query_id
stringlengths 32
32
| query
stringlengths 7
6.75k
| positive_passages
listlengths 1
1
| negative_passages
listlengths 88
101
|
---|---|---|---|
ca81f38726e4a037a759b6f377aa38be
|
Returns the latest date. Note that this returns a date that has the precision set, not the latest day.
|
[
{
"docid": "3cf1b68a45125369289675d482c7b690",
"score": "0.6077985",
"text": "def latest_raw\n @latest\n end",
"title": ""
}
] |
[
{
"docid": "3f85385599af7787daf822570e9f1656",
"score": "0.7635147",
"text": "def latest_date\n self.class.latest_date_from(self)\n end",
"title": ""
},
{
"docid": "40c9b5221b1e6de41611498d44b6999a",
"score": "0.7357057",
"text": "def latest_date\n swing_dates.maximum(:date)\n end",
"title": ""
},
{
"docid": "979a966d65bc91cc336cae879e796cf4",
"score": "0.7267948",
"text": "def get_latest_date\n latest_date = @exchange.order(:date).reverse.select(:date).first\n if latest_date == nil\n return nil\n end\n\n time = Time.at latest_date[:date]\n Date.parse time.to_s\n end",
"title": ""
},
{
"docid": "ffeac5962d3db497b16cdf7506c6dab3",
"score": "0.72236776",
"text": "def max_date\n Time.now.utc.to_date - 1\n end",
"title": ""
},
{
"docid": "e8301ea13cf3da9fe59baff8f82d9317",
"score": "0.7109459",
"text": "def latest_trade_date\n @latest_trade_date ||= self.trade_dates.max\n end",
"title": ""
},
{
"docid": "5f387741dd907b3a2185ac5944d7981e",
"score": "0.6824858",
"text": "def get_last_date\t\n\t\tlatest_order = self.mws_orders.order('last_update_date DESC').first\n\t\tif !latest_order.nil?\n\t\t\treturn latest_order.last_update_date.since(1)\n\t\telse\n\t\t\treturn Time.now.ago(60*60*3)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5f387741dd907b3a2185ac5944d7981e",
"score": "0.6824858",
"text": "def get_last_date\t\n\t\tlatest_order = self.mws_orders.order('last_update_date DESC').first\n\t\tif !latest_order.nil?\n\t\t\treturn latest_order.last_update_date.since(1)\n\t\telse\n\t\t\treturn Time.now.ago(60*60*3)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "d75ca0a7c7e886323af5cf0afb510751",
"score": "0.68169856",
"text": "def latest_date\n if time_keys.count == 1\n time_keys.first\n elsif time_keys.count == 2\n date1 = time_keys.first\n date2 = time_keys.second\n return date1 > date2 ? date1 : date2 # date1 > date2 => 'true' means date1 comes after date2\n else\n Date.today # arbitrary, but sensible for offset calculation in index.js.coffee\n end\n end",
"title": ""
},
{
"docid": "7621463620043bd5a466a8b979827cad",
"score": "0.6761082",
"text": "def newest_date(database)\n [database.updated_at, database.created_at].max\n end",
"title": ""
},
{
"docid": "2138800ad36be3a90b9d39f29568036c",
"score": "0.66947347",
"text": "def last_date\n return self.logs.order(\"timestamp DESC\").first\n end",
"title": ""
},
{
"docid": "e14d4e9cbc95e0b35cb7dbce3483bedc",
"score": "0.66855335",
"text": "def get_last_checked_date_for_products()\n\tlast_checked_date = Product.max(:updated_at)\n\tif last_checked_date.nil?\n\t\treturn Time.new(1970,1,1).iso8601\n\telse\n\t\treturn last_checked_date\n\tend\nend",
"title": ""
},
{
"docid": "55f83d27471d58b088da496eaaaca6dc",
"score": "0.6651099",
"text": "def highest\n return nil unless has_year?\n max_month = self.month || 12\n max_day = self.day || IncompleteDate.max_month_days(max_month, self.year)\n Date.civil(self.year, max_month, max_day)\n end",
"title": ""
},
{
"docid": "4f6d5e0e241a2ac038bbf8a1f6d0e04e",
"score": "0.6546748",
"text": "def last_import_date()\n log(2, 'Calculating UsageEntry.maximum(:date)', @loglevel)\n\n # This is an arbitrary date cut-off in the case of no pre-existing stats.\n import_date = UsageEntry.maximum(:date) || STARTDATE\n log(1, \"last import date: #{import_date}\", @loglevel)\n\n return import_date\n end",
"title": ""
},
{
"docid": "6b824a8301a2fc985587e37e8c64ed7e",
"score": "0.6531967",
"text": "def latest\n order(\"version_from desc\").first\n end",
"title": ""
},
{
"docid": "55c20197465660bf2a39779a3d071718",
"score": "0.64962727",
"text": "def lastDate( key = nil )\n last = @data.keys.max();\n if( key == nil ) then\n return last;\n end\n sortDates();\n @sortedDates.reverse_each(){\n |date|\n if( getByD( key, date ) != nil )then \n return date;\n end;\n }\n return nil;\n end",
"title": ""
},
{
"docid": "22d6877859065d87688313722322d8b1",
"score": "0.6494404",
"text": "def latest\n # TODO: Pull from proper created_at index\n all.max_by(&:created_at)\n end",
"title": ""
},
{
"docid": "62b94cde913f011c9645a80f235a3b35",
"score": "0.6485057",
"text": "def last_updated_at\n first_record = first\n return DEFAULT_DATE unless first_record\n\n first_record.date\n end",
"title": ""
},
{
"docid": "bb115b3588d259ffbfde9f795b70ab2c",
"score": "0.64281076",
"text": "def largest_valid_date\n today\n end",
"title": ""
},
{
"docid": "c84171593ebb04091a222c5034da026d",
"score": "0.6378297",
"text": "def last_version_date\n versions&.first&.dig(:created_at)\n end",
"title": ""
},
{
"docid": "452f7d8966590125f278a626046841c5",
"score": "0.6367033",
"text": "def last(day = nil)\n (day.nil?) ? Date.new(@date.year,@date.month,-1) : every(day).last\n end",
"title": ""
},
{
"docid": "286503bf298c93d0a8343414980f1e2b",
"score": "0.63362294",
"text": "def latest \n sort().last\n end",
"title": ""
},
{
"docid": "851dd2afcc49102f3936fab6cd97efd0",
"score": "0.6330252",
"text": "def latest\n result = nil\n each do |revision|\n result = revision if result.nil? || result.time < revision.time\n end\n result\n end",
"title": ""
},
{
"docid": "06354e2cbd6660e8328b3c55d7a77821",
"score": "0.6325247",
"text": "def last_invoice_date\n self.invoices.maximum('date_to') #.to_time rescue nil\n end",
"title": ""
},
{
"docid": "a376f3191ce5089838e4908f7874ac6d",
"score": "0.63112986",
"text": "def latest_eps\n annual_eps_newest_first.first\n end",
"title": ""
},
{
"docid": "770f6441f75c83ac0131e3696439e3b3",
"score": "0.6296971",
"text": "def latest_writing_date\n\t\t(self.additional.latest && self.additional.latest.complaint_writing_time) ?\n\t\t\t\tself.additional.latest.complaint_writing_time : nil\n\tend",
"title": ""
},
{
"docid": "1e9176db87182a2ce062c8b0dead7658",
"score": "0.62949526",
"text": "def latest\n @latest.latest if @latest\n end",
"title": ""
},
{
"docid": "2a929a847fea2d00268bc2bbd67a7a70",
"score": "0.6264768",
"text": "def entryMostRecent\n return nil if @data.size == 0\n \n max = DateTime.parse @data.sample['updated']\n @data.each {|idx|\n cur = DateTime.parse idx['updated']\n max = cur if max < cur\n }\n\n return max.iso8601\n end",
"title": ""
},
{
"docid": "8821a0f9e12da25f355997237de5854f",
"score": "0.6259422",
"text": "def latest_date_in_mountain_timezone\n Time.new(2017,1,1,0,0,0,'-07:00')\n end",
"title": ""
},
{
"docid": "a6c858bc4274c615f6c7358bcdfd4d6c",
"score": "0.62486285",
"text": "def last_known_calorie_date\n last_date = user.calorie_logs.maximum(:fitbit_date)\n (last_date || today_in_user_tz)\n end",
"title": ""
},
{
"docid": "0b6883c9cb217ed17cc92257d90fdb8e",
"score": "0.62409705",
"text": "def latest\n @latest ||= find(:first, :order => \"#{original_class.version_column} desc\")\n end",
"title": ""
},
{
"docid": "802092cbdbc70bef87a7311a17c47732",
"score": "0.62378955",
"text": "def newest(date)\n cc, yy = date.year.divmod(100)\n\n if @year < yy\n century(cc)\n elsif @year > yy\n century(cc - 1)\n else\n if @month < date.month\n century(cc)\n elsif @month > date.month\n century(cc - 1)\n else\n if @day <= date.day\n century(cc)\n else\n century(cc - 1)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "8235def508e81ef354c765099a1aed66",
"score": "0.6230753",
"text": "def last_target_date\n find_last_target[1].iso8601\n end",
"title": ""
},
{
"docid": "247df5263cb92e5d12a16a7296e78890",
"score": "0.62147176",
"text": "def latest_expression\n get_best_expression(language, points_in_time[-1].date)\n end",
"title": ""
},
{
"docid": "63b566f5b03cb331ee9ad2d27b375c63",
"score": "0.6207496",
"text": "def last_download\n downloads = Download.where(download_type: \"payments\").order(downloaded_at: :desc)\n downloads.empty? ? Date.new(2000,1,1).to_time : downloads.first.downloaded_at\n end",
"title": ""
},
{
"docid": "b8dbc6efa5359a3bf9939739ba6225d7",
"score": "0.62028396",
"text": "def last_concert\n self.concerts.maximum(:date).strftime(\"%Y - %B - %A\")\n end",
"title": ""
},
{
"docid": "af0127247cf1c9ec6b79176e67dbaa43",
"score": "0.62024224",
"text": "def get_max_date(collection)\n remove_nil_times(collection).max_by{|c| c[:time]}[:time]\n end",
"title": ""
},
{
"docid": "a4a01eb621dc00f1aff99d6ca14172cf",
"score": "0.620225",
"text": "def latest_due_date\n return due_date unless section_due_dates_type\n due_dates = assessment_section_properties.map(&:due_date) << due_date\n due_dates.compact.max\n end",
"title": ""
},
{
"docid": "8a3c9f4ed3434df5a7cce59af4025d40",
"score": "0.6195527",
"text": "def latest\n duplicate { |c| c.latest! }\n end",
"title": ""
},
{
"docid": "405e08bd08f993ab0e84de28c01ec59b",
"score": "0.61850655",
"text": "def last_post_date\n last_post.to_date.to_s :long\n end",
"title": ""
},
{
"docid": "e2f24fd6f58ea401c8519c288bea35b9",
"score": "0.6150104",
"text": "def latest_charge_end_date\n if storage_charges.size == 0 || storage_charges.last.end_date.nil?\n return charging_start_date ? charging_start_date.to_date - 1 : nil\n else\n return storage_charges.last.end_date.to_date\n end\n end",
"title": ""
},
{
"docid": "0736fe94e1d431d7e5af16dd0cc8b085",
"score": "0.6145056",
"text": "def maximum_invoice_date\r\n invoices.maximum(:date)\r\n end",
"title": ""
},
{
"docid": "841ba26e036e1d5ec160fa26ae7d78fd",
"score": "0.61422545",
"text": "def date(days_back=0)\n dates(days_back+1).last\n end",
"title": ""
},
{
"docid": "4b0d46fe48bfe989f183723da20292c9",
"score": "0.6112677",
"text": "def get_latest_checkin_date\n program_players=self.get_program_players\n if program_players.nil?\n return ''\n else\n dates=program_players.collect{|pp| pp.last_checked_in}.reject{|d| d.nil?}\n return (dates.empty?) ? '' : dates.max.strftime('%Y-%m-%d')\n end\n end",
"title": ""
},
{
"docid": "ec4431f132238cf91be99df76997bb1e",
"score": "0.61084133",
"text": "def latest_version\n versions.last\n end",
"title": ""
},
{
"docid": "9970bef95e5f533088fd359a410a0e08",
"score": "0.6102712",
"text": "def latest_version\n x = order(version: -1).limit(1).first\n x.nil? ? '00000000000000' : x.version\n end",
"title": ""
},
{
"docid": "9970bef95e5f533088fd359a410a0e08",
"score": "0.6102712",
"text": "def latest_version\n x = order(version: -1).limit(1).first\n x.nil? ? '00000000000000' : x.version\n end",
"title": ""
},
{
"docid": "480c53e0528573ed45646b775591232b",
"score": "0.60997254",
"text": "def latest_activity_date\n end",
"title": ""
},
{
"docid": "0370eb38c82c02d608d733874d3497ec",
"score": "0.60813874",
"text": "def last_day\n if @next_day.nil?\n return self.day\n else\n return @next_day.last_day\n end\n end",
"title": ""
},
{
"docid": "63e0ec314783eea9976721e4e3f3c9f6",
"score": "0.6044135",
"text": "def max\n convert_date @max\n end",
"title": ""
},
{
"docid": "d84626160000026b050cffb7d927cde3",
"score": "0.6028902",
"text": "def latest_revision\n return @latest_revision if @latest_revision\n configuration.logger.debug \"querying latest revision...\"\n @latest_revision = cvs_log(configuration.local,configuration.branch).\n split(/\\r?\\n/).\n grep(/^date: (.*?);/) { Time.parse($1).strftime(\"%Y-%m-%d %H:%M:%S\") }.\n sort.\n last\n end",
"title": ""
},
{
"docid": "0fe6fe89672eb1e2305f45972b95a5a7",
"score": "0.6003922",
"text": "def to_date\n @to_date ||= self.query.max(:accession_date)\n end",
"title": ""
},
{
"docid": "0fe6fe89672eb1e2305f45972b95a5a7",
"score": "0.6003922",
"text": "def to_date\n @to_date ||= self.query.max(:accession_date)\n end",
"title": ""
},
{
"docid": "3a1d7d8660f39b50129e75766376ca43",
"score": "0.6003693",
"text": "def last_collection\n dates = self.round_plans.map { |rp| rp.last_collection }\n last_date = dates.max\n end",
"title": ""
},
{
"docid": "38de825c73e67c835b4ab3299b8cf742",
"score": "0.60018075",
"text": "def most_recent_eps\n eps.sort_by{ |e| [e.year,e.quarter] }.last\n end",
"title": ""
},
{
"docid": "2e1efad3b4d668f37cd36fbf821330da",
"score": "0.5996492",
"text": "def latest\n @latest ||= releases.first\n end",
"title": ""
},
{
"docid": "f8f724d7053f01ced38004da443d2496",
"score": "0.5977066",
"text": "def best_day\n most_sold = successful_invoice_items.max_by { |invoice_item| invoice_item.quantity }\n date = most_sold.invoice.created_at\n Date.parse(date)\n end",
"title": ""
},
{
"docid": "5a9271d2be2c003c386bc01de076918f",
"score": "0.5975004",
"text": "def latest_build\n builds[-1]\n end",
"title": ""
},
{
"docid": "37dd0ba656012cba8eb6a1a6e08f85f6",
"score": "0.5973173",
"text": "def last_day\n end_date + 1.day\n end",
"title": ""
},
{
"docid": "37dd0ba656012cba8eb6a1a6e08f85f6",
"score": "0.5973173",
"text": "def last_day\n end_date + 1.day\n end",
"title": ""
},
{
"docid": "37dd0ba656012cba8eb6a1a6e08f85f6",
"score": "0.5973173",
"text": "def last_day\n end_date + 1.day\n end",
"title": ""
},
{
"docid": "c2c17ae22bce70c021fc2e97442e3d26",
"score": "0.5968936",
"text": "def last_edited\n self.latest_update.to_date\n end",
"title": ""
},
{
"docid": "f370ba5c5b1d1591956ed7dd5c64c256",
"score": "0.5950867",
"text": "def past\n newest(Date.today)\n end",
"title": ""
},
{
"docid": "03d664cbf2cc7ce6573fcf2a9b0d59c4",
"score": "0.5948732",
"text": "def latest_simulation_date_time\n return @latest_simulation_date_time\n end",
"title": ""
},
{
"docid": "285851c78c7db83ee80fbb496cca09ad",
"score": "0.5931902",
"text": "def get_most_recent_entry_date(items)\n begin\n return items[0].published_date if items && items[0]\n rescue\n nil\n end\n end",
"title": ""
},
{
"docid": "8fe5a24c890e8cab2f06bab471bed1f4",
"score": "0.59279937",
"text": "def get_last_checked_date_for_sales()\n\tlast_checked_date = RegisterSale.max(:sale_date)\n\tif last_checked_date.nil?\n\t\treturn Time.new(1970,1,1).iso8601\n\telse\n\t\treturn last_checked_date\n\tend\nend",
"title": ""
},
{
"docid": "b104564badd3e59e4f3b02940da6f7fd",
"score": "0.5926389",
"text": "def get_latest_event\n return Event.all.order(\"start_at desc\").limit(1)[0]\n end",
"title": ""
},
{
"docid": "b22a28152c0d5e97def89509d2136d78",
"score": "0.5923678",
"text": "def latest_offset\n offset_at(:latest)\n end",
"title": ""
},
{
"docid": "451ea899ab45958f8b40a0b758bfeac1",
"score": "0.5908245",
"text": "def latest_version\n @latest_version ||= begin\n # Versions before 70 do not have a LATEST_RELEASE file\n return normalize_version('2.41') if release_version < normalize_version('70')\n\n latest_applicable = with_cache(file_name) { latest_point_release(release_version) }\n\n Webdrivers.logger.debug \"Latest version available: #{latest_applicable}\"\n normalize_version(latest_applicable)\n end\n end",
"title": ""
},
{
"docid": "451ea899ab45958f8b40a0b758bfeac1",
"score": "0.5908245",
"text": "def latest_version\n @latest_version ||= begin\n # Versions before 70 do not have a LATEST_RELEASE file\n return normalize_version('2.41') if release_version < normalize_version('70')\n\n latest_applicable = with_cache(file_name) { latest_point_release(release_version) }\n\n Webdrivers.logger.debug \"Latest version available: #{latest_applicable}\"\n normalize_version(latest_applicable)\n end\n end",
"title": ""
},
{
"docid": "29770371b8961f65a3c4de18b0cd4794",
"score": "0.59054637",
"text": "def latest\n Time.current + 1.second\n end",
"title": ""
},
{
"docid": "3363cb95e9f51429d2b806f62aacb3f3",
"score": "0.59020054",
"text": "def get_latest_revision\n return get_revision(latest_revision_number())\n end",
"title": ""
},
{
"docid": "45a0bb58f245fe7b5a65c543594cd563",
"score": "0.5900819",
"text": "def actualization_date\n [ updated_at, timetable.updated_at, Date.new(2014,4,22).to_time ].compact.max\n end",
"title": ""
},
{
"docid": "296080b70443f7426ca3f55e362a75cb",
"score": "0.5898295",
"text": "def most_recent_membership_last_day(user)\n most_recent_membership(user)&.last_day&.to_date\n end",
"title": ""
},
{
"docid": "ffd37bb76831a0330aca544af3330fc5",
"score": "0.5898255",
"text": "def latest_definite\n return Time.now.to_date if is_ongoing?\n return bote if bote\n return next_period.botb if direct_transfer? && next_period.beginning && next_period.beginning.same?\n return eotb if eotb\n return nil\n end",
"title": ""
},
{
"docid": "5d2a9984e80374e82b28d7da753f61c6",
"score": "0.5895717",
"text": "def latest_standard_version\n standard_versions.last\n end",
"title": ""
},
{
"docid": "8772d16eda3e417890afa32e4db47143",
"score": "0.58646154",
"text": "def last_day(options={})\n recs = records options\n if recs.last\n d_id = d_id_from_file(recs.last)\n time = day_id_to_time d_id if d_id\n return time\n end\n return nil\n end",
"title": ""
},
{
"docid": "1d5e31febe0a4cd35dff6c80bee2c2a9",
"score": "0.5863931",
"text": "def last_tweet_date\n arr = self.last_tweet_array.sort { |a,b| a.created_at <=> b.created_at }\n return arr[-2].created_at\n end",
"title": ""
},
{
"docid": "42834f382b0d20863c2fc8a49ff1d462",
"score": "0.5853764",
"text": "def most_recent_value; @value; end",
"title": ""
},
{
"docid": "0ad6822bf1d57aa8bf5cc4cb9a893b40",
"score": "0.58484674",
"text": "def get_latest_conversion_date(base_currency, options = {})\n Ticker.latest_effective_date(base_currency)\n end",
"title": ""
},
{
"docid": "b1bf0c99f775c737273e3a0f3ac61a10",
"score": "0.5839198",
"text": "def get_date(card, max_date)\n card.release_date\n end",
"title": ""
},
{
"docid": "f6b4ab40831ed7d258c13524bae7f602",
"score": "0.58362025",
"text": "def latest\n debug \"pfsense: returning the latest #{@property_hash[:name].inspect} version #{@property_hash[:latest].inspect}\"\n @property_hash[:latest]\n end",
"title": ""
},
{
"docid": "a70bd7f8b80b5ee5eb2c3de49d4422f9",
"score": "0.5834547",
"text": "def latest\r\n\t\t@ary.last\r\n\tend",
"title": ""
},
{
"docid": "93a513c34899be60fc4a6173986f5f30",
"score": "0.5831409",
"text": "def get_last_date\n @RESPONSE_HASH['last_date']\n end",
"title": ""
},
{
"docid": "5d7f58e7c6a9b34c0540a262e4438ed5",
"score": "0.5822165",
"text": "def latest\n sort_by_date_from_file_name\n @files.last\n end",
"title": ""
},
{
"docid": "aa4030b6973df4b08fbeca7713e2fa43",
"score": "0.5812519",
"text": "def latest\n raise NotImplementedError.new\n end",
"title": ""
},
{
"docid": "c9fe949a57169434563b9f8f58d0348c",
"score": "0.58120453",
"text": "def get_latest_revision\n return get_revision(latest_revision_number)\n end",
"title": ""
},
{
"docid": "3aeaab48acb7d1499099c7d835286b72",
"score": "0.5811074",
"text": "def last_paid_visit_date\n v = Visit.where(status: PAID).where(\"billing_ref is not null\").order(:entry_ts).limit(1)\n return v[0].entry_ts.to_date rescue nil \n end",
"title": ""
},
{
"docid": "c5a83207eaf72f28910db7a4726633b0",
"score": "0.5810752",
"text": "def end_date\n entries.map { |e| Date.parse e.date }.sort.last\n end",
"title": ""
},
{
"docid": "350d3c9114eca3605ee5942edbb4acbb",
"score": "0.58095795",
"text": "def max_sprint_end_date\n s = project.sprints.find(:first, conditions: {}, sort: [:end_date, :desc])\n return s.end_date if s\n return nil\n end",
"title": ""
},
{
"docid": "6fa84ac229147b121cb22819b769de5d",
"score": "0.5807582",
"text": "def get_latest_login_date\n self.last_logged_in.nil? ? '' : self.last_logged_in.strftime('%Y-%m-%d')\n end",
"title": ""
},
{
"docid": "0dd126dc0f3da20a05c0e841ea672586",
"score": "0.5806301",
"text": "def newest\n @gems.last\n end",
"title": ""
},
{
"docid": "e246245a786d4683137f2ccd319b6948",
"score": "0.5792873",
"text": "def maximum_due_date\n evmbaselineIssues.maximum(:due_date)\n end",
"title": ""
},
{
"docid": "ae9c9daf9f46a301203fc17a1b2a4194",
"score": "0.5792402",
"text": "def get_latest_checkin_date\n c=self.checkins.order('created_at').last\n return c.nil? ? nil : c.created_at\n end",
"title": ""
},
{
"docid": "693371d40a7f961896153499d0cae926",
"score": "0.57898533",
"text": "def last\n @last ||= begin\n dd = @issue.history\n .reverse\n .find { |h| h[\"items\"].any? { |i| i[\"field\"] == \"duedate\" } }\n if dd.nil? && !@issue.duedate.nil?\n @when = @issue[\"created\"]\n dd = @issue.reporter\n else\n @when = dd[\"created\"]\n dd = Lazylead::User.new(dd[\"author\"])\n end\n dd\n end\n end",
"title": ""
},
{
"docid": "b8a01c45376907682aafb35fac608e6d",
"score": "0.57644665",
"text": "def latest\n debug \"returning the latest #{@property_hash[:name].inspect} version #{@property_hash[:latest].inspect}\"\n @property_hash[:latest]\n end",
"title": ""
},
{
"docid": "b8a01c45376907682aafb35fac608e6d",
"score": "0.57644665",
"text": "def latest\n debug \"returning the latest #{@property_hash[:name].inspect} version #{@property_hash[:latest].inspect}\"\n @property_hash[:latest]\n end",
"title": ""
},
{
"docid": "c9e48c9b4c7d45b4dd7ccef687459547",
"score": "0.5762599",
"text": "def latest_measurement\n @latest_measurement ||= current_user.measurements[-1]\n end",
"title": ""
},
{
"docid": "41b79aa7b4b40a284124402610d503b8",
"score": "0.57542956",
"text": "def most_recent_event\n recent_events.first\n end",
"title": ""
},
{
"docid": "bf42e3cdcb87f41e6b0cd56184dfda78",
"score": "0.5752653",
"text": "def fetch_oldest_date\n oldest_date = @company.oldest_ledger_date\n if oldest_date.blank?\n oldest_date = @company.accounts.minimum(:start_date)\n end\n oldest_date\n end",
"title": ""
},
{
"docid": "fb18d49d72fcdda649b3bebd233715e4",
"score": "0.5749461",
"text": "def newest_snapshot\n snapshots.sort_by(&:created_at).last\n end",
"title": ""
}
] |
e6dd902bd4bd00849b89f618f2810aea
|
Wraps get by default
|
[
{
"docid": "62b5b66d94ba8ac4a32a5e662fe2bee3",
"score": "0.0",
"text": "def query(query, use_valkyrie: Hyrax.config.query_index_from_valkyrie, **args)\n Rails.logger.warn rows_warning unless args.key?(:rows)\n method = args.delete(:method) || :get\n\n result = case method\n when :get\n get(query, use_valkyrie: use_valkyrie, **args)\n when :post\n post(query, use_valkyrie: use_valkyrie, **args)\n else\n raise \"Unsupported HTTP method for querying SolrService (#{method.inspect})\"\n end\n result['response']['docs'].map do |doc|\n ::SolrHit.new(doc)\n end\n end",
"title": ""
}
] |
[
{
"docid": "182a6f9ecce3cdd7657cc4aabdbbebea",
"score": "0.7566537",
"text": "def method_missing(method, *args, &block)\n get.send(method, *args, &block)\n end",
"title": ""
},
{
"docid": "9aaeec3e58f53a20213325646a695df8",
"score": "0.73352045",
"text": "def method_missing(method, *args, &block)\n get!(method)\n end",
"title": ""
},
{
"docid": "9aaeec3e58f53a20213325646a695df8",
"score": "0.73352045",
"text": "def method_missing(method, *args, &block)\n get!(method)\n end",
"title": ""
},
{
"docid": "0b6459b79b9af4ab9d00cb66d4c95f7e",
"score": "0.733375",
"text": "def get(opts={})\n raise NotImplementedError.new(\"get must be overridden!\")\n end",
"title": ""
},
{
"docid": "582c674078096710096c8f957a1cd8f8",
"score": "0.7329506",
"text": "def get *args; self; end",
"title": ""
},
{
"docid": "fac628c0018dad6c0ee482921fccff1a",
"score": "0.72543794",
"text": "def method_missing(method, *args)\n self.send(default_method || :get).send(method, *args)\n end",
"title": ""
},
{
"docid": "eea1ae8bef506616ee5e0bca160f94b0",
"score": "0.72501653",
"text": "def method_missing(method, *args, &block)\n self.get.send(method, *args, &block)\n end",
"title": ""
},
{
"docid": "58a65f710187bbd7e7a1630afbafc6a4",
"score": "0.71816516",
"text": "def get(*args, &block); end",
"title": ""
},
{
"docid": "fe94472f7716b08301f6efcf5b29ec83",
"score": "0.71540654",
"text": "def get(*args, &block)\n end",
"title": ""
},
{
"docid": "bd335bd1512a822be3d75f22f0cedb1d",
"score": "0.7106526",
"text": "def get(method, params={})\n call method, params, :get\n end",
"title": ""
},
{
"docid": "e6e685419b788c0c817a85c1abd37307",
"score": "0.6963668",
"text": "def get(&block)\n @get = block\n end",
"title": ""
},
{
"docid": "e6e685419b788c0c817a85c1abd37307",
"score": "0.6963668",
"text": "def get(&block)\n @get = block\n end",
"title": ""
},
{
"docid": "3ad4fb19b540c12eb10046458d38fa9e",
"score": "0.69575256",
"text": "def get(*args)\n proxy.get(*args)\n end",
"title": ""
},
{
"docid": "5af1f99cc35d7fd64f510ee1c117bbb1",
"score": "0.69020444",
"text": "def get(*args)\n end",
"title": ""
},
{
"docid": "f24ee87614ba5dbbf923ca15ea4cbaaf",
"score": "0.6878684",
"text": "def http_get\n set :httpget, true\n http :GET\n end",
"title": ""
},
{
"docid": "9d4a27a7b2ed4d844162111f1a1729a5",
"score": "0.6878652",
"text": "def get; end",
"title": ""
},
{
"docid": "9d4a27a7b2ed4d844162111f1a1729a5",
"score": "0.6878652",
"text": "def get; end",
"title": ""
},
{
"docid": "9d4a27a7b2ed4d844162111f1a1729a5",
"score": "0.6878652",
"text": "def get; end",
"title": ""
},
{
"docid": "9d4a27a7b2ed4d844162111f1a1729a5",
"score": "0.6878652",
"text": "def get; end",
"title": ""
},
{
"docid": "9d4a27a7b2ed4d844162111f1a1729a5",
"score": "0.6878652",
"text": "def get; end",
"title": ""
},
{
"docid": "9d4a27a7b2ed4d844162111f1a1729a5",
"score": "0.6878652",
"text": "def get; end",
"title": ""
},
{
"docid": "3f8616b1d07a229912d449c023d6064c",
"score": "0.6859955",
"text": "def _get(_arg0); end",
"title": ""
},
{
"docid": "8f070e8df678b3b75f3cc4bd4739eddf",
"score": "0.6826",
"text": "def fetch(*args)\n _original_get(*args)\n end",
"title": ""
},
{
"docid": "a5c978dae57504bb70af79e6547a4c55",
"score": "0.6823896",
"text": "def get\n raise \"needs to be redefined\"\n end",
"title": ""
},
{
"docid": "4fd9c69a221761129b895891fda80f60",
"score": "0.6805366",
"text": "def method_missing(message, *args, &block)\n return get(Regexp.last_match(1).to_sym, *args, &block) if message.to_s.match?(/^get_(.*)/)\n super # if we don't find a match then we'll call the top level `BasicObject#method_missing`\nend",
"title": ""
},
{
"docid": "9dab212d7b735dcb52e667362632fbcd",
"score": "0.67852545",
"text": "def get\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "90da0a38cfe63cc3f5b801116b106804",
"score": "0.6734221",
"text": "def get(*args); self.resource.get(*args) end",
"title": ""
},
{
"docid": "b2f5e1a4d3b3d1bbb70ffff0dc3e8a3f",
"score": "0.67272806",
"text": "def get(additional_headers={}, &block)\n wrap(:_get, additional_headers, &block)\n end",
"title": ""
},
{
"docid": "2c166d630b806f66f924b7331103e64c",
"score": "0.6706892",
"text": "def get(key)\n call(key, [:get, key], read: true)\n end",
"title": ""
},
{
"docid": "ed6aaa8f188ffff348219cdbcd977cbe",
"score": "0.66835463",
"text": "def get\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "014495bfd421f36a583fca728258c8f7",
"score": "0.668261",
"text": "def get\n end",
"title": ""
},
{
"docid": "e65b9a1e5ebda3c5eddacfa4498aabfb",
"score": "0.66772217",
"text": "def get?; method == :get; end",
"title": ""
},
{
"docid": "f5de3a61f2ff9a3c3b5e239d62dc870e",
"score": "0.66493773",
"text": "def add_get(&block)\n @get_method = block\n \n add_generic_retrieve() unless @retrieve_method\n add_generic_confirm() unless @confirm_method\n add_generic_verify() unless @verify_method\n if @set_method != nil\n add_generic_update unless @update_method\n end \n end",
"title": ""
},
{
"docid": "318d8a08f8b4b47547b03a39738c7fa3",
"score": "0.6639642",
"text": "def get(key)\n # YOUR WORK HERE\n end",
"title": ""
},
{
"docid": "63b508aa78abce741e6de7142e177727",
"score": "0.66374755",
"text": "def get(*args)\n if !@doing_with_error_checking\n process_with_error_checking('get', *args)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "e6082ef39bdbb1be7d5d20613865de44",
"score": "0.6625262",
"text": "def add_get(&block)\n @get_function = block\n end",
"title": ""
},
{
"docid": "692a3dc95197ac9e1ab2553c7b822282",
"score": "0.6591974",
"text": "def get\n puts 'get'\n end",
"title": ""
},
{
"docid": "4db3055ae2ed420b5f3b1abc1e136e62",
"score": "0.6575341",
"text": "def get(*a, &b)\n raise NotImplementedError, \"must be implemented in subclasses\"\n end",
"title": ""
},
{
"docid": "c82fb82b043cc80df855c492d13709a9",
"score": "0.6560252",
"text": "def get\n \n end",
"title": ""
},
{
"docid": "9d8b832d68098271cad4080bb7ec7b7c",
"score": "0.65536755",
"text": "def get(*args)\n map(:GET, *args)\n end",
"title": ""
},
{
"docid": "0148289bc4369695575d66cdb7bd1a9b",
"score": "0.6547959",
"text": "def get(matcher, &handler)\n register(:get, matcher, &handler)\n end",
"title": ""
},
{
"docid": "a4582ff55751f2ce6f4befadd161dce6",
"score": "0.6532463",
"text": "def get()\n \n end",
"title": ""
},
{
"docid": "15a6a73989df4c4d94a6182c2abf1aba",
"score": "0.65280145",
"text": "def get(key)\n\t\t\t\t\tcall('GET', key)\n\t\t\t\tend",
"title": ""
},
{
"docid": "c2fa704abdbcec3a02b87b3c5806cefe",
"score": "0.64695394",
"text": "def get(key)\n\n end",
"title": ""
},
{
"docid": "0ffe5b55a5033d390fdd937f12242050",
"score": "0.6467345",
"text": "def get\n request_method('GET')\n end",
"title": ""
},
{
"docid": "7e4f2550cb8ada1cd5e16a0dbe490d07",
"score": "0.64661205",
"text": "def perform_get_between_hooks( *args )\n \n return undecorated_get( *args )\n \n end",
"title": ""
},
{
"docid": "552846695f407b1c088b9a209d0ea8c3",
"score": "0.6444768",
"text": "def method\n @method ||= :get\n end",
"title": ""
},
{
"docid": "7259a1add12c894092a45e21d130490c",
"score": "0.64278644",
"text": "def get\n end",
"title": ""
},
{
"docid": "7259a1add12c894092a45e21d130490c",
"score": "0.64278644",
"text": "def get\n end",
"title": ""
},
{
"docid": "7259a1add12c894092a45e21d130490c",
"score": "0.64278644",
"text": "def get\n end",
"title": ""
},
{
"docid": "5d27d8ba7a8660c73dd1ab078ffa7bf4",
"score": "0.64260674",
"text": "def get(r, c)\n \n end",
"title": ""
},
{
"docid": "7ff27665637b329c3179897c2d3dd927",
"score": "0.64154965",
"text": "def get?; end",
"title": ""
},
{
"docid": "7ff27665637b329c3179897c2d3dd927",
"score": "0.64154965",
"text": "def get?; end",
"title": ""
},
{
"docid": "7ff27665637b329c3179897c2d3dd927",
"score": "0.64154965",
"text": "def get?; end",
"title": ""
},
{
"docid": "d7fedb53ba96641f1d27b4241ef3fb6c",
"score": "0.63964313",
"text": "def get(path, options = {}, &block); add :get, path, options, &block end",
"title": ""
},
{
"docid": "01dac9a52a54320729befaac0ec99f6d",
"score": "0.63961834",
"text": "def get!\n result = get\n shift\n result\n end",
"title": ""
},
{
"docid": "e428257af6c3056da2e9989982cae816",
"score": "0.63866067",
"text": "def get(options = {})\n end",
"title": ""
},
{
"docid": "e428257af6c3056da2e9989982cae816",
"score": "0.63866067",
"text": "def get(options = {})\n end",
"title": ""
},
{
"docid": "e428257af6c3056da2e9989982cae816",
"score": "0.63866067",
"text": "def get(options = {})\n end",
"title": ""
},
{
"docid": "199a71b914564cb74cb7168092a7b369",
"score": "0.6376687",
"text": "def method_missing(m)\n get(m)\n end",
"title": ""
},
{
"docid": "b4ae0b3b4b86c675e75a82fe1e3dd4e8",
"score": "0.637279",
"text": "def get(inparams = {})\n block = @get_function\n instance_exec(inparams,&block)\n end",
"title": ""
},
{
"docid": "4aa842a06108e058aa3649c12c297eb2",
"score": "0.6370446",
"text": "def get(*args, &block)\n find_method_by_http_method('get').call(self, *args, &block)\n end",
"title": ""
},
{
"docid": "f3707f735489eb78451dc4691a9443fd",
"score": "0.6336924",
"text": "def get(source, *args, &block); end",
"title": ""
},
{
"docid": "94bd798a53cec63bc9eefbd413e74dda",
"score": "0.63357764",
"text": "def get(key)\n raise NoMethodError.new('get')\n end",
"title": ""
},
{
"docid": "7828b52714bd9cef4b6ef07bc694836c",
"score": "0.6332743",
"text": "def get_wrapper(parameter, instance)\n get(parameter, instance)\n rescue StandardError\n raise Templates::Exception::ParameterGetterException.new(self)\n end",
"title": ""
},
{
"docid": "05bfa1a98e4585740fb89c57465473b7",
"score": "0.6330395",
"text": "def get_or_else(&block)\n get\n end",
"title": ""
},
{
"docid": "925afab3fe10fa5f8e2f522c7b17ee4f",
"score": "0.63300735",
"text": "def multi_get(opts=[])\n raise NotImplementedError.new(\"multi_get must be overridden!\")\n end",
"title": ""
},
{
"docid": "d32dd6943a6506da65d6bbb07662fb56",
"score": "0.6328829",
"text": "def get\n invoke_with_info(GET_INFO)\n end",
"title": ""
},
{
"docid": "d32dd6943a6506da65d6bbb07662fb56",
"score": "0.6328829",
"text": "def get\n invoke_with_info(GET_INFO)\n end",
"title": ""
},
{
"docid": "446de89a7cff7859edd429aaa1ab4db4",
"score": "0.6324483",
"text": "def get(opts = {})\n verify_control_presence(\"get\")\n return @get_method.call(opts)\n end",
"title": ""
},
{
"docid": "47068dc139a363dad84a31b2228f740f",
"score": "0.6321496",
"text": "def get\n\t\tend",
"title": ""
},
{
"docid": "d11d147289e807b61b49bd226c53b5fd",
"score": "0.63207996",
"text": "def get!(headers=false); call_client(:get!, headers); end",
"title": ""
},
{
"docid": "dd65a67bdfea2793bd5c360d91c52529",
"score": "0.63207674",
"text": "def method_missing(meth, *args, &block)\n return self[meth] if has_key?(meth)\n super\n end",
"title": ""
},
{
"docid": "58863a6e25c04653699a7278bff8e82a",
"score": "0.6305134",
"text": "def get(key)\n \n end",
"title": ""
},
{
"docid": "beda988565bc49c87a3721dfa76a5074",
"score": "0.6302014",
"text": "def get(name,type)\n template(name, '', type,'get ')\n end",
"title": ""
},
{
"docid": "145053eb462506866811da17728dc260",
"score": "0.6299347",
"text": "def method\n @method || :get\n end",
"title": ""
},
{
"docid": "63821664fe163324e7741d57bae553ad",
"score": "0.62851167",
"text": "def get_wrapper()\n\t\treq = Net::HTTP::Get.new(@uri.request_uri)\n\t\tself.set_headers(req)\n\tend",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6280697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6280697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6280697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6280697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6280697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6280697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6280697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6280697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6280697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6280697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6280697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6280697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6280697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6280697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "a3125e92d390f9639ee941da77a3765f",
"score": "0.6280697",
"text": "def get(key); end",
"title": ""
},
{
"docid": "b9f92ef235d340fc328d57f8463b59fc",
"score": "0.6266412",
"text": "def get\n nil\n end",
"title": ""
},
{
"docid": "61019c1c4e46d88181e4ea133e142402",
"score": "0.62461317",
"text": "def get(obj, *args)\n handler(obj).get(obj, *args)\n end",
"title": ""
},
{
"docid": "3436550a3a31ad1f0acba722637f23d4",
"score": "0.62449974",
"text": "def perform_get( params = {} )\n wrapper do\n configure_request(:get) do |http, request|\n request.set_form_data( self.request( params ) )\n end\n\n with_cache( self.http_request, self.config.cache_expiration ) do\n self.get!\n end\n end\n end",
"title": ""
},
{
"docid": "dd00f1beca9be66c860deb540950ff14",
"score": "0.6244191",
"text": "def default_get fields = nil, context = nil\n call! :default_get, fields, context\n end",
"title": ""
},
{
"docid": "caf0db27e0c6bbdcff2b1fb861b43a3b",
"score": "0.6231425",
"text": "def get(matcher, &handler)\n register(:get, matcher, &handler)\n register(:head, matcher, &handler)\n end",
"title": ""
},
{
"docid": "fa9e2329d75701662b1673ba78447fdd",
"score": "0.62057966",
"text": "def get(*args)\n\t\tconn.get(*args)\n\tend",
"title": ""
},
{
"docid": "7f18bd7ab9f483c0ca7e453ec878a974",
"score": "0.6201892",
"text": "def get(proxy_name, method, *arguments)\n call(proxy_name, :\"get_#{method}\", *arguments)\n end",
"title": ""
},
{
"docid": "6a39bd20a1b617ab3e535b84d01e38df",
"score": "0.6197963",
"text": "def get?\n method == :get\n end",
"title": ""
},
{
"docid": "6a39bd20a1b617ab3e535b84d01e38df",
"score": "0.6197963",
"text": "def get?\n method == :get\n end",
"title": ""
}
] |
c2b9d764522d5c1ddbce38572595d7e1
|
only_valid is used to avoid recursion when a piece creates valid_moves
|
[
{
"docid": "13e4eb73ff4c9d93fc93ce49076f4111",
"score": "0.0",
"text": "def move_piece(start_pos, end_pos, only_valid: true)\n error_message = \"There's no piece at #{start_pos}\"\n raise MoveError, error_message if self[start_pos].is_a?(NullPiece)\n\n piece = self[start_pos]\n valid_ends = possible_end_positions(piece, only_valid)\n raise MoveError unless valid_ends.include?(end_pos)\n\n # Capture opponent's piece\n self[end_pos] = NullPiece.instance\n self[start_pos] = NullPiece.instance\n self[end_pos] = piece\n piece.pos = end_pos\n end",
"title": ""
}
] |
[
{
"docid": "c24e5ea3b22a96247facd1d3744a4825",
"score": "0.773761",
"text": "def valid_moves\n\n end",
"title": ""
},
{
"docid": "39669a417e696d4d73e21ab9301d83a1",
"score": "0.76501805",
"text": "def valid_moves # do this method with the board#dup and all that and check if in check. Hah, it is indeed very straightforward lol\n all_moves = moves\n all_moves.reject { |move| move_into_check?(move) } # damn code is easy to write when it's good this should just check if a move leaves you in check and if so reject all the moves for which this is true\n end",
"title": ""
},
{
"docid": "2a4c629e5f89c95e170dbe2f85cf9e7b",
"score": "0.7604395",
"text": "def valid_moves\n valid_moves = moves.reject do |move|\n move_into_check?(move)\n end\n\n valid_moves\n end",
"title": ""
},
{
"docid": "fa691ee7a6fb6ef0db6e9cf3e0673271",
"score": "0.75973964",
"text": "def valid_moves\n super\n end",
"title": ""
},
{
"docid": "96ea3d5f0357de52db65810890c6e45f",
"score": "0.7596345",
"text": "def valid_moves\n moves.reject {|move| move_into_check?(move)}\n end",
"title": ""
},
{
"docid": "248c529a965a558d0bba3730405804aa",
"score": "0.749071",
"text": "def valid_moves\n moves.reject { |end_pos| move_into_check?(end_pos) }\n end",
"title": ""
},
{
"docid": "3ac533413a4dbb1bff0be070104f8714",
"score": "0.7468006",
"text": "def pre_check_legal_moves(state)\n player = state[:player]\n piece_list = state[:pieces][player]\n move_list = []\n # Loop over pieces\n piece_list.each do |piece|\n move_list += piece.legal_moves(state)\n end\n move_list\n end",
"title": ""
},
{
"docid": "1b70da5f914475aef0c6549fe411a958",
"score": "0.73455644",
"text": "def valid_moves(from)\n piece = @board.at(from)\n if piece.king? || piece.knight?\n piece.moves.map do |move|\n to = relative_coords(from, move)\n to if possible_move?(to)\n end.compact\n elsif piece.pawn?\n pawn_valid_moves(from)\n else\n valid_moves_recursive(from)\n end\n end",
"title": ""
},
{
"docid": "dfb65e655427a347b521f0acb482c837",
"score": "0.72935283",
"text": "def valid_moves\n valid = []\n all_moves = self.moves\n\n all_moves.each do |end_pos|\n valid << end_pos unless move_into_check(end_pos)\n end\n \n valid\n end",
"title": ""
},
{
"docid": "4dad2fc310d833c65e28f00350784211",
"score": "0.7262661",
"text": "def valid_moves\n # call #moves of the object\n # self.moves.select\n end",
"title": ""
},
{
"docid": "07e97b3bc52c346c556ad4c5a52226de",
"score": "0.714383",
"text": "def get_valid_moves\n possible_moves.select do |dir, moves| \n moves.select! { |mov| check_bounds(mov[0], mov[1]) }\n !moves.empty? && move_directions.include?(dir)\n end\n end",
"title": ""
},
{
"docid": "753dc7e4a298f28b150310a538611d4e",
"score": "0.70049834",
"text": "def valid_moves(from)\n\tpossible_moves(from).select { |move| valid_position?(move) }\nend",
"title": ""
},
{
"docid": "af4b076654baf78c8cf56724a4d094f4",
"score": "0.6999737",
"text": "def could_be_valid_move?\n return @board_gfx.is_draggingpiece_valid?\n end",
"title": ""
},
{
"docid": "0d49dec16d715d8451dfbd21261c8a91",
"score": "0.6990173",
"text": "def valid_moves(from)\r\n\tpossible_moves(from).select { |move| valid_position?(move) }\r\nend",
"title": ""
},
{
"docid": "7884ae6ceb30382e0fef19a884fc4be4",
"score": "0.69243693",
"text": "def valid_moves(temp_board)\n moves.select do |end_pos|\n temp_board.valid_pos?(end_pos) && temp_board.empty?(end_pos)\n end\n end",
"title": ""
},
{
"docid": "934f6af2d6cfb3c5c95c0b67a89a9cef",
"score": "0.6881366",
"text": "def legal_moves\n # Fill this in\n end",
"title": ""
},
{
"docid": "afe17693de77012de24b89144138f510",
"score": "0.68794733",
"text": "def valid_moves(pos)\n valid_moves = []\n long = [-2,2]\n short = [1,-1]\n valid_moves += valid_moves_helper(pos, long, short)\n valid_moves += valid_moves_helper(pos, short, long)\n end",
"title": ""
},
{
"docid": "4728e08c0609c98b2011914a2eee13dc",
"score": "0.68399656",
"text": "def validMove(piece, newLocation)\n # piece can move to any empty adjacent space.\n # might need to account for placing pieces. can be counted as a fly move i guess \n\n if newLocation == nil || piece == nil\n return false\n end\n\n # check if its a fly move. \n if @player1.isActive\n if @player1.numPlayedPieces <= 3\n fly = true \n else\n fly = false\n end\n else\n if @player2.numPlayedPieces <= 3\n fly = true \n else\n fly = false\n end\n end\n\n\n #checks if space is empty:\n if newLocation.isEmpty()\n # check if its a fly move\n if fly\n # if its a fly and the target location is empty its allowed. \n return true\n elsif piece.location == nil\n return true\n else\n # should return true if the move is valid.\n return @board.isAdjacent(piece,newLocation)\n end\n else\n # should the space is not empty, the move is invalid\n return false\n end\n\n end",
"title": ""
},
{
"docid": "1a8149d401d6dedecf0655e3398e966d",
"score": "0.6824314",
"text": "def get_valid_moves(pos)\n piece = self[pos]\n color = piece.color\n potential_moves = piece.potential_moves\n valid_moves = []\n potential_moves.each do |to_pos|\n if self.valid_move?(pos, to_pos, color)\n valid_moves << to_pos\n end\n end\n valid_moves\n end",
"title": ""
},
{
"docid": "785c97e2d4e77ddcef77c48ab6dc9e0a",
"score": "0.68201476",
"text": "def valid_moves\n moves = []\n # If the floor is on the bottom or top floor, it can only go One Direction\n if @current_floor == 0\n # Has to go up\n # We can take up just this item\n @floors[@current_floor].items.compact.each do |item|\n new_building = self.dup\n destination_floor = new_building.floors[@current_floor+1]\n\n if destination_floor.can_have?([item])\n # Valid move\n new_building.floors[@current_floor].items[item] = nil\n new_building.floors[@current_floor+1].items[item] = item\n moves << new_building\n end\n end\n\n # Or we can take two items\n @floors[@current_floor].items.compact.permutation(2).each do |items|\n new_building = self.dup\n destination_floor = new_building.floors[@current_floor+1]\n\n if destination_floor.can_have?(items)\n # Valid move\n items.each do |item|\n new_building.floors[@current_floor].items[item] = nil\n new_building.floors[@current_floor+1].items[item] = item\n end\n moves << new_building\n end\n end\n elsif @current_floor == 3\n # Has to go down\n else\n # Can go up or down\n end\n\n moves\n end",
"title": ""
},
{
"docid": "eb7d9e1166739c0f38e417d4a12b0963",
"score": "0.67923343",
"text": "def valid_moves\n (slide_moves + jump_moves).select { |move| valid_move_seq?([move]) }\n end",
"title": ""
},
{
"docid": "4f3d9ddcb2adcf72a082f6176cc7d2ef",
"score": "0.67912644",
"text": "def valid_moves_recursive(from)\n piece = @board.at(from)\n piece.moves.inject([]) do |valid_moves, move|\n valid_moves.push(*repeated_move(from, move))\n end\n end",
"title": ""
},
{
"docid": "9f2927d68d411324cd77272a8ec8b1dc",
"score": "0.67721856",
"text": "def legal_move?(new_x, new_y)\n return false unless actual_move?(new_x, new_y)\n return_val = false\n piece_moved_start_x = x_position\n piece_moved_start_y = y_position\n piece_captured = nil\n piece_captured_x = nil\n piece_captured_y = nil\n # check if you are moving pawn in en passant capture of enemy pawn\n if type == PAWN && !square_occupied?(new_x, new_y)\n if (new_x - piece_moved_start_x).abs == 1 && (new_y - piece_moved_start_y).abs == 1\n piece_captured = game.get_piece_at_coor(new_x, piece_moved_start_y)\n piece_captured_x = new_x\n piece_captured_y = piece_moved_start_y\n end\n end\n # return false if move is invalid for this piece for any of the reasons checked in piece #valid_move?\n return false unless valid_move?(new_x, new_y)\n # If square is occupied, respond according to whether piece is occupied by friend or foe\n if square_occupied?(new_x, new_y)\n occupying_piece = game.get_piece_at_coor(new_x, new_y)\n return false if (occupying_piece.is_white && is_white?) || (!occupying_piece.is_white && !is_white?)\n # since player is trying to capture a friendly piece\n piece_captured = occupying_piece\n piece_captured_x = occupying_piece.x_position\n piece_captured_y = occupying_piece.y_position\n capture_piece(occupying_piece)\n end\n # only here do we update coordinates of piece moved, once we have saved all starting coordinates of piece moved and any piece it captured\n update(x_position: new_x, y_position: new_y)\n increment_move\n return_val = true unless game.check?(is_white)\n update(x_position: piece_moved_start_x, y_position: piece_moved_start_y)\n piece_captured.update(x_position: piece_captured_x, y_position: piece_captured_y) unless piece_captured.nil?\n decrement_move\n return_val\n end",
"title": ""
},
{
"docid": "5a643944a000d28cc785217c28f2212e",
"score": "0.6771186",
"text": "def valid_move?(move)\n # Array of all posiible moves , check the board and map out the possible moves from there.\n end",
"title": ""
},
{
"docid": "f9e370a92c5eeeb45a724fc53c516d15",
"score": "0.67582786",
"text": "def valid_moves(pos)\n valids = []\n MOVE_DIFFERENTIALS.each do |move_diff|\n valids << [(pos[0] + move_diff[0]), (pos[1] + move_diff[1])]\n end\n valids.select { |move| on_board?(move) }\n end",
"title": ""
},
{
"docid": "d315dd3f115cb4da7e4c4a43c5594d09",
"score": "0.6754565",
"text": "def is_move_valid(move)\n @moves.include? move\n end",
"title": ""
},
{
"docid": "f84d0a2c136ee0401fa11dd0797d6246",
"score": "0.6735492",
"text": "def valid_moves\n @pad.cells.select { |c| self.can_move?(*c.pos) }\n end",
"title": ""
},
{
"docid": "f5eda01d173e7b15fc7bac09368497bb",
"score": "0.6727738",
"text": "def legal_moves(state)\n move_list = pre_check_legal_moves(state)\n # # Eliminate moves which leave player in check\n # # move_list.delete_if { |move| check?(next_state(state, move)) }\n # move_list.each do |move| \n # if check?(next_state(state, move))\n # print \".\"\n # move_list.delete(move)\n # end\n # end\n move_list\n end",
"title": ""
},
{
"docid": "27bab5dc97e8467efa1aee24c94c46cb",
"score": "0.6727345",
"text": "def permissible(start, stop, piece, player)\r\n $board[start[0]][start[1]].nil? ? start_color = nil : start_color = $board[start[0]][start[1]].color\r\n $board[stop[0]][stop[1]].nil? ? stop_color = nil : stop_color = $board[stop[0]][stop[1]].color \r\n # Ensures player moving own piece\r\n if start_color != player\r\n puts \"Invalid selection!\"; return false\r\n end\r\n temp_board = temporary_board(start, stop)\r\n check = in_check(player, temp_board)\r\n # Ensures King not currently in check, or move places King in check\r\n if check == true\r\n puts ''\r\n puts \"Invalid move. King in check.\" ; return false \r\n end\r\n # Ensures player doesn't capture own piece\r\n if stop_color == player\r\n puts ''\r\n puts \"You cannot capture your own piece!\"; return false\r\n end\r\n # Permits en passant\r\n if piece.class == Pawn && $board[@prev_coord[0]][@prev_coord[1]].class == Pawn\r\n if @prev_delta_y == 2 && @prev_coord[1] == start[1] && @prev_coord[0] == stop[0] \r\n if (player == 'white' && stop[1] == @prev_coord[1] + 1) or (player == 'black' && stop[1] == @prev_coord[1] -1 )\r\n print \"En passant\"\r\n $board[@prev_coord[0]][@prev_coord[1]] = nil\r\n return true\r\n end\r\n end\r\n end\r\n #King hasn't moved yet, rook hasn't moved yet\r\n if piece.class == King and start[1] == stop[1] and (start[0] - stop[0]).abs == 2 and piece.turn == 0 #first rank King,king hasn't moved, \r\n if castle_valid(start, stop, piece, player)\r\n print \"Castling...\"\r\n return true\r\n end\r\n end\r\n # Ensures move is a valid combination for piece type\r\n if piece.valid_move(start, stop, $board) == false\r\n puts ''\r\n puts \"Invalid move!\" ; return false\r\n end\r\n return true\r\n end",
"title": ""
},
{
"docid": "1b601141c26b4cb3ba2caefe4e47345f",
"score": "0.67086154",
"text": "def validate\n\n if self[:from_coord].blank? && @possible_movers && @possible_movers.length > 1\n errors.add :notation, \"Ambiguous move #{notation}. Clarify as in Ngf3 or R2d4, for example\"\n return \n end\n\n if self[:notation] && ( self[:from_coord].blank? || self[:to_coord].blank? )\n errors.add :notation, \"The notation #{notation} doesn't specify a valid move\" and return \n end\n \n #ensure the validity of the coordinates we have whether specified or inferred\n [from_coord, to_coord].each do |coord|\n errors.add_to_base \"#{coord} is not a valid coordinate\" unless Chess.valid_position?( coord )\n end\n\n #verify allowability of the move\n \n errors.add_to_base \"No piece present at #{from_coord} on this board\" and return if !@piece_moving\n\n unless @piece_moving.allowed_moves(@board).include?( to_coord.to_sym ) \n errors.add_to_base \"#{@piece_moving.function} not allowed to move to #{to_coord}\" \n end\n\n #can not leave your king in check at end of a move\n #new_board= @board.consider_move( Move.new( :from_coord => from_coord, :to_coord => to_coord ) )\n #if new_board.in_check?( @piece_moving.side )\n # errors.add_to_base \"Can not place or leave one's own king in check - you may as well resign if you do that !\" \n #end\n\n end",
"title": ""
},
{
"docid": "159281c687dbcbdcefd7e9a2dbe943f9",
"score": "0.66875106",
"text": "def moving_into_check(piece, valid_moves)\n valid_not_in_check = []\n old_position = piece.position\n\n # for each possible move, try it and test if in check, if so need to delete\n valid_moves.each do |test_position|\n move_piece([old_position, test_position])\n change_player\n if opponent_in_check(player.colour)\n valid_not_in_check.delete(test_position)\n undo_opponent_check(player.colour)\n else\n valid_not_in_check << test_position\n end\n change_player\n undo_move(test_position)\n end\n valid_not_in_check\n end",
"title": ""
},
{
"docid": "26a3615cf47f52da0dc7a21acdf473d3",
"score": "0.664284",
"text": "def valid_moves(starting_position, board, owner)\n next_pos = [starting_position[0] + @move[0], starting_position[1] + @move[1]]\n return non_slide_move(next_pos, board, owner) unless @sliding\n\n generate_slide_moves(next_pos, board, owner)\n end",
"title": ""
},
{
"docid": "75b2c03a4c2b970a232964cfaa450929",
"score": "0.66372794",
"text": "def valid_squares(move_array, piece)\n new_move_array = []\n move_array.each do |direction_array|\n # check coords on board\n direction_array.select! { |coord| (coord[0].between?(0, 7) && coord[1].between?(0, 7)) }\n # valid moves blocked by pieces and add valid attack squares\n direction_array.each do |move_square|\n square = @board_obj.board[move_square[0]][move_square[1]]\n\n if piece.instance_of?(Pawn)\n # case for pawn side takes\n if piece.position[1] != move_square[1]\n if square != \" \"\n new_move_array << move_square if square.colour != piece.colour\n elsif enpassant_square(move_square)\n new_move_array << move_square\n end\n break\n # case if piece in way \n elsif square != \" \"\n break\n end\n\n elsif square != \" \"\n new_move_array << move_square if square.colour != piece.colour\n break\n end\n new_move_array << move_square\n end\n end\n new_move_array\n end",
"title": ""
},
{
"docid": "d5575e15ff8e84f85888e650d9658852",
"score": "0.6636108",
"text": "def valid_moves\n moves = []\n\n # go in all directions\n (-1..1).each do |_x_step|\n (-1..1).each do |_y_step|\n # start walking in that direction\n (1..7).each do |steps|\n x = x_coordinate + steps * x_direction\n y = y_coordinate + steps * y_direction\n\n # stop walking if you hit a wall\n break unless valid_move?(x, y)\n\n # remember the valid moves\n moves.push(Move.new(x, y))\n end\n end\n end\n moves\n end",
"title": ""
},
{
"docid": "45da895554dd0c59d27007457befc8cd",
"score": "0.6587092",
"text": "def valid_move?(from, to, pieces)\n # check if move is forward for plain piece (not king)\n row = Game.index_to_row(from)\n if Game.is_king?(pieces[from-1]) # kings can go in both direction\n return false if (row + 1 != Game.index_to_row(to)) and (row - 1 != Game.index_to_row(to)) \n elsif Game.is_red?(pieces[from-1])\n return false if row + 1 != Game.index_to_row(to)\n elsif Game.is_white?(pieces[from-1]) and !Game.is_king?(pieces[from-1]) # kings can go in both direction\n return false if row - 1 != Game.index_to_row(to)\n end\n map = get_possible_moves_map\n map[from].include? to\n end",
"title": ""
},
{
"docid": "f55b4ff06b092e2cfcdfb3f67f50453f",
"score": "0.6574479",
"text": "def has_valid_piece?\n piece_to_move && right_piece_type? && right_piece_color?\n end",
"title": ""
},
{
"docid": "e9f67b8ad8a92031b24235955570c80d",
"score": "0.65303016",
"text": "def legal(coords)\n # How far piece moved from start position to end position\n distance_row = @row - coords[0]\n # if @first = true call first_move method\n if @first\n # steps for pawns first move\n first_move(coords, distance_row)\n else\n if @color == \"black\" && distance_row == 1\n legal_column(coords)\n elsif @color == \"white\" && distance_row == -1\n legal_column(coords)\n else\n puts \"greater than1.abs\"\n return false\n end\n end\n end",
"title": ""
},
{
"docid": "2aaed3eb9948edbd1fbf553accb33aea",
"score": "0.65206903",
"text": "def movement_validation(player_mov)\n\t\tcorrect_mov = []\n\t\tpiece_movs = {\n\t\t\t\"king\" => [[0,1], [1,1], [1,0], [1,-1], [0,-1], [-1,-1], [-1,0], [-1,1]],\n\t\t\t\"knight\" => [[-2,1], [-2,-1], [-1,-2], [1,-2], [2,-1], [2,1], [1,2], [-1,2]],\n\t\t\t\"rook\" => [[0,1], [1,0], [0,-1], [-1,0]],\n\t\t\t\"bishop\" => [[1,1], [1,-1], [-1,-1], [-1,1]],\n\t\t\t\"queen\" => [[0,1], [1,1], [1,0], [1,-1], [0,-1], [-1,-1], [-1,0], [-1,1]],\n\t\t\t\"pawn\" =>\t[[0,1], [0,-1], [1,1], [-1,1], [1,-1], [-1,-1], [0,2], [0,-2]]\n\t\t}\n\t\t\n\t\t#if the final move equals to one of the moves of the king or knight pieces.\n\t\tif [\"king\", \"knight\"].include?(@piece_name)\n\t\t\t#iterates through each basic move of the corresponding piece.\n\t\t\tpiece_movs[@piece_name].each do |mov|\n\t\t\t\t#if the final node color is nil or different from the start node color.\n\t\t\t\tif mov == player_mov && (@final_node.color != @current_player.color || @final_node.color == nil)\n\t\t\t\t\treturn true\n\t\t\t\t#if check analysis is in progress, the final node color equals to the current player color and the final node name is king.\n\t\t\t\telsif (mov == player_mov && @check_on_curse == true) && (@final_node.color == @current_player.color && @final_node.name == \"king\") \n\t\t\t\t\treturn true\t\t\t\t\n\t\t\t\tend\n\t\t\tend\n\t\t#if the final move equals to one of the moves of the rook, bishop or queen pieces.\n\t\telsif [\"rook\", \"bishop\", \"queen\"].include?(@piece_name)\n\t\t\t#iterates through each basic move of the corresponding piece.\n\t\t\tpiece_movs[@piece_name].each do |mov|\n\t\t\t\t#iterates through number 1 to 7 multiplying the basics pieces moves and saving it.\n\t\t\t\t(1..7).each do |num|\n\t\t\t\t\titeration = [mov[0]*num, mov[1]*num]\n\t\t\t\t\t#if the final move equals to multiplication of a basic move by a certain number and the way to the destination square is clear.\n\t\t\t\t\tif iteration == player_mov && cleared_way?(mov) == true\t\t\t\n\t\t\t\t\t\treturn true\t\t\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t#if start node name is a pawn piece.\n\t\telsif @piece_name == \"pawn\"\n\t\t\t#one positive rank move from a white piece to a nil node.\n\t\t\tif piece_movs[\"pawn\"][0].include?(player_mov) && (@final_node.color == nil && @start_node.color == \"white\")\n\t\t\t\treturn true\n\t\t\t#one negative rank move from a black piece to a nil code.\n\t\t\telsif piece_movs[\"pawn\"][1].include?(player_mov) && (@final_node.color == nil && @start_node.color == \"black\")\n\t\t\t\treturn true\t\n\t\t\t#a positive diagonal move from a white piece to a node of the opponent color.\t\n\t\t\telsif (piece_movs[\"pawn\"][2..3].include?(player_mov) && @start_node.color == \"white\") && (@final_node.color != @current_player.color && @final_node.color != nil)\n\t\t\t\treturn true\t\n\t\t\t#a negative diagonal move from a black piece to a node of the opponent color.\n\t\t\telsif (piece_movs[\"pawn\"][4..5].include?(player_mov) && @start_node.color == \"black\") && (@final_node.color != @current_player.color && @final_node.color != nil)\n\t\t\t\treturn true\n\t\t\t#a double positive rank move from a white piece on rank 2 position to a nil color node.\n\t\t\telsif (piece_movs[\"pawn\"][6] == player_mov && @final_node.color == nil) && (@start_node.color == \"white\" && @first_coord_convertion[1] == \"2\")\n\t\t\t\treturn true\n\t\t\t#a double negative rank move from a black piece on rank 7 position to a nil color node.\n\t\t\telsif (piece_movs[\"pawn\"][7] == player_mov && @final_node.color == nil) && (@start_node.color == \"black\" && @first_coord_convertion[1] == \"7\")\n\t\t\t\treturn true\t\n\t\t\tend\n\t\tend\n\t\treturn false\n\tend",
"title": ""
},
{
"docid": "82d29abc9c81570ba492d471fa136f19",
"score": "0.6500024",
"text": "def valid_move?(arr)\n arr[0] >= 0 && arr[0] <= 7 && arr[1] >= 0 && arr[1] <= 7 && @board[arr[0]][arr[1]][:piece].nil?\n end",
"title": ""
},
{
"docid": "1ee5d3e95032df2194517f42e43484e2",
"score": "0.6490631",
"text": "def valid_moves(pos)\n valid_moves =[]\n DELTAS.each do |delta_pair|\n valid_moves << [delta_pair[0] + pos[0], delta_pair[1] + pos[1]]\n end\n valid_moves.reject! { |coord| coord.any? { |x| x < 0 || x > 8} }\n end",
"title": ""
},
{
"docid": "f50318a203e0c0ebc88fcf8ea70670ba",
"score": "0.64437646",
"text": "def all_moves harmless\n\t\t# NOTE: harmless test disabled\n\t\tharmless = false\n\n\t\tmoves = {} \n\n\t\tif moved? or next_to_enemy?\n\t\t\tmoves[ :STAY ] = pos\n\t\t\treturn moves\n\t\tend\n\n\t\tlam = lambda do |dir| \n\t\t\t# Test movement of collective\n\t\t\tif can_pass? dir, false\n\t\t\t\tmoves[ dir ] = square.neighbor dir\n\t\t\tend\n\t\tend\n\n\t\t# Note that we don't bother with orientation so close to conflict\t\n\n\t\tif harmless\n\t\t\t$logger.info { \"#{ self } attackers harmless; staying is not an option\" }\n\t\telse\n\t\t\tmoves[ :STAY ] = square\n\t\tend\n\t\tlam.call :N\n\t\tlam.call :E\n\t\tlam.call :S\n\t\tlam.call :W\n\n\t\tif moves.empty?\n\t\t\t$logger.info \"We are stuck, apparently; staying anyway.\"\n\t\t\tmoves[ :STAY ] = square\n\t\tend\n\n\t\t$logger.info { \"possible moves: #{ moves }\" }\n\n\t\tmoves\n\tend",
"title": ""
},
{
"docid": "937f8e7f02e6fe0d16ecabb23acd5fbb",
"score": "0.6437318",
"text": "def valid_move?(from, to, player)\n if piece = player_piece?(from, player)\n unless player_piece?(to, player)\n return piece.valid_dest?(to, @board)\n end\n end\n false\n end",
"title": ""
},
{
"docid": "de9c5fe4c4e62b9d5381108cc29e908f",
"score": "0.6431408",
"text": "def is_move_valid(current_state, proposed_change)\n proposed_floor = current_state[:elevator] + proposed_change[:elevator]\n return false if proposed_change.length < 2 || proposed_change.length > 3\n return false if proposed_floor < 0 || proposed_floor > 3\n\n proposed_state = get_new_state(current_state, proposed_change)\n generators = []\n chips = []\n proposed_state[:floors][proposed_floor].each do |item|\n binding.pry if item == nil\n if item[0] == :gen\n generators << item[1]\n else\n chips << item[1]\n end\n end\n if generators.length > 0\n chips.each do |chip_type|\n return false if !generators.include?(chip_type)\n end\n end\n\n return false if @visited_states.include? proposed_state.to_s\n @visited_states << proposed_state.to_s\n # binding.pry\n proposed_state\nend",
"title": ""
},
{
"docid": "9379a9070ff7322037156a7a719b9738",
"score": "0.64178646",
"text": "def test_exposed_check_by_move\n board = ChessBoard.new\n piece = Knight.new(:white)\n board.add(piece, 'd4')\n\n board.add(King.new(:white), 'd1')\n board.add(Rook.new(:black), 'd8')\n\n refute(piece.valid_move?('d4', 'e6', board), 'Knight cannot expose king to check')\n end",
"title": ""
},
{
"docid": "bef95700d60bbbe704fa59ea6e34dd87",
"score": "0.64059156",
"text": "def special_pawn_rules(moved_piece, from_row, to_column)\n if en_passant_allowed?(moved_piece, from_row)\n moved_piece.allow_en_passant = true\n end\n\n if valid_en_passant_move?(moved_piece.color, from_row, to_column)\n @state[from_row][to_column] = nil\n end\n\n if promotion?(moved_piece)\n moved_piece.can_promote = true\n end\n\n moved_piece.moved = true\n end",
"title": ""
},
{
"docid": "61cfc8c58233ae0458b0168575b26218",
"score": "0.6405542",
"text": "def is_move_allowed(to_x,to_y) #Checks to see if the move is allowed based on the pieces 'rule'\n allowed=false\n \n x_diff=(to_x-@x).abs\n y_diff=(to_y-@y).abs\n \n if x_diff <=1 && y_diff <=1\n allowed= true\n end\n if x==to_x && y==to_y\n allowed = false\n end\n\n return allowed\n end",
"title": ""
},
{
"docid": "39a710f7d78bbd3052d86411b878aac9",
"score": "0.639993",
"text": "def allowed_moves(from_cell, chessboard)\n map_chess_move_array(from_cell, allowed_cells(from_cell, chessboard))\n end",
"title": ""
},
{
"docid": "1af587538d45d9fee69fc28fee53e570",
"score": "0.6396181",
"text": "def get_valid_moves\n # delta = color == :white ? 1 : -1\n pos = [position[0] + direction, position[1]]\n validated_moves = capture_spaces\n validated_moves << pos if valid_move?(pos)\n unless @moved || !validated_moves.include?(pos)\n\n pos = [position[0] + (2*direction), position[1]]\n validated_moves += valid_move?(pos) ? [pos] : []\n end\n\n validated_moves\n end",
"title": ""
},
{
"docid": "1649fbb24398da89627b4133e1ce8d75",
"score": "0.63653225",
"text": "def compile_legal_moves(square)\n (\"1\"..\"9\").each{|num| square.legal_moves << num if is_legal?(num, square) && !square.legal_moves.include?(num)}\n square.legal_moves\n end",
"title": ""
},
{
"docid": "d62398e3c267aa043e175337c4e014bf",
"score": "0.6362004",
"text": "def checkmoves(king, attacking_pieces, board )\n if self == king\n enemy_pieces = self.game.pieces.where('player_id != ?', king.player_id).where(captured_piece: false)\n king_moves = king.piece_can_move_to(board)\n enemy_pieces.each do |enemy_piece|\n if enemy_piece.type == \"Pawn\" #testing for if pawn is attacking square king could move to. wierd case since pawn cant move to this square unless an enemy piece is there to capture (take diagonal)\n pawn_test_spots = []\n if enemy_piece.game.black_player_id == enemy_piece.player_id\n pawn_test_spots = [[enemy_piece.y_position - 1,enemy_piece.x_position - 1],[enemy_piece.y_position - 1,enemy_piece.x_position + 1]]\n\n elsif enemy_piece.game.white_player_id == enemy_piece.player_id\n pawn_test_spots = [[enemy_piece.y_position + 1,enemy_piece.x_position - 1],[enemy_piece.y_position + 1,enemy_piece.x_position + 1]]\n end\n king_moves -= pawn_test_spots\n next\n end\n king_moves -= enemy_piece.piece_can_move_to(board)\n end\n return king_moves\n end\n\n return [] if attacking_pieces.length > 1 # can't defend from two attacking pieces unless king is moved\n\n current_piece = self\n current_piece_moves_avail = current_piece.piece_can_move_to(board)\n enemy_piece = attacking_pieces[0] # since only one piece is attacking, we should rename this\n current_piece_moves_avail = current_piece_moves_avail & (enemy_piece.piece_can_move_to(board) + [[enemy_piece.y_position,enemy_piece.x_position]])# finding the squares these pieces can both move to\n\n prevent_check_moves = []\n\n current_piece_moves_avail.each do |square|\n y = square[0]\n x = square[1]\n play_board = Marshal.load(Marshal.dump(board))\n play_board[self.y_position][self.x_position] = 0\n play_board[y][x] = self.player_id\n # enemy piece should have x,y such that board[y][x] should equal to enemy player.id\n if play_board[enemy_piece.y_position][enemy_piece.x_position] == self.player_id\n prevent_check_moves << square\n next\n end\n prevent_check_moves << square if !enemy_piece.piece_can_move_to(play_board).include?([king.y_position,king.x_position])\n end\n return prevent_check_moves\n\n end",
"title": ""
},
{
"docid": "1a6f6bc987751d47c4d0974b80dbff74",
"score": "0.63540083",
"text": "def valid_move?(from_row, from_column, to_row, to_column)\n piece = @state[from_row][from_column]\n return false if piece == nil\n\n new_location = [to_row, to_column]\n return false unless piece.moves.include? new_location\n\n return pawn_valid_move?(piece, new_location, to_column, from_column) if\n piece.class == Pawn\n\n return false unless empty_location?([to_row, to_column]) || \n enemy_piece_at_location?(piece.color, new_location)\n\n unless piece.class == Knight || piece.class == King\n return no_pieces_in_between?(from_row, from_column, to_row, to_column)\n end\n\n true\n end",
"title": ""
},
{
"docid": "5fbd3d3876a45305a2dfff6225c66eed",
"score": "0.63533795",
"text": "def capturable_legal_moves(cords)\n square = board.get_square(cords)\n\n legal_moves = []\n\n square.movement.each { |move| legal_moves << move unless illegal_move?(cords, move) }\n\n legal_moves -= illegal_pawn_moves(cords) if square.piece.is_a? Pawn\n legal_moves += en_passant_moves(cords)\n legal_moves += castling_moves(cords)\n\n legal_moves\n end",
"title": ""
},
{
"docid": "b982ed2acbd8b8c6b19ebf422a71ff9e",
"score": "0.6331652",
"text": "def moves_available?(player)\n !@board.moves(player).empty?\n end",
"title": ""
},
{
"docid": "d1c11a6ef7d302b05f3075b7a407f815",
"score": "0.63269144",
"text": "def normal_moves\n direction = NORMAL_MOVES[self.color]\n \n [check_validity(direction)]\n \n if pos_valid \n item_at_pos = @board.get_piece(current_row,current_col)\n \n if item_at_pos.nil? || item_at_pos.color != self.color\n [current_row, current_col]\n end\n end\n \nend",
"title": ""
},
{
"docid": "6f8f4e7d0f7b76deeaca33008dd995c5",
"score": "0.63251007",
"text": "def list_legal_moves(color)\n # Find all of the pieces of the given color.\n current_positions = @board.grid.flatten.select { |square| !square.piece.nil? && square.piece.color == color }\n # Generate a hash of all of the moves that each piece can take.\n total_moves = {}\n current_positions.each do |position|\n piece = position.piece\n move_list = piece.list_moves(position)\n total_moves[piece] = {pos_i: position, moves: move_list}\n end\n # Iterate through the hash, and for each piece:\n # 1) Record its initial position.\n # 2) For each move in its move list:\n # a) Save the piece that is currently located at the move position.\n # b) Move the piece from its initial position to the move position.\n # c) Determine whether making this move will result in check for the current player.\n # d) Reset the pieces at the initial position and the move position \n # back to their state before making the move.\n # e) If the move doesn't result in check, keep the move; otherwise, delete the move.\n total_moves.each do |piece, values|\n pos_i = values[:pos_i]\n legal_moves = values[:moves].select do |pos_f|\n piece_f = pos_f.piece\n\n # Pass the Board#move_piece method the names of the start and stop positions.\n @board.move_piece(color, pos_i.name, pos_f.name)\n check?(color) ? valid = false : valid = true\n\n pos_f.piece = piece_f\n pos_i.piece = piece\n valid\n end\n values[:moves] = legal_moves\n end\n return total_moves\n end",
"title": ""
},
{
"docid": "af3fb72c14db2a4a87222ec701b94798",
"score": "0.6303658",
"text": "def move_piece(start, dest)\n\n determine_moves(start)\n\n #puts \"dest movem valid?: #{@spaces[start].moveset.include?(dest)}\"\n\n #puts \"dest atack valid?: #{@spaces[start].attackset.include?(dest)}\"\n return false if @spaces[start].color != @player || \n @spaces[start].moveset.include?(dest).! and @spaces[start].attackset.include?(dest).!\n\n #TODO #return false if in_check\n\n @spaces[dest] = @spaces[start]\n\n @spaces[dest].location = dest\n\n @spaces[start] = nil\n\n return true\n\n end",
"title": ""
},
{
"docid": "8732ff0f585e29223d9d27bd9f472f6b",
"score": "0.63003844",
"text": "def valid_move?\n\t\t# Now let's make sure all of the moves are valid.\n\t\t# I'll do this by seeing if the sorted version of each\n\t\t# column equals the @board version.\n\t\ttemp_board = Marshal.load(Marshal.dump(@board))\n\t\ttemp = temp_board[@move_from].shift\n\t\ttemp_board[@move_to].unshift(temp)\n\n\t\ttemp_board.each do |column|\n\t\t\tif column.sort != column\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\n\t\t# If they all pass, we're good!\n\t\treturn true\n\tend",
"title": ""
},
{
"docid": "7a4ee18fccae44fda187568d8a942da7",
"score": "0.6295385",
"text": "def make_move(player)\n while true \n from, to = player.get_move\n break if valid_move?(from, to, player)\n puts \"Invalid move\"\n end\n move_piece(from, to)\n end",
"title": ""
},
{
"docid": "bd36f6a2dbace43c9055ba7c579c7c6d",
"score": "0.62950104",
"text": "def valid_move?(board, i)\n if i.between?(0,8) && !position_taken?(board, i)\n true\n end\n end",
"title": ""
},
{
"docid": "7db91b3562281676b3892b25be117aab",
"score": "0.62818176",
"text": "def legal_move?(board,from,to)\n\t\treturn false unless super(board,to)\n\t\tfrom_y = from[1]\n\t\tfrom_x = from[0]\n\t\tto_y = to[1]\n\t\tto_x = to[0]\n\t\t#when trying to move diagonally\n\t\tif from_x != to_x\n\t\t\t#checks colour of pawn\n\t\t\tif colour == \"white\"\n\t\t\t\t#checks only 1 vertical move away\n\t\t\t\tif (from_y-to_y) == 1\n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\tputs \"No enemy pawn there\"\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tif (to_y-from_y) == 1\n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\tputs \"No enemy pawn there\"\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\t#when trying to move straight\n\t\tif colour == \"white\"\n\t\t\tif from_y == 6\n\t\t\t\tif (from_y-to_y) <= 2 && board.get_piece(to) == \"_\"\n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\tputs \"Can only move 1 or 2 spaces from here and or another piece already there\"\n\t\t\t\t\treturn false\n\t\t\t\tend\t\t\t\t\t\n\t\t\telse\n\t\t\t\tif (from_y-to_y) == 1 && board.get_piece(to) == \"_\"\n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\tputs \"Can only move 1 space from here and or another piece already there\"\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\tif from_y == 1\n\t\t\t\tif (to_y-from_y) <= 2 && board.get_piece(to) == \"_\"\n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\tputs \"Can only move 1 or 2 spaces from here and or another piece already there\"\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tif (to_y-from_y) == 1 && board.get_piece(to) == \"_\"\n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\tputs \"Can only move 1 space from here and or another piece already there\"\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "5a224751744b0043837bb33ff529ccf9",
"score": "0.6279414",
"text": "def possible_moves(starting_position, actual_piece, turn = @turn, board = @board)\n row = starting_position[0]\n column = starting_position[1]\n potential_moves = []\n\n active_pieces = []\n enemy_pieces = []\n\n if turn == 1\n active_pieces = @w_pieces\n enemy_pieces = @b_pieces\n else\n active_pieces = @b_pieces\n enemy_pieces = @w_pieces\n end\n\n # moves available for white pawns\n if actual_piece == $w_pawn\n # if the white pawn is in its original spot, then it can move two spots or one spot\n return if row == 7\n\n if row == 1\n potential_moves << [row+1, column] if board[row+1][column] == ' '\n potential_moves << [row+2, column] if board[row+2][column] == ' '\n else\n potential_moves << [row+1, column] if board[row+1][column] == ' '\n end\n\n # can take black pieces, but only if they are available diagonally\n potential_moves << [row+1, column+1] if @b_pieces.include?(board[row+1][column+1])\n potential_moves << [row+1, column-1] if @b_pieces.include?(board[row+1][column-1])\n\n # can take black pawns under special en-passant rule\n if @en_passant_piece != []\n passant_row = invert_position_converter(@en_passant_piece)[0]\n passant_col = invert_position_converter(@en_passant_piece)[1]\n if passant_row == row && (passant_col == column + 1 || passant_col == column - 1)\n # it must be empty in order for us to do en-passant (otherwise the pawn can just take)\n if @board[passant_row+1][passant_col] = ' '\n potential_moves << [passant_row+1, passant_col]\n end\n end\n end\n end \n\n # moves available for black pawns\n if actual_piece == $b_pawn\n # if the black pawn is in its original spot, then it can move two spots or one spot\n return if row == 0\n\n if row == 6\n potential_moves << [row-1, column] if board[row-1][column] == ' '\n potential_moves << [row-2, column] if board[row-2][column] == ' '\n else\n potential_moves << [row-1, column] if board[row-1][column] == ' '\n end\n\n # can take white pieces\n potential_moves << [row-1, column+1] if @b_pieces.include?(board[row-1][column+1])\n potential_moves << [row-1, column-1] if @b_pieces.include?(board[row-1][column-1])\n\n # can take white pawns under special en-passant rule\n\n if @en_passant_piece != []\n passant_row = invert_position_converter(@en_passant_piece)[0]\n passant_col = invert_position_converter(@en_passant_piece)[1]\n if passant_row == row && (passant_col == column + 1 || passant_col == column - 1)\n if @board[passant_row-1][passant_col] = ' '\n potential_moves << [passant_row-1, passant_col]\n end\n end\n end\n end\n\n # moves available for rooks\n if actual_piece == $w_rook || actual_piece == $b_rook\n\n i_row = row\n i_col = column\n\n # returns all potential moves north of the starting position\n until i_row+1 == 8 || active_pieces.include?(board[i_row+1][i_col])\n if enemy_pieces.include?(board[i_row+1][i_col])\n potential_moves << [i_row+1,i_col]\n break\n else\n potential_moves << [i_row+1,i_col]\n end\n i_row += 1\n end\n \n i_row = row\n i_col = column \n\n # returns all potential moves south of the starting position\n until active_pieces.include?(board[i_row-1][i_col]) || i_row-1 == -1\n if enemy_pieces.include?(board[i_row-1][i_col])\n potential_moves << [i_row-1,i_col]\n break\n else\n potential_moves << [i_row-1,i_col]\n end\n i_row -= 1\n end\n\n i_row = row\n i_col = column\n \n\n # returns all potential moves right of the starting position\n until active_pieces.include?(board[i_row][i_col+1]) || i_col+1 == 8\n if enemy_pieces.include?(board[i_row][i_col+1])\n potential_moves << [i_row,i_col+1]\n break\n else\n potential_moves << [i_row,i_col+1]\n end\n i_col += 1\n end\n\n i_row = row\n i_col = column\n \n # returns all potential moves left of the starting position\n until active_pieces.include?(board[i_row][i_col-1]) || i_col-1 == -1\n if enemy_pieces.include?(board[i_row][i_col-1])\n potential_moves << [i_row,i_col-1]\n break\n else\n potential_moves << [i_row,i_col-1]\n end\n i_col -= 1\n end\n\n i_row = row\n i_col = column\n\n end\n\n # moves available for knights\n if actual_piece == $w_knig || actual_piece == $b_knig\n\n # returns all potential moves\n potential_moves << [row+2, column+1]\n potential_moves << [row+1, column+2]\n potential_moves << [row-1, column+2]\n potential_moves << [row-2, column+1]\n potential_moves << [row-2, column-1]\n potential_moves << [row-1, column-2]\n potential_moves << [row+1, column-2]\n potential_moves << [row+2, column-1]\n\n end\n\n # moves available for bishops\n if actual_piece == $w_bish || actual_piece == $b_bish\n\n i_row = row\n i_col = column\n\n # returns all potential moving north-east of the starting position\n\n until i_row+1 == 8 || i_col+1 == 8 || active_pieces.include?(board[i_row+1][i_col+1])\n if enemy_pieces.include?(board[i_row+1][i_col+1])\n potential_moves << [i_row+1,i_col+1]\n break\n else\n potential_moves << [i_row+1,i_col+1]\n end\n i_row += 1\n i_col += 1\n end\n \n i_row = row\n i_col = column \n\n # returns all potential moving south-east of the starting position\n until i_row-1 == -1 || i_col+1 ==8 || active_pieces.include?(board[i_row-1][i_col+1])\n if enemy_pieces.include?(board[i_row-1][i_col+1])\n potential_moves << [i_row-1,i_col+1]\n break\n else\n potential_moves << [i_row-1,i_col+1]\n end\n i_row -= 1\n i_col += 1\n end\n \n i_row = row\n i_col = column \n\n # returns all potential moving south-west of the starting position\n until i_row-1 == -1 || i_col-1 == -1 || active_pieces.include?(board[i_row-1][i_col-1])\n if enemy_pieces.include?(board[i_row-1][i_col-1])\n potential_moves << [i_row-1,i_col-1]\n break\n else\n potential_moves << [i_row-1,i_col-1]\n end\n i_row -= 1\n i_col -= 1\n end\n \n i_row = row\n i_col = column \n \n # returns all potential moving north-east of the starting position\n until i_row+1 == 8 || i_col-1 == -1 || active_pieces.include?(board[i_row+1][i_col-1])\n if enemy_pieces.include?(board[i_row+1][i_col-1])\n potential_moves << [i_row+1,i_col-1]\n break\n else\n potential_moves << [i_row+1,i_col-1]\n end\n i_row += 1\n i_col -= 1\n end\n \n i_row = row\n i_col = column \n\n end\n\n # moves available for queens\n if actual_piece == $w_quee || actual_piece == $b_quee\n if actual_piece == $w_quee\n potential_moves.concat(possible_moves(starting_position, $w_rook, turn = 1))\n potential_moves.concat(possible_moves(starting_position, $w_bish, turn = 1))\n end\n if actual_piece == $b_quee\n potential_moves.concat(possible_moves(starting_position, $b_rook, turn = 2))\n potential_moves.concat(possible_moves(starting_position, $b_bish, turn = 2))\n end\n end\n\n # moves available for kings\n if actual_piece == $w_king || actual_piece == $b_king\n i_row = row\n i_col = column\n\n potential_moves << [i_row+1, i_col]\n potential_moves << [i_row+1, i_col+1]\n potential_moves << [i_row, i_col+1]\n potential_moves << [i_row-1, i_col-1]\n potential_moves << [i_row-1, i_col]\n potential_moves << [i_row-1, i_col+1]\n potential_moves << [i_row, i_col-1]\n potential_moves << [i_row+1, i_col-1]\n\n # castling conditions\n # The king does not move over a square that is attacked by an enemy piece during the castling move, i.e., when castling, there may not be an enemy piece that can move (in case of pawns: by diagonal movement) to a square that is moved over by the king.\n\n # The king cannot be in check if they are trying to castle\n if !@check_condition\n if actual_piece == $w_king\n # checks for left rook potential\n if board[0][1] == ' ' && board[0][2] == ' ' && board[0][3] == ' '\n binding.pry\n if @w_king_move == \"not moved\" && @w_rook_left == \"not moved\"\n if !enemy_positions.include?([0, 3])\n potential_moves << [0, 2]\n end\n end\n #checks for right rook potential\n elsif board[0][5] == ' ' && board[0][6] == ' '\n if @w_king_move == \"not moved\" && @w_rook_right == \"not moved\"\n if !enemy_positions.include?([0, 5])\n potential_moves << [0, 6]\n end\n end\n end\n end\n if actual_piece == $b_king\n # checks for left rook potential\n if board[7][1] == ' ' && board[7][2] == ' ' && board[7][3] == ' '\n if @b_king_move == \"not moved\" && @b_rook_left == \"not moved\"\n if !enemy_positions.include?([7, 3])\n potential_moves << [7, 2]\n end \n end\n #checks for right rook potential\n elsif board[7][5] == ' ' && board[7][6] == ' '\n if @b_king_move == \"not moved\" && @b_rook_right == \"not moved\"\n if !enemy_positions.include?([7, 5])\n potential_moves << [7, 6] \n end\n end\n end\n end\n end\n\n end\n\n potential_moves = potential_moves.select { |pos| valid_move?(pos, turn)}\n\n potential_moves\n\n end",
"title": ""
},
{
"docid": "33bf960e9d42eb521c630c6b1ce057d6",
"score": "0.62710845",
"text": "def show_valid_moves\n @board = Board.new(session[:state])\n @board.show_valid_moves\n end",
"title": ""
},
{
"docid": "ad040bea13dc3820fd8b56e68cd162ba",
"score": "0.62699014",
"text": "def blocked(player)\n # check every piece on the board\n (0..23).each do |i|\n # if it's the player's piece check if it can move\n if @myPositions[i].player == player\n\n # if it can move up, down, left, or right then the player isn't blocked\n\t \t\tif @myPositions[i].up != nil && @myPositions[i].up.player == Controller::Player::NEUTRAL\n\t\t\t \treturn false\n end\n\n\t\t \tif @myPositions[i].down != nil && @myPositions[i].down.player == Controller::Player::NEUTRAL\n\t\t\t\t return false\n end\n\n\t\t\t if @myPositions[i].left != nil && @myPositions[i].left.player == Controller::Player::NEUTRAL\n\t\t\t\t return false\n end\n\n\t\t\t if @myPositions[i].right != nil && @myPositions[i].right.player == Controller::Player::NEUTRAL\n\t\t\t\t return false\n end\n end\n end\n\n\t # we must be blocked\n \treturn true\n end",
"title": ""
},
{
"docid": "f3d830fbdcd4edbf89df6671d8a7398e",
"score": "0.62580365",
"text": "def valid_moves(position)\n moves = []\n MOVES.each do |move|\n new_pos1 = move[0] + position[0]\n new_pos2 = move[1] + position[1]\n pos = [new_pos1, new_pos2]\n if pos.min >= 0 && pos.max < 9\n moves << pos\n end\n end\n moves\n end",
"title": ""
},
{
"docid": "4116b387525fcf9f32e5a879ab941848",
"score": "0.6254796",
"text": "def selected_valid_moves(x, y)\n return [] if self[x, y].nil?\n @selected_valids ||= self[x, y].valid_moves([x, y])\n end",
"title": ""
},
{
"docid": "26914b1d3129e2a20026cc5666a6ffb2",
"score": "0.6250267",
"text": "def check_valid(move)\n\n\t\tif @board[move[0]][move[1]] != \"-\"\n\t\t\treturn false\n\t\telse\n\t\t\treturn true\n\t\tend\n\n\tend",
"title": ""
},
{
"docid": "db3bf3d6827fa7b7caafe5276b31dbb6",
"score": "0.6248218",
"text": "def valid?(move)\n @board.valid_move?(move)\n end",
"title": ""
},
{
"docid": "2128ec8d28d24c77a38f9d65ec3b03b9",
"score": "0.6236348",
"text": "def legal_moves(color)\n moves = []\n\n # do on all_moves instead of all_normal_moves\n # check each piece replacement for unknown promotion\n\n # can use #select on all_possible_moves\n all_moves(color).filter do |m|\n # - make the move\n # - test if it result in a self check\n # - undo the move\n m.make(@board)\n moves << m unless in_check?(enemy)\n m.make(@board, true)\n end\n\n moves\n end",
"title": ""
},
{
"docid": "3ca2979eb85245eccea1d6d01fef45df",
"score": "0.6219933",
"text": "def no_player_can_move?\n !valid_move?(:black) && !valid_move?(:red)\n end",
"title": ""
},
{
"docid": "5ad772be533de575ad833960a32c2373",
"score": "0.62168604",
"text": "def check_mate(player)\n player_pieces = []\n if player.colour == \"BLACK\"\n player_pieces = @black_pieces\n elsif player.colour == \"WHITE\"\n player_pieces = @white_pieces\n else\n print \"ERROR\"\n end\n\n all_moves = []\n\n player_pieces.each do |piece|\n moves = allowed_moves(piece)\n all_moves << moving_into_check(piece, moves)\n end\n\n if all_moves.flatten.length.zero?\n puts \"******** CHECK MATE ********\"\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "72ef1859e57de393b7214b85446f7003",
"score": "0.62117136",
"text": "def valid_move?(board, position)\n position.between?(0, 8) && !position_taken?(board, position)\nend",
"title": ""
},
{
"docid": "49bf47139e9584b2a1b42de48a81f6ca",
"score": "0.62065417",
"text": "def valid_move?(destination)\n possible_moves.select do |move|\n on_board?(move) && open?(move)\n end\n\n possible_moves.include?(destination)\n end",
"title": ""
},
{
"docid": "51f9efa4572e37c73f849aa94a543ba8",
"score": "0.62013465",
"text": "def possible_moves\n # p possible_non_attack_moves\n # p possible_attack_moves\n moves = possible_non_attack_moves + possible_attack_moves\n moves.reject! { |move| move.any? { |c| c < 0 || c > 7} }\n moves\n end",
"title": ""
},
{
"docid": "b708a2300aca4b25f11094cff4af5cc8",
"score": "0.6199417",
"text": "def valid_move?(board, position)\n if !(position_taken?(board, position)) && position.between?(0, 8)\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "e26f7595e2b417a634cf4fe5b8e5c529",
"score": "0.6193704",
"text": "def valid_piece_movement?(coordinates)\n row = coordinates[:row]\n column = coordinates[:column]\n @active_piece.moves.any?([row, column]) || @active_piece.captures.any?([row, column])\n end",
"title": ""
},
{
"docid": "b3568cc038d74fc45cb0132afdfe1f4f",
"score": "0.6193314",
"text": "def pawn(p1)\n row = get_row_from_index(p1)\n col = get_col_from_index(p1)\n valid = []\n\n # Piece color defines direction of travel. Enemy presence defines\n # the validity of diagonal movements\n if @@color == \"red\"\n if unoccupied?(p1 - 8)\n valid << (p1 - 8)\n end\n if piece_color(p1 - 7) == @@enemy_color && col < 8\n valid << (p1 - 7)\n end\n if piece_color(p1 - 9) == @@enemy_color && col > 1\n valid << (p1 - 9)\n end\n # Only if the pieces is unmoved, can it move forward two rows\n if !@@pieces[p1][\"moved\"] && unoccupied?(p1 - 16) && unoccupied?(p1 - 8)\n valid << (p1 - 16)\n end\n elsif @@color == \"black\"\n if unoccupied?(p1 + 8)\n valid << (p1 + 8)\n end\n if piece_color(p1 + 7) == @@enemy_color && col > 1\n valid << (p1 + 7)\n end\n if piece_color(p1 + 9) == @@enemy_color && col < 8\n valid << (p1 + 9)\n end\n if !@@pieces[p1][\"moved\"] && unoccupied?(p1 + 16) && unoccupied?(p1 + 8)\n valid << (p1 + 16)\n end\n end\n\n return valid\n end",
"title": ""
},
{
"docid": "351edf59eed3bd6cad56fdebb740bac3",
"score": "0.61853576",
"text": "def valid_move?(board, i)\n i.integer? &&\n i <= 8 && i >= 0 &&\n !position_taken?(board, i)\nend",
"title": ""
},
{
"docid": "f5b9bddb6cb113fb7bb72a32aa9048e1",
"score": "0.61822605",
"text": "def valid_move?(board, i)\n # check if position taken or 'out-of-bounds'\n if (position_taken?(board, i) == true) || (i > 8) || (i < 0)\n return false\n else \n return true\n end \nend",
"title": ""
},
{
"docid": "632aa35c4b595d2167438a14639965d6",
"score": "0.6168425",
"text": "def valid_move?(board,index)\n if index.between?(0, 8) && !(position_taken?(board, index))\n true\n else \n false\n end\nend",
"title": ""
},
{
"docid": "5939c22b8464bc07bc0f9ab875927406",
"score": "0.6162509",
"text": "def valid_move?(board, position)\n position.to_i.between?(1,9) && !position_taken?(board,position.to_i-1)\n\nend",
"title": ""
},
{
"docid": "79e9f6ad0db2f7aeda97ff9cd99c1c0d",
"score": "0.61563146",
"text": "def move_piece(move)\n curr_piece = @board[move[0]]\n if curr_piece.non_check_moves.include?(move[1])\n #if en passant, remove captured piece\n if curr_piece.class == Pawn\n #puts curr_piece.can_en_passant?\n #puts \"HELKFDSJLFKD\"\n if curr_piece.can_en_passant?\n #puts \"HOMFDMSKFDFLSJFKDSLFJSDKLF JDSFKLSJFKLEJ FE FJSKLF\"\n rank = move[0][0]\n col = move[1][1]\n captured_pawn_pos = [rank,col]\n #puts captured_pawn_pos.inspect\n @board[captured_pawn_pos] = nil\n end\n end\n @board[move[1]] = curr_piece\n @board[move[0]] = nil\n curr_piece.move_history << move\n curr_piece.pos = move[1]\n #if castling, move rook too\n if curr_piece.class == King && (move[0][1] - move[1][1]).abs == 2\n #find the appropriate rook to move\n start_rank = move[0][0]\n start_file = move[1][1] == 2 ? 0 : 7\n start_pos = [start_rank, start_file]\n rook = @board[start_pos]\n #determine its final location, then move it.\n end_file = start_file == 0 ? 3 : 5\n end_pos = [start_rank, end_file]\n @board[end_pos] = rook\n @board[start_pos] = nil\n rook.move_history << end_pos\n rook.pos = end_pos\n end\n return true\n else\n puts \"Your king is still in check!\" if @board.in_check?(curr_piece.color)\n puts \"Not a legal move for this #{curr_piece.color} #{curr_piece.class}!\"\n puts\n return false\n end\n end",
"title": ""
},
{
"docid": "84cb09e9844636eab19388f06476f814",
"score": "0.61543125",
"text": "def valid_move?(board, position)\n !position_taken?(board, position) && position.between?(0,8)\nend",
"title": ""
},
{
"docid": "f214bf65938aaa82a8c4f96ebac807ac",
"score": "0.6152739",
"text": "def valid_move?(board, index)\n if index.between?(0,8) && !position_taken?(board, index)\n puts \"this is a valid move\"\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "81443fbfeeeb81a0b60e6b9f06eef0c0",
"score": "0.6149913",
"text": "def move_valid?\n @board.first_disk = 0\n\n #determine disk piece to be moved\n @board.board.each do |row, arr|\n if arr[@player.from] != 0\n @board.first_disk = arr[@player.from]\n break\n end\n end\n\n #determine the highest disk available in that column\n @board.board.each do |row, arr|\n if arr[@player.to] != 0\n @board.second_disk = arr[@player.to]\n break\n else\n @board.second_disk = arr[@player.to]\n end\n end\n\n #conditional test to see if move is valid\n if @board.first_disk == 0\n puts \"No disks in this column, try again\"\n get_input\n elsif @board.second_disk == 0 || @board.first_disk < @board.second_disk\n move_disk\n else\n puts \"Move is invalid\"\n puts \"Please check the rules and input a new move\"\n get_input\n end\n end",
"title": ""
},
{
"docid": "927b897747d122c434b09ea0c12e9708",
"score": "0.61484885",
"text": "def invalid_moves(moves, board)\n invalid = []\n moves.each do |y, x|\n unless board[y][x].nil?\n invalid << [y,x] if board[y][x].color == @color\n end\n end\n invalid\n end",
"title": ""
},
{
"docid": "22f7e42e80ed47a90b3e30fa27376d33",
"score": "0.6147878",
"text": "def move_valid?(x, y)\n coordinate_valid?(x, y) && !@visited[y][x]\n end",
"title": ""
},
{
"docid": "22f7e42e80ed47a90b3e30fa27376d33",
"score": "0.6147878",
"text": "def move_valid?(x, y)\n coordinate_valid?(x, y) && !@visited[y][x]\n end",
"title": ""
},
{
"docid": "e870d57da5b3789aa9c825257e8d7599",
"score": "0.6145907",
"text": "def valid_move?(board, index)\n index.between?(0,8) && !position_taken?(board, index) #if the position isn't taken and is on the board, the move must be valid\nend",
"title": ""
},
{
"docid": "c509740437707f8698a27ac88e4ab665",
"score": "0.6141651",
"text": "def possible_moves(side)\n possible_moves = []\n # initialize an 8x8 array of coordinates 1-8\n coords = Array.new(8) { [*1..8] }\n coords.each_with_index do |i, j|\n i.each do |t|\n # t is the x, i[j] is the y\n side.each do |test_piece|\n # Run move validation tests on every piece\n next unless test_piece.move_tests(to_x: t, to_y: i[j])\n # if a move passes validations, push the pieces ID and the\n # coordinates of a successful move to the possible_moves array\n possible_moves << [test_piece.id, t, i[j]]\n end\n end\n end\n possible_moves\n end",
"title": ""
},
{
"docid": "3ed3c6bdedfc1689206b96b12bd7afe4",
"score": "0.61403733",
"text": "def get_legal_moves(x, y, node)\n condition = node.id[0] + x > 7 || \n node.id[0] + x < 0 || \n node.id[1] + y > 7 || \n node.id[1] + y < 0\n\n unless condition\n node.legal_moves << [node.id[0] + x, node.id[1] + y]\n end\n end",
"title": ""
},
{
"docid": "ab32a1214bbc0ce8cc4da1a4c4d17e45",
"score": "0.61331224",
"text": "def valid_moves_array(game_id, id)\n piece = Game.find(game_id).pieces.find_by(id: id)\n valid_moves_array = []\n if piece.present? && piece.color == Game.find(game_id).turn\n valid_moves_array = [[piece.x_coordinate, piece.y_coordinate]]\n (0..7).each do |y_target|\n (0..7).each do |x_target|\n valid_moves_array << [x_target, y_target] if piece.valid_move?(x_target, y_target)\n end\n end\n valid_moves_array\n end\n end",
"title": ""
},
{
"docid": "b49178f2f3966c243b196a95083fafe8",
"score": "0.6131977",
"text": "def validate_player_move(move)\r\n \r\n #Return a value of false is the square has already been\r\n #selected\r\n return false if move == \"A1\" && $A1 != \" \"\r\n return false if move == \"B1\" && $B1 != \" \"\r\n return false if move == \"C1\" && $C1 != \" \"\r\n return false if move == \"A2\" && $A2 != \" \"\r\n return false if move == \"B2\" && $B2 != \" \"\r\n return false if move == \"C2\" && $C2 != \" \"\r\n return false if move == \"A3\" && $A3 != \" \"\r\n return false if move == \"B3\" && $B3 != \" \"\r\n return false if move == \"C3\" && $C3 != \" \" \r\n \r\n #Return a value of true if the square is available\r\n return true\r\n \r\n end",
"title": ""
},
{
"docid": "c38b8ffb9579454eb949e9b97adbff80",
"score": "0.612888",
"text": "def valid_move?(board, index)\n if index.between?(0, 8) && position_taken?(board, index) == false\n true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "5f0ab7e1a93c53701c0b33fd0f2d46ac",
"score": "0.61269045",
"text": "def valid_move?(board, index)\n index.between?(0, 8) && position_taken?(board, index) == false\n\nend",
"title": ""
},
{
"docid": "01419bd30414fcc969b88cd1b1a264ad",
"score": "0.612472",
"text": "def move_piece(move, color) \n squares = find_start_and_end(move) # [start, end]\n\n return false if @display[squares[0][0]][squares[0][1]].guest == ' '\n\n start_piece = @display[squares[0][0]][squares[0][1]].guest\n\n return false if start_piece.color != color \n\n moves = get_legal_moves(squares[0], start_piece, start_piece.poss_moves(squares[0]))\n\n\n if moves.include?(squares[1])\n\n # castling\n if start_piece.id == 'king' && start_piece.color == 'white' && squares[1] == [7, 1] \n make_move(squares[0], squares[1], start_piece)\n make_move([7, 0], [7, 2], @display[0][0].guest)\n elsif start_piece.id == 'king' && start_piece.color == 'black' && squares[1] == []\n make_move(squares[0], squares[1], start_piece)\n make_move([0, 0], [0, 2], @display[7][0].guest)\n\n # pawn -> queen upgrade\n elsif start_piece.id == 'pawn' && start_piece.color == 'white' && squares[1][0].zero?\n make_move(squares[0], squares[1], Queen.new('white'))\n elsif start_piece.id == 'pawn' && start_piece.color == 'black' && squares[1][0] == 7\n make_move(squares[0], squares[1], Queen.new('black'))\n\n else\n make_move(squares[0], squares[1], start_piece)\n end\n else\n false\n end\n end",
"title": ""
},
{
"docid": "5d69ea4a658cb6e3a5a6c3f07a59357a",
"score": "0.61247003",
"text": "def move_valid?(x, y)\n (0...@columns).cover?(x) && (0...@rows).cover?(y) && !@visited[x][y]\n end",
"title": ""
},
{
"docid": "4f521a79da3387edd8a1d1dceb01dded",
"score": "0.61213434",
"text": "def valid_move?(board, position)\n position.to_i.between?(1,9) && !position_taken?(board, position.to_i-1)\nend",
"title": ""
},
{
"docid": "f64df888437b2fe9c57dc5123d783ed3",
"score": "0.6119578",
"text": "def valid_move?(board,index)\n if index.between?(0,8) && !position_taken?(board,index)\n true\n else\n false\n end\n\nend",
"title": ""
},
{
"docid": "d80fb6bb4debd9a9632bf3fcc23aef08",
"score": "0.6114651",
"text": "def valid_move?(board, index)\n if index.between?(0, 8) && (position_taken?(board, index) == false)\n true\n elsif (index.between?(0,8) == false) || (position_taken?(board, index) == true)\n false\n end\nend",
"title": ""
},
{
"docid": "4ecea2cad8b90808dad1542bf945cc66",
"score": "0.6112135",
"text": "def valid_move?(board, index)\nif index.between?(0,8) && !position_taken?(board, index)\n true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "84387af17455f187dbdb04053ecfc740",
"score": "0.61104697",
"text": "def move_valid?(pos)\n return false unless board.in_bounds?(pos)\n return false if board.occupied?(pos) && board.grid[pos[0]][pos[1]].color == self.color\n true\n end",
"title": ""
}
] |
11180f1c2421052ce2dfc51573cb1ed5
|
GET /resources/new.json TODO: na razie nie ma zastosowania
|
[
{
"docid": "e1bc9a5c7d5dc36da2fd873d88e65d1f",
"score": "0.8066211",
"text": "def new\n\tputs \"new\"\n @resource = Resource.new\n\n respond_to do |format|\n format.json { render json: @resource }\n#\t format.html { render html: @resources }\n end\n end",
"title": ""
}
] |
[
{
"docid": "c38f1a3603b5de5824f457cac4925b2d",
"score": "0.76766187",
"text": "def new\n @resource = Resource.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "0eb1e08613a69bba99133087aeb7242c",
"score": "0.7659261",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "0eb1e08613a69bba99133087aeb7242c",
"score": "0.7659261",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "0eb1e08613a69bba99133087aeb7242c",
"score": "0.7659261",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "0eb1e08613a69bba99133087aeb7242c",
"score": "0.7659261",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "0eb1e08613a69bba99133087aeb7242c",
"score": "0.7659261",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "0eb1e08613a69bba99133087aeb7242c",
"score": "0.7659261",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "0eb1e08613a69bba99133087aeb7242c",
"score": "0.76590824",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "89be5c01b92850f074630109d0323b87",
"score": "0.7307844",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @resource }\n format.xml { render :xml => @resource }\n end\n end",
"title": ""
},
{
"docid": "6258963b54615d5254178f321a17484b",
"score": "0.7305309",
"text": "def new\n @resource_list = ResourceList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_list }\n end\n end",
"title": ""
},
{
"docid": "a645b503b058c8ef96cbf626d7e589f0",
"score": "0.7247487",
"text": "def new\n @resource = Imodec::Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "2bf8f36caa0d8f80223fb0788ff1fe22",
"score": "0.7230241",
"text": "def new\n resource = build_resource({})\n respond_with resource\n end",
"title": ""
},
{
"docid": "012788894c5cbe111bbe9e378645ee7b",
"score": "0.72098494",
"text": "def new\n resource_set resource_klass.new\n respond_with resource_get\n end",
"title": ""
},
{
"docid": "a368f11be0d9f9b3129ee13a70d86ffb",
"score": "0.72081167",
"text": "def new\n build_resource({})\n end",
"title": ""
},
{
"docid": "04d00fccc349eb3cad59104185ea78b7",
"score": "0.71787953",
"text": "def new\n build_resource({})\n self.resource.things.build\n respond_with self.resource\n end",
"title": ""
},
{
"docid": "3ceccca3dd5d117c73d3cd6a8797e276",
"score": "0.71749276",
"text": "def new\n @resource_type = ResourceType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_type }\n end\n end",
"title": ""
},
{
"docid": "3ceccca3dd5d117c73d3cd6a8797e276",
"score": "0.71749276",
"text": "def new\n @resource_type = ResourceType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_type }\n end\n end",
"title": ""
},
{
"docid": "8b474b00622d1ab56e0683b7c42f76c5",
"score": "0.71437037",
"text": "def new\n @resource = @course.resources.build\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "e18ad7a2dc6c5ab51abdd1e6504e6b16",
"score": "0.7119059",
"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": "17a7ff16f5b925c5a7376a86bbdcc5b6",
"score": "0.70973504",
"text": "def new\n @dummy_resource = DummyResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dummy_resource }\n end\n end",
"title": ""
},
{
"docid": "ef4e698319aa541baa62623e9d09f8b4",
"score": "0.7096476",
"text": "def new\n @resource_item = ResourceItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_item }\n end\n end",
"title": ""
},
{
"docid": "5ec65a47785bb0c3972ac06f1cf6a804",
"score": "0.70916665",
"text": "def new\n build_responder.call(new_resource, :action => :new)\n end",
"title": ""
},
{
"docid": "17d7da60333d97967bcd96628c11fd45",
"score": "0.7087921",
"text": "def new\n json_404\n end",
"title": ""
},
{
"docid": "e8e19d07d2c3975b080b063ab1e74305",
"score": "0.70846784",
"text": "def new\n build_resource\n respond_with resource\n end",
"title": ""
},
{
"docid": "de9a99bc84d83825f9bf856375c17d7f",
"score": "0.706106",
"text": "def new\n @resourceset = Resourceset.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resourceset }\n end\n end",
"title": ""
},
{
"docid": "d05e5d0820b6b699d4aeca44c6a3e81b",
"score": "0.7016453",
"text": "def new\n @class_resource = ClassResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @class_resource }\n end\n end",
"title": ""
},
{
"docid": "503ea17049c577147597eea30fe7d24d",
"score": "0.7008147",
"text": "def new\n @resource = Resource.new\n end",
"title": ""
},
{
"docid": "503ea17049c577147597eea30fe7d24d",
"score": "0.7008147",
"text": "def new\n @resource = Resource.new\n end",
"title": ""
},
{
"docid": "503ea17049c577147597eea30fe7d24d",
"score": "0.7008147",
"text": "def new\n @resource = Resource.new\n end",
"title": ""
},
{
"docid": "503ea17049c577147597eea30fe7d24d",
"score": "0.7008147",
"text": "def new\n @resource = Resource.new\n end",
"title": ""
},
{
"docid": "c568d55e6aca955b0ca21b281a12f106",
"score": "0.7007698",
"text": "def new\n\t\t@resource = Resource.new\n\tend",
"title": ""
},
{
"docid": "25e9781fc44ddc6df2ea0130a2a38c55",
"score": "0.6998931",
"text": "def new\n build_resource({})\n self.resource.person = Person.new\n respond_with self.resource\n end",
"title": ""
},
{
"docid": "c51e82de6f755b21c6626b48d09350bf",
"score": "0.6980828",
"text": "def new\n @resource = Resource.new\n @grades = Grade.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource }\n end\n end",
"title": ""
},
{
"docid": "ff3c4cdf997050f820722cd6784e565c",
"score": "0.6977189",
"text": "def new\n @resource_result = Resource::Result.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_result }\n end\n end",
"title": ""
},
{
"docid": "7d252d496701fcad35e802aef2f09435",
"score": "0.69703156",
"text": "def create\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created -- now fetching...' }\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": "21196b71248250571146c2a3a1f9159d",
"score": "0.6963841",
"text": "def new\n @site_resource = SiteResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @site_resource }\n end\n end",
"title": ""
},
{
"docid": "73868003d10ec9c89d467565e36f90f1",
"score": "0.6929474",
"text": "def new\n @ressource = Ressource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ressource }\n end\n end",
"title": ""
},
{
"docid": "73868003d10ec9c89d467565e36f90f1",
"score": "0.6929474",
"text": "def new\n @ressource = Ressource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ressource }\n end\n end",
"title": ""
},
{
"docid": "ab3967a8e5c7bb6904f7741845f1ec2e",
"score": "0.6928514",
"text": "def new\r\n @resource = Resource.new\r\n end",
"title": ""
},
{
"docid": "e9d5b6b07aa663dc852610611bbef77e",
"score": "0.69171625",
"text": "def new\n @web_resource = WebResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @web_resource }\n end\n end",
"title": ""
},
{
"docid": "61bfecb383315560842b385778896448",
"score": "0.69114554",
"text": "def new\n @appresource = Appresource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @appresource }\n end\n end",
"title": ""
},
{
"docid": "c2be97fc25bcb6dfdc4a609505922b85",
"score": "0.68954724",
"text": "def new\n @resource_type = ResourceType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @resource_type }\n format.xml { render :xml => @resource_type }\n end\n end",
"title": ""
},
{
"docid": "86f61cd81dbe189c9c065b68ca09044d",
"score": "0.68915105",
"text": "def new\n @event_resource = EventResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @event_resource }\n end\n end",
"title": ""
},
{
"docid": "e486a04badbc95dae3e68553bbdb79de",
"score": "0.6886425",
"text": "def new\n @object_resource = ObjectResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @object_resource }\n end\n end",
"title": ""
},
{
"docid": "0186de454da1bbacc0c0e11f5e4361ac",
"score": "0.6861985",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end",
"title": ""
},
{
"docid": "0186de454da1bbacc0c0e11f5e4361ac",
"score": "0.6861985",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end",
"title": ""
},
{
"docid": "0186de454da1bbacc0c0e11f5e4361ac",
"score": "0.6861985",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end",
"title": ""
},
{
"docid": "0186de454da1bbacc0c0e11f5e4361ac",
"score": "0.6861985",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end",
"title": ""
},
{
"docid": "0186de454da1bbacc0c0e11f5e4361ac",
"score": "0.6861985",
"text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end",
"title": ""
},
{
"docid": "4a24226f423ad8eec8dde6e158edb209",
"score": "0.68616015",
"text": "def new\n @online_resource = OnlineResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @online_resource }\n end\n end",
"title": ""
},
{
"docid": "40ffd0451ea5cbe97c65d212717c8e27",
"score": "0.68479973",
"text": "def new\n @history_resource = HistoryResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @history_resource }\n end\n end",
"title": ""
},
{
"docid": "eab046e8808fb098b67bad6b06cf9434",
"score": "0.68327624",
"text": "def new\n @postresource = Postresource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @postresource }\n end\n end",
"title": ""
},
{
"docid": "d3ce8ea5943bfc3c2992b9e8a05dc1c3",
"score": "0.68306464",
"text": "def new\n @resource_history = Resource::History.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_history }\n end\n end",
"title": ""
},
{
"docid": "97505784b66621b281b287b93572dbb3",
"score": "0.68297696",
"text": "def new\n # require global create permissions for this object type\n require_privilege(Alberich::Privilege::CREATE, StandaloneResource)\n\n @standalone_resource = StandaloneResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @standalone_resource }\n end\n end",
"title": ""
},
{
"docid": "9cfd84f37fc7f59850672b780bdecc1b",
"score": "0.68207264",
"text": "def new\n @sp_resource = SpResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sp_resource }\n end\n end",
"title": ""
},
{
"docid": "d25547e3b380644de201e11a5760b0b5",
"score": "0.6802269",
"text": "def new\n @resource_signup = Resource::Signup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_signup }\n end\n end",
"title": ""
},
{
"docid": "d89d88dcb488b2acf0e3af27a9893512",
"score": "0.6796365",
"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": "8718839c1873ebb1d41aaf909b25c347",
"score": "0.6784079",
"text": "def new\n do_new_resource\n get_project_if_exists\n do_set_attributes\n do_authorize_instance\n\n respond_new\n end",
"title": ""
},
{
"docid": "8718839c1873ebb1d41aaf909b25c347",
"score": "0.6784079",
"text": "def new\n do_new_resource\n get_project_if_exists\n do_set_attributes\n do_authorize_instance\n\n respond_new\n end",
"title": ""
},
{
"docid": "66c6a6819f7b82650966d2e1f51071ac",
"score": "0.67827773",
"text": "def new\n @transfer_resource = TransferResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @transfer_resource }\n end\n end",
"title": ""
},
{
"docid": "7e963f222fbc689ab806eebe7a8147ca",
"score": "0.67781496",
"text": "def new\n #alberich global permissions check\n require_privilege(Alberich::Privilege::CREATE, GlobalResource)\n @global_resource = GlobalResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @global_resource }\n end\n end",
"title": ""
},
{
"docid": "007166b793dc94e8ad9e1590f3cd115f",
"score": "0.67617613",
"text": "def new\r\n build_resource\r\n render_with_scope :new\r\n end",
"title": ""
},
{
"docid": "a699ec90776ded785fcf2cfaba617531",
"score": "0.67603683",
"text": "def index\n\tif params[:tag]\n \t@resources = Resource.tagged_with(params[:tag])\n \telse\n \t\t@resources = Resource.order(\"id DESC\")\n \tend\n \t\n \t@newresource = Resource.new\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @resources }\n end\n end",
"title": ""
},
{
"docid": "bc021e43758756a5197d4d183faedc14",
"score": "0.67252064",
"text": "def create\n @resource = Resource.new(params[:resource])\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": "f3cb393b8a86e58511632ae42671049e",
"score": "0.6724118",
"text": "def new\n # require global create permissions for this object type\n require_privilege(Alberich::Privilege::CREATE, ParentResource)\n @parent_resource = ParentResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @parent_resource }\n end\n end",
"title": ""
},
{
"docid": "1fe7a0eb754b891d211533173d6ae2a7",
"score": "0.6716473",
"text": "def new\n\t\n\t\t\n\t\trender json: {}\n\tend",
"title": ""
},
{
"docid": "5da16b2c91298b65822f602999d1754d",
"score": "0.6710767",
"text": "def new_stories\n get('/newstories.json')\n end",
"title": ""
},
{
"docid": "df84751e5ad1c3ba28c4bd5ab7d32692",
"score": "0.67054933",
"text": "def create\n @resource = Resource.new(resource_params)\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to resources_url, notice: 'Resource was successfully created.' }\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": "5b0e9c10536a9601bf58d1af42a7c961",
"score": "0.6700401",
"text": "def new\n @favorite_resource = FavoriteResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @favorite_resource }\n end\n end",
"title": ""
},
{
"docid": "edfa1acd7a807e43e8a183d308257578",
"score": "0.66977334",
"text": "def create\n @resource = Resource.new(resource_params)\n\n if @resource.save\n render json: @resource\n else\n render json: @resource.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "a8c712533c0cbeb1d96d424456078822",
"score": "0.66775733",
"text": "def handle_get_new_resource_request(request)\n handle_get_resource_request(request, @new_resource)\n end",
"title": ""
},
{
"docid": "add02b09ba310a0a3b292624227bfbed",
"score": "0.66477025",
"text": "def action_create\n if current_resource.exists? &&\n current_resource.name == new_resource.name &&\n current_resource.project_identifier == new_resource.project_identifier\n Chef::Log.debug(\"#{new_resource} exists - skipping\")\n else\n wait_until_ready!\n Chef::Log.info(\"Create Project #{new_resource.name} at #{new_resource.connection[:host]}\")\n #actually create foo\n redmine = RestClient::Resource.new( new_resource.connection[:host], { :user => new_resource.connection[:username] , :password => new_resource.connection[:password]})\n\n #createProject\n project = { :project => { :name => new_resource.name , :identifier => new_resource.project_identifier }}.to_json\n response = redmine[\"/projects.json\"].post project, :content_type => 'application/json'\n end\n end",
"title": ""
},
{
"docid": "6023abc20816d53a343d8f2f73156d2d",
"score": "0.6645654",
"text": "def new\n @resource_import_file = ResourceImportFile.new\n @file_path = root_url + Setting.resource_import_template\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @resource_import_file }\n end\n end",
"title": ""
},
{
"docid": "af31f97d2ad00595098607dcf2c7f2f0",
"score": "0.6644704",
"text": "def new\n authorize! :create, build_resource\n @lecture = parent.lecture\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: resource }\n end\n end",
"title": ""
},
{
"docid": "bdefcae1cec841161a2377f72e605801",
"score": "0.66393584",
"text": "def new\n @server = Server.new\n @creating_new = true\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @server }\n\n end\n end",
"title": ""
},
{
"docid": "f9bff006f190975e3a997ddea63f7212",
"score": "0.66292197",
"text": "def create\n @resource = Resource.new(resource_params)\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": "f9bff006f190975e3a997ddea63f7212",
"score": "0.66292197",
"text": "def create\n @resource = Resource.new(resource_params)\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": "3c65793d200ca9cd16b7b52a0bb0b553",
"score": "0.66267395",
"text": "def new_resource_class\n 'new'\n end",
"title": ""
},
{
"docid": "bbc8c17925476d5b54fc1e0931f7ab11",
"score": "0.6623874",
"text": "def new\n @resource_waiting_list = Resource::WaitingList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_waiting_list }\n end\n end",
"title": ""
},
{
"docid": "5597baebea1763aaed0c1b688d372a61",
"score": "0.66019505",
"text": "def new\n @jersey = Jersey.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jersey }\n end\n end",
"title": ""
},
{
"docid": "5646f094698d9bf09a0c98d904c26167",
"score": "0.65977126",
"text": "def new\n @room_resource = RoomResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @room_resource }\n end\n end",
"title": ""
},
{
"docid": "75828962bb6a63b52a0c2858329c2acd",
"score": "0.65975976",
"text": "def create\n resource_set resource_klass.new(resource_params)\n\n respond_to do |wants|\n result = resource_get.save\n call_hook :after_save, result\n if result\n flash[:notice] = t 'messages.record_created', model: t(\"models.#{resource_name}\")\n wants.html { redirect_to(resource_get) }\n wants.json { render :json => resource_get, :status => :created, :location => resource }\n else\n wants.html { render :action => \"new\" }\n wants.json { render :json => resource_get.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d09feba48d0754280f8c53c539cfc787",
"score": "0.6596856",
"text": "def new\n #return render :json => params\n resource = build_resource({ })\n @package = params[:package]\n #return render :json => params[:package]\n respond_with_navigational(resource) { render_with_scope :new }\n end",
"title": ""
},
{
"docid": "64ee58eef5034d152947e0267eb9724e",
"score": "0.6596721",
"text": "def new\n @issue_resource = IssueResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @issue_resource }\n end\n end",
"title": ""
},
{
"docid": "f5d6a578268610c046c2be60beba8b3c",
"score": "0.65917283",
"text": "def create\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n url = @resource.url\n format.json { render :json => {:url => url }}\n # format.html { redirect_to(courses_path, :notice => 'Resource was successfully created.') }\n # format.xml { render :xml => [:admin,@resource], :status => :created, :location => @admin_resource }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @admin_resource.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "114f74bf2a56d4142cb333c3ef1ad51e",
"score": "0.65874934",
"text": "def new_resource\n resource_scope.new(resource_params)\n end",
"title": ""
},
{
"docid": "c9d1386c5ece3daf4222c779bf9d71c4",
"score": "0.6575853",
"text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d165699f48be72249078b48a8f51fca1",
"score": "0.6574079",
"text": "def new\n @entity = Entity.new\n\n render json: @entity\n end",
"title": ""
},
{
"docid": "8760787d7dd7ca601b236697eee737b2",
"score": "0.65699214",
"text": "def new\n @resource_game = Resource::Game.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_game }\n end\n end",
"title": ""
},
{
"docid": "af3ff5d07be7811e90e4f318c5e7ad6d",
"score": "0.65649086",
"text": "def create\n @resource = Resource.new(resource_params)\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 :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": "af3ff5d07be7811e90e4f318c5e7ad6d",
"score": "0.65649086",
"text": "def create\n @resource = Resource.new(resource_params)\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 :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": "af3ff5d07be7811e90e4f318c5e7ad6d",
"score": "0.65649086",
"text": "def create\n @resource = Resource.new(resource_params)\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 :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": "283fbbddab83520fca3b3e8e448bbdfb",
"score": "0.65638226",
"text": "def new\n @resource_schedule = ResourceSchedule.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_schedule }\n end\n end",
"title": ""
},
{
"docid": "16c7ed7108d2a8a112d83451b52026f2",
"score": "0.6553732",
"text": "def new\n @resource_value = ResourceValue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_value }\n end\n end",
"title": ""
},
{
"docid": "697f09f0dd9849a4bdd3802588969afd",
"score": "0.65375453",
"text": "def new\n page \"asset\"\n @asset = Asset.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @asset }\n end\n end",
"title": ""
},
{
"docid": "51ff39e3396293e6ab1d37975da71339",
"score": "0.65233165",
"text": "def new\n @uri = Uri.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @uri }\n end\n end",
"title": ""
},
{
"docid": "004171d34793c7a1b939a4c047c589cf",
"score": "0.6523024",
"text": "def new\n ResourceInstance.new(@client, @api, self, action: @actions[:create], persistent: false)\n end",
"title": ""
},
{
"docid": "9da4ac2dd8d0dbc2eff8d27ca9bb0d5e",
"score": "0.6518847",
"text": "def new\n @new_recipe = NewRecipe.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @new_recipe }\n end\n end",
"title": ""
},
{
"docid": "dd82d6c0f713d3e0ccf621d7589fac74",
"score": "0.65175843",
"text": "def new\n @page_title = t('actions.new_client')\n @client = Client.new\n @client.role = \"Kundinnen\"\n @client.status = \"aktiv\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @client }\n end\n end",
"title": ""
},
{
"docid": "5b9b57e9e2101551b7e98d2e5f29dcc5",
"score": "0.6512961",
"text": "def create\n if params[:resource][:type_id] == \"status\" || params[:resource][:type_id] == \"book\"\n begin\n @resource = Resource.find_by_title_and_topic_id(params[:resource][:title], params[:resource][:topic_id])\n rescue\n @resource = nil\n end\n elsif params[:resource][:type_id] == \"link\" || params[:resource][:type_id] == \"video\"\n begin\n @resource = Resource.find_by_uri_and_topic_id(params[:resource][:uri], params[:resource][:topic_id])\n rescue\n @resource = nil\n end\n end\n \n if @resource != nil # If resource is added before\n @resource.add_count += 1\n else\n @resource = Resource.new(params[:resource])\n end\n \n respond_to do |format|\n if @resource.save\n format.html { redirect_to :back }\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": ""
}
] |
82aca695a0d0a93a5489ee157fc71c8e
|
TODO: This is a bad way of doing things .. this needs redo
|
[
{
"docid": "5bb50c02e05af9209af2062f31ac24fb",
"score": "0.0",
"text": "def seo_meta_data(pagename, seo_data = nil)\n params = {pagename: pagename, seo_data: seo_data}\n if pagename == 'home'\n params.merge!(current_url: request.fullpath)\n end\n @seo = SeoSlug.new(params)\n check_for_registered_user\n end",
"title": ""
}
] |
[
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6158068",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6158068",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6158068",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6158068",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6158068",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "9dcc74dd11eb115d21bf9af45b3ec4e3",
"score": "0.6158068",
"text": "def bodystmt; end",
"title": ""
},
{
"docid": "b6b2bcc0062aeb115edab7b10cbe6930",
"score": "0.61371684",
"text": "def desired; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.609449",
"text": "def used; end",
"title": ""
},
{
"docid": "33e1db3c06643dd523dcc31fccf3a005",
"score": "0.609449",
"text": "def used; end",
"title": ""
},
{
"docid": "3ae137b1a40ff3aae4f3cbb2b6082797",
"score": "0.6027413",
"text": "def reaper; end",
"title": ""
},
{
"docid": "4fe655da88e61d28e8b9a9ed964af838",
"score": "0.59146434",
"text": "def imprensa\n\t\t\n\tend",
"title": ""
},
{
"docid": "f0d50116d6d067bd787bf1044910efcb",
"score": "0.5828956",
"text": "def attempt; end",
"title": ""
},
{
"docid": "3caf4c824a6d6a4a5616c13fcab418da",
"score": "0.57773757",
"text": "def applied; end",
"title": ""
},
{
"docid": "dff37ea0d68b9c86bab1ceb2dfb658a9",
"score": "0.5772956",
"text": "def rc; end",
"title": ""
},
{
"docid": "bc658f9936671408e02baa884ac86390",
"score": "0.5765395",
"text": "def anchored; end",
"title": ""
},
{
"docid": "549cdd4767cacb4029e22f746ccd68b5",
"score": "0.5759154",
"text": "def work; end",
"title": ""
},
{
"docid": "7ec57c3874853e50086febdbdd3221bf",
"score": "0.575619",
"text": "def wedding; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.57133764",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.57133764",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.57133764",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.57133764",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.57133764",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.57133764",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.57133764",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.57133764",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.57133764",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.57133764",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.57133764",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.57133764",
"text": "def run; end",
"title": ""
},
{
"docid": "5ab49f4a4e76cf57dddfec246839f72d",
"score": "0.57133764",
"text": "def run; end",
"title": ""
},
{
"docid": "58e2e07d11b107b6864a328f2187e248",
"score": "0.5708851",
"text": "def apop?; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.56837684",
"text": "def operations; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.56837684",
"text": "def operations; end",
"title": ""
},
{
"docid": "794a198d95cf296afde54486d8c4e262",
"score": "0.56795895",
"text": "def avail_out=(*) end",
"title": ""
},
{
"docid": "1151221aa9457e5cad317e4fec922758",
"score": "0.56785905",
"text": "def adjugate; end",
"title": ""
},
{
"docid": "5928f8efe9c6c2d408ea21a4cdce83ad",
"score": "0.56721324",
"text": "def preliminary?; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.56595975",
"text": "def preparable; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.56595975",
"text": "def preparable; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.56595975",
"text": "def preparable; end",
"title": ""
},
{
"docid": "2811397aefca145cecd731fd0748b1e6",
"score": "0.56595975",
"text": "def preparable; end",
"title": ""
},
{
"docid": "954c5828178f6e4a659c40ef92736547",
"score": "0.5659216",
"text": "def helpful!\n\n\t\tend",
"title": ""
},
{
"docid": "a9dd648a5d0d2e7d56223e7c753f5e2e",
"score": "0.56543154",
"text": "def telegraphical()\n end",
"title": ""
},
{
"docid": "6ab77a9219ee157923bc58599ba6aa77",
"score": "0.56316227",
"text": "def in_use; end",
"title": ""
},
{
"docid": "6ab77a9219ee157923bc58599ba6aa77",
"score": "0.56316227",
"text": "def in_use; end",
"title": ""
},
{
"docid": "5c9ce12b396a1901aa5b7236d9b5e589",
"score": "0.56316197",
"text": "def next; end",
"title": ""
},
{
"docid": "5c9ce12b396a1901aa5b7236d9b5e589",
"score": "0.56316197",
"text": "def next; end",
"title": ""
},
{
"docid": "5c9ce12b396a1901aa5b7236d9b5e589",
"score": "0.56316197",
"text": "def next; end",
"title": ""
},
{
"docid": "5c9ce12b396a1901aa5b7236d9b5e589",
"score": "0.56316197",
"text": "def next; end",
"title": ""
},
{
"docid": "5c9ce12b396a1901aa5b7236d9b5e589",
"score": "0.56316197",
"text": "def next; end",
"title": ""
},
{
"docid": "a18186567d58d46fbcb43c48faf2ab4b",
"score": "0.5628644",
"text": "def apply\n\t\t\n\tend",
"title": ""
},
{
"docid": "0aa0db9270c5a88c81da713a1ee0e8f8",
"score": "0.5600137",
"text": "def rescued_exception; end",
"title": ""
},
{
"docid": "827ead910e51ccc306c866e1919284df",
"score": "0.5595034",
"text": "def postprocess; end",
"title": ""
},
{
"docid": "a24eeb4706a13ad1fb582849824772f7",
"score": "0.55823267",
"text": "def lup; end",
"title": ""
},
{
"docid": "da32862891e2ebc3c8d71f65524bb4c1",
"score": "0.55758935",
"text": "def prosa\n end",
"title": ""
},
{
"docid": "da32862891e2ebc3c8d71f65524bb4c1",
"score": "0.55758935",
"text": "def prosa\n end",
"title": ""
},
{
"docid": "2290804b238fc95bfd6b38f87c6d2895",
"score": "0.5550903",
"text": "def override; end",
"title": ""
},
{
"docid": "f0e7c8a4f10061cc13cd41c293de5b29",
"score": "0.5540184",
"text": "def process_next_entry; end",
"title": ""
},
{
"docid": "f0e7c8a4f10061cc13cd41c293de5b29",
"score": "0.5540184",
"text": "def process_next_entry; end",
"title": ""
},
{
"docid": "b7567a2a68cade31f2360723a4c42dc7",
"score": "0.5533993",
"text": "def used_by; end",
"title": ""
},
{
"docid": "61710f1359e9f4eb646612f0ec04f379",
"score": "0.5533242",
"text": "def post_process; end",
"title": ""
},
{
"docid": "766a1755b1f9472b764bda8eec9716c6",
"score": "0.5530672",
"text": "def chore; end",
"title": ""
},
{
"docid": "3d45e3d988480e2a6905cd22f0936351",
"score": "0.5505098",
"text": "def for; end",
"title": ""
},
{
"docid": "3d45e3d988480e2a6905cd22f0936351",
"score": "0.5505098",
"text": "def for; end",
"title": ""
},
{
"docid": "3d45e3d988480e2a6905cd22f0936351",
"score": "0.5505098",
"text": "def for; end",
"title": ""
},
{
"docid": "8d1d77531cce0d12539ad149eebad454",
"score": "0.54994154",
"text": "def sub_from; end",
"title": ""
},
{
"docid": "a606ff314b37ba47be08b757ff538b5e",
"score": "0.54961336",
"text": "def processor; end",
"title": ""
},
{
"docid": "a606ff314b37ba47be08b757ff538b5e",
"score": "0.54961336",
"text": "def processor; end",
"title": ""
},
{
"docid": "f43fd7d3787cd1208a6bf4763d996509",
"score": "0.54749954",
"text": "def Redo; end",
"title": ""
},
{
"docid": "e44ae2cef169d29f78b2b6306add59da",
"score": "0.54533803",
"text": "def huddlingly()\n end",
"title": ""
},
{
"docid": "a747cf4388fb3d14718cf9dda73c555f",
"score": "0.5452633",
"text": "def initalize; end",
"title": ""
},
{
"docid": "a747cf4388fb3d14718cf9dda73c555f",
"score": "0.5452633",
"text": "def initalize; end",
"title": ""
},
{
"docid": "0e02f83784c17c376ac60c44d26d2ebb",
"score": "0.5442302",
"text": "def existing; end",
"title": ""
},
{
"docid": "0a39799e76643367f1b6bfac65569895",
"score": "0.5427218",
"text": "def used?; end",
"title": ""
},
{
"docid": "04e074efc99de627ea58633a58870ec3",
"score": "0.5420844",
"text": "def stpreason\n end",
"title": ""
},
{
"docid": "54f970ee5768d76a8818f20a25600939",
"score": "0.54205483",
"text": "def looping",
"title": ""
},
{
"docid": "baabe5bb658b17a85353fb66fdbbf873",
"score": "0.54179597",
"text": "def extended; end",
"title": ""
},
{
"docid": "a7e46056aae02404670c78192ffb8f3f",
"score": "0.5415323",
"text": "def original_result; end",
"title": ""
},
{
"docid": "6a580931a1781238fd4518fdb62728d7",
"score": "0.5414814",
"text": "def process; end",
"title": ""
},
{
"docid": "6a580931a1781238fd4518fdb62728d7",
"score": "0.5414814",
"text": "def process; end",
"title": ""
},
{
"docid": "6a580931a1781238fd4518fdb62728d7",
"score": "0.5414814",
"text": "def process; end",
"title": ""
},
{
"docid": "bfc59ba4069006df84cd4e7d17c175e6",
"score": "0.540479",
"text": "def first_fixed; end",
"title": ""
},
{
"docid": "7477f36427db1eed71e3d1fe5ae5eb83",
"score": "0.54034764",
"text": "def manuver\n\tend",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.540245",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.540245",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "20888292727941835888e2d0f9081c0f",
"score": "0.540245",
"text": "def inquiry; end",
"title": ""
},
{
"docid": "8b79e8f7bbe83880e51794d26cd62a8f",
"score": "0.5398826",
"text": "def try; end",
"title": ""
},
{
"docid": "453bf50eb84d5640b709eabc6650b515",
"score": "0.5388627",
"text": "def next()\n \n end",
"title": ""
},
{
"docid": "e7880852be30ba624d3a414d6c608836",
"score": "0.5378764",
"text": "def reap; end",
"title": ""
},
{
"docid": "e7880852be30ba624d3a414d6c608836",
"score": "0.5378764",
"text": "def reap; end",
"title": ""
},
{
"docid": "e7880852be30ba624d3a414d6c608836",
"score": "0.5378764",
"text": "def reap; end",
"title": ""
},
{
"docid": "563c62b62fd579737ee9c1a7b4dc1e83",
"score": "0.5378719",
"text": "def changes; end",
"title": ""
},
{
"docid": "5ad7e5c7a147626a2b0a2c5956411be5",
"score": "0.53777564",
"text": "def r; end",
"title": ""
},
{
"docid": "b7cfdec5315b5d3c26b002081b1dbae3",
"score": "0.5370974",
"text": "def coming_soon; end",
"title": ""
},
{
"docid": "0939406b2108b4dcfeb32a0ce912e9dd",
"score": "0.5366872",
"text": "def\thustle \t \t\r\n\t\tend",
"title": ""
},
{
"docid": "26da328e8cf814fdc197fd2d301c3d2b",
"score": "0.53584284",
"text": "def flipx\r\n end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5353856",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5353856",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5353856",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5353856",
"text": "def implementation; end",
"title": ""
},
{
"docid": "3660c5f35373aec34a5a7b0869a4a8bd",
"score": "0.5353856",
"text": "def implementation; end",
"title": ""
},
{
"docid": "5ffd4221c0adbb90a19d26836dc1440b",
"score": "0.5351615",
"text": "def parter; end",
"title": ""
}
] |
1e7c5ffff3484ecde068ef5265a6e940
|
Performs the atomic $unset on the supplied field.
|
[
{
"docid": "d37f07bf38d67a9c1cd6639be1743f19",
"score": "0.72686774",
"text": "def unset(field, options = {})\n Unset.new(self, field, 1, options).persist\n end",
"title": ""
}
] |
[
{
"docid": "842b61eedd9aa036818e374a56973d2c",
"score": "0.7408633",
"text": "def unset(field)\n query.update_all(\"$unset\" => { database_field_name(field) => true })\n end",
"title": ""
},
{
"docid": "c9cb61e4c14ba06cce35634388bcf77a",
"score": "0.7113247",
"text": "def remove(field)\n self.delete(field)\n end",
"title": ""
},
{
"docid": "dcd4edc9c66b50046485a999c690cc84",
"score": "0.69456947",
"text": "def delete_field(field)\n interface.delete_field(data_collection, field)\n end",
"title": ""
},
{
"docid": "23fe62104c33cb64064d7c24c37e0e6b",
"score": "0.6790312",
"text": "def remove!(field, value)\n remove(field, value) && save\n end",
"title": ""
},
{
"docid": "d6d8ac3d20424a9726e7812c7d5161ed",
"score": "0.67014474",
"text": "def delete_value(key, field)\n @redis.hdel key, field\n end",
"title": ""
},
{
"docid": "e09f5808ba738b6074ebcefd3ecf6d66",
"score": "0.66080105",
"text": "def remove(field, value)\n field, value = normalize_input(field, value)\n\n FIELDS.include?(field) && send(field).delete(value)\n end",
"title": ""
},
{
"docid": "2fa69bad85e3e5ec0588b8660464bc56",
"score": "0.65777814",
"text": "def rm_index(field, value=self[field])\n self.class.rm_index(_java_entity, field.to_s, value)\n end",
"title": ""
},
{
"docid": "80f596676560be6ce8c6b45dcb692d20",
"score": "0.65506715",
"text": "def delete_property field\n orientdb.delete_property self, field\n end",
"title": ""
},
{
"docid": "fdb73f28604566289ebf91431d9253b0",
"score": "0.65474206",
"text": "def rm_index(field, value=self[field])\n self.class.rm_index(wrapped_entity, field.to_s, value)\n end",
"title": ""
},
{
"docid": "6b4c5c7ee05d7139b604ee93d50b1fce",
"score": "0.6542519",
"text": "def delete(field)\n field.to_sym if field.is_a? String\n valid_field!(field)\n raise ArgumentError, \"Cannot remove mandatory field #{field.to_s}\" if mandatory_fields.include?(field)\n @fields.delete(field)\n end",
"title": ""
},
{
"docid": "6e4e1e5184c14e6db2c064748b293966",
"score": "0.6459653",
"text": "def delete(*field)\n redis.hdel(key, field)\n end",
"title": ""
},
{
"docid": "2cc705bd4a51145143f07c869fa5c033",
"score": "0.62755257",
"text": "def unset(key)\n @hash.delete(key.to_s)\n delta('$unset', key => 1)\n end",
"title": ""
},
{
"docid": "f95ce1f68f48fc5c7fbea1266e8018b5",
"score": "0.6174093",
"text": "def delete_field!(field_name)\n @fields.delete_if{ |f| f.name == field_name}\n end",
"title": ""
},
{
"docid": "50e2f545b7cc63fee9b000c5254ad4f4",
"score": "0.60572195",
"text": "def clear_attribute(attribute)\n send(\"#{attribute}=\", nil)\n end",
"title": ""
},
{
"docid": "679e5da5231dce3b4f40c68c6c20b875",
"score": "0.604249",
"text": "def decrement_field(key, field, value = 1)\n @redis.hincrby key, field, -value\n end",
"title": ""
},
{
"docid": "daedb6429b563098b4d0e52453ffc25b",
"score": "0.60147995",
"text": "def clear_attribute(attribute)\n send(\"#{attribute}=\", nil)\n end",
"title": ""
},
{
"docid": "daedb6429b563098b4d0e52453ffc25b",
"score": "0.60147995",
"text": "def clear_attribute(attribute)\n send(\"#{attribute}=\", nil)\n end",
"title": ""
},
{
"docid": "1778a1032d601d27e20c15becc6b47c3",
"score": "0.59623456",
"text": "def clear_attribute(attribute)\n\t\t\tsend(\"#{attribute}=\", nil)\n\t\tend",
"title": ""
},
{
"docid": "8ab012d3cb84747547a96d058c83e742",
"score": "0.59100926",
"text": "def remove(field_name)\n @calc_field_collection.delete(field_name)\n end",
"title": ""
},
{
"docid": "624600be4484f027e9b845e091c37c8a",
"score": "0.5906925",
"text": "def remove_field(key)\n @acro_fields.removeField key.to_s\n end",
"title": ""
},
{
"docid": "2f4a9d33ecc6c62ba1e982e2929bbaaa",
"score": "0.5889143",
"text": "def unset(*args)\n fields = args.__find_args__.collect { |f| [database_field_name(f), true] }\n view.update_many(\"$unset\" => Hash[fields])\n end",
"title": ""
},
{
"docid": "87e597a1033ce68237209187b21ae502",
"score": "0.5885483",
"text": "def delete(field=nil)\n id ? \n delete_with_id : \n field ? \n self.class.delete_all(field => self[field]) : \n self.class.delete_all(attributes)\n end",
"title": ""
},
{
"docid": "2bb9fd8a272c58e19c3dbc6429a58a02",
"score": "0.58700407",
"text": "def remove_field(name)\n fields.delete name\n @field_defs.delete name\n undef_method name if method_defined?(name)\n undef_method \"#{name}=\" if method_defined?(\"#{name}=\")\n end",
"title": ""
},
{
"docid": "66c98c0d9e78fc5f80eb3ee506fe48fa",
"score": "0.5866962",
"text": "def delete_property(bucket, property)\n events(bucket).unset(\"d.#{property}\")\n end",
"title": ""
},
{
"docid": "66c98c0d9e78fc5f80eb3ee506fe48fa",
"score": "0.5866962",
"text": "def delete_property(bucket, property)\n events(bucket).unset(\"d.#{property}\")\n end",
"title": ""
},
{
"docid": "3ebbe78e53de3baabdad087c7da4602b",
"score": "0.5865138",
"text": "def decrement_field(key, field, value = 1)\n fail NotImplementedError\n end",
"title": ""
},
{
"docid": "58eca715698faad0ec1e7b7b80ffa884",
"score": "0.5843495",
"text": "def rm_index(entity, field, value)\n return false unless @field_types.has_key?(field)\n index_for_field(field).remove(entity, field, value)\n @parent_indexers.each { |i| i.rm_index(entity, field, value) }\n end",
"title": ""
},
{
"docid": "a3c1ccf49a63f1de651fb19e79e05ae5",
"score": "0.5813052",
"text": "def delete_field(request)\n begin\n data, _status_code, _headers = delete_field_with_http_info(request)\n rescue ApiError => e\n if e.code == 401\n request_token\n data, _status_code, _headers = delete_field_with_http_info(request)\n else\n raise\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "2db65f82303b646cf9b3ad125965ea57",
"score": "0.58121914",
"text": "def clear_field_changes!(field)\n previous_changes.delete(field.to_s)\n changed_attributes.delete(field.to_s)\n end",
"title": ""
},
{
"docid": "3dbc04c4aed220f502b205c43c85db3d",
"score": "0.57979906",
"text": "def delete_value(key, field)\n fail NotImplementedError\n end",
"title": ""
},
{
"docid": "2fe1051b2263fb495b6debd52cc4f3d2",
"score": "0.5791803",
"text": "def destroy_field_value\n DocumentFieldValue.where(local_standard_document_field_id: self.field_id, document_id: self.document_id).destroy_all\n end",
"title": ""
},
{
"docid": "94e7afad9d8a023a668ab9e9097dc1d1",
"score": "0.5772532",
"text": "def delete(field)\r\n\t\t\t\tif has_item(field.to_s)\r\n\t\t\t\t\tval = self[field.to_s]\r\n\t\t\t\t\tremove_item field.to_s\r\n\t\t\t\t\treturn val\r\n\t\t\t\telse\r\n\t\t\t\t\tif block_given?\r\n\t\t\t\t\t\tyield field\r\n\t\t\t\t\tend\r\n\t\t\t\t\treturn nil\r\n\t\t\t\tend\r\n\t\t\tend",
"title": ""
},
{
"docid": "40e50a44f2489351892564c432b0aaff",
"score": "0.57255226",
"text": "def unset(key)\n data.delete(key)\n end",
"title": ""
},
{
"docid": "c3814077ac60eedcc686b8a6c2d340fc",
"score": "0.5664979",
"text": "def pop(field, value)\n query.update_all(\"$pop\" => { database_field_name(field) => value })\n end",
"title": ""
},
{
"docid": "8120e0d00e1da663da0400c249ec190f",
"score": "0.56419945",
"text": "def delete_info(field)\n @cached_info = false\n @data.delete(field)\n end",
"title": ""
},
{
"docid": "654997e31745ac3d01bde2bd4fb44108",
"score": "0.56096715",
"text": "def delete_attribute(attr_name)\n debug{\"Attributes#delete_attribute(#{attr_name.inspect})\"}\n set_attribute(attr_name, nil)\n end",
"title": ""
},
{
"docid": "f35e162f5cb100887a8d8471741d9e16",
"score": "0.56053215",
"text": "def destroy\n @custom_field = CustomField.find(params[:id])\n \n ActiveRecord::Base.transaction do\n @custom_field.destroy\n end\n end",
"title": ""
},
{
"docid": "4bc5bcac53e68dd8070a258c9f2d619e",
"score": "0.5598942",
"text": "def pull(field, value)\n klass.collection.update(\n selector,\n { \"$pull\" => { field => value } },\n :multi => true\n )\n end",
"title": ""
},
{
"docid": "cabaf9564de4135904d5a14068c42de4",
"score": "0.5594241",
"text": "def delete(val)\n if self.srem(val)\n val\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "34becfdab6ba860dc63ca033e1af7015",
"score": "0.5575662",
"text": "def unmunge(value)\n value\n end",
"title": ""
},
{
"docid": "7dbeb3515a7aa11cb6fdc6ff0aad9316",
"score": "0.55677015",
"text": "def delete(word)\n found = self.find(word)\n found.value = nil\n end",
"title": ""
},
{
"docid": "c5f39c59c4ce70b0a561fe53ee3cdf92",
"score": "0.55673844",
"text": "def delete(val)\n if self.zrem(val)\n val\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "91f9895ee07ac5ae36d50d26aef0109e",
"score": "0.55578786",
"text": "def rem(key, value)\n connection.zrem(key, value)\n end",
"title": ""
},
{
"docid": "ae75a068e8546ec97ac03933dc9f2a14",
"score": "0.5532081",
"text": "def remove_field(key)\n @pdf_form.removeField(key.to_s)\n end",
"title": ""
},
{
"docid": "dcce0b5e4e435a2de91824207dec4ad6",
"score": "0.55010027",
"text": "def _remover\n @_remover ||= (embedded? ? (_index ? \"$pull\" : \"$unset\") : nil)\n end",
"title": ""
},
{
"docid": "33890230f4a03b52d2b5c0f8a14d9837",
"score": "0.5494587",
"text": "def delete_field(name)\n sym = name.to_sym\n singleton_class.__send__(:remove_method, sym, \"#{sym}=\")\n @table.delete sym\n end",
"title": ""
},
{
"docid": "9046eed1c2156bf2cf423b46ed6528d9",
"score": "0.54865146",
"text": "def decrby(field, by=1)\n incrby(field, -by)\n end",
"title": ""
},
{
"docid": "c6ecb55a75cb3f843d1b977cfd817353",
"score": "0.5478272",
"text": "def unset(distinct_id, properties, ip=nil, optional_params={})\n properties = [properties] unless properties.is_a?(Array)\n message = {\n '$distinct_id' => distinct_id,\n '$unset' => properties,\n }.merge(optional_params)\n message['$ip'] = ip if ip\n\n update(message)\n end",
"title": ""
},
{
"docid": "b6a1c587fa29aede961f392e82471abe",
"score": "0.5469736",
"text": "def unset_attribute (key)\n OpenWFE.unset_attribute(@attributes, key)\n end",
"title": ""
},
{
"docid": "1425dc1c4e0b2ee3c53539d5e661a3e7",
"score": "0.5441699",
"text": "def unset ( var )\n @settings << [ :unset, var ]\n end",
"title": ""
},
{
"docid": "3a859d4bdd0ad718b9d5da223a52ff35",
"score": "0.54360145",
"text": "def delete_field(name)\n @table.delete name.to_sym\n end",
"title": ""
},
{
"docid": "f0debc49160ac3d1fb2f06d4d7709484",
"score": "0.54267645",
"text": "def delete(fieldname)\n if optional_fieldnames.include?(fieldname)\n @datatype.delete(fieldname)\n return @data.delete(fieldname)\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "6048937cb1b8b4e732e18e72d4698c81",
"score": "0.54157305",
"text": "def delete_field(id)\n connection.delete(\"fields/#{id}\")\n end",
"title": ""
},
{
"docid": "03b731b30444702ed4706dcf01480c51",
"score": "0.54114413",
"text": "def delete(value)\n redis.zrem(key, value)\n end",
"title": ""
},
{
"docid": "a5966924922ea2de8d27a889f2f5994a",
"score": "0.5405926",
"text": "def delete_field(name)\n #@__table__ ||= {}\n __table__.delete(name.to_sym)\n end",
"title": ""
},
{
"docid": "6f2bab7febfaa6eb97838d5c552827b8",
"score": "0.5397488",
"text": "def lrem(key, count, value)\n call(key, [:lrem, key, count, value])\n end",
"title": ""
},
{
"docid": "6048bc5ca58985195c7fb48c6944fc85",
"score": "0.5395257",
"text": "def _remover\n embedded? ? (_index ? \"$pull\" : \"$unset\") : nil\n end",
"title": ""
},
{
"docid": "2e5563def5076137450fe2e63945dcd1",
"score": "0.5392067",
"text": "def zrem(key, member); end",
"title": ""
},
{
"docid": "2e5563def5076137450fe2e63945dcd1",
"score": "0.5392067",
"text": "def zrem(key, member); end",
"title": ""
},
{
"docid": "b0a86e3c8b4035b31c296ad6d48ba450",
"score": "0.5386342",
"text": "def forget(key)\n key = key.to_s\n __remove(key)\n end",
"title": ""
},
{
"docid": "064ab1200c7f5010b61edfd71883bab4",
"score": "0.5380113",
"text": "def decrement!(attribute, by = 1)\n decrement(attribute, by)\n save\n end",
"title": ""
},
{
"docid": "fe6b32f45e8e6e51575a0e446afe8f8c",
"score": "0.537305",
"text": "def remove_custom_field_setting(custom_field: nil, options: {}, **data)\n with_params = data.merge(custom_field: custom_field).reject { |_,v| v.nil? || Array(v).empty? }\n Resource.new(parse(client.post(\"/projects/#{gid}/removeCustomFieldSetting\", body: with_params, options: options)).first, client: client)\n end",
"title": ""
},
{
"docid": "1a0a5fc52fa27cb6c1ea81983994a9dd",
"score": "0.53678626",
"text": "def delete_form_field(field_id)\n start.uri('/api/form/field')\n .url_segment(field_id)\n .delete()\n .go()\n end",
"title": ""
},
{
"docid": "5a405db557c562d298e9e7dba2b85ad1",
"score": "0.5335681",
"text": "def ReverseField(object,field)\n object.update_attribute(\"#{field}\",!object[\"#{field}\"])\n end",
"title": ""
},
{
"docid": "c8ce3161d879a92a71ed423ea83c68d9",
"score": "0.5325054",
"text": "def unset_request_data(key, value); end",
"title": ""
},
{
"docid": "2ea09fddf6f823a4f390ed2d085b9042",
"score": "0.5317832",
"text": "def untag(obj = nil)\n if obj\n # TODO: implement me.\n end\n\n @count -= 1\n\n if @count > 0\n update_attribute(:count)\n else\n self.delete()\n end\n end",
"title": ""
},
{
"docid": "b0e3f1e9631d3bddbc5bd071da94b9ab",
"score": "0.5308622",
"text": "def delete_organization_field(id:, **args)\n params = parameters(args) do\n optional_params\n end\n request(:delete, \"organizationFields/#{id}\", params)\n end",
"title": ""
},
{
"docid": "7670f40134791c1096e465799055bb18",
"score": "0.53024924",
"text": "def uncheck(field_locator)\n locate_field(field_locator, CheckboxField).uncheck\n end",
"title": ""
},
{
"docid": "240bc0d658e8e6014ae73e9239b4fda4",
"score": "0.529939",
"text": "def delete(setting)\n record.unset(setting)\n end",
"title": ""
},
{
"docid": "33dea0010238d1bee47205880f2a748d",
"score": "0.5297161",
"text": "def unset(variable)\n sym = variable.to_sym\n protect(sym) do\n @original_procs.delete(sym)\n @variables.delete(sym)\n end\n end",
"title": ""
},
{
"docid": "9cc57864728585487cd2baabdd169b75",
"score": "0.52955604",
"text": "def remove(value)\n __getobj__.delete(value)\n end",
"title": ""
},
{
"docid": "50088c0e8e2fd3a360d8c4623b1f58af",
"score": "0.52944845",
"text": "def destroy_key! attribute, key\n destroy_key(attribute, key).save\n end",
"title": ""
},
{
"docid": "00c47598746363910e9e87e3ffb98a22",
"score": "0.527674",
"text": "def unset(group_key, group_id, properties, ip=nil, optional_params={})\n properties = [properties] unless properties.is_a?(Array)\n message = {\n '$group_key' => group_key,\n '$group_id' => group_id,\n '$unset' => properties,\n }.merge(optional_params)\n message['$ip'] = ip if ip\n\n update(message)\n end",
"title": ""
},
{
"docid": "de308636c70e80dd84326d57cba6b75f",
"score": "0.52734804",
"text": "def delete!\n @value = ''\n self\n end",
"title": ""
},
{
"docid": "d9ed311b88425e0991fd35648740af56",
"score": "0.5260976",
"text": "def remove(value)\n connection.srem key_label, value\n end",
"title": ""
},
{
"docid": "a916d92025f244b27375cb5e41b03e5f",
"score": "0.52602565",
"text": "def remove_custom_field_setting(custom_field: nil, options: {}, **data)\n with_params = data.merge(custom_field: custom_field).reject { |_,v| v.nil? || Array(v).empty? }\n Resource.new(parse(client.post(\"/projects/#{id}/removeCustomFieldSetting\", body: with_params, options: options)).first, client: client)\n end",
"title": ""
},
{
"docid": "7b96d37ddc95d2cbfb01c6a29bd66378",
"score": "0.52587855",
"text": "def delete(value)\n command :zrem, [key, value]\n end",
"title": ""
},
{
"docid": "30bcc71c9f0104ae5dd763d0ceb76ea7",
"score": "0.5255157",
"text": "def unset; end",
"title": ""
},
{
"docid": "28de39ca5659e1cf77326e8f89e453c5",
"score": "0.5248587",
"text": "def []=(field, value)\n field = field.to_sym\n\n raise ArgumentError, \"invalid field #{field}\" unless fields.include?(field)\n\n if value == UNSET_FIELD or value.nil?\n @fields.delete(field)\n else\n @fields.store(field, value)\n end\n\n value\n end",
"title": ""
},
{
"docid": "091a7faab8148aee6b30d95cee408d4a",
"score": "0.52445024",
"text": "def destroy\n @field = current_user.organization.fields.find(params[:id])\n @field.destroy\n\n respond_to do |format|\n format.html { redirect_to fields_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b958d50abc3d71a4eeeea5c2058cea9e",
"score": "0.5243053",
"text": "def pull(field)\n synchronize field, :type => :pull\n end",
"title": ""
},
{
"docid": "e4c433597975e6af9aedde4a24a5bdb5",
"score": "0.5240652",
"text": "def delete(value)\n redis.srem(key, marshal(value))\n end",
"title": ""
},
{
"docid": "85a080ef0f10d51e260c583bbfe46c12",
"score": "0.5232693",
"text": "def unset_request_data(key, value)\n self.request_data.delete(key)\n end",
"title": ""
},
{
"docid": "1aba9340d5e684aab103771182632ce7",
"score": "0.52325916",
"text": "def srem(key, member)\n call(key, [:srem, key, member])\n end",
"title": ""
},
{
"docid": "280001481533d3ba99813b8243cce9b7",
"score": "0.5226901",
"text": "def decrement!(attribute, by = 1)\n decrement(attribute, by).update_attribute(attribute, self[attribute])\n end",
"title": ""
},
{
"docid": "280001481533d3ba99813b8243cce9b7",
"score": "0.5226901",
"text": "def decrement!(attribute, by = 1)\n decrement(attribute, by).update_attribute(attribute, self[attribute])\n end",
"title": ""
},
{
"docid": "280001481533d3ba99813b8243cce9b7",
"score": "0.5226901",
"text": "def decrement!(attribute, by = 1)\n decrement(attribute, by).update_attribute(attribute, self[attribute])\n end",
"title": ""
},
{
"docid": "df26215b14c616b9617cc16ca4400f98",
"score": "0.5210636",
"text": "def decrement!(attribute, by = 1)\n decrement(attribute, by).update_attribute(attribute, self[attribute])\n end",
"title": ""
},
{
"docid": "6c0c049447f13c6785a475f3d4498a59",
"score": "0.52086353",
"text": "def unset \n ::GObject::g_value_unset self\n end",
"title": ""
},
{
"docid": "3f135e5d6478dd3a693fa6f7b50f1bf7",
"score": "0.52051437",
"text": "def delete_field(list_name, field_name)\n delete \"#{base_url}/lists/#{list_name}/fields/#{field_name}\"\n end",
"title": ""
},
{
"docid": "61ea241310ee1d749622faea710934ac",
"score": "0.51997817",
"text": "def unset\n ::GObject.g_value_unset self\n end",
"title": ""
},
{
"docid": "8f1daff7caeb082a2a85300005d784d9",
"score": "0.5199199",
"text": "def remove_custom_field_setting(custom_field: required(\"custom_field\"), options: {}, **data)\n with_params = data.merge(custom_field: custom_field).reject { |_,v| v.nil? || Array(v).empty? }\n client.post(\"/portfolios/#{gid}/removeCustomFieldSetting\", body: with_params, options: options) && true\n end",
"title": ""
},
{
"docid": "d6a094ec03791c7a7532675d67f5c8f9",
"score": "0.51963997",
"text": "def unset_email_address!\n update!(email_address: nil)\n end",
"title": ""
},
{
"docid": "24e52b311f029e0e67aa8718039a9441",
"score": "0.51958454",
"text": "def decrement!(attribute, by = T.unsafe(nil), touch: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "e2445acb1347bf033f9c216b00073fc8",
"score": "0.51950634",
"text": "def unset_result\n\n @attributes.delete(FIELD_RESULT)\n end",
"title": ""
},
{
"docid": "198b8f786cd5a4bc18086dd1d92ed538",
"score": "0.518579",
"text": "def removex(attribute)\n FFI.removexattr(self.to_s, attribute, 0)\n end",
"title": ""
},
{
"docid": "8fa8a6a791834c05942229d330b139d0",
"score": "0.51857066",
"text": "def remove_value(key, value)\n @redis.lrem key, 0, value\n end",
"title": ""
},
{
"docid": "1ba924f63e2937a3b965536a96695acc",
"score": "0.5177918",
"text": "def unset(x, y)\n \t@arr[x][y] = VALUE_NOT_SET\n\t\t@complete = false\n end",
"title": ""
},
{
"docid": "12465c9fd965a0f3e40dcfe54eff506a",
"score": "0.5175374",
"text": "def unsets\n self[\"$unset\"] ||= {}\n end",
"title": ""
},
{
"docid": "7729562eac45fb36f3064eaf62be2c24",
"score": "0.5174767",
"text": "def remove(value, count: 1)\n self.connection.lrem(@key, count.to_i, value)\n end",
"title": ""
}
] |
52a5e1fc3a45edf9c8ff625dd21321ef
|
End of New Method: Create
|
[
{
"docid": "9c7d8edcfd12bdaa3aedbb8c79dba030",
"score": "0.0",
"text": "def create\n\t\t@rental = Rental.new(params[:rental])\n\t\t@rental.created_by = 1\n\t\t@rental.modified_by = 1\n\n\t\tif @rental.save\n\t\t\tflash[:notice] = 'rental Sucessfully Created.'\n\t\t\tredirect_to :action => 'list'\n\t\telse\n\t\t\t@rentaltypes = Rentaltype.find(:all)#Show all Rentaltype\n\t\t\t@wards = Ward.find(:all)\n\t\t\t@streets = Street.find(:all)\n\t\t\trender :action => 'new'\n\t\tend\n\tend",
"title": ""
}
] |
[
{
"docid": "cfa08c71c616cdc11ac3715b69147db0",
"score": "0.82246476",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "cfa08c71c616cdc11ac3715b69147db0",
"score": "0.82246476",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "cfa08c71c616cdc11ac3715b69147db0",
"score": "0.82246476",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "cfa08c71c616cdc11ac3715b69147db0",
"score": "0.82246476",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "edefb41e6036fd69564480d350745cb1",
"score": "0.8102078",
"text": "def new\n # Nothing to see here, atm\n end",
"title": ""
},
{
"docid": "3293370df38424800b58bd240b80878a",
"score": "0.7911384",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.78890145",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.78890145",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.78890145",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.78890145",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "f9047cfa0581d3a84516254e93793a2b",
"score": "0.7869714",
"text": "def new\n\t end",
"title": ""
},
{
"docid": "85821b7c901833285eb68d70d01fd111",
"score": "0.7855936",
"text": "def create\n \n end",
"title": ""
},
{
"docid": "85821b7c901833285eb68d70d01fd111",
"score": "0.7855936",
"text": "def create\n \n end",
"title": ""
},
{
"docid": "85821b7c901833285eb68d70d01fd111",
"score": "0.7855936",
"text": "def create\n \n end",
"title": ""
},
{
"docid": "85821b7c901833285eb68d70d01fd111",
"score": "0.7855936",
"text": "def create\n \n end",
"title": ""
},
{
"docid": "80e5b37354dda57fb3616a06af8ae64b",
"score": "0.7836015",
"text": "def create\n \n end",
"title": ""
},
{
"docid": "02d55518370e795dcef2ad863faa25bc",
"score": "0.77755725",
"text": "def new\n\t\t\n\tend",
"title": ""
},
{
"docid": "02d55518370e795dcef2ad863faa25bc",
"score": "0.77755725",
"text": "def new\n\t\t\n\tend",
"title": ""
},
{
"docid": "02d55518370e795dcef2ad863faa25bc",
"score": "0.77755725",
"text": "def new\n\t\t\n\tend",
"title": ""
},
{
"docid": "7f7e8878dce6ee36edf6bf35ed0abe8c",
"score": "0.77629524",
"text": "def new \n \n end",
"title": ""
},
{
"docid": "329007458141deda5281a37a26800092",
"score": "0.7722131",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "329007458141deda5281a37a26800092",
"score": "0.7722131",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "329007458141deda5281a37a26800092",
"score": "0.7722131",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "329007458141deda5281a37a26800092",
"score": "0.7722131",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "329007458141deda5281a37a26800092",
"score": "0.7722131",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "329007458141deda5281a37a26800092",
"score": "0.7722131",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "329007458141deda5281a37a26800092",
"score": "0.7722131",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "329007458141deda5281a37a26800092",
"score": "0.7722131",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "329007458141deda5281a37a26800092",
"score": "0.7722131",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "329007458141deda5281a37a26800092",
"score": "0.7722131",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "f3067ae27a99428b9fec9fcb1d099cfb",
"score": "0.77174354",
"text": "def new \n\n end",
"title": ""
},
{
"docid": "fe813c3e1fdaa795994fc415daa33168",
"score": "0.7713147",
"text": "def creator; end",
"title": ""
},
{
"docid": "a32e830a53d1143dd3fac919742f016b",
"score": "0.7676614",
"text": "def new\n \t\tsuper\n \tend",
"title": ""
},
{
"docid": "7fa10fced75e39527100936cddd56f5c",
"score": "0.76676464",
"text": "def create #:doc:\r\n end",
"title": ""
},
{
"docid": "53969dca56fd3184c671683606452d3e",
"score": "0.76643157",
"text": "def create()\n end",
"title": ""
},
{
"docid": "53969dca56fd3184c671683606452d3e",
"score": "0.76643157",
"text": "def create()\n end",
"title": ""
},
{
"docid": "53969dca56fd3184c671683606452d3e",
"score": "0.76643157",
"text": "def create()\n end",
"title": ""
},
{
"docid": "53969dca56fd3184c671683606452d3e",
"score": "0.76643157",
"text": "def create()\n end",
"title": ""
},
{
"docid": "c331af34c6632c45ce5367bc72312029",
"score": "0.76599336",
"text": "def new \n end",
"title": ""
},
{
"docid": "3d4e0c94710e6b85807d075e46c7d0c8",
"score": "0.7643617",
"text": "def create; end",
"title": ""
},
{
"docid": "3d4e0c94710e6b85807d075e46c7d0c8",
"score": "0.7643617",
"text": "def create; end",
"title": ""
},
{
"docid": "3d4e0c94710e6b85807d075e46c7d0c8",
"score": "0.7643617",
"text": "def create; end",
"title": ""
},
{
"docid": "3d4e0c94710e6b85807d075e46c7d0c8",
"score": "0.7643617",
"text": "def create; end",
"title": ""
},
{
"docid": "3d4e0c94710e6b85807d075e46c7d0c8",
"score": "0.7643617",
"text": "def create; end",
"title": ""
},
{
"docid": "3d4e0c94710e6b85807d075e46c7d0c8",
"score": "0.7643617",
"text": "def create; end",
"title": ""
},
{
"docid": "3250be4615be8f46f67d8d0079fea5cd",
"score": "0.7634632",
"text": "def new \n\n end",
"title": ""
},
{
"docid": "73fc83910cda3ab89c3bb4397171246a",
"score": "0.7618957",
"text": "def create\n # helps with boilerplateness\n end",
"title": ""
},
{
"docid": "66fe98cea91c3e4573640a669a3c00e3",
"score": "0.76185143",
"text": "def create\n\t end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.7611567",
"text": "def new; end",
"title": ""
},
{
"docid": "882711fb623c7b9e6fbab2732ffd27d6",
"score": "0.7577574",
"text": "def new\r\n end",
"title": ""
},
{
"docid": "b770bbb9369e6724767f5fc1ffb4ecd6",
"score": "0.7553706",
"text": "def new\n \t\n \tend",
"title": ""
},
{
"docid": "b3f8e078ed6cc064cf211991427dcd47",
"score": "0.7545732",
"text": "def new\r\n end",
"title": ""
},
{
"docid": "b3f8e078ed6cc064cf211991427dcd47",
"score": "0.7545732",
"text": "def new\r\n end",
"title": ""
},
{
"docid": "b3f8e078ed6cc064cf211991427dcd47",
"score": "0.7545732",
"text": "def new\r\n end",
"title": ""
},
{
"docid": "b3f8e078ed6cc064cf211991427dcd47",
"score": "0.7545732",
"text": "def new\r\n end",
"title": ""
},
{
"docid": "d0d98af0b776d08e505f6834741fdfdc",
"score": "0.75305825",
"text": "def new\n end",
"title": ""
},
{
"docid": "9f6eadf535d159853a26a4a0cc87a631",
"score": "0.75075465",
"text": "def create!\n raise 'Not implemented'\n end",
"title": ""
},
{
"docid": "4015c6de6d677ac38b6f606a9d5e76b8",
"score": "0.748606",
"text": "def new \n end",
"title": ""
},
{
"docid": "4015c6de6d677ac38b6f606a9d5e76b8",
"score": "0.748606",
"text": "def new \n end",
"title": ""
},
{
"docid": "04497f34329faddde1da11685d15e45d",
"score": "0.74765694",
"text": "def new; end",
"title": ""
},
{
"docid": "1ebcc97ed07424a04f0259c9647f17aa",
"score": "0.74604195",
"text": "def new\n super\n end",
"title": ""
},
{
"docid": "41faa708112da8b2ad80d289774cd72c",
"score": "0.745941",
"text": "def create\n \t\n end",
"title": ""
},
{
"docid": "41faa708112da8b2ad80d289774cd72c",
"score": "0.745941",
"text": "def create\n \t\n end",
"title": ""
},
{
"docid": "8c9de77eb3f8174920238eb8abf34148",
"score": "0.74459",
"text": "def new\n end",
"title": ""
},
{
"docid": "8c9de77eb3f8174920238eb8abf34148",
"score": "0.74459",
"text": "def new\n end",
"title": ""
},
{
"docid": "8c9de77eb3f8174920238eb8abf34148",
"score": "0.74459",
"text": "def new\n end",
"title": ""
},
{
"docid": "8c9de77eb3f8174920238eb8abf34148",
"score": "0.74459",
"text": "def new\n end",
"title": ""
},
{
"docid": "c3016957af6354953d0c5f32fadb4af1",
"score": "0.7439975",
"text": "def new\n\t \n end",
"title": ""
},
{
"docid": "f5956baf49087ad09fe8fe33e31c3919",
"score": "0.74332243",
"text": "def new\n super\n end",
"title": ""
},
{
"docid": "a550d8562726b280b669c5abfb3204fb",
"score": "0.741995",
"text": "def new\n\t\t# TODO\n\tend",
"title": ""
},
{
"docid": "4b1fa20b690a7df420ec23c40dc8283c",
"score": "0.74095994",
"text": "def new?; end",
"title": ""
},
{
"docid": "61b6b9d8fcb3309d77069188f63cab0b",
"score": "0.73952925",
"text": "def create; super; end",
"title": ""
},
{
"docid": "4073df8bc06fce71f2c24d02577e1831",
"score": "0.7393035",
"text": "def create\n end",
"title": ""
},
{
"docid": "4073df8bc06fce71f2c24d02577e1831",
"score": "0.7393035",
"text": "def create\n end",
"title": ""
},
{
"docid": "05979ec487b0bed4a0d1163f9581255d",
"score": "0.7391951",
"text": "def create\n super\n end",
"title": ""
},
{
"docid": "b352075350f623a31f636ea2861a5915",
"score": "0.7379097",
"text": "def new()\n\nend",
"title": ""
},
{
"docid": "1489e88a804f42a64f7b9a9af4f06915",
"score": "0.73737335",
"text": "def new\n\t\tsuper\n\tend",
"title": ""
},
{
"docid": "e3e19932c850d6c73f0462cb68c7ffc1",
"score": "0.7369084",
"text": "def create\n super\n end",
"title": ""
},
{
"docid": "e3e19932c850d6c73f0462cb68c7ffc1",
"score": "0.7369084",
"text": "def create\n super\n end",
"title": ""
},
{
"docid": "e3e19932c850d6c73f0462cb68c7ffc1",
"score": "0.7369084",
"text": "def create\n super\n end",
"title": ""
},
{
"docid": "e3e19932c850d6c73f0462cb68c7ffc1",
"score": "0.7369084",
"text": "def create\n super\n end",
"title": ""
},
{
"docid": "e3e19932c850d6c73f0462cb68c7ffc1",
"score": "0.7369084",
"text": "def create\n super\n end",
"title": ""
},
{
"docid": "e3e19932c850d6c73f0462cb68c7ffc1",
"score": "0.7369084",
"text": "def create\n super\n end",
"title": ""
},
{
"docid": "e3e19932c850d6c73f0462cb68c7ffc1",
"score": "0.7369084",
"text": "def create\n super\n end",
"title": ""
},
{
"docid": "e3e19932c850d6c73f0462cb68c7ffc1",
"score": "0.7369084",
"text": "def create\n super\n end",
"title": ""
}
] |
6f112a99f2cbe701b916e47f0ed78ad0
|
the path from the url, without the protocol and domain parts, and without the leading `/`
|
[
{
"docid": "aca373946d94f57d9f6ca9e23c237eb1",
"score": "0.7096161",
"text": "def url_file_path\n return @url_file_path if @url_file_path\n url_parts = url.match /\\A[^:]+:\\/*[^\\/]+\\/(?<path_portion>.*)/\n url_parts = url.match /\\A\\/?(?<path_portion>.*)/ unless url_parts\n @url_file_path = url_parts[:path_portion]\n end",
"title": ""
}
] |
[
{
"docid": "9d57372c484d18f8a7d010791ba4b42a",
"score": "0.8649388",
"text": "def path\r\n url.gsub(/https?:\\/\\/[^\\/]+\\//i, '').scan(/([^&]+)/i).first().first()\r\n end",
"title": ""
},
{
"docid": "7df5cafb412ac059c8565cc92f8e0b51",
"score": "0.83171934",
"text": "def path_from_url(url)\n\tresult = url.sub(/https*:\\/\\/[^\\/]*/, '') # Eliminate http[s]:// and beyond to first slash\nend",
"title": ""
},
{
"docid": "ceb1355c58d20dfa9b0a5edb707bec66",
"score": "0.7802259",
"text": "def get_path(url)\n domain = get_domain(url)\n url_parts = url.partition(domain)\n path_with_query = url_parts[2].partition(\"?\")\n path_with_query[0]\nend",
"title": ""
},
{
"docid": "716ed3df0d397e5140e65fd1b843c90f",
"score": "0.7723206",
"text": "def url_path(url)\n u = URI.parse(url)\n u.path.sub(%r{/\\d+$},'')\n end",
"title": ""
},
{
"docid": "8fa6c36c61b835862d57b217cab65974",
"score": "0.7659698",
"text": "def get_path_from_url(url)\n return url[url.index(\"/\")..url.length]\nend",
"title": ""
},
{
"docid": "9123886c90d2cf6eada08950ab352cc3",
"score": "0.7659218",
"text": "def url_2_path(url)\n\t\t#puts \"Retrieve the relative path component of the url: #{url}\" if @verbose\n\t\tbegin\n\t\t\turl.strip!\n\t\t\tbase = url_2_site(url).chop\n\t\t\tpath=url.sub(base,'')\n\t\t\t#puts \"Path component found: #{path}\" if @verbose\n\t\t\treturn path\n\t\trescue => ee\n\t\t\tputs \"Exception on method #{__method__} for #{url}: #{ee}\" if @verbose\n\t\tend\n\t\n\tend",
"title": ""
},
{
"docid": "91b446094ac9299c20857b1c8439cedb",
"score": "0.76226157",
"text": "def slashless_url(url)\n url.chomp('/')\n end",
"title": ""
},
{
"docid": "dfce06d276a0ca8c39eb73b387737fa4",
"score": "0.7615082",
"text": "def normalize_path(url); end",
"title": ""
},
{
"docid": "dfce06d276a0ca8c39eb73b387737fa4",
"score": "0.7615082",
"text": "def normalize_path(url); end",
"title": ""
},
{
"docid": "28e7a0647e117b46737cca619ffa13ed",
"score": "0.76034105",
"text": "def path\n URI.parse(@url).path\n rescue URI::InvalidURIError # Invalid URLs will be added and caught when we try to navigate to them\n @url\n end",
"title": ""
},
{
"docid": "e37b07817b62064fea13d5e751091874",
"score": "0.75266266",
"text": "def path\n URI.parse(@url).path\n end",
"title": ""
},
{
"docid": "58b747dd7805fbcab3f2615a7dd6fc1a",
"score": "0.75263894",
"text": "def only_path(url)\n URI.parse(url).tap {|uri|\n uri.scheme = nil\n uri.host = nil\n uri.port = nil\n }.to_s\n end",
"title": ""
},
{
"docid": "aff10aa48ffed62fa7fab236e8113563",
"score": "0.75106674",
"text": "def path\n return @path.sub(/^\\//,'').sub(/^%2F/,'/')\n end",
"title": ""
},
{
"docid": "6f7e2342d92f99ce9e827168e78f25d2",
"score": "0.7481326",
"text": "def full_url(url, path)\n if path.start_with?('http')\n path\n else\n url = url[0..1] if url.end_with?('/')\n path = path[1..-1] if path.start_with?('/')\n \"#{url}/#{path}\"\n end\n end",
"title": ""
},
{
"docid": "e1c2fb4d72af6f6be4bf64a178ba9987",
"score": "0.735707",
"text": "def urlpath\n path = cleanpath\n path.blank? ? '/root' : '/' + path\n end",
"title": ""
},
{
"docid": "35ad025701179c75bfc141838baacc93",
"score": "0.7341087",
"text": "def url_path\n @path ||= params[:path].present? ? params[:path].split('/') : []\n end",
"title": ""
},
{
"docid": "d170b87001ad28d5296b0072b45954ee",
"score": "0.7193821",
"text": "def full_url(path)\n uri = URI.parse path\n uri.scheme, uri.host, uri.port = request.scheme, request.host, (request.port == 80 ? nil : request.port)\n uri.to_s\n end",
"title": ""
},
{
"docid": "03811c839c000e585c658c9c5de3c7e1",
"score": "0.7182176",
"text": "def url\n ::File.join \"/\", path.to_s\n end",
"title": ""
},
{
"docid": "12a9b15f7ef91988b672d2364e240257",
"score": "0.7165091",
"text": "def normalized_request_path(path)\n if path == \"/\"\n path\n else\n path.chomp(\"/\")\n end\n end",
"title": ""
},
{
"docid": "95073561ac20ed5cf414118360cef941",
"score": "0.70945626",
"text": "def extract_path( request )\n request.traits.waves.path ||= request.path.chomp(request.ext).scan(/[^\\/]+/).map { |e| Rack::Utils.unescape(e) }\n end",
"title": ""
},
{
"docid": "b23078a1524390de20b5b22525d9d5e2",
"score": "0.70557094",
"text": "def extract_path(input)\n input_s = input.to_s\n if /^(\\w+):/.match(input_s)\n input_s.gsub(/^\\w+:[^\\/]*\\/\\/[^\\/]+(\\/[^\\?]+)(?:\\?.*)?$/, '\\1')\n else\n input_s.gsub(/(?:\\?.*)$/, '')\n end\n end",
"title": ""
},
{
"docid": "acc1eac3f8b5b12ef1068380bb2a1c66",
"score": "0.70556587",
"text": "def url(path)\n url = \"#{request.scheme}://#{request.host}\"\n\n if request.scheme == \"https\" && request.port != 443 ||\n request.scheme == \"http\" && request.port != 80\n url << \":#{request.port}\"\n end\n\n url << \"/\" unless path.index(\"/\").zero?\n url << path\n end",
"title": ""
},
{
"docid": "d016265c13fde80f45e35017ee95a391",
"score": "0.7046006",
"text": "def full_path\n uri.request_uri\n end",
"title": ""
},
{
"docid": "09b0f6d0618a2b6348f49c6129eaa4b9",
"score": "0.70364964",
"text": "def path\n @path ||= filters.uri_escape(absolute_url) if absolute_url\n end",
"title": ""
},
{
"docid": "09b0f6d0618a2b6348f49c6129eaa4b9",
"score": "0.70364964",
"text": "def path\n @path ||= filters.uri_escape(absolute_url) if absolute_url\n end",
"title": ""
},
{
"docid": "74475b810ac70386ab3a85e613bbd3c8",
"score": "0.70356596",
"text": "def extract_path(uri_or_path)\n uri = URI(uri_or_path)\n uri.kind_of?(URI::HTTP) ? uri.request_uri : uri_or_path\n end",
"title": ""
},
{
"docid": "1bcd9456d10c8d2031887cbf0781d915",
"score": "0.700349",
"text": "def request_url(url_string)\n return url_string.gsub(/\\/$/, '') if url_string.length > 1\n url_string\n end",
"title": ""
},
{
"docid": "f8c1f5c0674886987f5a83df089d04db",
"score": "0.699899",
"text": "def path_to_url(path) # find something better, full url needed for redirects per HTTP\n \"http://#{self.request.host}:#{self.request.port}/#{path.sub(%r[^/],'')}\"\n end",
"title": ""
},
{
"docid": "e759ecb87c85b7c3df2406069584f119",
"score": "0.6985412",
"text": "def uri(path)\n s = File::expand_path(path).gsub(DIR, \"\").gsub(File::SEPARATOR, '/')\n return s == '' ? '/' : s\n end",
"title": ""
},
{
"docid": "8be5270e2b15a17eab9984ff32900668",
"score": "0.69257647",
"text": "def absolutize_url(url)\n # file_path = File.expand_path(File.join(working_directory, url))\n # full_path = File.expand_path(File.join(path, url))\n # full_path.gsub(File.expand_path(path), '')\n ('/' + url.split('./').last).gsub(%r(/+), '/')\n end",
"title": ""
},
{
"docid": "6b02dca62c97fe397315c274aefa2169",
"score": "0.6925173",
"text": "def normalized_request_path(request)\n path = request.path.gsub(%r{/+}, '/').sub(%r{/$}, '')\n path.empty? ? '/' : path\n end",
"title": ""
},
{
"docid": "76a9199f9416ac05b4eefb2d7fa6e8cf",
"score": "0.6923431",
"text": "def get_path(path)\n return '' if path.blank?\n return path if path[0] == '/'\n Rails.root.to_s + '/' + path\n end",
"title": ""
},
{
"docid": "22af74b97b89780e0095ba57be77c5e1",
"score": "0.6921581",
"text": "def web_path\n # 47 char is \"/\"\n return path[0] == 47 ? path : \"/\" + path\n end",
"title": ""
},
{
"docid": "cba84f7f3b8340aab359ebedff9af4b7",
"score": "0.6914674",
"text": "def path\n @path ||= Rack::Utils.unescape(request.path_info)\n end",
"title": ""
},
{
"docid": "66f6bfb904821a2a1098eb520b43126f",
"score": "0.69054747",
"text": "def get_path(fullpath = \"\")\n (fullpath || \"\").scan(/^[\\w+|\\/]+/)[0]\n end",
"title": ""
},
{
"docid": "d1852b80b82715433bbc7418d2afcf43",
"score": "0.68901545",
"text": "def url(path = \"/\")\n uri = URI.join(\"http://#{self.base_domain}\", path)\n uri.to_s\n end",
"title": ""
},
{
"docid": "4b70efed12b13ad0e1e234ff693ff66d",
"score": "0.6868551",
"text": "def canonical_path\n p = path.gsub(/\\/+/,'/')\n p.length > 1 ? p.chomp('/') : p\n end",
"title": ""
},
{
"docid": "5874735b4cd5db053671b8c17509652c",
"score": "0.6859868",
"text": "def full_path_for(path)\n path = \"/#{path}\" unless path[0..0] == '/'\n path\n end",
"title": ""
},
{
"docid": "6bf54aa5677273cd17f50e5884ad8b0c",
"score": "0.6852472",
"text": "def host_and_path(url)\n md = url.scan(/\\/\\/([^\\/]*)(.*)/)\n return md[0][0], md[0][1]\nend",
"title": ""
},
{
"docid": "7c5867990b02f1f20001d3fc1136b636",
"score": "0.68515617",
"text": "def get_url_root(url)\n url.split('/')[0..2].join('/')\n end",
"title": ""
},
{
"docid": "be0e4a767c3240daf5804c639afae654",
"score": "0.6843377",
"text": "def path\n parse_request! if @path.nil?\n @path\n end",
"title": ""
},
{
"docid": "50e24b741ee27e1cd875e3559214878e",
"score": "0.6824823",
"text": "def url(path)\n path\n end",
"title": ""
},
{
"docid": "53ad616b94f91a7a96a61402b7f3830d",
"score": "0.68167",
"text": "def url(p = path)\n \"/\" + relative_path(p).to_s.downcase.gsub(/\\s/, \" \")\n end",
"title": ""
},
{
"docid": "f53d21873fa8c5ef036aed995cf824bc",
"score": "0.681302",
"text": "def clean_path(x)\n ip = url_unescape(x)\n ip.gsub!(/^#{Regexp.escape(root_uri_path)}/, '') if root_uri_path\n ip\n end",
"title": ""
},
{
"docid": "2b8ea1935faadbd69a32b9f38bcdfad6",
"score": "0.6799602",
"text": "def relative_url(url)\n url.gsub(%r{\\Ahttp://[^/]*}, '')\n end",
"title": ""
},
{
"docid": "47b3d66aad83b20e7a1ec314c292a714",
"score": "0.6797116",
"text": "def get_Path(initial)\n\tinitial.split(' ',3)[1]\nend",
"title": ""
},
{
"docid": "b8f875a29cc96b3ff52aab2431624787",
"score": "0.6796579",
"text": "def root_url_path\r\n root_url.to_s.gsub(/^:.+:\\d*/, '')\r\n end",
"title": ""
},
{
"docid": "1757d37314d84fc9079605003d8be765",
"score": "0.6786368",
"text": "def clean_url url\n return url if url.nil?\n url.gsub('%2F', '/').gsub(/^\\/+/, '').gsub('//', '/')\n end",
"title": ""
},
{
"docid": "c16651d0a2e739ba7e785e9f2165038e",
"score": "0.673781",
"text": "def full_url_for(path)\n path = full_path_for(path)\n uri = request.request_uri\n host = uri.scheme + \"://\" + uri.host\n port = uri.port\n host << \":#{port}\" unless port == 80\n \"#{host}#{path}\"\n end",
"title": ""
},
{
"docid": "ebb445660558c070526e754dae02a153",
"score": "0.6733351",
"text": "def unescaped_path\n path_info.split(/(%25|%2F)/i).each_slice(2).map { |v, m| CGI.unescape(v) << (m || '') }.join('')\n end",
"title": ""
},
{
"docid": "7ae10eb884daa48a237e6dfa633ab020",
"score": "0.67302865",
"text": "def page_path_from_url(url)\n ::URI.parse(url).request_uri\n end",
"title": ""
},
{
"docid": "89826458319640da62561d2e944d9016",
"score": "0.6728521",
"text": "def url_for(str)\n return str if str =~ /^[|[:alpha:]]+:\\/\\//\n File.join((uri.path.empty?) ? uri.to_s : File.dirname(uri.to_s), str)\n end",
"title": ""
},
{
"docid": "166b0b23be1489440f8d94a36b6bc79e",
"score": "0.67240554",
"text": "def relativize_path(path)\n path.to_s.gsub(/^\\/?#{Regexp.escape(root_path.to_s)}\\/?/, '')\n end",
"title": ""
},
{
"docid": "717e3abaa17d2a6fc7d8d252f59adbfc",
"score": "0.6723282",
"text": "def host_and_path(uri)\n uri = URI.parse(uri) unless uri.is_a? URI\n host = uri.host\n path = uri.path.gsub(/\\/$/, '')\n path = path.empty? ? '/' : uri.path\n URI.parse(\"#{host}#{path}\")\n end",
"title": ""
},
{
"docid": "a8ab9271190691ada4935878d7452847",
"score": "0.671535",
"text": "def get_local_path(url)\n path = url.sub(/^http\\:\\/\\/www\\.thoughtless\\.ca\\/dyn_img\\/[a-z0-9\\-]+\\//i, '')\n path.gsub('/', '-')\nend",
"title": ""
},
{
"docid": "76145b5339345838b768bc5614a30a52",
"score": "0.6688387",
"text": "def get_stripped_url(url, drop_prefix)\n result = url\n if drop_prefix && result.start_with?(\"http://\", \"https://\")\n prefix = '://'\n result = result[result.rindex(prefix)+prefix.length, result.length]\n end\n if result.end_with?('/')\n result[0...-1]\n else\n result\n end\nend",
"title": ""
},
{
"docid": "332e1a60d3fcafe9a5c7ff2ecb015a08",
"score": "0.6686337",
"text": "def request_uri(uri)\n if has_colon_path_separator?(uri)\n path = hostname_and_path(uri).split(':').all_but_first.join('/')\n else\n path = hostname_and_path(uri).split('/').all_but_first.join('/')\n path.blank? ? nil : '/' + path\n end\n end",
"title": ""
},
{
"docid": "004b6e15c132eee83982a97465138beb",
"score": "0.6668528",
"text": "def path_without_extentions\n path[/^[^.]+/]\n end",
"title": ""
},
{
"docid": "661b25ab46b8724205da8ce9e01bf858",
"score": "0.6664035",
"text": "def normalize_req_path(req_path)\n # 1) Decode the req_path with URI::decode\n req_path = URI::decode(req_path)\n # 2) Strip first\n req_path = req_path.strip\n # 3) Remove first slash \n req_path = req_path[1..-1] if req_path[0,1]=='/'\n # 4) Remove last slash\n req_path = req_path[0..-2] if req_path[req_path.length-1,1]=='/'\n req_path\n end",
"title": ""
},
{
"docid": "789fc120f363de3121684833bca43d66",
"score": "0.6653015",
"text": "def dir\n url[-1, 1] == '/' ? url : File.dirname(url)\n end",
"title": ""
},
{
"docid": "51ad76721ac638f41451db7e681c9681",
"score": "0.6651465",
"text": "def full_url(path)\n \"#{base_url}#{path}\"\n end",
"title": ""
},
{
"docid": "dc8ef697c5d4772a76ad0c9cb4592d15",
"score": "0.6645577",
"text": "def dir\n if url.end_with?(\"/\")\n url\n else\n url_dir = File.dirname(url)\n url_dir.end_with?(\"/\") ? url_dir : \"#{url_dir}/\"\n end\n end",
"title": ""
},
{
"docid": "9c0d655ab918b9e99972b354fec04285",
"score": "0.6640576",
"text": "def _path uri, subject\n [uri.request_uri, subject].join\nend",
"title": ""
},
{
"docid": "9c0d655ab918b9e99972b354fec04285",
"score": "0.6640576",
"text": "def _path uri, subject\n [uri.request_uri, subject].join\nend",
"title": ""
},
{
"docid": "0c81747273afdadfcc9d2d05688e4a0f",
"score": "0.6638405",
"text": "def extract_base_url(uri)\n root = uri.split(\"/\",4)\n root[0] + \"//\" + root[2]\n end",
"title": ""
},
{
"docid": "40ab89811e0a21d8bd82e2105acebf58",
"score": "0.66152364",
"text": "def normalize_path(path)\n path.sub(%r{^/}, '').tr('', '')\n end",
"title": ""
},
{
"docid": "ed5c49d30dd3a817e9c9b6a468c3c61e",
"score": "0.6610176",
"text": "def current_path\n return nil if current_url.nil?\n return current_url.gsub(\"http://www.example.com\",\"\")\n end",
"title": ""
},
{
"docid": "43344c9d60562916e507177844c67258",
"score": "0.6602077",
"text": "def path_for_url(dir, subdir, url)\n path = url.gsub(/^[|[:alpha:]]+:\\/\\//, '')\n path.gsub!(/^[.\\/]+/, '')\n path.gsub!(/[^-_.\\/[:alnum:]]/, '_')\n File.join(dir, subdir, path)\n end",
"title": ""
},
{
"docid": "579b9a5364d3ed183023dacfa600ba28",
"score": "0.66010547",
"text": "def get_url_for_path(path)\n @url_prefix + path\n end",
"title": ""
},
{
"docid": "579b9a5364d3ed183023dacfa600ba28",
"score": "0.66010547",
"text": "def get_url_for_path(path)\n @url_prefix + path\n end",
"title": ""
},
{
"docid": "86acec6d1e87c3dde4b7698d629feb29",
"score": "0.6598613",
"text": "def normalize_url(url)\n\t\tbegin\n\t\t\turl.strip!\n\t\t\t# Converting the scheme and host to lower case in the process, i.e. 'HTTP://www.Example.com/' => 'http://www.example.com/' \n\t\t\t# Normalize the base\n\t\t\tbase=url_2_site(url) \n\t\t\t# Case#1, remove the trailing dot after the hostname, i.e, 'http://www.yahoo.com./' => 'http://www.yahoo.com/'\n\t\t\tbase=base.sub(/\\.\\/$/,'/')\n\t\t\t# Normalize the relative path, case#1\n\t\t\t# retrieve the file path and remove the first '/' or '.', \n\t\t\t# i.e. 'http://www.example.com/mypath' or 'http://www.example.com/./mypath' => 'mypath'\n\t\t\tpath=url_2_path(url).sub(/^(\\/|\\.)*/,'')\n\t\t\t# Normalize the relative path, case#2\n\t\t\t# Replace dot-segments. \"/../\" and \"/./\" with \"/\", i.e. 'http://www.example.com/../a/b/../c/./d.html\" => 'http://www.example.com/a/c/d.html'\n\t\t\tpath=path.gsub(/\\/\\.{1,2}\\//,'/')\n\t\t\tif path.nil?\n\t\t\t\treturn base\n\t\t\telse\n\t\t\t\treturn base+path\n\t\t\tend\n\t\trescue => ee\n\t\t\tputs \"Exception on method #{__method__} for #{url}: #{ee}\" if @verbose\n\t\t\treturn url\n\t\tend\n\tend",
"title": ""
},
{
"docid": "8ee72574321b4779ca185fbe0cb3a74b",
"score": "0.6591334",
"text": "def get_path(uri)\n name = uri.gsub(\"http://\", \"\")\n dir_list = name.split(\"/\")\n return dir_list\n end",
"title": ""
},
{
"docid": "9a28500fc5bf2392498b040ebb015c87",
"score": "0.6589534",
"text": "def to_path\n path = @uri.path\n return nil if path.nil? || path.empty?\n return Wgit::Url.new('/') if path == '/'\n\n Wgit::Url.new(path).without_slashes\n end",
"title": ""
},
{
"docid": "10f5f553068523ed9557cda3661cd21e",
"score": "0.6589154",
"text": "def get_path_for(path)\n if path.respond_to?(:href)\n path = path.href\n elsif path =~ /^[^\\/]/\n if link = link_for_rel(path)\n path = link.href\n end\n end\n path\n end",
"title": ""
},
{
"docid": "e27ed17069a7c306e3a2cf3d61e1c9e1",
"score": "0.658594",
"text": "def to_path\n path = @uri.path\n return nil if path.nil? || path.empty?\n return Wgit::Url.new('/') if path == '/'\n\n Wgit::Url.new(path).omit_slashes\n end",
"title": ""
},
{
"docid": "055a508600bebb823d83cd131e32ce5a",
"score": "0.6584385",
"text": "def get_host_from_url(url)\n return url[0...url.index(\"/\")]\nend",
"title": ""
},
{
"docid": "e4a27e25db6f6b6b87287e01596efaca",
"score": "0.6581993",
"text": "def real_path(path)\n real_path = @rack_context.getRealPath(path)\n real_path.chomp!('/') if real_path\n # just use the given path if there is no real path\n real_path\n end",
"title": ""
},
{
"docid": "8cbf6b745a2764cf824b1006fbb591a0",
"score": "0.65806365",
"text": "def path\n @uri.request_uri\n end",
"title": ""
},
{
"docid": "88712bac091803aef483a6ed15a5da97",
"score": "0.6578353",
"text": "def raw_path_info_from_servlet_request(servlet_request)\n # servlet spec decodes the path info, we want an unencoded version\n # fortunately getRequestURL is unencoded, but includes extra stuff - chop it off\n sb = servlet_request.getRequestURL.toString\n # chomp off the proto, host and optional port\n sb = sb.gsub(URL_UP_TO_URI, \"\")\n\n # chop off context path if one is specified - not sure if this is desired behaviour\n # but conforms to servlet spec and then remove the search part\n if servlet_request.getContextPath == \"\"\n sb\n else\n sb.gsub(URL_CHUNK, \"\")\n end.gsub(URL_SEARCHPART, \"\")\n end",
"title": ""
},
{
"docid": "9fc461451818180e343a24024763e9f7",
"score": "0.6573566",
"text": "def full_url(req)\n \"#{url_base}#{case req; when String: req; else req.path; end}\"\n end",
"title": ""
},
{
"docid": "d5b6bfa2c11bcd167fcccd5270738bc8",
"score": "0.6571596",
"text": "def extract_path(file_path)\n return nil if file_path.nil?\n last_slash = file_path.rindex(\"/\")\n if last_slash\n file_path[0, last_slash]\n end\n end",
"title": ""
},
{
"docid": "1bf2f7b549a0b2388179b92ffe899a3a",
"score": "0.65697676",
"text": "def request_path\n [request.base_url, request.path].join\n end",
"title": ""
},
{
"docid": "44565a323992a5be5075e9c31ab0e3b4",
"score": "0.65647465",
"text": "def path\n read_attribute(:path).sub(/^[^:]+:/,'').gsub(/^\\/+/,'')\n end",
"title": ""
},
{
"docid": "baf1d020e6928b548126af8ed4ddadc0",
"score": "0.6560348",
"text": "def uri_path(str)\n str.gsub(%r{[^/]+}n) { uri_segment($&) }\n end",
"title": ""
},
{
"docid": "ec68dfa5c3c73d565f64b89af007f799",
"score": "0.6559736",
"text": "def url(*path)\n [\"#{request.scheme}://#{request.host_with_port}\", *path].join('/')\n end",
"title": ""
},
{
"docid": "edc9316c6e8e39f793903efea59ff623",
"score": "0.65435934",
"text": "def path(request)\n request.path\n end",
"title": ""
},
{
"docid": "ea54b428ddc1e728dd94b3efd1314302",
"score": "0.6528951",
"text": "def path\n `window.location.pathname`\n end",
"title": ""
},
{
"docid": "1d87a5d3c1d6b98957c2271ee8af9810",
"score": "0.6521589",
"text": "def format_path(entry)\n server_path = entry.path\n if base_path && server_path[0,base_path.length] == base_path\n if server_path == base_path\n return \".\"\n elsif server_path[base_path.length,1] == \"/\"\n return server_path[base_path.length + 1, server_path.length - base_path.length - 1]\n elsif base_path == \"/\" && server_path[0,1] == \"/\"\n return server_path[1, server_path.length - 1]\n end\n end\n server_path\n end",
"title": ""
},
{
"docid": "399c000729311e6fc980f2194abd9c86",
"score": "0.6516953",
"text": "def base_url\n @url.to_s.split('?').first\n end",
"title": ""
},
{
"docid": "906d4fa68cd8c07c849f16fa178a92db",
"score": "0.65063876",
"text": "def strip_base(env)\n stripped = nil\n req_path = env['REQUEST_PATH']\n stripped = req_path[@base_path.length..-1]\n end",
"title": ""
},
{
"docid": "2c287ee8085f6b241aa20aef2fa37755",
"score": "0.65055335",
"text": "def filename\n if url\n url.match(%r{([^\\/]+\\z)})[0]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "f1b93f1aba7baa646a66a8bbb36b1e1e",
"score": "0.6498384",
"text": "def dir\n url.end_with?(\"/\") ? url : url_dir\n end",
"title": ""
},
{
"docid": "c959f6d7c094f92cef13dfcc9299d24b",
"score": "0.64887893",
"text": "def extract_basename(input)\n input.to_s.gsub(/^.*\\/([^\\/\\?]+).*$/, '\\1')\n end",
"title": ""
},
{
"docid": "db6ff00555a15145f42d1eb1d639c948",
"score": "0.6488295",
"text": "def absolute_url\n domain + path\n end",
"title": ""
},
{
"docid": "001271393fd80e579a2e3a1c4a70c34a",
"score": "0.647732",
"text": "def remove_slashes(url)\n return url unless url.present? && url.include?('//')\n parts = url.split('//')\n return parts[0..1].join if parts.length > 2\n url\n end",
"title": ""
},
{
"docid": "7ee013412a13ca0b2e446ab9b9a379a4",
"score": "0.64761674",
"text": "def path_without_ext\n @path_without_ext ||= path.chomp(ext)\n end",
"title": ""
},
{
"docid": "60307ea7ed99bc5c64f5a8a3d515a2dc",
"score": "0.64719486",
"text": "def absolutize_url(url)\n URI.join(@request.original_url, url).to_s\n rescue URI::InvalidURIError\n nil\n end",
"title": ""
},
{
"docid": "0311b54037d71819268fe59acabde3dc",
"score": "0.64478374",
"text": "def humanish(uri)\n uri.path.split('/').last.gsub('.git', '')\n end",
"title": ""
},
{
"docid": "ee8fb21eb24e2507c892ebba7cfc3a1b",
"score": "0.6444303",
"text": "def path\n real_path = Pathname.new(root).realpath.to_s\n full_path.sub(%r{^#{real_path}/}, '')\n end",
"title": ""
},
{
"docid": "3eb2a652c794fe98971ba36be79b6656",
"score": "0.6444141",
"text": "def get_filename(url)\n url =~ /([^\\/]+?)([\\?#].*)?$/\n $&\n end",
"title": ""
}
] |
e822b31d2c35463b09ebcaefdfe065ef
|
See if the CrossRef ClickThrough Service Record says that CR_CLICKTHROUGH_CLIENT_API_TOKEN has accpted an appropriate license
|
[
{
"docid": "7da38ceaa05f8642166dbb8732b2bf7f",
"score": "0.7361867",
"text": "def has_accepted_clickthrough_license?\n\tclient_api_token = request.env['HTTP_CR_CLICKTHROUGH_CLIENT_TOKEN']\n\tclickthrough_profile = get_profile(settings.clickthrough_publisher_api_token,client_api_token)\n\tclickthrough_profile['licenses'].each do |license|\n\t\tsettings.accepted_licenses.each do |accepted_license|\n\t\t\treturn true if license['uri'] == accepted_license && license['status'] == 'accepted'\n\t\tend\n\tend\n\treturn false\nend",
"title": ""
}
] |
[
{
"docid": "fef144d4e2eb4fc50dffc0196a989b3c",
"score": "0.6541825",
"text": "def open_license?\r\n @open_license\r\n end",
"title": ""
},
{
"docid": "6d9a4ea9d5b4abd1101b4b99e0e2cc50",
"score": "0.6454036",
"text": "def supports_api\n license = License.get\n\n if license and not license.supports_api?\n errors.add :license, \" - this product does not support API access\"\n end\n end",
"title": ""
},
{
"docid": "dee8d9fb07f4da894e41277d9c2f8e59",
"score": "0.6380402",
"text": "def has_correct_license_key?\n has_license_key? && correct_license_length\n end",
"title": ""
},
{
"docid": "769f65e77babf6da0a1651e9ef58d60c",
"score": "0.63234943",
"text": "def check_license researcher\n\tif Time.now > researcher.license_check_reset_time\n\t\tLOGGER.info \"but it is time to do a periodic check with the Click-Through Service...\"\n\t\treset_license_check researcher \n\t\traise LicenseNotAccepted unless has_accepted_clickthrough_license? \n\telse\n\t\tLOGGER.info \"skip check with Click-Through service and rely on local data...\"\n\tend\nend",
"title": ""
},
{
"docid": "79a0deaf86058d81e98d565ceef88e76",
"score": "0.62443084",
"text": "def required_license?\n return true if copyright&.holder != 'Author'\n return true if license&.display_description\n\n false\n end",
"title": ""
},
{
"docid": "1072c897d5758ad0e89e1bc19e99c57d",
"score": "0.6240515",
"text": "def int_driving_license\n end",
"title": ""
},
{
"docid": "402387da3a5bc776ec77b904c73dbaef",
"score": "0.62184066",
"text": "def has_license_key?\n if Agent.config[:license_key] && Agent.config[:license_key].length > 0\n true\n else\n ::NewRelic::Agent.logger.warn(\"No license key found in newrelic.yml config. \" +\n \"This often means your newrelic.yml is missing a section for the running environment '#{NewRelic::Control.instance.env}'\")\n false\n end\n end",
"title": ""
},
{
"docid": "63745ffb452f99f5884749ab3cc8e730",
"score": "0.61965084",
"text": "def show_license_pending\n if object.license&.approval_required\n object.license_status?(current_user, \"pending\")\n else\n false\n end\n end",
"title": ""
},
{
"docid": "402fd66c810320cf9f051e9f0c9daf3c",
"score": "0.60193115",
"text": "def vcap_nr_license\n @services.find_service(NR_SERVICE_NAME)[CREDENTIALS_KEY][LICENSE_KEY]\n end",
"title": ""
},
{
"docid": "6e0237af3337adc24b99a7905819b0b7",
"score": "0.59994334",
"text": "def check_license\n log 'LICENSE not found', 'pFMQMQ' unless check? 'LICENSE*'\n end",
"title": ""
},
{
"docid": "50f8be18191e6f8de6fdc9be570970ef",
"score": "0.5995525",
"text": "def allowed?(license)\n Array(self[\"allowed\"]).include?(license)\n end",
"title": ""
},
{
"docid": "b8297e2c6645a7cac2bef33e2fd76c5c",
"score": "0.5965814",
"text": "def show_entry_license?\n updated_at >= ENTRY_LICENSE_EXPLICIT_DATE\n end",
"title": ""
},
{
"docid": "26bb63b3e4d9199fb8644bd12038c783",
"score": "0.5940802",
"text": "def usable?\n FlickrMocks::Api.default(:usable_licenses).include?(license.to_i)\n end",
"title": ""
},
{
"docid": "3a7fcf4832aaa566b391249373db9aae",
"score": "0.5931942",
"text": "def license_needs_review?(app, source, record)\n # review is not needed if the record is set as reviewed\n require_version = data_source == \"configuration\" || source.class.require_matched_dependency_version\n return false if app.reviewed?(record, require_version: require_version)\n\n # review is not needed if the top level license is allowed\n return false if app.allowed?(record[\"license\"])\n\n # the remaining checks are meant to allow records marked as \"other\"\n # that have multiple licenses, all of which are allowed\n\n # review is needed for non-\"other\" licenses\n return true unless record[\"license\"] == \"other\"\n\n licenses = record.licenses.map { |license| license_from_text(license.text) }\n\n # review is needed when there is only one license notice\n # this is a performance optimization for the single license case\n return true unless licenses.length > 1\n\n # review is needed if any license notices don't represent an allowed license\n licenses.any? { |license| !app.allowed?(license) }\n end",
"title": ""
},
{
"docid": "113ff1858076e1452bf4efb8d9be9dd7",
"score": "0.5929396",
"text": "def detect_license!\n self[\"license\"] = license_key\n self.text = [license_text, *notices].join(\"\\n\" + TEXT_SEPARATOR + \"\\n\").strip\n end",
"title": ""
},
{
"docid": "81520a21e75241e62b60ac78ce79be12",
"score": "0.59288245",
"text": "def licenses_are_available?\n !License.find_available.empty?\n end",
"title": ""
},
{
"docid": "7da63696c6864a54f2745ee100cc2b80",
"score": "0.5847768",
"text": "def check_subscription_plan\n if @institute.plan.extra_features == false\n @unauthorized = \"true\"\n @page_access = \"true\"\n @location = \"Channel Map view\"\n end \n end",
"title": ""
},
{
"docid": "e309dff2e65e0765ca70237d388679da",
"score": "0.5842975",
"text": "def check_api_key\n ClientCompany.exists?(api_key: params[\"api_key\"])\n end",
"title": ""
},
{
"docid": "01ae472040d38e0d11b38a74f5d2da42",
"score": "0.5821632",
"text": "def document_licenses\n Rantly {\n choose(\n 'Creative Commons Attribution (BY)',\n 'Creative Commons Share-alike (BY-SA)',\n 'Creative Commons Non-commercial (NC)',\n 'Creative Commons No Derivative Works (ND)',\n 'Open Data Commons Open Database License',\n 'Open Data Commons Attribution License',\n 'Open Data Commons Public Domain Dedication and License',\n 'Public Domain',\n )\n }\n end",
"title": ""
},
{
"docid": "55c0871333820993f793bb7595c7d67a",
"score": "0.5809251",
"text": "def enable_auto_project_license?\n resource_for_controller.try(:new_record?) && logged_in_and_registered? &&\n default_license_for_current_user\n end",
"title": ""
},
{
"docid": "d87e53165bde61db1327473eba1b9fb2",
"score": "0.5791001",
"text": "def check_cv_wo_policy\n # TODO\n end",
"title": ""
},
{
"docid": "2449102d5d19c0973644d4e60da1cac0",
"score": "0.5779981",
"text": "def has_correct_license_key?\n if TingYun::Agent.config[:license_key] && TingYun::Agent.config[:license_key].length > 0\n true\n else\n TingYun::Agent.logger.warn(\"No license key found. \" +\n \"This often means your tingyun.yml file was not found, or it lacks a section for the running environment,'#{::TingYun::Frameworks.framework.env}'. You may also want to try linting your tingyun.yml to ensure it is valid YML.\")\n false\n end\n end",
"title": ""
},
{
"docid": "694723f1d337bf87e6f397e52a7238a9",
"score": "0.5771755",
"text": "def is_new_key_required?\n api_credentials = KitSaasSharedCacheManagement::ApiCredentials.new([@client_id]).fetch[@client_id]\n api_credentials.length == 0\n end",
"title": ""
},
{
"docid": "9e130e07373ea8a0ce38b53f6547e013",
"score": "0.5767049",
"text": "def authorized?\n !response.nil? && response.header_result == 'A' && invoices_result\n end",
"title": ""
},
{
"docid": "caf36eb7e3f64d30309f9e0cb5207bee",
"score": "0.5742696",
"text": "def AcceptedLicenseAndInfoFile(src_id)\n ret = ProductLicense.AskAddOnLicenseAgreement(src_id)\n if ret == nil\n return nil\n elsif ret == :abort || ret == :back\n Builtins.y2milestone(\"License confirmation failed\")\n return false\n end\n true\n end",
"title": ""
},
{
"docid": "f2f7a9065aaf81db3e46205e63fc480c",
"score": "0.5741732",
"text": "def token_renewable?\n token_creatable_externally? || (api_key_present? && !token_option)\n end",
"title": ""
},
{
"docid": "5fd541f2e7e7ba4da019b71c4d59b0e9",
"score": "0.571447",
"text": "def license_restrictions\n if User.count >= MAXIMUM_ACCOUNTS_FOR_LICENSE \n errors.add_to_base \"We are unable to create your account. This software is licensed for #{MAXIMUM_ACCOUNTS_FOR_LICENSE} accounts.\"\n return false\n end\n return true\n end",
"title": ""
},
{
"docid": "fcead5ca2cfbdafda84effc1758bfa2d",
"score": "0.5707952",
"text": "def creative_commons?\n url =~ %r{creativecommons.org/licenses}i\n end",
"title": ""
},
{
"docid": "76af757f3fe6df57ae7a1bf2c3a12e8c",
"score": "0.570208",
"text": "def licensed_resources\n find_related_frbr_objects( :licenses, :which_resources?) \n end",
"title": ""
},
{
"docid": "f85ebd5ea0f3e56fd5089dc2ff803677",
"score": "0.56801605",
"text": "def restrict_access\n puts \"[INFO][Application] Checking for API key\"\n authorized = ApiKey.exists?(access_key: api_key_from_header)\n puts \"[INFO][Application] Access authorized? #{authorized}\"\n error! :unauthenticated if !authorized\n end",
"title": ""
},
{
"docid": "0dadc2d646169e90938e16222ea9f892",
"score": "0.5641905",
"text": "def is_evaluation_license\n super\n end",
"title": ""
},
{
"docid": "dd1920df08e0ddee53b9c23edd3e5f88",
"score": "0.5608587",
"text": "def evaluate_license_url\n if url\n url.to_s\n elsif license_type == 'No Creative Commons License'\n 'https://rightsstatements.org/page/InC-EDU/1.0/'\n end\n end",
"title": ""
},
{
"docid": "21720a799984c83458f9754e515001d3",
"score": "0.55945724",
"text": "def authorized_client?\n request.env['X_AUTH_INTERNAL_TOKEN'] == INTERNAL_TOKEN\n end",
"title": ""
},
{
"docid": "975b3a9761a92c3ee8247335c1f07285",
"score": "0.5569657",
"text": "def license?\n @license ||= @lines.any? do |line|\n break true if line =~ /licen[sc]e/i # \"License\" or \"Licence\"\n break true if line =~ /all rights(?: reserved)?/i # \"All rights reserved\"\n\n # Popular licenses\n break true if line =~ /(?:^|\\W)\\(?BSD(?:v?3)\\)?(?:$|\\W)/ # \"BSD\", \"BSD3\", \"BSDv3\" or wrapping any of those in parentheses\n break true if line =~ /(?:^|\\W)\\(?MIT\\)?(?:$|\\W)/ # \"MIT\" or \"(MIT)\"\n break true if line =~ /(?:^|\\W)Apache(?:$|\\W)/i # \"Apache\"\n break true if line =~ /(?:^|\\W)Creative Commons(?:$|\\W)/i\n break true if line =~ /(?:^|\\W)GNU Public Licen[sc]e(?:$|\\W)/i # \"GNU Public License\"\n break true if line =~ /(?:^|\\W)\\(?[AL]?GPL\\)?(?:$|\\W)/ # GPL, AGPL, LGPL licenses\n\n false\n end\n end",
"title": ""
},
{
"docid": "1b84321568ec0a612acc58a0078d1bd8",
"score": "0.5567944",
"text": "def restrict_access\n authenticate_or_request_with_http_token do |token, options|\n if ApiKey.exists?(auth_token: token)\n if ApiKey.find_by_auth_token(token) \n return true\n else\n return false\n end\n end\n end\n end",
"title": ""
},
{
"docid": "162097149d520602db11d7ee53e4229b",
"score": "0.55618507",
"text": "def license_capability\n return @license_capability\n end",
"title": ""
},
{
"docid": "373c87765343bbbf0b3b98d8572a021f",
"score": "0.55538523",
"text": "def validate_license_info\n # First check the project licensing information\n\n # Check existence of licensing information\n if project.license == \"Unspecified\"\n licensing_warning(\"Project '#{project.name}' does not contain licensing information.\")\n end\n\n # Check license file exists\n if project.license != \"Unspecified\" && project.license_file.nil?\n licensing_warning(\"Project '#{project.name}' does not point to a license file.\")\n end\n\n # Check used license is a standard license\n if project.license != \"Unspecified\" && !STANDARD_LICENSES.include?(project.license)\n licensing_info(\"Project '#{project.name}' is using '#{project.license}' which is not one of the standard licenses identified in https://opensource.org/licenses/alphabetical. Consider using one of the standard licenses.\")\n end\n\n # Now let's check the licensing info for software components\n license_map.each do |software_name, license_info|\n # First check if the software specified a license\n if license_info[:license] == \"Unspecified\"\n licensing_warning(\"Software '#{software_name}' does not contain licensing information.\")\n end\n\n # Check if the software specifies any license files\n if license_info[:license] != \"Unspecified\" && license_info[:license_files].empty?\n licensing_warning(\"Software '#{software_name}' does not point to any license files.\")\n end\n\n # Check if the software license is one of the standard licenses\n if license_info[:license] != \"Unspecified\" && !STANDARD_LICENSES.include?(license_info[:license])\n licensing_info(\"Software '#{software_name}' uses license '#{license_info[:license]}' which is not one of the standard licenses identified in https://opensource.org/licenses/alphabetical. Consider using one of the standard licenses.\")\n end\n end\n end",
"title": ""
},
{
"docid": "47ed31dbfa323681e44d32b637b4cdc3",
"score": "0.55231404",
"text": "def legal_release_for_client?\n if(!release)\n errors.add(:release, \"is not specified\")\n elsif(!release.service)\n errors.add(:release, \"does not belong to a service\")\n elsif(!release.service.clients.include? client)\n errors.add(:release, \"does not belong to a service client #{client.name ? client.name : nil} has a contract for.\")\n end\n end",
"title": ""
},
{
"docid": "58d63594bdb8e9aec16363e4de6ba779",
"score": "0.55223715",
"text": "def verify(license_config)\n # If no license, it will just run LGPL components without anything extra\n return unless license_config.token\n\n public_key = OpenSSL::PKey::RSA.new(File.read(PUBLIC_KEY_LOCATION))\n\n # We gsub and strip in case someone copy-pasted it as a multi line string\n formatted_token = license_config.token.strip.delete(\"\\n\").delete(' ')\n decoded_token = Base64.decode64(formatted_token)\n\n begin\n data = public_key.public_decrypt(decoded_token)\n rescue OpenSSL::OpenSSLError\n data = nil\n end\n\n details = data ? JSON.parse(data) : raise_invalid_license_token(license_config)\n\n license_config.entity = details.fetch('entity')\n end",
"title": ""
},
{
"docid": "ae86066e04740109445e3585efe8a5a2",
"score": "0.55145085",
"text": "def sponsor_all_agreed\n ethics == true and code_of_conduct == true and sponsor_terms == true\n end",
"title": ""
},
{
"docid": "cc192dea2f6530e34807ad863ac4c750",
"score": "0.55085015",
"text": "def may_need_coapplicant_signature?\n [\"Loan Estimate\", \"Servicing Disclosure\"].include? name\n end",
"title": ""
},
{
"docid": "2a97cc7de9078be628d2be17bb988b54",
"score": "0.550178",
"text": "def partially_approved?\n !sign_document_key? &&\n installments.any? { |i| i.approved? } &&\n installments.any? { |i| i.rejected? || i.rejected_consent? } &&\n installments.all? { |i| i.approved? || i.rejected? || i.rejected_consent?}\n end",
"title": ""
},
{
"docid": "fb631bcbe8651cc32b5239417b700e7c",
"score": "0.54988146",
"text": "def licensee\n 'Not licensed'\n end",
"title": ""
},
{
"docid": "f844ff3860c10d86b52936b6601e7bc1",
"score": "0.5492311",
"text": "def access_control\n api_key = request.headers['X-Api-Key']\n access_ok = Api.find_by key: api_key\n\n unless access_ok\n head status: :forbidden\n false\n end\n end",
"title": ""
},
{
"docid": "171e57cdf4052afd0d922c0a8c1c3c81",
"score": "0.5486205",
"text": "def license_required?(mixlib_name, version)\n product = product_reader.lookup_by_mixlib(mixlib_name)\n return false if product.nil?\n # If they don't pass a version we assume they want latest\n # All versions in all channels require license acceptance\n return true if %w{latest unstable current stable}.include?(version.to_s) || version.nil?\n\n Gem::Version.new(version) >= Gem::Version.new(product.license_required_version)\n end",
"title": ""
},
{
"docid": "7bbfe40a6e6c0021b401f7735c5142d7",
"score": "0.5484054",
"text": "def verify()\n key = @client_id + ':' + @client_secret\n self.class.headers 'Authorization' => 'Basic ' + Base64.encode64(key)\n\n resp = self.class.get '/v2/license/security/authorizeToken?authToken=' + @access_token\n\n return false if resp.code != 200\n return false unless resp['AuthorizeTokenResultVO']\n return false unless resp['AuthorizeTokenResultVO']['authenticateUserID']\n\n @user_id = resp['AuthorizeTokenResultVO']['authenticateUserID']\n\n return true\n end",
"title": ""
},
{
"docid": "23caaac67b80444cf3ac66666ea5353f",
"score": "0.54826355",
"text": "def get_license_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiLicensingApi.get_license ...'\n end\n # resource path\n local_var_path = '/license'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['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 => 'License')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiLicensingApi#get_license\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "16f2b70e94260dd23ff53d704399deb4",
"score": "0.5479395",
"text": "def authorized?\n api_key = request.env[\"HTTP_KEY\"] # \"HTTP_AUTHORIZATION\" \n #STDERR.puts request.inspect\n \n # return data in case of authorized API_KEY\n (ALLOWED_KEYS.include? api_key) ? true : false \n end",
"title": ""
},
{
"docid": "d7b48a6375dc3f7bf83e03b994ed509c",
"score": "0.5462822",
"text": "def license\n @license or self.license_r\n end",
"title": ""
},
{
"docid": "c85e318c060872b445a0b00532758740",
"score": "0.5459583",
"text": "def agreement\n \"I have read the License Agreement(s), and by downloading the software, I agree to the terms of the agreement (yes|no):\"\n end",
"title": ""
},
{
"docid": "e9c083d76c2de00ae5a2b6cdfe6dd5b4",
"score": "0.5458548",
"text": "def get_license_type\n return Rails.application.config.x.license_types.key(self.copyright_license)\n end",
"title": ""
},
{
"docid": "f04a9f3e16cc05c2fe3ebf2236e3d608",
"score": "0.5456511",
"text": "def api_key_required?\n GritHttp.config[:protection] == true\n end",
"title": ""
},
{
"docid": "6904a4a6c482ca48ab5e6abdb58f39aa",
"score": "0.5445639",
"text": "def shared_with_client?\n self.access_rights && self.access_rights.to_i == 4\n end",
"title": ""
},
{
"docid": "ff81fc52c8b55dbcc94e971bcec0a87b",
"score": "0.5445614",
"text": "def mpl?\n highline.say license\n highline.agree agreement\n end",
"title": ""
},
{
"docid": "86fd3763c9f41cc6648883bca9877a32",
"score": "0.5428688",
"text": "def required_api_key_parts; end",
"title": ""
},
{
"docid": "be3f3c7b5f2a66ebd100b696975aaa46",
"score": "0.54183936",
"text": "def api_accessible?\n oauth_token.present? && (!oauth_expires || (Time.now+1.hour).to_i < oauth_expires_at.to_i)\n end",
"title": ""
},
{
"docid": "887b4804f17438e29bdfcb6a92300da7",
"score": "0.54055715",
"text": "def paid?\n [STATUS_PREAUTH, STATUS_CAPTURE].include? status\n end",
"title": ""
},
{
"docid": "f100d6288fd7f5dab56b5d76f96be0b9",
"score": "0.54049575",
"text": "def data_licence_determined_from_responses\n @data_licence_determined_from_responses ||= licence_from_ref(:data_licence)\n end",
"title": ""
},
{
"docid": "93d5b2ebe08a03a0643034330e5d9b10",
"score": "0.53985",
"text": "def access_renewal_request_allowed?(token_sha)\n TemporaryAccessToken.access_request_allowed_for?(token_sha)\n end",
"title": ""
},
{
"docid": "ef35bbfd158d8ea07c33c5b799ef6b38",
"score": "0.5395922",
"text": "def license_code_exists\n found_value = false\n find('table[id*=\"gridLicences_DXMainTable\"] > tbody').all('tr').map do |row|\n row.all('td').map do |cell|\n if cell.text.strip.downcase.match 'no data'\n found_value = true\n elsif cell.text.strip == 'abc123' || cell.text.strip == '1/1/2000'\n end\n break if found_value\n end\n break if found_value\n end\n found_value\n end",
"title": ""
},
{
"docid": "7ec3449682ef5d3a1c27c0213773ba5f",
"score": "0.53696674",
"text": "def license\n read_property 'License'\n end",
"title": ""
},
{
"docid": "f155b80b747a9989109d517f41e732b0",
"score": "0.5367804",
"text": "def licensing_authority\n data['licensingAuthorityName']\n end",
"title": ""
},
{
"docid": "7991cb732c8e18aee6efa2eb59fa386d",
"score": "0.53659254",
"text": "def check_if_product_supports_api_version(product_code, version)\n path = \"/d2l/api/#{product_code}/versions/#{version}\"\n _get(path)\nend",
"title": ""
},
{
"docid": "4d35007eeab386dc76a233719a352926",
"score": "0.5362759",
"text": "def restrict_access\n\t\tauthenticate_or_request_with_http_token do |token, option|\n\t\t\tApiKey.exists?(access_token: token)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "6fce6200f4a4942d710829b1f1fcfded",
"score": "0.53624696",
"text": "def check_license\n Chef::Log.debug(\"Checking if we need to accept Chef license to bootstrap node\")\n version = config[:bootstrap_version] || Chef::VERSION.split(\".\").first\n acceptor = LicenseAcceptance::Acceptor.new(logger: Chef::Log, provided: Chef::Config[:chef_license])\n if acceptor.license_required?(\"chef\", version)\n Chef::Log.debug(\"License acceptance required for chef version: #{version}\")\n license_id = acceptor.id_from_mixlib(\"chef\")\n acceptor.check_and_persist(license_id, version)\n Chef::Config[:chef_license] ||= acceptor.acceptance_value\n end\n end",
"title": ""
},
{
"docid": "7443834fbb0c5f80afd4cd2e9933580e",
"score": "0.53519833",
"text": "def restrict_access\n authenticate_or_request_with_http_token do |token,option|\n ApiKey.exists?(access_token: token)\n end\n end",
"title": ""
},
{
"docid": "2b985c80c82ffe29f266f171d84977fc",
"score": "0.53479856",
"text": "def verify_access\n return false unless (request.ssl? || (RAILS_ENV == 'development') || (RAILS_ENV == 'test'))\n authenticate_or_request_with_http_basic(\"PeepCode\") do |merchant_id, merchant_key|\n (merchant_id == GOOGLE_ID) && (merchant_key == GOOGLE_KEY)\n end\n end",
"title": ""
},
{
"docid": "07e1bce89f713d78fc69ac6184dad666",
"score": "0.53459066",
"text": "def correct_license_length\n key = Agent.config[:license_key]\n\n if key.length == 40\n true\n else\n ::NewRelic::Agent.logger.error(\"Invalid license key: #{key}\")\n false\n end\n end",
"title": ""
},
{
"docid": "9911c6250c61b1e4b0b06349cbd4b246",
"score": "0.5344401",
"text": "def verify\n return false if @response.nil?\n # - que el campo 'source' del ticket se corresponda con el DN del WSAA\n a = @response['header']['source'].upcase == @request.destination.upcase\n # - que el campo 'destination' del ticket se corresponda con el DN del CEE\n b = @response['header']['destination'].upcase == @request.source.upcase\n # - que el ticket no haya expirado\n c = Time.xmlschema(@response['header']['expirationTime']) > Time.now\n # - que el ticket no tenga una fecha de generacion posterior a la actual\n d = Time.xmlschema(@response['header']['generationTime']) < Time.now\n # - que el ticket tenga los campos token y sign de tipo string\n a && b && c && d\n end",
"title": ""
},
{
"docid": "a1e77eeab4330604987ceda5cb05ffa6",
"score": "0.5339493",
"text": "def restrict_access\n authenticate_or_request_with_http_token do |token, options|\n ApiKey.exists?(access_token: token)\n end\n end",
"title": ""
},
{
"docid": "a1e77eeab4330604987ceda5cb05ffa6",
"score": "0.5339493",
"text": "def restrict_access\n authenticate_or_request_with_http_token do |token, options|\n ApiKey.exists?(access_token: token)\n end\n end",
"title": ""
},
{
"docid": "0c2be4ed59d335f1384d22112dfdb9f8",
"score": "0.533751",
"text": "def content_licence_determined_from_responses\n @content_licence_determined_from_responses ||= licence_from_ref(:content_licence)\n end",
"title": ""
},
{
"docid": "71ec83a3c531aa29d50e0f5219708f42",
"score": "0.5336383",
"text": "def restoration_agreement?\n (application_type == 'LO-RA')\n end",
"title": ""
},
{
"docid": "71ec83a3c531aa29d50e0f5219708f42",
"score": "0.5336383",
"text": "def restoration_agreement?\n (application_type == 'LO-RA')\n end",
"title": ""
},
{
"docid": "7f29ba105eb433fedccfbd5004615db4",
"score": "0.53319126",
"text": "def get_license_by_key_with_http_info(license_key, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiLicensingApi.get_license_by_key ...'\n end\n # verify the required parameter 'license_key' is set\n if @api_client.config.client_side_validation && license_key.nil?\n fail ArgumentError, \"Missing the required parameter 'license_key' when calling ManagementPlaneApiLicensingApi.get_license_by_key\"\n end\n # resource path\n local_var_path = '/licenses/{license-key}'.sub('{' + 'license-key' + '}', license_key.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['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 => 'License')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiLicensingApi#get_license_by_key\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "5fa54d8620310f05a98e58e4e1d05d69",
"score": "0.5331464",
"text": "def verify_access_with_api_key\n # grab the api key from the post request headers\n api_key = request.headers[\"HTTP_API_KEY\"]\n andrew_id = request.headers[\"HTTP_ANDREW_ID\"]\n if (api_key.nil?)\n render json: {error: \"Error, bad request\"}, status: 400\n end\n if !(key_matches?(api_key))\n render json: {error: \"Error, unauthorized user or API key\"}, status: 401\n end\n end",
"title": ""
},
{
"docid": "c5e0f1b641de18984eb49c348ee48ac2",
"score": "0.53308666",
"text": "def return_selectable_licenses()\n LICENSES\n end",
"title": ""
},
{
"docid": "c447fa9947fe0b5fdbff8852792e83b1",
"score": "0.5330544",
"text": "def license\n @license ||= matched_file && matched_file.license\n end",
"title": ""
},
{
"docid": "995a4e954fe7e3bc3f7d27c7df7aa7ba",
"score": "0.5328092",
"text": "def license_key\n return \"none\" unless license\n license.key\n end",
"title": ""
},
{
"docid": "f228e1a10c33eac20232e719951b0a96",
"score": "0.53217196",
"text": "def restrict_access\n authenticate_or_request_with_http_token do |token,options|\n ApiKey.exists?(access_token: token)\n end\n end",
"title": ""
},
{
"docid": "124ae1e66ad34e53a574a698f9788c41",
"score": "0.53206354",
"text": "def api_accessible?\n oauth_token.present? && oauth_secret.present? && (!oauth_expires || (Time.now+1.hour).to_i < oauth_expires_at.to_i)\n end",
"title": ""
},
{
"docid": "3722f66e7792066298635a7fa23b1d9d",
"score": "0.53189397",
"text": "def add_license(key, start_date, end_date)\n license_there = false\n if license_there == license_code_exists\n else\n add_new.click\n license_key.set key\n license_start_date.set start_date\n license_end_date.set end_date\n #add_license.click # this step has some serious funky issue thus clicking by xpath below\n find(:xpath, \"//*[@id='ctl00_Content_gridLicences_DXEditingRow']/td[5]/img[1]\").click\n sleep 3\n end\n end",
"title": ""
},
{
"docid": "70c85bb880b58037363c48040c441894",
"score": "0.5318733",
"text": "def vehicles_checker_api\n @vehicles_checker_api ||= VehiclesCheckerApi.licence_info(vrn)\n end",
"title": ""
},
{
"docid": "1f6745b279abddd8e2da4b341121693d",
"score": "0.530676",
"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": "6df7176f3a679840a0afc4d64d663cc0",
"score": "0.5304246",
"text": "def infringes_copyright?\n rejection_reason == 'copyright' if video?\n end",
"title": ""
},
{
"docid": "9868668e608de4900a6c4832e09c16da",
"score": "0.5304124",
"text": "def validate_license\n self.languages.each do |locale|\n logger.debug \"******** validate_license, locale = #{locale}\"\n logger.debug \"******** - title present: #{self.license_title_translations[locale].present?}; desc present: #{self.license_description_translations[locale].present?}; url present: #{self.license_url_translations[locale].present?}\"\n if self.license_title_translations[locale].present? || self.license_description_translations[locale].present? || self.license_url_translations[locale].present?\n # some license info exists, make sure title and desc provided\n logger.debug \"******** - something is present, title or desc not present: #{!(self.license_title_translations[locale].present? && self.license_description_translations[locale].present?)} \"\n if !(self.license_title_translations[locale].present? && self.license_description_translations[locale].present?)\n errors.add(:base, I18n.t('errors.messages.license_requirements',\n language: Language.get_name(locale) ))\n return\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9d6e49dc05f28c9aebba957c59a7520e",
"score": "0.5303639",
"text": "def is_credit? #es credito cuando tiene un purchase invoice id\n not purchase_invoice_id.nil?\n end",
"title": ""
},
{
"docid": "53037351fcd986c57c751b16af38b381",
"score": "0.5294428",
"text": "def premium_api?\n !shared_secret.nil?\n end",
"title": ""
},
{
"docid": "91f27afa12531cdc95825e7d49785cd9",
"score": "0.52906686",
"text": "def restrict_access\n authenticate_or_request_with_http_token do |token, options|\n ApiKey.exists?(access_token: token)\n end\n end",
"title": ""
},
{
"docid": "91f27afa12531cdc95825e7d49785cd9",
"score": "0.52906686",
"text": "def restrict_access\n authenticate_or_request_with_http_token do |token, options|\n ApiKey.exists?(access_token: token)\n end\n end",
"title": ""
},
{
"docid": "944903cc481c5f23d40944f213753d24",
"score": "0.52899146",
"text": "def restrict_access\n \tauthenticate_or_request_with_http_token do |token, options|\n \t\tApiKey.exists?(access_token: token)\n \tend\n end",
"title": ""
},
{
"docid": "1efbdb35c2ccf63138b7ce5364e0efa3",
"score": "0.5287455",
"text": "def folio_disclaimer(document)\n # this flag is set in searchworks-folio-dev shared_configs\n return false unless Settings.folio.disclaimer\n return false unless document['folio_json_struct'] && document['marc_json_struct']\n\n marc_source = JSON.parse(document['folio_json_struct']&.first)&.dig('instance', 'source') == 'MARC'\n # currently FOLIO MARC records have a leader that starts with 8 spaces\n marc_source && document.to_marc&.leader&.match(/^ {8}/)\n end",
"title": ""
},
{
"docid": "c11405445c5a42fb654af66c712bb32f",
"score": "0.52745646",
"text": "def license\n @license || 'Unknown'\n end",
"title": ""
},
{
"docid": "7bb2dd069aeaff8a0c350faeca991bbd",
"score": "0.52745587",
"text": "def verify_purchase\n response =\n HTTP.auth(@access_token)\n .get(\"https://pardakht.cafebazaar.ir/devapi/v2/api/validate/#{@package_name}/inapp/#{@sku}/purchases/#{@purchase_token}/\", )\n validate_verification_response response\n end",
"title": ""
},
{
"docid": "8f18d461d89dbd75f090f45adb605ec0",
"score": "0.5268248",
"text": "def get_license_key(id, licensekeyname) path = \"/api/v2/accounts/#{id}/licensekey/#{licensekeyname}\"\n get(path, {}, AvaTax::VERSION) end",
"title": ""
},
{
"docid": "800d1ee2f7fa7e98ede957dc155dba27",
"score": "0.52679735",
"text": "def consented?\n consent_given_code == NcsCode::YES\n end",
"title": ""
},
{
"docid": "7a724fdf7d586190fe365aaa453928dd",
"score": "0.5265472",
"text": "def restrict_access \n authenticate_or_request_with_http_token do |token, options|\n ApiKey.exists?(access_token: token)\n end\n end",
"title": ""
},
{
"docid": "eeb367f580a5909b12a75ac220d78fb6",
"score": "0.52626216",
"text": "def cdk?\n true\n end",
"title": ""
},
{
"docid": "8a4e9b988ca0dbcf50d1fec56ba420b7",
"score": "0.5261289",
"text": "def has_valid_api_key\n return self.token != nil && api_key_valid_until > Time.now\n end",
"title": ""
},
{
"docid": "4a97b0ad28c6e85e6ab43021861aa24f",
"score": "0.5256337",
"text": "def licensed_as_creative_commons?\n license == 'creativeCommon' if video?\n end",
"title": ""
}
] |
0b8159948263ed9bc45e1f84bae00daf
|
Returns the application categories for traffic shaping rules.
|
[
{
"docid": "7f9a51d194b9ef853899836af3e361d8",
"score": "0.6856869",
"text": "def get_network_traffic_shaping_application_categories(network_id)\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => network_id\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/trafficShaping/applicationCategories'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => network_id\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\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) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end",
"title": ""
}
] |
[
{
"docid": "5dd95d870c641f7947c6d9c05ffaa6f1",
"score": "0.6558476",
"text": "def categories\n unless self.SUPPRESS_FROM_OPAC == 'T' or self.SUPPRESS_FROM_INDEX == 'T'\n add_category('opac')\n end\n @categories\n end",
"title": ""
},
{
"docid": "6b7aac24eba9c018ec4f1d885f05b425",
"score": "0.6531396",
"text": "def categories\n @cat_hash.keys\n end",
"title": ""
},
{
"docid": "6b7aac24eba9c018ec4f1d885f05b425",
"score": "0.6531396",
"text": "def categories\n @cat_hash.keys\n end",
"title": ""
},
{
"docid": "6b7aac24eba9c018ec4f1d885f05b425",
"score": "0.6531396",
"text": "def categories\n @cat_hash.keys\n end",
"title": ""
},
{
"docid": "a13a7aca87f6854af4c89d0d03658baf",
"score": "0.6505292",
"text": "def cats\n return unless %w[EmsCluster Host Storage AvailabilityZone HostAggregate].include?(model)\n\n self[:cats] ||=\n begin\n cats = Classification.categories.select(&:show).sort_by(&:description)\n cats.delete_if { |c| c.read_only? || c.entries.empty? }\n ret_cats = {'<None>' => '<None>'}\n case model\n when 'Host', 'Storage', 'AvailabilityZone', 'HostAggregate'\n cats.each { |c| ret_cats['Vm:' + c.name] = 'VM ' + c.description }\n when 'EmsCluster'\n cats.each { |c| ret_cats['Host:' + c.name] = 'Host ' + c.description }\n cats.each { |c| ret_cats['Vm:' + c.name] = 'VM ' + c.description }\n end\n ret_cats\n end\n end",
"title": ""
},
{
"docid": "23071935b59518a89a9aca9a5cfb4146",
"score": "0.64918786",
"text": "def get_all_apps_with_categories \n get(\"/appcon.json/\")\n end",
"title": ""
},
{
"docid": "d7b0b4c4fa809885e5098652c7bd3d0e",
"score": "0.6403742",
"text": "def get_categories\n metadata['catgry'].collect do | category |\n Category.new category\n end\n end",
"title": ""
},
{
"docid": "75c83fb66b288f116de2098ff3043fad",
"score": "0.6388514",
"text": "def categories\n categories = []\n categories << \"Memory\" if memory\n categories << \"CPU\" if cpu\n categories << \"Network\" if network\n categories << \"Battery\" if battery\n categories\n end",
"title": ""
},
{
"docid": "1945f36528d833e24d02acb7c3d412f0",
"score": "0.63365406",
"text": "def get_appcon_categories \n get(\"/appcon.json/categories\")\n end",
"title": ""
},
{
"docid": "98188b1b733c7e5f10d617b1d00e0e80",
"score": "0.6312547",
"text": "def categories\n @category_count.keys\n end",
"title": ""
},
{
"docid": "51d3b2a6c986b3386ce6c4e30e0775e6",
"score": "0.6258028",
"text": "def categories\n value(\"CATEGORIES\")\n end",
"title": ""
},
{
"docid": "51d3b2a6c986b3386ce6c4e30e0775e6",
"score": "0.6258028",
"text": "def categories\n value(\"CATEGORIES\")\n end",
"title": ""
},
{
"docid": "51d3b2a6c986b3386ce6c4e30e0775e6",
"score": "0.6258028",
"text": "def categories\n value(\"CATEGORIES\")\n end",
"title": ""
},
{
"docid": "51d3b2a6c986b3386ce6c4e30e0775e6",
"score": "0.6258028",
"text": "def categories\n value(\"CATEGORIES\")\n end",
"title": ""
},
{
"docid": "291c3ac012820b20ee940e983fbcd6be",
"score": "0.6256151",
"text": "def categories\n category\n end",
"title": ""
},
{
"docid": "efce1062dc9ea6e18373fe17e5c9dd42",
"score": "0.6208609",
"text": "def categories\n []\n end",
"title": ""
},
{
"docid": "76852ee87c2fb57d27d97d1800518a47",
"score": "0.6188348",
"text": "def categories\n value('CATEGORIES')\n end",
"title": ""
},
{
"docid": "2427e38715e9b5f237e5116ce2758e76",
"score": "0.6162569",
"text": "def categories\n categories_property.map {|prop| prop ? prop.ruby_value : prop}\n end",
"title": ""
},
{
"docid": "160d5097532fdcf8cad67dd3b224ba08",
"score": "0.60996044",
"text": "def categories\n response = HTTParty.get('https://www.boardgameatlas.com/api/game/categories?&client_id=' + ENV['CLIENT_ID'])\n @categories = response[\"categories\"]\n end",
"title": ""
},
{
"docid": "c4bccb7ce948b5411ca9fe4a0ee0a829",
"score": "0.60990214",
"text": "def category_rules\n calculation_categories.includes(mappings: %i[category discipline]).map do |calculation_category|\n category = Calculations::V3::Models::Category.new(calculation_category.category.name)\n Calculations::V3::Models::CategoryRule.new(\n category,\n mappings: calculation_category.mappings.map { |mapping| model_mapping(mapping) },\n maximum_events: calculation_category.maximum_events,\n reject: calculation_category.reject?\n )\n end\n end",
"title": ""
},
{
"docid": "6743fcdd33b1e561761f596dc0bcbda4",
"score": "0.60829777",
"text": "def goal_categories\n [\"Car\", \"Debt\", \"Education\", \"Holiday\", \"Home\", \"Medical\", \"Savings\", \"Wedding\", \"Other\"]\n end",
"title": ""
},
{
"docid": "7ef975b99fb7c23fca698439af969fe5",
"score": "0.6055702",
"text": "def categories # :nodoc:\n @categories.keys.collect { |c| c.to_s }\n end",
"title": ""
},
{
"docid": "25cf71c68a203e57012ac055cde95802",
"score": "0.6025022",
"text": "def categories\n @categories ||= []\n end",
"title": ""
},
{
"docid": "90e89312c55ff211a3d9085016d76d89",
"score": "0.5988927",
"text": "def get_opportunity_categories\n Resources::OpportunityCategory.parse(request(:get, \"OpportunityCategories\"))\n end",
"title": ""
},
{
"docid": "e41f405aee39d5fe39aa652b0d554796",
"score": "0.59863687",
"text": "def get_categories\n return @Backend.get_known_categories\n end",
"title": ""
},
{
"docid": "fd7fc4453e5911f6919e41ea8225b00b",
"score": "0.59783584",
"text": "def categories\n @category_templates.map do |template|\n category_hash_from_template(template[0])\n end\n end",
"title": ""
},
{
"docid": "b276c206ffa1c4176b97f11634933080",
"score": "0.5961672",
"text": "def categories\n @lists.keys\n end",
"title": ""
},
{
"docid": "0be806edda339379cf2dd583ef709aaa",
"score": "0.5960405",
"text": "def get_categories\n categories = %w[All Mains Side Dessert Starter Breakfast Snack Lunch Baking]\nend",
"title": ""
},
{
"docid": "e07e14859777f6e0d38e741d9811345a",
"score": "0.59569204",
"text": "def game_categories\n { 'Baseball' => 'Baseball Fields', 'Basketball' => 'Basketball Courts', \n 'Bocce' => 'Bocce Courts', 'Football' => 'Football Fields', \n 'Skating' => 'Ice Skating Rinks', 'Swimming' => 'Pools', 'Tennis' => 'Tennis Courts', \n 'Other' => ['Playgrounds', 'Beaches', 'Nature Centers', 'Recreation Centers'] }\n # [\"Bocce Courts\", \"Basketball Courts\", \"Tennis Courts\", \"Football Fields\", \"Ice Skating Rinks\", \"Playgrounds\", \"Baseball Fields\", \"Beaches\", \"Nature Centers\", \"Recreation Centers\", \"Pools\"]\n end",
"title": ""
},
{
"docid": "15bb137c2c7af4a86414988c49598925",
"score": "0.5943055",
"text": "def get_categories\n categories_data = get_items('__TOTAL__' => '__META__')['__TOTAL__']\n categories = if categories_data.first && categories_data.first['__CATEGORIES__']\n categories_data.first['__CATEGORIES__']['SS']\n else\n []\n end\n end",
"title": ""
},
{
"docid": "fcd0d23753debe07439d88e8b82609ae",
"score": "0.59358126",
"text": "def categories\r\n @categories ||= ['数码', '户外运动', '男装', '女装', '箱包', '饰品', '化妆品', '居家', '食品', '汽车', '图书影像', '创意礼品']\r\n end",
"title": ""
},
{
"docid": "b9c392019ac076ca42e54f606bb3e863",
"score": "0.59039044",
"text": "def categories\n\t\t\t\t\t\tresult = {}\n\t\t\t\t\t\tself.settings.each do |setting_key, setting_options|\n\t\t\t\t\t\t\tif setting_options[:category]\n\t\t\t\t\t\t\t\tif result[setting_options[:category]].nil?\n\t\t\t\t\t\t\t\t\tresult[setting_options[:category]] = []\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\tresult[setting_options[:category]] << setting_key\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\t\treturn result\n\t\t\t\t\tend",
"title": ""
},
{
"docid": "54662514874e263ae3903e5cc0e64fa7",
"score": "0.5885706",
"text": "def category_ids\n categorizations.map {|cs| cs.category_id }\n end",
"title": ""
},
{
"docid": "6636ed02725b2998ff9bcd4d5c3b7cb1",
"score": "0.5877687",
"text": "def available_categorizations\n values = {}\n values[\"listing_type\"] = listing_types\n values[\"category\"] = main_categories\n values[\"subcategory\"] = subcategories\n values[\"share_type\"] = share_types.reject { |st| listing_types.include?(st) }\n return values\n end",
"title": ""
},
{
"docid": "bcd5487cf12bec0c2154d1ab16d9271a",
"score": "0.58601916",
"text": "def interesting_categories\n %w(restaurants)\n end",
"title": ""
},
{
"docid": "af92d023e81d2a203c4ec1ff4fea740f",
"score": "0.5849692",
"text": "def device_categories\n return @device_categories\n end",
"title": ""
},
{
"docid": "3f548a1dbd1f90f192db9b59b562d43d",
"score": "0.58488137",
"text": "def categories\n categories = []\n CATEGORIES.each do |item|\n categories.push(Item_Category.new(item[0], item[1]))\n end\n categories\n end",
"title": ""
},
{
"docid": "80385399b5edbcc5d92a8f1dfd1e9a0a",
"score": "0.58259606",
"text": "def get_categories\r\n OpportunityCategory.where(\"opportunity_id = ?\", opportunity_id).all\r\n end",
"title": ""
},
{
"docid": "528bf787e44be7672777fc65040be022",
"score": "0.5819341",
"text": "def categories\n forecast!\n @reporter.categories\n end",
"title": ""
},
{
"docid": "ca276d6b2e0b024f9aa89baa96137b48",
"score": "0.57756275",
"text": "def categories()\n return MicrosoftGraph::DeviceAppManagement::MobileApps::Item::Categories::CategoriesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "24ce5f174515d73a406422ddb1fd3b62",
"score": "0.5765064",
"text": "def categories_for(race)\n [race.category] + race.category.descendants\n end",
"title": ""
},
{
"docid": "91457cf7f4b5f9479cf774e3ddb5d9e8",
"score": "0.57613885",
"text": "def categories\n @categories ||= Hashie::Mash.new\n end",
"title": ""
},
{
"docid": "48d5f1af53fe7e02168e738fe65d428d",
"score": "0.5761294",
"text": "def categories\n if attributes[\"Categories\"]\n attributes[\"Categories\"][\"Category\"]\n end\n end",
"title": ""
},
{
"docid": "dd569ccd2e1569fffc615f3775d81d9b",
"score": "0.57494974",
"text": "def catses\n REXML::XPath.match(@input, './app:categories', Names::XmlNamespaces)\n end",
"title": ""
},
{
"docid": "1fcd8c3e0d379426801bf3aedf9d3bba",
"score": "0.5747824",
"text": "def categories\n\t\t\t\t\t\tresult = {}\n\t\t\t\t\t\tself.settings.each do |setting_ref, setting_options|\n\t\t\t\t\t\t\tif setting_options[:category]\n\t\t\t\t\t\t\t\tif result[setting_options[:category]].nil?\n\t\t\t\t\t\t\t\t\tresult[setting_options[:category]] = []\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\tresult[setting_options[:category]] << setting_ref\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\t\treturn result\n\t\t\t\t\tend",
"title": ""
},
{
"docid": "2ffeef2e590e82022b49af03b40175c3",
"score": "0.5712536",
"text": "def site_map_order_categories\n return @staticmatic.get_site_map_categories\n end",
"title": ""
},
{
"docid": "a5030d39dab3f426e3fc3ec9e43e36f3",
"score": "0.5712396",
"text": "def applied_categories\n return @applied_categories\n end",
"title": ""
},
{
"docid": "afa8c0384834f7345d96f1a0fcbf315a",
"score": "0.5710849",
"text": "def get_network_l7_firewall_rules_application_categories(network_id)\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => network_id\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/l7FirewallRules/applicationCategories'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => network_id\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\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) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end",
"title": ""
},
{
"docid": "fd9ebcc697fb371b778f6ad375009c71",
"score": "0.56833017",
"text": "def get_all_apps_with_categories \n get(\"/appcon.json/\")\nend",
"title": ""
},
{
"docid": "e1e24eaa8aaf12477c883a417b3bbae4",
"score": "0.5676391",
"text": "def categories\n \t@categories.keys.map(&:to_s)\n end",
"title": ""
},
{
"docid": "a3ba4406a807764976d8c6c10b83e338",
"score": "0.5673312",
"text": "def categories\n connection.get(\"/categories\").body.spot_categories\n end",
"title": ""
},
{
"docid": "a3ba4406a807764976d8c6c10b83e338",
"score": "0.5673312",
"text": "def categories\n connection.get(\"/categories\").body.spot_categories\n end",
"title": ""
},
{
"docid": "435ffee42476f9fce11037c6fd4158c9",
"score": "0.56675464",
"text": "def categories\n @categories ||= yaml[\"categories\"] || []\n end",
"title": ""
},
{
"docid": "87b35f5d1844a59ddecde144649454d4",
"score": "0.56583965",
"text": "def categories(idea, flag)\n categories = []\n nodey = Neo4j::Node.find(\"idea: #{idea.inspect}~\")\n if nodey.first\n node = nodey.first\n nodey.close\n node.rels.each do |rel|\n category = rel[\"category\"]\n category_flag = category.chars.first.to_i\n category = category.slice(1..-1)\n already_found = false\n categories.each { |cat| already_found = true if cat[1].eql? category }\n categories << [category_flag, category] unless already_found\n end\n if flag == :category\n print_categories categories\n elsif flag == :category_relations\n categories.first[1]\n end\n else\n puts \"Still crunching data. Nothing on #{idea} yet. Check back soon.\"\n end\n end",
"title": ""
},
{
"docid": "adc9c955a2dfc494475ea7ecd6b0e786",
"score": "0.5634693",
"text": "def get_categories\n {\n method: \"Tracing.getCategories\"\n }\n end",
"title": ""
},
{
"docid": "0c7ee881e068efb2fead2aab93dc986b",
"score": "0.5630101",
"text": "def categories\n raw_categories.to_hashugar\n end",
"title": ""
},
{
"docid": "0c7ee881e068efb2fead2aab93dc986b",
"score": "0.5630101",
"text": "def categories\n raw_categories.to_hashugar\n end",
"title": ""
},
{
"docid": "7936a3db75185dd8f99e665bb4eddee3",
"score": "0.5629617",
"text": "def categories\n @categories ||= @entry_element.search('category').map do |category_element|\n Category.new(category_element.attribute('term').text, category_element.attribute('scheme').text)\n end\n end",
"title": ""
},
{
"docid": "6ea866e3426dab0b9b141fee2b147217",
"score": "0.5619727",
"text": "def categories\n filter!\n @reporter.categories\n end",
"title": ""
},
{
"docid": "3eeac939741fef0c1d5fe76a7fa578dc",
"score": "0.56126654",
"text": "def categories\n @categories ||= @entry_element.select_all(\"./atom:category\").map do |category_element|\n Category.new(category_element.attr(\"term\"), category_element.attr(\"scheme\"))\n end\n end",
"title": ""
},
{
"docid": "1cb0830dcb5c43953a599ca4d358c82d",
"score": "0.5610523",
"text": "def category\n \"flight, hotel\"\n end",
"title": ""
},
{
"docid": "fa288626a3dd78fd47d597e0c7c1c2b4",
"score": "0.5593755",
"text": "def categories\n @categories = [] if @categories.nil?\n @categories\n end",
"title": ""
},
{
"docid": "4d2be4f9abc267d925c6931e8c8d8c06",
"score": "0.559192",
"text": "def categories_for(race)\n categories = [race.category] + race.category.descendants\n\n if race.category.name == \"Masters Men\"\n masters_men_4_5 = ::Category.find_by(name: \"Masters Men 4/5\")\n if masters_men_4_5\n categories.delete masters_men_4_5\n categories -= masters_men_4_5.descendants\n end\n end\n\n if race.category.name == \"Masters Women\"\n masters_women_4 = ::Category.find_by(name: \"Masters Women 4\")\n if masters_women_4\n categories.delete masters_women_4\n categories -= masters_women_4.descendants\n end\n end\n\n categories << ::Category.find_by(name: \"Category 2/3 Men\") if race.category.name == \"Category 3 Men\"\n\n categories.delete ::Category.find_by(name: \"Category 2/3 Men\") if race.category.name == \"Senior Men\"\n\n categories\n end",
"title": ""
},
{
"docid": "801e77c73eaa11ab4bbdac0b273270a6",
"score": "0.558628",
"text": "def identify_all_categories\n @categories = @turns.map { |turn| turn.card.category}\n end",
"title": ""
},
{
"docid": "2ab493c1d68674e1a9ecd4ac800f760b",
"score": "0.5585022",
"text": "def get_apps_by_category(args = {}) \n get(\"/appcon.json/apps/#{args[:category]}\", args)\n end",
"title": ""
},
{
"docid": "94662687e16b0529b7e4f79c54717735",
"score": "0.5584136",
"text": "def categories\n if self.respond_to?(:channel) && self.channel.generator == 'Twitter'\n return @source.title.content.scan(/#([^#\\s]+)/).flatten\n end\n return [] if @source.categories.empty? && @source.dc_subjects.empty?\n tmp_cats = []\n tmp_cats << @source.categories.collect{|c| c.term}\n tmp_cats << @source.dc_subjects.collect{|c| c.content}\n\n tmp_cats.flatten.reject{|c| c == '' || c.match(/^\\s+$/)}\n end",
"title": ""
},
{
"docid": "619e68e2eefd8163ed6e38f3bc46fc95",
"score": "0.5583325",
"text": "def get_cats_for_model\n model = self.controller_name.singularize.camelize\n Cat.find_for_model(model).sort! { |a,b| a.long_name <=> b.long_name }\n end",
"title": ""
},
{
"docid": "203b2d18efb969cbce7cff368110753a",
"score": "0.55812025",
"text": "def categories\n @categories ||= Plaid::Categories.new(self)\n end",
"title": ""
},
{
"docid": "203b2d18efb969cbce7cff368110753a",
"score": "0.55812025",
"text": "def categories\n @categories ||= Plaid::Categories.new(self)\n end",
"title": ""
},
{
"docid": "25081f297e54bd1a294191c76b17b162",
"score": "0.5573058",
"text": "def get_charity_categories\n get(\"charity/categories\")\n end",
"title": ""
},
{
"docid": "ae98a405345cd53aa65a5962f1fdad10",
"score": "0.55637026",
"text": "def categories\n return @categories\n end",
"title": ""
},
{
"docid": "ae98a405345cd53aa65a5962f1fdad10",
"score": "0.55637026",
"text": "def categories\n return @categories\n end",
"title": ""
},
{
"docid": "b58d5130b483aafefdb5ed859f0d4c13",
"score": "0.5559365",
"text": "def categories\n turns.map do |turn|\n turn.card.category\n end\n turns.uniq\n end",
"title": ""
},
{
"docid": "b0d45dc75d3b0cfd4b053b7bc6926e28",
"score": "0.55470884",
"text": "def categories\n cats = []\n self.product_variation.product.subcategories.collect{|sub| cats << sub.category} if self.product_variation\n cats.uniq\n end",
"title": ""
},
{
"docid": "5332386b2ce92a1530efad7980efa6fa",
"score": "0.5546072",
"text": "def category_codes\n categories.map(&:second)\n end",
"title": ""
},
{
"docid": "e655bd2a77d377cbfc9723a96cad8370",
"score": "0.5544734",
"text": "def get_categories\n @deck.cards.inject([]) do |categories, card|\n categories.include?(card.category) ? categories : categories << card.category\n end\n end",
"title": ""
},
{
"docid": "95e12d8b866345db0304c452a10382ee",
"score": "0.5540002",
"text": "def category_list\n return unless user_configuration_name.name == \"CategoryList\"\n xml_to_category_list\n end",
"title": ""
},
{
"docid": "53b53c8524acc64d8b1e10f631e2aadf",
"score": "0.5531795",
"text": "def get_known_categories\n rKnownCategories = {}\n\n return rKnownCategories\n end",
"title": ""
},
{
"docid": "4d6ee427d11842ae52b705bb3365f871",
"score": "0.55312824",
"text": "def list_categories(game)\n keep_playing = true\n result = :none\n\n choose do |menu|\n menu.header = \"\\nSelect a category\"\n\n game.available_crowns.each do |crown|\n menu.choice(crown) { result = crown }\n end\n\n menu.choice('Cancel') { keep_playing = false }\n end\n\n [result, keep_playing]\n end",
"title": ""
},
{
"docid": "ef5cc819a207bf8b33816ca88481d7f9",
"score": "0.55296147",
"text": "def categories\n proptextlistarray 'CATEGORIES'\n end",
"title": ""
},
{
"docid": "73337995866636e73e9841cfe4947fde",
"score": "0.55279285",
"text": "def categories\n Api::V1::ShopsCategories::CompactSerializer.new(\n object.categories.only(:_id, :title)\n ).build_schema\n end",
"title": ""
},
{
"docid": "adf96b52c3d3bb71eb52f569cf027188",
"score": "0.5525039",
"text": "def categories\n return [] if @feed.channel.dc_subjects.empty?\n @feed.channel.dc_subjects.collect{|c| c.content}.reject{|c| c == '' || c.match(/^\\s+$/)}\n end",
"title": ""
},
{
"docid": "2f4a21bb534bbfb86b8b2b9d5a70a981",
"score": "0.5512496",
"text": "def categories\n add_category('holding')\n @categories\n end",
"title": ""
},
{
"docid": "9bad5df0b3eb55c208c3efba28f87bfb",
"score": "0.5509895",
"text": "def get_categories_of(entry)\n entry.categories.map{|c| category_to_struct(c) }\n end",
"title": ""
},
{
"docid": "f477230c33075803bfb6dd600eb6cf1b",
"score": "0.5509317",
"text": "def categorize\n out = {}.to_json\n if params[:url]\n # uri_enc_url = Rack::Utils.escape(params[:url])\n endpoint = \"http://access.alchemyapi.com/calls/url/URLGetCategory\"\n q = \"#{endpoint}?apikey=#{ENV[\"ALCHEMY_KEY\"]}&url=#{params[:url]}&outputMode=json\"\n out = RestClient.get(q)\n end\n respond_to do |format|\n format.html\n format.json { render :json => out.body }\n end\n end",
"title": ""
},
{
"docid": "5f2b3c3a031fe869dba58ce2a6ad0337",
"score": "0.5508736",
"text": "def categories\n categories_doc = Category.new(get_category_doc.body)\n categories_doc.categories\n end",
"title": ""
},
{
"docid": "5f2b3c3a031fe869dba58ce2a6ad0337",
"score": "0.5508736",
"text": "def categories\n categories_doc = Category.new(get_category_doc.body)\n categories_doc.categories\n end",
"title": ""
},
{
"docid": "d7919ca9aa211ad8afc8e1ac0569211f",
"score": "0.55007476",
"text": "def categorize_site cat\n governmental = ['G', 'M', 'Q', 'F']\n not_profit = ['E']\n commercial = ['P']\n if governmental.include?(cat)\n return \"governmental\"\n elsif not_profit.include?(cat)\n return \"not-for-profit\"\n end\n return \"commercial\"\n end",
"title": ""
},
{
"docid": "0c7e3efb8f80632cd925cc7f32aeaf19",
"score": "0.5499434",
"text": "def categories\n @persistence.categories\n end",
"title": ""
},
{
"docid": "e0cbcc329eb378b75dca8964f33b8c3b",
"score": "0.54987836",
"text": "def categories\n nil\n end",
"title": ""
},
{
"docid": "e0cbcc329eb378b75dca8964f33b8c3b",
"score": "0.54987836",
"text": "def categories\n nil\n end",
"title": ""
},
{
"docid": "f5d8172d267895ab93a7b7a9e499b841",
"score": "0.54924816",
"text": "def get_site_map_categories\n return @site_map_categories\n end",
"title": ""
},
{
"docid": "f671c256d3603392bfd9257100488d7a",
"score": "0.54859406",
"text": "def categorization\n categorizations.find(params[:id])\n end",
"title": ""
},
{
"docid": "314bd295eddc2d387f8f1fe6778939ee",
"score": "0.5473764",
"text": "def categories\n\t\t\t\t\tself.class.categories\n\t\t\t\tend",
"title": ""
},
{
"docid": "314bd295eddc2d387f8f1fe6778939ee",
"score": "0.5473764",
"text": "def categories\n\t\t\t\t\tself.class.categories\n\t\t\t\tend",
"title": ""
},
{
"docid": "27fcb0d59fd61541c67a1c6a72f4baec",
"score": "0.5472838",
"text": "def categories\n category = Struct::new(:title, :count)\n cats = {}\n @feeds.each { |feed|\n if feed['category']\n feed['category'].split(/\\s*\\b\\s*/).each { |cat|\n if cat == ','\n elsif cats.has_key? cat.downcase\n cats[cat.downcase].count += 1\n else\n cats[cat.downcase] = category.new(cat, 1)\n end\n }\n end\n }\n cats.values.sort { |a, b| a.title.downcase <=> b.title.downcase }\n end",
"title": ""
},
{
"docid": "1deb9aec63e3047a8cbe960ceb995319",
"score": "0.5468564",
"text": "def categories\n (@categories.delete_if {|n| n.blank?} if @categories) || []\n end",
"title": ""
},
{
"docid": "3bdf4d3a5736bcd1931a29571a431767",
"score": "0.54655004",
"text": "def category\n {\n 'Royal flush' => royal_flush?,\n 'Straight flush' => straight_flush?,\n 'Four of a kind' => four_of_a_kind?,\n 'Full house' => full_house?,\n 'Straight' => straight?,\n 'Flush' => flush?,\n 'Three of a kind' => three_of_a_kind?,\n 'Two pair' => two_pair?,\n 'Pair' => pair?\n }\n .find { |_name, method| method == true }.first\n end",
"title": ""
},
{
"docid": "abbcbf35623c472d664fe9516be473f3",
"score": "0.5464871",
"text": "def categories\n response[\"categories\"].map!{|category| Foursquared::Response::Category.new(category)}\n end",
"title": ""
},
{
"docid": "c852e2dc29b911f5a63369bca1921b56",
"score": "0.5464343",
"text": "def categories\n return [] if @item.dc_subjects.empty?\n @item.dc_subjects.collect{|c| c.content}.reject{|c| c == '' || c.match(/^\\s+$/)}\n end",
"title": ""
}
] |
975a830017e0ab4ceeaa88a427ee27fb
|
Constructs a new instance.
|
[
{
"docid": "d3aa65375f4c2ecabbcabfad16ee17b6",
"score": "0.0",
"text": "def initialize(ruby_values = nil, struct_value = nil)\n super(self.class.binding_type, ruby_values, struct_value)\n end",
"title": ""
}
] |
[
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.8045547",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.8045547",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.8045547",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.8045547",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.80440617",
"text": "def new; end",
"title": ""
},
{
"docid": "3e18cb2a5056cf5c82e7b585d5f1254d",
"score": "0.78544575",
"text": "def new\n inst = self.allocate\n inst.initialize\n inst\n end",
"title": ""
},
{
"docid": "3e18cb2a5056cf5c82e7b585d5f1254d",
"score": "0.78544575",
"text": "def new\n inst = self.allocate\n inst.initialize\n inst\n end",
"title": ""
},
{
"docid": "2ec4946cf4700263b114611fe9608ce2",
"score": "0.77168465",
"text": "def new; self end",
"title": ""
},
{
"docid": "cfa08c71c616cdc11ac3715b69147db0",
"score": "0.7695489",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "cfa08c71c616cdc11ac3715b69147db0",
"score": "0.7695489",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "cfa08c71c616cdc11ac3715b69147db0",
"score": "0.7695489",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "cfa08c71c616cdc11ac3715b69147db0",
"score": "0.7695489",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "8adda1b144e03f06faf1aa28abfdf9b0",
"score": "0.7688422",
"text": "def new(*args)\n self.class.new(*args)\n end",
"title": ""
},
{
"docid": "edefb41e6036fd69564480d350745cb1",
"score": "0.76513064",
"text": "def new\n # Nothing to see here, atm\n end",
"title": ""
},
{
"docid": "bc50701b04b9669938f1d64cfdb1fa80",
"score": "0.7633784",
"text": "def new(*args); end",
"title": ""
},
{
"docid": "df3bad92f81c9695d2f61be965850d70",
"score": "0.76327056",
"text": "def new(*args)\n super\n end",
"title": ""
},
{
"docid": "c4c797f4e170e07198b939f09207cad2",
"score": "0.7615316",
"text": "def construct; end",
"title": ""
},
{
"docid": "0182ee54dc9f55415b4a5f6698a86129",
"score": "0.75171906",
"text": "def initialize\n self\n end",
"title": ""
},
{
"docid": "bfec75ba54576a40ea45df45e210371a",
"score": "0.7493543",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "d4dbb1e94af52ef8c712b66ef7cda0d5",
"score": "0.74205095",
"text": "def construct(*args)\n self.klass.new(args)\n end",
"title": ""
},
{
"docid": "30db4e5d165a6098d1aeb8f8dd7b66e8",
"score": "0.73675203",
"text": "def initialize() end",
"title": ""
},
{
"docid": "30db4e5d165a6098d1aeb8f8dd7b66e8",
"score": "0.73675203",
"text": "def initialize() end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "c6116a572da53228c0ff0d98bc9a2bfc",
"score": "0.7343034",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "04497f34329faddde1da11685d15e45d",
"score": "0.73427063",
"text": "def new; end",
"title": ""
},
{
"docid": "413eb7a7781383c931819b4af16b7ad0",
"score": "0.73336613",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "413eb7a7781383c931819b4af16b7ad0",
"score": "0.73336613",
"text": "def initialize\n \n end",
"title": ""
},
{
"docid": "7866e43415b454926b27c4c4881d63b0",
"score": "0.7288684",
"text": "def new(name); end",
"title": ""
},
{
"docid": "7866e43415b454926b27c4c4881d63b0",
"score": "0.7288684",
"text": "def new(name); end",
"title": ""
},
{
"docid": "7866e43415b454926b27c4c4881d63b0",
"score": "0.7288684",
"text": "def new(name); end",
"title": ""
},
{
"docid": "7866e43415b454926b27c4c4881d63b0",
"score": "0.7288684",
"text": "def new(name); end",
"title": ""
},
{
"docid": "7866e43415b454926b27c4c4881d63b0",
"score": "0.7288684",
"text": "def new(name); end",
"title": ""
},
{
"docid": "7866e43415b454926b27c4c4881d63b0",
"score": "0.7288684",
"text": "def new(name); end",
"title": ""
},
{
"docid": "7866e43415b454926b27c4c4881d63b0",
"score": "0.7288684",
"text": "def new(name); end",
"title": ""
},
{
"docid": "7866e43415b454926b27c4c4881d63b0",
"score": "0.7288684",
"text": "def new(name); end",
"title": ""
},
{
"docid": "52b4fba67deb4dd7f43f3fb486fd1535",
"score": "0.7280512",
"text": "def create(*args)\n new(*args)\n end",
"title": ""
},
{
"docid": "677c07f5a78773a6bd46124e7e6fc28f",
"score": "0.7262246",
"text": "def new(init = nil)\n create(init: init)\n end",
"title": ""
},
{
"docid": "8e3629bb42b471c640e3e1bd665bf3b2",
"score": "0.7258747",
"text": "def initialize(*) end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "02fcfb474eba429c123242d716e023e7",
"score": "0.7241807",
"text": "def initialize\n end",
"title": ""
},
{
"docid": "4b1fa20b690a7df420ec23c40dc8283c",
"score": "0.72412014",
"text": "def new?; end",
"title": ""
},
{
"docid": "6b936507213d0e02c379ff276a28228e",
"score": "0.72103447",
"text": "def initialize()\n end",
"title": ""
},
{
"docid": "7dec9269614528a589912a28afebedb8",
"score": "0.7196008",
"text": "def build(attrs = {})\n new(attrs)\n end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
},
{
"docid": "27b17d3efbfa96fcae1899acb992e406",
"score": "0.71855557",
"text": "def initialize; end",
"title": ""
}
] |
566ad486f5a723af4ae7207dee7a9613
|
PATCH/PUT /group_roles/1 PATCH/PUT /group_roles/1.json
|
[
{
"docid": "13c05570b34356c769b3e884b82c7ab8",
"score": "0.7239791",
"text": "def update\n respond_to do |format|\n if @group_role.update(group_role_params)\n format.html { redirect_to @group_role, notice: 'Group role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @group_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "94716e905eea23f362dc8b9a98aedbec",
"score": "0.7274569",
"text": "def update\n @role = Role.find(params[:id])\n @role_groups = @role.group_ids\n\n @checked_groups = params[:group_ids].map {|group| group.to_i}\n @common_groups = (@role_groups & @checked_groups)\n\n # delete roles\n @delete_groups = @role_groups - @common_groups\n if !@delete_groups.blank?\n\t@delete_groups.each do |group|\n\t\t@role.groups.delete(Group.find(group))\n\tend\n end\n # insert roles\n @insert_groups = @checked_groups - @common_groups\n if !@insert_groups.blank?\n\t@insert_groups.each do |group|\n\t\t@role.groups << Group.find(group)\n\tend\n end\n\n respond_to do |format|\n if @role.update_attributes(params[:role])\n format.html { redirect_to roles_path, notice: 'Role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1f7da7c1c755b614267e5909e80c2b18",
"score": "0.71937037",
"text": "def update\n @group = Group.find(params[:id])\n\n # get an array of roles and set the role associations\n params[:group][:roles] = [] if params[:group][:roles].nil?\n roles = params[:group][:roles].collect { |i| Role.find(i) }\n @group.roles = roles\n\n # set parent manually\n if params[:group][:parent].to_s.empty?\n @group.parent = nil\n else\n @group.parent = Group.find(params[:group][:parent])\n end\n\n respond_to do |format|\n if @group.update_attributes(params[:group])\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to groups_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "99a58b69bcbd31bd9cd1c73a7e82002d",
"score": "0.7051256",
"text": "def update\n respond_to do |format|\n if @user_group_role.update(user_group_role_params)\n format.html { redirect_to @user_group_role, notice: 'User group role was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_group_role }\n else\n format.html { render :edit }\n format.json { render json: @user_group_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9a7392c5319f6e4469bc5d8427095314",
"score": "0.7024533",
"text": "def update\n @groups = Group.all\n @roles = Role.all\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(@user, :notice => 'User was successfully updated.') }\n format.json { render json: @user}\n else\n format.html { render :action => \"edit\" }\n format.json { render json: {error: @user.errors}}\n end\n end\n end",
"title": ""
},
{
"docid": "968c396d1a2b05b0870bddef11fe6e4b",
"score": "0.69031125",
"text": "def update\n @group = Group.find(params[:id].to_i)\n \n if request.get?\n # render only\n else\n # get an array of roles and set the role associations\n params[:group][:roles] = [] if params[:group][:roles].nil?\n roles = params[:group][:roles].collect { |i| Role.find(i) }\n @group.roles = roles\n\n # set parent manually\n if params[:group][:parent].to_s.empty?\n @group.parent = nil\n else\n @group.parent = Group.find(params[:group][:parent])\n end\n\n # Bulk-Assign the other attributes from the form.\n if @group.update_attributes(params[:group])\n flash[:success] = 'Group has been updated successfully.'\n redirect_to :action => 'show', :id => @group.to_param\n else\n render :action => 'update'\n end\n end\n\n rescue RecursionInTree\n @role.errors.add :parent, \"must not be a descendant of itself\"\n render :action => 'update'\n rescue ActiveRecord::RecordNotFound\n flash[:error] = 'You sent an invalid request.'\n redirect_to :action => 'list'\n end",
"title": ""
},
{
"docid": "d19f2035605d99ce00165eb5047681d1",
"score": "0.68004054",
"text": "def update\n @group = Group.find(params[:id])\n \n respond_to do |format|\n if @group.update_attributes(params[:group])\n proccess_association_roles(@group)\n flash[:notice] = 'Group was successfully updated.'\n format.html { redirect_to(:action => :index) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "94fb93f81f6419b14bb5b8f200531654",
"score": "0.6787732",
"text": "def update\n @role_group = RoleGroup.find(params[:id])\n #@club=current_club\n respond_to do |format|\n if @role_group.update_attributes(params[:role_group])\n\n format.html { redirect_to club_role_group_path , notice: 'Role group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @role_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2be61d377d398befff375e4714613ee",
"score": "0.6749012",
"text": "def update\n @role = Role.find(params[:id])\n\n # set parent role\n if not params[:role][:parent].to_s.empty?\n @role.parent = Role.find(params[:role][:parent])\n else\n @role.parent = nil\n end\n\n # get an array of static permissions and set the permission associations\n params[:role][:permissions] = [] if params[:role][:permissions].nil?\n permissions = params[:role][:permissions].collect { |i| Permission.find(i) }\n @role.permissions = permissions\n \n respond_to do |format|\n if @role.update_attributes(params[:role])\n flash[:notice] = 'Role was successfully updated.'\n format.html { redirect_to roles_url }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @role.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "a3345469a87df4ea7b0a93e4a5a33c26",
"score": "0.67445993",
"text": "def update\n authorize! :update, @user\n\n @roles=params[:roles].to_a\n \n respond_to do |format|\n if @user.update(user_params)\n\n @user.referant.sync_from_user(@user) if @user.referant\n\n \n if current_user.admin?\n @user.referant.sync_from_user(@user) if @user.referant\n Role.all.each{|r| @user.remove_role r.name}\n\n @roles.each do |r,ok|\n @user.add_role r if ok\n end\n end\n\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n\n @roles = Hash[Role.all.map{|r| [r.name, @user.has_role?(r.name)]}]\n\n format.html { render action: 'edit' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a3345469a87df4ea7b0a93e4a5a33c26",
"score": "0.67445993",
"text": "def update\n authorize! :update, @user\n\n @roles=params[:roles].to_a\n \n respond_to do |format|\n if @user.update(user_params)\n\n @user.referant.sync_from_user(@user) if @user.referant\n\n \n if current_user.admin?\n @user.referant.sync_from_user(@user) if @user.referant\n Role.all.each{|r| @user.remove_role r.name}\n\n @roles.each do |r,ok|\n @user.add_role r if ok\n end\n end\n\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n\n @roles = Hash[Role.all.map{|r| [r.name, @user.has_role?(r.name)]}]\n\n format.html { render action: 'edit' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "66b77b6763551452b53426966bfa8544",
"score": "0.67333883",
"text": "def update\n unless logged_in?\n logger.error('Not logged in')\n render json: { errors: 'Not logged in'}, status: :unauthorized\n response.set_header('Content-Type', 'application/json')\n return\n end\n unless current_user == @user || current_user.has_admin?(@user.organization_id)\n logger.error('Not authorized to edit this user')\n render json: { errors: 'Not authorized to edit this user'}, status: :unauthorized\n response.set_header('Content-Type', 'application/json')\n return\n end\n\n\n # Only update the Role Grants if any are set at all\n if params.has_key?(:roles) && !current_user.has_admin?(@user.organization_id)\n # Only Org Admins are allowed to set Roles\n logger.error('Only org admins may set roles')\n render json: {errors: 'Only org admins may set roles'}, status: :unauthorized\n return\n end\n updated_roles = false\n if current_user.has_admin?(@user.organization_id)\n logger.debug('Loading new roles...')\n# role_params = params.require(:user).permit([:role_ids, :roles])\n new_roles = if params.has_key?(:role_ids)\n (params[:role_ids].collect {|role_id| Role.find(role_id)}.compact)\n elsif params.has_key?(:roles)\n (params[:roles].collect {|role_name| Role.find_by(name: role_name)}).compact\n else \n []\n end\n logger.debug(\"New Roleset: #{new_roles}\")\n unless new_roles.empty?\n @user.roles = new_roles\n @user.touch\n updated_roles = true\n end\n end\n\n if current_user == @user || current_user.has_admin?(@user.organization_id)\n # Update their preferred sites, if set\n if params.has_key?(:preferred_sites)\n @user.preferred_sites = Site.where(slug: params[:preferred_sites])\n end\n end\n\n # Check whether there is anything else for this user to update\n# if user_params.nil? || user_params.empty?\n# render :json => { :errors => 'No valid params for your role to update'}, :status => :unprocessable_entity\n# response.set_header('Content-Type', 'application/json')\n# return\n# end \n \n # Only include the password fields if both are set \n prepared_user_params = user_params\n logger.debug(\"Permitted params: #{prepared_user_params.inspect}\")\n if !prepared_user_params.empty? && prepared_user_params[:password] == '' || prepared_user_params[:password].nil?\n logger.debug(\"Removing password fields: #{prepared_user_params}\")\n prepared_user_params.delete(:password)\n prepared_user_params.delete(:password_confirmation)\n end\n\n respond_to do |format|\n if (!prepared_user_params.empty? && @user.update(prepared_user_params)) || updated_roles\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render :show, status: :ok, location: @user }\n else\n format.html { render :edit }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6d47fbe9f1779b599c7f435b630dc2b2",
"score": "0.67041504",
"text": "def update\n role = Role.find(params[:id])\n if role.update(role_params)\n render json: role, status: 200, location: [:api, role]\n else\n failed_to_update(role, \"role\")\n end\n end",
"title": ""
},
{
"docid": "edf39968b1d2b431c0ecd2b213f42fdc",
"score": "0.66895133",
"text": "def update(id:, roles:)\n id_check(:id, id)\n non_empty_array_check(:roles, roles)\n\n data = {roles: roles}\n\n cf_patch(path: \"/organizations/#{org_id}/members/#{id}\", data: data)\n end",
"title": ""
},
{
"docid": "8b0964e50e2c65025a567c0c4e6097aa",
"score": "0.66823155",
"text": "def patch_application_role(application_id, role_id, request)\n start.uri('/api/application')\n .url_segment(application_id)\n .url_segment(\"role\")\n .url_segment(role_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end",
"title": ""
},
{
"docid": "b7d223017a38ffd70147b7f2a6a2d4e7",
"score": "0.6666998",
"text": "def update\n aRPrm = params[:PermGrp]\n iPmssn = 0\n aRPrm.each { |p| iPmssn+=p.to_i }\n\n respond_to do |format|\n @role.permissions = iPmssn\n\n if @role.update(role_params)\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9641043439b5eb78da8a03897d022414",
"score": "0.66503227",
"text": "def update\n @role = Role.find(params[:id])\n checkaccountobject(\"roles\",@role)\n\n respond_to do |format|\n if @role.update_attributes(params[:role])\n #if params[:roletasks][:ids]\n #@server.deployments << Deployment.find(params[:deployments][:ids])\n # @role.roletask_ids = params[:roletasks][:ids]\n #end\n\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bc0e75ec9ad4570a1f2f8db1947104d0",
"score": "0.6628198",
"text": "def update\n respond_to do |format|\n if @os_groups_rolemembership.update(os_groups_rolemembership_params)\n format.html { redirect_to @os_groups_rolemembership, notice: 'Os groups rolemembership was successfully updated.' }\n format.json { render :show, status: :ok, location: @os_groups_rolemembership }\n else\n format.html { render :edit }\n format.json { render json: @os_groups_rolemembership.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5e5aec14b3e5795d7f288f8e021158b7",
"score": "0.6613007",
"text": "def update\n authorize @role, :edit?\n respond_to do |format|\n if @role.update(api_v2_role_params)\n format.html { render :show, notice: \"Role was successfully updated.\" }\n format.json { render json: @role, status: :ok }\n else\n format.html { render :edit }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f45c8e5a371b0eb084514370d939a4e6",
"score": "0.66111785",
"text": "def update\r\n params[:userrole][:user_id] = params[:id]\r\n params[:userrole][:assigned_by] = session[:username]\r\n logger.debug(\"The old role_id when it is in update #{params[:old_role_id]} and #{params[:userrole][:role_id]}\")\r\n if(params[:userrole][:role_id].to_i == 5 && params[:old_role_id].to_i<=3)\r\n logger.debug(\"The old role_id when it is in update in if #{params[:old_role_id]}\")\r\n params[:userrole][:group_leader]='Yes'\r\n params[:userrole][:role_id]= params[:old_role_id]\r\n end\r\n\r\n @userrole = Userrole.find_by_user_id(params[:id])\r\n logger.debug(\"The update userrole are : #{@userrole.group_leader},and role id is#{@userrole.role_id}\")\r\n respond_to do |format|\r\n if @userrole.update_attributes(params[:userrole])\r\n format.html { redirect_to users_path, notice: 'Userrole was successfully updated.' }\r\n format.json { head :no_content }\r\n else\r\n format.html { render action: \"edit\" }\r\n format.json { render json: @userrole.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "7d15713aa9ec3719ff0ad89ea748ae1e",
"score": "0.66060454",
"text": "def update\n @role.update(role_params)\n head :no_content\n end",
"title": ""
},
{
"docid": "521b53f90d76ce273703895f3763b04d",
"score": "0.65953565",
"text": "def update_roles\n # Required for supporting checkboxes\n params[:user][:role_ids] ||= []\n\n # Figure out which role value checkboxes were checked and update accordingly\n for role_id in params[:user][:role_ids].reject! {|x| x.empty? }\n role = Role.find(role_id)\n @user.has_role role.name\n end\n\n if @user.update_attributes(params[:user])\n flash[:notice] = t 'user.account_update_success'\n redirect_to edit_user_path(@user, :anchor => 'roles')\n else\n render :action => :edit\n end\n end",
"title": ""
},
{
"docid": "95ebe44bdba451b98b0dbd1556b3b24f",
"score": "0.65701294",
"text": "def patch_update\n group = @company.public_send(ScimRails.config.scim_groups_scope).find(params[:id])\n\n json_scim_missing_field_response(params) and return if patch_path.blank?\n\n if patch_path == :members\n case patch_operation.downcase\n when \"add\"\n add_members(group) if members_param.present?\n when \"remove\"\n remove_members(group) if members_param.present?\n end\n else\n update_attribute(group)\n end\n\n json_scim_response(object: group)\n end",
"title": ""
},
{
"docid": "60dde83de50e51049db3156ad4dc9233",
"score": "0.6562494",
"text": "def update\n respond_to do |format|\n if @role.update(role_params)\n format.json { head :no_content }\n else\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b9ca5e0744c5c89ee991573ab9351cd",
"score": "0.65473175",
"text": "def update\n respond_to do |format|\n if @role.update(role_params)\n @role.access_module_roles.destroy_all\n params[:role][:access_module_ids].each do |acmi|\n AccessModuleRole.create!(:role_id => @role.id, :access_module_id => acmi) if acmi!=\"\"\n end\n format.html { redirect_to roles_path, notice: 'Role was successfully updated.' }\n format.json { render :index, status: :ok, location: @role }\n else\n format.html { render :edit }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cf74ef3100060bd64b880221d1357547",
"score": "0.6536056",
"text": "def patch_role(role_id, body)\n raise Auth0::MissingRoleId, 'Must supply a valid role_id' if role_id.to_s.empty?\n raise Auth0::InvalidParameter, 'Must supply a valid body' if body.to_s.empty? || body.empty?\n path = \"#{roles_path}/#{role_id}\"\n patch(path, body)\n end",
"title": ""
},
{
"docid": "283a52fd7d10da7ffb71c507b2577f9e",
"score": "0.6529397",
"text": "def update\n @role = Role.find(params[:id])\n\n respond_to do |format|\n if @role.update_attributes(params[:role])\n format.html { redirect_to @role, :notice => \"Grupo #{@role.name} atualizado com sucesso.\"}\n format.json { head :no_content }\n else\n format.html { render :action =>\"edit\" }\n format.json { render json =>@role.errors, status =>:unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4dafb109832d92b5ba927fb89da3a16b",
"score": "0.65233874",
"text": "def update\n respond_to do |format|\n\t\t\tif @role.update_attributes(params[:role])\n\t\t\t params[:permissions] ||= []\n @role.set_permissions(params[:permissions])\n\t\t\t\tflash[:notice] = 'Role was successfully updated.'\n\t\t\t\tformat.html { redirect_to(superadmin_roles_path) }\n\t\t\t\tformat.xml { head :ok }\n\t\t\telse\n flash[:error] = 'Role update failed.'\n\t\t\t\tget_permissions\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.xml { render :xml => @role.errors, :status => :unprocessable_entity }\n\t\t\tend\n end\n end",
"title": ""
},
{
"docid": "ce5323c3aba41355cb03660426931860",
"score": "0.65131164",
"text": "def update\n params[:role][:function_ids] ||= []\n @role = Role.find(params[:id])\n @functions = Function.all.group_by(&:agroup) #need show\n respond_to do |format|\n if @role.update_attributes(role_params)\n @role.assign_permission if @role.id == COMPANY_ADMIN_ID\n format.html { redirect_to @role, notice: t(\"controller.shared.flash.update.notice\", model: pick_model_from_locale(:role)) }\n format.json { head :no_content }\n else\n format.html { render \"edit\" }\n format.json { render json: @role.errors, status: t(\"controller.shared.flash.update.status\") }\n end\n end\n end",
"title": ""
},
{
"docid": "3759549b0ba826b7288300b5a4a1cb53",
"score": "0.649913",
"text": "def modify_guild_role(guild_id, role_id, name: :undef, permissions: :undef, color: :undef, hoist: :undef,\n mentionable: :undef, reason: nil)\n json = filter_undef({ name: name, permissions: permissions, color: color,\n hoist: hoist, mentionable: mentionable })\n route = Route.new(:PATCH, '/guilds/%{guild_id}/roles/%{role_id}', guild_id: guild_id, role_id: role_id)\n request(route, json: json, reason: reason)\n end",
"title": ""
},
{
"docid": "ec9c5a91953f8972a8f6303c3ca39e2d",
"score": "0.64877474",
"text": "def put_update(options = {})\n options[:id] ||= @role.id\n options[:role] ||= @attributes\n put :update,options\n end",
"title": ""
},
{
"docid": "4cf05048178a0375407a5ee69d9dc0d1",
"score": "0.64814717",
"text": "def update\n @managers = Manager.where(validity: true)\n @groups = Group.all\n @user = User.find(params[:id])\n \n if params[:admin]\n @role_admin = true\n end\n if params[:supervisor]\n @role_supervisor = true\n end\n if params[:manager]\n @role_manager = true\n end\n \n if !params[:manager] and !params[:supervisor] and !params[:admin]\n @user.errors.add(:role, t('errors.messages.must_be_selected'))\n render action: \"new\" \n return\n end\n \n if params[:manager] and params[:user][:manager_id] == \"\"\n @user.errors.add(:manager_id, t('errors.messages.blank'))\n render action: \"edit\" \n return\n end \n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n @user.roles.delete_all\n if params[:admin]\n role = Role.find_by_name('admin')\n @user.roles << role\n end\n if params[:supervisor]\n role = Role.find_by_name('supervisor')\n @user.roles << role\n end\n if params[:manager]\n role = Role.find_by_name('manager')\n @user.roles << role\n end\n @user.save\n format.html { redirect_to users_path, notice: t(:user_updated) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "90648de99ee12399cb4e38179f669e04",
"score": "0.6477128",
"text": "def update\n @team_role = TeamRole.find(params[:id])\n role_in_roleset = TeamRolesetsMap.find_all_by_team_role_id(params[:id])\n\n respond_to do |format|\n if role_in_roleset.count <= 0\n if @team_role.update_attributes(params[:team_role])\n format.html { redirect_to(@team_role, :notice => 'TeamRole was successfully updated.') }\n format.xml { head :ok }\n end\n else\n flash[:notice] = \"Role cannot be edited. It is a part of a Roleset\"\n format.html { redirect_to :controller => \"team_roles\", :action => \"index\" }\n format.xml { render :xml => @team_role.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fdcc35d62d88a782735fef49eb5a51c",
"score": "0.6476344",
"text": "def update\n respond_to do |format|\n if @role.update(role_params)\n @role.permissions = []\n @role.set_permissions(params[:permissions]) if params[:permissions]\n\n format.html { redirect_to admin_roles_path, notice: 'Papel foi atualizado com sucesso.' }\n format.json { head :no_content }\n else\n permissions_from_params(params[:permissions])\n\n format.html { render action: 'edit' }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "443703b10da8b2d39085950de43e901b",
"score": "0.64617664",
"text": "def update\n @role = ACL::Role.find(params[:id])\n @role.update_attributes(params[:role])\n @roles = ACL::Role.all\n respond_to do |format|\n format.js\n end\n end",
"title": ""
},
{
"docid": "9ebf1824728754a2243009a3823c50f0",
"score": "0.645666",
"text": "def update\n @role = Role.find(params[:id])\n\n @role.update_attributes(params[:role])\n respond_with @role\n end",
"title": ""
},
{
"docid": "8bfa5dd34ba04730c4365eb3d1532a44",
"score": "0.6454409",
"text": "def update\n respond_to do |format|\n if @roles_permission.update(roles_permission_params)\n format.html { redirect_to @roles_permission, notice: 'Roles permission was successfully updated.' }\n format.json { render :show, status: :ok, location: @roles_permission }\n else\n format.html { render :edit }\n format.json { render json: @roles_permission.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "641941ccce9db9b5f592b8748b4f16a7",
"score": "0.6451046",
"text": "def update\n @group_id = group_params[:group_id]\n puts group_params\n puts \"PARAMS\"\n @reponse = HTTParty.put(\"https://rails-api-ipo.herokuapp.com/api/v1/groups/#{@group_id}.json\",\n :body => {:group_name => group_params[:group_name], :group_permissions => group_params[:group_permissions]}.to_json,\n :headers => { 'Content-Type' => 'application/json' } )\n respond_to do |format|\n format.html { redirect_to '/groups/'+(@reponse['id'].to_s), notice: 'Group was successfully created.' }\n end\n end",
"title": ""
},
{
"docid": "38521f7f15fc83b7f05bd271cb644ca1",
"score": "0.64499015",
"text": "def edit(id, options = {})\n params.accepts(:label, :permission).validate!(options)\n response = request(:put, \"/roles/#{id}.json\", default_params(options))\n end",
"title": ""
},
{
"docid": "65c5efe6906e585e1c7757195e121bfb",
"score": "0.64425606",
"text": "def set_group_role\n @group_role = GroupRole.find(params[:id])\n end",
"title": ""
},
{
"docid": "e984eb36c0e8ffd97a7bdf02b4650748",
"score": "0.64377016",
"text": "def update\n if @role.update(role_params)\n render json: @role, meta: { errors: nil }\n else\n render json: @role, meta: { errors: @role.errors.full_messages }\n end\n end",
"title": ""
},
{
"docid": "d3de044c4b64663e6d0a95e234e291c7",
"score": "0.6431494",
"text": "def update\n @role = Role.find(params[:id])\n\n respond_to do |format|\n if @role.update_attributes(params[:role])\n format.html { redirect_to admin_role_path(@role), notice: 'Role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "20567b3b7cbee06697a776bce564eae7",
"score": "0.64221776",
"text": "def update\n respond_to do |format|\n if @ram.update(ram_params)\n @ram.roles.each do |role|\n @ram.roles.delete(role)\n end\n roleArray = params[:roleArray]\n if roleArray != nil\n\n roleArray.each do |roleParam|\n\n puts \"--------\" + roleParam[\"roleid\".to_sym].to_s\n role = Role.find(roleParam[\"roleid\"])\n @ram.roles << role\n\n end\n end\n @ram.workpackage_id = params[:workpackage_id]\n @ram.save\n format.html { redirect_to @ram, notice: 'Ram was successfully updated.' }\n format.json { render :show, status: :ok, location: @ram }\n else\n format.html { render :edit }\n format.json { render json: @ram.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ccb5291d216ed3c02536428f20b503b2",
"score": "0.6416579",
"text": "def update\n @role = Role.find(params[:id])\n\n respond_to do |format|\n if @role.update_attributes(params[:role])\n #Update all roles\n update_roles \n @role.save\n format.html { redirect_to(@role, :notice => 'Role was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @role.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3ca033bfdee44dc5b926a90476ed9e39",
"score": "0.6412292",
"text": "def update\n @user = User.find(params[:id])\n params[:permissions].each do |p|\n @user.user_groups << UserGroup.find(p)\n end\n @user.user_groups.uniq!\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f14720f1f0d4177f8c52d5137eded9ff",
"score": "0.64024603",
"text": "def change_roles\n @user = User.find params[:id], :include => :roles\n roles = @user.roles\n db_roles_ids = roles.map { |i| i.id.to_s }\n if request.put?\n params[:roles_ids] ||= []\n user_roles_ids = params[:roles_ids]\n if params[:roles_ids] == []\n flash[:notice] = \"roles have been reseted for user\"\n roles.delete_all\n else\n flash[:notice] = \"roles changed for this user\"\n to_delete = db_roles_ids.reject { |i| params[:roles_ids].member? i }\n to_put = params[:roles_ids].reject { |i| db_roles_ids.member? i }\n\n # avoid mass assignment\n # user can only change roles here.\n # don't act smart and change this to a one-liner and create a major bug in the system.\n # yes code can be improved. but it was made like this thinking in security\n to_put.each do |role_id|\n r = Role.find_by_id(role_id) \n roles << r unless r.nil? \n end\n \n to_delete.each do |role_id| \n r = Role.find_by_id role_id\n roles.delete r unless r.nil?\n end\n end\n end\n end",
"title": ""
},
{
"docid": "e22a3afa03864613e9dd1fe773ffb32c",
"score": "0.6401124",
"text": "def update\n @user_role = UserRole.find(params[:id])\n\n if @user_role.update(params[:user_role])\n head :no_content\n else\n render json: @user_role.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "cbe6435c821e2f9762639a8acbbfaf38",
"score": "0.6395895",
"text": "def change_role\n authorize @user\n @user.update!(role_params)\n json_response({message: \"Role changed successfully\"})\n end",
"title": ""
},
{
"docid": "be3f2c9ee024408cf984732b7870f4b6",
"score": "0.638552",
"text": "def update\n @auth_cms_role = CmsRole.find(params[:id])\n @auth_cms_role.set_cms_role_permits_list(params[\"cms_role\"][\"cms_role_permit_ids\"]) if params[\"cms_role\"][\"cms_role_permit_ids\"].present?\n @auth_cms_role.set_assign_permits_list(params[\"cms_role\"][\"assign_permit_ids\"]) if params[\"cms_role\"][\"assign_permit_ids\"].present?\n\n @auth_cms_role.name = params[\"cms_role\"][\"name\"]\n\n respond_to do |format|\n if @auth_cms_role.save\n format.html { redirect_to auth_cms_role_path(@auth_cms_role), notice: 'Cms role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @auth_cms_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ba7a2388a626ae10a85c348c13e5f3bb",
"score": "0.6375949",
"text": "def update #update users group\n @user_group = UserGroup.find(params[:id])\n @user_group.update(user_group_params)\n @user_group.save\n render json: @user_group\n end",
"title": ""
},
{
"docid": "cc6004af69153d3808440c1d3ad65b25",
"score": "0.6374589",
"text": "def update_role\n\t\t@project_select = params[:project_id]\n\t\t@project_id = Project.where(\"id = ?\", @project_select)\n\t\t@roles = Role.where(\"project_id = ?\", @project_id[0][:id]).all\n\n\t\t# render an array in JSON containing arrays like:\n \trender :json => @roles.map{|c| [c.id, c.role_name]}\n\tend",
"title": ""
},
{
"docid": "61235fdd3f8cc13829ba32444fb71958",
"score": "0.63691425",
"text": "def update\n respond_to do |format|\n if @role_group_right.update(role_group_right_params)\n format.html { redirect_to @role_group_right, notice: 'Role group right was successfully updated.' }\n format.json { render :show, status: :ok, location: @role_group_right }\n else\n format.html { render :edit }\n format.json { render json: @role_group_right.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bb013edcf39ccdb997d1788fd1603f68",
"score": "0.63596004",
"text": "def update\n @roles = Role.find(:all, :order => :name)\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n @user.role_ids = params[:user][:role_ids]\n @user.save!\n\n flash[:notice] = t(\"admin.users.update.success_msg\")\n format.html { redirect_to edit_admin_user_path(@user) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9fe4a83acbe7f0f87bec4f7bc9c736b5",
"score": "0.635726",
"text": "def update\n @roles_user = RolesUser.find(params[:id])\n\n respond_to do |format|\n if @roles_user.update_attributes(params[:roles_user])\n format.html { redirect_to @roles_user, notice: 'Roles user was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @roles_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9f03092cdf7429369e4ce14755c5102",
"score": "0.6334911",
"text": "def update\n if @user_role.update(user_role_params)\n render json: @user_role\n # 'user_role was successfully updated.'\n else\n render json: @user_role.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "f61ed65c48b077bc154e69f0812d400e",
"score": "0.632745",
"text": "def update\n @user = User.find(params[:id])\n\n if params[:user][:roles]==\"1\" && @user.is_admin?\n @user.remove_role 'admin'\n elsif params[:user][:roles]==\"1\"\n print \"asdasdasdasd\"\n @user.add_role 'admin'\n end\n\n params[:user].delete(\"roles\")\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to :admin_user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c666902e551fa4e07b7bca04ac0b2186",
"score": "0.6309577",
"text": "def update\n @role = Role.find(params[:id])\n\n respond_to do |format|\n if @role.update_attributes(params[:role])\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c666902e551fa4e07b7bca04ac0b2186",
"score": "0.6309577",
"text": "def update\n @role = Role.find(params[:id])\n\n respond_to do |format|\n if @role.update_attributes(params[:role])\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ab1f81568ff04aa0198579c1f9cf0f41",
"score": "0.6308341",
"text": "def update\n authorize! :modify, @group\n if @group.update(group_params)\n render json: @group.to_json\n else\n render_error_model(@group)\n end\n end",
"title": ""
},
{
"docid": "ea3b9ed193f25a2c904bbfa0249eb264",
"score": "0.63071513",
"text": "def update\n @role = @stage.roles.find(params[:id])\n\n if @role.update_attributes(params[:role])\n flash[:notice] = 'Role was successfully updated.'\n respond_with(@role, :location => [@project, @stage])\n else\n respond_with(@role)\n end\n end",
"title": ""
},
{
"docid": "9477bfda23894725e47dbcdc30fc2d20",
"score": "0.6302475",
"text": "def update\n @role = Role.find(params[:id])\n\n respond_to do |format|\n if @role.update_attributes(params[:role])\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9477bfda23894725e47dbcdc30fc2d20",
"score": "0.6302475",
"text": "def update\n @role = Role.find(params[:id])\n\n respond_to do |format|\n if @role.update_attributes(params[:role])\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2969e0058a78d4a452699798ed8494d5",
"score": "0.62866306",
"text": "def changeRole\r\n user = User.find(params[\"member\"])\r\n \r\n newRole = user.teamsusers.find_by_team_id(params[\"team\"]).role == \"member\" ? \"admin\" : \"member\"\r\n user.teamsusers.find_by_team_id(params[\"id\"]).update_attributes(:role => newRole)\r\n @team = Team.find(params[\"id\"])\r\n \r\n respond_to do |format|\r\n format.html {render :layout=>false}\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "277430ad07ec7e0211336cfc1b172557",
"score": "0.6285767",
"text": "def update\n @available_roles = Role.all\n role_ids = params[:selected_roles]\n respond_to do |format|\n if @user.update(user_params)\n if can? :update, Role\n if @user.update_roles(role_ids)\n if current_user.email == 'superuser@meritbadges.com'\n sign_out current_user\n format.html { redirect_to root_path, alert: 'Logged out superuser since you updated a user. Login as a real person now.' }\n else\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n end\n end\n else\n format.html { redirect_to @user, notice: 'User was successfully updated - except the roles.' }\n format.json { head :no_content }\n end\n\n else\n format.html { render action: 'edit' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n\n end",
"title": ""
},
{
"docid": "9c6576a98cd13ee3c41592a4c205a35c",
"score": "0.62820345",
"text": "def update\n\n # respond_to do |format|\n # if @role.update_attributes(params[:role])\n # format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n # format.json { head :no_content }\n # else\n # format.html { render action: \"edit\" }\n # format.json { render json: @role.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "a34c4114f98b8d987107c850186e211b",
"score": "0.62783706",
"text": "def update\n require_privilege(Alberich::Privilege::MODIFY, User)\n @user_group = UserGroup.find(params[:id])\n\n respond_to do |format|\n if @user_group.update_attributes(params[:user_group])\n format.html { redirect_to @user_group, notice: 'User group was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad903c2a1d0b4770be70830465f7f808",
"score": "0.627225",
"text": "def update_role(name, new_name = name, capabilities)\n self.class.put(\"#{@url}/rest/user-management/roles/#{URI.escape(name)}\", basic_auth: @auth, body: generate_role_payload(new_name,capabilities), headers: {'Content-Type' => 'application/json'})\n end",
"title": ""
},
{
"docid": "c117371afd19d22632d321480711840a",
"score": "0.6271637",
"text": "def update\n unless current_user.has_privilege?('roles', 'update')\n miss_privilege\n return\n end\n @role = Role.find(params[:id])\n\n\n if @role.update_attributes(params[:role])\n redirect_to(roles_url, :notice => '角色保存成功.')\n\n else\n render 'admin/roles/edit'\n end\n\n end",
"title": ""
},
{
"docid": "64d668a364454c698f4bfb9e95d770b7",
"score": "0.62708485",
"text": "def update\n respond_to do |format|\n if @api_v1_user_role.update(api_v1_user_role_params)\n format.html { redirect_to @api_v1_user_role, notice: 'User role was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_user_role }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_user_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e32fb382fe1cd787f6d975b9bc60c3ee",
"score": "0.6269014",
"text": "def edit(id, options = {})\n request(:put, \"/roles/#{id}.json\", default_params(options))\n end",
"title": ""
},
{
"docid": "182332b1a31ff1deb9683fe19dd2a4f1",
"score": "0.62685347",
"text": "def update!(**args)\n @add_roles = args[:add_roles] if args.key?(:add_roles)\n @remove_roles = args[:remove_roles] if args.key?(:remove_roles)\n @update_roles_params = args[:update_roles_params] if args.key?(:update_roles_params)\n end",
"title": ""
},
{
"docid": "a91339b045f9ba4fd193682196841f89",
"score": "0.62631845",
"text": "def update\n params[:user][:role_ids] ||= []\n @roles = Role.all\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n update_role_names\n format.js \n format.json { head :no_content }\n else\n format.js { render \"edit\", id: @user.id }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3f724b233096ef07c46158430418e24b",
"score": "0.6262491",
"text": "def update\n @role = Role.find(params[:id])\n @role.assign_attributes(role_params)\n @role.updated_at = Time.now\n\n respond_to do |format|\n if @role.save\n ress = []\n params[:role_resource_names].each do |res|\n ress << {resource_name: res,role_id: @role.id} if res.present?\n end\n RoleResource.where(role_id: @role.id).delete_all\n RoleResource.import!(ress)\n format.html { redirect_to(role_path(@role), :notice => 'Role was successfully updated.') }\n format.xml { head :ok }\n else\n @roles = Game.all\n flash.now[:alert] = @role.errors.full_messages\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @role.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0881f4c3689a96d0f5b2b7e4db1f19b2",
"score": "0.62605417",
"text": "def update\n respond_to do |format|\n if @role.update(role_params)\n format.html {redirect_to xmt_rbac_roles_url, notice: '角色编辑成功.'}\n format.json {render :show, status: :ok, location: @role}\n else\n format.html {render :edit}\n format.json {render json: @role.errors, status: :unprocessable_entity}\n\n end\n end\n end",
"title": ""
},
{
"docid": "443721abd5f8bf2f7d47192876fc2392",
"score": "0.6257376",
"text": "def update_role\n auth_token = params[:id]\n change_role(auth_token, params[:role])\n current_user.refresh!\n redirect_to root_path\n end",
"title": ""
},
{
"docid": "11e9dec3a38dc9e7747bc5482480f3f2",
"score": "0.62529093",
"text": "def update\n respond_to do |format|\n if @role.update(role_params)\n format.html { redirect_to roles_path, notice: t('message.success_updated', :model => Role.model_name.human) }\n format.json { render :show, status: :ok, location: @role }\n else\n format.html { render :edit }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ed1597aae481e4ff5c4c6ba365bc69ef",
"score": "0.6248021",
"text": "def update\n @team_role = TeamRole.find(params[:id])\n\n respond_to do |format|\n if @team_role.update_attributes(params[:team_role])\n format.html { redirect_to @team_role, notice: 'Team role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @team_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae7a6457e7cf7689a2c6cea5adae8914",
"score": "0.624544",
"text": "def update\n @role = @stage.roles.find(params[:id])\n\n respond_to do |format|\n if @role.update_attributes(params[:role])\n flash[:notice] = 'Role was successfully updated.'\n format.html { redirect_to project_stage_url(@project, @stage) }\n format.xml { head :ok }\n else\n format.html { render action: 'edit' }\n format.xml { render xml: @role.errors.to_xml }\n end\n end\n end",
"title": ""
},
{
"docid": "7b5e5f946c9682703b927d25773f2857",
"score": "0.6244546",
"text": "def update_role(token, server_id, role_id, name, colour, hoist = false, mentionable = false, packed_permissions = 104_324_161, reason = nil)\n Discordrb::API.request(\n :guilds_sid_roles_rid,\n server_id,\n :patch,\n \"#{Discordrb::API.api_base}/guilds/#{server_id}/roles/#{role_id}\",\n { color: colour, name: name, hoist: hoist, mentionable: mentionable, permissions: packed_permissions }.to_json,\n Authorization: token,\n content_type: :json,\n 'X-Audit-Log-Reason': reason\n )\n end",
"title": ""
},
{
"docid": "58abe12a4325731b32492eb7e0d37a0b",
"score": "0.6240586",
"text": "def update!(**args)\n @roles = args[:roles] if args.key?(:roles)\n end",
"title": ""
},
{
"docid": "1e05a88766d7c32bf0c2360054945721",
"score": "0.6236578",
"text": "def update\n begin\n @set_role = RoleUser.get(params[:id])\n @set_role.update(:role_id => params[:role_id],:user_id => params[:user_id])\n \n respond_to do |format|\n format.html { redirect_to(admin_set_roles_path, :notice => 'Set role was successfully updated.') }\n format.xml { head :ok }\n end\n rescue\n flash[:alert] = \"Role is not updated for that user.\"\n render :action => \"edit\" \n end\n end",
"title": ""
},
{
"docid": "e86dbfa4ea9ab5fc2cc9fcdad0321e07",
"score": "0.62265164",
"text": "def update\n @club = current_club\n\n @role = Role.find(params[:id])\n \n if @role.update_attributes(params[:role])\n Role.refresh_role_meeting_types(@role.id,params)\n redirect_to club_roles_path(@club, notice: 'Role was successfully updated.')\n end\n end",
"title": ""
},
{
"docid": "507c7747dceb9eeae2d42ccdea51677d",
"score": "0.6220997",
"text": "def update\n if @role.update(role_params)\n render :show, status: :ok, location: @role\n else\n render json: {errors: errors_as_array_hash(@role.errors)}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "cbc6377fa42b07d44bec6fce84c8d27d",
"score": "0.6220275",
"text": "def update\n respond_to do |format|\n if @role.update(update_role_params)\n format.html { redirect_to roles_url, notice: t('notifications_masc.success.resource.updated',\n resource: t('roles.form.resource')) }\n format.json { render :show, status: :ok, location: @role }\n else\n format.html { render :edit }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3060951cff98a3665f2e79719ac84fba",
"score": "0.62147534",
"text": "def update\n @role = Role.find(params[:id])\n respond_to do |format|\n if @role.update_attributes(params[:role])\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { render :show, status: :ok, location: @role }\n else\n format.html { render :edit }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3060951cff98a3665f2e79719ac84fba",
"score": "0.62147534",
"text": "def update\n @role = Role.find(params[:id])\n respond_to do |format|\n if @role.update_attributes(params[:role])\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { render :show, status: :ok, location: @role }\n else\n format.html { render :edit }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "94d9870f26cc2fd74ae4b397b5a35a4a",
"score": "0.62088996",
"text": "def update\n if params[:name] == 'roles'\n @user.roles = []\n @user.roles << Role.find(params[:value])\n else\n @user.update(params[:name] => params[:value])\n end\n respond_to do |format|\n if @user.save\n format.js\n else\n format.js\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a0b253a13d1cbafada8f87c3fcbe8ab3",
"score": "0.6207364",
"text": "def update\n\n respond_to do |format|\n if @role.update(role_params)\n format.html { redirect_to @role, notice: 'Role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "013fc8a1d593ec6735f1ce211a828038",
"score": "0.6206386",
"text": "def update_mod\n if params[:groupName] != nil && params[:subId] != nil && params[:password] != nil\n @group.subId = params[:subId] == \"\" ? nil : params[:subId].to_i\n @group.groupName = params[:groupName]\n @group.password = params[:password] == \"\" ? nil : params[:password]\n\n group_json = @group.to_h.to_json\n\n url = @httpIp+'/pet.com/api/group/updateGroup'\n uri = URI(url)\n res = Net::HTTP.post(uri, group_json, \"Content-Type\" => \"application/json\")\n puts res.body\n flash[:notice] = \"successfully updated\"\n redirect_to groups_path\n end\nend",
"title": ""
},
{
"docid": "15d3806fa1337b85efb3942f09d66634",
"score": "0.62061685",
"text": "def update\n respond_to do |format|\n if @role.update(role_params)\n format.html { redirect_to admin_roles_path, notice: 'Role was successfully updated.' }\n format.json { render :show, status: :ok, location: @role }\n else\n format.html { render :edit }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n register_log \"Role updated: #{@role.inspect}\\n\"\n end",
"title": ""
},
{
"docid": "e490e0bacddb4327a1d5836c62b573a3",
"score": "0.6180114",
"text": "def update_role\n @user = User.find(params[:id])\n @user.update_attribute(:roles, params[:wanted_role])\n redirect_to users_path\n end",
"title": ""
},
{
"docid": "31b11ef2089a4df7a0bb7b23387f896a",
"score": "0.61781466",
"text": "def update\n response = Role::Update.call(role_params)\n if response.success?\n success_response(message: response.status_message, http_status: 202, data: response.data)\n else\n error_response(message: response.status_message, data: response.data)\n end\n end",
"title": ""
},
{
"docid": "7be8593b8bd20daaf617eeb19d8f49f9",
"score": "0.617708",
"text": "def update\n @user_role = UserRole.find(params[:id])\n\n respond_to do |format|\n if @user_role.update_attributes(params[:user_role])\n format.html { redirect_to @user_role, notice: 'User role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7be8593b8bd20daaf617eeb19d8f49f9",
"score": "0.617708",
"text": "def update\n @user_role = UserRole.find(params[:id])\n\n respond_to do |format|\n if @user_role.update_attributes(params[:user_role])\n format.html { redirect_to @user_role, notice: 'User role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8060f932b101951302bd255538e79b11",
"score": "0.61732095",
"text": "def update\n @roles_user = RolesUser.find(params[:id])\n\n respond_to do |format|\n if @roles_user.update_attributes(params[:big_auth_roles_user])\n format.html { redirect_to(roles_users_url(), :notice => 'Roles user was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @roles_user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "369aa959c6fcbebffa2f909c36336f89",
"score": "0.61660004",
"text": "def update\n respond_to do |format|\n if @global_role.update_attributes(params[:global_role])\n format.html { redirect_to global_roles_url, notice: 'Global role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @global_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "516fa95cef3a12de79efdb62a7610a60",
"score": "0.6161747",
"text": "def update\n @users_role = UsersRole.find(params[:id])\n\n respond_to do |format|\n if @users_role.update_attributes(params[:users_role])\n format.html { redirect_to @users_role, notice: 'Users role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @users_role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "25a1cf9f37711f28c3d289fd3f3721ea",
"score": "0.6158524",
"text": "def update\n respond_to do |format|\n if @role.update(role_params)\n format.html { redirect_to @role, notice: 'role was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'index' }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3254f9a7b3204a9b92e2c5e7aaf1117b",
"score": "0.61571187",
"text": "def update\n @role.update(role_params)\n @roles = Role.all\n @role = Role.new\n end",
"title": ""
},
{
"docid": "7bc35ad089f0ea0af272977b97a209c8",
"score": "0.6154493",
"text": "def update\n respond_to do |format|\n if @role.update(role_params)\n format.html { redirect_to roles_path, flash: { success: 'Role was successfully updated.' } }\n format.json { render :show, status: :ok, location: @role }\n else\n set_html_elements\n format.html { render :edit }\n format.json { render json: @role.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "82ba9b9b45d336bd08a055e775b693b6",
"score": "0.61536515",
"text": "def update_role\n @user = User.find(params[:id])\n @user.update_attributes(role_user_params)\n\n respond_to do |format|\n format.html { redirect_to manage_users_path }\n format.json { head :no_content }\n format.js { render :layout => false }\n end\n end",
"title": ""
}
] |
22aac76925411362bf877e77214c1f1b
|
GET /devans GET /devans.json
|
[
{
"docid": "8fdaaae337dbe08de3fc3cb13f7b9e42",
"score": "0.70520955",
"text": "def index\n @devans = Devan.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @devans }\n end\n end",
"title": ""
}
] |
[
{
"docid": "067d06caa6a8b58931d32a4b7ef24e00",
"score": "0.67215383",
"text": "def show\n @devan = Devan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @devan }\n end\n end",
"title": ""
},
{
"docid": "e1b6dafde626a238c00512ddc1be8976",
"score": "0.6414895",
"text": "def show\n @project = Project.find(params[:id])\n @fans = @project.fans\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end",
"title": ""
},
{
"docid": "f835585db9e2ab5a8af61f38e16b8cad",
"score": "0.63745147",
"text": "def show\n @an = Ans.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @an }\n end\n end",
"title": ""
},
{
"docid": "465309501000e3cc32bde3b45c78190d",
"score": "0.62847733",
"text": "def show\n @dev = Dev.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dev }\n end\n end",
"title": ""
},
{
"docid": "1f8fb4fa512274b9de4a305c9709b6fd",
"score": "0.60891837",
"text": "def index\n @title = \"Fans\"\n @fans = Fan.all\n #in case I have pagination I will add it\n #@users = User.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fans }\n end\n end",
"title": ""
},
{
"docid": "fbc0e92149ffde482cac2cf0625d291f",
"score": "0.60397655",
"text": "def show\n @ankenstatus = Ankenstatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ankenstatus }\n end\n end",
"title": ""
},
{
"docid": "6c2f58e371b328714a3154e131f0ed18",
"score": "0.6029772",
"text": "def show\n @fan = Fan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fan }\n end\n end",
"title": ""
},
{
"docid": "6c2f58e371b328714a3154e131f0ed18",
"score": "0.6029772",
"text": "def show\n @fan = Fan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fan }\n end\n end",
"title": ""
},
{
"docid": "6c2f58e371b328714a3154e131f0ed18",
"score": "0.6029772",
"text": "def show\n @fan = Fan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fan }\n end\n end",
"title": ""
},
{
"docid": "6c2f58e371b328714a3154e131f0ed18",
"score": "0.6029772",
"text": "def show\n @fan = Fan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @fan }\n end\n end",
"title": ""
},
{
"docid": "9b325adcff0c351711fdd048a1675ecc",
"score": "0.5945954",
"text": "def show\n @devry = Devry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @devry }\n end\n end",
"title": ""
},
{
"docid": "12bf49200d8f5ebd22b232acf368e727",
"score": "0.59405243",
"text": "def show\n @anken = Anken.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @anken }\n end\n end",
"title": ""
},
{
"docid": "98e00b1f4d94d670baca8c8c65cba55b",
"score": "0.5934171",
"text": "def show\n @koan = Koan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @koan }\n end\n end",
"title": ""
},
{
"docid": "d456233fdb86d0bd1551f99b0eda52f6",
"score": "0.5912284",
"text": "def show\n json_response(@request)\n end",
"title": ""
},
{
"docid": "ddd5d4f0e33ecbb16a24cf8d9dd92741",
"score": "0.58681697",
"text": "def show\n \n @anketum = Anketum.find(params[:id])\n\t\n\trespond_to do |format|\n format.html # show.html.erb\n format.json { render json: @anketum }\n end\n end",
"title": ""
},
{
"docid": "76939c2f4451c6c8333b4f101490ed93",
"score": "0.5857013",
"text": "def show\n respond_to do |format|\n format.html { @api_v1_victim }\n format.json { render json: {results: @api_v1_victim, message: 'Victim has loaded successfully.'} }\n end\n end",
"title": ""
},
{
"docid": "2429c939a66cf9dd2877181bf44627c8",
"score": "0.5853351",
"text": "def index\n if(params[:uid].present?)\n @ans = Ans.find(:all, :conditions => [\"uid = ?\", params[:uid]], :order => \"created_at desc\").paginate(:page => params[:page], :per_page => 50)\n else\n @ans = Ans.find(:all, :order => \"created_at desc\").paginate(:page => params[:page], :per_page => 50)\n end \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @ans }\n end\n end",
"title": ""
},
{
"docid": "b81e27bdcfb9dea6805936c79d772b55",
"score": "0.5833429",
"text": "def show\n @minister = Minister.find(params[:id])\n @min_deps = Minister.find(params[:id]).departments\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @minister }\n end\n end",
"title": ""
},
{
"docid": "a530c32130711e9051e93bdd69ea77ea",
"score": "0.5821453",
"text": "def list_guest_access_portals(args = {}) \n get(\"/guestaccess.json/gap/\", args)\nend",
"title": ""
},
{
"docid": "a530c32130711e9051e93bdd69ea77ea",
"score": "0.5821453",
"text": "def list_guest_access_portals(args = {}) \n get(\"/guestaccess.json/gap/\", args)\nend",
"title": ""
},
{
"docid": "2e179d479d5208ffbda4e8df00709ade",
"score": "0.5815881",
"text": "def show\n @startup = Startup.find(params[:id])\n \n @comentarios = JSON.parse(open(\"http://api.oula.co/twitter/topic/?q=\" << @startup.name).read) \n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @startup }\n end\n end",
"title": ""
},
{
"docid": "b5d6b9e6da1b588e52541668062a5da4",
"score": "0.5811184",
"text": "def show\n rent = Rent.find(params[:id])\n render json: {:success => true, :api_token => @user.api_token, :rents=> JSON.parse(rent.to_json)}, status: 201\n end",
"title": ""
},
{
"docid": "1c46bfefb7623525655394d7f85782a0",
"score": "0.5793171",
"text": "def stats\n get 'stats', format: 'json'\n end",
"title": ""
},
{
"docid": "893c4223bc6610fe1948b841caebe668",
"score": "0.57851666",
"text": "def shows\n Birdman::Requester.get(\"people/#{id}/shows\")\n end",
"title": ""
},
{
"docid": "f1a4ec1c455c1f410f80241c399136b3",
"score": "0.5781791",
"text": "def show\n @clan = Clan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clan }\n end\n end",
"title": ""
},
{
"docid": "7137bfc1ad4b745dcdd77d5c3c14a880",
"score": "0.5773455",
"text": "def show\n @san_port = SanPort.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @san_port }\n end\n end",
"title": ""
},
{
"docid": "b9850e7ca60e9b5edee5d60948f66d2e",
"score": "0.5769527",
"text": "def show\n @kern = Kern.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kern }\n end\n end",
"title": ""
},
{
"docid": "48073ff0d594d5357930ee5ebe7f2b3e",
"score": "0.5767566",
"text": "def show\n @ring = Ring.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ring }\n end\n end",
"title": ""
},
{
"docid": "5a465b13e77a19a46f42fa03d0d18b95",
"score": "0.57626307",
"text": "def show\n\t\turi = URI.parse(\"http://204.87.169.110/accounts/\" + params[:account])\n\t\tres = Net::HTTP.get_response(uri)\n\n\t\tif res.code == '200'\n\t\t\trender :json => JSON.parse(res.body)\n\t\telse\n\t\t\trender :json => {}, status: res.code\n\t\tend\n\tend",
"title": ""
},
{
"docid": "95d8e1e18819e2fffe033ef0bf7e2b48",
"score": "0.5752798",
"text": "def list_arrays_for_all_tenants(args = {}) \n get(\"/arrays.json/global\", args)\nend",
"title": ""
},
{
"docid": "a2381ca3a3985ea028efd1bbf7261851",
"score": "0.5744738",
"text": "def show\n render :json => @stat\n end",
"title": ""
},
{
"docid": "145e29138c622a6c13fa40e11aa270c9",
"score": "0.5737679",
"text": "def explore\n @json = doorkeeper_access_token.get(\"api/v1/#{params[:api]}\").parsed\n respond_with @json\n end",
"title": ""
},
{
"docid": "4f3537e5703d229fbf41ac8b37d02d0e",
"score": "0.5737065",
"text": "def show\n @diet_plan = DietPlan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @diet_plan }\n end\n end",
"title": ""
},
{
"docid": "c81b7ad78d49f0cf549d42e6224249df",
"score": "0.5736105",
"text": "def show\n client = Marvelite::API::Client.new(:public_key => ENV['MARVEL_KEY'], :private_key => ENV['MARVEL_SECRET'])\n .characters(:name => 'Spider-Man').to_json\n client = JSON.parse(client)\n comics = client['data']['results']\n render json: comics\n end",
"title": ""
},
{
"docid": "bba79b4cb020503dc0ed4a449b19dd77",
"score": "0.5735646",
"text": "def index\n @talismans = Talisman.where(\"user_id = ?\", current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @talismans }\n end\n end",
"title": ""
},
{
"docid": "9f4dc1458c7d37e30629bf901cee3402",
"score": "0.57347417",
"text": "def get_clients_by_devices(args = {}) \n get(\"/clients.json/stats/device\", args)\nend",
"title": ""
},
{
"docid": "02f04d1e7c1ceeb8c1b64f7f11fa2a82",
"score": "0.57281667",
"text": "def show\n @admin_vat = Admin::Vat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_vat }\n end\n end",
"title": ""
},
{
"docid": "7eb8b246106ecb69a705a5684f1f1d36",
"score": "0.572578",
"text": "def show\n user = User.find_by({token: env['HTTP_TOKEN']})\n render json: user.visits.find(params[:id])\n end",
"title": ""
},
{
"docid": "7f412b998e1edab4de5f2650c181add3",
"score": "0.57223725",
"text": "def index\n \trender json: current_user.plans\n\tend",
"title": ""
},
{
"docid": "e4d7aaa891c35f031d6ad77535bc68bc",
"score": "0.5718686",
"text": "def show\n @stat = Stat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stat }\n end\n end",
"title": ""
},
{
"docid": "e4d7aaa891c35f031d6ad77535bc68bc",
"score": "0.5718686",
"text": "def show\n @stat = Stat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stat }\n end\n end",
"title": ""
},
{
"docid": "e4d7aaa891c35f031d6ad77535bc68bc",
"score": "0.5718686",
"text": "def show\n @stat = Stat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @stat }\n end\n end",
"title": ""
},
{
"docid": "945a571fb4e72c125b07b965c1c25b72",
"score": "0.57184404",
"text": "def show\n @freezer = Freezer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @freezer }\n end\n end",
"title": ""
},
{
"docid": "f25213601922d4183089d3f8632f46d2",
"score": "0.5712386",
"text": "def show\n @loan_debt = LoanDebt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @loan_debt }\n end\n end",
"title": ""
},
{
"docid": "682a213ff2d3575024cd84840e17dc93",
"score": "0.57009",
"text": "def show\n @speciman = Speciman.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @speciman }\n end\n end",
"title": ""
},
{
"docid": "20a6e0ebc9a40b18ab1ae65570d4b081",
"score": "0.5698766",
"text": "def show\n @visitador = Visitador.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @visitador }\n end\n end",
"title": ""
},
{
"docid": "70580b1fe03f410c6ac3287f8353e533",
"score": "0.56877625",
"text": "def index\n @devices = Device.all\n\n render json: @devices\n end",
"title": ""
},
{
"docid": "0b33db14ee9b6d92210dac6ec9a49a6c",
"score": "0.5671768",
"text": "def index\n @devisons = Devison.all\n end",
"title": ""
},
{
"docid": "6ec9b6910dc6c4115f07569f95e717ca",
"score": "0.56659645",
"text": "def show uid\n response = call_api method: :get, id: uid\n ap JSON.parse(response.body)\n return response\n end",
"title": ""
},
{
"docid": "fc7c58d52f7259b08f50ac9111c5d4b9",
"score": "0.5663687",
"text": "def show\n @veteran = Veteran.find(params[:id])\n respond_to do |format|\n format.html { render :show }\n format.json {\n render json: @veteran,\n serializer: VeteranFriendSerializer,\n scope: { current_veteran: current_veteran }\n }\n end\n end",
"title": ""
},
{
"docid": "dd10fa93393d1e1e08fdf1eb92a87c5a",
"score": "0.56615824",
"text": "def show\n @food_visit = FoodVisit.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @food_visit }\n end\n end",
"title": ""
},
{
"docid": "83fbfeee8ef695bbd9113b28fbee81b0",
"score": "0.5659586",
"text": "def show\n @device = Device.find(params[:id])\n\n render json: @device\n end",
"title": ""
},
{
"docid": "f6e313a915b677b7544b30ad24860f71",
"score": "0.5659031",
"text": "def show\n @usage = Usage.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @usage }\n end\n end",
"title": ""
},
{
"docid": "2c8e420f94b8fa9a08f4eba0c3e54822",
"score": "0.56569445",
"text": "def show\n @depot = Depot.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @depot }\n end\n end",
"title": ""
},
{
"docid": "52fcb037ac1779071004d7040706e81c",
"score": "0.5656678",
"text": "def show\n @devenir_franchise = DevenirFranchise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @devenir_franchise }\n end\n end",
"title": ""
},
{
"docid": "df6f0731ab616182dcc4db89b514fef3",
"score": "0.5654716",
"text": "def show\n @punt = Punt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @punt }\n end\n end",
"title": ""
},
{
"docid": "933ddc97f2de741e5fec300d8898f6de",
"score": "0.56543076",
"text": "def show\n @call_verizon = CallVerizon.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @call_verizon }\n end\n end",
"title": ""
},
{
"docid": "e9470dea650ae44f64be99b795632b46",
"score": "0.565252",
"text": "def show\n @denuncia = Denuncia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @denuncia }\n end\n end",
"title": ""
},
{
"docid": "6f3ea23e7f82c51703274da167f1bbd2",
"score": "0.5650168",
"text": "def list_all_guests(args = {}) \n get(\"/guestaccess.json/all\", args)\nend",
"title": ""
},
{
"docid": "6f3ea23e7f82c51703274da167f1bbd2",
"score": "0.5650168",
"text": "def list_all_guests(args = {}) \n get(\"/guestaccess.json/all\", args)\nend",
"title": ""
},
{
"docid": "1e038adda024f3248eebb954dce68502",
"score": "0.56492203",
"text": "def show\n @kicadnetlist = Kicadnetlist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kicadnetlist }\n end\n end",
"title": ""
},
{
"docid": "c22dcadab669f5064728419caa8484ea",
"score": "0.5644718",
"text": "def search_for_a_guest(args = {}) \n get(\"/guestaccess.json/search\", args)\nend",
"title": ""
},
{
"docid": "9e8e8167cd3aae49ecd12b8c6614b050",
"score": "0.56402194",
"text": "def show\n @statua = Statua.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @statua }\n end\n end",
"title": ""
},
{
"docid": "746b32ff56ddf19be4a85eb928cff85c",
"score": "0.5639117",
"text": "def show\n @konten = Konten.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @konten }\n end\n end",
"title": ""
},
{
"docid": "981114ce254f3356972f0c887ff5fce3",
"score": "0.56335574",
"text": "def index\n @nvs_depts = NvsDept.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nvs_depts }\n end\n end",
"title": ""
},
{
"docid": "c7c34bdcdd3a8eac4066bae2ec8637bc",
"score": "0.5633241",
"text": "def index\n url = 'https://petapi-1.herokuapp.com/'\n @response = RestClient.get(url)\n @parsed = JSON.parse(@response)\n end",
"title": ""
},
{
"docid": "7636e812c731d50d286fd1b7978fd8a2",
"score": "0.56326014",
"text": "def show\n @resturant = Resturant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @resturant }\n end\n end",
"title": ""
},
{
"docid": "8bb633e5e66652f18b137b078c749d67",
"score": "0.56317645",
"text": "def show\n @ping = Ping.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ping }\n end\n end",
"title": ""
},
{
"docid": "c2c6c7fb0c49180e9474b8eff2409fd5",
"score": "0.5630954",
"text": "def lists\n\tget('/lists.json')\nend",
"title": ""
},
{
"docid": "2de91f7bb5b3fec4ed0099ff62720c84",
"score": "0.56304693",
"text": "def index\n @fans = Fan.all\n end",
"title": ""
},
{
"docid": "37279854c175899aeef0bee3da04e895",
"score": "0.56274635",
"text": "def show\n @consultant = Consultant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consultant }\n end\n end",
"title": ""
},
{
"docid": "37279854c175899aeef0bee3da04e895",
"score": "0.56274635",
"text": "def show\n @consultant = Consultant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @consultant }\n end\n end",
"title": ""
},
{
"docid": "4d76422e2466ab19564e24d8d9e0ec6a",
"score": "0.5626762",
"text": "def show\n render json: @distrito\n end",
"title": ""
},
{
"docid": "44c8f0b8871b1760f34cfcb4c2e4d94f",
"score": "0.56260747",
"text": "def show\n @port = Port.find(params[:id])\n render :json => {:successful=>true, :data=> @port }\n end",
"title": ""
},
{
"docid": "e9e2d092b6fcdcde19a46ba3cb1ac0b4",
"score": "0.562562",
"text": "def index\n filter = params['filter'] || 'default'\n @entries = Entry.filter(visitor: current_visitor, filter: filter)\n @api_key = current_visitor.api_key\n respond_to do |format|\n format.html\n format.json { render json: @entries, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "dafe8df54e4a454154a5d74eff8072cb",
"score": "0.5625056",
"text": "def show\n @detall = Detall.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @detall }\n end\n end",
"title": ""
},
{
"docid": "cc4521509b7d25f2e50e4e0e24a9bc6e",
"score": "0.56249124",
"text": "def show\n @nvs_dept = NvsDept.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nvs_dept }\n end\n end",
"title": ""
},
{
"docid": "6b716e8fe575703fb35be97a8cae0f5a",
"score": "0.5621987",
"text": "def show\n @vlans_of_lan = @lan.vlans.paginate(page: params[:page],\n per_page: IPAMSConstants::RECORD_COUNT_PER_PAGE)\n authorize @vlans_of_lan\n\n gon.current_lan_id = @lan.id # pass to JS\n gon.locale = I18n.locale\n\n respond_to do |format|\n format.html\n format.json { render json: LansHelper.do_lan_stats(@lan) }\n end \n end",
"title": ""
},
{
"docid": "dd66d0dc06f350d8cbf355746be452fb",
"score": "0.5615751",
"text": "def show\n require 'net/http'\n require 'json'\n\n @url = 'https://pro-api.coinmarketcap.com/v1/cryptocurrency/listings/latest?CMC_PRO_API_KEY=f20de4a4-9bf9-4a57-bdb0-e68559b87260&start=1&limit=5000&convert=KRW'\n @uri = URI(@url)\n @response = Net::HTTP.get(@uri)\n @show_coin = JSON.parse(@response)\n end",
"title": ""
},
{
"docid": "9bad709d5e0b36881a550c27cc647360",
"score": "0.5613685",
"text": "def index\n if params[:name].present?\n plants = Plant.find_by(name: params[:name])\n else\n plants = Plant.all\n end\n #\n # THis is the string to add to the end of the URL to filer: (separate by \"&\")\n # ?id=9&name=Touch%20Me%20Not\n #\n # plants = Plant.find_by(apistring)\n\n render json: plants\n end",
"title": ""
},
{
"docid": "f311e3d2676b379bc993b3666cd3e846",
"score": "0.5612743",
"text": "def show\n if @fan.nil?\n head :not_found\n else\n render json: @fan.properties\n end\n end",
"title": ""
},
{
"docid": "335413a01e1d15920173b78a3ac38430",
"score": "0.56099594",
"text": "def show\n @unidadevangelismo = Unidadevangelismo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unidadevangelismo }\n end\n end",
"title": ""
},
{
"docid": "6fad00d038e901a379f7d4439b35ed4a",
"score": "0.5609513",
"text": "def show\n render json: @pain\n end",
"title": ""
},
{
"docid": "f57cee3bedff83ca3d9bea0eb8a23df3",
"score": "0.56093717",
"text": "def show\n @themeVisit = ThemeVisit.find(params[:id])\n @themeVisits = ThemeVisit.all\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @themeVisit }\n end\n end",
"title": ""
},
{
"docid": "c198c963ff3e2f70379638b34fa92589",
"score": "0.5608746",
"text": "def show\n @statu = Statu.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @statu }\n end\n end",
"title": ""
},
{
"docid": "70e404e7cbbb00975e5f14e73561e235",
"score": "0.5605525",
"text": "def index\n @dances = current_user.dances\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dances }\n end\n end",
"title": ""
},
{
"docid": "98980591aec5168679b6ea6be721b307",
"score": "0.56036633",
"text": "def show\n @user = User.find(params[:id])\n @loans = @user.loans\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @user }\n end\n end",
"title": ""
},
{
"docid": "fed32e6e9bd93f03b86bc2c60114ba49",
"score": "0.5601232",
"text": "def list_tenants_for_circle(args = {}) \n get(\"/tenantcircles.json/tenants\", args)\nend",
"title": ""
},
{
"docid": "1d0da22ba0676465a0f566eee0aca7d6",
"score": "0.55994165",
"text": "def show\n @restuarant = Restuarant.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @restuarant }\n end\n end",
"title": ""
},
{
"docid": "ba5c9da1d53d26f98b89f238f191b84b",
"score": "0.5597872",
"text": "def dev\n\t\trender json: Post.all\n\tend",
"title": ""
},
{
"docid": "1d0ada8b51180970652d48b8d2398a3c",
"score": "0.5596274",
"text": "def show\n @makanan = Makanan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @makanan }\n end\n end",
"title": ""
},
{
"docid": "301f225ff82ef8798a81599bc0961ac0",
"score": "0.55959535",
"text": "def show\n @canning_session = CanningSession.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @canning_session }\n end\n end",
"title": ""
},
{
"docid": "a30a4bd4a06be50ab3df736186fd3d77",
"score": "0.5595839",
"text": "def show\n @sangano = Sangano.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sangano }\n end\n end",
"title": ""
},
{
"docid": "25e1ddbabbd3cac1e11d5d9170403776",
"score": "0.55925405",
"text": "def show\n render json: @statu\n end",
"title": ""
},
{
"docid": "3b8cc3095010438acceb8a57b8b2e788",
"score": "0.55887985",
"text": "def show\n @ask = Ask.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ask }\n end\n end",
"title": ""
},
{
"docid": "15eee0f5215093ce91541572166aad0d",
"score": "0.5587657",
"text": "def show\n @dudad = Dudad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dudad }\n end\n end",
"title": ""
},
{
"docid": "8f755de2a27cc8017d584c0e82505033",
"score": "0.55876553",
"text": "def show\n trekks = Trekk.where(user_id: params[:user_id])\n render :json => { trekks: trekks }\n end",
"title": ""
},
{
"docid": "9f09d3eabc5fe090ce6ee64f4a2d22be",
"score": "0.55875653",
"text": "def show\n @device_status = DeviceStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @device_status }\n end\n end",
"title": ""
},
{
"docid": "115b62c695cfe7eca276de28f49b0ce3",
"score": "0.558639",
"text": "def show\n @statute = Statute.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @statute }\n end\n end",
"title": ""
},
{
"docid": "ab78e1e430014eb3b1b2898d82df8cc0",
"score": "0.55854505",
"text": "def index\n puts params.inspect\n @digital_objects = JSON[access_token.get(\"/api/v1/digital_objects/my\").body]\n @tags_obj = JSON[access_token.get(\"/api/v1/tags\").body]\n @contacts = JSON[access_token.get(\"/api/v1/contacts\").body]\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @digital_objects }\n end\n end",
"title": ""
}
] |
68ace5be59306c6dacf06c0cfec9729a
|
PUT /documenttypes/1 PUT /documenttypes/1.json
|
[
{
"docid": "11c8ffe6303ab1d446cc5b02f24052c2",
"score": "0.7173488",
"text": "def update\n @documenttype = Documenttype.find(params[:id])\n\n respond_to do |format|\n if @documenttype.update_attributes(params[:documenttype])\n format.html { redirect_to @documenttype, notice: 'Documenttype was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @documenttype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "078fc6f0e5e0fd65b1218492de0bb9e3",
"score": "0.76491725",
"text": "def update\n @document_type =DocumentType.find(params[:id])\n respond_to do |format|\n if @document_type.update(document_type_params)\n format.json { render json: @document_type, status: :ok }\n else\n format.json { render json: @document_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2dabdcad9303987cc01f5de076b1fce",
"score": "0.7290384",
"text": "def update\n respond_to do |format|\n if @type_document.update(type_document_params)\n format.html { redirect_to @type_document, notice: 'Type document was successfully updated.' }\n format.json { render :show, status: :ok, location: @type_document }\n else\n format.html { render :edit }\n format.json { render json: @type_document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "38448ab04266a022a4bec65518404f01",
"score": "0.7109281",
"text": "def update\n @type_document = TypeDocument.find(params[:id])\n\n respond_to do |format|\n if @type_document.update_attributes(params[:type_document])\n format.html { redirect_to(@type_document, :notice => 'Type document was successfully updated.') }\n format.xml { head :ok }\n format.json {render :json => {\"success\"=>true,\"data\"=>@type_document}}\n \n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @type_document.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "cfbd6c74218c19079df14a261aa556d6",
"score": "0.7100569",
"text": "def update\n @document_type = DocumentType.find(params[:id])\n @document_type.updated_at = Time.now\n respond_to do |format|\n if @document_type.update_attributes(params[:document_type])\n format.html { redirect_to @document_type, notice: 'Document type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "be80b4479d31c6dd2447e2d8dd0cbce9",
"score": "0.70209146",
"text": "def update\n @doc_type = DocType.find(params[:id])\n\n respond_to do |format|\n if @doc_type.update_attributes(params[:doc_type])\n format.html { redirect_to @doc_type, notice: 'Doc type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @doc_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7502b68676314c8a38bc11bd9726e8a8",
"score": "0.6978508",
"text": "def set_document_type\n @document_type = DocumentType.find(params[:id])\n end",
"title": ""
},
{
"docid": "3daa555836d1586cdd91e6c3afcf9c7e",
"score": "0.6938788",
"text": "def update\n\n respond_to do |format|\n if @document_type.update_attributes(params[:document_type])\n format.html { redirect_to(@document_type, :notice => 'Document type was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @document_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0947bf046a0307e306964e7aaff56a5e",
"score": "0.69127476",
"text": "def update\n respond_to do |format|\n if @document_type.update_attributes(params[:document_type])\n flash[:notice] = 'Document type was successfully updated.'\n format.html { redirect_to(@document_type) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @document_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "725444c287f81669252b45b5eaee1990",
"score": "0.68657476",
"text": "def set_type_document\n @type_document = TypeDocument.find(params[:id])\n end",
"title": ""
},
{
"docid": "e221f55b011907ff4aee1d92cadfa6e9",
"score": "0.6863483",
"text": "def set_document_type\n @document_type = DocumentType.find(params[:id])\n end",
"title": ""
},
{
"docid": "6e94320c1495da2f8dd4521c61f67608",
"score": "0.6783896",
"text": "def update\n @document_type = DocumentType.find(params[:id])\n\n respond_to do |format|\n if @document_type.update_attributes(params[:document_type])\n flash[:notice] = 'DocumentType was successfully updated.'\n format.html { redirect_to(@document_type) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @document_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c1fcb53a19a5060e81f78bf602fb780",
"score": "0.67820704",
"text": "def update\n @typedocument = Typedocument.find(params[:id])\n\n respond_to do |format|\n if @typedocument.update_attributes(params[:typedocument])\n format.html { redirect_to @typedocument, notice: 'Typedocument was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @typedocument.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2706f966b92de9f04824b81429adcae5",
"score": "0.672023",
"text": "def set_type_doc\n @type_doc = TypeDoc.find(params[:id])\n end",
"title": ""
},
{
"docid": "3abf75a063db859d0dc30d5b54b2ecdc",
"score": "0.668179",
"text": "def update\n @file_type = FileType.all\n \n respond_to do |format|\n if @doc.update(doc_params)\n format.html { redirect_to @doc, notice: 'doc was successfully updated.' }\n format.json { render :show, status: :ok, location: @doc }\n else\n format.html { render :edit }\n format.json { render json: @doc.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19507b6eab8b6139701535f90ab19d82",
"score": "0.6618696",
"text": "def update\n\n @document_type = DocumentType.find(params[:document_type][:id])\n\n if @document_type.update_attributes(params[:document_type])\n flash['notice'] = 'Update recorded'\n else\n flash['notice'] = 'Update failed'\n end\n\n redirect_to(:action => 'edit',\n\t\t:id => params[:document_type][:id])\n end",
"title": ""
},
{
"docid": "63686d5616fe810991439adac32b1aa1",
"score": "0.6564392",
"text": "def update\n @doc_type = DocType.find(params[:id])\n\n respond_to do |format|\n if @doc_type.update_attributes(params[:doc_type])\n flash[:notice] = 'DocType was successfully updated.'\n format.html { redirect_to(@doc_type) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @doc_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "accacac1c8c5966ae2c4d4eed770aad9",
"score": "0.65424556",
"text": "def documenttypes_id_documenttype_put_with_http_info(id_documenttype, name, attacheable, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DocumentsApi.documenttypes_id_documenttype_put ...'\n end\n # verify the required parameter 'id_documenttype' is set\n if @api_client.config.client_side_validation && id_documenttype.nil?\n fail ArgumentError, \"Missing the required parameter 'id_documenttype' when calling DocumentsApi.documenttypes_id_documenttype_put\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling DocumentsApi.documenttypes_id_documenttype_put\"\n end\n # verify the required parameter 'attacheable' is set\n if @api_client.config.client_side_validation && attacheable.nil?\n fail ArgumentError, \"Missing the required parameter 'attacheable' when calling DocumentsApi.documenttypes_id_documenttype_put\"\n end\n # resource path\n local_var_path = '/documenttypes/{id_documenttype}'.sub('{' + 'id_documenttype' + '}', id_documenttype.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])\n\n # form parameters\n form_params = {}\n form_params['name'] = name\n form_params['attacheable'] = attacheable\n\n # http body (model)\n post_body = nil\n auth_names = ['api_key']\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 => 'DocumentType')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DocumentsApi#documenttypes_id_documenttype_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "1735bb694d4d2256b93b8b409f20420f",
"score": "0.652881",
"text": "def document_type_params\n params.require(:document_type).permit(:name)\n end",
"title": ""
},
{
"docid": "8bdcdc228eb53d568b6a3730c261477d",
"score": "0.65179163",
"text": "def set_doc_type\n @doc_type = DocType.where(id: params[:id]).first\n doc_type_hash()\n end",
"title": ""
},
{
"docid": "b2e48db48ad753f7ebcaca186ea1b187",
"score": "0.65025216",
"text": "def update\n @type_clients = TypeClient.all\n respond_to do |format|\n if @type_doc.update(type_doc_params)\n format.html { \n redirect_to @type_doc\n flash[:success] = 'Se ha actualizado.'\n }\n format.json { render :show, status: :ok, location: @type_doc }\n else\n format.html { render :edit }\n format.json { render json: @type_doc.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7848ffc06ea35c1ddfa14614ecbcf535",
"score": "0.6448157",
"text": "def update\n respond_to do |format|\n if @associated_document_type.update_attributes(params[:associated_document_type])\n format.html { redirect_to(@associated_document_type, :notice => t('scaffold.notice.updated', :item=> AssociatedDocumentType.model_name.human)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @associated_document_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f44bb953fc09956047adfc2a5b0cf0fe",
"score": "0.6384774",
"text": "def type_doc_params\n params.require(:type_doc).permit(:type_client_id, :name)\n end",
"title": ""
},
{
"docid": "0cf716a7c8b25a513f7b143b75115270",
"score": "0.6361887",
"text": "def edit \n\n @document_type = DocumentType.find(params[:id])\n\n end",
"title": ""
},
{
"docid": "0f1a770d02d6cfec8064ab1de33edb6b",
"score": "0.63576514",
"text": "def type_document_params\n params.require(:type_document).permit(:name, :abbreviation)\n end",
"title": ""
},
{
"docid": "85804ee1f502497c79204ce56d248ae1",
"score": "0.63406265",
"text": "def create\n @type_document = TypeDocument.new(type_document_params)\n\n respond_to do |format|\n if @type_document.save\n format.html { redirect_to admin_type_documents_path(@type_document), notice: 'Type document was successfully created.' }\n format.json { render :show, status: :created, location: @type_document }\n else\n format.html { render :new }\n format.json { render json: @type_document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af6c06a04b8480ef65dd265e24660ec7",
"score": "0.63308984",
"text": "def create\n\t@document_type = DocumentType.new(document_type_params)\n respond_to do |format|\n if @document_type.save\n format.json {render json: @document_type, status: :ok }\n else\n format.json { render json: @document_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5018e2a1ceefbda056e95800c86a138d",
"score": "0.6324047",
"text": "def index(index, type, id, document, options={})\n body = encoder.is_encoded?(document) ? document : encoder.encode(document)\n if id.nil?\n response = request(:post, generate_path(:index => index, :type => type), body)\n else\n response = request(:put, generate_path(:index => index, :type => type, :id => id), body)\n end\n handle_error(response) unless response.status == 200\n encoder.decode(response.body)\n end",
"title": ""
},
{
"docid": "91babfd39639d480a60961668db902a9",
"score": "0.6302799",
"text": "def document_type=(name)\n @document_type = name\n end",
"title": ""
},
{
"docid": "91babfd39639d480a60961668db902a9",
"score": "0.6302799",
"text": "def document_type=(name)\n @document_type = name\n end",
"title": ""
},
{
"docid": "91babfd39639d480a60961668db902a9",
"score": "0.6302799",
"text": "def document_type=(name)\n @document_type = name\n end",
"title": ""
},
{
"docid": "41240803d95f995dd718aa53db48659d",
"score": "0.6280074",
"text": "def update_type\n\t\tfname= \"#{self.class.name}.#{__method__}\"\n\t\tLOG.debug(fname){\"params=#{params.inspect}\"}\n\t\t@object_plm = Document.find(params[:id])\n\t\tctrl_update_type @object_plm, params[:object_type]\n\tend",
"title": ""
},
{
"docid": "b2a9b87fdcd1b3f9c7bb52028445eecc",
"score": "0.627218",
"text": "def update\n respond_to do |format|\n if @document_type.update(document_type_params)\n format.html { redirect_to @document_type, notice: \"[#{@document_type.caption}] was successfully updated.\" }\n format.js { redirect_to @document_type, notice: \"[#{@document_type.caption}] was successfully updated.\" }\n else\n format.html { render action: 'edit' }\n format.js { render action: 'edit' }\n end\n end\n end",
"title": ""
},
{
"docid": "38979984bdedacd95706689e25f09f9e",
"score": "0.6261685",
"text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end",
"title": ""
},
{
"docid": "ef66a2138ec463f73ee8685378bbe4b9",
"score": "0.62093735",
"text": "def doc_type_params\n params.require(:doc_type).permit(:name)\n end",
"title": ""
},
{
"docid": "31312ab028f5e01b6b626bbef9b9006b",
"score": "0.61951625",
"text": "def update\n @business_document_type = BusinessDocumentType.find(params[:id])\n\n respond_to do |format|\n if @business_document_type.update_attributes(params[:business_document_type])\n format.html { redirect_to @business_document_type, notice: 'Business document type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @business_document_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e392b3e94167617f55483f9f509abb66",
"score": "0.61912245",
"text": "def update_entity_type(entity_type_id, request)\n start.uri('/api/entity/type')\n .url_segment(entity_type_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end",
"title": ""
},
{
"docid": "40e099ae2ae6f690fa5ffe893ec428c2",
"score": "0.6175255",
"text": "def update\n respond_to do |format|\n if @doc_type_config.update(doc_type_config_params)\n format.html { redirect_to @doc_type_config, notice: 'Doc type config was successfully updated.' }\n format.json { render :show, status: :ok, location: @doc_type_config }\n else\n format.html { render :edit }\n format.json { render json: @doc_type_config.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "512c8d93b800ad5c148c0cd12e863d69",
"score": "0.61696565",
"text": "def set_doc_attachment_type\n @doc_attachment_type = DocAttachmentType.find(params[:id])\n end",
"title": ""
},
{
"docid": "d9f4e455421dd5fa739a36564f4449db",
"score": "0.615555",
"text": "def update\n @type_clients = TypeClient.all\n @type_docs = TypeDoc.where('type_client_id = ?',@client.type_doc.type_client_id) \n respond_to do |format|\n if @client.update(client_params)\n format.html { \n redirect_to @client\n flash[:success] = 'Se ha actualizado.' }\n format.json { render :show, status: :ok, location: @client }\n else\n format.html { render :edit }\n format.json { render json: @client.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e9edd53bf9b0b7cf6f82234453ef8b84",
"score": "0.61527264",
"text": "def update\n respond_to do |format|\n if @doc_type.update(doc_type_params)\n doc_type_hash()\n format.html { redirect_to @doc_type, notice: $gcMsgUpdateRecord }\n format.json { render :json => @doc_type_hash }\n format.xml { render :xml => @doc_type_hash }\n else\n lcHashError = { return_status: false, errors: @doc_type.errors }\n format.html { render :edit }\n format.json { render :json => lcHashError }\n format.xml { render :xml => lcHashError }\n end\n end\n end",
"title": ""
},
{
"docid": "68832f0f0f3cdda50479121c9847c59e",
"score": "0.6147916",
"text": "def create\n @document_type = DocumentType.new(params[:document_type])\n @document_type.user_id = current_user.id\n respond_to do |format|\n if @document_type.save\n format.html { redirect_to @document_type, notice: 'Document type was successfully created.' }\n format.json { render json: @document_type, status: :created, location: @document_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @document_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b1d4fb3fbc2c66bcb55b1a942b0c6649",
"score": "0.6146904",
"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": "0032732f21af3862aa07e782cc6cc718",
"score": "0.61405563",
"text": "def create\n @documenttype = Documenttype.new(params[:documenttype])\n\n respond_to do |format|\n if @documenttype.save\n format.html { redirect_to @documenttype, notice: 'Documenttype was successfully created.' }\n format.json { render json: @documenttype, status: :created, location: @documenttype }\n else\n format.html { render action: \"new\" }\n format.json { render json: @documenttype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd731170147b2ffc6f1be185db58bb86",
"score": "0.6122881",
"text": "def index(document, params = {})\n overrides = from_document document\n params = update_params(params, overrides)\n params.merge!(action: \"docs.index\", rest_api: \"index\")\n\n params.delete(:id) if params[:id].nil? || params[:id].to_s =~ /\\A\\s*\\z/\n\n response =\n if params[:id]\n client.put \"/{index}/{type}/{id}\", params\n else\n client.post \"/{index}/{type}\", params\n end\n\n response.body\n end",
"title": ""
},
{
"docid": "5990e111e00870e4b69b66ec56b03a58",
"score": "0.61225086",
"text": "def documenttypes_id_documenttype_put_with_http_info(id_documenttype, name, attacheable, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ProvidersApi.documenttypes_id_documenttype_put ...'\n end\n # verify the required parameter 'id_documenttype' is set\n if @api_client.config.client_side_validation && id_documenttype.nil?\n fail ArgumentError, \"Missing the required parameter 'id_documenttype' when calling ProvidersApi.documenttypes_id_documenttype_put\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling ProvidersApi.documenttypes_id_documenttype_put\"\n end\n # verify the required parameter 'attacheable' is set\n if @api_client.config.client_side_validation && attacheable.nil?\n fail ArgumentError, \"Missing the required parameter 'attacheable' when calling ProvidersApi.documenttypes_id_documenttype_put\"\n end\n # resource path\n local_var_path = '/documenttypes/{id_documenttype}'.sub('{' + 'id_documenttype' + '}', id_documenttype.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'expand'] = opts[:'expand'] if !opts[:'expand'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/x-www-form-urlencoded'])\n\n # form parameters\n form_params = {}\n form_params['name'] = name\n form_params['attacheable'] = attacheable\n\n # http body (model)\n post_body = nil\n auth_names = ['api_key']\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 => 'DocumentType')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ProvidersApi#documenttypes_id_documenttype_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "b91e74b3c97f4c883caf69624515bf14",
"score": "0.61161214",
"text": "def update\n respond_to do |format|\n if @payment_document_type.update(payment_document_type_params)\n format.html { redirect_to @payment_document_type, notice: 'Payment document type was successfully updated.' }\n format.json { render :show, status: :ok, location: @payment_document_type }\n else\n format.html { render :edit }\n format.json { render json: @payment_document_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f4afb9eb722d38bd32c47060d74a544c",
"score": "0.6114954",
"text": "def document_params\n params.require(:document).permit(:name, :document_type)\n end",
"title": ""
},
{
"docid": "3f542e86550df0abd68767f08d0c4285",
"score": "0.6109932",
"text": "def destroy\n @document_type = DocumentType.find(params[:id])\n @document_type.destroy\n respond_to do |format|\n format.html { redirect_to document_types_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9565af4819a117fc9ed0a9f0cb651e9a",
"score": "0.6103585",
"text": "def update\n authorize! :manage, Document\n\n if params[:id]\n @document = Document.find(params[:id])\n success = @document.update_attributes(document_params)\n else\n @document = Document.new(document_params)\n template = DocumentTemplate.where(:name => params[:template]).first\n if !template\n head :bad_request\n return\n end\n @document.document_template = template\n @document.user_id = @user.id\n if change = ClientChange.find(params[:client_change_id])\n if change.type == 'template'\n change = ClientChange.where(\n :client => change.client,\n :created_at.lt => change.created_at,\n :type => 'client'\n ).desc(:created_at).first\n end\n @document.client_id = change.client_id\n @document.client_change_id = change.id\n success = @document.save!\n else\n success = false\n end\n end\n\n respond_to do |format|\n if success\n format.json { render json: get_json(@document) }\n else\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "80b2ab43e7ea83a3b3f2c0164276ab6a",
"score": "0.6093269",
"text": "def document_type_params\n params.require(:document_type).permit(:name,:description)\n end",
"title": ""
},
{
"docid": "df237d731f329a3c6ea24751b609b8f7",
"score": "0.6089215",
"text": "def update\n convert_camelcase\n\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n get_meta_data\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "05331d97bde4eaf6cf014d9803c1c11e",
"score": "0.6078948",
"text": "def update\n @document = Document.find(params[:id])\n\n respond_to do |format|\n [ :name, :body ].each do |attr|\n @document.send(\"#{attr}=\", params[:document][attr])\n end\n if @document.save\n flash[:notice] = 'Document was successfully updated.'\n format.html { redirect_to(@document) }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @document.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "719837858c5e274067c93fa8d0891666",
"score": "0.6070992",
"text": "def create\n @doc_type = DocType.new(params[:doc_type])\n\n respond_to do |format|\n if @doc_type.save\n format.html { redirect_to @doc_type, notice: 'Doc type was successfully created.' }\n format.json { render json: @doc_type, status: :created, location: @doc_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @doc_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "95fae1b81da516cb5e9d242db4f7b668",
"score": "0.6066216",
"text": "def document_type=(value)\n if value.respond_to?(:each)\n super(value.first)\n else\n super(value)\n end\n end",
"title": ""
},
{
"docid": "ad3e7e6e80001620bb23fd5951c84b2f",
"score": "0.6060823",
"text": "def destroy\n @documenttype = Documenttype.find(params[:id])\n @documenttype.destroy\n\n respond_to do |format|\n format.html { redirect_to documenttypes_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "05ca94b6af163bcd5d40fc466fc7f093",
"score": "0.605909",
"text": "def update\n @document = Document.find(params[:id])\n @document.update(document_params)\n @document.path = \"data:#{path_params['filetype']};base64, #{path_params['base64']}\" if path_params[\"filetype\"].present?\n if @document.save\n if @document.state == \"approved\"\n @document.user.event_subscriptions.map do |es|\n es[:approved] = es.user_requirements_status\n es.save\n end\n end\n head :no_content\n else\n render json: @document.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "7586d6b864a6b0be1094972244416f5e",
"score": "0.6039789",
"text": "def update\n @frbr_document_type = FrbrDocumentType.find(params[:id])\n\n respond_to do |format|\n if @frbr_document_type.update_attributes(params[:frbr_document_type])\n format.html { redirect_to @frbr_document_type, notice: 'Frbr document type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @frbr_document_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "426187f9cfb6aebf1e8ab30395e74fcd",
"score": "0.6039071",
"text": "def document_type=(value)\n document_type_will_change! unless value.present?\n if value.respond_to?(:each)\n super(value.first)\n else\n super(value)\n end\n end",
"title": ""
},
{
"docid": "aabd8a3facd970c12761f220d274165f",
"score": "0.6007939",
"text": "def destroy\n @doc_type = DocType.find(params[:id])\n @doc_type.destroy\n\n respond_to do |format|\n format.html { redirect_to doc_types_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7079a1b2a882a8f7a3c24948e03b792f",
"score": "0.6002313",
"text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: I18n.t('WasUpdated', model: Document.model_name.human(count: 0)).capitalize }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "80a7e269ac90a4df799668ceb51b6620",
"score": "0.5998539",
"text": "def save_document_type\n @document_type = draft.document_type\n end",
"title": ""
},
{
"docid": "c9ec436a6c88941f38194de8caabf6a8",
"score": "0.5991374",
"text": "def update\n @document = Item.find(params[:id])\n #@document.add_concepts(params[:document][:concept_titles], 'u')\n respond_to do |format|\n if @document.update_attributes(params[:document].merge(:modified_flag=>true))\n flash[:notice] = 'Document was successfully updated.'\n format.html { redirect_to(@document) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "81236f6d6dd57905c4a84e61e8e798b6",
"score": "0.598323",
"text": "def create\n @document = Document.new(document_params)\n @document.typename= @document.typename.upcase\n respond_to do |format|\n if @document.save\n format.html { redirect_to @document, notice: 'El documento fue registrado exitosamente' }\n format.json { render :show, status: :created, location: @document }\n else\n format.html { render :new }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "763f959db782a3106df238a80a82a2c3",
"score": "0.5976882",
"text": "def update\n respond_to do |format|\n if @object_type.update(name: params[:name], description: params[:description])\n format.json { render json: @object_type }\n end\n end\n end",
"title": ""
},
{
"docid": "fab0e33fe40ede39616b809b51fe4adb",
"score": "0.59758407",
"text": "def update\n @object = Type.find(params[:id])\n @object.update(object_params)\n render json: @object \n end",
"title": ""
},
{
"docid": "134bf36982b553b172d3243af737d48f",
"score": "0.5969478",
"text": "def resource_type\n document_type\n end",
"title": ""
},
{
"docid": "74f25b582d2460682fa96e7f0cc0706d",
"score": "0.59382856",
"text": "def document_type\n Document\n end",
"title": ""
},
{
"docid": "f10b8a2b9f308b83fc6c5c1ffbd0abb0",
"score": "0.5932101",
"text": "def replace_application_document( id, type, payload )\n post_binary( '/records/' + @record_id + '/apps/documents/key/' + id + '/replace', type, payload ).xpath('//api:document').first\n end",
"title": ""
},
{
"docid": "b99e37181bab20e1a0b8f2d6f52c0f97",
"score": "0.592543",
"text": "def update\n respond_to do |format|\n if @typecollection.update(typecollection_params)\n format.html { redirect_to @typecollection, notice: 'Typecollection was successfully updated.' }\n format.json { render :show, status: :ok, location: @typecollection }\n else\n format.html { render :edit }\n format.json { render json: @typecollection.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b0c45943327815ded7f9af6786622ab",
"score": "0.59134495",
"text": "def document_type_params\n params.require(:document_type).permit(\n :caption, :abbreviation, :order, :synonyms, :field_list, :report_field_list, :hidden_author,\n :peer_review_document_sub_category_id, :no_peer_review_document_sub_category_id)\n end",
"title": ""
},
{
"docid": "951021e0dccc92771d078322e1fe4782",
"score": "0.59048885",
"text": "def update\n @document = V1::Document.find(params[:id])\n\n respond_to do |format|\n if @document.update_attributes(params[:document])\n flash[:notice] = 'V1::Document was successfully updated.'\n format.html { redirect_to(@document) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @document.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "17c0e95e6dc17a4f8d9919f21d957d63",
"score": "0.5903734",
"text": "def add(type, id, doc, params={})\n doc.each do |key, val|\n # make sure dates are in a consistent format for indexing\n doc[key] = val.iso8601 if val.respond_to?(:iso8601)\n end\n\n put do |req|\n req.url \"/#{@name}/#{type}/#{id}\", params\n req.body = doc\n end\n end",
"title": ""
},
{
"docid": "6113a23cbf951b9880cae8721f7ba2c4",
"score": "0.5899198",
"text": "def update\n @type = Type.find(params[:id])\n\n respond_to do |format|\n if @type.update_attributes(params[:type])\n format.html { redirect_to types_path, notice: 'Type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d6e66ec8a71d06f24c704664f00cedac",
"score": "0.5884757",
"text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { render :edit, notice: 'Document was successfully created.' }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "29500741700746d1b40d95edf0927af0",
"score": "0.5874758",
"text": "def document_type=(document_type)\n validator = EnumAttributeValidator.new('String', [\"Abstract\", \"Agreement\", \"Assent\", \"Assignment\", \"Charge\", \"Conveyance\", \"Deed\", \"Indenture\", \"Lease\", \"Licence\", \"Plan\", \"SubCharge\", \"Transfer\", \"Other\", \"CommonholdCommunityStatement\", \"MemorandumAndArticlesOfAssociation\", \"SurrenderOfDevelopmentRights\", \"TerminationDocument\"])\n unless validator.valid?(document_type)\n fail ArgumentError, \"invalid value for 'document_type', must be one of #{validator.allowable_values}.\"\n end\n @document_type = document_type\n end",
"title": ""
},
{
"docid": "6d78817094c78b8e00753e78f400d48d",
"score": "0.586103",
"text": "def delete_document\n @student = Student.find(params[:id])\n document_type = params[:document_type]\n @student.send \"#{document_type}=\".to_sym, nil\n\n if @student.save\n respond_with @student\n else\n respond_with @student, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "8a4ff17e32f3af733dce8068deb518ea",
"score": "0.5858058",
"text": "def destroy\n\t@document_type =DocumentType.find(params[:id])\n @document_type.destroy\n respond_to do |format|\n format.json { render json: {}, status: :ok }\n end\n end",
"title": ""
},
{
"docid": "6e233529c3d7b45c9c2e44799e0abae4",
"score": "0.5852883",
"text": "def update\n respond_to do |format|\n if @type.update(type_params)\n format.html { redirect_to @type, notice: 'Type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1317fe9ee9261995a3c38389ade72579",
"score": "0.584608",
"text": "def update\n respond_to do |format|\n if @type.update(type_params)\n format.html { redirect_to @type, notice: 'Type was successfully updated.' }\n format.json { render :show, status: :ok, location: @type }\n else\n format.html { render :edit }\n format.json { render json: @type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1317fe9ee9261995a3c38389ade72579",
"score": "0.584608",
"text": "def update\n respond_to do |format|\n if @type.update(type_params)\n format.html { redirect_to @type, notice: 'Type was successfully updated.' }\n format.json { render :show, status: :ok, location: @type }\n else\n format.html { render :edit }\n format.json { render json: @type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "642a71e8a60ebc957d9d622819dcfba2",
"score": "0.58421904",
"text": "def update\n respond_to do |format|\n handle_sample_swap if @resource.sample?\n if @resource.update strong_type params, @type, @type.downcase\n handle_successful_update\n format.html { redirect_to resource_path(@resource, :edit), notice: 'Changes successfully saved.' }\n else\n handle_invalid\n format.html { render :edit }\n end\n end\n end",
"title": ""
},
{
"docid": "c00c683db0f6a4c62c033d3442dee33a",
"score": "0.5840763",
"text": "def update\n @type = Type.find(params[:id])\n\n respond_to do |format|\n if @type.update_attributes(params[:type])\n format.html { redirect_to @type, notice: 'Type was successfully updated!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "785713e3aa1a60734387cb78a5762ea3",
"score": "0.58315533",
"text": "def update\n respond_to do |format|\n if @resource_type.update(resource_type_params)\n format.html { redirect_to @resource_type, notice: 'Resource type was successfully updated.' }\n format.json { render :show, status: :ok, location: @resource_type }\n else\n format.html { render :edit }\n format.json { render json: @resource_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "961ed2772e8f7a11a6e1269cd72b6604",
"score": "0.58272296",
"text": "def update\n @document = Document.find(params[:id])\n documentable = @document.documentable\n\n respond_to do |format|\n if @document.update_attributes(document_params)\n format.html { redirect_to documentable, flash: { success: 'Document was successfully updated.' } }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fd614baf3c249b7818c69b5e9d2d9081",
"score": "0.5825081",
"text": "def create\n @type_doc = TypeDoc.new(type_doc_params)\n\n respond_to do |format|\n if @type_doc.save\n format.html { redirect_to @type_doc\n flash[:success] = 'Se ha creado.'}\n format.json { render :show, status: :created, location: @type_doc }\n else\n format.html { render :new }\n format.json { render json: @type_doc.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "78f43faab8f737e106f21ca848148711",
"score": "0.5814503",
"text": "def update\n respond_to do |format|\n if @type_obj.update(type_obj_params)\n format.html { redirect_to admin_path, notice: 'Type obj was successfully updated.' }\n format.json { render :show, status: :ok, location: @type_obj }\n else\n format.html { render :edit }\n format.json { render json: @type_obj.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7584d4ba41f111ec08dd58483f2cb435",
"score": "0.5811276",
"text": "def update\n Type.find(params[:type][:id]).update(title: params[:type][:title])\n redirect_to URI.escape(\"/types\")\n end",
"title": ""
},
{
"docid": "ac2ea7ce84bf1fd39d0e8ab973667c6b",
"score": "0.5811091",
"text": "def update\n event_type = EventType.find(params[:id])\n if event_type.update(event_type_params)\n render json: event_type, status: 200, location: [:api, event_type]\n else\n failed_to_update(event_type, \"event_type\")\n end\n end",
"title": ""
},
{
"docid": "b202ab17ea7f5e3da491de6961390e31",
"score": "0.5803853",
"text": "def update\n @body_type = BodyType.find(params[:id])\n\n respond_to do |format|\n if @body_type.update_attributes(body_type_params)\n format.html { redirect_to body_types_path, notice: 'Body type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @body_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "77c2c57a07c4d42bba38333ded757177",
"score": "0.5789357",
"text": "def update\n @doctype = Doctype.find(params[:id])\n\n respond_to do |format|\n if @doctype.update_attributes(params[:doctype])\n format.html { redirect_to @doctype, notice: 'Тип документа успешно обновлен.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @doctype.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "37a676dcf557187eb490d8413eb2f781",
"score": "0.5789272",
"text": "def update\n authorize! :manage_content, @object\n\n # if this object has been submitted, doesnt have an open version, and isnt sitting at sdr-ingest with a hold, they cannot change it.\n return render_error('Object cannot be modified in its current state.') unless @object.allows_modification?\n return render_error('Invalid new content type.') unless valid_content_type?\n return render_error('Object doesnt have a content metadata datastream to update.') unless has_content?\n\n @object.contentMetadata.set_content_type(\n params[:old_content_type],\n params[:old_resource_type],\n params[:new_content_type],\n params[:new_resource_type]\n )\n\n respond_to do |format|\n if params[:bulk]\n format.html { render plain: 'Content type updated.' }\n else\n format.any { redirect_to solr_document_path(params[:item_id]), notice: 'Content type updated!' }\n end\n end\n @object.save\n ActiveFedora.solr.conn.add(@object.to_solr) unless params[:bulk]\n end",
"title": ""
},
{
"docid": "b0bf73e4ed40ac33a7ea56e5a0cadcaf",
"score": "0.57842225",
"text": "def update\n respond_to do |format|\n if @word_type.update(word_type_params)\n format.html { redirect_to @word_type, notice: 'Word type was successfully updated.' }\n format.json { render :show, status: :ok, location: @word_type }\n else\n format.html { render :edit }\n format.json { render json: @word_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "32beed3b72a75b9d8963e28364fc4876",
"score": "0.5783897",
"text": "def update\n respond_to do |format|\n if @document.update_attributes(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9b89d96617846d71a7cc074337a43911",
"score": "0.5783751",
"text": "def update\n @word_type = WordType.find(params[:id])\n\n respond_to do |format|\n if @word_type.update_attributes(params[:word_type])\n format.html { redirect_to word_types_path, notice: 'Word type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @word_type.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70cbc116c0276fd92d0383aafa6b901a",
"score": "0.5780148",
"text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70cbc116c0276fd92d0383aafa6b901a",
"score": "0.5780148",
"text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70cbc116c0276fd92d0383aafa6b901a",
"score": "0.5780148",
"text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70cbc116c0276fd92d0383aafa6b901a",
"score": "0.5780148",
"text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70cbc116c0276fd92d0383aafa6b901a",
"score": "0.5780148",
"text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "70cbc116c0276fd92d0383aafa6b901a",
"score": "0.5780148",
"text": "def update\n respond_to do |format|\n if @document.update(document_params)\n format.html { redirect_to @document, notice: 'Document was successfully updated.' }\n format.json { render :show, status: :ok, location: @document }\n else\n format.html { render :edit }\n format.json { render json: @document.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
d0848cee9ea416dfbd5b07103b6fd1ec
|
get every test to pass before coding runner below
|
[
{
"docid": "ee01661b7bf9e498b80a3b486222665b",
"score": "0.0",
"text": "def runner\n welcome\n total_draw = initial_round\n while total_draw < 21\n total_draw = hit?(total_draw)\n display_card_total(total_draw)\nend\nend_game(total_draw)\nend",
"title": ""
}
] |
[
{
"docid": "4214d9c38556c2b02453744c9abd3771",
"score": "0.7492311",
"text": "def pass(suite, test, test_runner); end",
"title": ""
},
{
"docid": "e820a876acc56d01d07c4fe31f07d454",
"score": "0.74173",
"text": "def run_tests\n count = 0\n puts \"Starting test run...\"\n self.methods.each {|test|\n next if test !~ /^test_/\n puts \"[*] Running '#{test}'...\" if @loglevel > 2\n count +=1 if self.method(test).call\n }\n \n if count > 0\n puts \"Found #{count} failure#{\"s\" if count > 1 || count == 0}.\"\n else\n puts \"Found no failures. Tokens seem sane.\"\n end\n end",
"title": ""
},
{
"docid": "b394b10cb0558234b3c6fc1c4a03c82b",
"score": "0.73274654",
"text": "def run_all_tests\n read_env\n reset_tests\n\n ret = true\n self.failed_tests = []\n self.test_classes.each do |klass|\n ret &= run_all_tests_in_class(klass)\n end\n ret\n end",
"title": ""
},
{
"docid": "5596a3d5e4be52035b4157f548b708ba",
"score": "0.7279609",
"text": "def passing; @test_passed end",
"title": ""
},
{
"docid": "fe33402844dc199a7d3a6f44f3f81b57",
"score": "0.7245295",
"text": "def test_espresso_all(test = nil)\n generator = Generator.new(\"a\",\"b\",\"c\",\"d\")\n generator.seed = @seed\n if test then\n test = test.to_i\n print \"Test #{test}: \"\n return test_espresso(generator.make_1cover(test))\n else\n generator.each_1cover.with_index do |cover,i|\n print \"Test #{i}: \"\n return false unless test_espresso(cover)\n end\n return true\n end\n end",
"title": ""
},
{
"docid": "f16058f4c2ff1a02951e298da43a1e6a",
"score": "0.7151632",
"text": "def setup_test_stage\n say \"Checking common problems \"\n failed = false\n all_test_methods.sort.each do |test|\n begin\n send(test)\n print_dot unless failed\n true\n rescue => e\n say \"\\n\" unless failed\n failed = true\n paragraph{ error e.message }\n false\n end\n end.tap do |pass|\n success(' done') if !failed\n end\n\n true\n end",
"title": ""
},
{
"docid": "d5a6392d95e8bc4ef73fb2e93190a7d4",
"score": "0.71329165",
"text": "def run_passes\n run_before FIRST_PASS\n run_after FIRST_PASS\n end",
"title": ""
},
{
"docid": "6ac0f028dc11e1a857038fd8e748bba1",
"score": "0.7073319",
"text": "def test\n raise 'Failing test' if Global.fail\n\n Global.nbr_runs += 1\n end",
"title": ""
},
{
"docid": "f78af19ce90b642e642ae4137d599981",
"score": "0.7037707",
"text": "def check_tests\n tests_to_run.clear\n @test_monitor.scan_new_or_changed_with_test do |file, test|\n tests_to_run << test\n end\n if tests_to_run.size > 0\n print \"\\nTesting files: #{tests_to_run.join(\" \")}\\n\"\n system 'ruby -e \"\" -rtest/unit %s' % tests_to_run.map{|test| '-r%s' % test}.join(\" \")\n end\n end",
"title": ""
},
{
"docid": "c1152b3afd6ca1fb58b5069d4fc08aad",
"score": "0.6982976",
"text": "def passed\n all_tests.select(&:passed?)\n end",
"title": ""
},
{
"docid": "ed40ce7199db82876b1bdf9fda3f1528",
"score": "0.69716024",
"text": "def run_all_tests\n\n # Array of test sections\n test_library = [\n request_uri_test_cases,\n review_test_cases,\n reviews_request_test_cases,\n api_test_cases,\n server_test_cases\n ]\n\n # Actually run tests and print out results\n section_iter = 0\n puts \"\\n\"\n test_library.each do |test_section|\n section_iter += 1\n run_tests(test_section, section_iter)\n puts \"\\n\\n\"\n end\n\nend",
"title": ""
},
{
"docid": "8be1bd462fbd36f34b1b2d86a24e2536",
"score": "0.69709903",
"text": "def all_tests_pass\n cucumber_guard = ::Guard.guards({ :name => 'extendedcucumber', :group => 'tests'}).first\n cucumber_passed = cucumber_guard.instance_variable_get(\"@failed_paths\").empty?\n rspec_guard = ::Guard.guards({ :name => 'rspec', :group => 'tests'}).first\n rspec_passed = rspec_guard.instance_variable_get(\"@failed_paths\").empty?\n return rspec_passed && cucumber_passed\nend",
"title": ""
},
{
"docid": "10a276bce57bdee48e7d5d2b4690e737",
"score": "0.69156593",
"text": "def find_started_passing_tests\n @logger.debug('Looking for new successes...')\n\n failed_value = Result::Fail.value\n previous_test_ids = @previous_run_result.test_results.where { result < failed_value }.map { |result| result.test_id }\n tests = @run_result.test_results.where { result < failed_value }\n\n passed_tests = tests.where { |q| q.test_id.not_in previous_test_ids }\n passed_tests.each do |test_result|\n @test_database.create_test_result_change(@run_result, test_result.test, Automation::Test::Change::TestStartedPassing)\n end\n end",
"title": ""
},
{
"docid": "f311f458488fe72a875a01fdb96476e7",
"score": "0.68891853",
"text": "def test\n install_gems\n run_before_scripts\n run_scripts\n\n fail 'Some tests failed!' unless @passed\n\n puts 'All tests passed!'\n end",
"title": ""
},
{
"docid": "3ba4d2408f07cfe02b8fe74b8148c1b6",
"score": "0.68871903",
"text": "def passes_a\n tests.select(&:passed?).map { |e| result_h(e, 'passed') }\n end",
"title": ""
},
{
"docid": "38ec862ec3a8882eec9d4691fbea0d5b",
"score": "0.6873695",
"text": "def run_all\n results = runner.test_all\n throw :task_has_failed if results.failed?\n end",
"title": ""
},
{
"docid": "47731c9227e172710624da0fd2bb93a6",
"score": "0.68730116",
"text": "def test_cases\n test_suites.map(&:test_cases).tap(&:flatten!).select { |test_case| valid_test_method(test_case) }\n end",
"title": ""
},
{
"docid": "b9a22797dc9b97ac0ac383472c447b8c",
"score": "0.6862768",
"text": "def any_test_failed?(test_results); end",
"title": ""
},
{
"docid": "b94a14795c34b9bb80ab315b1d16c02f",
"score": "0.6853204",
"text": "def ran\n all_tests.select(&:ran?)\n end",
"title": ""
},
{
"docid": "9a461eb10c752e638f8709e6336f37e1",
"score": "0.6843228",
"text": "def run_tests(flags='run_all')\n # TODO - shore this up someday\n # Right now just a way to run just the tests in the else block below\n # Should eventually be able to take a list of tests or 'all' or something like that\n run_only = false\n run_only = true if flags[0].include? 'run_only' or flags[0].include? 'run_selected'\n num_tests = 0\n if not run_only\n\n all_pass = true\n begin\n #\n test__comment ; num_tests += 1 \n test__stmt_note_with_name ; num_tests += 1 \n test__stmt_note_without_name ; num_tests += 1\n test__stmt_note_alt_syntax ; num_tests += 1\n test__phrase ; num_tests += 1\n test__phrase_alt_syntax ; num_tests += 1\n test__section ; num_tests += 1\n test__repeat_index ; num_tests += 1\n test__write_format_sections_phrases ; num_tests += 1\n test__render ; num_tests += 1\n test__phrase_lite_syntax ; num_tests += 1\n test__measure_lite_syntax ; num_tests += 1\n test__copy_measure_lite_syntax ; num_tests += 1\n test__section_lite_syntax ; num_tests += 1\n test__repeat_index_lite_syntax ; num_tests += 1\n test__sections_phrases_lite_syntax ; num_tests += 1\n test__assignment ; num_tests += 1\n test__assignment_comment ; num_tests += 1\n test__assignment_2 ; num_tests += 1\n test__repeat_until; num_tests += 1\n test__repeat_assignment ; num_tests += 1\n test__func ; num_tests += 1\n test__next ; num_tests += 1\n test__render_lite_syntax ; num_tests += 1\n test__meter_lite_syntax ; num_tests += 1\n test__tempo ; num_tests += 1\n test__tempo_default ; num_tests += 1\n test__ensemble ; num_tests += 1\n test__ensemble_phrase_play_players ; num_tests += 1\n test__ensemble_phrase_play_ensembles ; num_tests += 1\n test__instruction_players ; num_tests += 1\n test__instruction_players_ensembles ; num_tests += 1\n test__instruction_players_state ; num_tests += 1\n test__instruction_ensemble_state ; num_tests += 1\n test__improvise_player ; num_tests += 1\n test__improvise2_player ; num_tests += 1\n test__render_lite_syntax_default_write ; num_tests += 1\n test__phrase_midi_lite_syntax ; num_tests += 1\n test__phrase_midi_format_top ; num_tests += 1\n test__ensemble_instrument_channel_midi_render ; num_tests += 1\n test__phrase_midi_format_consts ; num_tests += 1\n test__phrase_csound_format_consts ; num_tests += 1\n test__player_instrument ; num_tests += 1\n test__no_start_auto_next ; num_tests += 1\n test__import_phrase ; num_tests += 1\n test__import_root_map_players; num_tests += 1\n \n rescue AleatoricTestException => e\n puts e.to_s\n all_pass = false\n end\n\n else # if run_only\n \n all_pass = true\n begin \n \n # *** run_only TESTS GO HERE ***\n\n # *** run_only TESTS GO HERE ***\n \n rescue AleatoricTestException => e \n puts e.to_s\n all_pass = false\n end \n \n end\n \n puts \"\\n\\n***** composer_test: #{num_tests} run *****\\n\\n\"\n if AleatoricTest.all_pass? and all_pass \n puts \"***** composer_test: ALL TESTS PASSED *****\\n\\n\"\n else\n puts \"***** composer_test: #{AleatoricTest.failed_tests.length} TESTS FAILED *****\\n\\n\"\n AleatoricTest.failed_tests.each {|t| puts t}\n puts \"\\n\"\n end\n puts \"***** composer_test: complete *****\\n\\n\"\nend",
"title": ""
},
{
"docid": "8ed4d9487da168e3023e8e171ccf922e",
"score": "0.68255424",
"text": "def run_tests\n _run_anything :test\n end",
"title": ""
},
{
"docid": "2d707d830d05da5ab957f333347b9215",
"score": "0.6808374",
"text": "def run_checks\n tests_passed = true\n if @test_type == 'blinkr'\n tests_passed &= execute_blinkr\n elsif @test_type == 'dcp'\n tests_passed &= execute_dcp_checks\n else\n fail(StandardError, \"#{@test_type} is not a recognised test type, please check and try again\")\n end\n tests_passed\n end",
"title": ""
},
{
"docid": "63d69ce87585207e3e97639f4b03e22e",
"score": "0.6791387",
"text": "def successful_tests\n count = 0\n self.learning_tests.each do |test|\n if test.is_successful_test?\n count = count + 1\n end\n end\n count\n end",
"title": ""
},
{
"docid": "63d69ce87585207e3e97639f4b03e22e",
"score": "0.6791387",
"text": "def successful_tests\n count = 0\n self.learning_tests.each do |test|\n if test.is_successful_test?\n count = count + 1\n end\n end\n count\n end",
"title": ""
},
{
"docid": "8fbc98d9068bd9c82033a031286f0a1e",
"score": "0.6790065",
"text": "def tests; end",
"title": ""
},
{
"docid": "8fbc98d9068bd9c82033a031286f0a1e",
"score": "0.6790065",
"text": "def tests; end",
"title": ""
},
{
"docid": "e7c560b4a3161a8573c7f9514df1aa72",
"score": "0.6768047",
"text": "def passed_checks\n all_checks_which_pass\n end",
"title": ""
},
{
"docid": "be1a3c96e3fcb8f2d7f4f46c9b9f80d8",
"score": "0.6768014",
"text": "def run\n puts (1..tests.length).to_s\n tests.each_with_index do |test, i|\n begin\n if test.is_ok?\n ok(test, i)\n else\n not_ok(test, i)\n end\n rescue Sequel::DatabaseError\n puts $!.sql\n raise $!\n end\n end\n end",
"title": ""
},
{
"docid": "bb0c9a1f3b857de26bdb0dc4b0cc85d7",
"score": "0.6758628",
"text": "def fetch_tests\n _requirement_hook do\n @test_collection.fetch_and_add_testcases do |num|\n yield num if block_given?\n end\n #System.clear_screen\n end\n return @test_collection.test_cases\n end",
"title": ""
},
{
"docid": "afb454d44f89fa5eb7177e10f7341a6f",
"score": "0.6747024",
"text": "def run_tests\n @@test_config.each do |test|\n url_test = generate_url_test(test)\n @errors_or_warnings_found |= url_test.run_tests\n @email_body += url_test.format_results\n end\n end",
"title": ""
},
{
"docid": "4401d167bb7307005b52901a61ada6be",
"score": "0.6739721",
"text": "def passed \n tests.select{|test| test.test_status == \"passed\"}\n end",
"title": ""
},
{
"docid": "0974c3ad7f9ef5084c3427ec94334c0d",
"score": "0.6739479",
"text": "def run_tests\n tests_passed = true\n if @test_type == 'e2e' || @test_type == 'kc_e2e'\n %w(desktop mobile).each do |profile|\n tests_passed &= execute_e2e(profile)\n end\n else\n tests_passed &= execute_blc\n end\n tests_passed\n end",
"title": ""
},
{
"docid": "0974c3ad7f9ef5084c3427ec94334c0d",
"score": "0.6739081",
"text": "def run_tests\n tests_passed = true\n if @test_type == 'e2e' || @test_type == 'kc_e2e'\n %w(desktop mobile).each do |profile|\n tests_passed &= execute_e2e(profile)\n end\n else\n tests_passed &= execute_blc\n end\n tests_passed\n end",
"title": ""
},
{
"docid": "6f6bfdb51c20748c461768ed5ee2d3a6",
"score": "0.67315686",
"text": "def run_all_after_pass(tests_passed)\n return unless @options[:all_after_pass]\n\n if tests_passed\n run_all if @previous_failed\n else\n @previous_failed = true\n end\n end",
"title": ""
},
{
"docid": "329fbe415d9cde1f188261f949358ffe",
"score": "0.6731082",
"text": "def main_test_harness\n test__dnd_backstabber_attack\n test__bag_of_lost_coins_leads_to_lottery_ticket\n test__dice_battle__naruto_vs_sasuke\n\n puts \"\\n----- Extra Testing -----\\n\\n\"\n test__bag_cloning\n test__rc_randomizers_cloning\n test__random_select_and_add_items_from_player1_to_player2\nend",
"title": ""
},
{
"docid": "e2a0cdf3edf7be390ab66c3d2f5294be",
"score": "0.6729383",
"text": "def passed\n self.tests.select {|test| test.test_status == \"passed\"}\n end",
"title": ""
},
{
"docid": "d8813f940d83ba20232476df7ab827f8",
"score": "0.6707909",
"text": "def suite_result\n case\n when failures > 0; :failure\n when errors > 0; :error\n when skips > 0; :skip\n else :pass\n end\n end",
"title": ""
},
{
"docid": "a48e9119ea17a6bda4dde7a5b585851c",
"score": "0.66855913",
"text": "def pass?\n prepare_tests\n @tests.all?{ |t| t.pass? }\n end",
"title": ""
},
{
"docid": "84148dec3c1205e779c7decaaa8f1d0a",
"score": "0.66795045",
"text": "def test_run_started; end",
"title": ""
},
{
"docid": "20f58f6748cff9ec9a43210eb85a7c40",
"score": "0.6673442",
"text": "def test\n SeveralChecks.runs << [@name, '', '', 'Global test']\n end",
"title": ""
},
{
"docid": "c0f1e2ce33b688df41b242fa63f8e5b4",
"score": "0.6665543",
"text": "def pre_output\n @did_tests_fail = tests_failed?\n end",
"title": ""
},
{
"docid": "5a602adc31fd12c9cb5724ec50ce3766",
"score": "0.66651165",
"text": "def run_all\n stud_results = run_test stud_cmd\n teach_results = run_test teach_cmd\n puts(\"Students one: #{stud_results}\")\n puts(\"Teachers one: #{teach_results}\")\n if stud_results[:result].eql?(teach_results[:result])\n puts('100% passed!')\n end\n return stud_results\n end",
"title": ""
},
{
"docid": "aaa55e83c39ab0ea104a265f7bbcc47a",
"score": "0.6656543",
"text": "def run_suite(more_tests_follow, &block)\n\tbegin\n\t yield\n\trescue Exception => ex\n\t print_exception(ex)\n\t return false\n\tensure\n\t @service.stop_everything unless more_tests_follow\n\tend\n\tif more_tests_follow\n\t return all_tests_passed?\n\telse\n\t return print_results\n\tend\n end",
"title": ""
},
{
"docid": "517483965e802f0ebd521e8f97b15243",
"score": "0.6625879",
"text": "def test_all_on(sub)\n\t\tputs \"subject: #{sub}\"\n\t\t$tests.each{|test|\n\t\t\tr = test_sub(test,sub)\n\t\t\tif r[:result] then\n\t\t\t\tputs \"\t-- #{test}\"\n\t\t\tend\n\t\t}\t\n\tend",
"title": ""
},
{
"docid": "23aedb1f4ff28280dbb6767747232632",
"score": "0.6621978",
"text": "def test_all\n\t\ttest_cmd_list\n\t\ttest_cmd_mkd\n\t\ttest_cmd_stor\n\tend",
"title": ""
},
{
"docid": "1fbe098b1fdd6d553fbdfefd3e166f43",
"score": "0.66195345",
"text": "def run_all\n success = runner.run(options[:tests_path], options.merge(\n :message => 'Running all tests'\n ))\n\n @previous_failed = !success\n throw :task_has_failed unless success\n end",
"title": ""
},
{
"docid": "50341323d5ef92b6ba68e9c20de39366",
"score": "0.6616818",
"text": "def failed_tests\n @failed_tests\n end",
"title": ""
},
{
"docid": "f0fbb19b868b7d40482caee9e270611b",
"score": "0.6613102",
"text": "def test_run_finished; end",
"title": ""
},
{
"docid": "182c09faffa39fdb6d2f423f02a84a58",
"score": "0.66122174",
"text": "def passing(selected_tests = select_tests)\n selected_tests.select(&:passing?)\n end",
"title": ""
},
{
"docid": "657ca09ded2c7918af57a835c38ccfdb",
"score": "0.66042453",
"text": "def test_ok; end",
"title": ""
},
{
"docid": "657ca09ded2c7918af57a835c38ccfdb",
"score": "0.66042453",
"text": "def test_ok; end",
"title": ""
},
{
"docid": "c376ea2fcc2aa10bcb1c23ea3b6d7336",
"score": "0.6588145",
"text": "def run_all\n run_tests_and_report\n end",
"title": ""
},
{
"docid": "ece330d5d2480f039726ba26c597c6cd",
"score": "0.6586047",
"text": "def run_all\n\t\t\tputs 'Run all Behat tests'\n\t\t\tputs `behat`\n\t\t\tsuccess = last_command_is_successful?\n\n\t\t\tnotify success\n\t\t\tthrow :task_has_failed unless success\n\t\tend",
"title": ""
},
{
"docid": "adbfdc9f43bde6e2d37ba07928b011d4",
"score": "0.657925",
"text": "def before_each_test\nend",
"title": ""
},
{
"docid": "a9e125636a247822ddc9b916c96465cb",
"score": "0.6567096",
"text": "def all_tests\n # Explicit convesion to Array since the inject call on an empty array will return nil\n tests + Array(contexts.map(&:all_tests).inject(:+))\n end",
"title": ""
},
{
"docid": "c95a91380d7e0faed4a15ad6c738607a",
"score": "0.6560877",
"text": "def test_for(example)\n @mistakes += 1 if is_mistake(example)\n @tests += 1\n end",
"title": ""
},
{
"docid": "84f435a661a000dde241904307098154",
"score": "0.654625",
"text": "def recheck\n depends :init, :compile\n\n if config_source['testrun'].nil?\n latest_record = TestRunRecord.latest_record(@build_results.build_dir, @module_set)\n descrip = \"The latest test run\"\n else\n latest_record = named_testrun_record(config_source['testrun'])\n descrip = \"The specified test run\"\n end\n\n failed_test_classnames = latest_record.failed_test_classnames\n\n puts \"\"\n if failed_test_classnames.empty?\n puts \"%s, in '%s', passed. There is nothing to recheck.\" % [ descrip, latest_record.directory_description ]\n else\n puts \"%s, in '%s', failed %d tests. Re-running the following tests:\" % [ descrip, latest_record.directory_description, failed_test_classnames.length ]\n\n patterns = [ ]\n failed_test_classnames.each do |classname|\n puts \" %s\" % classname\n components = classname.split(/\\./)\n patterns << FilePath.new(*components).to_s\n end\n\n puts \"\"\n\n run_tests(FixedPatternSetTestSet.new(config_source, @module_groups, patterns))\n end\n end",
"title": ""
},
{
"docid": "1aa60fe24ab081e7afdd41678c928228",
"score": "0.6532687",
"text": "def test_case_started; end",
"title": ""
},
{
"docid": "1a4d37edbb7a988f058ab29b7e9cee45",
"score": "0.6519833",
"text": "def validate_and_run(test_set)\n start_time = Time.now\n total_patterns = 0\n\n @module_set.each do |build_module|\n build_module.each do |subtree|\n total_patterns += test_set.validate(subtree, ant, @platform, @build_results, @script_results)\n end\n end\n\n end_time = Time.now\n puts \"\\nValidated all %d test(s) in %.2f seconds for %s.\" % [ total_patterns, end_time - start_time, test_set.to_s ]\n\n run_tests(test_set) unless @script_results.failed?\n end",
"title": ""
},
{
"docid": "48fd2da2926fa6432da0aa973551b69c",
"score": "0.6515412",
"text": "def test_all\n\t\ttest_simple_upload\n\t\ttest_config\n\t\ttest_recursive_copy\n\t\ttest_safe_copy_without_overwriting\n\t\ttest_safe_copy_with_overwriting\n\tend",
"title": ""
},
{
"docid": "1b9cd1fbdf90863b393152073ee2c0b1",
"score": "0.6515273",
"text": "def test_cases\n test_suites.map(&:test_cases).tap(&:flatten!)\n end",
"title": ""
},
{
"docid": "1b9cd1fbdf90863b393152073ee2c0b1",
"score": "0.6515273",
"text": "def test_cases\n test_suites.map(&:test_cases).tap(&:flatten!)\n end",
"title": ""
},
{
"docid": "9a2997653017c82413fad50cfaab7811",
"score": "0.6514316",
"text": "def run\n if beginTest\n puts 'Passed!'\n else\n puts 'Failed!'\n end\n end",
"title": ""
},
{
"docid": "fd3002bddc15309761c18ce8e2b2b153",
"score": "0.6513728",
"text": "def testcase_setup\n end",
"title": ""
},
{
"docid": "159e16ddaec4a67f02e775e4390e77e5",
"score": "0.65110666",
"text": "def tests\n if test?\n @@tests\n end\n end",
"title": ""
},
{
"docid": "32eb8732389f631650979b5ffdf8ca35",
"score": "0.6510641",
"text": "def run\n Overseer.current_test = self\n start_time = Time.now\n suite.before.call if suite.before\n begin\n @code.call\n rescue Exception => e\n errors << e\n ensure\n begin\n suite.after.call if suite.after\n rescue Exception => e\n errors << e if passed?\n end\n @time = Time.now - start_time\n end\n end",
"title": ""
},
{
"docid": "05aa73202af7aa1bf57dd9f656622425",
"score": "0.6507352",
"text": "def tests\n ensure_valid\n @tests.keys\n end",
"title": ""
},
{
"docid": "05aa73202af7aa1bf57dd9f656622425",
"score": "0.6507352",
"text": "def tests\n ensure_valid\n @tests.keys\n end",
"title": ""
},
{
"docid": "b782e2616029fe9a866263c4dc064d3c",
"score": "0.6503384",
"text": "def total_successful_tests\n count = 0\n self.learning_tests.each do |test|\n count = test.is_successful_test? ? count + 1 : 0\n end\n count\n end",
"title": ""
},
{
"docid": "b782e2616029fe9a866263c4dc064d3c",
"score": "0.6503384",
"text": "def total_successful_tests\n count = 0\n self.learning_tests.each do |test|\n count = test.is_successful_test? ? count + 1 : 0\n end\n count\n end",
"title": ""
},
{
"docid": "18211f5e524e69674531c26f5e2fbe90",
"score": "0.6497115",
"text": "def test_passed(array)\n last_item = array.length - 1\n test_name = array[last_item - 1]\n test_suite_verify(array[@class_name_idx])\n printf \"%-40s PASS\\n\", test_name\n\n return unless @xml_out\n\n push_xml_output_passed(test_name) if @xml_out\n end",
"title": ""
},
{
"docid": "f5ad8f519b328578d43b60f25c3b991b",
"score": "0.6479112",
"text": "def set_all_test_cases\n @all_test_cases ||= TestCase.modules.inject([]) do |res, mod|\n res + TestCase.where(module: mod).order(name: :asc)\n end\n end",
"title": ""
},
{
"docid": "1dfc857dbcbecd0b1aea1470e96fefc0",
"score": "0.64615506",
"text": "def tapout_test_pass(result) #suite, test, test_runner\n doc = {\n 'type' => 'test',\n 'subtype' => '',\n 'status' => 'pass',\n #'setup': foo instance\n 'label' => \"#{result.label}\",\n #'expected' => 2\n #'returned' => 2\n #'file' => 'test/test_foo.rb'\n #'line': 45\n #'source': ok 1, 2\n #'snippet':\n # - 44: ok 0,0\n # - 45: ok 1,2\n # - 46: ok 2,4\n #'coverage':\n # file: lib/foo.rb\n # line: 11..13\n # code: Foo#*\n 'time' => Time.now - self.suite_start_time\n }\n\n record_stdcom(doc)\n\n #stdout, stderr = @_stdout, @_stderr\n #doc['stdout'] = stdout unless stdout.empty?\n #doc['stderr'] = stderr unless stderr.empty?\n\n return doc\n end",
"title": ""
},
{
"docid": "45d246087c6f8d83ce5031edb2e4cab9",
"score": "0.6448415",
"text": "def process_suitable_tests\n @suitable_tests ||= compute_suitable_tests\n @suitable_tests.each { |data| yield(*data) }\n end",
"title": ""
},
{
"docid": "428b5d1eaf9535043f41374ccd294f0d",
"score": "0.6447049",
"text": "def test_steps; end",
"title": ""
},
{
"docid": "b06f39351ecdfd70f80b90283dd377a6",
"score": "0.6419136",
"text": "def run_all_unit_tests\n\tenv = @context.env_hash\n\tcmd = \"go test `go list ./... | grep -v integration`\"\n\tpid = Process.spawn(env, cmd, chdir: @context.exchange_root)\n\tProcess.wait pid\n\treturn $?.exitstatus == 0\n end",
"title": ""
},
{
"docid": "70020bef7ce1848053b424f9b315b8d4",
"score": "0.64142483",
"text": "def run_all\n %w[unit functional integration performance].each do |test|\n load_in_fork(\"test/#{test}/**/*_test.rb\")\n end\n end",
"title": ""
},
{
"docid": "1ddad8a3ac680425d17717e0c7e0a932",
"score": "0.6407751",
"text": "def test_suite\n test_output_1()\n # test_output_2()\n # test_output_3()\nend",
"title": ""
},
{
"docid": "313cc13906a0cd423ee7743105e05f0c",
"score": "0.64054966",
"text": "def select_tests\r\n\r\n tests = []\r\n\r\n # These tests run the compiled executable and test the expected output\r\n if @config[\"diff\"] && @config[\"exe\"]\r\n\r\n prompt( \"Run diff tests?\", true ) do\r\n diff_test = @config[\"diff\"]\r\n\r\n # Handle multiple tests\r\n if diff_test.kind_of?( Array )\r\n tests = tests + diff_test.map do |diff|\r\n DiffTest.new( @assignment, diff, @config[\"exe\"] )\r\n end\r\n\r\n # There's only one test included\r\n else \r\n tests << DiffTest.new( @assignment, diff_test, @config[\"exe\"] )\r\n end\r\n end\r\n end\r\n\r\n # These tests link a submitted source file against a unit test\r\n if @config[\"simplectest\"]\r\n prompt( \"Run C unit tests?\", true ) do\r\n tests = tests + @config[\"simplectest\"].map do |test|\r\n SimpleCTest.new( @assignment, test )\r\n end\r\n end\r\n end\r\n\r\n # These tests use Cucumber at a feature level\r\n if @config[\"cucumber\"]\r\n prompt( \"Run Cucumber feature tests?\", true ) do\r\n tests = tests + @config[\"cucumber\"].map do |test|\r\n CucumberTest.new( @assignment, test, @config[\"exe\"] )\r\n end\r\n end\r\n end\r\n\r\n # These tests use PyUnit at a feature level\r\n if @config[\"pyunit\"]\r\n prompt( \"Run PyUnit tests?\", true ) do\r\n tests = tests + @config[\"pyunit\"].map do |test|\r\n PyUnitTest.new( @assignment, test )\r\n end\r\n end\r\n end\r\n\r\n # These tests use PyUnit at a feature level\r\n if @config[\"rubytestunit\"]\r\n prompt( \"Run Ruby Test::Unit tests?\", true ) do\r\n tests = tests + @config[\"rubytestunit\"].map do |test|\r\n RubyUnitTest.new( @assignment, test )\r\n end\r\n end\r\n end\r\n\r\n # These tests use PyUnit at a feature level\r\n if @config[\"tree\"]\r\n prompt( \"View source tree?\", true ) do\r\n tests = tests + @config[\"tree\"].map do |test|\r\n TreeTest.new( @assignment, test )\r\n end\r\n end\r\n end\r\n\r\n tests\r\n end",
"title": ""
},
{
"docid": "c52e7f53426a5936d032711491945d4f",
"score": "0.6395303",
"text": "def run_test(tests, primes_to_test, composites_to_test, current_test_name)\n require \"./primality_tests/\" + current_test_name + \".rb\"\n tests[current_test_name.to_sym][:result] = []\n tests[current_test_name.to_sym][:prime_pass?] = true\n tests[current_test_name.to_sym][:composite_pass?] = true\n primes_to_test.each {|i|\n result = send(current_test_name, i)\n tests[current_test_name.to_sym][:result] << result\n tests[current_test_name.to_sym][:prime_pass?] = false unless result\n }\n composites_to_test.each {|i|\n result = send(current_test_name, i)\n tests[current_test_name.to_sym][:result] << result\n tests[current_test_name.to_sym][:composite_pass?] = false if result\n }\nend",
"title": ""
},
{
"docid": "31af79b9c5e648e754d8dc04417bd9a7",
"score": "0.6387327",
"text": "def before_suites\n @before_all.call unless @before_all.nil?\n end",
"title": ""
},
{
"docid": "c1d674d4ba72bf42464f7b43ab7a5ec7",
"score": "0.63831043",
"text": "def smoke_test ()\n smoke_test = [\n \"case_001\",\n \"case_002\"\n ]\n return smoke_test\n end",
"title": ""
},
{
"docid": "9d904792abfd800fd078b71f1e94435d",
"score": "0.6382048",
"text": "def with_test_scaffold\n print \"testing #{name} . . . \"\n\n @passed = yield\n @has_run = true\n\n if passed?\n print 'passed'\n else\n print 'failed'\n end\n puts\n end",
"title": ""
},
{
"docid": "743789d6c34ab5ebfff5da767a5c4e8d",
"score": "0.6379222",
"text": "def run_all\n receive_results do\n log \"Run all tests\"\n test_files = load_test_files([\"test\"])\n\n reset_db_connection_post_fork\n test_runner = ::Nestor::Mappers::Rails::Test::TestRunner.new(nil)\n result = ::Test::Unit::AutoRunner.run(false, nil, []) do |autorunner|\n autorunner.runner = lambda { test_runner }\n end\n\n # Returns a Hash which the parent process will retrieve\n report(test_runner, test_files)\n end\n end",
"title": ""
},
{
"docid": "70ff2da1f74d1f51d06a3f1890e7e7fe",
"score": "0.6372814",
"text": "def all(expected); end",
"title": ""
},
{
"docid": "dbff941c6aece17c5183865503df3e90",
"score": "0.6371379",
"text": "def run_tests_for_dir(path, subfolder_depth)\n Dir.foreach path do |filename|\n if filename.match(/.*\\.rb/)\n out = \"\"\n err = \"\"\n str = \" TEST: #{filename}\"\n subfolder_depth.times do ||\n str.insert 0, \" \"\n end\n puts str\n \n\n out = `ruby #{path}#{filename} 2>&1`\n \n\n # TODO: what we need to do here is look through \"out\" with a regular expression to find out\n # the results of the test.\n # below is how we do it when compiling Xcode projects\n \n out.match(/.*Number of failed assertions: (.*).*/)\n \n if $1 == \"0\" # This means there are zero failed assertions\n @cur_count+=1\n log_test_pass \"*****************************************\"\n log_test_pass \"#{filename}\"\n log_test_pass \"*****************************************\"\n log_test_pass(out)\n # puts \"#{filename}: TEST PASSED\"\n puts \" TEST PASSED\"\n# # log_test(out)\n# # return 1\n else\n log_test_fail \"*****************************************\"\n log_test_fail \"#{filename}\"\n log_test_fail \"*****************************************\"\n log_test_fail(out) \n @fail_array.push(\"#{path}/#{filename}\")\n #puts \"#{filename}: TEST FAILED **************************************\"\n puts \" TEST FAILED **************************************\"\n# # log_test(out)\n# # log_error(err)\n end\n\n puts\n\n\n # elsif Dir.exist?(\"#{path}#{filename}\") && filename.match(/\\..*/) == nil\n elsif File.exists?(\"#{path}#{filename}\") && File.directory?(\"#{path}#{filename}\") && filename.match(/\\..*/) == nil\n str = \" FOLDER: #{path}#{filename}\"\n subfolder_depth.times do ||\n str.insert 0, \" \"\n end\n #puts str\n \n run_tests_for_dir \"#{path}#{filename}/\", 1+subfolder_depth\n end\n end\n\n ex_total, ex_count = get_count\n\nend",
"title": ""
},
{
"docid": "356d0aacb156dcbeb05679dea6848176",
"score": "0.63555026",
"text": "def run!\n time = Time.now\n yield\n time = ((Time.now-time)*1000).round\n \n print \"\\n ---\\n\"\n \n if @@error_count == 0\n green \"All #{@@test_count} tests finished in #{time} ms with no errors\"\n else\n red \"All #{@@test_count} tests finished in #{time} ms with #{@@error_count} errors\"\n end\n end",
"title": ""
},
{
"docid": "a001890b467ceff52d08c8a30672ff0c",
"score": "0.6349899",
"text": "def test(context)\n\t\t\t\t\t#\tfind the first failing test closure\n\t\t\t\t\t#\t\tit'd be nil if they all pass\n\t\t\t\t\tfailed = self.class.conditional_tests.find do |block|\n\t\t\t\t\t\t#\tfirst failure stops us\n\t\t\t\t\t\t(! (block.arity == 1 ? block.call(self) : block.call(self, context)))\n\t\t\t\t\tend\n\n\t\t\t\t\tfailed.nil?\n\t\t\t\tend",
"title": ""
},
{
"docid": "a500b345000521051ba63cbb47ca0b91",
"score": "0.6346521",
"text": "def tests_failed?\n return nil\n end",
"title": ""
},
{
"docid": "e319cc704698b8a7c4b5bc4b75585046",
"score": "0.6343057",
"text": "def testing_begin(files)\n end",
"title": ""
},
{
"docid": "1a74dde888cf9ccfb8d0bdf834a7bff6",
"score": "0.6341505",
"text": "def run\n Hash[\n @tests.map do |test|\n [test, test.run]\n end\n ]\n end",
"title": ""
},
{
"docid": "f7c0632309584cbf42a30ac6ce085d3a",
"score": "0.6340441",
"text": "def collect_tests\n # get local tests and get run list of profiles\n (local_suite_files + resolve_config_inspec_tests).compact.uniq\n end",
"title": ""
},
{
"docid": "79350fbbb93ea63d0ead748494435087",
"score": "0.6339531",
"text": "def continuous_successful_tests(number)\n count = 0\n successful = false\n self.learning_tests.each do |test|\n if test.is_successful_test?\n count = count + 1\n if count >= number\n successful = true\n end\n else\n count = 0\n end\n end\n successful\n end",
"title": ""
},
{
"docid": "79350fbbb93ea63d0ead748494435087",
"score": "0.6339531",
"text": "def continuous_successful_tests(number)\n count = 0\n successful = false\n self.learning_tests.each do |test|\n if test.is_successful_test?\n count = count + 1\n if count >= number\n successful = true\n end\n else\n count = 0\n end\n end\n successful\n end",
"title": ""
},
{
"docid": "f2672d22e3ca3520332cfd6332d2ba30",
"score": "0.63387984",
"text": "def test_case_finished; end",
"title": ""
},
{
"docid": "e541fff3b2cc0b1ecdc1227fedcc5905",
"score": "0.6333254",
"text": "def testBakery ()\n\tis_passed = true\n\tpassed = 0\n\terror = 0\n\tTEST_DATA.each do |test|\n\n\t\tr= results(test[:total],test[:packs])\n\t\tis_passed = (r==test[:numpacks]) && is_passed\n\t\tif !is_passed\n\t\t\terror+=1\n\t\t\tputs\n\t\t\tputs \"--- Error on Loop Bakery ---\"\n\t\t\tprint \"Passed: #{is_passed} - Expected: #{test} - ErrorOutput: #{r}\"\n\t\t\tputs\n\t\telse\n\t\t\tpassed+=1\n\t\tend\n\tend\n\tt=TEST_DATA.count\n puts \"--- Test result for Loop Bakery ---\"\n\tputs \"Passed: #{passed}/#{t} Error: #{error}/#{t}\"\n\treturn is_passed\nend",
"title": ""
},
{
"docid": "e0d07478878e26400961f9dd6b581ea2",
"score": "0.632165",
"text": "def runAllTests\r\n\t\tif @successfulLogin\r\n\t\t\tbegin\r\n\t\t\t\tallClasses = query(\"SELECT Id FROM ApexClass\")\r\n\t\t\t\ttoQueue = Array.new\r\n\t\t\t\tallClasses.each {\r\n\t\t\t\t\t|aClass|\r\n\t\t\t\t\ttoQueue << aClass.Id\r\n\t\t\t\t}\r\n\t\t\t\t\r\n\t\t\t\treturn queueUnitTests(toQueue)\r\n\t\t\trescue Exception => exception\r\n\t\t\t\tlogException('runAllTests()', exception.message, exception.backtrace)\r\n\t\t\t\traise\t\r\n\t\t\tend\t\t\t\t\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "e522f01507e09d3b19400eed61200ee5",
"score": "0.63188905",
"text": "def buildTests() \n @runner.build()\n end",
"title": ""
},
{
"docid": "598348d41710d29e8ed16f377862364e",
"score": "0.63177216",
"text": "def test(severity, txt)\n @tests << {severity => txt}\n unless severity == :I or severity == :W\n @fails += 1\n if $FAIL_FAST\n puts txt\n caller.each {|c| puts c}\n exit!\n end\n end\nend",
"title": ""
},
{
"docid": "dc2a21bd081b4c0294c6297492f066cc",
"score": "0.63083965",
"text": "def test_cases\n {}\n end",
"title": ""
},
{
"docid": "884d62b9acdf5e926f22e171a056dbcf",
"score": "0.6305766",
"text": "def failures\n all_tests.select(&:failed?)\n end",
"title": ""
}
] |
5e9eed428cbfef3d767fb0454ae51d18
|
Inserts the specified record in the specified +database+ (either :left or :right). +table+ is the name of the target table. +values+ is a hash of column_name => value pairs.
|
[
{
"docid": "2a943bb6b259ddefe427b016fe0c15c0",
"score": "0.7915203",
"text": "def insert_record(database, table, values)\n connections[database].insert_record(table, values)\n end",
"title": ""
}
] |
[
{
"docid": "8ac787357158511c21e8029e626389b9",
"score": "0.70809025",
"text": "def insert_row(table_name, values)\n @database[table_name].insert(values)\n end",
"title": ""
},
{
"docid": "d1d94db3ae62b752ea7fbc1a5dc12162",
"score": "0.69683987",
"text": "def insert(table, columns, values)\n puts \"attempting to insert values into #{table}...\"\n begin\n nvalues = []\n values.each do |v|\n if v.is_a? String\n nvalues << \"\\\"\" + v + \"\\\"\" \n else\n nvalues << v\n end\n end\n tt = @dbr.prepare(\"INSERT INTO #{table}(\" + columns.join(\", \") + \") VALUES(\" + nvalues.join(\", \") + \");\")\n ee = tt.execute\n puts \"values correctly added!\".green\n rescue\n puts \"error while inserting values\".red\n end\n end",
"title": ""
},
{
"docid": "6e7ad70fc5ddcf761948da621615c17f",
"score": "0.6802821",
"text": "def insert table, value_map\n\t\tcolumn_string, value_string = \"\", \"\"\n\t\tvalue_map.each do |key, value|\n\t\t\tcolumn_string += key.to_s + \", \"\n\t\t\tvalue_string += '\"' + value.to_s + '\", '\n\t\tend\n\t\tcolumn_string = column_string[0..(column_string.length - 3)] # Lose trailing ','\n\t\tvalue_string = value_string[0..(value_string.length - 3)] \n\t\t\n\t\tstatement = \"INSERT INTO \" + table.strip\n\t\tstatement += \" (\" + column_string.to_s.strip + \")\"\n\t\tstatement += \" VALUES (\" + value_string.to_s.strip + \")\"\n\t\tbegin \n\t\t\t@db.execute statement\n\t\trescue => e # Eat exception so later queries are executed\n\t\t\tputs \"Failing SQL Statement: \" + statement\n\t\t\tputs e\n\t\tend\n\tend",
"title": ""
},
{
"docid": "6de8b7302a65b9c9bc82b3e8eb3ea368",
"score": "0.6755077",
"text": "def insert(*values)\n execute_insert(insert_sql(*values))\n end",
"title": ""
},
{
"docid": "a5c246ebf5db5b5ab98af163306e5a1d",
"score": "0.66917664",
"text": "def insert (table, values, rollback)\n if rollback == false\n @oci.exec(\"INSERT INTO #{table} VALUES(#{values[0]})\")\n @oci.commit\n else\n @oci.exec(\"INSERT INTO #{table} VALUES(#{values[0]})\")\n end\n end",
"title": ""
},
{
"docid": "69e649df862b18cc59b0395d6d70b768",
"score": "0.6603438",
"text": "def insert(table, *values)\n\t\targs = []\n\t\targs << table_columns('nonid', table) << values.flatten\n\t\tstringmaker_create_porject_db :insert, 'notes_and_flashcards', table, args\n\tend",
"title": ""
},
{
"docid": "eb7cb39954f32082641bcbb78c538b17",
"score": "0.6574277",
"text": "def insert(*values)\n if !@opts[:sql]\n clone(default_server_opts(:sql=>insert_returning_pk_sql(*values))).single_value\n else\n execute_insert(insert_sql(*values), :table=>opts[:from].first,\n :values=>values.size == 1 ? values.first : values)\n end\n end",
"title": ""
},
{
"docid": "c36dc804c7e85f6a0d6a07b1f58e8abb",
"score": "0.64241713",
"text": "def insert(table, values_hash, options = nil)\n columns = []\n values = []\n values_hash.each do |column, value|\n unless value.nil?\n columns << column\n values << value\n end\n end\n cql = \"INSERT INTO #{table} (#{columns.join(\", \")}) VALUES (#{question_marks(columns.size)})\"\n\n if options&.include?(:ttl)\n options = options.dup\n ttl = options.delete(:ttl)\n if ttl\n cql += \" USING TTL ?\"\n values << Integer(ttl)\n end\n end\n\n batch_or_execute(cql, values, options)\n end",
"title": ""
},
{
"docid": "a3e4d30e431ffa2b0bb14632c75a8420",
"score": "0.6410378",
"text": "def insert(table:, column_list:, values_list:)\n <<~SQL\n INSERT INTO #{table} (#{column_list.join(', ')}) VALUES\n #{values_list.map { |values| \" (#{values.map(&:to_sql).join(',')})\" }.join(\",#{$/}\")}\n SQL\n end",
"title": ""
},
{
"docid": "175f97121f0a35ed69b18af44a98e069",
"score": "0.63484436",
"text": "def insert_many(table,query,values=[])\n klass = @db.const_get(table.to_s.singularize.camelize)\n klass.transaction do \n values.each do |v|\n sql = @db.send(:sanitize_sql_array,[query]+v)\n @db.connection.execute(sql)\n end\n end\n end",
"title": ""
},
{
"docid": "b6c7032e170d12c47e735ef6dcbc9ff9",
"score": "0.63302827",
"text": "def insert(table_name, value_hash)\n raise \"Attempt to insert 0 values into table #{table_name}\" if value_hash.length == 0\n\n escaped_values = [] \n escaped_keys = []\n value_hash.each{|k, v| \n escaped_values << ((v.is_a? String) ? escape(v) : v.to_s)\n escaped_keys << \"`#{k}`\"\n }\n\n return execute(\"insert into `#{table_name}` (#{escaped_keys.join(\",\")}) values (#{escaped_values.join(\",\")});\")\n end",
"title": ""
},
{
"docid": "4726587d0566bf646f8d07c6573dfe4e",
"score": "0.6327683",
"text": "def newRow(table, columns, values)\n values = values.join(\"','\") \n @conn.exec(\"INSERT INTO #{table}(#{columns}) VALUES ('#{values}')\")\n\n end",
"title": ""
},
{
"docid": "241ac174b8694ecc29ad60e51b70c80b",
"score": "0.6311005",
"text": "def insert_multi(table, keys, values)\n if values.empty?\n nil\n else\n sql_query = \"INSERT INTO `#{database_name}`.`#{table}`\"\n sql_query << \" (\" + keys.map { |k| \"`#{k}`\" }.join(', ') + \")\"\n sql_query << \" VALUES \"\n sql_query << values.map { |v| \"(\" + v.map { |v| escape(v) }.join(', ') + \")\" }.join(', ')\n query(sql_query)\n end\n end",
"title": ""
},
{
"docid": "2a20c7cb44b5f7d88d02f0df22223f39",
"score": "0.627614",
"text": "def insert(*values)\n # @db.synchronize do\n # @db.execute(insert_sql(*values)).last_insert_id\n # end\n raise NotImplementedError, NOTIMPL_MSG\n end",
"title": ""
},
{
"docid": "b6ee557f1e69ce9c64fd9f2f01f3953e",
"score": "0.62551314",
"text": "def insert_record(table, values)\n sweeper.ping\n result = super\n sweeper.ping\n result\n end",
"title": ""
},
{
"docid": "4f5ad9e7aa3c5c02ccb43147cb56590b",
"score": "0.6189623",
"text": "def insert_many(table, columns, values)\n values = values.compact.uniq.map do |list|\n list.map {|e| quote(e)}\n end\n\n columns = columns.map {|e| connection.quote_column_name(e)}.join(',')\n\n case adapter\n when 'sqlite3'\n pre_query = \"INSERT INTO #{table} (#{columns}) VALUES \"\n values.each do |v|\n execute pre_query + \"(#{v.join(',')})\"\n end\n else\n values = values.map {|v| \"(#{v.join(',')})\"}.join(', ')\n execute \"INSERT INTO #{table} (#{columns}) VALUES #{values}\"\n end\n end",
"title": ""
},
{
"docid": "4620cc12b3f33c4c69725ba16e417ea1",
"score": "0.6175919",
"text": "def insert(values)\n status = values.class == Array\n msg = \"Error: insert() must receive a string(s) of array as argument.\\n\"\n msg += \"User provided #{values.class}\"\n @assert.default_error_check(status, msg, @dbh)\n @insert = {\n :table_name => \"\",\n :values => values\n }\n self\n end",
"title": ""
},
{
"docid": "7769c66d423736c132c50cb8ad49bed5",
"score": "0.61452484",
"text": "def insert(table, hash)\n\t\tkeys = \"\"\n\t\tvalues = []\n\t\tq = \"\"\n\t\thash.each do |k,v|\n\t\t\tkeys << \"#{k},\"\n\t\t\tvalues << v\n\t\t\tq << \"?,\"\n\t\tend\n\t\tkeys.chomp!(\",\")\n\t\tq.chomp!(\",\")\n\t\tbegin\n\t\t\tquery = @db.prepare \"INSERT INTO #{table} (#{keys}) VALUES (#{q})\"\n\t\t\tquery.bind_params(values)\n\t\t\tquery.execute\n\t\trescue SQLite3::Exception => e\n\t\t\tputs \"Exception occurred\"\n\t\t\tputs e\n\t\t\tputs \"INSERT INTO #{table} (#{keys}) VALUES (#{q})\"\n\t\tensure\n\t\t\tquery.close if query\n\t\tend\n\tend",
"title": ""
},
{
"docid": "c487f10218329e5abe34c2c512b3f241",
"score": "0.61425984",
"text": "def add(table, columns, values)\n @query += \"INSERT INTO #{table} (\"\n columns.each do |column|\n @query += \"#{column},\"\n end\n @query[@query.length-1] = ''\n @query += ') VALUES(' + '?,' * columns.length\n @query[@query.length-1] = ''\n @query += ') '\n values.each do |values|\n @values << values\n end\n return self\n end",
"title": ""
},
{
"docid": "cdf26a049abac4393005216ffaee6da3",
"score": "0.61125064",
"text": "def insert(table, elements, values, database_path='database/db.db')\n #Connects to Database\n db = connect_to_db(database_path)\n #Checks if values is the same length as elements\n if values.length != elements.length\n session[:error_msg] = \"SQL Error\"\n return nil\n end\n #Creates a string of ? to match the length of the values\n question_str = ''\n num = values.length\n num.times {question_str += '?,'}\n question_str[-1] = ')'\n #Creates String of elements\n elements_str = arr_to_str(elements)\n #Cases for different table types\n case table\n when 'users'\n #Creates SQL String to execute\n sql_str = 'INSERT INTO users ' + elements_str + ' VALUES (' + question_str\n #Executes SQL String with the respective values\n db.execute(sql_str, values) \n when 'posts'\n #Creates SQL String to execute\n sql_str = 'INSERT INTO posts ' + elements_str + ' VALUES (' + question_str\n #Executes SQL String with the respective values\n db.execute(sql_str, values)\n when 'comments'\n #Creates SQL String to execute\n sql_str = 'INSERT INTO comments ' + elements_str + ' VALUES (' + question_str\n #Executes SQL String with the respective values\n db.execute(sql_str, values) \n when 'genre'\n #Creates SQL String to execute\n sql_str = 'INSERT INTO genre ' + elements_str + ' VALUES (' + question_str\n #Executes SQL String with the respective values\n db.execute(sql_str, values) \n else \n return {'msg' => \"SQL Error\"}\n end\n end",
"title": ""
},
{
"docid": "e59898850a3799f4b5e50b2781f75256",
"score": "0.6109946",
"text": "def insert_record(database, table, values)\n exclude_rr_activity database, table\n super\n end",
"title": ""
},
{
"docid": "31ab965732d234f2cfaa0ff72094658b",
"score": "0.60998017",
"text": "def append (table, values)\n @oci.exec(\"INSERT /*+ append */ INTO #{table} VALUES(#{values[0]})\")\n @oci.commit\n end",
"title": ""
},
{
"docid": "993b1996ba3292986d42898e292a30d6",
"score": "0.6014033",
"text": "def insert_sql(*values)\n if values.empty?\n insert_default_values_sql\n else\n values = values[0] if values.size == 1\n \n # if hash or array with keys we need to transform the values\n if @transform && (values.is_a?(Hash) || (values.is_a?(Array) && values.keys))\n values = transform_save(values)\n end\n\n case values\n when Array\n if values.empty?\n insert_default_values_sql\n else\n \"INSERT INTO #{@opts[:from]} VALUES (#{literal(values)})\"\n end\n when Hash\n if values.empty?\n insert_default_values_sql\n else\n fl, vl = [], []\n values.each {|k, v| fl << literal(k.is_a?(String) ? k.to_sym : k); vl << literal(v)}\n \"INSERT INTO #{@opts[:from]} (#{fl.join(COMMA_SEPARATOR)}) VALUES (#{vl.join(COMMA_SEPARATOR)})\"\n end\n when Dataset\n \"INSERT INTO #{@opts[:from]} #{literal(values)}\"\n else\n if values.respond_to?(:values)\n insert_sql(values.values)\n else\n \"INSERT INTO #{@opts[:from]} VALUES (#{literal(values)})\"\n end\n end\n end\n end",
"title": ""
},
{
"docid": "184b2753e8a67c3ddd11c0977e676547",
"score": "0.59801173",
"text": "def add_to_db\n db = SQLite3::Database.open('db/db.sqlite')\n str = \"INSERT INTO #{@table_name} (\"\n\n (@values.length - 2).times do |i|\n str += \"#{@values.keys[i + 1].to_s}, \"\n end\n str += \"#{@values.keys[-1].to_s}\"\n\n str += \") VALUES (\"\n (@values.length - 2).times do\n str += \"?, \"\n end\n str += \"?)\"\n\n to_be_inserted = @values.values\n to_be_inserted.delete_at(0)\n\n db.execute(str, to_be_inserted)\n end",
"title": ""
},
{
"docid": "4a2a285fde650143a280940aaf160f9e",
"score": "0.59370285",
"text": "def multi_insert_sql(columns, values)\n table = @opts[:from].first\n columns = literal(columns)\n values.map do |r|\n \"INSERT INTO #{table} (#{columns}) VALUES (#{literal(r)})\"\n end\n end",
"title": ""
},
{
"docid": "f3e0faaa64e3a23297eac1f4a18b2dbd",
"score": "0.5936918",
"text": "def set(key, values)\n unless exists?(key)\n table.insert(values.merge(table_name: key.to_s))\n end\n end",
"title": ""
},
{
"docid": "d81e783f973beaa059942df355ead765",
"score": "0.58937687",
"text": "def insert(table_name, params)\n pairs = params.to_a\n param_names = pairs.map(&:first)\n param_values = pairs.map(&:last)\n param_marks = Array.new(param_names.size, \"?\").join(\", \")\n\n insert_statement = \"INSERT INTO #{table_name} (#{param_names.join(\", \")}) VALUES (#{param_marks})\"\n\n @db.execute insert_statement, param_values\n end",
"title": ""
},
{
"docid": "24c10007bf18eba85816c739eb6c0647",
"score": "0.58729726",
"text": "def insert h\n sql = \"INSERT into #{@table_name} \"\n sql << \"(\" << h.keys.join(',') << \")\"\n sql << \" VALUES (\" << h.values.join(',') << \");\"\n ## TODO return value here ?\n @db.query(sql)\n end",
"title": ""
},
{
"docid": "d867e00938f0819353247f477c2449c4",
"score": "0.574705",
"text": "def sql_insert_statement(tbl = nil, values = {})\n return \"nope\" if tbl.nil?\n \"INSERT INTO #{tbl} (#{values.keys.sort.join(\",\")}) VALUES (#{values.keys.sort.collect{|k| sqlize(values[k])}.join(\",\")});\"\n end",
"title": ""
},
{
"docid": "23fffe0e23c4006844a3fa742dd4faa5",
"score": "0.574316",
"text": "def insert_into_table(db, query_string, *args)\r\n db.execute(query_string, args)\r\nend",
"title": ""
},
{
"docid": "825b09e98d57499e84b07f7c3945a185",
"score": "0.57380414",
"text": "def create(values)\n CQLModel::Query::InsertStatement.new(self).create(values)\n end",
"title": ""
},
{
"docid": "67bad875925611b4bd45fdf9adacd245",
"score": "0.57211375",
"text": "def insert_sql(*values)\n return static_sql(@opts[:sql]) if @opts[:sql]\n\n check_modification_allowed!\n\n columns = []\n\n case values.size\n when 0\n return insert_sql({})\n when 1\n case vals = values[0]\n when Hash\n values = []\n vals.each do |k,v| \n columns << k\n values << v\n end\n when Dataset, Array, LiteralString\n values = vals\n end\n when 2\n if (v0 = values[0]).is_a?(Array) && ((v1 = values[1]).is_a?(Array) || v1.is_a?(Dataset) || v1.is_a?(LiteralString))\n columns, values = v0, v1\n raise(Error, \"Different number of values and columns given to insert_sql\") if values.is_a?(Array) and columns.length != values.length\n end\n end\n\n if values.is_a?(Array) && values.empty? && !insert_supports_empty_values? \n columns, values = insert_empty_columns_values\n end\n clone(:columns=>columns, :values=>values).send(:_insert_sql)\n end",
"title": ""
},
{
"docid": "79084cffc874dd1ee9b6e675019c7a06",
"score": "0.5707509",
"text": "def insert_sql(*values)\n return static_sql(@opts[:sql]) if @opts[:sql]\n\n check_modification_allowed!\n\n columns = []\n\n case values.size\n when 0\n return insert_sql({})\n when 1\n case vals = values.at(0)\n when Hash\n vals = @opts[:defaults].merge(vals) if @opts[:defaults]\n vals = vals.merge(@opts[:overrides]) if @opts[:overrides]\n values = []\n vals.each do |k,v| \n columns << k\n values << v\n end\n when Dataset, Array, LiteralString\n values = vals\n else\n if vals.respond_to?(:values) && (v = vals.values).is_a?(Hash)\n return insert_sql(v) \n end\n end\n when 2\n if (v0 = values.at(0)).is_a?(Array) && ((v1 = values.at(1)).is_a?(Array) || v1.is_a?(Dataset) || v1.is_a?(LiteralString))\n columns, values = v0, v1\n raise(Error, \"Different number of values and columns given to insert_sql\") if values.is_a?(Array) and columns.length != values.length\n end\n end\n\n columns = columns.map{|k| literal(String === k ? k.to_sym : k)}\n clone(:columns=>columns, :values=>values)._insert_sql\n end",
"title": ""
},
{
"docid": "28f44d73deaf0dc70a5d3104a218da54",
"score": "0.56850684",
"text": "def insert_query(options)\n query = \"INSERT INTO #{options[:table]} (#{options[:columns]}) VALUES (#{options[:values]})\"\n @connection.query(query)\n end",
"title": ""
},
{
"docid": "56a03eb329b8e02c50ec45777f8f8785",
"score": "0.56724083",
"text": "def insert(table, attributes)\n sql_query = \"INSERT INTO `#{database_name}`.`#{table}`\"\n sql_query << \" (\" + attributes.keys.map { |k| \"`#{k}`\" }.join(', ') + \")\"\n sql_query << \" VALUES (\" + attributes.values.map { |v| escape(v) }.join(', ') + \")\"\n with_mysql do |mysql|\n query_on_connection(mysql, sql_query)\n mysql.last_id\n end\n end",
"title": ""
},
{
"docid": "55edbfb7f83697d89a7717df355ae965",
"score": "0.56548315",
"text": "def insert_values(*args)\n raise ArgumentError, \"no arguments given\" unless args.first\n # if first argument is array of symbols then use it as list of fields\n if args.first.all? { |a| a.instance_of?(Symbol) }\n fields = args.shift\n # otherwise use all columns as list of fields\n else\n fields = column_names\n end\n args.each do |record|\n raise ArgumentError, \"record should be Array of values\" unless record.is_a?(Array)\n raise ArgumentError, \"wrong number of column values\" unless record.size == fields.size\n insert(ArrayHelpers::to_hash(fields, record))\n end\n end",
"title": ""
},
{
"docid": "71ae6f4bc21517aec4b68a078c118eac",
"score": "0.5645393",
"text": "def insert(key,value)\t\r\n\t\t@table.store(key,value)\r\n\tend",
"title": ""
},
{
"docid": "a4eb6d88144e9266afe1a38fca55caff",
"score": "0.5626886",
"text": "def add(values_hash = {}) #values_hash = {}\n columns = values_hash.keys\n values = values_hash.values\n CONNECTION.execute(\"INSERT INTO #{tablename} (#{columns.join \", \"}) VALUES (#{values.to_s[1...-1]});\")\n\n id = CONNECTION.last_insert_row_id\n values_hash[\"id\"] = id\n \n self.new(values_hash)\n end",
"title": ""
},
{
"docid": "56a456998c2ceed46effbcae5ad67aac",
"score": "0.5596112",
"text": "def create_row(connection, table, row)\n sql = \"insert into #{table}(\"\n sql << row.keys.join(', ')\n sql << \") values('\"\n sql << row.values.join(\"', '\")\n sql << \"')\"\n connection.execute sql\nend",
"title": ""
},
{
"docid": "abd1d5c9017967944c3fa9411c561720",
"score": "0.5594951",
"text": "def table_insert_hash db, table, array # {{{\n $stderr.puts \"inside table_insert_hash \" if $opt_verbose\n array.each do |hash|\n str = \"INSERT OR IGNORE INTO #{table} (\"\n qstr = [] # question marks\n fields = [] # field names\n bind_vars = [] # values to insert\n hash.each_pair { |name, val|\n fields << name\n bind_vars << val\n qstr << \"?\"\n }\n fstr = fields.join(\",\")\n str << fstr\n str << \") values (\"\n str << qstr.join(\",\")\n str << \");\"\n $stderr.puts \"#{hash[\"id\"]}: #{hash[\"imdbid\"]} #{hash[\"title\"]} \" if $opt_verbose\n #puts \" #{hash[\"Title\"]} #{hash[\"imdbID\"]} \"\n db.execute(str, bind_vars)\n #rowid = @db.get_first_value( \"select last_insert_rowid();\")\n #return rowid\n end\nend",
"title": ""
},
{
"docid": "270061bd1c2eda17063e0e14270308ea",
"score": "0.55799705",
"text": "def create_new_records(db_connection: db_connection, table: table, column_names_and_values: column_names_and_values)\n ####\n col_names = column_names_and_values[0].join(\", \")\n (1..column_names_and_values.length - 1).each do |x|\n col_values = add_quotes_to_string(column_names_and_values[x].join(\"', '\"))\n db_connection.execute(\"INSERT INTO #{table} (#{col_names}) VALUES (#{col_values});\")\n end\n end",
"title": ""
},
{
"docid": "5b539b46e69a4b91cc02bfb9b98b48a1",
"score": "0.5556815",
"text": "def insert( record )\n record['id'] = (Time.now.to_f * 1000000).to_i unless record.has_key? 'id'\n @table.push record\n @actual_table.push record unless @table == @actual_table\n end",
"title": ""
},
{
"docid": "10378c9447bcb87ad7af13162bd05ffd",
"score": "0.5554337",
"text": "def multi_insert_sql(columns, values)\n values.map{|r| insert_sql(columns, r)}\n end",
"title": ""
},
{
"docid": "1d4a81f159b60eeb681b09114255b6b4",
"score": "0.5553713",
"text": "def replace(*values)\n execute_insert(replace_sql(*values))\n end",
"title": ""
},
{
"docid": "ea4d6ba4d04b807fc984802abf1da1bb",
"score": "0.55240697",
"text": "def _insert_values_sql(sql, values)\n super\n\n if values = @opts[:multi_insert_values]\n expression_list_append(sql, values.map{|r| Array(r)})\n end\n end",
"title": ""
},
{
"docid": "d395700e6d5e2ed53627256515df88b8",
"score": "0.55227035",
"text": "def table_insert_hash table, hash\n str = \"INSERT INTO #{table} (\"\n qstr = [] # question marks\n fields = [] # field names\n bind_vars = [] # values to insert\n hash.each_pair { |name, val| \n fields << name\n bind_vars << val\n qstr << \"?\"\n }\n fstr = fields.join(\",\")\n str << fstr\n str << \") values (\"\n str << qstr.join(\",\")\n str << \")\"\n #puts str\n # 2010-09-12 11:42 removed splat due to change in sqlite3 1.3.x\n @db.execute(str, bind_vars)\n rowid = @db.get_first_value( \"select last_insert_rowid();\")\n return rowid\n end",
"title": ""
},
{
"docid": "38619e808ba51b8a16ce16288277607a",
"score": "0.5514033",
"text": "def into(table_name)\n @insert[:table_name] = table_name\n query = @insert_hd.sqlite3_insert(@insert[:table_name], @insert[:values], @mem_db_col)\n @dbm.update_queries(query)\n end",
"title": ""
},
{
"docid": "46cec4610ab6c6b74b7c1884a7119303",
"score": "0.5500557",
"text": "def insert_case(table_name, case_values)\n statement = <<-END_SQL.gsub(/\\s+/, \" \").strip\n INSERT INTO #{table_name}(case_number, file_date, type_desc, subtype, case_title, status, judge, court_room, created_by)\n VALUES(#{case_values})\n END_SQL\n @client.query statement\n end",
"title": ""
},
{
"docid": "8ef5d852deea2a2c7ff4758c06a81d1f",
"score": "0.5463765",
"text": "def insert(transaction, table_name, record)\n if trace?\n trace(delegate.db[table_name].insert_sql(record)) \n end\n return super unless trace_only?\n record\n end",
"title": ""
},
{
"docid": "9ed2688703e74a429af19aaaecdb7c63",
"score": "0.5457545",
"text": "def update_row(table_name, values)\n @database[table_name].where(@database[table_name].columns.first => values.first).delete\n @database[table_name].insert(values)\n end",
"title": ""
},
{
"docid": "3cbd4f21e9408dcdb66b365ebc57229a",
"score": "0.54500526",
"text": "def sql_insert(fldsValues)\n raise ArgumentError, \"Needs a field:value hash\" if fldsValues.nil? || fldsValues.empty?\n\n flds, vals = parse_fldsvalues(fldsValues)\n ph = Array(placeholder).flatten * flds.count\n\n sql = %Q|insert into #{quoted_table}\n ( #{flds.join ','} )\n values( #{ph.join ','} )\n returning #{quote_field id_fld};| \n\n [sql, vals]\n end",
"title": ""
},
{
"docid": "d6b7668cf8caa0c9a07dd3b49296f220",
"score": "0.543695",
"text": "def execute_insert(sql, opts=OPTS)\n opts = Hash[opts]\n if f = @opts[:from]\n opts[:table] = f.first\n end\n opts[:sequence] = @opts[:sequence]\n super\n end",
"title": ""
},
{
"docid": "330463c807e563f2341ad2e92a08132d",
"score": "0.54261756",
"text": "def insert_unless_exist(table, values)\n table = connection.quote_table_name table\n if execute_sanitized([\"SELECT COUNT(*) FROM #{table} WHERE #{vaues.firsts.map {|v| \"#{connection.quote_column_name v}=?\"}*' AND '} LIMIT 1\", *values.lasts]).to_a.flatten > 0\n false\n else\n execute_sanitized [\"INSERT INTO #{table} VALUES (#{['?']*values.size*','})\", *values.lasts]\n true\n end\n end",
"title": ""
},
{
"docid": "4c65ca97884c09cd7ea003c77320cf61",
"score": "0.5425695",
"text": "def insert!(args)\n args = process_incoming_data(args)\n pp args\n if has_primary_key?\n unless args.include? @primary_key\n # If our table has a primary key, but can't find it in the data\n raise ArgumentError, 'Missing primary key in record to be inserted'\n end\n val = args[@primary_key]\n if @pk_map.has_key?(val)\n raise RuntimeError, \"Primary key #{val.inspect} already exists in table\"\n end\n @pk_map[val] = @table.size\n end\n row = Row.new(self, @table.size, args)\n @table << row\n row\n end",
"title": ""
},
{
"docid": "6db1de59d8ca488d44c0db6d29d7a023",
"score": "0.541635",
"text": "def insert_returning_pk_sql(*values)\n pk = db.primary_key(opts[:from].first)\n insert_returning_sql(pk ? Sequel::SQL::Identifier.new(pk) : NULL, *values)\n end",
"title": ""
},
{
"docid": "a78631d0d66c55df20a47164c1149866",
"score": "0.53973854",
"text": "def to\n query = \"INSERT INTO #{@table} (#{@dataframe.vectors.to_a.join(',')}\"\\\n \") VALUES (#{(['?']*@dataframe.vectors.size).join(',')})\"\n sth = @dbh.prepare(query)\n @dataframe.each_row { |c| sth.execute(*c.to_a) }\n true\n end",
"title": ""
},
{
"docid": "6e7162b434daec290eb9b8a32a10d64a",
"score": "0.5395936",
"text": "def _import(columns, values, opts)\n trans_opts = Hash[opts].merge!(:server=>@opts[:server])\n if opts[:return] == :primary_key\n @db.transaction(trans_opts){values.map{|v| insert(columns, v)}}\n else\n stmts = multi_insert_sql(columns, values)\n @db.transaction(trans_opts){stmts.each{|st| execute_dui(st)}}\n end\n end",
"title": ""
},
{
"docid": "3f121500a0e46f05bcb6dff7e47df59e",
"score": "0.53843796",
"text": "def insert(tuple)\n binds = tuple.to_a.map { |a| [ relation[a.first], a.last ] }\n stmt = relation.create_insert\n\n stmt.into(relation)\n stmt.insert(binds)\n\n connection.insert(stmt, 'SQL')\n end",
"title": ""
},
{
"docid": "b62d75c9613021d43601af316873a83d",
"score": "0.53819525",
"text": "def insert(ds, dbh, table)\n raise NoMethodError, \"Deprecated. Use Daru::DataFrame#write_sql instead.\"\n end",
"title": ""
},
{
"docid": "1af7b44dd2552352ee80662d2d3fc26e",
"score": "0.5380531",
"text": "def insert(*values)\n return super if @opts[:sql] || @opts[:returning]\n with_sql(\"SET NOCOUNT ON; #{insert_sql(*values)}; SELECT CAST(SCOPE_IDENTITY() AS INTEGER)\").single_value\n end",
"title": ""
},
{
"docid": "9b560cfc30af352a7aab17056bc4b2de",
"score": "0.53768694",
"text": "def insert data_hash = {}\n sql, *binds = SQLHelper.insert :table => name,\n :data => @query_default.merge(data_hash),\n :prepared => true\n pstmt = prepare :insert, sql\n pstmt.send @update_method, *binds\n end",
"title": ""
},
{
"docid": "19ed3eb6ffbd24333025ae4430fded61",
"score": "0.5360866",
"text": "def add_to_database(options={})\n \n column_names = options.keys\n values = options.values\n \n column_names_for_sql = column_names.join(\", \")\n \n individual_values_for_sql = []\n \n values.each do |value|\n if value.is_a?(String)\n individual_values_for_sql << \"'#{value}'\"\n else \n individual_values_for_sql << value\n end \n end\n \n values_for_sql = individual_values_for_sql.join(\", \")\n \n DATABASE.execute(\"INSERT INTO #{table_name} (#{column_names_for_sql}) VALUES (#{values_for_sql});\")\n \n id = DATABASE.last_insert_row_id\n options[\"id\"] = id\n \n self.new(options)\n end",
"title": ""
},
{
"docid": "8fc2d60c2bf437ed612d9f81d84a3597",
"score": "0.53416574",
"text": "def create(table, values)\n data_set = []\n values.each{ |data| \n data = data.join(\" \") \n data_set.push(data)\n }\n data_set = data_set.join(\", \")\n @oci.exec(\"CREATE TABLE #{table} (#{data_set})\")\n @oci.commit\n end",
"title": ""
},
{
"docid": "b70d67897815ea5839541c6a926ceb0a",
"score": "0.53329444",
"text": "def replace_sql(*values)\n clone(:replace=>true).insert_sql(*values)\n end",
"title": ""
},
{
"docid": "8ff754a49adb02a34083b2a6fb08949d",
"score": "0.53269786",
"text": "def insert\n col_names = attributes.keys.join(\", \")\n vals = attribute_values\n n = vals.count\n question_marks = \"(#{([\"?\"] * n).join(\", \")})\"\n table = self.class.table_name\n insert_into = \"#{table} (#{col_names})\"\n query = @@db.execute(<<-SQL, *vals)\n INSERT INTO\n #{insert_into}\n VALUES\n #{question_marks}\n SQL\n self.id = @@db.instance.last_insert_row_id\n end",
"title": ""
},
{
"docid": "95a5a25c2f52323ebff95c193991d21c",
"score": "0.53251046",
"text": "def insert_in_db_user(table, column, content)\n $db.execute(\"\n INSERT INTO #{table} (#{column}) \n VALUES (?, ?, ?, ?, ?)\", content )\nend",
"title": ""
},
{
"docid": "f129a496627c375457c0374429cdea17",
"score": "0.53237474",
"text": "def insert_multiple h\n sql = \"INSERT into #{@table_name} \"\n if h[:fields].is_a?(Array)\n sql << \"(\" << h[:fields].join(',') << \")\"\n sql << \" VALUES \" << h[:values].map{|v| \"(\" + v.map{ |vv| \"'#{vv}'\" }.join(',') + \")\" }.join(',') << \";\"\n # only one field\n else \n sql << \"(\" << h[:fields] << \")\"\n sql << \" VALUES \" << h[:values].map{|v| \"('\"+v.to_s + \"')\"}.join(',') << \";\"\n end\n @db.query(sql)\n end",
"title": ""
},
{
"docid": "4bcd57597e7337676affd973ccda4631",
"score": "0.531939",
"text": "def insert(record)\n if !record.kind_of?(Dupe::Database::Record) || !record.__model__ || !record[:id]\n raise ArgumentError, \"You may only insert well-defined Dupe::Database::Record objects\" \n end\n @tables[record.__model__.name] ||= []\n @tables[record.__model__.name] << record\n record.__model__.run_after_create_callbacks(record)\n end",
"title": ""
},
{
"docid": "bdc832cf77fc220a2a6bdf2fab72de2d",
"score": "0.52965987",
"text": "def insertQuery(row)\n\t\theads = []\n\t\tvals = []\n\t\trow.each do |k,v|\n\t\t\theads.push(k)\n\t\t\tvals.push(v)\n\t\tend\n\t\theads = heads.join(\", \")\n\t\tvals = vals.join(\"', '\")\n\t\treturn \"(\" + heads + \") VALUES ('\" + vals +\"')\"\n\tend",
"title": ""
},
{
"docid": "ba87039155b69d8369fe6731666406ff",
"score": "0.5293477",
"text": "def insert\n table = self.class.table_name\n column_names = self.class.columns.join(\", \")\n num_fields = self.class.columns.length\n fields = ([\"?\"] * num_fields).join(\", \")\n\n result = DBConnection.execute(<<-SQL, attribute_values)\n INSERT INTO\n #{table} (#{column_names})\n VALUES\n (#{fields})\n SQL\n\n self.id = DBConnection.last_insert_row_id\n end",
"title": ""
},
{
"docid": "d0ae5869e7c6a26da5593046ac5210b4",
"score": "0.52713615",
"text": "def insert_select(*values)\n naked.clone(default_server_opts(:sql=>insert_returning_sql(nil, *values))).single_record\n end",
"title": ""
},
{
"docid": "be1822fdfd47794d5f1115c8f8ff5750",
"score": "0.5251156",
"text": "def join(table, hash)\n sql = <<-EOF\n INSERT INTO #{table}\n (#{hash.keys.join(\",\")})\n VALUES\n (#{quote(hash.values).join(\",\")});\n EOF\n sql.gsub!(/^\\s{6}/, '')\n execute(sql)\n end",
"title": ""
},
{
"docid": "0c148341657ff8309bbdb4b399aa6b4d",
"score": "0.5232269",
"text": "def insert_value\n\t\tsql = \"insert into Value values (?, ?)\"\n\t\treturn sql\n\tend",
"title": ""
},
{
"docid": "022273106b17f66d6b625531fa9a2563",
"score": "0.5221813",
"text": "def multi_insert_sql(columns, values)\n case multi_insert_sql_strategy\n when :values\n sql = LiteralString.new('VALUES ')\n expression_list_append(sql, values.map{|r| Array(r)})\n [insert_sql(columns, sql)]\n when :union\n c = false\n sql = LiteralString.new\n u = ' UNION ALL SELECT '\n f = empty_from_sql\n values.each do |v|\n if c\n sql << u\n else\n sql << 'SELECT '\n c = true\n end\n expression_list_append(sql, v)\n sql << f if f\n end\n [insert_sql(columns, sql)]\n else\n values.map{|r| insert_sql(columns, r)}\n end\n end",
"title": ""
},
{
"docid": "028873f41cd2bc60babd0170c4481b9a",
"score": "0.5218346",
"text": "def table_insert_hash db, table, array\n #$stderr.puts \"inside table_insert_hash \"\n array.each do |hash|\n #str = \"INSERT OR IGNORE INTO #{table} (\"\n str = \"UPDATE #{table} SET \"\n qstr = [] # question marks\n bind_vars = [] # values to insert\n imdbid = hash.delete \"imdbID\"\n hash.each_pair { |name, val| \n bind_vars << val\n qstr << \" #{name}=? \"\n }\n #str << fstr\n #str << \") values (\"\n str << qstr.join(\",\")\n str << %Q[ WHERE imdbID = '#{imdbid}' ]\n str << \";\"\n $stderr.puts \"#{hash[\"imdbID\"]} #{hash[\"Title\"]} \"\n #puts \" #{hash[\"Title\"]} #{hash[\"imdbID\"]} \"\n db.execute(str, bind_vars)\n #rowid = @db.get_first_value( \"select last_insert_rowid();\")\n #return rowid\n end\nend",
"title": ""
},
{
"docid": "5f6051439892d96ae142ff16c592978f",
"score": "0.52087355",
"text": "def insert(record)\n return if @doc.read_only\n manager = @arel.insert_manager\n columns = record.keys.map { |k| @arel[k] }\n manager.insert(columns.zip(record.values))\n @connection.insert(manager)\n end",
"title": ""
},
{
"docid": "84f834de3eafaa41f4fcb2fec98fa60a",
"score": "0.52071595",
"text": "def write_to_db table, row\n\t\ttable\t= table.to_sym\n\t\ttables\t= get_tables\n\t\t\n\t\tif tables.include? table\n\t\t\ttable_fields = DB[table].columns!\n\n\t\t\tfields = {}\n\t\t\tif row.class.to_s == \"Hash\"\n\t\t\t\trow.each do | key, val |\n\t\t\t\t\tif table_fields.include? key.to_sym\n\t\t\t\t\t\tfields[key.to_sym] = val\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\treturn if fields.empty?\n\n\t\t\t\t#do not insert if the data is exsiting\n\t\t\t\t#delete the time\n\t\t\t\tfields.delete :changed if fields.include? :changed\n\t\t\t\tif DB[table].filter(fields).count == 0\n\t\t\t\t\tfields[:changed] = Time.now if table_fields.include? :changed \n\t\t\t\t\tinsert table, fields\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0a5a2037276093a32ec926f93c5312f8",
"score": "0.52025545",
"text": "def insert_sql(*values)\n if values.size == 1 && (vals = values.first).is_a?(Hash)\n super(merge_defaults_overrides(vals))\n else\n super\n end\n end",
"title": ""
},
{
"docid": "73f3ad8855069e838689e6b83a5cc023",
"score": "0.51934046",
"text": "def delete_record(database, table, values)\n connections[database].delete_record(table, values)\n end",
"title": ""
},
{
"docid": "98cbeda7da03b75c13bac79f0deaf4a2",
"score": "0.5190029",
"text": "def execute_insert(sql, opts={}, &block)\n @db.execute_insert(sql, default_server_opts(opts), &block)\n end",
"title": ""
},
{
"docid": "33492d5d9c020f8f72ed9caefeba96a5",
"score": "0.51894975",
"text": "def insert(*args)\n on_write { |conn| conn.insert(*args) }\n end",
"title": ""
},
{
"docid": "33492d5d9c020f8f72ed9caefeba96a5",
"score": "0.51894975",
"text": "def insert(*args)\n on_write { |conn| conn.insert(*args) }\n end",
"title": ""
},
{
"docid": "2496e28dda55ad7ce87767d00c1a8c7e",
"score": "0.5181374",
"text": "def insert(values={})\n return super if @opts[:sql]\n with_sql(\"SET NOCOUNT ON; #{insert_sql(values)}; SELECT CAST(SCOPE_IDENTITY() AS INTEGER)\").single_value\n end",
"title": ""
},
{
"docid": "66f5b2ca3b97127df78c39482da807b4",
"score": "0.51706296",
"text": "def update_record(database, table, values, old_key = nil)\n connections[database].update_record(table, values, old_key)\n end",
"title": ""
},
{
"docid": "97ebf51eb332e8480ff36643a340b7b6",
"score": "0.51697934",
"text": "def insert(table, id, attributes) # abstract\n end",
"title": ""
},
{
"docid": "97ebf51eb332e8480ff36643a340b7b6",
"score": "0.51697934",
"text": "def insert(table, id, attributes) # abstract\n end",
"title": ""
},
{
"docid": "68183620033626e9f9fab8927c64ac17",
"score": "0.516728",
"text": "def insert_sql_for(table)\n fields = %w[ import_id ] + send(\"#{table}_fields\")\n params = fields.collect { |f| \":#{f}\" }.join(',')\n \"INSERT INTO #{table}(#{fields.join(',')}) VALUES (#{params})\"\n end",
"title": ""
},
{
"docid": "133aaf0d3c6c7c826ef7a68670fd7a5e",
"score": "0.5167033",
"text": "def insert_select_sql(*values)\n ds = (opts[:output] || opts[:returning]) ? self : output(nil, [SQL::ColumnAll.new(:inserted)])\n ds.insert_sql(*values)\n end",
"title": ""
},
{
"docid": "00aebee0482e7bccd14809def8fc050d",
"score": "0.516095",
"text": "def insert(context, keys, rows, **attributes)\n\t\t\t\t\tif attributes.any?\n\t\t\t\t\t\tfields = Statement::Fields.new(attributes.keys + keys)\n\t\t\t\t\t\tvalues = attributes.values\n\t\t\t\t\t\ttuples = rows.map{|row| Statement::Tuple.new(values + row)}\n\t\t\t\t\telse\n\t\t\t\t\t\tfields = Statement::Fields.new(keys)\n\t\t\t\t\t\ttuples = rows.map{|row| Statement::Tuple.new(row)}\n\t\t\t\t\tend\n\t\t\t\t\t\n\t\t\t\t\treturn Statement::Insert.new(self, fields, Statement::Multiple.new(tuples)).to_a(context)\n\t\t\t\tend",
"title": ""
},
{
"docid": "df5a20a5ec18da4ed2b3ea9bbd6fd91e",
"score": "0.515627",
"text": "def insert_values_sql(sql)\n case values = opts[:values]\n when Array\n sql << (values.empty? ? \" DEFAULT VALUES\" : \" VALUES #{literal(values)}\")\n when Dataset\n sql << \" #{subselect_sql(values)}\"\n when LiteralString\n sql << \" #{values}\"\n else\n raise Error, \"Unsupported INSERT values type, should be an Array or Dataset: #{values.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "eb411e8bcf1a6f99fe528d3ddf3819c5",
"score": "0.5141997",
"text": "def insert(objects)\n column_names = escape_column_names(objects)\n object_values = objects.map { |o| convert_values_to_insert_syntax(o) }\n string_params = \"(\" << generate_string_params_template_from_class(objects.first.class) << \")\"\n object_values = sanitize_object_values(object_values, string_params)\n sql_runner.run(\"INSERT INTO #{@table} (#{column_names}) VALUES #{object_values.join(', ')}\")\n end",
"title": ""
},
{
"docid": "6805c75e3b67c9d086a871b9c5b735fd",
"score": "0.5116318",
"text": "def insert_values(sql_query, values, case_sensitive: false)\n return sql_query if values.nil? || values.all? { |i, _j| i.nil? || i.empty? }\n\n EasyIO.logger.debug \"Inserting variable values into query: #{JSON.pretty_generate(values)}\"\n sql_query = to_utf8(sql_query)\n values.each do |key, value|\n regexp_key = case_sensitive ? \"$(#{key})\" : /\\$\\(#{Regexp.escape(key)}\\)/i\n sql_query.gsub!(regexp_key) { value }\n end\n\n sql_query\n end",
"title": ""
},
{
"docid": "1cdbb5de5acb7b84c179b822f546374e",
"score": "0.51124614",
"text": "def simple_insert(conn, table, fields)\n placeholders = []\n 1.upto(fields.length) { |x| placeholders << \"$#{x}\" }\n placeholders.join(', ')\n conn.exec_params(\"INSERT INTO #{table} (#{fields.keys.join(', ')}) VALUES (#{placeholders.join(', ')})\",\n fields.values) # confirm ordering\n end",
"title": ""
},
{
"docid": "c702c3e17e7891b20d005f1ab6cfa343",
"score": "0.5112057",
"text": "def insert_select(*values)\n return unless supports_insert_select?\n with_sql_first(insert_select_sql(*values))\n end",
"title": ""
},
{
"docid": "ee3f8921b9734fd123b1aff0aa273b4d",
"score": "0.51118416",
"text": "def insert_many( sql, values, options = {}, *args ) # :nodoc:\n # the number of inserts default\n number_of_inserts = 0\n\n base_sql, post_sql = case sql\n when String\n [sql, '']\n when Array\n [sql.shift, sql.join( ' ' )]\n end\n\n sql_size = QUERY_OVERHEAD + base_sql.bytesize + post_sql.bytesize\n\n # the number of bytes the requested insert statement values will take up\n values_in_bytes = values.sum(&:bytesize)\n\n # the number of bytes (commas) it will take to comma separate our values\n comma_separated_bytes = values.size - 1\n\n # the total number of bytes required if this statement is one statement\n total_bytes = sql_size + values_in_bytes + comma_separated_bytes\n\n max = max_allowed_packet\n\n # if we can insert it all as one statement\n if max == NO_MAX_PACKET || total_bytes <= max || options[:force_single_insert]\n number_of_inserts += 1\n sql2insert = base_sql + values.join( ',' ) + post_sql\n insert( sql2insert, *args )\n else\n value_sets = ::ActiveRecord::Import::ValueSetsBytesParser.parse(values,\n reserved_bytes: sql_size,\n max_bytes: max)\n\n transaction(requires_new: true) do\n value_sets.each do |value_set|\n number_of_inserts += 1\n sql2insert = base_sql + value_set.join( ',' ) + post_sql\n insert( sql2insert, *args )\n end\n end\n end\n\n ActiveRecord::Import::Result.new([], number_of_inserts, [], [])\n end",
"title": ""
},
{
"docid": "9f2dfbe017b62a0fef2e8744c9b7c845",
"score": "0.51096845",
"text": "def insert\n vals = self.class.columns.join(', ')\n q_marks = []\n attribute_values.length.times { q_marks << '?' }\n q_marks = q_marks.join(', ')\n DBConnection.execute(<<-SQL, *attribute_values)\n INSERT INTO\n #{self.class.table_name} (#{vals})\n VALUES\n (#{q_marks})\n SQL\n self.id = DBConnection.last_insert_row_id\n end",
"title": ""
},
{
"docid": "5b2370d38add831636dd9c1c86452caf",
"score": "0.51086766",
"text": "def save(params)\n raise NoConection unless @table\n @table.insert params\n end",
"title": ""
},
{
"docid": "fbfab275e4245675a17e0c6406212758",
"score": "0.51065415",
"text": "def newEntry(table, entry)\n\t\t@conn.exec(\"INSERT INTO #{table} \" + insertQuery(entry) + \";\")\n\tend",
"title": ""
},
{
"docid": "70a4e957cc261915ee4dd8c5909d0a16",
"score": "0.50993514",
"text": "def insert_values(sql_query, values, case_sensitive: false)\n return sql_query if values.nil? || values.all? { |i, _j| i.nil? || i.empty? }\n\n IOHelper.logger.debug \"Inserting variable values into query: #{JSON.pretty_generate(values)}\"\n sql_query = to_utf8(sql_query)\n values.each do |key, value|\n regexp_key = case_sensitive ? \"$(#{key})\" : /\\$\\(#{Regexp.escape(key)}\\)/i\n sql_query.gsub!(regexp_key) { value }\n end\n\n sql_query\n end",
"title": ""
},
{
"docid": "cd4f7f05f2b0e98d20e8d4da632366f2",
"score": "0.5094947",
"text": "def insert_record(r)\n # if the hash keys are all valid writable table names, then write rows to multiple tables\n return nil if (r.keys & PHPBB_TABLES) != r.keys\n\n r.each_pair do |t,h|\n h.delete_if {|k,v| v.nil?}\n vstring = h.values.map {|g| sanitize(g)} * ', '\n kstring = h.keys * ', '\n q = \"INSERT INTO #{t} (#{kstring}) VALUES (#{vstring})\"\n begin\n PHPBB_DB.query(q)\n rescue Mysql2::Error => e\n puts \"Error with query: #{q}\"\n puts \"Record is: #{h}\" \n puts e.backtrace.join(\"\\n\")\n puts e\n next\n end\n\n if $rows_written < 100 || $rows_written % 20 == 0 # only output 1/10 of writes to the console after the first 100 writes\n puts \"Wrote \\e[32m#{h}\\e[0m to \\e[36m#{t}\\e[0m\"\n end\n end\n $rows_written += 1\n end",
"title": ""
}
] |
c3e18f2a89bf36e06e43a16a973f9a65
|
Yields the given block if the user logged in is the system administrator
|
[
{
"docid": "73fd3f98313ab62269eeafea10395337",
"score": "0.75328636",
"text": "def if_app_admin\n if logged_in?\n user = User.find(session[:user_id])\n if user.user_role.role == \"administrator\"\n yield if block_given?\n return\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "b720550483b1ba63895278e6bc7e53e6",
"score": "0.7226892",
"text": "def admins_only(&block)\n block.call if current_user.try(:admin?)\n nil\n end",
"title": ""
},
{
"docid": "e371f8acf57da196889e7c8ace8ba8ee",
"score": "0.721178",
"text": "def admins_only(&block)\n block.call if current_user.try(:admin?)\n end",
"title": ""
},
{
"docid": "994f2cd76db6c9b34d23641fe36c1ea4",
"score": "0.7098767",
"text": "def admin_only(&block)\n if admin_logged_in?\n block.call\n end\n end",
"title": ""
},
{
"docid": "19e48d14186a1239deb2c43ec5ba2e4c",
"score": "0.70837677",
"text": "def admin\n if block_given?\n yield unless current_user.nil?\n else\n !current_user.nil?\n end\n end",
"title": ""
},
{
"docid": "cd17fc9161ac628adf233a65007c1543",
"score": "0.69057244",
"text": "def admin_only(&block)\n role_only(\"admin\", &block)\n end",
"title": ""
},
{
"docid": "41f0f3f6ed764c045cc22593f48c6716",
"score": "0.66688013",
"text": "def if_project_admin(project)\n if logged_in?\n member = project.members.find_by_user_id(session[:user_id])\n if member and (member.member_role.role == \"creator\" or member.member_role.role = \"administrator\")\n yield if block_given?\n return\n end\n end\n end",
"title": ""
},
{
"docid": "576f758a470f5ebcc4e590ad782ad034",
"score": "0.6250084",
"text": "def block_access_for_non_admins\n# if current_user.role != \"admin\"\n# changed to super admins only\n if (current_user.role != \"admin\" )\n flash[:error] = \"You have no access rights for this section.\"\n redirect_to :controller => \"streams\", :action => \"index\"\n end\n end",
"title": ""
},
{
"docid": "25479b17450219535d50680e29d33ae2",
"score": "0.62392795",
"text": "def non_user(&block)\n capture(&block) unless current_user\n end",
"title": ""
},
{
"docid": "25aaf12119a0784f7512bc1bb232f62d",
"score": "0.6215599",
"text": "def block_user\n\n user = User.find(params[:id]) rescue nil\n\n if !user.nil?\n role = User.current.user_role.role.role.strip rescue nil\n if ((role.downcase.match(/Administrator/i) rescue false) ? true : false)\n user.update_attributes(active: false,\n :un_or_block_reason => params[:reason])\n end\n end\n\n redirect_to \"/view_users\" and return\n\n end",
"title": ""
},
{
"docid": "0dd24deb304de143a126666fa3a84cea",
"score": "0.6194865",
"text": "def block\n @user = current_user\n render :action => 'block', :layout => 'site'\n end",
"title": ""
},
{
"docid": "1c90aeaacf1c148b1d5fd83fbb668a47",
"score": "0.61158967",
"text": "def block_page_if_not_admin\n if !(@current_user)\n flash[:notice] = \"Sorry must be signed in to view that page.\"\n redirect_to root_path and return\n end\n if !(@current_user.admin)\n flash[:notice] = \"Sorry, must be signed in and have permission to view that page.\"\n redirect_to root_path and return\n end\n end",
"title": ""
},
{
"docid": "38ef5fe10fff1a601e72e13fb923a267",
"score": "0.6101639",
"text": "def for_user_in_group name, &block\n yield if current_user && current_user.is_in_group?(name)\n end",
"title": ""
},
{
"docid": "85b404b14ef578e20a0579ce19df52e8",
"score": "0.6100494",
"text": "def for_all_cpanel_real_users(&block)\n for_all_cpanel_users do |user|\n next if %w(system).include?(user)\n block.call(user)\n end\n end",
"title": ""
},
{
"docid": "0a5e7e99a6fc50a0b544fc6a53750009",
"score": "0.6035234",
"text": "def block(other_user)\n blocking << other_user\n end",
"title": ""
},
{
"docid": "bc9f4e398e4295c8a2b0cba17d62ec1f",
"score": "0.59811974",
"text": "def authorize_only(role,&block)\n role = {:big_wedgie=>1,:admin=>2,:leader=>3,:user=>4,:patient=>5,:temp=>7}[role]\n if (@user.role==role)\n if (block)\n if (! block.call)\n flash[:notice] = \"You do not have authority to access that page!\"\n @redirect =true\n if(@user.role==5)\n redirect_to :controller => 'record',:action=>'show',:wedgetail=>@user.wedgetail\n elsif(@user.role==7)\n redirect_to :controller => 'record',:action=>'show',:wedgetail=>@user.wedgetail.from(6)\n else\n redirect_to :controller => 'record'\n end\n else\n @authorized = true\n end\n else\n @authorized = true\n end\n end\n end",
"title": ""
},
{
"docid": "520f9ba51266816baa1b5cc42b812080",
"score": "0.596533",
"text": "def can_process_application(application)\n clan = application.clan\n raise \"block must be supplied\" unless block_given?\n if (clan.access_type == 1) && clan.can_admin?(current_user) && clan.already_applied?(application.user)\n yield\n else\n render :text => 'Invalid or un-authorised request', :layout => true\n end\n end",
"title": ""
},
{
"docid": "c2483930426c922350447b9f45ab5309",
"score": "0.59645534",
"text": "def as_admin(&block)\n save_auth_token = Thread.current[:usergrid_auth_token]\n begin\n unless Base.settings[:auth_token]\n resource = RestClient::Resource.new Base.settings[:application_url]\n response = resource['token'].post grant_type: 'client_credentials', client_id: Base.settings[:client_id], client_secret: Base.settings[:client_secret]\n Base.settings[:auth_token] = MultiJson.load(response)['access_token']\n end\n Thread.current[:usergrid_auth_token] = Base.settings[:auth_token]\n yield block\n ensure\n Thread.current[:usergrid_auth_token] = save_auth_token\n end\n end",
"title": ""
},
{
"docid": "77bdad10f7208b992bd3adae6afa1fdc",
"score": "0.59629875",
"text": "def authenticated_only(&block)\n if logged_in?\n block.call\n end\n end",
"title": ""
},
{
"docid": "77bdad10f7208b992bd3adae6afa1fdc",
"score": "0.59629875",
"text": "def authenticated_only(&block)\n if logged_in?\n block.call\n end\n end",
"title": ""
},
{
"docid": "2eaca69ee30679b6cfb4bfc74e02e2d1",
"score": "0.59570354",
"text": "def authenticated_only(&block)\n if logged_in?\n block.call\n end\n end",
"title": ""
},
{
"docid": "aa709029d2fc7735fc7bc00727c4b00e",
"score": "0.5939336",
"text": "def user_content(&block)\n capture(&block) if current_user\n end",
"title": ""
},
{
"docid": "aa709029d2fc7735fc7bc00727c4b00e",
"score": "0.5939336",
"text": "def user_content(&block)\n capture(&block) if current_user\n end",
"title": ""
},
{
"docid": "42d0ed4286009aeb7a3d21e16e87ed65",
"score": "0.59182924",
"text": "def block\n\t\tflash[:error] = \"Sorry. You must be an administrator to perform this action.\"\n\t\tredirect_back_or_default('/')\n\tend",
"title": ""
},
{
"docid": "ab93554cf273d09739c871211148e0f8",
"score": "0.5893153",
"text": "def administrator?\n role_symbols == [:administrator]\n end",
"title": ""
},
{
"docid": "379ad07539457d0b718fc0f8315f9a49",
"score": "0.5867415",
"text": "def user(&block)\n @current_user_block = block\n end",
"title": ""
},
{
"docid": "61e725eadd5b2ae5fad88d5ba7b9344e",
"score": "0.58608156",
"text": "def limit_faculty_to_self\n if site_user.admin == true\n yield\n else\n Image.only_edit_own(site_user) do\n yield\n end\n end\n end",
"title": ""
},
{
"docid": "f08143a61f2dddebeb3ed3ebde617222",
"score": "0.5843475",
"text": "def block_user username\n if Rails.configuration.mediawiki_session\n if self.wiki_page_name.present?\n name = self.wiki_page_name.gsub(\" \", \"_\")\n else\n name = self.title.strip.gsub(\" \", \"_\")\n end\n\n # Block\n begin\n result = RestClient.get(\"#{Project.load_mediawiki_api_base_url}api.php?action=weserve&method=block&page=#{URI.escape(name)}&user=#{username}&format=json\", {:cookies => Rails.configuration.mediawiki_session})\n JSON.parse(result.body)[\"response\"][\"code\"]\n rescue\n return nil\n end\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "d60f24a30f5f5b22ec3dd554b842ff92",
"score": "0.58186877",
"text": "def change_dir(path, &block)\n\t\tif admin? || path.start_with?('/' + @user + '/')\n\t\t\tyield true\n\t\telse\n\t\t\tyield false\n\t\tend\n\tend",
"title": ""
},
{
"docid": "912a5326193e67d7c9b281a3c65ea23a",
"score": "0.58141047",
"text": "def authorize_only(role,&block)\n role = {:big_wedgie=>1,:admin=>2,:leader=>3,:user=>4,:patient=>5,:temp=>7,:inactive=>10}[role]\n if (@user.role==role)\n if (block)\n if (! block.call)\n flash[:notice] = \"You do not have authority to access that page!\"\n @redirect =true\n if(@user.role==5)\n redirect_to(patient_path(@user.wedgetail))\n elsif(@user.role==7)\n unless request.xhr?\n redirect_to(:controller => 'patients',:action=>'show',:wedgetail=>@user.wedgetail.from(6)) \n else\n session[:original_uri] = nil\n render :update do |page| \n page.redirect_to(:controller => 'patients',:action=>'show',:wedgetail=>@user.wedgetail.from(6))\n end\n end\n else\n \n unless request.xhr?\n redirect_to(:controller => 'patients') \n else\n session[:original_uri] = nil\n render :update do |page|\n page.redirect_to(:controller => 'patients')\n end\n end\n end\n else\n @authorized = true\n end\n else\n @authorized = true\n end\n end\n end",
"title": ""
},
{
"docid": "a79474ec78ad2247191ae9c732d461bd",
"score": "0.5791884",
"text": "def is_admin_user\n if current_user != :false\n if current_user.role == \"Admin\"\n return true\n else\n access_denied\n end\n else\n access_denied\n end\n end",
"title": ""
},
{
"docid": "e46dea531e1b304a974d847b4a394c2e",
"score": "0.57732993",
"text": "def can_unblock?(user)\n blocked? && self.blocker == user\n end",
"title": ""
},
{
"docid": "8d4f70c74b1e1ad9d4f403c2173242ad",
"score": "0.5767805",
"text": "def when_logged_in(&block)\n if logged_in?\n yield\n\t\t\tend\n end",
"title": ""
},
{
"docid": "c81b016ca29f133cee7169bc1b31e058",
"score": "0.5739088",
"text": "def verify_block(&blk)\n yield\n true\n rescue => e\n logger.debug e.message\n false\n end",
"title": ""
},
{
"docid": "3f2ca3640f34e2a0b994e8d79354fc7c",
"score": "0.57319814",
"text": "def with_privilege(privilege, &block)\n set_privilege(privilege, true)\n yield\n ensure\n set_privilege(privilege, false)\n end",
"title": ""
},
{
"docid": "e7b7b8d3423cc28e35d54c7668a8e6d6",
"score": "0.5720056",
"text": "def check_admin_only\n\t\t\n\t\tif (not @current_user.is_administrator?)\n\t\t\tredirect_to root_path, notice: \"Access Denied\"\n\t\t\treturn\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3d9e39c8ed022cfbc197caa8a0c87b0b",
"score": "0.5698035",
"text": "def require_admin\n if @current_user.administrator?\n return\n else\n flash[:neg_notice] = 'Sorry, permission denied.'\n redirect_to root_url\n end\n end",
"title": ""
},
{
"docid": "8645e550e2393e5504c57218a0d69d6b",
"score": "0.5693998",
"text": "def check_role_system_admin\n render :file => \"public/401.html\", :layout => false, :status => 401 unless User.cache(session[:user_id]).role_system_admin\n end",
"title": ""
},
{
"docid": "0ac6334bd5f6dcb26c5da0bb18eea653",
"score": "0.56858224",
"text": "def check_user_identity\n render :text => 'You cannot access this mailbox.', :status => :forbidden unless (current_user == @user) || current_user.is_admin?\n end",
"title": ""
},
{
"docid": "2fb89d90f571b787a11da2c422d750c9",
"score": "0.5679477",
"text": "def check_permissions\n raise Cms::Errors::AccessDenied unless current_user.able_to_edit?(@block)\n \n # case action_name\n # when \"index\", \"show\", \"new\", \"create\", \"version\", \"versions\", \"usages\"\n # # Allow\n # when \"edit\", \"update\"\n # raise Cms::Errors::AccessDenied unless current_user.able_to_edit?(@block)\n # when \"destroy\", \"publish\", \"revert_to\"\n # raise Cms::Errors::AccessDenied unless current_user.able_to_publish?(@block)\n # else\n # raise Cms::Errors::AccessDenied\n # end\n end",
"title": ""
},
{
"docid": "9126d6567e10be2d2256a2a912694bf1",
"score": "0.567498",
"text": "def visit_block(block)\n execute_block(block.statements, Ringo::Environment.new(@environment))\n return nil\n end",
"title": ""
},
{
"docid": "163723036376ad9e73b3b778bb25d923",
"score": "0.5671955",
"text": "def ensure_administrator\n if ensure_usertype == 'normal' or ensure_usertype == 'banned' or ensure_usertype == 'moderator'\n render :nothing => true, :status => :forbidden\n end\n end",
"title": ""
},
{
"docid": "965476cff9f47f337498f1aebdc2e50d",
"score": "0.5661964",
"text": "def user_is_administrator?\n acct = I3.server.remote_account\n unless acct.has_permission?(\"administer\")\n I3.server.send_error(\n :status => \"403 Forbidden\",\n :title => \"Access Denied\",\n :message => \"You must be a Bulletin Board administrator \" +\n \"to access this service.\",\n :help => \"Please contact the Help Desk if you believe you have \" +\n \"received this message in error.\")\n log.warn \"Unauthorized access attempt by: #{acct}\"\n return false\n end #unless\n return true\n end",
"title": ""
},
{
"docid": "3368cdb06a6e356b42ff4afeec71803e",
"score": "0.56591785",
"text": "def ensure_administrator_only\n # TODO\n end",
"title": ""
},
{
"docid": "02889804379909adab9fddba0a4b1724",
"score": "0.5645107",
"text": "def administrator?(u = nil)\n wf_roles(u).include?(:administrator)\n end",
"title": ""
},
{
"docid": "994936e3ac8d56c93d798e795259a1f7",
"score": "0.56437683",
"text": "def system_administrator?\n has_exact_role?('urn:lti:sysrole:ims/lis/SysAdmin') ||\n has_exact_role?('SysAdmin') ||\n has_exact_role?('urn:lti:sysrole:ims/lis/Administrator')\n end",
"title": ""
},
{
"docid": "2bd102fd04fb8e64d9569ebc46d7cf81",
"score": "0.5636073",
"text": "def administrator?\n uid == 1\n end",
"title": ""
},
{
"docid": "60948ce4bd29c4aefd97e1a420c3da66",
"score": "0.56332487",
"text": "def block_access\n die_if_undefined\n unless @authenticated.nil?\n # Find the user's roles\n roles = []\n roles << @authenticated.role if @authenticated.respond_to?(:role)\n access_allowed_for.keys.each do |role|\n roles << role.to_s if @authenticated.respond_to?(\"#{role}?\") and @authenticated.__send__(\"#{role}?\")\n end\n # Check if any of the roles give her access\n roles.each do |role|\n return true if access_allowed?(params, role, @authenticated)\n end\n end\n return true if access_allowed?(params, :all, @authenticated)\n access_forbidden\n end",
"title": ""
},
{
"docid": "ce1f5ad5a551809bf8f206774d09aaae",
"score": "0.56278723",
"text": "def administrator?\n @is_administrator ||=\n begin\n is_admin?\n end\n end",
"title": ""
},
{
"docid": "ce1f5ad5a551809bf8f206774d09aaae",
"score": "0.56278723",
"text": "def administrator?\n @is_administrator ||=\n begin\n is_admin?\n end\n end",
"title": ""
},
{
"docid": "1e29470a0c429ecf2032f74667bdfcf6",
"score": "0.56258327",
"text": "def running_as(user)\n @run_as = user\n yield\n ensure\n @run_as = nil\n end",
"title": ""
},
{
"docid": "819b8a4dee47122f37066c618f232f5a",
"score": "0.56235653",
"text": "def can(user_urn, capability)\n user = CanDo::User.find(:id => user_urn)\n has_permission = user && user.can(capability)\n if block_given?\n if has_permission\n return yield\n end\n if @@cannot_block_proc\n self.instance_exec user_urn, capability, &@@cannot_block_proc\n end\n end\n\n has_permission\n end",
"title": ""
},
{
"docid": "cb9301dc16cb246fe40c2b256e65dce4",
"score": "0.5623446",
"text": "def administrator?\n @administrator ||= current_user && current_user.admin?\n end",
"title": ""
},
{
"docid": "3542d35599f1a4424dbe906ad2f3d921",
"score": "0.5620116",
"text": "def is_administrator\n if current_user && current_user.is_administrator\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "4e9fe8b9bcf539eec1b9c971821efadb",
"score": "0.56198585",
"text": "def not_for_roles(*user_roles, &block) \n user_roles = user_roles.flatten\n yield if !has_role?(user_roles) && block\n end",
"title": ""
},
{
"docid": "a7d433581e269e65d7c6bdfaa4aef110",
"score": "0.56101304",
"text": "def administrator\n @administrator ||= admin_users.include?(current_user.email)\n end",
"title": ""
},
{
"docid": "017c0ae66ec68d3da113ca585c3bfabb",
"score": "0.56001216",
"text": "def each(&block)\n whitelist_users_collection.each(&block)\n end",
"title": ""
},
{
"docid": "40bb25eb8e9d41cf83c6b2f9aba51a56",
"score": "0.55977",
"text": "def require_admin\n if (user = current_user) && user.admin?\n return true\n else\n puts user\n redirect_to root_path\n end\n end",
"title": ""
},
{
"docid": "9cd3ecec1c605a468b3bb49d56c3e3be",
"score": "0.5594988",
"text": "def logged_in_only\n yield if logged_in?\n end",
"title": ""
},
{
"docid": "b727ac85f42226e6e902a4c49f6802f6",
"score": "0.5589956",
"text": "def check_admin\n\t\tif session[:user_id] && session[:mod0]\n\t\t\t@iam = true\n\t\telse\n\t\t\t@iam = false\n\t\tend\t\n\tend",
"title": ""
},
{
"docid": "a2c4d05919a6e6dfef95bd65a72de123",
"score": "0.55811715",
"text": "def test_session_invokes_block\n block_ran = false\n @service.session do\n block_ran = true\n end\n\n assert(block_ran)\n end",
"title": ""
},
{
"docid": "b2b2dd24cf0ef78ed0d0465743424ed3",
"score": "0.5579688",
"text": "def for_roles(*user_roles, &block) \n user_roles = user_roles.flatten\n yield if has_role?(user_roles) && block\n end",
"title": ""
},
{
"docid": "0d70d84b2b7d9ac63fed7da28ea2b209",
"score": "0.55791426",
"text": "def block_user\n\n if params['unblock'].present?\n user = User.find(params[:user_id]) rescue nil\n if !user.nil?\n if admin?\n user.update_attributes(active: true,\n un_or_block_reason: 'Unkown')\n end\n end\n else\n user = User.find(params[:user_id]) rescue nil\n if !user.nil?\n if admin?\n user.update_attributes(active: false,\n un_or_block_reason: (params[:reason].blank? ? 'Unknown' : params[:reason]))\n end\n end\n end\n\n render :text => true\n end",
"title": ""
},
{
"docid": "5cb5eae7265e4ec2211dea59754256e1",
"score": "0.5571075",
"text": "def user_is_administrator?\n acct = I3.server.remote_account\n unless acct.has_permission?(\"administer\")\n I3.server.send_error(\n :status => \"403 Forbidden\",\n :title => \"Access Denied\",\n :message => \"You must be a Bulletin Board administrator \" +\n \"to modify topics.\",\n :help => \"Please contact the Help Desk if you believe you have \" +\n \"received this message in error.\")\n log.warn \"Unauthorized access attempt by: #{acct}\"\n return false\n end #unless\n return true\n end",
"title": ""
},
{
"docid": "b0a8b3b4407850911116a50d4df31047",
"score": "0.55671483",
"text": "def running_as(user)\n @run_as = user\n yield\n ensure\n @run_as = nil\n end",
"title": ""
},
{
"docid": "b0a8b3b4407850911116a50d4df31047",
"score": "0.55671483",
"text": "def running_as(user)\n @run_as = user\n yield\n ensure\n @run_as = nil\n end",
"title": ""
},
{
"docid": "d5026a958e8f35c43302891903dc2a04",
"score": "0.556527",
"text": "def administrator?\n @is_administrator ||=\n begin\n is_admin?\n end\n end",
"title": ""
},
{
"docid": "5dbc75fc71dac6fff38046bb2cc25d0e",
"score": "0.55593073",
"text": "def not_for_roles(*user_roles, &block) \n user_roles = user_roles.flat_uniq\n yield if !has_roles?(user_roles) && block\n end",
"title": ""
},
{
"docid": "5c29d9c4017790bd677f82a24105545e",
"score": "0.5557266",
"text": "def is_admin(current_user)\n current_user.roles[:user_roles][:administration] \n end",
"title": ""
},
{
"docid": "0a8b157fc41a05572d98b884696ff60e",
"score": "0.5554153",
"text": "def is_admin?\n current_user ? current_user.login == \"admin\" : false\n end",
"title": ""
},
{
"docid": "46c5101762d987031fbaf367f5e31741",
"score": "0.55513835",
"text": "def is_admin\n current_login_type == \"Administrator\"\n end",
"title": ""
},
{
"docid": "8a3d84c65100412edd8edca3d77ec4bb",
"score": "0.5547159",
"text": "def admin_only\n return true if admin_user?\n admin_access_denied\n end",
"title": ""
},
{
"docid": "9c4f868575db2d5f439f6c87abf501c7",
"score": "0.55419797",
"text": "def blockasaurus\n\tputs \"I am a blockasaurus. Grrr!\"\n\tyield\nend",
"title": ""
},
{
"docid": "729ca537e62c50ab7b7b937946e6b3de",
"score": "0.55392295",
"text": "def verify_manager_admin_privs\n\n begin\n unless @logged_in_user.is_manager? || @logged_in_user.is_a_role_member?('Admin')\n flash['notice'] = 'Access not allowed'\n redirect_to(:controller => 'tracker', :action => \"index\")\n end\n rescue\n flash['notice'] = 'Update not allowed - Must be admin or manager'\n redirect_to(:controller => 'tracker', :action => \"index\")\n end\n end",
"title": ""
},
{
"docid": "3d5bc39069a0461d5f1942acd6972462",
"score": "0.5530489",
"text": "def user_is_administrator?\n acct = I3.server.remote_account\n unless acct.has_permission?(\"administer\", \"i3-root\")\n I3.server.send_error(\n :status => \"403 Forbidden\",\n :title => \"Access Denied\",\n :message => \"You must be an administrator to access this service.\",\n :help => \"Please contact the Help Desk if you believe you have \" +\n \"received this message in error.\")\n log.warn \"Unauthorized access attempt by: #{acct}\"\n return false\n end #unless\n return true\n end",
"title": ""
},
{
"docid": "9f871fd600bc7e4441ae7e4756c67be4",
"score": "0.55285484",
"text": "def visible_block(role, user)\n if user.logged?\n case role.issues_visibility\n when 'all'\n true\n when 'default'\n !self.is_private? || (self.author == user || user.is_or_belongs_to?(assigned_to))\n when 'own'\n self.author == user || user.is_or_belongs_to?(assigned_to)\n else\n false\n end\n else\n !self.is_private?\n end\n end",
"title": ""
},
{
"docid": "536dbfb2b5cbf0daad7ce95d87b1551d",
"score": "0.5522975",
"text": "def examine_context(block)\n return false unless block.nested_block?\n found(block, 'is nested')\n end",
"title": ""
},
{
"docid": "a7e9de51505b29095b5a635b70c7b952",
"score": "0.552077",
"text": "def unblock_user\n\n user = User.find(params[:id]) rescue nil\n\n if !user.nil?\n role = User.current.user_role.role.role.strip rescue nil\n if ((role.downcase.match(/Administrator/i) rescue false) ? true : false)\n user.update_attributes(active: true,\n :un_or_block_reason => params[:reason])\n end\n end\n\n redirect_to \"/view_users\" and return\n\n end",
"title": ""
},
{
"docid": "5a79aeea4d377698ad0ecf3f47c2b4ab",
"score": "0.5513312",
"text": "def role r\n if block_given? && current_roles.include?(r.to_s)\n puts \"ROLE: #{r}\"\n yield\n end\n end",
"title": ""
},
{
"docid": "b397f8e0c9d37e5f030aaa375410b109",
"score": "0.55085427",
"text": "def block?\n !!block\n end",
"title": ""
},
{
"docid": "6893eed41b12e0296839326627ea83be",
"score": "0.55080897",
"text": "def check_admin_only\n\t\t# Check permissions\n\t\tif (not @current_user.is_administrator?)\n\t\t\tredirect_to root_path, notice: \"Access Denied\"\n\t\t\treturn\n\t\tend\n\tend",
"title": ""
},
{
"docid": "6893eed41b12e0296839326627ea83be",
"score": "0.55080897",
"text": "def check_admin_only\n\t\t# Check permissions\n\t\tif (not @current_user.is_administrator?)\n\t\t\tredirect_to root_path, notice: \"Access Denied\"\n\t\t\treturn\n\t\tend\n\tend",
"title": ""
},
{
"docid": "6893eed41b12e0296839326627ea83be",
"score": "0.55080897",
"text": "def check_admin_only\n\t\t# Check permissions\n\t\tif (not @current_user.is_administrator?)\n\t\t\tredirect_to root_path, notice: \"Access Denied\"\n\t\t\treturn\n\t\tend\n\tend",
"title": ""
},
{
"docid": "af8482fc44f68ac75b0f9adceb9cf9aa",
"score": "0.5505487",
"text": "def is_admin?\n current_user && current_user.roles.first && current_user.roles.first.title == \"Administrator\" ? true : false \n end",
"title": ""
},
{
"docid": "4cf158787b6487cdb78b67c9e31816e3",
"score": "0.5504051",
"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": "e3b87f0782e32cf6c172af460056871e",
"score": "0.54967475",
"text": "def is_admin()\n @user = current_user if current_user.admin == true;\n end",
"title": ""
},
{
"docid": "843a8b7a58875f73e8a81fe5fd47261c",
"score": "0.5492527",
"text": "def block(expiry, reason, anononly = true, nocreate = true, autoblock = true, noemail = false, allowusertalk = true, reblock = false)\n #require login\n @site.login\n result = @site.query_prop_info(@username, nil, 'block') \n token = result['query']['pages']['page']['blocktoken']\n result = @site.block(@username, token, nil, expiry, reason, anononly, nocreate, autoblock, noemail, nil, allowusertalk, reblock)\n if result.key?('error')\n raise RbykimediaError, \"#{@username}: \"+result['error']['code']\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "bd9556bc70194579106df1b106c56049",
"score": "0.548929",
"text": "def admin?\n (session[:drupal_user_role] && session[:drupal_user_role].values.include?('administrator')) ? true : false\n end",
"title": ""
},
{
"docid": "99222d13398944014e0a7ea4d2592a3a",
"score": "0.54881656",
"text": "def index\n @user_blocks = current_user.user_blocks\n end",
"title": ""
},
{
"docid": "cffc148544ccd7511b21d82d8b0c1f7c",
"score": "0.5487173",
"text": "def blocked\n @block_list = current_user.blocks\n end",
"title": ""
},
{
"docid": "968cc339b896c5ea692b7b085f178b9b",
"score": "0.5485828",
"text": "def blocked?(user)\n blocked.include?(user)\n end",
"title": ""
},
{
"docid": "cd105c93a501e8a876659f19b11b9366",
"score": "0.5483995",
"text": "def private_block(node)\n if (node[:command] == \"call\") && (node[:children][0][:children][0][:command] == \"private\")\n if node[:children][1][:command] == \"block\"\n # block\n # TODO: eliminate this option because it won't be\n # generated by lamb\n return node[:children][1][:children]\n else\n #context\n return node[:children][1][:children][1][:children]\n end\n elsif (node[:command] == \"context\")\n return false\n end\n node[:children].each do |child|\n result = private_block(child)\n return result if result\n end\n false\n end",
"title": ""
},
{
"docid": "56133566c3d48201530afb16121a300c",
"score": "0.54835653",
"text": "def is_admin_user\n not_found(\"You don't have sufficient privileges to complete that action\") if !current_signed_in_resource.is_admin?\n end",
"title": ""
},
{
"docid": "f3f800fbe2cf63f8b85d3a4fee0409df",
"score": "0.5476541",
"text": "def can_edit(item)\n if item.owner?(current_user) || admin_or_moderator?\n yield\n else\n render :partial => 'items/cannot_edit', :layout => true\n end\n end",
"title": ""
},
{
"docid": "0cfe240116d050b46bb934dbff40d15a",
"score": "0.54749626",
"text": "def require_admin\n # User.find_by_id(session[:id]) do |user|\n \n if User.find(session[:id]).email != \"admin@my-ballot.org\"\n redirect_to root_url, :notice => 'Must be admin.'\n end\n end",
"title": ""
},
{
"docid": "1993cd9e7128ed497cac5d3eabcdd136",
"score": "0.5473401",
"text": "def check_for_admin\n if current_user && User.first == User.last\n unless current_user.has_role? :admin\n current_user.add_role :admin\n end\n end\n end",
"title": ""
},
{
"docid": "7ff8776ac68e115ffb7b37686eb7dd81",
"score": "0.54727477",
"text": "def is_admin?(user)\n if(current_user.present?)\n true if(current_user.role == 'admin')\n end\n end",
"title": ""
},
{
"docid": "7d31138987499b8fbafda802f77ae84e",
"score": "0.5471198",
"text": "def current_user?(admin_admin)\n admin_admin == current_user\n end",
"title": ""
},
{
"docid": "71be28e2dcff3e97fe3a5514ada99321",
"score": "0.5470937",
"text": "def is_admin?\n !!(self.system_role == SYSTEM_ROLE_ADMIN_USER)\n end",
"title": ""
},
{
"docid": "62d960e5c9b19b6e68c5741aecf4d58e",
"score": "0.5469961",
"text": "def do_as u_str\n user = users[u_str.gsub(/用户/, '')]\n if user\n login_as user do\n yield\n end\n else\n yield\n end\n end",
"title": ""
},
{
"docid": "7f8dcfe51e85c8dd2fd30c1af0b983c5",
"score": "0.5468295",
"text": "def verify_super_admin\r\n redirect_to admin_path unless current_user.user_level == \"super_admin_access\"\r\n\r\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "f5a3bc017e5ecfa98bc5db0dcb1be720",
"score": "0.0",
"text": "def synonymou_params\n params.require(:synonymou).permit(:word_id, :word_2_id)\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": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "961582b19f0ed318c21af21bfb2a9ab3",
"score": "0.0",
"text": "def set_p_user\n @p_user = PUser.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.6032574",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6015663",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.59219843",
"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.59141374",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.59141374",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.58976305",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58890367",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58890367",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58890367",
"text": "def actions; end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5888804",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.58762443",
"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.58622783",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.5809543",
"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.5739154",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.5730308",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.5716412",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5703048",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.5692339",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.56683415",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.5651343",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5649526",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.5637351",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5625094",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.56081706",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5598399",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.55983305",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.5589034",
"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.55590636",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.55590636",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.5508606",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.5503641",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.5466762",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.5465908",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.5448214",
"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.54452825",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.543952",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.5416739",
"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.540998",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.540998",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.5399368",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5393666",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5393666",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.539238",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.53882563",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53783023",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.53568405",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.53475434",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.5347053",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.53463554",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.5343945",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.53414744",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53269625",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53046626",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5285546",
"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.5281048",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.52582437",
"text": "def define_callbacks(*args)\n if abstract_class\n all_shards.each do |model|\n model.define_callbacks(*args)\n end\n end\n\n super\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.52580667",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "fc88422a7a885bac1df28883547362a7",
"score": "0.5249179",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.52446544",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.523857",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5236856",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5236856",
"text": "def action; end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.52311945",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52288747",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.5223357",
"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.52224743",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.52201444",
"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.52142954",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.52137226",
"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.52085507",
"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.5206211",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.5204376",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.52038896",
"text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.52029234",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5200697",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.5197009",
"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.5197009",
"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.51938593",
"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.51789296",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.51784116",
"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.51725876",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51725876",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51725876",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.5162988",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.51526964",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.514453",
"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.5140928",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.51408994",
"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.5139561",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.5133698",
"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.51154804",
"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.5113695",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.510964",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5108603",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5108603",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5108603",
"text": "def action\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.5106174",
"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.5104524",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.50983906",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.509494",
"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.5093076",
"text": "def add_callbacks(base); end",
"title": ""
}
] |
ba4f1e9a0ca041d3cc818d7dad1609d2
|
looks up all songs with associated artist
|
[
{
"docid": "181ad9193e1b01776cded551b9ddf61f",
"score": "0.78424376",
"text": "def songs\n Song.all_by_artist(self)\n end",
"title": ""
}
] |
[
{
"docid": "7ed8679abc454268948aa877d1d09544",
"score": "0.7756042",
"text": "def songs\n #use select to iterate thru songs\n Song.all.select{|song| song.artist == self}\n end",
"title": ""
},
{
"docid": "82aaf3d4bcc2015b7a905fa47c0781a9",
"score": "0.77346545",
"text": "def songs\n Song.all.select do |song| \n song.artist == self\n end \n end",
"title": ""
},
{
"docid": "9082d21f983b643edbfc92c0a12c04a3",
"score": "0.7715006",
"text": "def songs\n Song.all.select {|song| song.artist = self}\n end",
"title": ""
},
{
"docid": "cdcd4d71dddcfcc4bb7d8901bfe2d1b7",
"score": "0.7695655",
"text": "def songs\n Song.all.select {|songs|songs.artist == self}\n end",
"title": ""
},
{
"docid": "7bb658388225b5e0cd5de2b39c80b187",
"score": "0.76769614",
"text": "def songs\n @songs ||= Song.where(:artist => info(:name))\n end",
"title": ""
},
{
"docid": "cca34fe327d83c6d505d7c4d80f0579e",
"score": "0.7674311",
"text": "def songs\n Song.all.select {|song| song.artist == self}\n end",
"title": ""
},
{
"docid": "ce08465f725667432f9f94889bb73064",
"score": "0.76737916",
"text": "def songs\n Song.all.select {|songs| songs.artist == self}\n end",
"title": ""
},
{
"docid": "75db9a8bd7e82c58f2bf808fd9f457fa",
"score": "0.7632819",
"text": "def songs\n Song.all.select do |song_instance|\n song_instance.artist == self\n end\n end",
"title": ""
},
{
"docid": "e7ddcfed3483b2389afc052d056bf825",
"score": "0.7629558",
"text": "def songs\n Song.all.select {|song| song.artist == self }\n end",
"title": ""
},
{
"docid": "1e20ab1810c74721e42c7cecd1c8f2b4",
"score": "0.7619728",
"text": "def songs\n Song.all.select {|s| s.artist == self}\n end",
"title": ""
},
{
"docid": "d45e170946d7ace7e750d43213f77aff",
"score": "0.76166326",
"text": "def songs\n Song.all.select {|song| song.artist == self}\n end",
"title": ""
},
{
"docid": "d45e170946d7ace7e750d43213f77aff",
"score": "0.76166326",
"text": "def songs\n Song.all.select {|song| song.artist == self}\n end",
"title": ""
},
{
"docid": "58e2ffc4eeabf0465dc51de7a4cfe1b4",
"score": "0.7615431",
"text": "def songs\n Song.all.select{|song| song.artist == self}\n end",
"title": ""
},
{
"docid": "2734e6fdc269e24bb6c7f55344005ca8",
"score": "0.76008296",
"text": "def songs\n Song.all.select{|song|song.artist == self}\n end",
"title": ""
},
{
"docid": "a24bb5929478e7f9439b298f12319e02",
"score": "0.7593976",
"text": "def songs\n Song.all.select do |song|\n song.artist == self.name\n end\n end",
"title": ""
},
{
"docid": "2b07a9d4e138167ed5e25b81e6474484",
"score": "0.75938576",
"text": "def songs \n Song.all.select do |e|\n e.artist == self\n end\n end",
"title": ""
},
{
"docid": "14159c71e2ef48019a015419e56bb55f",
"score": "0.75638336",
"text": "def songs\n Song.all.select {|song| song.artist == self}\n end",
"title": ""
},
{
"docid": "1f613341d6373e1dad662c9ca3fb3a5f",
"score": "0.7557476",
"text": "def songs\n Song.all.select do |song|\n song.artist == self\n end\n end",
"title": ""
},
{
"docid": "1f613341d6373e1dad662c9ca3fb3a5f",
"score": "0.7557476",
"text": "def songs\n Song.all.select do |song|\n song.artist == self\n end\n end",
"title": ""
},
{
"docid": "1f613341d6373e1dad662c9ca3fb3a5f",
"score": "0.7557476",
"text": "def songs\n Song.all.select do |song|\n song.artist == self\n end\n end",
"title": ""
},
{
"docid": "3896d27235cf2e10defd4eb387b18f92",
"score": "0.75517106",
"text": "def artists\n songs.collect do |song|\n song.artist\n end\n .uniq #does not return duplicate artists if the genre has more than one song by a particular artist (genre has many artists through songs)\n end",
"title": ""
},
{
"docid": "443728f7113c3d10254cdf5cf38b1bc2",
"score": "0.7547773",
"text": "def artists\n songs.map do |song|\n song.artist\n end\n end",
"title": ""
},
{
"docid": "443728f7113c3d10254cdf5cf38b1bc2",
"score": "0.7547773",
"text": "def artists\n songs.map do |song|\n song.artist\n end\n end",
"title": ""
},
{
"docid": "326e8b14d0b5ec0b1c9adfa330e247a2",
"score": "0.7547609",
"text": "def songs\n Song.all.select{|song| song.artist == self}\n end",
"title": ""
},
{
"docid": "d07cae30d802ce3479c6d948e23fb9e4",
"score": "0.7546786",
"text": "def songs\n Song.all.select do |song_instance|\n song_instance.artist == self \n end\n end",
"title": ""
},
{
"docid": "dbfbace99ace955aa8bb4ec29e501a8e",
"score": "0.754052",
"text": "def songs\n Song.all.select do |song| song.artist == self end\n end",
"title": ""
},
{
"docid": "73e736a74019e6d728fd40bcba1a443d",
"score": "0.7497015",
"text": "def songs\n Song.all.select do |song|\n song.artist == self \n end \n end",
"title": ""
},
{
"docid": "6a76dd6338fc1216efef51189f85acbb",
"score": "0.74965465",
"text": "def artists\n songs.map {|song| song.artist}\n end",
"title": ""
},
{
"docid": "a743af6a3676cd7c81d5dd706df55556",
"score": "0.74782604",
"text": "def artists(artist)\n if song.artist = nil || !Artist.find_by_name(name)\n song.artist = artist \n Artist.all << artist \n end \n end",
"title": ""
},
{
"docid": "e551abb1bc36f880c9688ead219dda51",
"score": "0.74732417",
"text": "def artists\n @songs.map { |m| m.artist }.uniq\n end",
"title": ""
},
{
"docid": "72abf54a7abcb2e2a6f6f4f89a527070",
"score": "0.7454245",
"text": "def artists\n @songs.collect do |song|\n song.artist\n end\n end",
"title": ""
},
{
"docid": "72abf54a7abcb2e2a6f6f4f89a527070",
"score": "0.7454245",
"text": "def artists\n @songs.collect do |song|\n song.artist\n end\n end",
"title": ""
},
{
"docid": "9f59f5c55d0a051ce3cd7e3accb07944",
"score": "0.74494356",
"text": "def artists\n @songs.collect{|song| song.artist}.uniq\n end",
"title": ""
},
{
"docid": "4ec7e0a136fac04cfefdbb88d61ba437",
"score": "0.7448132",
"text": "def artists\n artists = []\n self.songs.each do |song|\n artists << song.artist\n end\n artists.uniq\n end",
"title": ""
},
{
"docid": "100409831de6eb372501af68fc836e96",
"score": "0.7437871",
"text": "def songs\n Song.all.select do |song|\n song.artist == self\n end\n end",
"title": ""
},
{
"docid": "369e8ddb2d4e2777439f2a277bff030c",
"score": "0.7437729",
"text": "def songs # to entre the Song class then within the song class take the class variable all to use to select and go thought the songs listed in that array\n Song.all.select { |song| song.artist == self } # use the .select to gather the information we want from the all array in songs - go thought and assign each song artist to this current instance\n end",
"title": ""
},
{
"docid": "0ce2ab770a55edeb6456712eeb3ef5de",
"score": "0.7432813",
"text": "def artists\n self.songs.map {|song| song.artist}\n end",
"title": ""
},
{
"docid": "c86d0937ebd78a4db670a85fca020de4",
"score": "0.74252397",
"text": "def artists\n self.songs.collect{|song| song.artist}\n end",
"title": ""
},
{
"docid": "1cf6867900f8ba4cbdce1eb67a7ddfd1",
"score": "0.7417887",
"text": "def songs \n Song.all.select {|song| song.artist == self}\n end",
"title": ""
},
{
"docid": "70a06278c4ebdd4d10f454e98c2fef7d",
"score": "0.74160796",
"text": "def artists\n songs.collect do |song|\n song.artist\n\n end\nend",
"title": ""
},
{
"docid": "12d5f3a59e81ef64f649b7f14d950083",
"score": "0.7414687",
"text": "def find_artists\n album_ids = []\n album_results = CONNECTION.execute(\"SELECT * FROM albums_styles WHERE style_id = #{@id};\")\n album_results.each do |hash|\n album_ids << hash[\"album_id\"]\n end\n artist_ids = []\n artist_results = CONNECTION.execute(\"SELECT * FROM albums_artists WHERE album_id IN (#{album_ids.join(\",\")})\")\n artist_results.each do |hash|\n artist_ids << hash[\"artist_id\"]\n end\n \n Artist.find_many(artist_ids)\n end",
"title": ""
},
{
"docid": "be58d7845d8dd6ad10ed9d5c2bd03943",
"score": "0.73578304",
"text": "def artists\nSong.all.collect{|x| x.artist}\nend",
"title": ""
},
{
"docid": "f477e895ab066f14bd14aa6174cb3b91",
"score": "0.73537886",
"text": "def artists\n # - this method will show the connection between songs and artists \n self.songs.collect do |f| \n f.artist\n end\n end",
"title": ""
},
{
"docid": "886775cbe705e97d1aef3c817ddf9e69",
"score": "0.7192395",
"text": "def artists\n genre_artists = []\n Song.all.each {|song|\n if song.genre == self &&\n !genre_artists.include?(song.artist)\n genre_artists << song.artist\n end\n }\n genre_artists\n end",
"title": ""
},
{
"docid": "0c9f527e4da0954b9f10ac08d78759f4",
"score": "0.717444",
"text": "def artists\n @songs.collect do |song| #<Song:0x007f874c4eeed8 @artist=#<Artist:0x007f874c4ef0b8 @name=\"Jay-Z\", @songs=[#<Song:0x007f874c4eeed8 ...>]>, @genre=#<Genre:0x007f874c4ef018 @name=\"rap\", @songs=[#<Song:0x007f874c4eeed8 ...>]>, @name=\"99 Problems\">\n song.artist ##<Artist:0x007f874c4ef0b8 @name=\"Jay-Z\", @songs=[#<Song:0x007f874c4eeed8 @artist=#<Artist:0x007f874c4ef0b8 ...>, @genre=#<Genre:0x007f874c4ef018 @name=\"rap\", @songs=[#<Song:0x007f874c4eeed8 ...>]>, @name=\"99 Problems\">]>\n end\n end",
"title": ""
},
{
"docid": "3305816c3f226c49072c20f767d431a0",
"score": "0.7157779",
"text": "def songs\n Song.all.select do |song|\n song.artist == self\n end\nend",
"title": ""
},
{
"docid": "1e2fe4798f4e5aaad50c1fa4065a4b11",
"score": "0.71475923",
"text": "def songs_found\n get_songs\n return @songs\n end",
"title": ""
},
{
"docid": "35bdcd016c7fc042919fe2bbec9a5677",
"score": "0.71315193",
"text": "def songs\n Song.all.select { |x| x.artist == self}\nend",
"title": ""
},
{
"docid": "895256e3b9913fe13c09c4bb5e448640",
"score": "0.70885694",
"text": "def artists\n self.songs.collect {|song| song.artist}\nend",
"title": ""
},
{
"docid": "e1833c731448e5f33eb04ad6dfd56587",
"score": "0.7075609",
"text": "def artists # it looks like a reader but it's more complicated\n # a has many through\n @songs.collect{|song| song.artist}.uniq #=> This is called a <<has-many-through>>\n end",
"title": ""
},
{
"docid": "f6b082e1f55ba8d8508c3e5e438bbdd2",
"score": "0.7051929",
"text": "def find_photographs_by_artist(artist)\n artist_photos = []\n @photographs.each do |photograph|\n if photograph[:artist_id] == artist[:id]\n artist_photos << photograph\n end\n end\n artist_photos\n end",
"title": ""
},
{
"docid": "7f6c7ea4ae278152b196c91b0f3cb262",
"score": "0.703123",
"text": "def songs\n Song.find_by_album(@id)\n end",
"title": ""
},
{
"docid": "50d6a91398480798acde98c9a20af66b",
"score": "0.7017803",
"text": "def songs\n # Select each song and set the artist value for it equal to the instance\n # of Artist that this method is being called on (self).\n Song.all.select do |song|\n song.artist == self\n end\n end",
"title": ""
},
{
"docid": "f1646facc26cf301a8fce4325e8f65f1",
"score": "0.6960284",
"text": "def artist()\n sql = \"SELECT * FROM artists WHERE id = $1\"\n values = [@artist_id]\n artists = SqlRunner.run(sql, values)\n result = artists.map {|artist| Artist.new(artist)}\n return result\n end",
"title": ""
},
{
"docid": "bb12d73421f863912952f0bd1ea13e01",
"score": "0.6934917",
"text": "def artists\n songs.map do |song|\n song.artist\n # binding.pry\n end\n end",
"title": ""
},
{
"docid": "61a152f69aeb118782ab47468245802b",
"score": "0.6926655",
"text": "def track_artists\n @tracks.collect{ |t| t.artist }.compact.uniq\n end",
"title": ""
},
{
"docid": "9b767afb80a6b686b0f513d595fef1a5",
"score": "0.6884578",
"text": "def print_songs\n Song.all.each do |song|\n if song.artist == self \n puts song.name\n end \n end \n end",
"title": ""
},
{
"docid": "0f0d2f6c871a71175760cc64dadbbc9b",
"score": "0.6855135",
"text": "def find_song(artist, url_slug)\n\n\t\tartist.songs.uniq.each do |song|\n\t\t\tif song.song_url_slug == url_slug\n\t\t\t\t@song = song\n\n\t\t\telse\n\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "7931ee4211e5495a5c37a794944267eb",
"score": "0.68467623",
"text": "def songs\n # @@songs.select { |song| song.name == @name }\n @songs\n end",
"title": ""
},
{
"docid": "bd520582f55887d0df4f1e70e3226b7b",
"score": "0.6797577",
"text": "def albums\n sql = \"SELECT * FROM albums WHERE artist_id = #{@id};\"\n #Select all from albums when the id of the artist we are working on matched the artist_id in albums\n album_list = SqlRunner.run( sql )\n # Save the array to a varibale\n return album_list.map { |album| Album.new(album) }\n # Map the array to a hash.\n end",
"title": ""
},
{
"docid": "6eb9788eaf608416736bb86dedb46114",
"score": "0.6788331",
"text": "def view_artist_songs(artist)\n artist_name = artist\n artist_id = Artist.find_by(name: artist_name).id\n songs = Song.where(artist_id: artist_id).map{|song| song.name}\n puts \"**************************\"\n puts \"**************************\"\n prompt(\"#{artist_name}'s songs\", songs)\n end",
"title": ""
},
{
"docid": "60b5aed67e2556315fa1044887be8500",
"score": "0.67660797",
"text": "def add_song(song)\n # song.artist = self # assigns the current artist to the song's 'artist' property (song belongs to artist)\n #@songs << song #adds the song to the current artist's 'songs' collection \n ##does not assign the artist if the song already has an artist\n if song.artist == self\n song.artist\n else\n song.artist = self\n end \n # does not add the song to the current artist's collection of songs if it already exists therein\n if songs.include?(song)\n song\n else\n songs << song\n end \n songs\n end",
"title": ""
},
{
"docid": "c4b883642535a72b8dc72288afa042df",
"score": "0.67151105",
"text": "def search_songs(query)\n search('Songs', query)\n end",
"title": ""
},
{
"docid": "aa9cb928558c53dbc4e55943a0afc12f",
"score": "0.6712509",
"text": "def get_artist(artist_id)\n query_and_build \"artists/#{artist_id}\"\n end",
"title": ""
},
{
"docid": "5d91b819b34c620cb9e4fa47aaed8f03",
"score": "0.6683649",
"text": "def all_by_artist()\n\n sql = \"\n SELECT * FROM albums\n WHERE artist_id = $1;\n \"\n\n album_hashes = SqlRunner.run(sql, [@id])\n album_list = album_hashes.map {|album_hash| Album.new(album_hash)}\n return album_list\n\nend",
"title": ""
},
{
"docid": "965adb91a7a493d32d8f8e3c8282b5fa",
"score": "0.6674089",
"text": "def search_artist(artist)\n PeopleSearch.search_artist(artist, @api_key, @https)\n end",
"title": ""
},
{
"docid": "7324da3327193809aa69085de78fbd29",
"score": "0.66659355",
"text": "def list_songs_by_artist\n puts \"Please enter the name of an artist:\"\n input = gets.chomp\n if artist = Artist.find_by_name(input)\n sort_by_name = artist.songs.sort_by do |song|\n song.name\n end\n sort_by_name.each.with_index(1) do |song, i|\n puts \"#{i}. #{song.name} - #{song.genre.name}\"\n end\n end\n end",
"title": ""
},
{
"docid": "7f55b7cdd14d2ba1384a530f917f0cff",
"score": "0.66580665",
"text": "def search(artist, song)\n RSpotify.authenticate(ENV['SPOTIFY_CLIENT_ID'], ENV['SPOTIFY_CLIENT_SECRET'])\n result = RSpotify::Track.search(\"#{song} #{artist}\", limit: 1, market: 'US').first\n if !!result\n format_result(result)\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "f5e9165846c51fe90855b5dc3b16136b",
"score": "0.6657998",
"text": "def albums\n # binding.pry\n albums = CONN.execute(\"\n SELECT * FROM artists \n INNER JOIN albums\n ON artists.id = albums.artist_id\"\n )\n albums.map { |album| Album.new(album)}\n end",
"title": ""
},
{
"docid": "76d476779fb78a66780ebe90330c555d",
"score": "0.6642092",
"text": "def search_artist\n artist_query = @prompt.ask('What is the name of the artist?'.colorize(:light_green))\n artists = RSpotify::Artist.search(artist_query, limit: 5)\n cleaned_results = []\n artists.each { |a| cleaned_results << a.name.to_s }\n system('clear')\n selection = @prompt.select('Please select one of the search results:', cleaned_results)\n store_artist(selection)\n end",
"title": ""
},
{
"docid": "4a86cc0246512edd64fca19f5bacb46b",
"score": "0.66327894",
"text": "def get_suggestions(*artists)\n list = Echowrap.playlist_static(artist: artists, \n type: 'catalog',\n results: 100, \n limited_interactivity: true,\n seed_catalog: ECHONEST_KEYS['TASTE_PROFILE_ID'])\n final_list = []\n list.each do |song|\n final_list << PL.db.get_song_by_echonest_id(song.id) unless !PL.db.get_song_by_echonest_id(song.id)\n end\n final_list\n end",
"title": ""
},
{
"docid": "66183a261cc7e675987a3e6002d3c258",
"score": "0.66239166",
"text": "def artist_names\n artists.map do |artist|\n artist.name\n end\n end",
"title": ""
},
{
"docid": "fec6459344eb2ef0ed54cadfcc5f7b48",
"score": "0.6613878",
"text": "def initialize #initializes songs belonging to artist\r\n @song = artist\r\n end",
"title": ""
},
{
"docid": "7948a0fa77dc5940e67ad115799836d7",
"score": "0.66107094",
"text": "def artist_search(query={})\n result = self.class.get(\"/search/artists.json?query=#{query[:artist_name]}\")\n Songkickr::ArtistResult.new result\n end",
"title": ""
},
{
"docid": "1fa14992df8e80bdb40402ca7551f078",
"score": "0.6607203",
"text": "def all_songs\n end",
"title": ""
},
{
"docid": "f5c11d76127b12dfb6b1b5ebe08af1e8",
"score": "0.6606822",
"text": "def artist()\n sql = \"SELECT * FROM albums WHERE artist_id = $1\"\n values = [@id]\n results = SqlRunner.run(sql,values)\n artist_data = results[0]\n artist = Artist.new(artist_data)\n end",
"title": ""
},
{
"docid": "6cead94b5bf8701d383fee2492477b90",
"score": "0.6604667",
"text": "def index\n if (params.has_key?(:artist))\n searched_name = artist_params[:artist_name]\n found = Artist.all.select{|n| n.artist_name.downcase == searched_name.downcase}\n if found[0] != nil\n @artists = found\n else\n @artists = Artist.all.reverse_order\n require 'musicbrainz'\n @foundArtists = MusicBrainz::Artist.search(artist_params[:artist_name])\n # GEM GITHUB => https://github.com/localhots/musicbrainz\n end\n else\n @artists = Artist.all.reverse_order\n end\n @artist = Artist.new\n gon.next_artist_id = Artist.with_deleted.last.id + 1\n end",
"title": ""
},
{
"docid": "748dddaf64fb981a809d469655ea1ecf",
"score": "0.6566124",
"text": "def genres\n all_genres = []\n Song.all.each do |x|\n if x.artist == self\n all_genres << x.genre\n end\n end\nall_genres\nend",
"title": ""
},
{
"docid": "e553f2447d5903470d2fb3bf882ac699",
"score": "0.655814",
"text": "def song_plays\n SongPlay.where(:song_path => path)\n end",
"title": ""
},
{
"docid": "f6ad1ed9775c8118b254266b081cf09a",
"score": "0.65542257",
"text": "def list_track(artist_id)\n\t\tif @artist_list.has_key? artist_id\n\t\t\tartist_info = @artist_list[artist_id]\n\t\t\tartist_info.tracks.each do |track|\n puts \"------------ Track Info -------------\"\n\t\t\t\tputs track.to_s\n\t\t\tend\n\t\telse\n\t\t\tputs \"Artist with ID #{artist_id} does not exist in database!\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "c1724a8ec12cf57fb2fbd5fd89309762",
"score": "0.65504044",
"text": "def all_artists\n (track_artists() + artist()).compact.uniq\n end",
"title": ""
},
{
"docid": "228a3bd1e7ac9cb776a5ed96dfad6297",
"score": "0.65490025",
"text": "def display_song_with_artist(db)\n\tputs \"The songs with artist's name\"\n\tputs \"----------------------------\"\n\tsongs = db.execute(\"SELECT * FROM songlist;\")\n\tsongs.each do |song|\n\t\tputs \"SONG NAME: #{song['song_name']} ; ARTIST NAME: #{song['artist_name']}.\"\n\tend\nend",
"title": ""
},
{
"docid": "6f7e1de534a180f4949caf5dbd5cac54",
"score": "0.6546454",
"text": "def list_artist\n Artist.all.each.with_index(1) {|artist, i| puts \"#{i}. #{artist.name}\"}\n end",
"title": ""
},
{
"docid": "c62b3a1ab98959174430082636268809",
"score": "0.6536854",
"text": "def add_song(song)\n #associates a song to the artist's collection\n @songs << song\n song.artist = self\n end",
"title": ""
},
{
"docid": "92515a0c21e0121d694b5de0772e2a48",
"score": "0.6531573",
"text": "def add_song(song)\n song.artist = self\n end",
"title": ""
},
{
"docid": "92515a0c21e0121d694b5de0772e2a48",
"score": "0.6531573",
"text": "def add_song(song)\n song.artist = self\n end",
"title": ""
},
{
"docid": "92515a0c21e0121d694b5de0772e2a48",
"score": "0.6531573",
"text": "def add_song(song)\n song.artist = self\n end",
"title": ""
},
{
"docid": "92515a0c21e0121d694b5de0772e2a48",
"score": "0.6531573",
"text": "def add_song(song)\n song.artist = self\n end",
"title": ""
},
{
"docid": "92515a0c21e0121d694b5de0772e2a48",
"score": "0.6531573",
"text": "def add_song(song)\n song.artist = self\n end",
"title": ""
},
{
"docid": "92515a0c21e0121d694b5de0772e2a48",
"score": "0.6531573",
"text": "def add_song(song)\n song.artist = self\n end",
"title": ""
},
{
"docid": "7bebd8040da94dca8c50cc4e7bd911c7",
"score": "0.65286213",
"text": "def artist_names\n self.artists.collect do |n|\n n.name \n end\n end",
"title": ""
},
{
"docid": "969a5e1e4baa0125dc1fcc24f8f8bd58",
"score": "0.65239614",
"text": "def artist_images\n ArtistImage.find_by_artist_id(self.id)\n end",
"title": ""
},
{
"docid": "ca172427a007e8b247cc3cc6639713df",
"score": "0.651034",
"text": "def add_song(song)\n @songs << song\n song.artist = self\n\n end",
"title": ""
},
{
"docid": "1b869b57eba3a8fa988e51bdc6bbcb0e",
"score": "0.6509241",
"text": "def play_artist(user_entry)\n\t\tmsg = Array.new\n\t\t@songs.each do |song|\n\t\t\tif (user_entry == song.artist)\n\t\t\t\tmsg << song\n\t\t\tend\n\t\tend\n\n\t\tif (msg.empty?)\n\t\t\tmsg = msg.to_s\n\t\t\tmsg = \"That artist doesn't exist!\"\n\t\tend\n\n\t\treturn msg\n\tend",
"title": ""
},
{
"docid": "90d18ef43e04193b1bd34101076add85",
"score": "0.65078866",
"text": "def add_song(song)\n song.artist = self \n end",
"title": ""
},
{
"docid": "1a6a336cf192f46515ab8bc53ede0e2f",
"score": "0.6502075",
"text": "def retrieve_artists_by_label\n artistMap = Hash.new(nil)\n Artist.all.each do |rapper|\n if artistMap[rapper.label] == nil\n newArtistArr = []\n newArtistArr << rapper\n artistMap[rapper.label] = newArtistArr\n else\n existingArtistArr = artistMap[rapper.label]\n existingArtistArr << rapper\n end\n end\n artistMap\n end",
"title": ""
},
{
"docid": "c8b0b94339d68dc464b7f2dc9357ab0f",
"score": "0.64993215",
"text": "def artists\n @artists ||= artists_raw.map {|a| @session.artist.build(:name => a) }\n end",
"title": ""
},
{
"docid": "41ed7e5961780040ab4fe8d145712c13",
"score": "0.6495457",
"text": "def add_song(song)\n @songs << song\n song.artist = self\nend",
"title": ""
},
{
"docid": "82698c86f564bbdcadab48919658074c",
"score": "0.6494305",
"text": "def set_song_and_artist\n\t\t@artist = Artist.find(params[:artist_id])\n\t @song = Song.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "dcdfe6de2f80c5616f0741831008018c",
"score": "0.6493388",
"text": "def index\n @songs = Song.all\n @songs_with_names = Song.all.map{|s| [s, s.artist ? s.artist.name : \"\"]}\n end",
"title": ""
}
] |
0fbdc94a304a049097013e77bc9a500d
|
Set the value of the SecurityToken input for this Choreo.
|
[
{
"docid": "9add1465b6e21c628dd9d20251e8cc42",
"score": "0.7984486",
"text": "def set_SecurityToken(value)\n set_input(\"SecurityToken\", value)\n end",
"title": ""
}
] |
[
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "e7d7dafd2b1227377badf026162492f1",
"score": "0.5834737",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "a5bd862d7712f9bdf20603006edad8e8",
"score": "0.5776605",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "a5bd862d7712f9bdf20603006edad8e8",
"score": "0.5776605",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "a5bd862d7712f9bdf20603006edad8e8",
"score": "0.5776605",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "a5bd862d7712f9bdf20603006edad8e8",
"score": "0.5776605",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "a5bd862d7712f9bdf20603006edad8e8",
"score": "0.5776605",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "a5bd862d7712f9bdf20603006edad8e8",
"score": "0.5776605",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "a5bd862d7712f9bdf20603006edad8e8",
"score": "0.5776605",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "a5bd862d7712f9bdf20603006edad8e8",
"score": "0.5776605",
"text": "def set_Token(value)\n set_input(\"Token\", value)\n end",
"title": ""
},
{
"docid": "1d9c4ea3273840d63bfcd75a4d3c917d",
"score": "0.56258845",
"text": "def set_token=(token)\n @token = token\n end",
"title": ""
},
{
"docid": "5804d8dcc7c5b3bf19d522ef64309d1b",
"score": "0.5583006",
"text": "def set_TokenId(value)\n set_input(\"TokenId\", value)\n end",
"title": ""
},
{
"docid": "c5c16b2614491b42b0f6e01d51fb6b29",
"score": "0.5465578",
"text": "def set_SessionToken(value)\n set_input(\"SessionToken\", value)\n end",
"title": ""
},
{
"docid": "c5c16b2614491b42b0f6e01d51fb6b29",
"score": "0.5465578",
"text": "def set_SessionToken(value)\n set_input(\"SessionToken\", value)\n end",
"title": ""
},
{
"docid": "c5c16b2614491b42b0f6e01d51fb6b29",
"score": "0.5465578",
"text": "def set_SessionToken(value)\n set_input(\"SessionToken\", value)\n end",
"title": ""
},
{
"docid": "c5c16b2614491b42b0f6e01d51fb6b29",
"score": "0.5465578",
"text": "def set_SessionToken(value)\n set_input(\"SessionToken\", value)\n end",
"title": ""
},
{
"docid": "c5c16b2614491b42b0f6e01d51fb6b29",
"score": "0.546341",
"text": "def set_SessionToken(value)\n set_input(\"SessionToken\", value)\n end",
"title": ""
},
{
"docid": "c5c16b2614491b42b0f6e01d51fb6b29",
"score": "0.546341",
"text": "def set_SessionToken(value)\n set_input(\"SessionToken\", value)\n end",
"title": ""
},
{
"docid": "c5c16b2614491b42b0f6e01d51fb6b29",
"score": "0.546341",
"text": "def set_SessionToken(value)\n set_input(\"SessionToken\", value)\n end",
"title": ""
},
{
"docid": "c5c16b2614491b42b0f6e01d51fb6b29",
"score": "0.546341",
"text": "def set_SessionToken(value)\n set_input(\"SessionToken\", value)\n end",
"title": ""
},
{
"docid": "c5c16b2614491b42b0f6e01d51fb6b29",
"score": "0.546341",
"text": "def set_SessionToken(value)\n set_input(\"SessionToken\", value)\n end",
"title": ""
},
{
"docid": "c5c16b2614491b42b0f6e01d51fb6b29",
"score": "0.546341",
"text": "def set_SessionToken(value)\n set_input(\"SessionToken\", value)\n end",
"title": ""
},
{
"docid": "c5c16b2614491b42b0f6e01d51fb6b29",
"score": "0.546341",
"text": "def set_SessionToken(value)\n set_input(\"SessionToken\", value)\n end",
"title": ""
},
{
"docid": "c5c16b2614491b42b0f6e01d51fb6b29",
"score": "0.546341",
"text": "def set_SessionToken(value)\n set_input(\"SessionToken\", value)\n end",
"title": ""
},
{
"docid": "fbc7f3ad5f8eb51f40ffb198dc31e88d",
"score": "0.5462207",
"text": "def set_token(token)\n @token = token\n end",
"title": ""
},
{
"docid": "c2c1dfda457b63ae0f8a1706243caeb9",
"score": "0.54541665",
"text": "def set_TokenSecret(value)\n set_input(\"TokenSecret\", value)\n end",
"title": ""
},
{
"docid": "c2c1dfda457b63ae0f8a1706243caeb9",
"score": "0.54541665",
"text": "def set_TokenSecret(value)\n set_input(\"TokenSecret\", value)\n end",
"title": ""
},
{
"docid": "c2c1dfda457b63ae0f8a1706243caeb9",
"score": "0.54541665",
"text": "def set_TokenSecret(value)\n set_input(\"TokenSecret\", value)\n end",
"title": ""
},
{
"docid": "c2c1dfda457b63ae0f8a1706243caeb9",
"score": "0.54541665",
"text": "def set_TokenSecret(value)\n set_input(\"TokenSecret\", value)\n end",
"title": ""
},
{
"docid": "c2c1dfda457b63ae0f8a1706243caeb9",
"score": "0.54541665",
"text": "def set_TokenSecret(value)\n set_input(\"TokenSecret\", value)\n end",
"title": ""
},
{
"docid": "c2c1dfda457b63ae0f8a1706243caeb9",
"score": "0.54541665",
"text": "def set_TokenSecret(value)\n set_input(\"TokenSecret\", value)\n end",
"title": ""
},
{
"docid": "c2c1dfda457b63ae0f8a1706243caeb9",
"score": "0.54541665",
"text": "def set_TokenSecret(value)\n set_input(\"TokenSecret\", value)\n end",
"title": ""
},
{
"docid": "c2c1dfda457b63ae0f8a1706243caeb9",
"score": "0.54541665",
"text": "def set_TokenSecret(value)\n set_input(\"TokenSecret\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.54503876",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.54503876",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.54503876",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.54503876",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "eaf9ac7d29c6bee61fe53edfe49fccb4",
"score": "0.5448804",
"text": "def set_UserToken(value)\n set_input(\"UserToken\", value)\n end",
"title": ""
},
{
"docid": "3541c3740c1fb300416a35a728444f16",
"score": "0.5424647",
"text": "def set_SecurityGroupId(value)\n set_input(\"SecurityGroupId\", value)\n end",
"title": ""
},
{
"docid": "8e6e955883286472932b5805c51df8a9",
"score": "0.54193544",
"text": "def token=(token)\n write_attribute :token, token\n end",
"title": ""
},
{
"docid": "d429d0eecc0387476b6f6d1966792419",
"score": "0.538903",
"text": "def security_identifier=(value)\n @security_identifier = value\n end",
"title": ""
},
{
"docid": "d429d0eecc0387476b6f6d1966792419",
"score": "0.538903",
"text": "def security_identifier=(value)\n @security_identifier = value\n end",
"title": ""
},
{
"docid": "68b1edf16d40d3fe18a63236b1087ea6",
"score": "0.5345231",
"text": "def token=(value)\n @token = value\n end",
"title": ""
},
{
"docid": "891c2a136161392714e2e1643a27cfe6",
"score": "0.53441197",
"text": "def token=(token)\n @token = token\n end",
"title": ""
},
{
"docid": "891c2a136161392714e2e1643a27cfe6",
"score": "0.53441197",
"text": "def token=(token)\n @token = token\n end",
"title": ""
},
{
"docid": "1cbe09a6213164419163ef2a5fa6d371",
"score": "0.5327962",
"text": "def set_OauthToken(value)\n set_input(\"OauthToken\", value)\n end",
"title": ""
},
{
"docid": "1cbe09a6213164419163ef2a5fa6d371",
"score": "0.5327962",
"text": "def set_OauthToken(value)\n set_input(\"OauthToken\", value)\n end",
"title": ""
},
{
"docid": "1cbe09a6213164419163ef2a5fa6d371",
"score": "0.5327962",
"text": "def set_OauthToken(value)\n set_input(\"OauthToken\", value)\n end",
"title": ""
},
{
"docid": "1cbe09a6213164419163ef2a5fa6d371",
"score": "0.5327962",
"text": "def set_OauthToken(value)\n set_input(\"OauthToken\", value)\n end",
"title": ""
},
{
"docid": "1cbe09a6213164419163ef2a5fa6d371",
"score": "0.5327962",
"text": "def set_OauthToken(value)\n set_input(\"OauthToken\", value)\n end",
"title": ""
},
{
"docid": "1cbe09a6213164419163ef2a5fa6d371",
"score": "0.5327962",
"text": "def set_OauthToken(value)\n set_input(\"OauthToken\", value)\n end",
"title": ""
},
{
"docid": "1cbe09a6213164419163ef2a5fa6d371",
"score": "0.5327962",
"text": "def set_OauthToken(value)\n set_input(\"OauthToken\", value)\n end",
"title": ""
},
{
"docid": "1cbe09a6213164419163ef2a5fa6d371",
"score": "0.5327962",
"text": "def set_OauthToken(value)\n set_input(\"OauthToken\", value)\n end",
"title": ""
},
{
"docid": "1cbe09a6213164419163ef2a5fa6d371",
"score": "0.5327962",
"text": "def set_OauthToken(value)\n set_input(\"OauthToken\", value)\n end",
"title": ""
},
{
"docid": "1cbe09a6213164419163ef2a5fa6d371",
"score": "0.5327962",
"text": "def set_OauthToken(value)\n set_input(\"OauthToken\", value)\n end",
"title": ""
},
{
"docid": "1cbe09a6213164419163ef2a5fa6d371",
"score": "0.5327962",
"text": "def set_OauthToken(value)\n set_input(\"OauthToken\", value)\n end",
"title": ""
},
{
"docid": "1cbe09a6213164419163ef2a5fa6d371",
"score": "0.5327962",
"text": "def set_OauthToken(value)\n set_input(\"OauthToken\", value)\n end",
"title": ""
},
{
"docid": "1cbe09a6213164419163ef2a5fa6d371",
"score": "0.5327962",
"text": "def set_OauthToken(value)\n set_input(\"OauthToken\", value)\n end",
"title": ""
}
] |
339729f3253e477d8660dfea2feb3436
|
decode an error message into a protobuf reset message
|
[
{
"docid": "493a1a7d528710defd91b4cd904569a6",
"score": "0.7447884",
"text": "def decode_err(err)\n\t\treturn Netbat::Msg.new(\n\t\t\t:op_code => Netbat::Msg::OpCode::RESET,\n\t\t\t:err => err.msg,\n\t\t\t:err_type => err.err_type\n\t\t)\n\tend",
"title": ""
}
] |
[
{
"docid": "39419d668e015b34779412930a2f4b7d",
"score": "0.6542626",
"text": "def decode_message(bytes)\n raise \"Empty message\" if bytes.empty?\n reserved, schema_id, avro = bytes.unpack('cNa*')\n raise \"Reserved byte #{reserved.inspect} in message header (expected 0)!\\nmessage: #{bytes.inspect}\" unless 0 == reserved\n\n reader = reader_for(schema_id)\n decoder = Avro::IO::BinaryDecoder.new(StringIO.new(avro))\n\n wrap_error \"parsing message with schema #{schema_id}\" do\n [reader.writers_schema, reader.read(decoder)]\n end\n end",
"title": ""
},
{
"docid": "d9f587f562f4e954c068da5ce2d15d22",
"score": "0.6394024",
"text": "def decode_message(message)\n # minimum size is header (4) + type (1)\n return if message.length < 5\n header, type = message.unpack('NC')\n # TODO: handle fragmented responses\n return if header != UNFRAGMENTED_HEADER\n [type, message[5, message.length]]\n end",
"title": ""
},
{
"docid": "c344adda4837396cbed9d6123d733ad4",
"score": "0.63448036",
"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": "d54d0fa03931e520344f1504a6a9b1e9",
"score": "0.58472353",
"text": "def decode(message)\n start_time= Time.now\n @message = message\n qio = QIO.new(@message)\n begin\n @length, @message_type = qio.message_header()\n @value = qio.read_item()\n rescue QException => qe\n @exception = qe\n end\n end",
"title": ""
},
{
"docid": "d4e51d9b805e3a4facc3d9cb5c0605ba",
"score": "0.57919514",
"text": "def read_message(s)\n if buffer = s.read(4) and buffer.size == 4\n length = buffer.unpack('N').first\n begin\n str = s.read length\n message = UState::Message.decode str\n rescue => e\n puts \"Message was #{str.inspect}\"\n raise\n end\n \n unless message.ok\n puts \"Failed\"\n raise ServerError, message.error\n end\n \n message\n else\n raise InvalidResponse, \"unexpected EOF\"\n end\n end",
"title": ""
},
{
"docid": "0c459b4646e3449aea70abbbd61e63aa",
"score": "0.5770175",
"text": "def read_message(s)\n if buffer = s.read(4) and buffer.size == 4\n length = buffer.unpack('N').first\n begin\n str = s.read length\n message = Riemann::Message.decode str\n rescue => e\n puts \"Message was #{str.inspect}\"\n raise\n end\n\n unless message.ok\n puts \"Failed\"\n raise ServerError, message.error\n end\n\n message\n else\n raise InvalidResponse, \"unexpected EOF\"\n end\n end",
"title": ""
},
{
"docid": "0ff834186944208397e766b867e9bc09",
"score": "0.569524",
"text": "def decode_rle(msg)\n vprint_status \"Before decoding: #{msg}\"\n msg.gsub /.\\*./ do |match|\n match.bytes.to_a.first.chr * (match.bytes.to_a.last - 29 + 1)\n end\n end",
"title": ""
},
{
"docid": "51ecb5da1acbbffd4b04ebc9b5981c7c",
"score": "0.55488896",
"text": "def decodemsg(msg)\n YAML.load(msg.payload)\n end",
"title": ""
},
{
"docid": "cc7ece9f8817a0dc468efcc315558364",
"score": "0.55031574",
"text": "def error_state\n @bytes.uint8(7)\n end",
"title": ""
},
{
"docid": "49e826750bce7ba55636681f7a6f9f44",
"score": "0.55008155",
"text": "def decode_message(data, schema_name: nil, namespace: @namespace)\n readers_schema = schema_name && @schema_store.find(schema_name, namespace)\n stream = StringIO.new(data)\n decoder = Avro::IO::BinaryDecoder.new(stream)\n\n # The first byte is MAGIC!!!\n magic_byte = decoder.read(1)\n\n if magic_byte != MAGIC_BYTE\n raise \"Expected data to begin with a magic byte, got `#{magic_byte.inspect}`\"\n end\n\n # The schema id is a 4-byte big-endian integer.\n schema_id = decoder.read(4).unpack(\"N\").first\n\n writers_schema = @schemas_by_id.fetch(schema_id) do\n schema_json = @registry.fetch(schema_id)\n @schemas_by_id[schema_id] = Avro::Schema.parse(schema_json)\n end\n\n reader = Avro::IO::DatumReader.new(writers_schema, readers_schema)\n message = reader.read(decoder)\n\n DecodedMessage.new(schema_id, writers_schema, readers_schema, message)\n rescue Excon::Error::NotFound\n raise SchemaNotFoundError.new(\"Schema with id: #{schema_id} is not found on registry\")\n end",
"title": ""
},
{
"docid": "6ec6c541578d1cd923c26ce245780229",
"score": "0.54822385",
"text": "def parse_error_message(error)\n if error.http_body.blank? || !is_json?(error.http_body)\n error.message\n else\n begin\n error_hash = JSON.parse(error.http_body)\n if error_hash.has_key?('message')\n # check if hash can be parsed further\n message = error_hash['message']\n if message.index('{').nil?\n return message\n else\n # attempt to extract nested JSON from message\n json_start = message.index('{')\n json = message[json_start, message.size + 1]\n new_message = JSON.parse(json)\n if new_message.has_key?('message')\n new_message['message']\n else\n new_message\n end\n end\n else\n return error.message\n end\n rescue => e\n # reporting error doesn't help, so ignore\n Rails.logger.error e.message\n error.message + ': ' + error.http_body\n end\n end\n end",
"title": ""
},
{
"docid": "6807bc8327db6e7c5f2e30d04174ee62",
"score": "0.5477144",
"text": "def decode(data, schema_name: nil, namespace: @namespace)\n decode_message(data, schema_name: schema_name, namespace: namespace).message\n end",
"title": ""
},
{
"docid": "10dd8c136837b68c0dd5bc1b9e70c76e",
"score": "0.54569",
"text": "def error_for_message(msg)\n unless @errors\n with_reader do |conn|\n @errors = (0..127).inject({}) do |h, err|\n h[conn.err2string(err)] = err; h\n end\n end\n @errors.delete(\"Unknown error\")\n end\n @errors[msg]\n end",
"title": ""
},
{
"docid": "beb1499d866289f1f8808b48a2b137e3",
"score": "0.5331068",
"text": "def decode(string)\n Marshal.load(string.unpack('m').first)\n end",
"title": ""
},
{
"docid": "d0039f8fcb65f686315c0ec1e2db5e02",
"score": "0.5330111",
"text": "def decode(msg)\n if(msg.to_s(2).length == 112)\n df, ca, icao, me, pi = self.parse_segment_msg(msg)\n if(self.is_identification_tc(me))\n return (error, tc, ca, name = self.decode_icao_value(me))\n end\n\n else\n return \"NOT_VALID_LENGTH_TRAME\", nil\n end\n end",
"title": ""
},
{
"docid": "a0554a1fbb65ab1c221b765ecddd879c",
"score": "0.5321784",
"text": "def extract_message(data)\n # interpret input data as binary\n data.force_encoding(\"binary\")\n obj = nil\n bin = nil\n if data =~ /^(\\d+):(\\d+)\\{/\n length_length = $1.size + 1 + $2.size\n overall_length, json_length = $1.to_i, $2.to_i\n\n if data.size >= length_length + overall_length\n data.slice!(0..(length_length-1))\n\n json = data.slice!(0..json_length-1)\n # there shouldn't be any non ascii-7-bit characters, transcode just to be sure\n # encode from binary to utf-8 with :undef => :replace turns all non-ascii-7-bit bytes\n # into the replacement character (\\uFFFD)\n json.encode!(\"utf-8\", :undef => :replace)\n obj = json_to_object(json)\n\n # we already forced data to be binary encoded\n bin = data.slice!(0..(overall_length-json_length)-1)\n end\n end\n if obj\n unescape_all_strings(obj)\n type = obj[\"_message\"]\n obj.delete(\"_message\")\n Message.new(type, obj, bin)\n else\n nil\n end\nend",
"title": ""
},
{
"docid": "f13288c792a9c0eb95747477c7a69d51",
"score": "0.5303615",
"text": "def load(data)\n code, hash = MessagePack.unpack(data)\n CODE_TO_CLASS[code].new(decode_hash(hash).symbolize_keys)\n rescue MessagePack::UnpackError => e\n _log.warn { \"Failed to decode message\" }\n _log_exception(e)\n Models::Message::Garbled.new\n end",
"title": ""
},
{
"docid": "ca6f98220a665db832221b248ffe776f",
"score": "0.5250528",
"text": "def decode_remote_errors(data, options={})\n data.present? ? (Hash===data ? data : {base: data}) : {}\n end",
"title": ""
},
{
"docid": "2aa69512b50bedaa6bf1ff8def6fa3f3",
"score": "0.52055204",
"text": "def error!(msg)\n raise BinaryStreamException.new(msg + \" [ofs=#{@ofs}; next=#{@data[@ofs,16].unpack(\"H2\"*16)}]\")\n end",
"title": ""
},
{
"docid": "00b5e3621f0a87aafede221b35975ad0",
"score": "0.516414",
"text": "def read_message bytes, state=nil\n read_message! bytes.dup, state\n end",
"title": ""
},
{
"docid": "4a6b1e1faf0249bb70eda5d60239a991",
"score": "0.51553595",
"text": "def parse message\n\t\t\treturn nil unless message.valid_encoding?\n\t\t\tmessage = message.dup\n\t\t\tprefix = message.slice!(/\\S+/)\n\t\t\treturn nil unless prefix\n\t\t\tid, command = prefix.scan(/(\\d+:)?(\\w+)/).flatten\n\t\t\tid = id.delete(\":\").to_i if id\n\t\t\tid = nil if id == 0\n\t\t\tif message.include?(':')\n\t\t\t\tmessage = Hash[*message.scan(/(\\w+):([^:\\s]+)/).flatten].symbolize_keys if message.include?(':')\n\t\t\t\tmessage.each_key {|k| message[k] = message[k].to_i if message[k].is_numeric?}\n\t\t\telse\n\t\t\t\tmessage.delete!(' ')\n\t\t\tend\n\t\t\treturn [id, command, message]\n\t\tend",
"title": ""
},
{
"docid": "87e8258466c2967a19c0ec942279baa9",
"score": "0.51500595",
"text": "def message # :nodoc:\n @properties['errorMessage'].dup\n end",
"title": ""
},
{
"docid": "4e4161ef49a53886e574f09e13bf4037",
"score": "0.5139508",
"text": "def message_from(response)\n if not response.has_key?(:ErrInfo)\n return 'Success'\n end\n\n # The ErrInfo key can contain a | separated string of multiple error\n # codes. By default we start at the end and work our way backwards to\n # try and find the highest-level one we can.\n if response[:ErrInfo].index('|')\n error_codes = response[:ErrInfo].split('|')\n else\n error_codes = [response[:ErrInfo]]\n end\n\n error_codes.reverse.each do |code|\n if ERROR_CODES.has_key?(code)\n return ERROR_CODES[code]\n end\n end\n\n \"Error #{error_codes[-1]}\"\n end",
"title": ""
},
{
"docid": "19ff520c3ef373d08faa05aca896117d",
"score": "0.51330805",
"text": "def unpack(message)\n result = if(message[:content])\n message[:content]\n else\n if(message[:message])\n case determine_style(message)\n when :sqs\n if(message[:message]['Body'])\n message[:message]['Body'].to_smash\n else\n message[:message].to_smash\n end\n when :http\n begin\n MultiJson.load(message[:message][:body]).to_smash\n rescue MultiJson::DecodeError\n message[:message][:body].to_smash\n end\n when :nsq\n begin\n MultiJson.load(message[:message].message).to_smash\n rescue MultiJson::DecodeError\n message[:message].message.to_smash\n end\n else\n message[:message].to_smash\n end\n else\n message.to_smash\n end\n end\n if(respond_to?(:formatters) && respond_to?(:service_name))\n formatters.each do |formatter|\n next if result.fetch(:formatters, []).include?(formatter.class.name)\n begin\n if(service_name.to_sym == formatter.destination)\n debug \"Service matched formatter for pre-format! (<#{formatter.class}> - #{message})\"\n s_checksum = result.checksum\n formatter.format(result)\n unless(s_checksum == result.checksum)\n info \"Pre-formatter modified payload and will not be applied again after callback completion (<#{formatter.class}> - #{message})\"\n result[:formatters].push(formatter.class.name)\n end\n end\n rescue => e\n error \"Formatter failed <#{formatter.source}:#{formatter.destination}> #{e.class}: #{e}\"\n end\n end\n end\n result\n end",
"title": ""
},
{
"docid": "a6baf6f0e6f6e4f3ed928a8e04a6f443",
"score": "0.5124848",
"text": "def decode\n state = :normal\n decoded = buffer.reduce [] do |acc, byte|\n case state\n when :normal\n if byte == 0x7d\n state = :special\n else\n acc << byte\n end\n when :special\n state = :normal\n acc << (byte ^ 0x20)\n end\n acc\n end\n Packet.new decoded\n end",
"title": ""
},
{
"docid": "2b87c2a0e4da478f9d0551a0f9d66679",
"score": "0.5116668",
"text": "def parse_error(body)\n message = \"\"\n if body['reasons']\n reasons = body['reasons'].map do |reason|\n \"Error #{reason['code']}: #{reason['message']}\"\n end\n message += reasons.join(', ')\n end\n message\n end",
"title": ""
},
{
"docid": "80a3d5b9bf8d77e33519ca94e59b6805",
"score": "0.51090366",
"text": "def parse_body(buffer)\n super(buffer)\n @id = shift_short(buffer)\n\n return if buffer.empty?\n raise ProtocolException, 'Extra bytes at end of Unsubscribe Acknowledgment packet'\n end",
"title": ""
},
{
"docid": "d871c6bc0832f7cd9c9a020782a4b9f6",
"score": "0.5063465",
"text": "def error_message(response)\n json = parse_as_json(response)\n json.dig('error', 'message')\n rescue UnexpectedResponseError\n summary = \"Status: #{response.code}; Body: #{response.body}\"\n \"Could not parse error message. #{summary}\"\n end",
"title": ""
},
{
"docid": "a0d60a29d471714b77ec1486b375278b",
"score": "0.50536746",
"text": "def mssql_parse_error(data, info)\n\t\tlen = data.slice!(0,2).unpack('v')[0]\n\t\tbuff = data.slice!(0,len)\n\n\t\terrno,state,sev,elen = buff.slice!(0,8).unpack('VCCv')\n\t\temsg = buff.slice!(0,elen * 2)\n\t\temsg.gsub!(\"\\x00\", '')\n\n\t\tinfo[:errors] << \"SQL Server Error ##{errno} (State:#{state} Severity:#{sev}): #{emsg}\"\n\t\tinfo\n\tend",
"title": ""
},
{
"docid": "bf675d3cabfd02de8fec1e492427b4d9",
"score": "0.50501335",
"text": "def parse_error(response)\n ret = ''\n code = nil\n message = nil\n details = nil\n if (response.respond_to?(:status))\n code = response.status.to_s\n end\n if (response.respond_to?(:body))\n details = response.body.to_s\n begin\n err_msg = MultiJson.decode(response.body)\n err_msg.map { |_,v|\n if ! v.kind_of? Hash\n message = v.to_s\n next\n end\n code = v[\"code\"].to_s if v.has_key?(\"code\")\n message = v[\"message\"] if v.has_key?(\"message\")\n details = nil\n details = v[\"details\"] if v.has_key?(\"details\")\n }\n rescue MultiJson::DecodeError => error\n end\n else\n message = \"Unknown error response: \" + response.to_s\n end\n ret += code + \" \" unless code.nil?\n ret += message unless message.nil?\n unless details.nil?\n ret += \": \" unless ret.empty?\n ret += details\n end\n return ret\n end",
"title": ""
},
{
"docid": "db9a8e38b7f867f7790bd2b2b4046ee1",
"score": "0.5041895",
"text": "def assert_decoding_fail(options)\n error = nil\n begin\n assert_decoding(options.merge(:expecting_fail => true))\n rescue Sms::DecodingError\n error = $!\n end\n\n # ensure error of appropriate type was raised\n assert_not_nil(error, \"No error was raised\")\n\n # ensure error params are correct\n assert_equal(options[:error], error.type)\n assert_equal(options[:rank], error.params[:rank]) if options[:rank]\n assert_equal(options[:value], error.params[:value]) if options[:value]\n end",
"title": ""
},
{
"docid": "66d216fd67166563cbbef4c5c58e0263",
"score": "0.50272083",
"text": "def decode_error(payload)\n\t\tif ( payload[:err] && payload[:code] && payload[:title])\n\t\t\treturn true\n\t\tend\n\t\treturn false\n\tend",
"title": ""
},
{
"docid": "db6da803963edeff10c13841403ffb59",
"score": "0.50251925",
"text": "def error_message_segment\n return unless error_segment\n error_segment[error_segment.index(\"200\")..-1]\n end",
"title": ""
},
{
"docid": "52582c5f22d9288793e86991a439a713",
"score": "0.50174344",
"text": "def error(rcode:, question:nil)\n question = question || @questions[0]\n\n return Packet.new(\n trn_id: @trn_id,\n qr: QR_RESPONSE,\n opcode: OPCODE_QUERY,\n flags: FLAG_RD | FLAG_RA,\n rcode: rcode,\n questions: [question],\n answers: [],\n )\n end",
"title": ""
},
{
"docid": "bd25644605a311a1379627cd3435dffa",
"score": "0.5010352",
"text": "def from_error(error)\n child = error.get_elements('Errors')[0].get_elements('error')[0]\n code = child.attributes['code']\n exception = exceptions.find{|exc| exc.http_code == code }\n exception ||= self\n message = child.children.empty? ? '' : child.children[0].attributes['message']\n exception.new code, message\n end",
"title": ""
},
{
"docid": "508d640eb55c3698651ed00fa377eb83",
"score": "0.4998483",
"text": "def error_message\n parsed_body.strip\n end",
"title": ""
},
{
"docid": "58c1cb3a5dd6a601d63de6996a38d5d4",
"score": "0.499419",
"text": "def recover_from(_error); end",
"title": ""
},
{
"docid": "b4f004aebe1dc88238164538dfab63d6",
"score": "0.49903435",
"text": "def message_from(response)\n case response[:response_code]\n when 0\n return \"OK\"\n when 2000\n return \"ERROR 2000: Invalid Connection Ticket\"\n when 10303\n return \"ERROR 10303: TransRequestID is empty\"\n when 10305\n return \"ERROR 10305: An error occurred when validating the supplied payment data\"\n when 10309\n return \"ERROR 10309: The credit card number is formatted incorrectly\"\n when 10312\n return \"ERROR 10312: The credit card Transaction ID was not found\"\n when 10409\n return CVVResult.messages[ response[:card_code] ] if CARD_CODE_ERRORS.include?(response[:card_code])\n end\n end",
"title": ""
},
{
"docid": "3545c9cfdd6f8f086416c04b09d946e2",
"score": "0.49786606",
"text": "def mssql_send_error( msg )\n return [\n Constants::TDS_MSG_RESPONSE,\n 1, # status\n 0x0020 + msg.length * 2,\n 0x0037, # channel: 55\n 0x01, # packet no: 1\n 0x00, # window: 0\n Constants::TDS_TOKEN_ERROR,\n 0x000C + msg.length * 2,\n 18456, # SQL Error number\n 1, # state: 1\n 14, # severity: 14\n msg.length, # error msg length\n 0,\n msg.unpack('C*').pack('v*'),\n 0, # server name length\n 0, # process name length\n 0, # line number\n \"fd0200000000000000\"\n ].pack(\"CCnnCCCvVCCCCA*CCnH*\")\n end",
"title": ""
},
{
"docid": "d3ad1f5512465679561943c46fad4c63",
"score": "0.4963395",
"text": "def strip_wait_message(error_message)\n error_message.split(\"\\n\\n\", 2).last\n end",
"title": ""
},
{
"docid": "5593102bfba95f30ac82f861a538f42a",
"score": "0.4955868",
"text": "def decode(string, options = {})\n engine.decode(string, options)\n rescue engine::ParseError => exception\n raise DecodeError, exception.message, exception.backtrace\n end",
"title": ""
},
{
"docid": "b6a35d4aaddfc6f70980d9184ebf102e",
"score": "0.4953466",
"text": "def parse_legacy_error(body)\n message = \"\"\n if body['Errors']\n errors = body['Errors'].map do |error|\n \"Error #{error['Code']}: #{error['Message']}\"\n end\n message += errors.join(', ')\n end\n message\n end",
"title": ""
},
{
"docid": "83ba3f793b7bfc9fd00f4ee2c3ba59df",
"score": "0.4953182",
"text": "def parse_msg(rawmsgstr)\n Hash.from_xml(rawmsgstr)\n end",
"title": ""
},
{
"docid": "96c6322cc06f6828ca0ed5abb8ccf081",
"score": "0.49462914",
"text": "def unpack_body(body)\n # fixed fields\n self.status = body.slice!(0)\n self.flags = body.slice!(0)\n self.server_msg_len = body.slice!(0..1)\n self.data_len = body.slice!(0..1) \n \n # variable-length fields\n self.server_msg = body.slice!(0..(@server_msg_len - 1)) if (@server_msg_len != 0)\n self.data = body.slice!(0..(@data_len - 1)) if (@data_len != 0)\n return(nil)\n end",
"title": ""
},
{
"docid": "0aadb594f0eddf981625e214c9c3b2ab",
"score": "0.49401435",
"text": "def read_message(socket)\n unless (buffer = socket.read(4)) && (buffer.size == 4)\n raise InvalidResponse, 'unexpected EOF'\n end\n\n length = buffer.unpack1('N')\n begin\n str = socket.read length\n message = Riemann::Message.decode str\n rescue StandardError\n puts \"Message was #{str.inspect}\"\n raise\n end\n\n unless message.ok\n puts 'Failed'\n raise ServerError, message.error\n end\n\n message\n end",
"title": ""
},
{
"docid": "50eba3f8f8fc9ca8ec3bfd16271099d0",
"score": "0.49340546",
"text": "def serialize_error\n case error\n when Common::Exceptions::BaseError\n base_error\n when Common::Client::Errors::ClientError\n client_error\n when EMISRedis::VeteranStatus::NotAuthorized\n emis_error(:not_authorized)\n when EMISRedis::VeteranStatus::RecordNotFound\n emis_error(:not_found)\n when MPI::Errors::RecordNotFound\n mpi_error(404)\n when MPI::Errors::FailedRequestError\n mpi_error(503)\n when MPI::Errors::DuplicateRecords\n mpi_error(404)\n else\n standard_error\n end\n end",
"title": ""
},
{
"docid": "b80af5feaff113a989d1ef63913159fe",
"score": "0.49267247",
"text": "def parse_error(err)\n if err[:errors]\n err[:errors].values.flatten.map { |nested_err| parse_error(nested_err) }\n elsif err[:failed_attribute] == 'Required'\n parse_error_for_required_attr(err)\n else\n parse_error_default(err)\n end\n end",
"title": ""
},
{
"docid": "e3a01d2dd05450a1255c444da4b687c7",
"score": "0.49069297",
"text": "def decode_mpint(raw, offset=0)\n if raw.bytesize < offset + 4\n raise DecodeError, \"data too short\"\n end\n\n str_size_s = raw.byteslice(offset, 4)\n str_size = str_size_s.unpack(\"L>\").first\n mpi_size = str_size + 4\n\n if raw.bytesize < offset + mpi_size\n raise DecodeError, \"data too short\"\n end\n\n mpi_s = raw.slice(offset, mpi_size)\n\n # This calls OpenSSL's BN_mpi2bn() function. As far as I can tell, this\n # matches up with with MPI type defined in RFC4251 Section 5 with the\n # exception that OpenSSL doesn't enforce minimal length. We could enforce\n # this ourselves, but it doesn't seem worth the added complexity.\n mpi = OpenSSL::BN.new(mpi_s, 0)\n\n [mpi, mpi_size]\n end",
"title": ""
},
{
"docid": "a4f084dc1e61220a60f81e93cefd060b",
"score": "0.48999658",
"text": "def error\n @error ||= @response['reject_reason']\n end",
"title": ""
},
{
"docid": "71b09e023f066c331fabd89e97266a16",
"score": "0.48984206",
"text": "def decode(string)\n [string.tr(\" \\n\", '01')].pack('B*')\n end",
"title": ""
},
{
"docid": "5383a5909b9cb66bac6fd60c9baae015",
"score": "0.48983827",
"text": "def dissamble_packet(packet)\n packet_bytes = packet.bytes.to_a\n # debugger\n @thermo_address = packet_bytes[0] & 0b01111111\n @host_or_reply = packet_bytes[0][7]\n @message_type = packet_bytes[1] & 0b1111\n @data_length = (packet_bytes[1] & 0b11110000) / 0b10000\n @data = packet[2,@data_length]\n @checksum = packet[packet.length-1]\n @valid = validate_packet(packet)\n end",
"title": ""
},
{
"docid": "1ff3b1ef31f7c69b4f569f57ac35af99",
"score": "0.48976564",
"text": "def parse_error(error, req); end",
"title": ""
},
{
"docid": "2a810d09c50304396275ef3b7821e270",
"score": "0.48918265",
"text": "def extact_error_message(body)\n error_response = JSON.parse(body)\n error_response[\"errorMessage\"][0][\"error\"][0][\"message\"][0] rescue \"Unexpected error occured!\"\n end",
"title": ""
},
{
"docid": "784c19bdab81e45a8c7425284e145871",
"score": "0.48821172",
"text": "def parse_errors(response_string)\n pairs = response_string.split(@field_delim)\n pairs.each do |p|\n k,v = p.split(@value_delim)\n k = generate_error_key(k,v)\n @errors[k] = v\n end\n end",
"title": ""
},
{
"docid": "4bb577c76e770984fd82457d6b1dc20f",
"score": "0.48820397",
"text": "def unpack_body(body)\n # fixed-length fields\n self.server_msg_len = body.slice!(0..1)\n self.data_len = body.slice!(0..1)\n self.status = body.slice!(0)\n \n # variable-length fields\n @server_msg = body.slice!(0..(@server_msg_len - 1)) if (@server_msg_len != 0)\n @data = body.slice!(0..(@data_len - 1)) if (@data_len != 0)\n\n return(nil)\n end",
"title": ""
},
{
"docid": "a3b251f2ab7c526a17ff3765ac3f106f",
"score": "0.48790702",
"text": "def parse_response(value)\n @resp_message << value\n\n value = @buffer + value\n\n response_chunk, @resp_message_codes, @buffer = decode_message(value)\n\n @resp_message_codes.each do |resp_mc|\n if resp_mc.equal?(ERROR_RESPONSE)\n raise FailedRequest.new(MC_RESPONSE_FOR[@req_message_code], @resp_message_codes, response_chunk)\n end\n\n # The below should never really happen\n if resp_mc != MC_RESPONSE_FOR[@req_message_code]\n raise FailedExchange.new(MC_RESPONSE_FOR[@req_message_code], @resp_message_codes, response_chunk, \"failed_request\")\n end\n end\n\n if response_chunk.size > 0\n @response.parse_from_string response_chunk\n end\n\n @status = true\n return(@response)\n end",
"title": ""
},
{
"docid": "cb6fb584be5ca7edbcd9f9295f867e9c",
"score": "0.48787624",
"text": "def extract_error_message(response)\n begin\n begin\n content = MultiJson.load(response.body.to_s).to_smash\n @response_error_msg = [[:error, :message]].map do |path|\n if(result = content.get(*path))\n \"#{content[:code]}: #{result}\"\n end\n end.flatten.compact.first\n rescue MultiJson::ParseError\n begin\n content = MultiXml.parse(response.body.to_s).to_smash\n @response_error_msg = [['ErrorResponse', 'Error'], ['Error']].map do |path|\n if(result = content.get(*path))\n \"#{result['Code']}: #{result['Message']}\"\n end\n end.compact.first\n rescue MultiXml::ParseError\n content = Smash.new\n end\n rescue\n # do nothing\n end\n end\n @response_error_msg\n end",
"title": ""
},
{
"docid": "e257073f7f8236597da84b0a13b59234",
"score": "0.48760062",
"text": "def parse_message(message)\n begin\n JSON.parse(message)\n rescue => e\n raise \"Failed trying to parse response: #{e}\"\n end\n end",
"title": ""
},
{
"docid": "97af35368513569f0676d8eb3046d245",
"score": "0.48755598",
"text": "def decode(bytes)\n raise NotImplementedError, \"#{self.class.name}\\#decode\"\n end",
"title": ""
},
{
"docid": "73ab73f477cf606d0677ff240f44ec21",
"score": "0.48693505",
"text": "def decode(bytes)\n bytes.force_encoding(Encoding::BINARY)\n input = StringIO.new(bytes)\n version = has_version_tag ? input.read(1).ord : 0\n schema = schema_versions[version]\n raise ClientError, \"no registered schema for version #{version}\" unless schema\n read(input, schema)\n end",
"title": ""
},
{
"docid": "7fe1297af0346c25348909c460e114cc",
"score": "0.48678294",
"text": "def receive_with_error_handling(name,options={})\n message = receive(name,options)\n status = message['status']\n case status\n when 'success'\n message\n when 'error'\n raise_error_for_message(message)\n else\n $stderr.puts message.inspect\n raise RZ::Error,\"message status #{status.inspect} is unkown\"\n end\n end",
"title": ""
},
{
"docid": "ad1f9e3e31484c940cf21c09e2ffd036",
"score": "0.4865988",
"text": "def deserialize(value)\n begin\n ::Marshal.load(value.unpack('m')[0])\n rescue\n begin\n ::Marshal.load(value)\n rescue\n # Log the error?\n if options[:display_warnings] === true\n Ramaze::Log::warn(\"Failed to deserialize #{value.inspect}\")\n end\n\n return nil \n end\n end\n end",
"title": ""
},
{
"docid": "e94b9c80d1892cad9a971913da562321",
"score": "0.4853514",
"text": "def decode(bytes)\n decode_from(::StringIO.new(bytes))\n end",
"title": ""
},
{
"docid": "e832993ce8b096425babf2361ca70feb",
"score": "0.48446056",
"text": "def recv_msg(codec, last: false, limit_size: nil)\n data = @transport.read_data(last: last)\n\n raise StopIteration if data.nil?\n\n compressed, size, buf = *data\n\n unless size == buf.size\n raise \"inconsistent data: #{buf}\"\n end\n\n if limit_size && size > limit_size\n raise GrpcKit::Errors::ResourceExhausted, \"Receving message is too large: recevied=#{size}, max=#{limit_size}\"\n end\n\n if compressed\n raise 'compress option is unsupported'\n end\n\n begin\n codec.decode(buf)\n rescue ArgumentError => e\n raise GrpcKit::Errors::Internal, \"Error while decoding in server: #{e}\"\n end\n end",
"title": ""
},
{
"docid": "c0fdbe2a89686b5fa9630687e5565490",
"score": "0.48305303",
"text": "def deserialize(value)\n begin\n ::Marshal.load(value.unpack('m')[0])\n rescue\n begin\n ::Marshal.load(value)\n rescue\n # Log the error?\n if options[:display_warnings] === true\n Ramaze::Log::warn(\"Failed to deserialize #{value.inspect}\")\n end\n\n return nil\n end\n end\n end",
"title": ""
},
{
"docid": "8a81ebb7a21b119fdb4dc6735047bec0",
"score": "0.4825378",
"text": "def previous_error\n error = command(:getpreverror => 1)\n error[\"err\"] ? error : nil\n end",
"title": ""
},
{
"docid": "de7d00c11779cc89db3cadd3c6d01ded",
"score": "0.4824654",
"text": "def decrypt_and_verify(message, **options)\n catch_and_raise :invalid_message_format, as: InvalidMessage do\n catch_and_raise :invalid_message_serialization, as: InvalidMessage do\n catch_and_ignore :invalid_message_content do\n read_message(message, **options)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d2e3360afedcd9b215ec903243cdc73e",
"score": "0.48140252",
"text": "def status_to_error(status)\n case status\n when 1\n 'InvalidRequest'\n when 2\n 'InvalidCredentials'\n when 3\n 'NonExistentOrder'\n when 4\n 'NonExistentOrderItem'\n when 5\n 'InvalidStateChange'\n when 6\n 'InvalidStorno'\n when 7\n 'AnotherError'\n when 8\n 'OrderNotExported'\n when 9\n 'AutomaticDeliveryError'\n end\n end",
"title": ""
},
{
"docid": "04f75e37c99824bc2604e56aadad58c1",
"score": "0.48078626",
"text": "def unpack(message)\n if(message[:content])\n result = message[:content].to_smash\n else\n msg = message[:message].to_smash\n result = msg.fetch(:payload, msg)\n end\n if(respond_to?(:pre_formatters) && (pre_formatters && !pre_formatters.empty?))\n pre_formatters.each do |formatter|\n begin\n formatter.format(result)\n rescue => e\n error \"Formatter error encountered (<#{formatter}>): #{e.class} - #{e}\"\n end\n end\n end\n result\n end",
"title": ""
},
{
"docid": "f73a96ef78ed7519216507d624c545f3",
"score": "0.4800045",
"text": "def read_message! bytes, state=nil\n begin\n do_read_message! bytes, state\n rescue\n nil\n end\n end",
"title": ""
},
{
"docid": "fbd91bfa1971a5999baac9f92f9a537b",
"score": "0.4798581",
"text": "def clear_error_message\n self[:error_message] = nil\n end",
"title": ""
},
{
"docid": "7eb275004d41ed6f9721660702eab907",
"score": "0.47974005",
"text": "def parse_error(error)\n case error\n when SocketError\n PuppetDebugger::Exception::ConnectError.new(message: \"Unknown host: #{Puppet[:server]}\")\n when Net::HTTPError\n PuppetDebugger::Exception::AuthError.new(message: error.message)\n when Errno::ECONNREFUSED\n PuppetDebugger::Exception::ConnectError.new(message: error.message)\n when Puppet::Error\n if error.message =~ /could\\ not\\ find\\ class/i\n PuppetDebugger::Exception::NoClassError.new(default_modules_paths: default_modules_paths,\n message: error.message)\n elsif error.message =~ /default\\ node/i\n PuppetDebugger::Exception::NodeDefinitionError.new(default_site_manifest: default_site_manifest,\n message: error.message)\n else\n error\n end\n else\n error\n end\n end",
"title": ""
},
{
"docid": "98e5633bfd51ba06b9a9836ca2bfd257",
"score": "0.4796632",
"text": "def peek\n return nil if empty?\n _decode_message(self.first)\n end",
"title": ""
},
{
"docid": "8c29e33013ae1a0251a2f4af7ba994dc",
"score": "0.47925633",
"text": "def decode\n @msglen = plain_text.length\n holes = compute_holes(@msglen)\n\n end",
"title": ""
},
{
"docid": "40e89cb26bc73730f36cc429d37d6275",
"score": "0.47880447",
"text": "def error_message\n @data[\"message\"]\n end",
"title": ""
},
{
"docid": "701468907f48842c15ffebc68dc4d2f9",
"score": "0.47782993",
"text": "def to_s\n message_prefix_part = if message_prefix\n \"#{message_prefix} - \"\n else\n ''\n end\n \"#{message_prefix_part}#{Rdkafka::Bindings.rd_kafka_err2str(@rdkafka_response)} (#{code})\"\n end",
"title": ""
},
{
"docid": "edab499c1f4a3379b3bf534b864ac7da",
"score": "0.47776297",
"text": "def serialize(message)\n message.to_msgpack\n end",
"title": ""
},
{
"docid": "21f9351d8547eec52706b12ba5ffdbdc",
"score": "0.47701454",
"text": "def recover_from(_error)\n end",
"title": ""
},
{
"docid": "f0b34fa5235086654e994aba2989947b",
"score": "0.47681913",
"text": "def error_message\n @response.reason_phrase\n end",
"title": ""
},
{
"docid": "e57207008f578b7b444a8be5e63fa2a3",
"score": "0.4766971",
"text": "def ctcp_decode(str)\n ctcp_dequote(str.delete(\"\\x01\"))\n end",
"title": ""
},
{
"docid": "2574e38fe02eb15a975c4a79c7106505",
"score": "0.47646722",
"text": "def deserialize(bytes)\n raise \"Invalid byte count: #{bytes}. Expected length of #{length}\" if bytes.length != length\n deserialize_implementation(bytes)\n end",
"title": ""
},
{
"docid": "5d7c237779520ca118493d32a9f1bf81",
"score": "0.4761642",
"text": "def to_dnsruby_message # this should actually be a monkeypatch to Dnsruby::Message \"new_from_json\"?\n throw SyntaxError unless defined? self[:header] and defined? self[:question] and defined? self[:answer] and defined? self[:authority]\n msg = Message.new\n header = Header.new\n self[:header].each do |k,v|\n key = \"@#{k}\"\n next unless header.instance_variable_defined?(key)\n if k == :opcode\n header.opcode = v\n elsif k == :rcode\n header.rcode = v\n else\n header.instance_variable_set(key,v)\n end\n end\n msg.header = header\n \n self[:question].each do |q|\n msg.add_question(Question.new(q[:qname],q[:qtype],q[:qclass]))\n end\n \n self[:answer].each do |rr|\n msg.add_answer(RR.new_from_string(rr.to_rdata_string))\n end\n \n self[:authority].each do |rr|\n msg.add_authority(RR.new_from_string(rr.to_rdata_string))\n end\n \n self[:additional].each do |rr|\n msg.add_additional(RR.new_from_string(rr.to_rdata_string))\n end\n msg\n end",
"title": ""
},
{
"docid": "c379ca1a465cd3aba50c829c736e8dcf",
"score": "0.47542533",
"text": "def reset\n @messages = []\n @error = nil\n @status = :ready\n end",
"title": ""
},
{
"docid": "144ffae6392b7825d77b5daf2958e515",
"score": "0.4750828",
"text": "def response_message\n parsed_response['message']\nend",
"title": ""
},
{
"docid": "dd3cc5111eae7394ab72423f4c29b3b7",
"score": "0.47464308",
"text": "def first_error_message\n response_as_json[\"errors\"].first[\"message\"]\n end",
"title": ""
},
{
"docid": "e08d3e56e74fde3d91f621aad5ed4ed9",
"score": "0.4738348",
"text": "def demarshallMsg(cmsg, addr)\n\n @ipaddr = addr\t\t\t # IPAddress\n @seqId = to_i(cmsg.slice(0..3))\t # seqId\n @timetag = cmsg.slice(4..7)\t # timetag\n @pktFormat = to_i(cmsg.slice(8..9)) # pktFormat\n @cmd = to_i(cmsg.slice(10..11))\t # cmd\n @myIp = to_i(cmsg.slice(12..15))\t # myIp\n @version = cmsg.slice(16..17)\t # version\t\n @nodeType = to_i(cmsg.slice(18..19)) # nodeType\n @cmStatus = (cmsg.slice(20..23)) # status\t\n @mac11[0] = (cmsg.slice(24)) # mac11\n @mac11[1] = (cmsg.slice(25)) # mac11\n @mac11[2] = (cmsg.slice(26)) # mac11\n @mac11[3] = (cmsg.slice(27)) # mac11\n @mac11[4] = (cmsg.slice(28)) # mac11\n @mac11[5] = (cmsg.slice(29)) # mac11\n\n @mac12[0] = (cmsg.slice(30)) # mac12\n @mac12[1] = (cmsg.slice(31)) # mac12\n @mac12[2] = (cmsg.slice(32)) # mac12\n @mac12[3] = (cmsg.slice(33)) # mac12\n @mac12[4] = (cmsg.slice(34)) # mac12\n @mac12[5] = (cmsg.slice(35)) # mac12\n\n @mac13[0] = (cmsg.slice(36)) # mac12\n @mac13[1] = (cmsg.slice(37)) # mac12\n @mac13[2] = (cmsg.slice(38)) # mac12\n @mac13[3] = (cmsg.slice(39)) # mac12\n @mac13[4] = (cmsg.slice(40)) # mac12\n @mac13[5] = (cmsg.slice(41)) # mac12\n\n @mac14[0] = (cmsg.slice(42)) # mac12\n @mac14[1] = (cmsg.slice(43)) # mac12\n @mac14[2] = (cmsg.slice(44)) # mac12\n @mac14[3] = (cmsg.slice(45)) # mac12\n @mac14[4] = (cmsg.slice(46)) # mac12\n @mac14[5] = (cmsg.slice(47)) # mac12\n\n end",
"title": ""
},
{
"docid": "3c30dff22efb4bc52427b4dee28de970",
"score": "0.4737465",
"text": "def decode(token)\n \n end",
"title": ""
},
{
"docid": "03c24161f152ba7662514b0f2ff10c57",
"score": "0.4733102",
"text": "def decode; end",
"title": ""
},
{
"docid": "03c24161f152ba7662514b0f2ff10c57",
"score": "0.4733102",
"text": "def decode; end",
"title": ""
},
{
"docid": "eb0d450647b0e9e327155749630d95fd",
"score": "0.47228736",
"text": "def decode_remote_attributes(data,options={})\n self.remote_errors = data.delete('errors')\n super\n end",
"title": ""
},
{
"docid": "0420e0fd8d49a782896db4d57571f90c",
"score": "0.47213355",
"text": "def parse_body(buffer)\n @id = shift_short(buffer)\n while(buffer.bytesize>0)\n @return_codes << shift_byte(buffer)\n end\n # puts \"subacks #{@return_codes.inspect}\"\n end",
"title": ""
},
{
"docid": "29b30932adb88464d851b17f15ca1c60",
"score": "0.4718906",
"text": "def reset!()\n # fixed-length fields\n @status = 0\n @flags = 0\n @server_msg_len = 0\n @data_len = 0 \n \n # variable-length fields\n @server_msg = nil\n @data = nil\n \n return(nil)\n end",
"title": ""
},
{
"docid": "e64b53664f81e98c6534877d439b3c23",
"score": "0.47187302",
"text": "def parse_error(error)\n case error\n when SocketError\n PuppetRepl::Exception::ConnectError.new(:message => \"Unknown host: #{Puppet[:server]}\")\n when Net::HTTPError\n PuppetRepl::Exception::AuthError.new(:message => error.message)\n when Errno::ECONNREFUSED\n PuppetRepl::Exception::ConnectError.new(:message => error.message)\n when Puppet::Error\n if error.message =~ /could\\ not\\ find\\ class/i\n PuppetRepl::Exception::NoClassError.new(:default_modules_paths => default_modules_paths,\n :message => error.message)\n elsif error.message =~ /default\\ node/i\n PuppetRepl::Exception::NodeDefinitionError.new(:default_site_manifest => default_site_manifest,\n :message => error.message)\n else\n error\n end\n else\n error\n end\n end",
"title": ""
},
{
"docid": "d9ac8a7f1e457fd0880d672e803b2f32",
"score": "0.47149047",
"text": "def get_error_message(str)\n tmp=str.scan(/^ERROR MESSAGE --8<------\\n(.*?)ERROR MESSAGE ------>8--$/m)\n return \"Error message not available\" if !tmp[0]\n tmp[0][0].strip\n end",
"title": ""
},
{
"docid": "64e28202cfc67c5aba4b632faab2c0bd",
"score": "0.47066134",
"text": "def unreceive message, headers={}\n end",
"title": ""
},
{
"docid": "091011cd2b1866d8e0ead4c5ad2a5b46",
"score": "0.47017586",
"text": "def decode\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "777cf04fcecddfd4e96516994a705a57",
"score": "0.47003168",
"text": "def coerce_submessages(hash, message_class)\n return nil if hash.nil?\n coerced = {}\n message_descriptor = message_class.descriptor\n hash.each do |key, val|\n field_descriptor = message_descriptor.lookup(key.to_s)\n if field_descriptor && field_descriptor.type == :message\n coerced[key] = coerce_submessage(val, field_descriptor)\n elsif field_descriptor && field_descriptor.type == :bytes &&\n (val.is_a?(IO) || val.is_a?(StringIO))\n coerced[key] = val.binmode.read\n else\n # `google/protobuf` should throw an error if no field descriptor is\n # found. Simply pass through.\n coerced[key] = val\n end\n end\n coerced\n end",
"title": ""
},
{
"docid": "d04c358d83c230fdf488bcdefecda2dd",
"score": "0.47001645",
"text": "def message\n if not @message then\n [HTTPLogMessage, TCPLogMessage, StringLogMessage].each do |klass|\n @message = klass.parse(raw_message)\n break if @message\n end\n end\n return @message\n end",
"title": ""
},
{
"docid": "9dd7338c5f697f63ea9dbb32e18176e5",
"score": "0.46998784",
"text": "def decode_string(bytes)\n bytes.map(&:chr)\n .join\n .gsub(/#{0.chr}*$/, '')\n end",
"title": ""
},
{
"docid": "92283ddc4728144fb6a759cfeffac59f",
"score": "0.46938956",
"text": "def reset!()\n # fixed-length fields\n @user_msg_len = 0\n @data_len = 0\n @flags = 0\n \n # variable-length fields\n @user_msg = nil\n @data = nil\n return(nil)\n end",
"title": ""
}
] |
912c0e0cf8816366872f1b29941d2de1
|
DELETE /events/1 DELETE /events/1.json
|
[
{
"docid": "f41eedf4bbec81ae85e0190150e8c3da",
"score": "0.0",
"text": "def destroy\n @verbindung = Verbindung.find(params[:verbindung_id])\n if !has_access_to_verbindung(@verbindung) then return end\n\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to verbindung_events_url(@verbindung) }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "11f7138ce2d6d84fa0d9949fbd14cb07",
"score": "0.7693224",
"text": "def destroy\n @event = Event.using(:shard_one).find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7d4aa1b95a62c00729623f3530314a4e",
"score": "0.76886576",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7d4aa1b95a62c00729623f3530314a4e",
"score": "0.76886576",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7d4aa1b95a62c00729623f3530314a4e",
"score": "0.76886576",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f955252f902c753816feb5fc1cc0c7e3",
"score": "0.7681075",
"text": "def delete_event\n if params[:id]\n @e = Evento.find(params[:id]).destroy\n end\n render :json => msj = { :status => true, :message => 'ok'}\n end",
"title": ""
},
{
"docid": "7c98a7d8552c19734553b1ada3567eab",
"score": "0.7586044",
"text": "def destroy\n @event = Event.find(params[:id])\n \n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e896be2f446cd17268e2f3d1c26da788",
"score": "0.7569",
"text": "def destroy\n #@event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "162cc6dba467e447d1ef47fad3482411",
"score": "0.7561319",
"text": "def destroy\n # @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.7541495",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.7541186",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.7541186",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.7541186",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.7541186",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.7541186",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.7541186",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.7541186",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.7541186",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.7541186",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.7541186",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4a59ed95d145dc38f1e91719829b5af7",
"score": "0.7541186",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9fbe1865432814e6e751641965a7ff90",
"score": "0.7540414",
"text": "def destroy\n @event = Event.find(params[:id])\n @events = Event.where(event_id: params[:id])\n @events.each.destroy\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "85bcf3696d36a73119d715d29d7fc016",
"score": "0.75390416",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n\n end",
"title": ""
},
{
"docid": "5055bcd352d092415ba3f0f0308218d9",
"score": "0.75378317",
"text": "def destroy\n @event_event = Event::Event.find(params[:id])\n @event_event.destroy\n\n respond_to do |format|\n format.html { redirect_to event_events_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a718088b9c5ce3ef078c0345717912fe",
"score": "0.7527901",
"text": "def destroy\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "942b0d1987450124ca3251a75d38eaad",
"score": "0.7520685",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "764813fd46cfa96391554b362c16ff9b",
"score": "0.7515363",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "317970cfcdc39c3bb51044da950962a1",
"score": "0.74965996",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5b6be14b63501678d85943fb37a7ed1f",
"score": "0.746597",
"text": "def destroy\n @myevent = Myevent.find(params[:id])\n @myevent.destroy\n\n respond_to do |format|\n format.html { redirect_to myevents_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a689a8ee3647b9ae93f1a06adfdd5270",
"score": "0.74608785",
"text": "def destroy\n @event.destroy\n\n sync_destroy @event\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6864b639c4f05fa57495198051ae9efe",
"score": "0.7454681",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html {redirect_to events_url}\n format.json {head :no_content}\n end\n end",
"title": ""
},
{
"docid": "e556f2a41a91e5e12bae20237ac05251",
"score": "0.7447546",
"text": "def destroy\n @calevent = Calevent.find(params[:id])\n @calevent.destroy\n\n respond_to do |format|\n format.html { redirect_to calevents_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bd33b6073d88da718b1cca2764f64537",
"score": "0.7440987",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n render :nothing => true, :status => 200, :content_type => 'text/plain'\n end",
"title": ""
},
{
"docid": "dc00e510b6c5fd6d67feca6a083e6c44",
"score": "0.7440808",
"text": "def destroy\n @event = Event.find(params[:id])\n #@event.update_attribute(:deleted, true)\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8d9f0410de1be2123ca195594ddded3d",
"score": "0.74354243",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url, notice: t(:event_deleted) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f3a9491757a165f362cf9c92cb7a2dc6",
"score": "0.74334484",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ad357cc9d1033f88711366e23180ae78",
"score": "0.7402408",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_events_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "26254cababbf38dee84e607c7576c963",
"score": "0.738834",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "5ac5e9788b36aae32df4a766e6d635f3",
"score": "0.737868",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to root_url, notice: 'Event was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0f3540f6bfd7413e518b3b767b57338c",
"score": "0.7372888",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'データが削除されました。' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4bf00ea4ec230e99442b40f5b6598bc8",
"score": "0.73655",
"text": "def delete_event\r\n event = Event.find_by(id: params[:eventid].to_i)\r\n if event.present?\r\n event.update(status: 3)\r\n lt_update_event_status event, 'archived'\r\n render json: SuccessResponse.new(\r\n code: 200,\r\n message: 'Event Deleted.'\r\n ), adapter: :json, status: :ok\r\n else\r\n render json: ErrorResponse.new(\r\n code: 404,\r\n message: 'Event not found!'\r\n ), adapter: :json, status: :not_found\r\n end\r\n\r\n end",
"title": ""
},
{
"docid": "572aa8e74b6d518e13ca663d65264c3d",
"score": "0.7339261",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'Event was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0f05c11fde7a8d5463a6a1f64660558d",
"score": "0.73361975",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'Event was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0f05c11fde7a8d5463a6a1f64660558d",
"score": "0.73361975",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'Event was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a40c92970ceed6254b5f8bd26c1c2fbc",
"score": "0.73236173",
"text": "def destroy\n @event = Event.find(params[:id])\n @client = Client.find(@event.client_id)\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_to_client_path(@client) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c7123396c9c475d88037e7c41c7f3802",
"score": "0.7300774",
"text": "def destroy\n @event_request = EventRequest.find(params[:id])\n @event_request.destroy\n\n respond_to do |format|\n format.html { redirect_to event_requests_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "03762555e752f010440ac34d42956213",
"score": "0.7297619",
"text": "def destroy\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'Мероприятие успешно удалено.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3c12afc7d22c601664a1f94227010e01",
"score": "0.7291121",
"text": "def destroy\n @event = current_user.events.find_by_url(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a91ef0c5bcfdc2d242fc36770406abb4",
"score": "0.7291078",
"text": "def destroy\n @post_event.destroy\n respond_to do |format|\n format.html { redirect_to post_events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c53d56d42f99f099b2f8db82ed4e6b97",
"score": "0.7289857",
"text": "def destroy\n @event = @current_account.events.find(params[:id])\n @event.destroy\n\n respond_to do |format|\n format.html { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "be82dcfa54a4e1f407a060d6f29b8d83",
"score": "0.72875506",
"text": "def destroy\n @evento = Evento.find(params[:id])\n @evento.destroy\n\n respond_to do |format|\n format.html { redirect_to eventos_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "cc7354fae7e844caa211c0bae1c32551",
"score": "0.7285632",
"text": "def destroy\n @event = Event.find(params[:id])\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url, notice: 'Event was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "99c942f26a99372d994a409fb7899966",
"score": "0.7284554",
"text": "def destroy\n @eventtype.events.each do |e|\n e.destroy\n end\n @eventtype.destroy\n respond_to do |format|\n format.html { redirect_to eventtypes_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "607afcda137348f4629d43aab777bcec",
"score": "0.72833604",
"text": "def destroy \n @event.destroy \n respond_to do |format|\n format.html { redirect_to events_url, success: 'Event was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b9a6a82299f8829498a24fa9c24c24f6",
"score": "0.7273459",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.html { redirect_to events_url }\n format.mobile { redirect_to events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bae1ecd6caf803915219e611868cb184",
"score": "0.7270107",
"text": "def destroy\n @create_event = CreateEvent.find(params[:id])\n @create_event.destroy\n\n respond_to do |format|\n format.html { redirect_to create_events_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
579bd488b3671bce83b55832ab2a042e
|
The current user profile picture URL
|
[
{
"docid": "09e97aa3836d24a524feff417a8ffb78",
"score": "0.8135242",
"text": "def profile_pic_url\n json[\"entry_data\"][\"ProfilePage\"].first[\"graphql\"][\"user\"][\"profile_pic_url\"]\n end",
"title": ""
}
] |
[
{
"docid": "0ce2b01aa2886806e02774355d59f22d",
"score": "0.82898366",
"text": "def profile_pic_url\n result_hash['pic']\n end",
"title": ""
},
{
"docid": "9580aa58a884d1dad29a2e22116b65c7",
"score": "0.82226527",
"text": "def profile_url\n if self.profile and self.profile != \"\"\n return self.profile\n end\n return \"/blank.png\"\n end",
"title": ""
},
{
"docid": "3eb8b65569205e47187b62495017c6fc",
"score": "0.8062309",
"text": "def get_profile_picture_url\n\t\tidentity = self.identities.find_by_provider_id(ApplicationController.fb_app[:id])\n\t\treturn ApplicationController.fb_app[:graph][:query_root_url] + identity.uid + \"/\" + ApplicationController.fb_app[:graph][:query_mypic_suffix]\t\t\n\tend",
"title": ""
},
{
"docid": "97269c2e14a50d3c27cebc6a25062bf7",
"score": "0.8015587",
"text": "def image_url\n url_for(object.profile_pic)\n end",
"title": ""
},
{
"docid": "01d2740daaab8cb30aa5cdce38954ada",
"score": "0.7947919",
"text": "def avatar_url\r\n return @user.avatar_url\r\n end",
"title": ""
},
{
"docid": "a7665dc97e3604908ca0be606b97656c",
"score": "0.7877208",
"text": "def profile_picture\n if facebook_authentication && facebook_authentication.profile_picture\n return facebook_authentication.profile_picture\n end\n return '/images/unknown_user.png'\n end",
"title": ""
},
{
"docid": "95837e24e5f7b24bd03745eb342e4d59",
"score": "0.7870923",
"text": "def facebookProfilePicURL\n # https://www.facebook.com/user_name\n if facebook_url\n return \"https://graph.facebook.com/[PROFILE_ID]/picture\"\n else\n None\n end\n end",
"title": ""
},
{
"docid": "7f7f43ac1431156003289a058194c7a7",
"score": "0.7869886",
"text": "def avatar_url\n if !self.fb_id.blank?\n return 'https://graph.facebook.com/%s/picture?width=90&height=90' % self.fb_id\n elsif !self.gpp_id.blank?\n return 'http://profiles.google.com/s2/photos/profile/%s?sz=90' % self.gpp_id\n else\n return ''\n end\n end",
"title": ""
},
{
"docid": "8c1390b248124498a5e0c31858d28504",
"score": "0.7859494",
"text": "def profile_picture\n profile_picture_file_name\n end",
"title": ""
},
{
"docid": "5975cc5f4e3138813b4a73e5a7cba412",
"score": "0.783165",
"text": "def profile_url\n @data[:profile_url]\n end",
"title": ""
},
{
"docid": "492c4467a65f57ec8455378781fde40b",
"score": "0.78250825",
"text": "def user_avatar_url\n @raw['user']['avatar_url']\n end",
"title": ""
},
{
"docid": "1339000371e15b8ecf920aa8bcbb1477",
"score": "0.7796113",
"text": "def profile_picture_url\n hash = Digest::MD5.hexdigest(email)\n \"https://www.gravatar.com/avatar/#{hash}?d=mm\"\n end",
"title": ""
},
{
"docid": "faf3335967661954965181826d4b5066",
"score": "0.779285",
"text": "def set_profile_picture_url(user)\n case user.provider\n when 'facebook'\n x = open(\"http://graph.facebook.com/v2.6/#{user.uid}/picture?redirect=false\", &:read)\n user.profile_pic = eval(x)[:data][:url]\n else # 'twitter', 'google', 'linkedin'\n user.profile_pic = open(user.image_url)\n end\n user.profile_pic.url\n end",
"title": ""
},
{
"docid": "46a8021052004c6227269f5416519fc6",
"score": "0.7789238",
"text": "def get_profile_photo_url(photo)\n if photo != nil\n return photo.image.url(:thumb)\n else\n return 'user.png'\n end\n end",
"title": ""
},
{
"docid": "25dd15d8eae25b45f652499a32c1b8c1",
"score": "0.7785521",
"text": "def author_picture_url\n @author_picture_url ||= begin\n if self.author_screenname\n \"http://twitter.com/api/users/profile_image/#{self.author_screenname}\"\n else\n image_path(\"default-avatar.png\")\n end\n end\n end",
"title": ""
},
{
"docid": "8114ead4e89f72977c2dbd5672bc18fd",
"score": "0.7772762",
"text": "def image_path\n uri_path = URI(profile_image_url).path\n extension = File.extname(uri_path)\n \"#{@base_path}/#{screen_name}#{extension}\"\n end",
"title": ""
},
{
"docid": "23dba477cd17bd657dab630f7c3f094f",
"score": "0.77521974",
"text": "def get_image_url( account_profile ) \n account_profile['profile_image_url']\n end",
"title": ""
},
{
"docid": "6d5c9f46eddbef47a3768a2fd33009f0",
"score": "0.77447283",
"text": "def picture_url\n if avatar\n image_path(\"speakers/#{avatar}\")\n else\n image_path(\"default-avatar.png\")\n end\n end",
"title": ""
},
{
"docid": "08e3a28cb6b7915a4b986201e85736fb",
"score": "0.77105147",
"text": "def user_img_URL\n self.user.image_url\n end",
"title": ""
},
{
"docid": "61ef2b0286b13a4ee9e5051c7afa4daa",
"score": "0.7670244",
"text": "def get_pic_url\n\t if !self.pic_url\n\t\t twit_u = User.get_twitter_user_from_name(self.screen_name)\n\t\t\tputs twit_u\n\t\t\tself.pic_url = twit_u[\"profile_image_url\"]\n\t\t\tself.save!\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0a1d8858acbb814060f990cabf633f0a",
"score": "0.7630483",
"text": "def profile_image_url(size=:normal)\n insecure_url(profile_image_url_https(size)) if profile_image_url?\n end",
"title": ""
},
{
"docid": "d57ccfd48fa7bd61c8328e5e247a49f2",
"score": "0.76276594",
"text": "def profile_picture\n\t\tFbGraph::User.me(self.oauth_token).fetch.picture(width: 150, height: 200)\n\tend",
"title": ""
},
{
"docid": "944619e4b2ccc82e70716c7fdb49e4ac",
"score": "0.7610792",
"text": "def profile_photo\n photos = self.profile_photos\n photos.empty? ? 'http://ragatzi.s3.amazonaws.com/uploads/profile_default_1.png' : photos.last.photo.url\n end",
"title": ""
},
{
"docid": "f123a30b3f2c190812df52677b9f04ef",
"score": "0.7565195",
"text": "def display_profile_image\n if self.picture.present? && self.picture.url(:small).present?\n self.picture.url(:small)\n else\n ActionController::Base.helpers.asset_path('user.png')\n end\n end",
"title": ""
},
{
"docid": "67fe39de8fabc5e3f385ea646b4abcb5",
"score": "0.754514",
"text": "def avatar_url(user)\n if user.avatar_url.present?\n user.avatar_url\n else\n default_url = \"#{root_url}images/guest.png\"\n gravatar_id = Digest::MD5.hexdigest(user.email.downcase)\n \"http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}\"\n end\n end",
"title": ""
},
{
"docid": "67fe39de8fabc5e3f385ea646b4abcb5",
"score": "0.75443107",
"text": "def avatar_url(user)\n if user.avatar_url.present?\n user.avatar_url\n else\n default_url = \"#{root_url}images/guest.png\"\n gravatar_id = Digest::MD5.hexdigest(user.email.downcase)\n \"http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}\"\n end\n end",
"title": ""
},
{
"docid": "983c5478bb30f53b68ffa75dee908e52",
"score": "0.7540111",
"text": "def avatar_url(user)\n default_url = \"#{root_url}images/guest.jpg\"\n # BUG: Don't use gravatar as you can get someone else's gravatar with your name.\n # eg. Try signing up with name \"test meme\" ... it's some dude's distorted face\n # if user.profile\n # if user.profile.avatar_url.present?\n # user.profile.avatar_url\n # else\n # gravatar_id = Digest::MD5.hexdigest(user.email.downcase)\n # \"http://gravatar.com/avatar/#{gravatar_id}?s=200&d=#{CGI.escape(default_url)}\"\n # end\n # else\n # default_url\n # end\n end",
"title": ""
},
{
"docid": "93b69a297fe7e2698fe274ef696254dd",
"score": "0.75154036",
"text": "def avatar_url\n avatar_uri(object)\n end",
"title": ""
},
{
"docid": "a6b12da8628bd09dba810473ea111f3d",
"score": "0.7498681",
"text": "def picture\n if self.avatar?\n self.avatar.url\n elsif self.image_url != nil\n self.image_url\n else\n 'generic_avatar'\n end\n end",
"title": ""
},
{
"docid": "195075b6c296aec16356dff9dfe33316",
"score": "0.7477126",
"text": "def twitter_profile_image\n @profile_image ||= begin\n require 'open-uri'\n require 'json'\n buffer = open(\"http://twitter.com/users/show/#{self.twitter_screen_name}.json\").read\n result = JSON.parse(buffer)\n result['profile_image_url']\n end\n end",
"title": ""
},
{
"docid": "eafc5230d987ac51058abb83fcd3452b",
"score": "0.74567634",
"text": "def api_profile_picture_url\n return nil unless (temp_api_profile_picture_url = read_attribute(:api_profile_picture_url))\n # logger.debug2 \"temp_api_profile_picture_url = #{temp_api_profile_picture_url}\"\n encrypt_remove_pre_and_postfix(temp_api_profile_picture_url, 'api_profile_picture_url', 40)\n end",
"title": ""
},
{
"docid": "eafc5230d987ac51058abb83fcd3452b",
"score": "0.74567634",
"text": "def api_profile_picture_url\n return nil unless (temp_api_profile_picture_url = read_attribute(:api_profile_picture_url))\n # logger.debug2 \"temp_api_profile_picture_url = #{temp_api_profile_picture_url}\"\n encrypt_remove_pre_and_postfix(temp_api_profile_picture_url, 'api_profile_picture_url', 40)\n end",
"title": ""
},
{
"docid": "15843b8e2e1e2135a9bd59dbcbc6183c",
"score": "0.74537164",
"text": "def get_current_user_profile_image\n if ProfileImage.find_by(user_id: get_current_user.id).image_base64 != \"\"\n return ProfileImage.find_by(user_id: get_current_user.id)\n else\n return \"/img/logo/small-logo.png\"\n end\n end",
"title": ""
},
{
"docid": "5ac30365f4372dc690a45e376388e32a",
"score": "0.744178",
"text": "def profile_url\n nil\n end",
"title": ""
},
{
"docid": "530756cbe47e16c7b97be399b31c481e",
"score": "0.74012035",
"text": "def user_pic user\n \"<a href='#{site(user)}' title='#{user.city} #{user.jobs} #{user.maxim} #{user.memo}' target='_blank'><img width='48' height='48' src='#{user.avatar.thumb.url}' width='#{USER_THUMB_SIZE}' height='#{USER_THUMB_SIZE}'></a>\"\n end",
"title": ""
},
{
"docid": "2faf1fd85464748bce87be58111ea490",
"score": "0.7398888",
"text": "def profile_url\n @json['user']['links']['self']\n end",
"title": ""
},
{
"docid": "c93af6807e11435bc2c19b7b343171bb",
"score": "0.73655784",
"text": "def profile_img(uid, type=\"normal\")\n \"http://graph.facebook.com/#{uid}/picture?type=#{type}\"\n end",
"title": ""
},
{
"docid": "756f24bbc4aa2a20bcfa119055f9a84b",
"score": "0.73615336",
"text": "def user_avatar_url(user = nil, variant:)\n if user.nil? || Rails.application.show_dummy_image?\n UsersHelper.no_avatar_path\n else\n user.avatar_image_location(variant: variant) || UsersHelper.no_avatar_path\n end.to_s\n end",
"title": ""
},
{
"docid": "3cde1fa1820e719438898482bff95f4f",
"score": "0.7344175",
"text": "def user_profile_img(user)\n if user.avatar?\n return image_tag(user.avatar, alt: user.name, size: \"60x60\")\n else\n img_url = 'no_image.png'\n end\n image_tag(img_url, alt: user.name, size: \"60x60\")\n end",
"title": ""
},
{
"docid": "dd7f09fd4f072692d40d721253b984e2",
"score": "0.733764",
"text": "def profile_picture_for(user)\n if user.picture?\n image_tag(user.picture.url, alt: user.name, class: \"profile_picture\")\n else\n image_tag(random_default_image, alt: user.name, class: \"profile_picture\")\n end\n end",
"title": ""
},
{
"docid": "c7a664c21ab4c5d3e26b3ed372824bbc",
"score": "0.73333424",
"text": "def author_avatar\n is_anonymous ? Avatar.default.url : user.profile.avatar.url\n end",
"title": ""
},
{
"docid": "2641e6440be101fcad3ed2c037e744f2",
"score": "0.7313623",
"text": "def image\n if File.exist?(\"public/images/profile_images/#{self.username}.jpg\")\n img_path = \"/images/profile_images/#{self.username}.jpg\"\n else\n img_path = \"/images/default.jpg\"\n end\n return img_path\n end",
"title": ""
},
{
"docid": "395417546046d98b0744af396f690b6a",
"score": "0.73135114",
"text": "def profile_url(size: 'w300')\n if profile_path.present?\n \"#{h.configuration.base_url}#{size}#{object[\"profile_path\"]}\"\n else\n \"http://dummyimage.com/300x450/d9d9d9/000000.png&text=N/A\"\n end\n end",
"title": ""
},
{
"docid": "8a0cdfc5bf7235da157e9a448d9de5b1",
"score": "0.73127913",
"text": "def avatar_url(user)\n default_url = \"#{root_url}images/user-img.gif\"\n gravatar_id = Digest::MD5.hexdigest(user.email.downcase)\n \"http://gravatar.com/avatar/#{gravatar_id}.png?s=48&d=#{CGI.escape(default_url)}\"\n end",
"title": ""
},
{
"docid": "9d2b387bc0f811babb79a8f4e548cb17",
"score": "0.73081535",
"text": "def avatar_url\n root = Rails.application.routes.url_helpers.url_for(:root)\n uri = URI(root)\n uri.path = avatar_path\n uri.to_s\n end",
"title": ""
},
{
"docid": "02a03dd9dbbad4e5f812d07f78b89cb8",
"score": "0.72873616",
"text": "def avatar_url\n return image_url if image_url\n return DEFAULT_AVATAR if email.nil?\n\n gravatar_url\n end",
"title": ""
},
{
"docid": "9afb37b7c6a1b86b93aa60a89906caf1",
"score": "0.7281877",
"text": "def author_avatar\n anonymous? ? Avatar.default.url : user.profile.avatar.url\n end",
"title": ""
},
{
"docid": "7bdb309d7c8d9296d8724b5d3e220aab",
"score": "0.7268243",
"text": "def profile_photo_url(version)\n if self.photos.profile_photo.blank? \n \"#{version.to_s}_avtar.jpg\"\n else \n self.photos.profile_photo.first.name_url(version)\n end \n end",
"title": ""
},
{
"docid": "4ea1576bac096575b4bd240e1ab8051e",
"score": "0.7267245",
"text": "def avatar_url\n \"http://robohash.org/#{email}?gravatar=yes\"\n end",
"title": ""
},
{
"docid": "7da092fd1ebcda8764362bc041f49299",
"score": "0.726583",
"text": "def getPicturePath\n\t\t#return User.find(self.user_id)\n @profile = Profile.find(:first, :conditions => {:user_id => self.user_id})\n if @profile.avatar != '' and @profile.avatar!=nil\n return @profile.avatar\n else\n return @profile.picture_path\n end\n\t\t#return Profile.find(:first, :conditions => {:user_id => self.user_id}).picture_path\n\tend",
"title": ""
},
{
"docid": "a28ee9dae8adc151b46c4e70be6051fe",
"score": "0.7263538",
"text": "def avatar_url(avatar_size=\"small\")\n if self.has_shelby_avatar\n return self.shelby_avatar_url(avatar_size)\n else\n return self.user_image_original || self.user_image || \"#{Settings::ShelbyAPI.web_root}/images/assets/avatar.png\"\n end\n end",
"title": ""
},
{
"docid": "6ffcc75526bdc47d0668c8e891b19922",
"score": "0.7257076",
"text": "def avatar_url\n @data['avatarUrl']\n end",
"title": ""
},
{
"docid": "f726eb9fd9c04dca5818e21f834c7ad7",
"score": "0.72506255",
"text": "def url\n URI.join(request.url, @picture.image.url)\n end",
"title": ""
},
{
"docid": "96fe65a7ec261d4339b403b6fd0d6560",
"score": "0.7239887",
"text": "def profile_url\r\n infoxml = get_info\r\n return infoxml.at('profileurl').inner_text\r\n end",
"title": ""
},
{
"docid": "0d43fa0fa656b0045e326b3dc0028b07",
"score": "0.7236779",
"text": "def user_avatar(user)\n user.avatar ? user.avatar.photo.url(:thumb) : \"default-avatar.jpg\"\n end",
"title": ""
},
{
"docid": "5a41da8de43d1f89b05e4e6bf4b4224b",
"score": "0.7224724",
"text": "def avatar_url\n @attributes[:avatar_url]\n end",
"title": ""
},
{
"docid": "5a41da8de43d1f89b05e4e6bf4b4224b",
"score": "0.7224724",
"text": "def avatar_url\n @attributes[:avatar_url]\n end",
"title": ""
},
{
"docid": "93660d592bde612d710724fbc751ac44",
"score": "0.72159666",
"text": "def avatar_url(format = nil)\n return API::User.default_avatar(@discriminator) unless @avatar_id\n\n API::User.avatar_url(@id, @avatar_id, format)\n end",
"title": ""
},
{
"docid": "7cec3b15df1b49a52a04642a0de93278",
"score": "0.7201632",
"text": "def avatar_url(type = :small)\n \"#{authentications.first.avatar_url}?type=#{type}\"\n end",
"title": ""
},
{
"docid": "4e3f0dcffd22f4f380830177919acfaa",
"score": "0.7196554",
"text": "def profile_url\n @json['profile']['url'] rescue nil\n end",
"title": ""
},
{
"docid": "f38a11755de96e2f7280dc8dc86dd45f",
"score": "0.71876895",
"text": "def linked_in_avatar(user)\n image_tag(user.user_info[\"linked_in\"][\"image\"])\n end",
"title": ""
},
{
"docid": "9460cd9c8bd51ccec6ff1c2f154d32e3",
"score": "0.7173644",
"text": "def photo_url\n gravatar_id = Digest::MD5.hexdigest(email.downcase)\n \"https://gravatar.com/avatar/#{gravatar_id}.png\"\n end",
"title": ""
},
{
"docid": "5bebaf8299bec99ad6082805583df6a1",
"score": "0.7171098",
"text": "def blank_profile_pic_url(format = 'tiny')\n \"/images/profile_pictures/profile_blank_#{format}.png\"\n end",
"title": ""
},
{
"docid": "3668a6b0659123cce58a4f1ef59f0710",
"score": "0.7162253",
"text": "def set_facebook_url\n facebook_id = user.authorization.uid\n \"http://graph.facebook.com/#{facebook_id}/picture\"\n end",
"title": ""
},
{
"docid": "891a4592268180c481dfaf701bb67b41",
"score": "0.7152814",
"text": "def avatar_url (size)\n if avatar.present?\n return avatar.url(size)\n # elsif provider == \"facebook\" and external_uid\n # return \"https://graph.facebook.com/#{external_uid}/picture\"\n else\n return \"http://www.gravatar.com/avatar/#{Digest::MD5.hexdigest(email.downcase)}\"\n end\n end",
"title": ""
},
{
"docid": "c8cae67fbdab8d550c2f2d43a183b493",
"score": "0.7134476",
"text": "def picture\n\t\tbegin\n\t\t\tcase provider\n\t\t\twhen \"facebook\"\n\t\t\t\tresponse = get(\"/me/picture?type=large&redirect=false\")\n\t\t\t\treturn response['data']['url']\n\t\t\t\t\n\t\t\twhen \"twitter\"\n\t\t\t\tresponse = get(\"/1.1/users/show.json?user_id=#{uid}\")\n\t\t\t\treturn response['profile_image_url_https']\n\t\t\t\t\n\t\t\twhen \"google_oauth2\"\n\t\t\t\tresponse = get(\"/oauth2/v1/userinfo\")\n\t\t\t\treturn response['picture'] if response['picture']\n\t\t\t\t\n\t\t\twhen \"myspace\"\n\t\t\t\tresponse = get(\"/v1.0/people/@me\")\n\t\t\t\treturn response['thumbnailUrl'] if response['thumbnailUrl']\n\t\t\t\t\n\t\t\twhen \"vimeo\"\n\t\t\t\tresponse = get(\"/api/v2/#{uid}/info.json\")\n\t\t\t\treturn response['portrait_medium']\n\t\t\t\t\n\t\t\twhen \"yahoo\"\n\t\t\t\tresponse = get(\"/v1/user/#{uid}/profile/tinyusercard\")\n\t\t\t\treturn response['profile']['image']['imageUrl']\n\t\t\t\t\n\t\t\twhen \"vkontakte\"\n\t\t\t\tresponse = get(\"api.php?method=getProfiles?uids=#{uid}&fields=photo_medium\")\n\t\t\t\treturn response['Response'][0]['Photo']\n\t\t\t\t\n\t\t\twhen \"lastfm\"\n\t\t\t\tresponse = get(\"/2.0/?method=user.getinfo&format=json&user=#{uid}&api_key=#{creds['id']}\")\n\t\t\t\treturn response['user']['image'][1]['#text']\n\t\t\t\t\n\t\t\twhen \"linkedin\"\n\t\t\t\tresponse = get(\"/v1/people/~\")\n\t\t\t\tlogger.debug response.inspect\n\t\t\t\t#return ???\n\t\t\t\t\n\t\t\twhen \"windowslive\"\n\t\t\t\tresponse = get(\"/v5.0/me/picture?access_token=#{access_token}\")\n\t\t\t\treturn response['person']['picture_url']\n\t\t\t\t\n\t\t\tend\n\t\trescue StandardError => e\n\t\t\tlogger.debug \"error fetching pictures from #{provider}\"\n\t\t\tlogger.debug e.to_yaml\n\t\tend\n\t\treturn nil\n\tend",
"title": ""
},
{
"docid": "980e5613b184fb13b42faf94232815d9",
"score": "0.71223986",
"text": "def avatar_url\n\t\t\"http://zombitar.com/#{id}.jpg\"\n\tend",
"title": ""
},
{
"docid": "9b02ccd7499889ad9c76e0d88d21b39a",
"score": "0.7104735",
"text": "def display_picture_url\n\t\tdisplay_picture.url(:original)\n\tend",
"title": ""
},
{
"docid": "8d77e227fb199910f6773355ecc57a4e",
"score": "0.7101664",
"text": "def get_image_profile_pic\n last_pic = images.where(\"kind = ?\", \"profile_pic\").last\n\n if last_pic.nil?\n return \"/assets/octacat-resized.png\"\n else\n last_pic.url\n end\n end",
"title": ""
},
{
"docid": "3c529044a8db84c62a32a3215f1bdc68",
"score": "0.7083849",
"text": "def avatar_url(user_id, avatar_id)\n \"#{api_base}/users/#{user_id}/avatars/#{avatar_id}.jpg\"\n end",
"title": ""
},
{
"docid": "8559754c5c62e8a3e4a0533a41c2ab8e",
"score": "0.7076956",
"text": "def gravatar_url\n hash = Digest::MD5.hexdigest(self.email)\n\n image_src = \"//www.gravatar.com/avatar/#{hash}?d=identicon\"\n end",
"title": ""
},
{
"docid": "e4aadd73f5f57605275058f07b3b3209",
"score": "0.70717883",
"text": "def user_url\n @raw['user']['url']\n end",
"title": ""
},
{
"docid": "ca0f8bc73b1031dc424f5f5d123bee45",
"score": "0.7070717",
"text": "def avatar\n object.avatar.url\n end",
"title": ""
},
{
"docid": "a6d233d696491fc526754850f2220e61",
"score": "0.70645183",
"text": "def image_url\n \"https://graph.facebook.com/#{id}/picture\"\n end",
"title": ""
},
{
"docid": "14880f884a05fd415d7be88810ff4536",
"score": "0.706299",
"text": "def profile_image(profile)\n url = Gravatar.new(profile.display_email || '@').image_url size: 40,\n secure: true, default: :mm\n image_tag url, alt: \"gravatar for #{profile.name}\",\n style: 'width: 40px; height: 40px;'\n end",
"title": ""
},
{
"docid": "532a1529a56a524a38010af7e6395a0e",
"score": "0.70547396",
"text": "def get_avatar_url(user_id)\n u = User.find_by_id( user_id)\n avatar = u.avatar.url(:thumb)\n unless u.avatar_file_size?\n avatar = false\n end\n return avatar || Settings.avatar_image \n end",
"title": ""
},
{
"docid": "1c25f765116e11ee84ece2ae3a50ae4d",
"score": "0.7046843",
"text": "def get_avatar\n u = User.find_by_id(self.id)\n if u.role == 'user'\n return u.avatar.url unless u.avatar.nil?\n else\n info = Info.find_by_email(self.email)\n return info.info_avatar.image.url unless info.nil?\n end\n return nil\n end",
"title": ""
},
{
"docid": "0e083409399015e7e4ec189654465783",
"score": "0.7042633",
"text": "def user_image_url # return the user image\n ((self.user_image.present?)?(self.user_image.url.to_s):nil) || self.photo_url || \"/assets/no-image.png\"\n end",
"title": ""
},
{
"docid": "4c57727e3921d2ecd4819395d84bbca1",
"score": "0.7032547",
"text": "def avatar_url\n \"https://avatars.githubusercontent.com/u/#{uid}?v=2\"\n end",
"title": ""
},
{
"docid": "04e9dc0cecdff621e83932bae43e9f13",
"score": "0.70305645",
"text": "def user_gravatar_url\n self.user.gravatar_url\n end",
"title": ""
},
{
"docid": "43464323d2665b3b18689cae3c8eec29",
"score": "0.70302176",
"text": "def avatar_url(style = :small)\n if avatar_file_name\n avatar.url(style)\n else\n url = avatar.url(style)\n providers.each do |e|\n next unless e.image_url\n\n url = e.image_url\n end\n url\n end\n end",
"title": ""
},
{
"docid": "ceff032c7e7bb6d96df630bfca5c059b",
"score": "0.70030856",
"text": "def avatar_url\n self.avatar.attachment.nil? ? '' :\n \"#{Rails.configuration.api_url}#{Rails.application.routes.url_helpers.rails_blob_path(self.avatar, only_path: true)}\"\n end",
"title": ""
},
{
"docid": "77cbc408fd0360576210f6c0c55d4158",
"score": "0.6993246",
"text": "def avatar_url\n self.avatar.attachment.nil? ? '' :\n \"#{Rails.configuration.api_url}#{Rails.application.routes.url_helpers.rails_blob_path(self.avatar, only_path: true)}\"\n end",
"title": ""
},
{
"docid": "4ed645134f26dba9fb3e157c23ec6f20",
"score": "0.6975709",
"text": "def get_profile_url_linkedin\n profile_url = self[:info][:urls][:public_profile] if self[:info] and self[:info][:urls]\n profile_url.gsub!(/^http:/, 'https:') if profile_url # protect cookies\n profile_url\n end",
"title": ""
},
{
"docid": "7b4de8cf60a260ef10495dc31b4a6761",
"score": "0.69651264",
"text": "def avatar_url(user)\n url = \"http://www.gravatar.com/avatar/#{Digest::MD5::hexdigest(user.email)}?d=mm\"\n image_tag(url, :alt => 'Avatar', :class => 'avatar')\n end",
"title": ""
},
{
"docid": "ef207ad518de2dc5d75fbdb52d2770cc",
"score": "0.6950534",
"text": "def profile_urls\n Enceladus::Configuration::Image.instance.url_for(\"profile\", profile_path)\n end",
"title": ""
},
{
"docid": "5d0b420c553d251de4da99e0df86835e",
"score": "0.6934993",
"text": "def default_url\n Settings.image.default_avatar\n end",
"title": ""
},
{
"docid": "5d0b420c553d251de4da99e0df86835e",
"score": "0.6934993",
"text": "def default_url\n Settings.image.default_avatar\n end",
"title": ""
},
{
"docid": "5d0b420c553d251de4da99e0df86835e",
"score": "0.6934993",
"text": "def default_url\n Settings.image.default_avatar\n end",
"title": ""
},
{
"docid": "a2d17c368f04b56c29b400653aab033a",
"score": "0.6928972",
"text": "def profile_image_uri(size=:normal)\n ::URI.parse(insecure_uri(profile_image_uri_https(size))) if @attrs[:profile_image_url_https]\n end",
"title": ""
},
{
"docid": "149f99147138dba0615d3f97f73beda0",
"score": "0.6916874",
"text": "def avatar_url_for(person, options = {})\n person.nil? ? nil : url\n end",
"title": ""
},
{
"docid": "3f6ccee2d5dc420d2a48ad3c89d11b2c",
"score": "0.6901398",
"text": "def avatar_url(options = {})\n options = {\n rating: 'pg',\n default: 'retro'\n }.merge(options)\n hash = Digest::MD5.hexdigest(object.email)\n\n uri = URI.parse(\"https://secure.gravatar.com/avatar/#{hash}\")\n uri.query = URI.encode_www_form(options)\n\n uri.normalize.to_s\n end",
"title": ""
},
{
"docid": "68e89972135a07b7da411045b38e4092",
"score": "0.6898196",
"text": "def show\n if @user_profile.image.attachment \n @profile_image = @user_profile.image\n else\n @profile_image = \"https://api.adorable.io/avatars/200/#{current_user.username}\" \n end\n end",
"title": ""
},
{
"docid": "dc56dbf474ceffbf5917e47dc7dfa264",
"score": "0.68869454",
"text": "def avatar_url\n uploaded ? avatar.url : \"/assets/no_avatar.png\"\n end",
"title": ""
},
{
"docid": "75344115f53b805f32705595a97ffd67",
"score": "0.6879629",
"text": "def fb_profile_pic(user, options={})\n options = options.dup\n validate_fb_profile_pic_size(options)\n options.merge!(:uid => cast_to_facebook_id(user))\n tag(\"fb:profile-pic\", stringify_vals(options))\n end",
"title": ""
},
{
"docid": "a2db97dd86dcff13fee71c149848e3c0",
"score": "0.68710685",
"text": "def avatar_url(user, size)\n gravatar_id = Digest::MD5.hexdigest(user.email.downcase)\n \"http://gravatar.com/avatar/#{gravatar_id}.png?s=#{size}\"\n end",
"title": ""
},
{
"docid": "fc3645273a3721a670e6c9202b578208",
"score": "0.685269",
"text": "def profile_url\n \"#{Steam::API::COMMUNITY_URL}/profiles/#{steam_id}\"\n end",
"title": ""
},
{
"docid": "7bb8e1295431c18325b4533c42c8411f",
"score": "0.6851242",
"text": "def smol_avatar_url\n # Gravatar uses MD5 hashes of people's email addresses, so it works well here.\n hash = Digest::MD5.hexdigest(email)\n \"http://www.gravatar.com/avatar/#{hash}?size=50px\"\n end",
"title": ""
},
{
"docid": "1a423c485c2fbbba24c6f41a15c8dddf",
"score": "0.68217844",
"text": "def fb_profile_pic(user, options={})\n validate_fb_profile_pic_size(options)\n options.merge!(:uid => cast_to_facebook_id(user))\n tag(\"fb:profile-pic\", options)\n end",
"title": ""
},
{
"docid": "a09d38f57e84d444267a2ef3ccfdbdf3",
"score": "0.6821143",
"text": "def avatar_url\n attachment = @object.avatar_attachment\n return if attachment.nil?\n\n Rails.application.routes.url_helpers.rails_blob_url(attachment, only_path: true)\n end",
"title": ""
}
] |
668d3fcaedfdf166d97b60d1d3d4474f
|
Query the configuration of a service using QueryServiceConfigW or QueryServiceConfig2W
|
[
{
"docid": "421a531afd39f2bfbdd4cb0b78145fbb",
"score": "0.0",
"text": "def service_start_type(service_name)\n start_type = nil\n open_service(service_name, SC_MANAGER_CONNECT, SERVICE_QUERY_CONFIG) do |service|\n query_config(service) do |config|\n start_type = SERVICE_START_TYPES[config[:dwStartType]]\n end\n end\n # if the service has type AUTO_START, check if it's a delayed service\n if start_type == :SERVICE_AUTO_START\n open_service(service_name, SC_MANAGER_CONNECT, SERVICE_QUERY_CONFIG) do |service|\n query_config2(service, SERVICE_CONFIG_DELAYED_AUTO_START_INFO) do |config|\n return :SERVICE_DELAYED_AUTO_START if config[:fDelayedAutostart] == 1\n end\n end\n end\n if start_type.nil?\n raise Puppet::Error.new(_(\"Unknown start type '%{start_type}' for '%{service_name}'\") % { start_type: start_type.to_s, service_name: service_name})\n end\n start_type\n end",
"title": ""
}
] |
[
{
"docid": "e1eb300cf3fe418c314b1a7fb5e115b9",
"score": "0.64543587",
"text": "def query_service\n Valkyrie.config.metadata_adapter.query_service\n end",
"title": ""
},
{
"docid": "a4f28e293425372492a0111a1b5c0cf8",
"score": "0.64202106",
"text": "def get_serv_config\n\t\taction = \"configuration\"\n\t\tresponse = call_api(action)\n\tend",
"title": ""
},
{
"docid": "adb1355c804014b43a9906bd2e1bd0de",
"score": "0.63610035",
"text": "def query_service\n Valkyrie.config.metadata_adapter.query_service\n end",
"title": ""
},
{
"docid": "64778b3dffee53ef7a0f19e48a416dc2",
"score": "0.6096478",
"text": "def find_service(service)\n @configs[service]\n end",
"title": ""
},
{
"docid": "7448a57bd223c7ec93b5bc77d6787bd7",
"score": "0.6007238",
"text": "def services(query = {})\n get('service', query)\n end",
"title": ""
},
{
"docid": "a6af88fcd83e59c7a3d5a0222ca67369",
"score": "0.5905595",
"text": "def query_service(service)\n #remove on production/create testing case?\n resp = @client.get_content(service)\n @@logger.debug \"Service succesfully queried\"\n\n return resp\n end",
"title": ""
},
{
"docid": "f0157d2c9642b91e9fc12f9cd223f026",
"score": "0.57571787",
"text": "def config\n system_config.send(service_name.to_sym) || []\n end",
"title": ""
},
{
"docid": "72ce39b81c67aa8460432f7f94fe59f6",
"score": "0.56428283",
"text": "def configure(service_name, configurations); end",
"title": ""
},
{
"docid": "2b3c811ad79852230bb69b166abc2c0c",
"score": "0.56011",
"text": "def query_settings(options={})\n path = \"/api/v2/settings\"\n get(path, options)\n end",
"title": ""
},
{
"docid": "b4f410b47708e2ac9e3275a4aee0e30b",
"score": "0.55603576",
"text": "def config_service?\n true\n end",
"title": ""
},
{
"docid": "e3b7ddceca090314a88b2edb7fd6e1ee",
"score": "0.54357237",
"text": "def service_query_state(name)\n\t\tif session_has_services_depend?\n\t\t\t#meterpreter_service_query_state(name)\n\t\t\tNOTIMP\n\t\telse\n\t\t\tshell_service_query_state(name)\n\t\tend\t\n\tend",
"title": ""
},
{
"docid": "ce55eaf568d822c908317a09d150237f",
"score": "0.5363198",
"text": "def search_service\n Blacklight::SearchService.new(config: blacklight_config, user_params: {})\n end",
"title": ""
},
{
"docid": "96c2a09fba4f001d2464b14f6148e4a0",
"score": "0.53517646",
"text": "def fetch_configuration\n url = @url + \"?type=configuration&dataset=#{@name}\"\n document = REXML::Document.new( request( :url => url ) )\n\n # Top-Level filters...\n REXML::XPath.each( document, '//FilterDescription' ) do |f|\n unless f.attributes[\"displayType\"].eql? \"container\"\n @filters[ f.attributes[\"internalName\"] ] = Filter.new( f.attributes )\n end\n end\n \n # Filters nested inside containers...\n REXML::XPath.each( document, '//FilterDescription/Option' ) do |f|\n if f.attributes[\"displayType\"] != nil\n @filters[ f.attributes[\"internalName\"] ] = Filter.new( f.attributes )\n end\n end\n \n # Attributes are much simpler...\n REXML::XPath.each( document, '//AttributeDescription' ) do |a|\n @attributes[ a.attributes[\"internalName\"] ] = Attribute.new( a.attributes )\n end\n end",
"title": ""
},
{
"docid": "4cbd74af848f93c0baf3605857ea49d6",
"score": "0.53269184",
"text": "def service\n options[:service]\n end",
"title": ""
},
{
"docid": "d95483c971740546d8bcb42de57bb594",
"score": "0.5278515",
"text": "def acquire_service_data\n if config[:tags] && config[:service]\n tags = config[:tags].split(',').to_set\n services = []\n Diplomat::Health.service(config[:service]).each do |s|\n if s['Service']['Tags'].to_set.superset? tags\n services.push(*s['Checks'])\n end\n end\n services\n elsif config[:nodename]\n data = []\n begin\n services = Diplomat::Node.get(config[:nodename]).Services\n rescue StandardError\n services = {}\n end\n services.each_value do |service|\n Diplomat::Health.checks(service['Service']).each do |check|\n data.push(check) if check.Node == config[:nodename]\n end\n end\n data\n elsif config[:all]\n Diplomat::Health.state('any')\n else\n Diplomat::Health.checks(config[:service])\n end\n end",
"title": ""
},
{
"docid": "1afb1214bb969f641ae6a990a42742ad",
"score": "0.52706224",
"text": "def lookup_config(name)\n\t\tend",
"title": ""
},
{
"docid": "fb82e26a1dd2c9a088b78eba06cfd851",
"score": "0.52560425",
"text": "def query\n # support names, portorigin, pkgname and portname\n (inst = self.class.instances([name]).last) ? inst.properties : nil\n end",
"title": ""
},
{
"docid": "29818a0bb7dd5544a501549b3c6fec24",
"score": "0.52514946",
"text": "def query\n Puppet.debug \"Querying #{@resource[:name]}\"\n app = mas_app\n hash = {\n :provider => self.name,\n :ensure => app.nil? ? :absent : app[:ensure],\n }\n\n @property_hash.update(hash)\n @property_hash.dup\n end",
"title": ""
},
{
"docid": "dddc890cdaeb0d1c59daaa3b7349aabf",
"score": "0.5229043",
"text": "def query_for_services(type = nil, pool = nil)\n\n raise \"Type must not be nil if pool is nil\" if type.nil? && !pool.nil?\n\n @discovery_urls.each do |discovery_url|\n resource = \"/v1/service\"\n resource += \"/#{type}\" if ! type.nil?\n resource += \"/#{pool}\" if ! pool.nil?\n\n service_uri = URI.parse(discovery_url).merge(resource)\n\n @logger.debug(\"Get Request: #{service_uri.to_s}\")\n\n begin\n response = @client.get(service_uri.to_s, nil, nil)\n\n if response.status >= 200 && response.status <= 299\n service_data = JSON.parse(response.body)\n\n return service_data\n end\n\n @logger.error(\"#{service_uri.to_s}: Response Status #{response.status}\")\n @logger.error(response.body)\n\n rescue\n @logger.error(\"#{service_uri.to_s}: #{$!}\")\n end\n\n end\n\n raise \"Failed to get all services from any of [ #{@discovery_urls.join(\",\")} ]\"\n\n end",
"title": ""
},
{
"docid": "d7f2f5cd4eff85c46c7abe8ba819775b",
"score": "0.5217608",
"text": "def search\n @config[:search]\n end",
"title": ""
},
{
"docid": "ae4e1f4e68c49a252b02e8139accb845",
"score": "0.5209846",
"text": "def service\n URI.parse(@config.split('<')[0].split('->')[1])\n end",
"title": ""
},
{
"docid": "4fcb490f5b46f749e59f0cc8f06948dc",
"score": "0.52051324",
"text": "def configuration\n cfg = {:service => @service}\n cfg[:acl] = @acl.name if (@acl)\n cfg[:avpairs] = @avpairs if (@avpairs)\n cfg[:network_av] = @network_av.configuration if (@network_av)\n cfg[:shell_command_av] = @shell_command_av.configuration if (@shell_command_av)\n return(cfg)\n end",
"title": ""
},
{
"docid": "bee46e0695453a28ebc447d3001f34dd",
"score": "0.52041894",
"text": "def find_datasource(doc, number_instances)\n # When only one service instance is bound, then we do not require matching config ids. When multiple service instances are bound, we do.\n if number_instances == 1\n # tolerate degenerate condition of multiple datasources configured but only 1 is bound.\n datasources = doc.elements.to_a(\"//dataSource[@id='#{@datasource_id}']\")\n datasources = doc.elements.to_a('//dataSource') if datasources.empty?\n else\n datasources = doc.elements.to_a(\"//dataSource[@id='#{@datasource_id}']\")\n end\n return datasources if datasources.empty?\n raise \"The datasource configuration for service #{@service_name} is inconsistent\" unless Utils.logical_singleton?(datasources)\n datasources\n end",
"title": ""
},
{
"docid": "a555b555ec1239a87f5a579fcb296dbf",
"score": "0.5189935",
"text": "def get_config()\n return @api.do_request(\"GET\", get_base_api_path() + \"/config\")\n end",
"title": ""
},
{
"docid": "1d7a564a6e6419b771921722050bad80",
"score": "0.5162246",
"text": "def all(options = {})\n out = xml_run build_command('services', options.merge(:get => XML_COMMANDS_GET))\n convert_output(out.fetch(:stream, {}).fetch(:service_list, {}).fetch(:service, []), :service)\n end",
"title": ""
},
{
"docid": "96d4eddbf992d0e48b7acc212cb65744",
"score": "0.51485276",
"text": "def [](key)\n\n if SERVICE_PREFIX.match(key)\n @services[key]\n else\n conf[key]\n end\n end",
"title": ""
},
{
"docid": "3452cd2a8f315b81256909beddc0f3cf",
"score": "0.51399195",
"text": "def find(properties)\n if properties.nil? or properties.empty?\n raise \"Properties should be specified\"\n end\n\n check_property_value(properties, :type)\n\n url = \"config/#{properties[:type]}?\"\n\n properties.each do |property_name, property_value|\n url << \"s.#{property_name}=#{property_value}&\"\n end\n\n get(URI.escape(url), :rows => :all)\n end",
"title": ""
},
{
"docid": "866eb021e11074851aad76b5c16aaee9",
"score": "0.51260686",
"text": "def get_uptime_check_config config_name\n require \"google/cloud/monitoring\"\n\n client = Google::Cloud::Monitoring.uptime_check_service\n config = client.get_uptime_check_config name: config_name\n pp config.to_h\n config\nend",
"title": ""
},
{
"docid": "639d961032674cf81daf7571a80c2051",
"score": "0.5105899",
"text": "def query\n self.class.instances.any? do |provider_sm|\n provider_sm.properties if @resource[:name] == provider_sm.name\n end || nil\n end",
"title": ""
},
{
"docid": "849ad987356805055958e843378cf857",
"score": "0.5100721",
"text": "def getConfigByKey(key, domain = \"grid\") \n qs = <<CONFIG_Q\nSELECT testbeds.#{key} \n FROM testbeds\nWHERE testbeds.node_domain='#{domain}';\nCONFIG_Q\n \n value = nil\n runQuery(qs) { |v| \n value = v\n }\n return value\n end",
"title": ""
},
{
"docid": "522bbf31d1b2b51d8a64c81e2a10e5cb",
"score": "0.50895125",
"text": "def service\n @service\n end",
"title": ""
},
{
"docid": "16b42491921d3fe68426442a6d181600",
"score": "0.5064406",
"text": "def get_current_service_config\n return RaisEcs::ServiceConfig.new({\n service_instance_id: self.get_service_arn,\n cluster: @cluster,\n service: self,\n desired_count: self.get_desired_count,\n container_config: self.get_primary_container_config\n })\n end",
"title": ""
},
{
"docid": "b02999a7979309c954376a8db926d804",
"score": "0.50642234",
"text": "def findServiceDir(params = @@params)\n if (@@serviceDir != nil)\n return @@serviceDir\n end\n searchPath = (params[:configDir] || ENV['GRID_SERVICES_DIR'] || DEF_SEARCH_PATH).to_a\n [\"enabled\", \"available\"].each {|dir|\n searchPath.each { |configDir|\n path = \"#{configDir}/#{dir}\"\n if File.directory?(path)\n params[:serviceDir] = path\n params[:configDir] = configDir\n @@serviceDir = path\n return path\n end\n }\n }\n MObject.error('services', \"Can't find service directory in '#{searchPath.join(':')}\")\n return nil\nend",
"title": ""
},
{
"docid": "b02999a7979309c954376a8db926d804",
"score": "0.50642234",
"text": "def findServiceDir(params = @@params)\n if (@@serviceDir != nil)\n return @@serviceDir\n end\n searchPath = (params[:configDir] || ENV['GRID_SERVICES_DIR'] || DEF_SEARCH_PATH).to_a\n [\"enabled\", \"available\"].each {|dir|\n searchPath.each { |configDir|\n path = \"#{configDir}/#{dir}\"\n if File.directory?(path)\n params[:serviceDir] = path\n params[:configDir] = configDir\n @@serviceDir = path\n return path\n end\n }\n }\n MObject.error('services', \"Can't find service directory in '#{searchPath.join(':')}\")\n return nil\nend",
"title": ""
},
{
"docid": "1d494d69d1109f451fe263038c6fb039",
"score": "0.5057928",
"text": "def service\n :search\n end",
"title": ""
},
{
"docid": "4118cab96d2567a436a7a537c7a85967",
"score": "0.5046344",
"text": "def configuration(options = {})\n client = extract_client!(options)\n response = client.get(\"/api/system/configuration\")\n\n REXML::Document.new(response)\n end",
"title": ""
},
{
"docid": "80b2c28a21985e927662159441196810",
"score": "0.5028384",
"text": "def crud_get_all(resource_name, service_name, api_options = {})\n api_options = get_defaults(api_options)\n get '/'+resource_name do\n service = settings.send(service_name)\n\n sanitize_params(params)\n # Check query validity\n return 400 unless service.valid_query?(params)\n\n # Return Regions on Query\n JSON.fast_generate service.get_all_by_query(params)\n end\n end",
"title": ""
},
{
"docid": "09fc79cd3dbb84b8db188f13a10fe6dc",
"score": "0.502507",
"text": "def get_config(key)\n\t\t@conn.config.get_property(key, '')\n\tend",
"title": ""
},
{
"docid": "22b0d152e25669135a4dbd9e96a703c5",
"score": "0.5015499",
"text": "def configuration\n _get(\"/system/configuration\") { |json| json }\n end",
"title": ""
},
{
"docid": "189409d08be01bcf84e370391c9573b7",
"score": "0.49911273",
"text": "def services\n unless @services\n rows = database.view(VIEW_NAME, reduce: false, key: [1, name])['rows'] rescue []\n ids = rows.map {|row| row['value'] }\n @services = Service.all.keys(ids).to_a\n end\n @services\n end",
"title": ""
},
{
"docid": "73cc78e910eb518237fe1aa07c15cc03",
"score": "0.49835554",
"text": "def query\n command = resource_or_provider_command\n self.class.validate_command(command)\n\n self.class.instances(command).each do |pkg|\n return pkg.properties if @resource[:name].casecmp(pkg.name).zero?\n end\n return nil\n end",
"title": ""
},
{
"docid": "51eaf4043f611f33257f5e88bf45b70b",
"score": "0.4978955",
"text": "def get_config\n if @resource[:section]\n return node.get_config(params: \"section #{@resource[:section]}\", as_string: true)\n end\n node.running_config\n end",
"title": ""
},
{
"docid": "a5822896e001982b5dc84d0e2b9de788",
"score": "0.4967858",
"text": "def get_service_name\n\t\t\t\traise \"Should return the a service name from config.wsdl keys\"\n\t\t\tend",
"title": ""
},
{
"docid": "99b328fe9d2b4fc8330fa0fee9108470",
"score": "0.49657536",
"text": "def find_service(filter, *required_credentials)\n select(&service?(filter))\n .find(&credentials?(required_credentials))\n end",
"title": ""
},
{
"docid": "8cbc776056e87ea572d3296a820748f4",
"score": "0.49629065",
"text": "def get_service_status\n operation('GetServiceStatus')\n run\n end",
"title": ""
},
{
"docid": "8cbc776056e87ea572d3296a820748f4",
"score": "0.49629065",
"text": "def get_service_status\n operation('GetServiceStatus')\n run\n end",
"title": ""
},
{
"docid": "8cbc776056e87ea572d3296a820748f4",
"score": "0.49629065",
"text": "def get_service_status\n operation('GetServiceStatus')\n run\n end",
"title": ""
},
{
"docid": "8cbc776056e87ea572d3296a820748f4",
"score": "0.49629065",
"text": "def get_service_status\n operation('GetServiceStatus')\n run\n end",
"title": ""
},
{
"docid": "8cbc776056e87ea572d3296a820748f4",
"score": "0.49629065",
"text": "def get_service_status\n operation('GetServiceStatus')\n run\n end",
"title": ""
},
{
"docid": "8cbc776056e87ea572d3296a820748f4",
"score": "0.49629065",
"text": "def get_service_status\n operation('GetServiceStatus')\n run\n end",
"title": ""
},
{
"docid": "8cbc776056e87ea572d3296a820748f4",
"score": "0.49629065",
"text": "def get_service_status\n operation('GetServiceStatus')\n run\n end",
"title": ""
},
{
"docid": "8cbc776056e87ea572d3296a820748f4",
"score": "0.49629065",
"text": "def get_service_status\n operation('GetServiceStatus')\n run\n end",
"title": ""
},
{
"docid": "8cbc776056e87ea572d3296a820748f4",
"score": "0.49629065",
"text": "def get_service_status\n operation('GetServiceStatus')\n run\n end",
"title": ""
},
{
"docid": "d39cee12bf62f89bedee620b55dd0854",
"score": "0.49577698",
"text": "def param_service_full_name(options = {})\n merge_options_with_defaults(options, {\n :mandatory => true,\n :lookup_method => lambda do |request| \n @op.with_machine(request.get_param_value(\"machine\")) do |machine| \n localhost.list_services().map do |x|\n x[\"full_name\"]\n end\n end\n end \n })\n RHCP::CommandParam.new(\"service\", \"the service to work with\", options)\nend",
"title": ""
},
{
"docid": "49b0e6ee1d434f7fdec5afd912a33549",
"score": "0.49356598",
"text": "def get_config\n\t\tend",
"title": ""
},
{
"docid": "4d018eb16f1d3ae7ade6b02e0eee0d93",
"score": "0.49342823",
"text": "def query\n @options[:query].presence\n end",
"title": ""
},
{
"docid": "3f9a9d8897864a5c311ea4da09832f6f",
"score": "0.4926562",
"text": "def enum_configs\n host = session.session_host\n port = session.session_port\n exec_commands = [\n {\n 'cmd' => '/export verbose',\n 'fn' => 'get_config',\n 'desc' => 'Get Device Config on Mikrotik Device'\n },\n ]\n exec_commands.each do |ec|\n command = ec['cmd']\n cmd_out = session.shell_command(command).gsub(/#{command}/, '')\n print_status(\"Gathering info from #{command}\")\n # detect if we're in pagination and get as much data as possible\n if ec['fn'] == 'get_config'\n mikrotik_routeros_config_eater(host, port, cmd_out.strip)\n else\n cmd_loc = store_loot(\"mikrotik.#{ec['fn']}\",\n 'text/plain',\n session,\n cmd_out.strip,\n \"#{ec['fn']}.txt\",\n ec['desc'])\n vprint_good(\"Saving to #{cmd_loc}\")\n end\n end\n end",
"title": ""
},
{
"docid": "a095896918e68567ac7a9009dff86d55",
"score": "0.49258667",
"text": "def get_services()\n return get_request(address(\"/OS-KSADM/services\"), token())\n end",
"title": ""
},
{
"docid": "24567f2e78997b20c73b69254210a094",
"score": "0.4918607",
"text": "def index\n @services = Service.all\n\n # If a type of host is passed, check if it's a number and a valid host type.\n check_priority_param\n @services = @services.where(:priority => @priority) if (!@priority.blank?)\n\n # If a search query is received, filter the results\n if (!params[:q].blank?)\n # Do the search\n @query = params[:q]\n @services = @services.where(\"$or\" => [{:name => /#{@query}/i}, {:description => /#{@query}/i}, {:probe => /#{@query}/i}])\n end\n\n # If a page number is received, save it (if not, the page is the first)\n if (!params[:page].blank?)\n page = params[:page].to_i\n page = 1 if (page < 1)\n else\n page = 1\n end\n \n # Paginate!\n @services = @services.page(page)\n\n respond_to do |format|\n format.html\n end\n end",
"title": ""
},
{
"docid": "9e09e0d003d6cd84e3fb0771a18d016a",
"score": "0.4915272",
"text": "def query\n self.class.instances.each do |pkg|\n return pkg.properties if pkg.name == @resource[:name]\n end\n return nil\n end",
"title": ""
},
{
"docid": "51ddbea311cdda7d10e4c8ed5acb6be0",
"score": "0.491389",
"text": "def select(params = {})\n if params.has_key?(:path)\n path_regex = params[:path]\n path_regex = Regexp.new(path_regex.to_s) unless path_regex.is_a?(Regexp)\n selector = lambda {|agent| agent.config_path && path_regex.match(agent.config_path) }\n notify(:msg => \"[#{@name}] Selecting all services for path #{path_regex.inspect}\",\n :tags => [:galaxy, :trace])\n elsif params.has_key?(:type)\n type_regex = params[:type]\n type_regex = Regexp.new(type_regex.to_s) unless type_regex.is_a?(Regexp)\n selector = lambda {|agent| agent.config_path && type_regex.match(agent.type) }\n notify(:msg => \"[#{@name}] Selecting all services of type #{type_regex.inspect}\",\n :tags => [:galaxy, :trace])\n elsif params.has_key?(:core_type)\n core_type_regex = params[:core_type]\n core_type_regex = Regexp.new(core_type_regex.to_s) unless core_type_regex.is_a?(Regexp)\n selector = lambda {|agent| agent.config_path && core_type_regex.match(agent.core_type) }\n notify(:msg => \"[#{@name}] Selecting all services of core type #{core_type_regex.inspect}\",\n :tags => [:galaxy, :trace])\n elsif params.has_key?(:host) || params.has_key?(:hosts)\n host_names = arrayify(params[:host]) & arrayify(params[:hosts])\n selector = lambda {|agent| host_names.include?(agent.host) }\n notify(:msg => \"[#{@name}] Selecting all services for hosts #{host_names.inspect}\",\n :tags => [:galaxy, :trace])\n else\n notify(:msg => \"[#{@name}] Selecting all services\",\n :tags => [:galaxy, :trace])\n end\n command = ::Galaxy::Commands::ShowCommand.new([], @galaxy_options)\n command.report = GalaxyGatheringReport.new(@environment)\n agents = command.select_agents({})\n agents.each { |agent| agent.proxy = ::Galaxy::Transport.locate(agent.url) if agent.url }\n command.execute(agents)\n command.report.results.select {|result| selector.nil? || selector.call(result) }\n end",
"title": ""
},
{
"docid": "ab789cd4cef088d7cb29841504bf7631",
"score": "0.4902916",
"text": "def has_custom_config(key, value)\n includes(:configurations)\n .where(configurations: { key: key, value: value.to_s })\n end",
"title": ""
},
{
"docid": "697c93f89df782eb12654893317eeca7",
"score": "0.4900712",
"text": "def index\n conditions = []\n params[:per_page] = perpage if params[:per_page].nil?\n params[:page] = 1 if params[:page].blank?\n unless params[:search].blank?\n conditions.push \"config_type like ? or key like ?\"\n conditions.push \"%#{params[:search]}%\"\n conditions.push \"%#{params[:search]}%\"\n end\n @kf_global_configs = Kf::GlobalConfig.order(\"id DESC\").paginate(:page => params[:page], :per_page => params[:per_page] ,:conditions => conditions)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @kf_global_configs }\n end\n end",
"title": ""
},
{
"docid": "eabac8d5a40f71a944cee88eeb67aaa7",
"score": "0.49002722",
"text": "def get_configuration(alias_param, intent, extra_parameters)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'alias', alias_param)\n\t\t\tclient.add_param(kparams, 'intent', intent)\n\t\t\tclient.add_param(kparams, 'extraParameters', extra_parameters)\n\t\t\tclient.queue_service_action_call('paymentgatewayprofile', 'getConfiguration', 'KalturaPaymentGatewayConfiguration', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend",
"title": ""
},
{
"docid": "1b32c107369d3c608f63464a55bdf46b",
"score": "0.48945934",
"text": "def services(format: '{{.Names}}', status: :running, **filters); end",
"title": ""
},
{
"docid": "066a3180211cba7d8aec210370243521",
"score": "0.4892374",
"text": "def query\n self.class.instances.each do |provider_pip|\n return provider_pip.properties if @resource[:name] == provider_pip.name\n end\n return nil\n end",
"title": ""
},
{
"docid": "066a3180211cba7d8aec210370243521",
"score": "0.4892374",
"text": "def query\n self.class.instances.each do |provider_pip|\n return provider_pip.properties if @resource[:name] == provider_pip.name\n end\n return nil\n end",
"title": ""
},
{
"docid": "066a3180211cba7d8aec210370243521",
"score": "0.4892374",
"text": "def query\n self.class.instances.each do |provider_pip|\n return provider_pip.properties if @resource[:name] == provider_pip.name\n end\n return nil\n end",
"title": ""
},
{
"docid": "cf34106b22088eff73765738af297371",
"score": "0.48911476",
"text": "def search_status(...)\n SearchService.active_status\n end",
"title": ""
},
{
"docid": "36bb3043b72c8f8ab1ec77b986d4091e",
"score": "0.4876486",
"text": "def services\n\t\tService.find(:all)\n\tend",
"title": ""
},
{
"docid": "6399ab4a67660a6cc5eba4c02aa2ce20",
"score": "0.4875952",
"text": "def process_service_config\n @unbound_config = UnboundConfig.new(options[:service])\n end",
"title": ""
},
{
"docid": "89433f35fe4a85be182d94b4490c2680",
"score": "0.48630953",
"text": "def determine_services(specified_groups = []) \n services = {}\n\n activated_service_groups = self.config.select do |group_id, group_definition|\n ((group_id == \"default\" || group_definition[\"default\"] == true) ||\n specified_groups.include?(group_id)) &&\n ! specified_groups.include?(\"-#{group_id}\")\n end\n\n activated_service_groups.each_pair do |group_id, group_definition|\n services.merge! (group_definition[\"services\"] || {})\n end\n\n # Remove any disabled services\n services.reject! {|service_id, hash| hash && hash[\"disabled\"] == true}\n\n return services\n end",
"title": ""
},
{
"docid": "f698585116a2e3a9bfd005d3fd4e33f5",
"score": "0.4861375",
"text": "def list_uptime_check_configs project_id\n require \"google/cloud/monitoring\"\n\n client = Google::Cloud::Monitoring.uptime_check_service\n project_name = client.project_path project: project_id\n configs = client.list_uptime_check_configs parent: project_name\n\n configs.each { |config| puts config.name }\nend",
"title": ""
},
{
"docid": "270851b9a4db029fbc0b1b1a43c2b11f",
"score": "0.48581955",
"text": "def describe_configuration_options(options={})\n if option_filters = options.delete('Options')\n options.merge!(AWS.indexed_param('Options.member.%d', [*option_filters]))\n end\n request({\n 'Operation' => 'DescribeConfigurationOptions',\n :parser => Fog::Parsers::AWS::ElasticBeanstalk::DescribeConfigurationOptions.new\n }.merge(options))\n end",
"title": ""
},
{
"docid": "865938223c0b165d8775e40121bfafeb",
"score": "0.48577613",
"text": "def get_service_status(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'GetServiceStatus'\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? :account_id\n\t\t\targs[:query]['AccountId'] = optional[:account_id]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "1516fd6c2165506271e359d58af101e8",
"score": "0.48509306",
"text": "def get_config(url_prefix)\n request = Net::HTTP::Get.new(\"#{@jenkins_path}#{url_prefix}/config.xml\")\n @logger.debug \"GET #{url_prefix}/config.xml\"\n response = make_http_request(request)\n handle_exception(response, \"body\")\n end",
"title": ""
},
{
"docid": "439c4ac677a2e6aa6a39a733d821eebc",
"score": "0.48501682",
"text": "def services\n\t\tselect {|x| x.class == Service }\n\tend",
"title": ""
},
{
"docid": "9b17cb7882f714a295f2a1b843b1cbb4",
"score": "0.48490432",
"text": "def service\n @service ||= fetcher.get(Service, service_id)\n end",
"title": ""
},
{
"docid": "590380334af6d006cc96eb75969b779f",
"score": "0.48405594",
"text": "def call_with_config_params\n disciplina = Iesde::Model::Disciplina.buscar(\n config: {\n user: ENV['IESDE_USER'],\n password: ENV['IESDE_PWD'],\n ead_api_key: ENV['EAD_API_KEY']\n }).select {|d| d.disciplina_id.to_i == 123 }.first\n\n ap disciplina.aulas(12345)\nend",
"title": ""
},
{
"docid": "0d1b1498a2e4cb5f284dfebf0386ca5b",
"score": "0.4839277",
"text": "def service(cfg)\n defaults = { 'state' => 'active' }\n cfg = defaults.merge(cfg)\n query = format(\n \"node_systemd_unit_state{name='%s',state='%s'}\",\n cfg['name'], cfg['state']\n )\n prepare_metrics('service', @client.query(query))\n end",
"title": ""
},
{
"docid": "dfa77cd77b9064a9490af57bbe026cc2",
"score": "0.48383865",
"text": "def service_params\n params[:service]\n end",
"title": ""
},
{
"docid": "50b19f2d425786a09eea082bf67b1e62",
"score": "0.48347843",
"text": "def query\n self.class.instances.each do |instance|\n if instance.name == name || instance.name.downcase == name\n return instance.properties\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "67b21ad078e10c4d256e9eefdce11c27",
"score": "0.48237383",
"text": "def get(id)\n\t\t\tkparams = {}\n\t\t\tclient.add_param(kparams, 'id', id)\n\t\t\tclient.queue_service_action_call('configurations', 'get', 'KalturaConfigurations', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend",
"title": ""
},
{
"docid": "653119dda15b6cb97233a16a9bd0c567",
"score": "0.48226872",
"text": "def services()\n return @data[\"access\"][\"serviceCatalog\"]\n end",
"title": ""
},
{
"docid": "0e75bd28a2e5b026fa5a4636f3a3fc9e",
"score": "0.48223892",
"text": "def configuration\n Configuration::get\n end",
"title": ""
},
{
"docid": "0e75bd28a2e5b026fa5a4636f3a3fc9e",
"score": "0.48223892",
"text": "def configuration\n Configuration::get\n end",
"title": ""
},
{
"docid": "fff6d79fe8c206106bd0e1f820bde179",
"score": "0.4818147",
"text": "def get_settings\n return @client.raw(\"get\", \"/config/settings\")\n end",
"title": ""
},
{
"docid": "9780e170f1e5294f99bd0382e53ce58b",
"score": "0.48163176",
"text": "def settings(svc_name = @service_name)\n\t\tif @settings.nil?\n\t\t\t$log.debug(\"#{self.class}.#{__method__}() - caching settings for #{svc_name}\")\n\t\t\t@settings = self.class.dictionaryFromServeradmin(svc_name)\n\t\tend\n\t\treturn @settings\n\tend",
"title": ""
},
{
"docid": "2c82bf983bfe5c2ea55dc9c61cce22cc",
"score": "0.48133296",
"text": "def with_service(node, service)\n mapping = CONF['service_mappings']\n if mapping and mapping[service]\n mapping[service].include?(name(node))\n end\nend",
"title": ""
},
{
"docid": "03e686872b84bc2146cf8085d11dc522",
"score": "0.48120084",
"text": "def find_from_config(xpath, config, options = {})\n name_node = REXML::XPath.match(config, xpath)\n return nil if name_node.empty?\n\n properties = Util.xml_to_hash(name_node[0].parent, \"search\")\n from_hash(properties, options)\n end",
"title": ""
},
{
"docid": "2902c588fbefdcf786f83c0c883a01f3",
"score": "0.48118526",
"text": "def api_v11_cm_service_config_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_cm_service_config_get ...\"\n end\n \n # resource path\n path = \"/api/v11/cm/service/config\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n query_params[:'view'] = opts[:'view'] if opts[:'view']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\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 = []\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 = []\n data, status_code, headers = @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 if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_v11_cm_service_config_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "c7dadd5150ce72fb3f974b1b5a47eec1",
"score": "0.48098367",
"text": "def configuration(name)\n Alchemy::Config.get(name)\n end",
"title": ""
},
{
"docid": "2abdfcdbd09b0e572c9c5e178ee1d804",
"score": "0.48046604",
"text": "def find_service\n if params[:service_id].present?\n @service = @provider.services.find_by_id(params[:service_id])\n end\n end",
"title": ""
},
{
"docid": "0364b16b6ea6087d7292bf29fef61c02",
"score": "0.47957256",
"text": "def method_missing(sym, *args, &block)\n # Get a list of all the services (convert symbols to lower case)\n services = Trackerific.services.map { |service| service.to_s.downcase.to_sym }\n # Do not accept any configuration values for anything except services\n raise NoMethodError unless services.include? sym\n unless args.empty?\n # Only accept Hashes\n raise ArgumentError unless args[0].class == Hash\n # Validate configuration values against the required parameters for that service\n service = Trackerific.service_get(sym)\n validate_options args[0], service.required_parameters, service.valid_options\n # Store the configuration options\n @options[sym] = args[0]\n end\n # return the configuration options\n @options[sym]\n end",
"title": ""
},
{
"docid": "880257e943faaa868e55ffd950974ac2",
"score": "0.47824153",
"text": "def service; services.first; end",
"title": ""
},
{
"docid": "d434c1faf4b08f67117a9163588f5d44",
"score": "0.4780257",
"text": "def config_fgservice(servicename, lowport, highport, comment, category, type, proto)\n\n config = String.new\n\n#####################################\n# TCP and Destination Entry\n####################################\n if type == :dst && proto == :tcp\n\n fgservice = <<-EOS\n edit #{servicename}\n set tcp-portgrange #{lowport} #{highport}\n set category #{category}\n set comment \"#{comment}\"\n next\n EOS\n\n config += fgservice\n end\n\n####################################\n# UDP and Destination Entry\n####################################\n if type == :dst && proto == :udp\n\n fgservice = <<-EOS\n edit #{servicename}\n set udp-portgrange #{lowport} #{highport}\n set category #{category}\n set comment \"#{comment}\"\n next\n EOS\n\n config += fgservice\n end\n\n###################################\n# TCP and Source Entry\n####################################\n if type == :src && proto == :tcp\n\n fgservice = <<-EOS\n edit #{servicename}\n set tcp-portgrange 1 65535 #{lowport} #{highport}\n set category #{category}\n set comment \"#{comment}\"\n next\n EOS\n\n config += fgservice\n end\n\n###################################\n# UDP and Source Entry\n####################################\n if type == :src && proto == :udp\n\n fgservice = <<-EOS\n edit #{servicename}\n set udp-portgrange 1 65535 #{lowport} #{highport}\n set category #{category}\n set comment \"#{comment}\"\n next\n EOS\n\n config += fgservice\n end\n\n###################################\n# ICMP Service Entry\n####################################\n if type == :icmp && proto == :icmp\n\n fgservice = <<-EOS\n edit #{servicename}\n set protocol ICMP\n set icmptype #{lowport}\n set category #{category}\n set comment \"#{comment}\"\n next\n EOS\n\n config += fgservice\n end\n\n return config\nend",
"title": ""
},
{
"docid": "43ea40741686d75c791b37e52ae67686",
"score": "0.47737032",
"text": "def find_by_service_name(name)\n service = locator.find_by_name(name)\n service['credentials'] if service\n end",
"title": ""
},
{
"docid": "0c5582cf16982086c20f6da8d0858a03",
"score": "0.47735783",
"text": "def get_wsdl_opt(version_name, service_name)\n optcmd= {}\n optcmd['classdef'] = service_name\n optcmd['force'] = true\n optcmd['mapping_registry'] = true\n optcmd['driver'] = nil\n\n # Causes soap4r to wrap the classes it outputs into the given modules\n optcmd['module_path'] = ['AdWords', version_name.capitalize, service_name]\n return optcmd\nend",
"title": ""
},
{
"docid": "2b3b685aa793107fb725d43f5eba62ee",
"score": "0.47720188",
"text": "def config_get(id)\n Configuration.get(id)\n end",
"title": ""
},
{
"docid": "4e221844f262e59245320ed1f9993a64",
"score": "0.4769969",
"text": "def read_service_plans()\n @client.service_plans\n end",
"title": ""
},
{
"docid": "77b49acea78dd84e44d987eca1d69efa",
"score": "0.47685495",
"text": "def list_services\n @services\n end",
"title": ""
}
] |
9d7d5593dd5a1115d1737a32fb5175e5
|
Process the scale results for the current iteration, update the CSV file, fail if KOs are found
|
[
{
"docid": "e3561a773ffef9a98b888049376f65f2",
"score": "0.55703866",
"text": "def check_scale_results(scenario_hash) # rubocop:disable Metrics/AbcSize\n scenario = scenario_hash[:name]\n scale_scenario_instances = scenario_hash[:instances]\n success = true\n\n puts \"Checking results for scenario: #{scenario}\"\n puts\n\n # stats dir\n scale_results_parent_dir = \"results/scale/latest\"\n perf_scale_iteration_dir = \"#{scale_results_parent_dir}/#{scenario.gsub('.json', '')}\"\n js_dir = \"#{perf_scale_iteration_dir}/metric/js\"\n\n puts \"Checking stats in: #{js_dir}\"\n puts\n\n # TODO: extract to perf_results_helper (possibly just use gatling2csv)\n begin\n # global stats\n global_stats_path = \"#{js_dir}/global_stats.json\"\n global_stats_file = File.read(global_stats_path)\n global_stats_json = JSON.parse(global_stats_file)\n\n # check the results for KOs (TODO: needed or just use assertion?)\n num_total = global_stats_json[\"numberOfRequests\"][\"total\"]\n num_ok = global_stats_json[\"numberOfRequests\"][\"ok\"]\n num_ko = global_stats_json[\"numberOfRequests\"][\"ko\"]\n puts \"Number of requests:\"\n puts \"total: #{num_total}\"\n puts \"ok: #{num_ok}\"\n puts \"ko: #{num_ko}\"\n puts\n\n # stats\n stats_path = \"#{js_dir}/stats.json\"\n stats_file = File.read(stats_path)\n stats_json = JSON.parse(stats_file)\n\n # the 'group' name will be something like 'group_nooptestwithout-9eb19'\n group_keys = stats_json[\"contents\"].keys.select { |key| key.to_s.match(/group/) }\n group_node = stats_json[\"contents\"][group_keys[0]]\n\n # totals row is in the 'stats' node\n totals = group_node[\"stats\"]\n\n # transaction rows are in the 'contents' node\n contents = group_node[\"contents\"]\n\n # get each category\n node = contents[contents.keys[0]][\"stats\"]\n filemeta_pluginfacts = contents[contents.keys[1]][\"stats\"]\n filemeta_plugins = contents[contents.keys[2]][\"stats\"]\n locales = contents[contents.keys[3]][\"stats\"]\n catalog = contents[contents.keys[4]][\"stats\"]\n report = contents[contents.keys[5]][\"stats\"]\n\n # get atop results\n # get_scale_atop_results\n atop_csv_path = \"#{perf_scale_iteration_dir}/master/atop_log_#{scenario.downcase.gsub('.json', '_json')}.csv\"\n atop_csv_data = CSV.read(atop_csv_path)\n\n # results for csv\n results = []\n results << scale_scenario_instances\n results << totals[\"numberOfRequests\"][\"ok\"]\n results << totals[\"numberOfRequests\"][\"ko\"]\n results << totals[\"meanResponseTime\"][\"total\"]\n results << catalog[\"meanResponseTime\"][\"total\"]\n results << filemeta_plugins[\"meanResponseTime\"][\"total\"]\n results << filemeta_pluginfacts[\"meanResponseTime\"][\"total\"]\n results << locales[\"meanResponseTime\"][\"total\"]\n results << node[\"meanResponseTime\"][\"total\"]\n results << report[\"meanResponseTime\"][\"total\"]\n results << atop_csv_data[1][2] # average CPU TODO: verify from atop\n results << atop_csv_data[1][3] # average memory TODO: verify from atop\n\n # add this row to the csv\n update_scale_results_csv(scale_results_parent_dir, results)\n rescue StandardError => e\n puts \"Error encountered processing results files:\"\n puts e.message\n puts\n end\n\n # allow no more than SCALE_MAX_ALLOWED_KO KOs per iteration; this needs to be last\n if num_ko > SCALE_MAX_ALLOWED_KO\n puts \"ERROR - more than #{SCALE_MAX_ALLOWED_KO} KOs encountered in scenario: #{scenario}\"\n puts \"Exiting scale run...\"\n puts\n success = false\n end\n\n success\n end",
"title": ""
}
] |
[
{
"docid": "99ed031e66e586da06b86c6a86f9dd6b",
"score": "0.64745367",
"text": "def process\n return if @metrics.size_all == 0\n\n collate\n write_to_disk\n end",
"title": ""
},
{
"docid": "fc5034360e744ad3ce7ca0307e76c364",
"score": "0.63621795",
"text": "def update_scale_results_csv(scale_results_parent_dir, results)\n CSV.open(\"#{scale_results_parent_dir}/PERF_SCALE_#{@scale_timestamp}.csv\", \"a+\") do |csv|\n csv << results\n end\n end",
"title": ""
},
{
"docid": "0432b68646fb4368b9d72b5b761ea672",
"score": "0.5852581",
"text": "def build_scale_csv_summary(parent_dir)\n puts \"building scale test csv summary report for parent dir: #{parent_dir}\"\n puts\n\n parent_name = File.basename(parent_dir)\n report_name = \"scale_test_summary\"\n output_path = \"#{parent_dir}/#{report_name}.html\"\n\n # create a summary csv file to contain the last successful iteration from each result\n @summary_csv_path_success = \"#{parent_dir}/#{report_name}.success.csv\"\n create_summary_csv(@summary_csv_path_success)\n\n # create a summary csv file to contain the failing iteration from each result\n @summary_csv_path_fail = \"#{parent_dir}/#{report_name}.fail.csv\"\n create_summary_csv(@summary_csv_path_fail)\n\n # start with the template\n report = File.read(@template_path)\n\n # process each result dir\n process_result_dirs(parent_dir)\n\n # calculate variance for success\n calculate_summary_csv(@summary_csv_path_success)\n\n # calculate variance for failure\n calculate_summary_csv(@summary_csv_path_fail)\n\n # csv2html\n csv2html(@summary_csv_path_success)\n csv2html(@summary_csv_path_fail)\n\n # result name\n report = report.gsub(\"$RESULT_NAME\", parent_name)\n\n # add summary success table\n summary_success_table = extract_table_from_csv2html_output(\"#{@summary_csv_path_success}.html\")\n report = report.gsub(\"$RESULT_SUMMARY_SUCCESS_TABLE\", summary_success_table)\n\n # add summary fail table\n summary_fail_table = extract_table_from_csv2html_output(\"#{@summary_csv_path_fail}.html\")\n report = report.gsub(\"$RESULT_SUMMARY_FAIL_TABLE\", summary_fail_table)\n\n # add extract tables\n report = report.gsub(\"$RESULT_EXTRACT_TABLES\", @tables)\n\n # write report\n puts \"writing report to #{output_path}\"\n puts\n\n File.write(output_path, report)\nend",
"title": ""
},
{
"docid": "8f635aee429b2196d81b6636d219e7c7",
"score": "0.5806955",
"text": "def handle_scale_results(scenario_hash)\n scenario = scenario_hash[:name]\n\n puts \"Getting results for scenario: #{scenario}\"\n puts\n\n # stop monitoring and get results\n get_perf_result\n\n # copy results from metrics node\n copy_scale_results(scenario)\n\n # check results for KOs\n success = check_scale_results(scenario_hash)\n\n success\n end",
"title": ""
},
{
"docid": "eca1d955999cffca41ac066c81430079",
"score": "0.5788084",
"text": "def output(machine, records)\n # expecting position, sku, dispense qty, unit price, pkg qty, currency\n CSV.open('./docs/output', 'a') do |csv|\n records.each do |pos, sku, d_qty, cost, p_qty, curr|\n # attempt to fix erroneous dispense qtys on lockers\n d_qty = 1 if pos.to_i >= 70 and d_qty.to_i > 12\n csv << [machine['companyName'], machine['deviceName'], sku, (d_qty.to_i * p_qty.to_i), cost]\n end\n end\nend",
"title": ""
},
{
"docid": "7a9578cf2fef5f8a11bf7ab01e24c646",
"score": "0.5663899",
"text": "def output_to_csv\n if (@values[:result] != nil)\n @additions << calculate_worktime\n filename = get_entry(\"Specify output file: \")\n p = Menu.data_handler.find_person_by_id(@values[:id])\n CSVWriter.output(filename, p, @values[:result], @additions)\n else\n puts \"Nothing to write right now.\"\n end\n end",
"title": ""
},
{
"docid": "255e48bb0fe5112bf69896deafd92e45",
"score": "0.5585236",
"text": "def postprocess( scaleData )\n\n stream_out( \"\\n Loading XML elements from #{$gWorkingModelFile} ...\")\n\n # Load all XML elements from HOT2000 file (post-run results now available)\n h2kPostElements = get_elements_from_filename( $gWorkingModelFile )\n\n if ( $gCustomCostAdjustment )\n $gRegionalCostAdj = $gCostAdjustmentFactor\n else\n $gRegionalCostAdj = $RegionalCostFactors[$Locale]\n end\n\n # PVSise Depreciated. To be removed in later versions.\n # $PVsize = $gChoices[\"Opt-StandoffPV\"] # Input examples: \"SizedPV\", \"SizedPV|3kW\", or \"NoPV\"\n $PVInt = $gChoices[\"Opt-H2K-PV\"] # Input examples: \"MonoSi-50m2\", \"NA\"\n if ( $PVInt != \"NA\" )\n $PVIntModel = true\n if ( $PVsize != \"NoPV\" ) # Internal PV model supercedes external!\n $PVsize = \"NoPV\"\n end\n end\n\n # Set flags for reading from Browse.rpt file\n bReadOldERSValue = false\n bUseNextPVLine = false\n bUseNextACLine = false\n bReadAirConditioningLoad = true # Always get Air Conditioning Load (not available in XML)\n\n #Open diagnostics file and possibly read in interesting info !?!\n $lineNo = 0\n if ( $gReadROutStrTxt )\n #begin\n stream_out(\"\\nParsing diagnostics from #{$OutputFolder}\\\\Routstr.txt ...\")\n fRoutStr = File.new(\"#{$OutputFolder}\\\\Routstr.txt\", \"r\")\n\n $SOCparse = false\n $SHTiniparse = false\n $FFBCparse = false\n $EFBCparse = false\n $HPparse = false\n $bHeatingDone = false\n $EBakparse = false\n $GOPparse = false\n # Zero arrays\n 32.times do |n|\n\n $binDatHrs[n+1]=0\n $binDatTmp[n+1]=0\n $binDatTsfB[n+1]=0\n $binDatHLR[n+1]=0\n $binDatT2cap[n+1]=0\n #$binDatT1cap[n+1]=0\n $binDatT2PLR[n+1]=0\n $binDatT1PLR[n+1]=0\n\n end\n\n\n\n while !fRoutStr.eof? do\n\n $lineNo = $lineNo + 1\n\n $lineIn = fRoutStr.readline\n $lineIn.strip!\n\n if ( $lineIn =~ /^\\s*$/ || $bHeatingDone ) then\n next # Skip empty line.\n end\n\n\n #Report binned data in general or SOC modes.\n # (This still calls for a more robust approach that can set the evaluation\n # type from the choice file or cmd line.)\n if ($lineIn =~ /Starting Run: House with standard operating conditions/ ||\n $lineIn =~ /Starting Run: House\\s*$/ )\n debug_out(\"ROUTSTR ? SOC open #{$lineNo} | #{$lineIn} \\n\")\n $SOCparse = true\n elsif ($lineIn =~ /Starting Run: / && $SOCparse)\n debug_out(\"ROUTSTR ? SOC close #{$lineNo} | #{$lineIn} \\n\")\n $SOCparse = false\n end\n\n if ( ! $SOCparse ) then\n next # Skip if we're not within standard OCs.\n end\n\n # Test if cooling sectins have been reached.\n if ( $lineIn =~ /Cooling calculations ../ )\n debug_out(\"ROUTSTR ? COOLING SECTION : #{$lineIn} \\n\")\n $bHeatingDone = true\n next\n end\n\n\n\n # Set flags for sections in the file\n if ($lineIn =~ /SpaceHTini/ )\n debug_out(\"ROUTSTR ? SpaceHTini open #{$lineNo} | #{$lineIn} \\n\")\n $SHTiniparse = true\n elsif ($lineIn =~ /Space00/ && $SHTiniparse )\n debug_out(\"ROUTSTR ? SpaceHTini close #{$lineNo} | #{$lineIn} \\n\")\n $SHTiniparse = false\n end\n\n if ($lineIn =~ /FossilFurnaceBC/ )\n debug_out(\"ROUTSTR ? FossilFurnaceBC open #{$lineNo} | #{$lineIn} \\n\")\n $FFBCparse = true\n elsif ($FFBCparse &&\n ( $lineIn =~ /HPBPLocated/ || $lineIn =~ /ElectricFurnaceBC/ || $lineIn =~ /oSpaceHT/ ) )\n debug_out(\"ROUTSTR ? FossilFurnaceBC close #{$lineNo} | #{$lineIn} \\n\")\n $FFBCparse = false\n end\n\n\n if ($lineIn =~ /GOPBackup: Gas\\/Oil\\/Propane backup../ )\n debug_out(\"ROUTSTR ? Gas/Oil/Propoane backup open #{$lineNo} | #{$lineIn} \\n\")\n $GOPparse = true\n elsif ( $GOPparse &&\n ( $lineIn =~ /HPBPLocated/ || $lineIn =~ /ElectricFurnaceBC/ || $lineIn =~ /oSpaceHT/ ) )\n debug_out(\"ROUTSTR ? Gas/Oil/Propoane backup close #{$lineNo} | #{$lineIn} \\n\")\n $GOPparse = false\n end\n\n\n if ($lineIn =~ /ElectricFurnaceBC/ )\n debug_out(\"ROUTSTR ? ElectricFurnaceBC open #{$lineNo} | #{$lineIn} \\n\")\n $EFBCparse = true\n elsif ($EFBCparse &&\n ( $lineIn =~ /HPBPLocated/ || $lineIn =~ /oSpaceHT/ ) )\n debug_out(\"ROUTSTR ? ElectricFurnaceBC close #{$lineNo} | #{$lineIn} \\n\")\n $EFBCparse = false\n end\n\n if ($lineIn =~ /ElectricBackup: ELECTRIC BACK-UP/ )\n debug_out(\"ROUTSTR ? ElectricBack open #{$lineNo} | #{$lineIn} \\n\")\n $EBakparse = true\n elsif ( $EBakparse &&\n ( $lineIn =~ /ElectricFurnaceBC: ELECTRIC HEAT BELOW CUT-OFF../ ) )\n debug_out(\"ROUTSTR ? ElectricBack close #{$lineNo} | #{$lineIn} \\n\")\n $EBakparse = false\n end\n\n\n if ($lineIn =~ /AboveHPBP @160/ )\n debug_out(\"ROUTSTR ? HP open #{$lineNo} | #{$lineIn} \\n\")\n $HPparse = true\n elsif ( $HPparse &&\n ( $lineIn =~ /FALLS THU OPS/ || $lineIn =~ /Exit AboveHPBP @ 180/ || $lineIn =~/HPBPLocated 180 T/) )\n debug_out(\"ROUTSTR ? HP close #{$lineNo} | #{$lineIn} \\n\")\n $HPparse = false\n end\n\n\n # ==== Parse Data =====\n\n # Read fan power\n if ($lineIn =~ /QFFAN/ )\n debug_out(\"ROUTSTR ? QFFAN : #{$lineNo} | #{$lineIn} \\n\")\n valuesArr = $lineIn.split()\n $FurnFanPower = valuesArr[3]\n $HPFanPower = valuesArr[4]\n debug_out(\"ROUTSTR ? #{$lineNo} | QFFAN = #{$FurnFanPower} , QHPFAN = #{$HPFanPower} \\n \")\n end\n\n # Read T1 capacity\n if ($lineIn =~ /oSpaceHT FURNPW/ )\n valuesArr = $lineIn.split()\n debug_out(\"ROUTSTR ? oCpaceHTFURN : #{$lineIn} \\n\")\n $T1Capacity = valuesArr[2]\n end\n\n # Get SH bin definitions\n if ($SHTiniparse)\n debug_out(\"ROUTSTR ? SHITI : #{$lineIn} \\n\")\n # Headerline - ignore\n if ($lineIn =~ /Bin BinHours TbinC HLcvs HLAir TsfB CShtr HLR0 HLR1 HLR2/ )\n\n else\n valuesArr = $lineIn.split()\n binNo = valuesArr[0].to_i\n $binDatHrs[binNo] = valuesArr[1].to_f\n $binDatTmp[binNo] = valuesArr[2].to_f\n $binDatTsfB[binNo] = valuesArr[5].to_f\n end\n\n end\n\n\n\n\n\n # Get furnace performace data\n if ( $FFBCparse )\n debug_out(\"ROUTSTR ? FossilFurnace : #{$lineIn} \\n\")\n if ($lineIn =~ /FossilFurnaceBC:/ || $lineIn !~ /^\\s*[0-9]/)\n # Header - ignore\n else\n\n debug_out(\">>>FOSIL Furnace Parsing #{$lineIn} \\n\")\n valuesArr = $lineIn.split()\n binNo = valuesArr[0].to_i\n $binDatHLR[binNo] = valuesArr[3].to_f\n $binDatT1PLR[binNo] = valuesArr[6].to_f\n\n\n end\n end\n\n # Get Heat pump w/ electric back-up data\n if ( $EBakparse )\n debug_out(\"ROUTSTR ? E-Backup: #{$lineIn} \\n\")\n if ($lineIn =~ /ElectricFurnaceBC:/ || $lineIn !~ /^\\s*[0-9]/)\n # Header - ignore\n else\n\n valuesArr = $lineIn.split()\n binNo = valuesArr[0].to_i\n $binDatHLR[binNo] = valuesArr[1].to_f\n $binDatT2cap[binNo] = valuesArr[3].to_f\n $binDatT2PLR[binNo] = 1.0\n $binDatT1PLR[binNo] = valuesArr[5].to_f\n\n\n end\n end\n\n\n #Get heat pump w/gas back up data.\n if ( $GOPparse )\n\n if ( $lineIn !~ /^@290/ )\n # Header - ignore\n else\n debug_out(\"ROUTSTR ? GOP parse: #{$lineIn} \\n\")\n valuesArr = $lineIn.split()\n binNo = valuesArr[1].to_i\n $binDatHLR[binNo] = valuesArr[2].to_f\n $binDatT2cap[binNo] = valuesArr[3].to_f\n $binDatT2PLR[binNo] = 1.0\n $binDatT1PLR[binNo] = valuesArr[6].to_f\n\n\n end\n\n\n\n end\n\n\n\n # Get Electric furnace data\n if ( $EFBCparse )\n debug_out(\"ROUTSTR ? Electric Furnace : #{$lineIn} \\n\")\n if ($lineIn =~ /ElectricFurnaceBC:/ || $lineIn !~ /^\\s*[0-9]/)\n # Header - ignore\n else\n\n valuesArr = $lineIn.split()\n binNo = valuesArr[0].to_i\n $binDatHLR[binNo] = valuesArr[1].to_f\n $binDatT1PLR[binNo] = valuesArr[3].to_f\n\n\n end\n end\n\n\n # Get heat pump data\n if ( $HPparse )\n debug_out(\"ROUTSTR ? Heat pump : #{$lineIn} \\n\")\n if ($lineIn =~ /AboveHPBP/ || $lineIn !~ /^\\s*[0-9]/ )\n # Header - ignore\n else\n valuesArr = $lineIn.split()\n binNo = valuesArr[0].to_i\n $binDatHLR[binNo] = valuesArr[2].to_f\n $binDatT2cap[binNo] = valuesArr[4].to_f\n $binDatT2PLR[binNo] = valuesArr[5].to_f\n\n\n end\n end\n\n end # end of while loop\n\n\n stream_out(\"done.\\n\")\n fRoutStr.close()\n #rescue\n # fatalerror(\"Could not read ROutStr.txt\\n\")\n\n #end\n end #of reading ROUTSTR file\n\n\n\n\n\n debug_out(\" bin data: #{'%4s' \"bin\"} #{'%12s' % \"$binDatHrs\"} #{'%12s' % \"$binDatTmp\"} #{'%12s' % \"$binDatTsfB\"} #{'%12s' % \"$binDatHLR\"} #{'%12s' % \"$binDatT1PLR\"} #{'%12s' % \"$binDatT2PLR\"} #{'%12s' % \"$binDatT2cap\"}\\n\" )\n 32.times do |n|\n\n bin = n + 1\n debug_out(\" bin data: #{'%4s' % bin} #{'%12s' % $binDatHrs[bin]} #{'%12s' % $binDatTmp[bin]} #{'%12s' % $binDatTsfB[bin]} #{'%12s' % $binDatHLR[bin]} #{'%12s' % $binDatT1PLR[bin]} #{'%12s' % $binDatT2PLR[bin]} #{'%12s' % $binDatT2cap[bin]}\\n\" )\n\n end\n\n\n\n\n\n\n\n\n\n\n # Determine if need to read old ERS number based on existence of file Set_EGH.h2k in H2K folder\n if File.exist?(\"#{$run_path}\\\\Set_EGH.h2k\") then\n bReadOldERSValue = true\n end\n\n\n # Read from Browse.rpt ASCII file *if* data not available in XML (.h2k file)!\n if bReadOldERSValue || bReadAirConditioningLoad || $PVIntModel\n begin\n fBrowseRpt = File.new(\"#{$OutputFolder}\\\\Browse.Rpt\", \"r\")\n while !fBrowseRpt.eof? do\n lineIn = fBrowseRpt.readline # Sequentially read file lines\n lineIn.strip! # Remove leading and trailing whitespace\n if ( lineIn !~ /^\\s*$/ ) # Not an empty line!\n if ( bReadOldERSValue && lineIn =~ /^Energuide Rating \\(not rounded\\) =/ )\n lineIn.sub!(/Energuide Rating \\(not rounded\\) =/, '')\n lineIn.strip!\n $gERSNum = lineIn.to_f # Use * scaleData?\n bReadOldERSValue = false\n break if !$PVIntModel # Stop parsing Browse.rpt when ERS number found!\n elsif ( ( $PVIntModel && lineIn =~ /PHOTOVOLTAIC SYSTEM MONTHLY PERFORMANCE/ ) || ( $PVIntModel && bUseNextPVLine ) )\n bUseNextPVLine = true\n if ( lineIn =~ /^Annual/ )\n valuesArr = lineIn.split() # Uses spaces by default to split-up line\n $annPVPowerFromBrowseRpt = valuesArr[4].to_f * 12.0 / 1000.0 # kW (approx PV power)\n break # PV power near bottom and last value to read!\n end\n elsif ( (bReadAirConditioningLoad && lineIn =~ /AIR CONDITIONING SYSTEM PERFORMANCE/) || bUseNextACLine)\n bUseNextACLine = true\n if ( lineIn =~ /^Ann/ ) # Look for the annual results\n valuesArr = lineIn.split() # Uses spaces by default to split-up line\n $annACSensibleLoadFromBrowseRpt = valuesArr[1].to_f #Annual AirConditioning Sensible Load (MJ)\n $annACLatentLoadFromBrowseRpt = valuesArr[2].to_f #Annual AirConditioning Latent Load (MJ)\n $AvgACCOP = valuesArr[8].to_f #Average COP of AirConditioning\n $TotalAirConditioningLoad = ($annACSensibleLoadFromBrowseRpt + $annACLatentLoadFromBrowseRpt) / 1000.0 # Divided by 1000 to convert unit to GJ\n bUseNextACLine = false\n break if !$PVIntModel # Stop parsing Browse.rpt if noting else required!\n end\n end\n end\n end\n fBrowseRpt.close()\n rescue\n fatalerror(\"Could not read Browse.Rpt.\\n\")\n end\n end\n\n # ===================== Get house information from the XML file\n if ($FlagHouseInfo)\n getHouseInfo(h2kPostElements)\n end\n\n # ===================== Get envelope characteristics from the XML file\n getEnvelopeSpecs(h2kPostElements)\n\n # ==================== Get electricity rate structure for external PV model use\n if ($PVsize !~ /NoPV/ )\n locationText = \"HouseFile/FuelCosts/Electricity/Fuel/Minimum\"\n $gElecRate[\"ElecMthMinCharge$\"] = h2kPostElements[locationText].attributes[\"charge\"].to_f\n locationText = \"HouseFile/FuelCosts/Electricity/Fuel/RateBlocks/Block1\"\n $gElecRate[\"ElecBlck1Units\"] = h2kPostElements[locationText].attributes[\"units\"].to_f\n $gElecRate[\"ElecBlck1CostPerUnit\"] = h2kPostElements[locationText].attributes[\"costPerUnit\"].to_f\n if ( h2kPostElements[locationText].attributes[\"units\"] != \"99999\" )\n locationText = \"HouseFile/FuelCosts/Electricity/Fuel/RateBlocks/Block2\"\n $gElecRate[\"ElecBlck2Units\"] = h2kPostElements[locationText].attributes[\"units\"].to_f\n $gElecRate[\"ElecBlck2CostPerUnit\"] = h2kPostElements[locationText].attributes[\"costPerUnit\"].to_f\n if ( h2kPostElements[locationText].attributes[\"units\"] != \"99999\" )\n locationText = \"HouseFile/FuelCosts/Electricity/Fuel/RateBlocks/Block3\"\n $gElecRate[\"ElecBlck3Units\"] = h2kPostElements[locationText].attributes[\"units\"].to_f\n $gElecRate[\"ElecBlck3CostPerUnit\"] = h2kPostElements[locationText].attributes[\"costPerUnit\"].to_f\n if ( h2kPostElements[locationText].attributes[\"units\"] != \"99999\" )\n locationText = \"HouseFile/FuelCosts/Electricity/Fuel/RateBlocks/Block4\"\n $gElecRate[\"ElecBlck4Units\"] = h2kPostElements[locationText].attributes[\"units\"].to_f\n $gElecRate[\"ElecBlck4CostPerUnit\"] = h2kPostElements[locationText].attributes[\"costPerUnit\"].to_f\n end\n end\n end\n end\n\n # Get house heated floor area\n $FloorArea = getHeatedFloorArea( h2kPostElements )\n $HouseVolume= h2kPostElements[\"HouseFile/House/NaturalAirInfiltration/Specifications/House\"].attributes[\"volume\"].to_f\n # ==================== Get results for all h2k calcs from XML file (except above case)\n\n parseDebug = true\n $HCRequestedfound = false\n $HCGeneralFound = false\n $HCSOCFound = false\n\n # Make sure that the code we want is available\n h2kPostElements[\"HouseFile/AllResults\"].elements.each do |element|\n\n houseCode = element.attributes[\"houseCode\"]\n\n # 05-Feb-2018 JTB: Note that in Non-Program (ERS) mode there is no \"houseCode\" attribute in the single element results set!\n # When in Program mode there are multiple element results sets (7). The first set has no houseCode attribute, the next six (6)\n # do have a value for the houseCode attribute. The last set has the houseCode attribute of \"UserHouse\", which almost exactly\n # matches the first results set (General mode results).\n if (houseCode == nil && element.attributes[\"sha256\"] != nil)\n houseCode = \"General\"\n end\n\n if (houseCode == \"#{$outputHCode}\" )\n $HCRequestedfoundfound = true\n end\n\n if ( houseCode == \"SOC\" )\n $HCSOCFound = true\n end\n\n if ( houseCode == \"General\" )\n $HCGeneralFound = true\n end\n\n end\n\n if ( ! $HCRequestedfound && $outputHCode != \"General\" )\n $ThisMsg = \"HOT2000 didn't generate \\\"#{$outputHCode}\\\" result set. \"\n\n if ( $HCSOCFound )\n $outputHCode = \"SOC\"\n elsif ( $HCGeneralFound )\n $outputHCode = \"General\"\n end\n\n $ThisMsg +=\" Reporting result set \\\"#{$outputHCode}\\\" result instead. \\n\"\n warn_out($ThisMsg)\n end\n\n h2kPostElements[\"HouseFile/AllResults\"].elements.each do |element|\n\n houseCode = element.attributes[\"houseCode\"]\n\n if (houseCode == nil && element.attributes[\"sha256\"] != nil)\n houseCode = \"General\"\n end\n\n # JTB 31-Jan-2018: Limiting results parsing to 1 set specified by user in choice file and saved in $outputHCode\n if (houseCode =~ /#{$outputHCode}/)\n\n stream_out( \"\\n Parsing results from set: #{$outputHCode} ...\")\n\n # Energy Consumption (Annual GJ)\n $gResults[houseCode][\"avgEnergyTotalGJ\"] = element.elements[\".//Annual/Consumption\"].attributes[\"total\"].to_f * scaleData\n $gResults[houseCode][\"avgEnergyHeatingGJ\"] = element.elements[\".//Annual/Consumption/SpaceHeating\"].attributes[\"total\"].to_f * scaleData\n $gResults[houseCode][\"avgGrossHeatLossGJ\"] = element.elements[\".//Annual/HeatLoss\"].attributes[\"total\"].to_f * scaleData\n $gResults[houseCode][\"avgEnergyCoolingGJ\"] = element.elements[\".//Annual/Consumption/Electrical\"].attributes[\"airConditioning\"].to_f * scaleData\n $gResults[houseCode][\"avgEnergyVentilationGJ\"] = element.elements[\".//Annual/Consumption/Electrical\"].attributes[\"ventilation\"].to_f * scaleData\n $gResults[houseCode][\"avgEnergyEquipmentGJ\"] = element.elements[\".//Annual/Consumption/Electrical\"].attributes[\"baseload\"].to_f * scaleData\n $gResults[houseCode][\"avgEnergyWaterHeatingGJ\"] = element.elements[\".//Annual/Consumption/HotWater\"].attributes[\"total\"].to_f * scaleData\n\n if $ExtraOutput1 then\n # Total Heat Loss of all zones by component (GJ)\n $gResults[houseCode][\"EnvHLTotalGJ\"] = element.elements[\".//Annual/HeatLoss\"].attributes[\"total\"].to_f * scaleData\n $gResults[houseCode][\"EnvHLCeilingGJ\"] = element.elements[\".//Annual/HeatLoss\"].attributes[\"ceiling\"].to_f * scaleData\n $gResults[houseCode][\"EnvHLMainWallsGJ\"] = element.elements[\".//Annual/HeatLoss\"].attributes[\"mainWalls\"].to_f * scaleData\n $gResults[houseCode][\"EnvHLWindowsGJ\"] = element.elements[\".//Annual/HeatLoss\"].attributes[\"windows\"].to_f * scaleData\n $gResults[houseCode][\"EnvHLDoorsGJ\"] = element.elements[\".//Annual/HeatLoss\"].attributes[\"doors\"].to_f * scaleData\n $gResults[houseCode][\"EnvHLExpFloorsGJ\"] = element.elements[\".//Annual/HeatLoss\"].attributes[\"exposedFloors\"].to_f * scaleData\n $gResults[houseCode][\"EnvHLCrawlspaceGJ\"] = element.elements[\".//Annual/HeatLoss\"].attributes[\"crawlspace\"].to_f * scaleData\n $gResults[houseCode][\"EnvHLSlabGJ\"] = element.elements[\".//Annual/HeatLoss\"].attributes[\"slab\"].to_f * scaleData\n $gResults[houseCode][\"EnvHLBasementBGWallGJ\"] = element.elements[\".//Annual/HeatLoss\"].attributes[\"basementBelowGradeWall\"].to_f * scaleData\n $gResults[houseCode][\"EnvHLBasementAGWallGJ\"] = element.elements[\".//Annual/HeatLoss\"].attributes[\"basementAboveGradeWall\"].to_f * scaleData\n $gResults[houseCode][\"EnvHLBasementFlrHdrsGJ\"] = element.elements[\".//Annual/HeatLoss\"].attributes[\"basementFloorHeaders\"].to_f * scaleData\n $gResults[houseCode][\"EnvHLPonyWallGJ\"] = element.elements[\".//Annual/HeatLoss\"].attributes[\"ponyWall\"].to_f * scaleData\n $gResults[houseCode][\"EnvHLFlrsAbvBasementGJ\"] = element.elements[\".//Annual/HeatLoss\"].attributes[\"floorsAboveBasement\"].to_f * scaleData\n $gResults[houseCode][\"EnvHLAirLkVentGJ\"] = element.elements[\".//Annual/HeatLoss\"].attributes[\"airLeakageAndNaturalVentilation\"].to_f * scaleData\n\n # Annual DHW heating load [GJ] -- heating load (or demand) on DHW system (before efficiency applied)\n $gResults[houseCode][\"AnnHotWaterLoadGJ\"] = element.elements[\".//Annual/HotWaterDemand\"].attributes[\"base\"].to_f * scaleData\n end\n\n # Design loads, other data\n $gResults[houseCode][\"avgOthPeakHeatingLoadW\"] = element.elements[\".//Other\"].attributes[\"designHeatLossRate\"].to_f * scaleData\n $gResults[houseCode][\"avgOthPeakCoolingLoadW\"] = element.elements[\".//Other\"].attributes[\"designCoolLossRate\"].to_f * scaleData\n\n $gResults[houseCode][\"avgOthSeasonalHeatEff\"] = element.elements[\".//Other\"].attributes[\"seasonalHeatEfficiency\"].to_f * scaleData\n $gResults[houseCode][\"avgVntAirChangeRateNatural\"] = element.elements[\".//Annual/AirChangeRate\"].attributes[\"natural\"].to_f * scaleData\n $gResults[houseCode][\"avgVntAirChangeRateTotal\"] = element.elements[\".//Annual/AirChangeRate\"].attributes[\"total\"].to_f * scaleData\n $gResults[houseCode][\"avgSolarGainsUtilized\"] = element.elements[\".//Annual/UtilizedSolarGains\"].attributes[\"value\"].to_f * scaleData\n $gResults[houseCode][\"avgVntMinAirChangeRate\"] = element.elements[\".//Other/Ventilation\"].attributes[\"minimumAirChangeRate\"].to_f * scaleData\n\n $gResults[houseCode][\"avgFuelCostsElec$\"] = element.elements[\".//Annual/ActualFuelCosts\"].attributes[\"electrical\"].to_f * scaleData\n $gResults[houseCode][\"avgFuelCostsNatGas$\"] = element.elements[\".//Annual/ActualFuelCosts\"].attributes[\"naturalGas\"].to_f * scaleData\n $gResults[houseCode][\"avgFuelCostsOil$\"] = element.elements[\".//Annual/ActualFuelCosts\"].attributes[\"oil\"].to_f * scaleData\n $gResults[houseCode][\"avgFuelCostsPropane$\"] = element.elements[\".//Annual/ActualFuelCosts\"].attributes[\"propane\"].to_f * scaleData\n $gResults[houseCode][\"avgFuelCostsWood$\"] = element.elements[\".//Annual/ActualFuelCosts\"].attributes[\"wood\"].to_f * scaleData\n\n if $ExtraOutput1 then\n # Annual SpaceHeating and HotWater energy by fuel type [GJ]\n $gResults[houseCode][\"AnnSpcHeatElecGJ\"] = element.elements[\".//Annual/Consumption/Electrical\"].attributes[\"spaceHeating\"].to_f * scaleData\n $gResults[houseCode][\"AnnSpcHeatGasGJ\"] = element.elements[\".//Annual/Consumption/NaturalGas\"].attributes[\"spaceHeating\"].to_f * scaleData\n $gResults[houseCode][\"AnnSpcHeatOilGJ\"] = element.elements[\".//Annual/Consumption/Oil\"].attributes[\"spaceHeating\"].to_f * scaleData\n $gResults[houseCode][\"AnnSpcHeatPropGJ\"] = element.elements[\".//Annual/Consumption/Propane\"].attributes[\"spaceHeating\"].to_f * scaleData\n $gResults[houseCode][\"AnnSpcHeatWoodGJ\"] = element.elements[\".//Annual/Consumption/Wood\"].attributes[\"spaceHeating\"].to_f * scaleData\n $gResults[houseCode][\"AnnHotWaterElecGJ\"] = element.elements[\".//Annual/Consumption/Electrical/HotWater\"].attributes[\"dhw\"].to_f * scaleData\n $gResults[houseCode][\"AnnHotWaterGasGJ\"] = element.elements[\".//Annual/Consumption/NaturalGas\"].attributes[\"hotWater\"].to_f * scaleData\n $gResults[houseCode][\"AnnHotWaterOilGJ\"] = element.elements[\".//Annual/Consumption/Oil\"].attributes[\"hotWater\"].to_f * scaleData\n $gResults[houseCode][\"AnnHotWaterPropGJ\"] = element.elements[\".//Annual/Consumption/Propane\"].attributes[\"hotWater\"].to_f * scaleData\n $gResults[houseCode][\"AnnHotWaterWoodGJ\"] = element.elements[\".//Annual/Consumption/Wood\"].attributes[\"hotWater\"].to_f * scaleData\n end\n\n $gResults[houseCode][\"avgFueluseElecGJ\"] = element.elements[\".//Annual/Consumption/Electrical\"].attributes[\"total\"].to_f * scaleData\n\n # Bug in v11.3b90: The annual electrical energy total is 0 even though its components are not. Workaround below.\n # 07-APR-2018 JTB: This should only be checked when there is NO internal PV model in use!\n if !$PVIntModel && $gResults[houseCode][\"avgFueluseElecGJ\"] == 0 then\n $gResults[houseCode][\"avgFueluseElecGJ\"] = element.elements[\".//Annual/Consumption/Electrical\"].attributes[\"baseload\"].to_f * scaleData +\n element.elements[\".//Annual/Consumption/Electrical\"].attributes[\"airConditioning\"].to_f * scaleData +\n element.elements[\".//Annual/Consumption/Electrical\"].attributes[\"appliance\"].to_f * scaleData +\n element.elements[\".//Annual/Consumption/Electrical\"].attributes[\"lighting\"].to_f * scaleData +\n element.elements[\".//Annual/Consumption/Electrical\"].attributes[\"heatPump\"].to_f * scaleData +\n element.elements[\".//Annual/Consumption/Electrical\"].attributes[\"spaceHeating\"].to_f * scaleData +\n element.elements[\".//Annual/Consumption/Electrical\"].attributes[\"spaceCooling\"].to_f * scaleData +\n element.elements[\".//Annual/Consumption/Electrical\"].attributes[\"ventilation\"].to_f * scaleData +\n element.elements[\".//Annual/Consumption/Electrical/HotWater\"].attributes[\"dhw\"].to_f * scaleData\n end\n $gResults[houseCode][\"avgFueluseNatGasGJ\"] = element.elements[\".//Annual/Consumption/NaturalGas\"].attributes[\"total\"].to_f * scaleData\n $gResults[houseCode][\"avgFueluseOilGJ\"] = element.elements[\".//Annual/Consumption/Oil\"].attributes[\"total\"].to_f * scaleData\n $gResults[houseCode][\"avgFuelusePropaneGJ\"] = element.elements[\".//Annual/Consumption/Propane\"].attributes[\"total\"].to_f * scaleData\n $gResults[houseCode][\"avgFueluseWoodGJ\"] = element.elements[\".//Annual/Consumption/Wood\"].attributes[\"total\"].to_f * scaleData\n\n $gResults[houseCode][\"avgFueluseEleckWh\"] = $gResults[houseCode][\"avgFueluseElecGJ\"] * 277.77777778\n $gResults[houseCode][\"avgFueluseNatGasM3\"] = $gResults[houseCode][\"avgFueluseNatGasGJ\"] * 26.853\n $gResults[houseCode][\"avgFueluseOilL\"] = $gResults[houseCode][\"avgFueluseOilGJ\"] * 25.9576\n $gResults[houseCode][\"avgFuelusePropaneL\"] = $gResults[houseCode][\"avgFuelusePropaneGJ\"] / 25.23 * 1000\n $gResults[houseCode][\"avgFueluseWoodcord\"] = $gResults[houseCode][\"avgFueluseWoodGJ\"] / 18.30 # estimated GJ/cord for wood/pellet burning from YHC Fuel Cost Comparison.xls\n\n $gResults[houseCode][\"avgFuelCostsTotal$\"] = $gResults[houseCode][\"avgFuelCostsElec$\"] +\n $gResults[houseCode][\"avgFuelCostsNatGas$\"] +\n $gResults[houseCode][\"avgFuelCostsOil$\"] +\n $gResults[houseCode][\"avgFuelCostsPropane$\"] +\n $gResults[houseCode][\"avgFuelCostsWood$\"]\n\n # JTB 10-Nov-2016: Changed variable name from avgEnergyTotalGJ to \"..Gross..\" and uncommented\n # the reading of avgEnergyTotalGJ above. This value does NOT include utilized PV energy and\n # avgEnergyTotalGJ does when there is an internal H2K PV model.\n $gResults[houseCode][\"avgEnergyGrossGJ\"] = $gResults[houseCode]['avgEnergyHeatingGJ'].to_f +\n $gResults[houseCode]['avgEnergyWaterHeatingGJ'].to_f +\n $gResults[houseCode]['avgEnergyVentilationGJ'].to_f +\n $gResults[houseCode]['avgEnergyCoolingGJ'].to_f +\n $gResults[houseCode]['avgEnergyEquipmentGJ'].to_f\n\n\n\n monthArr = [ \"january\", \"february\", \"march\", \"april\", \"may\", \"june\", \"july\", \"august\", \"september\", \"october\", \"november\", \"december\" ]\n # Picking up AUX energy requirement from each result set.\n\n $gAuxEnergyHeatingGJ = 0\n $MonthlyAuxHeatingMJ = 0\n monthArr.each do |mth|\n $gAuxEnergyHeatingGJ += element.elements[\".//Monthly/UtilizedAuxiliaryHeatRequired\"].attributes[mth].to_f / 1000\n end\n\n # ASF 03-Oct-2016 - picking up PV generation from each individual result set.\n if ( $PVIntModel )\n pvAvailable = 0\n pvUtilized = 0\n #monthArr = [ \"january\", \"february\", \"march\", \"april\", \"may\", \"june\", \"july\", \"august\", \"september\", \"october\", \"november\", \"december\" ]\n monthArr.each do |mth|\n # ASF: 03-Oct-2016: Note inner caps on PhotoVoltaic likely an error (and inconsistent with convention used\n # elsewhere in the h2k file. Watch out for future .h2k file format changes here!)\n # ASF: 05-Oct-2016: I suspect this loop is really expensive.\n pvAvailable += h2kPostElements[\".//Monthly/Load/PhotoVoltaicAvailable\"].attributes[mth].to_f # GJ\n pvUtilized += h2kPostElements[\".//Monthly/Load/PhotoVoltaicUtilized\"].attributes[mth].to_f # GJ\n end\n # 10-Nov-2016 JTB: Use annual PV values only! HOT2000 redistributes the monthly excesses, if available!\n $gResults[houseCode][\"avgEnergyPVAvailableGJ\"] = pvAvailable # GJ\n $gResults[houseCode][\"avgEnergyPVUtilizedGJ\"] = pvUtilized # GJ\n $gResults[houseCode][\"avgElecPVGenkWh\"] = $gResults[houseCode][\"avgEnergyPVAvailableGJ\"] * 277.777778 # kWh\n $gResults[houseCode][\"avgElecPVUsedkWh\"] = $gResults[houseCode][\"avgEnergyPVUtilizedGJ\"] * 277.777778 # kWh\n\n # ***** Calculation of NET PV Revenue using HOT2000 model *****\n # 10-Nov-2016 JTB: Assumes that all annual PV energy available is used to reduce house electricity\n # to zero first, the balance is sold to utility at the rate PVTarrifDollarsPerkWh,\n # which is specified in the options file (defaulted at top if not in Options file!).\n netAnnualPV = $gResults[houseCode][\"avgElecPVGenkWh\"] - $gResults[houseCode][\"avgElecPVUsedkWh\"]\n if ( netAnnualPV > 0 )\n $gResults[houseCode][\"avgPVRevenue\"] = netAnnualPV * $PVTarrifDollarsPerkWh\n else\n $gResults[houseCode][\"avgPVRevenue\"] = 0\n end\n else\n # Calculate and reset these values below if external PV model used\n $gResults[houseCode][\"avgEnergyPVAvailableGJ\"] = 0.0\n $gResults[houseCode][\"avgEnergyPVUtilizedGJ\"] = 0.0\n $gResults[houseCode][\"avgElecPVGenkWh\"] = 0.0\n $gResults[houseCode][\"avgElecPVUsedkWh\"] = 0.0\n $gResults[houseCode][\"avgPVRevenue\"] = 0.0\n end\n\n # This is used for debugging only.\n diff = ( $gResults[houseCode][\"avgFueluseElecGJ\"].to_f +\n $gResults[houseCode][\"avgFueluseNatGasGJ\"].to_f -\n $gResults[houseCode][\"avgEnergyPVUtilizedGJ\"]) - $gResults[houseCode][\"avgEnergyTotalGJ\"].to_f\n $gResults[houseCode][\"zH2K-debug-Energy\"] = diff.to_f * scaleData\n\n break # break out of the element loop to avoid further processing\n\n end\n\n end # h2kPostElements |element| loop (and scope of local variable houseCode!)\n\n if ( $gDebug )\n $gResults.each do |houseCode, data|\n debug_out (\">Results for \" << houseCode.to_s)\n data.each do | var, value |\n debug_out (\" - \" << var.to_s << \" : \" << value.to_s )\n end\n end\n end\n\n $gAvgCost_Pellet = 0 # H2K doesn't identify pellets in output (only inputs)!\n\n # Total of all fuels in GJ\n $gAvgEnergy_Total = $gResults[$outputHCode][\"avgFueluseElecGJ\"] + $gResults[$outputHCode][\"avgFueluseNatGasGJ\"] +\n $gResults[$outputHCode][\"avgFueluseOilGJ\"] + $gResults[$outputHCode][\"avgFuelusePropaneGJ\"] +\n $gResults[$outputHCode][\"avgFueluseWoodGJ\"]\n\n # JTB 12-Nov-2016 : Updated and still valid. Sets cost of PV based on model type\n # and estimates PV kW size.\n # PV Data cost...\n $PVArrayCost = 0.0\n $PVArraySized = 0.0\n # Stand-off PV code depriciated. Need to figure out how to get PV size from H2k results.\n $PVsize = \"NoPV\"\n $PVcapacity = $PVsize\n $PVcapacity.gsub(/[a-zA-Z:\\s'\\|]/, '')\n if ( !$PVIntModel && ( $PVcapacity == \"\" || $PVcapacity == \"NoPV\" ) )\n $PVcapacity = 0.0\n end\n if ( $PVIntModel )\n if ( $PVInt != \"NA\" )\n # JTB 03-Nov-2016: The Cost field for Opt-H2K-PV is total cost NOT unit cost!!\n $PVUnitCost = $gOptions[\"Opt-H2K-PV\"][\"options\"][ $gChoices[\"Opt-H2K-PV\"] ][\"cost\"].to_f\n $PVUnitOutput = 0.0 # GJ/kW not used or estimated for internal H2K PV model\n else\n # No PV option specified in choice file (PV internal model part of base file)\n $PVUnitCost = 0.0\n $PVUnitOutput = 0.0\n end\n elsif ( $PVsize != \"NoPV\" )\n\n # Depreciated - to be removed.\n #$PVUnitCost = $gOptions[\"Opt-StandoffPV\"][\"options\"][\"SizedPV\"][\"cost\"].to_f\n #$PVUnitOutput = $gOptions[\"Opt-StandoffPV\"][\"options\"][\"SizedPV\"][\"ext-result\"][\"production-elec-perKW\"].to_f # GJ/kW\n end\n\n if ( $PVsize =~ /NoPV/ )\n # NoPV\n $gPVProduction = 0.0\n $PVArrayCost = 0.0\n elsif ( $PVsize =~ /SizedPV/ )\n # Size PV according to user specification, to max, or to size required to reach Net-Zero.\n # User-specified PV size (format is 'SizedPV|XkW', PV will be sized to X kW'.\n if ( $gExtraDataSpecd[\"Opt-StandoffPV\"] =~ /kW/ )\n $PVArraySized = $gExtraDataSpecd[\"Opt-StandoffPV\"].to_f # ignores \"kW\" in string\n $PVArrayCost = $PVUnitCost * $PVArraySized\n $gPVProduction = -1.0 * $PVUnitOutput * $PVArraySized\n $PVsize = \"spec'd SizedPV | #{$PVArraySized} kW\"\n else\n # USER Hasn't specified PV size, Size PV to attempt to get to net-zero.\n # First, get the home's total energy requirement.\n $prePVEnergy = $gAvgEnergy_Total\n if ( $prePVEnergy > 0 )\n # This should always be the case!\n $PVArraySized = $prePVEnergy / $PVUnitOutput # KW Capacity\n $PVmultiplier = 1.0\n if ( $PVArraySized > 14.0 )\n $PVmultiplier = 2.0\n end\n $PVArrayCost = $PVArraySized * $PVUnitCost * $PVmultiplier\n $PVsize = \" scaled: \" + \"#{$PVArraySized.round(1)} kW\"\n $gPVProduction = -1.0 * $PVUnitOutput * $PVArraySized\n else\n # House is already energy positive, no PV needed. Shouldn't happen!\n $PVsize = \"0.0 kW\"\n $PVArrayCost = 0.0\n end\n # Debug: How big is the sized array?\n debug_out (\"\\n PV array is #{$PVsize} ...\\n\")\n end\n end\n\n # Depreciated. To be deleted.\n #$gChoices[\"Opt-StandoffPV\"] = $PVsize\n #$gOptions[\"Opt-StandoffPV\"][\"options\"][$PVsize][\"cost\"] = $PVArrayCost\n\n\n # PV energy from HOT2000 model run (GJ) or estimate from option file PV data\n if ( $PVIntModel )\n $PVcapacity = $annPVPowerFromBrowseRpt # kW\n $PVsize = \" H2K: \" + \"#{$PVcapacity.round(1)} kW\"\n $gEnergyPV = $gResults[$outputHCode][\"avgEnergyPVUtilizedGJ\"]\n\n debug_out (\"\\n PV array is #{$PVsize} ...\\n\")\n elsif ( $PVsize !~ /NoPV/ )\n # PV energy comes from an estimate using Opt-StandoffPV specification. Uses options file\n # number for GJ/kW PV energy production for location and roof pitch.\n $PVcapacity = $PVArraySized # kW\n $gEnergyPV = $gPVProduction * -1.0 # GJ\n\n # Set values for external PV model (initialized to zero above)...\n $gResults[$outputHCode][\"avgEnergyPVAvailableGJ\"] = $gEnergyPV\n if ( $gResults[$outputHCode][\"avgFueluseElecGJ\"] > $gEnergyPV )\n # Decrease house electricity use by PV energy productions\n $gResults[$outputHCode][\"avgEnergyPVUtilizedGJ\"] = $gEnergyPV\n $gResults[$outputHCode][\"avgFueluseElecGJ\"] -= $gEnergyPV\n $gResults[$outputHCode][\"avgFueluseEleckWh\"] = $gResults[$outputHCode][\"avgFueluseElecGJ\"] * 277.77777778\n # Calculate new electricity cost and also update total fuel costs!\n calcElectCost( \"annual\" )\n else\n # PV production at least enough to cover house electrical needs!\n $gResults[$outputHCode][\"avgEnergyPVUtilizedGJ\"] = $gResults[$outputHCode][\"avgFueluseElecGJ\"]\n $gResults[$outputHCode][\"avgFueluseElecGJ\"] = 0.0\n $gResults[$outputHCode][\"avgFueluseEleckWh\"] = 0.0\n # New electricity cost is just the monthly minimum (also update total fuel cost)!\n calcElectCost( \"annualMin\" )\n end\n $gResults[$outputHCode][\"avgElecPVGenkWh\"] = $gResults[$outputHCode][\"avgEnergyPVAvailableGJ\"] * 277.777778 # kWh\n $gResults[$outputHCode][\"avgElecPVUsedkWh\"] = $gResults[$outputHCode][\"avgEnergyPVUtilizedGJ\"] * 277.777778 # kWh\n\n netAnnualPV = $gResults[$outputHCode][\"avgElecPVGenkWh\"] - $gResults[$outputHCode][\"avgElecPVUsedkWh\"]\n if ( netAnnualPV > 0 )\n $gResults[$outputHCode][\"avgPVRevenue\"] = netAnnualPV * $PVTarrifDollarsPerkWh\n else\n $gResults[$outputHCode][\"avgPVRevenue\"] = 0\n end\n end\n\n stream_out( \" done \\n\")\n\n stream_out \"\\n----------------------- SIMULATION RESULTS ---------------------------------\\n\"\n\n stream_out \"\\n Peak Heating Load (W): #{$gResults[$outputHCode]['avgOthPeakHeatingLoadW'].round(1)} \\n\"\n stream_out \" Peak Cooling Load (W): #{$gResults[$outputHCode]['avgOthPeakCoolingLoadW'].round(1)} \\n\"\n\n stream_out(\"\\n Energy Consumption: \\n\\n\")\n stream_out ( \" #{$gResults[$outputHCode]['avgEnergyHeatingGJ'].round(1)} ( Space Heating, GJ ) \\n\")\n stream_out ( \" #{$gResults[$outputHCode]['avgEnergyWaterHeatingGJ'].round(1)} ( Hot Water, GJ ) \\n\")\n stream_out ( \" #{$gResults[$outputHCode]['avgEnergyVentilationGJ'].round(1)} ( Ventilator Electrical, GJ ) \\n\")\n stream_out ( \" #{$gResults[$outputHCode]['avgEnergyCoolingGJ'].round(1)} ( Space Cooling, GJ ) \\n\")\n stream_out ( \" #{$gResults[$outputHCode]['avgEnergyEquipmentGJ'].round(1)} ( Appliances + Lights + Plugs + outdoor, GJ ) \\n\")\n stream_out ( \" --------------------------------------------------------\\n\")\n stream_out ( \" #{$gResults[$outputHCode]['avgEnergyGrossGJ'].round(1)} ( H2K Gross energy use GJ ) \\n\")\n\n if ( parseDebug )\n $check = $gResults[$outputHCode]['avgEnergyHeatingGJ'].to_f +\n $gResults[$outputHCode]['avgEnergyWaterHeatingGJ'].to_f +\n $gResults[$outputHCode]['avgEnergyVentilationGJ'].to_f +\n $gResults[$outputHCode]['avgEnergyCoolingGJ'].to_f +\n $gResults[$outputHCode]['avgEnergyEquipmentGJ'].to_f\n stream_out (\" ( Check1: should = #{$check.round(1)}, \")\n stream_out (\"Check2: avgEnergyTotalGJ = #{$gResults[$outputHCode]['avgEnergyTotalGJ'].round(1)} ) \\n \")\n end\n\n if $ExtraOutput1 then\n stream_out(\"\\n Components of envelope heat loss: \\n\\n\")\n stream_out ( \" #{$gResults[$outputHCode]['EnvHLCeilingGJ'].round(1)} ( Envelope Ceiling Heat Loss (all zones), GJ ) \\n\")\n stream_out ( \" #{$gResults[$outputHCode]['EnvHLMainWallsGJ'].round(1)} ( Envelope Main Wall Heat Loss (all zones), GJ ) \\n\")\n stream_out ( \" #{$gResults[$outputHCode]['EnvHLWindowsGJ'].round(1)} ( Envelope Window Heat Loss (all zones), GJ ) \\n\")\n stream_out ( \" #{$gResults[$outputHCode]['EnvHLDoorsGJ'].round(1)} ( Envelope Door Heat Loss (all zones), GJ ) \\n\")\n stream_out ( \" #{$gResults[$outputHCode]['EnvHLExpFloorsGJ'].round(1)} ( Envelope Exp Floor Heat Loss (all zones), GJ ) \\n\")\n stream_out ( \" #{$gResults[$outputHCode]['EnvHLCrawlspaceGJ'].round(1)} ( Envelope Crawlspace Loss (all zones), GJ ) \\n\")\n stream_out ( \" #{$gResults[$outputHCode]['EnvHLSlabGJ'].round(1)} ( Envelope Slab Heat Loss (all zones), GJ ) \\n\")\n stream_out ( \" #{$gResults[$outputHCode]['EnvHLBasementBGWallGJ'].round(1)} ( Envelope BG Basement Heat Loss (all zones), GJ ) \\n\")\n stream_out ( \" #{$gResults[$outputHCode]['EnvHLBasementAGWallGJ'].round(1)} ( Envelope AG Basement Heat Loss (all zones), GJ ) \\n\")\n stream_out ( \" #{$gResults[$outputHCode]['EnvHLBasementFlrHdrsGJ'].round(1)} ( Envelope Basement Floor Hdr Heat Loss (all zones), GJ ) \\n\")\n stream_out ( \" #{$gResults[$outputHCode]['EnvHLPonyWallGJ'].round(1)} ( Envelope Pony Wall Heat Loss (all zones), GJ ) \\n\")\n stream_out ( \" #{$gResults[$outputHCode]['EnvHLFlrsAbvBasementGJ'].round(1)} ( Envelope Floors Above Basement Heat Loss (all zones), GJ ) \\n\")\n stream_out ( \" #{$gResults[$outputHCode]['EnvHLAirLkVentGJ'].round(1)} ( Envelope Air Leakage & Ventilation Heat Loss (all zones), GJ ) \\n\")\n stream_out ( \" --------------------------------------------------------\\n\")\n stream_out ( \" #{$gResults[$outputHCode]['EnvHLTotalGJ'].round(1)} ( Envelope Total Heat Loss (as reported in file), GJ ) \\n\")\n\n if ( parseDebug )\n $check = $gResults[$outputHCode]['EnvHLCeilingGJ'].to_f +\n $gResults[$outputHCode]['EnvHLMainWallsGJ'].to_f +\n $gResults[$outputHCode]['EnvHLWindowsGJ'].to_f +\n $gResults[$outputHCode]['EnvHLDoorsGJ'].to_f +\n $gResults[$outputHCode]['EnvHLExpFloorsGJ'].to_f +\n $gResults[$outputHCode]['EnvHLCrawlspaceGJ'].to_f +\n $gResults[$outputHCode]['EnvHLSlabGJ'].to_f +\n $gResults[$outputHCode]['EnvHLBasementBGWallGJ'].to_f +\n $gResults[$outputHCode]['EnvHLBasementAGWallGJ'].to_f +\n $gResults[$outputHCode]['EnvHLBasementFlrHdrsGJ'].to_f +\n $gResults[$outputHCode]['EnvHLPonyWallGJ'].to_f +\n $gResults[$outputHCode]['EnvHLAirLkVentGJ'].to_f\n stream_out (\" ( Note: sum above without basement floor above HL = #{$check.round(1)} )\")\n end\n\n stream_out ( \"\\n\\n #{$gResults[$outputHCode][\"AnnHotWaterLoadGJ\"].round(1)} ( Annual DHW heating load, GJ ) \\n\")\n end\n\n stream_out(\"\\n\\n Energy Cost (not including credit for PV, direction #{$gRotationAngle} ): \\n\\n\")\n stream_out(\" + \\$ #{$gResults[$outputHCode]['avgFuelCostsElec$'].round(2)} (Electricity)\\n\")\n stream_out(\" + \\$ #{$gResults[$outputHCode]['avgFuelCostsNatGas$'].round(2)} (Natural Gas)\\n\")\n stream_out(\" + \\$ #{$gResults[$outputHCode]['avgFuelCostsOil$'].round(2)} (Oil)\\n\")\n stream_out(\" + \\$ #{$gResults[$outputHCode]['avgFuelCostsPropane$'].round(2)} (Propane)\\n\")\n stream_out(\" + \\$ #{$gResults[$outputHCode]['avgFuelCostsWood$'].round(2)} (Wood) \\n\")\n# stream_out(\" + \\$ #{$gResults[$outputHCode][''].round(2)} #{$gAvgCost_Pellet.round(2)} (Pellet)\\n\")\n stream_out ( \" --------------------------------------------------------\\n\")\n stream_out ( \" \\$ #{$gResults[$outputHCode]['avgFuelCostsTotal$'].round(2)} (All utilities).\\n\")\n stream_out ( \"\\n\")\n\n netAnnualPV = $gResults[$outputHCode]['avgElecPVGenkWh'] - $gResults[$outputHCode]['avgElecPVUsedkWh']\n\n stream_out ( \" - \\$ #{$gResults[$outputHCode]['avgPVRevenue'].round(2)} (**Net PV revenue for #{$PVcapacity.round(0)} kW unit: #{netAnnualPV.round(0)} kWh at \\$ #{$PVTarrifDollarsPerkWh} / kWh)\\n\")\n stream_out ( \" --------------------------------------------------------\\n\")\n\n netUtilityCost = $gResults[$outputHCode]['avgFuelCostsTotal$'] - $gResults[$outputHCode]['avgPVRevenue']\n\n stream_out ( \" \\$ #{netUtilityCost.round(2)} (Net utility costs).\\n\")\n stream_out ( \"\\n\")\n\n if $ExtraOutput1 then\n stream_out(\"\\n Space Heating Energy Use by Fuel (GJ): \\n\\n\")\n stream_out(\" - #{$gResults[$outputHCode][\"AnnSpcHeatElecGJ\"].round(1)} (Space Heating Electricity, GJ)\\n\")\n stream_out(\" - #{$gResults[$outputHCode][\"AnnSpcHeatGasGJ\"].round(1)} (Space Heating Natural Gas, GJ)\\n\")\n stream_out(\" - #{$gResults[$outputHCode][\"AnnSpcHeatOilGJ\"].round(1)} (Space Heating Oil, GJ)\\n\")\n stream_out(\" - #{$gResults[$outputHCode][\"AnnSpcHeatPropGJ\"].round(1)} (Space Heating Propane, GJ)\\n\")\n stream_out(\" - #{$gResults[$outputHCode][\"AnnSpcHeatWoodGJ\"].round(1)} (Space Heating Wood, GJ)\\n\")\n stream_out(\" - #{$gResults[$outputHCode][\"AnnHotWaterElecGJ\"].round(1)} (Hot Water Heating Electricity, GJ)\\n\")\n stream_out(\" - #{$gResults[$outputHCode][\"AnnHotWaterGasGJ\"].round(1)} (Hot Water Heating Natural Gas, GJ)\\n\")\n stream_out(\" - #{$gResults[$outputHCode][\"AnnHotWaterOilGJ\"].round(1)} (Hot Water Heating Oil, GJ)\\n\")\n stream_out(\" - #{$gResults[$outputHCode][\"AnnHotWaterPropGJ\"].round(1)} (Hot Water Heating Propane, GJ)\\n\")\n stream_out(\" - #{$gResults[$outputHCode][\"AnnHotWaterWoodGJ\"].round(1)} (Hot Water Heating Wood, GJ)\\n\")\n end\n\n stream_out(\"\\n\\n Total Energy Use by Fuel (in fuel units, not including credit for PV, direction #{$gRotationAngle} ): \\n\\n\")\n stream_out(\" - #{$gResults[$outputHCode]['avgFueluseEleckWh'].round(0)} (Total Electricity, kWh)\\n\")\n stream_out(\" - #{$gResults[$outputHCode]['avgFueluseNatGasM3'].round(0)} (Total Natural Gas, m3)\\n\")\n stream_out(\" - #{$gResults[$outputHCode]['avgFueluseOilL'].round(0)} (Total Oil, l)\\n\")\n stream_out(\" - #{$gResults[$outputHCode]['avgFuelusePropaneL'].round(0)} (Total Propane, l)\\n\")\n\n # ASF 03-Oct-2016:\n # Wood/Pellets\n stream_out(\" - #{$gResults[$outputHCode]['avgFueluseWoodcord'].round(0)} (Total Wood, cord)\\n\")\n # stream_out(\" - #{$gAvgPelletCons_t.round(1)} (Pellet, tonnes)\\n\")\n # stream_out (\"> SCALE #{scaleData} \\n\");\n # Estimate total cost of upgrades\n $gTotalCost = 0\n\n if ( $Locale == \"NA\" )\n thisLocale = \"Basehouse location\"\n else\n thisLocale = $Locale\n end\n stream_out (\"\\n\\n Estimated costs in #{thisLocale} (x #{$gRegionalCostAdj} Ottawa costs) : \\n\\n\")\n\n $gChoices.sort.to_h\n for attribute in $gChoices.keys()\n\n debug_out \"Costing for #{attribute}: \"\n\n choice = $gChoices[attribute]\n cost = $gOptions[attribute][\"options\"][choice][\"cost\"].to_f\n $gTotalCost += cost\n stream_out( \" + #{cost.round()} ( #{attribute} : #{choice} ) \\n\")\n end\n stream_out ( \" - #{($gIncBaseCosts * $gRegionalCostAdj).round} (Base costs for windows) \\n\")\n stream_out ( \" --------------------------------------------------------\\n\")\n stream_out ( \" = #{($gTotalCost-$gIncBaseCosts * $gRegionalCostAdj).round} ( Total incremental cost ) \\n\\n\")\n $gRegionalCostAdj != 0 ? val = $gTotalCost / $gRegionalCostAdj : val = 0\n stream_out ( \" ( Unadjusted upgrade costs: \\$ #{val} )\\n\\n\")\n\n if ( $gERSNum > 0 )\n $tmpval = $gERSNum.round(1)\n stream_out(\" ERS value: #{$tmpval}\\n\")\n end\n\nend",
"title": ""
},
{
"docid": "98b7323789136fcc1bfb1167ce7029df",
"score": "0.55557865",
"text": "def create_scale_results_csv_file(scale_results_parent_dir)\n CSV.open(\"#{scale_results_parent_dir}/PERF_SCALE_#{@scale_timestamp}.csv\", \"wb\") do |csv|\n headings = [\"agents\",\n \"ok\",\n \"ko\",\n \"combined mean\",\n \"catalog mean\",\n \"filemeta plugins mean\",\n \"filemeta pluginfacts mean\",\n \"locales mean\",\n \"node mean\",\n \"report mean\",\n \"average CPU %\",\n \"average memory\"]\n\n csv << headings\n end\n end",
"title": ""
},
{
"docid": "3b598db24b275d7df3c81073c3fdbb8c",
"score": "0.55159694",
"text": "def process_results\n # Clean up some of the files that are not needed\n %w(runmanager.db).each do |f|\n logger.debug \"Removing file: #{@simulation.run_path}/#{f}\"\n File.delete File.join(@simulation.run_path, f) if File.exist? File.join(@simulation.run_path, f)\n end\n\n json = {}\n Dir[\"#{@simulation.run_path}/*\"].each do |f|\n if f =~ /AnalysisResults-BEES.pdf/\n logger.info 'saving the compliance report path to model'\n @simulation.compliance_report_pdf_path = f\n elsif f =~ /.*\\s-\\sAnalysisResults-BEES.xml/\n logger.info \"BEES XML #{f}\"\n @simulation.compliance_report_xml = f\n elsif f =~ /.*\\s-\\sAnalysisResults.xml/\n logger.info \"XML #{f}\"\n @simulation.analysis_results_xml = f\n elsif f =~ /CbeccComWrapper.json/\n # Save the state based on the CbeccComWrapper.json file that is persisted\n json = MultiJson.load(File.read(f), symbolize_keys: true) if File.exist?(f)\n logger.info \"pyCBECC responded with: #{json}\"\n\n @simulation.cbecc_code = json.keys.first.to_s.to_i\n @simulation.cbecc_code_description = json.values.first\n elsif f =~ /.*\\s-\\sab.*/\n logger.info \"Annual baseline results #{f}\"\n @simulation.openstudio_model_baseline = f if File.extname(f) == '.osm'\n\n elsif f =~ /.*\\s-\\szb.*/\n logger.info \"Sizing simulation results #{f}\"\n elsif f =~ /.*\\s-\\sap.*/\n logger.info \"Annual proposed results #{f}\"\n @simulation.openstudio_model_proposed = f if File.extname(f) == '.osm'\n end\n end\n\n # TODO: remove other files\n\n # parse the log file for any errors\n errors = []\n log_file = find_log_file\n if log_file && File.exist?(log_file)\n s = File.read log_file\n s.scan(/Error:\\s{2}.*$/).each do |error|\n errors << error[/Error:\\s{2}(.*)/, 1].chomp\n end\n\n # This appeared once, but haven't seen it since.\n s.scan(/error\\(s\\) encountered simulating.*/i).each do |error|\n errors << error.chomp\n end\n\n # and this error: Compliance report(s) called for but bypassed due to report generator website not accessible.\n if s =~ /compliance report.*called for but bypassed due to report generator website not accessible/i\n @simulation.warning_messages << \"Could not generate Compliance Reports because report generate website was not accessible\"\n end\n\n @simulation.error_messages = errors\n end\n\n # TODO: zip up everything and remove what we don't care about\n\n # success is defined as no error messages\n if !json.keys.empty? && json.keys.first != :'0'\n return false\n end\n\n if !@simulation.error_messages.empty?\n return false\n end\n\n true\n end",
"title": ""
},
{
"docid": "ecccb9c236e0ea6e120b1973f6637ef6",
"score": "0.55102974",
"text": "def finalize_calculations\n\t\t\t@timeFactors.each do |t|\n\t\t\t\tif @metricsDataAggregator[t].hasDataToDump?\n\t\t\t\t\t@metricsDataAggregator[t].aggregateValues()\n\t\t\t\t\t@summaryMetricHashArr << @metricsDataAggregator[t].getCurrentData(@sequenceCounter)\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t# write the last batch to db\n\t\t\twrite_batch_to_db()\n\n\t\t\treturn true\n\t\tend",
"title": ""
},
{
"docid": "48fa1e2c37f2f7247b08c192dd7cd23e",
"score": "0.5499565",
"text": "def process_and_upload_csv\n\n @has_data = get_data_from_db do |data|\n formatted_data = format_data(data)\n c_add formatted_data\n end\n\n if @has_data\n zip_folder\n upload_to_s3\n delete_local_files\n end\n\n end",
"title": ""
},
{
"docid": "db2c9e7826cf41d47add7afcd480ba36",
"score": "0.54953474",
"text": "def run_for_cleared_eps(batch_limit)\n RequestStore[:current_user] = User.system_user\n conn = ActiveRecord::Base.connection\n\n @error_log = []\n @run_log = []\n\n error_ids = get_error_ids\n\n eps_queried = get_cleared_eps(batch_limit, error_ids, conn)\n eps_queried.each do |x|\n call_priority_sync(x[\"reference_id\"], conn)\n end\n\n error_csv = build_csv(@error_log)\n run_csv = build_csv(@run_log)\n log_to_s3(error_csv, \"cleared_ep_error_log\")\n log_to_s3(run_csv, \"cleared_ep_run_log\")\n final_metrics\n\n conn.close\n end",
"title": ""
},
{
"docid": "354ad1a65514eca4b5709a942295a2e5",
"score": "0.5440738",
"text": "def exported_report\n #The folder where the filename points to, is actually in the ~/rails/Forester because of capistrano as\n # the Apache point to ~/rails/Forester/current symlinkfolder and capistrano updates the them. \n @filename = \"quarterly_report_#{params[:year]}_#{params[:quarter]}.csv\"\n @file_path = \"#{Rails.root}/../../shared/system/exports/\"\n if params[:quarter] == \"1\"\n @tickets = Ticket.find(:all, :conditions => \"delivery_date>'#{(params[:year].to_i-1)}-12-31' AND delivery_date<'#{params[:year]}-04-01'\")\n else\n if params[:quarter] == \"2\"\n @tickets = Ticket.find(:all, :conditions => \"delivery_date>'#{params[:year]}-03-31' AND delivery_date<'#{params[:year]}-07-01'\")\n else\n if params[:quarter] == \"3\"\n @tickets = Ticket.find(:all, :conditions => \"delivery_date>'#{params[:year]}-06-30' AND delivery_date<'#{params[:year]}-10-01'\")\n else\n if params[:quarter] == \"4\" then\n @tickets = Ticket.find(:all, :conditions => \"delivery_date>'#{params[:year]}-09-30' AND delivery_date<'#{(params[:year].to_i+1)}-01-01'\")\n end\n end\n end\n end\n \n #Writing to file starts with empty line.\n File.open(\"#{@file_path}#{@filename}\", 'w') do |writer|\n writer.puts(\"\\n\")\n end\n \n #From the tickets delivered in the given quarter, the job ids are gathered here\n @job_ids = @tickets.collect {|i| i.job_id }\n @jobs = Job.find(@job_ids)\n \n #To have less DB calls, all specie records are put into an instance variable\n @species = Specie.all\n \n #Goes through all the jobs, for each sums up all the mbf and tonnages and writes them into the file\n # per specie.\n @jobs.each do |k|\n @my_tickets = []\n @tickets.each do |l|\n if l.job_id == k.id\n @my_tickets.push(l)\n end\n end\n \n @amounts = []\n \n @species.length.times do\n @amounts.push([0, 0])\n end\n \n @total_pulp = 0\n \n @my_tickets.each do |i|\n i.load_details.each do |j|\n if i.wood_type == 3 || j.species_id == 0 #wood type 3 & species_id 0 == pulp\n @total_pulp = @total_pulp + j.tonnage\n next #If load is pulp, it has only one load detail so program jups to next loop\n end\n #Amounts of mbf/tonnage are summed up here per ticket according to their specie.\n @amounts[j.species_id-1][0] = @amounts[j.species_id-1][0] + j.mbfss #This and triple-n tonnage in next are helper methods. See their documentation.\n @amounts[j.species_id-1][1] = @amounts[j.species_id-1][1] + j.tonnnage\n end\n end\n \n #Finally, the values calculated above are written into the file.\n File.open(\"#{@file_path}#{@filename}\", 'a') do |writer|\n writer.puts \"Job, #{k.name}\"\n writer.puts \"Category, MBF, Tonnage\"\n @species.each do |i|\n writer.puts \"#{i.code}, #{round_to(@amounts[i.id-1][0].to_f, 2)}, #{round_to(@amounts[i.id-1][1].to_f, 2)}\"\n end\n writer.puts \"Pulp, ,#{round_to(@total_pulp.to_f, 2)}\"\n writer.puts(\"\\n\")\n end\n end\n \n #The file created is opened in 'r' (== read) mode and send to user\n @file = File.open(\"#{@file_path}#{@filename}\", 'r')\n \n send_data(@file.read, :type => \"csv\", :filename => @filename)\n end",
"title": ""
},
{
"docid": "db94fcae57a9494720d3223c67a17fb5",
"score": "0.53757876",
"text": "def process_rows!\n # Correct incorrect rows in the table\n table.each do |row|\n row_metric = row[\"metric\"] # perf optimization\n # TODO inject Saikuro reference\n if row_metric == :saikuro\n fix_row_file_path!(row)\n end\n tool_tables[row_metric] << row\n file_tables[row[\"file_path\"]] << row\n class_tables[row[\"class_name\"]] << row\n method_tables[row[\"method_name\"]] << row\n end\n end",
"title": ""
},
{
"docid": "fe5083d681a853621f8f2f8c30869ad9",
"score": "0.5362884",
"text": "def calculate_results\n Repository::Config.new(@repo, @log, @process, @type).status(5) {\n files = files_to_analyze\n puts '-----Files to analyze done (Step 1)'\n files = prepare_files_to_rate files\n puts '-----Prepare files to rate done (Step 2)'\n files = count_total_lines files\n puts '-----Count total lines done (Step 3)'\n files = count_errors files\n puts '-----Count errors done (Step 4)'\n files = grade_categories files\n puts '-----Grade categories done (Step 5)'\n files = grade_files files\n puts '-----Grade files done (Step 6)' + files.to_s\n gpa = grade_repo files\n puts '-----Grade repos done (Step 7)' + gpa.to_s\n gpa_percent = get_overall_grades files\n puts '-----Grade overall percentage done (Step 8)' + gpa_percent.to_s\n cat_issues = get_category_issues files\n puts '-----Get categories issues done (Step 9)' + cat_issues.to_s\n store_cat_issues cat_issues\n puts '-----Store category issues done (Step 10)'\n store_grades gpa, gpa_percent\n puts '-----Store grades done (Step 11)'\n }\n end",
"title": ""
},
{
"docid": "eb7d8ca80dc51f019693882bf969ed2f",
"score": "0.53439397",
"text": "def abc_analysis\n infile, result, *others = params\n abc_filename = \"ABC-analysis-#{others[0] || File.basename(infile, '.*')}.csv\"\n\n puts; print \"Assigning machine count to customers...\"\n\n aggregator = Sycsvpro::Aggregator.new(infile: infile, \n outfile: \"aggregate.csv\", \n cols: \"45\", \n sum: \"Total:1,Machines\")\n\n aggregator.execute\n\n puts; print \"Sort customers based on machine count descending...\"\n\n sorter = Sycsvpro::Sorter.new(infile: \"aggregate.csv\",\n outfile: \"sort.csv\",\n cols: \"n:1\",\n df: \"%Y-%m-%d\",\n desc: \"d\")\n \n sorter.execute\n\n puts; print \"Categorize customers in regard to machine count...\"\n\n counter = Sycsvpro::Counter.new(infile: \"sort.csv\",\n outfile: \"count.csv\",\n rows: \"1-#{result.row_count}\",\n key: \"0:customer,1:machines\",\n cols: \"1:<10,1:10-50,1:>50\",\n sort: false)\n\n counter.execute\n\n puts; print \"Conducting ABC-analysis...\"\n\n calculator = Sycsvpro::Calculator.new(infile: \"count.csv\",\n outfile: abc_filename,\n header: \"*,A,B,C\",\n rows: \"2-#{result.row_count}\",\n cols: \"5:c4*c1,6:c3*c1,7:c2*c1\",\n sum: true)\n \n calculator.execute\n\n clean_up([\"aggregate.csv\", \"sort.csv\", \"count.csv\"])\n\n puts; puts \"You can find the result of the ABC Analysis in '#{abc_filename}'\"\n\nend",
"title": ""
},
{
"docid": "c072f748d12217f526e1ae342a20fba5",
"score": "0.5310782",
"text": "def copy_scale_results(scenario)\n puts \"Getting results for scenario: #{scenario}\"\n puts\n\n # create scale scenario result folder\n scale_results_parent_dir = \"results/scale/PERF_SCALE_#{@scale_timestamp}\"\n scale_result_dir = \"#{scale_results_parent_dir}/#{scenario.gsub('.json', '')}\"\n FileUtils.mkdir_p scale_result_dir\n\n # copy metric\n remote_result_dir = \"root/gatling-puppet-load-test/simulation-runner/results\"\n metric_results = \"#{@archive_root}/#{metric.hostname}/#{remote_result_dir}/#{@dir_name}\"\n FileUtils.copy_entry metric_results, \"#{scale_result_dir}/metric\"\n\n # copy master\n master_results = \"#{@archive_root}/#{master.hostname}\"\n log_filename = \"atop_log_#{scenario.downcase.gsub('.json', '_json')}\"\n\n # copy only the logs for this iteration (the dir contains logs from all previous iterations)\n FileUtils.mkdir_p \"#{scale_result_dir}/master\"\n atop_files = Dir.glob(\"#{master_results}/#{log_filename}*\")\n atop_files.each do |file|\n FileUtils.copy_file file, \"#{scale_result_dir}/master/#{File.basename(file)}\"\n end\n\n # copy stats\n global_stats_path = \"#{scale_result_dir}/metric/js/global_stats.json\"\n stats_path = \"#{scale_result_dir}/metric/js/stats.json\"\n json_dir = \"#{scale_results_parent_dir}/json\"\n FileUtils.mkdir_p json_dir\n FileUtils.copy_file global_stats_path, \"#{json_dir}/#{scenario.gsub('.json', 'global_stats.json')}\"\n FileUtils.copy_file stats_path, \"#{json_dir}/#{scenario.gsub('.json', 'stats.json')}\"\n\n # copy puppet-metrics-collector to scale results dir (this iteration) and parent dir (entire scale run)\n src = File.join(@archive_root, PUPPET_METRICS_COLLECTOR_DIR_NAME)\n FileUtils.copy_entry src, File.join(scale_result_dir, PUPPET_METRICS_COLLECTOR_DIR_NAME)\n FileUtils.copy_entry src, File.join(scale_results_parent_dir, PUPPET_METRICS_COLLECTOR_DIR_NAME)\n\n # copy epoch files\n # TODO: update to include in the bulk copy below when these have an extension\n FileUtils.copy_file \"#{@archive_root}/start_epoch\", \"#{scale_result_dir}/start_epoch\"\n FileUtils.copy_file \"#{@archive_root}/end_epoch\", \"#{scale_result_dir}/end_epoch\"\n\n # copy any csv/html/json/tar.gz/txt files\n res_files = Dir.glob(\"#{@archive_root}/*.{csv,html,json,tar.gz,txt}\")\n res_files.each do |file|\n FileUtils.copy_file file, File.join(scale_result_dir, File.basename(file))\n end\n end",
"title": ""
},
{
"docid": "82cab80eec4a42d4444a090eec8b42e6",
"score": "0.52536273",
"text": "def extract_table_from_results_csv(csv_path)\n # ensure the expected result csv file exists\n raise \"File not found: #{csv_path}\" unless File.file?(csv_path)\n\n # create a csv file with the headings and last 2 rows\n output_path = csv_path.gsub(\".csv\", \".scale_extract.csv\")\n csv_name = File.basename(csv_path)\n result_name = csv_name.gsub(\".csv\", \"\")\n puts \"processing csv: #{csv_name}\"\n\n # TODO: extract into a separate method?\n contents = File.readlines(csv_path)\n\n # only include runs that didn't fail on the first iteration\n if contents.length > 2\n File.open(output_path, \"w\") do |f|\n f << contents[0]\n f << contents[-2]\n f << contents[-1]\n end\n\n # add the 2nd to last line to the success summary\n update_summary_csv(@summary_csv_path_success, \"#{result_name},#{contents[-2]}\")\n\n # add the last line to the fail summary\n update_summary_csv(@summary_csv_path_fail, \"#{result_name},#{contents[-1]}\")\n\n # csv2html\n csv2html(output_path)\n\n # table\n table = extract_table_from_csv2html_output(\"#{output_path}.html\")\n\n else\n puts \"This run failed on the first iteration; ignoring...\"\n puts\n table = nil\n end\n\n table\nend",
"title": ""
},
{
"docid": "643e3bf485fd8efd02aaeaa1ab54bdee",
"score": "0.5229117",
"text": "def report!\n # Fulfill batches array with 1 second step timestamps\n #\n batches = []\n @min_time = Time.at(@min_time.to_f.truncate + 0.999)\n batches << @min_time\n \n (@max_time - @min_time).to_i.times {\n batches << batches.last + 1.second\n }\n batches << batches.last + 1.second\n \n @keys = @stats.keys.sort.each(&:to_sym)\n @keys.delete(:disconnect)\n \n CSV.open(File.expand_path(\"results/report.csv\"), 'w') do |csv|\n head = []\n @keys.each_with_index {|stat_name, index| head << \"N #{stat_name}\"; head << stat_name; head << \"Server\" }\n \n csv << [\"Time\"] + head + [\"Connections\"]\n # Calculate active connections per second\n \n net_bm = {}\n net_bm_count = {}\n net_bm_index = {}\n\n serv_bm = {}\n serv_bm_count = {}\n serv_bm_index = {}\n \n @keys.each { |stat_name| net_bm_index[stat_name] = 0; serv_bm_index[stat_name] = 0 }\n \n connections_index = 0\n \n batches.each_with_index do |batch, index|\n active_connections = 0\n for i in connections_index..(@connections_deltas.size - 1) do\n if @connections_deltas[i][:time].to_f <= batch.to_f\n active_connections += @connections_deltas[i][:delta]\n else\n connections_index = i\n break\n end\n \n if i == @connections_deltas.size-1\n connections_index = i + 1\n break\n end\n end\n \n @keys.each do |stat_name|\n net_bm[stat_name] = 0\n net_bm_count[stat_name] = 0\n \n for i in net_bm_index[stat_name]..(@stats[stat_name].size - 1) do\n if @stats[stat_name][i][:time].to_f <= batch.to_f\n net_bm[stat_name] += @stats[stat_name][i][:benchmark]\n net_bm_count[stat_name] += 1\n else\n net_bm_index[stat_name] = i\n break\n end\n \n if i == @stats[stat_name].size - 1\n net_bm_index[stat_name] = i + 1\n break\n end \n end \n end\n \n @keys.each do |stat_name|\n serv_bm[stat_name] = 0\n serv_bm_count[stat_name] = 0\n for i in serv_bm_index[stat_name]..(@server_stats[stat_name].size - 1) do\n if @server_stats[stat_name][i][:time].to_f <= batch.to_f\n serv_bm[stat_name] += @server_stats[stat_name][i][:benchmark]\n serv_bm_count[stat_name] += 1\n else\n serv_bm_index[stat_name] = i\n break\n end\n \n if i == @server_stats[stat_name].size - 1\n serv_bm_index[stat_name] = i + 1\n break\n end \n end \n end\n\n if index > 0\n @connections << active_connections + @connections[index - 1]\n else\n @connections << active_connections\n end\n \n result = []\n @keys.each_with_index do |stat_name, index|\n net_average = 0\n serv_average = 0\n net_average = (net_bm[stat_name] / net_bm_count[stat_name]) if net_bm_count[stat_name] > 0\n serv_average = (serv_bm[stat_name] / serv_bm_count[stat_name]) if serv_bm_count[stat_name] > 0\n \n result += [\"#{net_bm_count[stat_name]}\", \"%3.4f\"% net_average]\n result += [\"%3.4f\"% serv_average]\n end\n \n csv << [batch.strftime(\"%H:%M:%S\")] + result.flatten + [@connections[index]]\n end\n \n head = []\n @keys.each_with_index {|stat_name, index| head << \"N #{stat_name}\"; head << stat_name; head << \"Server\" }\n \n csv << [\" \"] + head + [\"Connections\"]\n end\n end",
"title": ""
},
{
"docid": "fdbb0bb89deeb4f434b57ca5d26b57ec",
"score": "0.52218866",
"text": "def start()\n header = true # skip the header\n File.open(\"pricefile.txt\", 'w') do |file|\n CSV.foreach(\"../../produce.csv\") do |row| \n row[5].to_i.times do\n selling_price = adjusted_price(row[0], get_markup(row[1]), row[4])\n sell_by = adjusted_sell_by(row[0], row[1], row[3])\n short_description = row[2][0..30]\n\n file.puts \"R#{'% 8.2f' % (selling_price)}#{sell_by.strftime('%Y/%m/%d')}#{short_description}\"\n end unless header\n header = false\n end\n end\nend",
"title": ""
},
{
"docid": "70ce8983d2505b3bfb71eae0aa82b759",
"score": "0.5180924",
"text": "def compute_and_present(reports)\n alltime_proceeds_per_currency = {} #currency is the key, value is the proceeds\n alltime_renewables = 0\n alltime_apps = {}\n alltime_payed_units = 0\n alltime_inapp_units = 0\n alltime_free_units = 0\n alltime_updated_units = 0\n \n first_date = reports[0].split('_').last.split('.').first\n reports.each do |alltime_filename|\n\n puts \"Processing #{alltime_filename}\".green if @beVerbose\n\n #get the date from the filename\n date = alltime_filename.split('_').last.split('.').first #filename example: S_D_80076793_20120706.txt\n\n report_data = File.open(alltime_filename, \"rb\").read \n\n report = parse(report_data)\n #puts report.class\n if report #report parsed\n apps = {}\n total_payed_units = 0\n total_inapp_units = 0\n total_free_units = 0\n total_updated_units = 0\n report.each do |item| #report is a hash \n if item\n sku = item[:sku] #group data by app sku\n if apps.has_key? sku #app is already cached\n app = apps[sku]\n else #initially insert app\n app = {:sku=>sku, :title=>item[:title], :sold_units=>0, :updated_units=>0}\n apps[sku] = app\n end\n #ensure currency sum\n alltime_proceeds_per_currency[item[:currency_of_proceeds]] = 0.0 unless alltime_proceeds_per_currency[item[:currency_of_proceeds]]\n \n #count units\n if SALE_IDENTS.include? item[:product_type_id] #count sales\n app[:sold_units] += item[:units]\n if item[:customer_price]==0 #a free app\n total_free_units += item[:units]\n else \n total_payed_units += item[:units]\n alltime_proceeds_per_currency[item[:currency_of_proceeds]] += item[:developer_proceeds] * item[:units]\n end\n elsif INAPP_SALE_IDENTS.include? item[:product_type_id]\n app[:sold_units] += item[:units]\n total_inapp_units += item[:units]\n alltime_proceeds_per_currency[item[:currency_of_proceeds]] += item[:developer_proceeds] * item[:units]\n if item[:product_type_id] == \"IAY\" #InAppPurchase\n alltime_renewables += item[:units]\n end\n elsif UPDATE_IDENTS.include? item[:product_type_id] #count updates\n app[:updated_units] += item[:units]\n total_updated_units += item[:units]\n end \n else # only if item \n puts \"null report\".red\n end\n end\n\n #add to the alltime stats\n alltime_payed_units += total_payed_units\n alltime_inapp_units += total_inapp_units\n alltime_free_units += total_free_units\n alltime_updated_units += total_updated_units\n \n apps.each do |alltime_sku, apps_app| \n #select the app\n if alltime_apps.has_key? alltime_sku\n #already cached\n alltime_app = alltime_apps[alltime_sku]\n else\n #insert for the first time\n alltime_app = {:sku=>alltime_sku, :title=>apps_app[:title], :sold_units=>0, :updated_units=>0} \n alltime_apps[alltime_sku] = alltime_app\n end\n #add stats\n alltime_app[:sold_units] += apps_app[:sold_units]\n alltime_app[:updated_units] += apps_app[:updated_units]\n end\n\n if @beVerbose && reports.size>1\n #report for date\n puts \"\\n\\n______________________________________________________________\".blue\n puts \"Report for #{date}\"\n puts \"\\n\" + \"Product\".ljust(40).blue + \": \" +\"Downloads\".green + \" / \" + \"Updates\".green\n puts \"______________________________________________________________\".yellow\n apps.each do |app_sku,apps_app|\n puts \"#{apps_app[:title].ljust(40).blue}: #{apps_app[:sold_units].to_s.ljust(10).green} / #{apps_app[:updated_units].to_s.rjust(7).dark_green}\"\n end \n puts \"______________________________________________________________\".yellow\n puts \"#{'InApp Purchases'.ljust(40).green}: #{total_inapp_units}\"\n puts \"#{'Payed Downloads'.ljust(40).green}: #{total_payed_units}\"\n puts \"#{'Free Downloads'.ljust(40).dark_green}: #{total_free_units}\"\n puts \"#{'Updates'.ljust(40).dark_green}: #{total_updated_units}\"\n puts \"______________________________________________________________\".blue\n puts \"\\n\\n\"\n end #if @beVerbose\n\n else \n puts \"null report parsed\".red\n end #if report parsed\n \n end #reports.each\n\n #report alltime\n puts \"\\n\\n______________________________________________________________\".blue\n from = Date.strptime first_date, '%Y%m%d'\n age = Date.today - from \n formatted_from = from.strftime(\"%b %d %Y\")\n puts \"Report\" + (ARGV[0]? \" #{ARGV[0]}\":\" daily\") + \", from #{formatted_from}, #{age.to_i} days\"\n puts \"\\n\" + \"Product\".ljust(40).blue + \": \" +\"Downloads\".green + \" / \" + \"Updates\".green\n puts \"______________________________________________________________\".yellow\n alltime_apps.each do |app_sku, aapp|\n puts \"#{aapp[:title].ljust(40).blue}: #{aapp[:sold_units].to_s.ljust(10).green} / #{aapp[:updated_units].to_s.rjust(7).dark_green}\"\n end \n puts \"______________________________________________________________\".yellow\n puts \"#{'InApp Purchases'.ljust(40).green}: #{alltime_inapp_units}\" + ( alltime_renewables > 0.0 ? \" / #{alltime_renewables} Auto-Renewed\" : \"\")\n puts \"#{'Payed Downloads'.ljust(40).green}: #{alltime_payed_units}\"\n puts \"#{'Free Downloads'.ljust(40).dark_green}: #{alltime_free_units}\"\n puts \"#{'Updates'.ljust(40).dark_green}: #{alltime_updated_units}\"\n puts \"\\n#{'Proceeds'.red}:\\n\\n\"\n total_proceeds = 0.0\n alltime_proceeds_per_currency.each do |proceed_key, proceed| \n formatted_sum = proceed > 0.0 ? \"#{proceed}\".green : \"#{proceed}\".red\n if proceed > 0.0\n if proceed_key == @convertTo\n total_proceeds += proceed\n puts \"#{proceed_key} : #{formatted_sum}\"\n else\n #convert using google\n data = open(\"http://www.google.com/ig/calculator?q=#{proceed}#{proceed_key}=?#{@convertTo}\").read\n #fix broken json\n data.gsub!(/lhs:/, '\"lhs\":')\n data.gsub!(/rhs:/, '\"rhs\":')\n data.gsub!(/error:/, '\"error\":')\n data.gsub!(/icc:/, '\"icc\":')\n data.gsub!(Regexp.new(\"(\\\\\\\\x..|\\\\\\\\240)\"), '') \n #puts data\n converted = JSON.parse data\n converted_proceed = converted[\"rhs\"].split(' ').first.to_f\n total_proceeds += converted_proceed\n puts \"#{proceed_key} : #{formatted_sum} / #{converted['rhs']}\"\n end\n end\n end\n puts \"\\n#{'Total'.green}: #{total_proceeds} #{@convertTo}\"\n puts \"______________________________________________________________\".blue\n puts \"\\n\\n\" \nend",
"title": ""
},
{
"docid": "99b1a8e6fd285a7fbb7cc6655195d264",
"score": "0.5174098",
"text": "def perform_second(input_csv)\n partner = false\n delivery = \"\"\n output = []\n total_cost = 0\n count = 0\n sum = 0\n low_delivery = 0\n total_delivery = 0\n assigned_capacity = 0\n CSV.foreach(input_csv, headers: false) do |row|\n # Each row of partners hash\n # sample row: {\"P1\"=>[{:\"Size Slab (IN GB)\"=>\"0-100\", :\"Minimum Cost\"=>\"1500\", :\"Cost Per GB\"=>\"20\"}, {:\"Size Slab (IN GB)\"=>\"100-200\", :\"Minimum Cost\"=>\"2000\", :\"Cost Per GB\"=>\"13\"}, {:\"Size Slab (IN GB)\"=>\"200-300\", :\"Minimum Cost\"=>\"2500\", :\"Cost Per GB\"=>\"12\"}, {:\"Size Slab (IN GB)\"=>\"300-400\", :\"Minimum Cost\"=>\"3000\", :\"Cost Per GB\"=>\"10\"}], \"P2\"=>[{:\"Size Slab (IN GB)\"=>\"0-200\", :\"Minimum Cost\"=>\"1000\", :\"Cost Per GB\"=>\"20\"}, {:\"Size Slab (IN GB)\"=>\"200-400\", :\"Minimum Cost\"=>\"2500\", :\"Cost Per GB\"=>\"15\"}], \"P3\"=>[{:\"Size Slab (IN GB)\"=>\"100-200\", :\"Minimum Cost\"=>\"800\", :\"Cost Per GB\"=>\"25\"}, {:\"Size Slab (IN GB)\"=>\"200-600\", :\"Minimum Cost\"=>\"1200\", :\"Cost Per GB\"=>\"30\"}]} \n values = []\n stripped_row = row.collect(&:strip)\n values << stripped_row[0]\n @h[stripped_row[2]].each do |k, v|\n v.each do |a|\n if find_range(a[:\"Size Slab (IN GB)\"], stripped_row[1])\n partner = true\n total_cost, delivery = calculate_total_cost(a, stripped_row, k)\n end\n end\n end \n low_delivery += total_cost\n assigned_capacity += stripped_row[1].to_i\n @h[stripped_row[2]].keys.each do |partner|\n if @capacities_hash[partner].to_i < assigned_capacity\n @h[stripped_row[2]][partner].each do |a|\n if find_range(a[:\"Size Slab (IN GB)\"], stripped_row[1])\n partner = true\n total_cost, delivery = calculate_total_cost(a, stripped_row, partner) \n total_delivery += total_cost\n total_delivery = total_delivery - assigned_capacity\n end\n end\n end\n end\n # Create Values to store in output file\n count = 0\n values << true if partner = true\n values << total_cost\n values << delivery\n values.join(' ')\n output << values\n end\n # To create output csv\n create_output_csv(output)\n end",
"title": ""
},
{
"docid": "3b9cd04e324d944091cd3952689744e3",
"score": "0.51649225",
"text": "def process_upload!\n init_error_report\n\n if fail_on_error?\n handle_save_nothing_on_error\n else\n handle_save_clean_orders\n end\n\n store_error_report if result.failed?\n self.processed_at = Time.zone.now\n save!\n end",
"title": ""
},
{
"docid": "f2133d36128f3bfab695825535f95bf6",
"score": "0.51458305",
"text": "def process\n by_time_batch\n by_waiting_batch\n rescue\n @logger.fatal \"Failed to process: #{$!}\"\n @logger.fatal $!.backtrace.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "c651df85d9eba0573e9246fe49d2a9ce",
"score": "0.5133165",
"text": "def elems_in_wh_and_quality_original_calculate_all_at_once\n # Los Secado de process rec_seco los muestra por tarja todos separados\n respond_to do |format|\n format.xlsx {\n @elements = Element.all.includes(:product_type, :drying_method, :warehouse)#.to_a\n\n # Applying filters\n f_params = params.reject{|k, v| v.blank?}\n if !f_params[:product_type_id]\n redirect_back(fallback_location: root_path, alert: \"Debe seleccionar un proceso.\")\n end\n @process = ProductType.find(f_params[:product_type_id]).name\n @elements = @elements.product_type(f_params[:product_type_id]) if f_params[:product_type_id]\n @elements = @elements.location(f_params[:location]) if f_params[:location]\n\n logger.info {\"Descargando elems_in_wh_and_quality\"}\n logger.info {\"Tamaño en memoria #{ActiveSupport::JSON.encode(@elements).size} bytes\"}\n\n # Los elems fueron filtrados por cosas comunes a groups\n # Obtengo todos los elems_ids que cumplen los parametros!\n elems_ids = @elements.ids\n group_ids = @elements.distinct.pluck(:elements_group_id)\n # p \"Groups IDS\"\n # p group_ids\n # Busco las muestras que pertenezcan a los elements o group_samples(para damage, caliber and humidity).\n @dam_samples = DamageSample.where(element_id: elems_ids).or(\n DamageSample.where(elements_group_id: group_ids)).to_a\n @cal_samples = CaliberSample.where(element_id: elems_ids).or( #includes(:caliber, :deviation_sample).to_a\n CaliberSample.where(elements_group_id: group_ids)).to_a\n cal_samples_ids = @cal_samples.map {|cs| cs.id}\n @dev_samples = DeviationSample.where(caliber_sample_id: cal_samples_ids).select(:caliber_sample_id, :deviation).to_a\n @humidity_samples = HumiditySample.where(element_id: elems_ids).or(\n HumiditySample.where(elements_group_id: group_ids))\n .select(:element_id, :humidity, :elements_group_id).to_a\n @sorbate_samples = SorbateSample.where(element_id: elems_ids).select(:element_id, :sorbate).to_a\n @carozo_samples = CarozoSample.where(element_id: elems_ids).select(:element_id, :carozo_percentage).to_a\n\n @damages_list = Util.damages_of_product_type(@process)\n response.headers['Content-Disposition'] = 'attachment; filename=\"'+ Date.today.to_s + ' - Productos: Bodega y calidad.xlsx\"'\n }\n end\n end",
"title": ""
},
{
"docid": "4c1bad513ba57cc6ac3e88cc6275c822",
"score": "0.5076254",
"text": "def process\n uploaded_workbook = Spreadsheet.open self.path\n @records_matched = 0\n @records_updated = 0\n @records_failed = 0\n @failed_queries = 0\n @skipped_records = 0\n\n product_sheet = uploaded_workbook.worksheet(0)\n perform(product_sheet)\n\n if not uploaded_workbook.worksheet(1).nil?\n variant_sheet = uploaded_workbook.worksheet(1)\n perform(variant_sheet)\n end\nend",
"title": ""
},
{
"docid": "534b8d44a85c351884f6c26799e0029e",
"score": "0.50700015",
"text": "def process\n progressbar = ProgressBar.create(title: \"Rows\", total: @values.count, format: \"%B | %c/%u | %p% | %E \")\n rows = [[\"Valid Original URL?\", \"Valid Article URL?\"]]\n @values.each_with_index do |row, index|\n next if index == 0\n valid_original_url = validate_url(row[9]) ? \"\" : \"DIRTY\"\n valid_article_url = validate_url(row[10]) ? \"\" : \"DIRTY\"\n rows << [valid_original_url, valid_article_url]\n progressbar.increment\n end\n\n update_sheet(rows)\n end",
"title": ""
},
{
"docid": "442a7cd6042b05cb9f0446f81af28d78",
"score": "0.50676596",
"text": "def fitFiles(target)\n buckets()\n runningSize = 0\n fileSet = FileSet.new(target, @log, @DEBUG, @LOG_DEBUG)\n \n # Go thru each bucket...\n @sortedBuckets.each do |bkt|\n Utils.printMux(@log, \"Processing bucket '#{bkt}'\")\n\n # ... And each file in the bucket\n @data[bkt].each do |file| \n Utils.printMux(@log, \"\\tProcessing file '#{file}'\")\n\n # The regular call to size won't work with larger (> 2 GB) files in some versions of Ruby, so call the custom version added above.\n fsize = File.size_big(file)\n\n Utils.printMux(@log, \"\\t\\t fsize: #{fsize}\\n\", @DEBUG, @LOG_DEBUG, Utils::DEBUG_LOW, Utils::LOG_LOW)\n Utils.printMux(@log, \"\\t\\trunningSize: #{runningSize}\\n\", @DEBUG, @LOG_DEBUG, Utils::DEBUG_LOW, Utils::LOG_LOW)\n Utils.printMux(@log, \"\\t\\t target: #{target}\\n\", @DEBUG, @LOG_DEBUG, Utils::DEBUG_LOW, Utils::LOG_LOW)\n\n\t\t\t # Sanity check the file size\n if (fsize < 0)\n Utils.printMux(@log, \"\\t\\t*** WARNING: fsize < 0 - skipping!\\n\", @DEBUG, @LOG_DEBUG, Utils::DEBUG_LOW, Utils::LOG_LOW)\n next\n end\n\n # Make sure this file won't push us over the limit\n if (fsize + runningSize) < target\n # take the first file in this bucket \n Utils.printMux(@log, \"\\t\\tAdding '#{file}' and removing from bucket\")\n fileSet.add(file, fsize)\n runningSize += fsize\n \n # Remove the file from the original list\n @data[bkt].delete(file)\n \n # See if we should remove the bucket, too\n if @data[bkt].size() == 0\n @data.delete(bkt)\n Utils.printMux(@log, \"Removed bucket '#{bkt}'\\n\")\n end\n else\n # Go to the next bucket and look at smaller files\n Utils.printMux(@log, \"\\t\\tDropping down to next bucket\\n\")\n break\n end\n\n # Give the CPU a bit of a break in between files\n sleep @sleepInterval\n end # iterate files\n\n # Give the CPU a bit of a break in between buckets\n sleep @sleepInterval\n end # iterate buckets\n \n # Save off the running size in the object\n @totalSize = runningSize\n \n # Save off the file set\n @fileSets << fileSet\n\n Utils.printMux(@log, \"totalSize: #{totalSize}\\n\", @DEBUG, @LOG_DEBUG, Utils::DEBUG_LOW, Utils::LOG_LOW)\n Utils.printMux(@log, \"fileSets:\\n\" + @fileSets.pretty_inspect(), @DEBUG, @LOG_DEBUG, Utils::DEBUG_LOW, Utils::LOG_LOW)\n\n return fileSet\n end",
"title": ""
},
{
"docid": "8a74fa930f881a0a602114a022e326ce",
"score": "0.5061947",
"text": "def process_round(model, iteration, info)\n @logger.info(\"iteration #{iteration}\")\n \n @demanders.each do |demander|\n if not model.in_allocation?(demander)\n bid = demander.get_bid(@suppliers, info)\n status = model.try_bid(demander, bid)\n\n @logger.info(\"#{demander.get_id} proposed bid #{bid.inspect}\")\n @logger.info(\"status: #{status}\")\n \n info.push({ :allocation => model.allocation.dup,\n :iteration => iteration,\n :demander => demander,\n :bid => bid,\n :status => status,\n })\n end\n end\n end",
"title": ""
},
{
"docid": "a214da707a6dbbe8d81e406e55661e05",
"score": "0.50594455",
"text": "def print_csv_results\n FileUtils.mkdir_p(\"data\")\n File.open(\"data/results.csv\", \"w\") do |f|\n @data.sort_by{|id, values| values[\"sum_dose\"]}.each do |id, values|\n f.puts \"%s\\t%d\\t%.4f\" % [id, values[\"ddays\"], dose_unit(values[\"sum_dose\"])]\n end\n end\n end",
"title": ""
},
{
"docid": "6b3a54a63328a66b3c181bc5fc9d5640",
"score": "0.5058366",
"text": "def export_summary(user_data)\n header = []\n row = []\n\n # chose to remove the 'total' key in the hash, figured end user will want to use own calculation on the CSV file when downloaded\n user_data[\"points\"].delete(\"total\")\n\n # put the hash keys into an array to form the header line\n user_data[\"points\"].each_key do |key|\n header << key\n end\n\n # put the values in an array to form the first line\n user_data[\"points\"].each_value do |value|\n row << value\n end\n\n # create the CSV file\n CSV.open(\"summary_#{user_data[\"name\"].downcase.split.join(\"_\")}.csv\", \"wb\") do |csv|\n\n # add the arrays into the file to create the header and first row\n csv << header\n csv << row\n end\n\n # unless something went wrong, show that the data exported correctly\n if File.exist?(\"summary_#{user_data[\"name\"].downcase.split.join(\"_\")}.csv\")\n puts \"\\nFile successfully save!\"\n else\n puts \"\\nThe files did not save, try again.\"\n end\nend",
"title": ""
},
{
"docid": "8beb6db8d056f445bbf5bb2c7f5220ae",
"score": "0.5051975",
"text": "def process_coupom\n @orders_csv.each do |oc|\n coupom = @coupons[oc.coupom_id]\n @orders_hash[oc.id].compute(coupom) if coupom && coupom.valid?\n end\n end",
"title": ""
},
{
"docid": "a8f80fda440d0911542aea85eee950d4",
"score": "0.501718",
"text": "def run\n scale_stack.each do |current_scale|\n stats_at_scale(current_scale).each do |klass|\n klass.harvest(poll_time)\n end\n end\n end",
"title": ""
},
{
"docid": "ecfe0909f95a26d0aa94685c447469d0",
"score": "0.5009108",
"text": "def perform_first(input_csv)\n partner = false\n delivery = \"\"\n output = []\n total_cost = 0\n count = 0\n sum = 0\n CSV.foreach(input_csv, headers: false) do |row|\n # Each row of partners hash\n # sample: {\"P1\"=>[{:\"Size Slab (IN GB)\"=>\"0-100\", :\"Minimum Cost\"=>\"1500\", :\"Cost Per GB\"=>\"20\"}, {:\"Size Slab (IN GB)\"=>\"100-200\", :\"Minimum Cost\"=>\"2000\", :\"Cost Per GB\"=>\"13\"}, {:\"Size Slab (IN GB)\"=>\"200-300\", :\"Minimum Cost\"=>\"2500\", :\"Cost Per GB\"=>\"12\"}, {:\"Size Slab (IN GB)\"=>\"300-400\", :\"Minimum Cost\"=>\"3000\", :\"Cost Per GB\"=>\"10\"}], \"P2\"=>[{:\"Size Slab (IN GB)\"=>\"0-200\", :\"Minimum Cost\"=>\"1000\", :\"Cost Per GB\"=>\"20\"}, {:\"Size Slab (IN GB)\"=>\"200-400\", :\"Minimum Cost\"=>\"2500\", :\"Cost Per GB\"=>\"15\"}], \"P3\"=>[{:\"Size Slab (IN GB)\"=>\"100-200\", :\"Minimum Cost\"=>\"800\", :\"Cost Per GB\"=>\"25\"}, {:\"Size Slab (IN GB)\"=>\"200-600\", :\"Minimum Cost\"=>\"1200\", :\"Cost Per GB\"=>\"30\"}]} \n values = []\n stripped_row = row.collect(&:strip)\n values << stripped_row[0]\n @h[stripped_row[2]].each do |k, v|\n # k = partner ids\n # v = size_slab, minimum_cost, cost_per_gb arrays\n v.each do |a|\n # a = Each array of size_slab, minimum_cost, cost_per_gb\n if find_range(a[:\"Size Slab (IN GB)\"], stripped_row[1])\n partner = true\n # Calculate minimum cost\n mul_value = (a[:\"Cost Per GB\"].to_i * stripped_row[1].to_i)\n if mul_value >= a[:\"Minimum Cost\"].to_i\n if count > 0\n if mul_value < sum\n sum = mul_value\n delivery = k\n total_cost = sum\n end\n else\n sum = mul_value\n delivery = k\n total_cost = sum\n count += 1\n end\n end\n end\n end\n end\n count = 0\n # Assinging output values\n values << true if partner == true\n values << total_cost\n values << delivery\n values.join(' ')\n output << values\n end\n # To create output csv\n create_output_csv(output)\n end",
"title": ""
},
{
"docid": "50ab29fcb943639a6a222c5f6e8a7a2d",
"score": "0.5008505",
"text": "def update_metric_values!\n puts \"Updating metric values...\"\n update_daily_happiness_distributions!\n update_weekly_happiness_distributions!\n update_monthly_happiness_distributions!\n update_annual_happiness_distributions!\n update_average_happiness_distributions!\n update_averages_for_metrics!\n puts \"Done updating metric values.\"\n end",
"title": ""
},
{
"docid": "ae4fcbbaa7899df67a7a207a9854bb76",
"score": "0.5008025",
"text": "def perform\n centry_ids_prices.each do |product|\n if product[0].present? && product[1].present?\n resp = centry.put(\"/conexion/v1/products/#{product[0]}.json\", {}, {\"price_compare\": product[1]})\n if (resp.code == \"200\")\n centry_product_info = JSON.parse(resp.body)\n ::Product.where(id_product_centry: centry_product_info[\"_id\"]).each do |local_product|\n local_product[:last_price_reported_centry] = centry_product_info[\"price_compare\"]\n local_product.save!\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "b4178b6a582cf71890d92a88ef08eb9e",
"score": "0.50031525",
"text": "def wrestler_raw_values_output\n\t\ttt_probability = \"%.1f\" % (self.statistics[:tt_probability] * 100) + \"%\"\n\t\tcard_rating = \"%.1f\" % self.statistics[:total_card_rating]\n\t\toc_probability = \"%.1f\" % (self.statistics[:oc_probability] * 100) + \"%\"\n\t\ttotal_card_points_per_round = \"%.3f\" % self.statistics[:total_card_points_per_round]\n\t\tdq_probability_per_round = \"%.1f\" % (self.statistics[:dq_probability_per_round] * 100) + \"%\"\n\t\tpa_probability_per_round = \"%.1f\" % (self.statistics[:pa_probability_per_round] * 100) + \"%\"\n\t\tsub_probability_per_round = \"%.1f\" % (self.statistics[:sub_probability_per_round] * 100) + \"%\"\n\t\txx_probability_per_round = \"%.1f\" % (self.statistics[:xx_probability_per_round] * 100) + \"%\"\n\t\tsub_prob = \"%.1f\" % (self.points[:sub_prob] * 100) + \"%\"\n\t\ttag_prob = \"%.1f\" % (self.points[:tag_prob] * 100) + \"%\"\n\n\t\tf = File.new('files/raw_results.csv', 'a')\n\t\tf.write(\"#{self.values[:set]},\")\n\t\tself.values.each { |k, v|\n\t\t\tf.write(v, \",\") \n\t\t}\n\t\tf.write(\"#{tt_probability}, #{card_rating}, #{oc_probability}, #{total_card_points_per_round}, #{dq_probability_per_round}, #{pa_probability_per_round}, #{sub_probability_per_round}, #{xx_probability_per_round}, #{sub_prob}, #{tag_prob}, #{self.values[:sub][0]}, #{self.values[:sub][1]}, #{self.values[:tag][0]}, #{self.values[:tag][1]}\\n\")\n\t\tf.close\n\tend",
"title": ""
},
{
"docid": "da9575417c7b2c0a36bebff849fb6a8e",
"score": "0.50014776",
"text": "def compute_csv_data\n row_count = 0\n csv_row_number = 0\n csv_data = []\n CSV.foreach(self.file.path, headers: true) do |row|\n # Transform row to hash\n row = row.to_hash\n # Normalize it\n row = normalize_row(row)\n # Increment row number\n csv_row_number += 1\n\n # PRECOMPUTE\n row = precompute_row(row, csv_row_number) # row[:csv_row_number] = csv_row_number AND initialize errors and array fields as arrays\n\n # store the valid_row result\n valid_row = valid_row?(row)\n\n # tranform raw row hash into a intermediate (more concise) information OR put in rejected data\n if valid_row\n csv_data << compute_row(row)\n else\n @rejected_user_data << row\n end\n if !self.limit.zero? && valid_row\n row_count += 1\n if row_count >= self.limit\n break\n end\n end\n end\n # Save original CSV data for post-processing report\n @original_csv_data = csv_data\n end",
"title": ""
},
{
"docid": "a55024e33ea35059b7c7fdaab977ffa5",
"score": "0.49916217",
"text": "def process(report)\n puts \"Code to process csv goes here for #{report}\"\n\n CSV.foreach(report, headers: true) do |row|\n# **** actions here are operated on every row in the csv ****\n puts row['Site Name']\n end\nend",
"title": ""
},
{
"docid": "1954118668432009a29c3ac160fce6ec",
"score": "0.49881563",
"text": "def summarize_results!(all_results)\n \t summaries = {}\n \t all_results.each do |paramset, results|\n \t File.open(@dir + \"/results-#{param_string(paramset)}.yaml\", 'w' ) do |out|\n \t\t\tYAML.dump(results, out)\n \t\tend\n \t\tsummaries[paramset] = {}\n \t\t# create an array of arrays\n \t\tres = results.keys.map do |key| \n \t\t # calculate stats\n \t\t a = results[key]\n \t\t if a.all? {|el| el.is_a? Numeric }\n \t\t summaries[paramset][\"#{key} mean\"] = Stats::mean(a)\n \t\t summaries[paramset][\"#{key} SD\"] = Stats::standard_deviation(a)\n \t\t [key] + a + [Stats::mean(a), Stats::standard_deviation(a)]\n \t\t else\n \t\t [key] + a + [\"--\", \"--\"]\n \t end\n \t\t end\n\t\t \n \t\t ls = results.keys.map{|v| [7, v.to_s.length].max }\n \t\t\n \t\tls = [\"Std Deviation\".length] + ls\n \t\tres = header_column + res\n \t\tres = res.transpose\n \t\tout = build_table res, ls\n \t\tFile.open(@dir + \"/#{paramset}-summary.mmd\", 'w') do |f|\n \t\t f << \"## Results for #{@experiment} with parametres #{param_string(paramset, \", \")} ##\\n\\n\"\n \t\t f << out\n \t\t end\n\t\t end\n\t\t \n\t\t # Build CSV file with all of the results\n\t\t #puts summaries.inspect\n\t\t \n\t\t summaries = summaries.to_a\n #puts summaries.inspect\n\t\t keys1 = summaries.first.first.keys\n\t\t keys2 = summaries.first.last.keys\n\t\t #puts keys1.inspect, keys2.inspect, \"=====\"\n CSV.open(@dir + \"/results.csv\", \"w\") do |csv|\n \t csv << keys1 + keys2\n \t summaries.each do |summary|\n \t #puts summary.first.inspect\n \t #puts summary.first.values_at(*keys1).inspect + summary.last.values_at(*keys2).inspect\n \t csv << summary.first.values_at(*keys1) + summary.last.values_at(*keys2)\n \t \n \t end\n \t end\n\t\t \n\t end",
"title": ""
},
{
"docid": "799c95208d563414e50eb02d5ac5717a",
"score": "0.49864542",
"text": "def display_results(remaining_exploits)\n rezsize = remaining_exploits.size\n puts \"[\".light_green + \"*\".white + \"] \".light_green + \"Saved #{rezsize} Result(s) to: #{@out}\".white if @log\n puts \"[\".light_green + \"*\".white + \"] \".light_green + \"Displaying Result(s):\".white if @verbose and @log\n puts \"[\".light_green + \"*\".white + \"] \".light_green + \"Found #{rezsize} Result(s):\".white if @verbose and not @log\n remaining_exploits.each do |line|\n if line =~ /(\\\".+,.+\\\")/\n crappy_csv_line = $1\n not_as_crappy_csv_line = crappy_csv_line.sub(\",\", \"\")\n workable_csv_line = line.sub!(\"#{crappy_csv_line}\",\"#{not_as_crappy_csv_line}\").split(\",\")\n else\n workable_csv_line = line.split(\",\")\n end\n foo = workable_csv_line - workable_csv_line.slice(0,5)\n foobar = foo - workable_csv_line.slice(-1, 1) - workable_csv_line.slice(-2, 1)\n if @log\n f = File.open(\"#{@out}\", 'a+')\n f.puts \"Description: #{workable_csv_line[2]}\"\n f.puts \"Location: #{CSV.split(\"/\")[0..-2].join(\"/\")}/#{workable_csv_line[1]}\"\n f.puts \"Exploit ID: #{workable_csv_line[0]}\"\n f.puts \"Platform: #{foobar.join(\",\")}\"\n f.puts \"Type: #{workable_csv_line[-2]}\"\n if not \"#{workable_csv_line[-1].chomp}\".to_i == 0\n f.puts \"Port: #{workable_csv_line[-1].chomp}\"\n end\n f.puts \"Author: #{workable_csv_line[4]}\"\n f.puts \"Submit: #{workable_csv_line[3]}\"\n f.puts\n f.close\n end\n if @verbose\n puts \"[\".light_green + \"*\".white + \"] \".light_green + \"Description: \".light_red + \"#{workable_csv_line[2]}\".white\n puts \"[\".light_green + \"*\".white + \"] \".light_green + \"Location: \".light_red + \"#{CSV.split(\"/\")[0..-2].join(\"/\")}/#{workable_csv_line[1]}\".white\n puts \"[\".light_green + \"*\".white + \"] \".light_green + \"Exploit ID: \".light_red + \"#{workable_csv_line [0]}\".white\n puts \"[\".light_green + \"*\".white + \"] \".light_green + \"Platform: \".light_red + \"#{foobar.join(\",\")}\".white\n puts \"[\".light_green + \"*\".white + \"] \".light_green + \"Type: \".light_red + \"#{workable_csv_line[-2]}\".white\n if not \"#{workable_csv_line[-1].chomp}\".to_i == 0\n \"[\".light_green + \"*\".white + \"] \".light_green + \"Port: \".light_red + \"#{workable_csv_line[-1].chomp}\".white\n end\n puts \"[\".light_green + \"*\".white + \"] \".light_green + \"Author: \".light_red + \"#{workable_csv_line[4]}\".white\n puts \"[\".light_green + \"*\".white + \"] \".light_green + \"Submit: \".light_red + \"#{workable_csv_line[3]}\\n\".white\n end\n end\n puts \"[\".light_blue + \"*\".white + \"] \".light_blue + \"Search Complete!\".white\n puts \"[\".light_blue + \"*\".white + \"] \".light_blue + \"Hope you found what you needed....\".white\n puts \"[\".light_blue + \"*\".white + \"] \".light_blue + \"Good Bye!\".white\nend",
"title": ""
},
{
"docid": "c7f010c18b23e3a3ab909711aa70a105",
"score": "0.49740425",
"text": "def process_end()\n self.output.print(\"processed #{@total_campgrounds.count} records\\n\")\n @counters.keys.sort.each do |k|\n if @counters[k].count > 0\n self.output.printf(\"%-20s : %d\\n\", k, @counters[k].count)\n @counters[k].each do |c|\n self.output.print(\" #{c[:name]}\\n\")\n end\n end\n end\n\n super()\n end",
"title": ""
},
{
"docid": "c7abe30b74e1bfe3fa3a7736624c6e91",
"score": "0.49730042",
"text": "def syssamples_tocsv(_apikey, _uuid, _systemname, _keys, ts, te, ss)\n _systemname = _uuid if _systemname.nil?\n\n begin\n simple_syskeys = {\n 'h' => ['health index', 'health state', 'uptime state', 'blocked state', 'load state', 'cpu state',\n 'memory state', 'state on last update', 'filesystem health index', 'filesystem state'],\n 'r' => ['running procs'],\n 'b' => ['blocked procs'],\n 'l' => ['system load'],\n 'm' => ['buffer memory MB', 'cache memory MB', 'free memory MB', 'used memory MB'],\n 's' => ['swap used MB', 'swap free MB'],\n 'c' => ['active', 'iowait', 'user', 'nice', 'system', 'irq', 'softirq', 'steal', 'guest']\n }\n\n complex_syskeys = {\n 's_c' => ['active', 'iowait', 'user', 'nice', 'system', 'irq', 'softirq', 'steal', 'guest'],\n 's_i' => ['rx KB/s average', 'tx KB/s average'],\n 's_f' => ['used Gbytes', 'free Gbytes'],\n 's_d' => ['reads KB/s', 'writes KB/s']\n }\n\n proc_syskeys = {\n 'p' => ['name', 'cmd line', 'PID', 'UID', 'state', 'CPU % User', 'CPU % System',\n 'CPU % Total', 'internal', 'Memory Virtual', 'Memory Resident', 'internal'],\n 'u' => ['User UID', 'CPU % User', 'CPU % System', 'CPU % Total', 'internal use',\n 'Memory Virtual', 'Memory Resident', 'Internal Use']\n }\n\n simple_numcats = {\n 'h' => 10,\n 'r' => 1,\n 'b' => 1,\n 'l' => 1,\n 'm' => 4,\n 's' => 2,\n 'c' => 9\n }\n\n complex_numcats = {\n 's_c' => 9,\n 's_i' => 2,\n 's_f' => 2,\n 's_d' => 2\n }\n\n proc_numcats = {\n 'p' => 12,\n 'u' => 8\n }\n\n keysto_strings = {\n 'h' => 'health',\n 'r' => 'run-procs',\n 'b' => 'block-procs',\n 'l' => 'sys-load',\n 'm' => 'memory',\n 's' => 'swap',\n 'c' => 'cpu',\n 's_c' => 'cpu',\n 's_i' => 'net',\n 's_f' => 'filesys',\n 's_d' => 'diskio',\n 'p' => 'procs'\n }\n\n row_array = Array.new\n firstpass = true\n\n if $outpath_setup == false\n $outpath_setup = true\n if $output_path != '.'\n if Dir.exists?(\"#{$output_path}/\") == false\n if $verbose == true\n print 'Creating directory...'\n if Dir.mkdir(\"#{$output_path}/\", 0775) == -1\n print \"** FAILED ***\\n\"\n return false\n else\n FileUtils.chmod(0775, \"#{$output_path}/\")\n print \"Success\\n\"\n end\n else\n if Dir.mkdir(\"#{$output_path}/\", 0775) == -1\n print \"FAILED to create directiory \" + \"#{$output_path}/\" + \"\\n\"\n return false\n else\n FileUtils.chmod(0775, \"#{$output_path}/\")\n end\n end\n else\n FileUtils.chmod(0775, \"#{$output_path}/\")\n end\n end\n end\n start = Time.now\n systemdata = GetSystemSamples.uuid(_apikey, _uuid, _keys, ts, te, ss)\n $times[$timed_calls] = Time.now - start\n $timed_calls += 1\n\n if systemdata.nil?\n puts \"\\nSkipping #{_systemname}\\n\"\n else\n keys = _keys\n keys_array = Array.new\n keys_array = keys.split(',')\n\n onesystem = Hash.new\n onesystem = systemdata[0]\n\n if (onesystem['_ts'].nil?) || (onesystem['_bs'].nil?)\n if $debug == true\n puts \"_ts or _bs was nil. Skipping this system\\n\"\n end\n else\n base_time = onesystem['_ts']\n sample_time = onesystem['_bs']\n\n if $verbose == true\n puts \"System data actual start date #{Time.at(base_time).getlocal}; actual sample size #{sample_time} \\n\"\n end\n\n incr = sample_time.to_i\n\n buckets = Array.new\n bucketoff = Array.new\n bucketcnt = 0\n off = 0\n t = base_time\n\n while t <= te\n buckets[bucketcnt] = t\n bucketoff[bucketcnt] = off\n t = t + incr\n off = off + incr\n bucketcnt = bucketcnt + 1\n end\n\n ctr = 0\n while ctr <= bucketcnt\n row_array[ctr] = Array.new\n ctr += 1\n end\n inp_keyhash = Hash.new\n\n keys_array.each do |keystr|\n inp_keyhash = onesystem[keystr]\n hdrrow = nil\n row = Array.new\n\n if simple_syskeys.has_key?(keystr)\n hdrrow = CSVHeaders.create('simple', simple_syskeys[keystr], [], firstpass)\n row_array[0].concat(hdrrow)\n\n numcats = simple_numcats[keystr]\n samples = inp_keyhash\n missctr = 0\n arrayctr = 0\n lastsample = 0\n firstsample = -1\n\n while arrayctr < bucketcnt\n if firstpass\n row_array[arrayctr + 1].concat([Time.at(buckets[arrayctr].to_i).getlocal])\n end\n\n val = samples[bucketoff[arrayctr].to_s]\n unless val.is_a?(Array)\n tmpa = Array.new\n tmpa[0] = val\n val = tmpa\n end\n if val.nil?\n row_array[arrayctr + 1].concat([''] * numcats)\n missctr = missctr + 1\n else\n row_array[arrayctr + 1].concat(val)\n\n if firstsample == -1\n firstsample = arrayctr\n end\n lastsample = arrayctr\n end\n arrayctr = arrayctr + 1\n end\n firstpass = false\n\n elsif complex_syskeys.has_key?(keystr)\n numcats = complex_numcats[keystr]\n names = Array.new\n\n if inp_keyhash != nil\n ckeys = inp_keyhash.keys\n\n ctr = 0\n while ctr < inp_keyhash.length\n names[ctr] = ckeys[ctr].to_s\n ctr = ctr + 1\n end\n\n hdrrow = CSVHeaders.create('complex', complex_syskeys[keystr], names, firstpass)\n row_array[0].concat(hdrrow)\n\n missctr = 0\n arrayctr = 0\n lastsample = 0\n firstsample = -1\n\n while arrayctr < bucketcnt\n if firstpass\n row_array[arrayctr + 1].concat([Time.at(buckets[arrayctr].to_i).getlocal])\n arrayctr + 1\n end\n ckeys.each do |ckey|\n samples = inp_keyhash[ckey]\n val = samples[bucketoff[arrayctr].to_s]\n\n if val.nil?\n row_array[arrayctr + 1].concat([''] * numcats)\n missctr = missctr + 1\n else\n row_array[arrayctr+1].concat(val)\n if firstsample == -1\n firstsample = arrayctr\n end\n lastsample = arrayctr\n end\n end\n arrayctr = arrayctr + 1\n end\n firstpass = false\n end\n elsif keystr == 'p'\n if inp_keyhash != nil\n ckeys = ['p', 'u']\n\n missctr = 0\n arrayctr = 0\n lastsample = 0\n firstsample = -1\n max_pprocs = 0\n num_pprocs = 0\n max_uprocs = 0\n num_uprocs = 0\n\n # first run through all time samples, and find max number of procs and\n # max number of uprocs\n while arrayctr < bucketcnt\n samples = inp_keyhash[bucketoff[arrayctr].to_s]\n if samples != nil\n newsamples = valid_json?(samples)\n if newsamples != nil\n samples = newsamples\n end\n\n pval = samples['p']\n num_pprocs = pval.length\n\n if num_pprocs > max_pprocs\n max_pprocs = num_pprocs\n end\n\n uval = samples['u']\n num_uprocs = uval.length\n\n if num_uprocs > max_uprocs\n max_uprocs = num_uprocs\n end\n end\n arrayctr += 1\n end\n\n arrayctr = 0\n num_pprocs = 0\n num_uprocs = 0\n\n # step through the expected offsets\n while arrayctr < bucketcnt\n if firstpass\n row_array[arrayctr + 1].concat([Time.at(buckets[arrayctr].to_i).getlocal])\n end\n\n samples = inp_keyhash[bucketoff[arrayctr].to_s]\n if samples != nil\n newsamples = valid_json?(samples)\n if newsamples != nil\n samples = newsamples\n end\n\n pval = samples['p']\n uval = samples['u']\n if pval != nil\n num_pprocs = pval.length\n excess = max_pprocs - num_pprocs\n\n pctr = 0\n while pctr < num_pprocs\n if pval[pctr].nil?\n row_array[arrayctr + 1].concat([''] * 12)\n else\n if pval[pctr].is_a?(Array)\n row_array[arrayctr+1].concat(pval[pctr])\n if firstsample == -1\n firstsample = arrayctr\n end\n lastsample = arrayctr\n else\n if $debug == true\n puts \"\\npctr is #{pctr} pval[pctr] is not an array : \\n\"\n print \"\\n\"\n end\n end\n end\n pctr += 1\n end\n\n if excess > 0\n pctr = 0\n while pctr < excess\n row_array[arrayctr+1].concat([''] * 12)\n pctr += 1\n end\n end\n end\n uval = samples['u']\n\n if uval != nil\n num_uprocs = uval.length\n excess = max_uprocs - num_uprocs\n\n pctr = 0\n while pctr < num_uprocs\n if uval[pctr].nil?\n row_array[arrayctr+1].concat([''] * 12)\n elsif uval[pctr].is_a? String\n row_array[arrayctr+1].concat([uval[pctr]])\n else\n row_array[arrayctr+1].concat(uval[pctr])\n end\n pctr += 1\n end\n\n if excess > 0\n pctr = 0\n while pctr < excess\n row_array[arrayctr+1].concat([''] * 12)\n pctr += 1\n end\n end\n end\n end\n arrayctr = arrayctr + 1\n end\n proc_ctr = 0\n while proc_ctr < max_pprocs\n hdrrow = CSVHeaders.create('simple', proc_syskeys['p'], [], firstpass)\n firstpass = false\n row_array[0].concat(hdrrow)\n proc_ctr += 1\n end\n proc_ctr = 0\n while proc_ctr < max_uprocs\n hdrrow = CSVHeaders.create('simple', proc_syskeys['u'], [], firstpass)\n firstpass = false\n row_array[0].concat(hdrrow)\n proc_ctr += 1\n end\n end\n else\n if $debug\n puts \"DEBUG: Unsupported key: \"+keystr+\"\\n\"\n end\n end\n end\n\n _systemname.gsub!('/', '_')\n _systemname.gsub!('\\\\', '_')\n\n fname = \"#{$output_path}/#{_systemname}.csv\"\n if $verbose\n puts \"Writing to #{fname}\\n\\n\"\n else\n print \".\"\n end\n\n CSV.open(fname, 'wb', {force_quotes: true}) do |csv|\n ctr = 0\n while ctr <= bucketcnt\n csv << row_array[ctr]\n ctr += 1\n end\n end\n end\n end\n end\n return true\nend",
"title": ""
},
{
"docid": "ca49b363c6901c3eba7b3e29311813b3",
"score": "0.49650845",
"text": "def draw\n self.results.to_a.each do |result|\n result.value = 0.5\n result.save!\n end\n end",
"title": ""
},
{
"docid": "0dee87ccb90896f3a1bb47e6474b0bba",
"score": "0.49606168",
"text": "def products_report(files)\n input_hash = files[0]\n output = files[1]\n\n # For each product in the data set:\n input_hash['items'].each do |toy|\n # Print the name of the toy\n output.puts \" #{toy['title']}\"\n\n # Print the retail price of the toy\n output.puts \" Retail price: #{toy['full-price']}\"\n\n # Calculate and print the total number of purchases\n sales_num = toy['purchases'].count\n output.puts \" Number sold: #{sales_num}\"\n\n # Calculate and print the total amount of sales\n sales_sum = do_total(toy['purchases'], 'price')\n output.puts \" Total amount of sales: #{sales_sum}\"\n\n # Calculate and print the average price the toy sold for\n average_sale = sales_sum / sales_num\n output.puts \" Average sale price: #{average_sale}\"\n\n # Calculate and print the average discount (% or $) based off the average sales price\n output.puts \" Average discount: #{((1 - (average_sale / toy['full-price'].to_f)) * 100).round(2)} %\"\n\n output.puts\n end\nend",
"title": ""
},
{
"docid": "f7826100d06f6a4cddd0cdee043e31e0",
"score": "0.49534175",
"text": "def process\n return if self.metrics.nil? # failed reports may have no metrics? be safe.\n changes = self.metrics['changes']['total']\n\n if changes > 0\n epochtime = Time.now.utc.to_i\n host_as_underscores = self.host.gsub(/\\./, '_')\n name = \"#{PATH_PREFIX}.#{host_as_underscores}\" \n\n send_metric \"#{name} #{changes} #{epochtime}\"\n end\n end",
"title": ""
},
{
"docid": "67366964fe6b7421efe1c8b6865ef00d",
"score": "0.49467212",
"text": "def find_recommendations (grouping_type, store, products, start_date, end_date, directory)\n before = Time.now\n \n recommended = get_all_accessories(store,products,start_date,end_date,directory)\n\n # Sorts the accessories into categories, then stores the data in the manner dictated above\n recommended.each_pair do |sku,recommendations| \n product_id = get_id(sku,:main,store)\n \n # Get presence numbers and top n products for each product_type (sorting part)\n acc_cats = {}\n count = 0\n p \"Sorting recommendations for #{sku}\"\n recommendations.sort_by{|sku,sales| sales}.reverse.each do |sku|\n acc_sku = sku[0]\n sales = sku[1]\n begin\n cat_id = get_id(acc_sku,:category,store)\n if acc_cats.key?(cat_id)\n acc_cats[cat_id][0] += sales # Add the number of sales this item has to the product_type total\n acc_cats[cat_id][1].store(acc_sku,sales)\n else\n acc_cats[cat_id] = [sales,{acc_sku=>sales}]\n end\n count += sales # The total sales of all categories (not used for table)\n rescue\n p \"Product #{acc_sku} does not exist in the database\" # When database is filled this should rarely be an issue\n end\n end\n \n # Saving part\n case grouping_type\n # Writes data to accessories table (each accessory has sales numbers linked to main product)\n when \"table\"\n write_to_acc_table(sku,recommendations,acc_cats,store)\n # Writes data to text_specs table -> data is hardcoded -> need to run task again to change it\n when \"fixed_categories\",\"numerical\"\n # Add top n purchased accessories to string\n text = \"Top #{ACCESSORIES_PER_PRODUCT_TYPE}~#{count}~\"\n recommendations.sort_by{|sku,sales| sales}.reverse.first(ACCESSORIES_PER_PRODUCT_TYPE).each do |product|\n sku = product[0]\n sales = product[1]\n text += sku.to_s+\"~\"+sales.to_s+\"~\"\n end\n case grouping_type\n when \"fixed_categories\"\n text += preset_acc_select(acc_cats)\n when \"numerical\"\n text += numerical_acc_select(acc_cats)\n end\n # Write text string to text spec table\n row = TextSpec.find_or_initialize_by_product_id_and_name(product_id,\"top_copurchases\")\n row.update_attributes(:value => text)\n end\n end\n\n after = Time.now\n p \"Time taken for task: \"+(after-before).to_s\nend",
"title": ""
},
{
"docid": "e452365a09b7538a983006bbd1d0c4bc",
"score": "0.49417225",
"text": "def before_export2engine\n raise \"error #{self.inspect} has no category \" unless self.category\n update_attribute(:label, \"#{self.category.label}'s default quizz\")\n QuizProduct.delete_all(:quiz_id => id)\n products.each { |product| QuizProduct.create(:product_id => product.id, :quiz_id => id) }\n QuizQuestion.delete_all(:quiz_id => id)\n questions.each { |question| QuizQuestion.create(:question_id => question.id, :quiz_id => id) }\n # recompute all tips for this each question\n questions.each { |question| question.compute_tips }\n \n # get the feature values \n products.each { |product|\n carriers = product.get_feature_value_string(110)\n carriers = carriers ? carriers.join(\",\") : 'n/a'\n product.update_attributes(:data_carriers => carriers,\n :data_rating => rand(5),\n :data_price => product.get_feature_value_string(143)) \n }\n end",
"title": ""
},
{
"docid": "1ce9f788409809843c2eed0839c3d569",
"score": "0.49353266",
"text": "def bruteforce\n File.delete(\"Optimals.csv\") if File.exists? \"Optimals.csv\"\n csv_write(\"Optimals.csv\",\"Material\",\"#{L_RANGE[0]} < L < #{L_RANGE[1]} (in m)\",\"#{D_RANGE[0]} < D < #{D_RANGE[1]} (in m)\",\"#{P_RANGE[0]} < P_allowable < #{P_RANGE[1]} (in kN)\",\"Max. objective = P_allowable / Volume = P/(D*D*L)\") \n MATERIALS.each do |mat|\n filename = \"#{mat[:name]}.csv\"\n File.delete(filename) if File.exists? filename\n csv_write(filename,\"#{L_RANGE[0]} < L < #{L_RANGE[1]} (in m)\",\"#{D_RANGE[0]} < D < #{D_RANGE[1]} (in m)\",\"Factor of safety\",\"#{P_RANGE[0]} < P_allowable < #{P_RANGE[1]} (in kN)\",\"Density (g/cc)\",\"Volume (mm^3)\",\"Mass (kg)\",\"Max. objective = P_allowable / Volume\") \n e = mat[:youngs_modulus]\n rho = mat[:density]\n data = []\n get_all_steps(L_RANGE,L_STEP).each do |l| # Loop through length\n get_all_steps(D_RANGE,D_STEP).each do |d| # Loop through diameter\n p_cr = (3.14*3.14*3.14*e*d*d*d*d)/(64*l*l) # Apply formula for critical load\n p = p_cr / FACTOR_OF_SAFETY # Calculate allowable load from critical load\n v = 3.14 * d * d * l /4 * 1000000000\n m = rho * v\n obj = p / v # Objective function to be maximized\n data.push({e: e,l: l,d: d,p: p,obj: obj})\n csv_write(filename,l,d,FACTOR_OF_SAFETY,p,rho*1000000,v,m,obj)\n end\n end \n \n # Find the optimal case\n data = data.sort_by { |x| x[:obj] }.reverse\n\n # Check if obtained solution of load is feasible\n while data[0][:p] < P_RANGE[0] || data[0][:p] > P_RANGE[1] \n data.delete_at 0\n end\n csv_write(\"Optimals.csv\",mat[:name],data[0][:l],data[0][:d],data[0][:p],data[0][:obj])\n puts data[0]\n end\nend",
"title": ""
},
{
"docid": "5621b17f212c46fab644bafc3ff32244",
"score": "0.49341443",
"text": "def process\n Wavefront::Write.new({ proxy: ENDPOINT, port: 2878 },\n tags: setup_tags).write(metrics_as_points)\n update_run_number\n end",
"title": ""
},
{
"docid": "9e66b134b40d50a90ab94ee915dc462e",
"score": "0.49336103",
"text": "def process\n csv_to_securities\n output_securities\n end",
"title": ""
},
{
"docid": "bf755c7dc7b6e97590613976dcee254c",
"score": "0.4927555",
"text": "def store_yardi_summary_files\n doc = Document.find_by_id(@options[:doc_id])\n period = ''\n date_err = false\n month = year = nil\n get_all_sheets.each do |sheet|\n if !read_via_numeral_abs(1, 1, sheet).blank? and read_via_numeral_abs(1, 1, sheet).downcase == 'boxscore summary'\n unless read_via_numeral_abs(3, 1, sheet).blank?\n dts = read_via_numeral_abs(3, 1, sheet).split(' = ').last.split('-')\n begin\n dts[0] = dts[0].to_date\n dts[1] = dts[1].to_date\n rescue\n date_err = true\n end\n unless date_err\n if dts[0] < dts[1] && dts[0].month == dts[1].month && (dts[1] - dts[0]).to_i > 27 && dts[1].year == dts[0].year\n month = dts[0].month\n year = dts[0].year\n period = 'year'\n elsif dts[0] < dts[1] && (dts[1] - dts[0]).to_i == 6\n period = 'weekly'\n else\n period = 'quit'\n doc.update_attribute('parsing_done',false)\n end\n end\n end\n if period == 'year'\n 6.upto find_last_base_cell(sheet) do |row|\n if read_via_numeral_abs(row, 1, sheet).blank? and !read_via_numeral_abs(row, 2, sheet).blank? and read_via_numeral_abs(row, 2, sheet).strip == 'Total'\n property_occupancy_summary = PropertyOccupancySummary.find_or_create_by_real_estate_property_id_and_year_and_month(doc.real_estate_property_id, year, month)\n property_occupancy_summary.total_building_rentable_s = read_via_numeral_abs(row, 3, sheet)\n property_occupancy_summary.current_year_sf_occupied_actual = (property_occupancy_summary.total_building_rentable_s.to_f * (read_via_numeral_abs(row,17,sheet).blank? ? 1 : read_via_numeral_abs(row,17,sheet).to_f)) / 100 rescue 0\n property_occupancy_summary.current_year_sf_vacant_actual = property_occupancy_summary.total_building_rentable_s - property_occupancy_summary.current_year_sf_occupied_actual rescue 0\n property_occupancy_summary.vacant_leased_number = read_via_numeral_abs(row, 7, sheet).blank? ? 0 : read_via_numeral_abs(row, 7, sheet).to_i\n property_occupancy_summary.vacant_leased_percentage = (property_occupancy_summary.vacant_leased_number.to_f / (read_via_numeral_abs(row, 5, sheet).blank? ? 1 : read_via_numeral_abs(row, 5, sheet).to_f)) * 100 rescue 0\n property_occupancy_summary.currently_vacant_leases_number = property_occupancy_summary.vacant_leased_number + (read_via_numeral_abs(row, 8, sheet).blank? ? 0 : read_via_numeral_abs(row, 8, sheet).to_f)\n property_occupancy_summary.currently_vacant_leases_percentage = ( property_occupancy_summary.currently_vacant_leases_number.to_f / (read_via_numeral_abs(row, 5, sheet).blank? ? 1 : read_via_numeral_abs(row, 5, sheet).to_f)) * 100 rescue 0\n property_occupancy_summary.occupied_preleased_number = read_via_numeral_abs(row, 9, sheet).blank? ? 0 : read_via_numeral_abs(row, 9, sheet).to_i\n property_occupancy_summary.occupied_preleased_percentage = (property_occupancy_summary.occupied_preleased_number.to_f / (read_via_numeral_abs(row, 5, sheet).blank? ? 1 : read_via_numeral_abs(row, 5, sheet).to_f)) * 100 rescue 0\n property_occupancy_summary.occupied_on_notice_number = property_occupancy_summary.occupied_preleased_number + (read_via_numeral_abs(row, 10, sheet).blank? ? 0 : read_via_numeral_abs(row, 10, sheet).to_i)\n property_occupancy_summary.occupied_on_notice_percentage = (property_occupancy_summary.occupied_on_notice_number.to_f / (read_via_numeral_abs(row, 5, sheet).blank? ? 1 : read_via_numeral_abs(row, 5, sheet).to_f)) * 100 rescue 0\n property_occupancy_summary.net_exposure_to_vacancy_number = (property_occupancy_summary.currently_vacant_leases_number - property_occupancy_summary.vacant_leased_number) + (property_occupancy_summary.occupied_on_notice_number - property_occupancy_summary.occupied_preleased_number)\n property_occupancy_summary.net_exposure_to_vacancy_percentage = (property_occupancy_summary.net_exposure_to_vacancy_number.to_f / (read_via_numeral_abs(row, 5, sheet).blank? ? 1 : read_via_numeral_abs(row, 5, sheet).to_f)) * 100 rescue 0\n property_occupancy_summary.current_year_units_total_actual = read_via_numeral_abs(row, 5, sheet).to_f\n property_occupancy_summary.current_year_units_occupied_actual = (property_occupancy_summary.current_year_units_total_actual.to_f * (read_via_numeral_abs(row,17,sheet).blank? ? 1 : read_via_numeral_abs(row,17,sheet).to_f)) / 100 rescue 0\n property_occupancy_summary.current_year_units_vacant_actual = property_occupancy_summary.current_year_units_total_actual - property_occupancy_summary.current_year_units_occupied_actual rescue 0\n property_occupancy_summary.save\n break\n end\n end if !date_err && month && year && period # check the excel file is valid.\n elsif period == \"weekly\"\n index_hash = {}\n availability, conversion = false, false\n 4.upto find_last_base_cell(sheet) do |row|\n if !read_via_numeral_abs(row, 1, sheet).blank? && [\"Availability\", \"Conversion Ratios\", \"Resident Activity\"].include?(read_via_numeral_abs(row, 1, sheet))\n availability = true if read_via_numeral_abs(row, 1, sheet) == \"Availability\"\n conversion = true if read_via_numeral_abs(row, 1, sheet) == \"Conversion Ratios\"\n elsif read_via_numeral_abs(row, 1, sheet).blank? && !read_via_numeral_abs(row, 2, sheet).blank? && read_via_numeral_abs(row, 2, sheet) == 'Total'\n availability, conversion = false, false\n elsif !read_via_numeral_abs(row, 1, sheet).blank? && !read_via_numeral_abs(row, 2, sheet).blank?\n if availability\n index_hash.update({read_via_numeral_abs(row, 1, sheet)=> ''})\n elsif conversion\n index_hash.update({read_via_numeral_abs(row, 1, sheet)=> row}) if index_hash.include? read_via_numeral_abs(row, 1, sheet)\n end\n end\n end\n 4.upto find_last_base_cell(sheet) do |row|\n unless read_via_numeral_abs(row, 1, sheet) == 'Code' && index_hash.include?(read_via_numeral_abs(row, 1, sheet))\n obj = PropertyWeeklyOsr.find_or_initialize_by_real_estate_property_id_and_floor_plan_and_time_period(doc.real_estate_property_id, read_via_numeral_abs(row, 1, sheet),dts[1].strftime(\"%Y-%m-%d\"))\n obj.user_id = doc.user_id\n obj.units = read_via_numeral_abs(row, 5, sheet)\n obj.prelsd = read_via_numeral_abs(row, 7, sheet).blank? ? 0 : read_via_numeral_abs(row, 7, sheet).to_i\n obj.vacant_total = obj.prelsd + (read_via_numeral_abs(row, 8, sheet).blank? ? 0 : read_via_numeral_abs(row, 8, sheet).to_i)\n obj.prelsd2 = read_via_numeral_abs(row, 9, sheet).blank? ? 0 : read_via_numeral_abs(row, 9, sheet).to_i\n obj.ntv_status_total = obj.prelsd2 + (read_via_numeral_abs(row, 10, sheet).blank? ? 0 : read_via_numeral_abs(row, 10, sheet).to_i)\n obj.current = obj.vacant_total + obj.ntv_status_total\n obj.pi_total = read_via_numeral_abs(index_hash[read_via_numeral_abs(row, 1, sheet)], 3, sheet)\n obj.wi_total = read_via_numeral_abs(index_hash[read_via_numeral_abs(row, 1, sheet)], 4, sheet)\n obj.dep_total = read_via_numeral_abs(index_hash[read_via_numeral_abs(row, 1, sheet)], 9, sheet)\n obj.dep_rej = read_via_numeral_abs(index_hash[read_via_numeral_abs(row, 1, sheet)], 14, sheet)\n obj.dep_canc = read_via_numeral_abs(index_hash[read_via_numeral_abs(row, 1, sheet)], 15, sheet)\n obj.save\n end if !read_via_numeral_abs(row, 1, sheet).blank? && !read_via_numeral_abs(row, 2, sheet).blank?\n break if read_via_numeral_abs(row, 1, sheet).blank? && !read_via_numeral_abs(row, 2, sheet).blank? && read_via_numeral_abs(row, 2, sheet) == 'Total'\n end unless index_hash.empty?\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a80478cd6bf32ddbd17063b7e9d40c29",
"score": "0.49267927",
"text": "def process_csv\n @file = @file.tempfile\n CSV.foreach(@file, headers: false) { |row| process_item(row[0].to_i) }\n end",
"title": ""
},
{
"docid": "e28b9e2ff9576a02624e0375d49933c2",
"score": "0.49244377",
"text": "def updatePrices\n\n puts \"Updating Search Result Prices\"\n\n SITE_CONFIG.each do |site, opts|\n\n SearchResult.order_by([[:updated_at, :desc]]).where(site_name: site).limit(GOOGLE_SERP_LIMIT * 10).each do |searchResult|\n\n puts \"Grabbing Prices for #{site.humanize.capitalize}:#{searchResult.sku}\"\n\n getPrices(searchResult)\n\n end\n\n end\n\nend",
"title": ""
},
{
"docid": "52a92715161279f9ab73b2e25cc9bcc5",
"score": "0.49186957",
"text": "def update_stats \n $logger.info \"regenerating stats from #{self.table_name}...\"\n \n # first delete the old data (always a good idea)\n AccessByServicePerMin.delete_all standard_condition \n AccessByServicePerHour.delete_all standard_condition\n AccessByServicePerDay.delete_all standard_condition\n \n # and reconstruct from the raw data\n success_entries = get_grouped_entries\n failure_entries = get_grouped_entries(false) \n \n # fill up gaps, merge the success and failure data and\n # write per-minute statistics\n 0.upto(23) do |hour|\n 0.upto(59) do |minute|\n \n the_timestamp = Time.at(start_ts + (hour * 60 + minute) * 60)\n \n new_row = AccessByServicePerMin.new(\n :host_name => self.host_name,\n :service_name => self.service_name,\n :log_ts => the_timestamp.strftime(\"%Y-%m-%d %H:%M:%S\"),\n :success_count => 0, \n :failure_count => 0,\n :response_time_micros_avg => 0\n )\n if success_entries.has_key?(the_timestamp)\n new_row[:success_count] = success_entries[the_timestamp].the_count\n new_row[:response_time_micros_avg] = success_entries[the_timestamp].the_avg\n end\n if failure_entries.has_key?(the_timestamp)\n new_row[:failure_count] = failure_entries[the_timestamp].the_count\n end\n new_row.save()\n end\n end\n \n # group the data we've just written by hour\n grouped_by_hour = get_hour_stats_from_minutes\n 0.upto(23) do |hour|\n the_timestamp = Time.at(start_ts + (hour * 60 * 60))\n new_row = AccessByServicePerHour.new(\n :host_name => self.host_name,\n :service_name => self.service_name,\n :log_ts => the_timestamp.strftime(\"%Y-%m-%d %H:%M:%S\"),\n :success_count => 0, \n :failure_count => 0,\n :response_time_micros_avg => 0 \n )\n if grouped_by_hour.has_key?(the_timestamp)\n new_row[:success_count] = grouped_by_hour[the_timestamp].success_sum\n new_row[:failure_count] = grouped_by_hour[the_timestamp].failure_sum\n new_row[:response_time_micros_avg] = grouped_by_hour[the_timestamp].the_avg\n end\n new_row.save\n end\n \n # and update the daily stats from the hours\n row = get_daily_stats_from_hours.first \n AccessByServicePerDay.new(\n :host_name => self.host_name,\n :service_name => self.service_name,\n :log_ts => start_ts.strftime(\"%Y-%m-%d %H:%M:%S\"),\n :success_count => row.success_sum, \n :failure_count => row.failure_sum,\n :response_time_micros_avg => row.the_avg\n ).save()\n $logger.info \"updated stats for #{self.service_name}@#{self.host_name} : #{row.success_sum} successful calls, #{row.failure_sum} failures between #{start_ts} and #{stop_ts}\"\n end",
"title": ""
},
{
"docid": "d0f3f8d726cc13cf08a7ef7b178cedff",
"score": "0.49157768",
"text": "def compute\n \tself.start_time = DateTime.now\n\n #call API request methods to fetch products\n\t\tApiRequestLog.process(self, endpoint)\n\n\t\tproducts = if category.present?\n\t\t\tProduct.where(category: category)\n\t\telse\n\t\t\tProduct.all\n\t\tend\n\n #compute average cubic weight\n\t\tif products.count > 0\n\t\t\t_total_cubic_weight = products.inject(0) {|r, p| r += p.volume.to_f * conversion_factor} \n\t\t\tself.average_cubic_weight = _total_cubic_weight.to_f / products.count \n\t\tend\n\n #update tracking data\n\t\tself.finished = true\n\t\tself.end_time = DateTime.now\n\t\tself.duration = end_time - start_time\n\t\tself.save(validate: false)\n\n #broadcast to client side to notify with calcualted average cubic weight of a related category\n if category.present?\n ActionCable.server.broadcast \"api_request_notifications_channel\", weight: \"#{average_cubic_weight} kg\", category: category\n else\n ActionCable.server.broadcast \"api_request_notifications_channel\", weight: \"#{average_cubic_weight} kg\"\n end\n\trescue\n end",
"title": ""
},
{
"docid": "c26528d6ada142a8f5f5aa9e8279a526",
"score": "0.49088144",
"text": "def run\n locales.each do |locale|\n # checking that all files / keys exist for any non.default locale\n self.files[locale].each do |file|\n build_hash(file)\n create_csv(file, locale)\n end\n end\n end",
"title": ""
},
{
"docid": "7ed20a6e431297a2b0baba42eff8a239",
"score": "0.4879067",
"text": "def process_result_dirs(parent_dir)\n # get all the result dirs in the parent dir\n results_dirs = Dir.glob(\"#{parent_dir}/*/\").sort\n puts \"processing #{results_dirs.length} results directories...\"\n\n # process each result dir\n results_dirs.each do |dir|\n dirname = File.basename(dir)\n puts \"processing results dir: #{dirname}\"\n\n csv_path = \"#{dir}#{dirname}.csv\"\n puts \"csv_path: #{csv_path}\"\n\n # create a summary csv with the headings and last 2 rows\n heading = \"<h1>#{dirname}</h1>\"\n table = extract_table_from_results_csv(csv_path)\n @tables += heading + table unless table.nil?\n end\nend",
"title": ""
},
{
"docid": "b95d01bdef736c8dd484b3aba48a0893",
"score": "0.48756504",
"text": "def pump_results!\n loop do\n distribute_results!\n end\n end",
"title": ""
},
{
"docid": "4ba791d057bd55a7840fe8b83b06a488",
"score": "0.48635888",
"text": "def run\n return if @classifiers.present?\n\n @classifiers = GRADES.each_with_object(new_classifiers) do |grade, classifiers|\n @projects[grade].each do |project|\n SECTIONS.product(PERIODS).each do |section, period|\n metrics = project.data_for(section: section, period: period)\n classifier_name = \"#{section}_#{period}\".to_sym\n\n classifiers[classifier_name][grade] = merge_metrics(\n classifiers[classifier_name][grade].to_h,\n metrics\n )\n end\n end\n end\n\n save\n end",
"title": ""
},
{
"docid": "fdff8880a33fe6b29fb9c68ee4076ed4",
"score": "0.4855472",
"text": "def before_results(controller_params)\n basename = File.basename( Dir.glob(File.join(job_dir, '*.a3m')).sort.last, '.a3m' ) \n \n # preparation for export functionality\n resfile = File.join(job_dir, jobid+\".\"+(controller_params[\"qsc\"] || '0.3')+\".hhrepid\")\n exportfile = File.join(job_dir, jobid+\".hhrepid\")\n FileUtils.rm_f(exportfile) if File.exists?(exportfile)\n FileUtils.cp(resfile, exportfile) if File.exists?(File.join(resfile))\n\n # parse results of HHrepID runs\n @qscs = QSCS\n @repfams = {}\n @plotfiles = {}\n @graphfiles = {}\n @mapfiles = {}\n @results = {}\n @mode = controller_params['mode'] || 'background'\n \n @qscs.each do |qsc|\n basename_w_qsc = basename + \".\" + qsc.to_s\n resultfile = basename_w_qsc + \".hhrepid\"\n graphfile = basename_w_qsc + \".png\"\n mapfile = basename_w_qsc + \".map\"\n \n next unless File.exists?(File.join(job_dir, resultfile))\n\n @graphfiles[qsc] = graphfile\n @mapfiles[qsc] = mapfile\n\n File.open(File.join(job_dir, resultfile), 'r' ) do |f|\n rp = Bioinf::Repeats::HHrepidParser.new.parse!(f)\n\n @repfams[qsc] = rp.repeat_families\n @plotfiles[qsc] = {}\n\n rp.repeat_families.each do |repfam|\n plotfile = basename_w_qsc+\"_#{repfam.famid}\"+\".png\"\n if File.exists?(File.join(job_dir, plotfile))\n @plotfiles[qsc][repfam.famid] = plotfile\n end\n end\n end\n\n res = IO.readlines(File.join(job_dir, resultfile)).map {|line| colorize(line) }.join.split(/Results for repeats type \\w:\\S*\\n/)\n res.shift\n @results[qsc] = {}\n res.each_index do |i| \n @results[qsc][ @repfams[qsc].map {|repfam| repfam.famid }.sort[i] ] = res[i] \n end\n\n end\n end",
"title": ""
},
{
"docid": "64046500a2c11961a203ce7bbdb30144",
"score": "0.48543864",
"text": "def syssamples_tocsv(_apikey, _uuid, _systemname, _keys, ts, te, ss)\n begin\n simple_syskeys = {\"h\" => [\"health index\", \"health state\", \"uptime state\", \"blocked state\", \"load state\", \"cpu state\", \"memory state\", \"state on last update\", \"filesystem health index\", \"filesystem state\"],\n \"r\" => [\"running procs\"],\n \"b\" => [\"blocked procs\"],\n \"l\" => [\"system load\"],\n \"m\" => [\"buffer memory MB\", \"cache memory MB\", \"free memory MB\", \"used memory MB\"],\n \"s\" => [\"swap used MB\", \"swap free MB\"]\n }\n complex_syskeys = {\"s_c\" => [\"active\", \"iowait\",\"user\", \"nice\", \"system\", \"irq\", \"softirq\", \"steal\", \"guest\"],\n \"s_i\" => [\"rx KB/s average\", \"tx KB/s average\"],\n \"s_f\" => [\"used Gbytes\", \"free Gbytes\"],\n \"s_d\" => [\"reads KB/s\", \"writes KB/s\"]\n }\n\n proc_syskeys = {\"p\" => [\"name\",\"cmd line\",\"PID\",\"UID\",\"state\",\"CPU % User\",\t\"CPU % System\",\t\"CPU % Total\", \"internal\", \t\"Memory Virtual\", \"Memory Resident\", \t\"internal\"],\n \"u\" =>\t[\"User UID\",\t\"CPU % User\",\t\"CPU % System\", \"CPU % Total\", \"internal use\",\"\tMemory Virtual\", \"Memory Resident\",\t\"internal use\"]\n }\n\n simple_numcats = {\"h\" => 10,\n \"r\" => 1,\n \"b\" => 1,\n \"l\" => 1,\n \"m\" => 4,\n \"s\" => 2\n }\n complex_numcats = {\"s_c\" => 9,\n \"s_i\" => 2,\n \"s_f\" => 2,\n \"s_d\" => 2\n }\n\n proc_numcats = {\"p\" => 12,\n \"u\" => 8\n }\n\n\n keysto_strings = { \"h\" => \"health\",\n \"r\" => \"run-procs\",\n \"b\" => \"block-procs\",\n \"l\" => \"sys-load\",\n \"m\" => \"memory\",\n \"s\" => \"swap\",\n \"s_c\" => \"cpu\",\n \"s_i\" => \"net\",\n \"s_f\" => \"filesys\",\n \"s_d\" => \"diskio\",\n \"p\" => \"procs\"\n }\n row_array = Array.new\n firstpass = true\n\n if $outpath_setup == false # ensure the following happens only once\n $outpath_setup = true\n if $output_path != \".\"\n if Dir.exists?($output_path.to_s+\"/\") == false\n if $verbose == true\n print \"Creating directory...\"\n if Dir.mkdir($output_path.to_s+\"/\",0775) == -1\n print \"** FAILED ***\\n\"\n return false\n else\n FileUtils.chmod 0775, $output_path.to_s+\"/\"\n print \"Success\\n\"\n end\n else\n if Dir.mkdir($output_path.to_s+\"/\",0775) == -1\n print \"FAILED to create directiory \"+$output_path.to_s+\"/\"+\"\\n\"\n return false\n else\n FileUtils.chmod 0775, $output_path.to_s+\"/\"\n end\n end\n else # the directory exists\n FileUtils.chmod 0775, $output_path.to_s+\"/\" # TODO only modify if needed?\n end # of 'if Dir.exists?($output_path.to_s+\"/\") == false'\n end\n end\n start = Time.now\n systemdata = GetSystemSamples.uuid( _apikey, _uuid, _keys, ts, te, ss)\n $times[$timed_calls] = Time.now - start\n $timed_calls += 1\n\n if systemdata == nil\n puts \"\\nSkipping \" + _systemname.to_s + \"\\n\"\n else\n keys = _keys\n keys_array = Array.new\n keys_array = keys.split(\",\")\n\n onesystem = Hash.new\n onesystem = systemdata[0]\n\n if (onesystem[\"_ts\"] == nil) || (onesystem[\"_bs\"] == nil)\n if $debug == true\n puts \"_ts or _bs was nil. Skipping this system\\n\"\n end\n else # else neither is nil\n base_time = onesystem[\"_ts\"]\n sample_time = onesystem[\"_bs\"]\n\n if $verbose == true\n puts \"system data actual start date \"+ Time.at(base_time).getlocal.to_s + \"; actual sample size \" + sample_time.to_s + \"\\n\"\n end\n\n incr = sample_time.to_i\n\n # create a master bucket list for this sample set, to detect missing samples\n buckets = Array.new # contains timestamps indexed from 0 to numentries - 1\n bucketoff = Array.new # contains offsets indexed from 0 to numentries - 1\n bucketcnt = 0\n off = 0\n\n# 4-21-2014\n# Handle the case where the instance data begins AFTER the start time\n# t = ts\n t = base_time\n\n while t <= te\n buckets[bucketcnt] = t\n bucketoff[bucketcnt] = off\n t = t + incr\n off = off + incr\n bucketcnt = bucketcnt + 1\n end\n\n ctr = 0\n while ctr <= bucketcnt\n row_array[ctr] = Array.new\n ctr += 1\n end\n inp_keyhash = Hash.new # one of these is pulled from the onesystem hash, and processed separately\n\n\n # Loop through all metrics sets (keys)\n keys_array.each do |keystr|\n inp_keyhash = onesystem[keystr] #inp_keyhash may have only samples (simple), or groups followed by samples (complex).\n hdrrow = nil\n row = Array.new\n\n if simple_syskeys.has_key?(keystr)\n hdrrow = CSVHeaders.create('simple',simple_syskeys[keystr],[],firstpass)\n #csv << hdrrow\n row_array[0].concat(hdrrow)\n\n numcats = simple_numcats[keystr]\n samples = inp_keyhash\n missctr = 0\n arrayctr = 0\n lastsample = 0\n firstsample = -1\n\n # step through the expected offsets\n while arrayctr < bucketcnt\n #row[0] = Time.at(buckets[arrayctr].to_i).utc\n\n if firstpass == true\n row_array[arrayctr+1].concat([Time.at(buckets[arrayctr].to_i).getlocal])\n end\n\n val = samples[bucketoff[arrayctr].to_s]\n if val.is_a?(Array) != true\n tmpa = Array.new\n tmpa[0] = val\n val = tmpa\n end\n if val == nil\n case numcats\n when 1\n row_array[arrayctr+1].concat([\"\"])\n when 2\n row_array[arrayctr+1].concat([\"\", \"\"])\n when 4\n row_array[arrayctr+1].concat([\"\", \"\", \"\", \"\"])\n when 9\n row_array[arrayctr+1].concat([\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"])\n when 10\n row_array[arrayctr+1].concat([\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"])\n end\n missctr = missctr + 1\n else\n row_array[arrayctr+1].concat(val)\n\n if firstsample == -1\n firstsample = arrayctr\n end\n lastsample = arrayctr\n end\n arrayctr = arrayctr + 1\n end # of 'while arrayctr < bucketcnt'\n\n elsif complex_syskeys.has_key?(keystr)\n numcats = complex_numcats[keystr]\n names = Array.new\n\n if inp_keyhash != nil\n ckeys = inp_keyhash.keys\n\n ctr = 0\n while ctr < inp_keyhash.length\n names[ctr] = ckeys[ctr].to_s\n ctr = ctr + 1\n end\n\n hdrrow = CSVHeaders.create('complex',complex_syskeys[keystr],names,firstpass)\n row_array[0].concat(hdrrow)\n\n missctr = 0\n arrayctr = 0\n lastsample = 0\n firstsample = -1\n\n # step through the expected offsets\n while arrayctr < bucketcnt\n if firstpass == true\n row_array[arrayctr+1].concat([Time.at(buckets[arrayctr].to_i).getlocal])\n end\n ckeys.each do |ckey|\n samples = inp_keyhash[ckey]\n val = samples[bucketoff[arrayctr].to_s]\n\n if val == nil\n case numcats\n when 1\n row_array[arrayctr+1].concat([\"\"])\n when 2\n row_array[arrayctr+1].concat([\"\", \"\"])\n when 4\n row_array[arrayctr+1].concat([\"\", \"\", \"\", \"\"])\n when 9\n row_array[arrayctr+1].concat([\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"])\n when 10\n row_array[arrayctr+1].concat([\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"])\n end\n missctr = missctr + 1\n else\n row_array[arrayctr+1].concat(val)\n if firstsample == -1\n firstsample = arrayctr\n end\n lastsample = arrayctr\n end\n end # of 'ckeys.each do'\n arrayctr = arrayctr + 1\n end # of 'while arrayctr < bucketcnt'\n end\n elsif keystr == \"p\"\n if inp_keyhash != nil\n ckeys = [ \"p\", \"u\" ]\n\n missctr = 0\n arrayctr = 0\n lastsample = 0\n firstsample = -1\n max_pprocs = 0\n num_pprocs = 0\n max_uprocs = 0\n num_uprocs = 0\n\n # first run through all time samples, and find max number of pprocs and\n # max number of uprocs\n while arrayctr < bucketcnt\n samples = inp_keyhash[bucketoff[arrayctr].to_s]\n if samples != nil\n newsamples = valid_json?(samples)\n if newsamples != nil\n samples = newsamples\n end\n\n pval = samples[\"p\"] # this is an array of arays\n num_pprocs = pval.length\n\n if num_pprocs > max_pprocs\n max_pprocs = num_pprocs\n end\n\n uval = samples[\"u\"] # this is an array of arays\n num_uprocs = uval.length\n\n if num_uprocs > max_uprocs\n max_uprocs = num_uprocs\n end\n end\n arrayctr += 1\n end\n\n arrayctr = 0\n num_pprocs = 0\n num_uprocs = 0\n\n # step through the exp ected offsets\n while arrayctr < bucketcnt\n if firstpass == true\n row_array[arrayctr+1].concat([Time.at(buckets[arrayctr].to_i).getlocal])\n end\n\n samples = inp_keyhash[bucketoff[arrayctr].to_s]\n if samples != nil\n newsamples = valid_json?(samples)\n if newsamples != nil\n samples = newsamples\n end\n\n pval = samples[\"p\"] # this is an array of arays\n uval = samples[\"u\"]\n if pval != nil\n num_pprocs = pval.length\n excess = max_pprocs - num_pprocs\n\n pctr = 0\n while pctr < num_pprocs\n if pval[pctr] == nil\n row_array[arrayctr+1].concat([\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"])\n else\n if pval[pctr].is_a?(Array)\n row_array[arrayctr+1].concat(pval[pctr])\n if firstsample == -1\n firstsample = arrayctr\n end\n lastsample = arrayctr\n else\n if $debug == true\n puts \"\\npctr is \" + pctr.to_s + \"; pval[pctr] is not an array : \\n\"\n print \"\\n\"\n end\n end\n end\n pctr += 1\n end\n\n if excess > 0\n pctr = 0\n while pctr < excess\n row_array[arrayctr+1].concat([\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"])\n pctr += 1\n end\n end\n end\n uval = samples[\"u\"] # this is an array of arays\n\n if uval != nil\n num_uprocs = uval.length\n excess = max_uprocs - num_uprocs\n\n pctr = 0\n while pctr < num_uprocs\n if uval[pctr] == nil\n row_array[arrayctr+1].concat([\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"])\n else\n row_array[arrayctr+1].concat(uval[pctr])\n end\n pctr += 1\n end\n\n if excess > 0\n pctr = 0\n while pctr < excess\n row_array[arrayctr+1].concat([\"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\"])\n pctr += 1\n end\n end\n end\n end\n arrayctr = arrayctr + 1\n end # of 'while arrayctr < bucketcnt'\n proc_ctr = 0\n while proc_ctr < max_pprocs\n hdrrow = CSVHeaders.create('simple', proc_syskeys[\"p\"] ,[],firstpass)\n firstpass = false\n row_array[0].concat(hdrrow)\n proc_ctr += 1\n end\n proc_ctr = 0\n while proc_ctr < max_uprocs\n hdrrow = CSVHeaders.create('simple', proc_syskeys[\"u\"] ,[],firstpass)\n firstpass = false\n row_array[0].concat(hdrrow)\n proc_ctr += 1\n end\n end\n else\n if $debug == true\n puts \"DEBUG: Unsupported key: \"+keystr+\"\\n\"\n end\n end # of 'complex_syskeys.has_key?(keystr)'\n firstpass = false\n end # of 'keys_array.each do'\n\n _systemname.gsub!('/','_')\n _systemname.gsub!('\\\\','_')\n\n fname = $output_path.to_s+\"/\"+ _systemname.to_s+\".csv\"\n if $verbose == true\n puts \"Writing to \"+fname.to_s+\"\\n\\n\"\n else\n print \".\"\n end\n\n CSV.open(fname.to_s, \"wb\", {:force_quotes => true}) do |csv|\n ctr = 0\n while ctr <= bucketcnt\n csv << row_array[ctr]\n ctr += 1\n end\n end\n end # end of 'else neither is nil'\n end\n # rescue Exception => e\n # puts \"system_samples exception \" + e.message + \"\\n\"\n # puts \"\\nSkipping \" + _systemname.to_s + \"\\n\"\n end # of begin\n return true\nend",
"title": ""
},
{
"docid": "c6a00c717acb8101a3f98d07f3791176",
"score": "0.48531812",
"text": "def cluster_and_write_clustered_dataset_to_file file_name, number_of_clusters, distance_level\n distance_level = 2 if nil.class == distance_level.class or 1 > distance_level.to_i\n distance_level = distance_level.to_i if \"string\".class == distance_level.class\n number_of_clusters = 2 if nil == number_of_clusters or 1 > number_of_clusters.to_i\n if \"string\".class == number_of_clusters.class\n number_of_clusters = 2 if 1 > number_of_clusters.to_i\n number_of_clusters = number_of_clusters.to_i\n end\n start_time = Time.new\n result = clusterize number_of_clusters, distance_level\n duration = Time.new - start_time\n File.open(file_name, 'w') {|f|\n\n attribute_types = \"\"\n attribute_names = \"\"\n @working_dataset.names_and_types_of_attributes.each {|attribute_name, attribute_type|\n attribute_names << \"#{attribute_name},\"\n attribute_types << \"#{attribute_type},\"\n }\n f.puts attribute_names.chop\n f.puts attribute_types.chop\n\n temp_string = \"\"\n ordered_result = result.sort{|a,b| a[1]<=>b[1]}\n ordered_result.each { |item|\n item[0].each { |attribute|\n temp_string << attribute << ','\n }\n f.puts \"#{temp_string}#{item[1]}\"\n temp_string = \"\"\n }\n \n result_hash = Hash.new\n ordered_result.each {|rez|\n if result_hash.has_key?(rez[1])\n result_hash[rez[1]] = result_hash[rez[1]] +1\n else\n result_hash[rez[1]] = 1\n end\n }\n\n f.puts\n result_hash.each { |key, value| f.puts \"Cluster number #{key} has #{value} elements\"}\n f.puts\n\n i = 0\n @array_of_k_means.each {|item|\n item.each { |mean|\n \n if mean.class == (1.0).class\n temp_string << \"%0.3f \" %mean\n else\n temp_string << \"#{mean} \"\n end\n \n }\n f.puts \"Mean values of cluster nr #{i} is #{temp_string}\"\n i += 1\n temp_string = \"\"\n }\n\n f.puts\n f.puts \"Duration of execution of algorithm was #{duration} seconds\"\n\n\n# result.each { |key,value|\n# key.each{ |attribute| temp_string << \"#{attribute},\" }\n# f.puts(\"#{temp_string}#{value}\")\n# temp_string = \"\"\n# }\n }\n end",
"title": ""
},
{
"docid": "62be36742185fe6eb6161bef11b792fb",
"score": "0.4831711",
"text": "def process_dataset_results( results )\n # Extract all of the needed index mapping data from \"attribute_map\"\n map_data = process_attribute_map( @current[:dataset_conf] )\n \n # Now loop through the result data...\n results[:data].each do |data_row|\n # First, create a hash out of the data_row and get the primary_attr_value\n data_row_obj = convert_array_to_hash( results[:headers], data_row )\n primary_attr_value = data_row_obj[ map_data[:primary_attribute] ]\n \n # First check we have something to map back to the index with - if not, move along...\n if primary_attr_value\n # Find us a doc object to map to...\n value_to_look_up_doc_on = extract_value_to_index( map_data[:primary_attribute], primary_attr_value, map_data[:attribute_map], data_row_obj )\n doc = find_document( map_data[:map_to_index_field], value_to_look_up_doc_on )\n \n # If we can't find one - see if we're allowed to create one\n unless doc\n if @current[:dataset_conf][\"indexing\"][\"allow_document_creation\"]\n set_document( value_to_look_up_doc_on, new_document() )\n doc = get_document( value_to_look_up_doc_on )\n end\n end\n \n # Okay, if we have a doc - process the biomart attributes\n if doc\n # Now do the processing\n data_row_obj.each do |attr_name,attr_value|\n # Extract and index our initial data return\n value_to_index = extract_value_to_index( attr_name, attr_value, map_data[:attribute_map], data_row_obj )\n \n if value_to_index and doc[ map_data[:attribute_map][attr_name][\"idx\"] ]\n if value_to_index.is_a?(Array)\n value_to_index.each do |value|\n doc[ map_data[:attribute_map][attr_name][\"idx\"] ].push( value )\n end\n else\n doc[ map_data[:attribute_map][attr_name][\"idx\"] ].push( value_to_index )\n end\n end\n \n # Any further metadata to be extracted from here?\n if value_to_index and map_data[:attribute_map][attr_name][\"extract\"]\n index_extracted_attributes( map_data[:attribute_map][attr_name][\"extract\"], doc, value_to_index )\n end\n end\n \n # Do we have any attributes that we need to group together?\n if @current[:dataset_conf][\"indexing\"][\"grouped_attributes\"]\n index_grouped_attributes( @current[:dataset_conf][\"indexing\"][\"grouped_attributes\"], doc, data_row_obj, map_data )\n end\n \n # Any ontology terms to index?\n if @current[:dataset_conf][\"indexing\"][\"ontology_terms\"]\n index_ontology_terms( @current[:dataset_conf][\"indexing\"][\"ontology_terms\"], doc, data_row_obj, map_data )\n end\n \n # Finally - save the document to the cache\n doc_primary_key = doc[@config[\"schema\"][\"unique_key\"].to_sym][0]\n set_document( doc_primary_key, doc )\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f660d1ccd45ac06546e13aa8996cc78f",
"score": "0.4830621",
"text": "def writeCSV(file_name)\n generated_array = transaction(file_name)\n array_from_csv = read_file(file_name)\n final_hash = merge_arrays(array_from_csv, generated_array)\n binding.pry\n\n CSV.open(\"results.csv\", \"w\") do |row|\n final_hash.each do |nested_hash|\n row << [nested_hash[\"SKU\"], nested_hash[\"quantity\"]]\n end #end each nested_hash loop\n end #end csv loop\nend",
"title": ""
},
{
"docid": "5b32107c7ae12749781bd02ad3328280",
"score": "0.4819521",
"text": "def assign_csv_values_to_genericfile(row, generic_file)\n field_mappings = @import.import_field_mappings.where('import_field_mappings.key != ?', 'image_filename')\n field_mappings.each do |field_mapping|\n\n key_column_number_arr = @import.import_field_mappings.where(key: field_mapping.key).first.value.reject!{|a| a.blank? } \n key_column_value_arr = []\n\n # For certain fields the values in the csv are comma delimeted and need to be parsed\n if field_mapping.key == 'subject'\n key_column_number_arr.each do |num|\n key_column_value_arr = key_column_value_arr + (row[num.to_i].try(:split, ',') || [])\n end\n elsif field_mapping.key == 'collection_identifier'\n # it's not a multivalue field so let's just get the first mapping\n key_column_number_arr.each do |num|\n generic_file.collection_identifier = row[num.to_i]\n break\n end\n\n elsif field_mapping.key == 'measurements'\n key_column_number_arr.each do |num|\n measurement_hash = measurement_format_for(row[num.to_i].try(:strip))\n unless measurement_hash.nil?\n #insert field as a measurement object\n measurement = Osul::VRA::Measurement.create(measurement: measurement_hash[:width], measurement_unit: measurement_hash[:unit], measurement_type: \"width\") \n \n generic_file.measurements << measurement\n measurement = Osul::VRA::Measurement.create(measurement: measurement_hash[:height], measurement_unit: measurement_hash[:unit], measurement_type: \"height\") \n generic_file.measurements << measurement\n end\n end\n\n elsif field_mapping.key == 'materials'\n key_column_number_arr.each do |num|\n material_hash = material_format_for(row[num.to_i].try(:strip))\n unless material_hash.nil?\n material = Osul::VRA::Material.create(material_hash)\n generic_file.materials << material\n end\n end\n\n else\n key_column_number_arr.each do |num|\n key_column_value_arr << row[num.to_i]\n end\n end\n\n # materials and measurements are associations so they are updated differently \n unless field_mapping.key == 'materials' or field_mapping.key == 'measurements' or field_mapping.key == 'collection_identifier'\n key_column_value_arr = key_column_value_arr.map.reject{|a| a.blank?}\n generic_file.send(\"#{field_mapping.key}=\".to_sym, key_column_value_arr)\n end\n end\n end",
"title": ""
},
{
"docid": "b798d2bca2ac4ddbf356b8135df5979d",
"score": "0.48090434",
"text": "def readCSVFile(csvfilename='') \r\n\r\n @title = \"Fryes Bag-o-Value\"\r\n @costTitle = \"volume\"\r\n @beneTitle = \"value\"\r\n\r\n\r\n @cutname = \"total volume\"\r\n @cutop = \"<\"\r\n\r\n #@cutval = 500\r\n @cutval = 1000\r\n csvitemID=['cellphone1','cellphone2','cpu1','cpu2','ram 1', 'ram 2', 'ram 3']\r\n csvitemValue=[199.99,155.99,75.50,123.45, 32.99, 26.26, 45.94 ]\r\n csvitemWeight=[100,99,23,22, 15,15,15]\r\n csvitemQtys=[10,25,20,20,15,15,10]\r\n\r\n\r\n\r\n @totalrows = csvitemID.size # count of item rows\r\n\r\n # total number of discrete items \r\n @totalqty = csvitemQtys.inject(0){|sum,item| sum+item} \r\n @optionSize=@totalqty;\r\n\r\n @totalcost=0.0 # initialize\r\n @totalbene=0.0 # initialize\r\n\r\n @itemID=Array.new\r\n @itemValue=Array.new\r\n @itemWeight=Array.new\r\n @itemQtys=Array.new\r\n\r\n # create one array element for each option, not each item, eg item1 qty2 = 2 elements\r\n\r\n (0...@totalrows).each do |row| \r\n \r\n # calculate the total cost and value\r\n @totalbene+=csvitemQtys[row]*csvitemValue[row]\r\n @totalcost+=csvitemQtys[row]*csvitemWeight[row]\r\n\r\n # multiply the quantities by the csv data to create the array data.\r\n (0...csvitemQtys[row]).each do | unit |\r\n\r\n @itemID << csvitemID[row]\r\n @itemValue << csvitemValue[row]\r\n @itemWeight << csvitemWeight[row]\r\n @itemQtys << 1\r\n\r\n end\r\n\r\n end\r\n\r\n\r\n\r\n if @cutop == '>'\r\n #MINIMUM_COST\r\n @goal = \"minimum cost\"\r\n @min_value=@cutval\r\n @max_weight=@totalcost\r\n end\r\n\r\n if @cutop == '<'\r\n #MAXIMUM_BENEFIT\r\n @goal = \"maximum benefit\"\r\n @max_weight=@cutval\r\n @min_value=1\r\n end\r\n\r\n\r\n end",
"title": ""
},
{
"docid": "0557c693340bdaab59c7e16196938122",
"score": "0.4808895",
"text": "def update_job_status_history_csv_file(latest_jenkins_job_status_map)\n job_status_history = Array.new\n\n #check if file exists - if not, create a RAM structure\n if (File.file?(JOB_STATUS_HISTORY_FILENAME) == false)\n #build array\n $jenkins_jobs_to_be_tracked.each do |job_name|\n job_entry = Array.new\n job_entry.push job_name\n \n job_status_history.push job_entry\n end\n \n else\n job_status_history = CSV.read(JOB_STATUS_HISTORY_FILENAME)\n \n #clean out source file\n File.delete(JOB_STATUS_HISTORY_FILENAME) \n end\n \n #loop through rows of job status info and process\n job_index = 0\n\n job_status_history.each do |job_status_history_row|\n \n #extract job name\n job_name = job_status_history_row[0]\n \n #check if we need to trim the job status history\n if (job_status_history_row.size > NUMBER_SAMPLES_IN_HISTORY)\n #delete old history item\n job_status_history_row.delete_at(1)\n \n #append new status value to end of row\n job_status_history_row << latest_jenkins_job_status_map[job_name]\n else\n #less than a full set of status history - simply append the new status info\n job_status_history_row << latest_jenkins_job_status_map[job_name] \n \n job_index = job_index + 1\n end\n \n #write out data to file\n out_file = File.new(JOB_STATUS_HISTORY_FILENAME, \"a\")\n element_index = 1\n \n job_status_history_row.each do |element|\n out_file << element \n \n if (element_index == job_status_history_row.length)\n out_file << \"\\n\"\n else\n out_file << \",\"\n end\n \n element_index = element_index + 1\n end\n out_file.close\n end \nend",
"title": ""
},
{
"docid": "ee24d8595efacbd9c3977056fd244113",
"score": "0.48075196",
"text": "def run_these_cases(current_task_files)\n\n \n $RunResults = Hash.new \n $choicefiles = Array.new\n $PIDS = Array.new\n $FinishedTheseFiles = Hash.new \n $RunNumbers = Array.new\n \n $CompletedRunCount = 0 \n $FailedRunCount = 0 \n \n ## Create working directories \n \n $headerline = \"\" \n $outputHeaderPrinted = false \n \n \n current_task_files.each do |choicefile|\n $FinishedTheseFiles[choicefile] = false \n end \n \n $choicefileIndex = 0 \n numberOfFiles = $FinishedTheseFiles.count {|k| k.include?(false)}\n\n \n stream_out (\" - HTAP-prm: begin runs ----------------------------\\n\\n\")\n \n $choicefileIndex = 0 \n $RunsDone = false \n \n $csvColumns = Array.new \n \n # Loop until all files have been processed. \n $GiveUp = false \n \n while ! $RunsDone \n\n $batchCount = $batchCount + 1 \n\n \n stream_out (\" + Batch #{$batchCount} ( #{$choicefileIndex}/#{numberOfFiles} files processed so far...) \\n\" )\n if ( $batchCount == 1 && $snailStart ) then \n \n stream_out (\" |\\n\") \n stream_out (\" +-> NOTE: \\\"SnailStart\\\" is active. Waiting for #{$snailStartWait} seconds between threads (on first batch ONLY!) \\n\\n\")\n \n end \n\n # Empty arrays for current batch. \n $choicefiles.clear\n $PIDS.clear \n $SaveDirs.clear\n \n \n # Compute the number of threads we will start: lesser of a) files remaining, or b) threads allowed.\n $ThreadsNeeded = [$FinishedTheseFiles.count {|k| k.include?(false)}, $gNumberOfThreads].min \n \n #=====================================================================================\n # Multi-threaded runs - Step 1: Spawn threads. \n for thread in 0..$ThreadsNeeded-1 \n \n # For this thread: Get the next choice file in the batch. \n $choicefiles[thread] = current_task_files[$choicefileIndex] \n \n # Get the name of the .h2k file for this thread. \n $H2kFile = $gArchetypeHash[$choicefiles[thread]]\n $Ruleset = $gRulesetHash[$choicefiles[thread]]\n $Location = $gLocationHash[$choicefiles[thread]]\n \n count = thread + 1 \n #stream_out (\" - Starting thread : #{count}/#{$ThreadsNeeded} for file #{$choicefiles[thread]} \")\n stream_out (\" - Starting thread #{count}/#{$ThreadsNeeded} for sim ##{$choicefileIndex+1} \")\n \n \n # For this thread: Get the next choice file in the batch. \n #$choicefiles[thread] = $RunTheseFiles[$choicefileIndex] \n \n \n # Make sure that's a real choice file ( this just duplicates a test above )\n if ( $choicefiles[thread] =~ /.*choices$/ )\n \n # Increment run number and create name for unique simulation directory\n $RunNumber = $RunNumber + 1 \n $RunDirectory = $RunDirs[thread]\n \n \n $SaveDirectory = \"#{$SaveDirectoryRoot}-#{$RunNumber}\"\n \n # Store run number and directory for this thread \n $RunNumbers[thread] = $RunNumber\n $SaveDirs[thread] = $SaveDirectory \n\n # create empty run directory\n if ( ! Dir.exist?($RunDirectory) )\n if ( ! Dir.mkdir($RunDirectory) )\n fatalerror( \" Fatal Error! Could not create #{$RunDirectory} below #{$gMasterPath}!\\n MKDir Return code: #{$?}\\n\" )\n end \n \n else \n # Delete contents, but not H2K folder\n FileUtils.rm_r Dir.glob(\"#{$RunDirectory}/*.*\") \n end \n \n \n \n \n # Copy choice and options file into intended run directory...\n if $choicesInMemory\n choicefile = File.open(\"#{$RunDirectory}/#{$choicefiles[thread]}\", 'w')\n choicefile.write ($ChoiceFileContents[$choicefiles[thread]])\n choicefile.close\n else \n FileUtils.cp($choicefiles[thread],$RunDirectory)\n end \n \n \n FileUtils.cp($gOptionFile,$RunDirectory) \n FileUtils.cp(\"#{$gArchetypeDir}\\\\#{$H2kFile}\",$RunDirectory)\n \n if ( $gComputeCosts ) then \n # Think about error handling. \n FileUtils.cp($gCostingFile,$RunDirectory)\n end \n # ... And get base file names for insertion into the substitute-h2k.rb command.\n $LocalChoiceFile = File.basename $choicefiles[thread] \n $LocalOptionsFile = File.basename $gOptionFile\n \n\n \n # CD to run directory, spawn substitute-h2k thread and save PID \n Dir.chdir($RunDirectory)\n\n if ( $gDebug ) \n FileUtils.cp(\"#{$H2kFile}\",\"#{$H2kFile}-p0\")\n end \n \n \n\n # Possibly call another script to modify the .h2k and .choice files \n \n case $Ruleset\n when /936_2015_AW_HRV/\n subcall = \"perl C:\\\\HTAP\\\\NRC-scripts\\\\apply936-AW.pl #{$H2kFile} #{$LocalChoiceFile} #{$LocalOptionsFile} #{$Location} 1 \"\n system (subcall) \n when /936_2015_AW_noHRV/\n subcall = \"perl C:\\\\HTAP\\\\NRC-scripts\\\\apply936-AW.pl #{$H2kFile} #{$LocalChoiceFile} #{$LocalOptionsFile} #{$Location} 0 \"\n system (subcall) \n end \n\n if ( $gDebug ) \n FileUtils.cp(\"#{$H2kFile}\",\"#{$H2kFile}-p1\")\n end \n \n $SubCostFlag = \"\"\n if ($gComputeCosts ) then \n $SubCostFlag = \"--auto_cost_options\"\n end \n cmdscript = \"ruby #{$gSubstitutePath} -o #{$LocalOptionsFile} -c #{$LocalChoiceFile} -b #{$H2kFile} --report-choices --prm #{$gExtendedOutputFlag} #{$SubCostFlag}\"\n \n # Save command for invoking substitute [ useful in debugging ] \n $cmdtxt = File.open(\"cmd.txt\", 'w') \n $cmdtxt.write cmdscript\n $cmdtxt.close\n \n #debug_out(\" ( cmd: #{cmdscript} | \\n\") \n \n \n pid = Process.spawn( cmdscript, :out => File::NULL, :err => \"substitute-h2k-errors.txt\" ) \n \n\n \n\n $PIDS[thread] = pid \n \n stream_out(\"(PID #{$PIDS[thread]})...\")\n \n \n \n \n # Cd to root, move to next choice file. \n Dir.chdir($gMasterPath)\n \n end \n\n # Snail-Start: \n # This patch is a workaround for instability observed with highly-thread (20+) runs on machines with slow I/O. \n # On the first batch, the substitute script copies the contents of the h2k folder into the working directories (HTAP-work-X),\n # and these folders are subsequently re-used on the following batches. I suspect that windows struggles when 40+ threads are all \n # trying to copy 80+ MB simultaneously to a slow disk; some folders are not created correctly, some files are missing. The \n # result is a bunch of failed runs. \n #\n # Specifying command line option '--snailStart X' causes prm to pause for X seconds after spawning a thread - * on the first batch only *\n # It seems to give a magnetic disk a fighting chance of keeping up with the copy requests. It doesn't appear to slow the simulation \n # down too much, because it only affects the first batch, the H2K folder copy operation appears to be the most expensive part of that first run.\n\n # In tests with 40 threads writing to a magnetic disk, `-- snailStart 6` produces stable runs. \n # A future improvement might modify substitute-h2k.rb to take a hash of the h2k directory content, and verify its integrity before proceeding. \n \n if ( $batchCount == 1 && $snailStart ) then \n \n stream_out (\" *SS-Wait\")\n for wait in 1..5\n \n stream_out (\".\")\n \n sleep($snailStartWait/5)\n \n end \n \n stream_out( \"*\")\n \n end \n \n \n stream_out (\" done. \\n\")\n $choicefileIndex = $choicefileIndex + 1\n \n # Create hash to hold results \n $RunResults[\"run-#{thread}\"] = Hash.new \n \n end \n \n \n # Multi-threaded runs - Step 2: Monitor thread progress\n \n #=====================================================================================\n # Wait for threads to complete \n \n for thread2 in 0..$ThreadsNeeded-1 \n \n count = thread2 + 1 \n \n stream_out (\" - Waiting on PID: #{$PIDS[thread2]} (#{count}/#{$ThreadsNeeded})...\")\n \n Process.wait($PIDS[thread2], 0)\n \n status = $?.exitstatus \n \n if ( status == 0 ) \n \n stream_out (\" done.\\n\")\n \n else \n \n stream_out (\" FAILED! (Exit status: #{status})\\n\")\n \n $RunResults[\"run-#{thread2}\"][\"s.success\"] = \"false\"\n $RunResults[\"run-#{thread2}\"][\"s.errors@99\"] = \" Run failed - substitute-h2k.rb returned status #{status}\"\n \n end \n \n end \n \n #=====================================================================================\n # Multi-threaded runs - Step 3: Post-process and clean up. \n \n \n \n for thread3 in 0..$ThreadsNeeded-1 \n count = thread3 + 1 \n stream_out (\" - Reading results files from PID: #{$PIDS[thread3]} (#{count}/#{$ThreadsNeeded})...\")\n \n Dir.chdir($RunDirs[thread3])\n \n\n $RunResults[\"run-#{thread3}\"][\"c.RunNumber\"] = \"#{$RunNumbers[thread3].to_s}\"\n $RunResults[\"run-#{thread3}\"][\"c.RunDirectory\"] = \"#{$RunDirs[thread3].to_s}\"\n $RunResults[\"run-#{thread3}\"][\"c.SaveDirectory\"] = \"#{$SaveDirs[thread3].to_s}\"\n $RunResults[\"run-#{thread3}\"][\"c.ChoiceFile\"] = \"#{$choicefiles[thread3].to_s}\"\n \n $runFailed = false\n \n # Parse contents of substitute-h2k-errors.txt, which may contain ruby errors if substitute-h2k.rb did \n # not execute correctly. \n $RunResults[\"run-#{thread3}\"][\"s.substitute-h2k-err-msgs\"] = \"nil\"\n \n if ( File.exist?(\"substitute-h2k-errors.txt\") )\n $errmsgs= File.read(\"substitute-h2k-errors.txt\")\n $errmsgs_chk = $errmsgs\n if ( ! $errmsgs_chk.gsub(/\\n*/,\"\").gsub( / */, \"\").empty? ) \n $RunResults[\"run-#{thread3}\"][\"s.substitute-h2k-err-msgs\"] = $errmsgs \n end \n \n end \n \n \n if ( File.exist?($RunResultFilename) ) \n \n contents = File.open($RunResultFilename, 'r') \n \n \n ec=0\n wc=0 \n \n \n \n lineCount = 0\n contents.each do |line|\n lineCount = lineCount + 1\n line_clean = line.gsub(/ /, '')\n line_clean = line.gsub(/\\n/, '')\n if ( ! line_clean.to_s.empty? ) \n $contents = Array.new \n $contents = line_clean.split('=')\n token = $contents[0].gsub(/\\s*/,'') \n value = $contents[1].gsub(/^\\s*/,'') \n value = $contents[1].gsub(/^ /,'')\n value = $contents[1].gsub(/ +$/,'')\n \n \n # add prefix to \n case token \n when /s.error/ \n token.concat(\"@#{ec}\")\n ec = ec + 1\n when /s.warning/\n token.concat(\"@#{wc}\")\n wc=wc+1 \n end \n $RunResults[\"run-#{thread3}\"][token] = value\n end \n \n end \n contents.close\n\n if $RunResults[\"run-#{thread3}\"][\"s.success\"] =~ /false/ then \n $runFailed = true\n stream_out (\" done (with errors).\\n\")\n else\n stream_out (\" done.\\n\")\n end \n \n \n \n \n\n \n else \n \n stream_out (\" Output couldn't be found! \\n\")\n $runFailed = true \n \n #stream_out (\" RUN FAILED! (see dir: #{$SaveDirs[thread3]}) \\n\")\n $failures.write \"#{$choicefiles[thread3]} (dir: #{$SaveDirs[thread3]}) - no output from substitute-h2k.rb\\n\"\n $FailedRuns.push \"#{$choicefiles[thread3]} (dir: #{$SaveDirs[thread3]}) - no output from substitute-h2k.rb\"\n $FailedRunCount = $FailedRunCount + 1\n \n $RunResults[\"run-#{thread3}\"][\"s.success\"] = \"false\"\n $RunResults[\"run-#{thread3}\"][\"s.errors@99\"] = \" Run failed - no output generated\"\n \n $LocalChoiceFile = File.basename $gOptionFile\n if ( ! FileUtils.rm_rf(\"#{$RunDirs[thread3]}/#{$LocalChoiceFile}\") )\n warn_out(\" Warning! Could delete #{$RunDirs[thread3]} rm_fr Return code: #{$?}\\n\" )\n end \n \n \n end \n \n Dir.chdir($gMasterPath) \n \n # Save files from runs that failed, or possibly all runs. \n if ( $gSaveAllRuns || $runFailed ) \n \n if ( ! Dir.exist?($SaveDirs[thread3]) ) \n \n Dir.mkdir($SaveDirs[thread3]) \n \n else \n \n FileUtils.rm_rf Dir.glob(\"#{$SaveDirs[thread3]}/*.*\") \n \n end \n \n FileUtils.mv( Dir.glob(\"#{$RunDirs[thread3]}/*.*\") , \"#{$SaveDirs[thread3]}\" ) \n FileUtils.rm_rf (\"#{$RunDirs[thread3]}/sim-output\")\n end \n \n #Update status of this thread. \n $FinishedTheseFiles[$choicefiles[thread3]] = true \n \n \n end \n \n errs = \"\" \n stream_out (\" - Post-processing results... \") \n\n $outputlines = \"\"\n \n row = 0 \n \n \n # Alternative output in JSON format. Can be memory-intensive\n if ( $gJSONize ) \n \n \n $RunResults.each do |run,data|\n \n $gJSONAllData[$gHashLoc] = Hash.new\n $gJSONAllData[$gHashLoc] = { \"result-number\" => $gHashLoc+1, \n \"status\" => Hash.new,\n \"archetype\" => Hash.new, \n \"input\" => Hash.new, \n \"output\" => Hash.new, \n \"configuration\" => Hash.new,\n \"miscellaneous_info\" => Hash.new } \n \n # Storage for arrays. \n $gJSONAllData[$gHashLoc][\"status\"] = { \"warnings\" => Array.new, \"errors\" => Array.new } \n \n # Storage for binned data\n if ( $gExtendedOutputFlag =~ /-e/ ) \n $gJSONAllData[$gHashLoc][\"output\"] = { \"BinnedData\" => Hash.new } \n $gJSONAllData[$gHashLoc][\"output\"][\"BinnedData\"] = Array.new \n for counter in 0..31\n $gJSONAllData[$gHashLoc][\"output\"][\"BinnedData\"][counter] = Hash.new \n $gJSONAllData[$gHashLoc][\"output\"][\"BinnedData\"][counter][\"bin\"] = counter+1\n end\n else \n $gJSONAllData[$gHashLoc][\"output\"] = { \"BinnedData\" => \"No binned data to report for run ##{$gHashLoc}. Run htap-prm with '-e' to enable\" } \n end \n\n data.each do |token,value|\n \n \n #Detect the type of this token from prefix\n $col_tmp = token.to_s.gsub(/\\s*/, '') \n \n case $col_tmp\n when /^input\\./ , /^i\\./ \n $col_type = \"input\"\n when /^output\\./ , /^o\\./ \n $col_type = \"output\"\n when /^arch\\./ , /^a\\./ \n $col_type = \"archetype\" \n when /^config\\./ , /^c\\./ \n $col_type = \"configuration\" \n when /^status\\./ , /^s\\./ \n $col_type = \"status\" \n else \n $col_type = \"miscellaneous_info\"\n end \n \n # And get remaining text after the '.'\n $col_txt = $col_tmp.to_s.gsub(/^[^\\.]+\\./,'')\n \n # Then store data in the appropriate location \n case $col_txt \n when /error/ \n \n $gJSONAllData[$gHashLoc][\"status\"][\"errors\"].push( value.to_s.gsub(/\"/,'') )\n \n when /warning/ \n \n $gJSONAllData[$gHashLoc][\"status\"][\"warnings\"].push( value.to_s.gsub(/\"/,'') ) \n \n when /BIN-data/\n # format is 'BIN-data-TYPE-##'; Split out TYPE and ##\n $bin_type = Array.new\n $bin_type = $col_txt.gsub(/BIN-data-/, '').split(\"-\") \n $bin_row = $bin_type[1].to_i - 1 \n # Store data in array, based on type.\n \n case $bin_type[0].to_s\n when /HRS/ \n $gJSONAllData[$gHashLoc][\"output\"][\"BinnedData\"][$bin_row][\"CumulativeHrs\"] = value.to_f\n \n when /TMP/ \n $gJSONAllData[$gHashLoc][\"output\"][\"BinnedData\"][$bin_row][\"Temperature_oC\"] = value.to_f\n \n when /HLR/ \n $gJSONAllData[$gHashLoc][\"output\"][\"BinnedData\"][$bin_row][\"HeatLossRateW\"] = value.to_f\n \n when /T2cap/ \n $gJSONAllData[$gHashLoc][\"output\"][\"BinnedData\"][$bin_row][\"Type2Capacity\"] = value.to_f\n \n when /T2PLR/ \n $gJSONAllData[$gHashLoc][\"output\"][\"BinnedData\"][$bin_row][\"Type2PartLoadRatio\"] = value.to_f \n \n when /T1PLR/ \n $gJSONAllData[$gHashLoc][\"output\"][\"BinnedData\"][$bin_row][\"Type1PartLoadRatio\"] = value.to_f \n end \n \n else \n \n \n # format according to data type \n case value.to_s.gsub(/\\s*/, '') \n when /^[0-9\\-]+$/ \n $gJSONAllData[$gHashLoc][\"#{$col_type}\"][\"#{$col_txt}\"] = value.to_i\n \n when /^[0-9\\.\\-E]+$/ \n $gJSONAllData[$gHashLoc][\"#{$col_type}\"][\"#{$col_txt}\"] = value.to_f\n \n else \n $gJSONAllData[$gHashLoc][\"#{$col_type}\"][\"#{$col_txt}\"] = value.to_s.gsub(/^\\s*/, '').gsub( /\\s*$/,'')\n\n end\n \n \n \n end \n \n \n end # ends data.each do \n \n # Arr err/warn empty? if so, put 'nil'\n if ( $gJSONAllData[$gHashLoc][\"status\"][\"errors\"].empty? ) \n \n $gJSONAllData[$gHashLoc][\"status\"][\"errors\"].push \"nil\"\n \n end \n \n if ( $gJSONAllData[$gHashLoc][\"status\"][\"warnings\"].empty? ) \n \n $gJSONAllData[$gHashLoc][\"status\"][\"warnings\"].push \"nil\"\n \n end \n \n \n \n # Test to see if the run was successful. Flag if not, otherwise increment completed counter. \n \n if ( $gJSONAllData[$gHashLoc][\"status\"][\"success\"] == \"false\" ) then \n \n $runFailed = true \n errs=\" *** simulation errors found ***\"\n $msg = \"#{$gJSONAllData[$gHashLoc][\"configuration\"][\"ChoiceFile\"]} (dir: #{$gJSONAllData[$gHashLoc][\"configuration\"][\"SaveDirectory\"]}) - substitute-h2k.rb reports errors\"\n $failures.write \"$msg\\n\"\n $FailedRuns.push $msg \n $FailedRunCount = $FailedRunCount + 1\n\n else \n \n $CompletedRunCount = $CompletedRunCount + 1 \n \n end \n\n \n # Increment hash increment too. \n $gHashLoc = $gHashLoc + 1 \n\n if ( $runFailed && $StopOnError ) then \n $RunsDone = true \n $GiveUp = true \n end \n\n\n \n \n end # ends $RunResults.each do\n \n \n end # Ends if JSON.\n \n \n $RunResults.each do |run,data|\n \n # Only write out data from successful runs - this helps prevent corrupted databae \n \n \n if ( data['s.success'] =~ /true/ ) then\n \n if ( ! $outputHeaderPrinted ) then \n # Deal with header first \n data.sort.to_h \n data.each do |column,value|\n \n case column \n when /s\\.error/, /s\\.warning/, /BIN-data/\n # Do nothing \n else \n \n $csvColumns.push column\n $headerline.concat(\"#{column.to_s},\")\n end \n end \n $outputHeaderPrinted = true \n $headerline.concat(\"\\n\")\n $outputCSV.write($headerline) \n end \n \n $csvColumns.each do |key|\n \n $outputlines.concat(\"#{data[key]},\")\n \n end\n \n $outputlines.concat(\"\\n\")\n \n end \n \n end \n \n $outputCSV.write($outputlines) \n $outputCSV.flush\n $failures.flush \n \n $RunResults.clear\n \n stream_out (\"done.#{errs}\\n\\n\")\n\n if ( ! $FinishedTheseFiles.has_value?(false) ) \n \n $RunsDone = true \n \n end \n \n\n end \n \n \n if ( $GiveUp ) then \n stream_out(\" - HTAP-prm: runs terminated due to error ----------\\n\\n\")\n else \n stream_out(\" - HTAP-prm: runs finished -------------------------\\n\\n\")\n end \n \n if ($gJSONize )\n stream_out(\" - Writing JSON output to HTAP-prm-output.json... \")\n $JSONoutput = File.open($gOutputJSON, 'w') \n $JSONoutput.write(JSON.pretty_generate($gJSONAllData))\n $JSONoutput.close \n stream_out(\"done.\\n\\n\")\n end \n \n \n if ( ! $gDebug ) then \n stream_out (\" - Deleting working directories... \") \n FileUtils.rm_rf Dir.glob(\"HTAP-work-*\") \n stream_out(\"done.\\n\\n\")\n end\n \nend",
"title": ""
},
{
"docid": "8cbdbabfdd92d440ead03946a9886bd7",
"score": "0.47926068",
"text": "def run_aggregation\n GRADES.each_with_index do |grade, idx|\n classifier[grade].each_pair do |metric, values|\n all_values = values\n all_values += classifier[GRADES[idx + 1]][metric] if (idx + 1) < GRADES.count\n\n classifier[grade][metric] =\n if all_values.count <= 2\n values.max || 0\n else\n (all_values.sum / all_values.count).round(2)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "11e3cb2ae3d12f2203ad1549d0127739",
"score": "0.47765264",
"text": "def process\n # Load each row element\n 2.upto(@rows).each do |row_index|\n ActiveRecord::Base.transaction do\n begin\n load_data row: @spreadsheet.row(row_index)\n\n rescue => e\n add_error message: e.message, backtrace: e.backtrace, row_index: row_index, data: @spreadsheet.row(row_index)\n\n raise ActiveRecord::Rollback\n end\n end\n end\n end",
"title": ""
},
{
"docid": "d5e139efde66aa2d3fea11d21cd0b807",
"score": "0.4773889",
"text": "def process\n validate_file_type(@file_name, 'csv')\n convert_csv_file_to_object\n end",
"title": ""
},
{
"docid": "c5a2e95f2c03d1e98156fbae95ec449a",
"score": "0.47710645",
"text": "def transform_results(options={})\n\n season = options[:season] ? options[:season] : '1314'\n league_id_str = league_id = options[:league]\n\n puts \"Fetching 'Results by League' info for league #{league_id_str} from production data store ...\"\n match_xml = Nokogiri::XML(aws_data_fetch({\n name: \"HistoricMatches-league-#{league_id_str}-#{season}.xml\",\n path: 'soccer/raw-data',\n }))\n\n data_file_recs = Array.new\n \n # live_score_xml = Nokogiri::XML(File.open(\"XML/LiveScore-league3-latest.xml\"))\n # live_score_match_ids = live_score_xml.xpath(\"//Match/Id\").map{ |node| node.text }\n # # puts \"live_score_match_ids #{live_score_match_ids}\"\n live_score_match_ids = Array.new\n\n match_xml.xpath(\"//Match\").each do |node|\n\n next if node.xpath(\"Id\").text == \"62364\"\n\n\n # puts \"========= MATCH ID : '#{node.xpath(\"FixtureMatch_Id\").text}' : LEAGUE : #{league} =========\"\n fixture_match_id = node.xpath(\"FixtureMatch_Id\").text\n fixture_id_str = standardize_id_str(fixture_match_id, :fixture)\n\n # Get substitution info from LiveScore data\n if live_score_match_ids.include? fixture_match_id\n live_score_node = live_score_xml.at(\"Id:contains(#{fixture_match_id})\").parent\n [\"Home\",\"Away\"].each do |team|\n sub_details = Array.new\n sub_details_node = node.add_child(\"<#{team}SubDetails></#{team}SubDetails>\")\n live_score_node.xpath(\"#{team}SubDetails\").text.split(';').reverse_each do |sub|\n sub_details << get_sub_details(sub)\n sub_details_node.first.add_child(\"<SubDetail />\")\n end\n\n i = 0\n node.xpath(\"#{team}SubDetails/SubDetail\").each do |detail|\n sub_detail_string = \"<Time>#{sub_details[i][:time]}</Time>\" +\n \"<Name>#{sub_details[i][:name]}</Name>\" +\n \"<Direction>#{sub_details[i][:dir]}</Direction>\"\n detail.add_child(sub_detail_string)\n i += 1\n end\n end\n end\n\n # Goal scorers\n [\"Home\",\"Away\"].each do |team|\n # JMC - skip Brasiliero 'GoalDetails' for now\n unless league_id == \"37\" or node.xpath(\"#{team}GoalDetails\").first.nil?\n goal_details = get_details(node.xpath(\"#{team}GoalDetails\").text)\n node.xpath(\"#{team}GoalDetails\").first.content = ''\n goal_details.each do |goal|\n tmp_str = \"<GoalDetail>\" +\n \"<Name>#{goal[:name]}</Name>\" +\n \"<Time>#{goal[:time]}</Time>\" +\n \"</GoalDetail>\"\n node.xpath(\"#{team}GoalDetails\").first.add_child(tmp_str)\n end\n end\n end\n\n # # Lineups\n # [\"Home\",\"Away\"].each do |team|\n # node.xpath(\"#{team}LineupDefense\").text.split(';').each do |player|\n # node << (\"<#{team}LineupDefender>#{player.strip}</#{team}LineupDefender>\")\n # end\n # node.xpath(\"#{team}LineupMidfield\").text.split(';').each do |player|\n # node << (\"<#{team}LineupMidfielder>#{player.strip}</#{team}LineupMidfielder>\")\n # end\n # node.xpath(\"#{team}LineupForward\").text.split(';').each do |player|\n # node << (\"<#{team}LineupForwardist>#{player.strip}</#{team}LineupForwardist>\")\n # end\n # end\n\n # Lineups\n [\"Home\",\"Away\"].each do |team|\n node.add_child(\"<#{team}Lineup />\")\n tmp_str = \"<Player>\" +\n \"<Name>#{node.xpath(\"#{team}LineupGoalkeeper\").text.strip}</Name>\" + \n \"<Position>G</Position>\" +\n \"</Player>\"\n node.xpath(\"#{team}Lineup\").first.add_child(tmp_str)\n node.xpath(\"#{team}LineupGoalkeeper\").remove\n \n [\"Defense\",\"Midfield\",\"Forward\"].each do |position|\n position_str = node.xpath(\"#{team}Lineup#{position}\").text\n node.xpath(\"#{team}Lineup#{position}\").remove\n position_str.split(';').each do |player|\n tmp_str = \"<Player>\" +\n \"<Name>#{player.strip}</Name>\" +\n \"<Position>#{position[0]}</Position>\" +\n \"</Player>\"\n node.xpath(\"#{team}Lineup\").first.add_child(tmp_str)\n end\n end\n end\n\n # Bookings: Yellow and Red Cards\n [\"Home\",\"Away\"].each do |team|\n [\"Yellow\",\"Red\"].each do |card|\n # Skip when missing 'TeamCardDetails' element (identified in Serie B data)\n unless node.xpath(\"#{team}Team#{card}CardDetails\").first.nil?\n tmp_card_details = get_details(node.xpath(\"#{team}Team#{card}CardDetails\").text)\n node.xpath(\"#{team}Team#{card}CardDetails\").first.content = ''\n tmp_card_details.each do |tcd|\n tmp_str = \"<CardDetail>\" +\n \"<Name>#{tcd[:name]}</Name>\" +\n \"<Time>#{tcd[:time]}</Time>\" +\n \"</CardDetail>\"\n node.xpath(\"#{team}Team#{card}CardDetails\").first.add_child(tmp_str)\n end\n end\n end\n end\n\n # Add the league_id\n league_name = node.xpath(\"League\").text\n league_id = @xmlsoccer_league_map[league_name]\n node.add_child(\"<League_Id>#{league_id}</League_Id>\")\n\n # Handle the shittle situation\n if league_id == \"20\"\n if node.xpath(\"HomeTeam_Id\").text == \"579\"\n node.xpath(\"HomeTeam\").first.content = 'Shittle Flounders FC'\n elsif node.xpath(\"AwayTeam_Id\").text == \"579\"\n node.xpath(\"AwayTeam\").first.content = 'Shittle Flounders FC'\n end\n end \n\n # Save the XML file for this match\n filename = write_xml_file({\n group: 'match',\n group_info: fixture_id_str,\n node: node,\n })\n\n # Save record for generating json and rake files\n data_file_recs << { name: filename, \n path: 'soccer/matches',\n # has_corrections: false,\n # format: 'xml',\n # data_store: 'aws',\n # data_store_id: 1,\n timestamp: `date`.strip } \n\n end # end match_reports\n\n # Save as json file for uploading xml files to data store\n write_upload_list_json_file({\n rec_type: 'result',\n rec_info: league_id_str,\n rec_data: 'xml',\n recs: data_file_recs,\n })\n\n # JMC-CREATE: Initialize the DataFile records\n write_create_records_rake_file({\n rec_class: 'DataFile',\n rec_type: 'file',\n desc: 'Fill database with file data',\n recs: data_file_recs,\n jmc: 'r1',\n ext: league_id_str,\n })\n\n # Create rake file to update Fixture.report_id with the match report id.\n # Yep, same as Fixture.match_id - essentially used as a 'has match report'\n # boolean for now, but keeping since the report id is likely to change\n # fixture_match_ids = match_xml.xpath(\"//Match/FixtureMatch_Id\").map{ |node| node.text }\n update_recs = Array.new\n missing_recs = Array.new\n fixture_ids = get_league_fixture_ids(league_id_str)\n $stdout.flush\n match_xml.xpath(\"//Match/FixtureMatch_Id\").map{ |node| node.text }.each do |match_id|\n next if match_id == \"0\"\n if fixture_ids.include? match_id\n update_recs << { match_id: match_id, report_id: match_id }\n else\n missing_recs << { match_id: match_id }\n end\n end\n puts missing_recs\n\n # JMC-UPDATE: Fixture-update rec for NoDB\n update_recs.each do |update_rec|\n write_nodb_record_json_file({\n rec_type: 'fixtures',\n rec_info: \"#{update_rec[:match_id]}-update-r1\",\n rec: update_rec,\n })\n end\n\n # JMC-UPDATE: Fixture-missing rec for NoDB\n missing_recs.each do |missing_rec|\n write_nodb_record_json_file({\n rec_type: 'fixtures',\n rec_info: \"#{missing_rec[:match_id]}-missing-r1\",\n rec: missing_rec,\n })\n end\n\n # JMC-UPDATE: Fixture-update record (with 'has-match-report' info)\n write_update_records_rake_file({\n rec_class: 'Fixture',\n rec_type: 'fixture',\n rec_key: 'match_id',\n desc: 'Update database with match report data',\n recs: update_recs,\n jmc: 'r1',\n ext: league_id_str,\n })\n\n # JMC-UPDATE-TBD: Fixture-update record\n filename = write_record_array_json_file({\n rec_type: 'fixtures',\n rec_info: \"#{league_id_str}-update-r1\",\n recs: update_recs,\n })\n @nodb_file_recs << { name: filename, path: 'soccer/nodb', timestamp: `date`.strip, }\n\nend",
"title": ""
},
{
"docid": "adc5cec7e2a061ef925c217a5a50ef29",
"score": "0.47702584",
"text": "def write_output\n rows = data_to_rows\n CSV.open(@filename, 'wb') do |csv|\n rows.each {|row| csv << row}\n end\n end",
"title": ""
},
{
"docid": "c5c2f45a42077464b17f4151fc40e355",
"score": "0.47671244",
"text": "def process\n market_data.each do |data|\n slug = data['slug']\n coin = Coin.find_by_slug(slug)\n\n if coin.nil?\n add_error(slug, \"Unknown coin: #{data['name']}\")\n next\n end\n\n quote_time = DateTime.parse(data['quote']['USD']['last_updated'])\n\n next if coin.worths.where(quote: 'USD', quote_time: quote_time).any?\n\n worth = coin.worths.build(\n quote_time: quote_time,\n quote: 'USD',\n market_capitalization: data['quote']['USD']['market_cap'],\n quoted_value: data['quote']['USD']['price']\n )\n\n worth.save!\n end\n\n errors.any?\n end",
"title": ""
},
{
"docid": "2f95774bb1664f700758199c59e4aa30",
"score": "0.4764076",
"text": "def process_updated_users\n CSV.foreach(get_canvas_user_report_file, :headers => :first_row) do |canvas_user|\n uid = canvas_user['login_id']\n\n # process only if found in campus data\n if @active_sis_users[uid]\n active_campus_user = canvas_user_from_campus_row(@active_sis_users[uid])\n\n # if SIS User ID has changed\n if canvas_user['user_id'] != active_campus_user['user_id']\n @sis_user_id_updates[\"sis_login_id:#{canvas_user['login_id']}\"] = active_campus_user['user_id']\n end\n\n unless Canvas::MaintainUsers.provisioned_account_eq_sis_account?(canvas_user, active_campus_user)\n logger.debug(\"Updating user #{canvas_user} with #{active_campus_user}\")\n add_user_to_import(active_campus_user)\n end\n @active_sis_users.delete(uid)\n end\n end\n end",
"title": ""
},
{
"docid": "b566c5d7114df28c67312a140179cadd",
"score": "0.47548836",
"text": "def performMeasurements()\n\n # Define the grid offsets\n grid = [];\n delta = (3.5/$freq.to_f * 1000.0)/2.0;\n max_deviation = delta * 4.0;\n\n pos = [];\n pos << 0.0;\n pos << max_deviation;\n grid << pos;\n\n pos = [];\n pos << 0.0;\n pos << delta;\n grid << pos;\n\n pos = [];\n pos << 0.0;\n pos << 0.0;\n grid << pos;\n\n pos = [];\n pos << 0.0;\n pos << -delta;\n grid << pos;\n\n pos = [];\n pos << 0.0;\n pos << -max_deviation;\n grid << pos;\n\n pos = [];\n pos << -max_deviation;\n pos << 0.0;\n grid << pos;\n\n pos = [];\n pos << -delta;\n pos << 0.0;\n grid << pos;\n\n pos = [];\n pos << 0.0;\n pos << 0.0;\n grid << pos;\n\n pos = [];\n pos << delta;\n pos << 0.0;\n grid << pos;\n\n pos = [];\n pos << max_deviation;\n pos << 0.0;\n grid << pos;\n\n puts \"[start]\";\n puts \"Performing measurements for antennas #{getAntList(',')}\";\n\n # Initialize the hashmap of all the measurements.\n @ants.each do |a|\n @measurements[a.name] = [];\n end\n\n # First, perform the measurement for the detault offsets\n # Should already be tracking\n t = Time.new.localtime\n timeString = \"Current Time : \" + t.to_s\n `sleep 10`;\n\n puts \"Getting default center measurements\";\n @ants.each do |a|\n meas = Measurement.new(a.pmDefault);\n `sleep 12`;\n meas.setPwr(\"x\", a.getPwrAvg(\"x\").split(/\\s+/)[2]);\n meas.setPwr(\"y\", a.getPwrAvg(\"y\").split(/\\s+/)[2]);\n @measurements[a.name] << meas;\n\n begin\n file = File.open($defaultPMValuesFilename, \"a+\");\n if(timeString != nil)\n file.write(timeString + \"\\n\");\n timeString = nil;\n end\n file.write(a.name + \",\" + meas.to_s + \"\\n\") ;\n rescue IOError => e\n $stderr.puts \"Trouble saving default PM values: \" + e.to_s;\n exit(1);\n ensure\n file.close unless file.nil?\n end\n end\n\n # For testing, stop here and make sure the default PM values\n # were written to the file.\n #exit(0);\n\n # Offset the PM for each grid position, then get the power for that\n # position.\n grid.each_with_index do |g, i|\n x = g[0];\n y = g[1];\n puts \"\\nGrid position #{(i+1).to_s}, Offsetting PM #{g[0]},#{g[1]}\\n\";\n @ants.each do |a|\n a.offsetPm(x, y);\n end\n puts \"Tracking #{@targetName}\";\n track(@targetName);\n `sleep 5`;\n @ants.each do |a|\n #Commented out for testin\n meas = Measurement.new(a.offsetPM);\n `sleep 12`;\n meas.setPwr(\"x\", a.getPwrAvg(\"x\").split(/\\s+/)[2]);\n meas.setPwr(\"y\", a.getPwrAvg(\"y\").split(/\\s+/)[2]);\n @measurements[a.name] << meas;\n end\n end\n\n # Set PM back to default\n @ants.each do |a|\n a.offsetPm(0.0, 0.0);\n end\n\n\n puts \"Finished measurements for antennas #{getAntList(',')}\";\n puts \"[end]\";\n\n\n @ants.each do |a|\n # Get the Az/El of the antenna for reporting purposes\n azel = getAzEl(a.name);\n\n offsets_xy = Measurement.calcOffset(a.name, \"xy\", @measurements[a.name]);\n offsets_x = Measurement.calcOffset(a.name, \"x\", @measurements[a.name]);\n offsets_y = Measurement.calcOffset(a.name, \"y\", @measurements[a.name]);\n time1 = Time.new.localtime.to_s\n #1a,\n #Tue Jul 19 10:47:38 -0700 2016,\n #GPS-BIIR-11--PRN-19-,\n #205.643,59.481,\n #290.7950,77.7110,290.773043159548,77.3966612701321,0.0219568404518782,0.314338729867927\n #offset.az, offset.el, o2, o1, (o2.to_f - offset.az.to_f).abs(), (o1.to_f - offset.el.to_f).abs() \n str = a.name + \",\" + time1 + \",\" + $satName + \",\" + azel[0] + \",\" + azel[1] + \",\" + \n offsets_xy[0].to_s + \",\" + \n offsets_xy[1].to_s + \",\" + \n offsets_xy[2].to_s + \",\" + \n offsets_xy[3].to_s + \",\" + \n offsets_xy[4].to_s + \",\" + \n offsets_xy[5].to_s;\n fname = a.name + \".pnt\";\n File.open(fname, 'a+') {|f| f.write(str + \"\\n\") }\n\n str2 = a.name + \"\\n\";\n @measurements[a.name].each do |m|\n str2 = str2 + m.to_s + \"\\n\";\n end\n str2 = str2 + str + \"\\n\";\n File.open(\"allants.pnt\", 'a+') {|f| f.write(str2 + \"\\n\") }\n\n time1 = Time.new.localtime\n\n # Output the results to \"corr.pnt\"\n\n str3 = \"\\nant: \" + a.name; \n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" Date: \" + time1.to_s;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" Sat: \" + $satName; \n\n puts \" Elev X: \" + Measurement.getMeasString(\"el\", \"x\", @measurements[a.name]);\n puts \" Elev Y: \" + Measurement.getMeasString(\"el\", \"y\", @measurements[a.name]);\n puts \" Az X: \" + Measurement.getMeasString(\"az\", \"x\", @measurements[a.name]);\n puts \" Az Y: \" + Measurement.getMeasString(\"az\", \"y\", @measurements[a.name]);\n File.open(\"corr.pnt\", 'a+') {|f| f.write(\" Elev X: \" + \n Measurement.getMeasString(\"el\", \"x\", @measurements[a.name]) + \"\\n\") }\n File.open(\"corr.pnt\", 'a+') {|f| f.write(\" Elev Y: \" + \n Measurement.getMeasString(\"el\", \"y\", @measurements[a.name]) + \"\\n\") }\n File.open(\"corr.pnt\", 'a+') {|f| f.write(\" Az X: \" + \n Measurement.getMeasString(\"az\", \"x\", @measurements[a.name]) + \"\\n\") }\n File.open(\"corr.pnt\", 'a+') {|f| f.write(\" Az Y: \" + \n Measurement.getMeasString(\"az\", \"y\", @measurements[a.name]) + \"\\n\") }\n\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" Az/El: \" + azel[0].to_s + \" \" + azel[1].to_s; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" Orig: \" + offsets_xy[0].to_s + \" \" + offsets_xy[1].to_s; \n puts str3;\n str3 = \" atasetpmoffsets --absolute #{a.name} #{offsets_xy[0].to_s} #{offsets_xy[1].to_s}\"; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\\n\") }\n str3 = \" XY New: \" + offsets_xy[2].to_s + \" \" + offsets_xy[3].to_s; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" XY Diff: \" + offsets_xy[4].to_s + \" \" + offsets_xy[5].to_s; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" Cmd: atasetpmoffsets --absolute #{a.name} #{offsets_xy[2].to_s} #{offsets_xy[3].to_s}\"; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n\n str3 = \" X New: \" + offsets_x[2].to_s + \" \" + offsets_x[3].to_s; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" X Diff: \" + offsets_x[4].to_s + \" \" + offsets_x[5].to_s; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" Cmd: atasetpmoffsets --absolute #{a.name} #{offsets_x[2].to_s} #{offsets_x[3].to_s}\"; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n\n str3 = \" Y New: \" + offsets_y[2].to_s + \" \" + offsets_y[3].to_s; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" Y Diff: \" + offsets_y[4].to_s + \" \" + offsets_y[5].to_s; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n str3 = \" Cmd: atasetpmoffsets --absolute #{a.name} #{offsets_y[2].to_s} #{offsets_y[3].to_s}\"; \n puts str3;\n File.open(\"corr.pnt\", 'a+') {|f| f.write(str3 + \"\\n\") }\n\n end\n end",
"title": ""
},
{
"docid": "adb07652e7dafc7ab951a80f498dea79",
"score": "0.4747778",
"text": "def update\n @experiment = Experiment.find(params[:id])\n authorize! :manage, @experiments \n #\n # if genes are associated with experiment but not expgenes,then copy over and write to directoy\n #\n # Need to update Summary file\n # \n @iofq_data =[]\n @kratky_data =[] \n @pofr_data =[]\n @fit_data =[]\n @guinier_data =[]\n\n iofq_file = \"#{Rails.root}/public/SAX_DATA/#{@experiment.data_directory}/iofq_data_file.dat\"\n pofr_file = \"#{Rails.root}/public/SAX_DATA/#{@experiment.data_directory}/pofr_data_file.dat\"\n fit_file = \"#{Rails.root}/public/SAX_DATA/#{@experiment.data_directory}/fitted_SAXS_with_model.dat\"\n \n if File.exists? iofq_file\n #\n # Private method at bottom loadFileIntoJSON()\n @iofq_data, @qmax = loadFileIntoJSON(iofq_file, true)\n #create Kratky data\n @kratky_data = createKratky(iofq_file, @qmax)\n #create Guinier region q*Rg < 1.3\n @guinier_data, @low, @upper = createGuinier(iofq_file, @experiment.rg, @experiment.io) \n end\n\n @pofr_data, @rmax = loadFileIntoJSON(pofr_file, false) if File.exists? pofr_file\n @fit_data, @fqmax = loadFileIntoJSON(fit_file, true) if File.exists? fit_file\n \n @originals = Dir.glob(\"#{Rails.root}/public/SAX_DATA/#{@experiment.data_directory}/originals/*.int\") \n if !@experiment.structural_model.nil?\n @experiment.structural_model.force_create = true \n end\n if !@experiment.ensemble.nil?\n @experiment.ensemble.force_create = true \n end \n if !@experiment.no_model.nil?\n @experiment.no_model.force_create = true\n if !@experiment.no_model.figure_content_type.nil? \n @extension = @experiment.no_model_content_type.split(/\\//)[1]\n end \n end \n \n respond_to do |format|\n if @experiment.update_attributes(params[:experiment])\n write_experiment(@experiment, @experiment.data_directory) \n format.html { redirect_to(edit_experiment_path(@experiment.id), :notice => 'Experiment was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @experiment.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e4fc4d37b1d3a1945dfa35a63d767a8",
"score": "0.47442356",
"text": "def process()\n\t\t\titem_gross=0\n\t\t\torderhdr = OrderHeader.where(member_id: member_id).first\n\t\t\torder_item_list= OrderDetail.select(\"sum(facility_item_mapping.published_rate*order_detail.quantity) as price,\n\t\t\t\t\t\tsum(quantity) as quantity,sales_item_detail.short_name as item, sales_item_detail.item_code as code, \n\t\t\t\t\t\tsales_item_detail.tax_category_code as item_category, facility_item_mapping.published_rate as published_rate\")\n\t\t\t\t.joins(\"INNER JOIN order_header ON order_detail.order_number=order_header.order_number\")\n\t\t\t\t.joins(\"INNER JOIN facility_item_mapping ON facility_item_mapping.item_code = order_detail.item_code\")\n\t\t\t\t.joins(\"INNER JOIN sales_item_detail ON facility_item_mapping.item_code = sales_item_detail.item_code\")\n\t\t\t\t.where(\"order_header.facility_code = facility_item_mapping.facility_code AND order_header.facility_code = ? AND order_header.member_id=? AND order_detail.corporate_id=? AND order_detail.establishment_id=?\", facility_code, member_id,@context.corporate_id, @context.establishment_id)\n\t\t\t\t.group(\"sales_item_detail.item_code\")\n\t\t\t\t.group(\"sales_item_detail.short_name\")\n\t\t\t\t.group(\"sales_item_detail.tax_category_code\")\n\t\t\t\t.group(\"facility_item_mapping.published_rate\")\n\n\t\t\tresult_list = []\n\t\t\torder_item_list.each do |one_rec|\n\t\t\t\t#TODO - To arrive at Unit Price; currently sending as Zero.\n\t\t\t\tobj = OrderItemVO.new(code:one_rec.code, title: one_rec.item, quantity: one_rec.quantity, \n\t\t\t\t\t\tprice: one_rec.price, category: one_rec.item_category, published_rate: one_rec.published_rate)\n\t\t\t\tresult_list << obj\n\n\t\t\t\titem_gross+=one_rec.price\n\t\t\tend\n\t\t\tpp \"Order Items -----------------\"\n\t\t\tpp result_list\n\t\t\tpp item_gross\n\t\t\tpp orderhdr\n\t\t\treturn result_list,item_gross,orderhdr\n\t\tend",
"title": ""
},
{
"docid": "dfd6628314d1098d37ee608b9788a7a8",
"score": "0.47406143",
"text": "def write_data\n \n puts \"Writing out new HR data\"\n processed_record =\".\"\n output_file = File.open(OUTPUT_FILE, 'w')\n \n @completed_users.each do |user| \n output_file.puts user.to_s \n STDERR.print processed_record\n end #basic puts but driven to open file\n \n output_file.close #closes\n puts \"\\nCompleted writing out new HR data \\n#{@completed_users.length} records processed\"\n\nend",
"title": ""
},
{
"docid": "9b50b862149fb90ed85b64a750f1fb12",
"score": "0.47386244",
"text": "def post_process_results(original_results_directory = nil)\n puts ' ========================= Starting Results Post Process ================================'\n puts \"Current directory: #{@base_dir}\"\n puts \"Test results will be stored in: #{test_results_dir}\"\n\n results = OpenStudioMeasureTester::OpenStudioTestingResult.new(@base_dir, test_results_dir, original_results_directory)\n results.save_results # one single file for dashboard\n\n # call the create dashboard command now that we have results\n dashboard\n\n # return the results exit code\n return results.exit_code\n end",
"title": ""
},
{
"docid": "f0909d759547afe2f73d03d06954a141",
"score": "0.47366714",
"text": "def normalize_output(data)\n output = {}\n\n until data.empty?\n row = data.shift\n normalized_row = row.size == 1 ? row + data.shift : row\n device, size, used, available, used_percent, mount = normalized_row\n output[mount] = DiskUsageItem.new(mount, device: device, size: to_filesize(size), used: to_filesize(used), available: to_filesize(available), used_percent: used_percent.to_i, mount: mount)\n end\n\n output\n end",
"title": ""
},
{
"docid": "c465b617bf241ba93fec5fa7f6e5effe",
"score": "0.47363174",
"text": "def summary\r\n \r\n @ph_product = PhProduct.find(params[:ph_result_id])\r\n @product = @ph_product.product\r\n @step = 1 \r\n if @ph_product.ph_intermediate_result \r\n if !@ph_product.ph_result\r\n ph_result = PhResult.new \r\n ph_result.ph_product_id = @ph_product.id\r\n ph_result.save\r\n @ph_product.ph_result = ph_result\r\n end\r\n @ph_result = @ph_product.ph_result\r\n if !@ph_product.ph_maintenance_result \r\n ph_maintenance_result = PhMaintenanceResult.new \r\n ph_maintenance_result.ph_product_id = @ph_product.id\r\n ph_maintenance_result.save\r\n @ph_product.ph_maintenance_result = ph_maintenance_result \r\n end\r\n @ph_maintenance_result = @ph_product.ph_maintenance_result \r\n if !@ph_product.ph_embedded_result \r\n ph_embedded_result = PhEmbeddedResult.new \r\n ph_embedded_result.ph_product_id = @ph_product.id\r\n ph_embedded_result.save\r\n @ph_product.ph_embedded_result = ph_embedded_result \r\n end\r\n @ph_embedded_result = @ph_product.ph_embedded_result \r\n \r\n\r\n @ph_embedded_result.temperature_induced = 0\r\n temp = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n temp = -0.13\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n temp = -0.4465\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n temp = -0.402545\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n temp = -0.25 \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n temp = -0.43666\r\n end \r\n \r\n # =(Assumptions!$I$11-25)*IF(Assumptions!G19=Menues!A2,Menues!A122,IF(Assumptions!G19=Menues!A3,Menues!B122,IF(Assumptions!G19=Menues!A4,Menues!C122,IF(Assumptions!G19=Menues!A5,Menues!D122,IF(Assumptions!G19=Menues!A6,Menues!E122,0))))) \r\n \r\n @ph_embedded_result.temperature_induced = temp * (@ph_product.ph_basic_information.temperature - 25) \r\n calcul_efficiency = @ph_product.ph_specified.efficiency * (1 + (@ph_embedded_result.temperature_induced / 100))\r\n \r\n ph_database_material_values = PhDatabaseMaterialValue.find(:all, :conditions => [\"ph_product_id = ?\", @ph_product.id])\r\n ph_database_material_values.each do |ph_database_material_value|\r\n ph_database_material_value.delete\r\n end \r\n \r\n\r\n @ph_database_materials = PhDatabaseMaterial.all \r\n @ph_database_materials.each do |ph_database_material|\r\n if ph_database_material.default_value_co2 == 0\r\n calculate_co2 ph_database_material, @ph_product\r\n end\r\n if ph_database_material.default_value_pe == 0\r\n calculate_pe ph_database_material, @ph_product\r\n end \r\n end\r\n @ph_database_material_values = PhDatabaseMaterialValue.find(:all, :conditions => [\"ph_product_id = ?\", @ph_product.id])\r\n \r\n n49 = 0\r\n if @ph_product.ph_specified.area_unit\r\n n49 = @ph_product.ph_specified.area * @ph_product.ph_specified.area_unit.conversion_factor\r\n end\r\n \r\n if @ph_product.ph_basic_information.known == 'both' || @ph_product.ph_basic_information.known == 'power_demand'\r\n #Menues!N56*Assumptions!F39\r\n @ph_result.lifetime = 0\r\n n56 = 0\r\n #=IF($Assumptions.G19=$Menues.A7;0;\r\n if @ph_product.ph_specified.ph_module_type.name != 'Not specified'\r\n if @ph_product.ph_specified.power_unit.conversion_factor == -1 \r\n # Peak Power [kWp]\r\n conversion_factor = @ph_product.ph_basic_information.radiation * @ph_product.ph_basic_information.performance_ratio\r\n n56 = @ph_product.ph_specified.power * conversion_factor\r\n else \r\n n56 = @ph_product.ph_specified.power * @ph_product.ph_specified.power_unit.conversion_factor\r\n end \r\n @ph_result.lifetime = n56 * @ph_product.ph_specified.lifetime\r\n end\r\n else \r\n #Menues!N49*(Assumptions!F38/100)*Assumptions!I15*Assumptions!I9*Assumptions!F39 \r\n @ph_result.lifetime = n49 * (calcul_efficiency / 100) * @ph_product.ph_basic_information.performance_ratio * @ph_product.ph_basic_information.radiation * @ph_product.ph_specified.lifetime\r\n \r\n end\r\n \r\n \r\n #IF($Assumptions.E35=$Menues.G41;$Assumptions.D35*$Menues.E60;IF($Assumptions.E35=$Menues.G42;$Assumptions.D35;IF($Assumptions.E35=G43;$Menues.E59*$Assumptions.D35;IF($Assumptions.E35=$Menues.G44;$Menues.E58*$Assumptions.D35;IF($Assumptions.E35=$Menues.G45;$Menues.E61*$Assumptions.D35;0)))));0))\r\n \r\n # ph_result cabling\r\n @ph_result.cabling = 0\r\n temp = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted' || @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Roof Mounted System', @ph_product \r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated' || @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Facade Mounted System', @ph_product\r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Ground Mounted System', @ph_product\r\n end \r\n\r\n @ph_result.cabling = temp * @ph_product.ph_intermediate_result.module_area\r\n\r\n @ph_result.module = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B17\r\n temp = get_database_material_result_co2 'a-Si', 'Module Laminate', @ph_product\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B15\r\n temp = get_database_material_result_co2 'p-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B8\r\n temp = get_database_material_result_co2 'm-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = get_database_material_result_co2 'CdTe', 'Thinfilm', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B19\r\n temp = get_database_material_result_co2 'CIS/CIGS', 'Module Laminate', @ph_product \r\n end\r\n @ph_result.module = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n # =(IF(Assumptions!$G$19=Menues!$A$5,'Database Materials'!B$2,IF(Assumptions!$G$19=Menues!$A$2,'Database Materials'!B$17,IF(Assumptions!$G$19=Menues!$A$3,'Database Materials'!B$15,IF(Assumptions!$G$19=Menues!$A$4,'Database Materials'!B$8,IF(Assumptions!$G$19=Menues!$A$6,'Database Materials'!B$19,0))))))*Assumptions!$I$68 \r\n\r\n @ph_result.framing = 0 \r\n if @ph_product.ph_basic_information.framed == 'yes'\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B18 - B17\r\n temp = (get_database_material_result_co2 'a-Si', 'Module Framed Panel', @ph_product) - (get_database_material_result_co2 'a-Si', 'Module Laminate', @ph_product)\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B14\r\n temp = get_database_material_result_co2 'p-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B7\r\n temp = get_database_material_result_co2 'm-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B20 - B19\r\n temp = (get_database_material_result_co2 'CIS/CIGS', 'Module Framed Panel', @ph_product) - (get_database_material_result_co2 'CIS/CIGS', 'Module Laminate', @ph_product) \r\n end \r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = 0 \r\n end \r\n @ph_result.framing = temp * @ph_product.ph_intermediate_result.module_area\r\n end\r\n \r\n # ph_result mounting\r\n @ph_result.mounting = 0 \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted'\r\n #B24\r\n temp = get_database_material_result_co2 'Mounting', 'Roof Mounted Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #B25\r\n temp = get_database_material_result_co2 'Mounting', 'Roof Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #B27\r\n temp = get_database_material_result_co2 'Mounting', 'Facade Mounted Structures', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated'\r\n #B28\r\n temp = get_database_material_result_co2 'Mounting', 'Facade Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #B26\r\n temp = get_database_material_result_co2 'Mounting', 'Open Ground Structures', @ph_product\r\n end \r\n @ph_result.mounting = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n \r\n # ph_result inverter\r\n @ph_result.inverter = 0 \r\n if @ph_product.ph_electric_component.quantity_1 != 0\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_result.inverter += temp * @ph_product.ph_electric_component.quantity_1\r\n end\r\n if @ph_product.ph_electric_component.quantity_2 != 0\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_result.inverter += temp * @ph_product.ph_electric_component.quantity_2\r\n end\r\n \r\n \r\n # ph_result batteries\r\n @ph_result.batteries = 0 \r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_result.batteries = @ph_product.ph_electric_component.separated_battery * pes_1 * pes_2\r\n \r\n # ph_result maintenance\r\n @ph_result.maintenance = 0 \r\n \r\n \r\n @ph_result.co2_total = @ph_result.cabling + @ph_result.module + @ph_result.framing + @ph_result.mounting + @ph_result.inverter + @ph_result.batteries\r\n \r\n \r\n ###########\r\n ### MAINTENANCE\r\n #########\r\n \r\n @ph_maintenance_result.years_included = 0\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_5'\r\n @ph_maintenance_result.years_included = 5\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_10'\r\n @ph_maintenance_result.years_included = 10\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_15'\r\n @ph_maintenance_result.years_included = 15\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_20'\r\n @ph_maintenance_result.years_included = 20\r\n end\r\n \r\n # boolean\r\n @ph_maintenance_result.inverter_replacement = 0\r\n if @ph_maintenance_result.years_included != 0\r\n if @ph_product.ph_maintenance.replacement_inverters == 'yes'\r\n @ph_maintenance_result.inverter_replacement = 1 \r\n end \r\n end\r\n\r\n # boolean\r\n @ph_maintenance_result.batteries_replacement = 0\r\n if @ph_product.ph_maintenance.replacement_batteries == 'yes'\r\n @ph_maintenance_result.batteries_replacement = 1 \r\n end \r\n \r\n @ph_maintenance_result.tap_water_l = 0\r\n if @ph_product.ph_maintenance.cleaning_modules == 'yes'\r\n @ph_maintenance_result.tap_water_l = 3.25\r\n end\r\n \r\n @ph_maintenance_result.tap_water_co2 = 0\r\n #b38\r\n temp = get_database_material_result_co2 'Maintenance', 'Tap Water', @ph_product\r\n @ph_maintenance_result.tap_water_co2 = temp * @ph_maintenance_result.tap_water_l\r\n \r\n @ph_maintenance_result.tap_water_pe = 0\r\n #c38\r\n temp = get_database_material_result_pe 'Maintenance', 'Tap Water', @ph_product\r\n @ph_maintenance_result.tap_water_pe = temp * @ph_maintenance_result.tap_water_l\r\n \r\n \r\n @ph_maintenance_result.needed_cycles_1 = 0\r\n if @ph_product.ph_electric_component.inverter_size_1 != 0 && @ph_product.ph_electric_component.quantity_1 != 0 \r\n if @ph_maintenance_result.inverter_replacement == 1 \r\n @ph_maintenance_result.needed_cycles_1 = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.lifetime_1) - 1\r\n if @ph_maintenance_result.needed_cycles_1 < 0\r\n @ph_maintenance_result.needed_cycles_1 = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_1 = @ph_maintenance_result.needed_cycles_1.ceil \r\n end\r\n end\r\n end\r\n @ph_maintenance_result.needed_replacements_1 = @ph_maintenance_result.needed_cycles_1 * @ph_product.ph_electric_component.quantity_1\r\n \r\n @ph_maintenance_result.embodied_co2_1 = 0\r\n # B29\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_maintenance_result.embodied_co2_1 = temp * @ph_maintenance_result.needed_replacements_1 \r\n @ph_maintenance_result.embodied_pe_1 = 0\r\n # C29\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_maintenance_result.embodied_pe_1 = temp * @ph_maintenance_result.needed_replacements_1\r\n\r\n \r\n @ph_maintenance_result.needed_cycles_2 = 0\r\n if @ph_product.ph_electric_component.inverter_size_2 != 0 && @ph_product.ph_electric_component.quantity_2 != 0 \r\n if @ph_maintenance_result.inverter_replacement == 1 \r\n @ph_maintenance_result.needed_cycles_2 = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.lifetime_2) - 1\r\n if @ph_maintenance_result.needed_cycles_2 < 0\r\n @ph_maintenance_result.needed_cycles_2 = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_2 = @ph_maintenance_result.needed_cycles_2.ceil\r\n end \r\n end\r\n end\r\n @ph_maintenance_result.needed_replacements_2 = @ph_maintenance_result.needed_cycles_2 * @ph_product.ph_electric_component.quantity_2\r\n \r\n @ph_maintenance_result.embodied_co2_2 = 0\r\n # B29\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_maintenance_result.embodied_co2_2 = temp * @ph_maintenance_result.needed_replacements_2\r\n \r\n @ph_maintenance_result.embodied_pe_2 = 0\r\n # C29\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_maintenance_result.embodied_pe_2 = temp * @ph_maintenance_result.needed_replacements_2\r\n \r\n \r\n \r\n @ph_maintenance_result.driven_maintenance = 2 * @ph_product.ph_maintenance.distance\r\n @ph_maintenance_result.driven_year = @ph_maintenance_result.driven_maintenance * @ph_product.ph_maintenance.yearly_frequency\r\n @ph_maintenance_result.driven_contract = @ph_maintenance_result.driven_year * @ph_maintenance_result.years_included\r\n \r\n @ph_maintenance_result.embodied_co2_transport = 0 \r\n #B35\r\n temp = get_database_material_result_co2 'Maintenance', 'Average Car Driving', @ph_product\r\n @ph_maintenance_result.embodied_co2_transport = @ph_maintenance_result.driven_contract * temp\r\n \r\n @ph_maintenance_result.embodied_pe_transport = 0\r\n #C35\r\n temp = get_database_material_result_pe 'Maintenance', 'Average Car Driving', @ph_product\r\n @ph_maintenance_result.embodied_pe_transport = @ph_maintenance_result.driven_contract * temp\r\n \r\n @ph_maintenance_result.embodied_co2_cleaning = @ph_product.ph_intermediate_result.module_area * @ph_maintenance_result.tap_water_co2\r\n @ph_maintenance_result.embodied_pe_cleaning = @ph_product.ph_intermediate_result.module_area * @ph_maintenance_result.tap_water_pe\r\n @ph_maintenance_result.total_embodied_co2_cleaning = @ph_maintenance_result.embodied_co2_cleaning * @ph_maintenance_result.years_included * @ph_product.ph_maintenance.yearly_frequency\r\n @ph_maintenance_result.total_embodied_pe_cleaning = @ph_maintenance_result.embodied_pe_cleaning * @ph_maintenance_result.years_included * @ph_product.ph_maintenance.yearly_frequency\r\n \r\n @ph_maintenance_result.needed_cycles_batteries = 0\r\n if @ph_maintenance_result.batteries_replacement == 1\r\n @ph_maintenance_result.needed_cycles_batteries = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.battery_lifetime) - 1\r\n if @ph_maintenance_result.needed_cycles_batteries < 0\r\n @ph_maintenance_result.needed_cycles_batteries = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_batteries = @ph_maintenance_result.needed_cycles_batteries.ceil\r\n end \r\n end\r\n \r\n @ph_maintenance_result.needed_replacements_batteries = @ph_maintenance_result.needed_cycles_batteries * @ph_product.ph_electric_component.separated_battery\r\n \r\n @ph_maintenance_result.embodied_co2_batteries = 0\r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n #B32 \r\n temp_2 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_maintenance_result.embodied_co2_batteries = @ph_maintenance_result.needed_replacements_batteries * temp * temp_2\r\n \r\n @ph_maintenance_result.embodied_pe_batteries = 0 \r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n #C32 \r\n temp_2 = get_database_material_result_pe 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_maintenance_result.embodied_pe_batteries = @ph_maintenance_result.needed_replacements_batteries * temp * temp_2\r\n \r\n @ph_maintenance_result.embodied_carbon_dioxide = 0\r\n @ph_maintenance_result.embodied_primary_energy = 0\r\n if @ph_product.ph_maintenance.maintenance_needs != 'no'\r\n @ph_maintenance_result.embodied_carbon_dioxide = @ph_maintenance_result.embodied_co2_1 + @ph_maintenance_result.embodied_co2_2 + @ph_maintenance_result.embodied_co2_transport + @ph_maintenance_result.total_embodied_co2_cleaning + @ph_maintenance_result.embodied_co2_batteries\r\n @ph_maintenance_result.embodied_primary_energy = @ph_maintenance_result.embodied_pe_1 + @ph_maintenance_result.embodied_pe_2 + @ph_maintenance_result.embodied_pe_transport + @ph_maintenance_result.total_embodied_pe_cleaning + @ph_maintenance_result.embodied_pe_batteries \r\n end\r\n @ph_result.maintenance = @ph_maintenance_result.embodied_carbon_dioxide\r\n @ph_embedded_result.pe_maintenance = @ph_maintenance_result.embodied_primary_energy\r\n ##########\r\n ### EMBEDDED\r\n ##########\r\n\r\n @ph_embedded_result.lifetime_saved = @ph_result.lifetime * 3.6 / @ph_product.ph_basic_information.conversion_factor\r\n \r\n @ph_embedded_result.pe_pv_cabling = 0\r\n temp = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted' || @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #C22\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Roof Mounted System', @ph_product \r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated' || @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #C21\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Facade Mounted System', @ph_product\r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #C23\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Ground Mounted System', @ph_product\r\n end \r\n @ph_embedded_result.pe_pv_cabling = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n \r\n @ph_embedded_result.pe_pv_module = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B17\r\n temp = get_database_material_result_pe 'a-Si', 'Module Laminate', @ph_product\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B15\r\n temp = get_database_material_result_pe 'p-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B8\r\n temp = get_database_material_result_pe 'm-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = get_database_material_result_pe 'CdTe', 'Thinfilm', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B19\r\n temp = get_database_material_result_pe 'CIS/CIGS', 'Module Laminate', @ph_product \r\n end\r\n @ph_embedded_result.pe_pv_module = temp * @ph_product.ph_intermediate_result.module_area \r\n \r\n @ph_embedded_result.pe_pv_framing = 0\r\n if @ph_product.ph_basic_information.framed == 'yes'\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B18 - B17\r\n temp = (get_database_material_result_pe 'a-Si', 'Module Framed Panel', @ph_product) - (get_database_material_result_pe 'a-Si', 'Module Laminate', @ph_product)\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B14\r\n temp = get_database_material_result_pe 'p-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B7\r\n temp = get_database_material_result_pe 'm-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B20 - B19\r\n temp = (get_database_material_result_pe 'CIS/CIGS', 'Module Framed Panel', @ph_product) - (get_database_material_result_pe 'CIS/CIGS', 'Module Laminate', @ph_product) \r\n end \r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = 0 \r\n end \r\n @ph_embedded_result.pe_pv_framing = temp * @ph_product.ph_intermediate_result.module_area\r\n end\r\n \r\n @ph_embedded_result.pe_pv_mounting = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted'\r\n #B24\r\n temp = get_database_material_result_pe 'Mounting', 'Roof Mounted Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #B25\r\n temp = get_database_material_result_pe 'Mounting', 'Roof Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #B27\r\n temp = get_database_material_result_pe 'Mounting', 'Facade Mounted Structures', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated'\r\n #B28\r\n temp = get_database_material_result_pe 'Mounting', 'Facade Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #B26\r\n temp = get_database_material_result_pe 'Mounting', 'Open Ground Structures', @ph_product\r\n end \r\n @ph_embedded_result.pe_pv_mounting = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n @ph_embedded_result.pe_inverter = 0\r\n if @ph_product.ph_electric_component.quantity_1 != 0\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_embedded_result.pe_inverter += temp * @ph_product.ph_electric_component.quantity_1\r\n end\r\n if @ph_product.ph_electric_component.quantity_2 != 0\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_embedded_result.pe_inverter += temp * @ph_product.ph_electric_component.quantity_2\r\n end\r\n \r\n \r\n @ph_embedded_result.pe_batteries = 0\r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_pe 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_embedded_result.pe_batteries = @ph_product.ph_electric_component.separated_battery * pes_1 * pes_2\r\n \r\n \r\n \r\n @ph_embedded_result.embedded_energy_total = @ph_embedded_result.pe_pv_cabling + @ph_embedded_result.pe_pv_module + @ph_embedded_result.pe_pv_framing + @ph_embedded_result.pe_pv_mounting + @ph_embedded_result.pe_inverter + @ph_embedded_result.pe_batteries + @ph_embedded_result.pe_maintenance \r\n \r\n \r\n @ph_embedded_result.peak_power = @ph_product.ph_intermediate_result.module_area * calcul_efficiency / 100\r\n @ph_embedded_result.lifetime_production = @ph_result.lifetime\r\n @ph_embedded_result.averaged_power = @ph_embedded_result.lifetime_production / @ph_product.ph_specified.lifetime\r\n @ph_embedded_result.averaged_consumption = @ph_embedded_result.averaged_power * 3.6 / @ph_product.ph_basic_information.conversion_factor \r\n @ph_embedded_result.system_emb = @ph_embedded_result.embedded_energy_total\r\n @ph_embedded_result.energy_payback = @ph_embedded_result.embedded_energy_total / @ph_embedded_result.averaged_consumption\r\n @ph_embedded_result.energy_yield = @ph_embedded_result.lifetime_saved / @ph_embedded_result.embedded_energy_total\r\n @ph_embedded_result.emb_co2 = @ph_result.cabling + @ph_result.inverter + @ph_result.batteries \r\n# @ph_embedded_result.estim_co2 = 1000 * @ph_result.co2_total / @ph_embedded_result.lifetime_production\r\n \r\n\r\n\r\n \r\n \r\n \r\n @ph_result.co2_total += @ph_result.maintenance\r\n @ph_embedded_result.estim_co2 = 1000 * @ph_result.co2_total / @ph_result.lifetime\r\n @ph_embedded_result.net_saved_co2 = @ph_embedded_result.lifetime_production * (@ph_product.ph_basic_information.co2_factor - @ph_embedded_result.estim_co2) / 1000 \r\n \r\n @ph_product.ph_result.save\r\n @ph_product.ph_embedded_result.save\r\n @ph_product.ph_maintenance_result.save\r\n end \r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml\r\n end\r\n end",
"title": ""
},
{
"docid": "9117be90eec2b65c9454c9e34ef5d017",
"score": "0.47363174",
"text": "def summary\r\n \r\n @ph_product = PhProduct.find(params[:ph_result_id])\r\n @product = @ph_product.product\r\n @step = 1 \r\n if @ph_product.ph_intermediate_result \r\n if !@ph_product.ph_result\r\n ph_result = PhResult.new \r\n ph_result.ph_product_id = @ph_product.id\r\n ph_result.save\r\n @ph_product.ph_result = ph_result\r\n end\r\n @ph_result = @ph_product.ph_result\r\n if !@ph_product.ph_maintenance_result \r\n ph_maintenance_result = PhMaintenanceResult.new \r\n ph_maintenance_result.ph_product_id = @ph_product.id\r\n ph_maintenance_result.save\r\n @ph_product.ph_maintenance_result = ph_maintenance_result \r\n end\r\n @ph_maintenance_result = @ph_product.ph_maintenance_result \r\n if !@ph_product.ph_embedded_result \r\n ph_embedded_result = PhEmbeddedResult.new \r\n ph_embedded_result.ph_product_id = @ph_product.id\r\n ph_embedded_result.save\r\n @ph_product.ph_embedded_result = ph_embedded_result \r\n end\r\n @ph_embedded_result = @ph_product.ph_embedded_result \r\n \r\n\r\n @ph_embedded_result.temperature_induced = 0\r\n temp = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n temp = -0.13\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n temp = -0.4465\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n temp = -0.402545\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n temp = -0.25 \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n temp = -0.43666\r\n end \r\n \r\n # =(Assumptions!$I$11-25)*IF(Assumptions!G19=Menues!A2,Menues!A122,IF(Assumptions!G19=Menues!A3,Menues!B122,IF(Assumptions!G19=Menues!A4,Menues!C122,IF(Assumptions!G19=Menues!A5,Menues!D122,IF(Assumptions!G19=Menues!A6,Menues!E122,0))))) \r\n \r\n @ph_embedded_result.temperature_induced = temp * (@ph_product.ph_basic_information.temperature - 25) \r\n calcul_efficiency = @ph_product.ph_specified.efficiency * (1 + (@ph_embedded_result.temperature_induced / 100))\r\n \r\n ph_database_material_values = PhDatabaseMaterialValue.find(:all, :conditions => [\"ph_product_id = ?\", @ph_product.id])\r\n ph_database_material_values.each do |ph_database_material_value|\r\n ph_database_material_value.delete\r\n end \r\n\r\n @ph_database_materials = PhDatabaseMaterial.all \r\n @ph_database_materials.each do |ph_database_material|\r\n if ph_database_material.default_value_co2 == 0\r\n calculate_co2 ph_database_material, @ph_product\r\n end\r\n if ph_database_material.default_value_pe == 0\r\n calculate_pe ph_database_material, @ph_product\r\n end \r\n end\r\n @ph_database_material_values = PhDatabaseMaterialValue.find(:all, :conditions => [\"ph_product_id = ?\", @ph_product.id])\r\n \r\n n49 = 0\r\n if @ph_product.ph_specified.area_unit\r\n n49 = @ph_product.ph_specified.area * @ph_product.ph_specified.area_unit.conversion_factor\r\n end\r\n \r\n if @ph_product.ph_basic_information.known == 'both' || @ph_product.ph_basic_information.known == 'power_demand'\r\n #Menues!N56*Assumptions!F39\r\n @ph_result.lifetime = 0\r\n n56 = 0\r\n #=IF($Assumptions.G19=$Menues.A7;0;\r\n if @ph_product.ph_specified.ph_module_type.name != 'Not specified'\r\n if @ph_product.ph_specified.power_unit.conversion_factor == -1 \r\n # Peak Power [kWp]\r\n conversion_factor = @ph_product.ph_basic_information.radiation * @ph_product.ph_basic_information.performance_ratio\r\n n56 = @ph_product.ph_specified.power * conversion_factor\r\n else \r\n n56 = @ph_product.ph_specified.power * @ph_product.ph_specified.power_unit.conversion_factor\r\n end \r\n @ph_result.lifetime = n56 * @ph_product.ph_specified.lifetime\r\n # @ph_result.lifetime = @ph_product.ph_specified.power * @ph_product.ph_specified.power_unit.conversion_factor\r\n end\r\n else \r\n #Menues!N49*(Assumptions!F38/100)*Assumptions!I15*Assumptions!I9*Assumptions!F39 \r\n @ph_result.lifetime = n49 * (calcul_efficiency / 100) * @ph_product.ph_basic_information.performance_ratio * @ph_product.ph_basic_information.radiation * @ph_product.ph_specified.lifetime\r\n \r\n end\r\n # New requirement\r\n if @ph_product.ph_basic_information.working == 'yes' && @ph_product.ph_basic_information.know_power == 'yes' \r\n @ph_result.lifetime = @ph_product.ph_basic_information.user_power * @ph_product.ph_specified.lifetime\r\n end \r\n\r\n \r\n #IF($Assumptions.E35=$Menues.G41;$Assumptions.D35*$Menues.E60;IF($Assumptions.E35=$Menues.G42;$Assumptions.D35;IF($Assumptions.E35=G43;$Menues.E59*$Assumptions.D35;IF($Assumptions.E35=$Menues.G44;$Menues.E58*$Assumptions.D35;IF($Assumptions.E35=$Menues.G45;$Menues.E61*$Assumptions.D35;0)))));0))\r\n\r\n @ph_result.cabling = 0\r\n temp = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted' || @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Roof Mounted System', @ph_product \r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated' || @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Facade Mounted System', @ph_product\r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Ground Mounted System', @ph_product\r\n end \r\n @ph_result.cabling = temp * @ph_product.ph_intermediate_result.module_area\r\n\r\n # ph_result module\r\n @ph_result.module = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B17\r\n temp = get_database_material_result_co2 'a-Si', 'Module Laminate', @ph_product\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B15\r\n temp = get_database_material_result_co2 'p-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B8\r\n temp = get_database_material_result_co2 'm-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = get_database_material_result_co2 'CdTe', 'Thinfilm', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B19\r\n temp = get_database_material_result_co2 'CIS/CIGS', 'Module Laminate', @ph_product \r\n end\r\n @ph_result.module = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n # =(IF(Assumptions!$G$19=Menues!$A$5,'Database Materials'!B$2,IF(Assumptions!$G$19=Menues!$A$2,'Database Materials'!B$17,IF(Assumptions!$G$19=Menues!$A$3,'Database Materials'!B$15,IF(Assumptions!$G$19=Menues!$A$4,'Database Materials'!B$8,IF(Assumptions!$G$19=Menues!$A$6,'Database Materials'!B$19,0))))))*Assumptions!$I$68 \r\n\r\n @ph_result.framing = 0 \r\n if @ph_product.ph_basic_information.framed == 'yes'\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B18 - B17\r\n temp = (get_database_material_result_co2 'a-Si', 'Module Framed Panel', @ph_product) - (get_database_material_result_co2 'a-Si', 'Module Laminate', @ph_product)\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B14\r\n temp = get_database_material_result_co2 'p-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B7\r\n temp = get_database_material_result_co2 'm-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B20 - B19\r\n temp = (get_database_material_result_co2 'CIS/CIGS', 'Module Framed Panel', @ph_product) - (get_database_material_result_co2 'CIS/CIGS', 'Module Laminate', @ph_product) \r\n end \r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = 0 \r\n end \r\n @ph_result.framing = temp * @ph_product.ph_intermediate_result.module_area\r\n end\r\n\r\n @ph_result.mounting = 0 \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted'\r\n #B24\r\n temp = get_database_material_result_co2 'Mounting', 'Roof Mounted Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #B25\r\n temp = get_database_material_result_co2 'Mounting', 'Roof Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #B27\r\n temp = get_database_material_result_co2 'Mounting', 'Facade Mounted Structures', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated'\r\n #B28\r\n temp = get_database_material_result_co2 'Mounting', 'Facade Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #B26\r\n temp = get_database_material_result_co2 'Mounting', 'Open Ground Structures', @ph_product\r\n end \r\n @ph_result.mounting = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n \r\n # ph_result inverter\r\n @ph_result.inverter = 0 \r\n if @ph_product.ph_electric_component.quantity_1 != 0\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_result.inverter += temp * @ph_product.ph_electric_component.quantity_1\r\n end\r\n if @ph_product.ph_electric_component.quantity_2 != 0\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_result.inverter += temp * @ph_product.ph_electric_component.quantity_2\r\n end\r\n \r\n \r\n # ph_result batteries\r\n @ph_result.batteries = 0 \r\n if @ph_product.ph_electric_component.ph_battery_type.name == 'Lead Acid'\r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n else\r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [per kg]', @ph_product \r\n end \r\n @ph_result.batteries = @ph_product.ph_electric_component.separated_battery * pes_1 * pes_2\r\n \r\n # ph_result maintenance\r\n @ph_result.maintenance = 0 \r\n \r\n \r\n @ph_result.co2_total = @ph_result.cabling + @ph_result.module + @ph_result.framing + @ph_result.mounting + @ph_result.inverter + @ph_result.batteries\r\n \r\n \r\n ###########\r\n ### MAINTENANCE\r\n #########\r\n \r\n @ph_maintenance_result.years_included = 0\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_5'\r\n @ph_maintenance_result.years_included = 5\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_10'\r\n @ph_maintenance_result.years_included = 10\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_15'\r\n @ph_maintenance_result.years_included = 15\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_20'\r\n @ph_maintenance_result.years_included = 20\r\n end\r\n \r\n # boolean\r\n @ph_maintenance_result.inverter_replacement = 0\r\n if @ph_maintenance_result.years_included != 0\r\n if @ph_product.ph_maintenance.replacement_inverters == 'yes'\r\n @ph_maintenance_result.inverter_replacement = 1 \r\n end \r\n end\r\n\r\n # boolean\r\n @ph_maintenance_result.batteries_replacement = 0\r\n if @ph_product.ph_maintenance.replacement_batteries == 'yes'\r\n @ph_maintenance_result.batteries_replacement = 1 \r\n end \r\n \r\n @ph_maintenance_result.tap_water_l = 0\r\n if @ph_product.ph_maintenance.cleaning_modules == 'yes'\r\n @ph_maintenance_result.tap_water_l = 3.25\r\n end\r\n \r\n @ph_maintenance_result.tap_water_co2 = 0\r\n #b38\r\n temp = get_database_material_result_co2 'Maintenance', 'Tap Water', @ph_product\r\n @ph_maintenance_result.tap_water_co2 = temp * @ph_maintenance_result.tap_water_l\r\n \r\n @ph_maintenance_result.tap_water_pe = 0\r\n #c38\r\n temp = get_database_material_result_pe 'Maintenance', 'Tap Water', @ph_product\r\n @ph_maintenance_result.tap_water_pe = temp * @ph_maintenance_result.tap_water_l\r\n \r\n \r\n @ph_maintenance_result.needed_cycles_1 = 0\r\n if @ph_product.ph_electric_component.inverter_size_1 != 0 && @ph_product.ph_electric_component.quantity_1 != 0 \r\n if @ph_maintenance_result.inverter_replacement == 1 \r\n @ph_maintenance_result.needed_cycles_1 = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.lifetime_1) - 1\r\n if @ph_maintenance_result.needed_cycles_1 < 0\r\n @ph_maintenance_result.needed_cycles_1 = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_1 = @ph_maintenance_result.needed_cycles_1.ceil \r\n end\r\n end\r\n end\r\n @ph_maintenance_result.needed_replacements_1 = @ph_maintenance_result.needed_cycles_1 * @ph_product.ph_electric_component.quantity_1\r\n \r\n @ph_maintenance_result.embodied_co2_1 = 0\r\n # B29\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_maintenance_result.embodied_co2_1 = temp * @ph_maintenance_result.needed_replacements_1 \r\n @ph_maintenance_result.embodied_pe_1 = 0\r\n # C29\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_maintenance_result.embodied_pe_1 = temp * @ph_maintenance_result.needed_replacements_1\r\n\r\n \r\n @ph_maintenance_result.needed_cycles_2 = 0\r\n if @ph_product.ph_electric_component.inverter_size_2 != 0 && @ph_product.ph_electric_component.quantity_2 != 0 \r\n if @ph_maintenance_result.inverter_replacement == 1 \r\n @ph_maintenance_result.needed_cycles_2 = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.lifetime_2) - 1\r\n if @ph_maintenance_result.needed_cycles_2 < 0\r\n @ph_maintenance_result.needed_cycles_2 = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_2 = @ph_maintenance_result.needed_cycles_2.ceil\r\n end \r\n end\r\n end\r\n @ph_maintenance_result.needed_replacements_2 = @ph_maintenance_result.needed_cycles_2 * @ph_product.ph_electric_component.quantity_2\r\n \r\n @ph_maintenance_result.embodied_co2_2 = 0\r\n # B29\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_maintenance_result.embodied_co2_2 = temp * @ph_maintenance_result.needed_replacements_2\r\n \r\n @ph_maintenance_result.embodied_pe_2 = 0\r\n # C29\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_maintenance_result.embodied_pe_2 = temp * @ph_maintenance_result.needed_replacements_2\r\n \r\n \r\n \r\n @ph_maintenance_result.driven_maintenance = 2 * @ph_product.ph_maintenance.distance\r\n @ph_maintenance_result.driven_year = @ph_maintenance_result.driven_maintenance * @ph_product.ph_maintenance.yearly_frequency\r\n @ph_maintenance_result.driven_contract = @ph_maintenance_result.driven_year * @ph_maintenance_result.years_included\r\n \r\n @ph_maintenance_result.embodied_co2_transport = 0 \r\n #B35\r\n temp = get_database_material_result_co2 'Maintenance', 'Average Car Driving', @ph_product\r\n @ph_maintenance_result.embodied_co2_transport = @ph_maintenance_result.driven_contract * temp\r\n \r\n @ph_maintenance_result.embodied_pe_transport = 0\r\n #C35\r\n temp = get_database_material_result_pe 'Maintenance', 'Average Car Driving', @ph_product\r\n @ph_maintenance_result.embodied_pe_transport = @ph_maintenance_result.driven_contract * temp\r\n \r\n @ph_maintenance_result.embodied_co2_cleaning = @ph_product.ph_intermediate_result.module_area * @ph_maintenance_result.tap_water_co2\r\n @ph_maintenance_result.embodied_pe_cleaning = @ph_product.ph_intermediate_result.module_area * @ph_maintenance_result.tap_water_pe\r\n @ph_maintenance_result.total_embodied_co2_cleaning = @ph_maintenance_result.embodied_co2_cleaning * @ph_maintenance_result.years_included * @ph_product.ph_maintenance.yearly_frequency\r\n @ph_maintenance_result.total_embodied_pe_cleaning = @ph_maintenance_result.embodied_pe_cleaning * @ph_maintenance_result.years_included * @ph_product.ph_maintenance.yearly_frequency\r\n \r\n @ph_maintenance_result.needed_cycles_batteries = 0\r\n if @ph_maintenance_result.batteries_replacement == 1\r\n @ph_maintenance_result.needed_cycles_batteries = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.battery_lifetime) - 1\r\n if @ph_maintenance_result.needed_cycles_batteries < 0\r\n @ph_maintenance_result.needed_cycles_batteries = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_batteries = @ph_maintenance_result.needed_cycles_batteries.ceil\r\n end \r\n end\r\n \r\n @ph_maintenance_result.needed_replacements_batteries = @ph_maintenance_result.needed_cycles_batteries * @ph_product.ph_electric_component.separated_battery\r\n \r\n @ph_maintenance_result.embodied_co2_batteries = 0\r\n if @ph_product.ph_electric_component.ph_battery_type.name == 'Lead Acid'\r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n #B32 \r\n temp_2 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n else\r\n #B33\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [kg / pc.]', @ph_product\r\n #B34 \r\n temp_2 = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [per kg]', @ph_product\r\n end \r\n @ph_maintenance_result.embodied_co2_batteries = @ph_maintenance_result.needed_replacements_batteries * temp * temp_2\r\n \r\n @ph_maintenance_result.embodied_pe_batteries = 0 \r\n if @ph_product.ph_electric_component.ph_battery_type.name == 'Lead Acid' \r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n #C32 \r\n temp_2 = get_database_material_result_pe 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n else\r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [kg / pc.]', @ph_product\r\n #C32 \r\n temp_2 = get_database_material_result_pe 'Electrics Battery', 'Lithium Ion [per kg]', @ph_product \r\n end \r\n @ph_maintenance_result.embodied_pe_batteries = @ph_maintenance_result.needed_replacements_batteries * temp * temp_2\r\n \r\n @ph_maintenance_result.embodied_carbon_dioxide = 0\r\n @ph_maintenance_result.embodied_primary_energy = 0\r\n if @ph_product.ph_maintenance.maintenance_needs != 'no'\r\n @ph_maintenance_result.embodied_carbon_dioxide = @ph_maintenance_result.embodied_co2_1 + @ph_maintenance_result.embodied_co2_2 + @ph_maintenance_result.embodied_co2_transport + @ph_maintenance_result.total_embodied_co2_cleaning + @ph_maintenance_result.embodied_co2_batteries\r\n @ph_maintenance_result.embodied_primary_energy = @ph_maintenance_result.embodied_pe_1 + @ph_maintenance_result.embodied_pe_2 + @ph_maintenance_result.embodied_pe_transport + @ph_maintenance_result.total_embodied_pe_cleaning + @ph_maintenance_result.embodied_pe_batteries \r\n end\r\n @ph_result.maintenance = @ph_maintenance_result.embodied_carbon_dioxide\r\n @ph_embedded_result.pe_maintenance = @ph_maintenance_result.embodied_primary_energy\r\n ##########\r\n ### EMBEDDED\r\n ##########\r\n\r\n @ph_embedded_result.lifetime_saved = @ph_result.lifetime * 3.6 / @ph_product.ph_basic_information.conversion_factor\r\n \r\n @ph_embedded_result.pe_pv_cabling = 0\r\n temp = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted' || @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #C22\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Roof Mounted System', @ph_product \r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated' || @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #C21\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Facade Mounted System', @ph_product\r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #C23\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Ground Mounted System', @ph_product\r\n end \r\n @ph_embedded_result.pe_pv_cabling = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n \r\n @ph_embedded_result.pe_pv_module = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B17\r\n temp = get_database_material_result_pe 'a-Si', 'Module Laminate', @ph_product\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B15\r\n temp = get_database_material_result_pe 'p-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B8\r\n temp = get_database_material_result_pe 'm-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = get_database_material_result_pe 'CdTe', 'Thinfilm', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B19\r\n temp = get_database_material_result_pe 'CIS/CIGS', 'Module Laminate', @ph_product \r\n end\r\n @ph_embedded_result.pe_pv_module = temp * @ph_product.ph_intermediate_result.module_area \r\n \r\n @ph_embedded_result.pe_pv_framing = 0\r\n if @ph_product.ph_basic_information.framed == 'yes'\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B18 - B17\r\n temp = (get_database_material_result_pe 'a-Si', 'Module Framed Panel', @ph_product) - (get_database_material_result_pe 'a-Si', 'Module Laminate', @ph_product)\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B14\r\n temp = get_database_material_result_pe 'p-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B7\r\n temp = get_database_material_result_pe 'm-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B20 - B19\r\n temp = (get_database_material_result_pe 'CIS/CIGS', 'Module Framed Panel', @ph_product) - (get_database_material_result_pe 'CIS/CIGS', 'Module Laminate', @ph_product) \r\n end \r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = 0 \r\n end \r\n @ph_embedded_result.pe_pv_framing = temp * @ph_product.ph_intermediate_result.module_area\r\n end\r\n \r\n @ph_embedded_result.pe_pv_mounting = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted'\r\n #B24\r\n temp = get_database_material_result_pe 'Mounting', 'Roof Mounted Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #B25\r\n temp = get_database_material_result_pe 'Mounting', 'Roof Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #B27\r\n temp = get_database_material_result_pe 'Mounting', 'Facade Mounted Structures', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated'\r\n #B28\r\n temp = get_database_material_result_pe 'Mounting', 'Facade Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #B26\r\n temp = get_database_material_result_pe 'Mounting', 'Open Ground Structures', @ph_product\r\n end \r\n @ph_embedded_result.pe_pv_mounting = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n @ph_embedded_result.pe_inverter = 0\r\n if @ph_product.ph_electric_component.quantity_1 != 0\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_embedded_result.pe_inverter += temp * @ph_product.ph_electric_component.quantity_1\r\n end\r\n if @ph_product.ph_electric_component.quantity_2 != 0\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_embedded_result.pe_inverter += temp * @ph_product.ph_electric_component.quantity_2\r\n end\r\n \r\n \r\n @ph_embedded_result.pe_batteries = 0\r\n if @ph_product.ph_electric_component.ph_battery_type.name == 'Lead Acid' \r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_pe 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n else\r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_pe 'Electrics Battery', 'Lithium Ion [per kg]', @ph_product \r\n end \r\n @ph_embedded_result.pe_batteries = @ph_product.ph_electric_component.separated_battery * pes_1 * pes_2\r\n \r\n \r\n \r\n @ph_embedded_result.embedded_energy_total = @ph_embedded_result.pe_pv_cabling + @ph_embedded_result.pe_pv_module + @ph_embedded_result.pe_pv_framing + @ph_embedded_result.pe_pv_mounting + @ph_embedded_result.pe_inverter + @ph_embedded_result.pe_batteries + @ph_embedded_result.pe_maintenance \r\n \r\n \r\n @ph_embedded_result.peak_power = @ph_product.ph_intermediate_result.module_area * calcul_efficiency / 100\r\n @ph_embedded_result.lifetime_production = @ph_result.lifetime\r\n \r\n \r\n if @ph_product.ph_basic_information.working == 'yes' && @ph_product.ph_basic_information.know_power == 'yes' && @ph_product.ph_basic_information.user_power\r\n @ph_embedded_result.averaged_power = @ph_product.ph_basic_information.user_power\r\n else \r\n @ph_embedded_result.averaged_power = @ph_embedded_result.lifetime_production / @ph_product.ph_specified.lifetime \r\n end\r\n \r\n \r\n \r\n \r\n @ph_embedded_result.averaged_consumption = @ph_embedded_result.averaged_power * 3.6 / @ph_product.ph_basic_information.conversion_factor \r\n @ph_embedded_result.system_emb = @ph_embedded_result.embedded_energy_total\r\n @ph_embedded_result.energy_payback = @ph_embedded_result.embedded_energy_total / @ph_embedded_result.averaged_consumption\r\n @ph_embedded_result.energy_yield = @ph_embedded_result.lifetime_saved / @ph_embedded_result.embedded_energy_total\r\n @ph_embedded_result.emb_co2 = @ph_result.cabling + @ph_result.inverter + @ph_result.batteries \r\n\r\n @ph_result.co2_total += @ph_result.maintenance\r\n @ph_embedded_result.estim_co2 = 1000 * @ph_result.co2_total / @ph_result.lifetime\r\n @ph_embedded_result.net_saved_co2 = @ph_embedded_result.lifetime_production * (@ph_product.ph_basic_information.co2_factor - @ph_embedded_result.estim_co2) / 1000 \r\n \r\n @ph_product.ph_result.save\r\n @ph_product.ph_embedded_result.save\r\n @ph_product.ph_maintenance_result.save\r\n end \r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml\r\n end\r\n end",
"title": ""
},
{
"docid": "67bfe452cfb927a79d15eb4f0618948a",
"score": "0.47363174",
"text": "def summary\r\n \r\n @ph_product = PhProduct.find(params[:ph_result_id])\r\n @product = @ph_product.product\r\n @step = 1 \r\n if @ph_product.ph_intermediate_result \r\n if !@ph_product.ph_result\r\n ph_result = PhResult.new \r\n ph_result.ph_product_id = @ph_product.id\r\n ph_result.save\r\n @ph_product.ph_result = ph_result\r\n end\r\n @ph_result = @ph_product.ph_result\r\n if !@ph_product.ph_maintenance_result \r\n ph_maintenance_result = PhMaintenanceResult.new \r\n ph_maintenance_result.ph_product_id = @ph_product.id\r\n ph_maintenance_result.save\r\n @ph_product.ph_maintenance_result = ph_maintenance_result \r\n end\r\n @ph_maintenance_result = @ph_product.ph_maintenance_result \r\n if !@ph_product.ph_embedded_result \r\n ph_embedded_result = PhEmbeddedResult.new \r\n ph_embedded_result.ph_product_id = @ph_product.id\r\n ph_embedded_result.save\r\n @ph_product.ph_embedded_result = ph_embedded_result \r\n end\r\n @ph_embedded_result = @ph_product.ph_embedded_result \r\n \r\n\r\n @ph_embedded_result.temperature_induced = 0\r\n temp = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n temp = -0.13\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n temp = -0.4465\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n temp = -0.402545\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n temp = -0.25 \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n temp = -0.43666\r\n end \r\n \r\n # =(Assumptions!$I$11-25)*IF(Assumptions!G19=Menues!A2,Menues!A122,IF(Assumptions!G19=Menues!A3,Menues!B122,IF(Assumptions!G19=Menues!A4,Menues!C122,IF(Assumptions!G19=Menues!A5,Menues!D122,IF(Assumptions!G19=Menues!A6,Menues!E122,0))))) \r\n \r\n @ph_embedded_result.temperature_induced = temp * (@ph_product.ph_basic_information.temperature - 25) \r\n calcul_efficiency = @ph_product.ph_specified.efficiency * (1 + (@ph_embedded_result.temperature_induced / 100))\r\n \r\n ph_database_material_values = PhDatabaseMaterialValue.find(:all, :conditions => [\"ph_product_id = ?\", @ph_product.id])\r\n ph_database_material_values.each do |ph_database_material_value|\r\n ph_database_material_value.delete\r\n end \r\n \r\n\r\n @ph_database_materials = PhDatabaseMaterial.all \r\n @ph_database_materials.each do |ph_database_material|\r\n if ph_database_material.default_value_co2 == 0\r\n calculate_co2 ph_database_material, @ph_product\r\n end\r\n if ph_database_material.default_value_pe == 0\r\n calculate_pe ph_database_material, @ph_product\r\n end \r\n end\r\n @ph_database_material_values = PhDatabaseMaterialValue.find(:all, :conditions => [\"ph_product_id = ?\", @ph_product.id])\r\n \r\n n49 = 0\r\n if @ph_product.ph_specified.area_unit\r\n n49 = @ph_product.ph_specified.area * @ph_product.ph_specified.area_unit.conversion_factor\r\n end \r\n # ph_result lifetime\r\n \r\n if @ph_product.ph_basic_information.known == 'both' || @ph_product.ph_basic_information.known == 'power_demand'\r\n #Menues!N56*Assumptions!F39\r\n @ph_result.lifetime = 0\r\n n56 = 0\r\n #=IF($Assumptions.G19=$Menues.A7;0;\r\n if @ph_product.ph_specified.ph_module_type.name != 'Not specified'\r\n if @ph_product.ph_specified.power_unit.conversion_factor == -1 \r\n # Peak Power [kWp]\r\n conversion_factor = @ph_product.ph_basic_information.radiation * @ph_product.ph_basic_information.performance_ratio\r\n n56 = @ph_product.ph_specified.power * conversion_factor\r\n else \r\n n56 = @ph_product.ph_specified.power * @ph_product.ph_specified.power_unit.conversion_factor\r\n end \r\n @ph_result.lifetime = n56 * @ph_product.ph_specified.lifetime\r\n end\r\n else \r\n #Menues!N49*(Assumptions!F38/100)*Assumptions!I15*Assumptions!I9*Assumptions!F39 \r\n @ph_result.lifetime = n49 * (calcul_efficiency / 100) * @ph_product.ph_basic_information.performance_ratio * @ph_product.ph_basic_information.radiation * @ph_product.ph_specified.lifetime\r\n \r\n end\r\n \r\n \r\n #IF($Assumptions.E35=$Menues.G41;$Assumptions.D35*$Menues.E60;IF($Assumptions.E35=$Menues.G42;$Assumptions.D35;IF($Assumptions.E35=G43;$Menues.E59*$Assumptions.D35;IF($Assumptions.E35=$Menues.G44;$Menues.E58*$Assumptions.D35;IF($Assumptions.E35=$Menues.G45;$Menues.E61*$Assumptions.D35;0)))));0))\r\n @ph_result.cabling = 0\r\n temp = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted' || @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Roof Mounted System', @ph_product \r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated' || @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Facade Mounted System', @ph_product\r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Ground Mounted System', @ph_product\r\n end \r\n\r\n @ph_result.cabling = temp * @ph_product.ph_intermediate_result.module_area\r\n\r\n # ph_result module\r\n @ph_result.module = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B17\r\n temp = get_database_material_result_co2 'a-Si', 'Module Laminate', @ph_product\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B15\r\n temp = get_database_material_result_co2 'p-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B8\r\n temp = get_database_material_result_co2 'm-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = get_database_material_result_co2 'CdTe', 'Thinfilm', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B19\r\n temp = get_database_material_result_co2 'CIS/CIGS', 'Module Laminate', @ph_product \r\n end\r\n @ph_result.module = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n # =(IF(Assumptions!$G$19=Menues!$A$5,'Database Materials'!B$2,IF(Assumptions!$G$19=Menues!$A$2,'Database Materials'!B$17,IF(Assumptions!$G$19=Menues!$A$3,'Database Materials'!B$15,IF(Assumptions!$G$19=Menues!$A$4,'Database Materials'!B$8,IF(Assumptions!$G$19=Menues!$A$6,'Database Materials'!B$19,0))))))*Assumptions!$I$68 \r\n \r\n # ph_result framing\r\n @ph_result.framing = 0 \r\n if @ph_product.ph_basic_information.framed == 'yes'\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B18 - B17\r\n temp = (get_database_material_result_co2 'a-Si', 'Module Framed Panel', @ph_product) - (get_database_material_result_co2 'a-Si', 'Module Laminate', @ph_product)\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B14\r\n temp = get_database_material_result_co2 'p-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B7\r\n temp = get_database_material_result_co2 'm-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B20 - B19\r\n temp = (get_database_material_result_co2 'CIS/CIGS', 'Module Framed Panel', @ph_product) - (get_database_material_result_co2 'CIS/CIGS', 'Module Laminate', @ph_product) \r\n end \r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = 0 \r\n end \r\n @ph_result.framing = temp * @ph_product.ph_intermediate_result.module_area\r\n end\r\n \r\n # ph_result mounting\r\n @ph_result.mounting = 0 \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted'\r\n #B24\r\n temp = get_database_material_result_co2 'Mounting', 'Roof Mounted Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #B25\r\n temp = get_database_material_result_co2 'Mounting', 'Roof Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #B27\r\n temp = get_database_material_result_co2 'Mounting', 'Facade Mounted Structures', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated'\r\n #B28\r\n temp = get_database_material_result_co2 'Mounting', 'Facade Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #B26\r\n temp = get_database_material_result_co2 'Mounting', 'Open Ground Structures', @ph_product\r\n end \r\n @ph_result.mounting = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n \r\n # ph_result inverter\r\n @ph_result.inverter = 0 \r\n if @ph_product.ph_electric_component.quantity_1 != 0\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_result.inverter += temp * @ph_product.ph_electric_component.quantity_1\r\n end\r\n if @ph_product.ph_electric_component.quantity_2 != 0\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_result.inverter += temp * @ph_product.ph_electric_component.quantity_2\r\n end\r\n \r\n \r\n # ph_result batteries\r\n @ph_result.batteries = 0 \r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_result.batteries = @ph_product.ph_electric_component.separated_battery * pes_1 * pes_2\r\n \r\n # ph_result maintenance\r\n @ph_result.maintenance = 0 \r\n \r\n \r\n @ph_result.co2_total = @ph_result.cabling + @ph_result.module + @ph_result.framing + @ph_result.mounting + @ph_result.inverter + @ph_result.batteries\r\n \r\n \r\n ###########\r\n ### MAINTENANCE\r\n #########\r\n \r\n @ph_maintenance_result.years_included = 0\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_5'\r\n @ph_maintenance_result.years_included = 5\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_10'\r\n @ph_maintenance_result.years_included = 10\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_15'\r\n @ph_maintenance_result.years_included = 15\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_20'\r\n @ph_maintenance_result.years_included = 20\r\n end\r\n \r\n # boolean\r\n @ph_maintenance_result.inverter_replacement = 0\r\n if @ph_maintenance_result.years_included != 0\r\n if @ph_product.ph_maintenance.replacement_inverters == 'yes'\r\n @ph_maintenance_result.inverter_replacement = 1 \r\n end \r\n end\r\n\r\n # boolean\r\n @ph_maintenance_result.batteries_replacement = 0\r\n if @ph_product.ph_maintenance.replacement_batteries == 'yes'\r\n @ph_maintenance_result.batteries_replacement = 1 \r\n end \r\n \r\n @ph_maintenance_result.tap_water_l = 0\r\n if @ph_product.ph_maintenance.cleaning_modules == 'yes'\r\n @ph_maintenance_result.tap_water_l = 3.25\r\n end\r\n \r\n @ph_maintenance_result.tap_water_co2 = 0\r\n #b38\r\n temp = get_database_material_result_co2 'Maintenance', 'Tap Water', @ph_product\r\n @ph_maintenance_result.tap_water_co2 = temp * @ph_maintenance_result.tap_water_l\r\n \r\n @ph_maintenance_result.tap_water_pe = 0\r\n #c38\r\n temp = get_database_material_result_pe 'Maintenance', 'Tap Water', @ph_product\r\n @ph_maintenance_result.tap_water_pe = temp * @ph_maintenance_result.tap_water_l\r\n \r\n \r\n @ph_maintenance_result.needed_cycles_1 = 0\r\n if @ph_product.ph_electric_component.inverter_size_1 != 0 && @ph_product.ph_electric_component.quantity_1 != 0 \r\n if @ph_maintenance_result.inverter_replacement == 1 \r\n @ph_maintenance_result.needed_cycles_1 = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.lifetime_1) - 1\r\n if @ph_maintenance_result.needed_cycles_1 < 0\r\n @ph_maintenance_result.needed_cycles_1 = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_1 = @ph_maintenance_result.needed_cycles_1.ceil \r\n end\r\n end\r\n end\r\n @ph_maintenance_result.needed_replacements_1 = @ph_maintenance_result.needed_cycles_1 * @ph_product.ph_electric_component.quantity_1\r\n \r\n @ph_maintenance_result.embodied_co2_1 = 0\r\n # B29\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_maintenance_result.embodied_co2_1 = temp * @ph_maintenance_result.needed_replacements_1 \r\n @ph_maintenance_result.embodied_pe_1 = 0\r\n # C29\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_maintenance_result.embodied_pe_1 = temp * @ph_maintenance_result.needed_replacements_1\r\n\r\n \r\n @ph_maintenance_result.needed_cycles_2 = 0\r\n if @ph_product.ph_electric_component.inverter_size_2 != 0 && @ph_product.ph_electric_component.quantity_2 != 0 \r\n if @ph_maintenance_result.inverter_replacement == 1 \r\n @ph_maintenance_result.needed_cycles_2 = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.lifetime_2) - 1\r\n if @ph_maintenance_result.needed_cycles_2 < 0\r\n @ph_maintenance_result.needed_cycles_2 = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_2 = @ph_maintenance_result.needed_cycles_2.ceil\r\n end \r\n end\r\n end\r\n @ph_maintenance_result.needed_replacements_2 = @ph_maintenance_result.needed_cycles_2 * @ph_product.ph_electric_component.quantity_2\r\n \r\n @ph_maintenance_result.embodied_co2_2 = 0\r\n # B29\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_maintenance_result.embodied_co2_2 = temp * @ph_maintenance_result.needed_replacements_2\r\n \r\n @ph_maintenance_result.embodied_pe_2 = 0\r\n # C29\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_maintenance_result.embodied_pe_2 = temp * @ph_maintenance_result.needed_replacements_2\r\n \r\n \r\n \r\n @ph_maintenance_result.driven_maintenance = 2 * @ph_product.ph_maintenance.distance\r\n @ph_maintenance_result.driven_year = @ph_maintenance_result.driven_maintenance * @ph_product.ph_maintenance.yearly_frequency\r\n @ph_maintenance_result.driven_contract = @ph_maintenance_result.driven_year * @ph_maintenance_result.years_included\r\n \r\n @ph_maintenance_result.embodied_co2_transport = 0 \r\n #B35\r\n temp = get_database_material_result_co2 'Maintenance', 'Average Car Driving', @ph_product\r\n @ph_maintenance_result.embodied_co2_transport = @ph_maintenance_result.driven_contract * temp\r\n \r\n @ph_maintenance_result.embodied_pe_transport = 0\r\n #C35\r\n temp = get_database_material_result_pe 'Maintenance', 'Average Car Driving', @ph_product\r\n @ph_maintenance_result.embodied_pe_transport = @ph_maintenance_result.driven_contract * temp\r\n \r\n @ph_maintenance_result.embodied_co2_cleaning = @ph_product.ph_intermediate_result.module_area * @ph_maintenance_result.tap_water_co2\r\n @ph_maintenance_result.embodied_pe_cleaning = @ph_product.ph_intermediate_result.module_area * @ph_maintenance_result.tap_water_pe\r\n @ph_maintenance_result.total_embodied_co2_cleaning = @ph_maintenance_result.embodied_co2_cleaning * @ph_maintenance_result.years_included * @ph_product.ph_maintenance.yearly_frequency\r\n @ph_maintenance_result.total_embodied_pe_cleaning = @ph_maintenance_result.embodied_pe_cleaning * @ph_maintenance_result.years_included * @ph_product.ph_maintenance.yearly_frequency\r\n \r\n @ph_maintenance_result.needed_cycles_batteries = 0\r\n if @ph_maintenance_result.batteries_replacement == 1\r\n @ph_maintenance_result.needed_cycles_batteries = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.battery_lifetime) - 1\r\n if @ph_maintenance_result.needed_cycles_batteries < 0\r\n @ph_maintenance_result.needed_cycles_batteries = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_batteries = @ph_maintenance_result.needed_cycles_batteries.ceil\r\n end \r\n end\r\n \r\n @ph_maintenance_result.needed_replacements_batteries = @ph_maintenance_result.needed_cycles_batteries * @ph_product.ph_electric_component.separated_battery\r\n \r\n @ph_maintenance_result.embodied_co2_batteries = 0\r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n #B32 \r\n temp_2 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_maintenance_result.embodied_co2_batteries = @ph_maintenance_result.needed_replacements_batteries * temp * temp_2\r\n \r\n @ph_maintenance_result.embodied_pe_batteries = 0 \r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n #C32 \r\n temp_2 = get_database_material_result_pe 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_maintenance_result.embodied_pe_batteries = @ph_maintenance_result.needed_replacements_batteries * temp * temp_2\r\n \r\n @ph_maintenance_result.embodied_carbon_dioxide = 0\r\n @ph_maintenance_result.embodied_primary_energy = 0\r\n if @ph_product.ph_maintenance.maintenance_needs != 'no'\r\n @ph_maintenance_result.embodied_carbon_dioxide = @ph_maintenance_result.embodied_co2_1 + @ph_maintenance_result.embodied_co2_2 + @ph_maintenance_result.embodied_co2_transport + @ph_maintenance_result.total_embodied_co2_cleaning + @ph_maintenance_result.embodied_co2_batteries\r\n @ph_maintenance_result.embodied_primary_energy = @ph_maintenance_result.embodied_pe_1 + @ph_maintenance_result.embodied_pe_2 + @ph_maintenance_result.embodied_pe_transport + @ph_maintenance_result.total_embodied_pe_cleaning + @ph_maintenance_result.embodied_pe_batteries \r\n end\r\n @ph_result.maintenance = @ph_maintenance_result.embodied_carbon_dioxide\r\n @ph_embedded_result.pe_maintenance = @ph_maintenance_result.embodied_primary_energy\r\n ##########\r\n ### EMBEDDED\r\n ##########\r\n\r\n @ph_embedded_result.lifetime_saved = @ph_result.lifetime * 3.6 / @ph_product.ph_basic_information.conversion_factor\r\n \r\n @ph_embedded_result.pe_pv_cabling = 0\r\n temp = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted' || @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #C22\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Roof Mounted System', @ph_product \r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated' || @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #C21\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Facade Mounted System', @ph_product\r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #C23\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Ground Mounted System', @ph_product\r\n end \r\n @ph_embedded_result.pe_pv_cabling = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n \r\n @ph_embedded_result.pe_pv_module = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B17\r\n temp = get_database_material_result_pe 'a-Si', 'Module Laminate', @ph_product\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B15\r\n temp = get_database_material_result_pe 'p-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B8\r\n temp = get_database_material_result_pe 'm-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = get_database_material_result_pe 'CdTe', 'Thinfilm', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B19\r\n temp = get_database_material_result_pe 'CIS/CIGS', 'Module Laminate', @ph_product \r\n end\r\n @ph_embedded_result.pe_pv_module = temp * @ph_product.ph_intermediate_result.module_area \r\n \r\n @ph_embedded_result.pe_pv_framing = 0\r\n if @ph_product.ph_basic_information.framed == 'yes'\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B18 - B17\r\n temp = (get_database_material_result_pe 'a-Si', 'Module Framed Panel', @ph_product) - (get_database_material_result_pe 'a-Si', 'Module Laminate', @ph_product)\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B14\r\n temp = get_database_material_result_pe 'p-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B7\r\n temp = get_database_material_result_pe 'm-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B20 - B19\r\n temp = (get_database_material_result_pe 'CIS/CIGS', 'Module Framed Panel', @ph_product) - (get_database_material_result_pe 'CIS/CIGS', 'Module Laminate', @ph_product) \r\n end \r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = 0 \r\n end \r\n @ph_embedded_result.pe_pv_framing = temp * @ph_product.ph_intermediate_result.module_area\r\n end\r\n \r\n @ph_embedded_result.pe_pv_mounting = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted'\r\n #B24\r\n temp = get_database_material_result_pe 'Mounting', 'Roof Mounted Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #B25\r\n temp = get_database_material_result_pe 'Mounting', 'Roof Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #B27\r\n temp = get_database_material_result_pe 'Mounting', 'Facade Mounted Structures', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated'\r\n #B28\r\n temp = get_database_material_result_pe 'Mounting', 'Facade Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #B26\r\n temp = get_database_material_result_pe 'Mounting', 'Open Ground Structures', @ph_product\r\n end \r\n @ph_embedded_result.pe_pv_mounting = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n @ph_embedded_result.pe_inverter = 0\r\n if @ph_product.ph_electric_component.quantity_1 != 0\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_embedded_result.pe_inverter += temp * @ph_product.ph_electric_component.quantity_1\r\n end\r\n if @ph_product.ph_electric_component.quantity_2 != 0\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_embedded_result.pe_inverter += temp * @ph_product.ph_electric_component.quantity_2\r\n end\r\n \r\n \r\n @ph_embedded_result.pe_batteries = 0\r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_pe 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n @ph_embedded_result.pe_batteries = @ph_product.ph_electric_component.separated_battery * pes_1 * pes_2\r\n \r\n \r\n \r\n @ph_embedded_result.embedded_energy_total = @ph_embedded_result.pe_pv_cabling + @ph_embedded_result.pe_pv_module + @ph_embedded_result.pe_pv_framing + @ph_embedded_result.pe_pv_mounting + @ph_embedded_result.pe_inverter + @ph_embedded_result.pe_batteries + @ph_embedded_result.pe_maintenance \r\n \r\n \r\n @ph_embedded_result.peak_power = @ph_product.ph_intermediate_result.module_area * calcul_efficiency / 100\r\n @ph_embedded_result.lifetime_production = @ph_result.lifetime\r\n @ph_embedded_result.averaged_power = @ph_embedded_result.lifetime_production / @ph_product.ph_specified.lifetime\r\n @ph_embedded_result.averaged_consumption = @ph_embedded_result.averaged_power * 3.6 / @ph_product.ph_basic_information.conversion_factor \r\n @ph_embedded_result.system_emb = @ph_embedded_result.embedded_energy_total\r\n @ph_embedded_result.energy_payback = @ph_embedded_result.embedded_energy_total / @ph_embedded_result.averaged_consumption\r\n @ph_embedded_result.energy_yield = @ph_embedded_result.lifetime_saved / @ph_embedded_result.embedded_energy_total\r\n @ph_embedded_result.emb_co2 = @ph_result.cabling + @ph_result.inverter + @ph_result.batteries \r\n# @ph_embedded_result.estim_co2 = 1000 * @ph_result.co2_total / @ph_embedded_result.lifetime_production\r\n \r\n\r\n\r\n \r\n \r\n \r\n @ph_result.co2_total += @ph_result.maintenance\r\n @ph_embedded_result.estim_co2 = 1000 * @ph_result.co2_total / @ph_result.lifetime\r\n @ph_embedded_result.net_saved_co2 = @ph_embedded_result.lifetime_production * (@ph_product.ph_basic_information.co2_factor - @ph_embedded_result.estim_co2) / 1000 \r\n \r\n @ph_product.ph_result.save\r\n @ph_product.ph_embedded_result.save\r\n @ph_product.ph_maintenance_result.save\r\n end \r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml\r\n end\r\n end",
"title": ""
},
{
"docid": "bc77b4b47a0aadbde91962495ec596f6",
"score": "0.4734355",
"text": "def perform\n update_null = \" or (stock is null and last_stock_reported_centry is not null)\"\n query = \"stock <> last_stock_reported_centry or ((stock is not null and last_stock_reported_centry is null)#{update_null if ENV[\"UPDATE_NULL_STOCK\"] == \"false\"})\"\n\n ::Product.where(query).each do |local_product|\n resp = centry.put('/conexion/v1/variants/sku.json', {}, {\"sku\": local_product[:sku], \"quantity\": local_product[:stock]})\n if (resp.code == \"200\")\n centry_variant_info = JSON.parse(resp.body)\n local_product[:last_stock_reported_centry] = centry_variant_info[\"quantity\"]\n local_product[:id_product_centry] = centry_variant_info[\"product_id\"]\n local_product.save!\n end\n end\n end",
"title": ""
},
{
"docid": "a5ade972fae2ab866d733fdfc8b59b5e",
"score": "0.47325107",
"text": "def convert\n STDERR.print \"\\nThis may take 10 minutes or more. Lines processed: \"\n line_in_count = 0\n\n # Create an object to store *all* lines of the *output* CSV\n @csv_out_data = FasterCSV.generate(FCSV_OUT_OPTS){|csv_out| \n\n # Iterate thru each *input* line\n FasterCSV.foreach(@in_file, FCSV_IN_OPTS) {|line_in|\n line_in_count += 1\n if line_in_count == 1\n self.class.verify_csv_in_headers(line_in.headers)\n @csv_out_headers = WILL_INCLUDE_INPUT_COLUMNS ? CSV_OUT_COLUMNS + CSV_IN_COLUMNS : CSV_OUT_COLUMNS\n end\n\n # Iterate thru each *output* column\n line_out = []\n @csv_out_headers.each_with_index{|col,i|\n csv_out << @csv_out_headers if line_in_count == 1 && i == 0\t# Header line\n\n case col\n when RmidItem, PrefixColOwner, PrefixColList\n line_out << line_in[col]\n when HdlItem\n line_out << get_handle_for_rmid(line_in[RmidItem])\n when HdlColOwner\n line_out << get_handle_for_collection_prefix(line_in[PrefixColOwner])\n when HdlColList\n if line_in[PrefixColList]\n prefixes = line_in[PrefixColList].split(VALUE_DELIMITER)\n handles = prefixes.inject([]){|a,prefix| a << get_handle_for_collection_prefix(prefix)}\n line_out << handles.join(VALUE_DELIMITER)\n else\n line_out << \"\"\n end\n end\n }\n csv_out << line_out\n STDERR.print \"#{line_in_count} \" if line_in_count % 200 == 0\n }\n }\n STDERR.puts \"; Total lines #{line_in_count} \"\n end",
"title": ""
},
{
"docid": "d3f7f667fb8f0ef74413189143a88453",
"score": "0.47214493",
"text": "def csv risks\n\t\t\t\trisks.order(:cvss_base_score).each do |plugin|\n\t\t\t\t\titems = Item.where(:plugin_id => plugin.id)\n\n\t\t\t\t\titems.each do |item|\n\t\t\t\t\t\thost = Host.where(:id => item.host_id).first\n\n\t\t\t\t\t\t@output.text \"#{host.ip}, #{host.fqdn}, #{host.netbios}, #{item.plugin_name}, #{plugin.risk_factor}\"\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "652493c3af24e9d0bdb6f7db31c919f7",
"score": "0.4719334",
"text": "def organise_data\n # Single big csv file where we want to aggregate all data\n outfile = File.open('energy-consumption.csv', 'w')\n\n # Columns we want to have in the output file:\n # * category = {commercial, residential}\n # * type = {restaurant, hospital, retail, etc.}\n # * name = name of the building (generally just the city where it is located)\n # * date = date of the year\n # * time = time of the day (hour by hour)\n # * energy = measured energy consuption for that date and hour\n outfile.puts('category,type,name,date,time,energy')\n \n rw_commercial_buildings_data(outfile)\n rw_residential_buildings_data(outfile)\n \n outfile.close\nend",
"title": ""
},
{
"docid": "fcf869c732113724a68d5dc05cc9a87f",
"score": "0.47182843",
"text": "def save_records\n @job_condition = job_condition\n find_type\n prepare_batch\n\n if @batch\n @image_count = 1 if @job_condition\n @batch.inbound_file_information = @inbound_file_information if @inbound_file_information\n\n images = prepare_image\n images.each{|image| @batch.images_for_jobs << image}\n\n prepare_job\n @batch.jobs << @job if @job_condition\n images.each{|image| @job.images_for_jobs << image}\n\n if @job_condition\n check = prepare_cheque\n @job.check_number = '0' if check.check_amount == 0.0\n @job.check_informations << check\n @job.initial_image_name = @initial_image_name\n micr = prepare_micr\n if micr\n payer = micr.payer\n check.payer_id = micr.payer_id if micr.payer_id\n if !facility.payer_ids_to_exclude.blank?\n @job.job_status = JobStatus::EXCLUDED if payer && payer.excluded?(facility)\n elsif !facility.payer_ids_to_include.blank?\n @job.job_status = JobStatus::EXCLUDED if !facility.included_payers.include?(payer)\n end\n micr.check_informations << check\n end\n end\n \n if @batch.save\n if @job.save\n images.each do |image|\n if image.save\n InputBatch.log.debug \"Image #{image.filename} id #{image.id} batch id #{image.batch.id} job id #{image.jobs.first.id} successfully loaded\"\n puts \"Image #{image.filename} successfully loaded\"\n end\n end\n\n total_number_of_images = number_of_pages(@job)\n check_number = check.check_number if !check.blank?\n estimated_eob = @job.estimated_no_of_eobs(total_number_of_images, micr, check_number)\n @job.update_attributes(:estimated_eob => estimated_eob, :pages_to => total_number_of_images)\n\n if @job_condition and check.save\n InputBatch.log.debug \"Check id #{check.id}, check_number #{check.check_number}, Job id #{check.job.id}, batch id #{check.job.batch.id} successfully loaded\"\n if micr and micr.save\n InputBatch.log.debug \"Check #{check.id} associated to micr #{check.micr_line_information.id}\"\n @job.save_payer_group(micr)\n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "464774580b903c4fb9288c13a3410eb7",
"score": "0.47175685",
"text": "def perform\n $stdout.write \"Outputting file to #{filepath_string}\\n\"\n CSV.open(filepath_string, \"wb\") do |csv|\n csv << output_header_row\n orders.each do |order|\n csv << order.output_row\n end\n end\n end",
"title": ""
},
{
"docid": "edb312b490f72fd637149e884ba628fe",
"score": "0.4717568",
"text": "def export\n @entries = []\n lines = []\n lines << \"Rating Diff,Score Diff\"\n @games = Game.where('home_score >= 0')\n stat_entries = StatEntry.where(stat_id: @stat.id)\n @games.each do |game|\n home_team = Team.where(short_name: game.home_team)[0]\n away_team = Team.where(short_name: game.away_team)[0]\n\n home_stat_entry = StatEntry.where(stat_id: @stat.id, week: game.week-1, year: game.year, team_id: home_team.id)[0]\n away_stat_entry = StatEntry.where(stat_id: @stat.id, week: game.week-1, year: game.year, team_id: away_team.id)[0]\n\n if home_stat_entry and away_stat_entry\n if home_stat_entry.rating\n if home_stat_entry.rating - 2*home_stat_entry.rating_deviation > away_stat_entry.rating + 2*away_stat_entry.rating_deviation\n lines << \"#{home_stat_entry.rating - away_stat_entry.rating},#{game.home_score - game.away_score}\"\n end\n if away_stat_entry.rating - 2*away_stat_entry.rating_deviation > home_stat_entry.rating + 2*home_stat_entry.rating_deviation\n lines << \"#{away_stat_entry.rating - home_stat_entry.rating},#{game.away_score - game.home_score}\"\n end\n end\n end\n end\n\n csv_string = lines.join(\"\\n\")\n\n respond_to do |format|\n format.html { render :export }\n format.json { render json: @entries }\n format.csv { send_data(csv_string, :filename => \"#{@stat.name.camelize}.csv\", :type => \"text/csv\") }\n end\n\n end",
"title": ""
},
{
"docid": "a7f6e7f4ee8cb5ef63fc836479ae4f60",
"score": "0.47125223",
"text": "def run_job(job)\r\n @log = Logger.new(File.expand_path(\"#{Rails.root}/log/scraper_job.log\", __FILE__))\r\n @log.info(\"Job started\")\r\n \r\n # initial job parameters\r\n region_list = JSON.parse(self.target_region_list)\r\n days_to_gather = self.days_to_gather\r\n size_of_a_day = 86400 # epoch time units (86400 is equal to 24 hours)\r\n size_of_a_time_slice = 10800 # epoch time units (10800 is equal to 3 hours)\r\n \r\n # start gathering from the beginning of the current day\r\n initial_start_time = Time.new(Time.now.year, Time.now.month, Time.now.day).to_i\r\n number_of_time_slices = ((days_to_gather * size_of_a_day) / size_of_a_time_slice).to_i\r\n \r\n job.log.concat(\"\\n#{Time.now.strftime(\"%F %T %Z\")}: > #{self.class} started (id:#{self.id})\")\r\n job.log.concat(\"\\n#{Time.now.strftime(\"%F %T %Z\")}: > The Epoch Start Time: #{initial_start_time}\")\r\n job.log.concat(\"\\n#{Time.now.strftime(\"%F %T %Z\")}: > The Formatted Start Time: #{Time.at(initial_start_time).strftime(\"%c\")}\")\r\n job.save\r\n \r\n # iterate each region\r\n region_list.each {|region_name,region_lookup| \r\n #validate a region exists\r\n region = Region.find_by name: region_name\r\n if region\r\n \r\n # run the channel scraper\r\n encoded_uri = URI.encode(\"https://www.foxtel.com.au/webepg/ws/foxtel/channels?regionId=\" + region_lookup)\r\n #job.log.concat(\"\\n#{Time.now.strftime(\"%F %T %Z\")}: > The encoded URI for #{region_name} is #{encoded_uri}\")\r\n #job.save\r\n raw_channels_created = 0\r\n raw_channels_skipped = 0\r\n\r\n # access the file and the data_hash\r\n file = URI.parse(encoded_uri)\r\n get_file_count = 0\r\n begin\r\n data_hash = JSON.parse(file.read)\r\n rescue Errno::ECONNRESET => e\r\n get_file_count += 1\r\n retry unless get_file_count > 10\r\n job.log.concat(\"\\n#{Time.now.strftime(\"%F %T %Z\")}: > Tried #{get_file_count} times and couldn't get #{file}: #{e}\")\r\n job.save\r\n @log.error(\"#{e.message}\")\r\n @log.error(\"#{e.backtrace}\")\r\n rescue OpenSSL::SSL::SSLError => e\r\n get_file_count += 1\r\n retry unless get_file_count > 10\r\n job.log.concat(\"\\n#{Time.now.strftime(\"%F %T %Z\")}: > Tried #{get_file_count} times and couldn't get #{file}: #{e}\")\r\n job.save\r\n @log.error(\"#{e.message}\")\r\n @log.error(\"#{e.backtrace}\")\r\n end\r\n\r\n # populate an array of times from the data hash\r\n #@log.debug(\"#{data_hash.inspect}\") \r\n data_hash[\"channels\"].each {|channel_hash|\r\n #@log.debug(\"#{channel_hash.inspect}\")\r\n raw_channel = RawChannel.create_from_channel_hash(region, channel_hash)\r\n if raw_channel.new_record?\r\n raw_channels_skipped += 1\r\n else\r\n raw_channels_created += 1\r\n end\r\n }\r\n job.log.concat(\"\\n#{Time.now.strftime(\"%F %T %Z\")}: > Raw Channels Created: #{raw_channels_created}, Skipped: #{raw_channels_skipped}, Total: #{raw_channels_skipped + raw_channels_created} for #{region_name}(#{region_lookup.to_s}).\")\r\n job.save\r\n \r\n # run the program scraper\r\n raw_programs_created = 0\r\n raw_programs_skipped = 0\r\n \r\n number_of_time_slices.times do |i|\r\n start_time = Time.at(initial_start_time + (i* size_of_a_time_slice))\r\n end_time = Time.at(start_time.to_i + size_of_a_time_slice)\r\n encoded_uri = URI.encode(\"https://www.foxtel.com.au/webepg/ws/foxtel/grid/events?startDate=\" + start_time.to_i.to_s + \"000&endDate=\" + end_time.to_i.to_s + \"000®ionId=\" + region_lookup)\r\n #job.log.concat(\"\\n#{Time.now.strftime(\"%F %T %Z\")}: > The encoded URI is #{encoded_uri}\")\r\n #job.save\r\n \r\n # access the file and the data_hash\r\n file = URI.parse(encoded_uri)\r\n get_file_count = 0\r\n begin\r\n data_hash = JSON.parse(file.read)\r\n rescue Errno::ECONNRESET => e\r\n get_file_count += 1\r\n retry unless get_file_count > 10\r\n job.log.concat(\"\\n#{Time.now.strftime(\"%F %T %Z\")}: > Tried #{get_file_count} times and couldn't get #{file}: #{e}\")\r\n job.save\r\n @log.error(\"#{e.message}\")\r\n @log.error(\"#{e.backtrace}\")\r\n rescue OpenSSL::SSL::SSLError => e\r\n get_file_count += 1\r\n retry unless get_file_count > 10\r\n job.log.concat(\"\\n#{Time.now.strftime(\"%F %T %Z\")}: > Tried #{get_file_count} times and couldn't get #{file}: #{e}\")\r\n job.save\r\n @log.error(\"#{e.message}\")\r\n @log.error(\"#{e.backtrace}\")\r\n end\r\n \r\n # populate an array of times from the data hash\r\n #@log.debug(\"#{data_hash.inspect}\")\r\n data_hash[\"channelEventsByTag\"].each {|channel_events|\r\n #@log.debug(\"#{program_array.inspect}\")\r\n channel_tag = channel_events[0]\r\n channel = Channel.find_by_tag(channel_tag)\r\n raw_channel = RawChannel.find_by_channel_tag_and_region_name(channel_tag,region_name)\r\n if channel.nil? and raw_channel.nil?\r\n # no channel or raw channel\r\n job.log.concat(\"\\n#{Time.now.strftime(\"%F %T %Z\")}: > The channel record and raw_channel record for #{channel_tag} in #{region_name} does not exist!\")\r\n job.save\r\n else\r\n # channel is ok\r\n array_of_channel_events = channel_events[1]\r\n #job.log.concat(\"\\n#{Time.now.strftime(\"%F %T %Z\")}: > Processing #{array_of_channel_events.length} channel events for channel #{channel.name} for #{region_name}.\")\r\n #job.save \r\n array_of_channel_events.each { |channel_event|\r\n raw_program = RawProgram.create_from_channel_event(region, channel_tag, channel_event)\r\n if raw_program.new_record?\r\n raw_programs_skipped += 1\r\n else\r\n raw_programs_created += 1\r\n end \r\n } \r\n end\r\n }\r\n end\r\n job.log.concat(\"\\n#{Time.now.strftime(\"%F %T %Z\")}: > Raw Programs Created #{raw_programs_created}, Skipped: #{raw_programs_skipped}, Total: #{raw_programs_created + raw_programs_skipped} for #{region_name}(#{region_lookup.to_s}).\")\r\n job.save\r\n else\r\n # no region\r\n job.log.concat(\"\\n#{Time.now.strftime(\"%F %T %Z\")}: > The region record for #{region_name} does not exist!\")\r\n job.save\r\n end\r\n }\r\n \r\n job.log.concat(\"\\n#{Time.now.strftime(\"%F %T %Z\")}: > #{self.class} completed (id:#{self.id})\")\r\n job.save\r\n \r\n @log.info(\"#{self.class} completed (id:#{self.id})\")\r\n return true\r\n end",
"title": ""
},
{
"docid": "0fedaea69c923386931211f7cc737cf3",
"score": "0.4712262",
"text": "def summary\r\n \r\n @ph_product = PhProduct.find(params[:ph_result_id])\r\n \r\n add_breadcrumb _(\"My products\").html_safe, :products_url\r\n add_breadcrumb @ph_product.product.name, edit_product_url(@ph_product.product)\r\n add_breadcrumb _(\"Environmental Assessment\").html_safe, ph_production_init_path(@ph_product)\r\n add_breadcrumb _(\"Results\").html_safe, ph_result_summary_path(@ph_product)\r\n \r\n @product = @ph_product.product\r\n @step = 1 \r\n if @ph_product.ph_intermediate_result \r\n if !@ph_product.ph_result\r\n ph_result = PhResult.new \r\n ph_result.ph_product_id = @ph_product.id\r\n ph_result.save\r\n @ph_product.ph_result = ph_result\r\n end\r\n @ph_result = @ph_product.ph_result\r\n if !@ph_product.ph_maintenance_result \r\n ph_maintenance_result = PhMaintenanceResult.new \r\n ph_maintenance_result.ph_product_id = @ph_product.id\r\n ph_maintenance_result.save\r\n @ph_product.ph_maintenance_result = ph_maintenance_result \r\n end\r\n @ph_maintenance_result = @ph_product.ph_maintenance_result \r\n if !@ph_product.ph_embedded_result \r\n ph_embedded_result = PhEmbeddedResult.new \r\n ph_embedded_result.ph_product_id = @ph_product.id\r\n ph_embedded_result.save\r\n @ph_product.ph_embedded_result = ph_embedded_result \r\n end\r\n @ph_embedded_result = @ph_product.ph_embedded_result \r\n \r\n\r\n @ph_embedded_result.temperature_induced = 0\r\n temp = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n temp = -0.13\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n temp = -0.4465\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n temp = -0.402545\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n temp = -0.25 \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n temp = -0.43666\r\n end \r\n \r\n # =(Assumptions!$I$11-25)*IF(Assumptions!G19=Menues!A2,Menues!A122,IF(Assumptions!G19=Menues!A3,Menues!B122,IF(Assumptions!G19=Menues!A4,Menues!C122,IF(Assumptions!G19=Menues!A5,Menues!D122,IF(Assumptions!G19=Menues!A6,Menues!E122,0))))) \r\n \r\n @ph_embedded_result.temperature_induced = temp * (@ph_product.ph_basic_information.temperature - 25) \r\n calcul_efficiency = @ph_product.ph_specified.efficiency * (1 + (@ph_embedded_result.temperature_induced / 100))\r\n \r\n ph_database_material_values = PhDatabaseMaterialValue.find(:all, :conditions => [\"ph_product_id = ?\", @ph_product.id])\r\n ph_database_material_values.each do |ph_database_material_value|\r\n ph_database_material_value.delete\r\n end \r\n \r\n\r\n @ph_database_materials = PhDatabaseMaterial.all \r\n @ph_database_materials.each do |ph_database_material|\r\n if ph_database_material.default_value_co2 == 0\r\n calculate_co2 ph_database_material, @ph_product\r\n end\r\n if ph_database_material.default_value_pe == 0\r\n calculate_pe ph_database_material, @ph_product\r\n end \r\n end\r\n @ph_database_material_values = PhDatabaseMaterialValue.find(:all, :conditions => [\"ph_product_id = ?\", @ph_product.id])\r\n \r\n n49 = 0\r\n if @ph_product.ph_specified.area_unit\r\n n49 = @ph_product.ph_specified.area * @ph_product.ph_specified.area_unit.conversion_factor\r\n end \r\n # ph_result lifetime\r\n \r\n if @ph_product.ph_basic_information.known == 'both' || @ph_product.ph_basic_information.known == 'power_demand'\r\n #Menues!N56*Assumptions!F39\r\n @ph_result.lifetime = 0\r\n n56 = 0\r\n #=IF($Assumptions.G19=$Menues.A7;0;\r\n if @ph_product.ph_specified.ph_module_type.name != 'Not specified'\r\n if @ph_product.ph_specified.power_unit.conversion_factor == -1 \r\n # Peak Power [kWp]\r\n conversion_factor = @ph_product.ph_basic_information.radiation * @ph_product.ph_basic_information.performance_ratio\r\n n56 = @ph_product.ph_specified.power * conversion_factor\r\n else \r\n n56 = @ph_product.ph_specified.power * @ph_product.ph_specified.power_unit.conversion_factor\r\n end \r\n @ph_result.lifetime = n56 * @ph_product.ph_specified.lifetime\r\n end\r\n else \r\n #Menues!N49*(Assumptions!F38/100)*Assumptions!I15*Assumptions!I9*Assumptions!F39 \r\n @ph_result.lifetime = n49 * (calcul_efficiency / 100) * @ph_product.ph_basic_information.performance_ratio * @ph_product.ph_basic_information.radiation * @ph_product.ph_specified.lifetime\r\n end\r\n # New requirement\r\n if @ph_product.ph_basic_information.working == 'yes' && @ph_product.ph_basic_information.know_power == 'yes' \r\n @ph_result.lifetime = @ph_product.ph_basic_information.user_power * @ph_product.ph_specified.lifetime\r\n end \r\n\r\n \r\n #IF($Assumptions.E35=$Menues.G41;$Assumptions.D35*$Menues.E60;IF($Assumptions.E35=$Menues.G42;$Assumptions.D35;IF($Assumptions.E35=G43;$Menues.E59*$Assumptions.D35;IF($Assumptions.E35=$Menues.G44;$Menues.E58*$Assumptions.D35;IF($Assumptions.E35=$Menues.G45;$Menues.E61*$Assumptions.D35;0)))));0))\r\n \r\n\r\n @ph_result.cabling = 0\r\n temp = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted' || @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Roof Mounted System', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated' || @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Facade Mounted System', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n temp = get_database_material_result_co2 'Electrical Cabling', 'Ground Mounted System', @ph_product\r\n end\r\n\r\n @ph_result.cabling = temp * @ph_product.ph_intermediate_result.module_area\r\n\r\n @ph_result.module = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B17\r\n temp = get_database_material_result_co2 'a-Si', 'Module Laminate', @ph_product\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B15\r\n temp = get_database_material_result_co2 'p-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B8\r\n temp = get_database_material_result_co2 'm-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = get_database_material_result_co2 'CdTe', 'Thinfilm', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B19\r\n temp = get_database_material_result_co2 'CIS/CIGS', 'Module Laminate', @ph_product \r\n end\r\n @ph_result.module = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n # =(IF(Assumptions!$G$19=Menues!$A$5,'Database Materials'!B$2,IF(Assumptions!$G$19=Menues!$A$2,'Database Materials'!B$17,IF(Assumptions!$G$19=Menues!$A$3,'Database Materials'!B$15,IF(Assumptions!$G$19=Menues!$A$4,'Database Materials'!B$8,IF(Assumptions!$G$19=Menues!$A$6,'Database Materials'!B$19,0))))))*Assumptions!$I$68 \r\n\r\n @ph_result.framing = 0\r\n if @ph_product.ph_basic_information.framed == 'yes'\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B18 - B17\r\n temp = (get_database_material_result_co2 'a-Si', 'Module Framed Panel', @ph_product) - (get_database_material_result_co2 'a-Si', 'Module Laminate', @ph_product)\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B14\r\n temp = get_database_material_result_co2 'p-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B7\r\n temp = get_database_material_result_co2 'm-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B20 - B19\r\n temp = (get_database_material_result_co2 'CIS/CIGS', 'Module Framed Panel', @ph_product) - (get_database_material_result_co2 'CIS/CIGS', 'Module Laminate', @ph_product) \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = 0 \r\n end\r\n @ph_result.framing = temp * @ph_product.ph_intermediate_result.module_area\r\n end\r\n \r\n # ph_result mounting\r\n @ph_result.mounting = 0 \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted'\r\n #B24\r\n temp = get_database_material_result_co2 'Mounting', 'Roof Mounted Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #B25\r\n temp = get_database_material_result_co2 'Mounting', 'Roof Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #B27\r\n temp = get_database_material_result_co2 'Mounting', 'Facade Mounted Structures', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated'\r\n #B28\r\n temp = get_database_material_result_co2 'Mounting', 'Facade Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #B26\r\n temp = get_database_material_result_co2 'Mounting', 'Open Ground Structures', @ph_product\r\n end \r\n @ph_result.mounting = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n \r\n # ph_result inverter\r\n @ph_result.inverter = 0 \r\n if @ph_product.ph_electric_component.quantity_1 != 0\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_result.inverter += temp * @ph_product.ph_electric_component.quantity_1\r\n end\r\n if @ph_product.ph_electric_component.quantity_2 != 0\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_result.inverter += temp * @ph_product.ph_electric_component.quantity_2\r\n end\r\n \r\n \r\n # ph_result batteries\r\n @ph_result.batteries = 0\r\n if @ph_product.ph_electric_component.include_batteries == 'yes'\r\n if @ph_product.ph_electric_component.ph_battery_type.name == 'Lead Acid'\r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n else\r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [per kg]', @ph_product\r\n end\r\n if @ph_product.ph_electric_component.separated_battery\r\n @ph_result.batteries = @ph_product.ph_electric_component.separated_battery * pes_1 * pes_2\r\n end\r\n end\r\n # ph_result maintenance\r\n @ph_result.maintenance = 0\r\n \r\n \r\n @ph_result.co2_total = @ph_result.cabling + @ph_result.module + @ph_result.framing + @ph_result.mounting + @ph_result.inverter + @ph_result.batteries\r\n \r\n \r\n ###########\r\n ### MAINTENANCE\r\n #########\r\n \r\n @ph_maintenance_result.years_included = 0\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_5'\r\n @ph_maintenance_result.years_included = 5\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_10'\r\n @ph_maintenance_result.years_included = 10\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_15'\r\n @ph_maintenance_result.years_included = 15\r\n end\r\n if @ph_product.ph_maintenance.maintenance_needs == 'yes_20'\r\n @ph_maintenance_result.years_included = 20\r\n end\r\n \r\n # boolean\r\n @ph_maintenance_result.inverter_replacement = 0\r\n if @ph_maintenance_result.years_included != 0\r\n if @ph_product.ph_maintenance.replacement_inverters == 'yes'\r\n @ph_maintenance_result.inverter_replacement = 1 \r\n end \r\n end\r\n\r\n # boolean\r\n @ph_maintenance_result.batteries_replacement = 0\r\n if @ph_product.ph_maintenance.replacement_batteries == 'yes'\r\n @ph_maintenance_result.batteries_replacement = 1 \r\n end \r\n \r\n @ph_maintenance_result.tap_water_l = 0\r\n if @ph_product.ph_maintenance.cleaning_modules == 'yes'\r\n @ph_maintenance_result.tap_water_l = 3.25\r\n end\r\n \r\n @ph_maintenance_result.tap_water_co2 = 0\r\n #b38\r\n temp = get_database_material_result_co2 'Maintenance', 'Tap Water', @ph_product\r\n @ph_maintenance_result.tap_water_co2 = temp * @ph_maintenance_result.tap_water_l\r\n \r\n @ph_maintenance_result.tap_water_pe = 0\r\n #c38\r\n temp = get_database_material_result_pe 'Maintenance', 'Tap Water', @ph_product\r\n @ph_maintenance_result.tap_water_pe = temp * @ph_maintenance_result.tap_water_l\r\n \r\n \r\n @ph_maintenance_result.needed_cycles_1 = 0\r\n if @ph_product.ph_electric_component.inverter_size_1 != 0 && @ph_product.ph_electric_component.quantity_1 != 0 \r\n if @ph_maintenance_result.inverter_replacement == 1 \r\n @ph_maintenance_result.needed_cycles_1 = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.lifetime_1) - 1\r\n if @ph_maintenance_result.needed_cycles_1 < 0\r\n @ph_maintenance_result.needed_cycles_1 = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_1 = @ph_maintenance_result.needed_cycles_1.ceil \r\n end\r\n end\r\n end\r\n @ph_maintenance_result.needed_replacements_1 = @ph_maintenance_result.needed_cycles_1 * @ph_product.ph_electric_component.quantity_1\r\n \r\n @ph_maintenance_result.embodied_co2_1 = 0\r\n # B29\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_maintenance_result.embodied_co2_1 = temp * @ph_maintenance_result.needed_replacements_1 \r\n @ph_maintenance_result.embodied_pe_1 = 0\r\n # C29\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_maintenance_result.embodied_pe_1 = temp * @ph_maintenance_result.needed_replacements_1\r\n\r\n \r\n @ph_maintenance_result.needed_cycles_2 = 0\r\n if @ph_product.ph_electric_component.inverter_size_2 != 0 && @ph_product.ph_electric_component.quantity_2 != 0 \r\n if @ph_maintenance_result.inverter_replacement == 1 \r\n @ph_maintenance_result.needed_cycles_2 = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.lifetime_2) - 1\r\n if @ph_maintenance_result.needed_cycles_2 < 0\r\n @ph_maintenance_result.needed_cycles_2 = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_2 = @ph_maintenance_result.needed_cycles_2.ceil\r\n end \r\n end\r\n end\r\n @ph_maintenance_result.needed_replacements_2 = @ph_maintenance_result.needed_cycles_2 * @ph_product.ph_electric_component.quantity_2\r\n \r\n @ph_maintenance_result.embodied_co2_2 = 0\r\n # B29\r\n temp = get_database_material_result_co2 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_maintenance_result.embodied_co2_2 = temp * @ph_maintenance_result.needed_replacements_2\r\n \r\n @ph_maintenance_result.embodied_pe_2 = 0\r\n # C29\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_maintenance_result.embodied_pe_2 = temp * @ph_maintenance_result.needed_replacements_2\r\n \r\n \r\n if @ph_product.ph_maintenance.distance\r\n @ph_maintenance_result.driven_maintenance = 2 * @ph_product.ph_maintenance.distance\r\n else\r\n @ph_maintenance_result.driven_maintenance = 0\r\n end\r\n\r\n @ph_maintenance_result.driven_year = 0\r\n if @ph_product.ph_maintenance.yearly_frequency && @ph_maintenance_result.driven_maintenance\r\n @ph_maintenance_result.driven_year = @ph_maintenance_result.driven_maintenance * @ph_product.ph_maintenance.yearly_frequency\r\n end\r\n @ph_maintenance_result.driven_contract = @ph_maintenance_result.driven_year * @ph_maintenance_result.years_included\r\n \r\n @ph_maintenance_result.embodied_co2_transport = 0 \r\n #B35\r\n temp = get_database_material_result_co2 'Maintenance', 'Average Car Driving', @ph_product\r\n @ph_maintenance_result.embodied_co2_transport = @ph_maintenance_result.driven_contract * temp\r\n \r\n @ph_maintenance_result.embodied_pe_transport = 0\r\n #C35\r\n temp = get_database_material_result_pe 'Maintenance', 'Average Car Driving', @ph_product\r\n @ph_maintenance_result.embodied_pe_transport = @ph_maintenance_result.driven_contract * temp\r\n \r\n @ph_maintenance_result.embodied_co2_cleaning = @ph_product.ph_intermediate_result.module_area * @ph_maintenance_result.tap_water_co2\r\n @ph_maintenance_result.embodied_pe_cleaning = @ph_product.ph_intermediate_result.module_area * @ph_maintenance_result.tap_water_pe\r\n\r\n if @ph_product.ph_maintenance.yearly_frequency && @ph_maintenance_result.years_included\r\n @ph_maintenance_result.total_embodied_co2_cleaning = @ph_maintenance_result.embodied_co2_cleaning * @ph_maintenance_result.years_included * @ph_product.ph_maintenance.yearly_frequency\r\n @ph_maintenance_result.total_embodied_pe_cleaning = @ph_maintenance_result.embodied_pe_cleaning * @ph_maintenance_result.years_included * @ph_product.ph_maintenance.yearly_frequency\r\n end\r\n @ph_maintenance_result.needed_cycles_batteries = 0\r\n if @ph_maintenance_result.batteries_replacement == 1\r\n if @ph_maintenance_result.years_included && @ph_product.ph_electric_component.battery_lifetime\r\n @ph_maintenance_result.needed_cycles_batteries = (@ph_maintenance_result.years_included / @ph_product.ph_electric_component.battery_lifetime) - 1\r\n if @ph_maintenance_result.needed_cycles_batteries < 0\r\n @ph_maintenance_result.needed_cycles_batteries = 0\r\n else \r\n @ph_maintenance_result.needed_cycles_batteries = @ph_maintenance_result.needed_cycles_batteries.ceil\r\n end\r\n end\r\n end\r\n\r\n\r\n @ph_maintenance_result.needed_replacements_batteries = 0\r\n if @ph_product.ph_electric_component.separated_battery\r\n @ph_maintenance_result.needed_replacements_batteries = @ph_maintenance_result.needed_cycles_batteries * @ph_product.ph_electric_component.separated_battery\r\n end\r\n\r\n @ph_maintenance_result.embodied_co2_batteries = 0\r\n if @ph_product.ph_electric_component.include_batteries == 'yes'\r\n if @ph_product.ph_electric_component.ph_battery_type.name == 'Lead Acid'\r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n #B32 \r\n temp_2 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n else\r\n #B33\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [kg / pc.]', @ph_product\r\n #B34 \r\n temp_2 = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [per kg]', @ph_product\r\n end \r\n @ph_maintenance_result.embodied_co2_batteries = @ph_maintenance_result.needed_replacements_batteries * temp * temp_2\r\n end\r\n\r\n\r\n @ph_maintenance_result.embodied_pe_batteries = 0\r\n if @ph_product.ph_electric_component.include_batteries == 'yes'\r\n\r\n if @ph_product.ph_electric_component.ph_battery_type.name == 'Lead Acid' \r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n #C32 \r\n temp_2 = get_database_material_result_pe 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n else\r\n #B31\r\n temp = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [kg / pc.]', @ph_product\r\n #C32 \r\n temp_2 = get_database_material_result_pe 'Electrics Battery', 'Lithium Ion [per kg]', @ph_product \r\n end \r\n @ph_maintenance_result.embodied_pe_batteries = @ph_maintenance_result.needed_replacements_batteries * temp * temp_2\r\n end\r\n\r\n\r\n @ph_maintenance_result.embodied_carbon_dioxide = 0\r\n @ph_maintenance_result.embodied_primary_energy = 0\r\n if @ph_product.ph_maintenance.maintenance_needs != 'no'\r\n begin\r\n @ph_maintenance_result.embodied_carbon_dioxide = @ph_maintenance_result.embodied_co2_1 + @ph_maintenance_result.embodied_co2_2 + @ph_maintenance_result.embodied_co2_transport + @ph_maintenance_result.total_embodied_co2_cleaning + @ph_maintenance_result.embodied_co2_batteries\r\n @ph_maintenance_result.embodied_primary_energy = @ph_maintenance_result.embodied_pe_1 + @ph_maintenance_result.embodied_pe_2 + @ph_maintenance_result.embodied_pe_transport + @ph_maintenance_result.total_embodied_pe_cleaning + @ph_maintenance_result.embodied_pe_batteries\r\n rescue\r\n end\r\n end\r\n @ph_result.maintenance = @ph_maintenance_result.embodied_carbon_dioxide\r\n @ph_embedded_result.pe_maintenance = @ph_maintenance_result.embodied_primary_energy\r\n ##########\r\n ### EMBEDDED\r\n ##########\r\n\r\n @ph_embedded_result.lifetime_saved = @ph_result.lifetime * 3.6 / @ph_product.ph_basic_information.conversion_factor\r\n \r\n @ph_embedded_result.pe_pv_cabling = 0\r\n temp = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted' || @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #C22\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Roof Mounted System', @ph_product \r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated' || @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #C21\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Facade Mounted System', @ph_product\r\n end \r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #C23\r\n temp = get_database_material_result_pe 'Electrical Cabling', 'Ground Mounted System', @ph_product\r\n end \r\n @ph_embedded_result.pe_pv_cabling = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n \r\n @ph_embedded_result.pe_pv_module = 0\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B17\r\n temp = get_database_material_result_pe 'a-Si', 'Module Laminate', @ph_product\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B15\r\n temp = get_database_material_result_pe 'p-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B8\r\n temp = get_database_material_result_pe 'm-Si', 'Total Module Laminate', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = get_database_material_result_pe 'CdTe', 'Thinfilm', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B19\r\n temp = get_database_material_result_pe 'CIS/CIGS', 'Module Laminate', @ph_product \r\n end\r\n @ph_embedded_result.pe_pv_module = temp * @ph_product.ph_intermediate_result.module_area \r\n \r\n @ph_embedded_result.pe_pv_framing = 0\r\n if @ph_product.ph_basic_information.framed == 'yes'\r\n if @ph_product.ph_specified.ph_module_type.name == 'amorphous Silicon'\r\n # B18 - B17\r\n temp = (get_database_material_result_pe 'a-Si', 'Module Framed Panel', @ph_product) - (get_database_material_result_pe 'a-Si', 'Module Laminate', @ph_product)\r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'polycrystalline Silicon'\r\n # B14\r\n temp = get_database_material_result_pe 'p-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'monocrystalline Silicon'\r\n # B7\r\n temp = get_database_material_result_pe 'm-Si', 'Module/Framed Panel', @ph_product \r\n end\r\n if @ph_product.ph_specified.ph_module_type.name == 'CIS/CIGS Thinfilm'\r\n # B20 - B19\r\n temp = (get_database_material_result_pe 'CIS/CIGS', 'Module Framed Panel', @ph_product) - (get_database_material_result_pe 'CIS/CIGS', 'Module Laminate', @ph_product) \r\n end \r\n if @ph_product.ph_specified.ph_module_type.name == 'CdTe Thinfilm'\r\n # B2\r\n temp = 0 \r\n end \r\n @ph_embedded_result.pe_pv_framing = temp * @ph_product.ph_intermediate_result.module_area\r\n end\r\n \r\n @ph_embedded_result.pe_pv_mounting = 0\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Mounted'\r\n #B24\r\n temp = get_database_material_result_pe 'Mounting', 'Roof Mounted Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'On Roof - Integrated'\r\n #B25\r\n temp = get_database_material_result_pe 'Mounting', 'Roof Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Mounted'\r\n #B27\r\n temp = get_database_material_result_pe 'Mounting', 'Facade Mounted Structures', @ph_product \r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Facade - Integrated'\r\n #B28\r\n temp = get_database_material_result_pe 'Mounting', 'Facade Integrated Structures', @ph_product\r\n end\r\n if @ph_product.ph_basic_information.ph_mounting_type.name == 'Open Ground'\r\n #B26\r\n temp = get_database_material_result_pe 'Mounting', 'Open Ground Structures', @ph_product\r\n end \r\n @ph_embedded_result.pe_pv_mounting = temp * @ph_product.ph_intermediate_result.module_area\r\n \r\n @ph_embedded_result.pe_inverter = 0\r\n if @ph_product.ph_electric_component.quantity_1 != 0\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 1', @ph_product\r\n @ph_embedded_result.pe_inverter += temp * @ph_product.ph_electric_component.quantity_1\r\n end\r\n if @ph_product.ph_electric_component.quantity_2 != 0\r\n temp = get_database_material_result_pe 'Electrics', '1x Inverter Type 2', @ph_product\r\n @ph_embedded_result.pe_inverter += temp * @ph_product.ph_electric_component.quantity_2\r\n end\r\n \r\n \r\n @ph_embedded_result.pe_batteries = 0\r\n if @ph_product.ph_electric_component.include_batteries == 'yes'\r\n if @ph_product.ph_electric_component.ph_battery_type.name == 'Lead Acid'\r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lead Acid [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_pe 'Electrics Battery', 'Lead Acid [per kg]', @ph_product\r\n else\r\n pes_1 = get_database_material_result_co2 'Electrics Battery', 'Lithium Ion [kg / pc.]', @ph_product\r\n pes_2 = get_database_material_result_pe 'Electrics Battery', 'Lithium Ion [per kg]', @ph_product\r\n end\r\n if @ph_product.ph_electric_component.separated_battery\r\n @ph_embedded_result.pe_batteries = @ph_product.ph_electric_component.separated_battery * pes_1 * pes_2\r\n end\r\n end\r\n \r\n \r\n @ph_embedded_result.embedded_energy_total = @ph_embedded_result.pe_pv_cabling + @ph_embedded_result.pe_pv_module + @ph_embedded_result.pe_pv_framing + @ph_embedded_result.pe_pv_mounting + @ph_embedded_result.pe_inverter + @ph_embedded_result.pe_batteries + @ph_embedded_result.pe_maintenance \r\n \r\n \r\n @ph_embedded_result.peak_power = @ph_product.ph_intermediate_result.module_area * calcul_efficiency / 100\r\n @ph_embedded_result.lifetime_production = @ph_result.lifetime\r\n \r\n \r\n if @ph_product.ph_basic_information.working == 'yes' && @ph_product.ph_basic_information.know_power == 'yes' && @ph_product.ph_basic_information.user_power\r\n @ph_embedded_result.averaged_power = @ph_product.ph_basic_information.user_power\r\n else \r\n @ph_embedded_result.averaged_power = @ph_embedded_result.lifetime_production / @ph_product.ph_specified.lifetime \r\n end\r\n\r\n @ph_embedded_result.averaged_consumption = @ph_embedded_result.averaged_power * 3.6 / @ph_product.ph_basic_information.conversion_factor \r\n @ph_embedded_result.system_emb = @ph_embedded_result.embedded_energy_total\r\n @ph_embedded_result.energy_payback = @ph_embedded_result.embedded_energy_total / @ph_embedded_result.averaged_consumption\r\n @ph_embedded_result.energy_yield = @ph_embedded_result.lifetime_saved / @ph_embedded_result.embedded_energy_total\r\n @ph_embedded_result.emb_co2 = @ph_result.cabling + @ph_result.inverter + @ph_result.batteries \r\n\r\n @ph_result.co2_total += @ph_result.maintenance\r\n @ph_embedded_result.estim_co2 = 1000 * @ph_result.co2_total / @ph_result.lifetime\r\n @ph_embedded_result.net_saved_co2 = @ph_embedded_result.lifetime_production * (@ph_product.ph_basic_information.co2_factor - @ph_embedded_result.estim_co2) / 1000 \r\n \r\n @ph_product.ph_result.save\r\n @ph_product.ph_embedded_result.save\r\n @ph_product.ph_maintenance_result.save\r\n end \r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml\r\n end\r\n end",
"title": ""
},
{
"docid": "e365ebc6c8676ce51a746a8a8af91173",
"score": "0.46968302",
"text": "def csvexport_all_tables\n @wires = Wire.all.sort_by {|obj| obj.kabeltyp}\n @switchgears_einbau = Switchgear.all.sort_by {|obj| obj.kennung}\n @switchgears = Switchgear.where(:typ => 1).sort_by {|obj| obj.kennung}\n @assemblies = Assembly.all.sort_by {|obj| obj.kennung}\n @electrical_installations = ElectricalInstallation.all.sort_by {|obj| obj.kennung}\n @drives = Drive.all.sort_by {|obj| obj.kennung}\n @devices = Device.all.sort_by {|obj| obj.definition}\n @iogroups = Iogroup.all.sort_by {|obj| obj.name}\n @switchgearcombinations = Switchgearcombination.all.sort_by {|obj| obj.name}\n @offertpositions = Offertposition.where(:subsubproject_id => params[:subsubproject_id]).sort_by {|obj| obj.name}\n @subsubproject = Subsubproject.find(params[:subsubproject_id])\n @subsubprojects = @subsubproject.subproject.subsubprojects.sort_by {|obj| obj.name}\n @subsystems = @subsubproject.subproject.project.subsystems.all.sort_by {|obj| obj.name}\n @units = Unit.where(:subsystem_id => @subsystems.pluck(:id)).sort_by {|obj| obj.name}\n\n CSV.open(\"export_all_tables#{Time.now.strftime(\"%Y-%m-%d-%H-%M\")}.csv\", \"wb\", {:headers => true, :encoding => \"iso-8859-1\", :col_sep => \";\"}) do |csv|\n csv << ['Geraetetypen', '']\n @devices.each do |entry| csv << [entry.id, entry.definition] end\n csv << ['SPS-Modultypen', '']\n @assemblies.each do |entry| csv << [entry.id, entry.kennung] end\n csv << ['Frequenzumrichtertypen', '']\n @drives.each do |entry| csv << [entry.id, entry.kennung] end\n csv << ['Kabeltypen', '']\n @wires.each do |entry| csv << [entry.id, entry.kabeltyp] end\n csv << ['Elektroinstallationstypen', '']\n @electrical_installations.each do |entry| csv << [entry.id, entry.kennung] end\n csv << ['Schaltschranktypen', '']\n @switchgears.each do |entry| csv << [entry.id, entry.kennung] end\n csv << ['Schaltschrankeinbautypen', '']\n @switchgears_einbau.each do |entry| csv << [entry.id, entry.kennung] end\n csv << ['Schaltgeraetekombinationen', '']\n @switchgearcombinations.each do |entry| csv << [entry.id, entry.name] end\n csv << ['IO-Gruppen', '']\n @iogroups.each do |entry| csv << [entry.id, entry.name] end\n csv << ['Offertpositionen', '']\n @offertpositions.each do |entry| csv << [entry.id, entry.name] end\n csv << ['Teilanlagen', '']\n @subsystems.each do |entry| csv << [entry.id, entry.name] end\n csv << ['TeilanlagenUnits', '']\n @units.each do |entry| csv << [entry.id, entry.name] end\n csv << ['Projektversionen', '']\n @subsubprojects.each do |entry| csv << [entry.id, entry.name] end\n end\n\n redirect_to settings_path, :notice => \"Export wurde unter \" + Rails.root.to_s + \"/ abgelegt!\"\n end",
"title": ""
},
{
"docid": "cd0a26fdd5ceb967d8ae3a4a9fd8c73d",
"score": "0.4696825",
"text": "def main\n\n if ARGV.length == 0 or ARGV[0] == \"-h\"\n puts \"makePWLfromCSV <file> where\n each line is a csv file\"\n exit\n end\n\n filename = ARGV[0]\n csvList = File.open(filename,\"r\")\n\n sample=1\n minRatio=0.0001\n\n while (!csvList.eof)\n line=csvList.gets.strip.chomp\n\n if line=~/^\\#/ \n #puts \"comment:#{line}\"\n next\n else\n #puts \"processing:#{line}\"\n filename=line\n end\n\n # \n # assuming file name is \n # config_process_voltage_temperature\n #\n base=File.basename(filename,\".csv\")\n arr=base.split(/_/)\n config=arr[1]\n process=arr[2]\n voltage=arr[3]\n temperature=arr[4]\n\n #arr.each{|item| puts item }\n #printf(\"%s,%s,%s\\n\",config,v,t)\n \n outFile = base + \".pwl\"\n\n out = File.open(outFile,\"w\")\n csv = File.open(filename,\"r\")\n puts \"opening \" + filename\n\n timeCurrentArr=Array.new\n j=0\n\n imin=1e9\n imax=0\n\n # \n # go through each line, store if\n # it is a line with comma and numbers\n #\n while (!csv.eof)\n data=csv.gets.strip.chomp\n #puts \"data line: \" + data\n\n if data=~/\\,/ then\n (t,i)=data.split(/,/)\n\n if is_num(t) and is_num(i) then \n #puts \"#{t} #{i} are numbers\" \n\n t=t.to_f\n i=i.to_f\n\n timeCurrentArr[j]=Array.new\n timeCurrentArr[j][0]=t\n timeCurrentArr[j][1]=i\n\n if i.abs>imax then\n imax=i.abs\n tmax=t\n indexMax=j\n end\n\n if i.abs<imin then\n imin=i.abs\n tmin=t\n indexMin=j\n end\n\n j+=1\n\n else\n #puts \"#{t} #{i} are not numbers\"\n end\n\n end\n end\n\n csv.close\n\n arrSize = timeCurrentArr.length\n puts \"arrSize: \" + arrSize.to_s + \" j:\" + j.to_s\n puts \"min: #{imin} at index #{indexMin}\"\n puts \"max: #{imax} at index #{indexMax}\"\n\n pwlArray=Array.new\n c=0\n\n # need to normalize the time to 0 as some\n # sims are offset in time\n initialTime=timeCurrentArr[0][0]\n initialCurrent=timeCurrentArr[0][0]\n\n #PWL waveform: (5E-12, -6.89266E-05)\n out.printf(\"PWL waveform: \")\n\n 0.upto(arrSize-1) do |j|\n\n check=(j.to_f/sample) \n\n #check to see if element of the array\n #is divisible by the sample size\n\n if check==check.to_i\n pwlArray[c]=Array.new\n t=timeCurrentArr[j][0]-initialTime\n\n # negate the data as the current is peaking negative\n i=-1 * timeCurrentArr[j][1]\n\n # after max value time is reached, make\n # sure ratio of the data indicates the\n # data is not essentially zero\n \n ratio = i.abs/imax\n #puts \"ratio: #{ratio} j:#{j} inxMax:#{indexMax} iabs:#{i.abs}\"\n if j<=indexMax then\n\n pwlArray[c][0]=t\n pwlArray[c][1]=i\n\n printf(\"(%.3e,%.3e)\\n\",t,i)\n out.printf(\"(%.3e,%.3e) \",t,i)\n\n c+=1\n\n elsif j>indexMax \n\n if ratio>minRatio then\n # keep on trucking\n #puts \"ratio ok:#{ratio}\"\n\n pwlArray[c][0]=t\n pwlArray[c][1]=i\n\n printf(\"(%.3e,%.3e)\\n\",t,i)\n out.printf(\"(%.3e,%.3e) \",t,i)\n\n c+=1\n else\n puts \"ratio low:#{ratio} at time #{t}\"\n end\n end\n end\n end\n \n out.printf(\"\\n\")\n out.close\n\n puts \"See: #{outFile}\"\n\n end\n\n csvList.close\nend",
"title": ""
},
{
"docid": "4ce2addcd29cb4cf7f0103f89486e1e4",
"score": "0.4693688",
"text": "def runner\n if !File.zero?('testdata.csv')\n solve_and_write_to_csv\n else\n File.exist?('solution_array.csv') ? FileUtils.rm('solution_array.csv') : File.new('solution_array.csv', 'w')\n puts \"Data file is empty.\"\n end\nend",
"title": ""
},
{
"docid": "81242f6d8a964bbf62e47e856b445f5b",
"score": "0.46927226",
"text": "def create_report\n\n # 1. Write report headers (title and section)\n wrt_rpt_hdr\n wrt_rpt_hdr(:product)\n \n # Array used to hold required brand info for each item.\n brands = []\n\n $products_hash[\"items\"].each do |product|\n\n # 2. Write product name to file\n wrt_prod_nam(product[\"title\"])\n\n separator\n\n # 2a. Write retail price\n wrt_retail_prc(product[\"full-price\"], format: 6)\n\n # 2b. Write total purchases\n wrt_total_purchs(product[\"purchases\"].length, format: 3)\n\n # 2c. Write total sales\n total_sales = wrt_total_sales(product[\"purchases\"], format: 7)\n\n # 2d. Write average price\n avg_prc = wrt_avg_prc(total_sales, product[\"purchases\"].length, format: 5, precision: 2)\n\n # 2e. Write average discount\n wrt_avg_disc(avg_prc, product[\"full-price\"], format: 6, precision: 2)\n\n separator\n\n $report_file.puts\n\n # 3. Add new brand to brands array\n add_new_brand(brands, product_brand: product[\"brand\"])\n\n add_brand_info(brands, product[\"brand\"], product[\"stock\"], product[\"full-price\"], total_sales)\n\n end\n\n # 4. Write brand header\n wrt_rpt_hdr(:brand)\n\n separator(29)\n\n # 5. Write brand info\n wrt_brand_info(brands, true, true, true, true, stk_format: 7, brand_avg_prc_format: 2, brand_tot_sales_format: 12)\n\n\n $report_file.close\n \n #prnt_file\nend",
"title": ""
},
{
"docid": "a33eef0b241d231e84f4f4787c8d13bc",
"score": "0.46924508",
"text": "def update\n generator = ProcessCsv.new(@image_attrib)\n\n send_data(\n generator.generate,\n filename: \"Converted CSV file #{Date.current}.csv\"\n )\n end",
"title": ""
},
{
"docid": "94bea4305eec0042983ed0e43c2922f2",
"score": "0.46919778",
"text": "def parse\n timeslots = []\n last_time = 0\n index = -1\n CSV.foreach(\"output_FINAL.csv\", :encoding => 'windows-1251:utf-8') do |row| \n unless last_time == row[3]\n index += 1\n end\n\n unless timeslots[index] # create new hash\n timeslots[index] = {day: row[2], time: row[3], classes: []}\n end\n\n row[4..row.length-1].each do |c|\n if c\n unless timeslots[index][:classes].include?(c)\n timeslots[index][:classes] << c\n end\n end\n end\n\n \n last_time = row[3]\n end\n\n p timeslots\n\n CSV.open(\"final_final_output.csv\", \"wb\") do |csv|\n timeslots.each do |timeslot|\n csv << [timeslot[:day], timeslot[:time]] + timeslot[:classes]\n end\n end\n\n CSV.open(\"stats.csv\", \"wb\") do |csv|\n timeslots.each do |timeslot|\n csv << [timeslot[:day], timeslot[:time], timeslot[:classes].length]\n end\n end\nend",
"title": ""
}
] |
542ae9a8f7b4ef3316e310ea0a145af5
|
wector.rationalize Arguments: other: (Array)
|
[
{
"docid": "a13732cf01e91c4f2c3d6bd42114f2c1",
"score": "0.7964815",
"text": "def rationalize(other)\n if other.is_a? Array\n raise \"Incorrect Dimensions\" unless self.size == other.size\n other = other.dup\n self.class.new(map { |i| i.rationalize other.shift })\n elsif other.is_a?(Integer) or other.is_a?(Float)\n self.class.new(map { |i| i.rationalize other })\n else\n super\n end\n end",
"title": ""
}
] |
[
{
"docid": "13157bcd7c387b189308312f047655d0",
"score": "0.7073642",
"text": "def rationalize(*eps)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "13157bcd7c387b189308312f047655d0",
"score": "0.7073642",
"text": "def rationalize(*eps)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "13157bcd7c387b189308312f047655d0",
"score": "0.7073642",
"text": "def rationalize(*eps)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "64acd96d8c963db7fa5023e147ddcbb4",
"score": "0.6987338",
"text": "def on_rational(value); end",
"title": ""
},
{
"docid": "7d573281f757c2c1e29578aaafc219a0",
"score": "0.6981319",
"text": "def rationalize(*several_variants)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "9f80b9b83ec675c1b270d1421980a9e0",
"score": "0.6613299",
"text": "def rationalize(x, tol = nil)\n x.rationalize(tol)\n end",
"title": ""
},
{
"docid": "0ed45c6e0c8ae05ed93078b13d8684fe",
"score": "0.65041614",
"text": "def visit_rational(node); end",
"title": ""
},
{
"docid": "00e5c835c5af55faa78b7685576fe348",
"score": "0.6373221",
"text": "def test_to_rational\r\n rat = '1/2'.to_r\r\n assert_equal(rat.to_foorth_r, rat)\r\n end",
"title": ""
},
{
"docid": "96f640063c0826e28143ce48246a02d6",
"score": "0.6357599",
"text": "def rationalize(x)\n # Use the algorithm which has been found most efficient, rationalize_Knuth.\n rationalize_Knuth(x)\n end",
"title": ""
},
{
"docid": "9009d5e735e7ffca13713a5e23a29392",
"score": "0.6353056",
"text": "def visit_rational(node)\n s(:rational, [node.value.to_r], smap_operator(nil, srange_node(node)))\n end",
"title": ""
},
{
"docid": "b0ef4a2dcdebcd9be0ab1a38b36478ca",
"score": "0.6348041",
"text": "def rationalize(eps = nil)\n eps ? base_amount.rationalize(eps) : base_amount.rationalize\n end",
"title": ""
},
{
"docid": "0ff5c3466c675e7abca75422efc4470f",
"score": "0.62365365",
"text": "def test_to_rational\r\n assert_equal(Rational(13,10), (1.3).to_foorth_r)\r\n end",
"title": ""
},
{
"docid": "90f32aa1292db21f71e04f38d485c85e",
"score": "0.62025434",
"text": "def simplify_rational_number\n self\n end",
"title": ""
},
{
"docid": "39820dba065c010c925f62c593935e7e",
"score": "0.6103819",
"text": "def Ostrichto_b; @rational != 0; end",
"title": ""
},
{
"docid": "0a9196d1aacd75c590a58383f79a4302",
"score": "0.60961103",
"text": "def rationalize!(*required_units)\n each do |base|\n new_unit = required_units.map { |unit| Unit.for(unit) }.find { |unit| unit.dimensions == base.unit.dimensions } ||\n find { |other_base| other_base.unit.dimensions == base.unit.dimensions }.unit\n base.unit = new_unit\n end\n\n consolidate_numerator_and_denominator!\n end",
"title": ""
},
{
"docid": "ce5120f02b72572e783de4abe5049412",
"score": "0.6084781",
"text": "def test_to_rational\r\n obj = Object.new\r\n assert_equal(obj.to_foorth_r, nil)\r\n end",
"title": ""
},
{
"docid": "e61e2e43c374a055a83fb3bccf7c36b6",
"score": "0.6075554",
"text": "def to_r\n return @scalar.to_r if self.unitless?\n raise RuntimeError, \"Cannot convert '#{self.to_s}' to Rational unless unitless. Use Unit#scalar\"\n end",
"title": ""
},
{
"docid": "61828f6b0ad8dffd058b51028a99fc53",
"score": "0.6057005",
"text": "def to_rational\n e = biased_exponent\n if e.negative?\n sign * mantissa_fraction * Rational(1, 2**-e)\n else\n sign * mantissa_fraction * 2**e\n end\n end",
"title": ""
},
{
"docid": "139fba5ac08fd9c451823f6860523c54",
"score": "0.601455",
"text": "def test_Integer_InstanceMethods_to_r\n\t\t# TODO\n\t\t# assert_equal(99.0, 99.rationalize)\n\t\t# assert_equal(-12345678.0, -12345678.rationalize(99))\n\tend",
"title": ""
},
{
"docid": "8595e0fad80769a2a2d93c3986d8778c",
"score": "0.59700847",
"text": "def quo(other)\n Rational.new!(self,1) / other\n end",
"title": ""
},
{
"docid": "8595e0fad80769a2a2d93c3986d8778c",
"score": "0.59700847",
"text": "def quo(other)\n Rational.new!(self,1) / other\n end",
"title": ""
},
{
"docid": "f5562c46084e6d4280a4a47c2ddc633a",
"score": "0.59085536",
"text": "def rational\n Rational(integer, integer(0..INTMAX))\n end",
"title": ""
},
{
"docid": "719a50be88c5700e1f1fc45004395cd8",
"score": "0.58793885",
"text": "def to_r\n Rational(self, 1)\n end",
"title": ""
},
{
"docid": "dc06bcfaf19c71e6c021dbf1399e8f56",
"score": "0.58768713",
"text": "def exact_binary_rationalization(x)\n p, q = x, 1\n while p.modulo(1) != 0\n p *= 2.0\n q <<= 1 # q *= 2\n end\n Rational(p.to_i, q)\n end",
"title": ""
},
{
"docid": "eded5e345aeb47e1529912ff238b54e0",
"score": "0.58280605",
"text": "def /(rational)\n new_numerator = self.numerator * rational.denominator\n new_denominator = self.denominator * rational.numerator\n RationalNumber.new(new_numerator, new_denominator)\n end",
"title": ""
},
{
"docid": "ac4eba1cdbf9a25abe70a63898d6dc82",
"score": "0.57930464",
"text": "def rationalize_numerator_and_denominator!(*units)\n replace(numerator_units.rationalize!(*units) + denominator_units.rationalize!(*units))\n end",
"title": ""
},
{
"docid": "10caeaf90fcf2f9f56845c51af3ebbca",
"score": "0.5786227",
"text": "def ==(rational)\n self.numerator * rational.denominator == self.denominator * rational.numerator\n end",
"title": ""
},
{
"docid": "50ab94ae063a294a3416e23c6edaa4b3",
"score": "0.5722472",
"text": "def visit_rational(node)\n node.copy\n end",
"title": ""
},
{
"docid": "54130cc190c25a2f739908aa1ff06268",
"score": "0.5686729",
"text": "def stringToRational\n return $str1.to_r\nend",
"title": ""
},
{
"docid": "4a7ba623460f43e0b99b35133d2b5ffc",
"score": "0.56629753",
"text": "def / other\n other = wrap(other)\n other.simple? ? Term.new(Rational(self.value,other.value)) : super(other)\n end",
"title": ""
},
{
"docid": "95c8ccd206107a99f890fe6a1cfc43a2",
"score": "0.56125534",
"text": "def use_rationals\n r1 = MyRational.new(3,4)\n r2 = r1 + r1 + MyRational.new(-5,2)\n puts r2.to_s\n (r2.add! r1).add! (MyRational.new(1,-4))\n puts r2.to_s\n puts r2.to_s2\n puts r2.to_s3\nend",
"title": ""
},
{
"docid": "890daa7fb10752de55efa63a63c0ea29",
"score": "0.56021607",
"text": "def add_fractions(a, b)\n denominator = lcm(a[1],b[1])\n result = []\n result << (denominator / a[1]) * a[0] + (denominator / b[1]) * b[0]\n result << denominator\n #reduce the result\n return result\nend",
"title": ""
},
{
"docid": "f34baff3a135b377d24f898b19cb04ca",
"score": "0.5582784",
"text": "def on_rational(value)\n RationalLiteral.new(\n value: value,\n location:\n Location.token(\n line: lineno,\n char: char_pos,\n column: current_column,\n size: value.size\n )\n )\n end",
"title": ""
},
{
"docid": "f8bc7e104719fe7194dc1f00c3cae38d",
"score": "0.55775166",
"text": "def rational\n denom_gen = such_that(fixnum) { |f| not f == 0 }\n\n fmap(tuple(fixnum, denom_gen)) do |(n, d)|\n Rational(n, d)\n end\n end",
"title": ""
},
{
"docid": "3f8251a637bdf36eef880767a9e0dfae",
"score": "0.556892",
"text": "def reciprocal\n RationalNumber.new(self.denominator, self.numerator)\n end",
"title": ""
},
{
"docid": "3f8251a637bdf36eef880767a9e0dfae",
"score": "0.556892",
"text": "def reciprocal\n RationalNumber.new(self.denominator, self.numerator)\n end",
"title": ""
},
{
"docid": "ac13015dbf7cf84497d66eadf3572c74",
"score": "0.55577487",
"text": "def /(other)\n \t@racional = Racional.new((@numerador * other.denominador),@denominador * other.numerador)\n reducir(@racional)\n end",
"title": ""
},
{
"docid": "4c4cf5994b95456acf9132ecb079d33f",
"score": "0.5551927",
"text": "def rpower (other)\n if other >= 0\n self.power!(other)\n else\n Rational.new!(self,1)**other\n end\n end",
"title": ""
},
{
"docid": "8c83d0b950c18c308661ce6a87974cd2",
"score": "0.5506115",
"text": "def rpower (other)\n if other >= 0\n self.power!(other)\n else\n Rational.new!(self, 1)**other\n end\n end",
"title": ""
},
{
"docid": "ef8179a7b1c200667481d971da72a1eb",
"score": "0.54913884",
"text": "def ==(rational)\n \t@numerator * rational.denominator == @denominator * rational.numerator\n end",
"title": ""
},
{
"docid": "affc9601a690a7537ed15e5dcfe1a2d5",
"score": "0.54903257",
"text": "def jruby_scale_down_rational(rat)\n return rat if rat.numerator <= java.lang.Long::MAX_VALUE\n [10, 100, 1000].each do |scale_by|\n new_numerator = rat.numerator / scale_by\n if new_numerator <= java.lang.Long::MAX_VALUE\n return Rational(new_numerator, rat.denominator / scale_by)\n end\n end\n end",
"title": ""
},
{
"docid": "099cc6321a97ffcd30845297ad0341fb",
"score": "0.54861456",
"text": "def -(rational)\n new_numerator = self.numerator * rational.denominator - self.denominator * rational.numerator\n new_denominator = self.denominator * rational.denominator\n RationalNumber.new(new_numerator, new_denominator)\n end",
"title": ""
},
{
"docid": "28182e630be18b60e2b3b3f54af68110",
"score": "0.54521835",
"text": "def single_radical\n c = b = 1\n prime_factors.each do |p, e|\n q, r = e.mixed_fraction\n c *= p**q\n b *= p**(r*rational_degree)\n end\n [c, b, rational_degree]\n end",
"title": ""
},
{
"docid": "ab6070fe549a7e7128be892fa0cec6f9",
"score": "0.5425324",
"text": "def vr(*arr)\n # return a ring of values (for amplitude) based on dividing array values by 10\n # i.e. vr( 1,2,3 ) => (ring 0.1, 0.2, 0.3)\n arr.map{ |a| a / 10.0 }.ring\nend",
"title": ""
},
{
"docid": "3ecc455c1074cedb19ac0a2c3e56cfc0",
"score": "0.5419756",
"text": "def /(other)\n\t\ttemp = Fraccion.new(@numer*other.denomin, @denomin*other.numer)\n\t\ttemp.simplificar\n\tend",
"title": ""
},
{
"docid": "bbbe4860abdd2e8a60a64dc8524efc5c",
"score": "0.54169863",
"text": "def unegyptian(array)\n sum = 0\n array.each do |elem| \n sum += Rational(1, elem)\n end\n sum\nend",
"title": ""
},
{
"docid": "82a3ebcaa1d8a5f169213cbf4c86b82d",
"score": "0.54133457",
"text": "def /(other)\n\t\t\tf =Fraccion.new(1,1)\n\t\t\tif other.instance_of? Fixnum\n\t\t\t\tf.a=@a\n\t\t\t\tf.b=@b*other\n\t\t\telse\n\t\t\t\tf.a=@a*other.b\n\t\t\t\tf.b=@b*other.a\n\t\t\tend\n\t\t\t#minimizamos el resultado\n\t\t\tf.a,f.b = minimiza(f.a,f.b)\n\t\t\treturn f\n\t\tend",
"title": ""
},
{
"docid": "d0c305316b590020110f7c878c1e8893",
"score": "0.5379087",
"text": "def solution(arr1, arr2)\n arr_sqs = []\n\n arr1.each_with_index do |num, idx|\n difference = num - arr2[idx]\n arr_sqs << difference ** 2\n end\n arr_sqs.sum.to_f / arr1.length\nend",
"title": ""
},
{
"docid": "c891c1efad82f1d4ad526a2dfc80c6f5",
"score": "0.53733605",
"text": "def dms_to_rational(sign, degrees, minutes, seconds = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "00dc639b03ab2fc825d0705b0d410c00",
"score": "0.5370172",
"text": "def rationalize_numerator_and_denominator_units!(*units)\n @base_units.rationalize_numerator_and_denominator!(*units)\n initialize_attributes\n end",
"title": ""
},
{
"docid": "dd05e4211c0b05031675cf12ce6121f6",
"score": "0.53700995",
"text": "def rad\r\n return 1 if self == 1\r\n return self.prime_division.map{|x,y| x}.reduce(:*)\r\n end",
"title": ""
},
{
"docid": "c8d0b27303ca408d3d4ad2a3dd8c87d5",
"score": "0.5361486",
"text": "def ratio other\n raise UnitsError.new \"Ratio error: unit mismatch\" if ! self.compatible? other\n 1.0 * self.scale / other.scale # need 1.0 in case both are integer\n end",
"title": ""
},
{
"docid": "2998706dd6a7d50970d662c0ceeadd2d",
"score": "0.53545326",
"text": "def round(other)\n if other.is_a? Array\n raise \"Incorrect Dimensions\" unless self.size == other.size\n other = other.dup\n self.class.new(map { |i| i.round other.shift })\n elsif other.is_a?(Integer) or other.is_a?(Float)\n self.class.new(map { |i| i.round other })\n else\n super\n end\n end",
"title": ""
},
{
"docid": "d0a401fa2f105241348b0022612b82df",
"score": "0.5351452",
"text": "def reciprocal\n\t\tRacional.new(@denominador,@numerador)\n\tend",
"title": ""
},
{
"docid": "ecc13b304031239727a8f7d539110071",
"score": "0.5344541",
"text": "def ** (other)\n if other.kind_of?(Rational)\n other2 = other\n if self < 0\n return Complex(self, 0.0) ** other\n elsif other == 0\n return Rational(1,1)\n elsif self == 0\n return Rational(0,1)\n elsif self == 1\n return Rational(1,1)\n end\n\n npd = numerator.prime_division\n dpd = denominator.prime_division\n if other < 0\n other = -other\n npd, dpd = dpd, npd\n end\n\n for elm in npd\n elm[1] = elm[1] * other\n if !elm[1].kind_of?(Integer) and elm[1].denominator != 1\n return Float(self) ** other2\n end\n elm[1] = elm[1].to_i\n end\n\n for elm in dpd\n elm[1] = elm[1] * other\n if !elm[1].kind_of?(Integer) and elm[1].denominator != 1\n return Float(self) ** other2\n end\n elm[1] = elm[1].to_i\n end\n\n num = Integer.from_prime_division(npd)\n den = Integer.from_prime_division(dpd)\n\n Rational(num,den)\n\n elsif other.kind_of?(Integer)\n if other > 0\n num = numerator ** other\n den = denominator ** other\n elsif other < 0\n num = denominator ** -other\n den = numerator ** -other\n elsif other == 0\n num = 1\n den = 1\n end\n Rational(num, den)\n elsif other.kind_of?(Float)\n Float(self) ** other\n else\n x , y = other.coerce(self)\n x ** y\n end\n end",
"title": ""
},
{
"docid": "1edaf9b0b6d92940f878a48d0e2240ed",
"score": "0.5339613",
"text": "def rad\n self.prime_factors.uniq.reduce( :* )\n end",
"title": ""
},
{
"docid": "0dfcb4371e1c64ecd43d67a267375acb",
"score": "0.53385836",
"text": "def /(other)\n\n Fraccion.new(@num * other.den, @den * other.num).min\n\n end",
"title": ""
},
{
"docid": "0dfcb4371e1c64ecd43d67a267375acb",
"score": "0.53385836",
"text": "def /(other)\n\n Fraccion.new(@num * other.den, @den * other.num).min\n\n end",
"title": ""
},
{
"docid": "4fc9773ab0bda94d86b06c668b82d9c0",
"score": "0.53299826",
"text": "def /(other)\n if other.is_a? Array\n raise \"Incorrect Dimensions\" unless self.size == other.size\n other = other.dup\n self.class.new(map { |i| i / other.shift })\n elsif other.is_a?(Integer) or other.is_a?(Float)\n self.class.new(map { |i| i / other })\n else\n super\n end\n end",
"title": ""
},
{
"docid": "2b5c019e6beb39b4b067c6501fc7e030",
"score": "0.5317582",
"text": "def reciprocate!(options={})\n options[:simplify] ? Fraction.new(@denominator, @numerator).simplify! : Fraction.new(@denominator, @numerator)\n end",
"title": ""
},
{
"docid": "f302454845e81d53ba35b84e98605076",
"score": "0.53095007",
"text": "def realize_denom(x, y)\n if y.integer?\n return x, y.to_i\n else\n return mul(x, y.conj), y.norm\n end\n end",
"title": ""
},
{
"docid": "aafebd312bd8d4feedf9e9d66c37ca24",
"score": "0.5301914",
"text": "def solution(ary_1, ary_2)\n squares = []\n \n ary_1.each_with_index do |first_num, idx|\n current_square = (first_num - ary_2[idx]).abs.**(2)\n squares << current_square\n end\n squares.sum.to_f / squares.size\n \nend",
"title": ""
},
{
"docid": "d916681ae40a1ba455c36e92ab67343e",
"score": "0.5293945",
"text": "def *(rational)\n new_numerator = self.numerator * rational.numerator\n new_denominator = self.denominator * rational.denominator\n RationalNumber.new(new_numerator, new_denominator)\n end",
"title": ""
},
{
"docid": "6e888b5b6212d6d83decddfd0059e98a",
"score": "0.5263335",
"text": "def <=>(other)\n @numerator * other.denominator - @denominator * other.numerator\n end",
"title": ""
},
{
"docid": "55a95c855fcd6e763dce00cf06dd9b80",
"score": "0.52507067",
"text": "def +(rational)\n new_numerator = self.numerator * rational.denominator + self.denominator * rational.numerator\n new_denominator = self.denominator * rational.denominator\n RationalNumber.new(new_numerator, new_denominator)\n end",
"title": ""
},
{
"docid": "e19a01a4ee41764903ed52bb49b921f4",
"score": "0.52469873",
"text": "def / (other)\n a = @a * other.denom\n b = @b * other.num\n mcd = gcd(a,b)\n a /= mcd\n b /= mcd\n\n Fraccion.new(a,b)\n end",
"title": ""
},
{
"docid": "54e2d8764cc736ac6086683de96a0154",
"score": "0.5245353",
"text": "def plusMinus(arr)\n zeros = arr.select { |n| n == 0 }\n positives = arr.select { |n| n > 0 }\n negatives = arr.select { |n| n < 0 }\n \n print_ratio(calculate_ratio(positives, arr))\n print_ratio(calculate_ratio(negatives, arr))\n print_ratio(calculate_ratio(zeros, arr))\nend",
"title": ""
},
{
"docid": "da92aa965a4d328826fdea90daf2c7b2",
"score": "0.5241783",
"text": "def subtract(r)\n rDif = RationalNum.new(@num * r.den - @den * r.num, @den * r.den)\n end",
"title": ""
},
{
"docid": "8d6f0a349b94079e337db53a74c86106",
"score": "0.520762",
"text": "def convergents_as_rationals(nth=nil)\n nth ||= convergents.length\n convergents[0...nth].map{|convergent| convergent_to_rational(convergent)}\n end",
"title": ""
},
{
"docid": "bbe9c2fae715184fcfae7c6ee97c794f",
"score": "0.52026486",
"text": "def RationalLiteral(value); end",
"title": ""
},
{
"docid": "1db9a34d1dc45b2a8c0fc5f66a7791f5",
"score": "0.518928",
"text": "def /(other)\n\t\tFraccion.new(@num*other.denom, @den*other.num)\t\n\tend",
"title": ""
},
{
"docid": "5cb01ad353fdde2896bfed446fedf2f7",
"score": "0.5188297",
"text": "def /(other)\n\t\t\tc=Matriz.new(@n,@m,Array.new(@n){Array.new(@m)})\n\t\t\tfor i in 0...@n do\n\t\t\t\tfor j in 0...@m do\n\t\t\t\t\tc.A[i][j] =@A[i][j] / other.to_f\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn c\n\t\tend",
"title": ""
},
{
"docid": "e8dd209667a3f3f332c24c15d0710c13",
"score": "0.5174788",
"text": "def /(other)\n r = 1.0 / other.real\n e = - other.epsilon.to_f / (other.real ** 2)\n tmp = self.class.new(r, e)\n self * tmp\n end",
"title": ""
},
{
"docid": "a017510456a67832dbab45375fe27693",
"score": "0.515635",
"text": "def convergent( k )\n p, q = [1, 0], [0, 1]\n i = 0\n \n until 0 > k\n p.unshift( self[i] * p[0] + p[1] )\n q.unshift( self[i] * q[0] + q[1] )\n \n k -= 1\n i += 1\n i = 1 unless i < self.length\n end\n \n Rational( p[0], q[0] )\n end",
"title": ""
},
{
"docid": "e6bc2d40774a380ce15b818394752ddd",
"score": "0.51555437",
"text": "def rms()\n\t\tarray = error()\n\t\tvariance = array.inject(0) { |variance, x| variance += x ** 2 }\n\t\tMath.sqrt(variance / (array.size - 1))\n\tend",
"title": ""
},
{
"docid": "c4c285823575cdeed523e690ebf23cf5",
"score": "0.5155286",
"text": "def test_conversion\n x = R.var\n mR = MR[[x,2*x],[3*x,4*x]]\n mQ = MQ[[1,2],[3,4]]\n# mE = ME.new [[1,2],[3,4]]\n mZ = MZ[[1,2],[3,4]]\n mZ3 = MZ3[[1,2],[3,4]]\n assert_equal(MR, (mR*mQ).class)\n assert_equal(MR, (mQ*mR).class)\n\n# assert_raises(RuntimeError) {mR * mE}\n\n assert_equal(MQ, (mZ*mQ).class)\n assert_equal(MQ, (mQ*mZ).class)\n\n assert_equal(MZ3, (mZ3*mZ).class)\n assert_equal(MZ3, (mZ*mZ3).class)\n\n assert_equal(Z3, Z3.wedge(Rational))\n assert_equal(MZ3, (mZ3*mQ).class)\n assert_equal(Z3, Rational.wedge(Z3))\n assert_equal(MZ3, (mQ*mZ3).class)\n end",
"title": ""
},
{
"docid": "c21731e772b1af58f170ea1d796e6db4",
"score": "0.5153864",
"text": "def reciprocal() # Calcula el reciproco de una fraccion.\n \tFrac.new(@denominador, @numerador)\n end",
"title": ""
},
{
"docid": "49926444c6e2f829c49bd48a345f3e39",
"score": "0.51473486",
"text": "def __ratio_from_numeric2(a,b)\n n1,d1 = __ratio_from_numeric(a)\n n2,d2 = __ratio_from_numeric(b)\n return n1*d2, d1*n2\n end",
"title": ""
},
{
"docid": "fd79f516cdbafb0bcd7738086c6981e6",
"score": "0.51381046",
"text": "def simplify(numerator, denominator)\n if (numerator % 1).nonzero? || (denominator % 1).nonzero?\n # Double the numerator and denominator to get them into integer-shape,\n # since the denominator will always be 0.5 or 1.5.\n return simplify(numerator * 2, denominator * 2)\n end\n\n return [numerator, denominator] if denominator == 1\n\n divisor = numerator.to_i.gcd(denominator.to_i)\n return [numerator, denominator] if divisor == 1\n\n simplify((numerator / divisor), (denominator / divisor))\n end",
"title": ""
},
{
"docid": "9ab8b7abcf9a9caf2500e19c69207584",
"score": "0.5132631",
"text": "def rms\n\t\tnew_array = @ratings_test\n\t\ttotal = 0\n\t\tnew_array.each do |x|\n\t\t\tif x[3].to_f>x[2].to_f\n\t\t\t\ty = x[3].to_f-x[2].to_f\n\t\t\telse \n\t\t\t\ty = x[2].to_f-x[3].to_f\n\t\t\tend\n\t\t\ttotal = total + y*y \n\t\tend\n\t\treturn Math.sqrt(total/new_array.length)\n\tend",
"title": ""
},
{
"docid": "76d18cd62fa98894253ed6896046aaca",
"score": "0.51292396",
"text": "def aprox_one\n #fix start value of the conjecture is 2 => k = 2\n k = 2\n #variable to save the continuing value\n current_value = 0.0\n #variable to save the difference of one an the current value, also break argument\n div_conv = 1.0\n\n #chwe\n while div_conv > Float::EPSILON\n current_value += ((k.to_f) - 1) / ((faculty(k)).to_f)\n div_conv = (1.0 - current_value).abs\n k += 1\n puts(k)\n end\n {Value_float: current_value,Value_rational: current_value.to_r, Index: k}\nend",
"title": ""
},
{
"docid": "f144d21a778fe1057a3a3fb637dd02eb",
"score": "0.5125889",
"text": "def solution(arr1, arr2)\n square_numbers = []\n\n arr1.each_with_index do |num, index|\n num_2 = arr2[index]\n difference = (num - num_2).abs\n square_numbers << difference * difference\n end\n\n square_numbers.sum.to_f / square_numbers.length.to_f\n\nend",
"title": ""
},
{
"docid": "d861e356b9f934e2daa5f24595f08e09",
"score": "0.51120234",
"text": "def r_div(a, b)\n r2n(a / b.to_r)\n end",
"title": ""
},
{
"docid": "abb1e4d025ea28c2b04c83d7d63ceeb5",
"score": "0.5106636",
"text": "def to_r(x)\n x = x.to_f\n return Rational(x.to_i,1) if x.modulo(1) == 0\n if !x.finite?\n return Rational(0,0) if x.nan?\n return x < 0 ? Rational(-1,0) : Rational(1,0)\n end\n\n f,e = Math.frexp(x)\n\n if e < Float::MIN_EXP\n bits = e + Float::MANT_DIG - Float::MIN_EXP\n else\n bits = [Float::MANT_DIG, e].max\n # return Rational(x.to_i, 1) if bits < e\n end\n p = Math.ldexp(f,bits)\n e = bits - e\n if e<Float::MAX_EXP\n q = Math.ldexp(1, e)\n else\n q = Float::RADIX**e\n end\n Rational(p.to_i, q.to_i)\n end",
"title": ""
},
{
"docid": "1d6873b35a2f0b55c503d3e61047543a",
"score": "0.5097467",
"text": "def /(other) # Calcula la division de dos fracciones.\n Frac.new(@numerador * other.denominador, @denominador * other.numerador)\n end",
"title": ""
},
{
"docid": "dfb802309caee60f6c002efbed031869",
"score": "0.50961775",
"text": "def vectD(array1,array2)\r\n aux = 0.0\r\n sqrt= 0.0\r\n (0..(array1.size-1)).each do |v|\r\n aux = (array1[v].to_f - array2[v].to_f).abs\r\n sqrt += aux*aux\r\n end\r\n sqrt = Math.sqrt(sqrt) if !sqrt.nan?\r\n return sqrt\r\nend",
"title": ""
},
{
"docid": "dfb802309caee60f6c002efbed031869",
"score": "0.50961775",
"text": "def vectD(array1,array2)\r\n aux = 0.0\r\n sqrt= 0.0\r\n (0..(array1.size-1)).each do |v|\r\n aux = (array1[v].to_f - array2[v].to_f).abs\r\n sqrt += aux*aux\r\n end\r\n sqrt = Math.sqrt(sqrt) if !sqrt.nan?\r\n return sqrt\r\nend",
"title": ""
},
{
"docid": "ade5c68d3793a11faab25e74e520a6d7",
"score": "0.5087768",
"text": "def add_frac(a,b)\n\tdenom = a[1].lcm(b[1])\n num = a[0] + b[0]\t\n\t#print_frac(num,denom)\n reduce_frac(num,denom)\nend",
"title": ""
},
{
"docid": "67f37768644892961fa6783e25910940",
"score": "0.5086519",
"text": "def rdiv(o); inv * o; end",
"title": ""
},
{
"docid": "74fe2c523296aa575d848ea72960d478",
"score": "0.50850904",
"text": "def consolidate_numerator_and_denominator!\n replace(numerator_units.consolidate! + denominator_units.consolidate!)\n end",
"title": ""
},
{
"docid": "685d878fe03c545bc399c0dd797ef04f",
"score": "0.5080429",
"text": "def +(other)\n Ratio.new( first+other.first, last+other.last)\n end",
"title": ""
},
{
"docid": "baac3c561b7381a71323c42c64955c5b",
"score": "0.50787914",
"text": "def mediant(other)\n Hyrarchy::EncodedPath(\n numerator + other.numerator,\n denominator + other.denominator)\n end",
"title": ""
},
{
"docid": "f8edab2485182d951a520c0231745603",
"score": "0.5078782",
"text": "def __ratio_from_numeric2(a, b)\n n1, d1 = __ratio_from_numeric(a)\n n2, d2 = __ratio_from_numeric(b)\n return n1 * d2, d1 * n2\n end",
"title": ""
},
{
"docid": "734547f9c1e3104dc3159f3a7aa13ca3",
"score": "0.5071877",
"text": "def unegyptian(array)\n array.reduce(Rational(0, 1)) do |sum, denominator|\n sum + Rational(1, denominator)\n end\nend",
"title": ""
},
{
"docid": "245275ab6b0a7a2694cf84db76d2b5f5",
"score": "0.5064705",
"text": "def + r\n ans = MyRational.new(@num,@den)\n ans.add! r\n ans\n end",
"title": ""
},
{
"docid": "245275ab6b0a7a2694cf84db76d2b5f5",
"score": "0.5064705",
"text": "def + r\n ans = MyRational.new(@num,@den)\n ans.add! r\n ans\n end",
"title": ""
},
{
"docid": "30f22ed95be77fd10bddf8db404eba1c",
"score": "0.5059128",
"text": "def quad_res_rat(a,p)\n if p % 2 == 0\n if p != 2\n return nil\n end\n r = a % 8\n if r % 2 == 0\t\n return 0\n elsif r == 7\n return 1\n else\n return -1\n end\n end\n r = NumberUtil::modPower(a, (p-1)/2, p)\n return r == p - 1 ? -1 : r\nend",
"title": ""
},
{
"docid": "1e548c013586ab87848a858a531636d3",
"score": "0.5043213",
"text": "def vectD(array1,array2)\r\n aux = 0.0\r\n sqrt= 0.0\r\n (0..(array1.size-1)).each do |v|\r\n aux = (array1[v] - array2[v]).abs\r\n sqrt += aux*aux\r\n end\r\n sqrt = Math.sqrt(sqrt) if !sqrt.nan?\r\n return sqrt\r\nend",
"title": ""
},
{
"docid": "1e548c013586ab87848a858a531636d3",
"score": "0.5043213",
"text": "def vectD(array1,array2)\r\n aux = 0.0\r\n sqrt= 0.0\r\n (0..(array1.size-1)).each do |v|\r\n aux = (array1[v] - array2[v]).abs\r\n sqrt += aux*aux\r\n end\r\n sqrt = Math.sqrt(sqrt) if !sqrt.nan?\r\n return sqrt\r\nend",
"title": ""
},
{
"docid": "1e548c013586ab87848a858a531636d3",
"score": "0.5043213",
"text": "def vectD(array1,array2)\r\n aux = 0.0\r\n sqrt= 0.0\r\n (0..(array1.size-1)).each do |v|\r\n aux = (array1[v] - array2[v]).abs\r\n sqrt += aux*aux\r\n end\r\n sqrt = Math.sqrt(sqrt) if !sqrt.nan?\r\n return sqrt\r\nend",
"title": ""
}
] |
fdac98ba6a67af665537daaa5b56aaaa
|
Export all events from selected categories as an ics file
|
[
{
"docid": "8e318a46f99a2f586f992680f69e087f",
"score": "0.75939524",
"text": "def export_selected_events\n\n cat = params[:category]\n cat = cat.split(\",\")\n\n @events = Calendar.find(:all) do\n any do\n cat.each do |c|\n categories.id == \"#{c}\"\n end\n end\n start = DateTime.strptime(\"#{params[:id]}T00:00:00+00:00\")\n month = start.strftime(\"%Y-%m-01\")\n\n start_date >= month\n order_by start_date\n end\n\n self.build_ical\n end",
"title": ""
}
] |
[
{
"docid": "16924f25dd8a56c491182d22b021daeb",
"score": "0.7362611",
"text": "def export_ical\n @event = Event.find(params[:id]) \n # dates = EventDatetime.find_by_event_id(@event.id)\n urls = @event.get_urls\n url_total = \"\"\n for url in urls\n url_total += url.to_s + \", \"\n end\n @event.event_datetimes.sort!{|x,y| x.start_date <=> y.start_date} \n calen = Vpim::Icalendar.create2\n for datetime in @event.event_datetimes\n calen.add_event do |e|\n e.dtstart datetime.start_date\n e.dtend datetime.end_date\n e.description @event.description \n e.url url_total\n e.summary \"Event Title:\" + @event.name + \", Service:\"+ Event.get_Service_name(@event.service)\n end \n end \n icsfile = calen.encode \n # @cal_string = icsfile.to_ical\n send_data icsfile, :filename => \"#{@event.name}.ics\" \n \n end",
"title": ""
},
{
"docid": "bc0cde5e95843de59f40161aeadaf875",
"score": "0.71070886",
"text": "def download_ics\n @events = Event.all\n cal = Icalendar::Calendar.new\n\n @events.each do |e|\n event = Icalendar::Event.new\n event.dtstart = e.startDate\n event.dtend = e.endDate\n event.summary = e.name\n event.description = e.description\n cal.add_event(event)\n end\n\n send_data cal.to_ical, type: 'text/calendar', disposition: 'attachment', filename: 'VWB Calendar.ics'\n end",
"title": ""
},
{
"docid": "ddd5c2b10c3a8a1ab1175b84dd8dfe6b",
"score": "0.7105861",
"text": "def export\n calendar = Icalendar::Calendar.new\n events=Event.all\n\n events.each do |e|\n event = Icalendar::Event.new\n event.dtstart = e.start_time\n event.dtend = e.end_time\n event.summary = e.title\n event.description = e.description\n calendar.add_event(event)\n end\n calendar.publish\n filename=current_user.email\n file = File.new(\"tmp/#{filename}.ics\", \"w+\")\n file.write(calendar.to_ical)\n file.close\n send_file(\"tmp/#{filename}.ics\")\n end",
"title": ""
},
{
"docid": "a4637c6be89a6b1f5e23b884f8cfd285",
"score": "0.6845991",
"text": "def to_ics\n calendar = Icalendar::Calendar.new\n self.events.where(accepted: true, cancelled: false).each do |e|\n new_event = calendar.event\n new_event.dtstart = e.start_dtime\n new_event.dtend = e.end_dtime\n new_event.summary = e.title\n new_event.description = e.summary\n new_event.location = \"#{e.location} - #{e.room}\"\n new_event.uid = e.slug\n end\n calendar.to_ical\n end",
"title": ""
},
{
"docid": "9a18c1b44347bd7503ee4ad15a3782f4",
"score": "0.67553335",
"text": "def events_to_ical()\n render_to_string(:action => \"index.ics.erb\", :layout => false)\n end",
"title": ""
},
{
"docid": "1fa5f0d7ed4f3c7cc64f75e5510dafc6",
"score": "0.6655249",
"text": "def export_event\n @event = Calendar.find(params[:id])\n\n @calendar = Icalendar::Calendar.new\n\n event = Icalendar::Event.new\n event.start = @event.start_date.strftime(\"%Y%m%dT%H%M%S\")\n event.end = @event.end_date.strftime(\"%Y%m%dT%H%M%S\")\n event.summary = @event.event\n event.description = @event.description\n #event.location = @event.location\n\n @calendar.add event \n @calendar.publish\n\n send_data(@calendar.to_ical, :type => 'text/calendar', :filename => 'ical.ics')\n end",
"title": ""
},
{
"docid": "2b6ad4f311af3be287ab902e850db867",
"score": "0.6597751",
"text": "def export_event\n @event = Calendar.find(params[:id])\n\n @calendar = Icalendar::Calendar.new\n\n event = Icalendar::Event.new\n event.start = @event.start_date.strftime(\"%Y%m%d\") + @event.start_time.strftime(\"T%H%M%S\")\n event.end = @event.end_date.strftime(\"%Y%m%d\") + @event.end_time.strftime(\"T%H%M%S\")\n event.summary = @event.event\n event.description = @event.description\n #event.location = @event.location\n\n @calendar.add event \n @calendar.publish\n\n send_data(@calendar.to_ical, :type => 'text/calendar', :filename => 'ical.ics')\n end",
"title": ""
},
{
"docid": "d46f4ff66ed788240b3fa760df66252b",
"score": "0.6586225",
"text": "def to_ics\n cal = Icalendar::Calendar.new\n cal.add_event ics_event_attributes\n cal.to_ical\n end",
"title": ""
},
{
"docid": "9535ac8180e5e985007f6f2240e64565",
"score": "0.64814234",
"text": "def export\n begin\n @event = Event.find(params[:id].to_i)\n render template: 'events/ical', formats: [:ics], handlers: [:erb]\n rescue\n flash[:error] = _(\"Couldn't find any event to export!\")\n redirect_to(:action => :index) and return\n end\n end",
"title": ""
},
{
"docid": "e038205171d2efa0876ab0c6ab373819",
"score": "0.6457243",
"text": "def export_daily_events \n @events = Calendar.day_events(params[:id])\n self.build_ical\n end",
"title": ""
},
{
"docid": "099b1d030c15f40e4c2ddad80259e442",
"score": "0.64490306",
"text": "def ics\n\t\theaders[\"Content-Type\"] = \"text/calendar; charset=utf-8\"\n\t\trender :text => @talks.to_ics\n\tend",
"title": ""
},
{
"docid": "a9a1e4b1184e03bde2f2f3347df4f530",
"score": "0.6443401",
"text": "def export_events \n @events = Calendar.current_events(params[:id])\n self.build_ical\n end",
"title": ""
},
{
"docid": "525a2d7fb071641ce70faba7065201f6",
"score": "0.6381526",
"text": "def export_selected_events\n start = DateTime.strptime(\"#{params[:id]}T00:00:00+00:00\")\n month = start.strftime(\"%Y-%m-01\")\n \n prog = params[:program]\n prog = prog.split(\",\")\n\n @events = Calendar.filter_events(prog, month)\n \n self.build_ical\n end",
"title": ""
},
{
"docid": "a4d08acdf3c5bb114c0327895b548d0d",
"score": "0.62957567",
"text": "def to_ical\n events\n Rails.logger.info 'Generating calendar from Facebook events'\n @calendar.to_ical\n end",
"title": ""
},
{
"docid": "82eda6b6a9f016ce1b42eb8df18f49e5",
"score": "0.6276344",
"text": "def export_events \n @events = Calendar.find(:all) do\n start_date >= params[:id]\n order_by start_date\n end\n\n self.build_ical\n end",
"title": ""
},
{
"docid": "330bc88ddc904303f2f29f0a070834f5",
"score": "0.62753296",
"text": "def out_ical\n File.open(ICAL_PUBLIC_PATH, 'w') do |f|\n ical = ICalendar.new\n public_events.each { |event| ical.set_event(event, :public) }\n f.write(ical)\n end\n File.open(ICAL_PRIVATE_PATH, 'w') do |f|\n ical = ICalendar.new\n private_events.each { |event| ical.set_event(event, :private) }\n f.write(ical)\n end\n end",
"title": ""
},
{
"docid": "1f9fdb48ce955a565392d27875069d3b",
"score": "0.6271058",
"text": "def to_ics\n cale = Icalendar::Event.new\n cale.dtstart = starttime\n cale.dtend = endtime\n cale.summary = route.ical_title\n cale.description = route.ical_description\n cale.created = created_at\n cale.last_modified = updated_at\n # cale.uid = id # Don't do this in real life !!! why they say this ?\n cale\n end",
"title": ""
},
{
"docid": "cdb905bf1e955eb39c57810c8b186c5b",
"score": "0.62283236",
"text": "def to_ics\n\t\tevent = Icalendar::Event.new\n\t\tevent.start = self.date.strftime(\"%Y%m%dT%H%M%S\")#times use the Y/M/D\n\t\tevent.end = self.end_date.strftime(\"%Y%m%dT%H%M%S\")# and T H/M/S format\n\t\tevent.summary = self.title\n\t\tevent.description = self summary\n\t\tevent.location = 'Here !'\n\t\tevent.klass = \"PUBLIC\"\n\t\tevent.created = self.created_at\n\t event.last_modified = self.updated_at\n\t\tevent.uid.event.url=\"#{PUBLIC_URL}events/#{self.id}\"\n\t\tevent.add_comment(\"AF83 -Shake your digital, we do WowWare\")\n\t\tevent\n\tend",
"title": ""
},
{
"docid": "1dcb998e3043e3f229bedea75c86f648",
"score": "0.6149045",
"text": "def to_ics\n cale = Icalendar::Event.new\n cale.dtstart = starttime\n cale.dtend = endtime\n cale.summary = route.ical_title\n cale.description = route.ical_description\n cale.created = created_at\n cale.last_modified = updated_at\n # cale.uid = id # Don't do this in real life !!! why they say this ?\n cale\n end",
"title": ""
},
{
"docid": "f5a2a7117628c6519ae02910334b2874",
"score": "0.6084604",
"text": "def subscribe_selected\n cat = params[:category].split(',')\n if cat\n @events = Calendar.subscribe_selected(cat)\n else\n @events = Calendar.current_events(Time.now.strftime(\"%Y-%m-%d\"))\n end\n\n respond_to do |format|\n format.ics { render :text => self.subscribe_events}\n end\n end",
"title": ""
},
{
"docid": "f549c1fafa5515efcecb44520bc06da3",
"score": "0.60825735",
"text": "def subscribe_events\n @calendar = Icalendar::Calendar.new\n\n for cal in @events\n event = Icalendar::Event.new\n event.start = cal.start_date.strftime(\"%Y%m%dT%H%M%S\")\n event.end = cal.end_date.strftime(\"%Y%m%dT%H%M%S\")\n event.summary = cal.event\n event.description = cal.description\n #event.location = cal.location\n @calendar.add event\n end \n\n @calendar.publish\n @calendar.to_ical\n end",
"title": ""
},
{
"docid": "7659d4114de68e04af5da63a2795865a",
"score": "0.607094",
"text": "def to_ical\n create_internal_calendar\n @calendar.export\n end",
"title": ""
},
{
"docid": "18ecaa2cbe0f523ba33ca38be03fd6e0",
"score": "0.605609",
"text": "def create_ics_file (schedule, first_game_date, last_date_this_season, team_names)\n holidays = HolidayDates.get_holiday_schedule()\n\n ics = Array.new\n ics.push(\"BEGIN:VCALENDAR\")\n ics.push(\"VERSION:2.0\")\n ics.push(\"X-WR-TIMEZONE:America/Los_Angeles\")\n ics.push(\"CALSCALE:GREGORIAN\")\n ics.push(\"METHOD:PUBLISH\")\n\n day = first_game_date\n wknum = 0\n while day <= last_date_this_season && wknum < schedule[:weekcount]\n if holidays.member?(day)\n day = day + 7\n next\n end\n schedule[:weeks][wknum][:games].sort {|x,y| x[:rink_id] <=> y[:rink_id]}.each do |game|\n tid = game[:timeslot_id]\n rid = game[:rink_id]\n home = game[:home]\n away = game[:away]\n home_team_name = team_names[home - 1]\n away_team_name = team_names[away - 1]\n rink_name = schedule[:rinks][rid][:short_name]\n rink_address = schedule[:rinks][rid][:address]\n rink_location = schedule[:rinks][rid][:location]\n rink_structured_location = schedule[:rinks][rid][:structured_location]\n\n start_hour = schedule[:timeslots][tid][:hour]\n start_minute = schedule[:timeslots][tid][:minute]\n\n start_time = Time.iso8601(\"#{day.strftime}T%02d:%02d:00\" % [start_hour, start_minute])\n end_time = start_time + (60 * 75)\n\n ics.push(\"BEGIN:VEVENT\")\n ics.push(\"DTSTART;TZID=America/Los_Angeles:#{start_time.localtime.strftime(\"%Y%m%dT%H%M%S\")}\")\n ics.push(\"DTEND;TZID=America/Los_Angeles:#{end_time.localtime.strftime(\"%Y%m%dT%H%M%S\")}\")\n ics.push(\"DTSTAMP:#{Time.now.gmtime.strftime(\"%Y%m%dT%H%M%SZ\")}\")\n ics.push(\"CREATED:19000101T120000Z\")\n ics.push(\"DESCRIPTION:\")\n ics.push(\"LAST-MODIFIED:#{Time.now.gmtime.strftime(\"%Y%m%dT%H%M%SZ\")}\")\n if rink_address != \"\" && rink_address != nil\n ics.push(rink_location)\n ics.push(rink_structured_location)\n end\n ics.push(\"SEQUENCE:1\")\n ics.push(\"STATUS:CONFIRMED\")\n if schedule[:rinkcount] > 1\n ics.push(\"SUMMARY:#{rink_name} #{home_team_name} v. #{away_team_name}\")\n else\n ics.push(\"SUMMARY:#{home_team_name} v. #{away_team_name}\")\n end\n ics.push(\"END:VEVENT\")\n end\n wknum += 1\n day = day + 7\n end\n ics.push(\"END:VCALENDAR\")\n return ics\nend",
"title": ""
},
{
"docid": "3e89aacea75b962907d58a377a43b110",
"score": "0.60505927",
"text": "def dump_calendar\n store = Persistent::DiskStore.new(CALENDAR_FILE)\n store.all.map { |calendar|\n calendar.dump(@options[:with_ids]) if calendar.name == @options[:name] || @options[:name].blank?\n }.compact.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "16493984228d491cbba3072d270654fb",
"score": "0.6047356",
"text": "def to_ics\n event = Icalendar::Event.new\n event.summary = project.name\n event.description = \"Project: #{ project.present? ? project.name : 'Untitled' } - Client: #{ project.client.present? ? project.client.name : \"No client\" }\"\n event.start = start_date.to_datetime\n .change(hour: project.account.account_setting.working_day_start_time.hour)\n .strftime(\"%Y%m%dT%H%M%S\")\n event.end = end_date.to_datetime\n .change(hour: project.account.account_setting.working_day_end_time.hour)\n .strftime(\"%Y%m%dT%H%M%S\")\n event\n end",
"title": ""
},
{
"docid": "e0de4d23029157a49869b77f32d61b70",
"score": "0.60214496",
"text": "def export\n\t\t\t\t\t@calendars = RicCalendar.calendar_model.all.order(name: :asc)\n\t\t\t\tend",
"title": ""
},
{
"docid": "9ec64dacc5cf13a26266593ad640d680",
"score": "0.6015704",
"text": "def to_ical( resources )\n calendar = Icalendar::Calendar.new\n calendar.custom_property(\"METHOD\",\"PUBLISH\")\n resources.each do |resource|\n calendar.add_event( resource.to_event )\n end\n calendar.to_ical\n end",
"title": ""
},
{
"docid": "d5373eb1710cbd45c3a1202f6f5dbc94",
"score": "0.59866244",
"text": "def index\n @events = Event.find(:all, :order => \"start_date DESC\")\n\n @title = 'Događaji'\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events }\n format.ical do\n calendar = Icalendar::Calendar.new\n @events.each do |event|\n calendar.add_event(event.to_ics)\n calendar.publish\n calendar.to_ical\n #render 'calendar.to_ical'\n #redirect_to root_path\n end\n render :text => calendar.to_ical\n end\n end\n end",
"title": ""
},
{
"docid": "1f767a18c0297f30321f586f661ef9a8",
"score": "0.5966346",
"text": "def to_ical\n FormatEventsIcal.perform(events: events).ical\n end",
"title": ""
},
{
"docid": "cf6614edda08a329668a8502e4cecb38",
"score": "0.5953333",
"text": "def gen_calendar_ics(site)\n cal = Icalendar::Calendar.new\n\n cal.x_wr_calname = site.config['title']\n\n confs_match(site.data.site.events_filter, site.data.events).each do |year_label, year|\n\n if year_label[/\\d{4}/]\n\n year.each do |conf_label, conf|\n\n conference = Icalendar::Event.new\n\n conference.uid = conference.uid.gsub(/@.*/, \"@#{site.data.site.domain}\")\n\n conference.summary = conf.name\n conference.location = conf.location\n conference.description = markdown_to_plaintext(conf.description).gsub(/\\n/, '')\n\n conference.start = conf.start\n\n # DTEND is unintuitively day + 1 (next day) for date-only events\n # according to RFC 5545 section 3.6.1 (page 53)\n conference.end = conf.end + 1 if conf.end\n\n if conf.talks\n talk_times = []\n\n conf.talks.each do |talk|\n event = Icalendar::Event.new\n\n event.uid = event.uid.gsub(/@.*/, \"@#{site.data.site.domain}\")\n\n description_text = \"Speaker: #{talk.speaker}. #{talk.description.to_s.strip}\"\n\n event.summary = talk.title.gsub(/:/, '\\\\:')\n event.location = talk.location || conf.location\n event.description = markdown_to_plaintext(description_text).gsub(/\\n/, '')\n\n if talk.start && talk.end\n timezone = tz_lookup(talk.timezone || conf.timezone || talk.start[/[a-zA-Z+0-9:]+$/])\n\n # Workaround for IST collision\n if talk.start =~ /IST$/ && event.location =~ /UK|United Kingdom|Dublin|Edinburgh|Ireland/i\n timezone = \"Europe/Dublin\"\n elsif talk.start =~ /IST$/\n timezone = \"Asia/Kolkata\"\n end\n\n event.start = vcal_time talk.start, timezone\n event.end = vcal_time talk.end, timezone\n\n # Keep track of all talk times, so conf. dates can be optional\n talk_times.push event.start\n talk_times.push event.end\n\n # Only add talks with date and time\n # There are some TBA events that are displayed,\n # but those don't belong in an .ics file\n cal.add_event(event)\n end\n end\n\n # Rewrite conference start and end based on talks,\n # if start and end times were not given\n if talk_times.min && !conference.start\n conference.start = talk_times.min.split(/T/).first.to_date\n end\n if talk_times.max && !conference.end\n conference.end = talk_times.max.split(/T/).first.to_date + 1\n end\n\n end\n\n cal.add_event(conference)\n end\n\n end\n\n end\n\n cal.to_ical\nend",
"title": ""
},
{
"docid": "b0cf2078d0dd711da60aada62fe887c6",
"score": "0.5905554",
"text": "def icalendar_filename(output_dir, name)\n filename = name.to_s.tr('/', '-') + '.ics'\n File.join(output_dir, filename)\nend",
"title": ""
},
{
"docid": "acba154afe7cfba8277c369b111b154b",
"score": "0.5899313",
"text": "def export_daily_events \n @events = Calendar.find(:all) do\n end_date >= params[:id]\n any do\n start_date.contains? params[:id]\n start_date <= params[:id]\n end\n order_by start_date\n end\n\n self.build_ical\n end",
"title": ""
},
{
"docid": "60806c4d9b9095967370d176cfcf3a12",
"score": "0.5855408",
"text": "def to_ical_calendar(events)\n # Create new ical calendar\n calendar = Icalendar::Calendar.new\n # Setting time zone\n calendar.timezone { |t| t.tzid = 'Europe/Berlin' }\n # Add every object in array to new created calendar\n events.each { |event| calendar.add_event(event.to_ical) }\n\n calendar\n end",
"title": ""
},
{
"docid": "e054539f5e9447b754e3aa85b824249d",
"score": "0.58302027",
"text": "def push(calendar)\n File.open(calendar.file, 'w') do |f|\n f.puts calendar.cal.to_ical\n end\n end",
"title": ""
},
{
"docid": "d4c0404c05027d483289bb2cbe352fca",
"score": "0.5827538",
"text": "def index\n now = Time.now.in_time_zone('Eastern Time (US & Canada)')\n @events = Event.where(['date >= ?', now.to_date]).order('date')\n\n respond_to do |format|\n format.html\n format.json\n format.rss { render :layout => false }\n format.ics { send_data(events_to_ical(), :filename => \"sopr.ics\",\n :disposition => \"inline; filename=sopr.ics\", :type => \"text/calendar\")}\n end\n end",
"title": ""
},
{
"docid": "812de1b9a78a7d56e4256875d35fe216",
"score": "0.5813147",
"text": "def generate_ics(ical_uid: nil, method: nil, prodid: nil)\n raise ArgumentError, \"Cannot generate an ICS file for an event without a Calendar ID or when set\" unless\n calendar_id && self.when\n\n payload = build_ics_event_payload(ical_uid, method, prodid)\n response = api.execute(\n method: :post,\n path: \"#{resources_path}/to-ics\",\n payload: JSON.dump(payload)\n )\n\n response[:ics]\n end",
"title": ""
},
{
"docid": "4b4cc4946be3cfe0fadcece8de64be5e",
"score": "0.57154465",
"text": "def export_category(file_name, arr)\n i = 0\n while i < arr.length\n CSV.open(file_name, \"a+\") do |csv|\n formatted = []\n formatted.push(arr[i].get_name, arr[i].get_internal_name, arr[i].get_category, arr[i].get_subject, arr[i].get_from_name, arr[i].get_from_email, arr[i].get_to_name, arr[i].get_to_email, arr[i].get_greeting, arr[i].get_header_img, arr[i].get_body_style)\n csv << formatted\n i = i+1\n end\n end\nend",
"title": ""
},
{
"docid": "ef63b3bb3c92eef11ad7ba56b7bd9934",
"score": "0.57120544",
"text": "def show\n respond_to do |format|\n format.json\n format.json_api { render json: @event }\n format.html\n format.ics { send_data @event.to_ical, type: 'text/calendar', disposition: 'attachment', filename: \"#{@event.slug}.ics\" }\n end\n end",
"title": ""
},
{
"docid": "e7ff72ecaa7e42681ad5dde6fb0babfe",
"score": "0.57031244",
"text": "def index\n respond_to do |format|\n format.json\n format.json_api { render({ json: @events }.merge(api_collection_properties)) }\n format.html\n format.csv\n format.ics\n end\n end",
"title": ""
},
{
"docid": "ad201db8ba421eeb1ce3b9248e301d32",
"score": "0.5695184",
"text": "def push_iCal(calendar)\n calendar = fix_iCal(calendar)\n content_type 'text/calendar'\n attachment('birthdays.ics')\n calendar.to_ical\n end",
"title": ""
},
{
"docid": "0d80f42a58ac5d20b24ada3634024696",
"score": "0.5688907",
"text": "def ical\n # Create a calendar with an event (standard method)\n cal = Icalendar::Calendar.new\n cal.event do |e|\n e.dtstart = Icalendar::Values::DateTime.new(start_at)\n e.dtend = Icalendar::Values::DateTime.new(end_at)\n e.summary = \"#{course.name.capitalize} avec #{course.coach.user.first_name.capitalize}\"\n e.description = \" #{specificities} \\n #{course.content} \\n #{course.details}. \"\n e.ip_class = \"PRIVATE\"\n e.location = \"Rdv: #{course.meeting_point} - #{course.address}\"\n e.organizer = course.coach.user.email\n end\n cal\n end",
"title": ""
},
{
"docid": "bae044893403bf3a2308a8a0f73211df",
"score": "0.5684345",
"text": "def index\n respond_to do |format|\n format.html do\n @full_calendar_events = Calendar.full_calendar_events(current_user)\n end\n format.ics do\n send_data Calendar.ical_events, filename: 'tournaments.ics', disposition: 'inline', type: 'text/Calendar'\n end\n end\n end",
"title": ""
},
{
"docid": "939d33819379075e2e3839bcec9a497b",
"score": "0.56486225",
"text": "def extract_events_from_ics(ics)\n ical = Icalendar::Parser.new(ics).parse.first\n # assumes one event per ics, bah\n ical.events[0]\n end",
"title": ""
},
{
"docid": "6f2f011955ffdbc30991fdc914c3ca50",
"score": "0.5635911",
"text": "def download_calendar\n @datecart = Datecart.find(params[:id])\n send_data generate_vcalendar(@datecart, :download), :filename => \"my_date.ics\", :type => \"text/calendar\"\n end",
"title": ""
},
{
"docid": "923f4dbb30da6afe15842cf939d97b31",
"score": "0.56017494",
"text": "def subscribe\n @events = Calendar.all\n\n respond_to do |format|\n format.ics { render :text => self.subscribe_events}\n end\n end",
"title": ""
},
{
"docid": "923f4dbb30da6afe15842cf939d97b31",
"score": "0.56017494",
"text": "def subscribe\n @events = Calendar.all\n\n respond_to do |format|\n format.ics { render :text => self.subscribe_events}\n end\n end",
"title": ""
},
{
"docid": "c1b3175e5253c7bff893a00dc7a8c153",
"score": "0.5582676",
"text": "def show_ical(course, yoe, ignored = [])\n begin\n calendar = Calendar.new(course, yoe.to_i, ignored)\n rescue ArgumentError => e\n return error 404, e.message\n end\n headers \"Content-Type\" => \"text/calendar\"\n calendar.to_ical\n end",
"title": ""
},
{
"docid": "1cbc93e10102fc4da265d01d21ef855d",
"score": "0.55763125",
"text": "def output_events(filename)\n File.open(filename, \"w+\") { |out|\n out.write @events.to_json()\n }\n end",
"title": ""
},
{
"docid": "a72a61b03f611a6d28d0f2b8aad9f1d5",
"score": "0.556505",
"text": "def download_calendars\n\tend",
"title": ""
},
{
"docid": "02e6db9d0fe0d2c22818caad9fc293dd",
"score": "0.5539546",
"text": "def index\n @events = Event.published.order(date: :DESC)\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "c0ba77aa3b610f5935e6f7b58e0537b6",
"score": "0.5520966",
"text": "def to_ics\n cal = Icalendar::Calendar.new\n event = Icalendar::Event.new\n event.start = self.departure_time.iso8601.gsub(/[-:]/, '')\n event.end = self.arrival_time.iso8601.gsub(/[-:]/, '')\n event.summary = \"#{self.invitation_title}\"\n event.organizer = %w(mailto:plan@timejust.com)\n event.description = strip_tags(self.google_event_detail).gsub(' ', ' ')\n event.location = self.invitation_location\n event.add_attendee \"#{self.user.email}\", {\"PARTSTAT\" => \"ACCEPTED\", \"RSVP=FALSE\" => \"FALSE\"} \n event.status = 'CONFIRMED'\n event.transp = 'OPAQUE'\n event.created = Time.now.utc.iso8601.gsub(/[-:]/, '')\n cal.ip_method = 'REQUEST'\n cal.add_event(event)\n cal.to_ical\n end",
"title": ""
},
{
"docid": "38d3153ad67743c6cab197e4ec44036d",
"score": "0.55194825",
"text": "def ical\n Icalendar::Calendar.new.tap do |cal|\n cal.prodid = '-//UMASS_TRANSIT_JOBAPPS//INTERVIEW_EXPORT//EN'\n cal.publish\n\n event = Icalendar::Event.new.tap do |e|\n e.dtstart = scheduled.to_formatted_s :ical\n e.description = application_submission.url\n e.summary = calendar_title\n e.uid = \"INTERVIEW#{id}@UMASS_TRANSIT//JOBAPPS\"\n e.dtstamp = created_at.to_formatted_s :ical\n e.status = 'CONFIRMED'\n end\n cal.add_event event\n end\n end",
"title": ""
},
{
"docid": "5dfac7abc3baccd21f80370fac8c60d3",
"score": "0.55139893",
"text": "def perform(events: [])\n @events = events.eager(:parallel, :course, :room).all\n\n @events.each do |e|\n @calendar.add_event IcalEvent(e).to_ical\n end\n end",
"title": ""
},
{
"docid": "ad035bbad425e522aceae37846ff05a1",
"score": "0.5500138",
"text": "def categories\n if !is_a_number?(params[:category])\n c = Category.find_by_name(params[:category])\n cat = c.id\n else\n cat = params[:category]\n end\n params[:id] = Time.now.strftime(\"%Y-%m-%d\") if !params[:id]\n if cat\n start = DateTime.strptime(\"#{params[:id]}T00:00:00+00:00\")\n month = start.strftime(\"%Y-%m\")\n \n @events = Calendar.filter_events(month, cat)\n \n @daily_events = @events.group_by { |d| d.start_date }\n else\n start = DateTime.strptime(\"#{params[:id]}T00:00:00+00:00\")\n month = start.strftime(\"%Y-%m\")\n @events = Calendar.current_events(params[:id])\n @daily_events = @events.group_by { |d| d.start_date }\n end\n end",
"title": ""
},
{
"docid": "e85bff21496fa6c801fc845c475abf2d",
"score": "0.549891",
"text": "def write_events\n \n puts \"Writing Events...\"\n\n new_events_file = File.open(OUTPUT_FILE, 'w')\n CONSTRUCTED_EVENTS.each do |event| new_events_file.puts event end #basic puts but driven to open file\n new_events_file.close #closes\n\n puts \"Writing Events...FINISHED\"\n\nend",
"title": ""
},
{
"docid": "661f2f288f914074818053b0fefebf4e",
"score": "0.54910314",
"text": "def index\n @events = @category.events\n @event = Event.new\n @event.event_categories.build\n\n respond_with(@events)\n end",
"title": ""
},
{
"docid": "898af206588fd3cfaa151620d2e52fd5",
"score": "0.5480233",
"text": "def current_events(format=:ics)\n format = :ics if format.to_s == 'ical'\n raise ArgumentError unless ['ics', 'rss'].include?(format.to_s)\n \"#{API_URL.chop}/2.0/artist/#{CGI::escape(@name)}/events.#{format}\"\n end",
"title": ""
},
{
"docid": "7d991689863b30ffabb27476a1dbe466",
"score": "0.54798716",
"text": "def ical(url)\n e=Icalendar::Event.new \n e.uid = self.id.to_json \n e.dtstart=DateTime.civil(self.starts_at.year, self.starts_at.month, self.starts_at.day, self.starts_at.hour, self.starts_at.min) \n e.dtend=DateTime.civil(self.ends_at.year, self.ends_at.month, self.ends_at.day, self.ends_at.hour, self.ends_at.min)\n e.location = self.location \n e.summary=self.title\n e.description = self.category + \"\\n\"+self.description \n e.created=DateTime.civil(self.created_at.year, self.created_at.month, self.created_at.day, self.created_at.hour, self.created_at.min) \n e.url = url \n e.last_modified=DateTime.civil(self.updated_at.year, self.updated_at.month, self.updated_at.day, self.updated_at.hour, self.updated_at.min)\n e\n end",
"title": ""
},
{
"docid": "160035d7152303146f033a4eeca44d8a",
"score": "0.5473354",
"text": "def event_categories\n get('events/categories').categories\n end",
"title": ""
},
{
"docid": "7a84aff2b2687db5084f75fa9f460dbc",
"score": "0.5456477",
"text": "def index\n @categories = Event.categories\n @events = Event.all\n @events = @events.send(params[:category]) if params.has_key? :category\n @past_events = @events.past.pastorder\n @future_events = @events.future\n end",
"title": ""
},
{
"docid": "c0ef0f241f97d0c5d46ad6ee7d6d7431",
"score": "0.5443662",
"text": "def convert_to_ics(semester_schedule)\n # TODO: Check if the ics actually has all the expected events\n cal = Icalendar::Calendar.new\n cal.timezone do |t|\n t.tzid = \"America/Chicago\"\n\n t.daylight do |d|\n d.tzoffsetfrom = \"-0600\"\n d.tzoffsetto = \"-0500\"\n d.tzname = \"CDT\"\n d.dtstart = \"19700308T020000\"\n d.rrule = \"FREQ=YEARLY;BYMONTH=3;BYDAY=2SU\"\n end\n\n t.standard do |s|\n s.tzoffsetfrom = \"-0500\"\n s.tzoffsetto = \"-0600\"\n s.tzname = \"CST\"\n s.dtstart = \"19701101T020000\"\n s.rrule = \"FREQ=YEARLY;BYMONTH=11;BYDAY=1SU\"\n end\n end\n\n days = semester_schedule.schedule\n days.each do |day|\n dateObject = day.date\n puts \"for #{dateObject} add #{day.student_events.length} events\"\n day.student_events.each do |event|\n date = dateObject.strftime(\"%Y%m%d\")\n cal.event do |e|\n start_date_time = dateObject.to_time #(date + event.start_time.to_s).to_i\n start_date_time = start_date_time + (event.start_time / 100) * 3600 + (event.start_time % 100) * 60\n e.dtstart = Icalendar::Values::DateOrDateTime.new(start_date_time)\n\n end_date_time = dateObject.to_time #(date + event.start_time.to_s).to_i\n end_date_time = end_date_time + (event.end_time / 100) * 3600 + (event.end_time % 100) * 60\n e.dtend = Icalendar::Values::DateOrDateTime.new(end_date_time)\n e.summary = event.summary\n e.location = event.location\n e.description = \"Have a nice and wholesome meal!\"\n end\n end\n end\n\n cal.publish\n cal\n return cal.to_ical\nend",
"title": ""
},
{
"docid": "d5ec11f6cc820539388c33426a09ee53",
"score": "0.54388785",
"text": "def generate_ical_items cfg\n ical = Icalendar::Calendar.new\n only_talks(@items).each do |item|\n ical.add_event generate_event(item, cfg)\n end\n\n @items.create(ical.to_ical, {:kind => :ical}, \"/ical\")\nend",
"title": ""
},
{
"docid": "4852757d3f60c745fc6c23b8f628fabb",
"score": "0.54353684",
"text": "def ical_link(event)\n link_to h(_(\"iCal\")), url_for(:controller => 'events', :action => 'export', :id => event.id), :class => 'ical'\n end",
"title": ""
},
{
"docid": "9ceda427e067a7a10803f75ded48442b",
"score": "0.54253113",
"text": "def event_categories\n response = get(\"/events/categories\")[\"response\"]\n response[\"categories\"].collect{|category| Foursquared::Response::Category.new(self, category)}\n end",
"title": ""
},
{
"docid": "c1064b04b044fe4b5367d5152d52701c",
"score": "0.5412583",
"text": "def index\n @seen_events = {}\n respond_to do |format|\n format.html {\n timeout = (Radiant::Config['event_calendar:cache_duration'] || self.class.cache_timeout || 3600).seconds\n expires_in timeout.to_i, :public => true, :private => false\n }\n format.js {\n render :json => events.to_json\n }\n format.rss {\n render :layout => false\n }\n format.ics {\n ical = RiCal.Calendar do |cal| \n events.each { |event| cal.add_subcomponent(event.to_ri_cal) } \n end\n send_data ical.to_s, :filename => \"#{filename}.ics\", :type => \"text/calendar\"\n }\n end\n end",
"title": ""
},
{
"docid": "4244a2b47caea5206b8cf5118a2fe78b",
"score": "0.5406526",
"text": "def index\n @events = Defer { ::Event.paginate(:page => params[:page], :order => 'ends_at desc') }\n\n respond_to do |format|\n format.ics { render :text => Event.to_icalendar(@events) }\n format.atom # index.atom.builder\n format.html # index.html.erb\n format.xml { render :xml => @events }\n end\n end",
"title": ""
},
{
"docid": "5b8b0f70c566baae67d33552cdcd61f8",
"score": "0.53975624",
"text": "def event_categories\n data.event_categories\n end",
"title": ""
},
{
"docid": "18aff43c3785205c4607334609e2dbef",
"score": "0.5386612",
"text": "def list_calendars\n store = Persistent::DiskStore.new(CALENDAR_FILE)\n store.all.map { |calendar|\n cnt = calendar.events.count\n \"%-20.20s: %d %s\" % [calendar.id, cnt > 0 ? cnt : 'no', cnt > 1 ? 'entries' : 'entry']\n }\n end",
"title": ""
},
{
"docid": "83e36256abd4be22ac04c48c2263203c",
"score": "0.5374127",
"text": "def show\n @event = Event.find(params[:id])\n\n @title = @event.name\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n format.ics do\n calendar = Icalendar::Calendar.new\n calendar.add_event(@event.to_ics)\n calendar.publish\n calendar.to_ical\n #render 'calendar.to_ical'\n #redirect_to root_path\n render :text => calendar.to_ical\n end\n end\n end",
"title": ""
},
{
"docid": "fdc5f2b726aef2c69f597aff9b801c7b",
"score": "0.53693557",
"text": "def to_ics(cal, &block)\n if self.deleted?\n cal.add_x_property('METHOD', 'CANCEL')\n else\n cal.add_x_property('METHOD', 'REQUEST')\n end\n cal.event do |event|\n event.uid = \"uid_#{self.id}_openirekia\"\n event.sequence = self.staff_alert_version\n event.summary = self.title\n event.description = block_given? ? yield[:description] || self.description_for_ics : self.description_for_ics\n event.dtstart = self.starts_at.getutc.strftime(\"%Y%m%dT%H%M%SZ\")\n event.dtend = self.ends_at.getutc.strftime(\"%Y%m%dT%H%M%SZ\")\n event.location = self.pretty_place\n event.url = yield[:url] if block_given?\n event.created = self.created_at.getutc.strftime(\"%Y%m%dT%H%M%SZ\")\n event.last_modified = self.updated_at.getutc.strftime(\"%Y%m%dT%H%M%SZ\")\n event.dtstamp = Time.zone.now.getutc.strftime(\"%Y%m%dT%H%M%SZ\")\n if self.deleted?\n event.status = \"CANCELLED\"\n else\n event.status = \"CONFIRMED\"\n end\n end\n end",
"title": ""
},
{
"docid": "90b9d701aa206eb0250de41b2fd49f96",
"score": "0.53589267",
"text": "def ical_events\n @calendar ||= Cal.new(tickets.map(&:event).map(&:ical)).calendar\n end",
"title": ""
},
{
"docid": "1df8aab42b7eda5bdf6155c5d0869373",
"score": "0.5333877",
"text": "def index\n @eventcategories = Eventcategory.all\n end",
"title": ""
},
{
"docid": "08c80b95718149e768a45aa3261059e4",
"score": "0.53243387",
"text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n format.ics do\n calendar = Icalendar::Calendar.new\n calendar.add_event(@event.to_ics)\n calendar.publish\n render :text => calendar.to_ical\n end\n end\n \n end",
"title": ""
},
{
"docid": "04ce9e5cdb327ff8f3106090003208b6",
"score": "0.53075194",
"text": "def export(*events)\n events.map do |event|\n exported_events[event.to_sym] ||= exported_events.size\n end\n end",
"title": ""
},
{
"docid": "1f43530d2857f8fcebbc88ca11ec3e95",
"score": "0.5298658",
"text": "def current_events(format=:ics)\n raise ArgumentError unless ['ics', 'rss'].include?(format.to_s)\n \"#{API_URL.chop}/2.0/artist/#{CGI::escape(@name)}/events.#{format.to_s}\"\n end",
"title": ""
},
{
"docid": "df6e42732de3156b8a2e090138157be0",
"score": "0.5287862",
"text": "def to_ics\n @items.map(&:to_ics).join(\"\\n\")\n end",
"title": ""
},
{
"docid": "deddeb9b1fe210e46e38d36aea5e28e0",
"score": "0.52650785",
"text": "def show\n @categorized_applications = {\n \"Pending applications\" => @event.applications.submitted.pending,\n \"Approved applications\" => @event.applications.approved,\n \"Rejected applications\" => @event.applications.rejected\n }\n\n respond_to do |format|\n format.html\n format.csv { send_data @event.to_csv, filename: \"#{@event.name} #{DateTime.now.strftime(\"%F\")}.csv\" }\n end\n end",
"title": ""
},
{
"docid": "0d3152effec87bed6170b2a8c867fd1e",
"score": "0.5247531",
"text": "def icalendar\n load_calendar_data(Company.where(:ics_identifier => params[:id]).first)\n \n respond_to do |format|\n format.ics {\n render :text => get_icalendar(@appointments)\n }\n end\n end",
"title": ""
},
{
"docid": "6abb9be6743908ce327e74eaf0f164c5",
"score": "0.52428794",
"text": "def index\n if params[:category]\n case params[:category]\n when WEEKLY\n @events = Event.weekly\n when MONTHLY\n @events = Event.monthly\n when ANNUAL\n @events = Event.annual\n end\n else\n @events = Event.includes(:category, :location).all\n end\n end",
"title": ""
},
{
"docid": "fb696d44f6dbd3dc196de75bce5d6cf6",
"score": "0.52424",
"text": "def index\n \n render json: Event.get_events_by_category(0)\n\n end",
"title": ""
},
{
"docid": "9747d96e5a22208ecdf8f6a199697b84",
"score": "0.5242145",
"text": "def index\n @casein_page_title = 'Events'\n @events = Event.order(sort_order(:title)).paginate :page => params[:page]\n respond_to do |format|\n format.html\n format.csv { send_data Event.all.to_csv, filename: \"events-#{Date.today}.csv\"}\n format.xlsx\n end\n end",
"title": ""
},
{
"docid": "673a26e034eee27dac310fe286051161",
"score": "0.5240405",
"text": "def export\n unless params[:page]\n params[:page] = 1\n end\n # Determine report type so we know what filter to apply\n case params[:type]\n when 'geofence'\n event_type = '%geofen%'\n else\n event_type = '%'\n end\n get_start_and_end_date\n if params[:type]=='stop'\n events = StopEvent.find(:all, {:order => \"created_at asc\",\n :conditions => [\"device_id = ? and created_at between ? and ?\", params[:id], @start_dt_str, @end_dt_str]})\n elsif params[:type] == 'idle'\n events = IdleEvent.find(:all, {:order => \"created_at asc\",\n :conditions => [\"device_id = ? and created_at between ? and ?\", params[:id], @start_dt_str, @end_dt_str]})\n elsif params[:type] =='runtime'\n events = RuntimeEvent.find(:all, {:order => \"created_at asc\",\n :conditions => [\"device_id = ? and created_at between ? and ?\", params[:id], @start_dt_str, @end_dt_str]})\n else\n readings = Reading.find(:all,:order => \"created_at asc\",:offset => ((params[:page].to_i-1)*ResultCount),:limit=>MAX_LIMIT,\n :conditions => [\"device_id = ? and event_type like ? and created_at between ? and ?\", params[:id],event_type,@start_dt_str,@end_dt_str])\n end\n # Name of the csv file\n @filename = params[:type] + \"_\" + params[:id] + \".csv\"\n csv_string = FasterCSV.generate do |csv|\n if ['stop','idle','runtime'].include?(params[:type])\n csv << [\"Address\",\"#{params[:type].capitalize} Duration (m)\",\"Started\",\"Latitude\",\"Longitude\"]\n events.each do |event|\n local_time = event.get_local_time(event.created_at.in_time_zone.inspect)\n address = event.reading.nil? ? \"#{event.latitude};#{event.longitude}\" : event.reading.short_address\n csv << [address,((event.duration.to_s.strip.size > 0) ? event.duration : 'Unknown'),local_time, event.latitude,event.longitude]\n end\n else\n csv << [\"Address\",\"Speed (mph)\",\"Started\",\"Latitude\",\"Longitude\",\"Event Type\"]\n readings.each do |reading|\n local_time = reading.get_local_time(reading.created_at.in_time_zone.inspect)\n csv << [reading.short_address,reading.speed,local_time,reading.latitude,reading.longitude,reading.event_type]\n end\n end\n end\n\n send_data csv_string,\n :type => 'text/csv; charset=iso-8859-1; header=present',\n :disposition => \"attachment; filename=#{@filename}\"\n end",
"title": ""
},
{
"docid": "d6e19947c22100620c0fce0ef2e0cecf",
"score": "0.5233227",
"text": "def index\n @event_categories = EventCategory.all\n end",
"title": ""
},
{
"docid": "20eebcea33ef9e480d9206dd700c1def",
"score": "0.523048",
"text": "def gather_events(filename, date)\n chapters = YAML.load_file(filename)\n events = chapters.collect do |k,v|\n v['events'].select do |e|\n ed = Time.at(e['time'] / 1000)\n ed.month == date.month && ed.year == date.year && e.key?('venue')\n end\n end\n sort_events(events.reject(&:empty?).flatten).reverse\n end",
"title": ""
},
{
"docid": "dc0507f23ab681f04a075e566e63471a",
"score": "0.5220333",
"text": "def request_ics_from_event(event)\n ics_path = (event/:href).text\n load_ics(ics_path)\n end",
"title": ""
},
{
"docid": "c124e152d158514218f82ebc80a21b80",
"score": "0.52164584",
"text": "def ics_parser(ics_text)\n events = Array.new\n cur_event_lines = Array.new\n processing_an_event = 0\n ics_text.each do |l|\n l = l.strip\n if l =~ /BEGIN:VEVENT/\n processing_an_event = 1\n cur_event_lines = Array.new\n next\n end\n if l =~ /END:VEVENT/\n processing_an_event = 0\n start_time = cur_event_lines.map {|i| i if i =~ /^DTSTART/}.delete_if {|j| j.nil?}\n end_time = cur_event_lines.map {|i| i if i =~ /^DTEND/}.delete_if {|j| j.nil?}\n summary = cur_event_lines.map {|i| i if i =~ /^SUMMARY/}.delete_if {|j| j.nil?}\n description = cur_event_lines.map {|i| i if i =~ /^DESCRIPTION/}.delete_if {|j| j.nil?}\n location = cur_event_lines.map {|i| i if i =~ /^LOCATION/}.delete_if {|j| j.nil?}\n uid = cur_event_lines.map {|i| i if i =~ /^UID:/}.delete_if {|j| j.nil?}\n\n start_time = start_time[0] if start_time.instance_of? Array\n end_time = end_time[0] if end_time.instance_of? Array\n summary = summary[0] if summary.instance_of? Array\n description = description[0] if description.instance_of? Array\n location = location[0] if location.instance_of? Array\n uid = uid[0] if uid.instance_of? Array\n\n if start_time.nil?\n STDERR.puts \"nil start_time for Array #{cur_event_lines}\"\n next\n end\n if end_time.nil?\n STDERR.puts \"nil end_time for Array #{cur_event_lines}\"\n next\n end\n\n # Convert a date like DTSTART:20091208T030000Z\n # or DTSTART;TZID=America/Los_Angeles:2009-09-15T21:30:00\n # into 2009-12-07T19:00:00\n # (assuming pacific time)\n\n start_time_gmt = 1\n start_time_gmt = 0 if start_time =~ /DTSTART;TZID=America.Los_Angeles/\n start_time = start_time.gsub(/^DTSTART.*:/, \"\").gsub(/(\\d\\d\\d\\d)(\\d\\d)(\\d\\d)T(\\d\\d)(\\d\\d)(\\d\\d)Z?/, '\\1-\\2-\\3T\\4:\\5:\\6')\n if start_time_gmt == 1\n start_time = Time.iso8601(\"#{start_time}Z\")\n else\n start_time = Time.iso8601(start_time)\n end\n\n end_time_gmt = 1\n end_time_gmt = 0 if end_time =~ /DTEND;TZID=America.Los_Angeles/\n end_time = end_time.gsub(/^DTEND.*:/, \"\").gsub(/(\\d\\d\\d\\d)(\\d\\d)(\\d\\d)T(\\d\\d)(\\d\\d)(\\d\\d)Z?/, '\\1-\\2-\\3T\\4:\\5:\\6')\n if end_time_gmt == 1\n end_time = Time.iso8601(\"#{end_time}Z\")\n else\n end_time = Time.iso8601(end_time)\n end\n\n this_event = Hash.new\n this_event[:start_time] = start_time\n this_event[:end_time] = end_time\n this_event[:summary] = summary.gsub(/^SUMMARY:\\s*/, \"\").gsub(/\\s*$/, \"\")\n this_event[:description] = description.gsub(/^DESCRIPTION:\\s*/, \"\").gsub(/\\s*$/, \"\")\n location = \"\" if location == nil\n this_event[:location] = location.gsub(/^LOCATION:\\s*/, \"\").gsub(/\\s*$/, \"\")\n uid = `uuidgen`.strip if uid == nil\n this_event[:uuid] = uid\n events.push(this_event)\n next\n end\n cur_event_lines.push(l)\n end\n events\nend",
"title": ""
},
{
"docid": "5bd8b1c74cc19bddb60f39477bae9023",
"score": "0.521196",
"text": "def index\n load_categories\n @event_category = EventCategory.new\n\n respond_with(@event_category)\n end",
"title": ""
},
{
"docid": "cbfff03488bb689483b13dfe9e9b9964",
"score": "0.5210631",
"text": "def all\n @events = Event.select(\"event_date, quantity, description\").where(:user_id => current_user.id).order(:event_date)\n\n respond_to do |format|\n format.xml { render :xml => @events }\n format.csv { \n csv = @events.collect { |e| [e.event_date, e.quantity, e.description].to_csv }\n csv.unshift [\"event date\", \"quantity\", \"description\"].to_csv\n\n render :content_type => 'text/csv', :text => csv.join(\"\")\n }\n end\n end",
"title": ""
},
{
"docid": "d240e4867190b5c2522246f2f23416e4",
"score": "0.52053124",
"text": "def show\n # require 'to_xls-rails'\n @city_actions = CalendarAction.where(:holder => '1')\n @people_actions = CalendarAction.where(:holder => '2')\n respond_to do |format|\n format.html{}\n format.xls { send_data @calendar.to_xls() }\n end\n end",
"title": ""
},
{
"docid": "40333ff9eff74ef9ad2ec34cdbac3e47",
"score": "0.5189873",
"text": "def index\n @products = Product.all\n respond_to do |format|\n format.html\n format.xlsx { put_attachment_name \"Prices #{Time.now.utc.strftime('%Y%M%d%H%M%S')}.xlsx\" }\n end\n @categories = Category.all\n end",
"title": ""
},
{
"docid": "85817fa192d074d75628b1d85d9a5ebf",
"score": "0.51885664",
"text": "def browse_all_categories\n @podcast_counter = 0\n puts \"\"\n puts \"Main Menu: All Categories\".colorize(:light_blue)\n PodcastFinder::Category.list_categories\n puts \"\"\n puts \"To get started, choose a category above (1-#{PodcastFinder::Category.all.size}) or type 'help' to see a list of commands.\".colorize(:light_blue)\n puts \"You can also type 'exit' at any point to quit.\".colorize(:light_blue)\n self.choose_category\n end",
"title": ""
},
{
"docid": "5e5aac5187af1347c0adeebdc9521376",
"score": "0.5185385",
"text": "def print_calendar\n cal = find_calendar( Persistent::DiskStore.new(CALENDAR_FILE) )\n cal.list_days(options[:from], options[:to], options[:show_empty], options[:with_ids]).compact.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "85c4c24ba2a463112f544f4e47578fec",
"score": "0.5169074",
"text": "def index\n @events = @category.events.includes(:event_choices)\n @form = EventForm.new(Event.new)\n @form.event_categories.build\n\n respond_with(@events)\n end",
"title": ""
},
{
"docid": "8dc4513274dc5bebaa35d2bdebda767e",
"score": "0.5168649",
"text": "def index\n\n if params[:category_id]\n @category = Category.find( params[:category_id] )\n @events = @category.events.page( params[:page] ).per(3)\n else\n @events = Event.page( params[:page] ).per(3)\n end\n\n @event = Event.new\n\n @categories = Category.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @events.to_xml }\n format.json { render :json => @events.to_json }\n format.atom { @feed_title = \"My event list\" } # index.atom.builder\n end\n end",
"title": ""
},
{
"docid": "57af6bbfd6bbee3ee03f7f31fd68fe63",
"score": "0.51611817",
"text": "def delete_events\n store = Persistent::DiskStore.new(CALENDAR_FILE)\n calendar = store.find(@options[:name])\n calendar.reject_events_by_id!(*@options[:delete_events])\n store << calendar\n end",
"title": ""
},
{
"docid": "be05a988379c1fd35dd585b328e84f2c",
"score": "0.5160404",
"text": "def aggregateAppleCalenders\n calenders = Array.new\n Dir.glob(\"#{@calendarPath}**/*.ics\").each do |path|\n calenders += Icalendar.parse( File.open(path) )\n end\n return calenders\n end",
"title": ""
},
{
"docid": "3ffae463be0f2106bbae576305a38c58",
"score": "0.5152478",
"text": "def index\n @admin_config_categories = Admin::ConfigCategory.all.paginate(:page => params[:page])\n @export = Admin::ConfigCategory.all\n respond_to do |format|\n format.html\n format.xlsx {\n response.headers['Content-Disposition'] = 'attachment; filename=\"Config-category.xlsx\"'\n }\n format.js { render :layout => false }\n end\n end",
"title": ""
},
{
"docid": "b4e5e46024c34e34a7f4619a8ad87429",
"score": "0.51366955",
"text": "def show\n @event = Event.find(params[:id])\n @page_title = \"#{@event.name} (#{@event.city})\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n format.ics do\n @calendar = Icalendar::Calendar.new\n @calendar.custom_property('X-WR-CALNAME','PixelCal Photo/Video Events')\n event = Icalendar::Event.new\n event.start = @event.starts_on.strftime(\"%Y%m%d\")\n event.end = @event.ends_on.strftime(\"%Y%m%d\") unless @event.ends_on.nil?\n event.summary = @event.name\n event.description = @event.description.blank? ? 'No description available' : @event.description.gsub(/<\\/?[^>]*>/, \"\") \n event.location = \"#{@event.venue_name} (#{@event.city})\"\n event.url = url_for @event\n event.uid = \"#{@event.id}@pixelcal.com\"\n @calendar.add event\n @calendar.publish\n send_data @calendar.to_ical, :layout => false, :content_type => \"text/calendar; charset=UTF-8\", :disposition => \"inline; filename=pixelcal.ics\", :filename => \"pixelcal.ics\"\n end\n end\n end",
"title": ""
},
{
"docid": "9dd8b4db7b8ff916c5d300ce0af32494",
"score": "0.51353663",
"text": "def all_events\n calendar = Icalendar::Calendar.parse(CalendarLoader.body).first\n calendar.events.flat_map do |event|\n Time.zone = 'London'\n event.dtstart = event.dtstart.in_time_zone\n event.dtend = event.dtend.in_time_zone\n\n # I really hope there never needs to be an event more than 100 years into\n # the future\n event.occurrences_between(Date.today - 100.years, Date.today + 100.years).map do |occurrence|\n event_occurrence = event.clone\n event_occurrence.dtstart = occurrence.start_time\n event_occurrence.dtend = occurrence.end_time\n event_occurrence\n end\n end\nend",
"title": ""
},
{
"docid": "20ef3e26a16e1dcbc1198b44364ea9e9",
"score": "0.5117165",
"text": "def show\n puts params\n respond_to do |format|\n format.html\n format.ics { send_data(create_ical_from(@routine, params[:datetime], params[:days]), :filename=>\"RoutineBuilders.ics\", :disposition=>\"inline; filename=RoutineBuilders.ics\", :type=>'text/calendar')}\n end\n end",
"title": ""
}
] |
fca81a9a2b1f51d6bf4ab69b8d8680fd
|
Process each of the commit by sequentially going through by index and inserting in to hash
|
[
{
"docid": "5dd9f1f84b183be46872e7d7cebd2352",
"score": "0.72361445",
"text": "def index_process_commit(arr, hash)\n\n commit_hash_str = arr[0].strip\n author_email_str = arr[2].strip\n created_at_tstamp = DateTime.parse(arr[3].strip)\n parent_hash = arr[4].strip\n\n #add commit hash\n hash[:commit_hash] = commit_hash_str[0..254]\n puts \"WARNING! Hash too long #{commit_hash_str}\" if commit_hash_str.length > 254\n\n #add email\n hash[:author_email] = author_email_str[0..254]\n puts \"WARNING! Email too long #{author_email_str}\" if author_email_str.length > 254\n \n #add author id \n dev = Developer.search_or_add author_email_str\n if dev.nil?\n unless %w(initial.commit\n license.bot@0039d316-1c4b-4281-b951-d872f2087c98\n initial.commit@0039d316-1c4b-4281-b951-d872f2087c98\n ).include? author_email_str\n puts \"WARNING! Email invalid for #{author_email_str}\"\n end\n else\n hash[:author_id] = dev.id \n end\n\n #add Date/Time created\n hash[:created_at] = created_at_tstamp\n\n #add parent_commit_hash\n hash[:parent_commit_hash] = parent_hash[0..254]\n puts \"WARNING! Parent hash too long #{parent_hash}\" if parent_hash.length > 254\n\n add_commit_to_db(hash)\n\n arr.clear\n\n end",
"title": ""
}
] |
[
{
"docid": "8782af53669bf2a0b6311529ef5a0389",
"score": "0.6770591",
"text": "def each_entry_with_index\n @index.each_with_index do |hash, idx|\n next if hash.nil?\n entry = '' \n hash.each {|x| entry << pack(x.sha1, @block_ary[x.block].start, @block_ary[x.block].size, x.buflocation, x.size) }\n yield entry, idx \n end\n end",
"title": ""
},
{
"docid": "f421da0203b133bdb1dbb5cae8c7f388",
"score": "0.66083765",
"text": "def iterate_commits\n raw_commits.each do |raw_commit|\n self.commit(raw_commit.sha)\n end\n end",
"title": ""
},
{
"docid": "c9183e1225d9aa5fe4edfb16516f3810",
"score": "0.62338555",
"text": "def create_commits\n present_commits = user.repositories.find_by(name: repository_name).commits.pluck(:sha)\n commits_details = []\n commits.each do |commit|\n commits_details << get_commit_hash(commit) unless present_commits.include?(commit['sha'])\n end\n Commit.bulk_insert values: commits_details\n end",
"title": ""
},
{
"docid": "04d2240289292d090edd4e130448daa1",
"score": "0.62291694",
"text": "def commit\n self.index.commit(@commit_msg, @commit_author)\n end",
"title": ""
},
{
"docid": "e396c06fa84e4bb36a3c639ecb39fa55",
"score": "0.61856556",
"text": "def commit_all(index, last_commit, last_tree)\n callback = self.git_settings.commit_message\n # $stderr.puts self.git_settings.inspect\n message = case callback\n when Symbol\n self.send(callback)\n when Proc\n callback.call(self)\n else\n \"new version of #{self.class}, id: #{self.id.to_s}\" \n end\n lc = (last_commit ? [last_commit.id] : nil)\n index.commit(message, lc, @model_user)\n end",
"title": ""
},
{
"docid": "3f4c633aa10a4a84af1ea80db9e825e4",
"score": "0.6140784",
"text": "def add_commit_to_db(hash)\n #insert hash values into proper attribute in commits table\n @con.exec_prepared('commitInsert', hash.values_at(*@@GIT_LOG_PROPERTIES))\n \n create_commit_filepath(hash[\"filepaths\"], hash[:commit_hash])\n create_commit_bug(hash[:bug], hash[:commit_hash]) if hash[:bug]!=nil\n end",
"title": ""
},
{
"docid": "d37f5c0f55171f63fe9635d1ab5f2205",
"score": "0.5996676",
"text": "def commit()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "273e3f9f4c4913e4e2b6af93a7b0713a",
"score": "0.59727067",
"text": "def commit\n if !@rollback\n @indexes.each_value do |index| \n $LUCENE_LOGGER.debug{\"BEGIN: Commit index #{index} txt #{to_s}\"} \n index.commit\n $LUCENE_LOGGER.debug{\"END: Commited index #{index} txt #{to_s}\"}\n end \n end\n @commited = true\n $LUCENE_LOGGER.error(\"Index was not removed from commited transaction: #{@indexes.inspect}\") if !@indexes.empty? && !@rollback \n @indexes.clear\n Thread.current[:lucene_transaction] = nil\n end",
"title": ""
},
{
"docid": "0ebd34ef2ec81adc6780359aec42d993",
"score": "0.5953706",
"text": "def index\n @index ||= @repository.rugged.merge_commits(@our_commit, @their_commit)\n end",
"title": ""
},
{
"docid": "ac12fef94d71a707e96bd0007ea18dea",
"score": "0.59419864",
"text": "def batch(&block)\n # NOTE: the use of 'self.staging' is quite important in this method.\n\n # write current index to git-staging-index\n idx = self.staging? ? self.staging : nil\n idx.sync if idx\n\n # replace current index with an in-mem staging index\n unstage\n self.staging=StageMemIndex.read(self)\n\n begin\n yield staging if block_given?\n\n rescue Exception => e\n # ensure index is discarded if there is a problem\n unstage\n self.staging if idx\n raise e\n end\n\n # write in-mem staging index to git-staging-index\n self.staging.force_sync\n\n # read git-staging-index if appropriate\n unstage\n self.staging if idx\n end",
"title": ""
},
{
"docid": "afc58498523081bc6ada8a28e32384f7",
"score": "0.5932332",
"text": "def git_add_all\n index.add_all\n index.write\n end",
"title": ""
},
{
"docid": "b286a25921b21df5d3191a66d69b6c87",
"score": "0.5924323",
"text": "def git_add_all\n index.add_all\n index.write\n end",
"title": ""
},
{
"docid": "1506d544b89132eeabf1d191e45057f0",
"score": "0.58641565",
"text": "def update_commitlist(h)\n h.map do |entry|\n sha = entry[\"commit\"].to_s.strip\n n = entry[\"note\"]\n # First, try to look it up in our existing repo\n if commit_exists?(sha) || sha.empty?\n entry # do nothing, put it back in the hash\n else\n # Ok, we know it doesn't exist. Now look it up in gitlog.json\n if @gitlog_json.key? sha\n m = @gitlog_json[sha][\"message\"]\n svn_id = m.lines.select {|l| l.match? /git-svn-id/ }.join.strip\n grep_cmd = <<~EOS.strip\n git -C ./tmp/src rev-list --all --grep=\"#{svn_id}\" --\n EOS\n stdout, stderr, status = Open3.capture3(grep_cmd)\n if stderr.empty?\n {\n \"commit\" => stdout.strip,\n \"note\" => <<~EOS.strip\n #{entry[\"note\"].to_s.lines.join(\"\\n\")}\n\n Formerly #{sha} before HTTPD rewrote Git history.\n EOS\n }\n else\n warn \"ERROR getting commit #{sha}. #{stderr}\"\n entry\n end\n else\n warn \"ERROR commit #{sha} does not exist in gitlog.json\"\n entry\n end\n end\n end\nend",
"title": ""
},
{
"docid": "d13b94f96493ea714239b8cf260859ad",
"score": "0.5846382",
"text": "def update_commit_history\n raw_commits = `cd #{project_repo_path} && git fetch && git checkout #{self.trunk_branch} && git log --pretty='%H -::- %an -::- %s -::- %ai'`\n raw_commits.each do |raw_commit|\n # commit format\n # 0 => hash\n # 1 => author name\n # 2 => commit message\n # 3 => commit date\n commit = raw_commit.split(\"-::-\")\n commit.collect!(&:strip)\n # avoid issues with git log header and footer information \n if commit.count == 4\n author = GitAuthor.find_or_create_by_name(commit[1])\n # note that this breaks if two projects manage to get the same hash\n obj = GitCommit.find_by_commit_hash(commit[0])\n attributes = {\n :commit_hash => commit[0],\n :project => self, \n :git_author => author, \n :subject => commit[2], \n :commit_at => Time.parse(commit[3])\n }\n if obj.nil?\n GitCommit.create!(attributes)\n else\n # for now, assume you cannot update a commit\n # makes this run much faster\n # obj.attributes = attriubtes\n # obj.save!\n end\n end\n end\n end",
"title": ""
},
{
"docid": "c1e1724b7012a747b05e2dc0ddd8ed97",
"score": "0.57964903",
"text": "def git_commit\n init_structure\n sha = add_all_changes_to_git\n \n if self.attributes.has_key?(\"version\") \n self.version = sha\n self.connection.update(\"UPDATE #{self.class.table_name} SET version='#{sha}' WHERE id='#{self.id}'\")\n end\n \n return sha\n end",
"title": ""
},
{
"docid": "99c075d80bf3e626a4e9f6da560637ab",
"score": "0.57744205",
"text": "def grit_update\n grit_repo = Repo.new(self.aq_repository.path)\n new_commits_count = grit_repo.commit_count(self.name) - self.commits.count\n count = 0\n while (count < new_commits_count)\n commits = grit_repo.commits(self.name, 10, count)\n commits.each do |c|\n if not self.commits.find_by_sha(c.id)\n a_commit = AqCommit.new(:sha => c.id,\n :log => c.message,\n :author_name => c.author.name,\n :created_at => c.committed_date,\n :committed_time => c.committed_date,\n :repository => self.aq_repository)\n c.diffs.each do |diff|\n begin\n a_file = AqFile.find_by_path(diff.b_path, :conditions => [\"aq_branch_id = ?\", self.id])\n rescue\n a_file = nil\n end\n if !a_file\n a_file = AqFile.new(:name => diff.b_path.split(\"/\").last, :path => diff.b_path)\n a_file.branch = self\n end\n self.files << a_file if !a_file.branch\n self.aq_repository.files << a_file if !a_file.repository\n a_commit.aq_files << a_file\n end\n a_commit.author = self.aq_repository.owner\n self.commits << a_commit\n self.save\n end\n end\n diff_c = new_commits_count - count\n if (diff_c > 10)\n count += 10\n else\n count += diff_c\n end\n end\n if self.aq_repository.owner.nil?\n the_user = User.our_current_user.login || \"error: cant get user login\"\n else\n the_user = self.aq_repository.owner.login\n end\n aq_logger(Settings.logs.scm, \"User #{the_user}, Branch : #{self.name}, #{count} commits treated.\")\n end",
"title": ""
},
{
"docid": "f5e74eed3b2c489df32221bb9a83d03a",
"score": "0.5764566",
"text": "def commit(index_name)\n uri = @client.make_uri(\"/#{index_name}/update/\", [[\"commit\", \"true\"]])\n req = HTTP::Post.new(uri)\n response = @client.send_http(req, true, ['200'])\n end",
"title": ""
},
{
"docid": "caab2a705317089cbe819a8c3673b33e",
"score": "0.5725405",
"text": "def create_commits commits_array\n commits_array = [commits_array] if commits_array.is_a? Hash\n normalize_commit_data commits_array\n commits_array.each do |commit_data|\n create_commit add_default_commit_data(commit_data)\n end\nend",
"title": ""
},
{
"docid": "375883a77406a015c90b2bd791615a66",
"score": "0.5699737",
"text": "def each\n git.tree.each_pair(true) do |ab, xyz_tree|\n next unless ab.length == 2\n \n xyz_tree.each_pair(true) do |xyz, target_tree|\n source = \"#{ab}#{xyz}\"\n \n target_tree.keys.each do |target|\n doc_sha = assoc_sha(source, target)\n yield(doc_sha) if doc_sha\n end\n end\n end\n end",
"title": ""
},
{
"docid": "a6d406111c6c9393234bc95908b3bee3",
"score": "0.5665821",
"text": "def commit!(msg=status)\n setup unless head\n \n sha = git.commit!(msg)\n index.write(sha)\n sha\n end",
"title": ""
},
{
"docid": "1b8b4152f791f0674914b95f1ed21fa2",
"score": "0.565038",
"text": "def commit\n head.commit\n end",
"title": ""
},
{
"docid": "b0fc37f4042e4862d69fa5f9ba9f2085",
"score": "0.5648503",
"text": "def save(options)\n author = options[:author] ? Grit::Actor.new(options[:author][:name], options[:author][:email]) : nil\n committer = options[:committer] ? Grit::Actor.new(options[:committer][:name], options[:committer][:email]) : nil\n \n index = git.index\n if head\n commit = head.commit\n index.current_tree = commit.tree\n end\n yield index\n index.commit(options[:message], :parents => Array(commit), :author => author, :committer => committer, :head => branch) if index.tree.any?\n end",
"title": ""
},
{
"docid": "b0fc37f4042e4862d69fa5f9ba9f2085",
"score": "0.5648503",
"text": "def save(options)\n author = options[:author] ? Grit::Actor.new(options[:author][:name], options[:author][:email]) : nil\n committer = options[:committer] ? Grit::Actor.new(options[:committer][:name], options[:committer][:email]) : nil\n \n index = git.index\n if head\n commit = head.commit\n index.current_tree = commit.tree\n end\n yield index\n index.commit(options[:message], :parents => Array(commit), :author => author, :committer => committer, :head => branch) if index.tree.any?\n end",
"title": ""
},
{
"docid": "a0c8c9df4758d53fb1ac4a79b3532c97",
"score": "0.5642808",
"text": "def commit(msg=status)\n setup unless head\n \n sha = git.commit(msg)\n index.write(sha)\n sha\n end",
"title": ""
},
{
"docid": "1ab287a4fad8f36bb014733f0742cb9d",
"score": "0.56179327",
"text": "def execute!\n logger.info(\"Pushing commit #{commit_log.commit_id}\")\n\n if phrases.size > 0\n commit_log.phrase_count = phrases.size\n repo_config.tms.store_phrases(phrases, commit_log.commit_id)\n commit_log.push\n else\n commit_log.finalize!\n end\n\n logger.info(\"Finished pushing commit #{commit_log.commit_id}\")\n rescue Java::OrgEclipseJgitErrors::MissingObjectException => ex\n commit_log.missing\n ensure\n save_commit_log\n end",
"title": ""
},
{
"docid": "97ab7fe348bb198fd01aa6b73d606e83",
"score": "0.56134087",
"text": "def get_commits(file)\n commit_queue= Array.new\n isCommitSec = false\n isStarted = false\n\n file.each_line do |line|\n if line.strip =~ (/^:::$/) or line.strip =~ (/^;;;:::$/)\n #begin processing, encountered\n #first commit (:::) avoid adding \n #any garbage before first commit\n if not isStarted\n isStarted = true\n else\n # Process commits, we already have queued the commit\n commit, hash = regex_process_commit(commit_queue)\n index_process_commit(commit, hash)\n end\n\n else\n #avoid adding empty string or havent started yet\n commit_queue.push(line) unless line.strip == \"\" or not isStarted\n end\n end#loop\n\n #process commits\n commit, hash = regex_process_commit(commit_queue)\n index_process_commit(commit, hash)\n\n end",
"title": ""
},
{
"docid": "cb57b078683562d4afd077fb78a29c94",
"score": "0.55867594",
"text": "def commits(commit=head)\n commits_for(commit)\n end",
"title": ""
},
{
"docid": "900b788449ee684d2c4b0b1bec1d37f4",
"score": "0.55482185",
"text": "def commit\n # TODO not enough to block threads here, since the @uncommited and @deleted_ids may change\n # Need to synchronize \n lock.synchronize do\n $LUCENE_LOGGER.debug \" BEGIN: COMMIT\"\n delete_documents # deletes all docuements given @deleted_ids\n \n # are any updated document deleted ?\n deleted_ids = @uncommited.keys & @deleted_ids\n # delete them those\n deleted_ids.each {|id| @uncommited.delete(id)}\n \n # update the remaining documents that has not been deleted\n update_documents # update @documents\n \n @uncommited.clear # TODO: should we do this in an ensure block ?\n @deleted_ids.clear\n \n # if we are running in a transaction remove this so it will not be commited twice\n Transaction.current.deregister_index(self) if Transaction.running?\n $LUCENE_LOGGER.debug \" END: COMMIT\" \n end\n rescue => ex\n $LUCENE_LOGGER.error(ex)\n # ex.backtrace.each{|x| $LUCENE_LOGGER.error(x)}\n raise ex\n end",
"title": ""
},
{
"docid": "3a0101370a257e19f69444aac434b5dc",
"score": "0.54962987",
"text": "def commit\n submissions.each(&:commit)\n end",
"title": ""
},
{
"docid": "bb6f0ee9120433d7324c861aa0be24dd",
"score": "0.5482576",
"text": "def dispatch_hashing!\n Thread::new do\n begin\n self.logger.debug { \"Starting hashset dispatcher.\" }\n \n data = true\n position = @options.offset * @options.blocksize\n \n if @options.blockcount\n target = position + @options.blockcount * @options.blocksize\n else\n target = nil\n end\n \n self.logger.info { \"Starting indexing for transfer.\" }\n \n while data and (target.nil? or position < target)\n self.file.acquire do |file|\n self.logger.debug { \"Reading block from position #{position}.\" }\n file.seek(position)\n data = file.read(@options.blocksize)\n end\n \n position += @options.blocksize\n @hash_queue << Digest::SHA1.hexdigest(data) if data\n end\n \n # indicates finish\n @hash_queue << :end\n \n self.logger.info { \"Indexing for transfer finished.\" }\n \n rescue Exception => e\n self.logger.fatal { \"#{e.class.name}: #{e.message}\\n #{e.backtrace.join(\"\\n\")}\" }\n end\n end\n end",
"title": ""
},
{
"docid": "83c2407523bdc01b711d7999f3dd0d4e",
"score": "0.54592633",
"text": "def test_commit_stress_1\n Repository.create()\n\n # should be 1000, since we wrote 1000 in our acceptance test\n (0..10).each do |e| \n filename = '.test_file' + e.to_s\n FileUtils.touch(filename)\n a = [filename]\n Repository.add(a) \n Repository.commit()\n end\n end",
"title": ""
},
{
"docid": "b4003008064700df89de1cbf40139c4a",
"score": "0.54516804",
"text": "def commit; end",
"title": ""
},
{
"docid": "b4003008064700df89de1cbf40139c4a",
"score": "0.54516804",
"text": "def commit; end",
"title": ""
},
{
"docid": "b4003008064700df89de1cbf40139c4a",
"score": "0.54516804",
"text": "def commit; end",
"title": ""
},
{
"docid": "f9627eb62300f0f0a7f394a98ab21e02",
"score": "0.5435053",
"text": "def commit\n {}\n end",
"title": ""
},
{
"docid": "f9627eb62300f0f0a7f394a98ab21e02",
"score": "0.5435053",
"text": "def commit\n {}\n end",
"title": ""
},
{
"docid": "f25e2de79bff6d6b153076f9bc0437af",
"score": "0.53935915",
"text": "def commit args = {}\n action = :deleted if self.deleted?\n action ||= self.is_new? ? :added : (self.is_changed? ? :updated : :nothing_to_commit) \n args[:skip_part_data] ||= false\n \n unless action.eql?(:nothing_to_commit)\n message = \"#{action} #{name}\"\n message = args[:m] if args[:m] \n if action.eql?(:deleted)\n repo.remove(self.file_name)\n self.history_count += 1\n else\n repo.add(self.file_name)\n end\n\n active_message = self.commit_messages[:most_recent]\n message = \"#{active_message.gsub(message,\"\")}\" unless self.deleted? || active_message.blank? || active_message.eql?(message)\n self.remove_message_from_temp_store(:most_recent) unless active_message.blank?\n \n repo.commit(message)\n self.last_commit = repo.log(self.local_path, :limit => 1).first.to_s\n end\n unless action.eql?(:deleted) \n self.part_count = parts.count\n self.part_count ||= 0 \n update_part_data unless args[:skip_part_data]\n\n self.history_count = self.history.size\n self.history_count = 1 if self.history_count.eql?(0) \n end\n self.save if self.changed?\n \n synchronize unless args[:dont_sync] || self.attributes[\"sync\"].blank? #rather than calling sync.blank? to skip the JSON parsing step.\n return action\n end",
"title": ""
},
{
"docid": "cc7e024495398a6c4add89f0f5acd730",
"score": "0.5370935",
"text": "def commit\n # no op\n end",
"title": ""
},
{
"docid": "547b759d242996ab214513f101624a6f",
"score": "0.53690326",
"text": "def addUnchangedFilesToCommit(prev_commit, commit, changed_files) #:doc:\n# sql = \"select devfiles.path, devfiles.name, devfiles.blob_id from devfiles, blobs, blobs_in_commits where blobs.devfile_id=devfiles.id and blobs_in_commits.blob_id=blobs.id and blobs_in_commits.commit_id=#{prev_commit.id};\"\n# devfiles_of_prev_commit = ActiveRecord::Base.connection.execute(sql)\n#\n devfiles_of_prev_commit = Devfile.find_by_sql(\"select devfiles.path, devfiles.name, devfiles.blob_id from devfiles, blobs, blobs_in_commits where blobs.devfile_id=devfiles.id and blobs_in_commits.blob_id=blobs.id and blobs_in_commits.commit_id=#{prev_commit.id};\")\n if devfiles_of_prev_commit.size > 0\n ActiveRecord::Base.connection.execute(\"begin\")\n now = DateTime.now\n devfiles_of_prev_commit.each do |df|\n if not changed_files.has_key?(df.path + df.name)\n begin\n sql = \"insert into blobs_in_commits(blob_id, commit_id, created_at, updated_at) values('#{df['blob_id']}', '#{commit.id}', '#{now}', '#{now}');\"\n ActiveRecord::Base.connection.execute(sql)\n rescue\n # do nothing\n end\n end\n end\n ActiveRecord::Base.connection.execute(\"commit\")\n end\n end",
"title": ""
},
{
"docid": "6258f13b60bcf67bb86a646b21acaa2c",
"score": "0.53570753",
"text": "def commit\n thr = Thread.new do\n Zlib::GzipWriter.open(@file) do |gz|\n gz.write(JSON.generate(@a))\n end\n end \n thr.join \n end",
"title": ""
},
{
"docid": "45542500be8bfe4664eb251ce1ad7f19",
"score": "0.53551316",
"text": "def commit\n sanity_check\n @handle.commit\n end",
"title": ""
},
{
"docid": "f4bf569cdbc753dc13e74adf0ae67cc8",
"score": "0.5352597",
"text": "def commit(message)\n @repo.commit_index(\"Cron Job: #{message}\") # Commit.\nend",
"title": ""
},
{
"docid": "359e66bdb8b40455903a4241daa1e8b2",
"score": "0.53362393",
"text": "def add_to_index(wiki, index, sha, files)\n end",
"title": ""
},
{
"docid": "9af222764b52b9b24d3ea38b7b0baccd",
"score": "0.5329375",
"text": "def create\n revisions do |orig_file, sha_list|\n sha_list.each_with_index do |sha, i|\n ver = (i + 1).to_s\n # Git revisioned file\n composeversions(orig_file, sha, ver) do |content, data, file_path|\n # dont re-write files\n if File.exist?(file_path)\n linecount(file_path)\n next\n end\n\n version_content = FrontMatter.new(data)\n version_content.content = content \n write(file_path, version_content.update)\n linecount(file_path)\n end\n end\n\n sha_list.map!.with_index { |sha, i| [] << sha << (i + 1) }\n # Git Diff combination files\n composediffs(orig_file, line_count, sha_list.combination(2)) do |content, data, file_path|\n content.sub!(DIFF_HEADER_REGEXP, '')\n if change?(content)\n VersionedFiles.frontmatter[\"no_change\"] = false\n styled_content = @style.style(content)\n data.merge!(@style.stats.final)\n else\n VersionedFiles.frontmatter[\"no_change\"] = \"no_change\"\n data[\"no_change\"] = true\n end\n\n fm = FrontMatter.new(data).create\n diff_file = fm << styled_content\n write(file_path, diff_file)\n end\n end\n end",
"title": ""
},
{
"docid": "b3e1cc378860ba79fe945270d97058cf",
"score": "0.53269744",
"text": "def _commit_externals \n __pack[:stubs].each_with_index do |obj_hash, index|\n obj = obj_hash[:id]\n if obj.commit\n obj_hash[:id] = obj.id\n else\n if obj.id\n self._warnings << \"Unable to save latest version of #{obj.inspect}, stubbed at index #{index}\"\n obj_hash[:id] = obj.id if obj.id \n else \n self._warnings << \"Unable to save #{obj.inspect}, stubbed at index #{index}\" \n end \n end \n end \n end",
"title": ""
},
{
"docid": "bdbca52db89539562a5d2db6956e5930",
"score": "0.5322387",
"text": "def commit\n @git = YMDP::GitHelper.new\n @git.do_commit(@message)\n @git_hash = git.get_hash(options[:branch]) \n end",
"title": ""
},
{
"docid": "33926dbcb6fdc5129245188814d462df",
"score": "0.5312973",
"text": "def commits\n repositories.map { |r| HoC.new(r, log: @log).commits }.inject(&:+)\n end",
"title": ""
},
{
"docid": "0b465deaa469c4b3f808df67b20c835e",
"score": "0.5312266",
"text": "def commit\r\n self.class.commit_orders [self]\r\n end",
"title": ""
},
{
"docid": "fb30441903dd86e43d0184de1df6ae78",
"score": "0.52978605",
"text": "def add_commits_in_current_repo\n existing_branches.each do |branch_name|\n add_commits_in_branch branch_name\n end\n @commit_list\n end",
"title": ""
},
{
"docid": "7bda78f2656acd37ea03abba6e229929",
"score": "0.5288683",
"text": "def make!\n select_transactions!\n @transactions.each do |transaction|\n vh = VersionHistory.new(transaction.version, transaction.comment)\n VersionHistory.insert(vh)\n DbRegistry.instance.execute_batch(transaction.data)\n end\n end",
"title": ""
},
{
"docid": "b17b1c195c08c83ee331cb722695da09",
"score": "0.5252615",
"text": "def commiter() end",
"title": ""
},
{
"docid": "11b5689ca146460a244c8157e65dfb30",
"score": "0.5247056",
"text": "def apply\n #TODO: generate a better commit message\n @gl_admin.commit_index(\"Commit by gitolite gem\")\n @gl_admin.git.push({}, \"origin\", \"master\")\n end",
"title": ""
},
{
"docid": "8cd7386ae9edea359d33b15c545ddf62",
"score": "0.5243633",
"text": "def process chunk\n self.chunk = chunk\n\n\n raise_if chunk.value_size.positive?, \"Commit rows cannot have a non-zero value_size.\" if chunk.commit_row\n\n case state\n when NEW_ROW\n process_new_row\n when CELL_IN_PROGRESS\n process_cell_in_progress\n when ROW_IN_PROGRESS\n process_row_in_progress\n end\n end",
"title": ""
},
{
"docid": "4d052f17d3910d1de1298f2c7ac1bdd9",
"score": "0.5241679",
"text": "def add_commits_in_branch branch_name\n array_output_of(\"git log #{branch_name} --format='%h|%s|%an <%ae>' --topo-order --reverse\").each do |commit|\n sha, message, author = commit.split('|')\n next if message == 'Initial commit'\n @commit_list.add sha: sha, message: message, branch_name: branch_name, author: author\n end\n @commit_list\n end",
"title": ""
},
{
"docid": "7853050828af83e10951ef79cb5126a9",
"score": "0.52387875",
"text": "def update_index\n index_files = []\n index_files << upload(\"specs.4.8.gz\", specs_index)\n log \"Uploaded all specs index\"\n index_files << upload(\"latest_specs.4.8.gz\", latest_index)\n log \"Uploaded latest specs index\"\n index_files << upload(\"prerelease_specs.4.8.gz\", prerelease_index)\n log \"Uploaded prerelease specs index\"\n\n index_files.each do |file|\n tuf_repo.replace_file(file, 'targets/unclaimed', 'targets')\n end\n\n # For now assume all files are unclaimed\n pending_files = tuf_pending_store.pending\n pending_files.each do |file|\n puts \"Adding file: #{file.path}\"\n tuf_repo.add_file(file, 'targets/unclaimed', 'targets')\n end\n tuf_repo.publish!\n tuf_pending_store.clear(pending_files)\n end",
"title": ""
},
{
"docid": "5c302e3ef84597144e0daaeda3c3852d",
"score": "0.5229699",
"text": "def fast_export\n commit_dates.each do |date|\n make_commits(date, n_commits(date))\n end\nend",
"title": ""
},
{
"docid": "e646a10f8309f8f6d9d4c103e75b5308",
"score": "0.5195857",
"text": "def commit()\n\t@awaitingCommitString.chop!\n\t@awaitingCommitString += \"]\"\n\tputs \"debug: buffer awaiting commit:\\n\";\n\tputs @awaitingCommitString\n\t\n\tbegin\n\t\tresponse = @cs.upload_documents(documents: @awaitingCommitString, content_type: 'application/json')\n\trescue Aws::CloudSearchDomain::Errors::DocumentServiceException=>e\n\t\tbegin\n\t\t\tstructuredExceptionData = JSON.parse(e.message)\n\t\t\tputs \"A DocumentServiceException occurred:\"\n\t\t\tap structuredExceptionData\n\t\t\tputs e.backtrace\n\t\t\texit(1)\n\t\trescue JSON::JSONError\n\t\t\tputs \"A DocumentServiceException occurred which was not parseable:\"\n\t\t\tputs e.message\n\t\t\tputs e.backtrace\n\t\t\texit(2)\n\t\tend\n\tend\n\t\n\t@awaitingCommitString = \"[\"\n\t\n\tputs \"INFO: upload_document request:\"\n\tputs \"\\tStatus: #{response.status}\"\n\tputs \"\\tAdded documents: #{response.adds}, deleted documents: #{response.deletes}\";\n\tif(response.warnings and response.warnings.length>0)\n\t\tputs \"\\tWARNINGS:\"\n\t\tresponse.warnings.each do |w|\n\t\t\tputs \"\\t\\t#{w.message}\"\n\t\tend #response.warnings.each\n\tend #if\nend",
"title": ""
},
{
"docid": "e9ef214cf5a3b237246e2ca5064a4cb5",
"score": "0.51927006",
"text": "def commit_db_transaction() \n log(\"Committing boxcar with #{@command_boxcar.length} commands\", 'commit_db_transaction()')\n \n previous_command = nil\n commands = []\n \n @command_boxcar.each do |command|\n if commands.length >= MAX_BOXCAR_SIZE or (previous_command and (command.verb != previous_command.verb))\n send_commands(commands)\n \n commands = []\n previous_command = nil\n else\n commands << command\n\t previous_command = command\n end\n end\n \n # Finish off the partial boxcar\n send_commands(commands) unless commands.empty?\n \n end",
"title": ""
},
{
"docid": "303d237631c268f3957e7259ab45aa62",
"score": "0.51840425",
"text": "def get_committed_files\n # set the current branch name to be the current branch you're on --> need to check that this works as part of push\n curr_branch_name = `git rev-parse --abbrev-ref HEAD`\n\n # raw_sha_list lists all the local, unpushed commit SHAs from your current branch\n raw_sha_list = `git log --graph --pretty=format:'%H' #{curr_branch_name}`\n\n committed_files = []\n # loop through the raw_sha_list and push properly formatted SHAs into the all_shas arr\n raw_sha_list.each_line { |sha|\n # using the .tr method on the sha makes a copy of the sha and replaces instances that matches with the to_str (second arg),\n # unless the range starts with a ^ carrot, in which case, it replaces on matches outside the range\n curr_sha = sha.tr('^A-Za-z0-9', '')\n\n # this `git diff-tree --no-commit-id --name-only -r <SHA>` will list the files of an individual commit when you add the SHA\n # on each iteration, set the changed_files variable to be the list of files from a particular commit, based its SHA\n changed_files = `git diff-tree --no-commit-id --name-only -r #{curr_sha}`\n\n # loop over the changed_files and add in each file that's part of a commit and add into the committed_files arr\n changed_files.each_line { |file|\n # remove any trailing whitespace from the file name and add into our arr\n committed_files << file.rstrip()\n }\n }\n # return the final, no-repeat array of committed files in this push\n return committed_files.uniq\nend",
"title": ""
},
{
"docid": "69d7ef6796d692afcbf4364bd62c4902",
"score": "0.5178395",
"text": "def save!\n @commits.collect do |commit|\n commit.save!\n end\n end",
"title": ""
},
{
"docid": "cd87f12df8b9622c32e4d1026b0c3072",
"score": "0.51679933",
"text": "def commit\n @handle.commit\n super\n end",
"title": ""
},
{
"docid": "620a71ff3094dd549de17ca68918dc44",
"score": "0.5161693",
"text": "def insert_hash_into_db(hash)\n with_transaction do\n hash.each do |collection, records|\n client[collection].insert_many(records)\n end\n end\n end",
"title": ""
},
{
"docid": "9b758240ad0592e8e2cf6e3c5e518da1",
"score": "0.51606363",
"text": "def commit_all(_message)\n puts 'TODO: Implement Git.commit_all'\n end",
"title": ""
},
{
"docid": "384db1a9247a511936915c52f64f0793",
"score": "0.51564944",
"text": "def commit=(_arg0); end",
"title": ""
},
{
"docid": "384db1a9247a511936915c52f64f0793",
"score": "0.51564944",
"text": "def commit=(_arg0); end",
"title": ""
},
{
"docid": "8eb9e53f72fe86d3cdfbbf1721b0b618",
"score": "0.51563275",
"text": "def perform\n # Since `is_txn_confirmations_gte_10` is the only field that may change, we can limit our query\n # to use that as a starting block\n earliest_unconfirmed_block_number = StakedCofiTransaction\n .where(is_txn_confirmations_gte_10: false)\n .order(txn_block_number: :asc)\n .select(:txn_block_number)\n .first\n &.txn_block_number\n latest_block_number = StakedCofiTransaction\n .order(txn_block_number: :desc)\n .select(:txn_block_number)\n .first\n &.txn_block_number\n start_block = earliest_unconfirmed_block_number || latest_block_number || 0\n\n transaction_items = fetch_token_transactions(start_block: start_block)\n puts \"Found #{transaction_items.length} transactions\"\n\n ActiveRecord::Base.transaction do\n transaction_items.each do |transaction_item|\n transaction = StakedCofiTransaction.find_by(txn_hash: transaction_item['hash'])\n # Check if we even need to update at all\n if transaction && transaction.is_txn_confirmations_gte_10\n puts \"Already saved transaction #{transaction_item['hash']}\"\n next\n end\n\n transaction ||= StakedCofiTransaction.new(\n txn_block_number: transaction_item['blockNumber'],\n txn_timestamp: DateTime.strptime(transaction_item['timeStamp'], '%s'),\n txn_hash: transaction_item['hash'],\n txn_block_hash: transaction_item['blockHash'],\n txn_from: transaction_item['from'],\n txn_to: transaction_item['to'],\n txn_value: transaction_item['value'],\n txn_token_decimal: transaction_item['tokenDecimal'].to_i,\n )\n transaction.is_txn_confirmations_gte_10 = (transaction_item['confirmations'].to_i >= 10)\n\n if transaction.changed?\n transaction.save!\n puts \"Created/Updated transaction #{transaction_item['hash']}\"\n end\n end\n end\n\n associate_transactions_service = AssociateUnassignedStakedCofiTransactionsService.call\n puts \"Associated #{associate_transactions_service.staked_cofi_transactions_updated.length} unassigned staked COFI transactions\"\n end",
"title": ""
},
{
"docid": "2b00a46336a66b648acf6f82c607cece",
"score": "0.51354194",
"text": "def commit!() raise NotImplementedError end",
"title": ""
},
{
"docid": "4c95d3b61010a08c8b6587cdcb1c8479",
"score": "0.51337826",
"text": "def commit_all(message)\n yield if block_given?\n\n git add: '.'\n git commit: %(-aqm \"#{message}\")\nend",
"title": ""
},
{
"docid": "4fcafd8475aa4f3c10e326244c6ac671",
"score": "0.512141",
"text": "def add(hash)\n batch << hash\n\n if batch.count % batch_size == 0\n solr_service_connection.add(batch, softCommit: soft_commit, commit: commit)\n batch.clear\n end\n end",
"title": ""
},
{
"docid": "1f88833f31ed2aa56a0eec84882a7949",
"score": "0.51190084",
"text": "def normalize_expected_commit_data commit_data\n # Convert file string list into real array\n commit_data[:file_name] = Kappamaki.from_sentence commit_data[:file_name]\n\n # Create individual expected commits for each location provided\n Kappamaki.from_sentence(commit_data.delete(:location)).map do |location|\n branch = branch_name_for_location location, commit_data[:branch]\n commit_data.clone.merge branch: branch\n end\nend",
"title": ""
},
{
"docid": "5521890d592ee6e4b0989b2e7866c01e",
"score": "0.5113567",
"text": "def save_index\r\n # if validate_markdown_repo\r\n\r\n # Write full list to json file\r\n open(INDEX_PATH, 'w') do |f|\r\n f.puts JSON.pretty_generate @index\r\n end\r\n\r\n commit_markdown_repo(@today, ar_add=nil, message='index ')\r\n # end\r\n end",
"title": ""
},
{
"docid": "426b32cba649a9ea96bd8049f762a0d7",
"score": "0.5103327",
"text": "def commit()\n @conn.commit if @conn\n Log.i(\"#{@count} new bookings added\")\n end",
"title": ""
},
{
"docid": "88b8c4b033ae2da28f1feca46751ae2a",
"score": "0.51024026",
"text": "def commit\n update\n end",
"title": ""
},
{
"docid": "0ea8aef0e637f0a87ff57cfcdd2f16bf",
"score": "0.50899094",
"text": "def regex_process_commit(arr)\n message = \"\"\n filepaths = {}\n end_message_index = 0\n hash = Hash.new\n in_files = false # Have we gotten to the file portion yet? After the ;;; delimiter\n\n #index 5 should be the start\n #of the message\n (5..arr.size-1).each do |i|\n #add lines to message string if they are not identifers of lines we want to get later\n if not arr.fetch(i) =~ (/^git-svn-id:/) and\n not arr.fetch(i) =~ (/^Review URL:/) and\n not arr.fetch(i) =~ (/^BUG/) and\n not arr.fetch(i) =~ (/^R=/)\n\n #concat the message into 1\n #string\n message = message + \" \" + arr.fetch(i)\n else\n #get the last index of the \n #message, is it multiple\n #lines\n end_message_index = i\n break\n end\n end\n\n hash[:message] = message\n arr[5] = message\n\n #remove the multi line message since we condensed it\n (6..end_message_index).each do |i| \n arr.delete(i) \n end\n\n arr.each do |element|\n if fast_match(element, /^Review URL:/)\n @reviews_to_update[element[/(\\d)+/].to_i] = arr[0].strip\n\n elsif fast_match(element, /^BUG=/)\n hash[:bug] = element.strip.sub(\"BUG=\", \"\")\n\n elsif fast_match(element, /^;;;/)\n in_files = true\n\n elsif in_files and element.include?('|') # stats output needs to have a pipe\n # collect the filepath and churn count, store in the filepath hash\n split = element.split('|')\n filepaths[split[0].strip] = split[1].to_i\n \n end#if\n\n end#arr.each\n hash[\"filepaths\"] = filepaths\n \n\n return arr, hash\n\n end",
"title": ""
},
{
"docid": "c00bcd9b40e8b5e0da9d7d52c2b1579c",
"score": "0.5089231",
"text": "def txn\n # Do a hard reset on the repository to ensure a clean slate.\n @repo.reset_hard\n # The caller should make changes and commit them.\n yield\n begin\n # Attempt to push to the origin. If an error occurs,\n # pull from the origin and rebase our local changes.\n # Then try to push again.\n @repo.push\n log << \"Database pushed\"\n rescue Config::Core::GitRepo::PushError => e\n @repo.pull_rebase\n log << \"Database pulled to resolve remote changes. Now at: #{version}\"\n # NOTE: We should determine if retries should be slower\n # or if a backoff strategy should be designed.\n retry\n end\n end",
"title": ""
},
{
"docid": "12d8b4a7c7ff7490bb544e8e708e0b9c",
"score": "0.508767",
"text": "def write_page(name, format, data, commit = {})\n index = nil\n sha1 = commit_index(commit) do |idx|\n index = idx\n add_to_index(index, '', name, format, data)\n end\n\n @access.refresh\n update_working_dir(index, '', name, format)\n\n sha1\n end",
"title": ""
},
{
"docid": "b8c9eb2650446c10d4494c16dbf46246",
"score": "0.5085587",
"text": "def commits_in_current_repo commit_fields\n CommitListBuilder.new(commit_fields).add_commits_in_current_repo.to_table\nend",
"title": ""
},
{
"docid": "5fb65b7672859f488354942ef221bdc8",
"score": "0.50846153",
"text": "def create_commit_filepath(filepaths, commit_hash)\n filepaths.each do |str_path, churn|\n @con.exec_prepared('fileInsert', [commit_hash,str_path, churn])\n end\n end",
"title": ""
},
{
"docid": "2063fb7b45ba3d6eeda3104438b4ae1b",
"score": "0.50807005",
"text": "def committed!\n @on_commit.each do |callback|\n callback.call\n end\n clear\n end",
"title": ""
},
{
"docid": "c73f0b10025abc5d378ec4a20d1dd2dc",
"score": "0.50721335",
"text": "def commit(*args)\n super(*args)\n\n ret = nil\n\n if next_action\n ret = next_action.call(*args)\n self.next_action = nil\n end\n\n ret\n end",
"title": ""
},
{
"docid": "e1e8d3e79d9485004dc7279b10064812",
"score": "0.5066019",
"text": "def perform_inner_commit\n @provider.push self\n\n begin\n perform_commit\n rescue => cause\n perform_rollback cause\n end\n\n clear\n stop\n end",
"title": ""
},
{
"docid": "dddf5b236da6a5e2e6bb3a58c31b9a31",
"score": "0.5064559",
"text": "def commit!(message)\n date = Time.now\n @status_add.each{|name, body|\n json = Article.new(name, body, date).to_json\n zcard = @redis.zcard name\n @redis.zadd name, zcard+1, json\n @redis.sadd KEY_SET, name\n @summary_redis.update MarkdownBody.new(name, body, date).summary\n }\n @remove_add.each{|name, latest_rank|\n @redis.zremrange(name, 0, latest_rank)\n }\n @redis.set MODIFIED_DATE, date.to_s\n end",
"title": ""
},
{
"docid": "723c3d317b67937ab9c0d05a95198acb",
"score": "0.50634533",
"text": "def on_add_with_index(&block)\n @index.each do |index, values|\n values.each do |v|\n block.call(index, v)\n end\n end\n @onAddBlockWithIndex = block\n end",
"title": ""
},
{
"docid": "21e53b3b9b5e0164885b68ecdd7439fd",
"score": "0.5061183",
"text": "def perform\n rv = instance_eval(&self.block)\n\n self.index.build\n if not self.nested\n commit\n @database.notify\n end\n\n rv\n end",
"title": ""
},
{
"docid": "0e4d32e2efb6bd1bf17c45b514fb2701",
"score": "0.5052722",
"text": "def commit\n @repo.commit\n end",
"title": ""
},
{
"docid": "0bd5fcc7d3a9db98ee8a6bd5a03ab560",
"score": "0.50490165",
"text": "def commits_all(num_commits)\n # Check for 'master' branch and switch to that if it exists\n # main_branch = nil\n # @repo.heads().each do |head|\n # main_branch = \"master\" if head.name == \"master\"\n # end\n main_branch = @repo.head().name\n # Get commits on that branch\n if num_commits > 50\n i = num_commits / 25\n (0..i).each do |i|\n yield @repo.commits(main_branch, 25, i*25)\n end\n else\n yield @repo.commits(main_branch, num_commits)\n end\n end",
"title": ""
},
{
"docid": "e40e10fa5633a562668195dfe1f433ae",
"score": "0.50471944",
"text": "def commit(newrevision, content_io=nil)\n if not get_indexfile_with_revision(newrevision).nil?\n raise \"Committing already-existing revision: #{newrevision} for #{@fname}\"\n end\n if content_io.nil?\n compress_file_lines = Deflate.deflate(File.read(@fname))\n else\n cont = content_io.read\n compress_file_lines = Deflate.deflate(cont)\n end\n\n # append current file fname to datafile\n length = IO.readlines(@datafile).size\n\n File.open(@datafile, \"a\") do |append|\n append.puts compress_file_lines\n end\n length = IO.readlines(@datafile).size - length\n\n # new version is the old version plus 1\n # new offset is the last length + last offset\n parse_last_line = parse_indexfile_line get_indexfile_with_line(-1)\n new_offset = parse_last_line[1] + parse_last_line[2]\n\n File.open(@indexfile, \"a\") do |f|\n index_write_row(f, newrevision.to_s,\n new_offset.to_s, length.to_s)\n end\n end",
"title": ""
},
{
"docid": "cd5ff045415e301c3ceae88f06dcbe5c",
"score": "0.50400245",
"text": "def commit!\n _commit( false )\n end",
"title": ""
},
{
"docid": "0eaa7ea9dced97164056c6e7f25b0f49",
"score": "0.5019685",
"text": "def process\n filename = \"index.markdown\"\n markdowns = {filename => []} \n state = :message\n message = [\"\\n\"]\n patch = []\n commit = nil\n (@gitlogp.split(\"\\n\")+[\"DONE\"]).each { |line|\n words=line.split\n if line.slice(0,1)==\" \" || words.length==0\n # commit messages start with 4 spaces, diff contents with 1 space\n if state==:message\n if words[0]==\"OUTPUT_FILE:\"\n filename = words[1]\n markdowns[filename] ||= []\n else\n message << \"#{line.slice(4..-1)}\"\n end\n else\n patch << \" #{line}\" if state==:patch\n end\n elsif words[0]==\"commit\" or words[0]==\"DONE\"\n if !commit.nil?\n # replace the short description line with a named link\n shortlog = message[2]\n message[2] = \"<a name='#{shortlog}'> </a>\"\n markdowns[filename] += message.map {|l|\n if l==\"SHOW_PATCH\"\n (patch+[\"{: .diff}\\n\"]).join(\"\\n\")\n else\n l\n end\n }\n series = tags[commit].slice(-2..-1)\n markdowns[filename] << \"\\n#{tags[commit]}: [view on github](#{@commit_link_base}#{commit}), [download #{series}-#{shortlog}.patch](#{@patch_link_base}/#{series}-#{shortlog}.patch)\\n{: .commit}\\n\"\n end\n \n message=[\"\\n\"]\n patch=[]\n\n commit = words[1]\n state = :message\n elsif [\"Author:\", \"Date:\", \"new\", \"index\", \"---\", \"+++\", '\\\\'].include?(words[0])\n # chomp\n elsif words[0]==\"diff\"\n state = :patch\n left = words[2].slice(2..-1)\n right = words[3].slice(2..-1)\n if left==right\n patch << \" ::: #{right}\"\n else\n patch << \" ::: #{left} -> #{right}\"\n end\n elsif words[0]==\"@@\"\n # git tries to put the function or class name after @@. This\n # works great for C diffs, but it only finds the class name in\n # Ruby, which is usually similar to the file name, Therefore\n # it's distracting cruft. Toss it.\n patch << \" #{words.slice(0,4).join(\" \")}\"\n else\n message << \"#{line.slice(4..-1)}\" if state==:message\n patch << \" #{line}\" if state==:patch \n end\n }\n output = {}\n markdowns.each do |fn, markdown|\n output[fn] = markdown.join(\"\\n\")\n Rails.logger.info(output[fn]) if respond_to? :Rails\n end\n return output\n end",
"title": ""
},
{
"docid": "698091a00be8ba5d7072e436c710fbfa",
"score": "0.5003859",
"text": "def gather_links indexes\n sort_index = 0\n indexes.each do |index|\n link = Link.find(index)\n link.trail_id = self.id\n link.sort_index = sort_index\n link.save\n sort_index = sort_index + 1\n end\n end",
"title": ""
},
{
"docid": "adcf0c089c6a325e130fc3ec96e6ed5e",
"score": "0.5003341",
"text": "def commit\n query 'commit'\n self\n end",
"title": ""
},
{
"docid": "4fd6966d9090adcb7f8da4dc1a2d8930",
"score": "0.49969447",
"text": "def commit\n # TODO\n # Update ./docProps\n # app.xml slides, notes, counts, etc\n # core.xml Times\n entries.each do |path, buffer|\n path = path.to_s\n if @original_files.include? path\n @zip.replace_buffer path, buffer\n else\n @zip.add_buffer path, buffer\n end\n end\n @zip.commit\n end",
"title": ""
},
{
"docid": "2493284faf561d31dbda7d76baf0d219",
"score": "0.49968737",
"text": "def sort\n params[:backlog_entry].each_with_index do |id, index|\n BacklogEntry.update_all({position: index+1}, {id: id})\n end\n render nothing: true\n end",
"title": ""
},
{
"docid": "f546f70e778bdaedd3fb7f265621c119",
"score": "0.49907473",
"text": "def commits!\n response = @client.get_json(\"#{path}/commits\")\n @commits = response.map do |commit| \n Commit.new(client: @client, user: @user, repo: self, sha: commit['sha']) \n end\n @commits\n end",
"title": ""
},
{
"docid": "7b7a72692296e7ade7051b0b01687ab5",
"score": "0.49784726",
"text": "def satellite_commit(repo, message, author, branch)\n options = rugged_commit_options(author, repo, message)\n commit_id = Rugged::Commit.create repo, options\n repo.index.write\n pushtobare branch\n touch # use current updated_at time\n commit_id\n end",
"title": ""
},
{
"docid": "67598f088ef79f9cd4d024e49b3abfc1",
"score": "0.4976858",
"text": "def write_db(user_hash)\n begin\n conn = open_db() # open database for updating\n max_id = conn.exec(\"select max(id) from details\")[0] # determine current max index (id) in details table\n max_id[\"max\"] == nil ? v_id = 1 : v_id = max_id[\"max\"].to_i + 1 # set index variable based on current max index value\n v_name = user_hash[\"name\"] # prepare data from user_hash for database insert\n v_age = user_hash[\"age\"]\n v_image = user_hash[\"image\"][:filename]\n v_n1 = user_hash[\"n1\"]\n v_n2 = user_hash[\"n2\"]\n v_n3 = user_hash[\"n3\"]\n v_quote = user_hash[\"quote\"]\n conn.prepare('q_statement',\n \"insert into details (id, name, age, image)\n values($1, $2, $3, $4)\") # bind parameters\n conn.exec_prepared('q_statement', [v_id, v_name, v_age, v_image])\n conn.exec(\"deallocate q_statement\")\n conn.prepare('q_statement',\n \"insert into numbers (id, details_id, n1, n2, n3)\n values($1, $2, $3, $4, $5)\") # bind parameters\n conn.exec_prepared('q_statement', [v_id, v_id, v_n1, v_n2, v_n3])\n conn.exec(\"deallocate q_statement\")\n conn.prepare('q_statement',\n \"insert into quotes (id, details_id, quote)\n values($1, $2, $3)\") # bind parameters\n conn.exec_prepared('q_statement', [v_id, v_id, v_quote])\n conn.exec(\"deallocate q_statement\")\n rescue PG::Error => e\n puts 'Exception occurred'\n puts e.message\n ensure\n conn.close if conn\n end\nend",
"title": ""
},
{
"docid": "290ff56835d7c085ebdb8bec8396f3a6",
"score": "0.49754578",
"text": "def block_hash\n\t\tdigest = Digest::SHA2.new\n\n\t\tdigest << '%d' % [ self.index ]\n\t\tdigest << self.timestamp.strftime( '%s%N' )\n\t\tdigest << self.payload\n\t\tdigest << self.payload_hash\n\t\tdigest << self.proof.to_s\n\t\tdigest << self.previous_hash\n\t\t\n\t\treturn digest.hexdigest\n\tend",
"title": ""
},
{
"docid": "16de7e20e0a07fcb41a2fca519fb5986",
"score": "0.49649268",
"text": "def update_index\n all.each do |n|\n n.update_index\n end\n end",
"title": ""
},
{
"docid": "6d32ff5c9b0dd9648aa94eed726b1029",
"score": "0.49596053",
"text": "def create\n @stage_commit = StageCommit.new(stage_commit_params)\n\n respond_to do |format|\n if @stage_commit.save\n GitHubber.promote_to_prod(@stage_commit.sha)\n old_commits=GitHubber.all_before_hash(@stage_commit.sha)\n logged_commits = StageCommit.where(\"sha in (?)\", old_commits).map{ |reviews| reviews.sha }\n skipped_commits = old_commits - logged_commits\n\n skipped_commits.each do |skipped_sha|\n StageCommit.create(:sha => skipped_sha, :approver => @stage_commit.approver, :comment => \"Auto Approved in Commit #{@stage_commit.sha} and Message #{@stage_commit.comment}\")\n end\n\n format.html { redirect_to @stage_commit, notice: 'Stage commit was successfully created.' }\n format.json { render action: 'show', status: :created, location: @stage_commit }\n else\n format.html { render action: 'new' }\n format.json { render json: @stage_commit.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "07ae2e7a90b216c8827b6c558e557ed7",
"score": "0.49574885",
"text": "def do_hook(c)\n sp = c[\"head_commit\"][\"message\"].split \"#\"\n taskid = sp[-1].to_i\n da_task = self.tasks.find(taskid)\n\n if da_task then\n commit = Commit.new\n commit.author_email = c[\"head_commit\"][\"author\"][\"email\"]\n commit.author_name = c[\"head_commit\"][\"author\"][\"name\"]\n commit.message = c[\"head_commit\"][\"message\"]\n commit.url = c[\"head_commit\"][\"url\"]\n commit.sha = c[\"head_commit\"][\"id\"]\n commit.date = c[\"head_commit\"][\"timestamp\"]\n commit.task_id = taskid\n commit.save\n end\n end",
"title": ""
}
] |
810290d5cd5b03ecc44bcd06090872f9
|
Defined humanreadable name of this resource type
|
[
{
"docid": "54e0d16037d5f2536d63a78713ace601",
"score": "0.73650485",
"text": "def resource_type\n return 'Undefined'\n end",
"title": ""
}
] |
[
{
"docid": "386920a0ac4fab72fd352cc5fe782ef6",
"score": "0.7926036",
"text": "def resource_name\n Util.to_plural(instance.class.resource).to_sym\n end",
"title": ""
},
{
"docid": "4334f41d9a6d564fa0055fab9b019c0c",
"score": "0.78441566",
"text": "def resource_name\n name.underscore.to_sym\n end",
"title": ""
},
{
"docid": "23df2928ce184c4b6bd9db5e10d5bd95",
"score": "0.7786743",
"text": "def human_resource_name\n @human_resource_name ||= resource_class.model_name.human\n end",
"title": ""
},
{
"docid": "e4c9ad890136c1ac4921bc97477b1c84",
"score": "0.7764269",
"text": "def resource_name\n \"#{self.class.resource_name} #{respond_to?(:name) ? self.name : self.id}\"\n end",
"title": ""
},
{
"docid": "feda46f012a2fd3215b0fe6eaf8f5aa4",
"score": "0.7737054",
"text": "def resource_name\n definition.resource_name\n end",
"title": ""
},
{
"docid": "f6cd23f2a10d32c81022005c5b576a0c",
"score": "0.7723619",
"text": "def name\n return super if defined? super\n\n resource_name.humanize\n end",
"title": ""
},
{
"docid": "9d4f8d50eccf36927e3fb08765a44c03",
"score": "0.77064705",
"text": "def resource_name\n name.demodulize.underscore\n end",
"title": ""
},
{
"docid": "900d8dd39efec6f3c876086bc635bdc0",
"score": "0.7679173",
"text": "def resource_name\n resource[:name].gsub(/\\s/, \"_\").downcase.singularize\n end",
"title": ""
},
{
"docid": "d23cad17aa8cb3988463ac7757c7335f",
"score": "0.7641299",
"text": "def resource_name\n @resource_name ||= self.class_basename.underscore.to_sym\n end",
"title": ""
},
{
"docid": "87898d30c36f574bb27ee6761bf8c462",
"score": "0.75773805",
"text": "def human_resource_name\n human_name.downcase\n end",
"title": ""
},
{
"docid": "51ac6461698d2222c4f92f368d80e5d5",
"score": "0.7551606",
"text": "def resource_name\n self.class.resource_name\n end",
"title": ""
},
{
"docid": "c96352daf20ba08207b607fc6643cf29",
"score": "0.75302804",
"text": "def resource_name\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5f6ab8697a611924c30003051831a66e",
"score": "0.7528323",
"text": "def name()\n @type.name()\n end",
"title": ""
},
{
"docid": "27636349a0759c7a4e3ce535a34790e9",
"score": "0.75175864",
"text": "def name\n [@resource_name, @name].compact.join(\"_\")\n end",
"title": ""
},
{
"docid": "b2eaf1d1da972edb0c41f8adbbc43e9a",
"score": "0.7509758",
"text": "def type\n resource[:name].split(/-/)[1]\n end",
"title": ""
},
{
"docid": "304570f0ca04fd96bbe5f5d7fefaa49e",
"score": "0.75074595",
"text": "def type_name\n Name.new(type.to_s)\n end",
"title": ""
},
{
"docid": "aa1e222c088140b3d596fd8786d27853",
"score": "0.75023144",
"text": "def human_resources_name\n @human_resources_name ||= resource_class.model_name.human(count: 2)\n end",
"title": ""
},
{
"docid": "02c7e39f76c676f051ccdc0bcecf0ce8",
"score": "0.7488047",
"text": "def type_name\n t(\".type_name\")\n end",
"title": ""
},
{
"docid": "02c7e39f76c676f051ccdc0bcecf0ce8",
"score": "0.7488047",
"text": "def type_name\n t(\".type_name\")\n end",
"title": ""
},
{
"docid": "02c7e39f76c676f051ccdc0bcecf0ce8",
"score": "0.7488047",
"text": "def type_name\n t(\".type_name\")\n end",
"title": ""
},
{
"docid": "2c6b594df150595ca1afab017a732c86",
"score": "0.74536014",
"text": "def resource_name; end",
"title": ""
},
{
"docid": "410c2818527cc4a835373958e3b74b84",
"score": "0.7420896",
"text": "def resource_name\n resource? ? resource.resource_name : resource_class.to_s.underscore.pluralize\n end",
"title": ""
},
{
"docid": "f8532a312ba6eebb0862509c04727db3",
"score": "0.7420107",
"text": "def resource_name\n { resource_name: resource_identifier }\n end",
"title": ""
},
{
"docid": "11df50ce0efc79e3491a0b7bf5dc47bf",
"score": "0.74136776",
"text": "def resource_type\n super.first || \"\"\n end",
"title": ""
},
{
"docid": "fd33fc072c27a6785d8ae32d5fc6baa0",
"score": "0.74044746",
"text": "def name\n resource[:name]\n end",
"title": ""
},
{
"docid": "f965bd38c3266199fe01f106f77b23b6",
"score": "0.73963314",
"text": "def namevar\n if builtin_type? and t = resource_type and t.key_attributes.length == 1\n t.key_attributes.first\n else\n :name\n end\n end",
"title": ""
},
{
"docid": "8609e6777516e71bd69dec45427cdbfc",
"score": "0.7394765",
"text": "def resource_display_name\n return @resource_display_name\n end",
"title": ""
},
{
"docid": "8609e6777516e71bd69dec45427cdbfc",
"score": "0.7394765",
"text": "def resource_display_name\n return @resource_display_name\n end",
"title": ""
},
{
"docid": "8781847178feedc4d63f0137a7d52c5b",
"score": "0.7372597",
"text": "def name(type = :en)\n name_struct.name(type)\n end",
"title": ""
},
{
"docid": "5a4d6c9f7862eae83c9903140b510ab9",
"score": "0.7356715",
"text": "def irregular_resource_name; end",
"title": ""
},
{
"docid": "99590d7cc7bf9d98bd8827e81dba8aa6",
"score": "0.73517776",
"text": "def name\n @resource\n end",
"title": ""
},
{
"docid": "f2ccd6409594ff0b9fb444142b773c15",
"score": "0.7347885",
"text": "def type_label\n ::RDF::URI(asset_type).path.split(\"/\").last.underscore.humanize.downcase\n end",
"title": ""
},
{
"docid": "f2ccd6409594ff0b9fb444142b773c15",
"score": "0.7347885",
"text": "def type_label\n ::RDF::URI(asset_type).path.split(\"/\").last.underscore.humanize.downcase\n end",
"title": ""
},
{
"docid": "04cd4494a1443dda6ba6570980b7ccd2",
"score": "0.7335969",
"text": "def resource_name\n @resource_name ||= resources_name.singularize\n end",
"title": ""
},
{
"docid": "324bc4eec2f545d2834bfc23a0b13575",
"score": "0.7335939",
"text": "def resource_name\n singular_name\n end",
"title": ""
},
{
"docid": "c2ab28b4aa76c1db5e1d08a2b99f7851",
"score": "0.732921",
"text": "def type_name(type); end",
"title": ""
},
{
"docid": "24e8bd46c71bda3ee1ce5a1172e783a6",
"score": "0.7318319",
"text": "def resource_name\n @resource_name ||= singular_resource_name.plural\n end",
"title": ""
},
{
"docid": "24e8bd46c71bda3ee1ce5a1172e783a6",
"score": "0.7318319",
"text": "def resource_name\n @resource_name ||= singular_resource_name.plural\n end",
"title": ""
},
{
"docid": "dec2563bc5fb7095e6925619e04ace67",
"score": "0.72990835",
"text": "def human_name_for_resource(resource)\n return nil unless resource_class = ::Link2::Support.find_resource_class(resource)\n raise ArgumentError unless ::Link2::Support.record_class?(resource_class)\n\n if ::Link2::Support.record_object?(resource)\n # Skip any ugly default to_s-value:\n custom_name = resource.to_s =~ CLASS_INSTANCE_STRING ? ::Link2::Support.human_name_for(resource_class).downcase : resource.to_s\n end\n custom_name = ::Link2::Support.human_name_for(resource_class).downcase if custom_name.blank?\n custom_name\n end",
"title": ""
},
{
"docid": "f1abcdf847f96b597bb513b9d5775774",
"score": "0.7298968",
"text": "def resource_name\n self.model.to_s.underscore\n end",
"title": ""
},
{
"docid": "e7e5f2e8be70c63e58f7b63901456d7a",
"score": "0.7292984",
"text": "def to_resource_name\n self.to_class_name.demodulize.singularize.underscore\n end",
"title": ""
},
{
"docid": "b7b1d65e86541a5bc519038d66529017",
"score": "0.7263889",
"text": "def resource_name\n @resource_name || self.class.resource_name\n end",
"title": ""
},
{
"docid": "9f3b62d61517bd33b5c74a2da16a1e4e",
"score": "0.7261408",
"text": "def type\n @type ||= self.class.to_s.downcase.sub( /resource/, '' )\n end",
"title": ""
},
{
"docid": "573b53b5f2505cb78fdf31b427a6ff63",
"score": "0.7261034",
"text": "def resource_name\n @resource_name ||= (var_name || resource_class.underscore)\n end",
"title": ""
},
{
"docid": "8e74e859500e97e2e32f665bdb2f61ca",
"score": "0.72609484",
"text": "def resources_name\n name.underscore.pluralize.to_sym\n end",
"title": ""
},
{
"docid": "b22227580a9c3bff6bd9b6dc8b3ec978",
"score": "0.7241735",
"text": "def instance_name\n resource_class.name.demodulize.underscore\n end",
"title": ""
},
{
"docid": "51122f3402e9d68e167787d1d892f90a",
"score": "0.7240862",
"text": "def resource_name\n return @resource_name\n end",
"title": ""
},
{
"docid": "51122f3402e9d68e167787d1d892f90a",
"score": "0.7240862",
"text": "def resource_name\n return @resource_name\n end",
"title": ""
},
{
"docid": "8850185c9f72c09d266f0e2374a1e3b1",
"score": "0.72400796",
"text": "def type_name(type)\n type.to_s.humanize capitalize: false\n end",
"title": ""
},
{
"docid": "986bba96feac1743e1acab0e2f498688",
"score": "0.7238981",
"text": "def type_name\n TYPES[type.to_s]\n end",
"title": ""
},
{
"docid": "af023d9df51dbb65431d8e07eaa27fde",
"score": "0.72262037",
"text": "def display_name\n @name || @resource\n end",
"title": ""
},
{
"docid": "bea3ee5cc61c3d4bf1e8183653b63bc5",
"score": "0.7219022",
"text": "def type_name\n t(\"config.types.#{type}\")\n end",
"title": ""
},
{
"docid": "f49e1f24f250e0672e0f4f162a33e08c",
"score": "0.7217388",
"text": "def type_name; end",
"title": ""
},
{
"docid": "f49e1f24f250e0672e0f4f162a33e08c",
"score": "0.7217388",
"text": "def type_name; end",
"title": ""
},
{
"docid": "f49e1f24f250e0672e0f4f162a33e08c",
"score": "0.7217388",
"text": "def type_name; end",
"title": ""
},
{
"docid": "f49e1f24f250e0672e0f4f162a33e08c",
"score": "0.7217388",
"text": "def type_name; end",
"title": ""
},
{
"docid": "f49e1f24f250e0672e0f4f162a33e08c",
"score": "0.7217388",
"text": "def type_name; end",
"title": ""
},
{
"docid": "f49e1f24f250e0672e0f4f162a33e08c",
"score": "0.7217388",
"text": "def type_name; end",
"title": ""
},
{
"docid": "f49e1f24f250e0672e0f4f162a33e08c",
"score": "0.7217388",
"text": "def type_name; end",
"title": ""
},
{
"docid": "f49e1f24f250e0672e0f4f162a33e08c",
"score": "0.7217388",
"text": "def type_name; end",
"title": ""
},
{
"docid": "f49e1f24f250e0672e0f4f162a33e08c",
"score": "0.7217388",
"text": "def type_name; end",
"title": ""
},
{
"docid": "f49e1f24f250e0672e0f4f162a33e08c",
"score": "0.7217388",
"text": "def type_name; end",
"title": ""
},
{
"docid": "f49e1f24f250e0672e0f4f162a33e08c",
"score": "0.7217388",
"text": "def type_name; end",
"title": ""
},
{
"docid": "c91a8832849157bc8a81b4ff7c510f5b",
"score": "0.72024673",
"text": "def resource_name\n self.class.resource_name\n end",
"title": ""
},
{
"docid": "82bb767f56e17e88de0dac67678cfec6",
"score": "0.71862453",
"text": "def underscored_resource_name\n @object.record.class.to_s.gsub('::', '').underscore\n end",
"title": ""
},
{
"docid": "dc44abbf55a5e8ca6eaa954a4bcac13c",
"score": "0.7181941",
"text": "def name\n @resource_schema.name.gsub('-', '_')\n end",
"title": ""
},
{
"docid": "9b8f019002d46fc77cd6c431559f050d",
"score": "0.71710825",
"text": "def type_label\n object.type.to_s.capitalize\n end",
"title": ""
},
{
"docid": "c9ada6480b1c5f9ab1243b58e33ee402",
"score": "0.7169817",
"text": "def resource\n I18n.t(\n underscored_resource_name,\n scope: [:resources],\n locale: :api,\n default: @record.class.to_s.titlecase\n )\n end",
"title": ""
},
{
"docid": "7aa7363c7b347de42f1fe332cc1967f8",
"score": "0.71664304",
"text": "def getTypeName\n\t\treturn Type.find(self.type_id).name\n\tend",
"title": ""
},
{
"docid": "ac65d626047c89dd3cd4f8af577002c0",
"score": "0.7164862",
"text": "def slingshot_type_name\n \"#{self.name.underscore}\" \n end",
"title": ""
},
{
"docid": "b0d6a1b4f6c56c854bffa27dcb64613a",
"score": "0.71563387",
"text": "def type_name\n @type.to_s.gsub(/\\d/, ' \\0').capitalize\n end",
"title": ""
},
{
"docid": "249a2c95bbdd906d28e4b266a9cb8eaa",
"score": "0.71533614",
"text": "def name(resource)\n resource.name.to_s.to_slug\n end",
"title": ""
},
{
"docid": "aa71acd23006bf62c4122979aac9c5e5",
"score": "0.7134583",
"text": "def resource_kind\n self.class.name.split(\"::\")[-1].underscore.split('/').join('-')\n end",
"title": ""
},
{
"docid": "a43355c6296d14090de15331ca25ae21",
"score": "0.71229094",
"text": "def resource_type\n descMetadata.resource_type\n end",
"title": ""
},
{
"docid": "5d2c6a0a7b316a2274fd0c51da61af1b",
"score": "0.7114079",
"text": "def resource_name\n @resource_name || default_resource_name\n end",
"title": ""
},
{
"docid": "4c4b3dcd9f6ee9e371ceadebbacc1000",
"score": "0.71130204",
"text": "def resources_name\n self.class.resources_name\n end",
"title": ""
},
{
"docid": "bfc326821ace7c9fb7964d4c6462ea29",
"score": "0.70914763",
"text": "def camelized_resource_name\n resource_name.titleize.gsub(' ', '')\n end",
"title": ""
},
{
"docid": "dcc9c3c307f07d6af099bfd732a3025d",
"score": "0.70909023",
"text": "def type\n Util.underscore(name.split(\"::\").last).gsub(\"_\", \" \")\n end",
"title": ""
},
{
"docid": "2642924cee7daefbc4cd77fd14ad411d",
"score": "0.70903933",
"text": "def name\n SUIT_NAME.fetch(@type)\n end",
"title": ""
},
{
"docid": "cf595a2ed5377e494a03bca5d39e8da7",
"score": "0.70877486",
"text": "def name\n self['type']['name']\n end",
"title": ""
},
{
"docid": "d363b4ea94b5fac746e2a4b6a3c5d3a8",
"score": "0.708286",
"text": "def type\n \"#{namespace}.#{name}\"\n end",
"title": ""
},
{
"docid": "d363b4ea94b5fac746e2a4b6a3c5d3a8",
"score": "0.708286",
"text": "def type\n \"#{namespace}.#{name}\"\n end",
"title": ""
},
{
"docid": "0709f55dbc96854328cfd51ff65f0da0",
"score": "0.7070865",
"text": "def cast_to_resources_name(target_type)\n target_type.to_s.to_resources_name\n end",
"title": ""
},
{
"docid": "1020a400af3fce73bf769a06eb670b0c",
"score": "0.7062409",
"text": "def human_type\n Core::TYPES_DESC[type]\n end",
"title": ""
},
{
"docid": "5c31c847bc7fac6439a25aa02add5c74",
"score": "0.70613766",
"text": "def resource_name\n config[:id].to_s.singularize\n end",
"title": ""
},
{
"docid": "fc696a2d2eb26cd1e747e8f4a586d172",
"score": "0.7060172",
"text": "def type_label\n self.type.to_s.humanize.capitalize\n end",
"title": ""
},
{
"docid": "81a2577a7df363b8723f2f311b8a0c78",
"score": "0.70590615",
"text": "def api_resource_name(method = nil)\n \"#{ underscore(name.split('::').last) }s\"\n end",
"title": ""
},
{
"docid": "27a6847f65476993173aba2b2698bcf8",
"score": "0.7052106",
"text": "def type_str\n\t\treturn custom if vulntype == 0\n\n\t\tvt = VulnType.get(vulntype)\n\t\treturn (vt.label.nil? || vt.label.strip.empty?) ? vt.name : vt.label\n\tend",
"title": ""
},
{
"docid": "17410be784126ac13cbaf58dea6d2096",
"score": "0.7050227",
"text": "def type_name\n @type_name ||= name.split('::').last.downcase.to_s\n end",
"title": ""
},
{
"docid": "b51ccf106a874ed21a829371160777db",
"score": "0.7045473",
"text": "def resource\n self.to_s.demodulize.downcase.pluralize\n end",
"title": ""
},
{
"docid": "b51ccf106a874ed21a829371160777db",
"score": "0.7045473",
"text": "def resource\n self.to_s.demodulize.downcase.pluralize\n end",
"title": ""
},
{
"docid": "489f4fc83042b0e0e9e613d360983c15",
"score": "0.70365655",
"text": "def resource_type_and_id\n \"#{resource_type}-#{resource_id}\"\n end",
"title": ""
},
{
"docid": "96a5bd99d89d595e9bdda198fc022758",
"score": "0.7025236",
"text": "def label_name\n \"#{resource_name.singularize}_#{field_name}\"\n end",
"title": ""
},
{
"docid": "b4b2e550641a52f0fb08147068b423ed",
"score": "0.70179725",
"text": "def resource_name\n @resource_name ||= controller_name.singularize\n end",
"title": ""
},
{
"docid": "644e25290ca54cf98cd214efe991e3b8",
"score": "0.70162654",
"text": "def resource_key\n camelized_resource_name\n end",
"title": ""
},
{
"docid": "9ab9eb56d738e8b4496527c80a1dff96",
"score": "0.7005734",
"text": "def resource_klass_name\n resource_name.classify\n end",
"title": ""
},
{
"docid": "aff52bc4aa185335f1d2b4d8f3be5fc5",
"score": "0.69999087",
"text": "def type\n \"#{namespace}.#{name}\"\n end",
"title": ""
},
{
"docid": "2db894e2f380e1f63209814bb719c5b2",
"score": "0.69920194",
"text": "def resource_name\n model_class_lstr.pluralize\n end",
"title": ""
},
{
"docid": "cd3b761ee3506fe03abc569f857e05b7",
"score": "0.6987858",
"text": "def type_name\n\t\treturn self.class.type_name\n\tend",
"title": ""
},
{
"docid": "67990a09efb410471ad59d94de765dba",
"score": "0.6987199",
"text": "def resource_name\n options[:class]\n end",
"title": ""
}
] |
02c15269374d44508f2194b919f69c13
|
=begin rdoc Note: operands are added after instantiation. =end
|
[
{
"docid": "70ae85c035d72f57c847bb65fb7686a3",
"score": "0.0",
"text": "def initialize( arch, ascii, opcode, prefixes=[], effects=[] )\n @arch = arch\n @ascii = ascii\n @opcode = opcode\n @operands = OperandList.new\n @prefixes = [ (prefixes || []) ].flatten \n @side_effects = [ (effects || []) ].flatten\n end",
"title": ""
}
] |
[
{
"docid": "84461160c7fd31ede2e5d7ca81c1063d",
"score": "0.6743221",
"text": "def operand1; end",
"title": ""
},
{
"docid": "3d9abab6384f891b3bc8138a5a311580",
"score": "0.6730509",
"text": "def op; end",
"title": ""
},
{
"docid": "3d9abab6384f891b3bc8138a5a311580",
"score": "0.6730509",
"text": "def op; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.6617396",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.66168964",
"text": "def operator; end",
"title": ""
},
{
"docid": "0ee27284dbfa1e68741dc95297e570de",
"score": "0.66168964",
"text": "def operator; end",
"title": ""
},
{
"docid": "20b09313f1423cbbb9c3d9bd0a33e9eb",
"score": "0.64933085",
"text": "def operand2; end",
"title": ""
},
{
"docid": "b8356e61508aca4b9f50016a1b7e9f3d",
"score": "0.6413149",
"text": "def +@\n R.expr(self)\n end",
"title": ""
},
{
"docid": "bd395ef5570ec94ad67ca3120a943fca",
"score": "0.639525",
"text": "def operation; end",
"title": ""
},
{
"docid": "bd395ef5570ec94ad67ca3120a943fca",
"score": "0.639525",
"text": "def operation; end",
"title": ""
},
{
"docid": "bd395ef5570ec94ad67ca3120a943fca",
"score": "0.639525",
"text": "def operation; end",
"title": ""
},
{
"docid": "bd395ef5570ec94ad67ca3120a943fca",
"score": "0.639525",
"text": "def operation; end",
"title": ""
},
{
"docid": "c1f9ee6570df6d520e0c91d6f6f5c9c1",
"score": "0.63879436",
"text": "def initialize\n super('+')\n end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.6278279",
"text": "def operations; end",
"title": ""
},
{
"docid": "2dbabd0eeb642c38aad852e40fc6aca7",
"score": "0.6278279",
"text": "def operations; end",
"title": ""
},
{
"docid": "2fd3cfbcf7560ea38e8df773d170cc64",
"score": "0.6267395",
"text": "def generated_expressions; end",
"title": ""
},
{
"docid": "7c56946020253403fdd5d8c8c91d4ea9",
"score": "0.6241156",
"text": "def + other\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "adb5bb340227e2fd9c294c8da6e9b329",
"score": "0.6193186",
"text": "def normalized_operation; end",
"title": ""
},
{
"docid": "62cd7ccf7d3bd4a4e555c8cc6d5c980e",
"score": "0.6187534",
"text": "def + numeric\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "62cd7ccf7d3bd4a4e555c8cc6d5c980e",
"score": "0.6187534",
"text": "def + numeric\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "62cd7ccf7d3bd4a4e555c8cc6d5c980e",
"score": "0.6187534",
"text": "def + numeric\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "abe48f748b5016b24b097c4978f9497b",
"score": "0.6159167",
"text": "def Op(value); end",
"title": ""
},
{
"docid": "f2547646c11bc19b4770359f75fa455f",
"score": "0.613412",
"text": "def lhs; end",
"title": ""
},
{
"docid": "f2547646c11bc19b4770359f75fa455f",
"score": "0.613412",
"text": "def lhs; end",
"title": ""
},
{
"docid": "0a37dbef99d44bb4050c96ccee7b7c9a",
"score": "0.61304855",
"text": "def rhs; end",
"title": ""
},
{
"docid": "0a37dbef99d44bb4050c96ccee7b7c9a",
"score": "0.61304855",
"text": "def rhs; end",
"title": ""
},
{
"docid": "0a37dbef99d44bb4050c96ccee7b7c9a",
"score": "0.61304855",
"text": "def rhs; end",
"title": ""
},
{
"docid": "cb56093bf24fa6dd185bd8ca95e465ff",
"score": "0.612901",
"text": "def operator\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "d625e14dae374cf5492cc619626e9472",
"score": "0.6121812",
"text": "def op=(_arg0); end",
"title": ""
},
{
"docid": "b1c07152d2dddfa65ec036a677120aaf",
"score": "0.61207455",
"text": "def literal; end",
"title": ""
},
{
"docid": "b1c07152d2dddfa65ec036a677120aaf",
"score": "0.61207455",
"text": "def literal; end",
"title": ""
},
{
"docid": "97514b7149390880be0e9f1675a41701",
"score": "0.6105703",
"text": "def alternate_operator; end",
"title": ""
},
{
"docid": "97514b7149390880be0e9f1675a41701",
"score": "0.6105703",
"text": "def alternate_operator; end",
"title": ""
},
{
"docid": "97514b7149390880be0e9f1675a41701",
"score": "0.6105703",
"text": "def alternate_operator; end",
"title": ""
},
{
"docid": "97514b7149390880be0e9f1675a41701",
"score": "0.6105703",
"text": "def alternate_operator; end",
"title": ""
},
{
"docid": "84bcb880b84c93b4952e04e0b370a4cf",
"score": "0.60944325",
"text": "def initialize(l, op, r = nil)\n @l, @op, @r = l, op, r\n end",
"title": ""
},
{
"docid": "770faa016342f708bcafed17ad12c322",
"score": "0.60748243",
"text": "def initialize\n super('(')\n end",
"title": ""
},
{
"docid": "b6c6723f9b4ad1449d1cec68f34154d8",
"score": "0.6074656",
"text": "def generate_primitive_expression\n generate_one [:literal_expression, :binary_operator_expression]\n end",
"title": ""
},
{
"docid": "49c74f712fe17c7f47319466d67eaa14",
"score": "0.60420793",
"text": "def operands\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "4b9bd8976809ade774bed6319ee17cbd",
"score": "0.6032036",
"text": "def AddOperators_custom\n\n calc = self\n\n\n # Now let's show how you can use a function to access a constant, like PI\n\n @operators << ::RCalc::BinaryOperator.new(\"[\", 3) {|x, y| x.value + y.value}\n @operators << ::RCalc::UnaryOperator.new(\"]\", 4) { |x| x.value }\n\n end",
"title": ""
},
{
"docid": "006a7e4e2acfebaac09422ff2270ce2b",
"score": "0.59985673",
"text": "def neoclassicism()\n addition_unliberated()\n end",
"title": ""
},
{
"docid": "a5ba8fed7385fe2198140323a621fc1f",
"score": "0.597785",
"text": "def literal_run; end",
"title": ""
},
{
"docid": "214ced08d70a765f23a7c05bacf8d051",
"score": "0.59691685",
"text": "def initialize(op, left = nil, right = nil)\n super()\n @op = op\n @left = left\n @right = right \n end",
"title": ""
},
{
"docid": "c5017a5fe1719fd3a33885696f2c517f",
"score": "0.5962014",
"text": "def operator_method?; end",
"title": ""
},
{
"docid": "c5017a5fe1719fd3a33885696f2c517f",
"score": "0.5962014",
"text": "def operator_method?; end",
"title": ""
},
{
"docid": "423ac542b3d6970c009a6aaf7edd41ba",
"score": "0.5959381",
"text": "def c2()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "a54176864b85671ccbdf61a4815771f4",
"score": "0.5948014",
"text": "def +\n end",
"title": ""
},
{
"docid": "7f5073ed8a81fec00b09ae99ac8f7c94",
"score": "0.5925004",
"text": "def additions; end",
"title": ""
},
{
"docid": "01845506ccf350b5b24216e283568b17",
"score": "0.5914483",
"text": "def +; end",
"title": ""
},
{
"docid": "712a25c3630be5f344b895a8cce4868b",
"score": "0.59042776",
"text": "def expr; end",
"title": ""
},
{
"docid": "712a25c3630be5f344b895a8cce4868b",
"score": "0.59042776",
"text": "def expr; end",
"title": ""
},
{
"docid": "712a25c3630be5f344b895a8cce4868b",
"score": "0.59042776",
"text": "def expr; end",
"title": ""
},
{
"docid": "712a25c3630be5f344b895a8cce4868b",
"score": "0.59042776",
"text": "def expr; end",
"title": ""
},
{
"docid": "712a25c3630be5f344b895a8cce4868b",
"score": "0.59042776",
"text": "def expr; end",
"title": ""
},
{
"docid": "712a25c3630be5f344b895a8cce4868b",
"score": "0.59042776",
"text": "def expr; end",
"title": ""
},
{
"docid": "712a25c3630be5f344b895a8cce4868b",
"score": "0.59042776",
"text": "def expr; end",
"title": ""
},
{
"docid": "35981b09870e67c1a7245a5021bb7115",
"score": "0.5898814",
"text": "def arithmetic_operation?; end",
"title": ""
},
{
"docid": "35981b09870e67c1a7245a5021bb7115",
"score": "0.5898814",
"text": "def arithmetic_operation?; end",
"title": ""
},
{
"docid": "640e5f8e1e39eba3e2853cc82039f79b",
"score": "0.5890676",
"text": "def initialize(num, operand)\n \t@num = num\n \t@operand = operand\n end",
"title": ""
},
{
"docid": "1c843acf952b11887b5b41b23f37cd75",
"score": "0.58892804",
"text": "def quick_add; end",
"title": ""
},
{
"docid": "5ad7e5c7a147626a2b0a2c5956411be5",
"score": "0.58841693",
"text": "def r; end",
"title": ""
},
{
"docid": "3c10e4c7cb8b425c47612b5ef8dd5de4",
"score": "0.5882761",
"text": "def pred()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "3c10e4c7cb8b425c47612b5ef8dd5de4",
"score": "0.5882761",
"text": "def pred()\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "0ff963e013187252c28a7e2b86a37702",
"score": "0.5862045",
"text": "def initialize(op, expr1, expr2)\n\t\t@elems = [expr1, expr2]\n\t\t@op = op\n\tend",
"title": ""
},
{
"docid": "5b690986d917e3d55b2d109ace006759",
"score": "0.5852186",
"text": "def initialize(left, right, op)\n @left = left\n @right = right\n @op = op\n end",
"title": ""
},
{
"docid": "76ff7aa36de5a1b30e178bda67265164",
"score": "0.584835",
"text": "def oa\n binary_operator \"+\"\n end",
"title": ""
},
{
"docid": "99600866ec9ea9bbca1d3aec99d8f275",
"score": "0.5846624",
"text": "def %(other); end",
"title": ""
},
{
"docid": "99600866ec9ea9bbca1d3aec99d8f275",
"score": "0.5846624",
"text": "def %(other); end",
"title": ""
},
{
"docid": "0f73b0063b982cefe7a0e8c7feed07be",
"score": "0.5844112",
"text": "def initialize(name, description) #this is an instance method. \n @name = name\n @description = description\n @@all << self #self should be the instance, not the class. for exaple, will start with r1, then shovel in r2. we want to do this upon initialization.\n end",
"title": ""
},
{
"docid": "be53b66cadec6b9932314135360bb325",
"score": "0.5832881",
"text": "def initialize\n @logger = VWO::Utils::Logger\n @operand_evaluator = OperandEvaluator.new\n end",
"title": ""
},
{
"docid": "df034585af6986785fa1cc5a0bbca4c5",
"score": "0.5830784",
"text": "def cops; end",
"title": ""
},
{
"docid": "df034585af6986785fa1cc5a0bbca4c5",
"score": "0.5830784",
"text": "def cops; end",
"title": ""
},
{
"docid": "df034585af6986785fa1cc5a0bbca4c5",
"score": "0.5830784",
"text": "def cops; end",
"title": ""
},
{
"docid": "8e3629bb42b471c640e3e1bd665bf3b2",
"score": "0.5824965",
"text": "def initialize(*) end",
"title": ""
},
{
"docid": "2ed847622d71d891d87646f914eb1d76",
"score": "0.58109117",
"text": "def initialize( op, attribute, vals=[] )\n\t\t@attribute = attribute\n\t\t_initialize_ext( op, attribute, vals )\n\tend",
"title": ""
},
{
"docid": "e815c424fa4d574c7975848b50f1640c",
"score": "0.5809614",
"text": "def literal_run=(_arg0); end",
"title": ""
},
{
"docid": "2f705c59d07172f639d0f44b37119a70",
"score": "0.57922345",
"text": "def exp_class=(_arg0); end",
"title": ""
},
{
"docid": "2f705c59d07172f639d0f44b37119a70",
"score": "0.57922345",
"text": "def exp_class=(_arg0); end",
"title": ""
},
{
"docid": "2f705c59d07172f639d0f44b37119a70",
"score": "0.57922345",
"text": "def exp_class=(_arg0); end",
"title": ""
},
{
"docid": "231d54269e57effdfced35389f114f34",
"score": "0.5791897",
"text": "def referenced_expression=(_arg0); end",
"title": ""
},
{
"docid": "231d54269e57effdfced35389f114f34",
"score": "0.5791897",
"text": "def referenced_expression=(_arg0); end",
"title": ""
},
{
"docid": "231d54269e57effdfced35389f114f34",
"score": "0.5791897",
"text": "def referenced_expression=(_arg0); end",
"title": ""
},
{
"docid": "231d54269e57effdfced35389f114f34",
"score": "0.5791897",
"text": "def referenced_expression=(_arg0); end",
"title": ""
}
] |
fe37da3cc26f81c7d1f895ecec56b932
|
iterate through all fields and test conversion
|
[
{
"docid": "033aba6abb6f8a170f0deefbcc7fc93e",
"score": "0.6187216",
"text": "def compare_all_fields(model_name)\n @scp_field_names.each_with_index do |scp_name, index|\n converted_name = FacetNameConverter.convert_schema_column(:alexandria, model_name, scp_name)\n assert_equal @expected_conversions[model_name][index], converted_name\n end\n end",
"title": ""
}
] |
[
{
"docid": "6cbaa7a41e75e13fa3a94890a94c8616",
"score": "0.6872563",
"text": "def unconverted_fields?() @unconverted_fields end",
"title": ""
},
{
"docid": "ad9784dd8b9cfd8f9bf576b69a93bc01",
"score": "0.61326075",
"text": "def each_field\n all_fields.each do |field|\n value = __send__(field.name)\n yield(field, value)\n end\n end",
"title": ""
},
{
"docid": "b253e2628fc54eba4bdd157da94c738e",
"score": "0.5919288",
"text": "def __each_field(e0)\n e0.each do |e1|\n if e1.is_a? Array\n ___each_ccrange(e1)\n else\n ___getfield(e1)\n end\n end\n end",
"title": ""
},
{
"docid": "fca58fc39e35b9a66bcd674674c1ad4a",
"score": "0.57747346",
"text": "def each_field # :yield:name, type\n\t\t@fields.each { |field| yield(*field) } \n\t end",
"title": ""
},
{
"docid": "af58f349a11f521b9f74509d25b96b8e",
"score": "0.57455134",
"text": "def to_fields(fields, mapping_method)\n fields.each { |field| to_field field, mapping_method }\n end",
"title": ""
},
{
"docid": "9bc3521ae0d5cfcc5c117f37107a9b20",
"score": "0.5738968",
"text": "def each_field\n return enum_for(__method__) if !block_given?\n fields.each { |field| yield(*field) }\n end",
"title": ""
},
{
"docid": "d04fd9387d2c470a43cd4a09e3b65f36",
"score": "0.5726807",
"text": "def test_all_attributes\n assert_equal(\n { :name => \"Name\", \n :age => \"Age\", \n :calorie_intake => \"% Daily value USDA recommended intake\", \n :auspicious_fortune => \"Auspicious fortune\", \n :zodiac_sign => \"Zodiac sign\"\n },\n @field_defs.all_attributes\n )\n end",
"title": ""
},
{
"docid": "8f1b55f4dbeb3489594f7274bd400ad6",
"score": "0.57114065",
"text": "def each(&block)\n @fields.flatten.each{ |field| yield(field) }\n end",
"title": ""
},
{
"docid": "7c8f503998b64d082bde42f2156dc92e",
"score": "0.562973",
"text": "def convert!(data)\n @converters.each do |field, converter|\n data.each do |submission|\n key = field.to_s\n if submission.has_key?(key)\n c = converter.new(submission[key])\n submission[key] = c.convert\n end\n end\n end\n data\n end",
"title": ""
},
{
"docid": "b253f83a46f5cbf931b0cd1de29fc85f",
"score": "0.5597632",
"text": "def each_field\n return to_enum(:each_field) unless block_given?\n\n self.class.all_fields.each do |field|\n value = self[field.name]\n yield(field, value)\n end\n end",
"title": ""
},
{
"docid": "9592a236ceb7d0a5ebca208adc7a1e09",
"score": "0.5554476",
"text": "def coerce_to_fields(values)\n values.reduce([]) { |acc, el| acc << to_field(el) }\n end",
"title": ""
},
{
"docid": "0d0ec66802a48ea98c7f709a506ca339",
"score": "0.5553628",
"text": "def test_salesforce_parsing\n assert_equal ({\n :Id=>\"SALESFORCE_ID_1234\",\n :Field1=>\"value1\",\n :Field2=>\"value2\",\n :deep_field=>\"value3\",\n :deep_field2=>\"value4\",\n :Timestamp => Date.new(2013,3,1)}), TestedModel.parse_salesforce_fields(@salesforce_fields)\n end",
"title": ""
},
{
"docid": "d2ff9fd23aaff1e3a2efd21f017bbcb4",
"score": "0.5543889",
"text": "def update_fields(fields_attributes)\n all_fields = get_required_field_symbols + get_optional_field_symbols\n success = true\n\n fields_attributes.each do |field|\n field_type = fields.find(field[1][:id].to_i).name.to_sym # juuh elikkäs\n field_value = field[1][:content]\n\n if validate_field(field_type, field_value)\n set_field_value(field_type, field_value)\n else\n success = false\n end\n end\n\n return success\n end",
"title": ""
},
{
"docid": "ccb9ffa28b5e1299e5e8b2094a9d3e44",
"score": "0.55350405",
"text": "def each(&block)\n block.call self if block\n if respond_to?(:fields) &! fields.empty?\n fields.each{|field| field.each &block }\n end\n end",
"title": ""
},
{
"docid": "5d4e7d9ba343e1248ce17580f2dfb32f",
"score": "0.5517748",
"text": "def each_field\n @report.per_signature.values.each do |sps|\n sps.per_type.each do |type|\n type.field.each do |field|\n yield type, field\n end\n end\n end\n end",
"title": ""
},
{
"docid": "14bc9c333a4c24f8f4681373a6be423c",
"score": "0.54545784",
"text": "def conversions_fields\n @conversions_fields ||= begin\n conversions = Array(options[:conversions])\n conversions.map(&:to_s) + conversions.map(&:to_sym)\n end\n end",
"title": ""
},
{
"docid": "db3d96dc0613ca4a8bb04dad90e82c8c",
"score": "0.54535824",
"text": "def parse_fields(fields)\n parsed = {}\n until fields == \"\" || fields == \"\\0\" || fields.nil?\n encoding, fields = parse_encoding(fields)\n return parsed if encoding.first.nil?\n\n e = Format::ENCODINGS[encoding]\n value, fields = parse_field(fields, encoding)\n break unless value\n parsed[e] = convert_field(encoding, value)\n end\n\n return parsed, fields\n end",
"title": ""
},
{
"docid": "17b8efd89183a0ab134f106b3a7707cd",
"score": "0.54318005",
"text": "def fillFields\n \n end",
"title": ""
},
{
"docid": "c5dc4f3177c43dac01e36ab1e3c55aac",
"score": "0.54086405",
"text": "def normalize_fields(data, fields)\n fields.each do |field|\n field_name = field[:name]\n if data.include?(field_name)\n field_data = data[field_name]\n field_data = normalize_output_field(field_data, field)\n field_data = check_array_collapse(field_data, field)\n data[field_name] = field_data unless field_data.nil?\n end\n end\n return data\n end",
"title": ""
},
{
"docid": "bf0c7bc7c498164b2e5c0def84b83a91",
"score": "0.5383021",
"text": "def each_field\n each_name do |fieldname|\n yield SubTextField.new(fieldname)\n end\n end",
"title": ""
},
{
"docid": "b2676d8ebd4d3eb2af6390af50c2df25",
"score": "0.53691",
"text": "def each_field\n self.form.form_fields.each do |field|\n yield field, self.data[field.name.to_sym]\n end\n end",
"title": ""
},
{
"docid": "29040d9719cffc977816ba45df037d53",
"score": "0.53612185",
"text": "def validate(record)\n return unless IdentityConfig.store.usps_ipp_transliteration_enabled\n nontransliterable_chars = Set.new\n @fields.each do |field|\n next unless record.respond_to?(field)\n\n value = record.send(field)\n next unless value.respond_to?(:to_s)\n\n invalid_chars = get_invalid_chars(value)\n next unless invalid_chars.present?\n\n nontransliterable_chars += invalid_chars\n\n record.errors.add(\n field,\n :nontransliterable_field,\n message: get_error_message(invalid_chars),\n )\n end\n\n if nontransliterable_chars.present?\n analytics.idv_in_person_proofing_nontransliterable_characters_submitted(\n nontransliterable_characters: nontransliterable_chars.sort,\n )\n end\n end",
"title": ""
},
{
"docid": "a3451066db2d0ce73d8f7d464260194c",
"score": "0.5359822",
"text": "def typecast_fields(field_names)\n # types of times\n time_classes = [Time, DateTime, ActiveSupport::TimeWithZone]\n\n field_names.map do |field|\n # copy so we don't modify it\n klone = field.to_sym\n\n if self.attribute_typecasts[klone].present?\n if time_classes.include?(self.attribute_typecasts[klone])\n klone = [klone.to_sym, :time]\n elsif self.attribute_typecasts[klone] == Date\n klone = [klone.to_sym, :date]\n else\n klone = [klone.to_sym, self.attribute_typecasts[klone].to_s.downcase.to_sym]\n end\n elsif self.column_names.include?(klone.to_s)\n col = self.columns.detect{|c| c.name.to_s == klone.to_s}\n if col.klass == Date\n klone = [klone.to_sym, :date]\n elsif time_classes.include?(col.klass)\n klone = [klone.to_sym, :time]\n else\n klone = [klone.to_sym, col.type]\n end\n end\n klone\n end\n end",
"title": ""
},
{
"docid": "01977e9129a02dc26caaa0ddd9a21b2e",
"score": "0.52901375",
"text": "def each_field_with_value\n non_value_fields = DynamicFormField.class_variable_get(:@@field_with_null_value).delete_if{ |field| field == \"field_group\"}\n \n properties.each do |index, field|\n if field[:type].to_s == 'file_upload'\n attachment_field_id = field[:id]\n attachment = attachments.find { |attachment| attachment.content_meta == attachment_field_id }\n field[:attachment] = attachment\n yield attachment, field\n else\n next if non_value_fields.include?(field[:type])\n yield index, field\n end\n end\n end",
"title": ""
},
{
"docid": "295bf8e1bd98b270ab720a00fe5cf5ce",
"score": "0.52894884",
"text": "def test_mapping_thing_flattener\n fields = { :foo => ['thing1', 'thing2', [8,9,10], Time.now] }\n assert_equal([\"thing1\", \"thing2\", \"[8, 9, 10]\", Time.now.to_s], fields[:foo].map(&:to_s))\n end",
"title": ""
},
{
"docid": "0973a7ad781b10e276e02ae6eb7cbe1f",
"score": "0.5288804",
"text": "def fields_for_query\n self.class.fields_coercions.keys.each_with_object({}) do |field_name, results|\n results[field_name] = @fields.each_with_object({}) do |(locale, fields), field_results|\n field_results[locale] = get_value_from(fields, field_name)\n end\n end\n end",
"title": ""
},
{
"docid": "dde1981344aeba7796c88f494e5be038",
"score": "0.5273274",
"text": "def normalise_form_fields( fields = nil )\n\n # blah\n fields ||= @definition[:form][:fields]\n\n # iterate through everything\n fields = fields.map do |name, spec|\n\n # if the fieldspec is just a type string\n spec = { type: spec } unless spec.is_a?( Hash )\n\n # merge in our base spec\n spec = BASE_FIELD_DEFINITIONS.merge( spec ).merge(\n field: name,\n required: @model_class.property_required?( name ),\n _wrapped: !UNWRAPPED_FIELDS.include?( spec[:type] )\n )\n\n # if there are subfields, recurse thereward\n spec[:fields] = normalise_form_fields( spec[:fields] ) if spec.key?( :fields )\n\n # return the spec to the map function\n spec\n\n end\n\n # return our newly-crunched fields\n fields\n\n end",
"title": ""
},
{
"docid": "686412df23244565804b6a311b527e6a",
"score": "0.52655107",
"text": "def each_field\n return enum_for(__method__) if !block_given?\n\n self.class.each do |field|\n yield(field.name, get(field.name))\n end\n end",
"title": ""
},
{
"docid": "a589c0c5a130ae29eab426aa55224c5a",
"score": "0.5248757",
"text": "def valid_encrypted_fields\n fields = []\n\n new_resource.encrypted_fields.each do |f|\n property = new_resource.properties[f]\n\n if property && property.is_a?(String)\n fields.push(f)\n else\n Chef::Log.warn(\n \"Ignoring #{f}, as it's not present in both places \"\\\n '(encrypted_fields and properties) or is not a String'\n )\n end\n end\n\n Chef::Log.debug(\"Valid encrypted fields: #{fields}\")\n\n fields\n end",
"title": ""
},
{
"docid": "6da801414339cf80e2d9044567a67655",
"score": "0.52308035",
"text": "def normalize_fields\n @fields = @fields.map do |field|\n case field\n when Property\n # TODO: if the Property's model doesn't match\n # self.model, append the property's model to @links\n # eg:\n #if property.model != self.model\n # @links << discover_path_for_property(property)\n #end\n field\n when Symbol, String\n property = @properties[field]\n raise ArgumentError, \"+options[:fields]+ entry #{field} does not map to a DataMapper::Property\" if property.nil?\n property\n else\n raise ArgumentError, \"+options[:fields]+ entry #{field.inspect} not supported\"\n end\n end\n end",
"title": ""
},
{
"docid": "1175fc18b5fe9940fcb81b8ab3ed0e8d",
"score": "0.5224612",
"text": "def convert_fields_for_query(fields)\n to_dbobject prep_fields(fields)\n end",
"title": ""
},
{
"docid": "bfb940b1abfe1a97794c4aee383ad3d0",
"score": "0.52243215",
"text": "def coerce_all_attributes\n @to_coerce.each { |a| coerce_attribute(a) }\n end",
"title": ""
},
{
"docid": "ef64a48831227478999addac98a83aae",
"score": "0.52036136",
"text": "def fields!\n @validators.keys.find_all { |key| @validators[key].is_a? ::Proc }\n end",
"title": ""
},
{
"docid": "79014680095e581da4a2fe2118092f5d",
"score": "0.52020395",
"text": "def apply_changes_from_converted_types\n end",
"title": ""
},
{
"docid": "49c694c3a86344163e4453c5a79403cc",
"score": "0.5190132",
"text": "def each_poss_field\n each_poss_name do |fieldname|\n yield SubText.new(fieldname)\n end\n end",
"title": ""
},
{
"docid": "40a93856d720b382de8ae4011492c3ba",
"score": "0.51724195",
"text": "def each_converter(&block)\n return enum_for(__method__) if !block\n converters_by_from_type.each_value do |converters|\n converters.each(&block)\n end\n end",
"title": ""
},
{
"docid": "08dbd12d48319316997ec9cf4e9837ec",
"score": "0.514743",
"text": "def fill_fields (fields)\n fields.each do |field, value|\n fill_in field, :with => value #It will fail if the field is not present\n end\nend",
"title": ""
},
{
"docid": "2d7f7f8ce9c7ea744a38591c58fc5d4c",
"score": "0.5145218",
"text": "def sorted_schema_check; schema_check(:cast => true); end",
"title": ""
},
{
"docid": "1122e293dafcdebe9d2745a65bceb8c6",
"score": "0.51237655",
"text": "def get_field_values(data, *fields)\n v = data.is_a?(Hash) ? data.values_at(*fields) : fields.map { |f| try(f) }\n v.map(&:presence)\n end",
"title": ""
},
{
"docid": "c5b2093ee6df2863c6211742db966424",
"score": "0.5119924",
"text": "def map_fields(row, array_of_fields)\n result = array_of_fields.map do |field|\n if row[field[0]]\n #the class you pass in is used here and class objects are built\n yield(row, field)\n end\n end\n #removes nil values\n result.compact\n end",
"title": ""
},
{
"docid": "577c90205710933ef4ae1f9b657fb3fc",
"score": "0.511639",
"text": "def actual_fields(fields)\n Hash[*fields.each do |type, fields|\n [actual_type(type), fields.map { |f| actual_field(f, record_class(type)) }]\n end]\n end",
"title": ""
},
{
"docid": "15c4b73e78c6bd54b29111b8a665450d",
"score": "0.5114998",
"text": "def converter_results; end",
"title": ""
},
{
"docid": "f6d8ed39ec70b8b075d489ed42285b99",
"score": "0.5114928",
"text": "def sanitize_fields; end",
"title": ""
},
{
"docid": "de29f591d2cf460523f95078f3ef6768",
"score": "0.5111479",
"text": "def convert(params, event)\n params.each do |field, type|\n converter = method(CONVERT_PREFIX + type)\n\n case original = event.get(field)\n when NilClass\n next\n when Hash\n @log.warn(\"cannot convert hash\", field: field, value: original)\n when Array\n event.set(field, original.map{|v| converter.call(v)})\n else\n event.set(field, converter.call(original))\n end\n end\n end",
"title": ""
},
{
"docid": "efadd87e5289de5aaebe8928c09e6a30",
"score": "0.51102954",
"text": "def test_parse\n model = DataMetaForm::Fmt.parse(IO.read('./test/test.dmForm'))\n bel = DataMetaForm::Fmt::Delim.new(7.chr)\n expected = [DataMetaForm::Fmt::Field.new('user_id', true)]\n expected << bel\n expected << DataMetaForm::Fmt::Field.new('first', true) << bel\n expected << DataMetaForm::Fmt::Field.new('mid', false) << bel\n expected << DataMetaForm::Fmt::Field.new('last', true) << bel\n expected << DataMetaForm::Fmt::Field.new('salary', true) << bel\n #noinspection RubyArgCount\n expected << DataMetaForm::Fmt::Field.new('created', true, 'yyyy-MM-dd HH:mm:ss') << bel\n expected << DataMetaForm::Fmt::Field.new('last_mod', false, 'yyyy-MM-dd HH:mm:ss') << bel\n expected << DataMetaForm::Fmt::Delim.new(10.chr)\n index = -1\n\n model.each { |item| # each fields list item\n index += 1\n msg = \"Mismatch at index #{index}\"\n xp = expected[index]\n case item\n when DataMetaForm::Fmt::Delim\n raise \"At [#{index}]: expected #{xp.class}, #{item.class}\" unless xp.kind_of?(DataMetaForm::Fmt::Delim)\n assert_equal(xp.val, item.val, msg)\n when DataMetaForm::Fmt::Field\n raise \"At [#{index}]: expected #{xp.class}, #{item.class}\" unless xp.kind_of?(DataMetaForm::Fmt::Field)\n assert_equal(xp.name, item.name, msg)\n assert_equal(xp.isReq, item.isReq, msg)\n assert_equal(xp.fmt, item.fmt, msg)\n else\n # none of the interest\n end\n }\n end",
"title": ""
},
{
"docid": "047bd51687f7617164f6cbc3be919137",
"score": "0.5096296",
"text": "def convert_and_validate(*values)\n my_converted = []\n values.each do |val|\n return [false, values] unless ::Array===val\n ok, converted = @subvalidator.convert_and_validate(*val)\n return [false, values] unless ok\n my_converted << converted.compact\n end\n [true, my_converted]\n end",
"title": ""
},
{
"docid": "a488ac6d632ac0c6d6b5b57f13b4e824",
"score": "0.508584",
"text": "def validate_each(record, attribute, value); end",
"title": ""
},
{
"docid": "91ca0c29f834d40d50f8f9c49af9a972",
"score": "0.50808823",
"text": "def test_date_to_float_conversion\r\n with_each_spreadsheet(:name=>'datetime_floatconv', :format=>:excel) do |oo|\r\n assert_nothing_raised(NoMethodError) do\r\n oo.cell('a',1)\r\n oo.cell('a',2)\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "70f1917aa1be88eda13a29434314ae28",
"score": "0.50798345",
"text": "def test_verify_all_fields_record()\n expected_fields = ['id', 'name', 'realName', 'owner', 'gender']\n\n # Grab the first record\n record = @heroes.get_heroes[0]\n\n # Perform assertion\n assert_equal(record.keys.sort, expected_fields.sort)\n end",
"title": ""
},
{
"docid": "65dee56e725a9efc7ab8fc004d62db8d",
"score": "0.50793713",
"text": "def check_requested_fields()\n print \"\\n--------------------------------------------------------\\n\"\n print \"07) Validate desired fields...\\n\"\n found_a_bad_field = false\n @fields_2b_modified = []\n @desired_fields.split(',').each_with_index do |this_field, ndx_field|\n this_field = this_field.downcase\n if @tc_fields.include?(this_field) == true\n print \"\\tField OK: #{this_field}\\n\"\n @fields_2b_modified.push(this_field)\n else\n if @tc_fields.include?('custom_' + this_field) == true\n print \"\\tField OK: custom_#{this_field}\\n\"\n @fields_2b_modified.push('custom_' + this_field)\n else\n print \"\\tERROR: Did not find a field with system_name '#{this_field}'\\n\"\n found_a_bad_field = true\n end\n end\n end\n if found_a_bad_field == true\n print \"\\tERROR: Invalid field name(s) found (above); exiting'\\n\"\n exit ERR_EXIT_FIELDINV\n end\n return\nend",
"title": ""
},
{
"docid": "a90e6072cf6d1be46466bcaa6e7c1c6e",
"score": "0.50693476",
"text": "def field_values( field )\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "db68b9311b9bb3e079dd2c32a2075e61",
"score": "0.50615275",
"text": "def populate_fields; end",
"title": ""
},
{
"docid": "9162b3f83ceccc326888b6ead667c41b",
"score": "0.50605905",
"text": "def add_unconverted_fields(row, fields)\n class << row\n attr_reader :unconverted_fields\n end\n row.instance_eval { @unconverted_fields = fields }\n row\n end",
"title": ""
},
{
"docid": "bfbfdea7a6a268b4392ccf87e12ab5cc",
"score": "0.50465703",
"text": "def generic_row_import_test(model_class, test_class, exceptions)\n feed_row = test_class.valid_gtfs_feed_row\n feed = GtfsApi::FeedTest.fill_valid_model\n feed.save!\n model = model_class.new_from_gtfs(feed_row, feed)\n assert model.valid?, model.errors.to_a.to_s\n model_class.gtfs_cols.each do |model_attr, feed_col|\n next if exceptions.include? (model_attr)\n feed_value = feed_row[feed_col]\n feed_value = feed_value.to_f if model.send(model_attr).is_a? Numeric\n feed_value = Time.new_from_gtfs(feed_value) if model.send(model_attr).is_a? Time\n assert_equal model.send(model_attr), feed_value, \"Testing \" + model_attr.to_s + \" vs \" + feed_col.to_s\n end\n\nend",
"title": ""
},
{
"docid": "04b7a150c4f5b3f112fc13b34cdc107c",
"score": "0.50406384",
"text": "def each\n return enum_for(:each) unless block_given?\n self.class.fields.each { |name, _| yield name, send(name) }\n end",
"title": ""
},
{
"docid": "a24887570fdb6d1c2cac7eb7b8cb2ce2",
"score": "0.5039416",
"text": "def reflect_fields\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "c007acb8ba4390e9c5f9117f8e3f0fab",
"score": "0.5020976",
"text": "def converted_content\n return content unless field\n\n # Put this on a dedicated class/module\n # It is used on the ItemDataRepresenter as well\n convertors = {\n Fixnum => proc do |c|\n c.to_i\n end,\n Float => proc do |c|\n c.to_f\n end\n }\n\n convertor = convertors[field.content_type]\n\n if convertor && !content.nil?\n convertor.call(content)\n else\n content\n end\n end",
"title": ""
},
{
"docid": "1d35806d84a4f05a969cb50fee3c17ab",
"score": "0.5017641",
"text": "def map_record fields, record\n record[@idate] = \"20\" + record[@idate] + record[@itime] \n transform_time_values record,@idate\n record[@idate] == 0 ? false : true\n end",
"title": ""
},
{
"docid": "01992b951cf09d1b0b49b218d0c6c332",
"score": "0.5014586",
"text": "def validate_fieldlets!\n\t self.each do |fieldlet|\n\t @errors << fieldlet.validate() \n\t end\n end",
"title": ""
},
{
"docid": "27d75117dcb1ff99b577286abeabc622",
"score": "0.5006487",
"text": "def all_conversions?(obj)\n return false unless obj.is_a?(Array)\n obj.each do |v|\n return false unless v.is_a?(Symbol)\n end\n true\n end",
"title": ""
},
{
"docid": "6f9e3734919dc8821a4339c907522c49",
"score": "0.49987537",
"text": "def dump_fields\n @fields.each_pair do |k, v|\n rv = v.raw_value\n if v.raw_value.nil?\n logger.error(\"RTN: field:#{k} is nil\")\n elsif (value = v.value).is_a? Array\n logger.error(\"RTN: field:#{k} is #{value.inspect}\")\n else\n logger.error(\"RTN: field:#{k} is #{value}\")\n end\n end\n end",
"title": ""
},
{
"docid": "5ca102684f009c9511482b19dc28a89b",
"score": "0.49967474",
"text": "def import_fields(section_id, field_rows)\n field_rows.each do | row |\n custom_field = CustomField.find_by(key: row[\"name\"]&.strip)\n if custom_field\n puts \"🟠 Field: \\\"#{row[\"name\"]}\\\" already exists, skipping.\"\n else\n custom_field = CustomField.new(\n key: row[\"name\"]&.strip,\n field_type: row[\"field_type\"].downcase,\n options: row[\"field_options\"],\n hint: row[\"hint\"],\n custom_field_section_id: section_id\n )\n if custom_field.save\n puts \"🟢 Field: \\\"#{row[\"name\"]}\\\" created (id: #{custom_field.id}).\"\n else\n puts \"🟠 Field: \\\"#{row[\"name\"]}\\\" failed to save. Continuing with import. #{custom_field.errors.messages}\"\n end \n end\n end\n end",
"title": ""
},
{
"docid": "f64ecd3149363c6cf1b560c58cca1617",
"score": "0.4993867",
"text": "def validate_each_file\n # TODO: this should check ID consistentcy too...\n # @harvest.update_attribute(:consistency_checked_at, Time.now)\n # TODO: I don't think the mkdirs belong here. I wasn't sure where would be best. TODO: really the dir names\n # here (and the one in format.rb) should be configurable\n folder = Rails.public_path.join('converted_csv')\n unless Dir.exist?(folder)\n Dir.mkdir(folder)\n @process.info(\"Created new folder: #{folder}\")\n end\n # Leave this in! It solves a bug where the formats were missing. :S\n @resource.reload\n each_format do\n fields = nil # scope.\n if @format.header_lines&.positive?\n col_checks = check_each_column\n expected_by_file = col_checks[:expected]\n fields = col_checks[:fields]\n raise(Exceptions::ColumnUnmatched, \"TOO MANY COLUMNS: #{@format.represents}: #{expected_by_file.join(',')}\") if\n expected_by_file&.size&.positive?\n else\n fields = {}\n @format.fields.each { |f| fields[f.expected_header] = f }\n end\n @file = @format.converted_csv_file\n CSV.open(@file, 'wb', encoding: 'UTF-8') do |csv|\n validate_csv(csv, fields)\n end\n Admin.maintain_db_connection\n wc = EolFileUtils.wc(@file)\n @process.info(\"Valid: #{@file} (#{wc} lines)\")\n @converted[@format.id] = true\n end\n Admin.maintain_db_connection\n @harvest.update_attribute(:validated_at, Time.now)\n end",
"title": ""
},
{
"docid": "541fe36c78ad34d2ac30758007a78323",
"score": "0.4984617",
"text": "def test_to_arabic_complex\n @faelle_complex.each do |key, value|\n assert_equal(value, Romanizer.to_arabic_complex(key));\n end\n end",
"title": ""
},
{
"docid": "451313592676b59ee71d806b58fb0a31",
"score": "0.49727422",
"text": "def convert_field_for_map(field)\n case field\n when \"byte\"\n \"UInt8\"\n when \"short\"\n \"Short\"\n when \"int\"\n \"Int\"\n when \"long\"\n \"Int\"\n when \"double\"\n \"Double\"\n when \"string\"\n \"String\"\n else\n field\n end\nend",
"title": ""
},
{
"docid": "7f78f282e87cfc6eb06c16b266e4ce19",
"score": "0.49648738",
"text": "def _fields; end",
"title": ""
},
{
"docid": "44c5c2c331afb465a57d615347f82c7d",
"score": "0.49620387",
"text": "def fields_ok? table,fields\n table_fields = Database::TableUtil::list_fields(table)\n remainings = fields.keys - table_fields\n return true if remainings.empty?\n # add remainings fields\n remainings.each do |f|\n if @opts[:mock]\n Logger.<<(__FILE__,\"INFO\",\"We should add the field #{f} to the #{table} table.\")\n else\n Database::TableUtil::add_field(table,f,fields[f])\n end\n end\n return true\n rescue => e\n Logger.<<(__FILE__,\"ERROR\",\"DUring DB fields_ok? operation #{table} . #{e}\")\n return false\n end",
"title": ""
},
{
"docid": "2ad49a1fbc902c24a00d0dec2df2b395",
"score": "0.49599585",
"text": "def check(fields)\n missing_fields = @spec.keys.difference(fields.keys)\n\n if missing_fields.any?\n missing_fields.each do |field|\n raise \"wrong number of args\" unless @spec[field].eql?(Type::Any)\n end\n end\n\n mismatching_fields = fields.keys.difference(@spec.keys)\n\n raise \"key does not exist\" if mismatching_fields.any?\n\n fields.each do |(field, value)|\n raise \"wrong data type\" unless value.is_a?(@spec[field]) || @spec[field].eql?(Type::Any)\n end\n\n true\n end",
"title": ""
},
{
"docid": "9db862a446bf614ec37a59d99fd4b5f5",
"score": "0.49595982",
"text": "def each\n super do |key, value|\n yield(convert(key), convert(value))\n end\n end",
"title": ""
},
{
"docid": "8049e561b8e4e4a9ea2f0eab55ef0790",
"score": "0.4958996",
"text": "def validate_fields!\n @fields_validations = true\n end",
"title": ""
},
{
"docid": "077a123540f9041741e406230f7fe64b",
"score": "0.49584788",
"text": "def verify_data_format\n index = 0\n @body_array.freeze\n @header_array.each do |column| \n matched_column = @@all_fields.find {|f| f[:name] == column}\n if matched_column\n set_error_message(\"Column #{matched_column[:name]} is not in the correct format\") unless verify_data_value matched_column, @body_array[index]\n end\n index += 1\n end\n end",
"title": ""
},
{
"docid": "66efda03f6c4ae0a09d02259114d33b1",
"score": "0.49561992",
"text": "def test_1100_feature_fields_complete\n # todo test if all fields of a feature are there\n feature = @testdocument.head.features[0]\n assert feature\n assert feature.type\n assert feature.key\n assert feature.value\n end",
"title": ""
},
{
"docid": "aad18999ba2bd0cbc6e711d52f807965",
"score": "0.4955557",
"text": "def typecast_copy_get( field_str, fieldno, format, encoding )\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "72cba03c2480decca10c91a32ffb898c",
"score": "0.49523476",
"text": "def field_mapping_fill!\n fields.each { |f| f.value = f.name.to_s if f.type == 'Text'}\n self\n end",
"title": ""
},
{
"docid": "a6938ac5e223929fd574c4581fa0e573",
"score": "0.4948001",
"text": "def each_field\n unless block_given?\n return enum_for(:each_field)\n end\n\n each_record_from_data_dictionary_index(:SYS_FIELDS, :PRIMARY) do |record|\n yield record.fields\n end\n\n nil\n end",
"title": ""
},
{
"docid": "6b005bdd668e9ea352896182ca9cfd27",
"score": "0.4943667",
"text": "def mark_all_fields!\n validations = self.class.validations\n if validations\n validations.each_key do |key|\n mark_field!(key.to_sym)\n end\n end\n end",
"title": ""
},
{
"docid": "6b005bdd668e9ea352896182ca9cfd27",
"score": "0.4943667",
"text": "def mark_all_fields!\n validations = self.class.validations\n if validations\n validations.each_key do |key|\n mark_field!(key.to_sym)\n end\n end\n end",
"title": ""
},
{
"docid": "1bd936968636ffdb9d8cba9f31fe6485",
"score": "0.49423522",
"text": "def test_1200_scale_fields_complete\n scale = @testdocument.scale_set.first\n assert scale\n %w{id unit mode continuous?}.each do |field|\n #puts \"<<#{field}>>\"\n assert scale.respond_to?(field), \"Scale is missing #{field} field.\"\n end\n end",
"title": ""
},
{
"docid": "1236b0c400de42ab5da75e788bc2034b",
"score": "0.49377444",
"text": "def all_matches_fhir_date_format(fieldpath, fhirdateformat, jsonobject)\n # pul all values for fieldpath\n # loop values and verify all match the provided dateformat\n steps = fieldpath.split('.')\n allvalues = []\n #loop through all json records and pull out all possible values for the provided path\n #this result could contain nil values if path does not exist in record\n jsonobject.each do |onerecord|\n save_all_values_of_path(0, steps, onerecord, allvalues)\n end # jsonobject.each\n # assumption is that if allvalues.length is 0, then the path did not resolve\n if allvalues.length == 0\n @@defined_error_msg = \"#{fieldpath} was not found in provided json\"\n return false\n end\n matches = true\n allvalues.each do |_tempvalue|\n regexresult = fhirdateformat.match(allvalues[0])\n was_found = !regexresult.nil?\n matches &&= was_found\n end #allvalues.each\n unless matches\n @@defined_error_msg = \"all values did not match provided fhirdateformat: #{allvalues}\"\n end #unless\n return matches\n end",
"title": ""
},
{
"docid": "81df89dbd2b1efb54091208b5a69923e",
"score": "0.4937156",
"text": "def convert_fields_for_query(fields)\n case fields\n when String, Symbol\n to_dbobject({fields => 1})\n when Array\n return nil if fields.length.zero?\n hash = {}\n fields.each { |field| hash[field] = 1 }\n to_dbobject hash\n when Hash\n to_dbobject fields\n end\n end",
"title": ""
},
{
"docid": "e29c9acd2f491bc97f1cb6241a88a33e",
"score": "0.4928756",
"text": "def translate_journal_fields(cm_object,field_name,field_value)\n\n# logger.error(\"cm_object -> \" + cm_object)\n# logger.error(\"field_name -> \" + field_name)\n\n if (cm_object.nil? or field_name.nil? or field_value.nil?)\n return \"\"\n end\n\n case cm_object\n when 'CmDoc'\n case field_name\n #Types translated in other helpers.\n when 'approval_level' \n change_approval_level_to_s(field_value)\n when 'baseline' \n change_baseline_to_s(field_value)\n #Types translated in reference tables:\n when 'category_id'\n DocumentCategory.find(:first,:conditions => ['id=?', field_value]).name unless DocumentCategory.find(:first,:conditions => ['id=?', field_value]).nil?\n when 'type_id'\n CmDocType.find(:first,:conditions => ['id=?', field_value]).name unless CmDocType.find(:first,:conditions => ['id=?', field_value]).nil?\n when 'originator_company_id'\n CmCompany.find(:first,:conditions => ['id=?', field_value]).name unless CmCompany.find(:first,:conditions => ['id=?', field_value]).nil?\n when 'subsystem_id'\n CmSubsystem.find(:first,:conditions => ['id=?', field_value]).name unless CmSubsystem.find(:first,:conditions => ['id=?', field_value]).nil?\n else\n field_value\n end\n\n when 'CmNc'\n case field_name\n #Types translated in reference tables:\n when 'status_id'\n CmNcsStatus.find(:first,:conditions => ['id=?', field_value]).name unless CmNcsStatus.find(:first,:conditions => ['id=?', field_value]).nil?\n when 'type_id'\n CmNcsType.find(:first,:conditions => ['id=?', field_value]).name unless CmNcsType.find(:first,:conditions => ['id=?', field_value]).nil? \n when 'classification_id'\n CmNcsClassification.find(:first,:conditions => ['id=?', field_value]).name unless CmNcsClassification.find(:first,:conditions => ['id=?', field_value]).nil?\n when 'subsystem_id'\n CmSubsystem.find(:first,:conditions => ['id=?', field_value]).name unless CmSubsystem.find(:first,:conditions => ['id=?', field_value]).nil?\n when 'assigned_to_id'\n unless (User.find(:first,:conditions => ['id=?', field_value]).nil?)\n User.find(:first,:conditions => ['id=?', field_value]).firstname + \" \" +User.find(:first,:conditions => ['id=?', field_value]).lastname\n end\n when 'rlse_expected_id'\n Version.find(:first,:conditions => ['id=?', field_value]).name unless Version.find(:first,:conditions => ['id=?', field_value]).nil?\n when 'supplier_id'\n CmCompany.find(:first,:conditions => ['id=?', field_value]).name unless CmCompany.find(:first,:conditions => ['id=?', field_value]).nil?\n else\n field_value\n end\n\n when 'CmRid'\n case field_name\n #Types translated in other helpers.\n when 'internal_status_id'\n change_internal_status_to_s(field_value.to_i)\n when 'category'\n change_category_to_s(field_value.to_i)\n #Types translated in reference tables:\n when 'close_out_id'\n CmRidCloseOut.find(:first,:conditions => ['id=?', field_value]).name unless CmRidCloseOut.find(:first,:conditions => ['id=?', field_value]).nil?\n when 'implementation_release_id'\n Version.find(:first,:conditions => ['id=?', field_value]).name unless Version.find(:first,:conditions => ['id=?', field_value]).nil?\n when 'assigned_to_id'\n unless (User.find(:first,:conditions => ['id=?', field_value]).nil?)\n User.find(:first,:conditions => ['id=?', field_value]).firstname + \" \" +User.find(:first,:conditions => ['id=?', field_value]).lastname\n end\n when 'affected_doc_id'\n CmDoc.find(:first,:conditions => ['id=?', field_value]).name unless CmDoc.find(:first,:conditions => ['id=?', field_value]).nil?\n else\n field_value\n end\n\n else\n\n field_value\n\n end\n \n end",
"title": ""
},
{
"docid": "8996deefbe7bb98609f8ea5bf2df3bf2",
"score": "0.49269938",
"text": "def prepare_fields_and_override_hashes fields\n\n fields = fields.dup\n one_per_request_count = 0\n\n fields.each_pair do |field, setup|\n if Hash === setup\n value = setup[:value]\n case setup[:type]\n\n when OnePerRequest\n\n one_per_request_count += 1\n raise MultiplePerRequestFieldError unless one_per_request_count == 1\n\n # use first one for initial request, and rest for additional, yielding n - 1 new requests\n fields[field] = value.shift\n (value.map {|val| {field => val} }).each do |overrides|\n yield overrides\n end\n\n when Csv\n fields[field] = value.join(',') \n \n end\n end\n \n fields\n end\n end",
"title": ""
},
{
"docid": "514bf8c50471d07092180029adf347f0",
"score": "0.49238467",
"text": "def set_extra_fields\n return unless challenge\n\n challenge.challenge_idea_fields.each_with_index do |field, i|\n field_name = \"cfield#{i}\"\n unless respond_to? field_name\n self.class.send :hstore_column, :properties, field_name, :text\n # self.class.send :validates, field_name, presence: true if field.required\n end\n end\n end",
"title": ""
},
{
"docid": "7b602c72a38a15bc0152ef612b60bfc6",
"score": "0.4916258",
"text": "def lower_fields\n self.attributes.each do |key,value|\n value = value.downcase rescue value\n end\n end",
"title": ""
},
{
"docid": "a10685476a18db23293fdb4403570b4f",
"score": "0.4914762",
"text": "def fields?; end",
"title": ""
},
{
"docid": "538fdd05c31d8046f3b35e0ce2d98852",
"score": "0.4913794",
"text": "def subclass_initialize\n @field_types = Hash.new\n @fields = Array.new\n @field_metadata = Hash.new\n get_fields.each do |name, offset, type, metadata|\n if name.respond_to?(:force_encoding)\n name.force_encoding('ASCII')\n end\n field_types[name] = type\n field_types[name.to_sym] = type\n fields << [name, type]\n field_metadata[name] = metadata\n end\n\n converted_fields = []\n full_fields = []\n each_field do |name, type|\n if type.contains_converted_types?\n converted_fields << name\n else\n full_fields << name\n end\n end\n converted_fields = converted_fields.sort\n full_fields = full_fields.sort\n\n @converted_fields = converted_fields\n overloaded_converted_fields = filter_methods_that_should_not_be_defined(converted_fields, false)\n overloaded_full_fields = filter_methods_that_should_not_be_defined(full_fields, true)\n m = access_method_module(overloaded_full_fields, overloaded_converted_fields)\n include(m)\n\n super if defined? super\n\n if !convertions_from_ruby.has_key?(Hash)\n convert_from_ruby Hash do |value, expected_type|\n result = expected_type.new\n result.set_hash(value)\n result\n end\n end\n\n if !convertions_from_ruby.has_key?(Array)\n convert_from_ruby Array do |value, expected_type|\n result = expected_type.new\n result.set_array(value)\n result\n end\n end\n end",
"title": ""
},
{
"docid": "c1edf0452a36acd0bb66c6b76593001e",
"score": "0.48944265",
"text": "def fields_for_query\n raw_fields = instance_variable_get(:@fields)\n fields_names = flatten_field_names(raw_fields)\n fields_names.each_with_object({}) do |field_name, results|\n results[field_name] = raw_fields.each_with_object({}) do |(locale, fields), field_results|\n field_results[locale] = parse_update_attribute(fields[field_name])\n end\n end\n end",
"title": ""
},
{
"docid": "dc7e283c5dab04105b4624068c57f55e",
"score": "0.48915207",
"text": "def transform_time_values row,*fields \n fields.each do |i|\n next unless i ## workaround, same mapper used for different format\n ## thens some fields may not exists\n v = row[i]\n values = Util::decompose(v,:sec).compact\n if values.empty? \n row[i] = 0\n else\n begin\n row[i] = Time.utc(*values).to_i \n rescue => e\n puts values.inspect\n puts e\n abort\n end\n end\n end\n return true\n end",
"title": ""
},
{
"docid": "9258f448d175a83fcd78d60ab8d47229",
"score": "0.48910445",
"text": "def process_attributes(attrs = nil)\n attrs ||= {} \n attrs.each_pair do |key, value|\n name = key.to_s\n validate_field(name, value)\n send(\"#{name}=\", value)\n end\n end",
"title": ""
},
{
"docid": "e46048c57ae136bd11c2aa8b69f0f65a",
"score": "0.4889181",
"text": "def data_validate_fields(errors)\n\n @field_names.each { |key|\n field=@fields[key]\n\n if not field.valid_data?\n errors[key] = field.errors_data\n end\n }\n end",
"title": ""
},
{
"docid": "af1eba50b8b09e5f573fff5f2ecd1f85",
"score": "0.4884988",
"text": "def adapt_fields\n self.fields.destroy_all\n self.create_fields\n end",
"title": ""
},
{
"docid": "02dfeda4853f98c0adb4755bdd17c9ab",
"score": "0.48849332",
"text": "def fields?; @fields; end",
"title": ""
},
{
"docid": "4a37fcbb949c20835d41de5f3ff30416",
"score": "0.48834082",
"text": "def each_field(&block)\n if block_given?\n @fields.each(&block)\n self\n else\n @fields.dup\n end\n end",
"title": ""
},
{
"docid": "2e9c6fb89c24c484357bd36a814d38c2",
"score": "0.48819894",
"text": "def test_to_roman_complex\n @faelle_complex.each do |key, value|\n assert_equal(key, Romanizer.to_roman_complex(value));\n end\n end",
"title": ""
},
{
"docid": "f6787a48566d75bfe6fb37faf054ff18",
"score": "0.4875904",
"text": "def fields; @_fields; end",
"title": ""
},
{
"docid": "a58d451226404e07695b5d80be4f77a9",
"score": "0.48731774",
"text": "def process_fields_and_projects(fields)\n fields.each do |pair|\n type = pair.first.gsub(/(^['\"]|['\"]$)/, '')\n value = pair.last.gsub(/(^['\"]|['\"]$)/, '')\n case type.downcase\n when 'account' then @accounts << value.to_i\n when 'group' then @groups << value.downcase\n when 'filter' then @filters << value.downcase.to_sym\n when 'access' then @access = ACCESS_MAP[value.strip.to_sym]\n when 'project' then @projects << value\n when 'projectid' then @project_ids << value.to_i\n when 'document' then @doc_ids << value.to_i\n else\n process_field(type, value)\n end\n end\n end",
"title": ""
},
{
"docid": "21d29d9fcc56fed5ff7589317707d3b0",
"score": "0.48680368",
"text": "def each\n @fields.each do |name, field|\n yield BoundField.new(self, field, name)\n end\n end",
"title": ""
},
{
"docid": "21d29d9fcc56fed5ff7589317707d3b0",
"score": "0.48680368",
"text": "def each\n @fields.each do |name, field|\n yield BoundField.new(self, field, name)\n end\n end",
"title": ""
},
{
"docid": "f423a854a0c0c4cb1b270138aaf4e8ff",
"score": "0.48679006",
"text": "def convert\n match('q', 'name')\n equal('company_type', 'classification')\n equal('created_since', 'created_at>=')\n date_range('incorporation_date', 'founding_date')\n date_range('dissolution_date', 'dissolution_date')\n equal('per_page', 'limit', default: input['open_corporates_api_key'] && 100) # default 30\n equal('page', 'page')\n\n input['contact_details'] && input['contact_details'].each do |contact_detail|\n if contact_detail['type'] == 'address' && (contact_detail['value'] || contact_detail['value~='])\n output['registered_address'] = contact_detail['value'] || contact_detail['value~=']\n end\n end\n\n # API-specific parameters.\n equal('api_token', 'open_corporates_api_key')\n one_of('jurisdiction_code', 'jurisdiction_code', transform: lambda{|v| v.downcase})\n one_of('country_code', 'country_code', transform: lambda{|v| v.downcase})\n equal('current_status', 'current_status')\n all_of('industry_codes', 'industry_code', backup: :one_of)\n equal('inactive', 'inactive', valid: [true, false])\n equal('branch', 'branch', valid: [true, false])\n equal('nonprofit', 'nonprofit', valid: [true, false])\n\n output\n end",
"title": ""
},
{
"docid": "14372fe268134f3b1566d198f2090100",
"score": "0.4866155",
"text": "def update_changed_fields\n changed_fields = self.changed_fields\n if changed_fields != nil && changed_fields.length > 0\n if changed_fields.has_key?(\"transaction_business_name_code\")\n transaction_business_name_code = changed_fields.fetch(\"transaction_business_name_code\")[1]\n trans_business_name = TransactionBusinessName.find_by_transaction_business_name_code(transaction_business_name_code)\n if trans_business_name\n self.transaction_business_name_id = trans_business_name.id\n self.transaction_business_name_code = trans_business_name.transaction_business_name_code\n end\n end\n\n # if changed_fields.has_key?(\"transaction_type_code\")\n # transaction_type_code = changed_fields.fetch(\"transaction_type_code\")[1]\n # trans_type = TransactionType.find_by_transaction_type_code(transaction_type_code)\n # if trans_type\n # self.transaction_type_id = trans_type.id\n # self.transaction_type_code = trans_type.transaction_type_code\n # end\n # end\n\n if changed_fields.has_key?(\"reference_number\")\n reference_number = changed_fields.fetch(\"reference_number\")[1]\n self.reference_number = reference_number\n end\n end\n #self.update\nend",
"title": ""
}
] |
ddc30c99513c9ba855626bab1fa3ff0a
|
Creates JSON of the curent object
|
[
{
"docid": "e70adda17d089a30b656fc1b78c6e643",
"score": "0.0",
"text": "def to_json(options = {})\r\n hash = key_map\r\n hash.to_json(options)\r\n end",
"title": ""
}
] |
[
{
"docid": "88d583e291ae96cf67ce99a9df5bb82b",
"score": "0.7116037",
"text": "def write_json(object); write object.to_json; end",
"title": ""
},
{
"docid": "9951867288d5591d9d7b213a760914d6",
"score": "0.711067",
"text": "def to_json(*args)\n {\n JSON.create_id => self.class.name,\n 'data' => self.to_h\n }.to_json(*args)\n end",
"title": ""
},
{
"docid": "1866fcbc505ef73c50020a99068089cd",
"score": "0.70874524",
"text": "def as_json( options={} )\n { :id => id.to_s + \"_obj\", :name => name, :data => description, :children => [] }\n end",
"title": ""
},
{
"docid": "8166975a759cb3f24ec60f3a04204d55",
"score": "0.7024722",
"text": "def make_json object\n if @pretty_json\n JSON.pretty_generate(object)\n else\n object.to_json\n end\n end",
"title": ""
},
{
"docid": "4ae4417e1dc6ee36d1a49f02d768dd9d",
"score": "0.702136",
"text": "def instance_to_json\n { \n id: self.id,\n name: self.name,\n about: self.about,\n img_url: self.img_url,\n user: {\n id: self.user.id,\n name: self.user.name\n }\n }\n end",
"title": ""
},
{
"docid": "c69a7440381f6e6ea8fdd5f9b1f81d54",
"score": "0.70051235",
"text": "def as_json(*)\n {\n JSON.create_id => self.class.name,\n 'o' => options,\n 's' => source,\n }\n end",
"title": ""
},
{
"docid": "5144e8a4ebbbce7fcca2672a0190f76b",
"score": "0.70018214",
"text": "def to_json; end",
"title": ""
},
{
"docid": "06dbd6d2dc4bd4c8c66e349cfe7fd766",
"score": "0.6980881",
"text": "def to_json\n json_generator.json\n end",
"title": ""
},
{
"docid": "bc3624a257ead82f79bb324d72f8e9c4",
"score": "0.6973438",
"text": "def as_json(*)\n {\n JSON.create_id => self.class.name,\n 'o' => options,\n 's' => source,\n }\n end",
"title": ""
},
{
"docid": "4c0d0f384e90fb55cc0cfe6ba2747c00",
"score": "0.69398624",
"text": "def to_json\n\t\t\t\tend",
"title": ""
},
{
"docid": "c78bed3d48f7bccdcc6681c35d0fcd06",
"score": "0.6923652",
"text": "def to_json\n\t\t\t\t\tto_h.to_json\n\t\t\t\tend",
"title": ""
},
{
"docid": "c78bed3d48f7bccdcc6681c35d0fcd06",
"score": "0.6923652",
"text": "def to_json\n\t\t\t\t\tto_h.to_json\n\t\t\t\tend",
"title": ""
},
{
"docid": "c78bed3d48f7bccdcc6681c35d0fcd06",
"score": "0.6923652",
"text": "def to_json\n\t\t\t\t\tto_h.to_json\n\t\t\t\tend",
"title": ""
},
{
"docid": "c78bed3d48f7bccdcc6681c35d0fcd06",
"score": "0.6923652",
"text": "def to_json\n\t\t\t\t\tto_h.to_json\n\t\t\t\tend",
"title": ""
},
{
"docid": "689213bcef1227a307b7860ace6cfcf0",
"score": "0.6922411",
"text": "def as_json(*)\n {\n JSON.create_id => self.class.name,\n 'y' => year,\n 'm' => month,\n 'd' => day,\n 'sg' => start,\n } \n end",
"title": ""
},
{
"docid": "fdc6b0035d54261ccfff829d06f9e2c3",
"score": "0.69181156",
"text": "def json_\n hash = {\n \"Id\" => id,\n \"Status\" => status,\n \"ParentId\" => parent_id,\n \"Name\" => name,\n \"Created\" => created,\n \"AllowCallback\" => allow_callback,\n \"CallbackToken\" => callback_token\n }\n\n hash.to_json\n end",
"title": ""
},
{
"docid": "c6f884d4d55502d1e90ba716a0d3db0c",
"score": "0.68758",
"text": "def build_data_object(obj)\n { success: true, data: obj }.to_json\n end",
"title": ""
},
{
"docid": "f1e0f820752a1aa16baaed34bc6bbee3",
"score": "0.68699574",
"text": "def to_json\n object.to_json\n end",
"title": ""
},
{
"docid": "d5ec943050a466a5ed4d16b0af2d625b",
"score": "0.68580574",
"text": "def as_json(*)\n {\n FunJSON.create_id => self.class.name,\n 'o' => options,\n 's' => source,\n }\n end",
"title": ""
},
{
"docid": "f5f26634b78633ae669cb23b788ac2f7",
"score": "0.68564504",
"text": "def json\n @@id += 1\n charset = @options[:reg_options].charset\n \"{\" +\n \"\\\"type\\\": \\\"#{@data_type}\\\", \\\"id\\\": \\\"L#{@@id}\\\", \\\"value\\\": #{@obj.json}, \" +\n \"\\\"offset\\\": #{@offset}, \\\"length\\\": #{@length}, \" +\n \"\\\"charset\\\": \\\"#{charset}\\\"\" +\n \"}\"\n end",
"title": ""
},
{
"docid": "0da080b29077af334312e388c0b8425b",
"score": "0.6849109",
"text": "def to_json\n end",
"title": ""
},
{
"docid": "7ac02993f6ae36bd40e0291710a61405",
"score": "0.6830482",
"text": "def build_data_object(obj)\n { success: true, data: obj }.to_json\n end",
"title": ""
},
{
"docid": "c8595f338a7bd64b77784c7e9b4b2b00",
"score": "0.6827027",
"text": "def custom_json\n '\"' + self.o_id.to_s + '\":{\"o_class\":\"' + self.class.to_s + '\", \"data\":' + self.to_json + \"}\"\n end",
"title": ""
},
{
"docid": "c333a116eb66095c2619b36bbe328bc4",
"score": "0.68066907",
"text": "def as_json(*)\n {\n JSON.create_id => self.class.name,\n 'y' => year,\n 'm' => month,\n 'd' => day,\n 'sg' => start,\n }\n end",
"title": ""
},
{
"docid": "d084233932a12f8eac5f7b8d79c2e44f",
"score": "0.6786195",
"text": "def to_json(*args, &block)\n # Remove the @_mounters instance var added by CarrierWave (0.4.1 atm),\n # which contains circular references :(\n \"{\\\"#{self.class}\\\": #{instance_values.except('_mounters').to_json}}\"\n end",
"title": ""
},
{
"docid": "e16c5bf24c306c541019a1fd09f7db4c",
"score": "0.6782656",
"text": "def serialize\n @json = {}\n ActiveSupport::Notifications.instrument('as_json.contact') do\n if @mode == 'only_name'\n build_hash_only_name\n elsif @mode == 'all' \n build_hash\n elsif @mode == 'select'\n prepare_select\n build_hash\n add_historic_values\n end\n end\n @json\n end",
"title": ""
},
{
"docid": "c055eeb8d9f1c4e3b5c6521799d7f903",
"score": "0.6769468",
"text": "def emit_json(obj)\n content_type :json\n obj.to_json\n end",
"title": ""
},
{
"docid": "b327a1dbffa4f315259f4e60ecd3337d",
"score": "0.67584246",
"text": "def dump_json(object)\n ::JSON.generate(object)\n end",
"title": ""
},
{
"docid": "5a5615315675a270b46625a9e25f31c6",
"score": "0.6756273",
"text": "def to_json\n restore\n\n Synaptical::Serializer::JSON.as_json(self)\n end",
"title": ""
},
{
"docid": "66abb236ea7566762392b7d351825606",
"score": "0.6748026",
"text": "def to_json\n JSON.generate(to_hash)\n end",
"title": ""
},
{
"docid": "66abb236ea7566762392b7d351825606",
"score": "0.6748026",
"text": "def to_json\n JSON.generate(to_hash)\n end",
"title": ""
},
{
"docid": "4e1b63a35f1100d1ecf9764e205bc625",
"score": "0.6746673",
"text": "def encode(obj)\n JSON.generate(obj)\n end",
"title": ""
},
{
"docid": "d69b1d810b030feb3764b3a0e71488ae",
"score": "0.67451566",
"text": "def to_json\n JSON.generate(self.to_hash)\n end",
"title": ""
},
{
"docid": "84b72959e6b4878be5a170aa0360751d",
"score": "0.67406243",
"text": "def to_json(_context = nil)\n to_h.to_json\n end",
"title": ""
},
{
"docid": "84b72959e6b4878be5a170aa0360751d",
"score": "0.67406243",
"text": "def to_json(_context = nil)\n to_h.to_json\n end",
"title": ""
},
{
"docid": "84b72959e6b4878be5a170aa0360751d",
"score": "0.67406243",
"text": "def to_json(_context = nil)\n to_h.to_json\n end",
"title": ""
},
{
"docid": "bb8f578235367753d13278c7b873f587",
"score": "0.67191213",
"text": "def json_serialization\n JSON.generate(self.serialize)\n end",
"title": ""
},
{
"docid": "7d5a6559154bd6fb075eb363fcfb4189",
"score": "0.6707326",
"text": "def to_json\n { \n :json_class => self.class.name,\n :id => self.id,\n :name => self.name,\n :source => self.source,\n :type => self.type\n }.to_json\n end",
"title": ""
},
{
"docid": "518510794b90c6039cdb129f73e93305",
"score": "0.6704284",
"text": "def as_json( options={} )\n { :id => id.to_s + \"_cat\", :name => name, :data => description, :children => known_objects }\n end",
"title": ""
},
{
"docid": "dde90743be769cffe60303814c85f3b5",
"score": "0.67006063",
"text": "def to_json(*)\n JSON.generate as_json\n end",
"title": ""
},
{
"docid": "dde90743be769cffe60303814c85f3b5",
"score": "0.67006063",
"text": "def to_json(*)\n JSON.generate as_json\n end",
"title": ""
},
{
"docid": "dde90743be769cffe60303814c85f3b5",
"score": "0.67006063",
"text": "def to_json(*)\n JSON.generate as_json\n end",
"title": ""
},
{
"docid": "d3b77f35d68f77caecd59f44feaa3cf8",
"score": "0.66951644",
"text": "def to_json\n JSON.generate( self.to_h )\n end",
"title": ""
},
{
"docid": "7c57bebd43ab268487714635d0bdc952",
"score": "0.6692085",
"text": "def json\n # We do not want to insert much extra whitespace, because ECS imposes\n # a maximum file-size limit based on bytes.\n JSON.generate(generate())\n end",
"title": ""
},
{
"docid": "62a2641da42f763ec90ccb83615b1c66",
"score": "0.66844994",
"text": "def to_json\n self.to_shared.to_json\n end",
"title": ""
},
{
"docid": "0c9cb503d20110a0df51fe76861a9782",
"score": "0.66692346",
"text": "def as_json(*)\n {\n JSON.create_id => self.class.name,\n 'y' => year,\n 'm' => month,\n 'd' => day,\n 'H' => hour,\n 'M' => min,\n 'S' => sec,\n 'of' => offset.to_s,\n 'sg' => start,\n } \n end",
"title": ""
},
{
"docid": "ca97cef13b7e1633c683c93ce8903959",
"score": "0.6665753",
"text": "def as_json; end",
"title": ""
},
{
"docid": "ca97cef13b7e1633c683c93ce8903959",
"score": "0.6665753",
"text": "def as_json; end",
"title": ""
},
{
"docid": "ca97cef13b7e1633c683c93ce8903959",
"score": "0.6665753",
"text": "def as_json; end",
"title": ""
},
{
"docid": "b29725faacd3b97e552e0260b3ab1b28",
"score": "0.66554254",
"text": "def json_creator\n unique = unique_creator()\n tempJson = {\n \"id\" => \"#{@ticket}\",\n \"data\" => \"#{unique}\"\n }\n File.open(\"#{@dirname}#{@ticket}.json\", File::WRONLY|File::CREAT|File::EXCL) do |file|\n file.write(JSON.pretty_generate(tempJson))\n end\n end",
"title": ""
},
{
"docid": "8d230d8da84ff2cab35af7bb61366725",
"score": "0.66527414",
"text": "def to_json_object(json_obj_)\n end",
"title": ""
},
{
"docid": "50b39b11f0c69ba00b1932b2ade43d84",
"score": "0.66315216",
"text": "def toJson()\n json = { 'class' => self.class.to_s }\n json['id'] = @id ;\n json['type'] = @type ;\n json['pos'] = [@pos.x, @pos.y]\n\n return json ;\n end",
"title": ""
},
{
"docid": "ac81a1771ef0eaa4c8afe1da6825491d",
"score": "0.66306233",
"text": "def as_json\n\t\t{\n\t\t\t:id => self.id,\n\t\t\t:nombre => self.nombre,\n\t\t\t:abreviacion => self.abreviacion,\n\t\t}\t\t\n\tend",
"title": ""
},
{
"docid": "43d3c1aa617fddc3404ec6737c968d8e",
"score": "0.66293746",
"text": "def prepare_json; end",
"title": ""
},
{
"docid": "66e1bb987512ebe81ceb2c12d495264d",
"score": "0.66036826",
"text": "def as_json(*)\n {\n JSON.create_id => self.class.name,\n 'm' => message,\n 'b' => backtrace,\n }\n end",
"title": ""
},
{
"docid": "66e1bb987512ebe81ceb2c12d495264d",
"score": "0.66036826",
"text": "def as_json(*)\n {\n JSON.create_id => self.class.name,\n 'm' => message,\n 'b' => backtrace,\n }\n end",
"title": ""
},
{
"docid": "146a1258d09831d223c079a4cc77a710",
"score": "0.66010875",
"text": "def toJson()\n json = { 'class' => self.class.to_s } ;\n\n ## coord system\n json['location'] = @coordSystem.toJson() ;\n\n ## edge list\n _edgeList = [] ;\n @edgeTable.each{|id, edge|\n _edgeList.push(edge.toJson()) ;\n }\n json['edgeList'] = _edgeList ;\n\n ## junction list\n _junctionList = [] ;\n @junctionTable.each{|id, junction|\n _junctionList.push(junction.toJson()) ;\n }\n json['junctionList'] = _junctionList ;\n\n return json ;\n end",
"title": ""
},
{
"docid": "d2d791b6f0edc9b359ec1dc10c52f626",
"score": "0.6601037",
"text": "def toJson()\n json = { 'class' => self.class.to_s }\n json['id'] = @id ;\n json['type'] = @type ;\n json['from'] = @fromId ;\n json['to'] = @toId ;\n\n _laneList = @laneList.map{|lane| lane.toJson() ;}\n json['laneList'] = _laneList ;\n\n return json ;\n end",
"title": ""
},
{
"docid": "fee4fa11e67f3f239d5f2429a15f52bb",
"score": "0.6592221",
"text": "def to_json(*a)\n {\n 'json_class' => self.class.name,\n 'data' => [ @contents ] # Hash can be recomputed\n }.to_json(*a)\n end",
"title": ""
},
{
"docid": "e54e8e6dd677338742d72d760b9d6f2f",
"score": "0.65723264",
"text": "def to_json\n 'Implement Me!'\n end",
"title": ""
},
{
"docid": "f1c774d2f84d7c3f9ba32e1a30bd1d25",
"score": "0.6571423",
"text": "def to_json(*args)\n @json\n end",
"title": ""
},
{
"docid": "b105aef664e9127c5e02b4b4bc51c2c6",
"score": "0.65702075",
"text": "def as_json(*)\n {\n JSON.create_id => self.class.name,\n 'r' => real,\n 'i' => imag,\n }\n end",
"title": ""
},
{
"docid": "55226c1947f9a1dc59de56be6e2db821",
"score": "0.6568351",
"text": "def to_json_raw_object\n {\n JSON.create_id => self.class.name,\n 'raw' => self.unpack('C*'),\n }\n end",
"title": ""
},
{
"docid": "55226c1947f9a1dc59de56be6e2db821",
"score": "0.6568351",
"text": "def to_json_raw_object\n {\n JSON.create_id => self.class.name,\n 'raw' => self.unpack('C*'),\n }\n end",
"title": ""
},
{
"docid": "55226c1947f9a1dc59de56be6e2db821",
"score": "0.6568351",
"text": "def to_json_raw_object\n {\n JSON.create_id => self.class.name,\n 'raw' => self.unpack('C*'),\n }\n end",
"title": ""
},
{
"docid": "55226c1947f9a1dc59de56be6e2db821",
"score": "0.656743",
"text": "def to_json_raw_object\n {\n JSON.create_id => self.class.name,\n 'raw' => self.unpack('C*'),\n }\n end",
"title": ""
},
{
"docid": "9037fd8626ac5821842fe2126c6ecf51",
"score": "0.65638757",
"text": "def write_json(object)\n write object.to_json\n end",
"title": ""
},
{
"docid": "46aad671ff3a787523a301cedd7e046e",
"score": "0.65592235",
"text": "def toJson()\n _obj = { :nPickUp => @nPickUp,\n :nDropOff => @nDropOff,\n :probSingular => @probSingular,\n :weightFactored => @weightFactored,\n :sumDiagProb => @sumDiagProb,\n :probPickUp => @probPickUp,\n :probDropOff => @probDropOff,\n :singularList => @singularList } ;\n return _obj ;\n end",
"title": ""
},
{
"docid": "ec717f71d64cd7639c8073d8f17896d5",
"score": "0.6554146",
"text": "def gen_json\n JSON.pretty_generate(@output)\n end",
"title": ""
},
{
"docid": "5c968465bcc4ac952472a2cd45d5453f",
"score": "0.6550084",
"text": "def to_json\n JSON.fast_generate(to_hash)\n end",
"title": ""
},
{
"docid": "b49e3fa408af1352856cfb7830b5f6a4",
"score": "0.654739",
"text": "def to_json(*a)\n {\n 'json_class' => self.class.name,\n 'data' => self.to_h\n }.to_json(*a)\n end",
"title": ""
},
{
"docid": "aa7b0a7fe652e1a5775acb2b476716e2",
"score": "0.6540017",
"text": "def to_json\n raise \"Not yet implemented.\"\n end",
"title": ""
},
{
"docid": "56fd182118701c0d63e6e205dd73266f",
"score": "0.65350425",
"text": "def to_json\n # TODO: setup the hash with all instance vairables to serialize into json\n { number: number, expiration_date: expiration_date, owner: owner, credit_network: credit_network }.to_json\n end",
"title": ""
},
{
"docid": "9675f3b79f70c6e100c8d3204b074ca5",
"score": "0.6527535",
"text": "def to_json(*args)\n \n {:id => id, :description => description, :view_style => view_style}.to_json\n \n end",
"title": ""
},
{
"docid": "03e72c3a0d794965519e3a14e85a400e",
"score": "0.6525396",
"text": "def to_json(*a)\n { JSON.create_id => self.class.name, \"str\" => self.to_s }.to_json(*a)\n end",
"title": ""
},
{
"docid": "80ec1773ca4c7aef48a008293aa5290c",
"score": "0.6515309",
"text": "def to_json\n ActiveSupport::JSON.encode(self.to_hash)\n end",
"title": ""
},
{
"docid": "06fa7195b090da619c2ba202f9d2db24",
"score": "0.64948976",
"text": "def json_encoder; end",
"title": ""
},
{
"docid": "06fa7195b090da619c2ba202f9d2db24",
"score": "0.64948976",
"text": "def json_encoder; end",
"title": ""
},
{
"docid": "06fa7195b090da619c2ba202f9d2db24",
"score": "0.64948976",
"text": "def json_encoder; end",
"title": ""
},
{
"docid": "1f553f8638c7e59afc7fd7555da1d0bb",
"score": "0.6491222",
"text": "def to_json\n JSON.generate(to_h)\n end",
"title": ""
},
{
"docid": "1f553f8638c7e59afc7fd7555da1d0bb",
"score": "0.6491222",
"text": "def to_json\n JSON.generate(to_h)\n end",
"title": ""
},
{
"docid": "1f553f8638c7e59afc7fd7555da1d0bb",
"score": "0.6491222",
"text": "def to_json\n JSON.generate(to_h)\n end",
"title": ""
},
{
"docid": "1c0f2ab9c867e34fdb102a2ceed2c0d0",
"score": "0.64906687",
"text": "def gen_json\n return JSON.pretty_generate(@output)\n end",
"title": ""
},
{
"docid": "fcbaa97c5872ae1fe6459aef3a96d79e",
"score": "0.64881444",
"text": "def to_json\n self.to_h.to_json\n end",
"title": ""
},
{
"docid": "2886c4b15d5f50afdf15ec680fcc0adb",
"score": "0.64870363",
"text": "def to_json\n renderer.render_to_string template: template_name, handler: :jbuilder\n end",
"title": ""
},
{
"docid": "6e8c4bc2847fb55f6ed9a251939e06a4",
"score": "0.64869916",
"text": "def json_format\n hash = {}\n hash[\"id\"] = self.id\n hash[\"name\"] = self.name\n hash[\"description\"] = self.description\n hash\n end",
"title": ""
},
{
"docid": "4cdfebd7745fb520a55f09020b37297d",
"score": "0.6486798",
"text": "def to_json()\n\t\t# Note, the to_json handles turning \":path =>\" to string key 'path'\n\t\treturn {\n\t\t\t'basePath' => @basePath,\n\t\t\t'infoList' => @infoList\n\t\t}.to_json\n\tend",
"title": ""
},
{
"docid": "07c4bcc643a7c61cc6a660498aa311b6",
"score": "0.6484181",
"text": "def _json\n ## override to produce json that can be used to initialize corresponding objects in\n ## the editor.\n extra_data\n end",
"title": ""
},
{
"docid": "ad091c545100352a2804599bf4a90fad",
"score": "0.6483654",
"text": "def json()\n process if @data.nil?\n @data.to_json\n end",
"title": ""
},
{
"docid": "2d09ba6f2f8d590e278baaf9ab4247c0",
"score": "0.64780885",
"text": "def to_json(*a)\n output = @data.clone\n output[\"json_class\"] = self.class.name\n output.to_json(*a)\n end",
"title": ""
},
{
"docid": "af92afe3f249d9c5187167fce71c123b",
"score": "0.6455237",
"text": "def to_json\n JSON.generate(to_hash)\n end",
"title": ""
},
{
"docid": "a41cff38fa43903dae1e45522b569e4b",
"score": "0.6449069",
"text": "def to_json\n Oj.dump(to_hash)\n end",
"title": ""
},
{
"docid": "cb2feefa69e8fa3ea3690f5f50d5159e",
"score": "0.64490676",
"text": "def as_json options = nil\n {\n :id => self.id,\n :name => self.name\n }\n end",
"title": ""
},
{
"docid": "cb2feefa69e8fa3ea3690f5f50d5159e",
"score": "0.64490676",
"text": "def as_json options = nil\n {\n :id => self.id,\n :name => self.name\n }\n end",
"title": ""
},
{
"docid": "60d4560f9b71d4b498df0fe8dcd219a0",
"score": "0.64482206",
"text": "def to_json\n output = {}\n output[:name] = self.name\n output[:id] = self.id\n\n output[:nodes] = []\n self.display_nodes.each do |node|\n output[:nodes].push(node.to_json)\n end\n\n output[:connections] = []\n self.display_connections.each do |connection|\n output[:connections].push(connection.to_json)\n end\n return output \n end",
"title": ""
},
{
"docid": "e349c66526255d83a35bcf09f00186fd",
"score": "0.64474493",
"text": "def to_json(*)\n JSON.fast_generate(to_hash)\n end",
"title": ""
},
{
"docid": "600e1241e8f8e9f2d9b64b1f21baafa2",
"score": "0.6447132",
"text": "def generate_json\n models = @Models.map { | model| model.to_json}\n json_obj = {models: models, groups: @groups}\n json_obj = JSON.pretty_generate(json_obj)\n File.open(\"config.rb\", 'w') { |file| file.write(json_obj) }\n end",
"title": ""
},
{
"docid": "eb205d972f62dbff314e67fa0e8dc1df",
"score": "0.6444739",
"text": "def to_json\n result = \"\"\n if (!@name.nil? && @name != \"\")\n result << \"#{@name} = \"\n end\n result << \"function(#{build_parameters})\"\n result << \"{#{build_body}}\"\n end",
"title": ""
},
{
"docid": "006e6603eeb0de1dc805ec9fef1503a3",
"score": "0.64416605",
"text": "def to_json\n to_h.to_json\n end",
"title": ""
},
{
"docid": "829a21176938f16fd3ba186f20e41b42",
"score": "0.6440782",
"text": "def to_json\n to_h.to_json\n end",
"title": ""
},
{
"docid": "829a21176938f16fd3ba186f20e41b42",
"score": "0.6440782",
"text": "def to_json\n to_h.to_json\n end",
"title": ""
}
] |
4cf20121d3f76fd4a5b254878bc7037a
|
Execute the given file using the associate app
|
[
{
"docid": "43f5a57b770358b079a8225b230c58c8",
"score": "0.78458637",
"text": "def run( file_name )\n application = select_app( file_name )\n system( \"#{application} #{file_name}\" )\n end",
"title": ""
}
] |
[
{
"docid": "e4aa793ced7f635f21a1c7571a408baf",
"score": "0.7883974",
"text": "def run file_name\n\t\tapplication = select_app file_name\n\t\tsystem \"#{application} #{file_name}\"\n\tend",
"title": ""
},
{
"docid": "1a2c2570bac9b34b9bf226709fef1cde",
"score": "0.78704983",
"text": "def run file_name\n application = select_app file_name\n system \"#{application} #{file_name}\"\n end",
"title": ""
},
{
"docid": "1a2c2570bac9b34b9bf226709fef1cde",
"score": "0.78704983",
"text": "def run file_name\n application = select_app file_name\n system \"#{application} #{file_name}\"\n end",
"title": ""
},
{
"docid": "02f2c0b9e9e6fd8c2a61ec6dc8cbaf0b",
"score": "0.77917683",
"text": "def run file_name \n application = select_app file_name \n system \"#{application} #{file_name}\" \n end",
"title": ""
},
{
"docid": "74128bf6f664e8efcbe2addbd6c3a2d4",
"score": "0.7768747",
"text": "def run(file_name)\n application = select_app(file_name)\n system \"#{application} #{file_name}\"\n end",
"title": ""
},
{
"docid": "af796027bd066371ce17e9aab3cbaca3",
"score": "0.77378714",
"text": "def run file_name \n\t\tapplication = select_app file_name \n\t\tsystem \"#{application} #{file_name}\" \n\tend",
"title": ""
},
{
"docid": "a3aa6036f6399bbff1ca3ace1754fa70",
"score": "0.76239985",
"text": "def exec_file(file)\n exec \"#{file}\"\n end",
"title": ""
},
{
"docid": "15a2f01477c3dcc6beebc76a82542d48",
"score": "0.7513853",
"text": "def execute_file( filename )\n text = File.read(filename)\n execute(text)\n end",
"title": ""
},
{
"docid": "3dc9e0fd023aca6772f463d00989c333",
"score": "0.7030451",
"text": "def execute_file(full_path, args)\n if File.extname(full_path) == '.rb'\n Rex::Script::Shell.new(self, full_path).run(args)\n else\n load_resource(full_path)\n end\n end",
"title": ""
},
{
"docid": "48d530f9a63c5f457d381f3d8f1fd40e",
"score": "0.67092305",
"text": "def execute_script(file)\n abspath = ::File.expand_path(file,@pwd.full_path)\n execute(Rush::File.new(abspath).contents)\n end",
"title": ""
},
{
"docid": "d8bab01926897dd2839d4f242c7ca5f1",
"score": "0.66771096",
"text": "def run file, args = nil \n handler(file).run file, args\n end",
"title": ""
},
{
"docid": "e42afb58079b73d93f6edb30b00bb7dc",
"score": "0.6461422",
"text": "def exec_file(file)\n\t\t\tcurrent_dir = @variables['__DIR__' ]\n\t\t\tcurrent_file = @variables['__FILE__']\n\t\t\tcurrent_line = @variables['__LINE__']\n\n\t\t\t@parser.parse(file) do |action, args, text, file, line|\n\t\t\t\t@variables['__DIR__'] = File.absolute_path(File.dirname(file))\n\t\t\t\t@variables['__FILE__'] = file\n\t\t\t\t@variables['__LINE__'] = line\n\t\t\t\tbreak if exec_parsed_action(action, args, true, text) == :break\n\t\t\tend\n\n\t\t\t@variables['__DIR__' ] = current_dir\n\t\t\t@variables['__FILE__'] = current_file\n\t\t\t@variables['__LINE__'] = current_line\n\t\tend",
"title": ""
},
{
"docid": "e9c1db89562649f6fd4a1cf44bff1838",
"score": "0.6427964",
"text": "def run(file, args = nil)\n handler(file).run file, args\n end",
"title": ""
},
{
"docid": "d3a2090e3efddbcd69b0585ad232dbbb",
"score": "0.64214337",
"text": "def execute_file(full_path, args)\n\t\to = Rex::Script::MetaSSH.new(self, full_path)\n\t\to.run(args)\n\tend",
"title": ""
},
{
"docid": "9af59a60faa2c2d29aab834f7840f90d",
"score": "0.6406524",
"text": "def run(filename, options) end",
"title": ""
},
{
"docid": "b71d252482a0c25763b0314b676cffe3",
"score": "0.6297119",
"text": "def run(file, cmd, *args)\n env = Environment.load(source: file)\n exec env, cmd, *args\n end",
"title": ""
},
{
"docid": "682700bb094a9215dadfc9d115efbd2d",
"score": "0.6280545",
"text": "def play_file(file)\n system(\"afplay #{file}\")\n end",
"title": ""
},
{
"docid": "682700bb094a9215dadfc9d115efbd2d",
"score": "0.6280545",
"text": "def play_file(file)\n system(\"afplay #{file}\")\n end",
"title": ""
},
{
"docid": "6f1421443b837261f5cc9c0baed585f9",
"score": "0.62392694",
"text": "def perform(filepath)\n\n end",
"title": ""
},
{
"docid": "1b9d1449a3548b4e37427d374d1e74e4",
"score": "0.61708254",
"text": "def run(file, line)\n system *command_for(file, line)\n end",
"title": ""
},
{
"docid": "db062828f0dcd267fdce5326b0b03ca4",
"score": "0.59848726",
"text": "def execute_app(app)\n load app\n end",
"title": ""
},
{
"docid": "1c80caf7d67e492d22da32b4c98cc650",
"score": "0.5943293",
"text": "def load(file)\n path = expand_path(file)\n runtime.run(path) if path\n end",
"title": ""
},
{
"docid": "df07f361af7487904470d6240e5784af",
"score": "0.59359366",
"text": "def execute(file)\n check_args!(file)\n\n resolve_uploader.upload(file)\n end",
"title": ""
},
{
"docid": "d4febe7f0d63b1ccf44596f886e0ceb6",
"score": "0.58884066",
"text": "def run\n if @options['file']\n execute_script @options['file']\n elsif @options['command']\n execute @options['command']\n else\n interactive_shell\n puts \n end\n end",
"title": ""
},
{
"docid": "7bd8b2334feb24636f4d0545e4584ea9",
"score": "0.58818674",
"text": "def run_rc_file(rc_file); end",
"title": ""
},
{
"docid": "1280b82220b28e81decff8c52e64d073",
"score": "0.57941246",
"text": "def eval_file(file)\n file = File.join(__dir__, file)\n eval(File.read(file), nil, file) # rubocop:disable Security/Eval\nend",
"title": ""
},
{
"docid": "c250f6a676b88b5f3acbb33aa8f56255",
"score": "0.57757014",
"text": "def eval_file; end",
"title": ""
},
{
"docid": "2d76abc159ed672ac15aaa3d5f1cceab",
"score": "0.576167",
"text": "def run_file(in_file, root)\n root.accept(self)\n end",
"title": ""
},
{
"docid": "c631ae9f19d50c1c5fefa68b24543e10",
"score": "0.5758337",
"text": "def run_script(file, out = STDOUT)\n raise NotImplementedException.new \"Debugger.run_script not implemented\"\n end",
"title": ""
},
{
"docid": "d2ed16f2f700f32933f1b9097f640c8e",
"score": "0.57067746",
"text": "def run_script(file, out = handler.interface, verbose=false)\n interface = ScriptInterface.new(File.expand_path(file), out)\n processor = ControlCommandProcessor.new(interface)\n processor.process_commands(verbose)\n end",
"title": ""
},
{
"docid": "d2ed16f2f700f32933f1b9097f640c8e",
"score": "0.57067746",
"text": "def run_script(file, out = handler.interface, verbose=false)\n interface = ScriptInterface.new(File.expand_path(file), out)\n processor = ControlCommandProcessor.new(interface)\n processor.process_commands(verbose)\n end",
"title": ""
},
{
"docid": "d2ed16f2f700f32933f1b9097f640c8e",
"score": "0.57067746",
"text": "def run_script(file, out = handler.interface, verbose=false)\n interface = ScriptInterface.new(File.expand_path(file), out)\n processor = ControlCommandProcessor.new(interface)\n processor.process_commands(verbose)\n end",
"title": ""
},
{
"docid": "2469478bd34cfafe49a5c91327c99fe9",
"score": "0.5691945",
"text": "def play_file(file)\n system(\"ogg123 #{file}\")\n end",
"title": ""
},
{
"docid": "33edf9013df436bc59e554345006f512",
"score": "0.5669537",
"text": "def run_local_story(filename, options={})\n run File.join(File.dirname(__FILE__), filename), options\nend",
"title": ""
},
{
"docid": "23fbfc491cd6bbc363ddd494a15e9b3a",
"score": "0.56620157",
"text": "def run_script(file=nil)\n\tif file == nil\n\t\tfile = $screen.ask(\"run script file: \",[\"\"],false,true)\n\t\tif (file==nil) || (file==\"\")\n\t\t\t$screen.write_message(\"cancelled\")\n\t\t\treturn\n\t\tend\n\tend\n\tif File.directory?(file)\n\t\tlist = Dir.glob(file+\"/*.rb\")\n\t\tlist.each{|f|\n\t\t\tscript = File.read(f)\n\t\t\teval(script)\n\t\t\tif $screen != nil\n\t\t\t\t$screen.write_message(\"done\")\n\t\t\tend\n\t\t}\n\telsif File.exist?(file)\n\t\tscript = File.read(file)\n\t\teval(script)\n\t\tif $screen != nil\n\t\t\t$screen.write_message(\"done\")\n\t\tend\n\telse\n\t\tputs \"Script file #{file} doesn't exist.\"\n\t\tputs \"Press any key to continue anyway.\"\n\t\tSTDIN.getc\n\tend\nrescue\n\tif $screen != nil\n\t\t$screen.write_message(\"Bad script\")\n\telse\n\t\tputs \"Bad script file: #{file}\"\n\t\tputs \"Press any key to continue anyway.\"\n\t\tSTDIN.getc\n\tend\nend",
"title": ""
},
{
"docid": "b7dff8d6a08dbae338527b1556e06cb2",
"score": "0.56619287",
"text": "def run\n src = ARGF.read\n exit 2 unless src\n\n interpreter = Expectr::Interpreter.new(src.untaint)\n interpreter.filename = $FILENAME\n interpreter.run\n end",
"title": ""
},
{
"docid": "952fb2578e0ea6262dd4e13a7301ec3f",
"score": "0.5603809",
"text": "def run(requester_file, argv)\n unsecure_run(requester_file, argv)\n rescue Exception => ex\n environment.on_error(self, ex)\n environment\n end",
"title": ""
},
{
"docid": "18a4ac14ae712ebca1cf1e8b2cc71b5f",
"score": "0.5596976",
"text": "def exec\n path = File.join(options[:bin_path], 'response')\n `#{path} pathfile=#{options[:pathfile]} message=#{message}`\n end",
"title": ""
},
{
"docid": "1004b8ef833c9bc9d8d6fa459f55e96e",
"score": "0.55946755",
"text": "def run_with_admin_privileges(file, *args)\n require 'win32ole'\n shell = WIN32OLE.new('Shell.Application')\n shell.ShellExecute('ruby', \"#{file} #{args.join(' ')}\", nil, 'runas', 1)\n end",
"title": ""
},
{
"docid": "e4e26d28376d654e3d5632c5f2b7ecac",
"score": "0.55762327",
"text": "def exe(*args)\r\n app.exe(self, args)\r\n end",
"title": ""
},
{
"docid": "ff0aeedb3208b58455f51f17391543dd",
"score": "0.5568431",
"text": "def run_from_file_command(command)\n if logger.debug?\n debug(\"Creating exec script for #{instance_name} (#{exec_script_file})\")\n debug(\"Executing #{exec_script_file}\")\n end\n File.open(exec_script_file, \"wb\") { |file| file.write(command) }\n %{powershell -file \"#{exec_script_file}\"}\n end",
"title": ""
},
{
"docid": "d58216ec0b27484123ef6aee03ba94bc",
"score": "0.55608875",
"text": "def play_file(file)\n\t\tsystem(\"afplay #{file}\") #switching ogg123 to afplay\n\tend",
"title": ""
},
{
"docid": "463fe6a6eeecd31221e9bb0eaeae7a15",
"score": "0.5549168",
"text": "def open_document(filename)\n case RUBY_PLATFORM\n when /darwin/\n system(\"open\", filename)\n when /linux/\n system(\"xdg-open\", filename)\n when /windows/\n system(\"cmd\", \"/c\", \"\\\"start #{filename}\\\"\")\n else\n Output.warning(:dont_know_how_to_open_resume)\n end\n end",
"title": ""
},
{
"docid": "d4f84d0d7b4a94d5e28969607bc894d5",
"score": "0.553771",
"text": "def load_file(file_path)\n\t\t\tcode = File.open(file_path) { |f| f.read }\n\t\t\trun(code)\n\t\tend",
"title": ""
},
{
"docid": "2805fc05fdca4ed81c14f00738c61fdd",
"score": "0.5532671",
"text": "def interpret\n eval File.read(@path), binding\n nil\n end",
"title": ""
},
{
"docid": "c2f19d21dc6618324e2c34f5373e17b0",
"score": "0.5526844",
"text": "def file(filename) File.read(File.absolute_path(filename, File.dirname($PROGRAM_NAME))) end",
"title": ""
},
{
"docid": "dd6391799db59d7752604029d23bc8f6",
"score": "0.5523489",
"text": "def run\r\n return puts(\"usage example: glimmer run tictactoe\") unless @name\r\n # Search for the filename (and add the .rb extension if not provided), and run it\r\n if File.exist?(\"#{@name}#{'.rb' unless @name =~ /.rb$/}\")\r\n command = \"#{JRUBY_COMMAND} \\\"#{@name.gsub(/\\\\/, '/')}#{'.rb' unless @name =~ /.rb$/}\\\"\"\r\n else\r\n # Search for all installed samples and try to run of those\r\n command = \"#{JRUBY_COMMAND} \\\"#{SAMPLES_PATH}/#{fetch_app(@name)}.rb\\\"\"\r\n end\r\n puts \"Starting the application with following command:\"\r\n puts command\r\n system command\r\n end",
"title": ""
},
{
"docid": "3f65eda37797d64d5d290c07bfba6237",
"score": "0.5520294",
"text": "def execute_app(app)\n $LOAD_PATH.unshift(Dir.pwd)\n Shoes.configuration.backend = :swt\n load app\n end",
"title": ""
},
{
"docid": "c07275e87a8709927a042e34ab5e012e",
"score": "0.5519505",
"text": "def execute_script(file_name, conn, keys, argv)\n conn.evalsha(\n script_sha(conn, file_name),\n keys,\n argv,\n )\n end",
"title": ""
},
{
"docid": "cb748bf1098bf177742bcb950ac5e7ad",
"score": "0.55129695",
"text": "def script(script_file)\n load script_file\n\n self\n end",
"title": ""
},
{
"docid": "e12304c8c54a8932647926a3690e0be5",
"score": "0.5510229",
"text": "def command_file prompt, *command\n pauseyn = command.shift\n command = command.join \" \"\n print \"[#{prompt}] Choose a file [#{$view[$cursor]}]: \"\n file = ask_hint $view[$cursor]\n #print \"#{prompt} :: Enter file shortcut: \"\n #file = ask_hint\n perror \"Command Cancelled\" unless file\n return unless file\n file = File.expand_path(file)\n if File.exists? file\n file = Shellwords.escape(file)\n pbold \"#{command} #{file} (#{pauseyn})\"\n system \"#{command} #{file}\"\n pause if pauseyn == \"y\"\n refresh\n else\n perror \"File #{file} not found\"\n end\nend",
"title": ""
},
{
"docid": "e80de354942db3cb06aece8896707a7e",
"score": "0.5505302",
"text": "def visit(file)\n @path ||= 'Safari.app'\n `open #{file} -a #{@path} -g`\n end",
"title": ""
},
{
"docid": "ce9c94406f357d72b06e583077d4fd5d",
"score": "0.5496876",
"text": "def use arg\n if arg.is_a? Symbol\n begin\n dirname = File.expand_path(File.dirname(self.__options[:recipe_file]))\n instance_eval File.read(\"#{dirname}/#{arg.to_s}.rb\")\n rescue Errno::ENOENT => e\n raise Screwcap::IncludeFileNotFound, \"Could not find #{File.expand_path(\"./\"+arg.to_s + \".rb\")}! If the file is elsewhere, call it by using 'use '/path/to/file.rb'\"\n end\n else\n begin\n instance_eval(File.read(arg))\n rescue Errno::ENOENT => e\n raise Screwcap::IncludeFileNotFound, \"Could not find #{File.expand_path(arg)}! If the file is elsewhere, call it by using 'use '/path/to/file.rb'\"\n end\n end\n end",
"title": ""
},
{
"docid": "9d7a0df535de3884c18010d429750375",
"score": "0.5481192",
"text": "def playback file, &block\n application \"playback\", file, &block\n end",
"title": ""
},
{
"docid": "0fa79d7571b895cd8162479b25098c28",
"score": "0.54719764",
"text": "def load_file(file_path)\n\t\t\tcode = File.open(file_path) { |f| f.read }\n\t\t\t@interpreter.run(code)\n\t\tend",
"title": ""
},
{
"docid": "f50722a856faefaa84d105c64734c83d",
"score": "0.5453806",
"text": "def run_android(test_file = nil)\n wait_for_valid_device\n cmd = 'bundle exec ruby ./lib/run.rb android'\n cmd = %(#{cmd} \"#{test_file}\") if test_file\n bash cmd\nend",
"title": ""
},
{
"docid": "a4c7216a5cb7875708f85b48d9db7bda",
"score": "0.5449136",
"text": "def air file\n jslib = normalize(\"lib\")\n if !File.exist?(jslib)\n begin \n puts \"Can't find #{jslib} necessary for Adobe AIR adl execution.\"\n\t\t print \"Would you like to (c)opy or (s)ymlink or (a)bort? (c/s/a): \" \n c = STDIN.gets.chomp.downcase\n end while ![\"c\", \"s\", \"a\"].include? c\n\n case c\n when \"c\" \n vendorize_with_copy\n when \"s\"\n vendorize_with_symlink\n when \"a\"\n exit\n end\n end\n system \"adl #{file}\"\n end",
"title": ""
},
{
"docid": "466ed0174c675ef084f06c50c439a810",
"score": "0.54482335",
"text": "def file(*args, &block)\n Rake::FileTask.define_task(*args, &block)\n end",
"title": ""
},
{
"docid": "e46e488e799358fab4748c5c02f84a41",
"score": "0.5438216",
"text": "def loadFile _args\n \"loadFile _args;\" \n end",
"title": ""
},
{
"docid": "8c4f4a1de119d31ff80abf60e84fce1a",
"score": "0.5434709",
"text": "def open\n\t \texec 'open '+@params[0]\n\t end",
"title": ""
},
{
"docid": "17c58a0b4f29f6580364691c0463accb",
"score": "0.5434181",
"text": "def run_sketch\n ensure_exists(filename)\n spin_up('run.rb', filename, argc)\n end",
"title": ""
},
{
"docid": "17c58a0b4f29f6580364691c0463accb",
"score": "0.5434181",
"text": "def run_sketch\n ensure_exists(filename)\n spin_up('run.rb', filename, argc)\n end",
"title": ""
},
{
"docid": "6d286d70eabfb34c783338a8c230f905",
"score": "0.5433793",
"text": "def rhino file\n system \"java -jar #{rhino_jar} -opt -1 #{file}\"\n end",
"title": ""
},
{
"docid": "be0626d421a5f7a71b57def503f8bee2",
"score": "0.5433491",
"text": "def load_script(file); end",
"title": ""
},
{
"docid": "4e9945bf27835ec54db640d2800c5466",
"score": "0.541924",
"text": "def exec; end",
"title": ""
},
{
"docid": "4e9945bf27835ec54db640d2800c5466",
"score": "0.541924",
"text": "def exec; end",
"title": ""
},
{
"docid": "50a81ed0bc664dfda16798284e55266a",
"score": "0.5409095",
"text": "def run(args)\n case args.size\n when 1\n if @proc.frame\n file = @proc.frame.source_container[1]\n line = @proc.frame.source_location[0]\n else\n errmsg(\"No Ruby program loaded.\")\n return\n end\n when 2\n line = Integer(args[1]) rescue nil\n if line\n if @proc.frame\n file = @proc.frame.source_container[1]\n else\n errmsg(\"No Ruby program loaded.\")\n return\n end\n else\n file = args[1]\n line = 1\n end\n when 3\n line, file = args[2], args[1]\n else\n errmsg \"edit needs at most 2 args.\"\n end\n editor = ENV['EDITOR'] || '/bin/ex'\n unless File.executable?(editor)\n errmsg \"Editor #{editor} is not executable. Trying anyway...\"\n end\n\n if File.readable?(file)\n file = File.basename(file) if settings[:basename]\n edit_cmd = \"#{editor} +#{line} \\\"#{file}\\\"\"\n msg \"Running #{edit_cmd}...\"\n system(edit_cmd)\n msg \"Warning: return code was #{$?.exitstatus}\" if $?.exitstatus != 0\n else\n errmsg \"File \\\"#{file}\\\" is not readable.\"\n end\n end",
"title": ""
},
{
"docid": "f28f9043ad6b552416cedd06a4531dde",
"score": "0.54047155",
"text": "def command_file prompt, *command\n pauseyn = command.shift\n command = command.join \" \"\n #print \"[#{prompt}] Choose a file [#{$view[$cursor]}]: \"\n t = \"[#{prompt}] Choose a file [#{$view[$cursor]}]: \"\n file = ask_hint t, $view[$cursor]\n #print \"#{prompt} :: Enter file shortcut: \"\n #file = ask_hint\n perror \"Command Cancelled\" unless file\n return unless file\n file = File.expand_path(file)\n if File.exists? file\n file = Shellwords.escape(file)\n pbold \"#{command} #{file} (press a key)\"\n c_system \"#{command} #{file}\"\n pause if pauseyn == \"y\"\n c_refresh\n else\n perror \"File #{file} not found\"\n end\nend",
"title": ""
},
{
"docid": "5f56de3caaf4a6cc13e9c4fdad890924",
"score": "0.53974587",
"text": "def load_file\n fc = JFileChooser.new\n fc.setDialogTitle(\"Choose Ruby Script File\")\n if fc.showOpenDialog(@frame) == JFileChooser::APPROVE_OPTION\n @ruby_main.file fc.getSelectedFile.absolute_path\n else\n STDERR.puts \"Unrecognized Ruby Script File\"\n end\n end",
"title": ""
},
{
"docid": "91d44efa62e0c7b013198245b1edc668",
"score": "0.53947306",
"text": "def call_script(file_name, *args)\n conn, keys, argv = extract_args(*args)\n return do_call(file_name, conn, keys, argv) if conn\n\n pool = defined?(redis_pool) ? redis_pool : nil\n\n redis(pool) do |new_conn|\n result = do_call(file_name, new_conn, keys, argv)\n yield result if block_given?\n result\n end\n end",
"title": ""
},
{
"docid": "5975af483a382657fd7fd1852172f01b",
"score": "0.5394329",
"text": "def run(path)\n if File.exist? path\n puts(path) ; system(\"ruby \" + path) \n end\nend",
"title": ""
},
{
"docid": "80e935a2ef7745a2075b8ac64ea66ec8",
"score": "0.53923786",
"text": "def spawn\n\t\t\tputs \"loading ruby script: #{@exec}\"\n\t\t\tdaemonize('load') do |command|\n\t\t\t\tcmd = Shellwords.split(command)\n\t\t\t\tfile = cmd.shift\n\n\t\t\t\t# reset ARGV\n\t\t\t\tObject.instance_eval{ remove_const(:ARGV) }\n\t\t\t\tObject.const_set(:ARGV, cmd)\n\n\t\t\t\t# reset $0\n\t\t\t\t$0 = file\n\n\t\t\t\t# reset $*\n\t\t\t\t$*.replace(cmd)\n\n\t\t\t\tload file\n\n\t\t\t\t# make sure we exit if loaded file won't\n\t\t\t\texit 0\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "64db0d1f6cbd998fb603c24b2e4efc22",
"score": "0.5390326",
"text": "def from_file path\n run File.read(path) if File.exists? path\n end",
"title": ""
},
{
"docid": "fcea9b0c31fc7b1b8ad844706d707497",
"score": "0.5385664",
"text": "def send_file_to_server(file)\n opener = FileManager.new(file)\n flag, content = opener.open_file\n if flag\n answer = execute_rpc_call(content)\n return parse_answer(answer, file)\n else\n return \"Can't open file #{file}\"\n end\n end",
"title": ""
},
{
"docid": "7822d716af183f8a4eb4d56178dd94a6",
"score": "0.5362803",
"text": "def play_file(file_path)\n @ole.PlayFile(file_path)\n end",
"title": ""
},
{
"docid": "a5315b64e0c9e9ce36bff81209cb1e08",
"score": "0.53605807",
"text": "def run\n if @files.empty?\n @commander.Process(STDIN)\n else\n @files.each do |filename|\n File.open(filename) { |f| @commander.Process(f) }\n end \n end\n end",
"title": ""
},
{
"docid": "110324d06fc4edca0f034608ede7e252",
"score": "0.5348435",
"text": "def exec_local(filename1, filename2 = nil)\n @command = [ @program, filename1, (filename2 or @database), *@option ]\n @output = nil\n @log = nil\n @report = nil\n Open3.popen3(*@command) do |din, dout, derr|\n din.close\n derr.sync = true\n t = Thread.start { @log = derr.read }\n begin\n @output = dout.read\n @report = Bio::Sim4::Report.new(@output)\n ensure\n t.join\n end\n end\n @report\n end",
"title": ""
},
{
"docid": "89fc86a924a415f2a7bca58149b3c33d",
"score": "0.53409916",
"text": "def click_run_file_dialog_popup(title)\n click_button_popup(title, \"&Run\")\nend",
"title": ""
},
{
"docid": "686fd0dae25977e91ddbc5b55168ead2",
"score": "0.5340094",
"text": "def command_file prompt, *command\n pauseyn = command.shift\n command = command.join ' '\n clear_last_line\n print \"[#{prompt}] Choose a file [#{@view[@cursor]}]: \"\n file = ask_hint @view[@cursor]\n # print \"#{prompt} :: Enter file shortcut: \"\n # file = ask_hint\n perror 'Command Cancelled' unless file\n return unless file\n\n file = expand_path(file)\n if File.exist? file\n file = Shellwords.escape(file)\n pbold \"#{command} #{file} (#{pauseyn})\"\n system \"#{command} #{file}\"\n setup_terminal\n pause if pauseyn == 'y'\n refresh\n else\n perror \"File #{file} not found\"\n end\nend",
"title": ""
},
{
"docid": "fd9d51ce9e97c26d7eb7c626e784958a",
"score": "0.53366894",
"text": "def test_cmd_appid_run_file\n File.delete(\"app_id_status.json\") if File.exists?(\"app_id_status.json\")\n app = Mu::Command::Cmd_appid.new\n args = Array.new\n args << \"-s\"\n args << \"#{Dir.pwd}/test/data/data_cgi.msl\"\n args << \"-i\"\n args << \"b1-10000,b2\"\n args << \"-p\"\n args << \"1-100:10\"\n app.cmd_run_file args\n assert(File.exists?(\"app_id_status.json\"), \"app_id_status.json file was not created\")\n j = JSON File.read(\"app_id_status.json\")\n status = j[\"status\"]\n assert(status[\"statistics\"][\"summary\"][\"duration\"].to_f >= 10.0, \"expected summary duration > 10, but got #{status[\"statistics\"][\"summary\"][\"duration\"]}\")\n assert(status[\"statistics\"][\"summary\"][\"instances\"][\"executed\"].to_i > 10, \"expected instances executed > 0, but got #{status[\"statistics\"][\"summary\"][\"instances\"][\"executed\"]}\")\n end",
"title": ""
},
{
"docid": "b5095e03336558356a7e23adb2c2b551",
"score": "0.5329671",
"text": "def run_file(filename, preloading = false)\n begin\n result = RSpec::Core::CommandLine.new([\"-f\", \"p\", filename]).run(io, io)\n rescue LoadError => e\n io << \"\\nCould not load file #{filename}: #{e.message}\\n\\n\"\n result = 1\n rescue Exception => e\n io << \"Exception when running #{filename}: #{e.message}\"\n io << e.backtrace[0..7].join(\"\\n\")\n result = 1\n end\n\n if preloading\n puts io.string\n else\n channel.write(\"command\" => \"result\", \"filename\" => filename, \"return_code\" => result.to_i, \"text\" => io.string, \"worker_number\" => worker_number)\n end\n end",
"title": ""
},
{
"docid": "6b90846546a84ad51b36a2545826ac40",
"score": "0.531943",
"text": "def eval_script filename, arguments\n proc = Proc.new {}\n eval(File.read(filename), proc.binding, filename)\nend",
"title": ""
},
{
"docid": "c27ba83e8acd9debb47626555a1ef500",
"score": "0.53170836",
"text": "def execute(args)\n # Analyze arguments\n remaining_args = @options.parse(args)\n if @display_help\n puts @options\n elsif (remaining_args.size > 2)\n puts 'Please specify just 1 file to be loaded on startup.'\n puts @options\n else\n activate_log_debug(true) if @debug\n log_info 'Loading GUI libraries...'\n require 'gtk2'\n Gdk::Threads.init\n require 'ruby-serial'\n require 'filesrebuilder/Model/Data'\n require 'filesrebuilder/GUIFactory'\n require 'filesrebuilder/GUIcontroller'\n require 'filesrebuilder/_Gtk/_object'\n require 'rUtilAnts/Platform'\n RUtilAnts::Platform::install_platform_on_object\n gui_factory = GUIFactory.new\n gui_controller = GUIController.new(gui_factory)\n gui_factory.gui_controller = gui_controller\n Gtk::Settings.default.gtk_button_images = true\n log_info 'Executing application...'\n main_widget = gui_factory.new_widget('Main')\n gui_controller.set_main_widget(main_widget)\n main_widget.show\n gui_controller.run_callback_dirline_progress_bars\n gui_controller.load_from_file(remaining_args[0]) if (remaining_args.size == 1)\n Gtk.main\n log_info 'Quitting application...'\n end\n end",
"title": ""
},
{
"docid": "9c168f88c9122f6b40c3451f40f7bc4d",
"score": "0.5295245",
"text": "def get_file_executable(dir_run_programs, opts = {})\n BawWorkers::Validation.check_custom_hash(opts, BawWorkers::Jobs::Analysis::Payload::OPTS_FIELDS)\n\n file_executable_relative = opts[:file_executable]\n BawWorkers::Validation.normalise_path(file_executable_relative, dir_run_programs)\n end",
"title": ""
},
{
"docid": "4d213368d7edc0ae6e186206d5056266",
"score": "0.52941686",
"text": "def run_task_from_file\n result = nil\n task = nil\n log.info \"Start Worker run for file #{@file}\"\n task = JSON.parse(IO.read(@file))\n\n # While provisioning, don't allow the provisioner to terminate by disabling signal\n sigterm = Coopr::Worker::SignalHandler.new('TERM')\n sigterm.dont_interupt do\n result = delegate_task(task)\n end\n rescue StandardError => e\n log.error \"Caught exception when running task from file #{@file}\"\n\n result = {} if result.nil? == true\n result['status'] = '1'\n # Check if it's an ssh_exec exception for additional logging info\n if e.class.name == 'CommandExecutionError'\n log.error \"#{e.class.name}: #{e.to_json}\"\n result['stdout'] = e.stdout\n result['stderr'] = e.stderr\n else\n result['stdout'] = e.inspect\n result['stderr'] = \"#{e.inspect}\\n#{e.backtrace.join(\"\\n\")}\"\n end\n log.error \"Worker run failed, result: #{result}\"\n end",
"title": ""
},
{
"docid": "9c1b0f16765f1cce6fef41046ae915ce",
"score": "0.5293092",
"text": "def run(config_file)\n load_options_from_file(config_file)\n check_options\n output = %x[ #{@binary} #{config_file} ]\n output\n end",
"title": ""
},
{
"docid": "07460739d2fc29ffc88ebd02741f7686",
"score": "0.5290114",
"text": "def execute\n warn 'executing fpm app spec task, but there are no input files [fpm_app_spec::task#execute]' if\n @opts.get(:files).empty?\n\n fpm_package @opts.get(:out), @opts.get(:files)\n end",
"title": ""
},
{
"docid": "71bf7d1a321a5ebc4117ea468d15697d",
"score": "0.5271671",
"text": "def Run222(programPath)\n file = File.open(programPath, \"w+\")\n\t\tfile.puts(\"Yes I am up!\")\n\t\tfile.close()\n end",
"title": ""
},
{
"docid": "7adfbea79a1a42971743a18c79e24c36",
"score": "0.5270165",
"text": "def run\n @files.each { |filename| load(filename) }\n end",
"title": ""
},
{
"docid": "7bc32c826646c9f98b3cbb3367af00a4",
"score": "0.5268118",
"text": "def open_output_file(output_file)\n puts \"\\n************************************\"\n puts ' >>> Only will work on mac <<<'\n puts 'NOW attempting to open created file in Word.'\n cmd = \"open #{output_file}\"\n puts \" will run '#{cmd}'\"\n puts '************************************'\n\n system cmd\n end",
"title": ""
},
{
"docid": "9bc430c0f79e46f7f4ac2f0b08f3cc4f",
"score": "0.5258005",
"text": "def load(filename)\n run \"load #{OptArg.quote(filename)}\"\n nil\n end",
"title": ""
},
{
"docid": "bc47fe31a9376b22afa2ed6f517b5e41",
"score": "0.5253503",
"text": "def do_a_thing\n puts \"We are doing a thing!!!!!!!!!!!!!!!! #{file_name}\"\n end",
"title": ""
},
{
"docid": "01f5fae5cba3743df423661c5d24e3ad",
"score": "0.52475643",
"text": "def launch (raw_exp, workitem)\n\n onotify(:launch, raw_exp.fei, workitem)\n\n apply(raw_exp, workitem)\n end",
"title": ""
},
{
"docid": "3db1ba710371837580d2621b83d41499",
"score": "0.5243501",
"text": "def run(specfile = nil)\n @specfile = specfile\n super\n end",
"title": ""
},
{
"docid": "bc7c0fa3d48881ec676e8f6c618af72b",
"score": "0.52422845",
"text": "def run_android test_file=nil\n wait_for_valid_device\n cmd = 'bundle exec ruby ./appium/run.rb android'\n cmd += %Q( \"#{ test_file }\") if test_file\n bash cmd\nend",
"title": ""
},
{
"docid": "8f76b5967f69770158a3687021faeb99",
"score": "0.5236029",
"text": "def execute *args\n self.executable = :amxmlc\n super\n end",
"title": ""
},
{
"docid": "389623c8be5ec1a804a55f870e96bcbc",
"score": "0.5234845",
"text": "def exec_script_on(script_path_str,arguments_str,current_path_str)\n fname_str = File.basename(script_path_str)\n rempte_path_str = \"/tmp/\" + fname_str\n push_a_file(script_path_str,rempte_path_str)\n exec_on!(\"sh #{rempte_path_str} \" + arguments_str,current_path_str)\n end",
"title": ""
},
{
"docid": "e3f8a30299dfc508e078e6bb1e144fd2",
"score": "0.52343976",
"text": "def act(act, file, *args)\n @actions << Action.for(act, file, *args)\n end",
"title": ""
},
{
"docid": "92699dfec1432b0c19221a9855dc840c",
"score": "0.52084523",
"text": "def open_file_in_editor(index)\n # get the selected filename\n filename=@filtered_files[index]\n\n # launch the vim executable\n task=NSTask.new\n task.setLaunchPath(MAC_VIM_EXECUTABLE)\n task.setArguments(['-g','--remote-tab-silent',filename])\n task.launch\n\n # that's it for ourself, let's go home.\n NSApp.stop(self)\n true\n end",
"title": ""
},
{
"docid": "5bcf2dfae75e9c2a195a8f1385162adc",
"score": "0.5201958",
"text": "def file(*args, &block)\n Rake::FileTask.define_task(*args, &block)\nend",
"title": ""
}
] |
af630984682f1a0b5a68e6092af0d102
|
Update properties of this object
|
[
{
"docid": "d2c8141883047786eb5b80c10e03e62d",
"score": "0.0",
"text": "def update!(**args)\n @blog_data = args[:blog_data] if args.key?(:blog_data)\n @book_citation_data = args[:book_citation_data] if args.key?(:book_citation_data)\n @deprecated_author_obfuscated_gaia = args[:deprecated_author_obfuscated_gaia] if args.key?(:deprecated_author_obfuscated_gaia)\n @deprecated_quarantine_whitelist = args[:deprecated_quarantine_whitelist] if args.key?(:deprecated_quarantine_whitelist)\n @doc_level_spam_score = args[:doc_level_spam_score] if args.key?(:doc_level_spam_score)\n @event = args[:event] if args.key?(:event)\n @gibberish_score = args[:gibberish_score] if args.key?(:gibberish_score)\n @groups_data = args[:groups_data] if args.key?(:groups_data)\n @is_anchor_bayes_spam = args[:is_anchor_bayes_spam] if args.key?(:is_anchor_bayes_spam)\n @keyword_stuffing_score = args[:keyword_stuffing_score] if args.key?(:keyword_stuffing_score)\n @mobile_data = args[:mobile_data] if args.key?(:mobile_data)\n @original_content_score = args[:original_content_score] if args.key?(:original_content_score)\n @premium_data = args[:premium_data] if args.key?(:premium_data)\n @quarantine_info = args[:quarantine_info] if args.key?(:quarantine_info)\n @scaled_expt_indy_rank = args[:scaled_expt_indy_rank] if args.key?(:scaled_expt_indy_rank)\n @scaled_expt_indy_rank2 = args[:scaled_expt_indy_rank2] if args.key?(:scaled_expt_indy_rank2)\n @scaled_expt_indy_rank3 = args[:scaled_expt_indy_rank3] if args.key?(:scaled_expt_indy_rank3)\n @scaled_expt_spam_score_eric = args[:scaled_expt_spam_score_eric] if args.key?(:scaled_expt_spam_score_eric)\n @scaled_expt_spam_score_yoram = args[:scaled_expt_spam_score_yoram] if args.key?(:scaled_expt_spam_score_yoram)\n @scaled_indy_rank = args[:scaled_indy_rank] if args.key?(:scaled_indy_rank)\n @scaled_link_age_spam_score = args[:scaled_link_age_spam_score] if args.key?(:scaled_link_age_spam_score)\n @scaled_spam_score_eric = args[:scaled_spam_score_eric] if args.key?(:scaled_spam_score_eric)\n @scaled_spam_score_yoram = args[:scaled_spam_score_yoram] if args.key?(:scaled_spam_score_yoram)\n @spam_word_score = args[:spam_word_score] if args.key?(:spam_word_score)\n @tag_page_score = args[:tag_page_score] if args.key?(:tag_page_score)\n @tool_bar_data = args[:tool_bar_data] if args.key?(:tool_bar_data)\n @whirlpool_discount = args[:whirlpool_discount] if args.key?(:whirlpool_discount)\n @apps_link = args[:apps_link] if args.key?(:apps_link)\n @asteroid_belt_intents = args[:asteroid_belt_intents] if args.key?(:asteroid_belt_intents)\n @author_obfuscated_gaia_str = args[:author_obfuscated_gaia_str] if args.key?(:author_obfuscated_gaia_str)\n @biasingdata = args[:biasingdata] if args.key?(:biasingdata)\n @biasingdata2 = args[:biasingdata2] if args.key?(:biasingdata2)\n @body_words_to_tokens_ratio_begin = args[:body_words_to_tokens_ratio_begin] if args.key?(:body_words_to_tokens_ratio_begin)\n @body_words_to_tokens_ratio_total = args[:body_words_to_tokens_ratio_total] if args.key?(:body_words_to_tokens_ratio_total)\n @brainloc = args[:brainloc] if args.key?(:brainloc)\n @commercial_score = args[:commercial_score] if args.key?(:commercial_score)\n @compressed_quality_signals = args[:compressed_quality_signals] if args.key?(:compressed_quality_signals)\n @compressed_url = args[:compressed_url] if args.key?(:compressed_url)\n @content_attributions = args[:content_attributions] if args.key?(:content_attributions)\n @country_info = args[:country_info] if args.key?(:country_info)\n @crawl_pagerank = args[:crawl_pagerank] if args.key?(:crawl_pagerank)\n @crawler_id_proto = args[:crawler_id_proto] if args.key?(:crawler_id_proto)\n @crowdingdata = args[:crowdingdata] if args.key?(:crowdingdata)\n @dates_info = args[:dates_info] if args.key?(:dates_info)\n @desktop_interstitials = args[:desktop_interstitials] if args.key?(:desktop_interstitials)\n @domain_age = args[:domain_age] if args.key?(:domain_age)\n @events_date = args[:events_date] if args.key?(:events_date)\n @extra_data = args[:extra_data] if args.key?(:extra_data)\n @firefly_site_signal = args[:firefly_site_signal] if args.key?(:firefly_site_signal)\n @freshbox_article_scores = args[:freshbox_article_scores] if args.key?(:freshbox_article_scores)\n @freshness_encoded_signals = args[:freshness_encoded_signals] if args.key?(:freshness_encoded_signals)\n @fringe_query_prior = args[:fringe_query_prior] if args.key?(:fringe_query_prior)\n @geodata = args[:geodata] if args.key?(:geodata)\n @home_page_info = args[:home_page_info] if args.key?(:home_page_info)\n @homepage_pagerank_ns = args[:homepage_pagerank_ns] if args.key?(:homepage_pagerank_ns)\n @host_age = args[:host_age] if args.key?(:host_age)\n @host_nsr = args[:host_nsr] if args.key?(:host_nsr)\n @imagedata = args[:imagedata] if args.key?(:imagedata)\n @in_newsstand = args[:in_newsstand] if args.key?(:in_newsstand)\n @is_hotdoc = args[:is_hotdoc] if args.key?(:is_hotdoc)\n @kaltixdata = args[:kaltixdata] if args.key?(:kaltixdata)\n @knex_annotation = args[:knex_annotation] if args.key?(:knex_annotation)\n @languages = args[:languages] if args.key?(:languages)\n @last_significant_update = args[:last_significant_update] if args.key?(:last_significant_update)\n @last_significant_update_info = args[:last_significant_update_info] if args.key?(:last_significant_update_info)\n @launch_app_info = args[:launch_app_info] if args.key?(:launch_app_info)\n @live_results_data = args[:live_results_data] if args.key?(:live_results_data)\n @localized_cluster = args[:localized_cluster] if args.key?(:localized_cluster)\n @media_or_people_entities = args[:media_or_people_entities] if args.key?(:media_or_people_entities)\n @noimageframeoverlayreason = args[:noimageframeoverlayreason] if args.key?(:noimageframeoverlayreason)\n @nsr_data_proto = args[:nsr_data_proto] if args.key?(:nsr_data_proto)\n @nsr_is_covid_local_authority = args[:nsr_is_covid_local_authority] if args.key?(:nsr_is_covid_local_authority)\n @nsr_is_election_authority = args[:nsr_is_election_authority] if args.key?(:nsr_is_election_authority)\n @nsr_is_video_focused_site = args[:nsr_is_video_focused_site] if args.key?(:nsr_is_video_focused_site)\n @nsr_sitechunk = args[:nsr_sitechunk] if args.key?(:nsr_sitechunk)\n @num_urls = args[:num_urls] if args.key?(:num_urls)\n @oceandata = args[:oceandata] if args.key?(:oceandata)\n @onsite_prominence = args[:onsite_prominence] if args.key?(:onsite_prominence)\n @origin = args[:origin] if args.key?(:origin)\n @original_title_hard_token_count = args[:original_title_hard_token_count] if args.key?(:original_title_hard_token_count)\n @page_tags = args[:page_tags] if args.key?(:page_tags)\n @pagerank = args[:pagerank] if args.key?(:pagerank)\n @pagerank0 = args[:pagerank0] if args.key?(:pagerank0)\n @pagerank1 = args[:pagerank1] if args.key?(:pagerank1)\n @pagerank2 = args[:pagerank2] if args.key?(:pagerank2)\n @pageregions = args[:pageregions] if args.key?(:pageregions)\n @phildata = args[:phildata] if args.key?(:phildata)\n @product_sites_info = args[:product_sites_info] if args.key?(:product_sites_info)\n @queries_for_which_official = args[:queries_for_which_official] if args.key?(:queries_for_which_official)\n @rosetta_languages = args[:rosetta_languages] if args.key?(:rosetta_languages)\n @rs_application = args[:rs_application] if args.key?(:rs_application)\n @s3_audio_language = args[:s3_audio_language] if args.key?(:s3_audio_language)\n @saft_language_int = args[:saft_language_int] if args.key?(:saft_language_int)\n @scaled_selection_tier_rank = args[:scaled_selection_tier_rank] if args.key?(:scaled_selection_tier_rank)\n @science_doctype = args[:science_doctype] if args.key?(:science_doctype)\n @science_holdings_ids = args[:science_holdings_ids] if args.key?(:science_holdings_ids)\n @semantic_date = args[:semantic_date] if args.key?(:semantic_date)\n @semantic_date_confidence = args[:semantic_date_confidence] if args.key?(:semantic_date_confidence)\n @semantic_date_info = args[:semantic_date_info] if args.key?(:semantic_date_info)\n @serving_time_cluster_ids = args[:serving_time_cluster_ids] if args.key?(:serving_time_cluster_ids)\n @shingle_info = args[:shingle_info] if args.key?(:shingle_info)\n @smartphone_data = args[:smartphone_data] if args.key?(:smartphone_data)\n @smearing_max_total_offdomain_anchors = args[:smearing_max_total_offdomain_anchors] if args.key?(:smearing_max_total_offdomain_anchors)\n @socialgraph_node_name_fp = args[:socialgraph_node_name_fp] if args.key?(:socialgraph_node_name_fp)\n @spam_cookbook_action = args[:spam_cookbook_action] if args.key?(:spam_cookbook_action)\n @spam_muppet_signals = args[:spam_muppet_signals] if args.key?(:spam_muppet_signals)\n @spambrain_data = args[:spambrain_data] if args.key?(:spambrain_data)\n @spambrain_total_doc_spam_score = args[:spambrain_total_doc_spam_score] if args.key?(:spambrain_total_doc_spam_score)\n @spamrank = args[:spamrank] if args.key?(:spamrank)\n @spamtokens_content_score = args[:spamtokens_content_score] if args.key?(:spamtokens_content_score)\n @time_sensitivity = args[:time_sensitivity] if args.key?(:time_sensitivity)\n @title_hard_token_count_without_stopwords = args[:title_hard_token_count_without_stopwords] if args.key?(:title_hard_token_count_without_stopwords)\n @toolbar_pagerank = args[:toolbar_pagerank] if args.key?(:toolbar_pagerank)\n @top_petacat_tax_id = args[:top_petacat_tax_id] if args.key?(:top_petacat_tax_id)\n @top_petacat_weight = args[:top_petacat_weight] if args.key?(:top_petacat_weight)\n @travel_good_sites_info = args[:travel_good_sites_info] if args.key?(:travel_good_sites_info)\n @trendspam_score = args[:trendspam_score] if args.key?(:trendspam_score)\n @tundra_cluster_id = args[:tundra_cluster_id] if args.key?(:tundra_cluster_id)\n @uac_spam_score = args[:uac_spam_score] if args.key?(:uac_spam_score)\n @url_after_redirects_fp = args[:url_after_redirects_fp] if args.key?(:url_after_redirects_fp)\n @url_poisoning_data = args[:url_poisoning_data] if args.key?(:url_poisoning_data)\n @v2_knex_annotation = args[:v2_knex_annotation] if args.key?(:v2_knex_annotation)\n @video_corpus_docid = args[:video_corpus_docid] if args.key?(:video_corpus_docid)\n @video_language = args[:video_language] if args.key?(:video_language)\n @videodata = args[:videodata] if args.key?(:videodata)\n @volt_data = args[:volt_data] if args.key?(:volt_data)\n @watchpage_language_result = args[:watchpage_language_result] if args.key?(:watchpage_language_result)\n @webmirror_ecn_fp = args[:webmirror_ecn_fp] if args.key?(:webmirror_ecn_fp)\n @webref_entities = args[:webref_entities] if args.key?(:webref_entities)\n @ymyl_health_score = args[:ymyl_health_score] if args.key?(:ymyl_health_score)\n @ymyl_news_score = args[:ymyl_news_score] if args.key?(:ymyl_news_score)\n end",
"title": ""
}
] |
[
{
"docid": "150fa2bdc1fc43d28ac45e2278a1f797",
"score": "0.7012263",
"text": "def update_properties(hash)\n hash.each do |key, value|\n setter_method = \"#{key}=\"\n if self.respond_to?(setter_method)\n self.send(setter_method, value)\n end\n end\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "e72f78e0e269f94de07625d4972f0298",
"score": "0.69181895",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n end",
"title": ""
},
{
"docid": "37ae8a386fde14c02d7021605aa72f45",
"score": "0.67403597",
"text": "def refresh\n self.class.base_properties.each_with_index do |prop, prop_id|\n @properties[prop] = get_property(prop_id)\n end\n refresh_features\n refresh_status\n refresh_config\n self\n end",
"title": ""
},
{
"docid": "10e41ec39ba2af73495ccece21c2d8a3",
"score": "0.6709326",
"text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"title": ""
},
{
"docid": "10e41ec39ba2af73495ccece21c2d8a3",
"score": "0.6709326",
"text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "092b765ad7cf3ce4b6bf4e7d8a2e6af7",
"score": "0.6696149",
"text": "def update(attrs)\n super(attrs)\n end",
"title": ""
},
{
"docid": "47bbd8b88b35da987fc3775b82211e56",
"score": "0.6618882",
"text": "def update_properties!(branch_id=nil)\n properties = fetch_properties(false, branch_id)\n length = properties.length\n counter = 0\n properties.each do |property|\n counter += 1\n if Vebra.debugging?\n puts \"[Vebra]: #{counter}/#{length}: live updating property with Vebra ref: #{property.attributes[:vebra_ref]}\"\n end\n live_update!(property)\n Vebra.set_last_updated_at(Time.now) if counter == length\n end\n end",
"title": ""
},
{
"docid": "769b77b7f7f9f82ae847f5968eb201dc",
"score": "0.6571848",
"text": "def update_self obj\n obj.each do |k,v|\n instance_variable_set(\"@#{k}\", v) if v\n end\n end",
"title": ""
},
{
"docid": "c3b6fccdeb696de5e9dbc38a9486b742",
"score": "0.65386343",
"text": "def update_attributes(properties_hash)\n self.class.get_class_properties.each do |property|\n key = property[:name].to_sym\n if properties_hash.has_key? key\n self.setValue(properties_hash[key], forKey:key)\n end\n end\n end",
"title": ""
},
{
"docid": "bb403006cc5423d9b1820fe684a7c5a5",
"score": "0.65178275",
"text": "def update\n # TODO: implement update\n end",
"title": ""
},
{
"docid": "1ee90e4f66e82aec13076a98b288a2d1",
"score": "0.6394807",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @states = args[:states] if args.key?(:states)\n end",
"title": ""
},
{
"docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5",
"score": "0.6389745",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"title": ""
},
{
"docid": "23eb6f5fbeae4bf9f56ac93a4126b4b5",
"score": "0.6389745",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @object = args[:object] if args.key?(:object)\n end",
"title": ""
},
{
"docid": "3f85752da065340d4ca70ce879a3b23d",
"score": "0.63328",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @total_value_count = args[:total_value_count] if args.key?(:total_value_count)\n @value = args[:value] if args.key?(:value)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"title": ""
},
{
"docid": "da63345424fc9aecef032928485bd149",
"score": "0.6319025",
"text": "def update\n \n end",
"title": ""
},
{
"docid": "5a8e82caac01cee661bc875a5b0cf723",
"score": "0.6283673",
"text": "def refresh\n set_attributes\n end",
"title": ""
},
{
"docid": "60d8c4f58de490a0d7cdd918c16a2cce",
"score": "0.6269463",
"text": "def update(attrs)\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "7a41bc9d5a07220fb8626d1fa90d2d79",
"score": "0.62639254",
"text": "def update!(**args)\n @properties = args[:properties] if args.key?(:properties)\n @source = args[:source] if args.key?(:source)\n end",
"title": ""
},
{
"docid": "29c22ae2290ffca9b9682a5f20f48103",
"score": "0.62410724",
"text": "def update_resource object, attributes\n object.update attributes\n end",
"title": ""
},
{
"docid": "91dc386ff8fa066852510a5d62b13078",
"score": "0.62170374",
"text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs)\n self\n end",
"title": ""
},
{
"docid": "6249943d1eeff63f8f611fcf73254058",
"score": "0.62152076",
"text": "def update\n \n end",
"title": ""
},
{
"docid": "1c12f310aca206a2cefff8c291007668",
"score": "0.6210263",
"text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end",
"title": ""
},
{
"docid": "1c0316f22c6db917fa4719767b5326a9",
"score": "0.6204041",
"text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"title": ""
},
{
"docid": "1c0316f22c6db917fa4719767b5326a9",
"score": "0.6204041",
"text": "def update!(**args)\n @name = args[:name] if args.key?(:name)\n @options = args[:options] if args.key?(:options)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"title": ""
},
{
"docid": "85a79fb5c3cc199e689344861658b09b",
"score": "0.62021106",
"text": "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end",
"title": ""
},
{
"docid": "5d229ea224b1dfa7ac9ce6808ca63fc4",
"score": "0.62017816",
"text": "def update(attributes = {})\n super(attributes)\n retrieve!\n self\n end",
"title": ""
},
{
"docid": "549a7eef6c18558dea47a8e8d72df295",
"score": "0.62017",
"text": "def update\n @objects.map(&:update);\n end",
"title": ""
},
{
"docid": "e1f766468b11768b786daa133483b157",
"score": "0.61730784",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "e1f766468b11768b786daa133483b157",
"score": "0.61730784",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "b76d372399abbb21b748df3ae7b06470",
"score": "0.6159277",
"text": "def live_update!(property)\n property_class = Vebra.models[:property][:class].to_s.camelize.constantize\n\n # ensure we have the full property attributes\n property.get_property if !property.attributes[:status] && property.attributes[:action] != 'deleted'\n\n # find & update or build a new property\n property_model = property_class.find_or_initialize_by_vebra_ref(property.attributes[:vebra_ref])\n\n # make sure property object is not empty\n return false if !property.attributes || !property.attributes[:property_type]\n\n # if the property has been deleted, mark it appropriately and move on\n if property.attributes[:action] == 'deleted'\n return property_model.destroy\n end\n\n # extract accessible attributes for the property\n property_accessibles = property_class.accessible_attributes.map(&:to_sym)\n property_attributes = property.attributes.inject({}) do |result, (key, value)|\n result[key] = value if property_accessibles.include?(key)\n result\n end\n\n # update the property model's attributes\n property_model.no_callbacks = true if property_model.respond_to?(:no_callbacks)\n property_model.update_attributes(property_attributes)\n\n # find & update or build a new address\n if Vebra.models[:address]\n address_class = Vebra.models[:address][:class].to_s.camelize.constantize\n address_model = property_model.send(Vebra.models[:property][:address_method])\n address_model = property_model.send(\"build_#{Vebra.models[:property][:address_method]}\") unless address_model\n\n # extract accessible attributes for the address\n address_accessibles = address_class.accessible_attributes.map(&:to_sym)\n address_attributes = property.attributes[:address].inject({}) do |result, (key, value)|\n result[key] = value if address_accessibles.include?(key)\n result\n end\n\n # update the address model's attributes\n address_model.update_attributes(address_attributes)\n end\n\n # find & update or build new rooms\n if Vebra.models[:room]\n room_class = Vebra.models[:room][:class].to_s.camelize.constantize\n\n # accessible attributes for the rooms\n room_accessibles = room_class.accessible_attributes.map(&:to_sym)\n\n # delete any rooms which are no longer present\n property_rooms = property.attributes[:rooms] || []\n property_model_rooms = property_model.send(Vebra.models[:property][:rooms_method])\n refs_to_delete = property_model_rooms.map(&:vebra_ref) - property_rooms.map { |r| r[:vebra_ref] }\n property_model_rooms.each do |room|\n room.destroy if refs_to_delete.include?(room.vebra_ref)\n end\n\n # find & update or build new rooms\n property_rooms.each do |room|\n room_model = room_class.find_by_property_id_and_vebra_ref(property_model.id, room[:vebra_ref])\n room_model = property_model_rooms.build unless room_model\n\n # extract accessible attributes for the room\n room_attributes = room.inject({}) do |result, (key, value)|\n result[key] = value if room_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n room_model.update_attributes(room_attributes)\n end\n end\n\n # find & update or build new file attachments\n if Vebra.models[:file]\n file_class = Vebra.models[:file][:class].to_s.camelize.constantize\n\n # accessible attributes for the files\n file_accessibles = file_class.accessible_attributes.map(&:to_sym)\n\n # first normalize the collection (currently nested collections)\n property_files = property.attributes[:files].inject([]) do |result, (kind, collection)|\n collection.each do |file|\n file[:type] = kind.to_s.singularize.camelize if file_accessibles.include?(:type)\n file[\"remote_#{Vebra.models[:file][:attachment_method]}_url\".to_sym] = file.delete(:url)\n # if file[:type] is set, it means the attachment file class can be subclassed. In this\n # case we need to ensure that the subclass exists. If not, we ignore this file\n begin\n file[:type].constantize if file_accessibles.include?(:type)\n result << file\n rescue NameError => e\n # ignore - this means the subclass does not exist\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n\n result\n end\n\n # delete any files which are no longer present\n property_model_files = property_model.send(Vebra.models[:property][:files_method])\n refs_to_delete = property_model_files.map(&:vebra_ref) - property_files.map { |f| f[:vebra_ref] }\n property_model_files.each do |file|\n file.destroy if refs_to_delete.include?(file.vebra_ref)\n end\n\n # find & update or build new files\n property_files.each do |file|\n begin\n file_model = property_model_files.find_by_vebra_ref(file[:vebra_ref])\n file_model = property_model_files.build unless file_model\n\n # extract accessible attributes for the file\n file_attributes = file.inject({}) do |result, (key, value)|\n result[key] = value if file_accessibles.include?(key)\n result\n end\n\n # update the room model's attributes\n file_model.update_attributes(file_attributes)\n rescue CarrierWave::ProcessingError, OpenURI::HTTPError => e\n # just ignore the file\n puts \"[Vebra]: #{e.message}\" if Vebra.debugging?\n end\n end\n end\n\n property_model.no_callbacks = false if property_model.respond_to?(:no_callbacks)\n property_model.save\n return property_model\n end",
"title": ""
},
{
"docid": "01219537b43bd1cf8341e0f00e27d4c8",
"score": "0.6156169",
"text": "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"title": ""
},
{
"docid": "147d62c4df79ff1ca86cbd477112bf7f",
"score": "0.61445665",
"text": "def update\n end",
"title": ""
},
{
"docid": "f3dea89f306804c3f2aa813c06584d06",
"score": "0.6125433",
"text": "def update!(**args)\n @mid = args[:mid] if args.key?(:mid)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"title": ""
},
{
"docid": "44756fd86dd095556580199f7e78936f",
"score": "0.61241156",
"text": "def modified_properties=(value)\n @modified_properties = value\n end",
"title": ""
},
{
"docid": "593de84fa9950baa68153e4fa9b6e17c",
"score": "0.6121413",
"text": "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end",
"title": ""
},
{
"docid": "ea25adea5b43c27e6c84f27ad88c3d9f",
"score": "0.6110477",
"text": "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end",
"title": ""
},
{
"docid": "147138a710a0ff53e9288ae66341894f",
"score": "0.6105694",
"text": "def update\n\t\t\n\t\tend",
"title": ""
},
{
"docid": "7b1d2242b1a6bd8d3cad29be97783a80",
"score": "0.61016303",
"text": "def set_props(props)\n @props.merge!(props)\n end",
"title": ""
},
{
"docid": "cb2162d3a1fd3434effd12aa702f250f",
"score": "0.60845226",
"text": "def update() end",
"title": ""
},
{
"docid": "231370ed2400d22825eba2b5b69e7a67",
"score": "0.6084427",
"text": "def update!(**args)\n @property_definitions = args[:property_definitions] if args.key?(:property_definitions)\n end",
"title": ""
},
{
"docid": "86ff97cc222b987bff78c1152a1c8ee1",
"score": "0.6065455",
"text": "def assign_properties\n self.properties ||= {}\n listing_properties.each do |prop|\n self.properties[prop.key] ||= prop.value\n end\n end",
"title": ""
},
{
"docid": "0f6ea4c54f9bc18020c08410f67289cd",
"score": "0.6059506",
"text": "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end",
"title": ""
},
{
"docid": "453da6bb915596261c5b82f2d17cabf8",
"score": "0.6054869",
"text": "def update!(**args)\n @property_value = args[:property_value] if args.key?(:property_value)\n end",
"title": ""
},
{
"docid": "52a81d6eb0fed16fe2a23be3d9ebc264",
"score": "0.6051708",
"text": "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"title": ""
},
{
"docid": "52a81d6eb0fed16fe2a23be3d9ebc264",
"score": "0.6051708",
"text": "def update!(**args)\n @property_name = args[:property_name] if args.key?(:property_name)\n end",
"title": ""
},
{
"docid": "874639781ed80ae451fbdd6ebbef2218",
"score": "0.60413384",
"text": "def update(attributes)\n (@attributes ||= {}).merge! attributes\n\n (self.class.attr_initializables & attributes.keys).each do |name|\n instance_variable_set :\"@#{name}\", attributes[name]\n end\n\n self\n end",
"title": ""
},
{
"docid": "d175f5bedd91a8daf191cad42b04dc0c",
"score": "0.6030853",
"text": "def update_attributes(attrs)\n super({})\n end",
"title": ""
},
{
"docid": "b8d1a7cd8f443ee5f30b5085aadff479",
"score": "0.6022535",
"text": "def update\n @dirty = true\n end",
"title": ""
},
{
"docid": "d7d62f9c97f629ef8c88e56d3d1ce8ee",
"score": "0.6015561",
"text": "def update\n\n # Run through the mixin updates\n colourable_update\n movable_update\n\n end",
"title": ""
},
{
"docid": "71750bae7e3d6bdde2b60ec30e70949a",
"score": "0.59932375",
"text": "def set(props)\n props.each do |prop, val|\n self.send(:\"#{ prop }=\", val)\n end\n end",
"title": ""
},
{
"docid": "73fe9bc31bfeeab4d84483e2fa65cbbb",
"score": "0.59898263",
"text": "def update\n super\n end",
"title": ""
},
{
"docid": "a98ac99e6e5115383e9148202286ff9e",
"score": "0.5976479",
"text": "def update!(**args)\n @property_id = args[:property_id] if args.key?(:property_id)\n @value_status = args[:value_status] if args.key?(:value_status)\n end",
"title": ""
},
{
"docid": "fb14f35e7fab31199053a7b87ef451a4",
"score": "0.5973787",
"text": "def update!(**args)\n @object_size_bytes = args[:object_size_bytes] if args.key?(:object_size_bytes)\n @object_version = args[:object_version] if args.key?(:object_version)\n end",
"title": ""
},
{
"docid": "6441b3fa93c3dfd974c66a975adb9d9c",
"score": "0.59678394",
"text": "def movable_update\n\n # Work through the different aspects we update\n movable_location_update\n movable_size_update\n movable_angle_update\n\n end",
"title": ""
},
{
"docid": "51a59f953548d1eff10532bdffdd8df9",
"score": "0.5963291",
"text": "def properties=(value)\n @properties = value\n end",
"title": ""
},
{
"docid": "e7a3d5504fcc6e382b06845ede0d5fd8",
"score": "0.5962048",
"text": "def update(attrs)\n attrs.each_pair do |key, value|\n send(\"#{key}=\", value) if respond_to?(\"#{key}=\")\n # attributes[key] = value <- lets make use of virtual attributes too\n end\n end",
"title": ""
},
{
"docid": "c7a2880c3da02b3708afc43c48d37f2e",
"score": "0.5961157",
"text": "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "c3f11e80d4ed9199aaaf751efade4812",
"score": "0.5950731",
"text": "def update; end",
"title": ""
},
{
"docid": "5ca2caa1a207739e77f437de35e41cf1",
"score": "0.59500545",
"text": "def update ; end",
"title": ""
},
{
"docid": "a20f534093aba7e3633ca0ac07a56d53",
"score": "0.59443134",
"text": "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"title": ""
},
{
"docid": "a20f534093aba7e3633ca0ac07a56d53",
"score": "0.59443134",
"text": "def update!(**args)\n @freshness_duration = args[:freshness_duration] if args.key?(:freshness_duration)\n @freshness_property = args[:freshness_property] if args.key?(:freshness_property)\n end",
"title": ""
},
{
"docid": "2c309c8084bf29f0b8d8674d22086956",
"score": "0.59424853",
"text": "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"title": ""
},
{
"docid": "2c309c8084bf29f0b8d8674d22086956",
"score": "0.59424853",
"text": "def method_missing(method, *args)\n super if @updated\n set_up_properties_from(@client.get(@path))\n self.send method, *args\n end",
"title": ""
},
{
"docid": "879f1214e030bb2d9e43a0aedb1bc3ea",
"score": "0.593523",
"text": "def update_with(attributes)\n assign_attributes(attributes)\n end",
"title": ""
},
{
"docid": "10b1cb39dbb1f67820e37bb6d2632986",
"score": "0.5926413",
"text": "def update\n # don't need to update; hash is shared\n end",
"title": ""
},
{
"docid": "51982942bd4f09be3f7adc59da4cf104",
"score": "0.5924831",
"text": "def update(attributes)\n HashProxy.with(attributes) do |proxy|\n self.class.attribute_names.each do |name|\n send(\"#{name}=\", proxy[name]) if proxy.key?(name)\n end\n end\n save\n end",
"title": ""
},
{
"docid": "f0dd489c52fa73b1c3846fa43727c29e",
"score": "0.592427",
"text": "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end",
"title": ""
},
{
"docid": "4229acd17d03e94871226b09dd3bd37d",
"score": "0.59233046",
"text": "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"title": ""
},
{
"docid": "4229acd17d03e94871226b09dd3bd37d",
"score": "0.59233046",
"text": "def update!(**args)\n @boolean_property_options = args[:boolean_property_options] if args.key?(:boolean_property_options)\n @date_property_options = args[:date_property_options] if args.key?(:date_property_options)\n @display_options = args[:display_options] if args.key?(:display_options)\n @double_property_options = args[:double_property_options] if args.key?(:double_property_options)\n @enum_property_options = args[:enum_property_options] if args.key?(:enum_property_options)\n @html_property_options = args[:html_property_options] if args.key?(:html_property_options)\n @integer_property_options = args[:integer_property_options] if args.key?(:integer_property_options)\n @is_facetable = args[:is_facetable] if args.key?(:is_facetable)\n @is_repeatable = args[:is_repeatable] if args.key?(:is_repeatable)\n @is_returnable = args[:is_returnable] if args.key?(:is_returnable)\n @is_sortable = args[:is_sortable] if args.key?(:is_sortable)\n @is_suggestable = args[:is_suggestable] if args.key?(:is_suggestable)\n @is_wildcard_searchable = args[:is_wildcard_searchable] if args.key?(:is_wildcard_searchable)\n @name = args[:name] if args.key?(:name)\n @object_property_options = args[:object_property_options] if args.key?(:object_property_options)\n @text_property_options = args[:text_property_options] if args.key?(:text_property_options)\n @timestamp_property_options = args[:timestamp_property_options] if args.key?(:timestamp_property_options)\n end",
"title": ""
},
{
"docid": "32ed734ad4f899f0ee9ec74a760ca1d0",
"score": "0.5921224",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "900f4c147e0916b2e9270373fb83c7e2",
"score": "0.59144294",
"text": "def update_attributes attributes\n @attributes.merge! attributes\n end",
"title": ""
},
{
"docid": "f63de190ae582620103d96f60d684114",
"score": "0.59142506",
"text": "def update!(**args)\n @async_options = args[:async_options] if args.key?(:async_options)\n @input_mappings = args[:input_mappings] if args.key?(:input_mappings)\n @name_property = args[:name_property] if args.key?(:name_property)\n @validation_options = args[:validation_options] if args.key?(:validation_options)\n end",
"title": ""
},
{
"docid": "512d9095b05a696270730ee09c640773",
"score": "0.58887535",
"text": "def update\r\n end",
"title": ""
},
{
"docid": "5b1f6d40d29f0afb908434d0a6404ac8",
"score": "0.58854496",
"text": "def update!(**args)\n @hash_prop = args[:hash_prop] if args.key?(:hash_prop)\n @type = args[:type] if args.key?(:type)\n end",
"title": ""
},
{
"docid": "efcb8c985b9e7911a606a9149b4ab171",
"score": "0.5883008",
"text": "def update\n raise NotImplemented\n end",
"title": ""
},
{
"docid": "65f67197ac4544cbebca350d889922ee",
"score": "0.58792305",
"text": "def update_obj\n mean, sd = rating.to_glicko_rating\n @obj.rating = mean\n @obj.rating_deviation = sd\n @obj.volatility = volatility\n end",
"title": ""
},
{
"docid": "c71a8be944fb89ab77a17fd4c16f7193",
"score": "0.5876954",
"text": "def update_values\n end",
"title": ""
},
{
"docid": "c71a8be944fb89ab77a17fd4c16f7193",
"score": "0.5876954",
"text": "def update_values\n end",
"title": ""
},
{
"docid": "10e162e857be9c47150e8eccd327cad9",
"score": "0.58744955",
"text": "def update\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "389ac4585e8143f353e2535499a23085",
"score": "0.5857968",
"text": "def update!(**args)\n @answers_header_signals = args[:answers_header_signals] if args.key?(:answers_header_signals)\n @property_value = args[:property_value] if args.key?(:property_value)\n @response_meaning_application = args[:response_meaning_application] if args.key?(:response_meaning_application)\n end",
"title": ""
},
{
"docid": "c202a823016f05ee2fc4aade77320497",
"score": "0.5845542",
"text": "def update!(**args)\n @create_time = args[:create_time] if args.key?(:create_time)\n @method_prop = args[:method_prop] if args.key?(:method_prop)\n @name = args[:name] if args.key?(:name)\n @state = args[:state] if args.key?(:state)\n end",
"title": ""
},
{
"docid": "dc268f568dcb7aca1d3905736d2477af",
"score": "0.5841629",
"text": "def update attributes, collection #:nodoc:\n 0\n end",
"title": ""
},
{
"docid": "9763ac25d7fdf4b4f35a971609f70b04",
"score": "0.58363605",
"text": "def update_property_groups(roll)\n @property_groups.each { |_, v| v.update_rent(roll) }\n end",
"title": ""
},
{
"docid": "541550458a4c8f94afeb6b10c0cb2293",
"score": "0.5829255",
"text": "def update!(**args)\n @source_property = args[:source_property] if args.key?(:source_property)\n end",
"title": ""
},
{
"docid": "49a282f2ce0c099a5ced60524a492b4f",
"score": "0.582919",
"text": "def update_info(update_attr_hash)\n update_attr_hash.each do |k,v| \n\t\t\tself.send(\"#{k}=\",v)\n\t\tend\n end",
"title": ""
},
{
"docid": "f6c4eafa4f48a0c81157fb03ff350901",
"score": "0.5822138",
"text": "def update_properties(path, properties)\n prop_patch = PropPatch.new(properties)\n emit('propPatch', [path, prop_patch])\n prop_patch.commit\n\n prop_patch.result\n end",
"title": ""
},
{
"docid": "524a6a969929f9af4bad05dbd9c8f935",
"score": "0.58208305",
"text": "def update\n set_deltatime\n set_last_update_at\n end",
"title": ""
}
] |
b652df54ca362e6a00c08f1c370e8af3
|
GET /short_names/1 GET /short_names/1.json
|
[
{
"docid": "1ef54524658761267a3d51c7982a44ab",
"score": "0.76477915",
"text": "def show\n @short_name = ShortName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @short_name }\n end\n end",
"title": ""
}
] |
[
{
"docid": "220b981cc822f20bea60434f0865ddfc",
"score": "0.71382123",
"text": "def rest_name\n short_name.downcase\n end",
"title": ""
},
{
"docid": "eb103bac7a291d061fd722fb4b4a4cc7",
"score": "0.6771936",
"text": "def short_name\n @short_name ||= name.to_s.split('').shift\n end",
"title": ""
},
{
"docid": "658e7661d8069cf1f38ba0e12f705919",
"score": "0.6696466",
"text": "def new\n @short_name = ShortName.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @short_name }\n end\n end",
"title": ""
},
{
"docid": "0ba8187e77614f674974b43b938891eb",
"score": "0.6677885",
"text": "def canonical_short_name\n if respond_to?(:short_name)\n short_name\n elsif respond_to?(:name)\n name\n elsif respond_to?(:title)\n title\n end\n end",
"title": ""
},
{
"docid": "04ece88fbf7526d5328018b347d1f98b",
"score": "0.6661533",
"text": "def shortname\n attributes['shortName']\n end",
"title": ""
},
{
"docid": "2379b6a37fea0f20f80a6bbd5f4fc9b9",
"score": "0.64486706",
"text": "def short_name\n if abbreviation.nil? then\n return name\n else\n return abbreviation\n end\n end",
"title": ""
},
{
"docid": "f9bbe783a3e760976f38f7df7813f77f",
"score": "0.6369612",
"text": "def show\n @human_name = HumanName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @human_name }\n end\n end",
"title": ""
},
{
"docid": "d4b7cd97f1d400ec3b339645ce72086e",
"score": "0.63591343",
"text": "def short_name\n short.to_s.sub(/^(-.).*$/, \"\\\\1\")\n end",
"title": ""
},
{
"docid": "c33ec405fecdea5ace260c50a3fc2bf9",
"score": "0.6341058",
"text": "def shortName\n self.short_name\n end",
"title": ""
},
{
"docid": "902a33b7c12f09044411dd299813359a",
"score": "0.6320912",
"text": "def shortname\n @shortname.nil? ? @name : @shortname\n end",
"title": ""
},
{
"docid": "2cc6f7812a1a635ea8370ac6d90c1191",
"score": "0.63076556",
"text": "def shortname\n name.downcase.gsub(/[^a-z]/, \"-\")\n end",
"title": ""
},
{
"docid": "9efe41059bb5731be1f23ad40d705066",
"score": "0.6306862",
"text": "def name\n short_code\n end",
"title": ""
},
{
"docid": "c307876826a70ec8a4eecc73eaadaf56",
"score": "0.6303446",
"text": "def shortname\n name.downcase.gsub(/[^a-z]/, \"\")\n end",
"title": ""
},
{
"docid": "12943cec50df5207c5618e1ae5365f99",
"score": "0.6300292",
"text": "def show\n @shorter = Shorter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.haml\n format.json { render json: @shorter }\n end\n end",
"title": ""
},
{
"docid": "9a10daba16131625339e833c02bba6d4",
"score": "0.627315",
"text": "def create\n @short_name = ShortName.new(params[:short_name])\n\n respond_to do |format|\n if @short_name.save\n format.html { redirect_to @short_name, notice: 'Short name was successfully created.' }\n format.json { render json: @short_name, status: :created, location: @short_name }\n else\n format.html { render action: \"new\" }\n format.json { render json: @short_name.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c9a1f17104066b01f2d29e76619e1fec",
"score": "0.6272511",
"text": "def countries(data)\n my_hash = JSON.parse(data)\n conv_name = my_hash[0]['conventional_short_form']\n puts conv_name\nend",
"title": ""
},
{
"docid": "208fb54a94799439ac84d7ec48d74a6e",
"score": "0.62519366",
"text": "def short_name\n puts \"Jai shree mahakal\"\n end",
"title": ""
},
{
"docid": "108eef7e5da9aacb642d7088dc2002fa",
"score": "0.6232359",
"text": "def show\n @shortener = Shortener.find(params[:id])\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shorteners }\n end\n end",
"title": ""
},
{
"docid": "8b83f3fbb43389335674925f47720933",
"score": "0.6127358",
"text": "def named(name)\n # do we need to modify the json\n # url_char_name = name.gsub!(' ','+')\n url_char_name = name.gsub(' ','+')\n self.class.get(\"/cards/named?fuzzy=#{url_char_name}\")\n end",
"title": ""
},
{
"docid": "9689ab338d4f4a6587798bb6db1d2d34",
"score": "0.6127252",
"text": "def show\n @shortener = Shortener.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shortener }\n end\n end",
"title": ""
},
{
"docid": "81d30de72b8c2f6502a657633d3884e4",
"score": "0.6085235",
"text": "def show\n @short_domain = ShortDomain.find(params[:id], :include => { :short_urls => :short_domain })\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @short_domain }\n end\n end",
"title": ""
},
{
"docid": "40cca70026082e03534fde7ed315a728",
"score": "0.6082997",
"text": "def destroy\n @short_name = ShortName.find(params[:id])\n @short_name.destroy\n\n respond_to do |format|\n format.html { redirect_to short_names_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8077318c3c39350aef80e67c94b68c28",
"score": "0.608049",
"text": "def to_s\n short_name\n end",
"title": ""
},
{
"docid": "9978cd12577338007fa4bbc1b2eb8257",
"score": "0.6074202",
"text": "def short_name\n full_name = \"\"\n if name.present?\n full_name = name\n else\n full_name = \"#{self.first_name ? self.first_name.downcase.capitalize : \"\"} #{self.last_name ? \"#{self.last_name.first.upcase}.\" : \"\"}\"\n end\n\n full_name\n end",
"title": ""
},
{
"docid": "c65e96170bd6c3cfa4514786cfa57e60",
"score": "0.6061557",
"text": "def short_name(how_short = 55)\n\t\tstr = self.name\n\t\tshortname = (str.length > how_short) ? (str[0..how_short] + \"...\") : str\n\t\treturn shortname\n\tend",
"title": ""
},
{
"docid": "4204a601b939b718f5732dc2a17131ad",
"score": "0.60531336",
"text": "def index\n @shorties = Shorty.per_user(current_user).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shorties }\n end\n end",
"title": ""
},
{
"docid": "f83dba0abb0607d45367d724cc25f4b2",
"score": "0.60082",
"text": "def use_short_names\n opts = get_options\n opts['uselongnames']=false\n save_file(opts)\n nil\n end",
"title": ""
},
{
"docid": "1fb7f0a3e7bb081a078176754aa8f4e8",
"score": "0.5983255",
"text": "def index\n @shorteners = Shortener.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shorteners }\n end\n end",
"title": ""
},
{
"docid": "3f9b8e785ad2c50804c53966ab5da334",
"score": "0.5975107",
"text": "def short_name\n short = name[0..30]\n if name.length > 30\n short += '...'\n end\n short\n end",
"title": ""
},
{
"docid": "65ea1b1328dfa11c90bd9622e65ab427",
"score": "0.5974434",
"text": "def short_name \r\n name.gsub(/([A-Z])[^A-Z]+/, '\\1')\r\n end",
"title": ""
},
{
"docid": "bbdcd09b3e79196e571b37a9b2d80648",
"score": "0.5970311",
"text": "def index\n @short_urls = @user.short_urls.paginate(:page => params[:page][:number], :per_page => params[:page][:size])\n if @short_urls.count > 0\n render json: @short_urls, meta: pagination_details(@short_urls)\n else\n error = {}\n render json: {errors: {message: \"You haven't created Short URLs yet!\"}}\n end\n end",
"title": ""
},
{
"docid": "2a27c5b332a86cb94092ae34d7a2dcd7",
"score": "0.5957677",
"text": "def update\n @short_name = ShortName.find(params[:id])\n\n respond_to do |format|\n if @short_name.update_attributes(params[:short_name])\n format.html { redirect_to @short_name, notice: 'Short name was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @short_name.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8444aa0991f1c546ae725a64adccc18f",
"score": "0.5951004",
"text": "def showName\n render json: User.findByName(params[\"name\"])\n end",
"title": ""
},
{
"docid": "fee16cc1f679c7b973866cf60ee30032",
"score": "0.5935536",
"text": "def short_name\n \"#{first_name} #{last_name[0, 1]}\"\n end",
"title": ""
},
{
"docid": "3c3a38439802ee415aea32481d6d95b7",
"score": "0.5920858",
"text": "def short_name\n Category.short_name name\n end",
"title": ""
},
{
"docid": "bf558481a8264e9b0a14d8821db83924",
"score": "0.59175134",
"text": "def index\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { @url_shorts = UrlShort.all }\n end\n end",
"title": ""
},
{
"docid": "2c13e5529c9ff051137ff9448f93fc80",
"score": "0.59149563",
"text": "def convert_short_name\n self.short_name = self.short_name.parameterize\n true # So the save doesn't give up?\n end",
"title": ""
},
{
"docid": "4bd0c645d49ebd2034dd0729a4477780",
"score": "0.5911564",
"text": "def short_url\n @json[\"shortUrl\"]\n end",
"title": ""
},
{
"docid": "62319ef5d8b23cb011ff5239579b7d80",
"score": "0.59068775",
"text": "def index\n render json: {\n status: :success,\n urls: ShortUrl::top_100\n }\n end",
"title": ""
},
{
"docid": "94a23bbd5dcd071e27c40b3aa8cfcfcd",
"score": "0.59010714",
"text": "def showName\n @user = User.by_name(params[:name])\n render json: @user\n end",
"title": ""
},
{
"docid": "3fc2f75f8f61af062ecb68111c7d6f0c",
"score": "0.58934164",
"text": "def show\n @name = Name.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @name }\n end\n end",
"title": ""
},
{
"docid": "3fc2f75f8f61af062ecb68111c7d6f0c",
"score": "0.58934164",
"text": "def show\n @name = Name.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @name }\n end\n end",
"title": ""
},
{
"docid": "0417603542f6758a7e6c2f756639b319",
"score": "0.58749694",
"text": "def show_full_name\n name\n end",
"title": ""
},
{
"docid": "3919a6a33337e39f0f408b289cf47453",
"score": "0.5867874",
"text": "def showNameLocal\n @user = User.by_name_local(params[:name],params[:local])\n render json: @user\n end",
"title": ""
},
{
"docid": "e452c0134473201ac583006406b80580",
"score": "0.586474",
"text": "def show\n token = ::Shortener::ShortenedUrl.extract_token(params[:id])\n track = Shortener.ignore_robots.blank? || request.human?\n url = ::Shortener::ShortenedUrl.fetch_with_token(token: token, additional_params: params, track: track)\n country = ISO3166::Country[request.location.country]\n name = begin\n (country.translations[I18n.locale.to_s] || country.name)\n rescue StandardError\n ''\n end\n Country.create(url_id: url[:shortened_url]&.id, name: country, ip: request.location.ip)\n redirect_to url[:url], status: :moved_permanently\n end",
"title": ""
},
{
"docid": "c7f2442eaab7d16e9d546a515642c782",
"score": "0.5861033",
"text": "def show\n @url = ShortenedUrl.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @url }\n end\n end",
"title": ""
},
{
"docid": "99687f80381b95518bd00939be6fad11",
"score": "0.5859179",
"text": "def show\n if @short_url\n short_visits = @short_url.short_visits.paginate(:page => params[:page][:number], :per_page => params[:page][:size])\n if short_visits.count > 0\n result = short_visits\n else\n error = {}\n error[:errors] = \"No visitors yet!!\"\n result = error\n end\n render json: result\n else\n render json: {errors: {message: \"No short_url with given id in your ShortUrl list.\"}}, status: 404\n end\n end",
"title": ""
},
{
"docid": "58395a91495a2ec1b25031a410130b20",
"score": "0.5856377",
"text": "def short_name\n if segments.empty?\n ''\n elsif segments.length == 1\n segments[0]\n else\n segments[1..-1].join(SEPARATOR)\n end\n end",
"title": ""
},
{
"docid": "ffbf68ef5723e65683ccce3c5134ed1b",
"score": "0.58487314",
"text": "def shortname\n\n # Get all servers, that share the same firstname\n doppelgangers = Server.where(firstname: firstname).where.not(id: id).to_a\n return firstname unless doppelgangers.size > 0\n\n # Generate an abbreviation of the lastname until there is noone who shares\n # the same start.\n last = ''\n lastname.each_char do |c|\n last += c\n doppelgangers = doppelgangers.select{ |d| d.lastname.starts_with?(last) }\n break unless doppelgangers.size > 0\n end\n\n # Only apply a dot if the lastname was actually shortend.\n last == lastname ? \"#{firstname} #{lastname}\" : \"#{firstname} #{last}.\"\n end",
"title": ""
},
{
"docid": "414426bfc24a6a440ee86602c3887e78",
"score": "0.5845346",
"text": "def index\n @industries = Industry.order(:short_name_en)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @industries }\n end\n end",
"title": ""
},
{
"docid": "23ace9793b671250556f05804d61b312",
"score": "0.5836085",
"text": "def my_short_name\n @my_short_name ||= self.class.name.split(\"_\").last\n end",
"title": ""
},
{
"docid": "8348fb5eb5cc39738ed960a63fb37bc5",
"score": "0.58304113",
"text": "def autocomplete_name\n @tags = Tag.where([\"name ILIKE ?\", \"*#{params[:term]}*\".to_escaped_for_sql_like]).order('LENGTH(name)', :name).limit(20).pluck(:name)\n respond_to do |format|\n format.json { render :json => @tags }\n end\n end",
"title": ""
},
{
"docid": "f1cdb9b1ff0696f732acf32a3a91d58d",
"score": "0.5830087",
"text": "def show\n @gid2name = Gid2name.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gid2name }\n end\n end",
"title": ""
},
{
"docid": "ee977f73867138d7fdb802f5db19eccf",
"score": "0.58160436",
"text": "def display_name\n\t\tself.short_name\n\tend",
"title": ""
},
{
"docid": "bb3be3a1f28287186e0f6e288b35d42f",
"score": "0.5805422",
"text": "def return_suggestion\n suggestion = Petit::Shortcode.suggest\n if request.accept?('application/json') || request.accept?('application/vnd.api+json')\n response.headers['Content-Type'] = 'application/vnd.api+json'\n json_body = {\n data: {\n type: 'suggestion',\n id: suggestion,\n attributes: {\n name: suggestion\n }\n }\n }\n json_body.to_json\n else\n suggestion\n end\n end",
"title": ""
},
{
"docid": "4370862d8a99dce6d63e10e197c0bd0f",
"score": "0.5804742",
"text": "def short_name\n self.abbrv.to_s.empty? ? self.name : self.abbrv\n end",
"title": ""
},
{
"docid": "979ed28111a42878b06ffdbc7603fbac",
"score": "0.5790472",
"text": "def short_name\r\n return \"#{first_name[0].chr}. #{last_name}\"\r\n end",
"title": ""
},
{
"docid": "02199e17dc33f6f2fc2fa70d6b213d66",
"score": "0.5783376",
"text": "def show\n @name_server = NameServer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @name_server }\n end\n end",
"title": ""
},
{
"docid": "b35299cabd7cb3e39c18c01c179e5ffb",
"score": "0.57765883",
"text": "def short_name\n self.get_column(\"Entry_ID/Short_Name\")\n end",
"title": ""
},
{
"docid": "a449b4ccd3d2528a242f3d88d39988ae",
"score": "0.5774187",
"text": "def name\n response[\"name\"]\n end",
"title": ""
},
{
"docid": "4d9895078a120791f471b9a462318d50",
"score": "0.576558",
"text": "def route_by_short_name(route_short_name)\n get \"/gtfs/routes/routeShortName/#{route_short_name}\"\n end",
"title": ""
},
{
"docid": "4955b64e5195351755707c2d6c516f42",
"score": "0.5751204",
"text": "def short_name\n name.size > 35 ? \"#{name[0..35]}...\" : name\n end",
"title": ""
},
{
"docid": "88943cb5e6862dd0abbe63b08f13d166",
"score": "0.5733209",
"text": "def index\n @shorts = Short.all\n end",
"title": ""
},
{
"docid": "335c2de03ef9845d144bd3503ee24e26",
"score": "0.57301146",
"text": "def getSQL_ShortText\n response = {:sql_short_text => get_cached_sql_shorttext_by_sql_id(params[:sql_id])}\n response = response.to_json\n render :json => response, :status => 200\n end",
"title": ""
},
{
"docid": "386f2e6b14a7e808fcd1b06f4b136ad8",
"score": "0.5723093",
"text": "def show\n @taxon_with_name = TaxonWithName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @taxon_with_name }\n end\n end",
"title": ""
},
{
"docid": "302bbadba3cbaef00b3c8028e45d52ef",
"score": "0.57208157",
"text": "def cmd_get_name argv\n setup argv\n uuid = @hash['uuid']\n response = @api.get_name(uuid)\n msg response\n return response\n end",
"title": ""
},
{
"docid": "85cc242f56aafae332f20fa9fb0ce5a6",
"score": "0.5718597",
"text": "def get_full_name\n description\n end",
"title": ""
},
{
"docid": "a999255216cd24cdad623d776dcab75e",
"score": "0.5679329",
"text": "def index\n @human_names = HumanName.search(params)\n\t\t@letters = get_turkish_alphabet()\n\n respond_to do |format|\n format.html # index.html.erb\n format.js\n format.json { render :json => @human_names }\n end\n end",
"title": ""
},
{
"docid": "c991ba6a0e3d9e15d981d0c44e5e2cf5",
"score": "0.5661967",
"text": "def show\n @member = Member.find(params[:id])\n @title = \"#{@member.last_name} #{@member.given_names}\"\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @member }\n end\n end",
"title": ""
},
{
"docid": "6a7697f27779f66b31584d17ee48bac9",
"score": "0.56543165",
"text": "def show_short_urls\n\t\turls = Url.all\n\t\t@short_url_list = []\n\t\turls.each do |url|\n\t\t\tshort_url = get_short_url_from_id url.id\n\t\t\t@short_url_list << short_url\n\t\tend\n\t\trender \"url\"\n\tend",
"title": ""
},
{
"docid": "9ede9bcf7eb42f23e0c09b2eea280cc7",
"score": "0.56501776",
"text": "def short=(value)\n raise ArgumentError, _(\"Short names can only be one character.\") if value.to_s.length != 1\n @short = value.to_s\n end",
"title": ""
},
{
"docid": "a33f931e967a21fe62b2445dd77fc7b8",
"score": "0.56462127",
"text": "def show\n @ingredients_name = IngredientsName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ingredients_name }\n end\n end",
"title": ""
},
{
"docid": "0ffa0f3443ff2bc162ece805ba83e773",
"score": "0.5644972",
"text": "def name\n \"#{number}: #{short_name}\"\n end",
"title": ""
},
{
"docid": "79b05d1a1f9f0036631100d49c3326c2",
"score": "0.5643732",
"text": "def shortdesc\n @data['shortdesc']\n end",
"title": ""
},
{
"docid": "df364f6c69f89adf66864cb599ef9ec4",
"score": "0.56382376",
"text": "def get_short_name\n sname = description.split(/trofeo|meeting/i)\n if sname.length > 1\n # Remove spaces, split in tokens, delete empty tokens and take just the first 3, joined together:\n (sname[1].strip.split(/\\s|\\,/).delete_if { |item| item == '' })[0..2].join(' ')\n else\n # Just use the name if it wasn't \"splittable\":\n sname[0]\n end\n end",
"title": ""
},
{
"docid": "df2ac30633ec4a6f97670e41a614b6e6",
"score": "0.5625479",
"text": "def to_param\n short_name\n end",
"title": ""
},
{
"docid": "32a9b22abffeac275b9219e3af74d4f1",
"score": "0.56238055",
"text": "def index\n @shortners = Shortner.all\n end",
"title": ""
},
{
"docid": "51899a86457a507622fb43138e4beb27",
"score": "0.5619408",
"text": "def index\n @urlshortners = Urlshortner.all\n end",
"title": ""
},
{
"docid": "69cff08123b1f74b26a4ac3310b00730",
"score": "0.56180215",
"text": "def alias_name(name)\n\tchar_index = 0 \n\talias_response = \"\"\n\t\twhile char_index < name.length\n\t\t\talias_response << new_name(name.downcase[char_index])\n\t\t\tchar_index += 1\n\t\tend\n\talias_response\nend",
"title": ""
},
{
"docid": "b11f0d7484568d21bbe847535fb473c3",
"score": "0.5617585",
"text": "def full_name\n json[\"entry_data\"][\"ProfilePage\"].first[\"graphql\"][\"user\"][\"full_name\"]\n end",
"title": ""
},
{
"docid": "f8bad57cd98f8e1f886eea1082d4f155",
"score": "0.5616468",
"text": "def get_full_name\n title\n end",
"title": ""
},
{
"docid": "3e8f76d179460c47edd60953044074ef",
"score": "0.5611848",
"text": "def to_s\n short || name[0]\n end",
"title": ""
},
{
"docid": "55be1f00d38f4c24d7886750b1de112a",
"score": "0.5604943",
"text": "def to_param\n short_name.present? ? short_name : super\n end",
"title": ""
},
{
"docid": "410165254c3ed36a892d24844dde74ab",
"score": "0.5602445",
"text": "def full_name\n name\n end",
"title": ""
},
{
"docid": "e99778507c49b4dce52ab139c0e6b621",
"score": "0.5601412",
"text": "def names\n get('names')\n end",
"title": ""
},
{
"docid": "df86bc9e2ea6435af22ccb46dcb19771",
"score": "0.55925465",
"text": "def full_name\n get_full_name\n end",
"title": ""
},
{
"docid": "43d45d62b2cad46f17570a1efe0a2ff1",
"score": "0.5592338",
"text": "def pretty_name\n self.name + ' (' + self.japanese_name + ')'\n end",
"title": ""
},
{
"docid": "43d008216455c0ae33dc66354383d199",
"score": "0.5586765",
"text": "def name\n @gapi[\"friendlyName\"]\n end",
"title": ""
},
{
"docid": "bcbe679ba60309a4b40cd32d32dcaf4e",
"score": "0.5576088",
"text": "def cugs_names_with_aliases\n channels = Channel.includes(:channel_aliases, :subscriptions => :user).searched_channels(true, params[:query], current_user.id)\n render :json => { :query => params[:query],\n :suggestions => channels.blank? ? [\"No CUGs Found\"] : channels.map{|channel| \"#{ChannelAlias.select(\"name,id\").where(:user_id => current_user.id, :channel_id => channel.id).first.try(:name) || channel.name}\"},\n :data => channels.blank? ? [0] : channels.map{|channel| channel.id} }\n end",
"title": ""
},
{
"docid": "2be6128e167b27db1a373d96e7fc0b2d",
"score": "0.5575243",
"text": "def new\n @shorter = Shorter.new\n\n respond_to do |format|\n format.html # new.html.haml\n format.json { render json: @shorter }\n end\n end",
"title": ""
},
{
"docid": "143f30a1830563d6412bb7e41be52518",
"score": "0.55710334",
"text": "def name\n full_name\n end",
"title": ""
},
{
"docid": "36647e5a0ae21fe3db5d5bbd39ce9144",
"score": "0.5570728",
"text": "def get_name(region)\n url = 'https://uinames.com/api/'\n uri= URI(url)\n response = Net::HTTP.get(uri)\n result = JSON.parse(response)\n result[\"name\"]\n \nend",
"title": ""
},
{
"docid": "5cdf81422966019466632d00141437e7",
"score": "0.556765",
"text": "def show\n if (@short_url = ShortUrl.find_by_hash_string(params[:id])).present?\n @redirect = true\n respond_to do |format|\n format.html\n end\n else\n @short_url = ShortUrl.find(params[:id])\n respond_to do |format|\n format.html\n format.json { render json: @short_url}\n end\n end\n end",
"title": ""
},
{
"docid": "b47eabdfde3c0bb154f12aa36c2a6184",
"score": "0.5549613",
"text": "def get_full_name\n \"#{name} (#{description})\"\n end",
"title": ""
},
{
"docid": "acaa891b88240adcaed4e27e3451ba28",
"score": "0.5539495",
"text": "def suggested_short_name(language=nil)\n (language && @short_name.find { |name| name.language == language }) || @short_name\n end",
"title": ""
},
{
"docid": "cb347912025318e850e9b9230967e9f3",
"score": "0.553706",
"text": "def get_full_name(hash)\n return hash[\"first\"] + \" \" + hash[\"last\"] + \", the \" + hash[\"title\"]\nend",
"title": ""
},
{
"docid": "9507ca7049e4c1438044bbd17882a55c",
"score": "0.5536069",
"text": "def names\n sql = 'SELECT DISTINCT resources.name '\\\n 'FROM resources '\\\n 'LEFT JOIN locations ON locations.id = resources.location_id '\\\n 'LEFT JOIN repositories ON locations.repository_id = repositories.id '\\\n 'LEFT JOIN institutions ON repositories.institution_id = institutions.id '\\\n 'WHERE institutions.id = ' + params[:institution_id].to_i.to_s\n conn = ActiveRecord::Base.connection\n results = conn.execute(sql)\n render json: results.map{ |r| r['name'] }\n end",
"title": ""
},
{
"docid": "96e0d41126486bf208a31b6670578e87",
"score": "0.55282956",
"text": "def show\n @shorty = Shorty.per_user(current_user).find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shorty }\n end\n end",
"title": ""
},
{
"docid": "e9f700f1c13c9ba6ff516c5e8ae88bb5",
"score": "0.5524983",
"text": "def canonical_long_name\n if respond_to?(:verbose_name)\n verbose_name\n elsif respond_to?(:short_name)\n name\n elsif respond_to?(:description)\n description\n else\n ''\n end\n end",
"title": ""
},
{
"docid": "2353140550c29aa2427c9ea64995866e",
"score": "0.5522574",
"text": "def index\n @shorturls = Shorturl.all\n end",
"title": ""
}
] |
15d4d8598c0ac10d22959881f7c05d31
|
Remove an anonymization rule Removing a nonexistent rule is your business. This method only cares that the rule does not exist when it's done.
|
[
{
"docid": "e5c394d854f15b8e2a0bc00ece3f9296",
"score": "0.7124882",
"text": "def forget_anonymization_rule rule_name\n self.anonymization_rules.delete rule_name\n end",
"title": ""
}
] |
[
{
"docid": "9e2b4e2b3a766f6d448eac452ff194bc",
"score": "0.73454595",
"text": "def delete_rule rule\n delete rule.meaning.to_sym\n end",
"title": ""
},
{
"docid": "95b1c93f51511c0c9dc58d1aaea95257",
"score": "0.72581553",
"text": "def delete_rule(rule)\n delete_rules(rule)\n end",
"title": ""
},
{
"docid": "c5b85fe4a2690737293f54b6c7247076",
"score": "0.6840619",
"text": "def remove_rule(id)\n @rules.delete_if { |rule| rule.id == id }\n\n rule = BeEF::Core::Models::Dns::Rule.get(id)\n\n rule != nil ? rule.destroy : false\n end",
"title": ""
},
{
"docid": "f67da4f5f258bbba3e2c036538c54486",
"score": "0.6715279",
"text": "def remove_ruleset\n @rules = []\n BeEF::Core::Models::Dns::Rule.destroy\n end",
"title": ""
},
{
"docid": "90a16ec6a4dae7cb54c465225b692c81",
"score": "0.66520494",
"text": "def exit_rule(grammar_file, rule_name)\n # do nothing\n end",
"title": ""
},
{
"docid": "03980030847ee5939f81d34443296673",
"score": "0.6571115",
"text": "def remove_policy_rule\n\n rule = @policy.policy_asset_subtype_rules.find(params[:rule])\n if rule.nil?\n notify_user_immediately \"Can't find the rule in policy #{@policy}\", \"warning\"\n elsif Asset.where(organization_id: @policy.organization_id, asset_subtype_id: rule.asset_subtype_id, fuel_type_id: rule.fuel_type_id).count > 0\n notify_user_immediately \"Can't remove a default rule being used from #{@policy}\", \"warning\"\n else\n if rule.try(:parent_rule_can_destroy?)\n AssetSubtype.find_by(id: rule.asset_subtype_id).destroy\n end\n rule.destroy\n\n notify_user_immediately \"Rule was successfully removed from #{@policy}\"\n end\n\n render 'update_policy_rules'\n\n end",
"title": ""
},
{
"docid": "e2ecbe4325ce9bbd0fdbbb3c6cea6eb4",
"score": "0.6567053",
"text": "def remove_response_rule(vs_name, rule)\n @driver.removeResponseRules([vs_name], [[rule]])\n end",
"title": ""
},
{
"docid": "74490526d21d825c8d3396f7a24803a5",
"score": "0.65626866",
"text": "def remove_request_rule(vs_name, rule)\n @driver.removeRules([vs_name], [[rule]])\n end",
"title": ""
},
{
"docid": "da786bab8749e8613a0302662d5fadea",
"score": "0.6523393",
"text": "def remove_rule(publisher, filter, rule)\n logger.info(\"Removing rule #{rule.value} from filter #{filter.name}\")\n return delete(\"#{publisher.uri}/filters/#{filter.name}/rules?type=#{CGI.escape(rule.type)}&value=#{CGI.escape(rule.value)}\") if rule\n end",
"title": ""
},
{
"docid": "8d5e1e9049033b80f48424a9f363c106",
"score": "0.6519645",
"text": "def test_10_remove_rule_good\n id = @@dns.add_rule('hack.the.gibson', IN::A) do |transaction|\n transaction.respond!('1.9.9.5')\n end\n\n removed = @@dns.remove_rule(id)\n\n assert(removed)\n end",
"title": ""
},
{
"docid": "47a6d31b4a2fa3a00ac26302bb4813ee",
"score": "0.6476651",
"text": "def remove_rule!(id)\n @lock.synchronize do\n begin\n rule = @database.find(id)\n if not rule.nil? and rule.destroy\n return true\n end\n rescue ActiveRecord::RecordNotFound\n return nil\n end\n return false\n end\n end",
"title": ""
},
{
"docid": "3b8d9777812d3c84a39f28bbcaf901a6",
"score": "0.63978505",
"text": "def test_11_remove_rule_bad\n removed = @@dns.remove_rule(42)\n\n assert(!removed)\n end",
"title": ""
},
{
"docid": "dc312ba6a69ed21119e1c49b79d651aa",
"score": "0.6356156",
"text": "def test_should_not_remove_undefined_rule\n assert !SmartMonth::Rulesets.remove_rule(\"Rule fake\")\n end",
"title": ""
},
{
"docid": "ade9141696127d770dae922f2085a017",
"score": "0.61947984",
"text": "def delete_rule\n super\n end",
"title": ""
},
{
"docid": "1e13cd39282e16f4122a31a71fec5763",
"score": "0.61375177",
"text": "def destroy\n audit(@set_rule, current_user)\n @set_rule.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "daec503d64c73774dfb89501c3006fcc",
"score": "0.6122337",
"text": "def delete_rule(project_id, rule_id)\n delete \"projects/#{project_id}/rules/#{rule_id}\"\n end",
"title": ""
},
{
"docid": "69081f48692467edd76891763c81213a",
"score": "0.60782427",
"text": "def delete_rule(*p)\n topic_name, subscription_name, rule_name = _rule_args(*p)\n\n delete_resource_entry(:rule, topic_name, subscription_name, rule_name)\n end",
"title": ""
},
{
"docid": "cd016d60a43950bdff6a90d9c82234b4",
"score": "0.6051214",
"text": "def test_13_remove_ruleset\n removed = @@dns.remove_ruleset\n ruleset = @@dns.get_ruleset\n\n assert(removed)\n assert_equal(0, ruleset.length)\n end",
"title": ""
},
{
"docid": "046997c138a536239219f88b94e2d1c9",
"score": "0.60492986",
"text": "def delete_rules\n singelton = class << self;\n self;\n end\n rule_node = Rule.rule_node_for(self)\n\n rule_node.rule_names.each { |rule_name| singelton.send(:remove_method, rule_name) }\n rule_node.rules.clear\n end",
"title": ""
},
{
"docid": "ade23cccad6f76ff5cf891021cb6dbf2",
"score": "0.6017107",
"text": "def remove_recurrence_rule(rule)\n res = @all_recurrence_rules.delete(rule)\n res.nil? ? [] : [res]\n end",
"title": ""
},
{
"docid": "ade23cccad6f76ff5cf891021cb6dbf2",
"score": "0.6017107",
"text": "def remove_recurrence_rule(rule)\n res = @all_recurrence_rules.delete(rule)\n res.nil? ? [] : [res]\n end",
"title": ""
},
{
"docid": "136b2cef275def384cd9932b1da5f9a7",
"score": "0.5951888",
"text": "def delete_rule!(object_id, opts = {})\n response = delete_rule(object_id, opts)\n response.wait(opts)\n end",
"title": ""
},
{
"docid": "4d7151c33472acb295a78d8f7d6941b7",
"score": "0.59437376",
"text": "def remove_ruleset\n @lock.synchronize { @server.remove_ruleset }\n end",
"title": ""
},
{
"docid": "c42b671783860ec3b435cf5fed665b39",
"score": "0.5931557",
"text": "def remove_recurrence_rule(rule)\n raise ArgumentError.new('Argument must be a valid rule') unless rule.class < Rule\n deletions = []\n @rrule_occurrence_heads.delete_if { |h| deletions << h.rule if h.rule == rule }\n deletions\n end",
"title": ""
},
{
"docid": "93535c3ceb4764f16aa7316990eba61d",
"score": "0.590532",
"text": "def destroy\n @ruleset = Ruleset.find(params[:ruleset_id])\n @rule = @ruleset.rules.find(params[:id])\n @rule.destroy\n\n respond_to do |format|\n format.html { redirect_to ruleset_rules_url(@ruleset) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "ea36a1377335d871c300d058edffec8d",
"score": "0.5878232",
"text": "def remove_policy(_sec, _ptype, _rule); end",
"title": ""
},
{
"docid": "7ae62948e95803cde76a7d554e382ea5",
"score": "0.58578366",
"text": "def destroy\n @rule = Rule.find(params[:id])\n consumer = @rule.consumer\n @rule.remove\n\n redirect_to consumer_rules_path(\n consumer.id,\n :notify => 'update_rule', \n :status => 'success', \n :update => 'removed')\n end",
"title": ""
},
{
"docid": "3cb0e5477b06d6aa77a5931ce5e1d00f",
"score": "0.5854508",
"text": "def delete_rule(type)\n find(:xpath, \"//ol[@id='#{type}-rules']//li[1]/a[3]\").click\n Log.debug(\"delete a rule\")\n end",
"title": ""
},
{
"docid": "2c4e658c7ba2cfb0a90d27456d19c968",
"score": "0.5804156",
"text": "def test_should_remove_defined_rule\n assert SmartMonth::Rulesets.remove_rule(\"Christmas\")\n assert !Month.december.respond_to?(:christmas)\n assert !Month.december.first.respond_to?(:is_christmas?)\n end",
"title": ""
},
{
"docid": "97b2d18f171817ab7268eac71abd6d7d",
"score": "0.5794841",
"text": "def remove_exrule(ruby_value)\n self.exrule_property.delete(RiCal::PropertyValue::RecurrenceRule.convert(self, ruby_value))\n end",
"title": ""
},
{
"docid": "4dfa736aa40f97152f1da5ef11cce029",
"score": "0.57646215",
"text": "def clear_synonym\n return unless synonym\n\n names = synonyms\n\n # Get rid of the synonym if only one's going to be left in it.\n if names.count <= 2\n synonym&.destroy\n names.each do |n|\n n.synonym = nil\n n.save\n end\n\n # Otherwise, just detach this name.\n else\n self.synonym = nil\n save\n end\n\n # This has to apply to names that are misspellings of this name, too.\n Name.where(correct_spelling: self).find_each do |n|\n n.correct_spelling = nil\n n.save\n end\n end",
"title": ""
},
{
"docid": "9f505e6d5e1de193e5278f2fc05612d7",
"score": "0.5764212",
"text": "def clear_synonym\n return unless synonym_id\n names = synonyms\n\n # Get rid of the synonym if only one going to be left in it.\n if names.length <= 2\n synonym.destroy\n names.each do |n|\n n.synonym_id = nil\n # n.accepted_name = n\n n.save\n end\n\n # Otherwise, just detach this name.\n else\n self.synonym_id = nil\n save\n end\n\n # This has to apply to names that are misspellings of this name, too.\n Name.where(correct_spelling: self).each do |n|\n n.update_attribute!(correct_spelling: nil)\n end\n end",
"title": ""
},
{
"docid": "5e0688e5780b2677e994446757050bf9",
"score": "0.57594764",
"text": "def rule(rule, replacement, target)\n @uncountables.delete(rule)\n @uncountables.delete(replacement)\n target.insert(0, [rule, replacement])\n end",
"title": ""
},
{
"docid": "2abd76dea62667a452f23bdaec6ef3ab",
"score": "0.5712286",
"text": "def destroy\n @rule = Rule.find(params[:id])\n @rule.destroy\n\n respond_to do |format|\n format.html { redirect_to rules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2abd76dea62667a452f23bdaec6ef3ab",
"score": "0.5712286",
"text": "def destroy\n @rule = Rule.find(params[:id])\n @rule.destroy\n\n respond_to do |format|\n format.html { redirect_to rules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "2abd76dea62667a452f23bdaec6ef3ab",
"score": "0.5712286",
"text": "def destroy\n @rule = Rule.find(params[:id])\n @rule.destroy\n\n respond_to do |format|\n format.html { redirect_to rules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a97040bd38f670ae461f6687788054ce",
"score": "0.570633",
"text": "def destroy\n @rule = Rule.find(params[:id])\n @rule.destroy\n\n respond_to do |format|\n format.html { redirect_to(rules_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a97040bd38f670ae461f6687788054ce",
"score": "0.570633",
"text": "def destroy\n @rule = Rule.find(params[:id])\n @rule.destroy\n\n respond_to do |format|\n format.html { redirect_to(rules_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f764ebebea457c0f04f8845e3b50961a",
"score": "0.5704919",
"text": "def remove_rule(shape)\n\t\t\thidden_entities = shape.receive_erased_entites()\n\t\t\thidden_entities.each { |ent| ent.layer = @solution_layer }\n\t\t\tController::remove_shape(shape, true)\n\t\t\treturn true\n\t\tend",
"title": ""
},
{
"docid": "1b4f7290cfcc450714b8d86825086186",
"score": "0.5697164",
"text": "def destroy\n @attribute_rule.destroy\n respond_to do |format|\n format.html { redirect_to attribute_rules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "cc74315ac00ed3f09bf723c5b4122ce4",
"score": "0.56854415",
"text": "def undelete\n @rules_rule = Rules::Rule.find(params[:id])\n @rules_rule._deleted = false\n @rules_rule.active = false\n @rules_rule.updated_actions << \"Undeleted\"\n @rules_rule.save!\n redirect_to rules_rule_path(@rules_rule)\n end",
"title": ""
},
{
"docid": "9a30857cc0c86d55783a9c8edaba2f25",
"score": "0.56834745",
"text": "def delete(rule_name, rule_node, old_value)\n update(rule_name, rule_node, old_value, nil)\n end",
"title": ""
},
{
"docid": "95dc595f793f729ccfcbdcde679daf44",
"score": "0.56661946",
"text": "def remove_exception_rule(rule)\n raise ArgumentError.new('Argument must be a valid rule') unless rule.class < Rule\n deletions = []\n @exrule_occurrence_heads.delete_if { |h| deletions << h.rule if h.rule == rule }\n deletions\n end",
"title": ""
},
{
"docid": "f1e135d05e53bca36b335eb41fc671c5",
"score": "0.56453043",
"text": "def cleanup(rule_name, info)\n\t\tif info.has_key?('remove') && info.has_key?('cleaner')\n\t\t\tcase info['cleaner']\n\t\t\twhen /port.?forward/i\n\t\t\t\tportForwardCleanUp(rule_name, info['remove'])\n\t\t\twhen /access.?control/i\n\t\t\t\taccessControlCleanUp(rule_name, info['remove'])\n\t\t\twhen /static.?nat/i\n\t\t\t\tstaticNatCleanUp(rule_name, info['remove'])\n when /port.?trigger/i\n port_triggering_cleanup(rule_name, \"all\")\n when /qos|quality.?of.?service/i\n qos_cleanup(rule_name, \"all\")\n\t\t\tend\n\t\telse\n\t\t\tself.msg(rule_name, :error, 'Clean Up', 'No \\\"Remove\\\" and/or \\\"Cleaner\\\" key for rule.')\n\t\t\treturn\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3566cf98dc7ae7d6bd795c5781ae37d4",
"score": "0.56440985",
"text": "def destroy\n @rule.destroy\n respond_to do |format|\n format.html { redirect_to admin_prize_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8f5626d3ef2f099b2999043d18cae5cd",
"score": "0.5640831",
"text": "def destroy\n @rule.destroy\n respond_to do |format|\n format.html { redirect_to rules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "54bb588c8b6dac38df36ea2a8d3ea418",
"score": "0.5629842",
"text": "def destroy\n @rule.destroy\n respond_to do |format|\n format.html { redirect_to creator_game_path(@creator, @game), notice: 'Rule was successfully deleted.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4a803cb7e382da39ada50cbb71f85170",
"score": "0.5628975",
"text": "def remove_rrule(ruby_value)\n self.rrule_property.delete(RiCal::PropertyValue::RecurrenceRule.convert(self, ruby_value))\n end",
"title": ""
},
{
"docid": "4a803cb7e382da39ada50cbb71f85170",
"score": "0.5628975",
"text": "def remove_rrule(ruby_value)\n self.rrule_property.delete(RiCal::PropertyValue::RecurrenceRule.convert(self, ruby_value))\n end",
"title": ""
},
{
"docid": "13cccefa557ca4f0aa5c2fd2b0138091",
"score": "0.56251794",
"text": "def delete_sql_server_firewall_rule(server_name, rule_name)\n if !list_sql_server_firewall_rules(server_name).collect{|x| x[:rule]}.include?(rule_name)\n error = \"The specified firewall rule #{rule_name} does not exist.\"\n raise error\n elsif get_sql_server(server_name)\n request_path = \"/servers/#{server_name}/firewallrules/#{rule_name}\"\n request = BaseManagement::SqlManagementHttpRequest.new(:delete, request_path)\n request.call\n Azure::Loggerx.info \"Deleted server-level firewall rule #{rule_name}.\"\n end\n end",
"title": ""
},
{
"docid": "9c5993da6b71c2b31c0ebc48d662e37c",
"score": "0.5623872",
"text": "def closeRuleset()\r\n\t\tif (processingRuleset?)\r\n\t\t\trsAlias = @curRuleset.alias\r\n\t\t\t@context.rulesets[rsAlias] = @curRuleset\r\n\t\tend\t# if\r\n\r\n\t\t@curRuleset = nil\t\t\r\n\t\t\r\n\tend",
"title": ""
},
{
"docid": "d2be8be77acaaa758b4b99ac6155a3de",
"score": "0.562356",
"text": "def destroy\n @access_rule = AccessRule.find(params[:id])\n @access_rule.destroy\n\n respond_to do |format|\n format.html { redirect_to(access_rules_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fbcb14bcfdecb03f50296ac93cf65ab1",
"score": "0.56133145",
"text": "def munge_rule(rule, rule_number, title)\n rule['id'] = \"#{title}-rule-#{rule_number}\" unless rule['id']\n rule['boolean-op'] = 'or' unless rule['boolean-op']\n rule['score'].gsub! 'inf', 'INFINITY' if rule['score']\n if rule['expressions']\n unless rule['expressions'].is_a? Array\n expressions_array = []\n expressions_array << rule['expressions']\n rule['expressions'] = expressions_array\n end\n expression_number = 0\n rule['expressions'].each do |expression|\n unless expression['id']\n expression['id'] = \"#{title}-rule-#{rule_number}-expression-#{expression_number}\"\n end\n expression_number += 1\n end\n end\n rule\n end",
"title": ""
},
{
"docid": "dfedcf444916efe155b89df8e737751c",
"score": "0.56131715",
"text": "def rule\n @rule ||= reload_rule\n end",
"title": ""
},
{
"docid": "dfedcf444916efe155b89df8e737751c",
"score": "0.56131715",
"text": "def rule\n @rule ||= reload_rule\n end",
"title": ""
},
{
"docid": "6d95d54b86262f9dd0c263dfc6deead0",
"score": "0.56039333",
"text": "def destroy\n @ruleset = Ruleset.find(params[:id])\n @ruleset.destroy\n\n respond_to do |format|\n format.html { redirect_to rulesets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6ae97340d2a0c5ad6ef28dc8d2a60a9e",
"score": "0.55930996",
"text": "def clear_rules\n @rules.clear\n end",
"title": ""
},
{
"docid": "87572c295580dcb5b3b5b12017dcb5d1",
"score": "0.5580016",
"text": "def rule(rule, replacement, target)\n uncountables.delete(rule)\n uncountables.delete(replacement)\n\n target.insert(0, [rule, replacement])\n end",
"title": ""
},
{
"docid": "1fa4b0f4cb7ba5558f4ca4f084310e8d",
"score": "0.5562513",
"text": "def destroy\n\n @rule.destroy\n respond_to do |format|\n format.html { redirect_to rules_url, notice: '删除成功!' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "e62f200a6f206496a02a04e6874b4e5b",
"score": "0.555639",
"text": "def decrement_rule_order\n target_rule_order = self.rule_order - 1\n self.move_rule(target_rule_order) unless target_rule_order <= 0\n end",
"title": ""
},
{
"docid": "0a9f5496dc1b201e5a5c44d7d937e0aa",
"score": "0.5550077",
"text": "def destroy\n @rule.destroy\n respond_to do |format|\n format.html { redirect_to game_rules_path(@game), flash: { success: I18n.t('flash_messages.success.destroyed', model: I18n.t('model.rule')) } }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "213f9d0c86cc447074f199df1ea932d1",
"score": "0.55374193",
"text": "def destroy\n @rule = Rule.find(params[:id])\n checkaccountobject(\"rules\",@rule)\n @rule.send_delete\n respond_to do |format|\n format.html { redirect_to rules_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8a7192aef4108f788ae88951d956ab63",
"score": "0.55235827",
"text": "def destroy\n @assessment_rule = AssessmentRule.find(params[:id])\n @assessment_rule.destroy\n\n respond_to do |format|\n format.html { redirect_to assessment_rules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5f86bd4f3e2409e72438dc5e34cdd04b",
"score": "0.5522811",
"text": "def destroy\n @rule.destroy\n respond_to do |format|\n format.html { redirect_to rules_url, notice: 'Regel gelöscht.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1b75bd443553aedf3858e69125b8708c",
"score": "0.5513929",
"text": "def update\n @rule = Rule.find(params[:id])\n @rule.name = params[:rule_name]\n\n @rule.part_of_rules.clear\n\n create_part_of_rules\n\n respond_to do |format|\n if @rule.update_attributes(params[:rule])\n format.html { redirect_to @rule, notice: 'Regel wurde erfolgreich aktualisiert.' }\n format.json { head :no_content }\n else\n save_failed\n format.html { render action: \"edit\" }\n format.json { render json: @rule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a5b89cdda62e71dcfd0fb1e4af098289",
"score": "0.551169",
"text": "def remove_exception_rule(rule)\n res = @all_exception_rules.delete(rule)\n res.nil? ? [] : [res]\n end",
"title": ""
},
{
"docid": "a5b89cdda62e71dcfd0fb1e4af098289",
"score": "0.551169",
"text": "def remove_exception_rule(rule)\n res = @all_exception_rules.delete(rule)\n res.nil? ? [] : [res]\n end",
"title": ""
},
{
"docid": "810b6aea12718b3e334ea256d60f2e17",
"score": "0.5509349",
"text": "def enter_rule(grammar_file, rule_name)\n # do nothing\n end",
"title": ""
},
{
"docid": "a18b8393201dcce9c3a3b534055b1beb",
"score": "0.55019706",
"text": "def destroy\r\n @cargo_rule = CargoRule.find(params[:id])\r\n @cargo_rule.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to cargo_rules_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "de0b869022e44b64077180b379ffa6db",
"score": "0.5490098",
"text": "def destroy\n @rule.destroy\n respond_to do |format|\n format.html { redirect_to rules_url, notice: 'Rule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "de0b869022e44b64077180b379ffa6db",
"score": "0.5490098",
"text": "def destroy\n @rule.destroy\n respond_to do |format|\n format.html { redirect_to rules_url, notice: 'Rule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "de0b869022e44b64077180b379ffa6db",
"score": "0.5490098",
"text": "def destroy\n @rule.destroy\n respond_to do |format|\n format.html { redirect_to rules_url, notice: 'Rule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "de0b869022e44b64077180b379ffa6db",
"score": "0.5490098",
"text": "def destroy\n @rule.destroy\n respond_to do |format|\n format.html { redirect_to rules_url, notice: 'Rule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "de0b869022e44b64077180b379ffa6db",
"score": "0.5490098",
"text": "def destroy\n @rule.destroy\n respond_to do |format|\n format.html { redirect_to rules_url, notice: 'Rule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "62a2204eb34566e2e7d606dcc10920d2",
"score": "0.54896206",
"text": "def destroy\n @business_rule = BusinessRule.find(params[:id])\n @business_rule.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_business_rules_path }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "713c9374b8ed791bd6e7240f68569eaf",
"score": "0.5488322",
"text": "def ignorable_at_rule(at_rule)\n end",
"title": ""
},
{
"docid": "00c064889d8d5ec8a9836b549abf2c0b",
"score": "0.5483897",
"text": "def check_and_remove_blank_in_rule(rule_without_code:)\n errors.add(:rule_string, 'cannot contain white space') if rule_without_code.match(REGEX_GET_SPACE)\n rule_without_code.gsub(REGEX_GET_SPACE, '')\n end",
"title": ""
},
{
"docid": "5b52ed7cc6a8c144d258498c68dd749d",
"score": "0.54500735",
"text": "def remove_rule request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_remove_rule_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::Compute::V1::Operation.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "7bf1db9f2af6a6057ba837c3247defa2",
"score": "0.54471534",
"text": "def destroy\n @academic_rule = AcademicRule.find(params[:id])\n @academic_rule.destroy\n\n respond_to do |format|\n format.html { redirect_to academic_rules_url, :notice => 'Regra acadêmica excluída com sucesso.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0340f954700aed1ef187b73f40ac2982",
"score": "0.54293185",
"text": "def destroy\n @rule.destroy\n respond_to do |format|\n format.html { redirect_to @game, notice: 'Rule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "653e9cc31933a984082d77bdcf20cc02",
"score": "0.5421945",
"text": "def destroy\n @rules_rule = Rules::Rule.find(params[:id])\n @rules_rule.destroy\n\n respond_to do |format|\n format.html { redirect_to (params[:event].presence ? rules_event_rules_url(event: params[:event]) : rules_rules_url) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f2cefe48f0a887644f55b535ded408cf",
"score": "0.54174674",
"text": "def revoke_rule(group, rule)\n case rule.direction\n when :in\n group.revoke_ingress(rule.protocol, rule.ports, *rule.sources)\n when :out\n group.revoke_egress(*rule.sources, :protocol => rule.protocol, :ports => rule.ports)\n else\n group.revoke_ingress(rule.protocol, rule.ports, *rule.sources)\n group.revoke_egress(*rule.sources, :protocol => rule.protocol, :ports => rule.ports)\n end\n end",
"title": ""
},
{
"docid": "3a126da1dd13a6049545531ea2e74914",
"score": "0.54116213",
"text": "def closeRule()\r\n end",
"title": ""
},
{
"docid": "59f8e468f5e5c7e100c9fb9707159d9c",
"score": "0.5407846",
"text": "def destroy\n @actionrulelink = Actionrulelink.find(params[:id])\n @actionrulelink.destroy\n\n respond_to do |format|\n format.html { redirect_to(actionrulelinks_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "40976806921e00387086e97f3a9f963d",
"score": "0.53990364",
"text": "def destroy\n @rulemaking = Rulemaking.find(params[:id])\n @rulemaking.destroy\n\n respond_to do |format|\n format.html { redirect_to(rulemakings_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6e150acbc462afde89bb1069e35aacba",
"score": "0.53828776",
"text": "def destroy1\n @rule = Rule.find(params[:id])\n @rule.destroy\n\n respond_to do |format|\n format.html { redirect_to(rules_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8defd42c4a928b3e44092911867b3330",
"score": "0.53812885",
"text": "def delete\n raise \"No chain on rule - cant identify it.\" if !@data.key?(:chain)\n raise \"No chain-number on rule - cant identify it.\" if !@data.key?(:no)\n \n begin\n if @data[:chain] == :prerouting\n cmd = \"iptables -t nat\"\n else\n cmd = \"iptables\"\n end\n \n cmd << \" -D #{@data[:chain].to_s.upcase} #{@data[:no]}\"\n \n Knj::Os.shellcmd(cmd)\n rescue\n puts \"CMD: #{cmd}\\n\"\n Knj.p @data\n raise\n end\n end",
"title": ""
},
{
"docid": "b21c02ace83448d82e866e8bf3da0e9e",
"score": "0.53719795",
"text": "def destroy\n @rule.destroy\n respond_to do |format|\n format.html { redirect_to edit_category_path(id: @rule.category_id) }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d287618dc3d054dd727ee5581638939e",
"score": "0.5367022",
"text": "def remove_unused_rules\n # Deletes all rules with \"#zero\" in the name\n start_time = Time.now\n deleted_cnt = 0\n puts \"------>> Removing unused rules(tagged with #zero) (~1s)\"\n print \"Looking for unused rules(~0s) . . . \" \n rules_for_deletetion = Array.new\n @policy_handler.rules.each do |rule|\n if rule.name.match(/#zero/)\n rules_for_deletetion.push rule\n end\n end\n puts \"OK! - #{Time.now - start_time}s\"\n\n start_time = Time.now \n print \"Removing unused rules(~1s) . . . \"\n rules_for_deletetion.each do |rule|\n if @policy_handler.delete_rule rule.index\n deleted_cnt +=1\n end\n end\n puts \"OK! - #{Time.now - start_time}s - #{deleted_cnt} objects deleted \"\n end",
"title": ""
},
{
"docid": "c66a8325194983c9b971ae740ebb702c",
"score": "0.5338998",
"text": "def destroy\n @action_rule.destroy\n respond_to do |format|\n format.html { redirect_to [project, action_chain], notice: 'Action rule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3e96b5558117be481a9171402f32d294",
"score": "0.5333683",
"text": "def remove_synonym(name)\n execute \"DROP SYNONYM #{quote_table_name(name)}\"\n end",
"title": ""
},
{
"docid": "f5f45a00a3dd08044c43871f13ff8d28",
"score": "0.53199685",
"text": "def rm\n Lesson.rm name\n end",
"title": ""
},
{
"docid": "a9813ca76bc010fbb26efecdc9183293",
"score": "0.5311838",
"text": "def remove_synonym(name)\n execute \"DROP SYNONYM #{quote_table_name(name)}\"\n end",
"title": ""
},
{
"docid": "dd9717fc727475e2147a2a669a377828",
"score": "0.5297727",
"text": "def destroy\n @validationrule = Validationrule.find(params[:id])\n @validationrule.destroy\n\n respond_to do |format|\n format.html { redirect_to(validationrules_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0f01141c37e499706fee6fd5a1d330f7",
"score": "0.52926123",
"text": "def delete_selling_manager_item_automation_rule(params = {})\n commit(Ebay::Requests::DeleteSellingManagerItemAutomationRule, params)\n end",
"title": ""
},
{
"docid": "cd7b138b7e37c28f4dc79c2792f70996",
"score": "0.5289503",
"text": "def destroy\n @special_rule.destroy\n respond_to do |format|\n format.html { redirect_to special_rules_url, notice: 'Special rule was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6b6a699245f0b9a53025187d842499ed",
"score": "0.52838284",
"text": "def destroy\n @special_rule.destroy\n respond_to do |format|\n format.html { redirect_to special_rules_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4b1f72b89a9e9eab85444af049b6a58c",
"score": "0.52804774",
"text": "def remove_oai_item_id\n #literal specifies that it should be in the form of...<oai:itemID>...</oai:itemID>\n self.remove_relationship :oai_item_id, OAI_ITEM_IDENTIFIER_NS + self.pid, :literal => true\n end",
"title": ""
},
{
"docid": "2326bac3f3533c56ca353417c30d49ed",
"score": "0.5278866",
"text": "def reset_use\n @current_rule_pack = nil\n end",
"title": ""
},
{
"docid": "13c4340b176c82eece74784a37f74041",
"score": "0.5274519",
"text": "def destroy\n @router_rule = RouterRule.find(params[:id])\n @router_rule.destroy\n\n respond_to do |format|\n format.html { redirect_to(router_rules_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
0ae5c1e9409bfc992e5f746a31db176d
|
Set the value of the Name input for this Choreo.
|
[
{
"docid": "556b2d3ed77dc127d19f7fa1a0d04847",
"score": "0.0",
"text": "def set_Name(value)\n set_input(\"Name\", value)\n end",
"title": ""
}
] |
[
{
"docid": "bd8df1d1ba74b7b21f005d968816a612",
"score": "0.7494862",
"text": "def set_Name(value)\n set_input(\"Name\", value)\n end",
"title": ""
},
{
"docid": "bd8df1d1ba74b7b21f005d968816a612",
"score": "0.7494862",
"text": "def set_Name(value)\n set_input(\"Name\", value)\n end",
"title": ""
},
{
"docid": "1a1ccb38a65c64bca202ea49d89b9410",
"score": "0.7330059",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "b7f652d72a0a466c0919e90fa7bcbf97",
"score": "0.73259443",
"text": "def set_name(name)\n @name = name\n end",
"title": ""
},
{
"docid": "1e69d6389e3d86a8d7972c217f26a3a6",
"score": "0.73251235",
"text": "def name=(name)\n if name.nil?\n fail ArgumentError, 'invalid value for \"name\", name cannot be nil.'\n end\n @name = name\n end",
"title": ""
},
{
"docid": "1e69d6389e3d86a8d7972c217f26a3a6",
"score": "0.73251235",
"text": "def name=(name)\n if name.nil?\n fail ArgumentError, 'invalid value for \"name\", name cannot be nil.'\n end\n @name = name\n end",
"title": ""
},
{
"docid": "1e69d6389e3d86a8d7972c217f26a3a6",
"score": "0.73251235",
"text": "def name=(name)\n if name.nil?\n fail ArgumentError, 'invalid value for \"name\", name cannot be nil.'\n end\n @name = name\n end",
"title": ""
},
{
"docid": "1e69d6389e3d86a8d7972c217f26a3a6",
"score": "0.73251235",
"text": "def name=(name)\n if name.nil?\n fail ArgumentError, 'invalid value for \"name\", name cannot be nil.'\n end\n @name = name\n end",
"title": ""
},
{
"docid": "1e69d6389e3d86a8d7972c217f26a3a6",
"score": "0.73251235",
"text": "def name=(name)\n if name.nil?\n fail ArgumentError, 'invalid value for \"name\", name cannot be nil.'\n end\n @name = name\n end",
"title": ""
},
{
"docid": "1e69d6389e3d86a8d7972c217f26a3a6",
"score": "0.73251235",
"text": "def name=(name)\n if name.nil?\n fail ArgumentError, 'invalid value for \"name\", name cannot be nil.'\n end\n @name = name\n end",
"title": ""
},
{
"docid": "1e69d6389e3d86a8d7972c217f26a3a6",
"score": "0.73251235",
"text": "def name=(name)\n if name.nil?\n fail ArgumentError, 'invalid value for \"name\", name cannot be nil.'\n end\n @name = name\n end",
"title": ""
},
{
"docid": "1e69d6389e3d86a8d7972c217f26a3a6",
"score": "0.73251235",
"text": "def name=(name)\n if name.nil?\n fail ArgumentError, 'invalid value for \"name\", name cannot be nil.'\n end\n @name = name\n end",
"title": ""
},
{
"docid": "1e69d6389e3d86a8d7972c217f26a3a6",
"score": "0.73251235",
"text": "def name=(name)\n if name.nil?\n fail ArgumentError, 'invalid value for \"name\", name cannot be nil.'\n end\n @name = name\n end",
"title": ""
},
{
"docid": "f9ae0f32e9925c91f6edf510cfdf422d",
"score": "0.72831744",
"text": "def name=(new_name)\n @name = new_name\n end",
"title": ""
},
{
"docid": "f9ae0f32e9925c91f6edf510cfdf422d",
"score": "0.72831744",
"text": "def name=(new_name)\n @name = new_name\n end",
"title": ""
},
{
"docid": "2093609ce711e94a585e703f94e17462",
"score": "0.7240264",
"text": "def set_name=(name)\n @name = name\n end",
"title": ""
},
{
"docid": "2093609ce711e94a585e703f94e17462",
"score": "0.7240264",
"text": "def set_name=(name)\n @name = name\n end",
"title": ""
},
{
"docid": "2093609ce711e94a585e703f94e17462",
"score": "0.7240264",
"text": "def set_name=(name)\n @name = name\n end",
"title": ""
},
{
"docid": "2093609ce711e94a585e703f94e17462",
"score": "0.7240264",
"text": "def set_name=(name)\n @name = name\n end",
"title": ""
},
{
"docid": "2093609ce711e94a585e703f94e17462",
"score": "0.7240264",
"text": "def set_name=(name)\n @name = name\n end",
"title": ""
},
{
"docid": "f9c8a1c1264a55c6a063b1740d60df44",
"score": "0.7229761",
"text": "def _name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7220395",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7220395",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7220395",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7220395",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7220395",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7220395",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7220395",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7220395",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7220395",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7220395",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7220357",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7220357",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7220357",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7220357",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7220357",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.722024",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.722024",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.722024",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.722024",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.722024",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219796",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219796",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219796",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219796",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219796",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219796",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219796",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219796",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219796",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219796",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219796",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219796",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219796",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219539",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219539",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219539",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219539",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219539",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219539",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219539",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219539",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219539",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219539",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219539",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219539",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219539",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219539",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219539",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7219539",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
},
{
"docid": "4b3f6a4b0c931070915e77d454da7bcd",
"score": "0.7218954",
"text": "def name=(value)\n @name = value\n end",
"title": ""
}
] |
f4fd3a2012baab763c47aa276fb7dc90
|
Abstract method that subclasses override to produce the content of the effective path. It should either succeed and return a String or fail with an exception.
|
[
{
"docid": "d131169e2614f4fcb5895d8c2492453b",
"score": "0.6269343",
"text": "def get_contents(effective_path)\n raise NotImplementedError.new\n end",
"title": ""
}
] |
[
{
"docid": "670816e28aa2c0fcc725897a7e12ffff",
"score": "0.64498395",
"text": "def to_s\n path\n end",
"title": ""
},
{
"docid": "398fb7809b9439849140d689ea3c45b6",
"score": "0.6403689",
"text": "def path() end",
"title": ""
},
{
"docid": "398fb7809b9439849140d689ea3c45b6",
"score": "0.6403689",
"text": "def path() end",
"title": ""
},
{
"docid": "398fb7809b9439849140d689ea3c45b6",
"score": "0.6403689",
"text": "def path() end",
"title": ""
},
{
"docid": "2f97c17320f7732a2bb6f3ba53216206",
"score": "0.6316913",
"text": "def to_s\n path\n end",
"title": ""
},
{
"docid": "44480cc45f4c81da0e9d8bbe11b7007b",
"score": "0.6311787",
"text": "def path\n s = ''\n s << '/' if @absolute\n s << @path.join('/')\n s << '/' if @trail\n s << '.' if s.empty?\n s\n end",
"title": ""
},
{
"docid": "392e513a918ded6d7d320467cc1cf6e0",
"score": "0.62108254",
"text": "def to_s\n if nesting\n to_relative_path\n elsif local\n to_local_path\n else\n to_absolute_path\n end\n end",
"title": ""
},
{
"docid": "232e7f3b388850a87d58378e156af75b",
"score": "0.6196544",
"text": "def to_s\n s = ''\n s << '/' if @absolute\n s << @path.join('/')\n s << '/' if @trail\n s << '.' if s.empty?\n s\n end",
"title": ""
},
{
"docid": "e90b9afd359000a07e2ca8742dc2b891",
"score": "0.61819065",
"text": "def path()\n\t\t\t\t@basePath + \"/\" + hierarchy().join( \"/\" )\n\t\t\tend",
"title": ""
},
{
"docid": "ee9a0d17a5d55fc6bcb982153af58de2",
"score": "0.61804867",
"text": "def to_s\n return \"\" if self.empty?\n @path.join(\":\")\n end",
"title": ""
},
{
"docid": "8780cc0ec2512892910dad8930065667",
"score": "0.6155261",
"text": "def to_s\n @path\n end",
"title": ""
},
{
"docid": "8780cc0ec2512892910dad8930065667",
"score": "0.6155261",
"text": "def to_s\n @path\n end",
"title": ""
},
{
"docid": "e1e7443ec803b3806f8a25383c02336a",
"score": "0.6073576",
"text": "def to_s\n @path.dup\n end",
"title": ""
},
{
"docid": "584aaf609ae12b30116865229a71392a",
"score": "0.6025211",
"text": "def path\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "f05cf6583946536a86fa5eb4f3923793",
"score": "0.6002427",
"text": "def path\r\n @pathname.to_s\r\n end",
"title": ""
},
{
"docid": "60038d708973e40f2d27c6c9f386eec3",
"score": "0.59872353",
"text": "def to_s\n return (@BasePath || \"\") + \"|\" + (@RelativePath || \"nil\")\n end",
"title": ""
},
{
"docid": "ccb227319f87c34a5d5badd68ea58ad4",
"score": "0.59857124",
"text": "def to_s\n @path\n end",
"title": ""
},
{
"docid": "d31996efe798a975697b766e4a48ffe8",
"score": "0.5985287",
"text": "def fullpath; end",
"title": ""
},
{
"docid": "5db237b7ee5f148e8c6bf54c3fece578",
"score": "0.5979007",
"text": "def build_path\n end",
"title": ""
},
{
"docid": "4485affd4eaa657c61c67ab5556635fc",
"score": "0.59762883",
"text": "def path\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "6cb810a8ea314a36581ee7a791e2a907",
"score": "0.59427166",
"text": "def to_s\n @path\n end",
"title": ""
},
{
"docid": "d7b980fa6abe06943d766f294458eb0f",
"score": "0.59418124",
"text": "def full_path; end",
"title": ""
},
{
"docid": "a4c0a6f7005c0c065f81547f0f17c2f0",
"score": "0.5941092",
"text": "def to_s\n '/' + @path.map { |part|\n if part.is_a? String\n part\n elsif part.is_a? Symbol\n part.inspect\n else\n fail \"Invalid path part: #{part}\"\n end\n }.join('/')\n end",
"title": ""
},
{
"docid": "7333158c38262983dcb2f25e705c5983",
"score": "0.5938809",
"text": "def to_s\n return '' if @path.empty?\n\n @path.map { |str| '/' + str.gsub(*ESCAPE) }.join\n end",
"title": ""
},
{
"docid": "64d2313157916bcf41098f17a76b5afe",
"score": "0.5931138",
"text": "def to_s\n @path\n end",
"title": ""
},
{
"docid": "8c74c75b5c3a0e6685783e57ed5f339c",
"score": "0.59240174",
"text": "def path\n @pathname.to_s\n end",
"title": ""
},
{
"docid": "7ad9e6009c0b6f2b8964dac4b50284a1",
"score": "0.5868272",
"text": "def path_str\n path.join(\"-\")\n end",
"title": ""
},
{
"docid": "4894d0cc3d5b5daa99a1d499b12e7ed3",
"score": "0.58632183",
"text": "def path\n return @path\n end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "5005dbbdce255b8ebe9266a7288728ea",
"score": "0.5860091",
"text": "def path; end",
"title": ""
},
{
"docid": "ff0841eb53eba2f5f96efba91da19e7e",
"score": "0.5844412",
"text": "def full_path\n path\n end",
"title": ""
},
{
"docid": "5b290d61f3293fdbf727c4765278800e",
"score": "0.58332735",
"text": "def path\n return @path\n end",
"title": ""
},
{
"docid": "5b290d61f3293fdbf727c4765278800e",
"score": "0.58332735",
"text": "def path\n return @path\n end",
"title": ""
},
{
"docid": "5b290d61f3293fdbf727c4765278800e",
"score": "0.58332735",
"text": "def path\n return @path\n end",
"title": ""
},
{
"docid": "7966dbacebfe10fab60f6901ed38e317",
"score": "0.5798521",
"text": "def to_s\n \"#<#{ self.class.name } name=#{ name.inspect } path=#{ path.to_s }>\"\n end",
"title": ""
},
{
"docid": "41b77e15d288d115b927611d44e71046",
"score": "0.5767204",
"text": "def path\n self.file.to_s\n end",
"title": ""
},
{
"docid": "0045cb21153ca6b7f133abb9b7924a69",
"score": "0.5766175",
"text": "def to_s\n return contentHost.locationDescriptor(baseDir)\n end",
"title": ""
},
{
"docid": "6e89403f397e18f3c23022ba95403d94",
"score": "0.57653135",
"text": "def path\n # FIXME: Do this without exception!\n #\"#{ @parent.path unless @parent == self }##{ ident }\"\n # rescue base path\n \"#{@parent.path rescue ''}##{ident}\"\n end",
"title": ""
},
{
"docid": "26db972c9635a8ae98a2e765d7423953",
"score": "0.5762343",
"text": "def path\n ensure_valid\n @path\n end",
"title": ""
},
{
"docid": "90fc57ad4013fcdcfd15c8f11205b860",
"score": "0.57614744",
"text": "def to_abs_path\n File.expand_path(self)\n end",
"title": ""
},
{
"docid": "b58281b6d93823b09a283fc7a35c1ef7",
"score": "0.5749761",
"text": "def compiled_path; end",
"title": ""
},
{
"docid": "36483824f06190b564700575c5980c19",
"score": "0.57405794",
"text": "def path_expanded path\n end",
"title": ""
},
{
"docid": "589e70749c24f4a76ef80061b2d291d9",
"score": "0.57381606",
"text": "def find\n \"#{content_path}#{clean_path}\"\n end",
"title": ""
},
{
"docid": "af255f42105f8ea17a73c9d8816dbf99",
"score": "0.5694922",
"text": "def full_path\n File.join(@path, @name)\n end",
"title": ""
},
{
"docid": "73c5dc1d4de07808f44bc41fe7cf465c",
"score": "0.5683146",
"text": "def inspect\n \"#<Path #{@path}>\"\n end",
"title": ""
},
{
"docid": "214ef01f62482dc95c0fcb4925b7fbda",
"score": "0.5675708",
"text": "def effective(p)\n\t\t\tp = if(p.is_a?(Pathname)) then p else Pathname.new(p) end\n\t\t\tif(p.absolute?) then p else @root + p end\n\t\tend",
"title": ""
},
{
"docid": "c34b106a3b2db2d201fcf584df460f1c",
"score": "0.5671504",
"text": "def file_path; end",
"title": ""
},
{
"docid": "7831ba0661be45c2543cf0e8ff15c3e9",
"score": "0.5649815",
"text": "def original_fullpath; end",
"title": ""
},
{
"docid": "c20ad8060ed0b7548dd1c6ac52844149",
"score": "0.56313723",
"text": "def path\n @path\n end",
"title": ""
},
{
"docid": "c20ad8060ed0b7548dd1c6ac52844149",
"score": "0.56313723",
"text": "def path\n @path\n end",
"title": ""
},
{
"docid": "ee307db2780f8616d145d5bcb1561d6e",
"score": "0.5613695",
"text": "def output_path; end",
"title": ""
},
{
"docid": "0de57d828b71a2413f15a92244a2ddb4",
"score": "0.5612677",
"text": "def path\n end",
"title": ""
},
{
"docid": "0de57d828b71a2413f15a92244a2ddb4",
"score": "0.5612677",
"text": "def path\n end",
"title": ""
},
{
"docid": "0de57d828b71a2413f15a92244a2ddb4",
"score": "0.5612677",
"text": "def path\n end",
"title": ""
},
{
"docid": "eb998232913bd1818f1a59d262dff31f",
"score": "0.5611577",
"text": "def path\n raise NotImplementedError.new(\"path() must be implemented by subclasses of AbstractVersionedFile.\")\n end",
"title": ""
},
{
"docid": "288fee3ad084f7bc9a288ba5c464194a",
"score": "0.5602231",
"text": "def path\n Pathname(@path.respond_to?(:to_path) ? @path.to_path : @path.to_s).expand_path\n end",
"title": ""
},
{
"docid": "65d8c9a7ff20c6acc5ff203e94d3e46e",
"score": "0.55986124",
"text": "def path\n return if @file.blank?\n if is_path?\n File.expand_path(@file)\n elsif @file.respond_to?(:path) && !@file.path.blank?\n File.expand_path(@file.path)\n end\n end",
"title": ""
},
{
"docid": "c70e496f96dc167797ab717a2a46edc2",
"score": "0.5595458",
"text": "def path\n end",
"title": ""
},
{
"docid": "7cf2dd78220cd1994f3086f7fd494055",
"score": "0.5580019",
"text": "def path\n @path\n end",
"title": ""
},
{
"docid": "7cf2dd78220cd1994f3086f7fd494055",
"score": "0.5580019",
"text": "def path\n @path\n end",
"title": ""
},
{
"docid": "7cf2dd78220cd1994f3086f7fd494055",
"score": "0.5580019",
"text": "def path\n @path\n end",
"title": ""
},
{
"docid": "7cf2dd78220cd1994f3086f7fd494055",
"score": "0.5580019",
"text": "def path\n @path\n end",
"title": ""
},
{
"docid": "a41115ca68dabd12177de21d42f396c7",
"score": "0.5573081",
"text": "def path\n @filename\n end",
"title": ""
},
{
"docid": "731d1d59ffa45c60112c27e9f4512dbc",
"score": "0.55703086",
"text": "def to_s\n logical_path.to_s\n end",
"title": ""
},
{
"docid": "eedef77e0e57dbed8507118ee6298496",
"score": "0.5564441",
"text": "def path\n @path\n end",
"title": ""
},
{
"docid": "eedef77e0e57dbed8507118ee6298496",
"score": "0.5564441",
"text": "def path\n @path\n end",
"title": ""
},
{
"docid": "eedef77e0e57dbed8507118ee6298496",
"score": "0.5564441",
"text": "def path\n @path\n end",
"title": ""
},
{
"docid": "eedef77e0e57dbed8507118ee6298496",
"score": "0.5564441",
"text": "def path\n @path\n end",
"title": ""
}
] |
0c80708ca8f91c930bd6c4b50bed425b
|
Combine any legacy options into a single global overlay and create new bit collection to track any bitwise overlays.
|
[
{
"docid": "9752db98e9a9c703408518340f8d6c06",
"score": "0.54773116",
"text": "def extract_overlay_data(reg_or_val, size, options = {})\n if reg_or_val.respond_to?(:data)\n ovl = reg_or_val.dup\n else\n ovl = Reg.dummy(size)\n end\n\n if options[:overlay]\n global = options[:overlay_label]\n elsif options.key?(:arm_debug_overlay) # prob don't need this anymore\n global = options[:arm_debug_overlay] # prob don't need this anymore\n else\n global = nil\n end\n\n [global, ovl]\n end",
"title": ""
}
] |
[
{
"docid": "3820f134428f28f403a3f344345b50a7",
"score": "0.6088688",
"text": "def combine_opts\n result = 0\n flags.each { |f| result |= f }\n\n result\n end",
"title": ""
},
{
"docid": "55c478f931068c9e53db611cd1e56065",
"score": "0.55061555",
"text": "def composite(overlay = T.unsafe(nil), mask: T.unsafe(nil), mode: T.unsafe(nil), gravity: T.unsafe(nil), offset: T.unsafe(nil), args: T.unsafe(nil), **options, &block); end",
"title": ""
},
{
"docid": "31129a06001a98ea0e118a5e8666d2c5",
"score": "0.5464927",
"text": "def overlay(options = {}); end",
"title": ""
},
{
"docid": "198870d329785067ff6d2b583db95a9b",
"score": "0.54377335",
"text": "def merge(new_options); end",
"title": ""
},
{
"docid": "604df96d1703798922c8e8cab322ab1d",
"score": "0.53779405",
"text": "def overlay(options = {})\r\n end",
"title": ""
},
{
"docid": "604df96d1703798922c8e8cab322ab1d",
"score": "0.53779405",
"text": "def overlay(options = {})\r\n end",
"title": ""
},
{
"docid": "5ce6d91d937c609c0bc3ed5fd029105e",
"score": "0.53474677",
"text": "def overlay(options = {})\n end",
"title": ""
},
{
"docid": "5ce6d91d937c609c0bc3ed5fd029105e",
"score": "0.53474677",
"text": "def overlay(options = {})\n end",
"title": ""
},
{
"docid": "924a1e563e9b7456528b9cfdf22c4ab2",
"score": "0.5256798",
"text": "def merge_options(old_ops, new_ops)\n return unless new_ops\n # Do size first\n old_ops[:size] *= new_ops[:size] if new_ops[:size]\n new_ops.each do |key, value|\n case key\n when :size\n when :x, :y\n old_ops[key] = value * old_ops[:size]\n when :rotation\n old_ops[key] = value * (Math::PI / 180.0)\n when :hue, :saturation, :brightness, :alpha\n adjusted = old_ops[:color].dup\n adjusted[HSB_ORDER[key]] *= value\n old_ops[:color] = adjusted\n when :flip\n old_ops[key] = !old_ops[key]\n when :width, :height\n old_ops[key] *= value\n when :color\n old_ops[key] = value\n else # Used a key that we don't know about or trying to set\n merge_unknown_key(key, value, old_ops)\n end\n end\n end",
"title": ""
},
{
"docid": "031f9829da55411e8d53bb816999d40a",
"score": "0.52439475",
"text": "def common_options(opts); end",
"title": ""
},
{
"docid": "678de247dab7364abfac0dbe021616a1",
"score": "0.5241071",
"text": "def with_implied_options(opts)\n res = opts.dup\n res[:completeness] ||= res[:auto_close]\n res[:prevent_overlap] ||= res[:completeness]\n res[:inclusion] ||= res[:completeness]\n res\n end",
"title": ""
},
{
"docid": "69497f8447b6c13d664d95e5954400ff",
"score": "0.5240385",
"text": "def global_flags\n return if class_options.empty?\n\n all_options = ''\n class_options.each do |key, val|\n all_options << '[' + val.switch_name\n all_options << (!val.aliases.empty? ? ('|' + val.aliases.join('|')) : '')\n all_options << '] '\n end\n all_options\n end",
"title": ""
},
{
"docid": "69497f8447b6c13d664d95e5954400ff",
"score": "0.5240385",
"text": "def global_flags\n return if class_options.empty?\n\n all_options = ''\n class_options.each do |key, val|\n all_options << '[' + val.switch_name\n all_options << (!val.aliases.empty? ? ('|' + val.aliases.join('|')) : '')\n all_options << '] '\n end\n all_options\n end",
"title": ""
},
{
"docid": "19004ad5a0ba15aa4000a2c374a14e81",
"score": "0.5229698",
"text": "def merge_computation_options!(options)\n {\n :force => false\n }.merge(options)\n end",
"title": ""
},
{
"docid": "6a946c7e2742b51d2a0d99c3d16f0a1b",
"score": "0.51856905",
"text": "def with_deprecated_support\n current = AridCache.raw_with_options\n yield\n AridCache.raw_with_options = !!current\n yield\n AridCache.raw_with_options = current\n end",
"title": ""
},
{
"docid": "cfb9373a62a7dce65974573858bb3ae2",
"score": "0.51338917",
"text": "def merge(opts); end",
"title": ""
},
{
"docid": "9d40b2c2cb781f91569932d3229e7377",
"score": "0.5127027",
"text": "def add_global_flag(*flags)\n options = flags.pop if flags.last.is_a?(Hash)\n flags = flags.flatten\n @pipeline[0] = add_global_flag_to_node(@pipeline[0], flags)\n end",
"title": ""
},
{
"docid": "908dc09e3804de575792b4fd9ba8d39e",
"score": "0.5096076",
"text": "def add_options legacy_categories\n [legacy_categories].flatten(1).each do |sub_key|\n case sub_key\n when ::Symbol\n add_config! sub_key, Config.new\n when ::Hash\n sub_key.each do |k, v|\n add_config! k, Config.new(v)\n end\n else\n raise ArgumentError \"Category must be a Symbol or Hash\"\n end\n end\n end",
"title": ""
},
{
"docid": "f9d03eb0954f9fd188eda55bdba740b5",
"score": "0.5093776",
"text": "def register_flags!\n answers_with_registered_flags = answers\n answers_with_registered_flags[:feature_flags] ||= StringifyHash.new\n new_flags = answers_with_registered_flags[:feature_flags]\n\n FLAGS.each do |flag|\n key = canonical_key(flag)\n value = flag?(key)\n if !new_flags.include?(key) && !value.nil?\n new_flags[key] = value\n end\n end\n\n options.merge!(\n :answers => answers_with_registered_flags\n ) if !new_flags.empty?\n\n options\n end",
"title": ""
},
{
"docid": "b734052ba9d3cca72565382f3db366bf",
"score": "0.50840175",
"text": "def composite\n [components + overrides].flatten.freeze\n end",
"title": ""
},
{
"docid": "47aca0472fc8ea997be28167c06ddac9",
"score": "0.50774735",
"text": "def common_options\n [\n :label, :pattern, :server, :secondary,\n ]\n end",
"title": ""
},
{
"docid": "97ae09612600a9290e30bc60da7d8499",
"score": "0.5071777",
"text": "def remerge_all_options\n @options = DEFAULT_OPTIONS.\n merge(@global_options).\n merge(@local_options).\n merge(@parsed_options)\n end",
"title": ""
},
{
"docid": "405fea18a4b1c44628508aeed3f63e98",
"score": "0.5067152",
"text": "def add_specific_options(opts)\n end",
"title": ""
},
{
"docid": "6f5dfe04bafe53a0825ad2bd7a75d829",
"score": "0.503847",
"text": "def merge(opts)\n dup.update(opts)\n end",
"title": ""
},
{
"docid": "236097dd8bfce4fa4dde6807ac281028",
"score": "0.5036623",
"text": "def create_collector_support\n odd_map = [0b11, 0b110, 0b1100, 0b11000, 0b10000] \n even_map = [0b1, 0b11, 0b110, 0b1100, 0b11000] \n \n all_odds = Array.new(0b100000)\n all_evens = Array.new(0b100000)\n bit_counts = Array.new(0b100000)\n new_regions = Array.new(0b100000)\n 0.upto(0b11111) do | i |\n bit_count = odd = even = 0\n 0.upto(4) do | bit |\n if (i[bit] == 1) then\n bit_count += 1\n odd |= odd_map[bit]\n even |= even_map[bit]\n end\n end\n all_odds[i] = odd\n all_evens[i] = even\n bit_counts[i] = bit_count\n new_regions[i] = create_regions( i)\n end\n\n @@converter = []\n 10.times { | row | @@converter.push((row % 2 == 0) ? all_evens : all_odds) }\n @@bit_counts = bit_counts\n @@regions = new_regions.collect { | set | set.collect { | value | [ value, bit_counts[value], value] } }\nend",
"title": ""
},
{
"docid": "95d43bdf6968b9c7810a1ca0e81ae4d5",
"score": "0.50024873",
"text": "def merged_options\n (new_resource.previous_options + [new_resource.options]).compact\n end",
"title": ""
},
{
"docid": "46298dc0a0c98596c78ef8c0ba79efaf",
"score": "0.50021946",
"text": "def overlay(source, options = {})\n self.dup.overlay!(source, options)\n end",
"title": ""
},
{
"docid": "3d3d8b2b53f7b3d08c06b2d25f9c2425",
"score": "0.4994814",
"text": "def _merge!(overlay)\n result = _merge(overlay)._dump\n _load(result)\n self\n end",
"title": ""
},
{
"docid": "3fd6933f272cea03a3c7069418cc29db",
"score": "0.49861333",
"text": "def merged_registry_options\n Chef::Mixin::DeepMerge.merge(resource_registry_options, machine_options_registry_options)\n end",
"title": ""
},
{
"docid": "78005ec6e7b0e5ce2f00da1623ada5de",
"score": "0.4977837",
"text": "def apply_overlay\n # TODO\n # @output.set_overlay\n end",
"title": ""
},
{
"docid": "bc21b6cfa8d5ee2b6a625d472324135a",
"score": "0.49598283",
"text": "def mask\n @_mask ||= if @version == 1\n [\n 0x08, 0x40, 0x80, 0x01, 0x20, 0x02, 0x04, 0x10, 0x04, 0x10, 0x01, 0x80,\n 0x08, 0x02, 0x40, 0x20, 0x40, 0x80, 0x08, 0x20, 0x04, 0x10, 0x02, 0x01,\n 0x02, 0x04, 0x10, 0x01, 0x80, 0x40, 0x20, 0x08, 0x80, 0x04, 0x02, 0x20,\n 0x01, 0x08, 0x10, 0x40, 0x01, 0x40, 0x04, 0x20, 0x10, 0x80, 0x08, 0x02,\n 0x10, 0x04, 0x08, 0x40, 0x20, 0x80, 0x01, 0x02, 0x20, 0x40, 0x08, 0x10,\n 0x01, 0x04, 0x02, 0x80\n ]\n else\n [\n 0x08, 0x40, 0x80, 0x01, 0x20, 0x02, 0x04, 0x10, 0x04, 0x10, 0x01, 0x80,\n 0x08, 0x02, 0x40, 0x20, 0x40, 0x80, 0x08, 0x20, 0x04, 0x10, 0x02, 0x01,\n 0x02, 0x04, 0x10, 0x01, 0x80, 0x40, 0x20, 0x08, 0x80, 0x04, 0x02, 0x20,\n 0x01, 0x08, 0x10, 0x40, 0x01, 0x40, 0x04, 0x20, 0x10, 0x80, 0x08, 0x02,\n 0x10, 0x04, 0x08, 0x40, 0x20, 0x80, 0x01, 0x02, 0x20, 0x40, 0x08, 0x10,\n 0x01, 0x04, 0x02, 0x80\n ]\n end\n end",
"title": ""
},
{
"docid": "5bc3f742308499edf6cc2a44da5ea142",
"score": "0.4950302",
"text": "def options_map\n\t\traw_options_map_to_soft_map( raw_options_map )\n\tend",
"title": ""
},
{
"docid": "e9953bb6508521e2fb2b1e73325205d6",
"score": "0.4947045",
"text": "def options\n [ all_option ] + other_options\n end",
"title": ""
},
{
"docid": "10d8a03accf49abb05ba19feeb4f4f2b",
"score": "0.49306595",
"text": "def build_bool_flags\n full_hash = {}\n temp = {}\n\n temp = {:short => '-c',\n :long => '--allow-cat',\n :desc => 'Filter out results that do NOT allow cats',\n :hash => :checkbox,\n :sym_hash => nil\n }\n\n full_hash[:pets_cat] = temp.clone\n\n temp = {:short => '-d',\n :long => '--allow-dog',\n :desc => 'Filter out results that do NOT allow dogs',\n :hash => :checkbox,\n :sym_hash => nil\n }\n\n full_hash[:pets_dog] = temp.clone\n\n temp = {:short => '-f',\n :long => '--furnished',\n :desc => 'Filter out results that are NOT furnished',\n :hash => :checkbox,\n :sym_hash => nil\n }\n\n full_hash[:is_furnished] = temp.clone\n\n temp = {:short => '-o',\n :long => '--output',\n :desc => 'Opens an interactive sesstion to specify output file',\n :hash => :query,\n :sym_hash => nil\n }\n\n full_hash[:output_file] = temp.clone\n\n temp = {:short => '-p',\n :long => '--has-pic',\n :desc => 'Only show results with a picture',\n :hash => :checkbox,\n :sym_hash => nil\n }\n\n full_hash[:hasPic] = temp.clone\n\n temp = {:short => '-q',\n :long => '--query QUERY',\n :desc => 'Search for results that include QUERY',\n :hash => :query,\n :sym_hash => nil\n }\n\n full_hash[:query] = temp.clone\n\n temp = {:short => '-s',\n :long => '--no-smoking',\n :desc => 'Filter out results that allow smoking',\n :hash => :checkbox,\n :sym_hash => nil\n }\n\n full_hash[:no_smoking] = temp.clone\n\n temp = {:short => '-t',\n :long => '--title-only',\n :desc => 'Search for query in title only',\n :hash => :query,\n :sym_hash => nil\n }\n\n full_hash[:srchType] = temp.clone\n\n temp = {:short => '-w',\n :long => '--wheelchair',\n :desc => 'Filter out results that are NOT wheelchair accessible',\n :hash => :checkbox,\n :sym_hash => nil\n }\n\n full_hash[:wheelchaccess] = temp.clone\n\n temp = {:short => nil,\n :long => '--nearby',\n :desc => 'Only show nearby results',\n :hash => :checkbox,\n :sym_hash => nil\n }\n\n full_hash[:searchNearby] = temp.clone\n\n temp = {:short => nil,\n :long => '--posted-today',\n :desc => 'Only show results posted today',\n :hash => :checkbox,\n :sym_hash => nil\n }\n\n full_hash[:postedToday] = temp.clone\n\n sym_hash = [{:apartment_1 => 'Apartment'},\n {:condo_2 => 'Condo'},\n {'cottage/cabin_3'.to_sym => 'Cottage/Cabin'},\n {:duplex_4 => 'Duplex'},\n {:flat_5 => 'Flat'},\n {:house_6 => 'House'},\n {'in-law_7'.to_sym => 'In-Law'},\n {:loft_8 => 'Loft'},\n {:townhouse_9 => 'Townhouse'},\n {:manufactured_10 => 'Manufactured'},\n {:assisted_living_11 => 'Assisted Living'},\n {:land_12 => 'Land'}\n ]\n\n temp = {:short => nil,\n :long => '--housing-type',\n :desc => 'Opens an interactive session to filter search results by housing type',\n :hash => :mult,\n :sym_hash => sym_hash.clone\n }\n\n full_hash[:housing_type] = temp.clone\n\n sym_hash = [{'w/d_in_unit_1'.to_sym => 'W/D in Unit'},\n {:laundry_in_bldg_2 => 'Laundry in Building'},\n {:laundry_on_site_3 => 'Laundry on Site'},\n {'w/d_hookups_4'.to_sym => 'W/D Hookups'},\n {:no_laundry_on_site_5 => 'No Laundry on Site'}\n ]\n\n temp = {:short => nil,\n :long => '--laundry',\n :desc => 'Opens an interactive session to filter search results by laundry options',\n :hash => :mult,\n :sym_hash => sym_hash.clone\n }\n\n full_hash[:laundry] = temp.clone\n\n sym_hash = [{:carport_1 => 'Carport'},\n {:attached_garage_2 => 'Attached Garage'},\n {:detached_garage_3 => 'Detached_Garage'},\n {'off-street_parking_4'.to_sym => 'Off-Street Parking'},\n {:street_parking_5 => 'Street Parking'},\n {:valet_parking_6 => 'Valet Parking'},\n {:no_parking_7 => 'No Parking'}\n ]\n\n temp = {:short => nil,\n :long => '--parking',\n :desc => 'Opens an interactive session to filter search results by parking options',\n :hash => :mult,\n :sym_hash => sym_hash.clone\n }\n\n full_hash[:parking] = temp.clone\n\n full_hash\n end",
"title": ""
},
{
"docid": "d12a83f898a28427b7c33c3af232828d",
"score": "0.4925129",
"text": "def roast_options\n @roast_options ||= %w[light regular dark]\n end",
"title": ""
},
{
"docid": "46e94575a66b1a8dead45d5aee91aaa9",
"score": "0.4924518",
"text": "def as_options\n mode = if copy_on_replace? then :copy\n else :drop\n end\n\n { :on_replace => mode, :once => once? }\n end",
"title": ""
},
{
"docid": "5fcc8fd809eb8b60e60ec43f640f62c8",
"score": "0.491751",
"text": "def extend_all!(experimental: false)\n add_flock_methods!\n\n extend_strings_and_symbols!\n\n return unless experimental\n\n array_shorthand!\n string_shorthand!\n symbol_shorthand!\n end",
"title": ""
},
{
"docid": "3e3074d3fd6c1a2a958cc6783687bfac",
"score": "0.49149066",
"text": "def build_common_options(opts, options, includes=[], excludes=[])\n #opts.separator \"\"\n # opts.separator \"Common options:\"\n option_keys = includes.clone\n all_option_keys = option_keys.dup\n # todo: support --quiet everywhere\n # turn on some options all the time..\n # unless command_name == \"shell\"\n # option_keys << :quiet unless option_keys.include?(:quiet)\n # end\n\n # ensure commands can always access options[:options], until we can deprecate it...\n options[:options] ||= {}\n\n while (option_key = option_keys.shift) do\n case option_key.to_sym\n\n when :tenant, :account\n # todo: let's deprecate this in favor of :tenant --tenant to keep -a reserved for --all perhaps?\n opts.on('--tenant TENANT', String, \"Tenant (Account) Name or ID\") do |val|\n options[:account] = val\n end\n opts.on('--tenant-id ID', String, \"Tenant (Account) ID\") do |val|\n options[:account_id] = val\n end\n # todo: let's deprecate this in favor of :tenant --tenant to keep -a reserved for --all perhaps?\n opts.on('-a','--account ACCOUNT', \"Alias for --tenant\") do |val|\n options[:account] = val\n end\n opts.on('-A','--account-id ID', \"Tenant (Account) ID\") do |val|\n options[:account_id] = val\n end\n opts.add_hidden_option('--tenant-id') if opts.is_a?(Morpheus::Cli::OptionParser)\n opts.add_hidden_option('-a, --account') if opts.is_a?(Morpheus::Cli::OptionParser)\n opts.add_hidden_option('-A, --account-id') if opts.is_a?(Morpheus::Cli::OptionParser)\n\n when :details\n opts.on('-a', '--all', \"Show all details.\" ) do\n options[:details] = true\n end\n opts.on('--details', '--details', \"Show more details\" ) do\n options[:details] = true\n end\n opts.add_hidden_option('--details')\n\n when :sigdig\n opts.on('--sigdig DIGITS', \"Significant digits to display for prices (currency). Default is #{default_sigdig}.\") do |val|\n options[:sigdig] = val.to_i\n end\n\n when :options\n options[:options] ||= {}\n opts.on( '-O', '--option OPTION', \"Option in the format -O field=\\\"value\\\"\" ) do |option|\n # todo: look ahead and parse ALL the option=value args after -O switch\n #custom_option_args = option.split('=')\n custom_option_args = option.sub(/\\s?\\=\\s?/, '__OPTION_DELIM__').split('__OPTION_DELIM__')\n custom_options = options[:options]\n option_name_args = custom_option_args[0].split('.')\n option_type = (options[:option_types] || []).find {|it| it['fieldName'] == custom_option_args[0]} || {}\n if option_name_args.count > 1\n nested_options = custom_options\n option_name_args.each_with_index do |name_element,index|\n if index < option_name_args.count - 1\n nested_options[name_element] = nested_options[name_element] || {}\n nested_options = nested_options[name_element]\n else\n val = custom_option_args[1]\n unless option_type['noParse']\n if (val.to_s[0] == '{' && val.to_s[-1] == '}') || (val.to_s[0] == '[' && val.to_s[-1] == ']')\n begin\n val = JSON.parse(val)\n rescue\n Morpheus::Logging::DarkPrinter.puts \"Failed to parse option value '#{val}' as JSON\" if Morpheus::Logging.debug?\n end\n end\n end\n nested_options[name_element] = val\n end\n end\n else\n val = custom_option_args[1]\n unless option_type['noParse']\n if (val.to_s[0] == '{' && val.to_s[-1] == '}') || (val.to_s[0] == '[' && val.to_s[-1] == ']')\n begin\n val = JSON.parse(val)\n rescue\n Morpheus::Logging::DarkPrinter.puts \"Failed to parse option value '#{val}' as JSON\" if Morpheus::Logging.debug?\n end\n end\n end\n custom_options[custom_option_args[0]] = val\n end\n # convert \"true\",\"on\" and \"false\",\"off\" to true and false\n unless options[:skip_booleanize]\n custom_options.booleanize!\n end\n options[:options] = custom_options\n end\n # --always-prompt can be used with for update commands where it normally defaults to --no-prompt\n opts.on('--prompt', \"Always prompt for input on every option, even those not prompted for by default.\") do\n options[:always_prompt] = true\n options[:options][:always_prompt] = true\n end\n opts.on('-N','--no-prompt', \"No prompt, skips all input prompting.\") do |val|\n options[:no_prompt] = true\n options[:options][:no_prompt] = true\n end\n # opts.on('--skip-prompt x,y,z', String, \"Skip prompt, do not prompt for input of the specified options.\") do |val|\n # options[:skip_prompt] ||= []\n # options[:skip_prompt] += parse_array(val)\n # options[:options][:skip_prompt] = options[:skip_prompt]\n # end\n # opts.on('--only-prompt x,y,z', String, \"Only prompt for input on the specified options.\") do |val|\n # options[:only_prompt] ||= []\n # options[:only_prompt] += parse_array(val)\n # options[:options][:only_prompt] = options[:only_prompt]\n # end\n opts.on('--no-options', String, \"No options, skips all option parsing so no options are required and no default values are used.\") do\n options[:no_options] = true\n options[:options][:no_options] = options[:no_options]\n end\n opts.on('--skip-options x,y,z', String, \"Skip parsing of the specified options so that they are not required and their default value is not used.\") do |val|\n options[:skip_options] ||= []\n options[:skip_options] += parse_array(val)\n options[:options][:skip_options] = options[:skip_options]\n end\n # opts.on('--only-options x,y,z', String, \"Only parse the specified options and skip all others.\") do |val|\n # options[:only_options] ||= []\n # options[:only_options] += parse_array(val)\n # options[:options][:only_options] = options[:only_options]\n # end\n \n # hide these while incubating\n opts.add_hidden_option('--skip-prompt')\n opts.add_hidden_option('--only-prompt')\n opts.add_hidden_option('--no-options')\n opts.add_hidden_option('--skip-options')\n opts.add_hidden_option('--only-options')\n\n when :payload\n opts.on('--payload FILE', String, \"Payload from a local JSON or YAML file, skip all prompting\") do |val|\n options[:payload_file] = val.to_s\n begin\n payload_file = File.expand_path(options[:payload_file])\n if !File.exist?(payload_file) || !File.file?(payload_file)\n raise ::OptionParser::InvalidOption.new(\"File not found: #{payload_file}\")\n #return false\n end\n if payload_file =~ /\\.ya?ml\\Z/\n options[:payload] = YAML.load_file(payload_file)\n else\n options[:payload] = JSON.parse(File.read(payload_file))\n end\n rescue => ex\n raise ::OptionParser::InvalidOption.new(\"Failed to parse payload file: #{payload_file} Error: #{ex.message}\")\n end\n end\n opts.on('--payload-dir DIRECTORY', String, \"Payload from a local directory containing 1-N JSON or YAML files, skip all prompting. This makes one request, merging all the files into a single payload.\") do |val|\n print_error yellow,\"[DEPRECATED] The option `--payload-dir` is deprecated and will be removed. Use `--payloads` to make requests for each file in a directory.\",reset,\"\\n\"\n options[:payload_dir] = val.to_s\n payload_dir = File.expand_path(options[:payload_dir])\n if !Dir.exist?(payload_dir) || !File.directory?(payload_dir)\n raise ::OptionParser::InvalidOption.new(\"Directory not found: #{payload_dir}\")\n end\n payload = {}\n begin\n merged_payload = {}\n payload_files = []\n payload_files += Dir[\"#{payload_dir}/*.json\"]\n payload_files += Dir[\"#{payload_dir}/*.yml\"]\n payload_files += Dir[\"#{payload_dir}/*.yaml\"]\n if payload_files.empty?\n raise ::OptionParser::InvalidOption.new(\"No .json/yaml files found in config directory: #{payload_dir}\")\n end\n payload_files.each do |payload_file|\n Morpheus::Logging::DarkPrinter.puts \"parsing payload file: #{payload_file}\" if Morpheus::Logging.debug?\n config_payload = {}\n if payload_file =~ /\\.ya?ml\\Z/\n config_payload = YAML.load_file(payload_file)\n else\n config_payload = JSON.parse(File.read(payload_file))\n end\n merged_payload.deep_merge!(config_payload)\n end\n options[:payload] = merged_payload\n rescue => ex\n raise ::OptionParser::InvalidOption.new(\"Failed to parse payload file: #{payload_file} Error: #{ex.message}\")\n end\n end\n opts.add_hidden_option('--payload-dir')\n opts.on('--payload-json JSON', String, \"Payload JSON, skip all prompting\") do |val|\n begin\n options[:payload] = JSON.parse(val.to_s)\n rescue => ex\n raise ::OptionParser::InvalidOption.new(\"Failed to parse payload as JSON. Error: #{ex.message}\")\n end\n end\n opts.on('--payload-yaml YAML', String, \"Payload YAML, skip all prompting\") do |val|\n begin\n options[:payload] = YAML.load(val.to_s)\n rescue => ex\n raise ::OptionParser::InvalidOption.new(\"Failed to parse payload as YAML. Error: #{ex.message}\")\n end\n end\n # --payloads test-data/item*.json\n opts.on('--payloads PATH', String, \"Payload(s) from one or more local JSON or YAML files, skip all prompting and execute the request 1-N times, once for each file. PATH can be a directory or a file pattern.\") do |val|\n # maybe use parse_array(val) to support csv..\n # find files matching PATH\n # todo: probably support recursive... can be done with '**/*.json' now though.\n if val.to_s.strip.empty?\n raise ::OptionParser::InvalidOption.new(\"PATH must be provided as directory, file or pattern to find JSON or YAML files.\")\n end\n filepath = File.expand_path(val.to_s.strip)\n files = []\n if File.directory?(filepath)\n # passed the name of a directory, include all the JSON and YAML files directly under it\n Dir.glob(File.join(filepath, \"*\")).each do |file| \n if File.file?(file) && ['.json','.yaml','.yml'].include?(File.extname(file))\n files << file\n end\n end\n if files.empty?\n raise ::OptionParser::InvalidOption.new(\"Failed to find any .json or .yaml files under the directory: #{filepath}\")\n end\n elsif File.file?(filepath)\n # passed the name of a file\n files << filepath\n else\n # assume it is a pattern to find files with\n files = Dir.glob(filepath)\n if files.empty?\n raise ::OptionParser::InvalidOption.new(\"Failed to find any files matching path: #{filepath}\")\n end\n end\n # parse files as JSON or YAML\n options[:payload_files] ||= []\n options[:payloads] ||= []\n files.each do |file|\n if options[:payload_files].include?(file)\n next\n else\n options[:payload_files] << file\n end\n payload = nil\n begin\n payload_file = File.expand_path(file)\n if !File.exist?(payload_file) || !File.file?(payload_file)\n raise ::OptionParser::InvalidOption.new(\"File not found: #{payload_file}\")\n end\n # todo: could use parse_json_or_yaml()\n payload = nil\n if payload_file =~ /\\.ya?ml\\Z/\n payload = YAML.load_file(payload_file)\n else\n payload = JSON.parse(File.read(payload_file))\n end\n options[:payloads] << payload\n rescue => ex\n raise ::OptionParser::InvalidOption.new(\"Failed to parse payload file: #{payload_file} Error: #{ex.message}\")\n end\n end\n end if all_option_keys.include?(:payloads)\n opts.on('--ignore-payload-errors', \"Continue processing any remaining payloads if an error occurs. The default behavior is to stop processing when an error occurs.\") do\n options[:ignore_payload_errors] = true\n end if all_option_keys.include?(:payloads)\n when :payloads\n # added with :payload too... just need it here to avoid unknown key error\n # todo: remove this when every command supporting :payload is updated to use parse_payload(options) and execute_api(options)\n when :list\n opts.on( '-m', '--max MAX', \"Max Results (use -1 for all results)\" ) do |val|\n # api supports max=-1 for all at the moment..\n if val.to_s == \"all\" || val.to_s == \"-1\"\n options[:max] = \"-1\"\n else\n max = val.to_i\n if max <= 0\n raise ::OptionParser::InvalidArgument.new(\"must be a positive integer\")\n end\n options[:max] = max\n end\n end\n\n opts.on( '-o', '--offset OFFSET', \"Offset Results\" ) do |val|\n offset = val.to_i\n if offset <= 0\n raise ::OptionParser::InvalidArgument.new(\"must be a positive integer\")\n end\n options[:offset] = offset\n end\n\n if excludes.include?(\"search\") == false\n opts.on( '-s', '--search PHRASE', \"Search Phrase\" ) do |phrase|\n options[:phrase] = phrase\n end\n end\n\n opts.on( '-S', '--sort ORDER', \"Sort Order. DIRECTION may be included as \\\"ORDER [asc|desc]\\\".\" ) do |v|\n if v.to_s.include?(\",\")\n # sorting on multiple properties, just pass it as is, newer api supports multiple fields\n options[:sort] = v\n else\n v_parts = v.to_s.split(\" \")\n if v_parts.size > 1\n options[:sort] = v_parts[0]\n options[:direction] = (v_parts[1].strip == \"desc\") ? \"desc\" : \"asc\"\n else\n options[:sort] = v\n end\n end\n end\n\n opts.on( '-D', '--desc', \"Descending Sort Direction.\" ) do |v|\n options[:direction] = \"desc\"\n end\n\n opts.on( \"--reverse\", \"Reverse order of results. This invert is done by the client, not necessarily the entire dataset.\" ) do\n options[:reverse] = true\n end\n\n # arbitrary query parameters in the format -Q \"category=web&phrase=nginx\"\n # opts.on( '-Q', '--query PARAMS', \"Query parameters. PARAMS format is 'foo=bar&category=web'\" ) do |val|\n # options[:query_filters_raw] = val\n # options[:query_filters] = {}\n # # todo: smarter parsing\n # val.split('&').each do |filter| \n # k, v = filter.split('=')\n # # allow \"woot:true instead of woot=true\"\n # if (k.include?(\":\") && v == nil)\n # k, v = k.split(\":\")\n # end\n # if (!k.to_s.empty?)\n # options[:query_filters][k.to_s.strip] = v.to_s.strip\n # end\n # end\n # end\n\n when :query, :query_filters\n # arbitrary query parameters in the format -Q \"category=web&phrase=nginx\"\n # or pass it many times like -Q foo=bar -Q hello=world\n opts.on( '-Q', '--query PARAMS', \"Query parameters. PARAMS format is 'foo=bar&category=web'\" ) do |val|\n if options[:query_filters_raw] && !options[:query_filters_raw].empty?\n options[:query_filters_raw] += (\"&\" + val)\n else\n options[:query_filters_raw] = val\n end\n options[:query_filters] ||= {}\n val.split('&').each do |filter| \n k, v = filter.split('=')\n # allow woot:true instead of woot=true\n if (k.include?(\":\") && v == nil)\n k, v = k.split(\":\")\n end\n if (!k.to_s.empty?)\n if options[:query_filters].key?(k.to_s.strip)\n cur_val = options[:query_filters][k.to_s.strip]\n if cur_val.instance_of?(Array)\n options[:query_filters][k.to_s.strip] << v.to_s.strip\n else\n options[:query_filters][k.to_s.strip] = [cur_val, v.to_s.strip]\n end\n else\n options[:query_filters][k.to_s.strip] = v.to_s.strip\n end\n end\n end\n end\n\n when :last_updated\n # opts.on(\"--last-updated TIME\", Time, \"Filter by gte last updated\") do |time|\n opts.on(\"--last-updated TIME\", String, \"Filter by Last Updated (gte)\") do |time|\n begin\n options[:lastUpdated] = parse_time(time)\n rescue => e\n raise OptionParser::InvalidArgument.new \"Failed to parse time '#{time}'. Error: #{e}\"\n end\n end\n\n when :find_by_name\n opts.on('--find-by-name', \"Always treat the identifier argument as a name, never an ID. Useful for specifying names that look like numbers. eg. '1234'\" ) do\n options[:find_by_name] = true\n end\n # opts.add_hidden_option('--find-by-name') if opts.is_a?(Morpheus::Cli::OptionParser)\n\n when :remote\n opts.on( '-r', '--remote REMOTE', \"Remote name. The current remote is used by default.\" ) do |val|\n options[:remote] = val\n end\n opts.on( '--remote-url URL', '--remote-url URL', \"Remote url. This allows adhoc requests instead of using a configured remote.\" ) do |val|\n options[:remote_url] = val\n end\n opts.on( '-T', '--token TOKEN', \"Access token for authentication with --remote. Saved credentials are used by default.\" ) do |val|\n options[:remote_token] = val\n end unless excludes.include?(:remote_token)\n opts.on( '--token-file FILE', String, \"Token File, read a file containing the access token.\" ) do |val|\n token_file = File.expand_path(val)\n if !File.exist?(token_file) || !File.file?(token_file)\n raise ::OptionParser::InvalidOption.new(\"File not found: #{token_file}\")\n end\n options[:remote_token] = File.read(token_file).to_s.split(\"\\n\").first.strip\n end\n opts.add_hidden_option('--token-file') if opts.is_a?(Morpheus::Cli::OptionParser)\n opts.on( '-U', '--username USERNAME', \"Username for authentication.\" ) do |val|\n options[:remote_username] = val\n end unless excludes.include?(:remote_username)\n \n\n unless excludes.include?(:remote_password)\n opts.on( '-P', '--password PASSWORD', \"Password for authentication.\" ) do |val|\n options[:remote_password] = val\n end\n opts.on( '--password-file FILE', String, \"Password File, read a file containing the password for authentication.\" ) do |val|\n password_file = File.expand_path(val)\n if !File.exist?(password_file) || !File.file?(password_file)\n raise ::OptionParser::InvalidOption.new(\"File not found: #{password_file}\")\n end\n file_content = File.read(password_file) #.strip\n options[:remote_password] = File.read(password_file).to_s.split(\"\\n\").first\n end\n opts.add_hidden_option('--password-file') if opts.is_a?(Morpheus::Cli::OptionParser)\n end\n\n # todo: also require this for talking to plain old HTTP\n opts.on('-I','--insecure', \"Allow insecure HTTPS communication. i.e. bad SSL certificate.\") do |val|\n options[:insecure] = true\n Morpheus::RestClient.enable_ssl_verification = false\n end\n \n #when :header, :headers\n opts.on( '-H', '--header HEADER', \"Additional HTTP header to include with requests.\" ) do |val|\n options[:headers] ||= {}\n # header_list = val.to_s.split(',')\n header_list = [val.to_s]\n header_list.each do |h|\n header_parts = val.to_s.split(\":\")\n header_key, header_value = header_parts[0], header_parts[1..-1].join(\":\").strip\n if header_parts.size() < 2\n header_parts = val.to_s.split(\"=\")\n header_key, header_value = header_parts[0], header_parts[1..-1].join(\"=\").strip\n end\n if header_parts.size() < 2\n raise_command_error \"Invalid HEADER value '#{val}'. HEADER should contain a key and a value. eg. -H 'X-Morpheus-Lease: $MORPHEUS_LEASE_TOKEN'\"\n end\n options[:headers][header_key] = header_value\n end\n end\n # opts.add_hidden_option('-H') if opts.is_a?(Morpheus::Cli::OptionParser)\n # opts.add_hidden_option('--header') if opts.is_a?(Morpheus::Cli::OptionParser)\n opts.add_hidden_option('-H, --header') if opts.is_a?(Morpheus::Cli::OptionParser)\n\n #when :timeout\n opts.on( '--timeout SECONDS', \"Timeout for api requests. Default is typically 30 seconds.\" ) do |val|\n options[:timeout] = val ? val.to_f : nil\n end\n opts.add_hidden_option('--timeout') if opts.is_a?(Morpheus::Cli::OptionParser)\n\n when :auto_confirm\n opts.on( '-y', '--yes', \"Auto Confirm\" ) do\n options[:yes] = true\n end\n\n when :json\n opts.on('-j','--json', \"JSON Output\") do\n options[:json] = true\n options[:format] = :json\n end\n\n opts.on('--json-raw', String, \"JSON Output that is not so pretty.\") do |val|\n options[:json] = true\n options[:format] = :json\n options[:pretty_json] = false\n end\n opts.add_hidden_option('json-raw') if opts.is_a?(Morpheus::Cli::OptionParser)\n\n when :yaml\n # -y for --yes and for --yaml\n if includes.include?(:auto_confirm)\n opts.on(nil, '--yaml', \"YAML Output\") do\n options[:yaml] = true\n options[:format] = :yaml\n end\n else\n opts.on('-y', '--yaml', \"YAML Output\") do\n options[:yaml] = true\n options[:format] = :yaml\n end\n end\n opts.on(nil, '--yml', \"alias for --yaml\") do\n options[:yaml] = true\n options[:format] = :yaml\n end\n opts.add_hidden_option('yml') if opts.is_a?(Morpheus::Cli::OptionParser)\n\n when :csv\n opts.on(nil, '--csv', \"CSV Output\") do\n options[:csv] = true\n options[:format] = :csv\n #options[:csv_delim] = options[:csv_delim] || \",\"\n end\n # deprecated --csv-delim, use --delimiter instead\n opts.on('--csv-delim CHAR', String, \"Delimiter for CSV Output values. Default: ','\") do |val|\n options[:csv] = true\n options[:format] = :csv\n val = val.gsub(\"\\\\n\", \"\\n\").gsub(\"\\\\r\", \"\\r\").gsub(\"\\\\t\", \"\\t\") if val.include?(\"\\\\\")\n options[:csv_delim] = val\n end\n opts.add_hidden_option('--csv-delim') if opts.is_a?(Morpheus::Cli::OptionParser)\n\n # deprecated --csv-newline, use --newline instead\n opts.on('--csv-newline [CHAR]', String, \"Delimiter for CSV Output rows. Default: '\\\\n'\") do |val|\n options[:csv] = true\n options[:format] = :csv\n if val == \"no\" || val == \"none\"\n options[:csv_newline] = \"\"\n else\n val = val.to_s.gsub(\"\\\\n\", \"\\n\").gsub(\"\\\\r\", \"\\r\").gsub(\"\\\\t\", \"\\t\") if val.include?(\"\\\\\")\n options[:csv_newline] = val\n end\n end\n opts.add_hidden_option('--csv-newline') if opts.is_a?(Morpheus::Cli::OptionParser)\n\n opts.on(nil, '--csv-quotes', \"Wrap CSV values with \\\". Default: false\") do\n options[:csv] = true\n options[:format] = :csv\n options[:csv_quotes] = true\n end\n opts.add_hidden_option('--csv-quotes') if opts.is_a?(Morpheus::Cli::OptionParser)\n\n opts.on(nil, '--csv-no-header', \"Exclude header for CSV Output.\") do\n options[:csv] = true\n options[:format] = :csv\n options[:csv_no_header] = true\n end\n opts.add_hidden_option('--csv-no-header') if opts.is_a?(Morpheus::Cli::OptionParser)\n\n opts.on(nil, '--quotes', \"Wrap CSV values with \\\". Default: false\") do\n options[:csv_quotes] = true\n end\n opts.add_hidden_option('--csv-quotes') if opts.is_a?(Morpheus::Cli::OptionParser)\n\n opts.on(nil, '--no-header', \"Exclude header for CSV Output.\") do\n options[:csv_no_header] = true\n end\n\n when :fields\n opts.on('-f', '--fields x,y,z', Array, \"Filter Output to a limited set of fields. Default is all fields for json,csv,yaml.\") do |val|\n if val.size == 1 && val[0].downcase == 'all'\n options[:all_fields] = true\n else\n options[:include_fields] = val\n end\n end\n opts.on('-F', '--old-fields x,y,z', Array, \"alias for -f, --fields\") do |val|\n if val.size == 1 && val[0].downcase == 'all'\n options[:all_fields] = true\n else\n options[:include_fields] = val\n end\n end\n opts.add_hidden_option('-F, --old-fields') if opts.is_a?(Morpheus::Cli::OptionParser)\n opts.on('--raw-fields [x,y,z]', String, \"Raw fields filters output like --fields except the properties [x,y,z] must be specified from the root of the response instead of relative to the the list or object context for this particular resource.\") do |val|\n if val.size == 1 && val[0].downcase == 'all'\n options[:all_fields] = true\n else\n options[:include_fields] = val.split(',').collect {|r| r.strip}.compact\n end\n options[:raw_fields] = true\n end\n opts.add_hidden_option('--raw-fields') if opts.is_a?(Morpheus::Cli::OptionParser)\n opts.on(nil, '--all-fields', \"Show all fields present in the data.\") do\n options[:all_fields] = true\n end\n opts.on(nil, '--wrap', \"Wrap table columns instead hiding them when terminal is not wide enough.\") do\n options[:wrap] = true\n end\n when :select\n #opts.add_hidden_option('--all-fields') if opts.is_a?(Morpheus::Cli::OptionParser)\n opts.on('--select x,y,z', String, \"Filter Output to just print the value(s) of specific fields.\") do |val|\n options[:select_fields] = val.split(',').collect {|r| r.strip}\n end\n opts.on('--raw-select x,y,z', String, \"Raw select works like --select except the properties [x,y,z] must be specified from the root of the response instead of relative to the the list or object context for this particular resource.\") do |val|\n options[:select_fields] = val.split(',').collect {|r| r.strip}\n options[:raw_fields] = true\n end\n opts.add_hidden_option('--raw-select') if opts.is_a?(Morpheus::Cli::OptionParser)\n\n when :delim\n opts.on('--delimiter [CHAR]', String, \"Delimiter for output values. Default: ',', use with --select and --csv\") do |val|\n options[:csv] = true\n options[:format] = :csv\n val = val.to_s\n val = val.gsub(\"\\\\n\", \"\\n\").gsub(\"\\\\r\", \"\\r\").gsub(\"\\\\t\", \"\\t\") if val.include?(\"\\\\\")\n options[:delim] = val\n end\n\n opts.on('--newline [CHAR]', String, \"Delimiter for output rows. Default: '\\\\n', use with --select and --csv\") do |val|\n options[:csv] = true\n options[:format] = :csv\n val = val.to_s\n if val == \"no\" || val == \"none\"\n options[:newline] = \"\"\n else\n val = val.to_s.gsub(\"\\\\n\", \"\\n\").gsub(\"\\\\r\", \"\\r\").gsub(\"\\\\t\", \"\\t\") if val.include?(\"\\\\\")\n options[:newline] = val\n end\n end\n when :thin\n opts.on( '--thin', '--thin', \"Format headers and columns with thin borders.\" ) do |val|\n options[:border_style] = :thin\n end\n \n \n\n when :dry_run\n opts.on('-d','--dry-run', \"Dry Run, print the API request instead of executing it.\") do\n # todo: this should print after parsing obv..\n # need a hook after parse! or a standard_handle(options) { ... } paradigm\n # either that or hook it up in every command somehow, maybe a hook on connect()\n #puts \"#{cyan}#{dark} #=> DRY RUN#{reset}\"\n # don't print this for --json combined with -d\n # print once and dont munge json\n if !options[:curl] && !options[:json]\n puts \"#{cyan}#{bold}#{dark}DRY RUN#{reset}\"\n end\n options[:dry_run] = true\n end\n opts.on(nil,'--curl', \"Curl, print the API request as a curl command instead of executing it.\") do\n # print once and dont munge json\n if !options[:dry_run] && !options[:json]\n puts \"#{cyan}#{bold}#{dark}DRY RUN#{reset}\"\n end\n options[:dry_run] = true\n options[:curl] = true\n end\n opts.on(nil,'--scrub', \"Mask secrets in output, such as the Authorization header. For use with --curl and --dry-run.\") do\n options[:scrub] = true\n end\n # dry run comes with hidden outfile options\n #opts.add_hidden_option('--scrub') if opts.is_a?(Morpheus::Cli::OptionParser)\n opts.on('--out FILE', String, \"Write standard output to a file instead of the terminal.\") do |val|\n # could validate directory is writable..\n options[:outfile] = val\n end\n opts.add_hidden_option('--out') if opts.is_a?(Morpheus::Cli::OptionParser)\n opts.on('--overwrite', '--overwrite', \"Overwrite output file if it already exists.\") do\n options[:overwrite] = true\n end\n opts.add_hidden_option('--overwrite') if opts.is_a?(Morpheus::Cli::OptionParser)\n\n when :outfile\n opts.on('--out FILE', String, \"Write standard output to a file instead of the terminal.\") do |val|\n options[:outfile] = val\n end\n opts.on('--overwrite', '--overwrite', \"Overwrite output file if it already exists.\") do |val|\n options[:overwrite] = true\n end\n when :quiet\n opts.on('-q','--quiet', \"No Output, do not print to stdout\") do\n options[:quiet] = true\n end\n\n else\n raise \"Unknown common_option key: #{option_key}\"\n end\n end\n\n # options that are always included\n\n # always support thin, but hidden because mostly not hooked up at the moment...\n unless includes.include?(:thin)\n opts.on( '--thin', '--thin', \"Format headers and columns with thin borders.\" ) do |val|\n options[:border_style] = :thin\n end\n opts.add_hidden_option('--thin') if opts.is_a?(Morpheus::Cli::OptionParser)\n end\n\n # disable ANSI coloring\n opts.on('-C','--nocolor', \"Disable ANSI coloring\") do\n Term::ANSIColor::coloring = false\n end\n\n\n # Benchmark this command?\n # Also useful for seeing exit status for every command.\n opts.on('-B','--benchmark', \"Print benchmark time and exit/error after the command is finished.\") do\n options[:benchmark] = true\n # this is hacky, but working! \n # shell handles returning to false\n #Morpheus::Benchmarking.enabled = true\n #my_terminal.benchmarking = true\n #start_benchmark(args.join(' '))\n # ok it happens outside of handle() alltogether..\n # wow, simplify me plz\n end\n\n opts.on('-V','--debug', \"Print extra output for debugging.\") do\n options[:debug] = true\n Morpheus::Logging.set_log_level(Morpheus::Logging::Logger::DEBUG)\n ::RestClient.log = Morpheus::Logging.debug? ? Morpheus::Logging::DarkPrinter.instance : nil\n # perhaps...\n # create a new logger instance just for this command instance\n # this way we don't elevate the global level for subsequent commands in a shell\n # @logger = Morpheus::Logging::Logger.new(STDOUT)\n # if !@logger.debug?\n # @logger.log_level = Morpheus::Logging::Logger::DEBUG\n # end\n end\n\n # A way to ensure debugging is off, it should go back on after the command is complete.\n opts.on('--no-debug','--no-debug', \"Disable debugging.\") do\n options[:debug] = false\n Morpheus::Logging.set_log_level(Morpheus::Logging::Logger::INFO)\n ::RestClient.log = Morpheus::Logging.debug? ? Morpheus::Logging::DarkPrinter.instance : nil\n end\n opts.add_hidden_option('--no-debug') if opts.is_a?(Morpheus::Cli::OptionParser)\n\n opts.on('--hidden-help', \"Print help that includes all the hidden options, like this one.\" ) do\n puts opts.full_help_message({show_hidden_options:true})\n exit 0 # return 0 maybe?\n end\n opts.add_hidden_option('--hidden-help') if opts.is_a?(Morpheus::Cli::OptionParser)\n opts.on('-h', '--help', \"Print this help\" ) do\n puts opts\n exit 0 # return 0 maybe?\n end\n\n opts\n end",
"title": ""
},
{
"docid": "51a5e6191eeb25ca32ba90198b224ced",
"score": "0.48955283",
"text": "def extract_options\n # TODO: deprecate\n dup.extract_options!\n end",
"title": ""
},
{
"docid": "34babaf395cab8280ec95df0c0eeb7bb",
"score": "0.4888707",
"text": "def options; @tool_options ||= HashStruct.new(super); end",
"title": ""
},
{
"docid": "8c03cc2cbf913a8aa570f9f7237db420",
"score": "0.48849267",
"text": "def process_overlay_handling\n end",
"title": ""
},
{
"docid": "8c03cc2cbf913a8aa570f9f7237db420",
"score": "0.48849267",
"text": "def process_overlay_handling\n end",
"title": ""
},
{
"docid": "170c18a20f1658184fd10d9c2466f45a",
"score": "0.48531315",
"text": "def merge_custom_defaults!; end",
"title": ""
},
{
"docid": "170c18a20f1658184fd10d9c2466f45a",
"score": "0.48531315",
"text": "def merge_custom_defaults!; end",
"title": ""
},
{
"docid": "b1c52c8bceaffb6c8764706834cbc796",
"score": "0.48490134",
"text": "def make_meta_options(layer); end",
"title": ""
},
{
"docid": "4e32ca4e3dcc1d657966923aa4e77c8a",
"score": "0.48304224",
"text": "def apply_global_options(hashtbl)\r\n classname = self.class.to_s.downcase\r\n\r\n\tif (is_metric())\r\n\t\toptions = GLOBAL_OPTIONS_METRIC\r\n\telse\r\n\t\toptions = GLOBAL_OPTIONS_IMPERIAL\r\n\tend\r\n \r\n options.keys.each do |key|\r\n parts = key.split('.')\r\n key_class = ''\r\n if (parts.length == 2)\r\n key_class = parts[0]\r\n next if not (classname =~ /#{key_class}/)\r\n newkey = parts[1]\r\n else\r\n newkey = key\r\n end\r\n if (hashtbl.has_key?(newkey))\r\n hashtbl[newkey] = options[key]\r\n end\r\n end\r\nend",
"title": ""
},
{
"docid": "81f7737ad6dd1a67d478e92594802292",
"score": "0.48301739",
"text": "def apply_options(magick, define: T.unsafe(nil), **options); end",
"title": ""
},
{
"docid": "81f7737ad6dd1a67d478e92594802292",
"score": "0.48301739",
"text": "def apply_options(magick, define: T.unsafe(nil), **options); end",
"title": ""
},
{
"docid": "05c53c8a6ef73305d543b5a15f8f972f",
"score": "0.48260316",
"text": "def universal_options\n opts = []\n opts << \"-c\" << new_resource.comment if should_set?(:comment)\n opts << \"-e\" << new_resource.expire_date if prop_is_set?(:expire_date)\n opts << \"-g\" << new_resource.gid if should_set?(:gid)\n opts << \"-f\" << new_resource.inactive if prop_is_set?(:inactive)\n opts << \"-p\" << new_resource.password if should_set?(:password)\n opts << \"-s\" << new_resource.shell if should_set?(:shell)\n opts << \"-u\" << new_resource.uid if should_set?(:uid)\n opts << \"-d\" << new_resource.home if updating_home?\n opts << \"-o\" if new_resource.non_unique\n opts\n end",
"title": ""
},
{
"docid": "9610fe95bcf2a9a4f601bf80448affb8",
"score": "0.48260137",
"text": "def merge_options!(options)\n @options.merge! options\n end",
"title": ""
},
{
"docid": "32f1e325dd316e76cb65574309bf53b3",
"score": "0.48195428",
"text": "def merge(new_options)\n dup.merge!(new_options)\n end",
"title": ""
},
{
"docid": "616f49f37975ed9c199b7ea7e9d23702",
"score": "0.4815127",
"text": "def combine_options (o1, o2)\n# $stderr.print \"Combining '#{o1}' with '#{o2}'\\n\"\n if (! @_option_value.has_key?(o1) && ! @_option_value.has_key?(o2))\n return\n elsif (! @_option_value.has_key?(o1))\n @_option_value[o1] = Array.new\n elsif (! @_option_value.has_key?(o2))\n @_option_value[o2] = Array.new\n end\n \n tmp = @_option_value[o1] | @_option_value[o2]\n\n @_option_value[o1] = tmp\n @_option_value[o2] = tmp\n @_count[o1] = tmp.size\n @_count[o2] = tmp.size\n end",
"title": ""
},
{
"docid": "bcfc8874441e88218674f9e89b55c0b6",
"score": "0.48144588",
"text": "def define_combined_overlay(*names)\n combined_name = names.join(\"_\").to_sym\n first = overlay_value(names.first)\n last = overlay_value(names.last)\n first.product(last).each {|arr| @overlays << [combined_name, arr.join(\"_\")]}\n end",
"title": ""
},
{
"docid": "14213b746c29d0698df3eb5d5879aa3b",
"score": "0.48138008",
"text": "def merge_opts *ox\n defaults = ox.last\n Hash[ defaults.keys.map do |k|\n [ k, ox.detect{ |h| h.key?(k) }[k] ]\n end ]\n end",
"title": ""
},
{
"docid": "4f3303d33f01ef731f35fbee362b8c51",
"score": "0.48064786",
"text": "def map_flags(options)\n MAPPINGS.each.reduce(options[:flags] || []) do |flags, (key, value)|\n cursor_type = options[:cursor_type]\n if options[key] || (cursor_type && cursor_type == key)\n flags.push(*value)\n end\n flags\n end\n end",
"title": ""
},
{
"docid": "1044c4085991ac73b14d1d002c286f90",
"score": "0.4801913",
"text": "def add_option_preset(preset_hash,op=:push)\n Log.log.debug(\"add_option_preset=#{preset_hash}\")\n raise \"internal error: setting default with no hash: #{preset_hash.class}\" if !preset_hash.is_a?(Hash)\n # incremental override\n preset_hash.each{|k,v|@unprocessed_defaults.send(op,[k.to_sym,v])}\n end",
"title": ""
},
{
"docid": "8af1b9802e9a21ee2568afa7e97f30f9",
"score": "0.4799626",
"text": "def merged_options(call_options); end",
"title": ""
},
{
"docid": "76f2a1addd609af17a4893d611d61d56",
"score": "0.4797994",
"text": "def generalCompat\n if Builtins.haskey(@current, \"general\")\n if Builtins.haskey(Ops.get_map(@current, \"general\", {}), \"keyboard\")\n Ops.set(\n @current,\n \"keyboard\",\n Ops.get_map(@current, [\"general\", \"keyboard\"], {})\n )\n Ops.set(\n @current,\n \"general\",\n Builtins.remove(Ops.get_map(@current, \"general\", {}), \"keyboard\")\n )\n end\n if Builtins.haskey(Ops.get_map(@current, \"general\", {}), \"language\")\n Ops.set(\n @current,\n \"language\",\n {\n \"language\" => Ops.get_string(\n @current,\n [\"general\", \"language\"],\n \"\"\n )\n }\n )\n Ops.set(\n @current,\n \"general\",\n Builtins.remove(Ops.get_map(@current, \"general\", {}), \"language\")\n )\n end\n if Builtins.haskey(Ops.get_map(@current, \"general\", {}), \"clock\")\n Ops.set(\n @current,\n \"timezone\",\n Ops.get_map(@current, [\"general\", \"clock\"], {})\n )\n Ops.set(\n @current,\n \"general\",\n Builtins.remove(Ops.get_map(@current, \"general\", {}), \"clock\")\n )\n end\n if Ops.get_boolean(@current, [\"general\", \"mode\", \"final_halt\"], false)\n script = {\n \"filename\" => \"zzz_halt\",\n \"source\" => \"chkconfig autoyast off\\nshutdown -h now\"\n }\n if !Builtins.haskey(@current, \"scripts\")\n Ops.set(@current, \"scripts\", {})\n end\n if !Builtins.haskey(\n Ops.get_map(@current, \"scripts\", {}),\n \"init-scripts\"\n )\n Ops.set(@current, [\"scripts\", \"init-scripts\"], [])\n end\n Ops.set(\n @current,\n [\"scripts\", \"init-scripts\"],\n Builtins.add(\n Ops.get_list(@current, [\"scripts\", \"init-scripts\"], []),\n script\n )\n )\n end\n if Ops.get_boolean(@current, [\"general\", \"mode\", \"final_reboot\"], false)\n script = {\n \"filename\" => \"zzz_reboot\",\n \"source\" => \"chkconfig autoyast off\\nshutdown -r now\"\n }\n if !Builtins.haskey(@current, \"scripts\")\n Ops.set(@current, \"scripts\", {})\n end\n if !Builtins.haskey(\n Ops.get_map(@current, \"scripts\", {}),\n \"init-scripts\"\n )\n Ops.set(@current, [\"scripts\", \"init-scripts\"], [])\n end\n Ops.set(\n @current,\n [\"scripts\", \"init-scripts\"],\n Builtins.add(\n Ops.get_list(@current, [\"scripts\", \"init-scripts\"], []),\n script\n )\n )\n end\n if Builtins.haskey(\n Ops.get_map(@current, \"software\", {}),\n \"additional_locales\"\n )\n if !Builtins.haskey(@current, \"language\")\n Ops.set(@current, \"language\", {})\n end\n Ops.set(\n @current,\n [\"language\", \"languages\"],\n Builtins.mergestring(\n Ops.get_list(@current, [\"software\", \"additional_locales\"], []),\n \",\"\n )\n )\n Ops.set(\n @current,\n \"software\",\n Builtins.remove(\n Ops.get_map(@current, \"software\", {}),\n \"additional_locales\"\n )\n )\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "25b8bc6190f576321dfd8b3875174831",
"score": "0.47959444",
"text": "def as_options\n mode = if copy_on_replace? then :copy\n else\n :drop\n end\n\n { on_replace: mode, once: once? }\n end",
"title": ""
},
{
"docid": "29cf6cf2101554aa2129fbe46af2ce9d",
"score": "0.47929588",
"text": "def cooerce_options_to_usher(opts)\n defaults = opts.delete(:_defaults)\n opts[:default_values] ||= {}\n opts[:default_values].merge!(defaults) if defaults\n opts\n end",
"title": ""
},
{
"docid": "cb26dc0cba28b37b264c6273ed798f0b",
"score": "0.47925216",
"text": "def merge_options(options)\n require 'deep_merge'\n # deep_merge will not work with frozen options, so make a deep copy\n # (options.dup is a shallow copy of contained Hashes)\n options_dup = Marshal.load(Marshal.dump(options))\n app_id = options.has_key?('app_id') ? options['app_id'] : 'default'\n\n merged_options = call_function('lookup', 'simpkv::options', { 'default_value' => {} })\n merged_options.deep_merge!(options_dup)\n\n backend_names = [ 'default' ]\n if merged_options.has_key?('backends')\n # reverse sort by length of string so we get the longest match when using\n # a partial match\n backend_names = merged_options['backends'].keys.sort_by(&:length).reverse\n else\n Puppet.debug(\"simpkv: No backends configured. 'file' backend automatically added\")\n merged_options['backends'] = {\n 'default' => {\n 'type' => 'file',\n 'id' => 'auto_default'\n }\n }\n end\n\n unless merged_options.has_key?('backend')\n backend = 'default'\n if backend_names.include?(app_id)\n backend = app_id\n else\n backend_names.each do |name|\n if app_id.start_with?(name)\n backend = name\n break\n end\n end\n end\n merged_options['backend'] = backend\n end\n\n unless merged_options.has_key?('softfail')\n merged_options['softfail'] = false\n end\n\n unless merged_options.has_key?('global')\n merged_options['global'] = false\n end\n\n merged_options['environment'] = closure_scope.compiler.environment.to_s\n\n merged_options\n end",
"title": ""
},
{
"docid": "a9732ffab6ec124750341220bdd6c2e1",
"score": "0.47913757",
"text": "def flags_from_options(opts)\n flags = 0\n\n flags |= 1<<12 if opts[:multiline]\n flags |= 1<<13 if opts[:password]\n\n if opts[:file_select]\n min_version 1.4\n flags |= 1<<20\n end\n\n if opts[:do_not_spell_check]\n min_version 1.4\n flags |= 1<<22\n end\n\n if opts[:do_not_scroll]\n min_version 1.4\n flags |= 1<<23\n end\n\n flags\n end",
"title": ""
},
{
"docid": "a9732ffab6ec124750341220bdd6c2e1",
"score": "0.47913757",
"text": "def flags_from_options(opts)\n flags = 0\n\n flags |= 1<<12 if opts[:multiline]\n flags |= 1<<13 if opts[:password]\n\n if opts[:file_select]\n min_version 1.4\n flags |= 1<<20\n end\n\n if opts[:do_not_spell_check]\n min_version 1.4\n flags |= 1<<22\n end\n\n if opts[:do_not_scroll]\n min_version 1.4\n flags |= 1<<23\n end\n\n flags\n end",
"title": ""
},
{
"docid": "f76223950b4072dd7f9348696e0e4ea7",
"score": "0.47874185",
"text": "def merge_environment_specific_options!\n self[Bridgetown.environment]&.each_key do |k|\n self[k] = self[Bridgetown.environment][k]\n end\n delete(Bridgetown.environment)\n\n self\n end",
"title": ""
},
{
"docid": "709188c50a4699f2fb95a36e6479474f",
"score": "0.47838217",
"text": "def global_option *args, &block\n switches, description = Runner.seperate_switches_from_description *args\n @options << {\n :args => args,\n :proc => block,\n :switches => switches,\n :description => description,\n }\n end",
"title": ""
},
{
"docid": "494ab18653db0602bfef00ca3d2e843a",
"score": "0.47819823",
"text": "def set_global_options!\n compose SolrMakr::SetGlobalOptions, raw_options\n end",
"title": ""
},
{
"docid": "20174266a4692c8344578bd143f11fbd",
"score": "0.47817135",
"text": "def apply_options(magick, define: {}, **options)\n options.each do |option, value|\n case value\n when true, nil then magick.public_send(option)\n when false then magick.public_send(option).+\n else magick.public_send(option, *value)\n end\n end\n\n apply_define(magick, define)\n end",
"title": ""
},
{
"docid": "7a269ab21438b1ac74de57c73ad48e8b",
"score": "0.47714153",
"text": "def merge_options(opts)\n @options = {\n format: :base_64,\n cipher: ::AES::DEFAULT_AES_CIPHER,\n iv: nil,\n padding: true, # use cipher padding by default\n }.merge! opts\n _handle_iv\n _handle_padding\n end",
"title": ""
},
{
"docid": "398fe70e248adce7399f8b5cf92cb033",
"score": "0.47711608",
"text": "def add_options(&block); end",
"title": ""
},
{
"docid": "398fe70e248adce7399f8b5cf92cb033",
"score": "0.47711608",
"text": "def add_options(&block); end",
"title": ""
},
{
"docid": "4e79527e3330f1959facd0690146c380",
"score": "0.4764137",
"text": "def define_merge_flag\n @options.on(\"-c\", \"--configuration NAME-or-FILE\", String, \"Apply a named or disk file configuration.\") do |name_or_path|\n loaded_configuration = load_configuration(name_or_path)\n @configuration = @configuration.deep_merge(loaded_configuration)\n end\n end",
"title": ""
},
{
"docid": "bdb51cb088f6af5f0face0e058729b02",
"score": "0.47636938",
"text": "def normalize_options(options)\n # here, we could also filter out local options e.g. like options[:band].\n return options unless options.any?\n\n propagated_options = options.dup\n propagated_options.delete(:wrap) # FIXME.\n propagated_options.delete(:_private)\n\n private_options = {}\n private_options[:include] = propagated_options.delete(:include) if options[:include]\n private_options[:exclude] = propagated_options.delete(:exclude) if options[:exclude]\n\n propagated_options[:_private] = private_options if private_options.any?\n\n propagated_options\n end",
"title": ""
},
{
"docid": "67e58caefc9bbf3b64b21851d1ce23bc",
"score": "0.47629067",
"text": "def global_options( &block )\n initialize_instance\n constructor = Caty::OptionConstructor.new(Caty::GlobalOption)\n @global_options.concat(constructor.construct(&block))\n end",
"title": ""
},
{
"docid": "def3947d2630c6a85b6a4087fc4ad135",
"score": "0.47629043",
"text": "def compare_options\n %w(side toggle opacity mask)\n end",
"title": ""
},
{
"docid": "4d53192e831ea768e35ca45983d74a0f",
"score": "0.47614822",
"text": "def merge_options_aliases\n commands = Binder::Strategy.subclasses.map { |command| command.to_s.gsub!('Binder::', '').downcase }.sort\n previous_cmd = \"\"\n options = []\n\n commands.each_with_index do |cmd, i|\n if cmd.length == 1\n previous_cmd = cmd\n elsif not previous_cmd.empty?\n cmd_prefixes = [previous_cmd.length == 1 ? '-' : '--', cmd.length == 1 ? '-' : '--']\n options << \"#{cmd_prefixes.first}#{previous_cmd}, #{cmd_prefixes.last}#{cmd}\"\n previous_cmd = \"\"\n end\n end\n @options = options\n end",
"title": ""
},
{
"docid": "bedbaa9b011602c1f69dd54a06a9e4ea",
"score": "0.47541308",
"text": "def get_modified_options\n unless @modified_options\n if options\n opts = options.inject({}) do |sum,h| \n sum.merge!({h[0].to_sym => ((h[1].nil?) ? self.send(h[0].to_sym) : h[1]) })\n end\n else\n opts = {}\n end\n @modified_options = opts.reject {|k,v| disallowed_options.include?(k) }\n end\n @modified_options\n end",
"title": ""
},
{
"docid": "299bc72cce1a59a3c0d743cbf4e4df9c",
"score": "0.47535077",
"text": "def option(name, mode = :any)\n if mode == :merge && (settings[name].kind_of?(Array) || settings[:global][name].kind_of?(Array))\n settings[:global].fetch(name, []) | settings.fetch(name, [])\n else\n settings.fetch(name, settings[:global][name])\n end\n end",
"title": ""
},
{
"docid": "de4091cdef264d9a13acb45f16b3b085",
"score": "0.47488058",
"text": "def overlay_settings(new_settings)\n existing_views = settings.views\n new_views = new_settings.__extract__(:views).values\n logger.debug \"RW RackWardenClassMethods.overlay_settings self: #{self}, new_settings: #{new_settings} \" #settings.object_id #{settings.object_id}\"\n #logger.debug \"RW existing_views #{existing_views.inspect}\"\n #logger.debug \"RW new_views #{new_views.inspect}\"\n # TODO: Should these next two steps be reversed? 2016-08-02\n set :views, [new_views, existing_views].flatten.compact.uniq\n set new_settings\n logger.debug \"RW compiled_views\"\n logger.debug views.to_yaml\n settings\n end",
"title": ""
},
{
"docid": "cb4d501e851f8f73693f9180d52381f2",
"score": "0.47480088",
"text": "def flatten!(options = {})\n return if self.opaque?\n \n options[:bgcolor] ||= '#fff'\n \n duped = self.dup\n @resource = IQ::Image::Canvas.new(\n duped.width, duped.height,\n :bgcolor => options[:bgcolor]\n ).overlay!(duped).resource\n \n self\n end",
"title": ""
},
{
"docid": "283cfef9a05fe24dee45d422bf96d94f",
"score": "0.47464848",
"text": "def merge_unknown_key(key, value, old_ops)\n key_s = key.to_s\n if key_s.match(/^set/)\n key_sym = key_s.sub('set_', '').to_sym\n if key_s.match(/(brightness|hue|saturation)/)\n adjusted = old_ops[:color].dup\n adjusted[HSB_ORDER[key_sym]] = value\n old_ops[:color] = adjusted\n else\n old_ops[key_sym] = value\n end\n end\n end",
"title": ""
},
{
"docid": "b8fbce664e033038961577e1ed6a407f",
"score": "0.4738521",
"text": "def add_legacy_explore_groups\n unless @site.config.key?(\"_collection_groups\")\n @site.config[\"_collection_groups\"] = @site.config.dig(\"_explore\", \"groups\")&.dup\n end\n end",
"title": ""
},
{
"docid": "97f900ac88afde3f843dc7c7b96680e6",
"score": "0.47384918",
"text": "def flag_res(old_flags, new_flag)\n old_flags | FLAGS[new_flag]\n end",
"title": ""
},
{
"docid": "810c8eda907e400b656e69cce7997e16",
"score": "0.47344038",
"text": "def make_copy\n obj = dup\n obj.local_options = Marshal.load(Marshal.dump(local_options))\n obj.hooks = @hooks\n\n obj\n end",
"title": ""
},
{
"docid": "ca29bb14685d29bdf697fcecdb7589f1",
"score": "0.4727418",
"text": "def options_from_switches(switches)\n {\n overwrite: (\n switches.include?('o') || \n switches.include?('overwrite')\n )? true : false\n }\n end",
"title": ""
},
{
"docid": "dccb870fe9cda7e23bcc3dbfaf90ad4d",
"score": "0.4725295",
"text": "def supported_options=(_arg0); end",
"title": ""
},
{
"docid": "dccb870fe9cda7e23bcc3dbfaf90ad4d",
"score": "0.4725295",
"text": "def supported_options=(_arg0); end",
"title": ""
},
{
"docid": "dccb870fe9cda7e23bcc3dbfaf90ad4d",
"score": "0.4725295",
"text": "def supported_options=(_arg0); end",
"title": ""
},
{
"docid": "6bc6a990ab1ac770c84274a4cdf0d854",
"score": "0.47235358",
"text": "def get_modified_options\n if options\n opts = options.inject({}) do |sum,h| \n sum.merge!({h[0].to_sym => ((h[1].nil?) ? self.send(h[0].to_sym) : h[1]) })\n end\n else\n opts = {}\n end\n opts.reject {|k,v| disallowed_options.include?(k) }\n end",
"title": ""
},
{
"docid": "1ed06be82385f05cdbc506e169ae76f3",
"score": "0.47224042",
"text": "def raw_options_map_old\n\t\tres = {}\n\t\toptions = self.product_options\n\t\t\n\t\toptions.each do |opt|\n\t\t\tkey = opt\n\t\t\tres[key] = self.product_option_values.find( :all, :conditions => \"product_option_id = #{opt.id}\", :order => '`default` DESC' )\n\t\tend\t\t\n\t\treturn res\n\tend",
"title": ""
},
{
"docid": "92eb214b4437e7003e783663640ed016",
"score": "0.47115737",
"text": "def copy_options_to_aliased_versions(global_options,command,options) # :nodoc:\n copy_options_to_aliases(global_options)\n command.copy_options_to_aliases(options)\n end",
"title": ""
},
{
"docid": "19037c99992f3d8cd3f72ad664ed3b75",
"score": "0.47083628",
"text": "def merge(output_to_color)\n overrides = ::Hash[ output_to_color.collect { |output, color| [ output.semantic, [output, color] ] } ]\n PlusPoles.new(@plus_poles.merge(overrides))\n end",
"title": ""
},
{
"docid": "d6a0310093c8b9bdd7f502ee6a5ff6a7",
"score": "0.47057766",
"text": "def remove_global_options\n # TODO: refactor with flipflop\n options.each do |option|\n switches = option[:switches]\n past_switch, arg_removed = false, false\n @args.delete_if do |arg|\n if switches.any? { |switch| switch =~ /^#{arg}/ }\n past_switch, arg_removed = true, false\n true\n elsif past_switch && !arg_removed && arg !~ /^-/ \n arg_removed = true\n else\n arg_removed = true\n false\n end\n end\n end\n end",
"title": ""
},
{
"docid": "65ba345ad3420c3f2768dbc6ae22c874",
"score": "0.470205",
"text": "def tools\n select_tools.map { |tool_name| OpenStruct.new(options_for tool_name) }\n end",
"title": ""
},
{
"docid": "eac9487e03525a5300b101742d4a2489",
"score": "0.47018766",
"text": "def merge_options\n options = default_options.marshal_dump\n self.configuration_file_options.each_pair do |key,value|\n options[key] = value\n end\n\n @parsed_options.marshal_dump.each_pair do |key,value|\n options[key] = value\n end\n\n @options = OpenStruct.new(options)\n end",
"title": ""
},
{
"docid": "cd81e4ae730b8083da546605dfdabe1a",
"score": "0.47007746",
"text": "def massage_gates\n if @enables.is_a?(Hash)\n @enables = {}.tap do |new_h|\n @enables.each { |gates, routines| new_h[gates] = [routines].flatten }\n end\n end\n if @flags.is_a?(Hash)\n @flags = {}.tap do |new_h|\n @flags.each { |gates, routines| new_h[gates] = [routines].flatten }\n end\n end\n end",
"title": ""
},
{
"docid": "eb8f41ccb4116e19be9c091cc9cd461e",
"score": "0.46948755",
"text": "def update_options!( options )\n options.merge!(@options)\n options = @extra_options.merge( options)\n end",
"title": ""
},
{
"docid": "4dff032d82ec40bd1f21a1654b068a6e",
"score": "0.46743962",
"text": "def merge_opts(args, opts)\n res = args.dup\n if res.last.is_a? Hash\n # there are already options\n # keep them\n orig_opts = res.last\n orig_opts.replace(opts.merge(orig_opts))\n else\n res << opts\n end\n res\n end",
"title": ""
},
{
"docid": "1dad9b73a7aa19388630dc8c3a208cdc",
"score": "0.4664396",
"text": "def enable_advanced_intra_coding\n FFMpegCommand << \"-aic\"\n end",
"title": ""
},
{
"docid": "ce4f39613214cf8a350653e7b76ce2be",
"score": "0.46611127",
"text": "def adam7_merge_pass(pass, canvas, subcanvas); end",
"title": ""
},
{
"docid": "1b4118743ee42a772082b7776fe3fce4",
"score": "0.46600854",
"text": "def output_options\n {:combine => @options[:combine]}\n end",
"title": ""
}
] |
05be79c11209441fc6de9cbc08a115b3
|
DELETE /pics/1 DELETE /pics/1.xml
|
[
{
"docid": "f040140f2f441a89c3b958f440baffe4",
"score": "0.72565556",
"text": "def destroy\n @pic = Pic.find(params[:id])\n @pic.destroy\n\n respond_to do |format|\n format.html { redirect_to(pics_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
[
{
"docid": "e33f242b37af43369183ed6142762c65",
"score": "0.7087131",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n @image.delete_img(@image.name)\n \n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "66672d128a9e6f3be7ec5fa72ca6a844",
"score": "0.7014046",
"text": "def delete\n @picture = Picture.find(params[:id])\n @picture.destroy\n\n respond_to do |format|\n format.html { redirect_to :action => :index }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fa1c14d657244597683d244ff3ac01cc",
"score": "0.69470805",
"text": "def destroy\n @pictures = Picture.find(params[:id])\n @pictures.destroy\n\n respond_to do |format|\n format.html { redirect_to(pictures_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4100b1ba27a9a751bb11d54b45e1aeb1",
"score": "0.6897808",
"text": "def delete(path);end",
"title": ""
},
{
"docid": "4100b1ba27a9a751bb11d54b45e1aeb1",
"score": "0.6897808",
"text": "def delete(path);end",
"title": ""
},
{
"docid": "7624e6d2da67f567fff5c6dd270e4df5",
"score": "0.6861277",
"text": "def delete_pics\n return unless params[:pic]\n params[:pic].each do |k,v|\n Picture.delete(k) if v == '1'\n end\n end",
"title": ""
},
{
"docid": "7624e6d2da67f567fff5c6dd270e4df5",
"score": "0.6861277",
"text": "def delete_pics\n return unless params[:pic]\n params[:pic].each do |k,v|\n Picture.delete(k) if v == '1'\n end\n end",
"title": ""
},
{
"docid": "6ddb5ecea86b1b9eb09bf44b1a715606",
"score": "0.6856774",
"text": "def destroy\n @pic_tag = PicTag.find(params[:id])\n @pic_tag.destroy\n\n respond_to do |format|\n format.html { redirect_to(pic_tags_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f186484c3bb8954afb1e063bbf4864e0",
"score": "0.6841653",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f186484c3bb8954afb1e063bbf4864e0",
"score": "0.6841648",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f186484c3bb8954afb1e063bbf4864e0",
"score": "0.6841648",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f186484c3bb8954afb1e063bbf4864e0",
"score": "0.6841648",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f186484c3bb8954afb1e063bbf4864e0",
"score": "0.6841648",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f186484c3bb8954afb1e063bbf4864e0",
"score": "0.6841648",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f186484c3bb8954afb1e063bbf4864e0",
"score": "0.6841648",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f186484c3bb8954afb1e063bbf4864e0",
"score": "0.6841648",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f186484c3bb8954afb1e063bbf4864e0",
"score": "0.6841648",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f186484c3bb8954afb1e063bbf4864e0",
"score": "0.6841648",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "f186484c3bb8954afb1e063bbf4864e0",
"score": "0.68414325",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "58a1d971046e635d87c9b18e358913f6",
"score": "0.68295854",
"text": "def destroy\n @scrap_photo = ScrapPhoto.find(params[:id])\n @scrap_photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(scrap_photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "27caacd1e8d785f635a35c0206450ea4",
"score": "0.68136305",
"text": "def destroy\n #REQUIRES: :id belongs to a picture in the database\n #MODIFIES: The database\n #EFFECTS: Removes the picture with :id from the database.\n @picture = Picture.find(params[:id])\n @picture.destroy\n\n respond_to do |format|\n format.html { redirect_to(pictures_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "dc7f523474227b1224b7ff64a79c9848",
"score": "0.6811303",
"text": "def destroy\n#@photo = Photo.find(params[:id])\n#@photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "19f2f18a36f284f2c46fa2423a40e076",
"score": "0.6808562",
"text": "def destroy\n @picture1 = Picture1.find(params[:id])\n @picture1.destroy\n\n respond_to do |format|\n format.html { redirect_to(picture1s_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b75595fadcf2494b514d125e4e8d94b8",
"score": "0.68071675",
"text": "def destroy\n @imagen = Imagen.find(params[:id])\n @imagen.destroy\n\n respond_to do |format|\n format.html { redirect_to(imagenes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "822ddea2e45bf78350003645efcbdb54",
"score": "0.67964536",
"text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end",
"title": ""
},
{
"docid": "1ac8dc8eedd0d59c7054fcd5fad837f6",
"score": "0.6790686",
"text": "def destroy\n @photo = @album.photos.find(params[:id])\n @photo.destroy\n \n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "de20116d7f090023cd90941d0f6c9659",
"score": "0.67895067",
"text": "def destroy\n #expire_index_page\n\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_photos_path) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fc977c4237ee295cafa9ba6a5746652f",
"score": "0.6782671",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fc977c4237ee295cafa9ba6a5746652f",
"score": "0.6782671",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fc977c4237ee295cafa9ba6a5746652f",
"score": "0.6782671",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to photos_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "62b1817590f756d597082a6174ff8905",
"score": "0.677023",
"text": "def destroy\n @picture = Picture.find(params[:id])\n @picture.destroy\n\n respond_to do |format|\n format.html { redirect_to(pictures_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "62b1817590f756d597082a6174ff8905",
"score": "0.677023",
"text": "def destroy\n @picture = Picture.find(params[:id])\n @picture.destroy\n\n respond_to do |format|\n format.html { redirect_to(pictures_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "62b1817590f756d597082a6174ff8905",
"score": "0.677023",
"text": "def destroy\n @picture = Picture.find(params[:id])\n @picture.destroy\n\n respond_to do |format|\n format.html { redirect_to(pictures_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "9b93574177e1d7fa68d16eb00585cf15",
"score": "0.6748558",
"text": "def destroy\n @myphoto = Myphoto.find(params[:id])\n @myphoto.destroy\n\n respond_to do |format|\n format.html { redirect_to(myphotos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e588c257dbf8debd2274521661c2cefd",
"score": "0.67485005",
"text": "def destroy\n @photo = @recipe.photos.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to recipe_url(@recipe) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0b24cbc6495df3923ea7679acbcd8deb",
"score": "0.6747645",
"text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend",
"title": ""
},
{
"docid": "0dcfc1b7f695169792dd4874b7c057a4",
"score": "0.6742647",
"text": "def destroy\n @photo_file = PhotoFile.find(params[:id])\n @photo_file.destroy\n\n respond_to do |format|\n format.html { redirect_to(photo_files_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7d10b1c4d14fedb289e836c310797899",
"score": "0.6714028",
"text": "def destroy\n\n @picture.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_pictures_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0bd79434a477497681fddefa99594eb6",
"score": "0.67081463",
"text": "def destroy\n @picture = Picture.find(params[:id])\n @picture.destroy\n respond_to do |format|\n format.html { redirect_to pictures_url }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d56949fe7cce541b8e2f4424089f5f14",
"score": "0.67042404",
"text": "def destroy\n @image = @post.images.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "10661794c4bb50e0ab6c65fe257f276b",
"score": "0.66935456",
"text": "def destroy\n# @photo = Photo.find(params[:id])\n @photo.destroy\n respond_to do |format|\n format.html { redirect_to(\"/manage/photos\") }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "3003e8e4934dfa70e4189f02656a7d4c",
"score": "0.6684164",
"text": "def destroy\n @picture = Picture.find(params[:id])\n @picture.destroy\n\n respond_to do |format|\n format.html { redirect_to(yacht_pictures_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e0f0485a7dd0b1b473758f019f0d45d9",
"score": "0.668023",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "baf17f1e881919d804874b54d7552004",
"score": "0.6679762",
"text": "def destroy\n @image = Image.find(params[:id])\n \n imagen = @image.filename\n \n #function in manage_images.rb\n remove_image_file(imagen)\n\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "84743c9f945ac5a31d47da1ac3e29297",
"score": "0.6670891",
"text": "def destroy\n @photo_bare = PhotoBare.find(params[:id])\n @photo_bare.destroy\n\n respond_to do |format|\n format.html { redirect_to(photo_bares_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "989e824b8032b2d1dfd3802f2ab2cd66",
"score": "0.6665675",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.remove_image! if @photo.image_url \n @photo.destroy\n @photos = Photo.all\n\n\n respond_to do |format|\n flash[:notice] = \"Photo bien supprimée\"\n format.html\n end\n end",
"title": ""
},
{
"docid": "5c53bdf3f55656e01eb20b357d937459",
"score": "0.6660599",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5c53bdf3f55656e01eb20b357d937459",
"score": "0.6660599",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5c53bdf3f55656e01eb20b357d937459",
"score": "0.6660599",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5c53bdf3f55656e01eb20b357d937459",
"score": "0.6660599",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2c1360456e44b5993481d234ac782329",
"score": "0.66596204",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(@gallery) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "23c6b14605abb73942b5d082a3c45eec",
"score": "0.66434693",
"text": "def destroy\n @picture = Picture.find_by_permalink(params[:id])\n @picture.destroy\n flash[:notice] = \"Picture #{@picture.title} is deleted\"\n\n respond_to do |format|\n format.html { redirect_to(edit_admin_gallery_url(params[:gallery_id])) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "23c6b14605abb73942b5d082a3c45eec",
"score": "0.66434693",
"text": "def destroy\n @picture = Picture.find_by_permalink(params[:id])\n @picture.destroy\n flash[:notice] = \"Picture #{@picture.title} is deleted\"\n\n respond_to do |format|\n format.html { redirect_to(edit_admin_gallery_url(params[:gallery_id])) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "df102b1fd43791f77dc737a5a439fa74",
"score": "0.66395485",
"text": "def destroy\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to([@album, :photos]) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "38b25f83182c684d1ff6ee4b3304e5f9",
"score": "0.66274446",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "cfa1dc72c34f6cdbf7ef08dc7413fee3",
"score": "0.6608973",
"text": "def destroy\n p = Photo.find_by({ :id => params[:id] })\n p.delete\n\n redirect_to(\"/\")\n end",
"title": ""
},
{
"docid": "f2a3f29de682a8462acf3a8bcbfc7adb",
"score": "0.6608136",
"text": "def destroy\n @foto = Foto.find(params[:id])\n @foto.destroy\n\n respond_to do |format|\n format.html { redirect_to(fotos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "da7b512f03ac0cdb7ad50f602968d288",
"score": "0.6607698",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6414473a807bdbb217c0d2343d52ee24",
"score": "0.6606522",
"text": "def destroy\n @mypicture = Mypicture.find(params[:id])\n @mypicture.destroy\n\n respond_to do |format|\n format.html { redirect_to(mypictures_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "b7dccfac5d40b7209c20023d917a773a",
"score": "0.65986955",
"text": "def destroy\n @imagen = Imagen.find(params[:id])\n @imagen.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_imagens_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "16b2c92fbddfe7c5438107abeb3a509b",
"score": "0.6594203",
"text": "def destroy\n @sidepic = Sidepic.find(params[:id])\n @sidepic.destroy\n\n respond_to do |format|\n format.html { redirect_to(sidepics_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a18a42fa9d796780ea2023ade11af3cd",
"score": "0.6582978",
"text": "def destroy\n @flickr_photo = FlickrPhoto.find(params[:id])\n @flickr_photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(flickr_photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a5fffbb6673f06399416006c4837be58",
"score": "0.6582745",
"text": "def destroy\n @image = Image.find(params[:id])\n begin\n File.delete(Rails.root.join('public', 'images', @image.name))\n rescue\n logger.warning \"Unable to delete file @{image.name}\"\n end\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(images_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "865f089cc3b98e27a1b660e4d891a1e9",
"score": "0.6575942",
"text": "def destroy\n @image = Image.find(params[:id])\n\n @image.destroy\n \n respond_to do |format|\n format.html { redirect_to(params[:redirect_to] || images_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "da1d7c948339cbc95ac9c5144d293387",
"score": "0.6575812",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photos_url) }\n format.xml { head :ok }\n end\n expire_photo(@photo)\n end",
"title": ""
},
{
"docid": "8f29196680a4a59ebdddab17ed29defc",
"score": "0.6572996",
"text": "def destroy\n @jpeg = Jpeg.find(params[:id])\n @jpeg.destroy\n\n respond_to do |format|\n format.html { redirect_to(jpegs_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "1b08ce62c42d00570f56a11b3a418583",
"score": "0.65624684",
"text": "def destroy\n @photo.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "2b692e1d7731c8a4343ba849e908e488",
"score": "0.6555882",
"text": "def destroy\n @image_upload = ImageUpload.find(params[:id])\n @image_upload.destroy\n\n respond_to do |format|\n format.html { redirect_to(image_uploads_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2b692e1d7731c8a4343ba849e908e488",
"score": "0.6555882",
"text": "def destroy\n @image_upload = ImageUpload.find(params[:id])\n @image_upload.destroy\n\n respond_to do |format|\n format.html { redirect_to(image_uploads_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "6f7523a73f6edcfacef2ff0c2e23b5e1",
"score": "0.65365446",
"text": "def destroy\n @book = Book.find(params[:id])\n #画像情報の削除\n @book.images.each{|image|\n image.destroy\n }\n #ディレクトリの削除\n deleteall(\"./public/images/#{@book.id}/\") if FileTest.exist?(\"./public/images/#{@book.id}/\") == true\n #本情報の削除\n @book.destroy\n respond_to do |format|\n format.html { redirect_to books_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8b0091c7159cce2c7929e21f45c72371",
"score": "0.65349716",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n\n respond_to do |format|\n format.html { redirect_to edit_album_path @album }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "fdb5222e60f67418931a74e6eb7c9a1d",
"score": "0.6532003",
"text": "def delete\n GoodData.delete(uri)\n end",
"title": ""
},
{
"docid": "d5d934d23f998c6240f4d1b3cbdf140d",
"score": "0.65223604",
"text": "def destroy\n @track.xml_attachements.each do |xml|\n xml.uploaded_file.file.delete\n end\n @track.destroy\n respond_to do |format|\n format.html { redirect_to tracks_url, notice: 'Le tracé à été supprimé avec succès.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b06eb09aa681882302326acd3fb06b96",
"score": "0.651043",
"text": "def destroy\n @imagem = Imagem.find(params[:id])\n @imagem.destroy\n\n respond_to do |format|\n format.html { redirect_to(imagems_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "0cf882efe43f69c8e92d504567609cee",
"score": "0.6502893",
"text": "def destroy\n @photo_reflection = PhotoReflection.find(params[:id])\n @photo_reflection.destroy\n\n respond_to do |format|\n format.html { redirect_to(photo_reflections_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "96aecaa24a2cb4971df5f59226ad2420",
"score": "0.6499702",
"text": "def delete_image\n ext = \".\" + \"#{params[:format]}\"\n file_name = \"#{Rails.root}/public/images/#{params[:poi_id]}_images/#{params[:file_name]}#{ext}\"\n File.delete(file_name) if File.file?(file_name)\n redirect_to show_images_path(params[:poi_id])\n end",
"title": ""
},
{
"docid": "b965aa2e76649b84623ed925811f4794",
"score": "0.64995944",
"text": "def delete(_path)\n end",
"title": ""
},
{
"docid": "22321110882dcc460dcd4a0f84d9e654",
"score": "0.6495612",
"text": "def destroy\n @photoset_photo = PhotosetPhoto.find(params[:id])\n @photoset_photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(photoset_photos_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a15324f63aae85e0a95d110087fe9c56",
"score": "0.6493573",
"text": "def destroy\n Image.find(params[:id]).destroy\n render :update do |page|\n page[\"image_#{params[:id]}\"].remove\n end\n end",
"title": ""
},
{
"docid": "d7ac66d16809f7fba38c0e689179fed1",
"score": "0.64862114",
"text": "def destroy\n @image = Image.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(album_url(@image.album_id)) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "200174ca3a03c836d2576f67ffb934a6",
"score": "0.64861405",
"text": "def delete(filename)\n\n end",
"title": ""
},
{
"docid": "a7a293210242a1290afb3c986e1c2211",
"score": "0.64796305",
"text": "def delete!\n CouchDB.delete( uri )\n end",
"title": ""
},
{
"docid": "a7a293210242a1290afb3c986e1c2211",
"score": "0.64796305",
"text": "def delete!\n CouchDB.delete( uri )\n end",
"title": ""
},
{
"docid": "599ebacc01771268c9d04c29066a5427",
"score": "0.6477988",
"text": "def destroy\n @photo = Photo.find(params[:id])\n if @photo.destroy\n return_message(200, :ok)\n else\n return_message(200, :fail, {:err => format_errors(@photo.errors.messages)})\n end\n end",
"title": ""
},
{
"docid": "793cfdb9ecc8bf0d2d369760ba9ba511",
"score": "0.64700866",
"text": "def destroy\n @album = Album.find(params[:id])\n @album.album.destroy\n @album.destroy\n respond_to do |format|\n format.html { redirect_to(albums_path, :notice => 'photo was successfully deleted.') }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "068942d7b52d24fb3b1b02a94017fd98",
"score": "0.6469619",
"text": "def destroy\r\n @fileupload = Fileupload.find(params[:id])\r\n\r\n File.delete(\"#{RAILS_ROOT}/public/files/#{@fileupload.username+'_'+@fileupload.filename}\")\r\n @fileupload.destroy\r\n\r\n respond_to do |format|\r\n format.html { redirect_to(fileuploads_url) }\r\n format.xml { head :ok }\r\n end\r\n end",
"title": ""
},
{
"docid": "eb8adb777175bb35b7f88b10b36f92da",
"score": "0.64584553",
"text": "def destroy\n @album = Album.find(params[:id])\n deleted_files = 0\n deleted_album = @album.title\n @album.destroy\n\n respond_to do |format|\n format.html { redirect_to(albums_url, :notice => \"Deleted #{deleted_album}\") }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a429d7925c78f8d889edeb2b0e26da6a",
"score": "0.64582866",
"text": "def delete(id)\r\n request = Net::HTTP::Delete.new(\"#{@url}/#{id}.xml\")\r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"title": ""
},
{
"docid": "23a768c361ecbc093383a9c58cb63918",
"score": "0.6455163",
"text": "def destroy\n id = params[:id] \n @image = @album.images.find(id).destroy\n respond_to do |format|\n format.html { redirect_to(prank_album_images_path(@prank, @album)) }\n end\n end",
"title": ""
},
{
"docid": "b0431b0eba3784096657c0bcb18ed920",
"score": "0.6454821",
"text": "def destroy\n @knack = Knack.find(params[:id])\n \n #delete each file\n # Photo.find_each(:knack_id => params[:id]) do |photo|\n # File.delete(photo.path)\n # end\n\n #delete whole directory\n require 'fileutils'\n filedir = \"app/assets/images/\" + params[:id]\n if Dir.exists?(filedir)\n FileUtils.rm_r filedir\n end\n\n @knack.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_knack_category_path( @category ) }\n format.json { head :no_content }\n format.js #added\n end\n end",
"title": ""
},
{
"docid": "95956fb0100b6b1601f05e5e9805b413",
"score": "0.64538586",
"text": "def delete\n@image = Image.find(@params['id'])\n@image.destroy\nredirect :action => :index\nend",
"title": ""
},
{
"docid": "87fb40134d67cac4743609fa9148b6f8",
"score": "0.6453353",
"text": "def destroy\n image = Image.find_by_hash(params[:id])\n if image.nil?\n return render json: {status: \"Image Doesn't exist\"}, status: 400\n end\n image.file.purge\n image.delete\n render json: {status: \"Image deleted\"}\n end",
"title": ""
},
{
"docid": "8d7a2865f05c53c1e5661485427be0cd",
"score": "0.6453069",
"text": "def destroy\n @banner = Banner.find(params[:id])\n file = \"#{Rails.root}/public/banners/#{params[:id]}.jpg\"\n File.delete(file) if FileTest.exist?(file)\n @banner.destroy\n\n respond_to do |format|\n format.html { redirect_to admin_banners_url }\n end\nend",
"title": ""
},
{
"docid": "6cc7bf007321bba2ac0c161e763b673d",
"score": "0.645284",
"text": "def destroy\n @photo = Photo.find(params[:id])\n @photo.destroy\n \n @photoid = params[:id]\n Userphotos.where(:photoid => @photoid).destroy_all\n \n respond_to do |format|\n format.html { redirect_to photos_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "216da3b6c5850a4fbe8230ef01b08ef5",
"score": "0.6452619",
"text": "def destroy\n @picture = Picture.find(params[:id])\n @picture.remove_image!\n @picture.remove_image = true\n @picture.destroy\n\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": "1691790ee2ee34cc8e6be6f7bb8d7f8d",
"score": "0.64515454",
"text": "def delete\n client.delete uri\n end",
"title": ""
},
{
"docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d",
"score": "0.64515454",
"text": "def delete\n client.delete uri\n end",
"title": ""
},
{
"docid": "6467f771b1373852373c5f9ad4658329",
"score": "0.6444567",
"text": "def destroy\n @image = @site.images.find(params[:id])\n @image.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_site_images_url(@site)) }\n format.xml { head :ok }\n end\n end",
"title": ""
}
] |
b1d567e52e0d5be4d8b5f7d8ff0c6f5b
|
POST /replies or /replies.json
|
[
{
"docid": "c3efb8565284a0a30161950ff4ee8854",
"score": "0.74285275",
"text": "def create\n @post = Post.find(params[:post_id])\n @reply = @post.replies.new(reply_params)\n\n respond_to do |format|\n if @reply.save\n format.html { redirect_to @post, notice: \"Reply was successfully created.\" }\n format.json { render :show, status: :created, location: @reply }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "3e3b7de0abe75d77ee71aae532a0188e",
"score": "0.73354673",
"text": "def create\n content = params[:content]\n location = params[:location]\n lat = params[:lat]\n lng = params[:lng]\n @reply = @current_user.replies.new(content: content,\n location: location,\n lat: lat, lng: lng)\n @reply.post_id = @post.id\n if @reply.save\n respond_with(@reply, only: [:id, :content, :location, :lat, :lng, :created_at])\n else\n render_error(404, request.path, 20301, @reply.errors.as_json)\n end\n end",
"title": ""
},
{
"docid": "90fcd1f5f048da0adbec7cb0f72e90a8",
"score": "0.7312097",
"text": "def post\n if params[:reply_to][:id].blank?\n post_to_list\n else\n post_private_reply\n end\n end",
"title": ""
},
{
"docid": "fb52e9170da011f307cd333c65674839",
"score": "0.72992337",
"text": "def create\n @reply = user.replies.new(reply_params)\n @reply.post = @post\n\n if @reply.save\n render :show\n else\n render json: @reply.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b777c9074d640ab7911e733af7938e68",
"score": "0.7263243",
"text": "def create\n @reply = @rating.replies.new(reply_params)\n @reply.user = current_user\n if @reply.save\n render json: @reply, status: :created, location: [@rating, @reply]\n else\n render json: @reply.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d66c872d2e9c4cd582f1438750c32e02",
"score": "0.6982607",
"text": "def create\n @reply = @card.replies.create(params[:reply])\n respond_with @card, location: card_url(id: @card.access_token)\n end",
"title": ""
},
{
"docid": "25c174a7d7171f56828d985e77718b83",
"score": "0.69548815",
"text": "def create\n @reply = Reply.new(reply_params)\n respond_to do |format|\n if @reply.save\n format.html { redirect_to posts_path, notice: 'Reply was successfully created.' }\n format.json { render :show, status: :created, location: @reply }\n else\n format.html { redirect_to posts_path}\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9af227c8f8eabb1739cdaf5e4f153810",
"score": "0.6940599",
"text": "def replies\n \n end",
"title": ""
},
{
"docid": "3e9612ca0e8fafc6de00be9e7a1be3dd",
"score": "0.6891342",
"text": "def create\n if params[:reply_to_id].present?\n post_private_reply\n else\n post_to_list\n end\n end",
"title": ""
},
{
"docid": "900efc758d439b19c6a4ab837da9d403",
"score": "0.68684816",
"text": "def create\n @title = t('view.replies.new_title')\n @reply.user_id = current_user.id\n\n respond_to do |format|\n if @reply.save\n format.html { redirect_to [@question, @reply], notice: t('view.replies.correctly_created') }\n format.json { render json: @reply, status: :created, location: @reply }\n else\n format.html { render action: 'new' }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51ac1965a8847dfb85865e62414ad9bd",
"score": "0.68669754",
"text": "def create\n\t\treply_content = params[:content]\n\t\tpost = Post.find_by_id(params[:id])\n\t\treply = Reply.new\n\t\treply.content = reply_content\n\t\tnew_notification = Notification.new\n\t\tif lecturer_signed_in?\n\t\t\tcurrent_lecturer.replies << reply\n\t\t\tnew_notification.message = \"#{current_lecturer.name} \n\t\t\thas replied to your post <a href= '/posts/#{post.id}'> '#{post.title}'</a>\"\n\t\telsif teaching_assistant_signed_in?\n\t\t\tcurrent_teaching_assistant.replies << reply\n\t\t\tnew_notification.message = \"#{current_teaching_assistant.name} \n\t\t\thas replied to your post <a href= '/posts/#{post.id}'> '#{post.title}'</a>\"\n\t\telse\n\t\t\tcurrent_student.replies << reply\n\t\t\tnew_notification.message = \"#{current_student.name} \n\t\t\thas replied to your post <a href= '/posts/#{post.id}'> '#{post.title}'</a>\"\t\n\t\tend\n\t\tif reply.owner != post.owner\n\t\t\tnew_notification.save\n\t\t\tpost.owner.notifications << new_notification\n\t\tend\n\t\tpost.replies << reply\n\t\trender json: reply\n\tend",
"title": ""
},
{
"docid": "8eed96d1faffd26b14aadcffd118d506",
"score": "0.6857334",
"text": "def create\n @reply = Reply.new(params[:reply])\n @reply.user = current_user\n\n respond_to do |format|\n if @reply.save\n format.html { redirect_to posts_path, notice: 'Reply was successfully created.' }\n format.json { render json: @reply, status: :created, location: @reply }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2fe70c8cb7b4a3ca4251fb09e977e8fb",
"score": "0.67975414",
"text": "def create\n @topic = Topic.find(params[:topic_id])\n @reply = @topic.replies.new(params[:reply])\n @reply.author = current_user\n\n respond_to do |format|\n if @reply.save\n flash[:notice] = 'Reply was successfully created.'\n format.html { redirect_to(@topic) }\n format.xml { render :xml => @reply, :status => :created, :location => [@topic, @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": "0a06ad7620e785009b6a799afff0668d",
"score": "0.6780603",
"text": "def create\n @reply = Reply.new(params[:reply])\n\n respond_to do |format|\n if @reply.save\n format.html { redirect_to @reply, notice: 'Reply was successfully created.' }\n format.json { render json: @reply, status: :created, location: @reply }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "af07dc01523901accd2d9e9706e7517f",
"score": "0.6749608",
"text": "def receive\n perform_request(:post, '/rest/v2/reply.json')\n end",
"title": ""
},
{
"docid": "3a3b9780385e70573be747ba758027af",
"score": "0.674013",
"text": "def post_replies\n @replies = @post.replies\n render_results(@replies)\n end",
"title": ""
},
{
"docid": "5c6942868c6581a68ea3d3137a802dad",
"score": "0.6708906",
"text": "def create\n if current_user\n @reply = Reply.new(reply_params)\n if !reply_params[:content].blank?\n respond_to do |format|\n if @reply.save\n @reply.vote_by :voter => current_user\n if !@reply.comment.nil?\n format.html { redirect_to @reply.comment.submission }\n format.json { render :show, status: :created, location: @reply }\n else\n format.html { redirect_to @reply.parent.submission }\n format.json { render :show, status: :created, location: @reply }\n end\n else\n format.html { redirect_to '/comments/' + (@reply.comment.id).to_s + '/new_reply' }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to \"/comments/\" + (@reply.comment.id).to_s + \"/new_reply\", :notice => \"Write a reply\"\n end\n else\n redirect_to \"auth/google_oauth2\"\n end\n end",
"title": ""
},
{
"docid": "4d603c7ab26364196b32fa7c3a0faa2a",
"score": "0.6708651",
"text": "def create\n data = reply_params\n data[:created_user] = @loggined_user_id if @loggined_user_id != nil\n @reply = Reply.new(data)\n respond_to do |format|\n if @reply.save\n format.html { redirect_to @reply, notice: 'Reply was successfully created.' }\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",
"title": ""
},
{
"docid": "c20d6c8108e0facde16e3837dcdbee96",
"score": "0.66887116",
"text": "def create\n @reply = Reply.new(params[:reply])\n\n respond_to do |format|\n if @reply.save\n format.html { redirect_to @reply, notice: 'Reply was successfully created.' }\n format.json { render json: @reply, status: :created, location: @reply }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "984f72da4e7b8de65fb430933a55d45a",
"score": "0.66722834",
"text": "def replies\n @status = Status.new\n @user = current_user\n opts = conditions\n opts[:user_id] = @user.id\n @statuses = Status.replies_for(opts)\n render_for_api(@statuses)\n end",
"title": ""
},
{
"docid": "f288134eed770bb40240a7416dc96db5",
"score": "0.66551334",
"text": "def create\n @reply = Reply.new(params[:reply])\n @reply.parent_post_id = params[:reply][:parent_post_id]\n @reply.post_id = params[:reply][:post_id]\n @post = Post.where(:id => @reply.parent_post_id).first\n\n\n respond_to do |format|\n if @reply.save\n format.html { redirect_to @post, notice: 'Reply was successfully created.' }\n format.json { render json: @reply, status: :created, location: @reply }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c528879d7844c8d91973ecacfe3367d3",
"score": "0.6644398",
"text": "def create\n @reply = @video.replies.new(reply_params)\n\n respond_to do |format|\n if @reply.save\n format.html { redirect_to [@user, @video, @reply], notice: 'Reply was successfully created.' }\n format.json { render :show, status: :created, location: [@user, @video, @reply] }\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": "b4ef9dbc57a5ab9b698a50dab78c225b",
"score": "0.66393185",
"text": "def create\n\t\t# Creates a reply within a discussion \n\t\t@reply = @discussion.replies.create(params[:reply].permit(:reply, :discussion_id))\n\t\t# Sets the reply user id to the current user\n\t\t# Show that we can show what user wrote that reply\n\t\t@reply.user_id = current_user.id\n\n\t\trespond_to do |format|\n\t\t\tif @reply.save \n\t\t\t\t# If the reply has saved, redirect to the discussion\n\t\t\t\tformat.html { redirect_to discussion_path(@discussion) }\n\t\t\t\t# Allows us to load a new reply without having to refresh the whole page\n\t\t\t\tformat.js # render create.js.erb\n\t\t\telse\n\t\t\t\t# If the reply did not save, show error message\n\t\t\t\tformat.html { redirection_to discussion_path(@discussion), \n\t\t\t\t\tnotice: 'Reply did not save. Please try again'}\n\t\t\t\t# Allows us to load a new reply without having to refresh the whole page\n\t\t\t\tformat.js # render create.js.erb\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b26ad2dfe7cc165b2f7c1011bb30520f",
"score": "0.6607997",
"text": "def new\n @reply = Reply.new\n @reply.post_id = params[:post_id]\n @replies = Reply.find_all_by_post_id(@reply.post_id)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reply }\n end\n end",
"title": ""
},
{
"docid": "895099d649db7145115e9d84eb218616",
"score": "0.6600237",
"text": "def replyrecursive\n if current_user.nil?\n redirect_to user_google_oauth2_omniauth_authorize_path\n else\n @reply = Reply.new(reply_params)\n @reply.user_id = current_user.id\n \n respond_to do |format|\n if @reply.save\n format.html { redirect_to \"/\"+ @reply.findContribution(@reply.id).to_s}\n format.json { render :show, status: :created, location: @reply }\n else\n format.html { redirect_to Reply.find(@reply.reply_id), notice: \"Reply can't be blank\" }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "5cd7a07d3b4f285906c9474a2485a107",
"score": "0.6582497",
"text": "def create\n\t\t@reply = Reply.new(params[:reply])\n\t\t@reply.user_id = current_user.id\n\t\t@reply.topic_id = params[:reply][:topic_id]\n\n\t\trespond_to do |format|\n\t\t\tif @reply.save\n\t\t\t\tformat.html { redirect_to admin_reply_path(@reply), notice: 'Η απάντηση δημιουργήθηκε με επιτυχία' }\n\t\t\t\tformat.json { render json: @reply, status: :created, location: @reply }\n\t\t\telse\n\t\t\t\tformat.html { redirect_to admin_reply_path(@reply), alert: 'Η απάντηση ήταν άκυρη' }\n\t\t\t\tformat.json { render json: @reply.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "0d3f7ad71ef3b59f69b07d80f4381846",
"score": "0.6569521",
"text": "def create\n @post = current_user.posts.build(post_params)\n if @post.save\n @post.update_attribute(:reply_at, @post.created_at)\n @reply = @post.replies.build(user_id: current_user.id, content: @post.content) \n @reply.save\n redirect_to @post\n flash.now[:success] = \"Post success!\"\n else\n render 'new' \n end\n end",
"title": ""
},
{
"docid": "c372b281d11df4dbbb4a8cffab8eee05",
"score": "0.6561352",
"text": "def create\n @post = Post.new(params[:post])\n\n respond_to do |format|\n if @post.save\n if @post.reply_id != nil\n format.html { redirect_to action: \"display_all_replies\", :id => @post.reply_id}\n format.json { render json: @post, status: :created, location: @post }\n else\n format.html { redirect_to action: \"index\" }\n format.json { render json: @post, status: :created, location: @post }\n end\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b5b302f434f32a2ad5a746b6f78e6ba9",
"score": "0.6539226",
"text": "def index\n reslyp = current_user.reslyps.find(params[:id])\n reslyp.replies.where.not(sender_id: current_user.id).update_all(seen: true)\n @replies = reslyp.replies.order(:created_at)\n render status: 200, json: present_collection(@replies),\n each_serializer: ReplySerializer\n end",
"title": ""
},
{
"docid": "48c5c1a420b45a756d760d634b195b27",
"score": "0.65292704",
"text": "def create\n @reply = Reply.new(params[:reply])\n @reply.user_id = current_user.id\n @reply.post_id = session[:post_id]\n @reply.vote_count = 0\n respond_to do |format|\n if @reply.save\n format.html { redirect_to reply_path(@reply.post_id), notice: 'Reply was successfully created.' }\n format.json { render json: @reply, status: :created, location: @reply }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2b4e585a1a0d9f5bdb3ac651d33b43e",
"score": "0.6524232",
"text": "def create\n @reply = Reply.new(params[:reply])\n @reply.topic_id = params[:topic_id]\n respond_to do |format|\n @reply.user_id = session[:user_id]\n if @reply.save\n format.html { redirect_to \"/topics/#{@reply.topic_id}/replies\"}\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": "5d8e1014fc382e78104e9b8aaf9a1828",
"score": "0.6518482",
"text": "def index\n @replies = Reply.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @replies }\n end\n end",
"title": ""
},
{
"docid": "5d8e1014fc382e78104e9b8aaf9a1828",
"score": "0.6518482",
"text": "def index\n @replies = Reply.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @replies }\n end\n end",
"title": ""
},
{
"docid": "7c904d21e1f52c571c9130a788287844",
"score": "0.6486563",
"text": "def replies\r\n RepliesController.instance\r\n end",
"title": ""
},
{
"docid": "5debf280ff8e7c94a4c5fccd098df1b5",
"score": "0.64562416",
"text": "def create\n reply = Reply.new(reply_params)\n\n if reply.save\n flash[:success] = \"Reply created successfully!\"\n redirect_to post_path(Post.find(reply.post_id))\n else\n flash.now[:danger] = 'Invalid Reply'\n redirect_to \"replies/new?post=#{reply_params[:post_id]}\"\n #redirect_to \"/replies/new?post=#{@reply.post_id}\"\n #redirect_to :action => 'new', :post => @reply.post_id\n end\n end",
"title": ""
},
{
"docid": "c0cac744c02085d11d85499a4a35d4ad",
"score": "0.6442971",
"text": "def create\n @post = Micropost.find_by_id(params[:id])\n #@reply = @post.replies.build.(params[:reply])\n @reply = @post.replies.build(params[:reply])\n #@reply = current_user.reply.build(params[:reply])\n #respond_to do |format|\n if @reply.save\n #format.html { redirect_to @reply, notice: 'Reply was successfully created.' }\n #format.json { render json: @reply, status: :created, location: @reply }\n flash[:success] = \"Reply was successfully created!\"\n\n else\n #format.html { render action: \"new\" }\n #format.json { render json: @reply.errors, status: :unprocessable_entity }\n @feed_items = []\n render 'pages/home'\n end\n #end\n private\n\n def authorized_user\n @reply = current_user.reply.find_by_id(params[:id])\n redirect_to root_path if @reply.nil?\n end\n end",
"title": ""
},
{
"docid": "90b8f4f6973dc282be5089249aca6216",
"score": "0.643827",
"text": "def create\n authorize\n @reply = Reply.new(params[:reply])\n @reply.user_id = current_user.id\n\n respond_to do |format|\n if @reply.save\n format.html { redirect_to @reply, notice: 'Reply was successfully created.' }\n format.json { render json: @reply, status: :created, location: @reply }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5a53b82b99189b8b64b508a67fb2acf4",
"score": "0.64286685",
"text": "def create\n\n @comment = Comment.find(params[:comment_id])\n @commentreply = @comment.commentreplies.new(commentreply_params)\n @commentreply.user = current_user\n\n\n respond_to do |format| \n if @commentreply.save\n format.html { redirect_to @comment,notice:'Commentreply was successfully created.' }\n format.json { render :show, status: :created, location: @commentreply }\n else\n format.html { render :new }\n format.json { render json: @commentreply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c221557421802d670e70f4237b52f091",
"score": "0.6424328",
"text": "def reply\n @message = Message.new\n @message.parent = Message.find_by_id(params[:id]) || ( not_found and return )\n @message.recipient = @message.parent.sender\n authorize! :reply, @message.parent\n add_breadcrumb @message.thread.subject, cooperative.message_path(@message.parent)\n add_breadcrumb :reply.l, cooperative.reply_message_path(@message.parent)\n\n respond_to do |format|\n format.html # reply.html.erb\n format.json { render :json => @message }\n end\n end",
"title": ""
},
{
"docid": "06964cc37884b0953126a4afc6b70d37",
"score": "0.6413785",
"text": "def create\n @reply = Reply.new(params[:reply])\n\n respond_to do |format|\n if @reply.save\n flash[:notice] = 'Post was successfully created.'\n format.html { redirect_to(@reply.post) }\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": "0e1e90f3de1d4ee40b1012f1d265fb5b",
"score": "0.64111316",
"text": "def create\n @forum = Forum.find(params[:forum_id])\n @reply = @forum.replies.new(reply_params)\n @reply.user_id = current_user.id\n @forum.updated_at = Time.now\n @forum.save!\n\n respond_to do |format|\n if @reply.save\n format.html { redirect_to forum_path(@forum), notice: 'Reply was successfully created.' }\n format.json { render action: 'show', status: :created, location: @reply }\n original_poster = User.find(@forum.user_id)\n Usermailer.reply_notification(original_poster, current_user, forum_url(@forum)).deliver\n else\n format.html { redirect_to forum_path(@forum), notice: 'Reply was NOT created.' }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "284db21a1aa8da5d0c00d0db485273b8",
"score": "0.63870114",
"text": "def create_reply\n @discussion = Discussion.find(params[:discussion_id])\n @forum = Forum.find(@discussion.forum_key)\n @reply_to_post = ForumPost.find(params[:forum_post][:reply_to_post])\n @current_user = current_user\n @forum_post = ForumPost.reply_to(@reply_to_post, @current_user, new_reply_params)\n\n respond_to do |format|\n if @forum_post.save\n redirect_url = \"/discussions/#{@discussion.key}/##{@forum_post.key}\"\n format.html { redirect_to redirect_url, notice: 'Forum post was successfully created.' }\n format.json { render action: 'show', status: :created, location: @forum_post }\n else\n format.html { render action: 'new' }\n format.json { render json: @forum_post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5ddfef151e543c64ddc3c9c568eb71c2",
"score": "0.63778234",
"text": "def replies=(value)\n @replies = value\n end",
"title": ""
},
{
"docid": "a1be87c62513bd1df11fe41996eca7f8",
"score": "0.6374648",
"text": "def create\n \n auth_user = current_user\n begin\n tmp = User.where(\"oauth_token=?\", request.headers[\"HTTP_API_KEY\"])[0]\n if (tmp)\n auth_user = tmp\n end\n rescue\n # intentionally left out\n end\n \n if auth_user\n @reply = Reply.new(reply_params)\n @reply.user = auth_user\n \n \n respond_to do |format|\n if @reply.save\n current_user&.vote_for(@reply)\n format.html { redirect_to @reply.comment.submission, notice: 'Reply was successfully created.' }\n format.json { render :show, status: :created, location: @reply }\n else\n format.html { redirect_to '/comments/' + (@reply.comment.id).to_s + '/new_reply', notice: 'Reply not created, you have to fill de field content' }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n else\n redirect_to \"/auth/google_oauth2\"\n end\n end",
"title": ""
},
{
"docid": "c5487eefdb7ffd9fd71751174e36c530",
"score": "0.637169",
"text": "def update\n @question = Question.find(params[:question_id])\n @reply = @question.replies.find(params[:id])\n\n respond_to do |format|\n if @reply.update_attributes(params[:reply])\n format.html { redirect_to @question, notice: 'Reponse was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d44e1bf96e791e29397ee9ce7dfa35c1",
"score": "0.63701534",
"text": "def reply\n @post = Post.find_by_id(params[:id])\n end",
"title": ""
},
{
"docid": "4fa7dd57156b9badda7a4bc899af4599",
"score": "0.63582075",
"text": "def create\n @reply = Reply.new(params[:reply])\n @reply.author = current_user\n\n respond_to do |format|\n if @reply.save\n receipt = NotificationsManager.notify( @reply.topic.author, t(\"notifications.reply_topic\", who: current_user.nick), view_context.link_to(@reply.topic.title, @reply.topic), current_user)\n\n format.html { redirect_to @reply, notice: t(\"replies.reply_created\") }\n format.json { render json: @reply, status: :created, location: @reply }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6b954c3ea38bb2c2a82652e0bf167e40",
"score": "0.6353409",
"text": "def replies(query={})\n perform_get('/statuses/replies.json', :query => query)\n end",
"title": ""
},
{
"docid": "6b954c3ea38bb2c2a82652e0bf167e40",
"score": "0.635175",
"text": "def replies(query={})\n perform_get('/statuses/replies.json', :query => query)\n end",
"title": ""
},
{
"docid": "b3f90784a7e18822f71f595165aa5e91",
"score": "0.6349741",
"text": "def reply_params\n params.require(:reply).permit(:user_id, :post_id, :body, :created_at)\n end",
"title": ""
},
{
"docid": "68f51b6da6ac8f98d03575a6710218b9",
"score": "0.63313276",
"text": "def reply\r\n @conversation = current_user.mailbox.conversations.find(params[:id])\r\n render json: current_user.reply_to_conversation(@conversation, params[:body])\r\n end",
"title": ""
},
{
"docid": "96cb9db1e03b32f63efc1508b32777fd",
"score": "0.6331108",
"text": "def create\n @postreply = Postreply.new(postreply_params)\n\n respond_to do |format|\n if @postreply.save\n post = Post.find(id=@postreply.post_id)\n forum = Forum.find(id=post.forum_id)\n\n format.html { redirect_to forum_post_path(forum, post)}\n format.json { render :show, status: :created, location: @postreply }\n else\n format.html { render :new }\n format.json { render json: @postreply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "88572bd8b295cbb621364f0849a8697d",
"score": "0.6321371",
"text": "def new\n @title = t('view.replies.new_title')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reply }\n end\n end",
"title": ""
},
{
"docid": "d2d99f17fb8cbb379ed0275317376871",
"score": "0.63017166",
"text": "def create\n @title = t 'view.replies.new_title'\n @reply.user_id = current_user.id\n\n respond_to do |format|\n if @reply.save\n format.html { redirect_to [@question, @reply], notice: t('view.replies.correctly_created') }\n format.json { render json: @reply, status: :created, location: @reply }\n format.js # create.js.erb\n else\n format.html { render action: 'new' }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n format.js # create.js.erb\n end\n end\n end",
"title": ""
},
{
"docid": "0b29f2979de5225722a34b04020530bc",
"score": "0.6298948",
"text": "def index\n @replies = Reply.all\n end",
"title": ""
},
{
"docid": "0b29f2979de5225722a34b04020530bc",
"score": "0.6298948",
"text": "def index\n @replies = Reply.all\n end",
"title": ""
},
{
"docid": "0b29f2979de5225722a34b04020530bc",
"score": "0.6298948",
"text": "def index\n @replies = Reply.all\n end",
"title": ""
},
{
"docid": "0b29f2979de5225722a34b04020530bc",
"score": "0.6298948",
"text": "def index\n @replies = Reply.all\n end",
"title": ""
},
{
"docid": "0b29f2979de5225722a34b04020530bc",
"score": "0.6298948",
"text": "def index\n @replies = Reply.all\n end",
"title": ""
},
{
"docid": "0b29f2979de5225722a34b04020530bc",
"score": "0.6298948",
"text": "def index\n @replies = Reply.all\n end",
"title": ""
},
{
"docid": "0b29f2979de5225722a34b04020530bc",
"score": "0.6298948",
"text": "def index\n @replies = Reply.all\n end",
"title": ""
},
{
"docid": "0b29f2979de5225722a34b04020530bc",
"score": "0.6298948",
"text": "def index\n @replies = Reply.all\n end",
"title": ""
},
{
"docid": "b5b637b6ee3532bbdd32baeedf3ebe1b",
"score": "0.6286873",
"text": "def createreply\n #create the reply object\n @user = User.find_by_userName(session[:userName])\n @post = Post.new(:user_id => @user.id, :postString => params[:replyContent], :parentPostID => params[:parentPostID], :totalVotes => 0)\n\n respond_to do |format|\n #save the reply and redirect to the parent post page for display\n if @post.save\n format.html { redirect_to Post.find(params[:parentPostID]), notice: 'Reply to this post is saved. See the \\'All replies\\' section.' }\n format.json { render json: Post.find(params[:parentPostID]), status: :created, location: Post.find(params[:parentPostID]) }\n else\n format.html { render action: \"new\" }\n format.json { render json: @post.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bde69867f11ff61b534c22c54d887cc5",
"score": "0.6277359",
"text": "def create\n\t\t@topic = Topic.find(params[:id])\n\t\t@topic_reply = TopicReply.new(topic_reply_params)\n\t\t@topic_reply.user_id = current_user.id\n\t\t@topic_reply.topic_id = @topic.id\n\t\t@replies_of_topic = \n\t\trespond_to do |format|\n\t\t\tif @topic_reply.save\n\t\t\t\t@topic.reply_count = @topic.reply_count+1\n\t\t\t\t@topic.save\n\t\t\t\tformat.html { redirect_to @topic, notice: 'Topic reply was successfully created.' }\n\t\t\t\tformat.json { render :show, status: :created, location: @topic_reply }\n\t\t\t\tformat.js\n\t\t\telse\n\t\t\t\tformat.html { render :new }\n\t\t\t\tformat.json { render json: @topic_reply.errors, status: :unprocessable_entity }\n\t\t\t\tformat.js\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "9da2aeef5be879e36ce838dcc81ecdc4",
"score": "0.6264045",
"text": "def new\n @title = t 'view.replies.new_title'\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reply }\n end\n end",
"title": ""
},
{
"docid": "9af42e8545cfd80249dbefcac1de24eb",
"score": "0.6254784",
"text": "def reply\n @conversation = Conversation.find(params[:id])\n authorize! :reply, @conversation\n if request.method == \"POST\"\n @message = Message.new(:content => params[:conversation][:content], :author => current_user)\n @message.conversation = @conversation\n @conversation.unread_by!(@conversation.the_other_user(current_user))\n @conversation.save\n if @conversation.save && @message.save\n return redirect_to conversation_path(@conversation)\n end\n else\n @message = Message.new\n end\n show_new_and_reply\n end",
"title": ""
},
{
"docid": "da3da96ae1914d7d898138638fce18ce",
"score": "0.6254398",
"text": "def reply_params\n params.require(:reply).permit(:content, :user_id, :comment_id, :reply_id)\n end",
"title": ""
},
{
"docid": "e78d36a4985d0d21bd168cc9dbfc9f94",
"score": "0.62314594",
"text": "def reply_params\n params.require(:reply).permit(:user_id, :post_id, :text)\n end",
"title": ""
},
{
"docid": "0122c54b54d0d9fbcb192b41784673de",
"score": "0.62275815",
"text": "def new\n @reply = @topic.replies.build\n\n respond_to do |format|\n format.html # new.html.erb\n #format.xml { render :xml => @reply }\n end\n end",
"title": ""
},
{
"docid": "34c31abbc84b94b413c51ab12b19447f",
"score": "0.62262684",
"text": "def new\n @topic = Topic.find(params[:topic_id])\n @reply = @topic.replies.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @reply }\n end\n end",
"title": ""
},
{
"docid": "bd3f541b7651f7ab6829869bcca76610",
"score": "0.62260854",
"text": "def new\n @reply = Reply.new\n #@reply.post = Post.find(params[:post_id]) <- need to past into create\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reply }\n end\n end",
"title": ""
},
{
"docid": "b47e870e854e435c9f65ea49147c5752",
"score": "0.62168384",
"text": "def reply\n user = @current_user\n base_comment = Comment.find(params[:id])\n\n if base_comment && user\n @new_reply = Comment.new(content: params[:content])\n base_comment.replies << @new_reply\n user.comments << @new_reply\n else\n end\n end",
"title": ""
},
{
"docid": "70aee3ef26a10527d4ee0a8fb5689162",
"score": "0.61978984",
"text": "def update\n\t\t# Find the reply\n\t\t@reply = @discussion.replies.find(params[:id])\n\n\t\trespond_to do |format|\n\t\t\tif @reply.update(reply_params)\n\t\t\t\t# If the reply was successfully updated, display a notice to \n\t\t\t\t# the user and go to the discussion\n\t\t\t\tformat.html { redirect_to discussion_path(@discussion), \n\t\t\t\t\tnotice: 'Reply was updated.'}\n\t\t\telse \n\t\t\t\t# If the reply wasn't added, redirect to the edit page\n\t\t\t\tformat.html { render :edit }\n\t\t\t\tformat.json { redner json: @reply.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "acac32d614176e2bdf6b62aa93373ae2",
"score": "0.6195034",
"text": "def reply_params\n params.require(:reply).permit(:post_id, :content, :user_id)\n end",
"title": ""
},
{
"docid": "0b37a96db6994078bb58d8960f0116f0",
"score": "0.61882323",
"text": "def get_replies\n respond_to do |format|\n format.json { render json: Photo.find_all_by_recipient_id(params[:user_id]).map{|p| {id: p.id, user_id: p.user_id, updated_at: p.updated_at} } }\n end\n end",
"title": ""
},
{
"docid": "b806e3d4807b0a290a8e4f280bd30a83",
"score": "0.6181997",
"text": "def reply_params\n params.require(:reply).permit(:content, :user_id, :comment_id)\n end",
"title": ""
},
{
"docid": "b806e3d4807b0a290a8e4f280bd30a83",
"score": "0.6181997",
"text": "def reply_params\n params.require(:reply).permit(:content, :user_id, :comment_id)\n end",
"title": ""
},
{
"docid": "e646147280f6deb543d321b9a7f7edad",
"score": "0.617975",
"text": "def handle_replies(data)\n dup = data.dup\n _kind, data = dup[\"kind\"], dup[\"data\"]\n modhash, children = data[\"modhash\"], data[\"children\"]\n if children.is_a?(Array)\n @replies = children.map{|reply| Comment.new(reply[\"data\"], :mode => :replies) }\n end\n true\n end",
"title": ""
},
{
"docid": "92dbf56bd45fc0aa808652fb6cafc26e",
"score": "0.6174822",
"text": "def reply_params\n params.require(:reply).permit(:user_id, :comment_id, :content)\n end",
"title": ""
},
{
"docid": "43efad3814546abee28804d88e3addc8",
"score": "0.6164064",
"text": "def reply_params\n params.require(:reply).permit(:reply, :post_id, :author)\n end",
"title": ""
},
{
"docid": "531af5535f1c3477f1ed1330fcb97e31",
"score": "0.6162674",
"text": "def create\n @reply = @discussion.replies.create(params[:reply]).permit(:reply , :discussion)\n # create a reply within the discussion \n reply.user_id = current_user.id\n #show who creates the reply.\n\n\n respond_to do |format| #create a record within another record\n\n if @reply.save #if reply is saved, render format which is discussion path in params discussion id\n format.html {redirect_to discussion_path(@discussion)}\n format.js #render create.js.erb (ajax)\n else\n format.html {redirect_to discussion_path(@discussion), notice: 'Reply not saved. Please try again !'}\n format.js\n end\n end\n end",
"title": ""
},
{
"docid": "fccca9c5ed300942829ed6e446c7d348",
"score": "0.61601746",
"text": "def reply\n reply_to = ForumPost.find(params[:id])\n @forum_post = ForumPost.new(:parent_id => reply_to.id)\n render :action => :new\n end",
"title": ""
},
{
"docid": "c660b9a44a6c119aae53b04975a09cff",
"score": "0.6153887",
"text": "def update\n respond_to do |format|\n if @reply.update(reply_params)\n if !@reply.comment.nil?\n format.html { redirect_to @reply.comment.submission }\n format.json { render :show, status: :ok, location: @reply }\n else\n format.html { redirect_to @reply.parent.submission }\n format.json { render :show, status: :ok, location: @reply }\n end\n else\n format.html { render :edit }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "21d2551748ac8c1b940f0489a7b73f0f",
"score": "0.6146153",
"text": "def reply\n @reply_to_post = ForumPost.find(params[:reply_to_post])\n @forum = Forum.find(@reply_to_post.forum_key)\n @discussion = Discussion.find(params[:discussion_id])\n @current_user = current_user\n @forum_post = ForumPost.reply_to(@reply_to_post, @current_user)\n end",
"title": ""
},
{
"docid": "9ea5856652a008e3fbfa0f7e5d3a83f4",
"score": "0.6144043",
"text": "def create\n if @reply.save\n flash[:notice] = 'reply was successfully created.'\n redirect_to(@reply.comment.article)\n else\n flash[:notice] = \"Error creating reply: #{@reply.errors}\"\n redirect_to(@reply.comment.article)\n end\n end",
"title": ""
},
{
"docid": "e8b62e48ef836504832be9f6a8f7beb5",
"score": "0.6140788",
"text": "def create\n @forum = @topic.forum\n @reply = @topic.replies.build(params[:reply])\n\n respond_to do |format|\n if @reply.save\n flash[:notice] = 'Reply was successfully created.'\n format.html { redirect_to(@topic) }\n #format.xml { render :xml => @topic, :status => :created, :location => @topic }\n else\n format.html { render :action => \"new\" }\n # format.xml { render :xml => @topic.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "753b6967dd984c8c923ab6b3f863a118",
"score": "0.6140274",
"text": "def reply\n begin\n object_type = params[:object_type].camelize\n object_id = BSON::ObjectId.from_string(params[:object_id])\n parent_id = BSON::ObjectId.from_string(params[:parent_id])\n\n #get object\n @object = object_type.singularize.constantize.find(object_id)\n\n #get comment parent\n @comment = Comment.find_by(id: parent_id)\n if @comment.nil?\n throw Exception\n end\n\n #build new comment\n @reply = Comment.new\n @reply.object_id = object_id\n @reply.object_type = object_type\n @reply.parent = @comment\n\n if params[:comment]\n @reply.content = params[:comment].strip\n end\n\n #author of comment\n user_id = session[:user_id]\n author = User.find(user_id)\n if !author.nil?\n @reply.author = author\n @reply.author_info = {_id: author.id, user_name: author.user_name}\n end\n\n if @reply.save\n #get total comments\n @total_comments = Comment.get_total_comments(@object.id, @object.object_type)\n @total_replies = @comment.replies.count\n\n # create notify to mentor\n # if @object.get_author.id != @comment.author.id\n # begin\n # notify_new_comment(@object, @reply.id, Notification::COMMENT_TYPE, @object.id, @object.object_type)\n # rescue Exception => e\n # logger.error(\"notification save error: #{e.message}\")\n # end\n # end\n\n # response\n respond_to do |format|\n format.js\n format.html\n end\n else\n respond_to do |format|\n if @reply.errors\n flash.now[:error] = @reply.errors.full_messages.to_sentence(:last_word_connector => ', ');\n else\n flash.now[:error] = t('comments.msg_reply_fail')\n end\n format.js { render action: 'reply_fail' }\n format.html\n end\n end\n rescue Exception => e\n logger.error(\"Comment save error: #{e.message}\")\n respond_to do |format|\n flash.now[:error] = t('comments.msg_reply_fail')\n format.js { render action: 'reply_fail' }\n #format.html\n end\n end\n end",
"title": ""
},
{
"docid": "2e97e4cf5db76404bd71225e435ca704",
"score": "0.6136148",
"text": "def reply token, api_message, api_step\n Message.find(api_message.id).replies.create(:step_id => api_step.id, :user => current_user)\n end",
"title": ""
},
{
"docid": "409e38a66909f87f91af60f42d7ee4d1",
"score": "0.6135151",
"text": "def index\n @replies = @post.replies\n end",
"title": ""
},
{
"docid": "17c02f83ea4b67b58273be82a95d03d3",
"score": "0.6133063",
"text": "def reply_params\n params.require(:reply).permit(:title, :body, :user_id, :comment_id, :published_at)\n end",
"title": ""
},
{
"docid": "66ac3fe3c75907e334e5a54d5b87c54d",
"score": "0.61228466",
"text": "def create\n @reply = Reply.new(params[:reply].permit(:content, :argument_id))\n @reply.user_id = current_user.id\n\n respond_to do |format|\n if @reply.save\n format.html { redirect_to @reply.argument.discussion, notice: 'Reply was successfully created.' }\n format.json { render :show, status: :created, location: @reply }\n else\n format.html { redirect_to @reply.argument.discussion, notice: 'Ouch! Some problem here' }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "89188a7d76c14bb5f4eb27c1fd851fd8",
"score": "0.61146086",
"text": "def destroy\n @reply.destroy\n respond_to do |format|\n format.html { redirect_to replies_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d26e707b80539d0f5cbd98b6ca157958",
"score": "0.61111504",
"text": "def destroy\n @post = Post.find(params[:id])\n post_id = @post.id\n replies = @post.replies\n @post.destroy\n replies.each {|reply| reply.destroy}\n\n respond_to do |format|\n format.html { redirect_to :controller => \"posts\", :action=> \"new\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "4c7d6a965d738228d3ed6b9e9b32a49e",
"score": "0.61105216",
"text": "def conversations_replies(options = {})\n raise ArgumentError, 'Required arguments :channel missing' if options[:channel].nil?\n raise ArgumentError, 'Required arguments :ts missing' if options[:ts].nil?\n options = options.merge(channel: conversations_id(options)['channel']['id']) if options[:channel]\n if block_given?\n Pagination::Cursor.new(self, :conversations_replies, options).each do |page|\n yield page\n end\n else\n post('conversations.replies', options)\n end\n end",
"title": ""
},
{
"docid": "0e08725edeba5d4bf1a4f1e69b0b6654",
"score": "0.60962284",
"text": "def new\n @reply_text = current_user.reply_texts.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reply_text }\n end\n end",
"title": ""
},
{
"docid": "dfdcc6a5d4570ecadab44b4e2c68230a",
"score": "0.60929483",
"text": "def reply_params\n params.require(:reply).permit(:name, :comment_id, :user_id)\n end",
"title": ""
},
{
"docid": "ffd8d69b54fd8e97f7408348e49a5d3f",
"score": "0.60842663",
"text": "def create\n @reply = Reply.new(reply_params)\n\n respond_to do |format|\n if @reply.save\n current_project.update_section_status(@reply.prompt.top_section)\n format.html do\n set_reply_exclusion(@reply.id)\n n = next_prompt(current_project, @reply.prompt.section)\n redirect_to n, notice: 'Reply was successfully created.'\n end\n format.json { render action: 'show', status: :created, location: @reply }\n else\n format.html { render action: 'new' }\n format.json { render json: @reply.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "356c1e5aa96d10a65444bafbb2b99e2a",
"score": "0.6083681",
"text": "def reply\n if logged_in?\n if params[:reply]\n @reply = Question.new(params[:reply])\n @reply.correct_flag=0\n @reply.user_id = current_user.id\n @reply.save\n @user = current_user\n @parent = Question.find(@reply.parentid)\n @answers = Question.findanswers(@parent.id.to_s)\n @answer = Question.find_all_by_id(@reply.id)\n respond_to do |format|\n flash[:notice] = 'Your answer was submitted successfully.'\n format.js\n format.html { redirect_to(question_path(@parent))}\n format.xml { render :xml => @reply }\n end\n end\n else\n flash[:notice] = 'Your must login or create an account to reply to a question.'\n redirect_to :controller => 'account', :action => 'login'\n end\n end",
"title": ""
},
{
"docid": "f2e92be30eadac834dff717948e2ced7",
"score": "0.60755056",
"text": "def reply_params\n params.require(:reply).permit(:texto, :user_id, :comment_id)\n end",
"title": ""
},
{
"docid": "935162d854e9233f3fd1706d57a6044b",
"score": "0.60733354",
"text": "def reply_params\n params.require(:reply).permit(:name, :email, :message, :post_id)\n end",
"title": ""
},
{
"docid": "43f4f832a144d311dda225e08e6514c0",
"score": "0.60684156",
"text": "def update_replies\n if self.in_reply_to_status_id\n Tweet.push({:tweet_id => self.in_reply_to_status_id}, :reply_ids => self.id)\n Tweet.increment({:tweet_id => self.in_reply_to_status_id}, :reply_count => 1)\n end\n end",
"title": ""
}
] |
0d1d35e2f3b51df560dacd9fa0f85f34
|
Use dylib instead of so
|
[
{
"docid": "e8f277f31fb65847265234ca2c98c49f",
"score": "0.0",
"text": "def patches; DATA; end",
"title": ""
}
] |
[
{
"docid": "9331697a0c8c3182a639a7badb7b5f17",
"score": "0.8023466",
"text": "def linked_dylibs; end",
"title": ""
},
{
"docid": "9331697a0c8c3182a639a7badb7b5f17",
"score": "0.8023466",
"text": "def linked_dylibs; end",
"title": ""
},
{
"docid": "dd5c00f1ee7162ed1742cbb38131f2f4",
"score": "0.7788544",
"text": "def dylib_load_commands; end",
"title": ""
},
{
"docid": "dd5c00f1ee7162ed1742cbb38131f2f4",
"score": "0.7788544",
"text": "def dylib_load_commands; end",
"title": ""
},
{
"docid": "483109ec32e8b84b1a6f63d13bf77ee6",
"score": "0.763249",
"text": "def dylib_id; end",
"title": ""
},
{
"docid": "2f7cc6acb107f530b3db8dbb5fb05b76",
"score": "0.7196996",
"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": "b7b43105657bca6ad3cf0666f58cbb86",
"score": "0.7139116",
"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": "b7b43105657bca6ad3cf0666f58cbb86",
"score": "0.7139116",
"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": "c7c92845c3da126cebb628a7f1c3e188",
"score": "0.66774637",
"text": "def add_system_library(names)\n add_system_library_extension(names, 'dylib')\n end",
"title": ""
},
{
"docid": "fbf233e648d19f2333f69834c7fd5318",
"score": "0.66212106",
"text": "def lib_target args\n # We adjust args slightly and pass it on. Add one of these for dynamic libs:\n # soname -- soname of library (non-OSX only)\n # install_name -- install_name of library (OSX only)\n\n # If the version is defined, the file name will have all 3 components of the version\n # number but the soname will only have major.minor (executables compiled against this\n # library will have the soname embedded so this ensures that the library can be\n # upgraded without affecting those executables).\n #\n # If no version is available, obviously none of this applies.\n #\n # Append major.minor.patch version numbers and extension to library name\n # and prepend path\n #\n name = add_ext args[ :name ], :lib\n args[ :path ] = File.join( @obj_root, 'lib', name )\n\n if :dynamic == @link_type # soname etc. only for dynamic libs\n if @@system.darwin?\n # special case --\n # 1. path and install_name are identical absolute paths\n # 2. We use all 3 version components in the actual path name but only the major\n # and minor numbers in the install_name; finally, suitable symbolic links\n # are created. For example, for debug build of library libFoo we will have:\n # + path = /var/tmp/brubuild/foo/lib/libFoo.3.2.1.dylib_dbg\n # + install_name = @rpath/../lib/libFoo.3.2.dylib\n # + symbolic link in the lib directory:\n # libFoo.3.2.dylib --> libFoo.3.2.1.dylib_dbg\n # 3. Applications that will be installed in the 'bin' directory next to 'lib' will\n # need to link with \"-Wl,-rpath,@loader_path/../lib\"\n\n # add :install_name to args\n # add suitable extension including 2-component version\n lib_name = add_ext( args[ :name ], :lib, true )\n args[ :install_name ] = File.join( '@rpath', '..', 'lib', lib_name )\n\n else\n\n # add :soname to args\n # add suitable extension including 2-component version\n lib_name = add_ext( args[ :name ], :lib, true )\n args[ :soname ] = lib_name\n end\n end\n\n args[ :build ] = self\n\n # replace dependency lists with lists of corresponding objects\n\n # object files\n files = args[ :files ]\n raise \"File list missing\" if !files\n raise \"Expected Array, got String\" if files.is_a?( String )\n raise \"File list empty\" if files.empty?\n args[ :deps ] = names_to_objects files\n\n # libraries\n libs = args[ :libs ]\n if libs\n raise \"Expected Array, got String\" if libs.is_a?( String )\n args[ :libs ] = names_to_objects( libs, :lib ) if libs\n end\n\n Build.logger.debug \"Creating library target %s\" % args[ :path ]\n return LibFileTarget.new args\n end",
"title": ""
},
{
"docid": "0f982a430b26c548af6e5155de4c6c8e",
"score": "0.65317816",
"text": "def dylib_id\n machos.first.dylib_id\n end",
"title": ""
},
{
"docid": "b0a60762f5f5e923562dd8e917577f37",
"score": "0.64883846",
"text": "def linked_dylibs\n # can machos inside fat binaries have different dylibs?\n machos.flat_map(&:linked_dylibs).uniq\n end",
"title": ""
},
{
"docid": "c80534bd17e4115e6c0a7b852c1e7140",
"score": "0.6347705",
"text": "def ffi_lib(*)\n super(Spotify::Heroku.libspotify_path)\n end",
"title": ""
},
{
"docid": "606f31b8c3acea599381497ab61ccd6e",
"score": "0.6202694",
"text": "def inject_dylib\n debug_logging = RunLoop::Environment.debug?\n puts \"Starting lldb.\" if debug_logging\n\n stderr_output = nil\n lldb_status = nil\n lldb_start_time = Time.now\n Open3.popen3('sh') do |stdin, stdout, stderr, process_status|\n stdin.puts 'xcrun lldb --no-lldbinit<<EOF'\n stdin.puts \"process attach -n '#{@process_name}'\"\n stdin.puts \"expr (void*)dlopen(\\\"#{@dylib_path}\\\", 0x2)\"\n stdin.puts 'detach'\n stdin.puts 'exit'\n stdin.puts 'EOF'\n stdin.close\n\n puts \"#{stdout.read}\" if debug_logging\n\n lldb_status = process_status\n stderr_output = stderr.read.strip\n end\n\n pid = lldb_status.pid\n exit_status = lldb_status.value.exitstatus\n\n if stderr_output == ''\n if debug_logging\n puts \"lldb '#{pid}' exited with value '#{exit_status}'.\"\n puts \"Took #{Time.now-lldb_start_time} for lldb to inject calabash dylib.\"\n end\n else\n puts \"#{stderr_output}\"\n if debug_logging\n puts \"lldb '#{pid}' exited with value '#{exit_status}'.\"\n puts \"lldb tried for #{Time.now-lldb_start_time} to inject calabash dylib before giving up.\"\n end\n end\n\n stderr_output == ''\n end",
"title": ""
},
{
"docid": "e9b693192ca149d7011a96afcc6c524f",
"score": "0.61768985",
"text": "def dlopen library\n Fiddle::Handle.new library\n end",
"title": ""
},
{
"docid": "cb55bde2e942f39f713f33cec5b30a7e",
"score": "0.61260533",
"text": "def rename_cdylib_for_ruby_compatibility(dest_path)\n dylib_path = validate_cargo_build!(dest_path)\n dlext_name = \"#{spec.name}.#{makefile_config(\"DLEXT\")}\"\n new_name = dylib_path.gsub(File.basename(dylib_path), dlext_name)\n FileUtils.cp(dylib_path, new_name)\n new_name\n end",
"title": ""
},
{
"docid": "fad2129a63613b32764dbc6644a3590e",
"score": "0.6062375",
"text": "def lib; end",
"title": ""
},
{
"docid": "a7abd1b9cb457ed13d86e78c6d3fe6fc",
"score": "0.6052662",
"text": "def change_dylib(old_name, new_name, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "4210fb755aa544540a99ef326dae0329",
"score": "0.59727407",
"text": "def link_binary_with_libraries_phase(target)\n puts \"Link binary with libraryes\"\n phase = target.build_phases.find { |phase| phase.is_a?(Xcodeproj::Project::Object::PBXFrameworksBuildPhase) }\n $frameworks.each do | fw |\n file_ref = Xcodeproj::Project::Object::PBXFileReference.new($project, $project.generate_uuid)\n file_ref.path = fw\n file_ref.source_tree = \"<group>\"\n file_ref.last_known_file_type = \"wrapper.framework\"\n file_ref.name = /.*\\/(.*)\\.framework/.match(fw)[1]\n phase.add_file_reference(file_ref, true)\n end\nend",
"title": ""
},
{
"docid": "56ddb25682f6438cdba3978f390e0881",
"score": "0.5881669",
"text": "def shared_ext\n @shared_ext ||= begin\n if dlext == 'bundle'\n 'dylib'\n elsif Gem.win_platform?\n 'dll'\n else\n dlext\n end\n end\n end",
"title": ""
},
{
"docid": "329644803bc01e9d0e5162e295bb6c93",
"score": "0.5875775",
"text": "def initialize(process_name, dylib_path)\n @process_name = process_name\n @dylib_path = Shellwords.shellescape(dylib_path)\n end",
"title": ""
},
{
"docid": "37d542c74d2a1944e310a4d4e6bda6f7",
"score": "0.582633",
"text": "def no_reexported_dylibs\n return @no_reexported_dylibs unless @no_reexported_dylibs.nil?\n @no_reexported_dylibs = (value & 1048576) != 0\n @no_reexported_dylibs\n end",
"title": ""
},
{
"docid": "0f7552ebbb12f227b67e2213e4405e4a",
"score": "0.57969165",
"text": "def initialize args\n super\n @opt_type = :ld_cc == @linker ? :ld_cc_lib : :ld_cxx_lib\n\n if Build.system.darwin?\n name = args[ :install_name ]\n if :dynamic == @link_type\n raise \"Need install_name for dynamic library #{@path}\" if !name\n @install_name = name\n else # static lib\n raise \"Got install_name #{name} for static library #{@path}\" if name\n end\n\n else # not OSX\n\n name = args[ :soname ]\n if :dynamic == @link_type\n raise \"Need soname for dynamic library #{@path}\" if !name\n @soname = name\n else # static lib\n raise \"Got soname #{name} for static library #{@path}\" if name\n end\n end\n\n end",
"title": ""
},
{
"docid": "175ba259c6c8c59b00f9c142a62d1b11",
"score": "0.5780448",
"text": "def add_linked_libs_from_sdks_to_app\n $linkedPods.each do |lib|\n next if lib.is_static\n pod lib.name, lib.version\n end\nend",
"title": ""
},
{
"docid": "2ff19ad735fcb9e757dd0e3da918118d",
"score": "0.5777232",
"text": "def j2objc_javalib\n pod 'J2OBJC', :path => ENV['J2OBJC_HOME']\npod 'AndroidBase', :path => ENV['DOPPEL_POD_DEV_HOME']+'/AndroidBase'\nend",
"title": ""
},
{
"docid": "0a41df93fbe9e6931be645ef22f09595",
"score": "0.57693833",
"text": "def so_ext\n return RbConfig::CONFIG[\"SOEXT\"] if RbConfig::CONFIG.key?(\"SOEXT\")\n\n if win_target?\n \"dll\"\n elsif darwin_target?\n \"dylib\"\n else\n \"so\"\n end\n end",
"title": ""
},
{
"docid": "c020d09f403dbb58d0257ee0f1e5cf8e",
"score": "0.5739845",
"text": "def libs = [\"hscript\", \"mcli\", \"tink_lang\", \"dox\"]",
"title": ""
},
{
"docid": "79230f9b1bcc91dc297b04120a4adf48",
"score": "0.57275635",
"text": "def bundle_rubycocoa_framework\n bundle_framework 'RubyCocoa.framework'\n end",
"title": ""
},
{
"docid": "b4d20b5145fc44a56330e591112738d9",
"score": "0.5704683",
"text": "def install_id(dylib_path)\n `otool -D #{dylib_path}`.split(\"\\n\").last\nend",
"title": ""
},
{
"docid": "05ed70b0407b9645e15f900871101904",
"score": "0.56669277",
"text": "def j2objc_lib\n pod 'j2objc-lib-debug', :configuration => ['Debug'], :path => '../lib/build/j2objcOutputs'\n pod 'j2objc-lib-release', :configuration => ['Release'], :path => '../lib/build/j2objcOutputs'\n pod 'J2OBJC', :path => '../../J2OBJC'\nend",
"title": ""
},
{
"docid": "3af99b76a3b95098ec593dc391c27025",
"score": "0.5642839",
"text": "def libs; end",
"title": ""
},
{
"docid": "42c391bcefdccbbf42728ffcb58885d2",
"score": "0.5638466",
"text": "def release\n\t java_opts = @droplet.java_opts\n\t java_opts.add_system_property('java.library.path', \"$PWD/#{(@droplet.sandbox).relative_path_from(@droplet.root)}\")\n end",
"title": ""
},
{
"docid": "b7f2821a93a3b15841a45d02e788a39b",
"score": "0.55946624",
"text": "def initialize(process_name, dylib_path)\n @process_name = process_name\n @dylib_path = dylib_path\n end",
"title": ""
},
{
"docid": "c9602d45c7f5466bdeaad6403ee7f30d",
"score": "0.5589953",
"text": "def load_no_focus_lib=(_arg0); end",
"title": ""
},
{
"docid": "7a0d8466cf55abcd9f96ed32f2ed5375",
"score": "0.55804604",
"text": "def inject_dylib(timeout)\n RunLoop.log_debug(\"Starting lldb injection with a timeout of #{timeout} seconds\")\n\n script_path = write_script\n\n start = Time.now\n\n options = {\n :timeout => timeout,\n :log_cmd => true\n }\n\n hash = nil\n success = false\n begin\n hash = xcrun.run_command_in_context([\"lldb\", \"--no-lldbinit\", \"--source\", script_path], options)\n pid = hash[:pid]\n exit_status = hash[:exit_status]\n success = exit_status == 0\n\n RunLoop.log_debug(\"lldb '#{pid}' exited with value '#{exit_status}'.\")\n\n success = exit_status == 0\n elapsed = Time.now - start\n\n if success\n RunLoop.log_debug(\"Took #{elapsed} seconds for lldb to inject calabash dylib.\")\n else\n RunLoop.log_debug(\"Could not inject dylib after #{elapsed} seconds.\")\n if hash[:out]\n hash[:out].split(\"\\n\").each do |line|\n RunLoop.log_debug(line)\n end\n else\n RunLoop.log_debug(\"lldb returned no output to stdout or stderr\")\n end\n end\n rescue RunLoop::Xcrun::TimeoutError\n elapsed = Time.now - start\n RunLoop.log_debug(\"lldb tried for #{elapsed} seconds to inject calabash dylib before giving up.\")\n end\n\n success\n end",
"title": ""
},
{
"docid": "c3d44380d047c08f854993ee150ac21b",
"score": "0.557171",
"text": "def shared_pods\n pod 'YJCocoa/System/Dispatch'\n pod 'YJCocoa/System/Security/Random'\n#pod 'YJCocoa', :git => 'https://github.com/937447974/YJCocoa.git', :branch =>'developer' #开发环境\nend",
"title": ""
},
{
"docid": "c3d44380d047c08f854993ee150ac21b",
"score": "0.557171",
"text": "def shared_pods\n pod 'YJCocoa/System/Dispatch'\n pod 'YJCocoa/System/Security/Random'\n#pod 'YJCocoa', :git => 'https://github.com/937447974/YJCocoa.git', :branch =>'developer' #开发环境\nend",
"title": ""
},
{
"docid": "e2a93a25b46637b04860fdbea2b728eb",
"score": "0.55523103",
"text": "def dlopen_yajl_library\n found = false\n ( expanded_library_names + library_names ).each do |libname|\n begin\n dlopen(libname)\n found = true\n break\n rescue ArgumentError\n end\n end\n raise \"cannot find yajl library for platform\" unless found\n end",
"title": ""
},
{
"docid": "c7626afdbca4e9335db040884a99c482",
"score": "0.55069786",
"text": "def j2objc_lib\n pod 'j2objc-lib-debug', :configuration => ['Debug'], :path => '../lib/build/j2objcOutputs'\n pod 'j2objc-lib-release', :configuration => ['Release'], :path => '../lib/build/j2objcOutputs'\n pod 'j2objc-gson-debug', :path => '../../../gradletrans/gson/trans/gson/build/j2objcOutputs'\n #pod 'j2objc-gson-release', :configuration => ['Release'], :path => '../../../gradletrans/gson/trans/gson/build/j2objcOutputs'\n #pod 'Gson', :path => '../../Gson'\n pod 'j2objc-core-debug', :path => '../../../gradletrans/dagger/trans/core/build/j2objcOutputs'\n #pod 'Dagger2', :path => '../../Dagger2'\n pod 'Okhttp', :path => '../../Okhttp'\n pod 'RxJava', :path => '../../RxJava'\n pod 'Retrofit', :path => '../../Retrofit'\n pod 'AndroidBase', :path => '../../AndroidBase'\n pod 'SqueakyCore', :path => '../../SqueakyCore'\n pod 'EventBus', :path => '../../EventBus'\n pod 'MagicThreads', :path => '../../MagicThreads'\n pod 'J2OBJC', :path => ENV['J2OBJC_HOME']\nend",
"title": ""
},
{
"docid": "c1024b7da89835b059317291a93c74db",
"score": "0.5499965",
"text": "def link libs\n libs.each do |lib|\n p lib\n pod lib.name, lib.version\n $linkedPods << lib\n end\nend",
"title": ""
},
{
"docid": "88621760e99cab75eb72512a78e5be1c",
"score": "0.5494447",
"text": "def effective_lib\n # If we're installed or installing as a Framework, then use that location.\n return prefix+\"Frameworks/Python.framework/Versions/3.2/lib\" if as_framework?\n # Otherwise use just 'lib'\n return lib\n end",
"title": ""
},
{
"docid": "bbadf0e94a094d831cd0e171539dc91e",
"score": "0.5487915",
"text": "def ffi_lib(*)\n super(Mock.path)\n end",
"title": ""
},
{
"docid": "bbadf0e94a094d831cd0e171539dc91e",
"score": "0.5487915",
"text": "def ffi_lib(*)\n super(Mock.path)\n end",
"title": ""
},
{
"docid": "91548e89da58ddb258cd832fc96eb077",
"score": "0.54765767",
"text": "def ffi_open_yajl_library\n found = false\n expanded_library_names.each do |libname|\n begin\n ffi_lib libname\n found = true\n rescue LoadError\n end\n end\n ffi_lib \"yajl\" unless found\n end",
"title": ""
},
{
"docid": "abf2d4f0b2dff137ace1c6b3df330e3f",
"score": "0.54506767",
"text": "def link_libraries\n if RbConfig::CONFIG[\"THREAD_MODEL\"] == \"pthread\"\n logger.info \"Linking extension against 'pthread' library\"\n # Link gem extension against pthread library\n have_library \"pthread\"\n have_required_function \"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 logger.info \"Linking extension against 'dl' library\"\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 func\n end\nend",
"title": ""
},
{
"docid": "6af6ce556f44d0730c1f7136b3d72e82",
"score": "0.5446156",
"text": "def wine_wrapper; <<-EOS.undent\n #!/bin/sh\n DYLD_FALLBACK_LIBRARY_PATH=\"#{MacOS::X11.lib}:#{HOMEBREW_PREFIX}/lib:/usr/lib\" \"#{bin}/wine.bin\" \"$@\"\n EOS\n end",
"title": ""
},
{
"docid": "191b2d854e03d80d0706684d24ca1ae3",
"score": "0.5412731",
"text": "def build_static_lib_for_ios(static_libs, defines, output)\n exec! \"libtool -static -o #{@sandbox_root}/build/package.a #{static_libs.join(' ')}\"\n xcodebuild defines, '-sdk iphonesimulator', 'build-sim'\n sim_libs = static_libs_in_sandbox 'build-sim'\n exec! \"libtool -static -o #{@sandbox_root}/build-sim/package.a #{sim_libs.join(' ')}\"\n exec! \"lipo #{@sandbox_root}/build/package.a #{@sandbox_root}/build-sim/package.a -create -output #{output}\"\n end",
"title": ""
},
{
"docid": "083f581c736bab4851a431408afaa52e",
"score": "0.53982073",
"text": "def lib_path; end",
"title": ""
},
{
"docid": "083f581c736bab4851a431408afaa52e",
"score": "0.53982073",
"text": "def lib_path; end",
"title": ""
},
{
"docid": "083f581c736bab4851a431408afaa52e",
"score": "0.53982073",
"text": "def lib_path; end",
"title": ""
},
{
"docid": "083f581c736bab4851a431408afaa52e",
"score": "0.53982073",
"text": "def lib_path; end",
"title": ""
},
{
"docid": "083f581c736bab4851a431408afaa52e",
"score": "0.53982073",
"text": "def lib_path; end",
"title": ""
},
{
"docid": "3b53e756d3b1f056458246fdbb307d34",
"score": "0.5381247",
"text": "def change_dylib_id(filename, new_id, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "606bc48f5f70edff201c009d57841001",
"score": "0.53774655",
"text": "def shared_library_extension\n self.is_windows? ? '.dll' : '.so'\n end",
"title": ""
},
{
"docid": "c23175a5ebf3dfb6fca4fd3c7a1125a6",
"score": "0.5375416",
"text": "def fix_install_name\n log \"Fix install path of binaries\"\n patterns = [File.join(@app_bundle, 'Contents/MacOS/*'),\n File.join(app_macruby_usr, 'lib/ruby/**/*.{bundle,rbo}'),\n File.join(@app_bundle, 'Contents/Resources/**/*.rbo')]\n patterns.each do |pat|\n Dir.glob(pat).each do |bin|\n execute(\"#{@install_name_tool} -change #{macruby_usr}/lib/libmacruby.dylib @executable_path/../Frameworks/MacRuby.framework/Versions/Current/usr/lib/libmacruby.dylib '#{bin}'\")\n end\n end\n log \"Fix identification name of libmacruby\"\n patterns = [ File.join(app_macruby_usr, 'lib/libmacruby*.dylib') ]\n patterns.each do |pat|\n Dir.glob(pat).each do |bin|\n execute(\"#{@install_name_tool} -id @executable_path/../Frameworks/MacRuby.framework/Versions/Current/usr/lib/libmacruby.dylib '#{bin}'\")\n end\n end\n end",
"title": ""
},
{
"docid": "d8438356c8a871ef5a1319e303bb8a68",
"score": "0.53687876",
"text": "def method_missing(lib_symbol, *args)\n lib_name = lib_symbol.to_s\n\n unless known_library_names.include? lib_name\n raise \"Library #{lib_name} not found. Known libraries: #{PP.pp(known_library_names, '')}\"\n end\n\n lib = get_library(lib_name)\n\n return LibraryWrapper.new(lib, client)\n end",
"title": ""
},
{
"docid": "8725c6410cf40ef505c96349acffbad4",
"score": "0.53642267",
"text": "def make_so(name)\n puts \"make_so: #{name}\"\n name = 'dist/shoes.a'\n sh \"ar rc #{name} #{OBJ.join(' ')}\"\n sh \"ranlib #{name}\"\n end",
"title": ""
},
{
"docid": "f5118e875b64ce8cf644bf2e24d14a95",
"score": "0.5345907",
"text": "def lib_path=(_arg0); end",
"title": ""
},
{
"docid": "f5118e875b64ce8cf644bf2e24d14a95",
"score": "0.53450865",
"text": "def lib_path=(_arg0); end",
"title": ""
},
{
"docid": "f5118e875b64ce8cf644bf2e24d14a95",
"score": "0.53450865",
"text": "def lib_path=(_arg0); end",
"title": ""
},
{
"docid": "f5118e875b64ce8cf644bf2e24d14a95",
"score": "0.53450865",
"text": "def lib_path=(_arg0); end",
"title": ""
},
{
"docid": "f5118e875b64ce8cf644bf2e24d14a95",
"score": "0.53450865",
"text": "def lib_path=(_arg0); end",
"title": ""
},
{
"docid": "601cc6ed70fcd9b9d61681e5829ae379",
"score": "0.5326901",
"text": "def shared_pods\n pod 'YJCocoa/AppFrameworks/Foundation', :path => \"../../../../YJCocoa.podspec\"\nend",
"title": ""
},
{
"docid": "352845c7348b8573d26799b1af34bb5a",
"score": "0.5312414",
"text": "def wine_wrapper; <<-EOS\n#!/bin/sh\nDYLD_FALLBACK_LIBRARY_PATH=\"/usr/X11/lib:#{HOMEBREW_PREFIX}/lib:/usr/lib\" \"#{bin}/wine.bin\" \"$@\"\nEOS\n end",
"title": ""
},
{
"docid": "352845c7348b8573d26799b1af34bb5a",
"score": "0.5312414",
"text": "def wine_wrapper; <<-EOS\n#!/bin/sh\nDYLD_FALLBACK_LIBRARY_PATH=\"/usr/X11/lib:#{HOMEBREW_PREFIX}/lib:/usr/lib\" \"#{bin}/wine.bin\" \"$@\"\nEOS\n end",
"title": ""
},
{
"docid": "67a132e3a89b89669bdbac767564af89",
"score": "0.53061",
"text": "def library_start\n end",
"title": ""
},
{
"docid": "67a132e3a89b89669bdbac767564af89",
"score": "0.53061",
"text": "def library_start\n end",
"title": ""
},
{
"docid": "d5cdf337bbcbf0e9ebb27cd7dd9ac6a2",
"score": "0.5297196",
"text": "def install\n ENV.cxx11 if build.cxx11?\n ENV.libcxx if build.cxx11?\n dylib = OS.mac? ? \"dylib\" : \"so\"\n\n args = std_cmake_args + %W[\n -DCMAKE_OSX_DEPLOYMENT_TARGET=\n -DPYTHON_INCLUDE_DIR=/usr/local/include/python2.7\n -DPYTHON_LIBRARY=/usr/local/Frameworks/Python.framework/Python\n -DFreeglut_INCLUDE_DIR=/System/Library/Frameworks/GLUT.framework/Headers\n -DFreeglut_glut_LIBRARY=/System/Library/Frameworks/GLUT.framework/GLUT\n -DENABLE_DTRACE=ON\n -DUT_ENABLE_DTRACE=ON\n ]\n args << \"-DCOMPILE_WITH_CXX11=ON\" if build.cxx11?\n args << \"-DENABLE_BASICFACADE=ON\" if build.cxx11?\n\n system \"git\", \"clone\", \"-b\", \"release_13\", \"git@intern.far.in.tum.de:Ubitrack/utDataflow.git\", \"modules/utdataflow\"\n system \"git\", \"clone\", \"-b\", \"release_13\", \"git@intern.far.in.tum.de:Ubitrack/utFacade.git\", \"modules/utfacade\"\n\n system \"git\", \"clone\", \"-b\", \"release_13\", \"git@intern.far.in.tum.de:UbitrackContrib/ARTDriver.git\", \"modules/art\"\n system \"git\", \"clone\", \"-b\", \"release_13\", \"git@intern.far.in.tum.de:UbitrackContrib/FirewireCameraDriver.git\", \"modules/firewirecamera\"\n system \"git\", \"clone\", \"-b\", \"release_13\", \"git@intern.far.in.tum.de:UbitrackContrib/QTKitCaptureDriver.git\", \"modules/qtkitcapture\"\n system \"git\", \"clone\", \"-b\", \"release_13\", \"git@intern.far.in.tum.de:Ubitrack/utComponents.git\", \"modules/utcomponents\"\n system \"git\", \"clone\", \"-b\", \"release_13\", \"git@intern.far.in.tum.de:Ubitrack/utCore.git\", \"modules/utcore\"\n system \"git\", \"clone\", \"-b\", \"release_13\", \"git@intern.far.in.tum.de:UbitrackContrib/HapticCalibrationComponents.git\", \"modules/uthaptics\"\n system \"git\", \"clone\", \"-b\", \"release_13\", \"git@intern.far.in.tum.de:Ubitrack/utVision.git\", \"modules/utvision\"\n system \"git\", \"clone\", \"-b\", \"release_13\", \"git@intern.far.in.tum.de:Ubitrack/utVisionComponents.git\", \"modules/utvisioncomponents\"\n system \"git\", \"clone\", \"-b\", \"release_13\", \"git@intern.far.in.tum.de:Ubitrack/utVisualization.git\", \"modules/utvisualization\"\n system \"git\", \"clone\", \"-b\", \"release_13\", \"git@intern.far.in.tum.de:UbitrackContrib/ZMQ.git\", \"modules/utzmq\"\n\n\n mkdir \"macbuild\" do\n system \"cmake\", \"..\", *args\n system \"make\"\n system \"make\", \"install\"\n end\n end",
"title": ""
},
{
"docid": "f93aaf0fb934170d42fba8fbef812ee8",
"score": "0.5296718",
"text": "def darwin_only(require_as)\n RbConfig::CONFIG['host_os'] =~ /darwin/ && require_as\nend",
"title": ""
},
{
"docid": "10489c48e3b67dbadd00b290ada77b3c",
"score": "0.52617264",
"text": "def ld(lib)\n load lib.to_s + '.rb'\nend",
"title": ""
},
{
"docid": "5b01d95e3bcdcc3b8cd708e51d354734",
"score": "0.52588636",
"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": "81fc272b3d12c8a359c8e42c75c6c088",
"score": "0.5256202",
"text": "def shared_libraries\n self.class.shared_libraries(@pid)\n end",
"title": ""
},
{
"docid": "c3686e9ec8f467f78d8627d01db15c1d",
"score": "0.5252937",
"text": "def isGoodLDDFound(lib)\n case lib\n when /.*vorbis.*/i\n true \n when /.*opus.*/i\n true\n when /.*pcre.*/i\n true\n when /.*ogg.*/i\n true\n when /.*tinyxml.*/i\n true\n when /.*rtmp.*/i\n true\n when /.*gsm.*/i\n true\n when /.*soxr.*/i\n true\n when /.*x2.*/i\n true\n when /.*libstdc++.*/i\n true\n when /.*jpeg.*/i\n true\n when /.*jxrglue.*/i\n true\n when /.*IlmImf.*/i\n true\n when /.*Imath.*/i\n true\n when /.*Half.*/i\n true\n when /.*Iex.*/i\n true\n when /.*IlmThread.*/i\n true\n when /.*openjp.*/i\n true\n when /.*libraw.*/i\n true\n when /.*png.*/i\n true\n when /.*freeimage.*/i\n true\n when /.*gnutls.*/i\n true\n when /.*atomic.*/i\n true\n when /.*zzip.*/i\n true\n when /.*libz.*/i\n true\n when /.*webp.*/i\n true\n when /.*Xaw.*/i\n true\n when /.*jasper.*/i\n true\n when /.*sdl2.*/i\n true\n when /.*openal.*/i\n true \n # GCC libraries\n # when /.*stdc++.*/i\n # true\n # when /libm.*/i\n # true\n # when /.*libgcc.*/i\n # true\n # These would be for bundling the system libc, but that doesn't work\n # due to also needing to bundle ld-linux-x86-64.so.2 and modifying\n # to active program loader\n # when /.*libc.*/i\n # true\n else\n false\n end\nend",
"title": ""
},
{
"docid": "c9a5c577135c15afb0195ded219292f8",
"score": "0.524987",
"text": "def rewrite_libs\n runtime_version = runtime['version']\n runtime_info = runtime_info_for(runtime_version)\n runtime_dir = \"/var/vcap/runtimes/erlang-#{runtime_version}\"\n\n # Ensure that our runtime matches the one that the libraries were packaged for\n start_erl_data = File.read('app/releases/start_erl.data')\n expected_erts = start_erl_data.split(/ /).first\n runtime_erts = runtime_info['erts_version']\n unless expected_erts == runtime_erts\n raise \"Application was released with different Erlang version to runtime. Selected Runtime ERTS: #{runtime_erts}, Packaged ERTS: #{expected_erts}\"\n end\n\n # Link in the system runtime\n FileUtils.rm_rf \"app/erts-#{runtime_erts}\"\n FileUtils.ln_s \"#{runtime_dir}/lib/erlang/erts-#{runtime_erts}\", \"app/erts-#{runtime_erts}\"\n\n builtin = runtime_info['builtins']\n Dir['app/lib/*'].each do |lib_name|\n base_lib_name = File.basename(lib_name)\n if builtin.include? base_lib_name\n # Candidate for replacement\n FileUtils.rm_rf lib_name\n FileUtils.ln_s \"#{runtime_dir}/lib/erlang/lib/#{base_lib_name}\", lib_name\n end\n end\n end",
"title": ""
},
{
"docid": "ae363b806834d8f6cffeb3a93a2907be",
"score": "0.5243857",
"text": "def post_install\n ohai \"running post install\"\n tmpdir = \"/tmp/homebrew-#{name}-#{version}\"\n system \"mkdir\",\"-p\", \"#{tmpdir}/\"\n system \"curl\", \"-Lo\", \"#{tmpdir}/wrap_executable_path\", \"https://github.com/TorXakis/Dependencies/releases/download/z3-4.8.7/wrap_executable_path\" \n system \"chmod\", \"+x\", \"#{tmpdir}/wrap_executable_path\"\n system \"#{tmpdir}/wrap_executable_path\", \"#{prefix}/bin/txsserver\", \"TORXAKIS_USE_INTERNAL_SMT_SOLVER\", \"#{HOMEBREW_PREFIX}/Cellar/z3@#{@@version_z3}/#{@@version_z3}/bin\", \"#{HOMEBREW_PREFIX}/Cellar/cvc4@#{@@version_cvc4}/#{@@version_cvc4}//bin\"\n end",
"title": ""
},
{
"docid": "f20473284a2311111e1b322c0ab5070c",
"score": "0.5243475",
"text": "def native; end",
"title": ""
},
{
"docid": "f20473284a2311111e1b322c0ab5070c",
"score": "0.5243475",
"text": "def native; end",
"title": ""
},
{
"docid": "f7ab6aa3256e847e29fd98873e6125a7",
"score": "0.5221898",
"text": "def static_setup (so_list)\n $stderr.puts \"setup: dir=#{`pwd`}\"\n rbvt = RUBY_V\n rbvm = RUBY_V[/^\\d+\\.\\d+/]\n mkdir_p \"#{TGT_DIR}/lib\"\n mkdir_p \"#{TGT_DIR}/fonts\"\n cp_r \"fonts\", \"#{TGT_DIR}/fonts\"\n mkdir_p \"#{TGT_DIR}/lib\"\n cp \"lib/shoes.rb\", \"#{TGT_DIR}/lib\"\n cp_r \"lib/shoes\", \"#{TGT_DIR}/lib\"\n cp_r \"lib/exerb\", \"#{TGT_DIR}/lib\"\n cp_r \"samples\", \"#{TGT_DIR}/samples\"\n cp_r \"static\", \"#{TGT_DIR}/static\"\n cp \"README.md\", \"#{TGT_DIR}/README.txt\"\n cp \"CHANGELOG\", \"#{TGT_DIR}/CHANGELOG.txt\"\n cp \"COPYING\", \"#{TGT_DIR}/COPYING.txt\"\n # clean out leftovers from last build\n #rm_f \"#{TGT_DIR}/libruby.so\" if File.exist? \"#{TGT_DIR}/libruby.so\"\n #rm_f \"#{TGT_DIR}/libruby.so.#{rbvm}\" if File.exist? \"#{TGT_DIR}/libruby.so.#{rbvm}\"\n #rm_f \"#{TGT_DIR}/libruby.so.#{rbvt}\" if File.exist? \"#{TGT_DIR}/libruby.so.#{rbvt}\"\n cp_r \"#{EXT_RUBY}/lib/ruby\", \"#{TGT_DIR}/lib\", remove_destination: true\n # copy and link libruby.so\n cp \"#{EXT_RUBY}/lib/libruby.so.#{rbvm}\", \"#{TGT_DIR}\"\n\n # copy include files - it might help build gems\n mkdir_p \"#{TGT_DIR}/lib/ruby/include/ruby-#{rbvt}\"\n cp_r \"#{EXT_RUBY}/include/ruby-#{rbvt}/\", \"#{TGT_DIR}/lib/ruby/include\"\n chdir TGT_DIR do\n ln_s \"libruby.so.#{rbvm}\", \"libruby.so\"\n end \n SOLOCS.each_value do |path|\n cp \"#{path}\", \"#{TGT_DIR}\"\n end \n end",
"title": ""
},
{
"docid": "d5b3a392a935909e79056f80e57fd95e",
"score": "0.5219136",
"text": "def plotting_library= lib\n case lib\n when :nyaplot, :highcharts\n @plotting_library = lib\n else\n raise ArgumentError, \"Unsupported library #{lib}\"\n end\n Daru::View::Plot.adapter = lib\n\n # When code is running in console/terminal then IRuby NameError.\n # Since IRuby methods can't work in console.\n begin\n load_lib_in_iruby lib.to_s if defined? IRuby\n rescue NameError\n ;\n end\n end",
"title": ""
},
{
"docid": "ee190deda248cf26aed42cd824b9cde8",
"score": "0.5216935",
"text": "def fixup_libgfortran(prefix)\n keg = Keg.for(prefix)\n libgfortran = Formulary.factory(\"staticfloat/juliadeps/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.4']\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.to_s, good_name.to_s, file.to_s)\n end\n end\n end\n end\n end\n\n gcc = Formulary.factory(\"gcc\")\n # For each .pc file within this keg\n pkgconfig_files(keg).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": "29543cea7f7a8043e753131348271930",
"score": "0.52150506",
"text": "def ffi_lib(*names)\n @ffi_lib = names.map do |x|\n if x == FFI::CURRENT_PROCESS\n DynamicLibrary::CURRENT_PROCESS\n\n # When the element is an array, it's an ordered choice,\n # ie, pick the first library that works.\n elsif x.kind_of? Array\n lib = nil\n\n x.each do |name|\n begin\n lib = DynamicLibrary.new(name)\n break\n rescue LoadError\n end\n end\n\n # If .new worked, then lib is set and we can use it.\n unless lib\n raise LoadError, \"Unable to find library among: #{x.inspect}\"\n end\n\n lib\n else\n DynamicLibrary.new(x)\n end\n end\n end",
"title": ""
},
{
"docid": "94013d630a1c866a82b7ca074c05621d",
"score": "0.52122635",
"text": "def fix_oracle_lib_path(file)\n file = Pathname.new(file)\n file.ensure_writable do\n if file.basename.to_s == ORACLE_LIBRARIES[0] # libclntsh.dylib\n system MacOS.locate(\"install_name_tool\"), \"-add_rpath\",\n HOMEBREW_PREFIX/\"lib\", file\n end\n if file.dylib_id\n system MacOS.locate(\"install_name_tool\"), \"-id\",\n HOMEBREW_PREFIX/\"lib\"/File.basename(file.dylib_id), file\n end\n file.dynamically_linked_libraries.each do |fname|\n next if fname[0] == \"@\"\n if ORACLE_LIBRARIES.include? File.basename(fname)\n system MacOS.locate(\"install_name_tool\"), \"-change\", fname,\n HOMEBREW_PREFIX/\"lib\"/File.basename(fname), file\n end\n end\n end\n end",
"title": ""
},
{
"docid": "5babb419b6984e2ac42b1b1ee5b81cf7",
"score": "0.520615",
"text": "def libsetup\n curlibs = ENV[\"RUBYLIB\"].split(\":\")\n $LOAD_PATH.reject do |dir| dir =~ /^\\/usr/ end.each do |dir|\n curlibs << dir unless curlibs.include?(dir)\n end\n\n ENV[\"RUBYLIB\"] = curlibs.join(\":\")\n end",
"title": ""
},
{
"docid": "c0f244c6cf39a0fb4919acd0764ce083",
"score": "0.5188598",
"text": "def swinject\n pod 'Swinject', '~> 2.6'\nend",
"title": ""
},
{
"docid": "e893968169b45293948bc7f86327bcea",
"score": "0.5180077",
"text": "def library_names\n case host_os\n when /mingw|mswin/\n [ \"libyajl.so\", \"yajl.dll\" ]\n when /cygwin/\n [ \"libyajl.so\", \"cygyajl.dll\" ]\n when /darwin/\n [ \"libyajl.bundle\", \"libyajl.dylib\" ]\n else\n [ \"libyajl.so\" ]\n end\n end",
"title": ""
},
{
"docid": "b5194492c867f4218239a653703480a4",
"score": "0.51657665",
"text": "def ios; end",
"title": ""
},
{
"docid": "a441e8dddb3149edc4aaf212d85e2274",
"score": "0.51504165",
"text": "def setup(lib_path=nil)\n # Setup the path to the C library\n lib_path ||= \"/Applications/VirtualBox.app/Contents/MacOS/VBoxXPCOMC.dylib\"\n\n # Attach to the interface\n ffi_lib lib_path\n attach_function :VBoxGetXPCOMCFunctions, [:uint], :pointer\n end",
"title": ""
},
{
"docid": "264f6b48cf6243781090e39cc7074a70",
"score": "0.51438504",
"text": "def add_library(name, **opt)\n Ils::HomeLibrary.new(name: name, **opt).tap do |lib|\n libraries << lib\n end\n end",
"title": ""
},
{
"docid": "6a83ef8bdd1afb4c3fad54a10df04938",
"score": "0.51223963",
"text": "def _dylib_wrapper32(prefix = '_dw_')\n\t return '' if @ret._ctype.nil?\n\t lines = []\n\t args = []\n\t targs = []\n\t i = 0\n\t @args.each do |a|\n\t\treturn '' if a._ctype.nil?\n\t\tai = \"_a#{i}\"\n\t\targs << ai\n\t\ttargs << \"#{a._ctype} #{ai}\"\n\t\ti += 1\n\t end\n\t name = \"#{prefix}#{self[:name]}\"\n\t proto = \"#{@ret._ctype} #{name}(#{targs.join(', ')})\"\n\t lines << \"#{proto} __asm(\\\"_#{self[:name]}\\\");\"\n\t lines << \"#{proto} {\"\n\t cline = \" \"\n\t cline << \"return \" unless @ret.type == 'v'\n\t cline << \"#{self[:name]}(#{args.join(', ')});\"\n\t lines << cline\n\t lines << \"}\\n\"\n\t lines.join(\"\\n\")\n\tend",
"title": ""
},
{
"docid": "55bcc481c4e08358a7cdd2bbfa68614f",
"score": "0.51215637",
"text": "def install\n ENV.append_to_cflags \"-D_DARWIN_C_SOURCE\"\n system \"make\", \"PREFIX=#{prefix}\", \"LIBS=-lc -lutil -lncurses\", \"install\"\n end",
"title": ""
},
{
"docid": "0a494c5c5a1be9ced404123a899d81f7",
"score": "0.51060003",
"text": "def set_system_lib_paths(iNewDirsList)\n ENV['LD_LIBRARY_PATH'] = iNewDirsList.join(':')\n end",
"title": ""
},
{
"docid": "c84e272dfeb7dc4d1f399dbdc899cd70",
"score": "0.509457",
"text": "def registerSelfAsLibrary(selflib)\n @self_lib = selflib\n end",
"title": ""
},
{
"docid": "75819394d8387e35db12ac4726bb8f4e",
"score": "0.50865996",
"text": "def install\n lib.install 'libneko.dylib'\n bin.install %w(neko nekoc nekotools nekoml nekoml.std)\n prefix.install Dir['*']\n end",
"title": ""
},
{
"docid": "b96f0e5bc315cae344ee40c6d51b2aba",
"score": "0.5081238",
"text": "def load_lib_in_iruby(library)\n require \"daru/view/adapters/#{library}/iruby_notebook\"\n if library.match('highcharts')\n library = 'LazyHighCharts'\n Object.const_get(library).init_iruby\n else\n Object.const_get(library.capitalize).init_iruby\n end\n end",
"title": ""
},
{
"docid": "3c979e03463289edd76b56aae8bd0a25",
"score": "0.50681114",
"text": "def wine_wrapper; <<-EOS\n#!/bin/sh\nDYLD_FALLBACK_LIBRARY_PATH=\"/usr/X11/lib\" \"#{bin}/wine.bin\" \"$@\"\nEOS\n end",
"title": ""
},
{
"docid": "7a1362a541e47537c30ec0f2653e3450",
"score": "0.5056125",
"text": "def new_so (name) \n tgts = File.expand_path(name)\n tgtd = File.dirname(name)\n $stderr.puts \"new_so: #{tgtd} from #{tgts}\"\n objs = []\n SubDirs.each do |f|\n d = File.dirname(f)\n objs = objs + FileList[\"#{d}/*.o\"] \n end\n objs = objs + FileList[\"shoes/native/gtk/*.o\"]\n main_o = 'shoes/main.o'\n objs = objs - [main_o]\n sh \"ar -rc #{tgtd}/shoes.lib #{objs.join(' ')}\"\n sh \"ranlib #{tgtd}/shoes.lib\" \n end",
"title": ""
},
{
"docid": "15559adeb33774564cf86ce4c354b41d",
"score": "0.5052299",
"text": "def xfixil(path) \n path.gsub!(/-L\\/usr\\/lib/, \"-L#{TGT_SYS_DIR}usr/lib\")\n return path\nend",
"title": ""
},
{
"docid": "048313a5d048ec54626ba7118498e9fd",
"score": "0.5048133",
"text": "def install\n # The approach to vendoring of Perl modules used here is that\n # described by @ilovezfs in a comment 2017-08-26 in:\n # https://github.com/Homebrew/homebrew-science/issues/6213\n\n ENV.prepend_create_path \"PERL5LIB\", libexec/\"lib/perl5\"\n ENV.prepend_path \"PERL5LIB\", libexec/\"lib\"\n\n mkdir_p man1\n mkdir_p (libexec/\"bin\")\n mkdir_p bin\n\n resources.each do |res|\n res.stage do\n case res.name\n\n when \"Mozilla::PublicSuffix\"\n if build.with? \"bundled-publicsuffix\"\n system \"sh\", \"-c\", \"PERL_MM_USE_DEFAULT=t perl Build.PL --install_base=#{libexec}\"\n system \"./Build\"\n system \"./Build\", \"test\"\n system \"./Build\", \"install\"\n end\n\n when \"Term::ReadLine::Gnu\"\n if build.with? \"readline\"\n system \"perl\", \"Makefile.PL\", \"INSTALL_BASE=#{libexec}\"\n system \"make\"\n system \"make\", \"install\"\n end\n\n when \"Net::SSLeay\"\n # Prompts for network testing, only env-control knobs accept defaults,\n # but the default is to do the testing. So echo no into it.\n Open3.pipeline([\"echo\", \"no\"], [\"perl\", \"Makefile.PL\", \"INSTALL_BASE=#{libexec}\"])\n system \"make\", \"PERL5LIB=#{ENV[\"PERL5LIB\"]}\"\n system \"make\", \"install\"\n\n else # res.name switch\n\n if File.exist? \"Makefile.PL\"\n system \"perl\", \"Makefile.PL\", \"INSTALL_BASE=#{libexec}\"\n system \"make\", \"PERL5LIB=#{ENV[\"PERL5LIB\"]}\"\n system \"make\", \"install\"\n else\n system \"perl\", \"Build.PL\", \"--install_base\", libexec\n system \"./Build\", \"PERL5LIB=#{ENV[\"PERL5LIB\"]}\"\n system \"./Build\", \"install\"\n end\n\n end\n end\n end\n\n inreplace \"sieve-connect.pl\",\n /(# No user-serviceable parts below)/,\n '\\1'\"\\nuse lib '#{libexec}/lib/perl5';\"\n\n system \"make\", \"PERL5LIB=#{ENV[\"PERL5LIB\"]}\", \"PREFIX=#{prefix}\", \"MANDIR=share/man\", \"install\"\n\n bin.env_script_all_files(libexec/\"bin\", :PERL5LIB => ENV[\"PERL5LIB\"])\n end",
"title": ""
},
{
"docid": "8d7e3d000d302cfced476f8f2fb471a1",
"score": "0.50378805",
"text": "def static_libs(platform = :ios)\n library_roots.map do |root|\n case platform\n when :tvos\n \"lib#{root}-tvOS.a\"\n else\n \"lib#{root}.a\"\n end\n end\n end",
"title": ""
},
{
"docid": "eb14780003af1021dd97205404b244a3",
"score": "0.5036621",
"text": "def build_ios_tvos(rb_file, device)\n check_build_src_file(rb_file)\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 # TODO: Need add this functionality to the gem\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: `build/#{device}`\"\nend",
"title": ""
},
{
"docid": "872e23ad6177b1069caa8a85b4a83f84",
"score": "0.5030672",
"text": "def other_linker_flags_dependencies\n config = build_configurations.filter do |config| not config.base_configuration_reference.nil? end.first\n other_ldflags = config.resolve_build_setting 'OTHER_LDFLAGS'\n \n if other_ldflags.nil? \n return [] \n end\n\n if other_ldflags.class == String\n other_ldflags = other_ldflags.split ' '\n end\n\n libraries = other_ldflags.filter do |flag| flag.start_with? '-l' end.map do |flag| flag.gsub! /([\"|\\-l]*)/, '' end.map do |name| PodDependency.newLibrary name end\n mixed_frameworks = other_ldflags.filter do |flag| !flag.start_with? '-l' end\n \n weak_frameworks = mixed_frameworks.length.times.filter do |i| mixed_frameworks[i].include? 'weak_framework' end.map do |i| PodDependency.newWeakFramework(mixed_frameworks[i+1].gsub! '\"', '') end\n frameworks = mixed_frameworks.length.times.select do |i| mixed_frameworks[i].match /^([^{weak_}]*)framework$/ end.map do |i| PodDependency.newFramework(mixed_frameworks[i+1].gsub! '\"', '') end\n\n return libraries + frameworks + weak_frameworks\n end",
"title": ""
}
] |
fe7acb914104d7dad27ec4658db80370
|
Halt the current request and respond with a 401 AUTHORIZATION REQUIRED
|
[
{
"docid": "fdc343138a9dd2faf2837ba717288c2a",
"score": "0.671223",
"text": "def send_authrequired_response( realm=\"gemserver\" )\n\t\tself.response['WWW-Authenticate'] = %(Basic realm=\"#{realm}\")\n\t\tthrow :halt, [ 401, 'Authorization required' ]\n\tend",
"title": ""
}
] |
[
{
"docid": "29a7964cff363860f618cb1a37318782",
"score": "0.75654465",
"text": "def unauthorized\n headers['WWW-Authenticate'] = 'Bearer realm=\"API\"'\n head :unauthorized\n end",
"title": ""
},
{
"docid": "c0cb18cdbcb85c8e43d3ad80b6757021",
"score": "0.7549013",
"text": "def unauthorized\n headers['WWW-Authenticate'] = 'Bearer realm=\"API\"'\n render_error 401\n end",
"title": ""
},
{
"docid": "cedf334d45783b6ca8332e16a3f9e39d",
"score": "0.7543624",
"text": "def protected!\n #Check authorized method, before halting\n halt 401, slim(:unauthorized) unless authorized?\n end",
"title": ""
},
{
"docid": "84334c68575b7197c52099fd03e2ce84",
"score": "0.74403787",
"text": "def prepare_unauthorized_response\n response.headers['WWW-Authenticate'] = 'Token realm=\"ImpactAppUser\"'\n response.status = :unauthorized\n end",
"title": ""
},
{
"docid": "a165fd3d060d9d1b80ebd296664d685a",
"score": "0.74012095",
"text": "def unauthorized_request\n render json: {\n status: 401,\n message: 'Unauthorized access'\n },\n status: 401\n end",
"title": ""
},
{
"docid": "cce5674c5e2a46e0c453730c251e7094",
"score": "0.7399944",
"text": "def deny_access!\n head 401\n end",
"title": ""
},
{
"docid": "866b4d53a5cc7ad006b1aa3e596692f9",
"score": "0.7324816",
"text": "def require_login\n @response.add_header('WWW-Authenticate', \"Bearer realm=\\\"#{@realm}\\\"\")\n @response.status = 401\n end",
"title": ""
},
{
"docid": "6d794fac15314a8a3e05d880695be6a1",
"score": "0.72834796",
"text": "def unauthorized\n custom!(Rack::Response.new([config.fail_message], 401, { 'WWW-Authenticate' => %Q{Bearer realm=\"#{config.realm}\"} }))\n end",
"title": ""
},
{
"docid": "338dc1131407ea6ffd309804ad2ae181",
"score": "0.72703576",
"text": "def unauthorised\n render_error 401, :unauthorized\n end",
"title": ""
},
{
"docid": "e24989f1c5ab25d639d83e8eab4a1a37",
"score": "0.7238553",
"text": "def host_authorization_unauthorized(_)\n @_response.status = 403\n nil\n end",
"title": ""
},
{
"docid": "bfb75a5fce3498bf930b36dd4a8af4ca",
"score": "0.7231557",
"text": "def check_authorization\n render status: 401 unless authorized?\n end",
"title": ""
},
{
"docid": "d41cb47140943f8d2f246f36734c823d",
"score": "0.7212575",
"text": "def access_denied!\n render 'errors/401', status: :unauthorized, layout: 'empty' # && return\n end",
"title": ""
},
{
"docid": "aeb186d7d2bec81025bb34342bf47d78",
"score": "0.71754706",
"text": "def fail_authorization\n render json: { error: 'Unauthorized' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "fb535a1463a6e98067d49ef6eec70991",
"score": "0.7174083",
"text": "def authorize_fail\n if request.format == :json\n render :text => \"Unauthorized action.\"\n else\n render :file => \"static/401\", :formats => [:html], :status => :unauthorized\n end\n return false\n end",
"title": ""
},
{
"docid": "66643f06ffd9c5396f980d9d8e407c7b",
"score": "0.7170638",
"text": "def prepare_unauthorized_response\n response.headers['WWW-Authenticate'] = 'Token realm=\"Evaluator\"'\n response.status = :unauthorized\n end",
"title": ""
},
{
"docid": "0641b4877d8ece47e75270b7bd486ca9",
"score": "0.7149141",
"text": "def halt_unauthorized(errors, render_options = {})\n halt_error(401, errors, render_options)\n end",
"title": ""
},
{
"docid": "e1531dcaf84e6cc82aa0be8a1eaec91f",
"score": "0.7142923",
"text": "def request\n request!\n throw :halt, @controller.render(\"HTTP Basic: Access denied.\\n\", :status => Unauthorized.status, :layout => false)\n end",
"title": ""
},
{
"docid": "31ea2a2e968bfe3e31f2ed9f3b819e84",
"score": "0.7141215",
"text": "def render_unauthorized\n render json: { errors: ['Unauthorized'] }, status: 401 and return\n end",
"title": ""
},
{
"docid": "9074e880083454c60632eac9d716fbc2",
"score": "0.71326315",
"text": "def halt_unauthorised(code, message)\n halt 401, err(code, message: message)\n end",
"title": ""
},
{
"docid": "4fa151fd894e5b8b22389034a068a633",
"score": "0.71282184",
"text": "def prepare_unauthorized_response\n response.headers['WWW-Authenticate'] = 'Token realm=\"ChattyCatty\"'\n response.status = :unauthorized\n end",
"title": ""
},
{
"docid": "8f9d9385a4b2ad6bbc9d1dd3b690b274",
"score": "0.7094063",
"text": "def unauthorized\n custom!(Rack::Response.new([config.fail_message], 401, { 'WWW-Authenticate' => %Q{Basic realm=\"#{config.realm}\"} }))\n end",
"title": ""
},
{
"docid": "0ef56a9d6e428eca2c92909597aa6d6b",
"score": "0.709205",
"text": "def access_denied!\n render partial: 'errors/401', status: 401 && return\n end",
"title": ""
},
{
"docid": "ed44a0bbf3a0252a9de8ca237ce95b49",
"score": "0.7058933",
"text": "def respond_unauthorized(message = nil)\n if message\n error_response(message, 401)\n else\n head :unauthorized\n end\n @performed_render = true\n end",
"title": ""
},
{
"docid": "3af3389bab7f85e110ce586f17ad4405",
"score": "0.7051364",
"text": "def access_denied\n head 401\n end",
"title": ""
},
{
"docid": "3af3389bab7f85e110ce586f17ad4405",
"score": "0.7051364",
"text": "def access_denied\n head 401\n end",
"title": ""
},
{
"docid": "c0549291f25802bca9046f6e435aca7e",
"score": "0.7032064",
"text": "def user_not_authorized\n head :unauthorized\n end",
"title": ""
},
{
"docid": "6637140b4c380092fd492b1a3c9aab86",
"score": "0.70202076",
"text": "def protected!\n return if authorized?\n headers['WWW-Authenticate'] = 'Basic Realm=\"Admin Only\"'\n halt 401, \"Not Authorized\"\n end",
"title": ""
},
{
"docid": "981433241790fa83b0ed0b3f5cd90623",
"score": "0.7014924",
"text": "def protected!\n unless authorized?\n response['WWW-Authenticate'] = %(Basic realm=\"Restricted Area\")\n throw(:halt, [401, \"Not authorized\\n\"])\n end\n end",
"title": ""
},
{
"docid": "bf61e57b4cdeacb1855de0d40a67ec7e",
"score": "0.7005576",
"text": "def protected!\n unless authorized_token?\n response['WWW-Authenticate'] = %(Basic realm=\"Restricted Area\")\n throw(:halt, [401, \"Not authorized\\n\"])\n end\n end",
"title": ""
},
{
"docid": "76471fa3ce1b128991088afeaef8ae22",
"score": "0.70023507",
"text": "def access_denied\n head 401\n false\n end",
"title": ""
},
{
"docid": "5a0db1c98e7b77abd2636fbdb3e437a8",
"score": "0.6996499",
"text": "def protected!\n unless authorized?\n response['WWW-Authenticate'] = %(Basic realm=\"Restricted Zen Area\")\n throw(:halt, [401, \"Oops... we need your login name & password\\n\"])\n end\nend",
"title": ""
},
{
"docid": "61925a301fe037a22bee04ea6a99f565",
"score": "0.6988292",
"text": "def unauthorized_request(exception)\n respond_to do |format|\n format.json { render :json => {:status => {\n :code=>401,\n :message=>exception.message}}, \n :status => :unauthorized }\n format.any { render :text => \"Error: #{exception.message}\", :status => :unauthorized }\n end\n end",
"title": ""
},
{
"docid": "f5767689c4fa773bfca6a3f595ff8671",
"score": "0.6985955",
"text": "def unauthorized(opts)\n flow_halt UNAUTHORIZED, opts\n end",
"title": ""
},
{
"docid": "d45591e565ce313d520bfdaf6453a0c3",
"score": "0.6985657",
"text": "def permission_denied\n head :unauthorized\n end",
"title": ""
},
{
"docid": "2e49418b7605bec7c375791ac0bd5bb5",
"score": "0.69826424",
"text": "def protected!\n\t\t\tunless authorized?\n\t\t\t\tresponse['WWW-Authenticate'] = \\\n\t\t\t\t\t%(Basic realm=\"Concerto Configuration\")\n\t\t\t\tthrow(:halt, [401, \"Not authorized\\n\"])\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "c373b75179367a09ac4c7453fffe1e6e",
"score": "0.69666773",
"text": "def unauthorized_request(e)\r\n json_response({ error: e.message }, :unauthorized)\r\n end",
"title": ""
},
{
"docid": "23bdbfe6418f3a3fde4486d51b2ab394",
"score": "0.6960106",
"text": "def require_login\n @response.add_header('WWW-Authenticate', 'AWS')\n @response.status = 401\n end",
"title": ""
},
{
"docid": "834d605706cd7195c3872a323008f09f",
"score": "0.6954766",
"text": "def unauthorized_request(e)\n render json: { message: e.message }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "834d605706cd7195c3872a323008f09f",
"score": "0.6954766",
"text": "def unauthorized_request(e)\n render json: { message: e.message }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "ac79ca6d17484399b508e70b107edd04",
"score": "0.6952519",
"text": "def unauthorized_request(e)\n\t\trender json: { message: e.message }, status: :unauthorized\n\tend",
"title": ""
},
{
"docid": "a5a12e583378ffc35679d23b98564931",
"score": "0.6950201",
"text": "def authorization_response\n render text: 'Authorization failure', status: :unauthorized\n end",
"title": ""
},
{
"docid": "720dcf20212c7f7c6ed71faec5fa1e3b",
"score": "0.69477504",
"text": "def render_unauthorized\n self.headers['WWW-Authenticate'] = \"Token realm='Projects API'\"\n render json: \"401: API token required.\", status: :unauthorized\n end",
"title": ""
},
{
"docid": "b569e5d6c4a24fc0eba458bc0f6bc5cb",
"score": "0.6932727",
"text": "def unauthorized\n render :text => \"Unauthorized\", :content_type => \"text/plain\", :status => :unauthorized\n end",
"title": ""
},
{
"docid": "ca7978763af362b9b7254296d6b3bc1f",
"score": "0.6929342",
"text": "def require_user_or_401\n render(status: 401, text: '') && return unless current_user\n end",
"title": ""
},
{
"docid": "73e37b3a224bb69abc726c17d113a872",
"score": "0.6922022",
"text": "def access_forbidden\n unless @authenticated\n # The user is not authenticated; ask for credentials\n respond_to do |format|\n format.html { redirect_to login_url }\n format.xml { request_http_basic_authentication \"Accounting\" }\n end\n else\n # The user is authentication but unauthorized for this resource\n head :forbidden\n end\n end",
"title": ""
},
{
"docid": "332f020359e7dc29bac037d97ee83977",
"score": "0.69206226",
"text": "def unauthorized_request(e)\n json_response({ status: 400, message: e.message }, :unauthorized)\n end",
"title": ""
},
{
"docid": "b596570b888d654b35160b2a8c5e0341",
"score": "0.6918339",
"text": "def render_unauthorized\n render json: {errors: ['Bad credentials']}, status: 401\n end",
"title": ""
},
{
"docid": "4069f7258167acf3a83b9b73d2c00946",
"score": "0.6914767",
"text": "def restrict_access\n render :file => \"public/401.html\", :status => :unauthorized, :layout => false\n end",
"title": ""
},
{
"docid": "2c00a56bae2e0db8ac7997fc04f0aa1f",
"score": "0.6913538",
"text": "def unauthorized\n render :text => \"You are not authorized to perform this action\", :status => 401\n end",
"title": ""
},
{
"docid": "9f3fe11430b6a71bdc4dabf2bfe166da",
"score": "0.69095975",
"text": "def access_denied\n @errors = \"authenication failed\"\n render status: 401\n end",
"title": ""
},
{
"docid": "ca088ba08c95d3a5ce22057849f22a93",
"score": "0.69079137",
"text": "def unauthorized(e)\n error_response('You are not authorized to do that.', 401)\n end",
"title": ""
},
{
"docid": "31a6c6586135f9becee166cbc2523bf9",
"score": "0.68903536",
"text": "def invalid_authentication\n render jsonapi: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "58aa75121c0343595b073daacba75e56",
"score": "0.6887952",
"text": "def deny_access\n @status = 401\n respond_to do |format|\n format.html { render template: \"errors/401\", status: @status, layout: \"errors\" }\n format.all { render nothing: true, status: @status }\n end\n end",
"title": ""
},
{
"docid": "56a7e6fd895c75a4eb4bc3862edcc34c",
"score": "0.6887282",
"text": "def handle_unverified_request\n reset_session\n render :nothing => true, :status => 401\n end",
"title": ""
},
{
"docid": "56a7e6fd895c75a4eb4bc3862edcc34c",
"score": "0.6887282",
"text": "def handle_unverified_request\n reset_session\n render :nothing => true, :status => 401\n end",
"title": ""
},
{
"docid": "70372ab6459cd84f4d159c7907310fdb",
"score": "0.6880744",
"text": "def protected!\n unless authorized?\n response['WWW-Authenticate'] = \\\n %(Basic realm=\"Concerto Configuration\")\n throw(:halt, [401, \"Not authorized\\n\"])\n end\n end",
"title": ""
},
{
"docid": "ec42e223dd109ef87d5ee8375ccf11b8",
"score": "0.68752486",
"text": "def secure_api\n if !authorized\n render status: 401, text: 'Please log in to use this API' and return\n end\n end",
"title": ""
},
{
"docid": "21540396486f1028d2484c06bf1302d1",
"score": "0.68669194",
"text": "def protected!\n unless authorized_basic?\n response['WWW-Authenticate'] = %(Basic realm=\"Restricted Area\")\n throw(:halt, [401, \"Not authorized\\n\"])\n end\n end",
"title": ""
},
{
"docid": "d47267dee4e9d838dd5283cfe3a884ae",
"score": "0.68554604",
"text": "def unauthorized\n render :text => \"Unauthorized.\", :status => :unauthorized\n end",
"title": ""
},
{
"docid": "2b90fcba280b4d8d5af8fd5ce0da64a2",
"score": "0.68489975",
"text": "def unauthorized\n respond_to do |format|\n format.html do\n if current_user\n flash.now[:error] = t(:authorization_failure)\n render 'spree/shared/unauthorized', :layout => '/spree/layouts/spree_application'\n else\n store_location\n redirect_to spree.login_path and return\n end\n end\n format.xml do\n request_http_basic_authentication 'Web Password'\n end\n format.json do\n render :text => \"Not Authorized \\n\", :status => 401\n end\n end\n end",
"title": ""
},
{
"docid": "1d2852e93c5e8636efb3cc0105ae18cc",
"score": "0.6848456",
"text": "def unauthorized\n respond_to do |format|\n format.html do\n if admin?\n flash.now[:error] = I18n.t(:authorization_failure)\n redirect_to login_path and return\n elsif current_user || admin?\n flash.now[:error] = I18n.t(:authorization_failure)\n render 'shared/unauthorized'\n #FIXME:: Should be that\n #render 'shared/unauthorized', :layout => 'layouts/application', :status => 401\n else\n store_location\n redirect_to login_path and return\n end\n end\n format.xml do\n request_http_basic_authentication 'Web Password'\n end\n format.json do\n render :text => \"Not Authorized \\n\", :status => 401\n end\n end\n end",
"title": ""
},
{
"docid": "cc0257e257da7a7b653fb130e32d1109",
"score": "0.68415785",
"text": "def render_unauthorized\n render(file: 'public/401.html', status: :unauthorized, layout: false) and return\n end",
"title": ""
},
{
"docid": "1b9d268bef058f00a77ef4d68404fa54",
"score": "0.6836871",
"text": "def unauthorized; end",
"title": ""
},
{
"docid": "cefdf57912a8ee836e21b5b3c056b26f",
"score": "0.6828498",
"text": "def unauthorized_request(e)\n json_response({ message: e.message }, :unauthorized)\n end",
"title": ""
},
{
"docid": "cefdf57912a8ee836e21b5b3c056b26f",
"score": "0.6828498",
"text": "def unauthorized_request(e)\n json_response({ message: e.message }, :unauthorized)\n end",
"title": ""
},
{
"docid": "cefdf57912a8ee836e21b5b3c056b26f",
"score": "0.6828498",
"text": "def unauthorized_request(e)\n json_response({ message: e.message }, :unauthorized)\n end",
"title": ""
},
{
"docid": "e16132ab7a5d4c18cdcc026652cd0ee3",
"score": "0.68283",
"text": "def unauthorized_request(e)\n json_response({ message: e.message }, :unathorized)\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.6820332",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.6820332",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.6820332",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.6820332",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "94429d1ad94ffd79b3eba7bf52edc6b1",
"score": "0.6820332",
"text": "def access_denied\n render :json => %Q~{\"errors\": [\"Please login to consume the REST API\"]}~, :status => 401\n end",
"title": ""
},
{
"docid": "f365161f19707f2e1f929356059ab7a9",
"score": "0.6816141",
"text": "def unauthorized\r\n respond_to do |format|\r\n format.html do\r\n if current_user\r\n flash.now[:error] = I18n.t(:authorization_failure)\r\n render 'shared/unauthorized', :layout => 'spree_application'\r\n else\r\n flash[:error] = I18n.t(:authorization_failure)\r\n store_location\r\n redirect_to login_path + \"?from_admin=true\" and return\r\n end\r\n end\r\n format.xml do\r\n request_http_basic_authentication 'Web Password'\r\n end\r\n format.json do\r\n render :text => \"Not Authorized \\n\", :status => 401\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "66c30ed77336ef60c6b24877cf394cce",
"score": "0.68108535",
"text": "def unauthorized_request(e)\n json_response({ message: e.message }, :unauthorized)\n end",
"title": ""
},
{
"docid": "62d424d60c1299fd48bdd3cd5b28bfa1",
"score": "0.68095267",
"text": "def unauthorized_request(e)\n error = format_error e\n json_response({ error: error }, :unauthorized)\n end",
"title": ""
},
{
"docid": "6526707381afe6162caa1c383f310f3a",
"score": "0.6800393",
"text": "def not_authorized\n render json: { error: 'Not Authorized'}, status: 401\n end",
"title": ""
},
{
"docid": "074ff542c489b72fe5b23aec69347a0c",
"score": "0.6796212",
"text": "def unauthorized_request(e)\n json_response({ message: e.message }, :unauthorized)\n end",
"title": ""
},
{
"docid": "074ff542c489b72fe5b23aec69347a0c",
"score": "0.6796212",
"text": "def unauthorized_request(e)\n json_response({ message: e.message }, :unauthorized)\n end",
"title": ""
},
{
"docid": "9b23f45bd4d9b4688f2c0aa20a91920d",
"score": "0.67882097",
"text": "def protected! ; halt 401 unless admin? ; end",
"title": ""
},
{
"docid": "995c3babbdda8c7ba6b0b76f5d2dc67f",
"score": "0.67873114",
"text": "def status\n 401\n end",
"title": ""
},
{
"docid": "e30bef057a04d56e397bcb0d6e27d327",
"score": "0.6784559",
"text": "def invalid_authentication\n render json: { error: 'Unauthorized Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "cb6b0c78473413b51dd87533157beb91",
"score": "0.67673033",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "011356b7a219632af683345081b36912",
"score": "0.6763373",
"text": "def unauthorized\n end",
"title": ""
},
{
"docid": "fd19454262e80a219dfdea00a2a8269e",
"score": "0.67395896",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "fd19454262e80a219dfdea00a2a8269e",
"score": "0.67395896",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.6735977",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.6735977",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.6735977",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "51e1577a5b382567c09a8fb58fb8aa15",
"score": "0.6735977",
"text": "def invalid_authentication\n render json: {error: 'Invalid Request'}, status: :unauthorized\n end",
"title": ""
},
{
"docid": "edc3c7cd86a1a89d6164ab77230b22d2",
"score": "0.67155963",
"text": "def protected!\n return unless ENV[\"HTTP_USER\"]\n unless authorized?\n response['WWW-Authenticate'] = %(Basic realm=\"Restricted Area\")\n throw(:halt, [401, \"Not authorized\\n\"])\n end\n end",
"title": ""
},
{
"docid": "4526988da672e20f3361e7025931e9ae",
"score": "0.6712847",
"text": "def access_denied\n respond_to do |format|\n format.any do\n redirect_to authentication_url\n end\n end\n end",
"title": ""
},
{
"docid": "4928754b427ecfbea84843ca03abcba9",
"score": "0.67125535",
"text": "def invalid_authentication\n render_unauthorized_response\n end",
"title": ""
},
{
"docid": "6a4a1debd61a7ebc7f019f7d106d0959",
"score": "0.67104644",
"text": "def authenticate_request\n @current_user = AuthorizeApiRequest.call(request.headers).result\n render json: { error: 'You are not Authorized, please check your authorization from admin' }, status: 401 unless @current_user\n end",
"title": ""
},
{
"docid": "629f7817e4cdd260c59bf27c3ff050fc",
"score": "0.67097974",
"text": "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "629f7817e4cdd260c59bf27c3ff050fc",
"score": "0.67097974",
"text": "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "c74ed3b5625696210658314b1442efe3",
"score": "0.67054135",
"text": "def invalid_authentication\n render json: { error: 'Unauthenticated Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "fbf692f7191eb10d310d04772f954b8f",
"score": "0.67033553",
"text": "def invalid_authentication\n render json: { error: 'Access not granted' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "7974a70d7714684cab43ebaa2f950030",
"score": "0.6702155",
"text": "def be_unauthorised\n ResponseStatusMatcher.new \"401 Unauthorized\"\n end",
"title": ""
},
{
"docid": "d01be45606c3dcb09e18fe8b95b57562",
"score": "0.66995823",
"text": "def invalid_authentication\n render json: { error: 'Invalid Request' }, status: :unauthorized\n end",
"title": ""
},
{
"docid": "6fa844b6f267f912deeabb93c4cd8f26",
"score": "0.6699369",
"text": "def unauthorized(exception)\n self.exception = exception\n render '/unauthorized', status: 403\n end",
"title": ""
}
] |
5182f02a0719adc5d29d9ec64095e5e5
|
tell a string is Chinese words or not return true if is
|
[
{
"docid": "532ccd1e383542b22ebc2112ab360b74",
"score": "0.7288308",
"text": "def han?(str)\n str =~ /\\p{Han}/\nend",
"title": ""
}
] |
[
{
"docid": "3851d6ad4dfb140ef15c8d115a83187d",
"score": "0.78648174",
"text": "def chinese?(c)\n (0x2000..0x2069).include?(c.ord) || # General Punctuation\n (0x2e80..0x2fff).include?(c.ord) || # CJK Radicals Supplement, Kangxi \n # Radicals, Ideographic Description \n # Characters\n (0x3000..0x303f).include?(c.ord) || # Punctuation\n (0x3100..0x312f).include?(c.ord) || # Bopomofo\n (0x3190..0x31ef).include?(c.ord) || # Kanbun, Bopomofo Extended, CJK \n # Strokes\n (0x4e00..0x9fff).include?(c.ord) || # CJK Unified Ideographs\n (0xf900..0xfaff).include?(c.ord) || # CJK Compatibility Ideographs\n (0x3400..0x4dbf).include?(c.ord) || # CJK Unified Ideographs Extension A\n (0xff00..0xffef).include?(c.ord) || # Halfwidth and Fullwidth Forms\n (0x20000..0x2fa1f).include?(c.ord) # CJK Unified Ideographs Extension B,\n # C, D, CJK Compatibility Ideographs\n # Supplement \n end",
"title": ""
},
{
"docid": "6fb0d140e749a17e672cee6752e37ced",
"score": "0.75002295",
"text": "def chinese_s\n CLD.detect_language('这是一个简体中文测')\n end",
"title": ""
},
{
"docid": "2a2adc7e0d587e3ec99e8f8056328ed0",
"score": "0.7350349",
"text": "def chinese_t\n CLD.detect_language('這是中國傳統的考試')\n end",
"title": ""
},
{
"docid": "771451184ea9cc13ccddad9b15ad06fa",
"score": "0.71042854",
"text": "def is_utf8?(string); end",
"title": ""
},
{
"docid": "68d1aaae7858a24d1ea66bc904cd3d3a",
"score": "0.7045339",
"text": "def detect_unicode(str); end",
"title": ""
},
{
"docid": "68d1aaae7858a24d1ea66bc904cd3d3a",
"score": "0.7045339",
"text": "def detect_unicode(str); end",
"title": ""
},
{
"docid": "ae0f68d70e297d2b3fb00c3ddd51d833",
"score": "0.7035263",
"text": "def english?\n text.ascii_only?\n end",
"title": ""
},
{
"docid": "fc9b70293edbafc5fdb9ea2a7f8155a6",
"score": "0.6961396",
"text": "def unicode?(text)\n !is_gsm(text)\n end",
"title": ""
},
{
"docid": "30645f727d9d625d1f0e218ba8884fd6",
"score": "0.68482876",
"text": "def wide_latin?\n self >= 0xff10 && self <= 0xff5a\n end",
"title": ""
},
{
"docid": "db000c38ae61ea7439c25828f6e62dae",
"score": "0.67175466",
"text": "def latinish?\n latin_count = cyrillic_count = 0\n split_words.each do |word|\n if word.latin?\n latin_count+=1\n else\n cyrillic_count+=1\n end\n end\n latin_count > cyrillic_count\n end",
"title": ""
},
{
"docid": "cda5601cfc1a0de4a4566a5b45499e54",
"score": "0.6715128",
"text": "def english?(message)\n /[一-龠]+|[ぁ-ん]+|[ァ-ヴー]+|[a-zA-Z0-9]+/ !~ message\nend",
"title": ""
},
{
"docid": "fc96ba76edc9eb6455f80a9de2a23801",
"score": "0.6693413",
"text": "def complete_korean_char? ch\n raise ArgumentError.new('Lengthy input') if str_length(ch) > 1\n\n # Range of Korean chracters in Unicode 2.0: AC00(가) ~ D7A3(힣)\n ch.unpack('U').all? { | c | c >= 0xAC00 && c <= 0xD7A3 }\n end",
"title": ""
},
{
"docid": "2ab7c1c67fb3b8f33630ac2f07c3f414",
"score": "0.66317904",
"text": "def katakana?\n tr('ー', '').mojinizer_katakana?\n end",
"title": ""
},
{
"docid": "78876f04d3f41bf2da5869a067fea4a2",
"score": "0.6595409",
"text": "def japanese?\r\n #$data_system.japanese\r\n return false\r\n end",
"title": ""
},
{
"docid": "7f7979932074dd17fcb24420aa7f950e",
"score": "0.6576381",
"text": "def cyrillish?\n !self.latinish?\n end",
"title": ""
},
{
"docid": "2ff9217d664d130a6ede7615bf0b916f",
"score": "0.65499693",
"text": "def test_multibyte\n result = compose_tweet(\"Laughing: \", \""绿坝绿坝★河蟹你全家feveR.【词:荼荼丸 歌:方正畅听软件音源】 - AcFun.cn" 原來還有國產版 NICO?!\", \"http://bit.ly/Lt6Ag\")\n assert result =~ /^Laughing:/\n assert result =~ /http:\\/\\/bit.ly\\/Lt6Ag\\)$/\n assert result =~ /原來還有國產版/, \"#{result}\"\n assert result.mb_chars.length <= 140\n end",
"title": ""
},
{
"docid": "bf3df0e50e9d2c7cc69f38e93644b659",
"score": "0.6537186",
"text": "def is_unicode(text)\n !is_gsm(text)\n end",
"title": ""
},
{
"docid": "f58fe8f9b06079f1c476bed02c6a87fd",
"score": "0.6462538",
"text": "def check_encoding(str)\n str[/[A-Za-z0-9_]+/] == str\n end",
"title": ""
},
{
"docid": "03c6417546115c4b4bb9a38bfcc3736f",
"score": "0.643495",
"text": "def is_utf8?; end",
"title": ""
},
{
"docid": "03c6417546115c4b4bb9a38bfcc3736f",
"score": "0.643495",
"text": "def is_utf8?; end",
"title": ""
},
{
"docid": "fdc60cc7083d875f5851077e083089d0",
"score": "0.6428507",
"text": "def has_bad_word(str)\n #Turn string (url or body) into UTF-8 and lower case\n new_str = str.force_encoding(\"UTF-8\").downcase\n bad_words = [\"spongebob\",\n \"britney spears\",\n \"paris hilton\",\n \"norrköping\"]\n return bad_words.any? { |word| new_str.include?(word) }\nend",
"title": ""
},
{
"docid": "8b679fcc1b0229880d60bfcc71f27ffe",
"score": "0.6355815",
"text": "def check_encoding(str); end",
"title": ""
},
{
"docid": "cc3b51e99f1d98c64195d0efe36e54ce",
"score": "0.6350033",
"text": "def wikiword?(s)\n s =~ WIKI_WORD_PAT\n end",
"title": ""
},
{
"docid": "ebcc397ab3368c82ad4ec140e6b622a0",
"score": "0.6337803",
"text": "def korean_char? ch\n raise ArgumentError.new('Lengthy input') if str_length(ch) > 1\n\n complete_korean_char?(ch) || @all.include?(ch)\n end",
"title": ""
},
{
"docid": "ea14448c9c174a73c24dfa84d1a2d284",
"score": "0.6322355",
"text": "def is_ascii?\n text.each_byte { |c| return false if c>=127 }\n true\n end",
"title": ""
},
{
"docid": "eb25999c6ad34a6a855e51caf7a39692",
"score": "0.63144565",
"text": "def tweet_enough_ascii?(tweet)\n return non_ascii_characters_ratio(tweet[\"text\"]) <= NON_ASCII_RATIO_THRESHOLD\nend",
"title": ""
},
{
"docid": "ec3bbd6c305bc7c57ec24eb3ebb982ad",
"score": "0.63005394",
"text": "def english?(word)\n # no gem version: word.upcase != data_h[\"output\"].upcase\n ENGLISH_WORDS.include?(word.downcase)\n end",
"title": ""
},
{
"docid": "692c62091372451a2356d68e7a54ab56",
"score": "0.6295389",
"text": "def string_in_lang? str\n return (not (str =~ @re).nil?)\n end",
"title": ""
},
{
"docid": "a475de13c106d94a4f5e715ba35628cc",
"score": "0.6286787",
"text": "def understand? str\n return false # default false\n end",
"title": ""
},
{
"docid": "d90a3f820d259f25f49d4a42c86b1b88",
"score": "0.62588674",
"text": "def fully_analyzed?\n phonetic_component.all? { |p| p.is_a?(Morpheme) }\n end",
"title": ""
},
{
"docid": "eac4e6d912d47f088a3824eaba9a0c0a",
"score": "0.6258545",
"text": "def has_umlaut(str)\n !!(str =~ /[öäüÖÄÜß]/)\n end",
"title": ""
},
{
"docid": "8f9891f5c2918e7cbef403014b4f5f3b",
"score": "0.62449104",
"text": "def is_latin?\n self.get_language == 'en' ? true : false\n end",
"title": ""
},
{
"docid": "2ea223078a741345e68b09507768f05f",
"score": "0.6228846",
"text": "def is_utf8?(str)\n isutf8 = true\n begin\n str.unpack('U'*str.length) # check for utf-8 encoding violations, either introduced or in the data\n rescue\n isutf8 = false\n end\n isutf8\n end",
"title": ""
},
{
"docid": "7d2dbb37a50743ffdb0c63d3cffc59fd",
"score": "0.6206384",
"text": "def check_word_for_char(char)\n @word.include?(char) ? true : false\n end",
"title": ""
},
{
"docid": "676487989269481a78898a897212db92",
"score": "0.6189839",
"text": "def wf_string?(str)\n #\n # Only allows PCRE \"word\" characters, spaces, full-stops and\n # commas in tags and descriptions. This might be too restrictive,\n # but if it is, this is the only place we need to change it.\n #\n if str.is_a?(String) && str.size < 1024 && str =~ /^[-\\w .,]*$/\n return true\n end\n\n raise Wavefront::Exception::InvalidString, str\n end",
"title": ""
},
{
"docid": "8756cebb47c19de31cb6f1fb67dba01c",
"score": "0.6165628",
"text": "def vindicated_word?(word)\n \nend",
"title": ""
},
{
"docid": "e01735472eba75409c972c9f0d0d2fb7",
"score": "0.6160804",
"text": "def is_utf8?(str)\n isutf8 = true\n begin\n str.unpack('U'*str.length) # check for utf-8 encoding violations, either introduced or in the data\n rescue\n isutf8 = false\n end\n isutf8\n end",
"title": ""
},
{
"docid": "394e051341743b356fb9218f57fb08d5",
"score": "0.6134858",
"text": "def text_contains_mixed_cases?\n uppercase_words = @words_and_emoticons.count { |word| WordHelper.word_upcase?(word) }\n\n uppercase_words.positive? && uppercase_words < @words_and_emoticons.size\n end",
"title": ""
},
{
"docid": "eeb0cd8a590e868a713d73743f049453",
"score": "0.6134099",
"text": "def support_unicode?\n !!@support_unicode\n end",
"title": ""
},
{
"docid": "b62526743d6af5d385594f7f7dff2df1",
"score": "0.6130655",
"text": "def contains_cyrillic_characters?(value)\n value =~ /\\p{Cyrillic}/\n end",
"title": ""
},
{
"docid": "25c84b202ae36d3a9aec6513bd19de7d",
"score": "0.61216694",
"text": "def special_word?(str)\n if str[0] == 'c' && str.length % 2 == 0\n return false\n elsif str[0] == 'c' || str.length % 2 == 0\n return true\n end\n return false\nend",
"title": ""
},
{
"docid": "29f686f5667b8a43a6736baaf396f47a",
"score": "0.6120222",
"text": "def is_arabic?(str)\n str =~ %r{([\\u0600-\\u06FF])+}u\n end",
"title": ""
},
{
"docid": "2b1993b3228c04ee0987b7340e41f683",
"score": "0.6119987",
"text": "def vindicated_word?(word)\n \nend",
"title": ""
},
{
"docid": "698d7427a7661f8bac18e62d1f09b69b",
"score": "0.6114811",
"text": "def includes?(word)\n #remove all especial and number characters\n word = word.gsub(/[^A-Za-z]/,'')\n #false case condition\n if @lyrics.count(word) == 0\n return false\n end\n #true case condition\n return @lyrics.any? { |word| word.length > 0}\n end",
"title": ""
},
{
"docid": "4097b30c34151b3295d04405cf436e0a",
"score": "0.6103595",
"text": "def solved?\n @word.each_char.all? { |char| good? char }\n end",
"title": ""
},
{
"docid": "79dc178a63046fc1b106c05989f5f0b1",
"score": "0.6073733",
"text": "def utf16?\n return @utf16\n #if @utf16.nil?\n # @utf16 = (encoding != \"UTF-8\") \n #end\n #return @utf16\n end",
"title": ""
},
{
"docid": "17143e2cf68a47fac6f1328b4e58cbf1",
"score": "0.60676295",
"text": "def english?(word)\n ENGLISH_WORDS.include?(word.downcase)\nend",
"title": ""
},
{
"docid": "269e155bbdae7f4b1be1832c1c72c503",
"score": "0.6056365",
"text": "def is_foreign_tweet(text)\n\t\tlanguage = @whatlanguage.language(text)\n\t\t# puts \"#{text} is thought to be #{language}\"\n\t\tif language != \"english\" then\n\t\t\treturn true\n\t\tend\n\n\t\treturn false\n\tend",
"title": ""
},
{
"docid": "0c33ff36b51647b7adb6bea6d8cfce23",
"score": "0.60547155",
"text": "def wordless?\n @results.map do |r|\n return false if r =~ /\\w/\n end\n true\n end",
"title": ""
},
{
"docid": "269ce66734315193b6d9d4b850c3452d",
"score": "0.60372245",
"text": "def is_utf8?\n Multibyte::Handlers::UTF8Handler.consumes?(self)\n end",
"title": ""
},
{
"docid": "895178eb08375347786164639f1696c3",
"score": "0.60355234",
"text": "def cyrillic?\n guess_layout.equal?(:cyr)\n end",
"title": ""
},
{
"docid": "d037d737082036302bdcf032a6448b7d",
"score": "0.60269845",
"text": "def non_ascii?\n @value.each_byte do |b|\n return true if b > 127\n end\n false\n end",
"title": ""
},
{
"docid": "b8b8c0e9659f86738b3fb8ab4c10bed4",
"score": "0.60229725",
"text": "def vindicated_word?(word)\n\nend",
"title": ""
},
{
"docid": "437781e8995837154607ee1fb8d42920",
"score": "0.60221267",
"text": "def is_word?\n !(self =~ /^[a-zA-Z]+$/).nil?\n end",
"title": ""
},
{
"docid": "b545def3ba977654b580abcdbb153357",
"score": "0.6004524",
"text": "def num_cjk_uni(str)\n if str\n str.scan(/\\p{Han}|\\p{Katakana}|\\p{Hiragana}|\\p{Hangul}/).size\n else\n 0\n end \nend",
"title": ""
},
{
"docid": "0ea0b6b174a40880cefc449de0d292a7",
"score": "0.5994517",
"text": "def isKatakana?(token)\n token.each_char do |x|\n return false unless $katakana.include?(x)\n end\n true\nend",
"title": ""
},
{
"docid": "6cb9e67aa72b139db172bd08be13863f",
"score": "0.5970083",
"text": "def isKanji?(token)\n token.each_char do |x|\n return false if $katakana.include?(x) || $hiragana.include?(x) || $alphabet.include?(x)\n end\n true\nend",
"title": ""
},
{
"docid": "b0c2ad62a30e8fce659193507024d8f9",
"score": "0.5966805",
"text": "def kindle?\n !!(ua =~ /Kindle/)\n end",
"title": ""
},
{
"docid": "e161785e8409eea2c73813e696fd0a28",
"score": "0.5965623",
"text": "def multibyte_correct?(pos, str)\n\n read_str = IO.read(MULTIBYTE_SAMPLE_PATH, str.bytesize, pos)\n str == read_str.toutf8\n end",
"title": ""
},
{
"docid": "794bd62f2f233c794c60dcec93021bb7",
"score": "0.59517133",
"text": "def has_utf8_semantics? #:nodoc:\n UTF8_PAT.match(self)\n end",
"title": ""
},
{
"docid": "7579800b0e369a5fb85ba7480bd19600",
"score": "0.59478986",
"text": "def yell word\n\t\tword.match(/[a-z]/).nil?? true : false\n\tend",
"title": ""
},
{
"docid": "2d9e9b8f6deb2f6da263bf71059f840b",
"score": "0.59121794",
"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": "f3263ea69a293727eae5ccaa1e381038",
"score": "0.5911951",
"text": "def triangular_word?(str)\n encoding = 0\n str.each_codepoint { |c| encoding += c % 96 }\n\n triangular_numbers = Hash.new { |h,k| h[k] = ((k * (k+1)) / 2)}\n\n i = 1\n until triangular_numbers[i] >= encoding\n i += 1\n end\n \n triangular_numbers[i] == encoding\nend",
"title": ""
},
{
"docid": "b1ac0cc88efb2f7cf1a941463d6fa7c6",
"score": "0.5903878",
"text": "def is_english_letter?(ch)\n ('a'..'z') === ch.downcase\n end",
"title": ""
},
{
"docid": "c6b3623305d8a0a7b7b07e6b514b83cd",
"score": "0.5903269",
"text": "def is_utf8?\n ActiveSupport::Multibyte::Handlers::UTF8Handler.consumes?(self)\n end",
"title": ""
},
{
"docid": "a82cd721e26e02894cedb0bdaa5ee610",
"score": "0.58969134",
"text": "def english_word?(attempt)\n translated = fr_translation(attempt)\n translated.nil? ? false : true\nend",
"title": ""
},
{
"docid": "86513ff8ee585c9886c61a7435070fc5",
"score": "0.58916473",
"text": "def valid_unicode(i)\n (i == 0x9 || i == 0xa || i == 0xd ||\n (i >= 0x20 && i <= 0xd7ff) ||\n (i >= 0xe000 && i <= 0xfffd) ||\n (i >= 0x10000 && i <= 0x10ffff))\n end",
"title": ""
},
{
"docid": "0a0631f0361c7d92cc046de8e1d7b6fa",
"score": "0.5882921",
"text": "def check_cyrillic(str)\n regexp = /\\p{Cyrillic}+.*?\\.?/\n if str.match(regexp).nil?\n return false\n else\n return true\n end\n end",
"title": ""
},
{
"docid": "3f40c4b992c68d6776d03b1b163b9c84",
"score": "0.5880661",
"text": "def valid_utf8?(s)\n @connection.valid_utf8?(s)\n end",
"title": ""
},
{
"docid": "1eb4f6c81266e71d4e813ece182c9152",
"score": "0.5878549",
"text": "def word?(word)\n return true if ACCEPT_WORDS.include?(word)\n return false if REJECT_WORDS.include?(word)\n return false if word.size < 2\n return false if word.size > 11\n return false if word == \"n't\"\n return false if word.start_with?(\"'\")\n return false if word.end_with?(\"'\")\n true\n end",
"title": ""
},
{
"docid": "8ce1a48aa450ace96d8a04a4fda0e535",
"score": "0.5860704",
"text": "def contains_nikto?(str_val)\n return (str_val.downcase.include? \"nikto\" or\n str_val.downcase.include? \"\\6e\\69\\6b\\74\\6f\")\nend",
"title": ""
},
{
"docid": "13df593da4484923eff056f2ab36e5c3",
"score": "0.58580005",
"text": "def yell\n\t\t\treturn @word.match(/[a-z]/).nil?? true : false\n\t\tend",
"title": ""
},
{
"docid": "b28f4af6fef7b26db8c21634c1731225",
"score": "0.5846985",
"text": "def uses_valid_apostrophes? word\n if word.include? \"'\"\n length = word.length\n index = word.index \"'\"\n return false if length-1 != word.tr(\"'\", \"\").length\n return false if index != length-1 and index != length-2\n return false if word[-1] != 's' and word[-2] != 's' and word[-1] != 't' and word[-1] != 'm' and word[-1] != 'd'\n end\n true\n end",
"title": ""
},
{
"docid": "fad6ddd02b26f4bf8e10e717317cb453",
"score": "0.5842759",
"text": "def valid_utf_8?(string)\n string.dup.force_encoding(Encoding::UTF_8).valid_encoding?\n end",
"title": ""
},
{
"docid": "51ba72a18b94883e22e456b82a99f6fa",
"score": "0.5836871",
"text": "def charset_checked?\n 0 != @flags & CHARSET_CHECKED\n end",
"title": ""
},
{
"docid": "197544296e7e86d83f0edd65c052fe79",
"score": "0.5833598",
"text": "def is_word?(word)\n @dictionary.include?(word.downcase)\n end",
"title": ""
},
{
"docid": "3b307100c9ffa312c20178dd8a2d85cc",
"score": "0.5831362",
"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": "e9c6bb0d419bf3a2d9fc554e38c95fe7",
"score": "0.582715",
"text": "def word?(a_string)\n !@words[a_string].nil?\n end",
"title": ""
},
{
"docid": "0f38fafd531ea42b76b493c652b25281",
"score": "0.5819439",
"text": "def detect_language(text)\n if text.class == String\n encoded_text = CGI::escape(text).slice(0..500)\n response = get('Detect', \"text=#{encoded_text}\")\n if response.code == 200\n response.parsed_response.to_hash['string']['__content__']\n else\n false\n end\n else\n raise ArgumentError, \"You must provide a String\"\n end\n end",
"title": ""
},
{
"docid": "a595af85711e88cff11ef40377fc951d",
"score": "0.58188415",
"text": "def phrase_is_boring?(phrase)\n words = phrase.words\n boring_words = %w{a and also are be been for get has in is just me of on only see than this the there was january february march april may june july august september october november december}\n number_non_boring_words = 0\n words.each do |word|\n number_non_boring_words += 1 unless boring_words.include?(word.downcase) #Not unicode safe?\n #number_non_boring_words += 1 unless boring_words.include?(word.chars.downcase) #Unicode safe\n end\n return true unless number_non_boring_words > 1\n end",
"title": ""
},
{
"docid": "9c251ebe46fd3c3caee1dda85d414e91",
"score": "0.58144695",
"text": "def special_word?(str)\n return (str[0].downcase == 'c') ^ (str.length.even?)\nend",
"title": ""
},
{
"docid": "a23d4f12c6144bd18f4400aaab78ffe5",
"score": "0.58107924",
"text": "def num_cjk_uni(str)\n if str\n str.scan(/\\p{Han}|\\p{Katakana}|\\p{Hiragana}|\\p{Hangul}/).size\n else\n 0\n end\n end",
"title": ""
},
{
"docid": "dcd28ca4fbbf260a6bfbf8c1a8757e45",
"score": "0.5807376",
"text": "def is_ascii?\n (0..256).include? self.ord\n end",
"title": ""
},
{
"docid": "9604dc049c03170d52c9abdd8b9284e8",
"score": "0.5802499",
"text": "def word(input_word)\n\n\tif input_word.length < 8\n\t\treturn \"false\"\n\telse\n\t\treturn\"true\"\nend\nend",
"title": ""
},
{
"docid": "383de11fae59dae4fa1a7f66f7c8aa22",
"score": "0.58000666",
"text": "def word?\n # TODO #12 - chagne to :lower: only\n self.form.value =~ /\\A[[:lower:][:upper:]]+\\Z/\n end",
"title": ""
},
{
"docid": "f3028bc7d7b258b9c61fead95174ba80",
"score": "0.57994914",
"text": "def strig_char (st,ch)\n return true if st.include?(ch)==true\n\n false\nend",
"title": ""
},
{
"docid": "5432b4946efb2de351683be436b0b83d",
"score": "0.5798167",
"text": "def in_string?; end",
"title": ""
},
{
"docid": "5432b4946efb2de351683be436b0b83d",
"score": "0.5798167",
"text": "def in_string?; end",
"title": ""
},
{
"docid": "88ad3eb0cbd72f9437e00fc8855e1c5b",
"score": "0.57924247",
"text": "def chaterism?\n words = self.gsub(/[^a-z\\s]/i, '').split\n\n # Find the direction we're traveling\n flen, llen = words.first.length, words.last.length\n direction = flen > llen ? :downto : :upto\n \n # Compare the pattern of word lengths against a range-turned-array of expected word lengths\n words.map(&:length) == flen.send(direction, llen).to_a\n end",
"title": ""
},
{
"docid": "f9dca253c5eeac746dd78f71d6ccabef",
"score": "0.5787609",
"text": "def datacheck(title_content)\n\n\tif (!title_content.include?\"日\") \n\t\treturn false\n\tend\n\n\tif (!title_content.include?\"月\") \n\t\treturn false\n\tend\n\n\tif (title_content.include?\"00\") \n\t\treturn false\n\tend\n\n\treturn true\nend",
"title": ""
},
{
"docid": "19e111ab2d9c400d5062544a754e7e20",
"score": "0.57823884",
"text": "def is_sciency?(text)\n !text.downcase.match(/scien|logy|sophy|tech|comput|pokemon/).nil?\n end",
"title": ""
},
{
"docid": "3aa8dd24e65b7ed3d478054fef713da7",
"score": "0.57804304",
"text": "def word? chars = []\n return terminal? if chars.empty?\n\n word_chars? chars\n end",
"title": ""
},
{
"docid": "2047f35c784bae87f11522bc5ca30c5a",
"score": "0.57792586",
"text": "def unicode(string); end",
"title": ""
},
{
"docid": "34f2085c3388c43bbec0a3f24b658e37",
"score": "0.57748044",
"text": "def single_character?(word)\n word.length == 1\n end",
"title": ""
},
{
"docid": "0999990fc7245921031819ff8a502c82",
"score": "0.57672465",
"text": "def convert_mc_case?(word)\n word.length > 2 &&\n word[0] == word[0].upcase &&\n word[1] == word[1].downcase &&\n word[2..-1] == word[2..-1].upcase\n end",
"title": ""
},
{
"docid": "60bff4d06197f1b1b43976aa687f8d2f",
"score": "0.57657254",
"text": "def single_character?(word)\n word.length == 1\n end",
"title": ""
},
{
"docid": "6b83c26471471a10293f5c62aefe9804",
"score": "0.5761889",
"text": "def test_text\n assert(line('Hello World').text?)\n assert(line('Hello World with special characters äöüßÄÖÜ').text?)\n assert(!line('.:!').text?)\n end",
"title": ""
},
{
"docid": "86bdbf3cbf2adf50a729f26a64394a7a",
"score": "0.5759922",
"text": "def seems_quiet?(text)\n # We don't allow all upper case content in english\n not((text =~ /[A-Z]+/) && !(text =~ /[^[:ascii:]]/) && (text == text.upcase))\nend",
"title": ""
},
{
"docid": "86bdbf3cbf2adf50a729f26a64394a7a",
"score": "0.5759922",
"text": "def seems_quiet?(text)\n # We don't allow all upper case content in english\n not((text =~ /[A-Z]+/) && !(text =~ /[^[:ascii:]]/) && (text == text.upcase))\nend",
"title": ""
},
{
"docid": "b40824146c2d45ca3c8cd8333e982111",
"score": "0.5758655",
"text": "def is_unicode?\n options[:unicode]\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "272585c40980ab395f72b97b113f0ef7",
"score": "0.0",
"text": "def set_affected_system_master\n @affected_system_master = AffectedSystemMaster.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.6031952",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6015048",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.5921451",
"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.5914583",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.5914583",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.58983696",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58894575",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58894575",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58894575",
"text": "def actions; end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5888968",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.5877173",
"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.58626074",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.5808828",
"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.57401395",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.5730547",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.5716119",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5702474",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.5692477",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.56679153",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.56518143",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5649757",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.5637324",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5626422",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.56092095",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.55974776",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.55969954",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.5588343",
"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.5559142",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5559142",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.5508525",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.55043614",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.54667777",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.54657924",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.5447067",
"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.5445801",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.54400206",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54159176",
"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.5410683",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5410683",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.54000914",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.53948104",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.53948104",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.5391904",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.53875244",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.5378064",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5356684",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.5348117",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.5347461",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.53465474",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.53433233",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.53411746",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53276825",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53046966",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5284304",
"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.52812636",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.52576077",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.5256278",
"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.5249396",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.5245556",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.52393436",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5237777",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.5237777",
"text": "def action; end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.5232965",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52291924",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.5223852",
"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.52229726",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.5219591",
"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.5214809",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.5212749",
"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.52092797",
"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.5206625",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.52032304",
"text": "def execute_pre_setup_actions(test_instance,runner=nil)\n self.class.pre_setup_actions.each do |action|\n action.call test_instance\n end\n end",
"title": ""
},
{
"docid": "d56f4ec734e3f3bc1ad913b36ff86130",
"score": "0.52030325",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.52029645",
"text": "def perform_setup\n ## Run global setup before example\n Alfred.configuration.setup.each do |setup|\n @request.perform_setup(&setup)\n end\n\n ## Run setup blocks for scenario\n setups.each { |setup| @request.perform_setup(&setup) }\n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5201181",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51956904",
"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.51956904",
"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.51915264",
"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.51790273",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.5177162",
"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.51728606",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51728606",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.51728606",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.51635724",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.515376",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.514297",
"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.5140896",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.513982",
"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.51390326",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.5133155",
"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.51153827",
"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.5113793",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.51105875",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.51092553",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.51092553",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.51092553",
"text": "def action\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.5106791",
"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.51050586",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.5098865",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.50954825",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.50921935",
"text": "def config(action, *args); end",
"title": ""
}
] |
631dd3a8a58da655dc482813e556a35b
|
POST /goals POST /goals.json
|
[
{
"docid": "c16af45e9b9c24a0f9b4532dfba3cfa2",
"score": "0.6585995",
"text": "def create\n # validate that current_user exists\n logger.info current_user.id\n goal = params[:goal]\n goal['owner_id'] = current_user.id\n \n auto_add = params[:goal][:user]\n\n goal.delete('user')\n @goal = Goal.new(goal)\n raise PermissionViolation unless @goal.creatable_by?(current_user)\n\n # Saving auto_add preference\n current_user.update_attributes(auto_add)\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to user_path(current_user), notice: 'Goal was successfully created.' }\n format.json { render json: @goal, status: :created, location: @goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "509107298fad661a8b3789eeec343f58",
"score": "0.7672443",
"text": "def create\n @goal = Goal.new(goal_params)\n current_user.goals << @goal\n\n if @goal.save\n render json: @goal, status: :created\n else\n render json: @goal.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "d73e21b1ce2e73690ab11e2f6deb9673",
"score": "0.7416447",
"text": "def create\n @goal = Goal.create(goal_params)\n render json: @goal\n end",
"title": ""
},
{
"docid": "3ef24da6c550e977c3e5b9dbeffd30ed",
"score": "0.73852706",
"text": "def create\n @goal = Goal.new(goal_params)\n\n if @goal.save\n render json: @goal, status: :created, location: @goal\n else\n render json: @goal.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "625518cb09465018d95b97c4ff03d8ec",
"score": "0.7299192",
"text": "def create\n authorize! :manage_account, current_account\n @goal = current_account.goals.new(goal_params)\n @goal.set_from_form(params)\n add_flash :notice, I18n.t('goals.created') if @goal.save\n respond_with @goal, location: goals_path\n end",
"title": ""
},
{
"docid": "2bd4a3c652fb3c3f8043736c2be6e2d0",
"score": "0.7268453",
"text": "def create\n @goal = current_user.goals.build(goal_params)\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db554495148cb5c8839420b1cdecc175",
"score": "0.72177386",
"text": "def create\n @goal = Goals::Goal.new(goal_params)\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to goal_path(@goal), notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b042a41e6db038ce00d98804f896753a",
"score": "0.72031826",
"text": "def create\n @goal = Goal.new(params[:goal])\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render json: @goal, status: :created, location: @goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a85b43f225172de14aa2f7f92849e8cd",
"score": "0.71830916",
"text": "def create\n # TODO - Make sure there is a user logged in (using a before filter)\n @goal = current_user.goals.new(goal_params)\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to profile_path(@goal.user), notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { redirect_to profile_path(@goal.user), notice: @goal.errors.messages.only(' ') }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4db3d186882a55f89092d82e5b7bcd40",
"score": "0.7182246",
"text": "def create\n @goal = current_member.goals.build(params[:goal])\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to goals_path, notice: 'Goal was successfully created.' }\n format.json { render json: @goal, status: :created, location: @goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ee99886168b35b6fe62d17e8fa22384a",
"score": "0.71564347",
"text": "def create\n @goals = Goals.new(params[:goals])\n\n respond_to do |format|\n if @goals.save\n flash[:notice] = 'Goals was successfully created.'\n format.html { redirect_to(@goals) }\n format.xml { render :xml => @goals, :status => :created, :location => @goals }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @goals.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "253b32d71ec3baa78ce801063dd25293",
"score": "0.71260893",
"text": "def create\n @goal = Goal.new(goal_params)\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "253b32d71ec3baa78ce801063dd25293",
"score": "0.71260893",
"text": "def create\n @goal = Goal.new(goal_params)\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dff921ba1c5dfde6d1d7eee166f82361",
"score": "0.71145284",
"text": "def create\n @goal = Goal.new(goal_params)\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dff921ba1c5dfde6d1d7eee166f82361",
"score": "0.71145284",
"text": "def create\n @goal = Goal.new(goal_params)\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "19774e8cb224e76ad13686652f71f4fb",
"score": "0.71010864",
"text": "def create\n @goal = Goal.new(goal_params)\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to goals_path, notice: 'Goal was successfully created.' }\n format.json { render action: 'show', status: :created, location: @goal }\n else\n format.html { render action: 'new' }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9e4ed0341afa58160cfed3374414de7d",
"score": "0.70931983",
"text": "def create\n goal = current_user.goals.create(goal_params)\n redirect_to goal_path(goal)\n end",
"title": ""
},
{
"docid": "59d22e0478d7747b3ba9105985607c61",
"score": "0.70601577",
"text": "def create\r\n @goal = Goal.new(goal_params)\r\n respond_to do |format|\r\n if @goal.save\r\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\r\n format.json { render :show, status: :created, location: @goal }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @goal.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "5181b79cc0aff5354f553d32d5c2256e",
"score": "0.70249605",
"text": "def create\n @goal = current_user.goals.build(params[:goal])\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to(@goal, :notice => 'Goal was successfully created.') }\n format.xml { render :xml => @goal, :status => :created, :location => @goal }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @goal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1da6814aebe0d41add6ce126c240d0d5",
"score": "0.7006465",
"text": "def create\n @goal = current_user.goals.new(goal_params)\n respond_to do |format|\n if @goal.save\n format.html { redirect_to :goals, \n notice: \"<p>Your goal was successfully created. Go get it!</p>#{view_context.tweet_your_goal_button(@goal)}\" }\n format.json { render action: 'show', status: :created, location: @goal }\n else\n format.html { render action: 'new' }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42cc710c46254bb879ccb06ef2ce8758",
"score": "0.6993854",
"text": "def create\n @goal = Goal.new(params[:goal])\n @goal.user_id = current_user.id\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to :root, notice: 'Goal was successfully created.' }\n format.json { render json: @goal, status: :created, location: @goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e611f93e289c12fb793b2b22e49a78a7",
"score": "0.69871855",
"text": "def create\n @team_goal = TeamGoal.new(team_goal_params)\n\n respond_to do |format|\n if @team_goal.save\n format.html { redirect_to @team_goal, notice: 'Team goal was successfully created.' }\n format.json { render action: 'show', status: :created, location: @team_goal }\n else\n format.html { render action: 'new' }\n format.json { render json: @team_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4d2f0c2c12d2d2c108de1a9eaecba83a",
"score": "0.6905715",
"text": "def create\n @goal = Goal.new(goal_params)\n\n respond_to do |format|\n if @goal.save\n @goal.data_points = DataPoint.generate_data_points_for(@goal)\n @goal.account = current_account\n @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d5fb61cd3a47b947869edde709fefae",
"score": "0.68778294",
"text": "def create\n @goal = current_user.goals.build(params[:goal])\n\tif @goal.save\n\t\t@goal.create_activity :create, owner: current_user\n\t\tflash[:success] = \"Rutina creada!\"\n\t\trespond_to do |format|\n\t\t\tformat.html {redirect_to user_goals_url(@user)}\n\t\t\tformat.js\n\t\tend\n\telse\n\t\tredirect_to @user\n\tend\n end",
"title": ""
},
{
"docid": "8d4a2ce4ab9c4e43642d0fd4f1ee0bc3",
"score": "0.6840543",
"text": "def create\n @goals = Goal.all\n @my_custom_goals = my_custom_goals\n @user_goal = UsersGoal.new(params[:users_goal])\n @user_goal.user = current_user\n\n respond_to do |format|\n if @user_goal.save\n format.html { redirect_to action: 'new', notice: 'Users goal was successfully created.' }\n format.json { render json: @user_goal, status: :created, location: @user_goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c674534f3479b3c78d322b46518afcfa",
"score": "0.68165606",
"text": "def create\n puts \"CREATING GOAL: #{params} \\nGOAL_PARAMS: #{goal_params}\"\n @goal = Goal.new(goal_params)\n ride_id = params[:goal]\n @goal.ride = Ride.find(ride_id[:ride_id])\n @goal.user = User.find(current_user.id)\n\n puts \"Goal: #{@goal} : #{@goal.ride}\"\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal.ride, notice: 'Goal was successfully created.' }\n format.json { render action: 'show', status: :created, location: @goal }\n else\n format.html { render action: 'new' }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0c4fc9c99fff0a86ae029c0e155622bc",
"score": "0.6811943",
"text": "def create\n @goal = Goal.new(params[:goal])\n @goal.assign_to = params[:users][0].to_i\n @goal.user_id=current_user.id\n respond_to do |format|\n if @goal.save\n format.html { redirect_to goals_path, :notice => 'Goal was successfully created.' }\n format.json { render :json => @goal, :status => :created, :location => @goal }\n else\n format.html { render :action => \"index\" }\n format.json { render :json => @goal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7d30f6fb848cdfc4f25e685d0bb24068",
"score": "0.6811702",
"text": "def create\n @activitygoal = Activitygoal.new(params[:activitygoal])\n\n respond_to do |format|\n if @activitygoal.save\n format.html { redirect_to @activitygoal, notice: 'Activitygoal was successfully created.' }\n format.json { render json: @activitygoal, status: :created, location: @activitygoal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @activitygoal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9f766de5660378279c6b89a14c17ab9",
"score": "0.6782093",
"text": "def create\n @goal = Goal.new(goal_params)\n @goal.user_id = current_user.id\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to '/misc_tasks', notice: 'Goal was successfully updated.'}\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c1ab83482959b0a5a2ebb9a33002933",
"score": "0.6779266",
"text": "def create\n @goal = Goal.new(goal_params)\n @goal.user = current_user\n @goal.start_date = params_start_date\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ce22ce680839293efc0e35b760914060",
"score": "0.67692846",
"text": "def create\n @goal = Goal.new params[:goal]\n if @goal.save\n current_user.goals << @goal\n current_user.events << @goal.event\n redirect_to :action => 'show', :id => @goal.id\n else\n flash[:error] = 'There was a problem saving your new goal.'\n flash[:errors] = @goal.errors\n redirect_to :action => \"new\"\n end\n end",
"title": ""
},
{
"docid": "56cc1509c120741de08c18b110d05cd4",
"score": "0.67516327",
"text": "def create\n @goal = current_user.goals.build(goal_params)\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Цель создана, успехов.' }\n else\n format.html { render :new }\n end\n end\n end",
"title": ""
},
{
"docid": "3b1c7f4a70205f2a8ec498286f102540",
"score": "0.6748759",
"text": "def create\n @goal = Goal.new(params[:goal])\n\n respond_to do |format|\n if @goal.save\n flash[:notice] = 'Goal was successfully created.'\n format.html { redirect_to :action => \"index\" }\n format.xml { render :xml => @goal, :status => :created, :location => @goal }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @goal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a000c458a5aa3cc2452c330556fcc11",
"score": "0.67380303",
"text": "def create\n @goal = Goal.new(goal_params)\n # eventually use 'current_user'\n @goal.user = current_user\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "43b1760957ed0bf6c7e48ba7f217a3ae",
"score": "0.6737834",
"text": "def create\n @user_goal = UserGoal.new(user_goal_params)\n\n respond_to do |format|\n if @user_goal.save\n format.html { redirect_to @user_goal, notice: 'User goal was successfully created.' }\n format.json { render :show, status: :created, location: @user_goal }\n else\n format.html { render :new }\n format.json { render json: @user_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f00ae4266a9a3f58815f0b1fc73f7070",
"score": "0.67215097",
"text": "def index\n @goals = Goal.all\n render json: @goals\n end",
"title": ""
},
{
"docid": "1c9e253ce00be8064d6724d53467aab4",
"score": "0.66849643",
"text": "def create\n\n @goal = Goal.new(goal_params)\n @goal.user_id = session['user_id'].to_i\n\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to new_goal_path, notice: 'Goal was successfully created.' }\n format.json { render action: 'show', status: :created, location: @goal }\n else\n format.html { render action: 'new' }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1cab6b06b62dbd78d8bc57c282ccdea1",
"score": "0.6681741",
"text": "def new_goals\n # render json: Goal.group_by_day(:created_at).count\n # render json: Goal.where(user_id: :user_id, trip_id: :trip_id)\n end",
"title": ""
},
{
"docid": "c8f1fdbb7b977a05f1290310d9b87004",
"score": "0.6662067",
"text": "def index\n goals = Goal.all\n \n render :json => goals.as_json, :status => 201\n end",
"title": ""
},
{
"docid": "96c9742535df9edac4ad5b60bd36fc86",
"score": "0.666034",
"text": "def create\n @goal = Goal.new(goal_params.merge(user_id: current_user.id))\n\n respond_to do |format|\n if @goal.save\n format.html { redirect_to goals_url, notice: I18n.t(:new, scope: [:generic, :confirmation]) }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0586c24f54c8e0c59bd3ce7329f25fcd",
"score": "0.66593367",
"text": "def create\n @challenge_goal = ChallengeGoal.new(challenge_goal_params)\n\n if @challenge_goal.save\n @challenge_goal.cg_create_log_scores\n render json: {challenge_goal: @challenge_goal, main_state: main_state}, status: :created, location: api_challenge_goal_url(@challenge_goal)\n else\n render json: {error: @challenge_goal.errors.full_messages}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "0f8c993a5b40233913550916ed53bb70",
"score": "0.6634495",
"text": "def create\n @goal = Goal.new(params[:goal])\n\n respond_to do |format|\n if @goal.save\n \n project = Project.find(@goal.project_id.to_i)\n project_to_load = project\n x = project_to_load.goals.length\n # binding.pry\n goals = x \n project_to_load.update_attributes(no_of_goals: goals)\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render json: @goal, status: :created, location: @goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2de2a8ceaf3c3a927276eb8d6ae88d2b",
"score": "0.661784",
"text": "def create\n @project_goal = ProjectGoal.new(project_goal_params)\n\n respond_to do |format|\n if @project_goal.save\n format.html { redirect_to @project_goal, notice: 'Project goal was successfully created.' }\n format.json { render action: 'show', status: :created, location: @project_goal }\n else\n format.html { render action: 'new' }\n format.json { render json: @project_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "15e2af04d04f5d8f3a98327be140d7b3",
"score": "0.6615838",
"text": "def create\n @goal = Goal.new\n @goal.name = goal_params['goal_name']\n @goal.target = goal_params['goal_target']\n @goal.keywords = goal_params['keywords']\n\n @goal_owner = GoalOwner.new\n if goal_params['target'] == 'group_goal'\n @goal_owner.group = Group.find(goal_params['group_id'])\n else\n @goal_owner.user = User.find(goal_params['user_id'])\n end\n @goal_owner.goal = @goal\n\n respond_to do |format|\n if @goal_owner.save && @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "de74e25a31dcc4628b9e7b58cd1c0adc",
"score": "0.6588455",
"text": "def index\n\t\t@goals = current_user.goal\n\t\trender json: @goals, status: 200 \n\tend",
"title": ""
},
{
"docid": "7b0fcc35828aec1ec0140007168c78b1",
"score": "0.6582886",
"text": "def index\n @goals = Goal.all \n render json: @goals\n end",
"title": ""
},
{
"docid": "34737ce276b160c13b97aa7e3532d7f4",
"score": "0.65733063",
"text": "def create\n puts goal_params\n m, u = params[:measurement].split(' ')\n @activity = Activity.find_or_create_by(description: params[:activity])\n @timeframe = Timeframe.find_or_create_by(description: params[:timeframe])\n @unit = Unit.find_or_create_by(description: u)\n @goal = Goal.new(activity: @activity, timeframe: @timeframe, unit: @unit, measurement: m)\n \n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render status: :created, json: @goal.as_json }\n else\n format.html { render action: 'new' }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c41ea0752702b0bbe1465226e925593",
"score": "0.6545861",
"text": "def create\n @goal = Goal.new(params[:goal])\n @user = User.find(session[:uid])\n @goal.user = @user #This associates the current user with their new goal. \n #After the goal is saved, the User ID is placed in the Goal Table's User ID column. \n respond_to do |format|\n if @goal.save\n format.html { redirect_to welcome_home_path, notice: 'Goal was successfully created.' }\n format.json { render json: @goal, status: :created, location: @goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8ec13d314c77cb579e11e1d6f07eb621",
"score": "0.65399873",
"text": "def create\n respond_to do |format|\n if @goal.save\n format.html { redirect_to(@goal.goal_id.nil?? goals_url : goal_url(:id => @goal.goal_id), :notice => t('goals.create.success')) }\n format.xml { render :xml => @goal, :status => :created, :location => @goal }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @goal.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "212f5d6bd29de3358f848f5cc43e2fb3",
"score": "0.6539595",
"text": "def create\n @goal = current_usesr.goals.new(goal_params)\n\n if @goal.save\n @status = true\n else\n @status = false\n end\n end",
"title": ""
},
{
"docid": "b48b6aed041786fc9a04f49db582d1b6",
"score": "0.65363365",
"text": "def create\n @list = List.find(params[:list_id])\n @goal = @list.goals.build(params[:goal])\n \n respond_to do |format|\n if @goal.save\n format.html { redirect_to list_goals_path(@list), notice: 'goal item was successfully created.' }\n format.json { render json: @list, status: :created, location: @list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "086ee8beb03477110291901bbf4b9669",
"score": "0.6527397",
"text": "def goal_params\n params.require(:goal).permit(:name, :average_score, :deadline, :test_done)\n end",
"title": ""
},
{
"docid": "8dafdfd109530c5618e77d8b188fb052",
"score": "0.6524644",
"text": "def create\n @field_goal = FieldGoal.new(params[:field_goal])\n\n respond_to do |format|\n if @field_goal.save\n format.html { redirect_to @field_goal, notice: 'Field goal was successfully created.' }\n format.json { render json: @field_goal, status: :created, location: @field_goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @field_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4b128662f6a199265f169c34ff88ca8a",
"score": "0.6511844",
"text": "def goal_params\n p = JSON.parse(request.raw_post)\n params[:goal] = p\n params.require(:goal).permit([:hole, :period, :goalie_id, :game_id])\n end",
"title": ""
},
{
"docid": "603265cceb76f3e1f8afdaf8e3f3304a",
"score": "0.650385",
"text": "def goals_post_with_http_info(goal_type, expected_type, period, expected, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GoalsApi.goals_post ...\"\n end\n # verify the required parameter 'goal_type' is set\n if @api_client.config.client_side_validation && goal_type.nil?\n fail ArgumentError, \"Missing the required parameter 'goal_type' when calling GoalsApi.goals_post\"\n end\n # verify the required parameter 'expected_type' is set\n if @api_client.config.client_side_validation && expected_type.nil?\n fail ArgumentError, \"Missing the required parameter 'expected_type' when calling GoalsApi.goals_post\"\n end\n # verify the required parameter 'period' is set\n if @api_client.config.client_side_validation && period.nil?\n fail ArgumentError, \"Missing the required parameter 'period' when calling GoalsApi.goals_post\"\n end\n # verify the required parameter 'expected' is set\n if @api_client.config.client_side_validation && expected.nil?\n fail ArgumentError, \"Missing the required parameter 'expected' when calling GoalsApi.goals_post\"\n end\n # resource path\n local_var_path = \"/goals\"\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # form parameters\n form_params = {}\n form_params[\"goal_type\"] = goal_type\n form_params[\"expected_type\"] = expected_type\n form_params[\"period\"] = period\n form_params[\"expected\"] = expected\n form_params[\"user_id\"] = opts[:'user_id'] if !opts[:'user_id'].nil?\n form_params[\"stage_id\"] = opts[:'stage_id'] if !opts[:'stage_id'].nil?\n form_params[\"currency\"] = opts[:'currency'] if !opts[:'currency'].nil?\n form_params[\"pipeline_id\"] = opts[:'pipeline_id'] if !opts[:'pipeline_id'].nil?\n\n # http body (model)\n post_body = nil\n auth_names = [ 'access_token' ]\n response = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GoalsApi#goals_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return response\n end",
"title": ""
},
{
"docid": "51ef8c3ac21087281b2d48cc87076ac7",
"score": "0.6490022",
"text": "def create\n @health_goal = HealthGoal.new(health_goal_params)\n\n respond_to do |format|\n if @health_goal.save\n format.html { redirect_to @health_goal, notice: 'Health goal was successfully created.' }\n format.json { render :show, status: :created, location: @health_goal }\n else\n format.html { render :new }\n format.json { render json: @health_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9c1cc361d468d8851807eec2bc5f7312",
"score": "0.6467734",
"text": "def goal_params\n params.require(:goal).permit(:goal, :deadline, :user_id)\n end",
"title": ""
},
{
"docid": "b67a27e58a3895b5bd5a82000ba3f9d2",
"score": "0.6466512",
"text": "def create\n @mgoal = Mgoal.new(params[:mgoal])\n\n respond_to do |format|\n if @mgoal.save\n format.html { redirect_to @mgoal, notice: 'Mgoal was successfully created.' }\n format.json { render json: @mgoal, status: :created, location: @mgoal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @mgoal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4df3147de08534aa331bfed4e9c39c27",
"score": "0.64555216",
"text": "def create\n #@goal = Goal.create(goal_params)\n @goal = current_user.goals.build(goal_params)\n\n respond_to do |format|\n if @goal.save\n #目標をを作成すると同時に自身も参加する\n current_user.follows.create(\n goal_id: @goal.id,\n is_owner: true\n )\n\n format.html { redirect_to @goal, notice: \"目標が作成されました。\" }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "84d86ae6577fd02c2506df5e11d9a0d9",
"score": "0.64342237",
"text": "def food_goals\n get(\"user/#{user_id}/foods/log/goal.json\")\n end",
"title": ""
},
{
"docid": "f496bb58c54b441335caede32cdacfbc",
"score": "0.6433813",
"text": "def index\n @my_goals = my_goals\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @users_goals }\n end\n end",
"title": ""
},
{
"docid": "2423567b23ffa616ceafba5be4dff06a",
"score": "0.64325583",
"text": "def create\n @page_goal = PageGoal.new(page_goal_params)\n\n respond_to do |format|\n if @page_goal.save\n format.html { redirect_to @page_goal, notice: 'Page goal was successfully created.' }\n format.json { render action: 'show', status: :created, location: @page_goal }\n else\n format.html { render action: 'new' }\n format.json { render json: @page_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d4b980282fa119b4364eb69d7d207cb4",
"score": "0.6429453",
"text": "def create\n @life_goal = LifeGoal.new(params[:life_goal])\n \n respond_to do |format|\n if @life_goal.save\n format.html { redirect_to_index_or_todo_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @life_goal.errors, :status => :unprocessable_entity }\n end\n end \n end",
"title": ""
},
{
"docid": "1c5b09fcf91d543aa13d83244120cb0b",
"score": "0.6428524",
"text": "def goal_params\n params.require(:goal).permit(:title, :description, :completed)\n end",
"title": ""
},
{
"docid": "c85a8832a8bb4cf1450891f0a9bef508",
"score": "0.64279824",
"text": "def create\n @goal = Goal.new(goal_params)\n authorize @goal\n\n if @goal.save\n redirect_to goal_path(@goal), notice: 'Goal was created successfully.'\n else\n render 'new'\n end\n end",
"title": ""
},
{
"docid": "b2eb6f8c6d9c1434a132a1579f30bc4f",
"score": "0.6427941",
"text": "def create\n @budget_goal = BudgetGoal.new(budget_goal_params)\n @budget_goal.user_id = current_user.id\n\n respond_to do |format|\n if @budget_goal.save\n format.html { redirect_to @budget_goal, notice: 'Budget goal was successfully created.' }\n format.json { render :show, status: :created, location: @budget_goal }\n else\n format.html { render :new }\n format.json { render json: @budget_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c1e1d9359f900dd8a8e0d14ecab5bc32",
"score": "0.64261633",
"text": "def create\n @goal = Goal.new(goal_params)\n\n if @goal.save\n # prepare translation into minutes \n time_allotted_units = params[:time_allotted_units]\n time_allotted = params[:goal][:time_allotted]\n goal_id = @goal.id\n calculate_minutes_texts(time_allotted, time_allotted_units, goal_id)\n # prepare Twilio data for sending initial text\n goal_title = @goal.goal_title\n goal_user_id = @goal.user_id\n member = User.find_by(id: goal_user_id)\n phone_number = member.phone_number.floor\n trigger_initial_message(goal_title, phone_number)\n # regular business\n redirect_to @goal \n flash[:alert] = \"Congrats,\"\n flash[:notice] = \"you've added your goal\"\n else\n redirect_to \"/goals/new\" \n end\n end",
"title": ""
},
{
"docid": "8d3b1bd1d87fa1d9a495bdd01326f331",
"score": "0.6424542",
"text": "def goal_params\n params.require(:goal).permit(:title, :completed_at, :description)\n end",
"title": ""
},
{
"docid": "8572cb4c10eaa942f8d3093fca1bed2e",
"score": "0.6410267",
"text": "def goal_params\n params.require(:goal).permit(:life_id, :create_goal, :start_date, :end_date, :achieved, :note_goal)\n end",
"title": ""
},
{
"docid": "d8db2296f496b97004c4630651147d18",
"score": "0.6409891",
"text": "def goal_params\n params.require(:goals_goal).permit(:title, :subtitle, :description, :deadline, :current_amount, :goal_amount)\n end",
"title": ""
},
{
"docid": "30d463363f82a7e9d6df5bd42ea12fdb",
"score": "0.6397439",
"text": "def index\n @goals = Goal.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @goals }\n end\n end",
"title": ""
},
{
"docid": "5878b0da2e88406caa581280922d621f",
"score": "0.63970304",
"text": "def goal_params\n params.require(:goal).permit :name, :completion_date, :amount, :user_id\n end",
"title": ""
},
{
"docid": "108665f751c59c222fb26163e7105fbb",
"score": "0.6393244",
"text": "def create\n @player_goal = PlayerGoal.new(player_goal_params)\n\n respond_to do |format|\n if @player_goal.save\n format.html { redirect_to @player_goal, notice: 'Player goal was successfully created.' }\n format.json { render :show, status: :created, location: @player_goal }\n else\n format.html { render :new }\n format.json { render json: @player_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f57fa1ecec37cdff33cb4aeb7489c03d",
"score": "0.63870186",
"text": "def create\n @daily_goal = DailyGoal.new(daily_goal_params.merge(user_id: current_user.id))\n respond_to do |format|\n if @daily_goal.save\n format.html { redirect_to new_daily_goal_path(daily_goal_params[:goal_id]), notice: I18n.t(:new, scope: [:generic, :confirmation]) }\n format.json { render :show, status: :created, location: @daily_goal }\n else\n format.html { render :new }\n format.json { render json: @daily_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6396eb61c6ba59b8e288f392b26cc0f9",
"score": "0.6373848",
"text": "def create\n @goal = Goal.new(goal_params)\n @goal.user_id = current_user.id\n c_goal = Goal.all.where(user_id: current_user.id, current_goal: true)\n c_goal.each do |c|\n c.current_goal = false\n c.save\n end\n @goal.current_goal = true\n respond_to do |format|\n if @goal.save\n format.html { redirect_to @goal, notice: 'Goal was successfully created.' }\n format.json { render :show, status: :created, location: @goal }\n else\n format.html { render :new }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aec43e2b3852a7bec45b64d7f6e79b01",
"score": "0.6363619",
"text": "def goal_params\r\n params.require(:goal).permit(:goal, :deadline, :user_id, :title, :private)\r\n end",
"title": ""
},
{
"docid": "39213fa034a09991b0cc5d6ac7c4f3f7",
"score": "0.6352054",
"text": "def goals\n @submission = Submission.find(params[:id])\n if current_user.id == @submission.user.id\n \n else\n @submission.goals += 1\n end\n @submission.save\n session[:goals] << @submission.id.to_s\n respond_to do |format|\n format.js\n format.html { redirect_to '/submissions'}\n format.json { render json: @submissions }\n end\n end",
"title": ""
},
{
"docid": "90024d719dedac4a95a70fc1510dcb6e",
"score": "0.6343342",
"text": "def create\n @nvs_goal = NvsGoal.new(params[:nvs_goal])\n @nvs_goal.project_id = @project\n @nvs_goal.created_by = User.current\n\n respond_to do |format|\n if @nvs_goal.save\n format.html { redirect_to @nvs_goal, notice: 'Nvs goal was successfully created.' }\n format.json { render json: @nvs_goal, status: :created, location: @nvs_goal }\n else\n @nvs_goal_types = NvsGoalType.all.map{|x| [x.name, x.id]}\n format.html { render action: \"new\" }\n format.json { render json: @nvs_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6fbce02c7faec2c3c6a385b206917c6",
"score": "0.63377565",
"text": "def create\n @reached_goal_int = ReachedGoalInt.new(reached_goal_int_params)\n\n respond_to do |format|\n if @reached_goal_int.save\n format.html { redirect_to @reached_goal_int, notice: 'Reached goal int was successfully created.' }\n format.json { render :show, status: :created, location: @reached_goal_int }\n else\n format.html { render :new }\n format.json { render json: @reached_goal_int.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ca15afebc87c5619535c0d845bc1c3a2",
"score": "0.633035",
"text": "def index\n @user = User.find_by(id: params[:user_id])\n @goals = @user.goals\n end",
"title": ""
},
{
"docid": "be0e0b1ae86832b94d244ee1163c8812",
"score": "0.6306787",
"text": "def create\n @goalie = Goalie.new(goaly_params)\n\n respond_to do |format|\n if @goalie.save\n format.html { redirect_to @goalie, notice: 'Goalie was successfully created.' }\n format.json { render :show, status: :created, location: @goalie }\n else\n format.html { render :new }\n format.json { render json: @goalie.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b87155c3e86075b002ca40beb2ec1676",
"score": "0.63033694",
"text": "def create\n @goal = Goal.new(goal_params)\n @goal.user_id = current_user.id\n # debugger\n if @goal.save\n redirect_to goal_url(@goal)\n else\n flash[:errors] = @goal.errors.full_messages\n render :new\n end\n end",
"title": ""
},
{
"docid": "b6ac573a6b364bfddf6710700982d933",
"score": "0.63005847",
"text": "def goal_params\n params.require(:goal).permit(:title, :amount, :description, :amount_paid, :paid)\n end",
"title": ""
},
{
"docid": "d8549aef1f8bb739c9e45395b75f671b",
"score": "0.628837",
"text": "def create\n @development_goal = DevelopmentGoal.new(development_goal_params)\n\n respond_to do |format|\n if @development_goal.save\n format.html { redirect_to @development_goal, notice: 'Development goal was successfully created.' }\n format.json { render :show, status: :created, location: @development_goal }\n else\n format.html { render :new }\n format.json { render json: @development_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "20ffde50f18891f6ce2eac38ccd2d67c",
"score": "0.6284514",
"text": "def add_specific_goal\n\t\temp = getMyEnterpriseAPP\n\t\tdescription = params[:description]\n\t\tpadre = Goal.find(params[:id_padre].to_i)\n\t\tgoal = Goal.new\n\t\tgoal.description = description\n\t\tgoal.goal_type = SPECIFIC_TYPE\n\t\tgoal.scope = padre.scope\n\t\tgoal.dimension = padre.dimension\n\t\tgoal.parent_id = padre.id\n\t\tgoal.enterprise_id = emp.id\n\n\t\trespond_to do |format|\n \tif goal.save # OK\n \t\tformat.json {render json: goal}\n \telse # ERROR\n \t\t\tformat.json {render json: \"ERROR\"}\n \t\tend\n \tend\t\n\n\tend",
"title": ""
},
{
"docid": "04ddc9bca51e766c4ead29bdb953861c",
"score": "0.62780756",
"text": "def new\n @goal = Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end",
"title": ""
},
{
"docid": "04ddc9bca51e766c4ead29bdb953861c",
"score": "0.62780756",
"text": "def new\n @goal = Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end",
"title": ""
},
{
"docid": "04ddc9bca51e766c4ead29bdb953861c",
"score": "0.62780756",
"text": "def new\n @goal = Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end",
"title": ""
},
{
"docid": "04ddc9bca51e766c4ead29bdb953861c",
"score": "0.62780756",
"text": "def new\n @goal = Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end",
"title": ""
},
{
"docid": "04ddc9bca51e766c4ead29bdb953861c",
"score": "0.62780756",
"text": "def new\n @goal = Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end",
"title": ""
},
{
"docid": "04ddc9bca51e766c4ead29bdb953861c",
"score": "0.62780756",
"text": "def new\n @goal = Goal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @goal }\n end\n end",
"title": ""
},
{
"docid": "bed96bf7ff06de052e73cb3e23fc8567",
"score": "0.62752455",
"text": "def goal_params\n params.require(:goal).permit(:name, :info, :date, :time, :completed, :imageurl, :user_id, :tag_id)\n end",
"title": ""
},
{
"docid": "0f44f0b78505048250b6081e54a9f87f",
"score": "0.62743074",
"text": "def create\n @energy_goal = EnergyGoal.new(params[:energy_goal])\n\n respond_to do |format|\n if @energy_goal.save\n format.html { redirect_to welcome_index_url, notice: 'Energieeffizienzziel erfolgreich angelegt.' }\n format.json { render json: @energy_goal, status: :created, location: @energy_goal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @energy_goal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3e0fdd06f907ab5100be2c700f84e236",
"score": "0.62647295",
"text": "def goals_post(goal_type, expected_type, period, expected, opts = {})\n goals_post_with_http_info(goal_type, expected_type, period, expected, opts)\n end",
"title": ""
},
{
"docid": "6b19565cf455cdb7163cb7ef2f688566",
"score": "0.6253491",
"text": "def index\n @goals = Goal.all\n end",
"title": ""
},
{
"docid": "6b19565cf455cdb7163cb7ef2f688566",
"score": "0.6253491",
"text": "def index\n @goals = Goal.all\n end",
"title": ""
},
{
"docid": "6b19565cf455cdb7163cb7ef2f688566",
"score": "0.6253491",
"text": "def index\n @goals = Goal.all\n end",
"title": ""
},
{
"docid": "6b19565cf455cdb7163cb7ef2f688566",
"score": "0.6253491",
"text": "def index\n @goals = Goal.all\n end",
"title": ""
},
{
"docid": "6b19565cf455cdb7163cb7ef2f688566",
"score": "0.6253491",
"text": "def index\n @goals = Goal.all\n end",
"title": ""
},
{
"docid": "6b19565cf455cdb7163cb7ef2f688566",
"score": "0.6253491",
"text": "def index\n @goals = Goal.all\n end",
"title": ""
},
{
"docid": "e7c1d8e42efd2ca03e5c515565a5aa6c",
"score": "0.62507117",
"text": "def goal_params\n params.require(:goal).permit(:user_id, :aim)\n end",
"title": ""
}
] |
fd6290f8c16e9d29060cc48339fadb2e
|
delayed_job hands us this message after max_attempts are exhausted
|
[
{
"docid": "fd49c4980222874614ab8b920794184a",
"score": "0.0",
"text": "def failure\n orchestration = Orchestration.find(self.orchestration_id)\n orchestration.message_delivery_failed\n end",
"title": ""
}
] |
[
{
"docid": "48e4609258376ed91f529ba075091850",
"score": "0.810124",
"text": "def max_attempts\n # don't try this job again if it fails. We'll let the client side trigger it again manually\n 1\n end",
"title": ""
},
{
"docid": "d412354d9d0934cd4dedd9ca00db55d8",
"score": "0.74316573",
"text": "def queue_wait_attempts\n\t\t200\n\tend",
"title": ""
},
{
"docid": "aae8eff3bb197645ebc997cef6ceee9a",
"score": "0.7371867",
"text": "def max_attempts\n 1\n end",
"title": ""
},
{
"docid": "aae8eff3bb197645ebc997cef6ceee9a",
"score": "0.7371867",
"text": "def max_attempts\n 1\n end",
"title": ""
},
{
"docid": "aae8eff3bb197645ebc997cef6ceee9a",
"score": "0.7371867",
"text": "def max_attempts\n 1\n end",
"title": ""
},
{
"docid": "aae8eff3bb197645ebc997cef6ceee9a",
"score": "0.7371867",
"text": "def max_attempts\n 1\n end",
"title": ""
},
{
"docid": "aae8eff3bb197645ebc997cef6ceee9a",
"score": "0.7371867",
"text": "def max_attempts\n 1\n end",
"title": ""
},
{
"docid": "aae8eff3bb197645ebc997cef6ceee9a",
"score": "0.7371867",
"text": "def max_attempts\n 1\n end",
"title": ""
},
{
"docid": "aae8eff3bb197645ebc997cef6ceee9a",
"score": "0.7371867",
"text": "def max_attempts\n 1\n end",
"title": ""
},
{
"docid": "aae8eff3bb197645ebc997cef6ceee9a",
"score": "0.7371867",
"text": "def max_attempts\n 1\n end",
"title": ""
},
{
"docid": "aae8eff3bb197645ebc997cef6ceee9a",
"score": "0.7371867",
"text": "def max_attempts\n 1\n end",
"title": ""
},
{
"docid": "aae8eff3bb197645ebc997cef6ceee9a",
"score": "0.7371867",
"text": "def max_attempts\n 1\n end",
"title": ""
},
{
"docid": "aae8eff3bb197645ebc997cef6ceee9a",
"score": "0.7371867",
"text": "def max_attempts\n 1\n end",
"title": ""
},
{
"docid": "4e52f20760ae28ee07e04322785b60b8",
"score": "0.73104405",
"text": "def max_attempts\n 1\n end",
"title": ""
},
{
"docid": "4e52f20760ae28ee07e04322785b60b8",
"score": "0.73104405",
"text": "def max_attempts\n 1\n end",
"title": ""
},
{
"docid": "4e52f20760ae28ee07e04322785b60b8",
"score": "0.73104405",
"text": "def max_attempts\n 1\n end",
"title": ""
},
{
"docid": "17cd498b49803fb67bc5dbc36e973a6d",
"score": "0.7189889",
"text": "def send_maximum_retry\n super\n end",
"title": ""
},
{
"docid": "43495a0d82d3739a56656c8ba41e6ae1",
"score": "0.6925126",
"text": "def num_retries; end",
"title": ""
},
{
"docid": "c8f3e1dac13ecd464eeff86e7d63d52f",
"score": "0.69228256",
"text": "def waiting_for_retry?; end",
"title": ""
},
{
"docid": "7427e1cbb15114a582ca459078886393",
"score": "0.6888036",
"text": "def max_attempts\n\t\t3\n\tend",
"title": ""
},
{
"docid": "ec84cdbcf753d66cb7861199b9aaa64d",
"score": "0.68764037",
"text": "def retry_attempts\n 3\n end",
"title": ""
},
{
"docid": "1ba8c188f3990fdd9c79594029328395",
"score": "0.6814154",
"text": "def retries; end",
"title": ""
},
{
"docid": "ab5a448d73eab1da7df2140dad13f836",
"score": "0.67890954",
"text": "def wait_for_retry; end",
"title": ""
},
{
"docid": "1d68b7a5246fd763ceffbceb8eaaf674",
"score": "0.67526156",
"text": "def max_retry_interval; end",
"title": ""
},
{
"docid": "e414bc6b371202ea398da559f2c3017d",
"score": "0.6714668",
"text": "def failed\n @attempts += 1\n end",
"title": ""
},
{
"docid": "184dca814439517d8d9feb7463b01d7e",
"score": "0.665649",
"text": "def retry_failed\n raise MaxAttemptError if @attempts[:total] >= @max_attempts\n @logger.warn \"Retrying #{operation} - #{@attempts[:total]} of #{@max_attempts}\"\n\n drop_successfully_updated_data\n\n execute\n end",
"title": ""
},
{
"docid": "b6b38ebe79059a0b2b52e4bcb34333a9",
"score": "0.66258806",
"text": "def retry_limit_for_failed_hooks\n 3\n end",
"title": ""
},
{
"docid": "b6b38ebe79059a0b2b52e4bcb34333a9",
"score": "0.66258806",
"text": "def retry_limit_for_failed_hooks\n 3\n end",
"title": ""
},
{
"docid": "0b1dc3b73dfdcb9e0f3ca2864cd3d566",
"score": "0.6612927",
"text": "def on_retry; end",
"title": ""
},
{
"docid": "f375233af9b3894e6460b29398a57079",
"score": "0.6599404",
"text": "def num_retries\n 1\n end",
"title": ""
},
{
"docid": "d141ec165eaabb2bf2de5e7952bb83fe",
"score": "0.65392226",
"text": "def process\n process_now if self.attempts == 0 # do it as soon as possible\n process_delayed((2**self.attempts).seconds) if self.attempts > 0 # delay...\n end",
"title": ""
},
{
"docid": "78d6d319482b2741f30d94db8ead171a",
"score": "0.6535129",
"text": "def attempts; @attempts || 1; end",
"title": ""
},
{
"docid": "78d6d319482b2741f30d94db8ead171a",
"score": "0.6535129",
"text": "def attempts; @attempts || 1; end",
"title": ""
},
{
"docid": "911c892274497c39ba6956efb8d4add3",
"score": "0.6524018",
"text": "def set_send_maximum_retry(opts)\n opts = check_params(opts,[:retries])\n super(opts)\n end",
"title": ""
},
{
"docid": "e6d669c2b2241a4855a6b832f5af2815",
"score": "0.6516566",
"text": "def retry\n failed\n queue.push self\n end",
"title": ""
},
{
"docid": "349ca3e540ec854f6f90650588b8ff65",
"score": "0.6480663",
"text": "def retry\n reque_single_job(params[:id])\n redirect_to failures_path(redirect_params)\n end",
"title": ""
},
{
"docid": "1b53392188f53de80766782ed13a0584",
"score": "0.6462419",
"text": "def delayed_job_attempts\n dj = self.delayed_job_id\n taskdj = Delayed::Job.find_by(:id => dj)\n if taskdj.attempts > 0\n return true\n end\n end",
"title": ""
},
{
"docid": "94494a6f007eea100cdc8c54ea6df380",
"score": "0.64336056",
"text": "def max_retry_delay\n @max_retry_delay ||= DEFAULT_MAX_RETRY_DELAY\n end",
"title": ""
},
{
"docid": "346a80f88d88586eed6b0db38e0af087",
"score": "0.64182746",
"text": "def max_retry_count\n\t\t2\n\tend",
"title": ""
},
{
"docid": "0653945b75f2d5c7ff6cd0e9d7e4c25d",
"score": "0.64124596",
"text": "def retry_interval; end",
"title": ""
},
{
"docid": "0653945b75f2d5c7ff6cd0e9d7e4c25d",
"score": "0.64124596",
"text": "def retry_interval; end",
"title": ""
},
{
"docid": "7c021f50ee98485d6120038a4b251ad5",
"score": "0.63925624",
"text": "def retry\n Resque::Failure.requeue(params[:id])\n redirect_to failures_path(redirect_params)\n end",
"title": ""
},
{
"docid": "8b4cf0a06f28ee9afbdde3f96860f425",
"score": "0.6369751",
"text": "def retry_count; end",
"title": ""
},
{
"docid": "015286c6caa131958efce461de13d763",
"score": "0.63596237",
"text": "def reset_delayed_jobs\n delayed_jobs.select {|j| j.attempts > 0 }.each do |job|\n job.attempts = job.attempts - 1\n job.run_at = Time.zone.now\n job.locked_at = nil\n job.locked_by = nil\n job.last_error = \"\"\n job.save!\n end\n end",
"title": ""
},
{
"docid": "38905740d2ed825881142b7adb5e3012",
"score": "0.6350043",
"text": "def increment_execution_attempts!\n @store.incr(msg_id, :attempts)\n end",
"title": ""
},
{
"docid": "d2239ebca7a4f6515f150f4068ff5a72",
"score": "0.63268524",
"text": "def process\n\t\tworker = self.class.worker\n\n\t\t# do it as soon as possible\n\t\tworker.perform_async(self.class.name, self.id) if self.attempts == 0\n\n\t\t# delay...\n\t\tworker.perform_in((2**self.attempts).seconds, self.class.name, self.id) if self.attempts > 0\n\tend",
"title": ""
},
{
"docid": "3b6eefc4d5f28060655e88d2aafff124",
"score": "0.63148093",
"text": "def queue_max_job_retries(delay=nil)\n if delay\n @queue_max_job_retries = delay\n else # accessor\n @queue_max_job_retries\n end\n end",
"title": ""
},
{
"docid": "f5e499d6e9c47d5c214a94e23fba33d6",
"score": "0.6300516",
"text": "def run!\n if(dead)\n raise RuntimeError,\n \"Action has already reached maximum allowed attempts (#{max_attempts})!\"\n else\n begin\n log_attempt!\n action.call\n rescue => e\n if(block_given?)\n raise unless yield(e)\n end\n if(max_attempts.nil? || attempts < max_attempts)\n interval = wait_on_failure(e)\n if(ui)\n if(max_attempts)\n attempt_info = \"[Attempt #{attempts}/#{max_attempts}]\"\n end\n ui.warn \"#{description} failed (#{e.class}: #{e}) - Retry in #{interval.to_i} seconds #{attempt_info}\"\n end\n sleep(interval)\n retry\n else\n if(ui && max_attempts.to_i > 0)\n ui.error \"#{description} failed (#{e.class}: #{e}) - Maximum number of attempts reached!\"\n end\n @dead = true\n raise e\n end\n end\n end\n end",
"title": ""
},
{
"docid": "f0ad8836397a446f6772fdf0208d624e",
"score": "0.62963724",
"text": "def max_retries\n options[:max_retries]\n end",
"title": ""
},
{
"docid": "b6bbda37814fe6ae89de9179618d901f",
"score": "0.6295717",
"text": "def on_retryable_exception(error)\n log_error(error)\n if executions < 5\n retry_job wait: 10.seconds\n end\n end",
"title": ""
},
{
"docid": "06a66b7e05d8bfd698f2dc815de69792",
"score": "0.62754077",
"text": "def attempts_exceeded?\n self.failed_attempts >= self.class.maximum_attempts\n end",
"title": ""
},
{
"docid": "553147d71825e78231156b6fc3eeba66",
"score": "0.62634677",
"text": "def retry_back_off\n @current_failure_count ** 2\n end",
"title": ""
},
{
"docid": "b8b042d0b5bc226f6afb6b87555cef92",
"score": "0.6262924",
"text": "def kick_out_after_too_many_retries_for!(action)\n# @retries[action] ||= 0\n# invalid_choice if @retries[action] > 2\n# @retries[action] += 1\n# log(\"=========================== Count for action '#{action}': #{@retries[action]}\") if DEBUG \n end",
"title": ""
},
{
"docid": "130d3c9070a8c36d8e4c7c79ea51a2f0",
"score": "0.62624824",
"text": "def min_retry_interval; end",
"title": ""
},
{
"docid": "12668bad96bc63408191666ae3b3f152",
"score": "0.62386316",
"text": "def perform(&block)\n response = nil\n tries = 0\n while response.blank?\n break if tries > @options[:max_retries]\n response = block.call\n tries += 1\n sleep @options[:sleep]\n end\n response\n end",
"title": ""
},
{
"docid": "c29423692a9cd8c4c95a9b7c9a2c5fbc",
"score": "0.6237496",
"text": "def job_must_die?\n job_retries >= job_max_retries\n end",
"title": ""
},
{
"docid": "ea2ed36d7f5affbd9b95eb9bb8242c98",
"score": "0.6234594",
"text": "def fail(attempts, error)\n if attempts > @retries\n raise error\n end\n end",
"title": ""
},
{
"docid": "5a5dd8211290860a90b146c7823616d5",
"score": "0.6233085",
"text": "def retry_attempt\n @retry_attempt ||= 0\n end",
"title": ""
},
{
"docid": "f31790a145d49503c4a214784f77a893",
"score": "0.6220844",
"text": "def max_retries_import\n @max_retries_import || 5\n end",
"title": ""
},
{
"docid": "a30c934f404021ec9c9acdc7424c2cec",
"score": "0.62175757",
"text": "def attempts_limit_reached?(attempts = nil)\n (attempts ||= @store.get(msg_id, :attempts)) && attempts.to_i >= attempts_limit\n end",
"title": ""
},
{
"docid": "41db3a823992bd04c0ae4998919ad039",
"score": "0.6207501",
"text": "def retries=(retries); end",
"title": ""
},
{
"docid": "9ae56b7d8db415f0455263f9af15bd5c",
"score": "0.6205893",
"text": "def retry_job(index_in_failed_queue)\n item = Resque.decode(@resque_data_store.list_range(:failed,index_in_failed_queue))\n item['retried_at'] = Time.now.strftime(\"%Y/%m/%d %H:%M:%S\")\n @resque_data_store.update_item_in_failed_queue(index_in_failed_queue,Resque.encode(item))\n @resque_data_store.push_to_queue(item[\"queue\"],Resque.encode(item[\"payload\"]))\n end",
"title": ""
},
{
"docid": "90972882e99e5d0f8838915575e59c2a",
"score": "0.6205434",
"text": "def retries\n @retries || 0\n end",
"title": ""
},
{
"docid": "77d854d57d186b7ef1cf2bc8f84c4327",
"score": "0.6195363",
"text": "def max_tries; end",
"title": ""
},
{
"docid": "53e72518347e2805e3f586f292507ba9",
"score": "0.6193078",
"text": "def after_recovery_attempts_exhausted(&block)\n @recovery_attempts_exhausted = block\n end",
"title": ""
},
{
"docid": "a49f0522981680ac1ddc810e40c94e91",
"score": "0.6192494",
"text": "def job_dead?\n job_retries > job_max_retries\n end",
"title": ""
},
{
"docid": "82355348fcea27c38b58a075b5f3cc32",
"score": "0.61574364",
"text": "def multi_factor_auth_max_attempts\n track_event('Multi-Factor Authentication: max attempts reached')\n end",
"title": ""
},
{
"docid": "4598871ce1e476b35938709da1cd3655",
"score": "0.6148755",
"text": "def Retry; end",
"title": ""
},
{
"docid": "9414e7f77a2953b8af92f9e6adb3a2f7",
"score": "0.61420286",
"text": "def defer_retry\n BetterSqs.logger.warn \"Deferring retry processing of the message for #{BetterSqs.configuration.sqs_message_deferral_seconds} in SQS.\"\n queue_client.defer_retry self\n end",
"title": ""
},
{
"docid": "73e120a3d997790f31cb22f329d82d8a",
"score": "0.61273074",
"text": "def failed(message = nil)\n self.retry unless times_failed >= self.class.max_attempts\n update(\n :failed_at => Time.now,\n :exception => message\n )\n end",
"title": ""
},
{
"docid": "144b8b58abbd0b1eeafb3216091493a3",
"score": "0.6124341",
"text": "def retry_later\n Rails.logger.info(\"Retyring later\")\n # sleep(60)\n # TransferWorkflowMonitorJob.perform_now(params)\n TransferWorkflowMonitorJob.set(wait: 1.minutes).perform_later(params)\n end",
"title": ""
},
{
"docid": "cf0a7e4b1fd4c46620ce790b1d285a21",
"score": "0.6106846",
"text": "def rocket_job_retry_on_fail?\n rocket_job_failure_count < retry_limit\n end",
"title": ""
},
{
"docid": "41a915901ad591c6c7aeb944cf3c7446",
"score": "0.6094919",
"text": "def try_try_again options = {}\n attempts = 0\n retry_limit = options[:limit] || 3\n retry_wait = options[:wait] || 1\n retry_message = options[:message] || 'Retrying...'\n begin\n yield\n rescue => e\n if attempts < retry_limit\n attempts += 1\n say_warning retry_message\n sleep retry_wait if retry_wait > 0\n retry\n else\n raise e\n end\n end\n end",
"title": ""
},
{
"docid": "637faa12596bbf79225684b27c416e42",
"score": "0.6089529",
"text": "def retry_attempts\n @retry_attempts ||= Vault::Defaults::RETRY_ATTEMPTS\n end",
"title": ""
},
{
"docid": "3ac7956228e912bac7152b38aad35a71",
"score": "0.60723066",
"text": "def on_completed_request\n @retry_counter = 0\n end",
"title": ""
},
{
"docid": "d75c705c8cc9b28212479c10fd46de0e",
"score": "0.6069345",
"text": "def retry_after\n minimum_interval\n end",
"title": ""
},
{
"docid": "97aee0abf0c705353667e272790b70c4",
"score": "0.6065602",
"text": "def clear_failed_jobs\n ActiveRecord::Base.connection.execute(\n \"DELETE FROM delayed_jobs WHERE attempts > 0\"\n )\n end",
"title": ""
},
{
"docid": "aa5cef44c900d1ff226550541dc365b0",
"score": "0.6053479",
"text": "def retry\n opts[:retry]\n end",
"title": ""
},
{
"docid": "241b4084402b2ee3b44a5d37aa8fc6e8",
"score": "0.60500956",
"text": "def attempt_retry(worker, msg, queue, e)\n max_retry_attempts = retry_attempts_from(msg['retry'], @max_retries)\n\n msg['queue'] = if msg['retry_queue']\n msg['retry_queue']\n else\n queue\n end\n msg['error_message'] = e.message\n msg['error_class'] = e.class.name\n count = if msg['retry_count']\n msg['retried_at'] = Time.now.utc\n msg['retry_count'] += 1\n else\n msg['failed_at'] = Time.now.utc\n msg['retry_count'] = 0\n end\n\n if msg['backtrace'] == true\n msg['error_backtrace'] = e.backtrace\n elsif msg['backtrace'] == false\n # do nothing\n elsif msg['backtrace'].to_i != 0\n msg['error_backtrace'] = e.backtrace[0..msg['backtrace'].to_i]\n end\n\n if count < max_retry_attempts\n delay = delay_for(worker, count)\n logger.debug { \"Failure! Retry #{count} in #{delay} seconds\" }\n retry_at = Time.now.to_f + delay\n payload = Sidekiq.dump_json(msg)\n Sidekiq.redis do |conn|\n conn.zadd('retry', retry_at.to_s, payload)\n end\n else\n # Goodbye dear message, you (re)tried your best I'm sure.\n retries_exhausted(worker, msg)\n end\n end",
"title": ""
},
{
"docid": "e7a9c4dced1bee04c5cdd3ccffd1ed79",
"score": "0.604745",
"text": "def do_retries\n yield\n rescue @from => e\n raise e unless (@tries -= 1).positive?\n\n sleep (@sleep_duration += 1)**2 if @backoff # rubocop:disable Lint/ParenthesesAsGroupedExpression\n retry\n end",
"title": ""
},
{
"docid": "c207fa3c858983c28c11829735077e0c",
"score": "0.6036367",
"text": "def retryable_error_handler(error)\n upsert_job_status(Form526JobStatus::STATUS[:retryable_error], error)\n log_error('retryable_error', error)\n metrics.increment_retryable(error)\n end",
"title": ""
},
{
"docid": "6521035285d49426766ed8336c6e2997",
"score": "0.60360783",
"text": "def max_network_retry_delay; end",
"title": ""
},
{
"docid": "7e85913b7b7062168225bc86ac8e74b8",
"score": "0.602896",
"text": "def perform\n DefaultSelfRetryingJob.perform_later\n end",
"title": ""
},
{
"docid": "89d36ba4ebfb289d4f119cf1402ec410",
"score": "0.6010918",
"text": "def log_failed_attempt\n self.last_attempted = Time.now\n self.increment(:attempt_count)\n end",
"title": ""
},
{
"docid": "5093da321a3fc6d8f374c2ef6aad54de",
"score": "0.60071284",
"text": "def retry_all\n if params[:queue].present? && params[:queue]!=\"failed\"\n Resque::Failure.requeue_queue(params[:queue])\n else\n (0...Resque::Failure.count).each { |id| Resque::Failure.requeue(id) }\n end\n redirect_to failures_path(redirect_params)\n end",
"title": ""
},
{
"docid": "277d6cdf2243f294865dca3bfc999002",
"score": "0.60000014",
"text": "def calculate_retry_after(env); end",
"title": ""
},
{
"docid": "223d34157d6560ea9d0dc069fd09bab0",
"score": "0.5999086",
"text": "def retry_data; end",
"title": ""
},
{
"docid": "65fca0ded73f51c5538f854776ccf09a",
"score": "0.5991337",
"text": "def set_retry_state!; end",
"title": ""
},
{
"docid": "dd9bf6109b48132b13acd2ee4efcc542",
"score": "0.5987995",
"text": "def when_not_ready\n retry_job\n end",
"title": ""
},
{
"docid": "14886ff7e85864dd9998ab53eca25347",
"score": "0.59788024",
"text": "def with_limited_retry(opts)\n tries = opts.fetch :tries\n wait_time = opts.fetch :wait_time, 2\n exceptions = Array(opts.fetch(:exceptions))\n\n return if tries == 0\n\n begin\n yield\n rescue *exceptions\n if (tries -= 1) > 0\n sleep wait_time\n retry\n end\n end\n end",
"title": ""
},
{
"docid": "438b78e9a498d56e38a889b0d1bee6a4",
"score": "0.59778",
"text": "def retry_interval=(_arg0); end",
"title": ""
},
{
"docid": "d24515f8029fccaf777b590c40952111",
"score": "0.59774804",
"text": "def fail(output, time_taken)\n tries = self.attempts + 1\n return try_again if tries < CloudCrowd.config[:work_unit_retries]\n update_attributes({\n :status => FAILED,\n :node_record => nil,\n :worker_pid => nil,\n :attempts => tries,\n :output => output,\n :time => time_taken\n })\n job && job.check_for_completion\n end",
"title": ""
},
{
"docid": "25cdc56273ef1cecf7fed2113375789c",
"score": "0.59766746",
"text": "def retryable_error_handler(error)\n upsert_job_status(Form526JobStatus::STATUS[:retryable_error], error)\n log_error('retryable_error', error)\n metrics.increment_retryable(error, @is_bdd)\n end",
"title": ""
},
{
"docid": "1f052a463f5f317a8504cc134a23f2c7",
"score": "0.59762365",
"text": "def max_network_retries; end",
"title": ""
},
{
"docid": "4d7460fac5694fac343aca92a11c92ed",
"score": "0.59717005",
"text": "def retry_attempts=(val)\n @retry_attempts = val\n end",
"title": ""
},
{
"docid": "9b97a3527ad40c58c0a537c1e1d804ca",
"score": "0.5969944",
"text": "def retry(item = nil)\n raise NoOpenTransaction unless @last_read_queue\n\n job = item ? RetryableJob.new(@job.retries, item) : @job.dup\n\n job.retries += 1\n\n if job.retries < @max_retries\n client.set(current_queue + \"_errors\", job)\n else\n raise RetriesExceeded.new(job)\n end\n\n ensure\n close_last_transaction\n end",
"title": ""
},
{
"docid": "4b894086175363de6f13d4e6ffddeb2e",
"score": "0.5967845",
"text": "def perform\n DefaultSelfRetryingJob.perform_later\n end",
"title": ""
},
{
"docid": "3d8e861d40a5a00a6585028a6d9358a0",
"score": "0.5967764",
"text": "def perform_processing!\n delay = if processing_error && processing_error.response\n processing_error.response.data['retry_after'].to_i\n else\n 10\n end\n retry_in(delay)\n end",
"title": ""
},
{
"docid": "97601487fd286004777ddbb981b31e2e",
"score": "0.5960516",
"text": "def retry_all\n @resque_data_store.num_failed.times do |index|\n retry_job(index)\n end\n end",
"title": ""
},
{
"docid": "3af3da2b5a4008d60b8e5523ae5db9a7",
"score": "0.59526473",
"text": "def max_retries\n @max_retries ||= options[:max_retries] || seeds.size\n end",
"title": ""
},
{
"docid": "6b68119eb79893d079bb3526b526eca8",
"score": "0.5948488",
"text": "def retry_all\n if params[:queue].present? && params[:queue] != 'failed'\n Resque::Failure.requeue_queue(params[:queue])\n else\n (Resque::Failure.count - 1).downto(0).each do |i|\n reque_single_job(i) if must_execute_action_for(i)\n end\n end\n\n redirect_to failures_path(redirect_params)\n end",
"title": ""
}
] |
49f7ff62de1489b2f8c973bcc9d07a6a
|
Creates a new instance.
|
[
{
"docid": "c184b1eb896290fbd643348b675ab1c0",
"score": "0.0",
"text": "def initialize(value = '')\n @value = Value.new(value)\n end",
"title": ""
}
] |
[
{
"docid": "785ca7af6bc64e08d1478854d1e7c46e",
"score": "0.8193921",
"text": "def new\n @instance = Instance.new\n end",
"title": ""
},
{
"docid": "52b4fba67deb4dd7f43f3fb486fd1535",
"score": "0.8173991",
"text": "def create(*args)\n new(*args)\n end",
"title": ""
},
{
"docid": "8adda1b144e03f06faf1aa28abfdf9b0",
"score": "0.7665391",
"text": "def new(*args)\n self.class.new(*args)\n end",
"title": ""
},
{
"docid": "7dd2308c1025799ff89dc58de436b706",
"score": "0.76394194",
"text": "def new\r\n\t\t@newinstance = Instance.new\r\n\tend",
"title": ""
},
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.7635986",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.7635986",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.7635986",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "e2b31d60b2b5b380040a867c381a1b70",
"score": "0.7635986",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "3e18cb2a5056cf5c82e7b585d5f1254d",
"score": "0.75847894",
"text": "def new\n inst = self.allocate\n inst.initialize\n inst\n end",
"title": ""
},
{
"docid": "3e18cb2a5056cf5c82e7b585d5f1254d",
"score": "0.75847894",
"text": "def new\n inst = self.allocate\n inst.initialize\n inst\n end",
"title": ""
},
{
"docid": "cfa08c71c616cdc11ac3715b69147db0",
"score": "0.7513164",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "cfa08c71c616cdc11ac3715b69147db0",
"score": "0.7513164",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "cfa08c71c616cdc11ac3715b69147db0",
"score": "0.7513164",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "cfa08c71c616cdc11ac3715b69147db0",
"score": "0.7513164",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "edefb41e6036fd69564480d350745cb1",
"score": "0.7512944",
"text": "def new\n # Nothing to see here, atm\n end",
"title": ""
},
{
"docid": "004171d34793c7a1b939a4c047c589cf",
"score": "0.74481875",
"text": "def new\n ResourceInstance.new(@client, @api, self, action: @actions[:create], persistent: false)\n end",
"title": ""
},
{
"docid": "a08a268d914f0eb1add77ee188ebbfa3",
"score": "0.7438021",
"text": "def create!(*args)\n new(*args).tap(&:save!)\n end",
"title": ""
},
{
"docid": "e916d85bf7b6d6d24c3718893525c85b",
"score": "0.7434006",
"text": "def create(attributes = {})\n self.new(attributes).tap {}\n end",
"title": ""
},
{
"docid": "f828d652dc659f3d1e37aae4f1a34673",
"score": "0.7426614",
"text": "def create(attributes = { })\n inst = self.new(attributes)\n inst.save\n\n inst\n end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "3bcd882268911f03b8c342c03668c47b",
"score": "0.74217",
"text": "def new; end",
"title": ""
},
{
"docid": "d5618580b82294c556df58f9c3f51ea0",
"score": "0.7392921",
"text": "def create\n self.clazz.new(self.options.dup, self.config.dup)\n end",
"title": ""
},
{
"docid": "f2022d5e4fc2214721796a80eb834e69",
"score": "0.73551595",
"text": "def instantiate(instance_attrs={})\n new(instance_attrs, :stored => true)\n end",
"title": ""
},
{
"docid": "efc828f38cb2fc4f7599e2b8479097b6",
"score": "0.7354301",
"text": "def create(attributes = {})\n instance = new(attributes)\n instance.create\n instance\n end",
"title": ""
},
{
"docid": "677c07f5a78773a6bd46124e7e6fc28f",
"score": "0.7348648",
"text": "def new(init = nil)\n create(init: init)\n end",
"title": ""
},
{
"docid": "e38391181ddf31e1159b15280bc07cd5",
"score": "0.72863996",
"text": "def create!(attributes = {})\n instance = new(attributes)\n instance.create!\n instance\n end",
"title": ""
},
{
"docid": "4765be81c24230164c422594e65759bc",
"score": "0.7262153",
"text": "def create(params={})\n new(params).tap { |n| n.save }\n end",
"title": ""
},
{
"docid": "58036574315848397834850c519a3c26",
"score": "0.7231684",
"text": "def create(*args)\n new(*args).tap(&:save)\n end",
"title": ""
},
{
"docid": "8bbbb6b03a9c0807d269519bea0517f0",
"score": "0.7225081",
"text": "def create(attributes = nil)\n object = new(attributes)\n object.save\n object\n end",
"title": ""
},
{
"docid": "4e506bc377edec8c378bb1ec44c4fdb1",
"score": "0.71724576",
"text": "def create!(attrs = {})\n new(attrs).tap(&:save!)\n end",
"title": ""
},
{
"docid": "2ec4946cf4700263b114611fe9608ce2",
"score": "0.7163026",
"text": "def new; self end",
"title": ""
},
{
"docid": "9d479e5091ab8e45e4ca3d991c07b4a4",
"score": "0.7145849",
"text": "def create(attributes = {})\n model = new(attributes)\n model.save\n model\n end",
"title": ""
},
{
"docid": "96363ebbd34971220ce8f30af1416894",
"score": "0.71385306",
"text": "def create!(*args)\n object = new(*args)\n object.save or raise InvalidRecord.new(object, object.errors)\n object\n end",
"title": ""
},
{
"docid": "9ac838fdf25bfcb01b5077bba38b975a",
"score": "0.7136487",
"text": "def create(attrs = {})\n new(attrs).tap(&:save)\n end",
"title": ""
},
{
"docid": "3293370df38424800b58bd240b80878a",
"score": "0.7117532",
"text": "def new\n \n end",
"title": ""
},
{
"docid": "df3bad92f81c9695d2f61be965850d70",
"score": "0.71124715",
"text": "def new(*args)\n super\n end",
"title": ""
},
{
"docid": "fe648b185762f6bcab9fd37dfddfd1e6",
"score": "0.7110074",
"text": "def make_new\n @klass.new(*@args)\n end",
"title": ""
},
{
"docid": "9f6eadf535d159853a26a4a0cc87a631",
"score": "0.7081887",
"text": "def create!\n raise 'Not implemented'\n end",
"title": ""
},
{
"docid": "9d40c09a382560d6b401e9660426307f",
"score": "0.70612365",
"text": "def instantiate(attributes)\n self.new attributes\n end",
"title": ""
},
{
"docid": "9d40c09a382560d6b401e9660426307f",
"score": "0.70612365",
"text": "def instantiate(attributes)\n self.new attributes\n end",
"title": ""
},
{
"docid": "2a6459044f130f17796a3e8869d8e3da",
"score": "0.705731",
"text": "def create *args\n\t\t\treturn Factory[self].new() if args.empty?\n\t\t\treturn Factory[self].new(*args)\n\t\tend",
"title": ""
},
{
"docid": "d3104d0cad300520c80aeb0da4f3c67e",
"score": "0.7045288",
"text": "def new\n @klass = Klass.new\n end",
"title": ""
},
{
"docid": "82253fc687c42bf87b86bff945e72834",
"score": "0.7043998",
"text": "def create\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "946633106325584a663b3f67b6caf57e",
"score": "0.7038359",
"text": "def create\n make_create_request\n self\n end",
"title": ""
},
{
"docid": "874a646f17ecdf3589233704c9811e75",
"score": "0.7032807",
"text": "def new(attributes)\n self.class.new(attributes)\n end",
"title": ""
},
{
"docid": "d9468ebf4d24f453f2c72b0e3b10d1bb",
"score": "0.7028143",
"text": "def create(attributes)\n instance = self.new(attributes)\n instance.save\n instance\n end",
"title": ""
},
{
"docid": "3642077420255fc29f07daafe08c2e40",
"score": "0.7013865",
"text": "def new_instance(**args)\n required_args = (defined? required_arguments) ? required_arguments : {}\n args = required_args.merge(args)\n described_class.new(**args)\n end",
"title": ""
},
{
"docid": "29353ec7289e8a3545869229d560472f",
"score": "0.70074815",
"text": "def create(*args)\n\t \t new(*args).send :create\n\t \tend",
"title": ""
},
{
"docid": "73fc83910cda3ab89c3bb4397171246a",
"score": "0.70032936",
"text": "def create\n # helps with boilerplateness\n end",
"title": ""
},
{
"docid": "b5083723d897de4bdf376e3058668716",
"score": "0.6999174",
"text": "def create(args = {})\n model = new(args)\n model.save\n model\n end",
"title": ""
},
{
"docid": "ba512741dd0ccb2343d724ad73a47283",
"score": "0.6989095",
"text": "def create!(attributes = {})\n new(attributes).tap(&:save!)\n end",
"title": ""
},
{
"docid": "d4dbb1e94af52ef8c712b66ef7cda0d5",
"score": "0.6980618",
"text": "def construct(*args)\n self.klass.new(args)\n end",
"title": ""
},
{
"docid": "0796350f29be34a7c5b3ab251051e6b7",
"score": "0.6978409",
"text": "def new(*args, &block)\n base_instance.new(*args, &block)\n end",
"title": ""
},
{
"docid": "04497f34329faddde1da11685d15e45d",
"score": "0.697496",
"text": "def new; end",
"title": ""
},
{
"docid": "e2aec291bc8a1f7389b768de2a676c0d",
"score": "0.6971855",
"text": "def create(data={})\n object = self.new(data)\n object.save\n end",
"title": ""
},
{
"docid": "35ab88ac0bb02b426c0ac667b74ceb4d",
"score": "0.69690967",
"text": "def create(*args, &block)\r\n # See \"Part of implementation of ::create()\" sections inside this Module\r\n # for the implementation.\r\n end",
"title": ""
},
{
"docid": "a838b21f00edca097c00b62e0c9cb82d",
"score": "0.69650525",
"text": "def create(options = {})\n (object = new(options)).save\n object\n end",
"title": ""
},
{
"docid": "ffa1c455c9d0797686a864b698d67da4",
"score": "0.6953428",
"text": "def instantiate(attributes)\n model.new(attributes)\n end",
"title": ""
},
{
"docid": "18675ef1ec360aef58de3b66ce10a383",
"score": "0.6923649",
"text": "def create\n fail ESP::NotImplementedError\n end",
"title": ""
},
{
"docid": "bc8f52bbe9ad4b80ca2658294ab9c492",
"score": "0.69161236",
"text": "def new(*params)\n validate\n obj = allocate\n obj.initialize(*params)\n add(obj) # code smell\n end",
"title": ""
},
{
"docid": "f17d463364895d970f29b90e647a64ae",
"score": "0.69118124",
"text": "def create(params={})\n raise \"Can't create a resource without a REST Client\" unless @client\n response = @client.post @path, params\n @instance_class.new \"#{@path}/#{response[@instance_id_key]}\", @client,\n response\n end",
"title": ""
},
{
"docid": "948bc29560b617701473a0fb23ac39d1",
"score": "0.69021136",
"text": "def new_instance(klass)\n logger.debug \"new {} instance\", klass\n to_class(klass).new\n end",
"title": ""
},
{
"docid": "4c6ffa5639405e9a5f1a3300f67d0aeb",
"score": "0.6897991",
"text": "def initialize(args = {})\n @config = Config.new\n create\n end",
"title": ""
},
{
"docid": "95b708f7b1780c661e21cbe13c924967",
"score": "0.6897394",
"text": "def create\n fail ESP::NotImplementedError\n end",
"title": ""
},
{
"docid": "6e5f2eb1b5148a4f88c6b6a2f44883e2",
"score": "0.6886418",
"text": "def new() raise NotFound end",
"title": ""
},
{
"docid": "df2fb200f66ba6aa3dfff6ae73e20686",
"score": "0.68856716",
"text": "def create(*args)\n new(*args).save\n end",
"title": ""
},
{
"docid": "4b1fa20b690a7df420ec23c40dc8283c",
"score": "0.68851984",
"text": "def new?; end",
"title": ""
},
{
"docid": "464c808c572f2441bff95894b13d4372",
"score": "0.6879228",
"text": "def new(attributes = {})\n record = model_class.new(attributes)\n add(record)\n end",
"title": ""
},
{
"docid": "4c3aa7ec663c6e44f82b01f8146920a6",
"score": "0.6879059",
"text": "def new(class_name, *args, &block)\n #We need to check finalizers first, so we wont accidently reuse an ID, which will then be unset in the process.\n self.check_finalizers\n \n #Spawn and return the object.\n return self.spawn_object(class_name, nil, *args, &block)\n end",
"title": ""
},
{
"docid": "1511cacb0219c9eefeb6a5a1cb2854e5",
"score": "0.68781227",
"text": "def create(attributes = {})\n resource = new(attributes)\n resource.save\n resource\n end",
"title": ""
},
{
"docid": "3e87cec690bc85aae6ebd8e966d2fb3e",
"score": "0.6872768",
"text": "def new(*args, &bk)\n build(*args, &bk).to_app\n end",
"title": ""
},
{
"docid": "0748c2e50ee7f93f20d31212e017b59b",
"score": "0.6867014",
"text": "def create(attributes = {})\n new(attributes).tap do |resource|\n resource.save\n end\n end",
"title": ""
},
{
"docid": "bc50701b04b9669938f1d64cfdb1fa80",
"score": "0.68645734",
"text": "def new(*args); end",
"title": ""
},
{
"docid": "8c9de77eb3f8174920238eb8abf34148",
"score": "0.6857919",
"text": "def new\n end",
"title": ""
},
{
"docid": "8c9de77eb3f8174920238eb8abf34148",
"score": "0.6857919",
"text": "def new\n end",
"title": ""
},
{
"docid": "8c9de77eb3f8174920238eb8abf34148",
"score": "0.6857919",
"text": "def new\n end",
"title": ""
},
{
"docid": "8c9de77eb3f8174920238eb8abf34148",
"score": "0.6857919",
"text": "def new\n end",
"title": ""
},
{
"docid": "32b0f0148f1d26df4940c3a6bd6fbaa8",
"score": "0.6855307",
"text": "def create(*args, &block)\n scoping { @klass.create(*args, &block) }\n end",
"title": ""
},
{
"docid": "5d3c896af3b939b3e80b82bce49ba525",
"score": "0.6851164",
"text": "def create(attributes)\n instance = self.new_with_attributes(attributes)\n instance.save\n instance\n end",
"title": ""
},
{
"docid": "5654fd981965d239f53e36c5a3ab30e6",
"score": "0.6849782",
"text": "def create!(args = {})\n new(args).save!\n end",
"title": ""
},
{
"docid": "c6cc7130c802cbbd1c3e3e70f76c1cf3",
"score": "0.6849523",
"text": "def create(attributes = {})\n self.new(attributes).tap { |resource| resource.save }\n end",
"title": ""
},
{
"docid": "0a260857d85ee69abae7e0aabe96bdbf",
"score": "0.68485785",
"text": "def create!(*args, &block)\n scoping { @klass.create!(*args, &block) }\n end",
"title": ""
},
{
"docid": "0a260857d85ee69abae7e0aabe96bdbf",
"score": "0.68485785",
"text": "def create!(*args, &block)\n scoping { @klass.create!(*args, &block) }\n end",
"title": ""
},
{
"docid": "9f73e1a4933a4d845bb36931e6c6e87c",
"score": "0.68413067",
"text": "def new_object(*args, &block)\n model.new(*args, &block)\n end",
"title": ""
},
{
"docid": "855e5fba30b3ad2394a58194b17a8da2",
"score": "0.6838632",
"text": "def new_instance\n self.class.new(worker_name: worker_name, job_queue: job_queue, job_args: job_args, job_meta: job_meta)\n end",
"title": ""
},
{
"docid": "023c75a5b5e3c7b569218b4260745a74",
"score": "0.68346936",
"text": "def create!(attributes = {})\n klass.create!(attributes)\n end",
"title": ""
}
] |
b0c6b81f7b30f46e5a8044aace6f182f
|
Returns +1 if player +1 has won in the given game state, 1 if player 1 has won, and 0 if no one has won.
|
[
{
"docid": "bbdd714c2d0290c33372ea9770b9cc94",
"score": "0.71353203",
"text": "def is_win?(game_state)\n position = @referee.player(game_state.turn).position\n return +game_state.turn if game_state.game_board.kalah(position) > game_state.game_board.TOTAL_STONES/2\n return -game_state.turn if game_state.game_board.opponent_kalah(position) > game_state.game_board.TOTAL_STONES/2\n 0\n end",
"title": ""
}
] |
[
{
"docid": "ec2ef83488405b3d983343bba35fd031",
"score": "0.6858723",
"text": "def win?\n if won_game?\n @games_won += 1\n won_set\n return true\n end\n end",
"title": ""
},
{
"docid": "5c81996e644364808ac22bc9b94d3375",
"score": "0.6832063",
"text": "def utility(state)\n return 0 if rules.draw?(state)\n\n (state.turn == team) ? -1 : 1 \n end",
"title": ""
},
{
"docid": "46a4bb356724cd36ee1d63d46b3a9e91",
"score": "0.67648286",
"text": "def track_p1_wins(winner)\n if winner == 1\n return 1\n else\n return 0\n end\nend",
"title": ""
},
{
"docid": "a9d1c8575a1cd0f7d33f91ef49965be5",
"score": "0.67591584",
"text": "def games_won(player)\n\t\ttiebreak_win = tiebreak && tiebreak.winner_id.eql?(player.id) ? 1 : 0\n\t\tgames.where(winner_id: player.id).count + tiebreak_win\n\tend",
"title": ""
},
{
"docid": "1391d4b2ccfe1c020ca9fb032e370c92",
"score": "0.6694871",
"text": "def game_won?\n if @points == 4\n if @opponent.points < 3\n @games_won += 1\n @points = 0\n @opponent.points = 0\n set_won?\n match_won?\n return 'win'\n elsif @opponent.points == 3\n @points -= 1\n @opponent.points -= 1\n return 'advantage'\n elsif @opponent.points == 4\n @points -= 1\n @opponent.points -= 1\n return 'duece'\n end\n end\n end",
"title": ""
},
{
"docid": "4832aa4eb8b33091f49d9e1b608b1414",
"score": "0.6688089",
"text": "def won\n if (object.result == 1 and object.white == current_user) or (object.result == -1 and object.black == current_user)\n return 1\n elsif object.result == 0\n return 0\n end\n -1\n end",
"title": ""
},
{
"docid": "75bdc4c2a015d733e3ee1c92b6e304b2",
"score": "0.6552206",
"text": "def won?\n @state.id == 14\n end",
"title": ""
},
{
"docid": "14959cc0508e731e6a478db0886b7a68",
"score": "0.65487635",
"text": "def won_game(player)\n if player.advantage\n player.win = true\n player.games_won += 1\n won_set(player)\n reset_scores\n elsif player.points > 3 and player.opponent.points < 3\n player.win = true\n player.games_won += 1\n won_set(player)\n reset_scores\n end\n end",
"title": ""
},
{
"docid": "a622dab2f3861681a43ea84fe769e467",
"score": "0.65457886",
"text": "def player_win?(n)\n self.wins.each do |win| \n return true if (player_moves(\"#{n}\") & win).count == self.win_length\n end\n return false\n end",
"title": ""
},
{
"docid": "f270b20095942096eba0f2e2116454a1",
"score": "0.65447557",
"text": "def game_over?\n self.lost? || self.won?\n end",
"title": ""
},
{
"docid": "aa208e5ac54b04be52747c8ae652afcc",
"score": "0.65161693",
"text": "def player_status(player)\n return \"Draw\" if draw?\n player.id == winner_id ? \"Won\" : \"Lost\"\n end",
"title": ""
},
{
"docid": "3acb71f63c5df5a3d2e01c6a11b9e4e3",
"score": "0.6485339",
"text": "def game_over?\n remaining_players == 1\n end",
"title": ""
},
{
"docid": "99096a1dc4dff71a3931513d8d5cf287",
"score": "0.6466114",
"text": "def won?()\r\n\t\twin_game = false\r\n\t\t\r\n\t\tif()\r\n\t\t win_game = true\r\n\t end\r\n\t\t\r\n\t\treturn win_game\r\n\tend",
"title": ""
},
{
"docid": "d680216f114c3df710133627935298cd",
"score": "0.64589995",
"text": "def game_over?\n alive_players.count == 1\n end",
"title": ""
},
{
"docid": "0c95c2b1fbd28fa010545555f25a2e34",
"score": "0.64250153",
"text": "def check_winner\n if win_state == CHECK\n if players[0].get_hand_score >= players[1].get_hand_score\n self.win_state = LOSS\n else\n self.win_state = WIN\n end\n end\n\n if win_state == WIN\n self.wins = wins + 1 \n puts \"Good win! You're now at #{wins} wins and #{losses}.\"\n else\n self.losses = losses + 1\n puts \"Better luck next time. You're now at #{wins} wins and #{losses} losses.\"\n end\n end",
"title": ""
},
{
"docid": "f1232bc4cb76efd8521559973edc48db",
"score": "0.64233714",
"text": "def track_p2_wins(winner)\n if winner == 2\n return 1\n else\n return 0\n end\nend",
"title": ""
},
{
"docid": "0212040eb8d3813f87520bcc1314814f",
"score": "0.64047897",
"text": "def set_won?\n if @games_won == 6 && @opponent.games_won < 5\n @sets_won += 1\n @games_won = 0\n @opponent.games_won = 0\n end\n if @games_won == 7 && @opponent.games_won < 7\n @sets_won += 1\n @games_won = 0\n @opponent.games_won = 0\n end\n end",
"title": ""
},
{
"docid": "84ea637ab5666771351f8254f2bccb27",
"score": "0.6402466",
"text": "def determine_win\n\t\t@win_combos.each do |combo|\n\t\t\tp1 = (@p1_spaces & combo).length\n\t\t\tp2 = (@p2_spaces & combo).length\n\n\t\t\tif p1 == 3\n\t\t\t\treturn 1\n\t\t\t\tp1.games_won += 1\n\t\t\telsif p2 == 3\n\t\t\t\treturn 2\n\t\t\t\tp2.games_won += 1\n\t\t\tend\n\t\tend\n\t\t0\n\tend",
"title": ""
},
{
"docid": "5ad56eba5ff46c1e0e85209ad6d6e577",
"score": "0.6383937",
"text": "def update_game_won_count(game_count, game_status)\n player_score = game_status[:player_hand]\n dealer_score = game_status[:dealer_hand]\n status = game_status[:current_game_status]\n\n if dealer_score > player_score && dealer_score <= MAX_HAND_VALUE\n game_count[:dealer_wins] += 1\n elsif status.include?('busted') && dealer_score <= MAX_HAND_VALUE\n game_count[:dealer_wins] += 1\n elsif player_score > dealer_score && player_score <= MAX_HAND_VALUE\n game_count[:player_wins] += 1\n elsif player_score <= MAX_HAND_VALUE && dealer_score > MAX_HAND_VALUE\n game_count[:player_wins] += 1\n end\nend",
"title": ""
},
{
"docid": "3f8a0721bf042d86493acc94e72d6fed",
"score": "0.63729143",
"text": "def compute_state # {{{\n\n player_moves = []\n ki_moves = []\n\n player_moves = self.get_moves_as_hash true\n ki_moves = self.get_moves_as_hash false\n\n return WON if has_winning_combination player_moves\n return LOST if has_winning_combination ki_moves\n\n return DRAWN if player_moves.count + ki_moves.count == 3*3\n\n RUNNING\n end",
"title": ""
},
{
"docid": "104a61147ee2fd332d18e0a08e77a693",
"score": "0.63612884",
"text": "def won?()\n\n # loops through the 2D array WIN_COMBINATIONS\n WIN_COMBINATIONS.each do |combination|\n\n # flags\n x_win = 0\n o_win = 0\n\n combination.each do |index|\n\n # checks if player X wins\n if @board[index] == \"X\"\n x_win += 1\n\n if x_win == 3\n return combination\n end\n else\n x_win = 0\n end\n\n # checks if player O wins\n if @board[index] == \"O\"\n o_win += 1\n\n if o_win == 3\n return combination\n end\n else\n o_win = 0\n end\n\n end\n end\n\n # return false if there is no winner\n return false\n end",
"title": ""
},
{
"docid": "65ae18618e9bc2f340330bf1f51c1257",
"score": "0.6351259",
"text": "def status\n return 0 unless has_been_approved_for_this_season?\n return 1 if all_primary_picks_are_wins?\n if first_loss_before_second_chance_start? && all_secondary_picks_are_wins?\n return 2\n end\n if first_loss_before_second_chance_start? == false || all_secondary_picks_are_wins? == false\n return 3\n end\n raise \"error determining status\"\n end",
"title": ""
},
{
"docid": "4d3776936139c3b776b7b6d8606b20a4",
"score": "0.6343207",
"text": "def did_player_win?(player)\n\t\twinner_count = self.teams.winner.joins(:positions).where(:positions => {player_id: player.id}).count\n\t\treturn winner_count > 0\n\tend",
"title": ""
},
{
"docid": "b947e7572fbef021a08641eb78856fb0",
"score": "0.6300973",
"text": "def won_game?\n @points > @opponent.points + 1 && @points >= 3\n end",
"title": ""
},
{
"docid": "65a4da5fc52f84871c27cd43a4acfb4e",
"score": "0.6299993",
"text": "def wins()\n\t\tself.as_regular_contestants.select{|c| c.win()}.size()\n\tend",
"title": ""
},
{
"docid": "6af7d5b9bc5955b62e36d272417eb506",
"score": "0.62796205",
"text": "def score(game)\n if game.winner.nil?\n 0\n elsif game.winner == game.computer_player\n 1\n else\n -1\n end\n end",
"title": ""
},
{
"docid": "a4904141755b4c6fbfadc4d13b7c7b13",
"score": "0.62776005",
"text": "def player_won\n\t\tputs \"\\nCongratulations! your have won!\"\n\t\tself.player_record[\"Wins\"] += 1\n\tend",
"title": ""
},
{
"docid": "771dddcdb2d45ea39eb77fc2be75ab4f",
"score": "0.6266337",
"text": "def winning_state_for_next_move?\n # for each possible move that could be made:\n # return true if the move leaves a losing_state_for_next_move for the opponent\n # else\n # false\n # end\n\n\n # a player can win with one move\n # / there is a move that makes true losing_state_for_next_move\n\n # if you can set up 1,1,1 by making your move, it's a winning move\n end",
"title": ""
},
{
"docid": "c8aea75d5afb108a74068c72a24e7138",
"score": "0.6227524",
"text": "def won_set\n if @opponent.games_won == 6 && @games_won == 7\n @games_won = 0\n @sets_won += 1\n elsif @games_won > 4 && @games_won > @opponent.games_won + 1\n @games_won = 0\n @sets_won += 1\n end\n\n @matches_won += 1 if won_match?\n end",
"title": ""
},
{
"docid": "24a1df14171bfa20f0c2f5cd3493bb47",
"score": "0.6215477",
"text": "def game_over\n remaining_player.count == 1\n end",
"title": ""
},
{
"docid": "7d0e8fda5385dc4f7557f1c6c812229a",
"score": "0.62132204",
"text": "def won?\n if @scores_array.reduce(0, :+) >= WINNING_SCORE \n \t\t\"You win!\"\n \t\treturn true\n \telse\n \"You haven't won yet.\"\n return false \n end\n end",
"title": ""
},
{
"docid": "77bdf6e9c75ab69e86d6e6d9ab3597f4",
"score": "0.62083185",
"text": "def has_won(board)\n # printf(\"Pre-Solved: %b \\n\", board)\n # puts \"Num: #{board}\"\n # check \\ diagonal\n w = board & (board >> 7)\n # check -- horizontal\n x = board & (board >> 8)\n # check / diagonal\n y = board & (board >> 9)\n # check | vertical\n z = board & (board >> 1)\n\n bitboard = ( (w & (w >> (2 * 7))) |\n (x & (x >> (2 * 8))) |\n (y & (y >> (2 * 9))) |\n (z & (z >> (2 * 1))) )\n # printf(\"Solved: %b \\n\", bitboard)\n # puts @game_state_model::state\n return bitboard > 0\n end",
"title": ""
},
{
"docid": "51d19da995165c26b6c2f908b768b8e1",
"score": "0.6201393",
"text": "def o_won?\r\n o = @game_board.each_index.select { |position| @game_board[position] == \"O\" }\r\n get_win(o)\r\n end",
"title": ""
},
{
"docid": "217d64d05ab0dd43f20b31235b07ad2a",
"score": "0.6200923",
"text": "def game_over?\n if victory?\n @@score[\"Player #{@other_player.mark}\"] += 1\n puts \"\\nBehold the winner - the #{@other_player}!!!\\n\"\n # show_score\n show_score\n true\n elsif @turns == 9\n @@score[:draws] += 1\n puts \"\\nIt's a draw!\\n\"\n # show_score\n show_score\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "5316422c8ecb3d0f33adec07f7db17b6",
"score": "0.6199518",
"text": "def won?\n #won?: If the player has over 100 points, returns true, otherwise returns false\n if total_score > 100\n return true\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "c4e77efe34239a1425c4cc8c77f0fe10",
"score": "0.619789",
"text": "def game_won?\n if diagonal_win?\n true\n elsif horizontal_win?\n true\n elsif vertical_win?\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "17606c77f8c0d59cb04534b60a7e40fe",
"score": "0.6192359",
"text": "def won?\n win = false\n win = true if total_score >= 100\n return win\n end",
"title": ""
},
{
"docid": "771440f9d49f6306cbab92f339a8d13a",
"score": "0.6185725",
"text": "def won?(state)\n pieces = state[:pieces]\n player = opponent(state[:player])\n # pieces[player].empty?\n king = pieces[player].find { |piece| piece.class == ChessKing }\n !king\n end",
"title": ""
},
{
"docid": "6223795090e9675ed0a5c3226336cb8e",
"score": "0.61635524",
"text": "def won?\n @game.started? && !detectives_won? && detectives_cannot_move?\n end",
"title": ""
},
{
"docid": "18150c0c634fc86dfea1a4c45d925fbe",
"score": "0.61261106",
"text": "def get_games_won()\n return @score_count.get_games_won()\n end",
"title": ""
},
{
"docid": "e88d608f61b7536176de33c5aa457d94",
"score": "0.6120373",
"text": "def won?\n player_case = false\n if total_score >= 100\n player_case = true\n end\n return player_case\n end",
"title": ""
},
{
"docid": "b0b92dbff68c04b71be682ce9f06cedc",
"score": "0.61134195",
"text": "def won_game?\n if @points > @opponent.points + 1 && @points > 3\n @points = 0\n opponent.points = 0\n return true\n end\n end",
"title": ""
},
{
"docid": "01ad6bed2d70986acb601b3043c34efe",
"score": "0.6106413",
"text": "def who_won? game\n if game.winner_id == nil\n \"In Progress\"\n elsif game.winner_id == current_user.id\n \"You\"\n else\n \"CPU\"\n end\n end",
"title": ""
},
{
"docid": "e5346261ce54eee63225204b1a03c37a",
"score": "0.6096073",
"text": "def result\n state.try(:to_sym) == :passed ? 0 : 1\n end",
"title": ""
},
{
"docid": "342f8d67027ca64d117fdac58f036248",
"score": "0.609214",
"text": "def game_over\n [:winner, :tie].include?(board.status)\n end",
"title": ""
},
{
"docid": "0cac8fd66b836fada13e00cd261ceef0",
"score": "0.6080858",
"text": "def board_won?\n\t\twon = false\n\t\t\n\t\tWINNING_POSITIONS.each do |positions|\n\t\t\tn = 0\n\t\t\tfor i in 0..8\n\t\t\t n += 1 if (positions[i] == @gameplay_positions[i] && positions[i] != 0)\n\t\t\tend\n\t\t\tif n == 3\n\t\t\t\twon = true\n\t\t\tend\n\t\tend\n\n\t\twon ? true : false\n\tend",
"title": ""
},
{
"docid": "3583d3e03808181cc2c9a75ce446dc00",
"score": "0.60795814",
"text": "def wins_game?\n if @player1.score == 'win'\n return @player1\n elsif @player2.score == 'win'\n return @Player2\n else\n return \"The score is currently, Player1: #{player1.score} to Player2: #{player2.score}.\"\n end\n end",
"title": ""
},
{
"docid": "1394b57445960d0b219a13d4ce1ad2b3",
"score": "0.6078576",
"text": "def winner\n (score1 > score2 ? 1 : 2) if won?\n end",
"title": ""
},
{
"docid": "47eb943789c89128c35a0bdafdd36e8c",
"score": "0.60770243",
"text": "def turn_count\n count = 0\n @board.each do |player|\n if player == 'X' || player == 'O'\n count += 1\n end\n end\n return count\n end",
"title": ""
},
{
"docid": "331d4029abeb3f3ed5bb33ba992ee4c5",
"score": "0.6069466",
"text": "def won?\n return total_score > 100 ? true : false\n end",
"title": ""
},
{
"docid": "73ca36781f005761f3990814e232bb63",
"score": "0.60663766",
"text": "def won_set(player)\n if player.games_won >= 6 and player.opponent.games_won < 5\n player.sets_won += 1\n @player1.games_won = 0\n @player2.games_won = 0\n won_match(player)\n elsif player.games_won == 7\n player.sets_won += 1\n @player1.games_won = 0\n @player2.games_won = 0\n won_match(player)\n end\n end",
"title": ""
},
{
"docid": "ddf010af66a49edf2e6e277b694d02cd",
"score": "0.6062806",
"text": "def won?\n total_score > 100 ? true : false\n end",
"title": ""
},
{
"docid": "f91edddb1fe7a25b51f05b9e307dedc0",
"score": "0.60606086",
"text": "def won?\n\t\twon = false\n\t\twon = true if (ended? && @guesses > 0)\n\t\twon\n\tend",
"title": ""
},
{
"docid": "6c0055bdb0c1956d7d70dc6220b3e2d4",
"score": "0.60457873",
"text": "def win()\n\t return false if (self.score.nil? or self.opponent.score.nil?)\n\t self.score() ? self.score().to_i > self.opponent.score().to_i : false\n\tend",
"title": ""
},
{
"docid": "4f7ff560042261e32ef890e452fba930",
"score": "0.60389847",
"text": "def game_over?\n players_found_phrase = @states.select { |s| s.found_phrase }\n if players_found_phrase.size == 1\n @renderer.output \"We have a winner! #{players_found_phrase.first.player.name} found the phrase!\"\n return true \n elsif players_found_phrase.size > 1\n drawn_player_names = players_found_phrase.map { |s| s.player.name }\n @renderer.output \"We have a draw between #{drawn_player_names.join(' and ')}\"\n return true\n else\n dead_players = @states.select { |s| s.incorrect_guesses.count >= Gallows.stages.count - 1 }\n if dead_players.count > 0\n dead_player_names = dead_players.map { |s| s.player.name }\n @renderer.output \"#{dead_player_names.join(' and ')} is dead.\"\n if dead_players.count == @states.count\n @renderer.output \"It's a draw, all players are dead.\"\n else\n surviving_players = @states.select { |s| dead_players.index(s).nil? }\n surviving_player_names = surviving_players.map { |s| s.player.name }\n @renderer.output \"We have a winner! #{surviving_player_names.join(' and ')} survived longer!\"\n end\n return true\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "a49bd75d69e80b72663b4dc0f31cdd63",
"score": "0.60378623",
"text": "def state_wins\n WINS.map { |win| [ $state[win[0]], $state[win[1]], $state[win[2]] ] }\nend",
"title": ""
},
{
"docid": "65ddadf84dc7a5989ecdd0101ec4f125",
"score": "0.6034683",
"text": "def winner?\n return @winner if @winner\n\n b = to_i\n @winner = @@WINNER_STATES.any? { |a| a & b == a }\n end",
"title": ""
},
{
"docid": "131010c548e0d492b4ec3102aee99342",
"score": "0.60305697",
"text": "def count_wins(player, computer, wins)\n if winner?(player, computer)\n wins[:User] += 1\n elsif winner?(computer, player)\n wins[:Computer] += 1\n end\nend",
"title": ""
},
{
"docid": "d30bfb306e22ba97b1d6cd14bd96e0bf",
"score": "0.6024224",
"text": "def num_games win_condition\n total_games = 0\n @game_objects.each do |game|\n total_games += 1 if game_meets_win_cond?(win_condition, game)\n end \n total_games\n end",
"title": ""
},
{
"docid": "6a36e28571636c8cfb0dac7e359e7e12",
"score": "0.60172933",
"text": "def heuristic_score(state)\n pieces = state[:pieces]\n player = state[:player]\n total_value(pieces[player]) - total_value(pieces[opponent(player)])\n end",
"title": ""
},
{
"docid": "80e60073bf4ed564c986ba47fde234f7",
"score": "0.59969205",
"text": "def checkWinner(state, player1, player2)\n\n for i in 0..2\n\n row_candidate = true\n column_candidate = true\n\n for j in 1..2\n\n # check rows\n if state[i * 3 + j] == '0' || state[i * 3 + j] != state[i * 3 + j - 1] then\n row_candidate = false\n elsif row_candidate && state[i * 3 + j] == state[i * 3 + j - 1] then\n if j == 2 then\n winner = if state[i * 3 + j] == '1' then player1 else player2 end\n return winner\n end\n end\n\n # check columns\n if state[j * 3 + i] == '0' || state[j * 3 + i] != state[(j - 1) * 3 + i] then\n column_candidate = false\n elsif column_candidate && state[j * 3 + i] == state[(j - 1) * 3 + i] then\n if j == 2 then\n winner = if state[j * 3 + i] == '1' then player1 else player2 end\n return winner\n end\n end\n end\n end\n\n # check diagonals\n if state[0] == state[4] && state[4] == state[8] && state[0] != '0' then\n winner = if state[0] == '1' then player1 else player2 end\n return winner\n end\n\n if state[2] == state[4] && state[4] == state[6] && state[2] != '0' then\n winner = if state[2] == '1' then player1 else player2 end\n return winner\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "d65d997e5e8dac416f63ab1f0e030122",
"score": "0.5981852",
"text": "def did_player_win?\n if @players_1_turn\n did_mark_win?(PLAYERS_1_MARK)\n else\n did_mark_win?(PLAYERS_2_MARK)\n end\n end",
"title": ""
},
{
"docid": "308afecd430988722f1a648927ddd3d1",
"score": "0.5970367",
"text": "def winning?(cells, player)\r\n status = false\r\n if (cells[0] == player && cells[1] == player && cells[2] == player) ||\r\n (cells[3] == player && cells[4] == player && cells[5] == player) ||\r\n (cells[6] == player && cells[7] == player && cells[8] == player) ||\r\n (cells[0] == player && cells[3] == player && cells[6] == player) ||\r\n (cells[1] == player && cells[4] == player && cells[7] == player) ||\r\n (cells[2] == player && cells[5] == player && cells[8] == player) ||\r\n (cells[0] == player && cells[4] == player && cells[8] == player) ||\r\n (cells[2] == player && cells[4] == player && cells[6] == player)\r\n status = true\r\n end\r\n status\r\n end",
"title": ""
},
{
"docid": "74295792e32f57f42d2618a540d655a1",
"score": "0.59667325",
"text": "def check_for_winner\n \tcollect_winning_positions.each do |position| \t\t\n \t\tif position == \"OOO\"\n \t\t return 2 \t\t\n \t\telsif position == \"XXX\" \n \t return 1 \t\t \n \t\tend \t\n \tend\n \tcat_game? == true ? 0 : -1\n end",
"title": ""
},
{
"docid": "6d81d7361c39e7a70d7dbc872d9a7672",
"score": "0.59619075",
"text": "def check_outcome(player)\n case @board.status\n when 1\n puts \"*** #{player.name} Won Congratulations! ***\"\n 1\n when 0\n puts \"*** That's a tie ***\"\n 0\n else\n -1\n end\n end",
"title": ""
},
{
"docid": "8c547d7048930ce2979a2ed8ee648885",
"score": "0.5951108",
"text": "def match_won?\n if @sets_won == 3\n @match_won = 1\n @sets_won = 0\n @opponent.sets_won = 0\n end\n if @opponent.sets_won == 3\n @match_won = 1\n @sets_won = 0\n @opponent.sets_won = 0\n end\n end",
"title": ""
},
{
"docid": "9cd54c34e65f487b4d44616e03b9e74b",
"score": "0.5936129",
"text": "def game_over args, win_or_lose\n # keep track of whether you won or lost\n args.state.game_state = win_or_lose\nend",
"title": ""
},
{
"docid": "bb9637666a0232db396b32e1973959f1",
"score": "0.59294057",
"text": "def track_victory(winnerofturn) #algorythmic\n if winnerofturn == @Player1\n @win_counter[\"P1\"] += 1\n elsif winnerofturn == @Player2\n @win_counter[\"P2\"] += 1\n end\n end",
"title": ""
},
{
"docid": "ab3181d79fa28859fc4a9c9b022a3ec7",
"score": "0.59276795",
"text": "def num_points win_condition\n points = 0\n @game_objects.each do |game|\n points += game.score_osu game_meets_win_cond win_condition, game\n end\n points\n end",
"title": ""
},
{
"docid": "f9f6b68a212ec4fc3f3bc8e575f9fb02",
"score": "0.59187",
"text": "def update_record game\n @wins += 1 if game.game_result == 'W'\n @losses += 1 if game.game_result == 'L'\n @ties += 1 if game.game_result == 'T'\n end",
"title": ""
},
{
"docid": "50b61c033dd5db7a52f0ff93fbad8e34",
"score": "0.5912244",
"text": "def find_winner\n if @player_1.life == 0\n return 2\n end\n return 1\n end",
"title": ""
},
{
"docid": "39860c88ab6d62f8f1683f1fa0ef5488",
"score": "0.5900455",
"text": "def evaluate_winner\n\t\treturn 100 if win?(\"x\")\n\t\treturn -100 if win?(\"o\")\n\t\treturn 0 if blocked?\n\tend",
"title": ""
},
{
"docid": "52115ca5f8441db50b4ca20d73d37e7a",
"score": "0.5892456",
"text": "def round_over? \n\t\tplayers.one?{ |player| !player.folded? }\n\tend",
"title": ""
},
{
"docid": "92458e5f45ccafb9b46f02479981145b",
"score": "0.5891332",
"text": "def someone_won_round?\r\n !!winner\r\n end",
"title": ""
},
{
"docid": "239ccb9ba07045a59bce111f7176f626",
"score": "0.5881442",
"text": "def game_over?\n return @gamestate.checkmate?(@current_player.team)\n end",
"title": ""
},
{
"docid": "03b2224083756f9f28a70ab279de71a9",
"score": "0.58739555",
"text": "def is_game_over?\n @guesses_left == 0 ? true : false\n end",
"title": ""
},
{
"docid": "7f601d49f4ee22eb3fd0c9628d02c931",
"score": "0.58671623",
"text": "def check_if_won\n\t\tif @word_hidden == @answer_word\n\t\t\t@game_over = 1\n\t\tend\n\t\t@game_over\n\tend",
"title": ""
},
{
"docid": "88061cb68512b609434c6392d5a77e4e",
"score": "0.5865293",
"text": "def count_evaluate(player) # true for white player, false for black\n if player\n RState.hamming(@white_positions) - RState.hamming(@black_positions)\n else\n RState.hamming(@black_positions) - RState.hamming(@white_positions)\n end\n end",
"title": ""
},
{
"docid": "c5b8b097b53c869fe918059807a6b848",
"score": "0.5858902",
"text": "def wins\n n = self.find_board_size\n streaks = (row_streaks(n) + column_streaks(n) + diagonal_streaks(n))\n wins = streaks_to_wins(streaks, n, 0) + diagonal_wins(n)\n return wins\n end",
"title": ""
},
{
"docid": "df505f62651a5510c49cb0c4b509a266",
"score": "0.58559847",
"text": "def someone_has_won_5_games?(game_count)\n if game_count[:player_wins] >= WINNING_SCORE\n false\n elsif game_count[:dealer_wins] >= WINNING_SCORE\n false\n else\n true\n end\nend",
"title": ""
},
{
"docid": "d71bdd38d4cffe010fdbf85a3770a1d7",
"score": "0.5852564",
"text": "def over?\n won? || tied?\n end",
"title": ""
},
{
"docid": "af01dd7615c999a9d880f19e134ec00a",
"score": "0.5847122",
"text": "def check_win\n @win_vecs.each {|vec| return vec.winner if vec.winner != 0}\n return 0\n end",
"title": ""
},
{
"docid": "ef7987a2ad2b486560df62633b760129",
"score": "0.58336526",
"text": "def game_over?\n @game_over\n end",
"title": ""
},
{
"docid": "9681edc1bbaa81f8daf8beee8059ef50",
"score": "0.5823578",
"text": "def game_is_over?\n (won? || draw? || full?) ? true : false\n end",
"title": ""
},
{
"docid": "78ab20eb851c5283729e9c2a7844d01f",
"score": "0.58220905",
"text": "def earn_point(player)\n player ==1 ? @player_2_wins += 1 : @player_1_wins +=1\nend",
"title": ""
},
{
"docid": "146eb65329755c7ccba4146dff94789f",
"score": "0.5811598",
"text": "def won_match(player)\n if player.sets_won > 1 and player.opponent.sets_won < 1\n player.matches_won += 1\n start_new_match\n end\n end",
"title": ""
},
{
"docid": "92024a9afb41d2946b1566d6f5b70969",
"score": "0.58008367",
"text": "def is_win(x, y, player)\n create_pivot_vectors(x, y)\n\n # TODO: parameter key not used (fix)\n @moves.each do |key, array|\n win3 = 0\n array.each do |key, val|\n if val == player\n win3 += 1\n return true if win3 == @win_with\n else\n win3 = 0\n end\n end\n end\n false\n end",
"title": ""
},
{
"docid": "9d65e4000d19b4a080feabf3ab9ddd99",
"score": "0.5799469",
"text": "def game_over\n return :winner if winner?\n return :draw if draw?\n false\n end",
"title": ""
},
{
"docid": "15a3e6fb9b861a172917ba9f32348241",
"score": "0.5798",
"text": "def givepoints \n x = comparison(@player_choice, @opponent_choice)\n if x == -1\n @player_score += 1\n elsif x == 0\n @player_score += 0\n @opponent_score += 0\n elsif x == 1\n @opponent_score += 1\n end \n return x\n end",
"title": ""
},
{
"docid": "3c3604c47d10f7a9dc7bfb8935aa63d0",
"score": "0.57966703",
"text": "def wins_point(winner)\n \n if winner == @player1\n @player1.record_won_ball!\n @score_counter += 1\n return @player1.points\n else\n @player2.record_won_ball!\n @score_counter += 1\n return @player2.points\n end\n # TODO: Think it's gross to pass an integer instead of a player object?\n # Then reimplement this method!\n end",
"title": ""
},
{
"docid": "d7931aa7310827df1b2ea4e5675e9bf6",
"score": "0.57933015",
"text": "def winner_count\n end",
"title": ""
},
{
"docid": "0a3a80e2a50959f6341ec5c686eaced1",
"score": "0.57889944",
"text": "def over?\n self.player.points == self.board.total_points\n end",
"title": ""
},
{
"docid": "ac114a1298df2c90181e6b85a69a4c6a",
"score": "0.5786197",
"text": "def game_over?\n losing_players != nil ? true: false\n end",
"title": ""
},
{
"docid": "4d443b3ce72445d70402f79f28e8d7e3",
"score": "0.57830656",
"text": "def won?\n WIN_COMBINATIONS.each do |triple|\n if(winning?(triple))\n return triple\n end\n end\n return false\n end",
"title": ""
},
{
"docid": "6b137354816820a131c8b3824ca2ca54",
"score": "0.57818514",
"text": "def finished?\n symbols_count = PLAYER_SYMBOLS.map{|s| board_state.count(s)}.inject(&:+)\n symbols_count == 9 || !winner.nil?\n end",
"title": ""
},
{
"docid": "db0cd93aabc07713e0fde92ddf1bc5f3",
"score": "0.57801783",
"text": "def game_state\n if @game_state.nil?\n @game_state = GameState.new(@player_count,@mode, 6, 7)\n end\n @game_state\n end",
"title": ""
},
{
"docid": "9c76a5d2fd1d2b8794ef85667d4120e3",
"score": "0.57796866",
"text": "def did_player_win\n (@purses[@current_player] != 6)\n end",
"title": ""
},
{
"docid": "48d3d4947b80a5b31285e473828614c6",
"score": "0.577963",
"text": "def turn_count #counts occupied positions!\n turn = 0 #start at position 0.\n @board.each do |index| #iterating through each spot on the board. Is it occupied?\n if index == \"X\" || index == \"O\" #if there is an X or O in that spot,\n turn += 1 #then you must turn!\n end\n end\n return turn #if there is not an X or O in that spot, take your turn and put your X or O there.\nend",
"title": ""
},
{
"docid": "323155dc21903aefee3a8977c85420b9",
"score": "0.5772052",
"text": "def declare_winner(bot_move, player_move)\n\t\treturn 0 if bot_move == player_move\n\n\t\tif bot_move == :r && player_move == :p\n\t\t\t1\n\t\telse\n\t\t\t-1\n\t\tend\n\n\t\tif bot_move == :p && player_move == :s\n\t\t\t1\n\t\telse\n\t\t\t-1\n\t\tend\n\n\t\tif bot_move == :s && player_move == :r\n\t\t\t1\n\t\telse\n\t\t\t-1\n\t\tend\n\tend",
"title": ""
},
{
"docid": "fc1754bf712893d6f921690b4bacd48a",
"score": "0.5771947",
"text": "def gameover?\n full? or not check_winner.nil?\n end",
"title": ""
}
] |
63fb026aa965069c98aa6bebbc0f32c5
|
Argument: A 2 dimensional array representing an M N matrix Side effects: None Return: None Edge cases: rotate90([[]]) == [] rotate90([[1, 2, 3, 4]]) == [[4], [3], [2], [1]] rotate90([1],[2],[3],[4]) == [[4, 3, 2, 1] Algorithm: matrix <= argument There are M rows and N columns in matrix rotated_matrix = [] Go through each column: add each element starting at bottom into an array. Then place that array as a 'row' into rotated_matrix Return rotated matrix
|
[
{
"docid": "78d3eca440a09047b4f48dcb3de6acdb",
"score": "0.84194565",
"text": "def rotate90(matrix)\n number_of_rows = matrix.size\n number_of_columns = matrix.first.size\n rotated_matrix = []\n \n number_of_columns.times do |column_number|\n new_row = []\n (number_of_rows - 1).downto(0) do |row_number|\n new_row << matrix[row_number][column_number]\n end\n rotated_matrix << new_row \n end\n \n rotated_matrix\nend",
"title": ""
}
] |
[
{
"docid": "93d08018de16a23b5c9b249f8a3d3776",
"score": "0.837677",
"text": "def rotate90(matrix)\n columns = matrix.size\n rows = matrix.first.size\n r_row = []\n r_matrix = []\n\n 0.upto(matrix.first.size - 1) do |y|\n r_row = []\n 0.upto(matrix.size - 1) do |x|\n r_row << matrix[x][y]\n end\n r_matrix << r_row.reverse\n end\n r_matrix\nend",
"title": ""
},
{
"docid": "37931f127d99fee0c781fe7f1c6c4e81",
"score": "0.8361061",
"text": "def rotate90(matrix)\n rotated = []\n row_idx = 0\n until row_idx == matrix.first.size\n new_row = []\n matrix.reverse_each { |row| new_row << row[row_idx] }\n rotated << new_row\n row_idx += 1\n end\n rotated\nend",
"title": ""
},
{
"docid": "a5272f68e50b9c83c43b572dc02acb75",
"score": "0.8303191",
"text": "def rotate90(matrix)\n new_matrix = []\n \n # determine number of columns, that is new number of rows, and vice versa\n 0.upto(matrix[0].length - 1) {|row|\n new_row = []\n (matrix.length - 1).downto(0) {|col|\n new_row << matrix[col][row]\n }\n new_matrix << new_row\n }\n new_matrix\nend",
"title": ""
},
{
"docid": "d92a28b0a9c97e2d6f746da7694b338a",
"score": "0.82240266",
"text": "def rotate90(array)\n matrix_width = array[0].size\n matrix_height = array.size\n new_matrix_width = matrix_height\n new_matrix_height = matrix_width\n results_array = []\n m = 0\n\n new_matrix_height.times do \n results = []\n n = -1\n \n array.count.times do \n results << array[n][m]\n n -=1\n end\n\n results_array << results\n m += 1\n end\n\n results_array\nend",
"title": ""
},
{
"docid": "212659884a448b81a7a541466abdb6ef",
"score": "0.82216156",
"text": "def rotate(matrix)\n rotated_by_90 = []\n matrix.transpose.each {|row| rotated_by_90 << row.reverse}\n rotated_by_90\nend",
"title": ""
},
{
"docid": "b886c0a8e171258e5968ebe5198fcfd1",
"score": "0.81971645",
"text": "def rotateMatrix(matrix)\n res = []\n matrix.each_with_index do |row, i|\n row.each_with_index do |_item, j|\n res[j] = [] unless res[j]\n res[j][matrix.length - 1 - i] = matrix[i][j]\n end\n end\n res\nend",
"title": ""
},
{
"docid": "c2fde164a6c94e3c2a5eee49374d456b",
"score": "0.8152064",
"text": "def rotate90(matrix)\n new_array = []\n matrix.first.length.times { new_array << [] }\n matrix.reverse.each do |arr|\n arr.each_with_index { |e, i| new_array[i] << e }\n end\n new_array\nend",
"title": ""
},
{
"docid": "6e22b7d527551d054648fbbc8c31667f",
"score": "0.81392",
"text": "def rotate90(matrix)\n new_matrix = Array.new(matrix[0].size) {Array.new}\n matrix.reverse_each.with_index do |ar, new_col|\n ar.each_index do |new_row|\n new_matrix[new_row][new_col] = ar[new_row]\n end\n end\n new_matrix\nend",
"title": ""
},
{
"docid": "61a60e984679e4697915c35e297dc79c",
"score": "0.8121319",
"text": "def rotate_by_90(matrix)\n\tmatrix_rotated = []\n\tcolumn_index = matrix.size - 1\n\twhile column_index >= 0\n\t\trow = []\n\t\t(0..matrix.size - 1).each do |row_index|\n\t\t\trow << matrix[row_index][column_index]\n\t\tend\n\t\tmatrix_rotated << row\n\t\tcolumn_index -= 1\n\tend\n\tmatrix_rotated\nend",
"title": ""
},
{
"docid": "2d5037af090895ad61d6e2fc744c349d",
"score": "0.80946195",
"text": "def rotate(matrix)\n limit = matrix.length / 2\n limit -= 1 if matrix.length.odd?\n m = matrix.length - 1\n (0..limit).each do |i|\n (i..m - 1 - i).each do |j|\n matrix[i][j], matrix[m - j][i], matrix[m - i][m - j], matrix[j][m - i] = matrix[m - j][i], matrix[m - i][m - j], matrix[j][m - i], matrix[i][j]\n end\n end\n nil\nend",
"title": ""
},
{
"docid": "28a2fd561801d5690cb9f00a125aa0a5",
"score": "0.80939525",
"text": "def rotate(matrix)\n length = matrix.length\n rotated_matrix = Array.new(length) { Array.new(length) { nil } }\n\n matrix.each_with_index do |row, i|\n row.each_with_index do |_col, j|\n rotated_matrix[length - 1 - j][i] = matrix[i][j]\n end\n end\n\n rotated_matrix\n end",
"title": ""
},
{
"docid": "a9712e7d89090d1af837b5db96c5f044",
"score": "0.8060237",
"text": "def rotate90(matrix)\n\ttransposed_array = []\n\ttemp_array = []\n\tcounter = 0\n\tloop do\n\t\tmatrix.reverse_each do |array|\n\t\t\ttemp_array.push(array[counter])\n\t\tend\n\t\ttransposed_array.push(temp_array)\n\t\ttemp_array = []\n\t\tcounter += 1\n\t\tbreak if counter == matrix[0].length\n\tend\n\tp transposed_array\nend",
"title": ""
},
{
"docid": "3068988ed7bfdae094963bcc5e2d03c8",
"score": "0.80226266",
"text": "def rotate_matrix(matrix)\n \nend",
"title": ""
},
{
"docid": "74ef785cd819b80df9e79166585f63b0",
"score": "0.7999509",
"text": "def rotate90(matrix_input)\n input_column = 0\n input_row = 0\n return_column = matrix_input.length - 1\n matrix2 = Array.new(matrix_input[0].size){Array.new(matrix_input.size)}\n loop do\n loop do\n matrix2[input_column][return_column] = matrix_input[input_row][input_column]\n input_column += 1\n break if input_column > matrix_input[0].size - 1\n end\n input_row += 1\n input_column = 0\n return_column -= 1\n break if input_row > matrix_input.length - 1\n end\n matrix2\nend",
"title": ""
},
{
"docid": "41dd1be24ceeaffc6cc4560d14362ce5",
"score": "0.79963464",
"text": "def make_rotated(matrix)\n matrix_size = matrix.length - 1\n new_matrix = Array.new(matrix.length) { Array.new }\n (0..matrix_size).each do |row|\n (0..matrix_size).each do |col|\n new_matrix[col] << matrix[row][col]\n end\n end\n new_matrix\nend",
"title": ""
},
{
"docid": "d74267c4f6aa0388d3443622201dcb1f",
"score": "0.7992429",
"text": "def rotate_matrix mtr\n # mtr is an array or arrays\n n = mtr.size\n ans = []\n n.times { ans << [] }\n\n mtr.each_with_index do |row, i|\n row.each_with_index do |num, j|\n ans[j][n-i-1] = num\n end\n end\n\n return ans\nend",
"title": ""
},
{
"docid": "a51430672291278a78a7674f5f86ccc9",
"score": "0.79798055",
"text": "def rotate_matrix\n len = @matrix.length - 1\n new_matrix = Array.new(len + 1) { Array.new(len + 1) }\n 0.upto(len) do |col|\n len.downto(0) do |row|\n new_matrix[col][len - row] = @matrix[row][col]\n end\n end\n Matrix.new new_matrix\n end",
"title": ""
},
{
"docid": "a672964d75c4af995ad79bf24e9ce482",
"score": "0.7977731",
"text": "def rotate_matrix(array_of_arrays) #rotate 90 degrees clockwise\n array_of_arrays.transpose.map(&:reverse)\nend",
"title": ""
},
{
"docid": "8e316ff8c115f0686ee7a6f39d8d75c5",
"score": "0.79765004",
"text": "def rotate90(matrix)\n rows = []\n row_size = matrix[0].size # new row size is old column size\n row_size.times do |row|\n rows[row] = matrix.map { |old_column| old_column[row] }.reverse\n end\n rows\nend",
"title": ""
},
{
"docid": "55f951063241d1840042b2c94e434cf9",
"score": "0.7962812",
"text": "def rotate_matrix(matrix)\n new_arr = Array.new(matrix.length, [])\n matrix.each_with_index do |row, row_idx|\n row.each_with_index do |element, ele_idx|\n new_idx = matrix.length - 1 - row_idx\n new_arr[ele_idx][new_idx] = element\n end\n end\n new_arr\nend",
"title": ""
},
{
"docid": "807f21f7837c39af14e88cc1c5998802",
"score": "0.79570067",
"text": "def rotate_matrix(matrix)\n arr = []\n matrix.length.times do |i|\n sub = []\n\n matrix.each do |array|\n sub << array[i]\n end\n\n arr << sub.reverse\n end\n arr\nend",
"title": ""
},
{
"docid": "807f21f7837c39af14e88cc1c5998802",
"score": "0.79570067",
"text": "def rotate_matrix(matrix)\n arr = []\n matrix.length.times do |i|\n sub = []\n\n matrix.each do |array|\n sub << array[i]\n end\n\n arr << sub.reverse\n end\n arr\nend",
"title": ""
},
{
"docid": "6d407d86780e9c010d6290af7950f7dc",
"score": "0.79466456",
"text": "def rotate_matrix(matrix)\n rotated = []\n matrix.length.times do\n rotated << []\n end\n matrix.each_with_index do |row,i|\n row.each_with_index do |square,j|\n rotated_x = row.length - 1 - j\n rotated_y = i\n rotated[rotated_x][rotated_y] = matrix[i][j]\n end\n end\n rotated\nend",
"title": ""
},
{
"docid": "5bff53cc168e46d6571d90cab177018e",
"score": "0.7924632",
"text": "def rotate90(matrix)\n matrix.each_with_object([]) do |arr, new_matrix|\n arr.each_with_index do |value, index|\n new_matrix.fetch(index) rescue new_matrix << []\n new_matrix[index].unshift(value)\n end\n end\nend",
"title": ""
},
{
"docid": "8c78640891abc72a1b4fb843b512a2d0",
"score": "0.7904654",
"text": "def rotate_2(matrix)\n len = matrix.length\n return matrix if len < 1\n rotated_matrix = Array.new(matrix[0].length) {Array.new(len)}\n matrix.each_with_index do |row, row_index|\n row.each_with_index do |col, col_index|\n rotated_matrix[row_index][col_index] = matrix[len - col_index - 1][row_index]\n end\n end\n rotated_matrix\nend",
"title": ""
},
{
"docid": "6932e10b88593461940aed50ed8fe7a6",
"score": "0.7803807",
"text": "def rotate_matrix(matrix)\n return matrix if matrix.length == 1\n\n (matrix.length / 2.0).ceil.times do |layer|\n rotate_layer(matrix, layer)\n end\n matrix\nend",
"title": ""
},
{
"docid": "c97fe89c3c2d495b871ad325e26fd422",
"score": "0.7760771",
"text": "def rotate90(matrix)\n matrix.transpose.map(&:reverse)\nend",
"title": ""
},
{
"docid": "83107e45e6233b0a083a4b290edf46ad",
"score": "0.7743662",
"text": "def clockwise_rotate(matrix)\n result = []\n\n (0 ... matrix[0].size).each do |i|\n row = []\n\n (matrix.size - 1).downto(0) do |j|\n row << matrix[j][i]\n end\n\n result << row\n end\n\n result\nend",
"title": ""
},
{
"docid": "2865e45ffee82b1b84341b7acdd6e165",
"score": "0.77229667",
"text": "def rotate_by_90_in_place(matrix)\n\tn = matrix.size\n\t# rotation must be done n/2 times = number of layers\n\t(0..((n / 2) - 1)).each do |layer| # this loop goes diagnolly\n\t\t(layer..n - 2 - layer).each do |row_index| \t# this loop goes across elements in the column\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# you don't have to go till n -1 since last elemnt already done cyclically\n\t\t\tmatrix = run_element_replacement(matrix, row_index, layer)\n\t\tend\n end\n matrix\nend",
"title": ""
},
{
"docid": "b7db6b2e06508e810e7b5711ab90a1eb",
"score": "0.77109814",
"text": "def rotate(matrix)\n matrix.replace(matrix.reverse.transpose)\nend",
"title": ""
},
{
"docid": "0558b8793dad9908249c9225144fbd40",
"score": "0.76891106",
"text": "def rotate_matrix(matrix)\n n = matrix.length\n \n (n / 2).times do |j|\n (j..n-2-j).each do |i|\n top = matrix[j][i]\n matrix[j][i] = matrix[n-1-i][j] # copy left half into top half\n matrix[n-1-i][j] = matrix[n-1-j][n-1-i] # bottom to left\n matrix[n-1-j][n-1-i] = matrix[i][n-1-j] # right to bottom\n matrix[i][n-1-j] = top # top to right\n end\n end\n\n return matrix\nend",
"title": ""
},
{
"docid": "71a897f6f7a9b52816d2122132feb712",
"score": "0.7634474",
"text": "def rotate(matrix)\n p matrix.reverse.transpose\nend",
"title": ""
},
{
"docid": "db2c9975f488347e43dac6d2f73efdf5",
"score": "0.761959",
"text": "def rotate_matrix(mat)\n mat.reverse!\n mat.transpose\nend",
"title": ""
},
{
"docid": "5a26bf6ac4ff5da3a46e7a1c39f0e4f9",
"score": "0.7610933",
"text": "def rotate_matrix(data)\n new_data = []\n row_size = data.size\n column_size = data[0].size\n \n (0...column_size).each do |i|\n tmp = []\n (0...row_size).each do |j|\n tmp << data[j][i]\n end\n new_data << tmp\n end\n new_data\nend",
"title": ""
},
{
"docid": "db3143b93916758d66c2b3aaac101fe9",
"score": "0.75900763",
"text": "def rotate(matrix)\n n = matrix.length\n ans = Array.new(n){Array.new(n,0)}\n for i in 0...n do\n for j in 0...n do\n ans[i][j] = matrix[n-1-j][i]\n end\n end\n for i in 0...n do\n for j in 0...n do\n matrix[i][j] = ans[i][j]\n end\n end\n return nil\nend",
"title": ""
},
{
"docid": "7d3509cd16bfc6db6d7a23601e07c101",
"score": "0.75865406",
"text": "def rotate_matrix(matrix)\n n = matrix.size-1\n for layer in 0..n/2\n first = layer\n last = n-1-layer\n for i in first..last\n offset = i - first\n tmp = matrix[first][i]\n matrix[first][i] = matrix[last-offset][first]\n matrix[last-offset][first] = matrix[last][last]\n end\n end \nend",
"title": ""
},
{
"docid": "927f79bcd36473e409937ce00575a91a",
"score": "0.7558244",
"text": "def rotate_matrix(matrix)\n n = matrix.length\n\n (n/2).times do |layer|\n final = n - layer - 1\n (layer..final-1).each do |i|\n offset = i - layer\n # save top\n top = matrix[layer][i]\n # left to top\n matrix[layer][i] = matrix[final - offset][layer]\n # bottom to left\n matrix[final - offset][layer] = matrix[final][final - offset]\n # right to bottom\n matrix[final][final - offset] = matrix[i][final]\n # top to right\n matrix[i][final] = top\n end\n end\n\n return matrix\nend",
"title": ""
},
{
"docid": "30dc40119dabf006e905c006f758f38b",
"score": "0.7535711",
"text": "def rotate_matrix(matrix)\n n = matrix.length\n\n (n/2).times do |layer|\n final = n - 1 - layer\n\n (layer..final-1).each do |i|\n offset = i - layer\n\n # Saving the top layer\n top = matrix[layer][i]\n\n # Left to top\n matrix[layer][i] = matrix[final - offset][layer]\n \n # Bottom to left\n matrix[final - offset][layer] = matrix[final][final - offset]\n\n # Right to bottom\n matrix[final][final - offset] = matrix[i][final]\n\n # Top to right\n matrix[i][final] = top\n end\n end\n\n return matrix\nend",
"title": ""
},
{
"docid": "802606fd108266a3a4653299a0fac9d7",
"score": "0.7517328",
"text": "def rotateMatrix(matrix)\n edge = matrix.length - 1\n pix = nil # p is pixel to be moved\n toRow = nil # new row\n toCol= nil # new col\n i = 0\n while(i < matrix.length - 1)\n j = 0\n row = 0\n col = i\n temp = nil# holds replaced pixel\n while (j < 4)\n pix = temp === nil ? matrix[row][col] : temp # first move or continued\n toRow = col; # columns turn to rows,\n toCol = edge - row; # rows become columns caluclated by lengt of row - row index\n temp = matrix[toRow][toCol]\n matrix[toRow][toCol] = pix\n row = toRow\n col = toCol\n j+=1\n end\n i+=1\n end\n return matrix\nend",
"title": ""
},
{
"docid": "c7c063cb998fd0b0f8f8e9d7feb05b14",
"score": "0.7488095",
"text": "def rotate_90_deg_left!(matrix)\n transposed_matrix = matrix.transpose\n raise IndexError.new('Given matrix is not a square matrix') if transposed_matrix.length != matrix.length\n transposed_matrix.reverse\nend",
"title": ""
},
{
"docid": "fc7dd690f0d4769760f797df4949c604",
"score": "0.7441209",
"text": "def rotate_matrix_in_place\n # We only need to loop over 1/4th of the numbers because rotate_position rotates all four numbers.\n\n # Because the matrix is rotating in place, only go over the first half of the rows.\n # The second half will be rotated by rotate_position as we rotate the first half. \n (@matrix.length / 2).floor.times do |row|\n # The number of columns to rotate per row number is equal to N - 1 - (2 * row_number).\n # Each column gets offset by how many row's we've seen because the numbers in the left most columns\n # have already been rotated by previous iterations\n (@matrix.length - 1 - 2 * row).times do |num_cols|\n offset = row\n rotate_position(row, offset + num_cols)\n end\n end\n self\n end",
"title": ""
},
{
"docid": "2a980dccc469fefe82e59814b13ffe65",
"score": "0.7424742",
"text": "def rotate_matrix(matrix, direction)\n if direction == 'clockwise'\n rotate_cw(matrix)\n else\n rotate_countercw(matrix)\n end\nend",
"title": ""
},
{
"docid": "0152a5be474b0b63d6858e1e02f7054a",
"score": "0.74095654",
"text": "def matrixRotation(matrix, r)\n resultMatrix = Array.new($m) { |_| Array.new($n) }\n\n (0..$m-1).each do |row|\n (0..$n-1).each do |col|\n x,y = computeOffset col, row, r\n puts [matrix[row][col], row, col, y, x].inspect\n resultMatrix[y][x] = matrix[row][col]\n end\n end\n\n printMatrix resultMatrix\nend",
"title": ""
},
{
"docid": "a6849d8407c8606ab880bc8b64f52768",
"score": "0.74074733",
"text": "def rotate(matrix)\n size = matrix.size\n max_index = size - 1\n\n # Flip diagonal\n size.times do |i| # O(n*n)\n (i..max_index).each do |j|\n matrix[i][j], matrix[j][i] = matrix[j][i], matrix[i][j]\n end\n end\n\n pp matrix\n\n # Flip horizontal\n size.times do |i|\n (size / 2).times do |j|\n matrix[i][j], matrix[i][max_index - j] = matrix[i][max_index - j], matrix[i][j]\n end\n end\nend",
"title": ""
},
{
"docid": "68716fa13d9e3fb64158f3f2ecc75a3e",
"score": "0.73857796",
"text": "def rotate matrix, direction\n direction == 'counter-clockwise' ? matrix.transpose.reverse : matrix.transpose.map(&:reverse)\nend",
"title": ""
},
{
"docid": "b2cf039562e6dd68a038adc78207d69c",
"score": "0.7357595",
"text": "def rotate( matrix )\n t = Marshal.load( Marshal.dump( self ) )\n t.rotate!( matrix )\n return t\n end",
"title": ""
},
{
"docid": "71a02692ee2480513babb9d62fcb5369",
"score": "0.7335293",
"text": "def rotate90(array)\n result = []\n (0...array[0].size).each do |sub_array|\n new_line = []\n (0...array.size).each do |index|\n new_line.unshift(array[index][sub_array])\n end\n result << new_line\n end\n result\nend",
"title": ""
},
{
"docid": "60c74b533e8ada0c9af1aca02bcd7df0",
"score": "0.7313111",
"text": "def rotate_matrix matrix, direction\n return clockwise(matrix) if direction == \"clockwise\"\n return counter_clockwise(matrix) if direction == \"counter-clockwise\"\nend",
"title": ""
},
{
"docid": "89531acf96e893ec2f19f34eb95a82e0",
"score": "0.7306695",
"text": "def rotate_matrix(old_matrix)\n new_matrix = old_matrix.map(&:dup)\n old_matrix.each_with_index do |line, line_i|\n line.each_with_index do |el, el_i|\n new_matrix[el_i][-(line_i + 1)] = el\n end\n end\n new_matrix\nend",
"title": ""
},
{
"docid": "ad11393e4af714aeb150b959ad956451",
"score": "0.7291813",
"text": "def rotate(matrix)\n n = matrix.length\n (0..(n / 2) - 1).each do |layer|\n last = (n - 1) - layer\n (layer..last - 1).each do |i|\n offset = i - layer\n top = matrix[layer][i]\n # left -> top\n matrix[layer][i] = matrix[last - offset][layer]\n # bottom -> left\n matrix[last - offset][layer] = matrix[last][last - offset]\n # right -> bottom\n matrix[last][last - offset] = matrix[i][last]\n # top -> right\n matrix[i][last] = top # matrix[last - offset][layer]\n end\n end\n matrix\nend",
"title": ""
},
{
"docid": "8a40ceaaef449d84aa92c9b03bcb337a",
"score": "0.7276637",
"text": "def rotate_matrix(matrix_str)\n matrix = matrix_str.split(\"\\n\").collect{|row| row.split(\" \")}\n no_rows = matrix.length\n no_columns = matrix.first.length\n rotated_matrix = []\n (1..no_columns).each do |i|\n rotated_matrix.push(matrix.collect{|row| row[no_columns - i]})\n end\n return rotated_matrix.collect{|row| row.join(\" \")}.join(\"\\n\")\nend",
"title": ""
},
{
"docid": "59f875aa86b7ab0d4ee993cc05710cf2",
"score": "0.7224106",
"text": "def rotateClockwise(matrix)\n # Transpose the matrix and reverse each individual array\n return matrix.transpose.map! { |array| array.reverse! }\nend",
"title": ""
},
{
"docid": "b10f5a7656ea4914f55d854145ac0815",
"score": "0.7199641",
"text": "def rotate_matrix_r_p mtr\n # mtr is an array of arrays\n n = mtr.size - 1\nend",
"title": ""
},
{
"docid": "0a3c23cfe638a7eb3d5b248b6253c39a",
"score": "0.71778476",
"text": "def rotate_matrix(arr)\n \n idx1 = 0\n\n while idx1 < arr.size / 2\n idx2 = idx1\n last = arr.size - idx1 - 1 \n while idx2 < last\n offset = idx1 - idx2\n top = arr[idx1][idx2]\n arr[idx1][idx2] = arr[last - offset][idx1]\n\n idx2 += 2\n end\n idx1 += 1\n end\nend",
"title": ""
},
{
"docid": "bf3f7d448b8f87578fbcbd5a76f17dba",
"score": "0.7171222",
"text": "def rotate_degrees(matrix, degrees)\n return puts\"Not a valid degree: #{degrees}\" unless degrees % 90 == 0\n n = degrees / 90\n return matrrix if n == 4 || n == 0\n temp = matrix\n result = nil\n n.times do |_|\n result = rotate90(temp)\n temp = result\n end\n result\nend",
"title": ""
},
{
"docid": "9e521149a859dc8ca9b6dbf51eb64eec",
"score": "0.71062094",
"text": "def rotate90(arr)\n col_size = arr.size # the number of rows in the original array\n row_size = arr[0].size # the number of cols in the original array\n new_arr = Array.new(row_size) { Array.new(col_size) } # creates a nil-filled row_size by col_size array\n # p new_arr\n arr.each_with_index do |sub_arr, row|\n sub_arr.each_index do |col|\n # sub_arr.each_with_index do |value, col|\n # p \"#{sub_arr}, #{row}, #{value}, #{col}\"\n # new_arr[row_size - 1 - col][row] = sub_arr[col] # rotates -90deg\n new_arr[col][col_size - 1 - row] = sub_arr[col] # rotates +90deg\n end\n end\n new_arr\nend",
"title": ""
},
{
"docid": "fb87f99306c4c24a62f5f60dc0ea0637",
"score": "0.709353",
"text": "def rotate90(array)\n result_arrays = []\n (array[0].size).times { result_arrays << [] }\n (0...array[0].size).each do |index|\n array.each do |array|\n result_arrays[index] << array[index]\n end\n end\n result_arrays.map { |array| array.reverse }\nend",
"title": ""
},
{
"docid": "2930d15596716a3a4e61c92ac30f2da0",
"score": "0.70598066",
"text": "def rotate(matrix)\n width = matrix.length\n transform = Hash.new\n\n width.times do |y|\n width.times do |x|\n transform[[x, width-1-y]] = matrix[y][x]\n end\n end\n\n transform\nend",
"title": ""
},
{
"docid": "3b9a4020113918c7a8c12b0752681e2c",
"score": "0.7046556",
"text": "def rotateMatrix(mat)\n n = mat.size\n # Consider all squares one by one \n 0.upto(n/2) do |x|\n \n # Consider elements in group \n # of 4 in current square \n x.upto(n-x-1) do |y|\n \n # store current cell in temp variable \n temp = mat[x][y] \n\n # move values from right to top \n mat[x][y] = mat[y][n-1-x]\n\n # move values from bottom to right \n mat[y][n-1-x] = mat[n-1-x][n-1-y] \n\n # move values from left to bottom \n mat[n-1-x][n-1-y] = mat[n-1-y][x] \n\n # assign temp to left \n mat[n-1-y][x] = temp \n end\n end\n mat\nend",
"title": ""
},
{
"docid": "b6dd90a72966ec2b40c16e54ddced14e",
"score": "0.7032529",
"text": "def rotate_left(arr)\n mirror_board_horizontal(arr).transpose\nend",
"title": ""
},
{
"docid": "4be34e33ff59c3ebf7e41c897ddbd0de",
"score": "0.69066316",
"text": "def rotate_array arr\n result = [] \n row = []\n \n (0..arr[0].size-1).each do |y|\n (0..arr.size-1).each do |x|\n row.push arr[x][y]\n end\n result.push row\n row = []\n end \n result.reverse\nend",
"title": ""
},
{
"docid": "2dd7d76db3c85a37bd07dc8058200051",
"score": "0.6890501",
"text": "def my_rotate(arr)\n row_length = arr.length\n col_length = arr[0].length\n ans = []\n (0...col_length).each do |col|\n ans[col] ||= []\n (0...row_length).each do |row|\n new_row = col_length - col - 1\n ans[col] << arr[row][new_row]\n end\n end\n ans\nend",
"title": ""
},
{
"docid": "d5917e639d78fda154b1fb4a389b516f",
"score": "0.68806195",
"text": "def my_transpose(matrix)\n transpose = []\n 0.upto(matrix[0].length - 1) do |c|\n row = []\n matrix.each do |r|\n row << r[c]\n end\n transpose << row\n end\n transpose\nend",
"title": ""
},
{
"docid": "9015d5ca8a060ba9b57716f468223291",
"score": "0.68674785",
"text": "def rotate_3(matrix)\n len = matrix.length\n layer = 0\n while layer < len / 2\n first_column_layer = layer\n last_column_layer = len - layer - 1\n\n # Iterate from first_column_layer to last_column_layer\n col = first_column_layer\n while col < last_column_layer\n offset = col - first_column_layer\n top = matrix[first_column_layer][col]\n # move the value from bottom left to top\n matrix[first_column_layer][col] = matrix[last_column_layer - offset][first_column_layer]\n #\n matrix[last_column_layer - offset][first_column_layer] = matrix[last_column_layer][last_column_layer - offset]\n\n matrix[last_column_layer][last_column_layer - offset] = matrix[col][last_column_layer]\n\n matrix[col][last_column_layer] = top\n\n col += 1\n end\n layer += 1\n end\n matrix\nend",
"title": ""
},
{
"docid": "775466a815ed877dd38f0f86eb2eeced",
"score": "0.6839019",
"text": "def rotate_90_in_place(array)\n print_array(array)\n process(array, 0, array.length-1, array[0][array.length-1])\n print_array(array)\nend",
"title": ""
},
{
"docid": "9feeaca8078d636fa01e4f822486b6b9",
"score": "0.6822969",
"text": "def rotate_matrix(image_matrix,n)\n mid = n/2\n for layer in 0...mid\n first = layer\n last = n-layer-1\n for i in first...last\n offset = i - first\n temp = image_matrix[first][i]\n # left to top\n image_matrix[first][i] = image_matrix[last-offset][first]\n # top to right\n image_matrix[last-offset][first] = image_matrix[last][last - offset];\n # right to bottom\n image_matrix[last][last - offset] = image_matrix[i][last];\n # bottom to left\n image_matrix[i][last] = temp\n end\n end\n p image_matrix\nend",
"title": ""
},
{
"docid": "5de888697813aee8cd9bb98daed7d3fb",
"score": "0.68056583",
"text": "def transpose(matrix)\n p new_matrix_array_num = matrix[0].length\n p new_matrix_array_length = matrix.length\n\n new_matrix = []\n (1..new_matrix_array_num).each { |x| new_matrix << [] }\n\n (0.upto(new_matrix_array_num - 1)).each do |old_index|\n ((matrix.length - 1).downto(0)).each do |old_array|\n new_matrix[old_index] << matrix[old_array][old_index]\n end\n end\n new_matrix\nend",
"title": ""
},
{
"docid": "d1fd8bd3c8a7e3d3ddb2e9e7e4c3ff8c",
"score": "0.68051004",
"text": "def transpose(matrix)\n matr = clone_matrix(matrix)\n mat = []\n 0.upto(matr[0].length - 1) do |e|\n row = []\n matr.each do |r|\n row << r[e]\n end\n mat << row\n end\n return mat\nend",
"title": ""
},
{
"docid": "fd545107dda1573f1b7501ad761b8b83",
"score": "0.6797003",
"text": "def rotateImage(a)\n count = 0\n new_image = Array.new(a.size){ Array.new(a.size)}\n \n a.reverse_each do |row|\n row.each_with_index do |col, index|\n new_image[index][count] = col\n end\n count += 1\n end\n\n puts \"Matrix #{new_image}\"\nend",
"title": ""
},
{
"docid": "3e487fba51b1882686725736b6157c87",
"score": "0.67748266",
"text": "def rotate_90(grid)\n rot_grid = grid.dup.map(&:dup)\n grid.length.each do |i|\n grid.length.each do |j|\n rot_grid[i][j] = grid[j][i]\n end\n end\n rot_grid\nend",
"title": ""
},
{
"docid": "40bef32452194db7ef6d4fd118320bf4",
"score": "0.6763734",
"text": "def get_mtx_rotated_90 mtx_in, h_original, w_original\n h_out = w_original\n w_out = h_original\n \n out = Array.new(h_out) { Array.new(w_out) { 0 } }\n\n mtx_in.each_with_index do |row_in, i|\n col_out = w_out - 1 - i\n\n row_in.each_with_index do |cell_in, j|\n out[j][col_out] = cell_in\n end\n end\n\n return out\nend",
"title": ""
},
{
"docid": "12f83735ad1a20fcb6693c724cf24209",
"score": "0.6762683",
"text": "def rotate180(matrix)\n matrix.reverse.map(&:reverse)\nend",
"title": ""
},
{
"docid": "7d14d30cc1a417aada6d090ae827b936",
"score": "0.6734323",
"text": "def rotate1(input_array)\n # TODO\nend",
"title": ""
},
{
"docid": "5cf62e921185ee94220a683a0adab6db",
"score": "0.670691",
"text": "def rotate(matrix)\n # 4 groups of two\n a = 0\n b = 2\n c = 2\n 2.times do |num|\n matrix[num][c], matrix[c][b], matrix[b][a], matrix[a][num] = matrix[a][num], matrix[num][c], matrix[c][b], matrix[b][a]\n b -=1\n end\n p matrix\nend",
"title": ""
},
{
"docid": "35882c07e74fbd3811fe6059ffd9ab81",
"score": "0.6705877",
"text": "def my_transpose(matrix)\n \n # for every (i, j) in matrix\n # output[j][i] = matrix[i][j]\n return [] if matrix == []\n\n output = Array.new(matrix[0].length) {[]}\n i = 0\n while i < matrix[0].length\n matrix.each do |sub|\n output[i] << sub[i]\n end\n i += 1\n end\n output \nend",
"title": ""
},
{
"docid": "e448538136b5ac3763ed4a9ed2a84230",
"score": "0.6690536",
"text": "def rotate_right(arr)\n mirror_board_horizontal(arr.transpose)\nend",
"title": ""
},
{
"docid": "cf20eaaa25f8296bb19d40200a4e05c8",
"score": "0.6670771",
"text": "def rotate2(input_array)\n # TODO\nend",
"title": ""
},
{
"docid": "f4c8447b36133f503aeee8204642ed7a",
"score": "0.66620266",
"text": "def rotate(matrix, rank)\n outerlayer = 0;\n i = rank;\n offset = rank\n # while( i > 1) do\n temp = nil\n 0.upto(i-2) do |j|\n top = matrix[outerlayer,j]\n temp = top\n p top\n #left to top\n matrix[outerlayer,j] = matrix[offset -1 - j,outerlayer]\n p matrix[offset -1 - j,outerlayer]\n #bottom to right\n matrix[offset -1 - j,outerlayer] = matrix[offset -1,offset -1 - j]\n p matrix[offset -1,offset -1 - j]\n #right to bottom\n matrix[offset -1,offset -1 - j] = matrix[j, offset - 1]\n p matrix[j, offset - 1]\n #top to right\n matrix[j, offset - 1] = temp\n end\n i = rank/2\n offset -= 1\n outerlayer += 1\n # end\n\nend",
"title": ""
},
{
"docid": "c543718db54feb07fe053c5eeef9f11c",
"score": "0.66591156",
"text": "def transpose(matrix)\n transpose_matrix = []\n matrix.each_with_index do |row, row_index|\n row.each_with_index do |item, col_index|\n if transpose_matrix[col_index] == nil\n transpose_matrix[col_index] = [] # cannot use a[index] << [] as it will raise error as a[index] return nil which do not have << method\n end\n transpose_matrix[col_index][row_index] = item\n end\n end\n \n transpose_matrix\nend",
"title": ""
},
{
"docid": "6edce869d023ad0c404f82497f528329",
"score": "0.66346794",
"text": "def spiral_order(matrix)\n spiral = []\n\n until matrix == []\n matrix.first.each { |el| spiral.push(el) }\n matrix.shift\n matrix = matrix.map(&:reverse).transpose\n end\n\n spiral\nend",
"title": ""
},
{
"docid": "a90675666778e4f4a830cdb178b0a428",
"score": "0.6602866",
"text": "def transpose!(matrix)\n size = matrix.size\n\n size.times do |row|\n size.times do |col|\n matrix[col] << matrix[row].shift\n end\n end\n matrix\nend",
"title": ""
},
{
"docid": "6e4e72fa14f1553320c9e7f68c8a7bdd",
"score": "0.65981555",
"text": "def transpose(matrix)\n new_matrix = []\n matrix[0].size.times { new_matrix << [] }\n \n (0...matrix[0].size).each do |row|\n (0...matrix.size).each do |col|\n new_matrix[row][col] = matrix[col][row]\n end\n end\n \n new_matrix\nend",
"title": ""
},
{
"docid": "e43ac095bfee299c8dea6e6f8b0e3bdf",
"score": "0.65906465",
"text": "def transpose(matrix)\n rows_number = matrix.size\n columns_number = matrix[0].size\n \n transposed_matrix = []\n columns_number.times do |column|\n new_row = []\n rows_number.times do |row|\n new_row << matrix[row][column]\n end\n transposed_matrix << new_row\n end\n \n transposed_matrix\nend",
"title": ""
},
{
"docid": "b1cebe275fc05fd1674e82037b5a267f",
"score": "0.65782607",
"text": "def transpose(matrix)\n return_matrix = Array.new(matrix[0].size) {[]}\n matrix.each do |row|\n row.each_with_index { |el, index| return_matrix[index] << el }\n end\n p return_matrix\nend",
"title": ""
},
{
"docid": "5936e3101bf051232b01e34085ba9526",
"score": "0.65781105",
"text": "def transpose(matrix)\n transposed = []\n row = 0\n until row == matrix[0].size\n col = []\n matrix.each_index { |i| col << matrix[i][row] }\n transposed << col\n row += 1\n end\n transposed\nend",
"title": ""
},
{
"docid": "f5dd2f4ff9cbf1f1d585439e01f02a9b",
"score": "0.65744233",
"text": "def transpose(matrix)\n final_array = Array.new\n (0...matrix[0].length).each do |i|\n new_array = Array.new\n (0...matrix.length).each do |j|\n new_array.push(matrix[j][i])\n end\n final_array.push(new_array)\n end\n final_array\nend",
"title": ""
},
{
"docid": "af3bea1d63679a0826c16e71aa2e962f",
"score": "0.656826",
"text": "def transpose(matrix)\n num_elements = [*1..matrix.size].map {|num| num - 1}\n new_matrix = []\n num_elements.each do |column_ind|\n new_row = num_elements.map { |row_ind| matrix[row_ind][column_ind] }\n new_matrix << new_row\n end\n new_matrix\nend",
"title": ""
},
{
"docid": "ddde95cb9d81c12f075d6c8a14037478",
"score": "0.6567142",
"text": "def transpose(matrix)\n # created an array with values from first row, then for each element, concat\n # it's associated column values\n new_matrix = matrix[0].map {|e| [e] }\n \n # row => new_matrix_row\n # col => new_matrix_column\n matrix[0].length.times {|row|\n 1.upto(matrix.length-1) {|col|\n new_matrix[row] << matrix[col][row]\n }\n }\n new_matrix\nend",
"title": ""
},
{
"docid": "a23dc898edbca0d546453de140a474ef",
"score": "0.6559084",
"text": "def transpose(matrix)\n rows = []\n row_size = matrix[0].size # new row size is old column size\n row_size.times do |row|\n rows[row] = matrix.map { |old_column| old_column[row] }\n end\n rows\nend",
"title": ""
},
{
"docid": "4aebe444a2fded13b88d493cc0bbd8f2",
"score": "0.6553602",
"text": "def transpose(matrix)\n n = matrix.length\n transpose = []\n \n matrix.each_with_index do |row, i|\n row.each_with_index do |el, j|\n transpose[j] = [] if transpose[j].nil?\n transpose[j][i] = el\n end\n end\n transpose\nend",
"title": ""
},
{
"docid": "321c2c2db3fa0b726109cf507d5fd373",
"score": "0.65490127",
"text": "def transpose(matrix)\n\ttransposed_array = []\n\ttemp_array = []\n\tcounter = 0\n\tloop do\n\t\tmatrix.each do |array|\n\t\t\ttemp_array.push(array[counter])\n\t\tend\n\t\ttransposed_array.push(temp_array)\n\t\ttemp_array = []\n\t\tcounter += 1\n\t\tbreak if counter == matrix[0].length\n\tend\n\tp transposed_array\nend",
"title": ""
},
{
"docid": "839fb45e89074b08151acfc2f43b95c9",
"score": "0.65481275",
"text": "def transpose(matrix)\n new_matrix = []\n\n column = 0\n while column < matrix.first.size\n new_row = []\n\n row = 0\n while row < matrix.size\n new_row << matrix[row][column]\n row += 1\n end\n\n new_matrix << new_row\n column += 1\n end\n\n new_matrix\nend",
"title": ""
},
{
"docid": "fe60cc8510b2744a84941d82a0b6aa86",
"score": "0.65458626",
"text": "def transpose(matrix)\n new_matrix = []\n matrix[0].length.times { new_matrix << [] }\n matrix.each do |arr|\n arr.each_with_index { |e, i| new_matrix[i] << e }\n end\n new_matrix\nend",
"title": ""
},
{
"docid": "0cd501bdf34008f2cf39494d7aa47c5e",
"score": "0.6543505",
"text": "def transpose(matrix)\n number_of_rows = matrix.size \n number_of_columns = matrix[0].size\n\n transposed_matrix = []\n number_of_columns.times do |col|\n new_row = [] \n number_of_rows.times do |row|\n new_row << matrix[row][col]\n end\n transposed_matrix << new_row \n end\n transposed_matrix \nend",
"title": ""
},
{
"docid": "8d4577409369321c0138ce47db8d9724",
"score": "0.65340227",
"text": "def transpose(matrix)\n result = []\n number_of_rows = matrix.size\n number_of_columns = matrix.first.size\n (0...number_of_columns).each do |column_index|\n new_row = (0...number_of_rows).map { |row_index| matrix[row_index][column_index] }\n result << new_row\n end\n result\nend",
"title": ""
},
{
"docid": "7a1293bd0357223bcf9052d9e1f6d8ef",
"score": "0.6530779",
"text": "def transpose(matrix)\n # new_matrix = Array.new(matrix.size) { [] }\n # \n # matrix.size.times do |idx|\n # matrix.each do |elem|\n # new_matrix[idx] << elem[idx]\n # end\n # end\n # new_matrix\n \n arr_size = matrix.size \n result = []\n (0..arr_size).each do |column_index|\n new_row = (0..arr_size).map { |row_index| matrix[row_index][column_index] }\n result << new_row\n end\n result\n \nend",
"title": ""
},
{
"docid": "7c92afe43ae7aee733464911ebcdba56",
"score": "0.6522901",
"text": "def rotate_array(\n array:,\n rotation:\n )\n rotation.times do\n temp = array.shift\n array.push(temp)\n end\n array\nend",
"title": ""
},
{
"docid": "df14ed29342fe00e8b8535be04b926ca",
"score": "0.65111256",
"text": "def transpose(matrix)\n new_matrix = []\n matrix.length.times { new_matrix << [] }\n matrix.each do |arr|\n arr.each_with_index { |e, i| new_matrix[i] << e }\n end\n new_matrix\nend",
"title": ""
},
{
"docid": "90ff8c350882408c580e02eb2fb9d0b2",
"score": "0.65022826",
"text": "def transpose(matrix)\n new_matrix = []\n num_rows = matrix.size\n num_cols = matrix.first.size\n (0...num_cols).each do |col_ind|\n new_row = (0...num_rows).map { |row_ind| matrix[row_ind][col_ind] }\n new_matrix << new_row\n end\n new_matrix\nend",
"title": ""
},
{
"docid": "b7e85f0c4c5dd7fcc5457ce3192f70f0",
"score": "0.6499064",
"text": "def transpose(matrix)\n result = []\n new_rows = matrix[0].count\n new_columns = matrix.count\n new_rows.times { result << [] }\n \n new_columns.times do |column|\n new_rows.times do |row|\n result[row][column] = matrix[column][row] \n end\n end\n \n result\nend",
"title": ""
}
] |
7c4ffa8a63a117cbab6561150aa27a4d
|
this creates a file listing all refpages categories (Modular, Foundation, etc.)
|
[
{
"docid": "f97460f5e1132e48329c2efb26b3507f",
"score": "0.0",
"text": "def moduleTOC(docModules)\n root = Element.new(\"root\")\n\n docModules.each do |moduleName|\n m = Element.new(\"module\")\n m.text = \"Jamoma#{moduleName}\"\n root.add_element m\n end\n @xml.add_element root\n\n end",
"title": ""
}
] |
[
{
"docid": "eb9d1a14a089962587a350a72d1eca85",
"score": "0.66267246",
"text": "def get_file_categories\n Resources::FileCategory.parse(request(:get, \"FileCategories\"))\n end",
"title": ""
},
{
"docid": "76147f79e91d568ba0d8f91f844e7e10",
"score": "0.6525559",
"text": "def category_files\n self.dbacl.categories.map do |category|\n File.expand_path(File.join(self.pwd, category.to_s)) \n end.join(\" \")\n end",
"title": ""
},
{
"docid": "0d8d46e39853639532914f3e7335ad76",
"score": "0.6476742",
"text": "def categories\n @categories ||=\n begin\n h = Hash.new { |h2,k| h2[k] = [] }\n\n def h.method_missing msg, *args\n if self.has_key? msg.to_s then\n self[msg.to_s]\n else\n super\n end\n end\n\n time_prune\n fix_subpages\n\n pages.each do |url, page|\n dir = url.split(/\\//).first\n next unless File.directory? dir and dir !~ /^_/\n next if url =~ /index.html/ or url !~ /html/\n h[dir] << page\n end\n\n h.keys.each do |dir|\n h[dir] = h[dir].sort_by { |p| [-p.date.to_i, p.title ] }\n end\n\n h\n end\n end",
"title": ""
},
{
"docid": "1059354b5bbff377b184c8dba8ebec49",
"score": "0.6473804",
"text": "def generate(site)\n @site = site\n kbCollections = site.collections.select {|k, v| v.metadata[\"isKB\"] }\n kbCategories = site.config[\"kbCategories\"]\n\n kbCollections.each {|collectionName, collectionDatas|\n\n base = @site.in_source_dir(collectionDatas.directory, \".\")\n subdirs = Dir.chdir(base) { @site.reader.filter_entries(Dir[\"*/\"], base) }\n subdirs = subdirs.sort\n\n subdirs.each {|subdir|\n # if subdir contains no file, do nothing\n if Dir.empty?(base + subdir)\n break\n end\n\n # get folder's name by splitting path\n categorySlug = subdir.split('/').first\n\n # do we have a corresponding entry in kb categories data file ?\n kbCategoryEntry = kbCategories[collectionName].select{ |category|\n category['slug'] == categorySlug\n }\n\n if kbCategoryEntry.empty?\n Jekyll.logger.error \"#{collectionName}:#{categorySlug} as no corresponding entry in _data/kb-categories.yaml file\"\n end\n\n category = kbCategoryEntry.first\n # creates an index file for category\n index = Jekyll::KBCategoryIndexPage.new(site, collectionDatas, category)\n site.pages << index\n Jekyll.logger.info \"Category index generator : created index at #{ index.dir }#{ index.name }\"\n }\n\n }\n\n end",
"title": ""
},
{
"docid": "39a5be7a2de66cfdc2b203c178d575b6",
"score": "0.64023846",
"text": "def write_category categories\n\tunless categories\n\t\treturn ''\n\tend\n\n\thtml = '<div class=\"categories\">'\n\n\tcategories.each do |category|\n\t\thtml += '<span class=\"category\">' + category + '</span>'\n\tend\n\n\thtml += '</div>' + \"\\n\"\n\treturn html\nend",
"title": ""
},
{
"docid": "9d5908a172b34eacd1d1ef35ad9b017e",
"score": "0.6367659",
"text": "def write_category_indexes\n if self.layouts.key? 'archives_blog_category'\n dir = self.config['category_dir'] || 'categories'\n self.categories.keys.each do |category|\n self.write_category_index(File.join(dir, category.to_url), category)\n end\n\n # Throw an exception if the layout couldn't be found.\n else\n raise <<-ERR\n\n===============================================\nError for generators/category.rb plugin\n-----------------------------------------------\nNo 'archives_blog_category.html' in source/_layouts/\nPerhaps you haven't installed a theme yet.\n===============================================\n\nERR\n end\n end",
"title": ""
},
{
"docid": "247d8c38de5405ef1e8ab1b6e28aecdb",
"score": "0.6308343",
"text": "def write_category_indexes\n if self.layouts.key? 'category_index'\n dir = self.config['category_dir'] || 'categories'\n\n post_categories = self.categories.map do |category, posts|\n normalized_category_name = category.gsub(/_|\\P{Word}/, '-').gsub(/-{2,}/, '-')\n category_dir = File.join(dir, normalized_category_name.downcase)\n PostCategory.new(category, category_dir, posts.count)\n end\n\n self.write_category_list_page(post_categories)\n post_categories.each do |post_category|\n self.write_category_index(post_category.dir, post_category.name)\n end\n\n # Throw an exception if the layout couldn't be found.\n else\n throw \"No 'category_index' layout found.\"\n end\n end",
"title": ""
},
{
"docid": "48fabdb057acb26456c5ee0619855738",
"score": "0.6224584",
"text": "def menu_categories\n i = 1\n while i < 11\n category_url = BASE_URL+get_page.css(\"a.category-link\")[i][\"href\"]\n category_name = get_page.css(\"#category-section > ul.mcd-category-page__links-section.mcd-category-page__left-nav--sub-category > li > a > span\")[i-1].text\n @categories << Category.new(category_name, category_url)\n i += 1\n end\n end",
"title": ""
},
{
"docid": "2e52e1cef6912f3f7a46d9df9ed7d4cf",
"score": "0.6198789",
"text": "def category_links(categories)\n base_dir = @context.registers[:site].config['category_dir']\n @categorydir = ''\n categories = categories.map do |category|\n next if @categorydir.include? self.category_dir(base_dir, category)\n base_dir = File.join(base_dir, @categorydir) unless @categorydir == ''\n @categorydir = self.category_dir(base_dir, category).chomp.split(\"/\").uniq.join(\"/\")\n # Make sure the category directory begins with a slash.\n @categorydir = \"/#{@categorydir}\" unless @categorydir =~ /^\\//\n \"<a class='category' href='#{@categorydir}/'>#{category.gsub(/\\-/, ' ').titlecase}</a>\"\n end\n \n @categorydir = ''\n\n case categories.length\n when 0\n \"\"\n when 1\n categories[0].to_s\n else\n categories.join(', ')\n end\n end",
"title": ""
},
{
"docid": "35b601a0fd2bbd32d95a2be135d1d23e",
"score": "0.61806023",
"text": "def show\n @subcategories = Array.new\n @filecategories = @aggregate.categories\n @filesubcategories = @aggregate.subcategories\n @categories = Category.all\n for cat in @filecategories\n for subcat in cat.subcategories\n if !@filesubcategories.include?(subcat) \n @subcategories.push(subcat)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "11d2b3c0feb32f6d497524c3a751ef59",
"score": "0.60313165",
"text": "def index\n authorize Document\n @categories = Document.all.order(:title).decorate.group_by(&:category)\n end",
"title": ""
},
{
"docid": "8a76891ab66b8bbb796dad031b317ff7",
"score": "0.6012398",
"text": "def write_to_tag_cloud\n puts ' => Creating Categories Tag Cloud'\n lists = {}\n max, min = 1, 1\n # @site = @config['']\n # @categories = \n @site = self\n @categories = @site.categories\n @categories.keys.sort_by{ |str| str.downcase }.each do |category|\n count = @categories[category].count\n lists[category] = count\n max = count if count > max\n end\n\n html = ''\n lists.each do | category, counter |\n url = get_category_url category\n style = \"font-size: #{100 + (60 * Float(counter)/max)}%\"\n if @config['category_counter']\n html << \" <a href='#{url}' style='#{style}'>#{category.capitalize}(#{@categories[category].count})</a> \"\n else\n html << \" <a href='#{url}' style='#{style}'>#{category.capitalize}</a> \"\n end\n end\n\n File.open(File.join(@source, '_includes/asides/categories_tag.html'), 'w') do |file|\n file << \"\"\"{% if site.category_tag_cloud %}\n<section>\n<h1>#{@config['category_title'] || 'Categories'}</h1>\n<span class='categories_tag'>#{html}</span>\n</section>\n{% endif %}\n\"\"\"\n end\n end",
"title": ""
},
{
"docid": "2528f1889a11e18fe893dd8829b05dd4",
"score": "0.6010163",
"text": "def index\n @admin_file_document_categories = Admin::FileDocumentCategory.order(created_at: \"desc\")\n end",
"title": ""
},
{
"docid": "1b2b4081cf0e61f3162451c065b76f87",
"score": "0.6004251",
"text": "def categories(cats = nil) #:yield: categories\n unless cats\n cats = @comp.categories\n yield cats\n end\n # TODO - strip the strings\n set_text_list('CATEGORIES', cats)\n end",
"title": ""
},
{
"docid": "d0d06824163c45d488e1ab3449c02295",
"score": "0.60008776",
"text": "def write_feeds\n render_file(\"index.rss\",\n \"feed.rxml\",\n :posts => posts[0, 10],\n :root => '')\n \n for category in categories\n posts = posts_for_tag(category)\n render_file(\"categories/#{category.downcase}.rss\", \n \"feed.rxml\", \n :category => category, \n :posts => posts,\n :root => '../') \n end\n end",
"title": ""
},
{
"docid": "748b0997f20744fd4eb26aa2e91b87bf",
"score": "0.59829897",
"text": "def render_categories (entry, workitem)\n\n @categories.each do |s|\n\n c = Atom::Category.new\n\n c[\"scheme\"] = @target_uri\n c[\"term\"] = s.strip\n\n entry.categories << c\n end\n end",
"title": ""
},
{
"docid": "f7f89cb45b7e6c76d43ae89bce885e6b",
"score": "0.5949297",
"text": "def view_categories_list()\n\n # See also rebuild_readme()\n def view_category_summary( category_name )\n #\n # This is largely cloned from program_thumbnail()\n def catgegory_thumbnail( category_name )\n dir = File.join( '..', 'categories' )\n i = File.join( '..', 'categories', 'default-thumbnail.png' )\n f = File.join( dir, \"#{ category_name }.png\" )\n i = f if File.exists?( f )\n f = File.join( dir, \"#{ category_name }.jpg\" )\n i = f if File.exists?( f )\n image(\n i,\n width: 150,\n height: 150,\n :margin_left => 10,\n :margin_bottom => 5,\n :margin_top => 5\n ).click{ view_a_category( category_name ) }\n end # catgegory_thumbnail( category_name )\n #\n @category = ''\n @content.append do\n flow( :margin_top => 10 ) do\n background( lightyellow, :curve => 10, :margin_left => 5, :margin_right => 20 )\n stack( width: 155 ) do\n #para # Blank line above the thumbnail.\n catgegory_thumbnail( category_name )\n end\n flow( width: width-155 ) do\n para( link( category_name ){ view_a_category( category_name ) } )\n para( \"\\n\" )\n para( category_description( category_name ) )\n end\n end\n end\n end # view_category_summary( category_name, *splat )\n\n @content.clear\n @content.append do\n flow( :margin_left => 10 ){\n para( 'Categories List > ' )\n }\n end\n @@categories_array.each{ |c|\n view_category_summary( c )\n }\nend",
"title": ""
},
{
"docid": "f7022ef931cabc51deae7b1c2313fbf3",
"score": "0.5941532",
"text": "def index\n @page_categories = Chemistry::PageCategory.order(title: :asc)\n render layout: chemistry_admin_layout\n end",
"title": ""
},
{
"docid": "cd9aeaaa225b5042b964d87b5e54ec14",
"score": "0.5940732",
"text": "def category_list\n #categories = Sap::Category.all #get_category_tree\n #CategoryRenderer.new(categories, self).render\n end",
"title": ""
},
{
"docid": "02a9b3c5915fdc0a5665e79f206241d0",
"score": "0.59299105",
"text": "def categories\n return nil unless Documents::Category.count > 0\n Documents::CategoriesDecorator.decorate(Documents::Category.all)\n end",
"title": ""
},
{
"docid": "6c7b58ee5bf75908501b8fb86d682c1a",
"score": "0.5911868",
"text": "def generate(site)\n if site.layouts.key? 'catpage'\n site.categories.keys.each do |cat|\n site.pages << CatPage.new(site, site.source, File.join('categories', cat), cat)\n site.pages << CatAtom.new(site, site.source, File.join('atom'), cat)\n end\n end\n end",
"title": ""
},
{
"docid": "54e3b689e539a2e29fa43eb14fead530",
"score": "0.58968693",
"text": "def create_category_pages\n articles_by_category.each do |category, items|\n @items.create(\n %Q{<%= render(\"/category_index.html\", category: \"#{category}\") %>},\n {\n title: \"Articles in #{category}\",\n excerpt: \"List of articles in the category #{category}.\",\n h1: \"#{category} articles\",\n items: items,\n },\n category_identifier(category),\n :binary => false\n )\n end\n end",
"title": ""
},
{
"docid": "ddaec9c0158a337b6ce99530fd4d02a8",
"score": "0.58829516",
"text": "def index\n @categories = DocflowCategory.order(\"lft\")\n end",
"title": ""
},
{
"docid": "a19d76d9c1e8def99b26d79a5e0b87ca",
"score": "0.5871803",
"text": "def write_to_sidebar\n puts ' => Creating Categories Sidebar'\n html = \"<ul>\\n\"\n # case insensitive sorting\n @categories.keys.sort_by{ |str| str.downcase }.each do |category|\n url = get_category_url category\n if @config['category_counter']\n html << \" <li><a href='#{url}'>#{category.capitalize} (#{@categories[category].count})</a></li>\\n\"\n else\n html << \" <li><a href='#{url}'>#{category.capitalize}</a></li>\\n\"\n end\n end\n html << \"</ul>\"\n File.open(File.join(@source, '_includes/asides/categories_sidebar.html'), 'w') do |file|\n file << \"\"\"{% if site.category_sidebar %}\n<section>\n<h1>#{@config['category_title'] || 'Categories'}</h1>\n#{html}\n</section>\n{% endif %}\n\"\"\"\n end\n end",
"title": ""
},
{
"docid": "a19d76d9c1e8def99b26d79a5e0b87ca",
"score": "0.5871803",
"text": "def write_to_sidebar\n puts ' => Creating Categories Sidebar'\n html = \"<ul>\\n\"\n # case insensitive sorting\n @categories.keys.sort_by{ |str| str.downcase }.each do |category|\n url = get_category_url category\n if @config['category_counter']\n html << \" <li><a href='#{url}'>#{category.capitalize} (#{@categories[category].count})</a></li>\\n\"\n else\n html << \" <li><a href='#{url}'>#{category.capitalize}</a></li>\\n\"\n end\n end\n html << \"</ul>\"\n File.open(File.join(@source, '_includes/asides/categories_sidebar.html'), 'w') do |file|\n file << \"\"\"{% if site.category_sidebar %}\n<section>\n<h1>#{@config['category_title'] || 'Categories'}</h1>\n#{html}\n</section>\n{% endif %}\n\"\"\"\n end\n end",
"title": ""
},
{
"docid": "f38ebdbc60507fed17ab5a3d2c61685b",
"score": "0.58712405",
"text": "def categories\n yaml(\"categories\")\n end",
"title": ""
},
{
"docid": "3c4a619943cb2055182f9e3400233932",
"score": "0.58670026",
"text": "def list_categories\n header\n input = list(@categories)\n toggle(input) || list_apis(input)\n end",
"title": ""
},
{
"docid": "32807f251a3a84d38fa4e3a704b1095b",
"score": "0.58498263",
"text": "def categories\n #\n @page_title = \"Categories\"\n end",
"title": ""
},
{
"docid": "ea5d16d09427374910a9f46a0901619b",
"score": "0.58444303",
"text": "def document_collection(collection)\n categories = []\n collection.each do |cat|\n categories << document_category_link(cat)\n end\n\n category_collection(categories, documents_path)\n end",
"title": ""
},
{
"docid": "85817fa192d074d75628b1d85d9a5ebf",
"score": "0.5843981",
"text": "def browse_all_categories\n @podcast_counter = 0\n puts \"\"\n puts \"Main Menu: All Categories\".colorize(:light_blue)\n PodcastFinder::Category.list_categories\n puts \"\"\n puts \"To get started, choose a category above (1-#{PodcastFinder::Category.all.size}) or type 'help' to see a list of commands.\".colorize(:light_blue)\n puts \"You can also type 'exit' at any point to quit.\".colorize(:light_blue)\n self.choose_category\n end",
"title": ""
},
{
"docid": "5f2b3c3a031fe869dba58ce2a6ad0337",
"score": "0.58343965",
"text": "def categories\n categories_doc = Category.new(get_category_doc.body)\n categories_doc.categories\n end",
"title": ""
},
{
"docid": "5f2b3c3a031fe869dba58ce2a6ad0337",
"score": "0.58343965",
"text": "def categories\n categories_doc = Category.new(get_category_doc.body)\n categories_doc.categories\n end",
"title": ""
},
{
"docid": "c5857c6c05a8dd570aa2ec281a469abc",
"score": "0.58089477",
"text": "def reset_posts_category(site)\n post_paths = []\n for p in site.posts.docs\n path = File.dirname(p.path)\n pos = path.index(\"_posts/\")\n path = path[pos..-1]\n post_paths << path\n\n c = path[7..-1]\n cn = get_category_name(path)\n p.data[\"category\"] = c\n p.data[\"categories\"] = [c]\n p.data[\"category_name\"] = cn\n io = IO.popen('git log -1 --pretty=\"format:%cI\" ' + p.path)\n date_str = io.gets\n # printf(\"post:%s\\n\", p.path)\n # printf(\" pwd :%s\", `pwd`)\n # printf(\" date:%s\\n\\n\", date_str)\n p.data[\"update_time\"] = date_str\n # printf(\"Post date:%s\\n\", `git log -1 --pretty=\"format:%cI\" $p`)\n # printf(\" category:%s\\n\", c)\n # printf(\" category name:%s\\n\\n\", cn)\n end\n # printf(\"paths:%s\\n\", post_paths)\n info = get_category_info(\"_posts\", post_paths)\n category_info = []\n for c in info[\"subs\"]\n category_info << c\n end\n site.data[\"category-info\"] = category_info\n # print category_info.inspect\n end",
"title": ""
},
{
"docid": "5b7df5c5febd4e1f4ed3b945bcae5f0a",
"score": "0.5770526",
"text": "def setCategory\n @categories = {}\n @mechanize.page.search(\"//a[@class='cf']\").each do |cat|\n num_thread_with_bracket = cat.search('.//span')[0].inner_text\n num_thread = num_thread_with_bracket.match('\\((\\d+)\\)')[1]\n catObj = NiwaTextream::Category.new\n catObj.elem = cat\n catObj.name = cat.inner_text.match('(.+?)\\((.+?)\\)')[1]\n catObj.num_thread = num_thread\n @categories[catObj.name] = catObj\n puts(\"--#CategoryPage#--\")\n puts(catObj.name)\n end\n end",
"title": ""
},
{
"docid": "686cb04fed4eadb053f2dcfe5bda702d",
"score": "0.57628965",
"text": "def list(report_file, categories=[])\n categories = mesh_categories(categories)\n cats = order(categories)\n cat_of_interest = cats.first \n prev_val = nil\n hash = {}\n (hash[:context], hash[:project]) = max_lengths(:context, :project)\n string = @todolist.map do |it|\n string = \"\"\n current_val = it.send(cat_of_interest)\n if prev_val && prev_val != current_val\n string << \"\\n\"\n end\n string << it.to_s(false, hash)\n prev_val = current_val\n string\n end.join(\"\\n\")\n\n # print to file and screen\n File.open(report_file, \"w\") do |fh| fh.puts string end\n puts string\n end",
"title": ""
},
{
"docid": "2fd300ae8e9e801e03a7f52ff50d264c",
"score": "0.57487553",
"text": "def generate(site)\n if site.config['paginate_category_basepath']\n for category in site.categories.keys\n paginate_category(site, category)\n end\n end\n end",
"title": ""
},
{
"docid": "54fbe4392e8ee3954a1caf4b91c0ce56",
"score": "0.5738569",
"text": "def link_tree\n return ''.html_safe if object.size == 0\n\n h.content_tag(:li,\n h.content_tag(:strong, I18n.t('search.index.categories')),\n class: 'filter-header') +\n h.content_tag_for(:li, Documents::Category.roots) do |root|\n Documents::CategoryDecorator.decorate(root).link_tree\n end\n end",
"title": ""
},
{
"docid": "30de6a9281596050c2814658ffcfd4d0",
"score": "0.57201624",
"text": "def category_pages\n \ta = page_content.match(/<li><a href\\=\\'([^\\']*)\\'/i)\n \tb = page_content.match(/<li style\\=\\\"font\\-size[^>]*><a href='([^\\']*)\\'/i)\n if (a or b)\n File.open(\"buckle_cat.txt\", 'w+') do |f|\n puts page_content.scan(/<li><a href\\=\\'([^\\']*)\\'/i)\n f.puts page_content.scan(/<li><a href\\=\\'([^\\']*)\\'/i)\n f.puts page_content.scan(/<li style\\=\\\"font\\-size[^>]*><a href='([^\\']*)\\'/i)\n puts page_content.scan(/<li style\\=\\\"font\\-size[^>]*><a href='([^\\']*)\\'/i)\n end\n else\n \tputs \"The give Regex was wrong..Please test it and give the correct one\"\n end\n\n end",
"title": ""
},
{
"docid": "19b5c330703bcf86a86985756147e929",
"score": "0.57140726",
"text": "def category_trail(ct = nil, is_leaf = false, mode = nil, page = nil)\r\n if ct.blank?\r\n self.page_name = 'Home'\r\n cats = ['Home']\r\n else\r\n cats = ct[1..-1]\r\n # in a GA world, we don't want the full hierarchy in the page name\r\n self.page_name = \"#{cats[-1]} Category Browse\"\r\n end\r\n\r\n self.page_number = page ? page : 1\r\n self.page_type = is_leaf ? 'Subcategory Page' : 'Category Page'\r\n cats << self.page_name\r\n self.hierarchy = cats\r\n self.display_mode = mode if mode\r\n end",
"title": ""
},
{
"docid": "b943117451d8a58a7065ef5e4b9e16f2",
"score": "0.5694115",
"text": "def category_list\n\t $collection_hash[\"collection\"].each do |category|\n\t\t\tputs category[\"category\"]\n\t end\n\t\tputs \"********************************************\"\n\t\tputs $collection_hash[\"collection\"].length\n\t\tputs \"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\"\n\tend",
"title": ""
},
{
"docid": "bc457d69850f9979640fc1ba2bf189a2",
"score": "0.56756014",
"text": "def write_to_tag_cloud\n puts ' => Creating Categories Tag Cloud'\n lists = {}\n max, min = 1, 1\n @categories.keys.sort_by{ |str| str.downcase }.each do |category|\n count = @categories[category].count\n lists[category] = count\n max = count if count > max\n end\n\n html = ''\n lists.each do | category, counter |\n url = get_category_url category\n style = \"font-size: #{100 + (50 * Float(counter)/max)}%\"\n if @config['category_counter']\n html << \" <a href='#{url}' style='#{style}'>#{category.capitalize}(#{@categories[category].count})</a> \"\n else\n html << \" <a href='#{url}' style='#{style}'>#{category.capitalize}</a> \"\n end\n end\n\n # testing data, should be removed\n # html << '<a href=\"/category/actionscript\" style=\"font-size: 138.9189189189189%\">ActionScript(24)</a> <a href=\"/category/asp\" style=\"font-size: 103.24324324324324%\">ASP(2)</a> <a href=\"/category/aws\" style=\"font-size: 101.62162162162163%\">AWS(1)</a> <a href=\"/category/book\" style=\"font-size: 101.62162162162163%\">Book(1)</a> <a href=\"/category/browser\" style=\"font-size: 103.24324324324324%\">Browser(2)</a> <a href=\"/category/cocos2d\" style=\"font-size: 101.62162162162163%\">Cocos2D(1)</a> <a href=\"/category/coffeescript\" style=\"font-size: 125.94594594594595%\">CoffeeScript(16)</a> <a href=\"/category/css\" style=\"font-size: 101.62162162162163%\">CSS(1)</a> <a href=\"/category/diary\" style=\"font-size: 142.16216216216216%\">Diary(26)</a> <a href=\"/category/django\" style=\"font-size: 122.70270270270271%\">Django(14)</a> <a href=\"/category/dojo\" style=\"font-size: 101.62162162162163%\">Dojo(1)</a> <a href=\"/category/easeljs\" style=\"font-size: 104.86486486486487%\">EaselJS(3)</a> <a href=\"/category/flash\" style=\"font-size: 160.0%\">Flash(37)</a> <a href=\"/category/funny\" style=\"font-size: 106.48648648648648%\">Funny(4)</a> <a href=\"/category/happy-ruby\" style=\"font-size: 103.24324324324324%\">Happy Ruby(2)</a> <a href=\"/category/html5\" style=\"font-size: 104.86486486486487%\">HTML5(3)</a> <a href=\"/category/ios-app-development\" style=\"font-size: 114.5945945945946%\">iOS App Development(9)</a> <a href=\"/category/javascript\" style=\"font-size: 140.54054054054055%\">JavaScript(25)</a> <a href=\"/category/jquery\" style=\"font-size: 101.62162162162163%\">jQuery(1)</a>'\n\n File.open(File.join(@source, '_includes/asides/categories_tag.html'), 'w') do |file|\n file << \"\"\"{% if site.category_tag_cloud %}\n<section class='well'>\n<h1>#{@config['category_title'] || 'Categories'}</h1>\n<span class='categories_tag'>#{html}</span>\n</section>\n{% endif %}\n\"\"\"\n end\n end",
"title": ""
},
{
"docid": "95e12d8b866345db0304c452a10382ee",
"score": "0.56485486",
"text": "def category_list\n return unless user_configuration_name.name == \"CategoryList\"\n xml_to_category_list\n end",
"title": ""
},
{
"docid": "a99cec23d339c38c753a87be51159a4b",
"score": "0.56439257",
"text": "def make_categories\n \n text = \"categories: [\\n\"\n \n self.keys.each do |key|\n text << \"'#{key}',\\n\"\n end\n \n text << \"]\\n\"\n \n end",
"title": ""
},
{
"docid": "1c3dfbe83fe89f78ea8f10a3682f4c9b",
"score": "0.56409454",
"text": "def index\n @pages_categories = PagesCategory.all\n end",
"title": ""
},
{
"docid": "2c699e821d924a55e3b474af78def75b",
"score": "0.56379175",
"text": "def index\n @categories = collections_config.values\n end",
"title": ""
},
{
"docid": "0ca18629b1463701d68c3963c4b69b94",
"score": "0.56361634",
"text": "def all\n categories = []\n\n # Categories are listed in catalog csv, so fetch that.\n catalog = Catalog.all(@options)\n catalog.each do |item|\n categories << {\n code: item[:category_code],\n description: item[:category_description]\n }\n end\n\n categories.uniq! { |c| c[:description] }\n categories.sort_by! { |c| c[:description] }\n\n categories\n end",
"title": ""
},
{
"docid": "e1a2c7e98ee8fada6e7c6e3bd843c237",
"score": "0.56356525",
"text": "def create_avail_category\n file = ::File.new(\"#{node['opennms']['conf']['home']}/etc/categories.xml\", 'r')\n doc = REXML::Document.new file\n file.close\n cg_el = doc.elements[\"/catinfo/categorygroup[name[text()[contains(.,'#{new_resource.category_group}')]]]/categories\"]\n cat_el = cg_el.add_element 'category'\n label_el = cat_el.add_element 'label'\n label_el.add_text(REXML::CData.new(new_resource.label))\n comment_el = cat_el.add_element 'comment'\n comment_el.add_text new_resource.comment\n normal_el = cat_el.add_element 'normal'\n normal_el.add_text new_resource.normal.to_s # really ruby? really?\n warning_el = cat_el.add_element 'warning'\n warning_el.add_text new_resource.warning.to_s\n new_resource.services.each do |s|\n s_el = cat_el.add_element 'service'\n s_el.add_text s\n end\n rule_el = cat_el.add_element 'rule'\n rule_el.add_text(REXML::CData.new(new_resource.rule))\n Opennms::Helpers.write_xml_file(doc, \"#{node['opennms']['conf']['home']}/etc/categories.xml\")\nend",
"title": ""
},
{
"docid": "ae0f58f2e322872262968494f4878dea",
"score": "0.56343865",
"text": "def get_categories(doc,url)\n if wiki_url?(url)\n doc.css('.reflist, .refbegin, #mw-panel, #footer').remove\n if doc.at('h2:contains(\"See also\")')\n doc.at('h2:contains(\"See also\")').next_element.remove\n end\n end\n\n final_array = get_proper_categories(doc).keys[0..1]\n common_words = get_common_categories(doc).delete_if {|k,v| final_array[0].include?(k) || final_array[1].include?(k) }.keys\n\n for word in common_words\n if final_array.length < 4\n final_array << word unless final_array.any? {|i| i.casecmp(word) == 0 } \n end\n end\n return final_array\n end",
"title": ""
},
{
"docid": "abd177df00fc3e7585ca5797241c4b64",
"score": "0.5586389",
"text": "def wiki_pages\n self.categories.map do |cat|\n cat.wiki_pages + (cat.parent ? cat.parent.wiki_pages : [])\n end.flatten.uniq\n end",
"title": ""
},
{
"docid": "0d1c76702ea46abc9ce089ddea739da6",
"score": "0.55856675",
"text": "def index\n add_breadcrumb 'categories'\n @categories = Category.all\n @pagy, @categories = pagy(Category.order(:name))\n end",
"title": ""
},
{
"docid": "25cf71c68a203e57012ac055cde95802",
"score": "0.55854625",
"text": "def categories\n @categories ||= []\n end",
"title": ""
},
{
"docid": "f46d020476c6981698bc82ceb71f00e7",
"score": "0.55791587",
"text": "def folder_categories(file)\n all = file.split('.')[0].split('/') \n all.delete all.last\n all\n end",
"title": ""
},
{
"docid": "aa980436722e27c143170b9882068abb",
"score": "0.55734193",
"text": "def index\n add_breadcrumb \"categories\", :categories_path, { :title => \"Categories\" }\n smart_listing_create partial: \"categories/listing\"\n end",
"title": ""
},
{
"docid": "a3ba4406a807764976d8c6c10b83e338",
"score": "0.5523219",
"text": "def categories\n connection.get(\"/categories\").body.spot_categories\n end",
"title": ""
},
{
"docid": "a3ba4406a807764976d8c6c10b83e338",
"score": "0.5523219",
"text": "def categories\n connection.get(\"/categories\").body.spot_categories\n end",
"title": ""
},
{
"docid": "6aeef1cb999bc6673de35c8dbe3c1ac4",
"score": "0.5519425",
"text": "def categories\n str = \"<li>#{self.name}</li>\"\n if self.children.any?\n str = \"<li>#{self.name}<i class='fa fa-caret-right p-0'></i>\"\n str += \"<ul class='childs-menu'>\"\n self.children.each do |child|\n str += child.categories\n end\n str += \"</ul></li>\"\n end\n str.html_safe\n end",
"title": ""
},
{
"docid": "b993d27efe2f8e89fa081d45cb52b385",
"score": "0.55182004",
"text": "def display_categories_list()\n @content.clear\n @@categories_array.each{ |c|\n category( c )\n }\nend",
"title": ""
},
{
"docid": "ef5cc819a207bf8b33816ca88481d7f9",
"score": "0.55148035",
"text": "def categories\n proptextlistarray 'CATEGORIES'\n end",
"title": ""
},
{
"docid": "984be37e5678f84d7237adc683678072",
"score": "0.5507882",
"text": "def load_categories\n @categories = []\n File.readlines(\"databases/\"+@short+\"/cats.lang\").each do |line|\n tab = line.split(\";\")\n @categories[tab[0].to_i] = tab[1]\n end\n end",
"title": ""
},
{
"docid": "2ed31c73469a4d9d65d15585222c683b",
"score": "0.54996115",
"text": "def categories\n add_category('item')\n @categories\n end",
"title": ""
},
{
"docid": "2945a28bb96d35168e5517ad9f53994c",
"score": "0.5492756",
"text": "def index\n\n #if I18n.available_locales.count > 1\n @categories = Category.active.ordered.with_translations(I18n.locale)\n #else\n # @categories = Category.active.alpha\n #end\n @page_title = I18n.t :knowledgebase, default: \"Knowledgebase\"\n @title_tag = \"#{AppSettings['settings.site_name']}: \" + @page_title\n @meta_desc = \"Knowledgebase for #{AppSettings['settings.site_name']}\"\n @keywords = \"Knowledgebase, Knowledge base, support, articles, documentation, how-to, faq, frequently asked questions\"\n add_breadcrumb @page_title, categories_path\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @categories }\n end\n end",
"title": ""
},
{
"docid": "578d4d1ec73d2b21e7639f42addb2940",
"score": "0.5482831",
"text": "def collect_loc_categories(city_code)\n categories = {}\n \n # url\n city_code.gsub!(/^0+/, \"\") # remove leading zero\n url = \"http://www.ddmap.com/sitemap/#{city_code}/1.htm\"\n # xml process\n doc = Nokogiri::HTML(defense_requests_control(url))\n css_path = \"html body div#body div.siteCon div.siteCon1\"\n \n # search for list of 'ul' under above css_path\n doc.at_css(css_path).children.each do | ul |\n # first 'li' is 1st level category\n first_cat = ul.at_xpath(\"li[@class='Con1']/a\")\n first_cat.children.each do |link |\n puts URI.unescape(link.content)\n end\n # second 'li' are list of 2nd level category, contained in all the links wrapped in <p>\n # second_cat = ul.at_xpath(\"//li[@class='Con2']\")\n #second_cat.children.each do | p |\n # link = p.at_xpath(\"//a\")\n # puts URI.unescape(link.content) if link\n #end\n # third 'li' are the 'more' link, not very useful now!\n \n puts \"--------------\"\n end\n \n \n # dump the data\n \nend",
"title": ""
},
{
"docid": "945f8f12decebe89fb33169dec7103fe",
"score": "0.54804033",
"text": "def category_links(opts = {})\n opts = {:delimiter => ', ', :style_class => nil}.merge(opts)\n categories.reverse.map{|cat| cat.to_link(opts[:style_class]) }.join(opts[:delimiter])\n end",
"title": ""
},
{
"docid": "a44181fdddadfde3046499cf1e21b246",
"score": "0.5476493",
"text": "def load_categories\n @categories = []\n File.readlines(\"databases/\"+@short+\"/cats.lang\").each do |line|\n tab = line.split \";\"\n @categories[tab[0].to_i] = tab[1]\n end\n end",
"title": ""
},
{
"docid": "706dfe30c701fe7a482298c10e1c05c8",
"score": "0.547586",
"text": "def categories\n categories_h = Hash.new\n Dir[Pathname.new('month_*.yml').expand_path(@data_path)].each do |file_path|\n data = YAML.load_file(file_path)\n \n data['days'].each do |day_name, day_items|\n day_items.each do |entry|\n category_t = entry['category']\n if category_t.length > 0\n categories_h[category_t] = true\n end\n end\n end\n end\n \n categories_a = categories_h.keys.sort{ |a, b| a.downcase <=> b.downcase }\n default_index = categories_a.index('default')\n if !default_index.nil?\n categories_a.delete_at(categories_a.index('default'))\n end\n categories_a.unshift('default')\n categories_a\n end",
"title": ""
},
{
"docid": "dd87479a5e0b2e0aaffb6f8ab42a6e00",
"score": "0.54725504",
"text": "def build_file_pages\n\t\t\t\t@file_list.each do |f|\n\t\t\t\t\tbuild_file_page(f)\n\t\t\t\tend\n\t\t\tend",
"title": ""
},
{
"docid": "76b42b29967ed0eefb055d289a8c7a5b",
"score": "0.5472009",
"text": "def get_category_info(dir_path, paths)\n dir = Dir.new(dir_path)\n info = {\n \"href\" => dir_path.slice(7..-1),\n \"name\" => File.basename(dir_path),\n \"priority\" => 0,\n \"subs\" => [],\n }\n\n if paths.find { |a| a.include?(dir_path) }.nil?\n return nil\n end\n\n info_path = dir_path + \"/_category.yml\"\n if File.exists?(info_path)\n category_info = YAML.load_file(info_path)\n info[\"name\"] = category_info[\"name\"] if !category_info[\"name\"].nil?\n info[\"priority\"] = category_info[\"priority\"] if !category_info[\"priority\"].nil?\n end\n if info[\"href\"].nil?\n info[\"post_count\"] = 0\n else\n info[\"post_count\"] = @posts.docs.count { |a|\n a.data[\"category\"].start_with? info[\"href\"]\n }\n end\n\n dir.children.each do |file_name|\n file_path = File.join(dir_path, file_name)\n if File.directory?(file_path)\n subinfo = get_category_info(file_path, paths)\n if !subinfo.nil?\n info[\"subs\"] << subinfo\n end\n end\n end\n info[\"subs\"] = info[\"subs\"].sort_by { |a| a[\"priority\"] }\n return info\n end",
"title": ""
},
{
"docid": "9a39173312ba4ab09d1515b89daca3ee",
"score": "0.54586333",
"text": "def scrape_categories\n cats = []\n # sometimes multiple selectors are used for categories so iterate through \n # each one assuming commas as a separator\n self.retailer.category_selector.split('|').each do |selector|\n the_categories = doc.css(selector)\n the_categories.each do |cat|\n # find an existing category if it exists or initialise a new one if not\n # con't create it otherwise we will end up with dud entries when running\n # tests. New retailer categories shouldn't be saved until the item is saved\n linked_cat = Category.find_or_initialize_by_name(cat.content)\n # only add the category if it isn't already there\n (self.categories << linked_cat) unless self.categories.include? linked_cat\n end\n end\n end",
"title": ""
},
{
"docid": "435ffee42476f9fce11037c6fd4158c9",
"score": "0.5453222",
"text": "def categories\n @categories ||= yaml[\"categories\"] || []\n end",
"title": ""
},
{
"docid": "d3eb6d238da8a62b94512516c3eeabd4",
"score": "0.54385424",
"text": "def write_all_patents_to_file\n write_csv_file_and_header\n links = get_category_query_terms\n links.each do |link| \n puts \"fetching patents for category: #{link}\"\n patent_ids = parse_patent_ids_from_page(link)\n patent_ids.each { |patent_id| get_and_write_patent(patent_id)}\n end\nend",
"title": ""
},
{
"docid": "7f87ed3e4bcb02ac802bdeb7ca93c5c4",
"score": "0.5435267",
"text": "def buildIndex(content, dir = nil, level = 0)\n\tbuildIndex(content, 'text') && return if dir.nil?\n\t\t\n\tif level == 0\n\t content << \"\\nh1. (No Category)\\n\"\n\telse\n\t\tcontent << \"\\nh#{level}. #{File.basename(dir)}\\n\"\n\tend\n\n\tfiles(dir, '*.text') do |file|\n\t\tpage = File.basename(file, '.text')\n\t\tcontent << \"* \\\"#{page}\\\":./#{URI.escape(page)}.html\\n\"\n\tend\n\n\tfolders(dir) do |folder|\n\t\tbuildIndex(content, folder, level + 1)\n\tend\nend",
"title": ""
},
{
"docid": "75c83fb66b288f116de2098ff3043fad",
"score": "0.54338384",
"text": "def categories\n categories = []\n categories << \"Memory\" if memory\n categories << \"CPU\" if cpu\n categories << \"Network\" if network\n categories << \"Battery\" if battery\n categories\n end",
"title": ""
},
{
"docid": "7875697f3f21f85bf299c7434f13cbc6",
"score": "0.5430502",
"text": "def get_categories\n\t\t\tunpack(self.send(refernet_url(\"Category\")))\n\t\tend",
"title": ""
},
{
"docid": "0fd24c1482cad1e52742262e9a60eba7",
"score": "0.5425912",
"text": "def visit_category_list\n visit \"/portal/site/queestudiar/menuitem.d7cfc336363a7af8e85c7273b0c0e1a0/?vgnextoid=0a8137a9f4f2b210VgnVCM2000009b0c1e0aRCRD&vgnextchannel=0a8137a9f4f2b210VgnVCM2000009b0c1e0aRCRD&vgnextfmt=default\"\n end",
"title": ""
},
{
"docid": "81e6663fa0ddaabe6186ac0c3aaaea58",
"score": "0.5421495",
"text": "def index\n @categories = Category.toplevel ## NOTA: no se paginan arboles (de momento)\n end",
"title": ""
},
{
"docid": "fa288626a3dd78fd47d597e0c7c1c2b4",
"score": "0.54205704",
"text": "def categories\n @categories = [] if @categories.nil?\n @categories\n end",
"title": ""
},
{
"docid": "1978e1edd44408e07d3256d08c25a8ed",
"score": "0.54187596",
"text": "def categories\n render_with_cache('node-page::'+request.fullpath+'::'+@node.cache_key) { render('inventory/categories') } unless admin?\n end",
"title": ""
},
{
"docid": "5dd95d870c641f7947c6d9c05ffaa6f1",
"score": "0.5418392",
"text": "def categories\n unless self.SUPPRESS_FROM_OPAC == 'T' or self.SUPPRESS_FROM_INDEX == 'T'\n add_category('opac')\n end\n @categories\n end",
"title": ""
},
{
"docid": "efce1062dc9ea6e18373fe17e5c9dd42",
"score": "0.54168916",
"text": "def categories\n []\n end",
"title": ""
},
{
"docid": "c63566530694961d87056645a52087b8",
"score": "0.54161084",
"text": "def list_vuln_categories\n data = DataTable._get_dyn_table(self, '/data/vulnerability/categories/dyntable.xml?tableID=VulnCategorySynopsis')\n data.map { |c| c['Category'] }\n end",
"title": ""
},
{
"docid": "efcb5e10780279c84a4be599091f0268",
"score": "0.5397324",
"text": "def categories\n call_api('/categories')\n end",
"title": ""
},
{
"docid": "54abc9436ef6b337da03904bc7530d0f",
"score": "0.5394874",
"text": "def index\n @categories_documents = CategoriesDocument.all\n end",
"title": ""
},
{
"docid": "986116598fd76fd296a8f6176079ac17",
"score": "0.539455",
"text": "def all_category_documents\n redis.hgetall(\"#{@namespace}:category_documents\")\n end",
"title": ""
},
{
"docid": "d8e211ead702dcd612719173f81c8ef5",
"score": "0.53903157",
"text": "def scrap_category(category_page, month)\n puts \"creating post = #{@current_post_name}\"\n\n post = Post.create(id, @current_post_name)\n @post_id = post.id\n \n link_reg_exp = YAML.load_file('private-conf/websites.yml')[\"website1\"][\"link_reg_exp\"]\n links = category_page.links_with(:href => %r{#{link_reg_exp}})#[0..1]\n pp \"Found #{links.count} links\" \n links.each do |link|\n parse_image(link)\n end\n end",
"title": ""
},
{
"docid": "26f03dc2bf63fe8d827166241faa48be",
"score": "0.53864413",
"text": "def categories_with_color\n parent_folder.category_list.select { |c| categories.include?(c.name) }\n end",
"title": ""
},
{
"docid": "3f548a1dbd1f90f192db9b59b562d43d",
"score": "0.53857833",
"text": "def categories\n categories = []\n CATEGORIES.each do |item|\n categories.push(Item_Category.new(item[0], item[1]))\n end\n categories\n end",
"title": ""
},
{
"docid": "4d1173c57b30860f3416c4602cc9f402",
"score": "0.53819114",
"text": "def create_categories\n categories = PublicApinception::API.all.map { |api| api.category }.uniq\n PublicApinception::Category.new_from_array(categories)\n end",
"title": ""
},
{
"docid": "3eeac939741fef0c1d5fe76a7fa578dc",
"score": "0.5377114",
"text": "def categories\n @categories ||= @entry_element.select_all(\"./atom:category\").map do |category_element|\n Category.new(category_element.attr(\"term\"), category_element.attr(\"scheme\"))\n end\n end",
"title": ""
},
{
"docid": "4e03fafe39415f9960bdf6b9ef621e0e",
"score": "0.537478",
"text": "def categories(options, &definition)\n unless options[:ignore_categories]\n @category_scrapers ||= []\n @category_scrapers << CategoryScraper.new(self, options, &definition)\n end\n end",
"title": ""
},
{
"docid": "fd7fc4453e5911f6919e41ea8225b00b",
"score": "0.53747773",
"text": "def categories\n @category_templates.map do |template|\n category_hash_from_template(template[0])\n end\n end",
"title": ""
},
{
"docid": "3ba35df6734525023560cea73d5c83a6",
"score": "0.5372753",
"text": "def categories(options = {})\n perform_get_with_objects('/categories', options, Epages::Category)\n end",
"title": ""
},
{
"docid": "3ba35df6734525023560cea73d5c83a6",
"score": "0.5372753",
"text": "def categories(options = {})\n perform_get_with_objects('/categories', options, Epages::Category)\n end",
"title": ""
},
{
"docid": "02eb1394b5930e6b898fac9aea116e92",
"score": "0.5370766",
"text": "def index_for_category(category, category_folder, parent_folder)\n GeneratedCategoryIndexFile.new(\n category_folder,\n category,\n Yuzu::Generators.category_index_template(parent_folder.path.relative, category.name)\n )\n end",
"title": ""
},
{
"docid": "e837627ac964165845e68de1ba20d5fa",
"score": "0.53702265",
"text": "def print_category(c, indent)\n printf(\"%sname:%s\\n\", \" \" * indent, c[\"name\"])\n printf(\"%shref:%s\\n\", \" \" * indent, c[\"href\"])\n printf(\"%spriority:%s\\n\\n\", \" \" * indent, c[\"priority\"])\n\n for cs in c[\"subs\"]\n if !cs.nil?\n print_category(cs, indent + 4)\n end\n end\n end",
"title": ""
},
{
"docid": "7936a3db75185dd8f99e665bb4eddee3",
"score": "0.5362759",
"text": "def categories\n @categories ||= @entry_element.search('category').map do |category_element|\n Category.new(category_element.attribute('term').text, category_element.attribute('scheme').text)\n end\n end",
"title": ""
},
{
"docid": "3a46232c845d9ff19a83a9990fa7f3af",
"score": "0.5343345",
"text": "def create_tag_pages\n puts 'create tag pages'\n tag_set(items).each do |tag|\n items << Nanoc3::Item.new(\n \"<%= render('_tag_page', :tag => '#{tag}')%>\", # use locals to pass data\n { :title => \"Category: #{tag}\", :is_hidden => true}, # do not include in sitemap.xml\n \"/tags/#{tag}/\", # identifier\n :binary => false\n )\n end\nend",
"title": ""
},
{
"docid": "7a953900a0c0ea3ab33d403e94e81c7d",
"score": "0.5338732",
"text": "def category_edit_support_flatlist(categories)\n\tret = ''\n\tret << '<div class=\"field title\">'\n\tret << \"#{@category_conf_label}:\\n\"\n\tcategories.each do |c|\n\t\tret << %Q!| <span class=\"category-item\">#{h c}</span>\\n!\n\tend\n\tret << \"|\\n</div>\\n<br>\\n\"\n\tret\nend",
"title": ""
},
{
"docid": "d7b0b4c4fa809885e5098652c7bd3d0e",
"score": "0.5338008",
"text": "def get_categories\n metadata['catgry'].collect do | category |\n Category.new category\n end\n end",
"title": ""
},
{
"docid": "53b5996dc401f757b74185bc77a589f0",
"score": "0.5336715",
"text": "def index\n @carnival_categories = Carnival::Category.all\n end",
"title": ""
},
{
"docid": "cefceaf25076fe4bb2bacaef5ba283cd",
"score": "0.53352404",
"text": "def create_contents_and_index\n contents = []\n index = []\n\n (@files+@classes).sort.each do |entry|\n\tcontent_entry = { \"c_name\" => entry.name, \"ref\" => entry.path }\n\tindex << { \"name\" => entry.name, \"aref\" => entry.path }\n\n\tinternals = []\n\n\tmethods = entry.build_method_summary_list(entry.path)\n\n\tcontent_entry[\"methods\"] = methods unless methods.empty?\n contents << content_entry\n\tindex.concat methods\n end\n\n values = { \"contents\" => contents }\n template = TemplatePage.new(RDoc::Page::CONTENTS)\n File.open(\"contents.hhc\", \"w\") do |f|\n\ttemplate.write_html_on(f, values)\n end\n\n values = { \"index\" => index }\n template = TemplatePage.new(RDoc::Page::CHM_INDEX)\n File.open(\"index.hhk\", \"w\") do |f|\n\ttemplate.write_html_on(f, values)\n end \n end",
"title": ""
},
{
"docid": "ab85b0e8512b86cb3699f06f48ba3030",
"score": "0.5328888",
"text": "def index\n @forum_categories = Forum::Category.all\n end",
"title": ""
}
] |
036d3ae18bc113e4b712f5a6c644b8a2
|
input: string output: boolean true if all are uppercase. false otherwise. ignore non alphabetic characters
|
[
{
"docid": "88558428bb95b30469f1d23e59f51b71",
"score": "0.836456",
"text": "def uppercase?(string)\n string.chars.all? do |char|\n char.match(/[A-Z]/)\n end \nend",
"title": ""
}
] |
[
{
"docid": "d2b8ea434526bff9b2b3775d5f37aba2",
"score": "0.8402715",
"text": "def uppercase?(string)\n result = true\n string.chars.each do |char|\n result = false if char.match(/[a-zA-Z]/) && char.upcase != char\n end\n result\nend",
"title": ""
},
{
"docid": "afe34211a2eb25dc11639a5dafd76c61",
"score": "0.83487535",
"text": "def all_upper?\n tr('^A-Za-z', '').split('').all? { |c| ('A'..'Z').to_a.include? c }\n end",
"title": ""
},
{
"docid": "a0ae308e27c2852d6b05e838e83f70ec",
"score": "0.83295494",
"text": "def uppercase?(str)\n str.each_char do |char|\n return false if char =~ /[a-z]/\n end\n true\nend",
"title": ""
},
{
"docid": "853b47a41356a4a01d68d6e67e2c547e",
"score": "0.8288613",
"text": "def uppercase?(str)\n str =~ /[a-z]/ ? false : true \nend",
"title": ""
},
{
"docid": "e46c8416f358fb582e121924678f8b14",
"score": "0.82756853",
"text": "def uppercase?(str)\n return_val = true\n str.each_char do |chr|\n if chr =~ /[a-z]/i\n chr =~ /[A-Z]/ ? return_val : return_val = !return_val\n end\n end\n return_val\nend",
"title": ""
},
{
"docid": "26f2b708bc44afe2e5d38ca2a488e1c8",
"score": "0.8247989",
"text": "def uppercase?(str)\n return_val = true\n str.each_char do |chr|\n if chr =~ /[a-z]/i && chr =~ /[A-Z]/\n return_val\n elsif chr =~ /[a-z]/i && chr =~ /[^A-Z]/\n return_val = !return_val\n elsif chr =~ /[^a-z]/i\n return_val\n end\n end\n return_val\nend",
"title": ""
},
{
"docid": "f3ae63b8defc24cad980e0af57fad3b3",
"score": "0.8241916",
"text": "def uppercase?(string)\n string.match(/[a-z]/) ? false : true\nend",
"title": ""
},
{
"docid": "0ee9a700ae9dec7ae2f3fbca63b111e5",
"score": "0.8235171",
"text": "def uppercase?(str)\nend",
"title": ""
},
{
"docid": "33b918564f238a3ec094759598bcf1e6",
"score": "0.8233022",
"text": "def uppercase?(str)\n is_true = true\n str.each_char do |char|\n if char =~ /[[:alpha:]]/\n is_true = false if char == char.downcase\n end\n end\n \n is_true\nend",
"title": ""
},
{
"docid": "32465a6d4bb98d6873d0ea97edfc0e6e",
"score": "0.8221815",
"text": "def upper?(password)\n password.gsub(/[A-Z]/, '') != password\nend",
"title": ""
},
{
"docid": "eb6b751c308098952f82470a555d7506",
"score": "0.82166725",
"text": "def uppercase?(str)\r\n str.chars.all?{ |letter| letter.upcase == letter }\r\nend",
"title": ""
},
{
"docid": "63ba8b7631a65e48160450f4b4edb2f6",
"score": "0.818946",
"text": "def uppercase?(str)\n str.each_char do |char|\n return false if char != char.upcase\n end\n true\nend",
"title": ""
},
{
"docid": "286357db556991ad734fb66c1b9470d4",
"score": "0.8184706",
"text": "def uppercase2?(str)\n str !~ /[a-z]/\nend",
"title": ""
},
{
"docid": "5f2fe14bf8fb2a6be8c70f4416d6a473",
"score": "0.8183047",
"text": "def uppercase?(str)\n str.match?(/[a-z]/) ? false : true\nend",
"title": ""
},
{
"docid": "4a21c5f8c2ef8301683f633bb182a6dd",
"score": "0.8172548",
"text": "def uppercase?(str)\n !(str =~ /[a-z]/)\nend",
"title": ""
},
{
"docid": "6a7db046aa4757f43839e2913fdbffb2",
"score": "0.815494",
"text": "def upper?(str)\n !!str.match('^[A-Z]+$');\nend",
"title": ""
},
{
"docid": "ab1c3c3180d17022909ca04415757869",
"score": "0.81407964",
"text": "def uppercase?(str)\n str.chars.all? {|x| x == x.upcase }\nend",
"title": ""
},
{
"docid": "6bc43f4774455e9713d7535b2b1f1f7e",
"score": "0.8120132",
"text": "def uppercase?(string)\n !string.match?(/[a-z]/)\nend",
"title": ""
},
{
"docid": "66886975a012fed4b6c0ab849b520dd7",
"score": "0.8106337",
"text": "def uppercase?(string)\n string.each_char do |char|\n return false if ('a'..'z').cover?(char)\n end\n true\nend",
"title": ""
},
{
"docid": "534d10b932a8c6b61547ef01c5a210bd",
"score": "0.80978",
"text": "def uppercase?(str)\n only_alpha = str.chars.select { |char| ('A'..'Z').include?(char) || ('a'..'z').include?(char) }\n return false if !only_alpha.any? { |char| ('A'..'Z').include?(char) }\n only_alpha.all? { |char| ('A'..'Z').include?(char) }\nend",
"title": ""
},
{
"docid": "1a9352d51adb94abf89c466fd0b11091",
"score": "0.80843997",
"text": "def uppercase?(str)\n str.each_char { |char| return false if (97..122).include?(char.ord) }\n true\nend",
"title": ""
},
{
"docid": "cc10b7d2a894afb00068b88a96b45cea",
"score": "0.8077568",
"text": "def has_only_uppercase_chars\n !get_cap_chars.empty? && get_lower_chars.empty?\n end",
"title": ""
},
{
"docid": "097b2ece20f8d537e5f169d593f8c871",
"score": "0.80593085",
"text": "def uppercase?(str)\n return false if str.scan(/\\w/).any? {|letter| letter =~ /[a-z]/}\n true\nend",
"title": ""
},
{
"docid": "c56176c01a01108fbb671d5dc16147f1",
"score": "0.8016406",
"text": "def uppercase?(string)\n check = string.chars.select { |char| char =~ /[a-z]/ }.join\n check == check.upcase\nend",
"title": ""
},
{
"docid": "97a0296c2f4c924f185e22e539ded573",
"score": "0.8012996",
"text": "def uppercase?(string)\n string.chars.all? { |char| char == char.upcase }\nend",
"title": ""
},
{
"docid": "365b78ab1498236c30f7349eccd4b7bd",
"score": "0.80080414",
"text": "def uppercase?(str)\n alpha = ('A'..'Z').to_a\n str.chars.each do |char|\n if alpha.include?(char.upcase)\n if !alpha.include?(char)\n return false\n end\n end\n end\n true\nend",
"title": ""
},
{
"docid": "46d30d6163a8af30a7c37e13f325557b",
"score": "0.8005644",
"text": "def uppercase?(str)\n upcase_arr = str.chars.select do |char|\n char == char.upcase\n end\n upcase_arr == str.chars\nend",
"title": ""
},
{
"docid": "ddb60f79a67176c1ff96460f2b83201f",
"score": "0.80042404",
"text": "def uppercase?(string)\n upper_array = string.each_char.select { |char| char =~ /[^a-z]/ }\n upper_array.join == string\nend",
"title": ""
},
{
"docid": "8d27b17b7497fff35d1e47888804e9ab",
"score": "0.79780793",
"text": "def is_uppercase?(word)\n word == word.upcase\nend",
"title": ""
},
{
"docid": "2f2757dbd6415941cfe99214b0ad38b1",
"score": "0.79696876",
"text": "def uppercase?(string)\n characters_arr = string.split('')\n downcase_total = characters_arr.count {|char| char.upcase != char}\n downcase_total > 0 ? false : true\nend",
"title": ""
},
{
"docid": "82b661b3241f2a577431061198f29e95",
"score": "0.7952723",
"text": "def uppercase? (string)\n string.upcase == string ? true : false\nend",
"title": ""
},
{
"docid": "72105aa9d9c2dd984bb2528b8b4aa08d",
"score": "0.7944577",
"text": "def uppercase?(str)\n string_array = str.chars\n string_array.all? { |char| char.upcase == char }\nend",
"title": ""
},
{
"docid": "93849e1eaf331c89e1a29e0cc9878962",
"score": "0.78922266",
"text": "def is_uppercase_letter?(ascii)\n ascii >= 65 && ascii <= 90\nend",
"title": ""
},
{
"docid": "b85965a6c411a298b5c09a978581a5d7",
"score": "0.78796226",
"text": "def uppercase?(string)\n string.upcase == string\nend",
"title": ""
},
{
"docid": "b85965a6c411a298b5c09a978581a5d7",
"score": "0.78796226",
"text": "def uppercase?(string)\n string.upcase == string\nend",
"title": ""
},
{
"docid": "b85965a6c411a298b5c09a978581a5d7",
"score": "0.78796226",
"text": "def uppercase?(string)\n string.upcase == string\nend",
"title": ""
},
{
"docid": "c951a3ef02a147ef445de49485606fa4",
"score": "0.7875532",
"text": "def has_upcase?\n if self =~/[A-Z]/\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "cb842c26adf1414693e18f19a4470161",
"score": "0.78743017",
"text": "def uppercase?(string)\n string == string.upcase ? true : false\nend",
"title": ""
},
{
"docid": "9dcc0260c423a68058f8268101f20f10",
"score": "0.7871091",
"text": "def upperCase?(x)\n x =~ /[A-Z]/\n end",
"title": ""
},
{
"docid": "e5b690c55095e26f26277bd585982145",
"score": "0.7862875",
"text": "def uppercase?(str)\n str.upcase == str\nend",
"title": ""
},
{
"docid": "e5b690c55095e26f26277bd585982145",
"score": "0.7862875",
"text": "def uppercase?(str)\n str.upcase == str\nend",
"title": ""
},
{
"docid": "e5c409ea43b54f640e28ce1fed3e29ba",
"score": "0.78611094",
"text": "def uppercase?(str)\n str = str.match(/[a-z]*/i).to_s\n str == str.upcase\nend",
"title": ""
},
{
"docid": "a1ea921ab441e38d334b59dd1c9f60c6",
"score": "0.7850711",
"text": "def uppercase?(string)\r\n string == string.upcase\r\nend",
"title": ""
},
{
"docid": "6b2c22625800e54c9fd4729e56825a7d",
"score": "0.7849922",
"text": "def uppercase?(str)\n letters = str.chars.keep_if { |char| char.match?(/[[:alpha:]]/) }\n !letters.any? { |char| char == char.downcase }\nend",
"title": ""
},
{
"docid": "54ffbf7d986a3c6af262f13248a78cc7",
"score": "0.7837117",
"text": "def uppercase?(str)\n\tstr.upcase == str\nend",
"title": ""
},
{
"docid": "9554f6d25e8677363b9b4b9f67c75746",
"score": "0.78052735",
"text": "def is_upper(str)\n str[/[A-Z]+/] == str\nend",
"title": ""
},
{
"docid": "15b5bd7c8973c2339f8df341d9f0e867",
"score": "0.78045845",
"text": "def uppercase?(text)\n text == text.upcase\nend",
"title": ""
},
{
"docid": "64c8ef9777aa4e5aa1c804ca60af84fb",
"score": "0.77772015",
"text": "def old_uppercase?(str)\n str == str.upcase\nend",
"title": ""
},
{
"docid": "ef9aab44f1b33efe02c5af6cd087a7e1",
"score": "0.7765822",
"text": "def uppercase?(str)\n str == str.upcase\nend",
"title": ""
},
{
"docid": "ef9aab44f1b33efe02c5af6cd087a7e1",
"score": "0.7765822",
"text": "def uppercase?(str)\n str == str.upcase\nend",
"title": ""
},
{
"docid": "b4a266cb11fd2181a6f93e20c334f017",
"score": "0.7757068",
"text": "def capitalized?(word)\n word.match(/^[A-Z]/) ? true : false\n end",
"title": ""
},
{
"docid": "064d5f2cbfa9992541fa3059a94e84d3",
"score": "0.774286",
"text": "def uppercase?(string)\n string == string.upcase\nend",
"title": ""
},
{
"docid": "064d5f2cbfa9992541fa3059a94e84d3",
"score": "0.774286",
"text": "def uppercase?(string)\n string == string.upcase\nend",
"title": ""
},
{
"docid": "064d5f2cbfa9992541fa3059a94e84d3",
"score": "0.774286",
"text": "def uppercase?(string)\n string == string.upcase\nend",
"title": ""
},
{
"docid": "064d5f2cbfa9992541fa3059a94e84d3",
"score": "0.774286",
"text": "def uppercase?(string)\n string == string.upcase\nend",
"title": ""
},
{
"docid": "064d5f2cbfa9992541fa3059a94e84d3",
"score": "0.774286",
"text": "def uppercase?(string)\n string == string.upcase\nend",
"title": ""
},
{
"docid": "064d5f2cbfa9992541fa3059a94e84d3",
"score": "0.774286",
"text": "def uppercase?(string)\n string == string.upcase\nend",
"title": ""
},
{
"docid": "064d5f2cbfa9992541fa3059a94e84d3",
"score": "0.774286",
"text": "def uppercase?(string)\n string == string.upcase\nend",
"title": ""
},
{
"docid": "064d5f2cbfa9992541fa3059a94e84d3",
"score": "0.774286",
"text": "def uppercase?(string)\n string == string.upcase\nend",
"title": ""
},
{
"docid": "95869eb772c93f9cc233be21eb79025a",
"score": "0.7733108",
"text": "def capitalized?\n self.match(/^[[:upper:]]/) ? true : false\n end",
"title": ""
},
{
"docid": "fb910efc8bc69625e35d4d1bf3e96eb5",
"score": "0.7732851",
"text": "def uppercase?(word)\n word == word.upcase\nend",
"title": ""
},
{
"docid": "ae955578baac85286af83d9abc8a652c",
"score": "0.7728754",
"text": "def uppercase_?(str)\n str == str.upcase\nend",
"title": ""
},
{
"docid": "fd23de22483e011ada99320d9013e435",
"score": "0.7694913",
"text": "def is_upper?(c)\n return c == c.capitalize\n end",
"title": ""
},
{
"docid": "58546b275bf21eb4f042456a29c072b9",
"score": "0.76598054",
"text": "def upcase?(string)\n result_arr = string.chars.select do |letter|\n letter =~ /[A-Za-z]/\n end\n result_arr.all? do |letter|\n letter == letter.upcase\n end\nend",
"title": ""
},
{
"docid": "c0259ecaf033828e16d80894a138fef9",
"score": "0.7657244",
"text": "def uppercase?(string)\n if string == string.upcase\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "911729e8b3686b26babc9c30efa5a1cd",
"score": "0.7629756",
"text": "def is_capitalized?(word)\r\n if word.strip[0] =~ /[A-Z]/\r\n return true\r\n end\r\n return false\r\n end",
"title": ""
},
{
"docid": "eca41f7c714494d77107238eb9e0701c",
"score": "0.7568862",
"text": "def is_upper?(c)\n\t\t\treturn c >= 'A' && c <= 'Z'\n\t\tend",
"title": ""
},
{
"docid": "634188b040aa363a9f658102acdac1f9",
"score": "0.752007",
"text": "def valid_upcase?(char)\n char == char.upcase && char != char.swapcase\nend",
"title": ""
},
{
"docid": "f2b1045b7ecd2b71ad8925ee1e4f5b2b",
"score": "0.7519995",
"text": "def require_uppercase_characters\n data.require_uppercase_characters\n end",
"title": ""
},
{
"docid": "09aa284a24d754a85a1ad4f096d92fd9",
"score": "0.75163794",
"text": "def uppercase?(string)\n string.empty? ? false : string == string.upcase\nend",
"title": ""
},
{
"docid": "6c978e270f4920c051f70608c3d63d7b",
"score": "0.74957967",
"text": "def require_uppercase_characters\n data[:require_uppercase_characters]\n end",
"title": ""
},
{
"docid": "8f58099f29a532ff70820496f6175bad",
"score": "0.7488056",
"text": "def capital?(char)\n char.upcase == char\n end",
"title": ""
},
{
"docid": "2d7bbcb70f6d8b3b6f97878b9915c2de",
"score": "0.7475544",
"text": "def proper(word)\n /[[:upper:]]/.match(word) != nil\nend",
"title": ""
},
{
"docid": "8868fe56a566bbf3b8ad0e047953e9f8",
"score": "0.7475399",
"text": "def is_uppercase?(orginial_value)\n orginial_value > 64 && orginial_value < 91\nend",
"title": ""
},
{
"docid": "1ab86bb2d0f486ee1675273013e6dd4a",
"score": "0.74501806",
"text": "def is_capital?(char)\n char >= \"A\" && char <= \"Z\"\n end",
"title": ""
},
{
"docid": "54e20a8f18cf45f9304dc76bc6ba2891",
"score": "0.7437727",
"text": "def starts_with_uppercase? word\n if word =~ /^[A-Z]/\n return true\n end\n\n false\n end",
"title": ""
},
{
"docid": "5007d87c6f8459184a96b9b1464e7916",
"score": "0.74317086",
"text": "def has_upper_and_lowercase(str)\n if str.count('A-Z') >= 1 && str.count('a-z') >= 1\n 'True'\n else\n 'False'\n end\nend",
"title": ""
},
{
"docid": "b2276c5e9f57cc8985948488e620632e",
"score": "0.738196",
"text": "def capital_checker(talk) #return false if there's a lowercase letter\n lower_case = ('a'..'z').to_a\n i = 0\n n = talk.length - 1\n while i < n\n lower_case.each do |char|\n if talk[i] == char\n return false\n end\n end\n i += 1\n end\n return true\nend",
"title": ""
},
{
"docid": "193a3060ec0fadea1552d7b7fc76143f",
"score": "0.73654467",
"text": "def uppercase(str)\n str == str.upcase\nend",
"title": ""
},
{
"docid": "aa4a87034b3553612913a1f0bfb633fa",
"score": "0.73286456",
"text": "def detect_capital_use(word)\n output = true\n word_arr = word.split(\"\")\n remaining_word = word_arr[1..word_arr.length-1].join\n if word_arr[0] == word_arr[0].upcase\n output = false if remaining_word != remaining_word.upcase && remaining_word != remaining_word.downcase\n else\n output = false if remaining_word != remaining_word.downcase\n end\n output\nend",
"title": ""
},
{
"docid": "86ea5a4704e6a500d5a748c99cf1ff67",
"score": "0.7322078",
"text": "def mixedcase?\n if self =~/[A-Z]/ and self =~/[a-z]/\n true\n else\n false\n end\n end",
"title": ""
},
{
"docid": "68bcd04c5209beddfadfe7c5caff7bfc",
"score": "0.73192877",
"text": "def is_upcase?(letter) \r\n\t('A'..'Z').include?(letter)\r\nend",
"title": ""
},
{
"docid": "7155e776425386b0ff3f8d614f5fd904",
"score": "0.7290589",
"text": "def all_upcase?(name)\n return name == name.upcase\nend",
"title": ""
},
{
"docid": "d905f588dab482b3cd86cb732d77b6d7",
"score": "0.7281066",
"text": "def is_capitalized(word)\n\n# \tword[0] the chr at first index\n# \tword[1..-1] the chr's in the rest index\n\tif word[0] == word[0].upcase && word[1..-1] == word[1..-1].downcase\n \treturn true\n \telse\n \treturn false\n \tend\nend",
"title": ""
},
{
"docid": "64485b0f9cbe8e4bb19d2209ab3c4cf5",
"score": "0.7260389",
"text": "def detect_capital_use(word)\n char_lower = nil\n \n word.each_char.with_index do |char, index|\n if index == 0 || (index == 1 && char_lower == false)\n char_lower = is_lower(char)\n \n next\n end\n \n return false if char_lower != is_lower(char) \n end\n \n true\nend",
"title": ""
},
{
"docid": "8e8a6023bae28101d482bd6b058547c3",
"score": "0.72581637",
"text": "def isUpperCaseOnly(pwd)\n !(pwd.index(/[A-Z]+/).nil?) and (pwd.index(/^a-zA-Z0-9/).nil? and pwd.index(/[0-9]+/).nil? and pwd.index(/[a-z]+/).nil?)\nend",
"title": ""
},
{
"docid": "14a608012793f66c3b9dcab5337c6750",
"score": "0.72522295",
"text": "def letters_is_upcase?(letters)\n return true if letters = letters.upcase\n return false\n end",
"title": ""
},
{
"docid": "39825783464f859d5a1d01a958457de9",
"score": "0.724718",
"text": "def destructive_uppercase(str)\n answer = \"\"\n str.each_char do |chr|\n if chr.downcase != chr\n answer += chr\n end\n end\n return answer\nend",
"title": ""
},
{
"docid": "45a5083fc814bd717b8a8ad91f6b524f",
"score": "0.72382",
"text": "def uppercase(string)\n string === string.upcase\nend",
"title": ""
},
{
"docid": "a30036676ec9e526aa04dd027b6dd8fc",
"score": "0.7237003",
"text": "def is_lower?(letter)\r\n letter != letter.upcase #if letter is not uppercase return true, else return false\r\nend",
"title": ""
},
{
"docid": "ae164b4766ddf8abb53f244630513021",
"score": "0.7201982",
"text": "def starts_with_capital?(word)\n return /^[[:upper:]]/.match(word)\nend",
"title": ""
},
{
"docid": "ee7a1697cb22f857195a1460e3c7e023",
"score": "0.7187781",
"text": "def yelling?\n input.upcase == input && input =~ /[A-Z]/\n end",
"title": ""
},
{
"docid": "bfd3b0cc872577e21f92ed64b892adf6",
"score": "0.7176267",
"text": "def destructive_uppercase(str)\n uppercase_letters = ''\n ('A'..'Z').each do |ch|\n if str.include?(ch)\n uppercase_letters << ch\n end\n end\n uppercase_letters\nend",
"title": ""
},
{
"docid": "96e41369ac0cfc43ad8f82363e144759",
"score": "0.71736354",
"text": "def upcase?(str)\n ('A'..'Z').to_a.include?(str)\nend",
"title": ""
},
{
"docid": "5b0ffa9ecb84aca455a65931ac0ec9fe",
"score": "0.71537864",
"text": "def yelling?(string)\n string == string.upcase\nend",
"title": ""
},
{
"docid": "b34e375609ccdf9f691daab8737c1ef7",
"score": "0.7144249",
"text": "def alphabet(string)\n string == string.upcase\nend",
"title": ""
},
{
"docid": "cb782e5775e9801d9860271ae4137823",
"score": "0.7118705",
"text": "def upcase?(letter)\n ('A'..'Z').include?(letter)\nend",
"title": ""
},
{
"docid": "09a0fc12ce14cff50e92e7af42715db7",
"score": "0.7100851",
"text": "def is_upcase?\n self == upcase\n end",
"title": ""
},
{
"docid": "c83795324f0013c2a40c5e5ac253dd9c",
"score": "0.70919377",
"text": "def destructive_uppercase(str)\n result = \"\"\n str.each_char {|ch| result.concat(ch) if ch.downcase != ch}\n result\nend",
"title": ""
},
{
"docid": "c4b2489a745b2fc60b1c6dcd97f388dd",
"score": "0.7069961",
"text": "def destructive_uppercase(str)\n str.split(\"\").select{|c| c==c.upcase}.join(\"\")\nend",
"title": ""
}
] |
b86c32b6a5c21ef5074ed7046c8bfd4f
|
Compute the direction between the first number and the second. Arguments : +startPos+ > the starting position +currentPos+ > the end position Returns : 1 if the direction is negative 0 if the direction is null +1 if the direction is positive
|
[
{
"docid": "ed89f231c16742562affb60cf64fcd9b",
"score": "0.7521163",
"text": "def calcDirection(startPos, currentPos)\n\t\t# clamp() is available in Ruby 2.4 only\n\t\t# https://bugs.ruby-lang.org/issues/10594\n\t\t# so this is a quick equivalent of\n\t\t# return (currentPos - startPos).clamp(-1, 1)\n\t\tres = currentPos - startPos\n\t\tmin = -1\n\t\tmax = 1\n\t\treturn [[max, res].min, min].max\n\tend",
"title": ""
}
] |
[
{
"docid": "f47ca9def7e4c6ceb8e3084bb1033092",
"score": "0.6831465",
"text": "def direction(current_node, destination_node)\n direction = [ destination_node.y - current_node.y, # down/up\n destination_node.x - current_node.x ] # negative: left, positive: right\n\n return 2 if direction[0] > 0 and direction[1] == 0 # south\n return 4 if direction[1] < 0 and direction[0] == 0 # west\n return 8 if direction[0] < 0 and direction[1] == 0 # north\n return 6 if direction[1] > 0 and direction[0] == 0 # east\n\n return 0 # default\n end",
"title": ""
},
{
"docid": "5881a94767bae2270f71a2001660bf8e",
"score": "0.65997803",
"text": "def direction(p1, p2)\t\t\n if (p1.x < p2.x) then return -1 end\t# p1 is less than p2.\n if (p1.x > p2.x) then return 1\tend # p1 is greater than p2.\n if (p1.y < p2.y) then return -1\tend # p1 is less than p2.\n if (p1.y > p2.y) then return 1\tend # p1 is greater than p2.\n return 0 # p1 is equal to p2.\n end",
"title": ""
},
{
"docid": "f4546398fdddde1b9a9c198ddc7c2480",
"score": "0.65706074",
"text": "def find_direction(new_position, initial_position)\n pos_diff = [\n new_position[0].to_i - initial_position[0].to_i, \n new_position[1].to_i - initial_position[1].to_i\n ]\n \n # Need to scale the value down to eliminate extra cases to change. e.g. moving from position 2,2 to 0,0\n pos_diff_scaled = []\n pos_diff_scaled[0] = pos_diff[0] == 0 ? 0 : pos_diff[0]/pos_diff[0].abs\n pos_diff_scaled[1] = pos_diff[1] == 0 ? 0 : pos_diff[1]/pos_diff[1].abs\n\n case pos_diff_scaled\n when [0,1]\n return :N\n when [1,1]\n return :NE\n when [1,0]\n return :E\n when [1,-1]\n return :SE\n when [0,-1]\n return :S\n when [-1,-1]\n return :SW\n when [-1,0]\n return :W\n when [-1,1]\n return :NW\n end\n\n return nil\n end",
"title": ""
},
{
"docid": "1a1372363f9473a725397a1e6053dc7a",
"score": "0.646114",
"text": "def direction\n end_point - start_point\n end",
"title": ""
},
{
"docid": "94d4e4757246ef4391e4da914e798065",
"score": "0.632079",
"text": "def get_direction\n return @dir if !@dir.nil?\n return 0 \n end",
"title": ""
},
{
"docid": "547a77f1a8199e21cae228bee1265181",
"score": "0.6248072",
"text": "def relative_direction(from, to)\n # first, look for the case where the maze wraps, and from and to\n # are on opposite sites of the grid.\n if wrap_x? && from[1] == to[1] && (from[0] == 0 || to[0] == 0) && (from[0] == @width-1 || to[0] == @width-1)\n if from[0] < to[0]\n W\n else\n E\n end\n elsif wrap_y? && from[0] == to[0] && (from[1] == 0 || to[1] == 0) && (from[1] == @height-1 || to[1] == @height-1)\n if from[1] < to[1]\n N\n else\n S\n end\n elsif from[0] < to[0]\n if from[1] < to[1]\n SE\n elsif from[1] > to[1]\n NE\n else\n E\n end\n elsif from[0] > to[0]\n if from[1] < to[1]\n SW\n elsif from[1] > to[1]\n NW\n else\n W\n end\n elsif from[1] < to[1]\n S\n elsif from[1] > to[1]\n N\n else\n # same point!\n nil\n end\n end",
"title": ""
},
{
"docid": "c8eb5170ed56ec5c5f3edea21718cde4",
"score": "0.62217665",
"text": "def validPos?(direction, startPos, currentPos)\n\t\tif direction == 0 then\n\t\t\treturn currentPos == startPos\n\t\telsif direction > 0 then\n\t\t\treturn currentPos > startPos\n\t\telse\n\t\t\treturn currentPos < startPos\n\t\tend\n\tend",
"title": ""
},
{
"docid": "1da31da2968dbaf1062e0a9f5866ad00",
"score": "0.6147145",
"text": "def direction\n if to_x - from_x > 0\n return EAST\n elsif to_x - from_x < 0\n return WEST\n end\n\n if to_y - from_y > 0\n return SOUTH\n elsif to_y - from_y < 0\n return NORTH\n end\n\n distance_to_center_x = trial_move_turn.trial.fortress_center_point.x - from_x\n distance_to_center_y = trial_move_turn.trial.fortress_center_point.y - from_y\n if distance_to_center_y.abs < distance_to_center_x.abs\n if 0 < distance_to_center_x\n return EAST if trial_squad.intruder_flg\n return WEST\n else\n return WEST if trial_squad.intruder_flg\n return EAST\n end\n else\n if 0 < distance_to_center_y\n return SOUTH if trial_squad.intruder_flg\n return NORTH\n else\n return NORTH if trial_squad.intruder_flg\n return SOUTH\n end\n end\n end",
"title": ""
},
{
"docid": "eb7d8ef5b05372d73a3d1ad86c05f33b",
"score": "0.6139598",
"text": "def direction_to(a, b)\n fail \"#{[a, b]} not contiguous!\" unless contiguous?([a, b])\n fail \"#{a} == #{b}!\" if a == b\n\n if column_of(a) == column_of(b)\n return a < b ? :bottom : :top\n else\n return a < b ? :right : :left\n end\n fail\n end",
"title": ""
},
{
"docid": "990f3ca1dcfe653bacd9037be376cfb5",
"score": "0.61030203",
"text": "def calc_dir(from, to)\n from_x, from_y = *from\n to_x, to_y = *to\n\n if from_y == to_y\n return :E if from_x - to_x == -1\n return :W if from_x - to_x == 1\n elsif from_x == to_x\n return :S if from_y - to_y == -1\n return :N if from_y - to_y == 1\n end\n end",
"title": ""
},
{
"docid": "8e8e6b7e3d8d42a769496d5affab88c1",
"score": "0.60749",
"text": "def direction (fx, fy, tx, ty)\n #puts \"(#{fx},#{fy}) -> (#{tx},#{ty})\"\n return case\n when (fx < tx && fy < ty) then N # +y __/++\\__ +x\n when (fx < tx && fy == ty) then NE # /0+\\__/+0\\\n when (fx == tx && fy > ty) then SE # \\__/00\\__/\n when (fx > tx && fy > ty) then S # /-0\\__/0-\\\n when (fx > tx && fy == ty) then SW # \\__/--\\__/\n when (fx == tx && fy < ty) then NW # -x \\__/ -y\n end\n end",
"title": ""
},
{
"docid": "d36601329cb9b03550c9f4f702a8b958",
"score": "0.59863347",
"text": "def forward_dir\n if @start_pos[0] == 1 \n 1\n else\n -1\n end\n end",
"title": ""
},
{
"docid": "c04662ce718ed4768ada94937271cdcb",
"score": "0.5981995",
"text": "def direction_to(a, b)\n fail \"#{[a, b]} not contiguous!\" unless contiguous?(rows, cols, [a, b])\n fail \"#{a} == #{b}!\" if a == b\n\n if column_of(a) == column_of(b)\n return a < b ? :bottom : :top\n else\n return a < b ? :right : :left\n end\n fail\n end",
"title": ""
},
{
"docid": "cdd66556b42fe49e5ddf73e99d9e4d29",
"score": "0.5887835",
"text": "def getDirection(x1, y1, x2, y2)\n\treturn Vector[x2 - x1, y2 - y1].normalize\nend",
"title": ""
},
{
"docid": "d789ce1a6221fe0820b84c361b04da5a",
"score": "0.58412004",
"text": "def valid_direction?(start_pos, end_pos)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "9c521f552f7fa49f65e8515e4dce01bf",
"score": "0.5794927",
"text": "def point_from_direction(start, dir)\n dir_arr = dir.split('')\n direction = dir_arr.shift\n distance = dir_arr.join('').to_i\n\n case direction\n when 'U'\n return [start.first, start.last - distance]\n when 'D'\n return [start.first, start.last + distance]\n when 'L'\n return [start.first - distance, start.last]\n when 'R'\n return [start.first + distance, start.last]\n else\n raise \"Found invalid direction: #{direction}\"\n end\nend",
"title": ""
},
{
"docid": "7f8dfd0422425cec272e9d9f81848010",
"score": "0.5781768",
"text": "def direction(prev, cur)\n dr = prev[0] - cur[0]\n dc = prev[1] - cur[1]\n case [dr, dc]\n when [1, 0]\n 'n'\n when [-1, 0]\n 's'\n when [0, 1]\n 'w'\n when [0, -1]\n 'e'\n else\n raise \"FFFFFFFFFFFFFFFFUUUUUUUUUUUUUU\"\n end\n end",
"title": ""
},
{
"docid": "7dfe92a330cf5da9b2adc0aa0b4ed4f7",
"score": "0.5767078",
"text": "def check_direction(origin, destination)\n\t\tif origin[0] == destination[0]\n\t\t\treturn \"V\"\n\t\telsif origin[1] == destination[1]\n\t\t\treturn \"H\"\n\t\telsif (origin[0]-destination[0]).abs == (origin[1]-destination[1]).abs\n\t\t\treturn \"D\"\n\t\telsif ((origin[0]-destination[0]).abs == 2 && (origin[1]-destination[1]).abs == 1) || ((origin[0]-destination[0]).abs == 1 && (origin[1]-destination[1]).abs == 2)\n\t\t\treturn \"L\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f97d528564f1518b0f9d7b896a60fc0d",
"score": "0.5721392",
"text": "def direction_towards(position)\n dir_x = if x > position.x\n -1\n elsif x == position.x\n 0\n else\n 1\n end\n\n dir_y = if y > position.y\n -1\n elsif y == position.y\n 0\n else\n 1\n end\n\n return Direction.new(dir_x, dir_y)\n end",
"title": ""
},
{
"docid": "a59dbb9dddd7f7a91ec4da56d11ae2a0",
"score": "0.5704106",
"text": "def action_direction(cur_pos, tar_pos, cur_dir)\n c, t = cur_pos.position, tar_pos.position\n dx, dy = (t[0] - c[0]), (t[1] - c[1])\n dir = Data::Move::DirR2S[cur_dir]\n if (dx == 0 && dy != 0)\n dir = (dy > 0) ? :DOWN : :UP\n elsif (dy == 0 && dx != 0)\n dir = (dx > 0) ? :RIGHT : :LEFT\n elsif (dy < 0 && dir == :DOWN)\n dir = :UP\n elsif (dy > 0 && dir == :UP)\n dir = :DOWN\n elsif (dx < 0 && dir == :RIGHT)\n dir = :LEFT\n elsif (dx > 0 && dir == :LEFT)\n dir = :RIGHT\n end\n return Data::Move::DirS2R[dir]\n end",
"title": ""
},
{
"docid": "bd76f2d1a6d680ffb6cb9a0942d5dcee",
"score": "0.5675249",
"text": "def direction\n return @range.first < @range.last ? :big : :little\n end",
"title": ""
},
{
"docid": "df0ac8575bed9852a9662360ad767f9d",
"score": "0.5620979",
"text": "def convert_current_dir_int()\n \tcase @direction_facing\n \twhen \"N\"\n \t\t@direction_facing = NORTH\n \twhen \"E\"\n \t\t@direction_facing = EAST\n when \"S\"\n \t\t@direction_facing = SOUTH\n when \"W\"\n \t\t@direction_facing= WEST\n \tend\n end",
"title": ""
},
{
"docid": "4095f11d6117240f71e6c98215b0a7dd",
"score": "0.5610735",
"text": "def track_direction\n @track_direction ||=\n begin\n edge_a, edge_b = normalized_edges\n\n if (edge_a - edge_b).abs == 3\n :straight\n elsif edge_a > edge_b\n :right\n elsif edge_a < edge_b\n :left\n end\n end\n end",
"title": ""
},
{
"docid": "e6c45826664c5048a77fd32a6b01cade",
"score": "0.5575137",
"text": "def move_direction(position_1, position_2)\n row_comparison = position_2[0] - position_1[0]\n col_comparison = position_2[1] - position_1[1]\n if row_comparison > 0 && col_comparison < 0\n :bottom_left\n elsif row_comparison > 0 && col_comparison > 0\n :bottom_right\n elsif row_comparison > 0\n :bottom\n elsif row_comparison < 0 && col_comparison < 0\n :top_left\n elsif row_comparison < 0 && col_comparison > 0\n :top_right\n elsif row_comparison < 0\n :top\n elsif row_comparison == 0 && col_comparison < 0\n :left\n elsif row_comparison == 0 && col_comparison > 0\n :right\n end\n end",
"title": ""
},
{
"docid": "196c0e51754ba5e9bfdc59f1f2f66c8a",
"score": "0.557061",
"text": "def relative_direction(dir)\n relative_directions[direction][dir]\n end",
"title": ""
},
{
"docid": "5067701a098be309b75434bef818dd34",
"score": "0.55085766",
"text": "def direction\n @player_number == 1 ? 1 : -1\n end",
"title": ""
},
{
"docid": "c9b343f58faad9e6d0f8bfdf88ebc3f5",
"score": "0.5506318",
"text": "def direction(line, station)\n\n cached_line = Line.cached_routes[line.number] || {}\n my_pos = nil\n other_pos = nil\n pos = 0\n\n\n cached_line.each do |kvb_id, hsh|\n my_pos = pos if kvb_id == self.kvb_id\n other_pos = pos if kvb_id == station.kvb_id\n pos += 1\n end\n return nil if !my_pos || !other_pos\n\n if my_pos > other_pos\n return :up\n elsif my_pos < other_pos\n return :down\n end\n end",
"title": ""
},
{
"docid": "bfbf460b30b57572f98c6d6735ad10e4",
"score": "0.54973733",
"text": "def direction\n @direction ||= 1\n end",
"title": ""
},
{
"docid": "3480dcc6641dfc30764daa24ae0a1062",
"score": "0.5492678",
"text": "def path_direction from, to, check_skip_liaison = true\n\t\tpath = find_path from, to, check_skip_liaison\n\n\t\treturn nil if path.nil?\n\n\t\t# TODO: check if following still occurs\n\t\treturn false if path.length < 2 \n\n\t\tliaison = get_liaison path[0], path[1]\n\t\t$logger.info { \"liaison #{ liaison }, from #{ from }\" }\n\n\t\t# If you have the choice, set path to next region \n\t\t# requested\n\n\t\tif not check_skip_liaison \n\t\t\tnext_region = path[1]\n\t\t\tif liaison.region == next_region\n\t\t\t\t$logger.info { \"liaison #{ liaison} already on next region\" }\n\t\t\telse\n\n\t\t\t\t# Find a neighboring region that is the same as the\n\t\t\t\t# next requested region\n\t\t\t\tnew_to = nil\n\t\t\t\t[ :N, :E, :S, :W ].each do |dir|\n\t\t\t\t\tif liaison.neighbor(dir).region == next_region\n\t\t\t\t\t\tnew_to = liaison.neighbor(dir)\n\t\t\t\t\t\t$logger.info { \"Found region #{ next_region} to #{ dir } of #{ liaison }; using that\" }\n\t\t\t\t\t\tbreak\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\tunless new_to.nil?\n\t\t\t\t\t$logger.info { \"Adjusting path to #{new_to} instead of liaison #{ liaison}\" }\n\t\t\t\t\tliaison = new_to\n\t\t\t\telse\n\t\t\t\t\t$logger.info { \"Could not find better point than liaison #{ liaison}\" }\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\n\t\tliaison\n\tend",
"title": ""
},
{
"docid": "b4d3923615df8a0c3408223748625ea3",
"score": "0.5486322",
"text": "def get_neighbour_direction cell_one, cell_two\n if cell_one.coordinate[0] == cell_two.coordinate[0]\n direction = '-'\n elsif cell_one.coordinate[1] == cell_two.coordinate[1]\n direction = '|'\n elsif cell_two.coordinate[0] < cell_one.coordinate[0]\n if cell_two.coordinate[1] < cell_one.coordinate[1]\n direction = '\\\\'\n elsif cell_two.coordinate[1] > cell_one.coordinate[1]\n direction = '/'\n end\n elsif cell_two.coordinate[0] > cell_one.coordinate[0]\n if cell_two.coordinate[1] < cell_one.coordinate[1]\n direction = '/'\n elsif cell_two.coordinate[1] > cell_one.coordinate[1]\n direction = '\\\\'\n end\n end\n direction\n end",
"title": ""
},
{
"docid": "ad01513170519fef45d713c4c114fb55",
"score": "0.54853374",
"text": "def get_direction(attacker, target = self)\n case attacker.x <=> target.x\n when 0\n case attacker.y <=> target.y\n when 1\n return 2\n when 0\n return 0\n when -1\n return 8\n end\n when 1\n coef = (attacker.y - target.y)/(attacker.x - target.x).to_f\n if coef < -1\n return 8\n elsif coef > 1\n return 2\n else\n return 6\n end\n when -1\n coef = (attacker.y - target.y)/(attacker.x - target.x).to_f\n if coef < -1\n return 2\n elsif coef > 1\n return 8\n else\n return 4\n end\n end \n end",
"title": ""
},
{
"docid": "3e1cab33897bf709cd4d2cc2d0ec91a4",
"score": "0.5444213",
"text": "def get_direction(dir)\n\n directions = [:up, :right, :down, :left]\n old_num = directions.index(dir)\n num = (old_num + 1).modulo(4)\n\n obj = $map.adjacent_tile(@x, @y, directions[num])\n\n while (obj.class != NilClass) && (obj.class != Actor) && (num != old_num) do\n num = (num + 1).modulo(4)\n obj = $map.adjacent_tile(@x, @y, directions[num])\n end\n\n if num != old_num then\n @direction = directions[num]\n end\n\n end",
"title": ""
},
{
"docid": "263cd0f0860e4032b79e1d78fd819fbc",
"score": "0.5419499",
"text": "def compute_direction(first,second)\n return nil if (lat1 == lat2 && lng1 == lng2) or first[:latitude].nil? or second[:latitude].nil? or first[:longitude].nil? or second[:longitude].nil?\n lat1 = nmea2degree_decimal(first[:latitude],first[:latitude_ns])/RADIAN_CONVERSION_FACTOR\n lat2 = nmea2degree_decimal(second[:latitude],second[:latitude_ns])/RADIAN_CONVERSION_FACTOR\n lng1 = nmea2degree_decimal(first[:longitude],first[:longitude_ew])/RADIAN_CONVERSION_FACTOR\n lng2 = nmea2degree_decimal(second[:longitude],second[:longitude_ew])/RADIAN_CONVERSION_FACTOR\n direction = \"UNK\";\n distance = Math.acos(Math.sin(lat1)*Math.sin(lat2)+Math.cos(lat1)*Math.cos(lat2)*Math.cos(lng1-lng2));\n azimuth = 0;\n if (Math.sin(lng2-lng1) < 0)\n azimuth = Math.acos((Math.sin(lat2)-Math.sin(lat1)*Math.cos(distance))/(Math.sin(distance)*Math.cos(lat1)))\n else\n tmp1 = (Math.sin(lat2)-Math.sin(lat1)*Math.cos(distance))/(Math.sin(distance)*Math.cos(lat1))\n azimuth = 2*Math::PI-Math.acos(tmp1)\n end\n return 360.0 - (azimuth*(RADIAN_CONVERSION_FACTOR));\n end",
"title": ""
},
{
"docid": "7a85f59e5dacdcdac66ca5378a30b093",
"score": "0.5393566",
"text": "def direction()\n return Direction.REVERSE unless @outages.find { |o| o.direction == Direction.REVERSE }.nil?\n return Direction.FORWARD unless @outages.find { |o| o.direction == Direction.FORWARD }.nil?\n return Direction.FALSE_POSITIVE if @outages.find { |o| o.direction == Direction.BOTH }.nil?\n return Direction.BOTH\n end",
"title": ""
},
{
"docid": "710b9bec28a680049ff552fc5d13b02f",
"score": "0.53764117",
"text": "def directions x, y, d\n case d # this is needed because otherwise the loop will skip 1 ahead\n when \"u\"\n y -= 1\n opposite = \"d\"\n when \"l\"\n x -= 1\n opposite = \"r\"\n when \"r\"\n x += 1\n opposite = \"l\"\n when \"d\"\n y += 1\n opposite = \"u\"\n end\n return x, y, opposite\n end",
"title": ""
},
{
"docid": "ad8b631246e5d870399a76c66261b8a9",
"score": "0.53578955",
"text": "def validate_direction(dir)\n if dir.is_a?(Symbol)\n if [:down,:left,:right,:up].include?(dir)\n dir = ([:down,:left,:right,:up].index(dir) + 1) * 2\n else\n stack = caller.join(\"\\n\")\n raise \"Invalid direction value #{dir.inspect}\\n\\n#{stack}\"\n end\n elsif !dir.is_a?(Integer) || (dir.is_a?(Integer) && dir < 1 || dir > 9)\n raise \"Invalid direction value #{dir}\\n\\n#{format_stack(caller)}\"\n end\n return dir\nend",
"title": ""
},
{
"docid": "e4a00104a4d7f249f2946444fee2ade1",
"score": "0.53219926",
"text": "def distance_from(end_coord, direction)\n end_x_pos = end_coord[0]\n end_y_pos = end_coord[1]\n\n distance = case direction\n when :horizontal\n (end_x_pos - self.x_pos).abs\n when :vertical\n (end_y_pos - self.y_pos).abs\n when :diagonal\n (end_x_pos - self.x_pos).abs # could have also used y distance, arbitrary choice\n else\n nil\n end\n\n distance\n end",
"title": ""
},
{
"docid": "9be3bc6787933f9734e3b5f85f77e259",
"score": "0.5319259",
"text": "def calcDirections(cell)\n\t\txWantedDir = calcDirection(@startCell.posX, cell.posX)\n\t\tyWantedDir = calcDirection(@startCell.posY, cell.posY)\n\n\t\t# a valid direction is only vertical or horizontal\n\t\t# => the direction is valid only if one of the two\n\t\t# dirs is 0\n\t\tnbZeros = [xWantedDir, yWantedDir].count(0)\n\t\tif nbZeros == 1 then\n\t\t\t@yDirection = yWantedDir\n\t\t\t@xDirection = xWantedDir\n\t\tend\n\t\treturn self\n\tend",
"title": ""
},
{
"docid": "b9b1d035c5247afb1d8466a55612960e",
"score": "0.5299392",
"text": "def dfs(direction, x, y, endX, endY)\n\t\treturn false if @maze[y][x] == '1' or @visited[y][x] == true\n\t\t@visited[y][x] = true\n\t\t@predecessor[y][x] = direction\n\t\treturn true if (x == endX * 2 + 1) and (y == endY * 2 + 1)\n\t\tdfs(1, x + 1, y, endX, endY) or dfs(2, x, y + 1, endX, endY) or dfs(-1, x - 1, y, endX, endY) or dfs(-2, x, y - 1, endX, endY)\n\tend",
"title": ""
},
{
"docid": "259944bd23037699681cdebb97407af2",
"score": "0.52958584",
"text": "def direction\n if before.blank?\n 'set'\n elsif after.blank?\n 'clear'\n elsif before > after\n 'down'\n else\n 'up'\n end\n end",
"title": ""
},
{
"docid": "3161d7bb84844483bc0a3d5dadf85013",
"score": "0.5281085",
"text": "def dx(direction)\n case direction\n when E, NE, SE then 1\n when W, NW, SW then -1\n else 0\n end\n end",
"title": ""
},
{
"docid": "b2adb37abdb1471c26ef36485c82d260",
"score": "0.5262749",
"text": "def direction(location, focus)\n phi = location.latitude\n phi_prime = focus.latitude\n psi = location.longitude\n psi_prime = focus.longitude\n y = sin_degrees(psi_prime - psi)\n x = ((cosine_degrees(phi) * tangent_degrees(phi_prime)) -\n (sin_degrees(phi) * cosine_degrees(psi - psi_prime)))\n if ((x == 0 && y == 0) || (phi_prime == 90.degrees))\n return deg(0)\n elsif (phi_prime == -90.degrees)\n return 180.degrees\n else\n return arctan_degrees(y, x)\n end\n end",
"title": ""
},
{
"docid": "ef6637f44760ba1627cad5c3e7d4e6e1",
"score": "0.5235285",
"text": "def forward_dir\n forward_move = @color == :white ? [-1, 0] : [1, 0]\n forward_move = forward_move.map.with_index { |el, idx| el + @pos[idx] }\n if valid_move?(forward_move)\n return forward_move\n end\n []\n end",
"title": ""
},
{
"docid": "b92b7e6f9b61366e449c63bb261b38d8",
"score": "0.52327275",
"text": "def between(first, second)\n Direction.from_delta(((second[:y] - first[:y]) <=> 0),\n ((second[:x] - first[:x]) <=> 0))\n end",
"title": ""
},
{
"docid": "34585704e3941a526c60d220892d0523",
"score": "0.5225285",
"text": "def get_direction\n case @dx\n when -1\n case @dy\n when -1\n return \"LEFT-UP DIAGONAL\"\n when 0\n return \"LEFT\"\n when 1\n return \"LEFT-DOWN DIAGONAL\"\n end # case @dy\n when 0\n case @dy\n when -1\n return \"UP\"\n when 0\n # Invalid to have a [0,0] direction\n return \"ERROR\"\n when 1\n return \"DOWN\"\n end # case @dy\n when 1\n case @dy\n when -1\n return \"RIGHT-UP DIAGONAL\"\n when 0\n return \"RIGHT\"\n when 1\n return \"RIGHT-DOWN DIAGONAL\"\n end # case @dy\n end # case @dx\n end",
"title": ""
},
{
"docid": "99f83cabe98e737a5f4738ab4122b8aa",
"score": "0.52208036",
"text": "def currenDirection\n @track.points[-2].bearingTo(point:@track.points[-1])\n end",
"title": ""
},
{
"docid": "ffaa1f43bf58ad3c5904433c89a672cb",
"score": "0.5184107",
"text": "def valid_move?(starting_pos, end_pos)\n # [2, 3] => [5, 6] => false\n # [+3, +3] [+-2, +-1] OR [+-1, +-2]\n\n #for now can only move forward 1 space\n #[1,1] => [1, 2] => true\n end_pos[0] == starting_pos[0] + 1 \n end",
"title": ""
},
{
"docid": "105bf71269d74149dbb04736b1c6f88c",
"score": "0.51694185",
"text": "def dy(direction)\n case direction\n when S, SE, SW then 1\n when N, NE, NW then -1\n else 0\n end\n end",
"title": ""
},
{
"docid": "ae7efb43997ece921023ef8c5ac5cb9b",
"score": "0.5165093",
"text": "def validate_direction(new_position, initial_position)\n #calls find_direction()\n if find_direction(new_position, initial_position) == @last_direction\n return false;\n end\n\n return true;\n end",
"title": ""
},
{
"docid": "20fdae0ef641cf533245cfd82ca2f3eb",
"score": "0.5164888",
"text": "def direction\n DIRECTIONS.invert[@d].to_s.upcase\n end",
"title": ""
},
{
"docid": "e742113d0a1e66adf682c82207cc5341",
"score": "0.51640636",
"text": "def match_direction\n {\n up: 'up',\n right: 'end',\n down: 'down',\n left: 'start',\n start: 'start',\n end: 'end'\n }.with_indifferent_access\n end",
"title": ""
},
{
"docid": "23d62dddb47389b1b89889afa5535947",
"score": "0.5160587",
"text": "def direction(points)\n if points[0][:y] == points[1][:y]\n :horizontal\n elsif points[0][:x] == points[1][:x]\n :vertical\n else\n :diagonal\n end\n end",
"title": ""
},
{
"docid": "34a5d0a79149d386e10a0510b980293f",
"score": "0.51560354",
"text": "def best_direction target\n\t\td1 = nil\n\t\td2 = nil\n\n\t\tfind_path true \n\t\tif @square != @start\n\t\t\ttarget1 = @square\n\t\t\td1 = $pointcache.distance target1, target\n\t\t\n\t\t\thistory1 = @history.clone\n\t\tend\n\n\t\tfind_path false \n\t\tif @square != @start\n\t\t\ttarget2 = @square\n\t\t\td2 = $pointcache.distance target2, target\n\t\tend\n\n\t\t# Select known paths over unknown paths\n\t\tdo_left = false\n\t\tif d1.nil? and not d2.nil?\n\t\t\t$logger.info \"selecting right; left is unknown\"\n\t\t\treturn false\n\t\telsif not d1.nil? and d2.nil?\n\t\t\t$logger.info \"selecting left; right is unknown\"\n\t\t\tdo_left = true\n\t\telsif d1.nil? and d2.nil?\n\t\t\t$logger.info \"No known paths\"\n\t\t\t# Don't make any assumptions\n\t\t\treturn nil\n\t\tend\n\n\t\tif do_left or d1 < d2 \n\t\t\t$logger.info \"left is better\"\n\n\t\t\t#reset internal state, it was overwritten with last search\n\t\t\t#find_path true \n\t\t\t@left = true\n\t\t\t@history = history1\n\t\t\t@square = target1\n\n\t\t\tret = true\n\t\telse\n\t\t\t$logger.info \"right is better\"\n\n\t\t\tret = false\n\t\tend\n\n\t\tret\n\tend",
"title": ""
},
{
"docid": "05332019023bd048332002cb14816d8e",
"score": "0.5147449",
"text": "def loadDirection(dir)\n return 1 if dir.nil?\n return 1 if dir.eql(\"asc\")\n return -1\n end",
"title": ""
},
{
"docid": "cc33526ce32161157d26232659fe71a0",
"score": "0.51432633",
"text": "def direction_after_turn(left_or_right)\n modifier = 1\n modifier = -1 if left_or_right == :left\n\n DIRECTIONS[(DIRECTIONS.index(@facing) + modifier) % 4]\n end",
"title": ""
},
{
"docid": "c119b01e64e138a0cddea42e59646bd7",
"score": "0.51286936",
"text": "def ydirection\n return @ydirection if defined?(@ydirection)\n\n if self.p1.y < self.p2.y\n @ydirection = BigDecimal('Infinity')\n elsif self.p1.y == self.p2.y\n @ydirection = 0\n else\n @ydirection = -BigDecimal('Infinity')\n end\n\n @ydirection\n end",
"title": ""
},
{
"docid": "c98271917ed148e68906d8778d4f25e9",
"score": "0.5117105",
"text": "def direction(lr)\n\t turn = {\"L\" => -1, \"R\" => 1}\n\t dir = [\"N\",\"E\" ,\"S\" ,\"W\"]\n\n\t # Checks to see if condition met to go past index\n\t if lr == \"L\" && @face == \"N\"\n\t \treturn \"W\"\n\t elsif lr == \"R\" && @face == \"W\"\n\t \treturn \"N\"\n\t else\n\t \t# Navigate the dir array based on inputs\n\t \treturn dir[dir.index(@face)+turn[lr]]\n\t end \n\tend",
"title": ""
},
{
"docid": "6a04ecdae9afc244bdcbac109f3a20b0",
"score": "0.5112312",
"text": "def get_next_direction(side)\n index = DIRECTIONS.find_index(@facing)\n index = -1 if index == 3\n\n if side == 'L'\n DIRECTIONS[index - 1]\n elsif side == 'R'\n DIRECTIONS[index + 1]\n else\n raise 'Bad side.'\n end\n end",
"title": ""
},
{
"docid": "fa5824b3d17045c65a6b771a94f0f524",
"score": "0.5108155",
"text": "def adjacent?(start_pt, end_pt)\n up = [start_pt.first - 1, start_pt.last] == end_pt\n down = [start_pt.first + 1, start_pt.last] == end_pt\n left = [start_pt.first, start_pt.last - 1] == end_pt\n right = [start_pt.first, start_pt.last + 1] == end_pt\n \n up or down or left or right\n end",
"title": ""
},
{
"docid": "75d272e00057a31c7c33b7dc8f9ec9d4",
"score": "0.50988895",
"text": "def direction_modifier(direction)\n case direction\n when \"+\" then @direction = [0, 1]\n when \"-\" then @direction = [0, -1]\n when \"<\" then @direction = [1, 0]\n when \">\" then @direction = [-1, 0]\n else \n @direction = [0, 0]\n end\nend",
"title": ""
},
{
"docid": "5c48390ec6884a98d2175e6babecc728",
"score": "0.50948894",
"text": "def left\n self.delta_point = Direction::DELTA[ORDER[(ORDER.index(direction) + 1) % 4]]\n direction\n end",
"title": ""
},
{
"docid": "774919752b8e0e105c552a772c0c6635",
"score": "0.5093219",
"text": "def direction\n\t\t@direction\n\tend",
"title": ""
},
{
"docid": "3853d9775df028da61f95f146a7b107f",
"score": "0.50857705",
"text": "def same_direction?(posible_directions, previous_direction)\n (posible_directions.key(previous_direction) == :left and !map[current_position[0]][current_position[1]-1].blank?) ? (return true) : false\n (posible_directions.key(previous_direction) == :right and !map[current_position[0]][current_position[1]+1].blank?) ? (return true) : false\n (posible_directions.key(previous_direction) == :up and !map[current_position[0]-1][current_position[1]].blank?) ? (return true) : false\n (posible_directions.key(previous_direction) == :down and !map[current_position[0]+1][current_position[1]].blank?) ? (return true) : false\n end",
"title": ""
},
{
"docid": "b8d2f447e41dfa656e3053f654c46870",
"score": "0.5083727",
"text": "def x_y_dir(start, destn)\n destn > start ? :+ : :-\n end",
"title": ""
},
{
"docid": "a629d35d5d3aad016c4ec51eab23d8c5",
"score": "0.5077579",
"text": "def direction_to_left(direction)\n raw_index = DIRECTIONS.index(direction) - 1\n new_index = raw_index < 0 ? DIRECTIONS.length - 1 : raw_index\n DIRECTIONS[new_index]\n end",
"title": ""
},
{
"docid": "1ef49c5c815c29a8a419e300ed2ca6f3",
"score": "0.5064252",
"text": "def next_in_direction(c, dir)\n c[0] += dir[0]\n c[1] += dir[1]\n c\n end",
"title": ""
},
{
"docid": "eca1ac7fc9a40a6b8b2d360e3333cba0",
"score": "0.50632167",
"text": "def direction\n @direction\n end",
"title": ""
},
{
"docid": "6d604b9ef354946c18e19426082ab001",
"score": "0.5061326",
"text": "def find_jumped_pos(end_pos)\n # Use vectors for easy math\n pos_v = Vector.elements(pos)\n end_v = Vector.elements(end_pos)\n jumped_pos = ((pos_v - end_v) / 2 + end_v).to_a\n\n jumped_pos\n end",
"title": ""
},
{
"docid": "20df5a6f8d26b560ec7839975723b27b",
"score": "0.5061141",
"text": "def direction(focus)\n y = Degree.sin(focus.longitude - @longitude)\n x = Degree.cos(@latitude)*Degree.tan(focus.latitude) -\n Degree.sin(@latitude)*Degree.cos(@longitude - focus.longitude)\n\n if (x == 0 && y == 0) || focus.latitude == 90\n return 0.0\n elsif focus.latitude == -90\n return 180.0\n else\n return Degree.atan2(y, x)\n end\n end",
"title": ""
},
{
"docid": "d5a956b64d49d41d7a430b9760d404a8",
"score": "0.5057844",
"text": "def next_direction\n sort_direction = SORT_KEY_ASC\n if (@params[:sort_direction].nil?) then\n sort_direction = (@sort_direction == SORT_KEY_ASC) ? SORT_KEY_DESC : SORT_KEY_ASC\n elsif (@params[:sort_direction] == SORT_KEY_ASC) then\n sort_direction = SORT_KEY_DESC\n end\n return sort_direction\n end",
"title": ""
},
{
"docid": "6fc705a974a686b1fc1fa2ff56a99a3c",
"score": "0.5055633",
"text": "def direction\n return @def.direction\n end",
"title": ""
},
{
"docid": "39367c1b0ad80a8ea6dceb8ee8e82fec",
"score": "0.5048746",
"text": "def direction\n Direction.new(dx, dy)\n end",
"title": ""
},
{
"docid": "dd2f75fc1720a354e4db76d857f62938",
"score": "0.5047928",
"text": "def direction_num\n temp_co = co_ordinates\n if co_ordinates[2] == \"N\"\n temp_co[2] = 0\n elsif co_ordinates[2] == \"E\"\n temp_co[2] = 1\n elsif co_ordinates[2] == \"S\"\n temp_co[2] = 2\n elsif co_ordinates[2] == \"W\"\n temp_co[2] = 3\n else\n puts \"Error: direction_num: Cannot read direction\"\n end\n puts \"direction_num: temp_co = #{temp_co}\"\n return temp_co\n end",
"title": ""
},
{
"docid": "6c638d7b625beb9e129de72e8c32781b",
"score": "0.5047124",
"text": "def get_directions(start_coord:, stop_coord:)\n x_move = PizzaBotHelper.horizontal_steps(\n start_x_coord: start_coord[0],\n stop_x_coord: stop_coord[0]\n )\n\n y_move = PizzaBotHelper.vertical_steps(\n start_y_coord: start_coord[1],\n stop_y_coord: stop_coord[1]\n )\n\n \"#{x_move}#{y_move}\"\n end",
"title": ""
},
{
"docid": "db6e4dc3ce1a20f2f70417168b783fbc",
"score": "0.50439733",
"text": "def directions\n [[1,0], [0,1], [-1,0], [0,-1]]\n end",
"title": ""
},
{
"docid": "20b9028625d56b3a7157a59eeceaca29",
"score": "0.503861",
"text": "def direction=(value)\r\n\t\t\tcntr = 0\r\n\t\t\tif value[\"-\"]\r\n\t\t\t\tcntr = value[value.index(\"-\")+1...value.size].to_i\r\n\t\t\t\tvalue = value[0...value.index(\"-\")]\r\n\t\t\tend\r\n\t\t\tunless $directions_all.member? value then return nil end\r\n\t\t\tunless cntr > 0 && $directions.member?(value) then return nil end\r\n\t\t\t@direction = value\r\n\t\t\t@counter = cntr\r\n\t\t\treturn self\r\n\t\tend",
"title": ""
},
{
"docid": "f0b744721a8995471c98c2d6b13d8791",
"score": "0.50379753",
"text": "def coord_direction p1, p2, filter = true\n xd = p2[0] - p1[0]\n yd = p2[1] - p1[1]\n zd = p2[2] - p1[2]\n north = zd < 0\n south = zd > 0\n east = xd > 0\n west = xd < 0\n up = yd > 0\n down = yd < 0\n dary = [xd.abs, yd.abs, zd.abs]\n xp = dary[0] == 0 ? 0 : dary[0].to_f / dary.max.to_f * 100\n yp = dary[1] == 0 ? 0 : dary[1].to_f / dary.max.to_f * 100\n zp = dary[2] == 0 ? 0 : dary[2].to_f / dary.max.to_f * 100\n\n # assign\n dir = []\n dir << [zp, :south] if south\n dir << [zp, :north] if north\n dir << [xp, :west] if west\n dir << [xp, :east] if east\n dir << [yp, :up] if up\n dir << [yp, :down] if down\n\n # filter\n dir = dir.select {|r, d| r > 15 } if filter && dir.length >= 2\n dir\n end",
"title": ""
},
{
"docid": "7e212b6359978c7f6dc6f261ffad2aec",
"score": "0.5034056",
"text": "def left\n return false unless placed\n @dir = AVAILABLE_DIRECTIONS[(AVAILABLE_DIRECTIONS.index(@dir) - 1).modulo(AVAILABLE_DIRECTIONS.count)]\n end",
"title": ""
},
{
"docid": "043df2351915ccb8d964938436830b31",
"score": "0.5032008",
"text": "def get_direction(curr_order, prev_order, dir)\n if !dir #If at all direction was nil\n \" ASC\"\n end\n\n if (prev_order && prev_order == curr_order) #In the case that the user has clicked the column header again, the order toggles. \n if dir == ' DESC'\n ' ASC'\n else\n ' DESC'\n end\n else #In the case that the user now has clicked a different column header. \n ' ASC'\n end\n\n end",
"title": ""
},
{
"docid": "eeffc1b7bd03f31381a0f9036a0cd378",
"score": "0.5029962",
"text": "def get_direction(dir)\n\t\t@directions[dir]\n\tend",
"title": ""
},
{
"docid": "b464a0babc3ae1493ae9e74a7daaa066",
"score": "0.5027463",
"text": "def change_direction(current_direction,command)\n cardinals = [\"N\",\"E\",\"S\",\"W\"]\n number = cardinals.index(current_direction)\n case command\n when 'L'\n if number >= 1\n number -= 1\n direction = cardinals[number]\n else\n number = 3\n direction = cardinals[number]\n end\n when 'R'\n if number <= 2\n number += 1\n direction = cardinals[number]\n else\n number = 0\n direction = cardinals[number]\n end\n end\n return direction\n end",
"title": ""
},
{
"docid": "90ce078ded8df966a93a45f23aa30c71",
"score": "0.50133806",
"text": "def normal_direction\n if col_distance > 0\n if row_distance > 0\n :ur\n elsif row_distance < 0\n :dr\n else\n :rt\n end\n elsif col_distance < 0\n if row_distance > 0\n :ul\n elsif row_distance < 0\n :dl\n else\n :lt\n end\n elsif row_distance > 0\n :up\n else row_distance < 0\n :dn\n end\n end",
"title": ""
},
{
"docid": "8381fe98aa169467daa31a110e443346",
"score": "0.50118893",
"text": "def next_point(pos, dir)\n #It does not allow to step off the edges, so we check them out:\n return nil if (pos < @width && (3..5).cover?(dir))\n return nil if (pos + @width >= @grid.size && [0, 1, 7].include?(dir))\n return nil if ((pos % @width).zero? && (5..7).cover?(dir))\n return nil if (pos % @width + 1 == @width && (1..4).cover?(dir))\n # DIRECTIONS = [[1,0],[1,1],[0,1],[-1,1],[-1,0],[-1,-1],[0,-1],[1,-1]]\n # DIRECTIONS[@direction][0] y index. DIRECTIONS[@direction][1] x index\n pos + MatrixOptions::DIRECTIONS[dir][0] * @width + MatrixOptions::DIRECTIONS[dir][1]\n end",
"title": ""
},
{
"docid": "d3fc76a65202a5a70918ced6b15c77f8",
"score": "0.50015235",
"text": "def determine_direction\n calls = get_elevator_calls\n if calls.first.nil?\n @direction = :idle unless @passengers.count >= 0\n else\n calls.first >= @current_floor ? @direction = :up : @direction = :down\n end\n end",
"title": ""
},
{
"docid": "e62ced160991d60ecac8eff9666ca36b",
"score": "0.49865726",
"text": "def right\n self.delta_point = Direction::DELTA[ORDER[(ORDER.index(direction) - 1) % 4]]\n direction\n end",
"title": ""
},
{
"docid": "cb54898588f2ab40fe1d140cdeeddd3a",
"score": "0.49861655",
"text": "def direction_left\n DIRECTIONS[(DIRECTIONS.index(direction) - 1) % 4]\n end",
"title": ""
},
{
"docid": "cb54898588f2ab40fe1d140cdeeddd3a",
"score": "0.49861655",
"text": "def direction_left\n DIRECTIONS[(DIRECTIONS.index(direction) - 1) % 4]\n end",
"title": ""
},
{
"docid": "d53cca333a4fadb2646fc4577a27e893",
"score": "0.4982988",
"text": "def dir\r\n Math.atan2(self[:y], self[:x])\r\n end",
"title": ""
},
{
"docid": "ce98923719db9f67f77157a481880a7b",
"score": "0.49789926",
"text": "def opp_direction_and_in_path?(called_direction)\n if called_direction != direction\n if direction == \"down\" && @floor_num_called < current_floor\n return true\n elsif direction == \"up\" && @floor_num_called > current_floor\n return true\n end\n end\n\n false\n end",
"title": ""
},
{
"docid": "4acb538e46d6f65db36d776495dca7b9",
"score": "0.49688163",
"text": "def check_for_valid_direction f\r\n\tcase f\r\n\twhen \"NORTH\"\r\n\t\tmovement_direction_indicator = 1\r\n\twhen \"SOUTH\"\r\n\t\tmovement_direction_indicator = 3\r\n\twhen \"EAST\"\r\n\t\tmovement_direction_indicator = 2\r\n\twhen \"WEST\"\r\n\t\tmovement_direction_indicator = 4\r\n\telse\r\n\t\tmovement_direction_indicator = 0\r\n\t\tprint(\"\\nNot a valid direction.\\n\")\r\n\tend\r\n\treturn movement_direction_indicator\r\nend",
"title": ""
},
{
"docid": "0d950e4c519ae59ad76827befcfe2356",
"score": "0.4963795",
"text": "def direction\n incoming? ? :incoming : :outgoing\n end",
"title": ""
},
{
"docid": "019a9100c17eaa6fc5071ddc3f6ca6bf",
"score": "0.49569812",
"text": "def dir\n Math.atan2(@y, @x) % (2*Math::PI)\n end",
"title": ""
},
{
"docid": "4970a8575632487d4184ae8b4362b60a",
"score": "0.49485403",
"text": "def directions_for(from, to)\n [].tap do |result|\n if (from.row - to.row).abs > @row_max/2\n result << :N if from.row < to.row\n result << :S if from.row > to.row\n else\n result << :S if from.row < to.row\n result << :N if from.row > to.row\n end\n\n if (from.col - to.col).abs > @col_max/2\n result << :W if from.col < to.col\n result << :E if from.col > to.col\n else\n result << :E if from.col < to.col\n result << :W if from.col > to.col\n end\n end\n end",
"title": ""
},
{
"docid": "f641f3c94bba7b8f5037be548a052cd1",
"score": "0.49469885",
"text": "def direction\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 42 )\n\n\n return_value = DirectionReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n\n root_0 = nil\n\n direction_flag185 = nil\n\n\n stream_direction_flag = ANTLR3::AST::RewriteRuleSubtreeStream.new( @adaptor, \"rule direction_flag\" )\n begin\n # at line 218:13: direction_flag\n @state.following.push( TOKENS_FOLLOWING_direction_flag_IN_direction_1233 )\n direction_flag185 = direction_flag\n @state.following.pop\n stream_direction_flag.add( direction_flag185.tree )\n\n # AST Rewrite\n # elements: direction_flag\n # token labels: \n # rule labels: return_value\n # token list labels: \n # rule list labels: \n # wildcard labels: \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 # 218:28: -> ^( DIRECTION direction_flag )\n # at line 218:31: ^( DIRECTION direction_flag )\n root_1 = @adaptor.create_flat_list\n root_1 = @adaptor.become_root( @adaptor.create_from_type( DIRECTION, \"DIRECTION\" ), root_1 )\n\n @adaptor.add_child( root_1, stream_direction_flag.next_tree )\n\n @adaptor.add_child( root_0, root_1 )\n\n\n\n\n return_value.tree = root_0\n\n\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\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\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 42 )\n\n\n end\n\n return return_value\n end",
"title": ""
},
{
"docid": "b300ec4dc82f215043149ee37f206453",
"score": "0.49460414",
"text": "def up_down\n return 1 if self.up\n return -1 if self.down\n return 0\n end",
"title": ""
},
{
"docid": "b300ec4dc82f215043149ee37f206453",
"score": "0.49460414",
"text": "def up_down\n return 1 if self.up\n return -1 if self.down\n return 0\n end",
"title": ""
},
{
"docid": "fc94fefbd8274c773c9a465a7239dd95",
"score": "0.49416876",
"text": "def correct_direction(orig, dest, shape)\n orig_idx = nil\n dest_idx = nil\n shape[:geometry].each_with_index do |x, i|\n name = x[2]\n if orig == name && orig_idx.nil?\n orig_idx = i\n elsif dest == name && dest_idx.nil?\n dest_idx = i\n end\n end\n shape[:orig_idx] = orig_idx\n shape[:dest_idx] = dest_idx\n # puts \" %s -> %s\" % [orig_idx, dest_idx]\n reverse = false\n if orig_idx == nil && dest_idx == nil\n puts \" ## No stop matches for #{orig} -> #{dest}\"\n return shape[:geometry]\n elsif orig_idx == nil || dest_idx == nil\n puts \" * Only one stop match for #{orig} -> #{dest}\"\n return nil\n elsif orig_idx > dest_idx\n # cut off everything before the dest_idx\n puts \"Reversing for #{orig} -> #{dest}\"\n return shape[:geometry][(dest_idx)..(orig_idx)].reverse\n else\n # cut off everything after the dest_idx \n return shape[:geometry][orig_idx..(dest_idx + 1)]\n end\nend",
"title": ""
},
{
"docid": "d7f19f796a93faff07f339c290d7a2f3",
"score": "0.4941533",
"text": "def direction(term)\n term = find_definition(term)\n dir = term&.direction_mapping\n if dir.nil?\n @default_direction\n else\n (dir == false ? nil : dir)\n end\n end",
"title": ""
},
{
"docid": "8d652b5b344106e798d6fad6a262b9f4",
"score": "0.49328887",
"text": "def direction(coord, buffer)\n vps = view_path_coordinates[\"LonLat\"]\n vp1 = vps[0]\n vps = vps.drop(1)\n while !vps.empty? do\n vp2 = vps[0]\n vps = vps.drop(1)\n if onLine(vp1, vp2, buffer, coord)\n return getGeoAngle(vp1,vp2)\n end\n vp1 = vp2\n end\n raise \"Not on Link\"\n end",
"title": ""
},
{
"docid": "72da1283572ea5a694ca7fa6e7c6c8af",
"score": "0.4931097",
"text": "def direction(angle)\n return Geo.direction(angle)\n end",
"title": ""
}
] |
ebb3878c7f5042795d7100a31da97824
|
For sdiff output. Don't split it in advance!!
|
[
{
"docid": "dd400cec92bd0062cb3c7d16dbe130b7",
"score": "0.6251105",
"text": "def sdiff_markup(sdiff_output, ignore_limit=1)\n # The unfortunate truth is that the Ruby Diff::LCS gem is\n # slow as hell, so this method is the only practical way\n # to diff large sets - dump them to files, use unix sdiff -d\n # and then read the output. The result should be equivalent\n # to diff_and_markup.\n diffs=[]\n sdiff_output.each_line {|l| diffs.push(handle_sdiff_line( l ))}\n changes_to_chunks( diffs, ignore_limit )\n end",
"title": ""
}
] |
[
{
"docid": "b913255df5700845ecf48d16634a925f",
"score": "0.6708139",
"text": "def printable_diff\n data_old = @s1.split(/\\n/).map! { |e| e.chomp }\n data_new = @s2.split(/\\n/).map! { |e| e.chomp }\n output = \"\"\n diffs = ::Diff::LCS.diff(data_old, data_new)\n return output if diffs.empty?\n oldhunk = hunk = nil\n file_length_difference = 0\n diffs.each do |piece|\n begin\n hunk = ::Diff::LCS::Hunk.new(\n data_old, data_new, piece, 3, file_length_difference\n )\n file_length_difference = hunk.file_length_difference\n next unless oldhunk\n # Hunks may overlap, which is why we need to be careful when our\n # diff includes lines of context. Otherwise, we might print\n # redundant lines.\n if hunk.overlaps?(oldhunk)\n hunk.unshift(oldhunk)\n else\n output << oldhunk.diff(:unified)\n end\n ensure\n oldhunk = hunk\n output << \"\\n\"\n end\n end\n #Handle the last remaining hunk\n output << oldhunk.diff(:unified) << \"\\n\"\n output.lstrip\n end",
"title": ""
},
{
"docid": "fcab77cf3b8e29ccedff1f3bf25c0382",
"score": "0.65792733",
"text": "def diff_and_markup(s1, s2, ignore_limit=1)\n diffs=Diff::LCS.sdiff(s1, s2)\n old=[]\n new=[]\n old_pos=0\n new_pos=0\n unchanged_buffer=Chunk.new(:buffer)\n diffs.each {|change|\n #next if change.old_element.to_s==\"\" && change.new_element.to_s==\"\"\n case change.action\n when *['+','-','!']\n if unchanged_buffer.length > ignore_limit\n # There have been more than ignore_limit unchanged\n # tokens between the last change (or start) and this\n # change.\n # add a new unchanged chunk\n old << ( Chunk.new( :unchanged, *unchanged_buffer ) )\n old.last.offset=old_pos\n old_pos+=unchanged_buffer.size\n new << ( Chunk.new( :unchanged, *unchanged_buffer ) )\n new.last.offset=new_pos\n new_pos+=unchanged_buffer.size\n # And start a new diff chunk\n old_elem=change.old_element.to_s\n old << Chunk.new(:diff, old_elem)\n old.last.offset=old_pos\n old_pos+=old_elem.size\n new_elem=change.new_element.to_s\n new << Chunk.new(:diff, new_elem)\n new.last.offset=new_pos\n new_pos+=new_elem.size\n else\n if old.empty?\n old << Chunk.new( :diff )\n old.last.offset=0\n end\n if new.empty?\n new << Chunk.new( :diff )\n new.last.offset=0\n end\n # put the ignored, unchanged tokens into the diff chunk\n # this syntax is ugly, but old.last+=<an array> doesn't\n # work because of method syntax (it looks for Array#last=)\n unchanged_buffer.each {|token| old.last << token; new.last << token}\n old_pos+=unchanged_buffer.size\n new_pos+=unchanged_buffer.size\n # and add the change to this diff chunk\n old_elem=change.old_element.to_s\n old.last << old_elem\n old_pos+=old_elem.size\n new_elem=change.new_element.to_s\n new.last << new_elem \n new_pos+=new_elem.size\n end\n unchanged_buffer.clear\n when '='\n unchanged_buffer << change.old_element\n end\n }\n # whatever is left in the unchanged buffer gets tacked on the end.\n unless unchanged_buffer.empty?\n old << ( Chunk.new( :unchanged, *unchanged_buffer ) )\n old.last.offset=old_pos\n new << ( Chunk.new( :unchanged, *unchanged_buffer ) )\n new.last.offset=new_pos\n end\n [old, new]\n end",
"title": ""
},
{
"docid": "d9bb65860aeebc8d1cb60fd0b1a84ce4",
"score": "0.6521652",
"text": "def diff\n end",
"title": ""
},
{
"docid": "bc720f56d431d8e7d31455ce28f9ea99",
"score": "0.64949524",
"text": "def differences; end",
"title": ""
},
{
"docid": "8dc853b474c325f69d5999f6136e82bf",
"score": "0.64444536",
"text": "def show_diff(destination, content); end",
"title": ""
},
{
"docid": "8dc853b474c325f69d5999f6136e82bf",
"score": "0.64444536",
"text": "def show_diff(destination, content); end",
"title": ""
},
{
"docid": "65573f631a3dffe2174479c9e5ce0b0a",
"score": "0.6420002",
"text": "def make_my_diffs_pretty!; end",
"title": ""
},
{
"docid": "e3cb33d0be329b4909cda3d2235db06e",
"score": "0.64167476",
"text": "def sdiff(*arguments)\n\t\t\t\t\tcall(\"SDIFF\", *arguments)\n\t\t\t\tend",
"title": ""
},
{
"docid": "5edecf42e706bfbd9ae4d9ae470134db",
"score": "0.63838625",
"text": "def diff\nend",
"title": ""
},
{
"docid": "12a57c59dcd1332f0b9061fa98f6563b",
"score": "0.63000065",
"text": "def render_diff(udiff)\n return if udiff.blank?\n out = \"<table class=\\\"codediff\\\">\\n\"\n \n lines = udiff.split(\"\\n\")\n \n lines_that_differs = /@@ -(\\d+),?(\\d*) \\+(\\d+),?(\\d*) @@/\n \n out << \"<thead>\\n\"\n out << \"\\t<tr><td class=\\\"line-numbers\\\">prev.</td><td class=\\\"line-numbers\\\">current</td><td> </td></tr>\\n\"\n out << \"</thead>\\n\"\n\n prev_counter = 0\n cur_counter = 0\n change_num = 0\n\n lines[2..lines.length].each do |line| \n if line_nums = line.match(lines_that_differs) \n \tprev_line_numbers = line_nums[1].to_i...(line_nums[1].to_i + (line_nums[2]).to_i)\n cur_line_numbers = line_nums[3].to_i...(line_nums[3].to_i + (line_nums[4]).to_i)\n prev_counter = prev_line_numbers.first - 1\n cur_counter = cur_line_numbers.first - 1\n change_num += 1 \n end\n \n line = h(line)\n line.gsub!(/^\\s/, '') # The column where + or - would be\n line.gsub!(/^(\\+{1}(\\s+|\\t+)?(.*))/, '\\2<ins>\\3</ins>')\n line.gsub!(/^(-{1}(\\s+|\\t+)?(.*))/, '\\2<del>\\3</del>')\n line.gsub!('\\ No newline at end of file', '')\n\n out << \"<tr class=\\\"changes\\\">\\n\"\n \n if line.match(/^(\\s+|\\t+)?<del>/) \n out << \"\\t<td class=\\\"line-numbers\\\">\" + prev_counter.to_s + \"</td>\\n\"\n out << \"\\t<td class=\\\"line-numbers\\\"> </td>\\n\"\n prev_counter += 1\n action_class = 'del'\n elsif line.match(/^(\\s+|\\t+)?<ins>/)\n out << \"\\t<td class=\\\"line-numbers\\\"> </td>\\n\"\n out << \"\\t<td class=\\\"line-numbers\\\">\" + cur_counter.to_s + \"</td>\\n\"\n cur_counter += 1 \n action_class = 'ins'\n else\n if line.match(lines_that_differs)\n line = ''\n if change_num > 1\n out << \"\\t<td class=\\\"line-numbers line-num-cut\\\">...</td>\\n\"\n out << \"\\t<td class=\\\"line-numbers line-num-cut\\\">...</td>\\n\"\n action_class = 'cut-line'\n else \n out << \"\\t<td class=\\\"line-numbers\\\"></td>\\n\"\n out << \"\\t<td class=\\\"line-numbers\\\"></td>\\n\"\n action_class = 'unchanged'\n end\n else\n out << \"\\t<td class=\\\"line-numbers\\\"></td>\\n\"\n out << \"\\t<td class=\\\"line-numbers\\\"></td>\\n\"\n action_class = 'unchanged'\n end\n prev_counter += 1 \n cur_counter += 1 \n end\n \n out << \"\\t<td class=\\\"code #{action_class}\\\">\" + line + \"</td></tr>\\n\" \n end\n out << \"\\n</table>\\n\"\n end",
"title": ""
},
{
"docid": "19257e70cc17c7f50a027f1c0720d992",
"score": "0.6207788",
"text": "def calculate_diffs\n s = self.statuses\n return if s.size < 2\n s[0].explanation_diffs = Differ.diff(s[0].explanation,s[1].explanation).to_s.split(\"\\n\").join(\"<br/>\") if s[0].explanation and s[1].explanation\n s[0].last_change_diffs = Differ.diff(s[0].last_change,s[1].last_change).to_s.split(\"\\n\").join(\"<br/>\") if s[0].last_change and s[1].last_change\n s[0].last_change_excel = excel(s[0].last_change,s[1].last_change).to_s.split('\\r\\n').join(' ') if s[0].last_change and s[1].last_change\n s[0].save\n end",
"title": ""
},
{
"docid": "42d1051448b78b95cf8d7945286121b8",
"score": "0.61196744",
"text": "def diff\n nil\n end",
"title": ""
},
{
"docid": "2beb8defad45b79dc9647acde20c365b",
"score": "0.61133856",
"text": "def diff_view diff\n old_diff = []\n new_diff = []\n\n detection = ::CharlockHolmes::EncodingDetector.detect(diff)\n utf8_encoded_content = ::CharlockHolmes::Converter.convert diff, detection[:encoding], 'UTF-8'\n HTMLEntities.new.encode(utf8_encoded_content).each_line do |line|\n if /^\\+/.match(line)\n new_diff.push(line)\n elsif /^\\-/.match(line)\n old_diff.push(line)\n else\n new_diff.push(line)\n old_diff.push(line)\n end\n end\n\n length_o = old_diff.count\n length_n = new_diff.count\n for i in 0..[length_o, length_n].max\n if i > [length_o, length_n].min\n break\n end\n\n if (/^\\-.*/.match(old_diff[i])) && !(/^\\+.*/.match(new_diff[i]))\n # tag removed latter to add color syntax\n insert = 'empty_line'\n # ugly way to avoid asymmetry if at display the line takes 2 line on the screen\n insert = \" \\n\"\n new_diff.insert(i, insert)\n length_n += 1\n elsif !(/^\\-.*/.match(old_diff[i])) && (/^\\+.*/.match(new_diff[i]))\n insert = 'empty_line'\n insert = \" \\n\"\n old_diff.insert(i, insert)\n length_o += 1\n end\n end\n { old_diff: old_diff, new_diff: new_diff }\n end",
"title": ""
},
{
"docid": "d6cb52ea58d9167c86ab1eff41a4ac79",
"score": "0.60823685",
"text": "def formatted\n ( @output.render diff_array, @meta if any? ).to_s\n end",
"title": ""
},
{
"docid": "770718e589b6c2d4b1e0f902422c6265",
"score": "0.6080872",
"text": "def diff_and_markup(s1, s2, ignore_limit=1)\n diffs=Diff::LCS.sdiff(s1, s2).map {|lcs_change| handle_lcs_change( lcs_change ) }\n changes_to_chunks( diffs, ignore_limit )\n end",
"title": ""
},
{
"docid": "c11874b6229fa214e8f2118759787947",
"score": "0.60417527",
"text": "def diff_text1(diffs)\n diffs.map { |op, data|\n if op == :insert\n \"\"\n else\n data\n end\n }.join\n end",
"title": ""
},
{
"docid": "9ebb31c1ef966a15a884046a50fccab4",
"score": "0.6023941",
"text": "def diffable; end",
"title": ""
},
{
"docid": "7354e3e1f7be04dd8059cce36d832649",
"score": "0.5985347",
"text": "def diff_as_string(data_new, data_old)\n data_old = data_old.split(/\\n/).map! { |e| e.chomp }\n data_new = data_new.split(/\\n/).map! { |e| e.chomp }\n output = \"\"\n diffs = Diff::LCS.diff(data_old, data_new)\n return output if diffs.empty?\n oldhunk = hunk = nil \n file_length_difference = 0\n diffs.each do |piece|\n begin\n hunk = Diff::LCS::Hunk.new(data_old, data_new, piece, context_lines,\n file_length_difference)\n file_length_difference = hunk.file_length_difference \n next unless oldhunk \n # Hunks may overlap, which is why we need to be careful when our\n # diff includes lines of context. Otherwise, we might print\n # redundant lines.\n if (context_lines > 0) and hunk.overlaps?(oldhunk)\n hunk.unshift(oldhunk)\n else\n output << oldhunk.diff(format)\n end\n ensure\n oldhunk = hunk\n output << \"\\n\"\n end\n end \n #Handle the last remaining hunk\n output << oldhunk.diff(format) << \"\\n\"\n end",
"title": ""
},
{
"docid": "4a3d78b9764b3a4bbb5d09813fde0001",
"score": "0.5973565",
"text": "def split_diff\n @left = []\n @right = []\n @changed = []\n @added = []\n @removed = []\n\n i = 0\n l = []\n r = []\n j = 0\n\n merge = Proc.new do\n max = [l.count, r.count].max\n min = [l.count, r.count].min\n\n if l.count > r.count\n @removed.concat (j+min...j+max).to_a\n elsif l.count < r.count\n @added.concat (j+min...j+max).to_a\n end\n\n if l.any? && r.any?\n @changed.concat (j...j+min).to_a\n end\n\n @left.concat(l.fill(nil, l.count...max))\n @right.concat(r.fill(nil, r.count...max))\n\n j += max\n\n l = []\n r = []\n end\n\n while i <= lines.size\n\n if i == lines.size\n merge.call\n break\n end\n\n line = lines[i]\n\n unless line.starts_with?('+') && l.any?\n merge.call\n end\n\n if line.starts_with?('-')\n while i < lines.size && lines[i].starts_with?('-')\n l << lines[i]\n i+=1\n end\n elsif line.starts_with?('+')\n while i < lines.size && lines[i].starts_with?('+')\n r << lines[i]\n i+=1\n end\n else\n @left << line\n @right << line\n l = []\n r = []\n i+=1\n j+=1\n end\n end\n true\n end",
"title": ""
},
{
"docid": "7caaf433e593cc501fff5677b0964622",
"score": "0.595792",
"text": "def output_diff\n added = @occurrences - @previous_occurrences\n removed = @previous_occurrences - @occurrences\n\n added.each do |occurrence|\n Theia.logger.info(\"Added: #{ occurrence.piece.key } (color diff: #{ occurrence.color_distance * 100 }%)\")\n end\n\n removed.each do |occurrence|\n Theia.logger.info(\"Removed: #{ occurrence.piece.key }\")\n end\n end",
"title": ""
},
{
"docid": "f323babc1632a06040680ebb5abd9522",
"score": "0.5926114",
"text": "def diff_files; end",
"title": ""
},
{
"docid": "a2966f80bdf42d1d7baa86953d0956ef",
"score": "0.591667",
"text": "def show_body_diff; end",
"title": ""
},
{
"docid": "a2966f80bdf42d1d7baa86953d0956ef",
"score": "0.591667",
"text": "def show_body_diff; end",
"title": ""
},
{
"docid": "facc66769542ee55f27b8c23a5e476c1",
"score": "0.5913698",
"text": "def shift_output_lines(delta); end",
"title": ""
},
{
"docid": "114fe3f1b70f466e3712b0f89fc30bd4",
"score": "0.5902675",
"text": "def post_process_diff(data)\n data.scan(/^(\\s|-|\\+)*(.+)/)\n .map { |mark, content| \"#{proper_mark(mark)}#{content}\" }\n .join(\"\\n\")\n end",
"title": ""
},
{
"docid": "2fb82bcaa23ebee1eba20ed0935bbe88",
"score": "0.5899494",
"text": "def get_diff\n old = IO.readlines(@conf['OLD']).map(&:chomp)\n new = IO.readlines(@conf['NEW']).map(&:chomp)\n\n File.open(@conf['ADD'], 'w') { |file| file.write((new-old).join(\"\\n\")) }\n File.open(@conf['DEL'], 'w') { |file| file.write((old-new).join(\"\\n\")) }\n end",
"title": ""
},
{
"docid": "800fb75d37327ba3d880bd6009e39299",
"score": "0.58865786",
"text": "def old_diff\n warn \"Expecting only one block in an old diff hunk!\" if @blocks.size > 1\n op_act = { \"+\" => 'a', \"-\" => 'd', \"!\" => \"c\" }\n\n block = @blocks[0]\n\n # Calculate item number range. Old diff range is just like a context\n # diff range, except the ranges are on one line with the action between\n # them.\n s = encode(\"#{context_range(:old)}#{op_act[block.op]}#{context_range(:new)}\\n\")\n # If removing anything, just print out all the remove lines in the hunk\n # which is just all the remove lines in the block.\n @data_old[@start_old .. @end_old].each { |e| s << encode(\"< \") + e + encode(\"\\n\") } unless block.remove.empty?\n s << encode(\"---\\n\") if block.op == \"!\"\n @data_new[@start_new .. @end_new].each { |e| s << encode(\"> \") + e + encode(\"\\n\") } unless block.insert.empty?\n s\n end",
"title": ""
},
{
"docid": "63854b14e05ae36ea32cfe4ec40eae34",
"score": "0.5880667",
"text": "def line_diff(old, new)\n Palmister.diff(old,new)\n end",
"title": ""
},
{
"docid": "9bc292ebea15310d84efbe50fa5b23a5",
"score": "0.58613205",
"text": "def diff_text2(diffs)\n diffs.map { |op, data|\n if op == :delete\n \"\"\n else\n data\n end\n }.join\n end",
"title": ""
},
{
"docid": "93e9028eed48b300af397032f78bff7e",
"score": "0.5841163",
"text": "def diff_pretty_html(diffs)\n diffs.map do |diff|\n text = diff.text.tr(\"&\", \"&\").tr(\"<\", \"<\").tr(\">\", \">\").tr(\"\\n\", \"¶<br>\")\n\n case diff.operation\n when :INSERT\n \"<ins style=\\\"background:#e6ffe6;\\\">#{text}</ins>\"\n when :DELETE\n \"<del style=\\\"background:#ffe6e6;\\\">#{text}</del>\"\n else #:EQUAL\n \"<span>#{text}</span>\"\n end\n end.join\n end",
"title": ""
},
{
"docid": "78487745810ebec6ca609fa1de811e6a",
"score": "0.5838832",
"text": "def print_diff(a, b, differences)\n\ta = \"\" if a == nil\n\tb = \"\" if b == nil\n\n\tlinemax = a.length\n\tlinemax = b.length if b.length > a.length\n\t\n\tfor pos in 0..linemax-1\n\t\tif differences.include?(pos+1)\n\t\t\tprint \"^\"\n\t\telse\n\t\t\tprint \" \"\n\t\tend\n\tend\n\t\n\tprint \"\\n\"\n\t\n\treturn\nend",
"title": ""
},
{
"docid": "03a2b1e324822b9678d455a4d907e513",
"score": "0.5824675",
"text": "def diff_pretty_html(diffs)\n diffs.map { |op, data|\n text = data.gsub(\"&\", \"&\").gsub(\"<\", \"<\").gsub(\">\", \">\").gsub('\\n', \"¶<br>\")\n case op\n when :insert\n \"<ins style=\\\"background:#e6ffe6;\\\">#{text}</ins>\"\n when :delete\n \"<del style=\\\"background:#ffe6e6;\\\">#{text}</del>\"\n when :equal\n \"<span>#{text}</span>\"\n end\n }.join\n end",
"title": ""
},
{
"docid": "9b61960698420bf7b6933754a765b271",
"score": "0.58134836",
"text": "def output_delta(output_data)\n if output.present?\n output_data.gsub(output, \"\\n\")\n else\n output\n end\n end",
"title": ""
},
{
"docid": "e85629fb681fb4225bc738e103b12a3f",
"score": "0.58118576",
"text": "def diff_output(sha)\n output = []\n marker = 0\n\n Black::Git\n .execute(@path, %w(show --format='%b' --no-prefix -U1000).push(sha))\n .each_line do |line|\n if line.start_with?('diff --git')\n marker += 1\n else\n if output[marker]\n output[marker] += line\n else\n output[marker] = line\n end\n end\n end\n\n # there are two empty lines at the top of the git show output\n output.shift\n output\n end",
"title": ""
},
{
"docid": "d02d45fb71c945f3cf890c01762074f0",
"score": "0.57924217",
"text": "def line_diff(old, new)\n RailsDiff.diff(old,new)\n end",
"title": ""
},
{
"docid": "7bc08af1181f0842f673f16b8896d63d",
"score": "0.57860434",
"text": "def diff_text2(diffs)\n diffs.map { |diff| diff.text1_change? ? \"\" : diff.text }.join\n end",
"title": ""
},
{
"docid": "44c9b79f021eb122d3bfd531ad040683",
"score": "0.57841635",
"text": "def call\n print diff\n end",
"title": ""
},
{
"docid": "0d5d396b91b8658b20822cf3ffceae93",
"score": "0.5758711",
"text": "def to_s\n \"#{@diff1}\\n#{@diff2}\"\n end",
"title": ""
},
{
"docid": "5aba167e15443d8bbb1c37d3c682c717",
"score": "0.5748851",
"text": "def each_diff_part\n\t\t\t\t#list of difference_entries where each entry is an array of Diff::LCS::Chang objects\n\t\t\t\t#e.g. #<Diff::LCS::Change:0x0000000127f5a0 @action=\"-\", @position=0, @element=\"a\">\n\t\t\t\t# if action == \"-\" the position points to char at the first file that should be deleted to obtain lcs (longest common subsequence)\n\t\t\t\t# if action == \"+\" the position points to char at the second file that should be deleted to obtain lcs\n\t\t\t\tdifference_array = Diff::LCS.diff(@code_a, @code_b)\n\n\t\t\t\tcode_a_index = 0\n\t\t\t\t@fragments_added = 0\n\t\t\t\t@fragments_deleted = 0\n\n\t\t\t\t#difference_entry is an Array of Diff::LCS::Change instances\n\t\t\t\tdifference_array.each do |difference_entry|\n\n\t\t\t\t\t#obtain the index where deletion(-) or insertion(+) should be done transform code_a into code_b\n\t\t\t\t\tnext_change_index = difference_entry[0].position\n\n\t\t\t\t\tif next_change_index_taken_from_b_file?(difference_entry[0]) then\n\t\t\t\t\t\tnext_change_index = convert_position_from_code_b_to_code_a(next_change_index)\n\t\t\t\t\tend\n\n\t\t\t\t\tlcs_fragment, code_a_index = read_lcs_fragment(code_a_index, next_change_index)\n\t\t\t\t\tgreen_segment, red_segment, code_a_index = get_red_and_green_fragments(code_a_index, difference_entry)\n\n\t\t\t\t\tif @yield_lines_separately\n\t\t\t\t\t\tlcs_fragment.each { |e| yield [e, :lcs] }\n\t\t\t\t\t\tred_segment.each { |e| yield [e, :-] }\n\t\t\t\t\t\tgreen_segment.each { |e| yield [e, :+] }\n\t\t\t\t\telse\n\t\t\t\t\t\tyield [lcs_fragment, :lcs]\n\t\t\t\t\t\tyield [red_segment, :-]\n\t\t\t\t\t\tyield [green_segment, :+]\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\tread_lcs_end(code_a_index) { |e| yield e } if @yield_lines_separately && (code_a_index != @code_a.size)\n\n\t\t\tend",
"title": ""
},
{
"docid": "edfc8e69fe62388c94ca463b51908552",
"score": "0.5737925",
"text": "def diff_text1(diffs)\n diffs.map { |diff| diff.text2_change? ? \"\" : diff.text }.join\n end",
"title": ""
},
{
"docid": "cb1d73770a73aed9e338c75a95e2435c",
"score": "0.57281834",
"text": "def diff(a, b)\n output = Array.new\n expected = a.to_s.split(\"\\n\", -1);\n actual = b.to_s.split(\"\\n\", -1);\n i = 0\n j = 0\n while (i < expected.length || j < actual.length)\n if (i >= expected.length)\n output.push(\"+ \" + actual[j])\n j += 1\n elsif (j >= actual.length)\n output.push(\"- \" + expected[i])\n i += 1\n elsif (expected[i] == actual[j])\n output.push(\" \" + expected[i])\n i += 1\n j += 1\n else\n next_actual = get_index_of_next_equal_to(actual, expected[i], j + 1)\n next_expected = get_index_of_next_equal_to(expected, actual[j], i + 1)\n if (next_actual == nil)\n output.push(\"- \" + expected[i])\n i += 1\n elsif (next_expected == nil || next_expected - i > next_actual - j)\n output.push(\"+ \" + actual[j])\n j += 1\n else\n output.push(\"- \" + expected[i])\n i += 1\n end\n end\n end\n return output.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "5ed03bc9e9f85ac15e421d5c679372d9",
"score": "0.5727234",
"text": "def report_on_differences\n # these are stacks with templates\n output_report_on_differences(build_diffs)\n end",
"title": ""
},
{
"docid": "f24c498b543209b5896e28be2b57252f",
"score": "0.56985754",
"text": "def getTotalDiff(diffSpectrum = @diff)\n total_diff = 0\n diffSpectrum.each {|word| total_diff += word[1][0][1]}\n return total_diff\n end",
"title": ""
},
{
"docid": "bc07f2e952ae7bcc8bbf300797310171",
"score": "0.56889236",
"text": "def diff2\n @diff2\n end",
"title": ""
},
{
"docid": "dbc874b2088d18b2419d8a90d522c9d4",
"score": "0.5684625",
"text": "def diff\n @diff_result ||= catdiff\n end",
"title": ""
},
{
"docid": "dcb9fc709e098d62281b67c6de68d564",
"score": "0.56700695",
"text": "def calculate_diffs(review_type)\n reviews = StreamReview.find(:all,:conditions => [\"stream_id = ? and review_type_id = ?\",self.id ,review_type], :order => \"created_at DESC\")\n if reviews.size > 2\n reviews[0].text_diff = Differ.diff(reviews[0].text,reviews[1].text).to_s.split(\"\\n\").join(\"<br/>\") if reviews[0].text and reviews[1].text\n reviews[0].save\n end\n end",
"title": ""
},
{
"docid": "dfed74f41978e60e1ea1e9ae51d7ea3c",
"score": "0.5668846",
"text": "def show_diff(destination, content) #:nodoc:\n if diff_lcs_loaded? && ENV[\"THOR_DIFF\"].nil? && ENV[\"RAILS_DIFF\"].nil?\n actual = File.binread(destination).to_s.split(\"\\n\")\n content = content.to_s.split(\"\\n\")\n\n Diff::LCS.sdiff(actual, content).each do |diff|\n output_diff_line(diff)\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "dfed74f41978e60e1ea1e9ae51d7ea3c",
"score": "0.5668846",
"text": "def show_diff(destination, content) #:nodoc:\n if diff_lcs_loaded? && ENV[\"THOR_DIFF\"].nil? && ENV[\"RAILS_DIFF\"].nil?\n actual = File.binread(destination).to_s.split(\"\\n\")\n content = content.to_s.split(\"\\n\")\n\n Diff::LCS.sdiff(actual, content).each do |diff|\n output_diff_line(diff)\n end\n else\n super\n end\n end",
"title": ""
},
{
"docid": "a4f3c16cc083d455c99953aa0c8df6c0",
"score": "0.5667818",
"text": "def _concatenate_diffs( first_half, second_half )\n\n end",
"title": ""
},
{
"docid": "d2419e60724f0795b543c848815667c1",
"score": "0.56602293",
"text": "def display_diff_summary(diff_summary)\n disp_text = \"\"\n disp_text += \"<div class='codeblock'><table class='diff_summary'>\"\n diff_summary.lines.each do |line|\n # determine if it generally adds or removes lines\n plusses = line.scan(\"+\").size\n minuses = line.scan(\"-\").size\n if plusses > minuses\n div_class = \"added_code\"\n elsif minuses > plusses\n div_class = \"removed_code\"\n else\n div_class = \"unchanged_code\"\n end\n # create the row\n disp_text += \"<tr>\"\n # depending on whether there is a pipe, add two cells or 1 wide cell\n parts = line.split(\"|\")\n if parts.length == 2\n disp_text += \"<td><div class='#{div_class}'>#{parts[0]}</div></td><td><div class='#{div_class}'>#{parts[1]}</div></td>\"\n else\n disp_text += \"<td colspan='2'>#{parts[0]}</td>\"\n end\n disp_text += \"</tr>\"\n end\n disp_text += \"</table></div>\"\n return disp_text.html_safe\n end",
"title": ""
},
{
"docid": "46fe4562714440c68ce2ccc57bfd1a2c",
"score": "0.5652957",
"text": "def compare_output(refAnno, difference)\n compare(refAnno, 20) do |tp_list, htp_startpos_list, htp_endpos_list,\\\n fp_list, fn_list, difference|\n puts \"# compared start- and endpositions from \\n# file \\\"#{@file}\\\" and\\n#\"\\\n + \" file \\\"#{refAnno.file}\\\"\\n#\"\n puts \"# parameters from LTRharvest (comments from\\n# file \\\"#{@file}\\\"):\"\n @commentlines.each do |line|\n puts line\n end\n puts \"#\\n# read #{refAnno.data.length} annotations of\" +\\\n \" LTR retrotransposons from\\n\" +\\\n \"# file #{refAnno.file} \\n#\"\n puts(\"# results: each row = 1 LTR-pair\\n\" +\\\n \"# startpos = 5'-boundary (of leftLTR)\\n\" +\\\n \"# endpos = 3'-boundary (of rightLTR)\\n#\\n\" +\\\n \"# start- and endpositions may vary +/-#{difference}\" +\\\n \"bp.\\n#\")\n\n puts \"# true positive(s) (TP) = #{tp_list.length}\"\n puts \"# half true positive(s) (TP) = #{htp_startpos_list.length\\\n + htp_endpos_list.length}\"\n puts \"# false positive(s) (FP) = #{fp_list.length}\"\n puts \"# false negative(s) (FN) = #{fn_list.length}\"\n puts \"#\"\n# puts \"# duplicated TP predictions = \" #?\n puts \"#\"\n #print TPs\n puts \"# #{tp_list.length} true positive(s) (TP)\\n\" +\\\n \"# startposition endposition \" +\\\n \"+/-startposition_berkeley +/-endposition_berkeley \" +\\\n \"length FBti_id family_name FBgn_id chromosome_arm release\"\n tp_list.sort{|i1, i2| i1[:s_pred] <=> i2[:s_pred]}.each do |tp|\n puts \"#{tp[:s_pred]} #{tp[:e_pred]} #{tp[:s_ref]-tp[:s_pred]} \"\\\n +\"#{tp[:e_ref]-tp[:e_pred]} #{tp[:length]} #{tp[:fbti_id]} \"\\\n +\"#{tp[:family_name]} #{tp[:fbgn_id]} #{tp[:chromosome_arm]} \"\\\n +\"#{tp[:release]}\"\n end\n #print hTPs\n puts \"# #{htp_startpos_list.length} half true positive(s) (only first position correct)\\n\" +\\\n \"# startposition false_endposition \"+\\\n \"+/-startposition_berkeley berkeley_endposition \"+\\\n \"length FBti_id family_name FBgn_id chromosome_arm release\"\n htp_startpos_list.sort{|i1, i2| i1[:s_pred] <=> i2[:s_pred]}.each do |htp|\n puts \"#{htp[:s_pred]} #{htp[:e_pred]} #{htp[:s_ref]-htp[:s_pred]} \"\\\n +\"#{htp[:e_ref]} #{htp[:length]} #{htp[:fbti_id]} \"\\\n +\"#{htp[:family_name]} #{htp[:fbgn_id]} #{htp[:chromosome_arm]} \"\\\n +\"#{htp[:release]}\"\n end\n puts \"# #{htp_endpos_list.length} half true positive(s) (only second position correct)\\n\" +\\\n \"# false_startposition endposition \"+\\\n \"berkeley_startposition +/-endposition_berkeley\"+\\\n \"length FBti_id family_name FBgn_id chromosome_arm release\"\n htp_endpos_list.sort{|i1, i2| i1[:s_pred] <=> i2[:s_pred]}.each do |htp|\n puts \"#{htp[:s_pred]} #{htp[:e_pred]} #{htp[:s_ref]} \"\\\n +\"#{htp[:e_ref]-htp[:e_pred]} #{htp[:length]} #{htp[:fbti_id]} \"\\\n +\"#{htp[:family_name]} #{htp[:fbgn_id]} #{htp[:chromosome_arm]} \"\\\n +\"#{htp[:release]}\"\n end\n #print FPs\n puts \"# #{fp_list.length} false positive(s) (FP)\\n\" +\\\n \"# false_startposition false_endposition length \" +\\\n \"startleftLTR endleftLTR lengthleftLTR \" +\\\n \"startrightLTR endrightLTR lengthrightLTR\"\n fp_list.sort{|i1, i2| i1[:sltr] <=> i2[:sltr]}.each do |fp|\n puts \"#{fp[:sltr]} #{fp[:eltr]} #{fp[:lltr]} \"\\\n +\"#{fp[:sleft]} #{fp[:eleft]} #{fp[:lleft]} \"\\\n +\"#{fp[:sright]} #{fp[:eright]} #{fp[:lright]}\"\n end\n #print FNs\n puts \"# #{fn_list.length} false negative(s) (FN)\\n\" +\\\n \"# not predicted startposition, not predicted endposition\"\n fn_list.sort{|i1, i2| i1[:sltr] <=> i2[:sltr]}.each do |fn|\n puts \"#{fn[:sltr]} #{fn[:eltr]} #{fn[:length]} #{fn[:fbti_id]} \"\\\n +\"#{fn[:family_name]} #{fn[:fbgn_id]} #{fn[:chromosome_arm]} \"\\\n +\"#{fn[:release]}\"\n end\n end\n end",
"title": ""
},
{
"docid": "fd8931fe2743838da7ea6a4af8cc963c",
"score": "0.5649171",
"text": "def diff(old, new)\n pattern = Regexp.new('(?:<.+?>)|(?:\\p{Word}+)|(?:[ \\t]+)|(?:\\r?\\n)|(?:.+?)')\n\n thisarr = old.scan(pattern)\n otharr = new.scan(pattern)\n\n cbo = Diff::LCS::ContextDiffCallbacks.new\n diffs = thisarr.diff(otharr, cbo)\n\n escape_html = lambda { |str| str.gsub(/&/, \"&\").gsub(/</, \"<\").gsub(/>/, \">\") }\n\n output = thisarr\n output.each { |q| q.replace(escape_html[q]) }\n\n diffs.reverse_each do |hunk|\n newchange = hunk.max { |a, b| a.old_position <=> b.old_position }\n newstart = newchange.old_position\n oldstart = hunk.min { |a, b| a.old_position <=> b.old_position }.old_position\n\n if newchange.action == \"+\"\n output.insert(newstart, TAG_INS_CLOSE)\n end\n\n hunk.reverse_each do |chg|\n case chg.action\n when \"-\"\n oldstart = chg.old_position\n output[chg.old_position] = TAG_NEWLINE if chg.old_element.match(/^\\r?\\n$/)\n when \"+\"\n if chg.new_element.match(/^\\r?\\n$/)\n output.insert(chg.old_position, TAG_NEWLINE)\n else\n output.insert(chg.old_position, \"#{escape_html[chg.new_element]}\")\n end\n end\n end\n\n if newchange.action == \"+\"\n output.insert(newstart, TAG_INS)\n end\n\n if hunk[0].action == \"-\"\n output.insert((newstart == oldstart || newchange.action != \"+\") ? newstart + 1 : newstart, TAG_DEL_CLOSE)\n output.insert(oldstart, TAG_DEL)\n end\n end\n\n output.join.gsub(/\\r?\\n/, TAG_BREAK)\n end",
"title": ""
},
{
"docid": "fd8931fe2743838da7ea6a4af8cc963c",
"score": "0.5649171",
"text": "def diff(old, new)\n pattern = Regexp.new('(?:<.+?>)|(?:\\p{Word}+)|(?:[ \\t]+)|(?:\\r?\\n)|(?:.+?)')\n\n thisarr = old.scan(pattern)\n otharr = new.scan(pattern)\n\n cbo = Diff::LCS::ContextDiffCallbacks.new\n diffs = thisarr.diff(otharr, cbo)\n\n escape_html = lambda { |str| str.gsub(/&/, \"&\").gsub(/</, \"<\").gsub(/>/, \">\") }\n\n output = thisarr\n output.each { |q| q.replace(escape_html[q]) }\n\n diffs.reverse_each do |hunk|\n newchange = hunk.max { |a, b| a.old_position <=> b.old_position }\n newstart = newchange.old_position\n oldstart = hunk.min { |a, b| a.old_position <=> b.old_position }.old_position\n\n if newchange.action == \"+\"\n output.insert(newstart, TAG_INS_CLOSE)\n end\n\n hunk.reverse_each do |chg|\n case chg.action\n when \"-\"\n oldstart = chg.old_position\n output[chg.old_position] = TAG_NEWLINE if chg.old_element.match(/^\\r?\\n$/)\n when \"+\"\n if chg.new_element.match(/^\\r?\\n$/)\n output.insert(chg.old_position, TAG_NEWLINE)\n else\n output.insert(chg.old_position, \"#{escape_html[chg.new_element]}\")\n end\n end\n end\n\n if newchange.action == \"+\"\n output.insert(newstart, TAG_INS)\n end\n\n if hunk[0].action == \"-\"\n output.insert((newstart == oldstart || newchange.action != \"+\") ? newstart + 1 : newstart, TAG_DEL_CLOSE)\n output.insert(oldstart, TAG_DEL)\n end\n end\n\n output.join.gsub(/\\r?\\n/, TAG_BREAK)\n end",
"title": ""
},
{
"docid": "d62df38b40d5effe9b660b3f7c0efcc8",
"score": "0.56359076",
"text": "def message_with_diff(message, differ, actual); end",
"title": ""
},
{
"docid": "7f5be927406064f48ffe9e05bdadc3ae",
"score": "0.56227636",
"text": "def to_s(options = {})\n get_diff(options) if options[:force_reload] || !@total_diff.any?\n\n @total_diff.each_with_index.collect do |line, line_num|\n str_data = line.collect { |f_diff| f_diff.join(\" \") }.join(\";\")\n \"#{line_num.succ}. #{str_data}\"\n end.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "3136801d915434ed555d6b51e5e6eab9",
"score": "0.56031257",
"text": "def print_resource_diffs(r1, r2)\n result = r1.dup \n r2.each{|e| result.include?(e) ? result.delete(e) : result.push(e) }\n result.each {|resource| puts \"\\t#{resource}\"}\nend",
"title": ""
},
{
"docid": "5ce49fc6f9bf38fc055fd1952f0e939a",
"score": "0.5587762",
"text": "def diff_stat\n nil\n end",
"title": ""
},
{
"docid": "1669b7c240c01a98a1fe6ef111089ce1",
"score": "0.5584865",
"text": "def udiff(old_file, new_file)\n require \"diff/lcs\"\n require \"diff/lcs/hunk\"\n\n diff_str = \"\"\n file_length_difference = 0\n\n old_data = IO.readlines(old_file).map(&:chomp)\n new_data = IO.readlines(new_file).map(&:chomp)\n diff_data = ::Diff::LCS.diff(old_data, new_data)\n\n return diff_str if old_data.empty? && new_data.empty?\n return \"No differences encountered\\n\" if diff_data.empty?\n\n # write diff header (standard unified format)\n ft = File.stat(old_file).mtime.localtime.strftime(\"%Y-%m-%d %H:%M:%S.%N %z\")\n diff_str << \"--- #{old_file}\\t#{ft}\\n\"\n ft = File.stat(new_file).mtime.localtime.strftime(\"%Y-%m-%d %H:%M:%S.%N %z\")\n diff_str << \"+++ #{new_file}\\t#{ft}\\n\"\n\n # loop over diff hunks. if a hunk overlaps with the last hunk,\n # join them. otherwise, print out the old one.\n old_hunk = hunk = nil\n diff_data.each do |piece|\n\n hunk = ::Diff::LCS::Hunk.new(old_data, new_data, piece, 3, file_length_difference)\n file_length_difference = hunk.file_length_difference\n next unless old_hunk\n next if hunk.merge(old_hunk)\n\n diff_str << old_hunk.diff(:unified) << \"\\n\"\n ensure\n old_hunk = hunk\n\n end\n diff_str << old_hunk.diff(:unified) << \"\\n\"\n diff_str\n end",
"title": ""
},
{
"docid": "132753fd9e3e6f7e40b1437c1a2954fc",
"score": "0.5579456",
"text": "def unit_diff(input=ARGF, output=$stdout)\n $b = false unless defined? $b\n $c = false unless defined? $c\n $k = false unless defined? $k\n $u = true unless defined? $u\n $p = false unless defined? $p\n\n data, footer = self.parse_input(input, output)\n\n output = []\n\n # Output\n data.each do |result|\n if result.first =~ /Error/ then\n output.push result.join('')\n next\n end\n\n prefix, expect, butwas, result_footer = parse_diff(result)\n\n output.push prefix.compact.map {|line| line.strip}.join(\"\\n\")\n\n if butwas then\n output.push self.diff(expect, butwas)\n\n output.push result_footer\n output.push ''\n else\n output.push expect.join('')\n end\n end\n\n if footer then\n footer.shift if footer.first.strip.empty?\n output.push footer.compact.map {|line| line.strip}.join(\"\\n\")\n end\n\n return output.flatten.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "70882963faef35223b1513dabfba5357",
"score": "0.5575866",
"text": "def stat_grep(changes,sign)\n changes_lines=changes.split(\"\\n\")\n changes_lines.collect{|line|\n split=line.split\n split[1] if split[0] == sign\n }.compact\n end",
"title": ""
},
{
"docid": "d15d99990135021829ea7580d823ccd1",
"score": "0.55651456",
"text": "def move_diffs\n end",
"title": ""
},
{
"docid": "7a89ba41091edf90f6bf02ba19faeb51",
"score": "0.5565117",
"text": "def format_difference(old, board = 'hs')\n if !is_mappack? || board != 'dual'\n return format_difference_board(old, board).join(\"\\n\")\n end\n\n diffs_hs = format_difference_board(old, 'hs', diff_score: false, empty: false)\n diffs_sr = format_difference_board(old, 'sr', diff_score: false, empty: false)\n return '' if diffs_hs.empty? && diffs_sr.empty?\n length_hs = diffs_hs.first.length rescue 0\n length_sr = diffs_sr.first.length rescue 0\n size = [diffs_hs.size, diffs_sr.size].max\n diffs_hs = diffs_hs.ljust(size, ' ' * length_hs)\n diffs_sr = diffs_sr.ljust(size, ' ' * length_sr)\n header = ' ' + 'Highscore'.center(length_hs - 4) + ' ' + 'Speedrun'.center(length_sr - 4)\n ret = [header, *diffs_hs.zip(diffs_sr).map{ |hs, sr| hs.sub(':', ' │') + ' │ ' + sr[4..-1] }]\n ret.join(\"\\n\")\n rescue\n nil\n end",
"title": ""
},
{
"docid": "75e26c513fe2998f2c285b54bfd87397",
"score": "0.5541887",
"text": "def dump(results, summary)\n hack=Hash.new {|h,k| h[k]=0}\n puts \"=========SUMMARY===============\"\n summary.each {|k,v| puts \"#{k}: #{v}\"}\n puts \"#{results.keys.size} Buckets.\"\n results.sort.each {|k,v|\n hack[v[2]]+=1\n }\n hack.each {|k,v| puts \"#{k}: #{v}\"}\n puts \"===============================\"\n results.sort.each {|k,v|\n puts \"--- #{k} (count: #{v[0]}) ---\"\n puts v[1].join(\"\\n\")\n # Quick and dirty, needs better path handling.\n if OPTS[:template_given]\n next unless v[1][3]\n puts `ruby ole2diff.rb -o #{OPTS[:template]} #{v[1][3]}`\n end\n }\nend",
"title": ""
},
{
"docid": "3a367a82f8f8cbc53b98aec824304e2f",
"score": "0.5536122",
"text": "def diff_as_string(data_old, data_new, format=:unified, context_lines=3)\n\n data_old = data_old.split(/\\n/).map! { |e| e.chomp }\n data_new = data_new.split(/\\n/).map! { |e| e.chomp }\n\n output = \"\"\n diffs = Diff::LCS.diff(data_old, data_new)\n return output if diffs.empty?\n oldhunk = hunk = nil\n file_length_difference = 0\n diffs.each do |piece|\n begin\n hunk = Diff::LCS::Hunk.new(data_old, data_new, piece, context_lines,\n file_length_difference)\n file_length_difference = hunk.file_length_difference\n next unless oldhunk\n\n # Hunks may overlap, which is why we need to be careful when our\n # diff includes lines of context. Otherwise, we might print\n # redundant lines.\n if (context_lines > 0) and hunk.overlaps?(oldhunk)\n hunk.unshift(oldhunk)\n else\n output << oldhunk.diff(format)\n end\n ensure\n oldhunk = hunk\n output << \"\\n\"\n end\n end\n\n #Handle the last remaining hunk\n output << oldhunk.diff(format) << \"\\n\"\nend",
"title": ""
},
{
"docid": "f897f8122d9da77cc328004d349700a3",
"score": "0.5524332",
"text": "def diff_cleanup_merge(diffs)\n diffs << new_equal_node(\"\") # Add a dummy entry at the end.\n pointer = 0\n count_delete = 0\n count_insert = 0\n text_delete = \"\"\n text_insert = \"\"\n\n while pointer < diffs.length\n case diffs[pointer].operation\n when :INSERT\n text_insert += diffs[pointer].text\n pointer += 1\n count_insert += 1\n when :DELETE\n text_delete += diffs[pointer].text\n count_delete += 1\n pointer += 1\n else # :EQUAL\n # Upon reaching an equality, check for prior redundancies.\n if count_delete + count_insert > 1\n if count_delete.nonzero? && count_insert.nonzero?\n # Factor out any common prefixies.\n common_length = diff_common_prefix(text_insert, text_delete)\n if common_length.nonzero?\n position = pointer - count_delete - count_insert\n if position.positive? && diffs[position - 1].is_equal?\n diffs[position - 1].text += text_insert[0...common_length]\n else\n diffs.unshift(new_equal_node(text_insert[0...common_length]))\n pointer += 1\n end\n text_insert = text_insert[common_length..-1]\n text_delete = text_delete[common_length..-1]\n end\n # Factor out any common suffixies.\n common_length = diff_common_suffix(text_insert, text_delete)\n if common_length.nonzero?\n diffs[pointer].text = text_insert[-common_length..-1] + diffs[pointer].text\n text_insert = text_insert[0...-common_length]\n text_delete = text_delete[0...-common_length]\n end\n end\n\n # Delete the offending records and add the merged ones.\n position = pointer - count_delete - count_insert\n diffs[position, count_delete + count_insert] =\n if count_delete.zero?\n [new_insert_node(text_insert)]\n elsif count_insert.zero?\n [new_delete_node(text_delete)]\n else\n [new_delete_node(text_delete), new_insert_node(text_insert)]\n end\n\n pointer = position + (count_delete.zero? ? 0 : 1) + (count_insert.zero? ? 0 : 1) + 1\n elsif pointer.positive? && diffs[pointer - 1].is_equal?\n # Merge this equality with the previous one.\n diffs[pointer - 1].text += diffs[pointer].text\n diffs[pointer, 1] = []\n else\n pointer += 1\n end\n count_insert = 0\n count_delete = 0\n text_delete = \"\"\n text_insert = \"\"\n end\n end\n\n diffs.pop if diffs.last.text.empty? # Remove the dummy entry at the end.\n\n # Second pass: look for single edits surrounded on both sides by equalities\n # which can be shifted sideways to eliminate an equality.\n # e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC\n changes = false\n pointer = 1\n\n # Intentionally ignore the first and last element (don't need checking).\n while pointer < diffs.length - 1\n if diffs[pointer - 1].is_equal? && diffs[pointer + 1].is_equal?\n # This is a single edit surrounded by equalities.\n if diffs[pointer].text[-diffs[pointer - 1].text.length..-1] == diffs[pointer - 1].text\n # Shift the edit over the previous equality.\n changes = true\n diffs[pointer].text = diffs[pointer - 1].text + diffs[pointer].text[0...-diffs[pointer - 1].text.length]\n diffs[pointer + 1].text = diffs[pointer - 1].text + diffs[pointer + 1].text\n diffs[pointer - 1, 1] = []\n elsif diffs[pointer].text[0...diffs[pointer + 1].text.length] == diffs[pointer + 1].text\n # Shift the edit over the next equality.\n changes = true\n diffs[pointer - 1].text += diffs[pointer + 1].text\n diffs[pointer].text = diffs[pointer].text[diffs[pointer + 1].text.length..-1] + diffs[pointer + 1].text\n diffs[pointer + 1, 1] = []\n end\n end\n pointer += 1\n end\n\n # If shifts were made, the diff needs reordering and another shift sweep.\n diff_cleanup_merge(diffs) if changes\n end",
"title": ""
},
{
"docid": "c9f2515d8139dccd47e14374b1de4049",
"score": "0.55133104",
"text": "def diff(doc_version)\n diff_out = Diffy::Diff.new(doc.plain, doc_version.doc.plain)\n first_chars = diff_out.to_s.gsub(/(.)[^\\n]*\\n/, '\\1')\n adds = first_chars.count(\"+\")\n mins = first_chars.count(\"-\")\n total = mins + adds\n if total > 8\n min = (8.0 / total)\n adds = (adds * min).round\n mins = (mins * min).round\n total = 8\n end\n [adds, mins, 8 - total]\n rescue StandardError\n [0, 0, 8]\n end",
"title": ""
},
{
"docid": "ed89289a4b0812ab9d16d27b824ecd79",
"score": "0.5512003",
"text": "def git_git_diff_output\n output = <<EOF\ndiff --git a/public/css/application.css b/public/css/application.css\nindex 522ca1a..730eb1e 100644\n--- a/public/css/application.css\n+++ b/public/css/application.css\n@@ -18,0 +19,4 @@ footer{\n+\n+footer .container .right {\n+ float:right;\n+}\ndiff --git a/views/layout.erb b/views/layout.erb\nindex f8d3aea..7f4fb2f 100644\n--- a/views/layout.erb\n+++ b/views/layout.erb\n@@ -43,0 +44 @@\n+ <span class=\"right\">a part of <a href=\"http://picoappz.com\">picoappz</a></span>\nEOF\n output\n end",
"title": ""
},
{
"docid": "cd448f800dacc7b8ed7c59251e8bf8bc",
"score": "0.5503018",
"text": "def to_string fdiff\n str = \"\"\n str << fdiff.to_diff_summary_string\n str << \": \"\n str << fdiff.message\n str << \"\\n\"\n return str\n end",
"title": ""
},
{
"docid": "aa545a786142de09b83ccceeb78c1a52",
"score": "0.55023474",
"text": "def move_diffs\n\n end",
"title": ""
},
{
"docid": "26965bcebc205ecb564a9eae14e261e9",
"score": "0.55016553",
"text": "def diffs(differ, actual)\n @expected_list\n .map do |(expected, diff_label)|\n diff = differ.diff(actual, expected)\n next if diff.strip.empty?\n diff_label + diff\n end\n .compact\n .join(\"\\n\\n\")\n end",
"title": ""
},
{
"docid": "8150471753b37bb4a7cd286c962c5fbf",
"score": "0.5501291",
"text": "def parse_diff_added(diff, exclude)\n ary = diff.split('diff')\n ary = ary.delete_if {|d| d.empty? }\n ary = ary.delete_if {|d| exclude.any? {|r| d.lines.first.match Regexp.new(r)}}\n ary.join(\"\\n\").lines.select {|l| l.match /^\\+[^+].*/}.join\n end",
"title": ""
},
{
"docid": "9b7fa09ab352945039b1eb9b429cbd34",
"score": "0.5483031",
"text": "def diff1\n @diff1\n end",
"title": ""
},
{
"docid": "3742e9f84a460abf5dbe8020360e87a4",
"score": "0.5482678",
"text": "def lines\n @lines ||= diff.split(\"\\n\")\n end",
"title": ""
},
{
"docid": "d697ace4c2828234a294cf65ce46d6e5",
"score": "0.5475581",
"text": "def test_diff_cli_rollover\n diff_cli('.2', true)\n end",
"title": ""
},
{
"docid": "ea85e6aafadd9d27848b38b997d98a0b",
"score": "0.54549474",
"text": "def diff\n @diff ||= Railroader::Differ.new(all_warnings, @old_results).diff\n end",
"title": ""
},
{
"docid": "4c5e6881ea10e6192c25ed1e5fdd6f61",
"score": "0.5452297",
"text": "def mu_pp_for_diff(obj); end",
"title": ""
},
{
"docid": "b5129c682ac0d284716be2acb77a2f17",
"score": "0.54420745",
"text": "def difference(old_files, new_files)\n subtractions = old_files - new_files\n additions = new_files - old_files\n result = '' and subtractions.each do |s|\n result << \"- #{s}\"\n end\n additions.each do |a|\n result << \"+ #{a}\"\n end\n result\nend",
"title": ""
},
{
"docid": "8056b2324f42a93f615c116241e0ff08",
"score": "0.5438215",
"text": "def get_diffs_struct\n\t {:append => {}, :remove => {}, :update => {}, :same => {}}\n end",
"title": ""
},
{
"docid": "ae5b830b1143cc9cc2b7c14b2122c256",
"score": "0.54327756",
"text": "def call(a,b)\n # convert dmp output from\n # [[:delete, \"a\"], [:equal, \"ab\"], [:delete, \"b\"], [:insert, \"x\"], [:equal, \"ccnn\"], [:insert, \"e\"]]\n # to\n # [[-1, \"a\"], [0, \"ab\"], [-1, \"b\"], [1, \"x\"], [0, \"ccnn\"], [1, \"e\"]]\n dmp = DiffMatchPatch.new\n\n dmp.diff_timeout = 0\n dmp.diff_edit_cost = 10 if dmp.respond_to? :diff_edit_cost\n dmp.diff_editCost = 10 if dmp.respond_to? :diff_editCost\n\n diffs = dmp.diff_main(a,b,false).map { |e|\n # NOTE on utf8 awareness: The diff_match_patch_native library is not\n # UTF8 aware and does not tag strings as UTF-8, so Ruby considers them\n # to be ASCII-8BIT/BINARY encoded.\n # Turns out that they are actually UTF-8 encoded, just improperly tagged.\n # So for Suspension to work, we can use force_encoding since we know\n # that the input strings were encoded in UTF-8.\n utf8_encoded_string = if(Encoding::ASCII_8BIT == e[1].encoding)\n # This string came from diff_match_patch_native, force encode to UTF-8\n e[1].force_encoding(\"UTF-8\")\n else\n # This string came from diff_match_patch (Ruby), leave as is\n e[1]\n end\n [SYM_TO_INT_MAP[e[0]], utf8_encoded_string]\n }\n\n # Since dmp is not utf8 aware, it can produce invalid UTF-8 byte sequences\n # in the resulting diffs. This can be caused, e.g., by two\n # different multibyte characters at the same position where the first\n # bytes are identical, and a subsequent one is different. Dmp splits that\n # multibyte char into separate diff units and thus creates invalid UTF8\n # byte sequences.\n #\n # Example: \"a—b\" and \"a…b\"\n #\n # [\n # [0, \"a\\xE2\\x80\"],\n # [-1, \"\\x94b\"],\n # [1, \"\\xA6b\"]\n # ]\n #\n # This is normally not a problem since combining the diff units will\n # result in valid utf8 byte sequences. However, in suspension we need to\n # measure diff string lengths for token suspension and unsuspension, so\n # the broken utf8 byte sequences get in the way and we need to fix them.\n # We fix these invalid diffs by moving separated byte sequences back\n # together.\n invalid_diff_clusters = diffs.each_with_index.chunk { |diff,idx|\n if diff[1].valid_encoding?\n nil\n else\n :cluster\n end\n }\n\n if invalid_diff_clusters.any?\n fix_invalid_diffs!(diffs, invalid_diff_clusters)\n end\n\n diffs\n end",
"title": ""
},
{
"docid": "7e712e9318e91e6f88a2e29899af1604",
"score": "0.5422499",
"text": "def difference(s)\n combine_with(s, 'd')\n end",
"title": ""
},
{
"docid": "d11bb55caeeaaf1504ad1dd6b1164c7c",
"score": "0.5421909",
"text": "def describe_file_diff(diff, max_width=80)\n description = []\n description << \"File comparison error `#{diff.relative_path}` for #{spec.spec_folder}:\"\n description << \"--- DIFF \".ljust(max_width, '-')\n description += diff.map do |line|\n case line\n when /^\\+/ then line.green\n when /^-/ then line.red\n else line\n end.gsub(\"\\n\",'')\n end\n description << \"--- END \".ljust(max_width, '-')\n description << ''\n description * \"\\n\"\n end",
"title": ""
},
{
"docid": "4a2b855305d95af7bfa43c564e94df37",
"score": "0.5415716",
"text": "def show_diff\n print base.__send__(:diff_files, relative_path, content, verbose: @verbose)\n end",
"title": ""
},
{
"docid": "0ab993a884eb7fdc040004b2547aba12",
"score": "0.5411909",
"text": "def diff_cleanup_merge(diffs)\n diffs.push([:equal, \"\"]) # Add a dummy entry at the end.\n pointer = 0\n count_delete = 0\n count_insert = 0\n text_delete = \"\"\n text_insert = \"\"\n\n while pointer < diffs.length\n case diffs[pointer][0]\n when :insert\n count_insert += 1\n text_insert += diffs[pointer][1]\n pointer += 1\n when :delete\n count_delete += 1\n text_delete += diffs[pointer][1]\n pointer += 1\n when :equal\n # Upon reaching an equality, check for prior redundancies.\n if count_delete + count_insert > 1\n if count_delete != 0 && count_insert != 0\n # Factor out any common prefixies.\n common_length = diff_common_prefix(text_insert, text_delete)\n if common_length != 0\n if (pointer - count_delete - count_insert) > 0 &&\n diffs[pointer - count_delete - count_insert - 1][0] == :equal\n diffs[pointer - count_delete - count_insert - 1][1] +=\n text_insert[0...common_length]\n else\n diffs.unshift([:equal, text_insert[0...common_length]])\n pointer += 1\n end\n text_insert = text_insert[common_length..]\n text_delete = text_delete[common_length..]\n end\n # Factor out any common suffixies.\n common_length = diff_common_suffix(text_insert, text_delete)\n if common_length != 0\n diffs[pointer][1] = text_insert[-common_length..] + diffs[pointer][1]\n text_insert = text_insert[0...-common_length]\n text_delete = text_delete[0...-common_length]\n end\n end\n\n # Delete the offending records and add the merged ones.\n diffs[pointer - count_delete - count_insert, count_delete + count_insert] = if count_delete.zero?\n [[:insert, text_insert]]\n elsif count_insert.zero?\n [[:delete, text_delete]]\n else\n [[:delete, text_delete], [:insert, text_insert]]\n end\n pointer = pointer - count_delete - count_insert +\n (count_delete.zero? ? 0 : 1) + (count_insert.zero? ? 0 : 1) + 1\n elsif pointer != 0 && diffs[pointer - 1][0] == :equal\n # Merge this equality with the previous one.\n diffs[pointer - 1][1] += diffs[pointer][1]\n diffs[pointer, 1] = []\n else\n pointer += 1\n end\n count_insert = 0\n count_delete = 0\n text_delete = \"\"\n text_insert = \"\"\n end\n end\n\n if diffs.last[1].empty?\n diffs.pop # Remove the dummy entry at the end.\n end\n\n # Second pass: look for single edits surrounded on both sides by equalities\n # which can be shifted sideways to eliminate an equality.\n # e.g: A<ins>BA</ins>C -> <ins>AB</ins>AC\n changes = false\n pointer = 1\n\n # Intentionally ignore the first and last element (don't need checking).\n while pointer < diffs.length - 1\n if diffs[pointer - 1][0] == :equal && diffs[pointer + 1][0] == :equal\n # This is a single edit surrounded by equalities.\n if diffs[pointer][1][-diffs[pointer - 1][1].length..] == diffs[pointer - 1][1]\n # Shift the edit over the previous equality.\n diffs[pointer][1] = diffs[pointer - 1][1] + diffs[pointer][1][0...-diffs[pointer - 1][1].length]\n diffs[pointer + 1][1] = diffs[pointer - 1][1] + diffs[pointer + 1][1]\n diffs[pointer - 1, 1] = []\n changes = true\n elsif diffs[pointer][1][0...diffs[pointer + 1][1].length] == diffs[pointer + 1][1]\n # Shift the edit over the next equality.\n diffs[pointer - 1][1] += diffs[pointer + 1][1]\n diffs[pointer][1] = diffs[pointer][1][diffs[pointer + 1][1].length..] +\n diffs[pointer + 1][1]\n diffs[pointer + 1, 1] = []\n changes = true\n end\n end\n pointer += 1\n end\n\n # If shifts were made, the diff needs reordering and another shift sweep.\n if changes\n diff_cleanup_merge(diffs)\n end\n end",
"title": ""
},
{
"docid": "253a2612a2bf91f49f8c86fcf8b32a26",
"score": "0.54106057",
"text": "def show_diff destination, content\n if diff_lcs_loaded? && ENV['THOR_DIFF'].nil? && ENV['RAILS_DIFF'].nil?\n actual = File.binread(destination).to_s.split(\"\\n\")\n content = content.to_s.split(\"\\n\")\n\n Diff::LCS.sdiff(actual, content).each do |diff|\n output_diff_line(diff)\n end\n else\n diff_cmd = ENV[\"THOR_DIFF\"] || ENV[\"RAILS_DIFF\"] || \"diff -u\"\n\n require \"tempfile\"\n Tempfile.open(File.basename(destination), File.dirname(destination)) do |temp|\n temp.write content\n temp.rewind\n system %(#{diff_cmd} \"#{destination}\" \"#{temp.path}\")\n end\n end\n end",
"title": ""
},
{
"docid": "5010fb32ad9b1ab6bd2befc0c965fc12",
"score": "0.541034",
"text": "def diff_between(string_a, string_b)\n\n # Diffy returns a list of 'chunks', where insertions, deletions, and\n # unchanged sequences of lines are grouped up. This method ungroups them so\n # that they're easier to display line-by-line.\n def diff_chunks(string_a, string_b)\n string_a = sanitize_for_comparison(string_a)\n string_b = sanitize_for_comparison(string_b)\n\n diff = ::Diffy::Diff.new(string_a, string_b)\n diff.each_chunk.map do |chunk|\n # Ignore messages about newlines at the end of files; most teachers will\n # probably not put any ending newlines when they specify the expected\n # output.\n if chunk == \"\\\\ No newline at end of file\\n\"\n []\n else\n chunk.split(\"\\n\")\n end\n end.flatten\n end\n\n def chunks_as_html(chunks)\n def diff_line(line_class, &block)\n content_tag(:tr, class: line_class, &block)\n end\n\n def diff_line_number(line_number, should_show_number)\n content_tag(:td, should_show_number ? line_number : \"\",\n class: 'diff-line-number')\n end\n\n def diff_line_code(text)\n content_tag(:td,\n content_tag(:span, text, class: 'diff-line')\n )\n end\n\n safe_empty = \"\".html_safe\n\n # These are the line numbers that will be shown off to the left of the\n # code. Because insertions and deletions only exist in one and not both\n # files, these two values will not always be the same.\n line_numbers = {a: 0, b: 0}\n\n chunks.reduce(safe_empty) do |acc, chunk|\n line_type = case chunk[0]\n when '+'\n :insertion\n when '-'\n :deletion\n else\n :unchanged\n end.to_s.inquiry\n\n # This is important because unchanged lines will have a leading space\n # that browsers will not normally show.\n chunk_to_html = if line_type.unchanged?\n # the [1..-1] is to avoid putting in the leading space twice\n \" \".html_safe + chunk[1..-1]\n else\n chunk\n end\n\n # Both line numbers incremented when line_type is 'unchanged'\n line_numbers[:a] += 1 unless line_type.deletion?\n line_numbers[:b] += 1 unless line_type.insertion?\n\n acc + diff_line(line_type.to_s) do\n diff_line_number(line_numbers[:a], !line_type.deletion?) +\n diff_line_number(line_numbers[:b], !line_type.insertion?) +\n diff_line_code(chunk_to_html)\n end\n end\n end\n\n table_content = chunks_as_html(diff_chunks(string_a, string_b))\n\n content_tag(:table, table_content,\n class: 'table table-bordered table-condensed table-diff')\n end",
"title": ""
},
{
"docid": "af1430b54f09b866fe862f12b1dafc48",
"score": "0.5409751",
"text": "def output_diff_messages(generators)\n # output information about glue etl job diffs\n output_glue_etl_job_diff_message(generators)\n\n # pulls the current state of the relations from AWS and attaches\n # it to the relation of the same name if present. also outputs\n # a list of all relations in AWS.. in this config... and which\n # relations will be deleted.\n output_athena_relation_diff_message(generators)\n end",
"title": ""
},
{
"docid": "7664af51775d0a1778aeac1921a8740e",
"score": "0.5400965",
"text": "def diff_all\n describe\n all_diffs = {}\n @sgs.each do |key, sg|\n diff = sg.diff\n if diff.any?\n all_diffs[key] = diff\n end\n end\n all_diffs\n end",
"title": ""
},
{
"docid": "54e6aa4e3650d2e2459af4901dc8cd32",
"score": "0.53845066",
"text": "def diff_cleanup_efficiency(diffs)\n changes = false\n equalities = [] # Stack of indices where equalities are found.\n last_equality = \"\" # Always equal to equalities.last[1]\n pointer = 0 # Index of current position.\n pre_ins = false # Is there an insertion operation before the last equality.\n pre_del = false # Is there a deletion operation before the last equality.\n post_ins = false # Is there an insertion operation after the last equality.\n post_del = false # Is there a deletion operation after the last equality.\n\n while pointer < diffs.length\n if diffs[pointer][0] == :equal # Equality found.\n if diffs[pointer][1].length < diff_edit_cost && (post_ins || post_del)\n # Candidate found.\n equalities.push(pointer)\n pre_ins = post_ins\n pre_del = post_del\n last_equality = diffs[pointer][1]\n else\n # Not a candidate, and can never become one.\n equalities.clear\n last_equality = \"\"\n end\n post_ins = false\n post_del = false\n else # An insertion or deletion.\n if diffs[pointer][0] == :delete\n post_del = true\n else\n post_ins = true\n end\n\n # Five types to be split:\n # <ins>A</ins><del>B</del>XY<ins>C</ins><del>D</del>\n # <ins>A</ins>X<ins>C</ins><del>D</del>\n # <ins>A</ins><del>B</del>X<ins>C</ins>\n # <ins>A</del>X<ins>C</ins><del>D</del>\n # <ins>A</ins><del>B</del>X<del>C</del>\n\n if !last_equality.empty? &&\n ((pre_ins && pre_del && post_ins && post_del) ||\n ((last_equality.length < diff_edit_cost / 2) &&\n [pre_ins, pre_del, post_ins, post_del].count(true) == 3))\n # Duplicate record.\n diffs[equalities.last, 0] = [[:delete, last_equality]]\n # Change second copy to insert.\n diffs[equalities.last + 1][0] = :insert\n equalities.pop # Throw away the equality we just deleted\n last_equality = \"\"\n if pre_ins && pre_del\n # No changes made which could affect previous entry, keep going.\n post_ins = true\n post_del = true\n equalities.clear\n else\n unless equalities.empty?\n equalities.pop # Throw away the previous equality.\n pointer = equalities.last || -1\n end\n post_ins = false\n post_del = false\n end\n changes = true\n end\n end\n pointer += 1\n end\n\n if changes\n diff_cleanup_merge(diffs)\n end\n end",
"title": ""
},
{
"docid": "ea02f1fb43e146379425360c07b8a568",
"score": "0.5382025",
"text": "def parse_diff(arr)\n\t\tarr = Array.new(1, arr) if arr.is_a?(String)\n\n\t\tarr.each do |e| \n\t\t\tset_square_state(e.to_i, /^-/.match(e).nil?) \n\t\tend\n\tend",
"title": ""
},
{
"docid": "baf46323f4fef86c1104d253a2f625d9",
"score": "0.53809696",
"text": "def coalesce_diffs( diff_hsh )\n results=[]\n diff_hsh.each {|cc|\n raise RuntimeError, \"oldpos not newpos, dunno what to do\" unless cc.old_position==cc.new_position\n raise RuntimeError, \"Length mismatch, can't handle.\" unless cc.old_element.length==cc.new_element.length\n if results.last and cc.old_position==results.last[0]+results.last[1][0].length\n # Contiguous, coalesce with the last difference.\n results.last[1][0] << cc.old_element\n results.last[1][1] << cc.new_element\n else\n # new difference\n results << [cc.old_position,[cc.old_element,cc.new_element]]\n end\n }\n result_hash={}\n # One of these hashes per stream / dirent, hash of offset -> difference detail structure.\n results.each {|ary| \n offset=ary[0]\n result_hash[offset]={}\n result_hash[offset][:old_elem]=ary[1][0]\n result_hash[offset][:new_elem]=ary[1][1]\n # Binary versions. These strings will be modified by the reducer.\n result_hash[offset][:old_binary]=result_hash[ary[0]][:old_elem].unpack('B*').first\n result_hash[offset][:new_binary]=result_hash[ary[0]][:new_elem].unpack('B*').first\n # As we gradually revert, the replacement will be left_reverted + new_binary +\n # right_reverted.\n result_hash[offset][:left_reverted]=\"\"\n result_hash[offset][:right_reverted]=\"\"\n # The binary masks will show which bits of the final item \"matter\". If we can\n # revert a bit to the old value (which may be unchanged) and the crash is the\n # same then the bit in question doesn't matter.\n result_hash[offset][:left_mask]=\"\"\n result_hash[offset][:right_mask]=\"\"\n # Initially, we set all bits to 'matter'\n result_hash[offset][:mid_mask]=\"1\"*result_hash[ary[0]][:old_binary].length\n }\n # In summary:\n # left_reverted and right_reverted grow, new binary shrinks\n # left_reverted+new_binary+right_reverted will be the next test\n # left_mask and right_mask grow, mid_mask is always \"111..11\" and shrinks\n result_hash\n end",
"title": ""
},
{
"docid": "a0eb4c565f383188c0022a1bde471b4e",
"score": "0.53807646",
"text": "def calculate_delta(file, st)\n 0\n end",
"title": ""
},
{
"docid": "a0eb4c565f383188c0022a1bde471b4e",
"score": "0.53807646",
"text": "def calculate_delta(file, st)\n 0\n end",
"title": ""
},
{
"docid": "ae614849b842641161d79764780428a2",
"score": "0.537877",
"text": "def pt2()\n results = []\n idLength = $ids[0].length\n $ids.each_with_index do |id1, id1Index|\n $ids.each do |id2|\n # short circuit so we don't do unnecessary comparisons\n if id1 == id2 or $ids.index(id2) < id1Index\n # puts \"#{$ids.index(id2)} and #{id1Index}\"\n next\n end\n puts \"comparing #{id1} and #{id2}\"\n\n # figure out each index that has a diff\n diffs = []\n idLength.times do |i|\n if id1[i] != id2[i]\n diffs << i\n end\n end\n\n # remove the char at each diff index from id1 and copy the id into results array\n slicedId = String.new id1 # copy constructor\n diffs.each do |diffIndex|\n slicedId.slice! diffIndex\n results << slicedId\n end\n end\n end\n\n puts \"#{results}\"\nend",
"title": ""
},
{
"docid": "357f922a5d33fcf4f0a29f0207402df4",
"score": "0.53781915",
"text": "def truncated_diff_lines\n prev_lines = []\n\n highlighted_diff_lines.each do |line|\n if line.meta?\n prev_lines.clear\n else\n prev_lines << line\n\n break if for_line?(line)\n\n prev_lines.shift if prev_lines.length >= NUMBER_OF_TRUNCATED_DIFF_LINES\n end\n end\n\n prev_lines\n end",
"title": ""
},
{
"docid": "bb7b38a991593d9577756c164a64b227",
"score": "0.5371551",
"text": "def show_diff(destination, content) #:nodoc:\n show_diff_common(destination, content)\n end",
"title": ""
},
{
"docid": "7a5e949e67f84637e9f32d354b852540",
"score": "0.53623134",
"text": "def diff_lines\n @diff_lines ||= DiffParser.new.parse(source.each_line, diff_file: self).to_a\n end",
"title": ""
},
{
"docid": "6ad771809f686b592b3e32269bd97cf5",
"score": "0.5358489",
"text": "def showdiff(isthesame, thefirstfile, thefirstword, thesecondfile, thesecondword)\n if isthesame\n puts \"#{thefirstfile} & #{thesecondfile}\"\n puts thefirstword\n else\n puts thefirstfile, thefirstword\n puts thesecondfile, thesecondword\n end\n end",
"title": ""
},
{
"docid": "5855b653ae2d68dd5b4af646bfe78267",
"score": "0.53583586",
"text": "def calculate_delta(file, st)\n 0\n end",
"title": ""
},
{
"docid": "47b0cfd6d32a3f3a45ac4eb84940b841",
"score": "0.53568184",
"text": "def obtener_desviaciones(s)\r\n\t @s = []\r\n\t\t@s << 1\r\n\t\tfor i in (0...@deltas.length - 1) do\r\n\t\t\tdesviacion = s - i\r\n\t\t\t@s << desviacion\r\n\t\tend\r\n\tend",
"title": ""
},
{
"docid": "b1accb0d6d93829bbecd9a7d8f5aa249",
"score": "0.5354889",
"text": "def diff_to_delta(diffs)\n diffs.map { |op, data|\n case op\n when :insert\n \"+\" + PatchObj::PATCH_PARSER.escape(data, /[^0-9A-Za-z_.;!~*'(),\\/?:@&=+$\\#-]/)\n when :delete\n \"-\" + data.length.to_s\n when :equal\n \"=\" + data.length.to_s\n end\n }.join(\"\\t\").gsub(\"%20\", \" \")\n end",
"title": ""
}
] |
a2099a77c85e91272ae2f9e35b937953
|
Only allow a trusted parameter "white list" through.
|
[
{
"docid": "6760ca0859aadb9e3e99e5c408fc2f02",
"score": "0.0",
"text": "def _create_user_params\n params.require(:user).permit(_admin_params)\n end",
"title": ""
}
] |
[
{
"docid": "c1f317213d917a1e3cfa584197f82e6c",
"score": "0.7121987",
"text": "def allowed_params\n ALLOWED_PARAMS\n end",
"title": ""
},
{
"docid": "b32229655ba2c32ebe754084ef912a1a",
"score": "0.70541996",
"text": "def expected_permitted_parameter_names; end",
"title": ""
},
{
"docid": "a91e9bf1896870368befe529c0e977e2",
"score": "0.69483954",
"text": "def param_whitelist\n [:role, :title]\n end",
"title": ""
},
{
"docid": "547b7ab7c31effd8dcf394d3d38974ff",
"score": "0.6902367",
"text": "def default_param_whitelist\n [\"mode\"]\n end",
"title": ""
},
{
"docid": "e291b3969196368dd4f7080a354ebb08",
"score": "0.6733912",
"text": "def permitir_parametros\n \t\tparams.permit!\n \tend",
"title": ""
},
{
"docid": "4fc36c3400f3d5ca3ad7dc2ed185f213",
"score": "0.6717838",
"text": "def permitted_params\n []\n end",
"title": ""
},
{
"docid": "e164094e79744552ae1c53246ce8a56c",
"score": "0.6687021",
"text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "e662f0574b56baff056c6fc4d8aa1f47",
"score": "0.6676254",
"text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c436017f4e8bd819f3d933587dfa070a",
"score": "0.66612333",
"text": "def filtered_parameters; end",
"title": ""
},
{
"docid": "9a2a1af8f52169bd818b039ef030f513",
"score": "0.6555296",
"text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end",
"title": ""
},
{
"docid": "7ac5f60df8240f27d24d1e305f0e5acb",
"score": "0.6527056",
"text": "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end",
"title": ""
},
{
"docid": "53d84ad5aa2c5124fa307752101aced3",
"score": "0.6456324",
"text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end",
"title": ""
},
{
"docid": "60ccf77b296ed68c1cb5cb262bacf874",
"score": "0.6450841",
"text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "f12336a181f3c43ac8239e5d0a59b5b4",
"score": "0.6450127",
"text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "12fa2760f5d16a1c46a00ddb41e4bce2",
"score": "0.6447226",
"text": "def param_whitelist\n [:rating, :review]\n end",
"title": ""
},
{
"docid": "86b2d48cb84654e19b91d9d3cbc2ff80",
"score": "0.6434961",
"text": "def valid_params?; end",
"title": ""
},
{
"docid": "16e18668139bdf8d5ccdbff12c98bd25",
"score": "0.64121825",
"text": "def permitted_params\n declared(params, include_missing: false)\n end",
"title": ""
},
{
"docid": "16e18668139bdf8d5ccdbff12c98bd25",
"score": "0.64121825",
"text": "def permitted_params\n declared(params, include_missing: false)\n end",
"title": ""
},
{
"docid": "7a6fbcc670a51834f69842348595cc79",
"score": "0.63913447",
"text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.63804525",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "bd826c318f811361676f5282a9256071",
"score": "0.63804525",
"text": "def filter_parameters; end",
"title": ""
},
{
"docid": "068f8502695b7c7f6d382f8470180ede",
"score": "0.6373396",
"text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "c04a150a23595af2a3d515d0dfc34fdd",
"score": "0.6360051",
"text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "fc43ee8cb2466a60d4a69a04461c601a",
"score": "0.6355191",
"text": "def check_params; true; end",
"title": ""
},
{
"docid": "9d23b31178b8be81fe8f1d20c154336f",
"score": "0.62856233",
"text": "def valid_params_request?; end",
"title": ""
},
{
"docid": "533f1ba4c3ab55e79ed9b259f67a70fb",
"score": "0.627813",
"text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "9735bbaa391eab421b71a4c1436d109e",
"score": "0.62451434",
"text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "67fe19aa3f1169678aa999df9f0f7e95",
"score": "0.6228103",
"text": "def list_params\n params.permit(:name)\n end",
"title": ""
},
{
"docid": "5ee931ad3419145387a2dc5a284c6fb6",
"score": "0.6224965",
"text": "def check_params\n true\n end",
"title": ""
},
{
"docid": "fe4025b0dd554f11ce9a4c7a40059912",
"score": "0.6222941",
"text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end",
"title": ""
},
{
"docid": "bb32aa218785dcd548537db61ecc61de",
"score": "0.6210244",
"text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end",
"title": ""
},
{
"docid": "ff55cf04e6038378f431391ce6314e27",
"score": "0.62077755",
"text": "def additional_permitted_params\n []\n end",
"title": ""
},
{
"docid": "c5f294dd85260b1f3431a1fbbc1fb214",
"score": "0.61762565",
"text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "0d980fc60b69d03c48270d2cd44e279f",
"score": "0.61711127",
"text": "def resource_params\n params[resource_singular_name].try(:permit, self.class.param_whitelist)\n end",
"title": ""
},
{
"docid": "1677b416ad07c203256985063859691b",
"score": "0.6168448",
"text": "def allow_params_authentication!; end",
"title": ""
},
{
"docid": "3eef50b797f6aa8c4def3969457f45dd",
"score": "0.6160164",
"text": "def param_whitelist\n [\n :title,\n :description,\n :organization,\n :team_id,\n :started_at,\n :finished_at,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end",
"title": ""
},
{
"docid": "c25a1ea70011796c8fcd4927846f7a04",
"score": "0.61446255",
"text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "8894a3d0d0ad5122c85b0bf4ce4080a6",
"score": "0.6134175",
"text": "def person_params\n # params whitelist does *not* include admin, sub, remember_token\n # TBD: share this whitelist with the list used by configuration_permitted_parameters\n # TBD: should current_password be on this list? -- for now, leaving off, since it seems to work without\n # NOTE: do not include 'admin' in this list!\n params.require(:person).permit(\n :name, \n :email, \n :description,\n :password, \n :password_confirmation\n )\n end",
"title": ""
},
{
"docid": "34d018968dad9fa791c1df1b3aaeccd1",
"score": "0.6120522",
"text": "def paramunold_params\n params.require(:paramunold).permit!\n end",
"title": ""
},
{
"docid": "76d85c76686ef87239ba8207d6d631e4",
"score": "0.6106709",
"text": "def param_params\n params.require(:param).permit(:param_category_id, :param_table_id, :name, :english_name, :weighting, :description)\n end",
"title": ""
},
{
"docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9",
"score": "0.60981655",
"text": "def quote_params\n params.permit!\n end",
"title": ""
},
{
"docid": "2b19f8222e09c2518b0d19b4bf1f69d3",
"score": "0.6076113",
"text": "def list_params\n params.permit(:list_name)\n end",
"title": ""
},
{
"docid": "aabfd0cce84d7f71b1ccd2df6a6af7c3",
"score": "0.60534036",
"text": "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end",
"title": ""
},
{
"docid": "4f20d784611d82c07d49cf1cf0d6cb7e",
"score": "0.60410434",
"text": "def all_params; end",
"title": ""
},
{
"docid": "5a96718b851794fc3e4409f6270f18fa",
"score": "0.6034582",
"text": "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end",
"title": ""
},
{
"docid": "ff7bc2f09784ed0b4563cfc89b19831d",
"score": "0.6029977",
"text": "def source_params\n params.require(:source).permit(all_allowed_params)\n end",
"title": ""
},
{
"docid": "6c615e4d8eed17e54fc23adca0027043",
"score": "0.6019861",
"text": "def user_params\n end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "7402112b5e653d343b91b6d38c203c59",
"score": "0.6019158",
"text": "def params; end",
"title": ""
},
{
"docid": "2032edd5ab9475d59be84bdf5595f23a",
"score": "0.60184896",
"text": "def get_allowed_parameters\n return _get_specific_action_config(:allowed_action_parameters, :allowed_parameters)&.map(&:to_s)\n end",
"title": ""
},
{
"docid": "c59ec134c641678085e086ab2a66a95f",
"score": "0.60157263",
"text": "def permitted_params\n @wfd_edit_parameters\n end",
"title": ""
},
{
"docid": "a8faf8deb0b4ac1bcdd8164744985176",
"score": "0.6005857",
"text": "def user_params\r\n end",
"title": ""
},
{
"docid": "b98f58d2b73eac4825675c97acd39470",
"score": "0.6003803",
"text": "def param_whitelist\n whitelist = [\n :comment,\n :old_progress, :new_progress,\n :metric_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:metric_id)\n end\n \n whitelist\n end",
"title": ""
},
{
"docid": "0cb77c561c62c78c958664a36507a7c9",
"score": "0.60012573",
"text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend",
"title": ""
},
{
"docid": "7b7196fbaee9e8777af48e4efcaca764",
"score": "0.59955895",
"text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end",
"title": ""
},
{
"docid": "be95d72f5776c94cb1a4109682b7b224",
"score": "0.5994598",
"text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend",
"title": ""
},
{
"docid": "70fa55746056e81854d70a51e822de66",
"score": "0.5993604",
"text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end",
"title": ""
},
{
"docid": "e4c37054b31112a727e3816e94f7be8a",
"score": "0.5983824",
"text": "def get_params\n\t\t\n\t\treturn ActionController::Parameters.new(self.attributes).permit(:first_name, :last_name, :email, :provider)\n\n\tend",
"title": ""
},
{
"docid": "e3089e0811fa34ce509d69d488c75306",
"score": "0.5983166",
"text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end",
"title": ""
},
{
"docid": "2202d6d61570af89552803ad144e1fe7",
"score": "0.5977431",
"text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end",
"title": ""
},
{
"docid": "4d77abbae6d3557081c88dad60c735d0",
"score": "0.597591",
"text": "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end",
"title": ""
},
{
"docid": "55d8ddbada3cd083b5328c1b41694282",
"score": "0.5968824",
"text": "def params_permit\n params.permit(:id)\n end",
"title": ""
},
{
"docid": "a44360e98883e4787a9591c602282c4b",
"score": "0.5965953",
"text": "def allowed_params\n params.require(:allowed).permit(:email)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.59647584",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "45b8b091f448e1e15f62ce90b681e1b4",
"score": "0.59647584",
"text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end",
"title": ""
},
{
"docid": "4e758c3a3572d7cdd76c8e68fed567e0",
"score": "0.59566855",
"text": "def filter_params\n params.permit(*resource_filter_permitted_params)\n end",
"title": ""
},
{
"docid": "3154b9c9e3cd7f0b297f900f73df5d83",
"score": "0.59506303",
"text": "def community_params\n params.permit(:profile_image, :name, :description, :privacy_type, :viewed_by, {tags: []}, {features: []}, {admins: []}, :members, :location, :beacon, :creator, :ambassadors, :current_events, :past_events, :feed, :category, :address, :allow_member_post_to_feed, :allow_member_post_to_events)\n end",
"title": ""
},
{
"docid": "b48f61fbb31be4114df234fa7b166587",
"score": "0.5950375",
"text": "def specialty_params\n\t\tparams.require(:specialty).permit(*Specialty::DEFAULT_ACCESSIBLE_ATTRIBUTES)\n\tend",
"title": ""
},
{
"docid": "c4802950f28649fdaed7f35882118f20",
"score": "0.59485626",
"text": "def authorize_params\n super.tap do |params|\n %w[display scope auth_type].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "5d64cb26ce1e82126dd5ec44e905341c",
"score": "0.59440875",
"text": "def feature_params_filter\n params.require(:feature).permit(:name, :cat, :lower, :upper, :opts, :category, :description, :company, :active, :unit, :icon)\n end",
"title": ""
},
{
"docid": "7fa620eeb32e576da67f175eea6e6fa0",
"score": "0.5930872",
"text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end",
"title": ""
},
{
"docid": "da4f66ce4e8c9997953249c3ff03114e",
"score": "0.5930206",
"text": "def argument_params\n params.require(:argument).permit(:name)\n end",
"title": ""
},
{
"docid": "f7c6dad942d4865bdd100b495b938f50",
"score": "0.5925668",
"text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end",
"title": ""
},
{
"docid": "9892d8126849ccccec9c8726d75ff173",
"score": "0.59235454",
"text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end",
"title": ""
},
{
"docid": "be01bb66d94aef3c355e139205253351",
"score": "0.5917905",
"text": "def property_params\n params.permit(:name, :is_available, :is_approved, :owner_id)\n end",
"title": ""
},
{
"docid": "631f07548a1913ef9e20ecf7007800e5",
"score": "0.59164816",
"text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end",
"title": ""
},
{
"docid": "d6bf948034a6c8adc660df172dd7ec6e",
"score": "0.5913821",
"text": "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end",
"title": ""
},
{
"docid": "eb5b91d56901f0f20f58d574d155c0e6",
"score": "0.59128743",
"text": "def whitelist_person_params\n params.require(:person).permit(:family, :pre_title, :given_name, :dates, :post_title, :epithet, :dates_of_office, same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end",
"title": ""
},
{
"docid": "c6a96927a6fdc0d2db944c79d520cd99",
"score": "0.5906617",
"text": "def parameters\n nil\n end",
"title": ""
},
{
"docid": "822c743e15dd9236d965d12beef67e0c",
"score": "0.59053683",
"text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end",
"title": ""
},
{
"docid": "a743e25503f1cc85a98a35edce120055",
"score": "0.59052664",
"text": "def sequence_param_whitelist\n default_param_whitelist << \"show_index\"\n end",
"title": ""
},
{
"docid": "533048be574efe2ed1b3c3c83a25d689",
"score": "0.5901591",
"text": "def resource_filter_permitted_params\n raise(NotImplementedError, 'resource_filter_permitted_params method not implemented')\n end",
"title": ""
},
{
"docid": "02a61b27f286a50802d652930fee6782",
"score": "0.58987755",
"text": "def normal_params\n reject{|param, val| param_definitions[param][:internal] }\n end",
"title": ""
},
{
"docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa",
"score": "0.5897456",
"text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end",
"title": ""
},
{
"docid": "238705c4afebc0ee201cc51adddec10a",
"score": "0.58970183",
"text": "def special_device_list_params\n params.require(:special_device_list).permit(:name)\n end",
"title": ""
},
{
"docid": "d493d59391b220488fdc1f30bd1be261",
"score": "0.58942604",
"text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "47402261c7f4d9e3a0541b7a2d238274",
"score": "0.0",
"text": "def adventure_params\n raw = params.require(:adventure).permit(:name, :setting, :owner_id)\n raw[:owner] = User.find(raw[:owner_id]) unless raw[:owner_id].blank?\n raw\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": ""
}
] |
3cd0b65c86b08a84942e75bd2954821d
|
Pass examination if _expected_ is _actual_ based on object identity. (by equal?)
|
[
{
"docid": "50a8f17890a566c2955abbf03ff761dd",
"score": "0.7417961",
"text": "def assert_same(expected, actual, message = nil)\n assertion_frame(expected.equal?(actual), message) do\n sprintf(\n \"Expected %s (0x%x) to be the same as %s (0x%x)\",\n expected.inspect, expected.object_id,\n actual.inspect, actual.object_id\n )\n end\n end",
"title": ""
}
] |
[
{
"docid": "1a192c5a4478f849f88832c933c5f2a1",
"score": "0.77768534",
"text": "def eq(expected); end",
"title": ""
},
{
"docid": "bacb5a1114b33d820dd6eab0521a19c4",
"score": "0.7748693",
"text": "def strict_match\n @expected == @actual\n end",
"title": ""
},
{
"docid": "fc009218ca0f247c13dc9d365a8e0d4a",
"score": "0.76657367",
"text": "def equal(expected); end",
"title": ""
},
{
"docid": "4dd9111ee6393382da8dec67726fadad",
"score": "0.7592485",
"text": "def eql(expected); end",
"title": ""
},
{
"docid": "eb3c5237b37d616e6c02e6838d254f23",
"score": "0.7543483",
"text": "def be_identical_to(obj)\n IdentityFailure.to_matcher(obj)\n end",
"title": ""
},
{
"docid": "f509845bbf0bc5213db0918bffcfe8e5",
"score": "0.75101805",
"text": "def is_identical_to(obj)\n IdentityFailure.to_matcher(obj)\n end",
"title": ""
},
{
"docid": "310aaf569457b2e0f990d3be3b607c87",
"score": "0.7215096",
"text": "def assert_same exp, act, msg = nil\n msg = message(msg) {\n data = [mu_pp(act), act.object_id, mu_pp(exp), exp.object_id]\n \"Expected %s (oid=%d) to be the same as %s (oid=%d)\" % data\n }\n assert exp.equal?(act), msg\n end",
"title": ""
},
{
"docid": "310aaf569457b2e0f990d3be3b607c87",
"score": "0.7215096",
"text": "def assert_same exp, act, msg = nil\n msg = message(msg) {\n data = [mu_pp(act), act.object_id, mu_pp(exp), exp.object_id]\n \"Expected %s (oid=%d) to be the same as %s (oid=%d)\" % data\n }\n assert exp.equal?(act), msg\n end",
"title": ""
},
{
"docid": "310aaf569457b2e0f990d3be3b607c87",
"score": "0.7215096",
"text": "def assert_same exp, act, msg = nil\n msg = message(msg) {\n data = [mu_pp(act), act.object_id, mu_pp(exp), exp.object_id]\n \"Expected %s (oid=%d) to be the same as %s (oid=%d)\" % data\n }\n assert exp.equal?(act), msg\n end",
"title": ""
},
{
"docid": "7f13e6017afb67650e5e0ee5477c548f",
"score": "0.71794796",
"text": "def to_be_the_same_as(object)\n failure_message = \"Expected #{@color.p(@target.inspect, :red)} (#{@color.p(@target.inspect.object_id, :red)}) \" \\\n \"to be the same as #{@color.p(object, :green)} (#{@color.p(object.object_id, :green)}).\"\n\n assert(@target.equal?(object), failure_message)\n end",
"title": ""
},
{
"docid": "ac5e81747e502da7a294f71aa7ac5b9e",
"score": "0.7177468",
"text": "def equal(obj)\n IdentityAssay.assertor(obj)\n end",
"title": ""
},
{
"docid": "a1511e31f18531acfa4925e575b99c71",
"score": "0.7060137",
"text": "def ==(other)\n super &&\n @actual_value == other.actual_value &&\n @expected_value == other.expected_value &&\n @in_sync == other.in_sync &&\n @name == other.name\n end",
"title": ""
},
{
"docid": "c1b9c72a1fb5fc86f2eb5d2528929cdb",
"score": "0.7053067",
"text": "def assert_equal(actual, expected)\n expect(actual).to eql(expected)\n end",
"title": ""
},
{
"docid": "a5ebbc296b9fbdec2e0b909782857c0d",
"score": "0.70335364",
"text": "def same(*args)\n expected, actual, message = extract_args(args, :expected, :actual, :message)\n\n unless expected.equal?(actual) then\n if message then\n failure \"Expected %s to be the same (equal?) as %p but was %p\", message, expected, actual\n else\n failure \"Expected %p but got %p\", expected, actual\n end\n end\n true\n\n rescue ::BareTest::Assertion::Failure, *::BareTest::Assertion::PassthroughExceptions\n ::Kernel.raise\n rescue Exception => e\n failure \"Could not compare %p with %p due to %s\", expected, actual, e\n end",
"title": ""
},
{
"docid": "f6c654620b822a071dfcbbce11ad570e",
"score": "0.69988555",
"text": "def matches? actual\n @actual = actual\n\n true\n end",
"title": ""
},
{
"docid": "64f4baec5f62d167133d5d304193a76d",
"score": "0.69365704",
"text": "def to_not_be_the_same_as(object)\n failure_message = \"Expected #{@color.p(@target.inspect, :red)} (#{@color.p(@target.inspect.object_id, :red)}) \" \\\n \"to not be the same as #{@color.p(object, :green)} (#{@color.p(object.object_id, :green)}).\"\n\n assert(!@target.equal?(object), failure_message)\n end",
"title": ""
},
{
"docid": "b5dc9145f7f482d48cea5b3103da92df",
"score": "0.6887234",
"text": "def test_every_object_has_different_id\n obj = Object.new\n another_obj = Object.new\n assert_equal true, obj.object_id != another_obj.object_id\n end",
"title": ""
},
{
"docid": "afed50be9588834633adf58a7eda6cc4",
"score": "0.68760556",
"text": "def assert_equals(expected, actual)\n if expected != actual\n puts \"Expected: #{expected}\"\n puts \"Actual: #{actual}\"\n else\n puts true\n end\nend",
"title": ""
},
{
"docid": "271d1a1055ed84907c11593f2c2e3d0d",
"score": "0.6869167",
"text": "def assert_instance_or_value(expected, actual)\n if expected.is_a?(Class)\n assert_instance_of expected, actual\n else\n assert_equal expected, actual\n end\n end",
"title": ""
},
{
"docid": "930417f65e0eaa46aab3122ed541b10d",
"score": "0.6849821",
"text": "def eql?(obj)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "1650d237dc8850897e949c85929decd8",
"score": "0.68290627",
"text": "def assertSame expected, actual, message = nil\n __assert (expected.equal? actual), ASSERT_SAME_ERROR, message, {:expected=>expected, :actual=>actual}\n end",
"title": ""
},
{
"docid": "2355c381cb9768bb32092dc0ae832db0",
"score": "0.682187",
"text": "def my_assert_type_of expectedClass, actualInstance\r\n my_assert_not_nil actualInstance\r\n my_assert_classes_are_equal nil, nil\r\n my_assert_classes_are_equal actualInstance.class, actualInstance.class\r\n my_assert_classes_are_equal expectedClass, expectedClass\r\n my_assert_classes_are_equal expectedClass, actualInstance.class\r\n end",
"title": ""
},
{
"docid": "25414a2aa05e3210600f3ce4292a79b0",
"score": "0.68211883",
"text": "def refute_same exp, act, msg = nil\n msg = message(msg) {\n data = [mu_pp(act), act.object_id, mu_pp(exp), exp.object_id]\n \"Expected %s (oid=%d) to not be the same as %s (oid=%d)\" % data\n }\n refute exp.equal?(act), msg\n end",
"title": ""
},
{
"docid": "25414a2aa05e3210600f3ce4292a79b0",
"score": "0.68211883",
"text": "def refute_same exp, act, msg = nil\n msg = message(msg) {\n data = [mu_pp(act), act.object_id, mu_pp(exp), exp.object_id]\n \"Expected %s (oid=%d) to not be the same as %s (oid=%d)\" % data\n }\n refute exp.equal?(act), msg\n end",
"title": ""
},
{
"docid": "adb8e15d696cfcd2d65ad4ef86084f7c",
"score": "0.68178487",
"text": "def assert_equal(expected, actual)\n assert(expected == actual, \"expected #{expected}, got #{actual}\")\n end",
"title": ""
},
{
"docid": "07d5f53e44ff3579eca734db888515ac",
"score": "0.68014866",
"text": "def assert_equal(expected, actual)\n message = \"Expected #{expected.inspect}, got #{actual.inspect}\"\n assert(expected == actual, message)\n end",
"title": ""
},
{
"docid": "83c74cf1b2f4905f2d9f4738dab0ade6",
"score": "0.6799096",
"text": "def assert_equal(value, other)\n flunk(\"#{value.inspect} != #{other.inspect}\") unless value == other\n success\n end",
"title": ""
},
{
"docid": "83c74cf1b2f4905f2d9f4738dab0ade6",
"score": "0.6799096",
"text": "def assert_equal(value, other)\n flunk(\"#{value.inspect} != #{other.inspect}\") unless value == other\n success\n end",
"title": ""
},
{
"docid": "74d2ae23a3ea78325ae8411421e68eff",
"score": "0.6789488",
"text": "def == obj\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "74d2ae23a3ea78325ae8411421e68eff",
"score": "0.6789488",
"text": "def == obj\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "306ba21a07d3891221d6db43bd9d8482",
"score": "0.6780071",
"text": "def test_refute_same_triggered\n util_assert_triggered 'Expected 1 (oid=N) to not be the same as 1 (oid=N).' do\n @tc.refute_same 1, 1\n end\n end",
"title": ""
},
{
"docid": "70efecebab22c6351f094549935656d6",
"score": "0.67668617",
"text": "def == object\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "6f36cd57ebaba70c5729672e1a41c196",
"score": "0.6763706",
"text": "def eq(obj)\n EqualAssay.assertor(obj)\n end",
"title": ""
},
{
"docid": "35ec94a20a16e29c4824bcf5fa7f6ebc",
"score": "0.6758319",
"text": "def must_be_identical_to(exp)\n IdentityFailure.assert(self, exp, :message=>msg, :backtrace=>caller)\n end",
"title": ""
},
{
"docid": "4805712103db754adcd279cc3d12184b",
"score": "0.6748489",
"text": "def remainder_ok?\n expected.delete(:data)\n actual.delete(:data)\n expected == actual\n end",
"title": ""
},
{
"docid": "52ce82d192bb683953264d7282287dac",
"score": "0.6745319",
"text": "def assert_equal\n Maze.check.true(@equal, \"The compared fields do not match:\\n #{result.reasons.join('\\n')}\")\n end",
"title": ""
},
{
"docid": "a2f9510de0bee72f3030b4e9bf97a65b",
"score": "0.6738658",
"text": "def assert_equal(expected, actual)\n assert(expected == actual, \"expected `#{expected}`, got `#{actual}`\")\n end",
"title": ""
},
{
"docid": "a5d133bf538dee535c4193e382a1e5ea",
"score": "0.6738062",
"text": "def assert_objs_equal(expect, got, *msg)\n assert_equal(fixture_label(expect), fixture_label(got), *msg)\n end",
"title": ""
},
{
"docid": "bbc34921299a7086dfe532196cf9e6b5",
"score": "0.6735582",
"text": "def ==(other)\n if @negate\n ::EqualAssay.refute!(@target, other, :backtrace=>caller)\n else\n ::EqualAssay.assert!(@target, other, :backtrace=>caller)\n end\n end",
"title": ""
},
{
"docid": "e56b70f476b6dc01a3596002c33ec3d4",
"score": "0.6731774",
"text": "def equal?(other)\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "8c1c2f325b963091c0468c669b28c3d5",
"score": "0.6730806",
"text": "def refute_equal(expected, actual, message = nil)\n refutation_frame(expected == actual, message) do\n \"Expected #{actual.inspect} to not be equal to #{expected.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "977987b01e25907c9ca56cad924aa24f",
"score": "0.6718658",
"text": "def refute_same(expected, actual, message = nil)\n refutation_frame(expected.equal?(actual), message) do\n \"Expected #{expected.inspect} to not be the same as #{actual.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "71d5b4eb995ba0bdd419e96007f6abe2",
"score": "0.6709092",
"text": "def refute_same_items(expected, actual)\n refute same_items(expected, actual),\n \"Expected #{ expected.inspect } and #{ actual.inspect } would not have the same items\"\n end",
"title": ""
},
{
"docid": "b56957f7cbec81ae52c09e8cd9cbc1ec",
"score": "0.6704234",
"text": "def test(expected,actual)\n if expected == actual\n puts 'yay'\n else\n puts 'nay'\n end\n end",
"title": ""
},
{
"docid": "318014a040582d48d414ec1613a5cab3",
"score": "0.670386",
"text": "def case_equal(*args)\n expected, actual, message = extract_args(args, :expected, :actual, :message)\n\n unless expected === actual then\n failure_with_optional_message \\\n \"Expected %s to be case equal (===) to %p but was %p\",\n \"Expected %p but got %p\",\n message, expected, actual\n end\n true\n\n rescue ::BareTest::Assertion::Failure, *::BareTest::Assertion::PassthroughExceptions\n ::Kernel.raise\n rescue Exception => e\n failure \"Could not compare %p with %p due to %s\", expected, actual, e\n end",
"title": ""
},
{
"docid": "0e151abc67b53faeb1aba564db0051d3",
"score": "0.67008436",
"text": "def equal! actual, expected, message = nil\n @assertion_performed = true\n if actual != expected\n actual_string = \"#{actual}#{actual.nil? ? \" (nil) \" : \" \" }\".strip\n message = \"actual:\\n#{actual_string}\\n\\ndid not equal\\n\\nexpected:\\n#{expected}\\n#{message}\"\n raise message\n end\n nil\n end",
"title": ""
},
{
"docid": "1aced998c398da45439affa0f1e0ab1c",
"score": "0.66874725",
"text": "def expected_for_diff\n if respond_to_failed\n matchers.an_object_having_attributes(\n @expected.select { |k, v| !@actual.respond_to?(k) }\n )\n else\n matchers.an_object_having_attributes(@expected)\n end\n end",
"title": ""
},
{
"docid": "7d377a0c2c9ffd1e08e50b08c453c677",
"score": "0.6664715",
"text": "def mirrors?(other)\n @subject == other\n end",
"title": ""
},
{
"docid": "a150ef648970313658305f55eca87d1c",
"score": "0.66489655",
"text": "def assert_equal(expected, actual, message = nil)\n assertion_frame(expected == actual, message) do\n \"Expected #{expected.inspect}, not #{actual.inspect}\"\n end\n end",
"title": ""
},
{
"docid": "ed17b06b3f7a911afc65a30f00f8c4ed",
"score": "0.6644942",
"text": "def ==(other)\n other.is_a?(self.class) &&\n other.attribute == attribute &&\n other.validation == validation &&\n other.expected == expected &&\n other.actual == actual\n end",
"title": ""
},
{
"docid": "4f42788ac4876299fa885e89f29d13bf",
"score": "0.6628211",
"text": "def dom_equal(expected)\n assert_dom_not_equal expected, @object\n end",
"title": ""
},
{
"docid": "5efd1c82377272010eec88a7695cd9eb",
"score": "0.66268724",
"text": "def ==(o) abstract end",
"title": ""
},
{
"docid": "5efd1c82377272010eec88a7695cd9eb",
"score": "0.66268724",
"text": "def ==(o) abstract end",
"title": ""
},
{
"docid": "09bbf0f25991a694fae5d6df8ccefaa7",
"score": "0.6619735",
"text": "def test_a_better_way_of_asserting_equality\n # changed expected vlue = __, to, expected_value = 2\n expected_value = 2\n actual_value = 1 + 1\n\n assert_equal expected_value, actual_value\n end",
"title": ""
},
{
"docid": "b37bb12a5e69e30e8deaba738a16d93a",
"score": "0.6619249",
"text": "def test_eq\n @@log.debug \"test_eq starts\" if @@log.debug?\n assert_respond_to(@abs, :==, \"test_eq_respond\")\n assert_equal(@abs == @jas, false)\n @@log.debug \"test_eq ends\" if @@log.debug?\n end",
"title": ""
},
{
"docid": "fcb007b76d07e577afcc1c12d6999496",
"score": "0.66001076",
"text": "def ==(other)\n return self.class == other.class && @identity == other.identity\n end",
"title": ""
},
{
"docid": "47c654deced6e5fde7d5a80d41216125",
"score": "0.6600051",
"text": "def assert( given, expected)\n given == expected\nend",
"title": ""
},
{
"docid": "14c2fb2dc52d0507eaa58cd87735f796",
"score": "0.6594887",
"text": "def is_identical(exp)\n IdentityFailure.assert(self, exp, :message=>msg, :backtrace=>caller)\n end",
"title": ""
},
{
"docid": "ed450be338ed4445c80517f760dadd69",
"score": "0.6593075",
"text": "def call(actual)\n raise \"Expected #{@expected}, got #{actual}\" unless actual == @expected\n end",
"title": ""
},
{
"docid": "42dd84b37d5fb713db692a00adc496de",
"score": "0.6590163",
"text": "def test_assert_equality\n # changed expected_value = __ , to, expected_value = 2\n expected_value = 2\n actual_value = 1 + 1\n assert expected_value == actual_value\n end",
"title": ""
},
{
"docid": "902ee18c80f7ff5b5eb88210e12fc5f6",
"score": "0.6585424",
"text": "def assert(expected, actual, msg = \"\")\n if expected.eql? actual\n puts \"victory\"\n else\n puts \"failure\"\n end\n end",
"title": ""
},
{
"docid": "da3e46c4f7779c2805a11ac25b3d7e74",
"score": "0.6575428",
"text": "def refute_equal_interfaces(object_a, object_b)\n refute InterfaceComparator.same?(object_a, object_b),\n \"Interfaces are of these two object are the same\"\n end",
"title": ""
},
{
"docid": "dbaee179415909ac817315028dde4fab",
"score": "0.65748155",
"text": "def assertEqual expected, actual, message = nil\n __assert (expected == actual), ASSERT_EQUAL_ERROR, message, {:expected=>expected, :actual=>actual}\n end",
"title": ""
},
{
"docid": "389ba4249c22ed6d4980c517b81a3eea",
"score": "0.6570451",
"text": "def wont_be_identical_to(exp)\n IdentityFailure.refute(self, exp, :message=>msg, :backtrace=>caller)\n end",
"title": ""
},
{
"docid": "ce9876525fdec75a14f28be2fe907cc4",
"score": "0.65679264",
"text": "def dom_equal(expected)\n assert_dom_equal expected, @object\n end",
"title": ""
},
{
"docid": "2372dbc9770d6e64353222842add115c",
"score": "0.65678066",
"text": "def == other\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "2372dbc9770d6e64353222842add115c",
"score": "0.65678066",
"text": "def == other\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "2372dbc9770d6e64353222842add115c",
"score": "0.65678066",
"text": "def == other\n #This is a stub, used for indexing\n end",
"title": ""
},
{
"docid": "76b30e47c984046e320f3974ddfad90e",
"score": "0.6562781",
"text": "def match expected, actual\n match_type? expected\n end",
"title": ""
},
{
"docid": "54444543502b8b01f74233d3384a3982",
"score": "0.6551636",
"text": "def assert_equal mode, actual, expected, message\n message ||=\n case mode\n when :assert\n String.new.tap { |str|\n str << \"Equality test failed\\n\".yellow.bold\n str << \" Was: #{actual.inspect}\\n\".red.bold\n str << \" Exp: #{expected.inspect}\".green.bold\n if String === actual and String === expected \\\n and expected.length > 40 and actual.length > 40\n diff = Differ.diff_by_char(actual.inspect, expected.inspect)\n str << NL << \" Dif: #{diff}\"\n end\n }\n when :negate\n if expected.inspect.length < 10\n \"Inequality test failed: object should not equal #{expected.inspect}.red.bold\"\n else\n \"Inequality test failed: the two objects were equal.\\n\" <<\n \" Value: #{expected.inspect.red.bold}\"\n end\n end\n\n passed = lambda { @stats[:pass] += 1 }\n #failed = lambda { @stats[:fail] += 1; _debug nil, message }\n failed = lambda { @stats[:fail] += 1; report_failure nil, message }\n\n result = (expected == actual)\n\n case mode\n when :sample then return result\n when :assert then result ? passed.call : failed.call\n when :negate then result ? failed.call : passed.call\n end\n\n result\n end",
"title": ""
},
{
"docid": "4c07aa8196ae3b645733e4c1d8fdd5f0",
"score": "0.654316",
"text": "def assert(actual, expected)\n raise \"expected #{expected}, got #{actual}\" unless actual == expected\nend",
"title": ""
},
{
"docid": "3983bcc2b00a2ed1147d917c5d7eac78",
"score": "0.652535",
"text": "def assert_equal(expected, actual)\n unless expected == actual\n puts \"Assertion failed!\"\n puts \"Expected: #{expected.inspect}\"\n puts \"Actual: #{actual.inspect}\"\n end\nend",
"title": ""
},
{
"docid": "3983bcc2b00a2ed1147d917c5d7eac78",
"score": "0.652535",
"text": "def assert_equal(expected, actual)\n unless expected == actual\n puts \"Assertion failed!\"\n puts \"Expected: #{expected.inspect}\"\n puts \"Actual: #{actual.inspect}\"\n end\nend",
"title": ""
},
{
"docid": "3983bcc2b00a2ed1147d917c5d7eac78",
"score": "0.652535",
"text": "def assert_equal(expected, actual)\n unless expected == actual\n puts \"Assertion failed!\"\n puts \"Expected: #{expected.inspect}\"\n puts \"Actual: #{actual.inspect}\"\n end\nend",
"title": ""
},
{
"docid": "3983bcc2b00a2ed1147d917c5d7eac78",
"score": "0.652535",
"text": "def assert_equal(expected, actual)\n unless expected == actual\n puts \"Assertion failed!\"\n puts \"Expected: #{expected.inspect}\"\n puts \"Actual: #{actual.inspect}\"\n end\nend",
"title": ""
},
{
"docid": "3983bcc2b00a2ed1147d917c5d7eac78",
"score": "0.652535",
"text": "def assert_equal(expected, actual)\n unless expected == actual\n puts \"Assertion failed!\"\n puts \"Expected: #{expected.inspect}\"\n puts \"Actual: #{actual.inspect}\"\n end\nend",
"title": ""
},
{
"docid": "3983bcc2b00a2ed1147d917c5d7eac78",
"score": "0.652535",
"text": "def assert_equal(expected, actual)\n unless expected == actual\n puts \"Assertion failed!\"\n puts \"Expected: #{expected.inspect}\"\n puts \"Actual: #{actual.inspect}\"\n end\nend",
"title": ""
},
{
"docid": "3983bcc2b00a2ed1147d917c5d7eac78",
"score": "0.652535",
"text": "def assert_equal(expected, actual)\n unless expected == actual\n puts \"Assertion failed!\"\n puts \"Expected: #{expected.inspect}\"\n puts \"Actual: #{actual.inspect}\"\n end\nend",
"title": ""
},
{
"docid": "bf32bb15f3d0dda9c6e4512651f0af99",
"score": "0.65158606",
"text": "def same?(other)\n self.inspect == other.inspect\n end",
"title": ""
},
{
"docid": "c9f28ee35eaf35e1d32d005f20b3d642",
"score": "0.65099776",
"text": "def ==(other); equals(other); end",
"title": ""
},
{
"docid": "21e638b6595bd65306f09c385578f245",
"score": "0.6507535",
"text": "def assert_equal(actual, expected)\r\n if actual != expected\r\n raise \"Assert equal failed\"\r\n end\r\nend",
"title": ""
},
{
"docid": "6ab9f46e2ac46433d40d73181fb613a1",
"score": "0.6504941",
"text": "def eql?(obj); self.eql_count += 1; super; end",
"title": ""
},
{
"docid": "ae42414ff05257db9d1689f673dfefac",
"score": "0.6500472",
"text": "def assert_same(exp, act, msg=nil)\n IdentityAssay.assert!(act, exp, :message=>msg, :backtrace=>caller)\n end",
"title": ""
},
{
"docid": "fe5834c282edb35766208c1551c498b0",
"score": "0.6496834",
"text": "def ==(other)\n return false if self.objects.to_a != other.objects.to_a\n return false if @environmental_factors != other.environmental_factors.to_a\n return false if self.clock != other.clock\n true\n end",
"title": ""
},
{
"docid": "e7d12213e8bb8400cec69fdeffd58391",
"score": "0.64951336",
"text": "def test_assert_equality\n expected_value = __\n actual_value = 1 + 1\n\n assert expected_value == actual_value\n end",
"title": ""
},
{
"docid": "ebd73ebb01255ed722ec54db1e55b50e",
"score": "0.649362",
"text": "def ==(other)\n identity == other.identity\n end",
"title": ""
},
{
"docid": "f06d7ff5785c9d874eda7bcf80b61975",
"score": "0.64874685",
"text": "def of(expected); end",
"title": ""
},
{
"docid": "9e3f22310143fc5c18909c735278a29c",
"score": "0.6486079",
"text": "def matches?(actual)\n expected_value.equal?(actual)\n end",
"title": ""
},
{
"docid": "eab89b977a7a07ed918bfc6e2c7b07c1",
"score": "0.6482484",
"text": "def assert_equal(expected, actual)\n raise \"Expected #{expected} to match #{actual}\" unless expected == actual\n puts \"ok\"\nend",
"title": ""
},
{
"docid": "908a60a4c21b72365aa539ceb5bd21a6",
"score": "0.64787424",
"text": "def assert_version_equal(expected, actual)\n assert_equal v(expected), v(actual)\n assert_equal v(expected).hash, v(actual).hash, \"since #{actual} == #{expected}, they must have the same hash\"\n end",
"title": ""
},
{
"docid": "134a843b34cb30802ccb540b90ab6253",
"score": "0.6473637",
"text": "def assert_equal(expected, actual, msg)\n if expected == actual\n true\n else\n puts(msg)\n puts \"\\n\\nEXPECTED:\\n\\n\"\n puts(expected)\n puts \"\\n\\nACTUAL:\\n\\n\"\n puts(actual)\n false\n end\nend",
"title": ""
},
{
"docid": "e2b06aa8bcd768313fe75da1375674ed",
"score": "0.6468914",
"text": "def test(expected, actual)\n if expected == actual\n puts 'yay'\n else\n puts 'nay'\n end\nend",
"title": ""
},
{
"docid": "ff209bcc2244fb7a3fdbf8b63b885a71",
"score": "0.64470035",
"text": "def assert_not_same(expected, actual, message=\"\")\n msg = message(msg) { build_message(message, <<EOT, expected, expected.__id__, actual, actual.__id__) }\n<?>\nwith id <?> expected to not be equal\\\\? to\n<?>\nwith id <?>.\nEOT\n assert(!actual.equal?(expected), msg)\n end",
"title": ""
},
{
"docid": "ff209bcc2244fb7a3fdbf8b63b885a71",
"score": "0.64470035",
"text": "def assert_not_same(expected, actual, message=\"\")\n msg = message(msg) { build_message(message, <<EOT, expected, expected.__id__, actual, actual.__id__) }\n<?>\nwith id <?> expected to not be equal\\\\? to\n<?>\nwith id <?>.\nEOT\n assert(!actual.equal?(expected), msg)\n end",
"title": ""
},
{
"docid": "33550397482c3e54e3070bab54e17963",
"score": "0.64457005",
"text": "def ==(_other); end",
"title": ""
},
{
"docid": "e35dd107a30e4bba113eb154779f4057",
"score": "0.64398617",
"text": "def ==(other); eql?(other); end",
"title": ""
},
{
"docid": "015c95a0677d8adc9143664114e77c1a",
"score": "0.6438027",
"text": "def refute_version_equal(unexpected, actual)\n refute_equal v(unexpected), v(actual)\n end",
"title": ""
},
{
"docid": "f481db1fc0c48636f25e9d3787aa5d61",
"score": "0.64356005",
"text": "def eq(other); end",
"title": ""
},
{
"docid": "bf0cac5e1acbf4e70b3fd2094b4b685c",
"score": "0.64230776",
"text": "def test_equals_review\n assert(@@review.equals_review(create_ruby_object()),\n\t \"Review comparison method isn't working\")\n end",
"title": ""
},
{
"docid": "bdf73506a20b2b502a82048c50b4a116",
"score": "0.6421575",
"text": "def test_a_better_way_of_asserting_equality\n expected_value = 2\n actual_value = 1 + 1\n\n assert_equal expected_value, actual_value\n end",
"title": ""
}
] |
24ad528b2687023f8943ba103c59b95b
|
New group user object attributes: attributes for object
|
[
{
"docid": "4f6cc96937fb8afe5121c202708395dc",
"score": "0.0",
"text": "def initialize(attributes = {})\n attr_with_defaults = {\n daily_reminder: true,\n weekly_reminder: true,\n mine_only: false\n }.merge(attributes)\n super(attr_with_defaults)\n end",
"title": ""
}
] |
[
{
"docid": "5b07599791586ef98095a1f56c313132",
"score": "0.70010525",
"text": "def addMembers (group_id, user_id)\n \tm = GroupUser.new(:group_id => group_id, :user_id => user_id)\n \tm.save\n end",
"title": ""
},
{
"docid": "6dd481133c870efbf8fb8bf246d23245",
"score": "0.6938688",
"text": "def addMembers (group_id, user_id)\n \tm = GroupUser.new(:group_id => @group_id, :user_id => @user_id)\n \tm.save\n end",
"title": ""
},
{
"docid": "c4e7000d968b6b489367c408e3ecc2aa",
"score": "0.67572",
"text": "def new\n @user_group = UserGroup.new\n @permissions = {}\n @group_permissions = Permission.get_group_permissions\n @group_permissions.each do |g|\n @permissions[g.group_permission_name] = Permission.get_permission_in_group_permission(g.group_permission_name)\n end\n end",
"title": ""
},
{
"docid": "7c29e313e07935e3a6d1c939a5facc68",
"score": "0.6739499",
"text": "def create\n @user = User.new(params[:user])\n @user.group = Group.new\n @user.group.name = \"Scriptwords\"\n @user.bright_text_application_id = BrightTextApplication.where(:name=>\"ScriptureWords\").first.id\n @user.user_type = 0\n\n respond_to do |format|\n if @user.save\n GroupMember.where(:email => @user.email).update_all(:user_id=>@user.id)\n log_in! @user\n format.html { redirect_to(scriptwords_root_url, :notice => 'User was successfully created.') }\n format.xml { render :xml => @user, :status => :created, :location => @user }\n else\n format.html { render :action => \"new\" , :layout => \"scriptwords\" }\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "92865b2deba4da39174f2b9da74f1905",
"score": "0.6702607",
"text": "def add_user_to_group(user, group)\n\t\t\tend",
"title": ""
},
{
"docid": "6eed2b945d2fb94222ad0c68c64cfbc4",
"score": "0.66533417",
"text": "def create\n @user.create_group!(new_group_params[:group_user_ids], {name: new_group_params[:name]})\n end",
"title": ""
},
{
"docid": "4c41e34d9651cb7f3327998389cbee3b",
"score": "0.66502",
"text": "def set_user_group(opts={})\n {\n :type => opts[:type] || 'user-group',\n :id => opts[:id] || @actor[:username],\n :icon => opts[:icon] || @actor[:avatar],\n :title => opts[:title] || gh_link(@actor[:username]),\n :name => opts[:name] || @actor[:username],\n :data => opts[:data] || nil\n }\n end",
"title": ""
},
{
"docid": "91b6bfc0d7406cc4c760bd06038e860f",
"score": "0.6594836",
"text": "def create_user(**data)\n create_object(type: 'User', data: { enabled: true }.merge(data))\n end",
"title": ""
},
{
"docid": "1689672d63e3b2522ad490c221d3c511",
"score": "0.65512663",
"text": "def set_create_user_fields\n user_id = AuditModule.get_current_user.uid\n self.created_by = user_id\n self.updated_by = user_id\n end",
"title": ""
},
{
"docid": "b97ea765209c8d057853cff6e8913c54",
"score": "0.6531541",
"text": "def create\n @groups_user = GroupsUser.find(params[:id])\n @groups_user = GroupsUser.new(groups_user_params)\n # @groups_user.user_id=1\n # @groups_user.group_id=3\n # respond_to do |format|\n if @groups_user.save\n redirect_to groups_url\n # format.html { redirect_to groups_url, notice: 'Groups user was successfully created.' }\n # format.json { render :show, status: :created, location: @groups_user }\n else\n format.html { render :new }\n format.json { render json: @groups_user.errors, status: :unprocessable_entity }\n end\n # end\n end",
"title": ""
},
{
"docid": "c45718ece36f6ee44f94a14b71cc88df",
"score": "0.650188",
"text": "def new\n @roles = current_user.pass_on_roles.to_a || [] # logged-in user can give his own roles to new user\n @user = User.new\n \n params[:id] = current_user.center if params[:id] == \"0\"\n \n if !params[:id].nil? # create new user for specific center/team\n @groups = Group.this_or_parent(params[:id])\n @group = Group.find(params[:id])\n @user.groups += @groups\n else\n @groups = if current_user.has_role?(:centeradmin)\n \tGroup.where(:center_id => current_user.center_id)\n \telse\t\n \t current_user.center_and_teams\n\t end\n end\n\n if current_user.has_role?(:superadmin) # superadmin can create users in all groups\n @groups = (Center.all + current_user.center.teams).sort_by { |c| c.title }\n end\n\n end",
"title": ""
},
{
"docid": "42539d0ab5f2974facb6920ab468bf7e",
"score": "0.64589405",
"text": "def create\n #logger.info \"Post parameters: #{params}\"\n @group = Group.new(name: params[:group][:name], expiration: params[:group][:expiration])\n if @group.save\n params[:group][:users].each do |u|\n Membership.create(group: @group, user: User.where(\"id = ? OR email = ?\", u[:id], u[:email]).first, admin:u[:admin])\n end\n render json: @group, status: :created, location: @group\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "5987c8ab23cc3dcd5fc6c269de8b1caf",
"score": "0.64579177",
"text": "def objbuilder(user, type=\"\", group=\"\", password=\"\")\n # user becomes group when adding / deleting groups\n # objbuilder(\"#{@thmgroupname}\", \"addgroup\") \n designobj = Class.new do\n attr_reader :type, :group, :password\n define_method :initialize do\n instance_variable_set(\"@type\", \"#{type}\")\n instance_variable_set(\"@group\", \"#{group}\")\n instance_variable_set(\"@password\", \"#{password}\")\n end\n end\n setup_privileges(\"#{user}\", designobj)\n end",
"title": ""
},
{
"docid": "bf0b4649cd51a411f9fabe087e7d7f2a",
"score": "0.64532757",
"text": "def add_user(user)\n UserGroup.create(user_id: user.id, group_id: id)\n end",
"title": ""
},
{
"docid": "b7689524497aedbd88204f814a0259fb",
"score": "0.6440754",
"text": "def create\n @group = Group.new(params[:group])\n @group.users << current_user\n \n respond_to do |format|\n if @group.save\n @group.groups_users.first.update_attribute :level, 2\n flash[:notice] = 'Group was successfully created.'\n format.html { redirect_to(@group) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "04c538010afd620825066099531f93dd",
"score": "0.6430988",
"text": "def new\n\t\t#\tget business rules for each account type\n\t #if this new user is assigned to an existing group it should be in the params.\n\t\t@group = params[:group].blank? ? Group.new() : Group.find_by_id(params[:group][:id])\n @group.name ||= \"MyGroup\"\n\t\t@user = User.new()\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "7caa3835dfac6c8bfb4bc8ebca9e8019",
"score": "0.64176416",
"text": "def create\n group_ids = params[\"group_id\"]\n org_id = params[:organization_id]\n @user = User.new(full_name: params[:full_name], password: params[:password], password_confirmation: params[:password], email: params[:email], status: params[:status], staff_number: params[:employee_id], career_path: params[:career_path], team_leader_id: nil)\n @user.user_group_ids = group_ids\n @user.organization_id = org_id\n\n respond_to do |format|\n if @user.save\n format.json { render json: @user }\n else\n format.json { render json: @user.errors.messages, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "159a03a709d5d97cc337815153270463",
"score": "0.64051217",
"text": "def new\n #unless current_user.try(:has_role?, 'Librarian')\n # access_denied; return\n #end\n @user = User.new\n authorize @user\n prepare_options\n @user_groups = UserGroup.all\n @user.user_group = current_user.user_group\n @user.library = current_user.library\n @user.locale = current_user.locale\n end",
"title": ""
},
{
"docid": "426826d527b7826dec06f7f54dbbab01",
"score": "0.63896114",
"text": "def create\n #logger.info \"Post parameters: #{params}\"\n @group = Group.new(name: params[:group][:name], expiration: params[:group][:expiration], owner: current_user)\n if @group.save\n @group.memberships.create!(user: current_user, admin: true)\n if params[:group][:users]\n params[:group][:users].each do |u|\n @group.memberships.create!(user: User.where(\"id = ? OR email = ?\", u[:id], u[:email]).first, admin:u[:admin])\n end\n end\n render json: @group, status: :created, location: @group\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "b2ab95c0bd48030a1a80a2b5354214d4",
"score": "0.63766336",
"text": "def create\n #TODO validate that the params[:id] is a legal value for user\n @group = Group.find(params[:group_id])\n authorize! :edit, @group\n Hydra::LDAP.add_users_to_group(@group.code, [params[:id]])\n redirect_to edit_group_path(@group), :notice=>\"Added member #{params[:id]}\"\n end",
"title": ""
},
{
"docid": "c35ba4f6c40976294ce1fa858f75973d",
"score": "0.63646394",
"text": "def create_user(obj, type)\n @logger.info(\"Creating user for #{type} #{obj.name}\")\n user = SugarCRM::User.new\n user.user_name = (type == 'agent') ? obj.emerchantpay_agent_id : obj.emerchantpay_iso_id\n user.user_name ||= \"EMP\"\n user.last_name = obj.name\n user.type_c = type\n #user.email1 = obj.email_address || \"mail@example.com\"\n user.email1 = 'stefan@emerchantpay.com'\n user.status = 'Inactive'\n user.system_generated_password = false\n user.save!\n obj.assigned_user_id = user.id\n obj.save!\n \n populate_user_pool(user, type)\n end",
"title": ""
},
{
"docid": "c6d0b2d9a77d19b262e91b74f2b8c1e2",
"score": "0.63446647",
"text": "def create\n @user = User.new(params[:user])\n @user.company_id = current_user.company_id\n\n password = @user.password.nil? ? @user.generate_password : false\n \n if @user.save && params.has_key?(:multiselect_user_grouping_ids)\n @user.update_groupings(params[:user][:grouping_ids])\n @user.notify_account(password) if password\n params.has_key?(:multiselect_user_role_ids) ? @user.update_roles(params[:user][:role_ids]) : @user.add_employee_role\n gflash :success => \"User created.\"\n else\n @user.errors[:base] << \"You must assign the user to one or more groups.\" unless params.has_key?(:user_groupings)\n @assigned_groups = current_user.root_grouping.id\n end\n \n respond_with(@user)\n end",
"title": ""
},
{
"docid": "ab0a517c9cf80185ab61ec861f18f0eb",
"score": "0.63275033",
"text": "def add_user(newuser)\n @group_users.push(newuser)\n end",
"title": ""
},
{
"docid": "1cc8e1b6b531a9990351c3a2ea45b8b0",
"score": "0.6314451",
"text": "def create\n @user = Company.find(params[:company_id]).groups.find(params[:group_id]).users.new(user_params)\n\n if @user.save\n redirect_to company_group_user_path(@user.group.company_id, @user.group_id, @user), notice: '正常に作成しました'\n render :show, status: :created, location: @user\n else\n render :new\n render json: @user.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "691c6ce1c1cd1729cac4ace85bc6d6b1",
"score": "0.63076234",
"text": "def new_group(group_data)\n [:id, :name].each { |attr| raise(ArgumentError, \"Missing or Invalid Parameter(s)\") unless group_data.key?(attr) }\n set_values group_data\n end",
"title": ""
},
{
"docid": "21fd8737bffe29940c47ac50b6ccc2a0",
"score": "0.63074845",
"text": "def createNewUser(userName, initialGroup, userEmail, fname, lname, password)\n\n password = password.encrypt\n user = {\"login\" => userName,\n \"group0\" => initialGroup,\n \"email\" => userEmail,\n \"fname\" => fname,\n \"lname\" => lname,\n \"password\" => password,\n \"orga\" => \"0\"}\n saveUser(userName, user)\n end",
"title": ""
},
{
"docid": "66cf606940a12ad2cf4f3d76056f9bfb",
"score": "0.62960166",
"text": "def new_user\n account_make = self\n # assign storing of information to a variable\n account_store = YAML::Store.new 'users.store'\n # store the object into a file\n account_store.transaction do\n account_store[username.to_s] = account_make\n end\n end",
"title": ""
},
{
"docid": "caf601cfd4aaf5315f95886c9ebf4035",
"score": "0.629362",
"text": "def add_user(user)\n group_members.create(group: self, user: user, accepted: DateTime.now)\n end",
"title": ""
},
{
"docid": "56ffe3031cbd54698d89dd63472d6563",
"score": "0.6285435",
"text": "def create\n \n @group = Group.new(group_params)\n @group.owner_id = current_user.id\n @group.users << current_user\n\n respond_to do |format|\n if @group.save\n format.html { redirect_to @group, notice: 'Group was successfully created.' }\n format.json { render :show, status: :created, location: @group }\n else\n format.html { render :new }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e3297cbffd2dfeba4c88da39312ce8db",
"score": "0.62833256",
"text": "def create\n @group = Group.new(params[:group])\n @u = User.create(:login=>@group.name, :password=>@group.psd, :password_confirmation=>@group.psd, :email =>@group.name+'@mail.msiu.ru')\n @u.role=0\n @u.save\n respond_to do |format|\n if @group.save\n format.html { redirect_to @group, :notice => 'Группа была создана.' }\n format.json { render :json => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "434aa8d4e47cfc754064e0f6ebb86908",
"score": "0.6281054",
"text": "def save_group(user)\n ActiveRecord::Base.transaction do\n save\n @user_group = UserGroup.new\n @user_group.user_id = user.id\n @user_group.group_id = id\n @user_group.save\n @member = GroupMember.new\n @member.e_mail = user.email\n @member.group_id = id\n @member.save\n end\n end",
"title": ""
},
{
"docid": "cb5bc88ac5ba9524ef070aaf24f30017",
"score": "0.6265772",
"text": "def create(id, user_id, name)\n user = get_user(user_id)\n group = Group.new(id, user.id, name)\n @@group[id] = group\n group.add(user.id)\n return \"Group Created\"\n end",
"title": ""
},
{
"docid": "72d1f98dfafa353fd5f784d3629d7698",
"score": "0.62464297",
"text": "def create_group(attributes)\n BrickFTP::API::Group.create(attributes)\n end",
"title": ""
},
{
"docid": "72d1f98dfafa353fd5f784d3629d7698",
"score": "0.62455577",
"text": "def create_group(attributes)\n BrickFTP::API::Group.create(attributes)\n end",
"title": ""
},
{
"docid": "34fb7a4786c5afb43935b441eb103ad3",
"score": "0.6242048",
"text": "def after_create entity_group\n ueg=entity_group.user_entity_groups.build\n ueg.user=entity_group.creator\n ueg.save\n end",
"title": ""
},
{
"docid": "e7705091101e046b3726c9b49c4267af",
"score": "0.62196755",
"text": "def create\n @group = Group.new(group_params)\n member = Member.create\n @group.members << member\n current_user.members << member\n\n @group.owner = member\n\n respond_to do |format|\n if @group.save\n format.html { redirect_to @group, notice: 'Group was successfully created.' }\n format.json { render action: 'show', status: :created, location: @group }\n else\n format.html { render action: 'new' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d45231ea79e718dd75dae8978a5a5320",
"score": "0.6219278",
"text": "def create\n @group = Group.new(group_params)\n @group.group_users.build user_type: 'Group Owner', user_id: @current_user.id\n @group.share_id = Array.new(8){rand(36).to_s(36)}.join\n\n\n respond_to do |format|\n if @group.save\n format.html { redirect_to @group, notice: 'Group was successfully created.' }\n format.json { render :show, status: :created, location: @group }\n else\n format.html { render :new }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "667e3d2a4fb025bdb580af640fbb7ca7",
"score": "0.6217906",
"text": "def create\n @group = Group.new(group_params)\n @group.owner = current_user\n\n if @group.save\n @group.add!(current_user)\n \n render json: @group, status: :created, location: @group\n else\n render json: @group.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "bb334e24b2934d6a988f02a64ed8cba5",
"score": "0.6198634",
"text": "def create\n # @group = Group.create(group_params)\n # @group.save\n @group = Group.new\n puts @group\n @group.name = params['name']\n puts params['user_id']\n @group.user_id = params['user_id']\n\n respond_to do |format|\n if @group.save\n # format.html { redirect_to @group, notice: 'Group was successfully created.' }\n format.json { render :show, status: :created, location: @group }\n # else\n # format.html { render :new }\n # format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "791862befe0e191bc416668923653b75",
"score": "0.61782545",
"text": "def create\n fname = \"#{self.class.name}.#{__method__}\"\n super\n user=User.find_by_email(reg_params[:email])\n pars={}\n unless user.nil?\n pars[:name]=params[:user][:name]\n pars[:role]=params[:user][:role]\n user.update(pars) \n else\n user=User.new(params[:user])\n end\n LOG.debug(fname) {\"************************ current_user=#{user.inspect}\"}\n end",
"title": ""
},
{
"docid": "c119468b4d322d1b5beea355ce417a2e",
"score": "0.6171075",
"text": "def create\n @group = Group.new(params[:group])\n @group.user = current_user\n\n respond_to do |format|\n if @group.save\n @group.add_member current_user\n flash[:notice] = '{object} was successfully {action}.'[:object_action_notice, \"Group\"[], \"created\"[]]\n format.html { redirect_to(@group) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "808135375b38d1dca67591c4e04fe4ee",
"score": "0.6170989",
"text": "def create_user(attributes)\n BrickFTP::API::User.create(attributes)\n end",
"title": ""
},
{
"docid": "808135375b38d1dca67591c4e04fe4ee",
"score": "0.61705226",
"text": "def create_user(attributes)\n BrickFTP::API::User.create(attributes)\n end",
"title": ""
},
{
"docid": "1fac213ccfb1755b86a694b8bca97173",
"score": "0.61676353",
"text": "def add_user(username, password, attributes = {})\n @users[username] = {}\n @users[username][:password] = password\n if attributes.empty?\n @users[username][:attributes] = {\n 'User-Name' => username,\n 'Filter-Id' => 60\n }\n else\n @users[username][:attributes] = attributes\n end\n end",
"title": ""
},
{
"docid": "fbe9c0742f804c87da6fd35f69f3039b",
"score": "0.616673",
"text": "def add_user(user, reason)\n compatibility_score = 0\n group_leader = User.find(self.creator)\n \n # initializing <tt>group</tt> because of something funky going on with <tt>self</tt> in this context\n group = Group.where(:creator => self.creator).first\n \n case reason\n when \"creator\"\n compatibility_score += 42\n self.initialize_group_meeting_times(user)\n self.initialize_group_schedule(user.schedule) # leader must have a schedule..\n when \"friend\"\n compatibility_score += 21\n compatibility_score += user.number_of_compatible_time_blocks_with(group_leader.schedule)\n else\n compatibility_score += user.number_of_compatible_time_blocks_with(group_leader.schedule)\n end\n \n if reason != \"creator\"\n group.update_group_meeting_times(user)\n group.update_group_schedule(user.schedule) if user.schedule != nil\n end\n \n Membership.create(:group_id => self.id, :user_id => user.id, :compatibility_score => compatibility_score)\n end",
"title": ""
},
{
"docid": "671b481ceed4fe1dbf3c90682f5c2755",
"score": "0.6159898",
"text": "def add(user)\n GroupMembers.new(:id => id).post(user)\n end",
"title": ""
},
{
"docid": "72cc3fb0427d240d865509a11f704037",
"score": "0.6155717",
"text": "def new\n UserGroup.new\n @cta = Cta.create({workflow_status: 0, pi_id: current_user.id})\n ci_relation = CtaRelation.new(name: 'ci', group_type: 2, cta_id: @cta.id)\n cci_relation = CtaRelation.new(name: 'cci', group_type: 2, cta_id: @cta.id)\n ci_relation.save\n cci_relation.save\n ci_relation.users << current_user\n ci_relation.save\n cci_relation.save\n redirect_to (@cta.add_form 'A'), action: :edit\n end",
"title": ""
},
{
"docid": "12673fb03395182abe590a2bdc04b7f7",
"score": "0.61450785",
"text": "def create\n # @group_user = GroupUser.new(params[:group_user])\n @group_user = @current_user.join_group(@group)\n respond_to do |format|\n if @group_user\n format.html { redirect_to @group, notice: 'Group user was successfully created.' }\n format.json { render json: @group_user, status: :created, location: @group_user }\n else\n format.html { render action: \"new\" }\n format.json { render json: @group_user.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b787f7b5e6103bd2fce86290d3b2ca7f",
"score": "0.6128916",
"text": "def addUserToGroup(uid, groupId)\r\n uri = sprintf(\"/api/v1/groups/%d/memberships\", groupId)\r\n\t $canvas.post(uri, {'user_id' => uid})\r\nend",
"title": ""
},
{
"docid": "b787f7b5e6103bd2fce86290d3b2ca7f",
"score": "0.6128916",
"text": "def addUserToGroup(uid, groupId)\r\n uri = sprintf(\"/api/v1/groups/%d/memberships\", groupId)\r\n\t $canvas.post(uri, {'user_id' => uid})\r\nend",
"title": ""
},
{
"docid": "4a18e9922f1bb166a0d5f97da55789ff",
"score": "0.61267",
"text": "def create\n @group_user_rel = GroupUserRel.new(params[:group_user_rel])\n\n respond_to do |format|\n if @group_user_rel.save\n format.html { redirect_to edit_user_path(@group_user_rel.user), notice: \"#{@group_user_rel.user.name} has been added to the '#{@group_user_rel.group.name}' group\" }\n format.json { render json: @group_user_rel, status: :created, location: @group_user_rel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @group_user_rel.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "951b25df51904d2cd084e29f7bd0c622",
"score": "0.61264384",
"text": "def create\n @group = Group.new(group_params)\n @group.owner = current_user\n @group.users << current_user\n\n respond_to do |format|\n if @group.save\n membership = Membership.find_by_group_id_and_user_id(@group.id, current_user)\n membership.update_attributes :acceptance_status => true\n\n format.html { redirect_to group_path(@group), alert: 'Group was successfully created.' }\n format.json { render action: 'show', status: :created, location: @group }\n else\n format.html { render action: 'new' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5c0af1e01af21f20b9f05ec95a186b6f",
"score": "0.6103825",
"text": "def create_new_user\r\n touch(\"* id:'#{add}'\")\r\n end",
"title": ""
},
{
"docid": "a3f86c7d28e6c1eb0d19c874cbbcec14",
"score": "0.6087044",
"text": "def add_user(user_id, is_editor = false, is_administrator = false, is_creator = false)\n\t\tgroup = ProjectGroup.new\n\t\tgroup.user_id = user_id\n\t\tgroup.project_creator = is_creator\n\t\tgroup.project_editor = is_editor\n\t\tgroup.project_administrator = is_administrator\n\t\tproject_groups << group\n\tend",
"title": ""
},
{
"docid": "dc43a36aaab57ee3fd68b298e3ccea19",
"score": "0.60847557",
"text": "def new\n \t#declare user variabel with assign new user\n \t@user=User.new\n end",
"title": ""
},
{
"docid": "8c38ce6eb0f550ac4f6dec6839375fb2",
"score": "0.60824716",
"text": "def create\n @group = Group.new(params[:group])\n\n #here we add the current user to the membership collection of the group\n @membership = @group.memberships.build(params[:membership])\n @membership.group = @group\n @membership.user = current_user\n @membership.initiator = false\n @membership.membership_status_id = 2\n \n #and here we set the current_user as the owner of the group\n @group_permission = @group.group_permissions.build(params[:group_permission])\n @group_permission.membership = @membership\n @group_permission.group_role = GroupRole.find_by_name('Owner')\n \n @group.metro_area = MetroArea.find(params[:metro_area_id])\n @group.state = (@group.metro_area && @group.metro_area.state) ? @group.metro_area.state : nil\n @group.country = @group.metro_area.country if (@group.metro_area && @group.metro_area.country)\n\n \n #current_user.track_activity(:created_a_group)\n \n# unless @user.is_in_group?(@group)\n# @user.memberships << @group\n# end\n\n respond_to do |format|\n if @group.save\n flash[:notice] = 'Group was successfully created.'\n format.html { redirect_to(@group) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @group.errors, :status => :unprocessable_entity }\n end\n end\n \n end",
"title": ""
},
{
"docid": "abdfcde62d2c8b0ee66621cd451de6f5",
"score": "0.6080873",
"text": "def create\n @group = Group.new(group_params)\n respond_to do |format|\n if @group.save\n @group.users.push(current_user)\n UserGroup.set_is_admin(@group.id, current_user.id, true)\n invite_members\n format.html { redirect_to @group, notice: t('flash.notice.groups.successfully_created') }\n format.json { render :show, status: :created, location: @group }\n else\n format.html { render :new }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "158b9e2e798d16be3db5a8640bf84779",
"score": "0.60806394",
"text": "def new\n #@user = User.new\n @user.active = true\n @user.role_ids = [1]\n @user.groupings << current_user.root_grouping\n #@assigned_roles = []\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @user }\n end\n end",
"title": ""
},
{
"docid": "6f1c0fbbc5c41e9e1f806acc378cea49",
"score": "0.606458",
"text": "def create\n # Create the new user, given the params, but already a member of the group\n @group_user = @parent.new(params[:group_user])\n\n if !current_user or (!current_user.is_admin and !@group.owners.include?(current_user))\n redirect_to @group, :notice => \"You cannot add users to that group.\"\n return\n end\n\n respond_to do |format|\n if @group_user.save\n format.html { redirect_to(@group, :notice => 'Group user was successfully created.') }\n format.xml { render :xml => @group_user, :status => :created, :location => @group_user }\n else\n format.html { form_prep and render :action => \"new\" }\n format.xml { render :xml => @group_user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ee875bd631ecea192d3d31a7c75f5c6",
"score": "0.606443",
"text": "def add_user_member(user, group)\n ids = users_by_group_id(group.id).push(user).map(&:id)\n current_ids = users_by_group_id(group.id).map(&:id)\n create_member(ids, current_ids, 'User', inherited_by: group.id, destroy: false)\n end",
"title": ""
},
{
"docid": "5fbfb051a8cace8ee6ef39eae0decb9e",
"score": "0.6058652",
"text": "def set_group_user\n @group_user = group_user.find(params[:id])\n end",
"title": ""
},
{
"docid": "202a2ec5884e8441a48a2d281bac8172",
"score": "0.6056058",
"text": "def create_user\n # provide the interface asking for name, destination and duration\n # then, create and store the User object\n end",
"title": ""
},
{
"docid": "50945d51a863500c4a31408d7a1eb009",
"score": "0.6050842",
"text": "def create\n\t\t@user = User.new(params[:user])\n\t\t@user.login ||= @user.email #only email is required to create an account\n\t\t@user.name ||= @user.login #these two fields can be edited later\n\t\tparams[:group][:name] ||= @user.login #same for the group param\n\t\t\n\t\t#a completely new group should only have a name, with id = nil.\t \n\t\t@user.account = @group.account if @group = Group.find_by_id(params[:group][:group_id])\n message = nil\n \n\t\trespond_to do |format|\n\t\t begin\n\t\t User.transaction do\n\t\t\t @group ||= Group.new(params[:group])\n \t\t\t\t@user.account ||= Account.create!() #only create new account if it is empty\n \t\t\t\t@user.save!\n \t\t\t\t@user.account.creator_id = @user.id\n \t\t\t\tUserSession.create(:login => params[:user][:login], :password => params[:user][:password])\n \t\t\t\t@group.account = @user.account\n \t\t\t\t@user.account.save!\t\t\t\t\n \t\t\t\t@group.save!\n\t\t\t Priviledge.create!(:user => @user, :group => @group, :level => Level.find_by_name('user'))\n \t\t\t\tbase = base_group #base_group defined in application_controller\n \t\t\t\tGroup.rebuild! unless base.lft || base.rgt #needed for testing\n \t\t\t\t@group.move_to_child_of(base) if @group.parent_id.blank?\n \t\t\t\t\n \t\t\t\tflash[:notice] = 'Registration was successfull.'\n \t\t\t\t\n \t\t\t\t#Test for session[:calculator]. If it exists, then redirect to exposures.create with appropriate input params\n \t\t\t\tif session[:calculator]\n \t\t\t\t params = { :tender => { :validity => session[:calculator][:duration].to_i, \n \t\t\t\t \"bid_date(1i)\" => Date.today.strftime(\"%Y\"),\n \t\t\t\t \"bid_date(2i)\" => Date.today.strftime(\"%m\"),\n \t\t\t\t \"bid_date(3i)\" => Date.today.strftime(\"%d\"),\n \t\t\t\t :description => @user.login + \"_01\",\n \t\t\t\t :group => @group,\n \t\t\t\t :user => @user},\n \t\t\t\t :exposure => {:currency_in => Currency.get(session[:calculator][:from]).id, \n \t\t\t\t :currency_out => Currency.get(session[:calculator][:to]).id,\n \t\t\t\t :amount => 1000000 } \t\t\t\t \n \t\t\t\t }\n \t\t\t\t @exposure = Exposure.create_with_tender(params, message)\n \t\t\t\t if message.blank? && @exposure\n \t\t\t\t format.html {redirect_to @exposure}\n\t\t\t\t else\n\t\t\t\t p \"uh oh \" + message.to_s+\"<=end of message\"\n\t\t\t\t flash[:notice] = message\n \t\t\t format.html { render :controller => \"exposures\", :action => new, :params => params }\n\t\t\t end\n\t\t\t\t else\n \t\t\t\t format.html { redirect_to(current_user) }\n \t\t\t\t format.xml { render :xml => @user, :status => :created, :location => @user }\n\t\t\t\t end\n \t\t\tend\t\t\n\t rescue ActiveRecord::RecordInvalid\n\t p \"didn't make it on user save\"\n\t p message\n\t format.html { render :action => \"new\"} #render is better than redirect, because it preserves all of the @user data\n format.xml { render :xml => @user.errors, :status => :unprocessable_entity }\n end\n\t\tend\n\tend",
"title": ""
},
{
"docid": "b0d4d7b902c16cc6bfb7fa7b735baa40",
"score": "0.6046442",
"text": "def add_initial_user\n initial_user = Member.where(:email => \"administrator@administrator.com\").first\n \n unless initial_user\n # Create an initial position.\n position = Position.new\n position.name = \"Administrator\"\n position.pos_type = \"Administrator\"\n position.save\n \n # Create an initial division.\n division = Division.new\n division.name = \"Administrator\"\n division.save\n \n # Find initial position and division created.\n # Id´s will be used to crete initial user.\n position = Position.where(:name => \"Administrator\").first\n division = Division.where(:name => \"Administrator\").first\n \n # Create an initial user with position and divison created above.\n member = Member.new\n member.name = \"Administrator\"\n member.email = \"administrator@administrator.com\"\n member.password = \"administrator\"\n member.major = \"NONE\"\n member.grad_year = 9999\n member.member_since = 9999\n member.hometown = \"NONE\"\n member.position_id = position.id\n member.division_id = division.id\n member.save\n end\n end",
"title": ""
},
{
"docid": "f16c0cbbdbbae33c082f3f397ba3c60c",
"score": "0.6043031",
"text": "def create\r\n @user = User.new(user_params)\r\n\r\n respond_to do |format|\r\n if @user.save\r\n # group=Group.find(1);\r\n #@user.groups<<group\r\n #UserMailer.welcome_email().deliver!\r\n #UserMailer.welcome_email(@user).deliver_later\r\n format.html { redirect_to @user, notice: 'User was successfully created .'}\r\n format.json { render :show, status: :created, location: @user }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @user.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end",
"title": ""
},
{
"docid": "fafba35815ea36156754b1c5ad37c769",
"score": "0.6038101",
"text": "def create\n @groupc_user = GroupcUser.new(params[:groupc_user])\n\n respond_to do |format|\n if @groupc_user.save\n format.html { redirect_to @groupc_user, :notice => 'Groupc user was successfully created.' }\n format.json { render :json => @groupc_user, :status => :created, :location => @groupc_user }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @groupc_user.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0f4077904b2e8d2078fea18de21fefe0",
"score": "0.6031299",
"text": "def make_user(params = {})\n self.user= account.users.build_with_fields params.reverse_merge(:email => email, :invitation => self)\n end",
"title": ""
},
{
"docid": "69bc63e42b58b5374f7c4a89538b5e8d",
"score": "0.6031073",
"text": "def create\n @group = Group.new(group_params)\n if current_user\n @group.user_id = current_user.id\n end\n \n respond_to do |format|\n if @group.save\n format.html { redirect_to @group, notice: 'Group was successfully created.' }\n format.json { render action: 'show', status: :created, location: @group }\n else\n format.html { render action: 'new' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4f38caa9401f0ee53dec2da34d9edd87",
"score": "0.6028661",
"text": "def create\n @systemuser = Systemuser.new(params[:systemuser])\n @systemuser.name = params[:systemuser][:name]\n \n if params[:systemuser][:group_id] == 4\n @systemuser.ro = 1\n else\n @systemuser.ro = 0\n end\n \n @systemuser.enabled = 1\n\n respond_to do |format|\n if @systemuser.save\n format.html { redirect_to systemusers_path, notice: 'Wizard user was successfully created.' }\n format.json { render json: @systemuser, status: :created, location: @systemuser }\n else\n format.html { render action: \"new\" }\n format.json { render json: @systemuser.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a9befc3fc0742a15df62557f243451b5",
"score": "0.60172355",
"text": "def add_user_to_group(username, groupname)\n\t\t\t\t# Check for validity first\n\t\t\t\tsuper(username, groupname)\n\n\n\t\t\t\t`/usr/sbin/pw groupmod #{shellescape(groupname)} -m #{shellescape(username)}`\n\t\t\tend",
"title": ""
},
{
"docid": "d230c01458ee850e7736c95036ed1610",
"score": "0.601642",
"text": "def set_user_group\n @user_group = UserGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "8e81bdbe1bac0aa73983ad296726cb17",
"score": "0.6015725",
"text": "def create\n @group = Group.new(group_params)\n @group.owner = current_user\n\n respond_to do |format|\n if @group.save && @group.add_user!(current_user, :admin)\n audit(@group, \"create\", @group.name)\n format.html { redirect_to :back, notice: 'Group was successfully created.' }\n format.json { render :show, status: :created, location: @group }\n else\n format.html { render :new }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36e7dec5bf8d73559037f9536b603213",
"score": "0.60118127",
"text": "def create\n @user_group = UserGroup.new(params[:user_group])\n\n respond_to do |format|\n if @user_group.save\n format.html { redirect_to @user_group, notice: 'User group was successfully created.' }\n format.json { render json: @user_group, status: :created, location: @user_group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "36e7dec5bf8d73559037f9536b603213",
"score": "0.60118127",
"text": "def create\n @user_group = UserGroup.new(params[:user_group])\n\n respond_to do |format|\n if @user_group.save\n format.html { redirect_to @user_group, notice: 'User group was successfully created.' }\n format.json { render json: @user_group, status: :created, location: @user_group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5fdc98cecab2a5e342094e09e5d44ec9",
"score": "0.60098875",
"text": "def create\n @group = Group.new(group_params)\n respond_to do |format|\n if @group.save\n @group.memberships.create(user_id: current_user.id, state: \"owner\")\n format.html { redirect_to @group, notice: 'Group was successfully created.' }\n format.json { render action: 'show', status: :created, location: @group }\n else\n format.html { render action: 'new' }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "03ec689b22cfcee26d1f2cbdd9e38e86",
"score": "0.60003895",
"text": "def newacct\r\n @user = User.new\r\n @user.user_type=\"m\"\r\n return @user\r\n end",
"title": ""
},
{
"docid": "e6cfd09f78c9f207c65ea716f2d6e366",
"score": "0.5996847",
"text": "def add_user\n group_id_param = params[:group_id]\n user_id_param = params[:user_id]\n\n if group_id_param.nil? || group_id_param.blank?\n render json: { error: 'group_id not specified.' }, status: :bad_request\n return\n end\n\n if user_id_param.nil? || user_id_param.blank?\n render json: { error: 'user_id not specified.' }, status: :bad_request\n return\n end\n\n user = User.find_by_id(user_id_param)\n if user.nil?\n render json: { error: \"Can't find user #{user_id_param}.\" }, status: :bad_request\n return\n end\n\n group = CanvasSpaces.GroupCategory.groups.find_by_id(group_id_param)\n if group.nil?\n render json: { error: 'No such group found.' }, status: :bad_request\n else\n if @current_user.account.site_admin? ||\n group.leader_id == @current_user.id ||\n @current_user.id == user.id\n\n group.add_user user\n group.save\n\n render json: { message: 'Successfully added user.' }, status: :ok\n else\n # doesn't have access to the group\n render json: { error: \"Can't add user. Not owner or not adding self.\" }, status: :forbidden\n end\n end\n end",
"title": ""
},
{
"docid": "7b2f916e1305b5ee3c8528b24981d29c",
"score": "0.5995789",
"text": "def create\n @group = StudentGroup.new(params[:student_group])\n users = []\n #@group.institution_id = current_user.institution.id if current_user.institution\n #@group.center_id = current_user.center.id if current_user.center\n #@group.role_id = 10 #short_role for SG group\n respond_to do |format|\n if @group.save\n if current_user.is?'ET' or current_user.is? 'EO'\n StudentGroupOwner.create(student_group_id: @group.id, user_id: current_user.id)\n end\n if params[\"users\"].present?\n users = users + params[\"users\"]\n end\n if params[\"teachers\"].present?\n users = users + params[\"teachers\"]\n end\n unless users.empty?\n users.each do |i|\n UserGroup.create(:group_id=>@group.id,:user_id=>i.to_i)\n end\n end\n format.html { redirect_to group_path(@group), notice: 'Group was successfully created.' }\n format.json { render json: @group, status: :created, location: @group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "595453327957d6b377294c44b7b46073",
"score": "0.5994743",
"text": "def new_profile\n profile = Profile.new\n profile.user_group = UserGroup.first\n profile.library = Library.real.first\n profile.locale = I18n.default_locale.to_s\n profile.full_name = 'System'\n profile\nend",
"title": ""
},
{
"docid": "cb37af7e15efd3c4eefcc3878da20a9a",
"score": "0.5993898",
"text": "def create\n group_id = params[:group_id]\n user = User.find(params[:user_id])\n group = Group.find_by_id(group_id)\n if user.is_admin || group.creator == current_user\n role = Role.find_by_rolename('group_admin')\n else\n role = Role.find_by_rolename('user')\n end\n \n is_authorized = false\n\n if group.private\n if user.is_admin || group.creator == current_user\n is_authorized = true\n end\n else\n is_authorized = true\n end \n\n @membership = Membership.create({:group_id => params[:group_id], \n :user_id => user.id,\n :role_id => role.id,\n :authorized => is_authorized})\n if @membership.save\n respond_to do |format|\n format.html { redirect_to group_path(group_id) }\n format.xml { render :xml => @membership, :status => :created } \n format.json { render :json => @membership, :status => :created } \n end\n else\n respond_to do |format|\n format.html { redirect_to group_path(group_id) }\n format.xml { render :xml => @membership.errors, :status => :unprocessable_entity }\n format.json { render :json => @membership.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3a757b5359bf757c7e51de471bc587c8",
"score": "0.5992858",
"text": "def create\n @reagent_group = ReagentGroup.new(params[:reagent_group])\n unless @reagent_group.users.include? current_user\n @reagent_group.users << current_user\n end\n respond_to do |format|\n if @reagent_group.save\n format.html { redirect_to @reagent_group, notice: 'Reagent group was successfully created.' }\n format.json { render json: @reagent_group, status: :created, location: @reagent_group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @reagent_group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9803279bddf0fcfe749e0da76c755f15",
"score": "0.5991714",
"text": "def make_user\n end",
"title": ""
},
{
"docid": "efa96c0ad6c899626dda133f3f5595b6",
"score": "0.59909904",
"text": "def add_user!( user )\n raise TypeError.new('not a user') unless user.is_a?(Ecore::User)\n user.add_group!(self)\n end",
"title": ""
},
{
"docid": "d49eb6ec501e05b33b0de0bb8058f7db",
"score": "0.59882885",
"text": "def create\n @usergroup = Usergroup.new(usergroup_params)\n\n respond_to do |format|\n if @usergroup.save\n format.html { redirect_to @usergroup, notice: 'User group was successfully created.' }\n format.json { render :show, status: :created, location: @usergroup }\n else\n format.html { render :new }\n format.json { render json: @usergroup.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5fe4c98eb136410b5cf2615d62387ada",
"score": "0.59862566",
"text": "def set_user_group\n @user_group = UserGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "5fe4c98eb136410b5cf2615d62387ada",
"score": "0.59862566",
"text": "def set_user_group\n @user_group = UserGroup.find(params[:id])\n end",
"title": ""
},
{
"docid": "aacaf7f2fbd6cdb8e3cc6dc20cd5ed88",
"score": "0.5984797",
"text": "def createuser(clazz, info, gender, location, pass = 'webeng12')\n ret = clazz.new\n info.each_pair do |k, v|\n ret[k] = v\n end\n ret.gender = Gender.find_by_sex(gender)\n ret.location = Location.find_by_postal_code(location)\n ret.password, ret.password_confirmation = pass, pass \n ret\nend",
"title": ""
},
{
"docid": "4de3979b872ead1bb09f6c79c32192d1",
"score": "0.5983353",
"text": "def new\n @add_group_to_user = AddGroupToUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @add_group_to_user }\n end\n end",
"title": ""
},
{
"docid": "540b5185259e767b63c1a20ff646c6ab",
"score": "0.5982153",
"text": "def init_personal_group\n group = Group.new(_id: id, is_personal:true, name: email)\n group.save\n\n self.current_group = group\n groups << group\n end",
"title": ""
},
{
"docid": "9e9f561266e08b22cd1c15c5d7a89761",
"score": "0.597769",
"text": "def new_user\n\t\t@resource = User.new\n\t\t@resource_name = 'user'\n\tend",
"title": ""
},
{
"docid": "6f572a07f91c7005e4c55aa902e9b433",
"score": "0.5973837",
"text": "def createUser(userName, password, isAdminUser, webGroups, adminGroup, fName, lName, email, additionalUserInformation)\n\n @ACCESS_CONTROL.createNewUser(userName, webGroups[0], email, fName, lName, password)\n at = 0\n webGroups.each{ |group|\n @ACCESS_CONTROL.setUserField(userName, \"group#{at}\", webGroups[at])\n at = at.next\n }\n additionalUserInformation.keys.each{ |key|\n @ACCESS_CONTROL.setUserField(userName, key, additionalUserInformation[key])\n }\n if(isAdminUser)\n @ADMIN_ACCESS_CONTROL.createNewUser(userName, adminGroup, email, fName, lName, password)\n additionalUserInformation.keys.each{ |key|\n @ADMIN_ACCESS_CONTROL.setUserField(userName, key, additionalUserInformation[key])\n }\n end\n return true\n end",
"title": ""
},
{
"docid": "c4a273c60c60f8563a2b622a0a4ccc24",
"score": "0.59719664",
"text": "def idp_build_user_assertions(user,group)\n hash = {}\n hash[:attributes] = {}\n reseller = Reseller.new\n\n # Populate the session information\n hash[:name_id] = user.uid\n hash[:attributes][:mno_session] = user.sso_session\n hash[:attributes][:mno_session_recheck] = 3.minutes.from_now.utc.iso8601\n\n # Add group metadata\n hash[:attributes][:group_uid] = group.uid\n hash[:attributes][:group_name] = group.name\n hash[:attributes][:group_end_free_trial] = group.free_trial_end_at.utc.iso8601\n hash[:attributes][:group_role] = nil\n hash[:attributes][:group_has_credit_card] = false\n hash[:attributes][:group_email] = \"#{group.uid}@example.com\"\n hash[:attributes][:group_currency] = 'USD'\n hash[:attributes][:group_timezone] = 'America/Los_Angeles'\n hash[:attributes][:group_country] = 'US'\n hash[:attributes][:group_city] = 'Los Angeles'\n hash[:attributes][:group_reseller_id] = reseller.uid\n\n # Add reseller metadata\n if session.delete(:reseller_sso)\n hash[:attributes][:reseller_id] = reseller.uid\n hash[:attributes][:reseller_name] = reseller.name\n hash[:attributes][:reseller_country] = reseller.country\n end\n\n # Add user metadata\n hash[:attributes][:uid] = user.uid\n hash[:attributes][:virtual_uid] = user.virtual_uid(group)\n hash[:attributes][:email] = user.email\n hash[:attributes][:virtual_email] = user.virtual_email(group)\n hash[:attributes][:name] = user.name\n hash[:attributes][:surname] = user.surname\n hash[:attributes][:country] = user.geo_country_code\n hash[:attributes][:company_name] = user.company\n\n # Permissions\n hash[:attributes][:group_role] = (user.role(group) || 'Guest')\n hash[:attributes][:app_owner] = true\n hash[:attributes][:organizations] = {}\n\n # Return the hash\n return hash\n end",
"title": ""
},
{
"docid": "3b7ec92fd7c8202ce9c0b05697da76d0",
"score": "0.5967392",
"text": "def establish_new_group(user_id, obj, is_consult)\n # Bracket 0 = normal\n # Bracket 1 = unplaced students\n # Bracket 2 = absent students\n new_team = {}\n new_team[:consultant_id] = nil\n new_team[:consultant_id] = user_id if is_consult\n new_team[:objective_id] = obj\n new_team[:user_ids] = []\n new_team[:user_ids] << user_id\n @teams << new_team\n end",
"title": ""
},
{
"docid": "c52575f56df9abae7dcd64767ec849f2",
"score": "0.5967092",
"text": "def add_user_to_group(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'AddUserToGroup'\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\tif optional.key? :user_name\n\t\t\targs[:query]['UserName'] = optional[:user_name]\n\t\tend\n\t\tself.run(args)\n\tend",
"title": ""
},
{
"docid": "13031269d04c8d52c5396cbce0fe36b0",
"score": "0.5966788",
"text": "def add id, data, groups=[]\n id ||= uniq_id\n id = id.to_i\n @@users[id] = data.is_a?(Hash) ? data : {name: data}\n @@users[id][:id] = id\n @@users[id][:vars] = {}\n @@users[id][:groups]=groups.map { |e| e.to_s }\n update_groups @@users[id][:groups]\n end",
"title": ""
},
{
"docid": "2b5a25884401a4e448301a47f3ae5335",
"score": "0.5966211",
"text": "def group_user_params\n params.require(:group_user).permit(:name, :user_id, :group_id)\n end",
"title": ""
},
{
"docid": "d87d36ae6265a7cce4aa228adaed813d",
"score": "0.59651077",
"text": "def create_user(struct)\n struct.remapkeys!\n if struct.has_key? :user and struct.has_key? :pass\n rt = RT_Client.new(:user => struct[:user], :pass => struct[:pass])\n struct.delete(:user)\n struct.delete(:pass)\n else\n rt = RT_Client.new\n end\n val = rt.create_user(struct)\n rt = nil\n val\n end",
"title": ""
},
{
"docid": "8340b3cab898cd7fb9f127d3b981c057",
"score": "0.5962271",
"text": "def create\n @usergroup = Usergroup.new(usergroup_params)\n\n respond_to do |format|\n if @usergroup.save\n format.html { redirect_to @usergroup, notice: 'Usergroup was successfully created.' }\n format.json { render :show, status: :created, location: @usergroup }\n else\n format.html { render :new }\n format.json { render json: @usergroup.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4fdfc7c01355fea9d20f9f6d8cea144d",
"score": "0.5959406",
"text": "def create\n @user = User.new(user_params)\n @user.add_token\n @tempass = SecureRandom.hex(4)\n @user.password = @tempass\n @group = Group.find(params[:group_id])\n if @user.save\n @reviewer = Reviewer.create(user_id: @user.id, group_id: @group.id)\n @groupreview = GroupReview.find_by(group_id: @group.id)\n Review.create(title: \"\", body: \"\", user_id: @user.id, group_review_id: @groupreview.id )\n UserMailer.invite_mailer(@user, @tempass).deliver\n redirect_to '/'\n else\n flash[:empty] = \"Field cannot be empty!\"\n redirect_to new_group_user_path\n end\n end",
"title": ""
},
{
"docid": "30cf1541ce76104ad289be8b30cf6ab3",
"score": "0.59551454",
"text": "def usergroup_params\n params.require(:usergroup).permit(:id, :group_name, :created_at, :created_by)\n end",
"title": ""
},
{
"docid": "a5c40152540ebf491f8172a2b8e61d92",
"score": "0.5944832",
"text": "def create\n ip = request.location\n @user = current_user\n @group = @user.groups_as_owner.new(params[:group])\n params[:group][:member_ids] = (params[:group][:member_ids] << @group.member_ids).flatten\n @group.school_id = @user.school_id\n respond_to do |format|\n if @group.save\n format.html { redirect_to @group, notice: 'Group was successfully created.' }\n format.json { render json: @group, status: :created, location: @group }\n else\n format.html { render action: \"new\" }\n format.json { render json: @group.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
5977adf3cc0cab184317eeb56ff347fa
|
def _______________________________ GETTERS & SETTERS _______________________________
|
[
{
"docid": "624eb131144da93ef8923c3283e21a0f",
"score": "0.0",
"text": "def get_nombre; @nombre; end",
"title": ""
}
] |
[
{
"docid": "5a3dc0e6482d536f380828c82e0f7fb7",
"score": "0.7638688",
"text": "def getters; end",
"title": ""
},
{
"docid": "8975f95936438911763d46097c40f12f",
"score": "0.73366773",
"text": "def set; end",
"title": ""
},
{
"docid": "8975f95936438911763d46097c40f12f",
"score": "0.73366773",
"text": "def set; end",
"title": ""
},
{
"docid": "75c2501879978e71bc187af98c5df933",
"score": "0.7035617",
"text": "def name\n return @name\nend\ndef age\n return @age\nend\n#setters, allows you to change or set something\ndef name=(name)\n @name = name\nend",
"title": ""
},
{
"docid": "8283b1de573b6513575e739bf9eb83db",
"score": "0.68238926",
"text": "def attribute_to_set; end",
"title": ""
},
{
"docid": "1fd669a638293fd8fd6c51cd8485b47a",
"score": "0.68238616",
"text": "def get()\n \n end",
"title": ""
},
{
"docid": "fe704db3d40ab3204f14f147617fc26f",
"score": "0.67614955",
"text": "def properties; end",
"title": ""
},
{
"docid": "fe704db3d40ab3204f14f147617fc26f",
"score": "0.67614955",
"text": "def properties; end",
"title": ""
},
{
"docid": "fe704db3d40ab3204f14f147617fc26f",
"score": "0.67614955",
"text": "def properties; end",
"title": ""
},
{
"docid": "fe704db3d40ab3204f14f147617fc26f",
"score": "0.67614955",
"text": "def properties; end",
"title": ""
},
{
"docid": "fe704db3d40ab3204f14f147617fc26f",
"score": "0.67614955",
"text": "def properties; end",
"title": ""
},
{
"docid": "fe704db3d40ab3204f14f147617fc26f",
"score": "0.67614955",
"text": "def properties; end",
"title": ""
},
{
"docid": "fe704db3d40ab3204f14f147617fc26f",
"score": "0.67614955",
"text": "def properties; end",
"title": ""
},
{
"docid": "fe704db3d40ab3204f14f147617fc26f",
"score": "0.67614955",
"text": "def properties; end",
"title": ""
},
{
"docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1",
"score": "0.67114305",
"text": "def private; end",
"title": ""
},
{
"docid": "bc0f2dfadaa2b38b41c59c3acf7983ff",
"score": "0.664508",
"text": "def attr_reader(*)\n end",
"title": ""
},
{
"docid": "393a496b6bf3ed4de22834876eba617e",
"score": "0.65798825",
"text": "def setting; end",
"title": ""
},
{
"docid": "639512c2ab926defd80a9c8f2f8c5d31",
"score": "0.6530084",
"text": "def attribute; end",
"title": ""
},
{
"docid": "639512c2ab926defd80a9c8f2f8c5d31",
"score": "0.6530084",
"text": "def attribute; end",
"title": ""
},
{
"docid": "639512c2ab926defd80a9c8f2f8c5d31",
"score": "0.6530084",
"text": "def attribute; end",
"title": ""
},
{
"docid": "639512c2ab926defd80a9c8f2f8c5d31",
"score": "0.6530084",
"text": "def attribute; end",
"title": ""
},
{
"docid": "639512c2ab926defd80a9c8f2f8c5d31",
"score": "0.6530084",
"text": "def attribute; end",
"title": ""
},
{
"docid": "639512c2ab926defd80a9c8f2f8c5d31",
"score": "0.6530084",
"text": "def attribute; end",
"title": ""
},
{
"docid": "639512c2ab926defd80a9c8f2f8c5d31",
"score": "0.6530084",
"text": "def attribute; end",
"title": ""
},
{
"docid": "48ba6a084e77d87bacdd60af59195a70",
"score": "0.6519245",
"text": "def properties\n super\n end",
"title": ""
},
{
"docid": "2923142224afcda0320a754ed21dddf4",
"score": "0.6457896",
"text": "def _setter_method\n :\"_#{self[:name]}=\"\n end",
"title": ""
},
{
"docid": "2dc9c5d731b1a45848546ec81f8a4299",
"score": "0.6406789",
"text": "def attr; end",
"title": ""
},
{
"docid": "be26db1d3021b03dab1c205d7432f6a5",
"score": "0.6350175",
"text": "def setter_method\n :\"#{self[:name]}=\"\n end",
"title": ""
},
{
"docid": "25440cdddf4e32f00e0e71aec1459c94",
"score": "0.6318949",
"text": "def setter\r\n @setter ||= Field.setter(@name)\r\n end",
"title": ""
},
{
"docid": "4df5a7ff51c7d751f3c1508db7bb66a2",
"score": "0.6299902",
"text": "def to_setter\n\t\t\t\t(to_getter.to_s+\"=\").to_sym\n\t\t\tend",
"title": ""
},
{
"docid": "cd7efa6b9ebb71c14ffcb3ca7b28a571",
"score": "0.628267",
"text": "def __setter__\n \"#{self}=\"\n end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.62691927",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.62691927",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.62691927",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.62691927",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.62691927",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.62691927",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.62691927",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.62691927",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.62691927",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.62691927",
"text": "def attributes; end",
"title": ""
},
{
"docid": "95ffebd9cbd702368807cff490fedf3e",
"score": "0.62691927",
"text": "def attributes; end",
"title": ""
},
{
"docid": "c3aa14ced3d51dfd36e906bb4d6b34fc",
"score": "0.6241754",
"text": "def _setter_method\n :\"_#{self[:name]}=\"\n end",
"title": ""
},
{
"docid": "9420a3f76abc825d3be0786baef3145a",
"score": "0.623336",
"text": "def result_of_setting; end",
"title": ""
},
{
"docid": "59287fecdcec20a7cb75f4397eea7c8f",
"score": "0.6222326",
"text": "def accessors\n self.class.accessors\n end",
"title": ""
},
{
"docid": "1ee35197cfe7ca2efdba262048e5bd72",
"score": "0.621435",
"text": "def age=(value)\n @age = value\nend",
"title": ""
},
{
"docid": "1ee35197cfe7ca2efdba262048e5bd72",
"score": "0.621435",
"text": "def age=(value)\n @age = value\nend",
"title": ""
},
{
"docid": "47222fcdc2b7b1a10cbb46a1ece3322d",
"score": "0.6170104",
"text": "def setter_method\n :\"#{self[:name]}=\"\n end",
"title": ""
},
{
"docid": "96aaf7a249e5635e7aece29551760bdf",
"score": "0.61440134",
"text": "def setter_to_getter(node); end",
"title": ""
},
{
"docid": "24a2b314a22cdecf15df178c03ca7a9e",
"score": "0.6139078",
"text": "def get(object); end",
"title": ""
},
{
"docid": "9dab212d7b735dcb52e667362632fbcd",
"score": "0.612332",
"text": "def get\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "9d4a27a7b2ed4d844162111f1a1729a5",
"score": "0.61220413",
"text": "def get; end",
"title": ""
},
{
"docid": "cb04214597cbfc6d78d2c966d0a1a9a2",
"score": "0.61075723",
"text": "def get\n end",
"title": ""
},
{
"docid": "7908d36f8e2c277c808890c32e23e56a",
"score": "0.60977185",
"text": "def properties\n self.values\n end",
"title": ""
},
{
"docid": "2d69f5d1f39644c4dd9c19ff2fae9924",
"score": "0.6009333",
"text": "def transferred_properties; end",
"title": ""
},
{
"docid": "2d69f5d1f39644c4dd9c19ff2fae9924",
"score": "0.6009333",
"text": "def transferred_properties; end",
"title": ""
},
{
"docid": "fbbeb8d6a6282e6ea720719e412a3201",
"score": "0.6001213",
"text": "def method_missing(meth, *args, &blk)\n match = meth.to_s.match(/^([a-zA-Z\\_]+)(=|$)$/)\n if match\n attribute, setter = match[1], !match[2].blank?\n if setter\n write_attribute(attribute, args.first)\n else\n read_attribute(attribute)\n end\n else\n super(meth, *args, &blk)\n end\n end",
"title": ""
},
{
"docid": "b6377230282ce990a852225024376cae",
"score": "0.5994731",
"text": "def settings\r\n Mutable[self]\r\n end",
"title": ""
},
{
"docid": "70e16a88ffc3187a0adb75e25fd7ec38",
"score": "0.59921545",
"text": "def attributes\n end",
"title": ""
},
{
"docid": "8c4f89753521f97c12a6f4975816b6b2",
"score": "0.5981576",
"text": "def setter\n @setter ||= :\"#{@name}=\"\n end",
"title": ""
},
{
"docid": "2e9bb3fed96c5d881c18fc7acca701c5",
"score": "0.5969729",
"text": "def set(object, value); end",
"title": ""
},
{
"docid": "bc38792f2aa342deef82e644a4cb2a7d",
"score": "0.5953041",
"text": "def value_read; end",
"title": ""
},
{
"docid": "040e2501d69a749402031c4ea130da75",
"score": "0.59498286",
"text": "def settings\n\t\traise NotImplementedError\n\tend",
"title": ""
},
{
"docid": "3ec51b255b6490c305bed2cc8d235b67",
"score": "0.59489673",
"text": "def set_setting\n end",
"title": ""
},
{
"docid": "cea2f3562cc3f5380093bb0e61cacf49",
"score": "0.5948308",
"text": "def delegate_object_reader_method; end",
"title": ""
},
{
"docid": "aeb5d4e0cfcdae43c2ab2837059ce5af",
"score": "0.59441304",
"text": "def setter_methods\n return @setter_methods if @setter_methods\n @setter_methods = get_setter_methods\n end",
"title": ""
},
{
"docid": "aeb5d4e0cfcdae43c2ab2837059ce5af",
"score": "0.59441304",
"text": "def setter_methods\n return @setter_methods if @setter_methods\n @setter_methods = get_setter_methods\n end",
"title": ""
},
{
"docid": "84e5e1ecf94f2ec5385b840d3caeea4b",
"score": "0.59277326",
"text": "def attributes\n end",
"title": ""
},
{
"docid": "1e5e53c4b9e93d9482caa25c8f435412",
"score": "0.5923154",
"text": "def methods; end",
"title": ""
},
{
"docid": "1e5e53c4b9e93d9482caa25c8f435412",
"score": "0.5923154",
"text": "def methods; end",
"title": ""
},
{
"docid": "1e5e53c4b9e93d9482caa25c8f435412",
"score": "0.5923154",
"text": "def methods; end",
"title": ""
},
{
"docid": "1e5e53c4b9e93d9482caa25c8f435412",
"score": "0.5923154",
"text": "def methods; end",
"title": ""
},
{
"docid": "2e1d28bb5c450f676bccc7d4f8150aaa",
"score": "0.5914046",
"text": "def values_for_properties; end",
"title": ""
},
{
"docid": "2e97ef30fe66a5063c81888a8f30f150",
"score": "0.58772093",
"text": "def get\n self\n end",
"title": ""
},
{
"docid": "33d5217145f535a17b90168dfec988f5",
"score": "0.58654064",
"text": "def set(value)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "ac3b8eb42c2da8a7ed7eb90b59e8c096",
"score": "0.585626",
"text": "def name_setter\n @name\n end",
"title": ""
},
{
"docid": "bf55bc7eaf18d56cb23fc1d7b4ba7bed",
"score": "0.5846852",
"text": "def public; end",
"title": ""
},
{
"docid": "bf55bc7eaf18d56cb23fc1d7b4ba7bed",
"score": "0.5846852",
"text": "def public; end",
"title": ""
},
{
"docid": "50eabf64cf97a97b23a585d7ffbb047c",
"score": "0.584369",
"text": "def set_value( value )\n @value = value \n end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
},
{
"docid": "0f688875676cb4e5fb1a58d865b51cca",
"score": "0.5837086",
"text": "def value; end",
"title": ""
}
] |
ebeef36cd21fefcb9e2052daeaa355e1
|
POST /todolists POST /todolists.json
|
[
{
"docid": "5026c86f42ff160dd122c5547c52d277",
"score": "0.7465282",
"text": "def create\n @todolist = Todolist.new(params[:todolist])\n @todolist.todo_id= $current_todo\n\n respond_to do |format|\n if @todolist.save\n format.html { redirect_to @todolist, notice: 'Task was successfully created.' }\n format.json { render json: @todolist, status: :created, location: @todolist }\n else\n format.html { render action: \"new\" }\n format.json { render json: @todolist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "6c0f37560ccc24bf6cede147f4a2f339",
"score": "0.7963792",
"text": "def create_todolist(todo_list)\n post_params = {\n :body => todo_list.post_json,\n :headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'})\n }\n \n response = Logan::Client.post \"/projects/#{@id}/todolists.json\", post_params\n Logan::TodoList.new response.merge({ :project_id => @id })\n end",
"title": ""
},
{
"docid": "0c3d9f456e57b45b44bab56e4b22a7dc",
"score": "0.79547995",
"text": "def create\n @todo_list = TodoList.create(todo_list_params)\n render json: @todo_list\n end",
"title": ""
},
{
"docid": "0f10a726dcf29f0b8d293c206a8180cf",
"score": "0.78698283",
"text": "def create_todolist(todo_list)\n post_params = {\n :body => todo_list.post_json,\n :headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'})\n }\n\n response = Logan::Client.post \"/projects/#{@id}/todolists.json\", post_params\n Logan::TodoList.new response.merge({ :project_id => @id })\n end",
"title": ""
},
{
"docid": "357652947e092f271c76208ea4c4118e",
"score": "0.7864541",
"text": "def create_todo(list_id, name)\n return base_uri('post', 'lists/' + list_id + '/items', name)\n end",
"title": ""
},
{
"docid": "5164c09688ecaae1cbe8863fc9d0b13f",
"score": "0.7819113",
"text": "def create\n @todo_list = TodoList.new(todo_list_params)\n\n respond_to do |format|\n if @todo_list.save\n format.json { render :show, status: :created, location: @todo_list }\n else\n format.json { render json: @todo_list.errors.full_messages, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "44faffbaea591eb001b46c6818f6191a",
"score": "0.7719135",
"text": "def create_todolist(todo_list)\n response = client.access_token.post(\"#{client.base_uri}/projects/#{id}/todolists.json\") do |request|\n request.body = todo_list.post_json\n request.headers['Content-Type'] = 'application/json'\n end\n\n Basecamp::TodoList.new(response.parsed.merge({\n :account_id => account_id,\n :token => token\n }))\n\n rescue OAuth2::Error => ex\n Basecamp::Error.new(ex.message).raise_exception\n end",
"title": ""
},
{
"docid": "05f330052bf2208cc9e255d0fb79ea90",
"score": "0.77130187",
"text": "def create\n @todo_list = current_user.todo_lists.new(todo_list_params)\n\n respond_to do |format|\n if @todo_list.save\n format.html { redirect_to @todo_list, notice: 'Todo list was successfully created.' }\n format.json { render :show, status: :created, location: @todo_list }\n else\n format.html { render :new }\n format.json { render json: @todo_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f4280bcbdd10079777be256ca3861c22",
"score": "0.7681969",
"text": "def create\n\n @todo = @list.todos.create(todo_params)\n @user.todos << @todo\n\n set_deadline(@todo)\n\n respond_to do |format|\n if @todo.save\n\n format.html { redirect_to list_path(@list) }\n format.json { render :show, status: :created, location: @list }\n else\n format.html { render :new }\n format.json { render json: @todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1da3f6b032005a10e33e3d2dff46f622",
"score": "0.7670616",
"text": "def create\n @list = List.find(params[:list_id])\n @todo = @list.todos.build(params[:todo])\n \n respond_to do |format|\n if @todo.save\n format.html { redirect_to list_todos_path(@list), notice: 'Todo item was successfully created.' }\n format.json { render json: @list, status: :created, location: @list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1696cf5d67c4cc587631c6674cd26ddd",
"score": "0.7657022",
"text": "def create\n @todo_list = TodoList.new(todo_list_params)\n \n respond_to do |format|\n if @todo_list.save\n format.html { redirect_to @todo_list, notice: 'Todo list was successfully created.' }\n format.json { render :show, status: :created, location: @todo_list }\n else\n format.html { render :new }\n format.json { render json: @todo_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2933b7a759a290e4fab160b5e991b63f",
"score": "0.7636687",
"text": "def create\n @todolist = Todolist.new(todolist_params)\n\n if @todolist.save\n render :show, status: :created, location: @todolist\n else\n render json: @todolist.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c6342326ca82231d9399fdd2585309bf",
"score": "0.7626317",
"text": "def create\n @to_do_list = ToDoList.new(params[:to_do_list])\n\n respond_to do |format|\n if @to_do_list.save\n format.html { redirect_to to_do_lists_path, notice: 'To do list was successfully created.' }\n format.json { render json: @to_do_list, status: :created, location: @to_do_list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @to_do_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "672b305bd05fa8512025d4750b5c7f29",
"score": "0.76122624",
"text": "def create\n respond_with current_user.todo_lists.create todo_list_params\n end",
"title": ""
},
{
"docid": "003c7cb7be8c5e68b477f9af06ef9bc9",
"score": "0.75566876",
"text": "def create\n @todo_list= @todo_lists.new(params[:todo_list])\n\n respond_to do |format|\n if @todo_list.save\n format.html { redirect_to(user_todo_list_path(@user, @todo_list), :notice => 'Todo List was successfully created.') }\n format.xml { render :xml => @todo_list, :status => :created, :location => @todo_list}\n format.json { render :json => @todo_list}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @todo_list.errors, :status => :unprocessable_entity }\n format.json { render :json => @todo_list.errors, :status => :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "dbf7420d1f6486097c17882a9049dfa9",
"score": "0.752584",
"text": "def create\n @todo_app_list = current_user.todo_app_lists.new(todo_app_list_params)\n\n respond_to do |format|\n if @todo_app_list.save\n format.html { redirect_to @todo_app_list, notice: 'Todo app list was successfully created.' }\n format.json { render :show, status: :created, location: @todo_app_list }\n else\n format.html { render :new }\n format.json { render json: @todo_app_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "48acb99a48d11f976634e7597c223ead",
"score": "0.7506947",
"text": "def create\n @list = TodoList.new(params[:todo_list])\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'TodoList was successfully created.' }\n format.json { render json: { \n success: true,\n data: [@list],\n message: \"TodoList was successfully created.\"\n }, status: :created, location: @list }\n else\n format.html { render action: \"new\" }\n format.json { render json: {\n success: false,\n data: [],\n message: @list.errors\n }}\n end\n end\n end",
"title": ""
},
{
"docid": "3a99fdee10647b41dbed0c6e02a04647",
"score": "0.75029194",
"text": "def create\n @todolist = Todolist.find(params[:todolist_id])\n @todoitem = @todolist.todoitems.new(todoitem_params)\n respond_to do |format|\n if @todoitem.save\n format.html { redirect_to @todolist, notice: 'Todo item was successfully created.' }\n format.json { render :show, status: :created, location: @todoitem }\n else\n format.html { render :new }\n format.json { render json: @todolist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0d403d99f0b78272e36d3486c32ccf01",
"score": "0.748274",
"text": "def create\n @admin_todo_list = Admin::Todo::List.new(params[:admin_todo_list])\n @admin_todo_list.user = current_user\n #@admin_todo_list.tag = @admin_todo_tag_map[params[:admin_todo_list][:todo_tag_id]] \n \n if @admin_todo_list.save\n render :json => {:data => @admin_todo_list.to_json}\n else\n render :json => {:errors => @admin_todo_list.errors.full_messages, :data => @admin_todo_list.to_json}\n end\n end",
"title": ""
},
{
"docid": "a054376bb291cf58c3e02dcd55daf161",
"score": "0.7473118",
"text": "def create\n @todo_list = TodoList.new(todo_list_params)\n @todo_list.user = current_user\n\n respond_to do |format|\n if @todo_list.save\n format.html { redirect_to @todo_list, notice: 'Todo list was successfully created.' }\n format.json { render :show, status: :created, location: @todo_list }\n else\n format.html { render :new }\n format.json { render json: @todo_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ddde0f3e7b65ffeaa48f67bbb8f01591",
"score": "0.74493915",
"text": "def create\n @todo_item = @todo_list.todo_items.create(todo_item_params)\n respond_to do |format|\n if @todo_item.save\n format.html { redirect_to @todo_list, notice: 'Todo item was successfully created.' }\n format.json { render :show, status: :created, location: @todo_list }\n end\n end\n end",
"title": ""
},
{
"docid": "c1f6c34a2a56935be7de85f38fdfb2b0",
"score": "0.73665524",
"text": "def create\n @to_do_list = ToDoList.new(to_do_list_params)\n\n respond_to do |format|\n if @to_do_list.save\n format.html { redirect_to users_path, notice: 'To do list was successfully created.' }\n format.json { render :show, status: :created, location: @to_do_list }\n else\n format.html { render :new }\n format.json { render json: @to_do_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3581bb6b4c90c659c8a331e24e0fd3a9",
"score": "0.73333395",
"text": "def create_todo(todo)\n post_params = {\n :body => todo.post_json,\n :headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'})\n }\n \n response = Logan::Client.post \"/projects/#{@project_id}/todolists/#{@id}/todos.json\", post_params\n Logan::Todo.new response\n end",
"title": ""
},
{
"docid": "e72cab65907e32ffb2181cc7d5edf8cc",
"score": "0.73288214",
"text": "def create\n @todolist = Todolist.new(todolist_params)\n @todolist.user_id = current_user.id\n respond_to do |format|\n if @todolist.save\n format.html { redirect_to @todolist, notice: 'Todolist was successfully created.' }\n format.json { render :show, status: :created, location: @todolist }\n else\n format.html { render :new }\n format.json { render json: @todolist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c4d40e48357dc339bca7630c04228c48",
"score": "0.73089737",
"text": "def create\n @todolist = current_user.todolists.create(params[:todolist])\n\n respond_to do |format|\n if @todolist.save\n format.html { redirect_to(@todolist, :notice => 'Todolist was successfully created.') }\n format.xml { render :xml => @todolist, :status => :created, :location => @todolist }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @todolist.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ba7d17fa44c5103e8f4e68d31d7341f",
"score": "0.7307305",
"text": "def create\n @project.todo_lists.new(todo_params)\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Todo added successfully.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "41c171e30086f3037c5bbb68ce8010ba",
"score": "0.72825027",
"text": "def create_todo(todo)\n post_params = {\n :body => todo.post_json,\n :headers => Logan::Client.headers.merge({'Content-Type' => 'application/json'})\n }\n\n response = Logan::Client.post \"/projects/#{@project_id}/todolists/#{@id}/todos.json\", post_params\n Logan::Todo.new response\n end",
"title": ""
},
{
"docid": "95079d880d8df10ab5612f7f5eec3ea9",
"score": "0.727284",
"text": "def create\n @user_todo_list = UserTodoList.new(user_todo_list_params)\n\n respond_to do |format|\n if @user_todo_list.save\n format.html { redirect_to @user_todo_list, notice: 'User todo list was successfully created.' }\n format.json { render :show, status: :created, location: @user_todo_list }\n else\n format.html { render :new }\n format.json { render json: @user_todo_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "037b4ff47d846ca05a2636b5e7a42dc7",
"score": "0.724177",
"text": "def create\n @todo_item = @todo_list.todo_items.new(todo_item_params)\n\n respond_to do |format|\n if @todo_item.save\n flash[:success] = 'Todo item was successfully created.'\n format.html { redirect_to root_path}\n format.json { render :show, status: :created, location: @todo_item }\n else\n flash[:error] = 'Error occured'\n format.html { redirect_to :back}\n format.json { render json: @todo_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d8bad367ff32c644733dd8cab761c9cf",
"score": "0.72053546",
"text": "def postList(listName, idBoard)\n\tresponse = RestClient.post(\n\t\t'https://api.trello.com/1/lists',\n\t\t:name => listName, \n\t\t:idBoard => idBoard,\n\t\t:key=>$key,\n\t\t:token=>$token\n\t)\n\tresponse = JSON.parse(response)\nend",
"title": ""
},
{
"docid": "71b759812f2d7c86c91304c73d0e9ed4",
"score": "0.72037435",
"text": "def create\n @todo_list = current_user.todo_lists.build(todo_list_params)\n @todo_list.user_id = current_user.id\n respond_to do |format|\n if @todo_list.save\n format.html { redirect_to todo_lists_url, notice: 'Todo item was successfully created.' }\n format.json { render :show, status: :created, location: @todo_list }\n else\n format.html { render :new }\n format.json { render json: @todo_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2dd57b1a3f114b9dd084e935d2aa019b",
"score": "0.7201021",
"text": "def create\n @todo_item = @todo_list.todo_items.create(todo_item_params)\n if @todo_item.save\n redirect_to @todo_list\n else\n redirect_to @todo_list\n end\n end",
"title": ""
},
{
"docid": "06c3668675816c1b9cdb4f046be80073",
"score": "0.72005343",
"text": "def create\n @todo_item = @todo_list.todo_items.create(set_todo_item_params)\n redirect_to @todo_list\n end",
"title": ""
},
{
"docid": "2da4a56919b190512bfdc7343dae2ab9",
"score": "0.7199914",
"text": "def create_todo(todo)\n response = client.access_token.post(\"#{client.base_uri}/projects/#{project_id}/todolists/#{id}/todos.json\") do |request|\n request.body = todo.post_json\n request.headers['Content-Type'] = 'application/json'\n end\n Basecamp::Todo.new(response.parsed)\n rescue OAuth2::Error => ex\n Basecamp::Error.new(ex.message).raise_exception\n end",
"title": ""
},
{
"docid": "d1fa06ed043395ab4ff38d6e06b1b5ca",
"score": "0.71980387",
"text": "def create\n @todo = Todo.new\n @todo.user_id = @user.id\n @todo.name = todo_params[\"name\"]\n @todo.isCompleted = todo_params[\"isCompleted\"]\n @todo.set_tag(todo_params[\"tag_list\"], @user.id)\n\n if @todo.save\n render :json => @todo, :include => [:tags]\n else\n render json: { error: 'Unable to create todo'}, status: 400\n end\n end",
"title": ""
},
{
"docid": "0029099cd736a0061ea709c4d075c715",
"score": "0.71688515",
"text": "def todo_params\n params.require(:todo_list).permit(:todo)\n end",
"title": ""
},
{
"docid": "141d216df2cf553624d864440f09c5a8",
"score": "0.7162075",
"text": "def new\n @list = List.find(params[:list_id])\n @todo = @list.todos.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @todo }\n end\n end",
"title": ""
},
{
"docid": "6c65e6244633f5cbe8aef414fe9bd357",
"score": "0.71249807",
"text": "def create\n @todo = Todo.new(todo_params)\n\n if @todo.save\n render json: @todo, status: :created, location: @todo\n else\n render json: @todo.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "39a401e06f9d69f9d0a7147c2835b190",
"score": "0.71162856",
"text": "def create\n @todo.save!\n respond_to do |format|\n format.html { redirect_to todos_path }\n format.json { render json: @todo }\n end\n end",
"title": ""
},
{
"docid": "77811c2da432bc03429c7f55d2e55936",
"score": "0.7115218",
"text": "def create\n @todo_item = TodoItem.new(params[:todo_item])\n @todo_list.todo_items << @todo_item\n\n respond_to do |format|\n if @todo_item.save\n format.json { render json: @todo_item, status: :created, location: @todo_item }\n format.js #create.js.coffee\n else\n format.json { render json: @todo_item.errors, status: :unprocessable_entity }\n format.js { render action: \"new\" }\n end\n end\n end",
"title": ""
},
{
"docid": "3345ae0cfbc71f7ea1541bddfdbdd6c9",
"score": "0.7102862",
"text": "def create\r\n @todolist = current_user.todolists.create(todolist_params) \r\n respond_to do |format|\r\n format.js \r\n end\r\n end",
"title": ""
},
{
"docid": "f671ca1bf92075138a49287ccc5f3ef7",
"score": "0.7094802",
"text": "def create\n @todo = Todo.create({\n :item =>params[:item],\n :user_id =>params[:user_id],\n :completed => !params[:completed].to_i.zero?\n })\n render json: @todo\n end",
"title": ""
},
{
"docid": "f4520515a180e2d77b404d4e3fbd6fa7",
"score": "0.7063812",
"text": "def create\n @todo_item = @todo_list.todo_items.create(params[:todo_item])\n redirect_to @todo_list\n end",
"title": ""
},
{
"docid": "da6ade59d08cbb32e1b62a3846dc8334",
"score": "0.7057933",
"text": "def create\n @todo_item=@my_list.todo_items.create(todo_items_params_content)\n redirect_to @my_list\n end",
"title": ""
},
{
"docid": "ddf11f56f15a2d22de0921c10a6e9404",
"score": "0.70467275",
"text": "def create\n @todo = Todo.new(todo_params)\n\n if @todo.save\n render json: @todo, status: 200\n else\n render json: @todo.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "3e473e016ee72126a379e7d77e32415e",
"score": "0.70429313",
"text": "def create\n @new_todo = Todo.new(todo_params)\n render json: @new_todo, status: :created, location: todos_path(@new_todo)\n\n end",
"title": ""
},
{
"docid": "d29810c81b8ffb31a8c686886e566a27",
"score": "0.7033186",
"text": "def create\n add_breadcrumb 'New Todo list'\n @todo_list = TodoList.new(todo_list_params)\n\n respond_to do |format|\n if @todo_list.save\n format.html do\n redirect_to @todo_list, notice: 'Todo list was successfully created.'\n end\n format.json { render :show, status: :created, location: @todo_list }\n else\n format.html { render :new , status: :unprocessable_entity }\n format.json do\n render json: @todo_list.errors, status: :unprocessable_entity\n end\n end\n end\n end",
"title": ""
},
{
"docid": "55c23e50b4abe0c657fe7d61aa3d3883",
"score": "0.6986564",
"text": "def create\n @todo = Todo.new(todo_params)\n\n\n if @todo.save\n render json: @todo, status: :created\n else\n render json: @todo.errors, status: :unprocessable_entity\n end\n\n end",
"title": ""
},
{
"docid": "46c24c7e9dc19664b5772686e6a9af3c",
"score": "0.69827884",
"text": "def create\n @todo = Todo.create!(todo_params)\n json_response(@todo, :created)\n end",
"title": ""
},
{
"docid": "b194e3ffbe1d833f3a6b79b62b7f3287",
"score": "0.6980925",
"text": "def create \n\t\t@todo_item = @todo_list.todo_items.create(todo_item_params)\n\t\tredirect_to @todo_list\n\tend",
"title": ""
},
{
"docid": "f1cdd468b4aa25551a74ee39b7f9c4f1",
"score": "0.69729704",
"text": "def create\n @task_list = current_user.task_lists.new(tl_params)\n\n if @task_list.save\n render json: @task_list, status: :created\n else\n render json: @task_list.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "bee677fb1bcbaaf055ffa2eede69b194",
"score": "0.69709176",
"text": "def create\n @tasks = @todo_list.tasks.create(task_params)\n redirect_to @todo_list\n end",
"title": ""
},
{
"docid": "aa3803b1d729b41fa2593eece2b1f312",
"score": "0.6962817",
"text": "def todolist_params\n params.require(:todolist).permit(:title, :description)\n end",
"title": ""
},
{
"docid": "0277bc667a44ac5394462d4df8c29159",
"score": "0.6962415",
"text": "def create_task_list(opts={})\n @list.client.post(\"#{url}/task_lists\", opts)\n end",
"title": ""
},
{
"docid": "1784e5ad2cfebf8c0d4ec24b3afd4b6a",
"score": "0.6926522",
"text": "def todo_list_params\n params.require(:todo_list).permit(:title, :description)\n end",
"title": ""
},
{
"docid": "1784e5ad2cfebf8c0d4ec24b3afd4b6a",
"score": "0.6926522",
"text": "def todo_list_params\n params.require(:todo_list).permit(:title, :description)\n end",
"title": ""
},
{
"docid": "1784e5ad2cfebf8c0d4ec24b3afd4b6a",
"score": "0.6926522",
"text": "def todo_list_params\n params.require(:todo_list).permit(:title, :description)\n end",
"title": ""
},
{
"docid": "5bea9c70539c443407ff4fcf088d982d",
"score": "0.6923468",
"text": "def todo_list_params\n params.require(:todo_list).permit(:title, :description)\n end",
"title": ""
},
{
"docid": "fa1de5f6e7c662af0aa2740558c996e8",
"score": "0.69018966",
"text": "def create\n @todoitem = Todoitem.new(todoitem_params)\n if @todoitem.save\n render json: @todoitem, status: :created\n else\n render json: @todoitem.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "ae1d389b28cbaee990c74463127054ae",
"score": "0.69012094",
"text": "def create\n respond_to do |format|\n if @task_list.save\n current_user.task_lists << @task_list\n format.html { redirect_to @task_list, notice: 'Task list was successfully created.' }\n format.json { render json: @task_list, status: :created, location: @task_list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @task_list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ecae1911065854a2d1e8e6639db2ea6",
"score": "0.6898918",
"text": "def create(name)\n attributes = client.post(path: 'lists', params: { list: { name: name }})\n TodoableApi::List.new(attributes)\n end",
"title": ""
},
{
"docid": "95f5fd4c731edee0a19357c42caae39b",
"score": "0.6896147",
"text": "def create\n @todo_item = @todo_list.todo_items.new(todo_item_params)\n\n if @todo_item.save\n redirect_to @todo_list, notice: 'Todo item was successfully created.'\n else\n redirect_to @todo_list, alert: 'Unable to create a todo item!'\n end\n \n end",
"title": ""
},
{
"docid": "3cd0b5daf48d43908b5eaa02a4a00787",
"score": "0.68940187",
"text": "def create\n \n @tasklist = current_user.tasklists.new(params[:tasklist]);\n \n respond_to do |format|\n if @tasklist.save\n format.html { redirect_to @tasklist, notice: 'Tasklist was successfully created.' }\n format.json { render json: @tasklist, status: :created, location: @tasklist }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tasklist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23cc7bc10657715c35fcd0bffa338213",
"score": "0.68906564",
"text": "def create\n @todolist = Todolist.new(params[:todolist])\n\n respond_to do |format|\n if @todolist.save\n flash[:notice]=\"Success\"\n format.html { redirect_to @todolist, notice: 'Todolist was successfully created.' }\n format.json { render json: @todolist, status: :created, location: @todolist }\n format.js { }\n else\n flash[:alert]=\"Unsuccessfull\"\n format.html { render action: \"new\" }\n format.json { render json: @todolist.errors, status: :unprocessable_entity }\n format.js { }\n end\n end\n end",
"title": ""
},
{
"docid": "4bef9e258484ad4e0228abb8d90e0ffd",
"score": "0.6876737",
"text": "def create\n \t@to_do_list = ToDoList.find(params[:to_do_list_id])\n @to_do_item = ToDoItem.new(params[:to_do_item])\n @to_do_list.to_do_items.build(params[:to_do_item])\n\t\trespond_to do |format|\n if @to_do_list.save\n format.html { redirect_to to_do_list_to_do_items_path(@to_do_item.to_do_list_id), notice: 'To do item was successfully created.' }\n format.json { render json: @to_do_item, status: :created, location: @to_do_item }\n else\n format.html { \n \trender action: \"new\" \n }\n format.json { render json: @to_do_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6a4fd705d9549967fb0495b7f0d1a00",
"score": "0.6874767",
"text": "def create\n @todo = Todo.new(todo_params)\n\n respond_to do |format|\n if @todo.save\n # format.html { redirect_to root_url, notice: 'Todo was successfully created.' }\n format.json { render json: {status: 'success', todo: @todo}, status: :created, location: @root_url }\n else\n # format.html { render :index }\n format.json { render json: @todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b677002a3b436d87849e7733bcf2bb95",
"score": "0.6870407",
"text": "def todo_list_params\n params.require(:todo_list).permit(:name, :user_id)\n end",
"title": ""
},
{
"docid": "9dcb0399314c71bb48687b92de811e0e",
"score": "0.68585175",
"text": "def todo_list todo_list_id\n TodoList.new Basecampx.request \"projects/#{self.id}/todolists/#{todo_list_id}.json\"\n end",
"title": ""
},
{
"docid": "892ccf47bf9ab521840f1fb6e1c5c6ec",
"score": "0.68577975",
"text": "def create\n @tasklist = Tasklist.new(tasklist_params)\n\n respond_to do |format|\n if @tasklist.save\n @user.tasklists << @tasklist\n \n format.html { redirect_to @tasklist, notice: 'Tasklist was successfully created.' }\n format.json { render action: 'show', status: :created, location: @tasklist }\n else\n format.html { render action: 'new' }\n format.json { render json: @tasklist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "20f921565f28a2aa4b229e01cecaac5f",
"score": "0.6852703",
"text": "def create\n @list = List.new(params[:list])\n\n respond_to do |format|\n if @list.save\n format.html { redirect_to @list, notice: 'Task list was successfully created.' }\n format.json { render json: @list, status: :created, location: @list }\n else\n format.html { render action: \"new\" }\n format.json { render json: @list.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "50f6ddab1730328eeee31b3469e2caee",
"score": "0.6848931",
"text": "def todo_list_params\n params.require(:todo_list).permit(\n :title,\n :description,\n :priority,\n :completed\n )\n end",
"title": ""
},
{
"docid": "4c70a8f85421324573d2fc4d9fba101b",
"score": "0.6848893",
"text": "def create\n @todo_list2 = TodoList2.new(todo_list2_params)\n\n respond_to do |format|\n if @todo_list2.save\n format.html { redirect_to @todo_list2, notice: 'Todo list2 was successfully created.' }\n format.json { render action: 'show', status: :created, location: @todo_list2 }\n else\n format.html { render action: 'new' }\n format.json { render json: @todo_list2.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "14481d1b957b493a1dad0eff5f31ab8e",
"score": "0.6839773",
"text": "def todo_list_params\n params.require(:todo_list).permit(:title, :description)\n end",
"title": ""
},
{
"docid": "56fa24a6821d05844215834eb088d654",
"score": "0.68223846",
"text": "def create\n @todo_item = @todo_list.todo_items.new(todo_item_params)\n\n if @todo_item.save\n flash[:success] = \"Added Todo list item\"\n redirect_to todo_list_todo_items_path\n else\n flash[:error] = \"There was an error adding that Todo item\"\n render action: :new\n end\n end",
"title": ""
},
{
"docid": "47d9b9a37da537c25f24b25280229f46",
"score": "0.6816086",
"text": "def todolist_params\n params.require(:todolist).permit(:name)\n end",
"title": ""
},
{
"docid": "72e1d72d0bd4dd943b29a9dbd3b85c61",
"score": "0.67913914",
"text": "def create\n @todo_item = TodoItem.new(params[:todo_item].merge(:todo_list => @todo_list))\n\n respond_to do |format|\n if @todo_item.save\n flash[:notice] = 'Item was successfully created.'\n format.html { redirect_to(@project) }\n format.xml { render :xml => @todo_item, :status => :created, :location => @todo_item }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @todo_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "58bea96cc465125e329148fe7fbdd110",
"score": "0.6790687",
"text": "def create\n @todo = Todo.new(params[:todo])\n \n respond_to do |format|\n if @todo.save\n format.html { redirect_to @todo, notice: 'Todo was successfully created.' }\n format.json { render json: @todo, status: :created, location: @todo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9823664598bcc265e5fa94e3cb3ae798",
"score": "0.6781492",
"text": "def create(params)\n post('lists', params)\n end",
"title": ""
},
{
"docid": "b6065b67895658a62df5923303c10d96",
"score": "0.6766391",
"text": "def create\n\n @todo = Todo.new(params[:todo])\n\n respond_to do |format|\n if @todo.save\n format.html { redirect_to @todo, notice: 'Todo was successfully created.' }\n format.json { render json: @todo, status: :created }\n else\n format.html { render action: \"new\" }\n format.json { render json: @todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d9258831f1c8f2d8fbfa408639ee8120",
"score": "0.67587185",
"text": "def new\n @to_do_list = ToDoList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @to_do_list }\n end\n end",
"title": ""
},
{
"docid": "406429b1f1d4d0f1ca3c21568c46324a",
"score": "0.67566437",
"text": "def create_task\n list = current_user.lists.find_by_id(params[:list_id])\n @task = list.tasks.new(:body => params[:body], :complete => params[:complete])\n\n respond_to do |format|\n if @task.save\n format.html { redirect_to @task, notice: 'Task was successfully created.' }\n format.json { render json: @task, status: :created, location: @task }\n format.js { render :layout => false }\n else\n format.html { render action: \"new\" }\n format.json { render json: @task.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "252cb36e91f189be48867be3823f9b03",
"score": "0.6752663",
"text": "def new\n @todo_item = @todo_list.todo_items.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @todo_item }\n end\n end",
"title": ""
},
{
"docid": "c50ec3aaaf500c9d7e8d8daf9621a4e4",
"score": "0.6744243",
"text": "def todo_list_params\n params.require(:list).permit(todos_attributes: [:id, :title,\n :is_completed, :_destroy])\n end",
"title": ""
},
{
"docid": "414c3f5134488b62f45e92a74dd83bd9",
"score": "0.6741189",
"text": "def create\n @todo = Todo.new(todo_params)\n\n respond_to do |format|\n if @todo.save\n format.html { redirect_to @todo, notice: 'Todo was successfully created.' }\n format.json { render :show, status: :created, location: @todo }\n else\n format.html { render :new }\n format.json { render json: @todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "414c3f5134488b62f45e92a74dd83bd9",
"score": "0.6741189",
"text": "def create\n @todo = Todo.new(todo_params)\n\n respond_to do |format|\n if @todo.save\n format.html { redirect_to @todo, notice: 'Todo was successfully created.' }\n format.json { render :show, status: :created, location: @todo }\n else\n format.html { render :new }\n format.json { render json: @todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "414c3f5134488b62f45e92a74dd83bd9",
"score": "0.6741189",
"text": "def create\n @todo = Todo.new(todo_params)\n\n respond_to do |format|\n if @todo.save\n format.html { redirect_to @todo, notice: 'Todo was successfully created.' }\n format.json { render :show, status: :created, location: @todo }\n else\n format.html { render :new }\n format.json { render json: @todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "65fdd403639f4554b2d1727528ead0eb",
"score": "0.6737253",
"text": "def create\n @todo_item = TodoItem.new(params[:todo_item])\n\n respond_to do |format|\n if @todo_item.save\n format.html { redirect_to @todo_item, :notice => 'Todo item was successfully created.' }\n format.json { render :json => @todo_item, :status => :created, :location => @todo_item }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @todo_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "79c5905e7e532b8a59cf8ca323e2bcbb",
"score": "0.67188346",
"text": "def create\n @todo_todo = Todo::Todo.new(todo_todo_params)\n\n respond_to do |format|\n if @todo_todo.save\n format.html { redirect_to @todo_todo, notice: 'Todo was successfully created.' }\n format.json { render :show, status: :created, location: @todo_todo }\n else\n format.html { render :new }\n format.json { render json: @todo_todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1cafa8f69c2ee4fee5c6f2b4cee90f5d",
"score": "0.67102903",
"text": "def post_body\n {\n \"list\": {\n \"name\": name\n }\n }.to_json\n end",
"title": ""
},
{
"docid": "3b5f23621f91a061c3535b9527ceefe7",
"score": "0.6702692",
"text": "def todo_list_item_params\n params.require(:todo_list_item).permit(:label, :status, :todo_list_id)\n end",
"title": ""
},
{
"docid": "19c1bf6b071dc517d2f5ff9503054d8c",
"score": "0.6694895",
"text": "def create\n todo = Todo.new(todo_params)\n if todo.save\n render json: {status: 'SUCCESS', message:'Saved todo', data:todo}, status: :ok\n else\n render json: {status: 'ERROR', message:'Todo not saved', data:todo.errors}, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "1c66a79e8ab68670374c35345d13e87c",
"score": "0.66880643",
"text": "def create(data)\n client = Client.new({\n 'method': Client::METHOD_POST,\n 'url': Base.config.api_url('lists'),\n 'params_post': data\n })\n client.request\n end",
"title": ""
},
{
"docid": "57db2de043a71103b0cbc9d4e1d17642",
"score": "0.66800183",
"text": "def create\n @tlist = Tlist.new(tlist_params)\n\n respond_to do |format|\n if @tlist.save\n format.html { redirect_to @tlist, notice: 'Tlist was successfully created.' }\n format.json { render :show, status: :created, location: @tlist }\n else\n format.html { render :new }\n format.json { render json: @tlist.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "eab7d2c2411899b0a9b6cf45b346c1bd",
"score": "0.6678949",
"text": "def create\n params['user_id'] = current_user.id if current_user\n @todo = Todo.new(todo_params)\n\n if @todo.save\n render json: { location: @todo }, status: :created\n else\n render json: @todo.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "846c513187fa1a94e8dd1452bea0197b",
"score": "0.6672591",
"text": "def create\n\t\t# @todolist = Todolist.find(params[:todolist_id])\n\t\t# make this a before_action\n\t\t@item = @todolist.items.create(item_params)\n\t\tredirect_to @todolist\n\tend",
"title": ""
},
{
"docid": "1fc82cd63306b1490aadea01e34cb9e1",
"score": "0.6663743",
"text": "def create\n @todo_item = TodoItem.new(params[:todo_item])\n\n respond_to do |format|\n if @todo_item.save\n format.html { redirect_to @todo_item, notice: 'Todo item was successfully created.' }\n format.json { render json: @todo_item, status: :created, location: @todo_item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @todo_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d580443a089abd385098bd6cc143568c",
"score": "0.666323",
"text": "def todo_list_params\n params.require(:todo_list).permit(:title, :description,:duedate, :status, :category, :priority)\n end",
"title": ""
},
{
"docid": "8acaf738aef478e41f83a27d514e2a17",
"score": "0.66509163",
"text": "def create\n @todo = Todo.new(todo_params)\n\n respond_to do |format|\n if @todo.save\n format.html { redirect_to todos_path, :flash => { :success => 'Task was successfully created.' } }\n format.json { render :show, status: :created, location: @todo }\n else\n format.html { render :new }\n format.json { render json: @todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a94ceab5edbd822fc9cdec071bcd907",
"score": "0.6650746",
"text": "def create\n @todo = @todos.new(params[:todo])\n\n respond_to do |format|\n if @todo.save\n format.html { redirect_to(user_todo_list_path(@todo_list.user, @todo_list)) }\n format.js\n else\n format.html { redirect_to(user_todo_list_path(@todo_list.user, @todo_list)) }\n format.js\n end\n end\n end",
"title": ""
},
{
"docid": "40d45e66bc64ee1e87929b77563de0ad",
"score": "0.66500133",
"text": "def to_do_list_params\n params.require(:to_do_list).permit(:title, :description)\n end",
"title": ""
},
{
"docid": "0abb0e186865da4bc9cea2934330a477",
"score": "0.66456306",
"text": "def new\n @todolist = Todolist.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @todolist }\n end\n end",
"title": ""
}
] |
ad2ac9d92e18a74b973a8cb158ba5acf
|
the new item form page
|
[
{
"docid": "0ac3f3900a89da59a90f4a4ce7e31a4d",
"score": "0.0",
"text": "def new\n \t@item = Item.new\n \t@cupboards = Cupboard.all\n end",
"title": ""
}
] |
[
{
"docid": "c039cbef96f11f484ef1b747e617c69e",
"score": "0.7877464",
"text": "def new\n\t@item = Item.new(:number => 1, :user_id => current_user.id )\n\trender :layout => 'form' \n end",
"title": ""
},
{
"docid": "95e0c965c9423f05ca61b53a509cfb87",
"score": "0.75517267",
"text": "def create\n @item = Item.new(item_params)\n if @item.save\n flash[:success] = \"項目已新增!\"\n redirect_to root_url\n else\n flash[:danger] = \"新增失敗!\"\n @submit_text = \"新增\"\n render 'new'\n end\n end",
"title": ""
},
{
"docid": "9044ef6ada62d615a6b56730b5cd48ec",
"score": "0.734149",
"text": "def create\n \t\n \t@item=Item.new(item_params)\n \t\n \tif @item.save\n \t\tredirect_to(:action=>'display')\n \telse\n \t\trender('new')\n \tend\t\n \n end",
"title": ""
},
{
"docid": "c7ca98e016fca96f8304b70e4b765231",
"score": "0.73297304",
"text": "def item_new\n @brief = Brief.find(params[:brief_id])\n @item = Item.new\n @item.kind = params[:kind]\n @action_to = vendor_item_create_path(@brief,@item.kind)\n end",
"title": ""
},
{
"docid": "45ef343f1e0b4bdf7a0f619039bc2368",
"score": "0.731374",
"text": "def new\n\t\t# no code needed here; all handled in the view\n\tend",
"title": ""
},
{
"docid": "b5375b603ae453818cee5493159cc03a",
"score": "0.7244962",
"text": "def create\n\t \t@item = Item.new(item_params)\n\t \tif @item.save\n\t \t\tredirect_to items_path\n\t \telse\n\t \t\trender action: \"new\"\n\t \tend\n\t end",
"title": ""
},
{
"docid": "d785fa31f8dd8b608e0a5eec6b6af2a7",
"score": "0.72045314",
"text": "def new\n @item = Item.new\n end",
"title": ""
},
{
"docid": "d785fa31f8dd8b608e0a5eec6b6af2a7",
"score": "0.72045314",
"text": "def new\n @item = Item.new\n end",
"title": ""
},
{
"docid": "d785fa31f8dd8b608e0a5eec6b6af2a7",
"score": "0.72045314",
"text": "def new\n @item = Item.new\n end",
"title": ""
},
{
"docid": "9186e265cb46e9cc8d8a7df22c6012de",
"score": "0.7187222",
"text": "def create\n\t if !params[:item].include?( 'Cancel' )\n\t\t@item = Item.new(params[:item])\n\t\tif @item.save\n\t\t\t flash[:notice] = \"#{@item.name} was added to your inventory.\"\n\t\t\t\t\t \t# why doesn't this work?\n\t\t\t redirect_to item_url(@item) \n\t\t\t\t# error: No route matches {:action=>\"show\", :controller=>\"items\"} ???\n\t\t\t \t#redirect_to( :controller=>\"items\", :action =>\"show\", :id => @item.id ) \n\t\telse\n\t\t\tflash.now[:error] = \"Item could not be created.\"\n\t\t\trender :layout => 'form', :action => 'new' \n\t\tend\n\t else\n\t redirect_to items_url \n\t end\t\t\n end",
"title": ""
},
{
"docid": "69768166e3763971eba32a7ceac7326a",
"score": "0.71829176",
"text": "def item\n @new = New.find(params[:id])\n end",
"title": ""
},
{
"docid": "4b71ad2a5a3c638487198bf4e269f0b0",
"score": "0.7163538",
"text": "def new\n @item = Item.new \n @item.create_date = current_user.new_item_date\n @tags_to_display = \"\"\n end",
"title": ""
},
{
"docid": "5fd5541a0338d7c6834e990260a28ac8",
"score": "0.7103287",
"text": "def set_new_item\n @new_item = NewItem.find(params[:id])\n end",
"title": ""
},
{
"docid": "f1c0e619851c7bc90a8e67309b710663",
"score": "0.7062",
"text": "def create\n @item = Item.new(item_params)\n \n if @item.save\n redirect_to @item\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "621e6d7d00e6e95f569f4daac4610bcc",
"score": "0.70561785",
"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 end\n \n end",
"title": ""
},
{
"docid": "4dc40a82f9027df2d9efb67020f7ba8e",
"score": "0.70517063",
"text": "def create\n @form_item = @template.form_items.build(form_item_params)\n\n respond_to do |format|\n if @form_item.save\n format.html { redirect_to template_path(@template, anchor: :additem), notice: 'Form item was successfully created.' }\n format.json { render :show, status: :created, location: @form_item }\n else\n format.html { render :new }\n format.json { render json: @form_item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "786e9ae9033be85748accd3a3ac55812",
"score": "0.703085",
"text": "def new \t\t\t\t\t\t\t\t\n\t\tadd_to_list(params[:item])\t\t\t# Eintrag in Cookie schreiben\n\t\tredirect_to :action => 'index'\t\t# zurueck zur Listen-Ansicht\n\tend",
"title": ""
},
{
"docid": "cbba650561256de3a6dc66b0c806b953",
"score": "0.70255816",
"text": "def create\r\n @item = Item.new(params[:item])\r\n if @item.save\r\n redirect_to @item, notice: 'Item was successfully created.'\r\n else\r\n render action: \"new\"\r\n end\r\n end",
"title": ""
},
{
"docid": "432408d532bbd0e8d958accf1008ae84",
"score": "0.6993711",
"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": "fa52b1eec9a60fa07dba606e1e91ba84",
"score": "0.69755995",
"text": "def create\n @item = Item.new(params[:item])\n\n if @item.save\n redirect_to :back\n end\n end",
"title": ""
},
{
"docid": "091e802dcff1b8283073d57a5d08833d",
"score": "0.6962415",
"text": "def new\n @page_title = \"New Ingredeient\"\n @ingredient = Ingredient.new\n @btnText = \"Add Ingredient\"\n @obj = @ingredient\n render 'shared/form'\n end",
"title": ""
},
{
"docid": "42fb83d2214651b2ae5e6e5e2843bf3c",
"score": "0.69547975",
"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": "baa1f964e4d2cad93fe8c9036027c826",
"score": "0.69510424",
"text": "def new\n @item = Item.new\n respond_to do |format|\n format.html # new.html.erb\n format.js # new.js.rjs\n format.xml { render :xml => @item }\n end\n end",
"title": ""
},
{
"docid": "f6f391b98729bc25f56e03acc3f9172d",
"score": "0.69137245",
"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": "2fe88de9108449a8cf2e2f808b0944aa",
"score": "0.6908008",
"text": "def new\n @line_item = LineItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end",
"title": ""
},
{
"docid": "854d11d8eb801ab8af5fb0af2f03c14c",
"score": "0.69029635",
"text": "def new\n @todo = TodoItem.new\n # render :new - app/views/pages/new.html.erb\n end",
"title": ""
},
{
"docid": "110ca50bc8fd9c436adc874e0d3639a8",
"score": "0.687951",
"text": "def new\n @item = Item.new\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "3459ccbd615f01412defa78b5c58f077",
"score": "0.6876496",
"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 end\n end",
"title": ""
},
{
"docid": "114b8726be6748ca7e034bb39f2328b8",
"score": "0.6876487",
"text": "def new\n redirect_to help_items_path, :notice => \"Help items can not be added via the user interface. Please contact a Scotch developer.\"\n end",
"title": ""
},
{
"docid": "7b1c59872949e99c9cc9df1978900131",
"score": "0.68709373",
"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 end\n end",
"title": ""
},
{
"docid": "7b1c59872949e99c9cc9df1978900131",
"score": "0.68709373",
"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 end\n end",
"title": ""
},
{
"docid": "f79f0fa3d5d9b9155f2d467a93ae986d",
"score": "0.6862342",
"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.6862342",
"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.6862342",
"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.6862342",
"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.6862342",
"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.6862342",
"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.6862342",
"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.6862342",
"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": "195e0cbb5721621e0387542385cbc429",
"score": "0.6834209",
"text": "def create\n @item = Item.new(item_params)\n @item.save\n redirect_to @item\n end",
"title": ""
},
{
"docid": "095d36c1b06321fe586d9b4a103a5cd8",
"score": "0.68335795",
"text": "def new\n @page_title = \"New Recipe\"\n @recipe = current_user.recipes.build\n @btnText = \"Create Recipe\"\n @obj = @recipe\n render 'shared/form'\n end",
"title": ""
},
{
"docid": "095d36c1b06321fe586d9b4a103a5cd8",
"score": "0.68335795",
"text": "def new\n @page_title = \"New Recipe\"\n @recipe = current_user.recipes.build\n @btnText = \"Create Recipe\"\n @obj = @recipe\n render 'shared/form'\n end",
"title": ""
},
{
"docid": "7ac3b2472f38d418a4116aa1da296603",
"score": "0.68261284",
"text": "def new\n @requisicion = Requisicion.new\n @items=@requisicion.items.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @requisicion }\n end\n end",
"title": ""
},
{
"docid": "e14e32780bf237fa0b7de90ce18c6b3c",
"score": "0.68089426",
"text": "def create\n\n \t\t@item = current_user.items.build(item_params)\n \t\tif @item.save\n \t\t\tflash[:success] = \"Item created!\"\n \t\t\tredirect_to items_path\n \t\telse\n \t\t\t@feed_items = []\n \t\t\trender 'static_pages/home'\n \t\tend\n \tend",
"title": ""
},
{
"docid": "d2ef65923b4af20b0e0bf264edb55527",
"score": "0.67967075",
"text": "def get_new_barcode\n # @item = Item.new\n # redirect_to get_new_item_info_path(@item)\n end",
"title": ""
},
{
"docid": "b3d871a446b2eb58c4fc6fdb1f085111",
"score": "0.6778427",
"text": "def new\n @item = current_user.items.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "9d9df1bb4b5883f2d532c69ed80f29bf",
"score": "0.6778134",
"text": "def new\n\t@meta[:title] = \"DondeVoyAComer.com | Ingresar nuevo local de comida\"\n\t @current_page = \"add\"\n @place = Place.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @place }\n end\n end",
"title": ""
},
{
"docid": "da0d12e4978b885ead3ba582a09dc67a",
"score": "0.6777469",
"text": "def create\n @item = build_item\n\n respond_to do |format|\n if @item.save\n format.html { redirect_to items_path, notice: 'アップロードしたでー' }\n format.json { render action: 'show', status: :created, location: @item }\n else\n format.html { render action: 'new' }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2da3be2543e0279abab71a493120c78f",
"score": "0.6775197",
"text": "def new\n\t\t@item = Product.new\n\tend",
"title": ""
},
{
"docid": "cc6e22b7596cfed4bd4036eafcf0468d",
"score": "0.6771312",
"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": "6e408ac3e7104ca53082e24394a72a42",
"score": "0.6767831",
"text": "def new_page(obj, opts={})\n page do\n form_attr = form_attributes(:action=>url_for(\"create\"))\n Forme.form(obj, form_attr, form_opts(form_attr[:action])) do |f|\n model.columns_for(:new, request).each do |column|\n col_opts = column_options_for(:new, request, obj, column)\n if html = model.edit_html_for(obj, column, :new, request)\n col_opts = col_opts.merge(:html=>html)\n end\n f.input(column, col_opts)\n end\n f.button(:value=>'Create', :class=>'btn btn-primary')\n end\n end\n end",
"title": ""
},
{
"docid": "accab4c6b85f70a138b24b3710cc388a",
"score": "0.6762637",
"text": "def new\n @item = current_user.items.build\n end",
"title": ""
},
{
"docid": "b9af25b3d01562bde6dd013ed72fbf7a",
"score": "0.6757216",
"text": "def new\n @item = Item.new(:list_id => params[:list_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @item }\n end\n end",
"title": ""
},
{
"docid": "44f739facd5243f41be4926212600f73",
"score": "0.6738298",
"text": "def new\n @menu_title = 'Post Item' if @category\n @item = Item.new(category_id: @category.try(:id) )\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
},
{
"docid": "073ac7f1dddd273e2b413ce5972b7f63",
"score": "0.673776",
"text": "def new\n @user = current_user\n @item = current_user.items.build\n respond_to do |format|\n format.json { render :json => @item }\n format.xml { render :xml => @item }\n format.html\n end\n end",
"title": ""
},
{
"docid": "f89f838511b479065ddff2ca222876ef",
"score": "0.67330444",
"text": "def new\n @item_info = ItemInfo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item_info }\n end\n end",
"title": ""
},
{
"docid": "50a506c1f9be05062a4c6b64d037d881",
"score": "0.6731088",
"text": "def new\n @page_title = '新建花销记录'\n @expense_item = ExpenseItem.new\n prepare_for\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @expense_item }\n end\n end",
"title": ""
},
{
"docid": "2f855eeb36e1555b86faf308993a1669",
"score": "0.6718894",
"text": "def newitem\n entry = Pages::Storage::Entry.new(self)\n\n entry.title = ''\n entry.tags = []\n entry.date = Time.new\n entry.content = ''\n entry.draft = false\n\n @items << entry\n\n return entry\n end",
"title": ""
},
{
"docid": "143f19042bb5345ee427a9bb8213be20",
"score": "0.6717627",
"text": "def new\n redirect_to edit_page_path(find_or_create_page)\n end",
"title": ""
},
{
"docid": "78d4fbbc3f7762ae9bad3262935f0c59",
"score": "0.6700744",
"text": "def item_create\n @item = Item.new(item_params)\n respond_to do |format|\n if @item.save\n format.html { redirect_to item_index_path, notice: 'O item foi criado com sucesso.' }\n format.json { render :show, status: :created, location: @item }\n else\n format.html { render :item_new }\n format.json { render json: @item.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c79f3e27fa2ce8b4e111d256d02a0b3a",
"score": "0.66975653",
"text": "def add_item\n\t\tcurrent_user.saved.items.push(Item.find(params[:item]))\n\t\tredirect_to :back\n\tend",
"title": ""
},
{
"docid": "b61797e661369c186ad81911adf70bd5",
"score": "0.6695914",
"text": "def new\n @action_item = ActionItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @action_item }\n end\n end",
"title": ""
},
{
"docid": "a5c3475e5d6f8fd7f1fde1eb0db1c86a",
"score": "0.66943413",
"text": "def new\n params[:item] ||= {}\n @item = \"Vger::Resources::#{params[:item_type]}\".constantize.new(params[:item].merge(:active => true))\n respond_to do |format|\n format.html\n end\n end",
"title": ""
},
{
"docid": "0c2b2bc9d1ce8a41dbe5eda8e4a5c791",
"score": "0.6688462",
"text": "def new\n @components_item = Components::Item.new\n respond_to do |format|\n format.js\n end\n end",
"title": ""
},
{
"docid": "879fc3e648ec3297a803ddec654da8a8",
"score": "0.6677056",
"text": "def new\n render 'new'\n end",
"title": ""
},
{
"docid": "7bea244578364aaf91860d0b40ff0c63",
"score": "0.6676317",
"text": "def new_album_menu_item(sender, selector, data)\n album_title = FXInputDialog.getString(\"My Album\", self,\n \"New Album\", \"Name:\")\n if album_title\n while true\n album = Album.new(:title => album_title)\n if album.save\n @album_list_view << album\n break\n else\n s=[]\n s << \"There were problems with that album.\"\n album.errors.each do |e|\n s << \" - #{e}\"\n end\n album_title = FXInputDialog.getString(album.title, self,\n \"Oops! \", s.join(\"\\n\"))\n break if album_title.nil?\n end\n end\n end\n end",
"title": ""
},
{
"docid": "47e11482b30ee076ad82575111e41d4f",
"score": "0.6676209",
"text": "def new\r\n @item_type = ItemType.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @item_type }\r\n end\r\n end",
"title": ""
},
{
"docid": "fdf7acc967c53463328cf45a96546f9e",
"score": "0.66709423",
"text": "def new\n @showitem = Showitem.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @showitem }\n end\n end",
"title": ""
},
{
"docid": "19879a4effce2b39b8a7d9b2666542a3",
"score": "0.6661568",
"text": "def new\n @item_type = ItemType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @item_type }\n end\n end",
"title": ""
},
{
"docid": "1b0547f70c465deb84a5615f8dda35e7",
"score": "0.66575295",
"text": "def new_next\n @item = Item.new_next(current_user)\n @item.create_date = current_user.new_item_date\n @tags_to_display = \"\" \n end",
"title": ""
},
{
"docid": "de0991e8281c4ad093096806ddede14d",
"score": "0.6643756",
"text": "def show\n #THE FORM FOR THE NEW ORDER IS ON THE SHOW PAGE OF THE BOOK\n @order = Order.new()\n end",
"title": ""
},
{
"docid": "3a807f727f92dffdcb4b1878602192a3",
"score": "0.6637448",
"text": "def new\n @menu_item = MenuItem.new\n\t@ingredients_list = InventoryItem.all\n\t\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @menu_item }\n end\n end",
"title": ""
},
{
"docid": "6deac531f1c84e683641ad76b424eec0",
"score": "0.6633169",
"text": "def new\n @item_selected_name = ItemSelectedName.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item_selected_name }\n end\n end",
"title": ""
},
{
"docid": "f985aeef6078ef93c8d1d4ceda801d04",
"score": "0.66326",
"text": "def new\n @clone_item_request = CloneItemRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @clone_item_request }\n end\n end",
"title": ""
},
{
"docid": "eae6581f37656ce6855591e9f3f7ce4e",
"score": "0.6628711",
"text": "def new\n @lwidth = '20%'\n @rwidth = '0' \n @account = flash[:form_data] || Account.new\n session[:method] = 'new'\n @category_list = [\"Customer\",\"Partner\",\"Reseller\",\"Competitor\"]\n @account.public = true\n Action.add_record(@account.id, session[:email], 'created', 'account', @account.name)\n @items = Action.recent_items\n end",
"title": ""
},
{
"docid": "b5812c86d40192cdd5a823108ae76982",
"score": "0.66248566",
"text": "def new\n @gitem = Gitem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gitem }\n end\n end",
"title": ""
},
{
"docid": "569febf9d59e7b7608cf5ed639d1d853",
"score": "0.661467",
"text": "def create\n\n @item = Item.new(item_params)\n #まだView設定がまだのため仮の登録データ、あとでViewからのデータをitem_paramsで定義します。\n atai = 1\n watasi = \"hoge\"\n\n @item.status = atai\n @item.upper_category = watasi\n @item.middle_category = watasi\n @item.lower_category = watasi\n @item.seller = watasi\n @item.size_type = watasi\n \n \n @item.save\n redirect_to root_path\n # respond_to do |format|\n # if @item.save\n # format.html { redirect_to @item, notice: 'Item was successfully created.' }\n # format.json { render :show, status: :created, location: @item }\n # else\n # format.html { render :new }\n # format.json { render json: @item.errors, status: :unprocessable_entity }\n # end\n # end\n end",
"title": ""
},
{
"docid": "ae6e1430a22d8f6830e42f77ca27468a",
"score": "0.6603968",
"text": "def new\n @admin_item = Admin::Item.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_item }\n end\n end",
"title": ""
},
{
"docid": "8f9b1b7d4fa33762dd791f8eb8d0b545",
"score": "0.65941393",
"text": "def new\n return error_status(true, :cannot_create_listitem) unless (ListItem.can_be_created_by(@logged_user, @list))\n \n @list_item = @list.list_items.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @list_item }\n end\n end",
"title": ""
},
{
"docid": "1c2ca92da2414481b6c8edc18eec1170",
"score": "0.659021",
"text": "def new\n @ordered_item = OrderedItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ordered_item }\n format.json { render :json => @ordered_item }\n end\n end",
"title": ""
},
{
"docid": "9cd0aecbea687686de05d087bb956746",
"score": "0.65888417",
"text": "def new\n @menu_item = uhook_new_menu_item\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @menu_item }\n end\n end",
"title": ""
},
{
"docid": "45e60cb1963983afba17104e2685f8d1",
"score": "0.6586637",
"text": "def new\n @list = List.find(params[:list_id])\n @item = @list.items.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @item }\n end\n end",
"title": ""
}
] |
d8b5e2680b87bb9122cdaf2938fb7ad2
|
PATCH/PUT /franjas/1 PATCH/PUT /franjas/1.json
|
[
{
"docid": "4c7405b6372bcdb1468cb118bc67a2ea",
"score": "0.60574216",
"text": "def update\n respond_to do |format|\n if @franja.update(franja_params)\n format.html { redirect_to @franja, notice: 'La Franja se ha editado correctamente.' }\n format.json { render :show, status: :ok, location: @franja }\n else\n format.html { render :edit }\n format.json { render json: @franja.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "e7663d0348b74542ff1d2f4fd96156fe",
"score": "0.6680832",
"text": "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end",
"title": ""
},
{
"docid": "4e0e59715d19dce2a47fccc2c67326dd",
"score": "0.66611487",
"text": "def patch!\n request! :patch\n end",
"title": ""
},
{
"docid": "4fea5d511e320e86d4f834cc3b2a7cf3",
"score": "0.6458455",
"text": "def update\n respond_to do |format|\n if @prueba_json.update(prueba_json_params)\n format.html { redirect_to @prueba_json, notice: 'Prueba json was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @prueba_json.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8d6a61f3186174209e44862cb0ae05d7",
"score": "0.64387125",
"text": "def patch\n headers = {\"If-Match\" => @version}\n response = @context.request :patch, \"#{@path}/#{@id}\", @data.to_json, headers\n @version += 1\n response\n # 'X-HTTP-Method-Override' => 'PATCH'\n end",
"title": ""
},
{
"docid": "d4ef989d8743bdf8c57e55d4d894dddc",
"score": "0.6388395",
"text": "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end",
"title": ""
},
{
"docid": "61c66428414122f5898ba89e54fc3612",
"score": "0.6375195",
"text": "def update\n @persona = Persona.find(params[:id])\n \n respond_to do |format|\n if @persona.update_attributes(params[:persona])\n format.json { head :ok }\n else\n format.json { render :json => @persona.errors,\n :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "42df8ba024ce54dab184f02761621ecd",
"score": "0.63490534",
"text": "def update_by_body\n @person = Person.find(person_update_params[:id])\n\n if @person.update_attributes(person_update_params)\n render json: { status: 'PUT Success' }, status: :ok\n else\n render json: { status: 'Error', message:'Error updating person', person: @person.errors }, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "c521f46143f44144c5f3e6fa4310c4d2",
"score": "0.625658",
"text": "def update\n respond_to do |format|\n if @json.update(json_params)\n format.html { redirect_to @json, notice: 'Json was successfully updated.' }\n format.json { render :show, status: :ok, location: @json }\n else\n format.html { render :edit }\n format.json { render json: @json.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c521f46143f44144c5f3e6fa4310c4d2",
"score": "0.625658",
"text": "def update\n respond_to do |format|\n if @json.update(json_params)\n format.html { redirect_to @json, notice: 'Json was successfully updated.' }\n format.json { render :show, status: :ok, location: @json }\n else\n format.html { render :edit }\n format.json { render json: @json.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "184d5a6e0e5c05c118c8ef1fe2b2a248",
"score": "0.6232539",
"text": "def update\n respond_to do |format|\n if @frat.update(frat_params)\n format.html { redirect_to @frat, notice: 'Frat was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @frat.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "85d2ed02d760acd40f7badcfec78a18a",
"score": "0.6172439",
"text": "def update!(params)\n res = @client.put(path, nil, params, \"Content-Type\" => \"application/json\")\n @attributes = res.json if res.status == 201\n res\n end",
"title": ""
},
{
"docid": "6b3d6af3e1ade5f41124866b57a6b326",
"score": "0.6159535",
"text": "def patch(path, **args); end",
"title": ""
},
{
"docid": "c3fc4c7dfddfeea7a59b7bc061071f0d",
"score": "0.6145291",
"text": "def update\n @bla = Bla.find(params[:id])\n\n respond_to do |format|\n if @bla.update_attributes(params[:bla])\n format.html { redirect_to @bla, :notice => 'Bla was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bla.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "02238e462f35e91cff024c60401f58ce",
"score": "0.6139318",
"text": "def update\n @person = Person.find(params[:id]) \n respond_to do |format|\n if @person.update(person_params)\n format.json { render json: @person, status: :ok }\n else\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "593a44661145186c50e85fe3c02ffd96",
"score": "0.61390454",
"text": "def patch(path, params = {})\n request(:patch, path, params)\n end",
"title": ""
},
{
"docid": "593a44661145186c50e85fe3c02ffd96",
"score": "0.61390454",
"text": "def patch(path, params = {})\n request(:patch, path, params)\n end",
"title": ""
},
{
"docid": "855f81d29ee8ff100cfefb3479cedcdd",
"score": "0.6135612",
"text": "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend",
"title": ""
},
{
"docid": "e690e0140eff095195310fbfe85a77ed",
"score": "0.612388",
"text": "def update\n @fred = Fred.find(params[:id])\n\n respond_to do |format|\n if @fred.update_attributes(params[:fred])\n format.html { redirect_to @fred, notice: 'Fred was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fred.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6eddf15605851198cb1f19714d1003f9",
"score": "0.61150736",
"text": "def update\n if request.content_type == \"application/json\"\n # .update is like a \"update people set ...\" in sql\n if @person.update(person_params)\n render json: @person\n else\n render json: @person.errors, status: :not_found\n end\n else\n render status: :bad_request\n end\n end",
"title": ""
},
{
"docid": "576f27e4c99d0868b0454fedc7deba0c",
"score": "0.6113841",
"text": "def update # PATCH\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5ba1e573fca43b27ce353ecaf4ea1445",
"score": "0.6100282",
"text": "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"title": ""
},
{
"docid": "5ba1e573fca43b27ce353ecaf4ea1445",
"score": "0.6100282",
"text": "def rest_edit(path, options={}, &blk)\n callback = Proc.new { |*args|\n @object = yield(*args) or pass\n rest_params.each { |k, v| @object.send :\"#{k}=\", v unless k == 'id' }\n\n return 400, @object.errors.to_json unless @object.valid?\n\n @object.save\n rest_respond @object\n }\n\n # Make it work with `Backbone.emulateHTTP` on.\n put path, &callback\n post path, &callback\n end",
"title": ""
},
{
"docid": "95db6e768803a2f7299c9fbe3b15cd20",
"score": "0.608637",
"text": "def actualizacion \n fiesta.update (params[:id]) \n render json: fiesta\n end",
"title": ""
},
{
"docid": "566b79a755478221953c8e53a0770812",
"score": "0.6084561",
"text": "def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"title": ""
},
{
"docid": "566b79a755478221953c8e53a0770812",
"score": "0.6084561",
"text": "def patch options\n rest_request({ method: :patch }.merge(options))\n end",
"title": ""
},
{
"docid": "12faf70207ae533ec70a6f13e34e9a58",
"score": "0.60781014",
"text": "def update\n @frais_repa = FraisRepa.find(params[:id])\n\n respond_to do |format|\n if @frais_repa.update_attributes(params[:frais_repa])\n format.html { redirect_to @frais_repa, :notice => 'Le frais de repas a bien été modifé' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @frais_repa.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e89e1f4225b31cf2dc1822c27265ca1d",
"score": "0.6069736",
"text": "def update\n respond_to do |format|\n if @api_v1_todo.update(api_v1_todo_params)\n format.json { render json: @api_v1_todo, status: :ok }\n else\n format.json { render json: @api_v1_todo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "30049483ea20dd3f8258dc77545ab656",
"score": "0.6064363",
"text": "def update\n @personaje = Personaje.find(params[:id])\n\n respond_to do |format|\n if @personaje.update_attributes(params[:personaje])\n format.html { redirect_to @personaje, notice: 'Personaje was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @personaje.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0afee451b5838dfec6de203b47bb6356",
"score": "0.60637087",
"text": "def update\n @telefon = Telefon.find(params[:id])\n @telefon.update_attributes(params[:telefon])\n respond_with(@telefon)\n end",
"title": ""
},
{
"docid": "e9ef16a0fbdf45f55fd45ba2fdbe9676",
"score": "0.6059119",
"text": "def update\n @spoofer = Spoofer.find(params[:id])\n\n respond_to do |format|\n if @spoofer.update_attributes(params[:spoofer])\n format.html { redirect_to @spoofer, notice: 'Spoofer was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spoofer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22479815e1f1fb93b6842f9fc177fb22",
"score": "0.6050317",
"text": "def update\n respond_to do |format|\n if @fabrica.update(fabrica_params)\n format.html { redirect_to @fabrica, notice: 'Fabrica was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @fabrica.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "129813f878bdb65e40141aa72a205f4e",
"score": "0.6043246",
"text": "def update(&block)\n validate_request()\n\n # Params includes all of the PATCH data at the top level along with other\n # other Rails-injected params like 'id', 'action', 'controller'. These\n # are harmless given no namespace collision and we're only interested in\n # the 'Operations' key for the actual patch data.\n #\n render(json: yield(self.safe_params()[:id], self.safe_params().to_hash()))\n end",
"title": ""
},
{
"docid": "d37b39a795a6e081d6480942ece1c538",
"score": "0.60362595",
"text": "def put!\n request! :put\n end",
"title": ""
},
{
"docid": "1051a4f1c9dc0bc9f4368974c2eb1062",
"score": "0.60351765",
"text": "def update\n respond_to do |format|\n if @fisier.update(fisier_params)\n format.html { redirect_to root_path, notice: 'Fisier was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @fisier.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d12fbc13d258a640a94368623904b957",
"score": "0.6033754",
"text": "def update\n respond_to do |format|\n if @patch.update(patch_params)\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "851c9c03027ad0b0e1cab2781f1dcc83",
"score": "0.6031702",
"text": "def update\n @persona = Persona.find(params[:id])\n\n respond_to do |format|\n if @persona.update_attributes(params[:persona])\n format.html { redirect_to personas_path, notice: 'Persona was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @persona.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a28c66411f7657b3f416a31647d7650d",
"score": "0.6014495",
"text": "def patch(path, data, params = {}, request_options = {})\n request(:patch, path, data, params)\n end",
"title": ""
},
{
"docid": "b90fb19040b453b0881001efec106ea0",
"score": "0.6013152",
"text": "def update\n respond_to do |format|\n if @falta.update(falta_params)\n format.html { redirect_to @falta, notice: \"Falta was successfully updated.\" }\n format.json { render :show, status: :ok, location: @falta }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @falta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1a1ccbf7153d90ad6ce5ccc7b894b68d",
"score": "0.6008127",
"text": "def update\n @fortune = Fortune.find(params[:id])\n\n respond_to do |format|\n if @fortune.update_attributes(params[:fortune])\n format.html { redirect_to @fortune, notice: 'Piosenka pozytywnie zaktualizowana.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fortune.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "931f17c5c899a79322a439bd3a6eca7b",
"score": "0.60074985",
"text": "def update\n @patch = Patch.find(params[:id])\n\n respond_to do |format|\n if @patch.update_attributes(params[:patch])\n format.html { redirect_to @patch, notice: 'Patch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @patch.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "12bbad04a8c6e10ba240594ed4352fd7",
"score": "0.59989965",
"text": "def update\n respond_to do |format|\n format.xml { head :method_not_allowed }\n format.json { head :method_not_allowed }\n end\n end",
"title": ""
},
{
"docid": "96072a31952cc4be672b787df791dec0",
"score": "0.59956235",
"text": "def update\n respond_to do |format|\n if @fondo.update(fondo_params)\n format.html { redirect_to @fondo, notice: 'Fondo was successfully updated.' }\n format.json { render :show, status: :ok, location: @fondo }\n else\n format.html { render :edit }\n format.json { render json: @fondo.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f5272fe85d53d6fa2a180cbb84ab4644",
"score": "0.5980434",
"text": "def activo_update\n respond_to do |format|\n activo = params[:laboratorio][:activo]\n id = params[:id]\n Laboratorio.where(id: id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"title": ""
},
{
"docid": "84f2d68dc84d9c8be9bb908304afea8f",
"score": "0.5972451",
"text": "def update\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n if @servicio.update_attributes(params[:servicio])\n format.html { redirect_to @servicio, :notice => 'Servicio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @servicio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b0fc01b384fb0119c2a1f5121d050842",
"score": "0.59658885",
"text": "def update\n @fucker = Fucker.find(params[:id])\n\n respond_to do |format|\n if @fucker.update_attributes(params[:fucker])\n format.json { head :no_content }\n else\n format.json { render json: @fucker.errors, status: :internal_server_error }\n end\n end\n end",
"title": ""
},
{
"docid": "8ba35241a016a5bd3a06805dbee248c1",
"score": "0.5964432",
"text": "def update\n control_usuario\n respond_to do |format|\n if @franja.update(franja_params)\n format.html { redirect_to @franja, notice: 'La Franja se ha editado correctamente.' }\n format.json { render :show, status: :ok, location: @franja }\n else\n format.html { render :edit }\n format.json { render json: @franja.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f36f9b03227e03a64189638805e60a95",
"score": "0.5957636",
"text": "def update\n# respond_to do |format|\n# if @req.update(req_params)\n format.json { render :json => {:status => 'success'}}\n# format.html { redirect_to @req, notice: 'Req was successfully updated.' }\n# format.json { render :show, status: :ok, location: @req }\n# else\n format.json { render :json => {:status => 'failed'}}\n# format.html { render :edit }\n# format.json { render json: @req.errors, status: :unprocessable_entity }\n# end\n# end\n end",
"title": ""
},
{
"docid": "fb88fef9ffa0d872f40dcfb6a7c29bc5",
"score": "0.5946578",
"text": "def patch(path, opts = {})\n request(:patch, path, opts).body\n end",
"title": ""
},
{
"docid": "ea7bdb00cf81f7423be1bcf34fb2f602",
"score": "0.5943434",
"text": "def update\n respond_to do |format|\n if @persona.update(persona_params)\n format.html {redirect_to personas_url, notice: 'Persona was successfully updated.'}\n format.json {render :show, status: :ok, location: @persona}\n else\n format.html {render :edit}\n format.json {render json: @persona.errors, status: :unprocessable_entity}\n end\n end\n end",
"title": ""
},
{
"docid": "4d0ed93a39c6e51dbd4d695733fc5bd4",
"score": "0.5942399",
"text": "def update\n respond_to do |format|\n if @rest_api.update(rest_api_params)\n format.html { redirect_to @rest_api, notice: 'Rest api was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @rest_api.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a2a5174b75ed2abfb5fff551a50f932a",
"score": "0.59324944",
"text": "def update\n @dependencia = Dependencia.find(params[:id])\n\n respond_to do |format|\n if @dependencia.update_attributes(dependencia_params)\n format.html { redirect_to @dependencia, notice: 'Dependencia se actualizo correctamente.' }\n format.json { head :no_content }\n format.js{}\n else\n format.html { render action: \"edit\" }\n format.json { render json: @dependencia.errors, status: :unprocessable_entity }\n format.js{}\n end\n end\n end",
"title": ""
},
{
"docid": "ab7fd05464f65d8dc0896b54ed9935b2",
"score": "0.5932205",
"text": "def update\n respond_to do |format|\n if @rest.update(rest_params)\n format.html { redirect_to @rest, notice: 'Rest was successfully updated.' }\n format.json { render :show, status: :ok, location: @rest }\n else\n format.html { render :edit }\n format.json { render json: @rest.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7961ba1d763ad0d47914ddcbcf089d8e",
"score": "0.5930726",
"text": "def patch(path, params)\n time(\"PATCH #{path}\") { Cloudflarer.new.patch(path, params) }\n end",
"title": ""
},
{
"docid": "a211c5f1153a600adb88c2a81cb6e48b",
"score": "0.592669",
"text": "def update\n respond_to do |format|\n if @ficheiro.update(ficheiro_params)\n format.html { redirect_to @ficheiro, notice: 'File was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @ficheiro.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "883e83ae6c18c070ec59b56c04a5ceb7",
"score": "0.5918278",
"text": "def update\n respond_to do |format|\n if @resto.update(resto_params)\n format.html { redirect_to @resto, notice: 'Entry was successfully updated.' }\n format.json { render :show, status: :ok, location: @resto }\n else\n format.html { render :edit }\n format.json { render json: @resto.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "407b8bf71f4e73639d8569de23b76d87",
"score": "0.5907231",
"text": "def update\n @foam = Foam.find(params[:id])\n\n respond_to do |format|\n if @foam.update_attributes(params[:foam])\n format.html { redirect_to @foam, notice: 'Foam was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @foam.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6ba77b73cfe2fe254a241f673cfaaf15",
"score": "0.5906156",
"text": "def update\n respond_to do |format|\n if @formalizacao.update(formalizacao_params)\n format.html { redirect_to @formalizacao, notice: 'Formalizacao was successfully updated.' }\n format.json { render :show, status: :ok, location: @formalizacao }\n else\n format.html { render :edit }\n format.json { render json: @formalizacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "909b760f54f181542cb95aee2413689b",
"score": "0.59012663",
"text": "def patch\n end",
"title": ""
},
{
"docid": "c0fdcca7f0bd33ee62ff453d8c4a484b",
"score": "0.5894134",
"text": "def update\n @golfer = Golfer.find(params[:id])\n\n respond_to do |format|\n if @golfer.update_attributes(params[:golfer])\n format.html { redirect_to @golfer, notice: 'Golfer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @golfer.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c42bde476d51212fa13cbbdb620fb4b8",
"score": "0.589306",
"text": "def update_aos_version(args = {}) \n id = args['id']\n temp_path = \"/aosversions.json/{aosVersionId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"aosversionId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend",
"title": ""
},
{
"docid": "2ed994882d1d1b5a84d197da2608a447",
"score": "0.58878094",
"text": "def update\n @todo = Todo.find(params[:id])\n @todo.update_attributes(params[:todo])\n render :json => @todo\n end",
"title": ""
},
{
"docid": "e540d33c3bf5332a65f644e1e8085266",
"score": "0.5876747",
"text": "def update\n respond_to do |format|\n if @fascicle.update(fascicle_params)\n format.html { redirect_to @fascicle, notice: 'Fascicle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @fascicle.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa735ab556d37c70906f6b499be5d74a",
"score": "0.5875968",
"text": "def update\n @oferta = Oferta.find(params[:id])\n\n respond_to do |format|\n if @oferta.update_attributes(params[:oferta])\n format.html { redirect_to [:admin, @oferta], :notice => 'Exemplo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @oferta.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "038dd65f88c5ca8ebb3ccd36caea3f59",
"score": "0.587",
"text": "def update\n @frete = Frete.find(params[:id])\n\n respond_to do |format|\n if @frete.update_attributes(params[:frete])\n format.html { redirect_to @frete, notice: 'Frete was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @frete.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22c8ad9af74017def208534773ebbf2f",
"score": "0.58681935",
"text": "def update\n @todo = Todo.find(params[:id])\n if @todo.update_attributes(todo_params)\n render json: @todo, status: :ok\n else\n render json: @todo.errors, status: 422\n end\n end",
"title": ""
},
{
"docid": "ab2cabde1ed842e750cf89c87b0a4008",
"score": "0.58676714",
"text": "def update\n respond_to do |format|\n if @famille.update(famille_params)\n format.html { redirect_to @famille, notice: 'Famille was successfully updated.' }\n format.json { render :show, status: :ok, location: @famille }\n\t else\n format.html { render :edit }\n end\n end\n end",
"title": ""
},
{
"docid": "d0677deb429289072f1f1c66ca72b8f2",
"score": "0.5865824",
"text": "def update\n @familium = Familium.find(params[:id])\n\n respond_to do |format|\n if @familium.update_attributes(params[:familium])\n format.html { redirect_to @familium, notice: 'Familia fue actualizada existosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @familium.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2ea53bcc6a6ea5f92852634bb0af13b6",
"score": "0.5864513",
"text": "def update\n pai = params[:pai] ? Conta.find_by_id(params[:pai]): nil\n \n respond_to do |format|\n if @conta.update(nome: conta_params[:nome], status: conta_params[:status], pai: pai) \n #format.json { render :show, status: :ok, location: @conta }\n format.json { render json: @conta.to_json, status: :ok }\n else \n format.json { render json: @conta.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "81dcde176dffc5d6552fa34e066787ea",
"score": "0.58638567",
"text": "def update\n @fulcliente = Fulcliente.find(params[:id])\n\n respond_to do |format|\n if @fulcliente.update_attributes(params[:fulcliente])\n format.html { redirect_to @fulcliente, notice: 'Fulcliente was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fulcliente.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "284ad8974db3f64d407dc39a4c771833",
"score": "0.5863746",
"text": "def update\n respond_to do |format|\n if @telefono.update(telefono_params)\n format.html { redirect_to @telefono, notice: 'Telefono was successfully updated.' }\n format.json { render :show, status: :ok, location: @telefono }\n else\n format.html { render :edit }\n format.json { render json: @telefono.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d3abc8887989710dfc28e7e38b9df59f",
"score": "0.5861897",
"text": "def partial_update(klass, id, patchset, options = {}, format = nil)\n headers = {}\n headers[:accept] = \"#{format}\" if format\n format ||= @default_format\n options = { resource: klass, id: id, format: format}.merge options\n if [FHIR::Formats::ResourceFormat::RESOURCE_XML, FHIR::Formats::ResourceFormat::RESOURCE_XML_DSTU2].include?(format)\n options[:format] = FHIR::Formats::PatchFormat::PATCH_XML\n headers[:content_type] = \"#{FHIR::Formats::PatchFormat::PATCH_XML}\"\n elsif [FHIR::Formats::ResourceFormat::RESOURCE_JSON, FHIR::Formats::ResourceFormat::RESOURCE_JSON_DSTU2].include?(format)\n options[:format] = FHIR::Formats::PatchFormat::PATCH_JSON\n headers[:content_type] = \"#{FHIR::Formats::PatchFormat::PATCH_JSON}\"\n end\n headers[:prefer] = @return_preference if @use_return_preference\n reply = patch resource_url(options), patchset, fhir_headers(headers)\n reply.resource = parse_reply(klass, format, reply)\n reply.resource_class = klass\n reply\n end",
"title": ""
},
{
"docid": "175540fec88590d71b29ca3b0ec1c88c",
"score": "0.5845207",
"text": "def update\n respond_to do |format|\n if @appraisal_fee.update(appraisal_fee_params)\n format.html { redirect_to appraisal_fees_path, notice: 'Appraisal fee was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @appraisal_fee.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1b70087586c52d06cb48d10151f49c49",
"score": "0.5840333",
"text": "def update\n respond_to do |format|\n if @factores_fluctuante.update(factores_fluctuante_params)\n format.html { redirect_to @factores_fluctuante, notice: 'Factores fluctuante was successfully updated.' }\n format.json { render :show, status: :ok, location: @factores_fluctuante }\n else\n format.html { render :edit }\n format.json { render json: @factores_fluctuante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bd9ab1132de10ed9da4a7f169979803b",
"score": "0.58392256",
"text": "def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", {\"passed\" => success}.to_json, :content_type => :json\nend",
"title": ""
},
{
"docid": "23a904e6ddd4b6b07c4b53353e78cf93",
"score": "0.58377683",
"text": "def update\n render json: User.update(params[\"id\"], params[\"user\"])\n end",
"title": ""
},
{
"docid": "89dcc849b40f145c8b0be32e5b7169bf",
"score": "0.5833901",
"text": "def update\n respond_to do |format|\n if @foca.update(foca_params)\n format.html { redirect_to @foca, notice: 'Foca atualizada com sucesso.' }\n format.json { render :show, status: :ok, location: @foca }\n else\n format.html { render :edit }\n format.json { render json: @foca.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8f136e3b7cde2fcbcac4d0e6788571ef",
"score": "0.5829354",
"text": "def update\n\n @foaf.interests.clear\n\n if(foaf_params.has_key?(:interests_attributes))\n interest_ids = foaf_params[:interests_attributes].split(\",\").map { |s| s.to_i }\n interest_ids.each do |i|\n @foaf.interests << Interest.find(i)\n #@foaf.update(Interest.find(i))\n end\n \n end\n\n respond_to do |format|\n if @foaf.update(name: foaf_params[:name], work: foaf_params[:work], \n slug: foaf_params[:slug], birthday: foaf_params[:birthday])\n format.html { redirect_to @foaf, notice: 'FOAF was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @foaf.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "24302373fcfc1f2b5d01fcc04a32543f",
"score": "0.58272946",
"text": "def update(data = :object || :json)\n end",
"title": ""
},
{
"docid": "e3fd9fcf8f01b222f74ea9350f91a7a2",
"score": "0.58254117",
"text": "def update\n @futbolada = Futbolada.find(params[:id])\n\n respond_to do |format|\n if @futbolada.update_attributes(params[:futbolada])\n format.html { redirect_to gestion_url, notice: 'Futbolada was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @futbolada.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa6aea3f0f4f44347ec25f10b1164a54",
"score": "0.5822893",
"text": "def update\n respond_to do |format|\n if @persona.update(persona_params)\n format.html { redirect_to @persona, notice: 'Persona was successfully updated.' }\n format.json { render :show, status: :ok, location: @persona }\n else\n format.html { render :edit }\n format.json { render json: @persona.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "22f5285196ae85e55e203175b13d3a84",
"score": "0.5822595",
"text": "def update\n if autenticacion == \"admin\"\n @personaje_sf3 = PersonajeSf3.find(params[:id])\n\n respond_to do |format|\n if @personaje_sf3.update_attributes(params[:personaje_sf3])\n format.html { redirect_to(@personaje_sf3, :notice => 'Personaje sf3 was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @personaje_sf3.errors, :status => :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "222b73ff2db981fa254405eba3f78bba",
"score": "0.58182997",
"text": "def update\n respond_to do |format|\n activo = params[:lab_far][:activo]\n farmacia_id = session[:farmacia_id]\n id = params[:id]\n LabFar.where(laboratorio_id: id, farmacium_id:farmacia_id).update_all(activo: activo )\n msg = { :status => \"ok\", :message => \"Actualizado!\" }\n format.json { render :json => msg }\n end\n end",
"title": ""
},
{
"docid": "13f830a910a81931e1a255c4a0b5e667",
"score": "0.58148885",
"text": "def update\n @jamaat = Jamaat.find(params[:id])\n\n respond_to do |format|\n if @jamaat.update_attributes(params[:jamaat])\n format.html { redirect_to @jamaat, notice: 'Jamaat was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @jamaat.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "27bf2343b43b279f3787ae78d10bd689",
"score": "0.5813845",
"text": "def patch(type, info)\n path, info = type_info(type, :path), force_case(info)\n ida = type == :client ? 'client_id' : 'id'\n raise ArgumentError, \"info must include #{ida}\" unless id = info[ida]\n hdrs = headers\n if info && info['meta'] && (etag = info['meta']['version'])\n hdrs.merge!('if-match' => etag)\n end\n reply = json_parse_reply(@key_style,\n *json_patch(@target, \"#{path}/#{Addressable::URI.encode(id)}\", info, hdrs))\n\n # hide client endpoints that are not quite scim compatible\n type == :client && !reply ? get(type, info['client_id']): reply\n end",
"title": ""
},
{
"docid": "02f3fe37688d2003782ea5e0f2fb3fc3",
"score": "0.5810872",
"text": "def update\n\n respond_to do |format|\n if @funeral.update_attributes(params[:funeral])\n format.html { redirect_to @funeral, notice: 'Funeral was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @funeral.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "59bbfc5e9d1dc917a20e3db81c438ffa",
"score": "0.5809383",
"text": "def contact_updated(freshdesk_data,contact_id)\n\t\t#Rails.logger.info \"Update method id and data\"\n\t\t#Rails.logger.debug \"#{@api_domain}-#{contact_id}-#{@api_key}\"\n\t\t#Rails.logger.debug \"#{freshdesk_data.to_json}\"\n\t response = HTTParty.put(\n\t \"#{@api_domain}contacts/#{contact_id}\", \n\t\t basic_auth: { username: @api_key, password: \"password\" },\n\t\t headers: { 'Content-Type' => 'application/json' },\n\t\t body: freshdesk_data.to_json\n\t )\n\tend",
"title": ""
},
{
"docid": "5d1d0a1cfae8d276693aa145776d8152",
"score": "0.58072793",
"text": "def update\n respond_with []\n end",
"title": ""
},
{
"docid": "9d72302bc12e3c8440c5cdd35fdc604c",
"score": "0.58070916",
"text": "def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"title": ""
},
{
"docid": "9d72302bc12e3c8440c5cdd35fdc604c",
"score": "0.58070916",
"text": "def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"title": ""
},
{
"docid": "9d72302bc12e3c8440c5cdd35fdc604c",
"score": "0.58070916",
"text": "def update_job_success(job_id, success)\n RestClient.put \"#{rest_jobs_url}/#{job_id}\", { 'passed' => success }.to_json, :content_type => :json\nend",
"title": ""
},
{
"docid": "1a433ecf81c60715685d2a06c0bd8593",
"score": "0.58065957",
"text": "def update\n puts \"update #{@feeling.as_json} #{updated_params.as_json}\"\n respond_to do |format|\n if @feeling.update(updated_params)\n puts \"brucep update success\"\n #format.html { redirect_to @feeling, notice: 'Feeling was successfully updated.' }\n format.html { redirect_to new_feeling_path }\n format.json { render :show, status: :ok, location: @feeling }\n #format.js\n else\n format.html { render :edit }\n format.json { render json: @feeling.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "349e1db6dff2a9fbe50b6ebdb9a7c1ab",
"score": "0.58062744",
"text": "def update\n\n @foaf.interests.clear\n\n if(foaf_params.has_key?(:interests_attributes))\n interest_ids = foaf_params[:interests_attributes].split(\",\").map { |s| s.to_i }\n interest_ids.each do |i|\n @foaf.interests << Interest.find(i)\n #@foaf.update(Interest.find(i))\n end\n \n end\n\n respond_to do |format|\n if @foaf.update(name: foaf_params[:name], work: foaf_params[:work], \n slug: foaf_params[:slug], birthday: foaf_params[:birthday])\n format.html { redirect_to @foaf, notice: 'Foaf was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @foaf.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d791df23f2c70865795e9ad803def813",
"score": "0.5805809",
"text": "def update\n respond_to do |format|\n if @feild.update(feild_params)\n format.html { redirect_to @feild, notice: 'Feild was successfully updated.' }\n format.json { render :show, status: :ok, location: @feild }\n else\n format.html { render :edit }\n format.json { render json: @feild.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67c879b6174932ec75d7ed75d144779b",
"score": "0.5805318",
"text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: t('.update_ok') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "debb235ec61df327a9fda5c6d583762b",
"score": "0.58040005",
"text": "def update\n @contact = Contact.find(params[:id])\n @contact.person_id = nil if params[:contact][:person_name].present?\n respond_to do |format|\n if @contact.update_attributes(params[:contact].merge(:updated_by => current_user.id))\n format.html { redirect_to client_contacts_path(@firm), :notice => \"#{ Contact.model_name.human } успешно изменен.\"}\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @contact.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8b7242db696342740424246c9f71fb0e",
"score": "0.58035207",
"text": "def update(resource,identifier,json)\n raise 'Not Yet Implemented'\n end",
"title": ""
},
{
"docid": "f2d1de6475c7936a5e12ebf14b6ac8e0",
"score": "0.58027315",
"text": "def update\n respond_to do |format|\n if @family.update(family_params)\n format.html { redirect_to @family, notice: 'Family was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @family.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "598ce05f6082b7f191b55f93bdaf11d0",
"score": "0.5799802",
"text": "def http_put(path, data, content_type = 'application/json')\n http_methods(path, :put, data, content_type)\n end",
"title": ""
},
{
"docid": "747fdc61174cd877ba0456f338ac6884",
"score": "0.57964975",
"text": "def update\n fn = params[:id].gsub('DOTDOT','.').gsub('SLASHSLASH','/')\n File.open(fn,'w+') { |f| \n f.puts params[:content]\n }\n respond_to do |format|\n format.json { render json: { success: true} }\n end\n end",
"title": ""
},
{
"docid": "1dea1e3fe2651bfb44c2a8469f9eaa2a",
"score": "0.57902026",
"text": "def update\n respond_to do |format|\n if @tipoapreensao.update(tipoapreensao_params)\n format.html { redirect_to @tipoapreensao, notice: 'Tipoapreensao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tipoapreensao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
829eec49525d2bffbb189290e7ffbb7f
|
GET /it_cases GET /it_cases.json
|
[
{
"docid": "0935a2a67b9ed0a673aaa5061ed8f1aa",
"score": "0.767946",
"text": "def index\n @it_cases = ItCase.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @it_cases }\n end\n end",
"title": ""
}
] |
[
{
"docid": "1291cd387b3cc03254957f67fe3ed8db",
"score": "0.7223965",
"text": "def test_cases\n @api.get_cases( :project_id => @project_id, :suite_id => @suite_id, :section_id => @id )\n end",
"title": ""
},
{
"docid": "4dd35b6497ef3b59e503ec1ec0fa7b1f",
"score": "0.7078609",
"text": "def show\n @it_case = ItCase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @it_case }\n end\n end",
"title": ""
},
{
"docid": "be598334a9d0b8b4082efa7072ab5650",
"score": "0.67350334",
"text": "def index\n @cases = Case.all\n @current_nav_item = cases_path\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cases }\n end\n end",
"title": ""
},
{
"docid": "ebfe471a0d779a0cd8a686dcf0f64dbc",
"score": "0.66591084",
"text": "def show\n render :json => Project.find(params[:project_id]).test_sets.find(params[:test_set_id]).cases.find(params[:id])\n end",
"title": ""
},
{
"docid": "3a25cdff279d1b7fe9bc146123dc3350",
"score": "0.6614717",
"text": "def cases\n @cases = current_user.cases.all\n render 'cases/index', :layout => \"application\"\n end",
"title": ""
},
{
"docid": "cde59b472e190e00c160144bdd09d1c1",
"score": "0.65743667",
"text": "def index \n render :json => Project.find(params[:project_id]).test_sets.find(params[:test_set_id]).cases.all\n end",
"title": ""
},
{
"docid": "f68b483a00660c556434a863a373f82c",
"score": "0.6556513",
"text": "def index\n @cases = Case.all\n end",
"title": ""
},
{
"docid": "0c2ed7b51d9af9a175c5b1192a3da042",
"score": "0.6523278",
"text": "def index\n @the_cases = TheCase.all\n end",
"title": ""
},
{
"docid": "7a900d46d56b922a6fc0d73037103470",
"score": "0.64744985",
"text": "def index\n find_cases\n respond_to do |format|\n format.html\n format.js\n end\n end",
"title": ""
},
{
"docid": "8b8ff3d548181f08ecb24f896e7c08a1",
"score": "0.6474118",
"text": "def index\n @cases = Case.all.page(params[:page]).per(10)\n end",
"title": ""
},
{
"docid": "68d6bc6e5fbee17ea99800cd12888e86",
"score": "0.64611083",
"text": "def index\n render jsonapi: Reservations::UseCases::FetchAll.new.call\n end",
"title": ""
},
{
"docid": "9afca6e5866341b868965c5f66561952",
"score": "0.6389286",
"text": "def index\n @contests = Contest.all\n render json: @contests\n end",
"title": ""
},
{
"docid": "0a31901eab3467749d87e3a926502deb",
"score": "0.63843876",
"text": "def index\n @cases = nil\n respond_to do |format|\n format.html { @cases = current_user.cases }\n format.json { @cases = Case.all }\n end\n\n if params[:only_user]\n @cases = current_user.cases\n end\n if not params[:user_id].blank?\n @cases = User.find(params[:user_id].to_i).cases\n end\n\n @cases = @cases.includes(:case_records, :case_users)\n\n # Busqueda en search\n if not params[:rol].nil?\n @cases = @cases.joins(:litigantes).where('lower(rol) LIKE ?', '%' + params[:rol].downcase + '%').uniq\n # Busqueda por dynatable\n elsif not params[:queries].nil? and not params[:queries][:search].nil?\n @cases = @cases.joins(:litigantes).where(\n 'lower(rol) LIKE :search OR\n lower(tribunal) LIKE :search OR\n lower(caratula) LIKE :search OR\n lower(info_type) LIKE :search OR\n lower(litigantes.nombre) LIKE :search OR\n lower(litigantes.rut) LIKE :search',\n search: '%' + params[:queries][:search].downcase + '%').uniq\n end\n if not params[:page].blank? and not params[:per_page].blank?\n @cases = @cases.paginate(:page => params[:page].to_i, :per_page => params[:per_page].to_i)\n end\n if not params[:order].blank?\n atributo = params[:order].keys[0].to_s == 'portal' ? 'info_type' : params[:order].keys[0].to_s\n @cases = @cases.order(atributo + ' ' + (params[:order].values[0].to_i == 1 ? 'DESC':'ASC'))\n end\n @cases = @cases.all\n end",
"title": ""
},
{
"docid": "5f7386ed49b41725ac360192f42ea018",
"score": "0.63440037",
"text": "def index\n render jsonapi: TicketDesks::UseCases::FetchAll.new.call\n end",
"title": ""
},
{
"docid": "2dd132ef43af951f29b77fdc97f32b30",
"score": "0.6325772",
"text": "def show\n @cases = Case.all\n end",
"title": ""
},
{
"docid": "699d036abc29a89aea76e71b4f0c9d0d",
"score": "0.6268",
"text": "def show\n @case = Case.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @case }\n end\n end",
"title": ""
},
{
"docid": "cfb3b87d41ea1ecf38b45457bac9548a",
"score": "0.6223309",
"text": "def index\n render jsonapi: Tickets::UseCases::FetchAll.new.call\n end",
"title": ""
},
{
"docid": "ed7055bdc1605723bbf82a605eb9dfe8",
"score": "0.6221337",
"text": "def cases\n @user = current_user\n @item = Item.new\n @item.images.build\n\n @cases = current_user.cases.all\n\n render \"#{target_user}_cases\", :layout => \"application\"\n end",
"title": ""
},
{
"docid": "fd1bbce6e3940dc3b9949c0ddd6b9b5d",
"score": "0.61877286",
"text": "def cases(project_id, suite_id, filters = {})\n get(\"get_cases/#{project_id}&suite_id=#{suite_id}\",\n params: {\n section_id: filters[:section_id],\n created_after: filters[:created_after],\n created_before: filters[:created_before],\n created_by: filters[:created_by].to_list,\n milestone_id: filters[:milestone_id].to_list,\n priority_id: filters[:priority_id].to_list,\n type_id: filters[:type_id].to_list,\n updated_after: filters[:updated_after],\n updated_before: filters[:updated_before],\n updated_by: filters[:updated_by].to_list\n })\n end",
"title": ""
},
{
"docid": "569d48f8e258a048035f473c1d9a0bdb",
"score": "0.6150415",
"text": "def index\n require 'pp'\n @case_files = CaseFile.by_id\n respond_to do |format|\n format.json\n end\n end",
"title": ""
},
{
"docid": "6e4ec302ba2046d6eaa99a8356381f3e",
"score": "0.61323583",
"text": "def show\n @test_case = TestCase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @test_case }\n end\n end",
"title": ""
},
{
"docid": "6e4ec302ba2046d6eaa99a8356381f3e",
"score": "0.61323583",
"text": "def show\n @test_case = TestCase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @test_case }\n end\n end",
"title": ""
},
{
"docid": "0a1c06771c50bad8544f0ea723311a70",
"score": "0.6123267",
"text": "def index\n\t\t@client_cases = ClientCase.all\n\t\t@client_case = ClientCase.new\n\n\tend",
"title": ""
},
{
"docid": "7439546e850654967f1171805c4e3f51",
"score": "0.61097217",
"text": "def index\n @problem_cases = ProblemCase.all\n end",
"title": ""
},
{
"docid": "e6490d82ec2d44060901a754a882dc9d",
"score": "0.61031675",
"text": "def show\n @bi_testcase = BiTestcase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bi_testcase }\n end\n end",
"title": ""
},
{
"docid": "678fe4d11296e7536799bec567192df1",
"score": "0.6090179",
"text": "def show\n @icd = Icd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @icd }\n end\n end",
"title": ""
},
{
"docid": "9024e650aff65c4f6318d55ed1e37997",
"score": "0.6079732",
"text": "def show\n render jsonapi: TicketDesks::UseCases::FetchOne.new.call(id: params[:id])\n end",
"title": ""
},
{
"docid": "09cecfd9b29085eac9f6cda50f424502",
"score": "0.60613734",
"text": "def index\n render jsonapi: Halls::UseCases::FetchAll.new.call\n end",
"title": ""
},
{
"docid": "d12133571081bbb490bf81f2f0ac3507",
"score": "0.60528445",
"text": "def index\n @result_cases = ResultCase.all\n end",
"title": ""
},
{
"docid": "3ff3fd44ed94951e511d480f5c09b281",
"score": "0.6044953",
"text": "def show\n render jsonapi: Reservations::UseCases::FetchOne.new.call(id: params[:id])\n end",
"title": ""
},
{
"docid": "b78302b068048b7d43ec3cee820ff4dd",
"score": "0.6041803",
"text": "def index\n @contests = Contest.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contests }\n end\n end",
"title": ""
},
{
"docid": "f85773ee9d8e483383e0c267bf2dc814",
"score": "0.6020265",
"text": "def show\n @contest = Contest.find(params[:id])\n @entries = Entry.where({contest_id: params[:id]})\n render json: {info: @contest, entries: @entries}\n end",
"title": ""
},
{
"docid": "67dfa59750adf0b55c64679a62da577c",
"score": "0.59925246",
"text": "def index\n if current_user== current_user.level >100\n @showcases = Showcase.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @showcases }\n end\n end\n end",
"title": ""
},
{
"docid": "b3acd1c81cce7a6bfe6b75559d44de47",
"score": "0.59795153",
"text": "def show\n @hivcase = Hivcase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @hivcase }\n end\n end",
"title": ""
},
{
"docid": "f04882b1c452ef02e5409655cdd671a6",
"score": "0.5975561",
"text": "def index\n render jsonapi: Movies::UseCases::FetchAll.new.call\n end",
"title": ""
},
{
"docid": "65c0b494a365c05e03aa5f354a072b68",
"score": "0.5975005",
"text": "def index\n @cases = Case.all\n # @devices = Device.all\n end",
"title": ""
},
{
"docid": "6417ab547e9158fbb2fca13227905f91",
"score": "0.5973603",
"text": "def index\n @casefiles = Casefile.all\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @casefiles }\n end\n end",
"title": ""
},
{
"docid": "2be6ede8d9ac10247e70641f19515378",
"score": "0.5966247",
"text": "def show\n render jsonapi: Tickets::UseCases::FetchOne.new.call(id: params[:id])\n end",
"title": ""
},
{
"docid": "75a1e95e9495a830d0dd301de7d889dc",
"score": "0.59616613",
"text": "def show\n @judge = Judge.find(params[:id])\n @training_sessions = @judge.training_sessions\n @cases = @judge.cases\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @judge }\n end\n end",
"title": ""
},
{
"docid": "480b16bb914f3a544cba8a905ea14c02",
"score": "0.5957971",
"text": "def show\n render jsonapi: Halls::UseCases::FetchOne.new.call(id: params[:id])\n end",
"title": ""
},
{
"docid": "311c578a4e9c3967b09d37ef443f5e16",
"score": "0.5952834",
"text": "def index\n @yfcases = Yfcase.all\n end",
"title": ""
},
{
"docid": "311c578a4e9c3967b09d37ef443f5e16",
"score": "0.5952834",
"text": "def index\n @yfcases = Yfcase.all\n end",
"title": ""
},
{
"docid": "b23ed36b47b1f046fcd59f6fbaac0d8e",
"score": "0.5946028",
"text": "def get_showcases\n if request.headers['email'].blank?\n if authenticate_with_default_key\n showcases = User.get_showcases(params)\n if showcases\n response_map={:showcases => showcases}\n render json: response_map, status: 200\n else\n render json:{:response=>\"failed\"}, status:422\n end\n end\n else\n if authenticate_action\n showcases = User.get_showcases(params)\n if showcases\n response_map={:showcases => showcases}\n render json: response_map, status: 200\n else\n render json:{:response=>\"failed\"}, status:422\n end\n end\n end\n\n end",
"title": ""
},
{
"docid": "c95baedeb91426165ba87d72ceb2fb22",
"score": "0.5935055",
"text": "def get_web_showcases\n showcases = User.get_showcases(params)\n if showcases\n response_map={:showcases => showcases}\n\n if params[:callback].blank?\n render json: response_map, status: 200\n else\n render json: response_map, callback: params[:callback], status: 200\n end\n else\n render json:{:response=>\"failed\"}, status:422\n end\n end",
"title": ""
},
{
"docid": "653f7ecd6889b1534f4c63982a35535c",
"score": "0.5926395",
"text": "def show\n @tbcase = Tbcase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @tbcase }\n end\n end",
"title": ""
},
{
"docid": "ee97173fcddf878d484286faeb33ae6c",
"score": "0.5922513",
"text": "def index\n @test_cases = TestCase.all\n end",
"title": ""
},
{
"docid": "34726f22d8fff7f731edf863a29ce904",
"score": "0.5902818",
"text": "def bot_testcase\n @submission = Submission.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @submission.get_test_cases }\n end\n end",
"title": ""
},
{
"docid": "dab62a78bc500886d7e0e0b8c67d831a",
"score": "0.5877906",
"text": "def new\n @case = Case.new\n @clients = Client.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @case }\n end\n end",
"title": ""
},
{
"docid": "4196526d842d8489d8fe783330a4d837",
"score": "0.58729136",
"text": "def index\n @caseworks = Casework.all\n end",
"title": ""
},
{
"docid": "127e59742e53a54182274c221aa547fa",
"score": "0.58719486",
"text": "def cases()\n return MicrosoftGraph::Security::Cases::CasesRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "60ca35be7b65e5c1a7b3b6018cf664ea",
"score": "0.58641684",
"text": "def index\n @state_cases = StateCase.all\n end",
"title": ""
},
{
"docid": "f00acaa526245ff28c9d6e810b212a8b",
"score": "0.5862484",
"text": "def index\n\t\tif @surgery_case.present?\n \t render json: { success: true, response: @surgery_case.as_json('case_media_index') },:status=> 200\n\t else\n\t render :json=> { success: false, message: \"Cases are not present\" },:status=> 203\n\t end \n\tend",
"title": ""
},
{
"docid": "416cd35873760bbcade9996effad6246",
"score": "0.58567435",
"text": "def get_cases_by_email\n service_response = AdminManagement::Kyc::GetByEmail.new(params).perform\n render_api_response(service_response)\n end",
"title": ""
},
{
"docid": "da998dbc8ee9c31e94446eab1cedd8e0",
"score": "0.5822651",
"text": "def index\n @cases = Case.where(\"amount_needed > #{:amount_obtained}\" ).verified.page params[:page]\n @governorates = Governorate.all\n @cities = City.all\n # @cases =Case.all.page params[:page]\n end",
"title": ""
},
{
"docid": "d404275d8cfc32c3d67b93474a7dd9b0",
"score": "0.5822563",
"text": "def show\n @image = Image.find(params[:id])\n @cases = Case.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @image }\n end\n end",
"title": ""
},
{
"docid": "52aedc33d9941093eb1cbf3eb98d5a29",
"score": "0.5822173",
"text": "def show\n @contest = Contest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contest }\n end\n end",
"title": ""
},
{
"docid": "0842ac2a9e3d330e0bebb5f4ccc85c70",
"score": "0.5814051",
"text": "def show\n @testcase = Testcase.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @testcase }\n end\n end",
"title": ""
},
{
"docid": "5dd1b1ed7910063940aa8129e5378a1a",
"score": "0.57990086",
"text": "def show\n @testcase = Testcase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @testcase }\n end\n end",
"title": ""
},
{
"docid": "5dd1b1ed7910063940aa8129e5378a1a",
"score": "0.57987726",
"text": "def show\n @testcase = Testcase.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @testcase }\n end\n end",
"title": ""
},
{
"docid": "a65d88c4edb7b1c9685f1c719412e71c",
"score": "0.5786899",
"text": "def index\r\n @case_notes = @client.case_notes.paginate :page => params[:page], :per_page => 10, :order => \"created_at DESC\"\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @case_notes }\r\n end\r\n end",
"title": ""
},
{
"docid": "a6fca1c935dd7d1182659b679b61ab7e",
"score": "0.57800996",
"text": "def show\n @cases = @test.cases\n end",
"title": ""
},
{
"docid": "cd9e6b920e7abaa737191b7e992385db",
"score": "0.5768487",
"text": "def overview\n response = @connection.get \"/contest/#{MPC_TOKEN}\"\n response.body\n end",
"title": ""
},
{
"docid": "2c9f87f86c3c8b5170c1b67f0729b329",
"score": "0.5767363",
"text": "def index\n @casestories = Casestory.all\n end",
"title": ""
},
{
"docid": "a383e87254c0d998528669c8a0b1ab87",
"score": "0.5766044",
"text": "def index\n @vitals = Vital.all\n render json: @vitals\n end",
"title": ""
},
{
"docid": "a128936b3396bbda5bc4a12bcb485e1b",
"score": "0.57586974",
"text": "def show\n @case = Case.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @case }\n format.json { render :json => custom_item_hash(@case) }\n end\n end",
"title": ""
},
{
"docid": "6e23a0b797f6b41266fc37bc2159f89f",
"score": "0.57583684",
"text": "def index\n @entries = @contest.entries.active\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @entries }\n end\n end",
"title": ""
},
{
"docid": "0cd33643ad00899023852442bdfce6d5",
"score": "0.57405925",
"text": "def index\n @testcases = Testcase.all\n end",
"title": ""
},
{
"docid": "8d4ec36722f117af76d61e7c89699306",
"score": "0.57399493",
"text": "def get_discipline_list\n response = RestClient.get(\"http://www.gw2spidy.com/api/v0.9/json/disciplines\")\n disciplines = JSON.parse(response)\n disciplines[\"results\"]\nend",
"title": ""
},
{
"docid": "86c03cb0e537d58d7764d02d1329fb1c",
"score": "0.57316554",
"text": "def show\n @courtstation = Courtstation.find(params[:courtstation_id])\n @casefile = @courtstation.casefiles.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @casefile }\n end\n end",
"title": ""
},
{
"docid": "c197d4c432b448549fe3e06e123f1517",
"score": "0.5730977",
"text": "def show\n @casestudy = Casestudy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @casestudy }\n end\n end",
"title": ""
},
{
"docid": "c197d4c432b448549fe3e06e123f1517",
"score": "0.5730977",
"text": "def show\n @casestudy = Casestudy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @casestudy }\n end\n end",
"title": ""
},
{
"docid": "003cb2a7f931c59a92feca10b0669d2b",
"score": "0.5728756",
"text": "def index\n @ivs = Iv.all\n render json: @ivs\n end",
"title": ""
},
{
"docid": "3d800afb6bc44d6e7c45f8c3341104a2",
"score": "0.5727787",
"text": "def show\n @discipline = Discipline.find(params[:id])\n @nivdisciplines = Nivdiscipline.where(discipline_id: @discipline.id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @discipline }\n end\n end",
"title": ""
},
{
"docid": "6276ebae77412e058d5a76e59d288f21",
"score": "0.5727771",
"text": "def index\n @contests = Contest.active\n respond_with(@contests)\n\n end",
"title": ""
},
{
"docid": "3f34e5719975fcb47772045a774490e6",
"score": "0.5723895",
"text": "def current_case_status\n redirect_to(root_url) && return unless current_user.can_edit_patient?\n\n patient_ids = params[:patient_ids]\n patients = current_user.viewable_patients.where(id: patient_ids)\n render json: { case_status: patients.pluck(:case_status), isolation: patients.pluck(:isolation), monitoring: patients.pluck(:monitoring) }\n end",
"title": ""
},
{
"docid": "f1ace855702a89f0601d46b7a9431f27",
"score": "0.57165843",
"text": "def index\n @course = Course.find(params[:course_id])\n @disciplines = Discipline.where(:course_id => params[:course_id])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @disciplines }\n end\n end",
"title": ""
},
{
"docid": "b2ecc9edcfe3145f5c708cad95650aff",
"score": "0.571586",
"text": "def index\n @workout_exercises = WorkoutExercise.all\n\n render json: @plan_workout\n end",
"title": ""
},
{
"docid": "873d4253efccfdab2cf0a471e5ca15d0",
"score": "0.5715659",
"text": "def show\n @case_study = CaseStudy.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @case_study }\n end\n end",
"title": ""
},
{
"docid": "51c403d065ff116a25f86317527d484a",
"score": "0.5712633",
"text": "def index\n @pc_cases = PcCase.paginate(page: params[:page], per_page: 4)\n end",
"title": ""
},
{
"docid": "bf30b7c45ec53b8eacda3362a562b6ec",
"score": "0.5710723",
"text": "def index\n @legal_cases = LegalCase.all\n end",
"title": ""
},
{
"docid": "e98f45c9ce3fe45b114af85d6b54e7e7",
"score": "0.5703908",
"text": "def show\n @p=PoliceStation.find(params[:id])\n @the_cases=@p.the_cases\n end",
"title": ""
},
{
"docid": "9a14d82b3389f8852e56801a70289c7b",
"score": "0.56962734",
"text": "def index\n @citizens_tasks = CitizensTask.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @citizens_tasks }\n end\n end",
"title": ""
},
{
"docid": "fa2e49e0b370a4543735eed2afad9288",
"score": "0.56912875",
"text": "def show\n @test_case_result = TestCaseResult.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @test_case_result }\n end\n end",
"title": ""
},
{
"docid": "4fecbae0968ecd0c3654bd1bec89077a",
"score": "0.56872493",
"text": "def index\n @problem = Problem.find(params[:problem_id])\n if params[:problem_id]\n permitted_to! :inspect, @problem\n logger.debug \"problem is \" + params[:problem_id]\n @test_cases = @problem.test_cases\n else\n raise Pundit::NotAuthorizedError\n @test_cases = @test_cases.distinct\n end\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @test_cases }\n end\n end",
"title": ""
},
{
"docid": "737edcda74919292b1ec1c6c85026559",
"score": "0.56768674",
"text": "def index\n @cie10s = Cie10.all\n\n respond_to do |format|\n format.json { render :json => @cie10s }\n end\n\n end",
"title": ""
},
{
"docid": "cbe28c2a479538ae7f304702b72a3602",
"score": "0.56658524",
"text": "def index\n\t # get the current surgeon of the all case details\n\t @cases = current_user.cases.order_by(:surgery_date=> :asc).collect{|surgery_case| surgery_case if (surgery_case.surgery_date.to_date.past? || surgery_case.surgery_date.to_date.today?)}.reject(&:blank?).take(10)\n\tend",
"title": ""
},
{
"docid": "a42672db56eb7f67cdd97b948dac6829",
"score": "0.56631625",
"text": "def cities\n self.class.get(\"/v1/cities\")\n end",
"title": ""
},
{
"docid": "7276f7e63862df5af4620d4556907d3a",
"score": "0.56573355",
"text": "def index\n bool = ActiveRecord::Type::Boolean.new\n\n archived = bool.deserialize(params[:archived]) || false\n sort_by = params[:sortBy]\n @deep = bool.deserialize(params[:deep]) || false\n\n if archived\n @no_tries = true\n @no_teams = false\n @cases = Case.where(archived: archived, owner_id: current_user.id).all\n else\n @cases = if 'last_viewed_at' == sort_by\n current_user.cases_involved_with.not_archived.includes(:metadata).references(:metadata)\n .order(Arel.sql('`case_metadata`.`last_viewed_at` DESC, `cases`.`id`')).limit(3)\n elsif sort_by\n current_user.cases_involved_with.preload( :tries).not_archived.order(sort_by)\n else\n current_user.cases_involved_with.preload(:tries, :teams,\n :cases_teams)\n .not_archived\n .left_outer_joins(:metadata)\n .order(Arel.sql('`case_metadata`.`last_viewed_at` DESC, `cases`.`updated_at` DESC'))\n end\n end\n\n respond_with @cases\n end",
"title": ""
},
{
"docid": "a9c5ddce83c5afe5e090c2c4241dfcaf",
"score": "0.56486624",
"text": "def index\n @assessment_iits = AssessmentIit.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json:@assessment_iits }\n end\n end",
"title": ""
},
{
"docid": "b5ef1b72f7a32756f66213423586b0bd",
"score": "0.564032",
"text": "def show\n @the_case=TheCase.find_by_id(params[:id])\n @victims=@the_case.victims\n @culprits=@the_case.culprits\n @proofs=@the_case.proofs\n @waitnesses=@the_case.waitnesses\n end",
"title": ""
},
{
"docid": "65db7ec8641ce5a9f0c8de0e52e29c57",
"score": "0.5639975",
"text": "def index\n @estadisticas = Estadistica.all\n render json: @estadisticas, status: :ok\n end",
"title": ""
},
{
"docid": "7ecdd5960879b6a7266eecebea40819b",
"score": "0.5638929",
"text": "def index\n @iacs = Iac.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @iacs }\n end\n end",
"title": ""
},
{
"docid": "2bdf9bc9e23a44f3ca97397d40dc7ffe",
"score": "0.56365657",
"text": "def index\n @councils = Council.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @councils }\n end\n end",
"title": ""
},
{
"docid": "bfa538489ebb1e31fa0c98753e1a1384",
"score": "0.56283396",
"text": "def index\n @caseworkers = Caseworker.all\n authorize! :read, Caseworker\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @caseworkers }\n end\n end",
"title": ""
},
{
"docid": "d0c50cb9b59ef8bd8c3afd6d5f681bca",
"score": "0.5625953",
"text": "def index\n @contests = Contest.all\n end",
"title": ""
},
{
"docid": "4413804b1df412bf067cf8384a12792a",
"score": "0.562551",
"text": "def show_cases(cases)\r\n p\r\n unless cases.empty?\r\n headings = ['BugID', 'Status', 'Title', 'Assigned To']\r\n rows = []\r\n if configatron.output.colorize\r\n cases.each do |c|\r\n status = c['sStatus']\r\n if status == 'Active'\r\n status = colorize(status, configatron.colors.green)\r\n elsif status =~ /Resolved/\r\n status = colorize(status, configatron.colors.cyan)\r\n elsif status =~ /Closed/\r\n status = colorize(status, configatron.colors.magenta)\r\n end\r\n rows << [ c['ixBug'], status, c['sTitle'], c['sPersonAssignedTo'] ]\r\n end\r\n else\r\n cases.each do |c|\r\n rows << [ c['ixBug'], c['sStatus'], c['sTitle'], c['sPersonAssignedTo'] ]\r\n end\r\n end\r\n print_table headings, rows\r\n else\r\n print_message 'No open cases were found that match your query.', :warn\r\n end\r\n end",
"title": ""
},
{
"docid": "1f1a2c581a3c466daacd589822b66575",
"score": "0.56101835",
"text": "def index\n\t\t@iterations = @idea.iterations.all\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @iterations }\n\t\tend\n\tend",
"title": ""
},
{
"docid": "98208b4e025e01f8b90d008c72a0e542",
"score": "0.5610093",
"text": "def index\n @api_cities = Api::City.all\n\n render json: @api_cities\n end",
"title": ""
},
{
"docid": "30bdd9412ef2949d9d77bbe390686f65",
"score": "0.5608194",
"text": "def index\n @cites = Cite.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cites }\n end\n end",
"title": ""
},
{
"docid": "76998b63045bd35a51d67ed3019b6229",
"score": "0.56030387",
"text": "def index\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contests }\n end\n end",
"title": ""
}
] |
16ff7029e9a37a653b88a6f255cc2ee8
|
Common to both OS X & Linux
|
[
{
"docid": "0fd7677e288effb5d87ed5cd6179eb58",
"score": "0.0",
"text": "def awk\n %{awk -F\"[: ]+\" '/inet /}\n end",
"title": ""
}
] |
[
{
"docid": "32d28cce86357f9e1f1b767587e67fc6",
"score": "0.7201171",
"text": "def host_os; end",
"title": ""
},
{
"docid": "32d28cce86357f9e1f1b767587e67fc6",
"score": "0.7201171",
"text": "def host_os; end",
"title": ""
},
{
"docid": "ea9711643e3f0bda12ce6c88b5ab9c85",
"score": "0.69855213",
"text": "def mac? ; RUBY_PLATFORM =~ /.*(sal|86).*-darwin1/i end",
"title": ""
},
{
"docid": "215a60d396b37e8a60a3d39eaca78076",
"score": "0.6882984",
"text": "def linux?\n unix? and not mac?\n end",
"title": ""
},
{
"docid": "2a23c6ac8fc93687047c6cb31dc3ed9a",
"score": "0.6866397",
"text": "def host_os_family; end",
"title": ""
},
{
"docid": "04e6c6eb0d0869b7d3882296690ee109",
"score": "0.68305784",
"text": "def mac?\n RUBY_PLATFORM =~ /darwin/i\nend",
"title": ""
},
{
"docid": "ea2896166db9ba230493e804d25e45ea",
"score": "0.681404",
"text": "def linux?\n !darwin?\n end",
"title": ""
},
{
"docid": "81f0ec068053467300fde364a1bac5da",
"score": "0.6812448",
"text": "def linux?\n unix? and not mac?\n end",
"title": ""
},
{
"docid": "920d048b6765b76c2ef2b226a57e7b90",
"score": "0.67559004",
"text": "def platform; RUBY_PLATFORM; end",
"title": ""
},
{
"docid": "cb6df8080e0c960405004ef808667d4f",
"score": "0.66891646",
"text": "def linux? ; RUBY_PLATFORM =~ /linux/i end",
"title": ""
},
{
"docid": "469a197e2fdb823e7a686242b6e1b63c",
"score": "0.6649943",
"text": "def os_x?\n RUBY_PLATFORM.match(/darwin/)\n end",
"title": ""
},
{
"docid": "7c857c0e7d6ebf65d007efc96560c8ec",
"score": "0.6510223",
"text": "def linux?\n RUBY_PLATFORM =~ /linux/i\nend",
"title": ""
},
{
"docid": "193db0d9398fed30055dcf1895e8a1f8",
"score": "0.64770526",
"text": "def osx?(platform = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "01e2f26061008cfc0369a099c309c43e",
"score": "0.64723027",
"text": "def os_other\n\t\t\t\t\tnot_os_osx.not_os_linux.not_os_netbsd.not_os_freebsd.not_os_cisco.not_os_vxworks.not_os_vmware_esx.not_os_windows.not_os_aix\n\t\t\t\tend",
"title": ""
},
{
"docid": "4df2c26d47258481e478bc558508a217",
"score": "0.64603156",
"text": "def darwin?\n RUBY_PLATFORM.include?('darwin')\n end",
"title": ""
},
{
"docid": "bf1061af6955459ba5be6f473cdae160",
"score": "0.6453694",
"text": "def isLinux()\n RUBY_PLATFORM.include? \"linux\"\nend",
"title": ""
},
{
"docid": "6c6f10f9092bacc6e9477658fa3fe759",
"score": "0.63791704",
"text": "def mac_mri?; end",
"title": ""
},
{
"docid": "03c852c892a4ef38a62fd374afb03b1e",
"score": "0.6354833",
"text": "def mac?\n (/darwin/ =~ RUBY_PLATFORM) != nil\n end",
"title": ""
},
{
"docid": "8ec372bfaf6eab4b799841bfc15f5b5e",
"score": "0.6348053",
"text": "def ruby_platform\n case RUBY_PLATFORM\n when /win32|mswin|mingw/\n # Works on Windows XP, 2003, 7, 8 running Ruby 1.8.6 & 1.8.7, 1.9.2, 1.9.3 & 2.0.0 installed from RubyInstaller\n # Can't match for just 'win' cause it will match darwin as well.\n 'windows'\n when /linux/\n # Works on Debian Sarge, Lenny & Wheezy and Ubuntu 9.10 running REE 1.8.7 & MRI 2.0.0 32-bit & 64-bit, don't have anything else to test on.\n 'linux'\n when /darwin/\n # Works on my MacBook Pro OS 10.6 running Ruby 1.8.7 and .rbenv version of 1.9.3 & 2.0.0 , don't have anything else to test on,\n 'mac'\n else\n nil\n end\nend",
"title": ""
},
{
"docid": "ff3e4384919bd18ba77f7d2eac879c20",
"score": "0.6338228",
"text": "def supported_platform?\n linux? || darwin?\n end",
"title": ""
},
{
"docid": "467e498fe8e6fbdb08f64e8a5162e382",
"score": "0.6338073",
"text": "def linux?\n %w(debian redhat ubuntu).include?(os[:family])\nend",
"title": ""
},
{
"docid": "f032991b1d8b5e3830f6385abdd27c8f",
"score": "0.63224685",
"text": "def myOs\n if OS.windows?\n \"Windows\"\n elsif OS.linux?\n \"Linux\"\n elsif OS.mac?\n \"Osx\"\n else\n \"Não consegui indentificar!\"\n end\nend",
"title": ""
},
{
"docid": "114d0d9c60ce69e2dbe5525fc2f8d0a5",
"score": "0.6315916",
"text": "def detect_os\n @@os_features ||= nil\n return @@os_features if @@os_features\n @@os_features ||= {}\n\n # Mac Miner\n mac_miner = lambda do\n version = `sw_vers -productVersion`.match(/\\d+\\.\\d+(?:\\.\\d+)?/)[0]\n @@os_features.merge!({\n :platform => \"darwin\",\n :os_distro => \"Mac OSX\",\n :os_version => version,\n :os_nickname => case version.split(\".\")[0..1].join(\".\")\n when \"10.0\"; \"Cheetah\"\n when \"10.1\"; \"Puma\"\n when \"10.2\"; \"Jaguar\"\n when \"10.3\"; \"Panther\"\n when \"10.4\"; \"Tiger\"\n when \"10.5\"; \"Leopard\"\n when \"10.6\"; \"Snow Leopard\"\n when \"10.7\"; \"Lion\"\n when \"10.8\"; \"Mountain Lion\"\n when \"10.9\"; \"Mavericks\"\n when \"10.10\"; \"Yosemite\"\n else; \"Unknown Version of OSX\"\n end,\n :install_method => \"install\",\n :hostname => `hostname`.chomp,\n })\n if Pathname.which(\"brew\")\n @@os_features[:install_cmd] = \"brew install\"\n elsif Pathname.which(\"port\")\n @@os_features[:install_cmd] = \"port install\"\n else\n @@os_features[:install_method] = \"build\"\n end\n @@os_features\n end\n\n # Linux Miner\n linux_miner = lambda do\n # Ensure LSB is installed\n if not Pathname.which(\"lsb_release\")\n pkg_mgrs = {\n \"apt-get\" => \"install -y lsb\", # Debian/Ubuntu/Linux Mint/PCLinuxOS\n \"up2date\" => \"-i lsb\", # RHEL/Oracle\n \"yum\" => \"install -y lsb\", # CentOS/Fedora/RHEL/Oracle\n \"zypper\" => \"--non-interactive install lsb\", # OpenSUSE/SLES\n \"pacman\" => \"-S --noconfirm lsb-release\", # ArchLinux\n \"urpmi\" => \"--auto lsb-release\", # Mandriva/Mageia\n \"emerge\" => \"lsb_release\", # Gentoo\n \"slackpkg\" => \"\", # Slackware NOTE - doesn't have lsb\n }\n ret = false\n pkg_mgrs.each do |mgr,args|\n if Pathname.which(mgr)\n if mgr == \"slackpkg\" && File.exists?(\"/etc/slackware-version\")\n ret = true\n else\n ret = system(\"sudo #{mgr} #{args}\")\n end\n break if ret\n end\n end\n end\n\n arch_family = `arch 2> /dev/null`.chomp\n pkg_arch = arch_family\n install_method = \"install\"\n if File.exists?(\"/etc/slackware-version\") || Pathname.which(\"slackpkg\")\n # Slackware\n nickname = File.read(\"/etc/slackware-version\").strip\n version = nickname.split[1..-1].join(\" \")\n major_release = version.to_i\n distro = \"Slackware\"\n pkg_fmt = major_release < 13 ? \"tgz\" : \"txz\"\n install = \"slackpkg -batch=on -default_answer=y install\"\n local_install = \"installpkg\"\n elsif File.exists?(\"/etc/oracle-release\") || File.exists?(\"/etc/enterprise-release\")\n if File.exists?(\"/etc/oracle-release\")\n nickname = File.read(\"/etc/oracle-release\").strip\n else\n nickname = File.read(\"/etc/enterprise-release\").strip\n end\n version = nickname.match(/\\d+(\\.\\d+)?/)[0]\n major_release = version.to_i\n distro, pkg_fmt, install, local_install = \"Oracle\", \"rpm\", \"up2date -i\", \"rpm -Uvh\"\n else\n version = `lsb_release -r 2> /dev/null`.strip.split[1..-1].join(\" \")\n major_release = version.to_i\n nickname = `lsb_release -c 2> /dev/null`.strip.split[1..-1].join(\" \")\n lsb_release_output = `lsb_release -a 2> /dev/null`.chomp\n distro, pkg_fmt, install, local_install = case lsb_release_output\n when /(debian|ubuntu|mint)/i\n pkg_arch = \"amd64\" if arch_family == \"x86_64\"\n [$1, \"deb\", \"apt-get install -y\", \"dpkg -i\"]\n when /(centos|fedora)/i\n [$1, \"rpm\", \"yum install -y\", \"yum localinstall -y\"]\n when /oracle/i\n [\"Oracle\", \"rpm\", \"up2date -i\", \"rpm -Uvh\"]\n when /redhat|rhel/i\n [\"RHEL\", \"rpm\", \"up2date -i\", \"rpm -Uvh\"]\n when /open\\s*suse/i\n [\"OpenSUSE\", \"rpm\", \"zypper --non-interactive install\", \"rpm -Uvh\"]\n when /suse.*enterprise/i\n [\"SLES\", \"rpm\", \"zypper --non-interactive install\", \"rpm -Uvh\"]\n when /archlinux/i\n [\"ArchLinux\", \"pkg.tar.xz\", \"pacman -S --noconfirm\", \"pacman -U --noconfirm\"]\n when /(mandriva|mageia)/i\n [$1, \"rpm\", \"urpmi --auto \", \"rpm -Uvh\"]\n when /pc\\s*linux\\s*os/i\n [\"PCLinuxOS\", \"rpm\", \"apt-get install -y\", \"rpm -Uvh\"]\n when /gentoo/i\n [\"Gentoo\", \"tgz\", \"emerge\", \"\"]\n else\n install_method = \"build\"\n [`lsb_release -d 2> /dev/null`.strip.split[1..-1].join(\" \")]\n end\n end\n ret = {\n :platform => \"linux\",\n :os_distro => distro,\n :pkg_format => pkg_fmt,\n :pkg_arch => pkg_arch,\n :os_version => version,\n :install_method => install_method,\n :install_cmd => install,\n :local_install_cmd => local_install,\n :os_nickname => nickname,\n :hostname => `hostname`.chomp,\n }\n ret.reject! { |k,v| v.nil? }\n @@os_features.merge!(ret)\n end\n\n # Solaris Miner\n solaris_miner = lambda do\n distro = `uname -a`.match(/(open\\s*)?(solaris)/i)[1..-1].compact.map { |s| s.capitalize }.join\n version = `uname -r`.strip\n nickname = \"#{distro} #{version.split('.')[-1]}\"\n if distro == \"OpenSolaris\"\n nickname = File.read(\"/etc/release\").match(/OpenSolaris [a-zA-Z0-9.]\\+/i)[0].strip\n end\n @@os_features.merge!({\n :platform => \"solaris\",\n :os_distro => distro,\n :os_version => version,\n :install_method => \"install\",\n :install_cmd => \"pkg install\",\n :os_nickname => nickname,\n :hostname => `hostname`.chomp,\n })\n end\n\n # *BSD Miner\n bsd_miner = lambda do\n distro = `uname -s`.strip\n version = `uname -r`.strip\n @@os_features.merge!({\n :platform => \"bsd\",\n :os_distro => distro,\n :os_version => version,\n :install_method => \"install\",\n :install_cmd => \"pkg_add -r\",\n :os_nickname => \"#{distro} #{version}\",\n :hostname => `hostname`.chomp,\n })\n end\n\n # BeOS Miner\n beos_miner = lambda do\n version = `uname -r`.strip\n distro = `uname -s`.strip\n @@os_features.merge!({\n :platform => \"beos\",\n :os_distro => distro,\n :os_version => version,\n :install_method => \"build\",\n :os_nickname => \"#{distro} #{version}\",\n :hostname => `hostname`.chomp,\n })\n end\n\n # Windows Miner\n windows_miner = lambda do\n sysinfo = `reg query \"HKEY_LOCAL_MACHINE\\\\SOFTWARE\\\\Microsoft\\\\Windows NT\\\\CurrentVersion\"`.chomp\n\n hostname = `reg query \"HKEY_LOCAL_MACHINE\\\\System\\\\CurrentControlSet\\\\Control\\\\ComputerName\\\\ComputerName\"`.chomp\n hostname = hostname.match(/^\\s*ComputerName\\s+\\w+\\s+(.*)/i)[1].strip\n\n version = sysinfo.match(/^\\s*CurrentVersion\\s+\\w+\\s+(.*)/i)[1].strip << \".\"\n version << sysinfo.match(/^\\s*CurrentBuildNumber\\s+\\w+\\s+(.*)/i)[1].strip\n\n nickname = sysinfo.match(/^\\s*ProductName\\s+\\w+\\s+(.*)/i)[1].strip\n nickname = \"Microsoft #{nickname}\" unless nickname =~ /^Microsoft/\n\n try_boot_ini = `type C:\\\\boot.ini 2> nul | findstr /C:\"WINDOWS=\"`.chomp\n unless try_boot_ini.empty?\n nickname = try_boot_ini.match(/WINDOWS=\"([^\"]+)\"/i)[1].strip\n end\n\n install_method, install_cmd = case ::RbConfig::CONFIG['host_os'].downcase\n when /mingw/; [\"build\", nil]\n when /mswin/; [\"install\", \"install\"]\n when /cygwin/; [\"install\", \"setup.exe -q -D -P\"] # TODO - Does this detect cygwin properly?\n end\n ret = {\n :os_distro => nickname.split(/\\s+/).reject { |s| s =~ /microsoft|windows/i }.join(\" \"),\n :hostname => hostname,\n :os_nickname => nickname,\n :os_version => version,\n :platform => \"windows\", # TODO - Cygwin / MinGW\n :install_method => install_method,\n :install_cmd => install_cmd,\n }\n ret.reject! { |k,v| v.nil? }\n @@os_features.merge!(ret)\n end\n\n case ::RbConfig::CONFIG['host_os'].downcase\n when /darwin/; mac_miner[]\n when /mswin|mingw/; windows_miner[]\n when /linux/; linux_miner[]\n when /bsd/; bsd_miner[]\n when /solaris/; solaris_miner[]\n else\n case `uname -s`.chomp.downcase\n when /linux/; linux_miner[]\n when /darwin/; mac_miner[]\n when /solaris/; solaris_miner[]\n when /bsd/; bsd_miner[]\n when /dragonfly/; bsd_miner[]\n when /haiku/; beos_miner[]\n when /beos/; beos_miner[]\n end\n end\n\n @@os_features.freeze\n end",
"title": ""
},
{
"docid": "d28c477505e979b6c55a896e9ff07d08",
"score": "0.62904125",
"text": "def platform\n type = os_type(:nice)\n type = case type\n when /Linux/i then linux_type\n else type\n end\n \n # Grab the Solaris version; turns '5.9' into '9', for example. (Solaris has a really\n # bizarre numbering scheme.)\n #\n # FIXME: This should include patchlevel.\n if type =~ /Solaris/i\n if @solaris_version.nil?\n @solaris_version = @platform.exec(\"uname\", \"-r\").strip\n @solaris_version = $2 if @solaris_version =~ /^\\s*(\\d+)\\s*\\.\\s*(\\d+)\\s*$/i\n end\n \n type += @solaris_version\n end\n \n # Grab the OS X version by looking at the Darwin kernel version.\n #\n # FIXME: This should include minor version, too (e.g., 10.4.7).\n if type =~ /OSX/i\n if @osx_version.nil?\n @osx_version = @platform.exec(\"uname\", \"-r\").strip\n if @osx_version =~ /^\\s*(\\d+)\\s*\\.\\s*(\\d+).*$/i\n minor_version = [ $1.to_i - 4, 0 ].max # i.e., Darwin 8.x => OS X 10.4, 7.x => OS X 10.3, etc.\n @osx_version = \"10.%d\" % minor_version\n else\n @osx_version = '-unknown-%s' % @osx_version\n end\n end\n \n type += @osx_version\n end\n \n # Grab the Windows version by System.getProperty\n if type =~ /Windows/i\n os_name = JavaSystem.getProperty('os.name');\n sun_os_patch_level = JavaSystem.getProperty('sun.os.patch.level');\n if @windows_version.nil?\n @windows_version = case os_name \n when /Windows 2003/i: \"win2k3\"\n when /Windows XP/i: \"winxp\"\n else os_name.gsub(/ /, '_')\n end\n unless sun_os_patch_level == \"unknown\"\n patch = ''\n sun_os_patch_level.split(/ /).each do |t|\n patch = \"#{patch}#{t[0..0]}\"\n end\n @windows_version += '-' + patch\n end \n end\n \n type = @windows_version\n end\n \n \"%s-%s\" % [ type.downcase, processor_type.downcase ]\n end",
"title": ""
},
{
"docid": "ed5ed1dc0dbbcf30d3360ffcb42d9b82",
"score": "0.62881696",
"text": "def platform; end",
"title": ""
},
{
"docid": "ed5ed1dc0dbbcf30d3360ffcb42d9b82",
"score": "0.62881696",
"text": "def platform; end",
"title": ""
},
{
"docid": "ed5ed1dc0dbbcf30d3360ffcb42d9b82",
"score": "0.62881696",
"text": "def platform; end",
"title": ""
},
{
"docid": "076508f13b42c5b98875abf966f5c34d",
"score": "0.626198",
"text": "def darwin?\n /darwin/.match(RUBY_PLATFORM)\n end",
"title": ""
},
{
"docid": "f40c227d528ac661a5400fdb9760960b",
"score": "0.62596565",
"text": "def determine_os\n @os = 'linux'\n end",
"title": ""
},
{
"docid": "a9c12fe9f43b8c2b5859ce3c4da27868",
"score": "0.6232103",
"text": "def determine_os\n @os = \"linux\"\n end",
"title": ""
},
{
"docid": "1d2878a41a5703aa5299a690c11b8524",
"score": "0.62249166",
"text": "def vanilla_windows?; end",
"title": ""
},
{
"docid": "a52c1cce9608ffcc4b035976e92dddae",
"score": "0.6219363",
"text": "def is_os_x?\n RbConfig::CONFIG[\"host_os\"] =~ /darwin/\n end",
"title": ""
},
{
"docid": "a45268f596fa3d8e8ec779b2f0575745",
"score": "0.6211972",
"text": "def mac?\n (/darwin/ =~ ruby_platform) != nil\n end",
"title": ""
},
{
"docid": "d28db8f665980f0d6f9740d346292a60",
"score": "0.6188475",
"text": "def on_os name\n os_kernel = `uname -a`\n os_kernel.downcase.include?(name)\nend",
"title": ""
},
{
"docid": "c477d033b2539783807f4ff6901d917d",
"score": "0.61792505",
"text": "def win_or_mac\r\n os = RUBY_PLATFORM\r\n if os.include? 'darwin'\r\n puts \"+ <lib><webdriver_helper> OS: Mac OSX\"\r\n return 'mac'\r\n elsif os.include? 'mingw32'\r\n puts \"+ <lib><webdriver_helper> OS: Windows\"\r\n return 'win'\r\n else\r\n puts \"+ <lib><webdriver_helper> Sorry, we do not support your Operating-System right now\"\r\n end\r\n end",
"title": ""
},
{
"docid": "8177f168fb868c17e690fa734d81b490",
"score": "0.6161415",
"text": "def get_unix_info()\n v = $VERBOSE\n $VERBOSE = nil\n sysname = `uname -s`\n $VERBOSE = v\n sysname = sysname.chomp\n\n if(sysname.include?(\"Linux\")) # for linux (rhel, suse, oel)\n # check if it is SUSE\n filepath = Pathname.new(\"/etc/SuSE-release\")\n if(filepath.exist?())\n release_file = '/etc/SuSE-release'\n else # for RHEL, OEL, etc.\n release_file = '/etc/issue'\n end\n\n $VERBOSE = nil\n flavor = `head -n 1 #{release_file}`\n $VERBOSE = v\n sysname = flavor.sub(/\\(\\w+\\)/, '').chomp\n sysname = sysname.sub(/\\s+\\Z/, \"\")\n\n else # for other unix platforms (solaris, aix, hpux)\n $VERBOSE = nil\n if(sysname.eql?(\"AIX\"))\n version = `oslevel`\n else\n version = `uname -r`\n end\n $VERBOSE = v\n sysname = sysname + \" \" + version.chomp\n end\n\n $VERBOSE = nil\n if(sysname.eql?(\"HP-UX\"))\n processor = `uname -m`\n else\n processor = `uname -p`\n end\n\n if(sysname.include?(\"SunOS\"))\n isainfo = `isainfo -b`\n isainfo = isainfo.chomp\n bitinfo = \" \" + isainfo + \"-bit\"\n else\n bitinfo = \"\"\n end\n $VERBOSE = v\n\n os_info = sysname + \" \" + processor.chomp + bitinfo\n os_info\nend",
"title": ""
},
{
"docid": "a34ad4df8df8addda3f881a0ea872a10",
"score": "0.6151912",
"text": "def os_family\n case os_type(:nice)\n when /Linux|Solaris|OSX/i then 'Generic'\n when /Windows/i then 'Windows'\n else 'Unknown'\n end\n end",
"title": ""
},
{
"docid": "5042252da290405ef9c7a5eb03c54003",
"score": "0.61454797",
"text": "def osx?(platform = nil)\n get_platform(platform) == :MACOS\n end",
"title": ""
},
{
"docid": "e3268f8f1a172a5c6398296bb32b47e9",
"score": "0.6135887",
"text": "def linux?\n RUBY_PLATFORM =~ /linux/\n end",
"title": ""
},
{
"docid": "acc73495e4bd6dc4fbd5a0952d7d37ca",
"score": "0.6133189",
"text": "def linux?\n linux_internal?\n end",
"title": ""
},
{
"docid": "0cb3fbe9b698b64cc7e8438e6b3b75d8",
"score": "0.61222935",
"text": "def host_os\n name = `uname`.split(' ').first.downcase.to_sym\n case name\n when :linux\n :linux\n when :darwin\n :macosx\n else\n :unknown\n end\n end",
"title": ""
},
{
"docid": "e1c9d5376ad35f21be2c63323a834e1a",
"score": "0.61042964",
"text": "def darwin?\n platform =~ /darwin/\n end",
"title": ""
},
{
"docid": "f16eec566da5af2501c583dc97b1cf9f",
"score": "0.6103385",
"text": "def linux_version\n case ENV['MACHTYPE']\n when \"s390x-suse-linux\"\n :sles_zlnx\n when /^i[356]86/\n if File.exist? \"/etc/fedora-release\"\n :linux_ia32_cell\n else\n :linux_ia32\n end\n else\n if File.exist? \"/etc/rhel-release\"\n :rhel\n elsif File.exist? \"/etc/redhat-release\"\n `awk '/release 5/||/release 4.9/{v=5};/release 4/{v=4}; END {print \"rhel\" v}' /etc/redhad-release`.to_sym\n elsif File.exist? \"/etc/SuSE-release\"\n `awk '$1==\"VERSION\" { v=$3}; END { print \"sles\" v}' /etc/SuSE-release`.to_sym\n elsif File.exist? \"/etc/yellowdog-release\"\n :yhpc\n else\n :rhel\n end\n end\nend",
"title": ""
},
{
"docid": "6b341e0117c93e4b004a0684d66e2d78",
"score": "0.61008656",
"text": "def set_browser_os()\r\n browsers = Array['chrome']\r\n $os = 'Mac'\r\n if (RUBY_PLATFORM =~ /w32/) # windows\r\n $os = 'Windows'\r\n browsers = Array['chrome']\r\n elsif (RUBY_PLATFORM =~ /darwin/) # mac\r\n $os = 'Mac'\r\n browsers = Array['chrome','safari']\r\n end\r\nend",
"title": ""
},
{
"docid": "e0ca26d35936fea4eaa415a51f68d955",
"score": "0.60945714",
"text": "def linux?\n /linux/.match(RUBY_PLATFORM)\n end",
"title": ""
},
{
"docid": "1e97811598493b8431b49caea392a87b",
"score": "0.6092354",
"text": "def ruby_platform_osname\n return unless Object.const_defined? :RUBY_PLATFORM\n\n case RUBY_PLATFORM\n when /darwin/ # macOS\n :macos\n when /linux/\n :linux\n when /mingw/\n :windows\n when /openbsd/\n :openbsd\n end\n end",
"title": ""
},
{
"docid": "8799c4730147d347952acb963fb150c9",
"score": "0.60907084",
"text": "def darwin_app_list; end",
"title": ""
},
{
"docid": "22e8badde9d122cb41d41727ad3eb218",
"score": "0.60783875",
"text": "def get_nb_fusion_guest_os(options)\n guest_os = \"freebsd\"\n if not options['arch'].to_s.match(/i386/) and not options['arch'].to_s.match(/64/)\n guest_os = guest_os+\"-64\"\n end\n return guest_os\nend",
"title": ""
},
{
"docid": "44ac3fdcff5ff9a2f62d206cb07ba731",
"score": "0.6073904",
"text": "def really_windows?; end",
"title": ""
},
{
"docid": "6cd66cd69ec6689771c8352ed1909310",
"score": "0.605985",
"text": "def user_os_complex\r\n end",
"title": ""
},
{
"docid": "9447f4afa6bc6e5fec72bceccfd5bd37",
"score": "0.6056896",
"text": "def is_darwin?\n Sprout.current_system.is_a?(Sprout::System::OSXSystem)\n end",
"title": ""
},
{
"docid": "acdedca67b39e7a02ada3128a850dcdd",
"score": "0.6040412",
"text": "def get_os\n if RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/\n return :Windows\n elsif RbConfig::CONFIG['host_os'] =~ /darwin/\n return :Mac\n elsif RbConfig::CONFIG['host_os'] =~ /linux/\n return :Linux\n elsif RbConfig::CONFIG['host_os'] =~ /bsd/\n return :BSD\n else\n return :unknown_os\n end\nend",
"title": ""
},
{
"docid": "4fb34f866e3f986170a709da1e94b6c5",
"score": "0.6038847",
"text": "def user_os_simple\r\n ua = request.env['HTTP_USER_AGENT'].downcase\r\n return \"Windows\" if ua.index('win')\r\n return \"Linux\" if ua.index('Linux')\r\n return \"Macintosh\" if ua.index('Macintosh')\r\n return \"unknown\"\r\n end",
"title": ""
},
{
"docid": "f818f388436a8f54fbd7c20e00ac2816",
"score": "0.6022196",
"text": "def mac?\n Config::CONFIG['target_os'] == \"darwin\"\n end",
"title": ""
},
{
"docid": "e3479a7067bd5e0552b77395e3071db0",
"score": "0.60043716",
"text": "def macos_ruby?\n !!(RUBY_PLATFORM =~ /darwin/)\n end",
"title": ""
},
{
"docid": "2271aaa9cd98ce5da3bb82003d3782dd",
"score": "0.6004084",
"text": "def mac?\n Config::CONFIG[\"host_os\"] =~ /darwin/i ? true : false\n end",
"title": ""
},
{
"docid": "d2935ac9078e0d0828de5cb16055df20",
"score": "0.6001635",
"text": "def is_unix?\n return !!@name.match(/^(solaris|aix|osx)-.*$/)\n end",
"title": ""
},
{
"docid": "2176ac123ff411010903d3223d289f67",
"score": "0.59979695",
"text": "def looks_like_rackspace? \n has_rackspace_mac?\nend",
"title": ""
},
{
"docid": "66212867a476e61faa07b307f5f13682",
"score": "0.5985635",
"text": "def get_os\n system=`/usr/bin/sw_vers -productVersion`.chomp.split(\".\").slice(1).to_i\n if system==4 then\n return \"tiger\"\n else\n return \"leo\"\n end\nend",
"title": ""
},
{
"docid": "82fa0444cd560498c574a2b2f372668b",
"score": "0.5984524",
"text": "def bash_on_windows?; end",
"title": ""
},
{
"docid": "e248c82d166eccb50c42d1512aa24550",
"score": "0.598356",
"text": "def from_osx?\n @from_osx ||= begin\n p = `#{binary} -c \"import sys; print(sys.prefix)\"`.strip\n p.start_with?(\"/System/Library/Frameworks/Python.framework\")\n end\n end",
"title": ""
},
{
"docid": "5908df490864d9a368455a0995aa3f7b",
"score": "0.5954202",
"text": "def unix?\n not windows? and not java?\n end",
"title": ""
},
{
"docid": "609333ea036016d8f21d3035539e8b8f",
"score": "0.5951662",
"text": "def osx_version\n @osx_version ||= `sw_vers | grep ProductVersion | cut -f 2 -d ':' | awk ' { print $1; } '`.strip rescue ''\n end",
"title": ""
},
{
"docid": "609333ea036016d8f21d3035539e8b8f",
"score": "0.5951662",
"text": "def osx_version\n @osx_version ||= `sw_vers | grep ProductVersion | cut -f 2 -d ':' | awk ' { print $1; } '`.strip rescue ''\n end",
"title": ""
},
{
"docid": "b36bd1c1b8cb2c750663526048248b7c",
"score": "0.59478253",
"text": "def mac_os_onboarded\n return @mac_os_onboarded\n end",
"title": ""
},
{
"docid": "291f46c2edd3c2a18d90302198620eb4",
"score": "0.5941071",
"text": "def linux?\n RUBY_PLATFORM.match(/linux/)\n end",
"title": ""
},
{
"docid": "8abe077346f45a37b595f26476de1423",
"score": "0.5914246",
"text": "def ruby_arch\n case Common.target_platform\n when /darwin/\n 'x86_64-darwin10'\n when 'linux-x86_64'\n 'x86_64-linux'\n when 'linux-x86'\n 'i686-linux'\n when /windows/\n 'x64-mingw64'\n end\nend",
"title": ""
},
{
"docid": "73da4538527502a444264fdd26df059f",
"score": "0.590815",
"text": "def mac?\n @mac ||= is? /mac|darwin/\n end",
"title": ""
},
{
"docid": "7b882b31361344e7e74d54917124ecf4",
"score": "0.5896543",
"text": "def os_x_older?\n os_x? && RUBY_PLATFORM.include?('11')\n end",
"title": ""
},
{
"docid": "b0ff94501088ca0ded0825560e0643ed",
"score": "0.58963996",
"text": "def linux?\n !!(ua =~ /Linux/)\n end",
"title": ""
},
{
"docid": "e72c36131f90e108d5e659ac2e895ea7",
"score": "0.58924997",
"text": "def os_x_newer?\n os_x? && !os_x_older?\n end",
"title": ""
},
{
"docid": "957e7a891f38a9900d00b2fc4c00caa0",
"score": "0.5888063",
"text": "def linux?\n kind_of? Unix::Platform rescue false\n end",
"title": ""
},
{
"docid": "cbbaa1d0e0cca468288f1c3fc35ae3c5",
"score": "0.5886632",
"text": "def sys_uname_osname\n uname = `uname`\n if uname.include? 'Darwin' # macOS\n :macos\n elsif uname.include? 'Linux'\n :linux\n elsif uname.include? 'MINGW'\n :windows\n elsif uname.include? 'OpenBSD'\n :openbsd\n end\n end",
"title": ""
},
{
"docid": "7bf21389ba9b1b78ef5cfd20a5a5a60f",
"score": "0.5884522",
"text": "def ensure_shell_commands\n xcodebuild_version\n swift_version\n end",
"title": ""
},
{
"docid": "be983e302e37a5bc37ef3ae8dc888fc6",
"score": "0.5876539",
"text": "def client_os? system\n detect_os == system.to_sym\n end",
"title": ""
},
{
"docid": "12d3c902ced88847a5030c258db6eba7",
"score": "0.5831226",
"text": "def get_ai_fusion_guest_os(options)\n guest_os = \"solaris10-64\"\n return guest_os\nend",
"title": ""
},
{
"docid": "15a98e3332b1beecd105673ac5b6ae77",
"score": "0.5828517",
"text": "def darwin_group\n # NOTE ordering required, but removal of Darwin class constant\n # procludes forcing os as Darwin\n [Tiger, Leopard, SnowLeopard, Darwin]\n end",
"title": ""
},
{
"docid": "b5194492c867f4218239a653703480a4",
"score": "0.58252186",
"text": "def ios; end",
"title": ""
},
{
"docid": "830be2cfc585bdaf20c60a083ee5d379",
"score": "0.5821109",
"text": "def get_osx_release_data\n cmd = \"uname -s\"\n kernel = if InstallBuddy.get_option(:remote)\n Remote.exec(cmd)\n else\n `#{cmd}`\n end\n return [\"ID=MacOSX\"] if kernel.match(/^Darwin/)\n []\n end",
"title": ""
},
{
"docid": "9ee0153cc67e5320d5a85c407e3a16b1",
"score": "0.5806794",
"text": "def platform_version_mac_os_x(arg)\n arg.match(/^[0-9]+\\.[0-9]+/).to_s\n end",
"title": ""
},
{
"docid": "efdcee00086ddb38fd1e8fe19b353cd8",
"score": "0.5806476",
"text": "def define_os\n @os ||= (\n host_os = RbConfig::CONFIG['host_os']\n case host_os\n when /mswin|msys|mingw|cygwin|bccwin|wince|emc/\n :windows\n when /darwin|mac os/\n :macosx\n when /linux/\n :linux\n when /solaris|bsd/\n :unix\n else\n raise GetMeSubsError.new(\"Unknown os: #{host_os.inspect}\")\n end\n )\n end",
"title": ""
},
{
"docid": "6c5e23d7a27e578c2f0486edfc10c301",
"score": "0.5796249",
"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": "c81446f9e1d0abe0e5826ef7b1f27ddf",
"score": "0.5795429",
"text": "def linux_identification\n \"#{fetch_linux_distributor}_#{fetch_linux_os_version}\"\nend",
"title": ""
},
{
"docid": "726c666f8d45a674144f27ebf57d8cc1",
"score": "0.57912874",
"text": "def linux?\n @linux\n end",
"title": ""
},
{
"docid": "2c6233cc0c40a3b48d96ee37fef39a5f",
"score": "0.57866305",
"text": "def mac?\n kind_of? Mac::Platform rescue false\n end",
"title": ""
},
{
"docid": "574650350ec5457af99fabcf3b5712ec",
"score": "0.5786242",
"text": "def mac?\n !!(ua =~ /Mac OS X/ && !ios?)\n end",
"title": ""
},
{
"docid": "12b5698fe55afcfcb33052b87a3dcd23",
"score": "0.5770487",
"text": "def get_ob_fusion_guest_os(options)\n guest_os = \"otherlinux-64\"\n return guest_os\nend",
"title": ""
},
{
"docid": "e5b9009d8be85d6acfae7fba93c9ae7a",
"score": "0.57698876",
"text": "def my_os\n Application.my_os\n end",
"title": ""
},
{
"docid": "f8a426e6f7dc1243735d3ffdc5591e85",
"score": "0.5760771",
"text": "def platform_end_point; end",
"title": ""
},
{
"docid": "f3082ccb81cc331a9a78e4038ce04b59",
"score": "0.5756899",
"text": "def etc; HOMEBREW_PREFIX+'etc' end",
"title": ""
},
{
"docid": "012067c8d5f12c23d88ae844f67237ad",
"score": "0.5755893",
"text": "def macys?\n ExecutionEnvironment.macys?\n end",
"title": ""
},
{
"docid": "52b090ae7597dd6eb9a2f7db864fcaf4",
"score": "0.57513374",
"text": "def os_type_extra\n type = os_type(:nice)\n if type =~ /linux/i && `uname -m` =~ /64/\n type = type + \"64\"\n end\n type\n end",
"title": ""
},
{
"docid": "890681cba4f93eb5e9f7984fcd7ac7af",
"score": "0.5747111",
"text": "def macos?(node = __getnode)\n node ? node[\"platform_family\"] == \"mac_os_x\" : macos_ruby?\n end",
"title": ""
},
{
"docid": "f1b75dc9cc2f53cf7cb6b000f16093b2",
"score": "0.57428265",
"text": "def posix?\n !windows?\n end",
"title": ""
},
{
"docid": "ace05d5fa80821be30d65c73323ddb5a",
"score": "0.57370293",
"text": "def linux?\n @linux ||= is? /linux|cygwin/\n end",
"title": ""
},
{
"docid": "138e8976029e3e6c7badf9bad2d66c0b",
"score": "0.5733699",
"text": "def workaround_older_macosx_misreported_cpu?\n os == :macosx && is_64_bit?\n end",
"title": ""
},
{
"docid": "0c042f63e3e2979a3ba7d84b6c777dd5",
"score": "0.5727979",
"text": "def unix?\n !windows?\n end",
"title": ""
},
{
"docid": "65033d1fe73c8f530a3e36eb3a1e3d55",
"score": "0.5724267",
"text": "def fetch_linux_os_version\n `lsb_release -rs`.strip\nend",
"title": ""
},
{
"docid": "69b5a3e4834f8a14279167cca4e47168",
"score": "0.5723026",
"text": "def ruby_platform\n RUBY_PLATFORM\n end",
"title": ""
},
{
"docid": "9a72b0dc43922b5bcdff5607fd96dfd5",
"score": "0.5718968",
"text": "def host_os\n @os ||= (\n case RbConfig::CONFIG['host_os']\n when /mswin|msys|mingw|cygwin|bccwin|wince|emc/\n :windows\n when /darwin|mac os/\n :macosx\n when /linux/\n :linux\n when /solaris|bsd/\n :unix\n else\n raise \"Unknown os: #{RbConfig::CONFIG['host_os']}\"\n end\n )\n end",
"title": ""
},
{
"docid": "9469acfad21829da9560cd635d2d666c",
"score": "0.57095635",
"text": "def osx_name\n return exec('sysctl -n machdep.cpu.brand_string')\n end",
"title": ""
}
] |
efb3c31a279ca65fa8cdec3fd719efb2
|
GET /newsletter_archives/:id GET /newsletter_archives/:id.xml
|
[
{
"docid": "53437d99f05c93f4cc5f6dbde4d0ab1d",
"score": "0.0",
"text": "def show\n @newsletter_editions = @newsletter_archive.newsletter_editions.accessible.where([ 'published <> ?', 'unpublished' ]).page(params[:page]).per(25)\n\n first_page = !params[:page] || params[:page] == 1\n @latest_newsletter_editions = []\n @newsletter_editions_for_table = @newsletter_editions.to_a\n if first_page\n @latest_newsletter_editions = @newsletter_editions_for_table[0..5]\n @newsletter_editions_for_table -= @latest_newsletter_editions\n end\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @newsletter_archive }\n end\n end",
"title": ""
}
] |
[
{
"docid": "d5a26159a8b3b5c341d13f7655452e1d",
"score": "0.6683545",
"text": "def index\n logger.debug \"cm/archives/index - session_id: #{request.session_options[:id]}\"\n @archives = @current_user.archives\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @archives }\n end\n end",
"title": ""
},
{
"docid": "088ea3b8f8b95a5e7f277370ee6b7550",
"score": "0.6560744",
"text": "def show\n @newsletter = Newsletter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @newsletter }\n end\n end",
"title": ""
},
{
"docid": "2b5199ac74caa9a4d1fd3e285c8f9308",
"score": "0.638567",
"text": "def index\n @subscribers = Subscriber.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscribers }\n end\n end",
"title": ""
},
{
"docid": "804c6c1f3dcdf27793dc8fdfee36c11d",
"score": "0.6363432",
"text": "def index\n @articles = Article.published\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @articles }\n end\n end",
"title": ""
},
{
"docid": "bfd384e13dc58fcfcc7f1de57b9131ae",
"score": "0.6318425",
"text": "def show\n @download = Download.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @download }\n end\n end",
"title": ""
},
{
"docid": "bfd384e13dc58fcfcc7f1de57b9131ae",
"score": "0.6318425",
"text": "def show\n @download = Download.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @download }\n end\n end",
"title": ""
},
{
"docid": "e58a98c130688c1905d6e5f0060de808",
"score": "0.63012326",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @newsletter_edition }\n end\n end",
"title": ""
},
{
"docid": "effde4f8ce1ee9de4c4eb24d1f916c1b",
"score": "0.62521523",
"text": "def find_newsletter_archive\n @newsletter_archive = @node.content\n end",
"title": ""
},
{
"docid": "f33ec3dadb902a0c144fea32e06734c9",
"score": "0.6213727",
"text": "def rss\n @headers[\"Content-Type\"] = \"application/xml\"\n @articles = Article.find(:all, \n :order => 'created_at DESC',\n :conditions => [\"articles.approved = ?\", true],\n :limit => 10\n )\n render :layout => false\n end",
"title": ""
},
{
"docid": "d0e190a2537d0d72f560ca87f7d3a5ab",
"score": "0.61786276",
"text": "def new\n @archive = Archive.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @archive }\n end\n end",
"title": ""
},
{
"docid": "b9c79cf1ad22e8a6b01e4cd996346779",
"score": "0.6170882",
"text": "def index\n @file_attachments = FileAttachment.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @file_attachments }\n end\n end",
"title": ""
},
{
"docid": "3cfe0fe25d06601dfc24fa0a02fdb1bb",
"score": "0.6170077",
"text": "def index\n @news_items = NewsItem.find(:all, :order => 'updated_at desc')\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @news_items.to_xml }\n end\n end",
"title": ""
},
{
"docid": "b6502616ccf926d8447084d512d82a7d",
"score": "0.6138418",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @download_registrations }\n end\n end",
"title": ""
},
{
"docid": "ed02863786bd0e5eb683491ac04dc551",
"score": "0.61118925",
"text": "def index\n @media_mails = MediaMail.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @media_mails }\n end\n end",
"title": ""
},
{
"docid": "e21195029974ef80febd4244b0dda986",
"score": "0.6098182",
"text": "def index\n @news_items = do_index(NewsItem, params)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @news_items }\n end\n end",
"title": ""
},
{
"docid": "403b58e88cdd146c5d2bad057fa3983f",
"score": "0.6097302",
"text": "def show\n @product_archive = ProductArchive.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @product_archive }\n end\n end",
"title": ""
},
{
"docid": "a172b3fb099f37bea37a3fe64ac19296",
"score": "0.60957927",
"text": "def show\n @newsletter_registrations = NewsletterRegistrations.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @newsletter_registrations }\n end\n end",
"title": ""
},
{
"docid": "75d28a1ef82b90052d1bef2ad404a96e",
"score": "0.6072538",
"text": "def index\n @news_updates = NewsUpdate.all.paginate(:page => params[:page], :per_page => 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @news_updates }\n end\n end",
"title": ""
},
{
"docid": "ba242d0294482c059b7df6fba8ec344f",
"score": "0.6068404",
"text": "def index\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscriptions }\n end\n end",
"title": ""
},
{
"docid": "ba242d0294482c059b7df6fba8ec344f",
"score": "0.6068404",
"text": "def index\n @subscriptions = Subscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @subscriptions }\n end\n end",
"title": ""
},
{
"docid": "ee6633f88f470a10568e45be52825e43",
"score": "0.6050382",
"text": "def index\n @newsletter_subscribers = NewsletterSubscriber.all\n\n respond_with do |format|\n format.html { render :index, :layout => false }\n end\n end",
"title": ""
},
{
"docid": "673457df0cd62ff5b8b0529710296ad6",
"score": "0.6034908",
"text": "def index\n @stream_items = StreamItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stream_items }\n end\n end",
"title": ""
},
{
"docid": "5652ed1ccdd999aa4f098ceffead282f",
"score": "0.6026625",
"text": "def show\n @downloadlink = Downloadlink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @downloadlink }\n end\n end",
"title": ""
},
{
"docid": "f5db25b600103a517f4eea25b87eba5a",
"score": "0.60022944",
"text": "def show\r\n @archive = Archive.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @archive }\r\n end\r\n end",
"title": ""
},
{
"docid": "1aea72a24ad3f7343161ada23d2486f7",
"score": "0.5997786",
"text": "def index\n @articles = Thumbwebs::Article.find(:all)\n \n # TODO, to_xml and namespaced models \n #see http://dev.rubyonrails.org/ticket/8305, to_xml does not work with namespaced models\n #see http://snakesgemscoffee.blogspot.com/2007/05/activerecordbasetoxml-woes.html\n #see http://dev.rubyonrails.org/attachment/ticket/8308/xml_serialize.patch \n respond_to do |format|\n format.html {render :template => \"index\"}\n format.xml {render :xml => @articles.to_xml( :root => 'thumbwebs:articles' , :children => 'thumbwebs:article') }\n end\n end",
"title": ""
},
{
"docid": "bae9fd916ef1229a74482d77a0fd82be",
"score": "0.59941787",
"text": "def show\n @news_item = NewsItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @news_item.to_xml }\n end\n end",
"title": ""
},
{
"docid": "d89cff248fd4768f8ccfe71809f96f7e",
"score": "0.5990566",
"text": "def index\n @meals = TestSubject.find(@test_subject.id).meals\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @meals }\n end\n end",
"title": ""
},
{
"docid": "9cbf79aa2dcba03d19d3bdcb07ba7f0a",
"score": "0.596089",
"text": "def show\n @published_document = PublishedDocument.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @published_document }\n end\n end",
"title": ""
},
{
"docid": "9160d2ba8a19507e0068406cf3b4e9bf",
"score": "0.59384423",
"text": "def index\n @announcements = Announcement.find(:all, :order => 'starts_at desc')\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @announcements }\n end\n end",
"title": ""
},
{
"docid": "6be275365652692ed0261117053ae7a6",
"score": "0.59344226",
"text": "def show\n @news = News.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news }\n end\n end",
"title": ""
},
{
"docid": "9dafe74af8ce39b9268416db571fbc0f",
"score": "0.59330446",
"text": "def show\n @news_update = NewsUpdate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news_update }\n end\n end",
"title": ""
},
{
"docid": "9ffa200502ac0ff243849b48a6ebf1f1",
"score": "0.59319544",
"text": "def index\n @feed_entries = FeedEntry.all\n @title = \"Feeds List\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @feed_entries }\n end\n end",
"title": ""
},
{
"docid": "43a3537ade1c30119c4548c61e050cb0",
"score": "0.59246516",
"text": "def archives\n @response, @documents = search_service.fetch(Array(params[:id]))# unless !params[:id].to_s.include?(\"repositories\")\n respond_to do |format|\n format.refworks_archives { render :layout => false }\n end\n end",
"title": ""
},
{
"docid": "52256ae1996674ed37a168b5cfc7426c",
"score": "0.5919633",
"text": "def show\n @announcement = Announcement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @announcement }\n end\n end",
"title": ""
},
{
"docid": "8fe3cd934890b7fc68183b3c53a9bacc",
"score": "0.59077454",
"text": "def index\n @news_blasts = NewsBlast.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @news_blasts }\n end\n end",
"title": ""
},
{
"docid": "18cf3cabe22dcdbf52cf4768e0836dff",
"score": "0.59066993",
"text": "def index\n @mail_servers = MailServer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @mail_servers }\n end\n end",
"title": ""
},
{
"docid": "2f0a535d5bf033070c550f0038e62f46",
"score": "0.59037876",
"text": "def to_xml\n PodcastsController.renderer.new(\n 'action_dispatch.request.path_parameters' => {\n controller: 'podcasts',\n action: 'show',\n id: podcast.id\n }\n ).render :show, format: :rss\n end",
"title": ""
},
{
"docid": "05ca9a41366972468a382fc2f5ef8c32",
"score": "0.59007376",
"text": "def index\n @feeds = Feed.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @feeds.to_xml }\n end\n end",
"title": ""
},
{
"docid": "f017d8b66adab7c97db52a15c583ed9c",
"score": "0.5896993",
"text": "def index\n @packages = Package.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @packages }\n end\n end",
"title": ""
},
{
"docid": "43582dc8494872054cec2a425fcb9dac",
"score": "0.58948827",
"text": "def index\n @publication_numbers = PublicationNumber.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @publication_numbers }\n end\n end",
"title": ""
},
{
"docid": "e2e69cf2749d0a8b46738040663cbe5e",
"score": "0.58895123",
"text": "def index\n @archives = Archive.published\n @future_meetups = Archive.unpublished\n end",
"title": ""
},
{
"docid": "a92ef093d0b2eef2a1515075f9dabe15",
"score": "0.5888755",
"text": "def show\n @news_item = NewsItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news_item }\n end\n end",
"title": ""
},
{
"docid": "a92ef093d0b2eef2a1515075f9dabe15",
"score": "0.5888755",
"text": "def show\n @news_item = NewsItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news_item }\n end\n end",
"title": ""
},
{
"docid": "afa00b355f296059413b067540a7e4e4",
"score": "0.5888051",
"text": "def index\n\t\trespond_to do |format|\n\t\t\tformat.html {\n\t\t\t\tfacets()\n\t\t\t}\n\t\t\tformat.xml {\n\t\t\t\t@archives = Archive.all\n\t\t\t}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "342cab0366835ee06fbf747ce5a45d5c",
"score": "0.588546",
"text": "def index\n\t\t@people = Person.all\n\t\t# respond_to do |format|\n\t\t# \tformat.xml { send_data @entries.to_xml, :type => 'text/xml; charset=UTF-8;', :disposition => 'attachment; filename=entries.xml'}\n\t\t# end\n\tend",
"title": ""
},
{
"docid": "fa37c32b60cc8b21077e9400f0090150",
"score": "0.5883426",
"text": "def index\n @active_news_items = NewsItem.active\n @expired_news_items = NewsItem.expired\n @newsletters = Newsletter.all(:order => 'newsletters.publication_date DESC',\n :conditions => ['expired = ?', true])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @news_items }\n end\n end",
"title": ""
},
{
"docid": "c3224d0bbb0a4645dd2c4c632c56ae66",
"score": "0.58818346",
"text": "def index1\n @publications = Publication.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @publications }\n end\n end",
"title": ""
},
{
"docid": "4194b9cdd348a4160aa0be3961a0b37c",
"score": "0.58815217",
"text": "def show\n @news_blast = NewsBlast.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news_blast }\n end\n end",
"title": ""
},
{
"docid": "b838701bce1cf4deb6828d0bbb502510",
"score": "0.5874524",
"text": "def show\n @announcement = Announcement.find(params[:id])\n\n respond_to do |format|\n format.html # show.haml\n format.xml { render :xml => @announcement }\n end\n end",
"title": ""
},
{
"docid": "853897cad47827718e5b45f6651ac3d6",
"score": "0.5869702",
"text": "def index\n @mails = Mail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @mails }\n end\n end",
"title": ""
},
{
"docid": "d5bc7af9e155941030b1226e081e56c4",
"score": "0.5869572",
"text": "def show\n @news_link = NewsLink.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news_link }\n end\n end",
"title": ""
},
{
"docid": "85057a52b8461db9e937869a1b3b2073",
"score": "0.5864573",
"text": "def index\n @links = Link.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @links }\n end\n end",
"title": ""
},
{
"docid": "09a66e3c25ffc96144e173f218a3d5a2",
"score": "0.5861497",
"text": "def show\n @news = News.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml{\n \n }\n end\n end",
"title": ""
},
{
"docid": "a3f5d629355481fc4760142fb0481be2",
"score": "0.5860334",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @broadcast.content_delivery.to_xml }\n end\n end",
"title": ""
},
{
"docid": "508f3889eaa4d31831c459b2309c4abe",
"score": "0.58595914",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news_item }\n end\n end",
"title": ""
},
{
"docid": "8464251d5e87712db702df2a842f2f33",
"score": "0.5859149",
"text": "def show\n @news = News.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news }\n end\n end",
"title": ""
},
{
"docid": "bf5dd2255a8c4f306bf9f55d55847741",
"score": "0.5856782",
"text": "def index\n @albums = Album.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @albums }\n end\n end",
"title": ""
},
{
"docid": "bf5dd2255a8c4f306bf9f55d55847741",
"score": "0.5856782",
"text": "def index\n @albums = Album.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @albums }\n end\n end",
"title": ""
},
{
"docid": "16c89ef4c80dcfc117464d668b37d0d7",
"score": "0.58537793",
"text": "def index\n @authorships = Authorship.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @authorships }\n end\n end",
"title": ""
},
{
"docid": "e52508c11a65255039d833695a475288",
"score": "0.58511907",
"text": "def show\n @newsletters_type = NewslettersType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @newsletters_type }\n end\n end",
"title": ""
},
{
"docid": "6806f39069afb279fd39cf9925780a63",
"score": "0.58482647",
"text": "def index\n @meals = TestSubject.find(@test_subject.id).meals.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @meals }\n end\n end",
"title": ""
},
{
"docid": "9b2ae244078a489c28d52b4984ce970f",
"score": "0.584381",
"text": "def index\n @articles = Article.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @articles }\n end\n end",
"title": ""
},
{
"docid": "9f84d217fe9568d9a63f00c435e82415",
"score": "0.58423126",
"text": "def show\n @mailfetch = Mailfetch.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @mailfetch }\n end\n end",
"title": ""
},
{
"docid": "c3558663e9c41d6a01e2a6c3e3c9ac21",
"score": "0.58326733",
"text": "def index\n @folders = Folder.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @folders }\n end\n end",
"title": ""
},
{
"docid": "c3558663e9c41d6a01e2a6c3e3c9ac21",
"score": "0.58326733",
"text": "def index\n @folders = Folder.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @folders }\n end\n end",
"title": ""
},
{
"docid": "2874bee9d92683ef6a4a9c2d1e49c54a",
"score": "0.58319926",
"text": "def index\n params[:page] ||= 1\n \n @releases = Release.search_archive(params[:search], params[:page])\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @releases }\n end\n end",
"title": ""
},
{
"docid": "7cd081049647193ba1f21c8ba6e26463",
"score": "0.58292174",
"text": "def index\n @drafts = SmsOnRails::Draft.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @drafts }\n end\n end",
"title": ""
},
{
"docid": "35c2857369777d8d075129ba78e5180d",
"score": "0.5826979",
"text": "def rss\n @event = Event.find_by_key(params['id'])\n @histories = @event.histories(:order => 'created_at DESC')\n render :layout => false\n response.headers[\"Content-Type\"] = \"application/xml; charset=utf-8\"\n end",
"title": ""
},
{
"docid": "37652cacb2723ed18a0e27c4116ec38b",
"score": "0.5823597",
"text": "def index\n @invitations = Invitation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invitations }\n end\n end",
"title": ""
},
{
"docid": "63734b7983dc58e2682308d3be0c7927",
"score": "0.5822004",
"text": "def index\n @packages = Package.package_order\n @blog = Blog.last\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @packages }\n end\n end",
"title": ""
},
{
"docid": "0f82f51f692c88986bcce1e8361ffd11",
"score": "0.58180463",
"text": "def index\n @articles = Article.all(:order=> \"created_at DESC\")\n @archive_items = Article.all(:order=> \"created_at DESC\")\n @title = \"Archive\"\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @articles }\n end\n end",
"title": ""
},
{
"docid": "4e46cd77bebd8a6dfdf76f47fc3fc323",
"score": "0.58154875",
"text": "def index\n @news = News.all(:order => \"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @news }\n end\n end",
"title": ""
},
{
"docid": "c2f76f69162cd581b81891f55a21f000",
"score": "0.5814077",
"text": "def new\n @newsletter = Newsletter.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @newsletter }\n end\n end",
"title": ""
},
{
"docid": "254626d33ff87e00b3cfe915e1231164",
"score": "0.58106786",
"text": "def index\n @albums = Album.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @albums }\n end\n end",
"title": ""
},
{
"docid": "3569c4b239cbe560d2421f4e8f276f4a",
"score": "0.5805436",
"text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @news_item }\n end\n end",
"title": ""
},
{
"docid": "1b99f54d262bb094fdd8469f1cc9cc61",
"score": "0.5802508",
"text": "def show\n @journal = Journal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @journal }\n end\n end",
"title": ""
},
{
"docid": "15280bc9fc5bc426602a008dd7e2102b",
"score": "0.57980067",
"text": "def show\n @twitterfeed = Twitterfeed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @twitterfeed }\n end\n end",
"title": ""
},
{
"docid": "00e8a00d2255ee0383771aa2230ecd45",
"score": "0.5790052",
"text": "def show\n @export = Export.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @export }\n end\n end",
"title": ""
},
{
"docid": "e9041a94c037ef4bd836570623b179fc",
"score": "0.5783145",
"text": "def index\n @titles = @medium.titles.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @titles }\n end\n end",
"title": ""
},
{
"docid": "a7a984b580c4b8fb2effb2cc0b3625a0",
"score": "0.5782562",
"text": "def index\n @article_lists = ArticleList.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @article_lists }\n end\n end",
"title": ""
},
{
"docid": "cc3a24549c2166e6456d0a8366ed882c",
"score": "0.5782222",
"text": "def index\n @invitations = Invitation.find(:all)\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @invitations.to_xml }\n end\n end",
"title": ""
},
{
"docid": "0ecf0db4a9669eedf54dc3622c6a43b0",
"score": "0.5779609",
"text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group_retention }\n end\n end",
"title": ""
},
{
"docid": "0574459ff234f2dafc68119a91a9970d",
"score": "0.57748544",
"text": "def index\n @bulletins = Bulletin.paginate(:all, :order => 'created_at DESC', :per_page => 10, :page => params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @bulletins }\n format.rss { render :layout => false }\n end\n end",
"title": ""
},
{
"docid": "6eeded846f8f5d83c55caa5a595499cf",
"score": "0.576295",
"text": "def index\n\t @assets = @campaign.assets\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @assets }\n end\n end",
"title": ""
},
{
"docid": "3acd4ef8bff83e8fb0a7663efb2f346a",
"score": "0.57582295",
"text": "def index\n @item_checkin_archives = ItemCheckinArchive.all.page(params[:page])\n end",
"title": ""
},
{
"docid": "13eea2b5990be2e1569ac868d82f4422",
"score": "0.57579523",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @imports }\n end\n end",
"title": ""
},
{
"docid": "62282c1c3518b30ad7db37e59715a0d6",
"score": "0.57562697",
"text": "def index\n respond_to do |format|\n format.html { redirect_to forum_path(params[:forum_id]) }\n format.xml do\n @topics = Topic.find_all_by_forum_id(params[:forum_id], :order => 'sticky desc, replied_at desc', :limit => 25)\n render :xml => @topics.to_xml\n end\n end\n end",
"title": ""
},
{
"docid": "c870f14c562ff1c92b851c1e3c710ff6",
"score": "0.57543004",
"text": "def archive\n render :file => cache_file and return if cached_file?\n @document = Document.public.find_by_path(params[:path].join('/'))\n raise ActiveRecord::RecordNotFound if @document.nil?\n\n \n @documents = @document.archive_for(params[:month], params[:year]).paginate :page => params[:page], :per_page => Settings.documents.per_page\n render :template => view_for(:suffix => '_archive')\n cache_this_page!\n end",
"title": ""
},
{
"docid": "41fa3b3265e0fdb212d8f91d3974f558",
"score": "0.5753071",
"text": "def index\n @receiving_items = ReceivingItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @receiving_items }\n end\n end",
"title": ""
},
{
"docid": "9b42eae26d616097ddd503ae277bab86",
"score": "0.5749481",
"text": "def show\n @feed = Feed.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @feed.to_xml }\n end\n end",
"title": ""
},
{
"docid": "79965684432dbe3229e1833ad21ba8c3",
"score": "0.574948",
"text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @chronopay_links }\n end\n end",
"title": ""
},
{
"docid": "d0ef104136d012be3b0085dd289ad739",
"score": "0.5749179",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @feed }\n end\n end",
"title": ""
},
{
"docid": "1c0c611579e1abc8155b6670a1c47db6",
"score": "0.5748673",
"text": "def show\n @datafeed = Datafeed.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @datafeed }\n end\n end",
"title": ""
},
{
"docid": "2abbdeb7d1bfc1e238ac42ccd8abb500",
"score": "0.5743165",
"text": "def rss \n @vote_topics = VoteTopic.rss\n respond_to do |format|\n format.rss\n end\n end",
"title": ""
},
{
"docid": "e014a29256a6e421e92886c03f97c4aa",
"score": "0.57382864",
"text": "def show\n @analisis = Analisis.find(params[:id])\n\n respond_to do |format|\n format.xml { render :xml => @analisis }\n end\n end",
"title": ""
},
{
"docid": "312a4798e068c1de0eb767401f64ef77",
"score": "0.5735384",
"text": "def show\n @mailing = Mailing.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @mailing }\n end\n end",
"title": ""
},
{
"docid": "a07eadeacf65553fc23a563cc3d7a204",
"score": "0.57349104",
"text": "def index\n @latestinfos = Latestinfo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @latestinfos }\n end\n end",
"title": ""
},
{
"docid": "1bbff51f65ef897a6b231ee44a795fa9",
"score": "0.5733921",
"text": "def show\n @podcast = Podcast.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml #{ render :xml => @podcast }\n end\n end",
"title": ""
},
{
"docid": "ef8f2ad7a1c33a0f9889f72174bc0992",
"score": "0.5730522",
"text": "def show\n @shelf = Shelf.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @shelf.to_xml(:include => :books) }\n end\n end",
"title": ""
},
{
"docid": "b5cec73f389684d3527664fa1f535e3c",
"score": "0.57299536",
"text": "def index\n @entries = Entry.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @entries }\n end\n end",
"title": ""
},
{
"docid": "8e406bce108d77ab23477eba1222bc87",
"score": "0.5729663",
"text": "def index\n @media_shares = MediaShare.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @media_shares }\n end\n end",
"title": ""
}
] |
bac322d56126a441c0f5156a5c84fe9d
|
DELETE /aggregate_metadata/1 DELETE /aggregate_metadata/1.json
|
[
{
"docid": "1c98db05e0b35c2e4ba08a43953f3334",
"score": "0.74667597",
"text": "def destroy\n @aggregate_metadatum = AggregateMetadatum.find(params[:id])\n @aggregate_metadatum.destroy\n\n respond_to do |format|\n format.html { redirect_to aggregate_metadata_url }\n format.json { head :no_content }\n end\n end",
"title": ""
}
] |
[
{
"docid": "c9c1efa513c6158d3160c8beb9b575d6",
"score": "0.7061719",
"text": "def destroy\n @aggregate = Aggregate.find(params[:id])\n @aggregate.destroy\n\n respond_to do |format|\n format.html { redirect_to(aggregates_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "8beb1eb73e2330e1f85ba70bd44b5881",
"score": "0.6940591",
"text": "def destroy\n @generic_table_aggregation = GenericTable::Aggregation.find(params[:id])\n @generic_table_aggregation.destroy\n\n respond_to do |format|\n format.html { redirect_to generic_table_aggregations_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7b8cb41d16b8ea11f791daee1f16cc88",
"score": "0.665821",
"text": "def destroy\n @event_agg.destroy\n respond_to do |format|\n format.html { redirect_to event_aggs_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "dfdfcbb7fc9dc8bb0179a5a59a73cbe4",
"score": "0.6319405",
"text": "def delete_analysis(analysis_id); rest_delete(\"#{link('analyses')}/#{analysis_id}\"); nil; end",
"title": ""
},
{
"docid": "e83fff9f24e942afdf123400328bf4fe",
"score": "0.62139046",
"text": "def destroy\n @datasource.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1a9362aedea703760222c579d2686569",
"score": "0.6188711",
"text": "def delete_metadata(key_name)\n requires :id\n service.delete_snapshot_metadata(id, key_name)\n true\n end",
"title": ""
},
{
"docid": "94c8fada48b01ca34e13ba1c2811654f",
"score": "0.6140643",
"text": "def destroy\n @metadata_schema = MetadataSchema.find(params[:id])\n @metadata_schema.destroy\n\n respond_to do |format|\n @metadata_schemas = MetadataSchema.arrange(:order => :created_at)\n format.html { redirect_to metadata_schemas_url }\n format.json { head :no_content }\n format.js { render 'create.js'}\n end\n end",
"title": ""
},
{
"docid": "a043aa8bfd1b6f976997bf10ba903522",
"score": "0.61159766",
"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": "1523d093eed147e7ee53d375984af5cb",
"score": "0.6101576",
"text": "def destroy\n onesecgroup('delete', resource[:name])\n @property_hash.clear\n end",
"title": ""
},
{
"docid": "99b4a5bd3864e4f866e62cd849e8c789",
"score": "0.60518104",
"text": "def destroy\n @summary.destroy\n respond_to do |format|\n format.html { redirect_to summaries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a6dab1c819138ec510e69b704d6944b7",
"score": "0.602551",
"text": "def delete_convention_data(study:, metadata_file:)\n bq_dataset = ApplicationController.big_query_client.dataset CellMetadatum::BIGQUERY_DATASET\n if metadata_file.use_metadata_convention\n bq_dataset.query \"DELETE FROM #{CellMetadatum::BIGQUERY_TABLE} WHERE study_accession = '#{study.accession}' AND file_id = '#{metadata_file.id}'\"\n SearchFacet.delay.update_all_facet_filters\n end\n end",
"title": ""
},
{
"docid": "179ff0053e8f4f967cb3d92206094cf0",
"score": "0.6022767",
"text": "def delete_aos_version(args = {}) \n delete(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend",
"title": ""
},
{
"docid": "01a0928229fd6d6014148f0cf5271dc6",
"score": "0.60000885",
"text": "def destroy\n @admin_sub_metric.destroy\n respond_to do |format|\n format.html { redirect_to admin_sub_metrics_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8631f2d68511384dfeabbcb9b3a0e0f3",
"score": "0.599431",
"text": "def destroy\n @annotation = Annotation.find(params[:id])\n @annotation.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "eedc100018298140fb3522e0007e8db6",
"score": "0.5991459",
"text": "def destroy\n @image_dataset = ImageDataset.find(params[:id])\n @image_dataset.destroy\n\n respond_to do |format|\n format.html { redirect_to(image_datasets_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7ae68d48e26e65fdde24fd27805a3ad3",
"score": "0.5990706",
"text": "def destroy\n collection = Collection.find(@mlog_entry[:collection_id])\n @mlog_entry.destroy\n respond_to do |format|\n format.html { redirect_to collection}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "b0606148fafa97da9052f3e66dc2ac8b",
"score": "0.598761",
"text": "def destroy\n @analytics_used_analysable.destroy\n respond_to do |format|\n format.html { redirect_to analytics_used_analysables_url, notice: 'Analytics used analysable was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6260348f0a1c7fb404460be9b85abc4c",
"score": "0.5963732",
"text": "def destroy\n persister.delete(resource: delete_change_set)\n respond_to do |format|\n format.html { redirect_to data_dictionary_fields_url, notice: 'Metadata field was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5d033b4086a56ffabb9b28fe823aadbd",
"score": "0.5950042",
"text": "def destroy\n @event_configurations.destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "7070e4dc3849fac5852c0271c9b6d7cc",
"score": "0.59485394",
"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": "02e7d3b6b0745b011c99e41fbafa36cf",
"score": "0.5941474",
"text": "def destroy\n @id = params[:id]\n @offset = (params[:offset] || \"-1\").to_i\n @mode = params[:deleteMode]\n @document.delete_annotation(@mode, @id, @offset, params[:type], params[:concept])\n @entity_types = EntityType.where(collection_id: @document.collection_id)\n\n # @annotation.destroy\n respond_to do |format|\n format.html { redirect_to @document, notice: 'The annotation was successfully deleted.' }\n format.json { render :show, status: :ok, location: @annotation }\n end\n end",
"title": ""
},
{
"docid": "3c3b98d26781ec157cb29d03474134d9",
"score": "0.5940331",
"text": "def destroy\n @opml_metadata = OpmlMetadata.find(params[:id])\n @opml_metadata.destroy\n\n respond_to do |format|\n format.html { redirect_to(opml_metadatas_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "27652aac1f1886179b811c744eb62fa6",
"score": "0.5938128",
"text": "def destroy\n @data_collection = DataCollection.find(params[:id])\n @data_collection.destroy\n\n respond_to do |format|\n format.html { redirect_to data_collections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bf8b3c5b77b31cdea63f7a5f08988491",
"score": "0.59266543",
"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.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0aabfd70910b8480a97cffeb53be8800",
"score": "0.5917947",
"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": "3b68c60e409ca5483af02f24ac2d3722",
"score": "0.59108835",
"text": "def destroy\n @aspect = Aspect.find(params[:id])\n @aspect.destroy\n\n respond_to do |format|\n format.html { redirect_to(aspects_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "ae032290a9d347ef4e3b89c92129c190",
"score": "0.58989346",
"text": "def destroy\n metric.destroy\n\n respond_with(metric)\n end",
"title": ""
},
{
"docid": "53478fac1164360cc088b6736ed54f7c",
"score": "0.5894166",
"text": "def destroy\n @test_meta_datum.destroy\n respond_to do |format|\n format.html { redirect_to test_meta_data_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "950c6308cc9ff9e9df4b870de6b07273",
"score": "0.5892495",
"text": "def destroy\n\n DataField.destroy_all :data_collection_id => @data_collection.id\n\n if not @data_collection.collection_name.nil?\n mongo_collection = MongoConnection.instance.get_collection @data_collection.collection_name\n mongo_collection.drop\n end\n\n @data_collection.destroy\n\n respond_to do |format|\n format.html { redirect_to data_collections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1e8133f9b54e3d48b0ae6e1f5e9d32af",
"score": "0.58921456",
"text": "def destroy\n @dataload_ga = DataloadGa.find(params[:id])\n @dataload_ga.destroy\n\n respond_to do |format|\n format.html { redirect_to dataload_gas_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "041c430400c5922500b3a0f435540135",
"score": "0.5890353",
"text": "def destroy\n @analysis.destroy\n respond_to do |format|\n format.html { redirect_to analyses_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "d1f0a8e8c97a0438790f1ddeeecaca29",
"score": "0.5889012",
"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": "4991191fc69ce093bb836fa2ea954aba",
"score": "0.588817",
"text": "def destroy\n @collection = @document.collection\n @document.destroy\n @collection.update_annotation_count\n respond_to do |format|\n format.html { redirect_back fallback_location: collection_documents_path(@collection), notice: 'The document was successfully removed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1a271113a7ebd8c1787e6572186174f0",
"score": "0.58846223",
"text": "def destroy\n identifier = @analysis_configuration.identifier\n @analysis_configuration.destroy\n respond_to do |format|\n format.html { redirect_to analysis_configurations_url, notice: \"'#{identifier}' was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "74f96a447dc1ec547eea00d0a11f9f5f",
"score": "0.5867008",
"text": "def delete_elasticsearch_addressbase_data\n uri = URI.parse(\"#{$ELASTIC_SEARCH_ENDPOINT}/\")\n conn = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Delete.new \"#{$ELASTICSEARCH_ADDRESSBASE}\"\n request['Content-Type'] = 'application/json'\n conn.request(request)\nend",
"title": ""
},
{
"docid": "0f5961c8902cf180ad807823410c6e31",
"score": "0.5865829",
"text": "def destroy\n @spatial_coverages = SpatialCoverages.find(params[:id])\n @spatial_coverages.destroy\n\n respond_to do |format|\n format.html { redirect_to spatial_coverage_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f9fa39da67ad511b50494bbbddb9d69f",
"score": "0.58367527",
"text": "def delete_metadata_full_path\n FileUtils.safe_unlink(metadata_full_path)\n @metadata_full_path = nil\n end",
"title": ""
},
{
"docid": "f9fa39da67ad511b50494bbbddb9d69f",
"score": "0.58367527",
"text": "def delete_metadata_full_path\n FileUtils.safe_unlink(metadata_full_path)\n @metadata_full_path = nil\n end",
"title": ""
},
{
"docid": "1bf3cf769e24af9303157a78438c0827",
"score": "0.58324474",
"text": "def destroy\n @gallery_asset = GalleryAsset.find(params[:id])\n @gallery_asset.destroy\n\n respond_to do |format|\n format.html { redirect_to(gallery_assets_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "a1113d3797921a46c1cb730f4416d6ae",
"score": "0.5818277",
"text": "def delete(uuid, key)\n request(method: 'DELETE', uri: \"/files/#{uuid}/metadata/#{key}/\")\n end",
"title": ""
},
{
"docid": "d4283b8650a3f254353ccb6f7d845bbc",
"score": "0.5807862",
"text": "def destroy\r\n @event.destroy\r\n @item.image.destroy # remove image from s3\r\n @item.image.clear # queues attachment to be deleted\r\n respond_to do |format|\r\n format.html { redirect_to events_url }\r\n format.json { head :no_content }\r\n end\r\n flash[:success] = \"Event deleted.\"\r\n redirect_to events_url\r\n end",
"title": ""
},
{
"docid": "9b9407fd7a12903fd6f6a21bebdaa372",
"score": "0.5793193",
"text": "def destroy\n @sample_metadata_numerical.destroy\n respond_to do |format|\n format.html { redirect_to sample_metadata_numericals_url, notice: 'Sample metadata numerical was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "91cd62a4909b12c49ab0339bbfc00d77",
"score": "0.5792663",
"text": "def destroy\n @distribution_audit = DistributionAudit.find(params[:id])\n @distribution_audit.destroy\n\n respond_to do |format|\n format.html { redirect_to distribution_audits_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "66a8b5d89e45f689716e4fac25f9dc2e",
"score": "0.5792504",
"text": "def destroy\n @annual_summary_report.destroy\n respond_to do |format|\n format.html { redirect_to annual_summary_reports_url}\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "c2dc1d160bec82dbbcb1e7687d40312a",
"score": "0.57924986",
"text": "def destroy\n @metric_source.destroy\n respond_to do |format|\n format.html { redirect_to metric_sources_url, notice: 'Metric source was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "88e33744d227f4b90a07f24f039862fc",
"score": "0.5792245",
"text": "def delete_convention_data\n if self.metadata_file.present? && self.metadata_file.use_metadata_convention\n Rails.logger.info \"Removing convention data for #{self.accession} from BQ\"\n bq_dataset = ApplicationController.big_query_client.dataset CellMetadatum::BIGQUERY_DATASET\n bq_dataset.query \"DELETE FROM #{CellMetadatum::BIGQUERY_TABLE} WHERE study_accession = '#{self.accession}' AND file_id = '#{self.metadata_file.id}'\"\n Rails.logger.info \"BQ cleanup for #{self.accession} completed\"\n SearchFacet.delay.update_all_facet_filters\n end\n end",
"title": ""
},
{
"docid": "6fa38ad15a0d737a9a5330676e4bdef0",
"score": "0.5786611",
"text": "def delete_all\n refresh_index!\n Elasticsearch::Persistence.client.delete_by_query(\n index: alias_name,\n conflicts: :proceed,\n body: { query: { match_all: {} } }\n )\n end",
"title": ""
},
{
"docid": "c7eb46a5c444e24fb5fa731ae6f4ae76",
"score": "0.5785162",
"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": "f2770115e4a60045161304a293d033bf",
"score": "0.5783355",
"text": "def destroy\n @health_record.destroy\n respond_to do |format|\n format.html { redirect_to health_records_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "663c93604447a2e3689fa197f0fcd260",
"score": "0.57832056",
"text": "def destroy\n authorize! :manage, @vspec\n metric = @vspec.metric\n @vspec.destroy\n respond_to do |format|\n format.html { redirect_to [metric.service, metric] }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "35f6838f2bf4c61c31a4f8e595901186",
"score": "0.5777566",
"text": "def destroy\n @accessory_gallery.destroy\n respond_to do |format|\n format.html { redirect_to accessory_galleries_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "435a0330c575312fac5f251eaaf9aad2",
"score": "0.5773639",
"text": "def destroy\n @event_meta = EventMeta.find(params[:id])\n @event_meta.destroy\n\n respond_to do |format|\n format.html { redirect_to(event_metas_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e0e772a4e1cfaa15747b976ee2a0ba66",
"score": "0.57679653",
"text": "def destroy\n @adocao_animal = AdocaoAnimal.find(params[:id])\n @adocao_animal.destroy\n\n respond_to do |format|\n format.html { redirect_to adocao_animals_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "8a31a4261a7d00d32c945640abc366bd",
"score": "0.57675374",
"text": "def destroy\n request.format = \"json\"\n\n @annotation = Annotation.where(\"annotation_id like ? \", \"%#{params['id']}\").first\n\n if @annotation.nil?\n format.json { render json: nil, status: :ok }\n else\n\n unless check_anno_auth(request, @annotation)\n return render_forbidden(\"There was an error deleting the annotation\")\n end\n\n if @annotation.version.nil? || @annotation.version < 1\n @annotation.version = 1\n end\n if !version_annotation @annotation\n errMsg = \"Annotation could not be versioned: \" + @problem\n render :json => { :error => errMsg },\n :status => :unprocessable_entity\n end\n @annotation.destroy\n respond_to do |format|\n format.html { redirect_to annotation_layers_url }\n format.json { head :no_content }\n end\n end\n end",
"title": ""
},
{
"docid": "846ebc9811354ce2063d78756174954a",
"score": "0.5762977",
"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": "49fddd87989873b36535d9938627afc1",
"score": "0.57611257",
"text": "def delete(path)\n path = relativize_path path\n\n Precog.connect self do |http|\n uri = Addressable::URI.new\n uri.query_values = { :apiKey => api_key }\n\n http.delete \"/ingest/v#{VERSION}/fs/#{path}?#{uri.query}\"\n end\n end",
"title": ""
},
{
"docid": "54027e527e7f839a7e68c52747d05bb9",
"score": "0.57596093",
"text": "def delete # rubocop:disable Metrics/AbcSize\n attrcheck = { 'container name' => @options[:container] }\n @validate.attrvalidate(@options, attrcheck)\n containerview = ObjectStorage.new(@options[:id_domain], @options[:user_name], @options[:passwd])\n if @options[:recurse]\n contents = containerview.contents(@options[:container])\n container_contents = contents.body.split(/\\n/)\n container_contents.each do |content|\n containerview.delete_content(@options[:container], content)\n puts 'deleted ' + content\n end\n end\n containerview = containerview.delete(@options[:container])\n if containerview.code == '204'\n puts \"Container #{@options[:container]} deleted\"\n else\n @util.response_handler(containerview)\n end\n end",
"title": ""
},
{
"docid": "1f4a44cd78800aa7074f6b5a70c1ecf4",
"score": "0.57584494",
"text": "def on_object_deleted(event)\n return unless resource?(event.payload[:object])\n Hyrax.index_adapter.delete(resource: event[:object])\n end",
"title": ""
},
{
"docid": "793857d6126d42749918a7bec479c164",
"score": "0.5758353",
"text": "def destroy\n @dataset_datum.destroy\n respond_to do |format|\n format.html { redirect_to dataset_data_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "81c8f374262391f91cafabd754c569d0",
"score": "0.57495815",
"text": "def deleteEntitySocialmedia( 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/socialmedia\",params)\n end",
"title": ""
},
{
"docid": "df2ea6db27dd08edb8d2e24a41289210",
"score": "0.57475543",
"text": "def destroy\n @snapshot.destroy\n\n respond_to do |format|\n format.html { redirect_to(snapshots_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "d5287764099ef4c9a08c8692df1290a9",
"score": "0.5746254",
"text": "def destroy\n @datastore = Datastore.find(params[:id])\n @datastore.destroy\n\n respond_to do |format|\n format.html { redirect_to datastores_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5c2a2b14653c7068acb8c99647342c9d",
"score": "0.5745059",
"text": "def destroy\n @media_metadata_item = MediaMetadataItems.find(params[:id])\n @media_metadata_item.destroy\n\n respond_to do |format|\n format.html { redirect_to(media_metadata_items_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "00bd1c1c14bfd06f79e520b89ae3a7af",
"score": "0.574296",
"text": "def destroy\n @reference_analytic.destroy\n respond_to do |format|\n format.html { redirect_to reference_analytics_url, notice: 'Reference analytic was successfully destroyed.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "49fef0c971f3bf604deb0efde035e30a",
"score": "0.5742039",
"text": "def destroy\n @experiment_raw_dataset.destroy\n respond_to do |format|\n format.html { redirect_to experiment_raw_datasets_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "f0e82ff26734819737f904269816e3ca",
"score": "0.5741654",
"text": "def destroy\n onevnet('delete', resource[:name])\n @property_hash.clear\n end",
"title": ""
},
{
"docid": "5210d3409ebc2e803f724e6659fd334b",
"score": "0.5736908",
"text": "def destroy\n @congestion = Congestion.find(params[:id])\n @congestion.destroy\n\n respond_to do |format|\n format.html { redirect_to congestions_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "9e657ded464c647b91d97bfa386f4f86",
"score": "0.5733557",
"text": "def destroy\n @dataset.destroy\n\n respond_to do |format|\n format.html { redirect_to(datasets_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "51baf4cfcabbc5660c807f993ed0128b",
"score": "0.5727865",
"text": "def delete_image_alias(alias_name)\n delete(image_alias_path(alias_name)).metadata\n end",
"title": ""
},
{
"docid": "a9cdf07abd2f7a88bb3bcc4c652167b8",
"score": "0.57277715",
"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": "33335e693b407c46760454c1844d8553",
"score": "0.57267493",
"text": "def destroy\n @doc_type_am_configuration = DocTypeAmConfiguration.find(params[:id])\n @doc_type_am_configuration.destroy\n\n respond_to do |format|\n format.html { redirect_to doc_type_am_configurations_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "4aa4de3eca2722becf3eca038340181a",
"score": "0.5725624",
"text": "def destroy\n @record = Asset.find(params[:id])\n @record.trash\n respond_to do |format| \n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1bf19923b33295ce614c4c41c3bb13c0",
"score": "0.57210135",
"text": "def delete\n if params[:id]\n result = backend_instance.compute_delete(params[:id])\n else\n result = backend_instance.compute_delete_all\n end\n\n if result\n respond_with(Occi::Collection.new)\n else\n respond_with(Occi::Collection.new, status: 304)\n end\n end",
"title": ""
},
{
"docid": "763117da3ba60afe824447a42ce0b8b9",
"score": "0.57191914",
"text": "def destroy\n @pageview.destroy\n respond_to do |format|\n format.html { redirect_to pageviews_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "07e12f5b17e23207e5b474a30b37bb46",
"score": "0.57187355",
"text": "def orchio_delete_graph(kind, to_collection, to_key)\n response = client.send_request(\n :delete,\n inst_args(\n kind: kind,\n to_collection: to_collection,\n to_key: to_key,\n path: \"?purge=true\"\n ))\n orchio_status response, 204\n end",
"title": ""
},
{
"docid": "47eb7861913bfcfb91dc5f9664686696",
"score": "0.571555",
"text": "def destroy\n @medusa_premis_representation_object = MedusaPremis::RepresentationObject.find(params[:id])\n @medusa_premis_representation_object.destroy\n\n respond_to do |format|\n format.html {\n query_params = session[:search] ? session[:search].dup : {}\n query_params.delete :counter\n query_params.delete :total\n link_url = url_for(query_params)\n redirect_to(link_url, notice: 'Representation object was successfully deleted.') }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "a9106be200a0064c75bbdefd1b33582d",
"score": "0.571335",
"text": "def destroy\n @glo_collection.destroy\n respond_to do |format|\n format.html { redirect_to glo_collections_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "5516a4e9d5ac3e6cf693f1f445a8678e",
"score": "0.57130724",
"text": "def delete(query)\n\n connect if @persevere.nil?\n\n deleted = 0\n\n if ! query.is_a?(DataMapper::Query)\n resources = [query].flatten\n else\n resources = read_many(query)\n end\n\n resources.each do |resource|\n tblname = resource.model.storage_name\n id = resource.attributes(:field)['id']\n \n # Retrieve the ID from persever if the resource doesn't have an ID field\n if id.nil?\n query = Persevere.enhance(resource.query)\n path = \"/#{tblname}/#{query.to_json_query_filter}[={'id':id}]\"\n response = @persevere.retrieve(path, {})\n id = JSON.parse(response.body)[0]['id'].match(/(\\w+\\/)*(\\d+)/)[2]\n end\n \n path = \"/#{tblname}/#{id}\"\n # path = \"/#{tblname}/#{resource.key.first}\"\n \n DataMapper.logger.debug(\"(Delete) PATH/QUERY: #{path}\")\n\n result = @persevere.delete(path)\n\n if result.code == \"204\" # ok\n deleted += 1\n end\n end\n return deleted\n end",
"title": ""
},
{
"docid": "7d4aa1b95a62c00729623f3530314a4e",
"score": "0.5712622",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7d4aa1b95a62c00729623f3530314a4e",
"score": "0.5712622",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7d4aa1b95a62c00729623f3530314a4e",
"score": "0.5712622",
"text": "def destroy\n @event.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "3b42317302ca48461cf225f537a02a36",
"score": "0.5712043",
"text": "def destroy\n @collection = Collection.find(params[:id])\n \n #destroy all child documents\n @collection.documents.each do |d|\n upload_remove(d) #Removes upload record if file is deleted\n d.destroy\n end\n \n #destroy all child collections\n @collection.collections.each do |c|\n collection_recursive_destroy(c)\n end\n \n @collection.destroy\n\n respond_to do |format|\n format.html { redirect_to collections_url }\n format.json { head :ok }\n end\n end",
"title": ""
},
{
"docid": "766fd6e6a740fef0786910b9e7186ac0",
"score": "0.57077026",
"text": "def destroy\n puts \"------------------------\"\n document_item = ActiveStorage::Attachment.find(@document.doc.id)\n p document_item.purge\n puts \"------------------------\"\n\n @document.destroy\n respond_to do |format|\n\n\n\n\n format.html { redirect_to property_property_unit_documents_path(@property, @property_unit), notice: 'Dokumentet ble slettet.' }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "466a7ffb811e0732c1cfef29f9866b4c",
"score": "0.5706169",
"text": "def destroy\n @time_series.destroy\n\n respond_to do |format|\n format.html { redirect_to time_series_index_url(@owner), flash: {success: t('app.msgs.success_deleted', :obj => t('mongoid.models.time_series.one'))} }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "0cc4ed19f1f2968782ce35377767489e",
"score": "0.5703892",
"text": "def destroy\n @callout.destroy\n respond_to do |format|\n format.html { redirect_to callouts_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "6a601062667b4959481404a097a7bcf6",
"score": "0.57022196",
"text": "def destroy\n @annotation_source = AnnotationSource.find(params[:id])\n @annotation_source.destroy\n\n respond_to do |format|\n format.html { redirect_to annotation_sources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "1fcb9b85b695b7e644d99318f61d7e80",
"score": "0.5699508",
"text": "def destroy\n @home_indices_ad = Home::Indices::Ad.find(params[:id])\n @home_indices_ad.destroy\n\n respond_to do |format|\n format.html { redirect_to home_indices_ads_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "7bbea9463c9d1cdcd294068bed80fcdb",
"score": "0.56966937",
"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.56966937",
"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": "4c1c164b581dbae14285797e584e8fb7",
"score": "0.5691367",
"text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend",
"title": ""
},
{
"docid": "3fda1a1f08db21b2aad7d74f40aa1388",
"score": "0.5687604",
"text": "def destroy\n @metric = Metric.find(params[:id])\n @metric.destroy\n\n head :no_content\n end",
"title": ""
},
{
"docid": "09fc2820d9479cac0697e20c559268bf",
"score": "0.5683034",
"text": "def delete\n render json: Alien.delete(params[\"id\"])\n end",
"title": ""
},
{
"docid": "9d4f3f17f19a6b39faa5c339ae30e9e0",
"score": "0.5670203",
"text": "def delete_array_for_tenant(args = {}) \n delete(\"/tenants.json/#{args[:tenantId]}/arrays/#{args[:arrayId]}\", args)\nend",
"title": ""
},
{
"docid": "43689ee1f0059fd835c3a7b775701326",
"score": "0.5669519",
"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": "1b9b2dfb899325057973963d80389d86",
"score": "0.56679744",
"text": "def destroy\n @data_store = DataStore.find(params[:id])\n @data_store.destroy\n\n respond_to do |format|\n format.html { redirect_to data_sources_url }\n format.json { head :no_content }\n end\n end",
"title": ""
},
{
"docid": "bf383234764e35d3ca70ba7164129a10",
"score": "0.56637806",
"text": "def destroy\n ImagesIndex.delete params[:id]\n respond_to do |format|\n format.html { redirect_to(\"/images_indices\") }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "e957775008a259e9cd60de26d383a0cd",
"score": "0.5661237",
"text": "def destroy\r\n @agroup.destroy\r\n respond_to do |format|\r\n format.html { redirect_to agroups_url }\r\n format.json { head :no_content }\r\n end\r\n end",
"title": ""
},
{
"docid": "b5e55bd7ff325805e27a9924bb4e9391",
"score": "0.566102",
"text": "def destroy\n Audit.find(params[:id]).destroy\n head :no_content\n end",
"title": ""
},
{
"docid": "5bd751a001193f179bff76fa74f75a64",
"score": "0.56590635",
"text": "def destroy\n @dataservice_blob = Dataservice::Blob.find(params[:id])\n authorize @dataservice_blob\n @dataservice_blob.destroy\n\n respond_to do |format|\n format.html { redirect_to(dataservice_blobs_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "2f2f78cbc35cb551725ce4863ca4cc3e",
"score": "0.56559265",
"text": "def destroy\n @collection.destroy\n\n render json: @collection, status: :ok#, location: @collection\n end",
"title": ""
}
] |
589b0f5d2385fb9555d468a8cb602c85
|
Method will prepare the body of the issue with the steps, expected result and the actual result. issue = A single gitlab issue row from the csv file. Examples prepare_issue_body(row[1]) Returns the updated body with the gitlab markup.
|
[
{
"docid": "eff1331488336211ae66d89293bd4cb0",
"score": "0.7746517",
"text": "def prepare_issue_body issue\n @steps = issue[6]\n @expected = issue[7]\n @actual = issue[8]\n body = \"\\n## Steps to Reproduce\n \\n#{@steps}\n \\n## Expected Result\n \\n#{@expected}\n \\n## Actual Result\n \\n#{@actual}\"\n end",
"title": ""
}
] |
[
{
"docid": "fadc60ad0e244722e7383dfd2b924888",
"score": "0.6531542",
"text": "def issue_body\n @issue_body ||= context.issue_body\n @issue_body ||= issue.body\n end",
"title": ""
},
{
"docid": "e2fa666d30265f5ef232ae1027c493a2",
"score": "0.6087002",
"text": "def report_issue_body\n execution_interval = \"(#{Date.today - range} - #{Date.today})\"\n\n issue = []\n issue << \"[[_TOC_]]\"\n issue << \"# Candidates for promotion to reliable #{execution_interval}\"\n issue << \"Total amount: **#{stable_test_runs.sum { |_k, v| v.count }}**\"\n issue << stable_summary_table(markdown: true).to_s\n issue << results_markdown(:stable)\n return issue.join(\"\\n\\n\") if unstable_reliable_test_runs.empty?\n\n issue << \"# Reliable specs with failures #{execution_interval}\"\n issue << \"Total amount: **#{unstable_reliable_test_runs.sum { |_k, v| v.count }}**\"\n issue << unstable_summary_table(markdown: true).to_s\n issue << results_markdown(:unstable)\n issue.join(\"\\n\\n\")\n end",
"title": ""
},
{
"docid": "8d78173d78ab04b3941c425bd4ae3d20",
"score": "0.6079729",
"text": "def format_issue i, width = columns\n return unless i['created_at']\n ERB.new(<<EOF).result binding\n<% p = i['pull_request']['html_url'] %>\\\n<%= bright { no_color { indent '%s%s: %s' % [p ? '↑' : '#', \\\n*i.values_at('number', 'title')], 0, width } } %>\n@<%= i['user']['login'] %> opened this <%= p ? 'pull request' : 'issue' %> \\\n<%= format_date DateTime.parse(i['created_at']) %>. \\\n<%= format_state i['state'], format_tag(i['state']), :bg %> \\\n<% unless i['comments'] == 0 %>\\\n<%= fg('aaaaaa'){\n template = \"%d comment\"\n template << \"s\" unless i['comments'] == 1\n '(' << template % i['comments'] << ')'\n} %>\\\n<% end %>\\\n<% if i['assignee'] || !i['labels'].empty? %>\n<% if i['assignee'] %>@<%= i['assignee']['login'] %> is assigned. <% end %>\\\n<% unless i['labels'].empty? %><%= format_labels(i['labels']) %><% end %>\\\n<% end %>\\\n<% if i['milestone'] %>\nMilestone #<%= i['milestone']['number'] %>: <%= i['milestone']['title'] %>\\\n<%= \" \\#{bright{fg(:yellow){'⚠'}}}\" if past_due? i['milestone'] %>\\\n<% end %>\n<% if i['body'] && !i['body'].empty? %>\n<%= indent i['body'], 4, width %>\n<% end %>\n\nEOF\n end",
"title": ""
},
{
"docid": "ee72ea1152b2b8457df566861ed3d19c",
"score": "0.60505235",
"text": "def format_issue i, width = columns\n return unless i['created_at']\n ERB.new(<<EOF).result binding\n<% p = i['pull_request']['html_url'] if i.key?('pull_request') %>\\\n<%= bright { no_color { indent '%s%s: %s' % [p ? '↑' : '#', \\\n*i.values_at('number', 'title')], 0, width } } %>\n@<%= i['user']['login'] %> opened this <%= p ? 'pull request' : 'issue' %> \\\n<%= format_date DateTime.parse(i['created_at']) %>. \\\n<% if i['merged'] %><%= format_state 'merged', format_tag('merged'), :bg %><% end %> \\\n<%= format_state i['state'], format_tag(i['state']), :bg %> \\\n<% unless i['comments'] == 0 %>\\\n<%= fg('aaaaaa'){\n template = \"%d comment\"\n template << \"s\" unless i['comments'] == 1\n '(' << template % i['comments'] << ')'\n} %>\\\n<% end %>\\\n<% if i['assignee'] || !i['labels'].empty? %>\n<% if i['assignee'] %>@<%= i['assignee']['login'] %> is assigned. <% end %>\\\n<% unless i['labels'].empty? %><%= format_labels(i['labels']) %><% end %>\\\n<% end %>\\\n<% if i['milestone'] %>\nMilestone #<%= i['milestone']['number'] %>: <%= i['milestone']['title'] %>\\\n<%= \" \\#{bright{fg(:yellow){'⚠'}}}\" if past_due? i['milestone'] %>\\\n<% end %>\n<% if i['body'] && !i['body'].empty? %>\n<%= indent i['body'], 4, width %>\n<% end %>\n\nEOF\n end",
"title": ""
},
{
"docid": "617c45bbc837b9e23214d3911035892d",
"score": "0.5822041",
"text": "def create_issue(repo, title, body = T.unsafe(nil), options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "470d6de93a7b2632fcc0ac2f75688b88",
"score": "0.5631764",
"text": "def get_string_for_issue(issue)\n encapsulated_title = encapsulate_string issue[\"title\"]\n\n title_with_number = \"#{encapsulated_title} [\\\\##{issue['number']}](#{issue['html_url']})\"\n title_with_number = \"#{title_with_number}#{line_labels_for(issue)}\" if @options[:issue_line_labels].present?\n line = issue_line_with_user(title_with_number, issue)\n issue_line_with_body(line, issue)\n end",
"title": ""
},
{
"docid": "3b3491ef1a2058f6eaff060c89e763da",
"score": "0.56107295",
"text": "def create_issue\n author_id, author_found = user_finder.author_id_for(issue)\n\n description =\n MarkdownText.format(issue.description, issue.author, author_found)\n\n attributes = {\n iid: issue.iid,\n title: issue.truncated_title,\n author_id: author_id,\n project_id: project.id,\n description: description,\n milestone_id: milestone_finder.id_for(issue),\n state: issue.state,\n created_at: issue.created_at,\n updated_at: issue.updated_at\n }\n\n insert_and_return_id(attributes, project.issues)\n rescue ActiveRecord::InvalidForeignKey\n # It's possible the project has been deleted since scheduling this\n # job. In this case we'll just skip creating the issue.\n end",
"title": ""
},
{
"docid": "0e1f64452463a147e81d3294dc64d6ea",
"score": "0.54733187",
"text": "def to_issue_body\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5119dd5ffb372e8c64a3c813dee55e0b",
"score": "0.54569334",
"text": "def format_editor issue = nil\n message = ERB.new(<<EOF).result binding\n\nPlease explain the issue. The first line will become the title. Trailing\nmarkdown comments (like these) will be ignored, and empty messages will\nnot be submitted. Issues are formatted with GitHub Flavored Markdown (GFM):\n\n http://github.github.com/github-flavored-markdown\n\nOn <%= repo %>\n\n<%= no_color { format_issue issue, columns - 2 if issue } %>\nEOF\n message.rstrip!\n message.gsub!(/(?!\\A)^.*$/) { |line| line.rstrip }\n max_line_len = message.gsub(/(?!\\A)^.*$/).max_by(&:length).length\n message.gsub!(/(?!\\A)^.*$/) { |line| \"<!-- #{line.ljust(max_line_len)} -->\" }\n # Adding an extra newline for formatting\n message.insert 0, \"\\n\"\n message.insert 0, [\n issue['title'] || issue[:title], issue['body'] || issue[:body]\n ].compact.join(\"\\n\\n\") if issue\n message\n end",
"title": ""
},
{
"docid": "d0b5269db630dbb263088b4011ec5876",
"score": "0.54403484",
"text": "def process_issues()\n issues = @doc.xpath(\"//Issue[@project='#{@@jira_project}']\")\n\n issues.each do |issue|\n\n title = \"#{issue.xpath(\"@key\").text}: #{issue.xpath(\"@summary\").text}\"\n\n # Grab the body of jira ticket\n body = issue.xpath(\"@description\").text + issue.xpath(\"description\").text\n body = process_text(body)\n\n # Github does not allow you to assign a reporter via the API, so...\n # Add the original reporter as an addendum.\n body += \"\\n\\n--------------------------------------------------\"\n body += \"\\nImported from JIRA\"\n\n reporter = issue.xpath(\"@reporter\").text\n body += \"\\nOriginally reported by: #{get_author_text(reporter)}\"\n\n options = {}\n\n # Grab the assignee of the jira ticket\n assign = @@authors[issues[0].xpath(\"@assignee\").text] || issues[0].xpath(\"@assignee\").text\n\n # versions / milestones\n issue_milestones = []\n\n @doc.xpath(\"//NodeAssociation[\n @sourceNodeEntity='Issue' and\n @sinkNodeEntity='Version' and\n @associationType='IssueFixVersion' and\n @sourceNodeId='#{issue.xpath(\"@id\")}'\n ]\").each do |version|\n version_id = version.xpath(\"@sinkNodeId\").text.to_i\n milestone_id = @milestones[version_id]\n issue_milestones.push(milestone_id)\n end\n\n puts \"milestones : #{issue_milestones}\" if @@dry_run\n\n if issue_milestones.size > 1\n options[:milestone] = issue_milestones[issue_milestones.size - 1]\n elsif issue_milestones.size == 1\n options[:milestone] = issue_milestones[0]\n end\n\n # labels\n labels = options[:labels] = []\n\n # make the issue type a label\n issue_type = get_gh_label(get_issue_type_name(issue))\n labels.push(issue_type)\n\n # if the status is special, include it as a label\n status_id = issue.xpath(\"@status\").text.to_i\n\n if @@special_statuses.include?(status_id)\n status_label = get_gh_label(@@statuses[status_id])\n labels.push(status_label)\n end\n\n # TODO actual JIRA labels\n\n\n # If it's unassigned, don't try to assign it when you create the ticket\n if assign != \"\"\n options[:assignee] = assign\n end\n\n # Create the ticket\n created = @client.create_issue(@@github_project, title, body, options) unless @@dry_run\n\n # Pull all of the comments associated with this particular issue\n comments = @doc.xpath(\"//Action[@type='comment'][@issue=\"+issue.xpath(\"@id\").text+\"]\")\n comments = comments.sort_by { |comment| comment.xpath(\"@created\").text }\n\n comments.each do |c|\n author = get_author_text(c.xpath(\"@author\").text)\n body = \"#{author} said:\\n\" + process_text(c.xpath(\"@body\").text + c.xpath(\"body\").text)\n @client.add_comment(@@github_project, created.number, body) unless @@dry_run\n end\n\n\n # If the ticket's closed, close it up\n if @@closed_statuses.include?(status_id)\n @client.close_issue(@@github_project, created.number) unless @@dry_run\n end\n\n\n # A little status message never harmed nobody\n puts \"Added: \" + issue.xpath(\"@key\").text\n\n end\nend",
"title": ""
},
{
"docid": "05dabaec4eb91fbd9acbb06ad23006f7",
"score": "0.54197437",
"text": "def format_editor issue = nil\n message = ERB.new(<<EOF).result binding\n\nPlease explain the issue. The first line will become the title. Trailing\nlines starting with '#' (like these) will be ignored, and empty messages will\nnot be submitted. Issues are formatted with GitHub Flavored Markdown (GFM):\n\n http://github.github.com/github-flavored-markdown\n\nOn <%= repo %>\n\n<%= no_color { format_issue issue, columns - 2 if issue } %>\nEOF\n message.rstrip!\n message.gsub!(/(?!\\A)^.*$/) { |line| \"# #{line}\".rstrip }\n message.insert 0, [\n issue['title'] || issue[:title], issue['body'] || issue[:body]\n ].compact.join(\"\\n\\n\") if issue\n message\n end",
"title": ""
},
{
"docid": "0d6bce40cbfdb4cd25b08c488a7cfbf1",
"score": "0.5408784",
"text": "def generate_body(pull_requests, issues); end",
"title": ""
},
{
"docid": "685f1fb1b0ce49d4147a0c543e1f1898",
"score": "0.5272189",
"text": "def open_issue(repo, title, body = T.unsafe(nil), options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "4ec36b5d5960f2466959dfa1b716d838",
"score": "0.52707165",
"text": "def body\n File.read(@issue_path)\n end",
"title": ""
},
{
"docid": "6b67da8b23a6e5ba4246f9b18ee39064",
"score": "0.51780766",
"text": "def hendl_issue(original)\n original_comments = client.issue_comments(source, original.number)\n comments = []\n original_comments.each do |original_comment|\n mapped_login_id = map_login_id(original_comment.user.login)\n table_code = table(mapped_login_id, \"@#{mapped_login_id} commented\")\n body = [table_code, original_comment.body]\n comments << {\n created_at: original_comment.created_at.iso8601,\n body: body.join(\"\\n\\n\")\n }\n end\n\n actual_label = original.labels.collect { |a| a[:name] }\n\n mapped_login_id = map_login_id(original.user.login)\n\n table_link = \"Imported from <a href='#{original.html_url}'>#{source}##{original.number}</a>\"\n table_code = table(mapped_login_id, \"Original issue by @#{mapped_login_id} - #{table_link}\")\n body = [table_code, original.body]\n data = {\n issue: {\n title: original.title,\n body: body.join(\"\\n\\n\"),\n created_at: original.created_at.iso8601,\n assignee: original.assignee.nil? ? nil : map_login_id(original.assignee.login),\n labels: actual_label + [\"imported\"],\n closed: original.state != \"open\"\n },\n comments: comments\n }\n data[:issue][:closed_at] = original.closed_at.iso8601 if original.state != \"open\"\n\n response = Excon.post(\"https://api.github.com/repos/#{destination}/import/issues\", body: data.to_json, headers: request_headers)\n response = JSON.parse(response.body)\n status_url = response['url']\n puts response\n\n new_issue_url = nil\n\n begin\n (5..35).each do |request_num|\n sleep(request_num)\n\n puts \"Sending #{status_url}\"\n async_response = Excon.get(status_url, headers: request_headers) # if this crashes, make sure to have a valid token with admin permission to the actual repo\n async_response = JSON.parse(async_response.body)\n puts async_response.to_s.yellow\n\n new_issue_url = async_response['issue_url']\n break if new_issue_url.to_s.length > 0\n puts \"unable to get new issue url for #{original.number} after #{request_num - 4} requests\".yellow\n end\n rescue => ex\n puts \"Something went wrong, wups\"\n puts ex.to_s\n # If the error message is\n # {\"message\"=>\"Not Found\", \"documentation_url\"=>\"https://developer.github.com/v3\"}\n # that just means that fastlane-bot doesn't have admin access\n end\n\n if new_issue_url.to_s.length > 0\n new_issue_url.gsub!(\"api.github.com/repos\", \"github.com\")\n\n client.update_issue(source, original.number, labels: (actual_label + [\"migrated\"]))\n\n # reason, link to the new issue\n puts \"closing old issue #{original.number}\"\n body = []\n body << \"This issue was migrated to #{new_issue_url}. Please post all further comments there.\"\n body << reason unless reason.nil?\n puts new_issue_url\n client.add_comment(source, original.number, body.join(\"\\n\\n\"))\n smart_sleep\n client.close_issue(source, original.number) unless original.state == \"closed\"\n else\n puts \"unable to find new issue url, not closing or commenting\".red\n client.update_issue(source, original.number, labels: (actual_label + [\"migration_failed\"]))\n puts \"Status URL: #{status_url}\"\n # This means we have to manually migrate the issue\n # if you want to try it again, just remove the migration_failed tag\n end\n end",
"title": ""
},
{
"docid": "6cffac59c48e55449588fbfb6e1860eb",
"score": "0.51689166",
"text": "def create_issue(invoice)\n onea_invoice = invoice.approver.nil?\n\n issue = Jira4R::V2::RemoteIssue.new()\n\n issue.project = PROJECT\n issue.reporter = USERNAME\n\n if onea_invoice then\n issue.assignee = default_approver(invoice.organization.name)\n issue.summary = \"Invoice #{invoice.book_number} for #{invoice.organization.name}\"\n issue.description = \"Invoice #{invoice.book_number} for #{invoice.organization.name}\"\n\n #Add customfield value\n custom_field = Jira4R::V2::RemoteCustomFieldValue.new\n custom_field.customfieldId = REFERENCE_FIELD_ID\n custom_field.values = invoice.book_number\n issue.customFieldValues = [custom_field]\n else\n issue.assignee = invoice.approver\n issue.summary = \"Invoice with booking #{invoice.book_number} for #{invoice.organization.name}\"\n issue.description = \"Invoice with booking #{invoice.book_number} for #{invoice.organization.name}\"\n end\n\n issue.type = issuetype\n issue.components = _find_org_components(invoice.organization.name)\n\n\n puts \"Created issue #{issue.summary}\"\n\n if get_all_invoices_from_jira('\"' + issue.summary + '\"').size == 0 then\n\n puts(\"uploading files for #{issue.summary} : #{invoice.file_name}\")\n new_issue = _create_jira_issue(issue,invoice.organization)\n _upload_file(new_issue, invoice.file_name)\n\n if invoice.approver == 'xxx'\n close_issue(new_issue)\n else\n unless onea_invoice then\n open_issue(new_issue)\n end\n end\n else\n puts \"#{issue.summary} already exists. Skipping\"\n end\n end",
"title": ""
},
{
"docid": "480203bd6701a13fa0483defb1320ae5",
"score": "0.5160173",
"text": "def parse_issues\n na = false\n issue_content = false\n in_issue = false\n issue_id = ''\n single_issue = []\n issue_found = false\n issue_count = 0\n \n @issues_contents.delete_if {|x| x.strip.empty? }\n \n @issues_contents.each do |line|\n if ( line =~ /^#N\\/A/i )\n na = true\n elsif ( line =~ /\\S+/ )\n issue_content = true\n end\n if ( line =~ /^ISSUE/i or line =~ /^# ISSUE/i )\n error(\"Possible typo in ISSUES section. Don't put \\\"ISSUE\\\" at the start of a line and don't put \\\"# ISSUE\\\" (space between # and ISSUE).\")\n end\n end\n \n if ( ! na and ! issue_content )\n error('ISSUES section is empty. If you have no issues to report in this session, specify #N/A.')\n \n elsif ( na and issue_content )\n error('Unexpected text found with #N/A tag in the ISSUES section. If you specify #N/A, no other text is permitted in this section.')\n \n elsif ( na and ! issue_content )\n @f_ISSUES.puts '\"' + File.basename(@file) + \"\\\"\\t\\\"<empty>\\\"\"\n \n elsif ( ! na and issue_content )\n \n @issues_contents.each do |line|\n if ( line =~ /^#ISSUE/i )\n if ( in_issue )\n clear_final_blanks( single_issue )\n \n if ( single_issue.empty? )\n error('Empty issue field in ISSUES section. Please include an issue description after each #ISSUE.')\n else\n @f_ISSUES.print '\"' + File.basename(@file) + \"\\\"\\t\\\"\"\n single_issue.each {|x| @f_ISSUES.print x }\n @f_ISSUES.print \"\\\"\\t\\\"#{issue_id}\\\"\\n\"\n issue_count += 1\n end\n end\n \n line =~ /^#ISSUE\\s+(.+)/i ? issue_id = $1 : issue_id = ''\n \n single_issue = []\n in_issue = true\n \n elsif ( in_issue )\n single_issue << line\n issue_found = true if ( line =~ /\\S+/ )\n \n elsif ( line =~ /\\S+/ )\n error(\"Unexpected text in ISSUES section: \\\"#{line}\\\". Please specify #ISSUE before each issue in this section.\")\n end\n end\n \n if ( in_issue )\n clear_final_blanks( single_issue )\n \n if ( single_issue.empty? )\n error('Empty issue field in ISSUES section. Please include an issue description after each #ISSUE.')\n else\n @f_ISSUES.print '\"' + File.basename(@file) + \"\\\"\\t\\\"\"\n single_issue.each {|x| @f_ISSUES.print x }\n @f_ISSUES.print \"\\\"\\t\\\"#{issue_id}\\\"\\n\"\n issue_count += 1\n end\n end\n end\n \n return issue_count\nend",
"title": ""
},
{
"docid": "470d39f4e1e281e3ad14abfac13a6955",
"score": "0.5124246",
"text": "def get_string_for_issue(issue)\n encapsulated_title = encapsulate_string issue[:title]\n\n title_with_number = \"#{encapsulated_title} [\\\\##{issue[:number]}](#{issue.html_url})\"\n issue_line_with_user(title_with_number, issue)\n end",
"title": ""
},
{
"docid": "3908efc8cc8671381b99222f9c409459",
"score": "0.5105759",
"text": "def issue\n @issue = @project.issues.find_by_id(params[:id]) unless params[:id].blank?\n if @issue\n @attachements = @issue.attachments\n @description = params[:issue] && params[:issue][:description]\n #Attenzione con HTML non serve --> remare questo if\n if @description && @description.gsub(/(\\r?\\n|\\n\\r?)/, \"\\n\") == @issue.description.to_s.gsub(/(\\r?\\n|\\n\\r?)/, \"\\n\")\n @description = nil\n end\n @notes = params[:notes]\n else\n @description = (params[:issue] ? params[:issue][:description] : nil)\n end\n render :layout => false\n end",
"title": ""
},
{
"docid": "7dfe7f1fcc1d712fc5dd2de20dac2975",
"score": "0.51019174",
"text": "def replace_issue_body(request, event_type)\n\n webhook_json = JSON.parse(request)\n webhook_action = webhook_json[\"action\"]\n\n # Ignore Deleted comments or updates from bots\n if ISSUE_EVENTS.include?(webhook_action) && webhook_json[\"sender\"][\"type\"] != \"bot\"\n issue_body = webhook_json[event_type][\"body\"]\n\n repo_name = webhook_json[\"repository\"][\"full_name\"]\n\n installation_id = webhook_json[\"installation\"][\"id\"]\n\n # Octokit does not support getting GitHub Enterprise access tokens\n access_token = get_app_token(installation_id)\n jira_hostname = get_jira_hostname(access_token, repo_name)\n\n new_body = update_comment(issue_body, jira_hostname)\n\n if new_body != \"\"\n issue_number = webhook_json[event_type][\"number\"]\n\n if access_token != \"\"\n client = Octokit::Client.new(access_token: access_token )\n Octokit.default_media_type =\"application/vnd.github.black-cat-preview\"\n options = {\n body: new_body\n }\n update_result = client.update_issue(repo_name, issue_number, options)\n return 201\n end\n end\n end\n\n return 200\nend",
"title": ""
},
{
"docid": "909e6a6f748cce80d85370fc69cf7125",
"score": "0.5101251",
"text": "def create_issue\n self.issue = GitHub::Issue.create config.github_repo, issue_attributes\n end",
"title": ""
},
{
"docid": "3dcaf4c4f348ad3c2b116bf16a818047",
"score": "0.50973517",
"text": "def import_issue(issue)\n puts \"Importing issue: #{issue}\"\n issue_doc = Nokogiri::HTML(open(issue[:url]))\n issue[:image] = extract_image(issue_doc, issue[:number])\n issue[:sections] = extract_sections(issue_doc)\n return write_to_file(issue)\nend",
"title": ""
},
{
"docid": "7fbacd259d93a30f7adc9a9193213dbd",
"score": "0.50514877",
"text": "def send_new_issue(issue,user)\n setup_email(user)\n @issue = issue\n @user = user\n @subject += \"BUGZ: A new issue has been assigned to you\"\n @from = \"team@lionsher.com\"\n# @body[:url] = \"http://bugz.kernlearning.com/issues/show/#{@issue.id}\" # on staging\n @body[:url] = \"http://#{SITE_URL}/issues/show/#{@issue.id}\"\n content_type \"text/html\"\n end",
"title": ""
},
{
"docid": "c9c4ba59b869ec76010e55d4278e6c76",
"score": "0.5041785",
"text": "def create_issue(title)\n puts \"\\nWrite your issue description right bellow (save and quit with CTRL+D) :\"\n puts \"---------------------------------------------------------------------\\n\\n\"\n begin\n description = STDIN.read\n rescue Interrupt => int\n puts %q[Why did you killed me ? :'(]\n exit!\n end\n Fgi::Executor.new.process_data(title, description)\n end",
"title": ""
},
{
"docid": "e4c5c3c8e3730d189ac1dcac976eabe3",
"score": "0.504066",
"text": "def create_issue(repo, title, body = nil, options = {})\n options[:labels] = case options[:labels]\n when String\n options[:labels].split(\",\").map(&:strip)\n when Array\n options[:labels]\n else\n []\n end\n parameters = { :title => title }\n parameters[:body] = body unless body.nil?\n post \"#{Repository.path repo}/issues\", options.merge(parameters)\n end",
"title": ""
},
{
"docid": "827d3ca085b3294c8ff051e7e0f0dbe2",
"score": "0.5003414",
"text": "def format_issue(issue)\n t(config.format == 'one-line' ? 'issue.oneline' : 'issue.details',\n key: issue.key,\n summary: issue.summary,\n status: issue.status.name,\n assigned: optional_issue_property('unassigned') { issue.assignee.displayName },\n fixVersion: optional_issue_property('none') { issue.fixVersions.first['name'] },\n priority: optional_issue_property('none') { issue.priority.name },\n url: format_issue_link(issue.key))\n end",
"title": ""
},
{
"docid": "073e5b35e02b378b6abd40417eba1171",
"score": "0.4964804",
"text": "def create_issue2\n # Wednesday to Sunday\n create_issue_base(project: subproject, start_date_day: 21, due_date_day: 25, estimated_hours: 100, done_ratio: 80)\n\n create_journal(day: 21)\n create_detail('done_ratio', old_value: 40, value: 60)\n create_detail('estimated_hours', old_value: 20, value: 60)\n\n create_journal(day: 22)\n create_detail('estimated_hours', old_value: 60, value: 100)\n\n create_journal(day: 23)\n create_detail('done_ratio', old_value: 60, value: 80)\n\n create_time_entry(20, day: 21)\n create_time_entry(20, day: 23)\n create_time_entry(20, day: 25)\n\n @issue\n end",
"title": ""
},
{
"docid": "0c16aec8c1cd9fa92da5448ba33695a2",
"score": "0.4952564",
"text": "def issue_comment(issue)\n @issue = issue\n\n mail :to => issue.email, :subject => 'Support Issue Tracking [issue comment]'\n end",
"title": ""
},
{
"docid": "125268e0b559b678d0ea4f3ba3770436",
"score": "0.49306118",
"text": "def update_report(issue)\n if params[:description].length > 0\n description = issue.description\n description += \"\\n\\n--- New Description --- \\n\"\n description += params[:description]\n issue.description = description\n end\n \n custom_fields = CustomField\n issue.custom_field_values.each do |value|\n case custom_fields.find_by_id(value.custom_field_id).name\n when \"Device\"\n value.value = value.value += \"\\n\"\n value.value = value.value += params[:device]\n when \"Date\"\n value.value = value.value += \"\\n\"\n value.value = value.value += params[:date]\n when \"Count\"\n value.value = (value.value.to_i + 1).to_s\n end\n end\n issue.init_journal(User.anonymous, \"Issue updated\")\n return issue.save\n end",
"title": ""
},
{
"docid": "946d6caf43eebd725dad0c5d7d3d6a58",
"score": "0.49110997",
"text": "def issue_add(issue)\n @title = 'ARTICOLO CREATO'\n redmine_headers 'Project' => issue.project.identifier,\n 'Issue-Id' => issue.id,\n 'Issue-Author' => issue.author.login\n redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to\n message_id issue\n recipients issue.recipients\n cc(issue.watcher_recipients - @recipients)\n #subject acronym(issue.author) << \"[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}\"\n subject \"Nuovo [#{issue.project.name}] #{issue.subject} [#{issue.status.name}/\" << acronym(issue.author) << \"]\"\n body :issue => issue,\n :issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue)\n render_multipart('issue_add', body)\n end",
"title": ""
},
{
"docid": "004820e159447c9b1d6e1082d033aacb",
"score": "0.49052456",
"text": "def create_issue1\n # Monday to Wednesday\n create_issue_base(project: project, start_date_day: 19, due_date_day: 22, estimated_hours: 20, done_ratio: 100)\n\n create_journal(day: 19)\n create_detail('done_ratio', old_value: 20, value: 80)\n create_detail('estimated_hours', old_value: 4, value: 10)\n\n # To check if correct value win\n create_journal(day: 20)\n create_detail('estimated_hours', old_value: 10, value: 16)\n create_journal(day: 20)\n create_detail('estimated_hours', old_value: 16, value: 18)\n create_journal(day: 20)\n create_detail('estimated_hours', old_value: 18, value: 20)\n\n create_journal(day: 21)\n create_detail('done_ratio', old_value: 80, value: 100)\n\n create_time_entry(10, day: 20)\n create_time_entry(15, day: 21)\n create_time_entry(20, day: 22)\n\n @issue\n end",
"title": ""
},
{
"docid": "a566e85373c6f8c8bb0be370c68568c2",
"score": "0.48885682",
"text": "def issue_add(issue)\n redmine_headers 'Project' => issue.project.identifier,\n 'Issue-Id' => issue.id,\n 'Issue-Author' => issue.author.login\n redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to\n message_id issue\n references issue\n @author = issue.author\n @issue = issue\n @users = [User.current]\n @issue_url = url_for(:controller => 'issues', :action => 'show', :id => issue)\n mail :to => User.current,\n :subject => \"[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] (#{issue.status.name}) #{issue.subject}\"\n end",
"title": ""
},
{
"docid": "85474b438b0e67144fa1fac68e2ec2ed",
"score": "0.48555088",
"text": "def issue_to_pdf(issue, assoc={})\n pdf = ITCPDF.new(current_language)\n pdf.set_title(\"#{issue.project} - #{issue.tracker} ##{issue.id}\")\n pdf.alias_nb_pages\n pdf.footer_date = format_date(Date.today)\n pdf.add_page\n pdf.SetFontStyle('B',11)\n buf = \"#{issue.project} - #{issue.tracker} ##{issue.id}\"\n pdf.RDMMultiCell(190, 5, buf)\n pdf.SetFontStyle('',8)\n base_x = pdf.get_x\n i = 1\n issue.ancestors.visible.each do |ancestor|\n pdf.set_x(base_x + i)\n buf = \"#{ancestor.tracker} # #{ancestor.id} (#{ancestor.status.to_s}): #{ancestor.subject}\"\n pdf.RDMMultiCell(190 - i, 5, buf)\n i += 1 if i < 35\n end\n pdf.SetFontStyle('B',11)\n pdf.RDMMultiCell(190 - i, 5, issue.subject.to_s)\n pdf.SetFontStyle('',8)\n pdf.RDMMultiCell(190, 5, \"#{format_time(issue.created_on)} - #{issue.author}\")\n pdf.ln\n\n left = []\n left << [l(:field_status), issue.status]\n\n ##### AYTYCRM - Silvio Fernandes #####\n # caso usuario nao seja ayty remove as informacoes de prioridade\n #left << [l(:field_priority), issue.priority]\n left << [l(:field_priority), issue.priority] if User.current.ayty_is_user_ayty?\n\n left << [l(:field_assigned_to), issue.assigned_to] unless issue.disabled_core_fields.include?('assigned_to_id')\n left << [l(:field_category), issue.category] unless issue.disabled_core_fields.include?('category_id')\n left << [l(:field_fixed_version), issue.fixed_version] unless issue.disabled_core_fields.include?('fixed_version_id')\n\n right = []\n right << [l(:field_start_date), format_date(issue.start_date)] unless issue.disabled_core_fields.include?('start_date')\n right << [l(:field_due_date), format_date(issue.due_date)] unless issue.disabled_core_fields.include?('due_date')\n right << [l(:field_done_ratio), \"#{issue.done_ratio}%\"] unless issue.disabled_core_fields.include?('done_ratio')\n right << [l(:field_estimated_hours), l_hours(issue.estimated_hours)] unless issue.disabled_core_fields.include?('estimated_hours')\n right << [l(:label_spent_time), l_hours(issue.total_spent_hours)] if User.current.allowed_to?(:view_time_entries, issue.project)\n\n rows = left.size > right.size ? left.size : right.size\n while left.size < rows\n left << nil\n end\n while right.size < rows\n right << nil\n end\n\n half = (issue.visible_custom_field_values.size / 2.0).ceil\n issue.visible_custom_field_values.each_with_index do |custom_value, i|\n (i < half ? left : right) << [custom_value.custom_field.name, show_value(custom_value, false)]\n end\n\n if pdf.get_rtl\n border_first_top = 'RT'\n border_last_top = 'LT'\n border_first = 'R'\n border_last = 'L'\n else\n border_first_top = 'LT'\n border_last_top = 'RT'\n border_first = 'L'\n border_last = 'R'\n end\n\n rows = left.size > right.size ? left.size : right.size\n rows.times do |i|\n heights = []\n pdf.SetFontStyle('B',9)\n item = left[i]\n heights << pdf.get_string_height(35, item ? \"#{item.first}:\" : \"\")\n item = right[i]\n heights << pdf.get_string_height(35, item ? \"#{item.first}:\" : \"\")\n pdf.SetFontStyle('',9)\n item = left[i]\n heights << pdf.get_string_height(60, item ? item.last.to_s : \"\")\n item = right[i]\n heights << pdf.get_string_height(60, item ? item.last.to_s : \"\")\n height = heights.max\n\n item = left[i]\n pdf.SetFontStyle('B',9)\n pdf.RDMMultiCell(35, height, item ? \"#{item.first}:\" : \"\", (i == 0 ? border_first_top : border_first), '', 0, 0)\n pdf.SetFontStyle('',9)\n pdf.RDMMultiCell(60, height, item ? item.last.to_s : \"\", (i == 0 ? border_last_top : border_last), '', 0, 0)\n\n item = right[i]\n pdf.SetFontStyle('B',9)\n pdf.RDMMultiCell(35, height, item ? \"#{item.first}:\" : \"\", (i == 0 ? border_first_top : border_first), '', 0, 0)\n pdf.SetFontStyle('',9)\n pdf.RDMMultiCell(60, height, item ? item.last.to_s : \"\", (i == 0 ? border_last_top : border_last), '', 0, 2)\n\n pdf.set_x(base_x)\n end\n\n pdf.SetFontStyle('B',9)\n pdf.RDMCell(35+155, 5, l(:field_description), \"LRT\", 1)\n pdf.SetFontStyle('',9)\n\n # Set resize image scale\n pdf.set_image_scale(1.6)\n text = textilizable(issue, :description,\n :only_path => false,\n :edit_section_links => false,\n :headings => false,\n :inline_attachments => false\n )\n pdf.RDMwriteFormattedCell(35+155, 5, '', '', text, issue.attachments, \"LRB\")\n\n unless issue.leaf?\n truncate_length = (!is_cjk? ? 90 : 65)\n pdf.SetFontStyle('B',9)\n pdf.RDMCell(35+155,5, l(:label_subtask_plural) + \":\", \"LTR\")\n pdf.ln\n issue_list(issue.descendants.visible.sort_by(&:lft)) do |child, level|\n buf = \"#{child.tracker} # #{child.id}: #{child.subject}\".\n truncate(truncate_length)\n level = 10 if level >= 10\n pdf.SetFontStyle('',8)\n pdf.RDMCell(35+135,5, (level >=1 ? \" \" * level : \"\") + buf, border_first)\n pdf.SetFontStyle('B',8)\n pdf.RDMCell(20,5, child.status.to_s, border_last)\n pdf.ln\n end\n end\n\n relations = issue.relations.select { |r| r.other_issue(issue).visible? }\n unless relations.empty?\n truncate_length = (!is_cjk? ? 80 : 60)\n pdf.SetFontStyle('B',9)\n pdf.RDMCell(35+155,5, l(:label_related_issues) + \":\", \"LTR\")\n pdf.ln\n relations.each do |relation|\n buf = relation.to_s(issue) {|other|\n text = \"\"\n if Setting.cross_project_issue_relations?\n text += \"#{relation.other_issue(issue).project} - \"\n end\n text += \"#{other.tracker} ##{other.id}: #{other.subject}\"\n text\n }\n buf = buf.truncate(truncate_length)\n pdf.SetFontStyle('', 8)\n pdf.RDMCell(35+155-60, 5, buf, border_first)\n pdf.SetFontStyle('B',8)\n pdf.RDMCell(20,5, relation.other_issue(issue).status.to_s, \"\")\n pdf.RDMCell(20,5, format_date(relation.other_issue(issue).start_date), \"\")\n pdf.RDMCell(20,5, format_date(relation.other_issue(issue).due_date), border_last)\n pdf.ln\n end\n end\n pdf.RDMCell(190,5, \"\", \"T\")\n pdf.ln\n\n if issue.changesets.any? &&\n User.current.allowed_to?(:view_changesets, issue.project)\n pdf.SetFontStyle('B',9)\n pdf.RDMCell(190,5, l(:label_associated_revisions), \"B\")\n pdf.ln\n for changeset in issue.changesets\n pdf.SetFontStyle('B',8)\n csstr = \"#{l(:label_revision)} #{changeset.format_identifier} - \"\n csstr += format_time(changeset.committed_on) + \" - \" + changeset.author.to_s\n pdf.RDMCell(190, 5, csstr)\n pdf.ln\n unless changeset.comments.blank?\n pdf.SetFontStyle('',8)\n pdf.RDMwriteHTMLCell(190,5,'','',\n changeset.comments.to_s, issue.attachments, \"\")\n end\n pdf.ln\n end\n end\n\n if assoc[:journals].present?\n pdf.SetFontStyle('B',9)\n pdf.RDMCell(190,5, l(:label_history), \"B\")\n pdf.ln\n assoc[:journals].each do |journal|\n\n ##### AYTYCRM - Silvio Fernandes #####\n journal_details = journal.ayty_filter_details(User.current)\n\n # Verifica se houve alteração, se não e o usuario não tiver acesso as Notas não exibe nada\n if journal_details.length > 0 || (!journal.notes.blank? && ayty_user_can_view_content?(User.current, journal.ayty_access_level))\n\n pdf.SetFontStyle('B',8)\n title = \"##{journal.indice} - #{format_time(journal.created_on)} - #{journal.user}\"\n\n # Mostra o nivel de acesso caso não seja a visão do cliente.\n title << \" #{ayty_get_access_level_name(User.current, journal.ayty_access_level)}\"\n\n title << \" (#{l(:field_private_notes)})\" if journal.private_notes?\n pdf.RDMCell(190,5, title)\n pdf.ln\n pdf.SetFontStyle('I',8)\n\n #details_to_strings(journal.visible_details, true).each do |string|\n details_to_strings(journal_details, true).each do |string|\n\n pdf.RDMMultiCell(190,5, \"- \" + string)\n end\n if ayty_user_can_view_content?(User.current, journal.ayty_access_level)\n\n if journal.notes?\n pdf.ln unless journal.details.empty?\n pdf.SetFontStyle('',8)\n text = textilizable(journal, :notes,\n :only_path => false,\n :edit_section_links => false,\n :headings => false,\n :inline_attachments => false\n )\n pdf.RDMwriteFormattedCell(190,5,'','', text, issue.attachments, \"\")\n end\n pdf.ln\n\n end\n\n end\n end\n end\n\n if issue.attachments.any?\n pdf.SetFontStyle('B',9)\n pdf.RDMCell(190,5, l(:label_attachment_plural), \"B\")\n pdf.ln\n for attachment in issue.attachments\n\n # Verifica se o usuario não tiver acesso aos anexos não exibe\n if ayty_user_can_view_content?(User.current, attachment.ayty_access_level)\n\n pdf.SetFontStyle('',8)\n pdf.RDMCell(80,5, attachment.filename)\n pdf.RDMCell(20,5, number_to_human_size(attachment.filesize),0,0,\"R\")\n pdf.RDMCell(25,5, format_date(attachment.created_on),0,0,\"R\")\n pdf.RDMCell(65,5, attachment.author.name,0,0,\"R\")\n pdf.ln\n end\n end\n end\n pdf.output\n end",
"title": ""
},
{
"docid": "21c3abd1df9a135b69f99ebdbcce08f2",
"score": "0.4854323",
"text": "def create_issue_note(project, issue, body)\n post(\"/projects/#{url_encode project}/issues/#{issue}/notes\", body: { body: body })\n end",
"title": ""
},
{
"docid": "21c3abd1df9a135b69f99ebdbcce08f2",
"score": "0.4854323",
"text": "def create_issue_note(project, issue, body)\n post(\"/projects/#{url_encode project}/issues/#{issue}/notes\", body: { body: body })\n end",
"title": ""
},
{
"docid": "96309a10c43ef1f6ede4c206f44c16cc",
"score": "0.4849594",
"text": "def from_issue(issue)\n @owner = issue.owner\n @repository = issue.repository\n @number = issue.number\n @updated_at = issue.updated_at\n\n import\n end",
"title": ""
},
{
"docid": "69e41fdd7f6a605a1cc194b839fb2fa4",
"score": "0.48450178",
"text": "def create_issue_on_repository(repository, issue)\n github_issue = @github.create_issue(\n repository, issue[:title], issue[:description], {labels: issue[:labels].join(\",\")})\n\n # Add comments to the issue\n issue[:comments].each do |comment|\n @github.add_comment(repository, github_issue.number, comment)\n end\n\n # Close issue if status is 'closed'\n github_issue = @github.close_issue(repository, github_issue.number) if issue[:isClosed]\n github_issue\n end",
"title": ""
},
{
"docid": "3f33212c017c3cef49909001ee1fa5fe",
"score": "0.4838229",
"text": "def receive_issue\n project = target_project\n issue = Issue.new\n issue.author = user\n issue.project = project\n issue.safe_attributes = helpdesk_issue_attributes_from_keywords(issue)\n issue.safe_attributes = {'custom_field_values' => custom_field_values_from_keywords(issue)}\n issue.subject = cleaned_up_subject(email)\n issue.subject = '(no subject)' if issue.subject.blank?\n issue.description = cleaned_up_text_body\n issue.start_date ||= Date.today if Setting.default_issue_start_date_to_creation_date?\n\n helpdesk_ticket = HelpdeskTicket.new(:from_address => email.from_addrs.first.to_s.downcase,\n :to_address => email.to_addrs.join(',').downcase,\n :cc_address => email.cc_addrs.join(',').downcase,\n :ticket_date => email.date || Time.now,\n :message_id => email.message_id,\n :is_incoming => true,\n :customer => contact,\n :issue => issue,\n :source => HelpdeskTicket::HELPDESK_EMAIL_SOURCE)\n\n issue.helpdesk_ticket = helpdesk_ticket\n issue.contacts << cc_contacts if HelpdeskSettings[:helpdesk_save_cc, target_project.id].to_i > 0\n\n save_email_as_attachment(helpdesk_ticket) if HelpdeskSettings[:helpdesk_save_as_attachment, target_project].to_i > 0\n add_attachments(issue)\n\n Redmine::Hook.call_hook(:helpdesk_mailer_receive_issue_before_save, { :issue => issue, :contact => contact, :helpdesk_ticket => helpdesk_ticket, :email => email})\n\n ActiveRecord::Base.transaction do\n issue.save!\n ContactNote.create(:content => \"*#{issue.subject}* [#{issue.tracker.name} - ##{issue.id}]\\n\\n\" + issue.description,\n :type_id => Note.note_types[:email],\n :source => contact,\n :author_id => issue.author_id) if HelpdeskSettings[:helpdesk_add_contact_notes, project]\n begin\n notification = HelpdeskMailer.auto_answer(contact, issue).deliver if HelpdeskSettings[:helpdesk_send_notification, project].to_i > 0\n logger.info \"Helpdesk MailHandler: notification was sent to #{notification.to_addrs.first}\" if logger && logger.info && notification\n rescue Exception => e\n logger.error \"Helpdesk MailHandler Error: notification was not sent #{e.message}\" if logger\n false\n end\n\n logger.info \"Helpdesk MailHandler: issue ##{issue.id} created by #{user} for #{contact.name}\" if logger && logger.info\n issue\n end #transaction\n\n end",
"title": ""
},
{
"docid": "407ab171421842ccc1d6b83596b7e6ca",
"score": "0.48361102",
"text": "def create_issue(title:, body: nil, labels: [])\n client.create_issue(repository, title, body, labels: labels)\n end",
"title": ""
},
{
"docid": "df0fcdde03791a629109a517027696c4",
"score": "0.48305944",
"text": "def create_issue(repo, title, body, options={})\n post(\"/repos/#{Repository.new(repo)}/issues\", options.merge({:title => title, :body => body}), 3)\n end",
"title": ""
},
{
"docid": "18a60a75504878e693fd247db0d9ac65",
"score": "0.48266342",
"text": "def _create_jira_issue(issue, organization)\n begin\n begin\n\n puts (\"Creating issue : #{issue.summary}\")\n puts (\" approver = #{issue.assignee}\")\n\n # try creating the ticket\n return @jira.createIssue(issue)\n rescue Exception => ex\n puts \"exception received when creating issue : \" + ex.to_s\n # if it fails try assigning it to the admin user\n issue.assignee = organization.default_approver\n issue.description = \"Upload of invoice assigned to #{issue.assignee} failed with message : #{ex.message}\"\n return @jira.createIssue(issue)\n end\n rescue Exception => ex2\n puts \"Exception creating issue : #{ex2}\"\n puts \"#{ex2.backtrace}\"\n raise Exception.new, \"Exception creating issue\"\n end\n return nil\n end",
"title": ""
},
{
"docid": "5b194fcf5a522ade2452517f56f2f02d",
"score": "0.4824333",
"text": "def create_issue_with_issue issue\n JIRA::Issue.new_with_xml jira_call( 'createIssue', issue )\n end",
"title": ""
},
{
"docid": "13f96abd4939a47074229afb28b1059a",
"score": "0.48219594",
"text": "def controller_issues_new_after_save(context={})\n redmine_url = \"#{Setting[:protocol]}://#{Setting[:host_name]}\"\n issue = context[:issue]\n\n text = l(:xmpp_issue_created) + \" ##{issue.id}\\n\\n\"\n text += l(:field_author) + \": #{issue.author.name}\\n\"\n text += l(:field_subject) + \": #{issue.subject}\\n\"\n text += l(:field_url) + \": #{redmine_url}/issues/#{issue.id}\\n\"\n text += l(:field_project) + \": #{issue.project}\\n\"\n text += l(:field_tracker) + \": #{issue.tracker.name}\\n\"\n text += l(:field_priority) + \": #{issue.priority.name}\\n\"\n if issue.assigned_to\n text += l(:field_assigned_to) + \": #{issue.assigned_to.name}\\n\"\n end\n if issue.start_date\n text += l(:field_start_date) + \": #{issue.start_date.strftime(\"%d.%m.%Y\")}\\n\"\n end\n if issue.due_date\n text += l(:field_due_date) + \": #{issue.due_date.strftime(\"%d.%m.%Y\")}\\n\"\n end\n if issue.estimated_hours\n text += l(:field_estimated_hours) + \": #{issue.estimated_hours} \" + l(:field_hours) + \"\\n\"\n end\n if issue.done_ratio\n text += l(:field_done_ratio) + \": #{issue.done_ratio}%\\n\"\n end\n if issue.status\n text += l(:field_status) + \": #{issue.status.name}\\n\"\n end\n text += \"\\n\\n#{issue.description}\"\n\n deliver text, issue\n end",
"title": ""
},
{
"docid": "13f96abd4939a47074229afb28b1059a",
"score": "0.48219594",
"text": "def controller_issues_new_after_save(context={})\n redmine_url = \"#{Setting[:protocol]}://#{Setting[:host_name]}\"\n issue = context[:issue]\n\n text = l(:xmpp_issue_created) + \" ##{issue.id}\\n\\n\"\n text += l(:field_author) + \": #{issue.author.name}\\n\"\n text += l(:field_subject) + \": #{issue.subject}\\n\"\n text += l(:field_url) + \": #{redmine_url}/issues/#{issue.id}\\n\"\n text += l(:field_project) + \": #{issue.project}\\n\"\n text += l(:field_tracker) + \": #{issue.tracker.name}\\n\"\n text += l(:field_priority) + \": #{issue.priority.name}\\n\"\n if issue.assigned_to\n text += l(:field_assigned_to) + \": #{issue.assigned_to.name}\\n\"\n end\n if issue.start_date\n text += l(:field_start_date) + \": #{issue.start_date.strftime(\"%d.%m.%Y\")}\\n\"\n end\n if issue.due_date\n text += l(:field_due_date) + \": #{issue.due_date.strftime(\"%d.%m.%Y\")}\\n\"\n end\n if issue.estimated_hours\n text += l(:field_estimated_hours) + \": #{issue.estimated_hours} \" + l(:field_hours) + \"\\n\"\n end\n if issue.done_ratio\n text += l(:field_done_ratio) + \": #{issue.done_ratio}%\\n\"\n end\n if issue.status\n text += l(:field_status) + \": #{issue.status.name}\\n\"\n end\n text += \"\\n\\n#{issue.description}\"\n\n deliver text, issue\n end",
"title": ""
},
{
"docid": "7849ba26614d84f809d6d5a2914d9a05",
"score": "0.4815343",
"text": "def create_issue(repository)\n repository_fullname = \"#{github_target_user}/#{repository}\"\n\n options = {}\n #options[:assignee] = github_target_user if [true, false].sample\n options[:closed] = [true, false].sample\n options[:created_at] = timestamp\n options[:labels] = labels\n\n comments = []\n for i in 0..1 + rand(15)\n comments[i] = { created_at: timestamp, body: comment }\n end\n\n result = github.import_issue(repository_fullname, issue_title, issue_body, comments, options)\n\n while result.status == 'pending' do\n result = github.check_issue_status(repository_fullname, result.id)\n if result.status == 'error'\n raise Octokit::InvalidIssue.new(Octokit.last_response)\n end\n end\n end",
"title": ""
},
{
"docid": "542087b044058bdecbf4ae2d357d0628",
"score": "0.4810472",
"text": "def create(issue)\n fetch({:method => :post, :body => issue})\n end",
"title": ""
},
{
"docid": "7ff49699f7124c5966e16c836621f04d",
"score": "0.48076907",
"text": "def prepareExecution(iUserID, iTicketID, iTaskID, iTaskName)\n prepareRedmineExecution do\n $Context[:DummySQLAnswers] = [\n [ # Select\n [ 666 ]\n ],\n [ # Insert\n ]\n ]\n yield\n end\n end",
"title": ""
},
{
"docid": "bdc18977eda8eb973649ccb6de00af36",
"score": "0.47743008",
"text": "def create_issue\n month_dates = get_dates(month)\n for date in month_dates\n issue_title = \"#{date} #{fixed_part}\"\n puts issue_title\n end\n end",
"title": ""
},
{
"docid": "757904e0838341f8a8b71dca629a9484",
"score": "0.47563797",
"text": "def receive_issue_with_redmine_issue_mailer\n\t\t issue = receive_issue_without_redmine_issue_mailer\n\t\t begin\n\t\t \thandler_options = self.handler_options || {}\n\t\t \n\t\t\t if handler_options[\"redmine_issue_mailer_plugin\"] == \"1\"\n\t\t\t issue_reply_subject_re = MailHandler.const_get(:ISSUE_REPLY_SUBJECT_RE)\n\t\t\t m = email.subject.match(issue_reply_subject_re)\n if issue.id != m.try(:[], 1).to_i\n \temail_from_client = issue.issue_email_from_clients.new()\n \temail_from_client.project_id = issue.project_id\n\t\t\t email_from_client.message_id = email.message_id\n\t\t\t email_from_client.from = email.from.join(', ') \n\t\t\t email_from_client.to = email.to.join(', ')\n\t\t\t email_from_client.cc = (email.cc || []).join(', ')\n\t\t\t email_from_client.subject = email.subject\n\t\t\t unless email_from_client.save\n\t\t\t messages = \"\"\n messages = email_from_client.errors.full_messages.join(', ') if email_from_client.errors.any?\n Rails.logger.error \"issue_mailer_plugin Time:#{Time.now} The following error occurred while save client inf: email from: #{email.from} email to: #{email.to} email message_id: #{email.message_id} Messages: #{messages}\"\n\t\t\t else\n\t\t\t issue.description = \"{{view_information_about_letter(#{issue.id}, #{email_from_client.id}, #{issue.project_id}, #{'Issue'})}}\" + \"<pre>#{issue.description}</pre>\"\n\t\t\t issue.save\n\t\t\t end\n end\n\t\t\t end\n\t\t rescue Exception => e\n Rails.logger.error \"issue_mailer_plugin Time:#{Time.now} The following error occurred while works with issue: #{e.backtrace}\"\n\t\t end\n\t\t issue\n\t\t end",
"title": ""
},
{
"docid": "db33e7a1ad14ab3d1d35a29b0ee29cec",
"score": "0.47476846",
"text": "def handle_issue(issue)\n author = Author.find_by(github_id: issue[:id])\n if author.present?\n author.update(name: issue[:title], biography: issue[:body] )\n else\n author = Author.create(name: issue[:title], github_id: issue[:id], from_github: true, biography: issue[:body])\n author.books.create(title: Faker::Book.title, publisher: author, price: 24.20)\n end\n author\n end",
"title": ""
},
{
"docid": "c1a06d236c1de8fc2794eedde75f72e4",
"score": "0.47469342",
"text": "def create_issue(title:, git_service:)\n description = get_issue_description\n\n headers = { git_service.token_header => TOKEN, 'Content-Type' => 'application/json' }\n url_with_querystring = \"#{git_service.routes[:issues]}?title=#{CGI.escape(title)}&description=#{CGI.escape(description)}\"\n\n response = post(url: url_with_querystring, headers: headers)\n response_body = JSON.parse(response[:body])\n\n post_issue_display(response_body['iid'])\n response_body\n end",
"title": ""
},
{
"docid": "b3ff72fc08a56ad4228687636a4e9dce",
"score": "0.4744674",
"text": "def wrap_body_in_template(latex_body, document_title)\n date_code = @options[:source_filename].split('/')\n .last\n .match(/[[:alpha:]]{3}\\d{2}-\\d{4}[[:alpha:]]?/)\n .to_s\n # assign i_vars referenced in template file\n @additional_footer_text = escape_latex_text(@options[:additional_footer_text])\n @body = latex_body\n @date_code = date_code.capitalize\n @font_name = @options[:font_override] || (@options[:is_primary_repo] ? 'V-Calisto-St' : 'V-Excelsior LT Std')\n @git_repo = Repositext::Repository.new\n @header_text = compute_header_text_latex(\n @options[:header_text],\n @options[:is_primary_repo],\n @options[:language_code_2_chars]\n )\n @header_title = compute_header_title_latex(\n document_title,\n @options[:is_primary_repo],\n @options[:language_code_2_chars]\n )\n @include_meta_info = include_meta_info\n @is_primary_repo = @options[:is_primary_repo]\n @latest_commit = @git_repo.latest_commit(@options[:source_filename])\n @latest_commit_hash = @latest_commit.oid[0,8]\n @page_number_command = compute_page_number_command(@options[:is_primary_repo], @options[:language_code_2_chars])\n @page_settings = page_settings_for_latex_geometry_package\n @paragraph_number_font_name = @options[:font_override] ? 'V-Excelsior LT Std' : @font_name\n @scale_factor = size_scale_factor\n @title = escape_latex_text(document_title)\n @title_font_name = @options[:font_override] || 'V-Calisto-St'\n @truncated_title_footer = compute_truncated_title(document_title, 45, 3)\n @use_cjk_package = 'zh' == @options[:language_code_2_chars]\n @version_control_page = if @options[:version_control_page]\n compute_version_control_page(@git_repo, @options[:source_filename])\n else\n ''\n end\n # dependency boundary\n @meta_info = include_meta_info ? compute_meta_info(@git_repo, @latest_commit) : ''\n\n erb = ERB.new(latex_template)\n r = erb.result(binding)\n r\n end",
"title": ""
},
{
"docid": "ea388b28e48cddfb69426047bcef6c9c",
"score": "0.4742203",
"text": "def update_issue_from_params\n @issue = Issue.last\n @time_entry = TimeEntry.new(:issue => @issue, :project => @issue.project)\n\n @issue.init_journal(User.first)\n\n @issue.notes = parse_payload['comment']['body']\n true\n end",
"title": ""
},
{
"docid": "e860bd5e2070fc4abae0e735f40aa4d2",
"score": "0.47413075",
"text": "def generate_pull_request_title_and_body(domain, repo, base_ref, head: 'HEAD', title: nil, summary: nil, body: nil)\n # Extract existing summary if there is one\n match = body.match(/#{SUMMARY_MARKER}(?<summary>.*?)#{AUTOGEN_MARKER}/m)\n if !summary && match\n summary = match['summary'].strip\n summary = nil if summary.empty?\n end\n\n pr_body =\n \"#{TITLE_MARKER}\\n\" \\\n \"#{title}\\n\" \\\n \"#{SUMMARY_MARKER}\\n\" \\\n \"#{summary}\\n\" \\\n \"#{AUTOGEN_MARKER}\\n\" \\\n \"### Commit Summary\\n\" +\n `git log \\\n --reverse \\\n --pretty=\"#### [%s](https://#{domain}/#{repo}/commit/%H)%n%b%n---\" \\\n \"#{base_ref}..#{head}\"`\n\n body = edit_string_with_editor(pr_body)\n\n # Extract new title if there is one\n match = body.match(/#{TITLE_MARKER}(?<title>.*?)#{SUMMARY_MARKER}/m)\n if match\n title = match['title'].strip\n title = nil if title.empty?\n end\n\n # Remove the title from the body since it is stored separately\n body.gsub!(/#{TITLE_MARKER}(?:.*?)(#{SUMMARY_MARKER})/m, '\\\\1')\n\n [title, body]\nend",
"title": ""
},
{
"docid": "6bd2cef405c35582b023812cf4bcd66e",
"score": "0.47288534",
"text": "def create_invoice_from_issue(issue)\n desc = issue.summary\n booking = desc.scan(/booking (.*) for/)[0][0]\n org = desc.scan(/ for (.*)/)[0][0]\n\n inv = Invoice.new()\n inv.organization = Organization.find_or_create_by(name: org)\n inv.book_number = booking\n inv.approver = issue.assignee\n inv.file_name = \"dummy\"\n inv.uploaded = true\n inv.jira_id = issue.key\n inv.jira_status = issue.status\n return inv\n end",
"title": ""
},
{
"docid": "0707eb622cf7f4fffd0dfa382964d03e",
"score": "0.47201282",
"text": "def markdown_issues (results, heading)\n message = \"#### #{heading}\\n\\n\"\n\n message << \"File | Line | Reason |\\n\"\n message << \"| --- | ----- | ----- |\\n\"\n puts \"Markdown resutls: #{results}\"\n results.each do |r|\n filename = r['file'].split('/').last\n line = r['line']\n reason = r['reason']\n\n message << \"#{filename} | #{line} | #{reason} \\n\"\n end\n\n message\n end",
"title": ""
},
{
"docid": "65555689234c50966d84cff4a7338a2e",
"score": "0.47190845",
"text": "def generate_email_template(close_issues, jsonData, environment, project, period)\n num_issue = close_issues.size\n issue_keys = \"\"\n close_issues.each do |issue, previous_status|\n issue_keys = \"#{issue_keys} #{issue.key}\"\n end\n if (environment == 'DEV')\n environment = 'DEV/BETA'\n end\n table_close_issues = generate_report_html_for_close_issues(close_issues)\n table_json = generate_report_html_from_json(jsonData)\n emailBody = \"<p>Dear Anki Team,</p><p>Below is the #{project} Top Error Report for this #{period}.\n We closed #{num_issue} bugs.</p><p>jiralist [#{issue_keys} ]</p><p>#{table_close_issues}</p>\n <p>There is the collected results for reported errors on #{project}:</p>\n <p><b>#{environment}</b></br><p>jiralist [#{table_json[0]} ]</p>#{table_json[1]}</p><p>Thanks,</p>AutoBot\"\n return emailBody\n end",
"title": ""
},
{
"docid": "1eace0862fde8febd9fa073605fd374f",
"score": "0.47027275",
"text": "def createIssue(type, summary, description)\n verbose \"Creating #{type} issue for #{summary}\"\n\n customfields = {}\n cust = $cfg['customfields.create']\n customfields = YAML.load(cust, 'cfg->customfields.create') unless cust.nil?\n verbose \" With custom fields: #{cust.to_json}\" unless cust.nil?\n\n unless $cfg['tool.dry'] then\n post('issue', {\n :fields=>customfields.merge({\n :issuetype=>{:name=>type},\n :project=>{:key=>project},\n :summary=>summary,\n :description=>description,\n :labels=>['auto-imported'],\n })\n })\n else\n {:key=>'_'}\n end\n end",
"title": ""
},
{
"docid": "143d5af977bd1aee852295a474f553d2",
"score": "0.46977195",
"text": "def generate_body(pull_requests, issues)\n body = \"\"\n body += main_sections_to_log(pull_requests, issues)\n body += merged_section_to_log(pull_requests) if @options[:pulls] && @options[:add_pr_wo_labels]\n body\n end",
"title": ""
},
{
"docid": "417a43133dbb56c5b98be1003d1ff293",
"score": "0.46922836",
"text": "def build_new_issue_from_params\n @issue = Issue.new\n @issue.project = Project.first\n @issue.author ||= github_user\n @issue.start_date ||= github_user.today if Setting.default_issue_start_date_to_creation_date?\n @issue.subject = parse_payload['issue']['title']\n @issue.status_id = 1\n @issue.description = parse_payload['issue']['body'] if parse_payload['issue']['body'].present?\n\n if @issue.project\n @issue.tracker ||= @issue.allowed_target_trackers(User.first).first\n if @issue.tracker.nil?\n if @issue.project.trackers.any?\n # None of the project trackers is allowed to the user\n render_error :message => l(:error_no_tracker_allowed_for_new_issue_in_project), :status => 403\n else\n # Project has no trackers\n render_error l(:error_no_tracker_in_project)\n end\n return false\n end\n if @issue.status.nil?\n render_error l(:error_no_default_issue_status)\n return false\n end\n end\n end",
"title": ""
},
{
"docid": "182d56dcff4238da006dbce639473abc",
"score": "0.46906397",
"text": "def create\n @issue = Issue.new(issue_params)\n target_url = issue_params[:url].split('/')\n if target_url.include?(\"jira\")\n xml_url = target_url[0..3]\n xml_url << [\"si\", \"jira.issueviews:issue-xml\", target_url[-1], target_url[-1]+\"xml\"]\n doc = Nokogiri::XML(open(xml_url.join(\"/\")))\n\n @issue.title = doc.xpath('rss/channel/item/title').text\n _, @issue.name, project_name = *@issue.title.match(/\\[((.*?)\\-.*?)\\]/)\n\n @project = Project.find_by(name: project_name)\n if @project.nil?\n @project = Project.new(name: project_name)\n @project.save\n end\n @issue.project = @project\n session[:project_id] = @project.id\n \n @issue.type_text = doc.xpath('rss/channel/item/type').text\n\n @duplicate_issue = Issue.find_by(url: @issue.url)\n if @duplicate_issue.nil?\n begin\n ActiveRecord::Base.transaction do\n @admin = User.find_by(role: :admin)\n @issue.save!\n create_comments(@issue, doc)\n create_edges(@issue.comments, @admin)\n create_edges(@issue.comments, current_user)\n create_svg(@issue, current_user)\n end\n flash[:success] = \"課題の登録に成功\"\n redirect_to @issue\n rescue => e\n logger.error \"----ERROR----\"\n logger.error e\n logger.error \"----ERROR----\"\n flash[:error] = \"課題の登録に失敗\"\n render :new\n end\n else\n flash[:error] = \"登録済みでした\"\n redirect_to new_issue_path\n end\n else\n flash[:error] = \"JIRAのプロジェクトを指定してください\"\n render :new\n end\n\n end",
"title": ""
},
{
"docid": "039ce96b80ed027d563dee2f31635659",
"score": "0.4678805",
"text": "def create_issue_in_jira\n\n if @one_m_users_flag.to_i == 1\n\n format_company_info_fields\n\n issue_params = {\n project_name:GlobalConstant::Jira.project_name,\n issue_type: GlobalConstant::Jira.task_issue_type,\n priority:GlobalConstant::Jira.medium_priority_issue,\n assignee: GlobalConstant::Jira.assignee_name,\n summary: get_issue_summary,\n description: get_issue_description\n }\n\n r = Ticketing::Jira::Issue.new(issue_params).perform\n\n @failed_logs = {\n debug_params: issue_params.to_hash\n } unless r.success?\n\n success\n\n end\n\n success\n\n end",
"title": ""
},
{
"docid": "54513174655196423b3199639b6ee46e",
"score": "0.4673375",
"text": "def create_new_report\n issue = Issue.new\n issue.tracker = tracker\n issue.subject = params[:msg]\n issue.description = params[:description]\n issue.project = Project.find_by_name(params[:app])\n issue.start_date = Time.now.localtime.strftime(\"%Y-%m-%d %T\")\n issue.priority = IssuePriority.find_by_name(\"Normal\")\n issue.author = User.anonymous\n issue.status = IssueStatus.find_by_name(\"New\")\n\n issue.custom_values = [\n create_custom_value(CustomField.find_by_name(\"StackTrace\").id, params[:stackTrace]),\n create_custom_value(CustomField.find_by_name(\"Cause\").id, params[:cause]),\n create_custom_value(CustomField.find_by_name(\"Count\").id, \"1\"),\n create_custom_value(CustomField.find_by_name(\"Device\").id, params[:device]),\n create_custom_value(CustomField.find_by_name(\"Version\").id, value = params[:version]),\n create_custom_value(CustomField.find_by_name(\"Package\").id, value = params[:package]),\n create_custom_value(CustomField.find_by_name(\"Date\").id, value = params[:date])\n ]\n return issue\n end",
"title": ""
},
{
"docid": "75e55c0e67e22333383a61605a734853",
"score": "0.46358547",
"text": "def markdown_issues(results, heading)\n message = \"#### #{heading}\\n\\n\".dup\n\n message << \"File | Line | Reason |\\n\"\n message << \"| --- | ----- | ----- |\\n\"\n\n results.each do |r|\n filename = r['file'].split('/').last\n line = r['line']\n reason = r['reason']\n rule = r['rule_id']\n # Other available properties can be found int SwiftLint/…/JSONReporter.swift\n message << \"#{filename} | #{line} | #{reason} (#{rule})\\n\"\n end\n\n message\n end",
"title": ""
},
{
"docid": "d96c3d0e1142ddece09386506541712d",
"score": "0.46275198",
"text": "def table_body(items_to_format)\n table_array = []\n items_to_format.each_with_index do |item, position|\n table_parser = item.details\n table_array << [\"#{position + 1}\",\n table_parser[:type],\n table_parser[:description],\n table_parser[:date],\n table_parser[:priority]]\n end\n table_array\n end",
"title": ""
},
{
"docid": "48d86268193c3e99bae5b2f5fa5df19d",
"score": "0.46144882",
"text": "def build_report_body\n # This will be a bit more complicated for Statistical Reports.\n pad(10) do\n add_text \"Average Time to fix issues (in hours): \" + data[:avg_time_to_fix].to_s\n end\n add_text \"Average Day's Tasks are open: \" + data[:avg_days_open].to_s\n pad(10) do\n add_text \"New Tasks added last week: \" + data[:new_tasks_last_week].to_s\n end\n add_text \"New Tasks added last month: \" + data[:new_tasks_last_month].to_s\n pad(10) do\n add_text \"New Tasks added last year: \" + data[:new_tasks_last_year].to_s \n end\n add_text \"Completed Tasks last week: \" + data[:completed_tasks_last_week].to_s\n pad(10) do\n add_text \"Completed Tasks last month: \" + data[:completed_tasks_last_month].to_s\n end\n add_text \"Completed Tasks last year: \" + data[:completed_tasks_last_year].to_s\n pad(10) do\n add_text \"Increase in Task backlog: \" + data[:task_back_log_increase].to_s\n end\n #add_text \"Number of re-opened Tasks: \" + data[:num_of_rejected_defects].to_s\n #pad(10) do\n # add_text \"Percentage of re-opened Tasks: \" + data[:percent_rejected_defects].to_s\n #end\n #add_text \"Task Velocity: \" + data[:velocity].to_s\n add_text \"Goal Completion Rate Week-to-date: \" + data[:wtd_goal_completion_rate].to_s\n pad(10) do\n add_text \"Goal Failure Rate Week-to-date: \" + (100.0 - data[:wtd_goal_completion_rate]).to_s\n end\n add_text \"Goal Completion Rate Month-to-date: \" + data[:mtd_goal_completion_rate].to_s\n pad(10) do\n add_text \"Goal Failure Rate Month-to-date: \" + (100.0 - data[:mtd_goal_completion_rate]).to_s\n end\n add_text \"Goal Completion Rate Year-to-date: \" + data[:ytd_goal_completion_rate].to_s\n pad(10) do\n add_text \"Goal Failure Rate Year-to-date: \" + (100.0 - data[:ytd_goal_completion_rate]).to_s\n end\n add_text \"Overall Goal Completion Rate: \" + data[:goal_completion_rate].to_s\n pad(10) do\n add_text \"Overall Goal Failure Rate: \" + (100.0 - data[:goal_completion_rate]).to_s\n end\n end",
"title": ""
},
{
"docid": "fbf3723c1a805afbe424b2d8c3ff11a2",
"score": "0.46125257",
"text": "def issue_params\r\n params.require(:issue).permit(\r\n :title,\r\n :description,\r\n :scenario_id,\r\n :round_id,\r\n :project_id,\r\n :name,\r\n :body,\r\n :gitlab_id,\r\n :is_existing_on_gitlab,\r\n :milestone_id,\r\n :labels,\r\n :labels_text\r\n )\r\n end",
"title": ""
},
{
"docid": "ba97a9eaedfed72a1c30909d46fbb6fd",
"score": "0.45966685",
"text": "def process_input(issue, author, timestamp, body)\n last_comment_timestamp = @timestamps[issue.number] || 0\n return if last_comment_timestamp != 0 && last_comment_timestamp >= timestamp\n\n # bot command or not, we need to update the yaml file so next time we\n # pull in the comments we can skip this one.\n\n add_and_yaml_timestamps(timestamp, issue.number)\n process_message(body, author, issue)\n end",
"title": ""
},
{
"docid": "3e7490be29c04ec9e89fa610fe219bb9",
"score": "0.45963606",
"text": "def inline(issue)\n \"#{issue.severity.to_s.capitalize}\\n#{meta_information(issue)}\\n#{issue.message}\"\n end",
"title": ""
},
{
"docid": "11569b0c8b739c20a6b0e13238a166a6",
"score": "0.45848227",
"text": "def issue\n if issue_id \n Issue.find(issue_id)\n else\n puts \"No issue found for branch #{@branch}\"\n nil\n end\n end",
"title": ""
},
{
"docid": "51ff35b69fcc4417ebfb3ba8dfaa345b",
"score": "0.45738718",
"text": "def print_issue_metadata(issue, gitlab_hash, issue_title)\n puts\n puts \"------\"\n puts\n puts \"\\e[4mVersionOne Issue Metadata:\\e[24m\"\n issue.each do |key, value|\n # For strings like the description, remove any linebreaks from the end\n # and truncate them to 100 characters.\n if value.is_a?(String)\n puts \"\\e[1m#{key.to_s}\\e[22m: #{truncate(value).chomp}\"\n else\n puts \"\\e[1m#{key.to_s}\\e[22m: #{value}\"\n end\n end\n puts\n puts \"\\e[4mGitLab Issue Metadata:\\e[24m\"\n puts \"\\e[1mtitle\\e[22m: #{issue_title}\"\n gitlab_hash.each do |key, value|\n # For strings like the description, remove any linebreaks from the end\n # and truncate them to 100 characters.\n if value.is_a?(String)\n puts \"\\e[1m#{key.to_s}\\e[22m: #{truncate(value).chomp}\"\n else\n puts \"\\e[1m#{key.to_s}\\e[22m: #{value}\"\n end\n end\nend",
"title": ""
},
{
"docid": "083cdbf2b801fb6eefb6588d264df425",
"score": "0.45624027",
"text": "def change_issue(issue, author, category, value, ticket=nil, updated=nil)\n i = issue[:number]\n client = @clients[author]\n case category\n when 'milestone'\n ms = @milestones[value]\n return issue unless ms\n $logger.info(\"issue #{i}: updating milestone to '#{value}'\")\n return client.update_issue_opts(issue, :milestone => ms)\n when 'owner'\n owner = client.login\n if owner and @collaborators.include?(owner)\n $logger.info(\"issue #{i}: updating assignee to '#{owner}'\")\n return client.update_issue_opts(issue, :assignee => owner)\n else\n $logger.warn(\"'#{owner}' not configured as collaborator\")\n end\n when 'status'\n case value\n when 'closed'\n $logger.info(\"issue #{i}: closing\")\n return client.close_issue(i)\n when 'reopened'\n $logger.info(\"issue #{i}: reopening\")\n return client.reopen_issue(i)\n end\n when 'summary'\n $logger.info(\"issue #{i}: updating title to '#{value}'\")\n return client.update_issue(i, value, issue[:body])\n when 'description'\n $logger.info(\"issue #{i}: updating issue description\")\n created_at=nil\n updated_at=nil\n if ticket\n created_at = Time.at(ticket[:time] / 1e6, ticket[:time] % 1e6)\n updated_at = Time.at(ticket[:changetime] / 1e6, ticket[:changetime] % 1e6)\n end\n # we have to see if the old body contains anything we have to\n # keep in the new body\n if not issue[:body].empty?\n body,body_author = markdownify(nil, value, created_at, updated_at)\n issue_author = issue[:body].scan(/(\\*\\*Originally .*\\*\\*\\n\\n___\\n).*/)\n if not issue_author.empty?\n body.insert(0, \"#{issue_author.last.first}\")\n end\n else\n body,body_author = markdownify(author, value, created_at, updated_at)\n end\n if body_author and body_author != author\n client = @clients[body_author]\n end\n return client.update_issue(i, issue[:title], body)\n when 'resolution', 'priority', 'component', 'type', 'version', 'severity', 'platform'\n old_labs = issue[:labels].map { |l| l[:name] }\n return issue unless @labels.has_key?(category)\n t, f = @labels[category].partition { |pat, rep| pat.match(value) }\n if t.empty?\n if value and not value.empty?\n $logger.warn(\"issue #{i}: no match for label '#{value}' in '#{category}'\")\n end\n return issue\n elsif t.size > 1\n $logger.error(\"issue #{i}: more than one match for '#{value}' in '#{category}'\")\n exit 1\n end\n new_labs = old_labs.reject { |lab| f.find { |pat, rep| rep == lab } }\n if old_labs.size != new_labs.size\n $logger.info(\"issue #{i}: replacing all '#{category}' labels by '#{t[0][1]}'\")\n end\n new_label = t[0][1]\n return issue if new_label.empty?\n $logger.info(\"issue #{i}: adding label '#{new_label}'\")\n new_labs << new_label\n new_labs_set = Set.new new_labs\n $logger.debug(\"issue #{i}: updating lables to #{new_labs}\")\n return client.update_issue_opts(issue, :labels => new_labs_set.to_a)\n when 'comment', 'changelog', 'attachment'\n return issue if value == nil || value.empty? || value =~ /Milestone.*deleted/\n $logger.info(\"issue #{i}: adding '#{category}' by '#{author}'\")\n if category == 'attachment'\n value = ticket[:description]\n end\n max_len = 30\n excerpt = value[0, max_len].gsub(/\\n|\\r/, ' ')\n excerpt << '...' if value.size > max_len\n $logger.debug(\"issue #{i}: comment '#{excerpt}'\")\n created_at=nil\n if updated\n created_at = Time.at(updated / 1e6, updated % 1e6)\n end\n\n # depending on the category we have to add\n # a short marker.\n case category\n when 'changelog'\n value.insert(0, \"**Release Note:**\\n\")\n when 'attachment'\n text = \"**Attachment added:**\"\n if @attachurl\n url=\"#{@attachurl}/#{i}/#{ticket[:filename]}\"\n if [\".png\", \".jpg\", \".gif\", \".PNG\", \".JPG\", \".GIF\"].include? File.extname(ticket[:filename])\n text = \"#{text} `#{ticket[:filename]}` (#{(ticket[:size]/1024.0).round(1)} KiB)\\n![#{ticket[:filename]}](#{URI.escape(url)})\"\n else\n text = \"#{text} [`#{ticket[:filename]}`](#{URI.escape(url)}) (#{(ticket[:size]/1024.0).round(1)} KiB)\"\n end\n else\n text = \"#{text} `#{ticket[:filename]}` (#{(ticket[:size]/1024.0).round(1)} KiB)\"\n end\n value.insert(0, \"#{text}\\n\")\n end\n\n body,body_author = markdownify(author, value, created_at)\n if body_author and body_author != author\n client = @clients[body_author]\n end\n client.add_comment(i, body)\n when 'keywords', 'cc', 'reporter' # TODO\n end\n return issue\n end",
"title": ""
},
{
"docid": "8adfb6a2fa6cd2cb4af6c946690e7405",
"score": "0.45605302",
"text": "def issue_new(issue)\n @issue = issue\n\n mail :to => issue.email, :subject => 'Support Issue Tracking [issue new]'\n end",
"title": ""
},
{
"docid": "95a043ade2918b46c15773c4aadc6512",
"score": "0.45524266",
"text": "def export\n self.attributes = {\n issue: {\n subject: \"件名\",\n description: \"説明\",\n project_id: 1\n }\n }\n unless self.save\n binding.pry\n end\n end",
"title": ""
},
{
"docid": "cdfa233ee5cfa3870f62c2837998077b",
"score": "0.4551811",
"text": "def create_issue( project_id, title, priority_id, resolver_id, tester_id, options={})\n description=options[:description]\n tags=options[:tags]\n watcher_id=options[:watcher_id]\n attachments=options[:attachments]\n\n data = {\n 'title' => title,\n 'priority_level_id' => priority_id,\n 'resolver_id' => resolver_id,\n 'tester_id' => tester_id,\n }\n\n data['description'] = description if description\n data['tags'] = tags if tags\n data['watcher_ids'] = watcher_id if watcher_id\n\n params = {:data => data, :update => false, :post => true}\n params[:attachments] = attachments if attachments\n api Constant.url_for('CREATE_ISSUE', project_id), params\n !result.empty? ? result[\"IssueID\"] : nil\n end",
"title": ""
},
{
"docid": "1e6bc1dbd90ef8153ed3b826ba76451f",
"score": "0.4550496",
"text": "def prepare(item)\n layout = item.data[\"layout\"]\n begin\n item.data.delete(\"layout\")\n\n if item.is_a?(Jekyll::Document)\n output = Jekyll::Renderer.new(@site, item).run\n else\n item.render({}, @site.site_payload)\n output = item.output\n end\n ensure\n # restore original layout\n item.data[\"layout\"] = layout\n end\n\n output\n end",
"title": ""
},
{
"docid": "32acd045b88ed01b30594eb05fc2e298",
"score": "0.45459893",
"text": "def comment_body(pr_comment = nil)\n return body.gsub(\"---\\n\", \"\") unless pr_comment\n\n job_entries = jobs_section(pr_comment)\n body(job_entries).gsub(\"---\\n\", \"\")\n end",
"title": ""
},
{
"docid": "f62be3ce7375cc4712bc7d0c6e8da149",
"score": "0.45407715",
"text": "def generate_error_email_body\n error_contents = self.read_parse_logfile(self.error_filepath)\n warning_contents = self.read_parse_logfile(self.warning_filepath)\n message_body = \"<p>'#{self.study_file.upload_file_name}' has failed during parsing.</p>\"\n if error_contents.present?\n message_body += \"<h3>Errors</h3>\"\n error_contents.each_line do |line|\n message_body += \"#{line}<br />\"\n end\n else\n message_body += \"<h3>Event Messages (since no errors were shown)</h3>\"\n message_body += \"<ul>\"\n self.event_messages.each do |e|\n message_body += \"<li><pre>#{ERB::Util.html_escape(e)}</pre></li>\"\n end\n message_body += \"</ul>\"\n end\n\n if warning_contents.present?\n message_body += \"<h3>Warnings</h3>\"\n warning_contents.each_line do |line|\n message_body += \"#{line}<br />\"\n end\n end\n message_body += \"<h3>Details</h3>\"\n message_body += \"<p>Study Accession: <strong>#{self.study.accession}</strong></p>\"\n message_body += \"<p>Study File ID: <strong>#{self.study_file.id}</strong></p>\"\n message_body += \"<p>Ingest Run ID: <strong>#{self.pipeline_name}</strong></p>\"\n message_body += \"<p>Command Line: <strong>#{self.command_line}</strong></p>\"\n message_body\n end",
"title": ""
},
{
"docid": "705fbc870b844b8da3e83708834c3233",
"score": "0.45325914",
"text": "def submit_issue\n if params[:description] == ''\n redirect_to :back, flash: { error: 'Please fill out all required fields.' }\n else\n response = GithubInterface.send_issue(params)\n if response.code == '201'\n redirect_to root_path, flash: { success: 'Issue submitted successfully.' }\n else\n redirect_to root_path, flash: { error: JSON.parse(response.body)['message'] }\n end\n end\n end",
"title": ""
},
{
"docid": "ac371dd4c84ae73411c11ee3d639a9af",
"score": "0.45272508",
"text": "def issue\n @issue ||= github_client.issue(context.repo, context.issue_id)\n end",
"title": ""
},
{
"docid": "136a9eace23be94a9c2ab5a3f2a2b92f",
"score": "0.4522089",
"text": "def issue_params\n params.require(:issue).permit(:title, :content, :courseid, :user, :username, :useremail)\n end",
"title": ""
},
{
"docid": "10019f955e266eea2a05529a0e8a3a98",
"score": "0.45208868",
"text": "def new_issue(title:, options: {})\n git_service = CONFIG[:git_service_class].new\n title = get_issue_title if title.nil?\n response = create_issue(title: title, git_service: git_service)\n\n if CONFIG[:default_branch].nil?\n puts \"\\n/!\\\\ FGI IS NOT UP-TO-DATE /!\\\\\"\n puts 'We are not able to create and switch you to the new branch.'\n puts 'Delete .config.fgi.yml and reconfigure fgi by running `fgi config`'\n elsif !response['iid'].nil?\n branch_name = snakify(title)\n branch_name = \"#{options[:prefix]}/#{branch_name}\" unless options[:prefix].nil?\n save_issue(branch: branch_name, id: response['iid'], title: response['title'].tr(\"'\", ' ').tr('_', ' '))\n create_branch(name: branch_name, from_current: options[:from_current]) unless options[:later]\n unless options[:duration].nil?\n res = set_issue_time_trackers(\n issue_id: response['iid'],\n duration: options[:duration],\n git_service: git_service,\n tracker: :estimate\n )\n post_estimation_display(res['human_time_estimate'], options[:duration])\n end\n end\n end",
"title": ""
},
{
"docid": "ef24ca6331141e02e2322ddfcd04b802",
"score": "0.45176876",
"text": "def text_message(type, context)\n issue = context[:issue]\n journal = context[:journal]\n\n if type == :update\n text = l(:field_chatty_crow_issue_updated) + \" ##{issue.id}\\n\\n\"\n text += l(:field_chatty_crow_issue_update_author) + \": #{journal.user.name}\\n\"\n else\n text = l(:field_chatty_crow_issue_created) + \" ##{issue.id}\\n\\n\"\n text += l(:field_author) + \": #{issue.author.name}\\n\"\n end\n\n text += l(:field_subject) + \": #{issue.subject}\\n\"\n text += l(:field_url) + \": #{redmine_url}/issues/#{issue.id}\\n\"\n text += l(:field_project) + \": #{issue.project}\\n\"\n text += l(:field_tracker) + \": #{issue.tracker.name}\\n\"\n text += l(:field_priority) + \": #{issue.priority.name}\\n\"\n\n if issue.assigned_to\n text += l(:field_assigned_to) + \": #{issue.assigned_to.name}\\n\"\n end\n\n if issue.start_date\n text += l(:field_start_date) + \": #{issue.start_date.strftime('%d.%m.%Y')}\\n\"\n end\n\n if issue.due_date\n text += l(:field_due_date) + \": #{issue.due_date.strftime('%d.%m.%Y')}\\n\"\n end\n\n if issue.estimated_hours\n text += l(:field_estimated_hours) + \": #{issue.estimated_hours} \" + l(:field_hours) + \"\\n\"\n end\n\n if issue.done_ratio\n text += l(:field_done_ratio) + \": #{issue.done_ratio}%\\n\"\n end\n\n if issue.status\n text += l(:field_status) + \": #{issue.status.name}\\n\"\n end\n\n if journal\n text += \"\\n#{journal.notes}\"\n end\n\n text\n end",
"title": ""
},
{
"docid": "ddbd2bb4850ae0582f60d568bf113cf5",
"score": "0.45168558",
"text": "def post_issue(issue, config)\n # [todo] - Better way to identify/compare remote->local issues than md5\n # Current md5 based on some things that easily can change, need better ident\n\n # Identify method entry\n debug_print \"#{ self.class } : #{ __method__ }\\n\"\n\n\n # Set up formatter for printing errors\n # config.output_format should be set based on less status by now\n formatter = Printer.new(config).build_formatter\n\n\n # Only attempt to get issues if API is specified\n if config.gitlab_api.empty?\n debug_print \"No API found, this shouldn't be called...\\n\"\n return false\n end\n\n\n\n return false if config.gitlab_issues.key?(issue[:md5])\n debug_print \"#{issue[:md5]} not found in remote issues, posting\\n\"\n\n\n # We didn't find the md5 for this issue in the open or closed issues, so safe to post\n\n # Create the body text for the issue here, too long to fit nicely into opts hash\n # [review] - Only give relative path for privacy when posted\n _body =\n \"__filename__ : #{ issue[:path] }\\n\" +\n \"__line #__ : #{ issue[:line_number] }\\n\" +\n \"__tag__ : #{ issue[:tag] }\\n\" +\n \"__md5__ : #{ issue[:md5] }\\n\\n\" +\n \"#{ issue[:context].join }\\n\"\n\n\n\n # Create option hash to pass to Remote::http_call\n # Issues URL for GitLab\n opts = {\n :url => \"#{ config.gitlab_endpoint }/api/v3/projects/#{ URI.escape(config.gitlab_repo, \"/\") }/issues\",\n :ssl => config.gitlab_endpoint.match(/^https/) ? true : false,\n :method => \"POST\",\n :headers => [ { :field => \"PRIVATE-TOKEN\", :value => config.gitlab_api } ],\n :data => [{ \"title\" => issue[:title] + \" [#{ issue[:path] }]\",\n \"labels\" => \"#{issue[:tag]}, watson\",\n \"description\" => _body }],\n :verbose => false\n }\n\n _json, _resp = Watson::Remote.http_call(opts)\n\n\n # Check response to validate repo access\n # Shouldn't be necessary if we passed the last check but just to be safe\n if _resp.code != \"201\"\n formatter.print_status \"x\", RED\n print BOLD + \"Post unsuccessful. \\n\" + RESET\n print \" Since the open issues were obtained earlier, something is probably wrong and you should let someone know...\\n\"\n print \" Status: #{ _resp.code } - #{ _resp.message }\\n\"\n return false\n end\n\n # Parse response and append issue hash so we are up to date\n config.gitlab_issues[issue[:md5]] = {\n :title => _json[\"title\"],\n :id => _json[\"iid\"],\n :state => _json[\"state\"]\n }\n\n\n return true\n end",
"title": ""
},
{
"docid": "4af7beaf59ca622515ccd39a0e27f803",
"score": "0.45161274",
"text": "def issues(issues)\n result = ''\n issues.each do |issue|\n result << COLUMN_SEPARATOR.dup\n result << issue.severity.to_s.capitalize\n result << COLUMN_SEPARATOR\n result << \"#{issue.file_name}:#{issue.line}\"\n result << COLUMN_SEPARATOR\n result << \"#{meta_information(issue)} #{issue.message}\"\n result << COLUMN_SEPARATOR\n result << LINE_SEPARATOR\n end\n # rubocop:enable Metrics/AbcSize\n result\n end",
"title": ""
},
{
"docid": "50097f5424b089bb3a84dcff203c64bc",
"score": "0.45108202",
"text": "def markdown_issues(results, heading)\n message = \"#### #{heading}\\n\\n\".dup\n\n message << \"File | Line | Reason |\\n\"\n message << \"| --- | ----- | ----- |\\n\"\n\n results.each do |r|\n s = r.split(':')\n\n filename = s[0]\n line = s[1]\n reason = \"#{s[3]}:#{s[4]}\"\n\n # Other available properties can be found int SwiftLint/…/JSONReporter.swift\n message << \"#{filename} | #{line} | #{reason})\\n\"\n end\n\n message\n end",
"title": ""
},
{
"docid": "e064277e9b345ce1bfdfe7d3310f779b",
"score": "0.4505436",
"text": "def compile(issue_id)\n puts \"Compiling #{ENV['REVIEW_REPOSITORY']}/#{issue_id}\"\n Open3.capture3(\"whedon prepare #{issue_id}\")\n end",
"title": ""
},
{
"docid": "b936d3ed8b441524eb5380252de590f9",
"score": "0.44994992",
"text": "def get_issue(issue_id, field_set=FS1)\r\n issue_id = issue_id.to_s.chomp\r\n item = call_mks(\"issues --fields='#{field_set}' #{FIELDS_DELIMITER} #{issue_id}\")\r\n \r\n issue = {}\r\n if(item)\r\n keys = get_column_names(field_set)\r\n vals = item.chomp.split(DELIMITER)\r\n vals.each_index {|idx| issue[keys[idx]] = vals[idx] }\r\n end\r\n return issue\r\n end",
"title": ""
},
{
"docid": "83c9b274c741f5a513bf38b7ad664930",
"score": "0.44895232",
"text": "def initialize(jira_issue, project)\n @project = project\n @story = jira_issue\n @title = jira_issue.summary\n @id = jira_issue.key\n @html_url = transform_url(jira_issue.self)\n end",
"title": ""
},
{
"docid": "73d3d428add2149ab5824da5eb59c96f",
"score": "0.44891912",
"text": "def issue_attributes\n {\n title: title,\n pivotal_ids: pivotal_ids,\n jira_ids: jira_ids,\n editor: options[:editor]\n }\n end",
"title": ""
},
{
"docid": "c3b96809876e7555236edf42feaaaa6f",
"score": "0.4485053",
"text": "def get_issue_description(node)\n issue_id = get_value_of_text_child_node(node, \"id\")\n description = get_value_of_text_child_node(node, \"description\") || \"\"\n \"#{@base_url}/issues/#{issue_id} \\n\\n#{description}\"\n end",
"title": ""
},
{
"docid": "9e6fbf3a7c500ab80bef38035eb3295a",
"score": "0.44834152",
"text": "def front_matter(issue)\n <<~FRONT_MATTER\n ---\n layout: post\n title: 'Issue #{issue[:number]}: #{issue[:title]}'\n category: Volume 1\n image:\n file: #{issue[:image][:file]}\n alt: #{issue[:image].fetch(:caption, 'null')}\n caption: #{issue[:image].fetch(:caption, 'null')}\n source_link: null\n half_width: false\n ---\n FRONT_MATTER\nend",
"title": ""
},
{
"docid": "7a616f154eef5519f5cb5c2f82c8a5b5",
"score": "0.44826058",
"text": "def to_json(context, version = nil, environment = nil)\n\t\tatext = \"#{issue_id}-#{issue.subject}\"\n\t\tlast_result = get_last_result(version, environment)\n\n\t\ttextilized_description =\n\t\t\tif issue.description\n\t\t\t\tcontext.textilizable(issue, :description, {}) rescue issue.description\n\t\t\telse\n\t\t\t\t''\n\t\t\tend\n\t\t{\n\t\t\t'id' => \"issue_#{issue_id}\",\n\t\t\t'issue_id' => issue_id,\n\t\t\t'text' => atext,\n\t\t\t'editable' => false,\n\t\t\t'desc' => textilized_description,\n\t\t\t'leaf' => true,\n\t\t\t'status' => issue.status,\n\t\t\t'iconCls' => \"testcase-result-icon-#{last_result}\",\n\t\t\t'icon' => \"testcase-result-icon-#{last_result}\",\n\t\t\t'draggable' => true,\n\t\t\t'qtipCfg' => {\n\t\t\t\t:cls => 'test',\n\t\t\t\t:width => '500',\n\t\t\t\t:closable => 'true',\n\t\t\t\t:text => (\n\t\t\t\t\t\"\\\"#{issue.subject}\\\"<br/>\" + (\n\t\t\t\t\t\tissue.description.nil? ? '' : (\n\t\t\t\t\t\t\t\"<br/><b>Description:</b><br/>#{textilized_description}\"\n\t\t\t\t\t\t)\n\t\t\t\t\t) +\n\t\t\t\t\t\"<br/><b>Priority:</b> #{issue.priority.name}\" +\n\t\t\t\t\t\"<br/><b>Author:</b> #{issue.author.name}\" +\n\t\t\t\t\t\"<br/><b>Created:</b> #{issue.created_on.strftime('%d.%m.%Y %H:%M')}\"\n\t\t\t\t),\n\t\t\t\t:title => \"Issue ##{issue.id}\",\n\t\t\t\t:dismissDelay => 30000\n\t\t\t},\n\t\t\t'type' => 'case',\n\t\t\t'state' => {\n\t\t\t\t'disabled' => ((issue.status.name != 'In Progress')&&(issue.status.name != 'Ready to Run')&&(issue.status.name != 'Automation In Progress'))\n\t\t\t}\n\t\t}\n\tend",
"title": ""
},
{
"docid": "1ac06eee54431b11bf667ffa938f0113",
"score": "0.44784072",
"text": "def create_issue(issue_title,issue_body,issue_assignees)\n RestClient.proxy = @proxy\n\n if issue_assignees.size == 0\n issue_assignees = ['']\n end\n\n url = @github_api_url + \"/repos\" + @github_repo + \"/issues\"\n headers = {:accept => :json, :content_type => :json, :authorization => \"Bearer #{@gitub_token}\"}\n body = { 'title' => issue_title, 'body' => issue_body, 'assignees' => issue_assignees }\n\n begin\n r = RestClient.post url, body.to_json, headers\n rescue RestClient::ExceptionWithResponse => e\n puts e.response\n end\n\n issue = JSON.parse(r.body)\n #puts \"issue is created. response is #{JSON.pretty_generate(issue)}\"\n return issue\n end",
"title": ""
},
{
"docid": "fb9a2d92caae998c5b35bf488b761c84",
"score": "0.44691253",
"text": "def new_issue_branch(issue, project, author, branch, branch_project: nil)\n branch_project ||= project\n link = url_helpers.project_compare_path(branch_project, from: branch_project.default_branch, to: branch)\n\n body = \"created branch [`#{branch}`](#{link}) to address this issue\"\n\n create_note(NoteSummary.new(issue, project, author, body, action: 'branch'))\n end",
"title": ""
},
{
"docid": "13357ec970612565837282d6b044abdc",
"score": "0.4468161",
"text": "def submit # rubocop:disable Metrics/MethodLength\n new_issue = {\n fields: {\n project: {\n key: @project\n },\n summary: @summary,\n description: @description,\n issuetype: {\n name: @issuetype\n },\n reporter: {\n name: @reporter || api_user['name']\n }\n }\n }\n\n @data = @client.post('issue/', new_issue)\n rescue Faraday::ClientError => e\n @data = JSON.parse(e.response[:body])\n end",
"title": ""
},
{
"docid": "b678bae1a50427a68d2dceecd6788ee0",
"score": "0.44675282",
"text": "def create(summary, description)\n body = {\n 'fields' => {\n 'project' => {'key' => @project.jira_project},\n 'summary' => summary,\n 'description' => description,\n 'issuetype' => {'name' => @issuetype},\n 'labels' => @labels,\n 'components' => @project.jira_components.map { |c| {'name' => c} },\n }\n }\n\n status = @issue.save!(body)\n rescue JIRA::HTTPError => e\n raise PuppetLabs::Jira::APIError, \"#{e.code} #{e.message}: #{e.response.body}\", e.backtrace\n end",
"title": ""
},
{
"docid": "14d5c4312113d9a0bba55afb3f6a39bc",
"score": "0.44647872",
"text": "def new_issue; CreateIssue.new.execute end",
"title": ""
},
{
"docid": "8eab5c6c5f3721c9c082057938eb7568",
"score": "0.4459583",
"text": "def create\n \n @org_issues = current_user.organization.issues(:order=>'created_at ASC')\n @org_last_issue = @org_issues.find(:last)\n if !@org_issues.blank? && !@org_last_issue.blank?\n y = @org_last_issue.issue_number.gsub!(\"ISSUE-\",\"\")\n puts \"###\"\n m=y.to_i\n m = m +1\n x = (\"ISSUE-%0.5d\" %m.to_i).to_s\n puts x\n params[:issue][:issue_number] = x\n @issue = Issue.new(params[:issue])\n @issue.organization = current_user.organization\n else \n m = 1\n x = (\"ISSUE-%0.5d\" %m.to_i).to_s\n puts x\n params[:issue][:issue_number] = x\n @issue = Issue.new(params[:issue])\n @issue.organization = current_user.organization\n \n end\n #ptid = ProjectType.find(params[:project][:project_name]).id\n #@project.project_type_id = ptid\n \n #for changing the default date format\n\n @issue.date_created = change_date_format(params[:issue][:date_created]) if !(params[:issue][:date_created]).blank?\n\n respond_to do |format|\n if @issue.save\n notification_mail(@issue)\n format.html { redirect_to issues_url, notice: 'Issue was successfully created.' }\n format.json { render json: @issue, status: :created, location: @issue }\n else\n format.html { render action: \"new\" }\n format.json { render json: @issue.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "087ed74f5f69d9e4ea1175c239f75f46",
"score": "0.44558233",
"text": "def issue_edit(journal)\n @title = 'ARTICOLO MODIFICATO'\n issue = journal.journalized.reload\n redmine_headers 'Project' => issue.project.identifier,\n 'Issue-Id' => issue.id,\n 'Issue-Author' => issue.author.login\n redmine_headers 'Issue-Assignee' => issue.assigned_to.login if issue.assigned_to\n message_id journal\n references issue\n @author = journal.user\n recipients issue.recipients\n # Watchers in cc\n cc(issue.watcher_recipients - @recipients)\n #s = \"[#{issue.project.name} - #{issue.tracker.name} ##{issue.id}] \"\n #s << \"(#{issue.status.name}) \" if journal.new_value_for('status_id')\n #s << issue.subject\n #subject acronym(nil) << s\n subject \"Modif. [#{issue.project.name}] #{issue.subject} [#{issue.status.name}/\" << acronym(nil) << \"]\"\n body :issue => issue,\n :journal => journal,\n :issue_url => url_for(:controller => 'issues', :action => 'show', :id => issue, :anchor => \"change-#{journal.id}\")\n\n render_multipart('issue_edit', body)\n end",
"title": ""
}
] |
c8106894973cccf0102a772142eb50fd
|
Returns the word string that is entailed by the source words.
|
[
{
"docid": "c096c5cf9d148000cd9fb0702cd0a1e0",
"score": "0.0",
"text": "def entailed_word\n entailed_tree = entailment_json.fetch(\"entailedTree\", nil)\n entailed_tree.fetch(\"word\", nil) if entailed_tree\n end",
"title": ""
}
] |
[
{
"docid": "72e6aab41e62dcefe35c1682000df141",
"score": "0.7180277",
"text": "def word\n #@short_context[0].split(/\\s+/)[-1]\n @short_context[1].map{|s| s.to_s}.join(\"\")\n end",
"title": ""
},
{
"docid": "e3d774544fdac01ccfde4707f70c122a",
"score": "0.673349",
"text": "def inspect\n \"#{source_word.transcription}/#{dest_word.transcription}\"\n end",
"title": ""
},
{
"docid": "8a1851ec014012920003e8e479693c87",
"score": "0.66118246",
"text": "def word_str\n\n end",
"title": ""
},
{
"docid": "b9382f9c6769c085c4e404eed7d58632",
"score": "0.6485291",
"text": "def word_from(x, y, dir)\n s = \"\"\n while !boundary?(x, y) do\n s += solution[y][x].to_w\n if dir == :across\n x += 1\n else\n y += 1\n end\n end\n s\n end",
"title": ""
},
{
"docid": "86616088e330a03c9ddea0384ac387f2",
"score": "0.6466602",
"text": "def get_word_raw\r\n #Skip white space.\r\n return nil unless (next_char = skip_white_space)\r\n\r\n #Gather the word token.\r\n word = ''\r\n\r\n begin\r\n word << next_char\r\n\r\n #Check for the three special cases.\r\n break if ['(', '//'].include?(word) || (next_char == '\"')\r\n\r\n next_char = @source.get\r\n end while next_char && next_char > ' '\r\n\r\n word\r\n end",
"title": ""
},
{
"docid": "bc9c48a3dbc58d919a8c9d42248f4308",
"score": "0.6398654",
"text": "def get_word\r\n word = ''\r\n\r\n begin\r\n next_char = @source.get\r\n return nil if next_char.nil?\r\n end while next_char <= ' ' || next_char == \"\\x7F\"\r\n\r\n begin\r\n word << next_char\r\n\r\n #Check for the three special cases.\r\n break if word == '('\r\n break if word == '//'\r\n break if next_char == '\"'\r\n\r\n next_char = @source.get\r\n break if next_char.nil?\r\n end while next_char > ' ' && next_char != \"\\x7F\"\r\n\r\n word\r\n end",
"title": ""
},
{
"docid": "3ba3e07bc0d8a3495e1f704a3fa83415",
"score": "0.63969713",
"text": "def to_s\n @word + '(' + @tags.join(', ') + ') '\n end",
"title": ""
},
{
"docid": "0d074a28116df60f8d53616a8f5de805",
"score": "0.6314932",
"text": "def get_word\r\n word = ''\r\n \r\n begin\r\n next_char = @source.get\r\n return nil if next_char.nil?\r\n end while next_char <= ' ' || next_char == \"\\x7F\"\r\n \r\n begin\r\n word << next_char\r\n \r\n #Check for the three special cases.\r\n break if word == '('\r\n break if word == '//'\r\n break if next_char == '\"'\r\n \r\n next_char = @source.get\r\n break unless next_char\r\n end while next_char > ' ' && next_char != \"\\x7F\"\r\n \r\n word\r\n end",
"title": ""
},
{
"docid": "1cc511492c73729c76616b7e38664b26",
"score": "0.63026315",
"text": "def to_s\n word\n end",
"title": ""
},
{
"docid": "9a574308d859a281dd8e99eb5c1f05bc",
"score": "0.62765306",
"text": "def to_s\n \"#{@word}(#{@tags.join(', ')})\"\n end",
"title": ""
},
{
"docid": "50388d4cf895f4043af82ee743e20536",
"score": "0.627059",
"text": "def get_word\n @lettercollection.push(@string_as_array[@i])\n @lettercollection.join('')\n end",
"title": ""
},
{
"docid": "e214b8f396e6f9346e45222461e9e9a8",
"score": "0.6263631",
"text": "def to_s\n word.to_s\n end",
"title": ""
},
{
"docid": "9863c0dc9c629ace75b6b85b365e9a0e",
"score": "0.6153625",
"text": "def to_s\n\t\treturn self.words.join(\" \")\n\tend",
"title": ""
},
{
"docid": "9863c0dc9c629ace75b6b85b365e9a0e",
"score": "0.6153625",
"text": "def to_s\n\t\treturn self.words.join(\" \")\n\tend",
"title": ""
},
{
"docid": "dbff2c5ec11c057118f928bee0a60e56",
"score": "0.6118823",
"text": "def word\n return @word\n end",
"title": ""
},
{
"docid": "04614d60ffdc191d30baa7181679e3d2",
"score": "0.6082693",
"text": "def get_sample_phrase_2\r\n \"the bat in the flat\"\r\n end",
"title": ""
},
{
"docid": "e29d6ae13d98481765ef0028296e7d58",
"score": "0.60818964",
"text": "def getWords()\n out = ''\n num_of_words = rand(3)\n (0..num_of_words).each do\n out += @words.sample.strip + ' '\n end\n return out\n end",
"title": ""
},
{
"docid": "4e069d021e7d605385a6b7649a674f5d",
"score": "0.60686237",
"text": "def somewords(wc)\n out = ''\n return out if wc < 1\n # guard against bad array population\n if @book[wc].class.to_s == 'Array'\n out = @book[wc][rand(@book[wc].count)]\n else\n half = wc / 2\n out = self.somewords(half).chomp + ' ' + self.somewords(wc-half)\n end\n out\n end",
"title": ""
},
{
"docid": "aa061c3c40ef17e78779f193f7287165",
"score": "0.60575646",
"text": "def to_s\n @word << '(' << @tags.join(', ') << ') '\n end",
"title": ""
},
{
"docid": "aa061c3c40ef17e78779f193f7287165",
"score": "0.60575646",
"text": "def to_s\n @word << '(' << @tags.join(', ') << ') '\n end",
"title": ""
},
{
"docid": "796ce8eb07fb9c2c3e439a6bb46a5e00",
"score": "0.6053954",
"text": "def original_word\n case word\n when :source\n segment.source_word\n when :dest\n segment.dest_word\n else\n raise RuntimeError.new(\"Invalid word value #{word}\")\n end\n end",
"title": ""
},
{
"docid": "f31c9bf65398277e2d94c7ff70facd36",
"score": "0.6046567",
"text": "def get_words\n puts @board.all_words.join(\", \")\n end",
"title": ""
},
{
"docid": "6d6003c6595c7d74d825bba33d8eabd2",
"score": "0.60450745",
"text": "def get_word\r\n @word\r\n end",
"title": ""
},
{
"docid": "9bbd0d7ce03b3903dc57e5de0d3d3baf",
"score": "0.604384",
"text": "def to_s\n \"(#{@synset_type}) #{words.map { |x| x.tr('_',' ') }.join(', ')} (#{@gloss})\"\n end",
"title": ""
},
{
"docid": "9bbd0d7ce03b3903dc57e5de0d3d3baf",
"score": "0.604384",
"text": "def to_s\n \"(#{@synset_type}) #{words.map { |x| x.tr('_',' ') }.join(', ')} (#{@gloss})\"\n end",
"title": ""
},
{
"docid": "2d0bbe9d6f430a0f4c5ab2fdbb3e3b92",
"score": "0.6039581",
"text": "def get_sample_phrase_1\r\n \"the cat in the hat\"\r\n end",
"title": ""
},
{
"docid": "3fac3d11a090252739ec941f4e12e79a",
"score": "0.60307795",
"text": "def words(num_of_word)\n target_len = num_of_word.times.inject(0){ |sum| sum + rand(@char_count_range_in_a_word) }\n sentence_key = bsearch(sentence_map_keys, target_len)\n unless sentence_key\n sentence_key = sentence_map.keys.min\n end\n wk_word = sentence_map[sentence_key].sample\n return wk_word.sub(/[#{ sentence_end_chars.join() }]$/, \"\")\n end",
"title": ""
},
{
"docid": "614193b25d731db6273ab7c1cbde64fc",
"score": "0.6016017",
"text": "def to_s\n @word.to_s\n end",
"title": ""
},
{
"docid": "b56317afcfd9a029d1a7d306b953619c",
"score": "0.599915",
"text": "def output_word\n end",
"title": ""
},
{
"docid": "eea7372128196fd9c7f7501017c45003",
"score": "0.5991629",
"text": "def print_word\r\n\t\tword_string = \"\"\r\n\t\t@word_guess.each { |letter| word_string = word_string + letter + \" \" }\r\n\t\treturn word_string.rstrip\r\n\tend",
"title": ""
},
{
"docid": "cf3e579ed851ba8650a9d9c0e197443c",
"score": "0.5986042",
"text": "def get(startWord, length)\n\t\tret = startWord + \" \"\n\t\tword = startWord.split\n\t\tcount = 0\n\t\t\n\t\twhile @corpus.has_key? word and count < length\n\t\t\tnewWord = @corpus[word][rand(@corpus[word].length)]\n\t\t\tret << newWord + \" \" \n\t\t\tword = [word[1],newWord]\n\t\t\tcount += 1\n\t\tend\n\t\t\n\t\tret\n\tend",
"title": ""
},
{
"docid": "455e7d7e0ca1785899d17ba04ed21a7a",
"score": "0.5968399",
"text": "def inscription(words)\n if @text.nil?\n @text = words\n end\n return @text\n end",
"title": ""
},
{
"docid": "75652da9efc5d3098483b8f5616b5777",
"score": "0.5959269",
"text": "def word\n @word ||= start_of_word + end_of_word\n end",
"title": ""
},
{
"docid": "75652da9efc5d3098483b8f5616b5777",
"score": "0.5959269",
"text": "def word\n @word ||= start_of_word + end_of_word\n end",
"title": ""
},
{
"docid": "22a5611db607a3ef5b855bd868a1708b",
"score": "0.595875",
"text": "def sentence\n words = @start.sample # Pick random word, then keep appending connected words.\n while next_word = next_word_for(words[-@depth, @depth])\n words << next_word\n end\n words[0..-2].join(\" \") + words.last # Format the sentence.\n end",
"title": ""
},
{
"docid": "536d47c81655cded7664a51bd7a4eccf",
"score": "0.5938038",
"text": "def results_for(source_word, length = source_word.split(\"\").length)\n if length >= MIN_CHARS\n chars = source_word.split(\"\")\n\n # start with longest word, work back to shortest\n result = dictionary.filter_by_length(length).filter_by_characters(chars).to_a\n result += results_for(source_word, length - 1)\n else\n []\n end\n end",
"title": ""
},
{
"docid": "09c5732b484a6878a79d3f5f55e7ff36",
"score": "0.59131384",
"text": "def construct_out_string\n out_string = @secret_word.map { |c| guessed?(c) }\n return out_string.join(' ')\n end",
"title": ""
},
{
"docid": "b88697eea5a15c5cc7015059f4ece13b",
"score": "0.5907725",
"text": "def to_s\n format(text, words)\n end",
"title": ""
},
{
"docid": "51092fce4459e2316eff8397d38f5fbc",
"score": "0.5907284",
"text": "def l1\n word_arr[0].strip\n end",
"title": ""
},
{
"docid": "506e99fab8b900636d1a0c92b74a1688",
"score": "0.5868679",
"text": "def to_s\n\t\treturn \"%s: %s (%s)\" % [\n\t\t\tself.type,\n\t\t\tself.target.words.map( &:to_s ).join( ', ' ),\n\t\t\tself.target.pos,\n\t\t]\n\tend",
"title": ""
},
{
"docid": "e79c928984a859902943881d0f9a2f48",
"score": "0.58627224",
"text": "def to_word\n self\n end",
"title": ""
},
{
"docid": "2562329000e5cbcd3fe2e7a3c0cfff1e",
"score": "0.5861601",
"text": "def to_s\n \"Noun: #{@word}\"\n end",
"title": ""
},
{
"docid": "2562329000e5cbcd3fe2e7a3c0cfff1e",
"score": "0.5861601",
"text": "def to_s\n \"Noun: #{@word}\"\n end",
"title": ""
},
{
"docid": "b5c7a5ac94dbef1028e9438aab164a0e",
"score": "0.5836236",
"text": "def get_word\r\n # Array containing the words used in the game\r\n words = [\"W I N D O W\", \"S T A T I O N\", \"H A M B U R G E R\",\r\n \"E X P R E S S I O N\", \"W A L L E T\", \"C A M E R A\",\r\n \"A I R P L A N E\", \"C A N D L E\", \"C O M P U T E R\",\r\n \"P I C T U R E\", \"F R A M E\", \"S H E L F\", \"B O W L I N G\",\r\n \"P O L I T E\", \"S T A T E M E N T\", \"N E G A T I V E\",\r\n \"M E T H O D\", \"F I S H I N G\", \"C O M P E N S A T E\",\r\n \"H A P P Y\"]\r\n \r\n # Choses a random number between 0 and 19 which will be used to select which word will be used in the game\r\n randomNo = rand(19)\r\n\r\n # Returns the word selected by the random number chosen above\r\n return words[randomNo]\r\n end",
"title": ""
},
{
"docid": "a7d1fd058f3c3837684970912ca5c404",
"score": "0.582122",
"text": "def word_data\n 'echo \"50 rare 200 common 3846 stop\"'\n end",
"title": ""
},
{
"docid": "70c1ae39a2eacc6764ce4e2ea00d5ed8",
"score": "0.5818437",
"text": "def word\n @word\n end",
"title": ""
},
{
"docid": "70c1ae39a2eacc6764ce4e2ea00d5ed8",
"score": "0.5818437",
"text": "def word\n @word\n end",
"title": ""
},
{
"docid": "43b9ee2920d11e2468e6ead69a808506",
"score": "0.5813432",
"text": "def prev_word\n\n # increment the index to keep track of where we're at\n # unless we're at zero\n self.source_index = self.source_index - 1 unless self.source_index == 0\n\n # grab the next word\n pw = self.source[self.source_index]\n\n # record the word as seen\n record_word(pw, self.source_index)\n\n # return our prev_word\n return pw\n\n end",
"title": ""
},
{
"docid": "daa88d37f061b4cfbdebd36b1dc6e3cf",
"score": "0.57966745",
"text": "def get_random_word\n word = File.read(\"dic/5desk.txt\").split.find_all { |word| word.length > 4 && word.length < 13 }\n return word.sample(1).join\n end",
"title": ""
},
{
"docid": "06df5b3d0effc11c819799482fa2ec59",
"score": "0.57813805",
"text": "def pick_word\n @word = @dictionary.sample.strip.downcase.split('')\n end",
"title": ""
},
{
"docid": "d080003fce8603b4cb5e69ed0d272d50",
"score": "0.5767836",
"text": "def word\n @start_keys = @histogram.keys.select { |k| k[0] == START_TOKEN }.sort\n char = nil\n #debugger\n key = @start_keys.clone.sample\n #p key\n if key\n word = key.last\n while char != END_TOKEN\n break if @histogram[key].nil?\n char = @histogram[key].clone.sample\n word += char\n key.push_shift(char)\n end\n word.gsub(END_TOKEN,'')\n\n end\n end",
"title": ""
},
{
"docid": "4f2cd0978a85309052ed7a1f1b1771d8",
"score": "0.57669973",
"text": "def word\n\t\t@ida.get_word(@offset)\n\tend",
"title": ""
},
{
"docid": "37462f4cfa31c1a6d3e4bfeeb4a9c7a3",
"score": "0.57665956",
"text": "def write_word\n view_word = @word\n @word.chars.each do |c|\n if !@guessed.include? c then\n view_word = view_word.gsub(/#{c}/, ' _ ')\n end\n end\n return view_word\n end",
"title": ""
},
{
"docid": "bf32fd2422c4ea92ae35969759546825",
"score": "0.5761513",
"text": "def to_s\n # There is probably a better way to do this...\n @word.upcase.each_char.map { |c| @correct.include?(c) ? c : '_' }.join\n end",
"title": ""
},
{
"docid": "f2a25ac6873be9ca88b97b106de29f45",
"score": "0.57596004",
"text": "def words(total)\n (1..interpret_value(total)).map { WORDS.sample }.join(' ')\n end",
"title": ""
},
{
"docid": "dbd68bf572d15f34f7fe4f29b69f9458",
"score": "0.5758456",
"text": "def generate_word\n @word = RandomWord.nouns(not_shorter_than: 4, not_longer_than: 8).next\n while @word.include?(\"_\") || word.include?(\"-\")\n @word = RandomWord.nouns(not_shorter_than: 4, not_longer_than: 8).next\n end\n return @word\n end",
"title": ""
},
{
"docid": "a77a01fea959a85dc8870ddd5c87e395",
"score": "0.57578963",
"text": "def word\n words(1)\n end",
"title": ""
},
{
"docid": "e6af8abd59dd6e948683a04591b87dd1",
"score": "0.5757447",
"text": "def get_word\n @@word\n end",
"title": ""
},
{
"docid": "a5d78db7326e3a4c7b82c3aeb944db8c",
"score": "0.5745745",
"text": "def word\n user_word.word\n end",
"title": ""
},
{
"docid": "25fced72e4a3bbeda74b9523b71e87da",
"score": "0.5742974",
"text": "def text target, *words\n\t\t\twords = [words].flatten\n\t\t\ttxt = [@data['text'][target]].flatten.sample\n\t\t\treturn nil if (txt.nil?)\n\t\t\treturn Input.substitute txt, words unless (words.empty?)\n\t\t\treturn txt\n\t\tend",
"title": ""
},
{
"docid": "dbafe32014827520814e192be84a78f9",
"score": "0.57305926",
"text": "def original_word\n\t\t@ida.get_original_word(@offset)\n\tend",
"title": ""
},
{
"docid": "9a9c4b3cd95345e57188817c9aaf6480",
"score": "0.5729924",
"text": "def getBase(word)\n begin\n page_base = query(word,\"\")\n if page_base.css('span').to_s.length==0 || page_base.css('ul').to_s.length==0 then\n return \"\"\n end\n rst_pho = page_base.css('span')[0].text\n rst_exp = page_base.css('ul')[0].text.to_s \n return rst_pho+\"|\"+rst_exp.gsub(/\\s+/, \"\")\n rescue\n return \"\"\n end\n end",
"title": ""
},
{
"docid": "6a378362d5af444cf1f674668a2989a2",
"score": "0.5729207",
"text": "def translate_sentance(sentance)\n @only_words = sentance.split(\" \")\n @only_words.length.times do |word|\n @translated[word] = translate_word(@only_words[word])\n end\n #breakpoint puts @only_words[word]\n return @translated.join(\" \")\nend",
"title": ""
},
{
"docid": "c45c4732ef0ecfca7ca507dd97a49617",
"score": "0.57279485",
"text": "def word_line \r\n\t\tline = \"\"\r\n\t\t@word.each do |c|\r\n\t\t\tif @guessed.include? c\r\n\t\t\t\tline << c\r\n\t\t\telse\r\n\t\t\t\tline << \"_\"\r\n\t\t\tend\r\n\t\t\tline << \" \"\r\n\t\tend\r\n\t\tline[0 .. -2]\r\n\tend",
"title": ""
},
{
"docid": "293f57ea6d8799b764540bd909271cfd",
"score": "0.572586",
"text": "def word\n random_word = sample(translate('faker.lovecraft.words'))\n random_word =~ /\\s/ ? word : random_word\n end",
"title": ""
},
{
"docid": "1aa9a96eec1338fea13d6bf54f8868b8",
"score": "0.5711937",
"text": "def translate\n translation = ''\n words.each do |word|\n if starts_with_vowel?(word)\n translation << \"#{word}way \"\n else\n translation << \"#{word[1,word.size-1]}#{word[0]}ay \"\n end\n end\n translation\n end",
"title": ""
},
{
"docid": "da7a3a5157d8331d78abe5cafc9d60e9",
"score": "0.57081556",
"text": "def word\n words(1)\n end",
"title": ""
},
{
"docid": "d9bd0f870dae83994142184d842f88b4",
"score": "0.5701793",
"text": "def get_phrase\n @genes.join('')\n end",
"title": ""
},
{
"docid": "7f35c28c4669a3506216be071ffbc089",
"score": "0.5684147",
"text": "def get(word_spelling)\n scanner.words[word_spelling]\n end",
"title": ""
},
{
"docid": "08cb00005732d10b9bdc470ae0570f07",
"score": "0.56800354",
"text": "def to_string\n print @words.join(' ').gsub(' .', '. ')#.color(:green)\n end",
"title": ""
},
{
"docid": "450ceddf439aad55ff1603f241d39aed",
"score": "0.567813",
"text": "def start (word)\n\treturn \"#{word}\"[0]\nend",
"title": ""
},
{
"docid": "6543c7ccb23884f945d4598731f687c6",
"score": "0.5674706",
"text": "def get_word(dictionary)\n word = dictionary[rand(dictionary.length)]\n # Ensure that the word is between 5 and 12 letters long.\n if word.length.between?(5,12)\n return word.downcase.strip\n else\n get_word(dictionary)\n end\nend",
"title": ""
},
{
"docid": "9514bdf83ff72e4474fbe050148b5e35",
"score": "0.5674642",
"text": "def get_word(word_key)\r\n return @words[word_key]\r\n end",
"title": ""
},
{
"docid": "bf19ea3c7bab8589283e57d42bc0c6a1",
"score": "0.56676644",
"text": "def source_text\n if source.start_with?(\"ost-remote\")\n \"OSTR (#{source.last(4)})\"\n elsif source.start_with?(\"ost-live-entry\")\n \"Live Entry (#{created_by})\"\n else\n source\n end\n end",
"title": ""
},
{
"docid": "7bd5b3ad1a0c516f3efd957c8eff369b",
"score": "0.5664184",
"text": "def word\n 1.words.first\n end",
"title": ""
},
{
"docid": "76093245bd1d1d2ed868d6d64d9026e8",
"score": "0.5652102",
"text": "def shorten(tweet)\n tweet.split.map {|word|dictionary(word)}.join( \" \")\nend",
"title": ""
},
{
"docid": "c22742383d14f57fcf9edab7dfa2e13c",
"score": "0.5647209",
"text": "def words\n %w(\n shit\n shitty\n fuck\n fucked\n fucking\n ass\n asshole\n cunt\n dick\n cock\n pussy\n )\n end",
"title": ""
},
{
"docid": "9bbbea8b76e6531aa560077f79f9adb6",
"score": "0.56449544",
"text": "def word\n @word ||= word_at(offset)\n end",
"title": ""
},
{
"docid": "5057073681c1e08d8e5e3e8568c4d8ae",
"score": "0.56428766",
"text": "def extract_en_headword(first_meaning_string)\n if (first_meaning_string.length > 0)\n return first_meaning_string.gsub(\"'\",\"''\").gsub(' ',' ').gsub('/', ' / ').split(\"/\").first.strip\n else\n return first_meaning_string\n end\n end",
"title": ""
},
{
"docid": "aa2558697c2bbddca3d65d4c079ebbc4",
"score": "0.5641832",
"text": "def phraseable_words\n words - COMMON_WORDS\n end",
"title": ""
},
{
"docid": "bf7f7b98195e96eb492084ee979304de",
"score": "0.5640609",
"text": "def synset_to_string(synset)\n if synset.nil?\n return '...'\n else\n possible_strings = synset.words\n return possible_strings.sample\n end\nend",
"title": ""
},
{
"docid": "729370d61e62d579be92876c15fdb506",
"score": "0.56339353",
"text": "def get_word\n\t\twords = []\n\t\tFile.open(@@FILENAME).readlines.each do |line|\n\t\t\tline = line.downcase.chomp\n\t\t\twords.push(line) if line.length >= 5 && line.length <= 12\n\t\tend\n\t\tguess_word = words.sample\n\tend",
"title": ""
},
{
"docid": "3de43704fc9399497455420d4518510c",
"score": "0.56284595",
"text": "def inscription(words)\n if @text == nil\n @text = words\n # If the door is already inscribed, it may not be modified\n else\n raise ArgumentError.new(\"A door may only be inscribed once.\")\n end\n return @text\n end",
"title": ""
},
{
"docid": "6fc82f4962cb9d61873db1b7fa3d52c3",
"score": "0.5624909",
"text": "def test_2_convert_build_word_array_to_string\n $build_word = [\"t\", \"_\", \"_\", \"t\", \"_\", \"n\", \"_\"]\n results = current_word()\n assert_equal(\"t _ _ t _ n _\", results)\n end",
"title": ""
},
{
"docid": "5acbdb5f339a6b4c3c20c2a8ba1fd603",
"score": "0.5624423",
"text": "def get_word (board, *coords)\n\tcoords.map {|x| board[x.first][x.last].join}\nend",
"title": ""
},
{
"docid": "3adeabc8794605a96d02ee53e8969b13",
"score": "0.5618766",
"text": "def get_feedback\n feedback_string = \"\"\n @file.secret_word.split(\"\").each_with_index do |letter, index|\n feedback_string +=\n if @used_letters.include?(letter.downcase)\n \" #{letter} \"\n else\n \" _ \"\n end\n end\n feedback_string\n end",
"title": ""
},
{
"docid": "d5f345749492f546b5f25f1c68c68e0f",
"score": "0.5617483",
"text": "def displayable_word\n letters = @word.split(//)\n result = \"\"\n letters.each do |letter|\n if @guessed_letters.include?(letter)\n result += \"#{letter} \"\n else\n result += \"__ \"\n end\n end\n return result\n end",
"title": ""
},
{
"docid": "510cb30cc2e0359a75378d06c9dd317a",
"score": "0.5603607",
"text": "def make_sentence(lookups)\n sentence = \"\"\n word_1 = \"\\n\"\n word_2 = \"\\n\"\n next_word = \"\\n\" #[\"It\", \"The\", \"If\", \"They\", \"We\", \"What\", \"Do\", \"Is\", \"This\", \"A\", \"Giants\"].sample\n source_preference = rand(lookups.length-1)\n\n source_counter = []\n lookups.length.times do\n source_counter << 0\n end\n\n current_lookup = lookups[source_preference]\n loop_counter = 0\n until end_of_sentence?(next_word)\n loop_counter += 1\n key = keymaker(word_1, word_2)\n\n #check if we need to change the source\n if source_counter[source_preference] >= source_counter.min + 3\n #change to least used source if possible\n bestfit_lookup_index = source_counter.index(source_counter.min)\n wildcard_lookup_index = rand(lookups.length - 1)\n\n if lookups[bestfit_lookup_index][key] != nil\n source_preference = bestfit_lookup_index\n current_lookup = lookups[source_preference]\n puts \"changed source to bestfit \" + source_preference.to_s\n puts sentence\n elsif lookups[wildcard_lookup_index][key] != nil\n source_preference = wildcard_lookup_index\n current_lookup = lookups[wildcard_lookup_index]\n # puts \"changed source to wildcard \" + source_preference.to_s\n # puts sentence\n end\n end\n\n if current_lookup[key] != nil\n source_counter[source_preference] += 1\n next_word = current_lookup[key].sample\n sentence = sentence + \" \" + next_word if next_word != \"\\n\"\n end\n word_1 = word_2\n word_2 = next_word\n break if word_1 + word_2 + next_word == \"\\n\\n\\n\"\n\n if loop_counter >= 100\n # puts \"we are over loop counter: \" + word_1 + \" \" + word_2 + \" \" + next_word\n break\n end\n end\n\n return sentence[1..-1] if sentence.length > 15 # chuck out the sentence if it's too short\n # puts \"sentence was too short\"\n make_sentence(lookups)\nend",
"title": ""
},
{
"docid": "183f7da7fd86e5e21511f43e20396b8f",
"score": "0.5601877",
"text": "def word_at pos\n\t\t\treturn @words[pos]\n\t\tend",
"title": ""
},
{
"docid": "188c5a78dfd62ebce68a4abf112966e4",
"score": "0.55965817",
"text": "def word_substituter(tweet)\n shortened = []\n\n tweet_words = tweet.split\n\n tweet_words.each do |word|\n short_form = dictionary(word.downcase)\n if short_form\n shortened << short_form\n else\n shortened << word\n end\n end\n\n shortened.join(' ')\nend",
"title": ""
},
{
"docid": "1e6485296c7373330dbc12d33b804a09",
"score": "0.5591312",
"text": "def words\n [\n \"geography\", \"cat\", \"yesterday\", \"java\", \"truck\", \"opportunity\",\n \"fish\", \"token\", \"transportation\", \"bottom\", \"apple\", \"cake\",\n \"remote\", \"boots\", \"terminology\", \"arm\", \"cranberry\", \"tool\",\n \"caterpillar\", \"spoon\", \"watermelon\", \"laptop\", \"toe\", \"toad\",\n \"fundamental\", \"capitol\", \"garbage\", \"anticipate\", \"pesky\"\n ]\n end",
"title": ""
},
{
"docid": "1f3c65145acfd60d421e07800ac14acc",
"score": "0.5591208",
"text": "def concatenate_words(w1, w2)\n # ADD YOUR CODE HERE\n w1+\" \"+w2\nend",
"title": ""
},
{
"docid": "a588034e06a19d319a609b5d7e5b63a3",
"score": "0.5587833",
"text": "def catch_phrase\n translate('faker.company.buzzwords').collect {|list| list.sample }.join(' ')\n end",
"title": ""
},
{
"docid": "e439f9a2fd5429b628156670d1c28b12",
"score": "0.5582577",
"text": "def word\n return @word.downcase\n end",
"title": ""
},
{
"docid": "e2172af52bfa3e94eb4f9a756ccf30e6",
"score": "0.55788404",
"text": "def to_string\n result = \"\"\n words = @head\n if words.nil?\n \"\"\n elsif words.next_node.nil?\n result = words.data\n else\n result += \"#{words.data}\"\n while words.next_node\n words = words.next_node\n result += \" #{words.data}\"\n end\n result\n end\n end",
"title": ""
},
{
"docid": "e5b8af095cd9a75725ac10c530653c02",
"score": "0.55727494",
"text": "def shortest_string(list_of_words)\n if list_of_words == []\n \treturn nil\n else\n \t\n \tshortest_word = \"\"\n \tlist_of_words.each do |word|\n \t\tif shortest_word < word\n \t\t\treturn shortest_word = word\n \t\telse\n \t\t\tword = shortest_word\n \t\tend\n \tend\n \tend\n \tp shortest_word\nend",
"title": ""
},
{
"docid": "eb6b0560af6bb4b601fab5062212b9be",
"score": "0.5565315",
"text": "def value_of_word( word)\n word.map{ |x, y| self[x, y]}.join\n end",
"title": ""
},
{
"docid": "c0fe70a9b58b6453af81493849db1afb",
"score": "0.55633134",
"text": "def run(source, target)\n @current_words = [source]\n @all_seen_words = {source => nil}\n while @current_words.empty? == false\n # new_current_words = []\n # @current_words.each do |current_word|\n # adj_words = adjacent_words(current_word)\n # adj_words.each do |adj_word|\n # next if @all_seen_words.include?(adj_word)\n # new_current_words << adj_word\n # @all_seen_words << adj_word\n # end\n # end\n new_current_words = explore_current_words\n @current_words = new_current_words\n break if @current_words.include?(target)\n end\n build_path(target)\n end",
"title": ""
},
{
"docid": "97f7a8dfc1f0ab556c3205bef9bee4c6",
"score": "0.55617326",
"text": "def start_of_word\n @start_of_word ||= begin\n match = source.code[0..offset-1].to_s.match(start_word_pattern)\n result = (match ? match[0] : '')\n # Including the preceding colon if the word appears to be a symbol\n result = \":#{result}\" if source.code[0..offset-result.length-1].end_with?(':') and !source.code[0..offset-result.length-1].end_with?('::')\n result\n end\n end",
"title": ""
},
{
"docid": "97f7a8dfc1f0ab556c3205bef9bee4c6",
"score": "0.5560897",
"text": "def start_of_word\n @start_of_word ||= begin\n match = source.code[0..offset-1].to_s.match(start_word_pattern)\n result = (match ? match[0] : '')\n # Including the preceding colon if the word appears to be a symbol\n result = \":#{result}\" if source.code[0..offset-result.length-1].end_with?(':') and !source.code[0..offset-result.length-1].end_with?('::')\n result\n end\n end",
"title": ""
},
{
"docid": "ea8b66ba90594226c32ae4b18077ab2d",
"score": "0.55561614",
"text": "def word; end",
"title": ""
}
] |
ee974bdcc565fbb17f4230c8d6a1379d
|
Start a new conversation with the API
|
[
{
"docid": "faaf0a31b2030d67251a52d34ab795ac",
"score": "0.0",
"text": "def initialize(key)\n @key = key\n end",
"title": ""
}
] |
[
{
"docid": "cfda706c9562b809eb43cb5d15d98713",
"score": "0.737714",
"text": "def start_conversation( organization_id, params={} )\n conversation_uri = 'conversations.json'\n conversation_uri = \"stencils/#{params[:stencil_id]}/#{conversation_uri}\" if params.include? :stencil_id\n conversation_uri = \"organizations/#{organization_id}/#{conversation_uri}\"\n post conversation_uri, extra_query: { conversation: params }, response_container: %w( conversation ), transform: SignalCloud::Conversation\n end",
"title": ""
},
{
"docid": "fc8eda33a99f4df5b715ff240627f20b",
"score": "0.72881716",
"text": "def create\n # @conversation = ( @stencil.nil? ? @organization : @stencil ).conversations.create( params[:conversation] )\n #@conversation = @stencil.open_conversation( conversation_params )\n #authorize!( :create, @conversation )\n\n if @conversation.update_attributes( conversation_params )\n #JobTools.enqueue SendConversationChallengeJob.new( @conversation.id )\n SendConversationChallengeJob.perform_async( @conversation.id )\n flash[:success] = 'The conversation has been successfully started.'\n end\n respond_with @organization, @conversation\n end",
"title": ""
},
{
"docid": "5a1443aa05d51728d9cdcd8638b7013b",
"score": "0.720396",
"text": "def start_conversation\n return render_error_messages(['Please indicate user ID to start conversation with']) unless params[:user_id].present?\n user = User.find(params[:user_id])\n authorize! :start_conversation, user\n conversation = Conversation.get_single_conversation(current_user.id, params[:user_id])\n if conversation.errors.any?\n render_error_model conversation\n else\n render_conversation(conversation)\n end\n end",
"title": ""
},
{
"docid": "e176460451adfb11780ec6dfea7d345a",
"score": "0.6972763",
"text": "def start(*args)\r\n conversation = self.class.strong_contain(*args)\r\n\r\n if conversation.nil?\r\n conversation = Conversation.new()\r\n\r\n conversation.join *args\r\n\r\n conversation.save\r\n end\r\n\r\n conversation\r\n end",
"title": ""
},
{
"docid": "432e35838058c1bbf71ad4dfbb6185f9",
"score": "0.69407755",
"text": "def create_conversation(opts={})\n @list.client.post(\"#{url}/conversations\", opts)\n end",
"title": ""
},
{
"docid": "26839023f74cff06387ed9d137f43c86",
"score": "0.6914045",
"text": "def create\n @current_user = User.find_by(token: params[:token])\n changed = {\n title: conversation_params[:title],\n privacy: conversation_params[:privacy]\n }\n @conversation = Conversation.new(changed)\n @username = params[:username]\n\n if @conversation.save\n if @conversation.privacy\n @user = User.find_by(username: @username)\n if @user\n Message.create!(\n text: 'has started the conversation.',\n username: @current_user.username,\n user_id: @current_user.id,\n conversation_id: @conversation.id\n )\n Message.create!(\n text: 'has joined the conversation.',\n username: @user.username,\n user_id: @user.id,\n conversation_id: @conversation.id\n )\n else\n raise 'Error'\n end\n else\n Message.create!(\n text: 'has started the conversation.',\n username: @current_user.username,\n user_id: @current_user.id,\n conversation_id: @conversation.id\n )\n end\n # render json: @conversation, status: :created, location: @conversation\n serialized_data = ActiveModelSerializers::Adapter::Json.new(\n ConversationSerializer.new(@conversation)\n ).serializable_hash\n ActionCable.server.broadcast 'conversations_channel', serialized_data\n head :ok\n else\n render json: @conversation.errors, status: :unprocessable_entity\n end\n end",
"title": ""
},
{
"docid": "effc4406d1448cd3cef76c76e41ff1c2",
"score": "0.6877927",
"text": "def start_conversation\n # Quick replies are accessible through message object's quick_reply property,\n # by default it's the quick reply text in ALL CAPS\n # you can also react on the text itself\n message.typing_on\n case message.quick_reply\n when 'OK'\n say \"Glad you're doing well!\"\n stop_thread\n when 'NOT_OK'\n say \"Too bad. What happened?\"\n next_command :appear_nice\n else\n say \"🤖\"\n # it's always a good idea to have an else, quick replies don't\n # prevent user from typing any message in the dialogue\n stop_thread\n end\n message.typing_off\n end",
"title": ""
},
{
"docid": "629eadf7020538467b9400a3f32ca478",
"score": "0.68377346",
"text": "def new\n @conversation = Conversation.new\n end",
"title": ""
},
{
"docid": "f9fdf7154d81625476077c5a1c39ea73",
"score": "0.6827904",
"text": "def create_conversation(data)\n post(\"conversations\", { body: data })\n\n # Extract ID of created conversation from the Location header\n conversation_uri = last_response.headers[\"location\"]\n conversation_uri.match(/(\\d+)$/)[0]\n end",
"title": ""
},
{
"docid": "7fad9acdb463d8f5b2b5f80db75b6278",
"score": "0.68105114",
"text": "def create\n if Api::V1::Conversation.between(@current_user.id, params[:recipient_id]).present?\n conversation = Api::V1::Conversation.between(@current_user.id, params[:recipient_id]).first\n else\n conversation = Api::V1::Conversation.new(conversation_params)\n conversation.sender_id = @current_user.id\n conversation.save\n end\n render json: conversation\n end",
"title": ""
},
{
"docid": "10e71c2a72e48db48ac1f8e362467ba5",
"score": "0.68091744",
"text": "def create_conversation(data)\n post(\"conversations\", { body: data })\n\n # Extract ID of created conversation from the Location header\n conversation_uri = last_response.headers[\"location\"]\n conversation_uri.match(/(\\d+)$/)[1]\n end",
"title": ""
},
{
"docid": "b9c83bcb4b4ae72c03e020949eace54f",
"score": "0.6797027",
"text": "def start_conversation_with_http_info(start_request, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ConversationApi.start_conversation ...'\n end\n # verify the required parameter 'start_request' is set\n if @api_client.config.client_side_validation && start_request.nil?\n fail ArgumentError, \"Missing the required parameter 'start_request' when calling ConversationApi.start_conversation\"\n end\n # resource path\n local_var_path = '/conversation/conversations'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n header_params['X-UltraCart-Api-Version'] = @api_client.select_header_api_version()\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(start_request)\n auth_names = ['ultraCartOauth', 'ultraCartSimpleApiKey']\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 => 'ConversationStartResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ConversationApi#start_conversation\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "267adb4cefe7845d805cc99f38b84737",
"score": "0.6777979",
"text": "def conversation\n\n end",
"title": ""
},
{
"docid": "6775b7b16cfaa400cd7f5477a6b33bb1",
"score": "0.670389",
"text": "def create\n @current_user = current_user\n conv = Conversation.create({\n :from_user_id => @current_user.id,\n :to_user_id => @current_user.locked_with\n })\n redirect_to \"/conversations/#{conv.id}\"\n end",
"title": ""
},
{
"docid": "e32659ff2c9579b933ea129aa51345ee",
"score": "0.6698826",
"text": "def create(params)\n post \"/conversations\", params\n end",
"title": ""
},
{
"docid": "14d1d9c762a45d17583770ab23c002c6",
"score": "0.6689997",
"text": "def create_conversation(options = {})\n post(\"inbox/conversations\", conversations: [options]).pop\n end",
"title": ""
},
{
"docid": "c2da080e5dc38718db0d8297442b3fb9",
"score": "0.66345435",
"text": "def create\n conversation = Conversation.new(conversation_params)\n\n if conversation.save\n serialized_data = ActiveModelSerializers::Adapter::Json.new(\n ConversationSerializer.new(conversation)\n ).serializable_hash\n \n ActionCable.server.broadcast 'conversations_channel', serialized_data\n head :ok\n elsif conversation.errors\n puts \"error\"\n puts conversation.errors.each { |error| puts error }\n end\n end",
"title": ""
},
{
"docid": "3c6bafca8c3dcd2226a9c5700c730848",
"score": "0.66090024",
"text": "def bot\n number = params['message']['conversation']['recipient']['handle']\n\n date = Time.at(params['message']['date']/1000)\n inbound = params['message']['inbound']\n text = params['message']['text']\n\n # create or find the user\n user = User.where(phone_number: number).first_or_create do |u|\n u.created_at = date\n puts \"New user created for #{number}\"\n end\n\n # find the most recent conversation or create a new one\n conversation = Conversation.where(user: user).order(:created_at).last\n last_message = conversation.messages.order(:created_at).last if conversation\n\n # if time since last message is outside threshold, create a new conversation\n if last_message.nil? || (inbound && hours_between(date, last_message.created_at) > HOURS_BETWEEN_CONVO)\n conversation = Conversation.create(user: user, created_at: date)\n ap conversation\n end\n\n # create the message\n message = Message.new(body: text, inbound: inbound)\n message.created_at = date\n message.conversation = conversation\n message.save\n ap message\n\n # send a reply\n send_text(ChatManager.new(conversation).reply(text), number)\n\n render nothing: true, status: :ok\n end",
"title": ""
},
{
"docid": "6255a50577643ec6beae732fad6e360e",
"score": "0.6585383",
"text": "def create\n if Conversation.between(params[:sender_id],params[:recipient_id])\n .present?\n @conversation = Conversation.between(params[:sender_id],\n params[:recipient_id]).first\n else\n @conversation = Conversation.create!(conversation_params)\n end\n redirect_to conversation_messages_path(@conversation)\n end",
"title": ""
},
{
"docid": "9a585e720d62380f9477ba0d3a33e96e",
"score": "0.6554067",
"text": "def create\n\t\t#if a conversation exists between the sender_id and recipient_id, return it and assign it to the @conversation instance variable\n\t\tif Conversation.between(params[:sender_id],params[:recipient_id]).present?\n\t\t@conversation = Conversation.between(params[:sender_id],params[:recipient_id]).first\n\t\telse\n\t\t#If no conversation was found between the two users, create a new conversation and return a json response with the id of the conversation.\n\t\t@conversation = Conversation.create!(conversation_params)\n\t\tend\n\n\t\trender json: { conversation_id: @conversation.id }\n\tend",
"title": ""
},
{
"docid": "9939d5a551f76ddbd943f57eafff838d",
"score": "0.65458333",
"text": "def start_conversation(start_request, opts = {})\n data, _status_code, _headers = start_conversation_with_http_info(start_request, opts)\n data\n end",
"title": ""
},
{
"docid": "59a6b189cb43b5940a394ca6d5b2ffa5",
"score": "0.6526565",
"text": "def perform\n conversation = Conversation.new(user: user)\n conversation.messages.build(body: body, user: user)\n \n conversation\n end",
"title": ""
},
{
"docid": "5c3296b31f59a79708fc97a6cff4abfc",
"score": "0.6499243",
"text": "def create\n @user.create_conversation_and_message!(new_conv_params[:conversation_user_ids], new_message_attrs)\n end",
"title": ""
},
{
"docid": "3b650a1311246fd54529effad829a342",
"score": "0.6471793",
"text": "def create\n user = User.find params[:conversation][:recipients]\n conver = current_user.send_message(user, *conversation_params(:body, :subject)).conversation\n redirect_to \"#{conversations_url}?which_box=sent_box&conversation=#{conver.id}\"\n end",
"title": ""
},
{
"docid": "bcc930d977d1ec8bfe018e64923fda07",
"score": "0.64554876",
"text": "def set_conversation\n #puts Conversation.find(params[:id])\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "928900212dbb59fd6500f75c1043b5c0",
"score": "0.6395341",
"text": "def open_conversation \n Mailboxer::Conversation.create!(subject: \"You've been matched\")\n Mailboxer::Notification.create!(type: \"Mailboxer::Message\", sender_id: user_id, sender_type: \"User\", body: \"You've been matched\", subject: \"You've been matched\", conversation_id: last_convo)\n Mailboxer::Receipt.create!(mailbox_type: \"inbox\", receiver_id: shown_user_id, receiver_type: \"User\", is_read: \"t\", notification_id: last_notification)\n Mailboxer::Receipt.create!(mailbox_type: \"inbox\", receiver_id: user_id, receiver_type: \"User\", is_read: \"t\", notification_id: last_notification)\n end",
"title": ""
},
{
"docid": "11e1f3d7e7da7eb39edcbabeca0a01a9",
"score": "0.6381729",
"text": "def create\n \t\tif Conversation.between(params[:sender_id],params[:recipient_id]).present?\n \t@conversation = Conversation.between(params[:sender_id], params[:recipient_id]).first\n\t \telse\n\t \t@conversation = Conversation.create!(conversation_params)\n\t \tend\n\t \t#redirect to the new conversation\n\n\t redirect_to conversation_messages_path(@conversation)\n\n\tend",
"title": ""
},
{
"docid": "ba76d133fcdcd98e3affa1eb97a3f34f",
"score": "0.63775265",
"text": "def set_conversation\n @conversation = Conversation.find({id: params[:id]})\n end",
"title": ""
},
{
"docid": "41daa9eca3ddb874a96be28b857a574e",
"score": "0.63720304",
"text": "def create\n \n # set the context variable as a Hash\n context = JSON.parse(message_params[:context].presence || Conversation.initialize(current_customer))\n\n # send message and context to Watson Conversation\n response = Conversation.send current_customer, message_params[:content], context\n \n # Extract messages and context \n @messages = response[:output][:text]\n @context = response[:context].to_json\n \n respond_to { |format| format.js } # respond with Javascript to update chat bubble\n end",
"title": ""
},
{
"docid": "2d355b863167f7c6b94692ed7336a484",
"score": "0.63451815",
"text": "def create\n @conversation = Conversation.new(conversation_params)\n if @conversation.save!\n @conversation.update(user_id: current_user.id)\n render json: @conversation, status: 201 \n else\n render json: { errors: @conversation.errors}, status: 422\n end\n end",
"title": ""
},
{
"docid": "54966e9e91bc216241b10ed1631a0d26",
"score": "0.63368165",
"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.63368165",
"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.63368165",
"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.63368165",
"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.63368165",
"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": "167430e71be2232283f9083672cd5f54",
"score": "0.63119316",
"text": "def create\n @conversation = Conversation.new(conversation_params.merge(:user_id_creator => current_user.id))\n\n respond_to do |format|\n if @conversation.save\n format.html { redirect_to @conversation, notice: \"Conversation was successfully created. id - #{current_user.id}\" }\n format.json { render :show, status: :created, location: @conversation }\n else\n format.html { render :new }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.6307563",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "8a3788a716202fd5a7bf66ae4bf8c1c9",
"score": "0.63070995",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "1ea40e3d7eba49e3586118ecdf59bf69",
"score": "0.6289144",
"text": "def set_conversation\n @conversation = Conversation.find_by(id: params[:id])\n end",
"title": ""
},
{
"docid": "1ea40e3d7eba49e3586118ecdf59bf69",
"score": "0.6289144",
"text": "def set_conversation\n @conversation = Conversation.find_by(id: params[:id])\n end",
"title": ""
},
{
"docid": "b65a82e3ac20187784ddc720f13c993b",
"score": "0.6273426",
"text": "def create\n @conversation = Conversation.new(conversation_params)\n @existing_convo = Conversation.where(\"user1_id = ? AND user2_id = ?\", params[:conversation][:user1_id], params[:conversation][:user2_id]).first\n \n respond_to do |format|\n if @conversation.save\n @convo = Conversation.last[:id]\n format.html { redirect_to conversation_messages_path(@convo), notice: 'This is the beginning of the conversation.' }\n format.json { render :show, status: :created, location: @conversation }\n else\n format.html { redirect_to conversation_messages_path(@existing_convo.id) }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "54626b900c433393dac4d8f416c56309",
"score": "0.6270799",
"text": "def create\n conversation = Conversation.new(conversation_params)\n if conversation.save!\n conversation.update(user_id: current_user.id)\n render json: conversation, status: 201\n else\n render json: { errors: conversation.errors}, status: 422\n end\n end",
"title": ""
},
{
"docid": "f9552de535b479e805a7724745c66202",
"score": "0.6268197",
"text": "def set_conversation\n @conversation = Conversation.friendly.find(params[:id])\n end",
"title": ""
},
{
"docid": "5a7a1a751209ca53169ddbda9c9bdcbf",
"score": "0.6250686",
"text": "def message\n @user1 = User.find(session[:user_id])\n @user2 = User.find(params[:id])\n \n @con = Conversation.find_conversation(@user1, @user2)\n \n if @con.nil?\n @con = Conversation.create_between(@user1, @user2)\n end\n \n redirect_to :action => :show, :id => @con.id\n end",
"title": ""
},
{
"docid": "663d8e26fd4563886f958819b1e42cbe",
"score": "0.625059",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "663d8e26fd4563886f958819b1e42cbe",
"score": "0.625059",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "663d8e26fd4563886f958819b1e42cbe",
"score": "0.625059",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "4a876cfcb19aa69560fec90aef224f23",
"score": "0.6242014",
"text": "def set_conversation\n @conversation = Conversation.find(params[:id])\n end",
"title": ""
},
{
"docid": "1d7e88da571c39a0018c7db21c3983aa",
"score": "0.6227058",
"text": "def create\n @conversation = Conversation.new(conversation_params)\n\n respond_to do |format|\n if @conversation.save\n format.html { redirect_to @conversation, notice: 'Conversation was successfully created.' }\n else\n format.html { render action: 'new' }\n end\n end\n end",
"title": ""
},
{
"docid": "730103e78710111aef889927ccb4ae2a",
"score": "0.62202513",
"text": "def create\n @conversation = Conversation.new(conversation_params)\n\n respond_to do |format|\n if @conversation.save\n format.html { redirect_to conversation_messages_path(@conversation), notice: 'Conversation was successfully created.' }\n format.json { render :show, status: :created, location: conversation_messages_path(@conversation) }\n else\n format.html { render :new }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3a6c4dd7e7843033e6659a4bfb11eb13",
"score": "0.62186545",
"text": "def create\n @conversation = Conversation.new(conversation_params)\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 :show, status: :created, location: @conversation }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "bed11879627dc2cd7a3538d75f93cac2",
"score": "0.62115705",
"text": "def create\n @conversation = Conversation.new(conversation_params)\n\n respond_to do |format|\n if @conversation.save\n format.html { redirect_to users_path, notice: 'Conversation was successfully created.' }\n format.json { render :show, status: :created, location: @conversation }\n else\n format.html { render :new }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7a7eb3160cad31c35233e0f37ac88231",
"score": "0.61988765",
"text": "def create_project_conversation(project_id, query={})\n perform_post(\"/api/1/projects/#{project_id}/conversations\", :body => {:conversation => query})\n end",
"title": ""
},
{
"docid": "cb5d0a32bb88a7a03e550198d3986966",
"score": "0.61623",
"text": "def create\n @conversation = current_user.conversations.build\n flash[:notice] = 'Conversation was successfully created.' if @conversation.save\n respond_with @conversation\n end",
"title": ""
},
{
"docid": "f3667771391282acfe9497c8070714b1",
"score": "0.6161195",
"text": "def create_conversation(conversation)\n if !conversation\n raise StandardError.new(\"Missing Conversation\")\n end\n\n url = \"/conversations.json\"\n\n begin\n response = Client.create_item(@auth, url, conversation.to_json)\n rescue StandardError => e\n puts \"Could not create conversation: #{e.message}\"\n end\n end",
"title": ""
},
{
"docid": "aacf6abe82f0c154f9eb97fabf0f8ac9",
"score": "0.6157522",
"text": "def create\n @conversation = Conversation.new(conversation_params)\n @conversation.users << current_user\n @conversation.user = current_user\n respond_to do |format|\n @conversation.kind = 'channel'\n if @conversation.save\n format.html { redirect_to @conversation, notice: 'Conversation was successfully created.' }\n format.json { render :show, status: :created, location: @conversation }\n else\n format.html { render :new }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b511c88c7c94e5d4d6aaa38b5d3296c0",
"score": "0.6152931",
"text": "def start_conversation( service=nil, topic=nil )\n try \"Starting conversation #{service} #{topic}\", Dde::Errors::ClientError do\n error \"DDE is not initialized\" unless dde_active?\n error \"Another conversation already established\" if conversation_active?\n\n # Create DDE strings for service and topic unless they are omitted\n @service = Dde::DdeString.new(@id, service) if service\n @topic = Dde::DdeString.new(@id, topic) if topic\n\n # Initiate new DDE conversation, returns conversation handle or nil \n error unless @conversation = dde_connect(@id, @service.handle, @topic.handle)\n end\n end",
"title": ""
},
{
"docid": "9b8f8c13da074ed4da230aea131f8e6f",
"score": "0.61404383",
"text": "def create\n if current_user.id == conversation_params[:user_id].to_i\n redirect_back fallback_location: listings_path, notice: 'This listing belongs to you.'\n elsif existing_conversation = Conversation.between(current_user.id, conversation_params[:user_id]).first\n redirect_to conversation_path(existing_conversation.id)\n else\n @conversation = Conversation.new\n current_user_participation = @conversation.participations.build(user: current_user)\n other_participation = @conversation.participations.build(user: User.find(conversation_params[:user_id]))\n\n respond_to do |format|\n if @conversation.save && current_user_participation.save && other_participation.save\n format.html { redirect_to @conversation, notice: 'Conversation was successfully created.' }\n format.json { render :show, status: :created, location: @conversation }\n else\n format.html { render :new }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9ced0bf7bccaa3b701f00fc138f88a58",
"score": "0.6131331",
"text": "def create\n @conversation = Conversation.new(scout_id: current_user.id, athlete_id: conversation_params[:athlete_id])\n\n if @conversation.save\n redirect_to @conversation, notice: 'Conversation created' }\n else\n render :new\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end",
"title": ""
},
{
"docid": "41fd59bb8a169af4e3ced904b5eaa98b",
"score": "0.61282736",
"text": "def conversation(service_instance_sid: nil, inbound_autocreation: nil, routing_assignment_timeout: nil, inbound_timeout: nil, url: nil, method: nil, record: nil, trim: nil, recording_status_callback: nil, recording_status_callback_method: nil, recording_status_callback_event: nil, status_callback: nil, status_callback_method: nil, status_callback_event: nil, **keyword_args)\n append(Conversation.new(service_instance_sid: service_instance_sid, inbound_autocreation: inbound_autocreation, routing_assignment_timeout: routing_assignment_timeout, inbound_timeout: inbound_timeout, url: url, method: method, record: record, trim: trim, recording_status_callback: recording_status_callback, recording_status_callback_method: recording_status_callback_method, recording_status_callback_event: recording_status_callback_event, status_callback: status_callback, status_callback_method: status_callback_method, status_callback_event: status_callback_event, **keyword_args))\n end",
"title": ""
},
{
"docid": "4b22503248ab529b848517e2c17c6962",
"score": "0.6120515",
"text": "def create\n\t\trecipients = conversation_params(:recipients).split(',')\n\t\tconversation = current_user.send_message(recipients, *conversation_params(:body, :subject)).conversation\n\t\t\n\t\trespond_to do |format|\n\t\t\tformat.js {\n\t\t\t\trender 'conversations/update_conversations'\n\t\t\t}\n\t\tend\n\tend",
"title": ""
},
{
"docid": "6940f99b945a9da6f304cc473b50e26c",
"score": "0.6116886",
"text": "def conversation(username)\n creds_not_found if @username.nil? == true && @username.nil? == true\n params = {\n 'username' => @username,\n 'auth_token' => @auth_token,\n 'endpoint' => '/loq/conversation'\n }\n jwt = sign_token(params)\n response = endpoint_auth(jwt)\n sc_data = {\n 'conversation_id' => @username + '~' + username\n }\n json_data = post_sc_request(response, sc_data)\n json_data\n end",
"title": ""
},
{
"docid": "a2c99b9e97399e1635385332a3675e7a",
"score": "0.6115979",
"text": "def create \n if Conversation.between(params[:sender_id], params[:recipient_id]).present? \n @conversation = Conversation.between(params[:sender_id], params[:recipient_id]).first\n else\n @conversation = Conversation.create!(conversation_params)\n end \n \n redirect_to conversation_messages_path(@conversation)\n end",
"title": ""
},
{
"docid": "7c7f2f66080696489e0bdb924002a628",
"score": "0.6096717",
"text": "def set_conversation\n @conversation = Conversation.find(params[:conversation_id])\n end",
"title": ""
},
{
"docid": "b20d1fafd491362a54e55918f7a18f74",
"score": "0.6089279",
"text": "def create\n to_id = params[:to_id]\n from_id = params[:from_id]\n\n if Conversation.where(to_id, from_id).present?\n @conversation = Conversation.from_or_to.first\n else\n @conversation = Conversation.create(conversation_params)\n end\n end",
"title": ""
},
{
"docid": "6018ccf73a6a19decef313f62fe53217",
"score": "0.6075586",
"text": "def create\n \n # init conversation and set its author\n @conversation = Conversation.new(conversation_params)\n @conversation.author = @user\n \n # prevent double posting\n redirect_to conversation_path(Conversation.where(:author_id => @conversation.author.id).recent.where(:title => @conversation.title).take) and return unless @conversation.is_not_a_double_post?\n\n # redirect user to the new conversation or take user back to form if errors exist\n if @conversation.save\n redirect_to @conversation, notice: 'Conversation was successfully created. You will receive email notifications about new replies.'\n else\n render :new\n end\n end",
"title": ""
},
{
"docid": "ca0ca6b4be3e108934961ebd0e75c0d4",
"score": "0.60700965",
"text": "def converse_1_step(connection, conversation)\n msg = conversation.start(connection)\n dispatch_msg(connection, conversation, msg)\n end",
"title": ""
},
{
"docid": "0986cebec71d8a0d15fb82228223b1e8",
"score": "0.6042666",
"text": "def show\n @request = Request.find(params[:id])\n @conversation= Conversation.new(id: @request.id)\n end",
"title": ""
},
{
"docid": "10fd5942b5f71e824d5f3711a6929718",
"score": "0.6033833",
"text": "def conversation\n @_conversation ||=\n site.conversations.build(id: params[:conversation_id] || params[:id])\n end",
"title": ""
},
{
"docid": "076b444853d7a9d3231a2bee12e8da31",
"score": "0.6026479",
"text": "def start!(data = nil, *)\n # do_smth_with(data)\n\n # There are `chat` & `from` shortcut methods.\n # For callback queries `chat` if taken from `message` when it's available.\n response = from ? \"Hello #{from['username']}!\" : 'Hi there!'\n # There is `respond_with` helper to set `chat_id` from received message:\n respond_with :message, text: response\n # `reply_with` also sets `reply_to_message_id`:\n # reply_with :photo, photo: File.open('party.jpg')\n end",
"title": ""
},
{
"docid": "31ea99cca3cd92829fcf8ea20cb9a91a",
"score": "0.6017718",
"text": "def set_conversation\n @conversation = Conversation.friendly.find(params[:id])\n authorize @conversation\n end",
"title": ""
},
{
"docid": "0dba41bcc43513a4238f1368929fd89f",
"score": "0.5984266",
"text": "def create\n @charge_station = ChargeStation.find(params[:charge_station_id])\n if current_user == @charge_station.user\n # I am a lister so choose a conversation with user from list\n redirect_to(conversations_path(charge_station_id: @charge_station.id)) && return\n else\n # I am a customer looking to book\n @conv = Conversation.where(charge_station: @charge_station).where(user: current_user)\n end\n\n if @conv.first.present?\n # I have a conversation with host already\n redirect_to(messages_path(conversation_id: @conv.first.id)) && return\n end\n\n @conversation = Conversation.new(user: current_user, charge_station: @charge_station)\n\n respond_to do |format|\n if @conversation.save\n format.html { redirect_to messages_path(conversation_id: @conversation.id),\n notice: 'Conversation was successfully created.' }\n format.json { render :show, status: :created, location: @conversation }\n else\n format.html { render :new }\n format.json { render json: @conversation.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e98067ff7b241433fa6b7e3d40f92199",
"score": "0.5980568",
"text": "def create\n \n if Listener.exists?(phone_number: params[:From])\n @listener = Listener.where(phone_number: params[:From]).first\n if Conversation.exists?(sender_id: @listener.id)\n # Find conversation\n @conversation = Conversation.where(sender_id: @listener.id).first\n \n # Create message with conversation\n @message = @conversation.messages.create!(\n number: @listener.phone_number,\n text: params[:Body],\n inbound: true\n )\n \n # Render message with action cable\n send_cable(@message)\n \n # Check competitio -- to be updated later\n # Apply downcase to params body\n keyword = params[:Body].downcase!\n @competition = Competition.where(\"keyword like ?\", \"%#{keyword}%\").first\n @competition.competitors.create(phone_number: @listener.phone_number)\n \n # Send SMS\n boot_twilio\n @client.messages.create(\n from: ENV[\"TWILIO_NUMBER\"],\n to: @listener.phone_number,\n body: \"Hey! Thanks for being our listener. You're now registered as a competitor in the - #{@competition.title} - competition!\"\n )\n \n @message = @conversation.messages.create!(\n number: @listener.phone_number,\n text: \"Hey! Thanks for being our listener. You're now registered as a competitor in the - #{@competition.title} - competition!\",\n inbound: false\n )\n \n # Render JSON 200\n render json: { state: 200 }\n else\n # Create conversation\n @conversation = @listener.conversations.build(sender_id: @listener.id)\n @conversation.save \n \n # Create message with conversation\n @message = @conversation.messages.create!(\n number: @listener.phone_number,\n text: params[:Body],\n inbound: true\n )\n \n # Render message with action cable\n send_cable(@message)\n \n # Check competitio -- to be updated later\n @competition = Competition.where(\"keyword like ?\", \"%#{params[:Body]}%\").first\n @competition.competitors.create(phone_number: @listener.phone_number)\n \n # Send SMS\n boot_twilio\n @client.messages.create(\n from: ENV[\"TWILIO_NUMBER\"],\n to: @listener.phone_number,\n body: \"Hey! Thanks for messaging us for the first time. You're now registered as a competitor in the - #{@competition.title} - competition!\"\n )\n \n @message = @conversation.messages.create!(\n number: @listener.phone_number,\n text: \"Hey! Thanks for messaging us for the first time. You're now registered as a competitor in the - #{@competition.title} - competition!\",\n inbound: false\n )\n \n # Render JSON 200\n render json: { state: 200 }\n end\n else\n @listener = Listener.create!(phone_number: params[:From])\n \n # Create conversation\n @conversation = @listener.conversations.build(sender_id: @listener.id)\n \n # Create message with conversation\n @message = @conversation.messages.create!(\n number: @listener.phone_number,\n text: params[:Body],\n inbound: true\n )\n \n # Render message with action cable\n send_cable(@message)\n \n # Check competitio -- to be updated later\n # Apply downcase to params body\n keyword = params[:Body].downcase!\n @competition = Competition.where(\"keyword like ?\", \"%#{keyword}%\").first\n @competition.competitors.create(phone_number: @listener.phone_number)\n \n # Send SMS\n boot_twilio\n @client.messages.create(\n from: ENV[\"TWILIO_NUMBER\"],\n to: @listener.phone_number,\n body: \"Hey! Thanks for messaging us for the first time. You're now registered as a competitor in the - #{@competition.title} - competition!\"\n )\n \n @message = @conversation.messages.create!(\n number: @listener.phone_number,\n text: \"Hey! Thanks for messaging us for the first time. You're now registered as a competitor in the - #{@competition.title} - competition!\",\n inbound: false\n )\n \n # Render JSON 200\n render json: { state: 200 }\n end\n end",
"title": ""
},
{
"docid": "d4bf84add4dc482602f55bf4a92aed46",
"score": "0.5969276",
"text": "def conversation\n @conversation = Conversation.between(params[:sender_id], params[:recipient_id]).first\n end",
"title": ""
},
{
"docid": "a9c7dbe23d4600a7e69dc9c870cd20ae",
"score": "0.59629136",
"text": "def start(connection)\n selector = client_first_document\n build_message(connection, user.auth_source, selector)\n end",
"title": ""
},
{
"docid": "1e73eec9fc6f67ba87952a0bb703b305",
"score": "0.5960693",
"text": "def start(options = {})\n integrate_configs(options)\n \n # Connect to start a session in one of three modes\n if(@options[:question]) then\n resp = req(\"start?rcs=1&firstevents=1&spid=&randid=#{get_randID}&cansavequestion=1&ask=#{URI::encode(@options[:question])}\", :get)\n elsif(@options[:answer]) then\n resp = req(\"start?firstevents=1&wantsspy=1\", :get) #previously ended at 6\n else\n topicstring = \"\"\n topicstring = \"&topics=#{ URI::encode(@options[:topics].to_s) }\" if @options[:topics].is_a?(Array)\n resp = req(\"start?firstevents=1#{topicstring}\", :get) #previously ended at 6\n end\n \n # Was the response JSON?\n if resp =~ /^\"[\\w]+:\\w+\"$/ then\n # not json, simply strip quotes\n @id = resp[1..-2]\n else\n #json\n # parse, find ID, add first events\n resp = JSON.parse(resp)\n raise \"No ID in connection response!\" if not resp[\"clientID\"]\n @id = resp[\"clientID\"]\n\n # Add events if we requested it.\n add_events(resp[\"events\"]) if resp[\"events\"]\n end\n end",
"title": ""
},
{
"docid": "b73c1ab149985425f2c0598982f5f334",
"score": "0.59603196",
"text": "def start_typing\n @conversation.start_typing(current_user)\n head :ok\n end",
"title": ""
},
{
"docid": "b73c1ab149985425f2c0598982f5f334",
"score": "0.59603196",
"text": "def start_typing\n @conversation.start_typing(current_user)\n head :ok\n end",
"title": ""
},
{
"docid": "fa64ec16773ab7d5a21b8dc5260069f8",
"score": "0.5954985",
"text": "def start\n RestClient.post \"#{PREFIX}/tournament/start\"\n end",
"title": ""
},
{
"docid": "180f4be8f9ee32a40dc9c31d9582ad71",
"score": "0.5951499",
"text": "def create\n StatsManager::StatsD.time(Settings::StatsConstants.api['messages']['create']) do\n if !params.include?(:text)\n render_error(400, \"text of message required\")\n else\n if @conversation = Conversation.find(params[:conversation_id])\n msg_opts = {:user => current_user, :public => true, :text => params[:text]}\n @new_message = GT::MessageManager.build_message(msg_opts)\n @conversation.messages << @new_message\n begin\n if @conversation.save!\n\n ShelbyGT_EM.next_tick { GT::NotificationManager.send_new_message_notifications(@conversation, @new_message, current_user) } \n\n # NOT posting this action currently\n #ShelbyGT_EM.next_tick { GT::OpenGraph.send_action('comment', current_user, @conversation, @new_message.text) }\n \n\n @status = 200 \n StatsManager::StatsD.increment(Settings::StatsConstants.message['create'])\n end\n rescue => e\n render_error(404, e)\n end\n else\n render_error(404, \"could not find conversation with id #{params[:conversation_id]}\")\n end\n end\n end\n end",
"title": ""
}
] |
7126ab3a9a49c6435c0006268edac7ba
|
Loads the userspecified timezone from configatron, if one exists
|
[
{
"docid": "c4af4d4c52461c2b76580c4a8edaf0f2",
"score": "0.68316555",
"text": "def set_timezone\n Time.zone = configatron.timezone.to_s if configatron.timezone?\n end",
"title": ""
}
] |
[
{
"docid": "4227018bb2e2c65c0a9988b865f1fe7a",
"score": "0.69587654",
"text": "def load_tzinfo\n insert_listener_into_tzinfo\n load_tzinfo_definitions\n end",
"title": ""
},
{
"docid": "a9821140209cfd80bac2a1ba12c0e2a3",
"score": "0.6772825",
"text": "def load_timezone_info(identifier); end",
"title": ""
},
{
"docid": "a9821140209cfd80bac2a1ba12c0e2a3",
"score": "0.6772825",
"text": "def load_timezone_info(identifier); end",
"title": ""
},
{
"docid": "a9821140209cfd80bac2a1ba12c0e2a3",
"score": "0.6772825",
"text": "def load_timezone_info(identifier); end",
"title": ""
},
{
"docid": "a34ed0e110a6a060f568b83403dbe116",
"score": "0.6655129",
"text": "def load_time_zone\n Time.zone = resource.time_zone\n end",
"title": ""
},
{
"docid": "bb93a20a92299d5e1f0e0d4fb7795f39",
"score": "0.6649955",
"text": "def load_timezone_index; end",
"title": ""
},
{
"docid": "e2a3283d73d47d5f990421af22cd402c",
"score": "0.6607337",
"text": "def set_timezone\n Time.zone = configatron.timezone.to_s if configatron.timezone?\n end",
"title": ""
},
{
"docid": "0d389b2f87d9505df3a8c4e60627b478",
"score": "0.65879834",
"text": "def check_config\n raise 'Timezone missing from config.yml' unless @config['timezone']\n end",
"title": ""
},
{
"docid": "3098b569a27918b2e6f532352fbc872a",
"score": "0.6526569",
"text": "def ensure_timezone\n self.timezone = account.preference.timezone\n end",
"title": ""
},
{
"docid": "65b78a643d90a95ad1240bbe8350c237",
"score": "0.65150625",
"text": "def load_timezone_index\n self.class.load_timezone_index\n end",
"title": ""
},
{
"docid": "c87586a9d423db07bd0a5e7b0e2d755a",
"score": "0.6473005",
"text": "def find_zone(time_zone); end",
"title": ""
},
{
"docid": "c87586a9d423db07bd0a5e7b0e2d755a",
"score": "0.6473005",
"text": "def find_zone(time_zone); end",
"title": ""
},
{
"docid": "af237868825fffc6460f13911e31104b",
"score": "0.64616495",
"text": "def load_timezone_index\n unless @@timezone_index_loaded\n require_index('timezones')\n @@timezone_index_loaded = true\n end \n end",
"title": ""
},
{
"docid": "a49f2298ba7edf3827bc5a99b684afd1",
"score": "0.64084184",
"text": "def in_config_zone time, config: nil\n if time.respond_to? :in_time_zone\n time.in_time_zone(config[:time_zone])\n elsif time.is_a? Date\n config[:time_zone].local(time.year, time.month, time.day)\n else\n raise TypeError.new(\"Can't convert #{time.class} to a Time\")\n end\n end",
"title": ""
},
{
"docid": "a49f2298ba7edf3827bc5a99b684afd1",
"score": "0.64084184",
"text": "def in_config_zone time, config: nil\n if time.respond_to? :in_time_zone\n time.in_time_zone(config[:time_zone])\n elsif time.is_a? Date\n config[:time_zone].local(time.year, time.month, time.day)\n else\n raise TypeError.new(\"Can't convert #{time.class} to a Time\")\n end\n end",
"title": ""
},
{
"docid": "1eb965f4da14088df3a02c6543cb9aa1",
"score": "0.6395208",
"text": "def tz_timezone ; timezone? ? TZInfo::Timezone.get(@timezone) : nil ; end",
"title": ""
},
{
"docid": "6840b854e80faa924454d37363d20f1e",
"score": "0.63650304",
"text": "def current_rhel_tz\n return nil unless ::File.exist?(\"/etc/sysconfig/clock\")\n\n # https://rubular.com/r/aoj01L3bKBM7wh\n /ZONE=\"(.*)\"/.match(::File.read(\"/etc/sysconfig/clock\"))[1]\n end",
"title": ""
},
{
"docid": "d4d7a7168beef9aa0f302b9fb4de869d",
"score": "0.62822556",
"text": "def timezones; end",
"title": ""
},
{
"docid": "0873c591507091c38bb1e5c57a219403",
"score": "0.6243696",
"text": "def raise_unknown_timezone; end",
"title": ""
},
{
"docid": "731afce395204e22518d071786fd12eb",
"score": "0.62027764",
"text": "def linked_timezones; end",
"title": ""
},
{
"docid": "6195b2ed8b8ed1a5e52a535dd102140e",
"score": "0.6148865",
"text": "def time_zone\n zone = configuration[:time_zone] || 'UTC'\n zone = 'UTC' if zone.nil? || zone.strip == ''\n file \"/etc/timezone\",\n :content => zone+\"\\n\",\n :ensure => :present\n file \"/etc/localtime\",\n :ensure => \"/usr/share/zoneinfo/#{zone}\",\n :notify => service('ntp')\n end",
"title": ""
},
{
"docid": "a53d4b06047fb804932b5a48626a1b03",
"score": "0.61421716",
"text": "def initialize_time_zone\n if configuration.time_zone\n zone_default = Time.__send__(:get_zone, configuration.time_zone)\n\n unless zone_default\n raise \\\n 'Value assigned to config.time_zone not recognized.' +\n 'Run \"rake -D time\" for a list of tasks for finding appropriate time zone names.'\n end\n\n Time.zone_default = zone_default\n\n if configuration.frameworks.include?(:active_record)\n ActiveRecord::Base.time_zone_aware_attributes = true\n ActiveRecord::Base.default_timezone = :utc\n end\n end\n end",
"title": ""
},
{
"docid": "ebd52adb3c73a2b06e7641f6921ff1f9",
"score": "0.61188924",
"text": "def user_tz\n 'Europe/Athens'\n end",
"title": ""
},
{
"docid": "e975d4bd6bea55ba46730e6730dc83d7",
"score": "0.60846865",
"text": "def create_timezone; end",
"title": ""
},
{
"docid": "e975d4bd6bea55ba46730e6730dc83d7",
"score": "0.60846865",
"text": "def create_timezone; end",
"title": ""
},
{
"docid": "5069c421bdc69751a190114e00e778a4",
"score": "0.6051484",
"text": "def in_zone(zone_name, &block)\n\n prev_tz = ENV['TZ']\n ENV['TZ'] = zone_name if zone_name\n\n block.call\n\nensure\n\n ENV['TZ'] = prev_tz\nend",
"title": ""
},
{
"docid": "143ea866d241269fd1b952cb1b34cd77",
"score": "0.6047543",
"text": "def detect_timezone!\n self.send(self.class.timezone_detector.options.as, self.detect_timezone)\n end",
"title": ""
},
{
"docid": "e24d8e99056b064e0744e098d156919d",
"score": "0.60417277",
"text": "def linked_timezone(identifier); end",
"title": ""
},
{
"docid": "f3dd44c20c0c066abf7f7f0ccef284b1",
"score": "0.6029392",
"text": "def timezone\n @json['accountSetting']['timezone'] || ''\n end",
"title": ""
},
{
"docid": "f3dd44c20c0c066abf7f7f0ccef284b1",
"score": "0.6029392",
"text": "def timezone\n @json['accountSetting']['timezone'] || ''\n end",
"title": ""
},
{
"docid": "f3dd44c20c0c066abf7f7f0ccef284b1",
"score": "0.6029392",
"text": "def timezone\n @json['accountSetting']['timezone'] || ''\n end",
"title": ""
},
{
"docid": "e318c293db9f718d5192cd513ae62d33",
"score": "0.6004894",
"text": "def rails_timezone_for(iana_timezone)\n MASTER_MAP[iana_timezone]\n end",
"title": ""
},
{
"docid": "305b297c8ee1f02ae29e64eaec4f8fdd",
"score": "0.5960425",
"text": "def skip_timezone?; !!@skip_timezone; end",
"title": ""
},
{
"docid": "40aa195118b8db3bccf9527b2ac254b3",
"score": "0.59577",
"text": "def has_timezone?\n properties.include?(\"has_timezone\")\n end",
"title": ""
},
{
"docid": "5097d2ea749e80903ec5140b6b0a8c12",
"score": "0.5956813",
"text": "def timezone_get database, login, password\n call! :timezone_get, database, login, password\n end",
"title": ""
},
{
"docid": "96928db2ca17055c2ea19a52f6aeb1bd",
"score": "0.5950985",
"text": "def with_time_zone(tz_name) \n prev_tz = ENV['TZ']\n ENV['TZ'] = tz_name\n yield\nensure\n ENV['TZ'] = prev_tz\nend",
"title": ""
},
{
"docid": "a771ff959a6aa07cb290a5af0bda0cf2",
"score": "0.5926796",
"text": "def load_timezone_info(identifier)\n begin\n if @timezone_index.include?(identifier)\n path = File.join(@zoneinfo_dir, identifier)\n \n # Untaint path rather than identifier. We don't want to modify \n # identifier. identifier may also be frozen and therefore cannot be\n # untainted.\n path.untaint\n \n begin\n ZoneinfoTimezoneInfo.new(identifier, path)\n rescue InvalidZoneinfoFile => e\n raise InvalidTimezoneIdentifier, e.message\n end\n else\n raise InvalidTimezoneIdentifier, 'Invalid identifier'\n end\n rescue Errno::ENOENT, Errno::ENAMETOOLONG, Errno::ENOTDIR\n raise InvalidTimezoneIdentifier, 'Invalid identifier'\n rescue Errno::EACCES => e\n raise InvalidTimezoneIdentifier, e.message\n end\n end",
"title": ""
},
{
"docid": "47fe057cf4e3ab53fd3f794f0ebe785a",
"score": "0.59007084",
"text": "def populate_timezones\n if new_record?\n self.created_at_timezone ||= Time.zone.name\n else\n if self.deleted?\n self.deleted_at_timezone ||= Time.zone.name\n end\n end\n end",
"title": ""
},
{
"docid": "a7f51989ca28f56160cf77f6caf5b04d",
"score": "0.58922255",
"text": "def update_timezone_from_location; end",
"title": ""
},
{
"docid": "50523432755f13b78f291ec15bb8ee37",
"score": "0.58885723",
"text": "def in_time_zone(new_zone = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "50523432755f13b78f291ec15bb8ee37",
"score": "0.58885723",
"text": "def in_time_zone(new_zone = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "ec676d467d931e876183b90c1a909ca9",
"score": "0.5885647",
"text": "def set_timezone\n return if time_zone\n\n self.time_zone = if zip.present?\n code = ZipCode.find_by_zip_code(zip)\n (code && code.time_zone) ? code.time_zone : TimeZone.find_by_name('US/Eastern')\n elsif country.present?\n # Pick the first one available by country.\n TimeZone.by_country(country).first\n else # Now that TZs are set from browser or WBID, this should never happen\n TimeZone.default\n end\n end",
"title": ""
},
{
"docid": "4c8ea6726b41ab2d9416fce138862f50",
"score": "0.58833987",
"text": "def find_zone(time_zone)\n find_zone!(time_zone) rescue nil\n end",
"title": ""
},
{
"docid": "4c8ea6726b41ab2d9416fce138862f50",
"score": "0.58833987",
"text": "def find_zone(time_zone)\n find_zone!(time_zone) rescue nil\n end",
"title": ""
},
{
"docid": "5916851283047c1de1494a8e0a44430a",
"score": "0.5880272",
"text": "def load\n init_zones\n parse File.read( file ) if File.exists?(file)\n zones\n end",
"title": ""
},
{
"docid": "dd52d8d303f4c4e90cfa8e82d1c5f22a",
"score": "0.58478796",
"text": "def supported_timezones\n data[:supported_timezones]\n end",
"title": ""
},
{
"docid": "f6d4eeca5c7fae84329dc102a81259e8",
"score": "0.58400214",
"text": "def time_zones(us_time_zones_only = nil)\n us_time_zones_only = Aspera::Config::Localization.load_settings.us_time_zones_only if us_time_zones_only.nil?\n if us_time_zones_only\n us_zones\n else\n all_zones\n end\n end",
"title": ""
},
{
"docid": "8aa0d984aeffaeac43c4de627ebc2126",
"score": "0.58352196",
"text": "def in_timezone(tz)\n return nil unless valid?\n\n tz = ActiveSupport::TimeZone.new(tz) if tz.is_a?(String)\n return nil if tz.nil?\n\n date = if @hash.has_key?(:DATE)\n @hash[:DATE]\n else\n n = tz.now\n sprintf('%04d%02d%02d', n.year, n.month, n.day)\n end\n time = if @hash.has_key?(:TIME)\n @hash[:TIME]\n else\n '000000'\n end\n \n tz.parse(date + 'T' + time)\n end",
"title": ""
},
{
"docid": "eb5554251bd3712f3e28481fad329517",
"score": "0.5835029",
"text": "def in_zone(zone_name, t=Time.now, &block)\n\n EtOrbi.class_eval do\n @local_tzone = nil\n @local_tzone_tz = nil\n @local_tzone_loaded_at = nil\n end\n\n prev_tz = ENV['TZ']\n\n if zone_name == :no_env_tz\n ENV.delete('TZ')\n elsif zone_name == nil\n ENV['TZ'] = EtOrbi.os_tz\n else\n zone_name = EtOrbi.windows_zone_name(zone_name, t) if windows?\n # warning: the windows zone name is computed for now\n ENV['TZ'] = zone_name\n end\n\n block.call\n\n ensure\n\n ENV['TZ'] = prev_tz\n end",
"title": ""
},
{
"docid": "e83458a8aea4679f30e192ec79cfd174",
"score": "0.583429",
"text": "def timezone(identifier); end",
"title": ""
},
{
"docid": "e83458a8aea4679f30e192ec79cfd174",
"score": "0.583429",
"text": "def timezone(identifier); end",
"title": ""
},
{
"docid": "7d33a0d452c3ea0b08c10cb1d4daef9b",
"score": "0.5833105",
"text": "def set_timezone(timezone); end",
"title": ""
},
{
"docid": "7d33a0d452c3ea0b08c10cb1d4daef9b",
"score": "0.5833105",
"text": "def set_timezone(timezone); end",
"title": ""
},
{
"docid": "7d33a0d452c3ea0b08c10cb1d4daef9b",
"score": "0.5833105",
"text": "def set_timezone(timezone); end",
"title": ""
},
{
"docid": "7d33a0d452c3ea0b08c10cb1d4daef9b",
"score": "0.5833105",
"text": "def set_timezone(timezone); end",
"title": ""
},
{
"docid": "7d33a0d452c3ea0b08c10cb1d4daef9b",
"score": "0.5833105",
"text": "def set_timezone(timezone); end",
"title": ""
},
{
"docid": "911313144aab860bdda90503709af1cd",
"score": "0.58196545",
"text": "def display_timezone(user, conference)\n return conference.timezone unless user\n\n user.timezone.presence || conference.timezone\n end",
"title": ""
},
{
"docid": "c413757a360b536a27a798757a463b35",
"score": "0.58164006",
"text": "def ls_tz; end",
"title": ""
},
{
"docid": "9a7d92061f9b31ddddbed9b5dd579451",
"score": "0.58124906",
"text": "def timezone\n ENV[\"TZ\"]\n end",
"title": ""
},
{
"docid": "726f52ad821f12f5b9172c78f0e11165",
"score": "0.5786819",
"text": "def set_timezone\n offset = [ Time.now.beginning_of_year.utc_offset, Time.now.beginning_of_year.change(:month => 7).utc_offset ].min\n offset *= 3600 if offset.abs < 13\n Time.zone = ActiveSupport::TimeZone.all.select { |zone| zone.utc_offset == offset }.first\nend",
"title": ""
},
{
"docid": "6556506b90ca98fa8986757c6146a035",
"score": "0.57859373",
"text": "def set_timezone\n @timezone = Timezone.find(params[:id])\n end",
"title": ""
},
{
"docid": "7c972d2e4eae8e07b7cbebc583cd6e56",
"score": "0.57820237",
"text": "def time_zone=(_arg0); end",
"title": ""
},
{
"docid": "f2979d3e7b8f10a27f683db6f79d6a72",
"score": "0.577207",
"text": "def set_time_zone\n user = not_fake_student_user\n if user && !user.time_zone.blank?\n Time.zone = user.time_zone\n if Time.zone && Time.zone.name == \"UTC\" && user.time_zone && user.time_zone.name.match(/\\s/)\n Time.zone = user.time_zone.name.split(/\\s/)[1..-1].join(\" \") rescue nil\n end\n else\n Time.zone = @domain_root_account && @domain_root_account.default_time_zone\n end\n end",
"title": ""
},
{
"docid": "135d85ce4bdec584e77d528e1ee7d45b",
"score": "0.57473147",
"text": "def default_timezone=(default_timezone); end",
"title": ""
},
{
"docid": "712d670c0872444334eb0700e7cd0528",
"score": "0.57411206",
"text": "def init_time_zone\n if session[:time_zone_name]\n @time_zone = ActiveSupport::TimeZone[session[:time_zone_name]]\n Time.zone = @time_zone.name if @time_zone\n end\n true\n end",
"title": ""
},
{
"docid": "47a050bfb6c3ba70d1e8778a301569b7",
"score": "0.5733619",
"text": "def get_timezone(zone_identifier)\n TZInfo::Timezone.get(zone_identifier)\nend",
"title": ""
},
{
"docid": "cd62875b3f46208e1f6c0cc787046036",
"score": "0.5733281",
"text": "def in_time_zone(zone = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "cd62875b3f46208e1f6c0cc787046036",
"score": "0.5733281",
"text": "def in_time_zone(zone = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "58ddbc233f0ddb898c84e533ec3307b1",
"score": "0.573069",
"text": "def timezone_with_company_default\n timezone || company_timezone\n end",
"title": ""
},
{
"docid": "94200c00b825efe2c0c4670df532bb11",
"score": "0.5723149",
"text": "def process_run_at_time_for_tz(timezone)\n Time.zone = timezone\n time_in_zone = (Time.zone.now + 1.day).beginning_of_day + 6.hours\n Rails.logger.info \"Time in zone - \" + time_in_zone.to_s\n time_to_run = time_in_zone.utc\n end",
"title": ""
},
{
"docid": "49c085e48b0957ad523032b642abfda9",
"score": "0.5716505",
"text": "def zone_default; end",
"title": ""
},
{
"docid": "49c085e48b0957ad523032b642abfda9",
"score": "0.5716505",
"text": "def zone_default; end",
"title": ""
},
{
"docid": "5edd9ea35be72780e245221a5e110c6d",
"score": "0.5713562",
"text": "def load!\n init_zones\n parse File.read( @file ) if file.length > 0\n end",
"title": ""
},
{
"docid": "e8efe78d9bac9b6545d9e54d23cf8c64",
"score": "0.57133305",
"text": "def default_time_zone\n tz = read_attribute('default_time_zone')\n ActiveSupport::TimeZone.new(tz) if tz\n end",
"title": ""
},
{
"docid": "ac5ba13eddd4e1f73d08f1cb1ef5c551",
"score": "0.5689889",
"text": "def timezone_definer_class\n TimezoneDefiner\n end",
"title": ""
},
{
"docid": "334cc1f87593845f116ee9de5ca6d226",
"score": "0.5685546",
"text": "def find_zoneinfo_dir; end",
"title": ""
},
{
"docid": "4d4a150913ff1953523496a8be18c050",
"score": "0.5671927",
"text": "def us_zones; end",
"title": ""
},
{
"docid": "4d4a150913ff1953523496a8be18c050",
"score": "0.5671927",
"text": "def us_zones; end",
"title": ""
},
{
"docid": "4d4a150913ff1953523496a8be18c050",
"score": "0.5671927",
"text": "def us_zones; end",
"title": ""
},
{
"docid": "4d4a150913ff1953523496a8be18c050",
"score": "0.5671927",
"text": "def us_zones; end",
"title": ""
},
{
"docid": "e87342ad580e19cee902595a00bafe98",
"score": "0.56674755",
"text": "def time_zone\n fetch('address.time_zone')\n end",
"title": ""
},
{
"docid": "a4b4608f47a555905aae921dfc59d694",
"score": "0.5660766",
"text": "def use_users_timezone\n timezone = Time.find_zone(cookies[:timezone]) or Time.zone\n Time.use_zone(timezone) { yield }\n end",
"title": ""
},
{
"docid": "321a31eaa53b6b9e49c0f21ce96c6034",
"score": "0.5659335",
"text": "def test_seed_timezone\n data = {}\n data[:name] = 'Brian King'\n data[:external_key] = 'brianking'\n data[:email] = 'brianking@kb.com'\n data[:currency] = 'GBP'\n data[:time_zone] = 'Europe/London'\n data[:address1] = '5 Downing street'\n data[:address2] = nil\n data[:postal_code] = 'E11 8QS'\n data[:company] = nil\n data[:city] = 'London'\n data[:state] = 'Greater London'\n data[:country] = 'England'\n data[:locale] = 'en_GB'\n @brianking = create_account_with_data(@user, data, @options)\n add_payment_method(@brianking.account_id, '__EXTERNAL_PAYMENT__', true, nil, @user, @options)\n\n data = {}\n data[:name] = 'John Silver'\n data[:external_key] = 'johnsilver'\n data[:email] = 'johnsilver@kb.com'\n data[:currency] = 'USD'\n data[:time_zone] = 'Pacific/Samoa'\n data[:address1] = '1234, Alabama street'\n data[:address2] = nil\n data[:postal_code] = '66799'\n data[:company] = nil\n data[:city] = 'Pago Pago'\n data[:state] = 'Pago Pago'\n data[:country] = 'USA'\n data[:locale] = 'en_US'\n @johnsilver = create_account_with_data(@user, data, @options)\n add_payment_method(@johnsilver.account_id, '__EXTERNAL_PAYMENT__', true, nil, @user, @options)\n\n data = {}\n data[:name] = 'Paul Dupond'\n data[:external_key] = 'pauldupond'\n data[:email] = 'pauldupond@kb.com'\n data[:currency] = 'EUR'\n data[:time_zone] = 'Europe/Paris'\n data[:address1] = '5, rue des ecoles'\n data[:address2] = nil\n data[:postal_code] = '25000'\n data[:company] = nil\n data[:city] = 'Besancon'\n data[:state] = 'Franche Comte'\n data[:country] = 'France'\n data[:locale] = 'fr_FR'\n @pauldupond = create_account_with_data(@user, data, @options)\n add_payment_method(@pauldupond.account_id, '__EXTERNAL_PAYMENT__', true, nil, @user, @options)\n\n data = {}\n data[:name] = 'Yokuri Matsumoto'\n data[:external_key] = 'yokurimatsumoto'\n data[:email] = 'yokurimatsumoto@kb.com'\n data[:currency] = 'JPY'\n data[:time_zone] = 'Asia/Tokyo'\n data[:address1] = 'block 5'\n data[:address2] = nil\n data[:postal_code] = '25000'\n data[:company] = nil\n data[:city] = 'Tokyo'\n data[:state] = 'Kanto Region'\n data[:country] = 'Japan'\n data[:locale] = 'ja_JP'\n @yokurimatsumoto = create_account_with_data(@user, data, @options)\n add_payment_method(@yokurimatsumoto.account_id, '__EXTERNAL_PAYMENT__', true, nil, @user, @options)\n\n pbs = []\n pbs << create_entitlement_base(@brianking.account_id, 'reserved-metal', 'MONTHLY', 'DEFAULT', @user, @options)\n\n pbs << create_entitlement_base(@johnsilver.account_id, 'reserved-metal', 'MONTHLY', 'DEFAULT', @user, @options)\n\n pbs << create_entitlement_base(@pauldupond.account_id, 'reserved-metal', 'MONTHLY', 'DEFAULT', @user, @options)\n\n pbs << create_entitlement_base(@yokurimatsumoto.account_id, 'reserved-metal', 'MONTHLY', 'DEFAULT', @user, @options)\n\n kb_clock_add_days(31, nil, @options)\n\n # Cancel all plans so we stop invoicing those accounts in the future\n pbs.each do |bp|\n bp.cancel(@user, nil, nil, nil, 'IMMEDIATE', 'END_OF_TERM', nil, @options)\n end\n end",
"title": ""
},
{
"docid": "22806ded0fdde0f5e64f37d420818ea9",
"score": "0.5658578",
"text": "def debian_tz; end",
"title": ""
},
{
"docid": "9ac9db1a8a119ea64f37f76f7d4c16a0",
"score": "0.56572366",
"text": "def set_time_zone\n # case current_user.timezone || current_company.timezone\n # when current_user.timezone\n # Time.zone = current_user.timezone\n # when current_company.timezone\n # Time.zone = current_company.timezone\n # else\n # Time.zone = \"Mumbai\"\n # end\n end",
"title": ""
},
{
"docid": "5f33a23ea6a365662410d0e7e269d1ab",
"score": "0.5649987",
"text": "def timezone_contains(timezone_str)\n @commands << \"grep #{timezone_str} /etc/timezone\"\n end",
"title": ""
},
{
"docid": "3b35a91400782489bc4c3f012655b836",
"score": "0.56497407",
"text": "def has_local_timezone?\n tzid && tzid.upcase != \"UTC\"\n end",
"title": ""
},
{
"docid": "4e9aa29dd204573ac6e1293e44b918f4",
"score": "0.564896",
"text": "def tz_timezone ; @venue.tz_timezone; end",
"title": ""
},
{
"docid": "b479ad14a93e3ad26a000c92904c380c",
"score": "0.56425136",
"text": "def timezone\n data[:timezone]\n end",
"title": ""
},
{
"docid": "b75ea46a18e3f58dfdf77189ce77dee3",
"score": "0.563963",
"text": "def certain_timezone_at(lng: 0.0, lat: 0.0)\n if lng > 180.0 or lng < -180.0 or lat > 90.0 or lat < -90.0\n raise ::TimezoneFinder::CoordinatesOutOfBoundsError.new(lng, lat)\n end\n\n possible_polygons = shortcuts_of(lng, lat)\n\n # x = longitude y = latitude both converted to 8byte int\n x = Helpers.coord2int(lng)\n y = Helpers.coord2int(lat)\n\n possible_polygons.each do |polygon_nr|\n # get boundaries\n @binary_file.seek((@bound_start_address + 16 * polygon_nr))\n boundaries = Helpers.fromfile(@binary_file, false, 4, 4)\n unless x > boundaries[0] or x < boundaries[1] or y > boundaries[2] or y < boundaries[3]\n\n outside_all_holes = true\n # when the point is within a hole of the polygon this timezone doesn't need to be checked\n _holes_of_line(polygon_nr) do |hole_coordinates|\n if Helpers.inside_polygon(x, y, hole_coordinates)\n outside_all_holes = false\n break\n end\n end\n\n if outside_all_holes\n if Helpers.inside_polygon(x, y, coords_of(polygon_nr))\n return TIMEZONE_NAMES[id_of(polygon_nr)]\n end\n end\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "19e1e6e3b469be2fa8915eb2a00fcff5",
"score": "0.56319547",
"text": "def event_timezone\n return TZInfo::Timezone.get(self.timezone) if self.timezone.present?\n return TZInfo::Timezone.get(\"UTC\") \n end",
"title": ""
},
{
"docid": "df42f82b2ead9ba629fd2450708e2dc2",
"score": "0.56272656",
"text": "def for(territory) = Timezone.new(self, territory, @config)",
"title": ""
},
{
"docid": "ed9642de1a645f4d0b046d7107a63c04",
"score": "0.5623415",
"text": "def set_time_zone\n Time.zone = self.current_user.time_zone if logged_in?\n Chronic.time_class = Time.zone\n end",
"title": ""
},
{
"docid": "27b57972fb3c565e16deb63d917bc425",
"score": "0.5619815",
"text": "def time_zone; end",
"title": ""
},
{
"docid": "27b57972fb3c565e16deb63d917bc425",
"score": "0.5619815",
"text": "def time_zone; end",
"title": ""
},
{
"docid": "27b57972fb3c565e16deb63d917bc425",
"score": "0.5619815",
"text": "def time_zone; end",
"title": ""
},
{
"docid": "2a71dd4cab7d38000316c5deafd1f622",
"score": "0.56108946",
"text": "def timezone()\n if @hash\n @hash[:TZID]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "7d2bc562acf8df2de4166194ccf99db4",
"score": "0.56060046",
"text": "def collect_preferred_time_zones_for_time_zone_select\n ::ActiveSupport::TimeZone.us_zones + [::ActiveSupport::TimeZone['Berlin']]\n end",
"title": ""
},
{
"docid": "b4578b6244bcc70ddb3dad8b51a3810e",
"score": "0.5605598",
"text": "def get_timezone\n @timezone ||= Time.now.getlocal.zone\n end",
"title": ""
},
{
"docid": "65af3c14831f7ad5d67271fc4de24628",
"score": "0.56039447",
"text": "def time_zone\n select_all(\"SHOW timezone\").first[\"TimeZone\"]\n end",
"title": ""
}
] |
cbbdad0ba2b2853c53c4cb98531e7665
|
Create a job to check the disk quota on a gear INPUTS: gear: a Gear object RETURNS: a RemoteJob object NOTES: uses RemoteJob
|
[
{
"docid": "c790585d8f845822b15723d14c99ce09",
"score": "0.75603455",
"text": "def get_show_gear_quota_job(gear)\n args = Hash.new\n args['--uuid'] = gear.uuid\n job = RemoteJob.new('openshift-origin-node', 'get-quota', args)\n job\n end",
"title": ""
}
] |
[
{
"docid": "047e8509b30fc6ac25f6cd5c274dd982",
"score": "0.7133455",
"text": "def get_update_gear_quota_job(gear, storage_in_gb, inodes)\n args = Hash.new\n args['--uuid'] = gear.uuid\n # quota command acts on 1K blocks\n args['--blocks'] = Integer(storage_in_gb * 1024 * 1024)\n args['--inodes'] = inodes unless inodes.to_s.empty?\n job = RemoteJob.new('openshift-origin-node', 'set-quota', args)\n job\n end",
"title": ""
},
{
"docid": "e5b66c35f8a6072a7186fe56d93450ff",
"score": "0.64547557",
"text": "def get_quota(gear)\n args = Hash.new\n args['--uuid'] = gear.uuid\n reply = execute_direct(@@C_CONTROLLER, 'get-quota', args, false)\n\n output = nil\n exitcode = 0\n if reply and reply.length > 0\n mcoll_result = reply[0]\n if (mcoll_result && (defined? mcoll_result.results) && !mcoll_result.results[:data].nil?)\n output = mcoll_result.results[:data][:output]\n exitcode = mcoll_result.results[:data][:exitcode]\n raise OpenShift::NodeException.new(\"Failed to get quota for user: #{output}\", 143) unless exitcode == 0\n else\n raise OpenShift::NodeException.new(\"Node execution failure (error getting result from node).\", 143)\n end\n else\n raise OpenShift::NodeException.new(\"Node execution failure (error getting result from node).\", 143)\n end\n output\n end",
"title": ""
},
{
"docid": "87cf2d9a7c7058dcc095e5f8cf10c2ca",
"score": "0.58209",
"text": "def set_quota(gear, storage_in_gb, inodes)\n args = Hash.new\n args['--uuid'] = gear.uuid\n # quota command acts on 1K blocks\n args['--blocks'] = Integer(storage_in_gb * 1024 * 1024)\n args['--inodes'] = inodes unless inodes.nil?\n reply = execute_direct(@@C_CONTROLLER, 'set-quota', args, false)\n\n output = nil\n exitcode = 0\n if reply and reply.length > 0\n mcoll_result = reply[0]\n if (mcoll_result && (defined? mcoll_result.results) && !mcoll_result.results[:data].nil?)\n output = mcoll_result.results[:data][:output]\n exitcode = mcoll_result.results[:data][:exitcode]\n raise OpenShift::NodeException.new(\"Failed to set quota for user: #{output}\", 143) unless exitcode == 0\n else\n raise OpenShift::NodeException.new(\"Node execution failure (error getting result from node).\", 143)\n end\n else\n raise OpenShift::NodeException.new(\"Node execution failure (error getting result from node).\", 143)\n end\n end",
"title": ""
},
{
"docid": "8b18c30964d8a85951cf2af1b20a566d",
"score": "0.55312854",
"text": "def quota_check(home, quotasize, ssh)\n $stdout.puts \"Performing quota check on #{home}\\n\\n\" if $VERBOSE\n qs_check = ssh.exec!(\"isi quota ls --path=#{home} | awk '{ print $4 }' | grep -c ^#{quotasize}\")\n if qs_check.to_i == 1\n $stdout.puts \"Quota check was successful\\n\\n\" if $VERBOSE\n else\n raise StandardError.new(\"Quota check failed for #{home}\\n\\n\")\n end\n end",
"title": ""
},
{
"docid": "192fc2b46b8f85bcf9f1d818c0d06870",
"score": "0.52977324",
"text": "def create(gear, quota_blocks=nil, quota_files=nil, sshkey_required=false, initial_deployment_dir_required=true)\n app = gear.application\n result = nil\n (1..10).each do |i|\n args = build_base_gear_args(gear, quota_blocks, quota_files, sshkey_required)\n\n # set the secret token for new gear creations\n # log an error if the application does not have its secret_token set\n if app.secret_token.present?\n args['--with-secret-token'] = app.secret_token\n else\n Rails.logger.error \"The application #{app.name} (#{app._id.to_s}) does not have its secret token set\"\n end\n\n args['--with-initial-deployment-dir'] = initial_deployment_dir_required\n\n mcoll_reply = execute_direct(@@C_CONTROLLER, 'app-create', args)\n\n begin\n result = parse_result(mcoll_reply, gear)\n rescue OpenShift::OOException => ooex\n # destroy the gear in case of failures\n # the UID will be unreserved up as part of rollback\n destroy(gear, true)\n\n # raise the exception if this is the last retry\n raise ooex if i == 10\n\n result = ooex.resultIO\n if result != nil && result.exitcode == 129 && has_uid_or_gid?(gear.uid) # Code to indicate uid already taken\n gear.uid = reserve_uid\n app.save!\n else\n raise ooex\n end\n else\n break\n end\n end\n result\n end",
"title": ""
},
{
"docid": "27ade4359136a6aa47d934810036c19d",
"score": "0.52530026",
"text": "def check_quota\n quota = vapi.get_quota\n free = quota[\"user\"][\"upload_space\"][\"free\"].to_i\n Rails.logger.debug \"quota: #{quota} free: #{free} size: #{size}\"\n raise UploadError.new, \"file size exceeds quota. required: #{size}, free: #{free}\" if size > free\n end",
"title": ""
},
{
"docid": "6ac6b8233239d6b43869ee96aca87fec",
"score": "0.52448595",
"text": "def get_status_job(gear, component)\n args = build_base_gear_args(gear)\n job = RemoteJob.new(component.cartridge_name, 'status', args)\n job\n end",
"title": ""
},
{
"docid": "4f80a1d7f08a786bff4bb2fe89ab2798",
"score": "0.51066345",
"text": "def reserve_job! to=10\n begin qjob = job_queue.reserve(to)\n rescue Beanstalk::TimedOut => e ; Log.info e.to_s ; sleep 0.4 ; return ;\n rescue StandardError => e ; Log.warn e.to_s ; sleep 1 ; return ; end\n qjob\n end",
"title": ""
},
{
"docid": "462279dfec457871078b6817193e5bba",
"score": "0.5043307",
"text": "def check_quota\n quota = vimeo.get_quota\n free = quota[\"user\"][\"upload_space\"][\"free\"].to_i\n\n raise UploadError.new, \"file size exceeds quota. required: #{size}, free: #{free}\" if size > free\n end",
"title": ""
},
{
"docid": "d2b744a80f3053f7b405d4cd1c5b52f0",
"score": "0.5013406",
"text": "def disk_space_allocation_exceeded(host_name)\n `curl -s -i -L \\\n -u #{Conn[:creds]} \\\n -H 'content-type:application/json' \\\n #{[Conn[:host_api], 'nodes', host_name].join('/')} | jq '.disk_free_limit<.disk_free*.8'`\n end",
"title": ""
},
{
"docid": "d10bf44c3920eaa460e1946bdda5f02a",
"score": "0.49740872",
"text": "def check_required_quota\n if @json.key?(KEYS[:user_variables])\n user_variables = @json[KEYS[:user_variables]]\n keys = user_variables.keys\n\n keys.each do |key|\n if user_variables[key][KEYS[:type]] == 'enum' && Configs::Blueprint::CONTAINER_SIZES.include?(user_variables[key][KEYS[:default]])\n @required_ram += (VagrantSubutai::Configs::Quota::RESOURCE[(user_variables[key][KEYS[:default]]).strip.to_sym][:RAM])\n @required_disk += (VagrantSubutai::Configs::Quota::RESOURCE[(user_variables[key][KEYS[:default]]).strip.to_sym][:DISK])\n end\n end\n\n @required_ram += VagrantSubutai::Configs::Quota::RESOURCE[:TINY][:RAM] if @json.key?(KEYS[:ansible_configuration]) # default ansible container ram\n @required_disk += VagrantSubutai::Configs::Quota::RESOURCE[:TINY][:DISK] if @json.key?(KEYS[:ansible_configuration]) # default ansible container disk\n else\n @json[KEYS[:containers]].each do |container|\n @required_ram += (VagrantSubutai::Configs::Quota::RESOURCE[(container[KEYS[:size]]).to_sym][:RAM])\n @required_disk += (VagrantSubutai::Configs::Quota::RESOURCE[(container[KEYS[:size]]).to_sym][:DISK])\n end\n end\n end",
"title": ""
},
{
"docid": "d1b9e58d8081291441d8c447b1259f95",
"score": "0.49234712",
"text": "def reserve_job(conn, reserve_timeout = Backburner.configuration.reserve_timeout)\n Backburner::Job.new(conn.tubes.reserve(reserve_timeout))\n end",
"title": ""
},
{
"docid": "7d4c22613498247907a3672d5619a4af",
"score": "0.49131563",
"text": "def get_send_quota\n request({\n 'Action' => 'GetSendQuota',\n :parser => Fog::Parsers::AWS::SES::GetSendQuota.new\n })\n end",
"title": ""
},
{
"docid": "b2fb733ef109f82857385650380e6752",
"score": "0.48837662",
"text": "def quota_exists(username, ssh)\n q_check = ssh.exec!(\"isi quota ls\")\n q_check = true if q_check =~ /\\b#{username}\\b/\n\n return q_check\n end",
"title": ""
},
{
"docid": "9dcab9a8257fb58a2be97d29f66dd96b",
"score": "0.48390618",
"text": "def reserve_and_run_one_job; end",
"title": ""
},
{
"docid": "d4d12635c0774009ed5600a8af30d494",
"score": "0.47824192",
"text": "def percent_of_queued_jobs_requesting_gpus(available_jobs)\n ((0.15).to_f) * 100\n #(queued_jobs_requesting_gpus.to_f / available_jobs) * 100\n end",
"title": ""
},
{
"docid": "6a3e9ebbe3399e48abe6a1f2a3d09c37",
"score": "0.47714198",
"text": "def get_update_proxy_status_job(gear, options)\n args = build_base_gear_args(gear)\n #TODO support specifying the proxy component/cart?\n #args = build_base_component_args(proxy_component, args)\n args['--action'] = options[:action]\n args['--gear_uuid'] = options[:gear_uuid]\n args['--persist'] = options[:persist]\n RemoteJob.new(@@C_CONTROLLER, 'update-proxy-status', args)\n end",
"title": ""
},
{
"docid": "29767eb28771e9f59cc29c60ab583a57",
"score": "0.47587472",
"text": "def run\n drives = execute_wmi_query(\"Select deviceid, freespace, size from win32_logicaldisk\")\n for drive in drives do\n if drive.deviceid =~ /^(\\w):$/\n drive_letter = $1\n free_space_val = drive.freespace\n drive_size_val = drive.size\n if is_number?(free_space_val) && is_number?(drive_size_val)\n used_space = drive_size_val.to_i - free_space_val.to_i\n @logger.debug(\"Drive #{drive_letter}: has #{free_space_val} free and #{used_space} used space\")\n gauge('df', '', 'df', \"drive_#{drive_letter}\", [ used_space, free_space_val.to_i ])\n end\n end\n end\nend",
"title": ""
},
{
"docid": "4ae700cf83486be065722a8035416478",
"score": "0.47191662",
"text": "def available_space\n quota - size\n end",
"title": ""
},
{
"docid": "e61254cbc99e6991e305d9ffb404416e",
"score": "0.47143787",
"text": "def restore_and_grow(server,new_size,force)\n options = { \"EBS_MOUNT_POINT\" => \"text:#{@mount_point}\",\n \"EBS_TOTAL_VOLUME_GROUP_SIZE\" => \"text:#{new_size}\",\n \"OPT_DB_FORCE_RESTORE\" => \"text:#{force}\",\n \"EBS_LINEAGE\" => \"text:#{@lineage}\" }\n audit = server.run_executable(@scripts_to_run['grow_volume'], options)\n audit.wait_for_completed\n end",
"title": ""
},
{
"docid": "18113f60d44359f5b478e66568e5baf4",
"score": "0.46891427",
"text": "def configure_retries bucket_name: nil, file_name: nil\n # The ID of your GCS bucket\n # bucket_name = \"your-unique-bucket-name\"\n\n # The ID of your GCS object\n # file_name = \"your-file-name\"\n\n require \"google/cloud/storage\"\n\n # Creates a client\n storage = Google::Cloud::Storage.new(\n\n # The maximum number of automatic retries attempted before returning\n # the error.\n #\n # Customize retry configuration with the maximum retry attempt of 5.\n retries: 5,\n\n # The total time in seconds that requests are allowed to keep being retried.\n # After max_elapsed_time, an error will be returned regardless of any\n # retry attempts made during this time period.\n #\n # Customize retry configuration with maximum elapsed time of 500 seconds.\n max_elapsed_time: 500,\n\n # The initial interval between the completion of failed requests, and the\n # initiation of the subsequent retrying request.\n #\n # Customize retry configuration with an initial interval of 1.5 seconds.\n base_interval: 1.5,\n\n # The maximum interval between requests. When this value is reached,\n # multiplier will no longer be used to increase the interval.\n #\n # Customize retry configuration with maximum interval of 45.0 seconds.\n max_interval: 45,\n\n # The multiplier by which to increase the interval between the completion\n # of failed requests, and the initiation of the subsequent retrying request.\n #\n # Customize retry configuration with an interval multiplier per iteration of 1.2.\n multiplier: 1.2\n )\n\n # Uses the retry configuration set during the client initialization above with 5 retries\n file = storage.service.get_file bucket_name, file_name\n\n # Maximum retry attempt can be overridden for each operation using options parameter.\n storage.service.delete_file bucket_name, file_name, options: { retries: 4 }\n puts \"File #{file.name} deleted with a customized retry strategy.\"\nend",
"title": ""
},
{
"docid": "4349f7bc21948c0f6f5d540680fc9f07",
"score": "0.46887538",
"text": "def ReservedSpace(part)\n part = deep_copy(part)\n # read the percentage\n option = Ops.get_string(\n part,\n [\"fs_options\", \"opt_reserved_blocks\", \"option_value\"],\n \"\"\n )\n ret = 0\n\n if option != nil && option != \"\"\n percent = Builtins.tofloat(option)\n\n if Ops.greater_than(percent, 0.0)\n # convert to absolute value\n fs_size = Ops.get_integer(part, \"size_k\", 0)\n ret = Builtins.tointeger(\n Ops.multiply(\n Convert.convert(\n Ops.divide(fs_size, 100),\n :from => \"integer\",\n :to => \"float\"\n ),\n percent\n )\n )\n end\n end\n\n if Ops.greater_than(ret, 0)\n Builtins.y2milestone(\n \"Partition %1: reserved space: %2%% (%3kB)\",\n Ops.get_string(part, \"name\", \"\"),\n option,\n ret\n )\n end\n\n Ops.multiply(ret, 1024)\n end",
"title": ""
},
{
"docid": "fbab45ba205d08423e531cfc63954c7c",
"score": "0.46852088",
"text": "def make_limit_task(channel)\n limit_timestamp = \"#{$carddir}/#{channel}/.limits_computed\"\n file limit_timestamp => \"#{$carddir}/#{channel}/.creation_timestamp\" do |t|\n sh \"compute_limits.sh #{$carddir}/#{channel} 10 #{$blind}\"\n end\n return limit_timestamp\nend",
"title": ""
},
{
"docid": "31e423871714a88f46a121b8832dcb2c",
"score": "0.46778885",
"text": "def check_storage(email_to)\n Helpers::log(\"checking storage information..\")\n df = ssh_df_inst\n if df.nil?\n Helpers::log(\"The storage information for #{hostname} cannot be accessed\")\n else\n percentage = df.split(\":\")[2].to_i\n if percentage >= STORAGE_THRESHOLD\n hostname = ssh_hostname\n Helpers::log(\"#{hostname} has exceeded the storage threshold: \" + \n \"#{STORAGE_THRESHOLD}%.\")\n if !email_to.nil?\n msg = \"#{hostname} is currently at #{percentage}%.\\n\" +\n \"It is over the #{STORAGE_THRESHOLD}% threshold.\\n\"\n Emailer::send_email(EMAIL_FROM, email_to,\n \"Time to clean up #{hostname}\", msg)\n end\n end\n df\n end\n end",
"title": ""
},
{
"docid": "639d01c000f1ba1374f85cfe80023faf",
"score": "0.46715754",
"text": "def disk_file_upload\n @bucket_size = 0\n \t@bucket_files = BucketFile.new\n \t@current_disk_id = params[:disk_id]\n \t@bucket_name = params[:name]\n puts \"=================\"\n puts @bucket_name\n puts \"+++++++++++++++\"\n \tconnection = Fog::Storage.new({ :provider => 'AWS', :aws_access_key_id => \"AKIAIAL3W5DIRE2IUQLQ\", :aws_secret_access_key => \"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\"})\n directory = connection.directories.get(\"#{params[:name]}\")\n @files = directory.files\n end",
"title": ""
},
{
"docid": "b9aea0f656188db70c33273df2a402fd",
"score": "0.4653803",
"text": "def get_quota\n\t\t\t@storage.fetch(:limit).to_i\n\t\tend",
"title": ""
},
{
"docid": "9f3549e24c931b917d072d6ddbe55ebd",
"score": "0.46521607",
"text": "def check_google\n uploaded_io = params[:file]\n if uploaded_io.respond_to?(:original_filename)\n # Store the uploaded file in an S3 bucket.\n config = ::Configuration.instance\n client = Aws::S3::Client.new\n s3 = Aws::S3::Resource.new(client: client)\n key = sprintf('google_inventory_%d.txt', Time.now.to_i)\n obj = s3.bucket(config.temp_bucket).object(key)\n obj.put(body: uploaded_io)\n\n task = Task.create!(name: 'Preparing to check Google',\n service: Service::GOOGLE,\n status: Task::Status::SUBMITTED)\n Google.new(key).check_async(task)\n flash['success'] = 'Google check will begin momentarily.'\n else\n flash['error'] = 'No file provided.'\n end\n rescue => e\n handle_error(e)\n ensure\n redirect_back fallback_location: tasks_path\n end",
"title": ""
},
{
"docid": "a0d7a359245fa1f8340937499d9f7f2e",
"score": "0.46473733",
"text": "def get()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('householdquota', 'get', 'KalturaHouseholdQuota', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend",
"title": ""
},
{
"docid": "8c246057c34daddfe41e872c1ade1ed5",
"score": "0.4640119",
"text": "def get_cart_status(gear, component)\n app = gear.application\n source_container = gear.get_proxy\n leave_stopped = false\n idle = false\n quota_blocks = nil\n quota_files = nil\n log_debug \"DEBUG: Getting existing app '#{app.name}' status before moving\"\n do_with_retry('status') do\n result = source_container.status(gear, component)\n result.properties[\"attributes\"][gear.uuid].each do |key, value|\n if key == 'status'\n case value\n when \"ALREADY_STOPPED\"\n leave_stopped = true\n when \"ALREADY_IDLED\"\n leave_stopped = true\n idle = true\n end\n elsif key == 'quota_blocks'\n quota_blocks = value\n elsif key == 'quota_files'\n quota_files = value\n end\n end\n end\n\n cart_name = component.cartridge_name\n if idle\n log_debug \"DEBUG: Gear component '#{cart_name}' was idle\"\n elsif leave_stopped\n log_debug \"DEBUG: Gear component '#{cart_name}' was stopped\"\n else\n log_debug \"DEBUG: Gear component '#{cart_name}' was running\"\n end\n\n return [idle, leave_stopped, quota_blocks, quota_files]\n end",
"title": ""
},
{
"docid": "07cd007a27e5062d1aedbaf66eeebf82",
"score": "0.46090212",
"text": "def reserve\n db.transaction do\n if job = waiting.order(:id).last # asc\n job[:started_working_at] = Time.now\n update_job!(job)\n payload = job[:payload].nil? ? nil : Marshal.load(job[:payload])\n EQ::Job.new(job[:id], job[:queue], payload)\n end\n end\n rescue ::Sequel::DatabaseError => e\n retry if on_error e\n end",
"title": ""
},
{
"docid": "f3519de1078c464dbfe0baf751e2d558",
"score": "0.4569391",
"text": "def get_download_quota\n @download_quota = self.class.get_download_quota\n end",
"title": ""
},
{
"docid": "8efe63d30679081a656a9f4012a364c9",
"score": "0.45562434",
"text": "def reserve_with_restriction\n @job_in_progress = reserve_without_restriction\n return @job_in_progress\n end",
"title": ""
},
{
"docid": "14d17e8ce4bf51027978889a059158b4",
"score": "0.4530114",
"text": "def rocket_job_class\n @rocket_job_class\n end",
"title": ""
},
{
"docid": "07d26a831fa3267d2bc3e9bc58351078",
"score": "0.45071945",
"text": "def disk_usage_exceeds?(max_percent)\n raise 'Percent must be between 1-100 (inclusive)' unless (1..100).member?(max_percent)\n OpenShift::Runtime::Node.check_quotas(@uuid, max_percent).length != 0\n end",
"title": ""
},
{
"docid": "8083cd4b0352e94f93465d50358edf5c",
"score": "0.45047912",
"text": "def make_limit_task(channel)\n limit_timestamp = \"#{$carddir}/#{channel}/.limits_computed\"\n carddir = $carddir #makes a copy so that if $cardir changes this does not\n file limit_timestamp => \"#{$carddir}/#{channel}/.creation_timestamp\" do |t|\n chdir(\"#{carddir}/#{channel}\") do\n sh \"ls -d [0-9]* | xargs -n 1 -P 10 -I {} compute_significance.sh {} #{$blind}\"\n end\n sh \"compute_limits.sh #{carddir}/#{channel} 10 #{$blind}\"\n end\n return limit_timestamp\nend",
"title": ""
},
{
"docid": "6165b160eb8019cfab42169fa0971953",
"score": "0.45038313",
"text": "def return_quota\n returned_sheets / (course_profs.size * students).to_f\n end",
"title": ""
},
{
"docid": "705bf6590717760a1d9f3351b321a011",
"score": "0.45033395",
"text": "def make_json_limit_task(channel)\n json_stamp = \"#{$carddir}/#{channel}/.limit_harvested\"\n file json_stamp => \"#{$carddir}/#{channel}/.limits_computed\" do |t|\n sh \"harvest_limits.py #{$carddir}/#{channel}\"\n sh \"touch #{t.name}\"\n end\n return json_stamp\nend",
"title": ""
},
{
"docid": "59f9f980a84b34f6fb00bdc0096954ec",
"score": "0.45030475",
"text": "def create_gear(cli = false)\n gear = OpenShift::TestGear.new(self)\n gear.create(cli)\n @gears << gear\n gear\n end",
"title": ""
},
{
"docid": "986524f45c4c5a310b6c81fcbbe7bd7e",
"score": "0.45030236",
"text": "def get_cars\n CarWorker.new.perform\n end",
"title": ""
},
{
"docid": "97980698e80261211a22c6ff14e775fa",
"score": "0.44892493",
"text": "def EvaluateFreeSpace(spare_percentage)\n partition = []\n # the sizes are in kB\n min_spare = 10 * 1024 # 10 MB\n max_spare = 1024 * 1024 # 1 GB\n\n target = Installation.destdir\n\n # get information about diskspace ( used/free space on every partition )\n partition = Convert.convert(\n SCR.Read(path(\".run.df\")),\n :from => \"any\",\n :to => \"list <map <string, string>>\"\n )\n\n # filter out headline and other invalid entries\n partition = Builtins.filter(partition) do |part|\n Builtins.substring(Ops.get(part, \"name\", \"\"), 0, 1) == \"/\"\n end\n\n if Installation.dirinstall_installing_into_dir\n target = GetDirMountPoint(Installation.dirinstall_target, partition)\n Builtins.y2milestone(\n \"Installing into a directory, target directory: %1, target mount point: %2\",\n Installation.dirinstall_target,\n target\n )\n end\n\n part_input = []\n\n Builtins.foreach(partition) do |part|\n part_info = {}\n free_size = 0\n spare_size = 0\n partName = \"\"\n add_part = true\n mountName = Ops.get_string(part, \"name\", \"\")\n spec = Ops.get_string(part, \"spec\", \"\")\n if Installation.dirinstall_installing_into_dir\n if Builtins.substring(mountName, 0, 1) != \"/\"\n mountName = Ops.add(\"/\", mountName)\n end\n\n dir_target = Installation.dirinstall_target\n\n Builtins.y2debug(\n \"mountName: %1, dir_target: %2\",\n mountName,\n dir_target\n )\n\n if Ops.greater_than(\n Builtins.size(mountName),\n Builtins.size(dir_target)\n ) &&\n Builtins.substring(mountName, 0, Builtins.size(dir_target)) == dir_target\n part_info = Builtins.add(part_info, \"name\", mountName)\n elsif mountName == target\n part_info = Builtins.add(part_info, \"name\", \"/\")\n else\n add_part = false\n end\n elsif target != \"/\"\n if Ops.greater_or_equal(\n Builtins.size(mountName),\n Builtins.size(target)\n ) &&\n Builtins.substring(mountName, 0, Builtins.size(target)) == target\n partName = Builtins.substring(mountName, Builtins.size(target))\n # nothing left, it was target root itself\n if Builtins.size(partName) == 0\n part_info = Builtins.add(part_info, \"name\", \"/\")\n else\n part_info = Builtins.add(part_info, \"name\", partName)\n end\n else\n add_part = false\n end # target is \"/\"\n else\n if mountName == \"/\"\n part_info = Builtins.add(part_info, \"name\", mountName)\n # ignore some mount points\n elsif mountName != Installation.sourcedir && mountName != \"/cdrom\" &&\n mountName != \"/dev/shm\" &&\n spec != \"udev\" &&\n !Builtins.regexpmatch(mountName, \"^/media/\") &&\n !Builtins.regexpmatch(mountName, \"^var/adm/mount/\")\n part_info = Builtins.add(part_info, \"name\", mountName)\n else\n add_part = false\n end\n end\n if add_part\n part_info = Builtins.add(\n part_info,\n \"used\",\n Builtins.tointeger(Ops.get_string(part, \"used\", \"0\"))\n )\n\n free_size = Builtins.tointeger(Ops.get_string(part, \"free\", \"0\"))\n spare_size = Ops.divide(\n Ops.multiply(free_size, spare_percentage),\n 100\n )\n\n if Ops.less_than(spare_size, min_spare)\n spare_size = min_spare\n elsif Ops.greater_than(spare_size, max_spare)\n spare_size = max_spare\n end\n\n free_size = Ops.subtract(free_size, spare_size)\n free_size = 0 if Ops.less_than(free_size, 0) # don't add a negative size\n\n part_info = Builtins.add(part_info, \"free\", free_size)\n\n part_input = Builtins.add(part_input, part_info)\n end\n end\n\n Builtins.y2milestone(\n \"UTILS *** EvaluateFreeSpace returns: %1\",\n part_input\n )\n\n Pkg.TargetInitDU(part_input)\n\n deep_copy(part_input)\n end",
"title": ""
},
{
"docid": "b6262f5a0a8e24c05515a48cceb18190",
"score": "0.44736567",
"text": "def reserve_with_limiter(queue)\n return nil if Resque.size(queue) == 0 # nothing in the queue\n\n rate_restricted = rate_limiter.is_restricted?(queue)\n concurrency_restricted = concurrency_limiter.is_restricted?(queue)\n\n # Call the original method and return if no restrictions applied to this queue\n return reserve_without_limiter(queue) unless rate_restricted || concurrency_restricted\n\n begin\n if concurrency_restricted\n # Try concurrency limit. Return if it's exceeded\n concurrency_limit_tx = concurrency_limiter.start_work(queue)\n return nil unless concurrency_limit_tx\n end\n\n if rate_restricted\n # Try to consume the reserved amount ...\n rate_limit_txs = rate_limiter.consume(queue, reserved_rates[queue] || 1)\n # ... return if we exceeded the limit - this is what it's all about\n return nil unless rate_limit_txs\n end\n\n job = reserve_without_limiter(queue)\n ensure\n if job\n # Tuck the transaction info onto the job\n job.rate_limit_txs = rate_limit_txs\n else\n # There was an error, or queue is empty - undo limiters\n rate_limiter.reimburse(rate_limit_txs, rate_limit_txs[0].amount) if rate_limit_txs\n concurrency_limiter.end_work(queue) if concurrency_limit_tx\n end\n end\n\n job\n end",
"title": ""
},
{
"docid": "4217a6fe0e4df1d4f1e1577383696002",
"score": "0.44671637",
"text": "def check_queue_size_hold\n `#{config[:path]} | /bin/egrep -c '^[0-9A-F]+!'`.to_i\n end",
"title": ""
},
{
"docid": "2d00d119ac6a03ec68fccfe58f1de885",
"score": "0.44628784",
"text": "def api_quota\n params = {\n REQUEST_PARAMS.email_address => self.email_address,\n REQUEST_PARAMS.api_key => self.api_key,\n REQUEST_PARAMS.action => ACTION.api_quota,\n }\n send_request(params)\n end",
"title": ""
},
{
"docid": "df85ae4752bc3d58e650decf2d6974e9",
"score": "0.44557926",
"text": "def createvolume\n if not checkRequirements([\"thezone\",\"thevolume\"])\n return false\n end\n checkToken(@thezone)\n req = {}\n req[\"name\"] = \"oe-#{@thevolume.name}\"\n req[\"description\"] = @thevolume.description\n req[\"sizeGb\"] = @thevolume.size\n submit = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/zones/#{@thevolume.azone.name}/disks', :method => 'post', :options => '', :data => req.to_json, :access_token => @thezone.toekn )\n d = checkQuery(:type => 'zone', :token => @thezone.token, :projectname => @thezone.name, :zonename => @thevolume.azone.name, :operationname => submit[\"name\"])\n data = queryGCE(:path => '/compute/v1beta15/projects/#{@thezone.name}/zones/#{@thevolume.azone.name}/disks/#{req[\"name\"]}', :method => 'get', :options => '', :access_token => @thezone.token) if d\n data ? data[\"name\"] : false\n end",
"title": ""
},
{
"docid": "a12702dcd36b434a4ca6bcc18e9f3f0b",
"score": "0.4455353",
"text": "def perform\n scan\n Delayed::Job.enqueue self, 0, Time.now.utc + 20.seconds # requeue for next time\n # todo: save the job id somewhere\n end",
"title": ""
},
{
"docid": "c2bff4469ffdb4798aa1d136450bd68a",
"score": "0.4443666",
"text": "def available_quota(redis, event_type, actor)\n keys = [namespaced_key(event_type), actor]\n argv = [Time.now.to_i, 1]\n\n available_quota = 1.0\n\n available_quota = redis.evalsha(sha1_digest, keys, argv).to_f\n rescue Redis::CommandError => e\n if e.to_s.include?('NOSCRIPT')\n load_script(redis)\n available_quota = redis.evalsha(sha1_digest, keys, argv).to_f\n elsif e.to_s.include?('No config found')\n raise ConfigNotDefinedError, e.to_s\n end\n ensure\n available_quota\n end",
"title": ""
},
{
"docid": "144cdf008911f1e914e09cdfe5622d5b",
"score": "0.44431838",
"text": "def enqueue_get_other_tasks_status_job\n\n BgJob.enqueue(\n ::RegisterBrandedToken::GetOtherTasksStatusJob,\n {\n parent_id: @parent_id\n },\n {\n wait: 30.seconds\n }\n )\n\n end",
"title": ""
},
{
"docid": "65f77980fcf0e533f9f1cd48b0a11400",
"score": "0.44393495",
"text": "def get_quota_blocks\n rpc_get_fact_direct('quota_blocks').to_i\n end",
"title": ""
},
{
"docid": "f0525c055f2cb93826d74640f794b9bc",
"score": "0.4431515",
"text": "def calculate_quotas(doc, where_filter, resource)\n\n oid = doc.root.at_xpath(\"ID\").text.to_i\n\n sys_used = 0\n\n @db.fetch(\"SELECT body FROM vm_pool WHERE #{where_filter} AND state<>6\") do |vm_row|\n vmdoc = nokogiri_doc(row[:body], 'vm_pool')\n\n vmdoc.root.xpath(\"TEMPLATE/DISK\").each { |e|\n type = \"\"\n\n e.xpath(\"TYPE\").each { |t_elem|\n type = t_elem.text.upcase\n }\n\n size = 0\n\n if !e.at_xpath(\"SIZE\").nil?\n size = e.at_xpath(\"SIZE\").text.to_i\n end\n\n if ( type == \"SWAP\" || type == \"FS\")\n sys_used += size\n else\n if !e.at_xpath(\"CLONE\").nil?\n clone = (e.at_xpath(\"CLONE\").text.upcase == \"YES\")\n\n target = nil\n\n if clone\n target = e.at_xpath(\"CLONE_TARGET\").text if !e.at_xpath(\"CLONE_TARGET\").nil?\n else\n target = e.at_xpath(\"LN_TARGET\").text if !e.at_xpath(\"LN_TARGET\").nil?\n end\n\n if !target.nil? && target != \"NONE\" # self or system\n sys_used += size\n\n if !e.at_xpath(\"DISK_SNAPSHOT_TOTAL_SIZE\").nil?\n sys_used += e.at_xpath(\"DISK_SNAPSHOT_TOTAL_SIZE\").text.to_i\n end\n end\n end\n end\n }\n end\n\n vm_elem = doc.root.at_xpath(\"VM_QUOTA/VM\")\n\n if !vm_elem.nil?\n vm_elem.at_xpath(\"VOLATILE_SIZE\").name = \"SYSTEM_DISK_SIZE\"\n vm_elem.at_xpath(\"VOLATILE_SIZE_USED\").name = \"SYSTEM_DISK_SIZE_USED\"\n else\n doc.root.xpath(\"VM_QUOTA\").each { |e| e.remove }\n\n vm_quota = doc.root.add_child(doc.create_element(\"VM_QUOTA\"))\n vm_elem = vm_quota.add_child(doc.create_element(\"VM\"))\n\n vm_elem.add_child(doc.create_element(\"CPU\")).content = \"-1\"\n vm_elem.add_child(doc.create_element(\"CPU_USED\")).content = \"0\"\n\n vm_elem.add_child(doc.create_element(\"MEMORY\")).content = \"-1\"\n vm_elem.add_child(doc.create_element(\"MEMORY_USED\")).content = \"0\"\n\n vm_elem.add_child(doc.create_element(\"VMS\")).content = \"-1\"\n vm_elem.add_child(doc.create_element(\"VMS_USED\")).content = \"0\"\n\n vm_elem.add_child(doc.create_element(\"SYSTEM_DISK_SIZE\")).content = \"-1\"\n vm_elem.add_child(doc.create_element(\"SYSTEM_DISK_SIZE_USED\")).content = \"0\"\n end\n\n vm_elem.xpath(\"SYSTEM_DISK_SIZE_USED\").each { |e|\n if e.text != sys_used.to_s\n #puts(\"#{resource} #{oid} quotas: SYSTEM_DISK_SIZE_USED has #{e.text} \\tis\\t#{sys_used}\")\n e.content = sys_used.to_s\n end\n }\n end",
"title": ""
},
{
"docid": "284ac3e70af671c574284474a3e6ac76",
"score": "0.44263852",
"text": "def disk(cfg)\n mountpoint = \"mountpoint=\\\"#{cfg['mount']}\\\"\"\n query = @client.percent_query_free(\n \"node_filesystem_size{#{mountpoint}}\",\n \"node_filesystem_avail{#{mountpoint}}\"\n )\n prepare_metrics('disk', @client.query(query))\n end",
"title": ""
},
{
"docid": "78b796ebaba7537185e2eeb9c8fe203f",
"score": "0.44165874",
"text": "def frontend_backup(gear)\n app = gear.application\n args = Hash.new\n args['--with-container-uuid']=gear.uuid\n args['--with-container-name']=gear.name\n args['--with-namespace']=app.domain_namespace\n result = execute_direct(@@C_CONTROLLER, 'frontend-backup', args)\n result = parse_result(result)\n result.resultIO.string\n end",
"title": ""
},
{
"docid": "724ec63ad111d559f25fdac5ee0f4550",
"score": "0.44136578",
"text": "def maximum_bytes_billed\n Integer @gapi.configuration.query.maximum_bytes_billed\n rescue StandardError\n nil\n end",
"title": ""
},
{
"docid": "e19fbbc39d7d4c67656616d774c0d225",
"score": "0.4396626",
"text": "def quota_info\n end",
"title": ""
},
{
"docid": "7e96ed5a7382f78e78cb5b20e0deb2ac",
"score": "0.43839267",
"text": "def make_json_limit_task(channel)\n samples_map = Hash['mmt' => 'data_DoubleMu', \n 'eet' => 'data_DoubleElectron', \n 'emt' => 'data_MuEG',\n 'llt' => 'data_DoubleMu',\n ]\n carddir = $carddir #makes a copy so that if $cardir changes this does not\n json_stamp = \"#{$carddir}/#{channel}/.limit_harvested\"\n file json_stamp => \"#{$carddir}/#{channel}/.limits_computed\" do |t|\n sh \"harvest_limits.py #{carddir}/#{channel}\"\n sh \"touch #{t.name}\"\n sh \"add_tag_to_json.py #{carddir}/#{channel}/*.json -l jobid -t #{$jobid}\"\n sh \"add_tag_to_json.py #{carddir}/#{channel}/*.json -l lumi -t #{get_lumi(samples_map[channel], $jobid)}\"\n end\n return json_stamp\nend",
"title": ""
},
{
"docid": "66ddd69f1b43a52979709ab45084467f",
"score": "0.43808222",
"text": "def get_update_configuration_job(gear, config)\n args = build_base_gear_args(gear)\n args['--with-config'] = config\n job = RemoteJob.new('openshift-origin-node', 'update-configuration', args)\n job\n end",
"title": ""
},
{
"docid": "4fc9e3f5a44bde2b00817587dd53b5bc",
"score": "0.437613",
"text": "def GetRequSpace(initialize)\n GetPartitionInfo() if !@info_called\n\n # used space in kB\n used = 0\n\n #$[ \"dir\" : [ total, usednow, usedfuture ], .... ]\n Builtins.foreach(Pkg.TargetGetDU) do |dir, sizelist|\n used = Ops.add(used, Ops.get_integer(sizelist, 2, 0))\n end\n Builtins.y2milestone(\"GetReqSpace Pkg::TargetGetDU() %1\", Pkg.TargetGetDU)\n # used is in kB\n String.FormatSize(Ops.multiply(used, 1024))\n end",
"title": ""
},
{
"docid": "724bfd11dc5db8158400299a623f7ccc",
"score": "0.43682835",
"text": "def enqueue_job\n\n BgJob.enqueue(\n PlanEconomyJob,\n {\n client_token_id: @client_token_id,\n is_first_time_set: @is_first_time_set\n }\n )\n\n end",
"title": ""
},
{
"docid": "f43b28092a59c40f83b9813c4bb50b86",
"score": "0.4361928",
"text": "def check_queue(pooler, request_object)\n # 360 retries takes about an hour\n retries = 360\n response_body = nil\n begin\n (1..retries).each do |i|\n response = Vanagon::Utilities.http_request_generic(\n \"#{pooler}/request\",\n 'POST',\n request_object.to_json,\n { 'X-AUTH-TOKEN' => @token }\n )\n response_body = validate_queue_status_response(response.code, response.body)\n break if response_body\n\n sleep_seconds = 10 if i >= 10\n sleep_seconds = i if i < 10\n VanagonLogger.info \"Waiting #{sleep_seconds} seconds to fill ABS request (x#{i})\"\n\n sleep(sleep_seconds)\n end\n rescue SystemExit, Interrupt\n VanagonLogger.error \"\\nVanagon interrupted during mains ABS polling. \" \\\n \"Remember to delete the requested job_id #{@saved_job_id}\"\n raise\n end\n\n if response_body\n translated(response_body, @saved_job_id)\n else\n VanagonLogger.error \"ABS timed out after #{retries} retries.\"\n { 'retry-failure': retries }\n end\n end",
"title": ""
},
{
"docid": "f81f5d51fd3dbdc4a6a7b14d2bbf5679",
"score": "0.43536228",
"text": "def get_quota_files\n rpc_get_fact_direct('quota_files').to_i\n end",
"title": ""
},
{
"docid": "126804504d665fa5d9e3dc9f1a727e5a",
"score": "0.43518862",
"text": "def test_volume_size(server,expected_size)\n puts \"Testing with: #{@mount_point} #{expected_size}\"\nputs \"THIS DOES NOT WORK - cause of rounding errors during volume size determination, FS overhead and df's output\"\nputs \"Need to query the volumes attached to the server and verify that they #{expected_size}/#{@stripe_count}\"\nputs \"Check that the server's volumes are #{expected_size}\"\n# server.spot_check_command(\"df -kh | awk -F\\\" \\\" -v -v size=#{expected_size}G '/#{@mount_point}/ {exit $2!=size}'\")\n end",
"title": ""
},
{
"docid": "549ecbc2aa26319413e8ec337e87c079",
"score": "0.43502718",
"text": "def reserve_with_restriction(queue)\n\n limit_restriction_workers(queue) do\n\n queue_size = Resque.size(queue)\n\n # Try up to N times to get a unrestricted job from the queue\n count = [queue_size, Plugins::Restriction.restriction_queue_batch_size].min\n count.times do |i|\n\n resque_job = reserve_without_restriction(queue)\n return nil unless resque_job\n\n job_class = resque_job.payload_class\n job_args = resque_job.args\n\n # return to work on job if not a restricted job\n return resque_job unless job_class.is_a?(Plugins::Restriction)\n\n # Move on to next if job is restricted, otherwise\n # return the job to be performed\n if job_class.restricted?(*job_args)\n job_class.push_to_restriction_queue(queue, *job_args)\n else\n return resque_job\n end\n\n end\n\n # Return nil to move on to next queue if we couldn't get a job after batch_size tries\n return nil\n\n end\n\n end",
"title": ""
},
{
"docid": "b36fb61cf6b0993b23e51a939f959670",
"score": "0.4341446",
"text": "def rsync_destination_container(gear, destination_container, destination_district_uuid, quota_blocks, quota_files)\n app = gear.application\n reply = ResultIO.new\n source_container = gear.get_proxy\n platform = gear.group_instance.platform\n log_debug \"DEBUG: Gear platform is '#{platform}'\"\n log_debug \"DEBUG: Creating new account for gear '#{gear.uuid}' on #{destination_container.id}\"\n sshkey_required = false\n initial_deployment_dir_required = false\n reply.append destination_container.create(gear, quota_blocks, quota_files, sshkey_required, initial_deployment_dir_required)\n rsync_keyfile = Rails.configuration.auth[:rsync_keyfile]\n log_debug \"DEBUG: Moving content for app '#{app.name}', gear '#{gear.uuid}' to #{destination_container.id}\"\n case platform.downcase\n when \"windows\"\n #Rsync arguments had to be changed for windows to move the gear with full rights and reset them correctly in the post move method\n log_debug `eval \\`ssh-agent\\`; ssh-add #{rsync_keyfile}; ssh -o StrictHostKeyChecking=no -A root@#{source_container.get_ip_address} \"rsync --perms -rltgoD0v --chmod=Du=rwx,Dg=rwx,Do=rwx,Fu=rww,Fg=rwx,Fo=rwx -p --exclude 'profile' -e 'ssh -o StrictHostKeyChecking=no' /cygdrive/c/openshift/gears/#{gear.uuid}/ root@#{destination_container.get_ip_address}:/cygdrive/c/openshift/gears/#{gear.uuid}/\"; exit_code=$?; ssh-agent -k;exit $exit_code`\n else\n log_debug `eval \\`ssh-agent\\`; ssh-add #{rsync_keyfile}; ssh -o StrictHostKeyChecking=no -A root@#{source_container.get_ip_address} \"rsync -aAXS -e 'ssh -o StrictHostKeyChecking=no' /var/lib/openshift/#{gear.uuid}/ root@#{destination_container.get_ip_address}:/var/lib/openshift/#{gear.uuid}/\"; exit_code=$?; ssh-agent -k; exit $exit_code`\n end\n\n if $?.exitstatus != 0\n raise OpenShift::NodeException.new(\"Error moving app '#{app.name}', platform '#{platform}', gear '#{gear.uuid}' from #{source_container.id} to #{destination_container.id}\", 143)\n end\n\n log_debug \"DEBUG: Moving system components for app '#{app.name}', gear '#{gear.uuid}' to #{destination_container.id}\"\n case platform.downcase\n when \"windows\"\n #Rsync arguments changed, preserving extended attributes and ACLs cannot be used on windows\n log_debug `eval \\`ssh-agent\\`; ssh-add #{rsync_keyfile}; ssh -o StrictHostKeyChecking=no -A root@#{source_container.get_ip_address} \"rsync -rltgoD0v -e 'ssh -o StrictHostKeyChecking=no' --include '.httpd.d/' --include '.httpd.d/#{gear.uuid}_***' --include '#{gear.name}-#{app.domain.namespace}' --include '.last_access/' --include '.last_access/#{gear.uuid}' --exclude '*' /cygdrive/c/openshift/gears/ root@#{destination_container.get_ip_address}:/cygdrive/c/openshift/gears/\"; exit_code=$?; ssh-agent -k; exit $exit_code`\n else\n log_debug `eval \\`ssh-agent\\`; ssh-add #{rsync_keyfile}; ssh -o StrictHostKeyChecking=no -A root@#{source_container.get_ip_address} \"rsync -aAXS -e 'ssh -o StrictHostKeyChecking=no' --include '.httpd.d/' --include '.httpd.d/#{gear.uuid}_***' --include '#{gear.name}-#{app.domain_namespace}' --include '.last_access/' --include '.last_access/#{gear.uuid}' --exclude '*' /var/lib/openshift/ root@#{destination_container.get_ip_address}:/var/lib/openshift/\"; exit_code=$?; ssh-agent -k; exit $exit_code`\n end\n\n if $?.exitstatus != 0\n raise OpenShift::NodeException.new(\"Error moving system components for app '#{app.name}', platform '#{platform}', gear '#{gear.uuid}' from #{source_container.id} to #{destination_container.id}\", 143)\n end\n\n unless platform.downcase == \"windows\"\n # Transfer the front-end configuration to the new gear\n backup = source_container.frontend_backup(gear)\n reply.append destination_container.frontend_restore(backup)\n end\n\n reply\n end",
"title": ""
},
{
"docid": "29fc43e7882e96fc89df9a10ded843b2",
"score": "0.4322796",
"text": "def create\n GpsJob.perform_later(request_params)\n head(:ok)\n end",
"title": ""
},
{
"docid": "a81c41929858dffb43f8b54bf0519cb7",
"score": "0.43087527",
"text": "def test_client_submit_background\n server = FakeJobServer.new(self)\n client, task1, task2, taskset, sock, res1, res2 = nil\n\n s = TestScript.new\n c = TestScript.new\n\n server_thread = Thread.new { s.loop_forever }.run\n client_thread = Thread.new { c.loop_forever }.run\n\n c.exec { client = Gearman::Client.new(\"localhost:#{server.port}\") }\n\n c.exec { task1 = Gearman::Task.new('add', '5 2', { :background => :true, :priority => :low }) }\n c.exec { task1.on_complete {|d| res1 = d.to_i } }\n c.exec { taskset = Gearman::TaskSet.new(client) }\n c.exec { taskset.add_task(task1) }\n s.exec { sock = server.expect_connection }\n s.wait\n\n s.exec { server.expect_request(sock, :submit_job_low_bg, \"add\\000\\0005 2\") }\n end",
"title": ""
},
{
"docid": "38dc5c7e356048b3b6aff16ceb35f037",
"score": "0.4306859",
"text": "def test_client_submit_background\n server = FakeJobServer.new(self)\n client, task1, task2, taskset, sock, res1, res2 = nil\n\n s = TestScript.new\n c = TestScript.new\n\n server_thread = Thread.new { s.loop_forever }.run\n client_thread = Thread.new { c.loop_forever }.run\n\n c.exec { client = Gearman::Client.new(\"localhost:#{server.port}\") }\n\n c.exec { task1 = Gearman::Task.new('add', '5 2', { :background => :true, :priority => :high }) }\n c.exec { task1.on_complete {|d| res1 = d.to_i } }\n c.exec { taskset = Gearman::TaskSet.new(client) }\n c.exec { taskset.add_task(task1) }\n s.exec { sock = server.expect_connection }\n s.wait\n\n s.exec { server.expect_request(sock, :submit_job_high_bg, \"add\\000\\0005 2\") }\n end",
"title": ""
},
{
"docid": "8e26d35bbc5234520ef3037417d9e9b8",
"score": "0.43063807",
"text": "def quota_vms_by_owner(options)\n quota_vm_stats(:quota_find_vms_by_owner, options)\n end",
"title": ""
},
{
"docid": "a66a292ac3782d355336855f64249f0d",
"score": "0.42816296",
"text": "def reserve\n queues.each do |queue|\n log_with_severity :debug, \"Checking #{queue}\"\n if job = Resque.reserve(queue)\n log_with_severity :debug, \"Found job on #{queue}\"\n\n if job.payload['enqueue_ts']\n delay_ts = Time.now.to_i - job.payload['enqueue_ts'].to_i\n max_delay = Resque.redis.get(\"fifo-stats-max-delay\") || 0\n Resque.redis.incrby(\"fifo-stats-accumulated-delay\", delay_ts)\n Resque.redis.incr(\"fifo-stats-accumulated-count\")\n if (delay_ts > max_delay.to_i)\n Resque.redis.set(\"fifo-stats-max-delay\", max_delay)\n end\n end\n return job\n end\n end\n\n nil\n rescue Exception => e\n log_with_severity :error, \"Error reserving job: #{e.inspect}\"\n log_with_severity :error, e.backtrace.join(\"\\n\")\n raise e\n end",
"title": ""
},
{
"docid": "19dbb9d37a966bead445bb52e399bfea",
"score": "0.4278941",
"text": "def percent_of_queued_jobs_not_requesting_gpus(available_jobs, eligible_jobs)\n #@queued_jobs_requesting_no_gpus = (eligible_jobs - queued_jobs_requesting_gpus).abs()\n #(@queued_jobs_requesting_no_gpus.to_f / available_jobs) * 100\n end",
"title": ""
},
{
"docid": "cbea2c1ead5811b12928b4c23ec83502",
"score": "0.42784616",
"text": "def get_remote_quotas\n begin\n response = @client.call(\"one.user.info\",@credentials, -1)\n xmlrpc_fault_exception\n end\n\n doc = Nokogiri::XML.parse(response[1])\n\n cpu = doc.xpath(\"//VM_QUOTA//CPU\").text\n cpu_used = doc.xpath(\"//VM_QUOTA//CPU_USED\").text\n memory = doc.xpath(\"//VM_QUOTA//MEMORY\").text\n memory_used = doc.xpath(\"//VM_QUOTA//MEMORY_USED\").text\n\n # These could be used for fixed and instance-based monitoring modes. Leaving them for possible future usage\n\n cpu = cpu.to_i * 100\n cpu_used = cpu_used.to_i * 100\n memory = memory.to_i * 1024\n memory_used = memory_used.to_i * 1024\n\n quotas = \"TOTALMEMORY=#{memory}\\n\"\n quotas << \"TOTALCPU=#{cpu}\\n\"\n # quotas << \"USEDMEMORY=0\\n\"\n # quotas << \"USEDCPU=0\\n\"\n # quotas << \"USEDMEMORY=#{memory_used}\\n\"\n # quotas << \"USEDCPU=#{cpu_used}\\n\"\n # quotas << \"FREEMEMORY=#{(memory - memory_used)}\\n\"\n # quotas << \"FREECPU=#{cpu - cpu_used}\\n\"\n end",
"title": ""
},
{
"docid": "04bb8ee6e548b024229a66e003bc975f",
"score": "0.42764488",
"text": "def index\n validate_arguments!\n quota_resp = api.request(\n :expects => [200, 404],\n :method => :post,\n :path => \"/apps/#{app}/actions/get-quota\",\n :headers => {\n \"Accept\" => \"application/vnd.heroku+json; version=3.app-quotas\",\n \"Content-Type\" => \"application/json\"\n }\n )\n\n if quota_resp.status = 200\n quota = quota_resp.body\n now = Time.now.getutc\n quota_message = if quota[\"allow_until\"]\n \"Free quota left:\"\n elsif quota[\"deny_until\"]\n \"Free quota exhausted. Unidle available in:\"\n end\n if quota_message\n quota_timestamp = (quota[\"allow_until\"] ? Time.parse(quota[\"allow_until\"]).getutc : Time.parse(quota[\"deny_until\"]).getutc)\n time_left = time_remaining(Time.now.getutc, quota_timestamp)\n display(\"#{quota_message} #{time_left}\")\n end\n end\n\n processes_resp = api.request(\n :expects => 200,\n :method => :get,\n :path => \"/apps/#{app}/dynos\",\n :headers => {\n \"Accept\" => \"application/vnd.heroku+json; version=3\",\n \"Content-Type\" => \"application/json\"\n }\n )\n processes = processes_resp.body\n\n processes_by_command = Hash.new {|hash,key| hash[key] = []}\n processes.each do |process|\n now = Time.now\n type = process[\"type\"]\n elapsed = now - Time.iso8601(process['updated_at'])\n since = time_ago(now - elapsed)\n size = process[\"size\"] || \"1X\"\n\n if type == \"run\"\n key = \"run: one-off processes\"\n item = \"%s (%s): %s %s: `%s`\" % [ process[\"name\"], size, process[\"state\"], since, process[\"command\"] ]\n else\n key = \"#{type} (#{size}): `#{process[\"command\"]}`\"\n item = \"%s: %s %s\" % [ process['name'], process['state'], since ]\n end\n\n processes_by_command[key] << item\n end\n\n extract_run_id = /\\.(\\d+).*:/\n processes_by_command.keys.each do |key|\n processes_by_command[key] = processes_by_command[key].sort do |x,y|\n x.match(extract_run_id).captures.first.to_i <=> y.match(extract_run_id).captures.first.to_i\n end\n end\n\n processes_by_command.keys.sort.each do |key|\n styled_header(key)\n styled_array(processes_by_command[key], :sort => false)\n end\n end",
"title": ""
},
{
"docid": "256e1934f1f0f584c083fbaec4a9e098",
"score": "0.4273169",
"text": "def cheap_wait; end",
"title": ""
},
{
"docid": "84ea67d78df44dda4cd8fefa3e36792b",
"score": "0.42714378",
"text": "def test_read_timeouts\n server = FakeJobServer.new(self)\n client, sock, task, taskset, res = nil\n\n s = TestScript.new\n c = TestScript.new\n\n server_thread = Thread.new { s.loop_forever }.run\n client_thread = Thread.new { c.loop_forever }.run\n\n c.exec { client = Gearman::Client.new(\"localhost:#{server.port}\") }\n\n # First, create a new task. The server claims to be sending back a\n # packet with 1 byte of data, but actually sends an empty packet. The\n # client should time out after 0.1 sec.\n c.exec { taskset = Gearman::TaskSet.new(client) }\n c.exec { task = Gearman::Task.new('foo', 'bar') }\n c.exec { client.task_create_timeout_sec = 0.1 }\n c.exec { res = taskset.add_task(task) }\n s.exec { sock = server.expect_connection }\n s.wait\n\n s.exec { server.expect_request(sock, :submit_job, \"foo\\000\\000bar\") }\n s.exec { server.send_response(sock, :job_created, '', 1) }\n c.wait\n s.wait\n\n assert_equal(false, res)\n\n # Now create a task, but only return a partial packet for\n # work_complete. The client should again time out after 0.1 sec.\n c.exec { res = taskset.add_task(task) }\n s.exec { sock = server.expect_connection }\n s.wait\n\n s.exec { server.expect_request(sock, :submit_job, \"foo\\000\\000bar\") }\n s.exec { server.send_response(sock, :job_created, 'a') }\n c.exec { res = taskset.wait(0.1) }\n s.exec { server.send_response(sock, :work_complete, \"a\\000\", 3) }\n c.wait\n s.wait\n\n assert_equal(false, res)\n end",
"title": ""
},
{
"docid": "9bb3551bdab7bcaf726e0bdd022bc095",
"score": "0.4260593",
"text": "def quota\n return @quota\n end",
"title": ""
},
{
"docid": "3b79cc85837e50fab29bce5477db5a3c",
"score": "0.4258162",
"text": "def enqueue_self\n\n BgJob.enqueue(\n ::RegisterBrandedToken::GetAirdropDeployStatusJob,\n {\n parent_id: @parent_id\n },\n {\n wait: 10.seconds\n }\n )\n\n end",
"title": ""
},
{
"docid": "f3cbb0678b9f02468269cffb9f9fa3e6",
"score": "0.4257747",
"text": "def requeue_throttled\n Sidekiq.redis { |conn| conn.lpush(QueueName.expand(queue_name), job) }\n end",
"title": ""
},
{
"docid": "527f55ec859b5ad0c512544de3a77b35",
"score": "0.4257332",
"text": "def crear_reserva\n if (horainicio - Time.now) < 14_400\n ReservationsJob.set(wait: (self.horainicio - Time.now).seconds).perform_later(self.space_id)\n asignar_espacio\n end\n end",
"title": ""
},
{
"docid": "67c81eba59f8218dc693df9f5655b1c3",
"score": "0.4254491",
"text": "def within_storage_limit?\n #return true if @homebase.plan.priveleges.find(2).plan_limit.to_i == 0\n #return true if @homebase.total_files.to_f/1024.kilobytes <= @homebase.plan.priveleges.find(2).plan_limit.to_i\n return true if @homebase.within_storage_limit?\n return false\n end",
"title": ""
},
{
"docid": "aa5ea73e1ab00d7a522ba78540ab109e",
"score": "0.42524734",
"text": "def CheckDiskFreeSpace(free_percent, max_unsufficient_free_size)\n GetPartitionInfo() if !@info_called\n\n Builtins.y2milestone(\n \"min. free space: %1%%, max. unsufficient free space: %2\",\n free_percent,\n max_unsufficient_free_size\n )\n\n ret = []\n\n if Ops.greater_than(free_percent, 0)\n #$[ \"dir\" : [ total, usednow, usedfuture ], .... ]\n Builtins.foreach(Pkg.TargetGetDU) do |dir, sizelist|\n Builtins.y2milestone(\"Disk usage of directory %1: %2\", dir, sizelist)\n total = Ops.get_integer(sizelist, 0, 0)\n used_future = Ops.get_integer(sizelist, 2, 0)\n used_now = Ops.get_integer(sizelist, 1, 0)\n current_free_size = Ops.subtract(total, used_future)\n current_free_percent = Ops.divide(\n Ops.multiply(current_free_size, 100),\n total\n )\n # ignore the partitions which were already full and no files will be installed there (bnc#259493)\n if Ops.greater_than(used_future, used_now) &&\n Ops.greater_than(current_free_size, 0)\n if Ops.less_than(current_free_percent, free_percent) &&\n Ops.less_than(current_free_size, max_unsufficient_free_size)\n Builtins.y2warning(\n \"Partition %1: less than %2%% free space (%3%%, %4)\",\n dir,\n free_percent,\n current_free_percent,\n current_free_size\n )\n\n ret = Builtins.add(\n ret,\n {\n \"dir\" => dir,\n \"free_percent\" => current_free_percent,\n \"free_size\" => current_free_size\n }\n )\n end\n end\n end\n end\n\n Builtins.y2milestone(\"Result: %1\", ret)\n\n deep_copy(ret)\n end",
"title": ""
},
{
"docid": "5bb340af158d7c5bb833864ae14aab6e",
"score": "0.42516744",
"text": "def execute_backup_stripe(options={})\n @disk.sync\n\n# Ensure filesystem is frozen and uses retry\n raise \"FATAL: unable to freeze lvm filesystem!\" unless @disk.freeze\n\n create_opts = {\n :lineage => options[:lineage],\n :prefix_override => options[:lineage], #Make sure we use the volume_nickname \"lineage\" as the prefix for our snaps (even if the volume has a different, perhaps more descriptive name)\n :description => \"Snapshot created by RightScale DB tools on instance #{ENV['EC2_INSTANCE_ID']}.\",\n :max_snaps => options[:max_snapshots],\n :keep_dailies => options[:keep_dailies],\n :keep_weeklies => options[:keep_weeklies],\n :keep_monthlies => options[:keep_monthlies],\n :keep_yearlies => options[:keep_yearlies],\n :devices => options[:devices].join(\",\")\n }\n create_opts[:suffix] = options[:suffix] if options[:suffix]\n\n # TODO: retry on the http requests? sounds like a good idea to me\n result = self.create_ebs_backup(create_opts)\n raise \"FATAL: unable to create snapshots!\" if result.nil?\n aws_ids = result['aws_ids']\n raise \"FATAL: result not recognized #{result}\" unless aws_ids.is_a?(Array)\n\n# Ensure filesystem is unfrozen and uses retry\n raise \"FATAL: could not unfreeze filesystem!\" unless @disk.unfreeze\n\n aws_ids.each do |snap|\n # TODO: does this http call need to be retried also? \n self.update_snapshot(snap, \"committed\")\n end\n\n # e) - Perform snapshot cleanup\n lst = self.cleanup_snapshots_stripe(options[:cleanup_prefix],{:keep_last => options[:max_snapshots], :dailies => options[:keep_dailies], :weeklies => options[:keep_weeklies], :monthlies => options[:keep_monthlies], :yearlies => options[:keep_yearlies]})\n puts \"Cleanup resulted in deleting #{lst.length} snapshots : #{lst.inspect}\"\n \n end",
"title": ""
},
{
"docid": "600b410e3f5199578194946d5858cb1c",
"score": "0.42482823",
"text": "def get_transfer_job request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_get_transfer_job_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::StorageTransfer::V1::TransferJob.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "cb7f0cc1b2e32818ffd3a1636d96ade2",
"score": "0.4241697",
"text": "def run\n super\n\n bucket_name = _get_entity_name\n opt_use_file = _get_option(\"use_file\")\n opt_filename = _get_option(\"brute_file\")\n opt_additional_buckets = _get_option(\"additional_buckets\")\n opt_use_creds = _get_option(\"use_creds\")\n opt_threads = _get_option(\"threads\")\n\n if opt_use_file\n _log \"Using file: #{opt_filename}\"\n potential_buckets = File.read(\"#{$intrigue_basedir}/data/#{opt_filename}\").split(\"\\n\")\n else\n _log \"Using provided brute list\"\n potential_buckets = [bucket_name]\n end\n\n # add in any additional buckets to the list of potentials\n all_potential_buckets = potential_buckets.concat(opt_additional_buckets.split(\",\"))\n\n # Create our queue of work from the checks in brute_list\n work_q = Queue.new\n all_potential_buckets.each do |pb|\n work_q << pb.strip\n end\n\n # Create a pool of worker threads to work on the queue\n workers = (0...opt_threads).map do\n Thread.new do\n begin\n while bucket_name = work_q.pop(true)\n\n #skip anything that isn't a real name\n next unless bucket_name && bucket_name.length > 0\n\n # Authenticated method\n if opt_use_creds\n\n access_key_id = _get_global_config \"aws_access_key_id\"\n secret_access_key = _get_global_config \"aws_secret_access_key\"\n\n unless access_key_id && secret_access_key\n _log_error \"FATAL! To scan with authentication, you must specify a aws_access_key_id aws_secret_access_key in the config!\"\n return\n end\n\n # Check for it, and get the contents\n Aws.config[:credentials] = Aws::Credentials.new(access_key_id, secret_access_key)\n exists = check_existence_authenticated(bucket_name)\n\n # create our entity and store the username with it\n _create_entity(\"AwsS3Bucket\", {\n \"name\" => \"#{s3_uri}\",\n \"uri\" => \"#{s3_uri}\",\n \"authenticated\" => true,\n \"username\" => access_key_id\n }) if exists\n\n #########################\n # Unauthenticated check #\n #########################\n else\n\n s3_uri = \"https://#{bucket_name}.s3.amazonaws.com\"\n exists = check_existence_unauthenticated(s3_uri)\n _create_entity(\"AwsS3Bucket\", {\n \"name\" => \"#{s3_uri}\",\n \"uri\" => \"#{s3_uri}\",\n \"authenticated\" => false\n }) if exists\n\n next if exists ## Only proceed if we got an error above (bucket exists!) !!!\n\n s3_uri = \"https://s3.amazonaws.com/#{bucket_name}\"\n exists = check_existence_unauthenticated(s3_uri)\n _create_entity(\"AwsS3Bucket\", {\n \"name\" => \"#{s3_uri}\",\n \"uri\" => \"#{s3_uri}\",\n \"authenticated\" => false,\n }) if exists\n\n end # end if opt_use_creds\n\n\n end # end while\n rescue ThreadError\n end\n end\n end; \"ok\"\n workers.map(&:join); \"ok\"\n\n end",
"title": ""
},
{
"docid": "714e21639531c0e494156deda5156a55",
"score": "0.4236735",
"text": "def space_percentage\n if quota == 0\n 0.0\n else\n (size.to_f/quota)*100 rescue 0.0\n end\n end",
"title": ""
},
{
"docid": "ca5ce8468e7bb1f5e111ab7b9c1951e7",
"score": "0.42214662",
"text": "def growfs\n case\n when checkfs == false && ismounted == false\n createfs\n when ismounted\n xfs_growfs(@resource[:fs_path])\n info(\"#{@resource[:fs_path]} has been grown\")\n end\n end",
"title": ""
},
{
"docid": "f8b53b08994de2d19746dfadeb48334c",
"score": "0.4221123",
"text": "def number_of_free_gigabytes\n if plan_id == 'pro'\n 100\n elsif plan_id == 'basic'\n 10\n else\n 1\n end\n end",
"title": ""
},
{
"docid": "4c531c371f89c3031da65ca0cfbe0c54",
"score": "0.42193145",
"text": "def update_limit_check() \n book_size=getFolderSize(@book_prod_folder)\n updates_size=getFolderSize(@updateFolder)\n accepted_size=(book_size*@max_update_limit.to_i())/100\n if(updates_size>accepted_size)\n diff_size=updates_size-accepted_size\n deleteUpdateFolderContents(diff_size)\n end\nend",
"title": ""
},
{
"docid": "b3fcd7b9dc7fb39cec4ad270c38070fb",
"score": "0.42185006",
"text": "def CheckDiskSize\n fit = true\n\n GetPartitionInfo() if !@info_called\n\n used = 0\n\n message = \"\"\n #$[ \"dir\" : [ total, usednow, usedfuture ], .... ]\n Builtins.foreach(Pkg.TargetGetDU) do |dir, sizelist|\n Builtins.y2milestone(\"%1: %2\", dir, sizelist)\n needed = Ops.subtract(\n Ops.get_integer(sizelist, 2, 0),\n Ops.get_integer(sizelist, 0, 0)\n ) # usedfuture - total\n if Ops.greater_than(needed, 0)\n Builtins.y2warning(\n \"Partition \\\"%1\\\" needs %2 more disk space.\",\n # size is in kB\n dir,\n String.FormatSize(Ops.multiply(needed, 1024))\n )\n fit = false\n end\n used = Ops.add(used, Ops.get_integer(sizelist, 2, 0))\n end\n\n Builtins.y2milestone(\"Total used space (kB): %1, fits ?: %2\", used, fit)\n\n fit\n end",
"title": ""
},
{
"docid": "eee51c7856a8eb53cef72adab8885d83",
"score": "0.42174777",
"text": "def quota_requests_by_owner(options)\n quota_provision_stats(:quota_find_prov_request_by_owner, options)\n end",
"title": ""
},
{
"docid": "9b94ac15bfd3871f7b43cac1a7d6c01a",
"score": "0.42166406",
"text": "def check_volume(volume) \n # Default warning_limit\n warning_limit=@warning_limit\n # Default critical_limit\n critical_limit=@critical_limit\n # Default nobackup_status\n nobackup_status=@nobackup_status\n\n puts \"Checking volume: #{volume}\" if @verbose\n\n if @objects.has_key?(volume) and not @objects[volume].has_key?(:skip)\n vol=DuplicityVolume.new(volume,@config_values,@objects[volume])\n vol.debug=@debug\n vol.testing=@testing\n vol.run(\"col\")\n\n puts \" Checking vol: #{volume} last backup: #{vol.last_backup}\" if @verbose\n warning_limit=@objects[volume][:warning_limit] if @objects[volume].has_key? :warning_limit\n\t puts \" warning_limit for #{volume} is #{warning_limit}\" if @debug\n critical_limit=@objects[volume][:critical_limit] if @objects[volume].has_key? :critical_limit\n\t puts \" critical_limit for #{volume} is #{critical_limit}\" if @debug\n nobackup_status=@objects[volume][:nobackup_status] if @objects[volume].has_key? :nobackup_status\n\t puts \" nobackup_status for #{volume} is #{nobackup_status}\" if @debug\n # Check backup age\n check_time=Time.now\n if vol.last_backup\n if check_time < vol.last_backup + warning_limit.to_i\n incstatus(\"OK\")\n elsif check_time >= vol.last_backup + warning_limit.to_i and check_time < vol.last_backup + critical_limit.to_i\n @short+=\"#{vol.name} OLD, \"\n @long+=\"#{vol.name} is too OLD\\n\"\n incstatus(\"WARNING\")\n elsif check_time >= vol.last_backup + critical_limit.to_i\n @short+=\"#{vol.name} OLD, \"\n @long+=\"#{vol.name} is too OLD\\n\"\n incstatus(\"CRITICAL\")\n end\n else\n @short+=\"no backups for #{vol.name}, \"\n @long+=\"No backups found for volume #{vol.name}\\n\"\n incstatus(nobackup_status)\n end\n else\n puts \"ERROR: Volume #{volume} is not defined\"\n return false\n end\n end",
"title": ""
},
{
"docid": "16ad0891abe3ddb35c3350e4c385e337",
"score": "0.42043513",
"text": "def create_transfer_job request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_create_transfer_job_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::StorageTransfer::V1::TransferJob.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "4dd9f8fe2e2395910e713c7bec35ff3e",
"score": "0.4199963",
"text": "def test_client_submit_background\n server = FakeJobServer.new(self)\n client, task1, task2, taskset, sock, res1, res2 = nil\n\n s = TestScript.new\n c = TestScript.new\n\n server_thread = Thread.new { s.loop_forever }.run\n client_thread = Thread.new { c.loop_forever }.run\n\n c.exec { client = Gearman::Client.new(\"localhost:#{server.port}\") }\n\n c.exec { task1 = Gearman::Task.new('add', '5 2', { :background => :true }) }\n c.exec { task1.on_complete {|d| res1 = d.to_i } }\n c.exec { taskset = Gearman::TaskSet.new(client) }\n c.exec { taskset.add_task(task1) }\n s.exec { sock = server.expect_connection }\n s.wait\n\n s.exec { server.expect_request(sock, :submit_job_bg, \"add\\000\\0005 2\") }\n end",
"title": ""
},
{
"docid": "5f32d09c72203892207051072fd5672e",
"score": "0.41992095",
"text": "def large()\n return MicrosoftGraph::Drives::Item::Items::Item::Workbook::Functions::Large::LargeRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "40c0ea83870617fc2c0040b6f07fa535",
"score": "0.4198117",
"text": "def new_job(job, username, password)\n puts \"Requesting quote for job:\"\n puts JSON.pretty_generate(job)\n puts \"\"\n res = post_json('jobs.json', job, username, password)\n if res['error'] || res['status'] == 'error'\n puts \"Job rejected (error #{res['status']}): #{res['error'] || res['reason']}\"\n return\n end\n\n puts \"Gnip's job desc:\"\n puts summarise_job(res)\nend",
"title": ""
},
{
"docid": "4eed912b3a8a91f7386d975e335e2825",
"score": "0.41948867",
"text": "def reserve\n queue_names = params[:queue_names].split(\",\")\n reservation_details = params[:reservation_details]\n \n Worker.identify( reservation_details, queue_names )\n \n job = JobCommands::JobReservation.new(queue_names: queue_names, reservation_details: reservation_details).perform\n if job.present?\n render_job_as_message(job)\n else\n head status: :not_found\n end\n end",
"title": ""
},
{
"docid": "d24b43b87c15471fee675e67a14602ec",
"score": "0.41885707",
"text": "def lock_retention_policy bucket_name:\n # The ID of your GCS bucket\n # bucket_name = \"your-unique-bucket-name\"\n\n require \"google/cloud/storage\"\n\n storage = Google::Cloud::Storage.new\n bucket = storage.bucket bucket_name\n\n # Warning: Once a retention policy is locked it cannot be unlocked\n # and retention period can only be increased.\n # Uses Bucket#metageneration as a precondition.\n bucket.lock_retention_policy!\n\n puts \"Retention policy for #{bucket_name} is now locked.\"\n puts \"Retention policy effective as of #{bucket.retention_effective_at}.\"\nend",
"title": ""
},
{
"docid": "d94c97f2ff0612677dee11df66f9ada8",
"score": "0.4186193",
"text": "def validate_disk_size\n return unless @dev\n\n # we can't use execute!() since we want to capture the output of the cmd\n output, _, stat = Open3.capture3(\"sudo blockdev --getsize64 #{@dev}\")\n raise RuntimeError, 'Unable determine dev size' unless stat.success?\n\n dev_mib = output.strip.to_i / (1024 * 1024) # space on device (MiB)\n begin\n tot_mib = total_disk_size()\n rescue RuntimeError => e\n warn(\"Performing lax disk size check (#{e})\")\n tot_mib = minimum_disk_size()\n end\n\n if tot_mib >= dev_mib\n warn(\"Insufficient space! need MiB: #{tot_mib}, device MiB: #{dev_mib}\")\n raise RuntimeError, \"Total size #{tot_mib} > block device size #{dev_mib}\"\n end\n\n nil\n end",
"title": ""
},
{
"docid": "9fbdc3e9e961e68510195aa017a47ae5",
"score": "0.41860256",
"text": "def test_global_deploy_black_box_failure\n setup_template_dir(\"resource-quota\") do |target_dir|\n flags = \"-f #{target_dir} --selector app=krane\"\n out, err, status = krane_black_box(\"global-deploy\", \"#{KubeclientHelper::TEST_CONTEXT} #{flags}\")\n assert_empty(out)\n assert_match(\"FAILURE\", err)\n refute_predicate(status, :success?)\n assert_equal(status.exitstatus, 1)\n end\n end",
"title": ""
},
{
"docid": "f3ea8d938316cf638f7d5cf916d989e9",
"score": "0.4185555",
"text": "def queue_job; end",
"title": ""
},
{
"docid": "d93636922f8c284c4da802b39293a2e4",
"score": "0.418552",
"text": "def quota\n @quota = 50 + @exp/2\n \n end",
"title": ""
},
{
"docid": "460ccf59d66ec6afc2b239e07dce7f7e",
"score": "0.41832587",
"text": "def test_callbacks\n server = FakeJobServer.new(self)\n client, task, taskset, sock = nil\n failed, retries, num, den, warning = nil\n\n s = TestScript.new\n c = TestScript.new\n\n server_thread = Thread.new { s.loop_forever }.run\n client_thread = Thread.new { c.loop_forever }.run\n\n c.exec { client = Gearman::Client.new(\"localhost:#{server.port}\") }\n\n task = Gearman::Task.new('foo', 'bar', { :retry_count => 3 })\n task.on_fail { failed = true }\n task.on_retry {|r| retries = r }\n task.on_status {|n,d| num = n.to_i; den = d.to_i }\n task.on_warning {|msg| warning = msg }\n received_data = \"\"\n task.on_data {|data| received_data << data }\n\n c.exec { taskset = Gearman::TaskSet.new(client) }\n c.exec { taskset.add_task(task) }\n s.exec { sock = server.expect_connection }\n s.wait\n\n # Send 4 failures back to the client.\n c.exec { taskset.wait }\n s.exec { server.expect_request(sock, :submit_job, \"foo\\000\\000bar\") }\n s.exec { server.send_response(sock, :job_created, 'a') }\n s.exec { server.send_response(sock, :work_fail, 'a') }\n s.exec { server.expect_request(sock, :submit_job, \"foo\\000\\000bar\") }\n s.exec { server.send_response(sock, :job_created, 'b') }\n s.exec { server.send_response(sock, :work_fail, 'b') }\n s.exec { server.expect_request(sock, :submit_job, \"foo\\000\\000bar\") }\n s.exec { server.send_response(sock, :job_created, 'c') }\n s.exec { server.send_response(sock, :work_status, \"c\\0001\\0002\") }\n s.exec { server.send_response(sock, :work_fail, 'c') }\n s.exec { server.send_response(sock, :job_created, 'd') }\n s.exec { server.send_response(sock, :work_data, \"d\\000data chunk 1\") }\n s.exec { server.send_response(sock, :work_data, \"d\\000data chunk 2\") }\n s.exec { server.send_response(sock, :work_warning, \"d\\000warning\") }\n s.exec { server.send_response(sock, :work_fail, 'd') }\n c.wait\n s.wait\n\n assert_equal(true, failed)\n assert_equal(3, retries)\n assert_equal(1, num)\n assert_equal(2, den)\n assert_equal(\"data chunk 1data chunk 2\", received_data)\n assert_equal(\"warning\", warning)\n end",
"title": ""
},
{
"docid": "703de0b3e8faf88b77482c139093faf5",
"score": "0.41799083",
"text": "def limit_amazon_bucket\n if !self.is_master\n while Build.where(:is_master => [nil, false]).count > 30\n @exclude_build = Build.where(:is_master => [nil, false]).first\n @file = @exclude_build.file_object\n\n @file.destroy\n @exclude_build.destroy\n end\n end\n end",
"title": ""
}
] |
c690d91b7e765c8453bc44cad98c50a7
|
GET /dices/1 or /dices/1.json
|
[
{
"docid": "14519ae9397cc974d54a2521183d86ba",
"score": "0.0",
"text": "def show\n number=@dice.dice_number #Number of dice\n sides=@dice.dice_sides #sides\n @roll_array = [] #array to store multiple results of dices\n number.times do\n @roll_array << (rand(sides) + 1)\n end\n @total = 0\n @roll_array.each do |roll|\n new_total = @total + roll\n @total = new_total #total of all results\n end\n return @roll_array,@total\n end",
"title": ""
}
] |
[
{
"docid": "19aa3aeb1bb18d715a0ab5c25cc2a620",
"score": "0.7197419",
"text": "def index\n @dices = Dice.all\n\n render json: @dices\n end",
"title": ""
},
{
"docid": "54f11e212cf36fb9ca79e4172c4dc5e1",
"score": "0.65421116",
"text": "def index\n @dices = Dice.all\n end",
"title": ""
},
{
"docid": "54f11e212cf36fb9ca79e4172c4dc5e1",
"score": "0.65421116",
"text": "def index\n @dices = Dice.all\n end",
"title": ""
},
{
"docid": "9bca47d9da6667c6ef035eac8ac3aa75",
"score": "0.6317044",
"text": "def show\n render json: @dice\n end",
"title": ""
},
{
"docid": "a12824d10ed355cc7f034f1a622d5662",
"score": "0.58936393",
"text": "def show\n client= Client.find_by_id params[:id]\n if client != nil\n render(json: client, status: 200) \n else\n head 404\n end \n end",
"title": ""
},
{
"docid": "1d75d0e51aa63155c707992528aea5f9",
"score": "0.5792962",
"text": "def food_info(food_id)\n get(\"/foods/#{food_id}.json\")\n end",
"title": ""
},
{
"docid": "5841e393693629fb6362ea5cacdaefe3",
"score": "0.57227933",
"text": "def index\n @diets = @profile.diets\n respond_with @diets\n end",
"title": ""
},
{
"docid": "a2a07230bba7d41d6a184ff9ea78f29e",
"score": "0.5627571",
"text": "def get_drvies_with_http_info(year, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DrivesApi.get_drvies ...'\n end\n # verify the required parameter 'year' is set\n if @api_client.config.client_side_validation && year.nil?\n fail ArgumentError, \"Missing the required parameter 'year' when calling DrivesApi.get_drvies\"\n end\n # resource path\n local_var_path = '/drives'\n\n # query parameters\n query_params = {}\n query_params[:'year'] = year\n query_params[:'seasonType'] = opts[:'season_type'] if !opts[:'season_type'].nil?\n query_params[:'week'] = opts[:'week'] if !opts[:'week'].nil?\n query_params[:'team'] = opts[:'team'] if !opts[:'team'].nil?\n query_params[:'offense'] = opts[:'offense'] if !opts[:'offense'].nil?\n query_params[:'defense'] = opts[:'defense'] if !opts[:'defense'].nil?\n query_params[:'conference'] = opts[:'conference'] if !opts[:'conference'].nil?\n query_params[:'offenseConference'] = opts[:'offense_conference'] if !opts[:'offense_conference'].nil?\n query_params[:'defenseConference'] = opts[:'defense_conference'] if !opts[:'defense_conference'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'Array<Drive>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DrivesApi#get_drvies\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "1a89300cbf12ee3cf7b4c5f9018155b1",
"score": "0.5618666",
"text": "def catalog_dcat()\n return uri(\"api/dcat.json\")\n end",
"title": ""
},
{
"docid": "b95daa9e8f3e5d859279d72bd6e41c4d",
"score": "0.56005466",
"text": "def show\n @daily_price = DailyPrice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @daily_price }\n end\n end",
"title": ""
},
{
"docid": "5f56eeb6fff563883afc64e48e7ad341",
"score": "0.55990845",
"text": "def show\n\t\t@client = Client.find(params[:id])\n\t\tif @client.status != 0\n\t\t\trender :json => @client, status: 200\n\t\telse\n\t\t\trender :json => @client.status, status: 400\n\t\tend\n\tend",
"title": ""
},
{
"docid": "284a2cb82d21bb2c835bb48a661aec03",
"score": "0.5594309",
"text": "def show\n response = Aws.list_recipe(params[:id])\n render :json => response\n end",
"title": ""
},
{
"docid": "a6c9890e4e20faa0da1c429d31d3ac22",
"score": "0.55889606",
"text": "def show\n params.require(%i[id])\n render json: Beverage.find_by!(id: params[:id])\n end",
"title": ""
},
{
"docid": "a9c220342acf91b2c8dab8c07e824093",
"score": "0.55852056",
"text": "def show\n @kf_diary = Kf::Diary.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kf_diary }\n end\n end",
"title": ""
},
{
"docid": "c1000d1fb741c3aaf49cdd8d04be1a0f",
"score": "0.5576191",
"text": "def index\n @diaries = current_user.diaries.all\n respond_to do |format|\n format.html {render :index}\n format.json { render json: @diaries }\n end\n end",
"title": ""
},
{
"docid": "a3ddfa7b84a8d639e7c14a1f4c73e71b",
"score": "0.55679625",
"text": "def show\r\n\r\n url = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/#{params[:id]}/information\")\r\n\r\n http = Net::HTTP.new(url.host, url.port)\r\n http.use_ssl = true\r\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\r\n\r\n request = Net::HTTP::Get.new(url)\r\n request[\"x-rapidapi-key\"] = ENV[\"SPOONACULAR_API_KEY\"] # hidden API key\r\n request[\"x-rapidapi-host\"] = 'spoonacular-recipe-food-nutrition-v1.p.rapidapi.com'\r\n\r\n response = http.request(request)\r\n @recipe = JSON.parse response.read_body # gets the recipe\r\n\r\n p url_ingredients = URI(\"https://spoonacular-recipe-food-nutrition-v1.p.rapidapi.com/recipes/#{params[:id]}/ingredientWidget.json\")\r\n\r\n http_ingredients = Net::HTTP.new(url_ingredients.host, url_ingredients.port)\r\n http_ingredients.use_ssl = true\r\n http_ingredients.verify_mode = OpenSSL::SSL::VERIFY_NONE\r\n\r\n request_ingredients = Net::HTTP::Get.new(url_ingredients)\r\n request_ingredients[\"x-rapidapi-key\"] = ENV[\"SPOONACULAR_API_KEY\"]\r\n request[\"x-rapidapi-host\"] = 'spoonacular-recipe-food-nutrition-v1.p.rapidapi.com'\r\n\r\n response_ingredients = http.request(request_ingredients)\r\n # puts response_ingredients.read_body\r\n @ingredients = JSON.parse # data is a string (which looks like a hash -> convert to hash) response_ingredients.read_body\r\n p \"RECIPES\"\r\n # p @recipe\r\n p \"INGREDIENTS\"\r\n p @ingredients\r\n\r\n end",
"title": ""
},
{
"docid": "218eab31665e186fecd476d1c3434acd",
"score": "0.5558298",
"text": "def show\n render json: @diet, status: 200, root: true\n end",
"title": ""
},
{
"docid": "7d28fd8575a61ea14078417474ec69e4",
"score": "0.555784",
"text": "def show(id) \n response = request(:get, \"/recipes/#{id}.json\")\n response.first[1]\n end",
"title": ""
},
{
"docid": "21ec62b145b846fb79ccb3fe133cfdf4",
"score": "0.5553278",
"text": "def show\n\n @food = Food.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @food }\n end\n end",
"title": ""
},
{
"docid": "f307292a88668c3dbcf15b93ab367cc3",
"score": "0.553907",
"text": "def find_client\n cliente = get_cliente(params[:id])\n\n respond_to do |format|\n format.json {render json: {client: cliente}}\n end\n end",
"title": ""
},
{
"docid": "a70ff66e977271f114f5214e99479509",
"score": "0.55379826",
"text": "def index\n @clients = Client.all\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clients }\n end\n end",
"title": ""
},
{
"docid": "df4ab5851494b704e284899fc576c837",
"score": "0.5529338",
"text": "def show\n @food = Food.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @food }\n end\n end",
"title": ""
},
{
"docid": "026cf257828640d7174f63634076866e",
"score": "0.5523274",
"text": "def show\n @dteor = Dteor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dteor }\n end\n end",
"title": ""
},
{
"docid": "0d0d85de764638cb8c34344892fcae5f",
"score": "0.5522605",
"text": "def get(params = {})\n client.get(\"/v1/shopping/hotels/#{@hotel_id}/hotel-offers\", params)\n end",
"title": ""
},
{
"docid": "3120d4114f1d3ddef044095a5ba4bac3",
"score": "0.55201566",
"text": "def show\n @clientsOffers = ClientsOffers.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientsOffers }\n end\n end",
"title": ""
},
{
"docid": "6c0a5b45e1892f8dccb966f52942e8c8",
"score": "0.551118",
"text": "def show\n sondage = SondageService.instance.afficherSondageParId(params[:id])\n (sondage != nil) ? (render json: sondage, status: :ok) : (render json: nil, status: :not_found)\n end",
"title": ""
},
{
"docid": "b911df536e0439e132470139efd43dd8",
"score": "0.5493973",
"text": "def drink\n @drinks = Item.select {|k,v| k.product_type_id == 4 }\n \n respond_to do |format|\n #format.html # index.html.erb\n format.json { render json: @drinks, :only => [:id, :name, :description, :price, :time], :include => {:product_type => { :only => [:id, :name]}}}\n end\n end",
"title": ""
},
{
"docid": "429635459645a76c63776f4f232add36",
"score": "0.5488423",
"text": "def doodles_by_tag\n\n\t \t@tag = Tag.where(\"name = ?\", params[:tag_name]).first\n\n\t \t@doodles = Doodle.joins(:tag).where(:tags => {:name => @tag.name})\n\n\n\t\t\t# render json: { message: @doodles}, status: :ok \t \n\t\t\trespond_with :api, @doodles\t\n\n\t\t\trescue\n\t @error = ErrorMessage.new(\"Could not find that resource. Are you using the right resource identification\", \"The requested item was not found!\" )\n\t respond_with @error, status: :not_found\n\t end",
"title": ""
},
{
"docid": "cf79098425393b4969ead92d388d02fc",
"score": "0.5487773",
"text": "def show\n @client = Client.find(params[:id])\n @uuid = params[:uuid]\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"title": ""
},
{
"docid": "67d6e722c7f329f36fdce6d92e389a6a",
"score": "0.5485682",
"text": "def show\n @dress = Dress.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dress }\n end\n end",
"title": ""
},
{
"docid": "92d818134951af9cc3a90d845126b8ad",
"score": "0.54798955",
"text": "def show\n render json: Seances::UseCases::AvailableSeats.new.call(id: params[:id])\n end",
"title": ""
},
{
"docid": "c9b5efebfd17445b0e0d066277983a34",
"score": "0.5476667",
"text": "def show\n @diet = @profile.diets.includes(:food_line_items).find(params[:id])\n @food_line_item = FoodLineItem.new\n @food_line_items = @diet.food_line_items\n respond_with @diets\n end",
"title": ""
},
{
"docid": "accc3b86acb048256d79dcafec0829cb",
"score": "0.5476468",
"text": "def show(id)\n @client = Locomotive::Client.get(id)\n raise NotFound unless @client\n display @client\n end",
"title": ""
},
{
"docid": "c08f08851a4c0ff67e672bffd88bc989",
"score": "0.5474514",
"text": "def show\n client = Client.retrieve_by_id(params[:id])\n\n render json: client, serializer: SingleClientSerializer\n end",
"title": ""
},
{
"docid": "0255186699fdbeb23e49975ace640621",
"score": "0.54718685",
"text": "def get\n url = prefix + \"get\" + id_param\n return response(url)\n end",
"title": ""
},
{
"docid": "5c46ac614e29fb58b806895fef91209f",
"score": "0.54686207",
"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": "ce8314da1d849d7d96e5c9161b623376",
"score": "0.54665345",
"text": "def get\n @dish = Dish.find_by_id(params[:id]) || Dish.find_or_create_by_name(params[:name])\n respond_to do |format|\n format.json { render json: @dish.id }\n end\n end",
"title": ""
},
{
"docid": "4ea39b8bdfe2ce27c609cead6ab76a5c",
"score": "0.54632646",
"text": "def show\n @disability = Disability.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @disability }\n end\n end",
"title": ""
},
{
"docid": "4dc2583e304c7209a2539a5dc6204bc7",
"score": "0.54617715",
"text": "def index\n @dossiers = Dossier.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @dossiers }\n end\n end",
"title": ""
},
{
"docid": "f8c8602bfe245f3261c6f7ffb8f974fa",
"score": "0.5451384",
"text": "def show\n @diary = current_user.diaries.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @diary }\n end\n end",
"title": ""
},
{
"docid": "ad5aa78a4198898d1b3a633d89188436",
"score": "0.5443454",
"text": "def show\n @clowd = Clowd.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clowd }\n end\n end",
"title": ""
},
{
"docid": "e01a4fd181400dd8725fe1f9c5b44345",
"score": "0.5435626",
"text": "def dencity_get(path)\n get(path)\n end",
"title": ""
},
{
"docid": "00a226c4fd18011541ec66f182878c71",
"score": "0.5430282",
"text": "def show\n render \"api/v1/bounties/show\"\n end",
"title": ""
},
{
"docid": "53d18f9df1737a4fced182627b6d1812",
"score": "0.5429728",
"text": "def show\n @dart = Dart.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dart }\n end\n end",
"title": ""
},
{
"docid": "8cf6cbcc00c033f2dfae49b257144e55",
"score": "0.5429717",
"text": "def get_depreciation_with_http_info(vin, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: MarketApi.get_depreciation ...'\n end\n # verify the required parameter 'vin' is set\n if @api_client.config.client_side_validation && vin.nil?\n fail ArgumentError, \"Missing the required parameter 'vin' when calling MarketApi.get_depreciation\"\n end\n # resource path\n local_var_path = '/depreciation'\n\n # query parameters\n query_params = {}\n query_params[:'vin'] = vin\n query_params[:'api_key'] = opts[:'api_key'] if !opts[:'api_key'].nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DepreciationPoint')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: MarketApi#get_depreciation\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "2eef10297890d47f6dde45250f325f99",
"score": "0.5428014",
"text": "def show\n @servicio = Servicio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @servicio }\n end\n end",
"title": ""
},
{
"docid": "653f5da126aec92e21462d8a7882d3ce",
"score": "0.5423434",
"text": "def show\n @food = Food.find(params[:id])\n respond_with(@food)\n end",
"title": ""
},
{
"docid": "4c158be059f22486736888d05ab408cb",
"score": "0.54063225",
"text": "def show\n @daily_inventory = DailyInventory.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @daily_inventory }\n end\n end",
"title": ""
},
{
"docid": "55f0df4cdb34ab5ba4346dabb4eda6c9",
"score": "0.5402788",
"text": "def disc(id)\n get(\"/catalog/titles/discs/#{id.to_s}\")\n end",
"title": ""
},
{
"docid": "f3220c112de1944efac072d124342a1c",
"score": "0.53961927",
"text": "def details\n @daily_deal = DailyDeal.find(params[:id])\n respond_to do |format|\n format.json do\n render with_api_version\n end\n end\n end",
"title": ""
},
{
"docid": "a904a681cc66d3f0bddeab0936545956",
"score": "0.5387887",
"text": "def show\n @denuncium = Denuncium.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @denuncium }\n end\n end",
"title": ""
},
{
"docid": "807be614e2a750c604cdda97ab72efd1",
"score": "0.53841627",
"text": "def show\n @dc = Dc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @dc }\n end\n end",
"title": ""
},
{
"docid": "50d66f90a633abc9ebef728d77b86809",
"score": "0.5381051",
"text": "def get(*args)\n prepare_request(:get, args)\n @@client.add(:get, @path, *args)\n end",
"title": ""
},
{
"docid": "3f3a04df093cd8fc3c1e6dcfa5cda4df",
"score": "0.537431",
"text": "def index\n @decks = current_user.decks\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @decks }\n end\n end",
"title": ""
},
{
"docid": "4e0ecde20ae5c5d27065232369039d89",
"score": "0.53700095",
"text": "def show\n @clientepedido = Clientepedido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clientepedido }\n end\n end",
"title": ""
},
{
"docid": "7033dafcb878866f9c3110c0ad8266d7",
"score": "0.53625876",
"text": "def show\n @dato = Dato.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dato }\n end\n end",
"title": ""
},
{
"docid": "c80b0bb268763b1e9c9319c5ef26a3c5",
"score": "0.5360533",
"text": "def index\n @digital_editions = DigitalEdition.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @digital_editions }\n end\n end",
"title": ""
},
{
"docid": "30b645375c086fb0e53ac93a266b6c97",
"score": "0.53602535",
"text": "def show\n params.require(%i[id])\n render json: Ingredient.find_by!(id: params[:id])\n end",
"title": ""
},
{
"docid": "8cb7eec81b8e7d9b3a58e47f3b1abb6f",
"score": "0.5352841",
"text": "def get(path, query={})\n request_json :get, path, query\n end",
"title": ""
},
{
"docid": "8efe0f2db5ef7a12512b90042016f685",
"score": "0.53517187",
"text": "def show\n @doctor_cliente = DoctorCliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @doctor_cliente }\n end\n end",
"title": ""
},
{
"docid": "922602a48270e5ad00627f59e11aa1b9",
"score": "0.5348964",
"text": "def show\n begin\n @response = Booking.get_booking(params[:id])\n rescue RestClient::Exception => exception\n @error = exception.response\n end\n end",
"title": ""
},
{
"docid": "d117a079a281bbd6f92d333397d108c3",
"score": "0.53467",
"text": "def show\r\n @design_dissertation = DesignDissertation.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @design_dissertation }\r\n end\r\n end",
"title": ""
},
{
"docid": "69de0c4831f7f8f9afc7312f588c8539",
"score": "0.5341923",
"text": "def show\n dog = Dog.find(params[:id])\n render json: dog\n end",
"title": ""
},
{
"docid": "034a57f81f361a1e5bfcf185c511f015",
"score": "0.5341127",
"text": "def show\n @drip = Drip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drip }\n end\n end",
"title": ""
},
{
"docid": "cfcb17e4f2732cc338ab686f48b61803",
"score": "0.53346896",
"text": "def show\n invoice = Invoice.find(params[:id]);\n invoice.docket_list = dockets;\n \n respond_with invoice\n end",
"title": ""
},
{
"docid": "7e5c477627dc88ecf4bcdba40815b258",
"score": "0.5334675",
"text": "def show\n @veiculo = Veiculo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @veiculo }\n end\n end",
"title": ""
},
{
"docid": "2cd4c13b803855902a71e6c5ec683cd8",
"score": "0.5330626",
"text": "def set_dice\n @dice = Dice.find(params[:id])\n end",
"title": ""
},
{
"docid": "2cd4c13b803855902a71e6c5ec683cd8",
"score": "0.5330626",
"text": "def set_dice\n @dice = Dice.find(params[:id])\n end",
"title": ""
},
{
"docid": "2cd4c13b803855902a71e6c5ec683cd8",
"score": "0.5330626",
"text": "def set_dice\n @dice = Dice.find(params[:id])\n end",
"title": ""
},
{
"docid": "8b8f148da7cbe0f5fb3c5c6bcf5ebb08",
"score": "0.5321282",
"text": "def show\n @crate = Crate.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @crate }\n end\n end",
"title": ""
},
{
"docid": "32b07e46150f9593199b83c6d6a7d4ab",
"score": "0.5318581",
"text": "def show\n @drug = Drug.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @drug }\n end\n end",
"title": ""
},
{
"docid": "87b03f2c94f360ff7180b03d547b83ed",
"score": "0.5317749",
"text": "def show\n @lector = Lector.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lector }\n end\n end",
"title": ""
},
{
"docid": "13bdf57538265401bf6fd805508ddbcf",
"score": "0.531553",
"text": "def show\n mix = BreedMix.find(params[:id])\n render json: mix\n end",
"title": ""
},
{
"docid": "e5cc38526646f61e35a7da8ff4bfa212",
"score": "0.53149325",
"text": "def show\n @dtpic = Dtpic.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @dtpic }\n end\n end",
"title": ""
},
{
"docid": "516e085d6f2489c556fdcba1b2f3d2f6",
"score": "0.5314617",
"text": "def show\n @caterer = Caterer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @caterer }\n end\n end",
"title": ""
},
{
"docid": "90b5d8fa91abda83bc532df69c5502cf",
"score": "0.53111756",
"text": "def get(request)\n db.get(id_for(request))\n rescue RestClient::ResourceNotFound\n Puppet.debug \"No couchdb document with id: #{id_for(request)}\"\n return nil\n end",
"title": ""
},
{
"docid": "0b027c5824d7dd007e392e2754b6caa2",
"score": "0.53084385",
"text": "def find(id)\n @api.get(\"api/#{id.to_s}.json\")\n end",
"title": ""
},
{
"docid": "51b78fbe76579145bc96610db2e4ea39",
"score": "0.5306189",
"text": "def show\n @pet = Pet.find_by(id: params[:id])\n if @pet\n render json: @pet\n else\n render json: {}, status: 404\n end\n end",
"title": ""
},
{
"docid": "ca65b3fd162f213e203e88b4863b70b6",
"score": "0.5305712",
"text": "def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"title": ""
},
{
"docid": "ca65b3fd162f213e203e88b4863b70b6",
"score": "0.5305712",
"text": "def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"title": ""
},
{
"docid": "ca65b3fd162f213e203e88b4863b70b6",
"score": "0.5305712",
"text": "def show\n @cliente = Cliente.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cliente }\n end\n end",
"title": ""
},
{
"docid": "c58bad85c9b73a5d33a7062dcd98c090",
"score": "0.5304853",
"text": "def get(path, arguments = {})\n perform_request { connection.get(path, arguments).body }\n end",
"title": ""
},
{
"docid": "a2a5de65e1404c1e74e5da1f0123911e",
"score": "0.5302672",
"text": "def show\n @cake = Cake.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cake }\n end\n end",
"title": ""
},
{
"docid": "a3dfe7b16149492c783c46c1b84e8c5c",
"score": "0.53023726",
"text": "def show\n @species = Specie.find(params[:id])\n\n @pets = Pet.where(:specie_id => @species).all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: {:secie => @species, :pets => @pets } }\n end\n end",
"title": ""
},
{
"docid": "b259cb0392ad14bf89b309f5b2948c71",
"score": "0.53016275",
"text": "def show\n @diet = Diet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @diet }\n end\n end",
"title": ""
},
{
"docid": "7f9676285632ebff4f56af09930cc4aa",
"score": "0.5301061",
"text": "def show\n @idiom = Idiom.find(params[:id])\n @essays = Essay.where(idiom_id: params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @idiom }\n end\n end",
"title": ""
},
{
"docid": "a91f666272ac54f33a8e467b4e6d4053",
"score": "0.5296335",
"text": "def list_tenants_for_circles(args = {}) \n get(\"/tenants.json/circles\", args)\nend",
"title": ""
},
{
"docid": "ea8def58233165e836d8af33a6079012",
"score": "0.5294977",
"text": "def show\n @gold_price = GoldPrice.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @gold_price }\n end\n end",
"title": ""
},
{
"docid": "4a02d06fbf3cb4366c483460cba3cf13",
"score": "0.5294109",
"text": "def show\n @data = @recipe.read(params[:id])\n render json: @data\n end",
"title": ""
},
{
"docid": "ca487f88622c75c49f8a7e30300c79aa",
"score": "0.5293734",
"text": "def view\n if params[:id]\n [client.get(params)]\n elsif params[:scroll]\n scroll_enumerator(client, response)\n else\n response.fetch(\"hits\").fetch(\"hits\")\n end\n end",
"title": ""
},
{
"docid": "b015aab0157fd723b90da1d1c16b9fbd",
"score": "0.52912265",
"text": "def random_drink\n # result = open(\"https://www.thecocktaildb.com/api/json/v1/1/random.php\")\n\n def get_json(url)\n respond = RestClient.get(url)\n JSON.parse(respond)\n end\n\n def get_ingredient\n drink_listing = []\n drink_data = get_json(\"https://www.thecocktaildb.com/api/json/v1/1/random.php\")['drinks'].each {|drink, ingr|ingr}.map {|name| name.values}\n\n drink_name = drink_data[0][1]\n drink_type = drink_data[0][21...35]\n drink_type = drink_type.reject do |data|\n data.empty?\n end.join(\", \")\n \"Your drink is a '#{drink_name}' and it is made from #{drink_type}\"\n # \"It is #{drink_type}\"\n # drink_listing\n end\n puts get_ingredient\n #option to save it to a list???\nend",
"title": ""
},
{
"docid": "228348ab3a051dc6c6d3a12f3795ca2b",
"score": "0.52898145",
"text": "def show\n @serv_adicionale = ServAdicionale.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @serv_adicionale }\n end\n end",
"title": ""
},
{
"docid": "dcdc92b151c24ec717e7491494790d88",
"score": "0.52887785",
"text": "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"title": ""
},
{
"docid": "dcdc92b151c24ec717e7491494790d88",
"score": "0.52887785",
"text": "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"title": ""
},
{
"docid": "dcdc92b151c24ec717e7491494790d88",
"score": "0.52887785",
"text": "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"title": ""
},
{
"docid": "dcdc92b151c24ec717e7491494790d88",
"score": "0.52887785",
"text": "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"title": ""
},
{
"docid": "dcdc92b151c24ec717e7491494790d88",
"score": "0.52887785",
"text": "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"title": ""
},
{
"docid": "dcdc92b151c24ec717e7491494790d88",
"score": "0.52887785",
"text": "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"title": ""
},
{
"docid": "dcdc92b151c24ec717e7491494790d88",
"score": "0.52887785",
"text": "def show\n @client = Client.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @client }\n end\n end",
"title": ""
},
{
"docid": "f134db35f239a2505c8ad4a7183c92fb",
"score": "0.5283439",
"text": "def show\n spread_type = @tenant.tenant_details.pluck(:spread_type).uniq.join(\",\") unless @tenant.tenant_details.nil?\n\n @spread = JSON.parse RestClient.get(\"#{$pim_core_service}/pimcore/api/FoodRecepie/SpreadName?id=\"+spread_type)\n\n \n end",
"title": ""
},
{
"docid": "7464d440138e05dca0bc3425cd3fc9b8",
"score": "0.52831143",
"text": "def drugbank_get(route, params)\n url = $drugbank_api + route\n res = HTTParty.get(url, :query => params, :headers => $drugbank_headers)\n return res\nend",
"title": ""
}
] |
5e240ffae9f78875d2da0fbbbb270b95
|
Returns a boolean indicating whether or not the provided board is solved. The input board will be in whatever form `solve` returns. def solved?(board) end Takes in a board in some form and returns a _String_ that's well formatted for output to the screen. No `puts` here! The input board will be in whatever form `solve` returns. def pretty_board(board) end THESE ARE THE METHODS WE DEVELOPED
|
[
{
"docid": "a0b7432cab8a1dedcc4b6ea184feb707",
"score": "0.0",
"text": "def make_board(input_str)\n board_side_length = 9\n\n board = Array.new(board_side_length) { [ ] }\n\n board_side_length.times.with_index do |x|\n board_side_length.times.with_index do |y|\n next_number = input_str[(x*board_side_length) + y]\n\n board[x] << next_number.to_i\n end\n end\n return board\nend",
"title": ""
}
] |
[
{
"docid": "10c1e05ceda9578a9b4e4c2f1c33eec6",
"score": "0.78276414",
"text": "def solved?(board)\n return true if solve(board)\n false\nend",
"title": ""
},
{
"docid": "68eb91701d4887b104e08350c689a37a",
"score": "0.7419186",
"text": "def solved?(board)\n\t\tif board.include?('0')\n\t \treturn false\n\t else\n\t \treturn true\n\t end\n\tend",
"title": ""
},
{
"docid": "9ca6a1045545f227728b6d2ddff116ea",
"score": "0.7419148",
"text": "def solved?(board)\n partial = false\n return true if board.all? { |row| row.join.chars.sort.join == \"123456789\" } &&\n board.transpose.all? { |col| col.join.chars.sort.join == \"123456789\" } &&\n make_squares_transpose(board).all? { |sq| sq.join.chars.sort.join == \"123456789\" }\n partial\nend",
"title": ""
},
{
"docid": "ae1f56158e682b14a3a5992378f0c43d",
"score": "0.7370162",
"text": "def solved?(board)\nend",
"title": ""
},
{
"docid": "ae1f56158e682b14a3a5992378f0c43d",
"score": "0.7370162",
"text": "def solved?(board)\nend",
"title": ""
},
{
"docid": "ae1f56158e682b14a3a5992378f0c43d",
"score": "0.7370162",
"text": "def solved?(board)\nend",
"title": ""
},
{
"docid": "40e9e319968b343eaa9f032aad67d282",
"score": "0.7337519",
"text": "def solved?(board)\n board.chars.sort.join == SOLUTION\nend",
"title": ""
},
{
"docid": "a84ddabf7caeaf779ac47222c80d8e39",
"score": "0.7184212",
"text": "def solved?(board)\n row_solve?(board) && column_solve?(board)\nend",
"title": ""
},
{
"docid": "a08e013f0a99ac5d5020764d8c0fd498",
"score": "0.71228",
"text": "def solve!\n \tif(solved)\n \t\treturn array_to_string(@board_arr)\n \telse\n \t\treturn 'Uh oh...'\n \tend\n end",
"title": ""
},
{
"docid": "ad1ea14f98bb848393888d071debe7a8",
"score": "0.7106429",
"text": "def solve(board_string)\nend",
"title": ""
},
{
"docid": "ad1ea14f98bb848393888d071debe7a8",
"score": "0.7106429",
"text": "def solve(board_string)\nend",
"title": ""
},
{
"docid": "823c8886c3aaebd4d1b43ca12ea37736",
"score": "0.7020004",
"text": "def solved?(board)\n solve(board).last\nend",
"title": ""
},
{
"docid": "1c4faf49e2ca6728498add7d70adcfd4",
"score": "0.69698066",
"text": "def solve(board)\n sudoku_grid = grid(board)\n solved_board = possibilities(sudoku_grid)\n solved_board.join('')\nend",
"title": ""
},
{
"docid": "123602de0ced59814f1b274f23529bd7",
"score": "0.6916637",
"text": "def solved?\n return true unless board_string.include?(\"0\")\n end",
"title": ""
},
{
"docid": "3c726f85ef5544d36d1e4e82c83db695",
"score": "0.6871221",
"text": "def solved?\n ! @board.include?(0.to_s)\n end",
"title": ""
},
{
"docid": "e7df3241e223f4461d01a34d2bc6c15f",
"score": "0.67563635",
"text": "def solved?\n return false unless @board[-1][-1] == 0\n @board == goal_state\n end",
"title": ""
},
{
"docid": "50b05853cd5c74c75553bd52fb602e9f",
"score": "0.6657063",
"text": "def solve(board)\n solve_with_basic_logic(board)\n solve_with_advanced_logic(board) if !solved?(board)\n solve_with_educated_guessing(board) if !solved?(board)\nend",
"title": ""
},
{
"docid": "26721efa4c07d62613c4708b0ecd4af1",
"score": "0.66201174",
"text": "def solved?\n all_rows_solved?(@public_board) && \n all_cols_solved?(@public_board) && \n all_three_by_three_grids_solved?(@public_board)\n end",
"title": ""
},
{
"docid": "3749fb4b09edce21d542f43bf0bcd28b",
"score": "0.661075",
"text": "def solved\n \tempty, row, col = still_empty?(@board_arr)\n \tif (!empty)\n \t\treturn true\n \tend\n \tfor num in 1..9\n \t\tif(is_valid_slot?(@board_arr, row, col, num.to_s))\n \t\t\t@board_arr[row][col] = num.to_s\n \t\t\tif solved\n \t\t\t\treturn true\n \t\t\telse\n \t\t\t\t@board_arr[row][col]='0'\n \t\t\tend\n \t\tend\n \tend\n \treturn false\n end",
"title": ""
},
{
"docid": "3eb4c847623cb5b11da9fb9db67c1b40",
"score": "0.65980536",
"text": "def solve!\n before = Time.now\n solve_with_recursive_backtracking\n puts \"Not solved!\" if !solved?\n puts \"Solved!\" if solved?\n puts \"Solved this board in: \\n #{Time.now - before}\"\n end",
"title": ""
},
{
"docid": "83d558ae9c6fd97be127e0574cc5d967",
"score": "0.65539443",
"text": "def solved?\n # You will want to know if each row, column, and\n # 3x3 square has been solved.\n # solved_rows? && solved_columns? && solved_squares?\n unless solved_rows?\n puts \"not solved rows\"\n return false\n end\n\n unless solved_columns?\n puts \"not solved columns\"\n return false\n end\n\n unless solved_squares?(0, 2) && solved_squares?(3, 5) && solved_squares?(6, 8)\n puts \"not solved some square\"\n return false\n end\n\n true\n end",
"title": ""
},
{
"docid": "55133317e5cad50b14b5f5b0b8f49495",
"score": "0.65487957",
"text": "def solvable(board)\n # Gets parity and blank position\n parity, blank = get_parity_and_blank(board.flatten)\n\n # Checks based on parity and blank position if it is solvable\n check_parity_and_blank(parity, blank)\n end",
"title": ""
},
{
"docid": "f57a24e0915624d2e625204fad016ed9",
"score": "0.6542996",
"text": "def board\n p \"Below is the solution, actual board displayed in terminal not yet completed...\"\n p @board_string\n end",
"title": ""
},
{
"docid": "2286c8d3dd3704ada7edc39707399537",
"score": "0.65249497",
"text": "def solve(board_string)\n # board = board_string split into 2D array\n board = generate_board(board_string)\n rows_missing = []\n columns_missing = []\n supercells_missing = []\n # row section\n row = 0\n while row < board.length\n rows_missing << missing_numbers(board, row)\n row += 1\n end\n # column section\n column = 0\n while column < board.length\n columns_missing << missing_numbers(board.transpose, column)\n column += 1\n end\n # supercell section\n s_row = 0\n while s_row < board.length\n s_column = 0\n while s_column < board.length\n supercell = supercell_array(board, s_row, s_column)\n s_column += 3\n supercells_missing << missing_numbers(supercell, 0)\n end\n s_row += 3\n end\n supercells_missing_ext = missing_supercell_ext(supercells_missing)\n # compares each of the 3 arrays for each individual box\n row = 0\n while row < board.length\n column = 0\n while column < board.length\n if !\"123456789\".chars.include?(board[row][column])\n board[row][column] = rows_missing[row] & columns_missing[column] & supercells_missing_ext[row][column]\n end\n column += 1\n end\n row += 1\n end\n replace_singles(board)\n replace_with_dash(board)\n if !board.flatten.include?(\"-\")\n p board\n return true\n end\n solve(board.flatten.join)\nend",
"title": ""
},
{
"docid": "a50070e1e0361ad91e5ef5dc28296c68",
"score": "0.6513726",
"text": "def solve\n\t\tif solver?(@cells[0])\n\t\t\t@message = \"Puzzle solved!\"\n\t\telse\n\t\t\t@message = \"No solution found...\"\n\t\tend\n\t\tself.to_s\n\tend",
"title": ""
},
{
"docid": "b3e70704a438563c0c93f63910ab08af",
"score": "0.6438286",
"text": "def solved?(board_array)\n\treturn valid?(board_array) && valid?(board_array.transpose)\nend",
"title": ""
},
{
"docid": "ddd677cd6d37d3906e7370b8f1de372f",
"score": "0.64156234",
"text": "def to_s\n\t \n\t sleep 0.01 # slows down execution\n\t print \"\\e[H\\e[2J\"; # Clear the terminal(UNIX)\n\t\tsystem('cls') # Clear the terminal(Windows)\n\t puts # blank line\n\t \n\t \n\t # Define some presentation elements\n\t border = \"---\" * (@size + @sqrt_size - 1)\n\t inner_border = \" | \"\t\n\t\n\t\n\t\t@board.each do |cell|\n\t\t\t\n\t\t\tif cell.index%(@sqrt_size**3) == 0 and cell.index != 0 # border after every 3rd row not 1st\n\t\t\t\tputs\n\t\t\t\tputs border\n\t\t\telsif cell.index%@size == 0 and cell.index != 0 # new line \n\t\t\t\tputs\n\t\t\telsif cell.index%@sqrt_size == 0 and cell.index%@size != 0 # vertical border every 3rd column, except first \n\t\t\t\tprint inner_border\t\n\t\t\tend\n\t\t\t\n\t\t\t# Finally, add the cell value or a placeholder\n\t\t\tif cell.value\n\t\t\t\tprint \" #{cell.value} \"\n\t\t\telse\n\t\t\t\tprint \" . \"\n\t\t\tend\n\t\t\t\n\t\tend\t\n\t\t\n\t\tputs # new line\n\t\tputs @message\n\n\tend\n\n\n\t\n\tprivate\n\t\t\n\t\n\t# resolve_candidates\n\t# ==================\n\t# Removes the candidate values from each cells neighbours based on the value in each cell object\t\n\t\n\tdef resolve_candidates(cell)\n\t\tputs \"#{cell.index}\"\n\t\tcell.neighbours.each do |i|\n\t\t\n\t\t\t@board[i].delete_candidate(cell.value)\n\t\t\t\n\t\tend\t\t\n\t\t\n\tend\n\t\n\t\n\t# solver(cell)\n\t# ============\n\t# Solves the puzzle using recursive backtracking\n\t\n\tdef solver?(cell)\n\t\n\t\t# Go thru each possible candidate value, evaluating if the selected candidate is\n\t\t# possible for the cell and if the resulting branch solves\n\t\tcell.candidates.each do |candidate|\n\t\t\tcell.try_value = candidate\n\t\t\t@message = \"Testing cell ##{cell.index} with #{candidate}\\n#{cell.candidates} available\"\n\t\t\tself.to_s\n\t\t\t\n\t\t\t# If the current cell is last in the @cells array, check only the validity of the candidate.\n\t\t\tif cell != @cells.last \n\t\t\t\tif candidate_is_valid?(cell) and solver?(next_cell(cell))\n\t\t\t\t\n\t\t\t\t\t# This cell has been solved - set value and return true back up the state space\n\t\t\t\t\t#cell.set_value = candidate\n\t\t\t\t\treturn true\n\t\t\t\t\t\n\t\t\t\telse\t\n\t\t\t\t\t\n\t\t\t\t\t# The cell has not been solved, restore it to nil (it must not affect other decisions)\n\t\t\t\t\tcell.try_value = nil\n\t\t\t\t\t\n\t\t\t\tend\n\t\t\telse\n\t\t\t\tif candidate_is_valid?(cell)\n\t\t\t\t\t# This is the base case where there are no other cells to check, so we can send true\n\t\t\t\t\t# back up the recursion levels \n\t\t\t\t\treturn true\n\t\t\t\telse\n\t\t\t\t\treturn false\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\tend\n\t\t\n\t\t# If all candidates have been evaluated without success, this branch has failed; need to backtrack\n\t\treturn false\n\t\t\t\n\tend\n\t\n\t\n\t# next_cell\n\t# =========\n\t# Returns the next cell from the @cells array\n\t\n\tdef next_cell(cell)\n\n\t\t# Find the index where the current cell occurs in the @cells array\n\t\tidx = @cells.index(cell)\n\t \n\t \t# Return the cell at the next position\n\t \treturn @cells[idx+1]\n\t \n\tend\n\t\n\t\n\t# candidate_is_valid?(cell) \n\t# =========================\n\t# Takes a cell and checks it against it's neighbours, returning false if the value is already \n\t# present in one of the neighbours.\t\t\n\t\t \n\tdef candidate_is_valid?(cell)\n\t\tcell.neighbours.each do |i|\n\t\t\tif @board[i].value == cell.value\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\t\t\n\t\treturn true\n\tend\n\n\t\nend\n\n\n\n# ==================================================================================================\n\n\nclass Cell\n\tattr_accessor :index, :value, :candidates, :neighbours\t\n\t\n\tdef initialize(index, size)\n\t\t@index = index\n\t\t@size = size # the size of the board\n\t\t@sqrt_size = Math.sqrt(@size).to_i\n\t\t@value = nil\n\t\t@candidates = Array.new(@size) { |i| i+1 }\n\t\t@neighbours = []\n\t\tdefine_neighbours\n\tend\n\t\t\n\t\t\n\t# to_s\n\t# ====\n\t# Returns the value of the Cell object\n\t\n\tdef to_s\n\t\treturn @value\n\tend\n\t\n\t\n\t\t# set_value\n\t# =========\n\t# Takes a value which is set as the value for the Cell object, and removes all remaining candidates\n\t\n\tdef set_value=(val)\n\t\t@value = val\n\t\t@candidates.pop(@candidates.length)\n\tend \n\t\n\t# try_value\n\t# =========\n\t# Takes a value which is set as the value for the Cell object; candidates are not changed\n\t\n\tdef try_value=(val)\n\t\t@value = val\n\tend\t\n\t\n\n\t# delete_candidate\n\t# ================\n\t# Takes a value which is deleted from the array of candidates for the Cell object\n\t\t\n\tdef delete_candidate(val)\n\t\t@candidates.delete(val)\n\tend\t\n\t\n\t\n\tprivate \n\t\n\t# position\n\t# ========\n\t# Establishes where a Cell object is in relation to the board\n\t\n\tdef position\n\t\trow = @index/@size\n\t\tcol = @index%@size\n\t\treturn {\"row\"=>row, \"col\"=>col}\n\tend\n\t\n\t# define_neighbours\n\t# =================\n\t# Adds the indices of each cell which is on the same row, column or block as this cell instance.\n\t\n\tdef define_neighbours\n\t\t#ROW\n\t\tfor i in 0..@size-1\n\t\t\tindex = (position['row'] * @size) + i\n\t\t\tadd_neighbour(index)\n\t\tend\n\t\t\n\t\t# COLUMN\n\t\tfor i in 0..@size-1\n\t\t\tindex = position['col'] + (i * @size)\n\t\t\tadd_neighbour(index)\n\t\tend\n\t\t\n\t\t#BLOCK\n\t\tsq_row = position['row']/@sqrt_size\n\t\tsq_col = position['col']/@sqrt_size\n\t\tstarting_index = (sq_row * @size + sq_col) * @sqrt_size\n\t\t\t\n\t\t# Generate differences between top-left index of block and other cells\n\t\tdiffs = []\n\t\tfor i in 0..@sqrt_size-1\n\t\t\tfor j in 0..@sqrt_size-1\n\t\t\t\tdiffs << j + i * @size\n\t\t\tend\n\t\tend\n\t\t\n\t\t# Generate indices of cells in this square and add them to the neighbours array\n\t\tdiffs.each do |diff|\n\t\t\tindex = starting_index + diff\n\t\t\tadd_neighbour(index)\n\t\tend\n\tend\t\n\n\n\t# add_neighbour(index)\n\t# ====================\n\t# Takes an index and adds it to the Cell object's neighbours array, if it is not already there \n\t# or is the index of the Cell object itself\n\t\t\n\tdef add_neighbour(index)\n\t\t@neighbours << index unless @neighbours.include?(index) or @index == index\n\tend\n\t\nend",
"title": ""
},
{
"docid": "373e142c66b1efdf1eb2148871e3be3a",
"score": "0.638816",
"text": "def solved?\n # trivially reject us if we're invalid.\n return false unless self.valid?\n\n # every row must contain (1..9)\n @board.each do |row|\n return false unless row.sort == [1,2,3,4,5,6,7,8,9]\n end\n # every col must contain (1..9)\n @board.transpose.each do |col|\n return false unless col.sort == [1,2,3,4,5,6,7,8,9]\n end\n # every block must containt (1..9)\n 3.times do |by|\n 3.times do |bx|\n block = []\n 3.times do |y|\n 3.times do |x|\n block.push @board[by*3+y][bx*3+x]\n end\n end\n return false unless block.sort == [1,2,3,4,5,6,7,8,9]\n end\n end\n end",
"title": ""
},
{
"docid": "54b682cc73c694af9617aa83e0b8f122",
"score": "0.63519377",
"text": "def solved?(board)\n \n 9.times do |row_id|\n return false if check_row?(board, row_id) == false\n end\n\n 9.times do |column_id|\n return false if check_column?(board, column_id) == false\n end\n\n 9.times do |box_id|\n return false if check_box?(board, box_id) == false\n end\n \n return true \nend",
"title": ""
},
{
"docid": "44a24cd53e4c3b59d1a15888691a55a4",
"score": "0.62562907",
"text": "def solved?(board)\n true_array = []\n board.each do |row|\n true_array << row.sort.join.include?(\"123456789\")\n end\n\n board.transpose.each do |row|\n true_array << row.sort.join.include?(\"123456789\")\n end\n boxes = [\n [[0,0], [0,1], [0,2], [1,0], [1,1], [1,2], [2,0], [2,1], [2,2]],\n [[0,3], [0,4], [0,5], [1,3], [1,4], [1,5], [2,3], [2,4], [2,5]],\n [[0,6], [0,7], [0,8], [1,6], [1,7], [1,8], [2,6], [2,7], [2,8]],\n [[3,0], [3,1], [3,2], [4,0], [4,1], [4,2], [5,0], [5,1], [5,2]],\n [[3,3], [3,4], [3,5], [4,3], [4,4], [4,5], [5,3], [5,4], [5,5]],\n [[3,6], [3,7], [3,8], [4,6], [4,7], [4,8], [5,6], [5,7], [5,8]],\n [[6,0], [6,1], [6,2], [7,0], [7,1], [7,2], [8,0], [8,1], [8,2]],\n [[6,3], [6,4], [6,5], [7,3], [7,4], [7,5], [8,3], [8,4], [8,5]],\n [[6,6], [6,7], [6,8], [7,6], [7,7], [7,8], [8,6], [8,7], [8,8]]]\n boxes.each do |row_locations|\n box_array = []\n row_locations.each do |location|\n box_array << board[location[0]][location[1]]\n end\n true_array << box_array.sort.join.include?(\"123456789\")\n end\n\n return true if !true_array.include?(false)\n\n\n end",
"title": ""
},
{
"docid": "4b54eec9861a93dec80d1aa45191b44f",
"score": "0.62537473",
"text": "def solve(board_string)\n start_board = setup(board_string)\n number_selection = number_set(board_string)\n solution_board = populate_board(start_board, number_selection)\n solution_board\nend",
"title": ""
},
{
"docid": "7db5f47c5328a624659ff938533796c4",
"score": "0.6241957",
"text": "def pretty_board(board)\n board\n end",
"title": ""
},
{
"docid": "a816d28cdc116a0ad4a23ae0d786e534",
"score": "0.62320393",
"text": "def solve\r\n 9.times do |i|\r\n 9.times do |j|\r\n if board[[i,j]] == \"0\"\r\n (1..9).each do |k|\r\n if board.isValid(i, j, k)\r\n board[[i, j]].to(k.to_s)\r\n if solve\r\n return true\r\n end\r\n board[[i, j]] = \"0\"\r\n end\r\n end\r\n return false\r\n end\r\n end\r\n end\r\n return true\r\n end",
"title": ""
},
{
"docid": "9a67d3d08f4a77a4390e610e465bb8b3",
"score": "0.62297326",
"text": "def board\n \tprint_board = array_to_string(@board_arr)\n \tprint_board.split(\"\").each_slice(9) do |row|\n \t\tnew_row = row.map do |cell|\n \t\t\tif (cell == '0')\n \t\t\t\tcell = '_'\n \t\t\telse\n \t\t\t\tcell = cell\n \t\t\tend\n \t\tend\n \tp new_row.join(\" \")\n \tend\n \tif !solved\n \t\tputs 'No solution'\n \telse\n \t\tputs 'Congratulations, your sudoku has now been solved!'\n \tend\n end",
"title": ""
},
{
"docid": "7cfc58d4d82d8f0a5225e6a6bb0eeb2b",
"score": "0.62166893",
"text": "def solve(board)\n board = board.clone # make a local copy, we don't want to modify the actual board\n\n # this is the cell with the fewest possible candidates\n # note that if SudokuBoard#scan solved the board then i = j = candidates = nil\n i, j, candidates = board.scan\n\n if board.solved? # if the board is solved\n puts board # print it\n return\n else # otherwise, there're still empty cells\n # need to resort to brute force\n # take the cell with the smallest no. of possible candidates\n candidates.each do |candidate| # and try each one of them in turn\n board.board[i][j] = candidate # substitute the cell with a candidate\n begin\n # try to recursevely solve the board with the guessed value in place\n # this will either lead to a valid solution or raise an Impossible exception\n return solve(board)\n rescue Impossible # if the board is impossible..\n next # go to the next guess\n end\n end\n\n raise Impossible # none of the guesses worked... go back?\n end\nend",
"title": ""
},
{
"docid": "9221ee088c738f90dae7065f049d2030",
"score": "0.62158626",
"text": "def solved?(board)\n # This will be true if all the elements in the board array are integers. This means that in our possibility array, if we flatten it, it should be completely empty.\nend",
"title": ""
},
{
"docid": "f4995d43b7115b1eb86ff7e9f93266ae",
"score": "0.62142223",
"text": "def print_solution\n puts\n \n # If any keywords were not located, warn the user\n if @keywords.size > 0\n puts \"===WARNING===\"\n puts \"The following keyword(s) were not located:\"\n @keywords.each {|keyword| puts keyword}\n puts\n end\n \n # TODO: Print out pretty solution ex: a t k-e-y-w-o-r-d x b\n @solutions.each {|soln| puts soln.to_s}\n\t\n\t# If the board isn't bigger than a standard console, print it out\n\tif @board.length < 24\n\t\t# Print out what the board looks like to help the user see the solution\n\t\tputs\n\t\tprint_board\n\tend\n end",
"title": ""
},
{
"docid": "58a668dcdb75f2969bced219b6fef98c",
"score": "0.62070316",
"text": "def solved?\n solved_rows? && solved_cols? && solved_squares?\n end",
"title": ""
},
{
"docid": "87ecbe8169689ef8cdaa7a5d89022b6e",
"score": "0.61820024",
"text": "def solve_the_board(k = 0, j = 0)\n # check whether the given board was valid\n return false if !self.valid_board?\n\n forward = true\n while (k <= MAX_ROW_POSITION && j <= MAX_COL_POSITION)\n found = false\n # If the square in the original board was empty\n if @board_indicator[k][j] == 0\n num = @board[k][j] + 1\n while (!found && num <= HIGHEST_DIGIT)\n @board[k][j] = num\n found = self.valid_board?\n num += 1\n end\n \n forward = found\n break if !forward && self.check_if_all_combos_tried(k, j, forward)\n if found \n if j < 8\n j += 1\n else\n j = 0\n k += 1\n end\n else\n @board[k][j] = 0 \n if j > 0\n j -= 1\n else\n j = 8\n k -= 1\n end\n end\n else\n if forward\n if j < 8\n j += 1\n else\n j = 0\n k += 1\n end\n else\n if j > 0\n j -= 1\n else\n j = 8\n k -= 1\n end\n end\n end\n end\n # Check whether a solution was found\n if self.valid_board? && !@board.flatten.include?(0)\n return @board\n else\n return false\n end\n end",
"title": ""
},
{
"docid": "eda060fdc2b48de4e2cf1423d2ac8a89",
"score": "0.61704665",
"text": "def to_s # The function display solved puzzles in the screen.\n board = self.board.join.to_s # It convert the board to a string.\n i = 9\n while i < board.length # Using a loop the board is devided in to 9 lines.\n board.insert(i, \"\\n\")\n i += 10\n end\n i = 1\n while i < board.length # This loop create 2 spaces between each number.\n board.insert(i, \" \")\n i += 3\n end\n board.insert(0, \" \")\n board # Finally The solved puzzle is ready to print.\n end",
"title": ""
},
{
"docid": "d92120baad2d8963f011d12cb82f5c8b",
"score": "0.61695284",
"text": "def print_board(board) \n puts \"+- - - - - - - - - - - - - - - -+\"\n for row in (0..8)\n print \"| \" \n for col in (0..8)\n cell = board[row][col]\n print cell\n print \" |\" if col == 2 || col == 5 || col == 8\n print \" \" if col != 2 || col != 5 \n end\n print \"\\n+- - - - - - - - - - - - - - - -+\" if row == 2 || row == 5 || row == 8\n print \"\\n\" \n end\n # puts \"Solved\" if solved? \nend",
"title": ""
},
{
"docid": "0e4cdaf8115fea4f6767ce17f2cd2326",
"score": "0.61682886",
"text": "def solution?\n board = Board.new(@arr)\n @arr.all? && board.valid?\n end",
"title": ""
},
{
"docid": "6374b015bb751fa7d1a6728223f2c39d",
"score": "0.61640644",
"text": "def solved?(board)\n board.all? { |row| row.flatten.length == 9 }\nend",
"title": ""
},
{
"docid": "33b0e4cd86a92c8f1f2190e92dffb190",
"score": "0.61400086",
"text": "def is_solved?\n for x in 0...9\n arr = []\n for y in 0...9\n arr << @board[x][y].value.to_i\n end\n if !no_dups(arr)\n return false\n end\n end\n\n # checks all columns\n for x in 0...9\n arr = []\n for y in 0...9\n arr << @board[y][x].value.to_i\n end\n if !no_dups(arr)\n return false\n end\n end\n # check nine 3x3 regions\n if !check_all_regions\n return false\n end\n true\n end",
"title": ""
},
{
"docid": "45e59453a02d1e640de492cd7ac35671",
"score": "0.61218446",
"text": "def solve(board_string)\n\tputs board_string\n\tgame_hash = string_to_hash(board_string)\n\treturn hash_to_array(brute_force_iterative_solve(game_hash))\nend",
"title": ""
},
{
"docid": "925c454efc3b914759ca38f598d51736",
"score": "0.61079496",
"text": "def solved?\n # Sufficient because the algorithm doesn't put add any numbers if they're already\n # in a row, column, or box. This means we just need to make sure there are no blank\n # squares. Adding up all numbers in all the rows is sufficient; they cannot add up\n # to 45 if there are blank squares\n @puzzle.reduce {|ans, row| ans &&= (row.reduce {|sum, num| sum += num} == 45)}\n end",
"title": ""
},
{
"docid": "a0ac34f7f3811dbb30bd002420e5d6b1",
"score": "0.60989606",
"text": "def pretty_board(board)\nend",
"title": ""
},
{
"docid": "a0ac34f7f3811dbb30bd002420e5d6b1",
"score": "0.60989606",
"text": "def pretty_board(board)\nend",
"title": ""
},
{
"docid": "a0ac34f7f3811dbb30bd002420e5d6b1",
"score": "0.60989606",
"text": "def pretty_board(board)\nend",
"title": ""
},
{
"docid": "a0ac34f7f3811dbb30bd002420e5d6b1",
"score": "0.60989606",
"text": "def pretty_board(board)\nend",
"title": ""
},
{
"docid": "a0ac34f7f3811dbb30bd002420e5d6b1",
"score": "0.60989606",
"text": "def pretty_board(board)\nend",
"title": ""
},
{
"docid": "e9d6fae6c8ca80f1bdb5c3c9002a75f4",
"score": "0.6097733",
"text": "def solve(i, j, board)\n if i == 9 && j == 0\n # Keep a record of the time of complete.\n endTime = Time.now\n # Output board\n for k in 0..8\n for l in 0..8\n print board[k][l].to_s + \" \"\n end\n puts\n end\n puts \"Time: \" + (endTime - $startTime).to_s\n exit\n else\n # There is blank cell\n if board[i][j] == 0\n # If row i column j is blank\n for n in 1..9\n board[i][j] = n\n if (valid?(i, j, board))\n if j < 8\n solve(i, j + 1, board)\n else\n solve(i + 1, 0, board)\n end\n end\n end\n board[i][j] = 0\n else\n if j < 8\n solve(i, j + 1, board)\n else\n solve(i + 1, 0, board)\n end\n end\n end\nend",
"title": ""
},
{
"docid": "1c3ff1a6243ded4361580b6c23672864",
"score": "0.60867614",
"text": "def solved?\n mark_row, mark_col = *current_mark_pos\n symbol = current_player.symbol\n\n # Check if solved horizontally\n if unique_rows.any? and unique_rows.include? mark_row\n row = play_table[mark_row]\n return true if row.all?{|m| m == symbol }\n\n # Remove row from unique list if no longer unique\n unique_rows.delete(mark_row) if row.compact.uniq.size > 1\n end\n\n # Check if solved vertically\n if unique_columns.any? and unique_columns.include? mark_col\n column = []\n size.times do |i|\n column << play_table[i][mark_col]\n end\n return true if column.all?{|m| m == symbol }\n\n # Remove column unique list if no longer unique\n unique_columns.delete(mark_col) if column.compact.uniq.size > 1\n end\n\n # Check if solved diagonally\n if (mark_row == mark_col || mark_row == size - mark_col - 1) &&\n unique_diags.any?\n # Initialize diagonals with negative and positive gradients\n neg_diag = []\n pos_diag = []\n\n size.times do |i|\n neg_diag << play_table[i][i]\n pos_diag << play_table[size-i-1][i]\n end\n return true if neg_diag.all?{|m| m == symbol } || pos_diag.all?{|m| m == symbol }\n\n # Remove diagonal if no longer unique\n unique_diags.delete(0) if neg_diag.compact.uniq.size > 1\n unique_diags.delete(1) if pos_diag.compact.uniq.size > 1\n end\n\n # Not yet solved\n return false\n end",
"title": ""
},
{
"docid": "ab2bc15eb5294bd9106525c9f1a91283",
"score": "0.6072391",
"text": "def driver()\n puts \"Welcome to Sudoku Puzzle Solver. Please choose an option from the list below:\\n(I)nput a new puzzle.\\nor\\n(S)ee it in action with a default example.\\n\"\n selected_choice = gets.downcase\n \n # Ensures the user gives a proper selection.\n while selected_choice[0] != \"i\" && selected_choice[0] != \"s\"\n puts \"Incorrect input! Please choose from the following:\\n(I)nput a new puzzle.\\nor\\n(S)ee it in action with a default example.\\n\"\n selected_choice = gets.downcase\n end \n\n # Handling the user's selection\n if selected_choice[0] == \"i\"\n puts \"Please input the Sudoku puzzle you want to solve:\"\n puts \"Enter each row of numbers for the puzzle, starting from the top, hitting enter after each row of input.\"\n puzzle_string = \"\"\n for x in 0...9 do # Concatonating the input from in.\n input = gets\n puzzle_string += input\n end\n board = parse_puzzle(puzzle_string)\n else selected_choice[0] == \"s\" # Sets the board to a default random thing I made.\n board = parse_puzzle(\"123456789\\n000000000\\n000000000\\n004000000\\n000000900\\n000000070\\n000800000\\n000000000\\n000000008\\n\")\n end\n if board != false # false is returned from parse_puzzle() when there is a problem with formatting. Error messages are actually printed elsewhere.\n puts \"This is the starting board:\\n\"\n print_pretty_board(board) # Print the starting board.\n\n board = solve(board) # Solve the puzzle.\n\n if board == false # False is returned from solve() only under the condition when the board has an invalid position at the time of input.\n puts \"ERROR: Board has an invalid position at the time of input. The board has no solution.\"\n else # Otherwise we just print the solution to the user.\n puts \"\\nThis is the solution:\\n\"\n print_pretty_board(board)\n end\n end\nend",
"title": ""
},
{
"docid": "28f552cea9b687789100d5c2f0c5ff6f",
"score": "0.6053489",
"text": "def is_solved?(matrix)\n !has_null?(matrix) &&\n rows_solved?(matrix) &&\n columns_solved?(matrix) &&\n diagonals_solved?(matrix)\nend",
"title": ""
},
{
"docid": "ba8b5ad4c86329165f085500687fda39",
"score": "0.60153854",
"text": "def solved?(chall_name, input, output)\n puts input == output ? \"#{chall_name} solved!\" : \"#{chall_name} failed!\"\nend",
"title": ""
},
{
"docid": "7191b290ef6ba5d6418f7c6a0035769a",
"score": "0.6014756",
"text": "def show_solution\n puts show_player_board(@solution)\n puts\n end",
"title": ""
},
{
"docid": "4bb0e71826ae3f07a37ddc2448e22a6d",
"score": "0.6007017",
"text": "def check_for_winner(board = @board)\n\n #horizontal check, will return the symbol\n def four_in_a_row(board)\n board.each do |row|\n a = row.each_cons(4).find {|a| a.uniq.size == 1 && a.first != ' '}\n return true unless a.nil?\n end\n nil\n end\n \n #vertical check\n def four_in_a_column(board)\n four_in_a_row(board.transpose)\n end\n\n #diagonal check that checks bottom left to top right\n def four_ascending(board)\n result = nil\n for c in 0..3 do\n if result\n break\n end\n for r in 3..5 do\n result = board[r][c] == @piece && board[r-1][c+1] == @piece && board[r-2][c+2] == @piece && board[r-3][c+3] == @piece\n if result\n break\n end\n end\n end\n result\n end\n\n #diagonal check that checks top left to bottom right\n def four_descending(board)\n result = nil\n for c in 0..3 do\n if result\n break\n end\n for r in 0..2 do\n result = board[r][c] == @piece && board[r+1][c+1] == @piece && board[r+2][c+2] == @piece && board[r+3][c+3] == @piece\n if result\n break\n end\n end\n end\n result\n end\n\n four_in_a_row(board) || four_in_a_column(board) || four_ascending(board) || four_descending(board)\n\n end",
"title": ""
},
{
"docid": "50b4e1b84f01e404cac0ce4a8517a314",
"score": "0.5997959",
"text": "def seek_solution(board)\n return board if board.is_solved?\n col = board.queen_count\n (0...board.size).each do |row|\n if board.is_pos_valid?(row, col)\n new_board = board.dup\n new_board.place_queen(row, col)\n solution = seek_solution(new_board)\n return solution if solution\n end\n end\n false\nend",
"title": ""
},
{
"docid": "99405aa44449a96cfea718d5d1bb6d54",
"score": "0.5961958",
"text": "def solve(board)\n raise NotImplementedError\nend",
"title": ""
},
{
"docid": "7f87b76ddf07a307cae365ed0f1777cd",
"score": "0.59442914",
"text": "def correct_format?(str)\n str.include?(' ') && in_board?(str.split[0]) && in_board?(str.split[1])\n end",
"title": ""
},
{
"docid": "2bd38ab5428504e3d4eeaa4b4bf51fa4",
"score": "0.59212863",
"text": "def solve_with_recursive_backtracking\n clear_then_display\n next_to_guess = next_zero\n if solved?\n return true\n else\n possible_nums = []\n POTENTIALS.each do |num|\n if check_all(num, next_to_guess)\n board_string[next_to_guess] = num\n if solve_with_recursive_backtracking\n return true\n else\n board_string[next_to_guess] = \"0\"\n end\n end\n end\n end\n false\n end",
"title": ""
},
{
"docid": "21c1f5a74321c72b95f2e8d6c2ff08e2",
"score": "0.5905966",
"text": "def solved?\n # A Sudoku puzzle is finished when all cells have been filled with a number\n # between 1 and 9 and none of the constraints are in conflict.\n\n # First, make sure all the cells are filled.\n @board.each do |row|\n row.each do |cell|\n unless POSSIBLE_VALUES.include? cell.value\n return false\n end\n end\n end\n\n # Next, make sure none of the constraints are in conflict.\n if not consistent?\n return false\n end\n\n return true\n end",
"title": ""
},
{
"docid": "4b836f955e50c56e7ef2248a59f5cd82",
"score": "0.587988",
"text": "def solve(board)\n sudoku_board = convert(board)\n sudoku_board = set_possible_values(sudoku_board)\n until solved?(sudoku_board)\n sudoku_board = logic_guess_loop(sudoku_board)\n solved?(sudoku_board)\n end\n sudoku_board\nend",
"title": ""
},
{
"docid": "5dbff7f014a460b54e0837b571e004ee",
"score": "0.5874447",
"text": "def to_s\n if @formatted_board.join.length > 81\n array_to_format = @formatted_board.map { |row| row.map { |cell| cell.length > 1 ? \"0\" : cell }}\n else\n array_to_format = @formatted_board.flatten\n end\n solution_string = array_to_format.join.gsub(/(\\w{3})\\D{0,1}(\\w{3})\\D{0,1}(\\w{3})/, ' \\1 | \\2 | \\3 '+\"\\n\")\n solution_string = \"----------------\\n\" + solution_string + \"----------------\"\n solution_string.insert(70, \"\\n----------------\")\n solution_string.insert(140, \"\\n----------------\")\n end",
"title": ""
},
{
"docid": "bcc02f663c16ed50cf29f4fb473dbd1a",
"score": "0.5869454",
"text": "def solved?\n\n end",
"title": ""
},
{
"docid": "f04ddbf919f612bb7f6a4a398b4fb561",
"score": "0.5866107",
"text": "def solved?\n\t\tcolSolved = (0...@nCol).all? {|i|\n\t\t\tgetSolverCol(i).solved?\n\t\t}\n\n\t\trowSolved = (0...@nRow).all? {|i|\n\t\t\trowSolved?(i)\n\t\t}\n\n\t\treturn colSolved && rowSolved\n\tend",
"title": ""
},
{
"docid": "1171bbf3c476d3a6a9a5c90f8f75d8d9",
"score": "0.58461857",
"text": "def pretty_board(board)\n board_string = \"\"\n board.each { |row| board_string += row.join(\" \") + \"\\n\" }\n board_string\nend",
"title": ""
},
{
"docid": "bff0e5d332e3605b1d64f6db33d5424f",
"score": "0.58461136",
"text": "def is_a_winner board, player\n\t# Does any row contain 3 marks for this player?\n\t# Check each row. \n\t# You can check each cell in the row,\n\t# But it's faster to join them (as 3 characters) and match a string.\n\tfor row in board\n\t\tif row.join.match(\"#{player}#{player}#{player}\")\n\t\t\treturn true\n\t\tend\n\tend\n\n\t# To compare the columns, simply transpose the matrix and \n\t# check the rows again.\n\tfor row in board.transpose\n\t\tif row.join.match(\"#{player}#{player}#{player}\")\n\t\t\treturn true\n\t\tend\n\tend\n\n\t# Now we check the diagonals. There's no easy way to do this.\n\tif board[0][0]+board[1][1]+board[2][2] == \"#{player}#{player}#{player}\"\n\t\treturn true\n\telsif board[0][2]+board[1][1]+board[2][0] == \"#{player}#{player}#{player}\"\n\t\treturn true\n\tend\n\n\t# If we arrive here, it means no row, column or diagonal matched.\n\t# So the player did not win.\n\treturn false\nend",
"title": ""
},
{
"docid": "f815f80223dcf424a997b765105a6fb1",
"score": "0.58376694",
"text": "def showBoard\n puts \"\\n The right answer is #{@contents.to_s}\\n\"\n end",
"title": ""
},
{
"docid": "4d8382b869ae06112dc41faa77a1342a",
"score": "0.58289284",
"text": "def main\n matrix = [\n [1, 0, 0, 4],\n [10, 0, 8, 5],\n [0, 0, 9, 0],\n [16, 0, 0, 13]\n ]\n\n if solve matrix\n print_arr matrix\n else\n puts 'No answer'\n end\nend",
"title": ""
},
{
"docid": "b28317e7d35b01ba124fcacb498d98e6",
"score": "0.5823914",
"text": "def solve(board_string)\n\n\tfinal_array = convert_to_array(board_string)\n\tguess_array = [1, 2, 3, 4, 5, 6, 7, 8, 9]\n\n\n\t# ______this should remove guesses from the guess array and ___\n\t# ______leave only possible numbers to solve the puzzle _______\n\t\n\tuntil solved?(final_array)\n\t\tguess_array.each do |guesses|\n\t\t\t#removes a guesses from the guest_hash if number is in a cell's current row\n\t\t\tr_list = row_method(guesses, final_array)\n\t\t\t\tguesses.reject! {|guess| r_list.include?(guess)}\n\t\t\t#removes a guesses from the guest_hash if number is in a cell's current column\n\t\t\tc_list = column_method(guesses, final_array)\n\t\t\t\tguesses.reject! {|guess| c_list.include?(guess)}\n\t\t\t# replaces guesses in array if there is only one guess left\n\t\t\tfinal_array[guesses] = guess_array[guesses] if guess_array.length == 1\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "685a92045f36acc21e91f58dcbaf8b88",
"score": "0.580039",
"text": "def old_valid_board?(ary)\n queen_placements = ary.map{|x| x.index(\"Q\")} ## could check duplicates here for fast return\n\n board_as_string = ary.join('').split('')\n\n invalid_spaces = []\n nqueens = ary.size\n\n queen_placements.each_with_index do |q, idx|\n next if q == nil\n board_max = nqueens*nqueens -1\n qplace = idx*nqueens + q\n\n horizontal = (idx*nqueens)...(idx*nqueens+nqueens)\n horizontal = horizontal.to_a\n horizontal.delete(q+(idx*nqueens))\n invalid_spaces = invalid_spaces + horizontal\n\n vertical = []\n nqueens.times{|i| vertical << (q + nqueens*i) }\n vertical.delete(q+(idx*nqueens))\n invalid_spaces = invalid_spaces + vertical\n\n diagonal = []\n\n go_left = (1..q).to_a\n go_left.each do |i|\n top_left = qplace - (nqueens+1)*i\n bottom_left = qplace + (nqueens-1)*i\n diagonal << top_left if top_left >= 0\n diagonal << bottom_left if bottom_left <= board_max\n end\n\n go_right = (1..(nqueens-(q+1)))\n go_right.each do |i|\n top_right = qplace - (nqueens-1)*i\n bottom_right = qplace + (nqueens+1)*i\n diagonal << top_right if top_right >= 0\n diagonal << bottom_right if bottom_right <= board_max\n end\n\n invalid_spaces = invalid_spaces + diagonal\n end\n\n queens_numerical_placement = queen_placements.compact.each_with_index.map{|x,i| i*nqueens + x}\n invalid_spaces.each do |s|\n if queens_numerical_placement.include?(s)\n return false\n end\n end\n\n return true\nend",
"title": ""
},
{
"docid": "6b249d9db757a0e19edeac09a911a93d",
"score": "0.57999706",
"text": "def solve(matrix)\n\tif is_solved matrix\n\t\t# this is the bottom case \n\t\t[matrix]\n\telse\n\t\t# We try every possible number from 1 to 9 if it is a valid move\n\t\t# And call solve with that number\n\t\t# and merge all solutions into one list of boards\n\t\t(1..9).select { |number| is_pos_ok(matrix, free_pos(matrix), number) }\n\t\t\t .map { |num| solve( set_number_at(matrix, free_pos(matrix)[0], num) ) }\n\t\t\t .inject([]) {|sum, el| sum + el}\n\tend\nend",
"title": ""
},
{
"docid": "2c2e8febd9d04f8bb63b7d6a964f770c",
"score": "0.579967",
"text": "def solve\n coords = find_empty\n x, y = coords\n\n return board unless coords\n\n numbers.each do |number|\n if is_valid?(number: number, x: x, y: x)\n board[y][x] = number\n\n if solve\n return board\n end\n\n board[y][x] = 0\n end\n end\n\n false\n end",
"title": ""
},
{
"docid": "6b8944f72e7920b52b4b648a9fff8723",
"score": "0.5798681",
"text": "def print_board(board)\n\tboard_as_string = \"\"\n\tfor x in 0 ... board.size\n\t\tnew_line = \"\"\n\t\tfor y in 0 ... board[x].size\n\t\t\tif board[x][y] == \"\"\n\t\t\t\tnew_line = new_line + \"|\" + \" \" + \"|\"\n\t\t\telse\n\t\t\t\tnew_line = new_line + \"|\" + board[x][y] + \"|\"\n\t\t\tend\n\t\tend\n\t\tnew_line = new_line[1..-2]\n\t\tnew_line = new_line.gsub(\"||\", \"|\")\t\t\t\n\t\tboard_as_string = board_as_string + new_line + \"\\n\"\n\t\tif x < 2\n\t\t\tboard_as_string = board_as_string + \"-----\\n\"\n\t\tend\n\tend\n\treturn board_as_string\nend",
"title": ""
},
{
"docid": "72aa84b52b41d96605bc03b93fc23f10",
"score": "0.5790223",
"text": "def check_board(word)\r\n new_board = []\r\n @board.map{|row| new_board << row.dup}\r\n diagonal = convert_diagonals(new_board)\r\n \r\n if check_rows(@board, word) || check_rows(@board.transpose, word) || check_rows(diagonal, word) || check_rows(diagonal.transpose, word) \r\n true\r\n else\r\n false\r\n end\r\n end",
"title": ""
},
{
"docid": "cab760b6b4cb68f54cad10b90e534cdb",
"score": "0.5783948",
"text": "def solve(board_string)\n # return board if solved?\n\n board = populate_board(board_string)\n i = 1\n while !completed?(board)\n i += 1\n break if i == 10\n board.each do |cell|\n process_cell(board, cell[:id])\n end\n end\n board\nend",
"title": ""
},
{
"docid": "241ede4fce4303c438d474082d6cc243",
"score": "0.5749847",
"text": "def won? board\n # Current board positions\n a = board.instance_variable_get(\"@a\")\n b = board.instance_variable_get(\"@b\")\n c = board.instance_variable_get(\"@c\")\n d = board.instance_variable_get(\"@d\")\n e = board.instance_variable_get(\"@e\")\n f = board.instance_variable_get(\"@f\")\n g = board.instance_variable_get(\"@g\")\n h = board.instance_variable_get(\"@h\")\n i = board.instance_variable_get(\"@i\")\n\n # Winning combinations\n if a == @side\n if b == @side && c == @side; true\n elsif d == @side && g == @side; true\n elsif e == @side && i == @side; true\n end\n elsif b == @side && e == @side && h == @side; true\n elsif c == @side\n if e == @side && g == @side; true\n elsif f == @side && i == @side; true\n end\n elsif d == @side && e == @side && f == @side; true\n elsif g == @side && h == @side && i == @side; true\n else; false\n end\n end",
"title": ""
},
{
"docid": "b0163ab645aa6287ea9799535dc62a45",
"score": "0.5746948",
"text": "def square_solved?(square)\n row_solved?(square.flatten)\n end",
"title": ""
},
{
"docid": "7bc307065e09ace7cd011a587e22dd1f",
"score": "0.57346123",
"text": "def won?\n # Horizontal\n (@board[0] == @board[1] && @board[1] == @board[2] && @board[0] != \" \") ||\n (@board[3] == @board[4] && @board[4] == @board[5] && @board[3] != \" \") ||\n (@board[6] == @board[7] && @board[7] == @board[8] && @board[6] != \" \") ||\n (@board[0] == @board[1] && @board[1] == @board[2] && @board[0] != \" \") ||\n # Vertical\n (@board[0] == @board[3] && @board[3] == @board[6] && @board[0] != \" \") ||\n (@board[1] == @board[4] && @board[4] == @board[7] && @board[1] != \" \") ||\n (@board[2] == @board[5] && @board[5] == @board[8] && @board[2] != \" \") ||\n # Diagonal\n (@board[0] == @board[4] && @board[4] == @board[8] && @board[0] != \" \") ||\n (@board[2] == @board[4] && @board[4] == @board[6] && @board[2] != \" \")\n end",
"title": ""
},
{
"docid": "19a422f41da51a04d2e7fb1243957675",
"score": "0.5733428",
"text": "def solved?\n self.each_cell do |_,_,cell|\n return false if cell == :_\n end\n return true\n end",
"title": ""
},
{
"docid": "c29aca71ffd7ed06635594743927d6b0",
"score": "0.57205606",
"text": "def check_win (board)\n\tbool = false\n\tif board[0] != \" \" && board[0]==board[1] && board[1]==board[2]\n\t\tbool = true\n\telsif board[0] != \" \" && board[0]==board[3] && board[3]==board[6]\n\t\tbool = true\n\telsif board[0] != \" \" && board[0]==board[4] && board[4]==board[8]\n\t\tbool = true\n\telsif board[2] != \" \" && board[5]==board[2] && board[5] == board[8]\n\t\tbool = true\n\telsif board[2] != \" \" && board[2] == board[4] && board[4] == board[6]\n\t\tbool = true\n\telsif board[6] != \" \" && board[6] == board[7] && board[7] == board[8]\n\t\tbool = true\n\telsif board[1] != \" \" && board[1] == board[4] && board[4] == board[7]\n\t\tbool = true\n\telsif board[3] != \" \" && board[3] == board[4] && board[4] == board[5]\n\t\tbool = true\n\telse\n\t\tbool = false\n\tend\n\n\treturn bool\nend",
"title": ""
},
{
"docid": "83a0b0519b1314be975cfb2cca9046be",
"score": "0.5715615",
"text": "def solved?\n @state.solved?\n end",
"title": ""
},
{
"docid": "fd9e769a2805d4c093e59b98ca50ea13",
"score": "0.5706246",
"text": "def won?\n # winners is the 2d array of positions that would win the game\n # top row: horizontal, middle: vertical, bottom: diagonal\n winners = [[0, 1, 2], [3, 4, 5], [6, 7, 8],\n [0, 3, 6], [1, 4, 7], [2, 5, 8],\n [0, 4, 8], [2, 4, 6]]\n winners.each do |line|\n pattern = \"\"\n line.each do |position|\n pattern << grid[position]\n end\n if pattern == \"XXX\" || pattern == \"OOO\"\n return pattern\n end\n end\n return \"\"\n end",
"title": ""
},
{
"docid": "c360bbae00d3ad08735e48d0db904d44",
"score": "0.5702962",
"text": "def solution?\n for i in 0..@board.size-1\n for j in 0..@board[i].size-1\n if @board[i][j]==0\n return false\n end\n end\n end\n return true\n end",
"title": ""
},
{
"docid": "d4dcffcc1e6491f851417ae60849b3b8",
"score": "0.5702925",
"text": "def can_computer_win?(display_in)\n puts \"computer can win???\"\n winner_square = 0\n if winner_square == 0\n puts \"computer can't win yet... First look at rows\"\n winner_square = row_winner_square(display_in, COMPUTER_MARK) \n end\n if winner_square == 0\n puts \"computer can't win yet ... look at cols\"\n winner_square = col_winner_square(display_in, COMPUTER_MARK) \n end\n if winner_square == 0\n puts \"computer can't win yet... so check diagonals\"\n winner_square = diag_winner_square(display_in, COMPUTER_MARK) \n end\n winner_square\n end",
"title": ""
},
{
"docid": "a5209ecc1ab22af8bd4f73644516a0fd",
"score": "0.5698217",
"text": "def solve! ##This needs to work with the finding posibilities\n counter_row = 0\n counter_column = 0\n while ((counter_row < 82) && (counter_column < 82))\n\n #binding.pry\n answer = @comp_board[counter_row][counter_column] - @stack\n\n if answer.length == 1\n @comp_board[counter_row][counter_column] = answer[0].to_i # <- these are whats sposed to be returned\n end\n end\n counter_row += 1\n counter_column += 1\n @comp_board\n end",
"title": ""
},
{
"docid": "715edfddffce007a800051abd5a768ee",
"score": "0.5691296",
"text": "def solved?\n # We're assuming no invalid boards, but that makes this easier.\n # If you make an invalid board then that's ALL YOUR FAULT and I don't care\n # if this is wrong. :)\n @diamonds_foundation.size == 13 && @spades_foundation.size == 13 &&\n @hearts_foundation.size == 13 && @clubs_foundation.size == 13\n end",
"title": ""
},
{
"docid": "36eb0846063ab20689f8f02ed968dccf",
"score": "0.56820893",
"text": "def done?\n @winner = Referee::connect_four?(@board)\n Displayable::display_grid(@board.size, @board.grid, true) if @winner\n @winner || board.full? || aborted?\n end",
"title": ""
},
{
"docid": "b3090a9ad94713a4efe7277c76af1d54",
"score": "0.56799936",
"text": "def solve_puzzle\n puts \"Solve the Puzzle!\"\n @solvethepuzzle = gets.strip.downcase\n if @solvethepuzzle == @currentpuzzle.downcase\n if @score > 0\n puts \"Congratulations!!! YOU WIN!!! Total Prize: $#{@score}\"\n else\n puts \"Your final total was $#{@score}... Oh well. ¯\\_(ツ)_/¯ You tried.\"\n end\n else\n puts \"That's not it, keep playing!\"\n play\n end\n end",
"title": ""
},
{
"docid": "84e71a3a3f99fc8beb1968fc9872400b",
"score": "0.5676643",
"text": "def pretty_board(board)\n array = arrayify(board)\n array_to_board(array)\nend",
"title": ""
},
{
"docid": "621bbcd70e3e3966d08d828b124bb6a9",
"score": "0.56745136",
"text": "def solve\n @board = Board.new(params[:board])\n @board.value = Board.generate_value(@board.value.chomp(','), @board.width, @board.height)\n\n puts 'running the local search'\n\n # height and width flipped since passing the number of blocks not dimensions\n # this just happens to work that way\n solve = (solve_sudoku(@board.value, :xblks => @board.height,:yblks => @board.width));\n\n if solve['error']\n render :json => {:error => solve['error']}\n else\n @sol = Solution.new(:value=>solve['board'])\n @board.solutions << @sol\n # TODO: May want to return the board that was passed in so can check if that's what originally entered?'\n @board.save\n # TODO: make the local search return what the board was if a limit was reached\n solve['board'] = @sol.decode\n render :json => solve\n end\n end",
"title": ""
},
{
"docid": "5e60a3133f0b6fb82433ccd7c676279c",
"score": "0.56686825",
"text": "def check_for_winner\n @@POSSIBLE_WINS.each do |row|\n if @squares[row[0]] == @squares[row[1]] and @squares[row[1]] == @squares[row[2]] and @squares[row[0]] != \"_\"\n return \"#{@squares[row[0]]} wins!\"\n end\n end\n unless @squares.include? \"_\"\n return \"tie\"\n end\n return \"in progress\"\n\n @@POSSIBLE_WINS.each do |row|\n p row\n end\n end",
"title": ""
},
{
"docid": "b472338e04e023d4f912392e9045295b",
"score": "0.5666811",
"text": "def display_board(board)\r\n #accept a board as an argument and\r\n # print out the current state of the board for the user\r\n puts \" #{board[0]} | #{board[1]} | #{board[2]} \"\r\n puts \"-----------\"\r\n puts \" #{board[3]} | #{board[4]} | #{board[5]} \"\r\n puts \"-----------\"\r\n puts \" #{board[6]} | #{board[7]} | #{board[8]} \"\r\nend",
"title": ""
},
{
"docid": "c93d6411e0d38485272298408d41386e",
"score": "0.56611055",
"text": "def pretty_print( puzzle )\n puzzle.each do |line|\n puts line.join(\" \")\n end\nend",
"title": ""
},
{
"docid": "9a31d246b30c2407d39299b9597426c0",
"score": "0.56562096",
"text": "def solved?\n @solved\n end",
"title": ""
},
{
"docid": "6bcaac840d3e8c6044f42222df6f1d59",
"score": "0.5653939",
"text": "def draw?(board)\n if full?(board) == true && won?(board).kind_of?(Array) == false #draw\n puts \"a draw\"\n return true\n elsif full?(board) == false && won?(board).kind_of?(Array) == false # in progress\n puts \"In progress\"\n return false\n elsif won?(board) == true #a win\n puts \"A win\"\n return false\n end\nend",
"title": ""
},
{
"docid": "ecae5cd7080e197f063b949845484fcd",
"score": "0.56520593",
"text": "def solved?\n peg_count = 0\n\n @board.each do |row|\n row.each do |square|\n peg_count += 1 if square == \"x\"\n return false if peg_count > 1\n end\n end\n\n true\n end",
"title": ""
},
{
"docid": "bce44d5394d158842b2fa57757e2b58b",
"score": "0.5649289",
"text": "def over?(board)\n if won?(board)\n puts \"Congratulations #{winner(board)}!\"\n return true\n elsif draw?(board)\n puts \"Cats Game!\"\n return true\n else\n return false\n end\nend",
"title": ""
},
{
"docid": "496d3173975d1babfd1867cc79efe3e8",
"score": "0.56491584",
"text": "def solve(board)\n unsolved_positions = get_unsolved_positions(board)\n\n # This is a simple check to ensure that the initial board isn't invalid from the beginning, causing solve() to run infinitely.\n for row in 0...9 do\n for col in 0...9 do\n number = board[row][col]\n if number != 0\n board[row][col] = 0 # Needed for the way validate_position is implemented.\n if validate_position(board, [row, col], number) == false\n board[row][col] = number # Needed for the way validate_position is implemented.\n puts \"Invalid initial input on row ##{row} and column ##{col}!\"\n return false\n end\n board[row][col] = number # Needed for the way validate_position is implemented.\n end\n end\n end\n\n # unsolved_positions will be unchanged throughout the execution of solve(). \n\n pos_count = 0 # A count variable for going over the unsolved positions.\n\n while pos_count < unsolved_positions.length\n unsolved_row = unsolved_positions[pos_count][0] # Getting the col to check\n unsolved_col = unsolved_positions[pos_count][1] # Getting the row to check\n experimental_number = board[unsolved_row][unsolved_col] + 1 # Getting the number and setting it to 1 by default.\n found = false # A flag to keep track of whether or not we need to backtrack.\n # This while block will increment the experimental_number over and over until it's found a valid position, where it will be set.\n while experimental_number < 10 && found == false # Trying all the numbers, as long as the number is a valid one.\n if validate_position(board, unsolved_positions[pos_count], experimental_number) # If it's a valid place to put the number...\n pos_count = pos_count + 1 # Increment the position count.\n board[unsolved_row][unsolved_col] = experimental_number # Set the value on the board.\n found = true # Trip the found flag.\n else # Otherwise...\n experimental_number = experimental_number + 1 # Increment the number we are brute forcing. \n end\n end\n\n # This while block checks for the condition where the found boolean flag is never tripped via the above while loop.\n if found == false\n pos_count = pos_count - 1 # De-increment count so the focus of the outer while loop goes back to the last position.\n board[unsolved_row][unsolved_col] = 0 # Reset the value of the board space that was being brute-forced.\n end\n end\n \n # The board should be solved at this point in execution.\n return board\nend",
"title": ""
}
] |
ebea1298b608a07c0d94b59d5c15d679
|
Find all nodes for which this node has become a finger in their finger table, and notify them. TODO: Doing this monolithically, all at once, seems expensive maybe this happens asynchronous, over time?
|
[
{
"docid": "368b1e991b8b1368605a96c2c3485970",
"score": "0.50415117",
"text": "def notify\n KeySpace.times do |position|\n do_notify(position)\n end\n end",
"title": ""
}
] |
[
{
"docid": "12e4630f77459cdaa968563702c50d7a",
"score": "0.592446",
"text": "def watch_appropriate_nodes\n remaining_paths.last( threshold + 1 ).reverse_each do |path|\n next if watched_paths.include? path\n watched_paths << path\n finish_node(path) unless zk.exists?(path, :watch => true)\n end\n end",
"title": ""
},
{
"docid": "faf0457addb3ca48a20359b8deceb60c",
"score": "0.5922019",
"text": "def fix_fingers\n @finger_table_index += 1\n @finger_table_index = 1 if @finger_table_index > KeySpace\n @finger_table[@finger_table_index] = find_successor(calculate_finger_position(@nodeid,@finger_table_index))\n\n @finger_table_index\n end",
"title": ""
},
{
"docid": "947ec7b1f1a43ce28511c8ae0688811d",
"score": "0.5492172",
"text": "def update_finger_table(node,position)\n if node != self && between_right_inclusive(node.nodeid,@nodeid,calculate_finger_position(node.nodeid,position))\n @finger_table[position] = node\n end\n end",
"title": ""
},
{
"docid": "3aea6a33fd71b7f50177868be577111d",
"score": "0.54777986",
"text": "def find_reaching_nodes\n @visit = CAN_REACH_TARGET\n for node, count in @parents\n if node.visit == UNVISITED\n node.find_reaching_nodes\n end\n end\n end",
"title": ""
},
{
"docid": "01b2c01d549e7c3fd032e9146b5ba9c4",
"score": "0.5315877",
"text": "def path_finder \n until queue.empty? \n current_node = queue.shift()\n generate_neighbours(current_node)\n current_node.neighbour_nodes.each do |neighbour|\n track_visited(current_node, neighbour)\n correct_node?(neighbour) ? (return neighbour.visited) : (queue << neighbour)\n end\n end\n end",
"title": ""
},
{
"docid": "4dc79672d909d8fd120f6ce84dfda0a7",
"score": "0.5207168",
"text": "def reachable_nodes\n recursive_set(@start) { |n| n.out }\n end",
"title": ""
},
{
"docid": "1f5bd1a1a1ecaaec538ae8178ccf86d7",
"score": "0.51474106",
"text": "def touch\n get_leaf_nodes.each do |leaf|\n leaf.parent.touch\n end\n end",
"title": ""
},
{
"docid": "da14826bdd5954508d532b600b8dc5bc",
"score": "0.5034576",
"text": "def notify_all(notifier_keys)\n Thread.start(notifier_keys) do |keys|\n sleep 1 # let the call to #listen occur\n keys.each do |key|\n DB.run DB[\"NOTIFY #{key.inspect}\"].sql\n end\n end\n end",
"title": ""
},
{
"docid": "57c2538fe43506d71140e8fcccbfb790",
"score": "0.5023001",
"text": "def join(node)\n s,_ = node.find_predecessor(@nodeid) # RPC\n p = nil\n begin\n p = s\n s = p.successor # RPC\n end until between_left_inclusive(@nodeid, p.nodeid, s.nodeid) # RPC\n\n acquire_successors(s)\n @predecessor = p\n s.receive_notification(self) # RPC\n p.receive_notification(self) unless s == p # RPC\n initialize_finger_table(s)\n stabilize\n notify\n s.reallocate_data(p.nodeid, self) # RPC\n end",
"title": ""
},
{
"docid": "2dfa8d749408f5be9098579513345d5e",
"score": "0.5019259",
"text": "def notify_new_traversal\n @item = @queue.shift\n @layers = @item.each\n @layer = @layers.next\n @index = 0\n end",
"title": ""
},
{
"docid": "370910a4cb14d580bdf761a55de06661",
"score": "0.49443206",
"text": "def live_on(live_cells)\n Set.new(live_cells.select { |p| \n stay_alive?(live_neighbor_count(p, live_cells)) })\nend",
"title": ""
},
{
"docid": "9814404c7545596edf7396c5a61f2757",
"score": "0.49193913",
"text": "def find_nodes\n puts '1st pass: find nodes'\n find :nodes\n self\n end",
"title": ""
},
{
"docid": "db164f851d648f0b4a6b7afbc95323cd",
"score": "0.49055523",
"text": "def visit_nodes(node)\n return if node.blank?\n if node.respond_to?(:each) # e.g. a list of nodes from a has_many association\n node.each { |n| visit_nodes(n) }\n else\n class_name = node.class.name\n @hash[class_name] ||= Set.new\n @hash[class_name] << visit(node)\n get_associations(node).each do |assoc|\n @logger.debug(\"Visiting #{assoc.name}\")\n new_nodes = node.send(assoc.name)\n next if new_nodes.blank?\n\n if new_nodes.respond_to?(:find_each)\n new_nodes.find_each { |n| visit_nodes(n) }\n else\n visit_nodes(new_nodes)\n end\n end\n\n end\n end",
"title": ""
},
{
"docid": "0dda2b710b91041d444381b90977c1d5",
"score": "0.49032095",
"text": "def simu_finger_th_wait\n wait_for_thread \"simu_finger_order_th\"\n end",
"title": ""
},
{
"docid": "b99d1d33065597a862a811610d8afc76",
"score": "0.48328903",
"text": "def tasks_in_subtree\n seen = {}\n f = proc do |root|\n unless seen[root]\n seen[root] = root\n for elem in root.deps_o\n f.call(elem)\n end\n end\n end\n f.call(self)\n seen.values\n end",
"title": ""
},
{
"docid": "ed6118a2730d39b9cc371b83ac52e11b",
"score": "0.47766313",
"text": "def bfs_search(root)\n queue = []\n\n root.marked = true\n queue.push(root)\n\n while queue.length != 0\n current = queue.shift\n visit(current)\n\n current.adjacent.each do |node|\n if !node.marked\n node.marked = true\n queue.push(node)\n end\n end\n end\nend",
"title": ""
},
{
"docid": "6850d0b70ae005428ffb9aa4a46a85fa",
"score": "0.47751448",
"text": "def each_touch_reachable_state\n if @touch_reachable.nil?\n # Set to avoid duplicates.\n @touch_reachable = Set[]\n\n player = @players[@turn]\n opponent_num = (@turn + 1) % 2\n opponent = @players[opponent_num]\n\n for player_hand in [Left, Right] do\n for opponent_hand in [Left, Right] do\n if hand_alive?(@turn, player_hand) and\n hand_alive?(opponent_num, opponent_hand)\n op = opponent.clone # because touch modifies it\n State.touch(player, player_hand, op, opponent_hand)\n if @turn == Player1\n @touch_reachable << State.new(player, op, opponent_num, self)\n else\n @touch_reachable << State.new(op, player, opponent_num, self)\n end\n end\n end\n end\n end\n\n @touch_reachable.each { |r| yield r }\n end",
"title": ""
},
{
"docid": "95f82f0725167ba25909031aa1fb9eb6",
"score": "0.47663724",
"text": "def infinite_loops\n reachable_sets = @nodes.group_by(&:forward)\n reachable_sets.each do |reachable,nodes|\n yield reachable if reachable == nodes.to_set\n end\n end",
"title": ""
},
{
"docid": "204c5ac8ad747a06197aa383ebfb469f",
"score": "0.47548473",
"text": "def touch_all\n touch\n _parents.each(&:touch)\n end",
"title": ""
},
{
"docid": "90f4c4082dc9db14800065fdb77c41bc",
"score": "0.47438985",
"text": "def visit(current_node, nodes, list)\n return if %w[permanent temporary].include?(current_node.marked)\n\n current_node.marked = \"temporary\"\n nodes.each { |node| visit(node, nodes, list) if node.from == current_node.to }\n current_node.marked = \"permanent\"\n list.unshift(current_node.from) unless list.include?(current_node.from)\nend",
"title": ""
},
{
"docid": "4a63c60337ea141cb2015427acedae46",
"score": "0.47335878",
"text": "def watch_nodes(opts = {})\n @conn.watch_nodes(opts)\n end",
"title": ""
},
{
"docid": "91b0c8d4c5c8850495856cea56e93f0c",
"score": "0.4732961",
"text": "def assign_mines_touching\n @tiles.flatten.each do |tile|\n neighbors = get_neighbors(tile)\n tile.mines_touching = count_mines_from_neighbors(neighbors)\n end\n end",
"title": ""
},
{
"docid": "f03ab8437641d28cb6f75dc4a9625203",
"score": "0.46869126",
"text": "def _gather_touch_updates(now, field = nil)\n return if touch_callbacks_suppressed?\n\n field = database_field_name(field)\n\n write_attribute(:updated_at, now) if respond_to?(\"updated_at=\")\n write_attribute(field, now) if field\n\n touches = _extract_touches_from_atomic_sets(field) || {}\n touches.merge!(_parent._gather_touch_updates(now) || {}) if _touchable_parent?\n touches\n end",
"title": ""
},
{
"docid": "60cbd7cedf72c11a5b1a272eccbe7d1f",
"score": "0.4686255",
"text": "def poll_nodes\n # clear any list of nodes we already know about and start fresh\n @nodes.clear\n transmit Packet::Poll.new\n end",
"title": ""
},
{
"docid": "09158e0ac58a749d833ddb45571ad2bc",
"score": "0.46798328",
"text": "def reachable\n @vertices.each do |vk, is_up|\n if is_up\n print \"#{vk}\\n\"\n if @edges_up[vk]\n @edges_up[vk].each do |ek, up_too|\n if up_too\n print \" #{ek}\\n\"\n end\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "c4a1270e1b3b66c4b8ff675b5ea4fe60",
"score": "0.46490896",
"text": "def tick!\n to_die = []\n to_live = []\n\n @cells.each do |row|\n row.each do |cell|\n\n # Add up the number of 'alive' neighbouring cells\n live_neighbour_count = neighbours(cell.x, cell.y).select { |n| n.alive? }.count\n\n if cell.alive? and (live_neighbour_count < 2 || live_neighbour_count > 3)\n to_die << cell\n elsif cell.dead? and live_neighbour_count == 3\n to_live << cell\n end\n end\n end\n\n to_die.each { |cell| cell.die! }\n to_live.each { |cell| cell.live! }\n end",
"title": ""
},
{
"docid": "c4f1e393b06c25302aef40a2b7613247",
"score": "0.46216097",
"text": "def collect_node_nei_hashes\n @log.info(\"#{__method__.to_s} started[#{self.class.to_s}]\")\n\n node_nei_hash = @redis_connector.fetch_relations\n end",
"title": ""
},
{
"docid": "5458de0d0f285ab6a2a6530eb0037c56",
"score": "0.46028304",
"text": "def process_all_nodes\n debug 'Start processing all nodes'\n each_node do |node|\n process_node node\n end\n end",
"title": ""
},
{
"docid": "995b1118175f665cf07e96f4f0997117",
"score": "0.4578004",
"text": "def floodfill_tree bn_id, &blk\n info \"Fill #{bn_id}\"\n return bn_id if node_visited?(bn_id)\n _q.push(bn_id)\n\n index = 0\n while _q.length > 0 do\n #bn = blk.call(bn_id)\n bns = Http.get_bns _q\n bns.each do |bn|\n bn_data = get_node_data_from_xml_doc(bn)\n set_node(bn_data)\n children = get_children_from_xml_doc(bn).map do |child_bn| \n get_node_data_from_xml_doc(child_bn)\n end\n children.each do |child|\n #floodfill_tree child[:id], &blk\n _q.push(child[:id])\n add_child bn_data[:id], child[:id]\n end\n ancestors = get_ancestors_from_xml_doc(bn)\n ancestors.each do |parent|\n parent_data = get_node_data_from_xml_doc parent\n #floodfill_tree parent_data[:id], &blk\n _q.push(parent_data[:id])\n add_ancestor bn_data[:id], parent_data[:id]\n # First 2 levels of ancestors are virtual nodes\n # Add them with this request\n current_parent_bn_id = parent_data[:id]\n grandparent = get_ancestors_from_xml_doc(parent)\n while grandparent.length > 0\n # MAybe Bug\n grandparent_data = get_node_data_from_xml_doc parent\n set_node grandparent_data\n add_ancestor current_parent_bn_id, grandparent_data[:id]\n current_parent_bn_id = grandparent_data[:id]\n grandparent = get_ancestors_from_xml_doc(grandparent)\n end\n end\n # a node is visited when all neighbours are visited\n visit_node bn_data[:id]\n end\n info \"To process #{_q.inspect}\"\n _q.reject!{|e| node_visited?(e)}\n info \"To process #{_q.length} node(s)\"\n index += 1\n save if (index%100 == 0)\n end\n save\n end",
"title": ""
},
{
"docid": "7387ac42abce2fea457ec887ae5673e6",
"score": "0.4574621",
"text": "def search(node = @root)\n if node.position == @target\n @target_node = node\n return\n else\n node.connected_knights.each { |knight| search(knight) }\n end\n end",
"title": ""
},
{
"docid": "95fe9d4188e49028914764d1130b1726",
"score": "0.45642152",
"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": "a95193f1f8c98bd811f1fe88d4e2355e",
"score": "0.4561329",
"text": "def bfs(root)\n # NOTE implement real queue for performance\n queue = []\n root.marked = true\n queue.push(root)\n\n while !queue.empty?\n node = queue.shift\n node.visit\n\n node.adjacent.each do |node|\n if node.marked == false\n node.marked = true\n queue.push(node)\n end\n end\n end\nend",
"title": ""
},
{
"docid": "e26bf40d8cfbc6d77c869c7018a94267",
"score": "0.45521384",
"text": "def notify_watchers(comment_id)\n comment = Comment.find comment_id\n\n article_id = comment.article_id\n favs = Favorite.where(favorable_id: article_id)\n uid = comment.user_id\n ids = []\n favs.each do |f|\n i = f.user_id\n next if uid == i or i == 0\n ids << i\n f.updated_at = Time.now()\n f.save!\n end\n end",
"title": ""
},
{
"docid": "3e24ece66c6756d1f62e84148c022ad5",
"score": "0.45512313",
"text": "def pin_true_nodes\n r = []\n @start_nodes.each {|n| n.pin(r) }\n @start_nodes = r\n\n # consisitency check\n @start_nodes.each do |n|\n raise unless n.parents.empty?\n next if n.children.empty?\n raise if n.children.size == 1\n raise if n.children.any? {|cc| cc.pinned }\n end\n\n # remove unused nodes\n @start_nodes.reject! {|n| n.children.empty? }\n end",
"title": ""
},
{
"docid": "86a64aec8a056dc7e316a5ab3e964dd1",
"score": "0.45500413",
"text": "def listen\n @nodes.each { |node|\n node.listen\n }\n self\n end",
"title": ""
},
{
"docid": "7da742da1a5d8428b890adbb14d6c012",
"score": "0.45496038",
"text": "def broadcast_presence\n services = CouchModels::Service.find_all\n users = services.map {|service| service.users }.flatten.uniq\n nodes = users.map {|jid| available(@stream.jid, jid) }\n nodes << services.map do |service|\n service.users.map {|jid| available(service.jid, jid) }\n end\n nodes.flatten!\n @throttle.async_send(nodes)\n end",
"title": ""
},
{
"docid": "ce4e02b5f92102da892e53be986ef6e6",
"score": "0.45410123",
"text": "def node_search\n while (current_node = queue.shift).present? && final.nil?\n @processed += 1\n yield(current_node)\n log \"\\rProcessing #{start.name}.... %d / %d / %d / %d @ %ds - depth: %d\", @unmarked, @requeued, @processed, @steps, (Time.now - @started), current_node.depth\n end\n\n format_results\n save_results if final.present?\n self.final_path\n end",
"title": ""
},
{
"docid": "086581811de7265f27fe6078d9598008",
"score": "0.45408165",
"text": "def free_nodes\n nodes.select(&:is_free?)\n end",
"title": ""
},
{
"docid": "4f0a1f2389f535f9edc6e47ddf0b47b9",
"score": "0.45300207",
"text": "def process_dead_neighbors\n\n @dead_neighbors.each do |dn|\n row, col = dn.split('_') \n dead_cell = Cell.new(row.to_i, col.to_i, false)\n\n dead_cell.neighbors.each do |n_cell|\n if @current_state.include?(n_cell)\n dead_cell.inc_alive_neighbors\n end\n end\n\n if reproduces?(dead_cell)\n dead_cell.alive = true\n future_state[dn] = dead_cell \n end\n end\n end",
"title": ""
},
{
"docid": "4beb39e22c1da83b53a270adcf85e4ee",
"score": "0.45265034",
"text": "def ping_nodes\n\t\twhile true\n\t\t\tsleep(rand(60))\n\t\t\tn = rand(@neighbour_nodes.count)\n\t\t\tnode = @neighbour_nodes[n]\n\t\t\ts = UDPSocket.new\n\t\t\tbegin\n\t\t\t\tTimeout::timeout(10){ \n\t\t\t\t\tputs \"Pinging #{node}\"\n\t\t\t\t\tsend_message [\"PING\", @info], 0, node.host, node.port\n\t\t\t\t\t@waiting = true\n\t\t\t\t\twhile waiting?\n\t\t\t\t\t\tsleep(0.2)\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\trescue Timeout::Error => ex\n\t\t\t\tif waiting?\n\t\t\t\t\tputs \"Conenction to #{node} timed out, sending DROP_NODE to all remaining nodes\"\n\t\t\t\t\t@neighbour_nodes - [node]\n\t\t\t\t\t@neighbour_nodes.each do |n|\n\t\t\t\t\t\tsend_message [\"DROP_NODE\", node], 0, n.host, n.port\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\trescue Socket::Error => ex\n\t\t\t\tputs \"Connection to #{node} failed, trying again in 60 seconds\"\n\t\t\trescue => ex\n\t\t\t\tputs ex.message\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "4d3e8b55321018b86cd38d154900b733",
"score": "0.4507821",
"text": "def process_all_nodes\n debug 'Start processing all nodes'\n hook 'pre_all'\n each_node do |node|\n process_node node\n end\n hook 'post_all'\n end",
"title": ""
},
{
"docid": "8124ee9ff28ccffea702df79430ca149",
"score": "0.45006797",
"text": "def contacts_to_notify(cycles, times_notified)\n # cycles starts at 0, but user generally expects first down event to be cycle 1\n \n to_notify = []\n @contacts.each do |contact|\n next if times_notified[contact['name']].to_i >= contact['upto']\n next if (cycles+1) < contact['after']\n next if (cycles+1 - contact['after']) % contact['every'] != 0\n to_notify << contact['name']\n end\n \n to_notify\n end",
"title": ""
},
{
"docid": "7d4289c09bcd38a7355679436607fa1f",
"score": "0.44857445",
"text": "def connectable_nodes_from(nodes)\n @calls << [:connectable_nodes_from, nodes]\n nodes & @accept_nodes\n end",
"title": ""
},
{
"docid": "5562cc05851eca8d3765c3abaa259265",
"score": "0.4480613",
"text": "def on_if_flag(node)\n children = node.children.dup\n names = children.shift\n state = node.type == :if_flag\n Array(names).each do |name|\n if @run_flag_table[name.to_sym].nil?\n @run_flag_table[name.to_sym] = 1\n else\n @run_flag_table[name.to_sym] += 1\n end\n end\n process_all(node.children)\n end",
"title": ""
},
{
"docid": "02f1aefc67765e26691d2753c132cc8e",
"score": "0.44771254",
"text": "def following_entries\n tree.all_data[(index + 1)..-1]\n end",
"title": ""
},
{
"docid": "a175c288939857743ac979d7688e7631",
"score": "0.44733465",
"text": "def live_neighbours\n self.neighbours.select do |n|\n n && n.is_alive?\n end\n end",
"title": ""
},
{
"docid": "f8c082b0228d14d6dd19c375f28bd457",
"score": "0.44725412",
"text": "def find_neighbors(node)\n nbrs = []\n self.edges.each do |e|\n nbrs.push(e.target) if e.source == node\n nbrs.push(e.source) if e.target == node\n end\n nbrs\n end",
"title": ""
},
{
"docid": "4f41f3f3e83143c4adf3ec1008a202ad",
"score": "0.44519612",
"text": "def refresh(nodes_to_refresh = seeds)\n refreshed_nodes = []\n seen = {}\n # Set up a recursive lambda function for refreshing a node and it's peers.\n refresh_node = ->(node) do\n unless seen[node]\n seen[node] = true\n # Add the node to the global list of known nodes.\n seeds.push(node) unless seeds.include?(node)\n begin\n node.refresh\n # This node is good, so add it to the list of nodes to return.\n refreshed_nodes.push(node) unless refreshed_nodes.include?(node)\n # Now refresh any newly discovered peer nodes - this will also\n # remove nodes that are not included in the peer list.\n refresh_peers(node, &refresh_node)\n rescue Errors::ConnectionFailure\n # We couldn't connect to the node.\n end\n end\n end\n\n nodes_to_refresh.each(&refresh_node)\n refreshed_nodes\n end",
"title": ""
},
{
"docid": "e8276aef938980fc78e672163c022026",
"score": "0.4441953",
"text": "def run( nodes )\n\t\t\tself.log.debug \"Got %d nodes to check with %p\" % [ nodes.length, self ]\n\t\t\tlookups = self.create_lookups( nodes )\n\t\t\treturn self.wait_for_responses( lookups, nodes )\n\t\tend",
"title": ""
},
{
"docid": "5cca6b388c58f0a9278d28cfa33038cd",
"score": "0.4441017",
"text": "def smart_bfs(len, to_get_users = [], to_get_neighbors = [], visited = Set.new)\n sample = []\n i = 0\n while i < len do\n while i < len do\n if to_get_users.empty? then\n break\n end\n # ask Twitter for a chunk of user objects from ids list\n uids = to_get_users.slice!(0..$max_users-1)\n users = get_users(uids)\n p \"got #{users.length} users\"\n sample.concat(users)\n\n # add ids to neighbors todo\n to_get_neighbors.concat( users.map { |u| u.attrs[:id] } )\n i+=users.length\n end\n\n while to_get_users.empty? do\n if to_get_neighbors.empty? then \n return sample\n end\n uid = to_get_neighbors.slice!(0)\n\n next_cursor = -1\n last_index = 0\n next_user_id = 0\n while next_cursor != 0 do\n # get the next page of follower ids\n cur = get_followers_cursor(uid, next_cursor)\n\n # add never-before-seen users to worklist\n newusers = cur[:ids].sselect { |fid| not visited.member?(fid) }\n newusers.each { |u| visited.add(u) }\n to_get_users.concat( newusers ) \n\n # next page index \n next_cursor = cur[:next_cursor]\n end\n end\n end\n \n return sample\nend",
"title": ""
},
{
"docid": "6b0fe493f38ee9bfc3aeb3d92de185da",
"score": "0.44401446",
"text": "def check_marked_circles \n circles.each do |circle|\n if circle.marked?\n update_count_of_marked_circles(circle.position_x, circle.position_y) \n end\n end\n end",
"title": ""
},
{
"docid": "2fe43fbead5f20cb282e176aedf89e33",
"score": "0.44390976",
"text": "def data_successors node\n @data_edges.find_all{ |s,d| s == node }.map{ |s,d| d}\n end",
"title": ""
},
{
"docid": "25a26ccbd00453b7f4e7c85fcc60b7be",
"score": "0.44387832",
"text": "def on_volatile(node)\n results << node\n end",
"title": ""
},
{
"docid": "66d13c5a20006766c8131d81a2bf0c4f",
"score": "0.44380757",
"text": "def touchesBegan(touches, withEvent: event)\n\n # We need to ask the touch for his location according\n # to the current view\n pointInView = touches.anyObject.locationInView(self)\n\n\n touch_at_beginning = false\n\n # Iterate through all the Kanji Paths available\n @kanji_traces.each { | kanji_trace |\n\n # If the touched point is equal to any Kanji Trace starting\n # point\n if CGRectContainsPoint(kanji_trace.initial_rectangle, pointInView)\n\n # Assign the trace that the user is currently\n # drawing\n @current_trace = kanji_trace\n touch_at_beginning = true\n end\n }\n\n\n # If the touch was at the beginning of any Kanji Trace\n if touch_at_beginning\n\n # Add the point to our array, but because is a structure (CGPoint)\n # we need to store it on a NSValue\n @touch_points.addObject(NSValue.valueWithCGPoint(pointInView))\n\n # Ask the view to redraw again\n self.setNeedsDisplay\n\n else\n\n # If there is no touch at the beginning means\n # that the user is not drawing a new trace\n @current_trace = nil\n end\n\n end",
"title": ""
},
{
"docid": "89c4835ed0acfaf6f579ae09d19f3e22",
"score": "0.44359",
"text": "def block_until_node_deleted(abs_node_path)\n queue = Queue.new\n ev_sub = nil\n\n node_deletion_cb = lambda do |event|\n if event.node_deleted?\n queue.enq(:deleted) \n else\n queue.enq(:deleted) unless exists?(abs_node_path, :watch => true)\n end\n end\n\n ev_sub = watcher.register(abs_node_path, &node_deletion_cb)\n\n # set up the callback, but bail if we don't need to wait\n return true unless exists?(abs_node_path, :watch => true) \n\n queue.pop # block waiting for node deletion\n true\n ensure\n # be sure we clean up after ourselves\n ev_sub.unregister if ev_sub\n end",
"title": ""
},
{
"docid": "b65601f4889d77607a1e019c25536306",
"score": "0.44346777",
"text": "def bfs(starting_node, target_value)\n queue = [starting_node]\n checked_nodes = Set.new\n\n until queue.empty?\n current = queue.shift\n unless checked_nodes.include?(current)\n checked_nodes.add(current)\n return current if current.value == target_value\n queue += current.neighbors\n end\n end\n nil\nend",
"title": ""
},
{
"docid": "f9027d89561ca8bfcc6557fa9ede9548",
"score": "0.44329584",
"text": "def refresh_peers(node, &block)\n node.peers.each do |node|\n block.call(node) unless seeds.include?(node)\n peers.push(node) unless peers.include?(node)\n end\n end",
"title": ""
},
{
"docid": "9f6abb998202efaefff2c93caf20ec3b",
"score": "0.44268563",
"text": "def watch_nodes(opts = {})\n core_client.watch_nodes(opts)\n end",
"title": ""
},
{
"docid": "227b1137281b803c3216cc61ec0023a4",
"score": "0.44175267",
"text": "def paths_to(node)\n find_paths do\n find { |n| n == node }\n end\n end",
"title": ""
},
{
"docid": "ae34a19f0ee96e2328809811f5771a98",
"score": "0.44019872",
"text": "def get_registered_nodes\n update_nodes\n @registered_nodes\n end",
"title": ""
},
{
"docid": "fd5dc9f90794e24aa4c30d6ce107a024",
"score": "0.43899244",
"text": "def notify_starting\n\t\tuser_list = []\n\t\tparty_list.each do |uid, uhash|\n\t\t\tuser_list <<= uid if uhash[:status] == STATUS_ATTENDING\t\t\t\n\t\tend\n\t\tnotification = EventNotification.new(NOTIF_EVENT_STARTING, self)\n\t\tnotify(notification, user_list, false)\n\tend",
"title": ""
},
{
"docid": "73b386c78c5ef9fcfef96c54e2c17c26",
"score": "0.4380253",
"text": "def build_sketch_graph\n\t@temp_hop_record = Hash.new\n\t@processed_list = Hash.new\n\t$node_list.each do |n|\n\t\t#Nodes in sketched graph: queries, user_inputs\n\t\t#if n.getInstr.getFromUserInput or (n.isQuery? and n.isWriteQuery?) or (n.getInstr.instance_of?AttrAssign_instr and n.getInstr.getFuncname.index('!') == nil)\n\t\tif n.isQuery? #or n.getInstr.getFromUserInputor isTableAttrAssign(n) \n\t\t\tn.Tnode = TreeNode.new(n)\n\t\t\t$sketch_node_list.push(n.Tnode)\t\n\t\t\t@temp_hop_record[n] = Array.new\n\t\t\t@processed_list[n] = Array.new\n\t\t\t@temp_hop_record[n].push(n)\n\t\tend \n\tend\n\tfor i in 0...$node_list.length\n\t\tadded_edge = false\n\t\tno_changes = true\n\t\t$node_list.each do |n|\n\t\t\tif n.Tnode != nil\n\t\t\t\t@temp_hop_record[n].push(nil)\n\t\t\t\ttemp_node = @temp_hop_record[n].shift\n\t\t\t\tstep = 0\n\t\t\t\twhile temp_node != nil and step < 10000 do\n\t\t\t\t\tstep += 1\n\t\t\t\t\tno_changes = false\n\t\t\t\t\ttemp_node.getDataflowEdges.each do |e|\n\t\t\t\t\t\tif e.getToNode.Tnode != nil and e.getToNode != n\n\t\t\t\t\t\t\tif n.Tnode.hasChildren(e.getToNode.Tnode) == false and (n.getIndex < e.getToNode.getIndex)\n\t\t\t\t\t\t\t\tn.Tnode.addChildren(e.getToNode.Tnode, i)\n\t\t\t\t\t\t\t\t#puts \"\\tAdd edge: #{n.getIndex}:#{n.getInstr.toString} -> #{e.getToNode.getIndex}:#{e.getToNode.getInstr.toString}\"\n\t\t\t\t\t\t\t\tadded_edge = true\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tif e.getToNode != n \n\t\t\t\t\t\t\t\tif @processed_list[n].include?e\n\t\t\t\t\t\t\t\telsif e.getToNode.getIndex < e.getFromNode.getIndex #returnv\n\t\t\t\t\t\t\t\t\te.getToNode.getDataflowEdges.each do |e1|\n\t\t\t\t\t\t\t\t\t\tif e1.getToNode.getIndex > temp_node.getIndex\n\t\t\t\t\t\t\t\t\t\t\t@temp_hop_record[n].push(e1.getToNode)\n\t\t\t\t\t\t\t\t\t\t\t@processed_list[n].push(e1)\n\t\t\t\t\t\t\t\t\t\tend \n\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t@temp_hop_record[n].push(e.getToNode)\n\t\t\t\t\t\t\t\t\t@processed_list[n].push(e)\n\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\t\ttemp_node = @temp_hop_record[n].shift\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tif added_edge\n\t\t\t#puts \"iteration #{i} ||\"\n\t\tend\n\t\tif no_changes\n\t\t\tbreak\n\t\tend\n\tend\n=begin\n\tgraph_write($graph_file, \"digraph sketch {\\n\")\n\t$node_list.each do |n|\n\t\tif n.Tnode != nil\n\t\t\tif n.isQuery?\n\t\t\t\tcolor = \"blue\"\n\t\t\telsif n.getInstr.instance_of?AttrAssign_instr\n\t\t\t\tcolor = \"darkorange\"\n\t\t\telse\n\t\t\t\tcolor = \"crimson\"\n\t\t\tend\n\t\t\tgraph_write($graph_file, \"\\tn#{n.getIndex} [label=<<i>#{n.getIndex}__#{n.getInstr.toString2}</i>> color=#{color}]; \\n\")\n\t\t\tn.Tnode.children.each do |c|\n\t\t\t\tgraph_write($graph_file, \"\\tn#{n.getIndex} -> n#{c.node.node.getIndex} [label=\\\"#{c.dist}\\\"]\\n\")\n\t\t\tend\n\t\tend\n\tend\n\tgraph_write($graph_file, \"}\")\n=end\nend",
"title": ""
},
{
"docid": "ed135bdf222be42aea746dbe2e94099e",
"score": "0.43751615",
"text": "def growing\n new_outer_nodes = []\n @outer_nodes.each do |o_n|\n new_partial_outer_nodes = set_outer_nodes(@neighbors_hash[o_n])\n new_outer_nodes << check_partial_outer_nodes(new_partial_outer_nodes, o_n)\n new_outer_nodes.flatten!\n end\n @outer_nodes = new_outer_nodes.compact\n end",
"title": ""
},
{
"docid": "561908871f55dd1a2e18327cfdd956d2",
"score": "0.43737993",
"text": "def dowalk(mngr,query)\n\n rows = Array.new\n\n count = 0\n\n query.each do |oid|\n start_oid = SNMP::ObjectId.new(oid)\n next_oid = start_oid\n while next_oid.subtree_of?(start_oid)\n begin\n response = mngr.get_next(next_oid)\n varbind = response.varbind_list.first\n rescue\n puts \"[-] error while quering for #{next_oid}\"\n break\n end\n break if not varbind.oid.subtree_of?(start_oid)\n next_oid = varbind.oid\n count += 1\n\n # need to make below values as variables\n # we don't want to cause high CPU on the devices\n rows.push(varbind.value)\n if count >= 100\n sleep 0.1\n puts \"[!] query count reached first limit - slowing down\" if count == 100\n end\n if count >= 1000 \n puts \"[!] query count reached second limit - stopping\"\n break\n end\n end\n end\n\n rows\nend",
"title": ""
},
{
"docid": "3fd0aeea435620ec9d38d65eba829a28",
"score": "0.43732083",
"text": "def find_probe_nodes(velvet_underground_graph, probe_read_ids)\n @bindings ||= Bio::FinishM::VelvetCBinding.new\n\n c_probe_read_ids = FFI::MemoryPointer.new(:int32, probe_read_ids.length)\n c_probe_read_ids.write_array_of_int32(probe_read_ids)\n\n probe_nodes = @bindings.extract_best_probe_reads(\n velvet_underground_graph.internal_graph_struct,\n c_probe_read_ids,\n probe_read_ids.length)\n probe_nodes2 = probe_nodes.read_array_of_int32(probe_read_ids.length).collect{|n| n.abs}.uniq\n\n #clean up\n c_probe_read_ids.free\n\n return probe_nodes2\n end",
"title": ""
},
{
"docid": "63b1e329c3dbc1f06f9b309bc7e5d5a3",
"score": "0.43718565",
"text": "def set_whats_changed\n\n self.post_nodes.each do |post_node|\n if post_node.node.attributes[:_changed]\n post_node.attributes[:_changed] = true\n end\n\n if post_node.node.attributes[:_should_destroy]\n post_node.attributes[:_should_destroy] = true\n end\n end\n\n self.post_thumbs.each do |post_thumb|\n if post_thumb.node.attributes[:_changed]\n post_thumb.attributes[:_changed] = true\n end\n\n if post_thumb.node.attributes[:_should_destroy]\n post_thumb.attributes[:_should_destroy] = true\n end\n end\n\n end",
"title": ""
},
{
"docid": "46d7deb32375a000103f0fb8abdc2580",
"score": "0.43695983",
"text": "def resolve_node_hw_id_collision\n # Get all nodes\n nodes = get_data.fetch_all_objects(:node)\n # This will hold all hw_id's (not unique)'\n all_hw_id = []\n # Take each hw_id and add to our all_hw_id array\n nodes.each { |node| all_hw_id += node.hw_id }\n # Loop through each hw_id\n all_hw_id.each do\n |hwid|\n # This will hold nodes that match\n matching_nodes = []\n # loops through each node\n nodes.each do\n |node|\n # If the hwid is in the node.hw_id array then we add to the matching ndoes array\n matching_nodes << node if (node.hw_id & [hwid]).count > 0\n end\n # If we have more than one node we have a conflict\n # We sort by timestamp ascending\n matching_nodes.sort! { |a, b| a.timestamp <=> b.timestamp }\n # We remove the first one, any that remain will be cleaned of the hwid\n matching_nodes.shift\n # We remove the hw_id from each and persist\n matching_nodes.each do\n |node|\n node.hw_id.delete(hwid)\n node.update_self\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "684a9028600bccef21330581db12cabe",
"score": "0.43681177",
"text": "def chargeVoisins\n for x in 0..(self.lignes-1)\n for y in 0..(self.colonnes-1)\n if (self.get_child_at(x,y).status == 'i')\n\n # DROITE\n for x2 in (x+1).upto(self.lignes-1)\n if (self.get_child_at(x2, y).status == 'i')\n self.get_child_at(x, y).eastNode = self.get_child_at(x2,y)\n break\n end\n end\n\n #BAS\n for y2 in (y+1).upto(self.colonnes-1)\n if (self.get_child_at(x,y2).status == 'i')\n self.get_child_at(x,y).southNode = self.get_child_at(x,y2)\n break\n end\n end\n \n #HAUT\n for y2 in (y-1).downto(0)\n if (self.get_child_at(x,y2).status == 'i')\n self.get_child_at(x,y).northNode = self.get_child_at(x,y2)\n break\n end\n end\n\n # Gauche\n for x2 in (x-1).downto(0)\n if (self.get_child_at(x2,y).status == 'i')\n self.get_child_at(x,y).westNode = self.get_child_at(x2,y)\n break\n end\n end\n end\n end \n end\n\n return self\n end",
"title": ""
},
{
"docid": "bcdf90a4ef970a460150d76bd59efff2",
"score": "0.4355357",
"text": "def traverseNodes(nodes, nextNode)\n tVec = Array.new\n #puts \"***********************\\ntraverseNodes :#{nextNode} \\n_______________________________\\n#{nodes}\\n***********************************\"\n for i in 0..nodes.size\n tmp = nodes[i]\n @xmlTool.setCountToZero()\n at = 0\n #tmpNode = @xmlTool.getHashForNameAtPos(tmp, nextNode, at)\n while ((tmpNode =@xmlTool.getHashForNameAtPos(tmp, nextNode, at) )!= nil)\n at = at.next\n @xmlTool.setCountToZero()\n tVec.push(tmpNode) # alternative is tVec.push(tmpNode)\n #tmpNode = @xmlTool.getHashForNameAtPos(tmp, nextNode, at)\n end\n end\n return tVec\n end",
"title": ""
},
{
"docid": "36061b0eec6f79b0fd904419fde6835b",
"score": "0.4354733",
"text": "def bfs(starting_node, target_value)\n visited = Set.new()\n queue = [starting_node]\n until queue.empty?\n dequeued = queue.shift\n return dequeued if dequeued.val == target_value\n visited.add(dequeued)\n dequeued.neighbors.each do |neighbor|\n queue << neighbor unless visited.include?(neighbor)\n end\n end\n nil\nend",
"title": ""
},
{
"docid": "26b5bd207f795d4768b4946206305809",
"score": "0.4349866",
"text": "def gatherNode(id)\n @nodes.bsearch { |n| n.data == data}\n end",
"title": ""
},
{
"docid": "b4aca7df911d2f59ac66df12c5367a22",
"score": "0.43333462",
"text": "def touch_users\n users.each {|u| u.touch}\n end",
"title": ""
},
{
"docid": "00375b59d8024a869a06b5db89a6c924",
"score": "0.4329767",
"text": "def _run_touch_callbacks_from_root\n return if touch_callbacks_suppressed?\n _parent._run_touch_callbacks_from_root if _touchable_parent?\n run_callbacks(:touch)\n end",
"title": ""
},
{
"docid": "467dcd8f063e3485754c7a56fb25a21e",
"score": "0.43240294",
"text": "def reachable_set(entry)\n reachable = Set.new\n todo = [entry]\n while !todo.empty?\n item = todo.pop\n next if reachable.include?(item)\n reachable.add(item)\n successors = yield item\n successors.each do |succ|\n todo.push(succ)\n end\n end\n reachable\n end",
"title": ""
},
{
"docid": "9c1e520666b11259d3011f95b0d76564",
"score": "0.43190256",
"text": "def process_node_bookmark(xn)\n pull_node(xn)\n flag_match_found\n end",
"title": ""
},
{
"docid": "60ce30d113bbd471aa8fbf0faf9b36b7",
"score": "0.4314172",
"text": "def seek!\n results = {}\n self.nodes.each { |node| results[node] = seek_from_node(node) }\n \n return results\n end",
"title": ""
},
{
"docid": "d4dad552a258dcd6a80895c3f15e333d",
"score": "0.4311257",
"text": "def for_node(*nodeargs)\n xpath, depth, ntype = *nodeargs\n\n return unless xpath\n\n offset = depth ? depth - @depth : 0 \n xpath_regex = ASpaceImport::Crosswalk::regexify_xpath(xpath, offset) \n\n @receivers.each do |p, r| \n yield r if r.receives_node? xpath_regex\n end \n end",
"title": ""
},
{
"docid": "2812c466bd176f53102b4fd3a8309351",
"score": "0.43108284",
"text": "def bfs(starting_node, target_value)\n return starting_node if starting_node.value == target_value\n queue = [starting_node]\n until queue.empty?\n queue += starting_node.neighbors\n queue.each { |neighbor| bfs(neighbor, tar) }\n end\n nil\nend",
"title": ""
},
{
"docid": "53070c4e64a4faa18c6e5d2457684246",
"score": "0.4309605",
"text": "def get_responsible_nodes key\n responsible_hash_keys = []\n if @@dynamo_nodes.size <= ENV['REPLICATION'].to_i\n return @@dynamo_nodes\n end\n responsible_node_key = 0\n previous = 0\n\n sorted_hash_keys = @@dynamo_nodes.sort_by { |_k,v| v.first.second.to_i}.map {|_k,v| v.first.second}\n\n sorted_hash_keys.each do |hash_key|\n #log_message('Comparing key '+key.to_i.to_s+' to hash_key '+hash_key.to_i.to_s)\n if key.to_i <= hash_key.to_i && key.to_i > previous.to_i #key.to_i.between?(previous.to_i,hash_key.to_i)\n responsible_node_key = hash_key\n break\n elsif hash_key.to_i == sorted_hash_keys.last.to_i && hash_key.to_i < key.to_i\n responsible_node_key = sorted_hash_keys.first\n else\n previous = hash_key\n end\n end\n\n sorted_hash_keys.each_with_index do |key, index|\n if key == responsible_node_key\n 3.times.each_with_index { |_e, iterator| responsible_hash_keys << sorted_hash_keys[(index - iterator) % sorted_hash_keys.size]}\n end\n end\n\n @@dynamo_nodes.select { |_k, v| v.first.second.in?(responsible_hash_keys) }\n\n end",
"title": ""
},
{
"docid": "643a52ddcadc2d2b4c7489a19453e0dc",
"score": "0.4307258",
"text": "def depth_first_search\n visited = {}\n timestamp = {}\n tree_edges = {}\n back_edges = {}\n cross_edges = {}\n forward_edges = {}\n count = 0\n\n # begin workaround removing depencency to order of Hash#each\n if @index.empty? then\n preference_of_nodes = nil\n else\n preference_of_nodes = {}.merge(@index)\n i = preference_of_nodes.values.max\n @graph.each_key do |node0|\n preference_of_nodes[node0] ||= (i += 1)\n end\n end\n # end workaround removing depencency to order of Hash#each\n\n dfs_visit = Proc.new { |from|\n visited[from] = true\n timestamp[from] = [count += 1]\n ary = @graph[from].keys\n # begin workaround removing depencency to order of Hash#each\n if preference_of_nodes then\n ary = ary.sort_by { |node0| preference_of_nodes[node0] }\n end\n # end workaround removing depencency to order of Hash#each\n ary.each do |to|\n if visited[to]\n if timestamp[to].size > 1\n if timestamp[from].first < timestamp[to].first\n \t# forward edge (black)\n \tp \"#{from} -> #{to} : forward edge\" if $DEBUG\n \tforward_edges[from] = to\n else\n \t# cross edge (black)\n \tp \"#{from} -> #{to} : cross edge\" if $DEBUG\n \tcross_edges[from] = to\n end\n else\n # back edge (gray)\n p \"#{from} -> #{to} : back edge\" if $DEBUG\n back_edges[from] = to\n end\n else\n # tree edge (white)\n p \"#{from} -> #{to} : tree edge\" if $DEBUG\n tree_edges[to] = from\n dfs_visit.call(to)\n end\n end\n timestamp[from].push(count += 1)\n }\n\n ary = @graph.keys\n # begin workaround removing depencency to order of Hash#each\n if preference_of_nodes then\n ary = ary.sort_by { |node0| preference_of_nodes[node0] }\n end\n # end workaround removing depencency to order of Hash#each\n ary.each do |node|\n unless visited[node]\n dfs_visit.call(node)\n end\n end\n return timestamp, tree_edges, back_edges, cross_edges, forward_edges\n end",
"title": ""
},
{
"docid": "53020e528b4950bb04539440d190cf54",
"score": "0.43010926",
"text": "def knight_moves(start, finish)\n tree = MoveTree.new(start)\n queue = [tree]\n result = nil\n visited_points = Set.new()\n while queue.length > 0\n current_node = queue.shift\n visited_points.add(current_node.point)\n if current_node.point == finish\n result = get_path(current_node)\n break\n else\n propagate_tree(current_node)\n queue += current_node.children.reject { |n| visited_points.include?(n.point) }\n end\n end\n result\nend",
"title": ""
},
{
"docid": "190055cc5f97a04eb05f9ed991c3c6a1",
"score": "0.4292998",
"text": "def bfs(start_node_num)\n node = find_node(start_node_num)\n _clear_visited\n ret_list = [node.value]\n # Your code here\n q = Queue.new\n q << node\n node.visited = true\n\n until q.empty?\n current = q.pop\n current.edges.each do |edge|\n next if edge.node_to.visited\n q << edge.node_to\n edge.node_to.visited = true\n ret_list << edge.node_to.value\n end\n end\n\n return ret_list\n end",
"title": ""
},
{
"docid": "b59c4d62a79ad29ef7e19e350ca252f7",
"score": "0.42919084",
"text": "def on_run_flag(node)\n children = node.children.dup\n names = children.shift\n state = children.shift\n Array(names).each do |name|\n if @run_flag_table[name.to_sym].nil?\n @run_flag_table[name.to_sym] = 1\n else\n @run_flag_table[name.to_sym] += 1\n end\n end\n process_all(node.children)\n end",
"title": ""
},
{
"docid": "a6fcb15af0b17d6a192aa9be0eb73bcb",
"score": "0.42875344",
"text": "def broadcast_check_for_hunts!\n @account.self_and_all_descendant_customers.find_each do |customer|\n ServiceRunnerJob.perform_later(\n \"DeviceBroadcasts::Customer\",\n customer,\n { type: \"hunts\", payload: {} }.to_json\n )\n end\n end",
"title": ""
},
{
"docid": "189e1291da6a4964cf213abd63af15d8",
"score": "0.42828184",
"text": "def bfs(target_pos) #this is called on the root node \n tar_x, tar_y = target_pos \n\n arr = [self]\n\n until arr.empty?\n current_check = arr.shift \n return current_check if current_check.root_node == target_pos\n arr.concat(current_check.children)\n end\n nil\n end",
"title": ""
},
{
"docid": "d8936b69b14a238ab134dd7173cb89e7",
"score": "0.42682302",
"text": "def notify_followers_if_necessary\n if state == MERGE_STATE['merge']\n notify_followers(jingle.id, child_jingle.user.id)\n end\n end",
"title": ""
},
{
"docid": "d55e096f2609b826b9de1e2761baa28e",
"score": "0.42678905",
"text": "def notify_users_and_add_it\n return # disabled for now\n return true if remote?\n User.find_all_by_notify_on_new_torrents(true).each do |user|\n Notifier.send_new(user,self) if user.notifiable_via_jabber?\n user.watch(self) unless user.dont_watch_new_torrents?\n end\n end",
"title": ""
},
{
"docid": "1daf785e95e869003fb732215f842d32",
"score": "0.42672825",
"text": "def find_cycles(start_node)\n work_queue = [{:action => :check_node, :path => Path.new(start_node)}]\n cycles_found = []\n\n while !work_queue.empty?\n task = work_queue.shift\n\n if task[:action] == :whitelist_node\n # We've checked all children of this node, so it's acyclic and doesn't\n # need to be checked again.\n @whitelisted_nodes[task[:node]] = true\n next\n end\n\n # Otherwise, we're being asked to check a node\n task[:action] == :check_node or raise \"Not sure what to do with #{task}\"\n\n path_to_check = task[:path]\n\n if path_to_check.contains_cycle?\n # Found one!\n cycles_found << path_to_check\n next\n elsif @whitelisted_nodes[path_to_check.node]\n # We've visited this node before, so no need to recheck it\n next\n end\n\n # Once this node's dependencies have been checked, we can whitelist this\n # node to avoid further checking. Since we're doing a depth-first search,\n # we add the whitelist action first.\n work_queue.unshift({:action => :whitelist_node, :node => path_to_check.node})\n\n # Add this node's dependencies to our list of nodes to check\n Array(@graph[path_to_check.node]).each do |dependency|\n work_queue.unshift({:action => :check_node,\n :path => path_to_check.next_node(dependency)})\n end\n end\n\n cycles_found\n end",
"title": ""
},
{
"docid": "9f36a85ddf0ed4914b0533bbda2e56a4",
"score": "0.42672613",
"text": "def edges(nodes, tweets)\n tweets.each do |tweet|\n node = nodes[tweet.user_name]\n node.mentions.merge(tweet.mentions.collect {|name| nodes[name]})\n tweet.mentions.each do |mention|\n nodes[mention].mentioned_by << node if nodes[mention]\n end\n end\n end",
"title": ""
},
{
"docid": "1d10db1422d5151dd1132a59170539d9",
"score": "0.42664802",
"text": "def backtrack!(nodes)\n while true\n return nil if nodes.empty? # backtracked back to 0, so we are done\n \n # We tried nodes.last and it didn't work, so\n # pop it off and uncover the corresponding columns.\n node = nodes.pop\n node.unchoose_except_self_column\n \n # Try the next node in this column.\n x = node.down\n\n return x unless x.is_a? Column\n \n # Our downwards iteration has gone full-circle\n # back to the column object where it started.\n x.uncover # Uncover the column.\n end\n end",
"title": ""
},
{
"docid": "921352138fee1061720f1156a7039a10",
"score": "0.42642108",
"text": "def resolve_dependencies\r\n @nodes.each do |node|\r\n puts \"processing #{node}\"\r\n\r\n node.outgoing_dependencies do |dependency|\r\n providers = nodes_satisfying(dependency.target)\r\n node.add_dependency(dependency, providers)\r\n end\r\n \r\n node.dependencies.values.each { |vals| vals.sort! }\r\n end\r\n end",
"title": ""
},
{
"docid": "9f4ab0f99197b8500fd602c98c61fbec",
"score": "0.42564756",
"text": "def bfs(starting_node, target_value)\n queue = [starting_node]\n visited = Set.new()\n\n starting_node.neighbors.each do |neighb_nodes|\n\n return queue.first.value if queue.first.value == target_value\n\n visited.add(queue.shift) \n\n queue.push(neighb_nodes) unless visited.include?(neighb_nodes)\n \n end\n nil\nend",
"title": ""
},
{
"docid": "e5b7ff9e044325cba25d15494c21c926",
"score": "0.42516634",
"text": "def live_neighbours_around_cell(cell)\n live_neighbours = []\n\n #check top cell\n if cell.x_axis > 0\n # puts \"Cell dimen1: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis - 1][cell.y_axis]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n #check right cell\n if cell.y_axis < (columns-1)\n # puts \"Cell dimen2: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis][cell.y_axis + 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n #check left cell\n if cell.y_axis > 0\n # puts \"Cell dimen3: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis][cell.y_axis - 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check bottom cell\n if cell.x_axis < (rows-1)\n # puts \"Cell dimen4: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis + 1][cell.y_axis]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check top left\n if cell.x_axis > 0 and cell.y_axis > 0\n # puts \"Cell dimen5: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis - 1][cell.y_axis - 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check top right\n if cell.x_axis > 0 and cell.y_axis < (columns-1)\n # puts \"Cell dimen6: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis - 1][cell.y_axis + 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check bottom left\n if cell.x_axis < (rows - 1) and cell.y_axis > 0\n # puts \"Cell dimen7: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis + 1][cell.y_axis - 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n # #check bottom right\n if cell.x_axis < (rows - 1) and cell.y_axis < (columns - 1)\n # puts \"Cell dimen8: #{cell.x_axis}:#{cell.y_axis}\"\n candidate = self.cell_grid[cell.x_axis + 1][cell.y_axis + 1]\n # puts \"Candidate #{candidate.inspect}\"\n live_neighbours << candidate if candidate.alive?\n end\n live_neighbours\n end",
"title": ""
},
{
"docid": "88f4938619f356fec018e672ed9372b7",
"score": "0.4249671",
"text": "def observe_changes(from_root)\n affected_paths = Set.new\n sentinel_path = File.join(from_root, SENTINEL)\n\n # if the directory was recently created, it *seems* like it needs to\n # actually be written out before we start the watch, otherwise we don't\n # receive any events.\n #\n # Unfortunately, sync(3) is a slow/expensive operation and a\n # newly-created direcotry is probably not the most common use-case. As a\n # compromise, we sync(3) only if the directory appears to have been\n # created in the past few seconds.\n if (Time.now - File.stat(from_root).ctime) < 5\n Kernel.syscall(SYS_SYNC)\n end\n\n fsevent = FSEvent.new\n fsevent.watch(from_root, file_events: true, latency: LATENCY) do |paths, meta|\n done = false\n meta['events'].each do |evt|\n # Don't track directories. We could change this...\n next if evt['flags'].include?(ITEM_IS_DIR)\n path = evt['path']\n # Because macOS delivers these events with a configurable latency, we\n # have to wait for it to flush its pipeline before we can escape from\n # the run loop, so we push this sentinel event after invoking the\n # block. We know we're done when we receive it.\n if path.end_with?(SENTINEL)\n done = true\n else\n affected_paths << path\n end\n end\n raise Interrupt if done\n end\n thr = Thread.new { fsevent.run }\n # If we yield before the handler is set up, early events will be\n # discarded.\n sleep 1e-6 until fsevent.instance_variable_get(:@running)\n\n yield\n\n # Once the thread recieves the event for the sentinel_path, it will\n # return, and #join will return.\n FileUtils.touch(sentinel_path)\n thr.join\n File.unlink(sentinel_path) # clean up\n\n affected_paths\n end",
"title": ""
},
{
"docid": "7a4aed55cd6baa07c531ca833f54d6f1",
"score": "0.42462906",
"text": "def deadend_nodes\n return enum_for(:deadend_nodes) if not block_given?\n @nodes.each { |n| yield n if n.out.empty? }\n end",
"title": ""
},
{
"docid": "7c65bcbf6445a9c2a61be0bcd30b4ce0",
"score": "0.42455998",
"text": "def tracking\n # @@neo = Neography::Rest.new\n self_node = self.get_node\n if self_node\n trackers = []\n begin\n trackers_list = self_node.outgoing(:friends).map{ |n| [n.object_type, n[:object_id]] }\n trackers_list = trackers_list.group_by{|x| x[0]}\n trackers_list.each do |tracker_type|\n tracker_ids = tracker_type[1].map{|u|u[1]}\n trackers << tracker_type[0].safe_constantize.where(id: tracker_ids).try(:to_a)\n end\n rescue Exception\n end\n\n return trackers.flatten\n else\n return []\n end\n end",
"title": ""
},
{
"docid": "f34152e363cb70d30cbca467b9ec1414",
"score": "0.4242896",
"text": "def search root, target\n queue = [root]\n\n until queue.empty?\n current = queue.shift\n return current if current.x == target.x && current.y == target.y\n\n current.make_children.each { |child| queue << child }\n end\nend",
"title": ""
},
{
"docid": "110b79e4e80f8056dd25d2c40484c36b",
"score": "0.42365152",
"text": "def process_child_nodes(node); end",
"title": ""
},
{
"docid": "68b47eecf6f5f1dc2850a9caa67d4596",
"score": "0.4222431",
"text": "def bft(&block)\n queue = Queue.new\n \n # Set all nodes to not enqueued\n self.each do |node|\n node.enqueued = false\n end\n\n queue.push(self) \n self.enqueued = true\n\n while(queue.size > 0)\n # Get next node in the queue\n node = queue.pop\n \n # Pass node off to block\n block.call(node)\n\n # Enqueue all children nodes\n node.child_array.each do |child|\n if !child.enqueued\n queue.push(child)\n child.enqueued = true\n end\n end\n\n end #while\n end",
"title": ""
},
{
"docid": "6137dcff6f0b96237bb7bcb214033ef5",
"score": "0.42200318",
"text": "def notify_flagged(cell); end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "518b4fd6ab05bfdf31bf8932b6f7bb00",
"score": "0.0",
"text": "def set_user\n @user = User.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60326946",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6015941",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.59229624",
"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.59169936",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.59169936",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.5899037",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5889287",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58890367",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58890367",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.58890367",
"text": "def actions; end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.5877498",
"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.5862599",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.5810375",
"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.5740072",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.57316417",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.5718692",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.5700777",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.5692726",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.5668117",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.56531155",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.565059",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.56384724",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.5625417",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.56102014",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5596785",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.5596253",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.55899394",
"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.5557985",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.5557985",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.55090857",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.55058104",
"text": "def assign_default_callbacks(action_name, is_member=false)\n if ResourceController::DEFAULT_ACTIONS.include?(action_name)\n DefaultActions.send(action_name, self)\n elsif is_member\n send(action_name).build { load_object }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => object }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { render :xml => object.errors }\n else\n send(action_name).build { load_collection }\n send(action_name).wants.html\n send(action_name).wants.xml { render :xml => collection }\n send(action_name).failure.flash \"Request failed\"\n send(action_name).failure.wants.html\n send(action_name).failure.wants.xml { head 500 }\n end\n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.54677796",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "dcf95c552669536111d95309d8f4aafd",
"score": "0.5465028",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "e3aadf41537d03bd18cf63a3653e05aa",
"score": "0.5448835",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.5447902",
"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": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.54402983",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54168683",
"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.5411516",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.5411516",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.5400121",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5395004",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.5395004",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.5392725",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.53884417",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53783494",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.53593004",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53494495",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.5349437",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.53471607",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.53441674",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5342784",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53281486",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53036916",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.528415",
"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.52831894",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.5258319",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.5256983",
"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.52521855",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.52472556",
"text": "def action_awareness\n if action_aware?\n if !@options.key?(:allow_nil)\n if @required\n @allow_nil = false\n else\n @allow_nil = true\n end\n end\n if as_action != \"create\"\n @required = false\n end\n end\n end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.52398384",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52376497",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52376497",
"text": "def action; end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.52329665",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.5229699",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "6350959a62aa797b89a21eacb3200e75",
"score": "0.5225785",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.52239066",
"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": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.5219224",
"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": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.52147436",
"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": "8d7ed2ff3920c2016c75f4f9d8b5a870",
"score": "0.52146924",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "78ecc6a2dfbf08166a7a1360bc9c35ef",
"score": "0.5211636",
"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.52089876",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.5206151",
"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": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.5204869",
"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.520361",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5201687",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.5198511",
"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.5198511",
"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.51926094",
"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.5181837",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.5178642",
"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.5173357",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5173357",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5173357",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.51642865",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.5153578",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.51448536",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.5142863",
"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": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.51412",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "2fcff037e3c18a5eb8d964f8f0a62ebe",
"score": "0.5139861",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.5134318",
"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.51167125",
"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.5115634",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.51111007",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5109693",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5109693",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5109693",
"text": "def action\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.5106379",
"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.510497",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.51013684",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.5096925",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.5093146",
"text": "def config(action, *args); end",
"title": ""
}
] |
8d177d6a61194d87a350ba5ad5098c2b
|
Gets the marker shape. ==== Description See setMarkerShape for a list of strings that can be returned ==== Syntax markerShape name ==== Parameters +name+ String ==== Returns String ==== Multiplayer ==== See Also Official Wiki: ==== Examples ====== Example 1: (example)
|
[
{
"docid": "84f9cfeed520f0dcc00d42433717fb5e",
"score": "0.6482316",
"text": "def markerShape _args\n \"markerShape _args;\" \n end",
"title": ""
}
] |
[
{
"docid": "c553bd472f658bdcc56ca6f9fc8935dd",
"score": "0.5681211",
"text": "def geoObject()\n return @shape ;\n end",
"title": ""
},
{
"docid": "4b6912a2d2b40a8de1760e568a34afda",
"score": "0.56372476",
"text": "def shape\n=begin\n\t\tgeometries = Rails.cache.fetch(MEMORY_CACHE_KEY_SHAPE.gsub(\"[shape_id]\", params[:id])\n\t\t\t\t.gsub(\"[locale]\", I18n.locale.to_s)\n\t\t\t\t.gsub(\"[shape_type_id]\", params[:shape_type_id])) {\n\t\t\tShape.build_json(params[:id], params[:shape_type_id]).to_json\n\t\t}\n=end\n\t\tkey = FILE_CACHE_KEY_SHAPE.gsub(\"[shape_id]\", params[:id])\n\t\t\t.gsub(\"[locale]\", I18n.locale.to_s)\n\t\t\t.gsub(\"[shape_type_id]\", params[:shape_type_id])\n\t\tgeometries = JsonCache.fetch_shape(key) {\n \t\tShape.build_json(params[:id], params[:shape_type_id]).to_json\n\t\t}\n\n respond_to do |format|\n format.json { render json: geometries }\n end\n end",
"title": ""
},
{
"docid": "1262404227a2a415cf25cf69f8bcd583",
"score": "0.54538274",
"text": "def shape(input, name: nil, out_type: :int32)\n _op(:shape, input, nil, name: name, out_type: out_type)\n end",
"title": ""
},
{
"docid": "49084425fcbe5d563e5d42f5dde16ba2",
"score": "0.5422636",
"text": "def genShapeJson()\n shape = [] ;\n @shape.pointList.each{|point|\n pos = [point.x, point.y] ;\n shape.push(pos) ;\n }\n return shape ;\n end",
"title": ""
},
{
"docid": "ca9da6d54b876bf5ad0be5df4dbcebc2",
"score": "0.5383458",
"text": "def display_shape_name(shapeType)\n\tcase shapeType\n\twhen :square then puts \"I am a square\"\n\twhen :circle then puts \"I am a circle\"\n\twhen :rectangle then puts \"I am a rectangle\"\n\tend\nend",
"title": ""
},
{
"docid": "92c06dc666d666e22e16b33e56ad0ffa",
"score": "0.52728266",
"text": "def get_shape_geometry_path(name, slide_index, shape_index, password = nil, folder = nil, storage = nil)\n data, _status_code, _headers = get_shape_geometry_path_with_http_info(name, slide_index, shape_index, password, folder, storage)\n data\n end",
"title": ""
},
{
"docid": "54e9793775e95846ee230ef5e21787eb",
"score": "0.51426655",
"text": "def get_marker_properties(marker) # :nodoc:\n return unless marker\n\n types = {\n :automatic => 'automatic',\n :none => 'none',\n :square => 'square',\n :diamond => 'diamond',\n :triangle => 'triangle',\n :x => 'x',\n :star => 'start',\n :dot => 'dot',\n :short_dash => 'dot',\n :dash => 'dash',\n :long_dash => 'dash',\n :circle => 'circle',\n :plus => 'plus',\n :picture => 'picture'\n }\n\n # Check for valid types.\n marker_type = marker[:type]\n\n if marker_type\n marker[:automatic] = 1 if marker_type == 'automatic'\n marker[:type] = value_or_raise(types, marker_type, 'maker type')\n end\n\n # Set the line properties for the marker..\n line = get_line_properties(marker[:line])\n\n # Allow 'border' as a synonym for 'line'.\n line = get_line_properties(marker[:border]) if marker[:border]\n\n # Set the fill properties for the marker.\n fill = get_fill_properties(marker[:fill])\n\n marker[:_line] = line\n marker[:_fill] = fill\n\n marker\n end",
"title": ""
},
{
"docid": "92520f3878b9fd86ac73046ef123b217",
"score": "0.5106867",
"text": "def get_shape_geometry_path_with_http_info(name, slide_index, shape_index, password = nil, folder = nil, storage = nil)\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SlidesApi.get_shape_geometry_path ...'\n end\n\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling SlidesApi.get_shape_geometry_path\"\n end\n # verify the required parameter 'slide_index' is set\n if @api_client.config.client_side_validation && slide_index.nil?\n fail ArgumentError, \"Missing the required parameter 'slide_index' when calling SlidesApi.get_shape_geometry_path\"\n end\n # verify the required parameter 'shape_index' is set\n if @api_client.config.client_side_validation && shape_index.nil?\n fail ArgumentError, \"Missing the required parameter 'shape_index' when calling SlidesApi.get_shape_geometry_path\"\n end\n # resource path\n local_var_path = '/slides/{name}/slides/{slideIndex}/shapes/{shapeIndex}/geometryPath'\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'name', name)\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'slideIndex', slide_index)\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'shapeIndex', shape_index)\n\n # query parameters\n query_params = {}\n query_params[:'folder'] = @api_client.prepare_for_query(folder) unless folder.nil?\n query_params[:'storage'] = @api_client.prepare_for_query(storage) unless storage.nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'password'] = password unless password.nil?\n\n # http body (model)\n post_body = nil\n\n # form parameters\n post_files = []\n\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :body => post_body,\n :files => post_files,\n :auth_names => auth_names,\n :return_type => 'GeometryPaths')\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "888e1449e261db94d23a3e0dfa7b6fce",
"score": "0.5077806",
"text": "def get_marker\n return @marker\n end",
"title": ""
},
{
"docid": "888e1449e261db94d23a3e0dfa7b6fce",
"score": "0.5077806",
"text": "def get_marker\n return @marker\n end",
"title": ""
},
{
"docid": "888e1449e261db94d23a3e0dfa7b6fce",
"score": "0.5077806",
"text": "def get_marker\n return @marker\n end",
"title": ""
},
{
"docid": "1b5bae5917733c23054d40bf58c6e1eb",
"score": "0.5062048",
"text": "def get_marker()\r\n center = Geom::Point3d.new(0, 0, 0)\r\n rotate_around_vector = Geom::Vector3d.new(0, 0, 1)\r\n angle = 14.4.degrees\r\n tr = Geom::Transformation.rotation(center, rotate_around_vector, angle)\r\n vector = Geom::Vector3d.new(@radius, 0, 0)\r\n 26.times.map {center + vector.transform!(tr) }\r\n end",
"title": ""
},
{
"docid": "799d0cc2ec1cda6353e4145758e3b9a0",
"score": "0.50605255",
"text": "def setMarkerShape _obj, _args\n \"_obj setMarkerShape _args;\" \n end",
"title": ""
},
{
"docid": "8f3ee9014437fb0d358d0704196a695b",
"score": "0.5042897",
"text": "def get_shape(name, slide_index, shape_index, password = nil, folder = nil, storage = nil, sub_shape = nil)\n data, _status_code, _headers = get_shape_with_http_info(name, slide_index, shape_index, password, folder, storage, sub_shape)\n data\n end",
"title": ""
},
{
"docid": "d6289933a76e4d23b7613c6d762de6c7",
"score": "0.5039397",
"text": "def get_marker\n return @marker\n end",
"title": ""
},
{
"docid": "d6289933a76e4d23b7613c6d762de6c7",
"score": "0.5039397",
"text": "def get_marker\n return @marker\n end",
"title": ""
},
{
"docid": "d6289933a76e4d23b7613c6d762de6c7",
"score": "0.5039397",
"text": "def get_marker\n return @marker\n end",
"title": ""
},
{
"docid": "ad237b51b910ec01cd018ebd267fff50",
"score": "0.50259805",
"text": "def get_shapes_with_http_info(name, slide_index, password = nil, folder = nil, storage = nil, shape_type = nil, sub_shape = nil)\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SlidesApi.get_shapes ...'\n end\n\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling SlidesApi.get_shapes\"\n end\n # verify the required parameter 'slide_index' is set\n if @api_client.config.client_side_validation && slide_index.nil?\n fail ArgumentError, \"Missing the required parameter 'slide_index' when calling SlidesApi.get_shapes\"\n end\n if @api_client.config.client_side_validation && shape_type && !['Shape', 'Chart', 'Table', 'PictureFrame', 'VideoFrame', 'AudioFrame', 'SmartArt', 'OleObjectFrame', 'GroupShape', 'GraphicalObject', 'Connector', 'SmartArtShape', 'ZoomFrame', 'SectionZoomFrame', 'SummaryZoomFrame', 'SummaryZoomSection'].any?{ |s| s.casecmp(shape_type)==0 }\n fail ArgumentError, \"Invalid value for parameter shape_type: \" + shape_type + \". Must be one of Shape, Chart, Table, PictureFrame, VideoFrame, AudioFrame, SmartArt, OleObjectFrame, GroupShape, GraphicalObject, Connector, SmartArtShape, ZoomFrame, SectionZoomFrame, SummaryZoomFrame, SummaryZoomSection\"\n end\n # resource path\n local_var_path = '/slides/{name}/slides/{slideIndex}/shapes'\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'name', name)\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'slideIndex', slide_index)\n\n # query parameters\n query_params = {}\n query_params[:'folder'] = @api_client.prepare_for_query(folder) unless folder.nil?\n query_params[:'storage'] = @api_client.prepare_for_query(storage) unless storage.nil?\n query_params[:'shapeType'] = @api_client.prepare_for_query(shape_type) unless shape_type.nil?\n query_params[:'subShape'] = @api_client.prepare_for_query(sub_shape) unless sub_shape.nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'password'] = password unless password.nil?\n\n # http body (model)\n post_body = nil\n\n # form parameters\n post_files = []\n\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :body => post_body,\n :files => post_files,\n :auth_names => auth_names,\n :return_type => 'Shapes')\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "722ad9129d826a86e7859aa736018db7",
"score": "0.4976042",
"text": "def polymarker(x, y, markersize = nil, marker_z = nil)\n # GR.jl - Multiple dispatch\n n = equal_length(x, y)\n if markersize.nil? && marker_z.nil?\n super(n, x, y)\n else\n markersize ||= GR.inqmarkersize\n markersize = if markersize.is_a?(Numeric)\n Array.new(n, markersize * 100)\n else\n raise ArgumentError if n != markersize.length\n\n markersize.map { |i| (100 * i).round }\n end\n marker_z ||= GR.inqcolor(989) # FIXME\n color = if marker_z.is_a?(Numeric)\n Array.new(n, marker_z)\n else\n raise ArgumentError if n != marker_z.length\n\n to_rgb_color(marker_z)\n end\n z = markersize.to_a.zip(color).flatten # to_a : NArray\n gdp(x, y, GDP_DRAW_MARKERS, z)\n end\n end",
"title": ""
},
{
"docid": "2f77d6fe93d7eb32431998108ae5fa18",
"score": "0.49750283",
"text": "def shape(shape_style={}, &blk)\n Shoes::Shape.new(style.merge(shape_style), blk)\n end",
"title": ""
},
{
"docid": "08a2de09552f75d0b9a197196dd41fd0",
"score": "0.49539655",
"text": "def get_shapes(name, slide_index, password = nil, folder = nil, storage = nil, shape_type = nil, sub_shape = nil)\n data, _status_code, _headers = get_shapes_with_http_info(name, slide_index, password, folder, storage, shape_type, sub_shape)\n data\n end",
"title": ""
},
{
"docid": "54d4157048b2db00f94aa4ba7b76996c",
"score": "0.49238136",
"text": "def create_marker(*options)\n result = GMarker.new(*options)\n @markers << result\n return result\n end",
"title": ""
},
{
"docid": "9879507cf3bfb1f10729f2e2852cdac0",
"score": "0.49044067",
"text": "def path\n shapefile_path\n end",
"title": ""
},
{
"docid": "fc69cfce5751351268055b9e508f9c6f",
"score": "0.4902",
"text": "def shape(shape_style = {}, &blk)\n Shoes::Shape.new(app, style.merge(shape_style), blk)\n end",
"title": ""
},
{
"docid": "62a4f125e64a477523a143f6f468145e",
"score": "0.48703364",
"text": "def map_marker\n=begin\n kita_icon = GIcon.new(:image => \"/images/red-dot.png\",\n :shadow => \"/images/shadow.png\",\n :shadow_size => GSize.new(49,32),\n :icon_anchor => GPoint.new(16,32))\n=end\n GMarker.new([self.lat, self.lng], :title => \"#{self.name}\", :info_window => \"\n <p> <b>#{self.name}</b><br />#{self.street}<br />#{self.country_code}-#{self.zip} #{self.city} </p>\n <p><a href='/kitas/#{self.id}'>Mehr Details...</a></p>\n \")\n end",
"title": ""
},
{
"docid": "2aeb83001659cae43e4b33d811a31f19",
"score": "0.48609626",
"text": "def getMarkerType _args\n \"getMarkerType _args;\" \n end",
"title": ""
},
{
"docid": "0592e281d456ae177a6b6d8cc077bb12",
"score": "0.48325056",
"text": "def get_shape_with_http_info(name, slide_index, shape_index, password = nil, folder = nil, storage = nil, sub_shape = nil)\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SlidesApi.get_shape ...'\n end\n\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling SlidesApi.get_shape\"\n end\n # verify the required parameter 'slide_index' is set\n if @api_client.config.client_side_validation && slide_index.nil?\n fail ArgumentError, \"Missing the required parameter 'slide_index' when calling SlidesApi.get_shape\"\n end\n # verify the required parameter 'shape_index' is set\n if @api_client.config.client_side_validation && shape_index.nil?\n fail ArgumentError, \"Missing the required parameter 'shape_index' when calling SlidesApi.get_shape\"\n end\n # resource path\n local_var_path = '/slides/{name}/slides/{slideIndex}/shapes/{shapeIndex}'\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'name', name)\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'slideIndex', slide_index)\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'shapeIndex', shape_index)\n\n # query parameters\n query_params = {}\n query_params[:'folder'] = @api_client.prepare_for_query(folder) unless folder.nil?\n query_params[:'storage'] = @api_client.prepare_for_query(storage) unless storage.nil?\n query_params[:'subShape'] = @api_client.prepare_for_query(sub_shape) unless sub_shape.nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'password'] = password unless password.nil?\n\n # http body (model)\n post_body = nil\n\n # form parameters\n post_files = []\n\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :body => post_body,\n :files => post_files,\n :auth_names => auth_names,\n :return_type => 'ShapeBase')\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "ba6486eb3a18bb0a553bb2f7864c56a7",
"score": "0.47586873",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n squares = @squares.values_at(*line)\n if three_identical_markers?(squares) # => we wish this method existed\n return squares.first.marker # => return the marker, whatever it is\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "f124e164c60168026c78218ca0f721bc",
"score": "0.4752829",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n squares = @squares.values_at(*line)\n if three_identical_markers?(squares) # => we wish this method existed\n return squares.first.marker # => return the marker, whatever it is\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "6d11c0ca26581e389b89093939405132",
"score": "0.47304848",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n squares = @squares.values_at(*line)\n if identical_markers?(3, squares)\n return squares.first.marker\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "710f5fc64ab883b439b35daa12d6159b",
"score": "0.47100013",
"text": "def color\n @marker_fill_color || @marker_border_color || :default\n end",
"title": ""
},
{
"docid": "36b01599d9e4c6b097a40d2406d7ca5f",
"score": "0.46958113",
"text": "def delete_watermark_with_http_info(name, shape_name = nil, password = nil, folder = nil, storage = nil)\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SlidesApi.delete_watermark ...'\n end\n\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling SlidesApi.delete_watermark\"\n end\n # resource path\n local_var_path = '/slides/{name}/watermark/delete'\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'name', name)\n\n # query parameters\n query_params = {}\n query_params[:'shapeName'] = @api_client.prepare_for_query(shape_name) unless shape_name.nil?\n query_params[:'folder'] = @api_client.prepare_for_query(folder) unless folder.nil?\n query_params[:'storage'] = @api_client.prepare_for_query(storage) unless storage.nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'password'] = password unless password.nil?\n\n # http body (model)\n post_body = nil\n\n # form parameters\n post_files = []\n\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:DELETE, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :body => post_body,\n :files => post_files,\n :auth_names => auth_names)\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "4e97283a6622e2123e972bf6be3a99ef",
"score": "0.46930167",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n squares = @squares.values_at(*line)\n markers = squares.map(&:marker)\n return markers[0] if markers.uniq.size == 1 && squares[0].marked?\n end\n nil\n end",
"title": ""
},
{
"docid": "d29233cd3542e893ba02795d637fe9bd",
"score": "0.46876678",
"text": "def get_special_slide_shape_with_http_info(name, slide_index, slide_type, shape_index, password = nil, folder = nil, storage = nil, sub_shape = nil)\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SlidesApi.get_special_slide_shape ...'\n end\n\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling SlidesApi.get_special_slide_shape\"\n end\n # verify the required parameter 'slide_index' is set\n if @api_client.config.client_side_validation && slide_index.nil?\n fail ArgumentError, \"Missing the required parameter 'slide_index' when calling SlidesApi.get_special_slide_shape\"\n end\n # verify the required parameter 'slide_type' is set\n if @api_client.config.client_side_validation && slide_type.nil?\n fail ArgumentError, \"Missing the required parameter 'slide_type' when calling SlidesApi.get_special_slide_shape\"\n end\n # verify enum value\n if @api_client.config.client_side_validation && !['MasterSlide', 'LayoutSlide', 'NotesSlide'].any?{ |s| s.casecmp(slide_type)==0 }\n fail ArgumentError, \"Invalid value for parameter slide_type: \" + slide_type + \". Must be one of MasterSlide, LayoutSlide, NotesSlide\"\n end\n # verify the required parameter 'shape_index' is set\n if @api_client.config.client_side_validation && shape_index.nil?\n fail ArgumentError, \"Missing the required parameter 'shape_index' when calling SlidesApi.get_special_slide_shape\"\n end\n # resource path\n local_var_path = '/slides/{name}/slides/{slideIndex}/{slideType}/shapes/{shapeIndex}'\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'name', name)\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'slideIndex', slide_index)\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'slideType', slide_type)\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'shapeIndex', shape_index)\n\n # query parameters\n query_params = {}\n query_params[:'folder'] = @api_client.prepare_for_query(folder) unless folder.nil?\n query_params[:'storage'] = @api_client.prepare_for_query(storage) unless storage.nil?\n query_params[:'subShape'] = @api_client.prepare_for_query(sub_shape) unless sub_shape.nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'password'] = password unless password.nil?\n\n # http body (model)\n post_body = nil\n\n # form parameters\n post_files = []\n\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :body => post_body,\n :files => post_files,\n :auth_names => auth_names,\n :return_type => 'ShapeBase')\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "137a5afd3bc04958ec5307acc7c25f11",
"score": "0.46798503",
"text": "def shape_type_code\n @opened ? @shape_type_code : nil\n end",
"title": ""
},
{
"docid": "801dbad6ba3d6b12e0fdac3ec43c396e",
"score": "0.46676373",
"text": "def drawn_georeferences\n message = ''\n value = params['gr_geographic_item_attributes_shape']\n if value.blank?\n @georeferences = Georeference.where('false')\n else\n feature = RGeo::GeoJSON.decode(value, json_parser: :json)\n # isolate the WKT\n geometry = feature.geometry\n this_type = geometry.geometry_type.to_s.downcase\n geometry = geometry.as_text\n\n radius = feature['radius']\n case this_type\n when 'point'\n @georeferences = Georeference.with_project_id(sessions_current_project_id)\n .joins(:geographic_item)\n .where(GeographicItem.intersecting_radius_of_wkt_sql(geometry, radius)) # TODO: likely want within_radius_of_wkt_sql\n when 'polygon'\n @georeferences = Georeference.with_project_id(sessions_current_project_id)\n .joins(:geographic_item)\n .where(GeographicItem.contained_by_wkt_sql(geometry))\n else\n end\n if @georeferences.blank?\n message = 'no objects contained in drawn shape'\n end\n render_gr_select_json(message)\n end\n end",
"title": ""
},
{
"docid": "c280165d34779b43c21a15237630ad13",
"score": "0.4667082",
"text": "def get_special_slide_shapes_with_http_info(name, slide_index, slide_type, password = nil, folder = nil, storage = nil, sub_shape = nil)\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SlidesApi.get_special_slide_shapes ...'\n end\n\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling SlidesApi.get_special_slide_shapes\"\n end\n # verify the required parameter 'slide_index' is set\n if @api_client.config.client_side_validation && slide_index.nil?\n fail ArgumentError, \"Missing the required parameter 'slide_index' when calling SlidesApi.get_special_slide_shapes\"\n end\n # verify the required parameter 'slide_type' is set\n if @api_client.config.client_side_validation && slide_type.nil?\n fail ArgumentError, \"Missing the required parameter 'slide_type' when calling SlidesApi.get_special_slide_shapes\"\n end\n # verify enum value\n if @api_client.config.client_side_validation && !['MasterSlide', 'LayoutSlide', 'NotesSlide'].any?{ |s| s.casecmp(slide_type)==0 }\n fail ArgumentError, \"Invalid value for parameter slide_type: \" + slide_type + \". Must be one of MasterSlide, LayoutSlide, NotesSlide\"\n end\n # resource path\n local_var_path = '/slides/{name}/slides/{slideIndex}/{slideType}/shapes'\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'name', name)\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'slideIndex', slide_index)\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'slideType', slide_type)\n\n # query parameters\n query_params = {}\n query_params[:'folder'] = @api_client.prepare_for_query(folder) unless folder.nil?\n query_params[:'storage'] = @api_client.prepare_for_query(storage) unless storage.nil?\n query_params[:'subShape'] = @api_client.prepare_for_query(sub_shape) unless sub_shape.nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'password'] = password unless password.nil?\n\n # http body (model)\n post_body = nil\n\n # form parameters\n post_files = []\n\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :body => post_body,\n :files => post_files,\n :auth_names => auth_names,\n :return_type => 'Shapes')\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "1d84adbf09cfada8c96836da733d8ae6",
"score": "0.4659901",
"text": "def start_coords\n marker_coords('S')\n end",
"title": ""
},
{
"docid": "04398e311703e3941652e33c9c4d448c",
"score": "0.46596304",
"text": "def route_shape_by_geometry_id(shape_id)\n get \"/gtfs/shapes/geometry/#{shape_id}\"\n end",
"title": ""
},
{
"docid": "fd29c4e7247a54c91043a599666b7ebd",
"score": "0.46592626",
"text": "def show\n @shape_type = ShapeType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shape_type }\n end\n end",
"title": ""
},
{
"docid": "0c5800c31cf727efc9fd98ebb9cb0b4c",
"score": "0.46504042",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n squares = @squares.values_at(*line)\n if three_identical_markers?(squares)\n return squares.first.marker\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "7914147438f0607084fd345ce019e44d",
"score": "0.46479565",
"text": "def shape\n \n return :default if (75..85).include(width) and (55..65).include(height)\n return :square if width == height ## TODO: Needs a bit of tolerance for small differences\n return :portrait if height > width\n return :landscape if width > height\n \n ## Possibly running in the nightmare corpse-city of R'lyeh\n raise \"Geometry of logo is abnormal, non-Euclidean, and loathsomely redolent of spheres and dimensions apart from ours.\"\n \n end",
"title": ""
},
{
"docid": "da40de132c50e316e804bdafeb0b92ce",
"score": "0.4647718",
"text": "def create_watermark(name, shape = nil, font_height = nil, text = nil, font_name = nil, font_color = nil, password = nil, folder = nil, storage = nil)\n create_watermark_with_http_info(name, shape, font_height, text, font_name, font_color, password, folder, storage)\n nil\n end",
"title": ""
},
{
"docid": "3a73c504fab58c384754b90c1f7d1353",
"score": "0.46378568",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n line_markers = squares.values_at(*line).map(&:marker)\n next if line_markers.include?(Square::INITIAL_MARKER)\n return line_markers.first if line_markers.uniq.size == 1\n end\n\n nil\n end",
"title": ""
},
{
"docid": "ebcd1b4a874557e9904307a4643f5134",
"score": "0.46365082",
"text": "def find_by_shape(shape)\n @game_entities.find { |item| item.shape == shape }\n end",
"title": ""
},
{
"docid": "64ae6b0639135161700ea2b9d43241d9",
"score": "0.4630773",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n squares = @squares.values_at(*line)\n return squares.first.marker if three_identical_markers?(squares)\n end\n nil\n end",
"title": ""
},
{
"docid": "e917212c21549a8dcf140da89f64c399",
"score": "0.46290848",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n squares = @squares.values_at(*line)\n if three_identical_markers?(squares)\n return squares.first.marker\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "e917212c21549a8dcf140da89f64c399",
"score": "0.46290848",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n squares = @squares.values_at(*line)\n if three_identical_markers?(squares)\n return squares.first.marker\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "e917212c21549a8dcf140da89f64c399",
"score": "0.46290848",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n squares = @squares.values_at(*line)\n if three_identical_markers?(squares)\n return squares.first.marker\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "e917212c21549a8dcf140da89f64c399",
"score": "0.46290848",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n squares = @squares.values_at(*line)\n if three_identical_markers?(squares)\n return squares.first.marker\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "e917212c21549a8dcf140da89f64c399",
"score": "0.46290848",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n squares = @squares.values_at(*line)\n if three_identical_markers?(squares)\n return squares.first.marker\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "e917212c21549a8dcf140da89f64c399",
"score": "0.46290848",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n squares = @squares.values_at(*line)\n if three_identical_markers?(squares)\n return squares.first.marker\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "e917212c21549a8dcf140da89f64c399",
"score": "0.46290848",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n squares = @squares.values_at(*line)\n if three_identical_markers?(squares)\n return squares.first.marker\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "e917212c21549a8dcf140da89f64c399",
"score": "0.46290848",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n squares = @squares.values_at(*line)\n if three_identical_markers?(squares)\n return squares.first.marker\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "e9efa19e8b612e285b7460dcce1da757",
"score": "0.46281084",
"text": "def delete_watermark(name, shape_name = nil, password = nil, folder = nil, storage = nil)\n delete_watermark_with_http_info(name, shape_name, password, folder, storage)\n nil\n end",
"title": ""
},
{
"docid": "adb9181994411ee91959aae34fb6b39b",
"score": "0.4627307",
"text": "def shapes\n @shapes ||= begin\n shapes = Array(operands.detect {|op| op.is_a?(Array) && op.first == :shapes})\n Array(shapes[1..-1])\n end\n end",
"title": ""
},
{
"docid": "8c3958d086dd60766862bc13efa4f747",
"score": "0.4617575",
"text": "def placemark(name = nil, options = {})\n Kamelopard::Placemark.new name, options\n end",
"title": ""
},
{
"docid": "96686ccbee1c372850ea46d4dbb40a39",
"score": "0.46094114",
"text": "def add_shape shape\n\t\tif shape.class == Rectangle or shape.class == Triangle or shape.class == Circle\n\t\t\t@shapes.push shape\n\t\telse\n\t\t\tputs \"Not a shape\"\n\t\tend\n\tend",
"title": ""
},
{
"docid": "de0ad81cf301fbfe2ff2a0aa98fa1611",
"score": "0.4608738",
"text": "def show_shape(type, options={})\n add_actor Gamework::Shape.new(type, options)\n end",
"title": ""
},
{
"docid": "5bc0325495845a38384302447f761c56",
"score": "0.45983443",
"text": "def shapes_here(point,shapes)\n\tlocal_shapes = []\n\tfor shape in shapes\n\t\tif shape['type'] == 'circle'\n\t\t\t# Generate polygon for circle\n\t \t\tcenter = @@vars['factory'].point(shape['generators'][0][0],shape['generators'][0][1])\n\t \t\tpoly = center.buffer(shape['radius'])\n\n\t\t\tif point.within?(poly)\n\t\t\t\tlocal_shapes << shape['id']\n\t\t\tend\n\t\telsif shape['type'] == 'polygon'\n\t\t\t# Generate polygon from points\n\t\t\tgen_points = []\n\t\t\tfor p in shape['generators']\n\t\t\t\tgen_points << @@vars['factory'].point(p[0],p[1])\n\t\t\tend\n\t\t\tring = @@vars['factory'].linear_ring(gen_points)\n\t\t\tpoly = @@vars['factory'].polygon(ring)\n\n\t\t\tif point.within?(poly)\n\t\t\t\tlocal_shapes << shape['id']\n\t\t\tend\n\t\tend\n\tend\n\treturn local_shapes\nend",
"title": ""
},
{
"docid": "4deb4a8b6e6e6af4f0d4f63f0828e473",
"score": "0.45915225",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n squares = @squares.values_at(*line)\n if three_identical_markers?(squares)\n return squares.first.marker # return the corresponding detected marker\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "d3abe90886b8217a3a3c8db7a694d856",
"score": "0.45842043",
"text": "def formalize_marker_name marker\r\n if marker\r\n marker = marker.delete(' ')\r\n marker = marker.downcase\r\n marker = marker.capitalize\r\n end\r\n return marker\r\n end",
"title": ""
},
{
"docid": "5c79376ac927d99ff47761cb2922c115",
"score": "0.456538",
"text": "def setMarkerShapeLocal _obj, _args\n \"_obj setMarkerShapeLocal _args;\" \n end",
"title": ""
},
{
"docid": "1f60da655735f03762b73fe78079b903",
"score": "0.4563427",
"text": "def type_id\n FFIGeos.GEOSGeomTypeId_r(Geos.current_handle_pointer, ptr)\n end",
"title": ""
},
{
"docid": "f85075e850d4b6be736ff0ebac9703e2",
"score": "0.45603523",
"text": "def winning_marker\n WINNING_COMBOS.each do |line|\n squares = @squares.values_at(*line)\n if three_identical_markers?(squares)\n return squares.first.marker\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "ec771d383a8db1d93114d46eef65b276",
"score": "0.45506945",
"text": "def name\n \tself.marker_synonyms.collect{|ms| ms.name}.join(',')\n end",
"title": ""
},
{
"docid": "d6f0e4be05c4c58a3adf426900788fbd",
"score": "0.45414144",
"text": "def winnning_marker\n WINNING_POSITIONS.each do |line|\n if count_human_marker(@squares.values_at(*line)) == 3\n return TTTPlay::HUMAN_MARKER\n end\n if count_computer_marker(@squares.values_at(*line)) == 3\n return TTTPlay::COMPUTER_MARKER\n end\n end\n\n nil\n end",
"title": ""
},
{
"docid": "1f338f11cd0c0b7b739bdcaefdd181bd",
"score": "0.45412177",
"text": "def add_shapes(name, klass, default, shapes, clusters)\n # Creates option with predefined shapes\n opt = klass.new(name, default, shapes, clusters, \n @separators, @cluster_separators,\n @case_sensitive)\n add_raw(opt)\n end",
"title": ""
},
{
"docid": "2e9e0c8ef414791a58fb77786c22c770",
"score": "0.45338815",
"text": "def detect_marker\n WINNING_LINES.each do |line|\n if count_human_marker(@squares.values_at(*line)) == 3\n return TTTGame::HUMAN_MARKER\n elsif count_computer_marker(@squares.values_at(*line)) == 3\n return TTTGame::COMPUTER_MARKER\n end\n end\n nil\n end",
"title": ""
},
{
"docid": "e1807db19e7e3acb5d76075cde2f255e",
"score": "0.4504122",
"text": "def create_shape\n id = rand 7\n @cur_y = 0\n @cur_x = 5\n @shape = SHAPES[id].dup\n end",
"title": ""
},
{
"docid": "0fdf536f572a3e19a0f357120a4b3f77",
"score": "0.45040333",
"text": "def get_special_slide_shape(name, slide_index, slide_type, shape_index, password = nil, folder = nil, storage = nil, sub_shape = nil)\n data, _status_code, _headers = get_special_slide_shape_with_http_info(name, slide_index, slide_type, shape_index, password, folder, storage, sub_shape)\n data\n end",
"title": ""
},
{
"docid": "8550108e830fb41c5f6e72690d426ab0",
"score": "0.45008436",
"text": "def set_shape_geometry_path_with_http_info(name, slide_index, shape_index, dto, password = nil, folder = nil, storage = nil)\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SlidesApi.set_shape_geometry_path ...'\n end\n\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling SlidesApi.set_shape_geometry_path\"\n end\n # verify the required parameter 'slide_index' is set\n if @api_client.config.client_side_validation && slide_index.nil?\n fail ArgumentError, \"Missing the required parameter 'slide_index' when calling SlidesApi.set_shape_geometry_path\"\n end\n # verify the required parameter 'shape_index' is set\n if @api_client.config.client_side_validation && shape_index.nil?\n fail ArgumentError, \"Missing the required parameter 'shape_index' when calling SlidesApi.set_shape_geometry_path\"\n end\n # verify the required parameter 'dto' is set\n if @api_client.config.client_side_validation && dto.nil?\n fail ArgumentError, \"Missing the required parameter 'dto' when calling SlidesApi.set_shape_geometry_path\"\n end\n # resource path\n local_var_path = '/slides/{name}/slides/{slideIndex}/shapes/{shapeIndex}/geometryPath'\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'name', name)\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'slideIndex', slide_index)\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'shapeIndex', shape_index)\n\n # query parameters\n query_params = {}\n query_params[:'folder'] = @api_client.prepare_for_query(folder) unless folder.nil?\n query_params[:'storage'] = @api_client.prepare_for_query(storage) unless storage.nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'password'] = password unless password.nil?\n\n # http body (model)\n post_body = @api_client.object_to_http_body(dto)\n\n # form parameters\n post_files = []\n\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :body => post_body,\n :files => post_files,\n :auth_names => auth_names,\n :return_type => 'ShapeBase')\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "74f134d2e4f0e7f0f66b24a2923c84d1",
"score": "0.45006102",
"text": "def geom_type\n FFIGeos.GEOSGeomType_r(Geos.current_handle_pointer, ptr)\n end",
"title": ""
},
{
"docid": "17d9d16351ef078344c515a152477f11",
"score": "0.44976524",
"text": "def get_relation(shape)\n if surrounds(shape)\n return \"surrounds\"\n elsif is_inside(shape)\n return \"is inside\"\n elsif intersects(shape)\n return \"intersects\"\n else\n return \"is separate from\"\n end\n end",
"title": ""
},
{
"docid": "b2706ebd821949ed721c8199648424d9",
"score": "0.44975483",
"text": "def getMarkerSize _args\n \"getMarkerSize _args;\" \n end",
"title": ""
},
{
"docid": "88d6998b807bea8f338c920d76bef0ba",
"score": "0.44913113",
"text": "def maps_marker\n \"&markers=color:green%7C#{place[:latitude]},#{place[:longitude]}\"\n end",
"title": ""
},
{
"docid": "73bd2ad02a2d0921d392ae0d4824d869",
"score": "0.44814008",
"text": "def get_shapes(slide_number,storage_type = '',storage_name='',folder_name='')\n begin\n if @filename == ''\n raise 'No file name specified'\n end\n \n str_uri = $product_uri + '/slides/' + @filename + '/slides/' + slide_number.to_s + '/shapes'\n if !folder_name.empty?\n str_uri += '?folder=' + folder_name\n end\n if !storage_name.empty?\n str_uri += '&storage=' + storage_name\n end\n signed_uri = Aspose::Cloud::Common::Utils.sign(str_uri)\n response = RestClient.get(signed_uri, :accept => 'application/json')\n json = JSON.parse(response)\n shapes = Hash.new\n json['ShapeList']['ShapesLinks'].each { |item| \n \n signed_uri = Aspose::Cloud::Common::Utils.sign(item['Uri']['Href'])\n response = RestClient.get(signed_uri, :accept => 'application/json')\n shapes = JSON.parse(response)\n }\n return shapes\n rescue Exception=>e\n print e\n end\n end",
"title": ""
},
{
"docid": "aa9b57d150fc975c624d6dc280835d85",
"score": "0.4472519",
"text": "def print_shape()\n puts \"shape type: #{type}\"\n @squares.each do |sq|\n puts \"point: #{sq.x}, #{sq.y}\"\n end\n end",
"title": ""
},
{
"docid": "3ce57d8b7c7c48c91df5f35a5c50e86a",
"score": "0.4443927",
"text": "def add_shape(shape)\n @shapes.add(shape)\n self\n end",
"title": ""
},
{
"docid": "081ff5610f904f4b7e0c16d575ddac57",
"score": "0.44436285",
"text": "def gen_marker(marker)\n marker.lat object.latitude\n marker.lng object.longitude\n link = h.link_to object.title, object\n info = \"#{link}<br>#{short_details}\"\n marker.infowindow info\n end",
"title": ""
},
{
"docid": "e0f73d65f62f14f6388cec12fd102933",
"score": "0.44338232",
"text": "def render\n update\n @batch.begin\n case @shape_type\n when :filled\n @shape.begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer::ShapeType::Filled)\n when :point\n @shape.begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer::ShapeType::Point)\n when :line\n @shape.begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer::ShapeType::Line)\n else\n @shape.begin(com.badlogic.gdx.graphics.glutils.ShapeRenderer::ShapeType::Filled)\n end\n display\n @shape.end unless @shape.nil?\n @batch.end\n end",
"title": ""
},
{
"docid": "a24cf6ca63d20c570764c1835f2a6585",
"score": "0.44271964",
"text": "def name_text_coordinates\n return 8, 5, 98, 16\n end",
"title": ""
},
{
"docid": "fa636ab0347560604fea7743800ddb1f",
"score": "0.4420294",
"text": "def set_visual_shape(shape, *params)\n case shape\n when :polygon, :Polygon\n @visual_shape = \"#{self.class}::#{shape}\".constantize.new\n params.each do |vector|\n @visual_shape.add_point vector.x, vector.y\n end\n when :circle, :Circle\n @visual_shape = DrawableShape::Circle.new(position.x, position.y, params)\n else\n @visual_shape = (\"DrawableShape::\"+ shape.to_s).constantize.new(params)\n end\n end",
"title": ""
},
{
"docid": "2691bb92f0d5dcbeab8ca58f74429d57",
"score": "0.4410834",
"text": "def find_watermark_text_by_name(name)\n Sketchup.active_model.entities.each { |e|\n return e if e.is_a?(Sketchup::Text) && e.get_attribute('MSPhysics', 'Name') == name.to_s\n }\n nil\n end",
"title": ""
},
{
"docid": "7efae65684da8e180f2f76ef81b8c12f",
"score": "0.4405171",
"text": "def get_kml_string\n get_kml.to_s\n end",
"title": ""
},
{
"docid": "b12959b727ca855dd90783d88b621087",
"score": "0.44028556",
"text": "def winning_marker\n WINNING_LINES.each do |line|\n line_squares = squares.values_at(*line)\n next if line_squares.any?(&:unmarked?)\n markers = line_squares.map(&:marker)\n return markers.first if winner?(markers)\n end\n nil\n end",
"title": ""
},
{
"docid": "25822a096da14aa12ff0fdcb49dbbe92",
"score": "0.43981203",
"text": "def to_geojson_s\n s = nil\n if shapefile && shapefile.file && shapefile.file.file\n File.open(shapefile.file.file, \"r\") do |file|\n s = file.read\n end\n end\n s\n end",
"title": ""
},
{
"docid": "df072d72feeab279e025753d46aa06f7",
"score": "0.43944043",
"text": "def route_by_shape_id(shape_id)\n get \"/gtfs/shapes/shapeId/#{shape_id}\"\n end",
"title": ""
},
{
"docid": "654c30bc3bc8b89298a38b95112e5048",
"score": "0.43937758",
"text": "def download_special_slide_shape(name, slide_index, slide_type, shape_index, format, options = nil, scale_x = nil, scale_y = nil, bounds = nil, password = nil, folder = nil, storage = nil, fonts_folder = nil, sub_shape = nil)\n data, _status_code, _headers = download_special_slide_shape_with_http_info(name, slide_index, slide_type, shape_index, format, options, scale_x, scale_y, bounds, password, folder, storage, fonts_folder, sub_shape)\n data\n end",
"title": ""
},
{
"docid": "1b19d18c30aeca804e362de076b52971",
"score": "0.43808827",
"text": "def gen_shapes\n input_file = ARGV[0].nil? ? \"example.dat\" : ARGV[0]\n shapes_json = gen_json(input_file)\n shapes_json[:geometry][:shape].map do |shape_json|\n Shape.new(shape_json)\n end\n end",
"title": ""
},
{
"docid": "97ddaf154bde177b6fdaaa8077d9d77a",
"score": "0.43740913",
"text": "def remove shape\n @remove_shapes << shape\n end",
"title": ""
},
{
"docid": "454e3c7fe31c7bd04c242a3b9331c82f",
"score": "0.43715513",
"text": "def create\n @polygon_mark = PolygonMark.new(:name => params[:name], :layer_id => params[:layer_id])\n \n respond_to do |format|\n if @polygon_mark.save\n @polygon_mark.the_geom = Polygon.from_coordinates([params[:coordinates]], 4269)\n @polygon_mark.save!\n format.html { redirect_to @polygon_mark, :notice => 'polygon mark was successfully created.' }\n format.json { render :json => @polygon_mark, :status => :created, :location => @polygon_mark }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @polygon_mark.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7cb5323799d6626037355456742d77a3",
"score": "0.43704498",
"text": "def record_marker marker_name, options = {}\n add_decision :record_marker, options.merge(:marker_name => marker_name)\n end",
"title": ""
},
{
"docid": "33e7ccd91d0264d5226c4074951da90a",
"score": "0.43694803",
"text": "def get_stroke_type\n stroke_type ? stroke_type.i18n_short : '?'\n end",
"title": ""
},
{
"docid": "eb6e8a6193887a06db645c8707fce5ef",
"score": "0.43666032",
"text": "def marker_img_for_grade grade\n case grade.name.downcase\n when \"maternelle\"\n char = 'M'\n color = \"blue\"\n when \"primaire\"\n char = \"P\"\n color = \"orange\"\n when \"college\"\n char = \"C\"\n color = \"red\"\n when \"lycee\"\n char = \"L\"\n color = \"yellow\"\n else\n char = \"U\"\n color = \"black\"\n end\n\n \"markers/markermed_#{color}_#{char}.png\"\n end",
"title": ""
},
{
"docid": "aef3bf41a1fbec53aa086dd4bcd41da6",
"score": "0.436439",
"text": "def create_watermark_with_http_info(name, shape = nil, font_height = nil, text = nil, font_name = nil, font_color = nil, password = nil, folder = nil, storage = nil)\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: SlidesApi.create_watermark ...'\n end\n\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling SlidesApi.create_watermark\"\n end\n # resource path\n local_var_path = '/slides/{name}/watermark'\n local_var_path = @api_client.replace_path_parameter(local_var_path, 'name', name)\n\n # query parameters\n query_params = {}\n query_params[:'fontHeight'] = @api_client.prepare_for_query(font_height) unless font_height.nil?\n query_params[:'text'] = @api_client.prepare_for_query(text) unless text.nil?\n query_params[:'fontName'] = @api_client.prepare_for_query(font_name) unless font_name.nil?\n query_params[:'fontColor'] = @api_client.prepare_for_query(font_color) unless font_color.nil?\n query_params[:'folder'] = @api_client.prepare_for_query(folder) unless folder.nil?\n query_params[:'storage'] = @api_client.prepare_for_query(storage) unless storage.nil?\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['multipart/form-data'])\n header_params[:'password'] = password unless password.nil?\n\n # http body (model)\n post_body = @api_client.object_to_http_body(shape)\n\n # form parameters\n post_files = []\n\n auth_names = ['JWT']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :body => post_body,\n :files => post_files,\n :auth_names => auth_names)\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "02c87d2c1c34956c414bf42d356917ba",
"score": "0.435954",
"text": "def remove_shape\n\t\t@shapes.delete_at(0)\n\tend",
"title": ""
},
{
"docid": "957075d02a676b2a62cd7e515dc2028b",
"score": "0.4355618",
"text": "def geometry_type_ogrinfo(shp_filename)\n IO.popen(\"#{Settings.gdal_path}ogrinfo -ro -so -al '#{shp_filename}'\") do |file|\n file.readlines.each do |line|\n next unless line =~ /^Geometry:\\s+(.*)\\s*$/\n\n logger.debug \"generate-mods: parsing ogrinfo geometry output: #{line}\"\n return Regexp.last_match(1).gsub('3D', '').gsub('Multi', '').strip\n end\n end\n end",
"title": ""
},
{
"docid": "d601bdeacacb94c3f17ec530267f763f",
"score": "0.43554407",
"text": "def index\n @shape_text = UniqueShapeName.for_profiles\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shape_text }\n end\n end",
"title": ""
},
{
"docid": "b859c17dd3e3a9047e5ac15033416f0f",
"score": "0.43528977",
"text": "def matchshape(name, category, geometry)\n new(one.match(name, category.id, geometry) || raise(RecordNotFound,\n \"No matching places found for #{name} in #{category.id} around #{geometry}.\"))\n end",
"title": ""
}
] |
cc8d8d8081a98aa70b01111c433bb3b8
|
Use this matcher to check that a controller action was successful === Example controller.should respond_successfully
|
[
{
"docid": "d7fd60bcf7f16a827963e5d6aa42b1e6",
"score": "0.0",
"text": "def respond_successfully\n RespondSuccessfully.new\nend",
"title": ""
}
] |
[
{
"docid": "e541b0fe66ccf918409715b3be1acd86",
"score": "0.6662589",
"text": "def ok\n respond_with :ok, status: :ok\n end",
"title": ""
},
{
"docid": "222e25e173992849f6ce7431d6dc90b9",
"score": "0.66291237",
"text": "def successful?\n status == :successful\n end",
"title": ""
},
{
"docid": "5d0487bd37fb511338a2b5a269144bc3",
"score": "0.6569769",
"text": "def ok\n @controller.render json: \"\"\n return false\n end",
"title": ""
},
{
"docid": "b01a86d5c0ce38315559900b8deecd93",
"score": "0.654912",
"text": "def success?\n @status == 200\n end",
"title": ""
},
{
"docid": "c09112758ffb958ef1f4d0c2f6fc40ec",
"score": "0.6517293",
"text": "def successful?\n returned_parameters['status'] == 'success'\n end",
"title": ""
},
{
"docid": "54d48fd3720343cf57d443df03eb6eb4",
"score": "0.651592",
"text": "def success?\n self.status == 200\n end",
"title": ""
},
{
"docid": "bb32e56f1a66dcad2f67b3c52cab77c3",
"score": "0.65096575",
"text": "def successful?\n status == :successful\n end",
"title": ""
},
{
"docid": "6ac5fb006749de55efa57c16d13dc186",
"score": "0.6489054",
"text": "def successful?\n status == 'Success'\n end",
"title": ""
},
{
"docid": "6ecad92a82cdd836eeaae8e0b550e35f",
"score": "0.64563036",
"text": "def ok\n rack_resp(200, 'ok')\n end",
"title": ""
},
{
"docid": "45bda48e23c2f4f5d4b556dc153f47ca",
"score": "0.6443521",
"text": "def successful?\n return @status == :success\n end",
"title": ""
},
{
"docid": "97b9b2bdab67082b6df24a87310398b8",
"score": "0.6439936",
"text": "def successful?\n @status.downcase.eql? 'success'\n end",
"title": ""
},
{
"docid": "c7e83d2876d6f8444a73acacad5b9dae",
"score": "0.64394844",
"text": "def success?\n response_code == 200\n end",
"title": ""
},
{
"docid": "0e1180abd9ee43d01f450289f75fcd26",
"score": "0.6434236",
"text": "def successful?\n status == 'Success'\n end",
"title": ""
},
{
"docid": "0e1180abd9ee43d01f450289f75fcd26",
"score": "0.6434236",
"text": "def successful?\n status == 'Success'\n end",
"title": ""
},
{
"docid": "70b0cd0c0bea28d5aa777bd12a4474f8",
"score": "0.64223075",
"text": "def expect_success\n call_api_endpoint_just_once\n # expect(response).to be_success\n expect(response).to have_http_status(200)\n end",
"title": ""
},
{
"docid": "b0897ae08654c8713dd1f244ff3792dd",
"score": "0.64120334",
"text": "def successful?\n success\n end",
"title": ""
},
{
"docid": "9f5a4937cfde8de85ee3a51b30f70d63",
"score": "0.64043707",
"text": "def success?\n @code == 200\n end",
"title": ""
},
{
"docid": "9f5a4937cfde8de85ee3a51b30f70d63",
"score": "0.64043707",
"text": "def success?\n @code == 200\n end",
"title": ""
},
{
"docid": "900b133adb8f7c1591fdc78851dffe53",
"score": "0.63953805",
"text": "def successful?\n @success\n end",
"title": ""
},
{
"docid": "900b133adb8f7c1591fdc78851dffe53",
"score": "0.63953805",
"text": "def successful?\n @success\n end",
"title": ""
},
{
"docid": "d000207219e53096c43793057afe4a7f",
"score": "0.6375723",
"text": "def success?\n status == 200\n end",
"title": ""
},
{
"docid": "1909c7a9e2c11548371219ef6c05e811",
"score": "0.6375365",
"text": "def successful?(response)\n response[:ok] == true\n end",
"title": ""
},
{
"docid": "2dc21e415f193200e9d70372be560e65",
"score": "0.637469",
"text": "def success?\n status == HTTP_STATUS_SUCCESS\n end",
"title": ""
},
{
"docid": "bcf1a7dd47e090bf4c45725ce7b97038",
"score": "0.63458055",
"text": "def ok?\n @status == 200\n end",
"title": ""
},
{
"docid": "f059e9212cf0b11e61639b10010ddb92",
"score": "0.63417697",
"text": "def success?\n response.code == '200'\n end",
"title": ""
},
{
"docid": "720f54a245ad65cba2ce1ef94aa982b3",
"score": "0.63307786",
"text": "def expect_success_flash_message(resource, action)\n expect(page).to have_content \"#{resource} has been successfully #{action}\"\nend",
"title": ""
},
{
"docid": "1f1ad41f27eb6e6e45a8640698f31c49",
"score": "0.632542",
"text": "def ok?\n\t\t\t\tstatus==200\n\t\t\tend",
"title": ""
},
{
"docid": "7c68bf33748488d24fec46f706229142",
"score": "0.6317242",
"text": "def successful?\n returned_parameters[\"status\"].nil? || returned_parameters[\"status\"] == \"success\"\n end",
"title": ""
},
{
"docid": "7c68bf33748488d24fec46f706229142",
"score": "0.6317242",
"text": "def successful?\n returned_parameters[\"status\"].nil? || returned_parameters[\"status\"] == \"success\"\n end",
"title": ""
},
{
"docid": "2b26c16c9643ca353e8a5664ef7dbc08",
"score": "0.63132054",
"text": "def succeeded?\n @response_success\n end",
"title": ""
},
{
"docid": "474398af4bc4c415fbc2d2b9a93684c6",
"score": "0.63015217",
"text": "def success?\n @response.success?\n end",
"title": ""
},
{
"docid": "8357104034b273745fa525a07430d8b5",
"score": "0.62986803",
"text": "def success?\n meta[:code] == 200\n end",
"title": ""
},
{
"docid": "9d10132f71754b356ccdccfc366b2cfe",
"score": "0.62975264",
"text": "def success?\n (mock || return_code == :ok) && response_code && has_good_response_code?\n end",
"title": ""
},
{
"docid": "0dd9c7f43e54ce953fcbb65ed8871f67",
"score": "0.6288188",
"text": "def success?\n\t\t\treturn status == REQUEST_STATUS['success']\n\t\tend",
"title": ""
},
{
"docid": "971b86ce985b9758a08b28d59231a085",
"score": "0.6288159",
"text": "def ok; @status = 200 end",
"title": ""
},
{
"docid": "57b37e5405faf813b8273308da4a5be2",
"score": "0.62772155",
"text": "def have_succeeded\n StatusEnhancer.new :status_verb => 'success'\n end",
"title": ""
},
{
"docid": "0375cb8e5719ccdde0fd531f1652cc2d",
"score": "0.62581575",
"text": "def successful?\n true\n end",
"title": ""
},
{
"docid": "5765d93a46d862febd779255b47de655",
"score": "0.62546",
"text": "def successful?\n @successful\n end",
"title": ""
},
{
"docid": "5765d93a46d862febd779255b47de655",
"score": "0.62546",
"text": "def successful?\n @successful\n end",
"title": ""
},
{
"docid": "9939d241a41e959369c390153dd897a8",
"score": "0.6249756",
"text": "def success?\n response.code.to_i == 200\n end",
"title": ""
},
{
"docid": "c4cda6baac90638a60234526310aac3c",
"score": "0.6218951",
"text": "def success?\n return unless @request\n if @request.respond_to?(:success?)\n @request.success?\n else\n _response = http_client.response\n _response && _response.code.start_with?('2')\n end\n rescue => e\n logger.error { \"Exception executing method :success?. '#{e.message}'\\n#{e.backtrace}\" }\n return false\n end",
"title": ""
},
{
"docid": "35988346a42db8aff5e56ce4ff28064b",
"score": "0.6214808",
"text": "def success?(_response)\n true\n end",
"title": ""
},
{
"docid": "97b455d05726ff78e3c9a44054ebfbdd",
"score": "0.61995745",
"text": "def respond_successfully\n BeSuccess.new\n end",
"title": ""
},
{
"docid": "3b6a4a8f619b3cae31012830154b1d9b",
"score": "0.6180295",
"text": "def successful?(response)\n response && response[:status] && (response[:status][:code] == 200)\n end",
"title": ""
},
{
"docid": "7e88a8f3dd76e8ce9e32119894d32e19",
"score": "0.61774504",
"text": "def report_success\n @status = STATUS_SUCCESS\n end",
"title": ""
},
{
"docid": "9e5d61a6f2ecf0da3e3d8a2260695574",
"score": "0.61709154",
"text": "def successful?\n false\n end",
"title": ""
},
{
"docid": "79b1d4a0c895f26aa0085883733449d0",
"score": "0.6170323",
"text": "def successful?\n status >= 200 && status < 300\n end",
"title": ""
},
{
"docid": "35d716f46d9588f4287d2b0baff06b3b",
"score": "0.6168391",
"text": "def success?\n body['ok']\n end",
"title": ""
},
{
"docid": "bbe7e22fd97d9197c34286a69d8821d0",
"score": "0.61582947",
"text": "def success?\n return true if @status == :success\n\n return false\n end",
"title": ""
},
{
"docid": "fe1d666bdf6a1d9bedb4bc091e25fe0e",
"score": "0.615231",
"text": "def should_respond_with(response)\n should \"respond with #{response}\" do\n matcher = respond_with(response)\n assert_accepts matcher, @controller\n end\n end",
"title": ""
},
{
"docid": "e3719c1c70ec73290352fd4ca67c72df",
"score": "0.6152246",
"text": "def success?\n return true if @status == :success\n\n false\n end",
"title": ""
},
{
"docid": "bc61a38538ecce68902c1cfda7b8bfc9",
"score": "0.61498255",
"text": "def success?\n status == :ok\n end",
"title": ""
},
{
"docid": "fa3839b3e7f0c29db736a048e4758be7",
"score": "0.6148448",
"text": "def successful\n end",
"title": ""
},
{
"docid": "fa3839b3e7f0c29db736a048e4758be7",
"score": "0.6148448",
"text": "def successful\n end",
"title": ""
},
{
"docid": "fdecc86c7a84a3ae17ede4e8f730b1f6",
"score": "0.6138527",
"text": "def success?\n code == \"200\"\n end",
"title": ""
},
{
"docid": "ac22c8a718b9b418c0bedbef7fcf35fc",
"score": "0.61272776",
"text": "def success?\n return true if status == :success\n\n false\n end",
"title": ""
},
{
"docid": "1fd2ef6fc07ea9e56480132a5013b673",
"score": "0.61246747",
"text": "def ok\n halt Rack::Utils.status_code(:ok)\n end",
"title": ""
},
{
"docid": "3ddc6a1cbf6a476172fdd69a85d6b278",
"score": "0.612362",
"text": "def success?\n return true if status == :success\n\n return false\n end",
"title": ""
},
{
"docid": "8e43ce1e2bf299119fb07e2f3658c201",
"score": "0.61182165",
"text": "def successful?\n !!@success\n end",
"title": ""
},
{
"docid": "9c4c8621c90d5a9785844ff50e51d535",
"score": "0.6116227",
"text": "def success?\n super && params[:response] == self.class.request_received_value\n end",
"title": ""
},
{
"docid": "5806b0b715b0b0dcaa4942a189570fee",
"score": "0.61127734",
"text": "def success?(label)\n ensure_response(label)\n @successes.has_key?(label)\n end",
"title": ""
},
{
"docid": "09202bf693e7dee0f1fe3110d76312d0",
"score": "0.6106673",
"text": "def success?\r\n return true if self.status==:success\r\n return false\r\n end",
"title": ""
},
{
"docid": "757c9eee039e0ed4558d3508d3f0e2fe",
"score": "0.6103389",
"text": "def is_success?\n self.status == :success\n end",
"title": ""
},
{
"docid": "dd6761660d0cd6472e0135bb8dd05d34",
"score": "0.60971016",
"text": "def success?(response)\n response.success?\n end",
"title": ""
},
{
"docid": "240b4561216d7e0659abab452b486ac7",
"score": "0.6087333",
"text": "def success?\n super && params[:result_code] == 'Success'\n end",
"title": ""
},
{
"docid": "41f62eeda6df1f15e756f2a17bf7c90c",
"score": "0.6083754",
"text": "def ok?\n response.ok?\n end",
"title": ""
},
{
"docid": "691ec030f385b5489052daf20805e544",
"score": "0.60829103",
"text": "def is_ok?\n code == 200\n end",
"title": ""
},
{
"docid": "691ec030f385b5489052daf20805e544",
"score": "0.60829103",
"text": "def is_ok?\n code == 200\n end",
"title": ""
},
{
"docid": "691ec030f385b5489052daf20805e544",
"score": "0.60829103",
"text": "def is_ok?\n code == 200\n end",
"title": ""
},
{
"docid": "691ec030f385b5489052daf20805e544",
"score": "0.60829103",
"text": "def is_ok?\n code == 200\n end",
"title": ""
},
{
"docid": "48e18b8188cb8ada20b88b09b1b5583c",
"score": "0.60753316",
"text": "def response_success(class_name, action_name)\n render status: 200, json: { status: 200, message: \"Success #{class_name.capitalize} #{action_name.capitalize}\" }\n end",
"title": ""
},
{
"docid": "0496bd05b03537b967953eee75ae0511",
"score": "0.6072469",
"text": "def assert_ok\n assert_status 200\n end",
"title": ""
},
{
"docid": "dc81e29ab121c0669f001182816f9679",
"score": "0.60719055",
"text": "def successful?\n if @successful.nil?\n true\n else\n @successful\n end\n end",
"title": ""
},
{
"docid": "3b238cfc856c39815bca946968b1b8e2",
"score": "0.6070516",
"text": "def success?\n @status == 0\n end",
"title": ""
},
{
"docid": "3b238cfc856c39815bca946968b1b8e2",
"score": "0.6070516",
"text": "def success?\n @status == 0\n end",
"title": ""
},
{
"docid": "95f72024ed5e4fefaee3db935398bbf5",
"score": "0.6063646",
"text": "def ok_status_code\n 200\n end",
"title": ""
},
{
"docid": "419322a1ac475ccfdf8088794b279dc4",
"score": "0.60607326",
"text": "def success?\r\n status_code >= 200 && status_code < 300\r\n end",
"title": ""
},
{
"docid": "3c0df4ae24917a0e4606103f46250602",
"score": "0.6060671",
"text": "def request_successful?(response)\n case response['status']\n when 'success'\n true\n when 'fail'\n false\n end\n end",
"title": ""
},
{
"docid": "856508c718aa90ea2805a937c02bdb39",
"score": "0.60549986",
"text": "def success?\n self[:status] == 'success'\n end",
"title": ""
},
{
"docid": "05039aa36847848cd11f3f3edc86a9d2",
"score": "0.6051928",
"text": "def ok?\n HTTP::Status.successful?(status)\n end",
"title": ""
},
{
"docid": "e1e3fc673f0bed2c21fb8fd14611bad7",
"score": "0.6051561",
"text": "def success?\n super && self.http_data[\"status\"] == \"SUCCESS\"\n end",
"title": ""
},
{
"docid": "e1e3fc673f0bed2c21fb8fd14611bad7",
"score": "0.6051561",
"text": "def success?\n super && self.http_data[\"status\"] == \"SUCCESS\"\n end",
"title": ""
},
{
"docid": "5cdd24b0fc92d49d3b091798eee97ce6",
"score": "0.6046304",
"text": "def is_successful?\n self.response == \"1\" ? true : false\n end",
"title": ""
},
{
"docid": "8c284e4c6f5337cf68cd6aeb22696181",
"score": "0.6045958",
"text": "def assert_response_ok\n begin\n if @response.redirect?\n #should be ok to be a redirect of somekind... could make an option to fail if redirect\n else\n assert_response :success\n end\n rescue\n view :error\n raise\n end\n end",
"title": ""
},
{
"docid": "260f45743348d1e04ae9dab81036b315",
"score": "0.6040091",
"text": "def successful?( response )\n response && response[ :status ] && ( response[ :status ][ :code ] == 200 )\n end",
"title": ""
},
{
"docid": "fe6ee33429af75c18a5100a02a612206",
"score": "0.6037148",
"text": "def success?\n @http_response.code == 200 && to_o.response_code == \"200\"\n end",
"title": ""
},
{
"docid": "5558abc38631e982b2e72ed053ac8ee9",
"score": "0.6036102",
"text": "def test\n render json: { message: 'Success!' }, status: :ok\n end",
"title": ""
},
{
"docid": "5558abc38631e982b2e72ed053ac8ee9",
"score": "0.6036102",
"text": "def test\n render json: { message: 'Success!' }, status: :ok\n end",
"title": ""
},
{
"docid": "0b8276c6f610fd4d331d363de5ead6e1",
"score": "0.60250926",
"text": "def success?\n @status\n end",
"title": ""
},
{
"docid": "e2c32015aa7d997432b009b3b1b365a6",
"score": "0.60195374",
"text": "def success?\n (200..204).include? @status\n end",
"title": ""
},
{
"docid": "4b30c5806bbb8c6b41fb6352735964a1",
"score": "0.6014814",
"text": "def success?\n status_code >= 200 && status_code < 300\n end",
"title": ""
},
{
"docid": "5df6fdd49fab757f615282f49d452c0c",
"score": "0.6014034",
"text": "def success?\n true\n end",
"title": ""
},
{
"docid": "5df6fdd49fab757f615282f49d452c0c",
"score": "0.6014034",
"text": "def success?\n true\n end",
"title": ""
},
{
"docid": "8d1494f8855a14191f5cca41717c4559",
"score": "0.60075545",
"text": "def is_success?\n return success\n end",
"title": ""
},
{
"docid": "dd946d306da77625b0559b3792536ff0",
"score": "0.6007012",
"text": "def success?\n response.status.between? 200, 299\n end",
"title": ""
},
{
"docid": "30682fff7527c4f080b6e012eae860f1",
"score": "0.5991834",
"text": "def success\n \tstatus == \"OK\"\n end",
"title": ""
},
{
"docid": "08bab04a1ced2f5f8d334f43ed05caad",
"score": "0.5989855",
"text": "def successful?(response)\n adapter.successful?(response)\n end",
"title": ""
},
{
"docid": "a90e15a4368fc75bf4237b1347e8f15c",
"score": "0.59870994",
"text": "def successful?\n @code == 0\n end",
"title": ""
},
{
"docid": "994bf5ca9655d9fcbe39ccd0b543949b",
"score": "0.59797245",
"text": "def success?(action)\n report = Deploy::Utils.xunit_to_list report_read(action)\n report[:errors] == 0\n end",
"title": ""
},
{
"docid": "cee767154920ee7dfd44ec2d71868379",
"score": "0.59504026",
"text": "def response_is_success(response)\n response.code == '200'\n end",
"title": ""
},
{
"docid": "c7aceae2d2b219825b4a6508eb9142f4",
"score": "0.59470814",
"text": "def success?\n @params['Success'] == '1'\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "adce976fbeffbe5a49c1fc1a44944493",
"score": "0.0",
"text": "def set_ensamblaje\n @ensamblaje = Ensamblaje.find(params[:id])\n end",
"title": ""
}
] |
[
{
"docid": "631f4c5b12b423b76503e18a9a606ec3",
"score": "0.60320485",
"text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end",
"title": ""
},
{
"docid": "7b068b9055c4e7643d4910e8e694ecdc",
"score": "0.6013371",
"text": "def on_setup_callbacks; end",
"title": ""
},
{
"docid": "311e95e92009c313c8afd74317018994",
"score": "0.5922535",
"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.59156126",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "8315debee821f8bfc9718d31b654d2de",
"score": "0.59156126",
"text": "def initialize(*args)\n super\n @action = :setup\nend",
"title": ""
},
{
"docid": "bfea4d21895187a799525503ef403d16",
"score": "0.589823",
"text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end",
"title": ""
},
{
"docid": "352de4abc4d2d9a1df203735ef5f0b86",
"score": "0.5890472",
"text": "def required_action\n # TODO: implement\n end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890387",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890387",
"text": "def actions; end",
"title": ""
},
{
"docid": "801bc998964ea17eb98ed4c3e067b1df",
"score": "0.5890387",
"text": "def actions; end",
"title": ""
},
{
"docid": "8713cb2364ff3f2018b0d52ab32dbf37",
"score": "0.58775556",
"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.5863097",
"text": "def actions\n\n end",
"title": ""
},
{
"docid": "930a930e57ae15f432a627a277647f2e",
"score": "0.5810218",
"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.5741132",
"text": "def setup\n common_setup\n end",
"title": ""
},
{
"docid": "a5ca4679d7b3eab70d3386a5dbaf27e1",
"score": "0.57315207",
"text": "def perform_setup\n end",
"title": ""
},
{
"docid": "ec7554018a9b404d942fc0a910ed95d9",
"score": "0.571736",
"text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end",
"title": ""
},
{
"docid": "9c186951c13b270d232086de9c19c45b",
"score": "0.56991524",
"text": "def callbacks; end",
"title": ""
},
{
"docid": "c85b0efcd2c46a181a229078d8efb4de",
"score": "0.56929684",
"text": "def custom_setup\n\n end",
"title": ""
},
{
"docid": "100180fa74cf156333d506496717f587",
"score": "0.5667968",
"text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend",
"title": ""
},
{
"docid": "2198a9876a6ec535e7dcf0fd476b092f",
"score": "0.5652351",
"text": "def initial_action; end",
"title": ""
},
{
"docid": "b9b75a9e2eab9d7629c38782c0f3b40b",
"score": "0.5649619",
"text": "def setup_intent; end",
"title": ""
},
{
"docid": "471d64903a08e207b57689c9fbae0cf9",
"score": "0.5637822",
"text": "def setup_controllers &proc\n @global_setup = proc\n self\n end",
"title": ""
},
{
"docid": "468d85305e6de5748477545f889925a7",
"score": "0.56270146",
"text": "def inner_action; end",
"title": ""
},
{
"docid": "bb445e7cc46faa4197184b08218d1c6d",
"score": "0.56099445",
"text": "def pre_action\n # Override this if necessary.\n end",
"title": ""
},
{
"docid": "432f1678bb85edabcf1f6d7150009703",
"score": "0.5595848",
"text": "def target_callbacks() = commands",
"title": ""
},
{
"docid": "48804b0fa534b64e7885b90cf11bff31",
"score": "0.5595191",
"text": "def execute_callbacks; end",
"title": ""
},
{
"docid": "5aab98e3f069a87e5ebe77b170eab5b9",
"score": "0.5588875",
"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.55566645",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "9efbca664902d80a451ef6cff0334fe2",
"score": "0.55566645",
"text": "def global_callbacks; end",
"title": ""
},
{
"docid": "482481e8cf2720193f1cdcf32ad1c31c",
"score": "0.55095106",
"text": "def required_keys(action)\n\n end",
"title": ""
},
{
"docid": "353fd7d7cf28caafe16d2234bfbd3d16",
"score": "0.55039996",
"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.5466593",
"text": "def layout_actions\n \n end",
"title": ""
},
{
"docid": "2f6ef0a1ebe74f4d79ef0fb81af59d40",
"score": "0.54660857",
"text": "def on_setup(&block); end",
"title": ""
},
{
"docid": "8ab2a5ea108f779c746016b6f4a7c4a8",
"score": "0.5449364",
"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.54439306",
"text": "def before(action)\n invoke_callbacks *options_for(action).before\n end",
"title": ""
},
{
"docid": "6bd37bc223849096c6ea81aeb34c207e",
"score": "0.5439483",
"text": "def post_setup\n end",
"title": ""
},
{
"docid": "07fd9aded4aa07cbbba2a60fda726efe",
"score": "0.54181427",
"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.54119074",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "dbebed3aa889e8b91b949433e5260fb5",
"score": "0.54119074",
"text": "def action_methods; end",
"title": ""
},
{
"docid": "9358208395c0869021020ae39071eccd",
"score": "0.53994405",
"text": "def post_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.53937256",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "c5904f93614d08afa38cc3f05f0d2365",
"score": "0.53937256",
"text": "def before_setup; end",
"title": ""
},
{
"docid": "cb5bad618fb39e01c8ba64257531d610",
"score": "0.5391617",
"text": "def define_model_action(methods,action,default_options={:validate => true})\n default_options.merge!(methods.extract_options!)\n actions = [action,\"#{action}!\".to_sym]\n actions.each do |a|\n define_method(a) do |opts = {}|\n rslt = nil\n options = default_options.merge(opts)\n options[:raise_exception] = a.to_s.match(/\\!$/)\n run_callbacks(action) do\n rslt = run_model_action(methods,options)\n end\n run_after_any\n rslt\n end\n end\n end",
"title": ""
},
{
"docid": "a468b256a999961df3957e843fd9bdf4",
"score": "0.5387492",
"text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end",
"title": ""
},
{
"docid": "f099a8475f369ce73a38d665b6ee6877",
"score": "0.53801376",
"text": "def action_run\n end",
"title": ""
},
{
"docid": "2c4e5a90aa8efaaa3ed953818a9b30d2",
"score": "0.5358599",
"text": "def execute(setup)\n @action.call(setup)\n end",
"title": ""
},
{
"docid": "725216eb875e8fa116cd55eac7917421",
"score": "0.5349504",
"text": "def setup\n @controller.setup\n end",
"title": ""
},
{
"docid": "118932433a8cfef23bb8a921745d6d37",
"score": "0.53479505",
"text": "def register_action(action); end",
"title": ""
},
{
"docid": "39c39d6fe940796aadbeaef0ce1c360b",
"score": "0.5346732",
"text": "def setup_phase; end",
"title": ""
},
{
"docid": "bd03e961c8be41f20d057972c496018c",
"score": "0.53440404",
"text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end",
"title": ""
},
{
"docid": "c6352e6eaf17cda8c9d2763f0fbfd99d",
"score": "0.5342186",
"text": "def initial_action=(_arg0); end",
"title": ""
},
{
"docid": "207a668c9bce9906f5ec79b75b4d8ad7",
"score": "0.53266597",
"text": "def before_setup\n\n end",
"title": ""
},
{
"docid": "669ee5153c4dc8ee81ff32c4cefdd088",
"score": "0.53030294",
"text": "def ensure_before_and_after; end",
"title": ""
},
{
"docid": "c77ece7b01773fb7f9f9c0f1e8c70332",
"score": "0.5285732",
"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.5284358",
"text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end",
"title": ""
},
{
"docid": "4ad1208a9b6d80ab0dd5dccf8157af63",
"score": "0.52565944",
"text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end",
"title": ""
},
{
"docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7",
"score": "0.52556264",
"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.5250511",
"text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end",
"title": ""
},
{
"docid": "8945e9135e140a6ae6db8d7c3490a645",
"score": "0.52470475",
"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.52388334",
"text": "def action; end",
"title": ""
},
{
"docid": "e6d7c691bed78fb0eeb9647503f4a244",
"score": "0.52388334",
"text": "def action; end",
"title": ""
},
{
"docid": "7b3954deb2995cf68646c7333c15087b",
"score": "0.5237919",
"text": "def after_setup\n end",
"title": ""
},
{
"docid": "1dddf3ac307b09142d0ad9ebc9c4dba9",
"score": "0.5233395",
"text": "def external_action\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "5772d1543808c2752c186db7ce2c2ad5",
"score": "0.52305096",
"text": "def actions(state:)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "64a6d16e05dd7087024d5170f58dfeae",
"score": "0.5224124",
"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.5220735",
"text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end",
"title": ""
},
{
"docid": "db0cb7d7727f626ba2dca5bc72cea5a6",
"score": "0.52206117",
"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.5215545",
"text": "def pick_action; end",
"title": ""
},
{
"docid": "7bbfb366d2ee170c855b1d0141bfc2a3",
"score": "0.52138394",
"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.5210016",
"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.5207759",
"text": "def ac_action(&blk)\n @action = blk\n end",
"title": ""
},
{
"docid": "4c23552739b40c7886414af61210d31c",
"score": "0.52053165",
"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": "6a98e12d6f15af80f63556fcdd01e472",
"score": "0.52050936",
"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.52028465",
"text": "def create_setup\n \n end",
"title": ""
},
{
"docid": "691d5a5bcefbef8c08db61094691627c",
"score": "0.5201899",
"text": "def performed(action)\n end",
"title": ""
},
{
"docid": "ad33138fb4bd42d9785a8f84821bfd88",
"score": "0.51971984",
"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.51971984",
"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.5189866",
"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.5180898",
"text": "def setup(instance)\n action(:setup, instance)\n end",
"title": ""
},
{
"docid": "9f1f73ee40d23f6b808bb3fbbf6af931",
"score": "0.5179142",
"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.5173538",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5173538",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "b4f4e1d4dfd31919ab39aecccb9db1d0",
"score": "0.5173538",
"text": "def setup(resources) ; end",
"title": ""
},
{
"docid": "7a0c9d839516dc9d0014e160b6e625a8",
"score": "0.51641655",
"text": "def setup(request)\n end",
"title": ""
},
{
"docid": "e441ee807f2820bf3655ff2b7cf397fc",
"score": "0.5151931",
"text": "def after_setup; end",
"title": ""
},
{
"docid": "c594a0d7b6ae00511d223b0533636c9c",
"score": "0.5142854",
"text": "def code_action_provider; end",
"title": ""
},
{
"docid": "1d375c9be726f822b2eb9e2a652f91f6",
"score": "0.51420087",
"text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end",
"title": ""
},
{
"docid": "faddd70d9fef5c9cd1f0d4e673e408b9",
"score": "0.5141399",
"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.51397336",
"text": "def setup(params)\n end",
"title": ""
},
{
"docid": "111fd47abd953b35a427ff0b098a800a",
"score": "0.5134713",
"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.51165104",
"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.5114052",
"text": "def setup\n transition_to(:setup)\n end",
"title": ""
},
{
"docid": "4c7a1503a86fb26f1e4b4111925949a2",
"score": "0.5111094",
"text": "def scaffold_setup_helper\n include ScaffoldingExtensions::Helper\n include ScaffoldingExtensions::MerbControllerHelper\n include ScaffoldingExtensions::PrototypeHelper\n include ScaffoldingExtensions::Controller\n include ScaffoldingExtensions::MerbController\n before :scaffold_check_nonidempotent_requests\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110216",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110216",
"text": "def action\n end",
"title": ""
},
{
"docid": "975ecc8d218b62d480bbe0f6e46e72bb",
"score": "0.5110216",
"text": "def action\n end",
"title": ""
},
{
"docid": "63849e121dcfb8a1b963f040d0fe3c28",
"score": "0.5107504",
"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.51062083",
"text": "def block_actions options ; end",
"title": ""
},
{
"docid": "0d1c87e5cf08313c959963934383f5ae",
"score": "0.5099243",
"text": "def on_action(action)\n @action = action\n self\n end",
"title": ""
},
{
"docid": "916d3c71d3a5db831a5910448835ad82",
"score": "0.50964487",
"text": "def do_action(action)\n case action\n when \"a\"\n @user_manager.create_user\n when \"b\"\n @user_manager.delete_user\n when \"c\"\n @user_manager.get_info\n when \"d\"\n @user_manager.list_all_users\n when \"quit\", \"exit\"\n bail\n end\n end",
"title": ""
},
{
"docid": "35b302dd857a031b95bc0072e3daa707",
"score": "0.50935394",
"text": "def config(action, *args); end",
"title": ""
}
] |
ef1bc5eac9e44b6cdc70f79b1e2e1c25
|
Returns the 'directory' of the RubyPython::Python object; similar to methods in Ruby.
|
[
{
"docid": "889eabd2c249d8754580a3601ad87c3b",
"score": "0.7192968",
"text": "def dir\n return self.class.new(RubyPython::Python.PyObject_Dir(@pointer)).rubify.map do |x|\n x.to_sym\n end\n end",
"title": ""
}
] |
[
{
"docid": "001e64c3a08c7fdd687e6a1243c74a03",
"score": "0.69503546",
"text": "def get_dir; @dir; end",
"title": ""
},
{
"docid": "1968e80e8e7d533f1c255bb6d520d4bb",
"score": "0.69063044",
"text": "def dirname\n File.dirname(self)\n end",
"title": ""
},
{
"docid": "be1a593fc06b99d78b61412413a05a10",
"score": "0.67933863",
"text": "def directory\n @directory.path\n end",
"title": ""
},
{
"docid": "a9256e2f76cb7552ef861a38baa6959e",
"score": "0.6777029",
"text": "def get_directory\n end",
"title": ""
},
{
"docid": "df42b7ebde0b8d0aeb79a20f07e03654",
"score": "0.6746828",
"text": "def directory\n @directory\n end",
"title": ""
},
{
"docid": "8440db5d6885d853070e9b463917557f",
"score": "0.6727966",
"text": "def directory\n @directory ||= workdir\n end",
"title": ""
},
{
"docid": "1c59cdeb0c4e3918a98a9695fb2a9ad6",
"score": "0.67166376",
"text": "def directory\n self.directory? ? self : self.dirname\n end",
"title": ""
},
{
"docid": "421de17926d6b459267ceb1c8ef73dfb",
"score": "0.66818357",
"text": "def get_directory\r\n end",
"title": ""
},
{
"docid": "9f09a1fed4576b55f45929a134d0cee7",
"score": "0.667119",
"text": "def dir\n @working_directory\n end",
"title": ""
},
{
"docid": "512d27a53d5e5b386ff6fa771fc79c8a",
"score": "0.6665055",
"text": "def get_directory; end",
"title": ""
},
{
"docid": "11b4c1296f6a05db456145e9aa4b3d49",
"score": "0.6664369",
"text": "def determine_directory path\n @file_system.dirname path\n end",
"title": ""
},
{
"docid": "a089f0082873291997e4f595191a4891",
"score": "0.6590725",
"text": "def directory\n @directory\n end",
"title": ""
},
{
"docid": "7327813f027c249a0fbf688af4c123e5",
"score": "0.65870184",
"text": "def dir\n File.dirname( path )\n end",
"title": ""
},
{
"docid": "7d64c6b7766ad9b6b00e0ea34e0aaa8c",
"score": "0.65808237",
"text": "def dir\n File.dirname(path)\n end",
"title": ""
},
{
"docid": "c118b2b34c9004736936aa881c68d829",
"score": "0.6575992",
"text": "def dir\n @dir ||= directory? ? path : File.dirname(path)\n end",
"title": ""
},
{
"docid": "e0ec06b7cc7ec9af9c247bf33a07d026",
"score": "0.6562466",
"text": "def get_file_directory\n return @directory\n end",
"title": ""
},
{
"docid": "45e31b4d75b5b5ebe9c156cf9f9434a4",
"score": "0.6549478",
"text": "def directory_name\r\n \"./\"\r\n end",
"title": ""
},
{
"docid": "d4c93d26493070eea6a36f0a18d5d06a",
"score": "0.6543196",
"text": "def directory\n @directory\n end",
"title": ""
},
{
"docid": "d4c93d26493070eea6a36f0a18d5d06a",
"score": "0.6543196",
"text": "def directory\n @directory\n end",
"title": ""
},
{
"docid": "f88caeaa2ed9bb75f84f11994fd02389",
"score": "0.65357274",
"text": "def path\n @directory\n end",
"title": ""
},
{
"docid": "2ac90dd21e82e333efdb651f52068036",
"score": "0.6535423",
"text": "def directory\n unless @directory\n raise \"Must set @directory to the base directory for this command\"\n end\n\n @directory\n end",
"title": ""
},
{
"docid": "bc738d295c297b7f2449598289457cb8",
"score": "0.65267515",
"text": "def getdir; end",
"title": ""
},
{
"docid": "85b06d8975c893a12033c3b579920e43",
"score": "0.6519038",
"text": "def module_directory\n install_root + FileSep + self['ModuleDirectory']\n end",
"title": ""
},
{
"docid": "0fd8497ee44614980ac5eed1ce946793",
"score": "0.6511229",
"text": "def dir\r\n raise \"dir not set\" unless @dir\r\n @dir\r\n end",
"title": ""
},
{
"docid": "a1348c74837448fd38056d0013a6f0f5",
"score": "0.6509371",
"text": "def dir\n Path.new(File.dirname(@path))\n end",
"title": ""
},
{
"docid": "0545a2fc4617af701b1c72cd0eed5183",
"score": "0.64970994",
"text": "def dirname\n @dirname || DEFAULT_DIRNAME\n end",
"title": ""
},
{
"docid": "3aec4c25946bc5cbc0e3df467299add0",
"score": "0.6496794",
"text": "def dirname\n self.class.new(File.dirname(self))\n end",
"title": ""
},
{
"docid": "7115dea63f95f9d3e92af4c46bb42dda",
"score": "0.6471058",
"text": "def r_Dir\n r_const_get :Dir\n end",
"title": ""
},
{
"docid": "8d679fa20e07dfa32eed0e24b0a30b35",
"score": "0.64543986",
"text": "def directory; end",
"title": ""
},
{
"docid": "8d679fa20e07dfa32eed0e24b0a30b35",
"score": "0.64543986",
"text": "def directory; end",
"title": ""
},
{
"docid": "8d679fa20e07dfa32eed0e24b0a30b35",
"score": "0.64543986",
"text": "def directory; end",
"title": ""
},
{
"docid": "8d679fa20e07dfa32eed0e24b0a30b35",
"score": "0.64543986",
"text": "def directory; end",
"title": ""
},
{
"docid": "8d679fa20e07dfa32eed0e24b0a30b35",
"score": "0.64543986",
"text": "def directory; end",
"title": ""
},
{
"docid": "86f4e2e8eee11ef152faeb86f9ed1bd6",
"score": "0.6445853",
"text": "def dir\n self\n end",
"title": ""
},
{
"docid": "df9817d72bdb8e6e95ff13fa8ad67b6c",
"score": "0.6442095",
"text": "def enclosed_directory\n \".\"\nend",
"title": ""
},
{
"docid": "df9817d72bdb8e6e95ff13fa8ad67b6c",
"score": "0.6442095",
"text": "def enclosed_directory\n \".\"\nend",
"title": ""
},
{
"docid": "2217d4a79699987657ba0717a1a7ead0",
"score": "0.64386636",
"text": "def dir()\n\t\traise \"dir() called on a Builder with no target set yet\" if targets().empty?()\n\t\treturn targets()[0].dirname()\n\tend",
"title": ""
},
{
"docid": "1089cd8280d0a7f82196fefcb4c6f123",
"score": "0.6423985",
"text": "def class_dir ; nil ; end",
"title": ""
},
{
"docid": "0defe7325e3306f7cc9a4ab200f467da",
"score": "0.6410505",
"text": "def dir\n File.dirname(complete_path)\n end",
"title": ""
},
{
"docid": "e412241fadfd7308c9e51c5f479f73fa",
"score": "0.6408256",
"text": "def dirname\n ::File.dirname @relative_path\n end",
"title": ""
},
{
"docid": "edfa93502698a808b0cad8acbdf7e475",
"score": "0.63798696",
"text": "def class_dir ; DIR_CLASS ; end",
"title": ""
},
{
"docid": "9889d9a71aae2e2c74748b014f7325be",
"score": "0.6358271",
"text": "def dir\n return File.expand_path(File.dirname(__FILE__))\n end",
"title": ""
},
{
"docid": "a8d4022850435b99c14690e062fe4b37",
"score": "0.6355426",
"text": "def dirname()\n @dirname ||= File.dirname(@path)\n end",
"title": ""
},
{
"docid": "da7111b5809b0b630a67516e96d3a367",
"score": "0.63497007",
"text": "def dirname\n rebuild(@path.dirname).as_directory\n end",
"title": ""
},
{
"docid": "6b95406a606b79ab9f82badaef207d47",
"score": "0.6349533",
"text": "def dir; end",
"title": ""
},
{
"docid": "6b95406a606b79ab9f82badaef207d47",
"score": "0.6349533",
"text": "def dir; end",
"title": ""
},
{
"docid": "6b95406a606b79ab9f82badaef207d47",
"score": "0.6349533",
"text": "def dir; end",
"title": ""
},
{
"docid": "6b95406a606b79ab9f82badaef207d47",
"score": "0.6349533",
"text": "def dir; end",
"title": ""
},
{
"docid": "6b95406a606b79ab9f82badaef207d47",
"score": "0.6349533",
"text": "def dir; end",
"title": ""
},
{
"docid": "6b95406a606b79ab9f82badaef207d47",
"score": "0.6349533",
"text": "def dir; end",
"title": ""
},
{
"docid": "6b95406a606b79ab9f82badaef207d47",
"score": "0.6349533",
"text": "def dir; end",
"title": ""
},
{
"docid": "6b95406a606b79ab9f82badaef207d47",
"score": "0.6349533",
"text": "def dir; end",
"title": ""
},
{
"docid": "2f1bda3b2a8f27bfe9f700d0d1c3a36e",
"score": "0.6328256",
"text": "def root\n File.dirname __dir__\n end",
"title": ""
},
{
"docid": "2f1bda3b2a8f27bfe9f700d0d1c3a36e",
"score": "0.6328256",
"text": "def root\n File.dirname __dir__\n end",
"title": ""
},
{
"docid": "2f1bda3b2a8f27bfe9f700d0d1c3a36e",
"score": "0.6328256",
"text": "def root\n File.dirname __dir__\n end",
"title": ""
},
{
"docid": "7b3be38b7e9d51b9a2d6fe0ff72e5dc5",
"score": "0.63263303",
"text": "def __DIR__\n File.dirname(self.__FILE__)\n end",
"title": ""
},
{
"docid": "823938da6f0bc2f33c7315d5c6536d33",
"score": "0.63225377",
"text": "def lib_dir\n return model.lib_dir\n end",
"title": ""
},
{
"docid": "e67de9cf5e6330248fb357595345ad52",
"score": "0.63219637",
"text": "def get_directory\r\n Course.find(self.node_object_id).directory_path\r\n end",
"title": ""
},
{
"docid": "92b002abdaab16dfb43e7ef136507c82",
"score": "0.6308108",
"text": "def object_dir; nil end",
"title": ""
},
{
"docid": "a1e450cfac0bfbdc192d90a2243db162",
"score": "0.63044965",
"text": "def parent_directory\r\n end",
"title": ""
},
{
"docid": "3d002142a861d8b13f28cc0ffc43684d",
"score": "0.62797403",
"text": "def directory\n File.join(Cfg.rootdir, @category, @suitename, @component)\n end",
"title": ""
},
{
"docid": "975614168ed24b419043dd42ad859e80",
"score": "0.6277158",
"text": "def base_dir\n self.class.base_dir\n end",
"title": ""
},
{
"docid": "5254a4798d4a29d726b797f6bb5b2fde",
"score": "0.6274315",
"text": "def dirname\n @dirname ||= File.dirname(@path)\n end",
"title": ""
},
{
"docid": "31eaca09d98cbc9342af22e112c77967",
"score": "0.62724656",
"text": "def root\n File.dirname __dir__\n end",
"title": ""
},
{
"docid": "447504464f31b1569fb4837a75cd0079",
"score": "0.6266745",
"text": "def dir\n File.dirname(filename)\n end",
"title": ""
},
{
"docid": "a4d6ec21e232f3fab74ddbb906b69013",
"score": "0.6265246",
"text": "def dir\n nil\n end",
"title": ""
},
{
"docid": "7d0f1cb3dc33cf7dcaca7ad2ad417d12",
"score": "0.62635076",
"text": "def root\n File.dirname __dir__\n end",
"title": ""
},
{
"docid": "ad05ddb93fca2f31a9f5f8bff4c8ebe9",
"score": "0.62599784",
"text": "def dir\n if dirs\n if relative?\n File.join(*dirs)\n else\n File.join(\"\", *dirs)\n end\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "635d16702a73e21ea1240bad8aaef321",
"score": "0.625371",
"text": "def dir_path\n @dir_path ||= (owner.respond_to?(:dir_path) ? owner.dir_path : \"#{parent.parent.dir_path}/#{node_name}\")\n end",
"title": ""
},
{
"docid": "2fa1ad24199c3cad26c64aed9b6864a8",
"score": "0.62375546",
"text": "def lib_folder\n File.join(@directory.lib, @package.name_tuple.folder_name)\n end",
"title": ""
},
{
"docid": "57af7e12b30b46f0a7e2f9114fde3823",
"score": "0.6231711",
"text": "def get_base_directory\n File.expand_path(\".\")\n end",
"title": ""
},
{
"docid": "8a5625ba167a1c5c44e83d974663b3f9",
"score": "0.6214616",
"text": "def path\n @path ||= environment.modulepath.collect { |path| File.join(path, name) }.find { |d| FileTest.directory?(d) }\n end",
"title": ""
},
{
"docid": "501c82084c22cca6387265d621dcfbd0",
"score": "0.62088764",
"text": "def dir\n # TODO: escape user name\n @workspace.dir + @name\n end",
"title": ""
},
{
"docid": "d70e87691a609aee8a6f7f466a7ad23a",
"score": "0.62034607",
"text": "def dirname\n File.dirname path\n end",
"title": ""
},
{
"docid": "789fc120f363de3121684833bca43d66",
"score": "0.6192096",
"text": "def dir\n url[-1, 1] == '/' ? url : File.dirname(url)\n end",
"title": ""
},
{
"docid": "b1736201d51c60849a8784095adadad1",
"score": "0.6189885",
"text": "def parent_directory\r\n nil\r\n end",
"title": ""
},
{
"docid": "b1736201d51c60849a8784095adadad1",
"score": "0.6189885",
"text": "def parent_directory\r\n nil\r\n end",
"title": ""
},
{
"docid": "43467fea58aba020965f3b9b5370041a",
"score": "0.6177115",
"text": "def lib_directory\n ::File.expand_path(::File.join(::File.dirname(__FILE__)))\n end",
"title": ""
},
{
"docid": "0a2122e55b10ce520b532ae91e2bf91f",
"score": "0.61766297",
"text": "def dirname\n tr = folder? ? @pathname.to_s : @pathname.dirname.to_s\n tr == \".\" ? \"\" : tr\n end",
"title": ""
},
{
"docid": "18f19323cd706645ef3508aabc0aae6a",
"score": "0.6173631",
"text": "def base_directory\n @base_directory ||=\n directory\n end",
"title": ""
},
{
"docid": "a579cb6c833fff9cf0ea517a6bdc7adf",
"score": "0.61585397",
"text": "def path\n @path ||= self.class.base_path.join(directory_name)\n end",
"title": ""
},
{
"docid": "42c2599a204e9f62bdfb991b9e95fdc3",
"score": "0.61567545",
"text": "def lib_directory\n ::File.expand_path(::File.join(::File.dirname(__FILE__)))\n end",
"title": ""
},
{
"docid": "42c2599a204e9f62bdfb991b9e95fdc3",
"score": "0.61567545",
"text": "def lib_directory\n ::File.expand_path(::File.join(::File.dirname(__FILE__)))\n end",
"title": ""
},
{
"docid": "42c2599a204e9f62bdfb991b9e95fdc3",
"score": "0.61567545",
"text": "def lib_directory\n ::File.expand_path(::File.join(::File.dirname(__FILE__)))\n end",
"title": ""
},
{
"docid": "65997059fd542df8e5e3f374d7ea78e5",
"score": "0.6155378",
"text": "def parent_directory\r\n File.join(%w{C: work})\r\n end",
"title": ""
},
{
"docid": "c350795477f53be8cb866cd2b6359116",
"score": "0.6141101",
"text": "def managed_directory\n @path\n end",
"title": ""
},
{
"docid": "7b67a76ba5e1dea08b5c8e1cfe8bd8f0",
"score": "0.6140093",
"text": "def directory\n FILE_DIRECTORY\nend",
"title": ""
},
{
"docid": "8a20ecfc0459893c0b99873fd9761c1e",
"score": "0.61373883",
"text": "def dirname\n return self if self.match(/\\/$/)\n File.dirname(self) + \"/\"\n end",
"title": ""
},
{
"docid": "fdd327b4c5dcb8cbf3329d21babb2439",
"score": "0.6134136",
"text": "def lib_folder\n File.join(@directory.lib, @package.spec.name_tuple.folder_name)\n end",
"title": ""
},
{
"docid": "93679222525778331d4f8f39a93e5f18",
"score": "0.613147",
"text": "def get_directory\n connection.directories.get(directory_name)\n end",
"title": ""
},
{
"docid": "08272035567d8e024af2420f369a4e4b",
"score": "0.6124965",
"text": "def path\n environment.modulepath.collect { |path| File.join(path, name) }.find { |d| FileTest.directory?(d) }\n end",
"title": ""
},
{
"docid": "2e13b21bb838934eeb4e7cfc3ddfce21",
"score": "0.61215323",
"text": "def dir\n Filer::Dir.new(File.dirname(@path))\n end",
"title": ""
},
{
"docid": "8a5f152dfe7cec305a6d8bf904f8c9d6",
"score": "0.6117418",
"text": "def dirname\n @dirname ||= File.dirname(path)\n end",
"title": ""
},
{
"docid": "7a50f907de8fde4bb2be507c4f2d16a6",
"score": "0.61171305",
"text": "def directory\n # concatenate relative path to root_path\n dir, base = (self.class.root_path + permalink.gsub(/^\\//, '')).split\n normalized = base.to_s.upcase\n\n match = nil\n dir.find do |path|\n if path.basename.to_s.dasherize.upcase == normalized\n match = path\n Find.prune # stop find\n end\n end\n @directory ||= match\n rescue Errno::ENOENT => e\n nil\n end",
"title": ""
},
{
"docid": "3c22ceb1d78f6014e2017eea4cfab485",
"score": "0.6112158",
"text": "def source_directory\n platform_map = { 'x86_64': 'x86_64',\n 'ppc64le': 'powerpc64le'}\n\n os_name_map = {'GNU/Linux': 'linux-gnu'}\n\n\n \"#{platform_map[platform]}-#{os_name_map[os_name]}/\"\n end",
"title": ""
},
{
"docid": "6c2c1159691a489bce03a3a09d51bc94",
"score": "0.6107644",
"text": "def dirname\n Path.new(File.dirname(@path))\n end",
"title": ""
},
{
"docid": "2e30bb9f439acbcb172fc0731c48fd7b",
"score": "0.610123",
"text": "def dirname\n File.dirname source_file\n end",
"title": ""
},
{
"docid": "0d94ca3a58debf782e1d7e0ae6640b65",
"score": "0.6097563",
"text": "def base_dir\n datastore['WritableDir'].to_s\n end",
"title": ""
},
{
"docid": "0d94ca3a58debf782e1d7e0ae6640b65",
"score": "0.6097563",
"text": "def base_dir\n datastore['WritableDir'].to_s\n end",
"title": ""
}
] |
f74c29bdfc4a183e1ec1b91334cd5be2
|
Use callbacks to share common setup or constraints between actions.
|
[
{
"docid": "1db9482e9a7e68b9996e0a8eb7d9a15a",
"score": "0.0",
"text": "def set_classroom\n @classroom = Classroom.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": ""
}
] |
1d7dff36c2b7e96a4c407a701f206371
|
Customize Signing Up Devise Params def sign_up_params params.require(:user).permit(:name, :email, :location, :sex, :dob, :bio, :language, :skillset, :password, :password_confirmation) end Customize User Profile Update Devise Params
|
[
{
"docid": "309fd24d28b1b664548516c4115cc12d",
"score": "0.0",
"text": "def account_update_params\n params.require(:user).permit(:name, :email, :location, :sex, :dob, :bio, :language, :skillset, :password, :password_confirmation, :avatar, :short_description, :tw_url, :fb_url, :ta_url, :video_url, :email_list, :is_guide, :guide_type, :credit, :affiliate, :category, :category => [])\n end",
"title": ""
}
] |
[
{
"docid": "64ab54da0301ae04b7883dcff580e894",
"score": "0.8391736",
"text": "def sign_up_params\n params.require(:user).permit(:email, :password, :password_confirmation, :first_name, :last_name, :dob, :gender,\n :bio, :country_id, :language_id)\n end",
"title": ""
},
{
"docid": "6803911d987a653d636c96e32cded10a",
"score": "0.8369382",
"text": "def sign_up_params\n params.require(:user).permit(:name, :surname, :designation, :facebook, :twitter, :linkedin, :rep?, :date_of_birth, :email, :password, :password_confirmation, :batch, :gender, :industry, :current_location, :education_qualification, :profession, :mobile, :address, :aboutme, :is_active, :avatar, :bloodgroup, :country_code, :native_place, :native_mandal, :native_pin, :admission_year, :passout_year, :current_state, :current_country, :working_sector, :admission_class, :passout_class)\n end",
"title": ""
},
{
"docid": "7bfa221f97f8f5bcedde180b94c880a4",
"score": "0.82001734",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(\n :sign_up,\n keys: %i[name last_name gender nickname hometown birthdate relationship_status about image_base]\n )\n end",
"title": ""
},
{
"docid": "885238a513a3e3e4a2131568cb5e781a",
"score": "0.8194054",
"text": "def sign_up_params\n params.require(:user).permit(:email, :password, :password_confirmation, :first_name, :last_name, :pesel, :address, :phone, :pwz_number, :dob, :age, :weight, :height, :sex, :user_type)\n end",
"title": ""
},
{
"docid": "363345f461374e9556478ee8ca0f38dd",
"score": "0.81556064",
"text": "def sign_up_params\n params.require(:user).permit(:email, :username, :first_name, :last_name, :profile_picture, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "7d8e16d4777401e52ea8ce8b156046ed",
"score": "0.815445",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :sex, :birthday,:marred_status, :sibling, :job, :income, :image, :post_data, :profile])\n end",
"title": ""
},
{
"docid": "78c924cdaeb87e157b73bf2bbf323dcd",
"score": "0.8144507",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up) { |u|\n u.permit(:email, :password, :password_confirmation,\n profile_attributes: [ :first_name, :last_name, :location, :avatar ] )\n }\n end",
"title": ""
},
{
"docid": "ef5ac85f331a851d2a12b722ebad3362",
"score": "0.81365645",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :gender, :birthday, :liberal])\n end",
"title": ""
},
{
"docid": "07c4c9713cb0663faac571d6fd32674c",
"score": "0.8130535",
"text": "def sign_up_params\n params.require(:user).permit(:email, :password, :encrypted_password, :user_name, :contact_first_name, :contact_last_name, :primary_phone, :secondary_phone, :street_address, :city, :county, :state, :zip, :user_type)\n end",
"title": ""
},
{
"docid": "d3e43e14ac6aea03890866b7dd55a486",
"score": "0.8109643",
"text": "def sign_up_params\n\t params.require(:user).permit(:name, :picture, :date_of_birth, :username, :telephone, :email, :password, :password_confirmation, :current_password, :admin, :gravatar_url)\n\tend",
"title": ""
},
{
"docid": "14e7f1072e91f0d73480c7f1c68fe0ca",
"score": "0.80860764",
"text": "def update_sanitized_params\n devise_parameter_sanitizer.for(:sign_up) do |user|\n user.permit :display_name, :location, :soil_type, :years_experience,\n :preferred_growing_style, :email, :password, :password_confirmation\n end\n end",
"title": ""
},
{
"docid": "55b9a086592e5162638950a0d49c809f",
"score": "0.8047237",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up) do |user|\n user.permit(\n :email,\n :first_name,\n :last_name,\n :shirt_size,\n :twitter,\n :website,\n :workplace\n )\n end\n end",
"title": ""
},
{
"docid": "f1f8bbcbbbe4d2dc10b247395f09dbc5",
"score": "0.8041419",
"text": "def user_params\n params.permit(:name, :email, :uid, :age, :sex, :profile)\n end",
"title": ""
},
{
"docid": "2a90290c7eaacf22667c630be28ebb77",
"score": "0.8035933",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, :gender, :dob, :state, :city_id, :uid, :provider, :image, :avatar, :name])\n end",
"title": ""
},
{
"docid": "1501e56e27f124e74dda9d14fc3d35fc",
"score": "0.80295223",
"text": "def sign_up_params\n params.require(:user).permit(:uid, :first_name, :last_name, :email, :password, :password_confirmation, :avatar, :approved, :admin)\n end",
"title": ""
},
{
"docid": "25b8d32f4b44166ae5884f7e8015f6d3",
"score": "0.8019255",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(\n :sign_up,\n keys: [\n :attribute,\n :username,\n profile_attributes: [\n :name,\n :gender,\n :birthdate,\n :email,\n :phone,\n :time_zone,\n address_attributes: %i[\n street\n city\n state\n zip\n ]\n ]\n ]\n )\n end",
"title": ""
},
{
"docid": "b8b0ef0f230842b94bae30e8609cd8ce",
"score": "0.8018671",
"text": "def sign_up_params\n params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation, :avatar,\n :profile, :phone_number, :latlon)\n end",
"title": ""
},
{
"docid": "18b95d7cce5914b9cc957d83acb5d41d",
"score": "0.80169344",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, :phone, :location, :birthday, :avatar, :provider, :uid])\n end",
"title": ""
},
{
"docid": "3cdd2a44b7f3aa71d5245ab7891aa6cc",
"score": "0.8016749",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up,\n keys: [:name, :state_id, :city_id, :role, :profile, :institution, :school_id])\n end",
"title": ""
},
{
"docid": "73ca12bbd06f5e53fafcd92fdefadb87",
"score": "0.8012856",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(:full_name, :username, :email, :password, :password_confirmation)}\n end",
"title": ""
},
{
"docid": "70b03dcd3c07cf1ded2fcfe648a89254",
"score": "0.7985493",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, :user_type, :avatar, :phonenumber, :birthdate])\n end",
"title": ""
},
{
"docid": "368fac62bee461d61e6bb2f0fce5bfee",
"score": "0.7982662",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, :gender, :date_of_birth])\n end",
"title": ""
},
{
"docid": "22529608f38d529add43df50eac09990",
"score": "0.7977803",
"text": "def sign_up_params\n params.require(:user).permit(:name, :email, :DOB, :gender, :image, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "c1c9346036460830583be503879c25b7",
"score": "0.79544985",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) do |u|\n u.permit(:name, :location, :service, :tier, :country, :social_links, :description, :image, :email, :password, :password_confirmation)\n end\n \n end",
"title": ""
},
{
"docid": "da2e2dd6a4b3a5e8ac085a069bf21e0a",
"score": "0.79489577",
"text": "def configure_devise_params\n devise_parameter_sanitizer.for(:sign_up) do |u|\n u.permit(:first_name, :last_name, :gender, :email, :password, :password_confirmation)\n end\n end",
"title": ""
},
{
"docid": "034cac262a28f57fa3422d254a925b3a",
"score": "0.7946001",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:email, :mobile,:roll, :password, :password_confirmation, :remember_me) }\n end",
"title": ""
},
{
"docid": "fbd64f7af61a0a9f6570ee899e492b68",
"score": "0.7944022",
"text": "def user_profile\n params.require(:user).permit(:name, :email, :description, :location, :password, :password_confirmation, :old_password)\n end",
"title": ""
},
{
"docid": "82d0f698e48f6176af68435ecb7fd2ab",
"score": "0.79407763",
"text": "def update_sanitized_params\n devise_parameter_sanitizer.for(:sign_up) {|u| u.permit(:name, :last_name, :login, :about, :email, :country, :password, :password_confirmation,:avatar,:terms_of_service, :birth_date)}\n end",
"title": ""
},
{
"docid": "f7e1fdf7ddef5428fd65e794fcf5d17c",
"score": "0.79386824",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:nickname, :first_name, :last_name, :first_name_kana, :last_name_kana, :birth_year_id, :birth_month_id, :birth_day_id])\n end",
"title": ""
},
{
"docid": "4c7b8c275b6ce79c6a6f379a4c74cb07",
"score": "0.79380864",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up) { |u| u.permit(:first_name, :last_name, :email, :password, :account_type) }\n end",
"title": ""
},
{
"docid": "d0438118aabc21c69603e602c631e662",
"score": "0.793665",
"text": "def sign_up_params\n params.require(:user).permit(:first_name,:last_name, :linkedin, :photo, :about_me, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "4aba35d365a6212a138aeff6c7919469",
"score": "0.793278",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:profile_pic, :firstname, :lastname, :dob, :role_id])\n #params.require(:user).permit(:profile_pic, :firstname, :lastname, :dob, :role_id, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "4fd815cc1ad0ed0d3f5ef53a7f114785",
"score": "0.79301393",
"text": "def configure_sign_up_params\n added_attrs = [:name, :email, :password, :password_confirmation, :remember_me, :profile_photo, :address_attributes=> [:line_1, :line_2, :city, :state, :pincode, :landmark]]\n devise_parameter_sanitizer.permit(:sign_up, keys: added_attrs)\n end",
"title": ""
},
{
"docid": "e45f1db4b2a2c3c13030b24abd2e8422",
"score": "0.7925168",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) do |u|\n u.permit(:email, :current_password, :password, :password_confirmation, :first_name, :last_name, :date_of_birth, :latitude, :longitude)\n end\n end",
"title": ""
},
{
"docid": "7be0fdff650ca514a304d3f0a2e0becc",
"score": "0.79246324",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) << :name\n devise_parameter_sanitizer.for(:sign_up) << :last_name\n devise_parameter_sanitizer.for(:sign_up) << :birth_date\n devise_parameter_sanitizer.for(:sign_up) << :locale\n end",
"title": ""
},
{
"docid": "de06ca57aea2f663cd3f61b1c9c5600c",
"score": "0.7923982",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:job_name, :locale, :token, :mobile_no, :first_name, :last_name, :organization_name, :is_merchant, :address, :lat, :lng])\n devise_parameter_sanitizer.permit(:account_update, keys: [:job_name, :locale, :token, :mobile_no, :first_name, :last_name, :organization_name, :is_merchant, :address, :lat, :lng])\n end",
"title": ""
},
{
"docid": "0376492271df584f7b298b7017ee9c96",
"score": "0.7919929",
"text": "def sign_up_params\n params.require(:user).permit(:first_name, :last_name, :address, :city, :state, :zip_code, :phone_number, :email,\n :password, :password_confirmation, :private, :name, :mission, :website, :organization)\n end",
"title": ""
},
{
"docid": "c02a863dd7335a8b2dd7155a5c90565f",
"score": "0.7910824",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :email, :username, :postcode, :prefecture_name, :address, :building, :sex, :telephone, :country, :corporatename])\n end",
"title": ""
},
{
"docid": "60770a0e54c4c3251f388498eda0d55a",
"score": "0.78920513",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :surname, :city, :promo_code, :date_of_birth, :avatar, :phone, :description])\n end",
"title": ""
},
{
"docid": "3ceeda7c5be0eb50b1f7a2f3cfef50a5",
"score": "0.78869855",
"text": "def configure_devise_params\n devise_parameter_sanitizer.permit(:sign_up) do |u|\n u.permit(:first_name, :last_name, :gender, :email, :password, :password_confirmation, :phone)\n end\n end",
"title": ""
},
{
"docid": "1cbd41b884210400adb7bc64998fc6e0",
"score": "0.7884333",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up).push(\n :username, \n :email,\n :email_confirmation,\n :first_name, \n :last_name,\n :birthdate,\n :city,\n :address_1,\n :address_2,\n :city,\n :state,\n :zip,\n :terms\n )\n end",
"title": ""
},
{
"docid": "f2129d6302a6be068e304754a8d652b6",
"score": "0.78821295",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) do |u|\n u.permit(:first_name, :last_name, :email, :password, :password_confirmation)\n end\n end",
"title": ""
},
{
"docid": "1726c1b564ee9dd86ab1950ebd5b230b",
"score": "0.78801614",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, :email, :phone_number, :locale, :role, :use_email, :use_call, :use_text])\n end",
"title": ""
},
{
"docid": "02fcf0ec61b326b84167d2f76ddab201",
"score": "0.7878715",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) << :profession_id\n\t\t#devise_parameter_sanitizer.for(:sign_up) { |u| u.permit( :first_name, :last_name, :profession_id, :password_confirmation, :password, :email ) }\n end",
"title": ""
},
{
"docid": "c105a00d5c06141b3295d91d84f5d2c0",
"score": "0.7862967",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:firstname, :middlename, :lastname, :phone, :city, :state, :street, :zip, :search, :emergency_contact, :emergency_number, :who_pays, :heard_from])\n end",
"title": ""
},
{
"docid": "0ffa4b4ea470f1d551c8d155646723e3",
"score": "0.78593814",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:fullname, :email, :phone, :username, :province_id, :district_id, :address])\n end",
"title": ""
},
{
"docid": "75387466bee1d4ad88eacc71ccbece6b",
"score": "0.78580403",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:first_name, :last_name, :email,:password,:password_confirmation,:access_token) }\n end",
"title": ""
},
{
"docid": "a1f750dd3573a4bc7f9716fa58c3535d",
"score": "0.7850626",
"text": "def user_params\n params.require(:user).permit(\n :email, :password, :password_confirmation, :first_name, :last_name, :country, :language, :subscribed\n #profile_attributes: [:twitter_name, :github_name, :bio]\n )\n end",
"title": ""
},
{
"docid": "e62f4ae7964a680167a433c453cd9638",
"score": "0.78494525",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [profile_attributes: [:name, :country, :phone_number ]])\n end",
"title": ""
},
{
"docid": "23eaefb42fb0d38f82ed781b48bcdf14",
"score": "0.7848538",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :gender])\n end",
"title": ""
},
{
"docid": "a02b21b075661716c8f884516a1dfe53",
"score": "0.78409326",
"text": "def sign_up_params\n params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation, :actcode_name, :management_ids,:type )\n end",
"title": ""
},
{
"docid": "5be88f71cece38ff38509c692f6b27aa",
"score": "0.78408885",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute,:name,:contact,:gender,:city,:user_type,:current_role])\n end",
"title": ""
},
{
"docid": "287abf4316ea3d01f5f759063291607f",
"score": "0.78322864",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :full_name, :role, :phone, :email, :authenticity_token])\n end",
"title": ""
},
{
"docid": "e5c06790f8c4f10ee7475cb4197de0a3",
"score": "0.7829623",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: %i[name definitive_registration gender grade furigana agreement])\n end",
"title": ""
},
{
"docid": "6842a321969b225a7c238c4e803df51f",
"score": "0.7822214",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(\n :sign_up,\n keys: %i[\n type\n first_name\n last_name\n birth_date\n gender\n school_id\n class_room_id\n operator_id\n handicap\n accept_terms\n ]\n )\n end",
"title": ""
},
{
"docid": "c6c5d002959eb6e29e406e3940a49b81",
"score": "0.78212065",
"text": "def sign_up_params\n params.require(:user).permit(:email, :password, :password_confirmation, :first_name,\n :last_name, :image_url, :locale)\n end",
"title": ""
},
{
"docid": "97836aafcdfae5cdff9524df11e760e3",
"score": "0.78133607",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute,:name,:contact,:gender,:city,:user_type])\n end",
"title": ""
},
{
"docid": "426aabeb403b8e395408cad7d2261ea5",
"score": "0.781176",
"text": "def sign_up_params\n params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation, :role_id, :country)\n end",
"title": ""
},
{
"docid": "80e13b2570dd59e3fc9c0e3b3e1a9589",
"score": "0.7810295",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up) do |user_params|\n user_params.permit(:email, :password, :password_confirmation)\n end\n end",
"title": ""
},
{
"docid": "bda97e7bb915c2155069e85994c5e89c",
"score": "0.7806226",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute, :first_name, :last_name])\n end",
"title": ""
},
{
"docid": "6140e1be30efcfedf374f1869609eeb5",
"score": "0.7803533",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:email, :display_name, :first_name, :last_name, :password, :password_confirmation])\n end",
"title": ""
},
{
"docid": "4c5c1800273c5513cc3e71973217ce49",
"score": "0.7802753",
"text": "def user_params\n params.permit(:first_name, :last_name, :email, :email_confirmation, :password, :password_confirmation, :cpf, :birth_date, :gender, :phone, :user_type)\n end",
"title": ""
},
{
"docid": "bc5a683be5c7fe6b6b031f412bfd0815",
"score": "0.78023654",
"text": "def configure_sign_up_params\n attributes = [:first_name, :last_name, :patronymic, :birthday, :sex, :email, :password, :password_confirmation]\n devise_parameter_sanitizer.permit(:sign_up, keys: attributes)\n end",
"title": ""
},
{
"docid": "2f6626bdafb1c4878bef4a0617f32891",
"score": "0.78022975",
"text": "def user_params_update\n params.require(:user).permit(:full_name, :email, :date_of_birth, :country, :city, :username)\n end",
"title": ""
},
{
"docid": "63dd8007f517f1e48b3186acb058e26b",
"score": "0.7798234",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) do |u|\n u.permit(\n :name, :email, :mobile, :password, :remember_me, :email_signup,\n :mobile_signup, :password_confirmation, :captcha\n )\n end\n end",
"title": ""
},
{
"docid": "00b8e1a7a64c07531e0c9cc7d2014458",
"score": "0.77942324",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:user_type, :name, :fund, :website, :partner, :linkedin, :twitter, :telegram])\n end",
"title": ""
},
{
"docid": "9e03a3fa971f9df3e6bb027696fd2626",
"score": "0.77898896",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, :phone_number, :country_code, :authy_id])\n end",
"title": ""
},
{
"docid": "b7a746111705d6f2208a9dad8a61b9fd",
"score": "0.7788692",
"text": "def sign_up_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation, :avatar, :banner, :home_time_zone)\n end",
"title": ""
},
{
"docid": "1bed02531af7bf296637632f854534d4",
"score": "0.7788166",
"text": "def sign_up_params\n\t params.require(:user).permit(\n\t \t:first_name,\n\t \t:last_name,\n\t \t:phone,\n\t \t:email,\n\t \t:password,\n\t \t:password_confirmation,\n\t \t:lat,\n\t \t:lng,\n\t \t:photo_url\n\t )\n\t end",
"title": ""
},
{
"docid": "d26bbf3f352259d7da36d8faabbf25b8",
"score": "0.77839315",
"text": "def sign_up_params\n params.require(:user).permit(:fName,:lName,:email,:password,:address ,:password_confirmation, :pCode, :city, :role,\n :telephone, :province, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "7f978ae6f60afd1659e290be8c661231",
"score": "0.77824813",
"text": "def sign_up_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation, :remember_me, :type)\n \tend",
"title": ""
},
{
"docid": "6e00504d82330add85d4fcf65d5c30af",
"score": "0.77816546",
"text": "def sign_up_params(params)\n params.permit(:password, :password_confirmation, :name, :email)\n end",
"title": ""
},
{
"docid": "98131989df10e944dfe9f55c9e162490",
"score": "0.7778859",
"text": "def sign_up_params\n params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "e4f0b82100e66cd452efc60fd7cbdd3e",
"score": "0.777431",
"text": "def sign_up_params\n params.require(:user).permit(:first_name, :last_name,\n :email, :password,\n :password_confirmation)\n end",
"title": ""
},
{
"docid": "541f14da0b4cf5390f85f574e5c008cc",
"score": "0.77724445",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :age, :email, :password, :avatar])\n end",
"title": ""
},
{
"docid": "a593aeeeb3accb5596b1bf77fb316351",
"score": "0.77721876",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :zip_code, :phone,\n :description, :url, :address, :city, :state, :service_radius, :service_category, :avatar])\n end",
"title": ""
},
{
"docid": "44a9429efbd9178b7cbc078dfa225cd4",
"score": "0.7770259",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:username,:usertype, :email, :password,:password_confirmation) }\n end",
"title": ""
},
{
"docid": "00e2d3df39240731f8eed092d2ac3e9d",
"score": "0.77654034",
"text": "def configure_sign_in_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name,\n :dob, :zip, :country])\n end",
"title": ""
},
{
"docid": "11de09062c62e10ac1bb5bd9700bca11",
"score": "0.7765392",
"text": "def configure_sign_up_params\n params.require(:user).permit(:email, :encrypted_password, :image, :first_name, :last_name)\n end",
"title": ""
},
{
"docid": "9c82ad6a83de7778ebdfff2b7b8ab816",
"score": "0.7764591",
"text": "def signup_params\n params.require(:signup).permit(:first_name, :last_name, :verified, :email, :address, :address2, :city, :state, :zip, :phone, :photo_id, :selfie, :user_id, :location_id).merge(user_id: current_user.id)\n end",
"title": ""
},
{
"docid": "af7a8d8080011e25f5940568b3ff69ed",
"score": "0.7764079",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) { |u|\n u.permit(:email, :name, :phone, :postal_code, :parking_number, :parking_level, :city, :suite, :condo_id, :password, :password_confirmation)\n }\n end",
"title": ""
},
{
"docid": "88f85df18004194d33bd349fa83de8ac",
"score": "0.7761344",
"text": "def sign_up_params\n\t\tparams.require(:user).permit(:email, :password, :password_confirmation, :name)\n\tend",
"title": ""
},
{
"docid": "1b789a6c28c2f21741f29f561e5c58c2",
"score": "0.7760526",
"text": "def user_params\n params.require(:user).permit(:name, :email, :password, :experience, :skill, :tag, :languages, :authentication_token, :profile_pic, :working_at, :passions, :city, :phone)\n end",
"title": ""
},
{
"docid": "52eb937c035dfdc06e8c9473fa4f422b",
"score": "0.77585196",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:kanji_name, :kana_name, :nickname, :birth_of_date, :prefecture, :address, :profile, :phone_number])\n end",
"title": ""
},
{
"docid": "d1c34f7e2be1bf2d62bcc0ba15f949c8",
"score": "0.77553034",
"text": "def sign_up_params\n params.require(:user).permit(:name, :username, :email, :password, :password_conformation)\n end",
"title": ""
},
{
"docid": "b751af9fefd124572293edc58477b877",
"score": "0.77550685",
"text": "def configure_devise_params\n devise_parameter_sanitizer.for(:sign_up) do |u|\n u.permit(:first_name, :last_name, :semester, :phone, :resume_url, :about_me, :linkedin_url, :user_type, :team_id, :picture_url, :email, :password, :password_confirmation)\n end\n end",
"title": ""
},
{
"docid": "7ab7abd7dfd5b670baef9b98a28eb10c",
"score": "0.77491975",
"text": "def configure_sign_up_params\n # type is a must to go forward to determine what params required for user type\n # render nothing: true, status: :bad_request and return unless params[:account].try(:[], :user).try(:[], :type)\n # let's make it easier for clients, set Customer as default user type\n unless params[:account].try(:[], :user).try(:[], :type)\n params[:account] && params[:account][:user] && params[:account][:user][:type] = 'Customer'\n end\n keys = [\n user: [:type, {profile: params[:account].try(:[],:user).try(:[],:type).try(:constantize).try(:required_profile_attributes)}]\n ]\n devise_parameter_sanitizer.permit(:sign_up, keys: keys)\n end",
"title": ""
},
{
"docid": "69f2aaf977313825f3bdfe3e234aae14",
"score": "0.77474046",
"text": "def sign_up_params\n params.require(:sign_up).permit(:first_name, :last_name, :gender, :phone, :step, :id)\n end",
"title": ""
},
{
"docid": "56e94df63fa67be2823d2965e08bce2e",
"score": "0.7745038",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) << [:username, :location, :bio, :boatname, :boatmodel, :blog, :fname, :lname]\n end",
"title": ""
},
{
"docid": "4bde1c2034f61206c15d4eb4a217d269",
"score": "0.7734809",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:first_name, :last_name, :email, :password, :password_confirmation])\n end",
"title": ""
},
{
"docid": "081d64a7f7c9e0e4a358b62d712befb6",
"score": "0.7734183",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:full_name, :address, :age_range, :height_ft,\n :height_in, :height_cm, :weight,:bust, :hip, :waist, :account_type, :tops_store, :tops_size, :tops_store_fit,\n :bottoms_store, :bottoms_size,:bottoms_store_fit, :bra_size, :bra_cup, :body_shape, :tops_fit, :preference, :bottoms_fit,\n :birthdate, :advertisement_source, :weight_type, :stripe_customer_id, :predicted_hip, :predicted_bust, :predicted_waist,\n :bust_waist_hip_inseam_type, :inseam, :predicted_inseam, :phone_number, :email_subscription, :terms_agreed?, :city, :province, :postal_code, :buzzer_code])\n end",
"title": ""
},
{
"docid": "bca8ade21360bbef9606a0101c76c9f4",
"score": "0.77330196",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:name, :isTalent, :address, :isPublic])\n end",
"title": ""
},
{
"docid": "cc78613b7a8890d5c49179f16651376a",
"score": "0.7731423",
"text": "def sign_up_params\n params.require(:user).permit(:first_name, :last_name, :email, :mobile, :password, :password_confirmation)\n end",
"title": ""
},
{
"docid": "0629b8a6fcf5ad8e44ff66562fbff478",
"score": "0.772986",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:nickname, :family_name, :first_name, :family_name_kana, :first_name_kana, :birthday_year, :birthday_month, :birthday_day, :phone_number])\n end",
"title": ""
},
{
"docid": "2c19f114cd573342a5d8cdc1f5474f0b",
"score": "0.7728475",
"text": "def sign_up_params\n params.require(:user).permit(:email, :password, :password_confirmation, :role, :name, :organization, :job, :contact_telephone, :office_telephone)\n end",
"title": ""
},
{
"docid": "77ee77622daf62df12ee78a429d324ff",
"score": "0.7726754",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.permit(:sign_up, keys: [:attribute,:user_family_name,:user_first_name,:user_family_name_kana,:user_first_name_kana,:birth])\n end",
"title": ""
},
{
"docid": "95c132d98dd46723f1ac9c49b1b85d42",
"score": "0.7726745",
"text": "def configure_sign_up_params\n devise_parameter_sanitizer.for(:sign_up) do |u|\n u.permit(\n :username,\n :first_name, :last_name,\n :email,\n :password,\n :terms_and_conditions,\n :newsletter,\n :role,\n :avatar, :remove_avatar,\n :graetzl_id,\n address_attributes: [\n :street_name,\n :street_number,\n :zip,\n :city,\n :coordinates])\n end\n end",
"title": ""
},
{
"docid": "ab5ba3eb709f087c58b1cb135b2ea020",
"score": "0.77251357",
"text": "def sign_up_params\n\t\tparams.permit(:email, :password, :password_confirmation, :name, :access_token, :type)\n\tend",
"title": ""
},
{
"docid": "2d0feb4b1be24d70d91e67c369e55589",
"score": "0.7723827",
"text": "def configure_account_update_params\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(\n :name,\n :username,\n :first_name,\n :last_name,\n :phone,\n :gender,\n :dob,\n :occupation,\n :street_addr,\n :post_code,\n :region,\n :city,\n :country\n )}\n end",
"title": ""
},
{
"docid": "6c27ab2785dffbf6f53a1474a59f55e1",
"score": "0.7723642",
"text": "def configure_sign_up_params\n\t\tdevise_parameter_sanitizer.for(:sign_up) do |u|\n\t\t\tu.permit( :username, :email, :email_confirmation, :password, :password_confirmation,\n\t\t\t\t :age, :source\n\t\t\t)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "a1015c993eb6757a2d898764c3c1c1fd",
"score": "0.77228224",
"text": "def configure_devise_params\n \tdevise_parameter_sanitizer.for(:sign_up) { |u| u.permit(:firstname, :lastname, :username, :city, :gender, :year_of_birth , :email, :password, :password_confirmation, :terms) }\n devise_parameter_sanitizer.for(:sign_in) { |u| u.permit(:login, :password, :remember_me) }\n end",
"title": ""
}
] |
71948503e0151e3242db7b6e8c6cc2a2
|
Search for SLOs. Get a list of service level objective objects for your organization.
|
[
{
"docid": "5aef5a2f764c37da48b40748486e61a6",
"score": "0.58679676",
"text": "def search_slo_with_http_info(opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ServiceLevelObjectivesAPI.search_slo ...'\n end\n # resource path\n local_var_path = '/api/v1/slo/search'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?\n query_params[:'page[size]'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'page[number]'] = opts[:'page_number'] if !opts[:'page_number'].nil?\n query_params[:'include_facets'] = opts[:'include_facets'] if !opts[:'include_facets'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'SearchSLOResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]\n\n new_options = opts.merge(\n :operation => :search_slo,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type,\n :api_version => \"V1\"\n )\n\n data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServiceLevelObjectivesAPI#search_slo\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
}
] |
[
{
"docid": "5a17a014d226ed9cd817e7fcf231cad6",
"score": "0.5965571",
"text": "def list_slos_with_http_info(opts = {})\n\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ServiceLevelObjectivesAPI.list_slos ...'\n end\n # resource path\n local_var_path = '/api/v1/slo'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'ids'] = opts[:'ids'] if !opts[:'ids'].nil?\n query_params[:'query'] = opts[:'query'] if !opts[:'query'].nil?\n query_params[:'tags_query'] = opts[:'tags_query'] if !opts[:'tags_query'].nil?\n query_params[:'metrics_query'] = opts[:'metrics_query'] if !opts[:'metrics_query'].nil?\n query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?\n query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body]\n\n # return_type\n return_type = opts[:debug_return_type] || 'SLOListResponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || [:apiKeyAuth, :appKeyAuth, :AuthZ]\n\n new_options = opts.merge(\n :operation => :list_slos,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type,\n :api_version => \"V1\"\n )\n\n data, status_code, headers = @api_client.call_api(Net::HTTP::Get, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ServiceLevelObjectivesAPI#list_slos\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "a6416321fd67e9498f0890caf4456f14",
"score": "0.55865043",
"text": "def list_silos\n r = execute(make_xml('SiloListingRequest'), '1.2')\n arr = []\n if r.success\n r.res.elements.each('SiloListingResponse/SiloSummaries/SiloSummary') do |silo|\n arr << SiloSummary.parse(silo)\n end\n end\n arr\n end",
"title": ""
},
{
"docid": "fab64c20805d24bf5a71c005e02b4e0c",
"score": "0.5355952",
"text": "def get_skills\r\n Skill.where(\"opportunity_id = ?\", opportunity_id).all\r\n end",
"title": ""
},
{
"docid": "b91b4a92912d1b2b6b6ecb3772fddfc0",
"score": "0.53528476",
"text": "def list_silos\n xml = make_xml('SiloListingRequest')\n r = execute xml, '1.2'\n\n if r.success\n res = []\n r.res.elements.each(\"//SiloSummary\") do |silo_profile|\n res << {\n :id => silo_profile.attributes['id'],\n :name => silo_profile.attributes['name'],\n :description => silo_profile.attributes['description']\n }\n end\n res\n else\n false\n end\n end",
"title": ""
},
{
"docid": "c6a295342179ab1e7ed3927f0b862e61",
"score": "0.52638227",
"text": "def index\n @sigesp_solicituds = Sigesp::Solicitud.search_almacen params[:page], params[:search], params[:sort]\n end",
"title": ""
},
{
"docid": "6ef2055e6ed85f789916e6b7d45ac7cd",
"score": "0.5188912",
"text": "def index\n\t@long_snps = LongSnp.search(params[:search])\n end",
"title": ""
},
{
"docid": "c54754707b27a78a5826254043b5ea7d",
"score": "0.51741713",
"text": "def list_sobjects\n response = describe_global # method_missing\n response[:sobjects].collect { |sobject| sobject[:name] }\n end",
"title": ""
},
{
"docid": "c3ecc603f01bcff55361327e79f125ba",
"score": "0.5171393",
"text": "def get_solutions(opts = {})\n data, _status_code, _headers = get_solutions_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "c2ebb51c3bb4f636faaa9ae445f6787e",
"score": "0.5146362",
"text": "def get_services(sObjectType, oParams)\n case sObjectType\n when :services\n # oParams[sObjectType] will provide the controller object.\n # This one can be interpreted only by controller code,\n # except if controller declares how to map with this object.\n # Processes can deal only process mapped data.\n # Currently there is no services process function. No need to map.\n hServices = oParams[:services]\n if not oParams[:list_services].is_a?(Array)\n hServiceToFind = [oParams[:list_services]]\n else\n hServiceToFind = oParams[:list_services]\n end\n # Search for service. Ex: Can be :Networking or network. I currently do not know why...\n hSearchServices= rhGet(hServices, :service_catalog)\n sService = nil\n hServiceToFind.each { | sServiceElem |\n if hSearchServices.key?(sServiceElem)\n sService = sServiceElem\n break\n end\n }\n\n forjError \"Unable to find services %s\" % hServiceToFind if sService.nil?\n result = rhGet(hServices, :service_catalog, sService).keys\n result.delete(\"name\")\n result.each_index { | iIndex |\n result[iIndex] = result[iIndex].to_s if result[iIndex].is_a?(Symbol)\n }\n return result\n else\n forjError \"'%s' is not a valid object for 'get_services'\" % sObjectType\n end\n end",
"title": ""
},
{
"docid": "7bb418b893a2017ac98981398025262e",
"score": "0.51343465",
"text": "def index\n @objectives = Objective.all\n\n @active_id = ObjectiveStatus.find_by(name: \"Active\").id\n @hold_id = ObjectiveStatus.find_by(name: \"On Hold\").id\n @complete_id = ObjectiveStatus.find_by(name: \"Complete\").id\n @active_objectives = @objectives.where(objective_status_id: @active_id)\n @hold_objectives = @objectives.where(objective_status_id: @hold_id)\n @complete_objectives = @objectives.where(objective_status_id: @complete_id)\n end",
"title": ""
},
{
"docid": "eb4fa7c57c6fef200046e3b461629f78",
"score": "0.512401",
"text": "def index\n @company_objectives = CompanyObjective.all\n end",
"title": ""
},
{
"docid": "622d3eb384ec09706f95d87b5e4bb016",
"score": "0.50996935",
"text": "def index\n @peo_covered_by_slos = PeoCoveredBySlo.all\n end",
"title": ""
},
{
"docid": "7b13f289d22c2af9ae8f2105e154b8a7",
"score": "0.5073582",
"text": "def index\n @loco_evaluations = LocoEvaluation.all\n end",
"title": ""
},
{
"docid": "9ae6ea89b5fee9cae20511067d726d6b",
"score": "0.50376743",
"text": "def index\n authorize KlasiusSrv\n @klasius_srvs = KlasiusSrv.order(:code).search(params[:search]).page(params[:page])\n end",
"title": ""
},
{
"docid": "eab6e52a0decfff27c877361fddd6951",
"score": "0.50235844",
"text": "def simple\n url = 'https://activities.osu.edu/involvement/student_organizations/find_a_student_org?v=list&l=W&c=Columbus'\n orgs = []\n get_org_list url, orgs\n output_handler orgs, [], url\nend",
"title": ""
},
{
"docid": "dc42d7f7f9930b19d86eb8dc9e8e5184",
"score": "0.5018187",
"text": "def index\n @sops = Sop.all\n end",
"title": ""
},
{
"docid": "75b590d74916f14fd709ec94578f2fd3",
"score": "0.49962592",
"text": "def index\n @specific_objectives = SpecificObjective.all\n end",
"title": ""
},
{
"docid": "f0f33058a83439c3bd860ad793e195c4",
"score": "0.4995427",
"text": "def all_approved_solutions\n @solutions = Solution.where(state: \"approved\")\n end",
"title": ""
},
{
"docid": "e34e7ee1c094167c43efa04c4bd17827",
"score": "0.49870208",
"text": "def index\n @spools = Spool.all\n end",
"title": ""
},
{
"docid": "74da01ec5995e6be74c6c02cdbd82199",
"score": "0.49798155",
"text": "def index\n @lops = Lop.all\n end",
"title": ""
},
{
"docid": "d0c3ccad30389b42306fc57f98732576",
"score": "0.49482605",
"text": "def index\n @solists = Solist.all\n end",
"title": ""
},
{
"docid": "274be500ae8f4707f61d2d449fa84d81",
"score": "0.49442658",
"text": "def obtenerSoluciones\n return @lista_soluciones\n end",
"title": ""
},
{
"docid": "274be500ae8f4707f61d2d449fa84d81",
"score": "0.49442658",
"text": "def obtenerSoluciones\n return @lista_soluciones\n end",
"title": ""
},
{
"docid": "0d55e95fdad3c022bbb8e262c565264f",
"score": "0.4942563",
"text": "def escalation_calculation_get_sla\n sla_selected = nil\n sla_list = Cache.get('SLA::List::Active')\n if sla_list.nil?\n sla_list = Sla.all.order(:name, :created_at)\n Cache.write('SLA::List::Active', sla_list, { expires_in: 1.hour })\n end\n sla_list.each do |sla|\n if sla.condition.blank?\n sla_selected = sla\n elsif sla.condition\n query_condition, bind_condition, tables = Ticket.selector2sql(sla.condition)\n ticket = Ticket.where(query_condition, *bind_condition).joins(tables).find_by(id: id)\n next if !ticket\n\n sla_selected = sla\n break\n end\n end\n sla_selected\n end",
"title": ""
},
{
"docid": "d9a7ea7c2e7f2f22b542600af1b789d0",
"score": "0.49419686",
"text": "def search_skills\n\t\tsel_company_skill_name = params[:skills]\n\n\t\tsel_company_skill = CompanySkill.where('lower(name) = ?', sel_company_skill_name.downcase).first\n\n\t\tif sel_company_skill.nil? or params[:skills] == \"\"\n\t\t\tsel_company_skill = CompanySkill.new\n\t\t\tsession[:category] = Category.new\n\t\t\tsession[:company_skills] = []\n\t\telse\n\t\t\tsel_category = Category.where(name: sel_company_skill.category.name)[0]\n\t\t\tsession[:category] = sel_category\n\n\t\t\tsession[:company_skills] = []\n\t\t\tsession[:company_skills] << sel_company_skill\n\t\tend\n\n\t\tauthorize sel_company_skill\n\n\t\tredirect_to own_company_skills_path\n\tend",
"title": ""
},
{
"docid": "622f5790b5f5a1714e49e15a471cefb9",
"score": "0.49359396",
"text": "def index\n @title = t 'control_objective_item.index_title'\n\n @control_objectives = ControlObjectiveItem.list.includes(\n :weaknesses,\n :work_papers,\n :process_control,\n :oportunities,\n review: [:period, :conclusion_final_review, :plan_item],\n control_objective: :process_control\n ).\n search(**search_params).\n references(:review).\n merge(Review.allowed_by_business_units).\n default_order.\n page params[:page]\n\n respond_to do |format|\n format.html\n end\n end",
"title": ""
},
{
"docid": "6eb60a3b54596924e4d530355f509f80",
"score": "0.49273804",
"text": "def do_search\n\t\tresults = []\n\t\tif self[:models].split(',').size == 1\n\t\t\t# Research on ONE model\n\t\t\tmodel_const = self[:models].split(',').first.classify.constantize\n\t\t\tresults = model_const.get_da_objects_list(self.param)#.merge!({:skip_pag => true}))\n\t\telse\n\t\t\t# Research on VARIOUS models\n\t\t\t# TODO use MySQL view, but permissions ...\n\t\t\tself[:opti] ||= 'skip_full_pag'\n\t\t\tself[:models].split(',').each do |model_name|\n\t\t\t\tmodel_const = model_name.classify.constantize\n\t\t\t\tresults += model_const.get_da_objects_list(self.param)\n\t\t\tend\n\t\t\t# Sorting all the element in memory ... very costly actually\n results = results.sort_with_filter(self[:filter][:field], self[:filter][:way])\n\t\t\t# Paginating these sorted element\n\t\t\tresults = results.paginate(:per_page => self[:pagination][:per_page].to_i, :page => self[:pagination][:page].to_i)\n\t\tend\n\t\treturn results\n\tend",
"title": ""
},
{
"docid": "0a018b68d66193b5ad9d8e4bd86fc885",
"score": "0.4916517",
"text": "def index\n @objectives = Objective.all\n end",
"title": ""
},
{
"docid": "0a018b68d66193b5ad9d8e4bd86fc885",
"score": "0.4916517",
"text": "def index\n @objectives = Objective.all\n end",
"title": ""
},
{
"docid": "0a018b68d66193b5ad9d8e4bd86fc885",
"score": "0.4916517",
"text": "def index\n @objectives = Objective.all\n end",
"title": ""
},
{
"docid": "45eee49c8c2eea9bd30fe18f73e60e8f",
"score": "0.4898366",
"text": "def getAllServicesOfProject( poid )\n\n # parameter TypeCheck\n #BIMserverAPI::TypeCheck::Long( poid )\n\n # BIMserver request\n request( { poid: poid } )\n end",
"title": ""
},
{
"docid": "2fae454657d18bce93c5ef8457b2758f",
"score": "0.48946956",
"text": "def loots(opts)\n ::ApplicationRecord.connection_pool.with_connection {\n # If we have the ID, there is no point in creating a complex query.\n if opts[:id] && !opts[:id].to_s.empty?\n return Array.wrap(Mdm::Loot.find(opts[:id]))\n end\n\n # Remove path from search conditions as this won't accommodate remote data\n # service usage where the client and server storage locations differ.\n opts.delete(:path)\n search_term = opts.delete(:search_term)\n data = opts.delete(:data)\n\n wspace = Msf::Util::DBManager.process_opts_workspace(opts, framework)\n opts = opts.clone()\n opts.delete(:workspace)\n opts[:workspace_id] = wspace.id\n\n if search_term && !search_term.empty?\n column_search_conditions = Msf::Util::DBManager.create_all_column_search_conditions(Mdm::Loot, search_term)\n results = Mdm::Loot.includes(:host).where(opts).where(column_search_conditions)\n else\n results = Mdm::Loot.includes(:host).where(opts)\n end\n\n # Compare the deserialized data from the DB to the search data since the column is serialized.\n unless data.nil?\n results = results.select { |loot| loot.data == data }\n end\n\n results\n }\n end",
"title": ""
},
{
"docid": "edec9f0404a42c21bb40a35d97ed0642",
"score": "0.48848638",
"text": "def index\n @salons = Salon.search(search_params)\n end",
"title": ""
},
{
"docid": "e4e82072ab5201a9d948f12dacaf9ed1",
"score": "0.48812637",
"text": "def index\n @search = SaleProcess.search(params[:q])\n @sale_processes = @search.result\n end",
"title": ""
},
{
"docid": "8679ec134f518e7cf9c5d20830fca7fa",
"score": "0.48767868",
"text": "def service_sl_as_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: SLAsApi.service_sl_as_get ...\"\n end\n # resource path\n local_var_path = \"/service/SLAs\"\n\n # query parameters\n query_params = {}\n query_params[:'conditions'] = opts[:'conditions'] if !opts[:'conditions'].nil?\n query_params[:'orderBy'] = opts[:'order_by'] if !opts[:'order_by'].nil?\n query_params[:'childconditions'] = opts[:'childconditions'] if !opts[:'childconditions'].nil?\n query_params[:'customfieldconditions'] = opts[:'customfieldconditions'] if !opts[:'customfieldconditions'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].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 => 'Array<SLA>')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: SLAsApi#service_sl_as_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "169a9003c4ff06938d0953add9e3713f",
"score": "0.48671472",
"text": "def search\n go_to_manage_soc\n on ManageSocPage do |page|\n page.term_code.set @term_code\n page.go_action\n end\n end",
"title": ""
},
{
"docid": "c33930ecbcecab55c566281735c2a4b1",
"score": "0.4863641",
"text": "def solutions\n @solutions ||= begin\n solution_lists.\n sort_by {|solution_list| solution_list.index.to_i}.\n map do |solution_list|\n bindings = solution_list.bindings.inject({}) { |hash, binding|\n hash[binding.variable.to_sym] = binding.value\n hash\n }\n RDF::Query::Solution.new(bindings)\n end\n end\n end",
"title": ""
},
{
"docid": "7b58cc81450769349be0f096dbf57e60",
"score": "0.4860477",
"text": "def index\n @protokols = Protokol.all\n end",
"title": ""
},
{
"docid": "5f718313bf81e9a1f8616dc140dfbb0e",
"score": "0.48520738",
"text": "def index\n @olbigations = Olbigation.all\n end",
"title": ""
},
{
"docid": "3a173b47a5851cae7b99e25cd732b91f",
"score": "0.48454654",
"text": "def index\n manage_filter_state\n no = params[:No]\n company = params[:WrkrCompany]\n office = params[:WrkrOffice]\n # OCO\n init_oco if !session[:organization]\n # Initialize select_tags\n if session[:company] != '0'\n @companies = Company.where(id: session[:company]) if @companies.nil?\n company = session[:company]\n else\n @companies = Company.order(:name) if @companies.nil?\n end\n if session[:office] != '0'\n @offices = Office.where(id: session[:office]) if @offices.nil?\n office = session[:office]\n elsif session[:company] != '0'\n @offices = @companies.first.offices.order(:name) if @offices.nil?\n else\n @offices = Office.order(:name) if @offices.nil?\n end\n\n # If inverse no search is required\n no = !no.blank? && no[0] == '%' ? inverse_no_search(no) : no\n\n @search = Infrastructure.search do\n fulltext params[:search]\n if session[:organization] != '0'\n with :organization_id, session[:organization]\n end\n if session[:company] != '0'\n any_of do\n with :company_id, session[:company]\n with :company_id, nil\n end\n end\n if session[:office] != '0'\n any_of do\n with :office_id, session[:office]\n with :office_id, nil\n end\n end\n if !no.blank?\n if no.class == Array\n with :code, no\n else\n with(:code).starting_with(no)\n end\n end\n if !company.blank?\n with :company_id, company\n end\n if !office.blank?\n with :office_id, office\n end\n order_by :sort_no, :asc\n paginate :page => params[:page] || 1, :per_page => per_page\n end\n @infrastructures = @search.results\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @infrastructures }\n format.js\n end\n end",
"title": ""
},
{
"docid": "8a93166502305a2c28089256aed4cbc1",
"score": "0.48347303",
"text": "def index\n @search = SicossCondition.search(params[:search])\n @sicoss_conditions = @search.page(params[:page]).per(10)\n flash.now[:notice] = t('flash.actions.index.notice') if @sicoss_conditions.empty?\n respond_with(@sicoss_conditions)\n end",
"title": ""
},
{
"docid": "2105cad91091facba111bf82636a2103",
"score": "0.4827058",
"text": "def index\n @user = current_user\n @job = Job.new\n\n @jobs = current_user.jobs.text_search(params[:query], params[:town], params[:status])\n $lmc_left_menu = 'lmc_my_jobs'\n $lmc_subleft_menu = 'lmc_all_jobs'\n\n end",
"title": ""
},
{
"docid": "4f9a5968c367dfb972c1887b90173a52",
"score": "0.48184708",
"text": "def index\n @olympics = policy_scope(Olympic)\n end",
"title": ""
},
{
"docid": "3d57df7a03b195f30a43e89704502732",
"score": "0.4814074",
"text": "def index\n @lols = Lol.all\n end",
"title": ""
},
{
"docid": "6eab99d83a1ac19fd9dd8030f9ec783c",
"score": "0.48056307",
"text": "def index\n @amm_o2_services = AmmO2Service.all\n end",
"title": ""
},
{
"docid": "c94fd4edeac2c83c4136d16fd905b179",
"score": "0.48023078",
"text": "def get_searched_l2_objects(l2_list)\n L2.where(id: [l2_list], l1_id: self.id).order(:id)\n end",
"title": ""
},
{
"docid": "a8c2cb430665133d0bc1469533b2ea26",
"score": "0.47941282",
"text": "def list_sos\n @token = request.headers[\"HTTP_X_API_POP_KEY\"]\n if Customer.exists?(authentication_token: @token)\n @customer = Customer.find_by(authentication_token: @token)\n sos_list = CorePayment::Sos.list_sos(customer: @customer.id)\n render json: {\n status: sos_list[0],\n message: sos_list[1]\n }\n else\n render json: {\n status: false,\n message: \"Utilisateur ou compte inconnu\"\n }\n end\n end",
"title": ""
},
{
"docid": "8f0aac11bf2cdd37d046e5f9c853905e",
"score": "0.47858223",
"text": "def search\n session[:breadcrumbs].add \"Find a Position\"\n\n params[:search] = \"course_override\" if !params[:search] && @service_learning_course\n\n if params[\"search\"]\n @results = generate_pipeline_search\n @pipeline_positions = ServiceLearningPosition.find(:all, :include=>[{:organization_quarter=>{:organization=>:locations}},\n :pipeline_positions_subjects,:pipeline_positions_grade_levels,\n :pipeline_positions_tutoring_types, :pipeline_positions_language_spokens, :times], \n :conditions=>{:id=>@results.collect{|r|r.id}},\n :order => \"organizations.name\")\n end\n\n respond_to do |format|\n format.html {\n fetch_rsvp\n get_progress_statuses\n fetch_field_info\n }\n\t format.js {\n\t }\n end\n end",
"title": ""
},
{
"docid": "a9430765c3f332563c9d745eb67f3568",
"score": "0.4781229",
"text": "def index\n authorize Service\n #@services = policy_scope(Service).includes(:organization)\n end",
"title": ""
},
{
"docid": "c154959679eee42b2efafbca25f0f336",
"score": "0.47782788",
"text": "def index\n @services = current_user.company.services.where(tipo: \"Servicio\").search_by_name(params[:name]).search_by_code(params[:code]).search_by_category(params[:category]).search_with_stock(params[:stock]).paginate(page: params[:page], per_page: 9)\n end",
"title": ""
},
{
"docid": "6518b940f75bf89e8be02e0632e4dff4",
"score": "0.4774622",
"text": "def get_all_semesters\n path = \"/d2l/api/lp/#{$lp_ver}/orgstructure/6606/children/?ouTypeId=5\"\n _get(path)\nend",
"title": ""
},
{
"docid": "380c37868f7b54321893dc8ab95b1485",
"score": "0.476849",
"text": "def search(title)\n results = {}\n self.services.each do |service|\n s = SERVICE_MAP[service].new(:ignore => ignore, :ecs_credentials => ecs_credentials)\n results[service] = s.search(title) #each search goes into results hash!!!\n end\n\n results\n end",
"title": ""
},
{
"docid": "4396ede37254b001d1c820f1cb49bfe2",
"score": "0.47505632",
"text": "def search_results(params = {})\n loans = []\n search(params)[\"loans\"].each do |loan|\n loans << Kiva::Loan.new(loan)\n end\n loans\n end",
"title": ""
},
{
"docid": "9d8337e921047268941d8876e885b2f0",
"score": "0.474839",
"text": "def index\n @companies = Company.order(:name)\n\n tags = params[:terms]\n\n unless tags.nil?\n if tags.class == Array.new\n tags = tags.inject { |m, x| m + x}\n end\n json_companies = search_elastic tags\n results = Array.new\n\n json_companies.each do |c|\n puts \"searching for #{c}\"\n company_found = Company.find_by( :name => c['_id'])\n puts \"found #{company_found}\"\n results << company_found unless company_found.nil?\n end\n\n results.each do |c|\n puts \"@companies #{c.name}\"\n end\n @companies = results\n end\n\n end",
"title": ""
},
{
"docid": "f72ed1b91a6affaca2e6c6131e606072",
"score": "0.47469932",
"text": "def services(year = nil)\n if year.blank?\n Service.joins(:employees => :groups).where(:groups => {:id => self.id}).uniq.order(:name)\n else\n Service.joins(:employees => :groups).where(:groups => {:id => self.id},\n :employee_allocations => {:fiscal_year_id => year.id}).uniq.order(:name)\n end\n end",
"title": ""
},
{
"docid": "c6f7942bdfcdf1c19bdf45db7bbec67e",
"score": "0.47451076",
"text": "def search\n \n @possible_Jobs = Array.new\n @possible_Jobs[0] = 'Any'\n @possible_Jobs = @possible_Jobs + GeneralInfo.see_Jobs\n end",
"title": ""
},
{
"docid": "9f75fa35f96f02194865ba1826c7c0c4",
"score": "0.47332814",
"text": "def describe_sobjects\n response = api_get 'sobjects'\n response.body['sobjects']\n end",
"title": ""
},
{
"docid": "9381a5f468ef2edaa31b3dec06987da1",
"score": "0.4731718",
"text": "def index\n scope = Organization.all.search_any_order(params[:search])\n @organizations = scope_order(scope).page(params[:page]).per(40)\n end",
"title": ""
},
{
"docid": "93c53a044626f2f0ba93c79b442cc639",
"score": "0.47226205",
"text": "def index\n @sodapops = Sodapop.all\n end",
"title": ""
},
{
"docid": "5e53517c051c59d2ca998281d6df7264",
"score": "0.47205472",
"text": "def index\n @sellouts = Sellout.all\n end",
"title": ""
},
{
"docid": "bc259f6c856857f763e6d980b995f5cc",
"score": "0.47169474",
"text": "def list_lgvs\n @company = Company.find(1)\n @pagetitle = \"#{@company.name} - lgvs\"\n @filters_display = \"block\"\n \n @locations = Location.where(company_id: @company.id).order(\"name ASC\")\n @divisions = Division.where(company_id: @company.id).order(\"name ASC\")\n \n \n if(params[:location] and params[:location] != \"\")\n @sel_location = params[:location]\n end\n \n if(params[:division] and params[:division] != \"\")\n @sel_division = params[:division]\n end\n \n if(@company.can_view(current_user))\n @lgvs = Lgv.all.order('id DESC').paginate(:page => params[:page])\n if params[:search]\n @lgvs = Lgv.search(params[:search]).order('id DESC').paginate(:page => params[:page])\n else\n @lgvs = Lgv.all.order('id DESC').paginate(:page => params[:page]) \n end\n \n else\n errPerms()\n end\n end",
"title": ""
},
{
"docid": "37d0212f6d89504d28b61915d73973b8",
"score": "0.4714061",
"text": "def evaluations_hr_manager(company,status,order,search_string)\n\n if search_string != nil\n @@search = search_string\n end\n if status != nil\n @@status = status\n end\n if order != nil\n @@order = order\n end\n\n #Aqui é feita a escolha da query a usar dependendo dos parametros passados\n if @@status != \"ALL\" #Se não for TUDO, há que respeitar o Status\n if @@search != \"\"\n evaluations = company.evaluations.where(\"status = ?\" , @@status).where(\"description LIKE '%\" + @@search + \"%'\").order(\"description \" + @@order )\n else\n evaluations = company.evaluations.where(\"status = ?\" , @@status).order(\"description \" + @@order )\n end\n else #Se for TUDO, vem tudo, sem respeito por status\n if @@search != \"\"\n evaluations = company.evaluations.where(\"description LIKE '%\" + @@search + \"%'\").order(\"description \" + @@order )\n else\n evaluations = company.evaluations.order(\"description \" + @@order )\n end\n end\n\n return evaluations\n\n end",
"title": ""
},
{
"docid": "7e4c9dc607626fb50a63c72986bb29a6",
"score": "0.47120363",
"text": "def index\n @sla_items = SlaItem.all\n end",
"title": ""
},
{
"docid": "32f96be26cef8d3bb4329f8ec516c824",
"score": "0.47107768",
"text": "def index\n \n # locs = [\"LI\"]\n \n query = Coral.all\n # query = query.located(params[:loc]) if params[:loc] && !params[:loc].blank?\n # query = query.exposed(params[:exp]) if params[:exp] && !params[:exp].blank?\n # query = query.gformed(params[:gfo]) if params[:gfo] && !params[:gfo].blank?\n query = query.located(params[:loc]) if params[:loc] && !params[:loc].blank?\n query = query.exposed(params[:exp]) if params[:exp] && !params[:exp].blank?\n query = query.gformed(params[:gfo]) if params[:gfo] && !params[:gfo].blank?\n @corals = query.all\n end",
"title": ""
},
{
"docid": "ae7fc2aeb192f621dffbaebe8a3733a3",
"score": "0.47089747",
"text": "def spo(s,p,o,r=nil) \n result = Array.new \n s = resource_or_self(s,r).uniq\n p = resource_or_self(p,r).uniq\n o = resource_or_self(o,r).uniq\n s.each do |x|\n p.each do |y|\n o.each do |z|\n # puts x.to_s + ' **** ' + y.to_s + ' **** ' + z.to_s\n result |= query(x,y,z,r)\n end \n end \n end \n @result = @result | result\n self\n end",
"title": ""
},
{
"docid": "7edb1b2379b891402baf4571541d714d",
"score": "0.47077924",
"text": "def hospitals\n var = Variable.where(field_name: limit_field).first\n return Hospital.all if var.nil?\n value = limit_value\n value = value.to_f if var.variable_type == :number || var.variable_type == :percentage\n field = limit_field\n field = \"#{field}.#{base_year}\" if var.is_time_series\n\n return Hospital.where(field => mongo_operator(limit_operator, value))\n end",
"title": ""
},
{
"docid": "5be45fd9ef63378a075846ca7a78f242",
"score": "0.4690123",
"text": "def list_service_rollouts request_pb, options = nil\n raise ::ArgumentError, \"request must be provided\" if request_pb.nil?\n\n verb, uri, query_string_params, body = ServiceStub.transcode_list_service_rollouts_request request_pb\n query_string_params = if query_string_params.any?\n query_string_params.to_h { |p| p.split \"=\", 2 }\n else\n {}\n end\n\n response = @client_stub.make_http_request(\n verb,\n uri: uri,\n body: body || \"\",\n params: query_string_params,\n options: options\n )\n operation = ::Gapic::Rest::TransportOperation.new response\n result = ::Google::Cloud::ServiceManagement::V1::ListServiceRolloutsResponse.decode_json response.body, ignore_unknown_fields: true\n\n yield result, operation if block_given?\n result\n end",
"title": ""
},
{
"docid": "263b570b3203d4ac9356cf1935437b29",
"score": "0.4688587",
"text": "def list_sobjects\n describe_sobjects.collect { |sobject| sobject['name'] }\n end",
"title": ""
},
{
"docid": "237b03cb21c3e3bad4c04e84d0971d2f",
"score": "0.4688228",
"text": "def search\t\t\n\t\t @query = params[:query]\n\t\t @spensions = Spension.search @query, :page => params[:page], :per_page => 10\t\t\n\tend",
"title": ""
},
{
"docid": "ffa6ed11b2751be268be6f41bb3668a6",
"score": "0.46786237",
"text": "def getAllObjectives(algo, within_obj, instances, instances_sorted, stripped_state_int, cutoff_time=100, cutoff_length=2147483647)\t\n\tinstanceHash = makeStandardInstanceHash(instances, stripped_state_int)\n\t\n\tobjectives = []\n\tfor inst in instances_sorted\n\t\tif instanceHash.key?(inst)\n\t\t\tresult = instanceHash[inst][\"result\"]\n\t\t\tp result\n\t\t\tqual = instanceHash[inst][\"desired_qual\"]\n\t\t\trest = instanceHash[inst][\"rest\"]\n\t\t\tresults = []\n\t\t\tfor res in result\n\t\t\t\tresults << singleRunObjective(algo, within_obj, res, qual, rest, cutoff_time, cutoff_length)\n\t\t\tend\n#\t\t\trequire \"stats_ils.rb\"\n\t\t\tobjectives << [results.median, results.length]\n#\t\t\tobjectives << [singleInstanceObjective(algo, within_obj, result, qual, reference), result.length]\n\t\telse\n\t\t\tobjectives << [nil, 0]\n\t\tend\n\tend\n\treturn objectives\nend",
"title": ""
},
{
"docid": "187d742c5aade007f44ff2963f23769f",
"score": "0.46777663",
"text": "def index\n @optin_services = OptinService.all\n end",
"title": ""
},
{
"docid": "9689c16b8925e665239a79f03dc92f9f",
"score": "0.46763813",
"text": "def residential_search(company_id, search_params)\n\t\t\t\tstatuses = search_params[:status].split(',').map{|s| Unit.statuses[s]}\n\t\t\t\tlistings = Unit\n\t\t\t\t\t.joins(:residential_listing, [building: [:landlord, :company]])\n\t\t\t\t\t.joins('left join neighborhoods on neighborhoods.id = buildings.neighborhood_id')\n\t\t\t\t\t.where('units.archived = false')\n\t\t\t\t\t.where('units.syndication_status IN (?)', [\n\t\t\t\t\t\tUnit.syndication_statuses['Syndicate if matches criteria'],\n\t\t\t\t\t\tUnit.syndication_statuses['Force syndicate']\n\t\t\t\t\t])\n\t\t\t\t\t.where('units.status IN (?)', statuses)\n\t\t\t\t\t.where('companies.id = ?', company_id)\n\n\t\t\t\tlistings = _restrict_on_residential_model(company_id, search_params, listings)\n\t\t\t\tlistings = _restrict_on_unit_model(company_id, search_params, listings)\n\t\t\t\tlistings = _sort_by(search_params, listings)\n\n\t\t\t\tlistings = listings\n\t\t\t\t\t.select(\n\t\t\t\t\t'units.id as unit_id', 'units.primary_agent_id', 'units.primary_agent2_id',\n\t\t\t\t\t'units.building_unit', 'units.status', 'units.available_by',\n\t\t\t\t\t'units.listing_id', 'units.updated_at', 'units.rent',\n\t\t\t\t\t'units.syndication_status',\n\t\t\t\t\t'buildings.id as building_id',\n\t\t\t\t\t'neighborhoods.name as neighborhood_name',\n\t\t\t\t\t'neighborhoods.borough as neighborhood_borough',\n\t\t\t\t\t'landlords.code', 'landlords.name', 'landlords.contact_name',\n\t\t\t\t\t'landlords.office_phone', 'landlords.mobile', 'landlords.fax',\n\t\t\t\t\t'landlords.email', 'landlords.website',\n\t\t\t\t\t'landlords.administrative_area_level_1_short as l_administrative_area_level_1_short',\n\t\t\t\t\t'landlords.sublocality as l_sublocality',\n\t\t\t\t\t'landlords.street_number as l_street_number', 'landlords.route as l_route',\n\t\t\t\t\t'landlords.postal_code as l_postal_code',\n\t\t\t\t\t'landlords.lat as l_lat',\n\t\t\t\t\t'landlords.lng as l_lng',\n\t\t\t\t\t'landlords.listing_agent_id', 'landlords.listing_agent_percentage',\n\t\t\t\t\t'landlords.has_fee as l_has_fee',\n\t\t\t\t\t'landlords.op_fee_percentage as l_op_fee_percentage',\n\t\t\t\t\t'landlords.tp_fee_percentage as l_tp_fee_percentage',\n\t\t\t\t\t'residential_listings.id AS r_id',\n\t\t\t\t\t'residential_listings.lease_start', 'residential_listings.lease_end',\n\t\t\t\t\t'residential_listings.has_fee as r_has_fee',\n\t\t\t\t\t'residential_listings.tp_fee_percentage', 'residential_listings.beds',\n\t\t\t\t\t'residential_listings.baths', 'residential_listings.description',\n\t\t\t\t\t'residential_listings.favorites as r_favorites', 'residential_listings.show as r_show',\n\t\t\t\t\t'residential_listings.expose_address as r_expose_address',\n\t\t\t\t\t'residential_listings.floor as r_floor',\n\t\t\t\t\t'residential_listings.total_room_count as r_total_room_count',\n\t\t\t\t\t'residential_listings.condition as r_condition',\n\t\t\t\t\t'residential_listings.showing_instruction as r_showing_instruction',\n\t\t\t\t\t'residential_listings.commission_amount as r_commission_amount',\n\t\t\t\t\t'residential_listings.cyof as r_cyof',\n\t\t\t\t\t'residential_listings.rented_date as r_rented_date',\n\t\t\t\t\t'residential_listings.rlsny as r_rlsny',\n\t\t\t\t\t'residential_listings.share_with_brokers as r_share_with_brokers',\n\t\t\t\t\t'residential_listings.tenant_occupied as r_tenant_occupied',\n\t\t\t\t\t'residential_listings.op_fee_percentage as r_op_fee_percentage',\n\t\t\t\t\t'residential_listings.rls_flag',\n\t\t\t\t\t'residential_listings.streeteasy_flag',\n\t\t\t\t)\n\n\t\t\t\tlistings\n\t\t\tend",
"title": ""
},
{
"docid": "eafe1e34807ce6850c3c680f318c19ea",
"score": "0.46708977",
"text": "def get_opp_lookups\n\n sources,stages = {},{}\n\n lookup_source = CompanySource.find_all_by_company_id(current_company.id) #Lookup.lead_source\n sources = ReportsHelper.get_lookups(lookup_source)\n sources[\"\"] , sources[nil] = \"\",\"\"\n\n lookup_stages = current_company.opportunity_stage_types\n stages = ReportsHelper.get_lookups(lookup_stages)\n stages[\"\"] , stages[nil] = \"\",\"\"\n\n [sources,stages]\n\n end",
"title": ""
},
{
"docid": "f637ac03ef6d6b44972f495236262ad0",
"score": "0.46672133",
"text": "def index\n @spies = Spy.all\n end",
"title": ""
},
{
"docid": "bc38fd2e3cb0874a9e00e566ed52ad2b",
"score": "0.46657413",
"text": "def search\n if params[:search].present?\n @commercialpropertiesforsales = Commercialpropertiesforsale.search(params[:search])\n else\n @commercialpropertiesforsales = Commercialpropertiesforsale.all\n end\n end",
"title": ""
},
{
"docid": "920443514679d9aa917c79f011591e41",
"score": "0.46654752",
"text": "def get_searched_l3_objects(l3_list)\n \tL3.where(id: [l3_list], l2_id: self.id).order(:name)\n end",
"title": ""
},
{
"docid": "8eaf6d1376ef25ab7d50bf2a0898b0fc",
"score": "0.46637505",
"text": "def index\n @orgs = OrgMgr.instance.traverse\n end",
"title": ""
},
{
"docid": "8dd2ad0888713d9413941ee70036587d",
"score": "0.46622425",
"text": "def index\n @q = GluttonSkill.active.ransack(params[:q])\n @glutton_skills = @q.result.page(params[:page]).per(15)\n end",
"title": ""
},
{
"docid": "4c245230c0deab3bb93df67f3ffbfaf3",
"score": "0.46589094",
"text": "def search_machine\n @search = Search.new\n @locations = Program.all.map{|prog| prog.location}.uniq \n end",
"title": ""
},
{
"docid": "b8667be128916a020d5dc0fe209e697d",
"score": "0.4656481",
"text": "def index\n @operative_systems = OperativeSystem.all\n end",
"title": ""
},
{
"docid": "77733de42709221765e836988fe35181",
"score": "0.4655366",
"text": "def search\n return if insufficient_query?\n # Call Primo Web Services\n unless @primo_id.nil? or @primo_id.empty?\n get_record = Exlibris::Primo::WebService::GetRecord.new(@primo_id, @base_url, {:institution => @institution}) \n @response = get_record.response\n process_record and process_search_results #since this is a search in addition to being a record call\n else\n brief_search = Exlibris::Primo::WebService::SearchBrief.new(search_params, @base_url, {:institution => @institution})\n @response = brief_search.response\n process_search_results\n end\n end",
"title": ""
},
{
"docid": "0a4fd8f8799ea400353dbd02abe6f5d4",
"score": "0.46520188",
"text": "def index\n @locomotive_types = LocomotiveType.all\n end",
"title": ""
},
{
"docid": "1316e1d08c8661e838defa6adf759265",
"score": "0.46475616",
"text": "def index\n \n #@authorized = true if current_user.id = @user.id\n opportunity_ids = SelectedOpportunity.where(user_id: @user.id, archived: false).pluck(:opportunity_id)\n @opportunities = Opportunity.order('deadline desc').where(id: opportunity_ids).search(params[:query])\n \n end",
"title": ""
},
{
"docid": "05bb4fc1706f69464d5b33f865a4cab0",
"score": "0.46433586",
"text": "def get_all_jobs \n soap_action = \"http://www.rimage.com/RmJobService/IRmJobService/GetJobStatuses\"\n response = invoke(\"rmj:GetJobStatuses\", :soap_action => soap_action) do |message|\n message.add \"rmj:request\" do |req|\n req.add \"rim:CallerId\", \"Warehouse\"\n end\n end\n parse_job_list(response.document.xpath(\"//s:Body\").first)\n end",
"title": ""
},
{
"docid": "6525621643287cb92a9a65d7eb7ebf37",
"score": "0.46359634",
"text": "def list_opsgenie_services(opts = {})\n data, _status_code, _headers = list_opsgenie_services_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "59a14795b68df5f7415d959185cf0436",
"score": "0.46332964",
"text": "def index\n @explosives = Explosive.all\n end",
"title": ""
},
{
"docid": "417f4721768279fb20f287a15a606aa8",
"score": "0.4633234",
"text": "def consultaRiesgo(opts)\n @iucn = CONFIG.iucn.api\n @token = CONFIG.iucn.token\n\n url = \"#{@iucn}/api/v3/species/#{opts[:nombre].limpia_ws}?token=#{@token}\"\n url_escape = URI.escape(url)\n uri = URI.parse(url_escape)\n req = Net::HTTP::Get.new(uri.to_s)\n begin\n res = Net::HTTP.start(uri.host, uri.port, :read_timeout => CONFIG.iucn.timeout ) {|http| http.request(req) }\n jres = JSON.parse(res.body)['result']\n jres[0]['category'] if jres.any?\n rescue => e\n nil\n end\n end",
"title": ""
},
{
"docid": "572a24f9fc6dd57b61556664b73f4e20",
"score": "0.46292397",
"text": "def index\n @job_oportunities = JobOportunity.all\n end",
"title": ""
},
{
"docid": "604cbf85f7c961681345f39ae44e2af8",
"score": "0.4626425",
"text": "def index\n @search = Goalie.search(params[:q])\n @goalies = @search.result\n end",
"title": ""
},
{
"docid": "42803375b4b5d51faf91bbd7d5e6d366",
"score": "0.46249598",
"text": "def index\n @sgoa_store_goals = SgoaStoreGoal.all\n end",
"title": ""
},
{
"docid": "bb9d3c93bc63f2404429a32e01ac608f",
"score": "0.46233976",
"text": "def index\n @losses = Loss.all\n end",
"title": ""
},
{
"docid": "20a414d2623bebf7400e09b1d1074565",
"score": "0.4623257",
"text": "def index\n @search = params[:search]\n @skills = Skill.search(params[:search])\n \n end",
"title": ""
},
{
"docid": "7da5d60885fc54dd4596708859043a18",
"score": "0.46204272",
"text": "def index\n @sims_employee_words = SimsEmployeeWord.all\n end",
"title": ""
},
{
"docid": "c548c08b8468fb59923b7e3eb05343e3",
"score": "0.46159014",
"text": "def index\n @q = Psicologa.ransack(params[:q])\n @psicologas = @q.result(distinct: true)\n end",
"title": ""
},
{
"docid": "0643ead424996f1078fba7d8384fcf68",
"score": "0.4614187",
"text": "def fetch_system_poi_list\n url_options = \"/api/location/#{system_id}/pois\"\n url = @url + url_options\n resp = send_request(url)\n\n begin\n resp_code = resp.code\n body = Hash.from_xml(resp.body)\n rescue\n return nil\n end\n\n if resp_code == \"200\"\n body[\"locations\"][\"location\"]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "46bde7afdd814018f1bd4f3f2dc33c90",
"score": "0.46127537",
"text": "def index\n manage_filter_state\n no = params[:No]\n company = params[:WrkrCompany]\n office = params[:WrkrOffice]\n # OCO\n init_oco if !session[:organization]\n # Initialize select_tags\n if session[:company] != '0'\n @companies = Company.where(id: session[:company]) if @companies.nil?\n company = session[:company]\n else\n @companies = Company.order(:name) if @companies.nil?\n end\n if session[:office] != '0'\n @offices = Office.where(id: session[:office]) if @offices.nil?\n office = session[:office]\n elsif session[:company] != '0'\n @offices = @companies.first.offices.order(:name) if @offices.nil?\n else\n @offices = Office.order(:name) if @offices.nil?\n end\n\n # If inverse no search is required\n no = !no.blank? && no[0] == '%' ? inverse_no_search(no) : no\n\n @search = Project.search do\n fulltext params[:search]\n if session[:organization] != '0'\n with :organization_id, session[:organization]\n end\n if !no.blank?\n if no.class == Array\n with :project_code, no\n else\n with(:project_code).starting_with(no)\n end\n end\n if !company.blank?\n with :company_id, company\n end\n if !office.blank?\n with :office_id, office\n end\n data_accessor_for(Project).include = [:company, :office]\n order_by :sort_no, :asc\n paginate :page => params[:page] || 1, :per_page => per_page\n end\n @projects = @search.results\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n format.js\n end\n end",
"title": ""
},
{
"docid": "98b6061b9b0d4742c3216427581a510e",
"score": "0.46118402",
"text": "def index\n params[:page] ||= 1\n allele_params = setup_allele_search(params)\n @alleles = Allele.search( allele_params ).paginate(\n :page => params[:page],\n :select => \"distinct alleles.*\",\n :include => [ { :targeting_vectors => :pipeline }, { :es_cells => :pipeline } ]\n )\n mutational_drop_downs\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @alleles }\n format.json { render :json => @alleles }\n end\n end",
"title": ""
},
{
"docid": "1c01d83635a27954cd320212dc87d094",
"score": "0.46115315",
"text": "def index\n @page_count, @services = Locomotive::Service.paginated(:page => (params[:page] || 1).to_i)\n display @services\n end",
"title": ""
},
{
"docid": "4e276f1046be7151cef1de1973a4b8b6",
"score": "0.4609063",
"text": "def index\n @os_names = OsName.all\n end",
"title": ""
},
{
"docid": "0e7d56a163e76f52c23cd482e5423351",
"score": "0.4605042",
"text": "def job_offers_search(company,status,order,search_string)\n\n if search_string != nil\n @@search = search_string\n end\n if status != nil\n @@status = status\n end\n if order != nil\n @@order = order\n end\n\n puts \"Params: \" + @@search + \" \" + @@status + \" \" + @@order\n\n #Aqui é feita a escolha da query a usar dependendo dos parametros passados\n if @@status != \"ALL\" #Se não for TUDO, há que respeitar o Status\n if @@search != \"\"\n evaluations = company.job_offers.where(\"status = ?\" , @@status).where(\"job_name LIKE '%\" + @@search + \"%'\").order(\"job_name \" + @@order )\n puts \"PASSEI 1\"\n else\n evaluations = company.job_offers.where(\"status = ?\" , @@status).order(\"job_name \" + @@order )\n puts \"PASSEI 2\"\n end\n else #Se for TUDO, vem tudo, sem respeito por status\n if @@search != \"\"\n evaluations = company.job_offers.where(\"job_name LIKE '%\" + @@search + \"%'\").order(\"job_name \" + @@order )\n puts \"PASSEI 3\"\n else\n evaluations = company.job_offers.order(\"job_name \" + @@order )\n puts \"PASSEI 4\"\n end\n end\n\n return evaluations\n\n end",
"title": ""
}
] |
f33dc865f2bd1cbacc29187cd1d9c062
|
GET /instructors_schedules/1 GET /instructors_schedules/1.json
|
[
{
"docid": "a81945373733e4951b987de6ea99f9a1",
"score": "0.0",
"text": "def show\n end",
"title": ""
}
] |
[
{
"docid": "65901b538dbd713ad56ff36880e3f7b7",
"score": "0.7951076",
"text": "def index\n @instructors_schedules = InstructorsSchedule.all\n end",
"title": ""
},
{
"docid": "e1e3695bacfb45f4b4424cfdc864246e",
"score": "0.74569154",
"text": "def set_instructors_schedule\n @instructors_schedule = InstructorsSchedule.find(params[:id])\n end",
"title": ""
},
{
"docid": "b4872d32915c3e82006abc7ccd415404",
"score": "0.73186165",
"text": "def index\n schedules = get_all_schedules\n\n response = {\n schedules: schedules\n }\n\n respond_to do |format|\n format.json { render :json => response}\n end\n end",
"title": ""
},
{
"docid": "8aa6dbd5a626723eca45d7553e797be9",
"score": "0.7261639",
"text": "def show\n @shedule = Shedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @shedule }\n end\n end",
"title": ""
},
{
"docid": "67add2f10eeb42fc566de0e4a4c2bda4",
"score": "0.72195834",
"text": "def show\n @schedule = getSchedules()[params[:id]]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule }\n end\n end",
"title": ""
},
{
"docid": "8c5993ecbbb851733c339b4ed3c93f00",
"score": "0.7133704",
"text": "def show\n @checkin_schedule = current_user.checkin_schedules.where(id: params[:id]).first\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @checkin_schedule }\n end\n end",
"title": ""
},
{
"docid": "3f8af591171f72d469815c8930fbabe3",
"score": "0.71302384",
"text": "def show\n @schedule = Schedule.find(params[:id])\n\n render json: @schedule\n end",
"title": ""
},
{
"docid": "51a097c9f87a609aa5ca5980d6a66bbe",
"score": "0.7073989",
"text": "def show\n render json: @schedule\n end",
"title": ""
},
{
"docid": "416de8e152e24392aa627d2ca6ef31d5",
"score": "0.69500417",
"text": "def show\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule }\n end\n end",
"title": ""
},
{
"docid": "416de8e152e24392aa627d2ca6ef31d5",
"score": "0.69500417",
"text": "def show\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule }\n end\n end",
"title": ""
},
{
"docid": "416de8e152e24392aa627d2ca6ef31d5",
"score": "0.69500417",
"text": "def show\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule }\n end\n end",
"title": ""
},
{
"docid": "416de8e152e24392aa627d2ca6ef31d5",
"score": "0.69500417",
"text": "def show\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule }\n end\n end",
"title": ""
},
{
"docid": "416de8e152e24392aa627d2ca6ef31d5",
"score": "0.69500417",
"text": "def show\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule }\n end\n end",
"title": ""
},
{
"docid": "416de8e152e24392aa627d2ca6ef31d5",
"score": "0.69500417",
"text": "def show\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule }\n end\n end",
"title": ""
},
{
"docid": "416de8e152e24392aa627d2ca6ef31d5",
"score": "0.69500417",
"text": "def show\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule }\n end\n end",
"title": ""
},
{
"docid": "416de8e152e24392aa627d2ca6ef31d5",
"score": "0.69500417",
"text": "def show\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule }\n end\n end",
"title": ""
},
{
"docid": "416de8e152e24392aa627d2ca6ef31d5",
"score": "0.69500417",
"text": "def show\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule }\n end\n end",
"title": ""
},
{
"docid": "5669384157b3aa909d50613991f5681d",
"score": "0.6941417",
"text": "def create\n @instructors_schedule = InstructorsSchedule.new(instructors_schedule_params)\n\n respond_to do |format|\n if @instructors_schedule.save\n format.html { redirect_to @instructors_schedule, notice: 'Instructors schedule was successfully created.' }\n format.json { render :show, status: :created, location: @instructors_schedule }\n else\n format.html { render :new }\n format.json { render json: @instructors_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7da58a1cc0251dcf4a5f9e2d902163a1",
"score": "0.6941031",
"text": "def index\n @schedules = Schedule.find_all_by_business_id(current_user.id)\n @schedule = \"\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @schedules }\n end\n end",
"title": ""
},
{
"docid": "b2606ba384d88ca4a777e91896dbca8f",
"score": "0.6933733",
"text": "def show\n @classroom_schedule = Classroom::Schedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @classroom_schedule.events }\n end\n end",
"title": ""
},
{
"docid": "c9af5df92c575e2646893682f7d43b88",
"score": "0.6932774",
"text": "def index\n @schedules = @meeting_room.schedules.all\n end",
"title": ""
},
{
"docid": "2ff834979867ed3c3ac43c75a94759fd",
"score": "0.69204867",
"text": "def index\n @classroom_schedules = Classroom::Schedule.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @classroom_schedules }\n end\n end",
"title": ""
},
{
"docid": "167fa5b5b666592e9a1a6df30a5efbc1",
"score": "0.68712825",
"text": "def index\n @schedules = current_user.schedules.all\n end",
"title": ""
},
{
"docid": "ba9c72c259699d5966ce435714ca60f8",
"score": "0.6869961",
"text": "def show\n @resource_schedule = ResourceSchedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @resource_schedule }\n end\n end",
"title": ""
},
{
"docid": "9913b3051d546a9bbf65f4c844850412",
"score": "0.68670183",
"text": "def schedules\n res = request('schedules')\n res.map { |schedule| Schedule.new(schedule) }\n end",
"title": ""
},
{
"docid": "e942d9daf743e1464c0a7f868d804536",
"score": "0.6830327",
"text": "def schedules\n SchedulesController.instance\n end",
"title": ""
},
{
"docid": "4077813b5358cd88367b4296e2ea959d",
"score": "0.68030506",
"text": "def index\n @schedules = Schedule.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @schedules }\n end\n end",
"title": ""
},
{
"docid": "4077813b5358cd88367b4296e2ea959d",
"score": "0.68030506",
"text": "def index\n @schedules = Schedule.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @schedules }\n end\n end",
"title": ""
},
{
"docid": "e6316f20d90d567b8bf4e3b8d992a093",
"score": "0.67977226",
"text": "def show\n @schedules=@student.get_schedules\n end",
"title": ""
},
{
"docid": "d0e5275f4824f6eda08e98d96fbb32ca",
"score": "0.67946917",
"text": "def show\n authorize @job\n @schedules = @job.schedules\n end",
"title": ""
},
{
"docid": "acc0d2f6225083bda2cc709bb6887919",
"score": "0.6778264",
"text": "def show\n @schedules_event = SchedulesEvent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedules_event }\n end\n end",
"title": ""
},
{
"docid": "874a5e851018ea293533964a91ca0dab",
"score": "0.67754626",
"text": "def show\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @schedule.to_json(:except => [:created_at, :updated_at]) }\n end\n end",
"title": ""
},
{
"docid": "77269fbca372b701eb88a1012f32bf96",
"score": "0.6771579",
"text": "def index\n @schedules = Schedule.all\n end",
"title": ""
},
{
"docid": "77269fbca372b701eb88a1012f32bf96",
"score": "0.6771579",
"text": "def index\n @schedules = Schedule.all\n end",
"title": ""
},
{
"docid": "77269fbca372b701eb88a1012f32bf96",
"score": "0.6771579",
"text": "def index\n @schedules = Schedule.all\n end",
"title": ""
},
{
"docid": "77269fbca372b701eb88a1012f32bf96",
"score": "0.6771579",
"text": "def index\n @schedules = Schedule.all\n end",
"title": ""
},
{
"docid": "77269fbca372b701eb88a1012f32bf96",
"score": "0.6771579",
"text": "def index\n @schedules = Schedule.all\n end",
"title": ""
},
{
"docid": "77269fbca372b701eb88a1012f32bf96",
"score": "0.6771579",
"text": "def index\n @schedules = Schedule.all\n end",
"title": ""
},
{
"docid": "77269fbca372b701eb88a1012f32bf96",
"score": "0.6771579",
"text": "def index\n @schedules = Schedule.all\n end",
"title": ""
},
{
"docid": "77269fbca372b701eb88a1012f32bf96",
"score": "0.6771579",
"text": "def index\n @schedules = Schedule.all\n end",
"title": ""
},
{
"docid": "77269fbca372b701eb88a1012f32bf96",
"score": "0.6771579",
"text": "def index\n @schedules = Schedule.all\n end",
"title": ""
},
{
"docid": "77269fbca372b701eb88a1012f32bf96",
"score": "0.6771579",
"text": "def index\n @schedules = Schedule.all\n end",
"title": ""
},
{
"docid": "c68b0daf930bc0dc2656f39dad789202",
"score": "0.67539316",
"text": "def get_my_schedule\n @data = current_user.get_my_schedule(params)\n render :json => @data\n end",
"title": ""
},
{
"docid": "1bfb15b266108e58a853342442e6f250",
"score": "0.6743412",
"text": "def schedules\n @tournament = Tournament.find(params[:id], :include => :teams)\n @teams = @tournament.teams\n end",
"title": ""
},
{
"docid": "b36b22ff0e9f65016fbf90e70162a4b2",
"score": "0.6726082",
"text": "def index\n @user = current_user\n @schedules = @user.schedules \n end",
"title": ""
},
{
"docid": "310fbbcb1a0660374aaa2dca38ffd2d0",
"score": "0.67243785",
"text": "def index\n @schedules = current_specialist.schedules.includes(:schedule_entities)\n end",
"title": ""
},
{
"docid": "0564c50a22c34a4b606c9e3ad6c94c2a",
"score": "0.67100334",
"text": "def index\n @route_schedules = RouteSchedule.all\n render json: @route_schedules\n end",
"title": ""
},
{
"docid": "f08e0e8887396b3938a6da62ec0496be",
"score": "0.6709793",
"text": "def index\n @schedules = Schedule.where(teammember_id: params[:teammember_id]).order(start_time: :asc)\n end",
"title": ""
},
{
"docid": "e24a252b0638e7b67eb74da837420962",
"score": "0.669892",
"text": "def show\n render json: @route_schedule\n end",
"title": ""
},
{
"docid": "de840194c52c135d1121b4d0b6f06e92",
"score": "0.6692968",
"text": "def index\n @assignment_schedules = AssignmentSchedule.all\n end",
"title": ""
},
{
"docid": "c4a7e12a4a254c9a7dcc3ec647576951",
"score": "0.6684204",
"text": "def index\n @shedules = Shedule.all\n end",
"title": ""
},
{
"docid": "da4dffcb31570a6f77c1f520f770bff9",
"score": "0.66818446",
"text": "def index\n @schedulings = Scheduling.all\n end",
"title": ""
},
{
"docid": "27ccfa7c1ff56c77295e6d412813b37a",
"score": "0.6650723",
"text": "def show\n @work_schedule = WorkSchedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work_schedule }\n end\n end",
"title": ""
},
{
"docid": "ee2288f2c6fa842fc1cdc3795fe443e5",
"score": "0.6647354",
"text": "def index\n @interview_schedules = InterviewSchedule.all\n end",
"title": ""
},
{
"docid": "3e0d7e2d72d95c31257b3706ffbaf9dc",
"score": "0.66387165",
"text": "def index\n @time_schedules = TimeSchedule.all\n end",
"title": ""
},
{
"docid": "25d4f1cf7dce1b5a67b1714fe69055ed",
"score": "0.66379327",
"text": "def show\n @schedule = Schedule.find_by_id(current_user)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @schedule }\n end\n end",
"title": ""
},
{
"docid": "3f9d250a2b7a0c772a9990d4588c2058",
"score": "0.66275275",
"text": "def show\n @kr_schedule = KrSchedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @kr_schedule }\n end\n end",
"title": ""
},
{
"docid": "104c63e14235dde8afaa5a74e5549bb7",
"score": "0.6617487",
"text": "def index\n @non_recurring_hours = NonRecurringHour.all\n @instructor = Instructor.find params[:instructor_id]\n end",
"title": ""
},
{
"docid": "fcc5a398241a7be12225995de1755ffe",
"score": "0.66132104",
"text": "def schedules\n result = {}\n @location = Location.find(params[:location_id])\n start_date = params[:start_date] ? Date.parse(params[:start_date]) : Date.today\n end_date = params[:end_date] ? Date.parse(params[:end_date]) : Date.today\n (start_date..end_date).each do |date|\n result[date] = @location.schedule_at(date)\n end\n render :json => result\n end",
"title": ""
},
{
"docid": "bae0d622f7f604eda784ba57ee6b28d0",
"score": "0.6612623",
"text": "def show\n\t\tverify_show_params\n\t\tverify_show_param_values\n\n\t\t@schedule = Schedule.find(params[:id])\n\tend",
"title": ""
},
{
"docid": "361eba9be7434b80bf527b8e63788e12",
"score": "0.6607554",
"text": "def index\n @task_schedules = TaskSchedule.all\n end",
"title": ""
},
{
"docid": "fa8b3e6de3a2f2bf9cf5130fe6672ac0",
"score": "0.6603122",
"text": "def student_schedule\n resp = get_calendar(@student_url, @student_calendar_days)\n parse_response(resp, :hide_dates => true, :message => \"No students in today\")\n end",
"title": ""
},
{
"docid": "6898db967758292201e5db461f5e9caa",
"score": "0.6601697",
"text": "def schedules\n @schedules = Schedule.all\n end",
"title": ""
},
{
"docid": "bc92a439135599cfc3ea245f271a70c3",
"score": "0.65940815",
"text": "def show\n @schedule = Schedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule, root: false, :serializer => ScheduleReadOnlySerializer }\n end\n end",
"title": ""
},
{
"docid": "98e73af47c0e713a85efe7aa37ec3c72",
"score": "0.65882474",
"text": "def show\n respond_to do |format|\n format.json { return render json: { data: @schedule, fandom: @schedule.fandom, status: :ok} }\n end\n end",
"title": ""
},
{
"docid": "d86e02dd96120bfbfe18edc4e4921c1b",
"score": "0.65723294",
"text": "def show\n\n @schedule = Schedule.find(params[:id])\n @schedules = @schedule.center.schedules\n @center = @schedule.center\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedule }\n end\n end",
"title": ""
},
{
"docid": "3cb9bcff397b9ec7c8d974e4cc6ae579",
"score": "0.65575284",
"text": "def show\n respond_with @schedule\n end",
"title": ""
},
{
"docid": "4212fb46f91b330213471e786651a489",
"score": "0.6550078",
"text": "def index\n @scheduleds = Scheduled.all\n end",
"title": ""
},
{
"docid": "3d87925653fec33b7dcd966bc8d85b4c",
"score": "0.6547921",
"text": "def show\n @rescheduling = Rescheduling.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rescheduling }\n end\n end",
"title": ""
},
{
"docid": "0576a45dcc675287fca28de9cb680d10",
"score": "0.6545126",
"text": "def show\n @service_schedule = ServiceSchedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @service_schedule }\n end\n end",
"title": ""
},
{
"docid": "b4a5808b96628c85756f3451dfdaef9e",
"score": "0.6539214",
"text": "def update\n respond_to do |format|\n if @instructors_schedule.update(instructors_schedule_params)\n format.html { redirect_to @instructors_schedule, notice: 'Instructors schedule was successfully updated.' }\n format.json { render :show, status: :ok, location: @instructors_schedule }\n else\n format.html { render :edit }\n format.json { render json: @instructors_schedule.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "db657a524efc9f631f1eccea93db6bfd",
"score": "0.6531779",
"text": "def index\n schedules = Schedule.all\n render json: schedules, status: 200\n\n ################# API PULL CODE #############################\n\n # @uri = HTTParty.get\"http://api.sportsdatallc.org/nba-t3/games/2014/REG/schedule.xml?api_key=3jdhu8c22zst6mn3p6fajnze\"\n\n # @length = @uri['league']['season_schedule']['games']['game'].length\n \n # for @i in 0...@length \n \n # @home = @uri['league']['season_schedule']['games']['game'][@i]['home_team']\n # @away = @uri['league']['season_schedule']['games']['game'][@i]['away_team']\n # @fulldate = @uri['league']['season_schedule']['games']['game'][@i]['scheduled']\n\n # # fulldate_array = fulldate.split('T')\n # # @date = fulldate_array[0]\n # # @time = fulldate_array[1].split('+')[0]\n\n # Schedule.create(home_team_id: @home, away_team_id: @away, game_date: @fulldate)\n # end\n # @teams = @uri['league']['season_schedule']['games']['game']\n end",
"title": ""
},
{
"docid": "73a927d774beaf4aae6557174be62f2b",
"score": "0.65170664",
"text": "def show\n render json: @service_schedule\n end",
"title": ""
},
{
"docid": "75ba4b535dd93c2c6c5ee963654153ba",
"score": "0.6516112",
"text": "def index\n @kaunsering_schedules = KaunseringSchedule.all\n end",
"title": ""
},
{
"docid": "d2dea49dd68d6815930b654e8b4fb852",
"score": "0.65108603",
"text": "def index\n @job_schedules = JobSchedule.all\n end",
"title": ""
},
{
"docid": "c70e1ef1b431f71ebe99fd08fd8d4f8f",
"score": "0.64937127",
"text": "def show\n# @schedule = Schedule.find(params[:id])\n\n end",
"title": ""
},
{
"docid": "362b8ee0d9abce462bc9ff4854350024",
"score": "0.6480051",
"text": "def show\n if(!checkAdmin())\n redirect_to \"/\", notice: 'Admin only!'\n return\n end\n @semester_schedule = SemesterSchedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @semester_schedule }\n end\n end",
"title": ""
},
{
"docid": "971e9bd64bb5f60375f87b17f1a7da89",
"score": "0.6465278",
"text": "def show\n @work_task_schedules = WorkTaskTimeSchedule.where('work_task_id = ?', params[:id])\n end",
"title": ""
},
{
"docid": "d4e40dbf95ebfcedb7bfa7bdcbff467e",
"score": "0.6462865",
"text": "def index\n @reminder_schedules = ReminderSchedule.all\n end",
"title": ""
},
{
"docid": "9eba005f7da3ba05045bf7563b2c5dc4",
"score": "0.64625055",
"text": "def show\n #@schedule = Schedule.find(params[:id])\n @user_id = RememberToken.where(token: @remember_token).first.user_id\n @schedule = Schedule.where(user_id: @user_id).first_or_create\n if @schedule\n #@schedule_hash = Hash.new\n #@schedule_hash['schedule'] = @schedule\n #@schedule_hash['sections'] = @schedule.sections\n\n respond_to do |format|\n format.json { render :json => @schedule.sections }\n end\n\n else\n respond_to do |format|\n format.json { render :json => [] }\n end\n end\n rescue ActiveRecord::RecordNotFound\n respond_to do |format|\n format.json { render :json => [] }\n end\n end",
"title": ""
},
{
"docid": "4c293d97687ec15e4abae6675dc6c1ea",
"score": "0.64543885",
"text": "def show\n @weekly_schedule = WeeklySchedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @weekly_schedule }\n end\n end",
"title": ""
},
{
"docid": "ddc4200532ffa494e88bea4591f412dd",
"score": "0.64528555",
"text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @working_schedule }\n end\n end",
"title": ""
},
{
"docid": "9009b9853e5b7209ec33a6331837400e",
"score": "0.64412296",
"text": "def index\n @schedule_students = ScheduleStudent.all\n end",
"title": ""
},
{
"docid": "31bf82a997793acad427dfa99aef9d61",
"score": "0.6439854",
"text": "def get_schedule(access_token, campaign_id, schedule_id)\n\t\t\t\t\turl = Util::Config.get('endpoints.base_url') + \n\t\t\t\t\t\t\t\tsprintf(Util::Config.get('endpoints.campaign_schedule'), campaign_id, schedule_id)\n\t\t\t\t\turl = build_url(url)\n\t\t\t\t\tresponse = RestClient.get(url, get_headers(access_token))\n\t\t\t\t\tComponents::Schedule.create(JSON.parse(response.body))\n\t\t\t\tend",
"title": ""
},
{
"docid": "8a854e3d2f3dbee1f70f151b66534076",
"score": "0.6438862",
"text": "def new\n @shedule = Shedule.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @shedule }\n end\n end",
"title": ""
},
{
"docid": "a90e0239d9b959df0a6adc5f8ec1b135",
"score": "0.6433503",
"text": "def show\n @course = getUserSchedule().courses[params[:id].to_i]\n\n respond_to do |format|\n format.html # show.html.format\n format.json { render json: @course }\n end\n end",
"title": ""
},
{
"docid": "843a039b8d255452e4548ec74951b7d7",
"score": "0.64260995",
"text": "def show\n @student = Student.find(params[:id])\n @schedule = Schedule.find_by(:email => @student.email)\n end",
"title": ""
},
{
"docid": "fd2709d85ecad2e983d97350bc788562",
"score": "0.6420214",
"text": "def index\n @working_schedules = WorkingSchedule.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @working_schedules }\n end\n end",
"title": ""
},
{
"docid": "83fec9b2652c1572ada1c820df5fb798",
"score": "0.64197296",
"text": "def index\n @scheduletimes = Scheduletime.all\n end",
"title": ""
},
{
"docid": "680fcd0b1270c10d98b65d7fcda904c5",
"score": "0.64122677",
"text": "def schedules_list\n assert_privileges(\"schedule\")\n\n schedule_build_list\n\n update_gtl_div('schedules_list') if pagination_or_gtl_request?\n end",
"title": ""
},
{
"docid": "add968074f9f4c8b4eefe8bcf50534fd",
"score": "0.6409087",
"text": "def set_schedule\n @schedule = @user.calendars.find(params[:id])\n end",
"title": ""
},
{
"docid": "5898a4008af42b3eb7a91fabf4a86c90",
"score": "0.63960385",
"text": "def schedules\n Schedules.new(@attributes.fetch('schedules', {}))\n end",
"title": ""
},
{
"docid": "707ceec35c8faec42b0ef48e1bcd9dd9",
"score": "0.6390389",
"text": "def index\n @schedule_events = ScheduleEvent.fullcalendar_events(params[:user_id])\n respond_to do |format|\n format.json { render json: @schedule_events }\n format.html\n end\n end",
"title": ""
},
{
"docid": "6861549ff75456da904296dae0f822d3",
"score": "0.63874966",
"text": "def instructors_schedule_params\n params.require(:instructors_schedule).permit(:schedule_id, :instructor_id, :day, :avail_seat)\n end",
"title": ""
},
{
"docid": "d73f534480e52a0cb8f6d76a6f6aeb7d",
"score": "0.63824147",
"text": "def index\n @nfi_schedules = NfiSchedule.all\n end",
"title": ""
},
{
"docid": "daa0320dc6522e517088fb931b7c0aff",
"score": "0.6375156",
"text": "def show\n @schedulereg = Schedulereg.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @schedulereg }\n end\n end",
"title": ""
},
{
"docid": "fbc6e6943cb723b98fee3cf9f239b1a4",
"score": "0.63691837",
"text": "def new\n @checkin_schedule = current_user.checkin_schedules.new(:monday => true, :tuesday => true, :wednesday => true,\n :thursday => true, :friday => true, :saturday => true, :sunday => true)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @checkin_schedule }\n end\n end",
"title": ""
},
{
"docid": "e065e4fa59f320e158883afd3b5f3c5c",
"score": "0.63682127",
"text": "def set_schedule\n @schedule = current_user.schedules.find(params[:id])\n end",
"title": ""
},
{
"docid": "4499c9997afab6ef6c090896552a8146",
"score": "0.6365855",
"text": "def index\n @eventschedules = Eventschedule.all\n end",
"title": ""
},
{
"docid": "4f4fdcc420c83d11b1ce53062c046dc2",
"score": "0.636049",
"text": "def show\n @office_cleanings_schedule = OfficeCleaningsSchedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @office_cleanings_schedule }\n end\n end",
"title": ""
},
{
"docid": "77652db5181641405542a94515f22ebe",
"score": "0.6359786",
"text": "def show\n @reloud_schedule = ReloudSchedule.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @reloud_schedule }\n end\n end",
"title": ""
}
] |
5a0c3a6b8a20a2fa396afc5abf5ba15c
|
Restart, start or stop the controller service Restart, start or stop the controller service
|
[
{
"docid": "b0c4e295a26d25892b3a002dffd3ca08",
"score": "0.0",
"text": "def create_controller_server_service_action_start(opts = {})\n data, _status_code, _headers = create_controller_server_service_action_start_with_http_info(opts)\n data\n end",
"title": ""
}
] |
[
{
"docid": "2e000d3fa7fe7feb4d08c8c9b11ef23f",
"score": "0.7844295",
"text": "def restart\n stop if service.loaded?\n start\n end",
"title": ""
},
{
"docid": "21c2bee0d6a9aea77a4172f38343c31d",
"score": "0.7315493",
"text": "def restart\n do_for_each_service { |service| service.restart }\n end",
"title": ""
},
{
"docid": "31b5b09cd199b1e4211910a8466c09c6",
"score": "0.72853434",
"text": "def restart\n @client.restart\n end",
"title": ""
},
{
"docid": "13406c79c9aa400236f5b4ec2eea4f82",
"score": "0.7193136",
"text": "def restart()\n shutdown()\n start()\n end",
"title": ""
},
{
"docid": "b7a9909be1dc8a32305ac4a94d4de988",
"score": "0.71236765",
"text": "def restart\n stop_all\n start\n end",
"title": ""
},
{
"docid": "f2ffdae85c70bfb11aacf65a1f6473ee",
"score": "0.7122752",
"text": "def restart\n if managed? && started?\n exec('restart', p: port, c: config.cloud)\n end\n end",
"title": ""
},
{
"docid": "f3d750a5def32d9ec2fd14ff8ca369fd",
"score": "0.711899",
"text": "def restart!\n stop!\n start!\n end",
"title": ""
},
{
"docid": "a6f015413558075f599ed2593611d043",
"score": "0.70865935",
"text": "def restart\n\trequire_relative '../../lib/falcon/command/supervisor'\n\t\n\tFalcon::Command::Supervisor[\"restart\"].call\nend",
"title": ""
},
{
"docid": "becd50bbdb38ed68bb6bc3893e4bf731",
"score": "0.7078363",
"text": "def restart\n stop\n start\n end",
"title": ""
},
{
"docid": "becd50bbdb38ed68bb6bc3893e4bf731",
"score": "0.7078363",
"text": "def restart\n stop\n start\n end",
"title": ""
},
{
"docid": "36b3dae901ea277a2c1748349236e802",
"score": "0.7042051",
"text": "def restart!\n stop! if running?\n start!\n end",
"title": ""
},
{
"docid": "1588f8fba13d2d0cee6e085c0f7b8e3e",
"score": "0.7036664",
"text": "def restart\n stop()\n start()\n end",
"title": ""
},
{
"docid": "80cd645d96ffc33fd9d812367afd9a36",
"score": "0.7032127",
"text": "def action_restart\n notify_if_service do\n service_resource.run_action(:restart)\n end\n end",
"title": ""
},
{
"docid": "6843be31c4d95b4d0e61371528f149d8",
"score": "0.70307994",
"text": "def restart!\n invoke [:restart]\n end",
"title": ""
},
{
"docid": "c54edd9b3d0d0b2d5ffd5e5b03ce49e3",
"score": "0.7026608",
"text": "def restart\n if @resource[:configvalidator]\n ucommand(:configvalidator)\n unless $CHILD_STATUS.exitstatus == 0\n raise Puppet::Error,\n \"Configuration validation failed. Cannot start service.\"\n end\n end\n if @resource[:restart] or restartcmd\n ucommand(:restart)\n else\n self.stop\n self.start\n end\n end",
"title": ""
},
{
"docid": "90cf23816b2b975a1d44c6c19968b388",
"score": "0.7026435",
"text": "def reset_service\n stop_service(true)\n start_service\n end",
"title": ""
},
{
"docid": "b4b5ac09bc5de0d9c4cb897e6f18067d",
"score": "0.7017433",
"text": "def restart\n shutdown if running?\n startup\n end",
"title": ""
},
{
"docid": "5ef12c51281ae01beb707e766a8236cc",
"score": "0.7014512",
"text": "def restart\n request(:restart)\n end",
"title": ""
},
{
"docid": "798cd447ea0579666cbf2759e6495958",
"score": "0.7000247",
"text": "def restart\n\t\tstop\n\t\tstart\n\tend",
"title": ""
},
{
"docid": "798cd447ea0579666cbf2759e6495958",
"score": "0.7000247",
"text": "def restart\n\t\tstop\n\t\tstart\n\tend",
"title": ""
},
{
"docid": "798cd447ea0579666cbf2759e6495958",
"score": "0.7000247",
"text": "def restart\n\t\tstop\n\t\tstart\n\tend",
"title": ""
},
{
"docid": "f26beb36f138817fa4ceb1e113c87df8",
"score": "0.6993592",
"text": "def restart\n if @resource[:restart] or restartcmd\n ucommand(:restart)\n else\n self.stop\n self.start\n end\n end",
"title": ""
},
{
"docid": "f709851314721a8bf7716319df8fd869",
"score": "0.6927311",
"text": "def restarted!\n run_setup\n run_connect\n start!\n end",
"title": ""
},
{
"docid": "3265b72840c3179090637cfee2e1f09b",
"score": "0.68568707",
"text": "def restart\n stop\n start\n end",
"title": ""
},
{
"docid": "3265b72840c3179090637cfee2e1f09b",
"score": "0.68568707",
"text": "def restart\n stop\n start\n end",
"title": ""
},
{
"docid": "4b4b99260b3515bae3bf5f97e79af12a",
"score": "0.6854845",
"text": "def restart\n ctl_proxy('restart','httpd restarted')\n end",
"title": ""
},
{
"docid": "9f4112f5cc359c798c4316a2e0bd582e",
"score": "0.6851611",
"text": "def start_service\n service new_resource.service_name do\n supports(\n status: true,\n restart: true\n )\n action %i(enable start)\n end\n end",
"title": ""
},
{
"docid": "3af473a8335e7c4dfe1cd11108d68a04",
"score": "0.68425155",
"text": "def restart\n stop\n start\n end",
"title": ""
},
{
"docid": "0f24cfdf3f9f65c37cb079ec9beb62ff",
"score": "0.68117374",
"text": "def restart!\n CouchSpring.post \"#{uri}/_restart\"\n end",
"title": ""
},
{
"docid": "60a0e4117b2ff2dbcf643d9f759ef547",
"score": "0.6803994",
"text": "def restart\n self.stop\n self.start\n end",
"title": ""
},
{
"docid": "32013acf90733c2884ae0dd6721414cf",
"score": "0.6797071",
"text": "def restart\n stop\n sleep self.class.stop_start_delay\n start\n end",
"title": ""
},
{
"docid": "5823ff8e3b607e7a8037f9938d4d2520",
"score": "0.6795444",
"text": "def restart\n @client = Helper.setup(parent_options)\n force = options[:force] ? true : false\n @client.system.restart(force)\n end",
"title": ""
},
{
"docid": "77e21d5382cef2edfc5cdbd412df17a1",
"score": "0.67746735",
"text": "def restart\n @status = :restart\n @runner.restart\n end",
"title": ""
},
{
"docid": "4852928fcd12455db0534772c25ab31c",
"score": "0.6763118",
"text": "def restart\n start\n end",
"title": ""
},
{
"docid": "a634f3c2de85baf5aef64832921dee0d",
"score": "0.6756803",
"text": "def restart\n stop if running?\n save\n start\n end",
"title": ""
},
{
"docid": "440754f72d05e1d01ba191c61997168c",
"score": "0.6733342",
"text": "def restart_manager\n put '/manager/restart'\n end",
"title": ""
},
{
"docid": "3aea1fc282f800c24ed6bcced1e8ff96",
"score": "0.67105097",
"text": "def restart\n swiftinit_run('reload', true)\n end",
"title": ""
},
{
"docid": "c1b8c973bb019792c87557154e0c872d",
"score": "0.6706691",
"text": "def restart(name)\n puts \" ** Restarting service #{name}\"\n sh \"service #{name} restart\"\n end",
"title": ""
},
{
"docid": "d0aea69d06ff405328312e3fd4d0c1b4",
"score": "0.67032987",
"text": "def restart\n app.restart\n end",
"title": ""
},
{
"docid": "bda3b27043f0c1410038c8f2fd9d15c8",
"score": "0.6683864",
"text": "def restart\n stop\n sleep 1\n start\n end",
"title": ""
},
{
"docid": "7a1d73513b185f993e1a45a4aeef96de",
"score": "0.66834086",
"text": "def restart\n Puppet.debug \"Call 'restart' for Pacemaker service '#{name}' on node '#{hostname}'\"\n unless primitive_is_running? name, hostname\n Puppet.info \"Pacemaker service '#{name}' is not running on node '#{hostname}'. Skipping restart!\"\n return\n end\n\n begin\n stop\n rescue\n nil\n ensure\n start\n end\n end",
"title": ""
},
{
"docid": "5e95f522d940284a56e74292836273ff",
"score": "0.6645682",
"text": "def reloadServiceNanny\n puts \"restart service-nanny\"\n if File.exists?('/emr/service-nanny/run/service-nanny.pid')\n sudo '/etc/init.d/service-nanny restart'\n else\n sudo '/etc/init.d/service-nanny start'\n end\nend",
"title": ""
},
{
"docid": "cc7c95f687f1b388c1fcd470bcfa8afe",
"score": "0.6644925",
"text": "def restart\n stop\n sleep(1)\n start\n end",
"title": ""
},
{
"docid": "fbdd6bc588c31a736f565cdbe8d2fbc3",
"score": "0.663912",
"text": "def restart_app\n stop_app\n start_app\n end",
"title": ""
},
{
"docid": "b00ef4b21ae0e54dc5681d9d5ba80cb2",
"score": "0.65776074",
"text": "def refresh\n if (@parameters[:ensure] == :running)\n provider.restart\n else\n debug \"Skipping restart; service is not running\"\n end\n end",
"title": ""
},
{
"docid": "8cff91dd956a6108c3ca9ade273c8b96",
"score": "0.65673286",
"text": "def start\n\t\t\t\tself.restart unless @container\n\t\t\tend",
"title": ""
},
{
"docid": "7ad667f076fb391ff51ed4a011a1dc55",
"score": "0.6564786",
"text": "def restartservice(service)\n do_request 'restartservice', :service => service\n end",
"title": ""
},
{
"docid": "339fea33159696c509fc493b0eabb516",
"score": "0.6559232",
"text": "def restart\n unless onebyone\n # Let's do a normal restart by defaults\n stop\n sleep 0.1 # Let's breath a bit shall we ?\n start\n else\n with_each_server do |n| \n stop_server(n)\n sleep 0.1 # Let's breath a bit shall we ?\n start_server(n)\n wait_until_server_started(n)\n end\n end\n end",
"title": ""
},
{
"docid": "80d3afe386a09b6e8cfccef576a02df1",
"score": "0.6547257",
"text": "def restart\n if running?\n validate_fluentd_options && stop && start\n else\n # NOTE: no path to here from browser operations for now\n start\n end\n end",
"title": ""
},
{
"docid": "80d3afe386a09b6e8cfccef576a02df1",
"score": "0.6547257",
"text": "def restart\n if running?\n validate_fluentd_options && stop && start\n else\n # NOTE: no path to here from browser operations for now\n start\n end\n end",
"title": ""
},
{
"docid": "00e5b0b740d8b7a9c70333865e8673b4",
"score": "0.65428567",
"text": "def restart\n stop\n reset\n start\n end",
"title": ""
},
{
"docid": "00e5b0b740d8b7a9c70333865e8673b4",
"score": "0.65428567",
"text": "def restart\n stop\n reset\n start\n end",
"title": ""
},
{
"docid": "b98d294221b077f4a8b9b3bc384fc7a8",
"score": "0.65404195",
"text": "def reloadServiceNanny\n puts \"restart service-nanny\"\n if File.exists?('/mnt/var/run/service-nanny/service-nanny.pid')\n sudo '/etc/init.d/service-nanny restart'\n else\n sudo '/etc/init.d/service-nanny start'\n end\nend",
"title": ""
},
{
"docid": "b98d294221b077f4a8b9b3bc384fc7a8",
"score": "0.65404195",
"text": "def reloadServiceNanny\n puts \"restart service-nanny\"\n if File.exists?('/mnt/var/run/service-nanny/service-nanny.pid')\n sudo '/etc/init.d/service-nanny restart'\n else\n sudo '/etc/init.d/service-nanny start'\n end\nend",
"title": ""
},
{
"docid": "89e6fa59464d43a7fa32eb6ffe8ad53f",
"score": "0.6534771",
"text": "def restart!\n restart(true)\n end",
"title": ""
},
{
"docid": "f0a3f268dd96b878ee1436edbec663e0",
"score": "0.65202975",
"text": "def restart_action\n execute \"J 0\"\n update_status\n end",
"title": ""
},
{
"docid": "c9070185a37f94adb3a98f1a08d0927a",
"score": "0.6512281",
"text": "def action_reload\n if service_resource.current_value.running\n Chef::Log.info(\"Reloading solaris service #{new_resource.service_name} by restarting\")\n action_restart\n else\n Chef::Log.info(\"Reloading solaris service #{new_resource.service_name} - not running \")\n end\n end",
"title": ""
},
{
"docid": "5718d662f21c50e19a856c1a0d4bf174",
"score": "0.6475905",
"text": "def restart\n @stop = false\n end",
"title": ""
},
{
"docid": "bbef44e3eaabbc173b97f1a5547342f3",
"score": "0.6462439",
"text": "def restart\n if managed? && started?\n exec_solr('restart', p: port, c: options[:cloud])\n end\n end",
"title": ""
},
{
"docid": "143b89d6b4d885a976a92f3e2605a587",
"score": "0.6461108",
"text": "def restart!\n Kernel.exec(*@restart_cmdline)\n end",
"title": ""
},
{
"docid": "7c1f36033a3ab31adce895cca3e6920b",
"score": "0.64355546",
"text": "def restart(options = {})\n return if stopped?\n stop\n start(options)\n end",
"title": ""
},
{
"docid": "d83d26189aaa7f8d7307bae0c82cb8f8",
"score": "0.6432243",
"text": "def restart\n $Log.info('Restarting Client')\n \n # Modify Path to ruby file if running on Windows\n require 'rbconfig'\n self_path = File.absolute_path(__FILE__)\n self_path.gsub!('/','\\\\') if (RbConfig::CONFIG['host_os'] =~ /mswin|mingw|cygwin/)\n \n # Call this file an replace exising process\n Kernel.exec(self_path, 'run')\n end",
"title": ""
},
{
"docid": "267108d7653e7110bdc6a5528f7dc8da",
"score": "0.64135295",
"text": "def restart\n puts 'Restarting denormalization service...'\n\n unless supervisor\n puts 'No Supervisor configured.'\n return\n end\n\n stop\n start\n end",
"title": ""
},
{
"docid": "104cc6e4bcd4b5f2f27c6bdb3d6f0e14",
"score": "0.6408944",
"text": "def SaveAndRestartService\n Builtins.y2milestone(\"Forced save and restart\")\n SetModified()\n\n SetStartService(true)\n\n return false if !Write()\n\n true\n end",
"title": ""
},
{
"docid": "54fef8a625a273f8a6167da8c22620e0",
"score": "0.6405209",
"text": "def ssh_service_restart\n launch_daemons_plist = '/System/Library/LaunchDaemons/ssh.plist'\n exec(Beaker::Command.new(\"launchctl unload #{launch_daemons_plist}\"))\n exec(Beaker::Command.new(\"launchctl load #{launch_daemons_plist}\"))\n end",
"title": ""
},
{
"docid": "54fef8a625a273f8a6167da8c22620e0",
"score": "0.6405209",
"text": "def ssh_service_restart\n launch_daemons_plist = '/System/Library/LaunchDaemons/ssh.plist'\n exec(Beaker::Command.new(\"launchctl unload #{launch_daemons_plist}\"))\n exec(Beaker::Command.new(\"launchctl load #{launch_daemons_plist}\"))\n end",
"title": ""
},
{
"docid": "cd099f748b4259e4581754f926d9f745",
"score": "0.63834774",
"text": "def restart!(env=:production)\n invoke [:restart], env\n end",
"title": ""
},
{
"docid": "7de93b7ad81aad176aef84dfaf655775",
"score": "0.63834596",
"text": "def ssh_service_restart\n command_result = nil\n # we get periodic failures to restart the service, so looping these with re-attempts\n repeat_fibonacci_style_for(5) do\n 0 == exec(Beaker::Command.new(\"cygrunsrv -E sshd\"), :acceptable_exit_codes => [0, 1]).exit_code\n end\n repeat_fibonacci_style_for(5) do\n command_result = exec(Beaker::Command.new(\"cygrunsrv -S sshd\"), :acceptable_exit_codes => [0, 1])\n 0 == command_result.exit_code\n end\n command_result\n end",
"title": ""
},
{
"docid": "6d72e5e528abb1a2bee56598c6a1d252",
"score": "0.6376009",
"text": "def restart_service()\n required_set?\n \n begin\n @container.find(@domain).find(@service).restart()\n \n rescue Exception => ex\n ContainerLogger.error \"Error restarting service #{@domain}::#{@service}!\".console_yellow, 1\n return \"error;#{ex}\"\n rescue => ex\n ContainerLogger.error \"Error restarting service #{@domain}::#{@service}!\".console_yellow, 1\n return \"Error restarting service #{@domain}::#{@service}!\"\n end\n \"#{@service} restarted!\"\n end",
"title": ""
},
{
"docid": "6d72e5e528abb1a2bee56598c6a1d252",
"score": "0.6376009",
"text": "def restart_service()\n required_set?\n \n begin\n @container.find(@domain).find(@service).restart()\n \n rescue Exception => ex\n ContainerLogger.error \"Error restarting service #{@domain}::#{@service}!\".console_yellow, 1\n return \"error;#{ex}\"\n rescue => ex\n ContainerLogger.error \"Error restarting service #{@domain}::#{@service}!\".console_yellow, 1\n return \"Error restarting service #{@domain}::#{@service}!\"\n end\n \"#{@service} restarted!\"\n end",
"title": ""
},
{
"docid": "bb1b6d140a48a280a46b9f726ba5d2a8",
"score": "0.637122",
"text": "def restart!\n CouchRest.post \"#{@uri}/_restart\"\n end",
"title": ""
},
{
"docid": "042d76f234ad7a1172e90290278aa831",
"score": "0.6347012",
"text": "def restart\n debug \"Call 'restart' for Pacemaker service '#{name}' on node '#{hostname}'\"\n if pacemaker_options[:restart_only_if_local] && (!primitive_is_running? name, hostname)\n Puppet.info \"Pacemaker service '#{name}' is not running on node '#{hostname}'. Skipping restart!\"\n return\n end\n\n begin\n stop\n rescue\n nil\n ensure\n start\n end\n end",
"title": ""
},
{
"docid": "7219daef02ed20be8272898b5242aabd",
"score": "0.63448715",
"text": "def restart\n daemonize_prefoker if @options[:daemonize]\n \n with_each_server do |n|\n stop_server n\n start_server n, app\n sleep 0.1 # Let the OS breath\n end\n \n Process.waitall\n end",
"title": ""
},
{
"docid": "7c7bb4e64ca8e5cddd8bb2e3bb443167",
"score": "0.631724",
"text": "def service_restart(name, start_type=START_TYPE_AUTO, server=nil)\n tried = false\n\n begin\n status = service_start(name, server)\n\n if status == Error::SUCCESS\n vprint_good(\"[#{name}] Service started\")\n return true\n else\n raise status\n end\n rescue RuntimeError => s\n if tried\n vprint_error(\"[#{name}] Unhandled error: #{s}\")\n return false\n else\n tried = true\n end\n\n case s.message.to_i\n when Error::ACCESS_DENIED\n vprint_error(\"[#{name}] Access denied\")\n when Error::INVALID_HANDLE\n vprint_error(\"[#{name}] Invalid handle\")\n when Error::PATH_NOT_FOUND\n vprint_error(\"[#{name}] Service binary could not be found\")\n when Error::SERVICE_ALREADY_RUNNING\n vprint_status(\"[#{name}] Service already running attempting to stop and restart\")\n stopped = service_stop(name, server)\n if ((stopped == Error::SUCCESS) || (stopped == Error::SERVICE_NOT_ACTIVE))\n retry\n else\n vprint_error(\"[#{name}] Service disabled, unable to change start type Error: #{stopped}\")\n end\n when Error::SERVICE_DISABLED\n vprint_status(\"[#{name}] Service disabled attempting to set to manual\")\n if (service_change_config(name, {:starttype => start_type}, server) == Error::SUCCESS)\n retry\n else\n vprint_error(\"[#{name}] Service disabled, unable to change start type\")\n end\n else\n vprint_error(\"[#{name}] Unhandled error: #{s}\")\n return false\n end\n end\n end",
"title": ""
},
{
"docid": "00998276eee115da3844fb0afba62de2",
"score": "0.63115424",
"text": "def restart; end",
"title": ""
},
{
"docid": "7cd82f2fe4bd8bbce34732e056a846e1",
"score": "0.63069624",
"text": "def stop\r\n DRb.stop_service\r\n @log.info(\"Controller stopped on : #{@drb_server_uri}\")\r\n end",
"title": ""
},
{
"docid": "010be943b65eb23179bb9e3ed028f29e",
"score": "0.63024265",
"text": "def restartcmd\n end",
"title": ""
},
{
"docid": "010be943b65eb23179bb9e3ed028f29e",
"score": "0.63024265",
"text": "def restartcmd\n end",
"title": ""
},
{
"docid": "1512c602a2e80fb1f15ef3755315af4f",
"score": "0.6281368",
"text": "def restart\n @context.get(PATH_RESTART)\n end",
"title": ""
},
{
"docid": "a59aaa45cfe79574e8a8eb091062c76e",
"score": "0.624594",
"text": "def restart\n exit_value = 0\n\n stop\n with_each_consumer do |info, consumer_config|\n @server_ctrl.consumer(consumer_config) # start the configured instances\n info = @server_ctrl.run_state(consumer_config)\n puts info # info after changing\n end\n\n exit_value\n end",
"title": ""
},
{
"docid": "04d3651ae6009075d15f97caf4f4afe8",
"score": "0.6202246",
"text": "def restart\n start\n rescue StandardError => err\n if err.message =~ /no acceptor/\n React::Rails::HotLoader.log(\"WS server is already running (#{ws_url})\")\n else\n React::Rails::HotLoader.error(err)\n end\n end",
"title": ""
},
{
"docid": "4d7e416937713405ad3229a67759f2d7",
"score": "0.62014806",
"text": "def restart\n change_resource_state(:power_cycle_soft_switch)\n end",
"title": ""
},
{
"docid": "2c3441131f4c10d9554200d3a19694da",
"score": "0.61998975",
"text": "def restart_app_server\n requires :id\n service.restart_app_server({'EnvironmentId' => id})\n reload\n end",
"title": ""
},
{
"docid": "66cdc32f551c572462f9062e0de59ded",
"score": "0.6167451",
"text": "def restart!\n\t\t\t\t@restarts += 1\n\t\t\tend",
"title": ""
},
{
"docid": "0b495625d805f76266085eb8c3cf620c",
"score": "0.6158971",
"text": "def restart!\n connection.post \"_restart\"\n end",
"title": ""
},
{
"docid": "988d4a77ee85426e1b599b6baa5c5505",
"score": "0.61585885",
"text": "def restart!\n lock\n\n begin\n if config.core_base\n @config.state = \"started\"\n write_config current_deployment_number, @config\n @log.debug \"Restarting core\"\n @starter.restart! config.core_base\n end\n\n announce\n return status\n ensure\n unlock\n end\n end",
"title": ""
},
{
"docid": "caa0ff34c54d76fe403ee828f40649fe",
"score": "0.614766",
"text": "def restart\n status 'Restarting ...'\n\n project.restart!(options[:environment])\n\n status 'Restarted'\n end",
"title": ""
},
{
"docid": "46c42a6170bd3cb37c8d69cb10acce3f",
"score": "0.61398536",
"text": "def start\n\t\t\t\t@services.start\n\t\t\t\t\n\t\t\t\tsuper\n\t\t\tend",
"title": ""
},
{
"docid": "73294fa480da08364f7b919eb6784156",
"score": "0.6132345",
"text": "def restart\n stop if running?\n start_event_loop\n end",
"title": ""
},
{
"docid": "fb4a0de61ea834683b006c7653ee4dc7",
"score": "0.6127767",
"text": "def reload\n info \"Restarting Foreman...\"\n stop\n start\n end",
"title": ""
},
{
"docid": "e2a7b6da1697423b3023065d38c9f689",
"score": "0.611916",
"text": "def restart()\n stop(\"TACACS+ server restart requested.\") if (@listener.alive?)\n start_server\n return(nil)\n end",
"title": ""
},
{
"docid": "10e1373335135a6406620cc74467a664",
"score": "0.6118981",
"text": "def restart\n raise Restart.new \"restart initiated by #{self.class.name}:#{object_id}\"\n end",
"title": ""
},
{
"docid": "72139a88eb2223652b2008771ce8b85f",
"score": "0.61177033",
"text": "def restart\n (old_services.keys & new_services.keys).select do |s|\n old_services[s] != new_services[s] && new_services[s].on_change == :restart\n end.map { |s| new_services[s] }\n end",
"title": ""
},
{
"docid": "72139a88eb2223652b2008771ce8b85f",
"score": "0.61177033",
"text": "def restart\n (old_services.keys & new_services.keys).select do |s|\n old_services[s] != new_services[s] && new_services[s].on_change == :restart\n end.map { |s| new_services[s] }\n end",
"title": ""
},
{
"docid": "139ebb76a993a237a49beb00bd716241",
"score": "0.61113745",
"text": "def changeService1(service)\n service = deep_copy(service)\n if Ops.less_than(Ops.get_integer(service, \"started\", -1), 0)\n outfile = Builtins.sformat(\n \"'%1/runlevel_out_%2'\",\n SCR.Read(path(\".target.tmpdir\")),\n String.Quote(@current_service)\n )\n\n started = Service.RunInitScriptWithTimeOut(\n @current_service,\n Ops.add(\"status\", Builtins.sformat(\" 2>&1 1>%1\", outfile))\n )\n\n Ops.set(service, \"started\", started)\n Ops.set(RunlevelEd.services, @current_service, service)\n updateStatusColumn(@current_service, started)\n end\n updateRlCheckBoxes(service)\n updateDescription(service)\n\n nil\n end",
"title": ""
},
{
"docid": "3b5c9d7e2cac520005e352e6f46e4cf9",
"score": "0.61109036",
"text": "def action_start\n notify_if_service do\n service_resource.run_action(:start)\n end\n end",
"title": ""
},
{
"docid": "098e3c48cb4c4ee9c581ce632e383cc6",
"score": "0.6109865",
"text": "def init_command\n restart_winrm_service if config[:restart_winrm]\n end",
"title": ""
},
{
"docid": "098e3c48cb4c4ee9c581ce632e383cc6",
"score": "0.6109865",
"text": "def init_command\n restart_winrm_service if config[:restart_winrm]\n end",
"title": ""
},
{
"docid": "6e6e0ed3e7c774162ea06303a59b65d1",
"score": "0.6109147",
"text": "def _run_restarted(maestro, status, _hParams)\n return false unless status.status == :restarted\n\n if maestro[:status] == :error\n PrcLib.fatal(1, 'Server tried to be rebuilt but failed again.')\n end\n status.is :cloud_init\n true\n end",
"title": ""
},
{
"docid": "e4e8aca60b21e4cf83649cf941b613a6",
"score": "0.6097601",
"text": "def reload_or_start(service)\n status = capture(\"sudo systemctl is-active #{service}\",\n raise_on_non_zero_exit: false)\n if status.start_with?('active')\n execute \"sudo systemctl reload #{service}\"\n else\n execute \"sudo systemctl restart #{service}\"\n end\nend",
"title": ""
},
{
"docid": "fcb90ce9801a57f2f43a57ae0182c7bc",
"score": "0.6095988",
"text": "def restart\n Cheese::Verbose.log_task \"Restart nginx server\" do\n %x{ /etc/init.d/nginx restart }\n end\n end",
"title": ""
}
] |
9e25d4440ab1999386d911d16791a823
|
The deserialization information for the current model
|
[
{
"docid": "8baa7b8a2a6a9935026530e3fd8e5ed9",
"score": "0.0",
"text": "def get_field_deserializers()\n return super.merge({\n \"daysWithoutContactBeforeUnenroll\" => lambda {|n| @days_without_contact_before_unenroll = n.get_number_value() },\n \"mdmEnrollmentUrl\" => lambda {|n| @mdm_enrollment_url = n.get_string_value() },\n \"minutesOfInactivityBeforeDeviceLock\" => lambda {|n| @minutes_of_inactivity_before_device_lock = n.get_number_value() },\n \"numberOfPastPinsRemembered\" => lambda {|n| @number_of_past_pins_remembered = n.get_number_value() },\n \"passwordMaximumAttemptCount\" => lambda {|n| @password_maximum_attempt_count = n.get_number_value() },\n \"pinExpirationDays\" => lambda {|n| @pin_expiration_days = n.get_number_value() },\n \"pinLowercaseLetters\" => lambda {|n| @pin_lowercase_letters = n.get_enum_value(MicrosoftGraph::Models::WindowsInformationProtectionPinCharacterRequirements) },\n \"pinMinimumLength\" => lambda {|n| @pin_minimum_length = n.get_number_value() },\n \"pinSpecialCharacters\" => lambda {|n| @pin_special_characters = n.get_enum_value(MicrosoftGraph::Models::WindowsInformationProtectionPinCharacterRequirements) },\n \"pinUppercaseLetters\" => lambda {|n| @pin_uppercase_letters = n.get_enum_value(MicrosoftGraph::Models::WindowsInformationProtectionPinCharacterRequirements) },\n \"revokeOnMdmHandoffDisabled\" => lambda {|n| @revoke_on_mdm_handoff_disabled = n.get_boolean_value() },\n \"windowsHelloForBusinessBlocked\" => lambda {|n| @windows_hello_for_business_blocked = n.get_boolean_value() },\n })\n end",
"title": ""
}
] |
[
{
"docid": "613f62eeb3655523fae5d548dc6e7875",
"score": "0.6580273",
"text": "def get_field_deserializers()\n return {\n \"downloadUrl\" => lambda {|n| @download_url = n.get_string_value() },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n }\n end",
"title": ""
},
{
"docid": "95802edbcc2f191f24bd1839f6286d62",
"score": "0.65657324",
"text": "def parse\n deserialize super\n end",
"title": ""
},
{
"docid": "95802edbcc2f191f24bd1839f6286d62",
"score": "0.65657324",
"text": "def parse\n deserialize super\n end",
"title": ""
},
{
"docid": "6a7725411bd737fd8dade9f612b6a78b",
"score": "0.65432274",
"text": "def load_model_info\n JSON.parse(RestClient.get(model_info_url))\n end",
"title": ""
},
{
"docid": "272e83046903fac7f2c627b3d129e22e",
"score": "0.6510958",
"text": "def get_field_deserializers()\n return {\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"fileSize\" => lambda {|n| @file_size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"fileSystemInfo\" => lambda {|n| @file_system_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::FileSystemInfo.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "116bc48a2ab5ffc41583d853ae5fc6a3",
"score": "0.6461195",
"text": "def serialized_attributes\n Serializer.new(self).serialize\n end",
"title": ""
},
{
"docid": "755d9c34380693800eb9f90b59933fa8",
"score": "0.63024974",
"text": "def deserialize_json_attributes\n json_fields.values.each{|field| field.deserialize} if @json_fields\n end",
"title": ""
},
{
"docid": "d7dc2152d86fbb172dfa3c18dce93690",
"score": "0.6297452",
"text": "def get_field_deserializers()\n return super.merge({\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"contentType\" => lambda {|n| @content_type = n.get_string_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"size\" => lambda {|n| @size = n.get_number_value() },\n })\n end",
"title": ""
},
{
"docid": "78e17defcc9f85a758ec2e34a6229774",
"score": "0.62954384",
"text": "def get_field_deserializers()\n return super.merge({\n \"committedContentVersion\" => lambda {|n| @committed_content_version = n.get_string_value() },\n \"contentVersions\" => lambda {|n| @content_versions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MobileAppContent.create_from_discriminator_value(pn) }) },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "60e05327ce7e07f239e7fe43634d2191",
"score": "0.6293884",
"text": "def get_field_deserializers()\n return {\n \"category\" => lambda {|n| @category = n.get_string_value() },\n \"family\" => lambda {|n| @family = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"severity\" => lambda {|n| @severity = n.get_string_value() },\n \"wasRunning\" => lambda {|n| @was_running = n.get_boolean_value() },\n }\n end",
"title": ""
},
{
"docid": "5730b4d4d4aa237b0fcba7a39b7dbc89",
"score": "0.6291495",
"text": "def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"fileData\" => lambda {|n| @file_data = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AgreementFileData.create_from_discriminator_value(pn) }) },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n \"isDefault\" => lambda {|n| @is_default = n.get_boolean_value() },\n \"isMajorVersion\" => lambda {|n| @is_major_version = n.get_boolean_value() },\n \"language\" => lambda {|n| @language = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "c0b098a71d1185a917fd6635ee86f3ab",
"score": "0.628632",
"text": "def get_field_deserializers()\n return super.merge({\n \"info\" => lambda {|n| @info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ParticipantInfo.create_from_discriminator_value(pn) }) },\n \"isInLobby\" => lambda {|n| @is_in_lobby = n.get_boolean_value() },\n \"isMuted\" => lambda {|n| @is_muted = n.get_boolean_value() },\n \"mediaStreams\" => lambda {|n| @media_streams = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MediaStream.create_from_discriminator_value(pn) }) },\n \"metadata\" => lambda {|n| @metadata = n.get_string_value() },\n \"recordingInfo\" => lambda {|n| @recording_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::RecordingInfo.create_from_discriminator_value(pn) }) },\n \"restrictedExperience\" => lambda {|n| @restricted_experience = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::OnlineMeetingRestricted.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "065f5e0ee6e88cbde55cb758a893f250",
"score": "0.6281143",
"text": "def get_field_deserializers()\n return {\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n \"filePath\" => lambda {|n| @file_path = n.get_string_value() },\n \"filePublisher\" => lambda {|n| @file_publisher = n.get_string_value() },\n \"fileSize\" => lambda {|n| @file_size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"issuer\" => lambda {|n| @issuer = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"sha1\" => lambda {|n| @sha1 = n.get_string_value() },\n \"sha256\" => lambda {|n| @sha256 = n.get_string_value() },\n \"signer\" => lambda {|n| @signer = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "d506ad5798ce8ae5e217d5fedccd17af",
"score": "0.62796885",
"text": "def get_field_deserializers()\n return {\n \"accountName\" => lambda {|n| @account_name = n.get_string_value() },\n \"commandLine\" => lambda {|n| @command_line = n.get_string_value() },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"fileHash\" => lambda {|n| @file_hash = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::FileHash.create_from_discriminator_value(pn) }) },\n \"integrityLevel\" => lambda {|n| @integrity_level = n.get_enum_value(MicrosoftGraph::Models::ProcessIntegrityLevel) },\n \"isElevated\" => lambda {|n| @is_elevated = n.get_boolean_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"parentProcessCreatedDateTime\" => lambda {|n| @parent_process_created_date_time = n.get_date_time_value() },\n \"parentProcessId\" => lambda {|n| @parent_process_id = n.get_number_value() },\n \"parentProcessName\" => lambda {|n| @parent_process_name = n.get_string_value() },\n \"path\" => lambda {|n| @path = n.get_string_value() },\n \"processId\" => lambda {|n| @process_id = n.get_number_value() },\n }\n end",
"title": ""
},
{
"docid": "09dce3c912e36ccebc8b254823c59a3b",
"score": "0.626656",
"text": "def get_field_deserializers()\n return super.merge({\n \"detectionCount\" => lambda {|n| @detection_count = n.get_number_value() },\n \"deviceName\" => lambda {|n| @device_name = n.get_string_value() },\n \"executionState\" => lambda {|n| @execution_state = n.get_enum_value(MicrosoftGraph::Models::WindowsMalwareExecutionState) },\n \"initialDetectionDateTime\" => lambda {|n| @initial_detection_date_time = n.get_date_time_value() },\n \"lastStateChangeDateTime\" => lambda {|n| @last_state_change_date_time = n.get_date_time_value() },\n \"threatState\" => lambda {|n| @threat_state = n.get_enum_value(MicrosoftGraph::Models::WindowsMalwareThreatState) },\n })\n end",
"title": ""
},
{
"docid": "8b69f87b7d6a965dbc6918717e0c5882",
"score": "0.6238251",
"text": "def get_field_deserializers()\n return super.merge({\n \"aaGuid\" => lambda {|n| @aa_guid = n.get_string_value() },\n \"attestationCertificates\" => lambda {|n| @attestation_certificates = n.get_collection_of_primitive_values(String) },\n \"attestationLevel\" => lambda {|n| @attestation_level = n.get_enum_value(MicrosoftGraph::Models::AttestationLevel) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"model\" => lambda {|n| @model = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "371e9a150c084e7aa65b83738f2dbd17",
"score": "0.62320113",
"text": "def get_field_deserializers()\n return {\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"height\" => lambda {|n| @height = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"sourceItemId\" => lambda {|n| @source_item_id = n.get_string_value() },\n \"url\" => lambda {|n| @url = n.get_string_value() },\n \"width\" => lambda {|n| @width = n.get_number_value() },\n }\n end",
"title": ""
},
{
"docid": "1a4fda9405f24be12ec8f5444ab82a9f",
"score": "0.62130165",
"text": "def get_field_deserializers()\n return {\n \"cameraMake\" => lambda {|n| @camera_make = n.get_string_value() },\n \"cameraModel\" => lambda {|n| @camera_model = n.get_string_value() },\n \"exposureDenominator\" => lambda {|n| @exposure_denominator = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"exposureNumerator\" => lambda {|n| @exposure_numerator = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"fNumber\" => lambda {|n| @f_number = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"focalLength\" => lambda {|n| @focal_length = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"iso\" => lambda {|n| @iso = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"orientation\" => lambda {|n| @orientation = n.get_number_value() },\n \"takenDateTime\" => lambda {|n| @taken_date_time = n.get_date_time_value() },\n }\n end",
"title": ""
},
{
"docid": "d7daa22fb5c2098aa8db3a10642b075a",
"score": "0.61990625",
"text": "def get_field_deserializers()\n return super.merge({\n \"lastUsed\" => lambda {|n| @last_used = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::UsageDetails.create_from_discriminator_value(pn) }) },\n \"resource\" => lambda {|n| @resource = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Entity.create_from_discriminator_value(pn) }) },\n \"resourceReference\" => lambda {|n| @resource_reference = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResourceReference.create_from_discriminator_value(pn) }) },\n \"resourceVisualization\" => lambda {|n| @resource_visualization = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ResourceVisualization.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "90bb30cfaee9c6811f230ee43021fbd6",
"score": "0.61944664",
"text": "def get_field_deserializers()\n return {\n \"contentType\" => lambda {|n| @content_type = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ContentTypeInfo.create_from_discriminator_value(pn) }) },\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n \"folderName\" => lambda {|n| @folder_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "b53320b515b463594e01845ff608d658",
"score": "0.6192342",
"text": "def get_field_deserializers()\n return {\n \"level\" => lambda {|n| @level = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"versionId\" => lambda {|n| @version_id = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "67d85f823439f90165701bd0f51f5a8e",
"score": "0.61874664",
"text": "def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"packageType\" => lambda {|n| @package_type = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppMsiPackageType) },\n \"productCode\" => lambda {|n| @product_code = n.get_string_value() },\n \"productName\" => lambda {|n| @product_name = n.get_string_value() },\n \"productVersion\" => lambda {|n| @product_version = n.get_string_value() },\n \"publisher\" => lambda {|n| @publisher = n.get_string_value() },\n \"requiresReboot\" => lambda {|n| @requires_reboot = n.get_boolean_value() },\n \"upgradeCode\" => lambda {|n| @upgrade_code = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "c515e023093d3e53ba191863e11adc13",
"score": "0.616086",
"text": "def get_field_deserializers()\n return {\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"latestTrainingStatus\" => lambda {|n| @latest_training_status = n.get_enum_value(MicrosoftGraph::Models::TrainingStatus) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"trainingAssignedProperties\" => lambda {|n| @training_assigned_properties = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::UserTrainingContentEventInfo.create_from_discriminator_value(pn) }) },\n \"trainingCompletedProperties\" => lambda {|n| @training_completed_properties = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::UserTrainingContentEventInfo.create_from_discriminator_value(pn) }) },\n \"trainingUpdatedProperties\" => lambda {|n| @training_updated_properties = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::UserTrainingContentEventInfo.create_from_discriminator_value(pn) }) },\n }\n end",
"title": ""
},
{
"docid": "000352fb4044cc26abc42977d6d8f2de",
"score": "0.61578184",
"text": "def known_serializers\n known.values\n end",
"title": ""
},
{
"docid": "419d5bd623555f64714e61c45cbf8527",
"score": "0.6155715",
"text": "def get_field_deserializers()\n return super.merge({\n \"assetTagTemplate\" => lambda {|n| @asset_tag_template = n.get_string_value() },\n \"homeScreenDockIcons\" => lambda {|n| @home_screen_dock_icons = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::IosHomeScreenItem.create_from_discriminator_value(pn) }) },\n \"homeScreenPages\" => lambda {|n| @home_screen_pages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::IosHomeScreenPage.create_from_discriminator_value(pn) }) },\n \"lockScreenFootnote\" => lambda {|n| @lock_screen_footnote = n.get_string_value() },\n \"notificationSettings\" => lambda {|n| @notification_settings = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::IosNotificationSettings.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "50160ab954080ace6f5d00eb6215db0a",
"score": "0.61538315",
"text": "def get_field_deserializers()\n return super.merge({\n \"applicationId\" => lambda {|n| @application_id = n.get_guid_value() },\n \"default\" => lambda {|n| @default = n.get_boolean_value() },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"discoverable\" => lambda {|n| @discoverable = n.get_boolean_value() },\n \"factoryTag\" => lambda {|n| @factory_tag = n.get_string_value() },\n \"metadata\" => lambda {|n| @metadata = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SynchronizationMetadataEntry.create_from_discriminator_value(pn) }) },\n \"schema\" => lambda {|n| @schema = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SynchronizationSchema.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "5c29b9808048f2151226bc6fddfb2f1e",
"score": "0.6147291",
"text": "def get_field_deserializers()\n return super.merge({\n \"minimumSupportedOperatingSystem\" => lambda {|n| @minimum_supported_operating_system = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AndroidMinimumOperatingSystem.create_from_discriminator_value(pn) }) },\n \"packageId\" => lambda {|n| @package_id = n.get_string_value() },\n \"versionCode\" => lambda {|n| @version_code = n.get_string_value() },\n \"versionName\" => lambda {|n| @version_name = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "7107e7c5e1ffa54535b801dc280c1ba3",
"score": "0.6143404",
"text": "def get_field_deserializers()\n return super.merge({\n \"comment\" => lambda {|n| @comment = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"scope\" => lambda {|n| @scope = n.get_string_value() },\n \"type\" => lambda {|n| @type = n.get_string_value() },\n \"value\" => lambda {|n| @value = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"visible\" => lambda {|n| @visible = n.get_boolean_value() },\n \"worksheet\" => lambda {|n| @worksheet = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WorkbookWorksheet.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "0ec6fe4813b191bee6bf7473768f608b",
"score": "0.6142892",
"text": "def get_field_deserializers()\n return super.merge({\n \"contentType\" => lambda {|n| @content_type = n.get_string_value() },\n \"isInline\" => lambda {|n| @is_inline = n.get_boolean_value() },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"size\" => lambda {|n| @size = n.get_number_value() },\n })\n end",
"title": ""
},
{
"docid": "2f2544e932e720faeaab35fc927134f8",
"score": "0.6119172",
"text": "def get_field_deserializers()\n return {\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"lastAccessedTime\" => lambda {|n| @last_accessed_time = n.get_date_time_value() },\n \"links\" => lambda {|n| @links = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::RecentNotebookLinks.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"sourceService\" => lambda {|n| @source_service = n.get_enum_value(MicrosoftGraph::Models::OnenoteSourceService) },\n }\n end",
"title": ""
},
{
"docid": "1c4a3d334e703e85f59bd17f925ea808",
"score": "0.61167276",
"text": "def get_field_deserializers()\n return {\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"sequenceId\" => lambda {|n| @sequence_id = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"tone\" => lambda {|n| @tone = n.get_enum_value(MicrosoftGraph::Models::Tone) },\n }\n end",
"title": ""
},
{
"docid": "3df80d231a5e7caf30844c17e73f1621",
"score": "0.61073446",
"text": "def serializers; end",
"title": ""
},
{
"docid": "f317a77d44174988ef8394b65ac29101",
"score": "0.61063015",
"text": "def get_field_deserializers()\n return {\n \"altitude\" => lambda {|n| @altitude = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"heading\" => lambda {|n| @heading = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"horizontalAccuracy\" => lambda {|n| @horizontal_accuracy = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"lastCollectedDateTime\" => lambda {|n| @last_collected_date_time = n.get_date_time_value() },\n \"latitude\" => lambda {|n| @latitude = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"longitude\" => lambda {|n| @longitude = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"speed\" => lambda {|n| @speed = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"verticalAccuracy\" => lambda {|n| @vertical_accuracy = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n }\n end",
"title": ""
},
{
"docid": "21c95714f462b330c2f4b0c125e94141",
"score": "0.61043894",
"text": "def get_field_deserializers()\n return super.merge({\n \"isAnswerEditable\" => lambda {|n| @is_answer_editable = n.get_boolean_value() },\n \"isRequired\" => lambda {|n| @is_required = n.get_boolean_value() },\n \"localizations\" => lambda {|n| @localizations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AccessPackageLocalizedText.create_from_discriminator_value(pn) }) },\n \"sequence\" => lambda {|n| @sequence = n.get_number_value() },\n \"text\" => lambda {|n| @text = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "6920798e323a98b37ab0bc4b6c753139",
"score": "0.61035234",
"text": "def get_field_deserializers()\n return super.merge({\n \"buildNumber\" => lambda {|n| @build_number = n.get_string_value() },\n \"bundleId\" => lambda {|n| @bundle_id = n.get_string_value() },\n \"childApps\" => lambda {|n| @child_apps = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MacOSLobChildApp.create_from_discriminator_value(pn) }) },\n \"ignoreVersionDetection\" => lambda {|n| @ignore_version_detection = n.get_boolean_value() },\n \"installAsManaged\" => lambda {|n| @install_as_managed = n.get_boolean_value() },\n \"md5Hash\" => lambda {|n| @md5_hash = n.get_collection_of_primitive_values(String) },\n \"md5HashChunkSize\" => lambda {|n| @md5_hash_chunk_size = n.get_number_value() },\n \"minimumSupportedOperatingSystem\" => lambda {|n| @minimum_supported_operating_system = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MacOSMinimumOperatingSystem.create_from_discriminator_value(pn) }) },\n \"versionNumber\" => lambda {|n| @version_number = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "d6b6593073d13311ba0e9863d3b2d85d",
"score": "0.61028",
"text": "def get_field_deserializers()\n return {\n \"createdBy\" => lambda {|n| @created_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"file\" => lambda {|n| @file = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::File.create_from_discriminator_value(pn) }) },\n \"fileSystemInfo\" => lambda {|n| @file_system_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::FileSystemInfo.create_from_discriminator_value(pn) }) },\n \"folder\" => lambda {|n| @folder = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Folder.create_from_discriminator_value(pn) }) },\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"image\" => lambda {|n| @image = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Image.create_from_discriminator_value(pn) }) },\n \"lastModifiedBy\" => lambda {|n| @last_modified_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"lastModifiedDateTime\" => lambda {|n| @last_modified_date_time = n.get_date_time_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"package\" => lambda {|n| @package = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Package.create_from_discriminator_value(pn) }) },\n \"parentReference\" => lambda {|n| @parent_reference = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemReference.create_from_discriminator_value(pn) }) },\n \"shared\" => lambda {|n| @shared = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Shared.create_from_discriminator_value(pn) }) },\n \"sharepointIds\" => lambda {|n| @sharepoint_ids = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SharepointIds.create_from_discriminator_value(pn) }) },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"specialFolder\" => lambda {|n| @special_folder = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SpecialFolder.create_from_discriminator_value(pn) }) },\n \"video\" => lambda {|n| @video = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Video.create_from_discriminator_value(pn) }) },\n \"webDavUrl\" => lambda {|n| @web_dav_url = n.get_string_value() },\n \"webUrl\" => lambda {|n| @web_url = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "37f7aba89711a5ae09f0708a1e3d833c",
"score": "0.6100393",
"text": "def deserialize_error?; end",
"title": ""
},
{
"docid": "8b62657cb9ca295b9c5a255aa1285bbd",
"score": "0.6099355",
"text": "def get_field_deserializers()\n return {\n \"data\" => lambda {|n| @data = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "2acb0924bcf6af7ba3eac5776ff57e89",
"score": "0.60921586",
"text": "def attributes\n data.attributes\n end",
"title": ""
},
{
"docid": "2bbca7b3ea1196f773bf05c36d00c84d",
"score": "0.60849917",
"text": "def get_field_deserializers()\n return super.merge({\n \"fileName\" => lambda {|n| @file_name = n.get_string_value() },\n \"value\" => lambda {|n| @value = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "93ed77fea6aeadd2da2fe147d8d523c6",
"score": "0.60761654",
"text": "def get_field_deserializers()\n return {\n \"courseNumber\" => lambda {|n| @course_number = n.get_string_value() },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "f7a6100c77b87b004be54dacd73cd607",
"score": "0.6067261",
"text": "def get_field_deserializers()\n return {\n \"album\" => lambda {|n| @album = n.get_string_value() },\n \"albumArtist\" => lambda {|n| @album_artist = n.get_string_value() },\n \"artist\" => lambda {|n| @artist = n.get_string_value() },\n \"bitrate\" => lambda {|n| @bitrate = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"composers\" => lambda {|n| @composers = n.get_string_value() },\n \"copyright\" => lambda {|n| @copyright = n.get_string_value() },\n \"disc\" => lambda {|n| @disc = n.get_number_value() },\n \"discCount\" => lambda {|n| @disc_count = n.get_number_value() },\n \"duration\" => lambda {|n| @duration = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"genre\" => lambda {|n| @genre = n.get_string_value() },\n \"hasDrm\" => lambda {|n| @has_drm = n.get_boolean_value() },\n \"isVariableBitrate\" => lambda {|n| @is_variable_bitrate = n.get_boolean_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"title\" => lambda {|n| @title = n.get_string_value() },\n \"track\" => lambda {|n| @track = n.get_number_value() },\n \"trackCount\" => lambda {|n| @track_count = n.get_number_value() },\n \"year\" => lambda {|n| @year = n.get_number_value() },\n }\n end",
"title": ""
},
{
"docid": "489a90b50a9696cc34f74f823663a41b",
"score": "0.6061633",
"text": "def get_field_deserializers()\n return super.merge({\n \"appAvailability\" => lambda {|n| @app_availability = n.get_enum_value(MicrosoftGraph::Models::ManagedAppAvailability) },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "ec8f1806a482636c38dabd07c6825ba7",
"score": "0.60609376",
"text": "def get_field_deserializers()\n return super.merge({\n \"nameTarget\" => lambda {|n| @name_target = n.get_string_value() },\n \"port\" => lambda {|n| @port = n.get_number_value() },\n \"priority\" => lambda {|n| @priority = n.get_number_value() },\n \"protocol\" => lambda {|n| @protocol = n.get_string_value() },\n \"service\" => lambda {|n| @service = n.get_string_value() },\n \"weight\" => lambda {|n| @weight = n.get_number_value() },\n })\n end",
"title": ""
},
{
"docid": "03a7a30f1c3a5683db6487f26f2c16a7",
"score": "0.606081",
"text": "def get_field_deserializers()\n return super.merge({\n \"contentBytes\" => lambda {|n| @content_bytes = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"contentId\" => lambda {|n| @content_id = n.get_string_value() },\n \"contentLocation\" => lambda {|n| @content_location = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "d5a5be82067c31c0cbf98f27b6321db1",
"score": "0.60607314",
"text": "def serializable_attributes # :nodoc:\n read_inheritable_attribute(\"serializable_attributes\")\n end",
"title": ""
},
{
"docid": "34462173b93af26d9e7b42a85cb03557",
"score": "0.60586154",
"text": "def get_field_deserializers()\n return super.merge({\n \"azureStorageUri\" => lambda {|n| @azure_storage_uri = n.get_string_value() },\n \"azureStorageUriExpirationDateTime\" => lambda {|n| @azure_storage_uri_expiration_date_time = n.get_date_time_value() },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"isCommitted\" => lambda {|n| @is_committed = n.get_boolean_value() },\n \"manifest\" => lambda {|n| @manifest = n.get_object_value(lambda {|pn| Base64url.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"sizeEncrypted\" => lambda {|n| @size_encrypted = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"uploadState\" => lambda {|n| @upload_state = n.get_enum_value(MicrosoftGraph::Models::MobileAppContentFileUploadState) },\n })\n end",
"title": ""
},
{
"docid": "1686ed2948a226782c295a6502df44ec",
"score": "0.6057047",
"text": "def get_field_deserializers()\n return {\n \"iNum\" => lambda {|n| @i_num = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"realNum\" => lambda {|n| @real_num = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n \"suffix\" => lambda {|n| @suffix = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Json.create_from_discriminator_value(pn) }) },\n }\n end",
"title": ""
},
{
"docid": "61260c8e8405709816cf6a1fb432fd7c",
"score": "0.6056979",
"text": "def get_field_deserializers()\n return {\n \"altitude\" => lambda {|n| @altitude = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"latitude\" => lambda {|n| @latitude = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"longitude\" => lambda {|n| @longitude = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "5a8477d3c002dcb359fcb4cdbbf6e676",
"score": "0.60565025",
"text": "def get_field_deserializers()\n return super.merge({\n \"bold\" => lambda {|n| @bold = n.get_boolean_value() },\n \"color\" => lambda {|n| @color = n.get_string_value() },\n \"italic\" => lambda {|n| @italic = n.get_boolean_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"size\" => lambda {|n| @size = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"underline\" => lambda {|n| @underline = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "e306da8b75e75c3810d6aad2a001dd6a",
"score": "0.60550934",
"text": "def get_field_deserializers()\n return {\n \"assignedDateTime\" => lambda {|n| @assigned_date_time = n.get_date_time_value() },\n \"completionDateTime\" => lambda {|n| @completion_date_time = n.get_date_time_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"trainingStatus\" => lambda {|n| @training_status = n.get_enum_value(MicrosoftGraph::Models::TrainingStatus) },\n }\n end",
"title": ""
},
{
"docid": "587dc10be49c75103a213c59308ff772",
"score": "0.60532653",
"text": "def get_field_deserializers()\n return {\n \"deviceCount\" => lambda {|n| @device_count = n.get_number_value() },\n \"lastUpdateDateTime\" => lambda {|n| @last_update_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"osVersion\" => lambda {|n| @os_version = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "bc161085e455ba6bb5ef925635cabf5d",
"score": "0.60520786",
"text": "def get_field_deserializers()\n return {\n \"classification\" => lambda {|n| @classification = n.get_string_value() },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"mailNickname\" => lambda {|n| @mail_nickname = n.get_string_value() },\n \"partsToClone\" => lambda {|n| @parts_to_clone = n.get_enum_value(MicrosoftGraph::Models::ClonableTeamParts) },\n \"visibility\" => lambda {|n| @visibility = n.get_enum_value(MicrosoftGraph::Models::TeamVisibilityType) },\n }\n end",
"title": ""
},
{
"docid": "11b1ae066abd122e5de9b250107ad26d",
"score": "0.60507023",
"text": "def deserialize(serialized_object); end",
"title": ""
},
{
"docid": "7a0d8640fe58fa700c24f20360428b3c",
"score": "0.60440755",
"text": "def get_field_deserializers()\n return super.merge({\n \"isDefault\" => lambda {|n| @is_default = n.get_boolean_value() },\n \"isShared\" => lambda {|n| @is_shared = n.get_boolean_value() },\n \"links\" => lambda {|n| @links = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::NotebookLinks.create_from_discriminator_value(pn) }) },\n \"sectionGroups\" => lambda {|n| @section_groups = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SectionGroup.create_from_discriminator_value(pn) }) },\n \"sectionGroupsUrl\" => lambda {|n| @section_groups_url = n.get_string_value() },\n \"sections\" => lambda {|n| @sections = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnenoteSection.create_from_discriminator_value(pn) }) },\n \"sectionsUrl\" => lambda {|n| @sections_url = n.get_string_value() },\n \"userRole\" => lambda {|n| @user_role = n.get_enum_value(MicrosoftGraph::Models::OnenoteUserRole) },\n })\n end",
"title": ""
},
{
"docid": "67620624c420f56c0f2b0b45c1c2e787",
"score": "0.6040798",
"text": "def get_field_deserializers()\n return super.merge({\n \"binaryName\" => lambda {|n| @binary_name = n.get_string_value() },\n \"binaryVersionHigh\" => lambda {|n| @binary_version_high = n.get_string_value() },\n \"binaryVersionLow\" => lambda {|n| @binary_version_low = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "81abfa6af04e0393806cba70c3126656",
"score": "0.60393685",
"text": "def get_field_deserializers()\n return super.merge({\n \"error\" => lambda {|n| @error = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::OnenoteOperationError.create_from_discriminator_value(pn) }) },\n \"percentComplete\" => lambda {|n| @percent_complete = n.get_string_value() },\n \"resourceId\" => lambda {|n| @resource_id = n.get_string_value() },\n \"resourceLocation\" => lambda {|n| @resource_location = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "9a9a071f6b06733e01eb9abdc6aa15ac",
"score": "0.60389745",
"text": "def serialized_attributes\n serializer_class.new(self).as_json\n end",
"title": ""
},
{
"docid": "296926876129f711c7b2a79fedd52673",
"score": "0.6035677",
"text": "def get_field_deserializers()\n return super.merge({\n \"appStoreUrl\" => lambda {|n| @app_store_url = n.get_string_value() },\n \"applicableDeviceType\" => lambda {|n| @applicable_device_type = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IosDeviceType.create_from_discriminator_value(pn) }) },\n \"bundleId\" => lambda {|n| @bundle_id = n.get_string_value() },\n \"licensingType\" => lambda {|n| @licensing_type = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::VppLicensingType.create_from_discriminator_value(pn) }) },\n \"releaseDateTime\" => lambda {|n| @release_date_time = n.get_date_time_value() },\n \"totalLicenseCount\" => lambda {|n| @total_license_count = n.get_number_value() },\n \"usedLicenseCount\" => lambda {|n| @used_license_count = n.get_number_value() },\n \"vppTokenAccountType\" => lambda {|n| @vpp_token_account_type = n.get_enum_value(MicrosoftGraph::Models::VppTokenAccountType) },\n \"vppTokenAppleId\" => lambda {|n| @vpp_token_apple_id = n.get_string_value() },\n \"vppTokenOrganizationName\" => lambda {|n| @vpp_token_organization_name = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "9e6b887c20ecfb38626998d9261acf16",
"score": "0.60302603",
"text": "def get_field_deserializers()\n return {\n \"ascending\" => lambda {|n| @ascending = n.get_boolean_value() },\n \"color\" => lambda {|n| @color = n.get_string_value() },\n \"dataOption\" => lambda {|n| @data_option = n.get_string_value() },\n \"icon\" => lambda {|n| @icon = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::WorkbookIcon.create_from_discriminator_value(pn) }) },\n \"key\" => lambda {|n| @key = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"sortOn\" => lambda {|n| @sort_on = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "7045f829b3bfbbbef912137f4901c390",
"score": "0.6029616",
"text": "def get_field_deserializers()\n return super.merge({\n \"author\" => lambda {|n| @author = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Identity.create_from_discriminator_value(pn) }) },\n \"content\" => lambda {|n| @content = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ItemBody.create_from_discriminator_value(pn) }) },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n })\n end",
"title": ""
},
{
"docid": "af54d3f09cf9e31f3d478947a7bb4acb",
"score": "0.6028731",
"text": "def get_field_deserializers()\n return super.merge({\n \"applicableDeviceType\" => lambda {|n| @applicable_device_type = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IosDeviceType.create_from_discriminator_value(pn) }) },\n \"buildNumber\" => lambda {|n| @build_number = n.get_string_value() },\n \"bundleId\" => lambda {|n| @bundle_id = n.get_string_value() },\n \"expirationDateTime\" => lambda {|n| @expiration_date_time = n.get_date_time_value() },\n \"minimumSupportedOperatingSystem\" => lambda {|n| @minimum_supported_operating_system = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IosMinimumOperatingSystem.create_from_discriminator_value(pn) }) },\n \"versionNumber\" => lambda {|n| @version_number = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "9804682d64b8cb5b545d75ee64dc609b",
"score": "0.6021203",
"text": "def get_field_deserializers()\n return {\n \"certificateUpdateResult\" => lambda {|n| @certificate_update_result = n.get_string_value() },\n \"lastRunDateTime\" => lambda {|n| @last_run_date_time = n.get_date_time_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "10eb4eab1f8d67351552bb27d783ad4e",
"score": "0.6017687",
"text": "def get_field_deserializers()\n return {\n \"additionalProperties\" => lambda {|n| @additional_properties = n.get_collection_of_primitive_values(String) },\n \"essential\" => lambda {|n| @essential = n.get_boolean_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"source\" => lambda {|n| @source = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "563ccabbf14d88f93b511ce39c3fd605",
"score": "0.60160464",
"text": "def attributes\n self.class.serializable_attributes.inject({}) do |h,field|\n value=self.send(field)\n h[field]=value if value\n h\n end\n end",
"title": ""
},
{
"docid": "48ac399e3768deb8a0332ddb6db21a89",
"score": "0.60153174",
"text": "def get_field_deserializers()\n return super.merge({\n \"activityDateTime\" => lambda {|n| @activity_date_time = n.get_date_time_value() },\n \"activityDisplayName\" => lambda {|n| @activity_display_name = n.get_string_value() },\n \"additionalDetails\" => lambda {|n| @additional_details = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::KeyValue.create_from_discriminator_value(pn) }) },\n \"category\" => lambda {|n| @category = n.get_string_value() },\n \"correlationId\" => lambda {|n| @correlation_id = n.get_string_value() },\n \"initiatedBy\" => lambda {|n| @initiated_by = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AuditActivityInitiator.create_from_discriminator_value(pn) }) },\n \"loggedByService\" => lambda {|n| @logged_by_service = n.get_string_value() },\n \"operationType\" => lambda {|n| @operation_type = n.get_string_value() },\n \"result\" => lambda {|n| @result = n.get_enum_value(MicrosoftGraph::Models::OperationResult) },\n \"resultReason\" => lambda {|n| @result_reason = n.get_string_value() },\n \"targetResources\" => lambda {|n| @target_resources = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::TargetResource.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "ca79365009c86a82231d38f48b4ea899",
"score": "0.6014177",
"text": "def get_field_deserializers()\n return super.merge({\n \"error\" => lambda {|n| @error = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PublicError.create_from_discriminator_value(pn) }) },\n \"percentageComplete\" => lambda {|n| @percentage_complete = n.get_number_value() },\n \"resourceId\" => lambda {|n| @resource_id = n.get_string_value() },\n \"type\" => lambda {|n| @type = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "d670d1b51290843830d7555138576614",
"score": "0.6012158",
"text": "def get_field_deserializers()\n return {\n \"isCaptionEnabled\" => lambda {|n| @is_caption_enabled = n.get_boolean_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"spokenLanguage\" => lambda {|n| @spoken_language = n.get_string_value() },\n \"translationLanguages\" => lambda {|n| @translation_languages = n.get_collection_of_primitive_values(String) },\n }\n end",
"title": ""
},
{
"docid": "b4ef8e3f649a9048d716ebc88f7aef9d",
"score": "0.6011329",
"text": "def get_field_deserializers()\n return super.merge({\n \"mobileAppIdentifier\" => lambda {|n| @mobile_app_identifier = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MobileAppIdentifier.create_from_discriminator_value(pn) }) },\n \"version\" => lambda {|n| @version = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "63090b0010d54cd64d3103d00488b035",
"score": "0.6007223",
"text": "def get_field_deserializers()\n return {\n \"isActive\" => lambda {|n| @is_active = n.get_boolean_value() },\n \"notAfter\" => lambda {|n| @not_after = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"notBefore\" => lambda {|n| @not_before = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"thumbprint\" => lambda {|n| @thumbprint = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "65b1004d6c501855af859757d81b333f",
"score": "0.6005515",
"text": "def get_field_deserializers()\n return {\n \"acceptedModalities\" => lambda {|n| @accepted_modalities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Modality.create_from_discriminator_value(pn) }) },\n \"callOptions\" => lambda {|n| @call_options = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IncomingCallOptions.create_from_discriminator_value(pn) }) },\n \"callbackUri\" => lambda {|n| @callback_uri = n.get_string_value() },\n \"mediaConfig\" => lambda {|n| @media_config = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MediaConfig.create_from_discriminator_value(pn) }) },\n \"participantCapacity\" => lambda {|n| @participant_capacity = n.get_number_value() },\n }\n end",
"title": ""
},
{
"docid": "4a50716f687e242c46184d6f7768bd64",
"score": "0.6005213",
"text": "def get_field_deserializers()\n return super.merge({\n \"deliveryOptimizationPriority\" => lambda {|n| @delivery_optimization_priority = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppDeliveryOptimizationPriority) },\n \"installTimeSettings\" => lambda {|n| @install_time_settings = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MobileAppInstallTimeSettings.create_from_discriminator_value(pn) }) },\n \"notifications\" => lambda {|n| @notifications = n.get_enum_value(MicrosoftGraph::Models::Win32LobAppNotification) },\n \"restartSettings\" => lambda {|n| @restart_settings = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Win32LobAppRestartSettings.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "a9e7a084490ab3b9dadbdf8e4bd2a5ba",
"score": "0.6003364",
"text": "def get_field_deserializers()\n return super.merge({\n \"cpuCoresCount\" => lambda {|n| @cpu_cores_count = n.get_number_value() },\n \"cpuName\" => lambda {|n| @cpu_name = n.get_string_value() },\n \"cpuProcessorSpeedInMhz\" => lambda {|n| @cpu_processor_speed_in_mhz = n.get_number_value() },\n \"feedback\" => lambda {|n| @feedback = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CallRecordsUserFeedback.create_from_discriminator_value(pn) }) },\n \"identity\" => lambda {|n| @identity = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::IdentitySet.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "76060dc3d02b9e31f0e6036afd57072a",
"score": "0.60000324",
"text": "def get_field_deserializers()\n return super.merge({\n \"cluster\" => lambda {|n| @cluster = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityKubernetesClusterEvidence.create_from_discriminator_value(pn) }) },\n \"labels\" => lambda {|n| @labels = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityDictionary.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "a8ae9d63bc63d00c767225295d477719",
"score": "0.59969",
"text": "def get_field_deserializers()\n return {\n \"birthDate\" => lambda {|n| @birth_date = n.get_date_value() },\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"gender\" => lambda {|n| @gender = n.get_enum_value(MicrosoftGraph::Models::EducationGender) },\n \"grade\" => lambda {|n| @grade = n.get_string_value() },\n \"graduationYear\" => lambda {|n| @graduation_year = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"studentNumber\" => lambda {|n| @student_number = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "c4de93b09767f83f7d3a885b311bc552",
"score": "0.59955215",
"text": "def get_field_deserializers()\n return {\n \"capabilities\" => lambda {|n| @capabilities = n.get_string_value() },\n \"isDefault\" => lambda {|n| @is_default = n.get_boolean_value() },\n \"isInitial\" => lambda {|n| @is_initial = n.get_boolean_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"type\" => lambda {|n| @type = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "519d9fd4109110bd8238a73f1bb331a6",
"score": "0.59953535",
"text": "def get_field_deserializers()\n return super.merge({\n \"attemptsCount\" => lambda {|n| @attempts_count = n.get_number_value() },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"error\" => lambda {|n| @error = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::OperationError.create_from_discriminator_value(pn) }) },\n \"lastActionDateTime\" => lambda {|n| @last_action_date_time = n.get_date_time_value() },\n \"operationType\" => lambda {|n| @operation_type = n.get_enum_value(MicrosoftGraph::Models::TeamsAsyncOperationType) },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::TeamsAsyncOperationStatus) },\n \"targetResourceId\" => lambda {|n| @target_resource_id = n.get_string_value() },\n \"targetResourceLocation\" => lambda {|n| @target_resource_location = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "f5fd9871702eeb0e840a41b6d80471ce",
"score": "0.59935874",
"text": "def deserialize( data )\n self.class.deserialize( data )\n end",
"title": ""
},
{
"docid": "887cbbce669640323a814a5a311ba4b4",
"score": "0.59921616",
"text": "def get_field_deserializers()\n return {\n \"address\" => lambda {|n| @address = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PhysicalAddress.create_from_discriminator_value(pn) }) },\n \"coordinates\" => lambda {|n| @coordinates = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::OutlookGeoCoordinates.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"locationEmailAddress\" => lambda {|n| @location_email_address = n.get_string_value() },\n \"locationType\" => lambda {|n| @location_type = n.get_enum_value(MicrosoftGraph::Models::LocationType) },\n \"locationUri\" => lambda {|n| @location_uri = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"uniqueId\" => lambda {|n| @unique_id = n.get_string_value() },\n \"uniqueIdType\" => lambda {|n| @unique_id_type = n.get_enum_value(MicrosoftGraph::Models::LocationUniqueIdType) },\n }\n end",
"title": ""
},
{
"docid": "e4d96f6885a6d428c6a6f767b1c6b107",
"score": "0.5990899",
"text": "def get_field_deserializers()\n return {\n \"chatInfo\" => lambda {|n| @chat_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ChatInfo.create_from_discriminator_value(pn) }) },\n \"endDateTime\" => lambda {|n| @end_date_time = n.get_date_time_value() },\n \"externalId\" => lambda {|n| @external_id = n.get_string_value() },\n \"participants\" => lambda {|n| @participants = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MeetingParticipants.create_from_discriminator_value(pn) }) },\n \"startDateTime\" => lambda {|n| @start_date_time = n.get_date_time_value() },\n \"subject\" => lambda {|n| @subject = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "047ed79335b05f65828ed9cc6bed0ab6",
"score": "0.59891254",
"text": "def read_attributes\n @_attributes\n end",
"title": ""
},
{
"docid": "82d4d55c193f169c247f6518ce909ae9",
"score": "0.598833",
"text": "def get_field_deserializers()\n return {\n \"direction\" => lambda {|n| @direction = n.get_enum_value(MicrosoftGraph::Models::MediaDirection) },\n \"label\" => lambda {|n| @label = n.get_string_value() },\n \"mediaType\" => lambda {|n| @media_type = n.get_enum_value(MicrosoftGraph::Models::Modality) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"serverMuted\" => lambda {|n| @server_muted = n.get_boolean_value() },\n \"sourceId\" => lambda {|n| @source_id = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "feb67f38151a905a84ffd348187a4172",
"score": "0.59881896",
"text": "def get_field_deserializers()\n return super.merge({\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"exportFileMetadata\" => lambda {|n| @export_file_metadata = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::SecurityExportFileMetadata.create_from_discriminator_value(pn) }) },\n \"exportOptions\" => lambda {|n| @export_options = n.get_enum_value(MicrosoftGraph::Models::SecurityExportOptions) },\n \"exportStructure\" => lambda {|n| @export_structure = n.get_enum_value(MicrosoftGraph::Models::SecurityExportFileStructure) },\n \"outputName\" => lambda {|n| @output_name = n.get_string_value() },\n \"reviewSet\" => lambda {|n| @review_set = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityEdiscoveryReviewSet.create_from_discriminator_value(pn) }) },\n \"reviewSetQuery\" => lambda {|n| @review_set_query = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SecurityEdiscoveryReviewSetQuery.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "2fe75e24c6631088ba771dbc66f11721",
"score": "0.5987151",
"text": "def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"environment\" => lambda {|n| @environment = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AccessPackageResourceEnvironment.create_from_discriminator_value(pn) }) },\n \"modifiedDateTime\" => lambda {|n| @modified_date_time = n.get_date_time_value() },\n \"originId\" => lambda {|n| @origin_id = n.get_string_value() },\n \"originSystem\" => lambda {|n| @origin_system = n.get_string_value() },\n \"roles\" => lambda {|n| @roles = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AccessPackageResourceRole.create_from_discriminator_value(pn) }) },\n \"scopes\" => lambda {|n| @scopes = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AccessPackageResourceScope.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "dd8e45f708a1e33ed3e6782c907bb9a6",
"score": "0.59866357",
"text": "def get_field_deserializers()\n return super.merge({\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"description\" => lambda {|n| @description = n.get_string_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"isDefaultEnvironment\" => lambda {|n| @is_default_environment = n.get_boolean_value() },\n \"modifiedDateTime\" => lambda {|n| @modified_date_time = n.get_date_time_value() },\n \"originId\" => lambda {|n| @origin_id = n.get_string_value() },\n \"originSystem\" => lambda {|n| @origin_system = n.get_string_value() },\n \"resources\" => lambda {|n| @resources = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AccessPackageResource.create_from_discriminator_value(pn) }) },\n })\n end",
"title": ""
},
{
"docid": "e572e872d81958ff1da267c7878c4689",
"score": "0.598389",
"text": "def serialized_attributes\n read_inheritable_attribute(:attr_serialized) or write_inheritable_attribute(:attr_serialized, {})\n end",
"title": ""
},
{
"docid": "dc287a11d022918ac45a325a772ef4e8",
"score": "0.59831935",
"text": "def get_field_deserializers()\n return super.merge({\n \"completedDateTime\" => lambda {|n| @completed_date_time = n.get_date_time_value() },\n \"completionPercentage\" => lambda {|n| @completion_percentage = n.get_number_value() },\n \"externalcourseActivityId\" => lambda {|n| @externalcourse_activity_id = n.get_string_value() },\n \"learnerUserId\" => lambda {|n| @learner_user_id = n.get_string_value() },\n \"learningContentId\" => lambda {|n| @learning_content_id = n.get_string_value() },\n \"learningProviderId\" => lambda {|n| @learning_provider_id = n.get_string_value() },\n \"status\" => lambda {|n| @status = n.get_enum_value(MicrosoftGraph::Models::CourseStatus) },\n })\n end",
"title": ""
},
{
"docid": "aa2001207afadc2bc08c83f140ed4ec4",
"score": "0.5982087",
"text": "def get_field_deserializers()\n return super.merge({\n \"aboutMe\" => lambda {|n| @about_me = n.get_string_value() },\n \"accountEnabled\" => lambda {|n| @account_enabled = n.get_boolean_value() },\n \"activities\" => lambda {|n| @activities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::UserActivity.create_from_discriminator_value(pn) }) },\n \"ageGroup\" => lambda {|n| @age_group = n.get_string_value() },\n \"agreementAcceptances\" => lambda {|n| @agreement_acceptances = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AgreementAcceptance.create_from_discriminator_value(pn) }) },\n \"appRoleAssignments\" => lambda {|n| @app_role_assignments = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AppRoleAssignment.create_from_discriminator_value(pn) }) },\n \"assignedLicenses\" => lambda {|n| @assigned_licenses = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AssignedLicense.create_from_discriminator_value(pn) }) },\n \"assignedPlans\" => lambda {|n| @assigned_plans = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AssignedPlan.create_from_discriminator_value(pn) }) },\n \"authentication\" => lambda {|n| @authentication = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Authentication.create_from_discriminator_value(pn) }) },\n \"authorizationInfo\" => lambda {|n| @authorization_info = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AuthorizationInfo.create_from_discriminator_value(pn) }) },\n \"birthday\" => lambda {|n| @birthday = n.get_date_time_value() },\n \"businessPhones\" => lambda {|n| @business_phones = n.get_collection_of_primitive_values(String) },\n \"calendar\" => lambda {|n| @calendar = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Calendar.create_from_discriminator_value(pn) }) },\n \"calendarGroups\" => lambda {|n| @calendar_groups = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::CalendarGroup.create_from_discriminator_value(pn) }) },\n \"calendarView\" => lambda {|n| @calendar_view = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Event.create_from_discriminator_value(pn) }) },\n \"calendars\" => lambda {|n| @calendars = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Calendar.create_from_discriminator_value(pn) }) },\n \"chats\" => lambda {|n| @chats = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Chat.create_from_discriminator_value(pn) }) },\n \"city\" => lambda {|n| @city = n.get_string_value() },\n \"companyName\" => lambda {|n| @company_name = n.get_string_value() },\n \"consentProvidedForMinor\" => lambda {|n| @consent_provided_for_minor = n.get_string_value() },\n \"contactFolders\" => lambda {|n| @contact_folders = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ContactFolder.create_from_discriminator_value(pn) }) },\n \"contacts\" => lambda {|n| @contacts = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Contact.create_from_discriminator_value(pn) }) },\n \"country\" => lambda {|n| @country = n.get_string_value() },\n \"createdDateTime\" => lambda {|n| @created_date_time = n.get_date_time_value() },\n \"createdObjects\" => lambda {|n| @created_objects = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },\n \"creationType\" => lambda {|n| @creation_type = n.get_string_value() },\n \"customSecurityAttributes\" => lambda {|n| @custom_security_attributes = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::CustomSecurityAttributeValue.create_from_discriminator_value(pn) }) },\n \"department\" => lambda {|n| @department = n.get_string_value() },\n \"deviceEnrollmentLimit\" => lambda {|n| @device_enrollment_limit = n.get_number_value() },\n \"deviceManagementTroubleshootingEvents\" => lambda {|n| @device_management_troubleshooting_events = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DeviceManagementTroubleshootingEvent.create_from_discriminator_value(pn) }) },\n \"directReports\" => lambda {|n| @direct_reports = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"drive\" => lambda {|n| @drive = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Drive.create_from_discriminator_value(pn) }) },\n \"drives\" => lambda {|n| @drives = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Drive.create_from_discriminator_value(pn) }) },\n \"employeeExperience\" => lambda {|n| @employee_experience = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::EmployeeExperienceUser.create_from_discriminator_value(pn) }) },\n \"employeeHireDate\" => lambda {|n| @employee_hire_date = n.get_date_time_value() },\n \"employeeId\" => lambda {|n| @employee_id = n.get_string_value() },\n \"employeeLeaveDateTime\" => lambda {|n| @employee_leave_date_time = n.get_date_time_value() },\n \"employeeOrgData\" => lambda {|n| @employee_org_data = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::EmployeeOrgData.create_from_discriminator_value(pn) }) },\n \"employeeType\" => lambda {|n| @employee_type = n.get_string_value() },\n \"events\" => lambda {|n| @events = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Event.create_from_discriminator_value(pn) }) },\n \"extensions\" => lambda {|n| @extensions = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Extension.create_from_discriminator_value(pn) }) },\n \"externalUserState\" => lambda {|n| @external_user_state = n.get_string_value() },\n \"externalUserStateChangeDateTime\" => lambda {|n| @external_user_state_change_date_time = n.get_date_time_value() },\n \"faxNumber\" => lambda {|n| @fax_number = n.get_string_value() },\n \"followedSites\" => lambda {|n| @followed_sites = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Site.create_from_discriminator_value(pn) }) },\n \"givenName\" => lambda {|n| @given_name = n.get_string_value() },\n \"hireDate\" => lambda {|n| @hire_date = n.get_date_time_value() },\n \"identities\" => lambda {|n| @identities = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ObjectIdentity.create_from_discriminator_value(pn) }) },\n \"imAddresses\" => lambda {|n| @im_addresses = n.get_collection_of_primitive_values(String) },\n \"inferenceClassification\" => lambda {|n| @inference_classification = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::InferenceClassification.create_from_discriminator_value(pn) }) },\n \"insights\" => lambda {|n| @insights = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::OfficeGraphInsights.create_from_discriminator_value(pn) }) },\n \"interests\" => lambda {|n| @interests = n.get_collection_of_primitive_values(String) },\n \"isResourceAccount\" => lambda {|n| @is_resource_account = n.get_boolean_value() },\n \"jobTitle\" => lambda {|n| @job_title = n.get_string_value() },\n \"joinedTeams\" => lambda {|n| @joined_teams = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Team.create_from_discriminator_value(pn) }) },\n \"lastPasswordChangeDateTime\" => lambda {|n| @last_password_change_date_time = n.get_date_time_value() },\n \"legalAgeGroupClassification\" => lambda {|n| @legal_age_group_classification = n.get_string_value() },\n \"licenseAssignmentStates\" => lambda {|n| @license_assignment_states = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LicenseAssignmentState.create_from_discriminator_value(pn) }) },\n \"licenseDetails\" => lambda {|n| @license_details = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::LicenseDetails.create_from_discriminator_value(pn) }) },\n \"mail\" => lambda {|n| @mail = n.get_string_value() },\n \"mailFolders\" => lambda {|n| @mail_folders = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::MailFolder.create_from_discriminator_value(pn) }) },\n \"mailNickname\" => lambda {|n| @mail_nickname = n.get_string_value() },\n \"mailboxSettings\" => lambda {|n| @mailbox_settings = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MailboxSettings.create_from_discriminator_value(pn) }) },\n \"managedAppRegistrations\" => lambda {|n| @managed_app_registrations = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedAppRegistration.create_from_discriminator_value(pn) }) },\n \"managedDevices\" => lambda {|n| @managed_devices = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ManagedDevice.create_from_discriminator_value(pn) }) },\n \"manager\" => lambda {|n| @manager = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },\n \"memberOf\" => lambda {|n| @member_of = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },\n \"messages\" => lambda {|n| @messages = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Message.create_from_discriminator_value(pn) }) },\n \"mobilePhone\" => lambda {|n| @mobile_phone = n.get_string_value() },\n \"mySite\" => lambda {|n| @my_site = n.get_string_value() },\n \"oauth2PermissionGrants\" => lambda {|n| @oauth2_permission_grants = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OAuth2PermissionGrant.create_from_discriminator_value(pn) }) },\n \"officeLocation\" => lambda {|n| @office_location = n.get_string_value() },\n \"onPremisesDistinguishedName\" => lambda {|n| @on_premises_distinguished_name = n.get_string_value() },\n \"onPremisesDomainName\" => lambda {|n| @on_premises_domain_name = n.get_string_value() },\n \"onPremisesExtensionAttributes\" => lambda {|n| @on_premises_extension_attributes = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::OnPremisesExtensionAttributes.create_from_discriminator_value(pn) }) },\n \"onPremisesImmutableId\" => lambda {|n| @on_premises_immutable_id = n.get_string_value() },\n \"onPremisesLastSyncDateTime\" => lambda {|n| @on_premises_last_sync_date_time = n.get_date_time_value() },\n \"onPremisesProvisioningErrors\" => lambda {|n| @on_premises_provisioning_errors = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnPremisesProvisioningError.create_from_discriminator_value(pn) }) },\n \"onPremisesSamAccountName\" => lambda {|n| @on_premises_sam_account_name = n.get_string_value() },\n \"onPremisesSecurityIdentifier\" => lambda {|n| @on_premises_security_identifier = n.get_string_value() },\n \"onPremisesSyncEnabled\" => lambda {|n| @on_premises_sync_enabled = n.get_boolean_value() },\n \"onPremisesUserPrincipalName\" => lambda {|n| @on_premises_user_principal_name = n.get_string_value() },\n \"onenote\" => lambda {|n| @onenote = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Onenote.create_from_discriminator_value(pn) }) },\n \"onlineMeetings\" => lambda {|n| @online_meetings = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::OnlineMeeting.create_from_discriminator_value(pn) }) },\n \"otherMails\" => lambda {|n| @other_mails = n.get_collection_of_primitive_values(String) },\n \"outlook\" => lambda {|n| @outlook = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::OutlookUser.create_from_discriminator_value(pn) }) },\n \"ownedDevices\" => lambda {|n| @owned_devices = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },\n \"ownedObjects\" => lambda {|n| @owned_objects = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },\n \"passwordPolicies\" => lambda {|n| @password_policies = n.get_string_value() },\n \"passwordProfile\" => lambda {|n| @password_profile = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PasswordProfile.create_from_discriminator_value(pn) }) },\n \"pastProjects\" => lambda {|n| @past_projects = n.get_collection_of_primitive_values(String) },\n \"people\" => lambda {|n| @people = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::Person.create_from_discriminator_value(pn) }) },\n \"photo\" => lambda {|n| @photo = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::ProfilePhoto.create_from_discriminator_value(pn) }) },\n \"photos\" => lambda {|n| @photos = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ProfilePhoto.create_from_discriminator_value(pn) }) },\n \"planner\" => lambda {|n| @planner = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::PlannerUser.create_from_discriminator_value(pn) }) },\n \"postalCode\" => lambda {|n| @postal_code = n.get_string_value() },\n \"preferredDataLocation\" => lambda {|n| @preferred_data_location = n.get_string_value() },\n \"preferredLanguage\" => lambda {|n| @preferred_language = n.get_string_value() },\n \"preferredName\" => lambda {|n| @preferred_name = n.get_string_value() },\n \"presence\" => lambda {|n| @presence = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Presence.create_from_discriminator_value(pn) }) },\n \"print\" => lambda {|n| @print = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::UserPrint.create_from_discriminator_value(pn) }) },\n \"provisionedPlans\" => lambda {|n| @provisioned_plans = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ProvisionedPlan.create_from_discriminator_value(pn) }) },\n \"proxyAddresses\" => lambda {|n| @proxy_addresses = n.get_collection_of_primitive_values(String) },\n \"registeredDevices\" => lambda {|n| @registered_devices = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },\n \"responsibilities\" => lambda {|n| @responsibilities = n.get_collection_of_primitive_values(String) },\n \"schools\" => lambda {|n| @schools = n.get_collection_of_primitive_values(String) },\n \"scopedRoleMemberOf\" => lambda {|n| @scoped_role_member_of = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ScopedRoleMembership.create_from_discriminator_value(pn) }) },\n \"securityIdentifier\" => lambda {|n| @security_identifier = n.get_string_value() },\n \"settings\" => lambda {|n| @settings = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::UserSettings.create_from_discriminator_value(pn) }) },\n \"showInAddressList\" => lambda {|n| @show_in_address_list = n.get_boolean_value() },\n \"signInActivity\" => lambda {|n| @sign_in_activity = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::SignInActivity.create_from_discriminator_value(pn) }) },\n \"signInSessionsValidFromDateTime\" => lambda {|n| @sign_in_sessions_valid_from_date_time = n.get_date_time_value() },\n \"skills\" => lambda {|n| @skills = n.get_collection_of_primitive_values(String) },\n \"state\" => lambda {|n| @state = n.get_string_value() },\n \"streetAddress\" => lambda {|n| @street_address = n.get_string_value() },\n \"surname\" => lambda {|n| @surname = n.get_string_value() },\n \"teamwork\" => lambda {|n| @teamwork = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::UserTeamwork.create_from_discriminator_value(pn) }) },\n \"todo\" => lambda {|n| @todo = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::Todo.create_from_discriminator_value(pn) }) },\n \"transitiveMemberOf\" => lambda {|n| @transitive_member_of = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::DirectoryObject.create_from_discriminator_value(pn) }) },\n \"usageLocation\" => lambda {|n| @usage_location = n.get_string_value() },\n \"userPrincipalName\" => lambda {|n| @user_principal_name = n.get_string_value() },\n \"userType\" => lambda {|n| @user_type = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "a68ebe8efe8b3d88a4a71d88977a06b8",
"score": "0.59813374",
"text": "def deserialize_attributes(attrs = {})\n attrs\n end",
"title": ""
},
{
"docid": "bedc98acf12e1aa668cfaec2134701b6",
"score": "0.59809405",
"text": "def get_field_deserializers()\n return {\n \"audioBitsPerSample\" => lambda {|n| @audio_bits_per_sample = n.get_number_value() },\n \"audioChannels\" => lambda {|n| @audio_channels = n.get_number_value() },\n \"audioFormat\" => lambda {|n| @audio_format = n.get_string_value() },\n \"audioSamplesPerSecond\" => lambda {|n| @audio_samples_per_second = n.get_number_value() },\n \"bitrate\" => lambda {|n| @bitrate = n.get_number_value() },\n \"duration\" => lambda {|n| @duration = n.get_object_value(lambda {|pn| Int64.create_from_discriminator_value(pn) }) },\n \"fourCC\" => lambda {|n| @four_c_c = n.get_string_value() },\n \"frameRate\" => lambda {|n| @frame_rate = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"height\" => lambda {|n| @height = n.get_number_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"width\" => lambda {|n| @width = n.get_number_value() },\n }\n end",
"title": ""
},
{
"docid": "cb5c51f6e50fcd0cc10c611aa9c852d9",
"score": "0.59725595",
"text": "def get_field_deserializers()\n return {\n \"accuracy\" => lambda {|n| @accuracy = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"altitude\" => lambda {|n| @altitude = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"altitudeAccuracy\" => lambda {|n| @altitude_accuracy = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"latitude\" => lambda {|n| @latitude = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"longitude\" => lambda {|n| @longitude = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "6284640401e686e2e4a240df6350af15",
"score": "0.59716827",
"text": "def get_field_deserializers()\n return super.merge({\n \"appStoreUrl\" => lambda {|n| @app_store_url = n.get_string_value() },\n \"minimumSupportedOperatingSystem\" => lambda {|n| @minimum_supported_operating_system = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::AndroidMinimumOperatingSystem.create_from_discriminator_value(pn) }) },\n \"packageId\" => lambda {|n| @package_id = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "e204894c3d673bd446b1fd11bd254ad3",
"score": "0.59713537",
"text": "def get_field_deserializers()\n return super.merge({\n \"additionalInformationUrl\" => lambda {|n| @additional_information_url = n.get_string_value() },\n \"category\" => lambda {|n| @category = n.get_enum_value(MicrosoftGraph::Models::WindowsMalwareCategory) },\n \"detectionCount\" => lambda {|n| @detection_count = n.get_number_value() },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"executionState\" => lambda {|n| @execution_state = n.get_enum_value(MicrosoftGraph::Models::WindowsMalwareExecutionState) },\n \"initialDetectionDateTime\" => lambda {|n| @initial_detection_date_time = n.get_date_time_value() },\n \"lastStateChangeDateTime\" => lambda {|n| @last_state_change_date_time = n.get_date_time_value() },\n \"severity\" => lambda {|n| @severity = n.get_enum_value(MicrosoftGraph::Models::WindowsMalwareSeverity) },\n \"state\" => lambda {|n| @state = n.get_enum_value(MicrosoftGraph::Models::WindowsMalwareState) },\n \"threatState\" => lambda {|n| @threat_state = n.get_enum_value(MicrosoftGraph::Models::WindowsMalwareThreatState) },\n })\n end",
"title": ""
},
{
"docid": "eda4ee45be2482b288419991f66c8623",
"score": "0.5971316",
"text": "def get_field_deserializers()\n return {\n \"contactITEmailAddress\" => lambda {|n| @contact_i_t_email_address = n.get_string_value() },\n \"contactITName\" => lambda {|n| @contact_i_t_name = n.get_string_value() },\n \"contactITNotes\" => lambda {|n| @contact_i_t_notes = n.get_string_value() },\n \"contactITPhoneNumber\" => lambda {|n| @contact_i_t_phone_number = n.get_string_value() },\n \"darkBackgroundLogo\" => lambda {|n| @dark_background_logo = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MimeContent.create_from_discriminator_value(pn) }) },\n \"displayName\" => lambda {|n| @display_name = n.get_string_value() },\n \"lightBackgroundLogo\" => lambda {|n| @light_background_logo = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::MimeContent.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"onlineSupportSiteName\" => lambda {|n| @online_support_site_name = n.get_string_value() },\n \"onlineSupportSiteUrl\" => lambda {|n| @online_support_site_url = n.get_string_value() },\n \"privacyUrl\" => lambda {|n| @privacy_url = n.get_string_value() },\n \"showDisplayNameNextToLogo\" => lambda {|n| @show_display_name_next_to_logo = n.get_boolean_value() },\n \"showLogo\" => lambda {|n| @show_logo = n.get_boolean_value() },\n \"showNameNextToLogo\" => lambda {|n| @show_name_next_to_logo = n.get_boolean_value() },\n \"themeColor\" => lambda {|n| @theme_color = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::RgbColor.create_from_discriminator_value(pn) }) },\n }\n end",
"title": ""
},
{
"docid": "e46e0abbee709da7ba2d2ce7de5d0973",
"score": "0.59690696",
"text": "def get_field_deserializers()\n return super.merge({\n \"deviceId\" => lambda {|n| @device_id = n.get_string_value() },\n \"deviceName\" => lambda {|n| @device_name = n.get_string_value() },\n \"errorCode\" => lambda {|n| @error_code = n.get_string_value() },\n \"installState\" => lambda {|n| @install_state = n.get_enum_value(MicrosoftGraph::Models::InstallState) },\n \"lastSyncDateTime\" => lambda {|n| @last_sync_date_time = n.get_date_time_value() },\n \"osDescription\" => lambda {|n| @os_description = n.get_string_value() },\n \"osVersion\" => lambda {|n| @os_version = n.get_string_value() },\n \"userName\" => lambda {|n| @user_name = n.get_string_value() },\n })\n end",
"title": ""
},
{
"docid": "efa81891990107427e7bfe2e3be9eb2a",
"score": "0.59680337",
"text": "def get_field_deserializers()\n return {\n \"altitudeInMeters\" => lambda {|n| @altitude_in_meters = n.get_number_value() },\n \"building\" => lambda {|n| @building = n.get_string_value() },\n \"city\" => lambda {|n| @city = n.get_string_value() },\n \"countryOrRegion\" => lambda {|n| @country_or_region = n.get_string_value() },\n \"floor\" => lambda {|n| @floor = n.get_string_value() },\n \"floorDescription\" => lambda {|n| @floor_description = n.get_string_value() },\n \"latitude\" => lambda {|n| @latitude = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"longitude\" => lambda {|n| @longitude = n.get_object_value(lambda {|pn| Double.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"organization\" => lambda {|n| @organization = n.get_collection_of_primitive_values(String) },\n \"postalCode\" => lambda {|n| @postal_code = n.get_string_value() },\n \"roomDescription\" => lambda {|n| @room_description = n.get_string_value() },\n \"roomName\" => lambda {|n| @room_name = n.get_string_value() },\n \"site\" => lambda {|n| @site = n.get_string_value() },\n \"stateOrProvince\" => lambda {|n| @state_or_province = n.get_string_value() },\n \"streetAddress\" => lambda {|n| @street_address = n.get_string_value() },\n \"subdivision\" => lambda {|n| @subdivision = n.get_collection_of_primitive_values(String) },\n \"subunit\" => lambda {|n| @subunit = n.get_collection_of_primitive_values(String) },\n }\n end",
"title": ""
},
{
"docid": "81def4d7450afc05b72f34e57d39c0ef",
"score": "0.5966792",
"text": "def get_field_deserializers()\n return {\n \"attributes\" => lambda {|n| @attributes = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::AttributeDefinition.create_from_discriminator_value(pn) }) },\n \"metadata\" => lambda {|n| @metadata = n.get_collection_of_object_values(lambda {|pn| MicrosoftGraph::Models::ObjectDefinitionMetadataEntry.create_from_discriminator_value(pn) }) },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"supportedApis\" => lambda {|n| @supported_apis = n.get_collection_of_primitive_values(String) },\n }\n end",
"title": ""
},
{
"docid": "2ebd7d1533ce4d57a3efbdd7092dfe5c",
"score": "0.5965087",
"text": "def get_field_deserializers()\n return {\n \"city\" => lambda {|n| @city = n.get_string_value() },\n \"countryOrRegion\" => lambda {|n| @country_or_region = n.get_string_value() },\n \"geoCoordinates\" => lambda {|n| @geo_coordinates = n.get_object_value(lambda {|pn| MicrosoftGraph::Models::GeoCoordinates.create_from_discriminator_value(pn) }) },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"state\" => lambda {|n| @state = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "49facb66f2362b9dc417d227df7b09c9",
"score": "0.59650815",
"text": "def info\n @info.marshal_dump\n end",
"title": ""
},
{
"docid": "343a979beedd0a5b9435392530ba02cd",
"score": "0.5963225",
"text": "def get_field_deserializers()\n return {\n \"clickAction\" => lambda {|n| @click_action = n.get_string_value() },\n \"clickDateTime\" => lambda {|n| @click_date_time = n.get_date_time_value() },\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"sourceId\" => lambda {|n| @source_id = n.get_string_value() },\n \"uriDomain\" => lambda {|n| @uri_domain = n.get_string_value() },\n \"verdict\" => lambda {|n| @verdict = n.get_string_value() },\n }\n end",
"title": ""
},
{
"docid": "e212ba29c938a207c8ac325e112a25e9",
"score": "0.5962619",
"text": "def get_field_deserializers()\n return {\n \"content\" => lambda {|n| @content = n.get_string_value() },\n \"contentType\" => lambda {|n| @content_type = n.get_string_value() },\n \"contentUrl\" => lambda {|n| @content_url = n.get_string_value() },\n \"id\" => lambda {|n| @id = n.get_string_value() },\n \"name\" => lambda {|n| @name = n.get_string_value() },\n \"@odata.type\" => lambda {|n| @odata_type = n.get_string_value() },\n \"teamsAppId\" => lambda {|n| @teams_app_id = n.get_string_value() },\n \"thumbnailUrl\" => lambda {|n| @thumbnail_url = n.get_string_value() },\n }\n end",
"title": ""
}
] |
4e477b00cb57971433cd08d44d23f874
|
method.call invokes the method to run as if you invoked the orignial object
|
[
{
"docid": "a3f5665754429c19b99225316a3640bd",
"score": "0.0",
"text": "def double(a)\r\n\t2*a\r\nend",
"title": ""
}
] |
[
{
"docid": "e425baaf687d96472068e3331bbf8824",
"score": "0.78450584",
"text": "def call(*args)\n __call__( args )\n end",
"title": ""
},
{
"docid": "4fc848bc851b85c0155842e2c413fc41",
"score": "0.77887106",
"text": "def call() end",
"title": ""
},
{
"docid": "d7e1994e287797f6fe6570bf2fc1811c",
"score": "0.7771336",
"text": "def call(object); end",
"title": ""
},
{
"docid": "bed13fd1d5ddd3a1d318b8f23b653d1a",
"score": "0.75920975",
"text": "def call\n end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.75760555",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.75760555",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.75760555",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.75760555",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.75760555",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.75760555",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.75760555",
"text": "def call; end",
"title": ""
},
{
"docid": "22eca42bc8ffb4cb933fefb36966d859",
"score": "0.75760555",
"text": "def call; end",
"title": ""
},
{
"docid": "b3f6bcf9d54b4bcb66185d3012f582a9",
"score": "0.74952465",
"text": "def call(*) end",
"title": ""
},
{
"docid": "b3f6bcf9d54b4bcb66185d3012f582a9",
"score": "0.74952465",
"text": "def call(*) end",
"title": ""
},
{
"docid": "88be844c01467bfff5df1abd22e93f6a",
"score": "0.74184304",
"text": "def call(*args)\n self.exec(*args)\n end",
"title": ""
},
{
"docid": "19b031aae8fdf0e6c3acff7bd60d31d0",
"score": "0.7408307",
"text": "def call\n end",
"title": ""
},
{
"docid": "3923598cefdb39ff94e39293456a9cf0",
"score": "0.7364039",
"text": "def call\n # implement in subclasses\n end",
"title": ""
},
{
"docid": "fecf59d5d23250edbaec8d6451073a41",
"score": "0.73155266",
"text": "def invoking\n end",
"title": ""
},
{
"docid": "adc143d9921490a32ce81e2ec1b81602",
"score": "0.73006403",
"text": "def invoke; end",
"title": ""
},
{
"docid": "9561939093a6aa4ab996a3b56a0a388f",
"score": "0.7290017",
"text": "def call(*args)\n instance.call(*args)\n end",
"title": ""
},
{
"docid": "00a407382546531b963b38af1df41a53",
"score": "0.72215116",
"text": "def method_missing(call)\n object.send(call)\n end",
"title": ""
},
{
"docid": "6199333fb432af38c8abaadcbc60a77e",
"score": "0.72192717",
"text": "def call\n\n\tend",
"title": ""
},
{
"docid": "6199333fb432af38c8abaadcbc60a77e",
"score": "0.72192717",
"text": "def call\n\n\tend",
"title": ""
},
{
"docid": "66c8e06210fc9d7f0610e7df2e937b62",
"score": "0.7203128",
"text": "def call(method, args)\n send(method, *args)\n end",
"title": ""
},
{
"docid": "6cb02c3c7404772482d1414a0c6bcf1e",
"score": "0.7196629",
"text": "def call(data)\n object.send(method, data)\n end",
"title": ""
},
{
"docid": "806a60a542bec5f6609cfd001b5e4bdb",
"score": "0.71357876",
"text": "def call(*args); end",
"title": ""
},
{
"docid": "8eef25bd58747263a5e45e8143109b59",
"score": "0.7108885",
"text": "def call\n raise \"Must subclass and implement call\"\n end",
"title": ""
},
{
"docid": "3649cb0a647d1fcfac2b234fe8fb1359",
"score": "0.7102976",
"text": "def invoke\n execute_only(:invoke)\n end",
"title": ""
},
{
"docid": "856fabe68def0a3ec2651e583dd94218",
"score": "0.7094322",
"text": "def call\n __proxied_call\n end",
"title": ""
},
{
"docid": "4293c983f1dc2ce6cbca75714af89594",
"score": "0.70907575",
"text": "def call\n raise NoMethodError, \"Called undefined #call. You need to implement the method in the class: #{self.class.name}\"\n end",
"title": ""
},
{
"docid": "81faf2197b222a2400c2354c49f6ba61",
"score": "0.7063285",
"text": "def call(method, *args) rpc_execute(method, *args) end",
"title": ""
},
{
"docid": "51b3a952fb89bc2a9f0f2ef8e67d6852",
"score": "0.7023556",
"text": "def call(method, arguments)\n # Like a typical class base runtime model, we store\n # methods in the class of the object.\n @awesome_class.lookup(method).call(self, arguments)\n end",
"title": ""
},
{
"docid": "c9974bebd9b5429fc20cb3e9194d9be2",
"score": "0.6997752",
"text": "def call\n raise(CallNotDefined, \"Your subclass must define its own #call.\")\n end",
"title": ""
},
{
"docid": "ab5d0e8b1574ea1ff4e1283134c23ea3",
"score": "0.6997391",
"text": "def call( *args )\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "183a49d71b059e743defeecf6449c617",
"score": "0.69221973",
"text": "def call(method, *args)\n self.class.rpc_execute(method, *args)\n end",
"title": ""
},
{
"docid": "1da5a401d4e6bf3346761c985e4c0585",
"score": "0.69012785",
"text": "def invoke\n @proc.call\n end",
"title": ""
},
{
"docid": "8b15cefd076593c29b807da042214cb2",
"score": "0.6849301",
"text": "def call(*args)\n\t filtered_args, vm = prepare_call(args)\n\t perform_call(filtered_args, vm)\n\tend",
"title": ""
},
{
"docid": "014271c2f9bbbf446c9520a69e586e97",
"score": "0.68257755",
"text": "def call(*)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "4e4d6d28905bbf532bd01a8a81ed1f20",
"score": "0.6816169",
"text": "def call!(env)\n instance.call(env)\n end",
"title": ""
},
{
"docid": "96b242391d6ca56f30b14ef104c37e98",
"score": "0.68149054",
"text": "def call\n access = RIGHTS[method] # Checking access permissions for perform corresponding ACTION\n raise NoAccessError.new(access) unless @permissions[access] # Raising Custom error if no access granted\n\n send(@method) # Calling method from @method\n end",
"title": ""
},
{
"docid": "96b242391d6ca56f30b14ef104c37e98",
"score": "0.68149054",
"text": "def call\n access = RIGHTS[method] # Checking access permissions for perform corresponding ACTION\n raise NoAccessError.new(access) unless @permissions[access] # Raising Custom error if no access granted\n\n send(@method) # Calling method from @method\n end",
"title": ""
},
{
"docid": "7090856f6f0462a10eea7d5770cc4a6c",
"score": "0.6769077",
"text": "def calls; end",
"title": ""
},
{
"docid": "7090856f6f0462a10eea7d5770cc4a6c",
"score": "0.6769077",
"text": "def calls; end",
"title": ""
},
{
"docid": "370a9e74a9f075f3f8bca8fa54df161b",
"score": "0.6767083",
"text": "def call\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "73c74e6dd2dc52a56f5258bfdeea60b7",
"score": "0.6760596",
"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": "cfc0885c9afd0ed9e205016b5239eb62",
"score": "0.6684967",
"text": "def execute_method\n return unless @method\n method(@method).call\n end",
"title": ""
},
{
"docid": "cfc0885c9afd0ed9e205016b5239eb62",
"score": "0.6684967",
"text": "def execute_method\n return unless @method\n method(@method).call\n end",
"title": ""
},
{
"docid": "9888044bb9fd876d521bf70615730d2e",
"score": "0.6679271",
"text": "def call\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "9888044bb9fd876d521bf70615730d2e",
"score": "0.6679271",
"text": "def call\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "8956d319958af0036b09bbd92df32d27",
"score": "0.66616535",
"text": "def call!(*args)\n new(*args).call!\n end",
"title": ""
},
{
"docid": "ec752b175d22c1c56fa31e534b244462",
"score": "0.665744",
"text": "def run\r\n\t\t\t@b.call\r\n\t\tend",
"title": ""
},
{
"docid": "35689a00e40548bdd2e0f59c92705b50",
"score": "0.6635671",
"text": "def invoke(args)\n @call_back.call *args\n end",
"title": ""
},
{
"docid": "03e479ed52e870c6dca1a99ad92ecea8",
"score": "0.6618689",
"text": "def call(method, *arguments)\n connection.call(method, *arguments)\n end",
"title": ""
},
{
"docid": "e6968edc4b05774aa4f6fa1d4f21ab92",
"score": "0.6587839",
"text": "def method_missing(method, *args)\n Call.new(self, method, args)\n end",
"title": ""
},
{
"docid": "7ffff9f7886007a15080e00fa012c149",
"score": "0.65751696",
"text": "def call(object, options = {})\n runner(object, options).call\n end",
"title": ""
},
{
"docid": "f47dd20614b1854dce3fa60a5033647a",
"score": "0.65746737",
"text": "def call(*command); end",
"title": ""
},
{
"docid": "d26a78068ecdf6dc85c3f90a256de5a2",
"score": "0.6554966",
"text": "def _call_of(method)\n proc{ |*args| send(method, *args) }\n end",
"title": ""
},
{
"docid": "07d90fd0c359d09f7199f02aee095bff",
"score": "0.6550127",
"text": "def call(*args)\n ensure_context_not_missing\n\n args = args.take(arity)\n\n if method?\n context.send(callee, *args)\n else\n context.instance_exec(*args, &callee)\n end\n end",
"title": ""
},
{
"docid": "9b9d470cc02243b19880542bc848ade0",
"score": "0.65449846",
"text": "def call\n raise NotImplementedError,\n \"Override #call and implement your application logic.\"\n end",
"title": ""
},
{
"docid": "7ad4e34966273e7ab62976f2ea50c09b",
"score": "0.65394115",
"text": "def _perform(args); end",
"title": ""
},
{
"docid": "c8e553379c2d88ccaf691ddc7e4b65dc",
"score": "0.6538569",
"text": "def call(method, args = [])\n @runtime_class.lookup(method, args.length).call(self, args)\n end",
"title": ""
},
{
"docid": "c947e3bd2d9de5de918bf686b5c029ef",
"score": "0.6524426",
"text": "def method_missing(method, params={})\n call(method, params)\n end",
"title": ""
},
{
"docid": "7ef1f8c5b5360ee3830da65eb667b342",
"score": "0.651655",
"text": "def instance_call(method_name)\n Scenario::Orchestrator.new(self, @mock_instance_double, :instance, method_name)\n end",
"title": ""
},
{
"docid": "7915662f76b862ad7fc5b0e1d2f72336",
"score": "0.64921486",
"text": "def call\n raise NoMethodError\n end",
"title": ""
},
{
"docid": "35982b6ddf29252194a5da179cfa47ca",
"score": "0.64920896",
"text": "def call(*arguments, **options)\n\t\t\tif options?\n\t\t\t\t@instance.send(@name, *arguments, **options)\n\t\t\telse\n\t\t\t\t# Ignore options...\n\t\t\t\t@instance.send(@name, *arguments)\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "34beb3d37c688bb740a313c7c5973624",
"score": "0.6487172",
"text": "def call(args = {})\n new.call(args)\n end",
"title": ""
},
{
"docid": "777697dce6249e8bcdc5bddb4a62c20b",
"score": "0.6463469",
"text": "def exec _obj, _args\n \"_obj exec _args;\" \n end",
"title": ""
},
{
"docid": "5062f18c62d36f63dbbebf6101a4db66",
"score": "0.64548093",
"text": "def call(*args, **kwargs, &block)\n forward(*args, **kwargs, &block)\n end",
"title": ""
},
{
"docid": "c104959e606e9bba4037731a71c66ba8",
"score": "0.64547044",
"text": "def call\n raise NotImplementedError, 'Lotion::Command subclasses are expected to define #call'\n end",
"title": ""
},
{
"docid": "779d05afc0bdac0b0e8c9b32258ee646",
"score": "0.64499557",
"text": "def invoke(object, args, kwargs, block, called_from)\n arity = args.size\n arity += 1 if !kwargs&.empty?\n check_arity!(arity)\n\n result =\n if @call_through\n call_plan(build_call_through_plan(object), block, *args, **kwargs)\n elsif @plan\n check_for_too_many_arguments!(@plan)\n call_plan(@plan, block, *args, **kwargs)\n end\n ensure\n calls << CallLog.new(object, called_from, args, kwargs, block, result)\n end",
"title": ""
},
{
"docid": "a13fcebe47291028aeb4352c04ceb0f3",
"score": "0.64446753",
"text": "def call\n raise 'You must implement your own #call method in your subclass.'\n end",
"title": ""
},
{
"docid": "855d555dcdcf48c52fb0ed5db48754a0",
"score": "0.64373726",
"text": "def call(*args)\n @ctx.instance_exec(args, &action)\n end",
"title": ""
},
{
"docid": "3b4f255e4b058ccc49355f41e4216994",
"score": "0.6424685",
"text": "def call \n user\n end",
"title": ""
},
{
"docid": "0b0b4ba0bf0b6ad316b8e9c3c25243a8",
"score": "0.64182794",
"text": "def invoke(name, args)\n\t\tself.class.invoke_instance_method(self, name, args)\n\tend",
"title": ""
},
{
"docid": "d1c698c87678a0f5467d35cbe172c422",
"score": "0.63959867",
"text": "def call(&block)\n instance_eval(&block)\n end",
"title": ""
},
{
"docid": "d1c698c87678a0f5467d35cbe172c422",
"score": "0.63959867",
"text": "def call(&block)\n instance_eval(&block)\n end",
"title": ""
},
{
"docid": "d1c698c87678a0f5467d35cbe172c422",
"score": "0.63959867",
"text": "def call(&block)\n instance_eval(&block)\n end",
"title": ""
},
{
"docid": "181dbde23c76dab2a027ca0df8701b97",
"score": "0.63933647",
"text": "def call(method, arguments=[], context)\n value = (@runtime_class.lookup(method) || context.locals[method])\n if value.nil?\n fail 'Undefined method or function. Maybe function was defined after?'\n else\n value.call(self, arguments)\n end\n end",
"title": ""
},
{
"docid": "db0950c15b6dc09fecbf64c4e84031a2",
"score": "0.63552845",
"text": "def call(method, arguments)\n @can_class.lookup(method).call(self, arguments)\n end",
"title": ""
},
{
"docid": "cc4255e7295ebd87da0e5e99ea645b45",
"score": "0.6351327",
"text": "def try_call(*args)\n if self.respond_to?(:call)\n self.call(*args)\n else\n self\n end\n end",
"title": ""
},
{
"docid": "09a7be39fa83ebce6e8851bcfd9dab31",
"score": "0.63362527",
"text": "def call *args\n\t\t\t@code.call *args\n\t\tend",
"title": ""
},
{
"docid": "be8b3d1a5ab0a498181c3ab5b8b2c51d",
"score": "0.63337344",
"text": "def execute(method)\n send(method)\n end",
"title": ""
},
{
"docid": "2172eca885f02b7af79072e7c66dc55c",
"score": "0.6331786",
"text": "def call_method(call_sym, *args, &block)\n call(nil, call_sym, *args, &block)\n end",
"title": ""
},
{
"docid": "e1b69e76be58d4c2390195dc85799050",
"score": "0.63175726",
"text": "def call_internal(command,args)\n return @commands[command].clone.run(args)\n end",
"title": ""
},
{
"docid": "a243e1898ce0a58fe0fe33b7416c24b8",
"score": "0.6309186",
"text": "def call\n process\n end",
"title": ""
},
{
"docid": "d97a73e2fcde65e6d5f14311a7963043",
"score": "0.62985396",
"text": "def invoke!\n _log { \"@facade=@#{@facade.object_id}\" }\n @result = @facade._active_target.__send__(@selector, *@arguments)\n @block.call(@result) if @block\n rescue Exception => exc\n @thread.raise(@exception = exc)\n end",
"title": ""
},
{
"docid": "a1a84e251dd79b000ec58b775f369eed",
"score": "0.6294349",
"text": "def invoke *o,&b\n @invoker ||= create_invoker()\n invoker.invoke *o,&b\n end",
"title": ""
},
{
"docid": "d173c2ed0dffcb0e1c89ec53743c5995",
"score": "0.629199",
"text": "def call(_rc)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "2acbf034da4fd47fc24672e18263463d",
"score": "0.62850165",
"text": "def call_method(method_name, params=nil)\n if params.nil?\n self.method(method_name).call\n else\n self.method(method_name).call(params)\n end\n end",
"title": ""
},
{
"docid": "c80e3100840ad41f0fdc3a1fc5fb7c19",
"score": "0.6277812",
"text": "def excel_call(method, *args)\n @excel.Application.Run(method.to_s, *args)\n end",
"title": ""
},
{
"docid": "99dec1a4844ea6183089a60139ebf720",
"score": "0.6272896",
"text": "def invoke\n raise NotImplementedError, \"Author of subclass forgot to implement #invoke\"\n end",
"title": ""
},
{
"docid": "551cf912263e3be2061119b65c68ca34",
"score": "0.62715876",
"text": "def op_invoke(method = nil)\n op_send(method, false)\n end",
"title": ""
},
{
"docid": "a43343f5b92337cd7db4359e0f165080",
"score": "0.6255327",
"text": "def call(*args)\n instance_exec(*correct_arg_arity(block.arity, args), &block)\n end",
"title": ""
},
{
"docid": "bb05b12072de98e45c3c19587fdbb669",
"score": "0.6246117",
"text": "def method_missing(name, *args)\n\t\t\tcall name, *args\n\t\tend",
"title": ""
},
{
"docid": "5486b5c467099a7d79bf7db6054a7ee5",
"score": "0.6245404",
"text": "def invoke(object, method_name)\n object.send(method_name)\nend",
"title": ""
},
{
"docid": "5406b75b79372f80bdc8fac89251a096",
"score": "0.6237877",
"text": "def system_call(call)\n system_caller.execute(call)\n end",
"title": ""
},
{
"docid": "e14077441e8edb1c1a2ec2a61dd72f3b",
"score": "0.62251186",
"text": "def method_missing(name, *args)\n\t\t\tcall(name, *args)\n\t\tend",
"title": ""
},
{
"docid": "860ceff71291b790efe26b40df080f8d",
"score": "0.6222719",
"text": "def call(env)\n dup._call(env)\n end",
"title": ""
},
{
"docid": "d4238bbd2a4e9bfe8517cd7f9e39e9ec",
"score": "0.6221668",
"text": "def remote_call name, args\n m = public_method(name)\n if m && m.owner == self.class\n m.call(*args)\n else\n raise NoMethodError, \"method #{name} is not found\"\n end\n rescue NameError\n raise NoMethodError, \"method #{name} is not found\"\n end",
"title": ""
},
{
"docid": "ad25aa78128d9d19a2ea9eacb9bf0b1e",
"score": "0.62179285",
"text": "def BlocksAndMethods(&argumento)\n\targumento.call\nend",
"title": ""
},
{
"docid": "0ccb9b7091551f350beb34655f54775b",
"score": "0.6197993",
"text": "def chained_call(*methods)\n raise \"Not implemented yet.\"\n end",
"title": ""
}
] |
c657de4b70d266e9a3a784b999ea9e60
|
Never trust parameters from the scary internet, only allow the white list through.
|
[
{
"docid": "1d1afa7f2af6d2ef41368a89237ffe3a",
"score": "0.0",
"text": "def ride_offer_comment_params\n params.require(:ride_offer_comment).permit(:user_name, :body, :ride_offer_id)\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": ""
}
] |
db1641723df11e29ae7fda8d6327f75d
|
This method returns a node for a principal. The passed array contains principal information, and is guaranteed to at least contain a uri item. Other properties may or may not be supplied by the authentication backend.
|
[
{
"docid": "cb7ed09be073c1c5157240a7882d8337",
"score": "0.5794403",
"text": "def child_for_principal(principal)\n AddressBookHome.new(@carddav_backend, principal['uri'])\n end",
"title": ""
}
] |
[
{
"docid": "7e5a71700cc7f41083ae6f3d47174d04",
"score": "0.6499383",
"text": "def principal_by_uri(uri)\n result = nil\n collections = @principal_collection_set\n collections.each do |collection|\n principal_collection = @server.tree.node_for_path(collection)\n unless principal_collection.is_a?(IPrincipalCollection)\n # Not a principal collection, we're simply going to ignore\n # this.\n next\n end\n\n result = principal_collection.find_by_uri(uri)\n return result unless result.blank?\n end\n\n nil\n end",
"title": ""
},
{
"docid": "1c578c8a6bbdd02b876e2bf1d6973527",
"score": "0.60528356",
"text": "def child_for_principal(principal)\n Principal.new(@principal_backend, principal)\n end",
"title": ""
},
{
"docid": "6b0417a2b8f1060a939005aadf765c68",
"score": "0.5963861",
"text": "def find_by_uri(uri)\n @principal_backend.find_by_uri(uri, @principal_prefix)\n end",
"title": ""
},
{
"docid": "52fa98b219474c6f126254ab0ac6de3f",
"score": "0.59017265",
"text": "def child_for_principal(principal_info)\n owner = principal_info['uri']\n acl = [\n {\n 'privilege' => '{DAV:}read',\n 'principal' => owner,\n 'protected' => true\n },\n {\n 'privilege' => '{DAV:}write',\n 'principal' => owner,\n 'protected' => true\n }\n ]\n\n principal_base_name = Uri.split(owner)[1]\n\n path = \"#{@storage_path}/#{principal_base_name}\"\n\n FileUtils.mkdir_p(path) unless ::File.directory?(path)\n\n Collection.new(\n path,\n acl,\n owner\n )\n end",
"title": ""
},
{
"docid": "65002bbf4ee7675c5c9f8b4aa6182c01",
"score": "0.58918166",
"text": "def child_for_principal(principal_info)\n end",
"title": ""
},
{
"docid": "3bcb43475dd4535049f21ef893911111",
"score": "0.5845814",
"text": "def principal\n @principal\n end",
"title": ""
},
{
"docid": "db28650002061a060318a13af8e77d51",
"score": "0.57699895",
"text": "def principal_url\n @principal_properties['uri']\n end",
"title": ""
},
{
"docid": "36a38b98bdbdf9825507203abf5090d5",
"score": "0.57607687",
"text": "def owner\n @principal_properties['uri']\n end",
"title": ""
},
{
"docid": "d2d9a1449c0479666dfad9c87e299350",
"score": "0.574529",
"text": "def principal\n return @principal\n end",
"title": ""
},
{
"docid": "3c21c2abe115d41aedeeb03a65c08866",
"score": "0.5723109",
"text": "def principal_url\n @principal_info['uri'] + '/' + name\n end",
"title": ""
},
{
"docid": "3f7566aebda120917b9f1ef8866c551a",
"score": "0.56983197",
"text": "def principal\n return @principal\n end",
"title": ""
},
{
"docid": "3f7566aebda120917b9f1ef8866c551a",
"score": "0.56983197",
"text": "def principal\n return @principal\n end",
"title": ""
},
{
"docid": "9e24805b2b26b385460902f95ffc7b04",
"score": "0.55446625",
"text": "def owner\n @principal_info['uri']\n end",
"title": ""
},
{
"docid": "e4352934dd5d56369a62097a4e843679",
"score": "0.5493463",
"text": "def principal=(value)\n @principal = value\n end",
"title": ""
},
{
"docid": "372d7e9f5a80ad10bf6e9fce2d11d72a",
"score": "0.54149866",
"text": "def owner\n @principal_uri\n end",
"title": ""
},
{
"docid": "372d7e9f5a80ad10bf6e9fce2d11d72a",
"score": "0.54149866",
"text": "def owner\n @principal_uri\n end",
"title": ""
},
{
"docid": "14e4d542c8d4e681d81c034ceb31e254",
"score": "0.5396598",
"text": "def principal=(value)\n @principal = value\n end",
"title": ""
},
{
"docid": "21e2c18fe8b12b24c63da003ec94a71e",
"score": "0.53788394",
"text": "def get_principal_id(xml)\n data = XmlSimple.xml_in(xml)\n if data.keys.include?('principal-list')\n return data['principal-list'].first['principal'].first['principal-id'] unless data['principal-list'].first.empty?\n elsif data.keys.include?('principal')\n return data['principal'].first['principal-id']\n else\n raise \"XMLParser does not support result of this format. No principal information found.\"\n end\n return nil\n end",
"title": ""
},
{
"docid": "7ebd452d1b82bc77b2cc4d09cebffa55",
"score": "0.53778994",
"text": "def prop_find(prop_find, node)\n path = prop_find.path\n\n # Checking the read permission\n unless check_privileges(path, '{DAV:}read', R_PARENT, false)\n # User is not allowed to read properties\n\n # Returning false causes the property-fetching system to pretend\n # that the node does not exist, and will cause it to be hidden\n # from listings such as PROPFIND or the browser plugin.\n return false if @hide_nodes_from_listings\n\n # Otherwise we simply mark every property as 403.\n prop_find.requested_properties.each do |requested_property|\n prop_find.set(requested_property, nil, 403)\n end\n\n return true\n end\n\n # Adding principal properties\n if node.is_a?(IPrincipal)\n prop_find.handle(\n '{DAV:}alternate-URI-set',\n -> { Dav::Xml::Property::Href.new(node.alternate_uri_set) }\n )\n prop_find.handle(\n '{DAV:}principal-URL',\n -> { Dav::Xml::Property::Href.new(\"#{node.principal_url}/\") }\n )\n prop_find.handle(\n '{DAV:}group-member-set',\n lambda do\n members = node.group_member_set\n members = members.map { |m| m.gsub(%r{/+$}, '') + '/' }\n Dav::Xml::Property::Href.new(members)\n end\n )\n prop_find.handle(\n '{DAV:}group-membership',\n lambda do\n members = node.group_membership\n members = members.map { |m| m.gsub(%r{/+$}, '') + '/' }\n Dav::Xml::Property::Href.new(members)\n end\n )\n prop_find.handle(\n '{DAV:}displayname',\n node.method(:displayname)\n )\n end\n\n prop_find.handle(\n '{DAV:}principal-collection-set',\n lambda do\n val = @principal_collection_set\n # Ensuring all collections end with a slash\n val = val.map { |v| v + '/' }\n Dav::Xml::Property::Href.new(val)\n end\n )\n prop_find.handle(\n '{DAV:}current-user-principal',\n lambda do\n url = current_user_principal\n if url\n return Xml::Property::Principal.new(Xml::Property::Principal::HREF, url + '/')\n else\n return Xml::Property::Principal.new(Xml::Property::Principal::UNAUTHENTICATED)\n end\n end\n )\n prop_find.handle(\n '{DAV:}supported-privilege-set',\n lambda do\n Xml::Property::SupportedPrivilegeSet.new(supported_privilege_set(node))\n end\n )\n prop_find.handle(\n '{DAV:}current-user-privilege-set',\n lambda do\n if !check_privileges(path, '{DAV:}read-current-user-privilege-set', R_PARENT, false)\n prop_find.set('{DAV:}current-user-privilege-set', null, 403)\n else\n val = current_user_privilege_set(node)\n if val.nil?\n return nil\n else\n return Xml::Property::CurrentUserPrivilegeSet.new(val)\n end\n end\n end\n )\n prop_find.handle(\n '{DAV:}acl',\n lambda do\n # The ACL property contains all the permissions\n if !check_privileges(path, '{DAV:}read-acl', R_PARENT, false)\n prop_find.set('{DAV:}acl', nil, 403)\n else\n acl = acl(node)\n if acl.nil?\n return nil\n else\n return Xml::Property::Acl.new(acl)\n end\n end\n end\n )\n prop_find.handle(\n '{DAV:}acl-restrictions',\n -> { Xml::Property::AclRestrictions.new }\n )\n\n # Adding ACL properties\n if node.is_a?(IAcl)\n prop_find.handle(\n '{DAV:}owner',\n -> { Dav::Xml::Property::Href.new(\"#{node.owner}/\") }\n )\n end\n end",
"title": ""
},
{
"docid": "50dde958d90c86a1544b6f01181f0584",
"score": "0.5361495",
"text": "def principal_search(search_properties, requested_properties, collection_uri = nil, test = 'allof')\n if collection_uri\n uris = [collection_uri]\n else\n uris = @principal_collection_set\n end\n\n lookup_results = []\n uris.each do |uri|\n principal_collection = @server.tree.node_for_path(uri)\n unless principal_collection.is_a?(IPrincipalCollection)\n # Not a principal collection, we're simply going to ignore\n # this.\n next\n end\n\n results = principal_collection.search_principals(search_properties, test)\n results.each do |result|\n lookup_results << uri.gsub(%r{/+$}, '') + '/' + result\n end\n end\n\n matches = []\n\n lookup_results.each do |lookup_result|\n matches << @server.properties_for_path(lookup_result, requested_properties, 0).first\n end\n\n matches\n end",
"title": ""
},
{
"docid": "de43ae8b77b30344c0340eb5d7ead147",
"score": "0.5349934",
"text": "def principal=(value)\n @principal = value\n end",
"title": ""
},
{
"docid": "de43ae8b77b30344c0340eb5d7ead147",
"score": "0.5349934",
"text": "def principal=(value)\n @principal = value\n end",
"title": ""
},
{
"docid": "0325fc0486fed2bc1026811f1d99ce05",
"score": "0.53494155",
"text": "def get_principal_uri name, *host\n # converting emails to usernames, assuming user@email.com has username user\n canonical_name = name.gsub(/@.*/, '') \n if host.empty?\n # relative URI\n principal_uri = '/users/' + canonical_name\n else\n #absolute URI\n principal_uri = host[0] + '/users/' + canonical_name\n end\n return principal_uri\n end",
"title": ""
},
{
"docid": "d7a4124b053eb25b6681e48585edd988",
"score": "0.5306039",
"text": "def find_by_uri(uri, principal_prefix)\n # Note that the default implementation here is a bit slow and could\n # likely be optimized.\n return nil unless uri[0, 7] == 'mailto:'\n\n result = search_principals(\n principal_prefix,\n '{http://sabredav.org/ns}email-address' => uri[7..-1]\n )\n\n result[0]\n end",
"title": ""
},
{
"docid": "6d828dafdfdef036e85b052915db81af",
"score": "0.5294663",
"text": "def principal_url\n end",
"title": ""
},
{
"docid": "fc639804aa61692e2472ef8f6b609383",
"score": "0.5289124",
"text": "def as_principal\n { id: self.id, email: self.email, role: self.role }\n end",
"title": ""
},
{
"docid": "ef2294f5754a21e7de1062c0ad584a65",
"score": "0.5283674",
"text": "def principal_name\n return @principal_name\n end",
"title": ""
},
{
"docid": "ef2294f5754a21e7de1062c0ad584a65",
"score": "0.5283674",
"text": "def principal_name\n return @principal_name\n end",
"title": ""
},
{
"docid": "e71d4d8dd93682bdae1e2cf6d19115df",
"score": "0.52485985",
"text": "def owner\n @object_data['principaluri']\n end",
"title": ""
},
{
"docid": "8adf214c9168d1777715a7e7d8ef0f92",
"score": "0.5180918",
"text": "def get_principal(principal_id)\n principal = nil\n if p_match = principal_id.match(/(.+)-(\\d+)/)\n if $1.classify == UserGroup.to_s\n principal = UserGroup.find($2) \n elsif $1.classify == User.to_s\n principal = User.find($2)\n else\n Exception.new(\"Invalid principal type passed: #{$1}. Must be UserGroup or User.\")\n end\n end\n end",
"title": ""
},
{
"docid": "824db19ccbaa6af1be1213072a164cc7",
"score": "0.51744014",
"text": "def get_principal(list, cm, cl)\n krb_enabled = CM.hadoop_kerberos_enabled?(cm, cl)\n return unless krb_enabled\n principal = list.dig(cm, 'service', 'impala', 'kerberos', 'principal')\n return principal unless principal.nil?\n msg = \"#{cm}: 'service > impala > kerberos > principal'\"\n raise CMUXConfigError, msg\n end",
"title": ""
},
{
"docid": "623fa2908abf81ce21f68d064102c7c5",
"score": "0.51529324",
"text": "def principal_type\n return @principal_type\n end",
"title": ""
},
{
"docid": "aeb3dac9b5868acebdbe8cebb524156d",
"score": "0.5131396",
"text": "def kadm5_find_principal(kadm5, principal)\n kadm5.get_principal(principal)\n rescue Kerberos::Kadm5::PrincipalNotFoundException\n nil\n end",
"title": ""
},
{
"docid": "db30eb14b07893c959ba98acae98ac0d",
"score": "0.5125723",
"text": "def principal_id\n return @principal_id\n end",
"title": ""
},
{
"docid": "db30eb14b07893c959ba98acae98ac0d",
"score": "0.5125723",
"text": "def principal_id\n return @principal_id\n end",
"title": ""
},
{
"docid": "db30eb14b07893c959ba98acae98ac0d",
"score": "0.5125723",
"text": "def principal_id\n return @principal_id\n end",
"title": ""
},
{
"docid": "c959e86970744db63f2548335a189c73",
"score": "0.5124416",
"text": "def name\n uri = @principal_properties['uri']\n name = Http::UrlUtil.split_path(uri)[1]\n name\n end",
"title": ""
},
{
"docid": "944b745b5c44e49f3e1a473b153cd4c8",
"score": "0.51035863",
"text": "def create_principal(path, mk_col)\n end",
"title": ""
},
{
"docid": "d4166e7a495bb4034b06c29ae738a662",
"score": "0.5098683",
"text": "def principal_id\n return @principal_id\n end",
"title": ""
},
{
"docid": "3792601e94a0e1e622176d13e76e914d",
"score": "0.5059148",
"text": "def create_subscription(principal_uri, uri, properties)\n end",
"title": ""
},
{
"docid": "8859ce91aa03d8142d7445e52f0312d2",
"score": "0.50388986",
"text": "def get_principal(list, cm, cl)\n krb_enabled = CM.hbase_kerberos_enabled?(cm, cl)\n return unless krb_enabled\n principal = list.dig(cm, 'service', 'hbase', 'kerberos', 'principal')\n return principal unless principal.nil?\n msg = \"#{cm}: 'service > hbase > kerberos > principal'\"\n raise CMUXConfigError, msg\n end",
"title": ""
},
{
"docid": "ce31c52d5f81d2c56cf378e8f666bce6",
"score": "0.5037046",
"text": "def show\n @principal = Principal.find(params[:id])\n end",
"title": ""
},
{
"docid": "1f98092ebba5ab0a8d592e9d053ea100",
"score": "0.4998664",
"text": "def principal_membership(main_principal)\n # First check our cache\n return @principal_membership_cache[main_principal] if @principal_membership_cache.key?(main_principal)\n\n check = [main_principal]\n principals = []\n\n while check.size > 0\n principal = check.shift\n\n node = @server.tree.node_for_path(principal)\n next unless node.is_a?(IPrincipal)\n node.group_membership.each do |group_member|\n unless principals.include?(group_member)\n check << group_member\n principals << group_member\n end\n end\n end\n\n # Store the result in the cache\n @principal_membership_cache[main_principal] = principals\n\n principals\n end",
"title": ""
},
{
"docid": "09bfac94ff74e45bec11bec841f0d221",
"score": "0.49850744",
"text": "def principal_name(principal)\n case principal.downcase\n when 'authenticated'\n 'system.Authenticated'\n when 'anonymous'\n 'system.Everyone'\n when 'everyone'\n 'system.Everyone'\n else\n principal\n end\n end",
"title": ""
},
{
"docid": "e25fd9d049e55092912ef5b2aa61aacf",
"score": "0.49642724",
"text": "def generalize_principal!\n @principal = RubyDav.generalize_principal @principal if\n @principal.is_a? String\n return self\n end",
"title": ""
},
{
"docid": "4b03f45cc39124aa80b0c7457f750dbf",
"score": "0.4960945",
"text": "def generalize_principal principal\n return principal.sub(@@generalize_principal_rx, '')\n end",
"title": ""
},
{
"docid": "6a92773cc1cc47088e516a2a8fdd4b7d",
"score": "0.4931436",
"text": "def creator\n creators = get_list(@xpaths[\"creators\"])\n return creators.map { |creator| { \"name\" => creator } }\n end",
"title": ""
},
{
"docid": "4c0f975a1c6c18e24eaa060bf9f526ca",
"score": "0.49245694",
"text": "def user_principal_name\n return @user_principal_name\n end",
"title": ""
},
{
"docid": "4c0f975a1c6c18e24eaa060bf9f526ca",
"score": "0.49243528",
"text": "def user_principal_name\n return @user_principal_name\n end",
"title": ""
},
{
"docid": "4c0f975a1c6c18e24eaa060bf9f526ca",
"score": "0.49243528",
"text": "def user_principal_name\n return @user_principal_name\n end",
"title": ""
},
{
"docid": "4c0f975a1c6c18e24eaa060bf9f526ca",
"score": "0.49243528",
"text": "def user_principal_name\n return @user_principal_name\n end",
"title": ""
},
{
"docid": "4c0f975a1c6c18e24eaa060bf9f526ca",
"score": "0.49243528",
"text": "def user_principal_name\n return @user_principal_name\n end",
"title": ""
},
{
"docid": "4c0f975a1c6c18e24eaa060bf9f526ca",
"score": "0.49243528",
"text": "def user_principal_name\n return @user_principal_name\n end",
"title": ""
},
{
"docid": "4c0f975a1c6c18e24eaa060bf9f526ca",
"score": "0.49243528",
"text": "def user_principal_name\n return @user_principal_name\n end",
"title": ""
},
{
"docid": "4c0f975a1c6c18e24eaa060bf9f526ca",
"score": "0.49243528",
"text": "def user_principal_name\n return @user_principal_name\n end",
"title": ""
},
{
"docid": "4c0f975a1c6c18e24eaa060bf9f526ca",
"score": "0.49243528",
"text": "def user_principal_name\n return @user_principal_name\n end",
"title": ""
},
{
"docid": "4c0f975a1c6c18e24eaa060bf9f526ca",
"score": "0.49243528",
"text": "def user_principal_name\n return @user_principal_name\n end",
"title": ""
},
{
"docid": "4c0f975a1c6c18e24eaa060bf9f526ca",
"score": "0.49243528",
"text": "def user_principal_name\n return @user_principal_name\n end",
"title": ""
},
{
"docid": "4c0f975a1c6c18e24eaa060bf9f526ca",
"score": "0.49243528",
"text": "def user_principal_name\n return @user_principal_name\n end",
"title": ""
},
{
"docid": "a39b3f9992e8b986994023d10d397678",
"score": "0.4916521",
"text": "def create_subscription(principal_uri, uri, properties)\n properties['uri'] = uri\n properties['principaluri'] = principal_uri\n properties['source'] = properties['{http://calendarserver.org/ns/}source'].href\n\n @subs[principal_uri] ||= []\n\n id = [principal_uri, @subs[principal_uri].size + 1]\n\n properties['id'] = id\n\n @subs[principal_uri] << properties.merge('id' => id)\n\n id\n end",
"title": ""
},
{
"docid": "7ba6926f08d2483b95bef8857645616b",
"score": "0.49135476",
"text": "def owner\n @subscription_info['principaluri']\n end",
"title": ""
},
{
"docid": "1be19ef9efa7b98940754149b605a017",
"score": "0.49117097",
"text": "def user_principal_name\n return @user_principal_name\n end",
"title": ""
},
{
"docid": "0b7ebc54062ca6367c32051f342e3f7b",
"score": "0.4893955",
"text": "def initialize(principal_backend, principal_prefix = 'principals')\n @disable_listing = false\n @principal_prefix = principal_prefix\n @principal_backend = principal_backend\n end",
"title": ""
},
{
"docid": "be027cafc5209697b67d54b917d561f5",
"score": "0.48864767",
"text": "def set_principal\n @principal = Principal.find(params[:id])\n end",
"title": ""
},
{
"docid": "be027cafc5209697b67d54b917d561f5",
"score": "0.48864767",
"text": "def set_principal\n @principal = Principal.find(params[:id])\n end",
"title": ""
},
{
"docid": "8d8bf22413570fc3bde0a29d411d93b4",
"score": "0.48628423",
"text": "def current_user_principal\n s=\"<D:current-user-principal xmlns:D='DAV:'><D:href>/carddav/</D:href></D:current-user-principal>\"\n Nokogiri::XML::DocumentFragment.parse(s)\n end",
"title": ""
},
{
"docid": "4b80b7199c0a6fa7453e0d18cc5897a8",
"score": "0.4858076",
"text": "def principal_display_name\n return @principal_display_name\n end",
"title": ""
},
{
"docid": "2d1bb2f5fb74b438aecf8f5d67511aee",
"score": "0.4849969",
"text": "def test_principal_uri\n baseuri + get_principal_uri('test2')\n end",
"title": ""
},
{
"docid": "4a313de65f64e6753dbf7bb0904067e7",
"score": "0.48181888",
"text": "def keytab_find_principal(keytab, principal)\n keytab.get_entry(principal)\n rescue Kerberos::Krb5::Keytab::Exception\n nil\n end",
"title": ""
},
{
"docid": "023ee7a05bd5b6a96b4732ab73dbbebc",
"score": "0.47930485",
"text": "def addresses_for_principal(principal)\n cuas = \"{#{NS_CALDAV}}calendar-user-address-set\"\n\n properties = @server.properties(\n principal,\n [cuas]\n )\n\n # If we can't find this information, we'll stop processing\n return [] unless properties.key?(cuas)\n\n addresses = properties[cuas].hrefs\n addresses\n end",
"title": ""
},
{
"docid": "e366f0edde647e69994aa3cfaf909910",
"score": "0.47833017",
"text": "def principal_from_state(state)\n argument_address = state.arg_hash[@address]\n return nil if argument_address.nil?\n root = state.set_nesting.first\n\n principal = locate_principal(argument_address, root)\n return nil,nil if principal.nil?\n\n new_state = state.dup\n new_state.command_path = argument_address[0..-2]\n new_state.arg_hash.delete(principal.name)\n return principal, new_state\n end",
"title": ""
},
{
"docid": "6af86367bf761350835371f0ddf56eb5",
"score": "0.47814772",
"text": "def arcroleURI_attr\n attr('arcroleURI')\n end",
"title": ""
},
{
"docid": "6af86367bf761350835371f0ddf56eb5",
"score": "0.47814772",
"text": "def arcroleURI_attr\n attr('arcroleURI')\n end",
"title": ""
},
{
"docid": "3ee63e22d36c0032d140b00e0c23e8c3",
"score": "0.47738227",
"text": "def current_principal\n @current_principal ||= User.find(:first, :conditions => [\"name = ?\",'joe'], :include => :eager_principal_roles)\n end",
"title": ""
},
{
"docid": "2bf93a5d653264ce53021df50eb67a00",
"score": "0.47543514",
"text": "def name\n name = Http::UrlUtil.split_path(@principal_prefix)[1]\n name\n end",
"title": ""
},
{
"docid": "6e305a44e48349ed873db459a316a88a",
"score": "0.47466865",
"text": "def get_principal_identities_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ManagementPlaneApiNsxComponentAdministrationTrustManagementPrincipalIdentityApi.get_principal_identities ...'\n end\n # resource path\n local_var_path = '/trust-management/principal-identities'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['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 => 'PrincipalIdentityList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ManagementPlaneApiNsxComponentAdministrationTrustManagementPrincipalIdentityApi#get_principal_identities\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "00202908d897e288f6fbad66f99462c3",
"score": "0.47302964",
"text": "def name\n name = Http::UrlUtil.split_path(@principal_info['uri']).second\n name\n end",
"title": ""
},
{
"docid": "fd3be572403bb44af97275205cb27c68",
"score": "0.47203922",
"text": "def show\n @principal = Principal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @principal }\n end\n end",
"title": ""
},
{
"docid": "712ecefd455103b65a889f69b89d221d",
"score": "0.47149318",
"text": "def show\n @principal = Principal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @principal }\n end\n end",
"title": ""
},
{
"docid": "770973ed4ee17e40ff8c163009869376",
"score": "0.4705392",
"text": "def creator\n people = []\n\n header = @xml.xpath(@xpaths[\"creators\"][\"header\"])\n # TODO check all the code when author is in the header because it is fairly involved XSLT\n if header && header.length > 0\n bibl_auth = @xml.xpath(@xpaths[\"creators\"][\"bibl\"])\n header.each do |title_auth|\n if (title_auth.xpath(\"choice/reg\").text == \"unknown\") && (title_auth.xpath(\"choice/orig\").text == \"unsigned\")\n people << { \"name\" => \"Anonymous\", \"id\" => \"\" }\n elsif bibl_auth && bibl_auth.first.xpath(\"choice/reg\").text == \"unknown\" && bibl_auth.first.xpath(\"choice/orig\") != \"unsigned\"\n people << { \"name\" => bibl_auth.first.xpath(\"choice/orig\").text }\n # TODO I have not tested this bibl_auth elsif with any TEI examples!!!\n elsif bibl_auth && bibl_auth.xpath(\"@key\")\n bibl_auth.xpath(\"@key\").each do |bibl|\n people << { \"name\" => bibl.value.gsub(/[\\[\\]]/, \"\"), \"id\" => \"\" }\n end\n else\n people << { \"name\" => Datura::Helpers.normalize_space(title_auth.text), \"id\" => \"\" }\n end\n end\n # if creator is not in the header, then attempt to grab out of the body instead\n else\n persNames = @xml.xpath(@xpaths[\"creators\"][\"in_text\"])\n persNames.each do |pers|\n people << { \"name\" => Datura::Helpers.normalize_space(pers[\"key\"]), id => \"\" }\n end\n end\n people.uniq\n end",
"title": ""
},
{
"docid": "b09a9f3fa3d1ede52357c238dd0092c5",
"score": "0.47028425",
"text": "def graph_service_principal()\n return MicrosoftGraph::Applications::Item::Owners::Item::GraphServicePrincipal::GraphServicePrincipalRequestBuilder.new(@path_parameters, @request_adapter)\n end",
"title": ""
},
{
"docid": "a06a5bd9e5228d5496515ee0b8c18bd0",
"score": "0.46866703",
"text": "def creator\n unless self[Report.creator_predicate].empty?\n User.where(:uri => self[Report.creator_predicate].first.to_s).first\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "5be6a1c7c1783c2731d60aa9221e24ab",
"score": "0.46755117",
"text": "def html_provider\n [\n [\n Principal.new(Principal::UNAUTHENTICATED),\n '<em>unauthenticated</em>'\n ],\n [\n Principal.new(Principal::AUTHENTICATED),\n '<em>authenticated</em>'\n ],\n [\n Principal.new(Principal::ALL),\n '<em>all</em>'\n ],\n [\n Principal.new(Principal::HREF, 'principals/admin'),\n '<a href=\"/principals/admin/\">/principals/admin/</a>'\n ]\n ]\n end",
"title": ""
},
{
"docid": "0fc5069af8ede2e47f2e03d516955a86",
"score": "0.46742174",
"text": "def principal_id=(value)\n @principal_id = value\n end",
"title": ""
},
{
"docid": "afe6b77983fc3f7c606763f6559762d1",
"score": "0.46638498",
"text": "def principal_id=(value)\n @principal_id = value\n end",
"title": ""
},
{
"docid": "afe6b77983fc3f7c606763f6559762d1",
"score": "0.46638498",
"text": "def principal_id=(value)\n @principal_id = value\n end",
"title": ""
},
{
"docid": "afe6b77983fc3f7c606763f6559762d1",
"score": "0.46638498",
"text": "def principal_id=(value)\n @principal_id = value\n end",
"title": ""
},
{
"docid": "cb4739d6a939083474d52dfe82586b77",
"score": "0.46493918",
"text": "def create\n authorize! :index, @user, :message => 'Not authorized.'\n @principal = Principal.new(params[:principal])\n\n respond_to do |format|\n if @principal.save\n format.html { redirect_to @principal, notice: 'Principal was successfully created.' }\n format.json { render json: @principal, status: :created, location: @principal }\n else\n format.html { render action: \"new\" }\n format.json { render json: @principal.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2924361547004aa91fc50b330b813659",
"score": "0.46492016",
"text": "def child(name)\n # Special nodes\n if name == 'inbox' &&\n @caldav_backend.is_a?(Backend::SchedulingSupport)\n return Schedule::Inbox.new(@caldav_backend, @principal_info['uri'])\n end\n if name == 'outbox' &&\n @caldav_backend.is_a?(Backend::SchedulingSupport)\n return Schedule::Outbox.new(@principal_info['uri'])\n end\n if name == 'notifications' &&\n @caldav_backend.is_a?(Backend::NotificationSupport)\n return Notifications::Collection.new(@caldav_backend, @principal_info['uri'])\n end\n\n # Calendars\n @caldav_backend.calendars_for_user(@principal_info['uri']).each do |calendar|\n next unless calendar['uri'] == name\n if @caldav_backend.is_a?(Backend::SharingSupport)\n if calendar.key?('{http://calendarserver.org/ns/}shared-url')\n return SharedCalendar.new(@caldav_backend, calendar)\n else\n return ShareableCalendar.new(@caldav_backend, calendar)\n end\n else\n return Calendar.new(@caldav_backend, calendar)\n end\n end\n\n if @caldav_backend.is_a?(Backend::SubscriptionSupport)\n @caldav_backend.subscriptions_for_user(@principal_info['uri']).each do |subscription|\n return Subscriptions::Subscription.new(@caldav_backend, subscription) if subscription['uri'] == name\n end\n end\n\n fail Dav::Exception::NotFound, \"'Node with name '#{name}' could not be found\"\n end",
"title": ""
},
{
"docid": "2b95f7b2e9e9e427accc474008e8339e",
"score": "0.46358645",
"text": "def child(name)\n principal = @principal_backend.principal_by_path(principal_url + '/' + name)\n\n fail Dav::Exception::NotFound, \"Node with name #{name} was not found\" unless principal\n\n return ProxyRead.new(@principal_backend, @principal_properties) if name == 'calendar-proxy-read'\n return ProxyWrite.new(@principal_backend, @principal_properties) if name == 'calendar-proxy-write'\n\n fail Dav::Exception::NotFound, \"Node with name #{name} was not found\"\n end",
"title": ""
},
{
"docid": "096025917e1392890fd07f81c7570f0b",
"score": "0.46143293",
"text": "def anonymous_user\n if acls_readable?\n data.xpath('cra:repositoryInfo/c:principalAnonymous', NS::COMBINED).text\n end\n end",
"title": ""
},
{
"docid": "07370dbda03288c2901ecb42edda000f",
"score": "0.45834652",
"text": "def service_principal\n return @service_principal\n end",
"title": ""
},
{
"docid": "5fc2286635410f9fa5a48d18f76f1555",
"score": "0.45659712",
"text": "def get_principal_identities(opts = {})\n data, _status_code, _headers = get_principal_identities_with_http_info(opts)\n data\n end",
"title": ""
},
{
"docid": "5d2d7bf7a4a77d1644356adb7e7b42e8",
"score": "0.45611683",
"text": "def principal_email\n return @principal_email\n end",
"title": ""
},
{
"docid": "13bcc886036741fe0c550384e5bbcae9",
"score": "0.45430326",
"text": "def get_node(caller_array)\r\n caller_array.each do |caller_path|\r\n %w(cloud_controller router dea health_manager services stager staging dev_setup vmc).each do |component_name|\r\n return component_name if caller_path.include?(component_name)\r\n end\r\n end\r\n return caller_array.join('/')\r\n end",
"title": ""
},
{
"docid": "95318a8e51385e8c3f63622d5887a14d",
"score": "0.45405552",
"text": "def get_node(fqdn, url, auth_cert, auth_key)\n begin\n # tell the call to use a system/uuid as a ref\n ref = \"nodes\"\n log(:info, \"get_node: Using ref: <#{ref}> to get PuppetDB Node.\")\n\n # get response and convert to json\n response = call_rest(:get, url, auth_cert, auth_key, ref, :json, nil)\n\n # validate response and return system object\n if response\n log(:info, \"get_node: Inspecting response: #{response.inspect}\") if @debug\n log(:info, \"get_node: Inspecting response body: #{response.body.inspect}\") if @debug\n\n if response.code == GET_NODE_SUCCESS_CODE\n log(:info, \"get_node: Successfully retrieved nodes from PuppetDB for system: #{fqdn}\")\n nodes = JSON.parse(response.body)\n log(:info, \"get_node: Inspecting nodes: #{nodes.inspect}\") if @debug\n\n # get the node and return it\n node = nodes.select { |n| n['certname'] == fqdn }\n else\n log(:warn, \"get_node: Unable to retrieve node object from PuppetDB for system: #{fqdn}. Returning empty array.\")\n return []\n end\n else\n raise \"Invalid Response: #{response.inspect}\"\n end\n rescue => err\n # log and backtrace the error\n log(:error, \"[#{err}]\\n#{err.backtrace.join(\"\\n\")}\")\n log(:error, \"get_node: #{err}. Returning nil.\")\n return nil\n end\nend",
"title": ""
},
{
"docid": "438328f4f4e618a9f15553803396393e",
"score": "0.4538934",
"text": "def principal_list(array)\n array_to_string(array)\n end",
"title": ""
},
{
"docid": "5644aa2dd42ada25ffc2116a46186ecf",
"score": "0.45328954",
"text": "def creator\n unless self[Comment.creator_predicate].empty?\n User.where(:uri => self[Comment.creator_predicate].first.to_s).first\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "0f29ae650b4ce474e69ac562df8e2ea8",
"score": "0.45203432",
"text": "def external_principal_id\n return @external_principal_id\n end",
"title": ""
},
{
"docid": "723fd1da6b6cd417b010811362509d4c",
"score": "0.45123264",
"text": "def principal_name=(value)\n @principal_name = value\n end",
"title": ""
}
] |
4009f5cdf21c59d36db60a5d44edda83
|
REGISTER MUST EQUAL THIS METHOD
|
[
{
"docid": "ef35d636c9c6f1a77d09d36bef4ea6e5",
"score": "0.0",
"text": "def add(stack, register)\n value = stack.pop\n register = register + value\nend",
"title": ""
}
] |
[
{
"docid": "706ce5b01190c0b1a7ec0680575e4aa3",
"score": "0.7390158",
"text": "def register; end",
"title": ""
},
{
"docid": "23d67defd4fbcf6a4404ec0c28651ca7",
"score": "0.7129588",
"text": "def register\n end",
"title": ""
},
{
"docid": "09df31aea3fc669d3f1b506fc8d5a8c5",
"score": "0.71106046",
"text": "def register\n\tend",
"title": ""
},
{
"docid": "09df31aea3fc669d3f1b506fc8d5a8c5",
"score": "0.71106046",
"text": "def register\n\tend",
"title": ""
},
{
"docid": "ca1dfea8c4e7d779a2c22178e3465229",
"score": "0.70868653",
"text": "def register\n end",
"title": ""
},
{
"docid": "ca1dfea8c4e7d779a2c22178e3465229",
"score": "0.70868653",
"text": "def register\n end",
"title": ""
},
{
"docid": "ca1dfea8c4e7d779a2c22178e3465229",
"score": "0.70868653",
"text": "def register\n end",
"title": ""
},
{
"docid": "ca1dfea8c4e7d779a2c22178e3465229",
"score": "0.70868653",
"text": "def register\n end",
"title": ""
},
{
"docid": "a39b2e915db1f59b38f93e3d13b72a1d",
"score": "0.7040343",
"text": "def register\n \n end",
"title": ""
},
{
"docid": "34cc4d1700881eb632806cd947872aa0",
"score": "0.70286727",
"text": "def method_missing(meth, *args, &block)\n add_code ::Register::RegisterMachine.instance.send(meth , *args)\n end",
"title": ""
},
{
"docid": "ed4840bee79eb20d80c6f90d332ecc66",
"score": "0.6942809",
"text": "def register(_arg0, _arg1); end",
"title": ""
},
{
"docid": "d60d06775d2b34f4802dc82c2872e59a",
"score": "0.69326615",
"text": "def register!\n guarded do\n write_to_register\n end\n end",
"title": ""
},
{
"docid": "5c313e66107d3647f3865802306a87fc",
"score": "0.67778414",
"text": "def registered=(_arg0); end",
"title": ""
},
{
"docid": "e50553ef0322f12b44bcf176f2416745",
"score": "0.67425853",
"text": "def registered?; end",
"title": ""
},
{
"docid": "af81c3354a7777d3dcc02af74b87df0e",
"score": "0.6722953",
"text": "def registered; end",
"title": ""
},
{
"docid": "af81c3354a7777d3dcc02af74b87df0e",
"score": "0.6722953",
"text": "def registered; end",
"title": ""
},
{
"docid": "e433cf52ada2ead82ab3f2822d4f538b",
"score": "0.6687838",
"text": "def register(r)\n self.registers[r] ||= 0\n end",
"title": ""
},
{
"docid": "951bb8116056a6cc005b45dcbab7ede7",
"score": "0.6657642",
"text": "def register(params)\nend",
"title": ""
},
{
"docid": "951bb8116056a6cc005b45dcbab7ede7",
"score": "0.6657642",
"text": "def register(params)\nend",
"title": ""
},
{
"docid": "3cedd2f2564a3db9938ec0b88f44ecb3",
"score": "0.6627704",
"text": "def register(params)\n\nend",
"title": ""
},
{
"docid": "69bf5236985650b1741c176483bfddda",
"score": "0.65493387",
"text": "def register(object); end",
"title": ""
},
{
"docid": "849bbc6c48a660db4febc8594f8c679e",
"score": "0.64930856",
"text": "def register\n code.registered\n end",
"title": ""
},
{
"docid": "75e8c6b7763217ab974c3a8447ec70fc",
"score": "0.64361185",
"text": "def registers()\n @registers\n end",
"title": ""
},
{
"docid": "74bd0f7f9307f1a9027f0abb0b812d78",
"score": "0.6408086",
"text": "def registers\n @registers ||= {}\n end",
"title": ""
},
{
"docid": "74bd0f7f9307f1a9027f0abb0b812d78",
"score": "0.6408086",
"text": "def registers\n @registers ||= {}\n end",
"title": ""
},
{
"docid": "8560db0a51889bb2e55085a926c74d69",
"score": "0.6368799",
"text": "def register(short, long); end",
"title": ""
},
{
"docid": "f3a9cc01c201a18c796e8cd0bc5edb08",
"score": "0.6359901",
"text": "def register(*args)\n raise NotImplementedError\n end",
"title": ""
},
{
"docid": "875bda579c6ad0ef1bd31cabbc68fbb3",
"score": "0.63479906",
"text": "def register?\n false\n end",
"title": ""
},
{
"docid": "1151c157146256df7232741761ac84a4",
"score": "0.63379204",
"text": "def registration\n end",
"title": ""
},
{
"docid": "cd42bb5185a11de27cc2f4c61b7317f9",
"score": "0.6334216",
"text": "def register_success\n end",
"title": ""
},
{
"docid": "5bc8ea75cbe137a0fca65155fe1132a8",
"score": "0.63233066",
"text": "def finish_register\n end",
"title": ""
},
{
"docid": "86ee82f805720dea1bb8518efb2fc8e9",
"score": "0.63091284",
"text": "def reg\n @reg ||= 0\n @reg += 1\n end",
"title": ""
},
{
"docid": "1e0af4b5a147d30a9ec6017129ca3e72",
"score": "0.62818277",
"text": "def registered!\n @registered = true\n end",
"title": ""
},
{
"docid": "ba0c3ae742064426de95e4d3c688c0ab",
"score": "0.62737596",
"text": "def registered?(_arg0); end",
"title": ""
},
{
"docid": "e86851dfc94b541804c30017355dd90c",
"score": "0.62592024",
"text": "def registered; @@registered; end",
"title": ""
},
{
"docid": "2511589363ab401d7e9633bbfa8f9600",
"score": "0.6246559",
"text": "def test_register_get_set\n reg = Register.new(:int, 'A')\n assert_equal 'A', reg.value\n reg.value = 'B'\n assert_equal 'B', reg.value\n end",
"title": ""
},
{
"docid": "7f167e72bd7b2f1eb109d6879f7ac274",
"score": "0.6205081",
"text": "def test_register_use\n Register.use 'B'\n assert_equal 'B', Register.use_get(:int).value\n Register.use 'C'\n assert_equal 'C', Register.use_get(:int).value\n Register.end_use\n assert_equal 'B', Register.use_get(:int).value\n Register.end_use\n assert_equal 'A', Register.use_get(:int).value\n end",
"title": ""
},
{
"docid": "cbf341de6afca1726bff7c4d378cdbb2",
"score": "0.619186",
"text": "def register sym, val\n\n end",
"title": ""
},
{
"docid": "21d20cf3237524b0e854eda31fd43948",
"score": "0.61389893",
"text": "def next_reg_use( type , extra = {} )\n int = @symbol[1,3].to_i\n raise \"No more registers #{self}\" if int > 11\n sym = \"r#{int + 1}\".to_sym\n RegisterValue.new( sym , type, extra)\n end",
"title": ""
},
{
"docid": "1f3e51dab6bae176b0cf9c8f09713faa",
"score": "0.61383426",
"text": "def register\n send registration_packet\n end",
"title": ""
},
{
"docid": "d60bf7d8390a3b8a4a63f019ff9a6df7",
"score": "0.61344",
"text": "def _register_value( regnum, size=nil )\n nil\n end",
"title": ""
},
{
"docid": "f7aab17e6b417d5f283fe228960bae54",
"score": "0.6105095",
"text": "def wrap_register reg\n return reg if reg.is_a? RegisterReference\n RegisterReference.new(reg)\n end",
"title": ""
},
{
"docid": "aa6fc6c27b4678eedcc26829e71067b5",
"score": "0.6063559",
"text": "def register_for(id); end",
"title": ""
},
{
"docid": "8bde281140c97d171a83246193b65119",
"score": "0.6062948",
"text": "def registry; end",
"title": ""
},
{
"docid": "8bde281140c97d171a83246193b65119",
"score": "0.6062948",
"text": "def registry; end",
"title": ""
},
{
"docid": "8bde281140c97d171a83246193b65119",
"score": "0.6062948",
"text": "def registry; end",
"title": ""
},
{
"docid": "8bde281140c97d171a83246193b65119",
"score": "0.6062948",
"text": "def registry; end",
"title": ""
},
{
"docid": "8bde281140c97d171a83246193b65119",
"score": "0.6062948",
"text": "def registry; end",
"title": ""
},
{
"docid": "420f082a101dbdc908d9dc7a9e0aea83",
"score": "0.6016406",
"text": "def method_missing(meth, *args, &block)\n var = meth.to_s[0 ... -1]\n if( args.length == 1) and ( meth.to_s[-1] == \"=\" )\n if @scope.local_variable_defined? var.to_sym\n l_val = @scope.local_variable_get var.to_sym\n return add_code l_val.assign(args[0])\n else\n return super\n end\n end\n add_code RegisterMachine.instance.send(meth , *args)\n end",
"title": ""
},
{
"docid": "190d3929511406802ece144ea010fbed",
"score": "0.59752965",
"text": "def register\n options[:register] = true\n end",
"title": ""
},
{
"docid": "c9234159f44a3958dcadcd71102a79ce",
"score": "0.59730136",
"text": "def register(var)\n @registers[var] ||= (10 + @registers.length)\n end",
"title": ""
},
{
"docid": "a920ecf68d68e950afa5b4809e427622",
"score": "0.5959716",
"text": "def register name = \"temp\"\n Registers::Temp.new name, \"r64\"\n end",
"title": ""
},
{
"docid": "5a77661f66a22ec3ae7101153d7518b0",
"score": "0.59509975",
"text": "def register(params)\n @params = params\nend",
"title": ""
},
{
"docid": "6ed01bc5df87af1ece7cb1b4b16e5b86",
"score": "0.5906117",
"text": "def next_reg_use by = 1\n int = @symbol[1,3].to_i\n sym = \"r#{int + by}\".to_sym\n RegisterReference.new( sym )\n end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "61713beb4935edd615520ce8463651d8",
"score": "0.5901564",
"text": "def dynamic_registration; end",
"title": ""
},
{
"docid": "2303f9948fb408ee9579ca2b36067ef2",
"score": "0.5900331",
"text": "def register(name, instance); end",
"title": ""
},
{
"docid": "dac837e6ad5262abd44795ec7144ddc6",
"score": "0.588948",
"text": "def registers= reg\n @registers = reg\n @free_registers = @registers.dup\n end",
"title": ""
},
{
"docid": "da4a0caec79d6c5ddcbbe141d7135bb2",
"score": "0.5887393",
"text": "def registrations; end",
"title": ""
},
{
"docid": "da4a0caec79d6c5ddcbbe141d7135bb2",
"score": "0.5887393",
"text": "def registrations; end",
"title": ""
},
{
"docid": "da4a0caec79d6c5ddcbbe141d7135bb2",
"score": "0.5887393",
"text": "def registrations; end",
"title": ""
},
{
"docid": "9560a9fd12efcca1229596d0b9c2001b",
"score": "0.5869426",
"text": "def <<( reg )\n raise \"not reg #{reg}\" unless reg.is_a?(RegisterValue)\n reg_to_slot = Risc.reg_to_slot(\"#{reg.class_name} -> #{register.class_name}[#{index}]\" , reg , register, index)\n builder.add_code(reg_to_slot) if builder\n reg_to_slot\n end",
"title": ""
},
{
"docid": "e923e645f3a596b69e6b2685bdc23879",
"score": "0.58600765",
"text": "def register\n\n self.client.send_regreq(self)\n res = wait_for( IAX_SUBTYPE_REGAUTH, IAX_SUBTYPE_REGREJ )\n return if not res\n\n if res[1] == IAX_SUBTYPE_REGREJ\n reason = res[2][IAX_IE_REGREJ_CAUSE] || \"Unknown Reason\"\n dprint(\"REGREJ: #{reason}\")\n # Acknowledge the REGREJ\n self.client.send_ack(self)\n return\n end\n\n chall = nil\n\n # Look for IAX_AUTH_MD5 (2) as an available auth method\n if res[2][14].unpack(\"n\")[0] & 2 <= 0\n dprint(\"REGAUTH: MD5 authentication is not enabled on the server\")\n return\n end\n\n if res[2][IAX_IE_CHALLENGE_DATA]\n self.dcall = res[0][0]\n chall = res[2][IAX_IE_CHALLENGE_DATA]\n end\n\n if chall.nil?\n dprint(\"REGAUTH: No challenge data received\")\n return\n end\n\n self.client.send_regreq_chall_response(self, chall)\n res = wait_for( IAX_SUBTYPE_REGACK, IAX_SUBTYPE_REGREJ )\n return if not res\n\n if res[1] == IAX_SUBTYPE_REGREJ\n reason = res[2][IAX_IE_REGREJ_CAUSE] || \"Unknown Reason\"\n dprint(\"REGREJ: #{reason}\")\n return\n end\n\n if res[2][IAX_IE_APPARENT_ADDR]\n r_fam, r_port, r_addr = res[2][IAX_IE_APPARENT_ADDR].unpack('nnA4')\n r_addr = r_addr.unpack(\"C*\").map{|x| x.to_s }.join(\".\")\n dprint(\"REGACK: Registered from address #{r_addr}:#{r_port}\")\n end\n\n # Acknowledge the REGACK\n self.client.send_ack(self)\n\n self.state = :registered\n\n true\n end",
"title": ""
},
{
"docid": "a2b009cb004491073c89a4e6229401e8",
"score": "0.58385736",
"text": "def register!(*args, &block)\n register(*args, &block)\n call(args.first)\n end",
"title": ""
},
{
"docid": "51bd234be36bca82c5906b71923089ba",
"score": "0.58344126",
"text": "def register_coder(coder); end",
"title": ""
},
{
"docid": "8956ac636bae47d18399486d3143f177",
"score": "0.5830953",
"text": "def register?\n value.kind_of? Bgo::Register\n end",
"title": ""
},
{
"docid": "8861cc0fcc93fc57ad6d040bff765504",
"score": "0.581859",
"text": "def registry=(_arg0); end",
"title": ""
},
{
"docid": "c7c7a961f022fd61971c6bd7af317d26",
"score": "0.581689",
"text": "def register()\n # Verify correctness of the request\n verify_origin()\n verify_request()\n\n # Execute the action associated with the request\n execute()\n\n save!\n end",
"title": ""
},
{
"docid": "32a28d0d67c26e0d10db39a9c68dac9b",
"score": "0.58018184",
"text": "def reg_write(reg, val)\n raise NotImplementedError, 'Abstract method'\n end",
"title": ""
},
{
"docid": "86a6b0d5803793210c939c8c38ea622a",
"score": "0.58009785",
"text": "def registered=(value)\n self.class.registered = value\n end",
"title": ""
}
] |
9c6adf2e9a1b047b56844da48bea7b38
|
Returns the UID, the UID where the Bricklet is connected to, the position, the hardware and firmware version as well as the device identifier. The position can be 'a', 'b', 'c' or 'd'. The device identifiers can be found :ref:`here `. .. versionadded:: 2.0.0~(Plugin)
|
[
{
"docid": "4199bf34a8321956c383cfade648c6cf",
"score": "0.0",
"text": "def get_identity\n send_request(FUNCTION_GET_IDENTITY, [], '', 25, 'Z8 Z8 k C3 C3 S')\n end",
"title": ""
}
] |
[
{
"docid": "38014bee9d55625708880540e64e8bf4",
"score": "0.5757256",
"text": "def uid() \n @uid ||= command && [command.uid, ident].compact.join(\".\").sub(/!\\./, \".\") \n end",
"title": ""
},
{
"docid": "5eb933b0d0e2b85413105e02e42d1940",
"score": "0.5740657",
"text": "def identifier()\n # First let's short circuit for the simulator.\n # We need a good enough device name.\n if LVGL::Introspection.simulator?\n # Safe~ish assumption for the simulator.\n return device_uefi\n end\n\n # Then let's try with the device tree compatible.\n if File.exists?(\"/proc/device-tree/compatible\") then\n # Let's take the most precise compatible name.\n compatible = File.read(\"/proc/device-tree/compatible\").split(\"\\0\").first\n\n case compatible\n when /^pine64,pinephone-pro/\n return \"pine64-pinephonepro\"\n when /^pine64,pinephone/\n return \"pine64-pinephone\"\n when /^pine64,pinetab/\n return \"pine64-pinetab\"\n when /^google,krane/\n return \"lenovo-krane\"\n when /^google,wormdingler/\n return \"lenovo-wormdingler\"\n when /^google,scarlet/\n # TODO: detect the actual scarlet model...\n return \"asus-dumo\"\n end\n end\n\n # Uh, no device tree? no problem!\n # Let's try and detect the device with its DMI info\n if File.exists?(\"/sys/class/dmi/id/product_name\")\n product_name = File.read(\"/sys/class/dmi/id/product_name\")\n # Bogus example of an UEFI system detection\n #case product_name\n #when \"Jupiter\"\n # return \"valve-jupiter\"\n #end\n end\n\n # Oh, still nothing specific? Let's hope it's just generic UEFI!\n if is_uefi\n return device_uefi\n end\n\n # This shouldn't really happen. We won't produce builds without some way\n # to detect the device identifier.\n \"... unknown device ...\"\n end",
"title": ""
},
{
"docid": "79803c1a29b6c68e7836d77bec9e503b",
"score": "0.565398",
"text": "def device_id\n response = meta(nil,:info).first\n manufacturer = response[/^Manufacturer: (.*)/,1].strip\n model = response[/^Model: (.*)/,1].strip\n revision = response[/^Revision: (.*)/,1].strip\n imei = response[/^IMEI: (.*)/,1].strip\n return '%s %s, IMEI: %s' % [manufacturer.capitalize,model,imei]\n end",
"title": ""
},
{
"docid": "2861b2a4f652010233f3fbec5f9443e3",
"score": "0.56083864",
"text": "def uid\n proptext 'UID'\n end",
"title": ""
},
{
"docid": "1baf96d83d400f9f5f1d4e3eb1dfbdaf",
"score": "0.5573279",
"text": "def product_id\n @product_id ||= usb_device.idProduct\n end",
"title": ""
},
{
"docid": "fc4dc208ba978ab71994259850093baa",
"score": "0.5527995",
"text": "def manufacturer_id\n mac[0..7]\n end",
"title": ""
},
{
"docid": "50d68ee908d0ed70d66f082b00bf5d76",
"score": "0.55232865",
"text": "def get_uid(urec)\n \"User Id: #{urec['user_id']}, Gear: #{urec['gear_id']}, UsageType: #{urec['usage_type']}\"\n end",
"title": ""
},
{
"docid": "4b3b83b4167cf3e53ba8e5ab76585e36",
"score": "0.5507139",
"text": "def uid\n getUID\n end",
"title": ""
},
{
"docid": "45e16238aacd555ade336f861e754087",
"score": "0.55035746",
"text": "def fullName\n \"#{device.name} (#{os.id})\"\n end",
"title": ""
},
{
"docid": "9589a37ea6ab8992ed1b2a9f87d99085",
"score": "0.54784185",
"text": "def uid; end",
"title": ""
},
{
"docid": "9589a37ea6ab8992ed1b2a9f87d99085",
"score": "0.54784185",
"text": "def uid; end",
"title": ""
},
{
"docid": "9589a37ea6ab8992ed1b2a9f87d99085",
"score": "0.54784185",
"text": "def uid; end",
"title": ""
},
{
"docid": "9589a37ea6ab8992ed1b2a9f87d99085",
"score": "0.54784185",
"text": "def uid; end",
"title": ""
},
{
"docid": "88e69ca5231a49da937743b18fd6e1a7",
"score": "0.5474022",
"text": "def uid\n @uid\n end",
"title": ""
},
{
"docid": "9da3fb737bf582cd56153a68370882d6",
"score": "0.546898",
"text": "def uid\n pdc_id.split('/').last\n end",
"title": ""
},
{
"docid": "f1d3955cb36be37f6802f46a8ad52de4",
"score": "0.54628825",
"text": "def device_id\n 'living-room'\n end",
"title": ""
},
{
"docid": "d9fe08af5c9dc3be6ca54ba91cfebe3b",
"score": "0.5442239",
"text": "def device_uid\n # Not using superclass_delegating_reader. See +site+ for explanation\n if defined?(@device_uid)\n @device_uid\n elsif superclass != Object && superclass.device_uid\n superclass.device_uid.dup.freeze\n end\n end",
"title": ""
},
{
"docid": "fa9b9ca8a424c90a2625eb4cd73485cb",
"score": "0.54407454",
"text": "def build_uid(product)\n \"#{product[@brand]}#{product[@code]}\".downcase\n end",
"title": ""
},
{
"docid": "b56e36a49f7170893ab6c92703388540",
"score": "0.5434827",
"text": "def get_user_from_serial\n device_info = DeviceInfo.find_by_serial_number(serial_number)\n user_id = device_info.user_id unless device_info.blank?\n end",
"title": ""
},
{
"docid": "9c540131c30639b7c131f643bc017b65",
"score": "0.54259795",
"text": "def uid\n if respond_to?(:id)\n return nil if id.nil?\n\n id.to_s\n else\n raise NotImplementedError\n end\n end",
"title": ""
},
{
"docid": "662de5a190b56e6d73ad05f10614c9b3",
"score": "0.53944284",
"text": "def vendor_id\n @vendor_id ||= usb_device.idVendor\n end",
"title": ""
},
{
"docid": "887e2eed7584b7895c82cfd0196aacc8",
"score": "0.5378068",
"text": "def puid_hex\n self.puid.unpack('H*').first\n end",
"title": ""
},
{
"docid": "5ba1f7720baa609bd4c73abded5d5fc1",
"score": "0.5355555",
"text": "def uid\n if respond_to?(:id)\n return nil if self.id.nil?\n self.id.to_s\n else\n raise NotImplementedError \n end\n end",
"title": ""
},
{
"docid": "fb01731f68f9b9ff753619b5cc094bb0",
"score": "0.5332178",
"text": "def device_id\n devices.first.dev_id if devices.present?\n end",
"title": ""
},
{
"docid": "d2066965b88851a9ec97cf464d86dbcf",
"score": "0.5322886",
"text": "def bcpc_uuid_for_device(dev_name)\n require 'mixlib/shellout'\n\n blkid_command = Mixlib::ShellOut.new('blkid', dev_name)\n blkid_command.run_command\n\n if blkid_command.status.success?\n begin\n blkid_command.stdout.match(/UUID=\"(.*?)\"/)[1]\n rescue\n Chef::Log.debug(\"No UUID found for '#{dev_name}'\")\n nil\n end\n else\n Chef::Log.warn(\"Failed to run blkid on '#{dev_name}'\")\n nil\n end\nend",
"title": ""
},
{
"docid": "3ea2f1a106e7148ab4a0bc9ab5878c43",
"score": "0.53145033",
"text": "def uid\n @data[\"rawId\"]\n end",
"title": ""
},
{
"docid": "ca121b4069e573e4e08298dcc3941dae",
"score": "0.52868205",
"text": "def device_address\n Call.libusb_get_device_address(@pDev)\n end",
"title": ""
},
{
"docid": "2bb9434084ba08d5c4de604b994b9c01",
"score": "0.5270731",
"text": "def device_id\n return @device_id\n end",
"title": ""
},
{
"docid": "2bb9434084ba08d5c4de604b994b9c01",
"score": "0.5270731",
"text": "def device_id\n return @device_id\n end",
"title": ""
},
{
"docid": "2bb9434084ba08d5c4de604b994b9c01",
"score": "0.5270731",
"text": "def device_id\n return @device_id\n end",
"title": ""
},
{
"docid": "2bb9434084ba08d5c4de604b994b9c01",
"score": "0.5270731",
"text": "def device_id\n return @device_id\n end",
"title": ""
},
{
"docid": "2bb9434084ba08d5c4de604b994b9c01",
"score": "0.5270731",
"text": "def device_id\n return @device_id\n end",
"title": ""
},
{
"docid": "2bb9434084ba08d5c4de604b994b9c01",
"score": "0.5270731",
"text": "def device_id\n return @device_id\n end",
"title": ""
},
{
"docid": "2bb9434084ba08d5c4de604b994b9c01",
"score": "0.5270731",
"text": "def device_id\n return @device_id\n end",
"title": ""
},
{
"docid": "2bb9434084ba08d5c4de604b994b9c01",
"score": "0.5270731",
"text": "def device_id\n return @device_id\n end",
"title": ""
},
{
"docid": "99a9a4e54b0a9044eee553e39dd573a9",
"score": "0.52647555",
"text": "def uid\n \"#{Feature.uid_prefix}-#{self.fid}\"\n end",
"title": ""
},
{
"docid": "48d88834f36129e49ed3c5bd7c81d4ab",
"score": "0.52633387",
"text": "def getuid\n\t\trequest = Packet.create_request('stdapi_sys_config_getuid')\n\t\tresponse = client.send_request(request)\n\t\treturn response.get_tlv_value(TLV_TYPE_USER_NAME)\n\tend",
"title": ""
},
{
"docid": "5de689e8b404c60c2230fe8cc1bd39fd",
"score": "0.5255619",
"text": "def uid\n read_attribute :uid\n end",
"title": ""
},
{
"docid": "ea33f7e8fedd07b580c0a7737ad41db0",
"score": "0.5249697",
"text": "def device_id\n attributes[:device_id]\n end",
"title": ""
},
{
"docid": "47b2659c4d35131387f93f5a8f65f89d",
"score": "0.52297443",
"text": "def uuid\n character_data.uuid\n end",
"title": ""
},
{
"docid": "68ae6e71231df5f1bed18f4bcf583457",
"score": "0.5227625",
"text": "def component_id\n unless id = attribute_get(:component_id)\n #self.component_id ||= GURN.create(self.uuid.to_s, self)\n #return GURN.create(self.uuid.to_s, { :model => self.class })\n if self.urn\n return GURN.create(self.urn, { :model => self.class })\n else\n return GURN.create(self.name, { :model => self.class })\n end\n end\n id\n end",
"title": ""
},
{
"docid": "c2355bc7f3e7a50f4ed75f47b5f8b22d",
"score": "0.5223408",
"text": "def bus_number\n Call.libusb_get_bus_number(@pDev)\n end",
"title": ""
},
{
"docid": "43bf6e482f0811694888633c3978803c",
"score": "0.5223341",
"text": "def get_uid\n details_cell.each do |cell|\n cell.text if cell.text.match?(TMP_ID_REGEXP)\n end\n end",
"title": ""
},
{
"docid": "55411e0aef994f37080bf5d701611fe3",
"score": "0.5200116",
"text": "def hive_mind_device_identifiers\n { id: @device_id }\n end",
"title": ""
},
{
"docid": "0498c02cac1edb409755aad6424a90fb",
"score": "0.5177605",
"text": "def get_uuid(device)\n Chef::Log.info(\"Getting uuid for device: #{device}\")\n fs_check = Mixlib::ShellOut.new(\"blkid -c /dev/null #{device}\")\n fs_check.run_command\n match = fs_check.stdout.match(/\\sUUID=\"(.*?)\"/)\n match = '' if match.nil?\n Chef::Log.info(\"uuid for device: #{device} is #{match[1]}\")\n match[1]\nend",
"title": ""
},
{
"docid": "0498c02cac1edb409755aad6424a90fb",
"score": "0.5177605",
"text": "def get_uuid(device)\n Chef::Log.info(\"Getting uuid for device: #{device}\")\n fs_check = Mixlib::ShellOut.new(\"blkid -c /dev/null #{device}\")\n fs_check.run_command\n match = fs_check.stdout.match(/\\sUUID=\"(.*?)\"/)\n match = '' if match.nil?\n Chef::Log.info(\"uuid for device: #{device} is #{match[1]}\")\n match[1]\nend",
"title": ""
},
{
"docid": "cfb8c7fd5f38c681f3b24edcf919de12",
"score": "0.51678926",
"text": "def uuid\n value = \"\"\n Cproton.pn_data_get_uuid(@impl).each{|val| value += (\"%02x\" % val)}\n value.insert(8, \"-\").insert(13, \"-\").insert(18, \"-\").insert(23, \"-\")\n end",
"title": ""
},
{
"docid": "8d020baa77cc270ae2347441a858f87f",
"score": "0.5157909",
"text": "def _uid(uuid = @uuid)\n uuid && uuid[0,6]\n end",
"title": ""
},
{
"docid": "8b37925b91947150c0f2652134407557",
"score": "0.5154154",
"text": "def uidnumber\n attributes['uidnumber']\n end",
"title": ""
},
{
"docid": "812f8baca7c67bfea9d9225dcd03e765",
"score": "0.5140536",
"text": "def uid\n @name.to_s.downcase.gsub(/[^a-z0-9]+/, '').gsub(/-+$/, '').gsub(/^-+$/, '').to_sym\n end",
"title": ""
},
{
"docid": "f8198efa5cf32991a16a58bee4750438",
"score": "0.51328516",
"text": "def current_system_id\n matched_contact = active_matched_contact\n\n return nil unless matched_contact\n\n matched_contact[\"Id\"] # This is the wildapricot ID\n end",
"title": ""
},
{
"docid": "d0a413acfee8168eca508aff260814b0",
"score": "0.51234865",
"text": "def get_device_info\n IO.popen('adb shell getprop ro.product.brand') { |f| $device = f.gets.chomp.upcase}\n $device += ' '\n IO.popen('adb shell getprop ro.product.model') { |f| $device += f.gets.chomp.upcase}\n IO.popen('adb shell getprop ro.build.version.release') { |f| $os_version = f.gets.chomp.upcase}\n return $device, $os_version\nend",
"title": ""
},
{
"docid": "5aa1385de526610b3de33697c15d2290",
"score": "0.511556",
"text": "def uid\n return @uid if @uid.present?\n\n @uid = if @openshift_object.present? # no openshift_object reloading here (cycle)\n @openshift_object.metadata.labels[LABEL_UNIQUE]\n else\n config_map&.uid\n end\n end",
"title": ""
},
{
"docid": "5aa1385de526610b3de33697c15d2290",
"score": "0.511556",
"text": "def uid\n return @uid if @uid.present?\n\n @uid = if @openshift_object.present? # no openshift_object reloading here (cycle)\n @openshift_object.metadata.labels[LABEL_UNIQUE]\n else\n config_map&.uid\n end\n end",
"title": ""
},
{
"docid": "5aa1385de526610b3de33697c15d2290",
"score": "0.511556",
"text": "def uid\n return @uid if @uid.present?\n\n @uid = if @openshift_object.present? # no openshift_object reloading here (cycle)\n @openshift_object.metadata.labels[LABEL_UNIQUE]\n else\n config_map&.uid\n end\n end",
"title": ""
},
{
"docid": "0484b249c0d2ec8f7aed38a690d078d3",
"score": "0.51139915",
"text": "def nuid\n self.uid\n end",
"title": ""
},
{
"docid": "438cdef32c5a959dd2bc98ca79b8d8d2",
"score": "0.5102916",
"text": "def uid\n @namsid = open(\"|getent passwd #{@username}\").read.chomp.split(\":\")[2]\n end",
"title": ""
},
{
"docid": "198ffa1997208edca5a556dd6cc9f653",
"score": "0.51004386",
"text": "def device\n device_detector.device_name\n end",
"title": ""
},
{
"docid": "0717a8d790c3e3bd5e68f11e95c4f71a",
"score": "0.50988686",
"text": "def uuid\n ref_call :get_uuid\n end",
"title": ""
},
{
"docid": "9ecf702281793dc118da38c61f5c6206",
"score": "0.5098459",
"text": "def uuid\n value = \"\"\n Cproton.pn_data_get_uuid(@data).each{|val| value += (\"%02x\" % val)}\n value.insert(8, \"-\").insert(13, \"-\").insert(18, \"-\").insert(23, \"-\")\n end",
"title": ""
},
{
"docid": "89b096202f06e9d0835fc1b107f840ff",
"score": "0.5083881",
"text": "def get_uuid(device)\n Chef::Log.info(\"Getting uuid for device: #{device}\")\n match = shell_out(\"blkid -c /dev/null #{device}\").stdout.match(/\\sUUID=\"(.*?)\"/)\n match = '' if match.nil?\n Chef::Log.info(\"uuid for device: #{device} is #{match[1]}\")\n match[1]\nend",
"title": ""
},
{
"docid": "07c94e4a43d369e630c703a1d5042854",
"score": "0.5080441",
"text": "def get_uuid(job)\n title = get_title( job )\n company = get_company( job )\n location = get_location( job )\n \n uuid = Seeker::Utils.uuid(title, company, location)\n end",
"title": ""
},
{
"docid": "b18d24b21a60b5a88ddac8fabe9de882",
"score": "0.5076382",
"text": "def vendor_string\n eax, ebx, ecx, edx = run_function(VENDOR_ID_FN)\n register_to_s(ebx) + register_to_s(edx) + register_to_s(ecx)\n end",
"title": ""
},
{
"docid": "8d833b62379be5920213931cb846be03",
"score": "0.5069406",
"text": "def connected_beacon_boards\n\n #Load the ruby WMI library.\n require 'ruby-wmi'\n\n #Find all serial ports on the host system.\n ports = WMI::Win32_SerialPort.find(:all)\n\n #Find only the ports which match the vendor/product ID for the JD beacon board.\n ports.select! { |p| p.attributes[\"pnp_device_id\"].start_with? \"USB\\\\VID_16D0&PID_05A5\" }\n\n #And convert each port to a name/value.\n ports.map! { |p| p.attributes[\"device_id\"] }\n \n end",
"title": ""
},
{
"docid": "79c0b9f9257a278a9f12671a368b6a14",
"score": "0.50633377",
"text": "def available_uid_path\n '.available.uid'\n end",
"title": ""
},
{
"docid": "a5d998368643d36b85ba6928e3fc14f8",
"score": "0.5059113",
"text": "def device_numbers\n @data.unpack('VV')\n end",
"title": ""
},
{
"docid": "78a8d8cf45fac6f94c1dde2b455d1845",
"score": "0.5056602",
"text": "def guid\n g_u_i_d\n end",
"title": ""
},
{
"docid": "ad267e8113efe518177d084afc7092a9",
"score": "0.50561476",
"text": "def get_firmware_number\n command(\"#:GVN#\")\n return read_LX200\n end",
"title": ""
},
{
"docid": "65fc43e15895d8e5a237f84e4437a17e",
"score": "0.50515044",
"text": "def raw\n Utils.bytes_to_hex_string(uid)\n end",
"title": ""
},
{
"docid": "25f63746412d704569ccc1beca5bfe22",
"score": "0.5050994",
"text": "def short_uid\n self.uid.split(/\\-/).first\n end",
"title": ""
},
{
"docid": "af8a5b0d6b81c41d570077069ddb908d",
"score": "0.50502074",
"text": "def pid\n driver.getPid\n end",
"title": ""
},
{
"docid": "54ca4e32a56adb4fdf521e6914eb4986",
"score": "0.5045136",
"text": "def uid\n Base32::URL.encode(id, split: 4, length: 16)\n end",
"title": ""
},
{
"docid": "54ca4e32a56adb4fdf521e6914eb4986",
"score": "0.5045136",
"text": "def uid\n Base32::URL.encode(id, split: 4, length: 16)\n end",
"title": ""
},
{
"docid": "859897aea60410813076c6f7d8c479eb",
"score": "0.5030004",
"text": "def dev_info(connection, device_name)\r\n device = @devices.select {|n| n.name.include?(device_name) }.first\r\n data = connection.get_info(device.uid)['data']\r\n return data\r\nend",
"title": ""
},
{
"docid": "1d9ef5b2f641c5eae9fc23ef17994804",
"score": "0.5029212",
"text": "def uid\n\t\tcid\n\tend",
"title": ""
},
{
"docid": "3497f5cb0bbbb5e7aac63a504ef6f649",
"score": "0.50244355",
"text": "def product\n @product ||= read_string(usb_device.iProduct, \"PRODUCT(0x#{product_id.to_hex(4)})\").strip\n end",
"title": ""
},
{
"docid": "f3947969a9aeb7ee2c61a578a32d3cf6",
"score": "0.50125986",
"text": "def device_tag\n return @device_tag\n end",
"title": ""
},
{
"docid": "824d072628ae55bebb66ac7236273c6f",
"score": "0.5009097",
"text": "def uuid\n \"#{type}/#{uid}\"\n end",
"title": ""
},
{
"docid": "7739df6bd1a9eb7a08d0336710320210",
"score": "0.5008938",
"text": "def device_name\n return @device_name\n end",
"title": ""
},
{
"docid": "7739df6bd1a9eb7a08d0336710320210",
"score": "0.5008751",
"text": "def device_name\n return @device_name\n end",
"title": ""
},
{
"docid": "7739df6bd1a9eb7a08d0336710320210",
"score": "0.5008751",
"text": "def device_name\n return @device_name\n end",
"title": ""
},
{
"docid": "7739df6bd1a9eb7a08d0336710320210",
"score": "0.5008751",
"text": "def device_name\n return @device_name\n end",
"title": ""
},
{
"docid": "7739df6bd1a9eb7a08d0336710320210",
"score": "0.5008751",
"text": "def device_name\n return @device_name\n end",
"title": ""
},
{
"docid": "45b155117026bdc24fa0a3a3c734b484",
"score": "0.5006315",
"text": "def uid(txid)\r\n\t\t[txid[0..32]].pack(\"H*\")\r\n\tend",
"title": ""
},
{
"docid": "e6db346e6aa47f52f92e1a413e7161b5",
"score": "0.5004055",
"text": "def sinuuid\n character_data.sinuuid\n end",
"title": ""
},
{
"docid": "c51ea4040a6f2d1cd14e1f2ae6f73f8e",
"score": "0.5003961",
"text": "def uid\n arr = SecureRandom.random_bytes(16).unpack('NnnnnN')\n arr[2] = (arr[2] & 0x0fff) | 0x4000\n arr[3] = (arr[3] & 0x3fff) | 0x8000\n '%08x-%04x-%04x-%04x-%04x%08x' % arr\n end",
"title": ""
},
{
"docid": "b1a72d2cebec6e76413b094e07878403",
"score": "0.50007594",
"text": "def identifier\n @identifier ||= @data[16, 4]\n end",
"title": ""
},
{
"docid": "585ae4d207e0c6398ab01f2f30e3cefa",
"score": "0.4992257",
"text": "def device_tag\n return @device_tag\n end",
"title": ""
},
{
"docid": "311bdd92e13ed6618655cab33388ef2b",
"score": "0.4990971",
"text": "def device_id\n creds_not_found if @username.nil? == true && @username.nil? == true\n params = {\n 'username' => @username,\n 'auth_token' => @auth_token,\n 'endpoint' => '/loq/device_id'\n }\n jwt = sign_token(params)\n response = endpoint_auth(jwt)\n json_data = post_sc_request(response)\n json_data\n end",
"title": ""
},
{
"docid": "8e2915ac0fd2e53e645ef2a33d8534d4",
"score": "0.49866992",
"text": "def to_s\n uid\n end",
"title": ""
},
{
"docid": "8e2915ac0fd2e53e645ef2a33d8534d4",
"score": "0.49866992",
"text": "def to_s\n uid\n end",
"title": ""
},
{
"docid": "8e2915ac0fd2e53e645ef2a33d8534d4",
"score": "0.49866992",
"text": "def to_s\n uid\n end",
"title": ""
},
{
"docid": "8e2915ac0fd2e53e645ef2a33d8534d4",
"score": "0.49866992",
"text": "def to_s\n uid\n end",
"title": ""
},
{
"docid": "b1c89e9af06479f605523531d01f8d4c",
"score": "0.498659",
"text": "def platform_id\n case [edition, fp]\n when [0, 9]\n 0x101f6f88\n when [1, 0]\n 0x101f795f\n when [1, 2]\n 0x101f8202\n when [2, 0]\n 0x101f7960\n when [2, 1]\n 0x101f9115\n when [2, 6]\n 0x101f9115\n when [2, 8]\n 0x10200bab\n when [3, 0]\n 0x101f7961\n when [3, 1]\n 0x102032be\n when [3, 2]\n 0x102752ae\n when [5, 0]\n 0x1028315f\n when [5, 2]\n 0x20022e6d\n else\n raise \"unsupported S60 version\"\n end\n end",
"title": ""
},
{
"docid": "8fb8018e11a8db77ad09d91036f2f83e",
"score": "0.4983162",
"text": "def uid\n @row_id\n end",
"title": ""
},
{
"docid": "72dc5f0b0845f2e002fbc7fe1bf2f686",
"score": "0.49817458",
"text": "def hardware_id\n @uuid_generator.generate\n end",
"title": ""
},
{
"docid": "601914a9410211a53474eb3bf8742dc0",
"score": "0.49731874",
"text": "def pio_uid\n self.id\n end",
"title": ""
},
{
"docid": "43d0a17df67b87f5259a6d0d35537503",
"score": "0.49702165",
"text": "def serial_number\n @serial_number ||= read_string(usb_device.iSerialNumber, '?').strip\n end",
"title": ""
},
{
"docid": "de37098ea197f2b45106bf300479f44d",
"score": "0.49698237",
"text": "def uuid\n user_id\n end",
"title": ""
},
{
"docid": "70b18a13525ad3d1f021ea14d920b398",
"score": "0.4949047",
"text": "def inspect; \"#<AdbSdkLib::Device:#{self.serial}>\" end",
"title": ""
},
{
"docid": "7809588cb8d3f72f5f3dd31e5f4c3d6a",
"score": "0.4935805",
"text": "def uid\n return @uid if @uid.present?\n\n @uid = if @openshift_object.nil? # no openshift_object reloading here (cycle)\n generate_uniq_uid\n else\n @openshift_object.data.uid\n end\n end",
"title": ""
}
] |
6be0e40114ef4b60519d6cca2319239b
|
Computes the path to an image asset. Full paths from the document root will be passed through. Used internally by +image_tag+ to build the image path: image_path("edit") => "/assets/edit" image_path("edit.png") => "/assets/edit.png" image_path("icons/edit.png") => "/assets/icons/edit.png" image_path("/icons/edit.png") => "/icons/edit.png" image_path(" => " If you have images as application resources this method may conflict with their named routes. The alias +path_to_image+ is provided to avoid that. Rails uses the alias internally, and plugin authors are encouraged to do so. source://actionview//lib/action_view/helpers/asset_url_helper.rb377
|
[
{
"docid": "4a2a6f6554afcfb72e02c3f9bf955ce1",
"score": "0.58905894",
"text": "def image_path(source, options = T.unsafe(nil)); end",
"title": ""
}
] |
[
{
"docid": "fe8292459e87fcd9726ad081ef0dd1d1",
"score": "0.75131047",
"text": "def image_path(path, options={})\n asset_path(path, :type => :image)\n end",
"title": ""
},
{
"docid": "7a5ce2b492974e1cedc6281e86564ebe",
"score": "0.7415515",
"text": "def images_path\n @imags_path ||= File.expand_path 'images/', assets_path\n end",
"title": ""
},
{
"docid": "8b4aa2687d614d081d996c65e1e73caf",
"score": "0.7254087",
"text": "def image_path(source, options = {})\n asset_path source, { :dir => 'images' }.merge(options)\n end",
"title": ""
},
{
"docid": "3929f04c64853d431ec55f15fcd392c9",
"score": "0.7243824",
"text": "def image_path(src)\n asset_path(:images, src)\n end",
"title": ""
},
{
"docid": "fc633b21aeba0fb02de358bee5a2bc2f",
"score": "0.7205672",
"text": "def image_path(source, options = {})\n asset_path source, sprockets_helpers_settings.default_path_options[:image_path].merge(options)\n end",
"title": ""
},
{
"docid": "42116752e13434f3276f1b1e1393bdf6",
"score": "0.70521677",
"text": "def site_image_path(src)\n rewrite_asset_path(src.expand_url(\"#{account_site_assets}/images/\"))\n end",
"title": ""
},
{
"docid": "2e89bb626df8cdfa8e1234104d5197ab",
"score": "0.6989009",
"text": "def asset_image_path(image_name)\n File.expand_path(\"../../assets/images/#{image_name}\", __FILE__)\n end",
"title": ""
},
{
"docid": "57fcdd5e3e2a823ef1e99e6cc81b4b37",
"score": "0.6941569",
"text": "def image_path(src)\n src.gsub!(/\\s/, '')\n src =~ %r{^\\s*(/|http)} ? src : uri_root_path('images', src)\n end",
"title": ""
},
{
"docid": "5d55c4c6eb82fbc929694725cdf15c10",
"score": "0.6880704",
"text": "def image_path(source)\n compute_public_path(source, 'images', 'png')\n end",
"title": ""
},
{
"docid": "8a609d18e6049410c116f4640a38ec02",
"score": "0.68621093",
"text": "def image_path(source)\n path_to_asset(source)\n end",
"title": ""
},
{
"docid": "4a25119bc6e09551884661a4f12ca5ab",
"score": "0.6770138",
"text": "def image_path(source)\n compute_public_path(source, 'images')\n end",
"title": ""
},
{
"docid": "f9ece76d6be185e331133bf49d1720de",
"score": "0.66777694",
"text": "def processing_image_path(image_name)\n \"/assets/\" + Rails.application.assets.find_asset(image_name).digest_path\n end",
"title": ""
},
{
"docid": "6d448ff0e2853bd983166a5e480e1e54",
"score": "0.6552322",
"text": "def image_jpg_path\n \"%s/app/assets/images/game_images/%s.jpg\" %[Rails.root, self.name.dehumanize]\n end",
"title": ""
},
{
"docid": "adf47138fa6b7f3efc8e2e791496c471",
"score": "0.65184414",
"text": "def image_path(image)\r\n image.rel_path\r\n end",
"title": ""
},
{
"docid": "bd640a8ff8861a57d9670a481fd1167e",
"score": "0.6470971",
"text": "def compute_asset_path(path, options = {})\n digested = options.delete(:digested)\n digested = true if digested.nil?\n\n if (digest_path = asset_digest_path(path, options))\n path = digest_path if digested && digest_assets\n path += \"?body=1\" if options[:debug]\n File.join(assets_prefix || \"/\", path)\n else\n super\n end\n end",
"title": ""
},
{
"docid": "4e950f5559bf8d1d827a7a9c772299d9",
"score": "0.6404318",
"text": "def site_image_url(src)\n rewrite_asset_path(src.expand_url(\"#{account_site_assets_url}/images/\"))\n end",
"title": ""
},
{
"docid": "3449bf1a2e9003266065032c658ed3b8",
"score": "0.63959396",
"text": "def image_path\n \"#{PATH}/#{image_filename}\"\n end",
"title": ""
},
{
"docid": "65b94e6c1308be2a6f392cff5ad8a7d1",
"score": "0.62776554",
"text": "def target_asset_path(asset)\n File.join('public', asset.folder, asset.filename)\n end",
"title": ""
},
{
"docid": "f2debe78d0f66aa85784f22393871edc",
"score": "0.6262085",
"text": "def img_path(img)\n\t # Easy peasy for normal files\n\t o = File.expand_path(img, $img_path)\n\t return o if __FILE__ !~ /\\.jar!\\//\n\t # Juggling around packages:\n\t idir = File.expand_path(\"img\", EnveCollection.home)\n\t Dir.mkdir(idir) unless Dir.exist? idir\n\t h = File.expand_path(img, idir)\n\t FileUtils.copy(o, h) unless File.exist? h\n\t h\n end",
"title": ""
},
{
"docid": "984a369762ee47ab31a920f0b631e583",
"score": "0.6256214",
"text": "def compute_asset_path(path, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "984a369762ee47ab31a920f0b631e583",
"score": "0.6256214",
"text": "def compute_asset_path(path, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "af8d4895594c9fe19f3911f6391aa420",
"score": "0.6250308",
"text": "def image_path(icon)\n File.expand_path(File.dirname(__FILE__) + \"/../../images/#{icon}.png\")\n end",
"title": ""
},
{
"docid": "a7c6ed8afd333f823c3267cd3032b7eb",
"score": "0.6244705",
"text": "def absolute_images_path\n File.join(absolute_import_dir, \"images\")\n end",
"title": ""
},
{
"docid": "ae1bfda6407a1fa426da17e54bf09869",
"score": "0.6242899",
"text": "def image_path filename\n File.expand_path \"../resources/#{filename}\", __dir__\nend",
"title": ""
},
{
"docid": "319826a9819de90405c374ec39918335",
"score": "0.6235828",
"text": "def avatar_path\n if ENV[\"FALLBACK_ICONS_DEBUG\"]\n return ActionController::Base.helpers.asset_path(self.class.image_files(:robot).sample)\n end\n\n if avatar.attached?\n # ▼Activestorrage service_url missing default_url_options[:host] · Issue #32866 · rails/rails\n # https://github.com/rails/rails/issues/32866\n Rails.application.routes.url_helpers.rails_blob_path(avatar, only_path: true)\n else\n list = self.class.image_files(race_info.key)\n file = list[(id || self.class.count.next).modulo(list.size)]\n ActionController::Base.helpers.asset_path(file) # asset_url にしてもURLにならないのはなぜ?\n end\n end",
"title": ""
},
{
"docid": "70143c334d3b786ef6e18081f534ced7",
"score": "0.62032336",
"text": "def path_for_asset(asset)\n \"#{assets_path}/#{asset}\"\n end",
"title": ""
},
{
"docid": "0c90673192f9d16c197bc59e62677265",
"score": "0.6198134",
"text": "def image_png_path\n \"%s/app/assets/images/game_images/%s.png\" %[Rails.root, self.name.dehumanize]\n end",
"title": ""
},
{
"docid": "b2ff15eaa974a0ab81eead18891f265b",
"score": "0.61880094",
"text": "def asset_path(kind, source = nil)\n kind, source = source, kind if source.nil?\n source = asset_normalize_extension(kind, escape_link(source.to_s))\n return source if source =~ ABSOLUTE_URL_PATTERN || source =~ /^\\//\n source = File.join(asset_folder_name(kind), source)\n timestamp = asset_timestamp(source)\n result_path = uri_root_path(source)\n \"#{result_path}#{timestamp}\"\n end",
"title": ""
},
{
"docid": "b0d0297231254fa64ba2dee008d357ed",
"score": "0.6178697",
"text": "def image_url source\n source.delete_prefix!('/')\n\n if source.starts_with?('uploads')\n path_to_url source\n elsif !source.starts_with?('http')\n path_to_url asset_pack_path(\"media/images/#{source}\")\n else\n source\n end\n end",
"title": ""
},
{
"docid": "6b5c62fcee9e12bb2f0d120ac21e14d3",
"score": "0.61568505",
"text": "def image_path\n \"#{@parent_path}output/#{@input_name}/#{@input_name}.png\"\n end",
"title": ""
},
{
"docid": "a3b11ae75a01bc04b240e8c3cd82702e",
"score": "0.6133639",
"text": "def relative_images_path\n File.join(relative_import_dir, \"images\")\n end",
"title": ""
},
{
"docid": "5e5b73d1c4b23b20d7f1433b46c90566",
"score": "0.6127188",
"text": "def image_path\r\n if self.image.nil? then\r\n return item.image_path\r\n else\r\n return \"/images/items/\" + self.image\r\n end\r\n end",
"title": ""
},
{
"docid": "af6a34d4b27b200a40dca6bd17964e3f",
"score": "0.61237985",
"text": "def image_path_with_engine_additions(source, options={})\r\n options.stringify_keys!\r\n source = Engines::RailsExtensions::AssetHelpers.plugin_asset_path(options[\"plugin\"], \"images\", source) if options[\"plugin\"]\r\n image_path_without_engine_additions(source)\r\n end",
"title": ""
},
{
"docid": "1417c594a5c04dd2d4f11800c5e6cfd5",
"score": "0.61123437",
"text": "def compute_asset_path(source, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "544eb2e9a344f356e26b1a8bd3d68fc7",
"score": "0.6105224",
"text": "def public_path(image_path, css_path)\n image_path, css_path = Pathname.new(image_path), Pathname.new(css_path)\n (image_path.absolute? ? Pathname.new(\"public#{image_path}\") : css_path.dirname + image_path).cleanpath\n end",
"title": ""
},
{
"docid": "57705945319b808f6068681ea4b6ee00",
"score": "0.605428",
"text": "def asset_path(kind, source)\n return source if source =~ /^http/\n asset_folder = case kind\n when :css then css_dir\n when :js then js_dir\n when :images then images_dir\n else kind.to_s\n end\n source = source.to_s.gsub(/\\s/, '')\n ignore_extension = (kind == :images) # don't append extension\n source << \".#{kind}\" unless ignore_extension or source =~ /\\.#{kind}/\n result_path = source if source =~ %r{^/} # absolute path\n result_path ||= asset_url(source, asset_folder)\n \"#{result_path}\"\n end",
"title": ""
},
{
"docid": "035a45632c18d446cc03745aac684cc8",
"score": "0.60419476",
"text": "def theme_public_images_path(source = '')\n File.join(theme_path, 'public', 'images', source)\n end",
"title": ""
},
{
"docid": "53bbb54e9e1ddca8a4e5623d93a2ae62",
"score": "0.60362875",
"text": "def public_compute_asset_path(source, options = T.unsafe(nil)); end",
"title": ""
},
{
"docid": "2eb8094cd059772211eafa362000cbb0",
"score": "0.60317856",
"text": "def image_url(path, options=nil)\n p = image_path(path)\n if options\n my_rewrite_url(p, options)\n else\n p\n end\n end",
"title": ""
},
{
"docid": "30c2516014faae60d29662122339848c",
"score": "0.60307306",
"text": "def image_manifest_path(name, **options)\n return image_pack_path(name, **options) if fallback_to_webpacker?\n\n resolve_path_to_image(name, **options)\n end",
"title": ""
},
{
"docid": "aaf09c37477df539f2772d8d8b8d53c8",
"score": "0.6023445",
"text": "def image_url(options = {})\n base_url = options[:base_url] || self.base_url || Configuration.DEFAULT_BASE_URL\n base_url << \"/\" if base_url[-1,1] != \"/\"\n base_url << image_path(options)\n end",
"title": ""
},
{
"docid": "d77735352c2aa9a536a41b1cad0618a5",
"score": "0.6011631",
"text": "def asset_path(kind, source)\n return source if source =~ /^http/\n asset_folder = case kind\n when :css then settings.css_dir\n when :js then settings.js_dir\n when :images then settings.images_dir\n else kind.to_s\n end\n source = source.to_s.gsub(/\\s/, '')\n ignore_extension = (kind == :images) # don't append extension\n source << \".#{kind}\" unless ignore_extension or source =~ /\\.#{kind}/\n result_path = source if source =~ %r{^/} # absolute path\n result_path ||= asset_url(source, asset_folder)\n timestamp = asset_timestamp(result_path)\n \"#{result_path}#{timestamp}\"\n end",
"title": ""
},
{
"docid": "6639e680fb11fd35fbe32a6032ec35b3",
"score": "0.5960087",
"text": "def asset_path(asset_relative_path)\n \"#{ASSETS_BASE_PATH}/#{asset_relative_path}\"\n end",
"title": ""
},
{
"docid": "43feedf349b1123a390f111ead0f8c77",
"score": "0.5948164",
"text": "def app_asset_path_for(asset_url, asset_prefix)\n File.join(Rails.root, 'public', asset_prefix, params[:asset])\n end",
"title": ""
},
{
"docid": "9d690b9cd6c2f4686037fa35d42a28c8",
"score": "0.5913489",
"text": "def path_to_image(source)\n path = super(source)\n if @generate_urls_with_host\n protocol = request.protocol()\n path = protocol + request.host_with_port() + path\n end\n return path\n end",
"title": ""
},
{
"docid": "3894b4c6abf17c566ab6151eadd1f019",
"score": "0.59008676",
"text": "def asset_location()\n if fetch(:assets_path, \"\") != \"\" then\n return asset_location = \"#{assets_path}/#{assets_folder}\"\n end\n\n return asset_location = \"#{assets_folder}\"\n end",
"title": ""
},
{
"docid": "2c9e560e36397674088a51cc36a5ad2e",
"score": "0.58715945",
"text": "def image_path(size, absolute = false, extension = nil, images_list = nil)\n return ImagesModule.image_path_for_basename(self.name, size, absolute, extension,\n images_list)\n end",
"title": ""
},
{
"docid": "7a187100a0d3a7b31bb14d0bbe4ea1c7",
"score": "0.5830492",
"text": "def site_asset_path(src)\n rewrite_asset_path(src.expand_url(\"#{account_site_assets}/\"))\n end",
"title": ""
},
{
"docid": "f9aedc1d9d23e5e12d317db2b97701ed",
"score": "0.58292216",
"text": "def asset_path(source, extension = nil)\n return source if is_uri?(source)\n source = source.to_s\n source = rewrite_extension(source, extension)\n source = rewrite_asset(source)\n source = rewrite_asset_path(source)\n source = rewrite_asset_host(source)\n source\n end",
"title": ""
},
{
"docid": "d4c9b35ab5b1e1b6f4e8cf0f1c147a62",
"score": "0.58270293",
"text": "def asset_url(path, **kwd)\n return \"url(#{asset_path(path, **kwd)})\"\n end",
"title": ""
},
{
"docid": "bc74c2a4af485a235f4a6f79d5ec5a8a",
"score": "0.5819191",
"text": "def assets_path\n @assets_path ||= 'assets'\n end",
"title": ""
},
{
"docid": "9b1e395a5d9eb04e01e9875c9f547df5",
"score": "0.5809593",
"text": "def path\n \"#{parent_image.basepath}-#{width}-#{height}-#{x1}-#{x2}-#{y1}-#{y2}#{parent_image.extname}\"\n end",
"title": ""
},
{
"docid": "d36f2e898e88309c857ac0454cbbeddd",
"score": "0.58090246",
"text": "def image_url\n return \"\" if @path.nil? || @path.empty?\n \"#{images_scheme}://#{images_host}/\" << if m = /^(pv4|pfk|p7s|p6o|p3w|p7s|p)\\/(.*)$/.match(@path)\n \"p/\" << m[2]\n else\n @path\n end\n end",
"title": ""
},
{
"docid": "24dbcc94177b4b12d3d8b6f0360477e4",
"score": "0.5804716",
"text": "def image_url(source)\n URI.join(root_url, image_path(source))\n end",
"title": ""
},
{
"docid": "a56c7b5fdb5351c103dd80603f2ee224",
"score": "0.57826537",
"text": "def logo_path(ngo)\n if ngo.image.attached?\n Rails.application.routes.url_helpers.rails_blob_path(ngo.image, only_path: true)\n else\n ActionController::Base.helpers.image_path('image_not_found.png')\n end\n end",
"title": ""
},
{
"docid": "bd0bfcbbdf5dd1625410c5bcffe6e6fb",
"score": "0.57740235",
"text": "def image_path\n \"#{File.dirname(__FILE__).gsub('spec/strategies', 'public')}#{@upload.avatar.url(:big)}\"\n end",
"title": ""
},
{
"docid": "e5ee80c50b8e5c211865b91c47e73c4d",
"score": "0.5772758",
"text": "def assets_path path, strict=true\n path_under \"assets\", path, strict\n end",
"title": ""
},
{
"docid": "13164c88cb33f06777793e0b66199467",
"score": "0.57640886",
"text": "def relative_path_to_image_for_match(match)\n relative_path_to(image_filename_for_match(match))\n end",
"title": ""
},
{
"docid": "552fddbf8ebdc4924fe5a6235388e326",
"score": "0.57636446",
"text": "def image_url(path)\n @@image_url_cache ||= {}\n @@image_url_cache[path] ||= client.get_temporary_link(normalize_path(path)).link\n end",
"title": ""
},
{
"docid": "ef7e33f81952b70f8f4d706695780495",
"score": "0.5762362",
"text": "def asset_path name\n fdpath = @app.asset(name)\n\n if fdpath && fdpath.start_with?(@app.assets_dir)\n if fdpath.start_with?(@app.public_dir)\n fdpath[@app.public_dir.length..-1]\n else\n fdpath[@app.assets_dir.length..-1]\n end\n else\n path = File.join('', name)\n [path, *@app.asset_version(name)].compact.join(\"?\")\n end\n end",
"title": ""
},
{
"docid": "45fd4b9f0a53168a9ef9c8f3bb1f58d3",
"score": "0.5761424",
"text": "def path\n asset_source_path\n end",
"title": ""
},
{
"docid": "45fd4b9f0a53168a9ef9c8f3bb1f58d3",
"score": "0.5761424",
"text": "def path\n asset_source_path\n end",
"title": ""
},
{
"docid": "bb4b3164f29da6925d5f835258d32aab",
"score": "0.5755896",
"text": "def assets_path path = nil\n @assets_path = root + normalize_path(path).freeze if path\n @assets_path ||= '' << root << 'public/'.freeze\n end",
"title": ""
},
{
"docid": "0b0491b587fa6b600a70ccf6da2cb34e",
"score": "0.5755742",
"text": "def defaulft_asset_path_for(asset_url, asset_prefix)\n File.join(theme_path_for('default'), asset_prefix, params[:asset])\n end",
"title": ""
},
{
"docid": "04e4d15487c1a1853bfbc76be8f2f6e2",
"score": "0.5730561",
"text": "def resolve_url_for(logical_path)\n url_join(\n Rails.application.config.action_controller.asset_host,\n Rails.application.config.assets.prefix,\n resolve(logical_path)\n )\n end",
"title": ""
},
{
"docid": "df9081c230e281709e366d744adf4a64",
"score": "0.57292295",
"text": "def asset_path(*args)\n path = args.join('/')\n page = sitemap[path]\n if production?\n raise \"Missing asset #{path}\" if page.blank?\n if page[:digest] == true\n raise \"Missing digest for #{path}\" if page[:digest_path].blank?\n path = page[:digest_path]\n end\n end\n asset_http_prefix + path\n end",
"title": ""
},
{
"docid": "35de06cb8990a4ff0d925fae0a7cb004",
"score": "0.5726685",
"text": "def asset path\n @app.asset path\n end",
"title": ""
},
{
"docid": "4714e23f90b96957839fcf6398a9efde",
"score": "0.57203466",
"text": "def id_to_image_path(id)\n return nil if id.blank?\n raise ArgumentError.new(\"Wrong image id : #{id}\") if Frame.images_paths(id).empty?\n image_path = \"webcomic/#{id}\"\n ActionController::Base.helpers.asset_path(image_path)\n end",
"title": ""
},
{
"docid": "5de11197639769e7d5cad7e013aa6f50",
"score": "0.5702861",
"text": "def asset path\n path = path.gsub STATIC_PATH_CLEANER, \"\"\n\n pub_filepath = File.expand_path(File.join(public_dir, path))\n return pub_filepath if File.file? pub_filepath\n\n ast_filepath = File.expand_path(File.join(assets_dir, path))\n return ast_filepath if File.file? ast_filepath\n\n pub_filepath.sub!(/(\\.\\w+)$/, '-*\\1')\n ast_filepath.sub!(/(\\.\\w+)$/, '-*\\1')\n filepath = Dir[pub_filepath, ast_filepath].first\n return filepath if filepath\n\n gin_filepath = File.expand_path(File.join(Gin::PUBLIC_DIR, path))\n return gin_filepath if File.file? gin_filepath\n end",
"title": ""
},
{
"docid": "553427be44c63e2f837641929ba21a4e",
"score": "0.5693069",
"text": "def get_image_cache_path(options={})\n size = options[:size] = options[:size].to_s.to_sym\n unless IMAGE_RENDER_SIZES.keys.include?(size)\n raise \"The option :size has to be one of: #{IMAGE_RENDER_SIZES.keys.inspect}\"\n end\n format = options[:format] = options[:format].to_s.to_sym\n unless [:jpg, :gif, :png].include?(format)\n format = IMAGE_CACHE_FORMAT \n end\n if self.id.to_i == 0\n seo_name = '/no-location-image'\n else\n if (seo_name = options[:seo_name]).blank?\n if (seo_name = self.title).blank?\n seo_name = self.location.name\n end\n end\n seo_name = seo_name.to_s.downcase.parameterize\n seo_name = I18n.transliterate(seo_name)\n FormatString.normalize_charset!(seo_name)\n seo_name = \"/#{seo_name}\"\n end\n path = \"#{GLOBAL_CONFIG[:location_images_cache_dir]}/\" +\n \"#{self.url_directory}/\" +\n \"#{self.id}/#{size}#{seo_name}.#{format}\"\n return path\n end",
"title": ""
},
{
"docid": "98555f00d398683588a206d5c8063736",
"score": "0.5692809",
"text": "def get_photo_path (id_num)\n photo_file_name = \"user_image_ \" + id_num.to_s\n photo_path_and_file_name = Rails.root.join \"app\", \"assets\", \"images\",\n photo_file_name\n if (File.file?(photo_path_and_file_name + \".bmp\"))\n asset_name = \"/assets/\" + photo_file_name + \".bmp\"\n elsif (File.file?(photo_path_and_file_name + \".gif\"))\n asset_name = \"/assets/\" + photo_file_name + \".gif\"\n elsif (File.file?(photo_path_and_file_name + \".jpg\"))\n asset_name = \"/assets/\" + photo_file_name + \".jpg\"\n elsif (File.file?(photo_path_and_file_name + \".jpeg\"))\n asset_name = \"/assets/\" + photo_file_name + \".jpeg\"\n elsif (File.file?(photo_path_and_file_name + \".png\"))\n asset_name = \"/assets/\" + photo_file_name + \".png\"\n elsif (File.file?(photo_path_and_file_name + \".tiff\"))\n asset_name = \"/assets/\" + photo_file_name + \".tiff\"\n else\n asset_name = \"/assets/placeholder-person.png\"\n end\n return asset_name\n end",
"title": ""
},
{
"docid": "98555f00d398683588a206d5c8063736",
"score": "0.5692809",
"text": "def get_photo_path (id_num)\n photo_file_name = \"user_image_ \" + id_num.to_s\n photo_path_and_file_name = Rails.root.join \"app\", \"assets\", \"images\",\n photo_file_name\n if (File.file?(photo_path_and_file_name + \".bmp\"))\n asset_name = \"/assets/\" + photo_file_name + \".bmp\"\n elsif (File.file?(photo_path_and_file_name + \".gif\"))\n asset_name = \"/assets/\" + photo_file_name + \".gif\"\n elsif (File.file?(photo_path_and_file_name + \".jpg\"))\n asset_name = \"/assets/\" + photo_file_name + \".jpg\"\n elsif (File.file?(photo_path_and_file_name + \".jpeg\"))\n asset_name = \"/assets/\" + photo_file_name + \".jpeg\"\n elsif (File.file?(photo_path_and_file_name + \".png\"))\n asset_name = \"/assets/\" + photo_file_name + \".png\"\n elsif (File.file?(photo_path_and_file_name + \".tiff\"))\n asset_name = \"/assets/\" + photo_file_name + \".tiff\"\n else\n asset_name = \"/assets/placeholder-person.png\"\n end\n return asset_name\n end",
"title": ""
},
{
"docid": "543271b05891c0c74157f41bb48978c9",
"score": "0.56735533",
"text": "def asset_path(source, options = {})\n uri = URI.parse(source)\n return source if uri.absolute?\n\n options[:prefix] = sprockets_helpers_settings.prefix unless options[:prefix]\n\n if sprockets_helpers_settings.debug || options[:debug]\n options[:manifest] = false\n options[:digest] = false\n options[:asset_host] = false\n end\n\n source_ext = File.extname(source)\n\n if options[:ext] && source_ext != \".#{options[:ext]}\"\n uri.path << \".#{options[:ext]}\"\n end\n\n path = find_asset_path(uri, source, options)\n if options[:expand] && path.respond_to?(:to_a)\n path.to_a\n else\n path.to_s\n end\n end",
"title": ""
},
{
"docid": "fece4c15df265ac0ef269b8f226cc3d0",
"score": "0.567133",
"text": "def image_src\n lambda do |text|\n hash = parse_text(text)\n image = find_image(hash)\n image.asset_digest_path\n end\n end",
"title": ""
},
{
"docid": "0f83fe21a18d9b1b5b35235152c4ca6f",
"score": "0.56712204",
"text": "def production_opening\n @images_path = \"/../../assets/images\"\n end",
"title": ""
},
{
"docid": "aeed937654796cadbf61a4aa233b4fd9",
"score": "0.5670281",
"text": "def image_path\n photo = album_cover ? album_cover.photo : photos.first\n if photo\n return \"/album/#{id}/photo/#{photo.id}\"\n else\n return nil\n end\n end",
"title": ""
},
{
"docid": "42e9cc3a8fa847e007a186763f786e7d",
"score": "0.5660385",
"text": "def asset_path_for(asset_url, asset_prefix, theme='default')\n if DcThemesStatic.all_theme_hash[theme]\n File.join(DcThemesStatic.all_theme_hash[theme]['theme'].to_s, asset_prefix, asset_url)\n elsif DcThemesStatic.all_theme_hash[ DC::Config[:theme] ]\n File.join(DcThemesStatic.all_theme_hash[ DC::Config[:theme] ]['theme'].to_s, asset_prefix, asset_url)\n else\n File.join(theme_path_for('default'), asset_prefix, asset_url)\n end\n end",
"title": ""
},
{
"docid": "5a70e891b5d206e0a009149f757228cf",
"score": "0.5656068",
"text": "def cl_image_path(source, options = {})\r\n options = options.clone\r\n url = cloudinary_url_internal(source, options)\r\n image_path_without_cloudinary(url)\r\n end",
"title": ""
},
{
"docid": "aac6d398dbdbbe6fba5cef7891fa70a1",
"score": "0.56474197",
"text": "def image_url(sprite)\n path = Pathname.new(sprite.path)\n if rails?\n \"sprites/#{sprite.filename}\"\n elsif @root\n \"/#{path.relative_path_from(@root)}\"\n else\n path.relative_path_from(@destination).to_s\n end\n end",
"title": ""
},
{
"docid": "7ceda248bd4988f75cb93315858d9ee6",
"score": "0.5646847",
"text": "def relative_path_to_selected_image\n relative_path_to(self.selected_image)\n end",
"title": ""
},
{
"docid": "db54f6da0654ba21db8187f16941e16a",
"score": "0.5645528",
"text": "def access_dir\n \"/assets/#{model.imageable_type.downcase.pluralize}/\"\n end",
"title": ""
},
{
"docid": "9b23b7d499d1a56ea6e9f6b51adbc655",
"score": "0.5632204",
"text": "def image(path, options = {})\n o = Hash(options).map { |k, v| \"#{k}='#{v}'\" }.join(' ')\n\n asset_html(path, [IMAGE_CDN.chomp, o].join(' '),\n [IMAGE_LOCAL.chomp, o].join(' '), options)\n end",
"title": ""
},
{
"docid": "c33e4405af9338cebbb3604713e33603",
"score": "0.5622299",
"text": "def image_url\n is_processed ?\n FileSystem.url(image_path) : \n orig_image_url\n end",
"title": ""
},
{
"docid": "c33e4405af9338cebbb3604713e33603",
"score": "0.5622299",
"text": "def image_url\n is_processed ?\n FileSystem.url(image_path) : \n orig_image_url\n end",
"title": ""
},
{
"docid": "4e1e91decd314bd377ba363ef3e9b1b4",
"score": "0.5612845",
"text": "def assets_path\n (RUBYCOCOA_ROOT + 'app/assets').to_s\n end",
"title": ""
},
{
"docid": "44a43873de3d46af60ad8d15fa930415",
"score": "0.5604599",
"text": "def compute_source_path(source, ext)\n asset_for(source, ext)\n end",
"title": ""
},
{
"docid": "ba20be847e9ee09e357b86344ca91ae9",
"score": "0.5601185",
"text": "def get_image_cache_path(options={})\n image_type = options[:image_type] = options[:image_type].to_s\n if image_type.blank? or not IMAGE_TYPES.include?(image_type)\n image_type = options[:image_type] = IMAGE_TYPES.first\n end\n size = options[:size] = options[:size].to_s\n if size.blank? or not IMAGE_RENDER_SIZES[image_type].keys.include?(size.to_sym)\n size = STANDARD_IMAGE_RENDER_SIZE[image_type]\n end\n format = options[:format] = options[:format].to_s\n if format.blank? or not [:jpg, :gif, :png].include?(format.to_sym)\n format = IMAGE_CACHE_FORMAT\n end\n\n path = \"#{GLOBAL_CONFIG[:coupon_merchant_images_cache_dir]}/\" +\n \"#{image_type}/\" +\n \"#{size}/\" +\n \"#{self.url_directory}/\" +\n \"#{self.id}.#{format}\"\n return path\n end",
"title": ""
},
{
"docid": "dad9850dd2bbc496b7d86fb4feafb145",
"score": "0.5598177",
"text": "def thumb_path(abs=false)\n !abs ? image_path_for(:thumb) : File.expand_path([Rails.root, 'public', image_path_for(:thumb) ].join('/'))\n end",
"title": ""
},
{
"docid": "1167e1c4a07a38ef21fe0dc263a52b77",
"score": "0.5597161",
"text": "def link_image(filename, options={})\n opts = {}.merge(options) #these are the default options for the stylesheet\n\n file_path = File.join('images', filename) #this is where the un-compiled asset currently resides\n asset = Bartender::Asset.new(file_path, self.sprockets_env)\n\n if asset\n return \"<img #{opts.to_a.collect{|opt_a| \"#{opt_a[0]}=\\\"#{opt_a[1]}\\\"\"}.join(' ')} src=\\\"#{asset.site_path}\\\"/>\"\n else\n $stderr.puts \"WARNING: Could not find image '#{filename}' in #{Bartender::DEFAULTS['assets']} for page #{self.page}\"\n return \"<!-- WARNING: Could not link img #{filename} -->\"\n end\n end",
"title": ""
},
{
"docid": "11377b6f2442a2a357d65df08cf51018",
"score": "0.5592171",
"text": "def image_url\n return unless image.attached?\n\n url_for(image)\n end",
"title": ""
},
{
"docid": "410504bb2033f7c1b4a3d8cfc794793c",
"score": "0.5569681",
"text": "def image_save_path\n @image_save_path\n end",
"title": ""
},
{
"docid": "6d360ad8fc3083d653820dcfc6bd07e4",
"score": "0.5547352",
"text": "def image_url(page, image_src)\r\n image_uri = URI.parse(image_src)\r\n if image_uri.absolute?\r\n image_uri\r\n elsif image_uri.relative?\r\n root = URI::Generic.build :scheme => page.url.scheme, :host => page.url.host \r\n URI.join root.to_s, image_uri.to_s\r\n else\r\n raise BasiliskImageError, \"Could not parse image src.\"\r\n end\r\n rescue\r\n raise BasiliskImageError, \"Could not parse image src.\"\r\n end",
"title": ""
},
{
"docid": "6ad693df6af7c07fa1b2692a5b61c470",
"score": "0.5546571",
"text": "def image_path\n \"/image_store/#{id}.#{extension}\"\n end",
"title": ""
},
{
"docid": "a27b538f68f2e23002ed33f24f8d9073",
"score": "0.55287373",
"text": "def local_image_path(name)\n Rails.root.join('uploads', name).to_s\n end",
"title": ""
},
{
"docid": "fc5a0ff9773c4663d7e584a734f32cdb",
"score": "0.55173236",
"text": "def graph_image_path\n File.join('/', graph_relative_path)\n end",
"title": ""
},
{
"docid": "f99933b501c50d0233b608bc945105ce",
"score": "0.5509856",
"text": "def thumb_image_path\n begin\n self.attachment.url(:thumb) ? self.attachment.url(:thumb) : \"/public/no-image.png\"\n rescue\n \"/public/no-image.png\"\n end\n end",
"title": ""
},
{
"docid": "89e6c7dd1b78fcf0889ed027faf0604e",
"score": "0.5509038",
"text": "def images_path\n \tmain_app.send(Auth::OmniAuth::Path.create_or_index_path(Auth.configuration.image_class))\n end",
"title": ""
},
{
"docid": "ac48728e0f84b024e8c02d30a0ae0364",
"score": "0.5507124",
"text": "def image\n if File.exists?(self.image_jpg_path)\n \"/assets/game_images/%s.jpg\" %[self.name.dehumanize]\n elsif File.exists?(self.image_png_path)\n \"/assets/game_images/%s.png\" %[self.name.dehumanize]\n else\n nil\n end\n end",
"title": ""
},
{
"docid": "e67244f61335ed411245bc377fdfefd3",
"score": "0.54805636",
"text": "def asset_path(source, options = {})\n return source if source =~ URI_MATCH\n \n # Extract the path, so we can add any query string items back on.\n uri = URI.parse(source)\n source = uri.path\n \n # Append extension if necessary\n if options[:ext] && File.extname(source).empty?\n source << \".#{options[:ext]}\"\n end\n \n source = materialize_path(source, options)\n \n # Return the reconstructed URI\n source << \"?#{uri.query}\" if uri.query\n source << \"##{uri.fragment}\" if uri.fragment\n source\n end",
"title": ""
},
{
"docid": "eddd63638fd5933821ff94adf8fe01d1",
"score": "0.54661953",
"text": "def output_path(asset_module, format)\n asset_module.cache_asset(format).absolute_path\n end",
"title": ""
}
] |
286d0fc463a8003642ad3f18c23a20cf
|
Method to update the quantity of an item input: new quantity of item steps: check hash for quantity of particular item, update quantity output: print new list with updated hash to verify change is made
|
[
{
"docid": "85d5bb98adf4000d965c2a94fe2f786a",
"score": "0.0",
"text": "def update_quantity(hash, item, quantity)\r\n\tnew_hash = {item => quantity}\r\n\thash.merge!(new_hash)\r\n\thash\r\nend",
"title": ""
}
] |
[
{
"docid": "8ead57b705dc18950976d3779465e023",
"score": "0.8084319",
"text": "def update_quanity(list, item, quantity)\r\n# input: list, item and quantity to be updated to\r\n# steps:\r\n # check if item exists\r\n # update quantity\r\n list[item] = quantity\r\n # print success \"your cart has been updated!\"\r\n puts \"The quantity for #{item.upcase} has been updated in your grocery list!\"\r\n p list\r\n# output: updated list with new quantity\r\nend",
"title": ""
},
{
"docid": "1004853f29974d754e899382069ef477",
"score": "0.7895728",
"text": "def update_quantity(list_name, item, value)\r\n# input: list, item name, new quantity\r\n# steps: find item in the hash and change quantity to new quantity\r\n list_name[item] = value\r\n# output: updated hash with new value for item key\r\n p list_name\r\nend",
"title": ""
},
{
"docid": "00220631c0081c97ea4c5988d06a91f1",
"score": "0.7819694",
"text": "def update_quantity(item, list, quantity)\n add_item(item, list, quantity)\nend",
"title": ""
},
{
"docid": "8c195594c14ca03e5c73f998554830a6",
"score": "0.774994",
"text": "def update_qty(list_hash, item, qty)\r\n \tlist_hash[item] = qty\r\n \tlist_hash\r\nend",
"title": ""
},
{
"docid": "78177dbcf5038a94a8e5608ff64e351c",
"score": "0.77342033",
"text": "def update_item_quantity(hash_of_items, item, quantity)\n hash_of_items[item] = quantity\n hash_of_items\nend",
"title": ""
},
{
"docid": "f571a264a1f92c01a2e3a8cb70c3cd4a",
"score": "0.7721552",
"text": "def update_item(list, item, quantity)\r\n add_item(list, item, quantity)\r\n# input: Shopping list, item to be updated, new quantity\r\n# steps:\r\n # Use shopping list as input\r\n # Use item to be updated as input\r\n # Use new quantity to be updated as input\r\n # Update the quantity of the item on the list\r\n # list[item] = quantity\r\n# output: shopping list with updated quantity\r\n # printlist(list)\r\nend",
"title": ""
},
{
"docid": "eceb5b093ea2f605f051f158f47110a5",
"score": "0.7714689",
"text": "def update_quantity(list, upd_item, new_quantity)\n# steps:\n # reassign key (item) a new value (quantity)\n list[upd_item] = new_quantity\n # return list\n list\nend",
"title": ""
},
{
"docid": "60c56ec32ba5073dba8975e73e0c43c0",
"score": "0.76953083",
"text": "def update_quantity_of_item(list,item,quantity)\r\n add_item_to_list(list,item,quantity)\r\n list\r\nend",
"title": ""
},
{
"docid": "0de7cbaa16926882046b19319ba35b22",
"score": "0.76818967",
"text": "def update_quantity(thingtochange)\n userinputarray=thingtochange.split(\",\")\n $list_hash.each do|current_item, qty| \n if current_item==userinputarray[0]\n $list_hash[current_item]=userinputarray[1]\n else\n end\n end\nend",
"title": ""
},
{
"docid": "79c49291ff47b154eebf7bf0be01c8d0",
"score": "0.76327366",
"text": "def update_qty(shopping_list, item, quantity)\r\n\r\n\tadd_item(shopping_list, item, quantity)\r\n\r\nend",
"title": ""
},
{
"docid": "94d5e4d9ab2fd4bb2cd99ed6f8224e40",
"score": "0.7590758",
"text": "def update_quantity(list, item, quantity)\n\tadd_to_list(list, item, quantity)\nend",
"title": ""
},
{
"docid": "7a52c8dab4b9f90115cf769c1ad55b61",
"score": "0.758822",
"text": "def update_qty(item_list, item, qty)\r\n item_list[item] = qty\r\n item_list\r\nend",
"title": ""
},
{
"docid": "033586b53acda68e46890f6a73fa3274",
"score": "0.7564379",
"text": "def update_quantity(list, item_name, quantity)\n # steps:\n # check IF item is included in list\n # update the item’s quantity\n # ELSE, print a message to the user\n list.include?(item_name) ? list[item_name] = quantity : puts(\"No #{item_name} on the list.\")\n\n # output: return the updated hash or the original hash\n list\nend",
"title": ""
},
{
"docid": "48128830c39f0cb23e3e5b193b3c45ac",
"score": "0.75505036",
"text": "def update(item, quantity, list)\n\t# steps: if the item is in the list\n\tif list.include? item.to_sym\n\t\t# update the quantity\n\t\tlist[item.to_sym] = quantity\n\telse \n\t\tadd_item(item, quantity, list)\n\tend\n\t# output: return the updated list\n\tlist\nend",
"title": ""
},
{
"docid": "0d88d5f5cb7530da3bbf7b547bfcc015",
"score": "0.7548767",
"text": "def update_item_quantity(list_hash,item_name,quantity)\n if list_hash[item_name]\n puts \"Updated the quantity of #{item_name} to: #{quantity}.\"\n list_hash[item_name] = quantity\n else\n puts \"Item does not exist.\"\n end\n\n list_hash\nend",
"title": ""
},
{
"docid": "091c44f531822497f171f1c49541052b",
"score": "0.7506103",
"text": "def update_quantity(hash, item, quantity)\n\thash[item] = quantity\n\treturn hash\nend",
"title": ""
},
{
"docid": "87a1194c5af3e05b2357fb433cc5cec9",
"score": "0.748279",
"text": "def update_quantity (quantity, item)\n $list.each do |list_item|\n if list_item[:item] == item\n list_item[:quantity] = quantity\n end\n end\nend",
"title": ""
},
{
"docid": "c0ad72b9b9704ee122acf4c3909d07c3",
"score": "0.74749035",
"text": "def updated_quantity(list, item_name, quantity)\r\n\tlist[item_name] = quantity\r\n\tlist\r\nend",
"title": ""
},
{
"docid": "dd08a39d02eea0e83a2b26ed6828e544",
"score": "0.7474106",
"text": "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\n\tlist\nend",
"title": ""
},
{
"docid": "c951136fdc185125524c71826d7d7a45",
"score": "0.7451897",
"text": "def list_update(hash_items, item_name, quantity)\n hash_items[item_name] = quantity\n return hash_items\nend",
"title": ""
},
{
"docid": "119e0964b46a12e44075c0ea60aaed86",
"score": "0.744694",
"text": "def update_quantity(list, item_name, quantity)\n\tlist[item_name] = quantity.to_i\n\tlist\nend",
"title": ""
},
{
"docid": "36cbf0f68b9983bc05b8ec4d23efea41",
"score": "0.74357426",
"text": "def update_quantity(list, item, qty)\n list[item] = qty\n list\nend",
"title": ""
},
{
"docid": "bceb099d123556bfb278c1abf8cf0c38",
"score": "0.7420269",
"text": "def update_quantity(grocery,item_name,new_quantity)\n # input:list, item name, and new_quantity\n # steps: change old value of item_name with the new_quantity\n grocery[item_name] = new_quantity\n # output: display the latest list\n display_list(grocery)\nend",
"title": ""
},
{
"docid": "d77d8ec68fd52ffd7d279d24ad7f47fb",
"score": "0.7415678",
"text": "def update_quantity(input_hash, item, qty)\n# steps: use input item as key and input quantity as value\n# output: hash \n input_hash[item] = qty\n \nreturn input_hash\nend",
"title": ""
},
{
"docid": "29d852e65be6d7d430c1558bf8a263d1",
"score": "0.7413445",
"text": "def update_quantity(hash_list, item, quantity)\n if hash_list.has_key?(item)\n hash_list[item] = quantity\n puts \"updated #{item} with quantity of: #{quantity}\"\n else\n puts \"item not found.\"\n puts \"please enter a item in the list.\"\n end\n p hash_list\nend",
"title": ""
},
{
"docid": "e4adaad1a3c97e42a7be01ed7bbbdb29",
"score": "0.74034745",
"text": "def update_item(item, quantity, list)\n\tlist.each do |i, q|\n\t\tif list.has_key?(item)\n\t\t\tlist[item] = quantity\n\t\telse \n\t\t\tputs \"List does not contain that item.\"\n\t\t\tbreak\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "fbce2ec35a1399faff124d3c93e46ce6",
"score": "0.73990387",
"text": "def update_qty(list, item, qty)\n if list.has_key?(item)\n list[item] = qty\n end\n return list.each {|k,v| puts \"#{k}: #{v}\"}\nend",
"title": ""
},
{
"docid": "7649a37dfaf16f0a198911cc69b1e9ce",
"score": "0.7394511",
"text": "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\n\tp list\nend",
"title": ""
},
{
"docid": "06057e2e70098ce26a22888b293c2a62",
"score": "0.7393692",
"text": "def update_item_quantity(list, updateitem, new_qty, print=true)\n\t# input: list, item name (string), new quantity (int or string)\n\t# output: updated list\n\n\tmatch_index = find_item(list, updateitem)\n\tif not match_index\n\t\t# alert if not found\n\t\tmsg = \"\\n\\n** WARNING update_item_quantity failure: item \"\n\t\tmsg += \"\\\"#{removeitem}\\\" not found in list. List unchanged. **\"\n\t\treturn list\n\telse\t\t\t\n\t\t# update list\n\t\tlist.delete_at(match_index)\n\t\tlist.insert(match_index, [updateitem.strip.capitalize, new_qty.to_s])\n\t\t# print success message\n\t\tmsg = \"\\n\\nList updated: item '#{updateitem}' quantity \"\n\t\tmsg += \"updated to '#{new_qty}'.\\n\"\n\t\tputs msg\n\t\t# print updated list\n\t\tprint_list(list) if print\n\t\treturn list\n\tend\nend",
"title": ""
},
{
"docid": "b1b320f4cc8d56162b17f763f38522f0",
"score": "0.7380853",
"text": "def update_quantity_of_items(list, item, quantity)\n list[item] = quantity\nend",
"title": ""
},
{
"docid": "2e430ad20d485e8efbc2d0c7a50d247b",
"score": "0.7366852",
"text": "def update_item(list, item, new_quantity)\n\tlist[item] = new_quantity\n\tlist\nend",
"title": ""
},
{
"docid": "9522637f9186187515d6a1a1a392f82a",
"score": "0.73624384",
"text": "def update_quantity(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend",
"title": ""
},
{
"docid": "9522637f9186187515d6a1a1a392f82a",
"score": "0.73624384",
"text": "def update_quantity(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend",
"title": ""
},
{
"docid": "cead9882cdd95daadda77076d180fa07",
"score": "0.7360292",
"text": "def update_quantity(list,item,item_count)\n\tlist[item] = item_count\nend",
"title": ""
},
{
"docid": "16a2d39317f46d6c613bca5a1ea863cd",
"score": "0.7354301",
"text": "def update_item_quantity(list, item, quantity)\n list[item] = quantity\n list\nend",
"title": ""
},
{
"docid": "9a6e551393c7adb07fc0d5ece31ad8ee",
"score": "0.73426986",
"text": "def update_quantity(list, item, updated_quantity)\n list[item] = updated_quantity\n list\nend",
"title": ""
},
{
"docid": "cd87dc5056d9cf2e921866b3babf92c2",
"score": "0.7324421",
"text": "def update_quantity(item, quantity, hash)\n hash[item] = quantity\n return hash\nend",
"title": ""
},
{
"docid": "521a7c9fb576ac47e9df4486d9e27b30",
"score": "0.730839",
"text": "def update_quantity (item, quantity)\n item_hash[item] = quantity\nend",
"title": ""
},
{
"docid": "56a7690470d5454d7a6bb20bd1053f26",
"score": "0.72983795",
"text": "def update_quantity(item, list, quantity)\n list[item] = quantity\n return list\nend",
"title": ""
},
{
"docid": "4013641490fac1775a2c33ff25376757",
"score": "0.7297394",
"text": "def update_quantity(list, item, quantity)\n #method to update quantity\n #can also add items\n list[item] = quantity\nend",
"title": ""
},
{
"docid": "12d9012b43432b1920ae1deabd91fa2b",
"score": "0.729657",
"text": "def update_quantity(new_list, item_name, quantity)\r\n \r\n new_list[item_name] = quantity\r\nend",
"title": ""
},
{
"docid": "a96e6223cb13b91ecb6ddd9b52ca9060",
"score": "0.7278809",
"text": "def update_quantity(list, item, quantity)\n list[item] = quantity\n list\nend",
"title": ""
},
{
"docid": "a96e6223cb13b91ecb6ddd9b52ca9060",
"score": "0.7278809",
"text": "def update_quantity(list, item, quantity)\n list[item] = quantity\n list\nend",
"title": ""
},
{
"docid": "ee274a28d4b59c9840e82be4ddea8c09",
"score": "0.7278298",
"text": "def update_quanity(list, item_name, new_quantity)\n\n\tlist[item_name] = new_quantity\n\tp list\nend",
"title": ""
},
{
"docid": "1dc1787baf895feecbb0aedc6fca8dc0",
"score": "0.7263024",
"text": "def update(list, item, qty)\n add_item(list, item, qty)\nend",
"title": ""
},
{
"docid": "6002b896f888b08c872b2da98165777f",
"score": "0.72484696",
"text": "def update_item_from_list(hash, item_to_update, new_qty)\n if hash.has_key?(item_to_update)\n hash[item_to_update] = new_qty\n else\n \"It looks like #{item_to_update} wasn't in the hash after all!\"\n end\nend",
"title": ""
},
{
"docid": "7a83ea4eed66e885807c23a503c8eb83",
"score": "0.7245728",
"text": "def update_item_quantity(hash, item, quantity)\n hash[item] = quantity\n hash\nend",
"title": ""
},
{
"docid": "c5c55086fd9194e3407199fb141f0d60",
"score": "0.72407687",
"text": "def update(list, item, quantity)\n\tlist[item] = quantity\n\tlist\nend",
"title": ""
},
{
"docid": "e576ecf7b79951761bb3dba40c4a369a",
"score": "0.7236584",
"text": "def update_quantity(list, item, new)\n if list.has_key?(item)\n list[item] = new\n #This is a different way that merges a new hash to update old hash\n # new_list = {key => new_quantity}\n # list.merge!(new_list) {|key, old_quantity, new_quantity| new_quantity}\n # p list\n end\nend",
"title": ""
},
{
"docid": "99569f6b2b4b46895dc56da9d843de8f",
"score": "0.72329265",
"text": "def update_qty(list_items, item_name, new_qty)\n raise ArguementError.new(\"This item does not exist\") unless list_items.include?(item_name)\n list_items[item_name] = item_qty\nend",
"title": ""
},
{
"docid": "73787c09305d639756d914353d1ab9fb",
"score": "0.7228689",
"text": "def update_quantity(list, item, quant)\n list[item] = quant\nend",
"title": ""
},
{
"docid": "8b68324d9b5de47d220f1e84aceeb59b",
"score": "0.72193795",
"text": "def update_quantity(list, item_name, qty)\n list[item_name] = qty\nend",
"title": ""
},
{
"docid": "6c64a6e7a41674a15a008521c7e12c0a",
"score": "0.721468",
"text": "def update_quantity(item, new_quantity, list)\r\n list[item] = new_quantity\r\n p list\r\n list\r\nend",
"title": ""
},
{
"docid": "6e69f3cb1be2ec937868ece0190f20cd",
"score": "0.72059345",
"text": "def update_quantity(grocery_list,item,new_quantity)\n # if item on the list\n grocery_list.store(item,new_quantity)\n puts \"When you pick up #{item}, make sure to grab #{new_quantity} instead.\"\nend",
"title": ""
},
{
"docid": "8ab24ddae845e983f00062670ff891f2",
"score": "0.7204422",
"text": "def update_quantity(list, item, quantity)\n list[item] = quantity.to_i\n list\nend",
"title": ""
},
{
"docid": "b583127eb8c3afdf1ff08b03659359df",
"score": "0.72022355",
"text": "def update_quantity(list, item, quantity)\r\n\tlist[item] = quantity\r\n\treturn list\r\nend",
"title": ""
},
{
"docid": "3b675ce6b1812e23dd5220dd001060fa",
"score": "0.7198882",
"text": "def update_quantity(list, item, quant)\n list[item] = quant\nend",
"title": ""
},
{
"docid": "00bdf14ef889eb261fcee4a90c35a4db",
"score": "0.71979195",
"text": "def change_quantity(list, item, qty)\n list[item] = qty\n list\nend",
"title": ""
},
{
"docid": "696fe971e0bdcc1f38337fbe86a57508",
"score": "0.71973056",
"text": "def add_item(list, add_item, add_quantity=1)\n# steps:\n # Add item as key and quantity as value to final_list hash(item and quantity will be user inputs)\n list[add_item] = add_quantity\n # Return updated hash\n list\nend",
"title": ""
},
{
"docid": "4e4f2b46795f142441e02a8d6a55b4b6",
"score": "0.7193059",
"text": "def update_item(list, name, change_in_quantity)\n normalize_string(name)\n if (list[name] + change_in_quantity <= 0)\n remove_item(list, name)\n else\n list[name] += change_in_quantity\n return list\n end\nend",
"title": ""
},
{
"docid": "d2cf8d73296a640e8d8fd0fb96e2058c",
"score": "0.7191282",
"text": "def item_quantity(list, item_to_update, quantity)\n list[item_to_update] = quantity \nend",
"title": ""
},
{
"docid": "ac5b284fc183fbe4ea6638f041c1de30",
"score": "0.7176213",
"text": "def change_quantity(list, item, new_qty)\n list[item] = new_qty\nend",
"title": ""
},
{
"docid": "58d1c7a14ea4bbbf00edd31dd8ef0ea0",
"score": "0.7175099",
"text": "def update_item_quantity(current_list)\r\n puts \"Enter item to update: \"\r\n item_to_update = gets.chomp\r\n \r\n puts \"Enter a new quantity: \"\r\n new_item_qty = gets.chomp\r\n new_item_qty = new_item_qty.to_i\r\n \r\n if current_list.has_key?(item_to_update)\r\n current_list[item_to_update] = new_item_qty\r\n end\r\n \r\n current_list\r\nend",
"title": ""
},
{
"docid": "d8f0297d6e091c457c2b9147c7dafc98",
"score": "0.7171696",
"text": "def update_quantity(grocery_list, item, quantity)\r\n add_item(grocery_list, item, quantity)\r\n \r\nend",
"title": ""
},
{
"docid": "86356ad31d4eedabd969fc211d3e2782",
"score": "0.7171607",
"text": "def update_quantity(hash, item, quantity)\n hash[item] = quantity\n return hash\nend",
"title": ""
},
{
"docid": "356445543bb0fb9f698791c2c8984a1d",
"score": "0.7158564",
"text": "def update_quantity(item, new_quantity)\n if $old_list.to_h.include?(item) == true\n $old_list[item] = new_quantity\n p $old_list\n else\n p \"that item isn't on the list\"\n end\n \nend",
"title": ""
},
{
"docid": "8941d0431fd15aa9379ba694fae6176c",
"score": "0.71584624",
"text": "def update(item,quantity,list)\n\tlist[item] = quantity\nend",
"title": ""
},
{
"docid": "6182826dc45c6878e6e1251e300e2947",
"score": "0.71547085",
"text": "def update_quantity(hash, item, quantity)\n hash[item] = quantity\nend",
"title": ""
},
{
"docid": "4ae010f5258134f4834408039503bf56",
"score": "0.7147065",
"text": "def update_quantity(list, item_name, new_quantity)\n list[item_name] = new_quantity\nend",
"title": ""
},
{
"docid": "4ae010f5258134f4834408039503bf56",
"score": "0.7147065",
"text": "def update_quantity(list, item_name, new_quantity)\n list[item_name] = new_quantity\nend",
"title": ""
},
{
"docid": "286f32e8bf7a0222d2b643d1ba04bf02",
"score": "0.7147005",
"text": "def change_qty(list, item, qty)\n if list.has_key?(item) == false\n puts \"Item not found\"\n else\n qty.to_i\n list[item] = qty\n end\n list\nend",
"title": ""
},
{
"docid": "c0793657727badd2bb053272d066734e",
"score": "0.7142324",
"text": "def update_quantity(groceries_list, item, new_quantity)\n\t# Change value for inputted key to the desired quantity\n\tgroceries_list [item] = new_quantity\n\tgroceries_list\nend",
"title": ""
},
{
"docid": "eaf8bee2933d6b742ebf03edf30be117",
"score": "0.71410704",
"text": "def update_quantity(shopping_list, item, quantity)\n shopping_list[item] = quantity\nend",
"title": ""
},
{
"docid": "cd8d1acd9c722b2087236480408906ac",
"score": "0.7137217",
"text": "def update_quantity(list, item_name, quantity)\n\tlist.each do |item, qty|\n\t\tif item === item_name\n\t\t\tlist[item] = quantity\n\t\tend\n\tend\nend",
"title": ""
},
{
"docid": "5492199e2818503ee90f6075c250d7ac",
"score": "0.71361583",
"text": "def update_quantity(grocery_list, item_to_update, qty)\n grocery_list[item_to_update] = qty\n grocery_list\nend",
"title": ""
},
{
"docid": "2cff758a209d55ca23204a251d881611",
"score": "0.7132015",
"text": "def update_qty(list, item_to_update, new_qty)\n # if list.has_key? item_to_update\n # list[item_to_update] = new_qty\n # end\n list[item_to_update] = new_qty if list.has_key? item_to_update\n list\nend",
"title": ""
},
{
"docid": "4379e1907d35851b447fe025e203b6b1",
"score": "0.7131657",
"text": "def update_quantity_in_grocery_list(grocery_list, item_name, quantity)\n # steps: update quantity for item\n grocery_list[item_name.to_sym] = quantity\n # output: explicit return updated hash\n grocery_list\nend",
"title": ""
},
{
"docid": "51446dae8524e77a70b0e2c4757a4e37",
"score": "0.71311325",
"text": "def update_quan(list, item, quantity)\n list[item] = quantity\nend",
"title": ""
},
{
"docid": "6c173a930748c71fd14f74a700d52684",
"score": "0.7119289",
"text": "def update_quantity (grocery_list, item, quantity)\n if grocery_list[item] == nil\n \tputs \"Item not on list.\"\n else\n \tadd_item(grocery_list,item,quantity)\n end\n return grocery_list\n print_list(grocery_list)\nend",
"title": ""
},
{
"docid": "6a6ddbe6b9900b71a2d0da32bb929d4f",
"score": "0.711692",
"text": "def update_quantity(list, item, quantity)\n list[item] = quantity\nend",
"title": ""
},
{
"docid": "19a9e085a245a44de5745e77da852b09",
"score": "0.7115882",
"text": "def update_quantity(list, item, quantity)\n list[item] = quantity\n p list\nend",
"title": ""
},
{
"docid": "edc3f8666f20f32dafc6d54b90118739",
"score": "0.71157414",
"text": "def update_quantity(list, item, quantity)\nlist[item] = quantity\nlist\nend",
"title": ""
},
{
"docid": "acde4d0bfa43d4b9aa6fa80073c4088e",
"score": "0.7114783",
"text": "def updating_item(list,item,quantity)\r\n\r\n adding_item(list,item, quantity)\r\n\r\nend",
"title": ""
},
{
"docid": "6e3ecb834c572d22064be28de7a2d150",
"score": "0.71137816",
"text": "def update_item (list,item,quantity)\n\tlist[item] = quantity\nend",
"title": ""
},
{
"docid": "96ce48e033782f6e6b16fa71755b2d77",
"score": "0.7109907",
"text": "def update_quantity (list, item, quantity)\n list[item] = quantity\nend",
"title": ""
},
{
"docid": "96ce48e033782f6e6b16fa71755b2d77",
"score": "0.7109907",
"text": "def update_quantity (list, item, quantity)\n list[item] = quantity\nend",
"title": ""
},
{
"docid": "d99ba35447fffe8218503e11428390b4",
"score": "0.7109604",
"text": "def update_quantity (item,list, quantity)\n list[item] = quantity\nlist\nend",
"title": ""
},
{
"docid": "be7f9e7e5dceb34e1fce729e7e1c351c",
"score": "0.7105786",
"text": "def update_quantity\n @shopping_cart = ShoppingCart.find_by_user_id(current_user.id)\n @shopping_cart_hash = eval(params[:item_hash])\n @counter = 0\n error_msg = \"\"\n @shopping_cart_hash.each do |item_id, quantity|\n item = Item.find(Integer(item_id))\n if item.quantity < Integer(params[:change_quantity_item_id][@counter])\n error_msg = \"Sorry! Only #{item.quantity} of #{item.title} is available at the moment\"\n end\n @counter+=1\n end\n @counter = 0\n if error_msg.empty?\n @shopping_cart_hash.each do |item_id, quantity|\n @shopping_cart_hash[item_id.to_s] = Integer(params[:change_quantity_item_id][@counter])\n if !params[:delete_item_id].nil? && (params[:delete_item_id].include? @counter.to_s)\n @shopping_cart_hash.delete(item_id.to_s)\n end\n @counter+=1\n end\n\n @shopping_cart.item_list = @shopping_cart_hash.to_s\n @shopping_cart.save\n\n redirect_to @shopping_cart\n else\n redirect_to @shopping_cart, notice: error_msg\n end\n end",
"title": ""
},
{
"docid": "f8e5dd9123a3761a6c5a19d302d8e33c",
"score": "0.7095134",
"text": "def update_quant(current_list, item, quantity)\n current_list[item] = quantity\n current_list\nend",
"title": ""
},
{
"docid": "3d0d0f619b5890e16fadcd81e6251799",
"score": "0.70932806",
"text": "def update_quantity(list,item,quantity)\nlist[item]= quantity\n p list\nend",
"title": ""
},
{
"docid": "9cb65fc6d7ea7db8a42c1322b63af1ab",
"score": "0.7091233",
"text": "def update_quantity(list_item,quantity,user_list)\n user_list[list_item] = quantity\n user_list\nend",
"title": ""
},
{
"docid": "1f5f0db8bd8adb422a56e00ebd3bdccb",
"score": "0.7087354",
"text": "def update_quantity(list, item, quantity)\n list[item] = quantity\nend",
"title": ""
},
{
"docid": "c62291669b48c0cd9b778b534db50ae0",
"score": "0.70769584",
"text": "def update_item(item, list, quantity)\n if list.has_key?(item)\n list[item] = quantity\n return list\n else\n return list\n end\nend",
"title": ""
},
{
"docid": "86192decc4cc31584864065fef1b5691",
"score": "0.70729685",
"text": "def new_quantity(list, item, qty)\n list[item] += qty\n p list\nend",
"title": ""
},
{
"docid": "0da9f98373eef13f84a8f5ca764a9a88",
"score": "0.70691687",
"text": "def update_quant(item, quant)\n\t$grocery_list.store(item, quant)\n\tp \"You updated #{item} number to #{quant}.\"\nend",
"title": ""
},
{
"docid": "6638ca56b827cdde11aa56b61560a65d",
"score": "0.706205",
"text": "def update_item(list, item, quantity)\n\tlist[item] = quantity\n\treturn list\nend",
"title": ""
},
{
"docid": "438e0f891c1d8f53c5d0460b24685f42",
"score": "0.7056549",
"text": "def update_quantity(list, item_name, quantity)\r\n list[item_name] = quantity\r\nend",
"title": ""
},
{
"docid": "0d6b5823c0d0aa1ec139824b29c678f3",
"score": "0.70427",
"text": "def update_item(item,quantity_changed,first_list)\n first_list[item] = quantity_changed\n\nend",
"title": ""
},
{
"docid": "78f47fdcd89360489afdc571d1c49844",
"score": "0.70385724",
"text": "def update_item(hash, item, qty)\n hash[ item ] = qty\nend",
"title": ""
},
{
"docid": "607139b1035457ad5857caf3a576dcb0",
"score": "0.7036328",
"text": "def update_item(item,amount,the_lists)\r\n\r\n\t# steps: search the hash for the key that match the item name\r\n\r\n\tif the_lists[item] == nil #If not found, return\r\n\t puts \"Item is not on the List, sorry\"\r\n\t print_list(the_lists)\r\n\t return\r\n\tend\r\n\r\n # update the value of that key with the new quantiy\r\n the_lists[item] = amount\r\n\r\n print_list(the_lists)\r\nend",
"title": ""
},
{
"docid": "a68bbc7128414c74485325af6778f485",
"score": "0.7033491",
"text": "def update (list, item, quantity)\n\tlist[item] = quantity\nend",
"title": ""
}
] |
becaa8363c6ebd5f99d75ed147e1513e
|
Adds all the solution numbers to the grid cells. If +isHorizontal+ equals true, then it adds all the left numbers, otherwise, the top numbers. Arguments : +cells+ > the Gtk::Grid to add the numbers to +solution+ > the array of array of numbers containing the solution +lineOffset+ > the top offset +columnOffset+ > the left offset Returns : the PicrossFrame itself
|
[
{
"docid": "55f6cb6b2db66a3bd9aa8f5e703167ba",
"score": "0.692376",
"text": "def createNumbers(cells, solution, lineOffset, columnOffset, isHorizontal)\n\n\t\tisHorizontal ? offset = lineOffset : offset = columnOffset\n\t\ti = 0\n\t\tsolution.each do |n|\n\t\t\tj = 0\n\t\t\tn = n.reverse.fill(n.size..offset - 1){ nil }\n\t\t\tn.reverse.each do |m|\n\t\t\t\taddNumber(m, isHorizontal, lineOffset, columnOffset, i, j, cells)\n\t\t\t\tj+= 1\n\t\t\tend\n\t\t\ti+= 1\n\t\tend\n\n\t\treturn self\n\tend",
"title": ""
}
] |
[
{
"docid": "dc8619a9437ef057e9fdfc2f3ab79382",
"score": "0.5924389",
"text": "def add_cells(cells)\n add_members_to_collection(cells) {|collection| @cells = collection }\n end",
"title": ""
},
{
"docid": "c842f53cff9cbef23f4c930c96600987",
"score": "0.58961576",
"text": "def add(cells); end",
"title": ""
},
{
"docid": "a9365aace20380f48b8ef09e6ef41146",
"score": "0.5872959",
"text": "def add_spanning_cells!\n #rounding: because Cell.new_from_points, using in #find_cells above, has\n # a float precision error where, for instance, a cell whose x2 coord is\n # supposed to be 160.137451171875 comes out as 160.13745498657227 because\n # of minus. :(\n vertical_uniq_locs = vertical_ruling_lines.map{|l| l.left.round(5)}.uniq #already sorted\n horizontal_uniq_locs = horizontal_ruling_lines.map{|l| l.top.round(5)}.uniq #already sorted\n\n cells.each do |c|\n vertical_rulings_spanned_over = vertical_uniq_locs.select{|l| l > c.left.round(5) && l < c.right.round(5) }\n horizontal_rulings_spanned_over = horizontal_uniq_locs.select{|t| t > c.top.round(5) && t < c.bottom.round(5) }\n\n unless vertical_rulings_spanned_over.empty?\n c.spanning = true\n vertical_rulings_spanned_over.each do |spanned_over_line_loc|\n placeholder = Cell.new(c.top, spanned_over_line_loc, 0, c.height)\n placeholder.placeholder = true\n cells << placeholder\n end\n end\n unless horizontal_rulings_spanned_over.empty?\n c.spanning = true\n horizontal_rulings_spanned_over.each do |spanned_over_line_loc|\n placeholder = Cell.new(spanned_over_line_loc, c.left, c.width, 0)\n placeholder.placeholder = true\n cells << placeholder\n end\n end\n\n #if there's a spanning cell that's spans over both rows and columns, then it has \"double placeholder\" cells\n # e.g. -------------------\n # | C | C | C | C | (this is some pretty sweet ASCII art, eh?)\n # |-----------------|\n # | C | C | C | C |\n # |-----------------|\n # | C | SC P | C | where MC is the \"spanning cell\" that holds all the text within its bounds\n # |---- + ----| P is a \"placeholder\" cell with either zero width or zero height\n # | C | P DP | C | DP is a \"double placeholder\" cell with zero width and zero height\n # |---- + ----| C is an ordinary cell.\n # | C | P DP | C |\n # |-----------------|\n\n unless (double_placeholders = vertical_rulings_spanned_over.product(horizontal_rulings_spanned_over)).empty?\n double_placeholders.each do |vert_spanned_over, horiz_spanned_over|\n placeholder = Cell.new(horiz_spanned_over, vert_spanned_over, 0, 0)\n placeholder.placeholder = true\n cells << placeholder\n end\n end\n end\n end",
"title": ""
},
{
"docid": "ff09ad4655387ceb2dda604be8d3b9ff",
"score": "0.5858149",
"text": "def addNumber(value, isHorizontal, lineOffset, columnOffset, i, j, cells)\n\t\tnumber = SolutionNumber.new(value)\n\t\tif isHorizontal then\n\t\t\tcells.attach(number,j,i+columnOffset,1,1)\n\t\telse\n\t\t\tcells.attach(number,i+lineOffset,j,1,1)\n\t\tend\n\t\treturn self\n\tend",
"title": ""
},
{
"docid": "5a0c3b45654cd5a85660f275a9559334",
"score": "0.5856253",
"text": "def add_range(cells); end",
"title": ""
},
{
"docid": "50db9b556f32964e209fff34bda0776f",
"score": "0.5749445",
"text": "def rows(evaluate_cells=true)\n if evaluate_cells\n fill_in_cells!\n end\n\n array_of_rows = cells.group_by{|cell| cell.top.round(5) }.sort_by(&:first).map{|x| x.last.sort_by(&:left) }\n\n #here, insert another kind of placeholder for empty corners\n # like in 01001523B_China.pdf\n #TODO: support placeholders for \"empty\" cells in rows other than row 1, and in #cols\n # puts array_of_rows[0].inspect\n if array_of_rows.size > 2\n if array_of_rows[0].map(&:left).uniq.size < array_of_rows[1].map(&:left).uniq.size\n missing_spots = array_of_rows[1].map(&:left) - array_of_rows[0].map(&:left)\n\n missing_spots.each do |missing_spot|\n missing_spot_placeholder = Cell.new(array_of_rows[0][0].top, missing_spot, 0, 0)\n missing_spot_placeholder.placeholder = true\n array_of_rows[0] << missing_spot_placeholder\n end\n end\n array_of_rows[0].sort_by!(&:left)\n end\n array_of_rows\n end",
"title": ""
},
{
"docid": "8154cacdeeb83714a9ba56b3e19b2b76",
"score": "0.5731908",
"text": "def position_cells\n # Calculate x- and y-positions as running sums of widths / heights.\n x_positions = column_widths.inject([0]) { |ary, x|\n ary << (ary.last + x); ary }[0..-2]\n x_positions.each_with_index { |x, i| column(i).x = x }\n\n # y-positions assume an infinitely long canvas starting at zero -- this\n # is corrected for in Table#draw, and page breaks are properly inserted.\n y_positions = row_heights.inject([0]) { |ary, y|\n ary << (ary.last - y); ary}[0..-2]\n y_positions.each_with_index { |y, i| row(i).y = y }\n end",
"title": ""
},
{
"docid": "ddcbd6d41e920c5f7c1133ae12a27dc3",
"score": "0.56775117",
"text": "def setup_cells\n # The max_cols and max_rows are determined based on the window\n # dimensions passed into the GosuCell.configure_dimensions\n # method during window init\n @rows = GosuCell.max_rows\n @cols = GosuCell.max_cols\n\n @cells = []\n\n @rows.times do |row_index|\n row = []\n \n @cols.times do |col_index|\n row << GosuCell.new( row_index, col_index )\n end\n\n @cells << row\n end\n\n # Flatten the nested cell arrays so that drawing ops have a\n # slightly optimized way to iterate over all cells\n @cell_draw_array = @cells.flatten\n end",
"title": ""
},
{
"docid": "0d4c50d777cdf6ed07a42e64b9387a2e",
"score": "0.5655094",
"text": "def cells\n positions = []\n width.times do |i| # 0 -> 5\n height.times do |j| # 0 -> 4\n positions << [\n top_pad + j,\n left_pad + i,\n ]\n end\n end\n positions\n end",
"title": ""
},
{
"docid": "139cd233a522acf0b41b08b8f4f79871",
"score": "0.56057554",
"text": "def solve cells\n cells.each_index do |i|\n @board.set cells[i][0], cells[i][1]\n end\n\n regenerate\n end",
"title": ""
},
{
"docid": "0acbcf5821b27ffb57666c52a33f8b32",
"score": "0.5558802",
"text": "def add_row_cell_lists\n (0..8).each do |row_index| \n cellList = SudokuCellList.new\n (0..8).each do |column_index|\n cellList << cell_at_pos(row_index,column_index)\n end\n @cellLists << cellList\n end\n end",
"title": ""
},
{
"docid": "92bc83a6872ec9634d00e5a5329573ff",
"score": "0.5532583",
"text": "def position_cells\n# Calculate x- and y-positions as running sums of widths / heights.\nx_positions = column_widths.inject([0]) { |ary, x|\nary << (ary.last + x); ary }[0..-2]\nx_positions.each_with_index { |x, i| column(i).x = x }\n# y-positions assume an infinitely long canvas starting at zero -- this\n# is corrected for in Table#draw, and page breaks are properly inserted.\ny_positions = row_heights.inject([0]) { |ary, y|\nary << (ary.last - y); ary}[0..-2]\ny_positions.each_with_index { |y, i| row(i).y = y }\nend",
"title": ""
},
{
"docid": "9a7040e205600b0b9108f4b40dcf953d",
"score": "0.5498074",
"text": "def cells\n @cells ||= []\n if @cells.empty?\n (0..n_y-1).each do |j|\n (0..n_x-1).each do |i|\n @cells << pdf.grid(j,i)\n end\n end\n end\n @cells\n end",
"title": ""
},
{
"docid": "2d8f0fb17135da8c0f7cbd713ddedd51",
"score": "0.5438594",
"text": "def spawn_cells(*cells)\n cells.each do |row,col|\n @cells[row][col] = 1\n end\n end",
"title": ""
},
{
"docid": "0a6d36cdd6c41696cb65e2856e06050b",
"score": "0.5432385",
"text": "def parse_cells(cells)\n figures = []\n rectangles = get_rectangles(cells)\n\n for e in rectangles\n figures.push(e)\n\n cells = e.get_cells_inside\n if cells != nil\n sub = parse_cells(e.get_cells_inside)\n figures.concat(sub)\n end\n end\n\n figures\n end",
"title": ""
},
{
"docid": "1a8c14db5e3bee41a150dda3f3a96000",
"score": "0.5418039",
"text": "def ink_and_draw_cells_and_start_new_page(cells_this_page, cell)\n # don't draw only a header\n draw_cells = (@header_row.nil? || cells_this_page.size > @header_row.size)\n \n ink_and_draw_cells(cells_this_page, draw_cells)\n \n # start a new page or column\n @pdf.bounds.move_past_bottom\n\n offset = (@pdf.y - cell.y)\n\n cells_next_page = []\n\n header_height = add_header(cell.row, cells_next_page)\n\n # account for header height in newly generated offset\n offset -= header_height\n\n # reset cells_this_page in calling function and return new offset\n return cells_next_page, offset\n end",
"title": ""
},
{
"docid": "30d2b6f185a5207327c5f519a60590da",
"score": "0.53824407",
"text": "def solution_grid\n\t\t\t\tArray.new(1) { Array.new(1) { Array.new(4) { Cell.new} } }\n\t\t\tend",
"title": ""
},
{
"docid": "916a05acbd315cad5b8659976c10177d",
"score": "0.53185403",
"text": "def build_grid(raw_rows)\n raw_rows.each do |row|\n row.each_char { |ltr| add_cell ltr }\n end\n end",
"title": ""
},
{
"docid": "3e7afcd69c9f36b32860619b7ce424f0",
"score": "0.5296996",
"text": "def add_grid\n\n # Sets the x, y, height, and width of the grid.\n # There are 31 horizontal lines and 31 vertical lines in the grid.\n # Feel free to count them yourself before continuing!\n x, y, h, w = 640 - 500/2, 640 - 500, 500, 500 # calculations done so the grid appears in screen's center\n lines_h = 31\n lines_v = 31\n\n # Sets values for the grid's border, grid lines, and filled squares.\n # The filled_squares variable is initially set to an empty array.\n state.grid_border ||= [ x, y, h, w ] # definition of grid's outer border\n state.grid_lines ||= draw_grid(x, y, h, w, lines_h, lines_v) # calls draw_grid method\n state.filled_squares ||= [] # there are no filled squares until the user fills them in\n\n # Outputs the grid lines, border, and filled squares onto the screen.\n outputs.lines.concat state.grid_lines\n outputs.borders << state.grid_border\n outputs.solids << state.filled_squares\n end",
"title": ""
},
{
"docid": "3aff123f290ef835e2f6dc8041df0766",
"score": "0.52875155",
"text": "def generate_cells!\n @grid = Array.new(@height) do |i|\n Array.new(@width) do |j|\n Cell.new(i-1, j-1)\n end\n end\n end",
"title": ""
},
{
"docid": "f54dc7992693c277613f8b374e816b24",
"score": "0.5277359",
"text": "def configure_cells\n each_cell do |cell| \n row, col = cell.row, cell.column\n cell.up = self[row - 1, col]\n cell.down = self[row + 1, col]\n cell.left = self[row, col - 1]\n cell.right = self[row, col + 1]\n end\n end",
"title": ""
},
{
"docid": "04446e3172e7483a4d486c0dec5e9d8a",
"score": "0.52757317",
"text": "def build_game_cells\n ARRAY_SIZE.times do |row|\n ARRAY_SIZE.times do |column|\n self.cells.create(row: row, column: column)\n end\n end\n end",
"title": ""
},
{
"docid": "61096d451f42593ee56e036f740870c2",
"score": "0.5255666",
"text": "def add_rows\n @maze.cells.each_with_index do |row, row_index|\n (0...row.length).each do |col_index|\n @maze_string << '+' << (row[col_index].has_top_cell? ? ' ' : '-')\n end\n @maze_string << \"+\\n\"\n (0...row.length).each do |col_index|\n @maze_string << (row[col_index].has_left_cell? ? ' ' : '|') << cell_marker(row_index, col_index)\n end\n @maze_string << \"|\\n\"\n end\n end",
"title": ""
},
{
"docid": "518b87270a8d8935835c5a8f5c4dc5c2",
"score": "0.5250656",
"text": "def set_cells(newcells, arglist)\n print_debug \"Setting cells\"\n @cells = Array.new\n @arglist = Array.new\n arglist.each do |arg|\n # Regex to delete any character not a-z,0-9,or _\n print_debug arg\n if [\"0\",\"1\",\"2\",\"3\",\"4\",\"5\",\"6\",\"7\",\"8\",\"9\"].include?(arg[0].chr)\n arg = \"_\" + arg\n end\n @arglist << arg.gsub(/(\\W)+/,\"\").downcase\n end\n if !newcells.nil?\n ord = 0\n newcells.each do |cell|\n ord += 1\n c = RCell.new\n c.onset = cell[\"onset\"]\n c.offset = cell[\"offset\"]\n c.db_cell = cell\n c.parent = @name\n vals = Array.new\n if cell[\"type\"] == 0\n for val in cell.getValue().getArguments()\n vals << val[\"value\"]\n end\n else\n vals << cell.getValue()[\"value\"]\n end\n c.set_args(vals,@arglist)\n c.ordinal = ord\n @cells << c\n end\n end\n end",
"title": ""
},
{
"docid": "c31918bc4cf104d2f061be436d814391",
"score": "0.52440965",
"text": "def sort_cells(cells); end",
"title": ""
},
{
"docid": "a3f16d214faaacc4a2c29239778f356a",
"score": "0.52424675",
"text": "def put_numbers\n (0..9).each do |row|\n (0..9).each do |column|\n tile = tile_array[row][column]\n if tile.has_mine != true\n index = (row.to_s + column.to_s).to_i\n\t \n n = index-10\n s = index+10\n w = index-1\n e = index+1\n ne = index-9\n sw = index+9\n nw = index-11\n se = index+11\n\n if row == 0 && column == 0\n neighbors = [e,se,s]\n elsif row == 0 && column == 9\n neighbors = [w,sw,s]\n elsif row == 9 && column == 0\n neighbors = [n,ne,e]\n elsif row == 9 && column == 9\n neighbors = [w,nw,n]\n elsif row == 0 && (1..8) === column \n neighbors = [w,sw,s,se,e]\n elsif row == 9 && (1..8) === column\n neighbors = [w,nw,n,ne,e]\n elsif (1..8) === row && column == 0\n neighbors = [n,ne,e,se,s]\n elsif (1..8) === row && column == 9\n neighbors = [w,nw,n,sw,s]\n else\n neighbors = [n,ne,e,se,s,sw,w,nw]\n end\n\n if count_neighboring_mines(neighbors) == 0\n tile.hidden_symbol = \" \"\n else\n num_neighboring_mines = count_neighboring_mines(neighbors).to_s\n tile.hidden_symbol = num_neighboring_mines\n end\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9e5024728d38f48297f0106efd77d4f3",
"score": "0.5235086",
"text": "def process_clues\n @clues = []\n number = 1\n added = false\n\n @height.times { |row|\n @width.times { |col|\n next if @solution[row, col] == '.'\n\n if @solution[row, col - 1] == '.' && @solution[row, col + 1] != '.'\n @clues << processed_clue_for(row, col, 'across', number)\n added = true\n end\n\n if @solution[row - 1, col] == '.' && @solution[row + 1, col] != '.'\n @clues << processed_clue_for(row, col, 'down', number)\n added = true\n end\n\n number += 1 if added\n added = false\n }\n }\n end",
"title": ""
},
{
"docid": "48ef5cba0f32060e2023bacb90833603",
"score": "0.52279556",
"text": "def add_grid\n\n # Outputs the grid's border.\n outputs.borders << state.grid_border\n temp = 0\n\n # Before looking at the code that outputs the vertical and horizontal lines in the\n # grid, take note of the fact that:\n # grid_border[1] refers to the border's bottom line (running horizontally),\n # grid_border[2] refers to the border's top line (running (horizontally),\n # grid_border[0] refers to the border's left line (running vertically),\n # and grid_border[3] refers to the border's right line (running vertically).\n\n # [2]\n # ----------\n # | |\n # [0] | | [3]\n # | |\n # ----------\n # [1]\n\n # Calculates the positions and outputs the x grid lines in the color gray.\n state.gridX.map do # perform an action on all elements of the gridX collection\n |x|\n temp += 1 # increment temp\n\n # if x's value is greater than (or equal to) the x value of the border's left side\n # and less than (or equal to) the x value of the border's right side\n if x >= state.centerX - (state.grid_border[2] / 2) && x <= state.centerX + (state.grid_border[2] / 2)\n delta = state.centerX - 640\n # vertical lines have the same starting and ending x positions\n # starting y and ending y positions lead from the bottom of the border to the top of the border\n outputs.lines << [x - delta, state.grid_border[1], x - delta, state.grid_border[1] + state.grid_border[2], 150, 150, 150] # sets definition of vertical line and outputs it\n end\n end\n temp = 0\n\n # Calculates the positions and outputs the y grid lines in the color gray.\n state.gridY.map do # perform an action on all elements of the gridY collection\n |y|\n temp += 1 # increment temp\n\n # if y's value is greater than (or equal to) the y value of the border's bottom side\n # and less than (or equal to) the y value of the border's top side\n if y >= state.centerY - (state.grid_border[3] / 2) && y <= state.centerY + (state.grid_border[3] / 2)\n delta = state.centerY - 393\n # horizontal lines have the same starting and ending y positions\n # starting x and ending x positions lead from the left side of the border to the right side of the border\n outputs.lines << [state.grid_border[0], y - delta, state.grid_border[0] + state.grid_border[3], y - delta, 150, 150, 150] # sets definition of horizontal line and outputs it\n end\n end\n\n # Sets values and outputs sprites for the filled_squares collection.\n state.filled_squares.map do # perform an action on every element of the filled_squares collection\n |x, y, w, h, sprite|\n # if x's value is greater than (or equal to) the x value of 17 pixels to the left of the border's left side\n # and less than (or equal to) the x value of the border's right side\n # and y's value is greater than (or equal to) the y value of the border's bottom side\n # and less than (or equal to) the y value of 25 pixels above the border's top side\n # NOTE: The allowance of 17 pixels and 25 pixels is due to the fact that a grid box may be slightly cut off or\n # not entirely visible in the grid's view (until it is moved using \"W\", \"A\", \"S\", \"D\")\n if x >= state.centerX - (state.grid_border[2] / 2) - 17 && x <= state.centerX + (state.grid_border[2] / 2) &&\n y >= state.centerY - (state.grid_border[3] / 2) && y <= state.centerY + (state.grid_border[3] / 2) + 25\n # calculations done to place sprites in grid spaces that are meant to filled in\n # mess around with the x and y values and see how the sprite placement changes\n outputs.sprites << [x - state.centerX + 630, y - state.centerY + 360, w, h, sprite]\n end\n end\n\n # outputs a white solid along the left side of the grid (change the color and you'll be able to see it against the white background)\n # state.increment subtracted in x parameter because solid's position is denoted by bottom left corner\n # state.increment subtracted in y parameter to avoid covering the title label\n outputs.primitives << [state.grid_border[0] - state.increment,\n state.grid_border[1] - state.increment, state.increment, state.grid_border[3] + (state.increment * 2),\n 255, 255, 255].solid\n\n # outputs a white solid along the right side of the grid\n # state.increment subtracted from y parameter to avoid covering title label\n outputs.primitives << [state.grid_border[0] + state.grid_border[2],\n state.grid_border[1] - state.increment, state.increment, state.grid_border[3] + (state.increment * 2),\n 255, 255, 255].solid\n\n # outputs a white solid along the bottom of the grid\n # state.increment subtracted from y parameter to avoid covering last row of grid boxes\n outputs.primitives << [state.grid_border[0] - state.increment, state.grid_border[1] - state.increment,\n state.grid_border[2] + (2 * state.increment), state.increment, 255, 255, 255].solid\n\n # outputs a white solid along the top of the grid\n outputs.primitives << [state.grid_border[0] - state.increment, state.grid_border[1] + state.grid_border[3],\n state.grid_border[2] + (2 * state.increment), state.increment, 255, 255, 255].solid\n\n end",
"title": ""
},
{
"docid": "2e873979e2e3ff99f41219eaa199d33f",
"score": "0.52260643",
"text": "def merge_cells(cells); end",
"title": ""
},
{
"docid": "333d09cd649894a7a7be76958711baca",
"score": "0.5225549",
"text": "def <<(cells)\n AppendedColumnRow.new(self, *cells.cells)\n end",
"title": ""
},
{
"docid": "111e03e62f75025540ba85b840a5ad81",
"score": "0.5189654",
"text": "def coordinates_for(cells)\n cells.map { |cell| [cell.row, cell.col] }.sort\n end",
"title": ""
},
{
"docid": "bacec7a2520a63574c82044fa850ce6b",
"score": "0.5181597",
"text": "def add_extra_circunference\n @cells.map! do |row|\n [0] + row + [0]\n end\n\n new_empty_row = Array.new(@cells.first.size, 0)\n @cells.unshift(new_empty_row)\n @cells.push(new_empty_row)\n\n ## Update max values from previous generations\n max_row_pos! && max_cell_pos!\n end",
"title": ""
},
{
"docid": "0affac263a825f764107ac373209deef",
"score": "0.5172133",
"text": "def generation\n new_grid = Array.new(@grid_size)\n each_cell do |i,row,col|\n living_neighbors = 0\n if row > 0\n if col > 0\n living_neighbors += 1 if living?(row-1, col-1)\n living_neighbors += 1 if living?(row, col-1)\n if row < @rows\n living_neighbors += 1 if living?(row+1, col-1)\n end\n end\n living_neighbors += 1 if living?(row-1, col)\n if col < @cols\n living_neighbors += 1 if living?(row-1, col+1)\n living_neighbors += 1 if living?(row, col+1)\n if row < @rows\n living_neighbors += 1 if living?(row+1, col+1)\n end\n end\n end\n new_grid[i] = ((living_neighbors == 2 or living_neighbors == 3) ? true : false)\n end\n @cells = new_grid\n end",
"title": ""
},
{
"docid": "d85916257ea42db817d4d21f896305aa",
"score": "0.5166584",
"text": "def figure_out_cell_numbers\n @board.each do |row|\n row.each do |cell|\n cell.calculate_neighboring_mines(@board, @size)\n end\n end\n\n end",
"title": ""
},
{
"docid": "d5a49bdd8fe7769408f7c316ca890ea2",
"score": "0.5154042",
"text": "def grid\n rows = []\n columns = []\n cells = []\n # @grid = Array.new(row){Array.new(column) } -removed to implement a clearer way to define cell from rows and columns\n @grid = Array.new(rows) do |row|\n Array.new(columns) do |column|\n #Create the 2 arrays. After we create an array of columns, we create a cell passing in a column and row. The cell is a product of row and column.\n cell = Cell.new(column, row)\n #We will need to be able to shovel a cell into an array of cells in the game.\n cells << cell\n cell\n end\n end\n end",
"title": ""
},
{
"docid": "97e31480ca34f593bf5d9f60a00700a9",
"score": "0.5149617",
"text": "def adjust()\n\t\tmax_col = 0\n\t\tmax_row = 0\n\t\tfor i in 0..@rows - 1\n\t\t\tfor j in 0..@cols - 1\n\t\t\t\tcell = get_cell(i, j)\n\t\t\t\tif cell != EMPTY\n\t\t\t\t\tif i > max_row\n\t\t\t\t\t\tmax_row = i\n\t\t\t\t\tend\n\t\t\t\t\tif j > max_col\n\t\t\t\t\t\tmax_col = j\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\tfitted_grid = []\n\t\tfor i in 0..max_row\n\t\t\tnew_row = []\n\t\t\tfor j in 0..max_col\n\t\t\t\tnew_row.push(@grid[i][j])\n\t\t\tend\n\t\t\tfitted_grid.push(new_row)\n\t\tend\n\t\t@grid = fitted_grid\n\t\t@rows = max_row + 1\n\t\t@cols = max_col + 1\n\tend",
"title": ""
},
{
"docid": "433af9f5d2c3229d8a2fc28a117ec1b2",
"score": "0.51426977",
"text": "def add_cells(routeCells)\n add_members_to_collection(routeCells) {|routeCells| @cellpath = routeCells }\n end",
"title": ""
},
{
"docid": "90091982e5268ed32ffb0df044aaf75a",
"score": "0.51395804",
"text": "def scan_lines(line_width)\n plain_grid_matrix = grid.split(',')\n array = plain_grid_matrix.each_slice(cols.to_i).to_a\n width = cols.to_i\n height = rows.to_i\n\n rows.to_i.times do |y|\n cols.to_i.times do |x|\n next if array[y][x].to_i == CELL_EMPTY\n user_cell_number = array[y][x]\n win = (array[y][x+1] == user_cell_number && x+1 < width) &&\n (array[y][x+2] == user_cell_number && x+2 < width) &&\n (array[y][x+3] == user_cell_number && x+3 < width)\n return [ user_cell_number, [[x,y],[x+1,y],[x+2,y],[x+3,y]] ] if win\n\n win = (array[y+1] && array[y+1][x] == user_cell_number && y+1 < height) &&\n (array[y+2] && array[y+2][x] == user_cell_number && y+2 < height) &&\n (array[y+3] && array[y+3][x] == user_cell_number && y+3 < height)\n return [ user_cell_number, [[x,y],[x,y+1],[x,y+2],[x,y+3]] ] if win\n\n win = (array[y+1] && array[y+1][x+1] == user_cell_number && y+1 < height && x+1 < width) &&\n (array[y+2] && array[y+2][x+2] == user_cell_number && y+2 < height && x+2 < width) &&\n (array[y+3] && array[y+3][x+3] == user_cell_number && y+3 < height && x+3 < width)\n return [ user_cell_number, [[x,y],[x+1,y+1],[x+2,y+2],[x+3,y+3]] ] if win\n\n win = (array[y+1] && array[y+1][x-1] == user_cell_number && y+1 < height && x-1 >= 0) &&\n (array[y+2] && array[y+2][x-2] == user_cell_number && y+2 < height && x-2 >= 0) &&\n (array[y+3] && array[y+3][x-3] == user_cell_number && y+3 < height && x-3 >= 0)\n return [ user_cell_number, [[x,y],[x-1,y+1],[x-2,y+2],[x-3,y+3]] ] if win\n end\n end\n return CELL_EMPTY\n end",
"title": ""
},
{
"docid": "37500ffcdaabec7c053e446a956b8736",
"score": "0.51342136",
"text": "def fill_grid grid\n if !solved? # if not yet solved\n empty = grid.find_index {|i| i == 0} # get first empty \n nums = row_nums(empty) & col_nums(empty) & reg_nums(empty) # get poss. digits for empty\n @first_e = empty if @first_e == -1\n\n # iterate recursively through all empties and all possible digits for each empty\n # this tries all possible options, backtracking if the next square has no possible numbers\n nums.each_with_index do |num, index|\n grid[empty] = num # put number in empty\n \n # update @puzzle, because methods that get possible digits use @puzzle\n @puzzle.clear\n grid.each_slice(9) {|row| @puzzle << row}\n \n fill_grid grid # recursive call\n if !solved?\n # if not solved after last number entered, previous entries are wrong\n # setting empty to 0 will force method to backtrack and recur again w/ diff. combination\n if index == nums.size-1\n grid[empty] = 0\n # if we are back at the first empty cell and have exhausted all possible values, then the puzzle has no solution\n if @first_e == empty\n @errorm = \"This puzzle has no solution.\"\n abort \"Invalid input\"\n end\n end\n else\n return # solution found; exit method\n end\n end # end nums block\n end # end if\n end",
"title": ""
},
{
"docid": "94f994853e7f4fe23a7efeaaa69b3cd3",
"score": "0.5132427",
"text": "def add_grid(grid, width, height)\n @last_width = width\n @last_height = height\n \n @clobber_grid = false\n generate_empty_grid\n \n height.times do |i|\n @grid[i] = grid[i][0].split(' ')\n end\n end",
"title": ""
},
{
"docid": "dfe154bc6359a2123393aba9576b23ec",
"score": "0.5130369",
"text": "def cells\n @cells ||= []\n end",
"title": ""
},
{
"docid": "158197455f51431a600710a2961806c9",
"score": "0.51286834",
"text": "def populate_grid(input)\n x = 0\n y = 0\n @cells = Array.new\n\n input.each_line do |line|\n line.chomp.each_char do |char|\n cell = Textcell.new(x,y)\n cell.set_parent(self)\n @cells.push(cell)\n x+=1\n end\n x=0\n y+=1\n end\n\n populate_figures\n end",
"title": ""
},
{
"docid": "26651f4ddbb8a6c60fb28b6d6f6a1015",
"score": "0.5122953",
"text": "def draw_grid_cells\n x_iter.each do |column_id|\n y_iter.each do |row_idx|\n field = @game.map.field_at(column_id, row_idx)\n if field.drawable?\n x0 = (column_id - 1)*cell_size\n y0 = (row_idx - 1)*cell_size\n\n x1 = column_id*cell_size\n y1 = row_idx*cell_size\n\n draw_rectangle_at(x0, y0, x1, y1, field.color_value, 1)\n end\n end\n end\n end",
"title": ""
},
{
"docid": "2a29f7082e35dce2fe13f7137fc0078d",
"score": "0.5114844",
"text": "def get_cells_inside\n return nil if cells.to_a.empty?\n cells = []\n\n for e in @cells\n if inside?(e.x,e.y)\n cells.push(e)\n end\n end\n cells\n end",
"title": ""
},
{
"docid": "f8ecc5748d61a8645ac9f90666b7b01e",
"score": "0.5105627",
"text": "def grid\n @cells.each_slice(5).to_a\n end",
"title": ""
},
{
"docid": "bfca8170515fe39bb006e4dcf4fa0c01",
"score": "0.5080385",
"text": "def add_column_cell_lists\n (0..8).each do |column_index|\n cellList = SudokuCellList.new\n (0..8).each do |row_index|\n cellList << cell_at_pos(row_index,column_index)\n end\n @cellLists << cellList\n end\n end",
"title": ""
},
{
"docid": "a695aaf36ebc2dfb8b9046ed9395e954",
"score": "0.50793004",
"text": "def merge_cells(cells)\n merged_cells.add cells\n end",
"title": ""
},
{
"docid": "b18463bf1479aedb60b4ae02796b9fd5",
"score": "0.5070703",
"text": "def get_grid\n curr_x = state.centerX - (state.gridSize / 2) # starts at left of grid\n deltaX = state.gridSize / state.lineQuantity # finds distance to place vertical lines evenly through width of grid\n (state.lineQuantity + 2).times do\n state.gridX << curr_x # adds curr_x to gridX collection\n curr_x += deltaX # increment curr_x by the distance between vertical lines\n end\n\n curr_y = state.centerY - (state.gridSize / 2) # starts at bottom of grid\n deltaY = state.gridSize / state.lineQuantity # finds distance to place horizontal lines evenly through height of grid\n (state.lineQuantity + 2).times do\n state.gridY << curr_y # adds curr_y to gridY collection\n curr_y += deltaY # increments curr_y to distance between horizontal lines\n end\n end",
"title": ""
},
{
"docid": "9ad372e26bc1fd54680253fe7bc79627",
"score": "0.506956",
"text": "def add_cells(row, col)\n if col == 0\n row[col] + row[col + 1]\n elsif col == (a[row].length -1)\n row[col -1] + row[col]\n else\n row[col -1] + row[col] + row[col + 1]\n end\nend",
"title": ""
},
{
"docid": "6962fc9779a359446205ab3119993b49",
"score": "0.50637084",
"text": "def add_cells(list)\n list.each { |obj| add_cell(obj) }\n self\n end",
"title": ""
},
{
"docid": "801071b38e3f9f31ba057170622d210f",
"score": "0.5057887",
"text": "def renumber_cells(clues, min_word_length=2)\n num = 0\n # make sure we don't change original\n clues = clues.dup\n each_cell do |c, x, y|\n unless c.black?\n across = x == 0 || cell_at(x - 1, y).black?\n across &&= (min_word_length - 1).times.all? do |n|\n x1 = x + n + 1\n x1 < width && !cell_at(x1, y).black?\n end\n\n down = y == 0 || cell_at(x, y - 1).black?\n down &&= (min_word_length - 1).times.all? do |n|\n y1 = y + n + 1\n y1 < height && !cell_at(x, y1).black?\n end\n\n n = across || down ? num += 1 : nil\n\n c.across_clue = clues.shift if across\n c.down_clue = clues.shift if down\n\n c.number = n\n end\n end\n end",
"title": ""
},
{
"docid": "b02ffbe9fba0e153f15b7aaf881ac8ef",
"score": "0.50528115",
"text": "def load_cells()\n\t\t(0..@m-1).each do |row|\n\t\t\t(0..@n-1).each do |col| \n\t\t\t\t@cells [row] [col] = Cell.new(col,row)\n\t\t\tend\n\t\tend\n\tend",
"title": ""
},
{
"docid": "dead34c1f3e20d7076c3479cb8ac18b4",
"score": "0.5043507",
"text": "def fill_board_with_cells\n (0..@row_count).each do |row|\n (0..@col_count).each do |col|\n @board[[row, col]] = Cell.new\n end\n end\n end",
"title": ""
},
{
"docid": "c183a219425de8a8e3878e1bb8616722",
"score": "0.50430745",
"text": "def init_cells\n\t\t\teach_cell do |c|\n\t\t\t\tcol, row = c.x, c.y\n\t\t\t\tc.up = self[col, row - 1]\n\t\t\t\tc.down = self[col, row + 1]\n\t\t\t\tc.left = self[col - 1, row]\n\t\t\t\tc.right = self[col + 1, row]\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "7254ccb13f1bfbee94a8a0a35ece8832",
"score": "0.50397134",
"text": "def addCell(cell)\n @cells << cell\n end",
"title": ""
},
{
"docid": "eec99b9878bf258d03517fbda8a9ba9d",
"score": "0.5023841",
"text": "def get_grid_lines\n grid_lines = []\n (0...9).each { |row_num| grid_lines << build_line_from_row(row_num) }\n grid_lines\n end",
"title": ""
},
{
"docid": "9e4ca0388077fa0d6f0845f048244195",
"score": "0.5021809",
"text": "def merge_cells(cells)\n @merged_cells << if cells.is_a?(String)\n cells\n elsif cells.is_a?(Array)\n cells = cells.sort { |x, y| x.r <=> y.r }\n \"#{cells.first.r}:#{cells.last.r}\"\n end\n end",
"title": ""
},
{
"docid": "5da2af05f3437df1f79d6653638d9524",
"score": "0.5015775",
"text": "def add_block_cell_lists\n (0..8).each do |block_index| \n cellList = SudokuCellList.new\n [0,1,2].each do |row_index|\n [0,1,2].each do |column_index|\n row = (block_index / 3) * 3 + row_index\n column = (block_index % 3) * 3 + column_index\n cellList << cell_at_pos(row,column) \n end\n end\n @cellLists << cellList\n end\n end",
"title": ""
},
{
"docid": "a0d9908a2b8315bd9956a189b50d0005",
"score": "0.4999612",
"text": "def render_cell_numbers\n state.cell_numbers.each_with_index do |cell, index|\n # Math that approx centers the number in the cell\n label_x = (cell.x * grid.cell_size) + grid.cell_size / 2 - 5\n label_y = (cell.y * grid.cell_size) + (grid.cell_size / 2) + 5\n\n outputs.labels << [label_x, label_y, (index + 1).to_s]\n end\n end",
"title": ""
},
{
"docid": "6cc3709f32dde4d36e2ff7ca77ca7aff",
"score": "0.4997441",
"text": "def highlight_cells(cells, roundedness=nil)\n return if cells.empty?\n @cmd << [:stroke, 'none']\n @cmd << [:fill, 'rgba(255, 255, 0, 0.3)']\n coordinates_of(cells).each do |c|\n roundedness ||= [c[:h], c[:w]].min / 2\n pts = [c[:x], c[:y], c[:x]+c[:w], c[:y]+c[:h], roundedness, roundedness].join ' '\n @cmd << [:draw, \"roundrectangle #{pts}\"]\n end\n end",
"title": ""
},
{
"docid": "f13ea708cab77624a15f1c156e7dcd5f",
"score": "0.4989554",
"text": "def horizontal\n rows = []\n height.times do |y|\n rows << board.select { |cell| cell.coord.y == y }\n end\n rows\n end",
"title": ""
},
{
"docid": "92482ddf6a30b1410612e1e10d432cf7",
"score": "0.4976648",
"text": "def cells_with_wire(wire)\r\n grid = []\r\n current_x = 0\r\n current_y = 0\r\n for i in (0..wire.length-1) #split is getting one extra blank field for some reason?\r\n direction = wire[i].slice(0)\r\n steps = wire[i].slice(1,10).to_i\r\n case direction\r\n when \"R\"\r\n #going right, keep y digit, increase x\r\n grid += ((1...steps).map{|x| [current_x + x, current_y]})\r\n current_x += steps\r\n when \"L\"\r\n #going left, keep y, decrease x\r\n grid += ((1...steps).map{|x| [current_x - x, current_y]})\r\n current_x -= steps\r\n when \"U\"\r\n #going up, keep x, increase y\r\n grid += ((1...steps).map{|y| [current_x, current_y+y]})\r\n current_y += steps\r\n\r\n when \"D\"\r\n #going down, keep x, decrease y\r\n grid += ((1...steps).map{|y| [current_x, current_y-y]})\r\n current_y -= steps\r\n else\r\n puts \"Error #{instruction} does not make sense\"\r\n break\r\n end\r\n end\r\n grid\r\nend",
"title": ""
},
{
"docid": "7be6c371e54e8dc112441080769b1930",
"score": "0.49756733",
"text": "def add(cells)\n self << if cells.is_a?(String)\n cells\n elsif cells.is_a?(Array)\n Axlsx.cell_range(cells, false)\n end\n end",
"title": ""
},
{
"docid": "851af229cac8fd1bbfc58e1897995e4b",
"score": "0.49586546",
"text": "def x_grid_lines\n scores.each_with_index.map do |score, index|\n tag.line x1: xcord(index),\n x2: xcord(index),\n y1: padding[:top],\n y2: padding[:bottom]\n end.join.html_safe\n end",
"title": ""
},
{
"docid": "ba9c13fa557b865e7b09afcb3094d527",
"score": "0.49513775",
"text": "def update\n\t\t\t@winning_rows = []\n\n\t\t\t8.times { @winning_rows << [] }\n\n\t\t\t3.times do |i|\n\t\t\t\t3.times do |j|\n\t\t\t\t\t@winning_rows[i] << @squares[3 * i + j]\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t3.times do |i|\n\t\t\t\t3.times do |j|\n\t\t\t\t\t@winning_rows[i+3] << @squares[i + 3 * j]\n\t\t\t\tend\n\t\t\tend\n\n\t\t\t[0,4,8].each do |i|\n\t\t\t\t@winning_rows[6] << @squares[i]\n\t\t\tend\n\n\t\t\t[2,4,6].each do |i|\n\t\t\t\t@winning_rows[7] << @squares[i]\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "1382a60807e4f6ed97af2f3bb235e9a7",
"score": "0.49497217",
"text": "def create_graph(grid)\r\n cell_grid = []\r\n grid.each do |row|\r\n cells = []\r\n row.each do |element|\r\n cell = Cell.new(element)\r\n cells.push(cell)\r\n end\r\n cell_grid.push(cells)\r\n end\r\n\r\n cell_grid.each_with_index do |cell_row, row|\r\n cell_row.each_with_index do |cell, col|\r\n row == 0 ? nil : cell.surroundings.push(cell_grid[row - 1][col])\r\n col == cell_row.size - 1 ? nil : cell.surroundings.push(cell_grid[row][col + 1])\r\n col == 0 ? nil : cell.surroundings.push(cell_grid[row][col - 1])\r\n row == cell_grid.size - 1 ? nil : cell.surroundings.push(cell_grid[row + 1][col])\r\n end\r\n end\r\n cell_grid\r\nend",
"title": ""
},
{
"docid": "9975c4d22161fd6e7433f46f0d29a8ab",
"score": "0.49468157",
"text": "def print_current_grid(grid)\nputs \" \n 1 2 3 4 5 6 7 8 9\n ======+=======+======\n A #{grid[0]} #{grid[1]} #{grid[2]} | #{grid[3]} #{grid[4]} #{grid[5]} | #{grid[6]} #{grid[7]} #{grid[8]} \n B #{grid[9]} #{grid[10]} #{grid[11]} | #{grid[12]} #{grid[13]} #{grid[14]} | #{grid[15]} #{grid[16]} #{grid[17]}\n C #{grid[18]} #{grid[19]} #{grid[20]} | #{grid[21]} #{grid[22]} #{grid[23]} | #{grid[24]} #{grid[25]} #{grid[26]}\n ======+=======+======\n D #{grid[27]} #{grid[28]} #{grid[29]} | #{grid[30]} #{grid[31]} #{grid[32]} | #{grid[33]} #{grid[34]} #{grid[35]}\n E #{grid[36]} #{grid[37]} #{grid[38]} | #{grid[39]} #{grid[40]} #{grid[41]} | #{grid[42]} #{grid[43]} #{grid[44]}\n F #{grid[45]} #{grid[46]} #{grid[47]} | #{grid[48]} #{grid[49]} #{grid[50]} | #{grid[51]} #{grid[52]} #{grid[53]}\n ======+=======+======\n G #{grid[54]} #{grid[55]} #{grid[56]} | #{grid[57]} #{grid[58]} #{grid[59]} | #{grid[60]} #{grid[61]} #{grid[62]}\n H #{grid[63]} #{grid[64]} #{grid[65]} | #{grid[66]} #{grid[67]} #{grid[68]} | #{grid[69]} #{grid[70]} #{grid[71]}\n I #{grid[72]} #{grid[73]} #{grid[74]} | #{grid[75]} #{grid[76]} #{grid[77]} | #{grid[78]} #{grid[79]} #{grid[80]}\"\nend",
"title": ""
},
{
"docid": "f5350fc0f05b25a89c3b23aaac5d6a45",
"score": "0.49467835",
"text": "def print_grid\n grid.each do |row|\n row.each do |cell|\n if cell.alive?\n print '0'\n else\n print '.'\n end\n end\n print \"\\n\"\n end\n end",
"title": ""
},
{
"docid": "6ca6530933fd4dd740c64c3896273425",
"score": "0.4932441",
"text": "def initialize(alive_cells)\n init_grid(alive_cells)\n end",
"title": ""
},
{
"docid": "eca36de12162981d20fe40f4a0be0f47",
"score": "0.49293762",
"text": "def push_numbers\n array = to_2d_array(@game)\n new_array = []\n @row.times do |r|\n # Remove all 0\n row = array[r].reject { |i| i == 0 }\n # Add back 0\n row.unshift(0) while row.count < @col\n new_array << row\n end\n @game = new_array.reduce(&:+)\n end",
"title": ""
},
{
"docid": "2c6b9927d6036a69a3cd82b8f8b2df81",
"score": "0.4927947",
"text": "def fill_number(grids)\n grids.each_with_index do |rows, r|\n rows.each_with_index do |grid, c|\n pos = [r, c]\n self[pos] = surrouding_bomb(pos) if grid == \" \" && surrouding_bomb(pos) != 0\n end\n end\n end",
"title": ""
},
{
"docid": "3f5ced1c6d1d089f7110e62afa714234",
"score": "0.49268866",
"text": "def fill_grid\n $thegrid.each_with_index do |line, i|\n start = (i==0) ? 1 : i*10\n stop = (i==8) ? 90 : ((i+1)*10 - 1)\n count = line.inject {|sum, n| sum + n }\n\n line.each_with_index do |n, j|\n if n > 0 then\n $thegrid[i][j] = rand(stop - start - count + 2) + start\n start = $thegrid[i][j] + 1 #increasing numbers\n count -= 1\n end\n end\n end\nend",
"title": ""
},
{
"docid": "a3c55aec24910a086325d84c0bc03e99",
"score": "0.49222013",
"text": "def rows_of_cols(cells = self.question_cells)\n result = cells.inject(Dictionary.new) do |rows, cell|\n rows[cell.row] = Dictionary.new if rows[cell.row].nil?\n rows[cell.row][cell.col] = cell\n rows\n end\n end",
"title": ""
},
{
"docid": "7d2d3177753e9b06d77136845ba2961e",
"score": "0.4918913",
"text": "def get_cells\n\t\t@filled_cells = Cell.where(puzzle_id: self.id)\n\tend",
"title": ""
},
{
"docid": "15490cb0a9f0174710aa3ed6f5726e05",
"score": "0.49145052",
"text": "def grid\n puts \"+---+---+---+\"\n puts \"| #{@board[0].value} | #{@board[1].value} | #{@board[2].value} |\"\n puts \"+---+---+---+\"\n puts \"| #{@board[3].value} | #{@board[4].value} | #{@board[5].value} |\"\n puts \"+---+---+---+\"\n puts \"| #{@board[6].value} | #{@board[7].value} | #{@board[8].value} |\"\n puts \"+---+---+---+\"\n end",
"title": ""
},
{
"docid": "5f639b8ed874b70d34a2ca79696c2a24",
"score": "0.49083295",
"text": "def across_start_cells\n cells.across_start_cells\n end",
"title": ""
},
{
"docid": "b89f23b1033503f8f8c22e1f14305068",
"score": "0.49012208",
"text": "def addHorizontal(player, num)\n col = -1 \n sum = 0\n @board.each do |row|#separates board into rows\n sum = 0\n col = 0\n gap = 0\n row.each do |index|#separates board into indexes\n if index == player\n sum += 1\n else\n sum = 0\n end\n if sum == num #Checks if sum combination has been reached and which side to add it on\n if col + 1 < 7 && row[col+1] == nil\n addDisc(player,col+1)\n return col + 1\n end\n if col - 3 > -1 && row[col-3] == nil\n addDisc(player,col-3)\n return col -3\n end\n end\n col +=1\n end\n end\n return -1 \n end",
"title": ""
},
{
"docid": "85329e3792213cec5db81302317313c4",
"score": "0.4891551",
"text": "def add_row\n @grid.unshift Array.new(@grid.first.length)\n end",
"title": ""
},
{
"docid": "ab7f81cd8667a109307ce646c1e24e83",
"score": "0.4889512",
"text": "def create_graph(grid)\n cell_grid = []\n grid.each do |row|\n cells = []\n row.each do |element|\n cell = Cell.new(element)\n cells.push(cell)\n end\n cell_grid.push(cells)\n end\n\n cell_grid.each_with_index do |cell_row, i|\n \n cell_row.each_with_index do |cell, j|\n i == 0 ? nil : cell.surroundings.push(cell_grid[i-1][j])\n j == 0 ? nil : cell.surroundings.push(cell_grid[i][j-1])\n i == cell_grid.size - 1 ? nil : cell.surroundings.push(cell_grid[i+1][j])\n j == cell_row.size - 1 ? nil : cell.surroundings.push(cell_grid[i][j+1])\n end\n\n end\n cell_grid\nend",
"title": ""
},
{
"docid": "c4ca3a115d3419c50f84c2b20a5918d6",
"score": "0.48885116",
"text": "def <<(cell)\n @cells << cell\n end",
"title": ""
},
{
"docid": "e021c74a07d5496bf5ce8cf404f157ca",
"score": "0.48878375",
"text": "def add_missing_cells(answer)\n a_cells = answer.answer_cells.ratings #.map {|a| [a.row, a.col] }\n count = 0\n # find missing\n cells = a_cells.map {|a| [a.row, a.col] }\n cell_arr = cells.first\n return if !(cell_arr && cell_arr.size == 2) \n\n q_cells = answer.question.question_cells.ratings.map {|a| [a.row, a.col] }\n q_cells_size = q_cells.size\n missing_cells = q_cells - cells\n # puts \"Answer: #{answer.id}\\nmissing cells: #{missing_cells.inspect}\"\n new_cells = []\n missing_cells.each do |m_cell|\n row, col = m_cell\n find_row = row - 1 # try one before this\n cells_away = 1 # how far the found cell is from the one to fill in\n while((prev_item = a_cells.detect { |c| c.row == find_row}).nil? && find_row > 0) do\n find_row -= 1\n cells_away += 1\n end\n # puts \"find_row: #{find_row} cells_away: #{cells_away}\"\n if prev_item && (item = prev_item.item) && find_row > 0 && find_row < q_cells_size\n cells_away.times { item.succ! }\n # puts \"new item: #{item}, m_cell: #{m_cell.inspect} prev_cell: #{prev_item.inspect}\"\n unless exists = answer.answer_cells(true).find_by_row_and_col(row, col)\n new_cells << ac = answer.answer_cells.create(:item => item, :row => row, :col => col, :answertype => 'Rating', :value => '')\n count += 1\n # puts \"AC created: #{ac.inspect}, item: #{item}, row: #{row}, m_cell: #{m_cell.inspect}\"\n end\n end\n row = col = find_row = cells_away = prev_item = exists = nil\n end if answer.survey_answer.done\n puts \"COUNT #{count} ANswer #{answer.id} q_id #{answer.question_id} r,c,i: \" + new_cells.map {|c| [c.row, c.col, c.item].join(', ')}.join(' ')\n answer = answer.question = nil\n count\n end",
"title": ""
},
{
"docid": "111c64caaf200a8dc6f3ff06d6c23d45",
"score": "0.48834208",
"text": "def wrap_up_same_col(cell) [0, cell.col] end",
"title": ""
},
{
"docid": "3850cb00e1ce9186d0013aa05eed6df8",
"score": "0.4876914",
"text": "def render_grid_lines\n outputs.lines << (0..grid.width).map { |x| vertical_line(x) }\n outputs.lines << (0..grid.width).map { |x| early_exit_vertical_line(x) }\n outputs.lines << (0..grid.height).map { |y| horizontal_line(y) }\n outputs.lines << (0..grid.height).map { |y| early_exit_horizontal_line(y) }\n end",
"title": ""
},
{
"docid": "a080032adf6f41d325642c5d36648074",
"score": "0.4875097",
"text": "def solve\n raise 'invalid game given' unless @grid.valid?\n\n exclude_preset_numbers\n\n unfilled_cells = []\n @grid.each { |cell| unfilled_cells.push(cell) unless cell.filled? }\n unfilled_cells = unfilled_cells.sort { |cell_a, cell_b| cell_a.num_possible <=> cell_b.num_possible }\n solve_using(unfilled_cells)\n\n @grid.solution\n end",
"title": ""
},
{
"docid": "8a9197dab031e6ec86ff948ec9c63cf7",
"score": "0.48696917",
"text": "def make_cell_lists\n @cellLists = []\n add_row_cell_lists\n add_column_cell_lists\n add_block_cell_lists\n end",
"title": ""
},
{
"docid": "f6092d3c33027cda933f4fbe5edde619",
"score": "0.486926",
"text": "def board(moved_cells = %w[1 2 3 4 5 6 7 8 9])\n cells = moved_cells\n puts <<-GRID\n\n #{cells[0]} | #{cells[1]} | #{cells[2]}\n ---+---+---\n #{cells[3]} | #{cells[4]} | #{cells[5]}\n ---+---+---\n #{cells[6]} | #{cells[7]} | #{cells[8]}\n\n GRID\nend",
"title": ""
},
{
"docid": "793fb91c2a0c0e1fa0838366f047d20a",
"score": "0.4866491",
"text": "def populate\n #debugger\n @grid.each_with_index do |subarr, row| \n subarr.each_with_index do |el, col| \n if row == 0 \n @grid[row][col] = TOP_ROW[col] \n elsif row == 1 \n @grid[row][col] = [:pawn, :B]\n elsif row == 6\n @grid[row][col] = [:pawn, :W]\n elsif row == 7\n @grid[row][col] = BOT_ROW[col]\n elsif row >= 2 && row <= 5\n @grid[row][col] = [:null]\n end\n end\n end\n end",
"title": ""
},
{
"docid": "b36003201011794fb8b123450cbedfcd",
"score": "0.48641288",
"text": "def update_cells(top_row, left_col, darray)\n darray.each_with_index do |array, y|\n array.each_with_index do |value, x|\n self[top_row + y, left_col + x] = value\n end\n end\n end",
"title": ""
},
{
"docid": "26b2dc3c0acc760bb215bc015b442afe",
"score": "0.48625126",
"text": "def configure_cells\n each_cell do |cell|\n row, col = cell.row, cell.column\n\n cell.north = self[row - 1, col]\n cell.south = self[row + 1, col]\n cell.west = self[row, col - 1]\n cell.east = self[row, col + 1]\n end\n end",
"title": ""
},
{
"docid": "1ba96bb75a19c27156342d22fef2910e",
"score": "0.48533294",
"text": "def apply_the_rules(puzzle)\n\n previous_iteration = nil\n while (puzzle.flatten(1) != puzzle.flatten(2) || puzzle.flatten.include?(0)) &&\n (puzzle != previous_iteration)\n\n previous_iteration = Marshal.load(Marshal.dump(puzzle))\n\n # cell can't be same as any other cell in group\n puzzle.map!.each_with_index do |row, y|\n row.map!.each_with_index do |cell, x|\n if cell == 0 || cell.class == Array\n cell_could_be = (1..9).to_a -\n row - # values in row\n puzzle.transpose[x] - # values in column\n puzzle[(y/3)*3, 3].transpose[(x/3)*3, 3].flatten(1) # values in square\n # if cell_could be is empty then the grid has no solution\n return false if cell_could_be.size == 0\n cell_could_be.size == 1 ? cell_could_be[0] : cell_could_be\n else\n cell\n end\n end\n end\n end\n\n previous_iteration = nil\n while (puzzle.flatten(1) != puzzle.flatten(2) || puzzle.flatten.include?(0)) &&\n (puzzle != previous_iteration)\n \n previous_iteration = Marshal.load(Marshal.dump(puzzle))\n \n ## if a number can only go in one cell in a group, then it must go there\n # apply rule to rows:\n puzzle = rule(puzzle)\n # apply rule to columns:\n #puzzle = puzzle.transpose\n #puzzle = rule(puzzle)\n #puzzle = puzzle.transpose\n\n end\n\n puzzle\n\nend",
"title": ""
},
{
"docid": "31c302849d8e2d6aad477b3e3ef16138",
"score": "0.48502222",
"text": "def gridlines=(v) Axlsx.validate_boolean(v); @gridlines = v; end",
"title": ""
},
{
"docid": "cdebc626eef74e298a12eea0445471ae",
"score": "0.48496357",
"text": "def populate_array\n\t\t@filled_cells.each do |c|\n\t\t\tx = c[:x]\n\t\t\ty = c[:y]\n\t\t\t@puzzle_array[y][x] = 1\n\t\tend\n\tend",
"title": ""
},
{
"docid": "bc3b7767ecbe39e9f1f7bff1ddcc0935",
"score": "0.48482764",
"text": "def build_minefield\n @grid = Array.new(@row_count) {Array.new(@column_count) {Cell.new}}\n end",
"title": ""
},
{
"docid": "4b61f2a94d6eefac32d6cb5989852493",
"score": "0.48304868",
"text": "def convert_grid(cellGrid)\n\n\t\tgrid = Array.new(@lines.size()) do\n\t\t\tArray.new(@clns.size()) do\n\t\t\t\t0\n\t\t\tend\n\t\tend\n\t\t(0...@lines.size()).each do |i|\n\t\t\t(0...@clns.size()).each do |j|\n\t\t\t\tgrid[i][j]=1 if cellGrid.cellPosition(i, j).state==Cell::CELL_BLACK\n\t\t\t\tgrid[i][j]=0 if cellGrid.cellPosition(i, j).state==Cell::CELL_WHITE\n\t\t\t\tgrid[i][j]=-1 if cellGrid.cellPosition(i, j).state==Cell::CELL_CROSSED\n\t\t\tend\n\t\tend\n\t\treturn grid\n\tend",
"title": ""
},
{
"docid": "1059f67e576ac5a1eaf9a45986e3d678",
"score": "0.48296747",
"text": "def build_grid\n\t# create 300x300 grid\n\tgrid = Array.new(301) {Array.new(301, 0)}\n\n\t# loop through rows\n\t(1..300).each do | r |\n\t\t# loop through columns\n\t\t(1..300).each do | c |\n\t\t\t# get power level for every cell\n\t\t\tgrid[r][c] = cell_power_level(r, c)\n\t\tend\n\tend\n\n\tgrid\nend",
"title": ""
},
{
"docid": "de05388e24ed360060203f2bff3cd30c",
"score": "0.48275492",
"text": "def render\n x = 0\n while(x < grid.width) do\n minterm = grid.col(x)\n x += 1\n next if minterm.count {|e| e =~ /c|n/i } <= 2\n process_column(x-1)\n end\n\n # now move the 'C' down to the added ancilla bit\n history = [nil] * grid.height\n (0..grid.width-1).each do |x|\n minterm = grid.col(x).join('')\n minterm = minterm.sub('Ca', '.c').tr('10a-','+.').split('')\n minterm = minterm.map.with_index do |x, i|\n case x\n when 'C' then history[i]\n when 'c', 'n' then history[i] = x\n else\n x\n end\n end\n grid.replace_col(x,minterm)\n end\n\n grid\n end",
"title": ""
},
{
"docid": "a7631bd9503afc65086e0cd7fec60114",
"score": "0.48164523",
"text": "def load_connected_cells(binary_array)\n @cells.each_with_index do |row, index_row| # connects connecting cells to one another\n row.each_with_index do |cell, index_col|\n cell_index = get_cell_index(index_row, index_col)\n cell.connect_cells(@cells[index_row][index_col + 1]) if binary_array[cell_index + 1] == 0\n cell.connect_cells(@cells[index_row - 1][index_col]) if binary_array[cell_index - (@width * 2 + 1)] == 0\n end\n end\n end",
"title": ""
},
{
"docid": "46fc2072b69b9720b7994b946de3afcf",
"score": "0.48157135",
"text": "def populate_cells\n @width.each do |letter|\n @height.each do |number|\n cell_coords = \"#{letter}#{number}\"\n @cells[cell_coords] = Cell.new(cell_coords)\n end\n end\n end",
"title": ""
},
{
"docid": "2d8b1bdbcc264a09fd9f59b93c65db26",
"score": "0.4813562",
"text": "def grow(lines, columns)\n\t\tif lines < @lines then\n\t\t\traise InvalidResizeSizeException, \"cannot grow lines #{@lines} to #{lines}\"\n\t\telsif columns < @columns then\n\t\t\traise InvalidResizeSizeException, \"cannot grow columns #{@columns} to #{columns}\"\n\t\tend\n\t\tlinesToAdd = lines - @lines\n\t\tcolmsToAdd = columns - @columns\n\n\t\thypothesis = @grid[0][0].hypothesis\n\n\t\tself.each_line_with_index do |line, j|\n\t\t\tcells = Array.new(colmsToAdd) do |i|\n\t\t\t\tCell.new(hypothesis, j, @columns + i)\n\t\t\tend\n\t\t\t@grid[j] = line + cells\n\t\tend\n\n\t\t(0...linesToAdd).each do |j|\n\t\t\tnewLine = Array.new(columns) do |i|\n\t\t\t\tCell.new(hypothesis, @lines + j, i)\n\t\t\tend\n\t\t\t@grid.push(newLine)\n\t\tend\n\t\t@columns = columns\n\t\t@lines = lines\n\t\treturn self\n\tend",
"title": ""
},
{
"docid": "6c44fa2c3480ae668ab639542eedae7f",
"score": "0.4813203",
"text": "def rec_solve_next_cell grid, row, col\n if col < 8\n return rec_solve_sudoku grid, row, col + 1 # Go to next cell on same row\n else\n return rec_solve_sudoku grid, row + 1, 0 # Go to next row\n end \nend",
"title": ""
}
] |
c845ff22a8902cf942c409f49b2808a7
|
Returns a hash with the contents of the sqs.yml file
|
[
{
"docid": "3aafe903c853fd8b85c734973f422d2e",
"score": "0.6576069",
"text": "def config\n @config ||= YAML.load_file(\"#{Rails.root}/config/sqs.yml\").with_indifferent_access\n end",
"title": ""
}
] |
[
{
"docid": "94e4fd2bcea4ea1dd5be09edd9e5cda3",
"score": "0.61511236",
"text": "def hash\n require 'yaml'\n hash = YAML.load(File.read(self.yaml_file))\n return hash\n end",
"title": ""
},
{
"docid": "590364872e3efd367926a8566fcf07f1",
"score": "0.5985398",
"text": "def db_yml_contents\n return File.open(SETTINGS[:rails_db_yml], 'r')\n end",
"title": ""
},
{
"docid": "c0f6e98472c46a592a281fb34a1b4bdd",
"score": "0.59612083",
"text": "def hash_from_yaml_file(file_name)\n raise \"invalid file name: #{file_name}\" unless File.exist?(file_name) \n YAML.load_file(file_name)\n end",
"title": ""
},
{
"docid": "cffc8b95741a95978c09f4c0bfe9a941",
"score": "0.57721525",
"text": "def hash_from_yaml_file(file)\n yaml = YAML.load_file(file)\n end",
"title": ""
},
{
"docid": "7a8ea4aadfbd8c4ae3db1361e25d4559",
"score": "0.5672911",
"text": "def config_hash\n YAML.load_file(config_file)\n end",
"title": ""
},
{
"docid": "71da177a05826d3096f00525abae7684",
"score": "0.5619182",
"text": "def dbconfig\n YAML.load(ERB.new(read('config/database.yml')).result)\n end",
"title": ""
},
{
"docid": "8b56b71599591fbed1c5acfdf29dee1a",
"score": "0.555791",
"text": "def database_yml_file\n shared_path.join('config/database.yml')\n end",
"title": ""
},
{
"docid": "f5df6be11dfb4b4154fdf86bdcf955f9",
"score": "0.5513465",
"text": "def get_hash\n File.file?(\".rake-sha\") ? File.open(\".rake-sha\", \"r\") { |f| f.read } : \"\"\nend",
"title": ""
},
{
"docid": "6ed17baa9cb7b2262f4dfef2ec804c31",
"score": "0.55033135",
"text": "def read\n if ! File.exists?(config_file)\n raise UserError, \"Kitchen YAML file #{config_file} does not exist.\"\n end\n\n Util.symbolized_hash(combined_hash)\n end",
"title": ""
},
{
"docid": "6b95ae6ed1255958f6f13771434ded35",
"score": "0.54914165",
"text": "def to_hash\n yaml\n end",
"title": ""
},
{
"docid": "15cbbdf48b77dee6e74e4506cf9e6d29",
"score": "0.5487154",
"text": "def get_database_yml(host, ssh_username, path_to_dbyml)\n dbyml = \"\"\n Net::SFTP.start(host, ssh_username) do |sftp| \n sftp.file.open(path_to_dbyml) do |file|\n dbyml = file.read\n end\n end\n dbyml\n end",
"title": ""
},
{
"docid": "e5c9291df4721cfa81eaf4a60705aca0",
"score": "0.5462586",
"text": "def yaml_to_hash(file_name)\n return {} if (content = open(file_name).read).empty?\n YAML.load(ERB.new(content).result).to_hash\n end",
"title": ""
},
{
"docid": "88ddb131c38ca31864f50e8a83ca6e11",
"score": "0.5452352",
"text": "def hash\n return config.hash\n end",
"title": ""
},
{
"docid": "3ff2912ef0d832be11b7d28921174645",
"score": "0.5424389",
"text": "def versions_hash\n YAML.load_file(versions_path)\n end",
"title": ""
},
{
"docid": "71a5b3513b0be3f6dd5b2fbf7eb71fe8",
"score": "0.54193497",
"text": "def database_configuration\n YAML::load(ERB.new(IO.read(database_configuration_file)).result)\n end",
"title": ""
},
{
"docid": "df10c080c447f2c832aa99643ba4da93",
"score": "0.5415484",
"text": "def to_hash\n YAML.load(File.read(@pathname))\n end",
"title": ""
},
{
"docid": "d3db3fea732fcd0eb8a639168913a184",
"score": "0.5385863",
"text": "def index\n\t\t@configuration_hash = BlankConfiguration::ConfigFile.open('sa_config.yml').hash\n\tend",
"title": ""
},
{
"docid": "a3e6597df8f8f646f9ec50d1e197e69b",
"score": "0.5371494",
"text": "def read_yml file\n raise ArgumentError unless String === file\n\n result = nil\n\n log(:debug) { \" read_yml #{file.inspect}\" }\n\n # No content for key if file does not exist.\n return EMPTY_HASH unless file && File.exist?(file)\n\n h = parse_yml_hash(File.read(file), file)\n\n h.freeze\n end",
"title": ""
},
{
"docid": "8cc859c0651be1f5fc6d988afe5f5db4",
"score": "0.5359725",
"text": "def read_db_yaml_file\n ::YAML.load(database_config.read)\n end",
"title": ""
},
{
"docid": "fb73f73675f9b323bec834a041e2590e",
"score": "0.5315889",
"text": "def credentials\n YAML.load_file(CONFIG_FILE)\n end",
"title": ""
},
{
"docid": "21ae646c076e8b5c15a926aeed7b1eb7",
"score": "0.53110427",
"text": "def database_configuration\n require 'erb'\n YAML::load(ERB.new(IO.read(database_configuration_file)).result)\n end",
"title": ""
},
{
"docid": "21ae646c076e8b5c15a926aeed7b1eb7",
"score": "0.53110427",
"text": "def database_configuration\n require 'erb'\n YAML::load(ERB.new(IO.read(database_configuration_file)).result)\n end",
"title": ""
},
{
"docid": "2fe46deab6b757457431a1b2ac9a2386",
"score": "0.5309695",
"text": "def yaml2hash(file_name)\n ret = YAML.load(File.read(file_name))\n ret = {} unless ret.is_a? Hash\n ret\n end",
"title": ""
},
{
"docid": "0368076e46c90826b18d9ca111196f76",
"score": "0.53007776",
"text": "def loadYML( filename)\n hash = YAML::load( File.open( filename ) )\n if $opt_debug\n $stderr.puts hash.keys.size\n end\n return hash\nend",
"title": ""
},
{
"docid": "61061e1ea939f699cc12b3d7a1bf81e0",
"score": "0.5292846",
"text": "def verify_config\n if !@config.has_key? 'sqs'\n raise Huck::Error, 'missing sqs config'\n end\n ['access_key_id', 'secret_access_key', 'region',\n 'queue_name'].each do |key|\n if !@config['sqs'].has_key? key\n raise Huck::Error, \"missing sqs config: #{key}\"\n end\n end\n end",
"title": ""
},
{
"docid": "75709e12b1f6ba20b40ce6e77737032f",
"score": "0.528947",
"text": "def load_database_yaml; end",
"title": ""
},
{
"docid": "6007edf74c594863debf0615d4bfa4c4",
"score": "0.52824855",
"text": "def to_hash\n config_content\n end",
"title": ""
},
{
"docid": "102e93bec06a175ae27a42eaaf124f6a",
"score": "0.5265057",
"text": "def let_yml_superhash\n # returns a big old hash for drying out of LET statements, \n # PROS: i'm sick of specifying which yml file things come out of,\n # maybe i could've dried this out too, but i'm only doing this one time so whatever\n # CONS: all keys across all yaml files must be unique, bc the way i named things below\n # CONS: did this really save me that much time? IDK... fun experiment though\n \n return { \n album1: works(:album1), \n album2: works(:album2),\n book1: works(:book1),\n book2: works(:book2),\n movie1: works(:movie1),\n movie2: works(:movie2),\n movie3: works(:movie3),\n movie4: works(:movie4),\n movie5: works(:movie5),\n movie6: works(:movie6),\n movie7: works(:movie7),\n movie8: works(:movie8),\n movie9: works(:movie9),\n movie10: works(:movie10),\n movie11: works(:movie11),\n \n user1: users(:user1),\n user2: users(:user2),\n user3: users(:user3),\n user4: users(:user4),\n user5: users(:user5),\n user6: users(:user6),\n \n vote1m1: votes(:vote1m1),\n vote1m2: votes(:vote1m2),\n vote1m3: votes(:vote1m3),\n vote1m4: votes(:vote1m4),\n vote1m5: votes(:vote1m5),\n vote1m6: votes(:vote1m6),\n vote1m7: votes(:vote1m7),\n vote1m8: votes(:vote1m8),\n vote1m9: votes(:vote1m9),\n vote1m10: votes(:vote1m10),\n \n vote2m1: votes(:vote2m1),\n vote2m2: votes(:vote2m2),\n vote2m3: votes(:vote2m3),\n vote3m1: votes(:vote3m1),\n vote3m2: votes(:vote3m2),\n vote4m1: votes(:vote4m1),\n \n vote1b1: votes(:vote1b1),\n vote1b2: votes(:vote1b2),\n vote2b2: votes(:vote2b2),\n vote1a1: votes(:vote1a1)\n }\n end",
"title": ""
},
{
"docid": "32b2dd3557b2bed501aa30005421263b",
"score": "0.5261378",
"text": "def credentials\n Psych.load_file(File.expand_path('../users.yml', data_path))\nend",
"title": ""
},
{
"docid": "e24f31fe33ad5293fd7e73801a220fc0",
"score": "0.52327114",
"text": "def jobs_yml(commit_sha)\n file =\n begin\n file = bitbucket_client.repos.sources.get(repository_owner, repository_slug,\n commit_sha, ProjectFile::JOBS_YML_PATH)\n Base64.decode64(file.content)\n rescue BitBucket::Error::NotFound\n nil\n end\n\n if file.blank?\n file = project.project_files.where(path: ProjectFile::JOBS_YML_PATH).\n first.try(:contents)\n end\n\n file\n end",
"title": ""
},
{
"docid": "2424118087737016582cd5990385f808",
"score": "0.5220281",
"text": "def data_for file_symbol \n YAML.load(File.open(\n File.join(RAILS_ROOT, 'db', 'seeds_data', file_symbol.to_s + '.yaml')\n ).read)\nend",
"title": ""
},
{
"docid": "63cc64c77b8b694bcc2ec2fd9e85e427",
"score": "0.519885",
"text": "def create hash\n File.open(\"#{ENV['HOME']}/.aem.yaml\", 'w') {|f| f.write contents.to_yaml }\n end",
"title": ""
},
{
"docid": "f2b8f574eef8547ceba8adf07e93a156",
"score": "0.51776546",
"text": "def config_file\n if File.exists?(config_file_path)\n hash = YAML.load_file(config_file_path)\n else\n hash = {}\n end\n convert_string_keys_to_symbols hash\n end",
"title": ""
},
{
"docid": "8b93ee89e4fa97f1b79a8f7b59a67c4c",
"score": "0.51761425",
"text": "def get_cheftacular_yml_as_hash filename='cheftacular.yml'\n config_location = if File.exist?(File.join( Dir.getwd, 'config', filename ))\n File.join( Dir.getwd, 'config', filename )\n elsif File.exist?(\"/root/#{ filename }\")\n \"/root/#{ filename }\"\n else\n raise \"cheftacular.yml configuration file could not be found in either #{ File.join( Dir.getwd, 'config', filename ) } or /root/#{ filename }\"\n end\n\n YAML::load(ERB.new(IO.read(File.open(config_location))).result)\n rescue StandardError => e\n puts \"The cheftacular.yml configuration file could not be parsed.\"\n puts \"Error message: #{ e }\\n#{ e.backtrace.join(\"\\n\") }\"\n \n exit\n end",
"title": ""
},
{
"docid": "033fce267901bfac0e490824204a813f",
"score": "0.51684755",
"text": "def database_config\n config_path.join(\"db.yml\")\n end",
"title": ""
},
{
"docid": "2782b47d85d87ada4cff507a892dab7d",
"score": "0.51621765",
"text": "def yaml\n File.read(@name)\n end",
"title": ""
},
{
"docid": "f0af9b160f55fdbc514fe95bf96892bb",
"score": "0.5156627",
"text": "def cli_helper_process_yaml(file_contents='')\n a_hash = YAML.load file_contents\n return a_hash\n end",
"title": ""
},
{
"docid": "73a9bc6ef586ccb86705cbc678729ff1",
"score": "0.5150931",
"text": "def after_find() yaml_content_to_hash! end",
"title": ""
},
{
"docid": "6837b83bc2b0fe8ff23a4030a6e9af5d",
"score": "0.51426524",
"text": "def connection_config\n symbolize_keys YAML.load_file('db_config.yml')['sql_server']\n end",
"title": ""
},
{
"docid": "34199a8bbbe57f4ee6a4df221694e212",
"score": "0.51367885",
"text": "def get_hash(name)\n file_name = File.join(@db_dir, name + '.json')\n return ::Hash.new unless File.exist?(file_name)\n\n begin\n json = File.read(file_name)\n rescue => e\n PEROBS.log.fatal \"Cannot read hash file '#{file_name}': #{e.message}\"\n end\n JSON.parse(json, :create_additions => true)\n end",
"title": ""
},
{
"docid": "b8ed4cf73c438b7ee5712d16fa783752",
"score": "0.51339227",
"text": "def config_yaml\n @config_yaml ||= YAML::load(File.open(\"#{Rails.root}/db/sms_carriers.yml\"))\n end",
"title": ""
},
{
"docid": "186ada2f0eb994da5b50f50d0a1c9378",
"score": "0.5116046",
"text": "def secrets\n @secrets ||= if File.exist?(secrets_path)\n info \"Loading existing secrets from #{secrets_path}\"\n YAML.load_file(secrets_path)\n else\n {}\n end\n end",
"title": ""
},
{
"docid": "2b793b304b2ca3547840eb026d714d31",
"score": "0.51148176",
"text": "def database_configuration\n require 'erb'\n yaml = ERB.new(IO.read(database_configuration_file)).result\n if YAML.respond_to?(:unsafe_load)\n YAML.unsafe_load(yaml)\n else\n YAML.load(yaml)\n end\n end",
"title": ""
},
{
"docid": "eae2d01ac60e74703b77ffb7db8d7383",
"score": "0.5104506",
"text": "def database_configuration\n require 'erb'\n YAML::load(ERB.new(IO.read(paths[\"config/database\"].first)).result)\n end",
"title": ""
},
{
"docid": "9832136f989f3d9bd8b5dc7af5eba268",
"score": "0.5097142",
"text": "def to_hash(file)\n\t\tcase File.extname file\n\t\t\twhen '.yaml', '.yml'\n\t\t\t\trequire 'yaml'\n\t\t\t\treturn YAML::load_file(file)\n\t\tend\n\tend",
"title": ""
},
{
"docid": "f370c405c4742747a39b827e50d89013",
"score": "0.5087076",
"text": "def read_from_hash\n File.open(\"banking_app_hash.txt\", \"r\") {\n |file| @balances_hash = file.read\n }\nend",
"title": ""
},
{
"docid": "972feaf35a1820fa0ac8ba5964e18a76",
"score": "0.5078716",
"text": "def credentials()\n credentials = YAML.load_file(\"#{home}/.s3conf/s3config.yml\")\n [credentials['aws_access_key_id'],credentials['aws_secret_access_key']] \n end",
"title": ""
},
{
"docid": "cda22d6027d4f1031eca7595eea20c47",
"score": "0.50700897",
"text": "def database_configuration\n require 'erb'\n YAML::load(ERB.new(IO.read(paths.config.database.to_a.first)).result)\n end",
"title": ""
},
{
"docid": "cda22d6027d4f1031eca7595eea20c47",
"score": "0.50700897",
"text": "def database_configuration\n require 'erb'\n YAML::load(ERB.new(IO.read(paths.config.database.to_a.first)).result)\n end",
"title": ""
},
{
"docid": "506cfdd70c6a585f07bcf124ee6ffdd2",
"score": "0.50686777",
"text": "def data\n YAML.load ERB.new(File.read File.expand_path yaml_path).result\n rescue StandardError, SyntaxError => e\n {}\n end",
"title": ""
},
{
"docid": "f1b870760c9aca8db1a7efc95014f377",
"score": "0.50572044",
"text": "def print\n hash(@yaml)\n end",
"title": ""
},
{
"docid": "3c304a3ebaca96e0e87a13a25f16037b",
"score": "0.5049459",
"text": "def get_key(file)\n [\n file['sha1'],\n file['size']\n ].join(':')\nend",
"title": ""
},
{
"docid": "a9944d1a52fc5f73757711cde1512eff",
"score": "0.50303",
"text": "def read_dump_file file\n hash = {}\n File.read(file).split(\"\\n\").each do |line|\n field,sql = line.split ':'\n hash[field.downcase.to_sym] = sql\n end\n hash\n end",
"title": ""
},
{
"docid": "57c6029aa3c07453f599bfee28a1c7ce",
"score": "0.5026125",
"text": "def load_files_hash(file)\n return YAML::load_file(file)\n end",
"title": ""
},
{
"docid": "01c54d8fb1dcf49e8f96db66f59816a6",
"score": "0.5019789",
"text": "def slurp_file(f)\n f = File.expand_path(f)\n tmp = {}\n\n if File.exist?(f)\n File.open( f ) { |yf| \n tmp = YAML::load( yf ) \n }\n end\n tmp.symbolize_keys! unless tmp == false\n end",
"title": ""
},
{
"docid": "6edaea2c34aeeff83ada0622c3d34350",
"score": "0.50151354",
"text": "def dovecot_entry\n \"{SSHA512}#{full_hash}\"\n end",
"title": ""
},
{
"docid": "0330a7ee66c4c95a2fb470b5a6663dae",
"score": "0.50059164",
"text": "def config\n if File.exists? frakfile\n Hash[YAML.load_file(frakfile).map { |k, v| [k.to_sym, v] }]\n else\n {}\n end\nend",
"title": ""
},
{
"docid": "ac37b702769473a05f39311d8b81d788",
"score": "0.50048757",
"text": "def raw_value\n stringify_keys.to_yaml\n end",
"title": ""
},
{
"docid": "5e791e43f7d9a88e7c6681677cf1a577",
"score": "0.50024754",
"text": "def jh_queues_for_sidekiq_queues_yml\n []\n end",
"title": ""
},
{
"docid": "7cd2c8d1491fe08b4d5240bd50033674",
"score": "0.50009155",
"text": "def read_settings_hash\n if File.exists?(\"#{Rails.root}/config/hibiscus.yml\")\n YAML::load_file(\"#{Rails.root}/config/hibiscus.yml\")[Rails.env.to_s]\n else\n {}\n end\n end",
"title": ""
},
{
"docid": "e9371a25295e51ba4706decbca0f8a0d",
"score": "0.49828866",
"text": "def get_seed_data_from_local_yml\n seed_file = 'seed_data.yml'\n seed_path = 'db/seeds/development/' + seed_file\n\n p \"Getting seed data from LOCAL within \" + seed_path\n\n raw_hash = YAML.load_file(seed_path)\n return raw_hash\nend",
"title": ""
},
{
"docid": "c24bf7cc902f6a0e4dcddac4f3ddaf27",
"score": "0.49773884",
"text": "def archetype_database_yml_file\n deploy_path.join(\"db/database.yml\")\n end",
"title": ""
},
{
"docid": "6fc1a152783b5116b267a9bb496598db",
"score": "0.49747977",
"text": "def shitcan_conf\n path = \"#{app_root}/config/shitcan.yml\"\n @shitcan_conf ||= YAML::load(ERB.new(IO.read(path)).result)[env]\n end",
"title": ""
},
{
"docid": "53c7b9c81a9f4952ba26f13d66efd940",
"score": "0.497043",
"text": "def get_cookbook_yaml_info()\n cookbook_keys = {'username' => nil, 'ssh_key' => nil }\n cookbook_suites = []\n kitchen_yaml = '.kitchen.yml'\n kitchen_yaml = ENV['KITCHEN_YAML'] if ENV['KITCHEN_YAML']\n kitchen_local_yaml = '.kitchen.local.yml'\n kitchen_local_yaml = ENV['KITCHEN_LOCAL_YAML'] if ENV['KITCHEN_LOCAL_YAML']\n [ \"#{kitchen_local_yaml}\", \"#{kitchen_yaml}\" ].each do |yml_file|\n if File.exist?(yml_file)\n cookbook_items = parse_yaml(yml_file)\n if cookbook_items.key?('suites')\n cookbook_items['suites'].each do |suite|\n cookbook_suites.push suite['name']\n end\n end\n %w[ http_proxy https_proxy no_proxy ].each do |prox_key|\n if cookbook_items.key?('driver')\n cookbook_keys[prox_key] = cookbook_items['driver'][prox_key]\n end\n end\n %w[ username ssh_key ].each do |trans_key|\n if cookbook_keys.has_key?(trans_key)\n if cookbook_items.has_key?('transport')\n cookbook_keys[trans_key] = cookbook_items['transport'][trans_key]\n end\n end\n end\n end\n end\n cookbook_keys['suites'] = cookbook_suites\n return cookbook_keys\nend",
"title": ""
},
{
"docid": "989b106c5aaff411fdfb0636c9818f4a",
"score": "0.4962797",
"text": "def read_encrypted_secrets; end",
"title": ""
},
{
"docid": "78bbcc9356108b1d7f0457ce054c7d9f",
"score": "0.49627376",
"text": "def hash_file\n\t\t\treturn @hash_file ||= Pathname.new(@@config.hash_dir).join(name).to_s\n\t\tend",
"title": ""
},
{
"docid": "2cf091bfd464b9e9c36654341f11f867",
"score": "0.49616015",
"text": "def config_yml\n template = File.read(find_config_yml_file)\n ERB.new(template).result(binding)\n end",
"title": ""
},
{
"docid": "2c0738c511a5ae7f7acd0712d38677f0",
"score": "0.49560276",
"text": "def parse_secret_access_key\n File.readlines(AWS_SUDO_FILE).each do |line|\n return line.split('=')[1].chomp if line.include?('AWS_SECRET_ACCESS_KEY')\n end\n end",
"title": ""
},
{
"docid": "dbd9e15b34e26abefc286d618634068a",
"score": "0.49557686",
"text": "def sqs_client_config\n params = {\n region: options[:mq_aws_region],\n endpoint: options[:mq_aws_sqs_endpoint],\n access_key_id: options[:mq_aws_access_key_id],\n secret_access_key: options[:mq_aws_secret_access_key]\n }\n params.compact\n end",
"title": ""
},
{
"docid": "9d895a7319d36026e9671db2a95a4a66",
"score": "0.49426502",
"text": "def load_aws_file(file_path)\n if File.exist?(file_path)\n logger.debug(\"loading aws file @ #{file_path}\")\n Smash.new.tap do |creds|\n key = :default\n File.readlines(file_path).each_with_index do |line, idx|\n line.strip!\n next if line.empty? || line.start_with?(\"#\")\n if line.start_with?(\"[\")\n unless line.end_with?(\"]\")\n raise ArgumentError,\n \"Failed to parse aws file! (#{file_path} line #{idx + 1})\"\n end\n key = line.tr(\"[]\", \"\").strip.sub(/^profile /, \"\")\n creds[key] = Smash.new\n else\n unless key\n raise ArgumentError,\n \"Failed to parse aws file! (#{file_path} line #{idx + 1}) \" \\\n \"- No section defined!\"\n end\n line_args = line.split(\"=\", 2).map(&:strip)\n line_args.first.replace(\n self.class.const_get(:CONFIG_FILE_REMAP).fetch(\n line_args.first, line_args.first\n )\n )\n if line_args.last.start_with?('\"')\n unless line_args.last.end_with?('\"')\n raise ArgumentError,\n \"Failed to parse aws file! (#{file_path} line #{idx + 1})\"\n end\n line_args.last.replace(line_args.last[1..-2]) # NOTE: strip quoted values\n end\n begin\n creds[key].merge!(Smash[*line_args])\n rescue => e\n raise ArgumentError,\n \"Failed to parse aws file! (#{file_path} line #{idx + 1})\"\n end\n end\n end\n end\n else\n Smash.new\n end\n end",
"title": ""
},
{
"docid": "85fb820334247fcc7811b24cb40895b0",
"score": "0.49425003",
"text": "def save(hash)\n str = convert_sql_to_multiline_yaml(hash)\n File.open(@pathname, 'w') { |f| f << str }\n end",
"title": ""
},
{
"docid": "455b739004c9a5e2e4873887cfea63ba",
"score": "0.4937125",
"text": "def read_config\n config_hash = {}\n\t\tif File.exist?(@config_file.to_s)\n\t\t\tlines = File.new(@config_file.to_s, 'r').readlines\n\n\t\t\t# Redhat based config files use the format: KEY=value\n\t\t\tlines.select {|l| l =~ /=/ }.each do |line|\n\t\t\t\tkey = line.split('=')[0].chomp\n\t\t\t\t config_hash[key.upcase.to_sym] = line.split('=')[1].chomp\n\t\t\tend\n\t\t\t\n\t\t\tPuppet.debug \"Imported config file to a hash\"\n\t\t\treturn config_hash\n\t\telse\n\t\t\t# TODO Puppet could create the file if nil?\n\t\t\tPuppet.debug \"Puppet was looking for #{@config_file.to_s} and coundn't find it\"\n\t\t\traise Puppet::Error, \"Puppet can't find the config file for %s\" % @resource[:name]\n\t\t\treturn nil\n\t\tend\n\tend",
"title": ""
},
{
"docid": "03a9add1d524dc76df4164878d6a2591",
"score": "0.4926609",
"text": "def setup_database_yml_for_ninefold\n File.open(\"config/database.yml\", \"r+\") do |f|\n out = \"\"\n f.each do |line|\n if line =~ /url:/\n out << <<-DB.gsub(/^ {8}/, '')\n adapter: postgresql\n encoding: utf8\n database: Rails.application.secrets.ninefold_db\n username: Rails.application.secrets.ninefold_user\n password: Rails.application.secrets.ninefold_pass\n host: localhost\n port: 5432\n pool: 10\n DB\n else\n out << line\n end\n end\n f.pos = 0\n f.print out.chomp\n f.truncate(f.pos)\n end\nend",
"title": ""
},
{
"docid": "95e2f433ba72b3fea68c873fe1ef2994",
"score": "0.49179974",
"text": "def to_hash\n {\n sha: sha,\n sources: sources\n }\n end",
"title": ""
},
{
"docid": "f63c35aa2f6fcbff3940146901da3dac",
"score": "0.4913249",
"text": "def load_hash(config)\n filename = \"#{ROOT_PATH}/files/#{config[\"month_stats\"]}\"\n log_hash = {}\n if !File.exist?(filename)\n return log_hash\n end\n open(filename) do |f|\n log_hash = YAML.load_file(filename)\n end\n log_hash\nend",
"title": ""
},
{
"docid": "4d2d3ad51cce835928e3750f7c0f3ed3",
"score": "0.49046138",
"text": "def read_config_file\n path = \"#{ROOT}/config/database.yml\"\n file = YAML.load_file(\"#{path}\")\n end",
"title": ""
},
{
"docid": "0e9565ad39f0cd01b804f5267e12d71c",
"score": "0.49029145",
"text": "def config\n HashWithIndifferentAccess.new YAML.load_file(CONFIG_FILE)\n end",
"title": ""
},
{
"docid": "ccd139fc8b54302cea075c182bf68019",
"score": "0.48899373",
"text": "def yaml_file\n @yaml_file ||= begin\n home_path = File.expand_path('~')\n File.join(home_path, 'backup_aws_s3', \"#{ @name }.yml\")\n end\n end",
"title": ""
},
{
"docid": "4979815877a15b7516043ae8f8ca3c1c",
"score": "0.48820138",
"text": "def pack(hash)\n yml_out = Psych.dump(hash) #.strip!\n end",
"title": ""
},
{
"docid": "0dd1c8a0b385dbe8cf3cc35f3fd84365",
"score": "0.4873467",
"text": "def get_yaml\n @quotes.to_yaml\n end",
"title": ""
},
{
"docid": "5b68510dc7ec815bfa6628eae61f5de3",
"score": "0.48700708",
"text": "def jobs_yml(commit_sha)\n file =\n begin\n file = github_client.contents(repository_id,\n path: ProjectFile::JOBS_YML_PATH, ref: commit_sha)\n Base64.decode64(file.content)\n rescue Octokit::NotFound\n nil\n end\n\n if file.blank?\n file = project.project_files.where(path: ProjectFile::JOBS_YML_PATH).\n first.try(:contents)\n end\n\n file\n end",
"title": ""
},
{
"docid": "d66b26b0c60dc1523c7f7326a535b7dc",
"score": "0.4865612",
"text": "def load_credentials\n return YAML.load(File.read(credentials_file))\n end",
"title": ""
},
{
"docid": "7ca09aed495d67993ccdf265b27a86d0",
"score": "0.48576444",
"text": "def content\n begin\n YAML::load(File.open(@config))\n rescue\n {}\n end\n end",
"title": ""
},
{
"docid": "80433e2b7310bbf3e55c89ec3d5aecd8",
"score": "0.48449016",
"text": "def to_hash\n if absolute_path\n YAML.load_file(absolute_path)\n else\n {}\n end\n end",
"title": ""
},
{
"docid": "d2c9963f73daab8ec0c0de2d3c603c90",
"score": "0.48444623",
"text": "def config\n configs[\"_config.yml\"]\n end",
"title": ""
},
{
"docid": "c815924bd95e5afc813da39ff58844f6",
"score": "0.48431385",
"text": "def db_configuration\n db_configuration_file = File.join(File.expand_path('..', __FILE__), '..', 'db', 'config.yml')\n YAML.load(File.read(db_configuration_file))\nend",
"title": ""
},
{
"docid": "4676ecf6d1bfefb8139d584f2b2d5ff1",
"score": "0.48392627",
"text": "def initialize \n @conf_filename='.sqweeze.yml'\n @source_dir=nil\n @target_dir=nil\n @files=[]\n \n @conf={\n :suppress_info => false,\n :suppress_debug => true,\n :suppress_warn => false,\n :suppress_error => false,\n :bin_paths => {},\n :dom_documents => [],\n :include_files => [],\n :exclude_files => [],\n :compress_png => true,\n :compress_jpeg => true,\n :compress_gif => true,\n :compress_js => true,\n :compress_css => true,\n :append_scripts_to => :head,\n :default_js_compressor => :yui,\n :optimisation_strategy => :all_in_one\n }\n end",
"title": ""
},
{
"docid": "f81e4a5ccb4aaa7d874aa757e9ca2bfd",
"score": "0.48335165",
"text": "def config_sample_raw\n GitlabHook::Config::read_raw configatron.app.path.base.projects + '/config.yml.sample'\n end",
"title": ""
},
{
"docid": "2c072dd2b9b9d959be43bbf106f500f4",
"score": "0.4816689",
"text": "def read_sim_library\n log = File.read('./data/database.yml')\n saved_sims_options = []\n YAML.load_stream(log) do |doc|\n saved_sims_options << doc[:id][:name]\n end\n saved_sims_options\nend",
"title": ""
},
{
"docid": "84df00caf661b8998ea62a5d712aa618",
"score": "0.481576",
"text": "def generate_digest(data)\n db = YAML.load_file('config/database.yml')\n OpenSSL::HMAC.hexdigest(OpenSSL::Digest::Digest.new('SHA1'), db[RAILS_ENV]['secret'], data)\n end",
"title": ""
},
{
"docid": "cdbb5244cf58278868ddf29d4eea73ad",
"score": "0.4812533",
"text": "def load_yaml(file = \"./config/database.yml\")\n YAML.load_file(file) \n end",
"title": ""
},
{
"docid": "d355c4add41aad9d18b925169358b0bc",
"score": "0.48112392",
"text": "def config_file\n \"#{path}/config.yml\"\n end",
"title": ""
},
{
"docid": "944ddc08b8e0d07645b976b950cb829d",
"score": "0.48002595",
"text": "def read_configuration\n\treturn YAML.load_file(\"config.yml\")\nend",
"title": ""
},
{
"docid": "944ddc08b8e0d07645b976b950cb829d",
"score": "0.48002595",
"text": "def read_configuration\n\treturn YAML.load_file(\"config.yml\")\nend",
"title": ""
},
{
"docid": "73886bc326cc706089f5e206dcf36360",
"score": "0.47974974",
"text": "def database_file\n ENV[\"YAML_DATABASE\"]\n end",
"title": ""
},
{
"docid": "1ed179b1cadfcd77744d2eb14ee07354",
"score": "0.47973225",
"text": "def hash\n [aliases, apps, aws_name, host_name, id, is_muted, last_reported_time, meta, metrics, mute_timeout, name, sources, tags_by_source, up].hash\n end",
"title": ""
},
{
"docid": "1388a5e4ac58c2fa68cb99321e776365",
"score": "0.47970408",
"text": "def populate_aws_user_data_yaml()\n yaml = []\n yaml.push(\"#cloud-config\")\n yaml.push(\"write_files:\")\n yaml.push(\"- path: /etc/sudoers.d/99-requiretty\")\n yaml.push(\" permissions: 440\")\n yaml.push(\" content: |\")\n yaml.push(\" Defaults !requiretty\")\n return yaml\nend",
"title": ""
},
{
"docid": "0f76098468f70c155cea97d2ca084467",
"score": "0.47968107",
"text": "def configuration_hash; end",
"title": ""
},
{
"docid": "0f76098468f70c155cea97d2ca084467",
"score": "0.47968107",
"text": "def configuration_hash; end",
"title": ""
},
{
"docid": "0f76098468f70c155cea97d2ca084467",
"score": "0.47968107",
"text": "def configuration_hash; end",
"title": ""
}
] |
eee4f599e7e724951682aeeed4aaaf28
|
PUT /solicitudes/1 PUT /solicitudes/1.xml
|
[
{
"docid": "08e9549a17b43b77cd3f3b43ba26f524",
"score": "0.54916936",
"text": "def update\n @solicitud = Solicitud.find(params[:id])\n\n #limpiamos fecha de creacion pasandola a formato MM/DD/YYYY\n params[:solicitud][:fecha_creacion] = fix_date(params[:solicitud][:fecha_creacion]) if params[:solicitud][:fecha_creacion]\n \n respond_to do |format|\n if @solicitud.update_attributes(params[:solicitud])\n flash[:notice] = 'Solicitud actualizada con exito.'\n format.html { redirect_to institucion_solicitud_path(@institucion, @solicitud) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @solicitud.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
}
] |
[
{
"docid": "6e418358cd766cf57276382c5f1d9af6",
"score": "0.65754133",
"text": "def update\n @solicitante = Solicitante.find(params[:id])\n\n respond_to do |format|\n if @solicitante.update_attributes(params[:solicitante])\n format.html { redirect_to(@solicitante, :notice => 'Solicitante was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @solicitante.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3bb447b0ae070384797bc4f88955d025",
"score": "0.6574781",
"text": "def update\n @solicitation = Solicitation.find(params[:id])\n\n respond_to do |format|\n if @solicitation.update_attributes(params[:solicitation])\n format.html { redirect_to(@solicitation, :notice => 'Solicitation was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @solicitation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "d37521cae727d0a18502df197cfe0f34",
"score": "0.6339731",
"text": "def update\n @solicitud = Solicitud.find(params[:id])\n respond_to do |format|\n if @solicitud.update_attributes(params[:solicitud])\n flash[:notice] = 'La solicitud a sido correctamente actualizada.'\n format.html { redirect_to(@solicitud) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @solicitud.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "f2afda7cd2d7a33ac997640357ef444c",
"score": "0.627176",
"text": "def update\n respond_to do |format|\n if @solicit.update(solicit_params)\n format.html { redirect_to @solicit, notice: 'Solicit was successfully updated.' }\n format.json { render :show, status: :ok, location: @solicit }\n else\n format.html { render :edit }\n format.json { render json: @solicit.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "53dd2087d2df7100b59481ea98c83bb3",
"score": "0.618146",
"text": "def update\n @solicitation_type = SolicitationType.find(params[:id])\n\n respond_to do |format|\n if @solicitation_type.update_attributes(params[:solicitation_type])\n flash[:notice] = 'SolicitationType was successfully updated.'\n format.html { redirect_to(@solicitation_type) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @solicitation_type.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "67ddec4cb6d9870bfce845fe91e4ac06",
"score": "0.61579067",
"text": "def update\n @solicitacao = Solicitacao.find(params[:id])\n\n respond_to do |format|\n if @solicitacao.update_attributes(params[:solicitacao])\n format.html { redirect_to @solicitacao, notice: 'Solicitacao was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @solicitacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a5b761b10bb2f0b5f7c841fa7492184f",
"score": "0.6134762",
"text": "def update\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n format.html { redirect_to @solicitud, notice: 'Su solicitud fue grabada de manera exitosa.' }\n format.json { render :show, status: :ok, location: @solicitud }\n else\n format.html { render :edit }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1658ce8aa663793911c1f1144b2e9c67",
"score": "0.6069125",
"text": "def set_sigesp_solicitud\n @solicitud = Sigesp::Solicitud.find(params[:id])\n end",
"title": ""
},
{
"docid": "0541e87f1aaf23097fcd7ae7ea69342e",
"score": "0.6068536",
"text": "def update\n @solicitud = Solicitud.find(params[:id])\n\n respond_to do |format|\n if @solicitud.update_attributes(params[:solicitud])\n format.html { redirect_to @solicitud, notice: 'Solicitud was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "23b5f5e4dacfb330cb1e0ffd4590ef63",
"score": "0.60581535",
"text": "def update opts = {}\n opts[:headers] ||= {}\n opts[:headers]['Content-Type'] ||= 'text/xml'\n post opts.fetch(:path, update_path), opts\n end",
"title": ""
},
{
"docid": "fbd7c46b15ae2792fd842ba0d764b7d0",
"score": "0.605244",
"text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end",
"title": ""
},
{
"docid": "bc05039b1f7db1834a7b00477457df49",
"score": "0.60239756",
"text": "def set_solicitation\n @solicitation = Solicitation.find(params[:id])\n end",
"title": ""
},
{
"docid": "d5c34536a5c29064e16484ed866ffb5d",
"score": "0.5998763",
"text": "def update\n respond_to do |format|\n if @sigesp_solicitud.update(sigesp_solicitud_params)\n format.html { redirect_to @sigesp_solicitud, notice: 'Solicitud was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @sigesp_solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "51af59f40d942682701f5e05808ba94b",
"score": "0.59954625",
"text": "def set_solicit\n @solicit = Solicit.find(params[:id])\n end",
"title": ""
},
{
"docid": "f44534e84843ac57f3f4141c556da1bf",
"score": "0.59875244",
"text": "def update\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n format.html { redirect_to @solicitud, notice: 'Solicitud was successfully updated.' }\n format.json { render :show, status: :ok, location: @solicitud }\n else\n format.html { render :edit }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "c19d4702b9177a0d52135cd5ccfe2cc2",
"score": "0.598231",
"text": "def update\n respond_to do |format|\n if @tipo_solicitude.update(tipo_solicitude_params)\n format.html { redirect_to @tipo_solicitude, notice: 'Tipo solicitude was successfully updated.' }\n format.json { render :show, status: :ok, location: @tipo_solicitude }\n else\n format.html { render :edit }\n format.json { render json: @tipo_solicitude.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "897296abf4e6475ec183112cb88ca1dc",
"score": "0.5951168",
"text": "def update\n @solicitation_item = SolicitationItem.find(params[:id])\n\n respond_to do |format|\n if @solicitation_item.update_attributes(params[:solicitation_item])\n flash[:notice] = 'SolicitationItem was successfully updated.'\n format.html { redirect_to(@solicitation_item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @solicitation_item.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "5db5198a003d844e2f4da6f1ff11ccf3",
"score": "0.5938704",
"text": "def set_sigesp_solicitud\n @sigesp_solicitud = Sigesp::Solicitud.find(params[:id])\n end",
"title": ""
},
{
"docid": "350af21458de14bf47ee582cc7f5aa00",
"score": "0.59106326",
"text": "def update\n respond_to do |format|\n if @solicitacao.update(solicitacao_params)\n format.html { redirect_to @solicitacao, notice: 'Solicitacao was successfully updated.' }\n format.json { render :show, status: :ok, location: @solicitacao }\n else\n format.html { render :edit }\n format.json { render json: @solicitacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "94506d595cd383321334becc9a6e816a",
"score": "0.59007555",
"text": "def set_solicitud\n @solicitud = Solicitud.find(params[:id])\n end",
"title": ""
},
{
"docid": "94506d595cd383321334becc9a6e816a",
"score": "0.59007555",
"text": "def set_solicitud\n @solicitud = Solicitud.find(params[:id])\n end",
"title": ""
},
{
"docid": "94506d595cd383321334becc9a6e816a",
"score": "0.59007555",
"text": "def set_solicitud\n @solicitud = Solicitud.find(params[:id])\n end",
"title": ""
},
{
"docid": "94506d595cd383321334becc9a6e816a",
"score": "0.59007555",
"text": "def set_solicitud\n @solicitud = Solicitud.find(params[:id])\n end",
"title": ""
},
{
"docid": "94506d595cd383321334becc9a6e816a",
"score": "0.59007555",
"text": "def set_solicitud\n @solicitud = Solicitud.find(params[:id])\n end",
"title": ""
},
{
"docid": "94506d595cd383321334becc9a6e816a",
"score": "0.59007555",
"text": "def set_solicitud\n @solicitud = Solicitud.find(params[:id])\n end",
"title": ""
},
{
"docid": "94506d595cd383321334becc9a6e816a",
"score": "0.59007555",
"text": "def set_solicitud\n @solicitud = Solicitud.find(params[:id])\n end",
"title": ""
},
{
"docid": "94506d595cd383321334becc9a6e816a",
"score": "0.59007555",
"text": "def set_solicitud\n @solicitud = Solicitud.find(params[:id])\n end",
"title": ""
},
{
"docid": "538cb2d6f3cbfce05e2a640b2476d096",
"score": "0.58935314",
"text": "def update\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n format.html { redirect_to @solicitud, notice: 'Solicitud modificada exitosamente.' }\n format.json { render :show, status: :ok, location: @solicitud }\n else\n format.html { render :edit }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "174b0e5985f181bc8e6aa5a1c96fe88a",
"score": "0.5884974",
"text": "def set_solicitacao\n @solicitacao = Solicitacao.find(params[:id])\n end",
"title": ""
},
{
"docid": "174b0e5985f181bc8e6aa5a1c96fe88a",
"score": "0.5884974",
"text": "def set_solicitacao\n @solicitacao = Solicitacao.find(params[:id])\n end",
"title": ""
},
{
"docid": "16bd36ca31f1b36e2eb16ac9f9376e8c",
"score": "0.58730596",
"text": "def set_solicitante\n @solicitante = Solicitante.find(params[:id])\n end",
"title": ""
},
{
"docid": "2ba3faf72ab58010413ee492ba9e2c64",
"score": "0.5861794",
"text": "def update\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n actualizar\n format.html { redirect_to @solicitud, notice: 'La solicitud fue actualizada correctamente' }\n format.json { render :show, status: :ok, location: @solicitud }\n else\n format.html { render :edit }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "feebf1de6fd43093add8b65f6bf46a63",
"score": "0.585775",
"text": "def set_solicitud\n\n @solicitud = Solicitud.find(params[:id])\n end",
"title": ""
},
{
"docid": "16dccb36eccdc08de6811111b618ce1d",
"score": "0.5854464",
"text": "def set_solicitud \n @solicitud = Solicitud.find(params[:id])\n end",
"title": ""
},
{
"docid": "e3b4ec61353c59c029c6f420c4d38bec",
"score": "0.5834604",
"text": "def update\n @solicitud_documento = SolicitudDocumento.find(params[:id])\n\n respond_to do |format|\n if @solicitud_documento.update_attributes(params[:solicitud_documento])\n flash[:notice] = 'SolicitudDocumento actualizado correctamente.'\n format.html { redirect_to(@solicitud_documento) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @solicitud_documento.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "3138ea4fdfd664e658845f129c1202b1",
"score": "0.5833327",
"text": "def set_solicitud_observacion\n @solicitud_observacion = SolicitudObservacion.find(params[:id])\n end",
"title": ""
},
{
"docid": "94426faffaa42ee9efd16fcc6272fc3f",
"score": "0.5832454",
"text": "def update\n respond_to do |format|\n if @solicitacao.update(solicitacao_params)\n format.html { redirect_to @solicitacao, notice: I18n.t('messages.updated') }\n format.json { render :show, status: :ok, location: @solicitacao }\n else\n format.html { render :edit }\n format.json { render json: @solicitacao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "acbb649d18adeab70975befda895a4c8",
"score": "0.58230877",
"text": "def update\n respond_to do |format|\n if @solicitacao_exclusao.update(solicitacao_exclusao_params)\n format.html { redirect_to @solicitacao_exclusao, notice: 'Solicitacao exclusao was successfully updated.' }\n format.json { render :show, status: :ok, location: @solicitacao_exclusao }\n else\n format.html { render :edit }\n format.json { render json: @solicitacao_exclusao.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7355ba30e253e53afe2c7fc730c34dac",
"score": "0.57861155",
"text": "def update\n authorize! :update, Solicitante\n respond_to do |format|\n if @solicitante.update(solicitante_params)\n format.html { redirect_to @solicitante, notice: 'Solicitante actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: @solicitante }\n else\n format.html { render :edit }\n format.json { render json: @solicitante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1c334e18b9ca99240d0394c4b9e22528",
"score": "0.57759464",
"text": "def update\n @solicitante = Solicitante.find(current_solicitante.perfilable_id)\n\n params[:solicitante][:pais_id] = 1 # Venezuela\n \n @localidad = params[:solicitante][:localidad_id]\n if Genericas::validar_parametros_a_objeto_sin_localidad(@solicitante, params[:solicitante])\n params[:solicitante][:localidad_id] = UbicacionGeografica.buscar_o_crear_id_de_localidad(@localidad,params[:solicitante][:municipio_id])\n end\n \n respond_to do |format|\n if @solicitante.update_attributes(params[:solicitante])\n flash[:success] = \"Perfil actualizado.\"\n format.html { redirect_to panel_solicitante_path }\n format.json { head :no_content }\n else\n flash[:error] = \"Ocurrió un error. Revisa el formulario.\"\n format.html { render action: \"edit\" }\n format.json { render json: @solicitante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e282e47d94deef0f7d219b10e07ffd9d",
"score": "0.5775276",
"text": "def update\n respond_to do |format|\n if @solicitud_estudiante.update(solicitud_estudiante_params)\n format.html { redirect_to @solicitud_estudiante, notice: 'Solicitud estudiante ha sido actualizada.' }\n format.json { render :show, status: :ok, location: @solicitud_estudiante }\n else\n format.html { render :edit }\n format.json { render json: @solicitud_estudiante.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a84781735d7d243228c7a8691e7132fa",
"score": "0.5737771",
"text": "def update\n respond_to do |format|\n if @solicitud.update(solicitud_params)\n format.html { redirect_to persona_solicituds_path(@solicitud.persona), notice: 'Solicitud actualizado exitosamente.' }\n format.json { render :show, status: :ok, location: persona_solicituds_path(@solicitud.persona) }\n else\n format.html { render :edit }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8b92f7d8d5092ed9a7e3a5b313e6d712",
"score": "0.5716245",
"text": "def create\n @solicitation = Solicitation.new(params[:solicitation])\n\n respond_to do |format|\n if @solicitation.save\n format.html { redirect_to(@solicitation, :notice => 'Solicitation was successfully created.') }\n format.xml { render :xml => @solicitation, :status => :created, :location => @solicitation }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @solicitation.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "38979984bdedacd95706689e25f09f9e",
"score": "0.56833136",
"text": "def put(document, method='')\n @resource[method].put(document.to_s, :content_type => 'text/xml')\n end",
"title": ""
},
{
"docid": "4584907af0886f3263b11838a1b40ba4",
"score": "0.567488",
"text": "def update\n respond_to do |format|\n if @solicitud_observacion.update(solicitud_observacion_params)\n format.html { redirect_to @solicitud_observacion, notice: 'Solicitud observacion was successfully updated.' }\n format.json { render :show, status: :ok, location: @solicitud_observacion }\n else\n format.html { render :edit }\n format.json { render json: @solicitud_observacion.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e7f6565369ea645086c63a0bd1072e5",
"score": "0.55759454",
"text": "def create\n @solicitante = Solicitante.new(params[:solicitante])\n\n respond_to do |format|\n if @solicitante.save\n format.html { redirect_to(@solicitante, :notice => 'Solicitante was successfully created.') }\n format.xml { render :xml => @solicitante, :status => :created, :location => @solicitante }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @solicitante.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "aa0b87a16ede7353758305dbbaf57c22",
"score": "0.55661106",
"text": "def put(*a) route 'PUT', *a end",
"title": ""
},
{
"docid": "e2e55a6ecb4c00b7fe18a670cc021207",
"score": "0.5563933",
"text": "def put_entry(id,summary)\n xml = <<DATA\n <entry xmlns=\"http://purl.org/atom/ns#\">\n <summary type=\"text/plain\"></summary>\n </entry>\nDATA\n\n doc = REXML::Document.new(xml)\n doc.elements['/entry/summary'].add_text(summary)\n\n # REXML -> String\n data=String.new\n doc.write(data)\n\n #make request\n path=\"/atom/edit/#{id}\"\n req=Net::HTTP::Put.new(path)\n req['Accept']= 'application/x.atom+xml,application/xml,text/xml,*/*',\n req['X-WSSE']= @credential_string\n\n #YHAAAA!!!\n res = @http.request(req,data)\n return res\n end",
"title": ""
},
{
"docid": "02ae37784bf6a9cbd463aeb23378339b",
"score": "0.555331",
"text": "def set_solicitud_estudiante_create\n @solicitud_estudiante = SolicitudEstudiante.find(params[:id])\n end",
"title": ""
},
{
"docid": "67b0d51a055ccb895b19eef170a96c0a",
"score": "0.55213827",
"text": "def update\n @espacio = Espacio.find(params[:id])\n\n respond_to do |format|\n if @espacio.update_attributes(params[:espacio])\n flash[:notice] = 'Espacio actualizado correctamente.'\n format.html { redirect_to(@espacio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @espacio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "a53a8620047f135255d909af1ba713e3",
"score": "0.55196965",
"text": "def set_solicitacao\n @solicitacao = Solicitacao.find(parametros[:id])\n end",
"title": ""
},
{
"docid": "54e8f841c42d0a52989eac276fa406df",
"score": "0.54967314",
"text": "def update\n @solicitud = Solicitud.find(params[:id])\n\n #limpiamos fecha de creacion pasandola a formato MM/DD/YYYY\n params[:solicitud][:fecha_creacion] = fix_date(params[:solicitud][:fecha_creacion]) if params[:solicitud][:fecha_creacion]\n\n respond_to do |format|\n if @solicitud.update_attributes(params[:solicitud])\n flash[:notice] = 'Solicitud actualizada con exito.'\n format.html { redirect_to institucion_solicitud_path(@institucion, @solicitud) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @solicitud.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6070705c1af929cf1357850472c8ddd4",
"score": "0.54898536",
"text": "def update\n @tipos_subsidio = TiposSubsidio.find(params[:id])\n\n respond_to do |format|\n if @tipos_subsidio.update_attributes(params[:tipos_subsidio])\n format.html { redirect_to(@tipos_subsidio, :notice => 'TiposSubsidio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipos_subsidio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "87cac32a091b9d0cbef4c8eb744a0f3a",
"score": "0.54765147",
"text": "def create\n @solicit = Solicit.new(solicit_params)\n\n respond_to do |format|\n if @solicit.save\n format.html { redirect_to @solicit, notice: 'Solicit was successfully created.' }\n format.json { render :show, status: :created, location: @solicit }\n else\n format.html { render :new }\n format.json { render json: @solicit.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "4a7a036c690da4180810fb04d32754c4",
"score": "0.5476114",
"text": "def set_solicitacao_transporte\n @solicitacao_transporte = SolicitacaoTransporte.find(params[:id])\n end",
"title": ""
},
{
"docid": "83316ba7728bc653e5e547a7272fd073",
"score": "0.54593843",
"text": "def destroy\n @solicitation = Solicitation.find(params[:id])\n @solicitation.destroy\n\n respond_to do |format|\n format.html { redirect_to(solicitations_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "c9f6b3da2afc426ffcffed9d7c5507e3",
"score": "0.5440091",
"text": "def update\n respond_to do |format|\n if @solicitacao_alt.update(solicitacao_alt_params)\n format.html { redirect_to @solicitacao_alt, notice: 'Solicitacao alt was successfully updated.' }\n format.json { render :show, status: :ok, location: @solicitacao_alt }\n else\n format.html { render :edit }\n format.json { render json: @solicitacao_alt.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8e18db431964c254de53caa41795b702",
"score": "0.5431409",
"text": "def put *args\n make_request :put, *args\n end",
"title": ""
},
{
"docid": "a6eaddde60ad0ad290c11346400ad414",
"score": "0.541378",
"text": "def put\n request = Net::HTTP::Put.new(endpoint_uri.request_uri)\n request.basic_auth Unfuzzle.username, Unfuzzle.password\n request.content_type = 'application/xml'\n \n Response.new(client.request(request, @payload))\n end",
"title": ""
},
{
"docid": "a48b3229e830876ae619b936301400b2",
"score": "0.5408603",
"text": "def put(url, xml, version = nil)\n req = Net::HTTP::Put.new(url)\n req.content_type = 'application/x-ssds+xml'\n \n if(!version.nil?)\n req['if-match'] = version;\n end\n \n req.content_length = xml.to_s.size.to_s\n req.basic_auth @username, @password\n req.body = xml.to_s\n execute_request(req)\n end",
"title": ""
},
{
"docid": "7c90a0c224bb39e0310f9954467e0e85",
"score": "0.54063994",
"text": "def update\n @simplace = Simplace.find(params[:id])\n\n respond_to do |format|\n if @simplace.update_attributes(params[:simplace])\n flash[:notice] = 'Simplace was successfully updated.'\n format.html { redirect_to(@simplace) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @simplace.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "b0f8c9a2ea1e2bd241a0a753188ac086",
"score": "0.54010177",
"text": "def update\n @nota = @solicitud.notas.find(params[:id])\n\n respond_to do |format|\n if @nota.update_attributes(params[:nota])\n format.html { redirect_to( solicitud_notas_path(@solicitud), :notice => 'Seguimiento actualizado con exito.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @nota.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2c938e84bc31cdc71fe947ce8217f8be",
"score": "0.53845406",
"text": "def create\n @solicitud = Solicitud.new(params[:solicitud])\n respond_to do |format|\n if @solicitud.save\n flash[:notice] = 'La solicitud a sido correctamente creada.'\n format.html { redirect_to(@solicitud) }\n format.xml { render :xml => @solicitud, :status => :created, :location => @solicitud }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @solicitud.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "da19cf23acedd5ee735a47cbc828c57f",
"score": "0.5372012",
"text": "def update\n authorize! :update_compra,Sigesp::Solicitud \n @solicitud.actualizar(sigesp_solicitud_params)\n if @solicitud.errors.empty?\n return render :show\n else\n return render json:@solicitud.errors ,status: :unprocessable_entity\n end \n end",
"title": ""
},
{
"docid": "07918d5a67562e424f50e841ebcd6a84",
"score": "0.53704286",
"text": "def put(path , params = {})\n request(:put , path , params)\n end",
"title": ""
},
{
"docid": "b44fcca808470030b0d4a8ca0e32b4b7",
"score": "0.53672594",
"text": "def update\n @estagiarios = Estagiario.find(params[:id])\n\n respond_to do |format|\n if @estagiarios.update_attributes(params[:estagiario])\n flash[:notice] = 'ESTAGIÁRIO SALVO COM SUCESSO.'\n format.html { redirect_to(@estagiarios) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estagiarios.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ad54471b285e5e357d9be959c8ade2d8",
"score": "0.53605086",
"text": "def update\n path = \"/workflow/#{repo}/objects/druid:#{druid}/workflows/#{workflow}/#{step}\"\n conn = Faraday.new(url: config['host'])\n conn.basic_auth(config['user'], config['password'])\n conn.headers['content-type'] = 'application/xml'\n\n conn.put path, payload\n end",
"title": ""
},
{
"docid": "c7d3cd0f218c42e01dbd0246ab7b00c9",
"score": "0.53583413",
"text": "def put(path, params={}); make_request(:put, host, port, path, params); end",
"title": ""
},
{
"docid": "27096800d14893529f640b6cf4566aba",
"score": "0.534411",
"text": "def update\n connection.put(\"/todo_lists/#{id}.xml\",\n \"<todo-list>\n <name>#{name}</name>\n <description>#{description}</description>\n <milestone_id>#{milestone_id}</milestone_id>\n </todo-list>\",\n XML_REQUEST_HEADERS)\n end",
"title": ""
},
{
"docid": "febb8482558b8a81d61ec8b91cf874de",
"score": "0.53391653",
"text": "def create\n @solicitud = Solicitud.new(solicitud_params)\n @solicitud.usuario_id = current_user.id\n\n respond_to do |format|\n if @solicitud.save\n actualizar\n format.html { redirect_to @solicitud, notice: 'La solicitud fue creada correctamente' }\n format.json { render :show, status: :created, location: @solicitud }\n else\n format.html { render :new }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "dabaaacc799019b0211d250061f3be92",
"score": "0.5328814",
"text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n\n format.html { redirect_to(servicos_url) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @servico.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "545dadbe32aa3d9d0edf1d22293783fc",
"score": "0.53234434",
"text": "def test_put_existing\n request = Http::Request.new('PUT', '/file1', {}, 'bar')\n\n response = self.request(request)\n\n assert_equal(204, response.status)\n\n assert_equal(\n 'bar',\n @server.tree.node_for_path('file1').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('bar')}\\\"\"]\n },\n response.headers\n )\n end",
"title": ""
},
{
"docid": "07885e3caf29bb95fcf2cd9a30593d66",
"score": "0.5322099",
"text": "def destroy\n @solicitud = Solicitud.find(params[:id])\n @solicitud.destroy\n\n respond_to do |format|\n format.html { redirect_to(solicitudes_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "7360de6151910f4b11941c8598150c01",
"score": "0.53184676",
"text": "def update\n @tipospoblacion = Tipospoblacion.find(params[:id])\n\n respond_to do |format|\n if @tipospoblacion.update_attributes(params[:tipospoblacion])\n format.html { redirect_to(@tipospoblacion, :notice => 'Tipospoblacion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipospoblacion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "177a19f7f85a31ed8cc5bc04c10f899d",
"score": "0.53149176",
"text": "def update\n @tipo_osexterna = TipoOsexterna.find(params[:id])\n\n respond_to do |format|\n if @tipo_osexterna.update_attributes(params[:tipo_osexterna])\n flash[:notice] = 'ATUALIZADO COM SUCESSO.'\n format.html { redirect_to(@tipo_osexterna) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_osexterna.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e6848e47eb2b08bcd2f6e206e8bfbe85",
"score": "0.5310873",
"text": "def set_solicitacao_exclusao\n @solicitacao_exclusao = SolicitacaoExclusao.find(params[:id])\n end",
"title": ""
},
{
"docid": "eb3474e1d26ed3f6b6a32c3f3a1ea64d",
"score": "0.53072906",
"text": "def update\n @estagiario = Estagiario.find(params[:id])\n\n respond_to do |format|\n if @estagiario.update_attributes(params[:estagiario])\n flash[:notice] = 'Estagiario foi atualizado com sucesso.'\n format.html { redirect_to(@estagiario) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @estagiario.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "0ce93f236832bafc146e205df3bbf901",
"score": "0.530648",
"text": "def set_solicitacao_alt\n @solicitacao_alt = SolicitacaoAlt.find(params[:id])\n end",
"title": ""
},
{
"docid": "a219a5b45c89a9f7052d812ade1e148b",
"score": "0.530097",
"text": "def update\n @seat = Seat.find(params[:id])\n\n idasiento = @seat.id_asiento.to_s\n usuario = session[:usr].to_s\n password = session[:pwd].to_s\n Rails.logger.info usuario.inspect\n \n client = Savon::Client.new (ruta_wdsl)\n client.wsdl.soap_actions\n response = client.request :ser, :reservarAsiento do\n soap.namespaces[\"xmlns:ser\"] = \"http://service.wsreserva.qwerty.dsd.upc.edu.pe/\"\n soap.body = \"<usuario>\" + usuario + \"</usuario><password>\" + password + \"</password><idAsiento>\"+idasiento+\"</idAsiento>\"\n end\n\n if response.success?\n @seat=response.to_hash()\n respond_to do |format|\n if @seat[:reservar_asiento_response][:return][:codigo]==\"0\"\n format.html { redirect_to \"/\", notice: @seat[:reservar_asiento_response][:return][:mensaje] }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @seat[:reservar_asiento_response][:return][:mensaje], status: :unprocessable_entity }\n end\n end\n end\n end",
"title": ""
},
{
"docid": "9190018f7b11e39e2d177190a0b4c098",
"score": "0.53004897",
"text": "def update\n @servicios = Servicios.find(params[:id])\n\n respond_to do |format|\n if @servicios.update_attributes(params[:servicios])\n flash[:notice] = 'Servicios was successfully updated.'\n format.html { redirect_to(@servicios) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @servicios.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "e0451d48b60c995d80dcec0e792ed42a",
"score": "0.52915674",
"text": "def update\n @tipoespacio = Tipoespacio.find(params[:id])\n\n respond_to do |format|\n if @tipoespacio.update_attributes(params[:tipoespacio])\n flash[:notice] = 'Tipo actualizado correctamente.'\n format.html { redirect_to(@tipoespacio) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipoespacio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ce6a72d58aaec141d460944e9fb68aa",
"score": "0.52901113",
"text": "def update\n @sitio = Sitio.find(params[:id])\n\n respond_to do |format|\n if @sitio.update_attributes(params[:sitio])\n format.html { redirect_to(@sitio, :notice => 'Sitio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sitio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "9ce6a72d58aaec141d460944e9fb68aa",
"score": "0.52901113",
"text": "def update\n @sitio = Sitio.find(params[:id])\n\n respond_to do |format|\n if @sitio.update_attributes(params[:sitio])\n format.html { redirect_to(@sitio, :notice => 'Sitio was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sitio.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1abd757de0dc335100182ef5324708fd",
"score": "0.5275829",
"text": "def update\n @tipo_signos = TipoSigno.find(params[:id])\n\n respond_to do |format|\n if @tipo_signos.update_attributes(params[:tipo_signo])\n format.html { redirect_to(@tipo_signos, :notice => 'Los datos del tipo de signo fueron actualizados de forma correcta.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @tipo_signos.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "7dcf61d28367255f0ec9cea7ade341de",
"score": "0.52739996",
"text": "def update(id, name=\"Updated Name\", published=\"false\", genre=\"movie\")\r\n xml_req =\r\n \"<?xml version='1.0' encoding='UTF-8'?>\r\n <timeline>\r\n <published type='string'>#{published}</published>\r\n <id type='integer'>#{id}</id>\r\n <description>#{name}</description>\r\n <genre>#{genre}</genre>\r\n </timeline>\"\r\n \r\n request = Net::HTTP::Put.new(\"#{@url}/#{id}.xml\")\r\n request.add_field \"Content-Type\", \"application/xml\"\r\n request.body = xml_req\r\n \r\n http = Net::HTTP.new(@uri.host, @uri.port)\r\n response = http.request(request)\r\n \r\n # no response body will be returned\r\n case response\r\n when Net::HTTPSuccess\r\n return \"#{response.code} OK\"\r\n else\r\n return \"#{response.code} ERROR\"\r\n end\r\n end",
"title": ""
},
{
"docid": "99d24a74bc96db3bd84b0451ef3afb5f",
"score": "0.52700305",
"text": "def test_put_invoices_1_xml\n @parameters = {:invoice => {:number => 'NewNumber'}}\n \n Redmine::ApiTest::Base.should_allow_api_authentication(:put,\n '/invoices/1.xml',\n {:invoice => {:number => 'NewNumber'}},\n {:success_code => :ok})\n \n assert_no_difference('Invoice.count') do\n put '/invoices/1.xml', @parameters, credentials('admin')\n end\n \n invoice = Invoice.find(1)\n assert_equal \"NewNumber\", invoice.number\n \n end",
"title": ""
},
{
"docid": "9ddf960eb3f437e62b9b99d34992bc0f",
"score": "0.52688557",
"text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :success\r\n end",
"title": ""
},
{
"docid": "925d2eddd5ea8b4880eb727e5b99034c",
"score": "0.5266615",
"text": "def update\n @sesion = Sesion.find(params[:id])\n\n respond_to do |format|\n if @sesion.update_attributes(params[:sesion])\n format.html { redirect_to(@sesion, :notice => 'Sesion was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @sesion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "8415acb983da3addb269a79e461bba00",
"score": "0.5260354",
"text": "def put(uri, options = {})\n request :put, options\n end",
"title": ""
},
{
"docid": "23b8fd20c4f863cc9fd1d0f2eeefb2e5",
"score": "0.5255998",
"text": "def update_task\n @user = User.find_by_username(session['user'])\n @access_token = OAuth::AccessToken.new(UsersController.consumer, @user.token, @user.secret)\n @response = UsersController.consumer.request(:put, \"/api/v1/tasks/#{params[:id]}.xml\", @access_token, {:scheme => :query_string},\n {'task[title]' => 'Updated Valid Task'})\n render :xml => @response.body\n end",
"title": ""
},
{
"docid": "a21658e8869b48b877bfbe57de8fb717",
"score": "0.52550054",
"text": "def update_contact\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/contacts/3'\n ).to_s\n\n puts RestClient.put(\n url,\n { Contact: { email: \"wacky_new_email@coolstuff.com\" } } )\n \nend",
"title": ""
},
{
"docid": "0947ae31bc6371357d0a9180203129ca",
"score": "0.5252698",
"text": "def update\n respond_to do |format|\n if @sfuture.update(sfuture_params)\n format.html { redirect_to @sfuture, notice: 'Sfuture was successfully updated.' }\n format.json { render :show, status: :ok, location: @sfuture }\n else\n format.html { render :edit }\n format.json { render json: @sfuture.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "6bf505e66f8c8e67bd756756115f56e8",
"score": "0.5243814",
"text": "def update\n @serviciorepuesto = Serviciorepuesto.find(params[:id])\n\n respond_to do |format|\n if @serviciorepuesto.update_attributes(params[:serviciorepuesto])\n format.html { redirect_to(@serviciorepuesto, :notice => 'Serviciorepuesto was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @serviciorepuesto.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "96c2c4ca74afa5a26914fb582062f271",
"score": "0.5236611",
"text": "def test_should_update_event_via_API_XML\r\n get \"/logout\"\r\n put \"/events/1.xml\", :event => {:name => 'Test API Event 1',\r\n :start_time => Time.now.to_s(:db),\r\n :end_time => Time.now.to_s(:db),\r\n :user_id => 1,\r\n :description => 'Test API Event 1 Desc',\r\n :event_type => 'API Type',\r\n :location => 'Testville, USA',\r\n :street => 'Testers Rd.',\r\n :city => 'TestTown',\r\n :website => 'http://www.test.com',\r\n :phone => '555-555-5555',\r\n :organized_by => 'API Testers of America'}\r\n assert_response 401\r\n end",
"title": ""
},
{
"docid": "8bb0786e820a42bba1bfe9248a5123d3",
"score": "0.5234665",
"text": "def create\n @solicitud = Solicitud.new(solicitud_params)\n @vendedor = Usuario.first\n @solicitud.vendedor_id = @vendedor.id\n @solicitud.estado = 0\n @solicitud.fecha = Date.today\n respond_to do |format|\n if @solicitud.save\n format.html { redirect_to @solicitud, notice: 'Solicitud realizada exitosamente.' }\n format.json { render :show, status: :created, location: @solicitud }\n else\n format.html { render :new }\n format.json { render json: @solicitud.errors, status: :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "1988f2ef1f51512708ce4e71d723fb42",
"score": "0.52334476",
"text": "def update\n @stes_e = StesE.find(params[:id])\n\n respond_to do |format|\n if @stes_e.update_attributes(params[:stes_e])\n format.html { redirect_to :controller => :edit, :action => :index }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @stes_e.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "ae9d0711a1004eb36f5ab1709ca0c585",
"score": "0.52261025",
"text": "def update\n @seccion = Seccion.find(params[:id])\n\n respond_to do |format|\n if @seccion.update_attributes(params[:seccion])\n format.html { redirect_to(secciones_path, :notice => \"La Sección #{@seccion} ha sido creado satisfactoriamente.\") }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @seccion.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "fe2c0f3115b879df35baefa6a1659763",
"score": "0.5225888",
"text": "def update\n @location = Location.find(params[:location][:id])\n\n respond_to do |format|\n if @location.update_attributes(params[:location])\n format.xml { head :ok }\n end\n end\n end",
"title": ""
},
{
"docid": "085c2f6887d484a8a5b3d4489bd20f84",
"score": "0.52219594",
"text": "def create\n\n @solicitud = @institucion.solicitudes.new(params[:solicitud])\n @solicitud.usuario_id = current_usuario.id\n @solicitud.origen_id = Solicitud::ORIGEN_DEFAULT\n\n #limpiamos fecha de creacion pasandola a formato MM/DD/YYYY\n @solicitud.fecha_creacion = fix_date(params[:solicitud][:fecha_creacion])\n\n respond_to do |format|\n if @solicitud.save\n flash[:success] = 'Solicitud creada con exito.'\n format.html { redirect_to laip_solicitud_path(@solicitud) }\n format.xml { render :xml => @solicitud, :status => :created, :location => @solicitud }\n else\n logger.debug { \"Error #{@solicitud.errors.inspect}\" }\n format.html { render :action => \"new\" }\n format.xml { render :xml => @solicitud.errors, :status => :unprocessable_entity }\n end\n end\n end",
"title": ""
},
{
"docid": "2f43d79cb8ce757f5e82d8476fd01962",
"score": "0.5213267",
"text": "def test_should_update_topic_via_API_XML\r\n get \"/logout\"\r\n put \"/forum_topics/1.xml\", :forum_topic => {:title=>'Updated API Test Topic',\r\n :description=>'Updated Test topic desc',\r\n :user_id=>1}\r\n assert_response 401\r\n end",
"title": ""
}
] |
79077fbb9faba6ef48142f5ed6220d4b
|
view for :instance_view is provided directly by view_for_state.
|
[
{
"docid": "45e29e6cfb1c5918794693c5bb28cb92",
"score": "0.6635425",
"text": "def test_view_for_state\n t = CellsTestOneCell.new(@controller)\n c = render_cell_state(t, :instance_view)\n assert_selekt c, \"#renamedInstanceView\"\n end",
"title": ""
}
] |
[
{
"docid": "ea24f760c891d7988999e34220579f76",
"score": "0.65331066",
"text": "def view\n @_view\n end",
"title": ""
},
{
"docid": "15fb33b16b474715e54ca66afd7a9089",
"score": "0.6454245",
"text": "def _view; end",
"title": ""
},
{
"docid": "6c37573a78eb27bee0ad51f43f662b12",
"score": "0.6406186",
"text": "def view_for_state(state)\n nil\n end",
"title": ""
},
{
"docid": "6c37573a78eb27bee0ad51f43f662b12",
"score": "0.6406186",
"text": "def view_for_state(state)\n nil\n end",
"title": ""
},
{
"docid": "6c37573a78eb27bee0ad51f43f662b12",
"score": "0.6406186",
"text": "def view_for_state(state)\n nil\n end",
"title": ""
},
{
"docid": "e3af3f0dba24f3f0c5299ca7679de06a",
"score": "0.62548476",
"text": "def view_instance\n # view = if controller.response.template\n # controller.response.template\n # else\n View.new controller, master_helper_module\n # end\n \n # view.extend Extensions::View\n end",
"title": ""
},
{
"docid": "eff0fc30d0aec3350f0b34b97a8196dc",
"score": "0.61906683",
"text": "def view()\n @view\n end",
"title": ""
},
{
"docid": "ed29f50951ccb4b576a4bc37e9ccdd1a",
"score": "0.60231256",
"text": "def render_view_for(opts, state)\n view_class = Class.new(Cell::View)\n action_view = view_class.new(self.class.view_paths, {}, @controller)\n action_view.cell = self\n \n # make helpers available:\n include_helpers_in_class(view_class) \n \n # handle :layout, :template_format, :view\n render_opts = defaultize_render_options_for(opts, state)\n \n action_view.assigns = assigns_for_view # make instance vars available.\n action_view.template_format = render_opts[:template_format]\n \n template = find_family_view_for_state(render_opts[:view], action_view)\n ### TODO: cache family_view for this cell_name/state in production mode,\n ### so we can save the call to possible_paths_for_state.\n render_opts[:file] = template unless render_opts[:file]\n \n action_view.render(render_opts) \n end",
"title": ""
},
{
"docid": "7595a27297306f1f161c2f7ef07846cd",
"score": "0.5898441",
"text": "def render_view_for_state(state)\n view_class = Class.new(ActionView::Base)\n action_view = view_class.new(template_root, {}, @controller)\n action_view.for_cells = true\n\n view_file = find_view_file_for_state(action_view, state)\n\n unless view_file && File.readable?(view_file)\n ### TODO: introduce error method.\n return \"ATTENTION: cell view for #{cell_name}##{state} is not readable/existing.\n Further on, your cell method did not return a String.\"\n end\n\n # Make helpers and instance vars available\n include_helpers_in_class(view_class)\n clone_ivars_to(action_view)\n action_view.render_file(view_file, false)\n end",
"title": ""
},
{
"docid": "60190604e2e39bfe62bc071cd558ca38",
"score": "0.5806789",
"text": "def render_view_for_state(state)\n view_class = Class.new(ActionView::Base)\n\n # We cheat a little bit by providing the view class with a known-good views dir\n action_view = view_class.new(\"#{RAILS_ROOT}/app/views\", {}, @controller)\n\n # Now override the finder in the view_class with our own (we can't use Rails' finder because it's braindead)\n action_view.send(:instance_variable_set, '@finder', Cell::TemplateFinder.new(self, state, action_view))\n\n # Make helpers and instance vars available\n include_helpers_in_class(view_class)\n clone_ivars_to(action_view)\n \n begin\n Rails.cache.fetch([\"cells\",cell_name,state].join(\":\"),:force => @force_cache_update) do\n action_view.render_file(\"#{self.cell_name}/#{state}\", true) # path that is passed to finder.path_and_extension\n end\n rescue ActionView::MissingTemplate\n ### TODO: introduce error method.\n return \"ATTENTION: cell view for #{cell_name}##{state} is not readable/existing.\n Further on, your cell method did not return a String.\"\n end\n end",
"title": ""
},
{
"docid": "6199ef05323f30dcb6592b0a3765e44d",
"score": "0.58062106",
"text": "def show()\n @view__.show\n self\n end",
"title": ""
},
{
"docid": "3da8cbee4159c08ef8e6d11fc3a7f2eb",
"score": "0.5749658",
"text": "def view view, &block\n @views[view]\n if block\n raise \"Nested views not supported\" if @current_view\n @current_view = view\n self.instance_eval &block\n @current_view = nil\n end\n end",
"title": ""
},
{
"docid": "47e38b91085eb514fa640c66020b953f",
"score": "0.5692803",
"text": "def view_instance\n view = ActionView::Base.new(controller.class.view_paths, {}, controller)\n view.extend master_helper_module\n end",
"title": ""
},
{
"docid": "3827345557e669b4ce901f4d54cb7ee0",
"score": "0.56892514",
"text": "def initialize(view)\n @view = view\n end",
"title": ""
},
{
"docid": "dc2730c2048cf83e6f021c41edc880bd",
"score": "0.5671841",
"text": "def find_family_view_for_state_with_caching(state)\n return find_family_view_for_state(state) unless self.class.cache_configured?\n\n # in production mode:\n key = \"#{state}/#{action_view.template_format}\"\n state2view = self.class.state2view_cache\n state2view[key] || state2view[key] = find_family_view_for_state(state, action_view)\n end",
"title": ""
},
{
"docid": "38354c0dd0c314483e4c023b64e49f68",
"score": "0.5643986",
"text": "def view; end",
"title": ""
},
{
"docid": "f4c750c26258ab15f6fdedfaf6dce3ab",
"score": "0.5625471",
"text": "def initialize(view)\n @view = view\n end",
"title": ""
},
{
"docid": "e8f725d57574b7762264b64b656f0f87",
"score": "0.56229675",
"text": "def render(options = nil, extra_options = {}, &block)\n if params[:format] == 'xml' # dump the view state as XML\n put_xml @view_state\n else\n super options\n end\n end",
"title": ""
},
{
"docid": "16a676f86bbde7f0c6b5e34d4fe2c777",
"score": "0.5614687",
"text": "def initialize(view)\n @view = view\n end",
"title": ""
},
{
"docid": "9cb47808e26d37236b790f00d7edb8a6",
"score": "0.5607665",
"text": "def _h\n @view_context\n end",
"title": ""
},
{
"docid": "12a46438e4c83a3f5a882c992d6fc9af",
"score": "0.55959034",
"text": "def initialize\n super\n @view_state = services[:view_state]\n @tmp_cache = {}\n @initialised = false\n end",
"title": ""
},
{
"docid": "86f12ab1e054b8f5cc9efb5bcaef2e68",
"score": "0.55545264",
"text": "def view_context\n @view_context\n end",
"title": ""
},
{
"docid": "3908531aea896ae2958009cdc1775293",
"score": "0.55498034",
"text": "def show\n @instance_action = InstanceAction.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instance_action }\n end\n end",
"title": ""
},
{
"docid": "041aafc5ab717fe2823279f290a81437",
"score": "0.55095315",
"text": "def view_template\n cell_name + '/#{state}'\n end",
"title": ""
},
{
"docid": "a7faa544ec924b8556e80f31262494fe",
"score": "0.5496903",
"text": "def to_view(type)\n if (self.respond_to?(:view_file))\n return ::Base::Render.template(binding(), self.view_file(type))\n else\n return self.render_fields(:to_view, type)\n end\n end",
"title": ""
},
{
"docid": "6397e4912f6c5736161f237c9c2ecba5",
"score": "0.5496211",
"text": "def rendered_views=(_arg0); end",
"title": ""
},
{
"docid": "977979709526b4e6d620abb461ac3933",
"score": "0.5458314",
"text": "def call\n load_view_class\n return <<-RUBY\n instance_vars = assigns.merge(local_assigns).inject({}) do |result, (name, value)|\n result.update(\"@\\#{name}\" => value)\n end\n view = #{view_class_name}.new(self, instance_vars) { |*names| yield(*names) }\n view.#{render_method}(#{template_source.inspect})\n RUBY\n end",
"title": ""
},
{
"docid": "1d702a270855632788a02a992eb99113",
"score": "0.54446894",
"text": "def method_missing(method, *args, &block)\n view.send(method, *args, &block)\n end",
"title": ""
},
{
"docid": "2b763faab06d65a2f44e7bd3a9bc2287",
"score": "0.5421315",
"text": "def method_missing(*args, &block)\n @_view.send(*args, &block)\n end",
"title": ""
},
{
"docid": "867b05dd818048cd9b0298996b968102",
"score": "0.54172015",
"text": "def views\n self[:views] ||= Gnash.new\n end",
"title": ""
},
{
"docid": "e99cdb2f62fbde1b99155d6a23514938",
"score": "0.5414759",
"text": "def show()\n view.show\n end",
"title": ""
},
{
"docid": "05ab6d2c917ad48577ec51270d98a0a3",
"score": "0.5413931",
"text": "def find_view_file_for_state(action_view, state)\n ### DISCUSS: check for existence here?\n if view_file = view_for_state(state) # instance. (not passing action_view)\n return view_file\n end\n\n return self.class.find_class_view_for_state(action_view, state)\n end",
"title": ""
},
{
"docid": "05ab6d2c917ad48577ec51270d98a0a3",
"score": "0.5413931",
"text": "def find_view_file_for_state(action_view, state)\n ### DISCUSS: check for existence here?\n if view_file = view_for_state(state) # instance. (not passing action_view)\n return view_file\n end\n\n return self.class.find_class_view_for_state(action_view, state)\n end",
"title": ""
},
{
"docid": "cb540d5cbce002e9870cbef374eacef9",
"score": "0.5413048",
"text": "def show\n render json: @instance\n end",
"title": ""
},
{
"docid": "1e6b47eb8f1f3812a54167c10bf3eaa5",
"score": "0.53976583",
"text": "def render_view_for_state(state, options = {})\n begin\n # path that is passed to finder.path_and_extension\n action_view_template(state).render(options.merge(:file => state.to_s, :use_full_path => true))\n rescue ActionView::MissingTemplate => e\n ### TODO: introduce error method.\n if RAILS_ENV == \"development\"\n return \"ATTENTION: cell view for #{cell_name}##{state} is not readable/existing. #{e}\"\n elsif RAILS_ENV == \"test\"\n raise\n else\n warn \"ATTENTION: cell view for #{cell_name}##{state} is not readable/existing.\"\n return nil\n end\n end\n end",
"title": ""
},
{
"docid": "ef738f883ea4c6afe2feeb3c0d0219c1",
"score": "0.53928113",
"text": "def show\n #@instance = Instance.find(params[:id])\n @instance = Instance.first\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instance }\n end\n end",
"title": ""
},
{
"docid": "a9239b8e0f7f299b996ee2b24b1e8769",
"score": "0.53387076",
"text": "def instance(opts)\n opts = check_params(opts,[:instance_format])\n super(opts)\n end",
"title": ""
},
{
"docid": "8ba61c78cfce031907df8295b894d873",
"score": "0.5334647",
"text": "def show\n #@instance = Instance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instance }\n end\n end",
"title": ""
},
{
"docid": "3e22b8aaa47fb91a5a0d820f6408dfed",
"score": "0.53106827",
"text": "def view\n end",
"title": ""
},
{
"docid": "d6f3cd0bce9247838a709492501a72c1",
"score": "0.5310308",
"text": "def add_instance_vocabulary_views\n return if self.vocabulary.nil?\n self.vocabulary.key_list.each {|k| add_instance_view(k)}\n instance_design_doc\n end",
"title": ""
},
{
"docid": "d6f3cd0bce9247838a709492501a72c1",
"score": "0.5310308",
"text": "def add_instance_vocabulary_views\n return if self.vocabulary.nil?\n self.vocabulary.key_list.each {|k| add_instance_view(k)}\n instance_design_doc\n end",
"title": ""
},
{
"docid": "b92dba43fad8413a341a5bc25e180833",
"score": "0.5299933",
"text": "def render_state(state)\n content = dispatch_state(state)\n \n return content if content.kind_of? String\n \n \n ### DISCUSS: are these vars really needed in state views?\n @cell = self\n @state_name = state\n \n render_view_for(content, state)\n end",
"title": ""
},
{
"docid": "3eb5cea36c4f697b8d46fe0cac3cc6d6",
"score": "0.52946144",
"text": "def show\n @instance = Instance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @instance }\n end\n end",
"title": ""
},
{
"docid": "9d1ed80e04e5abf71d085c005960f0cc",
"score": "0.5293624",
"text": "def render_view_for(opts, state)\n return '' if opts[:nothing]\n\n ### TODO: dispatch dynamically:\n if opts[:text] ### FIXME: generic option?\n elsif opts[:inline]\n elsif opts[:file]\n elsif opts[:state] ### FIXME: generic option\n opts[:text] = render_state(opts[:state])\n else\n # handle :layout, :template_format, :view\n opts = defaultize_render_options_for(opts, state)\n\n # set instance vars, include helpers:\n #prepare_action_view_for(action_view, opts)\n\n #template = find_family_view_for_state_with_caching(opts[:view], action_view)\n template = find_family_view_for_state(opts[:view])\n opts[:template] = template\n end\n\n opts = sanitize_render_options(opts)\n \n render_to_string(opts)\n end",
"title": ""
},
{
"docid": "3f3aff4c33ec49032847ba35e1db6ed2",
"score": "0.52909666",
"text": "def on_view(definition, &block)\n on(definition, true, &block)\n end",
"title": ""
},
{
"docid": "391146cefe73bbffc80f5045c552f533",
"score": "0.5270749",
"text": "def ar_view\n view = nil\n\n if params[:view]\n view = self.class.ar_views[params[:view].to_sym] ||\n self.class.ar_model.interfaces[:rest].views[params[:view].to_sym]\n end\n\n view ||= self.class.ar_views[action_name.to_sym] ||\n self.class.ar_model.interfaces[:rest].views[action_name.to_sym] ||\n View.new(:anonymous)\n view\n end",
"title": ""
},
{
"docid": "fa2539f85d7f327ef75421b324ae4430",
"score": "0.5265101",
"text": "def view_path\n @@view_path\n end",
"title": ""
},
{
"docid": "1b7980cd0e7094919bc4b38b58743b14",
"score": "0.52588636",
"text": "def new\n @instance_action = InstanceAction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @instance_action }\n end\n end",
"title": ""
},
{
"docid": "26a8b31fc81c287ffd133a134bceaf64",
"score": "0.5243673",
"text": "def view\n JenkinsPipelineBuilder::View.new(self)\n end",
"title": ""
},
{
"docid": "a6cd66be71d1b6cfeb7d7afc33a20d83",
"score": "0.52432996",
"text": "def show\n @instance_name = InstanceName.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instance_name }\n end\n end",
"title": ""
},
{
"docid": "b5b25700e97a3ff8649acd443cb60f46",
"score": "0.52380645",
"text": "def instance; end",
"title": ""
},
{
"docid": "b5b25700e97a3ff8649acd443cb60f46",
"score": "0.52380645",
"text": "def instance; end",
"title": ""
},
{
"docid": "b5b25700e97a3ff8649acd443cb60f46",
"score": "0.52380645",
"text": "def instance; end",
"title": ""
},
{
"docid": "a1bdfe97340241025bec3ca24bec8366",
"score": "0.5224207",
"text": "def get_view\n #debugger\n self.becomes(self.type.constantize).get_view\n end",
"title": ""
},
{
"docid": "434cf2fc05bc517ae9694a7eabe7fada",
"score": "0.5212327",
"text": "def show\n @instance = Instance.find(params[:id])\n render :json =>@instance\n end",
"title": ""
},
{
"docid": "2e182c7e3173e22f6988797282036d64",
"score": "0.5200087",
"text": "def show\n render :view\n end",
"title": ""
},
{
"docid": "dbe3da9832f4076e451d932ecd81c596",
"score": "0.51851064",
"text": "def view_for_state(state)\n \"#{cell_name}/#{state}\"\n end",
"title": ""
},
{
"docid": "ccb3920159e0f72528832905d209a748",
"score": "0.51789534",
"text": "def instance\n @controller.instance_variable_get(:\"@#{instance_name}\")\n end",
"title": ""
},
{
"docid": "a03dc2294c37552c0e4b326ba65e72d5",
"score": "0.51789135",
"text": "def build\n view\n self\n end",
"title": ""
},
{
"docid": "c71f6380fcb5044dcbb5af8270e9d120",
"score": "0.5161568",
"text": "def instance_helper\n\tend",
"title": ""
},
{
"docid": "ef059f5b56ed5a0b1ede3da561558280",
"score": "0.5145506",
"text": "def view_context\n options[:view_context]\n end",
"title": ""
},
{
"docid": "789852c52bcfaf2b472ccad82e252aca",
"score": "0.5141716",
"text": "def view(opts)\n opts = check_params(opts,[:view_names])\n super(opts)\n end",
"title": ""
},
{
"docid": "17c09668c12c500a4714f14f85756c52",
"score": "0.5133953",
"text": "def view\n JenkinsApi::Client::View.new(self)\n end",
"title": ""
},
{
"docid": "17c09668c12c500a4714f14f85756c52",
"score": "0.5133953",
"text": "def view\n JenkinsApi::Client::View.new(self)\n end",
"title": ""
},
{
"docid": "dfbbef2bedcdf0c8b6fc80d4105539f8",
"score": "0.5130957",
"text": "def set_instance\n @instance = @workflow.instances.find(params[:instance_id])\n end",
"title": ""
},
{
"docid": "31ae6805d2850515d78c722404a65a77",
"score": "0.5127022",
"text": "def state\n State.instance\n end",
"title": ""
},
{
"docid": "5b0ec72358ec669f0789a5d82a62b383",
"score": "0.5117478",
"text": "def loc_view\n \n end",
"title": ""
},
{
"docid": "e7745a3c812c4f41e49a73dddc0231e3",
"score": "0.5110452",
"text": "def render_widget(*args)\n @view_assigns = extract_state_ivars_for(root[args.first]) do\n @last_invoke = root.render_widget(*args)\n end\n \n @last_invoke\n end",
"title": ""
},
{
"docid": "d2c10e710c3a0ac1038eee5d7d9f62a1",
"score": "0.51013607",
"text": "def view_value\n {type: type, id: id}\n end",
"title": ""
},
{
"docid": "6a76f193d6ca4d0d0aad0b346c4983a2",
"score": "0.50992787",
"text": "def call(state = :show, *args)\n @action_name = state\n super\n end",
"title": ""
},
{
"docid": "abf86f52e551b01385569a777da8cf1f",
"score": "0.5097642",
"text": "def get_instance instance_id\n instances.get_instance name: instance_path(instance_id)\n end",
"title": ""
},
{
"docid": "234556d0d13db3d4f4ea1e5d68d7bf70",
"score": "0.5095391",
"text": "def view_to_url(view, parent = nil)\n association = view_to_association(view, parent)\n if association.nil?\n controller, action = db_to_controller(view.db)\n if controller == \"ems_cloud\" && action == \"show\"\n return ems_clouds_path\n end\n if controller == \"ems_infra\" && action == \"show\"\n return ems_infras_path\n end\n if controller == \"ems_physical_infra\" && action == \"show\"\n return ems_physical_infras_path\n end\n if controller == \"ems_container\" && action == \"show\"\n return ems_containers_path\n end\n if controller == \"ems_network\" && action == \"show\"\n return ems_networks_path\n end\n if controller == \"ems_storage\" && action == \"show\"\n return ems_storages_path\n end\n\n if request[:controller] == 'service' && view.db == 'GenericObject'\n action = 'show'\n return url_for_only_path(:action => action, :id => params[:id]) + \"?display=generic_objects&generic_object_id=\"\n end\n if @explorer\n # showing a list view of another CI inside vmx\n if %w[SecurityGroup\n SecurityPolicy\n SecurityPolicyRule\n FloatingIp\n NetworkRouter\n NetwokrService\n NetworkPort\n CloudNetwork\n CloudSubnet\n LoadBalancer\n CloudVolume].include?(view.db)\n return url_for_only_path(:controller => controller, :action => \"show\") + \"/\"\n elsif [\"Vm\"].include?(view.db) && parent && request.parameters[:controller] != \"vm\"\n # this is to handle link to a vm in vm explorer from service explorer\n return url_for_only_path(:controller => \"vm_or_template\", :action => \"show\") + \"/\"\n elsif %w[MiqWidget\n ConfigurationScript\n MiqReportResult].include?(view.db) &&\n %w[report].include?(request.parameters[:controller])\n suffix = ''\n if params[:tab_id] == \"saved_reports\" || params[:pressed] == \"miq_report_run\" || params[:action] == \"reload\"\n suffix = x_node\n end\n return \"/\" + request.parameters[:controller] + \"/tree_select?id=\" + suffix\n elsif %w[User MiqGroup MiqUserRole Tenant].include?(view.db) &&\n %w[ops].include?(request.parameters[:controller])\n if @tagging\n return false # when tagging Users, Groups, Roles and Tenants, the table is non-clickable\n else\n return \"/\" + request.parameters[:controller] + \"/tree_select/?id=\" + x_node.split(\"-\")[1]\n end\n elsif view.db == \"MiqServer\" &&\n %w[ops report].include?(request.parameters[:controller])\n return \"/\" + request.parameters[:controller] + \"/tree_select/?id=\" + TREE_WITH_TAB[active_tab]\n elsif %w[ScanItemSet\n MiqSchedule\n PxeServer\n PxeImageType\n Storage\n CustomizationTemplate].include?(view.db) &&\n %w[ops pxe report].include?(params[:controller])\n return \"/#{params[:controller]}/tree_select/?id=#{TreeBuilder.get_prefix_for_model(view.db)}\"\n else\n return url_for_only_path(:action => action) + \"/\" # In explorer, don't jump to other controllers\n end\n else\n controller = case controller\n when 'template_cloud'\n 'vm_cloud'\n when 'template_infra'\n 'vm_infra'\n when 'miq_ae_domain'\n 'miq_ae_class'\n else\n controller\n end\n\n return url_for_only_path(:controller => 'restful_redirect', :model => 'ExtManagementSystem') if controller == 'ext_management_system'\n\n return url_for_only_path(:controller => controller, :action => action, :id => nil) + \"/\"\n end\n else\n # need to add a check for @explorer while setting controller incase building a link for details screen to show items\n # i.e users list view screen inside explorer needs to point to vm_or_template controller\n return url_for_only_path(:controller => parent.kind_of?(VmOrTemplate) && !@explorer ? parent.class.base_model.to_s.underscore : request.parameters[\"controller\"],\n :action => association,\n :id => parent.id) + \"?#{@explorer ? \"x_show\" : \"show\"}=\"\n end\n end",
"title": ""
},
{
"docid": "250fc9720bd6caaef9ba8bdae9b40e9e",
"score": "0.50912505",
"text": "def view_info\n super\n end",
"title": ""
},
{
"docid": "df5886082af04f67f6f562f3afb9a75b",
"score": "0.50833565",
"text": "def x()\n @view__.x\n end",
"title": ""
},
{
"docid": "3482602b337fa53c609de1fbc0844a9c",
"score": "0.50814086",
"text": "def across_virtual_state\n super\n end",
"title": ""
},
{
"docid": "767552ac0a450912d64498be9a9b0133",
"score": "0.5071261",
"text": "def view\n logger.info \"in view\"\n show\n render :action=>'show'\nend",
"title": ""
},
{
"docid": "0994a78932bca22c8858cad0ae51e26c",
"score": "0.50690585",
"text": "def view\n @view ||= returning Cell::View.new(view_paths, {}, @controller) do |v|\n v.cell = self\n v.helper_module = self.class.master_helper_module\n end\n end",
"title": ""
},
{
"docid": "80070a91f3d51a18dfb5317c876020fd",
"score": "0.5065869",
"text": "def view(view_class,text = nil, &block)\n @view_class = view_class\n @view_render = text || block if (text || block)\n end",
"title": ""
},
{
"docid": "48f590d24d894cd78a2b69926bf721b2",
"score": "0.50576895",
"text": "def view(spec)\n id = view_cache_id(spec)\n cached = cache && id.is_a?(String) && cache[id]\n if cache\n if cached\n ActiveSupport::Notifications.instrument('couch_potato.view.cached') do\n cached\n end\n else\n cache[id] = view_without_caching(spec)\n cache[id]\n end\n else\n view_without_caching(spec)\n end\n end",
"title": ""
},
{
"docid": "e58e7b8c5b886b8fc8f0c2d392be205c",
"score": "0.5057304",
"text": "def view_context\n ActionView::Base.new\n end",
"title": ""
},
{
"docid": "e23afc828202804f9c7176623a5c2785",
"score": "0.5054534",
"text": "def inspect\n \"#<#{self.class} instance_id=#{instance_id}>\"\n end",
"title": ""
},
{
"docid": "29ec0bb271a4b0bfa74d8036972f5730",
"score": "0.5050565",
"text": "def set_instance\n @instance = Instance.find(params[:id])\n end",
"title": ""
},
{
"docid": "29ec0bb271a4b0bfa74d8036972f5730",
"score": "0.5050565",
"text": "def set_instance\n @instance = Instance.find(params[:id])\n end",
"title": ""
},
{
"docid": "29ec0bb271a4b0bfa74d8036972f5730",
"score": "0.5050565",
"text": "def set_instance\n @instance = Instance.find(params[:id])\n end",
"title": ""
},
{
"docid": "29ec0bb271a4b0bfa74d8036972f5730",
"score": "0.5050565",
"text": "def set_instance\n @instance = Instance.find(params[:id])\n end",
"title": ""
},
{
"docid": "29ec0bb271a4b0bfa74d8036972f5730",
"score": "0.5050565",
"text": "def set_instance\n @instance = Instance.find(params[:id])\n end",
"title": ""
},
{
"docid": "29ec0bb271a4b0bfa74d8036972f5730",
"score": "0.5050565",
"text": "def set_instance\n @instance = Instance.find(params[:id])\n end",
"title": ""
},
{
"docid": "d30efd2ddd0b0b4fbf3b7cdf5b46be44",
"score": "0.5044251",
"text": "def instance=(instance); end",
"title": ""
},
{
"docid": "147e872f0faaa0696c9303e0d10e64f0",
"score": "0.5039799",
"text": "def do_query_view(view_name, view_options)\n database.view \"#{self.name.underscore}/#{view_name}\", view_options\n end",
"title": ""
},
{
"docid": "187aee9355e27148d6c41e9d986b3904",
"score": "0.50357974",
"text": "def get(vmname, model_view = true, group = @resource_group)\n set_default_subscription\n\n raise ArgumentError, \"must specify resource group\" unless group\n\n @api_version = '2014-06-01'\n\n if model_view\n url = build_url(@subscription_id, group, vmname)\n else\n url = build_url(@subscription_id, group, vmname, 'instanceView')\n end\n\n JSON.parse(rest_get(url))\n end",
"title": ""
},
{
"docid": "330f0ec6e9561dca75aa7900867a16ea",
"score": "0.503245",
"text": "def render_state(state)\n @cell = self\n state = state.to_s\n self.state_name = state\n\n content = send(state)\n\n if content.class == String\n return content\n end\n\n return render_view_for_state(state)\n end",
"title": ""
},
{
"docid": "df631309922074831184060b16a5b6b9",
"score": "0.5031552",
"text": "def instance=(instance)\n @controller.instance_variable_set(:\"@#{instance_name}\", instance)\n end",
"title": ""
},
{
"docid": "099dca3cc60ce7c24a772ffdd5dbb8f1",
"score": "0.50226504",
"text": "def find_class_view_for_state(state)\n return [view_for_state(state)] if superclass == Cell::Base\n \n superclass.find_class_view_for_state(state) << view_for_state(state)\n end",
"title": ""
},
{
"docid": "3b2fed5296f3e844ced1ad99a90ab17c",
"score": "0.50171244",
"text": "def layer\n self.view\n end",
"title": ""
},
{
"docid": "8b0c61fb515f88fe43d63efca3a5e3d8",
"score": "0.5012116",
"text": "def show\n render json: @state\n end",
"title": ""
},
{
"docid": "9868e0c62e70f2df28981f6de859ec3c",
"score": "0.5008737",
"text": "def shareview\n # set default\n @template = 'slideshow_customv3'\n if @view_options.has_key?(params[:v].to_i) \n @template = 'slideshow_customv'+ params[:v] \n end\n # the main share view\n # pulls in the child view\n render 'shareshow' \n \n end",
"title": ""
},
{
"docid": "53cacda6485e27b0fe61e3a4e8db2154",
"score": "0.5005138",
"text": "def state\n @instance = Instance.find_by_instance_id(params[:id])\n @instance.state = params[:state] if params[:state]\n @instance.save\n \n \n respond_to do |format|\n format.html { redirect_to(instances_url) }\n format.xml { head :ok }\n end\n end",
"title": ""
},
{
"docid": "5fbaade9f492fcf28472b79cbfffc246",
"score": "0.49963325",
"text": "def show\n #not needed for our implementation\n end",
"title": ""
},
{
"docid": "dea473f4ec32edfd800e6a6c26cad8e7",
"score": "0.4994342",
"text": "def make_render_in_view exp\n make_render exp, true\n end",
"title": ""
},
{
"docid": "5a2972f5feb63ab141ec30f1a472c921",
"score": "0.49938187",
"text": "def show\n # No implementation needed\n end",
"title": ""
}
] |
16468c8520591739380cb7465757e200
|
Format the node pretty printing.
|
[
{
"docid": "9ca24d20c4793447d4aefedc16579574",
"score": "0.75439733",
"text": "def _format\r\n result = \"#{' '*_depth}#{_name} #{_sample}\\n\"\r\n each do |node|\r\n result << node._format\r\n end\r\n result\r\n end",
"title": ""
}
] |
[
{
"docid": "b3e8d4159d7b8fefeb69859f062a83b3",
"score": "0.7504719",
"text": "def pretty_print(node = @root, prefix = '', is_left = true)\n\t\tpretty_print(node.right_children, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right_children\n\t\tputs \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.value}\"\n\t\tpretty_print(node.left_children, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left_children\n\tend",
"title": ""
},
{
"docid": "37e566e65ad737c8e21875dd67830699",
"score": "0.7410831",
"text": "def pretty_print\n return 'INVALID TREE' unless valid?\n output = ''\n @root.traverse_dfs { |node, depth, _| output << \"#{' ' * depth}#{node}\\n\" }\n output\n end",
"title": ""
},
{
"docid": "e7649dd8414415accdb136c78f9c4b82",
"score": "0.74064344",
"text": "def pretty_print; end",
"title": ""
},
{
"docid": "30d6d968539ff00447c9bdbdebd4f2fb",
"score": "0.74004394",
"text": "def pretty_print(node = @tree[0], prefix = '', is_left = true)\n pretty_print(node.right, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.value}\"\n pretty_print(node.left, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left\n end",
"title": ""
},
{
"docid": "c1924a8201464a0d7ca3a97520ec85d3",
"score": "0.7377449",
"text": "def pretty_print(node = @root, prefix = '', is_left = true)\n pretty_print(node.right_child, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right_child\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.value}\"\n pretty_print(node.left_child, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left_child\n end",
"title": ""
},
{
"docid": "0342188eeb6dd7bbccf07fc2e13342a0",
"score": "0.7364599",
"text": "def pretty_print(node = @root, prefix = '', is_left = true)\n pretty_print(node.right_branch, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right_branch\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.data}\"\n pretty_print(node.left_branch, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left_branch\n end",
"title": ""
},
{
"docid": "9511a4f84cba981a2db22d96e01ef776",
"score": "0.73589647",
"text": "def pretty_print(node = @root, prefix = '', is_left = true)\n pretty_print(node.right, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}\\e[38;5;#{node.data}m#{node.data}\\e[0m\"\n pretty_print(node.left, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left\n end",
"title": ""
},
{
"docid": "d5f029f4ec3bdae620bcc0d0e8d113a9",
"score": "0.7325471",
"text": "def pretty_print(node = root, prefix=\"\", is_left = true)\n pretty_print(node.right, \"#{prefix}#{is_left ? \"│ \" : \" \"}\", false) if node.right\n puts \"#{prefix}#{is_left ? \"└── \" : \"┌── \"}#{node.value.to_s}\"\n pretty_print(node.left, \"#{prefix}#{is_left ? \" \" : \"│ \"}\", true) if node.left\n end",
"title": ""
},
{
"docid": "7c0f06ee0971318959c73a4569a51ec4",
"score": "0.72971755",
"text": "def pretty_print(node = @my_root, prefix = '', is_left = true)\n pretty_print(node.right, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.value}\"\n pretty_print(node.left, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left\n end",
"title": ""
},
{
"docid": "6cb1107b7903620902486c224d3aa08f",
"score": "0.72632146",
"text": "def pretty_print(node = root, prefix=\"\", is_left = true)\n pretty_print(node.right, \"#{prefix}#{is_left ? \"│ \" : \" \"}\", false) if node.right\n puts \"#{prefix}#{is_left ? \"└── \" : \"┌── \"}#{node.data.to_s}\"\n pretty_print(node.left, \"#{prefix}#{is_left ? \" \" : \"│ \"}\", true) if node.left\n end",
"title": ""
},
{
"docid": "cbc2c5b0104a296047cd88b6e28203f3",
"score": "0.7260426",
"text": "def pretty_print(node = root, prefix = '', is_left = true)\n pretty_print(node.right, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.value}\"\n pretty_print(node.left, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left\n end",
"title": ""
},
{
"docid": "d725388c6dccc17f7a829a1c1526e2af",
"score": "0.72543263",
"text": "def pretty_print(node = @root, prefix = '', is_left = true)\n pretty_print(node.right_child, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right_child\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.value}\"\n pretty_print(node.left_child, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left_child\n end",
"title": ""
},
{
"docid": "d725388c6dccc17f7a829a1c1526e2af",
"score": "0.72543263",
"text": "def pretty_print(node = @root, prefix = '', is_left = true)\n pretty_print(node.right_child, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right_child\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.value}\"\n pretty_print(node.left_child, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left_child\n end",
"title": ""
},
{
"docid": "d0065d0b5f5a4df626134d1d96f36726",
"score": "0.72395235",
"text": "def pretty_print(node = root, prefix=\"\", is_left = true)\n pretty_print(node.right, \"#{prefix}#{is_left ? \"│ \" : \" \"}\", false) if node.right\n puts \"#{prefix}#{is_left ? \"└── \" : \"┌── \"}#{node.data.to_s}\"\n pretty_print(node.left, \"#{prefix}#{is_left ? \" \" : \"│ \"}\", true) if node.left\nend",
"title": ""
},
{
"docid": "d0065d0b5f5a4df626134d1d96f36726",
"score": "0.72395235",
"text": "def pretty_print(node = root, prefix=\"\", is_left = true)\n pretty_print(node.right, \"#{prefix}#{is_left ? \"│ \" : \" \"}\", false) if node.right\n puts \"#{prefix}#{is_left ? \"└── \" : \"┌── \"}#{node.data.to_s}\"\n pretty_print(node.left, \"#{prefix}#{is_left ? \" \" : \"│ \"}\", true) if node.left\nend",
"title": ""
},
{
"docid": "4e217fd6a397270c287c5765ca1ce5ee",
"score": "0.7225297",
"text": "def pretty_print(node = root, prefix = '', is_left = true)\n pretty_print(node.right, \"#{prefix}#{is_left ? \"│ \" : \" \"}\", false) if node.right\n puts \"#{prefix}#{is_left ? \"└── \" : \"┌── \"}#{node.data}\"\n pretty_print(node.left, \"#{prefix}#{is_left ? \" \" : \"│ \"}\", true) if node.left\n end",
"title": ""
},
{
"docid": "3bc97c718c006a6e850db0fce27bc4f6",
"score": "0.7218808",
"text": "def pretty_print(node = @root, prefix = '', is_left = true)\n pretty_print(node.right, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.data}\"\n pretty_print(node.left, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left\n end",
"title": ""
},
{
"docid": "3bc97c718c006a6e850db0fce27bc4f6",
"score": "0.7218808",
"text": "def pretty_print(node = @root, prefix = '', is_left = true)\n pretty_print(node.right, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.data}\"\n pretty_print(node.left, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left\n end",
"title": ""
},
{
"docid": "3bc97c718c006a6e850db0fce27bc4f6",
"score": "0.7218808",
"text": "def pretty_print(node = @root, prefix = '', is_left = true)\n pretty_print(node.right, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.data}\"\n pretty_print(node.left, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left\n end",
"title": ""
},
{
"docid": "5bc1cb79fc2897b9b49f0abbc7e24290",
"score": "0.72117895",
"text": "def pretty_print(node = root, prefix = '', is_left = true)\n pretty_print(node.right, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.data}\"\n pretty_print(node.left, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left\n end",
"title": ""
},
{
"docid": "bb7ebb6bdfe99f8aaae8af3ebb59c4f1",
"score": "0.7200152",
"text": "def pretty_print(node = @root, prefix = '', is_left = true)\r\n pretty_print(node.right, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right\r\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.data}\"\r\n pretty_print(node.left, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left\r\n end",
"title": ""
},
{
"docid": "1477737ddb6eaccd5172e9ae59d36421",
"score": "0.7192632",
"text": "def format_node(source, node, maxwidth = T.unsafe(nil), base_indentation = T.unsafe(nil), options: T.unsafe(nil)); end",
"title": ""
},
{
"docid": "214637576fb2731b22f352cfa6c56842",
"score": "0.7189374",
"text": "def pretty_print(node = @root, prefix = '', is_left = true)\n pretty_print(node.right_child, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right_child\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.data}\"\n pretty_print(node.left_child, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left_child\n end",
"title": ""
},
{
"docid": "214637576fb2731b22f352cfa6c56842",
"score": "0.7189374",
"text": "def pretty_print(node = @root, prefix = '', is_left = true)\n pretty_print(node.right_child, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right_child\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.data}\"\n pretty_print(node.left_child, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left_child\n end",
"title": ""
},
{
"docid": "047695fbe1c09afa126c92d0123a20eb",
"score": "0.71810776",
"text": "def pretty_print(node = @root, prefix = '', is_left = true)\n pretty_print(node.right, \"#{prefix}#{is_left ? '│ ' : ' '}\", false) if node.right\n puts \"#{prefix}#{is_left ? '└── ' : '┌── '}#{node.value}\"\n pretty_print(node.left, \"#{prefix}#{is_left ? ' ' : '│ '}\", true) if node.left\n end",
"title": ""
},
{
"docid": "f86de31849c75383c8dfc131ccfd516e",
"score": "0.6901281",
"text": "def pretty_print(pp); end",
"title": ""
},
{
"docid": "f86de31849c75383c8dfc131ccfd516e",
"score": "0.6901281",
"text": "def pretty_print(pp); end",
"title": ""
},
{
"docid": "9e820d4df11432302c6599345b5e3250",
"score": "0.6821889",
"text": "def to_pretty\n to_s(:prettyprint => true)\n end",
"title": ""
},
{
"docid": "075362a6678df0d00460caa417a1b125",
"score": "0.6789635",
"text": "def format_node_with_aux\n proc do |node|\n [node, node.aux].compact.map(&:to_s).join('#')\n end\n end",
"title": ""
},
{
"docid": "fd60b09f056cf8a8c7bc69770b6c571e",
"score": "0.67197084",
"text": "def pretty\n raise \"#pretty unimplemented in #{self.class.name}\"\n end",
"title": ""
},
{
"docid": "68db78a2b48316564b9d2cfed8585334",
"score": "0.6689678",
"text": "def pretty\n @d = 0\n _pretty(self)\n end",
"title": ""
},
{
"docid": "5cc99098967954293c3aa440489039dd",
"score": "0.66807646",
"text": "def dump node = root, indent = ''\n STDERR.puts indent + node.letter + (node.value.nil? ? \"\" : \" \" + node.value.inspect) unless node == root\n node.children.each do |n|\n dump n, indent + '→ '\n end\n end",
"title": ""
},
{
"docid": "53dd60bb5e851488577b5225e6fbeae8",
"score": "0.66707826",
"text": "def prettify; end",
"title": ""
},
{
"docid": "d618144d50a048c71e2f6d31766f2a97",
"score": "0.6662965",
"text": "def to_pretty\n enable_prettyprint(true).to_s\n end",
"title": ""
},
{
"docid": "bf8420444cf8b1321fcc872e5045d218",
"score": "0.66315025",
"text": "def pretty_print pp\n\t\tpp.object_group self do\n\t\t\tpp.text ':'\n\t\t\tplain_old_ruby_object.pretty_print pp\n\t\tend\n\tend",
"title": ""
},
{
"docid": "3c12e7ff931963c82e828d6ebb7a483c",
"score": "0.6630278",
"text": "def display\n\t\tstr = \"\"\n\t\tself.each_node {|n| str << \"node: #{n.value} \\n\"}\n\t\tstr\n\tend",
"title": ""
},
{
"docid": "d9d841c4a51a373611714d7a8706cdd5",
"score": "0.66048706",
"text": "def pretty_print(document)\n doc = REXML::Document.new document.to_xml\n doc.context[:attribute_quote] = :quote\n out = \"\"\n formatter = REXML::Formatters::Pretty.new\n formatter.compact = true\n formatter.write(doc, out)\n\n out.strip\n end",
"title": ""
},
{
"docid": "d9d841c4a51a373611714d7a8706cdd5",
"score": "0.66048706",
"text": "def pretty_print(document)\n doc = REXML::Document.new document.to_xml\n doc.context[:attribute_quote] = :quote\n out = \"\"\n formatter = REXML::Formatters::Pretty.new\n formatter.compact = true\n formatter.write(doc, out)\n\n out.strip\n end",
"title": ""
},
{
"docid": "cc55626752d434a0a795741ae1122668",
"score": "0.6589217",
"text": "def pretty_print\n result = \"\"\n self.class.attributes.each { |m| result << \"#{m}: #{send(m)}\\n\"}\n result\n end",
"title": ""
},
{
"docid": "52d2dcb680e8b735f985292a5592211f",
"score": "0.65513104",
"text": "def pretty(&block)\n compile( :format => :pretty, &block )\n end",
"title": ""
},
{
"docid": "b6bd40baf2ee3fa7c2a18e186a3be46a",
"score": "0.6541756",
"text": "def pretty_print_tree\n puts \"Pretty Print Values In The YAML Tree - Using Psych\"\n @secret_tree.each do |node|\n puts node\n end\n end",
"title": ""
},
{
"docid": "add2fb79f612a0e1886451af9fa89619",
"score": "0.65083504",
"text": "def print_node( node, show_description, show_value )\n desc = node.desc.to_s.dup\n show_description = false if desc.empty?\n\n if show_description\n if colorize?\n desc = desc.gsub(%r/([^\\n]+)/,\n self.__send__(@colors[:description], '\\1'))\n end\n @io.puts(desc.indent(@desc_leader))\n end\n\n @io.puts(format_name(node, show_value))\n @io.puts if show_description\n end",
"title": ""
},
{
"docid": "eca4f6e6e113455c294de8b7d874e608",
"score": "0.6461817",
"text": "def print ()\r\n puts @node_data.to_s\r\n end",
"title": ""
},
{
"docid": "d19e1bf39c4cca6a1af02ccc759c0cb4",
"score": "0.6442492",
"text": "def dump(node = root, indent = '')\n STDERR.puts indent + node.letter + (node.value.nil? ? '' : ' ' + node.value.inspect) unless node == root\n node.children.each do |n|\n dump n, indent + '→ '\n end\n end",
"title": ""
},
{
"docid": "d5433b4ac9f00268f16e9d2afea2d51b",
"score": "0.64400417",
"text": "def print()\r\n puts @node_data.to_s\r\n end",
"title": ""
},
{
"docid": "da88e5e7d7cc0adf970ce94a711831a7",
"score": "0.64203954",
"text": "def indent_xml(node = @xdoc)\r\n bar = REXML::Formatters::Pretty.new\r\n out = String.new\r\n bar.write(node, out)\r\n return out\r\n end",
"title": ""
},
{
"docid": "a851f6e6427b6500667422f40302f1ec",
"score": "0.6415907",
"text": "def pretty(level=0)\r\n\t\t\tindent = ( \" \" * level )\r\n\t\t\tindent2 = ( \" \" * ( level + 1 ) )\r\n\t\t\tresult = \"\\n\" + indent + \"<\" + self.class.name + \":\" + self.object_id.to_s\r\n\t\t\tresult += \"\\n\" + indent2 + \"@type:\" + @type\r\n\t\t\tresult += \"\\n\" + indent2 + \"@direction:\" + @direction\r\n\t\t\tresult += \"-\" + @counter.to_s if @counter > 0\r\n\t\t\tresult += \"\\n\" + indent2 + \"@destination:\" + @destination\r\n\t\t\tresult += \"\\n\" + indent2 + \"@file:\" + @file unless @file.empty?\r\n\t\t\tresult += \"\\n\" + indent2 + \"@effect:\" + @effect unless @effect.empty?\r\n\t\t\tresult += \"\\n\" + indent2 + \"@text:\" + @text unless @text.empty?\r\n\t\t\tresult += \"\\n\" + indent2 + \"@door_id:\" + @door_id.to_s if @door_id\r\n\t\t\tresult += \"\\n\" + indent + \">\"\r\n\t\t\treturn result\r\n\t\tend",
"title": ""
},
{
"docid": "b789f1d682277ce66f6ba5d0eabc6777",
"score": "0.64133936",
"text": "def pretty\n\t\tstr\n\tend",
"title": ""
},
{
"docid": "c251c52139d038cee5ffdb90811f9eb2",
"score": "0.640579",
"text": "def pretty_print_nds(nds)\n pp nds\n # Change the code below to pretty print the nds with pp\n \nend",
"title": ""
},
{
"docid": "090d17a47039a2b183096c51eff13a4e",
"score": "0.640489",
"text": "def to_s() @node.to_s ; end",
"title": ""
},
{
"docid": "8cdb72dd6bdd4950cb4835227573c993",
"score": "0.640319",
"text": "def pretty_print\n pad = node.last_line.to_s.length\n pretty_print_lines.map do |covered, (num, line)|\n formatted_line = \"#{num.to_s.rjust(pad)}: #{line}\"\n if line.strip.length.zero?\n Rainbow(formatted_line).darkgray.dark\n elsif covered.nil?\n Rainbow(formatted_line).darkgray.dark + \\\n Rainbow(' hits: n/a').italic.darkgray.dark\n elsif covered.positive?\n Rainbow(formatted_line).green + \\\n Rainbow(\" hits: #{covered}\").italic.darkgray.dark + \\\n count_covered_branches(num)\n elsif covered.zero?\n Rainbow(formatted_line).red + \\\n Rainbow(\" hits: #{covered}\").italic.darkgray.dark + \\\n count_covered_branches(num)\n end\n end.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "e5beeaed4ebeac25a4794e871f21120a",
"score": "0.6394255",
"text": "def pretty_print_nds(nds)\n# Change the code below to pretty print the nds with pp\npp\nend",
"title": ""
},
{
"docid": "59099e52d62066b0eab4d3c8029634d9",
"score": "0.6381722",
"text": "def pretty_print_nds (nds)\nprint pp nds\n\nend",
"title": ""
},
{
"docid": "1f174f6c524a9457325e517d2b6940f7",
"score": "0.63568693",
"text": "def pretty_print(pp)\n pp.text _pretty_inspect\n end",
"title": ""
},
{
"docid": "2ac36e19bec67927c2486af2c4781d6f",
"score": "0.633986",
"text": "def pretty_print_nds(nds)\n pp nds\n\n # Change the code below to pretty print the nds with pp\n\nend",
"title": ""
},
{
"docid": "a13ed4e9d7cc47b543bf38116d088df8",
"score": "0.6335517",
"text": "def printnode\n print @data, \" \"\n end",
"title": ""
},
{
"docid": "94d9f11b03ea9aca5286b1477aad6fda",
"score": "0.6313941",
"text": "def pretty_print_tree\n puts \"#{@file_name} - Pretty Print The YAML Dump\"\n pp @secret_ruby\n end",
"title": ""
},
{
"docid": "b5640b35359f453d4f800cf9c186550a",
"score": "0.63139105",
"text": "def pretty_print pp\n\t\tpp.object_group self do end # nothing\n\tend",
"title": ""
},
{
"docid": "92d899554b7bfa9bb71a35eba0683564",
"score": "0.6308315",
"text": "def pretty_print(q)\n map = pretty_print_attribute_hash.delete_if { |k, v| v.nil_or_empty? }\n # one indented line per entry, all but the last line ending in a comma\n content = map.map { |label, value| \" #{label}=>#{format_print_value(value)}\" }.join(\",\\n\")\n # print the content to the log\n q.text(\"#{qp} structure:\\n#{content}\")\n end",
"title": ""
},
{
"docid": "80cdad1905f3f8334ab4ef478c69ca27",
"score": "0.63062716",
"text": "def print_pretty\n to_hash.ai(indent: -2)\n end",
"title": ""
},
{
"docid": "dc70dd2154b05937d348562a1dcb1309",
"score": "0.63060623",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n pp nds \n nil\nend",
"title": ""
},
{
"docid": "dc70dd2154b05937d348562a1dcb1309",
"score": "0.63060623",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n pp nds \n nil\nend",
"title": ""
},
{
"docid": "e1b78621830496e5256c6bf99b5e9ae3",
"score": "0.6286519",
"text": "def pretty_print(io = STDOUT, level = 0, indent = ' ')\n space = indent * level\n io.puts(space + to_s)\n io.puts(space + '{')\n each { |child| child.pretty_print(io, level + 1, indent) }\n io.puts(space + '}')\n end",
"title": ""
},
{
"docid": "83b67957082f985b766d6bbf7b2ea362",
"score": "0.62810254",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n\n pp nds\n\nend",
"title": ""
},
{
"docid": "58afe1b08b79d2fbe04501676c0e2d7b",
"score": "0.62748915",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n pp nds\n\nend",
"title": ""
},
{
"docid": "58afe1b08b79d2fbe04501676c0e2d7b",
"score": "0.62748915",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n pp nds\n\nend",
"title": ""
},
{
"docid": "934b440662999965623d978b80221449",
"score": "0.62682587",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n pp nds \nend",
"title": ""
},
{
"docid": "934b440662999965623d978b80221449",
"score": "0.62682587",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n pp nds \nend",
"title": ""
},
{
"docid": "934b440662999965623d978b80221449",
"score": "0.62682587",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n pp nds \nend",
"title": ""
},
{
"docid": "2b9f4f25c10cf5653b10e8de333fef79",
"score": "0.62654656",
"text": "def pretty_print_nds(nds)\r\n # Change the code below to pretty print the nds with pp\r\n pp nds\r\nend",
"title": ""
},
{
"docid": "2b9f4f25c10cf5653b10e8de333fef79",
"score": "0.62654656",
"text": "def pretty_print_nds(nds)\r\n # Change the code below to pretty print the nds with pp\r\n pp nds\r\nend",
"title": ""
},
{
"docid": "3d06ad74815fdc83fd8a8371f6a2427f",
"score": "0.6263816",
"text": "def pretty_print_nds(nds)\n pp nds# Change the code below to pretty print the nds with pp\nend",
"title": ""
},
{
"docid": "560cd30b4cf18f8f91ba45d71a3a94ba",
"score": "0.62619805",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n \n require 'pp'\n pp nds\n \nend",
"title": ""
},
{
"docid": "1e405dca3fafd672bc50d2371fb9406f",
"score": "0.6257711",
"text": "def format_sorted tree\n \treturn if tree.nil?\n \tformat_sorted tree.left\n puts tree.value\n \tformat_sorted tree.right\n end",
"title": ""
},
{
"docid": "c438e62d45761cac48df75dded13f9ce",
"score": "0.62510693",
"text": "def pretty_print_nds(nds)\n pp nds\n # Change the code below to pretty print the nds with pp\n nil\nend",
"title": ""
},
{
"docid": "c438e62d45761cac48df75dded13f9ce",
"score": "0.62510693",
"text": "def pretty_print_nds(nds)\n pp nds\n # Change the code below to pretty print the nds with pp\n nil\nend",
"title": ""
},
{
"docid": "028af0e9010772554daa964d5edaa856",
"score": "0.62441987",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n \n pp nds\n \nend",
"title": ""
},
{
"docid": "699d1e988c5563e506a5371ac60019fc",
"score": "0.6237576",
"text": "def pretty_print_nds(nds)\n pp nds\n # Change the code below to pretty print the nds with pp\nend",
"title": ""
},
{
"docid": "3f59f9d89650c0e8542ca86d71b02461",
"score": "0.6232077",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n require 'pp'\n pp nds \nend",
"title": ""
},
{
"docid": "e438b66a44ae2f1994283e8af13ae369",
"score": "0.62297636",
"text": "def print_node\n puts \"-----------------------------------------------------\\n\"\n puts \"Node:#{@id} Host:#{@hostname} Port:#{@port} Typ:#{@node_type} \"\n puts \"-----------------------------------------------------\\n\" \n end",
"title": ""
},
{
"docid": "fe4c65b26dd3a8981b0dd4821f396264",
"score": "0.62288415",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n pp nds\n nil\nend",
"title": ""
},
{
"docid": "fe4c65b26dd3a8981b0dd4821f396264",
"score": "0.62288415",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n pp nds\n nil\nend",
"title": ""
},
{
"docid": "fe4c65b26dd3a8981b0dd4821f396264",
"score": "0.62288415",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n pp nds\n nil\nend",
"title": ""
},
{
"docid": "fe4c65b26dd3a8981b0dd4821f396264",
"score": "0.62288415",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n pp nds\n nil\nend",
"title": ""
},
{
"docid": "fe4c65b26dd3a8981b0dd4821f396264",
"score": "0.62288415",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n pp nds\n nil\nend",
"title": ""
},
{
"docid": "fe4c65b26dd3a8981b0dd4821f396264",
"score": "0.62288415",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n pp nds\n nil\nend",
"title": ""
},
{
"docid": "fe4c65b26dd3a8981b0dd4821f396264",
"score": "0.62288415",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n pp nds\n nil\nend",
"title": ""
},
{
"docid": "08446b182a5cf6f8b13a4c74f0b84d49",
"score": "0.6226364",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n pp\nend",
"title": ""
},
{
"docid": "08446b182a5cf6f8b13a4c74f0b84d49",
"score": "0.6226364",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n pp\nend",
"title": ""
},
{
"docid": "b0a1ef91ddbd2e5a8a2d0c4e66eb08f9",
"score": "0.62250334",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n # nil\n \n pp nds\n \nend",
"title": ""
},
{
"docid": "728d3293d0df4c0d68f61bb5f1881f75",
"score": "0.6219111",
"text": "def displayNode (node)\r\n\t puts \"\\n\"\r\n \r\n\t\tprint \"\\t#{node[0]}\"; print \"\\t\\t#{node[1]}\"; print \"\\t\\t\\t#{node[2]}\\n\"\r\n\t\tprint \"\\t#{node[3]}\"; print \"\\t\\t#{node[4]}\"; print \"\\t\\t\\t#{node[5]}\\n\"\r\n\t\tprint \"\\t#{node[6]}\"; print \"\\t\\t#{node[7]}\"; print \"\\t\\t\\t#{node[8]}\\n\"\r\n\t puts \"\\n\"\r\n end",
"title": ""
},
{
"docid": "4b8444638490fce8e3d8bed8d3b091fc",
"score": "0.62176985",
"text": "def pretty_print_instance_variables\n super + [\"@nodes\"]\n end",
"title": ""
},
{
"docid": "36b324bf10e813e7b86e43cc351617c7",
"score": "0.6212488",
"text": "def to_s\n @node.to_s\n end",
"title": ""
},
{
"docid": "c5293df3ebe36e5458a4560cf820da39",
"score": "0.62124264",
"text": "def pretty_print_nds(nds)\npp nds\nend",
"title": ""
},
{
"docid": "0430ca6b13fc13267b9a350b6b4bfaf4",
"score": "0.62097746",
"text": "def pretty_print_nds(nds)\npp nds\n# Change the code below to pretty print the nds with pp\n nil\nend",
"title": ""
},
{
"docid": "6ff11b1e148ae1fbc77a77fcd147a389",
"score": "0.6209374",
"text": "def inspect\n \"#<#{ self.class.name } node=#{ node.key } \" \\\n \"carrier=#{ carrier } direction=#{ direction }>\"\n end",
"title": ""
},
{
"docid": "039c20f1fa8a0d0f10d0f517892fb0a8",
"score": "0.62061083",
"text": "def pretty_print_nds(nds)\n pp nds\nend",
"title": ""
},
{
"docid": "f3353f8081886dc174105dfb50344b09",
"score": "0.62024975",
"text": "def format_custom_property_value(node); end",
"title": ""
},
{
"docid": "8ff88df9e1656a82798899ae61f19895",
"score": "0.61974996",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n require 'pp'\n pp nds\n nil\nend",
"title": ""
},
{
"docid": "8ff88df9e1656a82798899ae61f19895",
"score": "0.61974996",
"text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n require 'pp'\n pp nds\n nil\nend",
"title": ""
}
] |
476dff1e2011ba498e1a504f802a644f
|
Builds a docker image from a Dockerfile
|
[
{
"docid": "04982790b2fcdf33d8b561ccd9ef51f3",
"score": "0.73407304",
"text": "def build_docker_image(image_id, build_context: '.',\n dockerfile: 'Dockerfile', build_args: {},\n timeout: 600, **options)\n\n build_args_json = generate_build_args_json(build_args)\n\n args = populate_args_hash(image_id, build_args_json, dockerfile)\n options.each { |key, value| args[key] = value }\n\n puts \"Build args: #{args.inspect}\" if ENV['DEBUG']\n build_image(build_context, args, timeout)\n end",
"title": ""
}
] |
[
{
"docid": "ca518a0ee3b34adebe72f1aa918b5061",
"score": "0.79904574",
"text": "def build(dir, docker_file)\n docker_file.write!\n\n @underlying_image = build_from_dir(dir, docker_file.relative_output_file)\n\n add_tag!(@tag)\n image\n end",
"title": ""
},
{
"docid": "3e4ece95ca2dd461defd0acb236f7051",
"score": "0.78651536",
"text": "def build_image\n run_command(docker_build_command)\n end",
"title": ""
},
{
"docid": "fc516a1eeb0a4def59e7378816a44b87",
"score": "0.77660424",
"text": "def docker_build\n debug(\"Docker build #{docker_image}\")\n system \"docker build -t #{docker_image} #{Git.toplevel}\"\n end",
"title": ""
},
{
"docid": "acbe4a730bb4d79b0f9aa1745fbb89b2",
"score": "0.7704685",
"text": "def dockerfile\n fetch(:dockerfile, 'Dockerfile')\n end",
"title": ""
},
{
"docid": "c0695daea382fdcd8d19a95a1b018688",
"score": "0.7651717",
"text": "def docker_build(image_name, silent: false)\n dockerfile_path = $cfg[:paths][:docker].join(\"Dockerfile\")\n cmd = \"docker build\"\n cmd << \" -q\" if silent\n cmd << \" -f #{dockerfile_path}\"\n cmd << \" -t #{image_name}\"\n cmd << \" .\"\n fill_cmd_with_docker_args(cmd)\n sh(cmd, verbose: true)\nend",
"title": ""
},
{
"docid": "be78e891cd18f04a1e42a38e4326364f",
"score": "0.7634925",
"text": "def image_from_dockerfile()\n @logger.debug(\"creating dockerfile from template...\")\n temp_dockerfile = \"Dockerfile.out\"\n\n dockerfile_erb = File.read(\"Dockerfile.erb\")\n dockerfile = ERB.new(dockerfile_erb, nil, '-').result(binding)\n\n # must write out the dockerfile to a tempfile to obtain build context\n # then we need to manually clean up\n File.write(temp_dockerfile, dockerfile)\n\n @logger.debug(\"building image from dockerfile...\")\n base_image = Docker::Image.build_from_dir(\".\", { \n 'dockerfile' => temp_dockerfile,\n :rm => true \n }) { |chunk|\n @logger.debug(chunk)\n }\n @logger.debug(\"...done!\")\n File.delete(temp_dockerfile)\n\n # return\n base_image \nend",
"title": ""
},
{
"docid": "27408cd82457283147d5ab1919fe186e",
"score": "0.76299965",
"text": "def build_docker_image\n image = build_image(docker_context)\n\n # Apply the name and tags\n # By default, it will apply the latest tag but this behavior can be\n # overwritten by excluding the latest tag from the specified list.\n config[:tags].each do |tag|\n tag_image(image.id, @name_args[0], tag)\n end\n end",
"title": ""
},
{
"docid": "1e85f373b003cd4a0c3fd82434223c32",
"score": "0.7434851",
"text": "def build_docker_image project_id\n image_name = \"google-cloud-ruby-test-%.08x\" % rand(0x100000000)\n image_location = \"us.gcr.io/#{project_id}/#{image_name}\"\n begin\n # Create default Dockerfile if one doesn't already exist\n if File.file? \"Dockerfile\"\n fail \"The Dockerfile file already exists. Please omit it and \" \\\n \"try again.\"\n else\n FileUtils.cp \"integration/Dockerfile.example\", \"Dockerfile\"\n temp_dockerfile = true\n end\n\n sh \"docker build -t #{image_location} .\"\n yield image_name, image_location\n ensure\n sh \"docker rmi #{image_location}\"\n FileUtils.rm \"Dockerfile\" if temp_dockerfile\n end\nend",
"title": ""
},
{
"docid": "27348d6a959865b9a49f698c5e66caca",
"score": "0.7426764",
"text": "def create_container_image\n build_image = @generator_config.build_settings.docker_settings.image\n build_image = @config.build_image_for(@task_name) unless @config.build_image_for(@task_name) == nil\n\n build_file = @config.build_docker_file_for(@task_name)\n\n if build_file != nil\n build_image = \"#{@config.application_name}-buildimage\"\n \n @logger.debug \"Building image: #{build_image} from file #{build_file}\"\n @docker_runner.build_image build_file, build_image\n else\n @logger.debug \"Pulling image: #{build_image}\"\n @docker_runner.pull_image build_image unless @docker_runner.find_image build_image\n end\n\n build_image\n end",
"title": ""
},
{
"docid": "afa65185050d9dbaadcc4ce3baacb5c6",
"score": "0.7374942",
"text": "def make_image name\n puts \"Creating docker image #{name}\"\n image = Docker::Image.build_from_dir(name)\n image.tag('repo' => name, 'tag' => 'latest')\n image\nend",
"title": ""
},
{
"docid": "0e348633e5d87aa7cd7c01c5ec1c1ce2",
"score": "0.7292459",
"text": "def build_docker_image app_dir, project_id\n image_name = \"google-cloud-ruby-test-%.08x\" % rand(0x100000000)\n image_location = \"us.gcr.io/#{project_id}/#{image_name}\"\n begin\n # Create default Dockerfile if one doesn't already exist\n if File.file? \"Dockerfile\"\n fail \"The Dockerfile file already exists. Please omit it and try again.\"\n else\n # Copy example Dockerfile and update with correct content\n File.open \"#{app_dir}/Dockerfile.example\" do |source_file|\n File.open \"Dockerfile\", \"w\" do |dest_file|\n base_image_tag = ENV[\"GAE_RUBY_BASE_IMAGE_TAG\"] || \"latest\"\n file_content = source_file.read % {\n base_image_tag: base_image_tag\n }\n dest_file.write file_content\n end\n end\n temp_dockerfile = true\n end\n\n sh \"docker build -t #{image_location} .\"\n yield image_name, image_location\n ensure\n FileUtils.rm \"Dockerfile\" if temp_dockerfile\n puts \"docker rmi #{image_location}\"\n Open3.capture3 \"docker rmi #{image_location}\"\n end\nend",
"title": ""
},
{
"docid": "a65a6d069a94ea7073da75749ac7b402",
"score": "0.719352",
"text": "def build\n generate\n run \"docker build .\"\n end",
"title": ""
},
{
"docid": "0b3e8b4738cd1b4ffb3e3fd34efe792a",
"score": "0.7166515",
"text": "def process_build\n Docker.new.build_container_image\n end",
"title": ""
},
{
"docid": "7362ca2e5c7115851a9f971979ca4fcc",
"score": "0.71165496",
"text": "def build_from_dir(dir, dockerfile_path)\n Docker::Image.build_from_dir(dir, dockerfile: dockerfile_path) { |c| DockerOutputParser.parse_chunk(c) }\n end",
"title": ""
},
{
"docid": "9852d745c293b2282e4ab7f93e9c9704",
"score": "0.70954406",
"text": "def build_docker_image(args=\"\", image_root=\"generic\")\n number = \"%.08x\" % rand(0x100000000)\n image = \"ruby-test-image-#{image_root}-#{number}\"\n begin\n assert_cmd_succeeds(\"docker build -t #{image} #{args} .\")\n yield image\n ensure\n execute_cmd(\"docker rmi #{image}\")\n end\n end",
"title": ""
},
{
"docid": "c9383edfd8b0643359529a562b7096f6",
"score": "0.7069485",
"text": "def create_dockerfile\n\n end",
"title": ""
},
{
"docid": "b60b445c6137b2ec677643689400cab1",
"score": "0.69388694",
"text": "def docker_build_command\n \"docker build -t #{@name_args[0]} #{docker_context}\"\n end",
"title": ""
},
{
"docid": "646667a7ed102210edbadf1acb1062eb",
"score": "0.6889924",
"text": "def build_and_start_docker_container \n #docker_image_tag = container_name\n Log.info \"Building docker image #{docker_image_tag}\"\n Image.build(@dockerfile, docker_image_tag)\n\n Log.info \"Starting docker container #{container_name} on port #{grpc_port}\"\n status, error_msg = start_daemon_docker?\n if status == :failed\n [nil, error_msg]\n else\n $queue << {@task_id => container_name, 'type' => 'docker'}\n container_name\n end\n end",
"title": ""
},
{
"docid": "3e39f69fd1d0fdb9a94e038cf4bc9d5b",
"score": "0.6876963",
"text": "def build_docker_image(chainnet)\n safe_system(\"docker build -f #{cwd}/../genesis/Dockerfile -t sifchain/sifnoded:#{chainnet} #{cwd}/../../\")\nend",
"title": ""
},
{
"docid": "118af775821a484a01b6e3f7bfb59540",
"score": "0.6796328",
"text": "def build_from_path(path)\n if !File.directory?(path) && File.basename(path) == 'Dockerfile'\n path = File.dirname(path)\n end\n File.directory?(path) ? build_from_dir(path) : build_from_file(path)\n end",
"title": ""
},
{
"docid": "aa28e6cdf3a07d15db5ae16957029c38",
"score": "0.67585194",
"text": "def build\n build_command = \"cd #{@docker_local_build_path} && docker-compose build #{@docker_local_build_container_name}\"\n system build_command\n end",
"title": ""
},
{
"docid": "135373e45ab9f92c576fb55c5633f5df",
"score": "0.6724777",
"text": "def dockerfile(filename=\"Dockerfile\")\n if File.exists?(filename)\n filename\n else\n [DOCKER_PATH, filename].join File::SEPARATOR\n end\nend",
"title": ""
},
{
"docid": "70c8662ea6020ef6e074713fb920f0a6",
"score": "0.6637179",
"text": "def image\n logger = DockerLogger.new\n @image ||= Docker::Image.build_from_dir(dockerfile_dir) do |chunk|\n logger.print_chunk(chunk)\n end\n end",
"title": ""
},
{
"docid": "217118ffe6aaff9d580ae29a758cfdfc",
"score": "0.6562615",
"text": "def build(yaml_file)\n language_version = project.language + '_version'\n\n version yaml_file[language_version]\n image yaml_file['image']\n build_steps yaml_file['build']\n test_steps yaml_file['test']\n setup_steps yaml_file['setup']\n\n create_docker_file\n run\n end",
"title": ""
},
{
"docid": "003bc4559bd8c2f71725a54b8f401eb2",
"score": "0.652529",
"text": "def dockerfile_data\n data = [\"FROM #{package}\"]\n data << 'COPY _switch /'\n data << 'COPY wheel /etc/sudoers.d/'\n data << \"RUN /_switch #{userargs} 2>&1\"\n data << 'ENV LC_ALL en_US.UTF-8'\n data << \"USER #{username}\"\n data << \"ENTRYPOINT [\\\"#{shell}\\\", \\\"-c\\\"]\"\n data.join(\"\\n\")\n end",
"title": ""
},
{
"docid": "d3441044b0e689d46ac53a682dc675b6",
"score": "0.6525127",
"text": "def build\n @logger.info \"Build for #{@git_commit_id} ...\"\n\n @workspace = init_repo(@repository[:url],\n @repository[:path],\n @logger,\n :workspace_dir => @git_commit_id)\n\n @logger.info @workspace.checkout(@git_commit_id)\n\n @logger.info 'Start building docker image...'\n image = Docker.build(\"#{@repository[:container_prefix]}/#{@git_commit_id}\",\n \"#{@workspace.dir.path}\"\n )\n image_id = image.json[\"Id\"]\n write_ids(image_id)\n image_id\n end",
"title": ""
},
{
"docid": "7e7839d3bc9cce0e73555995aac660da",
"score": "0.6464265",
"text": "def build\n self.increment!(:version)\n\n image_name = \"#{user.username.downcase}/#{name}\"\n git_ref = 'master'\n\n buildstep = Docker::Container.create({\n 'Image' => 'dawn/buildstep',\n 'Cmd' => ['/bin/bash', '-c', 'mkdir -p /app && tar -xC /app && /build/builder'],\n 'Env' => env.map { |k,v| \"#{k}=#{v}\" },\n 'OpenStdin' => true,\n 'StdinOnce' => true\n }, Docker::Connection.new('unix:///var/run/docker.sock', {:chunk_size => 1})) # tempfix for streaming\n\n Tempfile.open(name) do |tarball| # use a tempfile to not store in memory\n pid = spawn(\"git archive #{git_ref}\", :out => tarball, chdir: repo_path)\n Process.wait(pid)\n\n buildstep.tap(&:start).attach(stdin: tarball) do |stream, chunk|\n puts \"\\e[1G#{chunk}\" if chunk != \"\\n\" # \\e[1G gets rid of that pesky 'remote:' text, skip empty lines\n end\n\n if buildstep.wait['StatusCode'] == 0\n buildstep.commit(repo: image_name)\n else\n raise \"Buildstep returned a non-zero exit code.\"\n end\n end\n\n # .. tag the current image commit with version (user/image:v3, etc., the ':v3' part)\n # `docker tag #{self.image} `\n\n # clean up\n begin\n buildstep.kill.delete force: true\n rescue Docker::Error::NotFoundError\n end\n\n # set the release version to the counter\n releases.create!(image: image_name, version: version)\n end",
"title": ""
},
{
"docid": "c295a5371fb87b36b26d13ed54c4a6db",
"score": "0.64396775",
"text": "def build(*args, &block)\n task(*args) do\n sh Docker::Build.new(options: build_options, path: @path, &block).to_s\n end\n end",
"title": ""
},
{
"docid": "68f025ddb1aa37b55e10335b7b654aa2",
"score": "0.6391243",
"text": "def generate_file\n\t\t\tputs \"==> Generating Dockerfile for this project\"\n\t\t\tbegin\n\t\t\t\t##BUILD DOCKERFILE\n\t\t\t\tcase @template[\"base_image\"]\n\t\t\t\twhen \"ubuntu\"\n\t\t\t\t\tcase @template[\"runtime\"]\n\t\t\t\t\twhen \"ruby\"\n\t\t\t\t\t\treturn <<-DOCKERFILE\n\t\t\t\t\t\tFROM #{@template[\"docker_params\"][\"registry\"]}/#{@template[\"base_image\"]}/#{@template[\"runtime\"]} \\n\n\t\t\t\t\t\tRUN mkdir /app \\n\n\t\t\t\t\t\tADD . /app \\n\n\t\t\t\t\t\tWORKDIR /app \\n\n\t\t\t\t\t\tRUN bundle install \\n\n\t\t\t\t\t\tCMD [\\\"rake\\\", \\\"run\\\"] \n\t\t\t\t\t\tDOCKERFILE\n\t\t\t\t\twhen \"node\"\n\t\t\t\t\t\treturn <<-DOCKERFILE\n\t\t\t\t\t\tFROM #{@template[\"docker_params\"][\"registry\"]}/#{@template[\"base_image\"]}/#{@template[\"runtime\"]} \\n\n\t\t\t\t\t\tRUN mkdir /app \\n\n\t\t\t\t\t\tADD . /app/ \\n\n\t\t\t\t\t\tWORKDIR /app \\n\n\t\t\t\t\t\tRUN npm install \\n\n\t\t\t\t\t\tEXPOSE #{@template[\"port\"]} \\n \"\n\t\t\t\t\t\tCMD [\\\"node\\\", \\\"#{@template[\"exec_file\"]}\\\"]\n\t\t\t\t\t\tDOCKERFILE\n\t\t\t\t\tend\n\t\t\t\twhen \"centos\"\n\t\t\t\t\tcase @template[\"runtime\"]\n\t\t\t\t\twhen \"ruby\"\n\t\t\t\t\t\treturn <<-DOCKERFILE\n\t\t\t\t\t\tFROM #{@template[\"docker_params\"][\"registry\"]}/#{@template[\"base_image\"]}/#{@template[\"runtime\"]} \\n\n\t\t\t\t\t\tRUN mkdir /app \\n\n\t\t\t\t\t\tADD . /app \\n\n\t\t\t\t\t\tWORKDIR /app \\n\n\t\t\t\t\t\tRUN bundle install \\n\n\t\t\t\t\t\tCMD [\\\"rake\\\", \\\"run\\\"]\n\t\t\t\t\t\tDOCKERFILE\n\t\t\t\t\twhen \"node\"\n\t\t\t\t\t\treturn <<-DOCKERFILE\n\t\t\t\t\t\tFROM #{@template[\"docker_params\"][\"registry\"]}/#{@template[\"base_image\"]}/#{@template[\"runtime\"]} \\n\n\t\t\t\t\t\tRUN mkdir /app \\n\n\t\t\t\t\t\tADD . /app \\n\n\t\t\t\t\t\tWORKDIR /app \\n\n\t\t\t\t\t\tRUN npm install \\n\n\t\t\t\t\t\tEXPOSE #{@template[\"port\"]} \\n \n\t\t\t\t\t\tCMD [\\\"node\\\", \\\"#{@template[\"exec_file\"]}\\\"]\n\t\t\t\t\t\tDOCKERFILE\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\trescue Exception => e \n\t\t\t\tputs e\n\t\t\t\tputs e.backtrace\n\t\t\t\treturn nil\n\t\t\tend\n\t\tend",
"title": ""
},
{
"docid": "e9d8a58bda5118e2132db90a7e8e3dd3",
"score": "0.6369074",
"text": "def build_image\n unless @build_config.skip?(:build_image)\n @env.build_image\n end\n end",
"title": ""
},
{
"docid": "70b68c8fabe519580418a1956ba7f66d",
"score": "0.6291156",
"text": "def pull(img)\n Docker::Image.create(\"fromImage\" => img)\nend",
"title": ""
},
{
"docid": "8c95716402a98aa0f641a0c38b1352eb",
"score": "0.6268246",
"text": "def build_lite_data_image\n @process_runner.execute!(\"cd #{@working_directory} && docker run --rm -v #{@working_directory}/work:/work redhatdeveloper/drupal-data:latest /bin/sh -c \\\"cp -R /var/www/drupal/web/config/active /work/config && chmod -R 777 /work/config\\\"\")\n @process_runner.execute!(\"cd #{@working_directory} && docker run --rm -v #{@working_directory}/work:/work redhatdeveloper/drupal-data:latest /bin/sh -c \\\"cp -R /var/www/drupal/web/sites/default/files /work/files && chmod -R 777 /work/files\\\"\")\n\n @process_runner.execute!(\"cd #{@working_directory} && docker build -t redhatdeveloper/drupal-data-lite:latest -f Dockerfile.lite .\")\n end",
"title": ""
},
{
"docid": "91f61aad3cbaf97800c1bb4183529c7c",
"score": "0.62358296",
"text": "def pull_build_images\n image_name = @config.image_name\n image_repotag = \"#{image_name}:#{settings.distribution}\"\n\n puts \"Pulling build image: #{image_repotag}\"\n Docker::Image.create 'fromImage' => image_repotag\n\n puts 'Pulling busybox image'\n pull_busybox_image\n end",
"title": ""
},
{
"docid": "c5c40253f46e2b89def6c1a156f5103d",
"score": "0.6223668",
"text": "def dockerfile\n $dockerfile ||= STDIN.read\nend",
"title": ""
},
{
"docid": "447831844761118acae7eb561bdbd366",
"score": "0.620847",
"text": "def add_docker_to_mk_image(docker_image)\n FileUtils.cp(docker_image, image_path, { :preserve => true })\n File.basename(docker_image)\n end",
"title": ""
},
{
"docid": "cc6bf2a59d848b1e4f5165da719eb12e",
"score": "0.61688703",
"text": "def generate\n unless File.exists?('Dockerfile.erb')\n say 'Template file Dockerfile.erb not found', :red\n exit 1\n end\n template('Dockerfile.erb', 'Dockerfile', force: true)\n end",
"title": ""
},
{
"docid": "e550495a334d66048ae3be72340be635",
"score": "0.6163318",
"text": "def build(*args, &block)\n name, _, deps = Rake.application.resolve_args(args)\n task name => deps do\n sh Docker::Build.new(&block).to_s\n end\n end",
"title": ""
},
{
"docid": "d459e86490716dd7969969ecac5381f6",
"score": "0.6144053",
"text": "def build(no_cache: false, version: nil, build_args: [], latest: true, stream_output: true)\n image_name = File.basename(directory)\n build_args_hash = {\n 'vcs_ref' => PuppetDockerTools::Utilities.current_git_sha(directory),\n 'build_date' => Time.now.utc.iso8601\n }\n\n # if version is passed in, add that into the build_args hash\n # **NOTE** if both `version` and `build_args` includes `version=something`\n # the value in `build_args` takes precedence\n build_args_hash['version'] = version unless version.nil?\n\n # Convert the build_args array to a hash, and merge it with the values\n # that have already been set\n if Array(build_args).any?\n build_args_hash.merge!(PuppetDockerTools::Utilities.parse_build_args(Array(build_args)))\n end\n\n build_args_hash = PuppetDockerTools::Utilities.filter_build_args(build_args: build_args_hash, dockerfile: File.join(directory, dockerfile))\n\n # This variable is meant to be used for building the non-latest tagged build\n # If the version was set via `version` or `build_args`, use that. If not,\n # use `get_value_from_env` to parse that value from the dockerfile.\n #\n # If version hasn't been passed in via `version` or `build_args` there's\n # no need to add the version from `get_value_from_env` to the\n # build_args_hash, dockerfiles should not be using both hardcoded versions\n # and versions passed in to the dockerfile with an `ARG`\n version = build_args_hash['version'] || PuppetDockerTools::Utilities.get_value_from_env('version', namespace: namespace, directory: directory, dockerfile: dockerfile)\n\n path = File.join(repository, image_name)\n\n build_options = []\n if no_cache\n puts \"Ignoring cache for #{path}\"\n build_options << '--no-cache'\n end\n\n if dockerfile != \"Dockerfile\"\n build_options << ['--file', File.join(directory, dockerfile)]\n end\n\n tags = []\n if latest\n tags << ['--tag', \"#{path}:latest\"]\n end\n\n if version\n tags << ['--tag', \"#{path}:#{version}\"]\n end\n\n if tags.empty?\n return nil\n end\n\n\n build_args = []\n build_args_hash.map{ |k,v| \"#{k}=#{v}\" }.each do |val|\n build_args << ['--build-arg', val]\n end\n\n build_command = ['docker', 'build', build_args, build_options, tags, directory].flatten\n\n Open3.popen2e(*build_command) do |stdin, output_stream, wait_thread|\n output=''\n output_stream.each_line do |line|\n stream_output ? (puts line) : (output += line)\n end\n exit_status = wait_thread.value.exitstatus\n puts output unless stream_output\n fail unless exit_status == 0\n end\n end",
"title": ""
},
{
"docid": "3bae0013b41b64c821052273ca0e438b",
"score": "0.60650223",
"text": "def prepare_image\n has_image_or_build_arg = @attributes.key?(:image) || @attributes.key?(:build)\n\n raise ArgumentError.new('No Image or Build command provided') unless has_image_or_build_arg\n\n # Build or pull image\n if @attributes.key?(:image)\n @internal_image = @attributes[:image]\n\n unless image_exists(@internal_image)\n Docker::Image.create('fromImage' => @internal_image)\n end\n elsif @attributes.key?(:build)\n @internal_image = SecureRandom.hex # Random name for image\n Docker::Image.build_from_dir(@attributes[:build], {t: @internal_image})\n end\n end",
"title": ""
},
{
"docid": "7da7c8bc34b475be6290b955c0b856a1",
"score": "0.6036959",
"text": "def docker_image\n @_docker_image ||= \"#{docker_registry}/#{docker_repository}\"\n end",
"title": ""
},
{
"docid": "df65651d657fee10e040194cc29420ba",
"score": "0.60142875",
"text": "def build(commit_id)\n Apache.errlogger Apache::APLOG_NOTICE, \"Build for #{commit_id}\"\n\n repository_url = REPOSITORY_URL\n Apache.errlogger Apache::APLOG_NOTICE, \"repository url: #{repository_url}\"\n repository_name = repository_url.split('/')[-1].split('.')[0]\n\n repository_path = \"#{WORK_DIR}/#{repository_name}\"\n if FileTest.exist?(repository_path)\n `cd #{repository_path} && git fetch origin && git checkout #{commit_id}`\n else\n `git clone -n #{repository_url} #{WORK_DIR}/#{repository_name}`\n `cd #{repository_path} && git checkout #{commit_id}`\n end\n\n\n Apache.errlogger Apache::APLOG_NOTICE, \"Start building docker image...\"\n image_id = \\\n `docker build -t '#{repository_name}/#{commit_id}' #{WORK_DIR}/#{repository_name}`\\\n .split(\"\\n\")[-1]\\\n .split(\" \")[-1]\n image_full_id = \\\n `docker inspect --format='{{.Id}}' #{image_id}`.chomp\n write_ids(commit_id, image_full_id)\n return image_full_id\nend",
"title": ""
},
{
"docid": "ace4711ffb1fffd0f61c64b28cfb7a40",
"score": "0.5991967",
"text": "def docker_build_context\n fetch(:docker_build_context, '.')\n end",
"title": ""
},
{
"docid": "3749b97cce957830b75496e34f9822ee",
"score": "0.5975979",
"text": "def docker_image(arg = nil)\n set_or_return(\n :docker_image,\n arg,\n kind_of: [String, NilClass],\n default: install_type == :container ? default_docker_image : nil,\n callbacks: { 'A `docker_image` requires a container install' =>\n ->(a) { a.nil? ? true : install_type == :container } }\n )\n end",
"title": ""
},
{
"docid": "0b428ae38a8467bdca7d5c04eb20a7cb",
"score": "0.59594053",
"text": "def build_image(name, tarfile)\n # Setup parser to receive chunks and yield parsed JSON objects.\n ret = []\n error = nil\n parser = Yajl::Parser.new\n parser.on_parse_complete = Proc.new do |obj|\n ret << obj\n error = Hoosegow::ImageBuildError.new(obj) if obj[\"error\"]\n yield obj if block_given?\n end\n\n # Make API call to create image.\n opts = {:t => name, :rm => '1'}\n ::Docker::Image.build_from_tar StringIO.new(tarfile), opts do |chunk|\n parser << chunk\n end\n\n raise error if error\n\n # Return Array of received objects.\n ret\n end",
"title": ""
},
{
"docid": "b52a7774386b1bcce10c69f7d516c94b",
"score": "0.59443796",
"text": "def docker_image(image_name)\n @platform.docker_image = image_name\n end",
"title": ""
},
{
"docid": "d8033718cb6bd8c0276733e3d1f41a23",
"score": "0.5922126",
"text": "def docker_image\n buildkite_command = ENV[BUILDKITE_COMMAND_ENV_KEY]\n if is_docker_build && buildkite_command && buildkite_command.include?(\"OS_IMAGE\")\n os_image = buildkite_command.match(/OS_IMAGE=(?<image_id>[\\S]*)/)\n os_image[:image_id]\n end\n end",
"title": ""
},
{
"docid": "eeb0f26cffba56d3df3b5dc3c430347d",
"score": "0.5917256",
"text": "def create_depends_image(image_repotag:, image_tag:, package:, skip_apt_update:)\n image_name = image_repotag.split(':')[0]\n package_name = if package.is_a? SFPackage\n package.name\n else\n package\n end\n\n depends_cache_key = if package.is_a? SFPackage\n package.build_depends_cache_key\n else\n package_name\n end\n depends_image_name = \"#{image_name}-depends-#{depends_cache_key}\"\n depends_image_repotag = \"#{depends_image_name}:#{image_tag}\"\n\n if settings.use_existing_depends_image\n found = false\n Docker::Image.all.each do |image|\n repotags = image.info['RepoTags']\n next unless repotags\n\n if repotags.include? depends_image_repotag\n found = true\n break\n end\n end\n\n unless found\n puts \"Unable to find existing image #{depends_image_repotag}, aborting\"\n exit 1\n end\n\n puts \"DEBUG: use existing image => #{depends_image_repotag}\"\n return depends_image_repotag\n end\n\n depends_container_name = \"#{@config.container}-#{image_tag}-#{@config.timestamp}\"\n depends_container_image = image_repotag\n\n Docker::Image.all.each do |image|\n repotags = image.info['RepoTags']\n next unless repotags\n\n depends_container_image = depends_image_repotag if repotags.include? depends_image_repotag\n end\n\n puts \"DEBUG: depends_image_repotag => #{depends_image_repotag}\"\n puts \"DEBUG: depends_container_name => #{depends_container_name}\"\n puts \"DEBUG: depends_container_image => #{depends_container_image}\"\n\n default_command = %w[/usr/local/bin/fpm-cook install-build-deps --color]\n\n puts 'DEBUG: default command to run in depends container'\n puts \"DEBUG: #{default_command}\"\n\n command = default_command\n\n depends_environment = {\n SKIP_UPDATE: (skip_apt_update ? 1 : 0),\n APT_SOURCES: @config.apt_sources.join(\"\\n\"),\n PACKAGE_DIR: File.join('/recipes', package_name)\n }\n\n depends_container = create_docker_container(\n 'name' => depends_container_name,\n image: depends_container_image,\n env: depends_environment.to_a.map { |a| \"#{a[0]}=#{a[1]}\" },\n tty: true,\n cmd: command\n )\n puts \"Created depends container: #{depends_container}\"\n\n inject_recipes_to_container container: depends_container\n\n puts \"Starting depends container #{depends_container_name}\"\n depends_container.start\n\n depends_container.attach(tty: true) { |chunk| print chunk } if settings.verbose\n\n puts \"Waiting depends container #{depends_container_name} to exit\"\n return_code = depends_container.wait['StatusCode']\n if return_code != 0\n puts \"Return code #{return_code}, not removing depends container #{depends_container_name}\"\n puts 'See logs below:'\n puts depends_container.logs(stdout: true, stderr: true)\n\n exit return_code\n end\n\n depends_container.commit repo: depends_image_name, tag: image_tag\n depends_container.remove\n\n depends_image_repotag\n end",
"title": ""
},
{
"docid": "34eddc062083a0239717028334d65e97",
"score": "0.59092444",
"text": "def push_docker_image(image_id)\n docker_bin = which('docker')\n raise \"docker_push: no docker binary: #{image_id}\" unless docker_bin\n stdout, stderr, status = Open3.capture3(docker_bin, 'push', image_id)\n raise \"stdout: #{stdout}\\nstderr: #{stderr}\\nstatus: #{status}\" \\\n unless status.exitstatus.zero?\n clean_up_image(image_id)\n end",
"title": ""
},
{
"docid": "16f0ca2840b18fca5cc3350e27b76f00",
"score": "0.5886927",
"text": "def add_docker_image(image, docker_public_key, memory_limit, memory_swap, cpu_shared)\n # Convert docker image name into something that works as a Groovy variable name\n var_name = image.tr('/:\\-.', '_')\n # Convert docker image name into a more sensible jenkins label converting slashes and colons to dashes\n label = \"docker-#{image.tr('/:', '-')}\"\n <<-EOH\n def #{var_name}_templateBaseParameters = [\n image: '#{image}',\n volumesString: 'ccache:/var/cache/ccache',\n environmentsString: 'JENKINS_SLAVE_SSH_PUBKEY=#{docker_public_key}',\n memoryLimit: #{memory_limit},\n memorySwap: #{memory_swap},\n cpuShares: #{cpu_shared},\n privileged: false,\n tty: false,\n ]\n DockerTemplateBase #{var_name}_TemplateBase = new DockerTemplateBase(#{var_name}_templateBaseParameters.image);\n #{var_name}_templateBaseParameters.findAll{ it.key != \"image\" }.each { k, v ->\n #{var_name}_TemplateBase.\"$k\" = v\n }\n DockerTemplate dk_#{var_name}_Template = new DockerTemplate(\n #{var_name}_TemplateBase, // dockerTemplateBase\n sshConnector, // connector\n '#{label}', // labelString\n '', // remoteFs\n '50', // instanceCapStr\n )\n def #{var_name}_privileged_templateBaseParameters = [\n image: '#{image}',\n volumesString: 'ccache:/var/cache/ccache',\n environmentsString: 'JENKINS_SLAVE_SSH_PUBKEY=#{docker_public_key}',\n memoryLimit: #{memory_limit},\n memorySwap: #{memory_swap},\n cpuShares: #{cpu_shared},\n privileged: true,\n tty: false,\n ]\n DockerTemplateBase #{var_name}_privileged_TemplateBase = new DockerTemplateBase(#{var_name}_privileged_templateBaseParameters.image);\n #{var_name}_privileged_templateBaseParameters.findAll{ it.key != \"image\" }.each { k, v ->\n #{var_name}_privileged_TemplateBase.\"$k\" = v\n }\n DockerTemplate dk_#{var_name}_privileged_Template = new DockerTemplate(\n #{var_name}_privileged_TemplateBase, // dockerTemplateBase\n sshConnector, // connector\n '#{label}-privileged', // labelString\n '', // remoteFs\n '50', // instanceCapStr\n )\n dkTemplates.add(dk_#{var_name}_Template);\n dkTemplates.add(dk_#{var_name}_privileged_Template);\n\n EOH\n end",
"title": ""
},
{
"docid": "9e53379f5e3976cc7adce1fe2efd175e",
"score": "0.5877284",
"text": "def create_container(name, image)\n # Pull a suitable image\n Cyclid.logger.debug \"Creating image '#{image}'\"\n ::Docker::Image.create('fromImage' => image)\n\n # Create the container\n # XXX How do we (reliably) know what to run? /sbin/init is a good\n # guess but not bullet proof\n Cyclid.logger.debug \"Creating container '#{name}'\"\n container = ::Docker::Container.create('Name' => name,\n 'Image' => image,\n 'Cmd' => ['/sbin/init'])\n container.start\n\n return container\n end",
"title": ""
},
{
"docid": "ef9cafde3ce9859ea2a4f96c0f66e346",
"score": "0.58749324",
"text": "def dockerfile_name\n parse_dockerfile_name(@name_args[0])\n end",
"title": ""
},
{
"docid": "c72616d70f59cfd5112395faff2c187f",
"score": "0.5836136",
"text": "def build_from_string(string, dir = '.')\n dir = @options[:string_build_path] if @options[:string_build_path]\n Dir.mktmpdir do |tmpdir|\n FileUtils.cp_r(\"#{dir}/.\", tmpdir)\n dockerfile = File.join(tmpdir, 'Dockerfile')\n File.open(dockerfile, 'w') { |f| f.write(string) }\n build_from_dir(tmpdir)\n end\n end",
"title": ""
},
{
"docid": "3c455d49deb89dbed79e988ff7718343",
"score": "0.5785873",
"text": "def run\n # Ensure to pull the specified image\n Docker::Image.create('fromImage' => @image_name)\n @container = Docker::Container.create(\n 'Image' => @image_name,\n 'HostConfig' => {\n 'PortBindings' => {\n '8080/tcp' => [\n {\n 'HostPort' => '8080'\n }\n ]\n }\n }\n )\n @container.start\n @container\n end",
"title": ""
},
{
"docid": "0c2f00d25b4f5f033bd79389acf19320",
"score": "0.5752761",
"text": "def artifact_file(name, deps, iidfile, &block)\n desc \"Build `#{name}`\"\n file name => deps do\n digest = File.read(iidfile)\n run = Docker::Run.new(options: run_options, image: digest, cmd: [name], &block)\n run.with_defaults(rm: true, entrypoint: \"cat\")\n sh \"#{run} > #{name}\"\n end\n end",
"title": ""
},
{
"docid": "1f30dbe95af2fa7475fb3fe88d8f20b7",
"score": "0.57435906",
"text": "def create(image, name, extra_args={})\n # If this ends up getting integrated, we'll use @logger.error here\n case image.class.to_s\n when \"Docker::Image\"\n i = image.id\n when \"String\"\n if image.include? ':' # repository:tag format\n i = image\n else\n puts \"Image string must be in 'repository:tag' format.\"\n return\n end\n else\n puts \"image must be Docker::Image or in 'repository:tag' format\"\n return\n end\n\n # Don't change the non-capitalized 'name' here. The Docker API gem extracts\n # this key and uses it to name the container on create.\n main_args = {\n 'name' => name,\n 'Hostname' => name,\n 'Image' => i,\n 'PublishAllPorts' => true,\n 'CapAdd' => ['NET_ADMIN'],\n }\n @raw = Docker::Container.create(main_args.merge(extra_args))\n end",
"title": ""
},
{
"docid": "d8559ef195c97f0e20c1d74f40c30e5c",
"score": "0.57406014",
"text": "def call\n Docker::Container.create(\n 'Image' => image,\n 'Cmd' => command,\n 'Env' => environment,\n 'Binds' => binds\n )\n end",
"title": ""
},
{
"docid": "f563d220c08dad80d3fc66f93a3e2217",
"score": "0.5740003",
"text": "def docker_load(image_filename)\n return unless image_filename\n\n \"\\n# Load the uploaded Docker image to the local registry\\n\" \\\n \"#{IMAGE_ID_VAR}=`docker load < #{image_filename} | sed -n -e 's/^Loaded image: //p'`\\n\"\n end",
"title": ""
},
{
"docid": "d634491729bbd4e1ca319ff2475f30e8",
"score": "0.5672431",
"text": "def artifact_file(name, deps, iidfile, &block)\n desc \"Build `#{name}`\"\n file name => deps do\n digest = File.read(iidfile)\n run = Docker::Run.new(options: run_options, image: digest, cmd: [\"cat\", name], &block)\n run.with_defaults(rm: true)\n sh \"#{run} > #{name}\"\n end\n end",
"title": ""
},
{
"docid": "271c40f4e9133c00f46602a69e840fba",
"score": "0.56458014",
"text": "def docker_pull\n need_pull = true\n `docker images`.each_line do |l|\n if m = /^#{@docker_img}/.match(l)\n need_pull = false\n break\n end\n end\n if need_pull\n docker_command \"docker pull #{@docker_img}:#{@docker_tag}\"\n end\n end",
"title": ""
},
{
"docid": "86cf8a0a71d76db730edc6f43d949595",
"score": "0.5597266",
"text": "def build\n previous_image_id = image_id\n Docker.build(full_image_name)\n if previous_image_id == image_id\n # If the image id hasn't changed the build was not successfull\n false\n else\n true\n end\n end",
"title": ""
},
{
"docid": "56499ba9f578e77c7f3dea187cd353ab",
"score": "0.557303",
"text": "def build_image(path, **opts)\n @__build_images << [path, opts]\n end",
"title": ""
},
{
"docid": "618aaa0c015ed90ba54b8739bdb511a2",
"score": "0.55703074",
"text": "def docker_run(image_name, container_cmd)\n container_name = image_name\n\n unless docker_container?(container_name)\n cmd = \"docker run\"\n cmd << \" --rm\"\n cmd << \" --name #{container_name}\"\n cmd << \" -d\"\n cmd << \" -it\"\n cmd << \" #{image_name}\"\n sh(cmd, verbose: true)\n end\n\n sh(\"docker exec -it #{container_name} #{container_cmd}\", verbose: true)\nend",
"title": ""
},
{
"docid": "fdd2e221f32202b05c18a4cdfb5a3b4b",
"score": "0.5505925",
"text": "def build_image(path, **opts)\n @build_images << [path, opts]\n end",
"title": ""
},
{
"docid": "d77752e613348b2ffbcc0b1eceb22004",
"score": "0.54995036",
"text": "def descargarImagen\n Docker::Image.search('term' => 'sshd')\n image = Docker::Image.create('fromImage' => 'ubuntu:14.04')\nend",
"title": ""
},
{
"docid": "44a38db75a51fa53f00775e640f2972f",
"score": "0.5495851",
"text": "def recipe\n 'docker_init'\n end",
"title": ""
},
{
"docid": "1313f71ba3768bb027773cf1466374ae",
"score": "0.5490511",
"text": "def docker_run(*args)\n params = {}\n params['AttachStdin'] = true\n params['OpenStdin'] = true\n params['Tty'] = true\n params['name'] = container_name\n\n # links\n link_containers.each{|name, container_name|\n params['HostConfig'] ||= {}\n params['HostConfig']['Links'] ||= []\n params['HostConfig']['Links'] << \"#{container_name}:#{name}\"\n }\n\n config_params(params, env_config)\n params['Image'] = image_name\n params['Cmd'] = args\n\n #puts params\n\n container = Docker::Container.create(params)\n\n receiver = ->(msg) {\n $stdout << msg\n $stdout.flush\n }\n\n if $stdin && $stdin.tty?\n\n $stdin.raw do\n container.start!\n lines, cols = IO.console.winsize rescue [60,80]\n container.connection.post(\"/containers/#{container.id}/resize\", h: lines, w: cols)\n container.attach(tty: true, stdin: $stdin, &receiver)\n end\n else\n container.start!.attach(tty: true, &receiver)\n end\n\n status = container.json['State']['ExitCode']\n debug \"Exited with status #{status}\"\n\n status\n ensure\n clean_container(container_name)\n end",
"title": ""
},
{
"docid": "951b88a9038c5c55cb58b928fdb14738",
"score": "0.5470309",
"text": "def get(args = {})\n args.symbolize_keys!\n\n Cyclid.logger.debug \"docker: args=#{args}\"\n\n # If there is one, split the 'os' into a 'distro' and 'release'\n if args.key? :os\n match = args[:os].match(/\\A(\\w*)_(.*)\\Z/)\n distro = match[1] if match\n release = match[2] if match\n else\n # No OS was specified; use the default\n # XXX Defaults should be configurable\n distro = 'ubuntu'\n release = 'trusty'\n end\n\n # Find the image for the given distribution & release\n image_alias = \"#{distro}:#{release}\"\n Cyclid.logger.debug \"image_alias=#{image_alias}\"\n\n # Create a new instance\n name = create_name\n container = create_container(name, image_alias)\n\n Cyclid.logger.debug \"container=#{container}\"\n\n # Create a buildhost from the container details\n DockerHost.new(\n host: container.id,\n name: name,\n username: 'root',\n workspace: '/root',\n distro: distro,\n release: release\n )\n end",
"title": ""
},
{
"docid": "3b9b8dd241d7f10be0ddc404ffd2cd24",
"score": "0.547002",
"text": "def run(image_id)\n @logger.info 'Start running container...'\n env = [\"POOL_HOSTNAME=#{pool_hostname}\"]\n container = Docker.run(image_id, {'Env' => env})\n\n return container\n end",
"title": ""
},
{
"docid": "e0298a498606a2b2c88d487f0cb1260a",
"score": "0.5454781",
"text": "def get_image\n image_id = @options.delete :image_id\n aws_dockerfile_path = @options.delete :aws_dockerfile_path\n if image_id && aws_dockerfile_path\n raise OptionParser::InvalidOption, \"Cannot specify both :image_id and :aws_dockerfile_path\"\n elsif image_id\n Docker::Image.get(image_id)\n elsif aws_dockerfile_path\n BuildSpecRunner::DefaultImages.build_image :aws_dockerfile_path => aws_dockerfile_path\n else\n BuildSpecRunner::DefaultImages.build_image\n end\n end",
"title": ""
},
{
"docid": "4ae75d3abf6b3192b02436c2fde9da6c",
"score": "0.54437256",
"text": "def docker_context\n File.join(config[:dockerfiles_path], dockerfile_name)\n end",
"title": ""
},
{
"docid": "9313f0cff085040464c9bf03f73acd72",
"score": "0.543782",
"text": "def build_local!\n return if ENV[\"PORTUS_INTEGRATION_BUILD_IMAGE\"].to_s == \"false\"\n\n exists = !`docker images -q #{::Portus::Test::LOCAL_IMAGE}`.empty?\n rebuild!(exists)\nend",
"title": ""
},
{
"docid": "db22b85301605a611289b834098ffbb4",
"score": "0.5434261",
"text": "def build(autoinst)\n Dir.chdir(work_dir) do\n log.info \"Creating #{veewee_provider} image\"\n cmd = \"veewee #{veewee_provider} build #{IMAGE_NAME} --force --auto\"\n cmd << \" --nogui\" if headless\n system(build_environment(autoinst), cmd)\n end\n end",
"title": ""
},
{
"docid": "6f50a1c87cb2e528ba5b52ed83387d7a",
"score": "0.54187095",
"text": "def pull_busybox_image\n puts 'DEBUG: pulling busybox image'\n\n creds = Docker.creds\n Docker.creds = '{}'\n Docker::Image.create fromImage: 'busybox:latest'\n Docker.creds = creds\nend",
"title": ""
},
{
"docid": "57adba4db62ebfec8bc9bbaf7469121e",
"score": "0.5363915",
"text": "def run_build_image_job(local_job, push: false, tag_as_latest: false)\n k8s_job = Kubernetes::BuildJobExecutor.new(\n output,\n job: local_job,\n registry: self.class.registry_credentials(DockerRegistry.first)\n )\n success, build_log = k8s_job.execute!(\n build, project,\n docker_tag: build.docker_tag,\n push: push,\n tag_as_latest: tag_as_latest\n )\n\n build.docker_repo_digest = nil\n\n if success\n build_log.each_line do |line|\n if (match = line[DOCKER_REPO_REGEX, 1])\n build.docker_repo_digest = match\n end\n end\n end\n if build.docker_repo_digest.blank?\n output.puts \"### Failed to get the image digest\"\n end\n\n build.save!\n end",
"title": ""
},
{
"docid": "afd0e79ad42aeaad8652aa7d876bfced",
"score": "0.5343746",
"text": "def docker_go\n docker_run\n docker_start\n end",
"title": ""
},
{
"docid": "d79881652eef1a93a76a9490304cd3c8",
"score": "0.53297186",
"text": "def build_docker_image_for_branch?(branch)\n branch && docker_release_branch == branch\n end",
"title": ""
},
{
"docid": "b42ed90fd188a94e3e85ecbe44317160",
"score": "0.53216463",
"text": "def build_image(image_name, version, git_ref, repo_url)\n %{\ndest_dir=/tmp/images/#{image_name}\nrm -rf ${dest_dir}; mkdir -p ${dest_dir}\nset -e\npushd ${dest_dir}\ngit init && git remote add -t master origin #{repo_url}\ngit fetch && git checkout #{git_ref}\ngit_ref=$(git rev-parse --short HEAD)\necho \"Building and testing #{image_name}-centos7:$git_ref ...\"\nsudo env \"PATH=$PATH\" make test TARGET=centos7 VERSION=#{version} TAG_ON_SUCCESS=true\necho \"Building and testing #{image_name}-rhel7:$git_ref ...\"\nsudo env \"PATH=$PATH\" make test TARGET=rhel7 VERSION=#{version} TAG_ON_SUCCESS=true\npopd\nset +e\n }\n end",
"title": ""
},
{
"docid": "6824d7114ec768ac7301542801e61756",
"score": "0.53194267",
"text": "def build_submodule(label)\n # @env = options[:env]\n # image_name, tag, dockerfile_dir = [label, options[:tag], \"#{label}/dockerfiles\"]\n # dockerfile_path = \"#{dockerfile_dir}/#{image_name}-#{@env}.dockerfile\"\n # docker dockerfile_path, :build, tag: \"storjlabs/#{image_name}:#{tag}\"\n\n @env = options[:env]\n image_name, tag, dockerfile_dir =\n (submodules.include? label) ?\n [label, options[:tag], \"#{label}/dockerfiles\"] :\n ['storj', \"#{label}:latest\", 'dockerfiles']\n dockerfile_path = \"#{dockerfile_dir}/#{image_name}-#{@env}.dockerfile\"\n docker dockerfile_path, :build, tag: \"storjlabs/#{image_name}:#{tag}\"\n end",
"title": ""
},
{
"docid": "66c43ad7321fa85cab5010cd291080d0",
"score": "0.5313766",
"text": "def docker_build_opts\n fetch(:docker_build_opts, nil)\n end",
"title": ""
},
{
"docid": "b4c5eb68d3970c55e6d169b1de9339c3",
"score": "0.53016895",
"text": "def build_from_file(file)\n dir = File.dirname(file)\n string = IO.read(file)\n build_from_string(string, dir)\n end",
"title": ""
},
{
"docid": "e8578c0c77fa3bc42f3bf02cdbb2fe8a",
"score": "0.5295296",
"text": "def test_docker_image # rubocop:disable MethodLength\n # Test possible php commands\n ['php-cgi', 'php5-cgi', 'php', 'php5'].each do |php_cmd|\n result = test_docker_cmd [:which, php_cmd]\n\n next unless result[:ret_val] == 0\n\n php_cmd_path = result[:stdout].strip\n\n result = test_docker_cmd [php_cmd_path, '-v']\n\n next unless result[:ret_val] == 0\n php_version_re = /PHP [A-Za-z0-9\\.\\-\\_]+ \\(cgi-fcgi\\)/\n next if php_version_re.match(result[:stdout]).nil?\n\n @php_cmd_path = php_cmd_path\n break\n end\n fail 'No usable fast-cgi enabled php found in image' if @php_cmd_path.nil?\n\n # Test if spawn-fcgi exists\n result = test_docker_cmd [:which, 'spawn-fcgi']\n fail 'No usable spawn-fcgi found in image' unless result[:ret_val] == 0\n @spawn_cmd_path = result[:stdout].strip\n end",
"title": ""
},
{
"docid": "8b46b15c3b47c20c420165dc1d30a93f",
"score": "0.52699345",
"text": "def docker_pull\n need_pull = true\n Docker::Image.all.each do |img|\n img.info['RepoTags'].each do |tag|\n if tag.match(\"#{@docker_img}:#{@docker_tag}\")\n need_pull = false\n break\n end\n end\n end\n if need_pull\n Docker::Image.create('fromImage' => @docker_img, 'tag' => @docker_tag)\n end\n end",
"title": ""
},
{
"docid": "0a3461fb3f168ba3ba6365c2e11194ff",
"score": "0.5255741",
"text": "def make_default_dockerfile_and_image_name_not_collide\n self.dockerfile = nil if dockerfile == 'Dockerfile' && image_name\n end",
"title": ""
},
{
"docid": "de653af7e752b4c2bf598198e3003a73",
"score": "0.5253897",
"text": "def exec\n container = Docker::Container.create(Image: image.id,\n Cmd: ['bash'],\n Tty: true)\n container.start\n container\n end",
"title": ""
},
{
"docid": "37d84523bc78fc3752a8feb39a93014e",
"score": "0.5253808",
"text": "def build path, params = {}, authentication = {}, &block\n raise Docker::API::Error.new(\"Expected path or params[:remote]\") unless path || params[:remote] \n\n headers = {\"Content-type\": \"application/x-tar\"}\n headers.merge!({\"X-Registry-Config\": auth_encoder(authentication) }) if authentication.keys.size > 0\n\n if path == nil and params.has_key? :remote\n response = @connection.request(method: :post, path: build_path(\"/build\", params), headers: headers, response_block: block_given? ? block : default_streamer)\n else\n default_reader(path, build_path(\"/build\", params), headers)\n end\n end",
"title": ""
},
{
"docid": "8ee0c9c43bda72c7c98bb798a879d541",
"score": "0.5246858",
"text": "def perform(image_id, repo_credentials)\r\n \tprepare_docker\r\n\t\timage = Image.find(image_id)\r\n\t\timage.force_update_status(0)\r\n\t\tlog(\"build started for image with id\" + image_id, \"info\")\r\n\r\n\t\tdocker_prepare_status = authenticate_docker(repo_credentials['username'], repo_credentials['password'], repo_credentials['email'])\r\n\t\tif docker_prepare_status\r\n\t\t\tfile_exists = Docker::Image.exist?(image.filename)\r\n\t\t\tdockerfile_dir = Rails.root.join('public', 'images')\r\n\t\t\tif !file_exists\r\n\t\t\t\tDir.chdir(dockerfile_dir)\r\n\t\t\t\tdocker_image = Docker::Image.build_from_tar(File.open(dockerfile_dir + image.filename, 'r'))\r\n\t\t\t\tdocker_image.tag(\"repo\" => image.repo + \"/\" + image.image, \"force\" => true)\r\n\t\t\t\tpush_status = docker_image.push\r\n\t\t\t\tif push_status\r\n\t\t\t\t\timage.force_update_status(2)\r\n\t\t\t\t\tlog(\"build succeeded for image with id\" + image_id, \"info\")\r\n\t\t\t\telse\r\n\t\t\t\t\timage.force_update_status(1)\r\n\t\t\t\t\tlog(\"build failed for image with id\" + image_id, \"error\")\r\n\t\t\t\tend\r\n\t\t\tend\r\n\t\telse\r\n\t\t\timage.force_update_status(3)\r\n\t\t\tlog(\"authentication for build failed for image with id\" + image_id, \"error\")\r\n\t\tend\r\n end",
"title": ""
},
{
"docid": "70134c593cd829f7169f2a0153cd017b",
"score": "0.5245637",
"text": "def docker_push\n debug(\"Docker push #{docker_image}\")\n system \"docker push #{docker_image}\"\n end",
"title": ""
},
{
"docid": "763c6154a869920b58ba2a5a76eda533",
"score": "0.5239368",
"text": "def docker_run\n need_run = true\n `docker ps --all`.each_line do |l|\n if m = /#{@env_name}/.match(l)\n need_run = false\n break\n end\n end\n if need_run\n docker_command \"docker run #{@docker_run} #{@docker_img}:#{@docker_tag} #{@docker_cmd}\"\n else\n docker_start\n end\n end",
"title": ""
},
{
"docid": "3518d2c4c7cf47d0c080d95815a01ca5",
"score": "0.523925",
"text": "def docker_context\n File.join(config[:dockerfiles_path], @name_args[0])\n end",
"title": ""
},
{
"docid": "74ccddbf2fcc32febe43fbbde8c04967",
"score": "0.5221902",
"text": "def get_value_from_dockerfile(key, directory: '.', dockerfile: 'Dockerfile', dockerfile_contents: '')\n if dockerfile_contents.empty?\n file = \"#{directory}/#{dockerfile}\"\n fail \"File #{file} doesn't exist!\" unless File.exist? file\n dockerfile_contents = File.read(\"#{file}\")\n end\n dockerfile_contents[/^#{key.upcase} (.*$)/, 1]\n end",
"title": ""
},
{
"docid": "4f7a52a3f7dcb631bba55ba9c94a0ad5",
"score": "0.5207992",
"text": "def build\n builder = AYTests::ImageBuilder.new(\n sources_dir: AYTests.base_dir.join(\"share\", \"veewee\"),\n work_dir: work_dir,\n files_dir: files_dir,\n results_dir: results_dir,\n provider: provider,\n headless: headless\n )\n builder.cleanup_environment\n builder.install(autoinst(:install), iso_url(:install))\n builder.upgrade(autoinst(:upgrade), iso_url(:upgrade)) if upgrade?\n builder.import\n builder.cleanup\n end",
"title": ""
},
{
"docid": "5da362b968f8b7727d1410052e88be70",
"score": "0.51829046",
"text": "def push\n docker('push', \"#{image}:#{TAG}\")\n end",
"title": ""
},
{
"docid": "9edad50efec2beb13c2f00a6d8b37022",
"score": "0.5172701",
"text": "def create_docker_container(opts = {})\n opts[:NetworkMode] = 'host' unless opts.include? :NetworkMode\n container = Docker::Container.create opts\n CONTAINERS << container\n container\nend",
"title": ""
},
{
"docid": "d7adfb5f06d5e3858906ef89ae1a1445",
"score": "0.5154968",
"text": "def run_command_in_container command\n begin\n @logger.info \"Running command: #{command}\"\n\n settings = @generator_config.build_settings.docker_settings\n build_image = create_container_image\n\n args = {\n :image => build_image,\n :command => command,\n :volumes => settings.binds,\n :environment => settings.env,\n :working_directory => settings.working_directory\n }\n container, success = @docker_runner.create_and_run_container args\n\n # throw exception if failed\n raise \"Unable to run command #{command}\" unless success\n ensure\n @docker_runner.delete_container container\n end\n end",
"title": ""
},
{
"docid": "dfa895b425c6f55a420c1c64599aee85",
"score": "0.5146289",
"text": "def docker_command\n docker_cmd = 'sudo docker'\n local_cmd = 'docker'\n File.file?('/.dockerenv') ? docker_cmd : local_cmd\nend",
"title": ""
},
{
"docid": "04012be9a997a57d0d4760e0830a0853",
"score": "0.5145011",
"text": "def start_container!(image, name, ext = {})\n # Remove old containers.\n container = container_for(name)\n container.delete(force: true) if container\n\n opts = { \"Image\" => image }.merge(ext)\n\n begin\n container = Docker::Container.create(opts)\n rescue Docker::Error::NotFoundError\n puts \"Pulling from #{image}\"\n pull(image)\n container = Docker::Container.create(opts)\n end\n\n container.rename(name)\n puts \"Starting container #{name}\"\n container.start\n\n # Make sure that the container has actually started. Yes, the previous\n # `start` method does not say anything about this (and even worse, we don't\n # have a way in the client to tell why the container could not start).\n begin\n container.top\n rescue Docker::Error::ServerError\n raise StartError, \"Could not start container '#{name}' from image '#{image}'.\"\n end\nend",
"title": ""
},
{
"docid": "7bee3dab4f025df70c49defd34a8fdf7",
"score": "0.514066",
"text": "def install_docker\n # install docker to be able to connect to the master and deploy directly from there\n\n exe :master, \"apt -y update\"\n exe :master, \"apt -y install apt-transport-https ca-certificates gnupg2 software-properties-common\"\n exe :master, \"curl -fsSL https://download.docker.com/linux/debian/gpg | apt-key add -\"\n exe :master, \"add-apt-repository 'deb [arch=amd64] https://download.docker.com/linux/debian #{DEBIAN_RELEASE} stable'\"\n exe :master, \"apt -y update\"\n exe :master, \"apt -y install docker-ce docker-ce-cli containerd.io\"\n end",
"title": ""
},
{
"docid": "9660099c3e4d7b5129860ba41761c8a1",
"score": "0.51400083",
"text": "def fill_cmd_with_docker_args(cmd)\n DOCKER_ARGS.each do |env_var_name|\n if ENV[env_var_name]\n cmd << \" --build-arg=#{env_var_name}=#{ENV[env_var_name]}\"\n end\n end\nend",
"title": ""
},
{
"docid": "eee6bf9b43944c77ec688c71c9da6eba",
"score": "0.51371914",
"text": "def stage_file(iidfile, iiddeps, tag:, target:, &block)\n file iidfile => iiddeps do\n tsfile = \"#{iidfile}@#{Time.now.utc.to_i}\"\n build = Docker::Build.new(options: build_options, &block)\n build.with_defaults(iidfile: tsfile, tag: tag, target: target)\n sh build.to_s\n cp tsfile, iidfile\n end\n end",
"title": ""
},
{
"docid": "75620d1007e30be411b19abd44d9157d",
"score": "0.5115085",
"text": "def pull_image(image)\n ActiveSupport::Notifications.instrument('pull.docker.evaluator.coursemology',\n image: image) do\n Docker::Image.create('fromImage' => image)\n end\n end",
"title": ""
}
] |
313ac54be79f5e47257bcdb52420f60c
|
Command to run rolling restart of roles in a service. The sequence is:\n\nRestart all the nonslave roles\nIf slaves are present restart them in batches of size specified in RollingRestartCmdArgs\nPerform any postcommand needed after rolling restart\n\n\nAvailable since API v3. Only available with Cloudera Manager Enterprise\nEdition.
|
[
{
"docid": "02987685b72d6a7d7124bf301aff3f24",
"score": "0.48505244",
"text": "def api_v11_clusters_cluster_name_services_service_name_commands_rolling_restart_post(service_name, cluster_name, opts = {})\n api_v11_clusters_cluster_name_services_service_name_commands_rolling_restart_post_with_http_info(service_name, cluster_name, opts)\n return nil\n end",
"title": ""
}
] |
[
{
"docid": "f4e0f537a62b693b92a20f548e337c81",
"score": "0.661345",
"text": "def q_rolling_restart\n q = 'Are you sure you want to ROLLING RESTART on the above ' \\\n 'roles (y|n)? '\n Utils.exit_with_msg('STOPPED'.red, true) unless CHK.yn?(q.cyan, true)\n end",
"title": ""
},
{
"docid": "17bdba9c1b8636b8ebef221b90e90cc5",
"score": "0.63550526",
"text": "def api_v11_cm_service_role_commands_restart_post(opts = {})\n api_v11_cm_service_role_commands_restart_post_with_http_info(opts)\n return nil\n end",
"title": ""
},
{
"docid": "61a42b2ed9154edc7393e48c94b3df03",
"score": "0.5882019",
"text": "def restart_command(cmd); end",
"title": ""
},
{
"docid": "9e6028a10e964a7b99368c254f7504b8",
"score": "0.57872045",
"text": "def print_restart_role_msg(hostname, role)\n msg = 'Restart '.red + \"[#{hostname}] #{role}\".yellow\n FMT.puts_str(msg, true)\n end",
"title": ""
},
{
"docid": "c8380d0d901e0eac975ed31b8d626ab1",
"score": "0.57808685",
"text": "def restart(services)\n generate_config if stale_config\n update_platform_env\n services.each do |service|\n kubectl(\"rollout restart deploy #{clean_kubernetes_name(service)}\")\n end\n # down(services)\n # up(services)\n # status\n end",
"title": ""
},
{
"docid": "b8ae1ce91e53e9255fe9818a568ee918",
"score": "0.57209903",
"text": "def cmd_restart argv\n setup argv\n response = @api.restart\n msg response\n return response\n end",
"title": ""
},
{
"docid": "1c8031e4f62b88ce25607ac5c8b38162",
"score": "0.56476253",
"text": "def restart(*services) = execute(services: services)",
"title": ""
},
{
"docid": "f4cbdddec103e2311c31a88ed2f38a52",
"score": "0.5646544",
"text": "def restart\n if @restart_command\n run_command(@restart_command)\n else\n stop\n start\n end\n end",
"title": ""
},
{
"docid": "5f2fb90f4b1b1c19be7c0f79694390d2",
"score": "0.5604125",
"text": "def cmd_reboot(*args)\n if args.length > 0\n cmd_reboot_help\n return\n end\n client.reboot\n end",
"title": ""
},
{
"docid": "9a93e28d55d5b8b9be2fd42a389073ca",
"score": "0.5598298",
"text": "def restart(params)\n services = services_from_params(params)\n if @environment.in_dry_run_mode\n services.each do |agent|\n notify(:msg => \"[#{@name}] Would restart #{agent.host} (#{agent.type})\",\n :tags => [:galaxy, :dryrun])\n end\n services\n else\n command = ::Galaxy::Commands::RestartCommand.new([], @galaxy_options)\n command.report = GalaxyGatheringReport.new(@environment,\n '[' + @name + '] Restarted #{agent.host} (#{agent.type})',\n [:galaxy, :trace])\n execute(command, services)\n command.report.results\n end\n end",
"title": ""
},
{
"docid": "29fb83f3420d1e7498fdce4bd45535c2",
"score": "0.54874045",
"text": "def restart\n raise _(\"Server restart is only supported on Linux\") unless MiqEnvironment::Command.is_linux?\n\n _log.info(\"Server restart initiating...\")\n update_attribute(:status, \"restarting\")\n\n shutdown_and_exit(RESTART_EXIT_STATUS)\n end",
"title": ""
},
{
"docid": "a6f015413558075f599ed2593611d043",
"score": "0.54788643",
"text": "def restart\n\trequire_relative '../../lib/falcon/command/supervisor'\n\t\n\tFalcon::Command::Supervisor[\"restart\"].call\nend",
"title": ""
},
{
"docid": "af4245202c5ee11ccc68804e072fedf8",
"score": "0.53273606",
"text": "def restart_linux_service(service)\n message = \"Information:\\tRestarting Service \"+service\n command = \"service #{service} restart\"\n output = execute_command(message,command)\n return output\nend",
"title": ""
},
{
"docid": "408d1abacc8b8acaba213113cc640cf3",
"score": "0.53185314",
"text": "def restart_container\n do_service_action :restart_container\n end",
"title": ""
},
{
"docid": "e0b729e825ec57603d12deb02e4047d7",
"score": "0.52685237",
"text": "def restart!\n # Permissions are handled by the script, use: :sudo => false\n run_script! :restart, :sudo => false\n end",
"title": ""
},
{
"docid": "60c8cf2c6bc64d3cec75a8edf26b9818",
"score": "0.5267716",
"text": "def run!(deployments: [], statefulsets: [], daemonsets: [], selector: nil, verify_result: true)\n start = Time.now.utc\n @logger.reset\n\n @logger.phase_heading(\"Initializing restart\")\n verify_config!\n deployments, statefulsets, daemonsets = identify_target_workloads(deployments, statefulsets,\n daemonsets, selector: selector)\n\n @logger.phase_heading(\"Triggering restart\")\n restart_deployments!(deployments)\n restart_statefulsets!(statefulsets)\n restart_daemonsets!(daemonsets)\n\n if verify_result\n @logger.phase_heading(\"Waiting for rollout\")\n resources = build_watchables(deployments, start, Deployment)\n resources += build_watchables(statefulsets, start, StatefulSet)\n resources += build_watchables(daemonsets, start, DaemonSet)\n verify_restart(resources)\n else\n warning = \"Result verification is disabled for this task\"\n @logger.summary.add_paragraph(ColorizedString.new(warning).yellow)\n end\n StatsD.client.distribution('restart.duration', StatsD.duration(start),\n tags: tags('success', deployments, statefulsets, daemonsets))\n @logger.print_summary(:success)\n rescue DeploymentTimeoutError\n StatsD.client.distribution('restart.duration', StatsD.duration(start),\n tags: tags('timeout', deployments, statefulsets, daemonsets))\n @logger.print_summary(:timed_out)\n raise\n rescue FatalDeploymentError => error\n StatsD.client.distribution('restart.duration', StatsD.duration(start),\n tags: tags('failure', deployments, statefulsets, daemonsets))\n @logger.summary.add_action(error.message) if error.message != error.class.to_s\n @logger.print_summary(:failure)\n raise\n end",
"title": ""
},
{
"docid": "b6510264f064e0b6104b5d4d15109157",
"score": "0.5267137",
"text": "def run(options)\n check_privileges\n AgentConfig.root_dir = AgentConfig.right_link_root_dirs\n\n if RightScale::Platform.windows?\n cleanup_certificates(options)\n # Write state file to indicate to RightScaleService that it should not\n # enter the rebooting state (which is the default behavior when the\n # RightScaleService starts).\n reenroller_state = {:reenroll => true}\n File.open(STATE_FILE, \"w\") { |f| f.write reenroller_state.to_json }\n print 'Restarting RightScale service...' if options[:verbose]\n res = system('net start RightScale')\n puts to_ok(res) if options[:verbose]\n else\n print 'Stopping RightLink daemon...' if options[:verbose]\n pid_file = AgentConfig.pid_file('instance')\n pid = pid_file ? pid_file.read_pid[:pid] : nil\n system('/opt/rightscale/bin/rchk --stop')\n # Wait for agent process to terminate\n retries = 0\n while process_running?(pid) && retries < 40\n sleep(0.5)\n retries += 1\n print '.' if options[:verbose]\n end\n puts to_ok(!process_running?(pid)) if options[:verbose]\n # Kill it if it's still alive after ~ 20 sec\n if process_running?(pid)\n print 'Forcing RightLink daemon to exit...' if options[:verbose]\n res = Process.kill('KILL', pid) rescue nil\n puts to_ok(res) if options[:verbose]\n end\n cleanup_certificates(options)\n\n # Resume option bypasses cloud state initialization so that we can\n # override the user data\n puts((options[:resume] ? 'Resuming' : 'Restarting') + ' RightLink daemon...') if options[:verbose]\n action = (options[:resume] ? 'resume' : 'start')\n res = system(\"/etc/init.d/rightlink #{action} > /dev/null\")\n end\n true\n end",
"title": ""
},
{
"docid": "52fd0793e1c6c1679644462fc107e0ad",
"score": "0.5243671",
"text": "def restart_cluster\n #stop balancing hbase tables in order to restart nodes\n run_balancer(false)\n\n region_servers.each { |region_server|\n unless move_regions(region_server) then\n raise \"unable to move regions #{region_server}\"\n end\n\n unless restart_region_server(region_server) then\n raise \"unable to restart RS #{region_server}\"\n end\n }\n\n run_balancer(true)\n end",
"title": ""
},
{
"docid": "d34a7cc3ec1b1dd5dd4e3b13bc732ae2",
"score": "0.52338994",
"text": "def restart(cart_name, options={})\n @cartridge_model.start_cartridge('restart', cart_name,\n user_initiated: true,\n out: options[:out],\n err: options[:err])\n end",
"title": ""
},
{
"docid": "72f43c9183674f2142ee7da579d4b080",
"score": "0.522673",
"text": "def restart\n raw \"RESTART\\r\\n\"\n end",
"title": ""
},
{
"docid": "92b8f89c9e8e5a488fbd2c524a96dfa8",
"score": "0.515015",
"text": "def restartservices(member_order=\"SEQUENTIALLY\", \n restart_option=\"RESTART_IF_NEEDED\", \n sequential_delay=15, \n service_option=\"DHCP\")\n\n post_body = {\n :member_order => member_order,\n :restart_option => restart_option,\n :sequential_delay => sequential_delay.to_i,\n :service_option => service_option\n }\n JSON.parse(connection.post(resource_uri + \"?_function=restartservices\", post_body).body);\n end",
"title": ""
},
{
"docid": "dd8f3dfad9445f9f053b08cf471e247d",
"score": "0.5146166",
"text": "def restart\n ensure_session\n ensure_cli\n IRB.irb_at_exit\n str = \"Restarting: `#{ENV['IRT_COMMAND']}`\"\n puts\n puts IRT.dye(\" #{str} \", \"*** #{str} ***\", :error_color, :bold, :reversed)\n puts\n exec ENV[\"IRT_COMMAND\"]\n end",
"title": ""
},
{
"docid": "3992cbedbaca33b4404afd19e26fb813",
"score": "0.5142619",
"text": "def restart_kubelet\n cmd = ['systemctl', 'restart', 'kubelet.service']\n stdout, stderr, status = Open3.capture3(*cmd)\n raise Puppet::Error, _(\"stderr: '%{stderr}'\" % { stderr: stderr }) if status != 0\n { status: stdout.strip }\nend",
"title": ""
},
{
"docid": "a7d8b462a6268b0990d63edf79621174",
"score": "0.5088476",
"text": "def restart!\n IbmCloudRest.post \"#{@uri}/_restart\"\n end",
"title": ""
},
{
"docid": "739563daec1d51449bc609763272898f",
"score": "0.50841504",
"text": "def restart_running_instances_services\n nodes.each do |node|\n node.restart_with_monit\n end\n end",
"title": ""
},
{
"docid": "4dde6cac4a27e8fb0725e1235f8e0dc4",
"score": "0.5075462",
"text": "def drb_restart!\n Vedeu.bind(:_drb_restart_) { Vedeu::Distributed::Server.restart }\n end",
"title": ""
},
{
"docid": "73f3f21398e1abb0de183887992b5450",
"score": "0.50662565",
"text": "def restart\n process = shift_argument\n validate_arguments!\n release = options[:version]\n\n message, options = case process\n when NilClass\n [\"Restarting processes\", { }]\n when /.+\\..+/\n ps = args.first\n [\"Restarting #{ps} process\", { :ps => ps }]\n else\n type = args.first\n [\"Restarting #{type} processes\", { :type => type }]\n end\n\n action(message) do\n api.post_ps_restart(app, options.merge(:release => release))\n end\n end",
"title": ""
},
{
"docid": "c3119c70f6af6f849d48f85142772ca7",
"score": "0.5062215",
"text": "def restart\n dyno = shift_argument\n validate_arguments!\n\n message, options = case dyno\n when NilClass\n [\"Restarting dynos\", {}]\n when /.+\\..+/\n ps = args.first\n [\"Restarting #{ps} dyno\", { :ps => ps }]\n else\n type = args.first\n [\"Restarting #{type} dynos\", { :type => type }]\n end\n\n action(message) do\n api.post_ps_restart(app, options)\n end\n end",
"title": ""
},
{
"docid": "09f65ac0a74570cf53bde23848c14df7",
"score": "0.50391316",
"text": "def restart_game_cmd\n msg_details = \"#{@ix_current_game}\"\n cmd_to_send = build_cmd(:restart_game, msg_details)\n send_data_to_server(cmd_to_send)\n end",
"title": ""
},
{
"docid": "34a405a61d6bf13793c3977f59b119b1",
"score": "0.50350106",
"text": "def restart(gear, component)\n args = build_base_gear_args(gear)\n cart = component.cartridge_name\n args = build_base_component_args(component, args)\n\n run_cartridge_command(cart, gear, \"restart\", args)\n end",
"title": ""
},
{
"docid": "802203c423bf79614d4ba4633234718f",
"score": "0.50272334",
"text": "def cmd_reboot(*args)\n force = 0\n\n if args.length == 1 and args[0].strip == \"-h\"\n print(\n \"Usage: reboot [options]\\n\\n\" +\n \"Reboot the remote machine.\\n\" +\n @@reboot_opts.usage)\n return true\n end\n\n @@reboot_opts.parse(args) { |opt, idx, val|\n case opt\n when \"-f\"\n force = val.to_i\n end\n }\n print_line(\"Rebooting...\")\n\n client.sys.power.reboot(force, SHTDN_REASON_DEFAULT)\n end",
"title": ""
},
{
"docid": "a033e9c67435c9c1f6fbadfdbce2479d",
"score": "0.5026143",
"text": "def restart\n # Permissions are handled by the script, use: :sudo => false\n run_script :stop, :sudo => false\n end",
"title": ""
},
{
"docid": "9f244649879433fc0957b4c083fadea8",
"score": "0.50251174",
"text": "def restart_service\n service 'consul-haproxy' do\n action :restart\n end\nend",
"title": ""
},
{
"docid": "9a960eca6c3ae225cb531dafdab05651",
"score": "0.50179565",
"text": "def restart\n if @time < @next_restart\n log.info \"synapse: at time #{@time} waiting until #{@next_restart} to restart\"\n return\n end\n\n @next_restart = @time + @restart_interval\n @next_restart += rand(@restart_jitter * @restart_interval + 1)\n\n # do the actual restart\n res = `#{opts['reload_command']}`.chomp\n unless $?.success?\n log.error \"failed to reload haproxy via #{opts['reload_command']}: #{res}\"\n return\n end\n log.info \"synapse: restarted nginx\"\n\n @restart_required = false\n end",
"title": ""
},
{
"docid": "f70d905b23dd5c34a07da412b30bb60e",
"score": "0.50128174",
"text": "def resume_replication\n raise \"This DB object has no master\" unless master\n repl_binlog_coordinates(true)\n output \"Resuming replication from #{@master}.\"\n output mysql_root_cmd \"START SLAVE\"\n @repl_paused = false\n end",
"title": ""
},
{
"docid": "538558c6260f70115ad0dfb6ea60018a",
"score": "0.50067544",
"text": "def restart(options={})\n response = service.restart_network( options.merge({'id'=> self.id}))\n service.jobs.new(response['restartnetworkresponse'])\n end",
"title": ""
},
{
"docid": "495bf0bb5716d8584cc34efdb48f5167",
"score": "0.5005041",
"text": "def action_restart\n proxy_action(:restart)\n end",
"title": ""
},
{
"docid": "5783f0d131b765a8d0eaba2e806cbf2d",
"score": "0.49812755",
"text": "def print_restart_host_msg(hostname)\n msg = \"#{'Restart'.red} all roles on #{hostname.yellow}\"\n FMT.puts_str(msg, true)\n end",
"title": ""
},
{
"docid": "89607d0a11b197a957e86a4f5c796829",
"score": "0.49767396",
"text": "def restart(*args)\n stop\n start\n end",
"title": ""
},
{
"docid": "beb7413e0ca499e065c74fdb9bf0ce9f",
"score": "0.49762726",
"text": "def restart!\n JobRestarter.restart(self)\n end",
"title": ""
},
{
"docid": "ace7f1837a414399fafa365d6443d2b2",
"score": "0.4975987",
"text": "def api_v11_cm_service_commands_restart_post(opts = {})\n api_v11_cm_service_commands_restart_post_with_http_info(opts)\n return nil\n end",
"title": ""
},
{
"docid": "eed8de64fd3dc3b7136b9a4fef607a38",
"score": "0.4973832",
"text": "def prepare_rolling_restart_for_rs(cm, cl, role_type)\n return unless role_type == 'REGIONSERVER'\n disable_hbase_balancer(cm, cl)\n @exp_file = %(/tmp/#{cm}_#{cl}_#{Time.new.strftime('%Y%m%d%H%M%S')}.exp)\n export_rs(cm, cl, @exp_file)\n end",
"title": ""
},
{
"docid": "d84b4bc14519c5ae06c07491219c8d3b",
"score": "0.49720478",
"text": "def restart(wait=nil, expected_exitcodes = [0])\n @logger.debug('restart()')\n\n if self.is_passthrough? and self.passthrough[:type].eql?(:local)\n @logger.warn(sprintf('intercepted [restart] sent to a local passthrough, no op'))\n return nil\n end\n\n if @vagrant_reboot\n # leading vagrant handle this through 'reload --no-provision'\n self.reload\n else\n # trying to do it ourselves\n case os_type\n when :osx\n self.run('shutdown -r now', expected_exitcodes)\n when :rhel, :ubuntu\n if os_type.eql?(:rhel) and os_version(os_type).match(/7/)\n self.run('shutdown --halt --reboot now', expected_exitcodes << 256)\n else\n self.run('shutdown -rf now')\n end\n when :solaris\n self.run('shutdown -y -i5 -g0', expected_exitcodes)\n else\n raise InternalError.new(sprintf('unsupported OS[%s]', @ostype))\n end\n end\n\n @ssh, @ssh_info = nil # severing the SSH tunnel, getting ready in case this box is brought back up on a different port\n\n if wait\n inc = wait.to_i / 10\n 0.upto(9) do |e|\n @logger.debug(sprintf('waiting for reboot: round[%s], step[%s], total[%s]', e, inc, wait))\n return true if self.is_available_via_ssh?()\n sleep inc\n end\n\n return false\n end\n\n return true\n end",
"title": ""
},
{
"docid": "e53bb229b85f84bdcad7a14710bf6159",
"score": "0.49515775",
"text": "def create_snmp_service_action_restart(opts = {})\n data, _status_code, _headers = create_snmp_service_action_restart_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "84e515842560829422ecbe75f2210b78",
"score": "0.494887",
"text": "def restart_failed_jobs\n res = Messaging::JobReview.restart_failed_jobs!\n\n flash.now[:notice] = \"Restarted #{res} #{'job'.pluralize(res)}\"\n index\n end",
"title": ""
},
{
"docid": "5dd5698e76353f04757595f88be8c5db",
"score": "0.4926653",
"text": "def restart_mon_daemon(agent)\n\n agent = get_model(agent, Agent)\n\n command = CommandSpec.new( :repo => \"vendor\", :bundle => \"system/monitoring\",\n :command => \"mon_daemon.rb\", :args => \"restart\" )\n\n return exec(agent, command)\n end",
"title": ""
},
{
"docid": "f30e1c68e179645a607be047a60888d1",
"score": "0.49112093",
"text": "def api_v11_clusters_cluster_name_commands_rolling_restart_post(cluster_name, opts = {})\n api_v11_clusters_cluster_name_commands_rolling_restart_post_with_http_info(cluster_name, opts)\n return nil\n end",
"title": ""
},
{
"docid": "25c668ff23e7dac439dd909a08db8688",
"score": "0.49062183",
"text": "def run_role(env_vars, extra_vars, role_name, roles_path:, role_skip_facts: true)\n run_via_cli(env_vars, extra_vars, :role_name => role_name, :roles_path => roles_path, :role_skip_facts => role_skip_facts)\n end",
"title": ""
},
{
"docid": "e437847283e1e18db1db7aa7b3985499",
"score": "0.4880495",
"text": "def create_liagent_service_action_restart(opts = {})\n data, _status_code, _headers = create_liagent_service_action_restart_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "48475c2ae33e36cb64fcad05cb724199",
"score": "0.4875137",
"text": "def ssh_service_restart\n case self['platform']\n when /debian|ubuntu|cumulus|huaweios/\n exec(Beaker::Command.new(\"service ssh restart\"))\n when /(el|centos|redhat|oracle|scientific)-[7-9]|eos-7|fedora-(1[4-9]|2[0-9]|3[0-9])|archlinux-/\n exec(Beaker::Command.new(\"systemctl restart sshd.service\"))\n when /el-|centos|fedora|redhat|oracle|scientific|eos/\n exec(Beaker::Command.new(\"/sbin/service sshd restart\"))\n when /opensuse|sles/\n exec(Beaker::Command.new(\"/usr/sbin/rcsshd restart\"))\n when /solaris/\n exec(Beaker::Command.new(\"svcadm restart svc:/network/ssh:default\"))\n when /(free|open)bsd/\n exec(Beaker::Command.new(\"sudo /etc/rc.d/sshd restart\"))\n else\n raise ArgumentError, \"Unsupported Platform: '#{self['platform']}'\"\n end\n end",
"title": ""
},
{
"docid": "42e3ad37cdb0797ad6340c67dcf19d33",
"score": "0.48682362",
"text": "def api_v11_clusters_cluster_name_services_service_name_role_commands_restart_post(service_name, cluster_name, opts = {})\n api_v11_clusters_cluster_name_services_service_name_role_commands_restart_post_with_http_info(service_name, cluster_name, opts)\n return nil\n end",
"title": ""
},
{
"docid": "6fbfb1a348ca74842a6b3a834541694a",
"score": "0.48672467",
"text": "def restart_or_shutdown_node_restart(opts = {})\n restart_or_shutdown_node_restart_with_http_info(opts)\n return nil\n end",
"title": ""
},
{
"docid": "f060926cf0dbcb83e7608de8429efec1",
"score": "0.48602712",
"text": "def revoke_roles(user, roles, options = nil)\n policy = create_policy(options, AdminPolicy, default_admin_policy)\n command = AdminCommand.new\n command.revoke_roles(@cluster, policy, user, roles)\n end",
"title": ""
},
{
"docid": "081b685d852a4b6fed6797a958da2fbd",
"score": "0.48582593",
"text": "def restart\n debug \"Call 'restart' for Pacemaker service '#{name}' on node '#{hostname}'\"\n if pacemaker_options[:restart_only_if_local] and not primitive_is_running? name, hostname\n info \"Pacemaker service '#{name}' is not running on node '#{hostname}'. Skipping restart!\"\n return\n end\n\n begin\n stop\n rescue\n debug 'The service have failed to stop! Trying to start it anyway...'\n ensure\n start\n end\n end",
"title": ""
},
{
"docid": "71306229af0c3f530a72a4b1c50d7ce3",
"score": "0.48358366",
"text": "def action_restart\n return if options['never_restart']\n action_stop\n action_start\n end",
"title": ""
},
{
"docid": "e5fb2305cf7b8e74631cca60d02a3587",
"score": "0.4833076",
"text": "def reconnect!(roles)\n @cluster.reset!\n @cluster.connect!(self.servers(roles))\n end",
"title": ""
},
{
"docid": "68f8ecd62f1cf6616f5203a748513d3e",
"score": "0.48101267",
"text": "def restart\n request('restart')\n end",
"title": ""
},
{
"docid": "7a4557176ed713c1e8d44547af9da3e8",
"score": "0.48096195",
"text": "def after_restart_role(cm, cl, hostname, role_type, role)\n case role_type\n when 'REGIONSERVER'\n import_rs(cm, cl, hostname, @exp_file)\n when 'JOURNALNODE'\n CM.hdfs_role_edits(cm, cl, role)\n when *CHK_RTYPES\n CM.check_ha_status(cm, cl, role)\n end\n CM.exit_maintenance_mode_role(cm, cl, role)\n end",
"title": ""
},
{
"docid": "df4dd394dc6fd28af9ac130c31b7f9f3",
"score": "0.48086652",
"text": "def create_cluster_boot_manager_service_action_restart(opts = {})\n data, _status_code, _headers = create_cluster_boot_manager_service_action_restart_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "f733dcba6a27221caa39884b3599ad7b",
"score": "0.47950345",
"text": "def api_v11_cm_service_role_commands_restart_post_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_cm_service_role_commands_restart_post ...\"\n end\n \n # resource path\n path = \"/api/v11/cm/service/roleCommands/restart\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\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 = []\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 = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_v11_cm_service_role_commands_restart_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "6066a13835d0bdb50001ecbe540ee0b2",
"score": "0.4791778",
"text": "def restart(cart_name)\n cart_model.do_control(\"restart\", cart_name)\n end",
"title": ""
},
{
"docid": "8dc6ed4c44d0198330d7f2596810bc63",
"score": "0.47916886",
"text": "def create_nsx_upgrade_agent_service_action_restart(opts = {})\n data, _status_code, _headers = create_nsx_upgrade_agent_service_action_restart_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "9ad48d22e14378407cda350c35c38d65",
"score": "0.47889385",
"text": "def create_repository_service_action_restart(opts = {})\n data, _status_code, _headers = create_repository_service_action_restart_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "3073932f23b8bf516e7c9afc1bd05a60",
"score": "0.4754788",
"text": "def run_cmd_with_retries(cmd, num_retries=5, sleep_seconds=2, timing_metric=nil)\n for i in 1..num_retries\n if i == num_retries then\n result = run_cmd(cmd, timing_metric)\n else\n result = run_cmd(cmd, timing_metric, false)\n end\n if result[:exit_code] == 0\n return result\n else\n retries_remaining = num_retries - i\n unless i == num_retries\n log_and_stream(\"`#{cmd}` failed, will retry #{retries_remaining} more times<br>\")\n sleep sleep_seconds\n end\n end\n end\n\n raise \"Unable to execute `#{cmd}` after retrying #{num_retries} times\"\n end",
"title": ""
},
{
"docid": "e13a3aa8562db058f45ae51c7ae7f140",
"score": "0.47514862",
"text": "def restart_component(gear, component)\n args = build_base_gear_args(gear)\n args = build_base_component_args(component, args)\n cart = component.cartridge_name\n\n run_cartridge_command(cart, gear, \"restart\", args)\n end",
"title": ""
},
{
"docid": "098e3c48cb4c4ee9c581ce632e383cc6",
"score": "0.47223464",
"text": "def init_command\n restart_winrm_service if config[:restart_winrm]\n end",
"title": ""
},
{
"docid": "91335105c0fb6bdf50be3e1bc250cc02",
"score": "0.4706715",
"text": "def restart\n running_nodes = get_running_nodes()\n\n puts \"Running nodes: #{running_nodes}\"\n\n if running_nodes.empty?\n start_node 1\n exit\n end\n\n if running_nodes.count > 1\n abort \"still restarting. try again after some minutes\"\n end\n\n running_node = running_nodes.first.to_i\n\n running_nodes[1..-1].each do |i|\n stop_node i\n end\n\n new_node = running_node == 1 ? 2 : 1\n start_node new_node\n\n puts \"Wait some seconds for starting new node\"\n sleep 10\n\n abort('cluster health is not green') unless wait_cluster_health_green()\n\n stop_node running_node\n\n puts \"Elasticsearch restarted successfully.\"\nend",
"title": ""
},
{
"docid": "e8eba9a53d2ad2e8dd35c08c87d53955",
"score": "0.47042596",
"text": "def restart\n invoke :stop, :all => input[:all], :apps => input[:apps]\n\n line unless quiet?\n\n input[:apps].each do |app|\n unless input[:command].nil?\n app.command = input[:command]\n end\n app.update!\n end\n\n invoke :start, :all => input[:all], :apps => input[:apps],\n :debug_mode => input[:debug_mode]\n end",
"title": ""
},
{
"docid": "88eb65c3819a866fa8a17a1fd075b121",
"score": "0.46974507",
"text": "def run_restart(options={}, &block)\n with_each_host { stop(options); start(options) }\n end",
"title": ""
},
{
"docid": "4eae52408ad22ccd6400acff30afb2d7",
"score": "0.4696997",
"text": "def restart(config = nil)\n config ||= agent&.config\n stop if running?\n start(config)\n end",
"title": ""
},
{
"docid": "a4330a1755ad3f8a7a5ed68364acdd20",
"score": "0.4689824",
"text": "def create_rabbit_mq_service_action_restart(opts = {})\n data, _status_code, _headers = create_rabbit_mq_service_action_restart_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "af638c197f4d0019a941072c6a3a8b9b",
"score": "0.46866107",
"text": "def restart_workers_on_latest\n send_status( 'Info', \"Stop and restart all running workers on latest revision\")\n @WORKERS.keys.each do |id|\n info= @WORKERS[id]\n if info['status']=='RUN' # WIP\n cmd= info['cmd'].clone\n #cmd['revision']= '_latest'\n #cmd['revision_small'] = '_latest'\n rev = find_revision( '_latest' )\n cmd['revision']= rev['revision']\n cmd['revision_small']= rev['revision_small']\n @TORESTART[id]= cmd\n manage_worker( { 'worker_id' => id, 'action' => 'QUIT' } )\n end\n end\n @RRESTART= false\n end",
"title": ""
},
{
"docid": "75783ebbc2acfad8348aa7646c271da2",
"score": "0.46860796",
"text": "def restart\n\tcall 'falcon:supervisor:restart'\nend",
"title": ""
},
{
"docid": "75783ebbc2acfad8348aa7646c271da2",
"score": "0.46860796",
"text": "def restart\n\tcall 'falcon:supervisor:restart'\nend",
"title": ""
},
{
"docid": "75783ebbc2acfad8348aa7646c271da2",
"score": "0.46860796",
"text": "def restart\n\tcall 'falcon:supervisor:restart'\nend",
"title": ""
},
{
"docid": "4e49cc030c349efd878e7d21a15237aa",
"score": "0.46832278",
"text": "def restart\n client.restart\n end",
"title": ""
},
{
"docid": "46077a68ba7c51879707f102aed65c2f",
"score": "0.46803525",
"text": "def reboot\n node.update!(alive: false)\n run(\"reboot\")\n end",
"title": ""
},
{
"docid": "212918563b3088ce5f0ed30919c9d83c",
"score": "0.46577477",
"text": "def handle_restart(event)\n @bus.request 'containers', 'restarted', event: event.json, container: container_info(event.id)\n end",
"title": ""
},
{
"docid": "1c1fc097c9076266ac550fe227d23aa4",
"score": "0.46564624",
"text": "def automatic_restart\n @automatic_restart = true if @automatic_restart.nil?\n @automatic_restart\n end",
"title": ""
},
{
"docid": "ce4e9a2211645b00468f870fc9022c57",
"score": "0.4649672",
"text": "def mixlib_shellout_command(cmd, args)\n retries = args[:allow_failure_retry].to_i\n cmd = [sudo, cmd].join(' ') if args[:sudo]\n shlout = nil\n begin\n shlout = Mixlib::ShellOut.new(cmd,\n :logger => defined?(Chef) && defined?(Chef::Log) ? Chef::Log.logger : log,\n :live_stream => args[:livestream] ? STDOUT : nil,\n :timeout => args[:timeout] || 1200,\n :environment => {'HOME' => detect_home}\n )\n shlout.run_command\n shlout.error!\n shlout\n rescue Mixlib::ShellOut::ShellCommandFailed, CommandFailed, Mixlib::ShellOut::CommandTimeout => e\n if(retries > 0)\n log.warn \"LXC run command failed: #{cmd}\"\n log.warn \"Retrying command. #{args[:allow_failure_retry].to_i - retries} of #{args[:allow_failure_retry].to_i} retries remain\"\n sleep(0.3)\n retries -= 1\n retry\n elsif(args[:allow_failure])\n false\n else\n raise CommandFailed.new(e, CommandResult.new(shlout))\n end\n end\n end",
"title": ""
},
{
"docid": "0aff6b78e16e48db33adebd170143e92",
"score": "0.4641911",
"text": "def retry_cluster_restore_retry(opts = {})\n data, _status_code, _headers = retry_cluster_restore_retry_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "6277cf0490d2cac66fb8ceb931f527db",
"score": "0.46337047",
"text": "def flag_hard_restart\n redis_path = `which redis-cli`.chomp\n if redis_path.empty?\n $stderr.puts 'SKIP: Cannot mark this deployment as a hard restart because \"redis-cli\" not available. ',\n 'Once the deployment is complete you can do a manual hard restart with:',\n \" $ ttmscalr restart all -f #{@farm_id}\"\n return 'SKIP'\n end\n redis_url = URI.parse(Scalr::Caller.variable_value('TTM_REDIS_URL', farm_id: @farm_id))\n\n # hardcoded, ignore the value in the URL b/c that's only valid within EC2\n host = 'proxy2.openredis.com'\n\n port = redis_url.port\n password = redis_url.password\n\n command = \"-h #{host} -p #{port} -a #{password} SET SCALR-ADMIN:DEPLOY:HARD:#{@farm_id} TRUE EX 300\"\n @verbose && puts(\"Marking deployment as hard restart with: #{redis_path} #{command}...\")\n result = `#{redis_path} #{command}`\n @verbose && puts(\"...results: #{result}\")\n result # if it works this is 'OK'\n end",
"title": ""
},
{
"docid": "49ad3356f3890d84af590a378135aae8",
"score": "0.46093833",
"text": "def create_syslog_service_action_restart(opts = {})\n data, _status_code, _headers = create_syslog_service_action_restart_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "cbab60cad66883bd6197dccf92e275d6",
"score": "0.46064496",
"text": "def api_v11_clusters_cluster_name_services_service_name_role_commands_restart_post_with_http_info(service_name, cluster_name, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi#api_v11_clusters_cluster_name_services_service_name_role_commands_restart_post ...\"\n end\n \n # verify the required parameter 'service_name' is set\n fail \"Missing the required parameter 'service_name' when calling api_v11_clusters_cluster_name_services_service_name_role_commands_restart_post\" if service_name.nil?\n \n # verify the required parameter 'cluster_name' is set\n fail \"Missing the required parameter 'cluster_name' when calling api_v11_clusters_cluster_name_services_service_name_role_commands_restart_post\" if cluster_name.nil?\n \n # resource path\n path = \"/api/v11/clusters/{clusterName}/services/{serviceName}/roleCommands/restart\".sub('{format}','json').sub('{' + 'serviceName' + '}', service_name.to_s).sub('{' + 'clusterName' + '}', cluster_name.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = []\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 = []\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 = []\n data, status_code, headers = @api_client.call_api(:POST, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#api_v11_clusters_cluster_name_services_service_name_role_commands_restart_post\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end",
"title": ""
},
{
"docid": "107f9a7cadca8ba13ba35a1a26c69258",
"score": "0.45871887",
"text": "def restart!\n CouchRest.post \"#{@uri}/_restart\"\n end",
"title": ""
},
{
"docid": "5395409e67fcb9252b2eb7be3b390deb",
"score": "0.45802674",
"text": "def redeploy(opts)\n client = opts.k8s.to_api\n patch = {\n spec: {\n template: {\n metadata: {\n annotations: {\n \"kubectl.kubernetes.io/restartedAt\" => Time.now.strftime('%Y-%m-%dT%H:%M:%S.%L%z')\n }\n }\n }\n }\n }\n\n client\n .api('apps/v1')\n .resource('deployments', namespace: opts[:k8s][:k8s_namespace])\n .merge_patch(opts[:k8s][:k8s_deployment], patch)\nend",
"title": ""
},
{
"docid": "705d19cf0fe393150f549b9f938dfcef",
"score": "0.45778197",
"text": "def run(purpose: \"Chef run\", update_runlist: true, max_retries: 5, output: true, override_runlist: nil, reboot_first_fail: false, timeout: 1800)\n self.class.loadChefLib\n if update_runlist and !@config['run_list'].nil?\n knifeAddToRunList(multiple: @config['run_list'])\n end\n\n chef_node = ::Chef::Node.load(@server.mu_name)\n if !@config['application_attributes'].nil?\n MU.log \"Setting node:#{@server.mu_name} application_attributes\", MU::DEBUG, details: @config['application_attributes']\n chef_node.normal['application_attributes'] = @config['application_attributes']\n chef_node.save\n end\n if !@config['groomer_variables'].nil?\n chef_node.normal['mu'] = @config['groomer_variables']\n chef_node.save\n end\n if @server.deploy.original_config.has_key?('parameters')\n MU.log \"Setting node:#{@server.mu_name} parameters\", MU::DEBUG, details: @server.deploy.original_config['parameters']\n chef_node.normal['mu_parameters'] = @server.deploy.original_config['parameters']\n chef_node.save\n end\n saveDeployData\n\n retries = 0\n try_upgrade = false\n output_lines = []\n error_signal = \"CHEF EXITED BADLY: \"+(0...25).map { ('a'..'z').to_a[rand(26)] }.join\n runstart = nil\n cmd = nil\n ssh = nil\n winrm = nil\n windows_try_ssh = false\n begin\n runstart = Time.new\n if !@server.windows? or windows_try_ssh\n MU.log \"Invoking Chef over ssh on #{@server.mu_name}: #{purpose}\"\n ssh = @server.getSSHSession(@server.windows? ? 1 : max_retries)\n if @server.windows?\n cmd = \"chef-client.bat --color || echo #{error_signal}\"\n elsif !@config[\"ssh_user\"].nil? and !@config[\"ssh_user\"].empty? and @config[\"ssh_user\"] != \"root\"\n upgrade_cmd = try_upgrade ? \"sudo curl -L https://chef.io/chef/install.sh | sudo version=#{MU.chefVersion} sh &&\" : \"\"\n cmd = \"#{upgrade_cmd} sudo chef-client --color || echo #{error_signal}\"\n else\n upgrade_cmd = try_upgrade ? \"curl -L https://chef.io/chef/install.sh | version=#{MU.chefVersion} sh &&\" : \"\"\n cmd = \"#{upgrade_cmd} chef-client --color || echo #{error_signal}\"\n end\n Timeout::timeout(timeout) {\n ssh.exec!(cmd) { |_ch, _stream, data|\n extra_logfile = if Dir.exist?(@server.deploy.deploy_dir)\n File.open(@server.deploy.deploy_dir+\"/log\", \"a\")\n end\n puts data\n output_lines << data\n extra_logfile.puts data.chomp if extra_logfile\n raise MU::Cloud::BootstrapTempFail if data.match(/REBOOT_SCHEDULED| WARN: Reboot requested:|Rebooting server at a recipe's request|Chef::Exceptions::Reboot/)\n if data.match(/#{error_signal}/)\n error_msg = \"\"\n clip = false\n output_lines.each { |chunk|\n chunk.split(/\\n/).each { |line|\n if !clip and line.match(/^========+/)\n clip = true\n elsif clip and line.match(/^Running handlers:/)\n break\n end\n\n if clip and line.match(/[a-z0-9]/)\n error_msg += line.gsub(/\\e\\[(\\d+)m/, '')+\"\\n\"\n end\n }\n }\n raise MU::Groomer::RunError, error_msg\n end\n }\n }\n else\n MU.log \"Invoking Chef over WinRM on #{@server.mu_name}: #{purpose}\"\n winrm = @server.getWinRMSession(haveBootstrapped? ? 2 : max_retries)\n if @server.windows? and @server.windowsRebootPending?(winrm)\n # Windows frequently gets stuck here\n if retries > 5\n @server.reboot(true)\n elsif retries > 3 \n @server.reboot\n end\n raise MU::Groomer::RunError, \"#{@server.mu_name} has a pending reboot\"\n end\n if try_upgrade\n pp winrm.run(\"Invoke-WebRequest -useb https://omnitruck.chef.io/install.ps1 | Invoke-Expression; Install-Project -version:#{MU.chefVersion} -download_directory:$HOME\")\n end\n output_lines = []\n cmd = \"c:/opscode/chef/bin/chef-client.bat --color\"\n if override_runlist\n cmd = cmd + \" -o '#{override_runlist}'\"\n end\n resp = nil\n Timeout::timeout(timeout) {\n resp = winrm.run(cmd) do |stdout, stderr|\n if stdout\n print stdout if output\n output_lines << stdout\n end\n if stderr\n MU.log stderr, MU::ERR\n output_lines << stderr\n end\n end\n }\n\n if resp.exitcode == 1 and output_lines.join(\"\\n\").match(/Chef Client finished/)\n MU.log output_lines.last\n elsif resp.exitcode != 0\n raise MU::Cloud::BootstrapTempFail if resp.exitcode == 35 or output_lines.join(\"\\n\").match(/REBOOT_SCHEDULED| WARN: Reboot requested:|Rebooting server at a recipe's request|Chef::Exceptions::Reboot/)\n raise MU::Groomer::RunError, output_lines.slice(output_lines.length-50, output_lines.length).join(\"\")\n end\n end\n rescue MU::Cloud::BootstrapTempFail\n MU.log \"#{@server.mu_name} rebooting from Chef, waiting then resuming\", MU::NOTICE\n\n sleep 30\n\n # weird failures seem common in govcloud\n if MU::Cloud::AWS.isGovCloud?(@config['region'])\n @server.reboot(true)\n sleep 30\n end\n retry\n rescue SystemExit, Timeout::Error, MU::Cloud::BootstrapTempFail, Net::HTTPServerException, HTTPClient::ConnectTimeoutError, WinRM::WinRMError, Net::SSH::AuthenticationFailed, Net::SSH::Disconnect, Net::SSH::ConnectionTimeout, Net::SSH::Proxy::ConnectError, Net::SSH::Exception, Errno::ECONNRESET, Errno::EHOSTUNREACH, Errno::ECONNREFUSED, Errno::EPIPE, SocketError, IOError => e\n begin\n ssh.close if !ssh.nil?\n rescue Net::SSH::Exception, IOError => e\n if @server.windows?\n MU.log \"Windows has probably closed the ssh session before we could. Waiting before trying again\", MU::DEBUG\n else\n MU.log \"ssh session to #{@server.mu_name} was closed unexpectedly, waiting before trying again\", MU::NOTICE\n end\n sleep 10\n rescue StandardError => e\n MU.log \"Error I don't recognize closing ssh tunnel\", MU::WARN, details: e.inspect\n end\n if e.instance_of?(MU::Groomer::RunError) and retries == 0 and max_retries > 1 and purpose != \"Base Windows configuration\"\n MU.log \"Got a run error, will attempt to install/update Chef Client on next attempt\", MU::NOTICE\n try_upgrade = true\n else\n try_upgrade = false\n end\n\n if e.is_a?(MU::Groomer::RunError)\n if reboot_first_fail\n try_upgrade = true\n begin\n preClean(true) # drop any Chef install that's not ours\n @server.reboot # try gently rebooting the thing\n rescue StandardError => e # it's ok to fail here (and to ignore failure)\n MU.log \"preclean err #{e.inspect}\", MU::ERR\n end\n reboot_first_fail = false\n end\n end\n\n if retries < max_retries\n retries += 1\n MU.log \"#{@server.mu_name}: Chef run '#{purpose}' failed after #{Time.new - runstart} seconds, retrying (#{retries}/#{max_retries})\", MU::WARN, details: e.message.dup\n# if purpose != \"Base Windows configuration\"\n# windows_try_ssh = !windows_try_ssh\n# end\n if e.is_a?(WinRM::WinRMError)\n if @server.windows? and retries >= 3 and retries % 3 == 0\n # Mix in a hard reboot if WinRM isn't answering\n @server.reboot(true)\n end\n end\n sleep 30\n retry\n else\n @server.deploy.sendAdminSlack(\"Chef run '#{purpose}' failed on `#{@server.mu_name}` :crying_cat_face:\", msg: e.message)\n raise MU::Groomer::RunError, \"#{@server.mu_name}: Chef run '#{purpose}' failed #{max_retries} times, last error was: #{e.message}\"\n end\n rescue StandardError => e\n @server.deploy.sendAdminSlack(\"Chef run '#{purpose}' failed on `#{@server.mu_name}` :crying_cat_face:\", msg: e.inspect)\n raise MU::Groomer::RunError, \"Caught unexpected #{e.inspect} on #{@server.mu_name} in @groomer.run at #{e.backtrace[0]}\"\n\n end\n\n saveDeployData\n end",
"title": ""
},
{
"docid": "c9de985ce705e8946ec38a82f1783bb7",
"score": "0.45725942",
"text": "def restart\n puts \"\\n\\n project:\"\n puts ' command: restart'\n puts \" name: #{File.basename(root_dir)}\"\n puts \"\\n docker-machine:\"\n puts \" name: #{project_config['docker-machine']['name']}\"\n unless vm_running?\n puts ' status: NOT running '\n puts \"\\n\\n docker-machine not even running - thus do regular start\\n\\n\"\n start\n else\n puts ' status: running '\n puts \"\\n docker-compose:\"\n puts \" service: #{project_config['docker-compose']['service']}\"\n unless service_running?\n puts ' status: NOT running '\n puts \"\\n\\n service not even running - thus do regular start\\n\\n\"\n start\n else\n puts \" status: restarting... \\n\\n\"\n exec(\"#{setup_docker_env_vars_str} docker-compose restart\")\n end\n end\nend",
"title": ""
},
{
"docid": "64f893c90056d14e2cb0690ed7fea857",
"score": "0.45569772",
"text": "def restart(pid=nil)\n `cp #{APP_ROOT}/services/drb.log #{APP_ROOT}/services/drb.bak`\n `cp #{APP_ROOT}/services/dico.log #{APP_ROOT}/services/dico.bak`\n if !pid.nil?\n pid.each {|x| `kill -1 #{x}`}\n sleep(1)\n end\n `cd #{APP_ROOT};#{WHICH_RAKE} #{RAKE_FILE}[#{SHARD_ID},#{MAX_SHARD}] >#{APP_ROOT}/services/drb.log 2>&1 &`\n puts \"## Restarted\"\nend",
"title": ""
},
{
"docid": "d81ec6a1be8cde7056e5fc2f166a3f4f",
"score": "0.4542653",
"text": "def create_nsx_message_bus_service_action_restart(opts = {})\n data, _status_code, _headers = create_nsx_message_bus_service_action_restart_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "1998bb1982393c5db9bda14f8749e7d2",
"score": "0.45370132",
"text": "def restart # :nodoc:\n put :restart\n end",
"title": ""
},
{
"docid": "8ca6298568dee5e4cdf892c94c5589ba",
"score": "0.45259252",
"text": "def grant_roles(user, roles, options = nil)\n policy = create_policy(options, AdminPolicy, default_admin_policy)\n command = AdminCommand.new\n command.grant_roles(@cluster, policy, user, roles)\n end",
"title": ""
},
{
"docid": "5cf2ffd012b7a34ec26c6ce307abfd66",
"score": "0.45208684",
"text": "def run_command(jbosscmd, runasdomain, ctrlcfg, retry_count, retry_timeout)\n @cli_executor.run_command(jbosscmd, runasdomain, ctrlcfg, retry_count, retry_timeout)\n end",
"title": ""
},
{
"docid": "1e6e62af7ecdc101d4dc541b39897d84",
"score": "0.45133495",
"text": "def restart(inode)\n logger.info(\"machine.restart\")\n raise Exceptions::NotImplemented\n end",
"title": ""
},
{
"docid": "8c6672b9556f06c5c8c61bbaefbea08d",
"score": "0.44930908",
"text": "def create_appliance_management_service_action_restart(opts = {})\n create_appliance_management_service_action_restart_with_http_info(opts)\n return nil\n end",
"title": ""
},
{
"docid": "d0ec5011bab9ab57b4550048fa255393",
"score": "0.44814774",
"text": "def create_cminventory_service_action_restart(opts = {})\n data, _status_code, _headers = create_cminventory_service_action_restart_with_http_info(opts)\n return data\n end",
"title": ""
},
{
"docid": "cdd13c923b7893d5d2be648b85d621d3",
"score": "0.44572014",
"text": "def before_restart_role(cm, cl, hostname, role_type, role)\n CM.enter_maintenance_mode_role(cm, cl, role)\n\n case role_type\n when 'REGIONSERVER'\n empty_rs(cm, cl, hostname, @exp_file)\n when 'NAMENODE'\n nns = CM.nameservices_assigned_nn(cm, cl, role)\n nns.each { |nn| CM.failover_nn(cm, cl, role, nn) }\n end\n end",
"title": ""
},
{
"docid": "13406c79c9aa400236f5b4ec2eea4f82",
"score": "0.4450955",
"text": "def restart()\n shutdown()\n start()\n end",
"title": ""
},
{
"docid": "61b4a4ba04bf550d600ad5ab194c2adb",
"score": "0.44508734",
"text": "def patch_namespaced_role(name, namespace, body, opts = {})\n data, _status_code, _headers = patch_namespaced_role_with_http_info(name, namespace, body, opts)\n return data\n end",
"title": ""
},
{
"docid": "0084082ae44d853bfc0f9dfa78e1f8c8",
"score": "0.44440264",
"text": "def run(args)\n\n dbgr = @proc.dbgr\n argv = dbgr.restart_argv\n if argv and argv.size > 0\n @proc.run_cmd(%w(show args))\n if not confirm('Restart (exec)?', false)\n msg \"Restart not confirmed\"\n else\n if defined?(Trepan::PROG_UNRESOLVED_SCRIPT) &&\n position = argv.index(Trepan::PROG_UNRESOLVED_SCRIPT)\n save_filename = @proc.save_commands(:erase =>true)\n argv.insert(position, '--command', save_filename) if save_filename\n end\n Dir.chdir(RubyVM::OS_STARTUP_DIR)\n msg 'Restarting using...'\n msg \"\\t #{argv.inspect}\"\n @proc.finalize\n exec(*argv)\n end\n else\n errmsg(\"No executable file and command options recorded.\")\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.