query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
5b0c32dad1f2f2931ee751d8d9377950
Defining the instance method
[ { "docid": "ba772a78e80d732cf482257c10cf56d7", "score": "0.0", "text": "def convert(number)\n drops = drops(number)\n#Here the check and return if no drop is get. As the test request \n drops.empty? ? number.to_s : drops\n end", "title": "" } ]
[ { "docid": "b5b25700e97a3ff8649acd443cb60f46", "score": "0.7670076", "text": "def instance; end", "title": "" }, { "docid": "b5b25700e97a3ff8649acd443cb60f46", "score": "0.7670076", "text": "def instance; end", "title": "" }, { "docid": "b5b25700e97a3ff8649acd443cb60f46", "score": "0.7670076", "text": "def instance; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7602081", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7602081", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7602081", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7602081", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7602081", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7602081", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7602081", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7602081", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7602081", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7602081", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7602081", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7602081", "text": "def method; end", "title": "" }, { "docid": "357ce4398dc853fd511c56f0ec15bf3f", "score": "0.72897184", "text": "def instance_method(p0) end", "title": "" }, { "docid": "72b8dbb36cc3e89ba6e1186c62caddd5", "score": "0.71863043", "text": "def method_of_instance; end", "title": "" }, { "docid": "72b8dbb36cc3e89ba6e1186c62caddd5", "score": "0.71863043", "text": "def method_of_instance; end", "title": "" }, { "docid": "72b8dbb36cc3e89ba6e1186c62caddd5", "score": "0.71863043", "text": "def method_of_instance; end", "title": "" }, { "docid": "72b8dbb36cc3e89ba6e1186c62caddd5", "score": "0.71863043", "text": "def method_of_instance; end", "title": "" }, { "docid": "f4ad13bf5fa71b1e7bc47220336ffdbf", "score": "0.7139969", "text": "def methods() end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.7060447", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.7060447", "text": "def implementation; end", "title": "" }, { "docid": "1e5e53c4b9e93d9482caa25c8f435412", "score": "0.69641906", "text": "def methods; end", "title": "" }, { "docid": "1e5e53c4b9e93d9482caa25c8f435412", "score": "0.69641906", "text": "def methods; end", "title": "" }, { "docid": "1e5e53c4b9e93d9482caa25c8f435412", "score": "0.69641906", "text": "def methods; end", "title": "" }, { "docid": "1e5e53c4b9e93d9482caa25c8f435412", "score": "0.69641906", "text": "def methods; end", "title": "" }, { "docid": "3923598cefdb39ff94e39293456a9cf0", "score": "0.68231714", "text": "def call\n # implement in subclasses\n end", "title": "" }, { "docid": "31e801a93dc2fdf9be17a4b890837c5a", "score": "0.6807796", "text": "def public_method; end", "title": "" }, { "docid": "ae32f4a266db6d6dc2cc1873f83c6407", "score": "0.68049115", "text": "def class() end", "title": "" }, { "docid": "73c74e6dd2dc52a56f5258bfdeea60b7", "score": "0.675286", "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": "ec09ae8bbc36a364f7e939cc96fda48e", "score": "0.6744396", "text": "def instance_methods; end", "title": "" }, { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.6714371", "text": "def private; end", "title": "" }, { "docid": "a02f7382c73eef08b14f38d122f7bdb9", "score": "0.6708443", "text": "def custom; end", "title": "" }, { "docid": "a02f7382c73eef08b14f38d122f7bdb9", "score": "0.6708443", "text": "def custom; end", "title": "" }, { "docid": "65dba056d32de9c861cc379ba7a95a1d", "score": "0.66884553", "text": "def run; new.run; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.66710573", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.66710573", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.66710573", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.66710573", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.66710573", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.66710573", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.66710573", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.66710573", "text": "def call; end", "title": "" }, { "docid": "c71f6380fcb5044dcbb5af8270e9d120", "score": "0.6667234", "text": "def instance_helper\n\tend", "title": "" }, { "docid": "03c72e096aad5a42e4f413347d705f15", "score": "0.6665071", "text": "def member; end", "title": "" }, { "docid": "03c72e096aad5a42e4f413347d705f15", "score": "0.6665071", "text": "def member; end", "title": "" }, { "docid": "03c72e096aad5a42e4f413347d705f15", "score": "0.6665071", "text": "def member; end", "title": "" }, { "docid": "03c72e096aad5a42e4f413347d705f15", "score": "0.6665071", "text": "def member; end", "title": "" }, { "docid": "03c72e096aad5a42e4f413347d705f15", "score": "0.6665071", "text": "def member; end", "title": "" }, { "docid": "0a556b1952ad83e39c4a887f1f85e9bc", "score": "0.6661235", "text": "def method\n\t\t# code code\n\tend", "title": "" }, { "docid": "d3a34dba79236515757017e04b594083", "score": "0.6629116", "text": "def an_instance_method\n puts \"I am an instance method\"\n end", "title": "" }, { "docid": "99dec1a4844ea6183089a60139ebf720", "score": "0.6582789", "text": "def invoke\n raise NotImplementedError, \"Author of subclass forgot to implement #invoke\"\n end", "title": "" }, { "docid": "adc143d9921490a32ce81e2ec1b81602", "score": "0.6580974", "text": "def invoke; end", "title": "" }, { "docid": "8e95772a68908d578016ef7dd60ba1b7", "score": "0.6565174", "text": "def instance_eval\n end", "title": "" }, { "docid": "39f24f36e9483ba519892ab0c0b2268a", "score": "0.6562373", "text": "def express(instance)\n instance.define_singleton_method(@name) {|input|\n input\n }\n end", "title": "" }, { "docid": "124722fdb45c95f2b392bd78c6a4ca12", "score": "0.6556891", "text": "def method_missing(method_name, *args, &block)\n instance.send(method_name, *args, &block)\n end", "title": "" }, { "docid": "8eef25bd58747263a5e45e8143109b59", "score": "0.6540843", "text": "def call\n raise \"Must subclass and implement call\"\n end", "title": "" }, { "docid": "530e65cba197567f73b8125444ac33cc", "score": "0.65130645", "text": "def private_method\n end", "title": "" }, { "docid": "fecf59d5d23250edbaec8d6451073a41", "score": "0.64513165", "text": "def invoking\n end", "title": "" }, { "docid": "6199333fb432af38c8abaadcbc60a77e", "score": "0.6417229", "text": "def call\n\n\tend", "title": "" }, { "docid": "6199333fb432af38c8abaadcbc60a77e", "score": "0.6417229", "text": "def call\n\n\tend", "title": "" }, { "docid": "86b148116d711568dde55e2946e2464d", "score": "0.64142394", "text": "def method=(_); end", "title": "" }, { "docid": "addf120537f84d1b97d47e71399edeb1", "score": "0.6402294", "text": "def methods=(_arg0); end", "title": "" }, { "docid": "410acce3aabbb7b9adf35f889c493a83", "score": "0.6400465", "text": "def method\r\nend", "title": "" }, { "docid": "6a6ed5368f43a25fb9264e65117fa7d1", "score": "0.6384503", "text": "def internal; end", "title": "" }, { "docid": "126c2c552b724e98ef167fa2195be768", "score": "0.63783973", "text": "def overload; end", "title": "" }, { "docid": "64875541f8c42bdd60f0a7e3f539b0ba", "score": "0.6369577", "text": "def delegating_method; end", "title": "" }, { "docid": "e463976863461b169143d4eb53112fd5", "score": "0.6362444", "text": "def instances; end", "title": "" }, { "docid": "e463976863461b169143d4eb53112fd5", "score": "0.6362444", "text": "def instances; end", "title": "" }, { "docid": "3ed4cb54f2bc36108e18988abc2c1d85", "score": "0.6333122", "text": "def instance_variables() end", "title": "" }, { "docid": "6ffcbe25c8660e65fe3b24a876d58f35", "score": "0.6326793", "text": "def object; end", "title": "" }, { "docid": "6ffcbe25c8660e65fe3b24a876d58f35", "score": "0.6326793", "text": "def object; end", "title": "" }, { "docid": "6ffcbe25c8660e65fe3b24a876d58f35", "score": "0.6326793", "text": "def object; end", "title": "" }, { "docid": "6ffcbe25c8660e65fe3b24a876d58f35", "score": "0.6326793", "text": "def object; end", "title": "" }, { "docid": "6ffcbe25c8660e65fe3b24a876d58f35", "score": "0.6326793", "text": "def object; end", "title": "" }, { "docid": "6ffcbe25c8660e65fe3b24a876d58f35", "score": "0.6326793", "text": "def object; end", "title": "" }, { "docid": "6ffcbe25c8660e65fe3b24a876d58f35", "score": "0.6326793", "text": "def object; end", "title": "" }, { "docid": "6ffcbe25c8660e65fe3b24a876d58f35", "score": "0.6326793", "text": "def object; end", "title": "" }, { "docid": "6ffcbe25c8660e65fe3b24a876d58f35", "score": "0.6326793", "text": "def object; end", "title": "" }, { "docid": "6ffcbe25c8660e65fe3b24a876d58f35", "score": "0.6326793", "text": "def object; end", "title": "" }, { "docid": "6ffcbe25c8660e65fe3b24a876d58f35", "score": "0.6326793", "text": "def object; end", "title": "" }, { "docid": "6ffcbe25c8660e65fe3b24a876d58f35", "score": "0.6326793", "text": "def object; end", "title": "" }, { "docid": "6ffcbe25c8660e65fe3b24a876d58f35", "score": "0.6326793", "text": "def object; end", "title": "" }, { "docid": "6ffcbe25c8660e65fe3b24a876d58f35", "score": "0.6326793", "text": "def object; end", "title": "" }, { "docid": "6ffcbe25c8660e65fe3b24a876d58f35", "score": "0.6326793", "text": "def object; end", "title": "" }, { "docid": "bf55bc7eaf18d56cb23fc1d7b4ba7bed", "score": "0.6304945", "text": "def public; end", "title": "" }, { "docid": "bf55bc7eaf18d56cb23fc1d7b4ba7bed", "score": "0.6304945", "text": "def public; end", "title": "" }, { "docid": "8a391425187ceff6461e558601ca3c06", "score": "0.6276191", "text": "def method_one; end", "title": "" }, { "docid": "1a06a82b192ab1301c15c1f5243d9df7", "score": "0.62677073", "text": "def method=(_arg0); end", "title": "" }, { "docid": "1a06a82b192ab1301c15c1f5243d9df7", "score": "0.62677073", "text": "def method=(_arg0); end", "title": "" }, { "docid": "1a06a82b192ab1301c15c1f5243d9df7", "score": "0.62677073", "text": "def method=(_arg0); end", "title": "" }, { "docid": "9fb89e95341b5efa134eff27f4faccaa", "score": "0.62648237", "text": "def member\n super\n end", "title": "" }, { "docid": "9fb89e95341b5efa134eff27f4faccaa", "score": "0.62648237", "text": "def member\n super\n end", "title": "" }, { "docid": "4fc848bc851b85c0155842e2c413fc41", "score": "0.6260488", "text": "def call() end", "title": "" }, { "docid": "baa73a1d90b9661854bcf49c89f19ce8", "score": "0.62483424", "text": "def run(*)\n raise NotImplementedError, \"Expected #{self.class} to implement ##{__method__}\"\n end", "title": "" }, { "docid": "c27e66a40feb5fdbe5a8ba0097d5cf00", "score": "0.6247513", "text": "def my_fare\n\traise NotImplementedError,\n\t \"This class #{self.class.to_s} can not respond to the method::: #{__method__.to_s}\"\n end", "title": "" }, { "docid": "bd395ef5570ec94ad67ca3120a943fca", "score": "0.6243329", "text": "def operation; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.6236581", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.6236581", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.6236581", "text": "def specie; end", "title": "" } ]
9a6732fe4cb472aaa22dd0390ea22a47
Returns the datespecific liquid attributes
[ { "docid": "9af0d2a1ff5dd829761a049a48532758", "score": "0.79064023", "text": "def liquid_date_attributes\n date_format = self.site.config['date_format']\n date_attributes = {}\n date_attributes['date_formatted'] = format_date(self.data['date'], date_format) if self.data.has_key?('date')\n date_attributes['updated_formatted'] = format_date(self.data['updated'], date_format) if self.data.has_key?('updated')\n\n date_attributes['date_archive'] = format_date_archive(self.data['date'])\t if self.data.has_key?('date')\n\n date_attributes\n end", "title": "" } ]
[ { "docid": "9989e58cfa7f3a521cd34a3440777a51", "score": "0.78392446", "text": "def liquid_date_attributes\n date_format = self.site.config['date_format']\n date_attributes = {}\n date_attributes['date_formatted'] = format_date(self.data['date'], date_format) if self.data.has_key?('date')\n date_attributes['updated_formatted'] = format_date(self.data['updated'], date_format) if self.data.has_key?('updated')\n date_attributes\n end", "title": "" }, { "docid": "464c9b42c25e2e4e5c8da3de6438928c", "score": "0.78172535", "text": "def liquid_date_attributes\n date_format = self.site.config['date_format']\n date_attributes = {}\n\n date_attributes['date_formatted'] = l format_date(self.data['date'], date_format) if self.data.has_key?('date')\n date_attributes['updated_formatted'] = l format_date(self.data['updated'], date_format) if self.data.has_key?('updated')\n\n date_attributes\n end", "title": "" }, { "docid": "e7c7a9b83af20f5edc8a7580adc92278", "score": "0.6540423", "text": "def attributes\n @atts ||= {\n title: title,\n note: note,\n price_in_local_currency: price_in_local_currency,\n price_in_usd: price_in_usd,\n }\n end", "title": "" }, { "docid": "1796421cfcdc759077ad088559645b59", "score": "0.63794726", "text": "def date_attribute_get(instance, name)\n if value = instance.send(:\"formatted_#{name}\")\n { name => value, \"formatted_#{name}\" => value }\n else\n {}\n end\n end", "title": "" }, { "docid": "05b3052bc394cc1c51587eba4f5c7fc1", "score": "0.6146729", "text": "def date\n attributes[\"date\"]\n end", "title": "" }, { "docid": "e72ed7f0f3fc57fddd94b627a2d82eaa", "score": "0.6054424", "text": "def date\n @attributes[:date]\n end", "title": "" }, { "docid": "e72ed7f0f3fc57fddd94b627a2d82eaa", "score": "0.6054424", "text": "def date\n @attributes[:date]\n end", "title": "" }, { "docid": "a4c2e361e055bf42e914b59aaaca4dd4", "score": "0.59782207", "text": "def attributes\n %i[start_date end_date]\n end", "title": "" }, { "docid": "196df47e68d4c1937d85d5fab2bfe221", "score": "0.5960555", "text": "def page_attributes\n pattr = []\n unless brewery.nil?\n pattr << \"Brewery: #{brewery.title}\"\n end\n pattr << \"ABV: #{\"%.1f\" % abv}%\" unless abv.to_s.empty?\n unless original_gravity.to_s.empty?\n pattr << \"Original Gravity: #{original_gravity}\"\n end\n unless final_gravity.to_s.empty?\n pattr << \"Final Gravity: #{final_gravity}\"\n end\n pattr << \"Style: #{style.title}\"\n pattr\n end", "title": "" }, { "docid": "e20f2972dbff34c2f84fa07e9bd7cec9", "score": "0.5917997", "text": "def externalize\n self.attributes.inject({}) do |memo, a| \n if a[0] == \"release_date\"\n memo[a[0]] = Time.at(a[1]).to_s(:db)\n else\n memo[a[0]] = a[1]\n end\n memo\n end\n end", "title": "" }, { "docid": "bb3cddb3b1bcc20eabe4dcaf0e7722e6", "score": "0.5907579", "text": "def elements\n [\n DiaryDateElement.new(:datetime, 'Effective date'),\n DiaryElement.new(:content),\n ]\n end", "title": "" }, { "docid": "af57d0f28c20c429fcf192a120ed33ce", "score": "0.587482", "text": "def place_ge_entry_attributes\n attributes.except('id').except('time_of_scrape')\n end", "title": "" }, { "docid": "beb01847dcd0f1ed422b30c26b67c622", "score": "0.5856789", "text": "def attributes\n attrs = %w[emission_date expiry_date client voucher_type sale_condition\n net_amount iva_amount total_amount ucrm contabilium notes]\n\n attrs.map do |a|\n I18n.t(\".activerecord.attributes.invoice.#{a}\")\n end\n end", "title": "" }, { "docid": "f8e1d326421689b93a7adc8e5d6c73f7", "score": "0.5851514", "text": "def datetime_attribute_get(instance, name)\n if value = instance.send(:\"formatted_#{name}\")\n { name => value, \"formatted_#{name}\" => value }\n else\n {}\n end\n end", "title": "" }, { "docid": "5ca8391ddcaed998f340fe18c5db4eac", "score": "0.5848335", "text": "def date_fields\n return [:air_date, :off_air_date]\n end", "title": "" }, { "docid": "4ea08f1cfc67c24148d1278e78495af0", "score": "0.58444244", "text": "def sell_date\n attributes[\"selldate\"]\n end", "title": "" }, { "docid": "225b2afa3ea7d7e47afdae822526f7c2", "score": "0.58321184", "text": "def attributes\n %i[id date description splits]\n end", "title": "" }, { "docid": "5454d739a3f35ae0d743d639d8722ab1", "score": "0.58050066", "text": "def attributes\r\n { \r\n title: nil, type: nil, email: nil, \r\n address: nil, phone_number: nil, \r\n rate_per_night: nil, max_guests: nil, \r\n step: nil \r\n }\r\n end", "title": "" }, { "docid": "59a855f0e769f763c0535679024ce138", "score": "0.5799083", "text": "def attributes_for_expense_entry\n { date: self.transaction_date,\n description: cc_description,\n unit_cost: self.gbp_amount, qty: 1, vat: 0 }\n end", "title": "" }, { "docid": "cb02291e6848c7ef1e8b7886f122bc16", "score": "0.57958436", "text": "def attributes\n @_attributes ||= page.definition.fetch(\"fixed_attributes\", {}).symbolize_keys\n end", "title": "" }, { "docid": "3000f69dd38d7e9346fa4c8ff91204a1", "score": "0.5794517", "text": "def request_date_elements\n { ActualDateFrom: DateFormatting.to_xml_date_format(actual_date.presence || actual_date_from),\n ActualDateTo: DateFormatting.to_xml_date_format(actual_date.presence || actual_date_to),\n EffectiveDateFrom: DateFormatting.to_xml_date_format(effective_date.presence || effective_date_from),\n EffectiveDateTo: DateFormatting.to_xml_date_format(effective_date.presence || effective_date_to) }\n end", "title": "" }, { "docid": "554f67c92cb9939d29f56be7833ff61d", "score": "0.57923573", "text": "def get_attrs\n {\n feed: @feed,\n user_image: @user_image,\n user_email: @user_email,\n category: @category,\n site: @site,\n user_id: @user.id,\n stock_images: @stock_images\n }\n end", "title": "" }, { "docid": "f649a1916f4ccadda1b76860f3e1378a", "score": "0.5779321", "text": "def valid_attributes\n {\n start_date: Date.new(2013, 01, 20),\n end_date: Date.new(2013, 02, 20),\n onsite: false,\n name: \"Early\",\n competitor_expense_item_attributes: {\n cost: @comp_exp.cost,\n tax: @comp_exp.tax\n },\n noncompetitor_expense_item_attributes: {\n cost: @noncomp_exp.cost,\n tax: @noncomp_exp.tax,\n }\n }\n end", "title": "" }, { "docid": "5efbbdfacf21173ebfefca63165d3055", "score": "0.57569605", "text": "def available_custom_fields(story)\n #iterates over story hash and returns custom attributes with data\n story.attrs['fields'].each do |field_name, value|\n if field_name == 'duedate'\n puts field_name\n puts value\n end\n end\n nil\nend", "title": "" }, { "docid": "dc50bfd385a64bd3fea7d4930cd7a89c", "score": "0.57450217", "text": "def dct_temporal_dates\n items = @resource.datacite_dates.map(&:date).reject(&:blank?)\n items.map! do |dt|\n\n Date.iso8601(dt)&.strftime('%Y-%m-%d')\n rescue ArgumentError\n nil\n\n end\n items.compact\n\n # the below is the old stuff. We don't have ranges in our dates.\n # items = dates.map(&:to_s).compact\n # year_range_items = dates.map do |i|\n # (i.range_start.year..i.range_end.year).to_a.map(&:to_s) if i.range_start && i.range_end && i.range_start.year && i.range_end.year\n # end\n # (items + year_range_items).compact.flatten.uniq\n end", "title": "" }, { "docid": "60558a047df3abf83d082e7bc184e2dc", "score": "0.57421136", "text": "def attributes\n {\n charge_id: charge_from_row.id,\n at_time: next_at_time,\n period: period,\n amount: amount,\n }\n end", "title": "" }, { "docid": "961ee8ff1e2e5bf97c25c0e68dacd171", "score": "0.5688653", "text": "def the_date(item)\n\t\tDATE_TAGS.each do |tag|\n\t\t\treturn item[tag] if\\\n\t\t\t\titem.has_key?(tag)\n\t\tend\n\tend", "title": "" }, { "docid": "b2520c70bd22b86b3b3dde06b5d50dcd", "score": "0.56838524", "text": "def day_fields\n []\n end", "title": "" }, { "docid": "0fd4979b4868d50402d97921b474a7cb", "score": "0.5652651", "text": "def attributes\n {\n id: nil,\n x: x,\n y: y,\n title: title,\n price: price,\n description: description,\n beds: beds,\n baths: baths,\n squareMeters: squareMeters,\n provinces: nil\n }\n end", "title": "" }, { "docid": "fac2afd58bebd489e3b82913ca10cb9a", "score": "0.5650692", "text": "def attributes(*args)\n hash = super\n hash.each do |key, value|\n format_time!(hash, key, value)\n format_money!(hash, key, value)\n end\n end", "title": "" }, { "docid": "90b2703ce9ccb96f3826f6494b8a6922", "score": "0.5634967", "text": "def attributes()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "90b2703ce9ccb96f3826f6494b8a6922", "score": "0.5634967", "text": "def attributes()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "6a6faee5302ceb49fe27a254dc523132", "score": "0.56322557", "text": "def attributes_for_active_record\n { \n :date => @timestamp.to_s, \n :rmr => @rmr_number, \n :path => @visit_directory, \n :scanner_source => @scanner_source ||= get_scanner_source,\n :scan_number => @exam_number,\n :dicom_study_uid => @study_uid\n }\n end", "title": "" }, { "docid": "4fb3b8c9d57b19ee285dca588c0b962d", "score": "0.56271774", "text": "def stream_attributes\n slice(\n :legacy_opt_in_approved,\n :receipt_date,\n :veteran_file_number,\n :veteran_is_not_claimant,\n :establishment_submitted_at,\n :establishment_processed_at,\n :establishment_attempted_at,\n :establishment_last_submitted_at\n )\n end", "title": "" }, { "docid": "c19eb00060f21b67aade8575a6146efa", "score": "0.5618267", "text": "def to_liquid\n return [\n 'id' => self.id,\n 'title' => self.title,\n 'description' => self.description,\n 'primary' => self.primary,\n 'slug' => self.slug,\n 'date_update' => self.date_update,\n ]\n end", "title": "" }, { "docid": "826c08ab4be137d8c693bfcc9e781664", "score": "0.56141543", "text": "def attributes\n data[:attributes]\n end", "title": "" }, { "docid": "826c08ab4be137d8c693bfcc9e781664", "score": "0.56141543", "text": "def attributes\n data[:attributes]\n end", "title": "" }, { "docid": "826c08ab4be137d8c693bfcc9e781664", "score": "0.56141543", "text": "def attributes\n data[:attributes]\n end", "title": "" }, { "docid": "265e44f7afc64850c07eb6a5ec8e872c", "score": "0.5603803", "text": "def day_attributes(week, day)\n html = %( class=\"#{day_attribute_classes(week, day)}\")\n html << %( id=\"today\") if Time.now.mday == date.mday && Time.now.mon == date.mon\n return html\n end", "title": "" }, { "docid": "8d3e105d91c702665ef7ee38059361ab", "score": "0.5593829", "text": "def get_gedi_attributes\n gedi_headers = self.attributes\n gedi_headers.delete(\"id\")\n gedi_headers.delete(\"created_at\")\n gedi_headers.delete(\"updated_at\")\n gedi_headers.delete(\"lock_version\")\n # ZPAD is a generated value, so we will not have it set in the view\n gedi_headers.delete(\"ZPAD\")\n \n gedi_headers\n end", "title": "" }, { "docid": "749416481964a46bf241f503c1056d32", "score": "0.5585529", "text": "def attributes\n {\n currency: @currency,\n amount: @amount,\n description: @description,\n return_url: @return_url,\n update_url: @update_url,\n meta_info: @meta_info\n }\n end", "title": "" }, { "docid": "b24408a508ee456aef7c587aae85b855", "score": "0.557907", "text": "def date_fields\n return []\n end", "title": "" }, { "docid": "999cd47bed8dc185e0383dd38be07a92", "score": "0.5572891", "text": "def elements\n result = [\n DiaryDateElement.new(:datetime, 'Effective date'),\n DiaryDateElement.new(:due_date, 'Due date', formatter: ->date { date.short_date }),\n DiaryElement.new(:goal),\n ]\n\n with_applies_to(result)\n end", "title": "" }, { "docid": "27dcad254e7699cb946438f01cb6ea37", "score": "0.5558995", "text": "def valid_attributes\n {\n start_date: Date.new(2013, 01, 20),\n end_date: Date.new(2013, 02, 20),\n onsite: false,\n name: \"Early\",\n competitor_expense_item_id: @comp_exp.id,\n noncompetitor_expense_item_id: @noncomp_exp.id\n }\n end", "title": "" }, { "docid": "0360440f0e020ff0749828bc157335db", "score": "0.5556612", "text": "def attributes\n list = \"name: #{@names}\n size: #{@sizes} miles in diameter\n color: #{@colors}\n tempuratur: #{@temps} degrees Fahrenheit\n speed: #{@speeds} mph\n year_length: #{@year_length} days to go around the sun\n distance: #{@distances} million miles from the sun\"\n return list\n end", "title": "" }, { "docid": "1ed2b687783bec9aa1f970222a04a29b", "score": "0.5543949", "text": "def column_attrs\n attrs = {}\n\n attrs[\"SRID\"] = \"line_item.sub_service_request.try(&:display_id)\"\n attrs[\"Request Organization\"] = \"line_item.sub_service_request.try(&:organization).try(&:name)\"\n attrs[\"Status\"] = \"line_item.sub_service_request.formatted_status\"\n attrs[\"Service Name\"] = \"line_item.service.name\"\n\n attrs[\"Service Rate\"] = \"Service.cents_to_dollars(line_item.service.displayed_pricing_map.full_rate)\"\n\n attrs[\"Modified Rate\"] = \"cost_reset ? 'COST RESET' : Service.cents_to_dollars(admin_cost)\"\n attrs[\"Modified Rate Date\"] = \"date_of_change\"\n\n attrs[\"By\"] = \"identity.try(:full_name)\"\n\n attrs\n end", "title": "" }, { "docid": "51167e3eb77055981d0af77d3cc7a278", "score": "0.5536538", "text": "def fields\n select(\"dates/fields/field\").each_with_object({}) do |node, result|\n key = node.attribute(\"type\").value.underscore.gsub(/dayperiod/, \"day_period\").to_sym\n name = node.xpath(\"displayName\").first\n result[key] = name.content if name\n end\n end", "title": "" }, { "docid": "33ebea90b51c633e398b621358d32dfe", "score": "0.5533559", "text": "def list_planet_attr\n attributes = \"Name: #{@p_name}\\nPlanet Year Length: #{@p_yr_length}\\nDistance to Sun: #{@p_dist_sun}\\nNumber of Moons: #{@p_num_moons}\\nAverage Temp: #{@p_avg_temp}\\nPlanet Type: #{@p_planet_type}\\nLife?: #{@p_life}\\n\"\n return attributes\n end", "title": "" }, { "docid": "a1cfe08b2312382685566d2a798d877d", "score": "0.5532093", "text": "def event_attributes(overrides = {})\n {\n name: \"BugSmash\",\n location: \"Denver\",\n price: 10.00,\n description: 'A fun evening of bug smashing!',\n starts_at: 10.days.from_now,\n image_file_name: 'bugsmash.png',\n capacity: 75\n }.merge(overrides)\nend", "title": "" }, { "docid": "9c8c90f97bc720672d0fd85dcd469c27", "score": "0.5527806", "text": "def get_category_specific_attrs(n)\n case @category.name\n when 'Events';\n start_date, end_date = get_start_and_end_dates(n)\n start_date, end_date = nil, nil if start_date && start_date.to_date < Date.today\n result = { start_date: start_date, end_date: end_date,\n event_start_date: start_date, event_end_date: end_date,\n event_start_time: start_date, event_end_time: end_date }\n if @description_xpath[n] && @title_xpath[n]\n result[:event_type_code] = get_event_type_code(@description_xpath[n].text, @title_xpath[n].text)\n end\n result\n when 'Jobs';\n { start_date: convert_to_datetime(@date_xpath[n].text), job_type_code: get_job_type_code(n),\n compensation: get_compensation(n), ref_id: get_ref_id(n) }\n end\n end", "title": "" }, { "docid": "e9510fccd6facca72b02e6b339a64cc3", "score": "0.5526713", "text": "def attributes\n list = \"name: #{@names}\n size: #{@sizes} miles in diameter\n color: #{@colors}\n temperature: #{@temps} degrees Fahrenheit\n speed: #{@speeds} mph\n year_length: #{@year_length} days to go around the sun\n distance: #{@distances} million miles from the sun\"\n return list\n end", "title": "" }, { "docid": "c28f1b3361851a97990959f7dedba93d", "score": "0.5493624", "text": "def attributes\n # TODO\n end", "title": "" }, { "docid": "9096426968f195b28f6b740e7fcb1cd0", "score": "0.54907966", "text": "def model_attribute_list(attributes = nil, options = {})\n attributes ||= current_page.data.attributes\n attributes.reduce(\"\") do |acc, a|\n list = content_tag(:dt, 'definition') +\n content_tag(:dd, a['definition']) +\n content_tag(:dt, 'type') +\n content_tag(:dd, a['type'])\n acc + content_tag(:h4, a['name']) +\n content_tag(:dl, list, options = {})\n end\n end", "title": "" }, { "docid": "17b696ddaba91af0b6cff6664a5e4b56", "score": "0.5490413", "text": "def date_attribute_set(instance, name, attributes)\n return unless attributes.key?(name) || attributes.key?(\"formatted_#{name}\")\n\n value = attributes[name] || attributes[\"formatted_#{name}\"]\n\n instance.send(:\"formatted_#{name}=\", value)\n end", "title": "" }, { "docid": "cc3dc5a153be9dd59b9083a4ebb616e2", "score": "0.54889894", "text": "def get_dates\n @prgcat = GDS::ProductCategory.find(:all,:domain=>[['isroomtype','=',true]])\n end", "title": "" }, { "docid": "9a5bc757f805d6e2c725e056237bb017", "score": "0.5486382", "text": "def date_fields\n return [:created_at]\n end", "title": "" }, { "docid": "27219fb3fc2f312e95cd83d5c950b113", "score": "0.5486282", "text": "def elements\n [\n DiaryDateElement.new(:datetime, 'Effective date'),\n DiaryElement.new(:location, 'Location', default: Settings.meeting_location_default || 'unspecified'),\n DiaryElement.new(:notes),\n DiaryElement.new(:actions),\n ]\n end", "title": "" }, { "docid": "01924cf5a041a173227ec26cc6ae0578", "score": "0.548269", "text": "def get_attributes()\n\t\treturn self.get(\"attribute\",\"\")\n\tend", "title": "" }, { "docid": "6d0eb3e861a6c08bc7380de913afffdd", "score": "0.5481924", "text": "def recipe_attributes(element)\n {\n name: element.at('.m_titre_resultat').text.strip,\n description: element.at('.m_texte_resultat').text.strip,\n # To understand the weird #&. marks, read this:\n # http://mitrev.net/ruby/2015/11/13/the-operator-in-ruby/\n # It's an interesting feature that avoids broken code from chaining\n # methods into nil. In this case, not every page has elements with\n # .m_detail_time, so we're avoiding calling the next methods on nil.\n prep_time: element.at('.m_detail_time')&.first_element_child&.text&.strip\n }\n end", "title": "" }, { "docid": "f0d6a02bc50a39790d9fba04189254cc", "score": "0.546709", "text": "def list_planets_attributes\n list = []\n #iterate through @planets variable and formats into string\n @planets.each do |planet|\n list << \"#{@planets.index(planet) + 1}. #{planet.list_planet_attr}\"\n end\n return list.join(\"\\n\")\n end", "title": "" }, { "docid": "1bd2c3a44bd296deafed0fcb2f64d501", "score": "0.5466761", "text": "def attributes\n return \"\\nPlanet: #{@planet}, Color: #{@color}, Inhabitants: #{@inhabitants}, Distance from the sun: #{@distance_from_sun} million miles, Length in a year: #{@year_length} days, Moons: #{@moons}.\"\n end", "title": "" }, { "docid": "e38c0841979ba00719bf1c04b97c5ff5", "score": "0.5453013", "text": "def attributes\n\t\t@study = Study.find(params[:study_id])\n\t\tmakeActive(@study)\n\t\t@project = Project.find(params[:project_id])\n\t\t@study_arms = Arm.where(:study_id => @study.id).all\n\t\t@baseline_characteristic_field = BaselineCharacteristicField.new\n\t\t@baseline_characteristic_data_point = BaselineCharacteristicDataPoint.new\n\t\t@baseline_characteristic_template_fields = BaselineCharacteristicField.where(:template_id => Study.get_template_id(@study.id)).all\n\t\t@baseline_characteristic_custom_fields = BaselineCharacteristicField.where(:study_id => @study.id).all\n\t\trender :layout => 'attributes'\t\t\n end", "title": "" }, { "docid": "9ea28071dfbe39ca1536963f213220b3", "score": "0.54478395", "text": "def getDates\n date_string = @xml.xpath('./metadata/oai_dc:dc/dc:date[3]/text()').first.to_s\n \n # Store the year as a string, along with the Ca., if it exists, so we can display it \n @doc[:date_display] = date_string[/\\d{4}/]\n \n if @doc[:date_display]\n \n stripped_year = @doc[:date_display][/\\d{4}/]\n # Store the year as an actual date, so we can do math on it \n @doc[:creation_date] = stripped_year.concat(\"-01-01T23:59:59Z\")\n # Store a range value\n creation_era = []\n if 100.years.ago > DateTime.parse(stripped_year)\n creation_era << \"More than 100 years old\"\n end\n if 50.years.ago > DateTime.parse(stripped_year)\n creation_era << \"More than 50 years old\"\n end\n if 20.years.ago > DateTime.parse(stripped_year)\n creation_era << \"More than 20 years old\"\n end\n if 10.years.ago > DateTime.parse(stripped_year)\n creation_era << \"More than 10 years old\"\n end\n if 10.years.ago <= DateTime.parse(stripped_year)\n creation_era << \"Less than 10 years old\"\n end\n if 5.years.ago <= DateTime.parse(stripped_year)\n creation_era << \"Less than 5 years old\"\n end\n if 1.year.ago <= DateTime.parse(stripped_year)\n creation_era << \"Less than 1 year old\"\n end\n @doc[:subject_era_facet] = creation_era\n end\n end", "title": "" }, { "docid": "855bbf3c45bd21b5ebf4b930f64b7153", "score": "0.54456586", "text": "def date_group_items; end", "title": "" }, { "docid": "ec7568532ad2fc8710aba7753ea41879", "score": "0.54434174", "text": "def atts\n\t\t\t@attributes\n\t\tend", "title": "" }, { "docid": "281e790e5bb8c2cadb9ba7d222c65c2d", "score": "0.543817", "text": "def displayable_details\n attributes.except(\"id\", \"created_at\", \"updated_at\")\n end", "title": "" }, { "docid": "322c723cb6663d2e3c69905ba829aa2c", "score": "0.5436432", "text": "def get_datetime_attributes\n return @@datetime_attributes\n end", "title": "" }, { "docid": "adc654939e8159d10e5b5a8cd8d8fb3d", "score": "0.54362625", "text": "def attributes ; @attributes end", "title": "" }, { "docid": "51535fea299386008fbad1cffbb98321", "score": "0.5434578", "text": "def attribute_data\n return {\n :name => self.name,\n :psd_file_path => self.psd_file_path,\n :id => self.safe_name,\n :status => self.status,\n :photoshop_status => self.photoshop_status,\n :safe_name => self.safe_name,\n :safe_name_prefix => self.safe_name_prefix,\n :height => self.height,\n :width => self.width,\n :user => self.user.email\n }\n end", "title": "" }, { "docid": "f68568048646cc4cae038a2739dff44a", "score": "0.5431138", "text": "def valid_attributes\n time = Time.current\n {:start_date =>time-2.days, :end_date =>time+2.days, :availabilities=>{:avail=>{time=>[\"J\"]},:rather_not=>{time=>[\"J\"]},:prefer=>{time=>[\"J\"]}}}\n end", "title": "" }, { "docid": "8190e4b03ae59bf9ac7f1e462008d028", "score": "0.54300874", "text": "def to_liquid\n { \n 'id' => id, \n 'title' => title,\n 'option1' => option1,\n 'option2' => option2,\n 'option3' => option3,\n 'price' => to_cents(price), \n 'weight' => grams, \n 'compare_at_price' => to_cents(compare_at_price), \n 'inventory_quantity' => inventory_quantity, \n 'sku' => sku \n }\n end", "title": "" }, { "docid": "ca087d6fadcbc7f894a1c55921ef30cc", "score": "0.5427674", "text": "def get_listing_attrs(title, description, category_specific_attrs, n)\n {\n title: title,\n description: description,\n price: get_price(n),\n quantity: 1,\n site_id: get_site_id(n) || @feed.site_id,\n category_id: @category.id,\n external_url: @link_xpath[n].text\n }.merge(category_specific_attrs)\n end", "title": "" }, { "docid": "f2cbd1e0e687a59d5e28bfcde2ca00c4", "score": "0.5422739", "text": "def effective_dates\n date = data.dig('EffectiveDate', 'FirstIssuedDate') || {}\n date.values.compact\n end", "title": "" }, { "docid": "80d2f102d7ed67f2ca6c74dd4d53c88b", "score": "0.54209954", "text": "def attributes\n return \"\\n Name: #{@name}\\n Moons: #{@order}\\n Distance from the Sun: #{@distance_fromsun}\\n Mass: #{@diameter}\\n Orbit Period = #{@orbit_period}\\n \"\n end", "title": "" }, { "docid": "37d132281651353c615fc783ee7b538c", "score": "0.54183555", "text": "def daily_carbohydrate_allotment\n self.daily_calorie_allotment * 0.15\n end", "title": "" }, { "docid": "e9f564b5aaa27cbcbd77a17cbdeb8a87", "score": "0.54140586", "text": "def to_liquid\n format = self.site.config['date_format']\n if format.nil? || format.empty? || format == \"ordinal\"\n date_formatted = ordinalize(self.date)\n else\n date_formatted = self.date.strftime(format)\n end\n\n self.data.deep_merge({\n \"title\" => self.data[\"title\"] || self.slug.split('-').select {|w| w.capitalize! || w }.join(' '),\n \"url\" => self.url,\n \"date\" => self.date,\n # Monkey patch\n \"date_formatted\" => date_formatted,\n \"id\" => self.id,\n \"categories\" => self.categories,\n \"next\" => self.next,\n \"previous\" => self.previous,\n \"tags\" => self.tags,\n \"content\" => self.content })\n end", "title": "" }, { "docid": "71724b3129ec7231a5c5f8ae12426988", "score": "0.54014623", "text": "def to_liquid\n @object.respond_to?(:attributes) ? @object.attributes : []\n end", "title": "" }, { "docid": "a9aa0e576f51a3cf5d4a1a5cee4b40ee", "score": "0.54001856", "text": "def dates\n {\n created_at: Time.zone.now,\n updated_at: Time.zone.now\n }\nend", "title": "" }, { "docid": "357855eb9e9bd8de19126566a9451865", "score": "0.5398966", "text": "def day_fields\n DAY_FIELDS\n end", "title": "" }, { "docid": "3fdfe9847dfc5ca12b402a197943b03e", "score": "0.5396699", "text": "def extract_local_attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" }, { "docid": "95ffebd9cbd702368807cff490fedf3e", "score": "0.5395037", "text": "def attributes; end", "title": "" } ]
4324bc0398a0e378f9a8014459557af1
GET /oss/new GET /oss/new.json
[ { "docid": "da1bd82e14cb1e07f27c7084d73a7cf6", "score": "0.0", "text": "def new\n @os = Os.new\n @os.itens.build\n @os.pagamentos.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @os }\n end\n end", "title": "" } ]
[ { "docid": "7b689672fb051affca32a268fdcb4736", "score": "0.6941042", "text": "def new\n\tuuid = SecureRandom.uuid\n\t@new_url = searches_url + \"/\" + uuid # creates http://localhost/search/123-34552-adsfrjha-234\n\tresponse.set_header(\"Location\", @new_url)\n respond_to do |format|\n format.html { render :new, status: 201 }\n format.json { render :new, status: 201 }\n format.jsonld { render :new, formats: :json, status: 201 }\n end\n\t\n end", "title": "" }, { "docid": "17d7da60333d97967bcd96628c11fd45", "score": "0.6724122", "text": "def new\n json_404\n end", "title": "" }, { "docid": "51ff39e3396293e6ab1d37975da71339", "score": "0.6679195", "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": "bdefcae1cec841161a2377f72e605801", "score": "0.66367805", "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": "e1bc9a5c7d5dc36da2fd873d88e65d1f", "score": "0.6635443", "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": "31c8c5a421b4dbecf26238b1bf18fb49", "score": "0.6594154", "text": "def new\n @newse = Newse.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @newse }\n end\n end", "title": "" }, { "docid": "5da16b2c91298b65822f602999d1754d", "score": "0.65641505", "text": "def new_stories\n get('/newstories.json')\n end", "title": "" }, { "docid": "40d33b018a4942131161a4537a51ef57", "score": "0.65459466", "text": "def new\n @snmp = Snmp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @snmp }\n end\n end", "title": "" }, { "docid": "e676086c9c7fa6cba32d8205762e8705", "score": "0.6531872", "text": "def new\n @sn = Sn.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sn }\n end\n end", "title": "" }, { "docid": "fc430afae67829016ccfb8075244d391", "score": "0.6519419", "text": "def new\n @ring = Ring.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ring }\n end\n end", "title": "" }, { "docid": "f1b9b443f6e54af7a3575d8573509edf", "score": "0.6475425", "text": "def new\n @noc = Noc.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @noc }\n end\n end", "title": "" }, { "docid": "d89d88dcb488b2acf0e3af27a9893512", "score": "0.6473025", "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": "b3d2bf49a79f95b828cdacbc1c1b3102", "score": "0.64719534", "text": "def new\n @sop = Sop.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sop }\n end\n end", "title": "" }, { "docid": "63b94c62b3cacd1aae98226e4333bf62", "score": "0.6432474", "text": "def new\n @repo = Repo.new\n\n respond_to do |format|\n format.json { render json: @repo }\n end\n end", "title": "" }, { "docid": "19a80692dc63a9e1c82898748409dcc4", "score": "0.64285564", "text": "def new\n @pos_server = PosServer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pos_server }\n end\n end", "title": "" }, { "docid": "3f1642e59b185de41582db84000acdea", "score": "0.64162433", "text": "def new\n @version = Version.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @version }\n end\n end", "title": "" }, { "docid": "3f1642e59b185de41582db84000acdea", "score": "0.64162433", "text": "def new\n @version = Version.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @version }\n end\n end", "title": "" }, { "docid": "c6986af2444faa54da4aea8070c3227b", "score": "0.6400111", "text": "def new\n @official = Official.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @official }\n end\n end", "title": "" }, { "docid": "c6986af2444faa54da4aea8070c3227b", "score": "0.6398909", "text": "def new\n @official = Official.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @official }\n end\n end", "title": "" }, { "docid": "c6986af2444faa54da4aea8070c3227b", "score": "0.6398909", "text": "def new\n @official = Official.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @official }\n end\n end", "title": "" }, { "docid": "fbb221e0dac1e7043946860433ac438e", "score": "0.6392864", "text": "def new\n @exist = Exist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exist }\n end\n end", "title": "" }, { "docid": "3cfe3840fab4ab605307f6f1db60397f", "score": "0.6387502", "text": "def new\n @req = Req.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @req }\n end\n end", "title": "" }, { "docid": "4a24226f423ad8eec8dde6e158edb209", "score": "0.6381091", "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": "cee795039dac4cc26e1c6abc4b4b095d", "score": "0.63786554", "text": "def new\n @sname = Sname.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sname }\n end\n end", "title": "" }, { "docid": "66f4bf442ffa873052cc23f6c7fc31aa", "score": "0.6369387", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status }\n end\n end", "title": "" }, { "docid": "5825ebdb373d0c7b32ad5a6974f535ad", "score": "0.636912", "text": "def new\n @system = System.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @system }\n end\n end", "title": "" }, { "docid": "82a30e78c15eb4eb45196587d151860b", "score": "0.6368594", "text": "def new\n @version = ApplicationController::HEPHAESTUS_VERSION\n @server = Server.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @server }\n end\n end", "title": "" }, { "docid": "f21b93a37ec98093c29dce4e86e8236d", "score": "0.6366984", "text": "def new\n @url = Url.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @url }\n end\n end", "title": "" }, { "docid": "f21b93a37ec98093c29dce4e86e8236d", "score": "0.6366984", "text": "def new\n @url = Url.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @url }\n end\n end", "title": "" }, { "docid": "f21b93a37ec98093c29dce4e86e8236d", "score": "0.6366984", "text": "def new\n @url = Url.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @url }\n end\n end", "title": "" }, { "docid": "697f09f0dd9849a4bdd3802588969afd", "score": "0.635969", "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": "8bac910d9fb06ec0207d159c48be39a6", "score": "0.6359322", "text": "def new\n authorize! :create , Update\n @update = Update.new\n @page_title = \"New Update\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @update }\n end\n end", "title": "" }, { "docid": "7e22a81a487f74bcff9ed990be2ebec8", "score": "0.6358906", "text": "def new\n @su = Sus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @su }\n end\n end", "title": "" }, { "docid": "17af51464a29cc9dc36c149aceffe91e", "score": "0.6354277", "text": "def new\n @eventos2 = Eventos2.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @eventos2 }\n end\n end", "title": "" }, { "docid": "849777449cced5669430788c0cf8becf", "score": "0.6352227", "text": "def new\n @spl = Spl.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @spl }\n end\n end", "title": "" }, { "docid": "7a20df6477d15b527a5076f6bc1dba7e", "score": "0.6348019", "text": "def new\n render plain: \"new action not available in API\"\n end", "title": "" }, { "docid": "31823a3812e4e610e5e81ba55f0d2493", "score": "0.63419765", "text": "def new\n @production = Production.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @production }\n end\n end", "title": "" }, { "docid": "31823a3812e4e610e5e81ba55f0d2493", "score": "0.63419765", "text": "def new\n @production = Production.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @production }\n end\n end", "title": "" }, { "docid": "46cd8c0b9916d2e8b8b79e6d87c47c01", "score": "0.63404113", "text": "def new\n @jackrabbit = Jackrabbit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @jackrabbit }\n end\n end", "title": "" }, { "docid": "60a524c8a74e7c675582a2da93b567d0", "score": "0.6339642", "text": "def new\n @license = License.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @license }\n end\n end", "title": "" }, { "docid": "b1f4210452c4c7dade120889f695a609", "score": "0.63367426", "text": "def new\n @url = Url.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @url }\n end\n end", "title": "" }, { "docid": "14ea87a5904ec2eafe0dcec489dcf876", "score": "0.6333584", "text": "def new_rest\n @v1_item_usage = V1ItemUsage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @v1_item_usage }\n end\n end", "title": "" }, { "docid": "f5067cccd41b18649cb1e6e9faa0d4c4", "score": "0.6328513", "text": "def new\n @ortho_source = OrthoSource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ortho_source }\n end\n end", "title": "" }, { "docid": "f476e876143b7c457d07b6379b7555f1", "score": "0.63216114", "text": "def new\n @url = Url.new\n\n render json: @url\n end", "title": "" }, { "docid": "d6c415b35ca300065c51ee0e0ff81735", "score": "0.6320721", "text": "def new\n @artifact = Artifact.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @artifact }\n end\n end", "title": "" }, { "docid": "baf442ed728a847b711b6070aa276e36", "score": "0.6316722", "text": "def new\n @mongotest = Mongotest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mongotest }\n end\n end", "title": "" }, { "docid": "a9fd6e51a9ac94b7dc54d4ccb2863528", "score": "0.6316365", "text": "def new\n screen_name(\"Admin-Nueva-Tipo-OT\")\n @ot_type = OtType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ot_type }\n end\n end", "title": "" }, { "docid": "cdd2f1a17ee2297fe52e61e0c90c2757", "score": "0.6314519", "text": "def new\n @ontology = Ontology.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ontology }\n end\n end", "title": "" }, { "docid": "cdd2f1a17ee2297fe52e61e0c90c2757", "score": "0.6314519", "text": "def new\n @ontology = Ontology.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ontology }\n end\n end", "title": "" }, { "docid": "0424fd3b9b8625b545cae1f93204c739", "score": "0.6313386", "text": "def new\n @artifact = Artifact.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @artifact}\n end\n end", "title": "" }, { "docid": "84beec7621e8d84841daf5417476d953", "score": "0.6310916", "text": "def new\n render text: \"get new request\"\n end", "title": "" }, { "docid": "19e602c2f4081136b9902fed2fd815be", "score": "0.63076234", "text": "def new\n screen_name(\"Admin-Nueva-OT\")\n @ot = Ot.new\n @ot.created_by = current_user.id\n @ot.target_date = DateTime.now + 2\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ot }\n end\n end", "title": "" }, { "docid": "73868003d10ec9c89d467565e36f90f1", "score": "0.6303806", "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.6303806", "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": "de67e3c2bff5546646a0642bc3cf2a7e", "score": "0.630163", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status }\n end\n end", "title": "" }, { "docid": "de67e3c2bff5546646a0642bc3cf2a7e", "score": "0.630163", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status }\n end\n end", "title": "" }, { "docid": "de67e3c2bff5546646a0642bc3cf2a7e", "score": "0.630163", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status }\n end\n end", "title": "" }, { "docid": "de67e3c2bff5546646a0642bc3cf2a7e", "score": "0.630163", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status }\n end\n end", "title": "" }, { "docid": "de67e3c2bff5546646a0642bc3cf2a7e", "score": "0.630163", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status }\n end\n end", "title": "" }, { "docid": "de67e3c2bff5546646a0642bc3cf2a7e", "score": "0.630163", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status }\n end\n end", "title": "" }, { "docid": "de67e3c2bff5546646a0642bc3cf2a7e", "score": "0.630163", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status }\n end\n end", "title": "" }, { "docid": "de67e3c2bff5546646a0642bc3cf2a7e", "score": "0.630163", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status }\n end\n end", "title": "" }, { "docid": "de67e3c2bff5546646a0642bc3cf2a7e", "score": "0.630163", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status }\n end\n end", "title": "" }, { "docid": "de67e3c2bff5546646a0642bc3cf2a7e", "score": "0.630163", "text": "def new\n @status = Status.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @status }\n end\n end", "title": "" }, { "docid": "faf22131ca112501dc8a27fb9358abc8", "score": "0.6301435", "text": "def new\n @soon = Soon.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @soon }\n end\n end", "title": "" }, { "docid": "308440994fb11a73abafde6eb02c460b", "score": "0.62950104", "text": "def new\n @ice = Ice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @ice }\n end\n end", "title": "" }, { "docid": "c9d1386c5ece3daf4222c779bf9d71c4", "score": "0.6294382", "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": "aec031a4d5eb1ebded625a20a0fa2f37", "score": "0.62924683", "text": "def new\n @software = Software.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @software }\n end\n end", "title": "" }, { "docid": "aec031a4d5eb1ebded625a20a0fa2f37", "score": "0.62924683", "text": "def new\n @software = Software.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @software }\n end\n end", "title": "" }, { "docid": "4221cd9e5d19aac8cebb6a15c4edb475", "score": "0.62882304", "text": "def new\n @os_vendor = OsVendor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @os_vendor }\n end\n end", "title": "" }, { "docid": "c38f1a3603b5de5824f457cac4925b2d", "score": "0.62819195", "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": "6c738079260611f58e1c4eb64eed5b50", "score": "0.6277994", "text": "def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stat }\n end\n end", "title": "" }, { "docid": "6c738079260611f58e1c4eb64eed5b50", "score": "0.6277994", "text": "def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stat }\n end\n end", "title": "" }, { "docid": "6c738079260611f58e1c4eb64eed5b50", "score": "0.6277994", "text": "def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stat }\n end\n end", "title": "" }, { "docid": "6c738079260611f58e1c4eb64eed5b50", "score": "0.6277994", "text": "def new\n @stat = Stat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @stat }\n end\n end", "title": "" }, { "docid": "fb34c33aa1f23b70ea08677565fb25c3", "score": "0.62764186", "text": "def new\n @nagios_status = NagiosStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nagios_status }\n end\n end", "title": "" }, { "docid": "0e9a6514bbc32f66a970d0e945eea31e", "score": "0.6276387", "text": "def new\n @sprint = Sprint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sprint }\n end\n end", "title": "" }, { "docid": "5edd5b6b80375c5d5cab86bda45c8787", "score": "0.6269166", "text": "def new\n @software = Software.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @software }\n end\n end", "title": "" }, { "docid": "0eb1e08613a69bba99133087aeb7242c", "score": "0.6267375", "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.6267375", "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.6267375", "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.6267375", "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.6267375", "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.6267375", "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.6267357", "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": "7f36ca117d8960111dc0b5ceaf444813", "score": "0.6267307", "text": "def new\n @title = t('view.providers.new_title')\n @provider = Provider.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provider }\n end\n end", "title": "" }, { "docid": "4b21856125d065d218877a3caa48be35", "score": "0.62645465", "text": "def new\n @ping = Ping.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ping }\n end\n end", "title": "" }, { "docid": "c7e6059bb336ab9c1f6f984f860c2fd6", "score": "0.62643856", "text": "def new_rest\n @instrument = Instrument.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @instrument }\n end\n end", "title": "" }, { "docid": "9b0a480c630f17eda9c799858469f8c2", "score": "0.62577057", "text": "def new\n @outsource = Outsource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @outsource }\n end\n end", "title": "" }, { "docid": "bdccf65d565a9bdcdb2455f60500dc73", "score": "0.6256741", "text": "def new\n @foundry = Foundry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @foundry }\n end\n end", "title": "" }, { "docid": "86386de4579c2369832fbccab8c7316c", "score": "0.6252223", "text": "def new\n @sprint = Sprint.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @sprint }\n end\n end", "title": "" }, { "docid": "b7ee736c99988d10c4423a1ee9a3896f", "score": "0.625144", "text": "def new\n @nova = Nova.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nova }\n end\n end", "title": "" }, { "docid": "922eefbb3ab06385c06b9c148346f1cf", "score": "0.62475955", "text": "def new\n @lookup = Lookup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lookup }\n end\n end", "title": "" }, { "docid": "acaef71d7e6c15fefa4cdd0cb0a56794", "score": "0.6244244", "text": "def new\n @creation = Creation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @creation }\n end\n end", "title": "" }, { "docid": "e53d4b781049c700f789b3541a87ebcc", "score": "0.6243783", "text": "def new\n @evnets_share = EvnetsShare.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @evnets_share }\n end\n end", "title": "" }, { "docid": "9b6fc3f724a831e745c356884acf1abd", "score": "0.6243193", "text": "def new\n @artifact_status = ArtifactStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @artifact_status }\n end\n end", "title": "" }, { "docid": "8f8d1db4c6177f95b17c22cd916c94f3", "score": "0.6242749", "text": "def new\n @cap = Cap.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @cap }\n end\n end", "title": "" }, { "docid": "00f7481031877992a82b91fc1a24b062", "score": "0.624077", "text": "def new_rest\n @v1_instrument_session = V1InstrumentSession.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @v1_instrument_session }\n end\n end", "title": "" }, { "docid": "373545daae8b16948dff5f2341bd4641", "score": "0.6240564", "text": "def new\n @owner = Owner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @owner }\n end\n end", "title": "" }, { "docid": "373545daae8b16948dff5f2341bd4641", "score": "0.6240564", "text": "def new\n @owner = Owner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @owner }\n end\n end", "title": "" }, { "docid": "373545daae8b16948dff5f2341bd4641", "score": "0.6240564", "text": "def new\n @owner = Owner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @owner }\n end\n end", "title": "" } ]
94a9a86e29a6923cf21840b36f1406e6
definimos el head estructura html
[ { "docid": "d6b8078b92cce832a9bbce382aab29f7", "score": "0.7029836", "text": "def head()\n head = '<!DOCTYPE html>\n <html lang=\"es\">\n <head>\n <meta charset=\"UTF-8\">\n <meta name=\"author\" content=\"Esteban Ramirez\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta name=\"description\" content=\"trabajo Api Esteban\" />\n <title>Fotos de Marte</title>\n\n <!--CSS bootstrap 4.5.2-->\n\n <link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css\" integrity=\"sha384-JcKb8q3iqJ61gNV9KGb8thSsNjpSL0n8PARn9HuZOnIxN0hoP+VmmDGMN5t9UJ0Z\" crossorigin=\"anonymous\">\n</head>\n <body>\n\n <div class=\"container\" >\n <div class=\"card mx-auto mt-3 mb-3\" style=\"width: 35rem;\">\n <ul>\n '\nend", "title": "" } ]
[ { "docid": "1907945582ae5bb63f44b3c062bddeac", "score": "0.80656356", "text": "def head\n render 'head.html'\n end", "title": "" }, { "docid": "66a464556c9c7795dcfb8e3fe79f680c", "score": "0.78444", "text": "def head\n\t%{\n <head>\n <title>Shelob</title>\n </head>\n\t}\nend", "title": "" }, { "docid": "d6a03c40af37160cfdf7c8ccfc7da178", "score": "0.74066925", "text": "def head\n @head ||= at('/html/head')\n end", "title": "" }, { "docid": "03ee36eaf3b68cec28449d23ee657ff8", "score": "0.73830837", "text": "def head\n @head ||= at('/html').add_child(Elements::Basic.new('head', self))\n end", "title": "" }, { "docid": "846374e4d6e7b6cde04f31abdf802af8", "score": "0.72515017", "text": "def head_content\n doctype\n meta 'http-equiv' => 'content-type', :content => 'text/html;charset=UTF-8'\n page_title\n include_blueprint\n included_stylesheets\n end", "title": "" }, { "docid": "bed78362d6b38fa12970ce46ddee0336", "score": "0.7125463", "text": "def head\n stylesheet 'structure', 'form', 'theme', 'buttons'\n javascript 'wufoo'\n end", "title": "" }, { "docid": "f2a2b60164f2d15a5e841a775578c08f", "score": "0.70614165", "text": "def engine_head\n\tpartial 'engine/head'\n end", "title": "" }, { "docid": "4ebcdb4cfbc0fa0f13d5976b8f72571d", "score": "0.69729865", "text": "def html_header(title)\n styles = css()\n header = <<HTML_HEADER\n<!DOCTYPE html>\n<html>\n <head><title>#{title}</title></head>\n\n #{styles}\n\n <body>\n <div class=\"content\">\n <div class=\"rendered-content\">\n\nHTML_HEADER\n end", "title": "" }, { "docid": "cf6d1d08729c9eae4dbff3c24a59b45d", "score": "0.69630796", "text": "def head\n '<!DOCTYPE html>\n <html lang=\"es\">\n \n <head>\n <meta charset=\"UTF-8\">\n <link rel=\"shortcut icon\" type=\"image/png\" href=\"./assets/img/favicon.png\" />\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">\n <meta name=\"author\" content=\"Sebastian Venegas\">\n <meta name=\"description\" content=\"Photos Rovers Mars, API NASA\">\n <meta name=\"keywords\" content=\"Mars, Nasa, Rovers, Photo Nasa\">\n \n <title>Mars Rover</title>\n <!--Bootstrap 4.5.0-->\n <link rel=\"stylesheet\" href=\"https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css\"\n integrity=\"sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk\" crossorigin=\"anonymous\">\n \n <!--Font Awe-->\n <script src=\"https://kit.fontawesome.com/6a3cb15231.js\" crossorigin=\"anonymous\"></script>\n \n <!--Google Font-->\n <link href=\"https://fonts.googleapis.com/css2?family=Raleway:wght@300;500&display=swap\" rel=\"stylesheet\">\n <!--CSS-->\n <link rel=\"stylesheet\" href=\"./assets/css/style.css\">\n </head>\n \n <body>'\nend", "title": "" }, { "docid": "e7c085133eec1483c991da5f23b0547a", "score": "0.6868353", "text": "def header\n @io.content_type = content_type if @io.respond_to?(:content_type)\n\n @io << \"<html>\"\n @io << tag(:head) do |headers|\n # tabber_js_file = File.expand_path(File.join(File.dirname(__FILE__), 'scea', 'tabber-minimized.js'))\n table_sorter_file = File.expand_path(File.join(File.dirname(__FILE__), 'scea', 'table-sorter.js'))\n css_file = File.expand_path(File.join(File.dirname(__FILE__), 'scea', 'style.css'))\n\n headers << tag(:title, 'SCEA Log Analyzer Report')\n headers << tag(:style, File.open(css_file).read, :type => \"text/css\")\n # headers << tag(:script, File.open(tabber_js_file).read, :type => 'text/javascript')\n headers << tag(:script, File.open(table_sorter_file).read, :type => 'text/javascript')\n end\n @io << '<body>'\n @io << tag(:h1, 'SCEA Log Analyzer Report')\n # @io << tag(:p, \"Version #{RequestLogAnalyzer::VERSION}\")\n end", "title": "" }, { "docid": "cf3ab5e47e7283957929d3f68bebe258", "score": "0.6859257", "text": "def head\n @content\n end", "title": "" }, { "docid": "4471fbf827c3e13eaa36e7cc5469f2d3", "score": "0.68558246", "text": "def generate_header\n @buffer += \"---\\nlayout: page\\ntitle: Обзоры\\n---\\n\"\n end", "title": "" }, { "docid": "58af687e92404547de8bba857b42dcd6", "score": "0.6836165", "text": "def header\n self.class.class_variable_defined?( :@@header ) && @@header ?\n @@header.call( self ) :\n \"</head><body>\"\n end", "title": "" }, { "docid": "869b7fe46af49b0f0a9bb0a163aa7675", "score": "0.682223", "text": "def html_header\n if File.exist? tracker.options[:html_style]\n css = File.read tracker.options[:html_style]\n else\n raise \"Cannot find CSS stylesheet for HTML: #{tracker.options[:html_style]}\"\n end\n\n <<-HTML\n <!DOCTYPE HTML SYSTEM>\n <html>\n <head>\n <title>Brakeman Report</title>\n <script type=\"text/javascript\">\n function toggle(context) {\n var elem = document.getElementById(context);\n\n if (elem.style.display != \"block\")\n elem.style.display = \"block\";\n else\n elem.style.display = \"none\";\n \n elem.parentNode.scrollIntoView();\n }\n </script>\n <style type=\"text/css\"> \n #{css}\n </style>\n </head>\n <body>\n <h1>Brakeman Report</h1>\n <table>\n <tr>\n <th>Application Path</th>\n <th>Rails Version</th>\n <th>Report Generation Time</th>\n <th>Checks Performed</th>\n </tr>\n <tr>\n <td>#{File.expand_path tracker.options[:app_path]}</td>\n <td>#{rails_version}</td>\n <td>#{Time.now}</td>\n <td>#{checks.checks_run.sort.join(\", \")}</td>\n </tr>\n </table>\n HTML\n end", "title": "" }, { "docid": "719008871d70f17ce1adb5d6b22b34f9", "score": "0.68155634", "text": "def build_head_html(cgi)\n cgi.head do\n cgi.title { \"Overwatch\" } +\n cgi.link('rel' => 'stylesheet',\n 'href' => 'style.css') +\n cgi.script('type' => 'text/javascript',\n 'src' => 'URI.js') +\n cgi.script('type' => 'text/javascript',\n 'src' => 'overwatch.js') +\n cgi.meta('name' => 'viewport',\n 'content' => 'width=device-width, initial-scale=1') + # Let mobile devices do their own scaling\n cgi.meta('charset' => 'utf-8')\n end\nend", "title": "" }, { "docid": "18a06a6794fb9b8599525a2d85c53bc3", "score": "0.68119293", "text": "def indexHeader # Header text\n\theader = \"<html><head><title>Index</title><link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"contentpages/main.css\\\" /></head><body><font face=helvetica>\"\nend", "title": "" }, { "docid": "31889ba68c5c87ed9e0d680faf5c8d0a", "score": "0.6806823", "text": "def append_head\n @_head = append(Head) do\n meta :\"http-equiv\" => \"Content-Type\", :content => \"text/html; charset=utf-8\"\n end\n end", "title": "" }, { "docid": "fa441aca135fd7fcf2b628d5c6b662c6", "score": "0.6796186", "text": "def view_layouts_base_html_head(context)\n javascript_include_tag('projects_tree_view', :plugin => :redmine_ababylon2) +\n stylesheet_link_tag('projects_tree_view', :plugin => :redmine_ababylon2) +\n javascript_include_tag('calendar', :plugin => :redmine_ababylon2) +\n stylesheet_link_tag('calendar', :plugin => :redmine_ababylon2)+\n stylesheet_link_tag('style_bab2', :plugin => :redmine_ababylon2)\n end", "title": "" }, { "docid": "de88254943f8f0f5b913e7945a94c1de", "score": "0.6774733", "text": "def view_layouts_base_html_head(context = {})\n ret = ''\n unless User.current.anonymous? || context[:controller].class.name == 'AnnouncementsController'\n ret << context[:hook_caller].javascript_tag do\n a = announcements(context)\n \"$(function() {\n var a = #{a.inspect};\n $(a).insertBefore('#content');\n });\".html_safe\n end\n end\n ret << stylesheet_link_tag(\"announcements\", plugin: :redmine_site_announcements)\n ret\n end", "title": "" }, { "docid": "73c4efb8aab9e553709d8fa52117563e", "score": "0.6723194", "text": "def head\n @head.join.gsub(/<\\/?(?:html|head|!DOCTYPE).*?>/mi, '')\n end", "title": "" }, { "docid": "eb0a62b6310741691bf9a485fb2bdaad", "score": "0.6716049", "text": "def page_header(head)\n \t\"<header class='jumbotron subhead' id='overview'>\\\n\t\t<div class='row-fluid'>\\\n\t\t\t<div class='span12 page-header'>\\\n\t\t\t\t<h1>#{head}</h1>\\\n\t\t\t</div>\\\n\t\t</div>\\\n\t</header>\".html_safe\n end", "title": "" }, { "docid": "ec205f53a964d064483c35348666d9e8", "score": "0.6712809", "text": "def header\n @file.puts <<-eos\n <!DOCTYPE html>\n <html>\n <head>\n <meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\">\n <title>Cucumber step documentation</title>\n <style>\n .stepdefs {\n font-size: smaller;\n }\n .stepdefs li {\n margin-bottom: 0.25em;\n list-style-type: none;\n }\n .stepdefs li:before {\n content: \"\\u00BB \";\n font-size: larger;\n padding-right: 0.3em;\n }\n .stepdef {\n color: #111;\n text-decoration: none;\n }\n .extrainfo {\n display: none;\n overflow: hidden; /* Fixes jumping issue in jQuery slideToggle() */\n }\n </style>\n <script src=\"http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js\"></script>\n </head>\n <body>\n eos\n end", "title": "" }, { "docid": "b3a8c29e49aa262613e73eb855634661", "score": "0.669081", "text": "def html_boilerplate(foldername, type)\n <<-eos\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title></title>\n <link rel=\"stylesheet\" href=\"css/#{foldername}_#{type}.css\">\n <script src=\"js/jquery.min.js\"></script>\n <script src=\"js/TweenMax.min.js\"></script>\n <script src=\"js/#{foldername}_#{type}.js\"></script>\n</head>\n<body>\n <!-- Start-of-the-Image-Tags -->\n<!-- End-of-the-Image-Tags -->\n\n <div id=\"overall_mask\"></div>\n\n <!-- Start-of-the-ISI -->\n <div id=\"isi\"></div>\n <!-- End-of-the-ISI -->\n</body>\n</html>\n eos\n end", "title": "" }, { "docid": "4b3c297d95dcc7f2f0fb6de444d0dbf5", "score": "0.6655188", "text": "def content_for_head\n \"#{include_tag}\\n#{javascript}\"\n end", "title": "" }, { "docid": "66e60cd94c762970b2e787fbf8f886c0", "score": "0.664407", "text": "def haml_head(title, assets)\n head = \"\"\n head << \"%head\\n\"\n head << \" %title #{title}\\n\"\n head << \" %meta{\\\"http-equiv\\\"=>\\\"Content-Type\\\", :content=>\\\"text/html;charset=utf-8\\\"}\"\n assets.helpers.each do |lib|\n lib.gsub!(/@/, \"\")\n assets.send(lib).each {|path| head << \" #{send(lib, path)}\\n\"}\n end\n haml head\n end", "title": "" }, { "docid": "8361bb7c981f0d927336bc7a959ae087", "score": "0.6627457", "text": "def html_header(title=\"Your Bank Statement as of #{Time.now}\")\n <<-EOM\n<!DOCTYPE HTML>\n<html>\n<head>\n<title>#{title}</title>\n</head>\n<body>\n<h1>#{title}</h1>\n EOM\nend", "title": "" }, { "docid": "9e0617422c0a06fa1c66e75cb9dedd5c", "score": "0.66160935", "text": "def haml_head(title, assets)\n head = \"\"\n head << \"%head\\n\"\n head << \" %title #{title}\\n\"\n head << \" %meta{\\\"http-equiv\\\"=>\\\"Content-Type\\\", :content=>\\\"text/html;charset=utf-8\\\"}\"\n head << \" \"\n assets.helpers.each do |lib|\n lib.gsub!(/@/, \"\")\n puts lib\n assets.send(lib).each {|path| head << \" =#{lib} \\\"#{path}\\\"\\n\"}\n end\n haml head\n end", "title": "" }, { "docid": "c2952146b2b8a0ebf96cd74d702d7c75", "score": "0.6612732", "text": "def header\n puts @cgi.header\n puts <<HTML\n<html>\n<head>\n<meta http-equiv=\"content-type\" content=\"text/html; charset=utf-8\">\n<meta name=\"viewport\" content=\"width=device-width\">\n<title>Last Update List</title>\n<style type=\"text/css\"><!--\n.conductbutton{ display: inline; }\n.conductbutton p{ display: inline; }\n.conduct{ font-size: 125%; margin: 0.25em 0em; }\n#maintable td, #maintable th{ border-bottom: 1px solid black }\n--></style>\n</head>\n<body>\n<h1>Last Update List</h1>\nHTML\n end", "title": "" }, { "docid": "f749249787190ac919261ecd80cd0640", "score": "0.6579752", "text": "def html_boilerplate(foldername, type)\n <<-eos\n<!DOCTYPE html>\n<html lang=\"en\">\n<head>\n <meta charset=\"UTF-8\">\n <title></title>\n <link rel=\"stylesheet\" href=\"css/#{foldername}_#{type}.css\">\n <script src=\"js/jquery.min.js\"></script>\n <script src=\"js/TweenMax.min.js\"></script>\n <script src=\"js/#{foldername}_#{type}.js\"></script>\n</head>\n<body>\n\n <div id=\"overall_mask\"></div>\n\n <!-- Start-of-the-Image-Tags -->\n <!-- End-of-the-Image-Tags -->\n\n <!-- Start-of-the-ISI -->\n <div id=\"isi\"></div>\n <!-- End-of-the-ISI -->\n\n</body>\n</html>\neos\n end", "title": "" }, { "docid": "f6fc2acd416de7eac299ed0d619e08ae", "score": "0.65664107", "text": "def topage()\n\"<html>\n<head>\n<link rel='stylesheet' href='style.css'>\n</head>\n<body>\n <header>\n <h1>IMAGENES DE LA NASA</h1>\n </header>\n <section>\n <ul>\"\nend", "title": "" }, { "docid": "cf3badaef35bf04742ecda4c5c384e5f", "score": "0.65568024", "text": "def head\n 'head'\n end", "title": "" }, { "docid": "5834e687c1d7ab1ccc5f619e213c7a86", "score": "0.6549616", "text": "def add_to_head\n @head_html ||= []\n @head_html << yield.dup if block_given?\n end", "title": "" }, { "docid": "fd6900f91bda669725d5b951d1dcceae", "score": "0.65350425", "text": "def html_header\n if File.exist? tracker.options[:html_style]\n css = File.read tracker.options[:html_style]\n else\n raise \"Cannot find CSS stylesheet for HTML: #{tracker.options[:html_style]}\"\n end\n\n locals = {\n :css => css,\n :tracker => tracker,\n :checks => checks,\n :rails_version => rails_version,\n :railroader_version => Railroader::Version\n }\n\n Railroader::Report::Renderer.new('header', :locals => locals).render\n end", "title": "" }, { "docid": "93e186c01e7a45d859eae7fabebd4889", "score": "0.65031624", "text": "def view_layouts_base_html_head(context = {})\n\t\t\t\tcss = stylesheet_link_tag 'aam_category_tree.css', :plugin => 'aam_category_tree'\n\n\t\t\t\tcss\n\t\t\tend", "title": "" }, { "docid": "28ad8c8f73c79e4a8939c8269c53d147", "score": "0.64962953", "text": "def insert_header\n insert_common_snippet(\"Header\", :top)\n end", "title": "" }, { "docid": "b66410f48a3afa738b5a8b2786d874c5", "score": "0.6488537", "text": "def Header\n end", "title": "" }, { "docid": "3b41254368e3366151cba2a098d1fe4b", "score": "0.6450912", "text": "def head(text=nil, &block)\n content_for :head, text, &block\n end", "title": "" }, { "docid": "07810adb8eb11345c511165457cb0dfe", "score": "0.64440864", "text": "def head\n\t\t@head\n\tend", "title": "" }, { "docid": "07810adb8eb11345c511165457cb0dfe", "score": "0.64440864", "text": "def head\n\t\t@head\n\tend", "title": "" }, { "docid": "07810adb8eb11345c511165457cb0dfe", "score": "0.64440864", "text": "def head\n\t\t@head\n\tend", "title": "" }, { "docid": "07810adb8eb11345c511165457cb0dfe", "score": "0.64440864", "text": "def head\n\t\t@head\n\tend", "title": "" }, { "docid": "07810adb8eb11345c511165457cb0dfe", "score": "0.64437604", "text": "def head\n\t\t@head\n\tend", "title": "" }, { "docid": "48a8288d9a65bd9fd2bbb817a2e01062", "score": "0.6424594", "text": "def head_generator(title, assets)\n head = \"\"\n head << \"<head>\\n\"\n head << \" <meta http-equiv=\\\"Content-Type\\\" content=\\\"text/html;charset=utf-8\\\"/>\"\n head << \" <title>#{title}</title>\\n\"\n assets.helpers.each do |lib|\n lib.gsub!(/@/, \"\")\n assets.send(lib).each {|path| head << \" #{send(lib, path)}\\n\"}\n end\n head << \"</head>\"\n head\n end", "title": "" }, { "docid": "8376a2f07a13fc82e1f6c226bac6d532", "score": "0.64188784", "text": "def header\n end", "title": "" }, { "docid": "2c9d0785e7b8e063df3f0310b1de46b4", "score": "0.6392212", "text": "def head_title(*args)\n inside_layout\n super\n end", "title": "" }, { "docid": "a0b769d20135041a4151e867cec1ce76", "score": "0.6375383", "text": "def header; end", "title": "" }, { "docid": "a0b769d20135041a4151e867cec1ce76", "score": "0.6375383", "text": "def header; end", "title": "" }, { "docid": "a0b769d20135041a4151e867cec1ce76", "score": "0.6375383", "text": "def header; end", "title": "" }, { "docid": "a0b769d20135041a4151e867cec1ce76", "score": "0.6375383", "text": "def header; end", "title": "" }, { "docid": "a0b769d20135041a4151e867cec1ce76", "score": "0.6375383", "text": "def header; end", "title": "" }, { "docid": "a0b769d20135041a4151e867cec1ce76", "score": "0.6375383", "text": "def header; end", "title": "" }, { "docid": "a0b769d20135041a4151e867cec1ce76", "score": "0.6375383", "text": "def header; end", "title": "" }, { "docid": "a0b769d20135041a4151e867cec1ce76", "score": "0.6375383", "text": "def header; end", "title": "" }, { "docid": "a0b769d20135041a4151e867cec1ce76", "score": "0.6375383", "text": "def header; end", "title": "" }, { "docid": "f6640709c69d4198a40d7816be9481ee", "score": "0.6367064", "text": "def head(&block)\n content_for(:head) { block.call }\n end", "title": "" }, { "docid": "84dc8b6c4d7e0262bcec99c513c037e2", "score": "0.6366409", "text": "def variables\n head.merge(:root => root, \n :header => category || title,\n :body => body)\n end", "title": "" }, { "docid": "9c3d9072566b967667546f1e52644a48", "score": "0.63510627", "text": "def html_content_header(content, no_user_info = false)\n render(\"contents/html_header\", :content => content, :no_user_info => no_user_info)\n end", "title": "" }, { "docid": "0d08c8c0ca83975e6aa9e8bdbe130319", "score": "0.6318283", "text": "def to_html\n html = \"\"\n\n # Add a well formed HTML5 header.\n html << html_header(title)\n\n # Add the body content.\n html << body_html()\n\n # Add the document closing tags.\n html << html_footer()\n end", "title": "" }, { "docid": "f07fa0679fb46ff7211a882b2d44ad47", "score": "0.631085", "text": "def head\n ''\n end", "title": "" }, { "docid": "ee948f62beed075647ce1dfe67f4ab5c", "score": "0.6298674", "text": "def build_html(cgi, status, sections)\n cgi.html do\n build_head_html(cgi) +\n build_body_html(cgi, status, sections)\n end\nend", "title": "" }, { "docid": "b62562d9e20e2abfb64d6a8ff4fd4335", "score": "0.6288162", "text": "def head(*args, &block)\n tag!(:head, *args) do\n tag!(:meta, \"http-equiv\" => \"Content-Type\", \"content\" => \"text/html; charset=utf-8\") if @output_meta_tag\n instance_eval(&block)\n end\n end", "title": "" }, { "docid": "b62562d9e20e2abfb64d6a8ff4fd4335", "score": "0.6288162", "text": "def head(*args, &block)\n tag!(:head, *args) do\n tag!(:meta, \"http-equiv\" => \"Content-Type\", \"content\" => \"text/html; charset=utf-8\") if @output_meta_tag\n instance_eval(&block)\n end\n end", "title": "" }, { "docid": "2c664b0f602cec6d82aa899d475e35b5", "score": "0.6281908", "text": "def head_js\n if block_given?\n content_for(:head_js) { yield }\n else\n content_for :head_js\n end\n end", "title": "" }, { "docid": "861abcb4701efd7f978e0823aec6a9ca", "score": "0.6274822", "text": "def head\n :head\n end", "title": "" }, { "docid": "a386c3574015c6c93318efc110cc5fb7", "score": "0.62662685", "text": "def init_html(cmd)\n \n puts \"<link rel='stylesheet' href='file://#{e_url(@bundle_support)}/css/output.css' type='text/css' charset='utf-8' media='screen'>\"\n puts \"<script src='file://#{e_url(@bundle_support)}/js/output.js' type='text/javascript' charset='utf-8'></script>\"\n print \"<div id='top'>\n <div id='title'>Running sketch: #{@folder_name} &nbsp;</div><div id='subtitle'>#{@project_path}</div></div>\"\n puts \"<div id='outputContent'>\"\n \n end", "title": "" }, { "docid": "a386c3574015c6c93318efc110cc5fb7", "score": "0.62662685", "text": "def init_html(cmd)\n \n puts \"<link rel='stylesheet' href='file://#{e_url(@bundle_support)}/css/output.css' type='text/css' charset='utf-8' media='screen'>\"\n puts \"<script src='file://#{e_url(@bundle_support)}/js/output.js' type='text/javascript' charset='utf-8'></script>\"\n print \"<div id='top'>\n <div id='title'>Running sketch: #{@folder_name} &nbsp;</div><div id='subtitle'>#{@project_path}</div></div>\"\n puts \"<div id='outputContent'>\"\n \n end", "title": "" }, { "docid": "c3a10bcc943df440432b1b51c3e31419", "score": "0.6256777", "text": "def output_head\n output_line(@title)\n end", "title": "" }, { "docid": "1131d1811c81ad68dbd39205d76cbaf5", "score": "0.62554294", "text": "def view_layouts_base_html_head(context)\n if ActivitiesController === context[:controller]\n stylesheet_link_tag 'journal_center', :plugin => 'redmine_journal_center'\n elsif IssuesController === context[:controller] and 'show' == context[:controller].action_name\n context[:controller].send :render_to_string, :partial => 'journal_notes/full_js_init'\n end\n end", "title": "" }, { "docid": "6d1219add726d14b6313771ebe6293c7", "score": "0.62549824", "text": "def header\n display_title(\"Création de fiche\", @red)\n puts \"Sheet Generator #{@cya}#{@version}#{@std}\".center(@s_len - 1)\n puts \"Author : #{@cya}#{@author}#{@std}\".center(@s_len - 1)\n end", "title": "" }, { "docid": "6d1219add726d14b6313771ebe6293c7", "score": "0.62549824", "text": "def header\n display_title(\"Création de fiche\", @red)\n puts \"Sheet Generator #{@cya}#{@version}#{@std}\".center(@s_len - 1)\n puts \"Author : #{@cya}#{@author}#{@std}\".center(@s_len - 1)\n end", "title": "" }, { "docid": "fbf9bc767e28a6f0c43a563de1a044d8", "score": "0.62477416", "text": "def top_html\n full_html = <<-HTML\n <!DOCTYPE html>\n <html>\n <head>\n <style>\n h1 {\n color: #000;\n font-family: Georgia;\n font-size: 20px;\n line-height: 22px;\n font-weight: 700;\n font-style: italic;\n letter-spacing: 0.01em;\n word-spacing: -0.1em;\n }\n img {\n width: 225px;\n height: 225px;\n border-color: #fff;\n border-width: 1px;\n box-shadow: 1px 1px 2px lightgray;\n }\n </style>\n <title>My Gallery</title>\n </head>\n <body>\n <h1>My Gallery</h1>\n HTML\n return full_html\nend", "title": "" }, { "docid": "5521a04e99465e5a19546b00e92b4b46", "score": "0.62178916", "text": "def custom_html_header_content\n nil\n end", "title": "" }, { "docid": "a921f8207084b6efa88a767398dd67f2", "score": "0.6213644", "text": "def head(*args, &block)\n tag!(:head, *args) do\n tag!(:meta, 'http-equiv' => 'Content-Type', 'content' => 'text/html; charset=utf-8')\n instance_eval &block\n end\n end", "title": "" }, { "docid": "4cee7e5d8605cc8f3c1e22f2c90c12b0", "score": "0.6196792", "text": "def generate_header(header)\n\n \" <head id='header'></head><div class='style-header'> <h2 class='header-background-select'>#{header.form_name}</h2><div>#{header.description}</div></div><form id='form' name='#{header.form_name}' class='top page' autocomplete='off' enctype='multipart/form-data' method='#{header.form_method}' novalidate action='#{header.target_site}'><ul class='style-ul'>\"\n\n end", "title": "" }, { "docid": "f37d8ab023a7c4a9d851855e2484fc8a", "score": "0.618806", "text": "def dev_header\n return unless development?\n %Q|<!--\n DEVELOPMENT SITE\n Last Updated: #{DateTime.now.strftime(\"%b %d, %Y - %H:%M:%S\")}\n -->\n <meta name='robots' content='noindex, nofollow' />|.html_safe\n end", "title": "" }, { "docid": "be9d2f8711157cd18e9a88ac951ed914", "score": "0.6183429", "text": "def included_head_content\n included_widgets = [self.class] + output.widgets.to_a + extra_widgets\n InstallfestExternalRenderer.new(:classes => included_widgets).to_html\n end", "title": "" }, { "docid": "be9d2f8711157cd18e9a88ac951ed914", "score": "0.6183429", "text": "def included_head_content\n included_widgets = [self.class] + output.widgets.to_a + extra_widgets\n InstallfestExternalRenderer.new(:classes => included_widgets).to_html\n end", "title": "" }, { "docid": "be9d2f8711157cd18e9a88ac951ed914", "score": "0.6183429", "text": "def included_head_content\n included_widgets = [self.class] + output.widgets.to_a + extra_widgets\n InstallfestExternalRenderer.new(:classes => included_widgets).to_html\n end", "title": "" }, { "docid": "c04420a1896c435d62d77cba1e35f6fe", "score": "0.61779994", "text": "def render_head_fragment(template, entry)\n ''\n end", "title": "" }, { "docid": "98c7dedc0d8902f23d6c993eb6db25ad", "score": "0.61753476", "text": "def head(head_identity=nil)\n content_for(:head) do\n case head_identity\n when \"description\"\n \"<meta name=\\\"description\\\" content=\\\"#{yield}\\\" />\\n\"\n when \"keywords\"\n \"<meta name=\\\"keywords\\\" content=\\\"#{yield}\\\" />\\n\"\n else\n yield\n end.html_safe\n end\n end", "title": "" }, { "docid": "e38fc0ac29e89c0440b1bc350437a128", "score": "0.6172698", "text": "def html; end", "title": "" }, { "docid": "e2e1fda2908d75aa7ff23b038977ebec", "score": "0.6169628", "text": "def header\n unless @header\n h2 = html_head.at 'h2' if html_head\n @header = he_decode h2.inner_html if h2\n end\n \n @header\n end", "title": "" }, { "docid": "ea5a4b7d2778ba747bbbbb9106b58d95", "score": "0.616436", "text": "def header\n # do nothing\n end", "title": "" }, { "docid": "ef68b926152fa1a295fcdde1ef17d1a8", "score": "0.6163542", "text": "def head_content\n\t\tif @kind == \"template\"\n\t\t\t@content.scan(/<head>(.*)<\\/head>/imu).flatten.first\n\t\telse \n\t\t\t''\n\t\tend\n\tend", "title": "" }, { "docid": "d14bb4a0aa3e53fc85b75143bc6a27dd", "score": "0.6160374", "text": "def head\n end", "title": "" }, { "docid": "d14bb4a0aa3e53fc85b75143bc6a27dd", "score": "0.6160374", "text": "def head\n end", "title": "" }, { "docid": "0f23cb67a48cc49a62d67f82c194f6d3", "score": "0.61558115", "text": "def render_header\n fail \"/application/name is not found\" unless @source[:name]\n\n <<-EOS\nmeta charset=\"utf-8\"\ntitle\n | #{ERB::Util.html_escape(@source[:name])}\n EOS\n end", "title": "" }, { "docid": "41b9c7bc79df22dd12cfd488522c01a9", "score": "0.61517566", "text": "def generate_header\n tpl_path = File.join(File.dirname(__FILE__), 'templates', 'header.erb')\n rendered_doc = ERB.new(File.open(tpl_path).read).result(binding)\n\n path = File.join(Rails.root, 'doc', 'rspec_doc_00000.html')\n file = File.open(path, 'w')\n file.write(rendered_doc)\n file.close\n puts \"Reqres::Writers::Html saved doc header to #{path}\"\n end", "title": "" }, { "docid": "446ce6e59eef7ad6704f37269f0e3161", "score": "0.61418265", "text": "def render_header; end", "title": "" }, { "docid": "61b54414ca18d448a1efb3dcd5631cea", "score": "0.6139746", "text": "def page_header(text=SITE_NAME)\n content_for(:page_header)do\n content_tag(:h1, text)\n end\n\tend", "title": "" }, { "docid": "ce59cb4195f9b4b6ea692c934feb2dc0", "score": "0.6139434", "text": "def head_gen(file)\n head = file.split(\"\\n\\n\")[0]\n if head == \"NO HEAD\"\n puts \"<head>\"\n puts \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/base-min.css\\\">\"\n puts \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"/css/smd_base.css\\\">\"\n puts \"</head>\"\n else\n puts \"<head>\"\n head_parse(head)\n puts \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"https://cdnjs.cloudflare.com/ajax/libs/pure/0.6.0/base-min.css\\\">\"\n puts \"<link rel=\\\"stylesheet\\\" type=\\\"text/css\\\" href=\\\"/css/smd_base.css\\\">\"\n puts \"</head>\"\n end\nend", "title": "" }, { "docid": "2891c8de9bb485ceed1c53efa732e2c4", "score": "0.61023504", "text": "def header article; end", "title": "" }, { "docid": "2891c8de9bb485ceed1c53efa732e2c4", "score": "0.61023504", "text": "def header article; end", "title": "" }, { "docid": "cbdc30bd3427c062c79455d524c3f3e5", "score": "0.609966", "text": "def head\n @head\n end", "title": "" }, { "docid": "065e3e7f54e10ceb746dcc72d5fbb762", "score": "0.60984397", "text": "def head\n @head\n end", "title": "" }, { "docid": "9c2e269154dd7f3f777809b750c1208b", "score": "0.60968477", "text": "def header\n '<!-- Pour gérer une image de fond --><div id=\"background\"></div>'\n end", "title": "" }, { "docid": "d2895b6b08c6aa03ce45b1e9b2b95232", "score": "0.6092725", "text": "def html()\n _html = \"<div id=\\\"page\\\">\\n\"\n\n # Wrap title in anchor if link is provided\n _html += \"<h1 id=\\\"title\\\">#{@content[:title]}</h1>\\n\"\n\n # Add the rest of the necessary content\n _html += \"<div id=\\\"body\\\">\\n\" +\n \"#{@content[:body]}\\n\" +\n \"</div>\" +\n \"</div>\"\n\n _html\n end", "title": "" }, { "docid": "3654ba8170b112954f87f1329efd8acb", "score": "0.60927016", "text": "def wp_head\n # Prints scripts or data in the head tag on the front end.\n do_action 'wp_head' \n end", "title": "" }, { "docid": "44a9ceb2327a6b70940625c5de823ad3", "score": "0.60762906", "text": "def plain_html\n @title || 'Top Section'\n end", "title": "" }, { "docid": "80b97c3bb1f3cb3a8d14381261abd5da", "score": "0.60624677", "text": "def preamble; end", "title": "" } ]
8d336fb415124befa124c44fb465c72c
To be used in any controller
[ { "docid": "5128731d048d25477dfe46da14146474", "score": "0.0", "text": "def record_activity(extra)\n begin\n @activity = ActivityLog.new\n unless current_user.nil?\n @activity.user_id = current_user.id\n @activity.user = current_user.name\n end\n @activity.controller = controller_name \n @activity.action = action_name \n @activity.params = params.inspect\n @activity.ip = request.env['REMOTE_ADDR']\n @activity.browser = request.env['HTTP_USER_AGENT']\n @activity.extra = extra\n @activity.save\n rescue => e\n logger.warn(\"record_activity(): #{controller_name}-#{action_name}-#{params}: #{e}\")\n end\n end", "title": "" } ]
[ { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.71093065", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.71093065", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.71093065", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.71093065", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.71093065", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.71093065", "text": "def controller; end", "title": "" }, { "docid": "40f7f9a8053cda5781e8cf27340a2d71", "score": "0.71093065", "text": "def controller; end", "title": "" }, { "docid": "77c80309c9604e96c8868ed9ff3be3f0", "score": "0.6900796", "text": "def controller(controller); end", "title": "" }, { "docid": "b69a071a6dd10a8c7c69fbbc5721b533", "score": "0.68396014", "text": "def controller\n end", "title": "" }, { "docid": "b69a071a6dd10a8c7c69fbbc5721b533", "score": "0.68396014", "text": "def controller\n end", "title": "" }, { "docid": "06ad98ee4d4a7c6f8d73fe6611899ab4", "score": "0.6705135", "text": "def request; @controller.request; end", "title": "" }, { "docid": "ce68938c52b22e2d8552d234f995bb87", "score": "0.6680921", "text": "def controller\r\n @controller\r\n end", "title": "" }, { "docid": "928512e34ca1d76a28b3e5a1c18a9f87", "score": "0.66721416", "text": "def requestor; end", "title": "" }, { "docid": "80fb57d8ad997430cd555f8693b1d748", "score": "0.66548437", "text": "def controller; nil; end", "title": "" }, { "docid": "80fb57d8ad997430cd555f8693b1d748", "score": "0.66548437", "text": "def controller; nil; end", "title": "" }, { "docid": "157b06ed26e1b4f7cd2f3d564a6cbb80", "score": "0.6618556", "text": "def controller_class; end", "title": "" }, { "docid": "6fc66e33c4fa3df2443a99dc75fd5909", "score": "0.6505427", "text": "def before_action(controller, context)\n end", "title": "" }, { "docid": "6746e235576520784569e1a421bcbb33", "score": "0.6448695", "text": "def controller\n @controller\n end", "title": "" }, { "docid": "6746e235576520784569e1a421bcbb33", "score": "0.6448695", "text": "def controller\n @controller\n end", "title": "" }, { "docid": "2336ac161ef826b7ca8a2a4055bef7da", "score": "0.64106625", "text": "def initialize controller\n @controller = controller\n end", "title": "" }, { "docid": "28e60dbaf2d0424c71309c703f988e63", "score": "0.6343619", "text": "def before_dispatch(_env); end", "title": "" }, { "docid": "ffb5cf00c8d466d21886eaa32a75e368", "score": "0.6338018", "text": "def before_dispatch(_env)\n end", "title": "" }, { "docid": "c0cfab87dea9d66f72688e24dea02bd1", "score": "0.63362664", "text": "def controller_name() self.class.controller_name end", "title": "" }, { "docid": "7460b524d2e1d5c33e2ea2b8b180623f", "score": "0.63235545", "text": "def main\r\n MainController.instance\r\n end", "title": "" }, { "docid": "3fa7c40adf59a3dafcd85b8c1c79ad35", "score": "0.6322633", "text": "def controller=(controller); end", "title": "" }, { "docid": "0f9897ee0de631b1f348b71485f5fdf8", "score": "0.63171417", "text": "def before_render; end", "title": "" }, { "docid": "6b43d893e237e16627dc8d5f95cd5512", "score": "0.6306346", "text": "def controller_name; end", "title": "" }, { "docid": "6b43d893e237e16627dc8d5f95cd5512", "score": "0.6306346", "text": "def controller_name; end", "title": "" }, { "docid": "6b43d893e237e16627dc8d5f95cd5512", "score": "0.6306346", "text": "def controller_name; end", "title": "" }, { "docid": "0e4680a9f3cc17070dff98fd86d9a37d", "score": "0.6300828", "text": "def controller; @context.registers[:controller] end", "title": "" }, { "docid": "c191580413373faa53df68e645a073dc", "score": "0.6249197", "text": "def controller_path; end", "title": "" }, { "docid": "c191580413373faa53df68e645a073dc", "score": "0.6249197", "text": "def controller_path; end", "title": "" }, { "docid": "c191580413373faa53df68e645a073dc", "score": "0.6249197", "text": "def controller_path; end", "title": "" }, { "docid": "65ad23e1583427cb616bd6650c77ed32", "score": "0.62378716", "text": "def controller\n @controller\n end", "title": "" }, { "docid": "65ad23e1583427cb616bd6650c77ed32", "score": "0.62378716", "text": "def controller\n @controller\n end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "c5036a247d6d36888e108137980f43eb", "score": "0.62230825", "text": "def request; end", "title": "" }, { "docid": "38354c0dd0c314483e4c023b64e49f68", "score": "0.6204871", "text": "def view; end", "title": "" }, { "docid": "38354c0dd0c314483e4c023b64e49f68", "score": "0.6204871", "text": "def view; end", "title": "" }, { "docid": "e995d38921b1c9cec7da8a9e978dc58a", "score": "0.61829364", "text": "def before_dispatch(env)\n end", "title": "" }, { "docid": "b93e34c58b901f3f425cc73245a6577d", "score": "0.6180442", "text": "def controller\n self\n end", "title": "" }, { "docid": "b93e34c58b901f3f425cc73245a6577d", "score": "0.6180442", "text": "def controller\n self\n end", "title": "" }, { "docid": "b93e34c58b901f3f425cc73245a6577d", "score": "0.6180442", "text": "def controller\n self\n end", "title": "" }, { "docid": "b93e34c58b901f3f425cc73245a6577d", "score": "0.6180442", "text": "def controller\n self\n end", "title": "" }, { "docid": "c93326b850b6982d9c9b86373906daec", "score": "0.61758953", "text": "def view\n \n end", "title": "" }, { "docid": "7f35dbaefc46a2e5bd4ff62483edef9c", "score": "0.61696327", "text": "def view\n\t\t\n\tend", "title": "" }, { "docid": "7f35dbaefc46a2e5bd4ff62483edef9c", "score": "0.6169053", "text": "def view\n\t\t\n\tend", "title": "" }, { "docid": "d83d4b43f7b36b95d7343ad3a760d460", "score": "0.6159619", "text": "def real_controller; Controller.actual_object; end", "title": "" }, { "docid": "aff0ac53398c754f6cae979442edf6f5", "score": "0.61096305", "text": "def controller_file_name; end", "title": "" }, { "docid": "d6914ee36f5daf05664333dc0d095971", "score": "0.61002654", "text": "def on_before_dispatch\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.6098474", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.6098474", "text": "def action; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.6080227", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.6080227", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.6080227", "text": "def actions; end", "title": "" }, { "docid": "a80b33627067efa06c6204bee0f5890e", "score": "0.6078217", "text": "def actions\n\n end", "title": "" }, { "docid": "18362da27fb3966ac2a80ac45e32ec42", "score": "0.6077103", "text": "def views; end", "title": "" }, { "docid": "18362da27fb3966ac2a80ac45e32ec42", "score": "0.6077103", "text": "def views; end", "title": "" }, { "docid": "499815d044703d8de2c9319aa87f1724", "score": "0.6074336", "text": "def params; @controller.params; end", "title": "" }, { "docid": "cccd61fdd01396414d6cf47e1f9d36b7", "score": "0.6056258", "text": "def controller\n self\n end", "title": "" }, { "docid": "40769f9969d33ad71cb2389a7e574114", "score": "0.6031637", "text": "def institucional\n\t\t\n\tend", "title": "" }, { "docid": "c5d23a1d8161e7d7adcc240789013bd6", "score": "0.6024399", "text": "def view_context; end", "title": "" }, { "docid": "12b04df315be464b08d60d17a1aa0c5c", "score": "0.60139406", "text": "def initialize(controller)\n @controller = controller\n end", "title": "" }, { "docid": "3a79f5954648ebd0d28d87fc3d181ebf", "score": "0.6000827", "text": "def default_controller; end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.5978161", "text": "def before_action \n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.5978161", "text": "def before_action \n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.5978161", "text": "def before_action \n end", "title": "" }, { "docid": "c65e35029d875cebce65894dd00c9b3c", "score": "0.5968534", "text": "def normalize_controller!; end", "title": "" }, { "docid": "1832d9199c102b1f3987c6e720b1829f", "score": "0.5967188", "text": "def controller_path\n end", "title": "" }, { "docid": "21c7466c71dfa67f62486ba2f2347f6e", "score": "0.595566", "text": "def request\n end", "title": "" }, { "docid": "13c018fd66f905e73763814587d10177", "score": "0.5953345", "text": "def index\n \n end", "title": "" }, { "docid": "37cd029d843c7ef2fcde49f1712dd75e", "score": "0.5952172", "text": "def action args = {}\n\t\tend", "title": "" }, { "docid": "f093f2571fa70e8780a14bc7e9a1e553", "score": "0.5942991", "text": "def index\n \n end", "title": "" }, { "docid": "f093f2571fa70e8780a14bc7e9a1e553", "score": "0.5942991", "text": "def index\n \n end", "title": "" }, { "docid": "f093f2571fa70e8780a14bc7e9a1e553", "score": "0.5942991", "text": "def index\n \n end", "title": "" }, { "docid": "f093f2571fa70e8780a14bc7e9a1e553", "score": "0.5942991", "text": "def index\n \n end", "title": "" }, { "docid": "f093f2571fa70e8780a14bc7e9a1e553", "score": "0.5942991", "text": "def index\n \n end", "title": "" }, { "docid": "f093f2571fa70e8780a14bc7e9a1e553", "score": "0.5942991", "text": "def index\n \n end", "title": "" }, { "docid": "f093f2571fa70e8780a14bc7e9a1e553", "score": "0.5942991", "text": "def index\n \n end", "title": "" }, { "docid": "f093f2571fa70e8780a14bc7e9a1e553", "score": "0.5942991", "text": "def index\n \n end", "title": "" } ]
3520be7ab03c183271582621987223fc
GET /departures/new GET /departures/new.xml
[ { "docid": "2f2f72237e83c40448b15869150a054e", "score": "0.7444384", "text": "def new\n @departure = Departure.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @departure }\n end\n end", "title": "" } ]
[ { "docid": "f06e35ff5f6c6407ae3054299369d851", "score": "0.6855921", "text": "def new\n @dept = Dept.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dept }\n end\n end", "title": "" }, { "docid": "57d2de6224c6f35cff05fda775d90ac1", "score": "0.68454516", "text": "def new\n @depart = Depart.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @depart }\n end\n end", "title": "" }, { "docid": "77219616b4153a28d2227cab524c736c", "score": "0.6831737", "text": "def new\n @dept_tour_request = DeptTourRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @dept_tour_request }\n end\n end", "title": "" }, { "docid": "d1fe009c8a514790514e43c7dc89829f", "score": "0.6779922", "text": "def new\n @undefind_fee = UndefindFee.new\n @departments = Department.all.collect { |d| [d.name, d.id] }\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @undefind_fee }\n end\n end", "title": "" }, { "docid": "e7ffcf4f083a2bd9d1958cc3422ac9fd", "score": "0.67317355", "text": "def new\n @department = Department.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @department }\n end\n end", "title": "" }, { "docid": "ff0aa2bacc5109b643edc3bddf8d1b94", "score": "0.6731538", "text": "def new\n @departure = Departure.new\n @routines = Routine.order(:code)\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @departure }\n end\n end", "title": "" }, { "docid": "41d2f46897f51ed20b285fcfbdc25ea9", "score": "0.67233545", "text": "def new\n @department = Department.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @department }\n end\n end", "title": "" }, { "docid": "48ebea3b4fb3f0ded4d2e699cb7bb7cc", "score": "0.6714316", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @department }\n end\n end", "title": "" }, { "docid": "5aec3ef473572053e8a106ee5d6daf31", "score": "0.6609361", "text": "def create\n @departure = Departure.new(params[:departure])\n\n respond_to do |format|\n if @departure.save\n format.html { redirect_to(@departure, :notice => 'Departure was successfully created.') }\n format.xml { render :xml => @departure, :status => :created, :location => @departure }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @departure.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "782d57ff3b08beadfe897468db0244f9", "score": "0.66052467", "text": "def new\n @depot = Depot.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @depot }\n end\n end", "title": "" }, { "docid": "88babba6248b0adc74559b83e911a650", "score": "0.6585647", "text": "def new\n @travel = Travel.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @travel }\n end\n end", "title": "" }, { "docid": "f5cff736b4443e9cbdfb30012d519e12", "score": "0.6570136", "text": "def new\n @travelrequest = Travelrequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @travelrequest }\n end\n end", "title": "" }, { "docid": "f1614a0fd34ccd730ff858d1ca715f0a", "score": "0.65664274", "text": "def new\r\n @department = Department.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @department }\r\n end\r\n end", "title": "" }, { "docid": "3ea47bacf6709a1834ffdb264650b709", "score": "0.65448487", "text": "def new\n @departament = Departament.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @departament }\n end\n end", "title": "" }, { "docid": "9e99dc220bc2387d0d76b13deebed7a8", "score": "0.6491293", "text": "def new\n @department = Irm::Department.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @department }\n end\n end", "title": "" }, { "docid": "f54feb2062d9e02072ed308ecf5193d1", "score": "0.646283", "text": "def new\n @traveler = Traveler.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @traveler }\n end\n end", "title": "" }, { "docid": "7f36bf4c13a9a08f7660d70af01b16bb", "score": "0.6405639", "text": "def new\n @zone = Zone.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @zone }\n end\n end", "title": "" }, { "docid": "975ec7b92d1c6a9c16c504ebcdb02a77", "score": "0.63872635", "text": "def new\n @department = Department.new\n\n @hospitals = Hospital.find(:all)\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @department }\n end\n end", "title": "" }, { "docid": "b73190d58cedfa4993782698193f475b", "score": "0.63872236", "text": "def new\n @dependent = Dependent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dependent }\n end\n end", "title": "" }, { "docid": "ded46b38fc7bd65aa83267bd75a5483c", "score": "0.635772", "text": "def new\n @road = Road.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @road }\n end\n end", "title": "" }, { "docid": "95044bf079e382be81a55c2607db9741", "score": "0.63482696", "text": "def new\n @department = Department.new\n @department_categories = DepartmentCategory.find(:all)\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @department }\n end\n end", "title": "" }, { "docid": "a162e72f06eceddcc67370047e462b78", "score": "0.63450265", "text": "def new\n @roundtrip = Roundtrip.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @roundtrip }\n end\n end", "title": "" }, { "docid": "b27524de28308f6a86b7f77ec3d68ae9", "score": "0.63286906", "text": "def new\n @fleet = Fleet.new\n # @company = Company.find(params[:company_id])\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fleet }\n end\n end", "title": "" }, { "docid": "c9636d04c8c5d796873da0f50577889a", "score": "0.63166106", "text": "def new\n @party = Party.new\n\t@locations = current_host.locations\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @party }\n end\n end", "title": "" }, { "docid": "42bd375b31b7cc4c28df3761526cdb5c", "score": "0.6316056", "text": "def new\n @trip = Trip.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @trip }\n end\n end", "title": "" }, { "docid": "42bd375b31b7cc4c28df3761526cdb5c", "score": "0.6316056", "text": "def new\n @trip = Trip.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @trip }\n end\n end", "title": "" }, { "docid": "42bd375b31b7cc4c28df3761526cdb5c", "score": "0.6316056", "text": "def new\n @trip = Trip.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @trip }\n end\n end", "title": "" }, { "docid": "e9d0913ae7a631948940122a0936d32e", "score": "0.63125175", "text": "def create\n\n request = RestClient.post File.join(API_SERVER,\"rest-api/departments\"), { \n 'name' => params['department']['name'], \n 'description' => params['department']['description'] }.to_json, :content_type => :json, :accept => :json\n redirect_to :action => :index\n end", "title": "" }, { "docid": "e490bfd98725abd73ac4210fcaf61dae", "score": "0.6309737", "text": "def new\n @appt_request = ApptRequest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @appt_request }\n end\n end", "title": "" }, { "docid": "ab652c6fba3db57ce4c727840caa68a7", "score": "0.6305623", "text": "def new\n @trip = Trip.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @trip }\n end\n end", "title": "" }, { "docid": "7a1c85bf513148e775f2afac592e164e", "score": "0.628803", "text": "def new\n @hr_dept_change = Hr::DeptChange.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @hr_dept_change }\n end\n end", "title": "" }, { "docid": "43582eb4d4d7b5eacea323d396d4bc15", "score": "0.6274761", "text": "def new\r\n @service_request = ServiceRequest.new\r\n\t @flight_types = FlightType.find(:all).map {|m| [m.name, m.id]}\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.xml { render :xml => @service_request }\r\n end\r\n end", "title": "" }, { "docid": "0d040d6e8860580e39334e5bea2f2a6a", "score": "0.6262728", "text": "def new\n @flight_select = FlightSelect.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @flight_select }\n end\n end", "title": "" }, { "docid": "0bd4331b9e8f6ac73d97b43261a0358e", "score": "0.6261257", "text": "def new\n @pickup = Pickup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @pickup }\n end\n end", "title": "" }, { "docid": "5196007cd42c80156c69206c11776d70", "score": "0.6257239", "text": "def new\n @new_vehicle = NewVehicle.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new_vehicle }\n end\n end", "title": "" }, { "docid": "4fb6cc84610fef4229a3ac8fc6e197fa", "score": "0.625723", "text": "def new\n @agency = Agency.new\n list\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @agency }\n end\n end", "title": "" }, { "docid": "6813efc3c6a2bdc3e2cc43c6106511b4", "score": "0.62557364", "text": "def new\n @ship = Ship.new\n @locations = Location.find :all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ship }\n end\n end", "title": "" }, { "docid": "2bdd92106b76da33233808f9fbec6bb2", "score": "0.62434816", "text": "def new\n @festival = Festival.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @festival }\n end\n end", "title": "" }, { "docid": "bc0c8623fbec1941a13deab796822ac9", "score": "0.6243318", "text": "def new\n @station = Station.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @station }\n end\n end", "title": "" }, { "docid": "bc0c8623fbec1941a13deab796822ac9", "score": "0.6243318", "text": "def new\n @station = Station.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @station }\n end\n end", "title": "" }, { "docid": "4b506e29494c6e35e9687f9a55ca9580", "score": "0.6241998", "text": "def new\n @portfollio = Portfollio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @portfollio }\n end\n end", "title": "" }, { "docid": "91e635e2ec34c15e8ac534aaabdbc79a", "score": "0.6229946", "text": "def new\n @dept = Dept.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dept }\n end\n end", "title": "" }, { "docid": "91e635e2ec34c15e8ac534aaabdbc79a", "score": "0.6229946", "text": "def new\n @dept = Dept.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dept }\n end\n end", "title": "" }, { "docid": "5fc650a32de437203d7b48c1ae2f83e8", "score": "0.6227944", "text": "def new\n @geo = Geo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @geo }\n end\n end", "title": "" }, { "docid": "c335c1c5588414471ce4c306bdb48dc6", "score": "0.6225697", "text": "def new\n @travel = Travel.find(params[:travel_id])\n @datesprice = Datesprice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @datesprice }\n end\n end", "title": "" }, { "docid": "f6c03e9878c9a0d721009d32a7782404", "score": "0.62217444", "text": "def new\n @dept_contact = DeptContact.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dept_contact }\n end\n end", "title": "" }, { "docid": "1c829e11964ab94084936f4874bd6317", "score": "0.6213428", "text": "def new\n @adress = Adress.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @adress }\n end\n end", "title": "" }, { "docid": "8d81031028951cfc6117d7b3173abf41", "score": "0.62095064", "text": "def new\n @ordem = Ordem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @ordem }\n end\n end", "title": "" }, { "docid": "8682bcb341a756334385aa9543c01dfa", "score": "0.6208226", "text": "def new\n @path = Path.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @path }\n end\n end", "title": "" }, { "docid": "e079526edc36fbe4a6016190d3acb1a7", "score": "0.61973274", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @location }\n end\n end", "title": "" }, { "docid": "0cbeb5d96f4ef1007b8e6f1e9888f8a9", "score": "0.61968184", "text": "def new\n @apartment = Apartment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @apartment }\n end\n end", "title": "" }, { "docid": "b9fb178057187ef04904bdac318f7fa6", "score": "0.6195651", "text": "def new\n @tour = Tour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tour }\n end\n end", "title": "" }, { "docid": "b9fb178057187ef04904bdac318f7fa6", "score": "0.6195651", "text": "def new\n @tour = Tour.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @tour }\n end\n end", "title": "" }, { "docid": "6f7a4c900b0b10e925072578d6cca4ea", "score": "0.6192657", "text": "def new\n @specie = Species.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @specie }\n end\n end", "title": "" }, { "docid": "baf6079ce8d80790117ed69dd2d6de88", "score": "0.6187611", "text": "def new\n @eep = Eep.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @eep }\n end\n end", "title": "" }, { "docid": "e85e99b9474af34afaa881da3b851211", "score": "0.6187391", "text": "def new\n @department_status = DepartmentStatus.new\n @department_status.department = Department.find(params[:department_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @department_status }\n end\n end", "title": "" }, { "docid": "4d98cfa9b1335a56abc21b84920108e5", "score": "0.61849755", "text": "def new\n @city = City.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @city }\n end\n end", "title": "" }, { "docid": "4d98cfa9b1335a56abc21b84920108e5", "score": "0.61849755", "text": "def new\n @city = City.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @city }\n end\n end", "title": "" }, { "docid": "4d98cfa9b1335a56abc21b84920108e5", "score": "0.61849755", "text": "def new\n @city = City.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @city }\n end\n end", "title": "" }, { "docid": "4d98cfa9b1335a56abc21b84920108e5", "score": "0.61849755", "text": "def new\n @city = City.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @city }\n end\n end", "title": "" }, { "docid": "4d98cfa9b1335a56abc21b84920108e5", "score": "0.61849755", "text": "def new\n @city = City.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @city }\n end\n end", "title": "" }, { "docid": "4d98cfa9b1335a56abc21b84920108e5", "score": "0.61849755", "text": "def new\n @city = City.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @city }\n end\n end", "title": "" }, { "docid": "1ac57f038c620da69472ea67709ebc6c", "score": "0.6179179", "text": "def new\n @fieldtasksupply = Fieldtasksupply.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @fieldtasksupply }\n end\n end", "title": "" }, { "docid": "d2e3fd5f97f1a91ca1834be0af6c569e", "score": "0.61772764", "text": "def new\n @department_choice = DepartmentChoice.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @department_choice }\n end\n end", "title": "" }, { "docid": "1cef15a2ec9284433a829a6fff9ebc2b", "score": "0.6174804", "text": "def new\n @downfile = Downfile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @downfile }\n end\n end", "title": "" }, { "docid": "104bdd66dc4e82e0167332d65cfce475", "score": "0.6170962", "text": "def create\n @departure = Departure.new(params[:departure])\n\n respond_to do |format|\n if @departure.save\n format.html { redirect_to @departure, notice: 'Departure was successfully created.' }\n format.json { render json: @departure, status: :created, location: @departure }\n else\n format.html { render action: \"new\" }\n format.json { render json: @departure.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bd6322e526272287d3e94ff14046ad3", "score": "0.61664563", "text": "def new\n @plant_template = PlantTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @plant_template }\n end\n end", "title": "" }, { "docid": "feb6342ff9aa9575fe2d3ec5cc16de0c", "score": "0.61651796", "text": "def new\n @segment = Segments.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @segment }\n end\n end", "title": "" }, { "docid": "33fd4ba64cfb93dbedb0bc6e4c2681ee", "score": "0.61586124", "text": "def new\n @city = City.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @city }\n end\n end", "title": "" }, { "docid": "a121c5a9bf593d04ae642680c093ac24", "score": "0.6153078", "text": "def new\n @election = Election.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @election }\n end\n end", "title": "" }, { "docid": "06855f2f9c4860429dd5bc9996d30645", "score": "0.6151052", "text": "def new\n @waitlist = Waitlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @waitlist }\n end\n end", "title": "" }, { "docid": "0c4e19661a681bd89a407ec9915535d5", "score": "0.61465454", "text": "def new\n @departmentmaster = Departmentmaster.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @departmentmaster }\n end\n end", "title": "" }, { "docid": "9dac74c5361c458c638e25cac849a487", "score": "0.61451864", "text": "def new\n @province = Province.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @province }\n end\n end", "title": "" }, { "docid": "284aff6572231da3d254e5c021b6a914", "score": "0.61437845", "text": "def new\n @dead = Dead.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @dead }\n end\n end", "title": "" }, { "docid": "f29ec049d67a0c7fc415ba3821e887fe", "score": "0.6141549", "text": "def new\n @loc = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @loc }\n end\n end", "title": "" }, { "docid": "88439883e03c43e0f144f31829a55101", "score": "0.6136275", "text": "def new\n @servicelisting = Servicelisting.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @servicelisting }\n end\n end", "title": "" }, { "docid": "6fbdc594b66a5fec55bf732b987b044f", "score": "0.61282223", "text": "def new\n @district = District.new\n @provinces = []\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @district }\n end\n end", "title": "" }, { "docid": "a20ce91a1938e632e76d3e6787d4c345", "score": "0.61234814", "text": "def new\n @transportador = Transportador.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @transportador }\n end\n end", "title": "" }, { "docid": "f75458c19c2d8e3e41f2528cbb6be4c1", "score": "0.6121663", "text": "def new\n @attendee = Attendee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @attendee }\n end\n end", "title": "" }, { "docid": "f23b382a1539969b20be8b597caf3816", "score": "0.61176634", "text": "def department_new\n @department = Department.new\n @form = 'departmentForm'\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @department }\n end\n end", "title": "" }, { "docid": "eba69370c938fd0810c5469fec9f8796", "score": "0.61151147", "text": "def new\n @location = Location.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "title": "" }, { "docid": "eba69370c938fd0810c5469fec9f8796", "score": "0.61151147", "text": "def new\n @location = Location.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "title": "" }, { "docid": "80f1c49b7b183f3dd443f80820e5daa0", "score": "0.6115109", "text": "def new\n @vdig = Vdig.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @vdig }\n end\n end", "title": "" }, { "docid": "2d8d96bea2c7b1dd80fc5706cc1fbacb", "score": "0.6113102", "text": "def new\n @de_datum = DeDatum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @de_datum }\n end\n end", "title": "" }, { "docid": "cf0c200e8ff43c5f2833f2aa82c70708", "score": "0.61093974", "text": "def new\n\t\t@provinces = Province.all\n @prefecture = Prefecture.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prefecture }\n end\n end", "title": "" }, { "docid": "60869e1194df7810b87805eea930329c", "score": "0.6108703", "text": "def new\n @department = Department.new\n @button_text = 'Create'\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @department }\n end\n end", "title": "" }, { "docid": "d59d214ef2cb7e922f225e634ffa9f0e", "score": "0.6106354", "text": "def new\n @prac = Prac.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @prac }\n end\n end", "title": "" }, { "docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd", "score": "0.610558", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "title": "" }, { "docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd", "score": "0.610558", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "title": "" }, { "docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd", "score": "0.610558", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "title": "" }, { "docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd", "score": "0.610558", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "title": "" }, { "docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd", "score": "0.610558", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "title": "" }, { "docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd", "score": "0.610558", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "title": "" }, { "docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd", "score": "0.610558", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "title": "" }, { "docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd", "score": "0.610558", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "title": "" }, { "docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd", "score": "0.610558", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "title": "" }, { "docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd", "score": "0.610558", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "title": "" }, { "docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd", "score": "0.610558", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "title": "" }, { "docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd", "score": "0.610558", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "title": "" }, { "docid": "2d5d616e3f2a0171231e2f7c0d0cf5dd", "score": "0.610558", "text": "def new\n @location = Location.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @location }\n end\n end", "title": "" } ]
5af897e39203a503c0128a01f9674616
PATCH/PUT /filmmakers/1 PATCH/PUT /filmmakers/1.json
[ { "docid": "313d3cfd6e634d3083144d42c7fbccd7", "score": "0.7181654", "text": "def update\n respond_to do |format|\n if @filmmaker.update(filmmaker_params)\n format.html { redirect_to @filmmaker, notice: 'Filmmaker was successfully updated.' }\n format.json { render :show, status: :ok, location: @filmmaker }\n else\n format.html { render :edit }\n format.json { render json: @filmmaker.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "afbbb4162a5562eb326419f976bba10e", "score": "0.7299548", "text": "def update\n @filmmaker = Filmmaker.find(params[:id])\n\n respond_to do |format|\n if @filmmaker.update_attributes(params[:filmmaker])\n format.html { redirect_to @filmmaker, notice: 'Filmmaker was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @filmmaker.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e2979e359e1982a0b3eac6bbedc9c72", "score": "0.6666597", "text": "def update\n respond_to do |format|\n if @maker.update(maker_params)\n format.html { redirect_to @maker, notice: 'Maker was successfully updated.' }\n format.json { render :show, status: :ok, location: @maker }\n else\n format.html { render :edit }\n format.json { render json: @maker.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "77a54f2bee9f8372f0c86b31cd34161b", "score": "0.6659295", "text": "def update\n respond_to do |format|\n if @maker.update(maker_params)\n format.html { redirect_to @maker, notice: \"Maker was successfully updated.\" }\n format.json { render :show, status: :ok, location: @maker }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @maker.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "479922ca9bb9a1e602ba48dde16562bb", "score": "0.65763396", "text": "def update\n respond_to do |format|\n if @film.update(film_params)\n format.html { redirect_to @film, notice: 'Film mis a jour.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @film.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "05c4710e410087d1ec147cc3fe528460", "score": "0.65680903", "text": "def update\n #@user = User.find(params[:id])\n \n if @film.update(film_params)\n render JSON: @film\n else\n render JSON: @film.errors, status: :unprocessable_entity\nend\nend", "title": "" }, { "docid": "87df9aafb60cf9e0ec4c7098e100dc16", "score": "0.6443227", "text": "def update\n respond_to do |format|\n if @maker.update(maker_params)\n format.html { redirect_to @maker, notice: 'Maker was successfully updated.' }\n format.json { render :show, status: :ok, location: @maker }\n else\n format.html { render :edit }\n format.json { render json: @maker.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "15a494b30e5ae830a3dfeac382482ae9", "score": "0.6411679", "text": "def update\n respond_to do |format|\n if @film.update(film_params)\n format.html { redirect_to @film, notice: 'Filme atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @film.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b0fc01b384fb0119c2a1f5121d050842", "score": "0.63664967", "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": "007569064122e4f72e6e0f6a53ab208b", "score": "0.63393193", "text": "def update\n respond_to do |format|\n if @film_actor.update(film_actor_params)\n format.html { redirect_to @film_actor, notice: 'Film actor was successfully updated.' }\n format.json { render :show, status: :ok, location: @film_actor }\n else\n format.html { render :edit }\n format.json { render json: @film_actor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "50b83d26124da65dc26d0232206817c8", "score": "0.6256911", "text": "def update\n @missionmaker = Missionmaker.find(params[:id])\n\n respond_to do |format|\n if @missionmaker.update_attributes(params[:missionmaker])\n format.html { redirect_to @missionmaker, notice: 'Missionmaker was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @missionmaker.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a99b181cfcdc6adeac7fc3d64f46bd74", "score": "0.62325734", "text": "def update\n @farm = Farm.find(params[:id])\n\n respond_to do |format|\n if @farm.update_attributes(params[:farm])\n format.html { redirect_to @farm, notice: 'Farm was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @farm.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a99b181cfcdc6adeac7fc3d64f46bd74", "score": "0.62325734", "text": "def update\n @farm = Farm.find(params[:id])\n\n respond_to do |format|\n if @farm.update_attributes(params[:farm])\n format.html { redirect_to @farm, notice: 'Farm was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @farm.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a99b181cfcdc6adeac7fc3d64f46bd74", "score": "0.62325734", "text": "def update\n @farm = Farm.find(params[:id])\n\n respond_to do |format|\n if @farm.update_attributes(params[:farm])\n format.html { redirect_to @farm, notice: 'Farm was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @farm.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c4ae46e634c7fe45e9b497fcf83b9386", "score": "0.62127423", "text": "def update\n @microfilm_reel = MicrofilmReel.find(params[:id])\n\n respond_to do |format|\n if @microfilm_reel.update_attributes(params[:microfilm_reel])\n format.html { redirect_to @microfilm_reel, notice: 'Microfilm reel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @microfilm_reel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cae9b9978892e6e0268c76274118b166", "score": "0.6198714", "text": "def update\n #remove bypassapi from the params because it's not in the database\n newparams = movie_params.delete_if{|k,v| k == \"bypassapi\"}\n respond_to do |format|\n if @movie.update(newparams)\n format.html { redirect_to movies_url, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "63cd9307b3dd7ca5e6b8dd37755ee2ca", "score": "0.6149784", "text": "def update\n @moose = Moose.find(params[:id])\n\n respond_to do |format|\n if @moose.update_attributes(params[:moose])\n format.html { redirect_to @moose, notice: 'Moose was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @moose.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ff55d35f112269bd6ad1ffd75c67f03", "score": "0.61396503", "text": "def update\n respond_to do |format|\n if @film_caster.update(film_caster_params)\n format.html { redirect_to @film_caster, notice: 'Film caster was successfully updated.' }\n format.json { render :show, status: :ok, location: @film_caster }\n else\n format.html { render :edit }\n format.json { render json: @film_caster.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a8e4e4c0bf88c2cc384436ef17fe66c", "score": "0.61034995", "text": "def update\n @farmer = Farmer.find(params[:id])\n\n respond_to do |format|\n if @farmer.update_attributes(params[:farmer])\n format.html { redirect_to @farmer, notice: 'Farmer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @farmer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab3901334aee9aa2850e7134cfb9d0ad", "score": "0.61023986", "text": "def update\n @film = @festival.films.find(params[:id])\n @updated = @film.update_attributes(params[:film])\n \n respond_to do |format|\n format.html { raise NonAjaxEditsNotSupported }\n format.js # update.rjs\n if @updated\n format.xml { head :ok }\n else\n format.xml { render :xml => @film.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a263ddf2c12c7b6cb2afa642a574401c", "score": "0.60996896", "text": "def update\n @movie = Movie.find(params[:id])\n if params[:movie][:actors]\n params[:movie][:actors].map!{ |id|\n Actor.find(id)\n }\n else\n params[:movie][:actors] = []\n end\n if params[:movie][:genres]\n params[:movie][:genres].map!{ |id|\n Genre.find(id)\n }\n else\n params[:movie][:genres] = []\n end\n if params[:movie][:directors]\n params[:movie][:directors].map!{ |id|\n Director.find(id)\n }\n else\n params[:movie][:directors] = []\n end\n\n respond_to do |format|\n if @movie.update_attributes(params[:movie])\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c466b8c99a1ebe6fb81bd17bd53145a1", "score": "0.6040427", "text": "def set_filmmaker\n @filmmaker = Filmmaker.find(params[:id])\n end", "title": "" }, { "docid": "10d7c65f9336d1a8b1afebc4d3065300", "score": "0.6028864", "text": "def update\n respond_to do |format|\n if @maker_master.update(maker_master_params)\n format.html { redirect_to @maker_master, notice: 'Maker master was successfully updated.' }\n format.json { render :show, status: :ok, location: @maker_master }\n else\n format.html { render :edit }\n format.json { render json: @maker_master.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "892f4b9a84f89bca9813325fc5da12c1", "score": "0.6020162", "text": "def update\n @monkey = Monkey.find(params[:id])\n\n respond_to do |format|\n if @monkey.update_attributes(params[:monkey])\n format.html { redirect_to @monkey, notice: 'Monkey was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @monkey.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11c8460e9d51c08e300fe7909448d138", "score": "0.59984255", "text": "def update\n respond_to do |format|\n if @farmer.update(farmer_params)\n format.html { redirect_to @farmer, notice: 'Farmer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @farmer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5bf47ea2fe6d59b05690a4a57452105a", "score": "0.59895337", "text": "def update\n respond_to do |format|\n if @film_genre.update(film_genre_params)\n format.html { redirect_to @film_genre, notice: 'Film genre was successfully updated.' }\n format.json { render :show, status: :ok, location: @film_genre }\n else\n format.html { render :edit }\n format.json { render json: @film_genre.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "407b8bf71f4e73639d8569de23b76d87", "score": "0.5979681", "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": "833b404485afb63869e47ca1fc64eb9a", "score": "0.5978522", "text": "def update\n respond_to_update({thing: @author})\n end", "title": "" }, { "docid": "e339c7bb15421f3a5125b7652cef4048", "score": "0.59713316", "text": "def update\n redirect_to root_url\n\n # respond_to do |format|\n # if @fluke.update(fluke_params)\n # format.html { redirect_to @fluke, notice: 'Fluke was successfully updated.' }\n # format.json { render :show, status: :ok, location: @fluke }\n # else\n # format.html { render :edit }\n # format.json { render json: @fluke.errors, status: :unprocessable_entity }\n # end\n # end\n end", "title": "" }, { "docid": "905848ce874e2f44a198c3c10a1162fe", "score": "0.5968995", "text": "def update\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n if @movie.update_attributes(params[:movie])\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "905848ce874e2f44a198c3c10a1162fe", "score": "0.5968995", "text": "def update\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n if @movie.update_attributes(params[:movie])\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "905848ce874e2f44a198c3c10a1162fe", "score": "0.5968995", "text": "def update\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n if @movie.update_attributes(params[:movie])\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "905848ce874e2f44a198c3c10a1162fe", "score": "0.5968995", "text": "def update\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n if @movie.update_attributes(params[:movie])\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "905848ce874e2f44a198c3c10a1162fe", "score": "0.5968995", "text": "def update\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n if @movie.update_attributes(params[:movie])\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "905848ce874e2f44a198c3c10a1162fe", "score": "0.5968995", "text": "def update\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n if @movie.update_attributes(params[:movie])\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6815ed5f1659a6e08d7f38a57e16e449", "score": "0.5942163", "text": "def update\n respond_to do |format|\n if @theatre_movie.update(theatre_movie_params)\n format.html { redirect_to @theatre_movie, notice: 'Theatre movie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @theatre_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8adb3275cefd184ea94f5202ec0e4950", "score": "0.5940092", "text": "def update\n @taker = Taker.find(params[:id])\n\n respond_to do |format|\n if @taker.update_attributes(params[:taker])\n format.html { redirect_to @taker, notice: 'Taker was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @taker.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd0f133caf83f55eadd9f09b8037dd7f", "score": "0.5937345", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd0f133caf83f55eadd9f09b8037dd7f", "score": "0.5937345", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd0f133caf83f55eadd9f09b8037dd7f", "score": "0.5937345", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1159a6c20f4377353432cfac890f73c0", "score": "0.5936657", "text": "def update\n @movie = Movie.find(params[:id])\n\n respond_to do |format|\n if @movie.update_attributes(movie_params)\n format.html { redirect_to @movie, notice: 'La pelicula ha sido actualizada correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9a491c3dc8360a8919019e58fcb0ca51", "score": "0.59354067", "text": "def update\n @bollywood_movie = BollywoodMovie.find(params[:id])\n\n respond_to do |format|\n if @bollywood_movie.update_attributes(params[:bollywood_movie])\n format.html { redirect_to @bollywood_movie, :notice => 'Bollywood movie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @bollywood_movie.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1963e83723c85d5b9e9553897e94226f", "score": "0.5930157", "text": "def update\n respond_to do |format|\n if @wine_maker.update(wine_maker_params)\n format.html { redirect_to @wine_maker, notice: 'Wine maker was successfully updated.' }\n format.json { render :show, status: :ok, location: @wine_maker }\n else\n format.html { render :edit }\n format.json { render json: @wine_maker.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bad51ba834e6ec480a264010cfd938e2", "score": "0.59162945", "text": "def update\n respond_to do |format|\n if @fakemodel.update(fakemodel_params)\n format.html { redirect_to @fakemodel, notice: 'Fakemodel was successfully updated.' }\n format.json { render :show, status: :ok, location: @fakemodel }\n else\n format.html { render :edit }\n format.json { render json: @fakemodel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6a841ca45ed489a9ad58f3b89ab59d7e", "score": "0.59115964", "text": "def update\n @watched_movie = WatchedMovie.find(params[:id])\n\n respond_to do |format|\n if @watched_movie.update_attributes(params[:watched_movie])\n format.html { redirect_to @watched_movie, notice: 'Watched movie was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @watched_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "85d2ed02d760acd40f7badcfec78a18a", "score": "0.5899835", "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": "c7c439954870330e9b0632d3efee5e37", "score": "0.5897341", "text": "def update\n dream = Dream.find params[:id]\n dream.update dream_params\n render json: {dream: dream}\n end", "title": "" }, { "docid": "eb680c5e225bee76eda6cbedc171fa93", "score": "0.58959997", "text": "def update\n respond_to do |format|\n if @wrestler.update(wrestler_params)\n format.html { redirect_to @wrestler, notice: 'Wrestler was successfully updated.' }\n format.json { render :show, status: :ok, location: @wrestler }\n else\n format.html { render :edit }\n format.json { render json: @wrestler.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "98b95a5732c4bc5fd64df7ed536b0f77", "score": "0.58942294", "text": "def update\n @stay_in = \"Chỉnh Sửa Hãng Sản Xuất\"\n @admin_movie_maker = MovieMaker.find(params[:id])\n\n respond_to do |format|\n if @admin_movie_maker.update_attributes(params[:movie_maker])\n format.html { redirect_to admin_movie_maker_path(@admin_movie_maker), notice: 'Sửa hãng sản xuất thành công.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_movie_maker.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58778dc3331f03e0678b4c3da78776bf", "score": "0.5892074", "text": "def update\n respond_to do |format|\n if @winemaker.update(winemaker_params)\n format.html { redirect_to @winemaker, notice: \"Winemaker was successfully updated.\" }\n format.json { render :show, status: :ok, location: @winemaker }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @winemaker.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f8954bde7976396dd8d2b046ffe2db1b", "score": "0.5884838", "text": "def update\n @finder = Finder.find(params[:id])\n\n respond_to do |format|\n if @finder.update_attributes(params[:finder])\n format.html { redirect_to @finder, notice: 'Finder was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @finder.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "57f9748ea3ef675386e6ec6a4b8c3c43", "score": "0.5884738", "text": "def update\n respond_to do |format|\n if @matthew.update(matthew_params)\n format.html { redirect_to @matthew, notice: 'Matthew was successfully updated.' }\n format.json { render :show, status: :ok, location: @matthew }\n else\n format.html { render :edit }\n format.json { render json: @matthew.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c27eafb709e71795c2826580b6a3cdbe", "score": "0.5881425", "text": "def update\n @farm = Farm.find(params[:id])\n\n respond_to do |format|\n if @farm.update_attributes(params[:farm])\n format.html { redirect_to(\"/farmview\", :notice => 'Farm was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @farm.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "722304651411ca36beb63690fc1033d0", "score": "0.5874995", "text": "def update\n if @farm.update(farm_params)\n render :show, status: :ok, location: api_farm_url(@farm)\n else\n render json: @farm.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "caaefa6725274ee0351d88b030ffe5df", "score": "0.58688366", "text": "def update\n @add_moderator_to_film = AddModeratorToFilm.find(params[:id])\n\n respond_to do |format|\n if @add_moderator_to_film.update_attributes(params[:add_moderator_to_film])\n format.html { redirect_to(@add_moderator_to_film, :notice => 'Add moderator to film was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @add_moderator_to_film.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "db5bd24b1e335733541aa4c0b7c668e0", "score": "0.5850279", "text": "def update_attr\n #sanity checks \n @persona = current_persona\n @mediaset = @persona.mediasets.find(params[:id])\n \n respond_to do |format|\n @mediaset.update_attributes( params[:mediaset] )\n format.json{ respond_with_bip(@mediaset) }\n end\n end", "title": "" }, { "docid": "5134995fa0e607fc6cf4587b5ae979ad", "score": "0.58493996", "text": "def update\n respond_to do |format|\n actors = Actor.find movie_params[:actor_ids].reject! { |c| c.empty? }\n \n @movie.actors = actors\n photo = self.upload_album_photo\n @movie.photos << photo if photo\n\n data = movie_params\n data[:picture] = self.upload_photo\n\n\n if @movie.update(data)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "511c3ca96466c17502287edaec5971ea", "score": "0.5842267", "text": "def update\n @farm = Farm.find(params[:id])\n\n respond_to do |format|\n if @farm.update_attributes(params[:farm])\n flash[:notice] = 'Farm was successfully updated.'\n format.html { redirect_to(@farm) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @farm.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3dab808fe59110b67a71cfe19dce19f6", "score": "0.58373326", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html {redirect_to @movie, notice: 'Movie was successfully updated.'}\n format.json {render :show, status: :ok, location: @movie}\n else\n format.html {render :edit}\n format.json {render json: @movie.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "672b13753c7d841f10fd3b1893c3cdfe", "score": "0.5829737", "text": "def update\nrespond_to do |format|\nif @magazine.update(magazine_params)\nformat.html { redirect_to @magazine, notice: 'Magazine was successfully updated.' }\nformat.json { render :show, status: :ok, location: @magazine }\nelse\nformat.html { render :edit }\nformat.json { render json: @magazine.errors, status: :unprocessable_entity }\nend\nend\nend", "title": "" }, { "docid": "846cd085138e2b84d1e8bb0f2d8aa7fe", "score": "0.5829547", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.json { render :show, status: :ok, location: @movie }\n else\n format.json do\n render json: @movie.errors, status: :unprocessable_entity\n end\n end\n end\n end", "title": "" }, { "docid": "68b9b449652d2eaa9dc8fbee320d459f", "score": "0.5829172", "text": "def update\n @micrrapost = Micrrapost.find(params[:id])\n\n respond_to do |format|\n if @micrrapost.update_attributes(params[:micrrapost])\n format.html { redirect_to @micrrapost, notice: 'Micrrapost was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @micrrapost.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b7cb83b1fd43ea68b9c62b8b369481f", "score": "0.58233035", "text": "def update\n @wrestler = Wrestler.find(params[:id])\n\n respond_to do |format|\n if @wrestler.update_attributes(params[:wrestler])\n format.html { redirect_to(@wrestler, :notice => 'Wrestler was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @wrestler.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e9ef16a0fbdf45f55fd45ba2fdbe9676", "score": "0.58216786", "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": "c0fdcca7f0bd33ee62ff453d8c4a484b", "score": "0.5821103", "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": "add5df4517887454ec406636647af59c", "score": "0.5804705", "text": "def update\n # respond_to do |format|\n # if @kitchen.update_attributes(post_params)\n # format.html { redirect_to @kitchen, notice: 'Kitchen was successfully updated.' }\n # format.json { head :no_content }\n # else\n # format.html { render action: 'edit' }\n # format.json { render json: @kitchen.errors, status :unprocessable_entity }\n # end\n # end\n end", "title": "" }, { "docid": "5efd4df1f81e9e479923b76d8331671d", "score": "0.5802797", "text": "def update\n @micorpost = Micorpost.find(params[:id])\n\n respond_to do |format|\n if @micorpost.update_attributes(params[:micorpost])\n format.html { redirect_to @micorpost, notice: 'Micorpost was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @micorpost.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13b3fe4bcbe95f2191ff8aef474bf89d", "score": "0.57897663", "text": "def update\n respond_to do |format|\n if @remixer.update(remixer_params)\n format.html { redirect_to @remixer, notice: 'Remixer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @remixer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e68041eb736bd44a15535ee1e7991522", "score": "0.5785692", "text": "def update\n respond_to do |format|\n if @magazine.update(magazine_params)\n format.html { redirect_to @magazine, notice: 'Magazine was successfully updated.' }\n format.json { render :show, status: :ok, location: @magazine }\n else\n format.html { render :edit }\n format.json { render json: @magazine.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "83c2a445f04b4e0447820e0ab64e6ada", "score": "0.5784482", "text": "def update\n respond_to do |format|\n if @theatre_movie.update(theatre_movie_params)\n format.html { redirect_to @theatre_movie, notice: 'Theatre movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @theatre_movie }\n else\n format.html { render :edit }\n format.json { render json: @theatre_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63f0c80895ebca1b07c59bfb10138d2", "score": "0.57841694", "text": "def update\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc433daff751f1be2d7cbd492cfaee23", "score": "0.57834023", "text": "def update\n @trompler = Trompler.find(params[:id])\n\n respond_to do |format|\n if @trompler.update_attributes(params[:trompler])\n format.html { redirect_to @trompler, notice: 'Trompler was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @trompler.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61e95a27546bb7eabbea3ff35fac482b", "score": "0.5783038", "text": "def update\n respond_to do |format|\n if @movie_model.update(movie_model_params)\n format.html { redirect_to @movie_model, notice: 'Movie model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @movie_model.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "63d0239e23d1ccf276e3efd5fc9c09e6", "score": "0.5779782", "text": "def update\n respond_to do |format|\n if @farming.update(farming_params)\n format.html { redirect_to @farming, notice: 'Farming was successfully updated.' }\n format.json { render :show, status: :ok, location: @farming }\n else\n format.html { render :edit }\n format.json { render json: @farming.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "753d3af2dc310910a3da14d2ba350f20", "score": "0.57752967", "text": "def update\n respond_to do |format|\n if @course_maker.update(course_maker_params)\n format.html { redirect_to course_course_makers_path(@course_maker.course.id), notice: 'Course maker was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_maker }\n else\n format.html { render :edit }\n format.json { render json: @course_maker.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6ab55f4527125051ce520b5a2ceda900", "score": "0.5758804", "text": "def update\n @monel = Monel.find(params[:id])\n\n respond_to do |format|\n if @monel.update_attributes(params[:monel])\n format.html { redirect_to @monel, notice: 'Monel was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @monel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b4cc553d271b6529f5c406a4971e2a7", "score": "0.575827", "text": "def update\n respond_to do |format|\n if @genres_movie.update(genres_movie_params)\n format.html { redirect_to @genres_movie, notice: 'Genres movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @genres_movie }\n else\n format.html { render :edit }\n format.json { render json: @genres_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5cf04a5f119c9d2231d3358af08ed717", "score": "0.57523686", "text": "def update\n @lector = Lector.find(params[:id])\n\n respond_to do |format|\n if @lector.update_attributes(params[:lector])\n format.html { redirect_to @lector, notice: 'Las modificaciones al Lector se han guardado correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lector.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d159c7cbca38f40ed19e23c1c8112653", "score": "0.57469434", "text": "def update\n @farm = Farm.find(params[:id])\n @farm.user = @logged_user;\n respond_to do |format|\n if @farm.update_attributes(params[:farm])\n format.html { redirect_to @farm, :notice => 'Farm was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @farm.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ddcc2d6df168ae1bd4dfab0abeafab34", "score": "0.57436824", "text": "def update\n add_director\n add_actors\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d005ee3c7ca1d3ee2b0af126192a9198", "score": "0.5739575", "text": "def update\n respond_to do |format|\n if @appman.update(appman_params)\n format.html { redirect_to @appman, notice: 'Appman was successfully updated.' }\n format.json { render :show, status: :ok, location: @appman }\n else\n format.html { render :edit }\n format.json { render json: @appman.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f1966fe2318cff15e257bcfbbfe0caf1", "score": "0.5738183", "text": "def update\n @movie = @catalogue.movies.find(params[:id])\n data = params[:movie]\n if(data.has_key?(\"genres\"))\n\t\tids = Genre.get_ids(data[:genres])\n\t\tdata.delete(\"genres\")\n\tend\n\t@movie.enable_dirty_associations do\n\t\tunless ids == nil\n\t\t\t@movie.genre_ids = ids\n\t end\n\n\t respond_to do |format|\n\t if @movie.update_attributes(data)\n\t format.html { redirect_to(@movie, :notice => 'Movie was successfully updated.') }\n\t format.xml { head :ok }\n\t format.json { render :json => {:success => true} }\n\t else\n\t format.html { render :action => \"edit\" }\n\t format.xml { render :xml => @movie.errors, :status => :unprocessable_entity }\n\t format.json { render :json => {:success => false, :errors => @movie.errors} }\n\t end\n\t end\n end\n end", "title": "" }, { "docid": "ffeea4930631fc203238764331d12889", "score": "0.57377774", "text": "def update\n\n\n prepare_movie(false)\n\n respond_to do |format|\n if @movie.update(movie_params)\n format.html { redirect_to @movie, notice: 'Movie was successfully updated.' }\n format.json { render :show, status: :ok, location: @movie }\n else\n format.html { render :edit }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e225e9250605cbdb844b63e1cb92f60", "score": "0.57373923", "text": "def update\n @beer = Beer.find(params[:id])\n\n respond_to do |format|\n if @beer.update_attributes(beer_params)\n format.html { redirect_to @beer, notice: 'Beer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @beer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e225e9250605cbdb844b63e1cb92f60", "score": "0.57373923", "text": "def update\n @beer = Beer.find(params[:id])\n\n respond_to do |format|\n if @beer.update_attributes(beer_params)\n format.html { redirect_to @beer, notice: 'Beer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @beer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
9bb576243a98307bffb10f279b61dbf6
Add a song to a user
[ { "docid": "ba87406b89b0ff4fef8c7d6afe209538", "score": "0.0", "text": "def add_song(song)\n return if Song.find_by_id(song).nil?\n songs << song\n end", "title": "" } ]
[ { "docid": "c954880520c77b53853042df78b9cd4c", "score": "0.78743047", "text": "def add_user_favorite_song song_id\n params = { 'songID' => song_id }\n send_request 'addUserFavoriteSong', params\n end", "title": "" }, { "docid": "0d3ef1d3a483a70c834eabb6282aaac2", "score": "0.74939984", "text": "def add_user_library_song_ex songs = {}\n params = { 'songs' => songs }\n send_request 'addUserLibrarySongsEx', params\n end", "title": "" }, { "docid": "c5760b42aba0d8fccaa6a081bbf50c53", "score": "0.73742473", "text": "def addplay\n Play.create(user: User.find(current_user.id), song: Song.find(params['song_id']))\n redirect_to '/songs'\nend", "title": "" }, { "docid": "e4d9389d16bbfc9781bca7cb2bf706cf", "score": "0.72997296", "text": "def save_song(data)\n authed_user = current_authed_user\n return unless authed_user && authed_user.user_spotify_authenticated?\n\n song = Song.find_by(id: data['song'], event: @event)\n return if song.nil?\n\n authed_user.add_to_saved(song)\n end", "title": "" }, { "docid": "af42a350fd32ca74cd8dddbdb84ffe92", "score": "0.729643", "text": "def add_song\n @playlist = Playlist.find( params[:id] )\n @song = Song.find( params[:song_id] )\n if belongs_to_user?(current_user, @playlist, @song)\n @playlist.songs << @song\n if @playlist.save\n render json: { status: 'success', playlist: { id: @playlist.id, name: @playlist.name }, song: { id: @song.id, artist: @song.artist, name: @song.name }}\n else\n render json: { status: 'error', playlist: { id: @playlist.id, name: @playlist.name }, song: { id: @song.id, artist: @song.artist, name: @song.name }}\n end\n \n else\n render json: { status: 'error', message: 'You do not own this song or playlist' }\n end\n end", "title": "" }, { "docid": "20739e65b45fdd767ec45fafd0d24b5b", "score": "0.7167025", "text": "def set_user_song\n @user_song = UserSong.find(params[:id])\n end", "title": "" }, { "docid": "20739e65b45fdd767ec45fafd0d24b5b", "score": "0.7167025", "text": "def set_user_song\n @user_song = UserSong.find(params[:id])\n end", "title": "" }, { "docid": "4410e85bb6dd10d64bc566a0c0ef7649", "score": "0.709178", "text": "def add_song(song)\n #this method takes in an argument of a song name and associates that song w/ the artist by telling the song that it belongs to the artist\n # @songs << song\n song.artist = self\n end", "title": "" }, { "docid": "0f66bc9cb304845ca692b229a76fee77", "score": "0.707676", "text": "def add_song(song)\n songs << song\n end", "title": "" }, { "docid": "0b0f6a637767c6e9a73a918a7acc3b90", "score": "0.7061818", "text": "def add_song(song)\n songs << song\n end", "title": "" }, { "docid": "0b0f6a637767c6e9a73a918a7acc3b90", "score": "0.7061818", "text": "def add_song(song)\n songs << song\n end", "title": "" }, { "docid": "0b0f6a637767c6e9a73a918a7acc3b90", "score": "0.7061818", "text": "def add_song(song)\n songs << song\n end", "title": "" }, { "docid": "0b0f6a637767c6e9a73a918a7acc3b90", "score": "0.7061818", "text": "def add_song(song)\n songs << song\n end", "title": "" }, { "docid": "0b0f6a637767c6e9a73a918a7acc3b90", "score": "0.7061818", "text": "def add_song(song)\n songs << song\n end", "title": "" }, { "docid": "0b0f6a637767c6e9a73a918a7acc3b90", "score": "0.7061818", "text": "def add_song(song)\n songs << song\n end", "title": "" }, { "docid": "0b0f6a637767c6e9a73a918a7acc3b90", "score": "0.7061454", "text": "def add_song(song)\n songs << song\n end", "title": "" }, { "docid": "162be0af65dc9b9567a6b5f49e5d51fe", "score": "0.7057038", "text": "def add_song(song)\n songs << song \n end", "title": "" }, { "docid": "a14d3e7a1c135d8b88fde718cbdcc36d", "score": "0.70444995", "text": "def add_song(song)\n\n songs << song\n\n end", "title": "" }, { "docid": "90c1954bbe0c5fcd33f4952e4fbc47d1", "score": "0.70238423", "text": "def add_song(song)\n @songs << song\n end", "title": "" }, { "docid": "90c1954bbe0c5fcd33f4952e4fbc47d1", "score": "0.70238423", "text": "def add_song(song)\n @songs << song\n end", "title": "" }, { "docid": "90c1954bbe0c5fcd33f4952e4fbc47d1", "score": "0.70238423", "text": "def add_song(song)\n @songs << song\n end", "title": "" }, { "docid": "90c1954bbe0c5fcd33f4952e4fbc47d1", "score": "0.70238423", "text": "def add_song(song)\n @songs << song\n end", "title": "" }, { "docid": "90c1954bbe0c5fcd33f4952e4fbc47d1", "score": "0.70238423", "text": "def add_song(song)\n @songs << song\n end", "title": "" }, { "docid": "90c1954bbe0c5fcd33f4952e4fbc47d1", "score": "0.70238423", "text": "def add_song(song)\n @songs << song\n end", "title": "" }, { "docid": "90c1954bbe0c5fcd33f4952e4fbc47d1", "score": "0.70238423", "text": "def add_song(song)\n @songs << song\n end", "title": "" }, { "docid": "c0d5c1afee083d3dbd91ccaf5ac2cc46", "score": "0.7016924", "text": "def add_song(song)\n @playlist.push(song)\n end", "title": "" }, { "docid": "c0d5c1afee083d3dbd91ccaf5ac2cc46", "score": "0.7016924", "text": "def add_song(song)\n @playlist.push(song)\n end", "title": "" }, { "docid": "7fffd57ff24353a27cd4b61e28de993b", "score": "0.7004469", "text": "def add_user_library_songs song_id, album_id, artist_id\n params = { 'songIDs' => song_id, 'albumIDs' => album_id, 'artistIDs' => artist_id }\n send_request 'addUserLibrarySongs', params\n end", "title": "" }, { "docid": "328b33714868ec64d8b08909013e5590", "score": "0.7002451", "text": "def add_song\n playlist = Playlist.find(params[:id])\n song = Song.find(params[:song_id])\n #TODO playlist.add_song ??\n\n playlist.add_song(song)\n redirect_to playlist_path(playlist)\n end", "title": "" }, { "docid": "67c6d841e3a6f8c1bbdc284c03fddd27", "score": "0.6986303", "text": "def add_song(song)\n @songs << song\n end", "title": "" }, { "docid": "6681626d6dff891664c38590d980683a", "score": "0.6984789", "text": "def add_song(song)\n @songs.push(song)\n\n #hey artist, you belong to a song.\n song.artist = self\n end", "title": "" }, { "docid": "a16c49fa1357e396e9991bbd6c44bbb1", "score": "0.69778347", "text": "def add_song(song) #arg is song instance\n \tself.songs << song\n end", "title": "" }, { "docid": "e3992b268f4d8fa99255907e44a9b05c", "score": "0.6966505", "text": "def upload\r\n @user = current_user\r\n @song = Song.new\r\n end", "title": "" }, { "docid": "2e6dc28d3962b97dd5eb04bed238ab4c", "score": "0.6951792", "text": "def add_song(song)\n @songs << song\n save\n end", "title": "" }, { "docid": "68015ff666df9ad3013fe0b69308ff1e", "score": "0.6941394", "text": "def add_song\n\t\t# Ensure the user is logged in\n\t\tif(session['logged_in'] != 1)\n\t\t\trender :nothing => true and return\n\t\tend\n\t\t\n\t\t# Fetch the user's information\n\t\tuser_id = session['user_id']\n\t\tuser = User.find_by(id:user_id)\n\t\t\n\t\t# Fetch the track information\n\t\tpath = params[:path]\n\t\t\n\t\t# Get their playlist\n\t\tplaylist = user.playlist\n\t\t\n\t\t# If they do not have a playlist create new playlist for them\n\t\tif(not playlist)\n\t\t\tuser.playlist = Playlist.create()\n\t\t\tplaylist = user.playlist\n\t\t\tuser.save\n\t\tend\n\t\t\n\t\t# Find the song to add to the playlist\n\t\tmedium = Medium.find_by(file_path:path)\n\t\t\n\t\t#Grab the correct portion of the data\n\t\tif medium\n\t\t\tmusic = medium.music\n\t\tend\n\t\t\n\t\t# If there was such a song on the database, add it to the user's playlist\n\t\t# Only add this song to the playlist if it isn't already in it\n\t\tif medium and music\n\t\t\tif(not playlist.musics.find_by(id:music.id))\n\t\t\t\t# This is not in the user's playlist hence add it!\n\t\t\t\tplaylist.musics.push(music)\n\t\t\t\tplaylist.save\n\t\t\t\tuser.save\n\t\t\tend\n\t\tend\n \t\n\t\t# Return the playlist so the views can be updated using ajax\n\t\txml = \"<tracks>\"\n\t\t\n\t\t#Add all the relevant fields to the XML output\n\t\tfor music in playlist.musics\n\t\t\txml += \"<track>\"\n\t\t\txml += \"<name>#{music.medium.title}</name>\"\n\t\t\txml += \"<path>#{music.medium.file_path}</path>\"\n\t\t\txml += \"<imgpath>#{music.image_path}</imgpath>\"\n\t\t\txml += \"<artist>#{music.medium.user.username}</artist>\"\n\t\t\txml += \"<artist_id>#{music.medium.user.id}</artist_id>\"\n\t\t\t\n\t\t\t# Calculate the average rating of this song\n\t\t\trating_count = 0\n\t\t\trating_sum = 0\n\t\t\tuser_ratings = Rating.where(medium_id:music.medium.id)\n\t\t\t\n\t\t\t#Add the ratings together\n\t\t\tfor user_rating in user_ratings\n\t\t\t\trating_sum += user_rating.rating\n\t\t\t\trating_count += 1\n\t\t\tend\n\t\t\n\t\t#Initialize rating to 0\n\t\trating = 0\n\t\tputs rating_sum\n\t\tputs rating_count\n\t\t\n\t\t#Generate the actual rating if one exists\n\t\tif(rating_count != 0)\n\t\t\trating = rating_sum.to_f/rating_count\n\t\tend\n \t\t\n\t\t#Add the information to the XML output\n\t\txml += \"<rating>#{rating}</rating>\"\n \t\txml += \"<plays>#{music.plays}</plays>\"\n \t\txml += \"<songID>#{music.id}</songID>\"\n \t\txml += \"</track>\"\n\tend\n \t\n\t#Close tags and render\n\txml += \"</tracks>\"\n\trender :xml => xml and return\n\tend", "title": "" }, { "docid": "1761f08c4cf436e966c074d83e0b0b20", "score": "0.6923842", "text": "def add_song(song)\n @songs << song \n end", "title": "" }, { "docid": "ee16070548d2c84ec7a0028c2c95f180", "score": "0.69175726", "text": "def add_song(song)\n @song << song.name\n song.artist = self\n \n end", "title": "" }, { "docid": "33e71026a0096b6d3b4e6e99686a2797", "score": "0.69043833", "text": "def add_song(song)\n @songs.push(song)\n end", "title": "" }, { "docid": "503cc8285d1ee9badb8e9e0bdaf76e03", "score": "0.6895803", "text": "def add_song(song)\n\t\t@songs << song\n\tend", "title": "" }, { "docid": "6dd9881984133b446c144d7fdd94eb60", "score": "0.6895195", "text": "def add_song(song)\n song.artist = self\n @songs << song \n self.save\n song\n end", "title": "" }, { "docid": "d3d4627da141a9350a01abd9b609d2e4", "score": "0.6878833", "text": "def set_song\n @song = UserSong.find(params[:song_id])\n end", "title": "" }, { "docid": "21e54005b509d003ff8681d7cd351dfe", "score": "0.6873438", "text": "def create\n @my_song.song = @song\n @my_song.user = current_user\n\n respond_to do |format|\n if @my_song.save\n format.html { redirect_to @my_song, notice: 'Song was successfully created.' }\n format.json { render :show, status: :created, location: @my_song }\n else\n format.html { render :new }\n format.json { render json: @my_song.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "89972d4525b8569937e6fd34434f035d", "score": "0.6859187", "text": "def add_song(new_song)\n songs << new_song\n end", "title": "" }, { "docid": "c36d90849acc7e9c1dbc69664b7fdff1", "score": "0.6845649", "text": "def add_song(song)\n @songs << song\n self.save\n end", "title": "" }, { "docid": "e40abf691c1e3fd5cec42a22d748e832", "score": "0.6844672", "text": "def add_song(song)\n @songs << song\n song.artist = self #tell the song that it belongs to this artist\n end", "title": "" }, { "docid": "043d94b41606d962ff479a9a797e720f", "score": "0.68403167", "text": "def add_song(song)\n self.songs << song\n \n end", "title": "" }, { "docid": "0fd596cfd325b966e12e36003d9c9fbe", "score": "0.6838604", "text": "def set_song_user\n @song_user = SongUser.find(params[:id])\n end", "title": "" }, { "docid": "51ecbc9367f6a3ef4a5a9b6de2048290", "score": "0.68299454", "text": "def add_song(song)\n if song.artist == nil \n song.artist = self \n end \n \n if !@songs.include?(song)\n @songs << song \n end \n \n end", "title": "" }, { "docid": "0b5bfd069b728556c79319f6fdad9d0b", "score": "0.6819029", "text": "def add_song(song)\n @tracklist.push(song)\n end", "title": "" }, { "docid": "47e1b30b4561515a225f52f7652c1435", "score": "0.6816822", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "47e1b30b4561515a225f52f7652c1435", "score": "0.6816822", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "47e1b30b4561515a225f52f7652c1435", "score": "0.6816822", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "47e1b30b4561515a225f52f7652c1435", "score": "0.6816822", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "47e1b30b4561515a225f52f7652c1435", "score": "0.6816822", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "47e1b30b4561515a225f52f7652c1435", "score": "0.6816822", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "47e1b30b4561515a225f52f7652c1435", "score": "0.6816822", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "cde58724660b4696f81238b7ff706b73", "score": "0.6816621", "text": "def add_song(song)\n #song = #<Song:0x00007fb1569b5a00 @artist=#<Artist:0x00007fb1569b5af0 @name=\"Adele\", @songs=[#<Song:0x00007fb1569b5a00 ...>]>, @title=\"Hello\">\n #song é o objeto da classe Song sendo add ao artista.\n @songs << song\n song.artist = self\n @@song_count += 1\n\n end", "title": "" }, { "docid": "262cc876905a2a988b31e670dad69511", "score": "0.68102473", "text": "def add_song(song)\n \tsongs << song\n song.artist = self\n end", "title": "" }, { "docid": "f36e8efe70e251f517bf1a05507a780e", "score": "0.68075293", "text": "def add_song(song)\n self.songs().push(song)\n end", "title": "" }, { "docid": "92515a0c21e0121d694b5de0772e2a48", "score": "0.68071395", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "92515a0c21e0121d694b5de0772e2a48", "score": "0.68071395", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "92515a0c21e0121d694b5de0772e2a48", "score": "0.68071395", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "92515a0c21e0121d694b5de0772e2a48", "score": "0.68071395", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "92515a0c21e0121d694b5de0772e2a48", "score": "0.68071395", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "92515a0c21e0121d694b5de0772e2a48", "score": "0.68071395", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "92515a0c21e0121d694b5de0772e2a48", "score": "0.68071395", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "90d18ef43e04193b1bd34101076add85", "score": "0.6806887", "text": "def add_song(song)\n song.artist = self \n end", "title": "" }, { "docid": "e2298276fc30756be6bc54d4e24ac322", "score": "0.6801037", "text": "def add_song=song\n\t\t@songs << song\n\tend", "title": "" }, { "docid": "bdf735893320c11ac75705fc7bf9cfb6", "score": "0.6800864", "text": "def add_song(song)\n song.artist = self \n end", "title": "" }, { "docid": "16ad131c77470fb3db5917f663998709", "score": "0.6799267", "text": "def add_song(song)\n song.artist = self\n #puts \"#{song} belongs to #{self}\"\n end", "title": "" }, { "docid": "c0e6b0a44f8a952fddd659fb890f348f", "score": "0.67929554", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "c0e6b0a44f8a952fddd659fb890f348f", "score": "0.67929554", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "c0e6b0a44f8a952fddd659fb890f348f", "score": "0.67929554", "text": "def add_song(song)\n song.artist = self\n end", "title": "" }, { "docid": "f735cea52e4fcee35512c7c710051755", "score": "0.67875344", "text": "def add_song(song)\n song.artist = self\n @@song_count += 1\n end", "title": "" }, { "docid": "100f3fd7a3c44911848e89c0cde7cf97", "score": "0.67851055", "text": "def add_song(song)\n @songs << song\n song.artist = self\n end", "title": "" }, { "docid": "100f3fd7a3c44911848e89c0cde7cf97", "score": "0.67851055", "text": "def add_song(song)\n @songs << song\n song.artist = self\n end", "title": "" }, { "docid": "100f3fd7a3c44911848e89c0cde7cf97", "score": "0.67851055", "text": "def add_song(song)\n @songs << song\n song.artist = self\n end", "title": "" }, { "docid": "100f3fd7a3c44911848e89c0cde7cf97", "score": "0.67851055", "text": "def add_song(song)\n @songs << song\n song.artist = self\n end", "title": "" }, { "docid": "100f3fd7a3c44911848e89c0cde7cf97", "score": "0.67851055", "text": "def add_song(song)\n @songs << song\n song.artist = self\n end", "title": "" }, { "docid": "100f3fd7a3c44911848e89c0cde7cf97", "score": "0.67851055", "text": "def add_song(song)\n @songs << song\n song.artist = self\n end", "title": "" }, { "docid": "100f3fd7a3c44911848e89c0cde7cf97", "score": "0.67851055", "text": "def add_song(song)\n @songs << song\n song.artist = self\n end", "title": "" }, { "docid": "100f3fd7a3c44911848e89c0cde7cf97", "score": "0.67851055", "text": "def add_song(song)\n @songs << song\n song.artist = self\n end", "title": "" }, { "docid": "100f3fd7a3c44911848e89c0cde7cf97", "score": "0.67851055", "text": "def add_song(song)\n @songs << song\n song.artist = self\n end", "title": "" }, { "docid": "100f3fd7a3c44911848e89c0cde7cf97", "score": "0.67851055", "text": "def add_song(song)\n @songs << song\n song.artist = self\n end", "title": "" }, { "docid": "da91fecbdee113327c26ad7a99cf872c", "score": "0.67810166", "text": "def add_song (song)\n @songs << song\n song.artist = self\n end", "title": "" }, { "docid": "530e4fe00aac6e07b09d16b12da615ea", "score": "0.6774715", "text": "def add_song(song)\n self.songs() << song\n end", "title": "" }, { "docid": "265ff50b681c6c7c2ac4abb6091ae8a3", "score": "0.67694736", "text": "def add_song(song)\n @songs << song\n song.artist = self\n end", "title": "" }, { "docid": "0fd1630849bac3831172efa1e7b6dd83", "score": "0.6768535", "text": "def add_song(song)\n @songs << song \n song.artist = self\n end", "title": "" }, { "docid": "e683c2e0387bb79aafca11fa666b18cc", "score": "0.6767595", "text": "def add_song(song)\n @songs << song\n song.artist = self \n @@song_count += 1\n end", "title": "" }, { "docid": "6fbe5e83029d12bcabd91322ab15ae85", "score": "0.6766451", "text": "def library_add(songs = [])\n @client.request('userAddSongsToLibrary', songs: songs.map(&:to_hash))\n end", "title": "" }, { "docid": "46b75408d5659f8fadd457a541a67e51", "score": "0.6764887", "text": "def add_song(song)\n @songs << song\n song.artist = self\n end", "title": "" }, { "docid": "7c3e2f8363536fbc6cc803f825f416b4", "score": "0.6764866", "text": "def add_song (song)\n @songs << song\n song.artist = self\n end", "title": "" }, { "docid": "122f59e49e65821818cc6f0db6077e5c", "score": "0.67618656", "text": "def add_song(name) \n name.artist||=self\n @songs.push(name) unless @songs.include?(name)\n #@songs.push(Song.find_or_create_by_name(name))\n end", "title": "" }, { "docid": "5001be15894172aac7a833ebccbce15f", "score": "0.675933", "text": "def add_song(song)\n @songs << song\n song.artist = self\n @@song_count += 1\n end", "title": "" }, { "docid": "5001be15894172aac7a833ebccbce15f", "score": "0.675933", "text": "def add_song(song)\n @songs << song\n song.artist = self\n @@song_count += 1\n end", "title": "" }, { "docid": "5001be15894172aac7a833ebccbce15f", "score": "0.675933", "text": "def add_song(song)\n @songs << song\n song.artist = self\n @@song_count += 1\n end", "title": "" }, { "docid": "5001be15894172aac7a833ebccbce15f", "score": "0.675933", "text": "def add_song(song)\n @songs << song\n song.artist = self\n @@song_count += 1\n end", "title": "" }, { "docid": "dbc160ace33dc472a38b50fbdb721a71", "score": "0.6750151", "text": "def add_song(song)\n song.set_artist(self) unless song.artist\n @songs << song unless @songs.include?(song)\n end", "title": "" }, { "docid": "0f08b6a7ecf72e5eb5a717ee2e55b4b7", "score": "0.67427844", "text": "def add_song_by_name(song_name)\n song = Song.new(song_name)\n self.add_song(song)\n end", "title": "" }, { "docid": "c2f487ca86860deed1f028f424d325c6", "score": "0.67392004", "text": "def add_song(song)\n @songs << songs\n end", "title": "" }, { "docid": "72c1c0e66ecb131e13d5927bb73c8a64", "score": "0.6737195", "text": "def add_song(song)# song = <Song:0x007fca378a29c0 @genre=#<Genre:0x007fca378a2b00 @name=\"rap\", @songs=[#<Song:0x007fca378a29c0 ...>]>, @name=\"99 Problems\">\n song.artist = self # adds myself to songs artist # self = <Artist:0x007fca378a2c18 @name=\"Jay-Z\", @songs=[]>\n @songs << song\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "5fd4edd5a763da8cba8081f3b70dcedb", "score": "0.0", "text": "def task_params\n params.require(:task).permit(:name, :category_id, :attachment)\n end", "title": "" } ]
[ { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.69792545", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6781151", "text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1677b416ad07c203256985063859691b", "score": "0.67419964", "text": "def allow_params_authentication!; end", "title": "" }, { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.674013", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "547b7ab7c31effd8dcf394d3d38974ff", "score": "0.6734356", "text": "def default_param_whitelist\n [\"mode\"]\n end", "title": "" }, { "docid": "a91e9bf1896870368befe529c0e977e2", "score": "0.6591046", "text": "def param_whitelist\n [:role, :title]\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.6502396", "text": "def expected_permitted_parameter_names; end", "title": "" }, { "docid": "3a9a65d2bba924ee9b0f67cb77596482", "score": "0.6496313", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "068f8502695b7c7f6d382f8470180ede", "score": "0.6480641", "text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "c04a150a23595af2a3d515d0dfc34fdd", "score": "0.64565", "text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "title": "" }, { "docid": "9a2a1af8f52169bd818b039ef030f513", "score": "0.6438387", "text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "title": "" }, { "docid": "c5f294dd85260b1f3431a1fbbc1fb214", "score": "0.63791263", "text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "title": "" }, { "docid": "631f07548a1913ef9e20ecf7007800e5", "score": "0.63740575", "text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "title": "" }, { "docid": "9735bbaa391eab421b71a4c1436d109e", "score": "0.6364131", "text": "def allowed_params\n params.require(:user).permit(:username, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "12fa2760f5d16a1c46a00ddb41e4bce2", "score": "0.63192815", "text": "def param_whitelist\n [:rating, :review]\n end", "title": "" }, { "docid": "f12336a181f3c43ac8239e5d0a59b5b4", "score": "0.62991166", "text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "title": "" }, { "docid": "c25a1ea70011796c8fcd4927846f7a04", "score": "0.62978333", "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": "822c743e15dd9236d965d12beef67e0c", "score": "0.6292148", "text": "def user_params \n \tparams.require(:user).permit(:name, :email, :password, :password_confirmation)# preventing CSTR\n end", "title": "" }, { "docid": "7f0fd756d3ff6be4725a2c0449076c58", "score": "0.6290449", "text": "def user_params\n params.permit(:name, :phoneNumber, :address, :postalCode, :local, :link, :counter, :latitude, :longitude) \n end", "title": "" }, { "docid": "9d23b31178b8be81fe8f1d20c154336f", "score": "0.6290076", "text": "def valid_params_request?; end", "title": "" }, { "docid": "533f1ba4c3ab55e79ed9b259f67a70fb", "score": "0.62894756", "text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "title": "" }, { "docid": "5f16bb22cb90bcfdf354975d17e4e329", "score": "0.6283177", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "1dfca9e0e667b83a9e2312940f7dc40c", "score": "0.6242471", "text": "def whitelist_url_params\n params.require(:whitelist_url).permit(:domain)\n end", "title": "" }, { "docid": "a44360e98883e4787a9591c602282c4b", "score": "0.62382483", "text": "def allowed_params\n params.require(:allowed).permit(:email)\n end", "title": "" }, { "docid": "4fc36c3400f3d5ca3ad7dc2ed185f213", "score": "0.6217549", "text": "def permitted_params\n []\n end", "title": "" }, { "docid": "7a218670e6f6c68ab2283e84c2de7ba8", "score": "0.6214457", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "b074031c75c664c39575ac306e13028f", "score": "0.6209053", "text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "title": "" }, { "docid": "0cb77c561c62c78c958664a36507a7c9", "score": "0.6193042", "text": "def query_param\n\t\tparams.permit(:first_name, :last_name, :phone)\n\tend", "title": "" }, { "docid": "9892d8126849ccccec9c8726d75ff173", "score": "0.6177802", "text": "def strong_params\n params.require(:success_metric).permit(param_whitelist)\n end", "title": "" }, { "docid": "e3089e0811fa34ce509d69d488c75306", "score": "0.6174604", "text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "title": "" }, { "docid": "7b7196fbaee9e8777af48e4efcaca764", "score": "0.61714715", "text": "def whitelisted_user_params\n params.require(:user).\n permit( :first_name, :last_name, :email,:password,:password_confirmation,:birthday,:gender)\n end", "title": "" }, { "docid": "9d589006a5ea3bb58e5649f404ab60fb", "score": "0.6161512", "text": "def user_params\n ActionController::Parameters.permit_all_parameters = true\n params.require(:user) #.permit(:name, :surname, :phone, :password, :email, :time_zone)\n end", "title": "" }, { "docid": "d578c7096a9ab2d0edfc431732f63e7f", "score": "0.6151757", "text": "def strong_params\n params.require(:metric_change).permit(param_whitelist)\n end", "title": "" }, { "docid": "38a9fb6bd1d9ae5933b748c181928a6b", "score": "0.6150663", "text": "def safe_params\n params.require(:user).permit(:name)\n end", "title": "" }, { "docid": "7a6fbcc670a51834f69842348595cc79", "score": "0.61461", "text": "def get_params\n\t\treturn ActionController::Parameters.new(self.attributes).permit(\"account_id\", \"title\", \"category\", \"introduction\", \"tags\", \"segment_type\", \"visible\", \"status\", \"main_image\")\n\tend", "title": "" }, { "docid": "fe4025b0dd554f11ce9a4c7a40059912", "score": "0.61213595", "text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "60ccf77b296ed68c1cb5cb262bacf874", "score": "0.6106206", "text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9", "score": "0.6105114", "text": "def quote_params\n params.permit!\n end", "title": "" }, { "docid": "86b2d48cb84654e19b91d9d3cbc2ff80", "score": "0.6089039", "text": "def valid_params?; end", "title": "" }, { "docid": "34d018968dad9fa791c1df1b3aaeccd1", "score": "0.6081015", "text": "def paramunold_params\n params.require(:paramunold).permit!\n end", "title": "" }, { "docid": "6d41ae38c20b78a3c0714db143b6c868", "score": "0.6071004", "text": "def user_params\n\t\tparams.permit(:nickname, :avatar, :description, :password, :gender, :birthday, :email, :phone, :qq_id, :wechat_id)\n\tend", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "49052f91dd936c0acf416f1b9e46cf8b", "score": "0.6019971", "text": "def user_params\n params.permit(\n \t:id,\n \t:email, \n \t:first_name, \n \t:last_name, \n \t:password, \n \t:confirm_token, \n \t:phone_number,\n \t:facebook_link,\n \t:car_model,\n \t:license_plate)\n end", "title": "" }, { "docid": "5eaf08f3ad47cc781c4c1a5453555b9c", "score": "0.601788", "text": "def filtering_params\n params.permit(:email, :name)\n end", "title": "" }, { "docid": "5ee931ad3419145387a2dc5a284c6fb6", "score": "0.6011056", "text": "def check_params\n true\n end", "title": "" }, { "docid": "3b17d5ad24c17e9a4c352d954737665d", "score": "0.6010898", "text": "def wx_public_params\n params.require(:wx_public).permit(:nickname, :manager, :alias)\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": "74c092f6d50c271d51256cf52450605f", "score": "0.6001556", "text": "def listing_params\n\t\tparams.permit(:address, :transit_info, :rules, :other_info, :lat, :lng)\n\tend", "title": "" }, { "docid": "75415bb78d3a2b57d539f03a4afeaefc", "score": "0.6001049", "text": "def social_account_params\n\t\t\tparams.require(:social_account).permit!\n\t\tend", "title": "" }, { "docid": "bb32aa218785dcd548537db61ecc61de", "score": "0.59943926", "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": "65fa57add93316c7c8c6d8a0b4083d0e", "score": "0.5992201", "text": "def url_params\n params.require(:url).permit(:short_url, :original_url, :clicks, :ip_addresses)\n end", "title": "" }, { "docid": "865a5fdd77ce5687a127e85fc77cd0e7", "score": "0.59909594", "text": "def user_params\n params.require(:user).permit(:uri, :username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "ec609e2fe8d3137398f874bf5ef5dd01", "score": "0.5990628", "text": "def model_params\n\t\tparams.require(:manager).permit(\n\t :user_name,\n :password,\n :email,\n \t\t\t)\n\tend", "title": "" }, { "docid": "423b4bad23126b332e80a303c3518a1e", "score": "0.5980841", "text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "title": "" }, { "docid": "48e86c5f3ec8a8981d8293506350accc", "score": "0.59669393", "text": "def college_whitelist_params\n params.require(:college_whitelist).permit(:status)\n end", "title": "" }, { "docid": "9f774a9b74e6cafa3dd7fcc914400b24", "score": "0.59589154", "text": "def active_code_params\n params[:active_code].permit\n end", "title": "" }, { "docid": "a573514ae008b7c355d2b7c7f391e4ee", "score": "0.5958826", "text": "def filtering_params\n params.permit(:email)\n end", "title": "" }, { "docid": "2202d6d61570af89552803ad144e1fe7", "score": "0.5957911", "text": "def valid_params(params)\n params.permit(:user_id, :photo_id, :originX, :originY, :width, :height)\n end", "title": "" }, { "docid": "8b571e320cf4baff8f6abe62e4143b73", "score": "0.5957385", "text": "def ip_address_params\n\t\t\tparams.require(:ip_address).permit!\n end", "title": "" }, { "docid": "d493d59391b220488fdc1f30bd1be261", "score": "0.5953072", "text": "def pull_request_params\n whitelist = [\n :url,\n :id,\n :html_url,\n :diff_url,\n :patch_url,\n :issue_url,\n :number,\n :state,\n :locked,\n :title\n ]\n params.require(:pull_request).permit(whitelist)\n end", "title": "" }, { "docid": "f18c8e1c95a8a21ba8cd6fbc6d4d524a", "score": "0.59526145", "text": "def reserved_params\n params.require(:reserved).permit(:name, :email, :pax, :address, :KTP, :title)\n end", "title": "" }, { "docid": "4e6017dd56aab21951f75b1ff822e78a", "score": "0.5943361", "text": "def post_params\n if current_user.admin? \n params.permit(:title, :body, :city, :country, :gps_location, :privacy, :visible, :latitude, :longitude, images: [], files: [])\n else \n params.permit(:title, :body, :city, :country, :gps_location, :privacy,:latitude, :longitude, images: [], files: [])\n end \n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.59386164", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.59375334", "text": "def filter_parameters; end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.59375334", "text": "def filter_parameters; end", "title": "" }, { "docid": "5060615f2c808bab2d45f4d281987903", "score": "0.5933856", "text": "def vineyard_params\n params.permit(:vineyard_name, :email, :website_url, :phone, :address, :city, :region, :postcode, :country, :specialty, :description, :pet_friendly, :holiday, :tours, :events, :family_friendly, :cover_image, :image_one, :image_two, :image_three, :image_four, :user_id, :base64)\n end", "title": "" }, { "docid": "7fa620eeb32e576da67f175eea6e6fa0", "score": "0.59292704", "text": "def available_activity_params\n # params.require(:available_activity).permit(:type,:geometry,:properties)\n whitelisted = ActionController::Parameters.new({\n type: params.require(:available_activity)[:type],\n geometry: params.require(:available_activity)[:geometry].try(:permit!).to_h,\n properties: params.require(:available_activity)[:properties].try(:permit!).to_h\n }).try(:permit!)\n end", "title": "" }, { "docid": "d9483565c400cd4cb1096081599a7afc", "score": "0.59254247", "text": "def user_params\n params.permit(:name, :username, :email, :password, :img_url, :bg_url, :coinbank)\n end", "title": "" }, { "docid": "f7c6dad942d4865bdd100b495b938f50", "score": "0.5924164", "text": "def user_params_pub\n\t \tparams[:user].permit(:hruid)\n\t end", "title": "" }, { "docid": "70fa55746056e81854d70a51e822de66", "score": "0.59167904", "text": "def user_params\n params.permit(:id, :email, :password, :nickname, :status, :avatar, :flat_picture, :flatsharing_id, :member,\n :user, :color, :solde)\n end", "title": "" }, { "docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa", "score": "0.59088355", "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": "3eef50b797f6aa8c4def3969457f45dd", "score": "0.5907542", "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": "753b67fc94e3cd8d6ff2024ce39dce9f", "score": "0.59064597", "text": "def url_whitelist; end", "title": "" }, { "docid": "f9f0da97f7ea58e1ee2a5600b2b79c8c", "score": "0.5906243", "text": "def admin_social_network_params\n params.require(:social_network).permit!\n end", "title": "" }, { "docid": "5bdab99069d741cb3414bbd47400babb", "score": "0.5898226", "text": "def filter_params\n params.require(:filters).permit(:letters)\n end", "title": "" }, { "docid": "7c5ee86a81b391c12dc28a6fe333c0a8", "score": "0.589687", "text": "def origin_params\n params.permit(:country, :state, :city, :postal_code, :address, :description)\n end", "title": "" }, { "docid": "de77f0ab5c853b95989bc97c90c68f68", "score": "0.5896091", "text": "def valid_params(params)\n params.permit(:login, :first_name, :last_name, \n :password, :password_confirmation)\n end", "title": "" }, { "docid": "29d030b36f50179adf03254f7954c362", "score": "0.5894501", "text": "def sensitive_params=(params)\n @sensitive_params = params\n end", "title": "" }, { "docid": "bf321f5f57841bb0f8c872ef765f491f", "score": "0.5894289", "text": "def permit_request_params\n params.permit(:address)\n end", "title": "" }, { "docid": "5186021506f83eb2f6e244d943b19970", "score": "0.5891739", "text": "def user_params\n # Ensure a user can't give themselves admin priveleges\n params.delete(:admin) if current_user.admin?\n params.require(:user).permit(:name, :email, :admin, :image)\n end", "title": "" }, { "docid": "b85a12ab41643078cb8da859e342acd5", "score": "0.58860534", "text": "def secure_params\n params.require(:location).permit(:name)\n end", "title": "" }, { "docid": "46e104db6a3ac3601fe5904e4d5c425c", "score": "0.5882406", "text": "def strong_params\n params.require( :setting ).\n permit( :global_scan_limit, :per_user_scan_limit,\n :target_whitelist_patterns, :target_blacklist_patterns )\n end", "title": "" }, { "docid": "abca6170eec412a7337563085a3a4af2", "score": "0.587974", "text": "def question_params\n params.require(:survey_question).permit(question_whitelist)\n end", "title": "" }, { "docid": "26a35c2ace1a305199189db9e03329f1", "score": "0.58738774", "text": "def case_insensitive_params\n params.require(:case_insensitive).permit(:name)\n end", "title": "" }, { "docid": "de49fd084b37115524e08d6e4caf562d", "score": "0.5869024", "text": "def empire_master_no_match_params\n params.require(:empire_master_no_match).permit(:uid, :last_name, :list, :search_date, :double, :source)\n end", "title": "" }, { "docid": "7b7ecfcd484357c3ae3897515fd2931d", "score": "0.58679986", "text": "def maintenance_request_params\n params[:maintenance_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "0016f219c5d958f9b730e0824eca9c4a", "score": "0.5867561", "text": "def unwanted_params\n params.require(:unwanted).permit(:title, :description, :image)\n end", "title": "" }, { "docid": "8aa9e548d99691623d72891f5acc5cdb", "score": "0.5865932", "text": "def url_params\n params[:url].permit(:full)\n end", "title": "" }, { "docid": "c6a8b768bfdeb3cd9ea388cd41acf2c3", "score": "0.5864461", "text": "def backend_user_params\n params.permit!\n end", "title": "" }, { "docid": "be95d72f5776c94cb1a4109682b7b224", "score": "0.58639693", "text": "def filter_params\n\t\treturn params[:candidate].permit(:name_for_filter)\n\tend", "title": "" }, { "docid": "967c637f06ec2ba8f24e84f6a19f3cf5", "score": "0.58617616", "text": "def speed_measurement_params\n\n #fuckit, to lazy to deal with permit crap right now\n ActionController::Parameters.permit_all_parameters = true\n\n params[:speed_measurement]\n end", "title": "" }, { "docid": "e4a29797f9bdada732853b2ce3c1d12a", "score": "0.5861436", "text": "def user_params\n params.permit(:name, :age, :username, :display_photo, :password)\n end", "title": "" }, { "docid": "d14f33ed4a16a55600c556743366c501", "score": "0.5860451", "text": "def get_params\r\n #params.require(:article).permit(:title, :permalink, :content, :source_site, :introtext, :type_id, :order_by, :searchable, :created_by, :edited_by, :published_by, :published_on, :user_id)\r\n params.require(:article).permit!\r\n\r\n end", "title": "" }, { "docid": "46cb58d8f18fe71db8662f81ed404ed8", "score": "0.58602303", "text": "def pub_params\n params.require(:pub).permit(:name, :description, :phone, :email, :hidden, :city_id, :address)\n end", "title": "" }, { "docid": "7e9a6d6c90f9973c93c26bcfc373a1b3", "score": "0.5854586", "text": "def pass_params\n params[:pass].permit(:name, :price, :description, :colour, :events)\n end", "title": "" }, { "docid": "ad61e41ab347cd815d8a7964a4ed7947", "score": "0.58537364", "text": "def droptraining_params\n params.permit(:training_id,:user_id, :utf8, :authenticity_token, :commit)\n end", "title": "" }, { "docid": "8894a3d0d0ad5122c85b0bf4ce4080a6", "score": "0.5850427", "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": "53d84ad5aa2c5124fa307752101aced3", "score": "0.5850199", "text": "def parameter_params\n params.require(:parameter).permit(:name, :description, :param_code, :param_value, :active_from, :active_to)\n end", "title": "" } ]
66e26fa055d5c8e98ebf6c1ed75cb0b0
Parses the supplied input and returned a decommented, tagified and cleaned string.
[ { "docid": "e7dbb9653548a359aa3893d6f64c2b9e", "score": "0.84885716", "text": "def parse\n tagify(decommentify(@input)).strip\n end", "title": "" } ]
[ { "docid": "0fcf26283ccac8df1664dffc3be24b1e", "score": "0.68763405", "text": "def decommentify input\n output = input.dup\n # Remove multiline comments:\n output.gsub!(/(#{Regexp.quote @block_comment_start}.+?#{Regexp.quote @block_comment_end})/m, \"\")\n # Remove inline comments:\n output.gsub!(/(#{Regexp.quote @inline_comment_delimiter}.+$)/,\"\")\n return output.lines.map(&:strip).join($/)\n end", "title": "" }, { "docid": "ddfa85130b2bc65f2085fbf4342e54ec", "score": "0.60611886", "text": "def sanitize input\n sanitized = []\n blank_or_comment = /^(\\s+$|\\/\\/.+)$/\n input.each do |line|\n next if line.match(blank_or_comment)\n sanitized << strip_comments(line)\n end\n sanitized\n end", "title": "" }, { "docid": "7eca9a2ed8abbc6968677e3e1cea4eea", "score": "0.6016763", "text": "def clean_input(input)\n input.strip\n end", "title": "" }, { "docid": "530e38644dcde883c5bf70ac47459c92", "score": "0.5880021", "text": "def normalize_comment text\n return text if text.empty?\n\n case language\n when :ruby\n text = strip_hashes text\n when :c\n text = strip_stars text\n end\n text = expand_tabs text\n text = flush_left text\n text = strip_newlines text\n text\n end", "title": "" }, { "docid": "52bfa71e29ca4ea3a49b96b166c045bf", "score": "0.5862776", "text": "def normalize_comment text\n return text if text.empty?\n\n text = strip_hashes text\n text = expand_tabs text\n text = flush_left text\n strip_newlines text\n end", "title": "" }, { "docid": "5769d8363f6ad28dd757f3b062f18d3d", "score": "0.5830343", "text": "def parse (input)\n\t\treturn parse_tail(input.gsub('(', ' ( ').gsub(')', ' ) ').split)\n\tend", "title": "" }, { "docid": "16ec73a0a0d01cb4ae6f21032159024d", "score": "0.57398254", "text": "def format_input(input)\n raise \"No content in entry\" if input.nil? || input.strip.length == 0\n input_lines = input.split(/[\\n\\r]+/)\n title = input_lines[0].strip\n note = input_lines.length > 1 ? input_lines[1..-1] : []\n note.map! { |line|\n line.strip\n }.delete_if { |line|\n line =~ /^\\s*$/\n }\n\n [title, note]\n end", "title": "" }, { "docid": "3b2c75976c45b4ef1470ef0f7af6dc03", "score": "0.5672524", "text": "def sanitize_input(input)\n\t\tclean_input = input.to_s.scan(/(\"[^\"]+?\"|\\S+)/).flatten.join \" \"\n\n case clean_input[-1]\n when '+'\n [ clean_input[0...-1], :verbose ]\n when '!'\n [ clean_input[0...-1], :full ]\n else\n [ clean_input, :basic ]\n end\n end", "title": "" }, { "docid": "b7ab1b936ab42e722467e972fda2d4ad", "score": "0.567195", "text": "def smartify(input); end", "title": "" }, { "docid": "707c3f856f21f940223ce3c5dfa5e5d2", "score": "0.56578", "text": "def parse_with_comments(source); end", "title": "" }, { "docid": "26ca16066fc3f903a4a9352faa445c64", "score": "0.5651834", "text": "def lex_comment(input)\n case input\n when /\\A\\s*\\/\\// # single line comment //\n if /\\A\\s*(\\/\\/.*?\\n)/.match(input)\n return :comment, $1, $'\n else\n return :open, '//', input\n end\n when /\\A\\s*\\/\\*/m # multi-line comment /* */\n if /\\A\\s*(\\/\\*.*?\\*\\/)/m.match(input)\n return :comment, $1, $'\n else\n return :open, '/*', input\n end\n when /\\A\\s*@\"/ # objective C string\n if :objective_c == @language\n token, value, rest = lex_string($')\n if :open == token\n return :open, '@\"', input\n elsif :error == token\n return :error, nil, input\n else\n return :string, '@\"' + value, rest\n end\n else\n return :error, nil, input\n end\n when /\\A\\s*\"/ # double quoted string \" \"\n token, value, rest = lex_string($')\n if :open == token\n return :open, '\"', input\n elsif :error == token\n return :error, nil, input\n else\n return :string, '\"' + value, rest\n end\n when /\\A\\s*'/ # char literal ' '\n token, value, rest = lex_char($')\n if :open == token\n return :open, \"'\", input\n elsif :error == token\n return :error, nil, input\n else\n return :char, \"'\" + value, rest\n end\n when /\\A\\s*(@#{@regex_identifier})/ # objective c directive\n value, rest = $1, $'\n if @keywords.include?(value)\n return :keyword, value, rest\n else\n return :error, nil, input\n end\n when /\\A\\s*(#{@regex_identifier})/\n value, rest = $1, $'\n if @keywords.include?(value)\n return :keyword, value, rest\n elsif @unique_tokens.has_key?(value)\n return @unique_tokens[value], value, rest\n else\n return :identifier, value, rest\n end\n when /\\A\\s*(#{@regex_float})/\n return :float, $1, $'\n when /\\A\\s*(#{@regex_hex_float})/\n return :float, $1, $'\n when /\\A\\s*(#{@regex_integer})/\n return :integer, $1, $'\n when /\\A\\s*(\\S.*)\\z/m\n val, rest = lex_punctuator($1)\n if val\n return :punctuator, val, rest\n else\n return :error, nil, input\n end\n else\n return :end\n end\n end", "title": "" }, { "docid": "da0e67d3abbd2ad69adcb9de72f64687", "score": "0.56191075", "text": "def read_file_omitting_comments(input)\n return '' unless File.exist?(input)\n\n File.readlines(input).reject { |line| line =~ /^\\s*#/ }.join('')\n end", "title": "" }, { "docid": "485696003491cb635d479fbafe0b939b", "score": "0.56007427", "text": "def filter_comment_format(comment, struct_comment)\n sc, cc = struct_comment, comment\n comment = nil unless cc && cc.match(/./)\n sc = nil unless sc && sc.match(/./)\n if cc || sc\n [cc, sc].uniq.compact.join(' / ').gsub(/\"/, '')\n else\n ''\n end\n end", "title": "" }, { "docid": "3281bc2efd787812baf3ecfa1cfe2ad6", "score": "0.5599831", "text": "def parse input\n ## split input into lines, remove comments and evaluate any variables\n\n lines = input.split(\"\\n\").delete_if { |l| \n l == \"\" || l =~ /^;;/ }.map{ |l| evaluate_line l }\n\n scan lines\n end", "title": "" }, { "docid": "84124c5e80006d52b17b1e0fafd3911d", "score": "0.5578136", "text": "def clean( input )\n input.gsub( %r/\\s+/, '' )\n end", "title": "" }, { "docid": "676d401ebfe5443d2ec878345afd791e", "score": "0.55403787", "text": "def parse_comments(comments)\n return '' if !comments || comments.empty?\n meta_match = /^@(\\S+)\\s*(.*)/\n comments = comments.split(/\\r?\\n/) if comments.is_a? String\n docstring = \"\"\n\n indent, last_indent = comments.first[/^\\s*/].length, 0\n orig_indent = 0\n last_line = \"\"\n tag_name, tag_klass, tag_buf, raw_buf = nil, nil, \"\", []\n\n (comments+['']).each_with_index do |line, index|\n indent = line[/^\\s*/].length \n empty = (line =~ /^\\s*$/ ? true : false)\n done = comments.size == index\n\n if tag_name && (((indent < orig_indent && !empty) || done) || \n (indent <= last_indent && line =~ meta_match))\n create_tag(tag_name, tag_buf, raw_buf)\n tag_name, tag_buf, raw_buf = nil, '', []\n orig_indent = 0\n end\n\n # Found a meta tag\n if line =~ meta_match\n orig_indent = indent\n tag_name, tag_buf = $1, $2 \n raw_buf = [tag_buf.dup]\n elsif tag_name && indent >= orig_indent && !empty\n # Extra data added to the tag on the next line\n last_empty = last_line =~ /^[ \\t]*$/ ? true : false\n \n if last_empty\n tag_buf << \"\\n\\n\" \n raw_buf << ''\n end\n \n tag_buf << line.gsub(/^[ \\t]{#{indent}}/, last_empty ? '' : ' ')\n raw_buf << line.gsub(/^[ \\t]{#{orig_indent}}/, '')\n elsif !tag_name\n # Regular docstring text\n docstring << line << \"\\n\" \n end\n\n last_indent = indent\n last_line = line\n end\n\n # Remove trailing/leading whitespace / newlines\n docstring.gsub!(/\\A[\\r\\n\\s]+|[\\r\\n\\s]+\\Z/, '')\n end", "title": "" }, { "docid": "61b8b26f15a543f92f99a11d81ef02d7", "score": "0.55115265", "text": "def strip_bbcode(string); end", "title": "" }, { "docid": "7fd4e3a3b5ca7596d57a0731ca2bd430", "score": "0.54699934", "text": "def untag(txt)\n Sanitize.clean(txt).strip.gsub(/\\s+/, \" \")\n end", "title": "" }, { "docid": "409072e655530cc094ea59f2ea21bef5", "score": "0.545502", "text": "def find_and_flatten(input)\n input.scan(/<(textarea|code|pre)[^>]*>(.*?)<\\/\\1>/im).each do |thing|\n input = input.gsub(thing[1], flatten(thing[1]))\n end\n input\n end", "title": "" }, { "docid": "880cdc9bf17c715ce78ce68284a4ad70", "score": "0.52819693", "text": "def clean_string(input)\r\n unless input.nil?\r\n input = input.to_s.gsub(/^[\\s]+|[\\s]+$/, \"\")\r\n end\r\n return input\r\n end", "title": "" }, { "docid": "6665e34b2849ce490ae82eebef40e1de", "score": "0.52743155", "text": "def parse_comments(comments); end", "title": "" }, { "docid": "c8bf01390e9e118fda6594825bfa9623", "score": "0.5249198", "text": "def cleaned s, whitelist=%w[ref]\r\n\ts ||= ''\r\n\twhitelist << '---' # prevent empty (?!) in regexes\r\n\t\r\n\ts.gsub(/'{2,3}/, '').gsub(/<(?!#{whitelist.join '|'})(?!\\/(?:#{whitelist.join '|'}))[^>]+>/, '')\r\nend", "title": "" }, { "docid": "27844c4557a86d841c4c5ebce00ab8e1", "score": "0.5237271", "text": "def filter(comment)\n return '' if comment =~ /^=pod\\s*$/\n comment.gsub!(/^=pod/, '==')\n\n comment.gsub!(/^=head(\\d+)/) do\n \"=\" * $1.to_i\n end\n comment.gsub!(/=item/, '');\n comment.gsub!(/C<(.*?)>/, '<tt>\\1</tt>');\n comment.gsub!(/I<(.*?)>/, '<i>\\1</i>');\n comment.gsub!(/B<(.*?)>/, '<b>\\1</b>');\n comment\n end", "title": "" }, { "docid": "26daa4989609221fc45743bf812ab6b2", "score": "0.52244794", "text": "def sanitize(input, options={})\n return \"\" if input.nil? or input.empty?\n \n # Only take elements inside of <body>\n @doc = Hpricot(input)\n @doc = Hpricot(@doc.at(\"body\").inner_html) if @doc.at(\"body\")\n sanitized = Aqueduct::RailsSanitizer.white_list_sanitizer.sanitize(@doc.to_html)\n\n # Start parsing sanitized doc\n @doc = Hpricot(sanitized)\n\n # Rewrite all id's to appened network_key\n append_id(@options[:append]) unless @options[:append].nil?\n\n @options[:formatted] == false ? @doc.to_html.gsub(/\\r|\\n/i,'') : @doc.to_html \n end", "title": "" }, { "docid": "7c1e2c99d0c85589e7931688ad6c9b83", "score": "0.5217194", "text": "def comment(string); end", "title": "" }, { "docid": "7c1e2c99d0c85589e7931688ad6c9b83", "score": "0.5217194", "text": "def comment(string); end", "title": "" }, { "docid": "7c1e2c99d0c85589e7931688ad6c9b83", "score": "0.5217194", "text": "def comment(string); end", "title": "" }, { "docid": "7c1e2c99d0c85589e7931688ad6c9b83", "score": "0.5217194", "text": "def comment(string); end", "title": "" }, { "docid": "165aafb8572f0861ce62065be7f2cffd", "score": "0.52161866", "text": "def lex(input)\n loop do\n token, value, rest = lex_comment(input)\n if :comment == token\n raise \"infinite loop on input: #{input}\" if input == rest\n input = rest\n else\n return token, value, rest\n end\n end\n end", "title": "" }, { "docid": "82437bd7aad96ee3d8dc8a4dd0aa6879", "score": "0.5208185", "text": "def prepare_comment_text(comment)\n simple_format comment.body\n # raw comment.body.split(\"\\n\").map(&:squish).reject(&:blank?).map { |s| parse_common_string s }.join\n end", "title": "" }, { "docid": "fb98843e67f281ecc0af854bf75c520c", "score": "0.52003723", "text": "def format\n # first of all, handle extended tags\n strs = reduce_nested_tag do |str, snip|\n start = str.index(snip)\n sub = str[start, snip.size]\n str[start, snip.size] = sub.gsub(extended_regex) do |variable|\n variable = variable[1, variable.size] # remove $\n dispatch(variable)\n end\n str\n end\n \n strs.gsub(variable_regex) do |variable|\n variable = variable[1, variable.size] # remove $\n dispatch(variable)\n end.gsub(shell_regex) do |variable|\n dispatch(variable)\n end\n end", "title": "" }, { "docid": "d0c66025d6d1fc4763ae742149ceca6e", "score": "0.51991594", "text": "def detect_comments\n if @input =~ %r{^\\s*[/]{2}}\n @mode = :comment\n @expression = ''\n end\n end", "title": "" }, { "docid": "f9afa7173b1aacf6e6f80d35ac6304a6", "score": "0.5196817", "text": "def remove_blank_and_comment_line(str)\n str.gsub! /^\\s*#.*/, ''\n str.gsub! /^\\s*\\/\\*((?!\\*\\/).)*\\*\\//m, ''\n str.gsub! /\\n\\s*/, \"\\n\"\n str.strip\n end", "title": "" }, { "docid": "907c0545a7cd5583f26ecc5c076672c5", "score": "0.5188881", "text": "def unorphan(input)\n input.sub(/\\s+(\\S+)\\s*$/, '&nbsp;\\1')\n end", "title": "" }, { "docid": "f9fd87494d6cd677ca26d88d3696d98e", "score": "0.51652336", "text": "def parse_text(text)\n ## Strip html\n Sanitize::clean!(text, :remove_contents => ['script','style'])\n text.gsub!(/[\\n\\t]+/, ' ')\n text\n end", "title": "" }, { "docid": "04ae085f39f172501b6e73079305caeb", "score": "0.5120442", "text": "def remove_comments(raw_html)\n raw_html.gsub(/&lt;!--(.*?)--&gt;/, \"\")\n end", "title": "" }, { "docid": "9b62428e7ca8391451d0a7bd5a6a9199", "score": "0.5115187", "text": "def read(input)\n Extractor.input_cache(input)\n # if unxml\n # txt.gsub(/\\<(.*?)\\>/, '')\n # else\n # txt\n # end\n end", "title": "" }, { "docid": "9efa597f4c18839ee136c35e7dd06ec1", "score": "0.5107147", "text": "def preprocess_input(input)\n input\nend", "title": "" }, { "docid": "127b9098f13644bb1db50beb15e6a495", "score": "0.50897425", "text": "def parse\n self.data = BdlFile.strip_comments self.data\n save!\n tokenize\n Instruction.create_references!\n end", "title": "" }, { "docid": "55dac79f7a1bb8d0eaafa4987459d951", "score": "0.50877154", "text": "def format_tag_input(txt)\n txt ? txt.gsub(\", \", \",\").gsub(' ', '_').gsub(/[^a-zA-Z0-9#_,]/, '') : ''\n end", "title": "" }, { "docid": "303dd8f64daed2ae9e9138747c026150", "score": "0.508263", "text": "def normalizeInput(s)\r\n if s == nil\r\n return \"\"\r\n else\r\n return s.gsub(/\\\\n/, \"\\n\")\r\n end\r\n end", "title": "" }, { "docid": "074a6b1e31fed09ca510ca86773b99fe", "score": "0.50766987", "text": "def markdownify(input); end", "title": "" }, { "docid": "6361cfbaca8f94599ece6ea35ea421a2", "score": "0.50765514", "text": "def clean text\n text.gsub(/(\\n|\\t|\\r)/, ' ').gsub(/>\\s*</, '><').squeeze(' ')\n end", "title": "" }, { "docid": "0818d9e4fd2e9490e595470d9ea61c17", "score": "0.5061205", "text": "def tokenize input\n\n\t# Different regex parts for smiley faces\n\teyes = \"[8:=;]\"\n\tnose = \"['`\\-]?\"\n\n\tinput = input\n\t\t.gsub(/https?:\\/\\/\\S+\\b|www\\.(\\w+\\.)+\\S*/,\"<URL>\")\n\t\t.gsub(\"/\",\" / \") # Force splitting words appended with slashes (once we tokenized the URLs, of course)\n\t\t.gsub(/@\\w+/, \"<USER>\")\n\t\t.gsub(/#{eyes}#{nose}[)d]+|[)d]+#{nose}#{eyes}/i, \"<SMILE>\")\n\t\t.gsub(/#{eyes}#{nose}p+/i, \"<LOLFACE>\")\n\t\t.gsub(/#{eyes}#{nose}\\(+|\\)+#{nose}#{eyes}/, \"<SADFACE>\")\n\t\t.gsub(/#{eyes}#{nose}[\\/|l*]/, \"<NEUTRALFACE>\")\n\t\t.gsub(/<3/,\"<HEART>\")\n\t\t.gsub(/[-+]?[.\\d]*[\\d]+[:,.\\d]*/, \"<NUMBER>\")\n\t\t.gsub(/#\\S+/){ |hashtag| # Split hashtags on uppercase letters\n\t\t\t# TODO: also split hashtags with lowercase letters (requires more work to detect splits...)\n\n\t\t\thashtag_body = hashtag[1..-1]\n\t\t\tif hashtag_body.upcase == hashtag_body\n\t\t\t\tresult = \"<HASHTAG> #{hashtag_body} <ALLCAPS>\"\n\t\t\telse\n\t\t\t\tresult = ([\"<HASHTAG>\"] + hashtag_body.split(/(?=[A-Z])/)).join(\" \")\n\t\t\tend\n\t\t\tresult\n\t\t} \n\t\t.gsub(/([!?.]){2,}/){ # Mark punctuation repetitions (eg. \"!!!\" => \"! <REPEAT>\")\n\t\t\t\"#{$~[1]} <REPEAT>\"\n\t\t}\n\t\t.gsub(/\\b(\\S*?)(.)\\2{2,}\\b/){ # Mark elongated words (eg. \"wayyyy\" => \"way <ELONG>\")\n\t\t\t# TODO: determine if the end letter should be repeated once or twice (use lexicon/dict)\n\t\t\t$~[1] + $~[2] + \" <ELONG>\"\n\t\t}\n\t\t.gsub(/([^a-z0-9()<>'`\\-]){2,}/){ |word|\n\t\t\t\"#{word.downcase} <ALLCAPS>\"\n\t\t}\n\n\treturn input\nend", "title": "" }, { "docid": "da5ef167ede8d7c5649be1708008c1f3", "score": "0.50605327", "text": "def consume_comment(input)\n while not input.eof? do\n case input.look_ahead\n when \"\\\\\" : \n # In comments, only escaped backslashes and line endings matter\n if [\"\\n\", \"\\\\\"].include? input.look_ahead(1)\n input.consume\n end\n when \"\\n\" : input.consume; break \n end\n input.consume\n end\n end", "title": "" }, { "docid": "7afc730c5b71caff723e1b57f08b501d", "score": "0.50488806", "text": "def parse input\r\n split_index = input.index(/[{},]/)\r\n stack = []\r\n if split_index ==nil then\r\n\r\n end\r\n pre_string = input[0..split_index-1].strip\r\n post_string = input[split_index+1..input.length].strip\r\n case input[/[{},]/]\r\n when \"{\"\r\n \tstack << parse(post_string) if pre_string==\"\"\r\n \tif pre_string!=\"\" then\r\n \t\tstack = {}\r\n \t\tstack[pre_string] = parse(post_string)\r\n \tend\r\n when \"}\"\r\n \tstack << pre_string\r\n \treturn stack\r\n when \",\"\r\n end\r\n stack\r\n\r\nend", "title": "" }, { "docid": "a2492e8c38e7b05b0806b22635b70986", "score": "0.5043355", "text": "def strip() end", "title": "" }, { "docid": "34cfe1d3bf5e851eb8c240d71a675bcd", "score": "0.50393575", "text": "def strip_comments(string)\n string.gsub Regexp.new('<!--.*?-->', Regexp::MULTILINE, 'u'), ''\n end", "title": "" }, { "docid": "8362738717736490e7b1b3e74e9b4eee", "score": "0.5024471", "text": "def strip_comments(line)\n\t\tline.strip!\n\t\t\n\t\tif line.start_with?(COMMENTS[0]) or line.start_with?(COMMENTS[1])\n\t\t\treturn ''\n\t\tend\n\t\t\n\t\tcomment_exists = (0 ... line.length).find_all {|i| line[i, 1] == COMMENTS[0] or line[i, 1] == COMMENTS[1]}\n\t\t\n\t\tif comment_exists.empty?\n\t\t\treturn line\n\t\tend\n\t\t\n\t\tif comment_exists\n\t\t\tline1 = String.new(line)\n\t\t\t#ignore delimiters within the text in the line itself.\n\t\t\t#replace quoted string with ' ' for the length and then remove comments.\n\t\t\t#return original line with the newly calculated index values.\n\t\t\t#asked question in forum and got this idea.\n\t\t\tline.scan(REGEX_STRING).each do |item|\n\t\t\t\tline1.sub!(item,' ' * item.length)\n\t\t\tend\n\n\t\t\tcomment_start = line1.index(COMMENTS[0])\n\t\t\t\n\t\t\tunless comment_start\n\t\t\t\tcomment_start = line1.index(COMMENTS[1])\n\t\t\t\t\tunless comment_start\n\t\t\t\t\t\treturn line\n\t\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\toutput = line[0..comment_start - 1]\n\t\t\t#strip again for whitespace before comment \n\t\t\toutput.strip!\n\t\t\treturn output\n\t\tend\n\t\t#if comment doesn't exist, return the line\n\t\tline\n\tend", "title": "" }, { "docid": "c22a8be07188292d5704670d8a0aa1c3", "score": "0.50202113", "text": "def summary(input)\n if input.index(/\\n\\n/)\n input.split(/\\n\\n/)[0]\n else\n input\n end\n end", "title": "" }, { "docid": "c22a8be07188292d5704670d8a0aa1c3", "score": "0.50202113", "text": "def summary(input)\n if input.index(/\\n\\n/)\n input.split(/\\n\\n/)[0]\n else\n input\n end\n end", "title": "" }, { "docid": "046721f2d5d28b33d8173b3ffa1cb5ea", "score": "0.5009824", "text": "def enrich_data(a)\n b = a.scan(/<p>(.*)<\\/p>/)\n b = b.join(\"\")\n b = b.gsub(/\\(.*?\\)/,\"\")\n b = b.gsub(/<.*?>/,\"\")\n b = b.gsub(/^.*?\\(.*?\\).*?--/,\"\")\n\n # Replace \n # ? => ?.\n # ! => !.\n # ... => <blank>\n # so that the text is suitable for pcfg parsers\n b = b.gsub(/\\?/,\"?.\")\n b = b.gsub(/\\!/,\"!.\")\n b = b.gsub(/\\.\\.\\./, \"\")\n end", "title": "" }, { "docid": "f81e40424969f1337afe98291c52623f", "score": "0.50076187", "text": "def unwrap(input)\n input.gsub(/<div class='bogus-wrapper'><notextile>(.+?)<\\/notextile><\\/div>/m) do\n $1\n end\n end", "title": "" }, { "docid": "1214a538d508babf83af07a07e5ef6f1", "score": "0.5006645", "text": "def canonicalize_comments!\n @comment = nil if @comment && @comment.match(/^Track \\d+$/)\n end", "title": "" }, { "docid": "becc8acb00be7da57326eebbd2f093bc", "score": "0.5006395", "text": "def unparse(node, comment_array = T.unsafe(nil)); end", "title": "" }, { "docid": "c29cd34799e03adcf485c74b29054cbb", "score": "0.49932143", "text": "def clean_str(mystring)\n if mystring.nil? then\n\t return nil\n\t end\n if mystring.include? \" \" then\n return fix_str(mystring)\n else\t \n\t return mystring.gsub(/@value=\"/,'').gsub(/>/,'')\n end\t\t \nend", "title": "" }, { "docid": "5b457c442916ba3e50500c4efee33ec6", "score": "0.4987412", "text": "def clean(token)\n token.lstrip!\n token.rstrip!\n if(token[0] == \"\\\"\")\n token[0] = \"\"\n token = token.chop! \n end \n return token\nend", "title": "" }, { "docid": "3812cdbb5eac8ed30888fbc931bacc65", "score": "0.49808717", "text": "def get_parse(s);end", "title": "" }, { "docid": "d4a78732f1a84f79147d71a49efb99ec", "score": "0.4975348", "text": "def parse_comment\n s0 = @scanner.pos\n if match_str('*') == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n s2 = parse_nonls\n if parse_nl == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n @reported_pos = s0\n s0 = s2.join\n end\n end\n if s0 == :failed\n s0 = @scanner.pos\n s1 = match_str('&')\n if s1 == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n s2 = parse_nonls\n if parse_nl == :failed\n @scanner.pos = s0\n s0 = :failed\n else\n @reported_pos = s0\n s0 = '&' + s2.join\n end\n end\n end\n s0\n end", "title": "" }, { "docid": "8014774c8afe7714127174350dad67b9", "score": "0.4974003", "text": "def strip_newlines(input); end", "title": "" }, { "docid": "9f0fa67d95aa5854b3f4532c914bbbb5", "score": "0.496991", "text": "def tokenize string\n string = string.strip\n return \"[#{string}]\" if string =~ /^(W\\/)?\".*\"$/\n return \"<#{string}>\"\n end", "title": "" }, { "docid": "9b54e30d00fac64535b2f27da5ff1193", "score": "0.49616006", "text": "def parse\n #use regex to split\n arr = @html_string.scan(TAGS_AND_TEXT).flatten\n\n #remove nil values and return\n arr.compact!\n\n #remove white spaces\n arr.map! { |s| s.strip}\n end", "title": "" }, { "docid": "389cf900fbe88af1049e473bd0a50a1a", "score": "0.49569872", "text": "def antisamy(context,input)\n if input.nil?\n if @allow_nil\n return nil\n end\n user = \"#{context}: Input number required\"\n log = \"Input number required: context=#{context}, input=#{input}\"\n raise Owasp::Esapi::ValidationException.new(user,log,context)\n end\n canonical = @string_rule.valid(context,input)\n begin\n r = AntiSamy.scan(canonical,@@policy)\n unless r.messages.empty?\n Esapi.logger.info(:SECURITY_FAILURE,\"Cleaned up HTML error #{r.messages}\")\n end\n # AntiSamy will wrap loose content in a <p> if there is no starting tag\n clean = r.clean_html\n # Strip out the >p> tags\n if clean =~ /^\\<p\\>(.*)\\<\\/p\\>$/\n x = $1\n unless input =~ /^\\</\n clean = x\n end\n end\n return clean.strip\n rescue Exception => e\n user = \"#{context}: Invalid HTML input\"\n log = \"Invalid HTML input: context=#{context} error=#{e.message}\"\n raise Owasp::Esapi::ValidationException.new(user,log,context,e)\n end\n end", "title": "" }, { "docid": "32aff3a0f120430bf3714c6b6cd72e6e", "score": "0.49540424", "text": "def clean(s)\n @cleaned = String.new(s)\n tokenize(@cleaned)\n @cleaned.gsub!(/[.,\\d]*\\d/, '<NUM>')\n @cleaned.gsub!(/[^a-zA-Z0-9,.;:<>\\-'\\/$% ]/, '')\n @cleaned.gsub!('--', ' ')\n @cleaned = @cleaned.split\n end", "title": "" }, { "docid": "b3d4f789c807a491be6234fb182d072a", "score": "0.4947413", "text": "def unprettify(email)\n email && email.match(/\\<(.*)\\>/) ? $1 : email\n end", "title": "" }, { "docid": "485ac351aa99d2b397743da535e46616", "score": "0.49311516", "text": "def preprocess(input); end", "title": "" }, { "docid": "2175c3f7a0f5cb6219b6fce993e6f62f", "score": "0.49237734", "text": "def clean(s)\n @cleaned = String.new(s)\n tokenize(@cleaned)\n @cleaned.gsub!(/[.,\\d]*\\d/, '<NUM>')\n @cleaned.gsub!(/[^a-zA-Z0-9,.;:<>\\-'\\/$% ]/, '')\n @cleaned.gsub!('--', ' ')\n @cleaned = @cleaned.split\n end", "title": "" }, { "docid": "ccea91db182aa95fc7ad0aa30748625a", "score": "0.49187937", "text": "def split_output_of_extracted_comment(output)\n output\n .lines\n .slice_before(/^ =====([^=\\n]+)=====$/)\n .map do |comment|\n Struct::Comment.new(\n comment[0].gsub(/^ =====|=====$/, ''),\n comment[1..-1].join('')\n )\n end\nend", "title": "" }, { "docid": "4c01c1395cc5566d2c90429c321a6671", "score": "0.49164972", "text": "def strip!() end", "title": "" }, { "docid": "7c9c523dd31a47c2fd43dae4cd8e40d6", "score": "0.49148452", "text": "def parse(input)\n norm = self.class.normalize(input)\n paragraphs = split_paragraphs(input)\n result = []\n for paragraph in paragraphs do\n result << parse_paragraph(paragraph)\n end \n return result\n end", "title": "" }, { "docid": "d0c99821b6f044ccb22b2d0b71849369", "score": "0.49083665", "text": "def strip_html(text)\n @name =\n # Remove HTML from the text\n Sanitize.clean(text).\n # Replace newlines with a space\n gsub(/\\n|\\r/, ' ').\n # Replaces runs of spaces by a single space\n squeeze(' ').\n # Remove leading and trailing whitespace\n strip\nend", "title": "" }, { "docid": "02ad9aec4707b1d332d0837d2d6e9ca7", "score": "0.4896653", "text": "def clean_user_input(input)\n cleansed_input = input.strip.downcase.split.join(\" \")\n cleansed_input\n end", "title": "" }, { "docid": "d2372f793a60686ac3ef56f17dd09d93", "score": "0.4894515", "text": "def format_input(input)\n raise EmptyInput, 'No content in entry' if input.nil? || input.strip.empty?\n\n input_lines = input.split(/[\\n\\r]+/).delete_if(&:ignore?)\n title = input_lines[0]&.strip\n raise EmptyInput, 'No content in first line' if title.nil? || title.strip.empty?\n\n date = nil\n iso_rx = /\\d{4}-\\d\\d-\\d\\d \\d\\d:\\d\\d/\n date_rx = /^(?:\\s*- )?(?<date>.*?) \\| (?=\\S)/\n\n raise EmptyInput, 'No content' if title.sub(/^.*?\\| */, '').strip.empty?\n\n title.expand_date_tags(Doing.setting('date_tags'))\n\n if title =~ date_rx\n m = title.match(date_rx)\n d = m['date']\n date = if d =~ iso_rx\n Time.parse(d)\n else\n d.chronify(guess: :begin)\n end\n title.sub!(date_rx, '').strip!\n end\n\n note = Note.new\n note.add(input_lines[1..-1]) if input_lines.length > 1\n # If title line ends in a parenthetical, use that as the note\n if note.empty? && title =~ /\\s+\\(.*?\\)$/\n title.sub!(/\\s+\\((?<note>.*?)\\)$/) do\n m = Regexp.last_match\n note.add(m['note'])\n ''\n end\n end\n\n note.strip_lines!\n note.compress\n\n [date, title, note]\n end", "title": "" }, { "docid": "e452a2bfe9d0fdd819251acd907f9426", "score": "0.48904216", "text": "def parse_input(input)\n\tinput.split(\" \")\nend", "title": "" }, { "docid": "9f0732255e3cebb212b15d7a1e2eb530", "score": "0.4879384", "text": "def safe_output(input)\n sanitize Nokogiri::HTML.fragment(CGI.unescapeHTML(input)).to_s\n end", "title": "" }, { "docid": "f081fc554542521befba0e1ecf7af725", "score": "0.4869747", "text": "def normalize_whitespace(input); end", "title": "" }, { "docid": "e34bd00e104ab966ad15abab3b6c5245", "score": "0.4866899", "text": "def scrub(line)\n\t\t#remove any comments\n\t\tline = line.split('//')[0]\n\t\t#whitespace can be bad too\n\t\tline.strip!\n\tend", "title": "" }, { "docid": "028db6e1109825054def8d1dde55661b", "score": "0.48656315", "text": "def unnormalize(string, doctype = T.unsafe(nil), filter = T.unsafe(nil), illegal = T.unsafe(nil)); end", "title": "" }, { "docid": "839e0051d566b71efdc741157bb04543", "score": "0.4859048", "text": "def parse(tags); end", "title": "" }, { "docid": "a81014f0244f16a8a73af511cabff6ad", "score": "0.48533055", "text": "def clean_up_text\n text.gsub!(/<br/, \"\\n<br\")\n text.gsub!(/<p/, \"\\n<p\")\n text.gsub!(/<\\/?span(.*?)?>/, '')\n text.gsub!(/<\\/?div(.*?)?>/, '')\n end", "title": "" }, { "docid": "46cee33c6e91b71ca1516acfa995ba55", "score": "0.48525706", "text": "def clean_field(value)\n doc = Nokogiri::XML.fragment(value)\n doc.text.squish\n end", "title": "" }, { "docid": "3fec260f75166939d85165c35acffd8b", "score": "0.48500466", "text": "def preprocess_input(input)\nend", "title": "" }, { "docid": "1ecfda30f36fa05de583c6e3c04f732b", "score": "0.4841502", "text": "def format_user_input strip = true\n format_ruby self.user_input, strip\n end", "title": "" }, { "docid": "406eb7e4935a78e9c4f4996e078164dc", "score": "0.4839935", "text": "def parse_unpaired_tags(wiki_text)\n wiki_text.gsub!(%r{<[a-zA-Z]*/>}im, \"\")\n wiki_text\n end", "title": "" }, { "docid": "57a3e0d11f57c2f65fb5e07d55d63dc9", "score": "0.48344028", "text": "def prettify(str); end", "title": "" }, { "docid": "03cb7e895e8aa600d27f6254759efe1d", "score": "0.48343092", "text": "def html_to_rss_description(input)\n html = Loofah.fragment(input)\n html.scrub!(Scrubber.new)\n html.to_s\n end", "title": "" }, { "docid": "9df1cd3a06136eba281418ccb9af8358", "score": "0.48293054", "text": "def blocks_parse(input)\n return nil\nend", "title": "" }, { "docid": "877052c79063f2720a0af72b1a6eb1f9", "score": "0.48262885", "text": "def parse(text); end", "title": "" }, { "docid": "9ea2c64174a304f487fbc9ec4a2cb8be", "score": "0.4824587", "text": "def tag_strip(tag)\n if tag =~ /:/\n return $'\n else\n return tag\n end \n end", "title": "" }, { "docid": "e73c209e0cc14e64ea48812a651b964b", "score": "0.4818943", "text": "def outdent(str)\n str =~ /\\A(?:\\s*?\\n)( *)(.*)\\z/m ? $2.gsub!(/^ {0,#{$1.length}}/, '') : str\n end", "title": "" }, { "docid": "9b9be8894d2a6f72ce9d5fa67a94e2f5", "score": "0.4818688", "text": "def comment_filter(comments)\n # p comments\n comments.each do |info|\n # p info\n # p info[1].values\n info[1].values.each do |item|\n if item.gsub(/\\s+/, \"\") == \"\"\n comments.delete(info[0])\n end\n end\n end\n if comments.empty?\n \"empty\"\n else\n comments\n end\nend", "title": "" }, { "docid": "9c220fd649042a391bbaa67cd565856f", "score": "0.4814411", "text": "def parse_comment(raw)\n c = nil\n if raw =~ /\\A\\((.+?)\\)(.+)\\z/\n c, raw = [$2, $1]\n end\n if raw =~ /\\A(.+)\\((.+?)\\)\\z/\n raw, c = [$1, $2]\n end\n [raw, c]\n end", "title": "" }, { "docid": "1d4ae749b0ff81fc4802b3e0b9ed3ef1", "score": "0.48046073", "text": "def strip_shell_comments(text)\n lines = text.lines.to_a\n return text if lines.count < 2\n lines.first + lines[1..lines.count].\n reject{|l| (l =~ /^\\s*#/) || (l =~ /^\\s+$/)}.join('')\n end", "title": "" }, { "docid": "c8f1ae406d4b6e082d1957487810e0fc", "score": "0.47996965", "text": "def normalize_source(source)\n source.chop.gsub(/\\s*\\n\\s*/, ' ')\n end", "title": "" }, { "docid": "1dcf63e04963fa2785e028774d2e8ad7", "score": "0.47988135", "text": "def test_comment_sanitization\n\n full_tests = {\n \"hey `there`\" => \"<p>hey <code>there</code></p>\",\n\n \"hey `<b>`\" => \"<p>hey <code>&lt;b&gt;</code></p>\",\n\n # this one is not desired, but it's safe and acceptable\n \"hey `<script>`\" => \"<p>hey <code>&lt;script&gt;</code></p>\",\n\n \"hey `<link href=\\\"what\\\">`\" => \"<p>hey <code>&lt;link href=\\\"what\\\"&gt;</code></p>\",\n\n \"hey <script>\" => \"<p>hey &lt;script&gt;&lt;/script&gt;</p>\",\n \"hey <script>yes</script>\" => \"<p>hey &lt;script&gt;yes&lt;/script&gt;</p>\",\n \"hey <b>yes</b>\" => \"<p>hey <b>yes</b></p>\",\n }\n\n full_tests.each do |input, output|\n assert_equal output, routing.render_comment_body(input).strip\n end\n\n\n end", "title": "" }, { "docid": "ba770e35e5ff6024048a2d49d2b3eb86", "score": "0.4797555", "text": "def strip(str); end", "title": "" }, { "docid": "578b64074473ef3bb0c703a5cc1f1c1b", "score": "0.47951028", "text": "def consume_comments\n if @s.peek(2) == '/*'\n @s.consume\n @s.consume\n\n if text = @s.scan_until(RE_COMMENT_CLOSE)\n text.slice!(-2, 2)\n else\n # Parse error.\n text = @s.consume_rest\n end\n\n return create_token(:comment, :value => text)\n end\n\n nil\n end", "title": "" }, { "docid": "c9078f698f2481136ed213784238f24c", "score": "0.47927836", "text": "def _strip_comment(line)\n delimiter_indexes = (0 ... line.length).find_all { |i| line[i, 1] == COMMENT_DELIM }\n\n if delimiter_indexes.empty?\n # No comment to strip\n return line\n end\n\n # Ignore quoted strings by replacing them with a placeholder.\n # This is because a delimiter could occur in a string value.\n copy = String.new(line)\n line.scan(STRING_REGEX).each do |str|\n copy.sub!(str, ' ' * str.length)\n end\n\n # Take everything up to the first occurrence of COMMENT_DELIM\n comment_start = copy.index(COMMENT_DELIM)\n\n unless comment_start\n # No comment to strip\n return line\n end\n\n comment_start -= 1\n if comment_start < 0\n return ''\n end\n\n sanitized = line[0..comment_start]\n sanitized.strip!\n sanitized\n end", "title": "" }, { "docid": "6b6c9c65ace64975d3316db377a34ea4", "score": "0.4789359", "text": "def format_xml_as_burlap(xml_string)\n xml_string.gsub!(/(^|\\n)\\s*/m, \"\")\nend", "title": "" }, { "docid": "44ee34555976eecf27f6102bafe18b0b", "score": "0.47893316", "text": "def preprocess!\n input_html\n nil\n end", "title": "" } ]
e80cebc3cf0b4e632b7bb1800342a813
Create ReturnById xml as per the api format . "params" is collection keyvalues, in this "params" holds Amount, TransactionId. It returns xml format in string.
[ { "docid": "a1c574fa6f77304cfba402f9ab10e57e", "score": "0.84495443", "text": "def returnByIdXML(params)\n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.ReturnById('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance',\n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>\"ReturnById\" ) {\n xml.ApplicationProfileId application_profile_id \n xml.BatchIds('xmlns:d2p1' => 'http://schemas.microsoft.com/2003/10/Serialization/Arrays', 'i:nil' => \"true\")\n xml.DifferenceData('xmlns:ns1' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Bankcard', 'i:type' => \"ns1:BankcardReturn\"){\n xml['ns2'].TransactionId params[:TransactionId] ,'xmlns:ns2' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions'\n if params[:Amount] != ''\n xml['ns1'].Amount params[:Amount]\n else\n xml['ns1'].Amount '0.00'\n end\n }\n xml.MerchantProfileId merchant_profile_id\n } \n end.to_xml\n rescue Exception => ex\n return \"transaction id and/or amount not set in xml for returnByIdXML!\"\n end \n end", "title": "" } ]
[ { "docid": "28ba7f3dc4e98ee0059363dcd9e1e8f6", "score": "0.6123846", "text": "def adjustXML(params)\n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.Adjust('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance',\n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>\"Adjust\" ) {\n xml.ApplicationProfileId application_profile_id \n xml.BatchIds('xmlns:d2p1' => 'http://schemas.microsoft.com/2003/10/Serialization/Arrays', 'i:nil'=> \"true\")\n xml.MerchantProfileId merchant_profile_id\n xml.DifferenceData('xmlns:ns1' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions',\n 'xmlns:ns2' => \"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",\n 'xmlns:ns3' => \"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\") {\n if params[:Amount] != ''\n xml['ns2'].Amount params[:Amount]\n else\n xml['ns2'].Amount '0.00'\n end \n xml['ns3'].TransactionId params[:TransactionId]\n }\n } \n end.to_xml \n rescue Exception => ex\n return \"transaction id and/or amount not set in xml for adjustXML!\"\n end \n end", "title": "" }, { "docid": "c794a29b675b80fdca2801db80b35935", "score": "0.6067641", "text": "def build_xml( id, price, options )\n xml = ::Builder::XmlMarkup.new\n xml.GenerateRequest do\n xml.PxPayUserId ::Pxpay::Base.pxpay_user_id\n xml.PxPayKey ::Pxpay::Base.pxpay_key\n xml.AmountInput sprintf(\"%.2f\", price)\n xml.TxnId id\n xml.TxnType options[:txn_type] ? options[:txn_type].to_s.capitalize : \"Purchase\"\n xml.CurrencyInput options[:currency_input] || \"NZD\"\n xml.MerchantReference options[:merchant_reference] || options[:reference] || id.to_s ## Backwards compatibility\n xml.UrlSuccess options[:url_success] || ::Pxpay::Base.url_success \n xml.UrlFail options[:url_failure] || ::Pxpay::Base.url_failure\n xml.EmailAddress options[:email_address] if options[:email_address]\n xml.TxnData1 options[:txn_data1] if options[:txn_data1]\n xml.TxnData2 options[:txn_data2] if options[:txn_data2]\n xml.TxnData3 options[:txn_data3] if options[:txn_data3]\n xml.TxnData4 options[:txn_data4] if options[:txn_data4]\n xml.Opt options[:opt] if options[:opt]\n xml.EnableAddBillCard 1 if options[:token_billing]\n xml.BillingId options[:billing_id] if options[:token_billing]\n end\n end", "title": "" }, { "docid": "47d4d52d5a8aeeb41f1d40910f8f9c4a", "score": "0.59212077", "text": "def undoXML(params)\n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.Undo('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance', \n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>\"Undo\" ) {\n xml.ApplicationProfileId application_profile_id \n xml.BatchIds('xmlns:d2p1' => 'http://schemas.microsoft.com/2003/10/Serialization/Arrays','i:nil' => \"true\")\n xml.DifferenceData('xmlns:d2p1' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions','i:nil' => \"true\")\n xml.MerchantProfileId merchant_profile_id \n xml.TransactionId params[:TransactionId] \n }\n end.to_xml \n rescue Exception => ex\n return \"transaction id not set in xml for undoXML!\"\n end \n end", "title": "" }, { "docid": "37fe105b8eed33fdb2887281ef7dc7e5", "score": "0.58403385", "text": "def captureXML(params)\n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.ChangeTransaction('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance',\n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest',\n 'i:type' =>\"Capture\" ) {\n xml.ApplicationProfileId application_profile_id #'14644'\n xml.DifferenceData('xmlns:d2p1' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions',\n 'xmlns:d2p2' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Bankcard', \n 'xmlns:d2p3' => 'http://schemas.ipcommerce.com/CWS/v2.0/TransactionProcessing',\n 'i:type' => \"d2p2:BankcardCapture\"){\n xml['d2p1'].TransactionId params[:TransactionId]#'760CBDD65E4642E49A3CD2E2F3257A10'\n if params[:Amount] != ''\n xml['d2p2'].Amount params[:Amount]\n else\n xml['d2p2'].Amount '0.00'\n end \n xml['d2p2'].TipAmount '0.00' \n }\n } \n end.to_xml \n rescue Exception => ex\n return \"transaction id and/or amount not set in xml for captureXML!\"\n end \n end", "title": "" }, { "docid": "9d7f9537a11030894162dd26dc9dfb9c", "score": "0.5792095", "text": "def to_xml\n a = REXML::Element.new(\"parameter\")\n a.add_attribute(\"id\", id)\n a.add_attribute(\"name\", name)\n if (description != nil)\n a.add_element(\"description\").text = description\n end\n if (defaultValue != nil)\n a.add_element(\"default\").text = defaultValue\n end\n return a\n end", "title": "" }, { "docid": "d924ca5dbbeb23c9c884a726dabbe1e9", "score": "0.577693", "text": "def build_xml( result )\n xml = ::Builder::XmlMarkup.new\n \n xml.ProcessResponse do \n xml.PxPayUserId ::Pxpay::Base.pxpay_user_id\n xml.PxPayKey ::Pxpay::Base.pxpay_key\n xml.Response result\n end\n end", "title": "" }, { "docid": "83737f889cfdd2762f9424582e60a8dc", "score": "0.5723404", "text": "def retrieve(params = {})\n req = WebPay::CustomerIdRequest.create(params)\n raw_response = @client._request(:get, 'customers' + '/' + req.id.to_s, req)\n WebPay::CustomerResponse.new(raw_response)\n end", "title": "" }, { "docid": "3cbde0cb8b33a9460c4eabcec5ef3cb2", "score": "0.5640022", "text": "def returnUnlinkedXML(params)\n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.ReturnTransaction('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance',\n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>\"ReturnTransaction\" ) {\n xml.ApplicationProfileId application_profile_id \n xml.BatchIds('xmlns:d2p1' => 'http://schemas.microsoft.com/2003/10/Serialization/Arrays', 'i:nil'=> \"true\")\n xml.MerchantProfileId merchant_profile_id \n xml.Transaction('xmlns:ns1' => \"http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Bankcard\", 'i:type' => \"ns1:BankcardTransaction\" ){\n xml['ns1'].TenderData{\n if params[:SwipeStatus].present? && params[:IdentificationInformation].present? && params[:SecurePaymentAccountData].present? && params[:EncryptionKeyId].present?\n #p \"Swipe card..maga...\"\n xml['ns5'].SecurePaymentAccountData('xmlns:ns5' =>\n \"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:SecurePaymentAccountData])\n xml['ns6'].EncryptionKeyId('xmlns:ns6' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:EncryptionKeyId])\n xml['ns7'].SwipeStatus('xmlns:ns7' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:SwipeStatus])\n xml['ns1'].CardSecurityData{\n xml['ns1'].IdentificationInformation params[:IdentificationInformation]\n }\n xml['ns1'].CardData('i:nil' =>\"true\")\n elsif params[:SecurePaymentAccountData].present? && params[:EncryptionKeyId].present? \n #p \"Swipe card..Dukp...\"\n xml['ns5'].SecurePaymentAccountData('xmlns:ns5' =>\n \"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:SecurePaymentAccountData])\n xml['ns6'].EncryptionKeyId('xmlns:ns6' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:EncryptionKeyId])\n xml['ns7'].SwipeStatus('xmlns:ns7' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\") \n xml['ns1'].CardSecurityData{\n xml['ns1'].IdentificationInformation('i:nil' =>\"true\")\n }\n xml['ns1'].CardData('i:nil' =>\"true\")\n xml['ns1'].EcommerceSecurityData('i:nil' =>\"true\") \n elsif params[:PaymentAccountDataToken].present?\n #p \"PaymentAccountDataToken...........\"\n xml['ns4'].PaymentAccountDataToken('xmlns:ns4' =>\n \"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:PaymentAccountDataToken])\n xml['ns5'].SecurePaymentAccountData('xmlns:ns5' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns6'].EncryptionKeyId('xmlns:ns6' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns7'].SwipeStatus('xmlns:ns7' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\") \n xml['ns1'].CardData('i:nil' =>\"true\")\n xml['ns1'].EcommerceSecurityData('i:nil' =>\"true\") \n else \n #p \"without token....\"\n xml['ns4'].PaymentAccountDataToken('xmlns:ns4' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\", 'i:nil' =>\"true\")\n xml['ns5'].SecurePaymentAccountData('xmlns:ns5' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns6'].EncryptionKeyId('xmlns:ns6' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns7'].SwipeStatus('xmlns:ns7' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns1'].CardData{\n xml['ns1'].CardType params[:CardType] \n if params[:Track2Data].present?\n xml['ns1'].Track2Data params[:Track2Data]\n xml['ns1'].PAN('i:nil' =>\"true\") \n xml['ns1'].Expire('i:nil' =>\"true\")\n xml['ns1'].Track1Data('i:nil' =>\"true\")\n elsif params[:Track1Data].present?\n xml['ns1'].Track1Data params[:Track1Data]\n xml['ns1'].PAN('i:nil' =>\"true\") \n xml['ns1'].Expire('i:nil' =>\"true\")\n xml['ns1'].Track2Data('i:nil' =>\"true\")\n else\n xml['ns1'].PAN params[:PAN] \n xml['ns1'].Expire params[:Expire]\n xml['ns1'].Track1Data('i:nil' =>\"true\")\n xml['ns1'].Track2Data('i:nil' =>\"true\")\n end\n }\n xml['ns1'].EcommerceSecurityData('i:nil' =>\"true\") \n end\n }\n xml['ns2'].CustomerData('xmlns:ns2' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\"){\n xml['ns2'].BillingData{\n xml['ns2'].Name('i:nil' =>\"true\")\n xml['ns2'].Address{\n xml['ns2'].Street1 params[:Street1] \n xml['ns2'].Street2('i:nil' =>\"true\")\n xml['ns2'].City params[:City] \n xml['ns2'].StateProvince params[:StateProvince]\n xml['ns2'].PostalCode params[:PostalCode]\n xml['ns2'].CountryCode params[:CountryCode]\n }\n xml['ns2'].BusinessName 'MomCorp'\n xml['ns2'].Phone params[:Phone]\n xml['ns2'].Fax('i:nil' =>\"true\")\n xml['ns2'].Email params[:Email]\n }\n xml['ns2'].CustomerId 'cust123'\n xml['ns2'].CustomerTaxId('i:nil' =>\"true\")\n xml['ns2'].ShippingData('i:nil' =>\"true\")\n }\n xml['ns3'].ReportingData('xmlns:ns3' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\"){\n xml['ns3'].Comment 'a test comment'\n xml['ns3'].Description 'a test description'\n xml['ns3'].Reference '001'\n }\n xml['ns1'].TransactionData{\n if params[:Amount] != ''\n xml['ns8'].Amount('xmlns:ns8' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:Amount])\n else\n xml['ns8'].Amount('xmlns:ns8' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text('0.00')\n end\n xml['ns9'].CurrencyCode('xmlns:ns9' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text('USD') \n xml['ns10'].TransactionDateTime('xmlns:ns10' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text('2013-04-03T13:50:16')\n xml['ns11'].CampaignId('xmlns:ns11' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns12'].Reference('xmlns:ns12' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text('xyt')\n xml['ns1'].AccountType 'NotSet'\n xml['ns1'].ApprovalCode('i:nil' =>\"true\")\n xml['ns1'].CashBackAmount '0.0'\n xml['ns1'].CustomerPresent 'Present'\n xml['ns1'].EmployeeId '11'\n xml['ns1'].EntryMode params[:EntryMode]\n xml['ns1'].GoodsType 'NotSet'\n xml['ns1'].IndustryType params[:IndustryType]\n xml['ns1'].InternetTransactionData('i:nil' =>\"true\")\n xml['ns1'].InvoiceNumber params[:InvoiceNumber]\n xml['ns1'].OrderNumber params[:OrderNumber]\n xml['ns1'].IsPartialShipment 'false'\n xml['ns1'].SignatureCaptured 'false'\n xml['ns1'].FeeAmount '0.0'\n xml['ns1'].TerminalId('i:nil' =>\"true\")\n xml['ns1'].LaneId('i:nil' =>\"true\")\n xml['ns1'].TipAmount '0.0'\n xml['ns1'].BatchAssignment('i:nil' =>\"true\")\n xml['ns1'].PartialApprovalCapable 'NotSet'\n xml['ns1'].ScoreThreshold('i:nil' =>\"true\")\n xml['ns1'].IsQuasiCash 'false' \n }\n }\n } \n end.to_xml\n rescue Exception => ex\n return \"Some value not set in xml for returnUnlinkedXML!\"\n end\n end", "title": "" }, { "docid": "4eed1245a74fbcaa781d56c04139f593", "score": "0.5624831", "text": "def queryTransactionsDetailJSON(params)\n begin\n { \n :TransactionDetailFormat => 'CWSTransaction',\n :PagingParameters => { \n :Page => 0, \n :PageSize => 10\n },\n :QueryTransactionsParameters => { \n :Amounts => nil,\n :ApprovalCodes => nil,\n :BatchIds => batch_ids(params),\n :CaptureDateRange =>nil,\n :CaptureStates => nil,\n :TransactionIds => mul_trd(params),\n :MerchantProfileIds => nil,\n :CardTypes => nil,\n :IsAcknowledged=> \"false\",\n :OrderNumbers => nil,\n :QueryType => \"OR\",\n :ServiceIds => nil,\n :ServiceKeys => nil,\n :TransactionClassTypePairs=> nil,\n :TransactionDateRange=> transaction_date_range(params),\n :TransactionStates => nil,\n },\n :IncludeRelated => 'false' \n }.to_json\n rescue Exception => ex\n return \"Some value not set in querytransactiondetail, batchid, transactionid or transactiondates!\"\n end\n end", "title": "" }, { "docid": "c680db9b1112e070d2e58e57dcce6ed7", "score": "0.5529969", "text": "def xml\n @xml ||= begin\n builder = ::Builder::XmlMarkup.new(:indent => 4)\n\n authed_xml_as_string(builder) do\n builder.GetReceiptInfoCall do\n builder.ReceiptFilter do\n builder.ReceiptId(id)\n end\n end\n end\n end\n end", "title": "" }, { "docid": "32a05d8e061c17765e257d334db05b12", "score": "0.5448661", "text": "def get_single_transaction_query(params = {})\r\n @PARAM_HASH[\"REPORT_START_DATE\"] = params[:report_start_date]\r\n @PARAM_HASH[\"REPORT_END_DATE\"] = params[:report_end_date]\r\n @PARAM_HASH[\"id\"] = params[:transaction_id]\r\n @PARAM_HASH[\"EXCLUDE_ERRORS\"] = params[:exclude_errors] || ''\r\n @api = \"stq\" \r\n end", "title": "" }, { "docid": "32a05d8e061c17765e257d334db05b12", "score": "0.5448661", "text": "def get_single_transaction_query(params = {})\r\n @PARAM_HASH[\"REPORT_START_DATE\"] = params[:report_start_date]\r\n @PARAM_HASH[\"REPORT_END_DATE\"] = params[:report_end_date]\r\n @PARAM_HASH[\"id\"] = params[:transaction_id]\r\n @PARAM_HASH[\"EXCLUDE_ERRORS\"] = params[:exclude_errors] || ''\r\n @api = \"stq\" \r\n end", "title": "" }, { "docid": "8267cfd31b92c0ae478b2eb092c1b456", "score": "0.5389999", "text": "def to_xml(*args); end", "title": "" }, { "docid": "8267cfd31b92c0ae478b2eb092c1b456", "score": "0.5389999", "text": "def to_xml(*args); end", "title": "" }, { "docid": "8267cfd31b92c0ae478b2eb092c1b456", "score": "0.5389999", "text": "def to_xml(*args); end", "title": "" }, { "docid": "8267cfd31b92c0ae478b2eb092c1b456", "score": "0.5389999", "text": "def to_xml(*args); end", "title": "" }, { "docid": "8267cfd31b92c0ae478b2eb092c1b456", "score": "0.5389999", "text": "def to_xml(*args); end", "title": "" }, { "docid": "8267cfd31b92c0ae478b2eb092c1b456", "score": "0.5389999", "text": "def to_xml(*args); end", "title": "" }, { "docid": "a5e0b8edb3336f875f531ac57f3714b1", "score": "0.5366789", "text": "def build_request_xml(function, param, extra = nil)\n xml = \"<?xml version=\\\"1.0\\\" encoding=\\\"ISO-8859-1\\\"?>\\n\"\n xml << \"<dados>\\n\"\n xml << \" <usuario>#{@user}</usuario>\\n\"\n xml << \" <senha>#{@password}</senha>\\n\"\n xml << \" <funcao>#{function}</funcao>\\n\"\n xml << \" <param>#{param}</param>\\n\"\n xml << \" <param2>#{extra}</param2>\\n\" if extra\n xml << \" <retorno>#{RETURN_FORMATS[@format]}</retorno>\\n\"\n xml << \"</dados>\"\n xml\n end", "title": "" }, { "docid": "cffa003f3488f6f524ac504351cf6de2", "score": "0.5351837", "text": "def transaction_with_http_info(txid, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.transaction ...'\n end\n # verify the required parameter 'txid' is set\n if @api_client.config.client_side_validation && txid.nil?\n fail ArgumentError, \"Missing the required parameter 'txid' when calling DefaultApi.transaction\"\n end\n # resource path\n local_var_path = '/api/v1/transaction'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'txid'] = txid\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', 'application/xml', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Transaction' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#transaction\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "e8d7e963cc739564131a34864af1d754", "score": "0.5350602", "text": "def sale(params = {})\r\n @PARAM_HASH['TRANSACTION_TYPE'] = 'SALE'\r\n @PARAM_HASH['AMOUNT'] = params[:amount]\r\n @PARAM_HASH['RRNO'] = params[:trans_id] || ''\r\n @api = \"bp10emu\"\r\n end", "title": "" }, { "docid": "4641d45775af4c14a4a438751ed802cb", "score": "0.53337884", "text": "def to_xml\n xml = String.new\n builder = Builder::XmlMarkup.new(:target => xml, :indent => 2)\n \n # Xml instructions (version and charset)\n builder.instruct!\n \n builder.source(:primary => primary_source) do\n builder.id(id, :type => \"integer\")\n builder.uri(uri.to_s)\n end\n \n xml\n end", "title": "" }, { "docid": "7ec2e8ab70228e5c562f87deaeaa92bd", "score": "0.5325902", "text": "def sale(params = {})\r\n @PARAM_HASH['TRANSACTION_TYPE'] = 'SALE'\r\n @PARAM_HASH['AMOUNT'] = params[:amount]\r\n @PARAM_HASH['RRNO'] = params[:trans_id] || ''\r\n @PARAM_HASH['CUST_TOKEN'] = params[:customer_token] if params[:customer_token]\r\n @api = \"bp10emu\"\r\n end", "title": "" }, { "docid": "db7c34faf2caa4b59f436547c0df13b2", "score": "0.5325122", "text": "def Return(params={})\n Return.new(params)\n end", "title": "" }, { "docid": "8b0c1a514ddb117c5a0ab422eef343e3", "score": "0.5294081", "text": "def get_transaction_report(params = {})\r\n @PARAM_HASH[\"QUERY_BY_SETTLEMENT\"] = '0'\r\n @PARAM_HASH[\"REPORT_START_DATE\"] = params[:report_start_date]\r\n @PARAM_HASH[\"REPORT_END_DATE\"] = params[:report_end_date]\r\n @PARAM_HASH[\"QUERY_BY_HIERARCHY\"] = params[:query_by_hierarchy]\r\n @PARAM_HASH[\"DO_NOT_ESCAPE\"] = params[:do_not_escape] || ''\r\n @PARAM_HASH[\"EXCLUDE_ERRORS\"] = params[:exclude_errors] || ''\r\n @api = \"bpdailyreport2\"\r\n end", "title": "" }, { "docid": "59fd997cc7ee843d4dd28f07d20b28cb", "score": "0.5257304", "text": "def get_transaction_report(params = {})\r\n @PARAM_HASH[\"QUERY_BY_SETTLEMENT\"] = '0'\r\n @PARAM_HASH[\"REPORT_START_DATE\"] = params[:report_start_date]\r\n @PARAM_HASH[\"REPORT_END_DATE\"] = params[:report_end_date]\r\n @PARAM_HASH[\"QUERY_BY_HIERARCHY\"] = params[:query_by_hierarchy]\r\n\t@PARAM_HASH[\"BACKEND_ID\"] = params[:backend_id] if params[:backend_id]\r\n\t@PARAM_HASH[\"ORIGIN\"] = params[:origin] if params[:origin]\r\n @PARAM_HASH[\"DO_NOT_ESCAPE\"] = params[:do_not_escape] || ''\r\n @PARAM_HASH[\"EXCLUDE_ERRORS\"] = params[:exclude_errors] || ''\r\n @api = \"bpdailyreport2\"\r\n end", "title": "" }, { "docid": "f9dc1929eb26be967f29fc1a82dc610f", "score": "0.5249186", "text": "def query_by_transaction_id(trans_id)\n @PARAM_HASH[\"id\"] = trans_id;\n end", "title": "" }, { "docid": "dedca7da8dfa4daf92c60c183fd0a330", "score": "0.5222699", "text": "def transactionById\n results = HTTParty.get(\"http://192.168.99.101:4050/transactions/\" + (params[:id]).to_s)\n render json: results.parsed_response, status: results.code\n end", "title": "" }, { "docid": "ff00a052aee576b18c1a5e823c4661d1", "score": "0.52025336", "text": "def verifyXML(params)\n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.AuthorizeTransaction('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance',\n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest',\n 'i:type' =>\"AuthorizeTransaction\" ) {\n xml.ApplicationProfileId application_profile_id #'14560'\n xml.MerchantProfileId merchant_profile_id #'PrestaShop Global HC'\n xml.Transaction('xmlns:ns1' => \"http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Bankcard\",\n 'i:type' => \"ns1:BankcardTransaction\" ){\n xml['ns1'].TenderData{\n xml['ns1'].CardData{\n xml['ns1'].CardType params[:CardType]\n xml['ns1'].CardholderName params[:CardholderName]\n # xml['ns1'].PAN params[:PAN] #'4111111111111111'\n # xml['ns1'].Expire params[:Expire]\n # xml['ns1'].Track1Data('i:nil' =>\"true\")\n if params[:Track2Data].present?\n xml['ns1'].Track2Data params[:Track2Data]\n xml['ns1'].PAN('i:nil' =>\"true\") \n xml['ns1'].Expire('i:nil' =>\"true\")\n xml['ns1'].Track1Data('i:nil' =>\"true\")\n elsif params[:Track1Data].present?\n xml['ns1'].Track1Data params[:Track1Data]\n xml['ns1'].PAN('i:nil' =>\"true\") \n xml['ns1'].Expire('i:nil' =>\"true\")\n xml['ns1'].Track2Data('i:nil' =>\"true\")\n else\n xml['ns1'].PAN params[:PAN] \n xml['ns1'].Expire params[:Expire]\n xml['ns1'].Track1Data('i:nil' =>\"true\")\n xml['ns1'].Track2Data('i:nil' =>\"true\")\n end\n }\n xml['ns1'].CardSecurityData{\n xml['ns1'].AVSData{\n xml['ns1'].CardholderName('i:nil' =>\"true\") \n xml['ns1'].Street params[:Street]\n xml['ns1'].City params[:City]\n xml['ns1'].StateProvince params[:StateProvince]\n xml['ns1'].PostalCode params[:PostalCode]\n xml['ns1'].Phone params[:Phone]\n xml['ns1'].Email params[:Email]\n }\n xml['ns1'].CVDataProvided 'Provided'\n xml['ns1'].CVData params[:CVData]\n xml['ns1'].KeySerialNumber('i:nil' =>\"true\")\n xml['ns1'].PIN('i:nil' =>\"true\") \n xml['ns1'].IdentificationInformation('i:nil' =>\"true\")\n }\n xml['ns1'].EcommerceSecurityData('i:nil' =>\"true\")\n }\n xml['ns1'].TransactionData{\n if params[:Amount] != ''\n xml['ns8'].Amount('xmlns:ns8' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:Amount])\n else\n xml['ns8'].Amount('xmlns:ns8' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text('0.00')\n end\n xml['ns9'].CurrencyCode('xmlns:ns9' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text('USD')\n xml['ns10'].TransactionDateTime('xmlns:ns10' =>\n \"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text('2014-04-03T13:50:16') \n xml['ns1'].AccountType 'NotSet'\n xml['ns1'].CustomerPresent 'Present'\n xml['ns1'].EmployeeId '11'\n if params[:Track2Data].present? || params[:Track1Data].present?\n xml['ns1'].EntryMode params[:EntryMode]\n else\n xml['ns1'].EntryMode 'Keyed'\n end \n xml['ns1'].IndustryType params[:IndustryType]\n xml['ns1'].InvoiceNumber('i:nil' =>\"true\")\n xml['ns1'].OrderNumber('i:nil' =>\"true\")\n xml['ns1'].TipAmount '0.0'\n } \n }\n }\n end.to_xml\n rescue Exception => ex\n return \"Some value not set in xml for verifyXML!\"\n end\n end", "title": "" }, { "docid": "ed9687330516d785e8ca5244876be126", "score": "0.5179881", "text": "def to_xml(xml=Builder::XmlMarkup.new)\n attributes = {'ID' => id, 'Version' => version, 'IssueInstant' => issue_instant.in_time_zone.xmlschema}\n attributes['InResponseTo'] = in_response_to unless in_response_to.nil?\n attributes['Destination'] = destination unless destination.nil?\n attributes['Consent'] = consent unless consent.nil?\n attributes = add_xmlns(attributes)\n xml.tag!('samlp:Response', attributes) {\n xml << issuer.to_xml unless issuer.nil?\n xml << signature.to_xml unless signature.nil?\n # TODO: add extensions support\n xml << status.to_xml unless status.nil?\n assertions.each { |assertion| xml << assertion.to_xml }\n encrypted_assertions.each { |encrypted_assertion| xml << encrypted_assertion.to_xml }\n }\n end", "title": "" }, { "docid": "5944e3489ef4988ae965a2a8f6fb8614", "score": "0.51683646", "text": "def query_by_transaction_id(trans_id)\r\n @PARAM_HASH[\"id\"] = trans_id\r\n end", "title": "" }, { "docid": "5944e3489ef4988ae965a2a8f6fb8614", "score": "0.51683646", "text": "def query_by_transaction_id(trans_id)\r\n @PARAM_HASH[\"id\"] = trans_id\r\n end", "title": "" }, { "docid": "ea08cd3de9762a0b47284b63ce44e340", "score": "0.5155356", "text": "def to_xml(xml=Builder::XmlMarkup.new)\n xml.tag!('samlp:AssertionIDRequest') {\n assertion_id_refs.each { |assertion_id_ref| xml << assertion_id_ref.to_xml }\n }\n end", "title": "" }, { "docid": "44e332f395fdedf432ce0ae52a9ab93a", "score": "0.5124426", "text": "def transaction_id\n params['x_trans_id']\n end", "title": "" }, { "docid": "d7deb9eb9db1b2b33d8db22b40441d3a", "score": "0.5118464", "text": "def to_xml\n response\n end", "title": "" }, { "docid": "1592b1e51de8ff617bfa3a700c81fef0", "score": "0.5116675", "text": "def generate_xml_request\n tax_receipt = generate_tax_receipt\n @certificate.certifica tax_receipt\n @key.sella tax_receipt\n tax_receipt.to_xml\n end", "title": "" }, { "docid": "691a8e03600406fa3b7e1e7a7fef5fc7", "score": "0.5115086", "text": "def reserve(params)\n AmazonProcessor.validate_reservation_response params\n raise PreconditionsError, 'Payment state should be :created' unless payment.created?\n r_amount = Remit::RequestTypes::Amount.new ({value: payment.amount, currency_code: 'USD'})\n caller_ref = new_caller_reference\n request = Remit::Reserve::Request.new ({\n recipient_token_id: recipient_token,\n sender_token_id: params[:tokenID],\n caller_reference: caller_ref,\n transaction_amount: r_amount,\n charge_fee_to: 'Caller'\n })\n\n response = remit.reserve(request)\n\n raise ApiInteractionError, response.errors.join('; ') unless response.errors.empty?\n\n update_attribute :transaction_id, response.reserve_result.transaction_id\n update_attribute :caller_reference, caller_ref\n payment.update_attribute :state, :reserved\n end", "title": "" }, { "docid": "46f6ce60fe435cc98eab32f6b153cd7b", "score": "0.5113107", "text": "def to_xml(opts={})\n { :name => self.controller_name,\n :parameters => self.queryable_params,\n :identifier => self.xml_identifier\n }.to_xml(opts.merge(:root => \"resource\"))\n end", "title": "" }, { "docid": "63205690d3dd8aa09f193d5f0cf24ebc", "score": "0.5110626", "text": "def retrieve(params = {})\n req = WebPay::ChargeIdRequest.create(params)\n raw_response = @client._request(:get, 'charges' + '/' + req.id.to_s, req)\n WebPay::ChargeResponse.new(raw_response)\n end", "title": "" }, { "docid": "c8db07f3f97b7d717e971962b9354cbd", "score": "0.5071808", "text": "def transaction_id\n params['x_trans_id']\n end", "title": "" }, { "docid": "ed2da2723a68967b746fba7e4305a923", "score": "0.506146", "text": "def make_url(params) #:nodoc:\n params[:appid] = @appid\n params[:output] = 'xml'\n\n super params\n end", "title": "" }, { "docid": "ed2da2723a68967b746fba7e4305a923", "score": "0.506146", "text": "def make_url(params) #:nodoc:\n params[:appid] = @appid\n params[:output] = 'xml'\n\n super params\n end", "title": "" }, { "docid": "78d08ef684ca9b093d69fc1f5d64af1a", "score": "0.5059793", "text": "def make_url(params) #:nodoc:\n params[:key] = @key\n params[:output] = 'xml'\n\n super params\n end", "title": "" }, { "docid": "2515daf5cd259363a9c15227ae149c22", "score": "0.5045425", "text": "def make_xml_request( opts={} )\n\t\topts = TEST_XML_REQUEST_OPTS.merge( opts )\n\t\theaders = normalize_headers( opts, TEST_XML_HEADERS )\n\t\theaders.delete( 'URI' ) # XML requests don't have one\n\n\t\tMongrel2.log.debug \"XML request, headers = %p, opts = %p\" % [ headers, opts ]\n\n\t\theaderstring = TNetstring.dump( Yajl::Encoder.encode(headers) )\n\t\tbodystring = TNetstring.dump( opts[:body] || \"#{TEST_XML_PATH} />\" )\n\n\t\t# UUID ID PATH SIZE:HEADERS,SIZE:BODY,\n\t\tdata = \"%s %d %s %s%s\" % [\n\t\t\topts[:uuid],\n\t\t\topts[:id],\n\t\t\topts[:path],\n\t\t\theaderstring,\n\t\t\tbodystring,\n\t\t]\n\t\treturn data.encode( 'binary' )\n\tend", "title": "" }, { "docid": "2515daf5cd259363a9c15227ae149c22", "score": "0.50437844", "text": "def make_xml_request( opts={} )\n\t\topts = TEST_XML_REQUEST_OPTS.merge( opts )\n\t\theaders = normalize_headers( opts, TEST_XML_HEADERS )\n\t\theaders.delete( 'URI' ) # XML requests don't have one\n\n\t\tMongrel2.log.debug \"XML request, headers = %p, opts = %p\" % [ headers, opts ]\n\n\t\theaderstring = TNetstring.dump( Yajl::Encoder.encode(headers) )\n\t\tbodystring = TNetstring.dump( opts[:body] || \"#{TEST_XML_PATH} />\" )\n\n\t\t# UUID ID PATH SIZE:HEADERS,SIZE:BODY,\n\t\tdata = \"%s %d %s %s%s\" % [\n\t\t\topts[:uuid],\n\t\t\topts[:id],\n\t\t\topts[:path],\n\t\t\theaderstring,\n\t\t\tbodystring,\n\t\t]\n\t\treturn data.encode( 'binary' )\n\tend", "title": "" }, { "docid": "accf7e4f9ff404ada98bb310ec78b61a", "score": "0.5041877", "text": "def get_transactions(*params); raise('Stub or mock required.') end", "title": "" }, { "docid": "0f5a37fcd4fb596be59d2aaba014a030", "score": "0.50404733", "text": "def hash_xml(xml, params)\n params.each do |key, value|\n xml = xml_key_value(key, value, xml)\n end\n xml\n end", "title": "" }, { "docid": "6b657f906aaaf0084d47f3873a3946bd", "score": "0.50186795", "text": "def to_xml(*)\n self\n end", "title": "" }, { "docid": "a5478a5ec26a43e99f31a3eca929c1ac", "score": "0.5006773", "text": "def pay\n #@CallerTokenId = params['CallerTokenId']\n #@RecipientTokenId = params['RecipientTokenId']\n #@SenderTokenId = params['SenderTokenId']\n #@Amount = params['Amount']\n\n call = { 'Action' => 'Pay',\n \t\t# tokens\n \t\t'CallerTokenId' => @CallerTokenId,\n \t\t'SenderTokenId' => @SenderTokenId,\n \t\t'RecipientTokenId' => @RecipientTokenId,\n\t\t\n \t\t# transactions details ### NOTE: Complex types are sent like this. #####\n \t\t'TransactionAmount.Amount' => @Amount, \n \t\t'TransactionAmount.CurrencyCode' => 'USD', \n \t\t'TransactionDate' => Time.now.gmtime.iso8601, # example result: 2007-05-10T13:08:02\n \t\t'ChargeFeeTo' => 'Recipient', #this must match the true/false value from the recipient token\n\t\t\n \t\t# references - unique transaction values\n \t\t'CallerReference' => 'Order-' + Time.now.to_i.to_s, # required unique value for each pay call\n \t\t'SenderReference' => 'Test Sender reference string', # optional unique reference for the sender\n \t\t'RecipientReference' => 'Test Recipient reference string' # optional unique reference for the recipient\n }\n # make the REST call \n\t\t@fps_response = AWS::FPS::Query.do(call)\n\t\trexml_doc = REXML::Document.new(@fps_response)\n\t\telements = rexml_doc.root.elements\n @xml_out = pretty_xml(rexml_doc)\n\t\t@status = elements[\"Status\"].text\n\t\t@request_id = elements[\"RequestId\"].text\n\t\t@success = false\n\t\tif @status == \"Success\"\n\t\t @success = true\n\t\t @TransactionId = elements[\"TransactionResponse\"].elements['TransactionId'].text\n\t\tend\n end", "title": "" }, { "docid": "fa63ec51b1346ac4726beccdbbd719d8", "score": "0.5005276", "text": "def generate_xml\n\t\n\t\tbuilder = Nokogiri::XML::Builder.new do |xml|\n \t\t\txml.randomGeneratedData {\n \t\t\txml.parameters(nbStations: @inputs.nb_stations, nbDemands: @inputs.nb_demands)\n xml.stations {\n @list_stations.each do |s|\n\t\t\t\t\t\t\txml.station(\n\t\t\t\t\t\t\t\tid: s.id, \n\t\t\t\t\t\t\t\txPos: s.xPos, \n\t\t\t\t\t\t\t\tyPos: s.yPos,\n\t\t\t\t\t\t\t\tmaxSize: s.maxSize\n\t\t\t\t\t\t\t)\n end\n }\n \t\t\t\txml.demands {\n @list_demands.each do |d|\n \t\t\t\t\t\txml.demand(\n\t\t\t\t\t\t\t id: d.id,\n\t\t\t\t\t\t\t\tidsOrigin: d.sOrigin.id, \n\t\t\t\t\t\t\t\tidsDestination: d.sDestination.id, \n\t\t\t\t\t\t\t\tnbDemand: d.nbDemand,\n\t\t\t\t\t\t\t\tdepartureTime: d.departureTime_TS,\n\t\t\t\t\t\t\t\tarrivalTime: d.arrivalTime_TS\n \t\t\t\t\t\t)\n end\n \t\t\t\t}\n \t\t\t}\n\t\tend\n\t\t\n\t\treturn builder.to_xml\n\tend", "title": "" }, { "docid": "58b952ac626453532e31a560984fa12f", "score": "0.49931023", "text": "def create(params)\n m = type.create(params)\n @id = m.id\n puts \" + #{type}: #{params.inspect} => #{@id}\"\n m\n end", "title": "" }, { "docid": "56520b794a86bea117f113a9fd5f82b1", "score": "0.49763417", "text": "def get_payment_detail(attributes = {})\n ::Nokogiri::XML::Builder.new(:encoding => \"utf-8\") do |xml|\n xml.send(\"soapenv:Envelope\", \"xmlns:soapenv\" => \"http://schemas.xmlsoap.org/soap/envelope/\", \"xmlns:v1\" => \"http://gpe.cz/pay/pay-ws/proc/v1\", \"xmlns:type\" => \"http://gpe.cz/pay/pay-ws/proc/v1/type\") {\n xml.send(\"soapenv:Header\")\n xml.send(\"soapenv:Body\") {\n xml.send(\"v1:getPaymentDetail\") {\n xml.send(\"v1:paymentDetailRequest\") {\n xml.send(\"type:messageId\", attributes[:message_id])\n xml.send(\"type:provider\", \"0100\")\n xml.send(\"type:merchantNumber\", attributes[:merchant_number])\n xml.send(\"type:paymentNumber\", attributes[:order_number])\n xml.send(\"type:signature\", attributes[:digest])\n }\n }\n }\n }\n end.to_xml\n end", "title": "" }, { "docid": "7e1e895d7f7fd63d250cee79d3058b07", "score": "0.49670142", "text": "def make_xml_request( opts={} )\n\t\topts = TEST_XML_REQUEST_OPTS.merge( opts )\n\t\theaders = normalize_headers( opts, TEST_XML_HEADERS )\n\t\theaders.delete( 'URI' ) # XML requests don't have one\n\n\t\tMongrel2.log.debug \"XML request, headers = %p, opts = %p\" % [ headers, opts ]\n\n\t\theaderstring = TNetstring.dump( Yajl::Encoder.encode(headers) )\n\t\tbodystring = TNetstring.dump( opts[:body] || \"#{TEST_XML_PATH} />\" )\n\n\t\t# UUID ID PATH SIZE:HEADERS,SIZE:BODY,\n\t\treturn \"%s %d %s %s%s\" % [\n\t\t\topts[:uuid],\n\t\t\topts[:id],\n\t\t\topts[:path],\n\t\t\theaderstring,\n\t\t\tbodystring,\n\t\t]\n\tend", "title": "" }, { "docid": "a1bf72b42759de54755ee2caa5b256b4", "score": "0.49645847", "text": "def authorizeXML(params) \n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.AuthorizeTransaction('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance', \n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest',\n 'i:type' =>\"AuthorizeTransaction\" ) {\n xml.ApplicationProfileId application_profile_id\n xml.MerchantProfileId merchant_profile_id\n xml.Transaction('xmlns:ns1' => \"http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Bankcard\",\n 'i:type' => \"ns1:BankcardTransaction\" ){\n xml['ns1'].TenderData{\n if params[:SwipeStatus].present? && params[:IdentificationInformation].present? && params[:SecurePaymentAccountData].present? && params[:EncryptionKeyId].present?\n #p \"Swipe card..maga...\"\n xml['ns5'].SecurePaymentAccountData('xmlns:ns5' =>\n \"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:SecurePaymentAccountData])\n xml['ns6'].EncryptionKeyId('xmlns:ns6' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:EncryptionKeyId])\n xml['ns7'].SwipeStatus('xmlns:ns7' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:SwipeStatus])\n xml['ns1'].CardSecurityData{\n xml['ns1'].IdentificationInformation params[:IdentificationInformation]\n }\n xml['ns1'].CardData('i:nil' =>\"true\")\n elsif params[:SecurePaymentAccountData].present? && params[:EncryptionKeyId].present? \n #p \"Swipe card..Dukp...\"\n xml['ns5'].SecurePaymentAccountData('xmlns:ns5' =>\n \"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:SecurePaymentAccountData])\n xml['ns6'].EncryptionKeyId('xmlns:ns6' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:EncryptionKeyId])\n xml['ns7'].SwipeStatus('xmlns:ns7' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\") \n xml['ns1'].CardSecurityData{\n xml['ns1'].IdentificationInformation('i:nil' =>\"true\")\n }\n xml['ns1'].CardData('i:nil' =>\"true\")\n xml['ns1'].EcommerceSecurityData('i:nil' =>\"true\") \n elsif params[:PaymentAccountDataToken].present?\n #p \"PaymentAccountDataToken...........\"\n xml['ns4'].PaymentAccountDataToken('xmlns:ns4' =>\n \"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:PaymentAccountDataToken])\n xml['ns5'].SecurePaymentAccountData('xmlns:ns5' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns6'].EncryptionKeyId('xmlns:ns6' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns7'].SwipeStatus('xmlns:ns7' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\") \n xml['ns1'].CardData('i:nil' =>\"true\")\n xml['ns1'].EcommerceSecurityData('i:nil' =>\"true\") \n else \n #p \"without token....\"\n xml['ns4'].PaymentAccountDataToken('xmlns:ns4' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\", 'i:nil' =>\"true\")\n xml['ns5'].SecurePaymentAccountData('xmlns:ns5' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns6'].EncryptionKeyId('xmlns:ns6' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns7'].SwipeStatus('xmlns:ns7' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns1'].CardData{\n xml['ns1'].CardType params[:CardType] \n if params[:Track2Data].present?\n xml['ns1'].Track2Data params[:Track2Data]\n xml['ns1'].PAN('i:nil' =>\"true\") \n xml['ns1'].Expire('i:nil' =>\"true\")\n xml['ns1'].Track1Data('i:nil' =>\"true\")\n elsif params[:Track1Data].present?\n xml['ns1'].Track1Data params[:Track1Data]\n xml['ns1'].PAN('i:nil' =>\"true\") \n xml['ns1'].Expire('i:nil' =>\"true\")\n xml['ns1'].Track2Data('i:nil' =>\"true\")\n else\n xml['ns1'].PAN params[:PAN] \n xml['ns1'].Expire params[:Expire]\n xml['ns1'].Track1Data('i:nil' =>\"true\")\n xml['ns1'].Track2Data('i:nil' =>\"true\")\n end \n }\n xml['ns1'].EcommerceSecurityData('i:nil' =>\"true\") \n end\n }\n xml['ns2'].CustomerData('xmlns:ns2' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\"){\n xml['ns2'].BillingData{\n xml['ns2'].Name('i:nil' =>\"true\")\n xml['ns2'].Address{\n xml['ns2'].Street1 params[:Street1] \n xml['ns2'].Street2('i:nil' =>\"true\")\n xml['ns2'].City params[:City] \n xml['ns2'].StateProvince params[:StateProvince]\n xml['ns2'].PostalCode params[:PostalCode]\n xml['ns2'].CountryCode params[:CountryCode]\n }\n xml['ns2'].BusinessName 'MomCorp'\n xml['ns2'].Phone params[:Phone]\n xml['ns2'].Fax('i:nil' =>\"true\")\n xml['ns2'].Email params[:Email]\n }\n xml['ns2'].CustomerId 'cust123'\n xml['ns2'].CustomerTaxId('i:nil' =>\"true\")\n xml['ns2'].ShippingData('i:nil' =>\"true\")\n }\n xml['ns3'].ReportingData('xmlns:ns3' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\"){\n xml['ns3'].Comment 'a test comment'\n xml['ns3'].Description 'a test description'\n xml['ns3'].Reference '001'\n }\n xml['ns1'].TransactionData{\n if params[:Amount] != ''\n xml['ns8'].Amount('xmlns:ns8' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:Amount])\n else\n xml['ns8'].Amount('xmlns:ns8' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text('0.00')\n end\n #xml['ns8'].Amount('xmlns:ns8' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:Amount])\n xml['ns9'].CurrencyCode('xmlns:ns9' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text('USD') \n xml['ns10'].TransactionDateTime('xmlns:ns10' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text('2013-04-03T13:50:16')\n xml['ns11'].CampaignId('xmlns:ns11' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns12'].Reference('xmlns:ns12' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text('xyt')\n xml['ns1'].AccountType 'NotSet'\n xml['ns1'].ApprovalCode('i:nil' =>\"true\")\n xml['ns1'].CashBackAmount '0.0'\n xml['ns1'].CustomerPresent 'Present'\n xml['ns1'].EmployeeId '11'\n xml['ns1'].EntryMode params[:EntryMode]\n xml['ns1'].GoodsType 'NotSet'\n xml['ns1'].IndustryType params[:IndustryType]\n xml['ns1'].InternetTransactionData('i:nil' =>\"true\")\n xml['ns1'].InvoiceNumber params[:InvoiceNumber]\n xml['ns1'].OrderNumber params[:OrderNumber]\n xml['ns1'].IsPartialShipment 'false'\n xml['ns1'].SignatureCaptured 'false'\n xml['ns1'].FeeAmount '0.0'\n xml['ns1'].TerminalId('i:nil' =>\"true\")\n xml['ns1'].LaneId('i:nil' =>\"true\")\n xml['ns1'].TipAmount '0.0'\n xml['ns1'].BatchAssignment('i:nil' =>\"true\")\n xml['ns1'].PartialApprovalCapable 'NotSet'\n xml['ns1'].ScoreThreshold('i:nil' =>\"true\")\n xml['ns1'].IsQuasiCash 'false' \n }\n }\n } \n end.to_xml \n rescue Exception => ex\n return \"Some value not set in xml for authorizeXML!\"\n end\n end", "title": "" }, { "docid": "8f9adff7a6261c3555363c65ed9b1c21", "score": "0.49532235", "text": "def create_by_api(params = {})\n create_by_translator params_to_translator(params)\n end", "title": "" }, { "docid": "5ff22b9f3bc72a92707e09428f8bf855", "score": "0.49510658", "text": "def transaction_id\n\tparams['txn_id']\n end", "title": "" }, { "docid": "6a8be4bf26179386733abb9e74009ce7", "score": "0.49424547", "text": "def initialize(params)\n @result = params[:result]\n @user_id = params[:userid]\n @post = build_xml( params[:result] )\n end", "title": "" }, { "docid": "9e6d5400eb94388c74845dd996f535c4", "score": "0.4925339", "text": "def payout_transaction_with_http_info(transaction_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: TransactionsApi.payout_transaction ...'\n end\n # verify the required parameter 'transaction_id' is set\n if @api_client.config.client_side_validation && transaction_id.nil?\n fail ArgumentError, \"Missing the required parameter 'transaction_id' when calling TransactionsApi.payout_transaction\"\n end\n # resource path\n local_var_path = '/transactions/{Transaction ID}/payout'.sub('{' + 'Transaction ID' + '}', transaction_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['AuthorizationKey', 'AuthorizationNonce', 'AuthorizationSecret', 'AuthorizationSignature']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'TransactionResponse')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: TransactionsApi#payout_transaction\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "82451a20d193985f4f43f1e9ed86d8cd", "score": "0.4916244", "text": "def _create_xml(method_name, isExtApi, data = [])\n raise \"Invalid data! Needs to be an array\" if isExtApi && !data.is_a?(Array)\n\n output = \"\"\n xml = Builder::XmlMarkup.new(:target => output, :indent => 1)\n xml.instruct!\n xml.methodCall {\n xml.methodName isExtApi ? \"extapi.callWpMethod\" : method_name\n xml.params {\n xml.param {\n xml.value {\n xml.string @rpc_admin\n }\n }\n xml.param {\n xml.value {\n xml.string @rpc_password\n }\n }\n if isExtApi\n xml.param {\n xml.value {\n xml.string method_name\n }\n }\n end\n xml.param {\n xml.value {\n if isExtApi\n xml.array {\n xml.data {\n data.each do |param|\n if param.is_a? Hash\n xml.value {\n _create_key_value_xml_struct(output, param)\n }\n else\n _create_value_xml_struct(output, param)\n end\n end\n }\n }\n else\n _create_key_value_xml_struct(output, data)\n end\n }\n }\n }\n }\n return output\n end", "title": "" }, { "docid": "8eb1cf797edc7135b5365056e2f58029", "score": "0.4894518", "text": "def create_refund_request_xml(merchantCode, orderCode, currencyCode, amount)\n xml = \"<?xml version=\\\"1.0\\\"?>\\n\"\n xml << \"<!DOCTYPE paymentService PUBLIC '-//WorldPay/DTD WorldPay PaymentService v1/EN' 'http://dtd.worldpay.com/paymentService_v1.dtd'>\\n\"\n xml << \"<paymentService version=\\\"1.4\\\" merchantCode=\\\"\" + merchantCode + \"\\\">\\n\"\n xml << \"<modify>\\n\"\n xml << \"<orderModification orderCode=\\\"\" + orderCode + \"\\\">\\n\"\n xml << \"<refund>\\n\"\n xml << \"<amount value=\\\"\"+ amount.to_s + \"\\\" currencyCode=\\\"\" + currencyCode + \"\\\" exponent=\\\"2\\\"/>\"\n xml << \"</refund>\\n\"\n xml << \"</orderModification>\\n\"\n xml << \"</modify>\\n\"\n xml << \"</paymentService>\\n\"\n xml\n end", "title": "" }, { "docid": "55ded2c51be23f0c4ab9eb2744f5a011", "score": "0.48931396", "text": "def parameterdetails(parameter_id)\n\n url= \"#{@base_url}/#{@tool}/parameterdetails/#{URI.encode(parameter_id)}\"\n uri = URI.parse(url)\n resp = Net::HTTP.get_response(uri)\n\n paramdetails = XmlSimple.xml_in(resp.body)\n\n return paramdetails\n\n end", "title": "" }, { "docid": "b0d12ba6e0ed4cc9498c058d3b8fb7a9", "score": "0.4892249", "text": "def transactions_get_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.transactions_get ...'\n end\n # resource path\n local_var_path = '/api/v1/transactions'\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'addrs'] = opts[:'addrs'] if !opts[:'addrs'].nil?\n query_params[:'confirmed'] = opts[:'confirmed'] if !opts[:'confirmed'].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', 'application/xml', ])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Object' \n\n # auth_names\n auth_names = opts[:auth_names] || []\n\n new_options = opts.merge(\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#transactions_get\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "fc1c744182dc942b68d36f36b97d60e5", "score": "0.48908585", "text": "def to_xml\n doc = REXML::Document.new\n doc << REXML::XMLDecl.default\n doc.add_element(\"envelope\")\n p = doc.root.add_element(\"params\", { \"index\" => \"1\" })\n unless receivers.empty?\n to_elt = p.add_element(\"to\")\n receivers.each do |aid|\n agent_identifier_to_xml(to_elt, aid)\n end\n end\n unless sender.nil?\n from_elt = p.add_element(\"from\")\n agent_identifier_to_xml(from_elt, sender)\n end\n unless comments.nil?\n elt = p.add_element(\"comments\")\n elt.text = comments\n end\n unless acl_representation.nil?\n elt = p.add_element(\"acl-representation\")\n elt.text = acl_representation\n end\n unless payload_length.nil?\n elt = p.add_element(\"payload-length\")\n elt.text = payload_length\n end\n unless payload_encoding.nil?\n elt = p.add_element(\"payload-encoding\")\n elt.text = payload_encoding\n end\n unless date.nil?\n elt = p.add_element(\"date\")\n elt.text = date.iso8601\n end\n unless encrypted.nil?\n elt = p.add_element(\"encrypted\")\n elt.text = encrypted\n end\n unless intended_receivers.empty?\n elt = p.add_element(\"intended-receiver\")\n intended_receivers.each do |r|\n agent_identifier_to_xml(elt, r)\n end\n end\n unless received.nil?\n received_elt = p.add_element(\"received\")\n received_by_elt = received_elt.add_element(\"received-by\")\n url_elt = received_by_elt.add_element(\"url\")\n url_elt.text = received.by\n unless received.from.nil?\n received_from_elt = received_elt.add_element(\"received-from\")\n url_elt = received_from_elt.add_element(\"url\")\n url_elt.text = received.from\n end\n received_elt.add_element(\"received-date\", { \"value\" => received.date })\n unless received.id.nil?\n received_elt.add_element(\"received-id\", { \"value\" => received.id})\n end\n unless received.via.nil?\n received_elt.add_element(\"received-via\", { \"value\" => received.via})\n end\n end\n doc\n end", "title": "" }, { "docid": "7a0253d01bd40c4c16240b39b0b12f66", "score": "0.48756075", "text": "def build_result(action)\n xml = ''\n doc = Builder::XmlMarkup.new(:target => xml)\n doc.tag!(\"#{action}Response\", :xmlns => \"http://sdb.amazonaws.com/doc/2007-11-07\") do\n if block_given?\n yield doc\n end\n \n doc.ResponseMetadata do\n doc.RequestId \"1234\"\n doc.BoxUsage \"0\"\n end\n end\n \n xml\n end", "title": "" }, { "docid": "af0a4f7cb10069dc9b67c18d03f75b08", "score": "0.48745495", "text": "def to_xml\n\t\tend", "title": "" }, { "docid": "af0a4f7cb10069dc9b67c18d03f75b08", "score": "0.48745495", "text": "def to_xml\n\t\tend", "title": "" }, { "docid": "7897e5ba97b8e13eb66bef15c895af01", "score": "0.4872467", "text": "def generate_xml( args={} )\n biomart_xml = \"\"\n xml = Builder::XmlMarkup.new( :target => biomart_xml, :indent => 2 )\n \n xml.instruct!\n xml.declare!( :DOCTYPE, :Query )\n xml.Query( :virtualSchemaName => \"default\", :formatter => \"TSV\", :header => \"0\", :uniqueRows => \"1\", :count => args[:count], :datasetConfigVersion => \"0.6\" ) {\n xml.Dataset( :name => @name, :interface => \"default\" ) {\n \n if args[:filters]\n args[:filters].each do |name,value|\n if value.is_a? Array\n value = value.join(\",\")\n end\n xml.Filter( :name => name, :value => value )\n end\n else\n self.filters.each do |name,filter|\n if filter.default\n xml.Filter( :name => name, :value => filter.default_value )\n end\n end\n end\n \n unless args[:count]\n if args[:attributes]\n args[:attributes].each do |name|\n xml.Attribute( :name => name )\n end\n else\n self.attributes.each do |name,attribute|\n if attribute.default\n xml.Attribute( :name => name )\n end\n end\n end\n end\n \n }\n }\n \n return biomart_xml\n end", "title": "" }, { "docid": "b82d2c1aaccfecdb1d90795ecc51fd05", "score": "0.48694938", "text": "def to_xml()\n XmlSimple.xml_out( { :address => self.to_hash() }, { :KeepRoot=>true, :NoAttr=>true } )\n end", "title": "" }, { "docid": "cf8972a845ab06bf3514a95e07b4a7de", "score": "0.48627916", "text": "def soap_call(name, method, params = {})\n begin\n result = @service.request(name) do |soap|\n # soap.action = \"KashFlow/#{method}\"\n\n params = params.pop if params.is_a?(Array)\n params_xml = Gyoku.xml(params, { key_converter: :camelcase }) if params.present?\n\n params_xml = params_xml.gsub(/Id>/,\"ID>\") if params_xml\n params_xml = params_xml.gsub(/Dbid>/,\"DBID>\") if params_xml\n params_xml = params_xml.gsub(/<InvoiceLine>/, \"<InvoiceLine xsi:type=\\\"InvoiceLine\\\">\") if params_xml\n pretext, posttext = object_wrapper(name, params_xml)\n\n soap.xml = %[<?xml version=\"1.0\" encoding=\"utf-8\"?>\n <soap:Envelope xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\" xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" xmlns:soap=\"http://schemas.xmlsoap.org/soap/envelope/\">\n <soap:Body>\n <#{method} xmlns=\"KashFlow\">\n <UserName>#{@login}</UserName>\n <Password>#{@password}</Password>\n #{pretext}\n #{params_xml}\n #{posttext}\n </#{method}>\n </soap:Body>\n </soap:Envelope>]\n end.to_hash\n rescue Savon::SOAP::Fault => e\n puts \"soap fault:\" + e.inspect\n return false\n end\n end", "title": "" }, { "docid": "b2a2fe5387ce39801aef720accadbd41", "score": "0.48625174", "text": "def notice_xml\n render xml: {\n notice: {\n id: (@results.first[:hash] rescue nil)\n }\n }\n end", "title": "" }, { "docid": "9467ce260de4ed2c07719e67ee2c537f", "score": "0.4852868", "text": "def authorizeAndCaptureXML(params)\n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.AuthorizeAndCaptureTransaction('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance', \n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest',\n 'i:type' =>\"AuthorizeAndCaptureTransaction\" ) {\n xml.ApplicationProfileId application_profile_id\n xml.MerchantProfileId merchant_profile_id \n xml.Transaction('xmlns:ns1' => \"http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Bankcard\", \n 'i:type' => \"ns1:BankcardTransaction\" ){\n xml['ns1'].TenderData{\n if params[:SwipeStatus].present? && params[:IdentificationInformation].present? && params[:SecurePaymentAccountData].present? && params[:EncryptionKeyId].present?\n #p \"Swipe card..maga...\"\n xml['ns5'].SecurePaymentAccountData('xmlns:ns5' =>\n \"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:SecurePaymentAccountData])\n xml['ns6'].EncryptionKeyId('xmlns:ns6' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:EncryptionKeyId])\n xml['ns7'].SwipeStatus('xmlns:ns7' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:SwipeStatus])\n xml['ns1'].CardSecurityData{\n xml['ns1'].IdentificationInformation params[:IdentificationInformation]\n }\n xml['ns1'].CardData('i:nil' =>\"true\")\n elsif params[:SecurePaymentAccountData].present? && params[:EncryptionKeyId].present? \n #p \"Swipe card..Dukp...\"\n xml['ns5'].SecurePaymentAccountData('xmlns:ns5' =>\n \"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:SecurePaymentAccountData])\n xml['ns6'].EncryptionKeyId('xmlns:ns6' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:EncryptionKeyId])\n xml['ns7'].SwipeStatus('xmlns:ns7' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\") \n xml['ns1'].CardSecurityData{\n xml['ns1'].IdentificationInformation('i:nil' =>\"true\")\n }\n xml['ns1'].CardData('i:nil' =>\"true\")\n xml['ns1'].EcommerceSecurityData('i:nil' =>\"true\") \n elsif params[:PaymentAccountDataToken].present?\n #p \"PaymentAccountDataToken...........\"\n xml['ns4'].PaymentAccountDataToken('xmlns:ns4' =>\n \"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:PaymentAccountDataToken])\n xml['ns5'].SecurePaymentAccountData('xmlns:ns5' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns6'].EncryptionKeyId('xmlns:ns6' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns7'].SwipeStatus('xmlns:ns7' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\") \n xml['ns1'].CardData('i:nil' =>\"true\")\n xml['ns1'].EcommerceSecurityData('i:nil' =>\"true\") \n else \n #p \"without token....\"\n xml['ns4'].PaymentAccountDataToken('xmlns:ns4' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\", 'i:nil' =>\"true\")\n xml['ns5'].SecurePaymentAccountData('xmlns:ns5' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns6'].EncryptionKeyId('xmlns:ns6' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns7'].SwipeStatus('xmlns:ns7' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns1'].CardData{\n xml['ns1'].CardType params[:CardType] \n if params[:Track2Data].present?\n xml['ns1'].Track2Data params[:Track2Data]\n xml['ns1'].PAN('i:nil' =>\"true\") \n xml['ns1'].Expire('i:nil' =>\"true\")\n xml['ns1'].Track1Data('i:nil' =>\"true\")\n elsif params[:Track1Data].present?\n xml['ns1'].Track1Data params[:Track1Data]\n xml['ns1'].PAN('i:nil' =>\"true\") \n xml['ns1'].Expire('i:nil' =>\"true\")\n xml['ns1'].Track2Data('i:nil' =>\"true\")\n else\n xml['ns1'].PAN params[:PAN] \n xml['ns1'].Expire params[:Expire]\n xml['ns1'].Track1Data('i:nil' =>\"true\")\n xml['ns1'].Track2Data('i:nil' =>\"true\")\n end\n }\n xml['ns1'].EcommerceSecurityData('i:nil' =>\"true\") \n end\n }\n xml['ns2'].CustomerData('xmlns:ns2' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\"){\n xml['ns2'].BillingData{\n xml['ns2'].Name('i:nil' =>\"true\")\n xml['ns2'].Address{\n xml['ns2'].Street1 params[:Street1] \n xml['ns2'].Street2('i:nil' =>\"true\")\n xml['ns2'].City params[:City] \n xml['ns2'].StateProvince params[:StateProvince]\n xml['ns2'].PostalCode params[:PostalCode]\n xml['ns2'].CountryCode params[:CountryCode]\n }\n xml['ns2'].BusinessName 'MomCorp'\n xml['ns2'].Phone params[:Phone]\n xml['ns2'].Fax('i:nil' =>\"true\")\n xml['ns2'].Email params[:Email]\n }\n xml['ns2'].CustomerId 'cust123'\n xml['ns2'].CustomerTaxId('i:nil' =>\"true\")\n xml['ns2'].ShippingData('i:nil' =>\"true\")\n }\n xml['ns3'].ReportingData('xmlns:ns3' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\"){\n xml['ns3'].Comment 'a test comment'\n xml['ns3'].Description 'a test description'\n xml['ns3'].Reference '001'\n }\n xml['ns1'].TransactionData{\n if params[:Amount] != ''\n xml['ns8'].Amount('xmlns:ns8' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:Amount])\n else\n xml['ns8'].Amount('xmlns:ns8' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text('0.00')\n end\n #xml['ns8'].Amount('xmlns:ns8' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text(params[:Amount])\n xml['ns9'].CurrencyCode('xmlns:ns9' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text('USD') \n xml['ns10'].TransactionDateTime('xmlns:ns10' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text('2013-04-03T13:50:16')\n xml['ns11'].CampaignId('xmlns:ns11' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\",'i:nil' =>\"true\")\n xml['ns12'].Reference('xmlns:ns12' =>\"http://schemas.ipcommerce.com/CWS/v2.0/Transactions\").text('xyt')\n xml['ns1'].AccountType 'NotSet'\n xml['ns1'].ApprovalCode('i:nil' =>\"true\")\n xml['ns1'].CashBackAmount '0.0'\n xml['ns1'].CustomerPresent 'Present'\n xml['ns1'].EmployeeId '11'\n xml['ns1'].EntryMode params[:EntryMode]\n xml['ns1'].GoodsType 'NotSet'\n xml['ns1'].IndustryType params[:IndustryType]\n xml['ns1'].InternetTransactionData('i:nil' =>\"true\")\n xml['ns1'].InvoiceNumber params[:InvoiceNumber]\n xml['ns1'].OrderNumber params[:OrderNumber]\n xml['ns1'].IsPartialShipment 'false'\n xml['ns1'].SignatureCaptured 'false'\n xml['ns1'].FeeAmount '0.0'\n xml['ns1'].TerminalId('i:nil' =>\"true\")\n xml['ns1'].LaneId('i:nil' =>\"true\")\n xml['ns1'].TipAmount '0.0'\n xml['ns1'].BatchAssignment('i:nil' =>\"true\")\n xml['ns1'].PartialApprovalCapable 'NotSet'\n xml['ns1'].ScoreThreshold('i:nil' =>\"true\")\n xml['ns1'].IsQuasiCash 'false'\n }\n }\n } \n end.to_xml \n rescue Exception => ex\n return \"Some value not set in xml for authorizeAndCaptureXML!\"\n end\n end", "title": "" }, { "docid": "6bcee72c6d282b7471d3a2584f448b70", "score": "0.485239", "text": "def preservation_xml\n descriptive_metadata = metadata_source.find_by(source_type: 'descriptive').user_defined_mappings\n structural_metadata = metadata_source.find_by(source_type: 'structural').user_defined_mappings\n\n Nokogiri::XML::Builder.new(encoding: 'UTF-8') { |xml|\n xml.root {\n xml.record {\n xml.uuid { xml.text repo.unique_identifier }\n\n descriptive_metadata.each do |field, values|\n values.each { |value| xml.send(field + '_', value) }\n end\n\n xml.pages {\n structural_metadata['sequence'].map do |asset|\n xml.page {\n asset.map do |field, value|\n Array.wrap(value).each { |v| xml.send(field + '_', v) }\n end\n }\n end\n }\n }\n }\n }.to_xml\n end", "title": "" }, { "docid": "466d26cc04738d476b11e3faa8227471", "score": "0.48372963", "text": "def get_transaction(id)\n submit GetTransaction.new(:transaction_id => id)\n end", "title": "" }, { "docid": "9948dea22d9c7adbfe515548f9ba539b", "score": "0.48332635", "text": "def captureAllXML()\n begin\n Nokogiri::XML::Builder.new do |xml|\n xml.CaptureAll('xmlns:i' => 'http://www.w3.org/2001/XMLSchema-instance', \n 'xmlns' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions/Rest', 'i:type' =>\"CaptureAll\" ) {\n xml.ApplicationProfileId application_profile_id\n xml.MerchantProfileId merchant_profile_id\n xml.BatchIds('xmlns:d2p1' => 'http://schemas.microsoft.com/2003/10/Serialization/Arrays', 'i:nil'=> \"true\")\n xml.DifferenceData('xmlns:d2p1' => 'http://schemas.ipcommerce.com/CWS/v2.0/Transactions','i:nil'=> \"true\")\n } \n end.to_xml \n rescue Exception => ex\n return \"Some value not set in xml for captureAllXML!\"\n end \n end", "title": "" }, { "docid": "eca5004a136e81313640b6f9d656536f", "score": "0.48322582", "text": "def filter(params)\n unless @xml_data\n return 'ERR: filter method only works with xml-based output!'\n\n end\n\n result = Array.new\n begin\n if @xml_data\n\n if params[:given]\n found = @xml_data.xpath(\"//#{params[:given][:entity]}[contains(text(), #{params[:given][:value].inspect})]\")\n if found.size > 0\n @xml_data.xpath(\"//#{params[:entity]}[contains(text(), #{params[:value].inspect})]\").each do |node|\n result << create_response_item(node)\n end\n end\n else # no conditional\n @xml_data.xpath(\"//#{params[:entity]}[contains(text(), #{params[:value].inspect})]\").each do |node|\n result << create_response_item(node)\n end\n end\n\n return result\n else # no xml data\n return 'ERR: no valid xml data!'\n\n end #if\n\n rescue Exception=>e\n return \"ERR: #filter: #{e}\"\n\n end\n\n return result\n\n end", "title": "" }, { "docid": "731f0ddecffb42d10800323bb45b4b58", "score": "0.4830395", "text": "def sale(amount, trans_id='')\n @PARAM_HASH['TRANSACTION_TYPE'] = 'SALE'\n @PARAM_HASH['AMOUNT'] = amount\n @PARAM_HASH['RRNO'] = trans_id\n end", "title": "" }, { "docid": "362f110f9172c99a28b7e57d4440039e", "score": "0.48297316", "text": "def to_xml\n\t\t\ttext = \"\"\n\t\t\t@response.write(text, 1)\n\t\t\treturn text\n\t\tend", "title": "" }, { "docid": "b72b93c9c7458d202acd07d83c19f305", "score": "0.482896", "text": "def get_settled_transaction_report(params = {})\r\n @PARAM_HASH[\"QUERY_BY_SETTLEMENT\"] = '1'\r\n @PARAM_HASH[\"REPORT_START_DATE\"] = params[:report_start_date]\r\n @PARAM_HASH[\"REPORT_END_DATE\"] = params[:report_end_date]\r\n @PARAM_HASH[\"QUERY_BY_HIERARCHY\"] = params[:query_by_hierarchy]\r\n @PARAM_HASH[\"DO_NOT_ESCAPE\"] = params[:do_not_escape] || ''\r\n @PARAM_HASH[\"EXCLUDE_ERRORS\"] = params[:exclude_errors] || ''\r\n @api = \"bpdailyreport2\"\r\n end", "title": "" }, { "docid": "b72b93c9c7458d202acd07d83c19f305", "score": "0.482896", "text": "def get_settled_transaction_report(params = {})\r\n @PARAM_HASH[\"QUERY_BY_SETTLEMENT\"] = '1'\r\n @PARAM_HASH[\"REPORT_START_DATE\"] = params[:report_start_date]\r\n @PARAM_HASH[\"REPORT_END_DATE\"] = params[:report_end_date]\r\n @PARAM_HASH[\"QUERY_BY_HIERARCHY\"] = params[:query_by_hierarchy]\r\n @PARAM_HASH[\"DO_NOT_ESCAPE\"] = params[:do_not_escape] || ''\r\n @PARAM_HASH[\"EXCLUDE_ERRORS\"] = params[:exclude_errors] || ''\r\n @api = \"bpdailyreport2\"\r\n end", "title": "" }, { "docid": "14a1ce882d2872dab5254df21fadf8e9", "score": "0.4824252", "text": "def rpc_response(value)\n render inline: \"xml.instruct! :xml, :version=>'1.0' \\n xml.methodResponse { xml.params { xml.param { #{value} }}}\", type: :builder, content_type: \"text/xml\"\n end", "title": "" }, { "docid": "cf8208895d943b7e59f8663bb47a4282", "score": "0.48152906", "text": "def to_xml\n\t\t\t\"<#{@name} #{attributes_string} />\"\n\t\tend", "title": "" }, { "docid": "0748faa0659c09bf96fe07fef8e2643e", "score": "0.48140964", "text": "def toxml\n\t\tend", "title": "" }, { "docid": "835920190b9f89e81b1ea454b2a3f515", "score": "0.48048377", "text": "def get(id, params={})\n response = Shippo.request(:get, \"#{url}/#{CGI.escape(id)}/\", params)\n self.construct_from(response)\n end", "title": "" }, { "docid": "d4d873ebcd47ed86bb896676f82a2a32", "score": "0.48028263", "text": "def tran_xml(xml, index, job, batch, transaction_set_count) \n if !payer.blank? && !payer.status.blank? && (!payer.gateway.blank? || !payer.gateway_temp.blank?)\n gateway = payer.status.upcase == 'MAPPED' ? payer.gateway : (payer.gateway_temp || 'HLSC')\n payid = payer.payer_identifier(micr_line_information)\n footnote_indicator = (payer.footnote_indicator ? 1 : 0)\n else raise 'Invalid Payer'\n puts \"Payer record for check number #{check_number} is incomplete or invalid\"\n log.error \"Payer record for check number #{check_number} is incomplete or invalid\"\n end\n\n payee_name ||= batch.facility.name.to_s.strip\n xml.tran(:ID => index + 1) do\n xml.tag!(:batch_attrib, 1)\n xml.tag!(:gateway, gateway)\n xml.tag!(:pay_id, payid)\n xml.tag!(:payee_nm, (payee_name.slice(0, 25) if !payee_name.blank?))\n xml.tag!(:aba_num, (micr_line_information.aba_routing_number if micr_line_information))\n xml.tag!(:chk_act, (micr_line_information.payer_account_number if micr_line_information))\n xml.tag!(:chk_num, check_number)\n xml.tag!(:chk_amt, sprintf('%.02f', check_amount.to_f))\n xml.tag!(:eob_id, (index + 1))\n xml.tag!(:tid, job.transaction_number)\n xml.tag!(:rework, '0')\n xml.tag!(:payer_footnote_based, (footnote_indicator || 0))\n xml.tag!(:worklist_status_cd, '')\n xml.tag!(:transaction_receipt_dt, (batch.date.strftime(\"%Y-%m-%d\") unless batch.date.blank?))\n xml.tag!(:hlsc_file_nm, batch.src_file_name)\n xml.tag!(:show_on_worklist, '0')\n xml.tag!(:transaction_guid, guid)\n end\n transaction_set_count += 1\n end", "title": "" }, { "docid": "7f331e4b678ec49065941131773d8a63", "score": "0.48005548", "text": "def get_transaction_with_http_info(id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: PaymentsTransactionsApi.get_transaction ...\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling PaymentsTransactionsApi.get_transaction\"\n end\n # resource path\n local_var_path = \"/transactions/{id}\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['oauth2_client_credentials_grant', 'oauth2_password_grant']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'TransactionResource')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: PaymentsTransactionsApi#get_transaction\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "9277fb94e93ff98cfb54873b99597760", "score": "0.47949108", "text": "def create_bill(params)\n build_header_auth('/bills', API_VERSION_1, 'POST')\n build_request()\n p_hash = {}\n p_hash[\"bill\"] = {\"identifier\" => params['id'],\n \"amount_cents\" => params['amount_cents'],\n \"bill_template_id\" => params['bill_template_id'],\n \"memo\" => params['memo'],\n \"content\" => params['content'],\n \"recurring\" => params['recurring'],\n \"customer_id\" => params['customer_id'],\n \"date\" => params['date']}\n req_body = p_hash.to_json.to_s\n request = Net::HTTP::Post.new(@uri.request_uri)\n @header.each do |name, value|\n request[name] = value\n end\n # request.each do |name, value|\n # puts name+\" : \"+value\n # end\n request.set_body_internal(req_body)\n response = @http.request(request)\n # response.body = JSON.parse(response.body)\n return response\n end", "title": "" }, { "docid": "8e89532babac6875ab5487c84f4832c8", "score": "0.47857866", "text": "def op_send_request_xml(params)\n return '' unless valid?\n\n # update the ticket with the metadata sent at the first request for XML (i.e. if not blank)\n @ticket.update!(\n hpc_response: (@ticket.hpc_response || params[:hcpresponse]),\n company_file_name: (@ticket.company_file_name || params[:company]),\n country: (@ticket.country || params[:country]),\n qbxml_major_version: (@ticket.qbxml_major_version || params[:major_ver]),\n qbxml_minor_version: (@ticket.qbxml_minor_version || params[:minor_ver])\n )\n\n # only process when in the Authenticated or Processing states\n unless ['Authenticated', 'Processing'].include?(@ticket.state)\n @ticket.request_error!(@last_log_message)\n return ''\n end\n\n # either grab the current request or create a new one\n request = @ticket.qb_request\n unless request\n request = create_request\n @ticket.qb_request = request\n end\n\n # if we don't have a request, then we are done.\n unless request\n log \"There is no more work to be done. Marking ticket state as finished\"\n @ticket.update!(state: 'Finished')\n return ''\n end\n\n request.update!(qb_ticket: @ticket, request_sent_at: Time.zone.now)\n qb_xml = request.to_qb_xml\n request.update!(request_qbxml: qb_xml)\n\n # set the ticket into a Processing state\n @ticket.state = 'Processing'\n\n # save the changes.\n @ticket.save!\n\n log \"Sending request [#{request.state}] XML to QuickBooks\"\n\n qb_xml\n end", "title": "" }, { "docid": "443e50d4557150b1472e1c25c27e8b45", "score": "0.47851807", "text": "def to_xml(opts = {})\n mapper.to_xml(self, opts)\n end", "title": "" }, { "docid": "4c66e47d93a7bd3cf43535bc63e7d10a", "score": "0.47809958", "text": "def create(xml)\n \t check_login\n \t\tresponse = @client.request :create do\n \t soap.header = { \"SessionHeader\" => { \"session\" => \"#{self.session}\" }}\n \t soap.body = xml\n \tend\n \tif response.success?\n \t\t return response.to_hash[:create_response][:result][:id]\n \t \telse \n \t \t return false\n \t \tend\n end", "title": "" }, { "docid": "8ab402ca93f74ba0738a80399e128813", "score": "0.477016", "text": "def to_xml(parent=nil, persp=:default, id=:default)\n ret = Nokogiri::XML::Builder.new({}, parent) do |xml|\n xml.send(xml_element,{:xmlns => ns(persp)}, :path => File.join('',path(id))) do\n serialized_pairs(persp).each do |name, val|\n case val\n when Welo::Embedder\n val.to.to_xml(xml.parent, persp).to_xml\n when Welo::EmbeddersEnumerator\n xml.send(val.label) do\n val.each do |embedder|\n embedder.to.to_xml(xml.parent, persp).to_xml\n end\n end\n else\n xml.send(name, val)\n end\n end\n end\n end\n ret\n end", "title": "" }, { "docid": "1f7721fb52524545d01045870a6709db", "score": "0.47687438", "text": "def user_not_found_response(tnx_id)\n xml = Builder::XmlMarkup.new\n xml.instruct!(:xml, :version => \"1.0\")\n render :xml => xml.response {\n xml.osmp_txn_id(tnx_id)\n xml.result(5)\n xml.comment(\"The subscribers ID is not found (Wrong number)\")\n }\n end", "title": "" }, { "docid": "12fd8dc54481b0dc335f5bb8a6307772", "score": "0.47671762", "text": "def xml(*args)\n attrs = { :version => '1.0' }\n attrs.merge!(args.pop) if args.last.respond_to?(:fetch) \n args.push(lambda{|*x| yield(*x) }) if block_given?\n new(\"<?xml\", attrs, \" ?>\\n\", *args)\n end", "title": "" }, { "docid": "e9458f66b65a3925bc6f2742b4031692", "score": "0.47616938", "text": "def route_xml(route_id, query_params = nil)\n get(\"/routes/#{route_id}/xml\", query_params)\n end", "title": "" }, { "docid": "284c2818d86a72848b59b2c1aca7b09c", "score": "0.47594425", "text": "def to_xml\n a = REXML::Element.new(\"property\")\n a.add_attribute(\"id\", name)\n a.add_element(\"name\").text = name\n if (parameter)\n a.add_element(\"parameter\").text = parameter\n end\n if (description)\n a.add_element(\"description\").text = description\n end\n if (@options)\n p @options\n @options.each {|name, value|\n a.add_element(name.to_s).text = value.to_s\n }\n end\n return a\n end", "title": "" }, { "docid": "e142947dc76df6d57218de71f939e808", "score": "0.4758014", "text": "def build_response!\n Accounts::TransactionsSerializer.new(account_model!, scope: transactions_count)\n end", "title": "" }, { "docid": "a3bdb8d688a7a889c2fd5528cfb97d5b", "score": "0.47517464", "text": "def to_xml\n render_xml\n end", "title": "" }, { "docid": "447b32d4863ebe965489792ed04468f8", "score": "0.47503147", "text": "def make_url(method, params)\n params[:key] = @key\n params[:output] = 'xml'\n\n super method, params\n end", "title": "" }, { "docid": "a7db5e899b4e49caa047af53da80017b", "score": "0.4747122", "text": "def gettransaction(txid)\n request :gettransaction, txid\n end", "title": "" }, { "docid": "af202c872237a55f91fff56bc7b5a936", "score": "0.47420713", "text": "def create\n response = Books::Return.call(params: params)\n\n if response.success?\n render json: response.rent, status: :created\n else\n render json: response.error, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "5042050110963e199e22b119d10485d0", "score": "0.47397247", "text": "def xml \n obj = {}\n expOb = Experiment.where('experimentName' => params[:experimentName]).to_a[0]\n obj['gameName'] = expOb['gameName']\n obj['sequences'] = expOb['sequences']\n obj['experimentName'] = expOb['experimentName']\n render :xml => \"<hash>\"+create_xml(obj, '')+\"</hash>\\n\"\n end", "title": "" } ]
5c2ba87f5cd8059a949d911552fff553
defines events on all elements in collection event, String, name of event minus 'on' ie, col.on("click") do ... end, sets "onclick" to block, b b, block to use for event returns self
[ { "docid": "e07c4008e87cd8cb0ec3c1dbbcfe5043", "score": "0.6956272", "text": "def on event,&b\n each do |e| \n e.on event,&b\n end\n self\n end", "title": "" } ]
[ { "docid": "a43f6bac396653ed199d25e1247be077", "score": "0.64911634", "text": "def on event,&b\n @element.set \"on#{event}\",&b\n end", "title": "" }, { "docid": "4a781fe590cb9c6c2a3a9e77372c5b66", "score": "0.63598204", "text": "def setOnClickEvent(name, &block)\n\t\t@items[name].setOnClickEvent(block)\n\tend", "title": "" }, { "docid": "5b6a37e7012566abd4a99751121d9621", "score": "0.6259319", "text": "def onClick(&block)\n set_event_proc(:onClick, block)\n end", "title": "" }, { "docid": "6c39779e4075d4ffce91bf46c0059b0f", "score": "0.6224563", "text": "def on(event, &block); end", "title": "" }, { "docid": "6c39779e4075d4ffce91bf46c0059b0f", "score": "0.6224563", "text": "def on(event, &block); end", "title": "" }, { "docid": "6d7c763fc9f01e7029877d0d0d4da814", "score": "0.61800736", "text": "def on(event, &block)\n e = event.to_sym\n @events[e] = (@events[e] || []) << block\n end", "title": "" }, { "docid": "4076f35e46173d8852063da49c0e4064", "score": "0.61585665", "text": "def define_event_helpers\n @event_block = {}\n EVENTS.each do |event|\n clazz = class << self; self; end\n clazz.send :define_method, \"on_#{event}\" do |&block|\n @event_block[event] = block\n end\n clazz.send :define_method, \"trigger_#{event}\" do |*args|\n @event_block[event].call *args if @event_block[event]\n end\n end\n end", "title": "" }, { "docid": "1d781c9397c8cd8ef15898deebc67c17", "score": "0.60355127", "text": "def custom_fire_events (element)\n ['onclick', 'onmouseover','onchange','onmousedown','onfocus','onblur'].each do |event|\n element.fire_event event\n end\n end", "title": "" }, { "docid": "606eb56434f11d8d587daef04cb9514c", "score": "0.60315996", "text": "def on_click(&block)\n on('clicked', &block)\n end", "title": "" }, { "docid": "a7b26d7f61968cd10b9bfe970fc6c854", "score": "0.5950001", "text": "def each(&block)\n events.each(&block)\n end", "title": "" }, { "docid": "a7b26d7f61968cd10b9bfe970fc6c854", "score": "0.5950001", "text": "def each(&block)\n events.each(&block)\n end", "title": "" }, { "docid": "8ec2f918715b6e5b8516765eb17bb74a", "score": "0.5938928", "text": "def on(event, &block)\n @handlers[event] = block\n return self\n end", "title": "" }, { "docid": "56095b0c22dad8bfdc2bad15c64c0d81", "score": "0.5920487", "text": "def on(event_name, &block)\n\t\t\t@events[event_name] = block\n\t\tend", "title": "" }, { "docid": "1c8c21bb2baff6493d9b7fa7fb648c35", "score": "0.5906833", "text": "def on *events, &block\n return unless events.is_a? Array\n\n events.each do |e|\n @event_hadlers[e] = [] unless @event_hadlers[e]\n @event_hadlers[e].push block\n end\n end", "title": "" }, { "docid": "f40988c2d61fd80e2e5b575ded2b422c", "score": "0.58901995", "text": "def onClick(&block)\n set_proc(:onClick, block)\n end", "title": "" }, { "docid": "1f7d1fd9e491ab28e84ad9d2ac3a126c", "score": "0.5888484", "text": "def on event, &block\n unless @events.key?(event)\n @events[event] = []\n end\n @events[event] << block\n end", "title": "" }, { "docid": "54f9396d52a68fa2076d21d71b5a7d25", "score": "0.5883472", "text": "def click(&block)\n self.listen_to :event => :click, &block\n end", "title": "" }, { "docid": "1501be9ff7dd972f8d708462061b973c", "score": "0.58756334", "text": "def on(event, &block)\n listeners(event) << block\n self\n end", "title": "" }, { "docid": "8899ac4aa1a6b0b7bb6555493ec659fa", "score": "0.58467454", "text": "def events(&block)\n test_class ||= Class.new(BasicObject)\n starting_methods = test_class.instance_methods\n test_class.class_eval(&block)\n\n new_events = test_class.instance_methods.select do |method|\n !starting_methods.include? method\n end\n\n _event_methods.concat new_events\n class_eval(&block)\n\n self\n end", "title": "" }, { "docid": "81cece47a2302e0c48e54b21442c91af", "score": "0.58394575", "text": "def on_all(&block)\n\t\t@on_all = block\n\t\tself\n\tend", "title": "" }, { "docid": "b4a55e3978627268582eeb24d9f8fba0", "score": "0.5830612", "text": "def each_event(only_wrapped = true)\n if !block_given?\n return enum_for(:each_event, only_wrapped)\n end\n\n\t for _, ev in bound_events\n\t\tyield(ev)\n\t end\n self\n end", "title": "" }, { "docid": "07e1bfd334b60b37390c3960de087d26", "score": "0.5798718", "text": "def on(event, &block)\n @events ||= {}\n @events[event] ||= []\n @events[event] << block\n block\n end", "title": "" }, { "docid": "d0c8a6da0c1a4dba4c6b634e02e42ea0", "score": "0.5774957", "text": "def events(&block)\n machine.events.call(&block)\n end", "title": "" }, { "docid": "93aa6b79bf54ca0cc3b6637b12b3567d", "score": "0.57546407", "text": "def each_event_handler(&block)\n if (handlers)\n handlers.each(&block)\n end\n end", "title": "" }, { "docid": "0625c2f5b4623a699ec7f7b8ad94c6f9", "score": "0.56917256", "text": "def on(event, selector = nil, &block)\n Element[`document`].on(event, selector, &block)\n end", "title": "" }, { "docid": "964bbe71171dd920f5ae7f4f11c217c4", "score": "0.56895703", "text": "def setOnClickEvent(block)\n\t\t@gtkObject.signal_connect(\"button_press_event\",&block)\n\tend", "title": "" }, { "docid": "60ba0e63ef259a9abd5f6a1faf169e50", "score": "0.56841093", "text": "def each_event( &block )\n \n super{|event|\n case event.type\n\n ## key pressed\n when EV_KEY\n if event.code == BTN_0 or event.code == BTN_MOUSE then\n if event.value == 1 and @btn_press_handler then\n\t @btn_pressed = true\n @btn_press_handler.call( event )\n elsif @btn_release_handler\n\t @btn_pressed = false\n @btn_release_handler.call(event )\n end\n end\n\n ## dial rotated\n when EV_REL \n if event.code == REL_DIAL or event.code == REL_X then\n @rotate_handler.call( event ) if @rotate_handler\n end\n\n ## LED status change\n when EV_MSC\n\t## decode status flag\n\t # bits 0- 7: 8 bits: LED brightness\n\t # bits 8-16: 9 bits: pulsing speed modifier \n\t # bits 17-18: 2 bits: pulse table\n\t # bit 19: 1 bit : pulse whilst asleep?\n\t # bit 20: 1 bit : pulse constantly?\n @status.brightness = event.value & 0xff\n @status.speed = (event.value >> 8) & 0x1FF\n @status.mode = (event.value >> 17) & 0x3\n @status.pulse_asleep = (event.value >> 19) & 0x1\n if @status.pulse_asleep == 1 then\n @status.pulse_asleep = true\n\t else \n @status.pulse_asleep = false\n end\n \t @status.pulse_awake = (event.value >> 20) & 0x1\n if @status.pulse_awake == 1 then\n @status.pulse_awake = true\n\t else \n @status.pulse_awake = false\n end\n\n @led_handler.call( @status ) if @led_handler\n\n end # when\n\n ## handle generic event handler\n block.call( event ) if block\n }\n \n end", "title": "" }, { "docid": "0a8a7a376dd7efb18e0e8c3e5780163a", "score": "0.5675208", "text": "def on(*event_names, &block)\n add_callback event_names, proc_for_block(block)\n end", "title": "" }, { "docid": "e5b90c450239db53ddfb72257f66c44c", "score": "0.56650424", "text": "def each_event(&ruby_block)\n # No ruby block? Return an enumerator.\n return to_enum(:each_event) unless ruby_block\n # A ruby block? Apply it on each event.\n @events.each(&ruby_block)\n end", "title": "" }, { "docid": "e5b90c450239db53ddfb72257f66c44c", "score": "0.56650424", "text": "def each_event(&ruby_block)\n # No ruby block? Return an enumerator.\n return to_enum(:each_event) unless ruby_block\n # A ruby block? Apply it on each event.\n @events.each(&ruby_block)\n end", "title": "" }, { "docid": "2746111b5794f73a1ebcf356dd027e56", "score": "0.5642789", "text": "def event(name, options = T.unsafe(nil), &block); end", "title": "" }, { "docid": "4fe00fc3387c1ccd32e395214f6c0ee5", "score": "0.5641178", "text": "def on(event, &block)\n check_arity(block, 1)\n event = event.to_sym\n if event_handlers.has_key?(event)\n event_handlers[event] << block\n else\n task.event(event).on(on_replace: :drop, &method(:__handle_event__))\n (event_handlers[event] = []) << block\n end\n end", "title": "" }, { "docid": "7a900beb7fe9fbed1a2a37602b71b091", "score": "0.5574312", "text": "def on_click(&blk)\n @on_action = blk\n def self.performAction(sender); @on_action.call(sender, self.clickedColumn, self.clickedRow); end\n setAction(\"performAction:\")\n end", "title": "" }, { "docid": "2ba0f8cc7d3a3bf61e92a05f7e928c21", "score": "0.55632883", "text": "def on_event(event, &block)\n on(event, &block)\n end", "title": "" }, { "docid": "f1e0591720d5ba18dc7010c64a290b75", "score": "0.55160105", "text": "def on(name, &block)\n @on[name] ||= []\n @on[name] << block\n end", "title": "" }, { "docid": "f1e0591720d5ba18dc7010c64a290b75", "score": "0.55160105", "text": "def on(name, &block)\n @on[name] ||= []\n @on[name] << block\n end", "title": "" }, { "docid": "f1e0591720d5ba18dc7010c64a290b75", "score": "0.55160105", "text": "def on(name, &block)\n @on[name] ||= []\n @on[name] << block\n end", "title": "" }, { "docid": "7f650ae71d2310e30cd9567e51d88289", "score": "0.5486658", "text": "def each_ui_event_listener(&block)\n ui_event_listeners.each(&block)\n end", "title": "" }, { "docid": "5abf3680dc91b5745d229e96d72557dd", "score": "0.54695857", "text": "def method_missing(sym, &block)\n @event_blocks[sym] = block\n self\n end", "title": "" }, { "docid": "74f5d5d45a6adef4086db6c73753d3e1", "score": "0.5466754", "text": "def on_click &b\n \n end", "title": "" }, { "docid": "74f5d5d45a6adef4086db6c73753d3e1", "score": "0.5466754", "text": "def on_click &b\n \n end", "title": "" }, { "docid": "c61d2afd4b5531549eb04e03712634d3", "score": "0.546368", "text": "def on(name, selector, &block)\n %x{\n #{@native}.on(name, selector, function(event) {\n return #{block.call(Native(`this`), Native(`event`))};\n });\n }\n end", "title": "" }, { "docid": "7df9d3546050b4cec357504db2cea13c", "score": "0.5458532", "text": "def listen_events(events, &block)\n self.class.instance_eval do\n define_method(:listen_event) do |label, message|\n block.call(label, message.root)\n end\n end\n events.each do |event|\n @transp.register(event, method(:listen_event))\n end\n begin\n loop do\n @transp.read_and_dispatch_event\n end\n rescue StopEventListening\n ensure\n events.each do |event|\n @transp.unregister(event, method(:listen_event))\n end\n end\n end", "title": "" }, { "docid": "09a5406446a863bbec92c3b3804d81b7", "score": "0.54568446", "text": "def handle_block(blk)\n register_click blk if respond_to?(:register_click)\n end", "title": "" }, { "docid": "20b9d78f873f8aa986d33aa65f84cdce", "score": "0.5446789", "text": "def on(event_name, &block)\n event_name = event_name.to_sym\n if EVENT_NAMES.include?(event_name)\n @handlers[event_name] << block\n else\n Robe.logger.warn \"#{self.class.name} : #{event_name} is not one of the allowed WebSocket events: #{EVENT_NAMES}\"\n end\n end", "title": "" }, { "docid": "35cd382bbae6bbbf1e6c4f21d91078c8", "score": "0.5393874", "text": "def method_missing(method_name, *_args, &block)\n if method_name.to_s =~ /\\Aon_(.+)/\n @handlers[$1.to_sym] = block\n self\n else\n super\n end\n end", "title": "" }, { "docid": "a729eb2dbc84706aeeb0dcb0c8c89220", "score": "0.53743285", "text": "def make_accessible_all_click_events\n # Interface method\n end", "title": "" }, { "docid": "4db8a12db7f91fcdb4e55c459553b33b", "score": "0.5369658", "text": "def each_event\n\t\tall_events.each { |event| yield event }\n\tend", "title": "" }, { "docid": "8865c4e39a00792f05253863ad147c5b", "score": "0.5333343", "text": "def setEvent(event, &block)\n event = event.to_s.downcase\n eval(\"@#{event}Func=block\")\n @simulation.subscribeToEvent(event, self)\n case event\n when 'ontouching', 'ontouch', 'onuntouching'\n self.touchable = true\n end\n end", "title": "" }, { "docid": "ae00a7281cc945d01cb51606adda2293", "score": "0.5294228", "text": "def event(event_name, &block)\n result = yield block if block_given?\n (result || []).each do |from, to|\n if valid_transition(from, to)\n @transition_table[[event_name, from]] = to\n end\n end\n\n define_method \"can_#{event_name}?\" do\n self.class.can_execute?(event_name).first\n end\n\n define_method \"#{event_name}!\" do\n self.class.execute_event! event_name\n end\n end", "title": "" }, { "docid": "b7ac9b30114eccbeaece938a6bffde09", "score": "0.52852625", "text": "def apply_events(events)\n events.each do |event|\n send(event_handler(event), event.data)\n end\n end", "title": "" }, { "docid": "5a576ef4be37dc983a936776040a5f67", "score": "0.5282953", "text": "def on(*args, &block)\n @block = block\n @ons = args\n self\n end", "title": "" }, { "docid": "d14b0b6a8c67eb0eaa6dd239183acebc", "score": "0.5274431", "text": "def make_accessible_click_events(element)\n # Interface method\n end", "title": "" }, { "docid": "5c617bb83ab9445c5f0e422da9b9e02d", "score": "0.5267437", "text": "def evt_mouse_events(&block)\n evt_left_down(&block)\n evt_left_up(&block)\n evt_middle_down(&block)\n evt_middle_up(&block)\n evt_right_down(&block)\n evt_right_up(&block)\n evt_motion(&block)\n evt_left_dclick(&block)\n evt_middle_dclick(&block)\n evt_right_dclick(&block)\n evt_leave_window(&block)\n evt_enter_window(&block)\n evt_mousewheel(&block)\n end", "title": "" }, { "docid": "c0e8c3d6cef9cd63c6bf4af97eec434a", "score": "0.5248662", "text": "def on(*event_names, &block)\n any_found = false\n event_names.each do |event_name|\n next unless event_name && event_name.strip != ''\n merge_event_prop!(event_name, &block)\n any_found = true\n end\n set_native_attributes(`React.cloneElement(#{self}, #{@properties.shallow_to_n})`) if any_found\n self\n end", "title": "" }, { "docid": "4656f83281834fc4d0ac7797f7d87a84", "score": "0.52244747", "text": "def on(name, &block)\n @handlers[name.to_s] = block\n end", "title": "" }, { "docid": "84cf71c33e438eb9a771c48a5f1e2e35", "score": "0.518217", "text": "def on event_name, &block\n if EVENT_NAMES.include? event_name\n @handlers[event_name] << block\n else\n warn \"[Bowser::WebSocket] #{event_name} is not one of the allowed WebSocket events: #{EVENT_NAMES.to_a}\"\n end\n end", "title": "" }, { "docid": "f5f594706f5eff5c08774b091a45aecd", "score": "0.51776415", "text": "def add_event_handler( event, &block )\n unless self.class.has_event?( event )\n raise( ArgumentError, \"Event #{event} not defined for #{self.class}\" )\n end\n unless block_given?\n raise( ArgumentError, 'No block given.' )\n end\n @events[event] ||= []\n @events[event] << block\n nil\n end", "title": "" }, { "docid": "56638b3a5803055de33eb72f180ef045", "score": "0.51679945", "text": "def on evt, bool = false, &b\n each do |q|\n q.add_event_listener evt.to_s, bool, &b\n end\n \n return nil\n end", "title": "" }, { "docid": "2d57dfd12232a7e0415a08aa54d18ed6", "score": "0.5157729", "text": "def on(event_name, opts = nil, &block)\n @event_handlers[event_name] = block\n end", "title": "" }, { "docid": "fd12ff8b14e545568469a1f9871e32c6", "score": "0.51562804", "text": "def raw_event_handler(event)\n end", "title": "" }, { "docid": "d4f1570d0fbef0c9676e3b7b187b0b6a", "score": "0.51471186", "text": "def on(*args, &block)\n case args.length\n when 2\n @@app.register_event(args[1], args[0], &block)\n when 3\n @@app.register_event(args[2], args[1], args[0], &block)\n else\n raise Prubot::Error 'on supports either \"on <event> <description> do...\" or '\\\n '\"on <action> <event> <description> do...\"'\n end\n end", "title": "" }, { "docid": "6cd3ad415f676b527848f29ee479bf8e", "score": "0.5143486", "text": "def on_event(event_id, &block)\n dsl.OnEvent(event_id.to_s, block)\nend", "title": "" }, { "docid": "69b1b9d2b92ecd63a49e9bdc6b59f64a", "score": "0.5136853", "text": "def event(*a, &b)\n EVENTS.handle(*a, &b)\n end", "title": "" }, { "docid": "2b2bf635c09c484510697fca741e241f", "score": "0.5133054", "text": "def bind_events\n PARSER_EVENTS.each do |e|\n on = \"on_#{e}\".to_sym\n @parser.on(e) { |x| __send__ on, x }\n end\n end", "title": "" }, { "docid": "599709e268ba721ca22eda2e2b65de20", "score": "0.51217014", "text": "def listener_event(&block)\n self.block = block if block_given?\n return self.block\n end", "title": "" }, { "docid": "439ae12128ef94c8202304d0991185b6", "score": "0.5119061", "text": "def on(event_name, &block)\n DiscourseEvent.on(event_name) do |*args|\n block.call(*args) if enabled?\n end\n end", "title": "" }, { "docid": "ee829b5de9dcf137cf0fd6205045bc3e", "score": "0.5117455", "text": "def add_click_handler(&handler) #:yields: {:day,:hour,:data,:gdk_event}\n @click_handlers << handler\n end", "title": "" }, { "docid": "e74364303cb9c2ad5401790f0e3ed47f", "score": "0.51046216", "text": "def on!(name, &block)\n raise ArgumentError, 'no block has been given' unless block\n\n name = Event.name_for(name)\n callback = Callback.new(self, name, &block)\n callbacks.push(callback)\n\n attach!(callback)\n end", "title": "" }, { "docid": "f512791be818e624dd528029fa26e7ee", "score": "0.5102482", "text": "def listen(&block)\n @event_blocks.push(block)\n end", "title": "" }, { "docid": "07c33ba0c822416059ae5d03aec2cb71", "score": "0.5096459", "text": "def on(event_type, &block)\n validate!(event_type)\n handler.define_singleton_method(event_type) do |*args|\n instance_exec(*args, &block)\n end\n end", "title": "" }, { "docid": "3c6879b8a9e7602041cb48d16fcefeb9", "score": "0.509006", "text": "def with(name, *args, &block)\n args << el(\"(funcall #{el4r_rubyproc_to_lambda(&block)})\")\n funcall(name, *args)\n end", "title": "" }, { "docid": "fc140a991f5ae2066700ccdacb8e53c6", "score": "0.508275", "text": "def on(event_name, &block)\n event_bus.on(event_name, &block)\n end", "title": "" }, { "docid": "9be959368d37f5e865d320e62420d99c", "score": "0.508229", "text": "def each_event()\n while e = event\n yield e\n end\n end", "title": "" }, { "docid": "aa45d060f29ecee72a00bb58bcc81c89", "score": "0.50718373", "text": "def on(event, &block)\n branch default_options.with_callback(event, block)\n end", "title": "" }, { "docid": "031b67b5a86f4dbfa443c8b9017f17d5", "score": "0.50623405", "text": "def handle_event(event, clicked = false)\n \n end", "title": "" }, { "docid": "8a0a0a090dd656a09818da2803872475", "score": "0.5056477", "text": "def event *a, &b\n EVENTS.handle(*a, &b)\nend", "title": "" }, { "docid": "a3d96162e72b31de39e23ed4ad963924", "score": "0.50486296", "text": "def on(what, &block)\n case what\n when :failure\n @failure_callbacks << block\n when :success\n @success_callbacks << block\n else\n raise \"Unknown event '#{what}' for #{self.class.name}\"\n end\n return self\n end", "title": "" }, { "docid": "3b1749867f8657ab684c81e0d231c0bf", "score": "0.50435346", "text": "def on_child(elem_name, &block)\n @handlers[elem_name.downcase] = block\n end", "title": "" }, { "docid": "365c5cd88fe131e9704e7c8db4b8a2da", "score": "0.5038125", "text": "def events(&block)\n @nr.chunkedIterator(APIInfo[:events], {metricId:@id}, block)\n return self\n end", "title": "" }, { "docid": "ff584c62908db185f6d5b24b75cfae14", "score": "0.5037486", "text": "def grid_events\n\t\t@grid_events.each do |event, functions|\n\t\t\tif functions.length == 1\n\t\t\t\t@grid_options[event] = functions[0]\n\t\t\telse\n\t\t\t\t# Extract the declaration so we know how to call the converted functions and how we are going to be called.\n\t\t\t\tdeclaration = functions[0].to_s[/(.*?)\\{/, 1]\n\t\t\t\targuments = declaration[/(\\(.*?\\))/, 1]\n\t\t\t\tproxy_function = declaration + \"{\\n\"\n\t\t\t\tfunctions.each_with_index do |f, i|\n\t\t\t\t\t# Convert the anonymous functions into real functions.\n\t\t\t\t\t@grid_methods << f.to_s.sub(/function/, \"function #{event}_#{i}\")\n\n\t\t\t\t\t# Add to the proxy function\n\t\t\t\t\tproxy_function << \"\\t#{event}_#{i}#{arguments}\\n\"\n\t\t\t\tend\n\t\t\t\t@grid_options[event] = Javascript.new(proxy_function += \"}\")\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "2bc9b7daa9ab347d45c522bc617c7f83", "score": "0.50250643", "text": "def handle_event(event_name, event_class, &event_block)\n raise Cliqr::Error::ValidationError, 'only one of event_class or event_block are allowed' \\\n if !event_class.nil? && block_given?\n\n event_handler = event_class\n event_handler = event_block if event_class.nil?\n event = build_event(event_name, event_handler)\n @events[event.name.to_s] = event\n end", "title": "" }, { "docid": "a635d3dd7d7f162ee500cc1dbe2aef14", "score": "0.50226474", "text": "def event(event_name)\n method_name = \"on_#{event_name}\"\n internal_variable_name = \"@event_#{event_name}\"\n\n # define method obj.on_event_name\n define_method method_name do |parameters|\n event_handler = instance_variable_get(internal_variable_name)\n event_handler.fire( self, parameters)\n nil\n end\n private method_name\n\n # define method obj.event_name\n define_method event_name do\n instance_variable_get(internal_variable_name) || Eventorz::Event.new\n end\n\n # define method obj.event_name=\n define_method \"#{event_name}=\" do |event|\n instance_variable_set(internal_variable_name, event)\n end\n\n end", "title": "" }, { "docid": "8e41cf4beae90d08fe5441ecd457648e", "score": "0.5021695", "text": "def event(name, &block)\n name = name.to_s\n event = events[name] ||= Event.new(self, name)\n event.instance_eval(&block)\n \n # Record the states so that the machine can keep a list of all known\n # states that have been defined\n event.transitions.each do |transition|\n @states |= [transition.options[:to]] + Array(transition.options[:from]) + Array(transition.options[:except_from])\n @states.sort!\n end\n \n event\n end", "title": "" }, { "docid": "8a4f2a75df75c4f7ac805dd18ba0a319", "score": "0.50207114", "text": "def define_event_method\n state_machine.events.each do |event_name, event|\n event.attribute_name = state_machine.attribute_name\n define_can_event_method(event_name, event)\n define_event_execution_method(event_name, event)\n define_event_execution_method!(event_name, event)\n end\n end", "title": "" }, { "docid": "1cb4d94f120d656175a37bff09bbfa99", "score": "0.50206107", "text": "def method_missing(method, *args, &block)\n if events.respond_to?(method)\n events.send(method, *args, &block)\n else\n super\n end\n end", "title": "" }, { "docid": "f7d7379d871c26965899c0550a8e2b08", "score": "0.5015827", "text": "def on_anything(&block)\n on('anything', &block)\n end", "title": "" }, { "docid": "13afe7d063e84b6d7ac33b2a9460ef27", "score": "0.5014173", "text": "def seq(*events, &ruby_block)\n # Ensure there is a block.\n ruby_block = proc {} unless block_given?\n # Preprocess the events.\n events.map! do |event|\n event.respond_to?(:to_event) ? event.to_event : event\n end\n # Create and add the resulting behavior.\n self.add_behavior(Behavior.new(:seq,*events,&ruby_block))\n end", "title": "" }, { "docid": "1dc755db4fc254c29495e1331fd3a7cb", "score": "0.5011994", "text": "def call(event)\n @block.call(event)\n end", "title": "" }, { "docid": "4cad5409c378eba14c3e697852c7771b", "score": "0.4996299", "text": "def events(arg)\n end", "title": "" }, { "docid": "90cefd7491d9fe8008f7e4698021e3f7", "score": "0.49959227", "text": "def activate_events_on(element_name, attributes)\n send_on_each_event(:activate_on, element_name, attributes)\n end", "title": "" }, { "docid": "08964ebdd53ebcad2e38c94c48eaaa9c", "score": "0.49815887", "text": "def on(event, &block)\n if block_given?\n subscribe(Subscriptions::Closure.new(event, block))\n end\n self\n end", "title": "" }, { "docid": "7de3747f05c187b712a91f862605ec19", "score": "0.49796942", "text": "def select(&block)\n result=[]\n @elems.each_pair{|event,xpr| result.push(event) if block.call(event,xpr);}\n result\n end", "title": "" }, { "docid": "f8d86643d70c6d18223c3adbf04f86aa", "score": "0.49788955", "text": "def on(event, &blk)\n case event\n when :branch_end\n @events[:branch_end] = blk\n when :no_answer\n @events[:no_answer] = blk\n when :intercept_end \n @events[:intercept_end] = blk\n when :conversation_end\n @events[:conversation_end] = blk\n end # event\n end", "title": "" }, { "docid": "6d3b7e3ccd1efba90a605112f021ad8b", "score": "0.4969808", "text": "def set_event(name, &block)\n if @events[name].nil? != block.nil?\n @events[name] = block\n @session.send %Q{registry[#{@id}].\n eventMask['#{WebApp.escape_string(name)}'] =\n #{(block.nil?)?'false':'true'};}\n end\n end", "title": "" }, { "docid": "4637a5fa8c05d34e5345d9bbec04ee41", "score": "0.49574882", "text": "def peep(event_name, options = {}, &block)\n add \"bind('#{event_name}', #{event_function(options[:prevent_default], &block)})\"\n end", "title": "" }, { "docid": "c5ac6a9eb11c35c0b48e32f7a6e27d94", "score": "0.495687", "text": "def inject_eventables(events, &block)\n if events\n array = events.is_a?(Array)\n events = [events] if !array\n events_by_eventable_type = events.group_by &:eventable_type\n events_by_eventable_type.each do |eventable_type, events|\n events_by_eventable_id = events.group_by &:eventable_id\n ids = events_by_eventable_id.keys.compact\n klass = eventable_type.constantize\n klass = klass.for_events if klass.respond_to? :for_events\n eventables = klass.find(ids)\n eventables.each do |eventable|\n events_by_eventable_id[eventable.id].each { |event| event.set_eventable_target(eventable) }\n end\n end\n array ? events : events.first\n end\n end", "title": "" }, { "docid": "740d7c8e59367ef92fd9685853108edb", "score": "0.49546826", "text": "def onUnclick(&block)\n set_event_proc(:onUnclick, block)\n end", "title": "" }, { "docid": "0f137f5578b2d37006e42b8e16c4170f", "score": "0.49544087", "text": "def apply(events) nil end", "title": "" }, { "docid": "2cba834529ad29ff83316ed2c26daacd", "score": "0.4951516", "text": "def event_handler(&block)\n dsl = Chef::EventDispatch::DSL.new(\"Chef client DSL\")\n dsl.instance_eval(&block)\n end", "title": "" } ]
685f7253a9ebb307691604bf3080355d
Constants and Class Methods Class constructor
[ { "docid": "688fb7e873a6f5863052ddc775a22c0d", "score": "0.0", "text": "def initialize(rtime=Time.now().to_i(), stime=0, etime=0,\n last_known_id=0, queued_vm_ids=[])\n @filename = nil\n @rtime = rtime\n @etime = etime\n @stime = stime\n @last_known_id = last_known_id\n @queued_vm_ids = queued_vm_ids\n @is_valid = false\n if stime > 0 and etime > 0 and last_known_id > 0\n @is_valid = true\n end\n end", "title": "" } ]
[ { "docid": "8e3629bb42b471c640e3e1bd665bf3b2", "score": "0.7476161", "text": "def initialize(*) end", "title": "" }, { "docid": "4b47ff77d50fd89449b4aee569683d2b", "score": "0.7328318", "text": "def initialize()\n raise \"#{self.class.to_s} should not be instantiated directly.\"\n end", "title": "" }, { "docid": "30db4e5d165a6098d1aeb8f8dd7b66e8", "score": "0.71637577", "text": "def initialize() end", "title": "" }, { "docid": "30db4e5d165a6098d1aeb8f8dd7b66e8", "score": "0.71637577", "text": "def initialize() end", "title": "" }, { "docid": "a83980d1953a1624afdb6684da64ec09", "score": "0.70942366", "text": "def initialize(); end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "27b17d3efbfa96fcae1899acb992e406", "score": "0.7091005", "text": "def initialize; end", "title": "" }, { "docid": "c4c797f4e170e07198b939f09207cad2", "score": "0.7026145", "text": "def construct; end", "title": "" }, { "docid": "413eb7a7781383c931819b4af16b7ad0", "score": "0.6948772", "text": "def initialize\n \n end", "title": "" }, { "docid": "413eb7a7781383c931819b4af16b7ad0", "score": "0.6948772", "text": "def initialize\n \n end", "title": "" }, { "docid": "40769f9969d33ad71cb2389a7e574114", "score": "0.6940292", "text": "def institucional\n\t\t\n\tend", "title": "" }, { "docid": "ee0f15437adffefaa29f1b3afc7d611d", "score": "0.69279575", "text": "def initialize(*)\n end", "title": "" }, { "docid": "18250542a2b1999be90588db1d071d92", "score": "0.69241726", "text": "def initialize\n\t\t\n\tend", "title": "" }, { "docid": "bfec75ba54576a40ea45df45e210371a", "score": "0.6914568", "text": "def initialize\n \n end", "title": "" }, { "docid": "6b936507213d0e02c379ff276a28228e", "score": "0.69097203", "text": "def initialize()\n end", "title": "" }, { "docid": "c6116a572da53228c0ff0d98bc9a2bfc", "score": "0.6870076", "text": "def initialize\n end", "title": "" }, { "docid": "c6116a572da53228c0ff0d98bc9a2bfc", "score": "0.6870076", "text": "def initialize\n end", "title": "" }, { "docid": "c6116a572da53228c0ff0d98bc9a2bfc", "score": "0.6870076", "text": "def initialize\n end", "title": "" }, { "docid": "c6116a572da53228c0ff0d98bc9a2bfc", "score": "0.6870076", "text": "def initialize\n end", "title": "" }, { "docid": "c6116a572da53228c0ff0d98bc9a2bfc", "score": "0.6870076", "text": "def initialize\n end", "title": "" }, { "docid": "c6116a572da53228c0ff0d98bc9a2bfc", "score": "0.6870076", "text": "def initialize\n end", "title": "" }, { "docid": "c6116a572da53228c0ff0d98bc9a2bfc", "score": "0.6870076", "text": "def initialize\n end", "title": "" }, { "docid": "c6116a572da53228c0ff0d98bc9a2bfc", "score": "0.6870076", "text": "def initialize\n end", "title": "" }, { "docid": "c6116a572da53228c0ff0d98bc9a2bfc", "score": "0.6870076", "text": "def initialize\n end", "title": "" }, { "docid": "2f3962c646ef1a338f61f68f7de71122", "score": "0.6867098", "text": "def initialize(**)\n end", "title": "" }, { "docid": "2b9dd967ab1edcae68c9d4d5721e3088", "score": "0.68574053", "text": "def initialize; end", "title": "" }, { "docid": "1cbe40a616aff57de850d7af265a5eef", "score": "0.68540865", "text": "def initialize \n\n\n\tend", "title": "" }, { "docid": "750dff3807780d14440a128104770309", "score": "0.68463355", "text": "def initialize\r\n end", "title": "" }, { "docid": "aff1cc8288aa22ae949bd714aab9ad0e", "score": "0.6841662", "text": "def initialize #:nodoc:\n super \"_\"\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "02fcfb474eba429c123242d716e023e7", "score": "0.6840683", "text": "def initialize\n end", "title": "" }, { "docid": "5c17a19a63d1cee82afe68e21d863a56", "score": "0.68384033", "text": "def initialize #constructor - when ruby creates a new object, it executes this 'constructor' instance method to put default values into instance variables \n @@all << self #when a class of this instance is initialized, it will be pushed to the @all class variable \n end", "title": "" }, { "docid": "748bd7b5149abf972e7b72dfbb61e623", "score": "0.6832086", "text": "def initialize\t\n\t\tend", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "7a5eade4fa268386033662e3824d1d7a", "score": "0.68268037", "text": "def initialize()\n end", "title": "" }, { "docid": "4ba68bf13f8658add40720f5b37f7b0f", "score": "0.6826399", "text": "def initialize( * )\n super\n end", "title": "" }, { "docid": "ff948dc747838904eb6c8b59f7d85b12", "score": "0.6824686", "text": "def initialize\n\tend", "title": "" }, { "docid": "df0d23338a0a7c8d76732664fba75f8a", "score": "0.68238544", "text": "def initialize\n\n end", "title": "" }, { "docid": "df0d23338a0a7c8d76732664fba75f8a", "score": "0.68238544", "text": "def initialize\n\n end", "title": "" }, { "docid": "df0d23338a0a7c8d76732664fba75f8a", "score": "0.68238544", "text": "def initialize\n\n end", "title": "" }, { "docid": "8c4bfe693235956f9bf7e5a352a0848d", "score": "0.6818536", "text": "def initialize(*args, **kwargs); end", "title": "" }, { "docid": "0257c309741ca9abd3d16d4e44831b6c", "score": "0.6806156", "text": "def initialize(*args) ; end", "title": "" }, { "docid": "1f9a58d5e4c2e3d1298087658b6842a2", "score": "0.6784395", "text": "def initialize(*)\n super()\n end", "title": "" }, { "docid": "6a468484a093141df451337d04b1372f", "score": "0.6740329", "text": "def initialize(*_)\n raise NotImplementedError\n end", "title": "" }, { "docid": "ad0eeb67b988aadcd20ef1dd6739a767", "score": "0.67276216", "text": "def initialize \n end", "title": "" }, { "docid": "9ec6e03b5441bc1ce8cc25c8578929ab", "score": "0.6719359", "text": "def initialize(*args)\n end", "title": "" }, { "docid": "9ec6e03b5441bc1ce8cc25c8578929ab", "score": "0.6719359", "text": "def initialize(*args)\n end", "title": "" } ]
d6ca855b9c067fc9e3362c55ed861019
versions is already used for extend
[ { "docid": "51fcb26f1fcd44be62bc70fa22c8169c", "score": "0.0", "text": "def remote_versions\n Setting.upyun.images.versions\n end", "title": "" } ]
[ { "docid": "f9cade1d32c99f3e4129272f324bae6a", "score": "0.7597049", "text": "def installed_versions; end", "title": "" }, { "docid": "14bcc51d2301f9d77a21a4eda2f32d75", "score": "0.69541645", "text": "def get_versions(versions)\n versions.map {|v| [v,get_version(v)] }\n end", "title": "" }, { "docid": "7616f2f5edad88cb61e826206051bdcb", "score": "0.6878548", "text": "def version_helper; end", "title": "" }, { "docid": "7616f2f5edad88cb61e826206051bdcb", "score": "0.6878548", "text": "def version_helper; end", "title": "" }, { "docid": "7616f2f5edad88cb61e826206051bdcb", "score": "0.6878548", "text": "def version_helper; end", "title": "" }, { "docid": "7616f2f5edad88cb61e826206051bdcb", "score": "0.6878548", "text": "def version_helper; end", "title": "" }, { "docid": "c7925cf378a8de836df363c0c44bd5d5", "score": "0.68339396", "text": "def extract_versions(infos)\n end", "title": "" }, { "docid": "a90230da370e00964238a76a1893f2b3", "score": "0.67800343", "text": "def get_all_versions\n []\n end", "title": "" }, { "docid": "a7e8e22f10099f055a0279f78aeb2b36", "score": "0.67521614", "text": "def get_versions\n return if not File.directory? @parent_release_directory\n\n Find.find(@parent_release_directory) do |file|\n begin\n next unless file.end_with? '/current' and File.symlink? file and File.realpath(file)\n\n application_name = file.slice((@parent_release_directory.length+1)..-9)\n\n next if application_name == 'sample'\n\n @registry[application_name].add_current_version version: File.basename(File.readlink(file)), ctime: File.stat(file).ctime\n\n if File.symlink?(File.dirname(file) + '/previous') and File.realpath(File.dirname(file) + '/previous')\n version = File.basename(File.readlink(File.dirname(file) + '/previous'))\n ctime = File.stat(File.dirname(file) + '/previous').ctime\n @registry[application_name].add_previous_version version: version, ctime: ctime\n end\n rescue Errno::ENOENT\n end\n end\n end", "title": "" }, { "docid": "f8cdc45658b89e0da6605611f9c22db6", "score": "0.6739812", "text": "def def_version; end", "title": "" }, { "docid": "3ddf7fe9db53f9354a1f4fedea138d54", "score": "0.67375463", "text": "def getVersions\r\n\t\t\t\t\treturn @versions\r\n\t\t\t\tend", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "41de0d9efb42153ab12adf4dad158176", "score": "0.67084825", "text": "def version; end", "title": "" }, { "docid": "8df3f56b5c1798278deaa53f787a0c49", "score": "0.66764134", "text": "def get_all_versions()\n return []\n end", "title": "" }, { "docid": "58bda31b59463bf9faed49fcc2d03731", "score": "0.66595376", "text": "def version(*vs)\n set :versions, vs.map { |v| ::File.join(\"/\", v) }\n end", "title": "" }, { "docid": "3e732504ad16e2a0c93116514c558aaa", "score": "0.6627472", "text": "def assignable_versions_with_wrapping\n\t\t\t\t@assignable_versions = (project.shared_versions.open + project.shared_versions.slocked + [Version.find_by_id(fixed_version_id_was)]).compact.uniq.sort\n\t\t\t end", "title": "" }, { "docid": "23c2276422f8744829d841c9d0b35bb3", "score": "0.66125774", "text": "def versions\n @versions ||= Versions.new(self)\n end", "title": "" }, { "docid": "23c2276422f8744829d841c9d0b35bb3", "score": "0.66125774", "text": "def versions\n @versions ||= Versions.new(self)\n end", "title": "" }, { "docid": "8921e1cc70997c4b21e480b46ada97f2", "score": "0.66108406", "text": "def update_version_method(version)\nend", "title": "" }, { "docid": "a31e49f47455d27270f8efd04780a399", "score": "0.66033125", "text": "def versions(args = {}, &bl)\n local_args = Hash[args]\n recursive = local_args[:recursive]\n dev_deps = local_args[:dev_deps]\n versions = local_args[:versions] || {}\n\n gem_versions = Polisher::VersionChecker.versions_for(name, &bl)\n versions.merge! name => gem_versions\n local_args[:versions] = versions\n\n if recursive\n versions.merge! dependency_versions local_args, &bl\n versions.merge! dependency_versions local_args.merge(:dev => true), &bl if dev_deps\n end\n\n versions\n end", "title": "" }, { "docid": "fd04309f1c3915e5a612a1dee00ba5a9", "score": "0.6596636", "text": "def version_helper=(_arg0); end", "title": "" }, { "docid": "fd04309f1c3915e5a612a1dee00ba5a9", "score": "0.6596636", "text": "def version_helper=(_arg0); end", "title": "" }, { "docid": "fd04309f1c3915e5a612a1dee00ba5a9", "score": "0.6596636", "text": "def version_helper=(_arg0); end", "title": "" }, { "docid": "ad802b093aab4f27ba2fdf002a6f95f4", "score": "0.6594074", "text": "def get_version\n\t\tend", "title": "" }, { "docid": "8c98162bf93c74b4a0e8aa8bc9ff9084", "score": "0.65761405", "text": "def upgrade(version)\n \n end", "title": "" }, { "docid": "6533b0a24c5e0ee92da5650db60a3516", "score": "0.65698415", "text": "def setVersions(versions)\r\n\t\t\t\t\t@versions = versions\r\n\t\t\t\tend", "title": "" }, { "docid": "e679c19566ae215e68aa0066d8c2261e", "score": "0.6552905", "text": "def versions\n @versions ||= VersionsProxy.new self\n end", "title": "" }, { "docid": "257b6b60b76da9463cbaef3d9b94a0cc", "score": "0.652624", "text": "def get_version()\n\t\tend", "title": "" }, { "docid": "4b7252c5681c5a6ff031d103f08fccc9", "score": "0.65140086", "text": "def all_versions\n [document.version, *all_preceding_versions]\n end", "title": "" }, { "docid": "2ef550d0cb90a0b538332623e513b391", "score": "0.6488866", "text": "def versions\n @versions ||= run( :versions, '--bare' ).lines.map( &:chomp )\n end", "title": "" }, { "docid": "3b669bef6c4d9a27a1bd7dada1a2cd1a", "score": "0.64816743", "text": "def version=(_arg0); end", "title": "" }, { "docid": "3b669bef6c4d9a27a1bd7dada1a2cd1a", "score": "0.64816743", "text": "def version=(_arg0); end", "title": "" }, { "docid": "3b669bef6c4d9a27a1bd7dada1a2cd1a", "score": "0.64816743", "text": "def version=(_arg0); end", "title": "" }, { "docid": "3b669bef6c4d9a27a1bd7dada1a2cd1a", "score": "0.64816743", "text": "def version=(_arg0); end", "title": "" }, { "docid": "3b669bef6c4d9a27a1bd7dada1a2cd1a", "score": "0.64816743", "text": "def version=(_arg0); end", "title": "" }, { "docid": "37f927a51eb6818890f0c6174c6fea99", "score": "0.6481503", "text": "def versions(args = {}, &bl)\n local_args = Hash[args]\n recursive = local_args[:recursive]\n dev_deps = local_args[:dev_deps]\n versions = local_args[:versions] || {}\n\n gem_versions = Polisher::VersionChecker.versions_for(name, &bl)\n versions.merge! name => gem_versions\n local_args[:versions] = versions\n\n if recursive\n versions.merge! dependency_versions local_args, &bl\n versions.merge! dependency_versions local_args.merge(:dev => true), &bl if dev_deps\n end\n\n versions\n end", "title": "" }, { "docid": "e3714dd4f8d5ff3e8e53d876549c0b3c", "score": "0.6450937", "text": "def versions\n info[:versions]\n end", "title": "" }, { "docid": "175156d86c9f1460bfdb8ebf9c4c89c2", "score": "0.64403725", "text": "def has_version?; end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.64105976", "text": "def version\n super\n end", "title": "" }, { "docid": "1b26c6cd13e8ea597ffef6d8a6e75d46", "score": "0.6410111", "text": "def version\n super\n end", "title": "" }, { "docid": "33a1203b230190e696442348b9eb2b6c", "score": "0.63932884", "text": "def versions\n\t\tObjectVersion.where(\n\t\t\t:format => 1,\n\t\t\t:model_id => self.id, \n\t\t\t:inki_model_name => self.class.to_s, \n\t\t).order(\"created_at DESC\")\n\tend", "title": "" }, { "docid": "a69fab675e897ec532399477d457b7af", "score": "0.6392727", "text": "def patch_version; end", "title": "" } ]
a77f2d571dda4cf161a122b54fec3997
get the checkout sha related first level files and folders
[ { "docid": "33c67100836bcef803f70aefdff9f995", "score": "0.5631346", "text": "def first_level_fs(pr, filter = lambda { |x| true })\n sha = pr[:base_commit]\n begin\n fs = ls_tree(git.lookup(sha).tree)\n rescue StandardError => e\n log \"Cannot find commit #{sha} in base repo, head_commit: #{pr[:head_commit]}, ownername: #{ARGV[0]}, reponame: #{ARGV[1]}\" # some are in the other branches\n return nil # not to the default branch\n end\n\n if fs.size <= 0\n log \"No files for commit #{sha}\"\n end\n fs.select { |x| filter.call(x) }\n end", "title": "" } ]
[ { "docid": "f795a6f73f714fe94fda7078179b87ee", "score": "0.7076404", "text": "def get_tree_sha(dir, tree = get_trees)\n tree['tree'].find { |t| t['path'] == dir }['sha']\n end", "title": "" }, { "docid": "2c02804ce8694a64a81eacc8d2a5bec3", "score": "0.70202565", "text": "def get_tree_sha(dir)\n get_trees['tree'].find { |t| t['path'] == dir }['sha']\n end", "title": "" }, { "docid": "a0051a7f0c324db22b9c09f7983daca3", "score": "0.68646204", "text": "def get_tree_sha(dir)\n trees = open(\"https://api.github.com/repos/twitter/bootstrap/git/trees/#{@branch}\").read\n trees = JSON.parse trees\n trees['tree'].find{|t| t['path'] == dir}['sha']\n end", "title": "" }, { "docid": "0ff32f57b5361fc7804b9f0fce57b2e8", "score": "0.67884517", "text": "def get_tree_sha\n sha = nil\n trees = get_json(\"#{@git_data_trees}/#{@branch}\")\n trees['tree'].find{|t| t['path'] == 'dist'}['sha']\n end", "title": "" }, { "docid": "7771f8172d5e6972c7c97e1620722f94", "score": "0.6767807", "text": "def sha1\n repo.git.exec(\"rev-parse\",\"--verify\",@path).chomp\n end", "title": "" }, { "docid": "462f82640037949d463aecf7cfa7a79e", "score": "0.6628488", "text": "def checkout_hash\n repository_hash\n end", "title": "" }, { "docid": "d957c03f6fccf5f22e6489184c29983f", "score": "0.6462673", "text": "def sha1\n currwd = Dir.pwd\n Dir.chdir(@isis_release)\n res = Git.git(\"log -n1\").split\n Dir.chdir(currwd)\n return res[1]\n end", "title": "" }, { "docid": "93a89ea91aa8e3fed486d6b6dd6fa90d", "score": "0.63820595", "text": "def short_hash\n Dir.chdir @root do\n hash = sh 'git rev-parse --short HEAD'\n hash.strip\n end\n end", "title": "" }, { "docid": "f7f233130ee43d1888d222039ca19b85", "score": "0.6363173", "text": "def git_sha; end", "title": "" }, { "docid": "f7f233130ee43d1888d222039ca19b85", "score": "0.6363173", "text": "def git_sha; end", "title": "" }, { "docid": "4ef53e9acb42733bc0de6bd7da033c7c", "score": "0.63223714", "text": "def sha_hierarchy\n sha_string = model.sha.to_s\n dirs = [sha_string[0..1], sha_string[2..3], sha_string[4..5]]\n dirs.join('/')\n end", "title": "" }, { "docid": "f072ce49d656cca5151146bd4f07e6f3", "score": "0.631755", "text": "def head_sha\n open\n @git.object('HEAD').sha\n end", "title": "" }, { "docid": "f072ce49d656cca5151146bd4f07e6f3", "score": "0.631755", "text": "def head_sha\n open\n @git.object('HEAD').sha\n end", "title": "" }, { "docid": "4639f479fb84319f19030a096a013e83", "score": "0.63108337", "text": "def committed_files sha\n array_output_of \"git diff-tree --no-commit-id --name-only -r #{sha}\"\nend", "title": "" }, { "docid": "9929598ec6bf8d166ea362cab6e258bd", "score": "0.6288446", "text": "def sha_repo; end", "title": "" }, { "docid": "99ad46168d559c8b508da6725cc33174", "score": "0.62617815", "text": "def checkout_hash\n digest(\"#{PROTOCOL_VERSION}\\000#{repo_type}\\000#{url}\\000#{tag}\")\n end", "title": "" }, { "docid": "50a00828b2b75f27ec51aaaf8d55e3d4", "score": "0.6236114", "text": "def scan_folder(dir, repo)\n @latest_sha = repo.sha_latest_commit\n Dir.foreach(dir) do |item|\n next if item == '.' || item == '..'\n full_path = File.expand_path(item, dir)\n puts \"DIR! #{full_path}\" if File.directory?(full_path)\n scan_folder(full_path, repo) if File.directory?(full_path)\n next if File.directory?(full_path)\n repo.sha_latest_commit = @api.ref(repo.full_repo_path, @ref).object.sha ###### here\n repo.sha_base_tree = @api.commit(repo.full_repo_path, repo.sha_latest_commit).commit.tree.sha\n\n sha_new_commit = create_commit(item, dir, repo)\n @latest_sha = sha_new_commit\n end\n @latest_sha\n end", "title": "" }, { "docid": "7f2ad290a70c1ecd02fa2c1d093087e8", "score": "0.6146027", "text": "def sha\n git_repo.sha\n end", "title": "" }, { "docid": "4fe1cab7d6e075946a209ee1e096a444", "score": "0.61087805", "text": "def git_sha\n Pkg::Util.in_project_root do\n %x{#{GIT} rev-parse HEAD}.strip\n end\n end", "title": "" }, { "docid": "8b396a5c1905acfbd5ecd500f6a0d60e", "score": "0.6106111", "text": "def get_path_by_hash(user, repository, base, hash)\n #git_cmd(), \"ls-tree\", '-r', '-t', '-z', $base\n reg = Regexp.new(\"(?:[0-9]+) (?:.+) #{hash}\\\\t(.+)$\")\n execute(self, user, repository, ['ls-tree', '-r', '-t', base]).each_line do |line|\n return $1 if line.scan(reg) and $1\n end\n return false\n # while it\n end", "title": "" }, { "docid": "ba1e3fe21204376e9c93d49911859b17", "score": "0.6052456", "text": "def get_sha1(ref)\n `git rev-parse #{ref}`.chomp\n end", "title": "" }, { "docid": "ba1e3fe21204376e9c93d49911859b17", "score": "0.6052456", "text": "def get_sha1(ref)\n `git rev-parse #{ref}`.chomp\n end", "title": "" }, { "docid": "75679a0e91fa71c7f038e41d1525e59b", "score": "0.6042763", "text": "def get_base_tree_for_branch(head_sha)\n client = create_octokit_client\n client.commit(full_repo_name, head_sha)[:commit][:tree][:sha]\n end", "title": "" }, { "docid": "d8472021e5ca4dd9e07c22efa533c3cd", "score": "0.60140955", "text": "def checkout_dir\r\n @checkout_dir\r\n end", "title": "" }, { "docid": "b6b7bb4f8abc22dc2799f14402dc35ba", "score": "0.59833926", "text": "def current_git_sha(directory = '.')\n Dir.chdir directory do\n `git rev-parse HEAD`.strip\n end\n end", "title": "" }, { "docid": "56c74787b650eca3a4ffb9f81e896018", "score": "0.596963", "text": "def base_sha\n default_branch = client.repo(repo)[:default_branch]\n branches.find { |branch| branch[:name] == default_branch }[:commit][:sha]\n end", "title": "" }, { "docid": "8f651e500381f02f668dc788952039b3", "score": "0.5951122", "text": "def local_sha\n `git log --pretty=format:%H #{working_branch} -1`.chomp\n end", "title": "" }, { "docid": "d6ad85a9f95438069995f1e935885024", "score": "0.5933073", "text": "def current_sha\n `git rev-parse --short HEAD 2>/dev/null`\nend", "title": "" }, { "docid": "fe143589e13a5f85b7beed2bc82cf567", "score": "0.59003985", "text": "def sha\n event['head_commit']['id'] if event['head_commit']\n end", "title": "" }, { "docid": "2872b8069999c44f12f4e886732a7e31", "score": "0.5896133", "text": "def project_file_names(commit_sha)\n repo = project.repository_id\n github_client.tree(repo, commit_sha, recursive: true)[:tree].map(&:path)\n end", "title": "" }, { "docid": "da07d8a1824bb9d2f0684a00acb0fe1d", "score": "0.58841807", "text": "def sha_of_branch branch_name\n output_of \"git rev-parse #{branch_name}\"\nend", "title": "" }, { "docid": "df035cc429aafbf077b8dbbc218c2d54", "score": "0.5870314", "text": "def sha_from_file\n current_revision[3].gsub(/[)]/, '')\n end", "title": "" }, { "docid": "4f5cf8881294cb7ee0bd8eefbcbf5e37", "score": "0.586653", "text": "def checkout_dir\n @checkout_dir\n end", "title": "" }, { "docid": "f7279932a5802f620e58291f3c70d2b3", "score": "0.58658737", "text": "def resource_hash\n Digest::SHA1.hexdigest(\"#{PROTOCOL_VERSION}\\000#{@repository.checkout_hash}\\000#{@pos}\")\n end", "title": "" }, { "docid": "a77d401d7b41664bdd145aac30656c18", "score": "0.5864105", "text": "def sha\n event['head_commit']['id']\n end", "title": "" }, { "docid": "1840c42cb10d3aaf93b73b270bb2a120", "score": "0.5859393", "text": "def path_sha(path)\n @path_sha_pipe ||=\n git(*%w[hash-object -w --no-filters --stdin-paths]).popen('r+')\n @path_sha_pipe.puts(path)\n @path_sha_pipe.gets.chomp\n end", "title": "" }, { "docid": "a29463bf1bc450f602c769bda31b6028", "score": "0.5850379", "text": "def build_file_tree\n @files = {}\n Find.find(CODE_PATH) do |path|\n if File.basename(path)[0] == ?. || File.basename(path)[0] == ?#\n Find.prune # Don't look any further into system or .git directory.\n else\n %w{.c .h .rb .lkr .feature}.each do |extension|\n if File.extname(path) == extension\n puts path + ' => ' + Digest::SHA1.file(path).hexdigest\n # puts File.mtime(path)\n\t\t\t\t\tputs\n end\t\n end\t\n next\n end\n end\n #~ exit 2\nend", "title": "" }, { "docid": "746ab6a8217641defacc0db332a42b36", "score": "0.5838668", "text": "def git_sha\n %x{git rev-parse HEAD}.strip\nend", "title": "" }, { "docid": "52afdca84a0be092c2c36905284c8b69", "score": "0.5823408", "text": "def current_sha\n @current_sha ||=\n `cd #{root}; git rev-parse HEAD 2>/dev/null || echo unknown`.\n chomp.freeze\n end", "title": "" }, { "docid": "1d613fc33de1a54bf46093f0455c8099", "score": "0.582161", "text": "def hash\n \"#{size}--#{path}--#{repo.root}--#{revision} 2> /dev/null\".hash\n end", "title": "" }, { "docid": "89d404ade929a6e76da0605cc276726a", "score": "0.5820265", "text": "def generate_git_objects\n generate_head_objects\n Dir.glob(repo_path + \"/**/*/\").each do |t|\n tree_sha = Digest::SHA2.hexdigest(t)\n @trees[tree_sha] ||= OpenStruct.new(path: t.split(\"/\").last, mode: \"040000\", type: \"tree\",\n sha: tree_sha, size: 0, url: t, tree: sub_objects(t))\n end\n end", "title": "" }, { "docid": "029711e952f6bb469359489fe7403bc3", "score": "0.58177024", "text": "def last_commit(path)\n Dir.chdir @root do\n hash = sh \"git log -n 1 --pretty=format:%h -- #{path}\"\n hash.strip\n end\n end", "title": "" }, { "docid": "1189ecf2385ed737a439cb200fba45a6", "score": "0.5810852", "text": "def files_by_sha(commit_sha)\n `git -C #{@config.working_dir} show --pretty=\"format:\" --name-only #{commit_sha}`\n end", "title": "" }, { "docid": "4867381a7700a33546e18d4f612c8931", "score": "0.57977885", "text": "def repo_dir_for(repo_sha)\n @registered_checkouts[repo_sha]\n end", "title": "" }, { "docid": "4d92c3b79b310c2e5ccc0d361f561469", "score": "0.57849884", "text": "def get_files_in_commit(sha)\n cmd = \"git -C #{@repo} diff-tree --no-commit-id --name-only -r #{sha}\"\n files = \"\"\n begin\n files = `#{cmd}`\n rescue => e\n warn \"ERROR running #{cmd}: Message: #{e.message}\"\n return []\n end\n return files.split(\"\\n\").to_a\n end", "title": "" }, { "docid": "00fbf80dbcf0b06d158504eb514c2055", "score": "0.57831466", "text": "def sha\n @sha = self.class.sha(path) unless @sha\n @sha\n end", "title": "" }, { "docid": "0adb4f01edc84375a1afc11774d382ec", "score": "0.5771059", "text": "def git_sha\n `git rev-parse HEAD`.strip\n end", "title": "" }, { "docid": "791afc040be8f73f47e98a809eac73cf", "score": "0.5764412", "text": "def head_sha\n @g.object('HEAD').sha\n end", "title": "" }, { "docid": "3cf7c024a3209769b97be798f64aaf4e", "score": "0.57557184", "text": "def get_branch_sha\n @branch_sha ||= %x[git ls-remote '#@repo_url' | awk '/#@branch/ {print $1}'].chomp\n end", "title": "" }, { "docid": "ac2a3d6379c46fd07f526aa24ccd0e36", "score": "0.57545704", "text": "def root_revision\n case repository_type\n when 'git'\n `git rev-list --max-parents=0 HEAD`.chomp\n when 'git-svn', 'svn'\n 0\n end\nend", "title": "" }, { "docid": "df6d40339cb0ccd484885677f9a8f7b3", "score": "0.5727689", "text": "def sha\n @gcommit.sha\n end", "title": "" }, { "docid": "778c573b38ce805ebbf8fe65b1953967", "score": "0.5723308", "text": "def getFullHash(hash)\n\t\tDir.foreach(getObjectsDirectory) do |dir|\n\t\t\tdirpath = getObjectsDirectory + '/' + dir\n\t\t\tunless File.directory?(dirpath)\n\t\t\t\tif dir[0, hash.length] == hash\n\t\t\t\t\treturn dir\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\t\treturn nil\n\tend", "title": "" }, { "docid": "94d26f19e5c981a607f71255fd6df845", "score": "0.57224125", "text": "def sha(length = 40)\n Pkg::Util.in_project_root do\n stdout, = Pkg::Util::Execution.capture3(\"#{Pkg::Util::Tool::GIT} rev-parse --short=#{length} HEAD\")\n stdout.strip\n end\n end", "title": "" }, { "docid": "a26f7264061c27ecc559abf94020bcda", "score": "0.5719375", "text": "def get_head(branch_name=nil)\n\t\t$head = File.open(head_dir, 'r'){|f| f.read}\n\t\t$snapshot_tree = Marshal.load(File.binread($store_dir))\n\t\tif branch_name.nil?\n\t\t\treturn $head\n\t\telse\n\t\t\thead = $snapshot_tree.snapshots.find{|x| x.branch_name == branch_name || x.branch_HEAD == true}\n\t\t\treturn head.snapshot_ID\n\t\tend\n\tend", "title": "" }, { "docid": "24898cbf29a84655586beab283c21cb6", "score": "0.57111704", "text": "def git_hash_object(path)\n require 'mixlib/shellout'\n begin\n Mixlib::ShellOut.new(\"git hash-object #{path}\").run_command.stdout.chomp\n rescue\n ''\n end\nend", "title": "" }, { "docid": "d97457e67c17a41a2e8758f904c9164c", "score": "0.5699178", "text": "def files_in branch:\n array_output_of(\"git ls-tree -r --name-only #{branch}\")\nend", "title": "" }, { "docid": "b0bf1c54ced6d4e730dd10f94f66d75e", "score": "0.5688619", "text": "def git_tree_version\n #if File.directory?(\".git\")\n # @tree_version ||= `git describe`.strip.sub('-', '.')\n # @tree_version << \".0\" unless @tree_version.count('.') == 2\n #else\n $: << \"lib\"\n require 'ruby_openid_test_server'\n @tree_version = RubyOpenIdTestServer.release\n #end\n @tree_version\nend", "title": "" }, { "docid": "f5df6be11dfb4b4154fdf86bdcf955f9", "score": "0.56852496", "text": "def get_hash\n File.file?(\".rake-sha\") ? File.open(\".rake-sha\", \"r\") { |f| f.read } : \"\"\nend", "title": "" }, { "docid": "3a10e47aac196718c66753f1ef1d0589", "score": "0.56558084", "text": "def get_master_head_sha\n client = create_octokit_client\n client.ref(full_repo_name, 'heads/master')[:object][:sha]\n end", "title": "" }, { "docid": "9074c354420cbb54164efa0e291c2067", "score": "0.56532747", "text": "def checkout(commit_digest, path = File.expand_path(\".\"))\n commit = load(commit_digest)\n checkout_tree(commit[:tree], path)\n @db[Dir.pwd] = save(commit: commit_digest, time: Time.now, previous: @db[Dir.pwd])\nend", "title": "" }, { "docid": "5f7c262e498ab6af25e43cb1c1f00fa6", "score": "0.5650956", "text": "def head_path\n \"#{path}/.git/refs/heads/#{branch}\"\n end", "title": "" }, { "docid": "4502263a00ca63451605e77d09a7c3e1", "score": "0.56322205", "text": "def head_path\n \"#{path}/refs/heads/#{branch}\"\n end", "title": "" }, { "docid": "1afefb9afdc1d782050f19fc0ff1d7ef", "score": "0.56284815", "text": "def signature\n @repo.head\n end", "title": "" }, { "docid": "e02f1a78b43c9dbb1f69d84449a43880", "score": "0.5624649", "text": "def sha_repo=(_arg0); end", "title": "" }, { "docid": "895e9b4573b5c6be2d2b4d1d0d78e095", "score": "0.5617702", "text": "def git_sha=(_arg0); end", "title": "" }, { "docid": "42d82d4baaa9723138dc41388c3012b2", "score": "0.5595712", "text": "def get_branch_sha\n return @branch if @branch =~ /\\A[0-9a-f]+\\z/\n cmd = \"git ls-remote 'https://github.com/#@repo' | awk '/#@branch/ {print $1}'\"\n log cmd\n @branch_sha ||= %x[#{cmd}].chomp\n raise 'Could not get branch sha!' unless $?.success?\n @branch_sha\n end", "title": "" }, { "docid": "b4a5e168aa33076957c659c08e95f655", "score": "0.55953926", "text": "def get_commit args = {}\n #attempt to find commit for given path in the 5 most recent commits\n commit = self.log(args[:for], :limit => 10).select{|c| c.to_s == args[:sha_id]}.first\n #if above didn't find it, attempt to find in all commits for given path\n commit ||= self.log(args[:for]).select{|c| c.to_s == args[:sha_id]}.first\n\n commit\n end", "title": "" }, { "docid": "32fdcc9d1ddc744d3eb488a6d3cc9f07", "score": "0.5591596", "text": "def top_dir_inside_zip\n @zip_folder ||= `unzip -Z1 #{zip_archive} | awk 'BEGIN{FS=\"/\"}{print $1}' | uniq | tail -1`.chomp\n end", "title": "" }, { "docid": "881f39a8dd01a5546ab9507a98af33f4", "score": "0.55912495", "text": "def latest_commit_sha_local(filename = '')\n s, _ = Open3.capture2(\n [\n \"git\",\n \"--git-dir=#{ @repo_path }\",\n \"log\",\n \"-1\",\n \"--pretty=format:'%H'\",\n \"--\",\n filename.sub(/#{ @repo.workdir }\\//, ''),\n ].join(' ')\n )\n s\n end", "title": "" }, { "docid": "9ab996386df75abc9f77269e58dc9e56", "score": "0.55835056", "text": "def git_tree\n repo = Grit::Repo.new(\"#{Rails.root}/repositories/#{self.path}\")\n last_commit = repo.commits.first\n if last_commit\n return last_commit.tree\n else\n return nil\n end\n end", "title": "" }, { "docid": "3062c070c32955a17a5fba23db14b317", "score": "0.55776143", "text": "def check_upstream_sha\n git(%W(ls-remote #{::PGQuilter::Config::UPSTREAM_REPO_URL} master)).split(\"\\t\").first\n end", "title": "" }, { "docid": "b1a86620e350fd5cf7844502dda3fefa", "score": "0.5573902", "text": "def git_tree_version\n #if File.directory?(\".git\")\n if false\n @tree_version ||= `git describe`.strip.sub('-', '.')\n @tree_version << \".0\" unless @tree_version.count('.') == 2\n else\n #$: << \"lib\"\n #require 'mac_bacon'\n #@tree_version = Bacon::VERSION\n @tree_version = \"1.3\"\n end\n @tree_version\nend", "title": "" }, { "docid": "af307b3d19ae249c373fd4d8ac957400", "score": "0.5572657", "text": "def tree_entry(commit, path)\n pathname = Pathname.new(path)\n tmp_entry = nil\n\n pathname.each_filename do |dir|\n tmp_entry = tmp_entry ? @repo.lookup(tmp_entry[:oid])[dir] : commit.tree[dir]\n return nil unless tmp_entry\n end\n tmp_entry\n end", "title": "" }, { "docid": "71051675b5179eb770cdfe65f3c8b864", "score": "0.5561297", "text": "def project_file_names(commit_sha, path='/', level=PROJECT_FILES_DIRECTORY_DEPTH)\n sources = bitbucket_client.repos.sources.list(repository_owner, repository_slug, commit_sha, path)\n paths = sources['files'].map { |file| file['path'] }\n if level > -1\n sources['directories'].each do |directory|\n paths += project_file_names(commit_sha, \"#{sources['path']}/#{directory}/\", level - 1)\n end\n end\n\n paths\n end", "title": "" }, { "docid": "70ea74a2ffe2f062c12f10fe89a101c8", "score": "0.5550099", "text": "def hash\n folder.hash ^ name.hash\n end", "title": "" }, { "docid": "998cdb180f12d21fc5e55033df3c52dc", "score": "0.5545741", "text": "def git_checkout_path(checkout_root, stack)\n if (git_info_for_stack[stack.intern].has_key?(:checkout_dir))\n dir = git_info_for_stack[stack.intern][:checkout_dir].to_s\n else\n dir = stack.to_s\n end\n File.join(checkout_root, dir)\n end", "title": "" }, { "docid": "83c813b68d2e2e2c098c0fd50e15c7df", "score": "0.55440575", "text": "def hash\n @folder.hash\n end", "title": "" }, { "docid": "e3af763ad4110e58f8da065d8371f5a3", "score": "0.5544009", "text": "def flat_structure(repo_tree)\n # Used to add ancestry within github main tree\n # We sort them by path\n # maybe use sha for ancestry items ?\n # file = \"/path/to/xyz.mp4\"\n # TO DO => refacto\n # comp = File.basename file # => \"xyz.mp4\"\n # extn = File.extname file # => \".mp4\"\n # name = File.basename file, extn # => \"xyz\"\n # path = File.dirname file # => \"/path/to\n repo_tree.sort_by do |item|\n split_path = item.path.split('/')\n item[:id] = item.sha\n item[:name] = split_path.last\n item[:ancestry] = split_path.select {|v| v != item[:name]}.join('/')\n item[:ancestry] = nil if item[:ancestry].empty?\n item[:parent] = split_path[-2]\n item.type == 'tree' ? item[:extension] = 'folder' : item[:extension] = File.extname(item.path)\n # split_path.length == 1 ? item[:node] = item[:id] : item[:node] = split_path[-2]\n item.path\n end\n end", "title": "" }, { "docid": "82c37621ac692eee94c2a2b23f0bdc11", "score": "0.55386096", "text": "def first_commit\n self.repo.git.rev_list({:reverse => true}, \"master\").split(\"\\n\").first\n end", "title": "" }, { "docid": "32c8d857a11f6aeaf3e4283ff77d112b", "score": "0.5523117", "text": "def tree!(sha)\n tree = @repo.git.native(:ls_tree,\n {:r => true, :l => true, :z => true}, sha)\n items = tree.split(\"\\0\").inject([]) do |memo, line|\n memo << parse_tree_line(line)\n end\n\n if dir = @page_file_dir\n regex = /^#{dir}\\//\n items.select { |i| i.path =~ regex }\n else\n items\n end\n end", "title": "" }, { "docid": "b95804d97890e65e03588cf5ee66a692", "score": "0.55206466", "text": "def get_head_hash(user, repository)\n get_hash_by_name(user, repository, 'HEAD')\n end", "title": "" }, { "docid": "b7a04b51cdb5eb592aec78a8d32ec55a", "score": "0.55161345", "text": "def tree_entries(sha)\n git('ls-tree', sha).stripped_lines.map do |line|\n m = /^(\\d{6}) (blob|tree) ([0-9a-f]{40})\\t(.*)$/.match(line)\n fail \"Unexpected: #{line}\" unless m\n\n {\n :mode => m[1].to_i(8),\n :type => m[2].to_sym,\n :sha => m[3],\n :name => m[4],\n }\n end\n end", "title": "" }, { "docid": "f9bbf0745437adff299b123c5c92341f", "score": "0.55154204", "text": "def path\n @git_change.path\n end", "title": "" }, { "docid": "374bdb8cd9ba0dba569fe70e981bee85", "score": "0.5514926", "text": "def get_commits(treepath, repo)\n commits = repo.log('data', treepath)\n commits = nil if commits.empty?\n commits\nend", "title": "" }, { "docid": "c889456a11b2a31cd7b68e24f712bbca", "score": "0.551404", "text": "def hashed_path( oid )\n\t\toid = oid.to_s\n\n\t\t# Split the first 8 characters of the UUID up into subdirectories, one for\n\t\t# each HASH_DEPTH\n\t\tchunksize = 8 / HASH_DEPTH\n\t\thashed_dir = 0.step( 7, chunksize ).inject( self.root_path ) do |path, i|\n\t\t\tpath + oid[i, chunksize]\n\t\tend\n\n\t\treturn hashed_dir + oid\n\tend", "title": "" }, { "docid": "a27b4b2448d9bb0e6f5c8927dced1b64", "score": "0.55123645", "text": "def gcommit sha_id\n #self.log(sha_id).first\n logs = git \"log #{sha_id}\"\n read_log(logs).first\n end", "title": "" }, { "docid": "6aa04165ab68c912436a3b0133cf9c29", "score": "0.5511317", "text": "def shas_by_file\n result = {}\n files = files_by_tree(@git.gtree('HEAD'))\n files.each do |file|\n result[file] = file_sha(file)\n end\n result\n end", "title": "" }, { "docid": "0211962a683a3e9d5de7b6f45bca2178", "score": "0.5509495", "text": "def signature\n @working_dir.revision\n end", "title": "" }, { "docid": "8706826e062ec0b2d6ade86981e7fd12", "score": "0.55055374", "text": "def get_path(sha1)\r\n sha1[0...2] + '/' + sha1[2..40]\r\n end", "title": "" }, { "docid": "8706826e062ec0b2d6ade86981e7fd12", "score": "0.55055374", "text": "def get_path(sha1)\r\n sha1[0...2] + '/' + sha1[2..40]\r\n end", "title": "" }, { "docid": "997631ceeb25e24df60c2de53a0805bf", "score": "0.5487764", "text": "def head\n repo.head.commit\n end", "title": "" }, { "docid": "9caaa3aa8d929115a99c4e2661384fd0", "score": "0.548716", "text": "def bare_repo_presence() File.join(bare_dir, 'HEAD') end", "title": "" }, { "docid": "4956def79f1c066728c5a211570ab068", "score": "0.5479714", "text": "def tree_entries(sha)\n object = repo.lookup(sha)\n tree = object.type == :tree ? object : object.tree\n tree.map do |entry|\n {\n :type => entry[:type],\n :name => entry[:name],\n :sha => entry[:oid],\n :mode => entry[:filemode],\n }\n end\n end", "title": "" }, { "docid": "c00c56dc933603de1fe354c367542feb", "score": "0.5473358", "text": "def path_sha(path)\n ::Rugged::Blob.from_disk(repo, path)\n end", "title": "" }, { "docid": "843e612e06021365e9972e79eb409615", "score": "0.5470564", "text": "def checkout\n status, out, err = grit.clone({:process_info => true, :quiet => false, :progress => true}, git_url, path)\n [status, out, err]\n end", "title": "" }, { "docid": "9ac54c52b42d12652a38a288065cb506", "score": "0.5464368", "text": "def checkout_repo\n connect_repo unless @context\n # FIXME: another thread..?\n @context.checkout(\"#{SVN_URL}/conf\",WC_PATH) unless File.exists?(WC_PATH + \"/branch.conf\") \n return @last_rev = (@context.update(WC_PATH)).to_s\n end", "title": "" }, { "docid": "402caf6a94a7c118812e2b1ad06d1617", "score": "0.54638964", "text": "def top_level_dir\n %x[git rev-parse --show-toplevel].strip\nend", "title": "" }, { "docid": "dcdce6e22ac284b2401d6a3bbd0f442d", "score": "0.5462155", "text": "def find_tree(oid)\n if branch_exists?(oid)\n last_commit_sha = @repo.ref(\"refs/heads/#{oid}\").target.oid\n lookup(last_commit_sha).tree\n else\n lookup(oid)\n end\n end", "title": "" }, { "docid": "12f148a166dc4ffd0cfbe56b7f424d62", "score": "0.5461291", "text": "def navigate_to(path_list='')\n repo = config['default_repo']\n\n branch = get_branch\n sha = branch.commit.sha\n commit = @client.commit(repo, sha)\n commit.commit.tree.sha\n\n # tree = @client.tree(repo, tree_sha)\n # puts JSON.pretty_generate tree\n end", "title": "" }, { "docid": "957a3c825230eac53d24dd633b20dd51", "score": "0.545963", "text": "def git_head\n Kernel.open(\"| git symbolic-ref HEAD\").readlines[0].chomp.sub(/.*\\//, '')\nend", "title": "" } ]
3b2820dac12199b2c1da080b21436efc
POST /text_questions POST /text_questions.json
[ { "docid": "bc2419d35fdb61ce792ba69365663674", "score": "0.7321778", "text": "def create\n @text_question = TextQuestion.new(text_question_params)\n\n respond_to do |format|\n if @text_question.save\n format.html { redirect_to @text_question, notice: 'Text question was successfully created.' }\n format.json { render :show, status: :created, location: @text_question }\n else\n format.html { render :new }\n format.json { render json: @text_question.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "07580a309f5df6ad5da834964117e58e", "score": "0.7354184", "text": "def create\n @text_question = @base_question.text_questions.new(params[:text_question])\n\n respond_to do |format|\n if @text_question.save\n format.html { redirect_to base_question_path(@base_question), notice: 'Text question was successfully created.' }\n format.json { render json: @text_question, status: :created, location: @text_question }\n else\n format.html { render action: \"new\" }\n format.json { render json: @text_question.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "26d39bcf1bfd799b16acc5efc05609fd", "score": "0.7190868", "text": "def text_question_params\n params.require(:text_question).permit(:title, :body)\n end", "title": "" }, { "docid": "5d39b6042f78aaefe57788c957e8b1b6", "score": "0.7182534", "text": "def question_params\n params.require(:question).permit(:text)\n end", "title": "" }, { "docid": "ca98efeaf01fafd9cfbf914444768330", "score": "0.7115448", "text": "def question_params\n params.require(:question).permit(:question_text)\n end", "title": "" }, { "docid": "843cb3abb845ce1d8bac750696a72733", "score": "0.710327", "text": "def question_params\n params.require(:question).permit(:text)\n end", "title": "" }, { "docid": "843cb3abb845ce1d8bac750696a72733", "score": "0.710327", "text": "def question_params\n params.require(:question).permit(:text)\n end", "title": "" }, { "docid": "fc10e0cbae3c297b1e9491f565eff280", "score": "0.6772231", "text": "def text_answer_params\n params.require(:text_answer).permit(:title, :body)\n end", "title": "" }, { "docid": "5b30b0d106e68007332bf0eb5bfd6599", "score": "0.6727339", "text": "def new\n @text_question = @base_question.text_questions.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @text_question }\n end\n end", "title": "" }, { "docid": "70da4f9086c5ce66bf2e35ee110d0785", "score": "0.66622204", "text": "def create\n @question = Question.create!(params.require(:question).permit(:text))\n\n respond_to do |format|\n format.html { redirect_to(@question, notice: 'Question is created successfully.') }\n format.xml { render xml: @question, status: :created }\n format.json { render json: @question }\n end\n end", "title": "" }, { "docid": "73fbdfea31031916285f993c77e56c3d", "score": "0.66344327", "text": "def answer_params\n params.require(:answer).permit(:text)\n end", "title": "" }, { "docid": "73fbdfea31031916285f993c77e56c3d", "score": "0.66344327", "text": "def answer_params\n params.require(:answer).permit(:text)\n end", "title": "" }, { "docid": "73fbdfea31031916285f993c77e56c3d", "score": "0.66344327", "text": "def answer_params\n params.require(:answer).permit(:text)\n end", "title": "" }, { "docid": "bbfe8efbceb7755dd7a9fa53f451dd54", "score": "0.6613673", "text": "def index\n @text_questions = @base_question.text_questions.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @text_questions }\n end\n end", "title": "" }, { "docid": "914ccc65b2e9c9987a5d9d5d650f8043", "score": "0.6599061", "text": "def answer_text_params\n params.require(:answer_text).permit(:atext)\n end", "title": "" }, { "docid": "8505f3a9b51e706686b3d1dab7c33ee8", "score": "0.6585215", "text": "def create\n @text_answer = TextAnswer.new(text_answer_params)\n\n respond_to do |format|\n if @text_answer.save\n format.html { redirect_to @text_answer, notice: 'Text answer was successfully created.' }\n format.json { render :show, status: :created, location: @text_answer }\n else\n format.html { render :new }\n format.json { render json: @text_answer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4096b1454642a1e97c0a110fb63597d", "score": "0.6567708", "text": "def question_params\n params.require(:question).permit(:text, :answered_at)\n end", "title": "" }, { "docid": "6324976c53f1664bfe7aa7998020a3e9", "score": "0.6556244", "text": "def answer_params\n params.require(:answer).permit(:question_id, :text)\n end", "title": "" }, { "docid": "ff8d8b37b59ae08c9a2328dd4050c7c1", "score": "0.653577", "text": "def question_params\n params.require(:question).permit(:text, :number)\n end", "title": "" }, { "docid": "7f16d949b67a6eea5421953eaaf058e5", "score": "0.6524699", "text": "def create\n @question = Question.new(question_params)\n \n # if question is alternativce\n if @question.style == Question::STYLE_CHOICE\n # register each response\n if not params[:choices].nil?\n params[:choices].each do |choice|\n q_choice = QuestionChoice.new\n q_choice.text = choice\n q_choice.save\n @question.question_choices.push q_choice\n end\n end\n end\n\n\n # validation of subjects as array (avoid crashes)\n if not params[:subjects].nil?\n if params[:subjects].class == Array\n params[:subjects].each do |id|\n subject = Subject.find(id)\n @question.subjects.push(subject)\n end\n end\n end\n\n @question.owner = current_user\n if @question.save\n render :json => {}\n else\n render :json => @subject.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "830f5663e12f0a799b17a15552a2c931", "score": "0.6521893", "text": "def question_params\n params.require(:question).permit(:game_id, :question_text)\n end", "title": "" }, { "docid": "412653e6fdfe27aa5c2418f2e094a63c", "score": "0.6515988", "text": "def create\n @answer_text = AnswerText.new(answer_text_params)\n\n respond_to do |format|\n if @answer_text.save\n format.html { redirect_to @answer_text, notice: 'Answer text was successfully created.' }\n format.json { render :show, status: :created, location: @answer_text }\n else\n format.html { render :new }\n format.json { render json: @answer_text.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c02a86be6a3c89cf46e1da7a204c7d50", "score": "0.6510132", "text": "def create\n @survey_text = SurveyText.new(params[:survey_text])\n\n respond_to do |format|\n if @survey_text.save\n format.html { redirect_to @survey_text, notice: 'Survey text was successfully created.' }\n format.json { render json: @survey_text, status: :created, location: @survey_text }\n else\n format.html { render action: \"new\" }\n format.json { render json: @survey_text.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23f975cc2988a41c067efe3bcd2e36c4", "score": "0.64827746", "text": "def question_params\n params.require(:question).permit(:text, :answer_type, answers_attributes: [:id, :text, :correct, :_destroy])\n end", "title": "" }, { "docid": "1621049db147fdd0efd9fe4aac3136a1", "score": "0.6478113", "text": "def question_params\n params.require(:question).permit(:text, :description, :explaination, :category, :difficulty)\n end", "title": "" }, { "docid": "b4d107d3a032b429b52d4c7470d333b4", "score": "0.6469575", "text": "def index\n @text_questions = TextQuestion.all\n end", "title": "" }, { "docid": "82b4e84eafb174ede627e004e3f7b08b", "score": "0.64398956", "text": "def create\n @question = Question.new(text: question_params['text'])\n set_tags\n @question.user = current_user\n\n respond_to do |format|\n if @question.save\n if Rails.application.config.slack_notifications\n SlackNotifierJob.perform_later(\"A new question has been asked: *#{@question.first_line_for_slug.strip}* #{question_url(@question)}\")\n end\n\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n flash[:alert] = 'There was a problem saving your question.'\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1db16af428bdfd9bdad09f0e77036da3", "score": "0.64312494", "text": "def answer_params\n params[:answer].permit(:text)\n end", "title": "" }, { "docid": "a8148938fbd56ad4cdbaea737c996308", "score": "0.6429737", "text": "def question_params\n params.require(:question).permit(:id, :text, :style, :answer, :source, :hot, :subjects, :choices)\n end", "title": "" }, { "docid": "6fd47f03534e5250ce17a32347413661", "score": "0.64247656", "text": "def question_params\n params.require(:question).permit(:text, :final,\n answers_attributes: [:id, :text, :correct, :_destroy])\n end", "title": "" }, { "docid": "534abdcbb0b441ee0af562a0f5df2aba", "score": "0.6422942", "text": "def answer_params\n params.require(:answer).permit(:text, :question_id)\n end", "title": "" }, { "docid": "88ab5313164bbc64a91626b1e6fbf56d", "score": "0.6414424", "text": "def question_params\n params.require(:question).permit(:text, :first_answer, :second_answer, :third_answer, :fourth_answer, :correct_answer, :user_id)\n end", "title": "" }, { "docid": "ac67ad19d27975f08cfda5fb33c61907", "score": "0.6411235", "text": "def question_params\n params.require(:question).permit(:text, :total_views, :language_id)\n end", "title": "" }, { "docid": "9688af7d2e7cf35b3bacfcdc123f486d", "score": "0.6402736", "text": "def create\n @question = Question.new(params[:question])\n\t@question.user_id = current_user.id \n\t@question.deleted = false\n respond_to do |format|\n if @question.save\n\t\t\tdirty = @question.text\n\t\t\tclean = Sanitize.clean(dirty, Sanitize::Config::RELAXED)\n\t\t\t@question.update_attribute(:text , clean )\n # format.html { redirect_to @question, notice: 'Question was successfully created.' }\n\t\tformat.html { redirect_to questions_url }\n \n\t\tformat.json { render json: @question, status: :created, location: @question }\n else\n format.html { render action: \"new\" }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f46b60654dc2ab43b85f6924a6861004", "score": "0.6387343", "text": "def manage_question(body)\r\n upload_questions(JSON.parse(body)['questions'])\r\n get_questions\r\nend", "title": "" }, { "docid": "4e2ca9d5f8c6961bcf294b1fd43cf05b", "score": "0.6378186", "text": "def create\n @question = Question.new(question_params)\n\n respond_to do |format|\n if @question.save\n send_telegram_post_req(@question)\n\n format.html { redirect_to @question, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n format.js\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n format.js { render :status => 400 }\n end\n end\n end", "title": "" }, { "docid": "5a7235726f8b2d5ee5a317bc59b6526e", "score": "0.6344563", "text": "def question_params\n params.require(:question).permit(:text, :author)\n end", "title": "" }, { "docid": "661235353d872cd7b835c1c463471ca6", "score": "0.63325965", "text": "def question_params\n params.require(:question).permit(:text, :details, :topic_id, :user_id)\n end", "title": "" }, { "docid": "510378262e42d22bc08e4423964f6620", "score": "0.6317349", "text": "def question_params\n params.require(:question).permit(:question_text, :answer_a, :answer_b, :answer_c, :answer_d, :like_count, :dislike_count, :correct_answer, :correct_answers_received, :incorrect_answers_received, :tags)\n end", "title": "" }, { "docid": "20e892342fb35a98de928a3b5a93ecfe", "score": "0.6289231", "text": "def question_params\n params.require(:question).permit(:text, :tag_list)\n end", "title": "" }, { "docid": "685041e69a743001d334fde6cf9ddff6", "score": "0.6281535", "text": "def survey_question_params\n params.require(:survey_question).permit(:survey_question_text, :categories)\n end", "title": "" }, { "docid": "ef55a0525c3b0ca2ea5a44ac8c835ef4", "score": "0.6274899", "text": "def question_params\n params[:question].permit(:body)\n end", "title": "" }, { "docid": "ca34339fb0e9f3daff0203a690eedc57", "score": "0.62527186", "text": "def question_params\n params.require(:question).permit(:title, :text, :rating, :tags)\n end", "title": "" }, { "docid": "6c6e8c3105d4870523d473a8d652c35d", "score": "0.625065", "text": "def question_params\n params.require(:question).permit(:question_text, :correct_answer, :incorrect_answer_1, :incorrect_answer_2, :incorrect_answer_3, :category)\n end", "title": "" }, { "docid": "51fe33621f962c1a30227a061fde5a9d", "score": "0.6250002", "text": "def question_params\n params.require(:question).permit(:content, :answer)\n end", "title": "" }, { "docid": "ecc3bbc6e831e51f399fb8c009ff1937", "score": "0.6246775", "text": "def question_params\n params.require(:question).permit(:text, :description, :position)\n end", "title": "" }, { "docid": "e1809a521803598d5b2268daa709ffe2", "score": "0.6235494", "text": "def question_params\n params.require(:question).permit(:profile_id, :text)\n end", "title": "" }, { "docid": "7f6413fca2eeb60786f5c38e68aaa36a", "score": "0.6205527", "text": "def question_params\n params.permit(:content, :answer)\n end", "title": "" }, { "docid": "1c5e40d760de02e64ef6099ce98ec19d", "score": "0.62048125", "text": "def question_params\n params.require(:question).permit(:title, :body)\n end", "title": "" }, { "docid": "1c5e40d760de02e64ef6099ce98ec19d", "score": "0.62048125", "text": "def question_params\n params.require(:question).permit(:title, :body)\n end", "title": "" }, { "docid": "1c5e40d760de02e64ef6099ce98ec19d", "score": "0.62048125", "text": "def question_params\n params.require(:question).permit(:title, :body)\n end", "title": "" }, { "docid": "4d970b4fba837bbf9d2097596a1dbad3", "score": "0.62015754", "text": "def questions\n request('questions')\n end", "title": "" }, { "docid": "cc9516302c8ad5fa60168e220cd37b8c", "score": "0.619793", "text": "def question_params\n params.require(:question).permit(:text, :students_tutor_id)\n end", "title": "" }, { "docid": "b08eacd1abe0e17506bc5314d5e30b71", "score": "0.61936146", "text": "def question_params\n params.require(:question).permit(:content)\n end", "title": "" }, { "docid": "b08eacd1abe0e17506bc5314d5e30b71", "score": "0.61936146", "text": "def question_params\n params.require(:question).permit(:content)\n end", "title": "" }, { "docid": "b08eacd1abe0e17506bc5314d5e30b71", "score": "0.61936146", "text": "def question_params\n params.require(:question).permit(:content)\n end", "title": "" }, { "docid": "b08eacd1abe0e17506bc5314d5e30b71", "score": "0.61936146", "text": "def question_params\n params.require(:question).permit(:content)\n end", "title": "" }, { "docid": "c00f3bbbacdfd21912a9ea449806c848", "score": "0.6189979", "text": "def question_params\n params.require(:question).permit(:text, :title, :user_id, :forum_id)\n end", "title": "" }, { "docid": "2392b494d53eff88b9dc0a1dcbe081d9", "score": "0.6186223", "text": "def question_params\n params.require(:question).permit(:question_text, :answer_1, :answer_2, :answer_3, :answer_4, :answer_5, :answer_6, :answer_7, :answers, :comments, :answer_1_text, :answer_2_text, :answer_3_text, :answer_4_text, :answer_5_text, :answer_6_text, :answer_7_text, :user_id, :assigned)\n end", "title": "" }, { "docid": "29395b7d91bde1dd2b21f304005c1f3a", "score": "0.6180081", "text": "def question_params\n params.require(:question).permit(:title, :content)\n end", "title": "" }, { "docid": "29395b7d91bde1dd2b21f304005c1f3a", "score": "0.6180081", "text": "def question_params\n params.require(:question).permit(:title, :content)\n end", "title": "" }, { "docid": "29395b7d91bde1dd2b21f304005c1f3a", "score": "0.6180081", "text": "def question_params\n params.require(:question).permit(:title, :content)\n end", "title": "" }, { "docid": "29395b7d91bde1dd2b21f304005c1f3a", "score": "0.6180081", "text": "def question_params\n params.require(:question).permit(:title, :content)\n end", "title": "" }, { "docid": "ff56df749dfcafeb4fd8c7d4f3e84204", "score": "0.6174323", "text": "def question_params\n params.require(:question).permit(:user_id, :content, :is_tweet, :is_anonymous)\n end", "title": "" }, { "docid": "048a37617f8baf796df025625674ed5c", "score": "0.61667144", "text": "def add_questions\n authorize @form\n @question = AssessmentQuestion.create(question: params[:assessment_question][:question], question_type: params[:assessment_question][:question_type], mod_id: @form.id, position: @form.assessment_questions.count + 1)\n options = {}\n params[:options].reject!(&:empty?).each_with_index do |key, index|\n options[key] = params[:answer][0].split(',')[index]\n end\n @question.update(options: options)\n respond_to do |format|\n format.js\n end\n end", "title": "" }, { "docid": "0893509278a9a704d361cb3f76b4db90", "score": "0.6164314", "text": "def question_params\n params.require(:question).permit(:qtext,:qtitle, :course_id, :topic_id, :standalone)\n end", "title": "" }, { "docid": "38af44d2ff2b5145cc1257a5cda79bba", "score": "0.6162143", "text": "def question_params\n params.require(:question).permit(:title, :body, question_tags: [])\n end", "title": "" }, { "docid": "79b2be2e323eb62a73f2f25f1a352cd2", "score": "0.61543536", "text": "def create\n rams = question_params\n rams[:options] = rams[:options].split(',').map(&:strip)\n @question = Question.new(rams)\n\n respond_to do |format|\n if @question.save\n format.html { redirect_to @question.survey, notice: 'Question was successfully created.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aab2b6b1a929c2e02d85e0a394b696f6", "score": "0.6150592", "text": "def question_params\n params.permit(:title, :content)\n end", "title": "" }, { "docid": "7549380b1729d55dd3b524b448830f90", "score": "0.61474025", "text": "def create\n @question = Xmt::Test::Question.generate(question_params)\n respond_to do |format|\n if @question.save\n # params[:answer].values.each do |answer|\n # @question.answers.create(answer)\n # end\n format.html { redirect_to xmt_test_questions_url, notice: '添加成功.' }\n format.json { render :show, status: :created, location: @question }\n else\n format.html { render :new }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3c2f754d9a67876ce45a4a500a1b5700", "score": "0.61364675", "text": "def question_params\n params.require(:question).permit(:questiontext, :Genre_id, :Subgenre_id, :qtype)\n end", "title": "" }, { "docid": "8339c8e19a3f2f236bdbf5a253f05e38", "score": "0.61329293", "text": "def question_params\n params.require(:question).permit(:headline, :content, :user_id, :tag_list, :anon)\n end", "title": "" }, { "docid": "98c1766c41937d948a34bc2a08d2c248", "score": "0.61299855", "text": "def save_questions(questionnaire_id)\n delete_questions questionnaire_id\n save_new_questions questionnaire_id\n if params[:question]\n for question_key in params[:question].keys\n if params[:question][question_key][:txt].strip.empty?\n # question text is empty, delete the question\n Question.delete(question_key)\n else\n # Update existing question.\n question = Question.find(question_key)\n if !question.update_attributes(params[:question][question_key])\n Rails.logger.info(question.errors.messages.inspect)\n end\n end\n end\n end\n end", "title": "" }, { "docid": "7a18cbf6be305185b1208eb8137df2fc", "score": "0.61298496", "text": "def question_params\n params.require(:question).permit(:content, :category_id, :answer)\n end", "title": "" }, { "docid": "665bb376b94cedc462ca8f0d12732b10", "score": "0.612681", "text": "def question_params\n params.require(:question).permit(:stem, :option_a, :option_b, :option_c, :option_d, :option_e, :answer, :image, :exam, topic_ids: [])\n end", "title": "" }, { "docid": "740250f7fdc321da6da178f7b3ba05e1", "score": "0.61263525", "text": "def question_params\n params.require(:question).permit(:body, :quiz_id)\n end", "title": "" }, { "docid": "740250f7fdc321da6da178f7b3ba05e1", "score": "0.61263525", "text": "def question_params\n params.require(:question).permit(:body, :quiz_id)\n end", "title": "" }, { "docid": "1c16b1ef7673ad16e0930ea88edf6328", "score": "0.6114184", "text": "def set_text_question\n @text_question = TextQuestion.find(params[:id])\n end", "title": "" }, { "docid": "4c895200f298b32ef7f5bdf807a48eba", "score": "0.611059", "text": "def question_params\n params.require(:question).permit(:title, :slug, :text, :user_id)\n end", "title": "" }, { "docid": "af37b35c2cf0cbb2f5403b1fcff1a623", "score": "0.610499", "text": "def question_params\n params.require(:question).permit(:subject_id, :text, :file)\n end", "title": "" }, { "docid": "072deb0d781411c771b621809f156121", "score": "0.60895133", "text": "def save_questions(questionnaire_id)\n delete_questions questionnaire_id\n save_new_questions questionnaire_id\n\n if params[:question]\n params[:question].keys.each do |question_key|\n if params[:question][question_key][:txt].strip.empty?\n # question text is empty, delete the question\n Question.delete(question_key)\n else\n # Update existing question.\n question = Question.find(question_key)\n Rails.logger.info(question.errors.messages.inspect) unless question.update_attributes(params[:question][question_key])\n end\n end\n end\n end", "title": "" }, { "docid": "0ab793272d0b0b2f766bb44af49404ca", "score": "0.6079028", "text": "def add_new_questions\n questionnaire_id = params[:id] if params[:id] != nil\n (1..params[:question][:total_num].to_i).each do |i|\n question = Object.const_get(params[:question][:type]).create(txt: 'Edit question content here', questionnaire_id: questionnaire_id, seq: i, type: params[:question][:type], break_before: true)\n if question.is_a? ScoredQuestion\n question.weight = 1\n question.max_label = 'Strong agree'\n question.min_label = 'Strong disagree'\n end\n if question.is_a? Criterion\n question.size = '50,3'\n end\n if question.is_a? Dropdown\n question.alternatives = '0|1|2|3|4|5'\n end\n if question.is_a? TextResponse\n question.size = '60,5'\n end\n begin\n question.save\n rescue\n flash[:error] = $!\n end\n end\n redirect_to edit_questionnaire_path(questionnaire_id.to_sym)\n end", "title": "" }, { "docid": "362b351d783023bc5aec29720485fedb", "score": "0.6075634", "text": "def question_params\n params.require(:question).permit(:assessment_id, :Title, :Text, :Feedback, :Type, :Points, :Answer, :Options)\n end", "title": "" }, { "docid": "8315edd4ee6c17f827740fb8cb81a60c", "score": "0.6073739", "text": "def save_questions(questionnaire_id)\n\n delete_questions questionnaire_id\n save_new_questions questionnaire_id\n\n if params[:question]\n for question_key in params[:question].keys\n\n if params[:question][question_key][:txt].strip.empty?\n # question text is empty, delete the question\n Question.delete(question_key)\n else\n # Update existing question.\n question = Question.find(question_key)\n if !question.update_attributes(params[:question][question_key])\n Rails.logger.info(question.errors.messages.inspect)\n end\n end\n\n end\n end\n end", "title": "" }, { "docid": "6e5442f36bdba14c19fd7e29921c4085", "score": "0.60711485", "text": "def update\n respond_to do |format|\n @question.text = question_params['text']\n set_tags\n if @question.save\n format.html { redirect_to @question, notice: 'Question was successfully updated.' }\n format.json { render :show, status: :ok, location: @question }\n else\n format.html { render :edit }\n format.json { render json: @question.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba4ce40d1ad1052aefa38dbd31dd8139", "score": "0.60645765", "text": "def save_questions\n questionnaire_id = params[:questionnaire_id]\n questionnaire_type = params[:questionnaire_type]\n delete_questions questionnaire_id\n save_new_questions(questionnaire_id, questionnaire_type)\n if params[:question]\n params[:question].keys.each do |question_key|\n if params[:question][question_key][:txt].strip.empty?\n Question.delete(question_key)\n else\n question = Question.find(question_key)\n Rails.logger.info(question.errors.messages.inspect) unless question.update_attributes(params[:question][question_key])\n end\n end\n end\n return\n end", "title": "" }, { "docid": "bd20cdb8ba67660b74a8df27519c2305", "score": "0.6061783", "text": "def question_params\n params.require(:question).permit(:title, :content, :category)\n end", "title": "" }, { "docid": "c9bdc21e60e44fcc964e311d8e2e0314", "score": "0.6059533", "text": "def question_params\n params.require(:question).permit(:text, :op1, :op2, :op3, :op4, :answer, :subgenre_id)\n end", "title": "" }, { "docid": "ffd6b3973757290dcf8a3e364b084c28", "score": "0.60534453", "text": "def questionnaire_params\n params.require(:questionnaire).permit(:completed_at, :patient_id, :body, :json, :hstore)\n end", "title": "" }, { "docid": "347382f2ae393f833f396f2e49ee112a", "score": "0.60524595", "text": "def answer_questions\n @project = Project.find(params[:id])\n @question_responses = []\n params[:question_responses].each do |question_id, response|\n @question_responses << QuestionResponse.create!(:question_id => question_id.to_i, :user => current_user, :response => response.to_i)\n end\n \n respond_to do |format|\n format.html { redirect_to @project, notice: 'Your answers have been saved. Thanks!' }\n format.json { render json: @question_responses, status: :created, location: @project }\n end\n end", "title": "" }, { "docid": "4b9ebc80ff2e67a2fcf17267f61dd039", "score": "0.60489655", "text": "def create\n render json: current_user.questions.create!(question_params_with_tag), status: :ok\n end", "title": "" }, { "docid": "a378df98af2425a3afe9a50f46755028", "score": "0.60452116", "text": "def practice_question_params\n params.require(:practice_question).permit(:title, :question_text, :hint_text)\n end", "title": "" }, { "docid": "4704a3c341fe55356c2fa4b73f06d889", "score": "0.60426825", "text": "def create\n params[:contextualization][:question].each do |k, v|\n answer = Answer.new\n answer.user_id = params[:contextualization][:user_id]\n answer.question_id = k;\n answer.answer = v;\n answer.save\n end\n respond_to do |format|\n format.html { redirect_to answers_path, notice: 'Questionário criado com sucesso.' }\n format.json { render :index, status: :created, location: @answer }\n end\n end", "title": "" }, { "docid": "56850646224a2709f3405ab227e6e9c2", "score": "0.60417944", "text": "def create\n \t@question = Question.new(questions_params)\n\n \trespond_to do |format|\n \t\tif @question.save\n \t\t\tformat.html { redirect_to @question, notice: 'question was successfully created.' }\n \t\t\tformat.json { render json: @question.to_json }\n \t\telse\n \t\t\tformat.html { render action: 'new' }\n \t\t\tformat.json { render json: @question.errors, status: :unprocessable_entity }\n \t\tend\n \tend\n end", "title": "" }, { "docid": "b5df9a54cce9db14dd6df3f12ed7d948", "score": "0.6041524", "text": "def new\n # @question = Question.new\n\n # respond_to do |format|\n # format.html # new.html.erb\n # format.json { render json: @question }\n # end\n\n question = { title: params[:title],\n choice_a: params[:choice_a],\n choice_b: params[:choice_b],\n choice_c: params[:choice_c],\n choice_d: params[:choice_d],\n answer: params[:answer]\n }\n\n if @topic.questions.create(question) && question[:title] != \"\"\n render :text => 'Created', :status => '200'\n else\n render :text => 'Failed', :status => '404'\n end\n end", "title": "" }, { "docid": "c6b2789fcd3012f5e49f04882365fb42", "score": "0.60364395", "text": "def save_new_questions(questionnaire_id)\n if params[:new_question]\n # The new_question array contains all the new questions\n # that should be saved to the database\n params[:new_question].keys.each do |question_key|\n q = Question.new\n q.txt = params[:new_question][question_key]\n q.questionnaire_id = questionnaire_id\n q.type = params[:question_type][question_key][:type]\n q.seq = question_key.to_i\n if @questionnaire.type == \"QuizQuestionnaire\"\n q.weight = 1 # setting the weight to 1 for quiz questionnaire since the model validates this field\n end\n q.save unless q.txt.strip.empty?\n end\n end\n end", "title": "" }, { "docid": "2f84a27b8e1ce9c249ff7040bb84e667", "score": "0.6033081", "text": "def question_params\n params.require(:question).permit(:question_id, :content, :category_id, :answer)\n end", "title": "" }, { "docid": "760e1ce59e7b1253d67bccccfcebb0b0", "score": "0.60295004", "text": "def save_new_questions(questionnaire_id)\n if params[:new_question]\n # The new_question array contains all the new questions\n # that should be saved to the database\n for question_key in params[:new_question].keys\n q = Question.new()\n q.txt=params[:new_question][question_key]\n q.questionnaire_id = questionnaire_id\n q.type = params[:question_type][question_key][:type]\n q.seq = question_key.to_i\n if @questionnaire.type == \"QuizQuestionnaire\"\n q.weight = 1 #setting the weight to 1 for quiz questionnaire since the model validates this field\n end\n unless q.txt.strip.empty?\n q.save\n end\n end\n end\n end", "title": "" }, { "docid": "69cf99c86b0ba28153a4c292f0442526", "score": "0.60291994", "text": "def create\n @ttest_question = TtestQuestion.new(ttest_question_params)\n\n respond_to do |format|\n if @ttest_question.save\n format.html { redirect_to @ttest_question, notice: 'Ttest question was successfully created.' }\n format.json { render action: 'show', status: :created, location: @ttest_question }\n else\n format.html { render action: 'new' }\n format.json { render json: @ttest_question.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0fba78bda470fd7eccd263ee7a926655", "score": "0.60193574", "text": "def question_params\n params.require(:question).permit(:difficulty, :content, :status)\n end", "title": "" }, { "docid": "54bb4228765abf8b38d728733309ea97", "score": "0.6010443", "text": "def send_telegram_post_req(question)\n require 'net/http'\n require 'json'\n\n begin\n uri = URI('https://iptemplebot.herokuapp.com/notify')\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n req = Net::HTTP::Post.new(uri.path, {'Content-Type' =>'application/json'})\n req.body = { \"msg\" => question.text }.to_json\n res = http.request(req)\n # puts \"response #{res.body}\"\n # puts JSON.parse(req.body)\n rescue => e\n puts \"failed #{e}\"\n end\n end", "title": "" } ]
e286b67b1636babbf6738bb7f1c09e50
Create the csar yaml This won't work, as the body just needs the yaml string.
[ { "docid": "ebc7da8ca2e6c9c7fba69418144177b4", "score": "0.69143814", "text": "def create\n megam_rest.post_csar(@yamldata)\n end", "title": "" } ]
[ { "docid": "0329a1f705a7389198ab3d738065774b", "score": "0.6847948", "text": "def body_as_yaml(yaml)\r\n @message_body_with_format = yaml\r\n format :yaml\r\n end", "title": "" }, { "docid": "f3b3ad93c5c8fa9897e733e93b5fce8b", "score": "0.6224684", "text": "def build_yaml_rails3\r\n\r\n\t\tcode = Rex::Text.encode_base64(payload.encoded)\r\n\t\tyaml =\r\n\t\t\t\"--- !ruby/hash:ActionDispatch::Routing::RouteSet::NamedRouteCollection\\n\" +\r\n\t\t\t\"'#{Rex::Text.rand_text_alpha(rand(8)+1)};eval(%[#{code}].unpack(%[m0])[0]);' \" +\r\n\t\t\t\": !ruby/object:OpenStruct\\n table:\\n :defaults: {}\\n\"\r\n\t\tyaml.gsub(':', '\\u003a')\r\n\tend", "title": "" }, { "docid": "1722b413849fabed7452f65e56f1eec2", "score": "0.5906013", "text": "def build_yaml_rails2\r\n\r\n\t\tcode = Rex::Text.encode_base64(payload.encoded)\r\n\t\tyaml =\r\n\t\t\t\"--- !ruby/hash:ActionController::Routing::RouteSet::NamedRouteCollection\\n\" +\r\n\t\t\t\"'#{Rex::Text.rand_text_alpha(rand(8)+1)}; \" +\r\n\t\t\t\"eval(%[#{code}].unpack(%[m0])[0]);' \" +\r\n\t\t\t\": !ruby/object:ActionController::Routing::Route\\n segments: []\\n requirements:\\n \" +\r\n\t\t\t\":#{Rex::Text.rand_text_alpha(rand(8)+1)}:\\n :#{Rex::Text.rand_text_alpha(rand(8)+1)}: \" +\r\n\t\t\t\":#{Rex::Text.rand_text_alpha(rand(8)+1)}\\n\"\r\n\t\tyaml.gsub(':', '\\u003a')\r\n\tend", "title": "" }, { "docid": "d7475b736559295bb34d592935e76668", "score": "0.5875667", "text": "def processed_template\n yaml.to_json\n end", "title": "" }, { "docid": "b7e586199f21a0b859235394c506ea75", "score": "0.57627934", "text": "def write_yaml(object); write object.to_yaml; end", "title": "" }, { "docid": "f8b2110a064d112e5b09a05eb4e507bb", "score": "0.5735525", "text": "def create(body = {})\n @client.pipeline.create(body)\n end", "title": "" }, { "docid": "0bd68b9f724300a1d349f3dbcc040e10", "score": "0.5720564", "text": "def build_pod_yml\n\t\t\tputs \"==> Generating yaml configuration for #{@template[\"name\"]}-pod\"\n\t\t\timage = \"#{@template[\"docker_params\"][\"registry\"]}/#{@template[\"base_image\"]}/#{@template[\"runtime\"]}_#{@template[\"name\"]}\"\n\t\t\tpod_hash = {\n\t\t\t\t\"apiVersion\"=> @template[\"kubernetes\"][\"api\"],\n\t\t\t\t\"kind\" => @template[\"kubernetes\"][\"kind\"][\"pod\"],\n\t\t\t\t\"metadata\" => {\n\t\t\t\t\t\"name\" => @template[\"name\"],\n\t\t\t\t\t\"labels\" => {\n\t\t\t\t\t\t\"role\" => @template[\"name\"]\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"spec\" => {\n\t\t\t\t\t\"containers\" => [{\n\t\t\t\t\t\t\"name\" => @template[\"name\"],\n\t\t\t\t\t\t\"image\" => image,\n\t\t\t\t\t\t\"ports\" => [{\n\t\t\t\t\t\t\t\"name\" => @template[\"name\"],\n\t\t\t\t\t\t\t\"containerPort\" => @template[\"port\"].to_i\n\t\t\t\t\t\t}],\n\t\t\t\t\t\t\"securityContext\" => {\n\t\t\t\t\t\t\t\"privileged\" => true\n\t\t\t\t\t\t}\n\t\t\t\t\t}]\n\t\t\t\t}\n\t\t\t}\n\t\t\tputs \"#{pod_hash.to_yaml}\"\n\t\t\treturn pod_hash.to_yaml\n\t\tend", "title": "" }, { "docid": "4aa5b25fe3ada9c50d246d51b62325b2", "score": "0.5719718", "text": "def create\n create_respond_to(@yml_source)\n end", "title": "" }, { "docid": "75e063d3c24f246f4f67d4b6aed53261", "score": "0.5698418", "text": "def to_yaml(*args)\n payload.to_yaml(*args)\n end", "title": "" }, { "docid": "36cdec0bf3a1f152af8ffa94fd670eba", "score": "0.5692513", "text": "def configure_with_yaml\n cfg = load_config(Rails.root.join('config', 'creatary.yml')).freeze\n Creatary.configure(cfg)\n end", "title": "" }, { "docid": "7a432712a003a7084cba0ad72646121c", "score": "0.56261915", "text": "def create_ansible_aws_yaml(options)\n options['access'] = options['q_struct']['access_key'].value\n options['secret'] = options['q_struct']['secret_key'].value\n options['ami'] = options['q_struct']['source_ami'].value\n options['region'] = options['q_struct']['region'].value\n options['size'] = options['q_struct']['instance_type'].value\n options['adminuser'] = options['q_struct']['ssh_username'].value\n options['key'] = options['q_struct']['key_name'].value\n options['ports'] = options['q_struct']['open_ports'].value\n options['group'] = options['q_struct']['security_group'].value\n options['keyfile'] = File.basename(options['q_struct']['keyfile'].value,\".pem\")+\".key.pub\"\n options['name'] = options['q_struct']['ami_name'].value\n options['cidr'] = options['q_struct']['default_cidr'].value\n tmp_keyfile = \"/tmp/\"+options['keyfile']\n ansible_dir = options['clientdir']+\"/ansible\"\n options['clientdir'] = ansible_dir+\"/aws/\"+options['name']\n hosts_file = options['clientdir']+\"/hosts\"\n prov_file = options['clientdir']+\"/\"+options['name']+\".yaml\"\n hosts_file = options['clientdir']+\"/hosts\"\n if options['verbose'] == true\n handle_output(options,\"Information:\\tChecking Client directory\")\n end\n check_dir_exists(options,options['clientdir'])\n uid = options['uid']\n check_dir_owner(options,options['clientdir'],uid)\n prov_data =[]\n prov_data.push(\"---\\n\")\n prov_data.push(\"- name: Provision EC2 instances\\n\")\n prov_data.push(\" hosts: localhost\\n\")\n prov_data.push(\" connection: local\\n\")\n prov_data.push(\" gather_facts: false\\n\")\n prov_data.push(\"\\n\")\n prov_data.push(\" vars:\\n\")\n prov_data.push(\" ec2_access_key: #{options['access']}\\n\")\n prov_data.push(\" ec2_secret_key: #{options['secret']}\\n\")\n prov_data.push(\" ec2_region: #{options['region']}\\n\")\n prov_data.push(\" ec2_type: #{options['size']}\\n\")\n prov_data.push(\" ec2_name: #{options['name']}\\n\")\n prov_data.push(\" ec2_image: #{options['ami']}\\n\")\n prov_data.push(\"\\n\")\n prov_data.push(\" tasks:\\n\")\n prov_data.push(\"\\n\")\n prov_data.push(\" - name: Handling EC2 group {{ ec2_name }}\\n\")\n prov_data.push(\" ec2_group:\\n\")\n prov_data.push(\" name: \\\"{{ ec2_name }}\\\"\\n\")\n prov_data.push(\" description: \\\"{{ ec2_name }}\\\"\\n\")\n prov_data.push(\" region: \\\"{{ ec2_region }}\\\"\\n\")\n prov_data.push(\" ec2_access_key: \\\"{{ ec2_access_key }}\\\"\\n\")\n prov_data.push(\" ec2_secret_key: \\\"{{ ec2_secret_key }}\\\"\\n\")\n prov_data.push(\" rules:\\n\")\n if options['ports'].to_s.match(/,/)\n options['ports'] = options['ports'].split(\",\")\n else\n options['ports'] = [ options['ports'] ]\n end\n options['ports'].each do |install_port|\n prov_data.push(\" - proto: tcp\\n\")\n prov_data.push(\" from_port: #{install_port}\\n\")\n prov_data.push(\" to_port: #{install_port}\\n\")\n prov_data.push(\" cidr_ip: #{options['cidr']}\\n\")\n end\n prov_data.push(\"\\n\")\n prov_data.push(\" - name: Create instance for {{ ec2_name }}\\n\")\n prov_data.push(\" ec2:\\n\")\n prov_data.push(\" region: \\\"{{ ec2_region }}\\\"\\n\")\n prov_data.push(\" ec2_access_key: \\\"{{ ec2_access_key }}\\\"\\n\")\n prov_data.push(\" ec2_secret_key: \\\"{{ ec2_secret_key }}\\\"\\n\")\n prov_data.push(\" keypair: \\\"{{ ec2_name }}\\\"\\n\")\n prov_data.push(\" group: \\\"{{ ec2_name }}\\\"\\n\")\n prov_data.push(\" instance_type: \\\"{{ ec2_type }}\\\"\\n\")\n prov_data.push(\" image: \\\"{{ ec2_image }}\\\"\\n\")\n prov_data.push(\" exact_count: 1\\n\")\n prov_data.push(\" count_tag:\\n\")\n prov_data.push(\" Name: \\\"{{ ec2_name }}\\\"\\n\")\n prov_data.push(\" instance_tags:\\n\")\n prov_data.push(\" Name: \\\"{{ ec2_name }}\\\"\\n\")\n prov_data.push(\" wait: true\\n\")\n prov_data.push(\" register: ec2\\n\")\n prov_data.push(\"\\n\")\n prov_data.push(\" - name: Gathering instance information for {{ ec2_name }}\\n\")\n prov_data.push(\" local_action: copy content={{ ec2 }} dest=/tmp/{{ ec2_name }}.output\\n\")\n hosts_data = []\n hosts_data.push(\"---\\n\")\n hosts_data.push(\"[local]\\n\")\n hosts_data.push(\"localhost\\n\")\n write_array_to_file(options,prov_data,prov_file,\"w\")\n write_array_to_file(options,hosts_data,hosts_file,\"w\")\n [ prov_file, hosts_file ].each do |file_name|\n check_file_owner(options,file_name, uid)\n end\n set_file_perms(prov_file, \"600\")\n\treturn\nend", "title": "" }, { "docid": "95fe5ff47abd29e38ab9938f1d05cb37", "score": "0.5600511", "text": "def to_yaml_style\n end", "title": "" }, { "docid": "95fe5ff47abd29e38ab9938f1d05cb37", "score": "0.5600511", "text": "def to_yaml_style\n end", "title": "" }, { "docid": "95fe5ff47abd29e38ab9938f1d05cb37", "score": "0.5600511", "text": "def to_yaml_style\n end", "title": "" }, { "docid": "f9ed4430a2209466c20ef9073d2bf280", "score": "0.5574844", "text": "def api_yaml_post(uri, data)\n yaml = YAML.dump(data)\n api_raw_post(uri, yaml, 'application/x-yaml')\n end", "title": "" }, { "docid": "74a5cc48f59c262a167f4ee62c3fd0a7", "score": "0.5567289", "text": "def create_yaml(filename, yaml_url, md_url)\n yaml = {}\n yaml[\"yaml_url\"] = yaml_url\n yaml[\"md_url\"] = md_url\n yaml[\"Title\"] = \"Cheat Sheet title\"\n File.open(filename, \"w\") { |f| YAML.dump(yaml, f) }\n\n content = File.read(filename)\n Gist.gist(content,\n :filename => filename,\n :update => yaml_url)\n\n yaml_url = filename\n Chgen::Markdown.parse_file(yaml_url)\n end", "title": "" }, { "docid": "2bee9e504a2b789d5e6b4be8cb5c5051", "score": "0.55583227", "text": "def render_yaml fh = nil\n fh ||= StringIO.new\n\n fh.puts <<\"END\"\n# THIS IS UTF-8 YAML: CHECK YOUR EDITOR SETTINGS BEFORE EDITING IT!\n# GENERATED BY #{self.class.name}#render_yaml\n--- \n:api_version: #{document[:api_version]}\nEND\n if x = document[:action]\n fh.puts \":action: #{x.to_s.inspect}\" \n end\n\n if x = document[:format]\n fh.puts \":format: #{x.to_s.inspect}\" \n end\n\n if x = document[:comment]\n fh.puts \":comment: #{x.to_s.inspect}\" \n end\n\n if x = document[:errors]\n fh.puts \":errors: #{x.inspect}\" \n end\n\n if x = document[:stats]\n fh.puts \":stats:\"\n x.keys.sort { | a, b | a.to_s <=> b.to_s }.\n each do | k |\n v = x[k]\n fh.puts \" #{k.inspect}: #{v.inspect}\"\n end\n end\n\n render_header = lambda do | cols |\n fh.puts <<\"END\"\n:contents_count: #{document[:contents_count]}\n:contents_columns: #{cols.inspect}\n:contents: \nEND\n end\n\n render_rows(render_header) do | row_i, c, i, v |\n if i == 0\n fh.puts \"# #{row_i}\" if options[:row_id]\n fh.write START_ROW\n else\n fh.write START_COL\n end\n \n case c\n when :data\n fh.write Contenter::Yaml.string_as_yaml(v, INDENT); fh.write NEWLINE\n when :content_key, :data_encoding, :filename\n fh.puts v.inspect\n when :version, :id, :uuid, :content_key_uuid, :md5sum\n fh.puts v.to_s\n when :tasks\n fh.puts \"#{v.inspect} \\# tasks\"\n else\n fh.puts \":#{v.inspect}\"\n end\n end\n\n fh\n end", "title": "" }, { "docid": "feee1007e148562a596ea0d26e86fa0f", "score": "0.5554701", "text": "def dump\n head.to_yaml + \"---\" + body\n end", "title": "" }, { "docid": "0919a9ae6a570e5bafe936b9d0d0e2ab", "score": "0.5540975", "text": "def create_yaml\n current_types = mdes_version.specification.types.select(&:code_list)\n create_yaml_from_types(current_types, automatic_filename)\n create_yaml_from_types(future_code_list_types(current_types), future_filename)\n end", "title": "" }, { "docid": "993d80257de84e6265d69bfb5a90afdd", "score": "0.5540307", "text": "def yaml_output\n <<YAML\n -\n image: #{image}\n image_title: \"#{image_title}\"\n caption: \"#{caption}\"\n description: #{description.inspect.gsub('\\\\r\\\\n\\\\r\\\\n', '<br ><br >')}\n alt: #{alt.inspect}\n month: #{Date::MONTHNAMES[month].downcase}\nYAML\n end", "title": "" }, { "docid": "b33397bc26692567b56318595ebd6a92", "score": "0.5520588", "text": "def generate_yaml\n raw_sections = File.read(__FILE__.gsub('.rb', '.wiki')).\n split(/^==/).\n map{|l| /=*(.+):(.+)====(.+)/m.match(l)}.compact\n\n sections = raw_sections.map do |r|\n desc = r[3].strip.gsub(/{\\|.+?\\|}/m, '').gsub(/\\n\\s+/m, \"\\n\").strip\n name = r[2].strip\n method_name = name.gsub(/\\(.+\\)/, '').strip.gsub(/\\W+/,'_').downcase\n code = r[1].strip\n\n potential_params = desc.scan(/\\s([XYZEFSPR])\\d*(?!\\w)/).map{|m| m[0].to_sym}.uniq.sort\n\n example_matcher = /^(Example:) ([\\w .<>-]+?)(#.+)?$/\n if match = example_matcher.match(desc)\n example = match[2]\n desc.sub!(example_matcher, '\\3').sub('#', '')\n end\n\n {\n code: code,\n name: name,\n example: example,\n accepts: potential_params,\n supported: true,\n method_name: method_name,\n description: desc,\n }\n end\n\n File.open(__FILE__.gsub('.rb', '.yml'), \"w\"){|f| f.write sections.to_yaml }\n end", "title": "" }, { "docid": "21e4b5f1d76204543a07feec653226de", "score": "0.54789263", "text": "def encode(value)\n # If it contains a `content` attribute, other data is in a YAML front matter block\n if value.key? \"content\"\n content = value[\"content\"].to_s\n value.delete(\"content\")\n\n data = value.to_yaml\n data += \"---\\n\\n\"\n data += content\n data\n else\n # Standard YAML file\n value.to_yaml\n end\n end", "title": "" }, { "docid": "2a47d6ef2035f1ce9135f3c69f4362e4", "score": "0.54618335", "text": "def for_yaml\n SPARQLTestYAML.new(\n subject.to_s,\n name,\n (type ? type.to_s : nil),\n comment,\n (action.query_file ? action.query_file.to_s : nil),\n (action.test_data ? action.test_data.to_s : nil),\n action.graphData.to_a.map(&:to_s),\n (result ? result.to_s : nil),\n (approval ? approval.to_s : nil),\n (approved_by ? approved_by.to_s : nil),\n (manifest ? manifest.to_s : nil),\n tags)\n end", "title": "" }, { "docid": "eb35086a56301aed1bf8b58c21f545dd", "score": "0.5459887", "text": "def content_to_yaml!\n self.content = content_to_yaml\n end", "title": "" }, { "docid": "bd81e35f4541ad829eb18d7e5a343bb5", "score": "0.54572105", "text": "def to_yaml\n Chef::JSONCompat.from_json(to_json).to_yaml\n end", "title": "" }, { "docid": "15f9e4f44fe8f8b1e91c8a7c2e1078aa", "score": "0.54505986", "text": "def create\n snitch_config_tpl = <<EOF\n# what services would you like to send commit messages to?\nservices:\n :campfire:\n :subdomain: \n :login: \n :password: \n :room: Development\n :twitter:\n :login: \n :password: \n :email:\n # You mail server settings:\n :host:\n :server: localhost\n :port: 25\n # Your login creds:\n :login:\n :password:\n :method: :login\n # Our email addresses:\n :from: Snitch <root@localhost>\n :to:\nEOF\n File.open(config_file_path, 'w') { |f| f.write snitch_config_tpl } unless File.exists?(config_file_path)\n end", "title": "" }, { "docid": "8a66feb142d4864240e02c1e6032c05f", "score": "0.5440429", "text": "def dump\n head.to_yaml + \"---\\n\" + body\n end", "title": "" }, { "docid": "8af3d8fdd22992d691cece3274d520d2", "score": "0.53992265", "text": "def create!\n puts \"Creating #{resource_type}/#{name}\".color(:yellow).bright if config.verbose\n puts to_json if config.debug\n kubectl! 'create -f -', input: to_json\n end", "title": "" }, { "docid": "ae0ecbbfa4fcecb25e40380db64af82c", "score": "0.53860265", "text": "def body=(var)\n self.data = var.to_yaml\n end", "title": "" }, { "docid": "93c17189ba1552a795f900303eec3492", "score": "0.5383904", "text": "def serialize\n buffer = YAML.dump(meta_data)\n buffer << \"---\\x0D\\x0A\"\n buffer << post_body\n buffer\n end", "title": "" }, { "docid": "a3c200eb984214c92d8ab31f64d1879f", "score": "0.5354957", "text": "def create body\n @connection.post endpoint, :body => body\n end", "title": "" }, { "docid": "1ce3b403235ae72c6c7ceb7e8bae4808", "score": "0.5349718", "text": "def write_yaml(object)\n write object.to_yaml\n end", "title": "" }, { "docid": "04316399090edc30babfea107a515aeb", "score": "0.5343724", "text": "def render_yaml fh = nil\n fh ||= StringIO.new\n\n cols = document[:contents_columns] || (raise ArgumentError, 'no contents_columns')\n\n fh.puts <<\"END\"\n# THIS IS UTF-8 YAML: CHECK YOUR EDITOR SETTINGS BEFORE EDITING IT!\n# GENERATED BY Contenter::Bulk#render_yaml\n--- \n:api_version: #{document[:api_version]}\nEND\n if x = document[:action]\n fh.puts \":action: #{x.to_s.inspect}\" \n end\n\n if x = document[:comment]\n fh.puts \":comment: #{x.to_s.inspect}\" \n end\n\n if x = document[:errors]\n fh.puts \":errors: #{x.inspect}\" \n end\n\n if x = document[:stats]\n fh.puts \":stats:\"\n x.keys.sort { | a, b | a.to_s <=> b.to_s }.\n each do | k |\n v = x[k]\n fh.puts \" #{k.inspect}: #{v.inspect}\"\n end\n end\n\n if document[:contents]\n document[:contents_count] = document[:contents].size\n fh.puts <<\"END\"\n:contents_count: #{document[:contents_count]}\n:contents_columns: #{document[:contents_columns].inspect}\n:contents: \nEND\n row_i = -1\n document[:contents].each do | r |\n case r\n when Hash\n r = cols.map { | c | r[c] }\n when Array\n #\n when ActiveRecord::Base\n r = cols.map do | c | \n v = r.send(c)\n if ActiveRecord::Base === v\n v = v.code if v.respond_to?(:code)\n end\n v\n end\n else\n raise ArgumentError\n end\n \n fh.puts \"# #{row_i += 1}\" if options[:row_id]\n\n cols.each_with_index do | c, i |\n v = r[i]\n fh.write \"#{i == 0 ? '-' : ' '} - \"\n \n case c\n when :data\n if (v =~ /\\n/)\n fh.puts <<\"END\"\n|\n #{v.gsub(/(\\r?\\n)/){|x| x + \" \"}}\nEND\n else\n fh.puts <<\"END\"\n\"#{v.gsub(/([\\\\\\\"])/){|x| '\\\\' + x }}\"\nEND\n end\n when :content_key\n fh.puts \"#{v.inspect}\"\n when :version, :id, :uuid, :md5sum\n fh.puts \"#{v}\"\n else\n fh.puts \":#{v.inspect}\"\n end\n end\n end\n end\n\n fh\n end", "title": "" }, { "docid": "547aac1d1dcf0a96dad6cd1390960114", "score": "0.5333622", "text": "def create_yaml\n if @host_2_check and @host_2_check.is_a?(String)\n @host_data = { :hosts => get_hostinfo_single(@in_file, @host_2_check )}\n else\n @host_data = { :hosts => get_hostinfo(@in_file) }\n end\n #puts @host_data.inspect\n puts \"creating #{@out_file}\"\n File.open(@out_file, 'w') { |f| f.write(@host_data.to_yaml) }\nend", "title": "" }, { "docid": "122cc1111f0d2fe6fec139cdd347481a", "score": "0.5323341", "text": "def create_yaml\n yml = mdes_version.specification.types.select(&:code_list).collect { |typ|\n # Merge display text for duplicate codes. In MDES 2.0, these only occur in PSU_CL1.\n code_list_index = typ.code_list.inject({}) { |i, cl_entry|\n # TODO: some display text entries have lots of random bytes\n # in them. Clean them up sometime.\n display_text = cl_entry.label.strip.gsub(/\\s+/, \" \")\n (i[cl_entry.value.to_i] ||= []) << display_text\n i\n }\n code_list_index.collect { |local_code, display_texts|\n {\n 'list_name' => typ.name.upcase,\n 'local_code' => local_code,\n 'display_text' => display_texts.join('; ')\n }\n }\n }.flatten.sort_by { |list_entry| [list_entry['list_name'], list_entry['local_code']] }\n\n File.open(filename.to_s, 'w:utf-8') do |w|\n w.write(yml.to_yaml)\n end\n end", "title": "" }, { "docid": "a31ff81ece1b7ef30439c5db770478b7", "score": "0.5312191", "text": "def create\n puts \"this is create\"\n puts brewery_params\n @brewery = Brewery.new(brewery_params)\n puts \"in save\"\n puts @brewery.to_yaml\n respond_to do |format|\n if @brewery.save\n puts \"saved\"\n format.html { redirect_to @brewery, notice: 'Brewery was successfully created.' }\n format.json { render action: 'show', status: :created, location: @brewery }\n else\n puts \"didnt save\"\n format.html { render action: 'new' }\n format.json { render json: @brewery.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11b9e5acffb3a3cedf2ac7f044590c9e", "score": "0.5300685", "text": "def save_template\n path = \"/tmp/ufo/#{@stack_name}/stack.yml\"\n FileUtils.mkdir_p(File.dirname(path))\n IO.write(path, template_body)\n puts \"Generated template saved at: #{path}\"\n\n path = \"/tmp/ufo/#{@stack_name}/parameters.yml\"\n IO.write(path, JSON.pretty_generate(parameters))\n puts \"Generated parameters saved at: #{path}\"\n end", "title": "" }, { "docid": "91350c3522c1ed55eb78dcb38fa93366", "score": "0.52853435", "text": "def create_yaml_file(path)\n File.open(path, 'w:UTF-8') do |stream|\n stream.write(YAML.dump(yield))\n end\nend", "title": "" }, { "docid": "fa6fbb0277e4c419666da128b52b9ddb", "score": "0.52794695", "text": "def do_create_secret(secret)\n namespace = secret['namespace']\n name = secret['name']\n spec = secret['data']\n annotations =secret['annotations']\n labels= secret['labels']\n secret_type= secret['secret_type']\n filename=\"/var/vcap/data/action/secret_#{name}.yml\"\n\n\n File.open(filename, 'w+') do |f|\n f.puts(\"apiVersion: v1\")\n f.puts(\"kind: Secret\")\n f.puts(\"metadata:\")\n f.puts(\" name: #{name}\")\n f.puts(\" namespace: #{namespace}\")\n f.puts(\" annotations:\")\n if annotations != nil\n annotations.each{ |annotation|\n f.puts(\" #{annotation['name']}: #{annotation['value']}\")\n }\n end\n if labels != nil\n f.puts(\" labels:\")\n labels.each{ |label|\n f.puts(\" #{label['name']}: #{label['value']}\")\n }\n end\n if secret_type != nil\n f.puts(\"type: #{secret_type}\")\n end\n if spec != nil\n f.puts(\"data:\")\n spec.each { |data|\n b= Base64.encode64(data['value'])\n b.delete!(\"\\n\")\n f.puts(\" #{data['name']}: #{b}\")\n }\n end\n end\n \"kubectl apply -f #{filename} \"\nend", "title": "" }, { "docid": "8c0fb83deda2d6e37ae44fac4e8bd4f4", "score": "0.5251807", "text": "def to_y\r\n require 'yaml'\r\n y self\r\n end", "title": "" }, { "docid": "0c58f07b65cd33b71df5c0c7433e404f", "score": "0.5249715", "text": "def create\n @yml_source = YmlSource.new(params[:yml_source])\n\n respond_to do |format|\n if @yml_source.save\n format.html { redirect_to @yml_source, notice: 'Yml source was successfully created.' }\n format.json { render json: @yml_source, status: :created, location: @yml_source }\n else\n format.html { render action: \"new\" }\n format.json { render json: @yml_source.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "929b59bbb654272c5100832a81aa0fb4", "score": "0.5245877", "text": "def save_yaml\n File.open(@yaml_path, 'w') {|f|\n f.write(@yaml.to_yaml)\n }\n end", "title": "" }, { "docid": "83700eb68e2fc20b5e12e4da4b7210bc", "score": "0.5243927", "text": "def save object, filename #You can put the write (save) portion in one method...\n File.open filename, 'w' do |f| #\"W\" is for \"write-access\", allows us to write the file.\n f.write object.to_yaml #\".write\" 's the variable \"string_content\" in to the file.\n end #Ruby closes the file for you automatically.\nend", "title": "" }, { "docid": "cdb68fc0f080605f5a01f875a4fbc440", "score": "0.52348715", "text": "def save_yaml(data, filename)\n f = File.open(filename,'w') \n f.write(data.to_yaml)\nend", "title": "" }, { "docid": "07e2b4fe74a675fb81d4ba6a6983f97a", "score": "0.5221792", "text": "def yaml!(obj)\n concat ::YAML.dump(obj)\n end", "title": "" }, { "docid": "28018413c23f77cb050c3cd0d3b3ccae", "score": "0.52134055", "text": "def api_post_body\n {\n name: title,\n color: color,\n description: description\n }\n end", "title": "" }, { "docid": "4e07add4c711b81c3bda045242dfbc46", "score": "0.52133584", "text": "def copy_yaml\n template \"custom_words.yml\", \"config/custom_words.yml\"\n end", "title": "" }, { "docid": "6e3406b32286227928739199858db378", "score": "0.52128357", "text": "def call()\n documents = []\n if file && File.exists?(file)\n YAML.load_stream(File.open(file)) do |document|\n if document[\"kind\"] == \"Secret\"\n if document[\"data\"]\n document[\"data\"].each do |k,v|\n if decode?\n document[\"data\"][k] = Base64.strict_decode64(v)\n else\n document[\"data\"][k] = Base64.strict_encode64(v)\n end\n end\n end\n end\n documents << document\n end\n yaml = documents.map{|d| d.to_yaml}.join\n\n puts yaml\n if yes?\n File.open(file, 'w') { |file| file.write(yaml) }\n end\n else\n cli.show_help\n end\n exit\n end", "title": "" }, { "docid": "e01ce9aa8d2b40a713f0262f35ca8ccf", "score": "0.52110565", "text": "def do_create_kubectl(apply)\n name = apply['name']\n namespace = apply['namespace']\n options = apply['options']\n cmd = apply['cmd']\n content = apply['content']\n filename = \"/var/vcap/data/action/#{name}.yml\"\n kubectl_cmd =\"kubectl #{cmd} \"\n unless namespace.nil? || namespace == 0\n kubectl_cmd = \"#{kubectl_cmd} --namespace #{namespace} \"\n end\n unless options .nil? || options == 0\n kubectl_cmd = \"#{kubectl_cmd} #{options}\"\n end\n unless content .nil? || content == 0\n File.open(\"#{filename}\", 'w') {|f| f.write content .to_yaml }\n kubectl_cmd = \"#{kubectl_cmd} -f #{filename}\"\n end\n kubectl_cmd\nend", "title": "" }, { "docid": "c3b8dcc11aa9356f2c51814df7e30d96", "score": "0.5201466", "text": "def to_yaml_s\n raise InternalError.new( \"@key is empty for #{self.class}\" ) if \"#{@key}\".empty?\n\n x = \"=== #{@key} ===\\n\"\n x += \"#{(description || 'FIXME: NO DESCRIPTION GIVEN')}\\n\"\n\n # comment every line that describes the item:\n x = x.each_line.map{ |y| \"# #{y}\" }.join\n\n # add yaml (but stripped of frontmatter and first indent)\n # TODO: should we be using SafeYAML? http://danieltao.com/safe_yaml/\n x += { @key => @value }.to_yaml.gsub(/^---\\s*\\n/m, '').gsub(/^ /, '' )\n x += \"\\n\"\n\n if @skip_yaml\n nil\n else\n x\n end\n end", "title": "" }, { "docid": "abd05004a422f9774e6f530c8581b3bd", "score": "0.51968056", "text": "def create(body = {})\n @client.pipeline_transfer.create(body)\n end", "title": "" }, { "docid": "b1df2ca724a3d797ad53ac688c619729", "score": "0.5187148", "text": "def to_yaml_properties; end", "title": "" }, { "docid": "46cca9492045b88dc4141173d7582e33", "score": "0.5181973", "text": "def template\n Stackup::YAML.load(template_body)\n end", "title": "" }, { "docid": "181567bb2de7a05849fb3cbfd33b4ef3", "score": "0.51817185", "text": "def create path, body, merger = ENV['merger']\n generate path, body do |*files|\n system \"#{merger} #{Shellwords.join files}\" if merger\n end\n end", "title": "" }, { "docid": "df2e6238116b94973c561971b3d16373", "score": "0.51637393", "text": "def y(obj)\n puts obj.to_yaml\nend", "title": "" }, { "docid": "df2e6238116b94973c561971b3d16373", "score": "0.51637393", "text": "def y(obj)\n puts obj.to_yaml\nend", "title": "" }, { "docid": "df2e6238116b94973c561971b3d16373", "score": "0.51637393", "text": "def y(obj)\n puts obj.to_yaml\nend", "title": "" }, { "docid": "df2e6238116b94973c561971b3d16373", "score": "0.51637393", "text": "def y(obj)\n puts obj.to_yaml\nend", "title": "" }, { "docid": "b485387a2fd71176103c8dfcc1ace309", "score": "0.5147155", "text": "def __prepare_body(data)\n\n if data[:template].has_key?(:content)\n unless data[:template][:content].empty?\n data[:template][:content] = Base64.encode64(data[:template][:content])\n end\n end\n\n if data[:template].has_key?(:archive)\n unless data[:template][:archive].empty?\n data[:template][:archive] = Base64.encode64(data[:template][:archive])\n end\n end\n\n if data[:template].has_key?(:plain_text)\n unless data[:template][:plain_text].empty?\n data[:template][:plain_text] = Base64.encode64(data[:template][:plain_text])\n end\n end\n\n campaign_data = {}\n campaign_data[:campaign] = data\n\n campaign_data\n end", "title": "" }, { "docid": "75fcef1dc955aeb2552881efc2cef0de", "score": "0.5144125", "text": "def create(queue, klass, *args)\n args.collect! do |arg|\n if arg.is_a?(Hash) && arg.key?(:serialize)\n if arg[:serialize].is_a?(Hash)\n arg[:serialize].each{|k,v| arg[:serialize][k] = v.to_yaml }\n elsif arg[:serialize].is_a?(Array)\n arg[:serialize].collect!{|a| a.to_yaml }\n end\n end\n arg\n end\n create_after_serializing(queue, klass, *args)\n end", "title": "" }, { "docid": "b5843e03b278de7ccd2ac52a7fadf595", "score": "0.51419973", "text": "def yamsave(obj, filename)\n File.open(filename, \"w\") { |x|\n x.write(obj.to_yaml)\n }\nend", "title": "" }, { "docid": "4979815877a15b7516043ae8f8ca3c1c", "score": "0.5140843", "text": "def pack(hash)\n yml_out = Psych.dump(hash) #.strip!\n end", "title": "" }, { "docid": "f12d5c8ad2f49ce3ce4624f639ae65fa", "score": "0.51382756", "text": "def create_body(capistrano)\n<<-EOL\n#{summary}\n\nComment: #{capistrano[:comment] || \"[none given]\"}\n\nLOG:\n#{ `git log #{capistrano[:previous_revision]}..#{capistrano[:current_revision]}`}\n\nNerd details\n============\nRelease: #{capistrano[:current_release]}\nRelease Time: #{humanize_release_time(capistrano[:current_release])}\nRelease Revision: #{capistrano[:current_revision]}\n\nPrevious Release: #{capistrano[:previous_release]}\nPrevious Release Time: #{humanize_release_time(capistrano[:previous_release])}\nPrevious Release Revision: #{capistrano[:previous_revision]}\n\nRepository: #{capistrano[:repository]}\nDeploy path: #{capistrano[:deploy_to]}\nEOL\n end", "title": "" }, { "docid": "1c19711d8fc2fbe8e2a8e3d9c3b5a54e", "score": "0.5121727", "text": "def make_config_file\n if File.exists? @options.config_file_name\n puts \"Are you sure? (y for yes)\"\n a = gets.strip.downcase\n return unless a == \"y\"\n end\n File.open(@options.config_file_name, 'w+') do |file| \n file.puts @options.to_yaml\n end\n end", "title": "" }, { "docid": "8a919dd758da79581b7b6dbcf7d00773", "score": "0.5106359", "text": "def body\n # TODO: add a test for something with --- without a yaml header.\n @body ||= begin\n thing = File.file?(path) ? path : self\n _, body = Zenweb::Config.split thing\n if self.binary? then\n body\n else\n body.strip\n end\n end\n end", "title": "" }, { "docid": "e2172fd798fd9c5e06a0c5833cf4ea53", "score": "0.5096237", "text": "def save_as_yaml(conf_file_path)\n begin\n #fd = IO.sysopen(filename, Fcntl::O_WRONLY|Fcntl::O_CREAT|Fcntl::O_EXCL, 0600)\n #IO.open(fd, 'wb') {|fh| fh.puts ConfigHeader, YAML.dump(self) }\n\n if !File.file?(conf_file_path)\n\n FileUtils.mkdir_p(File.dirname(conf_file_path))\n File.open(conf_file_path, 'w') { |file| file.puts ConfigHeader, YAML.dump(self) }\n\n end\n rescue Exception => e\n puts \"Could not save config to (#{conf_file_path})\"\n puts e.backtrace\n #logger.error \"Could not save config to (#{conf_file_path})\"\n #logger.log_exception e\n end\n\n return self\n end", "title": "" }, { "docid": "fa0b8e8c25a2011a0429c8b1210c0734", "score": "0.50938493", "text": "def yaml_save object, filename\n File.open filename, \"w\" do |f|\n f.write(object.to_yaml)\n end\nend", "title": "" }, { "docid": "e4374722ac5d91133d97d0a3e22f6dd1", "score": "0.5083203", "text": "def create_config_file\n template 'active_spy.yml', File.join('config', 'active_spy.yml')\n end", "title": "" }, { "docid": "830c4925afb5199ab35e89aeea843c03", "score": "0.50796235", "text": "def toYAML()\r\n\t\t@buffer = \"{source: {lang: '#{@sourceLang}', content:'#{@sourceText}'}, target: {lang: '#{@targetLang}', content: '#{@targetText}'}},\\n\"\r\n\t\treturn @buffer\r\n\tend", "title": "" }, { "docid": "cf532de1a2197e43059655b3814c9664", "score": "0.5079493", "text": "def dump\n (head.empty? ? '' : head.to_yaml + \"---\") + body\n end", "title": "" }, { "docid": "0384dd894b3ee7df787ea9c51d81106d", "score": "0.5078793", "text": "def create_new_post(params) \n post_title = params['post']['title']\n post_date = (Time.now).strftime(\"%Y-%m-%d\")\n\n content = yaml_data(post_title).to_yaml + \"---\\n\" + params[:post][:content]\n post_file = (post_date + \" \" + post_title).to_url + '.md'\n file = File.join(jekyll_site.source, *%w[_posts], post_file)\n File.open(file, 'w') { |file| file.write(content)}\n post_file\n end", "title": "" }, { "docid": "5529a60d62e850c0917381396bd604f6", "score": "0.5077535", "text": "def build_service_yml\n\t\t\tputs \"==> Generating yaml configuration for #{@template[\"name\"]}-service\"\n\t\t\treverse_proxy = {\"hosts\" => [{\"host\" => \"#{@template[\"name\"]}.default.ciohcld.innovate.ibm.com\", \"port\"=> \"80\", \"path\"=> [\"/#{@template[\"name\"]}\"], \"defaultPath\"=> \"#{@template[\"name\"]}\"}]}.to_json\n\t\t\tservice_hash = {\n\t\t\t\t\"kind\" => @template[\"kubernetes\"][\"kind\"][\"service\"],\n\t\t\t\t\"apiVersion\" => @template[\"kubernetes\"][\"api\"],\n\t\t\t\t\"metadata\" => {\n\t\t\t\t\t\"name\" => @template[\"name\"],\n\t\t\t\t\t\"labels\" => {\n\t\t\t\t\t\t\"name\" => @template[\"name\"]\n\t\t\t\t\t},\n\t\t\t\t\t\"annotations\" => {\n\t\t\t\t\t\t\"kubernetesReverseproxy\" => reverse_proxy\n\t\t\t\t\t}\n\t\t\t\t},\n\t\t\t\t\"spec\" => {\n\t\t\t\t\t\"ports\" => [{\"port\" => @template[\"port\"].to_i}],\n\t\t\t\t\t\"selector\" => {\n\t\t\t\t\t\t\"role\" => @template[\"name\"]\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\t\t\tputs \"#{service_hash.to_yaml}\"\n\t\t\treturn service_hash.to_yaml\n\t\tend", "title": "" }, { "docid": "4d2f5d9938a9bbba923170b2331cd8cd", "score": "0.50755805", "text": "def configuration_body\n YAML.dump request_payload\n end", "title": "" }, { "docid": "4d1230887a27efdb2fa0c502362bdbdc", "score": "0.50748414", "text": "def yaml_save(object, filename)\n File.open filename, \"w\" do |f|\n f.write(object.to_yaml)\n end\nend", "title": "" }, { "docid": "888600d87255700fab7f962eff08d1af", "score": "0.5071142", "text": "def inventory\n render body: Cogy.bundle_config.to_yaml, content_type: \"application/x-yaml\"\n end", "title": "" }, { "docid": "f5ed89a00500765a53b38cb5fede2f82", "score": "0.50680023", "text": "def yaml_save object, filename\n File.open filename, \"w\" do |f|\n f.write(object.to_yaml)\n end\nend", "title": "" }, { "docid": "f53be88f7486b73a4fa32b1daa80b36c", "score": "0.50677717", "text": "def yaml_save(object, filename)\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "title": "" }, { "docid": "467528f4a3f9fd41f8a9f3f3bcbdc415", "score": "0.5067383", "text": "def initialize_rule_yaml(filename, files = Dry::Files.new, template: rule_template)\n files.write(filename, template)\n end", "title": "" }, { "docid": "32041b2c4dd0ff4e985d9bddebc87b14", "score": "0.50631994", "text": "def upload_yaml(file)\n upload_file(file, YAML_FORMAT)\n end", "title": "" }, { "docid": "16e44d88cfb832b64fdcb2ba785184b4", "score": "0.50625366", "text": "def to_yaml\n # get the attributes with their translations and get rid of all the symbols\n object = self.to_hash\n\n object.each do |key, value|\n if value.is_a?(Array)\n object[key] = if value.first.is_a?(String)\n StyledYAML.inline(value) # inline array\n else\n value.map(&:to_hash)\n end\n end\n end\n\n StyledYAML.dump object\n end", "title": "" }, { "docid": "448827dbe6e4122689698726cd2c9796", "score": "0.5061817", "text": "def construct_and_write_yaml(filepath)\n data = YAML::load(File.open(filepath))\n\n yield data\n\n File.open(filepath, \"w\") do |f|\n f.write(YAML::dump(data))\n end\nend", "title": "" }, { "docid": "9bb320c6c2f26a500883b30933794916", "score": "0.5060094", "text": "def template\n template_path = File.expand_path('../../pipeline.yml', __FILE__)\n contents = File.read(template_path)\n # support removal of trailing newlines\n ERB.new(contents, nil, '-')\n end", "title": "" }, { "docid": "a15307ff1a9b0de697fb3e9fa0b2fd83", "score": "0.5059692", "text": "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "title": "" }, { "docid": "a15307ff1a9b0de697fb3e9fa0b2fd83", "score": "0.5059692", "text": "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "title": "" }, { "docid": "a15307ff1a9b0de697fb3e9fa0b2fd83", "score": "0.5059692", "text": "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "title": "" }, { "docid": "a15307ff1a9b0de697fb3e9fa0b2fd83", "score": "0.5059692", "text": "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "title": "" }, { "docid": "a15307ff1a9b0de697fb3e9fa0b2fd83", "score": "0.5059692", "text": "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "title": "" }, { "docid": "a15307ff1a9b0de697fb3e9fa0b2fd83", "score": "0.5059692", "text": "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "title": "" }, { "docid": "a15307ff1a9b0de697fb3e9fa0b2fd83", "score": "0.5059692", "text": "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "title": "" }, { "docid": "a15307ff1a9b0de697fb3e9fa0b2fd83", "score": "0.5059692", "text": "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "title": "" }, { "docid": "a15307ff1a9b0de697fb3e9fa0b2fd83", "score": "0.5059692", "text": "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "title": "" }, { "docid": "a15307ff1a9b0de697fb3e9fa0b2fd83", "score": "0.5059692", "text": "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "title": "" }, { "docid": "a15307ff1a9b0de697fb3e9fa0b2fd83", "score": "0.5059692", "text": "def yaml_save object, filename\n File.open filename, 'w' do |f|\n f.write(object.to_yaml)\n end\nend", "title": "" }, { "docid": "b43af63cfe6e1988dd48b09485ff6a46", "score": "0.5049716", "text": "def validate_yaml\n end", "title": "" }, { "docid": "bf62ab3f6ed84b6f8c3e3ca0b60e1111", "score": "0.503289", "text": "def create_card(body:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::POST,\n '/v2/cards',\n 'default')\n .header_param(new_parameter('application/json', key: 'Content-Type'))\n .body_param(new_parameter(body))\n .header_param(new_parameter('application/json', key: 'accept'))\n .body_serializer(proc do |param| param.to_json unless param.nil? end)\n .auth(Single.new('global')))\n .response(new_response_handler\n .deserializer(APIHelper.method(:json_deserialize))\n .is_api_response(true)\n .convertor(ApiResponse.method(:create)))\n .execute\n end", "title": "" }, { "docid": "cc805c7b8c1f95e57a0d3bae6983228c", "score": "0.5028937", "text": "def create_docker_compose_yml\n end", "title": "" }, { "docid": "c158847533d5bd37720913fd2e62f1db", "score": "0.502366", "text": "def create\n @data_structure = DataStructure.new(data_structure_params.merge(user_id: current_user.id))\n @data_structure.structure = CreateStructureService.new(data_structure_params).create.to_yaml\n\n respond_to do |format|\n if @data_structure.save\n format.html { redirect_to @data_structure, notice: 'Data structure was successfully created.' }\n format.json { render :show, status: :created, location: @data_structure }\n else\n format.html { render :new }\n format.json { render json: @data_structure.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1ddd8871de7b3bca43a15b7b382b595f", "score": "0.5022624", "text": "def copy\r\n Tem::SecPack.new_from_yaml_str self.to_yaml_str\r\n end", "title": "" }, { "docid": "13f755fa7a956fecf9c52e43a7a91813", "score": "0.50122136", "text": "def take_yaml(yaml)\n @data = YAML.load(yaml)\n end", "title": "" }, { "docid": "623f5c48eca6d7d961ee53168a25ae09", "score": "0.5011253", "text": "def test_yaml\n\n s = Ruote::Serializer.new(:yaml)\n\n data = s.encode(Vehicle.new('bike'))\n\n assert_match /^---/, data\n\n v = s.decode(data)\n\n assert_equal Vehicle, v.class\n assert_equal 'bike', v.type\n end", "title": "" } ]
703e2bdba616723afcbd05ca80e95a91
Prepends content to 'content_for'
[ { "docid": "1e14a204191687d98cf0bb13dc45f406", "score": "0.5993792", "text": "def prepend_to name, content = nil, &block\n ivar = \"@content_for_#{name}\"\n content = capture(&block) if block_given?\n content ||= \"\"\n stored_content = instance_variable_get(ivar) || \"\"\n instance_variable_set(ivar, content + stored_content)\n nil\n end", "title": "" } ]
[ { "docid": "0a16155c430f3a621fd5ba9f5739bd4d", "score": "0.65111756", "text": "def prepare(content)\n body = content.body\n body.gsub!('<title />', \"<h1>#{link_to_content(content)}</h1>\")\n \n if content.respond_to?(:published_at)\n body.gsub!('<timestamp />', \"<div class='date'>#{content.published_at.strftime(\"%B #{content.published_at.day.ordinalize}, %Y\")}</div>\")\n body.gsub!(\"<summary>\", \"\")\n body.gsub!(\"</summary>\", \"\")\n end\n \n body\n end", "title": "" }, { "docid": "e9e16efd115fd09e7f8eba4556b55b8a", "score": "0.6385303", "text": "def cama_content_prepend(content)\n @_before_content << content\n end", "title": "" }, { "docid": "95d8d07f5869bbbd5b389f5ad5619e29", "score": "0.619281", "text": "def render_content\n content\n end", "title": "" }, { "docid": "b16266e136ea8748cf7477900524ec2b", "score": "0.6172457", "text": "def build_from_content(content, with_intro = true)\n html = \"\"\n if with_intro\n html = \"<div class='static-module'>\"\n html << \"<div>#{content.intro}</div>\"\n html << \"<div>#{content.content}</div>\"\n html << \"</div>\"\n else\n html << content.content\n end\n html.html_safe\n end", "title": "" }, { "docid": "39522be022748a343d427b3a04f4b4ee", "score": "0.61673373", "text": "def view_context\n super.tap do |view|\n (@_content_for || {}).each do |name,content|\n view.content_for name, content\n end\n end\n end", "title": "" }, { "docid": "39522be022748a343d427b3a04f4b4ee", "score": "0.61673373", "text": "def view_context\n super.tap do |view|\n (@_content_for || {}).each do |name,content|\n view.content_for name, content\n end\n end\n end", "title": "" }, { "docid": "0a2b222028eef5d23f9d67761a768450", "score": "0.6095299", "text": "def content! &block # :yields: content\n # If our block returns a value, this will become this resource's new\n # content\n new_content = yield _content\n self.content = new_content if new_content\n self\n end", "title": "" }, { "docid": "8ace57a7d94ec3e29172a0a3d200d347", "score": "0.60558593", "text": "def generate_content; end", "title": "" }, { "docid": "7e8a0f69538807bd3771ad8e26c5a092", "score": "0.6010294", "text": "def content_for\n @content_for\n end", "title": "" }, { "docid": "a4956aeeefa76fb73163c62b3d035405", "score": "0.60034966", "text": "def process\n replace_tag_into_template! 'genit.pages', page_content\n end", "title": "" }, { "docid": "bc79aff1a22a3eca23fcb512f0ff6692", "score": "0.5992454", "text": "def content(**data)\n return @content unless @content.blank?\n\n template.result(data)\n end", "title": "" }, { "docid": "894f8164c70702a4f579b021388ed4fc", "score": "0.59636456", "text": "def build_content_item\n end", "title": "" }, { "docid": "f78d0ff27cbd4b9c8f21bc016a1d1452", "score": "0.59533834", "text": "def pre_render\n content_tag tag_type, html_options do\n concat glyph_and_content_html if @content\n concat header_html if @header\n concat body_html if @body\n concat badge_html if @options[:badge]\n end\n end", "title": "" }, { "docid": "e0aa17f1f105b7fbded2f010e5f631f0", "score": "0.5947733", "text": "def content_for(name, content = nil, &block)\n # this doesn't exist, and causes errors\n @_content_for = {} unless defined? @_content_for\n # we've got to initialize this, so we can concat to it\n @_content_for[name] = '' if @_content_for[name].nil?\n # now the rest is the same as in rails\n content = capture(&block) if block_given?\n @_content_for[name] << content if content\n @_content_for[name] unless content\n end", "title": "" }, { "docid": "e0aa17f1f105b7fbded2f010e5f631f0", "score": "0.5947733", "text": "def content_for(name, content = nil, &block)\n # this doesn't exist, and causes errors\n @_content_for = {} unless defined? @_content_for\n # we've got to initialize this, so we can concat to it\n @_content_for[name] = '' if @_content_for[name].nil?\n # now the rest is the same as in rails\n content = capture(&block) if block_given?\n @_content_for[name] << content if content\n @_content_for[name] unless content\n end", "title": "" }, { "docid": "167166ea81c254fab464cf407f82b75c", "score": "0.59313875", "text": "def add_content(to_add)\n\t\t@content << to_add\n\tend", "title": "" }, { "docid": "b1b6a3d9b943ec096c2c18e9c9809158", "score": "0.5892715", "text": "def content # :yields: content\n return _content unless block_given?\n # If our block returns a value, this will become this resource's new\n # content\n yield _content\n self\n end", "title": "" }, { "docid": "01adf298d1a3d995da1cff607f307dea", "score": "0.5877357", "text": "def content_for(name, content = nil, &block)\n # this doesn't exist, and causes errors\n @_content_for = {} unless defined? @_content_for\n # we've got to initialize this, so we can concat to it\n @_content_for[name] = '' if @_content_for[name].nil?\n # now the rest is the same as in rails\n content = capture(&block) if block_given?\n @_content_for[name] << content if content\n @_content_for[name] unless content\n end", "title": "" }, { "docid": "50535514636f61e4ac18dd5863c714ec", "score": "0.58772767", "text": "def yield_content_for section, content\n content_for section do \n content\n end\n end", "title": "" }, { "docid": "953ef1064500857863cb676823aa3263", "score": "0.5865021", "text": "def resolve_content\n @content_model == :simple ? %(<p>#{content}</p>) : content\n end", "title": "" }, { "docid": "e6e68b2bf4e05f526e8f085233609db1", "score": "0.5854213", "text": "def resolve_content\n @content_model == :simple ? %(<p>#{content}</p>) : content\n end", "title": "" }, { "docid": "e6e68b2bf4e05f526e8f085233609db1", "score": "0.5854213", "text": "def resolve_content\n @content_model == :simple ? %(<p>#{content}</p>) : content\n end", "title": "" }, { "docid": "cd06e16d0c513b3114370f5db7296f6e", "score": "0.5853371", "text": "def content_for(name, &block)\n @helpers.assigns[\"content_for_#{name}\"] =\n eval(\"@content_for_#{name} = (@content_for_#{name} || '') + capture(&block)\")\n end", "title": "" }, { "docid": "cd06e16d0c513b3114370f5db7296f6e", "score": "0.5853371", "text": "def content_for(name, &block)\n @helpers.assigns[\"content_for_#{name}\"] =\n eval(\"@content_for_#{name} = (@content_for_#{name} || '') + capture(&block)\")\n end", "title": "" }, { "docid": "7aba9f532f89a34fc713621007d01f08", "score": "0.58236104", "text": "def content_for(name, &block)\n eval \"@content_for_#{name} = (@content_for_#{name} || '') + capture(&block)\"\n end", "title": "" }, { "docid": "3ddef7a86ea3234f237b145697952ab6", "score": "0.58085734", "text": "def pack\n @content.pack(@template)\n end", "title": "" }, { "docid": "4e9ec271da56ef005abfb546f4fe7c7b", "score": "0.5782664", "text": "def render_content(content, context, options={})\n return '' if content.blank?\n html = ''\n\n Array(content).compact.map(&:to_article).each do |article|\n # if we're caching, add content to the objects list\n if defined? @COBJECTS\n @COBJECTS << article.original_object\n end\n\n directory = article.original_object.class.name.underscore\n tmplt_opts = [\"#{directory}/#{context}\", \"default/#{context}\"]\n\n partial = tmplt_opts.find do |template|\n self.lookup_context.exists?(template, [\"shared/content\"], true)\n end\n\n html << render(\n \"shared/content/#{partial}\",\n :article => article,\n :options => options\n )\n end\n\n html.html_safe\n end", "title": "" }, { "docid": "08c5989b1b411265c5becf4acfd3ed20", "score": "0.57789963", "text": "def content\n return @content if @content.present?\n @content = page.present? ? page.present_content(vars) : mailer.render\n end", "title": "" }, { "docid": "592bccf68366bd69a1204f385b2a4d0a", "score": "0.57674503", "text": "def setcontent\n \tnewblock = self.content_blocks.create(content: '<p>Content goes here</p>')\n \tself.block_order = Array.new\n \tself.block_order << newblock.id\n end", "title": "" }, { "docid": "d4c0df09ec9e61a711424ad523d1f010", "score": "0.57641107", "text": "def render\n content\n end", "title": "" }, { "docid": "d4c0df09ec9e61a711424ad523d1f010", "score": "0.57641107", "text": "def render\n content\n end", "title": "" }, { "docid": "d4c0df09ec9e61a711424ad523d1f010", "score": "0.57641107", "text": "def render\n content\n end", "title": "" }, { "docid": "d4c0df09ec9e61a711424ad523d1f010", "score": "0.57641107", "text": "def render\n content\n end", "title": "" }, { "docid": "d4c0df09ec9e61a711424ad523d1f010", "score": "0.57641107", "text": "def render\n content\n end", "title": "" }, { "docid": "d4c0df09ec9e61a711424ad523d1f010", "score": "0.57641107", "text": "def render\n content\n end", "title": "" }, { "docid": "6e425946aecdd9b92fd8a8b42e5c993c", "score": "0.5759439", "text": "def content_for(name, &block)\n eval \"@content_for_#{name} = (@content_for_#{name} || '') + capture(&block)\"\n end", "title": "" }, { "docid": "e00255493063413a42d15fcdbba8a6af", "score": "0.57384306", "text": "def content_for(name, content = nil, &block)\n content = capture(&block) if block_given?\n if content\n if @_subset_content_for && @_subset_content_for[cache_level]\n @_subset_content_for[cache_level][name] << content\n\n # также нужно передать этот контент всем родительским кеш-блокам\n (cache_level - 1).downto(0) do |i|\n @_subset_content_for[i][name] << content\n end\n end\n @view_flow.append(name, content)\n nil\n else\n @view_flow.get(name)\n end\n end", "title": "" }, { "docid": "7f6e024c70794c849dc0a889ab2e0acf", "score": "0.573713", "text": "def format_content\n self.content = cleanup_and_format(self.content)\n end", "title": "" }, { "docid": "ba698c823970cca1f575d4779b350cde", "score": "0.5726291", "text": "def prepend_content(new_content)\n @fields['text'] = new_content + @fields['text']\n self\n end", "title": "" }, { "docid": "1fbdd35679cec210b317b41d74dba404", "score": "0.57243305", "text": "def add_content\n # construct each snippet in setup mode\n run_hook :before_snippet_construct\n snippets.map! { |s| s.new(flavor: self) }\n mark_enabled_snippets\n run_hook :after_snippet_construct\n\n # call hooks to add content\n run_hook :before_add_content\n run_hook :do_add_content\n run_hook :after_add_content\n\n # copy queued content\n run_hook :before_copy_content\n copy_content\n run_hook :after_copy_content\n end", "title": "" }, { "docid": "ea34eff4221e6573427cf697a2da07b1", "score": "0.5715783", "text": "def content!\n ActionController::Base.helpers.sanitize( # for tag completion\n ActionController::Base.helpers.sanitize( # for tag/attrs permission\n content, tags: %w|a dl ul ol li p i b pre|, attributes: %w|href|\n )\n )\n end", "title": "" }, { "docid": "fe50ec080bef817aaa832ab8cb49896d", "score": "0.56929207", "text": "def setContent(content)\r\n\t\t\t\t\t@content = content\r\n\t\t\t\tend", "title": "" }, { "docid": "a2040615a98c5e3c3c6dbc1a6e7cf282", "score": "0.5686697", "text": "def process_template(content)\n ERB.new(content, 0, \"%<>\").result(binding)\n end", "title": "" }, { "docid": "a91925367f273d466dab44e5deaf3a57", "score": "0.567962", "text": "def index\n prepare_content()\n end", "title": "" }, { "docid": "7cba299ebdc654d1aae2d053df133920", "score": "0.5678086", "text": "def content= value\n value = self.class.content_processor.call(value)\n @content = value\n end", "title": "" }, { "docid": "5c6a6ed05a622e7daf6323b513952963", "score": "0.567458", "text": "def wrap_content_in_tag(content)\n PageCell::Template.new {content}.render(view_context)\n end", "title": "" }, { "docid": "14b6a430441fa4b722635196147fd8ba", "score": "0.56698954", "text": "def content\n @_content ||= (view_context.capture(self, &@_content_block) if @_content_block)\n end", "title": "" }, { "docid": "42fedf940ceaaf122d3669dcbd076b4a", "score": "0.5655779", "text": "def render_content(content, type)\n raise StandardError.new('Already built response') if @already_built_response\n \n @res.content_type = type\n @res.body = inject_csrf_fields(content)\n @already_built_response = true\n do_chores\n end", "title": "" }, { "docid": "ffd71a24de47d6af942952d9fba98151", "score": "0.56240326", "text": "def build_content\n []\n end", "title": "" }, { "docid": "fe61dea27ad37d2d6a9e90d4753a288d", "score": "0.56220806", "text": "def setContent()\n\t\tself.children.each do |child|\n\t\t\tself.remove(child)\n\t\tend\n\t\ttoAdd = self.content\n\t\ttoAdd.show_all\n\t\tself.add(toAdd)\n\t\treturn self\n\tend", "title": "" }, { "docid": "b1d12ba906868d1123d6554fbae462f0", "score": "0.56123054", "text": "def content_processor\n @content = STRIP_FEATURES_RE.gsub(@content, '')\n @content = STRIP_MARKET_DATA_WIDGET_RE.gsub(@content, '')\n super\n end", "title": "" }, { "docid": "2de9eed342002abc7f756855babd1a04", "score": "0.56122595", "text": "def build_content(obj,position, with_intro = true)\n\n html = \"\"\n\n obj.each do |pos|\n content = pos\n if(content.displayed?)\n if(position.tpl.blank?)\n html << build_from_content(content, with_intro)\n else\n html << build_from_view_file(content,position.tpl)\n end\n end\n end\n\n html.html_safe\n end", "title": "" }, { "docid": "a1f2017a8ce91e2dd347366a429c593a", "score": "0.56068313", "text": "def rebuild_page_content(locale)\n unless page_part && page_part.template\n raise \"page_part with valid template not available\"\n end\n # page_part = self.page_parts.find_by_page_part_key page_part_key\n\n if page_part.present?\n l_template = Liquid::Template.parse(page_part.template)\n new_fragment_html = l_template.render(\"page_part\" => page_part.block_contents[locale][\"blocks\"])\n # p \"#{page_part_key} content for #{self.slug} page parsed.\"\n # save in content model associated with page\n\n page_fragment_content = find_or_create_content\n # container.contents.find_or_create_by(page_part_key: page_part_key)\n content_html_col = \"raw_\" + locale + \"=\"\n # above is the col used by globalize gem to store localized data\n # page_fragment_content[content_html_col] = new_fragment_html\n page_fragment_content.send content_html_col, new_fragment_html\n page_fragment_content.save!\n\n # set page_part_key value on join model\n page_content_join_model = get_join_model\n # page_fragment_content.page_contents.find_by_page_id self.id\n page_content_join_model.page_part_key = page_part_key\n page_content_join_model.save!\n else\n new_fragment_html = \"\"\n end\n\n new_fragment_html\n end", "title": "" }, { "docid": "e9c8494abf3f26e7172e5fa9d405ba7e", "score": "0.56063914", "text": "def concat_content(content)\n content\n end", "title": "" }, { "docid": "27d05a540d43d0d4c25fb1bf7ce2554f", "score": "0.55862886", "text": "def becomes(superclass)\n object = super\n object.content = render_content if object.respond_to?(:content=)\n object\n end", "title": "" }, { "docid": "648a5c62cc63bc40baa75914abf723f8", "score": "0.55849785", "text": "def content\n @content ||= content!\n end", "title": "" }, { "docid": "e7390e6bf346730d3ce65f05410684b6", "score": "0.5582365", "text": "def content_for(name, &block)\n eval \"@content_for_#{name} = (@content_for_#{name} || '') + (capture(&block) || '')\", binding, __FILE__, __LINE__\n return '' # incase user does <%= content_for ... %>\n end", "title": "" }, { "docid": "ae8d30f0c1c4d7a2805fa4a781defb53", "score": "0.5571442", "text": "def cama_content_append(content)\n @_after_content << content\n end", "title": "" }, { "docid": "1454823843a8a55033b4d23d013f30e2", "score": "0.5562161", "text": "def attributes\n super.merge content_attributes\n end", "title": "" }, { "docid": "10f9c8e4319103b3ca16798a21e758ff", "score": "0.55374044", "text": "def pre_render\n content_tag :div, glyph_and_content_html, html_options\n end", "title": "" }, { "docid": "a0727ba167b9efab2e65b4ff6717a29e", "score": "0.55337423", "text": "def content!\n @content = fetch\n end", "title": "" }, { "docid": "80130cd467c4075d065f4b7ba8c74f8f", "score": "0.55159134", "text": "def content\n case @context\n when :preamble\n @blocks.map {|b| b.render }.join\n # lists get iterated in the template (for now)\n # list items recurse into this block when their text and content methods are called\n when :ulist, :olist, :dlist, :colist\n @buffer\n when :listing, :literal\n apply_literal_subs(@buffer)\n when :pass\n apply_passthrough_subs(@buffer)\n when :admonition, :example, :sidebar, :quote, :verse, :open\n if !@buffer.nil?\n apply_para_subs(@buffer)\n else\n @blocks.map {|b| b.render }.join\n end\n else\n apply_para_subs(@buffer)\n end\n end", "title": "" }, { "docid": "d0444bd62daf75abda4935c4bf9a0957", "score": "0.5515114", "text": "def content\n processed\n end", "title": "" }, { "docid": "22f38e4335d987fb0c022f0b7574a6f6", "score": "0.5513648", "text": "def content=(value)\n @content = value\n end", "title": "" }, { "docid": "22f38e4335d987fb0c022f0b7574a6f6", "score": "0.5513648", "text": "def content=(value)\n @content = value\n end", "title": "" }, { "docid": "22f38e4335d987fb0c022f0b7574a6f6", "score": "0.5513648", "text": "def content=(value)\n @content = value\n end", "title": "" }, { "docid": "22f38e4335d987fb0c022f0b7574a6f6", "score": "0.5513648", "text": "def content=(value)\n @content = value\n end", "title": "" }, { "docid": "22f38e4335d987fb0c022f0b7574a6f6", "score": "0.5513648", "text": "def content=(value)\n @content = value\n end", "title": "" }, { "docid": "22f38e4335d987fb0c022f0b7574a6f6", "score": "0.5513648", "text": "def content=(value)\n @content = value\n end", "title": "" }, { "docid": "22f38e4335d987fb0c022f0b7574a6f6", "score": "0.5513648", "text": "def content=(value)\n @content = value\n end", "title": "" }, { "docid": "22f38e4335d987fb0c022f0b7574a6f6", "score": "0.5513648", "text": "def content=(value)\n @content = value\n end", "title": "" }, { "docid": "24aa23801e855fb7d459639418726886", "score": "0.5498848", "text": "def render\n if @render_only_active_content\n @only_active_content.html_safe\n else\n\n # Wrapper\n @wrapper_html_options ||= {}\n @wrapper_html_options[:\"data-initial-active-tab-id\"] = tab_html_id_for @selected_tab_id\n content_tag(:div, @wrapper_html_options) do\n\n # Tabs list\n @list_html_options ||= {}\n @list_html_options[:class] ||= ''\n @list_html_options[:class] += @list_html_options[:class].empty? ? 'tabs' : ' tabs'\n\n @list_item_html_options ||= {}\n @list_item_html_options[:class] ||= ''\n @list_item_html_options[:class] += @list_item_html_options[:class].empty? ? 'tab' : ' tab'\n\n content_tag(:ul, @list_html_options) do\n @tabs.map do |tab|\n content_tag(:li, tab_li_options(tab)) do\n tab[:html_options][:\"data-tab-type\"] ||= tab[:tab_type] # for javascript: change click behavior depending on type :static, :link or :ajax\n tab[:html_options][:\"data-show-content-id\"] ||= content_html_id_for(tab[:tab_id]) # for javascript: element id to show when select this tab\n tab[:html_options][:\"data-ajax-url\"] ||= tab[:ajax_url] if tab[:tab_type] == :ajax # for javascript: url to make ajax call\n tab[:html_options][:class] ||= ''\n tab[:html_options][:class] += 'active' if tab[:active]\n @template.link_to(tab[:text], tab[:url], tab[:html_options])\n end\n end.join.html_safe\n end +\n\n # Content sections\n @contents.map do |content|\n content_tag(:div, content[:html_options]) do\n content[:content] # this should be blank unless content[:active] or content[:tab_type] == :static\n end\n end.join.html_safe\n end.html_safe\n\n end\n end", "title": "" }, { "docid": "56c8bc9fcceb616ba59b1b1b4413d8f9", "score": "0.5490893", "text": "def set_content(new_content)\r\n self.content = new_content\r\n return self\r\n end", "title": "" }, { "docid": "e7871273911e062926186f8d3dddd838", "score": "0.54894155", "text": "def each_content\n content.each do |content|\n yield content if content\n end\n end", "title": "" }, { "docid": "6ca2a0b9e8506cca096335f89deefe01", "score": "0.5482627", "text": "def single_content_for(name, content = nil, &block)\n @view_flow.set(name, ActiveSupport::SafeBuffer.new)\n content_for(name, content, &block)\n end", "title": "" }, { "docid": "3f7ebeb3916bbcab53757c11c0a4815f", "score": "0.5479511", "text": "def content=(value)\n @content = value\n end", "title": "" }, { "docid": "3f7ebeb3916bbcab53757c11c0a4815f", "score": "0.5479131", "text": "def content=(value)\n @content = value\n end", "title": "" }, { "docid": "3f7ebeb3916bbcab53757c11c0a4815f", "score": "0.5479131", "text": "def content=(value)\n @content = value\n end", "title": "" }, { "docid": "3f7ebeb3916bbcab53757c11c0a4815f", "score": "0.54767954", "text": "def content=(value)\n @content = value\n end", "title": "" }, { "docid": "a6e2117cee3fb5f90b7ff83158bb7a33", "score": "0.54740876", "text": "def render_content(content, type)\n raise 'DOH' if already_rendered?\n @res.body = content\n @res.content_type = type\n session.store_session(@res)\n @already_built_response = true\n nil\n end", "title": "" }, { "docid": "f472c4f5eac433d3de3acfd5ff562b22", "score": "0.5466455", "text": "def content=(value)\n @content = value\n end", "title": "" }, { "docid": "285029648512d8d28d222846fa3e3e1b", "score": "0.54663885", "text": "def content (content)\n\t\t\tself.co(content)\n\t\tend", "title": "" }, { "docid": "6fbbda0ff74b268a8ff410c076fb338b", "score": "0.5462943", "text": "def processed_content\r\n processor(self)\r\n end", "title": "" }, { "docid": "6e2e56000ab0c373ac0a2007c7402a39", "score": "0.5456769", "text": "def start_of_content(object_in_context, main_title)\n render :partial => 'shared/public_pages/content_start',\n :locals => {:object => object_in_context, :main_title => main_title}\n end", "title": "" }, { "docid": "7bd9e050c7e6bca524e30e98ffb86a16", "score": "0.5455156", "text": "def prepare_content\n @posts = []\n @pages = []\n\n # Create a Post for each file in the posts directory\n Dir.entries('posts').each do |f|\n entry = File.join('posts', f)\n if File.file?(entry)\n @posts << Post.new(entry)\n end\n end\n\n # Create a Page for each file in the pages directory\n Dir.entries('pages').each do |f|\n entry = File.join('pages', f)\n if File.file?(entry)\n @pages << Page.new(entry)\n end\n end\n\n save_metadata\n\n # Sort the posts by date, with most recent first\n @posts.sort_by! { |post| post[:date] }\n @posts.reverse!\n end", "title": "" }, { "docid": "26bc61b42b53e0e07b7eced226010be8", "score": "0.54532284", "text": "def content\n buffer = [].tap do |content|\n source_list.each_chapter do |files|\n content << %[<div class=\"chapter\">#{render_chapter(files)}</div>]\n end\n end\n\n buffer.join\n end", "title": "" }, { "docid": "8754e461ab99fc24ab8f9154e15d55b8", "score": "0.5451734", "text": "def default_content_for(view, &block)\n if get_content_for(view).blank?\n # puts \"content blank\"\n eval \"@content_for_#{view.to_s} = capture(&block)\"\n end\n # puts \"yielding #{view}, content should be \" + eval(\"@content_for_#{view.to_s}\").inspect\n concat(eval(\"yield :#{view.to_s}\", block.binding), block.binding)\n end", "title": "" }, { "docid": "9be4a1dad35942373d26cd8a71458b9c", "score": "0.54471713", "text": "def format_content\n\t\tcontent\n\tend", "title": "" }, { "docid": "9b3006d2c2bbb260d6c41e5784122704", "score": "0.54312766", "text": "def prepare_content(site, content, language)\n\n # Handle nil content.\n if !content\n content = ''\n end\n\n # Strip whitespace.\n content = content.strip\n # Translate if needed.\n content = opensdg_translate_key(content, site.data['translations'], language)\n # Next compile any Markdown.\n converter = site.find_converter_instance(::Jekyll::Converters::Markdown)\n content = converter.convert(content)\n # Now strip any HTML.\n content = content.gsub(/<\\/?[^>]*>/, \"\")\n return content\n end", "title": "" }, { "docid": "2602016a60ad9470d023a4dfdd030cf4", "score": "0.5423191", "text": "def content # :nodoc:\n @content.dup\n end", "title": "" }, { "docid": "8245109c70d4149948cc62a902ce7da3", "score": "0.54191095", "text": "def associate_related_content(content)\n return if params.dig(:content, :content_to_content).blank?\n\n content.content_to_content = []\n content_params[:content_to_content]&.each do |content_to_content|\n content.content_to_content << content_to_content\n end\n end", "title": "" }, { "docid": "e9bb5e3312bf2a5b78553bb14ad9317a", "score": "0.5410032", "text": "def set_content\n self.content = 'Default Content' if self.content.nil?\n # self.content ||= 'Default Content'\n end", "title": "" }, { "docid": "98e687590ddabd88165898a83704fe30", "score": "0.54093695", "text": "def process\n replace_tag_into_template! 'genit.news', news_content\n end", "title": "" }, { "docid": "6278d60259d7d9f0f8309fd3333b3141", "score": "0.54067886", "text": "def content\n case @content\n when Proc\n result = @builder.resolve(&@content)\n\n if @builder.nested?\n \"\\n#{@builder}\\n\"\n else\n \"\\n#{Utils::Escape.html(result)}\\n\"\n end\n else\n Utils::Escape.html(@content)\n end\n end", "title": "" }, { "docid": "a177ec4902818140666ba13e4b386931", "score": "0.54030365", "text": "def render_content_tag_for(items)\n @template.content_tag(@options[:list_tag], class: @options[:list_class]) do\n items.collect do |item|\n @template.concat(@template.content_tag(@options[:item_tag], item, class: @options[:item_class]))\n end\n end\n end", "title": "" }, { "docid": "1abe09d38ac4dc731b538becbe0188de", "score": "0.5401648", "text": "def prepare_content_for(target, notification_index, params)\n content_for :notification_index do\n @target = target\n begin\n render_notification notification_index, params\n rescue ActionView::MissingTemplate\n params.delete(:target)\n render_notification notification_index, params\n end\n end\n end", "title": "" }, { "docid": "01472e5e820b74dce6d0b4875a43fbdf", "score": "0.5400171", "text": "def content=(content)\n @content = content\n end", "title": "" }, { "docid": "7526e174c1eae082d114298c41a3726f", "score": "0.539761", "text": "def decorate_content content, options = {}\n return unless content\n\n doc = Nokogiri::HTML.fragment('<div>' << content << '</div>')\n\n yield doc\n\n if footer = options[:footer]\n content_div = doc.css('> .content')\n\n if content_div.length > 0\n content_div.children.last.after footer\n end\n end\n\n # Unwrap additional block level elements inside p\n doc.search('p > article, p > figure, p > section').each do |node|\n node.parent.replace(node)\n end\n\n doc.child.inner_html\n end", "title": "" }, { "docid": "76dd38a947c1c5af3f9585e9de481052", "score": "0.539045", "text": "def render_content(content, type)\n ensure_no_double_render\n session.store_session(res)\n\n @res.content_type = type\n @res.body = content\n @already_built_response = true\n end", "title": "" }, { "docid": "54ee2710aa61e4c54770ebe4adff233a", "score": "0.53903145", "text": "def content\n View.render\n ensure\n self.class.reset\n end", "title": "" } ]
67f60b164f890751c238ace6ae6027ac
Determines how the Fighter should select the item and on whom during battle (Use command). Return nil on error.
[ { "docid": "148364ec7f5c7ec32c525d1cd5e5f227", "score": "0.5495615", "text": "def choose_item_and_on_whom(enemy)\n C[@inventory.random_item, [self, enemy].sample]\n end", "title": "" } ]
[ { "docid": "ed4ebbb354c0eca052e10dd66c29a1b7", "score": "0.72764426", "text": "def choice_a_battle\n use_item_in_battle\n end", "title": "" }, { "docid": "35135efe5775a198c1e5cef4d7430ccc", "score": "0.6758379", "text": "def select_for_item(item)\n @cursor_fix = item.for_user?\n @cursor_all = item.for_all?\n if @cursor_fix\n select($game_party.menu_actor.index)\n elsif @cursor_all\n select(0)\n else\n select_last\n end\n end", "title": "" }, { "docid": "8596a853d85801c06abb1fc8967bbef5", "score": "0.6646038", "text": "def choose_item_and_on_whom(enemy)\n index = nil\n item = nil\n\n # Choose the item to use.\n while !index\n print_inventory\n puts \"Which item would you like to use?\"\n input = player_input prompt: \"(or type 'pass' to forfeit the turn): \"\n\n return if (input.casecmp(\"pass\").zero?)\n\n index = has_item(input)\n\n if !index\n print NO_SUCH_ITEM_ERROR\n else\n item = @inventory[index].first\n end\n end\n\n whom = nil\n\n # Choose on whom to use the item.\n while !whom\n puts \"On whom will you use the item (#{@name} or #{enemy.name})?\"\n input = player_input prompt: \"(or type 'pass' to forfeit the turn): \"\n\n return if (input.casecmp(\"pass\").zero?)\n\n if (input.casecmp(@name).zero?)\n whom = self\n elsif (input.casecmp(enemy.name).zero?)\n whom = enemy\n else\n print \"What?! Choose either #{@name} or #{enemy.name}!\\n\\n\"\n end\n end\n\n return C[item, whom]\n end", "title": "" }, { "docid": "8ad6c309a4df8e4e2ab9a8eeafc5fdb4", "score": "0.64643097", "text": "def use_item\n\n if @inventory.empty?\n slow_type(\"\\nYou don't have anything in your inventory\")\n\n else\n print_inventory_items\n\n use_item = TTY::Prompt.new\n\n choices = []\n @options = []\n @inventory.each do |item_id|\n inventory_item = find_item_by_id(item_id)\n choices << { name: inventory_item.name, value: inventory_item.item_id }\n end\n\n item_id = use_item.select(slow_type(\"\\nWhat would you like to use?\"), choices)\n \n selected_item = find_item_by_id(item_id)\n \n use_on = TTY::Prompt.new\n\n choices = []\n @options = []\n current_cell_items.each do |item_id|\n item = find_item_by_id(item_id)\n choices << { name: item.name, value: item.item_id } unless @inventory.include?(item.item_id) || item.show_item == false\n end\n\n target_item = use_on.select(slow_type(\"\\nWhat would you like to use the #{selected_item.name} on?\"), choices)\n\n combo = @use_combos.find { |combo| combo[:item_id] == item_id && combo[:usage_location] == @current_room_id && combo[:target_id] == target_item}\n \n if combo.nil?\n slow_type(\"\\nYou cannot use these two items together\") \n \n else \n use_item_dependency(item_id)\n slow_type(combo[:message])\n\n if combo[:cell_to_unlock]\n find_room_by_id(combo[:cell_to_unlock]).isLocked = false\n game_complete if combo[:game_complete]\n\n elsif\n combo[:knocked_out]\n @guard_is_knocked_out = true\n end\n\n end\n end\n end", "title": "" }, { "docid": "b16622f741919ab0b5bbdbd13da601c7", "score": "0.645522", "text": "def choose_item_and_on_whom(enemy)\n index = nil\n item = nil\n\n # Choose the item to use.\n while !index\n print_inventory\n puts \"Which item would you like to use?\"\n print \"(or type 'pass' to forfeit the turn): \"\n input = gets.chomp\n\n print \"\\n\"\n\n return if (input.casecmp(\"pass\").zero?)\n\n index = has_item(input)\n\n if !index\n print \"What?! You don't have THAT!\\n\\n\"\n else\n item = @inventory[index].first\n end\n end\n\n whom = nil\n\n # Choose on whom to use the item.\n while !whom\n puts \"On whom will you use the item (#{@name} or #{enemy.name})?\"\n print \"(or type 'pass' to forfeit the turn): \"\n input = gets.chomp\n\n print \"\\n\"\n\n return if (input.casecmp(\"pass\").zero?)\n\n if (input.casecmp(@name).zero?)\n whom = self\n elsif (input.casecmp(enemy.name).zero?)\n whom = enemy\n else\n print \"What?! Choose either #{@name} or #{enemy.name}!\\n\\n\"\n end\n end\n\n return Couple.new(item, whom)\n end", "title": "" }, { "docid": "e81030521b32e2216fb2f5878d4dedcb", "score": "0.6378931", "text": "def determine_mix_target_yea_abe\n @item = @mix_window.mix_result\n $game_temp.battle_aid = @item\n BattleManager.actor.input.set_item(@item.id)\n if @item.for_opponent?\n select_enemy_selection\n elsif @item.for_friend?\n select_actor_selection\n else\n set_actor_mix_items # mix\n next_command\n $game_temp.battle_aid = nil\n end\n end", "title": "" }, { "docid": "b20e24343192e94ef9dea41de101e993", "score": "0.62441415", "text": "def choice_a_menu\n item_id = @item_list[@index]\n return action_b if item_id.nil?\n return play_buzzer_se if item_id == 0\n play_decision_se\n show_shadow_frame\n # Prepare the choice info\n # Use option\n map_usable = proc { !GameData::Item[item_id].map_usable }\n # Give option\n giv_check = proc { $pokemon_party.pokemon_alive <= 0 || !GameData::Item[item_id].holdable }\n # Unregister / register\n if $bag.shortcuts.include?(item_id)\n reg_id = 14\n reg_meth = method(:unregister_item)\n else\n reg_id = 2\n reg_meth = method(:register_item)\n reg_check = map_usable\n end\n # Throw option\n thr_check = proc { !GameData::Item[item_id].limited }\n # Create the choice\n choices = PFM::Choice_Helper.new(Yuki::ChoiceWindow::But, true, 999)\n choices.register_choice(text_get(22, 0), on_validate: method(:use_item), disable_detect: map_usable)\n .register_choice(text_get(22, 3), on_validate: method(:give_item), disable_detect: giv_check)\n .register_choice(text_get(22, reg_id), on_validate: reg_meth, disable_detect: reg_check)\n .register_choice(text_get(22, 1), on_validate: method(:throw_item), disable_detect: thr_check)\n .register_choice(text_get(22, 7))\n # Show selection : item_name\n @base_ui.show_win_text(parse_text(22, 35, PFM::Text::ITEM2[0] => GameData::Item[item_id].exact_name))\n # Process the actual choice\n y = 200 - 16 * choices.size\n choices.display_choice(@viewport, 306, y, nil, on_update: method(:update_graphics), align_right: true)\n @base_ui.hide_win_text\n hide_shadow_frame\n end", "title": "" }, { "docid": "b2bca8bedeee54b359561036ee56d0c3", "score": "0.6217482", "text": "def item_can_use?(item)\n return false unless item.is_a?(RPG::Item)\n return false if item_number(item) == 0\n if $game_temp.in_battle\n return item.battle_ok?\n else\n return item.menu_ok?\n end\n end", "title": "" }, { "docid": "fca4a013a7db11ed956f94256d65dc58", "score": "0.6080119", "text": "def update_phase3_item_select\r\n # Make item window visible\r\n @item_window.visible = true\r\n # If B button was pressed\r\n if Input.trigger?(Input::B)\r\n # Play cancel SE\r\n $game_system.se_play($data_system.cancel_se)\r\n # End item selection\r\n end_item_select\r\n return\r\n end\r\n # If C button was pressed\r\n if Input.trigger?(Input::C)\r\n # Get currently selected data on the item window\r\n @item = @item_window.item\r\n # If it can't be used\r\n unless $game_party.item_can_use?(@item.id)\r\n # Play buzzer SE\r\n $game_system.se_play($data_system.buzzer_se)\r\n return\r\n end\r\n # Play decision SE\r\n $game_system.se_play($data_system.decision_se)\r\n # Set action\r\n @active_battler.current_action.item_id = @item.id\r\n # Make item window invisible\r\n @item_window.visible = false\r\n @item_window.active = false\r\n # If effect scope is single enemy\r\n if @item.scope == 1\r\n # Start enemy selection\r\n start_enemy_select\r\n # If effect scope is single ally\r\n elsif @item.scope == 3 or @item.scope == 5\r\n # Start actor selection\r\n start_actor_select\r\n # If effect scope is not single\r\n else\r\n # End item selection\r\n end_item_select\r\n # Go to command input for next actor\r\n phase3_next_actor\r\n end\r\n return\r\n end\r\n end", "title": "" }, { "docid": "311c8e0c7b5055060fcb67b552b5272e", "score": "0.5993221", "text": "def determine_mix_target\n if $imported[\"YEA-BattleCommandList\"]\n determine_mix_target_yea_bcl\n elsif $imported[\"YEA-BattleEngine\"]\n determine_mix_target_yea_abe\n else # default battle system\n @item = @mix_window.mix_result\n BattleManager.actor.input.set_item(@item.id)\n \n if !@item.need_selection?\n set_actor_mix_items # mix\n next_command\n elsif @item.for_opponent?\n select_enemy_selection\n else\n select_actor_selection\n end # if\n end # if\n end", "title": "" }, { "docid": "a3e6749620021e879b16275834684233", "score": "0.59843963", "text": "def update_phase3_item_select\n # Make item window visible\n @item_window.visible = true\n # Update item window\n @item_window.update\n # If B button was pressed\n if Input.trigger?(Input::B)\n # Play cancel SE\n $game_system.se_play($data_system.cancel_se)\n # End item selection\n end_item_select\n return\n end\n # If C button was pressed\n if Input.trigger?(Input::C)\n # Get currently selected data on the item window\n @item = @item_window.item\n # If it can't be used\n unless $game_party.item_can_use?(@item.id)\n # Play buzzer SE\n $game_system.se_play($data_system.buzzer_se)\n return\n end\n # Play decision SE\n $game_system.se_play($data_system.decision_se)\n # Set action\n @active_battler.current_action.item_id = @item.id\n # Make item window invisible\n @item_window.visible = false\n # If effect scope is single enemy\n if @item.scope == 1\n # Start enemy selection\n start_enemy_select\n # If effect scope is single ally\n elsif @item.scope == 3 or @item.scope == 5\n # Start actor selection\n start_actor_select\n # If effect scope is not single\n else\n # End item selection\n end_item_select\n # Go to command input for next actor\n phase3_next_actor\n end\n return\n end\n end", "title": "" }, { "docid": "b747d3c4784df612bf9d4ad12b716882", "score": "0.5945014", "text": "def usable?(item)\n return false if item.nil?\n tb = battler\n return tb.usable?(item) # tb.is_a?(Game_Actor) ? <- : false\n end", "title": "" }, { "docid": "790e5eb8c87519d7979001131ab6e30c", "score": "0.59319514", "text": "def actions\n answer = @prompt.select(\"Where will you go?\", %w(Foward Back Status Items), cycle:true, per_page:4)\n if answer == \"Foward\"\n if @zone_cur == 10\n narrate(\"you leave the #{self.name}\")\n leave(self.exit_name)\n else\n @zone_cur += 1\n narrate(\"you continue foward\")\n encounter_check\n end\n elsif answer == \"Back\"\n if @zone_cur == 0\n narrate(\"you leave the #{self.name}\")\n leave(self.entrance_name)\n else\n @zone_cur -= 1\n narrate(\"you retreat backwards\")\n encounter_check\n end\n elsif answer == 'Status'\n narrate(\"#{@player.name} has #{@player.hp} hp, #{@player.attack} attack, and #{@player.defence} defence\")\n str = \"\"\n a = @player.equipment.map do |el|\n el.name\n end\n b = a.join(\", \")\n narrate(\"#{@player.name} has the following items equipped: #{b}\")\n here\n elsif answer == 'Items'\n answer = @prompt.select(\"Items Menu\", %w(Equip_item Look_item), cycle:true, per_page:4)\n if answer == 'Equip_item'\n #list inventory\n stuff = @player.items.map do |el|\n el.name\n end\n #select an item from inventory\n answer = @prompt.select(\"Items Menu\", stuff, cycle:true, per_page:4)\n #find that item again\n to_eq = @player.items.find do |el|\n el.name == answer\n end\n binding.pry\n #equip that item\n @player.equip(to_eq)\n narrate( \"You have equipped the #{to_eq.name}!\")\n actions\n end\n end\n end", "title": "" }, { "docid": "c9e3b9c0f628f5c0ab6ef6c32dd10a7f", "score": "0.5928257", "text": "def select_tb_unit(x,y)\n tm = TactBattleManager\n return tm.set_selecting_target(false) if !(@hl_att_points||={})[Vertex.new(x,y)]\n tbu = @tb_event.tb_unit\n is_skill = @tb_item.is_a?(RPG::Skill)\n b = @tb_event.tb_unit.battler\n tl = tbu.tb_actions[:targets]\n type = nil\n if is_skill && @tb_item.id == b.basic_atk_tb\n lmt = tbu.tb_actions[:atk]\n return end_select if !tbu.atk_ok? # lmt >= tbu.atk_action_lmt || tl >= tbu.target_tb_lmt\n type = :atk\n elsif is_skill\n lmt = tbu.tb_actions[:skill]\n return end_select if !tbu.skill_ok? # lmt >= tbu.skill_action_lmt || tl>=tbu.target_tb_lmt\n type = :skill\n else\n lmt = tbu.tb_actions[:item]; \n return end_select if !tbu.item_ok? # lmt >= tbu.item_action_lmt || tl>=tbu.target_tb_lmt\n type = :item\n end\n \n map = $game_map \n res, use = false, false\n dir = @tb_event.dir_to_sym_era\n \n if @tb_item.tb_aoe\n use = Era::AI.apply_aoe_item(x,y,@tb_item, @tb_event.id, dir)\n else\n use = Era::AI.apply_item(x,y,@tb_item, @tb_event.id, dir)\n end\n \n if use\n @tb_event.tb_unit.use_item(@tb_item)\n tbu.used_action(type,1)\n tbu.lose_item(@tb_item, 1)\n end\n reset_aoe_follows\n # @spriteset.remove_group(DISPLAY_TB) # @spriteset.dispose_highlights_tb # for now remove all highlights\n remove_show_hls\n end_select\n end", "title": "" }, { "docid": "a8f196732fe19d376c49030ac85f638a", "score": "0.5921408", "text": "def item_choice\n item_id, target = @visual.show_item_choice\n if item_id\n # The player made a choice we store the action and we check if he can make other choices\n @player_actions << { type: :item, item_id: item_id, target: target, bag: @logic.bags[0] }\n log_debug(\"Action : #{@player_actions.last}\") if debug? # To prevent useless overhead outside debug\n @next_update = can_player_make_another_action_choice? ? :player_action_choice : :trigger_all_AI\n else\n # If the player canceled we return to the player action\n @next_update = :player_action_choice\n end\n end", "title": "" }, { "docid": "ceaf57e8946abfdedc4b91c6f191b6f7", "score": "0.58893013", "text": "def pbItemMenu(idxBattler,_firstAction)\r\n # Fade out and hide all sprites\r\n visibleSprites = pbFadeOutAndHide(@sprites)\r\n # Set Bag starting positions\r\n oldLastPocket = $PokemonBag.lastpocket\r\n oldChoices = $PokemonBag.getAllChoices\r\n $PokemonBag.lastpocket = @bagLastPocket if @bagLastPocket!=nil\r\n $PokemonBag.setAllChoices(@bagChoices) if @bagChoices!=nil\r\n # Start Bag screen\r\n itemScene = PokemonBag_Scene.new\r\n itemScene.pbStartScene($PokemonBag,true,Proc.new { |item|\r\n useType = GameData::Item.get(item).battle_use\r\n next useType && useType>0\r\n },false)\r\n # Loop while in Bag screen\r\n wasTargeting = false\r\n loop do\r\n # Select an item\r\n item = itemScene.pbChooseItem\r\n break if !item\r\n # Choose a command for the selected item\r\n item = GameData::Item.get(item)\r\n itemName = item.name\r\n useType = item.battle_use\r\n cmdUse = -1\r\n commands = []\r\n commands[cmdUse = commands.length] = _INTL(\"Use\") if useType && useType!=0\r\n commands[commands.length] = _INTL(\"Cancel\")\r\n command = itemScene.pbShowCommands(_INTL(\"{1} is selected.\",itemName),commands)\r\n next unless cmdUse>=0 && command==cmdUse # Use\r\n # Use types:\r\n # 0 = not usable in battle\r\n # 1 = use on Pokémon (lots of items), consumed\r\n # 2 = use on Pokémon's move (Ethers), consumed\r\n # 3 = use on battler (X items, Persim Berry), consumed\r\n # 4 = use on opposing battler (Poké Balls), consumed\r\n # 5 = use no target (Poké Doll, Guard Spec., Launcher items), consumed\r\n # 6 = use on Pokémon (Blue Flute), not consumed\r\n # 7 = use on Pokémon's move, not consumed\r\n # 8 = use on battler (Red/Yellow Flutes), not consumed\r\n # 9 = use on opposing battler, not consumed\r\n # 10 = use no target (Poké Flute), not consumed\r\n case useType\r\n when 1, 2, 3, 6, 7, 8 # Use on Pokémon/Pokémon's move/battler\r\n # Auto-choose the Pokémon/battler whose action is being decided if they\r\n # are the only available Pokémon/battler to use the item on\r\n case useType\r\n when 1, 6 # Use on Pokémon\r\n if @battle.pbTeamLengthFromBattlerIndex(idxBattler)==1\r\n break if yield item.id, useType, @battle.battlers[idxBattler].pokemonIndex, -1, itemScene\r\n end\r\n when 3, 8 # Use on battler\r\n if @battle.pbPlayerBattlerCount==1\r\n break if yield item.id, useType, @battle.battlers[idxBattler].pokemonIndex, -1, itemScene\r\n end\r\n end\r\n # Fade out and hide Bag screen\r\n itemScene.pbFadeOutScene\r\n # Get player's party\r\n party = @battle.pbParty(idxBattler)\r\n partyPos = @battle.pbPartyOrder(idxBattler)\r\n partyStart, _partyEnd = @battle.pbTeamIndexRangeFromBattlerIndex(idxBattler)\r\n modParty = @battle.pbPlayerDisplayParty(idxBattler)\r\n # Start party screen\r\n pkmnScene = PokemonParty_Scene.new\r\n pkmnScreen = PokemonPartyScreen.new(pkmnScene,modParty)\r\n pkmnScreen.pbStartScene(_INTL(\"Use on which Pokémon?\"),@battle.pbNumPositions(0,0))\r\n idxParty = -1\r\n # Loop while in party screen\r\n loop do\r\n # Select a Pokémon\r\n pkmnScene.pbSetHelpText(_INTL(\"Use on which Pokémon?\"))\r\n idxParty = pkmnScreen.pbChoosePokemon\r\n break if idxParty<0\r\n idxPartyRet = -1\r\n partyPos.each_with_index do |pos,i|\r\n next if pos!=idxParty+partyStart\r\n idxPartyRet = i\r\n break\r\n end\r\n next if idxPartyRet<0\r\n pkmn = party[idxPartyRet]\r\n next if !pkmn || pkmn.egg?\r\n idxMove = -1\r\n if useType==2 || useType==7 # Use on Pokémon's move\r\n idxMove = pkmnScreen.pbChooseMove(pkmn,_INTL(\"Restore which move?\"))\r\n next if idxMove<0\r\n end\r\n break if yield item.id, useType, idxPartyRet, idxMove, pkmnScene\r\n end\r\n pkmnScene.pbEndScene\r\n break if idxParty>=0\r\n # Cancelled choosing a Pokémon; show the Bag screen again\r\n itemScene.pbFadeInScene\r\n when 4, 9 # Use on opposing battler (Poké Balls)\r\n idxTarget = -1\r\n if @battle.pbOpposingBattlerCount(idxBattler)==1\r\n @battle.eachOtherSideBattler(idxBattler) { |b| idxTarget = b.index }\r\n break if yield item.id, useType, idxTarget, -1, itemScene\r\n else\r\n wasTargeting = true\r\n # Fade out and hide Bag screen\r\n itemScene.pbFadeOutScene\r\n # Fade in and show the battle screen, choosing a target\r\n tempVisibleSprites = visibleSprites.clone\r\n tempVisibleSprites[\"commandWindow\"] = false\r\n tempVisibleSprites[\"targetWindow\"] = true\r\n idxTarget = pbChooseTarget(idxBattler,GameData::Target.get(:Foe),tempVisibleSprites)\r\n if idxTarget>=0\r\n break if yield item.id, useType, idxTarget, -1, self\r\n end\r\n # Target invalid/cancelled choosing a target; show the Bag screen again\r\n wasTargeting = false\r\n pbFadeOutAndHide(@sprites)\r\n itemScene.pbFadeInScene\r\n end\r\n when 5, 10 # Use with no target\r\n break if yield item.id, useType, idxBattler, -1, itemScene\r\n end\r\n end\r\n @bagLastPocket = $PokemonBag.lastpocket\r\n @bagChoices = $PokemonBag.getAllChoices\r\n $PokemonBag.lastpocket = oldLastPocket\r\n $PokemonBag.setAllChoices(oldChoices)\r\n # Close Bag screen\r\n itemScene.pbEndScene\r\n # Fade back into battle screen (if not already showing it)\r\n pbFadeInAndShow(@sprites,visibleSprites) if !wasTargeting\r\n end", "title": "" }, { "docid": "30e1c8b2a4406ffe8dd0a9e2e3fce56c", "score": "0.5881104", "text": "def user_select(items)\n h.choose do |menu|\n menu.index = :number\n menu.prompt = 'Please Choose One:'\n menu.select_by = :index_or_name\n items.each do |item|\n menu.choice item.to_sym do |command|\n ui.msg \"Using: #{command}\"\n selected = command.to_s\n end\n end\n menu.choice :all do return :all end\n menu.choice :exit do exit 1 end\n end\n end", "title": "" }, { "docid": "d1b0e285b7d6bd4960ec6d35b72eeec2", "score": "0.5830982", "text": "def select_space\n play_defense or play_offense\n end", "title": "" }, { "docid": "d59bb17c45c16256b20b8713144ecf8a", "score": "0.58078843", "text": "def user_select(items)\n choose do |menu|\n menu.index = :number\n menu.prompt = \"Please Choose One:\"\n menu.select_by = :index_or_name\n items.each do |item|\n menu.choice item.to_sym do |command| \n say \"Using: #{command}\" \n selected = command.to_s\n end\n end\n menu.choice :exit do exit 1 end\n end\n end", "title": "" }, { "docid": "b9ccccccb2f91bc5dc59c8f3ea2270f5", "score": "0.57639277", "text": "def valid_item\n @windows[Win_Help].move_to(2)\n #@windows[Win_Help].show\n @active_battler.current_action.clear\n @active_battler.current_action.set_item(@item.id)\n if @item.for_dead_friend? and !$game_system.actors_bodies? \n if $game_map.passable?(@cursor.x, @cursor.y, 0) and\n (occupied_by?(@cursor.x, @cursor.y) == nil)\n open_revive_window\n end\n else\n @active_battler.current_action.set_item(@item.id)\n @targets = get_targets\n if @targets.empty?\n Sound.play_buzzer\n else\n Sound.play_decision\n @cursor.active = false \n @windows[Win_Confirm].ask(Command_Confirm::Item) \n @windows[Win_Status].dmg_preview(3, @active_battler, @item, @targets)\n @windows[Win_Help].move_to(2)\n #@windows[Win_Help].show\n end\n end\n end", "title": "" }, { "docid": "ac6f74e275e56a9aaf2b368d659a5198", "score": "0.5761947", "text": "def determine_mix_target_yea_bcl\n @item = @mix_window.mix_result\n BattleManager.actor.input.set_item(@item.id)\n\n status_redraw_target(BattleManager.actor)\n if $imported[\"YEA-BattleEngine\"]\n $game_temp.battle_aid = @item\n if @item.for_opponent?\n select_enemy_selection\n elsif @item.for_friend?\n select_actor_selection\n else\n set_actor_mix_items # mix\n next_command\n $game_temp.battle_aid = nil\n end\n else\n if !@item.need_selection?\n set_actor_mix_items # mix\n next_command\n elsif @item.for_opponent?\n select_enemy_selection\n else\n select_actor_selection\n end\n end\n end", "title": "" }, { "docid": "090ce0b28e04463ca4d3d5c642edfcba", "score": "0.5757619", "text": "def use_item(item)\n battler.use_item(item)\n end", "title": "" }, { "docid": "0c37ddab3ebb5b6e9619a3af49e085ff", "score": "0.5743584", "text": "def item_target_candidates\r\n if item.for_opponent?\r\n opponents_unit.alive_members\r\n elsif item.for_user?\r\n [subject]\r\n elsif item.for_dead_friend?\r\n friends_unit.dead_members\r\n else\r\n friends_unit.alive_members\r\n end\r\n end", "title": "" }, { "docid": "71500ed13433016351a2896a447863d9", "score": "0.5735295", "text": "def menu_choice(action)\n if action == \"a\"\n @humanplayer.search_weapon\n elsif action == \"s\"\n @humanplayer.search_health_pack\n elsif action == \"1\"\n @humanplayer.attack(@player_1)\n elsif action == \"2\"\n @humanplayer.attack(@player_2)\n elsif action == \"3\"\n @humanplayer.attack(@player_3)\n elsif action == \"4\"\n @humanplayer.attack(@player_4)\n else puts \"Please select option a, s, 1, 2, 3 or 4\"\n end\n\n kill_player\n end", "title": "" }, { "docid": "3c8e7f31603b0821c86679d76f68545b", "score": "0.57227045", "text": "def update_selected \n #no select when exiting\n if @battle_exiting\n @selected = nil\n \n #fast update if @cursor didn't change position\n elsif @selected.nil? or not @selected.at_xy_coord(@cursor.x, @cursor.y) \n @selected = nil\n battler = $game_map.occupied_by?(@cursor.x, @cursor.y)\n if battler != nil\n #for battler in tactics_all\n # next if battler.nil? \n # if battler.at_xy_coord(@cursor.x, @cursor.y)\n @selected = battler\n @windows[Win_Status].update(battler)\n #Modified to be hard coded to top right checking. \n mx = Graphics.width - @windows[Win_Status].width\n mw = Graphics.width\n my = 0\n mv = @windows[Win_Status].height\n if @spriteset.cursor.x.between?(mx, mw) && @spriteset.cursor.y.between?(my,mv)\n @windows[Win_Status].move_to(3); #lower right\n else\n @windows[Win_Status].move_to(9); #upper right // Default\n end\n return\n # end\n end \n end\n end", "title": "" }, { "docid": "458329ccd8d83454ed8c34af634183bf", "score": "0.57053053", "text": "def fo_tool\n return actor.equips[0] if actor.primary_use == 1\n return actor.equips[1] if actor.primary_use == 2\n return actor.assigned_item if actor.primary_use == 3\n return actor.assigned_item2 if actor.primary_use == 4\n return actor.assigned_item3 if actor.primary_use == 5\n return actor.assigned_item4 if actor.primary_use == 6\n return actor.assigned_skill if actor.primary_use == 7\n return actor.assigned_skill2 if actor.primary_use == 8\n return actor.assigned_skill3 if actor.primary_use == 9\n return actor.assigned_skill4 if actor.primary_use == 10\n end", "title": "" }, { "docid": "4b65d8f04566038a5b8eaf62221916b9", "score": "0.570282", "text": "def tbs_use_item_era(item)\n \n tb = TactBattleManager.tact_battle?\n ch_tar = tb && TactBattleManager.selecting_target? # remove\n \n # Case during a tact battle, and not selecting a target\n if tb && !ch_tar\n return if (tb_event = $game_temp.tb_event).nil?\n dir = tb_event.dir_to_sym_era\n r1,r2 = item.tbs_spec_range, item.tbs_simple_range\n \n range = r1.nil? ? r2 : r1[dir]\n return no_range_set_tb(item) if r1.nil? && r2.nil?\n \n if r1.nil?\n if self.is_a?(Game_Actor)\n \n n,m = item.tb_range_min-1, item.tb_range_max-1\n range=Unit_Range.points(0,0,eqp_r_min(item) + n,eqp_r_max(item)+m)\n else; range = r2; end\n else; range = r1[dir]; end\n \n if !range.nil?\n range = relative_range_era(range)\n $game_map.next_att_highlights(range, item.tbs_hl_color)\n end\n \n # instead of doing this here, alias use_item inside game_battler, and call\n # it twice. Once when using the item initially, and then again after the\n # target has been selected.\n TactBattleManager.set_selecting_target(true)\n $game_temp.tb_item = item\n \n if !SceneManager.scene.is_a?(Scene_Map) && SceneManager.get_stack.size > 0\n SceneManager.return \n end\n # SceneManager.return # <= this fucking line of code... omfg wow.. fucking noob shit\n # was causing SceneManager to pop off last scene from stack\n # and seemingly exit strangely. Scariest error of my life,\n # had no call stack to debug with\n end\n end", "title": "" }, { "docid": "4e3abdd0b63857d9a15654b6b6de6638", "score": "0.56445354", "text": "def phase3_command_item\r\n # Set action\r\n @active_battler.current_action.kind = 2\r\n # Start item selection\r\n start_item_select\r\n end", "title": "" }, { "docid": "5357b084ed424593b013b0f345bd4a79", "score": "0.56363785", "text": "def update_item_selection\n if Input.trigger?(Input::B)\n Sound.play_cancel\n return_scene\n elsif Input.trigger?(Input::C)\n @item = @item_window.item\n if @item != nil\n $game_party.last_item_id = @item.id\n end\n if $game_party.item_can_use?(@item)\n Sound.play_decision\n determine_item\n else\n Sound.play_buzzer\n end\n elsif Input.repeat?(Input::DOWN) || Input.repeat?(Input::UP) ||\n Input.repeat?(Input::LEFT) || Input.repeat?(Input::RIGHT)\n update_detail_window(@item_window.selected_item)\n elsif (Input.repeat?(Input::Y) || Input.repeat?(Input::Z))\n update_dataview_select(Input.press?(Input::Z), \n Input.trigger?(Input::Y) || Input.trigger?(Input::Z))\n @item_window.window_update($game_party.items, @dataviews_window.selected_view)\n @item_window.index = 0\n update_detail_window(@item_window.selected_item)\n end\n end", "title": "" }, { "docid": "5357b084ed424593b013b0f345bd4a79", "score": "0.56363785", "text": "def update_item_selection\n if Input.trigger?(Input::B)\n Sound.play_cancel\n return_scene\n elsif Input.trigger?(Input::C)\n @item = @item_window.item\n if @item != nil\n $game_party.last_item_id = @item.id\n end\n if $game_party.item_can_use?(@item)\n Sound.play_decision\n determine_item\n else\n Sound.play_buzzer\n end\n elsif Input.repeat?(Input::DOWN) || Input.repeat?(Input::UP) ||\n Input.repeat?(Input::LEFT) || Input.repeat?(Input::RIGHT)\n update_detail_window(@item_window.selected_item)\n elsif (Input.repeat?(Input::Y) || Input.repeat?(Input::Z))\n update_dataview_select(Input.press?(Input::Z), \n Input.trigger?(Input::Y) || Input.trigger?(Input::Z))\n @item_window.window_update($game_party.items, @dataviews_window.selected_view)\n @item_window.index = 0\n update_detail_window(@item_window.selected_item)\n end\n end", "title": "" }, { "docid": "6d3d46d9bd420cd2ac912230c146d66c", "score": "0.5599778", "text": "def equip_selected\n item = @equip_window.item\n if @equip_window.item.nil?\n Sound.play_buzzer\n return\n end\n @enchant_window.item = item\n Sound.play_ok\n @equip_window.active = false\n @enchant_window.state = 2\n end", "title": "" }, { "docid": "91b58d7d97f5c0af5eb622a98468d7ac", "score": "0.55964506", "text": "def activate\n if player.location.has_items?\n # set inventory index being considered for get\n @index = 0\n @item = player.location.inventory[@index]\n if player.inventory.can_fit?(@item)\n if player.location.inventory.size == 1 && @item.quantity == 1\n # a single item at the location so just get it\n player.get(@item)\n game.change_state(Map.new)\n else\n game.messages << \"Do you want to pick up #{@item}? Y/N\"\n end\n else\n game.messages << 'Your inventory is full.'\n game.change_state(Map.new)\n end\n else\n # no items at location\n game.change_state(Map.new)\n end\n end", "title": "" }, { "docid": "b07a9ffe97a98bd60ee66f61e2673429", "score": "0.5558444", "text": "def update_item\n # continue input if item should be used\n return false if !self.check_item_condition?\n # if item not usable or item use process not executed and no selection\n if $game_player.battler.item == 0 ||\n !$game_player.use_item($data_items[$game_player.battler.item]) &&\n $game_temp.select_data == nil\n # play buzzer, can't use\n $game_system.se_play($data_system.buzzer_se)\n end\n # stop input update\n return true\n end", "title": "" }, { "docid": "0b6cad8b8b4ce4ace6549117e9c77ef7", "score": "0.5552155", "text": "def target_choice\n launcher, skill, target_bank, target_position = @visual.show_target_choice\n if launcher\n # The player made a choice we store the action and check if he can make other choices\n @player_actions << { type: :attack, launcher: launcher, skill: skill, target_bank: target_bank, target_position: target_position }\n log_debug(\"Action : #{@player_actions.last}\") if debug? # To prevent useless overhead outside debug\n @next_update = can_player_make_another_action_choice? ? :player_action_choice : :trigger_all_AI\n else\n # If the player canceled we return to the player action\n @next_update = :player_action_choice\n end\n ensure\n @skip_frame = true\n end", "title": "" }, { "docid": "f2bc1c9f77f151449ca53c1b727c859c", "score": "0.5544441", "text": "def choose_item_and_on_whom(enemy)\n item = @inventory[Random.rand(@inventory.length)].first\n whom = [self, enemy].sample\n return C[item, whom]\n end", "title": "" }, { "docid": "7fede337d019838a562abae14e51bd8b", "score": "0.55300486", "text": "def occasion_ok?(item)\r\n $game_party.in_battle ? item.battle_ok? : item.menu_ok?\r\n end", "title": "" }, { "docid": "68e520f2887f9018463b7e4e04b0c4b3", "score": "0.55290014", "text": "def load_abs_tool(item)\n return if @knockdown_data[0] > 0\n PearlKernel.load_item(item)\n \n return if self.is_a?(Game_Follower) and @targeted_character.nil?\n \n if !@targeting[0] and self.battler.is_a?(Game_Actor)\n if item.is_a?(RPG::Skill) || item.is_a?(RPG::Item)\n # apply target to skills items \n if PearlKernel.tool_target == \"true\" || item.scope == 7 ||\n item.scope == 9\n load_target_selection(item)\n return\n end\n else\n # apply target parsing the invoked skill to weapons and armors\n invoke = PearlKernel.tool_invoke\n if invoke != nil && invoke > 0 && invoke != 1 && invoke != 2\n invokeskill = $data_skills[invoke]\n if PearlKernel.tool_target == \"true\" || invokeskill.scope == 7 ||\n invokeskill.scope == 9\n load_target_selection(item)\n return\n end\n # apply target to normal weapon and armor without invoking\n else\n if PearlKernel.tool_target == \"true\"\n load_target_selection(item)\n return\n end\n end\n end\n end\n if item.is_a?(RPG::Skill) || item.is_a?(RPG::Item)\n battler.use_item(item) \n else\n if PearlKernel.tool_invoke != 0\n battler.use_item($data_skills[PearlKernel.tool_invoke])\n end\n end\n \n # if the tool has data continue\n if PearlKernel.has_data?\n consume_ammo_item(item) if battler.is_a?(Game_Actor) and\n PearlKernel.tool_itemcost != 0\n @anime_speed = PearlKernel.user_animespeed\n battler.apply_cooldown(item, PearlKernel.tool_cooldown)\n end\n create_projectile_object(item)\n create_anime_sprite_object(item)\n end", "title": "" }, { "docid": "1e3fe286fd1f7ef6b6d8e4cf458dbad8", "score": "0.5526487", "text": "def tbs_unit_selection\n map, p = $game_map, $game_player\n x,y = p.x, p.y\n \n if Input.trigger?(TM::Defaults::ShowAtt) #&& !TM.selecting_target?\n on_click\n set_tb_event(x,y)\n return if TM.selecting? # command window is up\n next_atk_hls(x,y) \n # Press Z to show route then Z again to move the unit\n elsif Input.trigger?(TM::Defaults::ShowMove) \n on_click\n return tb_enter_trade unless @selecting_tb_trade.nil?\n return if TM.selecting? # command window is up\n return tbs_target_selection if TM.selecting_target?\n return move_unit_tb(x,y) if @move_pos_selecting && can_move?\n return next_menu_ok_tb if @showing_temp_hls # @showing_temp_hls = false\n pok = produce_units if !TM.selecting_target?\n return SceneManager.call(SceneTBMainMenu) if show_mm_ok_tb?(x,y, pok)\n @menu_ok_tb = false\n elsif Input.trigger?(TM::Defaults::SelectAtk)\n on_click\n set_tb_event(x,y)\n return if TM.selecting? # command window is up\n next_atk_hls(x,y, true) \n elsif Input.trigger?(:B) \n on_click\n on_cancel_select if !@showing_status\n return if !@tb_event.nil? && @tb_event.move_route_forcing\n return @selecting_tb_trade = nil if @selecting_tb_trade \n if TM.selecting_target? || @move_pos_selecting || @showing_temp_hls\n end_select\n elsif @showing_status\n @showing_status = false\n @status_window_tb.hide\n @tb_command_window.activate\n else\n turn_off_flash_tbe\n @tb_event = nil\n check_unit_to_show\n SceneManager.call(SceneTBMainMenu) if !TM.selecting? && @tb_event.nil?\n end\n end_click\n end\n end", "title": "" }, { "docid": "e799e58bc5d02ab052f0fca4cb2b6774", "score": "0.5523942", "text": "def select_player_choice (player)\n puts \"\\n#{player.name}, it's your turn.\\n\\nHere are your options:\\n\"\n @acceptable_choices.each { |e| puts e}\n player.select_choice(self)\n end", "title": "" }, { "docid": "993532f454c165b895e5bfe9c5fa8e28", "score": "0.55221283", "text": "def update_phase3_enemy_select\n pkmn = @actors[@actor_actions.size]\n skill = pkmn.skills_set[@atk_index]\n if skill.id == 174 and !pkmn.type_ghost? #> Malédiction\n return [pkmn]\n end\n #>Choix automatique en 1v1\n if $game_temp.vs_type == 1 or (@enemy_party.pokemon_alive==1 and $pokemon_party.pokemon_alive==1) or skill.is_no_choice_skill?\n return util_targetselection_automatic(pkmn, skill)\n #>Choix 2v2\n elsif $game_temp.vs_type == 2\n data = update_phase3_pokemon_select_2v2(pkmn, skill)\n return -1 if data == -1\n if data < 2\n return [@enemies[data]]\n end\n return [@actors[data-2]]\n else\n return -1\n end\n\n end", "title": "" }, { "docid": "180c2b1afbea95882e4c7fe051ae32e1", "score": "0.55203575", "text": "def process_tool_action(item)\n PearlKernel.load_item(item)\n return if !battler.tool_ready?(item)\n \n unless PearlKernel.has_data?\n if item.is_a?(RPG::Weapon) || item.is_a?(RPG::Armor)\n msgbox('Tool data missing') if $DEBUG\n return\n end\n if item.scope.between?(1, 6)\n msgbox('Tool data missing') if $DEBUG\n return\n elsif item.scope == 0\n return\n \n elsif !battler.usable?(item)\n RPG::SE.new(\"Cursor1\", 80).play if self.is_a?(Game_Player)\n return \n end\n end\n \n if PearlKernel.has_data? and not usable_test_passed?(item)\n RPG::SE.new(\"Cursor1\", 80).play if self.is_a?(Game_Player)\n return\n end\n \n @user_casting = [PearlKernel.tool_castime,item] if PearlKernel.has_data?\n if @user_casting[0] > 0\n @animation_id = 0\n @animation_id = PearlKernel.tool_castanimation\n else\n load_abs_tool(item)\n end\n end", "title": "" }, { "docid": "25bccd3ebc9d4e73853990c3bdd85112", "score": "0.55120265", "text": "def pick_up\n\n slow_type(\"\\nHere's what's in #{find_room_by_id(@current_room_id).name}:\\n\")\n\n current_cell_items.each do |item_id|\n item = find_item_by_id(item_id)\n puts \"#{item.name}\" unless @inventory.include?(item.item_id) || item.show_item == false || item.class == Person\n end\n \n pick_up = TTY::Prompt.new\n\n choices = []\n current_cell_items.each do |item_id|\n item = find_item_by_id(item_id)\n choices << { name: item.name, value: item.item_id } unless @inventory.include?(item.item_id) || item.show_item == false || item.class == Person\n end\n \n input = pick_up.select(slow_type(\"\\nWhat would you like to pick up?\\n\"), choices)\n\n # RUN PICK UP RULES TO CHECK IF WE CAN PICK IT UP\n\n if current_cell_items.include?(input) && !@inventory.include?(input)\n pick_up_checks(input)\n\n else current_cell_items.include?(input) && !@inventory.include?(input)\n put_item_in_inventory(input)\n end\n end", "title": "" }, { "docid": "b531acca103098d59f7065f1ff0c0eb5", "score": "0.5505634", "text": "def update_item\r\n # If B button was pressed\r\n if Input.trigger?(Input::B)\r\n # Play cancel SE\r\n $game_system.se_play($data_system.cancel_se)\r\n # Switch to menu screen\r\n $scene = Scene_Map.new\r\n return\r\n end\r\n # If C button was pressed\r\n if Input.trigger?(Input::C)\r\n # Get currently selected data on the item window\r\n @item = @item_window.item\r\n # If not a use item\r\n unless @item.is_a?(RPG::Item)\r\n # Play buzzer SE\r\n $game_system.se_play($data_system.buzzer_se)\r\n return\r\n end\r\n # Play decision SE\r\n $game_system.se_play($data_system.decision_se)\r\n # If effect scope is an ally\r\n\r\n puts \"User chose item #{ItemService.item_sym_of(id)}\"\r\n @pedestal.pedestal_item_id = id\r\n\t\t\t$game_party.gain_item(rmxp_item_id, -1)\r\n\r\n SetupEventService.new.setup!\r\n $scene = Scene_Map.new\r\n return\r\n end\r\n end", "title": "" }, { "docid": "5feb4334a98298466f9abfd255f3c473", "score": "0.5501842", "text": "def pbChooseItemScreen(proc=nil)\n oldlastpocket = @bag.lastpocket\n oldchoices = @bag.getAllChoices\n @scene.pbStartScene(@bag,true,proc)\n item = @scene.pbChooseItem\n @scene.pbEndScene\n @bag.lastpocket = oldlastpocket\n @bag.setAllChoices(oldchoices)\n return item\n end", "title": "" }, { "docid": "66cdd66861bf230b8117ffa376c4d1b7", "score": "0.5500474", "text": "def set_battle()\n if ((@weapon == \"scissors\") && (@other_weapon == \"paper\")) || ((@weapon == \"rock\") && (@other_weapon == \"scissors\")) || ((@weapon == \"paper\") && (@other_weapon == \"rock\"))\n @battle_result = 1\n \n elsif ((@weapon == \"rock\") && (@other_weapon == \"paper\")) || ((@weapon == \"scissors\") && (@other_weapon == \"rock\")) || ((@weapon == \"paper\") && (@other_weapon == \"scissors\"))\n @battle_result = 2 \n\n else\n @weapon == @other_weapon \n @battle_result = 0\n end\n end", "title": "" }, { "docid": "586a050f04d9eb13f550ea405881f84c", "score": "0.54957426", "text": "def choose_pokemon\n choice = nil\n call_scene(GamePlay::StorageTrade) { |scene| choice = scene.return_data }\n return choice\n end", "title": "" }, { "docid": "b68f47067bee2dd3d1737656271a0f74", "score": "0.5485719", "text": "def pick_up(item)\n\n puts \"in pick_up item = #{item}\"\n puts \"equipped_weapon #{equipped_weapon}\"\n\n # binding.pry\n\n if (CAPACITY - items_weight) >= item.weight\n @items << item\n\n # binding.pry\n if item.class == PlasmaCannon || item.class == Laser\n # binding.pry\n self.equipped_weapon = item\n end\n\n true\n\n else\n false\n end\n\n end", "title": "" }, { "docid": "3586b257418970f5c3948a7827a21476", "score": "0.54732853", "text": "def update_equip_selection\n if Input.trigger?(Input::B)\n Sound.play_cancel\n cancel_command()\n \n elsif Input.trigger?(Input::C)\n if @remove\n if @equip_window.selected_item != nil\n Sound.play_decision\n remove_equip_command()\n else\n Sound.play_buzzer\n end\n else\n if @item_window.hasItems\n Sound.play_decision\n do_equip_command()\n else\n Sound.play_buzzer\n end\n end\n \n elsif Input.repeat?(Input::DOWN) || Input.repeat?(Input::UP)\n @item_window.equip_type = @equip_window.index\n @item_window.window_update($game_party.items)\n @item_window.index = -1\n end\n end", "title": "" }, { "docid": "2e5ee6aea904a03556948e007a4f5cf2", "score": "0.5461464", "text": "def determine_target\n used = false\n if @skill.for_all?\n for target in $game_party.members\n target.skill_effect(@actor, @skill)\n used = true unless target.skipped\n end\n elsif @skill.for_user?\n target = $game_party.members[@target_window.index]\n target.skill_effect(@actor, @skill)\n used = true unless target.skipped\n else\n $game_party.last_target_index = @target_window.index\n target = $game_party.members[@target_window.index]\n target.skill_effect(@actor, @skill)\n used = true unless target.skipped\n end\n if used\n use_skill_nontarget\n else\n Sound.play_buzzer\n end\n end", "title": "" }, { "docid": "2e5ee6aea904a03556948e007a4f5cf2", "score": "0.5461464", "text": "def determine_target\n used = false\n if @skill.for_all?\n for target in $game_party.members\n target.skill_effect(@actor, @skill)\n used = true unless target.skipped\n end\n elsif @skill.for_user?\n target = $game_party.members[@target_window.index]\n target.skill_effect(@actor, @skill)\n used = true unless target.skipped\n else\n $game_party.last_target_index = @target_window.index\n target = $game_party.members[@target_window.index]\n target.skill_effect(@actor, @skill)\n used = true unless target.skipped\n end\n if used\n use_skill_nontarget\n else\n Sound.play_buzzer\n end\n end", "title": "" }, { "docid": "e69db4baf2611aa8c2e759145d99b118", "score": "0.54548943", "text": "def use_item_nontarget\n Sound.play_use_item\n $game_party.consume_item(@item)\n @item_window.draw_item(@item_window.index)\n @target_window.window_update($game_party.members)\n if $game_party.all_dead?\n $scene = Scene_Gameover.new\n elsif @item.common_event_id > 0\n $game_temp.common_event_id = @item.common_event_id\n $scene = Scene_Map.new\n end\n end", "title": "" }, { "docid": "e69db4baf2611aa8c2e759145d99b118", "score": "0.54548943", "text": "def use_item_nontarget\n Sound.play_use_item\n $game_party.consume_item(@item)\n @item_window.draw_item(@item_window.index)\n @target_window.window_update($game_party.members)\n if $game_party.all_dead?\n $scene = Scene_Gameover.new\n elsif @item.common_event_id > 0\n $game_temp.common_event_id = @item.common_event_id\n $scene = Scene_Map.new\n end\n end", "title": "" }, { "docid": "21739ed54581567eaf337589a0c723f4", "score": "0.5447198", "text": "def gain_item\n\t\titem = $data_items\n\t\t$game_party.gain_item(item[1], 1)\n\tend", "title": "" }, { "docid": "1e6780b3a031971ffc0c84d0dd4aa516", "score": "0.5440096", "text": "def util_targetselection_automatic(launcher, skill)\n case skill.target\n when :adjacent_pokemon # eo eo ex / ux ao ax\n arr = util_targetselection_adjacent_foe(launcher)\n return [arr[rand(arr.size)]] if arr.size > 0\n when :adjacent_foe # eo eo ex / ux ax ax\n arr = util_targetselection_adjacent_foe(launcher)\n return [arr[rand(arr.size)]] if arr.size > 0\n when :adjacent_all_foe # e! e! ex / ux ax ax\n return util_targetselection_adjacent_foe(launcher)\n when :all_foe # e! e! e! / ux ax ax\n return ::BattleEngine.get_enemies!(launcher)\n when :adjacent_all_pokemon # e! e! ex / ux a! ax\n return util_targetselection_adjacent_pokemon(launcher)\n when :all_pokemon # e! e! e! / u! a! a!\n return ::BattleEngine.get_enemies!(launcher) + ::BattleEngine.get_ally!(launcher)\n when :user # ex ex ex / u! ax ax\n return [launcher]\n when :user_or_adjacent_ally # ex ex ex / uo ao ax\n arr = [launcher]+util_targetselection_adjacent_ally(launcher)\n return [arr[rand(arr.size)]] if arr.size > 0\n when :adjacent_ally # ex ex ex / ux ao ax\n arr = util_targetselection_adjacent_ally(launcher)\n return [arr[rand(arr.size)]] if arr.size > 0\n when :all_ally # ex ex ex / u! a! a!\n return ::BattleEngine.get_ally!(launcher)\n when :any_other_pokemon # ex ex ex / uo ax ax\n arr = ::BattleEngine.get_enemies!(launcher)\n arr += util_targetselection_adjacent_ally(launcher)\n return [arr[rand(arr.size)]] if arr.size > 0\n when :random_foe # e? e? e? / ux ax ax\n arr = ::BattleEngine.get_enemies!(launcher)\n return [arr[rand(arr.size)]] if arr.size > 0\n end\n return [launcher]\n end", "title": "" }, { "docid": "2fb2ff3ae74a74f8e0a0f2144cc4d461", "score": "0.5428276", "text": "def result\n return 'Draw' if player_item == self.item\n return @player if WIN[player_item] == self.item\n return self\n end", "title": "" }, { "docid": "b346c2f0b9d657b29a7eba3683e40891", "score": "0.54224294", "text": "def choose_player\n case @name\n when 'R2D2' then rtwodtwo\n when 'Hal' then hal\n when 'Chappie' then chappie\n end\n end", "title": "" }, { "docid": "69da865f80b761eafdd4c7ed5af49968", "score": "0.54195964", "text": "def update_buy_selection()\n item = @buy_window.selected_item.item\n \n if Input.trigger?(Input::B)\n Sound.play_cancel\n cancel_command()\n \n elsif Input.repeat?(Input::DOWN) || Input.repeat?(Input::UP)\n update_item_stats(item)\n \n elsif Input.repeat?(Input::Y) || Input.repeat?(Input::Z)\n update_character_select(Input.press?(Input::Z))\n \n elsif Input.repeat?(Input::RIGHT) || Input.repeat?(Input::LEFT)\n if !@buy_window.selected_item.active && (Input.press?(Input::RIGHT) ||\n (Input.press?(Input::LEFT) && @buy_window.selected_item.is_min_number?))\n Sound.play_buzzer\n elsif (Input.press?(Input::RIGHT) && !@buy_window.selected_item.is_max_number?) ||\n (Input.press?(Input::LEFT) && !@buy_window.selected_item.is_min_number?)\n Sound.play_cursor\n update_number_select(Input.press?(Input::RIGHT), @buy_window)\n update_transaction(@buy_window.selected_items)\n @buy_window.update_items_activity(@transaction_window.difference)\n end\n \n elsif Input.trigger?(Input::C)\n if (@buy_window.selected_items.size == 0)\n Sound.play_buzzer\n else\n Sound.play_decision\n @confirm_buy_window.show()\n @buy_window.active=false\n end\n end\n\n end", "title": "" }, { "docid": "a4083a393e8f900397e7f5e09215a4c5", "score": "0.5404846", "text": "def menu_choice(choice)\n\n\t\tif choice == \"a\"\n\t\t\thuman_player.search_weapon\n\t\telsif choice == \"s\"\n\t\t\thuman_player.search_health_pack\n\t\telse\n\t\t\ti = 0\n\t\t\tenemies_in_sight.each do |enemy|\n\t\t\t\ti += 1\n\t\t\t\tif i == choice.to_i\n\t\t\t\t\thuman_player.attacks(enemy)\n\t\t\t\t\tunless enemy.life_points > 0\n\t\t\t\t\t\tenemies_in_sight.delete(enemy)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "4dcb6ce5d321a83393ecf6605317c03b", "score": "0.5400751", "text": "def on_item_ok\n @item = @item_window.item\n BattleManager.actor.input.set_item(@item.id)\n action = BattleManager.actor.input\n case @item.target_type[0]\n when :one\n select_target_selection\n when :all\n BattleManager.actor.input.set = SES::TargetManager.make_targets(action)\n when :rand\n targets, set = [], SES::TargetManager.make_targets(action)\n (@item.target_type[1][0] + rand(@item.target_type[1][1])).times do\n targets << set[rand(set.size)]\n end\n BattleManager.actor.input.set = set\n else\n @item_window.hide\n next_command\n end\n $game_party.last_item.object = @item\n end", "title": "" }, { "docid": "1426ca2f9fbde5a4d0dae748cad04fc1", "score": "0.53934604", "text": "def use_item(item_name)\n item = self.items.find_by(name: item_name)\n if item.item_type == \"Healing Potion\"\n if self.hp += 10 < self.base_hp\n puts \"You drank the entire bottle. You feel energized! (+10 HP)\"\n puts \"You HP is now #{self.hp}\"\n #removes Item from inventory \n Item.destroy(item)\n else\n #if HP goes ove the base_health, it automatically caps at base_hp aka your max hp\n self.hp = self.base_hp\n puts \"You drank the entire bottle. You are at full health!\"\n puts \"Your HP is now #{self.base_hp}\"\n Item.destroy(item)\n end \n elsif item.item_type == \"Weapon\"\n #weapons will boost the characters attack points by a random number?\n if self.current_weapon == nil \n random_attack_boost = [2,3,5].sample\n self.attack_power += random_attk_boost\n puts \"You've equipped #{item.name}. (+#{random_attk_boost})\"\n else \n equipped_weapon = self.items.find_by(current_weapon)\n Item.destroy(equppied_weapon)\n self.attack_power = self.base_attk\n random_attack_boost = [5,6,10].sample\n self.attack_power += random_attack_boost\n puts \"You have replaced your weapon with #{item.name}. (+#{random_attk_boost})\"\n end \n else \n puts \"You can't use/equip this!\"\n end \n end", "title": "" }, { "docid": "b641f2b7a56b5581bf45facaa0162c7b", "score": "0.5385158", "text": "def choice_a_shop\n sell_item\n end", "title": "" }, { "docid": "2ac3452f2fd812a7765382d6939150bc", "score": "0.53749716", "text": "def trainer_chooses_pokemon\n choose_pokemon = {\"Fire\" => \"Charmander\", \"Grass\" => \"Bulbasaur\", \"Water\" => \"Squirtle\"}\n type_choice = prompt.select(Interactivity.choose_pokemon, choose_pokemon.keys) \n Interactivity.no_turning_back\n user.pokemon = Pokemon.find_by(name: choose_pokemon[type_choice])\n user.save\n end", "title": "" }, { "docid": "4a2bc70f1a0fb783d374cbb9ee812e6f", "score": "0.53701025", "text": "def test_selectItem\n\t\t#vm = VendingMachine.new\n\t\tvm = VendingMachine.new(@db)\n\t\tvm.output = StringIO.new\n\t\t# vm.items[\"A1\"].quantity = 1\n\t\tvm.inputMoney(0.50)\n\t\titem = vm.selectItem(\"A1\")\n\t\tassert_not_nil(item)\n\t\tassert_equal(\"A1\", item.code)\n\t\tassert_equal(\"Almond Joy\", item.description)\n\tend", "title": "" }, { "docid": "a1bd98c7c6694bc1cec13138d76f2aba", "score": "0.53686374", "text": "def pbIsMedicine?(item)\n return [1, 2, 6, 7].include?(GameData::Item.get(item).battle_use) && !GameData::Item.get(item).is_berry?\nend", "title": "" }, { "docid": "833017a229d3b82923a95e70f0585fa2", "score": "0.5367476", "text": "def select_intended\n select intended\n end", "title": "" }, { "docid": "833017a229d3b82923a95e70f0585fa2", "score": "0.5367476", "text": "def select_intended\n select intended\n end", "title": "" }, { "docid": "706e51a6c574633df11aca2a86e252f0", "score": "0.5367239", "text": "def use(item_name)\n # TODO: figure out how to pass around entire item object to access effects anywhere\n if @player.has_item(item_name) && current_room.npc && current_room.npc.has_item(item_name)\n effect = current_room.npc.inventory.select { |i| i.name == item_name }.first.effects\n puts effect\n @player.remove_from_inventory(item_name)\n # TODO: eventually remove from NPC inventory & change ownership of item\n elsif @player.has_item(item_name) && current_room.has_item(item_name)\n effect = current_room.items.find { |i| i.name == item_name }.effects\n puts effect\n @player.remove_from_inventory(item_name)\n # TODO: eventually remove from Room inventory & change ownership of item\n else\n puts \"Sorry, that item is not in your inventory. Did you pick it up or try taking it from someone?\"\n end\n end", "title": "" }, { "docid": "ef2aa7ca048a0772abcd4a6a09f61d61", "score": "0.5354782", "text": "def attack_ui(entity, action, options = {})\n selected_targets = []\n\n target = @prompt.select(\"#{entity.name} targets\") do |menu|\n battle.valid_targets_for(entity, action, target_types: options[:target_types], range: options[:range]).each do |target|\n menu.choice target.name, target\n end\n menu.choice 'Manual'\n menu.choice 'Back', nil\n end\n\n return nil if target == 'Back'\n\n if target == 'Manual'\n targets = target_ui(validation: lambda { |selected|\n selected_entities = map.thing_at(*selected)\n\n return false if selected_entities.empty?\n\n selected_entities.detect do |selected_entity|\n battle.valid_targets_for(entity, action, target_types: options[:target_types], range: options[:range], include_objects: true).include?(selected_entity)\n end\n })\n\n if targets.size > (options[:num_select].presence || 1)\n loop do\n target = @prompt.select('multiple targets at location(s) please select specific targets') do |menu|\n targets.each do |t|\n menu.choice t.name.to_s, t\n end\n end\n selected_targets << target\n break unless selected_targets.size < options[:num_select]\n end\n else\n selected_targets = targets\n end\n\n return nil if target.nil?\n else\n selected_targets << target\n end\n\n selected_targets.flatten\n end", "title": "" }, { "docid": "3b67f754981dbcd592cd9a754e04cdbf", "score": "0.53531486", "text": "def selected?; end", "title": "" }, { "docid": "3b67f754981dbcd592cd9a754e04cdbf", "score": "0.53531486", "text": "def selected?; end", "title": "" }, { "docid": "e4799b70ae9b892c5848b374b24a32e6", "score": "0.5345677", "text": "def occasion_ok?(item)\n SceneManager.scene_is?(Scene_Map) ? item.battle_ok? : item.menu_ok?\n end", "title": "" }, { "docid": "80baed2ddd066c07e68ea73a3af4b424", "score": "0.5340097", "text": "def menu_choice(cmd)\n hplayer = @human_player\n action = cmd\n\n # define possible actions for the player\n if action == \"a\"\n hplayer.search_weapon\n elsif action == \"s\"\n hplayer.search_health_pack\n elsif action.match(/^(\\d)+$/) # check if action is a number\n hplayer.attacks(@enemies[action.to_i])\n if @enemies[action.to_i].life_points <= 0\n kill_player(@enemies[action.to_i])\n end\n end\n \n end", "title": "" }, { "docid": "6f692f51037aaadfe83b7b00c119ebe2", "score": "0.5337638", "text": "def menu_choice\n puts \"Votre réponse :\"\n print \">\"\n user_answer = gets.chomp\n\n if(user_answer == \"a\")\n then @human_player.search_weapon\n end\n if(user_answer == \"s\")\n then @human_player.search_health_pack\n end\n if(user_answer == 0.to_s)\n then @human_player.attacks(@player1)\n end\n if(user_answer == 1.to_s)\n then @human_player.attacks(@player2)\n end\n if(user_answer == 2.to_s)\n then @human_player.attacks(@player3)\n end\n if(user_answer == 3.to_s)\n then @human_player.attacks(@player4)\n end\n kill_player\n end", "title": "" }, { "docid": "5ddf8d90927d1c52eca7116e394ad4a6", "score": "0.53235936", "text": "def item_usable?\n return false unless @item\n return @actor ? @actor.usable?(@item) : $game_player.usable?(@item)\n end", "title": "" }, { "docid": "f41047b275994953f0279680e8d9f589", "score": "0.53196865", "text": "def test_selection\n @player = @battle.user_select(1)\n assert_instance_of(Karl, @player)\n\n @rand_player = @battle.user_select(4)\n assert_instance_of([Karl, Guspatcho, LemonyWinks], @rand_player)\n end", "title": "" }, { "docid": "884c40882e3a949cb31f1cfc446e27e6", "score": "0.5318418", "text": "def computer_ai_2\n choice = @human_moves[-1]\n end", "title": "" }, { "docid": "19b4cedbfc52bbd5ebd812079ecfd398", "score": "0.53111124", "text": "def selected\r\n assert_exists\r\n #@option.selected\r\n option_selected\r\n end", "title": "" }, { "docid": "84f29c4def07f74968ca137b8fd46033", "score": "0.530622", "text": "def chose_weapon\n if @class == 'Water'\n chosen_weapon = Weapon.new \n return chosen_weapon.water_weapons\n end\n end", "title": "" }, { "docid": "0f9c3a54efcc923bff779817d9c1dd49", "score": "0.5303764", "text": "def start_battle\n self.go_to_pokemon_center? if user.pokemon.hp == 0\n choice = prompt.select(Interactivity.fightPokemon?(@@wild_pokemon.name), [\"Let's BATTLE!\", \"No, I don't wanna battle.\"]) \n if choice == \"Let's BATTLE!\"\n self.accepts_battle\n elsif choice == \"No, I don't wanna battle.\"\n self.keep_exploring? \n end \n end", "title": "" }, { "docid": "d580be641fbd0c7e098db3e1dd9b496a", "score": "0.53003925", "text": "def util_targetselection_get_possible(launcher,skill)\n if launcher.position < 0\n arr = []\n util_targetselection_adjacent_pokemon(launcher).each do |target|\n arr << target if seviper_zangoose_detect(launcher, target)\n end\n return arr if arr.size > 0\n end\n case skill.target\n when :adjacent_pokemon # eo eo ex / ux ao ax\n return util_targetselection_adjacent_pokemon(launcher)\n when :adjacent_foe # eo eo ex / ux ax ax\n return util_targetselection_adjacent_foe(launcher)\n when :user_or_adjacent_ally # ex ex ex / uo ao ax\n return [launcher]+util_targetselection_adjacent_ally(launcher)\n when :adjacent_ally # ex ex ex / ux ao ax\n return util_targetselection_adjacent_ally(launcher)\n when :any_other_pokemon # ex ex ex / uo ax ax\n arr = ::BattleEngine.get_enemies!(launcher)\n arr += util_targetselection_adjacent_ally(launcher)\n return arr\n end\n return nil\n end", "title": "" }, { "docid": "ecbca58b1d1b8e2af50ffeff389f06d5", "score": "0.5299494", "text": "def selectWeapon _obj, _args\n \"_obj selectWeapon _args;\" \n end", "title": "" }, { "docid": "cc33182846078c66073b0986e961d4a8", "score": "0.5298197", "text": "def weapon?\n melee_weapon? or ranged_weapon?\n end", "title": "" }, { "docid": "4719a450249b32b0d31b3744a870d566", "score": "0.5297655", "text": "def select_o\r\n print \" Please select the O player: \"\r\n p2 = gets.chomp\r\n case p2\r\n when \"1\" then @p2_type = \"human\"\r\n when \"2\" then @p2_type = \"perfect\"\r\n when \"3\" then @p2_type = \"random\"\r\n when \"4\" then @p2_type = \"sequential\"\r\n else @p2_type = \"invalid_p2\"\r\n end\r\n invalid_player?(@p2_type)\r\n end", "title": "" }, { "docid": "e97597fd996a3a36e9a6e26ce37ca0d7", "score": "0.529675", "text": "def choice_a_hold\n item_id = @item_list[@index]\n return action_b if item_id.nil?\n return play_buzzer_se if item_id == 0 || !GameData::Item[item_id].holdable\n\n play_decision_se\n @running = false\n @return_data = @item_list[@index]\n end", "title": "" }, { "docid": "91e6888e65ad85d03f7b0334de68362b", "score": "0.5290493", "text": "def choose_attack\n puts \"Choose an action:\"\n print_battle_commands\n\n input = player_input\n index = has_battle_command(input)\n\n #input error loop\n while !index\n puts \"You don't have '#{input}'\"\n puts \"Try one of these:\"\n print_battle_commands\n\n input = player_input\n index = has_battle_command(input)\n end\n\n return @battle_commands[index]\n\tend", "title": "" }, { "docid": "fb4355f872dad36a41168164ec6f80d5", "score": "0.5285464", "text": "def decide_random_target_for_actor\n # Diverge with effect scope\n if for_one_friend_hp0?\n battler = $game_party.random_target_actor_hp0\n elsif for_one_friend?\n battler = $game_party.random_target_actor\n else\n battler = $game_troop.random_target_enemy\n end\n # If a target exists, get an index, and if a target doesn't exist,\n # clear the action\n if battler != nil\n @target_index = battler.index\n else\n clear\n end\n end", "title": "" }, { "docid": "d6a1d2fc028b31a558becb5a5099ebce", "score": "0.5278838", "text": "def get_user_selection\n puts 'Choice (Press enter for first choice):'\n loop do\n choice = STDIN.gets.strip.to_i\n if !choice.nil? && possible_moves.each_index.to_a.include?(choice)\n return choice\n else\n puts \"Please select valid choice.\"\n end\n end\n end", "title": "" }, { "docid": "a00f5ee89aa9f396757533bc39d19863", "score": "0.52657384", "text": "def run(user, enemy)\n # Determine the item and on whom to use the item.\n pair = user.choose_item_and_on_whom(enemy)\n return if (!pair)\n user.use_item(pair.first, pair.second)\n end", "title": "" }, { "docid": "9b5d76b2cfd0166cf07715459116b54e", "score": "0.52641886", "text": "def update_item_selection\n @item_window.active = true\n @item_window.update\n @help_window.update\n #@item_back_window.update\n #@dataviews_window.update\n #@item_details_window.update\n \n if Input.trigger?(Input::B)\n Sound.play_cancel\n end_item_selection\n elsif Input.trigger?(Input::C)\n @item = @item_window.item\n if @item != nil\n $game_party.last_item_id = @item.id\n end\n if $game_party.item_can_use?(@item)\n Sound.play_decision\n determine_item\n else\n Sound.play_buzzer\n end\n #elsif (Input.repeat?(Input::Y) || Input.repeat?(Input::Z))\n # update_dataview_select(Input.press?(Input::Z), \n # Input.trigger?(Input::Y) || Input.trigger?(Input::Z))\n # @item_window.window_update(@dataviews_window.apply_dataview($game_party.items))\n # @item_window.index = 0\n end\n end", "title": "" }, { "docid": "6554642e8092e60e7126953250b38d5d", "score": "0.5263913", "text": "def setup_item_choice(params)\r\n $game_message.item_choice_variable_id = params[0]\r\n end", "title": "" }, { "docid": "bfbd380ad6c3c569f2bed6b505b05df6", "score": "0.52635676", "text": "def update_phase3_actor_select\r\n # If B button was pressed\r\n if Input.trigger?(Input::B)\r\n # Play cancel SE\r\n $game_system.se_play($data_system.cancel_se)\r\n # End actor selection\r\n end_actor_select\r\n return\r\n end\r\n # If C button was pressed\r\n if Input.trigger?(Input::C)\r\n # Play decision SE\r\n $game_system.se_play($data_system.decision_se)\r\n # Set action\r\n @active_battler.current_action.target_index = @actor_arrow.index\r\n # End actor selection\r\n end_actor_select\r\n # If skill window is showing\r\n if @skill_window != nil\r\n # End skill selection\r\n end_skill_select\r\n end\r\n # If item window is showing\r\n if @item_window != nil\r\n # End item selection\r\n end_item_select\r\n end\r\n # Go to command input for next actor\r\n phase3_next_actor\r\n end\r\n end", "title": "" }, { "docid": "f894349fab1dd6c347f55362f585c42e", "score": "0.5258815", "text": "def select_option\n return $prompt.select(\"What's your option?\",\n [\"Ladder\", \"Team's info\", \"Play a game!\", \"Training\", \"Exit\"])\n \nend", "title": "" }, { "docid": "19c89e12bd29541e40f1c36febdc5c9c", "score": "0.52580416", "text": "def selection(input, user)\n case input\n when 1\n get_number_of_random_recipes(user)\n when 2\n recipe_hash = run_option_find_recipe_by_name\n run_sub_menu_option(user, recipe_hash)\n when 3\n run_option_create(user)\n when 4\n run_option_view_favs(user)\n end\n end", "title": "" }, { "docid": "462535b6deea74dd361f3f363ea9e29f", "score": "0.52542174", "text": "def update_phase3_enemy_select\r\n # If B button was pressed\r\n if Input.trigger?(Input::B)\r\n # Play cancel SE\r\n $game_system.se_play($data_system.cancel_se)\r\n # End enemy selection\r\n end_enemy_select\r\n return\r\n end\r\n # If C button was pressed\r\n if Input.trigger?(Input::C)\r\n # Play decision SE\r\n $game_system.se_play($data_system.decision_se)\r\n # Set action\r\n @active_battler.current_action.target_index = @enemy_arrow.index\r\n # End enemy selection\r\n end_enemy_select\r\n # If skill window is showing\r\n if @skill_window != nil\r\n # End skill selection\r\n end_skill_select\r\n end\r\n # If item window is showing\r\n if @item_window != nil\r\n # End item selection\r\n end_item_select\r\n end\r\n # Go to command input for next actor\r\n phase3_next_actor\r\n end\r\n end", "title": "" }, { "docid": "edb90197e568171795d411912f5ab2e5", "score": "0.524969", "text": "def get_selected_item\n @items[@selected_slot]\n end", "title": "" }, { "docid": "888c5956babe29d3b793e1c69025f756", "score": "0.52488863", "text": "def selectWeaponTurret _obj, _args\n \"_obj selectWeaponTurret _args;\" \n end", "title": "" }, { "docid": "b95bb6bd6959045239e0897885e12f76", "score": "0.5245773", "text": "def equippable?(item)\n # If weapon\n if item.is_a?(RPG::Weapon)\n style = get_style(0, item.id)\n # If included among equippable weapons in current class\n if $data_classes[@class_id].weapon_set.include?(item.id)\n if style == nil or @job_current == Unemployed\n return true\n else\n #check if they have the style\n job = get_job\n for i in 1...3\n key = 'style' + i.to_s\n if job[key] == style\n return true\n end\n end\n if (first_command == 'Equip ' + style) or (second_command == 'Equip ' + style)\n return true\n end\n end\n end\n end\n # If armor\n if item.is_a?(RPG::Armor)\n style = get_style(1, item.id)\n # If included among equippable armor in current class\n if $data_classes[@class_id].armor_set.include?(item.id)\n if style == nil or @job_current == Unemployed\n return true\n else\n #check if they have the style\n job = get_job\n for i in 1...3\n key = 'style' + i.to_s\n if job[key] == style\n return true\n end\n end\n if (first_command == 'Equip ' + style) or (second_command == 'Equip ' + style)\n return true\n end\n end\n end\n end\n return false\n end", "title": "" }, { "docid": "8d2fb02cc452bced6617d1b43ec08a1d", "score": "0.52445173", "text": "def select_map\n\t\tprint \"\\nThis game features two maps, United States (US) or Germany (G).\\nWhich map would you like to play on? \"\n\t\tinput = nil\n\t\tuntil input != nil\n\t\t\tinput = case gets.chomp.downcase\n\t\t\twhen \"us\", \"united states\" then :US\n\t\t\twhen \"g\", \"germany\" then :G\n\t\t\telse nil\n\t\t\tend\n\t\t\tputs \"\\nThat is not a vaild choice, please try again: \" if input == nil\n\t\tend\n\t\tinput\n\tend", "title": "" }, { "docid": "09adace502b983b59bdf9a0fd7273cf0", "score": "0.5237881", "text": "def select_botgarden_action_code(data_set)\n action = data_set[InventoryMovement::REASON.name]\n if action\n action_code_options_locator = input_options_locator([], InventoryMovement::REASON.name)\n hit_escape\n wait_for_options_and_select(botgarden_action_code_input_locator, action_code_options_locator, action)\n end\n end", "title": "" }, { "docid": "2b7a0f6ae82e53c3c7635007812475e4", "score": "0.52369213", "text": "def update_sell_selection()\n item = @sell_window.selected_item.item\n\n if Input.trigger?(Input::B)\n Sound.play_cancel\n cancel_command()\n \n elsif Input.repeat?(Input::DOWN) || Input.repeat?(Input::UP)\n update_item_stats(item)\n \n elsif Input.repeat?(Input::Y) || Input.repeat?(Input::Z)\n update_character_select(Input.press?(Input::Z))\n \n elsif Input.repeat?(Input::RIGHT) || Input.repeat?(Input::LEFT)\n if (Input.press?(Input::RIGHT) && !@sell_window.selected_item.is_max_number?) ||\n (Input.press?(Input::LEFT) && !@sell_window.selected_item.is_min_number?)\n Sound.play_cursor\n update_number_select(Input.press?(Input::RIGHT), @sell_window)\n update_transaction(@sell_window.selected_items)\n end\n \n elsif Input.trigger?(Input::C)\n if (@sell_window.selected_items.size == 0)\n Sound.play_buzzer\n else\n Sound.play_decision\n @confirm_sell_window.show()\n @sell_window.active=false\n end\n end\n end", "title": "" } ]
39ac47442446682ca6dc09779afadf6b
pull the initialization vector from the front of the encoded message
[ { "docid": "a1581b8befd5d87acf402a6d1ad62289", "score": "0.0", "text": "def separate_iv_and_ciphertext(cipher, iv_and_ciphertext)\n idx = cipher.iv_len\n [iv_and_ciphertext[0..(idx - 1)], iv_and_ciphertext[idx..-1]]\n end", "title": "" } ]
[ { "docid": "871f73669031f4511408f9eb8022b23b", "score": "0.57510763", "text": "def slice_message_tail(message_vector)\n vector.new(message_vector.vector[-HASH_LENGTH / 8..-1])\n end", "title": "" }, { "docid": "41a73cd240a6eb10a2d9ea1e8e56a37c", "score": "0.5528789", "text": "def unpack msg\n msg.unpack \"aa#{TAG_LENGTH}a#{@cipher.iv_len}a*\"\n end", "title": "" }, { "docid": "e542220b5bda8c45d0bf387b13452939", "score": "0.5242289", "text": "def decode=(_arg0); end", "title": "" }, { "docid": "e542220b5bda8c45d0bf387b13452939", "score": "0.5242289", "text": "def decode=(_arg0); end", "title": "" }, { "docid": "81548dec11351a3bbc26312be3c1746b", "score": "0.51496595", "text": "def prev\n v_ = @vector.dup\n @structure._dec_vector(v_) ? nil : Position.new(@structure, v_)\n end", "title": "" }, { "docid": "b2df2cfe65c2e8a6638f673ff80ab06d", "score": "0.5138068", "text": "def decoder_stub(state)\n len = state.buf.length \n\n decoder =\n \"\\xd9\\xee\" +\t\t\t # fldz \n \"\\xd9\\x74\\x24\\xf4\" +\t\t # fnstenv [esp - 0xc]\n \"\\x5f\" +\t\t\t # pop edi\n \"\\x83\\xc7\\x22\" +\t\t # add edi, 0x22\n \"\\x8d\\x37\" +\t\t\t # lea esi, [edi]\n \"\\x83\\xc6\" + [len].pack('C') + \t # add esi, (len + 1)\n \"\\x31\\xc0\" +\t\t\t # xor eax, eax\n \"\\x8a\\x07\" +\t\t\t # mov al, BYTE PTR [edi]\n \"\\x34X\" +\t\t\t # xor al, (xor key)\n \"\\x74\\x0b\" +\t\t\t # je +11 \n \"\\x8d\\x1e\" +\t\t\t # lea ebx, [esi]\n \"\\x01\\xc3\" +\t\t\t # add ebx, eax\n \"\\x8a\\x03\" +\t\t\t # mov al, BYTE PTR [ebx]\n \"\\x88\\x07\" +\t\t\t # mov BYTE PTR [edi], al\n \"\\x47\" +\t\t\t # inc edi\n \"\\xeb\\xef\"\t\t\t # jmp -17\n\n state.decoder_key_offset = 20\n\n return decoder\n end", "title": "" }, { "docid": "2dd9ffaee7ab5186c04354216e9478b8", "score": "0.51318157", "text": "def encode_begin(state)\n @dictionary = state.buf.split(//).sort.uniq.shuffle.join\n end", "title": "" }, { "docid": "93db83c7789c5d3a76fa54da51e96413", "score": "0.51219326", "text": "def mark_IV_decoder(first_wheel_index,second_wheel_index,encoded_message)\n input_array = encoded_message.split(//)\n wheel_three_index=[0]\n output_array=[]\n for i in 0...input_array.length\n output_char = mark_I_encoder(-2 *Integer(wheel_three_index[i]),input_array[i]).to_s\n output_array.push mark_II_encoder(-first_wheel_index,-second_wheel_index,output_char).to_s\n wheel_three_index[i+1]=$keyboard.index(output_array[i])\n end\n mark_IV_decoded_message = output_array.join\n return mark_IV_decoded_message\nend", "title": "" }, { "docid": "2b77afd8c83db1cd76aea831dfb0f3fb", "score": "0.511182", "text": "def v_decode message, key\n message_array = alphabet_number(message.split(\"\"))\n key_array = alphabet_number(make_key_repeat(key.split(\"\"), message_array.length)).take(message_array.length)\n number_alphabet(message_array.map.with_index{ |m,i| (m.to_i - key_array[i].to_i + 1) % 26}).take(message_array.length).join(\"\")\nend", "title": "" }, { "docid": "90790026d9b1c7f2f1720c13efb42f0a", "score": "0.4976245", "text": "def sub_bytes_inv(state)\n state = state.map{ |b| S_BOX_INV[b] }\n print_state(state, __method__) if DEBUG\n state\n end", "title": "" }, { "docid": "7dd80f361b9bda4ba9ee230f38e36282", "score": "0.4968207", "text": "def unpack_header(header)\n # fixed fields\n self.version = header.slice!(0)\n self.type = header.slice!(0)\n self.seq_no = header.slice!(0)\n self.flags = header.slice!(0)\n self.session_id = header.slice!(0..3)\n self.length = header.slice!(0..3)\n return(nil)\n end", "title": "" }, { "docid": "52c023eccd6d986a59c9ce5554b68876", "score": "0.4961423", "text": "def encrypt message\n raw = message.bytes.reverse!\n raw << raw.size\n # strip_leading_zero_bytes raw\n raw.each do |item|\n puts item\n end\nend", "title": "" }, { "docid": "d122e9345c50d24dbd85258472c04f5c", "score": "0.49358124", "text": "def msg_init\n\t@msg_buf = []\n end", "title": "" }, { "docid": "98e5633bfd51ba06b9a9836ca2bfd257", "score": "0.4927837", "text": "def peek\n return nil if empty?\n _decode_message(self.first)\n end", "title": "" }, { "docid": "88cfadd26c5b14e685cefbe989d4d2e8", "score": "0.4915334", "text": "def unpack(p0) end", "title": "" }, { "docid": "d9f587f562f4e954c068da5ce2d15d22", "score": "0.48935863", "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": "a8437727faec43ee3325012e26b4f2bf", "score": "0.4887896", "text": "def last_four_chars_of_encryption_into_array\n @message[-4..-1].chars\n end", "title": "" }, { "docid": "1e7ffac72851c70cc5d1251ba6adb3ce", "score": "0.48766482", "text": "def generate_initialization_vector(words)\n vector = \"\"\n words.times {\n vector << [rand(ULONG)].pack('N')\n }\n return(vector)\n end", "title": "" }, { "docid": "c063733f0e256bdbf1c57a51c8020bb3", "score": "0.48049492", "text": "def _s2v(associated_data, plaintext)\n # Note: the standalone S2V returns CMAC(1) if the number of passed\n # vectors is zero, however in SIV construction this case is never\n # triggered, since we always pass plaintext as the last vector (even\n # if it's zero-length), so we omit this case.\n d = Internals::Block.new\n d.xor_in_place(@mac.digest(d.data))\n\n associated_data.each do |ad|\n d.dbl\n d.xor_in_place(@mac.digest(ad))\n end\n\n if plaintext.bytesize >= Internals::Block::SIZE\n # TODO: implement this more efficiently by adding IUF support to CMAC\n difference = plaintext.length - Internals::Block::SIZE\n beginning = plaintext[0, difference]\n d.xor_in_place(plaintext[difference..-1])\n msg = beginning + d.data\n else\n d.dbl\n d.xor_in_place(Internals::Util.pad(plaintext, Internals::Block::SIZE))\n msg = d.data\n end\n\n @mac.digest(msg)\n end", "title": "" }, { "docid": "053f4e98a536349e438c74ff705a7582", "score": "0.48013565", "text": "def rc4_initialize(key)\r\n @q1 = 0\r\n @q2 = 0\r\n @key = []\r\n key.each_byte { |elem| @key << elem } while @key.size < 256\r\n @key.slice!(256..@key.size - 1) if @key.size >= 256\r\n @s = (0..255).to_a\r\n j = 0\r\n 0.upto(255) do |i|\r\n j = (j + @s[i] + @key[i]) % 256\r\n @s[i], @s[j] = @s[j], @s[i]\r\n end\r\n end", "title": "" }, { "docid": "bc879afa0c3f5ce172dfe30a68e76d75", "score": "0.4780746", "text": "def decoder_stub(state)\n\t\tstate.key = \"\"\n\t\tstate.decoder_key_size = 0\n\t\tRex::Encoder::NonUpper::gen_decoder()\n\tend", "title": "" }, { "docid": "4c3e545b712dbdffbce1efd4740ec920", "score": "0.47430775", "text": "def decoder(string)\n string.gsub(/(WUB)+/, ' ').strip\nend", "title": "" }, { "docid": "8c29e33013ae1a0251a2f4af7ba994dc", "score": "0.47386882", "text": "def decode\n @msglen = plain_text.length\n holes = compute_holes(@msglen)\n\n end", "title": "" }, { "docid": "58dfacb75394f66047ea215a2218f2ed", "score": "0.47375864", "text": "def decode_raw_header\n decoded_header = Ether.new\n decoded_header.read(payload)\n end", "title": "" }, { "docid": "1e239957e7361b93f805ec53af536440", "score": "0.47320116", "text": "def msg_version; @msg_version ||= PackedHeader.new(1, 'C').encode(VERSION); end", "title": "" }, { "docid": "ff75d40887b44fc55decf478cc4f44aa", "score": "0.47289076", "text": "def caesar_decode(word,offset)\n caesar_encode(word,offset*-1)\nend", "title": "" }, { "docid": "4c2fc81ab7ba8707b394dbbdcbb3caea", "score": "0.46922895", "text": "def decode(c)\n i = interlace(c)\n a = i >> @b_size\n b = (i ^ (a << @b_size))\n [a, b]\n end", "title": "" }, { "docid": "3c30dff22efb4bc52427b4dee28de970", "score": "0.46861535", "text": "def decode(token)\n \n end", "title": "" }, { "docid": "572229e3f4b6c63bcffbeb57eaf1da10", "score": "0.46402964", "text": "def payload\n @payload[0] if @payload\n end", "title": "" }, { "docid": "1bdba5fac877b2dbc19812db3b9e1f89", "score": "0.46379942", "text": "def unwrap\n frame = pop\n if @msg_frames.first.size == 0\n pop\n end\n frame\n end", "title": "" }, { "docid": "d54d0fa03931e520344f1504a6a9b1e9", "score": "0.46351266", "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": "c344adda4837396cbed9d6123d733ad4", "score": "0.4631798", "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": "eb427e3e3b7e04426577525f4002c7e3", "score": "0.46299747", "text": "def parse_chunk_ENCU stream\n decode_aes256 stream.read\n end", "title": "" }, { "docid": "d1e4c9d5f0e5e91dbe1765d960e6ad68", "score": "0.46245968", "text": "def initialize(message)\n\t\t@message = message\n\t\t@parse = Parse.new(message)\n\t\t@char_map = (\"a\"..\"z\").to_a + (\"0\"..\"9\").to_a + [\" \", \".\", \",\"]\n\t\t@key = Key.new\n\t\t@offset = Offset.new\n\n\t\t@a = Rotor.new.a_rotation\n\t\t@b = Rotor.new.b_rotation\n\t\t@c = Rotor.new.c_rotation\n\t\t@d = Rotor.new.d_rotation\n\n\t\t@encrypted_message = []\n\tend", "title": "" }, { "docid": "10bf484b6ce02dcc74676109de39b5d4", "score": "0.46233886", "text": "def pre\n @pre ||= _to_a[3]\n end", "title": "" }, { "docid": "5d30d723388f90a93f1bc578aefda388", "score": "0.4619958", "text": "def sequence_decoder(string)\n array = string.unpack('N3')\n [(array[0] << 32) + array[1], array[2]]\n end", "title": "" }, { "docid": "bfef5f2c41dd3058e17a2d28cbdc30c8", "score": "0.46194208", "text": "def mark_IV_index_finder(encoded_message,hint)\n key_combinations =Array.new\n for i in 0...9\n for j in 0...9\n decoded_message=mark_IV_decoder(i,j,encoded_message)\n if (decoded_message.include? hint)\n index_combination =Array.new\n index_combination.push i,j\n key_combinations.push index_combination\n final_decoded_message = decoded_message\n end\n end\n end\n return [key_combinations,final_decoded_message]\nend", "title": "" }, { "docid": "37acaec74f5cb11c54088ecada3069c9", "score": "0.4618379", "text": "def zero(&contents) X(0, &contents) end", "title": "" }, { "docid": "59976f479e5182ba5a21c803a1104622", "score": "0.46081835", "text": "def payload\n self[0...-SIGNATURE_LENGTH]\n end", "title": "" }, { "docid": "342a662406152150095ab10bd0966137", "score": "0.4606011", "text": "def create_begin\n buffer.allocate(4 + @_model.fbe_size)\n end", "title": "" }, { "docid": "342a662406152150095ab10bd0966137", "score": "0.4606011", "text": "def create_begin\n buffer.allocate(4 + @_model.fbe_size)\n end", "title": "" }, { "docid": "342a662406152150095ab10bd0966137", "score": "0.4606011", "text": "def create_begin\n buffer.allocate(4 + @_model.fbe_size)\n end", "title": "" }, { "docid": "342a662406152150095ab10bd0966137", "score": "0.4606011", "text": "def create_begin\n buffer.allocate(4 + @_model.fbe_size)\n end", "title": "" }, { "docid": "5be08fe47643565cb50de7db4e0d9140", "score": "0.4596591", "text": "def payload=(_arg0); end", "title": "" }, { "docid": "03c24161f152ba7662514b0f2ff10c57", "score": "0.4591524", "text": "def decode; end", "title": "" }, { "docid": "03c24161f152ba7662514b0f2ff10c57", "score": "0.4591524", "text": "def decode; end", "title": "" }, { "docid": "c304addc6463cee3f48cb1d8f6753058", "score": "0.45803657", "text": "def standard_padding; 0; end", "title": "" }, { "docid": "1af898f024d841ee212abadfedb8cbb9", "score": "0.4578243", "text": "def header\n @version, @flags, @numStrikes = @bytes[0, 8].unpack('nnN')\n\n @strikeOffset = (0...@numStrikes).map do |n|\n start = 8 + n * 4\n @bytes[start, 4].unpack('N')[0]\n end\n end", "title": "" }, { "docid": "38e75b4a18f42b2e68da31b68db72884", "score": "0.45714864", "text": "def decode(encoded)\n encoded.map { |n, e| e.nil? ? n : [e] * n }.flatten\nend", "title": "" }, { "docid": "39419d668e015b34779412930a2f4b7d", "score": "0.4570133", "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": "4cefe52368c13d2f7cdc2ab475e0547c", "score": "0.45652878", "text": "def iv_len\n 4\n end", "title": "" }, { "docid": "105e3b7f79ef16a256a46ff4fba12b74", "score": "0.455918", "text": "def crypt_keeper_payload_parse(payload)\n payload.encode('UTF-8', 'binary',\n invalid: :replace, undef: :replace, replace: '')\n end", "title": "" }, { "docid": "0f0991a7971cf6ec6b0752eb575d866e", "score": "0.45580196", "text": "def decode_aes256_cbc_plain data\n if data.empty?\n ''\n else\n # TODO: Check for input validity!\n _decode_aes256 :cbc, data[1, 16], data[17..-1]\n end\n end", "title": "" }, { "docid": "0ff834186944208397e766b867e9bc09", "score": "0.45407838", "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": "8cb4c3930e3601c15acac92185979d29", "score": "0.45347878", "text": "def unmask(message, key)\n masked = []\n mask_bytes = key.unpack(\"C4\")\n i = 0\n message.each_byte do |byte|\n masked << (byte ^ mask_bytes[i % 4])\n i += 1\n end\n #p :unmasked => masked.pack(\"C*\"), :original => message\n return masked.pack(\"C*\")\n end", "title": "" }, { "docid": "29d55578d39b53d4d531eefc315c27c6", "score": "0.45344165", "text": "def local_header_offset=(_arg0); end", "title": "" }, { "docid": "6abb57130ebaf2e61a74e5e573c82dd8", "score": "0.4534118", "text": "def _lex_trans_keys=(_arg0); end", "title": "" }, { "docid": "6abb57130ebaf2e61a74e5e573c82dd8", "score": "0.4534118", "text": "def _lex_trans_keys=(_arg0); end", "title": "" }, { "docid": "6abb57130ebaf2e61a74e5e573c82dd8", "score": "0.4534118", "text": "def _lex_trans_keys=(_arg0); end", "title": "" }, { "docid": "6abb57130ebaf2e61a74e5e573c82dd8", "score": "0.4534118", "text": "def _lex_trans_keys=(_arg0); end", "title": "" }, { "docid": "d7e774ecd42e758af1f5cda1b6a377a9", "score": "0.4532978", "text": "def full_armored_ais_payload\n # get the full message and fill bits for the last one\n ptr = self\n ret = \"\"\n loop do\n break if ptr.raw_ais_payload.nil? # guard against rare instances of message corruption\n ret << ptr.raw_ais_payload\n break if ptr.next_part.nil? # stop when we run out of messages in the chain\n ptr = ptr.next_part\n end\n ret\n end", "title": "" }, { "docid": "4b4b373c8b61adad78c346b6cd387d11", "score": "0.45305645", "text": "def init(string)\n return string[0]\nend", "title": "" }, { "docid": "ba4f5d08d2c001ef880e0eebaa143b0e", "score": "0.45223764", "text": "def initpos_1\n return [0,0]\n end", "title": "" }, { "docid": "e4a89183f0fe28dec2784ed7a1489e33", "score": "0.4517241", "text": "def ebsin_decode(data, key)\n rc4 = RubyRc4.new(key)\n (Hash[ rc4.encrypt(Base64.decode64(data.gsub(/ /,'+'))).split('&').map { |x| x.split(\"=\") } ]).slice(* NECESSARY )\n end", "title": "" }, { "docid": "e4a89183f0fe28dec2784ed7a1489e33", "score": "0.4517241", "text": "def ebsin_decode(data, key)\n rc4 = RubyRc4.new(key)\n (Hash[ rc4.encrypt(Base64.decode64(data.gsub(/ /,'+'))).split('&').map { |x| x.split(\"=\") } ]).slice(* NECESSARY )\n end", "title": "" }, { "docid": "cd65481017c9a6e01f744b8c2384ebd3", "score": "0.4516752", "text": "def initialize\n hip_struct = LAME.hip_decode_init\n super(hip_struct)\n end", "title": "" }, { "docid": "5f5ad07c524c41fdb5f4199b3ba0bc2a", "score": "0.45093387", "text": "def mark_IV_encoder(first_wheel_index,second_wheel_index,message_to_encode)\n input_array = message_to_encode.split(//)\n wheel_three_index= message_to_encode.split(//).map{|z|[$keyboard.index(z)]}.flatten!\n wheel_three_index.insert(0,0)\n output_array=[]\n for i in 0...input_array.length\n output_char = mark_II_encoder(first_wheel_index,second_wheel_index,input_array[i])\n output_array.push mark_I_encoder(2 * Integer(wheel_three_index[i]),output_char)\n end\n mark_IV_encoded_message = output_array.join\n return mark_IV_encoded_message\nend", "title": "" }, { "docid": "0ce8ce5425dea06dfb61e8caf8133c4c", "score": "0.45047912", "text": "def zero_start\n @chr_start - 1\n end", "title": "" }, { "docid": "8c820ea9afa220dec7d6d4025f066120", "score": "0.45023048", "text": "def previous_output\n @prev_out.reverse.unpack(\"H*\")[0]\n end", "title": "" }, { "docid": "bb330fca794a94123a3af29dfd446901", "score": "0.44961578", "text": "def caesar_decode(string, offset)\n caesar_encode(string,offset*-1)\nend", "title": "" }, { "docid": "9dd7338c5f697f63ea9dbb32e18176e5", "score": "0.44936216", "text": "def decode_string(bytes)\n bytes.map(&:chr)\n .join\n .gsub(/#{0.chr}*$/, '')\n end", "title": "" }, { "docid": "54f96c391f7d8e07f7ad6ce62c126e74", "score": "0.4489786", "text": "def iv_len; end", "title": "" }, { "docid": "177f5db82604b74a14567faf36d02598", "score": "0.4487982", "text": "def initialize_content\n content = []\n num = 0\n (0..@size).each do\n num = 0 if (num != 0 && num % ((@size+1)/8) == 0)\n content << num.to_s(16)\n num+=1\n end\n content\n end", "title": "" }, { "docid": "d41d57aa42a9ec3e1a4e3475871e1f45", "score": "0.4483076", "text": "def local_header_offset; end", "title": "" }, { "docid": "09adac0c88882c746e9323885e3dcbf9", "score": "0.44827303", "text": "def starting_chars\n if self.init\n if self.init.error.kind_of? State\n :everything\n else\n self.init.keys\n end\n else\n []\n end\t\n end", "title": "" }, { "docid": "03bfa7ee2f16c0b1a71a57e5efba95b9", "score": "0.44808045", "text": "def get_begin\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return 0\n end\n\n fbe_struct_offset = read_uint32(fbe_offset)\n if (fbe_struct_offset == 0) || ((@_buffer.offset + fbe_struct_offset + 4 + 4) > @_buffer.size)\n return 0\n end\n\n fbe_struct_size = read_uint32(fbe_struct_offset)\n if fbe_struct_size < (4 + 4)\n return 0\n end\n\n @_buffer.shift(fbe_struct_offset)\n fbe_struct_offset\n end", "title": "" }, { "docid": "03bfa7ee2f16c0b1a71a57e5efba95b9", "score": "0.44808045", "text": "def get_begin\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return 0\n end\n\n fbe_struct_offset = read_uint32(fbe_offset)\n if (fbe_struct_offset == 0) || ((@_buffer.offset + fbe_struct_offset + 4 + 4) > @_buffer.size)\n return 0\n end\n\n fbe_struct_size = read_uint32(fbe_struct_offset)\n if fbe_struct_size < (4 + 4)\n return 0\n end\n\n @_buffer.shift(fbe_struct_offset)\n fbe_struct_offset\n end", "title": "" }, { "docid": "03bfa7ee2f16c0b1a71a57e5efba95b9", "score": "0.44808045", "text": "def get_begin\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return 0\n end\n\n fbe_struct_offset = read_uint32(fbe_offset)\n if (fbe_struct_offset == 0) || ((@_buffer.offset + fbe_struct_offset + 4 + 4) > @_buffer.size)\n return 0\n end\n\n fbe_struct_size = read_uint32(fbe_struct_offset)\n if fbe_struct_size < (4 + 4)\n return 0\n end\n\n @_buffer.shift(fbe_struct_offset)\n fbe_struct_offset\n end", "title": "" }, { "docid": "03bfa7ee2f16c0b1a71a57e5efba95b9", "score": "0.44808045", "text": "def get_begin\n if (@_buffer.offset + fbe_offset + fbe_size) > @_buffer.size\n return 0\n end\n\n fbe_struct_offset = read_uint32(fbe_offset)\n if (fbe_struct_offset == 0) || ((@_buffer.offset + fbe_struct_offset + 4 + 4) > @_buffer.size)\n return 0\n end\n\n fbe_struct_size = read_uint32(fbe_struct_offset)\n if fbe_struct_size < (4 + 4)\n return 0\n end\n\n @_buffer.shift(fbe_struct_offset)\n fbe_struct_offset\n end", "title": "" }, { "docid": "0e435bbb6356055486bcb74b07b1ae44", "score": "0.44767267", "text": "def convert_payload_to_message(payload)\n message_array = []\n SSE_FIELDS.each do |field|\n value = if payload[field]\n payload[field]\n elsif field == :id\n SecureRandom.hex\n end\n\n message_array << \"\\n#{field}: #{value}\" if value\n end\n\n message_array << \"\\n\\n\"\n message_array.join(\"\")\n end", "title": "" }, { "docid": "83756398727181a94f08d5b5b8968db7", "score": "0.44762588", "text": "def inflate\n end", "title": "" }, { "docid": "cb342bedb4aac9c39a1586be20402c35", "score": "0.44761547", "text": "def initial\n chr\n end", "title": "" }, { "docid": "da2386e95bcbd18478750d245c2e6871", "score": "0.44711596", "text": "def from_base64\n unpack(\"m\").first\n end", "title": "" }, { "docid": "7386d388112c102bb54eb2a73fccf39e", "score": "0.44708037", "text": "def vvec( ver )\n\t\treturn ver.split('.').collect {|char| char.to_i }.pack('N*')\n\tend", "title": "" }, { "docid": "e6d7b33d2fa9e68b49ac1262f283fa13", "score": "0.4469995", "text": "def inflate(data); end", "title": "" }, { "docid": "7386d388112c102bb54eb2a73fccf39e", "score": "0.44697565", "text": "def vvec( ver )\n\t\treturn ver.split('.').collect {|char| char.to_i }.pack('N*')\n\tend", "title": "" }, { "docid": "7386d388112c102bb54eb2a73fccf39e", "score": "0.44697565", "text": "def vvec( ver )\n\t\treturn ver.split('.').collect {|char| char.to_i }.pack('N*')\n\tend", "title": "" }, { "docid": "7386d388112c102bb54eb2a73fccf39e", "score": "0.44697565", "text": "def vvec( ver )\n\t\treturn ver.split('.').collect {|char| char.to_i }.pack('N*')\n\tend", "title": "" }, { "docid": "7386d388112c102bb54eb2a73fccf39e", "score": "0.44697565", "text": "def vvec( ver )\n\t\treturn ver.split('.').collect {|char| char.to_i }.pack('N*')\n\tend", "title": "" }, { "docid": "7386d388112c102bb54eb2a73fccf39e", "score": "0.44697565", "text": "def vvec( ver )\n\t\treturn ver.split('.').collect {|char| char.to_i }.pack('N*')\n\tend", "title": "" }, { "docid": "be62393be6b8f85014276dcf213866e2", "score": "0.4469008", "text": "def initWithCoder decoder\n self.init\n self.message = decoder.decodeWithObjectForKey \"message\"\n self.id = decoder.decodeWithObjectForKey \"id\"\n self\n end", "title": "" }, { "docid": "ceb3c08cae9e66e4bb25d02e499adddf", "score": "0.44637236", "text": "def post_init\n # setup single-shot version of receive_marshalled_message\n class <<self\n alias_method :receive_marshalled_message, :receive_handshake_message\n end\n end", "title": "" }, { "docid": "f46339b1ef158a34f420cc7c637cd05e", "score": "0.44602975", "text": "def initialize(message, ml = nil, h0 = 0x67452301, h1 = 0xEFCDAB89, h2 = 0x98BADCFE, h3 = 0x10325476, h4 = 0xC3D2E1F0)\n # Message length in bits (always a multiple of the number of bits in a character).\n ml ||= message.size * 8\n\n # Pre-processing:\n # ---------------\n # Append the bit '1' to the message; e.g., by adding 0x80 if message length is a multiple of 8 bits.\n message += 0x80.chr\n\n # Append 0 ≤ k < 512 bits '0', such that the resulting message length in bits is congruent to −64 ≡ 448 (mod 512).\n # Since 512 is a power of two (2**9), it is much faster to perform modulo via bitwise (i & (n - 1)) than via the modulo operator (%).\n message += \"\\0\" * ((448 / 8 - message.size) & ((512 - 1) / 8))\n\n # Append ml, the original message length, as a 64-bit big-endian integer. Thus, the total length is a multiple of 512 bits.\n message += [ml].pack('Q>') # Unsigned 64-bit integer (big-endian).\n\n # Process the message in successive 512-bit chunks:\n message.chunk(64).each do |chunk|\n # For each chunk, break chunk into sixteen 32-bit big-endian words w[i], 0 ≤ i ≤ 15.\n w = chunk.chunk(64 / 16).map { |word| word.unpack('L>')[0] }\n\n # Extend the sixteen 32-bit w into eighty 32-bit w:\n (16..79).each do |i|\n w[i] = (w[i - 3] ^ w[i - 8] ^ w[i - 14] ^ w[i - 16]).left_rotate(1)\n end\n\n # Initialize hash value for this chunk:\n a = h0\n b = h1\n c = h2\n d = h3\n e = h4\n\n # Main loop:\n (0..79).each do |i|\n if i <= 19\n f = (b & c) | ((~b) & d)\n k = 0x5A827999\n elsif i.between?(20, 39)\n f = b ^ c ^ d\n k = 0x6ED9EBA1\n elsif i.between?(40, 59)\n f = (b & c) | (b & d) | (c & d)\n k = 0x8F1BBCDC\n elsif i.between?(60, 79)\n f = b ^ c ^ d\n k = 0xCA62C1D6\n end\n\n temp = a.left_rotate(5) + f + e + k + w[i] & 0xffffffff\n e = d\n d = c\n c = b.left_rotate(30)\n b = a\n a = temp\n end\n\n # Add this chunk's hash to result so far:\n h0 = (h0 + a) & 0xffffffff\n h1 = (h1 + b) & 0xffffffff\n h2 = (h2 + c) & 0xffffffff\n h3 = (h3 + d) & 0xffffffff\n h4 = (h4 + e) & 0xffffffff\n end\n\n # Produce the final hash value (big-endian) as a 160-bit number:\n hh = (h0 << 128) | (h1 << 96) | (h2 << 64) | (h3 << 32) | h4\n\n # Return the hash / message digest as hex:\n @digest = hh\n end", "title": "" }, { "docid": "a7a93faa100a3648cbd2d3d469ea5edb", "score": "0.44595414", "text": "def initial_parse(binstr)\n return false unless binstr\n\n if binstr[0, 2] != self.class.const_get(:HEADER_ID)\n warn 'WARNING: weird extra field header ID. Skip parsing it.'\n return false\n end\n\n [binstr[2, 2].unpack1('v'), binstr[4..-1]]\n end", "title": "" }, { "docid": "e8cd557622ecd23ed86993e1f3146522", "score": "0.44519025", "text": "def separate_iv_ciphertext(cipher, iv_ciphertext)\n idx = cipher.iv_len\n [iv_ciphertext[0..(idx - 1)], iv_ciphertext[idx..-1]]\n end", "title": "" }, { "docid": "a1520af5df73e7ef46274674925e1d84", "score": "0.44513628", "text": "def translate_sequence(token)\n return token.value['sequence']\n end", "title": "" }, { "docid": "39e8a30f29062d5451958a3d78394297", "score": "0.44405296", "text": "def decoder(message)\n translated = message\n translated.gsub!(/\\w/).each do |letter|\n if letter.ord + 13 < 122\n letter.gsub!(letter, (letter.ord + 13).chr)\n else\n letter.gsub!(letter, (letter.ord-13).chr)\n end\n end\nend", "title": "" }, { "docid": "b2ccfb4a90ad1127b7675a089540041c", "score": "0.4434971", "text": "def initialize(msg = nil)\n if msg.nil?\n @header = ((0).chr) * LENGTH\n @message = \"\"\n else\n @msg = msg\n @header = msg[0..(LENGTH - 1)]\n @message = msg[LENGTH..(msg.length - 1)]\n end\n end", "title": "" }, { "docid": "4ccd5fba917d89105edb24fa70e68c33", "score": "0.44321138", "text": "def decrypt(message)\n\tcounter = 0\n\twhile counter < message.length\n\tif message[counter] == ' '\n\t\tmessage[counter] = ' '\n\t\tcounter += 1\n\telse\n\t\talphabet = 'abcdefghijklmnopqrstuvwxyz'\n\t\tinstance_in_alphabet = alphabet[alphabet.index(message[counter])]\n\t\tmessage[counter] = alphabet[(alphabet.index(instance_in_alphabet)) - 1] \n\t\tcounter += 1 \n\tend\n\tend\nreturn message\nend", "title": "" }, { "docid": "48ea5228e0eb8d7bfe5ee4b977fadd08", "score": "0.44268462", "text": "def encode_finalize_stub(state, stub)\n\t\tstub[22, 2] = [ state.key.to_i ].pack('N')[0, 2]\n\t\tstub[26, 2] = [ state.key.to_i ].pack('N')[2, 2]\n\n\t\tstub\n\tend", "title": "" }, { "docid": "a094fe724e5db1899e14ed60fe2a9ac9", "score": "0.44200718", "text": "def to_s(); self.unpad[0] end", "title": "" } ]
91f9679aeab766445e3872aa4eb91483
Helper: labeled_checkbox (Helpers) Draws a checkbox with a label. Usage labeled_checkbox(label, name, value[, attributes]]) Example != labeled_checkbox "I accept", :accept, true
[ { "docid": "aeefe576d3394238aded0fb41d3bcdd4", "score": "0.8500716", "text": "def labeled_checkbox(label, name, value, options={})\n id = options.delete(:id) || name\n\n attrs = options.map { |(k, v)| \" #{h k}='#{h v}'\" }.join('')\n\n [ \"<label#{attrs} class='checkbox' for='#{id}'>\",\n checkbox(name, value, :id => id),\n \"<span>#{h label}</span>\",\n \"</label>\"\n ].join(\"\\n\")\n\n end", "title": "" } ]
[ { "docid": "11f6064510fbf1d063f80ef45360b5b6", "score": "0.7410696", "text": "def labeled_checkbox( text, checked, object, property )\n tag_id = object.to_s.gsub(/[\\[,\\]]/, \"_\") + \"_\" + property.to_s\n adds = \"checked='checked'\" if checked\n\n str = \"<input type='checkbox' name='#{object+\"[\"+property.to_s+\"]\"}' value='#{property}' id='#{tag_id}' #{adds} />&nbsp;\"\n str += \"<label for='#{tag_id}'><a class='hidden_link' style='display: inline' href=\\\"javascript:toggleCheckBox('#{tag_id}')\\\">#{h(text)}</a></label>\\n\" \n\n return str\n end", "title": "" }, { "docid": "439850b2755477ed223b296cf9082b22", "score": "0.7087776", "text": "def check_box_field(attr, options = {}, &block)\n label_text = options.delete :label\n input_html = input_html_for attr, options, &block\n errors_html = errors_html_for attr\n label_html_for attr, class: 'check-box-label' do\n @template.content_tag(:span, input_html, class: 'check-box-wrapper') +\n @template.content_tag(:span, label_text, class: 'label-text') +\n errors_html\n end\n end", "title": "" }, { "docid": "74cbdd4ca39604b53144bd4c2bd00dbf", "score": "0.7071626", "text": "def consent_checkbox_label\n # unit_test_no_generate: consent_checkbox_label, label.className(create_ats_regex_string(\"ats-consentboxlbl\"))\n $tracer.trace(__method__)\n return ToolTag.new(label.className(create_ats_regex_string(\"ats-consentboxlbl\")), __method__)\n end", "title": "" }, { "docid": "69689ede9ea522fb7e0d361010d52434", "score": "0.68986773", "text": "def html_label\n check_box_tag(input_name(:fields, true, nil), name, active, :id => dom_id(:active), :onclick => js_active_toggle) + h(label)\n end", "title": "" }, { "docid": "0bbe44bdfae0a17db6b78848267bc863", "score": "0.6748493", "text": "def labelled_check_box(method, text = nil, check_box_options = {})\n label_options = check_box_options.delete(:label) || {}\n if check_box_options[:editable] == false\n %Q{#{label(method, \"#{text || method.to_s.titleize}\", label_options)} <div class=\"labelled\" id=\"#{object_name}_#{method}\">#{@object.send(method)}</div>}.html_safe\n else\n %Q{<div class=\"check_box\"><div class=\"input\">#{check_box(method, check_box_options)}</div><div class=\"label\">#{label(method, text || method.to_s.titleize)}</div></div>}.html_safe\n end\n end", "title": "" }, { "docid": "7f85986864a4bd079689ddb06428af30", "score": "0.6743071", "text": "def label_for_user_att_check(text, att_id)\r\n return \"<label for='#{check_box_user_att_id(att_id)}'>#{text}</label>\"\r\n end", "title": "" }, { "docid": "bbffee8d15f7c9c30a005a3e0b1bcdf3", "score": "0.6611567", "text": "def add_check_box(name, label_text, options = {}, &block)\n options = options.dup\n proc = get_command(options.delete(:command), &block)\n add_widget Tk::Tile::Checkbutton, name, label_text, options.merge(create_var: :variable), &proc\n end", "title": "" }, { "docid": "1e15638b07b80245d1ee678e0e90a72b", "score": "0.6534741", "text": "def check_box_tag(name, value = T.unsafe(nil), checked = T.unsafe(nil), options = T.unsafe(nil)); end", "title": "" }, { "docid": "fc7361f2f8789ddaefd85c342b664538", "score": "0.6503852", "text": "def truth_label(is_true, true_label = 'true', false_label = 'false')\n content_tag(:span, is_true ? true_label : false_label,\n class: ['label', is_true ? 'label-success' : 'label-danger'])\n end", "title": "" }, { "docid": "4cf5f4812ab44b20815adbae3d8ae4d6", "score": "0.6464285", "text": "def format_checkbox\n @attr[:type] = :checkbox\n @attr[:checked] = :checked if @opts[:checked]\n if @attr[:name] && !@opts[:no_hidden]\n attr = {:type=>:hidden}\n unless attr[:value] = @opts[:hidden_value]\n attr[:value] = CHECKBOX_MAP[@attr[:value]]\n end\n attr[:id] = \"#{@attr[:id]}_hidden\" if @attr[:id]\n attr[:name] = @attr[:name]\n [tag(:input, attr), tag(:input)]\n else\n tag(:input)\n end\n end", "title": "" }, { "docid": "7be6686b5bbc50f593a50560bdc9400a", "score": "0.6458699", "text": "def true_label\n raise 'Called true_label from a Non Single CheckBox type' unless single_value?\n \n label = Label.find(true_label_id)\n \n raise \"True label not set for CustomFields::CheckBox id=#{self[:id]}\" if label.nil?\n\n label\n end", "title": "" }, { "docid": "b6daa521176d0d47d826e6a11fc153f5", "score": "0.64478064", "text": "def labeled_input(label_value, attributes={}, &block)\n Haml::Engine.new(<<EOL\n%li\n -required = attributes.delete(:required)\n %label.desc{attributes}\n =label_value\n -if required\n %span.req *\n =block.call if block\nEOL\n ).render(self, :label_value => label_value, :attributes => attributes, :block => block)\n end", "title": "" }, { "docid": "b3ca7214017a4008de55625ce0709575", "score": "0.64450413", "text": "def checkbox(name, value=nil, options={})\n selected = ''\n selected = \" checked='1'\" if value\n attrs = options.map { |(k, v)| \" #{h k}='#{h v}'\" }.join('')\n\n [ \"<input type='hidden' name='#{name}' value='0'>\" +\n \"<input#{attrs} type='checkbox' name='#{name}' value='1'#{selected}>\"\n ].join(\"\\n\")\n end", "title": "" }, { "docid": "b3ca7214017a4008de55625ce0709575", "score": "0.64450413", "text": "def checkbox(name, value=nil, options={})\n selected = ''\n selected = \" checked='1'\" if value\n attrs = options.map { |(k, v)| \" #{h k}='#{h v}'\" }.join('')\n\n [ \"<input type='hidden' name='#{name}' value='0'>\" +\n \"<input#{attrs} type='checkbox' name='#{name}' value='1'#{selected}>\"\n ].join(\"\\n\")\n end", "title": "" }, { "docid": "6524e7683c16988cc3958455df8a2ddf", "score": "0.64360774", "text": "def checkbox(name = \"\", value = nil, checked = nil)\n attributes = if name.kind_of?(String)\n { \"TYPE\" => \"checkbox\", \"NAME\" => name,\n \"VALUE\" => value, \"CHECKED\" => checked }\n else\n name[\"TYPE\"] = \"checkbox\"\n name\n end\n input(attributes)\n end", "title": "" }, { "docid": "ea3703b7e153214d3ea8249dbdf99cb5", "score": "0.6429822", "text": "def true_label(is_true, true_label = 'true')\n content_tag(:span, true_label, class: %w[label label-success]) if is_true\n end", "title": "" }, { "docid": "3c278b2be1a1e4694304785c021ab67d", "score": "0.6409561", "text": "def add_checkbox(text, id=nil)\n html = <<-HTML\n <div class=\"form-group\">\n <div class=\"col-sm-3\">&nbsp;</div>\n <div class=\"col-sm-9\">\n <label>\n <input type=\"checkbox\" id=\"#{id unless id.nil?}\">\n <span class=\"lbl\"> #{text}</span>\n </label>\n </div>\n </div>\n HTML\n html.html_safe\n end", "title": "" }, { "docid": "aa4063f1b49f7d94e3f67ae1788aad58", "score": "0.6321983", "text": "def display_check_box( value )\n html = String.new\n html += \"<input type=\\\"checkbox\\\" readonly disabled\"\n html += \" checked\" if value\n html += \"/>\"\n html.html_safe\n end", "title": "" }, { "docid": "13fb8618978ff9094ecde003f27a8039", "score": "0.62365264", "text": "def check_box(method, orig_options = {}, checked_value = '1',\n unchecked_value = '0')\n options = decorate_opts_with_disabled(orig_options)\n div_wrapper do\n @template.content_tag :div, class: 'checkbox' do\n label_control(method) do\n orig_check_box(method, options, checked_value, unchecked_value) +\n method.to_s.humanize\n end\n end\n end\n end", "title": "" }, { "docid": "ea39d4da2a4b28e89eceda8750029a02", "score": "0.6233423", "text": "def add_label label\n @labels[label] = true\n\n label\nend", "title": "" }, { "docid": "c6a5618e1b2797df2bca4678a6b93b0a", "score": "0.62330973", "text": "def form_checkbox(&block)\n content_tag(:div, capture(&block), class: \"checkbox\")\n end", "title": "" }, { "docid": "c6b0efbb11ef9df4ae41e0ebbeb377cf", "score": "0.621467", "text": "def build_check_box(unchecked_value, options); end", "title": "" }, { "docid": "db31d9e88131a5470e9ca18867debb2a", "score": "0.62084526", "text": "def checkboxes_for coll, &blok\n \n @checkbox ||= Class.new do \n \n def initialize &blok\n instance_eval(&blok)\n end\n \n def text txt\n @text = txt\n end\n \n def value txt\n @value = txt\n end\n \n def name txt\n @name = txt\n end\n \n def props\n [ \n @text, \n { :name => @name, \n :type => 'checkbox', \n :value => @value \n } \n ]\n end\n \n end\n \n span_txt, attrs = @checkbox.new(&blok).props\n ele_id = \"checkbox_#{rand(1000)}_#{attrs[:value]}\"\n s_ele_id = \"selected_checkbox_#{rand(1000)}_#{attrs[:value]}\"\n \n text(capture {\n loop coll do\n \n show_if 'selected?' do\n div.box.selected {\n input( {:checked=>'checked', :id=>s_ele_id}.update attrs )\n label span_txt, :for=>s_ele_id\n }\n end\n \n if_not 'selected?' do\n div.box {\n input( {:id=>ele_id}.update attrs )\n label span_txt, :for=>ele_id\n }\n end\n \n end # === loop\n })\n\n end", "title": "" }, { "docid": "a026b6390d84668cffce46f0d54722a5", "score": "0.6207355", "text": "def label\n <<-HTML\n\n <label id=\"#{label_id}\" class=\"string #{label_classes}\">#{attribute_name.to_s.titleize}</label>\n HTML\n end", "title": "" }, { "docid": "4a46f7d5fc08e0d980b4ce1f1e8dab91", "score": "0.6198791", "text": "def add_checkbox_field(form, model, field, text, checked=false)\n html = <<-HTML\n <div class=\"form-group\">\n <div class=\"col-sm-3\">&nbsp;</div>\n <div class=\"col-sm-9\">\n <label>\n #{form.check_box(field, :checked => checked)}\n <span class=\"lbl\"> #{text}</span>\n </label>\n </div>\n </div>\n HTML\n html.html_safe\n end", "title": "" }, { "docid": "65227cf383e70af0eb24e39078b05baf", "score": "0.6168523", "text": "def build_check_box(unchecked_value = unchecked_value())\n @builder.check_box(attribute_name, input_html_options, checked_value, unchecked_value)\n end", "title": "" }, { "docid": "a2bc2c3897e29e30063739cff65ce06d", "score": "0.6161326", "text": "def label_tag(name = T.unsafe(nil), content_or_options = T.unsafe(nil), options = T.unsafe(nil), &block); end", "title": "" }, { "docid": "3b4a0f6cc87b350467ff7c40b8b697d5", "score": "0.6147573", "text": "def boolean_label(expression, value = nil)\n value = Array(value).compact\n value = %w(Ja Nein) if value.empty?\n value = expression ? value.first : value.last\n content_tag :span, value, :class => \"label label-#{expression ? 'success' : 'danger'}\"\n end", "title": "" }, { "docid": "e2b1ff64c92270801b7dca93e462d7c5", "score": "0.61312395", "text": "def check_box_tag(name, options = {})\n html = content_tag(:dt) do\n content_tag(:label , \"#{options.delete(:label)}:\", :for => options[:id])\n end\n\n options[:class] = append_class_name(options[:class], 'checkbox')\n html << content_tag(:dd) do\n checked = options.delete(:value).to_s != 'false'\n @super.hidden_field_tag(name, \"0\", :id => \"#{options[:id]}_hidden\") +\n @super.check_box_tag(name, \"1\", checked, options)\n end\n end", "title": "" }, { "docid": "d6773ad529ba330b3bdd25ae0f220b8b", "score": "0.61282814", "text": "def label_tag(name, text, options = {})\n content_tag('label', text, { 'for' => name }.merge(options.stringify_keys))\n end", "title": "" }, { "docid": "191a4e21289b6a043e3d557970cc56a7", "score": "0.61015666", "text": "def label_tag(name, text, options = {})\n content_tag('label', text, { 'for' => name }.merge(options.stringify_keys))\n end", "title": "" }, { "docid": "4bcfd03db58e31e81fb17daebef13e99", "score": "0.60892636", "text": "def label_for_field(field, options = {})\n return ''.html_safe if options.delete(:no_label)\n text = ''\n text += yield if block_given?\n text += options[:label].is_a?(Symbol) ? l(options[:label]) : options[:label] if options[:label]\n text += @template.t(field.to_s, :scope => [:activerecord, :attributes, object_name.underscore]) unless options[:label]\n @template.content_tag(:label, text.html_safe,\n :class => (block_given? ? \"checkbox \" : \"control-label \").to_s + (@object && @object.errors[field].present? ? \"error\" : nil).to_s,\n :for => (@object_name.to_s.gsub(/[\\[\\]]/,'_') + \"_\" + field.to_s).gsub(/__/, '_'))\n end", "title": "" }, { "docid": "48ab597b4acd0281f0a41d1117c03f37", "score": "0.60340226", "text": "def wiki_checkbox\n adding_field do |f|\n output = \"\".html_safe\n output << f.label(:wiki, \"Wiki\")\n output << f.check_box(:wiki)\n output\n end\n end", "title": "" }, { "docid": "f82547a9f8085d72b0e2bd848bcf2b6f", "score": "0.60339993", "text": "def labeled(label)\n wrap(\n @inner.select do |event|\n event['event'] == 'labeled' &&\n event['label'].name.downcase == label.downcase\n end,\n )\n end", "title": "" }, { "docid": "6b18599c54b2d26721cf0802d2ec7c57", "score": "0.6002529", "text": "def checkbox(&block)\n @template.form_checkbox(&block)\n end", "title": "" }, { "docid": "6c90275fc2b17b00c2588a732b3db4e0", "score": "0.59986037", "text": "def tag_checkbox(article, tags)\n html = \"\"\n return html if tags == nil || tags.empty?\n tags.each do |tag|\n checked = \"\"\n if tag.selected?(article)\n checked = \" checked\"\n end\n html << <<-HTML\n <label for=\"tag_#{tag.id}\" class=\"checkbox inline tagcheck\">\n <input type=\"checkbox\" id=\"tag_#{tag.id}\" value=\"#{tag.name}\" class=\"tagCheck\"#{checked}>#{tag.name}</input>\n </label>\n HTML\n end\n html.html_safe\n end", "title": "" }, { "docid": "4ee89903d5ad3309375a68a885386893", "score": "0.59756726", "text": "def false_label\n raise 'Called false_label from a Non Single CheckBox type' unless single_value?\n \n label = Label.find(false_label_id)\n\n raise \"True label not set for CustomFields::CheckBox id=#{self[:id]}\" if label.nil?\n\n label\n end", "title": "" }, { "docid": "68e3b3b6566e8474d8ee2e22d22953a8", "score": "0.59704", "text": "def gift_message_checkbox\n $tracer.trace(__method__)\n return ToolTag.new(span.className(create_ats_regex_string(\"ats-wis-giftmsgcheckbox\")).input, __method__)\n end", "title": "" }, { "docid": "4bdf534e192f34f9e8a882a8b8091ef4", "score": "0.59436727", "text": "def create_checkbox_field(form, value, name, label, field_id, validation: nil, readonly: false)\n render partial: 'dynamic_form/fields/checkbox_field',\n locals: {\n f: form,\n field_value: value,\n field_name: name,\n field_label: label,\n field_id:,\n readonly:,\n validation:\n }\n end", "title": "" }, { "docid": "73645c9c19b8b093f263c54fb8f0c91b", "score": "0.5925873", "text": "def check_box_tag(name, value = \"1\", checked = false, options = {}) \n\t\toptions = check_options(options)\n\t\toptions[:class] << 'check_box'\n\t\tsuper(name, value, checked, options)\n\tend", "title": "" }, { "docid": "c8b9eb216d7e2334231456b72d7d30c9", "score": "0.5901608", "text": "def input_checkbox(name)\n field = field_content(name)\n option_item(field, field_id(name), name)\n end", "title": "" }, { "docid": "e7e6e01703e5b8ffb86a5343c06bd885", "score": "0.58961195", "text": "def label(content = nil, **attributes)\n pagebuilder_basic_element('label', content, attributes)\n end", "title": "" }, { "docid": "ece7426b4597c25faeb18631f944ba59", "score": "0.5888128", "text": "def checkbox(x, y, options = { })\n options = { stroke_width: 0.5, size: 8, rounded: false, color: '000000' }.merge(options || {})\n stored_line_width = line_width\n stored_color = stroke_color\n self.line_width = options[:stroke_width]\n self.stroke_color = options[:color]\n if options[:rounded]\n stroke_rounded_rectangle [x, y], options[:size], options[:size], options[:size] * 0.2\n else\n stroke_rectangle [x, y], options[:size], options[:size]\n end\n if options[:checked]\n self.stroke_color = '000000'\n self.line_width = options[:size] * 0.125\n offset = options[:size] * 0.1\n stroke_line [x + offset, y - offset], [x + options[:size] - offset, y - options[:size] + offset]\n stroke_line [x + offset, y - options[:size] + offset], [x + options[:size] - offset, y - offset]\n end\n self.line_width = stored_line_width\n self.stroke_color = stored_color\n unless options[:label].blank?\n text_box options[:label], at: [x + options[:size] + 2.pt, y]\n end\n end", "title": "" }, { "docid": "d6183fb7506a3363dc0a576b9c6acecc", "score": "0.5879612", "text": "def checkbox(name, locator)\n define_method(name) do\n platform.click_checkbox(locator)\n end\n end", "title": "" }, { "docid": "85f019a1306a195d0fe55553ae6b0604", "score": "0.5818155", "text": "def label(attribute_name, *args); end", "title": "" }, { "docid": "bcd5783e7a878915bfb1cd07cd4ad2c1", "score": "0.5817005", "text": "def ui_checkbox_field(content = nil, options = nil, html_options = nil, &block)\n UiBibz::Ui::Core::Forms::Choices::CheckboxField.new(content, options, html_options, &block).render\n end", "title": "" }, { "docid": "24944277bcfb2795ca3b56dd21404c18", "score": "0.58162206", "text": "def gift_message_checkbox\n $tracer.trace(__method__)\n #unit_test_no_generate: gift_message_checkbox, input.className(create_ats_regex_string(\"ats-giftmsgcheckbox\"))\n return ToolTag.new(input.className(create_ats_regex_string(\"ats-giftmsgcheckbox\")), __method__, self)\n end", "title": "" }, { "docid": "bf1c6590dd8cfee3dbdcb641b1a292bc", "score": "0.5811344", "text": "def anonymous_checkbox\n adding_field do |f|\n output = \"\".html_safe\n output << f.label(:anonymous, t(\"scaffold.post_as_anonymous\"))\n output << f.check_box(:anonymous, {:class => \"checkbox\"}, true, false)\n output\n end\n end", "title": "" }, { "docid": "525ae26f8dcd4b286847cb81683fba24", "score": "0.57327276", "text": "def labeled\r\n attrs.fetch(:labeled, {})\r\n end", "title": "" }, { "docid": "3df1a90e05fc35cc5c9e62b5182797bb", "score": "0.5710247", "text": "def checkbox(item)\n name_li(item).checkbox\n end", "title": "" }, { "docid": "615feecc903380fd610dc9f56a1da82f", "score": "0.56932354", "text": "def tick\n\t\t# what_it_is >> 11\n\t\ts = \"\"\n\t\tb=1;(1..32).each {|i| s += \"<label><input type='checkbox' checked><span class='checkable'>#{SYMBOL[b]}</span></label>\" if (self.what_it_is.to_i&b)==b; b = b << 1}\n\t\ts\n\tend", "title": "" }, { "docid": "6e8011568f7f1fbc68da79f5250abac1", "score": "0.5676783", "text": "def consent_checkbox\n # unit_test_no_generate: consent_checkbox, input.className(create_ats_regex_string(\"ats-consentbox\"))\n $tracer.trace(__method__)\n return ToolTag.new(input.className(create_ats_regex_string(\"ats-consentbox\")), __method__)\n end", "title": "" }, { "docid": "32c153cfcfc145ae9da5ef88873175c3", "score": "0.5664656", "text": "def render_item_checkbox(item)\n %(<input type=\"checkbox\"\n class=\"task-list-item-checkbox\"\n #{'checked=\"checked\"' if item.complete?}\n disabled=\"disabled\"\n />)\n end", "title": "" }, { "docid": "8eb5cba7ef4bf0c60d0f8c184ce0aa29", "score": "0.5650532", "text": "def label_select_home(filter, value)\n html = nil\n if filter&.include?(value)\n html = <<-HTML\n <input class=\"form-check-input hidden required\" type=\"checkbox\" value=\"#{value}\" name=\"criteria[knowledge_level][]\" id=\"criteria_knowledge_level_#{value}\" checked>\n <label class=\"collection_check_boxes category-choice-home active\" for=\"criteria_knowledge_level_#{value}\">\n #{value.capitalize}\n </label>\n HTML\n else\n html = <<-HTML\n <input class=\"form-check-input hidden required\" type=\"checkbox\" value=\"#{value}\" name=\"criteria[knowledge_level][]\" id=\"criteria_knowledge_level_#{value}\">\n <label class=\"collection_check_boxes category-choice-home\" for=\"criteria_knowledge_level_#{value}\">\n #{value.capitalize}\n </label>\n HTML\n end\n html.html_safe\n end", "title": "" }, { "docid": "7974aa8dc5346daf83842bba870900ee", "score": "0.5631978", "text": "def check_box_toggle(name, checked, elt, ifchecked, ifnotchecked)\n check_box_tag name, 1, checked, :onchange => %Q{$('##{elt}').text($(this).is(':checked') ? '#{escape_javascript ifchecked}' : '#{escape_javascript ifnotchecked}')}\n end", "title": "" }, { "docid": "ed9a7415dd4c4c5450e49ef53ea63b67", "score": "0.562567", "text": "def check_box; end", "title": "" }, { "docid": "3c91904ab1a75e76fe2da6f3de52cf6a", "score": "0.56170094", "text": "def label_nested_input\n @builder.label(label_target,\n input + template.content_tag('span', label_text),\n label_html_options)\n end", "title": "" }, { "docid": "e428e28177a879644f2a2e6e1d86d9be", "score": "0.55718446", "text": "def checkbox_guard_for(elt_name, visible=false)\n check_box_tag(\"show_\" << elt_name.to_s, '1', visible,\n :onclick => %Q{$('##{elt_name}').slideToggle();})\n end", "title": "" }, { "docid": "54b2aee9615d12897651d055bf1a6ce9", "score": "0.5565462", "text": "def checkbox_name\n \"mail[#{name}_check]\"\n end", "title": "" }, { "docid": "1760cb57dfd18aada3b37bafe4044076", "score": "0.5546877", "text": "def checkbox(criteria = T.unsafe(nil)); end", "title": "" }, { "docid": "ad1f409e81df8b5a6bcd5d408aa9b9e7", "score": "0.55458605", "text": "def cdl_label(value)\n value ? \"Yes\" : \"No\"\n end", "title": "" }, { "docid": "98c41eec891825f3bd9c8f3a394815a6", "score": "0.55179244", "text": "def quick_checkbox(how, what)\n QuickCheckbox.new(self, how, what, parent_widget, window_id, :checkbox)\n end", "title": "" }, { "docid": "32262008aab4b49bd565f1c34c36379e", "score": "0.55151266", "text": "def boolean_check_mark(boolean)\n boolean ? content_tag(:span, image_tag('check.png', :alt => 'true', :size => '20x20')) : ''\n end", "title": "" }, { "docid": "5b53920d34a843c20441fa17e35ea4a1", "score": "0.55139816", "text": "def add_label(name, label_text, options = {})\n add_widget Tk::Tile::Label, name, label_text, options\n end", "title": "" }, { "docid": "32f2006a70d92f233c84bd5179560669", "score": "0.5508077", "text": "def label_tag(contents=nil, attrs=nil)\n contents ||= conditional_escape(@label)\n widget = @field.widget\n id_ = widget.attrs[:id] || self.auto_id\n\n if id_\n attrs = attrs ? flatatt(attrs) : ''\n contents = \"<label for=\\\"#{Widgets::Widget.id_for_label(id_)}\\\"#{attrs}>#{contents}</label>\"\n end\n\n mark_safe(contents)\n end", "title": "" }, { "docid": "fc91509dbb25df6f278f11acc3d7e87e", "score": "0.5493217", "text": "def label(*args)\n current_form_context.label(*args)\n end", "title": "" }, { "docid": "9545760c49416ce7a0987ea137c608a8", "score": "0.5488782", "text": "def click_on_label_for(label)\n find(:xpath, \"//label[@for='#{label}']\").click\n end", "title": "" }, { "docid": "52187b7e584c24ea987c4bcadd0f5f0a", "score": "0.5479886", "text": "def label(value = nil, html_options = {})\n tree = get_parents_tree\n for_attr_value = tree.collect{ |x| x[0] }.join('_')\n tags = get_tags(html_options, {:for => for_attr_value})\n value = ERB::Util::h(@name.humanize) if value.nil?\n %Q{<label #{tags}>#{value}</label>}\n end", "title": "" }, { "docid": "f6343b6a1b37339d0e85dab3ff15141f", "score": "0.547804", "text": "def tag_for_label_with_instructions( label_text, field_id, instructions )\n _html = \"\"\n _html << %{<label for=\"#{field_id}\">#{label_text}}\n _html << %{<span class=\"instructions\">#{instructions}</span>}\n _html << %{</label><br />}\n _html\n end", "title": "" }, { "docid": "fc77b25cf988ead7c7b6d972e3f53260", "score": "0.547729", "text": "def checkbox_group(name = \"\", *values)\n if name.kind_of?(Hash)\n values = name[\"VALUES\"]\n name = name[\"NAME\"]\n end\n values.collect{|value|\n if value.kind_of?(String)\n checkbox(name, value) + value\n else\n if value[-1] == true || value[-1] == false\n checkbox(name, value[0], value[-1]) +\n value[-2]\n else\n checkbox(name, value[0]) +\n value[-1]\n end\n end\n }.join\n end", "title": "" }, { "docid": "3d2aac9b90846bdf621bedd34d3aa63f", "score": "0.5476313", "text": "def input_label(name)\n field = field_content(name)\n label(field, name)\n end", "title": "" }, { "docid": "021119162a32f102b21424fa6e6d70cd", "score": "0.54757595", "text": "def checkboxes; end", "title": "" }, { "docid": "2410eff31f3d98f685bb16eb6fcf83e7", "score": "0.5474253", "text": "def click_checkbox(button, value)\n append_to_script \"click_checkbox \\\"#{button}\\\" \\\"#{value}\\\"\"\n end", "title": "" }, { "docid": "d7ca8302bdc72c3f24f244bd4ccf0d72", "score": "0.5468", "text": "def checkbox_to_function(checked = true, *args, &block)\n\t\thtml_options = args.extract_options!\n\t\tfunction = args[0] || ''\n\n\t\thtml_options.symbolize_keys!\n\t\tfunction = update_page(&block) if block_given?\n\t\ttag(\"input\",\n\t\thtml_options.merge({\n\t\t\t:type => \"checkbox\",\n\t\t\t:checked => (\"checked\" if checked),\n\t\t\t# FIXME-cpg: href should not be needed? :href => html_options[:href] || \"#\",\n\t\t\t:onclick => (html_options[:onclick] ? \"#{html_options[:onclick]}; \" : \"\") + \"#{function}; return false;\"\n\t\t})\n\t\t)\n\tend", "title": "" }, { "docid": "6657bf3db4de3bc23492a1b23a54dc08", "score": "0.54644626", "text": "def collection_check_boxes(method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil), &block); end", "title": "" }, { "docid": "0844c354dd4bda34e6ad35c75dab3132", "score": "0.5462368", "text": "def labeled?\r\n false\r\n end", "title": "" }, { "docid": "22349e2a40c73e1e8ac918cec789f624", "score": "0.5462094", "text": "def checkbox_checked\n return 'checked=checked' if show\n\n ''\n end", "title": "" }, { "docid": "5cc89590529ff8b0d3fe8ff655ab6878", "score": "0.5453131", "text": "def label(label = nil)\n @label = label if label\n @label\n end", "title": "" }, { "docid": "2b6f4c329328899b4af03c382f2c1a63", "score": "0.54442906", "text": "def label(model, field_name, label_text, options={})\n # Use the field_name option if supplied\n # The value for the for attribute.\n label_for = (model.to_s + '_' + field_name).downcase\n # The <label> tag\n label_tag = content_tag('label', label_text, :for => label_for)\n # Add an asterisk if :required option specified.\n label_tag += '*' if options[:required]\n # Finish off the label.\n label_tag += ':'\n # Wrap the <label> tag in a <strong> tag.\n content_tag('strong', label_tag)\nend", "title": "" }, { "docid": "9d924c61e3c5a18ba76a4e3010f95db2", "score": "0.54307157", "text": "def label_tag(attr_name, options = {})\n return '' if options.delete(:no_label)\n\n @template.content_tag 'label',\n \"#{(options.delete(:label) || attr_name.to_s.humanize)}:\",\n :for => \"#{@object_name}_#{attr_name}\",\n :class => (options[:long] ? 'long' : '')\n end", "title": "" }, { "docid": "f4cecfd825bf59aa0646b10b770d37bf", "score": "0.5429754", "text": "def labeled?(name)\n @labels.key?(name.to_sym)\n end", "title": "" }, { "docid": "020faae48898886c163eb185e47c5b89", "score": "0.54264444", "text": "def boolean_input(method, options)\n html_options = options.delete(:input_html) || {}\n checked = options.key?(:checked) ? options[:checked] : options[:selected]\n html_options[:checked] = checked == true if [:selected, :checked].any? { |k| options.key?(k) }\n\n input = self.check_box(method, strip_formtastic_options(options).merge(html_options),\n options.delete(:checked_value) || '1', options.delete(:unchecked_value) || '0')\n options = options_for_label(options)\n\n # the label() method will insert this nested input into the label at the last minute\n options[:label_prefix_for_nested_input] = input\n\n self.label(method, options)\n end", "title": "" }, { "docid": "8635e58f70ad12c62be0f8d284f917f2", "score": "0.5424151", "text": "def description\n 'Choose multiple values using checkbox'\n end", "title": "" }, { "docid": "53f1ec1d8602c608094f808d07df1290", "score": "0.54098415", "text": "def assert_checkbox_selected(checkbox_name)\n assert_togglebutton_selected checkbox_name\n end", "title": "" }, { "docid": "a3c164a6abbd097f8d583e63f1c6b572", "score": "0.54063314", "text": "def scaffold_label(id, text)\n \"<label for='#{id}'>#{h text}</label>\"\n end", "title": "" }, { "docid": "296c9bd25ff8ca8a2354552e4ee5c72c", "score": "0.54035556", "text": "def bool_checked(field)\n filename = field ? \"check.png\" : \"blank.gif\"\n image_tag(filename, :alt => \"yes\", :size => \"16x16\") \n end", "title": "" }, { "docid": "9643dbe42e8864a7e678fe083afb17e9", "score": "0.53922015", "text": "def purcc_checkbox\n #unit_test_no_generate: purcc_checkbox, span.className(create_ats_regex_string(\"ats-purccbox\"))\n $tracer.trace(__method__)\n return ToolTag.new(span.className(create_ats_regex_string(\"ats-purccbox\")), __method__)\n end", "title": "" }, { "docid": "ffaa413a446a07fa00313d7bb43d5533", "score": "0.53906125", "text": "def label(opts = {})\n label_for(@page, opts)\n end", "title": "" }, { "docid": "272e760f4ddd922b60748055215257e7", "score": "0.5371886", "text": "def assert_check_box(model, *attributes)\n attributes.each do |attribute|\n assert_select \"input[type=checkbox][name=?]\",\n \"#{model.to_s}[#{attribute.to_s}]\"\n end\n end", "title": "" }, { "docid": "abb497f6784c5ad57207cd7dcc96b2fd", "score": "0.537108", "text": "def format_checkbox\n @attr[:disabled] = :disabled\n @opts[:no_hidden] = true unless @opts.has_key?(:no_hidden)\n super\n end", "title": "" }, { "docid": "eb40ebb58535f0583394e8ade83a57ab", "score": "0.5320979", "text": "def label_tag(field, *args)\n\t\t\topts = args.last.is_a?(Hash) ? args.pop : {}\n\t\t\topts[:content] ||= args.shift || field.to_s.gsub('_', ' ').capitalize\n\t\t\topts[:for] ||= field\n\t\t\ttag(:label, opts)\n\t\tend", "title": "" }, { "docid": "5eeb9f5062734c7603887e97abe77954", "score": "0.53188175", "text": "def check_group(name)\n self.checkbox(:title=>\"Select #{name}\").set\n end", "title": "" }, { "docid": "e188462e7be969a7bca09bd9a5aee85a", "score": "0.5306223", "text": "def default_label?\n true\n end", "title": "" }, { "docid": "c13a49df88642f361d722340b23e4795", "score": "0.5304172", "text": "def nested_boolean_choice_field(form, name, attribute, opts = {})\n on_change = (attribute.new_record? ? \"nestedCheckboxChanged(this)\" : nil)\n class_name = (attribute.new_record? ? \"nested_checkbox\" : nil)\n\n if opts[:onchange] and on_change\n on_change += \"; #{ opts[:onchange] }\"\n end\n\n opts[:class] = \"#{ opts[:class] } #{ class_name }\"\n\n options = opts.merge({ :onchange => on_change, :index => attribute.id })\n return form.check_box(name, options)\n end", "title": "" }, { "docid": "5b797ad6ccbf018ce40cfabfce10ad51", "score": "0.53035295", "text": "def label_html_for(attr, text, options = {}, &block)\n return nil unless text\n return @template.content_tag :label, text, options if attr.nil?\n options[:class] ||= ''\n options[:class] << ' is-invalid-label' if object.errors[attr].any?\n label attr, text, options, &block\n end", "title": "" }, { "docid": "1f9411ff63813efbab62ad0ab6d0b70a", "score": "0.5299477", "text": "def label_with_icon_tag(label, icon, spin: false)\n [\n icon_tag(icon, spin: spin),\n label\n ].join(\"\\n\").html_safe\n end", "title": "" }, { "docid": "e22711af70fa98dab52923f36dd5735a", "score": "0.5297318", "text": "def wrt_checkbox(chkbox, state,loc = nil, ret = nil)\n if loc \n loc.click \n edit.click\n chkbox.send state \n save.click_no_wait\n jsClick(\"OK\")\n sleep 1\n ret.click \n else\n chkbox.send state\n end\n end", "title": "" }, { "docid": "7def0f66390e0afbc4b6520daa4238ae", "score": "0.5289405", "text": "def checkboxes_for(method,vals,options={})\n \n end", "title": "" }, { "docid": "8005e2afdbdae9fd87f622a6d16f1e41", "score": "0.52780086", "text": "def check_checkbox(checkBoxName, values=nil)\r\n elements = find_checkboxes_by_name(checkBoxName)\r\n if values\r\n values.class == Array ? arys = values : arys = [values] \r\n arys.each { |cbx_value|\r\n elements.each do |elem|\r\n elem.click if elem.attribute('value') == cbx_value && !elem.selected?\r\n end\r\n }\r\n else\r\n the_checkbox = elements[0] \r\n the_checkbox.click unless the_checkbox.selected?\r\n end\r\n end", "title": "" } ]
1f6a51acc37b6b2c275bfcf4a119a650
Set a variable to the given value.
[ { "docid": "b689a286a376e03e845b85f60d1c158b", "score": "0.7001576", "text": "def set(variable, *args, &block)\n if variable.to_s !~ /^[_a-z]/\n raise ArgumentError, \"invalid variable `#{variable}' (variables must begin with an underscore, or a lower-case letter)\"\n end\n\n if !block_given? && args.empty? || block_given? && !args.empty?\n raise ArgumentError, \"you must specify exactly one of either a value or a block\"\n end\n\n if args.length > 1\n raise ArgumentError, \"wrong number of arguments (#{args.length} for 1)\"\n end\n\n if @override_enabled && @override_vars.include?( variable )\n logger.info \"#{variable} cannot be overridden\"\n else\n value = args.empty? ? block : args.first\n sym = variable.to_sym\n protect(sym) { @variables[sym] = value }\n end\n end", "title": "" } ]
[ { "docid": "1bc48970053eda02d96faa1cbbfa25b6", "score": "0.8028821", "text": "def set_variable(name, value) \r\n \t\tmsg=\"SET VARIABLE \" + name + \" \" + value\r\n \t\tsend(msg)\r\n \t\treturn get_int_result()\r\n \tend", "title": "" }, { "docid": "ab860841da3f4c7c7dca83452a80b525", "score": "0.8000831", "text": "def set_var(val)\n self.var = val\n self\n end", "title": "" }, { "docid": "e7bbc41d365ca28e77cb20e00bf91dee", "score": "0.798096", "text": "def set_var(val)\n self.var = val\n self\n end", "title": "" }, { "docid": "1000f88f25928cbeabe3a9e56095d48f", "score": "0.797856", "text": "def set_variable(variable_name, value)\n agi \"SET VARIABLE\", variable_name, value\n end", "title": "" }, { "docid": "e183821a5993745b9b335fc782f80844", "score": "0.79644454", "text": "def set_var(name, value)\n @_var_values[name] = value\n end", "title": "" }, { "docid": "c72e1f958ed5270a0903eedd725fcee0", "score": "0.7816804", "text": "def set_variable(name, value)\n instance_variable_set(:\"@#{name}\", value)\n end", "title": "" }, { "docid": "f221604295b23e167dd9932e6e608b08", "score": "0.77090675", "text": "def set(var_name, value)\n var_name = var_name.to_s\n\n record = fetch(var_name) || new(var: var_name)\n record.value = value\n record.save!\n\n value\n end", "title": "" }, { "docid": "956d11b0ed2192c31faa5ab0b9468999", "score": "0.77061677", "text": "def set_variable(name, value=0)\n \n \n if @vars.has_key?(name)\n \n # the variable already exists\n set_var(name, @vars[name], value)\n \n else\n # create a new variable and return it\n addr = @next_var_addr\n set_var(name, addr, value)\n @next_var_addr += 4\n return addr\n \n end\n end", "title": "" }, { "docid": "99cef38b76ed9d4099678fab9739e24b", "score": "0.7644367", "text": "def set(object, value)\n object.instance_variable_set(instance_variable_name, value)\n\n self\n end", "title": "" }, { "docid": "9e7f129956e78630101a57c760adf153", "score": "0.76282537", "text": "def set(variable, value)\n set_variables << variable\n instance_variable_set(\"@#{variable}\", value)\n end", "title": "" }, { "docid": "f1a29f14b5c8885f055255d0f1022b44", "score": "0.75814945", "text": "def []=(varname, value, _ = nil)\n setvar(varname, value)\n end", "title": "" }, { "docid": "7de5f77428f509c87cf9294ccd488919", "score": "0.75076413", "text": "def set_instance_variable_to(var, value)\n set_instance_variable(var, value)\n end", "title": "" }, { "docid": "431a9c38ba537230fc9b81c049821f27", "score": "0.75038475", "text": "def set_instance_variable(var, value)\n set_instance_variable(var, value)\n end", "title": "" }, { "docid": "3850076de4cd9e5245fefeb68c9e754a", "score": "0.7488701", "text": "def set_variable(name, val)\n get_variables_by_depth[name] = val\n end", "title": "" }, { "docid": "310cc8841153260d96b44b4d2718abca", "score": "0.7475475", "text": "def set_variable(name, value)\n current_path = '/api/v1/variables'\n payload = { 'name' => name, 'value' => value }.to_json\n @conn.put(current_path, payload)\n end", "title": "" }, { "docid": "c1a50f2a7df351d821df056b0bd8b863", "score": "0.7472207", "text": "def set(name, value)\n name = atize(name)\n bind_call(:instance_variable_set, name, value)\n end", "title": "" }, { "docid": "c1dceebc7e80a5a89af0e7eb9006b029", "score": "0.74337274", "text": "def assign_variable(value)\n value=value\nend", "title": "" }, { "docid": "36d30326aad4775a9dc74322f28decf6", "score": "0.7420859", "text": "def set(variable_name, value)\n @variables[variable_name] = value\n method_name = (variable_name.to_s + \"=\").to_sym\n if @expect.methods.include?(method_name)\n @expect.method(method_name).call(value)\n end\n end", "title": "" }, { "docid": "216b02950818612c62e02fdf0d035e40", "score": "0.73933625", "text": "def put_variable(name, value)\n @driver.put_variable(@handle, name, value)\n end", "title": "" }, { "docid": "b62301cf33335e12db4cdad5b2afeea7", "score": "0.7391923", "text": "def set(var_name, value)\n \tsetting = get(var_name)\n \tif (! setting.nil?)\n \tsetting.value = value\n \tsetting.save\n else\n Settings.set(var_name, value, name)\n end\n\tend", "title": "" }, { "docid": "7e6f38658ff0213d141bb360aed09ebe", "score": "0.7380445", "text": "def set_value(v)\n @value = v\n end", "title": "" }, { "docid": "bb845e04cbd3a4278a950a4f3de5808d", "score": "0.7378795", "text": "def set_var(act, var, value)\n begin\n Twke::Conf::set(var, value)\n rescue => err\n act.say \"Failure setting variable #{var}=#{value}: #{err.inspect}\"\n end\n end", "title": "" }, { "docid": "dd916b95f51eb278b5dcc5bf2e55e893", "score": "0.73601896", "text": "def __set_var(name, val)\n @args[:communicator].communicate(type: \"set_var\", id: @args[:id], name: name, val: val)\n nil\n end", "title": "" }, { "docid": "7ec657d54b79a5565829b45e09e12cbc", "score": "0.73357403", "text": "def set_var(name, address, value=0)\n \n begin\n if @vars.has_key?(name)\n raise \"[!] ERROR: variable %s already exists at address 0x%08x\" % [name, @vars[name]]\n elsif @vars.has_value?(address)\n raise \"[!] ERROR: address 0x#{address.to_s(16)} already contains a variable.\"\n end\n end\n \n puts \"creating variable #{name} at address 0x#{address.to_s(16)}\" if @debug\n \n @vars[name] = address\n @mem[address] = value\n end", "title": "" }, { "docid": "6ce504a737bac159afe3c7a27f4d7979", "score": "0.7334667", "text": "def set(var,val) $USER.send(\"#{var}=#{val}\"); nil; end", "title": "" }, { "docid": "a93fc1426a7628f978094270503aaefa", "score": "0.7310081", "text": "def []=(var_name, value)\n\t\tv = get_variable var_name\n\t\tbegin\n\t\t\twrite_value_object v, value\n\t\trescue ToolException => ex\n\t\t\traise ToolException.new \"Tinker: error writing variable '#{v.name}': \" + ex.message\n\t\tend\n\tend", "title": "" }, { "docid": "f34d0f72d9b220f6be9b832701112d06", "score": "0.72994876", "text": "def set(key, value)\n vars[key.to_s] = value\n end", "title": "" }, { "docid": "39b50bc56944404d427d96f06be0a13a", "score": "0.72855854", "text": "def set(v)\n @val = v\n end", "title": "" }, { "docid": "39b50bc56944404d427d96f06be0a13a", "score": "0.72855854", "text": "def set(v)\n @val = v\n end", "title": "" }, { "docid": "39b50bc56944404d427d96f06be0a13a", "score": "0.72855854", "text": "def set(v)\n @val = v\n end", "title": "" }, { "docid": "c39e75e717f8082736d27ab7e0a178b9", "score": "0.7275045", "text": "def set_value(value)\n _set(:value, value)\n end", "title": "" }, { "docid": "ff9a8e8de1f4a3a749c5902959225fb6", "score": "0.72736675", "text": "def set(variable, *args, &block)\n if variable.to_s !~ /^[_a-z]/\n raise ArgumentError, \"invalid variable `#{variable}' (variables must begin with an underscore, or a lower-case letter)\"\n end\n\n if !block_given? && args.empty? || block_given? && !args.empty?\n raise ArgumentError, \"you must specify exactly one of either a value or a block\"\n end\n\n if args.length > 1\n raise ArgumentError, \"wrong number of arguments (#{args.length} for 1)\"\n end\n\n value = args.empty? ? block : args.first\n sym = variable.to_sym\n protect(sym) { @variables[sym] = value }\n end", "title": "" }, { "docid": "069d14fd420d3830d83eadc8c7c0c55d", "score": "0.7247192", "text": "def set(value)\n @value = value\n end", "title": "" }, { "docid": "53fcca46e4de7b7da5d7ab11fa75e60c", "score": "0.72268724", "text": "def set!(name, value)\n scope = innermost_binding(name)\n raise UndefinedVariable.new(\"Cannot set undefined variable '#{name}'\") if scope.nil?\n scope[name] = value\n end", "title": "" }, { "docid": "e918310860e917bebb4606eaaa858e1e", "score": "0.72175", "text": "def set(name, value)\n name = \"@#{name}\" unless name.to_s.start_with?('@')\n bind_call(Object, :instance_variable_set, name, value)\n end", "title": "" }, { "docid": "3fb2c065b65751c4f019ef4a00c3800d", "score": "0.7201448", "text": "def set!(instance, value)\n instance.instance_variable_set(instance_variable_name, value)\n end", "title": "" }, { "docid": "3c482f2a450891b1fa6eceebe6f6f0f6", "score": "0.719843", "text": "def set_variable(k,v)\n key = k.to_s.upcase.to_sym\n variables[key] = v\n end", "title": "" }, { "docid": "e5b8f59bcabc29655d5a6ca122f93527", "score": "0.7194206", "text": "def set_value variable_name, variable_value\n sysconfig.set_value(get_sysconfig_varid(variable_name), variable_value, false, false)\n end", "title": "" }, { "docid": "346900a78f27dc0c186d8a7573c4b856", "score": "0.7193992", "text": "def set(variable, value=nil, &block)\n # if the variable is uppercase, then we add it as a constant to the\n # actor. This is to allow uppercase \"variables\" to be set and referenced\n # in recipes.\n if variable.to_s[0].between?(?A, ?Z)\n klass = @actor.metaclass\n klass.send(:remove_const, variable) if klass.const_defined?(variable)\n klass.const_set(variable, value)\n end\n\n value = block if value.nil? && block_given?\n @variables[variable] = value\n end", "title": "" }, { "docid": "346900a78f27dc0c186d8a7573c4b856", "score": "0.7193992", "text": "def set(variable, value=nil, &block)\n # if the variable is uppercase, then we add it as a constant to the\n # actor. This is to allow uppercase \"variables\" to be set and referenced\n # in recipes.\n if variable.to_s[0].between?(?A, ?Z)\n klass = @actor.metaclass\n klass.send(:remove_const, variable) if klass.const_defined?(variable)\n klass.const_set(variable, value)\n end\n\n value = block if value.nil? && block_given?\n @variables[variable] = value\n end", "title": "" }, { "docid": "cfc015125bfb84bece35664fa8e39ff6", "score": "0.71646", "text": "def set_var(name, value)\n puts \"set: @#{name} = #{value}\"\n instance_variable_set(\"@#{name}\".to_sym, value)\nend", "title": "" }, { "docid": "31cc6245260db3d07b0e5a6fa60f0536", "score": "0.7146509", "text": "def set(value); end", "title": "" }, { "docid": "37d1b8035ee509bbf1f4af26dc6429ed", "score": "0.7129108", "text": "def set_variable\r\n variable_name = self[1].value\r\n global_variable_list = @current_program.global_variable_list\r\n global_variable_list[variable_name] = self[4]\r\n end", "title": "" }, { "docid": "1d523df451338770da267bf8d425e936", "score": "0.7111531", "text": "def set_variable _key, _value\n _key = \"rarma_var_#{_key}\"\n @variables[_key] = _value\n SQF.setVariable @this, _key, _value\n end", "title": "" }, { "docid": "d82bc0a175d3f53230b8096562e1e62f", "score": "0.71050596", "text": "def set_variable(var, val, override=false)\n\n fexp, v = locate_set_var(var, override) || locate_var(var)\n\n fexp.un_set_variable(:set, v, val, (fexp.h.fei != h.fei)) if fexp\n end", "title": "" }, { "docid": "fe61adf3744b2b94fde27db3e4c0cb10", "score": "0.7080531", "text": "def set_value(value)\n @value = value\n end", "title": "" }, { "docid": "9b0ee8d3d7f78df01caed063d37e84e4", "score": "0.70783097", "text": "def []=(variable_id, value)\n old_set(variable_id, value)\n $game_system.handle_bars(variable_id, value)\n end", "title": "" }, { "docid": "fd87bb23d7f8fd8fd45dee6f566a1724", "score": "0.70608157", "text": "def set(value)\n ivar_set(value)\n end", "title": "" }, { "docid": "352788686aa5af158c077c700e262f6d", "score": "0.7056408", "text": "def set_value var, value\n if node_type? value, :if\n value = value_from_if(value)\n elsif node_type? value, :case\n value = value_from_case(value)\n end\n\n if @ignore_ifs or not @inside_if\n if @meth_env and node_type? var, :ivar and env[var].nil?\n @meth_env[var] = value\n else\n env[var] = value\n end\n elsif env.current[var]\n env.current[var] = value\n elsif @branch_env and @branch_env[var]\n @branch_env[var] = value\n elsif @branch_env and @meth_env and node_type? var, :ivar\n @branch_env[var] = value\n else\n env.current[var] = value\n end\n end", "title": "" }, { "docid": "0012b847fb2886936d8bf377958e75b9", "score": "0.705198", "text": "def get_set_var(name, value)\n orig_value = @@__vars[name.to_s]\n @@__vars[name.to_s] = value\n orig_value.nil? ? 0 : orig_value\n end", "title": "" }, { "docid": "28a3477f40981c110fa77a37c7a3ac43", "score": "0.7002685", "text": "def set_var( sym, val )\n instance_variable_set( \"@#{sym}\".to_sym, val )\n end", "title": "" }, { "docid": "3dc93e98ca672d4f49b00a7ba2c248a1", "score": "0.69959146", "text": "def assign( variable, value )\n @assignments[ variable ] = value\n end", "title": "" }, { "docid": "f5ef2265087ea850af755a8e2da56fbe", "score": "0.6994997", "text": "def instance_variable_set(name, value)\n @instance_variables[name.to_sym] = value\n end", "title": "" }, { "docid": "7887498f2663bf8534cf03dfdc54e8d0", "score": "0.6992969", "text": "def set_value(value)\n set_internal_word(Integer.integer_index, value)\n end", "title": "" }, { "docid": "434835e3d914dc1d2825f45562f56307", "score": "0.6977939", "text": "def var=(var)\n write_attr :var, var\n end", "title": "" }, { "docid": "6481354ac2e834f31972a3375548158b", "score": "0.69716233", "text": "def []=(var_name, value)\n var_name = var_name.to_s\n\n record = object(var_name) || thing_scoped.new(var: var_name)\n record.value = value\n record.save!\n\n value\n end", "title": "" }, { "docid": "4615fab374ae7c5c9b684ba2bad1dd59", "score": "0.6970149", "text": "def set(value)\n gracefully { node.set(value) }\n end", "title": "" }, { "docid": "a41598a5e941dcbbca4096454fb6b9eb", "score": "0.6968146", "text": "def []=(name, value)\n @vars[name.to_s] = value\n end", "title": "" }, { "docid": "6d3cd50c842f8710dc4814e98798688f", "score": "0.69618684", "text": "def set_variable( cpuset, variable, value )\n raise ArgumentError, \"Argument is tasks - we can not set tasks here\" if variable.eql? \"tasks\"\n unless cpuset.eql? \"\"\n raise ArgumentError, \"Cpuset does not exist\" unless list_cpusets.include? cpuset\n end\n \n base = find_base_path\n\n var = variable\n var = \"cpuset.#{variable}\" unless variable.include? \"cpuset.\"\n begin \n File.open( \"#{base}#{cpuset}/#{var}\", \"w\") do |line|\n line.write value\n end\n rescue Exception => e \n puts \"Failed in setting the variable: #{@path}#{@name}/#{var} with #{value}\"\n puts \"Exiting due to exception #{e}\"\n exit\n end\n end", "title": "" }, { "docid": "0a4d2e4b88fa5995818e46929427e82d", "score": "0.692868", "text": "def set_value= val\n @value = val\n @evaluated = true\n end", "title": "" }, { "docid": "f7b6e160bc4db9903073e696b3814a12", "score": "0.6928553", "text": "def setVarValue (var_name, var_value, aBinding)\n if var_value.nil?\n var_value = ''\n end\n var_value.gsub!(/^\\s+/,'')\n if (aBinding.class != binding.class)\n aBinding[var_name] = var_value\n else\n escaped_var_value =\n var_value.gsub(/(\\\\*)'/) { |m| $1.length % 2 == 0 ? $1 + \"\\\\'\" : m }\n to_eval = \"#{var_name} = '#{escaped_var_value}'\";\n #puts \"going to eval '#{to_eval}'\"\n eval(to_eval, aBinding)\n end\n end", "title": "" }, { "docid": "dc98b2588c0d144bb19324bc5ad5bd45", "score": "0.69250524", "text": "def get_set_var(name, value)\n orig_value = @@_variables[name]\n @@_variables[name] = value\n orig_value\n end", "title": "" }, { "docid": "99783bad1c1a97b77d39ee8d8809ff96", "score": "0.69189316", "text": "def set_variable_by_name(name, value)\n new_value = @java_frame.virtualMachine.mirrorOf(value)\n variables.each do |var|\n if(var.name == name)\n set_variable(var, value)\n return\n end\n end\n end", "title": "" }, { "docid": "b8b176e759ec11ca42c881c3045051b7", "score": "0.6909967", "text": "def setvar(name, value, options = EMPTY_HASH)\n if name =~ /^[0-9]+$/\n raise Puppet::ParseError.new(_(\"Cannot assign to a numeric match result variable '$%{name}'\") % { name: name }) # unless options[:ephemeral]\n end\n unless name.is_a? String\n raise Puppet::ParseError, _(\"Scope variable name %{name} is a %{class_type}, not a string\") % { name: name.inspect, class_type: name.class }\n end\n\n # Check for reserved variable names\n if (name == VARNAME_TRUSTED || name == VARNAME_FACTS) && !options[:privileged]\n raise Puppet::ParseError, _(\"Attempt to assign to a reserved variable name: '%{name}'\") % { name: name }\n end\n\n # Check for server_facts reserved variable name\n if name == VARNAME_SERVER_FACTS && !options[:privileged]\n raise Puppet::ParseError, _(\"Attempt to assign to a reserved variable name: '%{name}'\") % { name: name }\n end\n\n table = effective_symtable(options[:ephemeral])\n if table.bound?(name)\n error = Puppet::ParseError.new(_(\"Cannot reassign variable '$%{name}'\") % { name: name })\n error.file = options[:file] if options[:file]\n error.line = options[:line] if options[:line]\n raise error\n end\n\n table[name] = value\n\n # Assign the qualified name in the environment\n # Note that Settings scope has a source set to Boolean true.\n #\n # Only meaningful to set a fqn globally if table to assign to is the top of the scope's ephemeral stack\n if @symtable.equal?(table)\n if is_topscope?\n # the scope name is '::'\n compiler.qualified_variables[name] = value\n elsif source.is_a?(Puppet::Resource::Type) && source.type == :hostclass\n # the name is the name of the class\n sourcename = source.name\n compiler.qualified_variables[\"#{sourcename}::#{name}\"] = value\n end\n end\n value\n end", "title": "" }, { "docid": "2aecc3b31f5fd4120ccb362fd420609e", "score": "0.69009876", "text": "def []=(var_name, value)\n self.send(:\"#{var_name}=\", value)\n end", "title": "" }, { "docid": "3beefb1e50317449640ae53e84527b5a", "score": "0.6883407", "text": "def setValue(value)\n @value = value\n end", "title": "" }, { "docid": "4b57b81d9371ca26a32d26cd290deec0", "score": "0.6868091", "text": "def set_value\n value = 20\nend", "title": "" }, { "docid": "6749df13c7ddede78e1042533a327def", "score": "0.6840244", "text": "def set_val(val)\n @val = val\n end", "title": "" }, { "docid": "19936fc1a3cbef752459585e1579e45e", "score": "0.683863", "text": "def set_value\n a = 5\nend", "title": "" }, { "docid": "1247376de08e36f344e9ac0f78d9db63", "score": "0.681545", "text": "def var=(val)\n attributes['var'] = val\n end", "title": "" }, { "docid": "1aa1655ec9fe27cda1533308f4383de5", "score": "0.6789002", "text": "def static_variable_set var_name, value\n var_name = var_name.to_s.to_sym unless var_name.is_a? Symbol\n static_vars[var_name] = value\n end", "title": "" }, { "docid": "f0f09a00ad5d88c2e2c92cfe458ed63f", "score": "0.6776077", "text": "def set(key, value)\n k = key.to_sym\n self.class.define_variable_accessor(key) unless self.methods.include?(k)\n @variables[k] = value\n end", "title": "" }, { "docid": "299cf613d84d6fb6472f29ce84ccdb8f", "score": "0.6768935", "text": "def assign_variable(value)\n name = value\nend", "title": "" }, { "docid": "068caff49ec675c6462795971a02edae", "score": "0.6756526", "text": "def []= (key, value)\n\n @variables[key] = value\n store_itself\n end", "title": "" }, { "docid": "b3d6919e1780a986d94f1aafbf3924bb", "score": "0.6749969", "text": "def set(new_value); end", "title": "" }, { "docid": "b3d6919e1780a986d94f1aafbf3924bb", "score": "0.6749969", "text": "def set(new_value); end", "title": "" }, { "docid": "013b1165443a6c7d0ff4c697200e0897", "score": "0.6739658", "text": "def set(name, value)\n send(\"_set_#{name}\", value)\n end", "title": "" }, { "docid": "3048b86cb78328f5b7d3f19b4097426f", "score": "0.67364603", "text": "def assign(key, value)\n instance_variable_set(\"@#{key}\", value)\n end", "title": "" }, { "docid": "368398e3f4735c51c6c395aafc89c315", "score": "0.67315453", "text": "def []=(key, value)\n @variables[key.to_s] = value\n end", "title": "" }, { "docid": "368398e3f4735c51c6c395aafc89c315", "score": "0.67315453", "text": "def []=(key, value)\n @variables[key.to_s] = value\n end", "title": "" }, { "docid": "937bfa5e897528f0ce2983a4a188e18b", "score": "0.66878814", "text": "def var=(val)\n attributes['var'] = val\n end", "title": "" }, { "docid": "2d6900363150e1e0c50997899a5c163a", "score": "0.66658676", "text": "def set_value\na = 5\nend", "title": "" }, { "docid": "762ba9ef5c609a0710a3ac0ebee44fb6", "score": "0.66626555", "text": "def assign_to(variable)\n @variable = variable\n \"#{@variable} = #{create};\"\n end", "title": "" }, { "docid": "5a7d219f435346fa01ead4f42a4bac6b", "score": "0.6661942", "text": "def assign_to(variable)\n @variable = variable\n \"#{@variable} = #{create};\"\n end", "title": "" }, { "docid": "5327fc4b3f141176e54e54e5af51ba6e", "score": "0.6658979", "text": "def set(value)\n base.set(value)\n end", "title": "" }, { "docid": "88004108c3910452361b11a00b29ddb6", "score": "0.66518396", "text": "def []=(var_name, value)\n super\n end", "title": "" }, { "docid": "14fe1898278f829c0b97a14de9e09e31", "score": "0.66255134", "text": "def set_value_for(scope_type, variable_name, value)\n raise_invalid_scope_type!(scope_type)\n @registry[scope_type][variable_name] = value\n end", "title": "" }, { "docid": "a82af95c79558d6f889921025d015215", "score": "0.66072553", "text": "def set_value(setting_var, setting_value)\n # Try to find the setting in the database, if it exists. If not,\n # then a new one will be created.\n setting = Setting.find_or_initialize_by(var: setting_var)\n setting.value = setting_value\n setting.save!\n end", "title": "" }, { "docid": "de10544f7d0ccf4c0ee387798a969ce9", "score": "0.66055644", "text": "def set_value_for(scope_type, variable_name, value)\n raise_invalid_scope_type!(scope_type)\n @registry[scope_type][variable_name] = value\n end", "title": "" }, { "docid": "e30c030bb1ea6738eeb5ad51ded792cb", "score": "0.6583819", "text": "def test_set_val\n variables = Variables.new\n assert_equal 5, variables.set_var(0,5)\n end", "title": "" }, { "docid": "d845f10250aefd9ce42656dd1e087cb3", "score": "0.65804297", "text": "def homie_attr_set!(name, value)\n instance_variable_set(\"@#{name}\", value)\n end", "title": "" }, { "docid": "212110019b7abf561a2a438d9764667d", "score": "0.65729547", "text": "def set_variable_value(scope_number:, variable_name:, new_value:, call_frame_id:)\n {\n method: \"Debugger.setVariableValue\",\n params: { scopeNumber: scope_number, variableName: variable_name, newValue: new_value, callFrameId: call_frame_id }.compact\n }\n end", "title": "" }, { "docid": "7e0a420195106ce5ec1409608b204c4c", "score": "0.65456104", "text": "def set_node_value(x, v)\n x.value = v\n end", "title": "" }, { "docid": "e5b03ae2043fec2f2080acf816be6fa1", "score": "0.6526187", "text": "def assign(variable, value)\n record \"#{variable} = #{javascript_object_for(value)}\"\n end", "title": "" }, { "docid": "e5b03ae2043fec2f2080acf816be6fa1", "score": "0.6526187", "text": "def assign(variable, value)\n record \"#{variable} = #{javascript_object_for(value)}\"\n end", "title": "" }, { "docid": "3ba1a6b4068c9d42bb94b19b45d494af", "score": "0.6523151", "text": "def set ( var, value = \"\" )\n value = \"\\\"#{value}\\\"\" if QUOTED.include? var unless value =~ /^'.*'$/\n @settings << [ :set, var, value ]\n end", "title": "" }, { "docid": "fe1d6b0ed8eb0f10d27675e488440bcb", "score": "0.65013164", "text": "def []=(var_name, value)\n var_name = var_name.to_s\n \n record = object(var_name) || self.new(:config_key => var_name)\n record.value = value\n record.save\n end", "title": "" }, { "docid": "0097edd1f17bfa3914e0423343b5d2d4", "score": "0.64993215", "text": "def class_variable_set(name, value)\n @class_variables[name.to_sym] = value\n end", "title": "" }, { "docid": "d4a46b406d401147c20b10c533d61549", "score": "0.64941174", "text": "def assign_variable(type, name, value, node)\n scope = assignment_scope(type)\n variable = scope.lookup(type, name)\n\n # If there's already a variable we'll just update it.\n if variable\n variable.reference_amount += 1\n\n # `value` is not for conditional assignments as those are handled\n # manually.\n variable.value = value if value\n else\n variable = Definition::RubyObject.new(\n :type => type,\n :name => name,\n :value => value,\n :instance_type => :instance,\n :reference_amount => 0,\n :line => node.line,\n :column => node.column,\n :file => node.file\n )\n end\n\n buffer_assignment_value(value)\n\n # Primarily used by #after_send to support variable assignments as method\n # call arguments.\n if value and !value_stack.empty?\n value_stack.push(variable.value)\n end\n\n add_variable(variable, scope)\n end", "title": "" }, { "docid": "054554e90d6aa25ebdd4260201d8788f", "score": "0.6493165", "text": "def []=(key, val)\n @my_vars[key] = val\n end", "title": "" } ]
7ec01338cb79f1ca27707fbf1352a939
Start a loop, accepting a request and handling it.
[ { "docid": "a9dea216fd34523cd539bc1070bacaa5", "score": "0.714658", "text": "def start_accepting_requests\n\t\tself.log.info \"Starting the request loop.\"\n\t\tself.reactor.start_polling( ignore_interrupts: true )\n\tend", "title": "" } ]
[ { "docid": "9e2a5fc99a7471b500718dfd13aa5f6a", "score": "0.74819785", "text": "def start\n loop do\n begin\n socket = tcp_server.accept\n\n handle_request(socket)\n ensure\n socket.close\n end\n end\n end", "title": "" }, { "docid": "d0a2529c235f89cc485251304513344d", "score": "0.72117054", "text": "def run!\n start_server!\n loop do\n Thread.start(@proxy_server.accept) do |socket|\n begin\n handle_request(socket)\n rescue => e\n @logger.error(self.class) { e.message }\n @logger.error(self.class) { e.backtrace }\n ensure\n socket.close\n end\n end\n end\n end", "title": "" }, { "docid": "cbfb83390d231b45969dafd497bb234a", "score": "0.7138178", "text": "def request_loop\n @request_queue.receive_messages.each do |msg|\n yield(get_request(msg))\n end\n end", "title": "" }, { "docid": "b879fedd5c063dedbad56818944fa7eb", "score": "0.6998388", "text": "def listen\n while true\n data = $BLIX_REQUEST.pop\n response = do_handle(body)\n if response\n puts \"[DummyServer] response: data=#{data}, options=#{options}\" if $DEBUG\n $BLIX_RESPONSE.push(data)\n end\n end\n end", "title": "" }, { "docid": "8688d93b7f3266a865e7177b7af30320", "score": "0.6919759", "text": "def loop(&block)\n block ||= Proc.new { pending_requests.any? }\n session.loop{Rex::ThreadSafe.sleep(0.5); block.call }\n end", "title": "" }, { "docid": "016374e6238aba03d0594cd15312ff1f", "score": "0.69167054", "text": "def run\n Thread.start do\n begin\n while true\n main_loop\n end\n ensure\n @protocol.close if @protocol\n end\n end\n end", "title": "" }, { "docid": "977b1e9838ecef4490026bf6f99e08d6", "score": "0.6904854", "text": "def run\n loop do\n schedule(@fileserver.accept) do |client|\n loop do\n request = client.gets.chomp\n if request[0..4] == \"OPEN:\"\n open_request(request, client)\n elsif request[0..5] == \"CLOSE:\"\n close_request(request[6..request.length-1].to_s, client)\n elsif request[0..4] == \"READ:\"\n read_request(request, client)\n elsif request[0..5] == \"WRITE:\"\n write_request(request, client)\n\t elsif request[0..4] ==\"TIME:\"\n\t time_request(request, client)\n end\n end\n end\n end\n @fileserver.close\n at_exit { @pool.shutdown }\n end", "title": "" }, { "docid": "4caabe2fd7615096adfdb5a2829ceba1", "score": "0.68307686", "text": "def loop( &block )\n sanity_check\n @connection.loop(&block)\n end", "title": "" }, { "docid": "131670bd28ed6abf5f05d0c8ca598792", "score": "0.6829174", "text": "def start_server\n loop do\n socket = @server.accept\n @pool.post do\n request = socket.gets\n unless request.nil?\n response = fetch_data(request)\n socket.print build_response(response)\n socket.print \"\\r\\n\"\n socket.print response[:message]\n end\n socket.close\n end\n end\n end", "title": "" }, { "docid": "d0cd4a764df38293245a218977e2b59e", "score": "0.6829157", "text": "def start_loop\n loop do\n sleep 2\n start\n end\n rescue => e\n Torkify.logger.error { e }\n end", "title": "" }, { "docid": "9052fff3a2d920208aa892433c535437", "score": "0.68138444", "text": "def run\n loop{\n @client = @server.accept\n @serverPool.schedule(@client)\n }\n end", "title": "" }, { "docid": "9052fff3a2d920208aa892433c535437", "score": "0.68138444", "text": "def run\n loop{\n @client = @server.accept\n @serverPool.schedule(@client)\n }\n end", "title": "" }, { "docid": "bb391b8349715d6ad8e5739de0455271", "score": "0.67762417", "text": "def serving_loop\n Thread.new { socket_loop }\n @manager.management_loop\n end", "title": "" }, { "docid": "5b783ec63aae8ac7675a77a198533338", "score": "0.67699164", "text": "def run\n\t\t# Empezamos a escuchar al servidor\n\t\tlisten\n\t\t# Empezamos a enviar al servidor\n\t\tsend\n\t\t# Revisamos el estado de la conexion\n\t\t# check_alvie\n\t\t# Al terminar cerramos los Threads\n\t\t@request.join if @request.alive?\n\t\t@response.join if @response.alive?\n\tend", "title": "" }, { "docid": "8280faee61f9b41e7dc653e299a63b87", "score": "0.6736515", "text": "def run\n loop do\n memcached = Memcached.new # each client has its oun cache storage\n new_client = @tcp_Server.accept # when a new client connects to the server\n client_handler_id = rand(999999).to_s\n client_handler = ClientHandler.new(id: client_handler_id, clientSocket: new_client, memcached: memcached)\n @@clients << client_handler\n\n Thread.start(client_handler) do |handler| # open a new thread for each accepted connection\n # Here we inform the client of the connections. It's human made, so can be removed if not needed\n puts \"New connection established! Now #{@@clients.length()} clients :>\"\n puts \"WAITING FOR REQUESTS\"\n handler.send(\"Server: Connection established with Client Handler ID: #{client_handler_id}\")\n handler.send(\"Server: You are the client ##{@@clients.length()}\")\n handler.send(\"Server: You may introduce commands now\")\n listen_requests(handler) # allow communication\n end\n end.join\n end", "title": "" }, { "docid": "7d7e81419e8052c3d619e4bfb7d5e4eb", "score": "0.6731819", "text": "def start_application\n sleep(1)\n loop do\n puts \"\\nWhat price are you looking for?\"\n input = gets.chomp\n next if input.empty?\n\n @analyzer.process_request(input)\n end\n end", "title": "" }, { "docid": "b8348f6c8f04717977014e2e3591404a", "score": "0.67202884", "text": "def run\n trap('INT') { http_server.shutdown }\n http_server.start\n end", "title": "" }, { "docid": "eea2ae6fca0c924cac87587c323f4c6d", "score": "0.6708794", "text": "def run\n srv = if self.path\n UNIXServer.new(path)\n else\n TCPServer.new(host, port)\n end\n\n loop do\n io = accept_connection(srv)\n\n begin\n data = receive_data(io)\n send_data(io, handle_data(io, data)) if data\n rescue\n raise 'Connection reset by peer' if config[:debug] && io.closed?\n ensure\n io.close rescue nil\n GC.start if config[:run_gc_per_request]\n end\n end\n end", "title": "" }, { "docid": "14d1f6c5accea07edaa4892b1dbe42f4", "score": "0.66935724", "text": "def start\n loop do\n run\n end\n end", "title": "" }, { "docid": "5d533308e483a4c1e94e771232ee895a", "score": "0.66486716", "text": "def loop\n Kernel.loop do\n IO.select([@client], nil, nil, 5) or fail TimeoutError\n\n request = Request.new(read_request)\n response = Response.from_request(request)\n\n # Logs the current operation.\n Logger.log(''.tap do |s|\n s << \"#{@addrinfo.ip_address} \"\n s << \"#{request.path} -- \"\n s << \"#{response.status.code} #{response.status.message}\"\n end.send(Utils.color_for_status(response.status)))\n\n write_response(response)\n\n break if response.header[:Connection] == 'close'\n end\n ensure\n Logger.log \"client disconnected / #{$!.inspect}\".yellow\n @client.close\n end", "title": "" }, { "docid": "8f58579256de728089b997724dffb4d9", "score": "0.66420925", "text": "def do_work\r\n until @is_need_stop\r\n # @mutex.synchronize do\r\n r = @server.get_request\r\n if !r.nil?\r\n @logger.debug \"#{self}: Handling request: #{r}\"\r\n r.handle\r\n @logger.debug \"#{self}: Done handling request: #{r}, \"\r\n r.mem_free\r\n else\r\n sleep($APP_CONFIG['worker_loop_timeout'])\r\n end\r\n # end\r\n end\r\n @thread = nil #free the link to the thread, because the thread will finish here\r\n end", "title": "" }, { "docid": "e282ab6589149a07310e6ea3ef6d5fd6", "score": "0.663116", "text": "def listenLoop()\n x = Thread.new{\n i = 0\n while true\n i = i + 1\n puts \" \"\n print @name, \" Listen Loop Round: \", i\n puts \" \"\n jsonIN = @s.recv(65536)\n puts \" \"\n print @name, \" \", Time.now, \" has receaved a Message: \", jsonIN\n puts \" \"\n parsed = JSON.parse(jsonIN)\n if @netWorkMember\n self.respond( parsed )\n else\n puts \"Not a member of a Network hence I will not respond\"\n end\n end\n }\n end", "title": "" }, { "docid": "d9b5faf2e04b01c9242e1f4daf829cd4", "score": "0.65849197", "text": "def listenLoop()\n x = Thread.new {\n i = 0\n while true\n i = i + 1\n puts \" \"\n print @name, \" Listen Loop Round: \", i\n puts \" \"\n jsonIN = @socket.recv(65536)\n puts \" \"\n print @name, \" \", Time.now, \" has received a Message: \", jsonIN\n puts \" \"\n parsed = JSON.parse(jsonIN)\n if @netWorkMember\n self.respond(parsed)\n else\n puts \"Not a member of a Network, No Response\"\n end\n end\n }\n end", "title": "" }, { "docid": "2ed2483a8160ab8fdb78ab576042cb34", "score": "0.6579266", "text": "def start\n while listen\n # Loop for-ev-er\n end\n end", "title": "" }, { "docid": "f2080e0b3d2ac6e39200589631242d04", "score": "0.6569678", "text": "def run!\n start_server!\n @server_thread = Thread.new do\n loop do\n Thread.start(@server.accept) do |socket|\n begin\n handle_request(socket)\n rescue => e\n @logger.error \"#{e.class}: #{e.message}\"\n @logger.debug e.backtrace\n ensure\n closing_client = @client_mutex.synchronize do\n @clients.delete(socket)\n end\n # invoke callbacks for disconnect if there is a client to\n # disconnect\n emit(:client_disconnect, closing_client) if closing_client\n socket.close\n end\n end\n end\n end\n end", "title": "" }, { "docid": "6a01e936a1424317672c8546b18d33ae", "score": "0.65413326", "text": "def start\n\n # load config files\n @httpd_conf.load \n @mimes.load\n # initialze logger \n logger = Logger.new(@httpd_conf.logfile) \n Thread.abort_on_exception=true\n \n loop do\n puts \"Opening server socket to listen for connections\"\n\n # handle incoming request\n Thread.start(server.accept) do |client|\n worker = Worker.new(client,@httpd_conf,@mimes,logger) \n worker.handle_request\n end\n end\n\n end", "title": "" }, { "docid": "b1c18adb3b003dfbb68cda9d6a700843", "score": "0.6530906", "text": "def main_loop\n Thread.start(@protocol.accept) do |client|\n @grp.add Thread.current\n Thread.current['DRb'] = { 'client' => client ,\n 'server' => self }\n DRb.mutex.synchronize do\n client_uri = client.uri\n @exported_uri << client_uri unless @exported_uri.include?(client_uri)\n end\n loop do\n begin\n succ = false\n invoke_method = InvokeMethod.new(self, client)\n succ, result = invoke_method.perform\n if !succ && verbose\n p result\n result.backtrace.each do |x|\n puts x\n end\n end\n client.send_reply(succ, result) rescue nil\n ensure\n client.close unless succ\n if Thread.current['DRb']['stop_service']\n Thread.new { stop_service }\n end\n break unless succ\n end\n end\n end\n end", "title": "" }, { "docid": "29484ddf5f48c23568ab99773cd0ad4c", "score": "0.6523181", "text": "def start\n prepare_parser\n perform_request\n end", "title": "" }, { "docid": "1abd9aa80610b0d209be57008215afe5", "score": "0.6485235", "text": "def run\n loop do\n break unless app_loop\n end\n end", "title": "" }, { "docid": "7159c9db646621dbb1826b11de83877c", "score": "0.644766", "text": "def loop\n end", "title": "" }, { "docid": "7159c9db646621dbb1826b11de83877c", "score": "0.644766", "text": "def loop\n end", "title": "" }, { "docid": "f1c0f1d901bf2b03ddd526e590c1dd6d", "score": "0.64412004", "text": "def run\n connect = false\n until connect do\n begin\n call { |server| @server = server ; start }\n rescue\n Waves::Logger.error e.to_s\n sleep 1\n end\n connect = true\n end\n end", "title": "" }, { "docid": "5bd26a7b9860784610ad601e8c38e0ce", "score": "0.6426346", "text": "def run\n loop do\n Thread.start(server.accept) do |client|\n begin\n ServerThread.new(client,@job_queue).run\n rescue Exception => e\n STDERR.puts \"A server thread has encountered an exception:\"\n STDERR.puts \"--------------------------------\"\n STDERR.puts e.message\n STDERR.puts e.backtrace\n STDERR.puts \"--------------------------------\"\n end\n end\n end\n end", "title": "" }, { "docid": "8f1fedb59614b97b331429de521e787b", "score": "0.6424428", "text": "def loop\n end", "title": "" }, { "docid": "a5d1503b5925c0b7488d6a0952e7e3cd", "score": "0.63944197", "text": "def start\n @client.ping\n @state.set :run\n @thread ||= Thread.new{ work_loop }\n end", "title": "" }, { "docid": "ec44a4c1111e52d631eb4f2cb1fc6a01", "score": "0.6380425", "text": "def loop &block\n _loop ::Dnet, :route_loop, Entry, &block\n end", "title": "" }, { "docid": "a32aebcf867dbead2b4bfb75bcdb215f", "score": "0.636057", "text": "def listen_requests(handler)\n loop do\n message = handler.listen # expecting array\n command_data = message[0] if message != nil\n\n if command_data != nil && command_data != \"\"\n command = command_data.split(\"\\s\")[0]\n if command == \"close\" || command == \"quit\"\n remove_client(handler) # when client disconnects or closes communication\n elsif command == \"clients\"\n handler.send(\"Server has #{@@clients.length()} clients connected :D\")\n elsif command == \"server -v\"\n handler.send(\"Your SERVER VERSION is #{SERVER_VERSION} ;)\")\n else # if isn't a server request, let the client handler manage it\n handler.manage_requests(message)\n end\n end\n end\n end", "title": "" }, { "docid": "63f989d806255ad873376256c4367be2", "score": "0.6357432", "text": "def run()\n loop do\n s = @sock.gets\n break if s.nil?\n @mutex.synchronize { handle_server_input(s) }\n end\n end", "title": "" }, { "docid": "709bbccf316e0f18cc6beafb479d9f66", "score": "0.6333013", "text": "def start\n main_loop\n end", "title": "" }, { "docid": "f76809b762ce0b2b0fc56916e33a7de4", "score": "0.63253134", "text": "def listen\n connect do\n loop_routes do |route|\n if args = @client.retrieve(route)\n run(route, args)\n end\n end\n end\n end", "title": "" }, { "docid": "4d40b9f3fc7af3afa70f3449efeb7f64", "score": "0.6284266", "text": "def run\n trap_signals\n loop do\n break if signals_want_shutdown\n begin\n # IO.select returns either a triplet of lists with IO objects that\n # need attention or nil on timeout of 2 seconds.\n if needy = IO.select([server.socket, lifeline], nil, [server.socket, lifeline], 2)\n server.log.debug(\"Detected activity on: #{needy.inspect}\")\n # If the lifeline is active the server went down and we need to go\n # down as well.\n break if needy.flatten.any? { |io| !io.respond_to?(:accept_nonblock) }\n # Otherwise we handle incoming requests\n needy.flatten.each do |io|\n if io.respond_to?(:accept_nonblock)\n begin\n process_incoming_socket(*io.accept_nonblock)\n rescue Errno::EAGAIN, Errno::ECONNABORTED\n end\n end\n end\n end\n rescue EOFError, Errno::EAGAIN, Errno::EINTR, Errno::EBADF, IOError\n end\n end\n cleanup\n end", "title": "" }, { "docid": "86eadacf2cc1735ebb23e479ab3d52d3", "score": "0.6269473", "text": "def run()\n #Keep track of time so the periodic things can be done\n lastTime = Time.now().to_i\n\n while (true)\n selectRes = IO.select([@@socket, $stdin], nil, nil, SELECT_TIMEOUT)\n if (selectRes)\n # Check the read ios\n selectRes[0].each{|ioStream|\n if (ioStream.eof)\n # Got an eof? Stop the thread\n stop()\n return\n end\n\n if (ioStream == @@socket)\n data = ''\n @@lock.synchronize{\n data = @@socket.gets()\n }\n\n InputHandler::queueTask(InputHandler::SERVER_INPUT, data)\n elsif (ioStream == $stdin)\n InputHandler::queueTask(InputHandler::STDIN_INPUT, $stdin.gets())\n else\n # Got some crazy io stream\n log(ERROR, \"Got bad io stream #{ioStream}\")\n end\n }\n end\n\n now = Time.now().to_i\n if (now - lastTime >= SELECT_TIMEOUT)\n #Do periodic stuff\n lastTime = now\n InputHandler::queueTask(InputHandler::PERIODIC_ACTIONS, nil)\n end\n end\n end", "title": "" }, { "docid": "3860886497bf5cb9b27450eecea1d332", "score": "0.62692475", "text": "def run\n loop do\n # Wait for a client to connect and then create a thread for it\n Thread.new(@server.accept) do |client_socket|\n logger.info \"Accepted client: #{client_socket.peeraddr.join(':')}\"\n server_socket = TCPSocket.new(@server_host, @server_port)\n begin\n process_packets(client_socket, server_socket)\n rescue Exception => exp\n logger.error exp.to_s\n end\n logger.info \"Disconnected: #{client_socket.peeraddr.join(':')}\"\n server_socket.close\n client_socket.close\n end\n end\n end", "title": "" }, { "docid": "8c31417090965ed149b090b764d54af7", "score": "0.62541854", "text": "def run\n while true; async.handle_message @socket.read; end\n end", "title": "" }, { "docid": "847719028ee51a3eb5699d03811a1c97", "score": "0.6251484", "text": "def run_loop\n end", "title": "" }, { "docid": "b246aad1603d5e089398b7d451ef1eaa", "score": "0.6249143", "text": "def run\n make_request(@path)\n end", "title": "" }, { "docid": "0b8b002f5a4691d0a6293dc890873cb0", "score": "0.624011", "text": "def loop_forever; end", "title": "" }, { "docid": "140d5d955bda16290378f4685c767af3", "score": "0.62312883", "text": "def outlet\n loop do\n http = Net::HTTP.new(@logplex_url.host, @logplex_url.port)\n http.set_debug_output($stdout) if ENV['DEBUG']\n http.use_ssl = true if @logplex_url.scheme == 'https'\n begin\n http.start do |conn|\n num_reqs = 0\n while num_reqs < @max_reqs_per_conn\n #Blocks waiting for a request.\n req = @request_queue.deq\n @req_in_flight += 1\n resp = nil\n begin\n Timeout::timeout(@conn_timeout) {resp = conn.request(req)}\n rescue => e\n $stdout.puts(\"at=req-error msg=#{e.message}\") if ENV['DEBUG']\n next\n ensure\n @req_in_flight -= 1\n end\n num_reqs += 1\n $stdout.puts(\"at=req-sent status=#{resp.code}\") if ENV['DEBUG']\n end\n end\n rescue => e\n $stdout.puts(\"at=req-error msg=#{e.message}\") if ENV['DEBUG']\n ensure\n http.finish if http.started?\n end\n end\n end", "title": "" }, { "docid": "4a232e3a094d8af633a83516500607b6", "score": "0.6225924", "text": "def listen\n connect do\n routes.each do |route|\n @client.subscribe(route) do |args|\n run(route, args)\n end\n end\n \n loop do\n sleep 1\n end\n end\n end", "title": "" }, { "docid": "baac4c0584517ed0dadd01cc46374f2d", "score": "0.62249184", "text": "def start_loop\n unless @playing || @queue.first.nil?\n @playing = true\n loop do\n LOGGER.debug \"Started music loop for server #{@id}\"\n if @queue.empty?\n respond('I have no songs, give me a fat beat with `add`!')\n break\n end\n song = @queue.first\n play_song(song) if song.ready || wait_for_song(song)\n end\n @playing = false\n end\n end", "title": "" }, { "docid": "60dfe634bc5643286f578ab2c26790f9", "score": "0.62170887", "text": "def handler\r\n\t loop do \r\n\t socket = @rqueue.pop\r\n\t req = Request.new socket \r\n\t if req.broadcast == true\r\n\t handle_broadcast req \r\n\t else\r\n\t handle_listen req\r\n\t end\r\n\t \r\n\t end\r\n \tend", "title": "" }, { "docid": "433bacd4e0262517370d85571181a9de", "score": "0.6202345", "text": "def run\n @run_mutex.synchronize do\n fail 'cannot run without registering services' if rpc_descs.size.zero?\n @server.start\n transition_running_state(:running)\n @run_cond.broadcast\n end\n loop_handle_server_calls\n end", "title": "" }, { "docid": "2aa6bccedb50bc27c1a24407a53588e0", "score": "0.61971617", "text": "def run!\n loop do\n begin\n job = Job.new(get_apps)\n job.fetch_targets!\n post_messages!(job.to_hash)\n sleep(@interval)\n rescue Errno::ECONNREFUSED => ce\n puts \"\"\n sleep(@interval)\n end\n\n end\n end", "title": "" }, { "docid": "e5a3aa6bedff23a6cc2d2c6ad7a2315b", "score": "0.61920655", "text": "def go\n while(true)\n process_event(wait_for_event)\n end\n end", "title": "" }, { "docid": "ae20a81251871e5ea1f4b8fbf4f0ae17", "score": "0.61863816", "text": "def start\n @heroku_manager = nil\n while true do\n begin\n self.run_loop\n rescue SystemExit, Interrupt # purposeful quit, ctrl-c, kill signal etc\n raise\n rescue StandardError => e # any other error\n ErrorHandler.handle(e)\n end\n sleep @interval\n end\n end", "title": "" }, { "docid": "b6572c501a702c2453d75a43947ea937", "score": "0.61806554", "text": "def run!(frequency = 0)\n while @jabber.connected?\n @jabber.received_messages do |message|\n start = Time.now\n \n from = message.from.to_s.split('/').first\n parts = message.body.strip.split(':', 2)\n hash = parts.first\n path_parts = parts.last.split('?', 2)\n request = Request.new(hash, from, path_parts.first, ((path_parts.length == 2) ? path_parts.last : ''))\n # TODO: DRY this portion up.\n if @debug\n # Allow errors to fall through and kill the process.\n controller_response = @controller.route!(request)\n response = {:status => 200, :data => ''}.merge(controller_response)\n respond_to request, :status => response[:status], :data => response[:data]\n puts \"Responded to '#{from}' in #{(Time.now - start).to_s} seconds.\"\n else\n # Capture the errors so that the server keeps on running.\n begin\n controller_response = @controller.route!(request)\n response = {:status => 200, :data => ''}.merge(controller_response)\n respond_to request, :status => response[:status], :data => response[:data]\n rescue\n respond_to request, :status => 500\n puts \"Error responding to #{message.from.to_s.strip}:\"\n puts $!\n else\n puts \"Responded to '#{from}' in #{(Time.now - start).to_s} seconds.\"\n end\n end\n #puts \"\\n\"\n end\n if frequency > 0\n # Keep it from hogging up CPU cycles.\n sleep frequency\n end\n end\n end", "title": "" }, { "docid": "86c8d01e4ea593f7bbd9fb39dc9348f4", "score": "0.6144519", "text": "def process()\n begin\n @sock.sync=true\n req=WEBrick::HTTPRequest.new(WEBrick::Config::HTTP.dup)\n res=WEBrick::HTTPResponse.new(WEBrick::Config::HTTP.dup)\n WEBrick::Utils::set_non_blocking(@sock)\n WEBrick::Utils::set_close_on_exec(@sock)\n req.parse(@sock)\n $logger.debug \"PATH=#{req.path}\"\n $logger.debug \"QUERY=#{req.query_string}\"\n args=req.path.split('/')\n cmd=args.last()\n str=run(cmd, req.query_string)\n res.request_method=req.request_method\n res.request_uri=req.request_uri\n res.request_http_version=req.http_version\n res.keep_alive=false\n res.body=\"Accepted,#{req.path},#{str}\"\n res.status=200\n $logger.debug res.inspect()\n res.send_response(@sock)\n rescue Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPROTO=>ex\n rescue Exception => ex\n raise ex.inspect()\n end\n end", "title": "" }, { "docid": "86c8d01e4ea593f7bbd9fb39dc9348f4", "score": "0.6144519", "text": "def process()\n begin\n @sock.sync=true\n req=WEBrick::HTTPRequest.new(WEBrick::Config::HTTP.dup)\n res=WEBrick::HTTPResponse.new(WEBrick::Config::HTTP.dup)\n WEBrick::Utils::set_non_blocking(@sock)\n WEBrick::Utils::set_close_on_exec(@sock)\n req.parse(@sock)\n $logger.debug \"PATH=#{req.path}\"\n $logger.debug \"QUERY=#{req.query_string}\"\n args=req.path.split('/')\n cmd=args.last()\n str=run(cmd, req.query_string)\n res.request_method=req.request_method\n res.request_uri=req.request_uri\n res.request_http_version=req.http_version\n res.keep_alive=false\n res.body=\"Accepted,#{req.path},#{str}\"\n res.status=200\n $logger.debug res.inspect()\n res.send_response(@sock)\n rescue Errno::ECONNRESET, Errno::ECONNABORTED, Errno::EPROTO=>ex\n rescue Exception => ex\n raise ex.inspect()\n end\n end", "title": "" }, { "docid": "c0e6b314f7977896ae50fad3a4a7d1ac", "score": "0.6142856", "text": "def consuming_loop conf\n agent = Agent.new @logger\n uri, every, target = conf[\"source_uri\"], conf[\"every\"], conf[\"target\"]\n\n until Thread.current[:dying]\n begin\n remote_qm = DRb::DRbObject.new_with_uri uri\n\n queue_name = connect_qm(remote_qm, target, uri, every)\n next unless queue_name\n\n fetch(queue_name, uri) { |m|\n raise AgentError, \"agent proc failed.\" unless agent.call(m, conf)\n }\n\n rescue Exception => e\n @logger.warn { \"error in fetch-msg/agent-proc: #{e}\\n#{e.backtrace.join(\"\\n\\t\")}\" }\n end\n\n sleep every\n end\n end", "title": "" }, { "docid": "ab9e52555491fc8fa4b5588ebe8b710d", "score": "0.6141312", "text": "def start\n # the above only accepts 1 requiest. it will stop after receiving a request\n # in order to enable the server to accept more than 1 request, you need to create a loop\n loop do\n # this is an infinite loop.. this can now accept multiple vars and it will ahve separate objects per request\n # once the server socket is ready..\n # we need to tell the server socket that we're ready to accept a connection\n # the #accept method accepts the next incoming connection or it will block if there are no incoming connections at teh moment\n # it will #accept once it arrives\n # this is the socket / connetiont at we have to teh remote browser\n socket = @server.accept # THIS IS THE CLIENT SOCKET\n puts \"this is the socket var: \" + @socket.inspect\n # let's start the new conneciton inside a thread\n # NOTE: there's a big performance and memory penalty for creating a new thread => needs to put a bunch of memory\n # to increase the performance, they initialize threads and then store those threads in a $\"thread pool\" => ie. instead of initializign new threads, it leverages existing threads\n # doing what you did below slows down the server significantly\n # apache, nginx, unicorn => prefork model\n # => fork meaning it will fork right afte rthe server socket initialization (see above in TCPServer) => 2 parts: main server socket in the master process and we will make child processes by calling a method called fork. it copies the the main process and it will $share the sockets from the master process\n # to the child proceess\n Thread.new do\n # create a new isntance of the connneciton class\n connection = Connection.new(socket, @app) # now we have access to the rack application instance inside our Connection \n connection.process\n end\n end\n end", "title": "" }, { "docid": "8078389ecbcd2c688dac2d41521df409", "score": "0.61354643", "text": "def run\n loop do\n if @workQ.size < (@pool_size-1)\n Thread.start(@directoryServer.accept) do | proxy |\n @workQ.push 1\n proxy_handler(proxy)\n @workQ.pop(true)\n end\n else\n # if thread pool is full\n sleep 5 \n proxy.close\n end\n end\n end", "title": "" }, { "docid": "a9b40d0854f82d965d6c1075f80de989", "score": "0.6134925", "text": "def run\n @logger.info(\"Started.\")\n begin\n loop do\n process_incoming\n @logger.debug(\"Sleeping between actions for \" +\n \"#{SLEEP_BETWEEN_ACTIONS} seconds.\")\n sleep SLEEP_BETWEEN_ACTIONS\n process_outgoing\n @logger.debug(\"Sleeping between cycles for \" +\n \"#{SLEEP_BETWEEN_CYCLES} seconds\")\n sleep SLEEP_BETWEEN_CYCLES\n end\n rescue Interrupt\n @logger.info(\"Quitting.\")\n exit\n end\n end", "title": "" }, { "docid": "4ff1c6878027d0a6ac237f730afc6321", "score": "0.6134733", "text": "def run\n return if halted?\n\n http = request.em\n http.callback {\n Benchy.logger.info \"#{name}\\t| #{request.method.upcase} #{request.url} - HTTP #{http.response_header.status}\"\n run\n }\n http.errback {\n Benchy.logger.error \"#{name}\\t| Connection error!\"\n halt # TODO - Make this fail the ping and try again, not halt\n }\n end", "title": "" }, { "docid": "c8d467a23721abdc6d46ba809dffbe9f", "score": "0.612189", "text": "def loop; end", "title": "" }, { "docid": "4b2647f7c82134cc9ac1ce88ebf1ca7b", "score": "0.6117669", "text": "def start\n @logger.debug { \"Opening server\" }\n @tcp_server = TCPServer.new(@ip, @port)\n @logger.debug { \"Listening to #{@ip} port #{@port}\n pointing #{ROOT_DIR}\" }\n\n answer_worker = AnswerWorker.new\n client = nil\n loop do\n begin\n client = @tcp_server.accept\n @logger.debug { \"Server accepted new request\" }\n answer_worker.start(client)\n rescue Interrupt => e\n @logger.debug { \"Closing program\" }\n exit\n rescue Exception => e\n @logger.debug { \"Exception caught:\" }\n @logger.debug { e }\n end\n end\n stop\n end", "title": "" }, { "docid": "52d44059f1ff9bfc1443b44c5fdd43bc", "score": "0.61169183", "text": "def loop_handle_server_calls\n fail 'not started' if running_state == :not_started\n while running_state == :running\n begin\n an_rpc = @server.request_call\n break if (!an_rpc.nil?) && an_rpc.call.nil?\n active_call = new_active_server_call(an_rpc)\n unless active_call.nil?\n @pool.post(active_call) do |ac|\n c, mth = ac\n begin\n rpc_descs[mth].run_server_method(c, rpc_handlers[mth])\n rescue StandardError\n c.send_status(GRPC::Core::StatusCodes::INTERNAL,\n 'Server handler failed')\n end\n end\n end\n rescue Core::CallError, RuntimeError => e\n # these might happen for various reasonse. The correct behaviour of\n # the server is to log them and continue, if it's not shutting down.\n if running_state == :running\n GRPC.logger.warn(\"server call failed: #{e}\")\n end\n next\n end\n end\n # @running_state should be :stopping here\n @run_mutex.synchronize { transition_running_state(:stopped) }\n GRPC.logger.info(\"stopped: #{self}\")\n end", "title": "" }, { "docid": "357b2f3a04edc95f6b7bea00eb1b39c5", "score": "0.6095265", "text": "def start!\n until should_stop? do work end\n end", "title": "" }, { "docid": "f0bb078f0023918353ea3aa81dfa61e1", "score": "0.6094773", "text": "def run\n loop do\n tick\n sleep settings.service.polling_interval\n end\n end", "title": "" }, { "docid": "f0bb078f0023918353ea3aa81dfa61e1", "score": "0.6094773", "text": "def run\n loop do\n tick\n sleep settings.service.polling_interval\n end\n end", "title": "" }, { "docid": "a9e3825d70f1f32c5177d18a7348a652", "score": "0.60507876", "text": "def listen\n connect do\n routes.each do |queue|\n @client.subscribe(queue) do |args|\n run(queue, args)\n end\n end\n end\n while (!Thread.current[:shutdown]) do\n sleep(self.class.sleep_time)\n end\n end", "title": "" }, { "docid": "e09968ab76e4aae862e72e9c25e5baee", "score": "0.6043152", "text": "def cycle\n @initialized = true\n @socket = UDPSocket.new\n @socket.bind(@listen_address, @listen_port)\n \n initial_counters = {}\n \n if @counters_list_file && File.exist?(@counters_list_file)\n counter_keys = IO.read(@counters_list_file).split(\"\\n\")\n counter_keys.each do |key|\n initial_counters[key] = 0\n end\n end\n \n # block will be called when a request comes from the core\n # if exit is received the method will return\n network_loop(pipe, @socket, initial_counters) do |msg, counters, gauges|\n data = {}\n \n values = gauges\n \n counters.each do |k, v|\n values[k] = v / interval_in_seconds()\n end\n \n unless values.empty?\n if @host\n data['host'] = @host\n end\n \n data[@app] = {}\n data[@app][@res] = values\n end\n \n send_metrics(data)\n end\n \n end", "title": "" }, { "docid": "c36b1331aed1a944a41eb2410af0cff4", "score": "0.603629", "text": "def start()\n @state = RUNNING\n @loop.wakeup() unless @loop.nil?\n end", "title": "" }, { "docid": "17825ab388c99659d5515030b28e5d2a", "score": "0.6026875", "text": "def start\n Socket.accept_loop(@tcpserver) do |connection|\n SLogger.debug(\"[server] accepted a new connection (#{connection})\")\n\n self.session.connection = connection\n self.handle_connection(connection)\n end\n rescue IOError\n Thread.exit\n end", "title": "" }, { "docid": "1a0ebe07ce453c7898999498d80b2003", "score": "0.60194683", "text": "def run\n loop do\n client_sock = @server.accept\n client = Rsws_client.new(client_sock)\n yield client\n end\n end", "title": "" }, { "docid": "4131e69b810430607977f3e0a4dc6659", "score": "0.6017656", "text": "def listen_loop\n $stderr.print \"listen-loop called.\\n\" if @debug\n \n str = @in.gets(\"\\n\")\n if str == nil\n raise \"Socket closed.\" if @in.closed?\n sleep 0.1\n return nil\n end\n \n \n data = str.strip.split(\":\")\n raise \"Expected length of 2 or 3 but got: '#{data.length}'.\\n#{data}\" if data.length != 2 and data.length != 3\n \n raise \"Invalid ID: '#{data[1]}'.\" if data[1].to_s.strip.length <= 0\n id = data[1].to_i\n \n raise \"Invalid length: '#{data[2]}' (#{str.to_s.strip}).\" if data[2].to_s.strip.length <= 0\n length = data[2].to_i\n \n $stderr.print \"Received ID #{id}.\\n\" if @debug\n res = @in.read(length)\n \n begin\n obj = Marshal.load(res)\n $stderr.print \"Got content for '#{id}' (#{data[0]}).\\n\" if @debug\n \n case data[0]\n when \"answer\"\n #raise \"Already have answer for '#{id}'.\" if @out_answers.key?(id)\n @out_answers[id] = obj\n when \"answer_block\"\n @blocks[id][:mutex].synchronize do\n @blocks[id][:results] += obj\n end\n when \"answer_block_end\"\n $stderr.print \"Answer-block-end received!\\n\" if @debug\n @blocks[id][:block_result] = obj\n @blocks[id][:finished] = true\n when \"send\"\n Knj::Thread.new do\n result_obj = Knj::Process::Resultobject.new(:process => self, :id => id, :obj => obj)\n \n begin\n @on_rec.call(result_obj)\n rescue SystemExit, Interrupt => e\n raise e\n rescue => e\n #Error was raised - try to forward it to the server.\n result_obj.answer(\"type\" => \"process_error\", \"class\" => e.class.name, \"msg\" => e.message, \"backtrace\" => e.backtrace)\n end\n end\n when \"send_block\"\n result_obj = Knj::Process::Resultobject.new(:process => self, :id => id, :obj => obj)\n @blocks_send[id] = {:result_obj => result_obj, :waiting_for_result => false}\n \n @blocks_send[id][:enum] = Enumerator.new do |y|\n @on_rec.call(result_obj) do |answer_block|\n $stderr.print \"Running enum-block for #{answer_block}\\n\" if @debug\n \n #Block has ended on hosts side - break out of block-loop.\n break if !@blocks_send.key?(id)\n \n #Throw the result at the block running.\n y << answer_block\n \n #This is to prevent the block-loop from running again, until host has confirmed it wants another result.\n dobreak = false\n \n loop do\n #Block has ended on hosts-side - break of out block-loop.\n if !@blocks_send.key?(id)\n dobreak = true\n break\n end\n \n #If waiting for result then release the loop and return another result.\n if @blocks_send[id][:waiting_for_result]\n @blocks_send[id][:waiting_for_result] = false\n break\n end\n \n #Wait a little with checking for another result to not use 100% CPU.\n sleep 0.01\n end\n \n #The block-loop should not run again - it has been prematurely interrupted on the host-side.\n break if dobreak\n end\n end\n when \"send_block_res\"\n begin\n #The host wants another result. Set the 'waiting-for-result' and wait for the enumerator to run. Then return result from enumerator (code is right above here).\n @blocks_send[obj][:waiting_for_result] = true\n res = @blocks_send[obj][:enum].next\n self.answer(id, {\"result\" => res})\n rescue StopIteration\n self.answer(id, \"StopIteration\")\n end\n when \"send_block_end\"\n if @blocks_send.key?(obj)\n enum = @blocks_send[obj][:enum]\n @blocks_send.delete(obj)\n \n begin\n enum.next if enum #this has to be called to stop Enumerator from blocking...\n rescue StopIteration\n #do nothing.\n end\n end\n \n self.answer(id, \"ok\")\n when \"send_block_buffer\"\n Knj::Thread.new do\n result_obj = Knj::Process::Resultobject.new(:process => self, :id => id, :obj => obj)\n block_res = nil\n buffer_done = false\n \n begin\n buffer_answers = Knj::Threadsafe.std_array #JRuby needs the threadsafety.\n buffer_thread = Knj::Thread.new do\n loop do\n arr = buffer_answers.shift(200)\n \n if !arr.empty?\n $stderr.print \"Sending: #{arr.length} results.\\n\" if @debug\n self.answer(id, arr, \"answer_block\")\n else\n $stderr.print \"Waiting for buffer-stuff (#{arr.length}, #{buffer_done}).\\n\" if @debug\n sleep 0.05\n end\n \n break if buffer_done and buffer_answers.empty?\n end\n end\n \n begin\n begin\n count = 0\n block_res = @on_rec.call(result_obj) do |answer_block|\n loop do\n if buffer_answers.length > 1000\n $stderr.print \"Buffer is more than 1000 - sleeping and tries again in 0.05 sec.\\n\" if @debug\n sleep 0.05\n else\n break\n end\n end\n \n count += 1\n buffer_answers << answer_block\n \n if count >= 100\n count = 0\n \n loop do\n answer = self.send(\"obj\" => id, \"type\" => \"send_block_count\")\n $stderr.print \"Answer was: #{answer}\\n\" if @debug\n \n if answer >= 100\n $stderr.print \"More than 100 results are buffered on the other side - wait for them to be handeled before sending more.\\n\" if @debug\n sleep 0.05\n else\n $stderr.print \"Less than 100 results in buffer - send more.\\n\" if @debug\n break\n end\n end\n end\n end\n ensure\n buffer_done = true\n end\n ensure\n buffer_thread.join\n end\n rescue => e\n $stderr.print Knj::Errors.error_str(e) if @debug\n #Error was raised - try to forward it to the server.\n result_obj.answer(\"type\" => \"process_error\", \"class\" => e.class.name, \"msg\" => e.message, \"backtrace\" => e.backtrace)\n ensure\n $stderr.print \"Answering with block-end.\\n\" if @debug\n self.answer(id, block_res, \"answer_block_end\")\n end\n end\n when \"send_block_count\"\n if @blocks.key?(obj)\n count = @blocks[obj][:results].length\n else\n count = 0\n end\n \n self.answer(id, count)\n else\n $stderr.print \"Unknown command: '#{data[0]}'.\"\n raise \"Unknown command: '#{data[0]}'.\"\n end\n rescue => e\n $stderr.print Knj::Errors.error_str(e) if @debug\n #Error was raised - try to forward it to the server.\n result_obj = Knj::Process::Resultobject.new(:process => self, :id => id, :obj => obj)\n result_obj.answer(\"type\" => \"process_error\", \"class\" => e.class.name, \"msg\" => e.message, \"backtrace\" => e.backtrace)\n end\n end", "title": "" }, { "docid": "c844d471e476d39d828cacdd42cefcb8", "score": "0.60137546", "text": "def socket_loop\n @socket.listen\n loop do\n client_socket, client_addr = @socket.accept\n Thread.new(client_socket) { |client_socket| serve_client client_socket } \n end\n @manager.tem_ports\n end", "title": "" }, { "docid": "c7bff51237d2bed6ce37e6abcffd0b3f", "score": "0.6010806", "text": "def start_server\n @watchman = Thread.new {\n while !@stopped\n @pool_mutex.synchronize\n socket = @server.accept\n @pool << Thread.new(socket) {|socket|\n serve(socket)\n }\n end \n }\n end", "title": "" }, { "docid": "0c538a989792dd70b21caf2b7c4fdb1c", "score": "0.6010138", "text": "def loop_forever\n running = true\n\n while wait_for_connection\n @logger.info(\"New client connected\")\n command, *arguments = next_message.split\n @logger.debug \"#{command} received\"\n response = case command\n when /^track$/i then track(arguments.first)\n when /^list$/i then list\n when /^release$/i then release(arguments.first)\n end\n\n write(response) unless response.nil?\n end\n rescue => e\n @logger.error(\"An error occurred when waiting for new connections!\\n\\t#{e.inspect}\\n\\t#{e.backtrace.join(\"\\n\\t\")}\")\n end", "title": "" }, { "docid": "5244363105ff4b31af673c7d143fe2e8", "score": "0.60028785", "text": "def start\n receive(IO.new(3), IO.new(4)) do |f|\n f.when([:call, Array]) do |args|\n method = args[0]\n retype = args[1]\n args = args[2..-1]\n f.send! self.dispatch(method, retype, args)\n exit if Chassis.exit_after_current_dispatch\n f.receive_loop\n end\n \n f.when(:config) do\n f.send! [:result, self.config]\n f.receive_loop\n end\n \n f.when(:api) do\n f.send! [:result, self.api]\n f.receive_loop\n end\n \n f.when(:ping) do\n f.send! :pong\n f.receive_loop\n end\n \n f.when(:quit) do\n exit(0)\n end\n end\n end", "title": "" }, { "docid": "0b508bfdf1b674c119ca72b96a8211b1", "score": "0.5993246", "text": "def initiate_event_loop!\n @active = true\n\n @thread = Thread.new do\n while @active\n @session_mutex.synchronize do\n @session.process(@loop_wait)\n end\n Thread.pass\n end\n end\n end", "title": "" }, { "docid": "5f4c9b63e29e50440e7d97f8b208754d", "score": "0.5983761", "text": "def initiate_event_loop!\n @active = true\n\n @thread = Thread.new do\n while @active\n @session_mutex.synchronize do\n @session.process(@loop_wait)\n end\n Thread.pass\n end\n end\n end", "title": "" }, { "docid": "5f4c9b63e29e50440e7d97f8b208754d", "score": "0.5983761", "text": "def initiate_event_loop!\n @active = true\n\n @thread = Thread.new do\n while @active\n @session_mutex.synchronize do\n @session.process(@loop_wait)\n end\n Thread.pass\n end\n end\n end", "title": "" }, { "docid": "6b6a39b88cccbb12ffaf22e7a4611a09", "score": "0.5962481", "text": "def run_forever\n run\n sleep(10) while true\n end", "title": "" }, { "docid": "26296cdbbdd3a2fe55e022b251fd646c", "score": "0.5953892", "text": "def start_async\n while c = @serv.accept\n Thread.start do\n begin\n @threads << Thread.current\n l = Mutex.new\n loop do\n begin\n x = Dr2.read(c, [Dr2::Types::Message,\n Dr2::Types::Error])\n Thread.start {\n begin\n @threads << Thread.current\n receive x, c, l\n ensure\n l.unlock rescue nil if l.locked?\n @threads.delete Thread.current\n end\n }\n rescue Dr2::Types::EOFException\n break\n rescue Dr2::Types::QuitException\n break\n rescue Exception\n l.synchronize { Dr2.write(c, $!) }\n end\n end\n ensure\n c.close rescue nil\n @threads.delete Thread.current\n end\n end\n end\n end", "title": "" }, { "docid": "29bab0c0f520c0a3ae302afb6bd2939a", "score": "0.5947049", "text": "def start\n executor.post {read_loop}\n start_protocols\n super\n end", "title": "" }, { "docid": "5c732c3eef80c9981517740aa71d2f69", "score": "0.5943376", "text": "def start\n # we trap CTRL+C in the console and kill the server\n trap(\"INT\") { BeEF::Core::Server.instance.stop }\n \n # starts the web server\n @http_server.start\n end", "title": "" }, { "docid": "2793e2c90c3b2aec5af302cc6b0be54d", "score": "0.5937184", "text": "def main_loop\n debug(\"Entering request handler main loop\")\n reset_signal_handlers\n begin\n @graceful_termination_pipe = IO.pipe\n @graceful_termination_pipe[0].close_on_exec!\n @graceful_termination_pipe[1].close_on_exec!\n\n @main_loop_thread_lock.synchronize do\n @main_loop_generation += 1\n @main_loop_running = true\n @main_loop_thread_cond.broadcast\n\n @select_timeout = nil\n\n @selectable_sockets = []\n @server_sockets.each_value do |value|\n socket = value[2]\n @selectable_sockets << socket if socket\n end\n @selectable_sockets << @owner_pipe\n @selectable_sockets << @graceful_termination_pipe[0]\n end\n\n install_useful_signal_handlers\n start_threads\n wait_until_termination_requested\n wait_until_all_threads_are_idle\n terminate_threads\n debug(\"Request handler main loop exited normally\")\n\n rescue EOFError\n # Exit main loop.\n trace(2, \"Request handler main loop interrupted by EOFError exception\")\n rescue Interrupt\n # Exit main loop.\n trace(2, \"Request handler main loop interrupted by Interrupt exception\")\n rescue SignalException => signal\n trace(2, \"Request handler main loop interrupted by SignalException\")\n if signal.message != HARD_TERMINATION_SIGNAL\n raise\n end\n rescue Exception => e\n trace(2, \"Request handler main loop interrupted by #{e.class} exception\")\n raise\n ensure\n debug(\"Exiting request handler main loop\")\n revert_signal_handlers\n @main_loop_thread_lock.synchronize do\n @graceful_termination_pipe[1].close rescue nil\n @graceful_termination_pipe[0].close rescue nil\n @selectable_sockets = []\n @main_loop_generation += 1\n @main_loop_running = false\n @main_loop_thread_cond.broadcast\n end\n end\n end", "title": "" }, { "docid": "3c4b09f2c4d52e56c07055cddfc76b42", "score": "0.5929428", "text": "def run\n loop do\n #Kernel.exit\n if @workQ.size < (@pool_size-1)\n Thread.start(@fileServer.accept) do | client |\n @workQ.push 1\n message_handler(client)\n @workQ.pop(true)\n end\n else\n # if thread pool is full\n sleep 5 \n client.close\n end\n end\n end", "title": "" }, { "docid": "ea51e2d9716bc5ad002bcef53050b361", "score": "0.59059554", "text": "def serve\n while true\n client = nil\n\n # accept connection\n\n begin\n client = @socket.accept\n rescue => err\n @server.log(err.inspect, err)\n @server.heraldize('fizzie! Socket server trouble (in accept)! ' + err.inspect)\n break\n end\n\n # serve client\n\n begin\n refused = handle(client)\n unless refused.nil?\n client.send(\"error\\n#{refused}\\n\", 0)\n client.close\n end\n rescue => err\n begin\n client.close unless client.closed?\n rescue\n # just ignore\n end\n @server.log(err.inspect, err)\n end\n end\n end", "title": "" }, { "docid": "7a57dcbaa9fb8feeaa6ac49360deebff", "score": "0.5900311", "text": "def listen!\n EM.run do\n EM.add_periodic_timer(1) do\n if url = get_new_url\n puts \"[#{name}] Reading #{url}\"\n #check for maximum fork number here\n if pid = fork\n Process.detach pid\n else\n Worker.new url\n end\n end\n end\n end\n end", "title": "" }, { "docid": "26f487068efc7aff744f3da029497763", "score": "0.58945334", "text": "def run port, verbose_level, script_inject, upstream_host, upstream_port\n\t\tbegin\n\t\t\t# Start our server to handle connections (will raise things on errors)\n\t\t\t@socket = TCPServer.new port\n\t\t\t@verbose_level = verbose_level\n\t\t\t@upstream_host = upstream_host\n\t\t\t@upstream_port = upstream_port\n\t\t\t@script_inject = script_inject\n\n\t\t\trequest_number = 0\n\t\t\t# Handle every request in another thread\n\t\t\tloop do\n\t\t\t\ts = @socket.accept\n\n\t\t\t\tThread.new s, request_number, &method(:handle_request)\n\t\t\t\trequest_number += 1\n\t\t\tend\n\n\t\t# CTRL-C\n\t\trescue Interrupt\n\t\t\tputs 'Got Interrupt..'\n\t\t\t# Ensure that we release the socket on errors\n\t\tensure\n\t\t\tif @socket\n\t\t\t\t@socket.close\n\t\t\t\tputs 'Socked closed..'\n\t\t\tend\n\t\t\tputs 'Quitting.'\n\t\tend\n\tend", "title": "" }, { "docid": "808ad965053e681254586fe856c48f51", "score": "0.58925056", "text": "def run\n logger.debug \"[Cottontail] Connecting to client\"\n @client = Bunny.new( *settings(:client) )\n @client.start\n\n logger.debug \"[Cottontail] Declaring exchange\"\n exchange = @client.exchange( *settings(:exchange) )\n\n logger.debug \"[Cottontail] Declaring queue\"\n queue = @client.queue( *settings(:queue) )\n\n routes.keys.each do |key| \n logger.debug \"[Cottontail] Binding #{key.inspect} to exchange\"\n queue.bind( exchange, :key => key )\n end\n\n logger.debug \"[Cottontail] Entering subscribe loop\"\n subscribe! queue\n rescue => e\n @client.stop if @client\n reset!\n\n logger.error \"#{e.class}: #{e.message}\\n\\t#{e.backtrace.join(\"\\n\\t\")}\"\n\n # raise when no retries are defined\n raise( e, caller ) unless settings(:retries)\n\n logger.debug \"[Cottontail] Going to retry in #{settings(:delay_on_retry)} seconds...\"\n sleep settings(:delay_on_retry) if settings(:delay_on_retry)\n retry\n end", "title": "" }, { "docid": "88de9e70d2ad804f4e3ad5a437b3ff67", "score": "0.58843035", "text": "def start!\n http_server.start\n self\n end", "title": "" }, { "docid": "07d62a17759a714326bb37c071fa8dc8", "score": "0.5826088", "text": "def irc_loop\n while true\n until @irc.dead_socket\n sleep 15\n @irc.handle(:irc_loop)\n Thread.pass\n end\n\n # Disconnected? Wait a little while and start up again.\n @nextserver = (@nextserver+1) % @servers.length\n sleep 30\n @irc.stop_listening\n self.connect_socket\n start_listening\n end\n end", "title": "" }, { "docid": "10e093986be7c4565c393940bfcccfa1", "score": "0.5824654", "text": "def server_loop(server)\n loop do\n Thread.start(server.accept) do |client|\n _unused, remote_port, _unused, remote_ip = client.peeraddr\n @server.logging \"--> OPEN connection from #{remote_ip}:#{remote_port}\"\n client.puts @entrypoint_routine.call\n client.close\n @server.logging \"<-- CLOSE connection from #{remote_ip}:#{remote_port}\"\n end\n end\n end", "title": "" }, { "docid": "247f980a71b63cf3b22507a8cb799bbd", "score": "0.5823688", "text": "def run\n Thread.new {\n loop do\n @server.update(1000)\n break if @terminate\n end\n }\n end", "title": "" }, { "docid": "52d9c560789d8466a07217bd71d26721", "score": "0.5815588", "text": "def startHttp(callback_opts) do\n server = TCPServer.new @host, @port\n while session = server.accept\n @implementation(session, callback_opts)\n end\n end", "title": "" }, { "docid": "9991e122637394b416b7d60f5fd7c897", "score": "0.5808395", "text": "def begin!\n start_server\n end", "title": "" }, { "docid": "7e2314ca7584000d7723393bb13f9656", "score": "0.57976556", "text": "def listen(&block)\n while @_run do\n request = @responder.recv #(ZMQ::NOBLOCK)\n if request\n response = block && block.call(request)\n @responder.send( response )\n end\n end\n end", "title": "" }, { "docid": "5db8a7ba8bd47230d8cd06451b68e168", "score": "0.578713", "text": "def read_loop\n loop do\n msg = connection.read_msg\n msg.received_at = Time.now\n handle(msg)\n end\n rescue StandardError => e\n self << [:raise_error, e]\n end", "title": "" } ]
2f25f93d75fcf44ec5b9927a5e3d4dc0
Bypasses the .members method so we can check for uniqueness of any newly added list item
[ { "docid": "5a3adaab437cd718a9f41907590d8744", "score": "0.67132676", "text": "def add_item(item)\n if member_labels.include?(item.pref_label)\n errors.add :members, \"must be unique\"\n else\n members << item\n end\n end", "title": "" } ]
[ { "docid": "2bcb15f09e6d3a9bdd287eca20e1d125", "score": "0.63148695", "text": "def missing_members\n new_members - (current_members & new_members)\n end", "title": "" }, { "docid": "5363c5e0c35e1ba88a739115418783da", "score": "0.6203831", "text": "def add_to_all_members(items_to_add)\n\t return if items_to_add == nil\n\t if items_to_add.size > 0\n\t @all_members.push('-') if @all_members.size > 0\n\t @all_members = @all_members + items_to_add\n\t end\n\tend", "title": "" }, { "docid": "2a89be3bec19d2f2c34f525595c9077b", "score": "0.6123914", "text": "def update_list_member\n end", "title": "" }, { "docid": "8ace7249edab74424854cceada523099", "score": "0.6006956", "text": "def add_members\n \n end", "title": "" }, { "docid": "8a73f7ac85358f70df29ecf953490de5", "score": "0.59887594", "text": "def members= new_members\n @members = Array(new_members).uniq\n end", "title": "" }, { "docid": "5c4b728a95b97ae7fdbfb90b12dc315c", "score": "0.5964488", "text": "def add_members\n\n end", "title": "" }, { "docid": "5186b102cf81c3bd0dca3df04f9d7f99", "score": "0.59606886", "text": "def add_members(new_member_ids)\n raise \"Don't use add_members. It's a bad idea and a performance nightmare\"\n end", "title": "" }, { "docid": "c88b59034b175c538046ba6456a31ec7", "score": "0.5905699", "text": "def add_unique(*items)\n return unless items.count > 0\n notify_will_change!\n @collection = collection | items.flatten\n @collection\n end", "title": "" }, { "docid": "336324de9512d9eec84e3ff68851dc19", "score": "0.58926946", "text": "def add_unique!(*items)\n return false unless @delegate.respond_to?(:op_add_unique!)\n @delegate.send :op_add_unique!, @key, items.flatten\n reset!\n end", "title": "" }, { "docid": "d86c5ef99691a58e4e2cf35caf3ca6fb", "score": "0.5836336", "text": "def members\n @_members ||= Set.new(@members)\n end", "title": "" }, { "docid": "1d5b46ce38b53c5763b1cecb74be4423", "score": "0.58239967", "text": "def place_members_only?\n false\n end", "title": "" }, { "docid": "84eb098dc07e1b7dbe4cc6e9c826257d", "score": "0.58218896", "text": "def all_dead?\n return existing_members.empty?\n end", "title": "" }, { "docid": "a151b8a0d262895b50e1d50ba6b6d886", "score": "0.58065575", "text": "def add_member(opts)\n opts = check_params(opts,[:members])\n super(opts)\n end", "title": "" }, { "docid": "a151b8a0d262895b50e1d50ba6b6d886", "score": "0.58065575", "text": "def add_member(opts)\n opts = check_params(opts,[:members])\n super(opts)\n end", "title": "" }, { "docid": "a151b8a0d262895b50e1d50ba6b6d886", "score": "0.58065575", "text": "def add_member(opts)\n opts = check_params(opts,[:members])\n super(opts)\n end", "title": "" }, { "docid": "555604b1bc35df36dd16d2ca16c69c4c", "score": "0.5804567", "text": "def add_member_fs\n members << readmefile.first unless readmefile.empty? || members.include?(readmefile.first)\n end", "title": "" }, { "docid": "9f67f8335cee684c830410ed5455a82d", "score": "0.5799085", "text": "def add_members\n\t\tbegin\n\t\t\tlist = List.find(params[:list_id])\n\t\t\t\n\t\t\t# Only, owner can add anybody to list, else you can only add yourself.\n\t\t\tif params[:user_id].to_i == @current_user.id || list.user == @current_user\n\t\t\t\t\n\t\t\t\t# If list is public, anybody can join else only owner can add new users to private lists\n\t\t\t\tif list.is_public || list.user == @current_user\n\t\t\t\t\t\n\t\t\t\t\t@members = list.members.map { |member| member.user }.flatten\n\t\t\t\t\tif !@members.include? User.find(params[:user_id])\n\t\t\t\t\t\tlist.members.create(user_id: params[:user_id])\n\t\t\t\t\t\tflash[:notice] = \"Added!\"\n\t\t\t\t\telse \n\t\t\t\t\t\tlogger.debug \"User already added\"\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend \n\t\trescue => error\n\t\t\tflash[:notice] = \"Error!\"\n\t\tend\n\t\tredirect_to request.referrer\n\tend", "title": "" }, { "docid": "059de94bdc29b84851a721b47c696c8e", "score": "0.5777062", "text": "def initialize\n @members = []\n end", "title": "" }, { "docid": "b7b38163840283fefa5b80fe9a832a6f", "score": "0.57728773", "text": "def place_members_only?\n false\n end", "title": "" }, { "docid": "1c689761e5a175bb3deef2a543d34a7b", "score": "0.5753424", "text": "def touch_members\n members.each do |mem|\n mem.touch\n end\n end", "title": "" }, { "docid": "1c689761e5a175bb3deef2a543d34a7b", "score": "0.5753424", "text": "def touch_members\n members.each do |mem|\n mem.touch\n end\n end", "title": "" }, { "docid": "8654be9f6236e8926e999662b1aacc52", "score": "0.5753242", "text": "def add_unique!(*items)\n super(items.flatten.parse_pointers)\n end", "title": "" }, { "docid": "7d2eec4c613b980a4363bab75e147f0a", "score": "0.5751801", "text": "def on_user_list_member_added(source, target, list)\n log(\"Got new addition to list : #{target.handle}\")\n end", "title": "" }, { "docid": "5872509090233a8608fc4c966e174cab", "score": "0.57401973", "text": "def setup\n super()\n @members = []\n end", "title": "" }, { "docid": "04c49a516b07995a55b283f0a8a60b2d", "score": "0.5739305", "text": "def addmember\n end", "title": "" }, { "docid": "122a76ca2a9ccb79e5189478b9279c1d", "score": "0.5701858", "text": "def name_not_exists\n if self.new_record?\n if Member.find_by_name(self.name)\n errors.add(:name, \"There is already a member named #{name}. Modify name to avoid duplication.\")\n return false\n else\n return true\n end\n end\n end", "title": "" }, { "docid": "477b08e8c302d16ea025e6009783e641", "score": "0.56933093", "text": "def addSuperMember(member)\n @superMemberSet << member unless @superMemberSet.include?(member)\n end", "title": "" }, { "docid": "f9029eeebe6ece9bcc1cc7b4709b93ca", "score": "0.56849587", "text": "def members\n @_members ||= Set.new(@members)\n end", "title": "" }, { "docid": "c20c3859d8f5f621c7768462a72db3f4", "score": "0.5661867", "text": "def check_duplicates(members, group)\n if members\n if members.uniq.length != members.length\n duplicates = members.select{|element| members.count(element) > 1 }.uniq\n Log.error(\"Found duplicate members within a group\", group: group, duplicates: duplicates)\n Log.fatal(\"A group may not declare the same member more than once\")\n exit(10)\n end\n end\n end", "title": "" }, { "docid": "34db160591e593279ba2c390e229d8f9", "score": "0.5638967", "text": "def add_members(members)\n if members != nil\n members.each do | member |\n group_user = GroupUser.new(group_id: self.id, user_id: member[:id],\n is_admin: member[:is_admin])\n self.group_users << group_user unless self.group_users.include? group_user\n end\n self.save!\n end\n end", "title": "" }, { "docid": "32caf92a64931142429e6301ba398def", "score": "0.5632101", "text": "def add_missing_members(members_arr:, dryrun: false, trace: false)\n members_to_add = []\n\n # Look to see if the user is already a member, and if they are, check their email address is still valid.\n members_arr.each do |m|\n @research_project_users[m['external_id']] = true # record every user we encounter\n\n if !member_exists?(member: m)\n if free_license?\n members_to_add << m unless m['bad_email']\n update_team_member_map(member: m) # Adds a placeholder, so we don't add this user again, while processing a later research group.\n else\n warn \"WARNING: No Free Licenses. Cannot add #{m['external_id']} #{m['email']}\"\n end\n elsif email_address_changed?(member: m)\n # They already exist in Dropbox, but the email record is now different\n if m['email'].empty?\n # The Uni isn't recording their new email in the AD, so they have most likely left.\n m['email'] = \"#{m['external_id']}@aucklanduni.ac.nz\"\n if @team_member_map[m['external_id']]['email'] == m['email']\n next # Nothing actually changed.\n else\n # Staff email has changed to the student email\n warn \"WARNING: AD Email address for #{@team_member_map[m['external_id']]['email']} was empty? Set to #{m['email']}\"\n end\n end\n\n if @team_member_email_map[m['email']].nil?\n # We don't have this user, under this email address.\n warn \"WARNING: Email address changed from #{@team_member_map[m['external_id']]['email']} to #{m['email']}\"\n begin\n @dbx_mng.team_members_set_profile(email: @team_member_map[m['external_id']]['email'], new_email: m['email'], trace: trace) unless dryrun\n update_team_member_map(member: m) # updates the entry in the cached copy of team members, so we don't try and change it again.\n rescue WIKK::WebBrowser::Error, StandardError => _e\n # We couldn't fix this user's email address, so we don't want to continue trying to work with the bad one\n m['bad_email'] = true # updates the entry in the cached copy of team members, so we don't try and change it again.\n update_team_member_map(member: m) # updates the entry in the cached copy of team members, so we don't try and change it again.\n @failed_to_add << m['email'] # This address will get deleted from groups, so we don't try to add them to Dropbox groups.\n next\n end\n else\n # A record for this email address exists, but without the exernal_id set, so someone added it in the Web interface.\n warn \"WARNING: Looks like we have a manually added user #{m['email']}\"\n next\n end\n end\n end\n\n puts 'Adding members'\n p( members_to_add )\n\n if members_to_add.length > 0 && !dryrun\n begin\n # Doesn't matter if the users already exists, but we have culled these anyway, as we have to check for changed emails.\n response = @dbx_mng.team_add_members(members_details: members_to_add, send_welcome: true, trace: trace)\n\n # Response will have those who didn't get added due to an error. We can't add these to a group, so we remove these bad ones.\n response.each do |user_email|\n @failed_to_add << user_email\n # @research_project_users[m['external_id']] = nil #User never made it.\n end\n rescue WIKK::WebBrowser::Error => _e\n # Ignore web errors. Already logged\n end\n end\nend", "title": "" }, { "docid": "6aa9c5677d8e2e53386a91d1a6cccfe2", "score": "0.5630096", "text": "def team_members_uniqueness\n \tif registerable_type == \"Team\"\n \t\tids = [Team.find(registerable_id).member_ids |\n \t\t\t competition.teams.map {|team| team.member_ids}].flatten\n \t\terrors.add(:registerable_id, \"is already registered for this competition\") if ids.uniq.length == ids.length\n \tend\n end", "title": "" }, { "docid": "534c8db0afecec796ad3294c8a99bddc", "score": "0.5620393", "text": "def add_item?\n record.membership <= user.membership\n end", "title": "" }, { "docid": "4bdaccf7ca91c444202131adc8bba8e7", "score": "0.56191", "text": "def test_add_and_remove_member\n org_name = \"org\"\n member_name = \"you\"\n organization = Organization.named(org_name)\n member = User.named(member_name)\n member2 = User.named(\"him\")\n\n organization.add_member(member)\n assert(organization.has_member?(member), \"member not in list\")\n assert(organization.members.include?(member), \"false member added\")\n assert(!organization.members.include?(member2), \"not added as member\")\n\n organization.remove_member(member)\n assert(!organization.members.include?(member), \"remove member failed\")\n assert(!organization.has_member?(member), \"member still in list\")\n end", "title": "" }, { "docid": "e93daa4588dd207f028f251f39cc0431", "score": "0.56080997", "text": "def dup\n\t\t\t\t#Marshal.load(Marshal.dump(self))\n\t\t\t\tms = Members.new\n\t\t\t\t@member_array.each do |m|\n\t\t\t\t\tms.push(m.dup)\n\t\t\t\tend\n\t\t\t\tms\n\t\t\tend", "title": "" }, { "docid": "0e014f8c44aa6686c900f4b779ef2249", "score": "0.5592176", "text": "def add_member(member)\r\n @members << member\r\n end", "title": "" }, { "docid": "d2f6f744b4186e3e5eaa9e7beb350f1a", "score": "0.5583909", "text": "def member?(item)\n members.include? item\n end", "title": "" }, { "docid": "72b690fe2b39e84839c689d82f7887d1", "score": "0.5583058", "text": "def start record\n super(record)\n self.members = []\n end", "title": "" }, { "docid": "22a9eda7ca270e32637e453650e0570a", "score": "0.55748975", "text": "def only_preserve_unpreserved_members?\n @membership_changed != true && @created_preservation_object != true\n end", "title": "" }, { "docid": "ff404941a84de3652f70b9484c655b52", "score": "0.55523175", "text": "def add_member(member)\n @members << member\n end", "title": "" }, { "docid": "eebd3527764204fd5e00fd7e2f0e25c5", "score": "0.5538616", "text": "def update_members\n unless member_ids.nil?\n self.groups_members.each do |m|\n m.destroy unless member_ids.include?(m.member_id.to_s)\n member_ids.delete(m.member_id.to_s)\n\t\t@note = Note.new\n\t\t@note.member_id = m.member_id\n\t\t@note.content = \"- removed from group \"+Group.find(m.group_id).name\n\t\t@note.modification_time = Time.now\n\t\t@note.save\n end\n member_ids.each do |m|\n self.groups_members.create(:member_id => m) unless m.blank?\n\t\tunless m.blank?\n\t\t\t@note = Note.new\n\t\t\t@note.member_id = m\n\t\t\t@note.content = \"- added to group \"+self.name\n\t\t\t@note.modification_time = Time.now\n\t\t\t@note.save\n\t\tend\n end\n reload\n self.member_ids = nil\n\tend\n end", "title": "" }, { "docid": "96d2f3c2ae75f94b52eefb1154ccb9b1", "score": "0.55336523", "text": "def members_only?\n false \n end", "title": "" }, { "docid": "076cabc197f9c3538d8b403f6a34107e", "score": "0.55237806", "text": "def initialize\n @members = {}\n @locked = false\n end", "title": "" }, { "docid": "e4eac8b4ecef9b222dc22a66b0c0922e", "score": "0.5519788", "text": "def update_members\n return \"\" if members_override.nil?\n\n self.members_override = members_override.select { |name| name != nil && name.strip != \"\" }\n #if the list has changed\n if (self.members_override.sort != self.members.collect { |person| person.human_name }.sort)\n self.updating_email = true\n list = map_member_strings_to_users(self.members_override)\n raise \"Error converting members_override to IDs!\" if list.include?(nil)\n self.members = list\n end\n members_override = nil\n end", "title": "" }, { "docid": "698b32176cdcf2e4da3b419e6a26f314", "score": "0.551579", "text": "def duplicate_list_name_except_current?(list_name)\n remove_orig = session[:lists].reject { |list| list[:name] == list_name }\n remove_orig.any? { |list| list[:name] == @list_name }\nend", "title": "" }, { "docid": "99c255508aea46096bbc72b5ad648af2", "score": "0.5504658", "text": "def add_uniqueness(item)\n add_timeout_and_expiration(item)\n add_unique_args_and_digest(item)\n end", "title": "" }, { "docid": "70ef5e34f3a61318ef474184c7deebcd", "score": "0.5500415", "text": "def add_item(list, item_name, qty)\r\n\tif !list.include?(item_name)\r\n\t\tlist[item_name.to_sym] = qty\r\n\t\tlist\r\n\telse\r\n\t\tputs \"That's already on the list\"\r\n\tend\r\n\tlist\r\nend", "title": "" }, { "docid": "084a775439ae2913a2c7d6bd533679b6", "score": "0.5495598", "text": "def validate_uniqueness_of_in_memory(collection, attrs, message)\n hashes = collection.inject({}) do |hash, record|\n key = attrs.map {|a| record.send(a).to_s }.join\n if key.blank? || record.marked_for_destruction?\n key = record.object_id\n end\n hash[key] = record unless hash[key]\n hash\n end\n if collection.length > hashes.length\n self.errors.add(:base, message)\n end\n end", "title": "" }, { "docid": "3f318c1e07f68f7660be4727e729bb9a", "score": "0.54931134", "text": "def party_members_changed?\n @members_id != get_members_id($game_party.members)\n end", "title": "" }, { "docid": "394b8ed609204d0b2fbdc5cf643132e9", "score": "0.54916", "text": "def remove_member(opts)\n opts = check_params(opts,[:members])\n super(opts)\n end", "title": "" }, { "docid": "394b8ed609204d0b2fbdc5cf643132e9", "score": "0.54916", "text": "def remove_member(opts)\n opts = check_params(opts,[:members])\n super(opts)\n end", "title": "" }, { "docid": "394b8ed609204d0b2fbdc5cf643132e9", "score": "0.54916", "text": "def remove_member(opts)\n opts = check_params(opts,[:members])\n super(opts)\n end", "title": "" }, { "docid": "9aeb1adf91b6bbb29d566fff34f08f80", "score": "0.5489707", "text": "def not_member\n end", "title": "" }, { "docid": "9aeb1adf91b6bbb29d566fff34f08f80", "score": "0.5489707", "text": "def not_member\n end", "title": "" }, { "docid": "920d4c81ce45258c0a70c58748ed0153", "score": "0.5489481", "text": "def uhook_duplicated_object(obj)\n end", "title": "" }, { "docid": "ac63dc1a4f05f25dc5f1900a69c6013b", "score": "0.547935", "text": "def unique(item)\r\n # check to see if name or email is unique\r\n puts \"I don't care if #{item} is unique, and neither should you!\"\r\n true\r\n end", "title": "" }, { "docid": "3a59124a22272b2a589d3fc70d506f85", "score": "0.5475751", "text": "def check_unique(item)\n item.valid?\n end", "title": "" }, { "docid": "06e192aaf2186ab0e913a95c49e8284c", "score": "0.5472219", "text": "def is_unique; @is_unique; end", "title": "" }, { "docid": "a3e69f52d02285f2bc60f9489710b48d", "score": "0.5462914", "text": "def member_tokens=(new_members)\n _ids = new_members.split(\",\").map { |id| id.strip }\n self.members = User.any_in( _id: _ids ).only(:_id).all.map{|i| i._id}\n @member_names = nil # clear chached variable\n end", "title": "" }, { "docid": "689b9bf2c05b383e0feda61247ade97b", "score": "0.5453137", "text": "def members; end", "title": "" }, { "docid": "689b9bf2c05b383e0feda61247ade97b", "score": "0.5453137", "text": "def members; end", "title": "" }, { "docid": "689b9bf2c05b383e0feda61247ade97b", "score": "0.5453137", "text": "def members; end", "title": "" }, { "docid": "689b9bf2c05b383e0feda61247ade97b", "score": "0.5453137", "text": "def members; end", "title": "" }, { "docid": "689b9bf2c05b383e0feda61247ade97b", "score": "0.5453137", "text": "def members; end", "title": "" }, { "docid": "341d8bc5f47d368e7d6b5c14050698b8", "score": "0.54470736", "text": "def ensure_not_references_by_any_line_item\n if member_tackles.empty?\n return true\n else\n errors.add(:base, 'Tackle items present')\n return false\n end\n end", "title": "" }, { "docid": "999814a96751d11feecb9721278c26ec", "score": "0.54351616", "text": "def add_creator_to_members\n\t\tself.members << self.creator\n\tend", "title": "" }, { "docid": "bd87591cd66870d0eac33e17313df39c", "score": "0.543085", "text": "def local_update_members\n ## this is not updating the index correctly since the member does not yet know it is a part of the\n ## collection. How do we do this correctly? Not sure. It seems like we need to set the\n ## member outside of this loop.\n ## We are going to handel the update index in the controller for the GF\n ## so we do nothing here\n ## todo: what is below really should work\n #if self.respond_to?(:members)\n # if (members_added.size > 0)\n # members_added.each do |member_id|\n # member = ActiveFedora::Base.find(member_id,cast:true)\n # logger.warn \"\\n\\n ****** updating member collections: #{member.collections}\"\n # member.reload.update_index\n # end\n # end\n #end\n #@member_ids_at_load_time = current_members\n end", "title": "" }, { "docid": "9a1b0c38860cff83933cd7363f6f0f19", "score": "0.54306847", "text": "def edit_list_name_validation(this_list_id, new_name)\n other_lists = session[:lists].reject{|list| list[:id] == this_list_id }\n\n # if !(1..100).cover? new_name.size\n # \"List name must be between 1 and 100.\"\n # elsif other_lists.any? { |list| list[:name] == new_name }\n # \"'#{new_name}' already exists.\"\n # end \n list_validation_error(new_name, other_lists)\nend", "title": "" }, { "docid": "7779d07c2cef04d5b7282c8ea8302614", "score": "0.54238904", "text": "def not_unique\n define_method(:unique?) { false }\n @unique = false\n end", "title": "" }, { "docid": "f10d78eced7a45adb9739980ec2aaeda", "score": "0.5409377", "text": "def unique; end", "title": "" }, { "docid": "f10d78eced7a45adb9739980ec2aaeda", "score": "0.5409377", "text": "def unique; end", "title": "" }, { "docid": "f10d78eced7a45adb9739980ec2aaeda", "score": "0.5409377", "text": "def unique; end", "title": "" }, { "docid": "f10d78eced7a45adb9739980ec2aaeda", "score": "0.5409377", "text": "def unique; end", "title": "" }, { "docid": "ac96ef45ac5ea4227490f8173bb6d94e", "score": "0.5403998", "text": "def add_item(item, quantity=0, list)\n # Check if the list already has the lowercased item name\n # IF the list already has the item name, print a warning that the item doesn't exist\n if has_item(list, item)\n # Add the item name with the optional quantity to the end of the list\n puts \"We already have #{item.downcase}!\" \n # IF the list doesn't have the item name\n elsif !has_item(list, item)\n list[item.downcase] = quantity\n puts \"Here is the updated list: #{list}\"\n end\n list\nend", "title": "" }, { "docid": "4bdba1ba7c388c1973851cac3ba6aeab", "score": "0.540202", "text": "def merge!(members)\n\t\t\t\t$TRACE.debug 9, \"merge before: #{@member_array.map{|n| n.field_name+'::'+n.options.inspect}.join(',')}\"\n\n\t\t\t\tmembers.each do |m| \n\t\t\t\t\t$TRACE.debug 9, \"merge: #{m.field_name}: options=#{m.options.inspect}\"\n\n\t\t\t\t\t#$TRACE.debug 5, \"merge: delete: #{m.field_name}\"\n\t\t\t\t\t#@member_array.delete_if {|n| m.field_name == n.field_name}\n\n\t\t\t\t\tif !@member_hash.has_key?(m.field_name) then\n\t\t\t\t\t\t@member_array.push(m)\n\t\t\t\t\t\t@member_hash[m.field_name] = m\n\t\t\t\t\t\t#$TRACE.debug 5, \"merge: delete: #{m.field_name}\"\n\t\t\t\t\t\t#@member_array.delete_if {|n| m.field_name == n.field_name}\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\t$TRACE.debug 9, \"merge after: #{@member_array.map{|n| n.field_name+'::'+n.options.inspect}.join(',')}\"\n\t\t\t\tself\n\t\t\tend", "title": "" }, { "docid": "981d4f27eaf91e7b93583b9e289f4475", "score": "0.5400715", "text": "def add_member(member)\n @member_count += 1\n @members[member.id] = member\n end", "title": "" }, { "docid": "981d4f27eaf91e7b93583b9e289f4475", "score": "0.5400715", "text": "def add_member(member)\n @member_count += 1\n @members[member.id] = member\n end", "title": "" }, { "docid": "3eb91ba3f47c90e6e45a7b63e3ff0203", "score": "0.539962", "text": "def test_add_and_remove_puids\n track = Model::Track.new\n assert_equal 0, track.puids.size\n assert_nothing_raised {track.puids << @valid_puids[0]}\n assert_equal 1, track.puids.size\n assert_nothing_raised {track.puids << @valid_puids[1]}\n assert_equal 2, track.puids.size\n \n assert_nothing_raised {track.puids.delete @valid_puids[1]}\n assert_equal 1, track.puids.size\n assert_nothing_raised {track.puids.delete @valid_puids[0]}\n assert_equal 0, track.puids.size\n end", "title": "" }, { "docid": "a0ba90ffb14941cf33518cf13678d29a", "score": "0.5388896", "text": "def <<(item)\n @items << item unless @items.include?(item)\n end", "title": "" }, { "docid": "2d27ed18d9223ac20025f9f6e5ee788e", "score": "0.53854424", "text": "def remove_all_members\n super\n end", "title": "" }, { "docid": "709176c609a7a7ed34abcf75c73d1f9e", "score": "0.5385361", "text": "def can_duplicate?\n false\n end", "title": "" }, { "docid": "8a937653aaef1bb3dd844d3c75909667", "score": "0.537556", "text": "def add(list, item, quantity) #What if the item is already on the list?\n unless list[item]\n list[item] = quantity\n else\n update(list, item, quantity)\n end\n list\nend", "title": "" }, { "docid": "aa894cd23d0e14db4cc01c8750ba4ce9", "score": "0.5370666", "text": "def update_members(members)\n # Remove any users no longer listed\n @group.users -= (@group.users - members.keys)\n\n # Add/edit the new list of users\n members.each do |user, role|\n creator = [:creator].include?(role)\n owner = %i[creator owner].include?(role)\n editor = %i[creator owner editor].include?(role)\n\n gm = @group.membership.where(user: user).first\n update = gm&.owner != owner || gm&.editor != editor\n if !gm || update\n # Existing user - remove old membership before re-adding\n @group.users -= [user] if update\n\n @group.membership << GroupMembership.new(\n user: user,\n group: @group,\n creator: creator,\n owner: owner,\n editor: editor\n )\n end\n end\n end", "title": "" }, { "docid": "4bacc472187990e5d39f01086f0c4b80", "score": "0.53677076", "text": "def members_only?\n true\n end", "title": "" }, { "docid": "06414aeaa93f900975c5cf4057be1eb9", "score": "0.53642017", "text": "def validate_listOfMembers\n\t\tmembers = listOfMembers.gsub(/\\s+/, \"\").split(/,/)\n\t\tfor i in 0..members.length - 1\n\t\t\tif !Student.find_by(studentid: members[i]) #check to see if student exists\n\t\t\t\treturn false\n\t\t\tend\n\t\t\t#Check to see if student is registered in course\n\t\t\tif !CourseRegistration.find_by(studentid: Student.find_by(studentid: members[i]).id, courseid: Course.find_by(TeamCollaboration.find(teamcollaborationid).courseid))\n\t\t\t\treturn false\n\t\t\tend\n\t\t\tif !check_student_not_already_in_team(members[i]) #go to function below\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\n\t\treturn true\n\tend", "title": "" }, { "docid": "92a25a207adba172c82751571d8a6e00", "score": "0.5359532", "text": "def changing_members(&block)\n _assigning do\n ids = member_ids\n instance_eval(&block)\n new_ids = member_ids\n\n added, removed = (new_ids - ids), (ids - new_ids)\n\n @original_members ||= ids\n @members_added ||= []; @members_removed ||= []\n @members_added -= removed; @members_removed -= added\n @members_added.concat(added).uniq!; @members_removed.concat(removed & @original_members).uniq!\n end\n self\n end", "title": "" }, { "docid": "527a443b522bb1487629571eb85bc7f7", "score": "0.53535646", "text": "def members_only?\n false\n end", "title": "" }, { "docid": "527a443b522bb1487629571eb85bc7f7", "score": "0.53535646", "text": "def members_only?\n false\n end", "title": "" }, { "docid": "47bfa6fe5b52e7c0f913b9b37c022227", "score": "0.53490484", "text": "def <<(arg)\n\t\t\t\tif arg.kind_of?(Members) then\n\t\t\t\t\targ.each {|md| push(md)}\n\t\t\t\telse\n\t\t\t\t\tif @member_hash[arg.field_name] then\n\t\t\t\t\t\t@member_hash[arg.field_name] = arg\n\t\t\t\t\t\t@member_array[@member_array.index(arg)] = arg\n\t\t\t\t\telse\n\t\t\t\t\t\tpush(arg)\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "be51e1a5a628c16dfd7c54ea103aa072", "score": "0.53403693", "text": "def unique?; end", "title": "" }, { "docid": "2727c57b3049153b4d4381f6cf20dad7", "score": "0.5337308", "text": "def add(people)\n @members = nil # force fresh LDAP search\n people = (Array(people) - members).map(&:id)\n return if people.empty?\n ASF::LDAP.modify(self.dn, [ASF::Base.mod_add('memberUid', people)])\n ensure\n @members = nil\n end", "title": "" }, { "docid": "f70484c68204de1b7f95ce7a464bd22a", "score": "0.532864", "text": "def compute_add(items)\n members.merge(items)\n end", "title": "" }, { "docid": "644888fac21046bbbc62e63da9379056", "score": "0.5320455", "text": "def add_item(new_item, existing_list)\n\texisting_list[new_item] = 1\n\treturn existing_list\n\nend", "title": "" }, { "docid": "f4f125f0a8b588bd2120c2386bb501b4", "score": "0.5316568", "text": "def members_only?\n true\n end", "title": "" }, { "docid": "9fbbcdddc5a4471c7020f4fa132b535a", "score": "0.53148156", "text": "def duplicable?; end", "title": "" }, { "docid": "9fbbcdddc5a4471c7020f4fa132b535a", "score": "0.53148156", "text": "def duplicable?; end", "title": "" }, { "docid": "f09cb1e10262afc0875da89ec94133eb", "score": "0.53095585", "text": "def make_unique_names\n for enemy in members\n next unless enemy.exist?\n next unless enemy.letter.empty?\n n = @names_count[enemy.original_name]\n n = 0 if n == nil\n enemy.letter = LETTER_TABLE[n % LETTER_TABLE.size]\n @names_count[enemy.original_name] = n + 1\n end\n for enemy in members\n n = @names_count[enemy.original_name]\n n = 0 if n == nil\n enemy.plural = true if n >= 2\n end\n end", "title": "" }, { "docid": "44706f235d1b886be5ce728e2d9fb090", "score": "0.53091", "text": "def new?(object)\n !@seen.include?(object)\n end", "title": "" }, { "docid": "7a5e3a9fca8ea72ed81b508a0645bc88", "score": "0.53083634", "text": "def add_unique!(*items)\n return false unless @delegate.respond_to?(:op_add_relation!)\n items = items.flatten.parse_pointers\n @delegate.send :op_add_relation!, @key, items\n end", "title": "" }, { "docid": "a2bae271151264112719ba65d0fb3e90", "score": "0.53040916", "text": "def add_members(members_id_list) #can also just provide the users themselves.\n members_id_list.each do |member_id|\n member = User.find_by_id(member_id)\n ProjectMembership.create(:user_id => member_id, :project_id => self.id)\n self.members << member unless self.members.include? member\n end\n self.save\n end", "title": "" } ]
57532c102d44a308313d606696a66185
GET /projects/1 GET /projects/1.json
[ { "docid": "c0fe3fa1d4745bf0b6750ab9dfb5735a", "score": "0.0", "text": "def show\n #render :text => params.to_json\n end", "title": "" } ]
[ { "docid": "b2d778e1a6b6df24139d1f5864dedb0f", "score": "0.7868971", "text": "def list\n get 'projects'\n end", "title": "" }, { "docid": "723f580541bd41ab30bb2973cfdea294", "score": "0.76979554", "text": "def listprojects\n get('listprojects.json')['projects']\n end", "title": "" }, { "docid": "adacf3081d75be772f952c8b379a976d", "score": "0.7680216", "text": "def show\n @project = @client.projects.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "82660b3d8bf45c925c8bc322dc10768c", "score": "0.7611453", "text": "def projects\n resource 'projects'\n end", "title": "" }, { "docid": "8bc096a51ce29543b71328b57b935869", "score": "0.75334454", "text": "def index\n @projects = Project.all\n render json: @projects, status: :ok\n end", "title": "" }, { "docid": "4f5630e29821bef6d57cb56e656012a4", "score": "0.75258976", "text": "def index\n @projects = Project.all\n render json: @projects\n end", "title": "" }, { "docid": "6e1ca3a9e609427c72f7a9248c9e43a3", "score": "0.74926496", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "6e1ca3a9e609427c72f7a9248c9e43a3", "score": "0.74926496", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "6e1ca3a9e609427c72f7a9248c9e43a3", "score": "0.74926496", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "6e1ca3a9e609427c72f7a9248c9e43a3", "score": "0.74926496", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "6e1ca3a9e609427c72f7a9248c9e43a3", "score": "0.74926496", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "6e1ca3a9e609427c72f7a9248c9e43a3", "score": "0.74926496", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "6e1ca3a9e609427c72f7a9248c9e43a3", "score": "0.74926496", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "6e1ca3a9e609427c72f7a9248c9e43a3", "score": "0.74924207", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "7b0dc546f7e3eaf3d8880694a7d62483", "score": "0.7484109", "text": "def index\n @user = User.find_by(id: params[:user_id])\n @project = @user.projects\n if @project \n render :json => @project\n else\n render :json => 422\n end\n end", "title": "" }, { "docid": "cb65a0549e3ddc3b3e06f30bffc742b0", "score": "0.7479275", "text": "def projects\n request(method: 'getAllProjects')\n end", "title": "" }, { "docid": "7512155b98b272c71e0017ea7d460fba", "score": "0.7444873", "text": "def project(project_id, params = {})\n make_get_request(\"/projects/#{project_id}\", params)\n end", "title": "" }, { "docid": "fcf2c9439b93a0cf43436a8511c28558", "score": "0.74294627", "text": "def index\n @projects = Project.visible\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "9d85d8c3182cb70e42a2ed0015d69363", "score": "0.74224764", "text": "def index\n @projects = Project.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @projects }\n end\n end", "title": "" }, { "docid": "15ac27fe5701716b27322caeac861126", "score": "0.7414947", "text": "def show\n render json: Project.where(id: params.fetch(:id))\n end", "title": "" }, { "docid": "1ba4d563446d21f82b53b5f3abee7822", "score": "0.7385035", "text": "def show \n project= Project.find(params[:id])\n\n render json: project\n end", "title": "" }, { "docid": "068f919d1ab5e4489ef7535f6d7fd693", "score": "0.7380203", "text": "def index\n @projects = Project.all_for_user(current_user.id)\n render json: @projects.to_json(include: :project_detail), status: 200\n end", "title": "" }, { "docid": "aedd9ac0d9fcc1bfa9cd53ecc2cb987d", "score": "0.7379937", "text": "def project(project_id, options={})\n response_body = nil\n begin\n response = connection.get do |req|\n req.url \"/api/v1/projects/#{project_id}\", options\n end\n response_body = response.body\n rescue MultiJson::DecodeError => e\n #p 'Unable to parse JSON.'\n end\n \n response_body\n end", "title": "" }, { "docid": "2e5417264e1a587c5586be4c8bba5a2d", "score": "0.7375317", "text": "def index\n @projects = current_user.projects\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "f645d3e4b47a70b69c3dce721c6c5ee6", "score": "0.7361155", "text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "f645d3e4b47a70b69c3dce721c6c5ee6", "score": "0.7361155", "text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "f645d3e4b47a70b69c3dce721c6c5ee6", "score": "0.7361155", "text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "f645d3e4b47a70b69c3dce721c6c5ee6", "score": "0.7361155", "text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "f645d3e4b47a70b69c3dce721c6c5ee6", "score": "0.7361155", "text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "f645d3e4b47a70b69c3dce721c6c5ee6", "score": "0.7361155", "text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "f645d3e4b47a70b69c3dce721c6c5ee6", "score": "0.7361155", "text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "f645d3e4b47a70b69c3dce721c6c5ee6", "score": "0.7361155", "text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "f645d3e4b47a70b69c3dce721c6c5ee6", "score": "0.7361155", "text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "f645d3e4b47a70b69c3dce721c6c5ee6", "score": "0.7361155", "text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "f645d3e4b47a70b69c3dce721c6c5ee6", "score": "0.7361155", "text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "f645d3e4b47a70b69c3dce721c6c5ee6", "score": "0.7361155", "text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "f645d3e4b47a70b69c3dce721c6c5ee6", "score": "0.7361155", "text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "f645d3e4b47a70b69c3dce721c6c5ee6", "score": "0.7361155", "text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "f645d3e4b47a70b69c3dce721c6c5ee6", "score": "0.7361155", "text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "3d5b591fc21bb5bc20ff599ec64b7e6d", "score": "0.73572785", "text": "def project(project_id, query_params = nil)\n get(\"/projects/#{project_id}\", query_params)\n end", "title": "" }, { "docid": "28e4bcd081dea0c8e7eda7ee79e50bcb", "score": "0.7352506", "text": "def project(project_id)\n resource \"projects/#{project_id}\"\n end", "title": "" }, { "docid": "724e0c88decba0f4b1adaf3ab021e4d2", "score": "0.73521084", "text": "def index\n @projects = Project.all\n render json: @projects, layout: false\n end", "title": "" }, { "docid": "639ed892520389bb6b2fa293ecc02522", "score": "0.73436445", "text": "def getProjectID()\n result = RestClient.get GITHUB_API + PROJECTS_PATH, :accept => 'application/vnd.github.inertia-preview+json', :'Authorization' => 'token ' + CONFIG['OAUTH']\n result = JSON.parse(result) \n end", "title": "" }, { "docid": "31a011334bef47f8e2cd373ed1e0e3df", "score": "0.73410857", "text": "def show\n @project = Project.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "9783f0d89e1281cbe6d74ad87c238471", "score": "0.73250616", "text": "def get\n CircleCi.request(conf, '/projects').get\n end", "title": "" }, { "docid": "242cd4a341d08e8e55308bf1008c2788", "score": "0.7303016", "text": "def index\n # @projects = @current_user.projects\n @projects = Project.all\n json_response(@projects)\n end", "title": "" }, { "docid": "ed6b399562133b7aedfd69d483315d0d", "score": "0.72884965", "text": "def projects\n records \"project\", \"/project/list\"\n end", "title": "" }, { "docid": "03344428e1b192e7419cfc9b3832f573", "score": "0.72734356", "text": "def projects\n Sifter.\n get(\"/api/projects\").\n parsed_response[\"projects\"].\n map { |p| Sifter::Project.new(p) }\n end", "title": "" }, { "docid": "ebd7574b99c11d1fa8ef6f9644e8c5e8", "score": "0.72727096", "text": "def index \n\n @projects = Project.all\n respond_to do |format|\n format.html {render :template => \"projects/index\"}\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "e1faa3c7c8f9ed6f94a38a055d28d826", "score": "0.72536707", "text": "def index\n @projects = current_user.projects.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "c0e89b8983c73cd4e399416b645bcda9", "score": "0.7251402", "text": "def index\n \n @workspaces = current_user.workspaces\n # debugger\n @projects = Project.where(:workspace_id => @workspace)\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "b8e0846bf6a19187f07c50323fa883c8", "score": "0.72502863", "text": "def show\n @project = Project.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @project }\n end\n end", "title": "" }, { "docid": "0a9ca128c6aa1839ded99c0ba79f2c41", "score": "0.72433484", "text": "def show\n render json: @project\n end", "title": "" }, { "docid": "c39459b58a8c796a2a372cd9143f30a7", "score": "0.7241812", "text": "def show\n repo = ProjectRepo.new current_user\n @v_project = repo.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @v_project }\n end\n end", "title": "" }, { "docid": "c3e198c82e5fd5ead184e93926761450", "score": "0.7228012", "text": "def find_project(name)\n get(\"/projects/#{name}\")\n end", "title": "" }, { "docid": "c3e198c82e5fd5ead184e93926761450", "score": "0.7228012", "text": "def find_project(name)\n get(\"/projects/#{name}\")\n end", "title": "" }, { "docid": "c7dcab2d4f5ae76cbf253af10709f152", "score": "0.7213682", "text": "def show\n @project = Project.find_by(id: params[:id])\n if @project\n render :json => @project\n else\n render :json => 422\n end\n end", "title": "" }, { "docid": "4e78119d0f3e092dc4944625506210aa", "score": "0.7210143", "text": "def projects(params = {})\n make_get_request('/account/projects', params)\n end", "title": "" }, { "docid": "4d549bb4b7dc1d826145735b591c2420", "score": "0.72031206", "text": "def project\n request :project\n end", "title": "" }, { "docid": "30bf0654e681b7e87032046e386bbdfd", "score": "0.71956533", "text": "def project\n return forbidden unless current_account and params[:id] and (request.format.json? || request.format.js? || request.format.text?)\n project = Project.accessible(current_account).find(params[:id].to_i)\n return not_found unless project\n opts = { :include_document_ids => params[:include_document_ids] != 'false' }\n @response = {'project' => project.canonical(opts)}\n render_cross_origin_json\n end", "title": "" }, { "docid": "2d1c169fe60b6e017eab898a730938d0", "score": "0.7184686", "text": "def show \n render :json => Project.find_by_id(params[:id])\n end", "title": "" }, { "docid": "dbb7016d4b382c2e4404b0fa66c4d5bd", "score": "0.71557546", "text": "def show\n @ourproject = Ourproject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @ourproject }\n end\n end", "title": "" }, { "docid": "28e2da98ab2e0a9a6934e7d6625ee9d9", "score": "0.71509594", "text": "def get_project(project_id)\n http = Net::HTTP.new(@city_db_url, @port)\n http.read_timeout = 1000\n if @city_db_is_https\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n request = Net::HTTP::Get.new(\"/projects/#{project_id}.json\")\n request.add_field('Content-Type', 'application/json')\n request.add_field('Accept', 'application/json')\n request.basic_auth(ENV['URBANOPT_USERNAME'], ENV['URBANOPT_PASSWORD'])\n\n response = http.request(request)\n if response.code != '200' # success\n @runner.registerError(\"Bad response #{response.code}\")\n @runner.registerError(response.body)\n @result = false\n return {}\n end\n\n result = JSON.parse(response.body, symbolize_names: true)\n return result\n end", "title": "" }, { "docid": "345191566d217caa504ade40cfb8dcc5", "score": "0.71480834", "text": "def index\n @projects = Project.with_permissions_to(:read)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "755de62725d47b8460aac7ab66632a13", "score": "0.7120158", "text": "def show\n @projectresource = Projectresource.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @projectresource }\n end\n end", "title": "" }, { "docid": "56078bacb686d790a730ab1d461f9dc2", "score": "0.71123755", "text": "def index\n @projects = Project.where user: current_user\n render json: @projects, each_serializer: Projects::IndexSerializer\n end", "title": "" }, { "docid": "48998f45dc2f29cf15837cc1e263a740", "score": "0.7106823", "text": "def show \n respond_to do |format|\n format.json {\n\n @project = Project.find_by_id(params[:id])\n\n if @project\n render :json => @project\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end", "title": "" }, { "docid": "0f46a73c612c13185cedbc5bcd8b0f3d", "score": "0.70865124", "text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "54ebb7cb4b491dcb9ab0303c5ff2ebdd", "score": "0.7084294", "text": "def show\n @current_project = CurrentProject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @current_project }\n end\n end", "title": "" }, { "docid": "147d3ca600ec603e08f3126f69f0f584", "score": "0.7079523", "text": "def show\n respond_with(@project) do |format|\n format.json { render json: @project.as_json }\n format.html\n end\n end", "title": "" }, { "docid": "3f1ec2bfc0044a76a4eb2fabe1974df1", "score": "0.705198", "text": "def show\n @show_project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @show_project }\n end\n end", "title": "" }, { "docid": "2f5b1269fb97d6d0da2d4117872699cd", "score": "0.70506", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "8b79fc6843fc945612721132c2faf806", "score": "0.7044681", "text": "def show\n respond_with @project do |format|\n format.json do\n render json: @project.as_json.merge(\n commits_url: project_commits_url(@project, format: 'json'),\n commits: @project.commits.order('committed_at DESC').limit(10).map { |commit|\n commit.as_json.merge(\n percent_done: commit.fraction_done.nan? ? 0.0 : commit.fraction_done*100,\n translations_done: commit.translations_done,\n translations_total: commit.translations_total,\n strings_total: commit.strings_total,\n import_url: import_project_commit_url(@project, commit, format: 'json'),\n sync_url: sync_project_commit_url(@project, commit, format: 'json'),\n url: project_commit_url(@project, commit),\n status_url: project_commit_url(@project, commit),\n )\n }\n )\n end\n end\n end", "title": "" }, { "docid": "5e4db97fd5233307b59894cc32e9c73c", "score": "0.70423746", "text": "def show\n # turn ruby database into json\n # route to the project 3 page with this json\n # id = 1\n end", "title": "" }, { "docid": "bf8e55148f919c04d196f878d3579785", "score": "0.70259416", "text": "def show\n\n render json: Project.all\n\n end", "title": "" }, { "docid": "d89051df7875c691ab1fead1041af8ea", "score": "0.70248544", "text": "def projects(params = {})\n fetch_all('projects', 'projects', params)\n end", "title": "" }, { "docid": "a4c2fb2ef0f959208ce9c01c34633365", "score": "0.70047486", "text": "def index\n @about_projects = AboutProject.last(1)\n\n respond_to do |format|\n format.json {render json: @about_projects[0], :only => [:description]}\n end\n end", "title": "" }, { "docid": "0824ae0eebc87197d0fbd2a55a9bd049", "score": "0.70040953", "text": "def show\n set_surrogate_key_header \"api/platforms/#{@platform.id}/projects\"\n set_cache_control_headers 3600\n end", "title": "" }, { "docid": "d343552d05afe48aba08d4bdc699d46f", "score": "0.70025414", "text": "def show\n @projects = find_projects\n end", "title": "" }, { "docid": "8f3edf2190b458e171891061e3d96d84", "score": "0.7000689", "text": "def get_project(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'GET'\n\t\targs[:pattern] = '/projects/[ProjectName]'\n\t\targs[:query]['Action'] = 'GetProject'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :project_name\n\t\t\targs[:path]['ProjectName'] = optional[:project_name]\n\t\tend\n\t\tself.run(args)\n\tend", "title": "" }, { "docid": "cf6ad459133629e7ec89f6c431072f74", "score": "0.6987457", "text": "def show_by_gitpath\n @project = Project.includes(:users).includes(:technos).find_by_gitpath(params[:gitpath])\n\n respond_to do |format|\n format.json { render json: @project, status: 200 }\n end\n end", "title": "" }, { "docid": "d8337abb829e1b8e19664e9355602f21", "score": "0.6984701", "text": "def project\n @client.project(:id => project_id)\n end", "title": "" }, { "docid": "bbb1133c72172c2b5072799b0e461a21", "score": "0.69802356", "text": "def list_projects\n handle_action_exceptions(__method__) do\n cmd_line = ['listprojects']\n cmd_line << 'json' if @json\n\n handle_return(@toolshck_ether.cmd(cmd_line.join(' ')))\n end\n end", "title": "" }, { "docid": "b1fd7fd1af509ba86d73fe32495c9259", "score": "0.6979858", "text": "def index\n #@projects = []\n if current_user\n #@projects = current_user.projects.where(\"memberships.status >= ?\", 1)\n end\n\n if params[:id]\n @project = Project.find(params[:id])\n authorize! :read, @project\n else\n @project = @projects.first\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.js { render :action => 'show'}\n format.json { render json: @projects }\n end\n end", "title": "" }, { "docid": "3c9b4cdaecab69dfd5a93dbf59d646b6", "score": "0.69780463", "text": "def projects\n return forbidden unless current_account # already returns a 401 if credentials aren't supplied\n opts = { :include_document_ids => params[:include_document_ids] != 'false' }\n @response = {'projects' => Project.accessible(current_account).map {|p| p.canonical(opts) } }\n render_cross_origin_json\n end", "title": "" }, { "docid": "289a3ecf716155b0a919924b2cec139b", "score": "0.69780076", "text": "def get_projects_of_user\n respond_to do |format|\n format.json {\n #param = params[:payload]\n #@user = User.find_by_id(param[:id])\n @projects = Project.where(:user_id => @current_user.id)\n if @projects\n render :json => @projects\n else\n render :nothing => true, :status => 200, :content_type => 'text/html'\n end\n }\n end\n end", "title": "" }, { "docid": "c68c04a2bc7bb98aefea172cec87b070", "score": "0.6970507", "text": "def get\n render json: Project.select(:id, \"name as label\")\n end", "title": "" }, { "docid": "12e91c845013fdeb898d35ed6ae1624b", "score": "0.6966368", "text": "def index\n @projects = Project.includes(:user).all\n respond_with(@projects) do |format|\n format.json { render :json => {:list => @projects.as_json, :current_user => current_user.as_json} }\n format.html\n end\n end", "title": "" }, { "docid": "cb2ced39498c1abfb4b57343f8b69ff0", "score": "0.69646454", "text": "def details\n get(\"project/details\")[\"project\"]\n end", "title": "" }, { "docid": "4e7a86bb9e81d042908834c1cbd770ab", "score": "0.69622666", "text": "def show\n @unfinished_project = UnfinishedProject.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unfinished_project }\n end\n end", "title": "" }, { "docid": "313dff1bcb3157fad6221e541a61cfae", "score": "0.6961776", "text": "def show\n @workspaces = current_user.workspaces\n @project = Project.find(params[:id])\n @workspace = Workspace.find(params[:workspace_id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "83ae75281dbf69a50d44f959f76054d5", "score": "0.6961545", "text": "def index\n @user = User.find_by_id(session[:userid])\n @projects = current_user_projects\n respond_to do |format|\n format.html # index.html.erb\n format.json\n end\n end", "title": "" }, { "docid": "b36ef801f1a0738677729254dc14a75c", "score": "0.69614834", "text": "def get(project_name)\n response = get_request(\"/projects/#{project_name}/\")\n TheShiningSource::Project.new(response)\n end", "title": "" }, { "docid": "b7403f849d892c96ac78d2cbc710b45f", "score": "0.69565344", "text": "def show_project\r\n @project = Project.find(params[:id])\r\n @id = @project.id\r\n respond_to do |format|\r\n format.html { render 'project_control/view' }\r\n format.json { render json: @project }\r\n end\r\n end", "title": "" }, { "docid": "963db3301c148de143339a632c9da94c", "score": "0.6943089", "text": "def getProject(project)\r\n\t\t\t\tproject_json = JSON.parse project\r\n\t\t\t\tproject_array = project_json[\"projects\"]\r\n\t\t\t\treturn jsonToProject(project_array[0])\r\n\t\t\tend", "title": "" }, { "docid": "d7a2d43e06a35c7adc4917c2e828849b", "score": "0.6936655", "text": "def show\n @project = Project.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @projects }\n #format.json { render json: @project.as_json(:include => [:client, :project_participants] ) }\n end\n end", "title": "" }, { "docid": "6ca2ca84dd22168449fc3b86b03db006", "score": "0.69335127", "text": "def index\n if signed_in?\n @projects = current_user.projects\n respond_to do |format|\n format.html { render 'projects/index' }\n format.json { render template: 'projects/index.json.jbuilder' }\n end\n else\n redirect_to :projects\n end\n end", "title": "" }, { "docid": "0e505819a12e5e3076b53f7ea7b97815", "score": "0.69173217", "text": "def index\n @projects = @projects.includes(:latest_iteration).where(:tenant_id => current_user.tenant).order(\"name\").page(params[:page]).per(DEFAULT_ROWS_PER_PAGE)\n\n respond_with @projects\n end", "title": "" }, { "docid": "d3267bd277f0c37b415e0f299a52e655", "score": "0.69125015", "text": "def show\n respond_to do |format|\n format.html {render :show}\n format.json {render json: @project}\n end\n end", "title": "" }, { "docid": "b03208060bdb25d62f4458de07968421", "score": "0.6909762", "text": "def show\n @project = Project.find(params[:id])\n\t@user = User.find(@project.user_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "99c65c4b39603d417c5233c6b886ddff", "score": "0.69050795", "text": "def find(project_id)\n raw_response = get_request(\"projects/#{project_id}\")\n parse_response(raw_response, :project)\n end", "title": "" } ]
316b30086069e94f7aaf3dd3fd310fb8
Initiate the export of a contact list. Returns 200 if received OK.
[ { "docid": "e7762a11a2cb936e787c42d835f3415d", "score": "0.60225284", "text": "def post_outbound_contactlist_export_with_http_info(contact_list_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OutboundApi.post_outbound_contactlist_export ...\"\n end\n \n \n # verify the required parameter 'contact_list_id' is set\n fail ArgumentError, \"Missing the required parameter 'contact_list_id' when calling OutboundApi.post_outbound_contactlist_export\" if contact_list_id.nil?\n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/outbound/contactlists/{contactListId}/export\".sub('{format}','json').sub('{' + 'contactListId' + '}', contact_list_id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'DomainEntityRef')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OutboundApi#post_outbound_contactlist_export\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "c5c66a5f392390cd3fdcedd2f8c966b2", "score": "0.66566724", "text": "def import\n fire_async_response('import_contacts')\n end", "title": "" }, { "docid": "afea8ee899b24246571d44d0fa9217c5", "score": "0.6543209", "text": "def add_export_contacts_activity(access_token, export_contacts)\n url = Util::Config.get('endpoints.base_url') +\n Util::Config.get('endpoints.export_contacts_activity')\n url = build_url(url)\n payload = export_contacts.to_json\n response = RestClient.post(url, payload, get_headers(access_token))\n Components::Activity.create(JSON.parse(response.body))\n end", "title": "" }, { "docid": "9ee91b8a0033824c1869cb3a81152d55", "score": "0.63633", "text": "def add_export_contacts_activity(export_contacts)\n Services::ActivityService.add_export_contacts_activity(export_contacts)\n end", "title": "" }, { "docid": "878c01fee5925a159d63a27e8db8468c", "score": "0.6339584", "text": "def export_contacts\n if !params[:id].blank?\n @campaign_mailout = CampaignMailout.find(params[:id])\n \n stream_csv do |csv|\n csv << [\n \"ADDRESS_LINE1\",\n \"ADDRESS_LINE2\",\n \"ADDRESS_LINE3\",\n \"ADDRESS_LINE4\",\n \"ADDRESS_LINE5\",\n \"ADDRESS_LINE6\",\n \"ADDRESS_LINE7\",\n \"NOMEN\",\n \"FIRST_NAME\",\n \"LAST_NAME\",\n \"ROLE_TITLE\",\n \"ORGANISATION\",\n \"BUILDING\",\n \"STREET\",\n \"SUBURB\",\n \"LOCALITY\",\n \"POSTCODE\",\n \"REGION\",\n \"COUNTRY\",\n \"EMAIL\",\n \"PHONE\",\n \"FAX\",\n \"MOBILE\",\n \"SALUTATION\"\n ]\n @campaign_mailout.mailout_contacts.each do |c|\n firstname = ''\n lastname = ''\n if !c.name.nil? \n split = c.name.split(' ', 2)\n if split.length > 0\n firstname = split[0]\n lastname = split[-1]\n end\n end\n csv << [\n c.address_line1,\n c.address_line2,\n c.address_line3,\n c.address_line4,\n c.address_line5,\n c.address_line6,\n c.address_line7,\n c.nomen,\n firstname,\n lastname,\n c.role_title,\n c.organisation_name,\n c.building,\n c.street,\n c.suburb,\n c.locality,\n c.postcode,\n c.region,\n c.country,\n c.email,\n c.phone,\n c.fax,\n c.mobile_sms,\n c.salutation\n ]\n end\n end\n end\n end", "title": "" }, { "docid": "e238551921926000ac562fcdf156261e", "score": "0.6324338", "text": "def index\n @presenter = Admin::FosterContacts::IndexPresenter.new(current_user, params[:page], params[:q])\n respond_with(@foster_contacts) do |format|\n format.html\n format.csv do\n render csv: FosterContact.organization(current_user),\n filename: 'foster_contacts'\n end\n end\n end", "title": "" }, { "docid": "c5b4d8638ab7eac7d1554212d7ed6a35", "score": "0.6235195", "text": "def add_export_contacts_activity(access_token, export_contacts)\n\t\t\tServices::ActivityService.add_export_contacts_activity(access_token, export_contacts)\n\t\tend", "title": "" }, { "docid": "ef4436d84bcfc07b31d914ecfcca4957", "score": "0.6223859", "text": "def export_people\n @people = @current_user.get_contacts_list\n if params[:type][:all] == '0'\n types = []\n types << 'CSV importation' if params[:type][:imported_from_csv]=='1'\n types << 'Creation' if params[:type][:creation]=='1'\n types << 'contact_form' if params[:type][:front_contcts]=='1' \n @people = @people.delete_if{|p| !types.include?(p.origin)}\n end\n\t\t@outfile = \"people_\" + Time.now.strftime(\"%m-%d-%Y\") + \".csv\"\n\t\tcsv_data = FasterCSV.generate do |csv|\n\t\t\tcsv << [\"First name\", \"Last name\", \"Email\", \"Gender\", \"Primary phone\", \"Mobile phone\", \"Fax\", \"Street\", \"City\", \"Postal code\", \"Country\", \"Company\", \"Web page\", \"Job title\", \"Notes\",\"Salutation\",\"Date of birth\",\"Subscribed on\",\"Updated at\"]\n\t\t\t@people.each do |person|\n\t\t\t\tcsv << [person.first_name, person.last_name, person.email, person.gender, person.primary_phone, person.mobile_phone, person.fax, person.street, person.city, person.postal_code, person.country, person.company, person.web_page, person.job_title, person.notes, person.salutation, person.date_of_birth, person.created_at, person.updated_at]\n\t\t\tend\n\t\tend\n\t\tsend_data csv_data, :type => 'text/csv; charset=iso-8859-1; header=present', :disposition => \"attachment; filename=#{@outfile}\"\n\t\t#flash[:notice] = \"Export complete!\"\n end", "title": "" }, { "docid": "687172161b8163538fe70a233e17d7ce", "score": "0.62215966", "text": "def index\r\n\t@header_info = Contact.new\r\n\t\r\n @contacts = Contact.order( \"id DESC, last_name, first_name\" )\r\n\t\r\n\t\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @contacts }\r\n format.csv { render :action => 'spreadsheet.html', :layout => 'spreadsheet' }\r\n end\r\n end", "title": "" }, { "docid": "da2908608e7cea2cba9182a86ac1cb04", "score": "0.6193881", "text": "def index\n \n begin\n Rails.logger.info_log.info \" I,[#{Time.now.strftime(\"%Y-%m-%d %H:%M:%S %Z\")}]\" \"INFO -- : Entered in contact index page\"\n contacts=RestClient.get $api_service+'/contacts'\n @contacts=(JSON.parse contacts)\n\n user_id = session[:user_id]\n user = RestClient.get $api_service+\"/users/#{user_id}\"\n @user=JSON.parse user\n\n if @contacts.present?\n Rails.logger.info_log.info \" I,[#{Time.now.strftime(\"%Y-%m-%d %H:%M:%S %Z\")}]\" \"INFO -- : contacts successfully displayed\"\n else\n Rails.logger.debug_log.debug { \"#{\"contact may be not available otherwise check backend\"}\"}\n end \n\n rescue => e\n Rails.logger.custom_log.error { \"#{e} contact_controller index method\" }\n end\n \n# params[:file] = \"/home/nagammaialtius/Nagammai/Nagammai-Frontend/app/assets/images/CONTACTS.csv\"\n \nif params[\"file\"].present?\n send_file params[:file], :disposition => 'attachment'\nend\n\n end", "title": "" }, { "docid": "b27df6e4a558442b474f820f5581bc93", "score": "0.61845434", "text": "def index\n @search = VetContact.organization(current_user).search(params[:q])\n @vet_contacts = @search.result.paginate(page: params[:page], per_page: 10).order('updated_at DESC')\n\n respond_with(@vet_contacts) do |format|\n format.html # index.html.erb\n format.csv do\n render csv: VetContact.organization(current_user),\n filename: 'vet_contacts'\n end\n end\n end", "title": "" }, { "docid": "7f62522ea065148664aa224fddf1a85c", "score": "0.61837167", "text": "def add_export_contacts_activity(access_token, export_contacts)\n Services::ActivityService.add_export_contacts_activity(access_token, export_contacts)\n end", "title": "" }, { "docid": "2d623b0147b68444f9768b608d86de00", "score": "0.61673427", "text": "def person_export_csv\n begin\n export_file_async(:person_list)\n render nothing: true, status: 202\n rescue\n render nothing: true, status: 500\n end\n end", "title": "" }, { "docid": "5cc6072771cda8a3d12b1660e70b09aa", "score": "0.6086227", "text": "def callback\n @contacts = request.env['omnicontacts.contacts']\n if @contacts\n @contacts.each do |contact|\n client = Client.new(company_id: current_user.company_id,\n city: contact[:city],\n email: contact[:email],\n first_name: contact[:first_name],\n last_name: contact[:last_name],\n phone: contact[:phone_number],\n state: contact[:region],\n street: contact[:address_1],\n zipcode: contact[:postcode],\n company_name: contact[:company])\n client.save(validate: false)\n end\n flash[:success] = 'Contacts import successfully!'\n else\n flash[:danger] = 'Contacts not found!'\n end\n redirect_to clients_path\n end", "title": "" }, { "docid": "56fd3f317c3274e7aef6d43070264bba", "score": "0.6071228", "text": "def request_contact_export_with_http_info(request_contact_export, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ContactsApi.request_contact_export ...'\n end\n # verify the required parameter 'request_contact_export' is set\n if @api_client.config.client_side_validation && request_contact_export.nil?\n fail ArgumentError, \"Missing the required parameter 'request_contact_export' when calling ContactsApi.request_contact_export\"\n end\n # resource path\n local_var_path = '/contacts/export'\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = @api_client.object_to_http_body(request_contact_export)\n auth_names = ['api-key', 'partner-key']\n data, status_code, headers = @api_client.call_api(:POST, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'CreatedProcessId')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ContactsApi#request_contact_export\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "691418fd5cf2be2599c2fc6eb1b1b0fe", "score": "0.60633993", "text": "def index\n if params[:type] == 'xml'\n @responses = Response.where([\"contact_form_id = ?\", params[:contact_form_id].to_i]).order(\"#{@sort_field} #{@sort_direction}\").page(@current_page).per(@page_limit)\n else\n @responses = @contact_form.responses\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml # index.xml.builder\n format.csv { send_data @responses.to_csv_file }\n format.xls # index.xls.erb\n end\n end", "title": "" }, { "docid": "66e6207ff4c6b12c836d3b25ea64e91c", "score": "0.60513926", "text": "def index\n @contact_list = ContactList.find(params[:contact_list_id])\n @contact_list_items = @contact_list.contact_list_items.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contact_list_items }\n end\n end", "title": "" }, { "docid": "a72842baf905815ac14ed39652c21e31", "score": "0.60418993", "text": "def get_outbound_contactlist_export_with_http_info(contact_list_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: OutboundApi.get_outbound_contactlist_export ...\"\n end\n \n \n # verify the required parameter 'contact_list_id' is set\n fail ArgumentError, \"Missing the required parameter 'contact_list_id' when calling OutboundApi.get_outbound_contactlist_export\" if contact_list_id.nil?\n \n \n \n \n \n \n \n \n \n \n \n # resource path\n local_var_path = \"/api/v2/outbound/contactlists/{contactListId}/export\".sub('{format}','json').sub('{' + 'contactListId' + '}', contact_list_id.to_s)\n\n # query parameters\n query_params = {}\n query_params[:'download'] = opts[:'download'] if opts[:'download']\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n auth_names = ['PureCloud OAuth']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'ExportUri')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: OutboundApi#get_outbound_contactlist_export\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "725e24804cee3e5fa28af6db6dab5bca", "score": "0.60273397", "text": "def index\n respond_with(contacts)\n end", "title": "" }, { "docid": "ff9ad8c6170f909e8c8e6dbead2c9b80", "score": "0.60254276", "text": "def index\n @search = VolunteerContact.organization(current_user).search(params[:q])\n @volunteer_contacts = @search.result.paginate(page: params[:page], per_page: 10).order('updated_at DESC')\n\n respond_with(@volunteer_contacts) do |format|\n format.html # index.html.erb\n format.csv do\n render csv: VolunteerContact.organization(current_user),\n filename: 'volunteer_contacts'\n end\n end\n end", "title": "" }, { "docid": "9fdab04154cf6f7495b178e97f8426b7", "score": "0.59935737", "text": "def index\n # @postcard_exports = PostcardExport.all\n @mail_id = \"#{params['state']}-#{params['what']}-#{params['list']}\"\n # @mail_id = params['mail_id']\n\n @postcard_exports = PostcardExport.all\n\n respond_to do |format|\n format.html\n format.csv { send_data @postcard_exports.to_csv, filename: \"empire_weekly_rolling_state_email_#{Date.today}.csv\" }\n end\n\n if params['record'] == 'yes'\n new = PostcardRecord.create(\n company: params['co'],\n group: params['group'],\n mailing_id: params['mail_id'],\n mail_date: params['day'],\n card: params['card'],\n sent: params['sent']\n )\n new.save\n end\n end", "title": "" }, { "docid": "d428a398418c271098358ea9461e44ac", "score": "0.59454906", "text": "def contacts_list_xlsx\n authorize! :contacts_list_xlsx, nil\n \n @contacts = Contact.search(params)\n \n respond_to do |format|\n format.xlsx {\n response.headers['Content-Disposition'] = 'attachment; filename=\"Danh sach lien he.xlsx\"'\n }\n end\n end", "title": "" }, { "docid": "f57178a84b50e395a54307adc5ceb277", "score": "0.59348845", "text": "def index\n if current_mpd_user.show_welcome\n redirect_to :action => \"welcome\"\n else\n @title = \"My Ministry Partner Contact Info\"\n @col_layout = \"two_col\"\n conditions =[]\n if params[:sort].nil?\n @show = params[:show] \n else \n @show = process_sort_for_show(params[:sort])\n end\n\n if params[:type].present?\n if params[:type] == \"contact\"\n if params[:compare].present?\n select_conditions = params[:selection] + \" \" + params[:compare] + \" '\" + params[:value] + \"'\"\n else\n select_conditions = params[:selection] + \" = '\" + params[:value] + \"'\"\n end\n else \n select_conditions = \"mpd_contact_actions.\" + params[:selection] + \" = '\" + params[:value] + \"'\"\n end\n conditions = process_conditions(select_conditions)\n else \n conditions = process_conditions\n end\n @mpd_contacts = MpdContact.find(:all, :include => \"mpd_priorities\", :order => process_sort(params[:sort]),\n :conditions => conditions, :joins => :mpd_contact_actions)\n \n if request.xml_http_request?\n render :partial => \"shared/full_contacts_list\", :layout => false\n end\n end\n end", "title": "" }, { "docid": "bf6a9d520313a06cd5d3efe259bc3829", "score": "0.59257895", "text": "def index\n @contact_lists = ContactList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contact_lists }\n end\n end", "title": "" }, { "docid": "cbe2590bcb26c16448a528571667d02c", "score": "0.5918758", "text": "def index\n params[:page] ||= 1\n\n @q, @contact_links = ransack_paginate(ContactLink)\n\n respond_to do |format|\n format.html # index.html.haml\n format.json { render :json => @q.result.all }\n format.csv { render :csv => @q.result.all, :force_quotes => true, :filename => 'contact_links' }\n end\n end", "title": "" }, { "docid": "6ffd0b96851a404429d75a46f6610f6f", "score": "0.5917485", "text": "def index\n @contacts = Contact.order(:id)\n\n respond_to do |format|\n format.xls {\n send_data(xls_content_for(@contacts),\n :type => \"text/excel;charset=utf-8; header=present\",\n :filename => \"contacts_#{Time.now.strftime(\"%Y%m%d\")}.xls\")\n }\n format.html\n end\n end", "title": "" }, { "docid": "49fdcc0215a701a3d61bfef9c9f92d03", "score": "0.5907581", "text": "def import_contacts\n begin\n email_provider = \"yahoo\"\n oauth_token = params[:oauth_token]\n oauth_secret = session['yahoo_request_secret']\n oauth_verifier = params[:oauth_verifier]\n contacts_adapter = ContactsAdapter.new(nil, nil, oauth_token, oauth_secret, oauth_verifier)\n @contacts = contacts_adapter.contacts(email_provider)\n rescue MultiJson::DecodeError, Net::HTTPFatalError, OAuth::Problem\n redirect_to(root_path, :notice => \"Seus contatos não puderam ser importados agora. Por favor tente novamente mais tarde.\")\n end\n end", "title": "" }, { "docid": "9e6005a7f807d590498e312355ecd458", "score": "0.58708376", "text": "def enqueue_export\n return unless request.format.xls? || request.format.pdf? || request.format.csv? || request.format.zip?\n if list_exportable?\n @export = ListExport.create(\n controller: self.class.name,\n params: params,\n url_options: url_options,\n export_format: params[:format],\n company_user: current_company_user\n )\n\n @export.queue! if @export.new?\n end\n render action: :new_export, formats: [:js]\n end", "title": "" }, { "docid": "68470ef5b899e3b07521b4cdc5db3ec1", "score": "0.58699167", "text": "def perform\n\n p \"Exporting customers to #{@file_path}\"\n \n FileUtils.mkdir_p(@folder)\n\n now = DateTime.now\n @export_file = ExternalIntegration::BackgroundExportFile.create(name: \"Exportación clientes\",\n \t description: \"Exportación clientes\",\n \t notification_email: @notification_email,\n \t notify_by_email_on_finish: @notify_by_email_on_finish,\n \t created_at: now,\n \t valid_until: now + 1,\n \t file_name: @file_name,\n \t file_path: @file_path,\n \t url_path: \"/admin/integration/export/#{@file_name}\",\n \t content_type: @content_type,\n \t status: :pending)\n \n processed = 0\n\n begin\n\t CSV.open(@file_path, \"wb\") do |csv|\n columns = [\"name\", \"surname\", \"email\", \"phone\", \"address\", \"city\", \"state\", \"zip\", \"country\"]\n columns << \"sales_channel\"\n\t \tcsv << columns\n @customers = customers\n\t \t@export_file.update(status: :in_progress)\n\t @customers.each do |customer|\n address = \"\"\n address << customer.street unless customer.street.nil?\n address << \" \" unless customer.number.nil?\n address << customer.number unless customer.number.nil?\n address << \" \" unless customer.complement.nil?\n address << customer.complement unless customer.complement.nil?\n\t \tcsv << [customer.customer_name, customer.customer_surname, \n\t \t\t customer.customer_email, customer.customer_phone,\n address, customer.city, customer.state, customer.zip, customer.country,\n customer.sales_channel_code]\n\t \tprocessed += 1\n\t \t@export_file.update(number_of_records: processed)\n\t end \t\n\t end\n\t @export_file.update(status: :done)\n rescue StandardError => msg\n @export_file.update(status: :error, error_message: msg)\n end\t\n \n end", "title": "" }, { "docid": "7f7dd401b99ce0f9458c66085c915640", "score": "0.58595747", "text": "def index\n if params[:q] and params[:q][:auth_object] == \"newsletter\"\n @q = Contact.ransack(params[:q], auth_object: 'newsletter')\n @contacts = @q.result\n else\n @q = Contact.ransack(params[:q])\n @contacts = @q.result.page(params[:page]).paginate(:page => params[:page], :per_page => 10) \n end \n contacts = @q.result\n \n respond_to do |format|\n format.html \n format.js\n # if current_user.is_admin?\n # format.csv { send_data contacts.to_admin_csv(col_sep: \"\\t\",profile_id: params[:profile_id]) }\n # format.xls { send_data contacts.to_admin_csv(col_sep: \"\\t\",profile_id: params[:profile_id]) }\n\n # else\n format.csv { send_data contacts.to_csv }\n format.xls { send_data contacts.to_csv(col_sep: \"\\t\",profile_id: params[:profile_id])}\n # end \n end\n end", "title": "" }, { "docid": "e85df9e7ba565fe6a69b45f155b9c934", "score": "0.58479667", "text": "def fetch_contacts!\n create_agent\n prepare\n scrape_contacts\n end", "title": "" }, { "docid": "9905f1c46623072e49dba791d6edaa3f", "score": "0.583672", "text": "def index\n @search = VetContact.organization(current_user).search(params[:q])\n @vet_contacts = @search.result.paginate(:page => params[:page], :per_page => 10).order(\"updated_at DESC\")\n\n respond_with(@vet_contacts) do |format|\n format.html # index.html.erb\n format.xls { send_data VetContact.organization(current_user).to_xls, content_type: 'application/vnd.ms-excel', filename: 'vet_contacts.xls' }\n end\n end", "title": "" }, { "docid": "118f7cffa5dd688093edad29cd748253", "score": "0.5829552", "text": "def index\n get_all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contacts }\n end\n end", "title": "" }, { "docid": "997db6b07a21d0e3c50c0a42d26ae5ff", "score": "0.5828205", "text": "def index\n @recipients = Recipient.all(:all, :order => \"created_at DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @recipients }\n format.csv do\n csv_string = FasterCSV.generate do |csv| \n # header row\n header_row = Recipient.column_names\n header_row.delete(\"id\")\n #header_row.delete(\"token\")\n csv << header_row\n # data rows\n @recipients.each do |recipient|\n csvRow = Array.new\n header_row.each do |field|\n unless (field == \"id\") #|| (field == \"token\")\n csvRow << recipient[field]\n end\n end \n csv << csvRow\n end \n end\n date = Date.today\n filename = \"Mailing_List_\" + date.to_s + \".csv\"\n # send it to the browsah\n send_data(csv_string,\n :type => 'text/csv; charset=iso-8859-1; header=present',\n :disposition => \"attachment\",\n :filename => filename)\n end # end format.csv\n end\n end", "title": "" }, { "docid": "c49b4fbc045d0f1d3a35acd3171b4662", "score": "0.5827918", "text": "def index\n respond_with @contacts = Contact.all\n end", "title": "" }, { "docid": "73a3b8d2d47a7040f9e32e689e161358", "score": "0.5825839", "text": "def index\n @search = AdoptionContact.organization(current_user).search(params[:q])\n @adoption_contacts = @search.result.paginate(:page => params[:page], :per_page => 10).order(\"updated_at DESC\")\n @presenter = Admin::AdoptionContacts::IndexPresenter.new(current_user)\n respond_with(@adoption_contacts) do |format|\n format.html\n format.xls { send_data AdoptionContact.organization(current_user).to_xls, content_type: 'application/vnd.ms-excel', filename: 'adoption_contacts.xls' }\n end\n end", "title": "" }, { "docid": "ceb6fa22bac99850cef8221da01994db", "score": "0.58230895", "text": "def index\n contacts = Contact.all\n respond_with(contacts)\n end", "title": "" }, { "docid": "2a3486ba3c077a646d886e26808d5ec7", "score": "0.57963693", "text": "def index\n search = []\n search = params[:search].map { |k, v| v } if params[:search]\n params[:order] ||= \"name\"\n params[:direction] ||= \"asc\"\n params[:page] ||= 1\n \n @all_contacts = current_user.contacts.filter(search, params[:q], params[:order], params[:direction], params[:data_type])\n @contacts = @all_contacts.page(params[:page]).per_page(50)\n @pending_count = current_user.contacts.pending.count\n \n respond_to do |format|\n format.html\n format.json\n format.csv { send_data @all_contacts.to_csv(current_user.id) }\n format.js\n end\n end", "title": "" }, { "docid": "8e9d9aa39276adb29e5eac6f6de891be", "score": "0.577789", "text": "def index\n @companies = Company.all\n respond_to do |format|\n format.html\n format.csv { SendCSV.new(@companies, self) }\n end\n end", "title": "" }, { "docid": "f54e8aacfd31a71dfb1a120cd9bc0ecc", "score": "0.57618403", "text": "def index\n @presenter = Admin::AdoptionContacts::IndexPresenter.new(current_user, params[:page], params[:q], params[:animal_id])\n respond_with(@adoption_contacts) do |format|\n format.html\n format.csv do\n render csv: AdoptionContact.organization(current_user),\n filename: 'adoption_contacts'\n end\n end\n end", "title": "" }, { "docid": "6e7e7b1775fae18f54e89c83213be28c", "score": "0.5759163", "text": "def index\n response.headers['X-Total-Count'] = @contacts.count.to_s\n @contacts = @contacts.page(params[:page]) if params[:page].present?\n @contacts = @contacts.per(params[:per]) if params[:per].present?\n \n render json: @contacts\n end", "title": "" }, { "docid": "bb6bb612135869cac70e107cf7fbe6ec", "score": "0.575911", "text": "def index\n @contacts = Contact.all\n respond_with @contacts\n end", "title": "" }, { "docid": "999d35b9843364da9bf2d804e8e33bdb", "score": "0.57549065", "text": "def imports\n\tputs params.inspect + \"--------------------\"\n if params[:users].present?\n @contacts = ImportContact::Facebook.import(current_user, {\n :password => auth_params[:password],\n :email => auth_params[:email], :contact_uids => params[:users]\n })\n session.delete(:import_contact_params)\n flash.notice = \"Contacts imported.\"\n else\n redirect_to dashboard_contacts_path, :notice => \"Not selected contacts.\"\n end\n @contacts.each do |c|\n User.find_by_id(c[0].id).invite!\n end\n# User.where(:id => @contacts).map{ |v| v.invite!}\n\trender :text => dashboard_contacts_path.to_s\n end", "title": "" }, { "docid": "ee5ea438421c3f598cf28571e0577ac6", "score": "0.5752125", "text": "def post_outbound_contactlist_export(contact_list_id, opts = {})\n data, _status_code, _headers = post_outbound_contactlist_export_with_http_info(contact_list_id, opts)\n return data\n end", "title": "" }, { "docid": "7850419673ebfc994e54f7f05d4028a3", "score": "0.57481575", "text": "def addContacts()\n\t#Will hold the number of contacts added \n\t$contactsAdded = 0\n\t\n\t#First, we need to retrieve a list ID to add contacts to (for this example we'll get the latest ID)\n\t$listID = getListID();\n\t\n\tputs \"list ID we will add to: #{$listID}\"\n\t\n\t#Second, we need to prepare the information of contacts that will be added to the list \n\t#We will create an array that will hold contact's information \n\t#A contact MUST have an email in order to be added successfully. The other fields (like first name) are optional \n\t$contactInfo = [\n\t\t\t{:email => \"ruby@rubies.com\", :firstname => \"Red\", :lastname => \"Ruby\"},\n\t\t\t{:email => \"agent@smith.com\", :firstname => \"Agent\", :lastname => \"Smith\"}\n\t\t]\n\t\n\t#Third, make the API call to add contacts\n\t\n\t# listAddContacts(): Add our array of contacts to the specified mailing list \n\t#Pre-requisites - \n\t#\t- Must have connected to Benchmark Email's API and logged in. See section below under \"Logging In\"\n\t#\t- Must have prepared an array with at least one email for a contact to add \n\t# @param listID: The ID of the list we want to add contacts to \n\t# @param contactInfo : The array of contacts we are adding to the mailing list \n\t# @Return: (Integer) The number of contacts that were added to the mailing list \n\t$contactsAdded = BMEAPI.listAddContacts($listID, $contactInfo);\n\t\n\t#Display how many (if any) contacts were added. Remember that Benchmark Email does not allow duplicate contacts within the same list! \n\t#If you try to add a duplicate contact they will not be added to the mailing list \n\tif($contactInfo.length == $contactsAdded)\n\t\tputs \"All #{$contactsAdded} contact(s) were added successfully!\\n\\n\"\n\telsif($contactsAdded < 1)\n\t\tputs \"Looks like not all contacts were added: 0 of #{$contactInfo.length} contact(s) were added.\\n\\n\"\n\telsif($contactInfo.length > $contactsAdded)\n\t\tputs \"Looks like not all contacts were added: Only #{$contactsAdded} of #{$contactInfo.length} contact(s) were added.\\n\\n\"\n\tend\nend", "title": "" }, { "docid": "2bbbdba41f49fefd3a718c05e772a65a", "score": "0.57458425", "text": "def list\n @title = \"Step 1: Namestorm\"\n @col_layout = \"two_col\"\n @show_teaser = session[:first_time_namestorm]\n session[:first_time_namestorm] = nil\n \n items_per_page = 60\n @chunk_size = items_per_page / 3\n\n @pages, @contacts = paginate_collection current_mpd_user.mpd_contacts.sort_by { |c| c.created_at }.reverse, :per_page => items_per_page, :page => params[:page]\n\n if request.xml_http_request?\n render :partial => \"contacts_list\", :layout => false\n else\n render :action => \"list\"\n end\n end", "title": "" }, { "docid": "6aa3a71377fcce27a03df1f6d9fbbe4d", "score": "0.57451385", "text": "def index\n if current_mpd_user.mpd_contacts.count == 0\n redirect_to(:action => 'start')\n else\n redirect_to(:action => 'list')\n end\n end", "title": "" }, { "docid": "7a26551d39676a0d8b0a2dc528b9d0bc", "score": "0.57444936", "text": "def export( contacts = [] )\n return if contacts.empty? \n \n contacts.uniq.compact.collect do |contact|\n first_name, last_name = contact[:name].split(' ', 2)\n Vcard.new( :first => first_name.to_s, :last => last_name.to_s, :email => contact[:email])\n end\n end", "title": "" }, { "docid": "1414290ee260aeffc10766ec505776cf", "score": "0.5726609", "text": "def initialize(contacts, lists, column_names = [])\n if !contacts.empty?\n if contacts[0].instance_of?(Components::AddContactsImportData)\n @import_data = contacts\n else\n raise Exceptions::IllegalArgumentException, sprintf(Util::Config.get('errors.id_or_object'), 'AddContactsImportData')\n end\n end\n\n @lists = lists\n @column_names = column_names\n\n # attempt to determine the column names being used if they are not provided\n if column_names.empty?\n used_columns = [Util::Config.get('activities_columns.email')]\n\n contact = contacts[0]\n\n if !contact.first_name.nil?\n used_columns << Util::Config.get('activities_columns.first_name')\n end\n\n if !contact.middle_name.nil?\n used_columns << Util::Config.get('activities_columns.middle_name')\n end\n\n if !contact.last_name.nil?\n used_columns << Util::Config.get('activities_columns.last_name')\n end\n\n if !contact.job_title.nil?\n used_columns << Util::Config.get('activities_columns.job_title')\n end\n\n if !contact.company_name.nil?\n used_columns << Util::Config.get('activities_columns.company_name')\n end\n\n if !contact.work_phone.nil?\n used_columns << Util::Config.get('activities_columns.work_phone')\n end\n\n if !contact.home_phone.nil?\n used_columns << Util::Config.get('activities_columns.home_phone')\n end\n\n address = contact.addresses[0]\n\n if !address.line1.nil?\n used_columns << Util::Config.get('activities_columns.address1')\n end\n\n if !address.line2.nil?\n used_columns << Util::Config.get('activities_columns.address2')\n end\n\n if !address.line3.nil?\n used_columns << Util::Config.get('activities_columns.address3')\n end\n\n if !address.city.nil?\n used_columns << Util::Config.get('activities_columns.city')\n end\n\n if !address.state_code.nil?\n used_columns << Util::Config.get('activities_columns.state')\n end\n\n if !address.state_code.nil?\n used_columns << Util::Config.get('activities_columns.state_province')\n end\n\n if !address.country_code.nil?\n used_columns << Util::Config.get('activities_columns.country')\n end\n\n if !address.postal_code.nil?\n used_columns << Util::Config.get('activities_columns.postal_code')\n end\n\n if !address.sub_postal_code.nil?\n used_columns << Util::Config.get('activities_columns.sub_postal_code')\n end\n\n # Custom Fields\n if !contact.custom_fields.nil?\n contact.custom_fields.each do |custom_field|\n if custom_field.name.match('custom_field_')\n custom_field_number = custom_field.name[13, custom_field.length]\n used_columns << Util::Config.get('activities_columns.custom_field_' + custom_field_number)\n end\n end\n end\n\n @column_names = used_columns\n end\n end", "title": "" }, { "docid": "be7902e8f4fc40471335028e283626ed", "score": "0.5724351", "text": "def index\n @contacts = Contact.all\n respond_with(@contacts)\n end", "title": "" }, { "docid": "be7902e8f4fc40471335028e283626ed", "score": "0.5724351", "text": "def index\n @contacts = Contact.all\n respond_with(@contacts)\n end", "title": "" }, { "docid": "33547744389f4d8a5b6111764b77c848", "score": "0.5723809", "text": "def index\n @timestamp = Time.now.strftime(\"%Y%m%d-%H%M%S\")\n\n @contacts = Contact.where(nil)\n\n if(params['filter']=\"yes\")\n Contact.new.attributes.each do |attr_name, attr_value|\n\n if (attr_name == \"counsellor_id\")\n if (params['counsellor_signature'] && params['counsellor_signature'].length > 0)\n if(User.where(\"signature = ?\", params['counsellor_signature']).any?)\n @c = User.find_by_signature(params['counsellor_signature'])\n @contacts = @contacts.where(counsellor: @c)\n else\n @contacts = Contact.none\n end\n end\n\n elsif (attr_name == \"contactdate\")\n if (params['contactdate_selectrange'] == \"true\" )\n @contactdate_rangestart = params['contactdate_rangestart'].to_date\n @contactdate_rangeend = params['contactdate_rangeend'].to_date\n\n @contacts = @contacts.where(\"contactdate >= ? and contactdate <= ?\", @contactdate_rangestart, @contactdate_rangeend)\n end\n elsif (params[attr_name] && params[attr_name].length > 0)\n @param = params[attr_name]\n @contacts = @contacts.where(\"#{attr_name} like ?\", \"%\"+@param+\"%\") if params[attr_name].present?\n end\n end\n\n else\n if (params[:client_id])\n @contacts = Contact.where(\"client_id = ?\", params[:client_id])\n end\n end\n\n respond_to do |format|\n format.html\n format.json\n format.xls { headers[\"Content-Disposition\"] = \"attachment; filename=\\\"contact-export-#{@timestamp}.xls\\\"\" }\n end\n end", "title": "" }, { "docid": "93e686bd5b348a59669cbef192e6a350", "score": "0.57213914", "text": "def index\n\t @profiles = Profile.all\n\t respond_to do |format|\n\t format.html\n\t format.csv {\n\t send_data @profiles.export_csv, type: 'text/csv; charset=utf-8;header=present', disposition: 'attachement; filename=email_list.csv'\n\t }\n\t end\n\tend", "title": "" }, { "docid": "8b74c1c9e5a3b2233cb9073ff4244689", "score": "0.5719531", "text": "def get_contacts\n render :file => \"#{Rails.root}/lib/tasks/contact_list_test_data/data/cordova_format.json\"\n end", "title": "" }, { "docid": "d02289077538966499e1544de03f1064", "score": "0.5709266", "text": "def export\n export_config = active_scaffold_config.export\n if params[:export_columns].nil?\n export_columns = {}\n export_config.columns.each { |col|\n export_columns[col.name.to_sym] = 1\n }\n options = {\n :export_columns => export_columns,\n :full_download => export_config.default_full_download.to_s,\n :delimiter => export_config.default_delimiter,\n :skip_header => export_config.default_skip_header.to_s\n }\n params.merge!(options)\n end\n\n find_items_for_export\n\n response.headers['Content-Disposition'] = \"attachment; filename=#{export_file_name}\"\n render :partial => 'export', :layout => false, :content_type => Mime::CSV, :status => response_status\n end", "title": "" }, { "docid": "4af6e92fc34128709835b88d0ff1e624", "score": "0.56967187", "text": "def index\n @contacts = Contact.find_all_by_customer_id(current_customer.id)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contacts }\n end\n end", "title": "" }, { "docid": "04706addfe74dae16a16b9fbcb657253", "score": "0.5695499", "text": "def export\n @export_pto = PtoRequest.all\n respond_to do |format|\n format.csv { send_data @export_pto.to_csv }\n end\n end", "title": "" }, { "docid": "2a852e09b0fa60dc54fdfa4b43967bfe", "score": "0.5695446", "text": "def import_contacts(contacts)\n broadcast('@type' => 'importContacts',\n 'contacts' => contacts)\n end", "title": "" }, { "docid": "586f56e01323a792d6f4438806e376d0", "score": "0.56888115", "text": "def index\n @departments = Department.search(params[:search], params[:page])\n @all_departments = Department.all\n @computers = Computer.in_use\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @departments }\n format.csv do\n @outfile = \"departments_\" + Time.now.strftime(\"%m-%d-%Y\") + \".csv\"\n\n csv_data = FasterCSV.generate do |csv|\n csv << [\n \"Name\",\n \"Account Number\",\n \"Maintenance Total\"\n ]\n @all_departments.each do |dept|\n #unless dept.nil?\n csv << [\n dept.name,\n dept.try(:maintenance_account),\n dept.maintenance_fee_total\n ]\n #end\n end\n end\n\n send_data csv_data,\n :type => 'text/csv; charset=iso-8859-1; header=present',\n :disposition => \"attachment; filename=#{@outfile}\"\n\n flash[:notice] = \"Export complete!\"\n end\n end\n end", "title": "" }, { "docid": "2386283251314f375cd53b56ea6be435", "score": "0.5681268", "text": "def export\n @company = Company.find(params[:id])\n @customers = @company.get_customers()\n @divisions = @company.get_report_divisions()\n @locations = @company.get_report_locations()\n @products_categories = ProductsCategory.find(:all, :conditions => {:company_id => @company.id})\n @products = Product.find(:all, :conditions => {:company_id => @company.id})\n @suppliers = Supplier.find(:all, :conditions => {:company_id => @company.id})\n @products_kits = ProductsKit.find(:all, :conditions => {:company_id => @company.id})\n @invoices = Invoice.find(:all, :conditions => {:company_id => @company.id})\n @company_users = CompanyUser.find(:all, :conditions => {:company_id => @company.id})\n \n respond_to do |format|\n format.csv do\n render_csv(\"export_#{@company.id}\")\n end\n end\n end", "title": "" }, { "docid": "e60a48a1009569ec1fd5a4b812a36d0f", "score": "0.568017", "text": "def bulkexports; end", "title": "" }, { "docid": "9e37a80f2da8b313bdeb5e50fd5642c0", "score": "0.5667984", "text": "def index\n @contact_numbers = ContactNumber.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contact_numbers }\n end\n end", "title": "" }, { "docid": "8c430629ae70a709c1b2c8e546ce153f", "score": "0.56667536", "text": "def index\n\n\n # if mobile_request?\n # @company = current_user.company\n # end\n # @monthly_mails = current_user.company.company_setting.get_mails_capacity #.plan.monthly_mails\n # @monthly_mails_sent = current_user.company.company_setting.monthly_mails\n # @from_collection = current_user.company.company_from_email.where(confirmed: true)\n\n # @locations = Location.where(company_id: current_user.company_id, active: true).order(:order, :name)\n # @service_providers = ServiceProvider.where(company_id: current_user.company_id, active: true).order(:order, :public_name)\n # @services = Service.where(company_id: current_user.company_id, active: true).order(:order, :name)\n\n # selected_custom_filters = []\n # if !params[:custom_filters].blank?\n # selected_custom_filters = CustomFilter.find(params[:custom_filters])\n # end\n\n # @clients = Client.accessible_by(current_ability).filter(current_user.company_id, params)\n # @clients_export = Client.accessible_by(current_ability).filter(current_user.company_id, params)\n\n # #Custom filters\n # selected_custom_filters.each do |custom_filter|\n # @clients = Client.custom_filter(@clients, custom_filter)\n # @clients_export = Client.custom_filter(@clients_export, custom_filter)\n # end\n\n # @clients = @clients.order(sort_column + \" \" + sort_direction).paginate(:page => params[:page], :per_page => 25)\n # @clients_export = @clients_export.order(sort_column + \" \" + sort_direction)\n\n # @custom_filters = current_user.company.custom_filters\n\n # respond_to do |format|\n # format.html\n # format.csv\n # format.xls\n # end\n\n if mobile_request?\n @company = current_user.company\n end\n @monthly_mails = current_user.company.company_setting.get_mails_capacity #.plan.monthly_mails\n @monthly_mails_sent = current_user.company.company_setting.monthly_mails\n @from_collection = current_user.company.company_from_email.where(confirmed: true)\n\n @locations = Location.where(company_id: current_user.company_id, active: true).order(:order, :name)\n @service_providers = ServiceProvider.where(company_id: current_user.company_id, active: true).order(:order, :public_name)\n @services = Service.where(company_id: current_user.company_id, active: true).order(:order, :name)\n\n selected_custom_filters = []\n if !params[:custom_filters].blank?\n selected_custom_filters = CustomFilter.find(params[:custom_filters])\n end\n\n @clients = Client.accessible_by(current_ability)\n #@clients_export = Client.accessible_by(current_ability)\n\n #Custom filters\n selected_custom_filters.each do |custom_filter|\n @clients = Client.custom_filter(@clients, custom_filter)\n #@clients_export = Client.custom_filter(@clients_export, custom_filter)\n end\n\n\n @clients = @clients.filter(current_user.company_id, params)\n #@clients_export = @clients_export.filter(current_user.company_id, params)\n\n @clients_export = @clients.order(sort_column + \" \" + sort_direction)\n @clients = @clients.order(sort_column + \" \" + sort_direction).paginate(:page => params[:page], :per_page => 25)\n\n @custom_filters = current_user.company.custom_filters\n\n respond_to do |format|\n format.html\n format.csv { render text: Client.export_csv(current_user.company_id, @clients_export) }\n format.xls\n end\n\n end", "title": "" }, { "docid": "cc5eb91573baef0337075a9ef6aa9b1a", "score": "0.5654707", "text": "def index\n @contacts = current_user.contacts.order('eventdate DESC').paginate(:page => params[:page], :per_page => 30)\n respond_to do |format|\n format.html\n format.xls { send_data @contacts.to_csv(col_sep: \"\\t\") }\n end\n end", "title": "" }, { "docid": "76e64910ec3d436dc1ae5a8475ab4121", "score": "0.5642227", "text": "def index\n @iterator = 0\n @tasks = @list.tasks\n respond_to do |format|\n format.html\n format.json\n format.pdf { render template: \"tasks/task\", pdf: \"Task\" }\n format.csv { send_data @tasks.to_csv, filename: \"list-#{@list.name}-tasks-#{Date.today}.csv\" }\n end\n end", "title": "" }, { "docid": "4715da10ef7df2b91adc9f2cad0883e4", "score": "0.56319857", "text": "def index\n @contacts = Contact.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contacts }\n end\n end", "title": "" }, { "docid": "4715da10ef7df2b91adc9f2cad0883e4", "score": "0.56319857", "text": "def index\n @contacts = Contact.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contacts }\n end\n end", "title": "" }, { "docid": "0b1c8a03170dafc680c534771e206e77", "score": "0.5630713", "text": "def get_list\n # Pull the access token and base URL from the response body.\n accessToken = @auth_token['access_token']\n base_uri = @auth_token['resource_server_base_uri']\n\n # Create the URL that accesses the API.\n # GET https://api-c7.incontact.com/inContactAPI/services/v13.0/reports\n resource = 'services/v13.0/reports'\n\n # fields = \"abandoned,abandonSeconds,agentId,agentSeconds,contactId,contactStart,firstName,fromAddr,holdCount,holdSeconds,inQueueSeconds,isOutbound,isRefused,lastName,masterContactId,mediaType,mediaTypeName,pointOfContactName,preQueueSeconds,routingTime,serviceLevelFlag,skillId,skillName,toAddr,totalDurationSeconds\"\n # query_string_params = \"?startDate=\" + @start_date + \"&endDate=\" + @end_date + \"&fields=\" + fields + \"&mediaTypeId=4\"\n query_string_params = \"\"\n\n # Assemble URL\n url = URI(base_uri + resource + query_string_params)\n\n http = Net::HTTP.new(url.host, url.port)\n # http.read_timeout = 1000\n http.use_ssl = true\n\n request = Net::HTTP::Get.new(url)\n request[\"Content-Type\"] = 'application/x-www-form-urlencoded'\n request[\"Authorization\"] = \"Bearer #{accessToken}\"\n request[\"Accept\"] = 'application/json'\n request[\"Accept-Encoding\"] = 'none'\n request[\"cache-control\"] = 'no-cache'\n request[\"Connection\"] = 'keep-alive'\n\n # Make the HTTP post request and store the response.\n response = http.request(request)\n\n # http_status_code = response.code.to_i\n http_status_code = response.code.strip\n\n # Show me http status code\n puts \"http_status_code: #{http_status_code}\"\n # http_status_code.chr == '2'\n\n # When response is OK then parese it to a Ruby data structure\n if response.is_a?(Net::HTTPSuccess)\n puts \"Success. Response was a Net::HTTPSuccess object\"\n puts \"List of available reports was returned.\"\n response_string = response.body\n response_body_hash = JSON.parse(response_string)\n available_reports = response_body_hash\n else\n puts \"HTTP request failed\"\n available_reports = \"error\"\n end\n\n available_reports\n end", "title": "" }, { "docid": "db036fa4b829b95467922f91b16d9505", "score": "0.56201506", "text": "def index\n @contacts = Contact.all\n\n render json: @contacts\n end", "title": "" }, { "docid": "680464823216e7f4871a0a4894b924aa", "score": "0.5619869", "text": "def contacts()\n get('contactsList')\n end", "title": "" }, { "docid": "e00d8e1c1a2b7e6092cf5e6e091795e7", "score": "0.56192297", "text": "def index\n @customer_contacts = CustomerContact.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @customer_contacts }\n end\n end", "title": "" }, { "docid": "10436695c0c3efda7d51577d2f457f05", "score": "0.5608215", "text": "def index\n @casein_page_title = 'Partner assets'\n @partner_assets = PartnerAsset.order(sort_order(:retailer_domain)).paginate :page => params[:page]\n respond_to do |format|\n format.html\n format.csv { send_data @partner_assets.to_csv, filename: \"partner_assets-#{Date.today}.csv\"}\n format.xlsx\n end\n end", "title": "" }, { "docid": "1f091a8c1de3f52ce7a8a65675b39eee", "score": "0.56066215", "text": "def index\n contacts = Contact.all\n\n render json: contacts\n end", "title": "" }, { "docid": "426b5ea2a4eb3da555157268ff65ca48", "score": "0.56029224", "text": "def index\n @sub_contacts = SubContact.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sub_contacts }\n end\n end", "title": "" }, { "docid": "71eb0194d80c73c732647f4c4e0ef374", "score": "0.560043", "text": "def index\n # default contact_type to show to address\n @contact_type = params[:contact_type] || 'address'\n # set organization as contactable\n @contactable = Organization.find_organization(params)\n\n # if organization present, get contacts for that organziation\n if @contactable\n p @contacts = @contactable.contacts.where(contact_type: @contact_type)\n else\n # if there is org_type, get all contacts for that org type\n if params[:org_type]\n @org_type = MasterType.find_by_type_value(params[:org_type] ||= 'vendor')\n\n @organizations = @org_type.type_based_organizations\n @contacts = Contact.where(contact_type: @contact_type, contactable_id: @organizations.collect(&:id), contactable_type: 'Organization')\n else\n # if all else fails, get all contacts\n @contacts = Contact.all\n end\n end\n\n respond_to do |format|\n format.html # index.html.erb\n @concts = []\n format.json do\n @contacts = @contacts.select do |contact|\n conct = {}\n contact.attributes.each do |key, value|\n conct[key] = value\n end\n conct[:organization] = CommonActions.linkable(organization_path(contact.contactable), 'Organization : ' + contact.contactable.organization_short_name)\n conct[:first_name] = CommonActions.linkable(contact_path(contact), contact[:first_name]) if @contact_type == 'contact'\n conct[:contact_name] = contact.contact_title\n conct[:contact_telephone] = \"#{view_context.number_to_phone(contact.contact_telephone)}\"\n conct[:contact_fax] = \"#{view_context.number_to_phone(contact.contact_fax)}\"\n conct[:contact_default] = contact.default_address.present? ? 'selected' : ''\n conct[:contact_title] = CommonActions.linkable(contact_path(contact), contact[:contact_title]) if @contact_type == 'address'\n conct[:contact_email] = \"<a href='mailto:#{contact.contact_email}' target='_top'>#{contact.contact_email}</a>\"\n\n if can? :edit, Contact\n conct[:links] = CommonActions.object_crud_paths(nil, edit_contact_path(contact), nil)\n else\n conct[:links] = ''\n end\n @concts.push(conct)\n end\n render json: { aaData: @concts }\n end\n end\n end", "title": "" }, { "docid": "0e2fcd55302e282cc3a51e224b128d55", "score": "0.5593655", "text": "def import\n @company = Company.find_or_initialize_by(number: contact_params[:company][:number])\n @company.assign_attributes(contact_params[:company])\n @company_contact = Contact::Company.find_or_initialize_by(company: @company)\n\n @officer_contacts = []\n @officers = []\n\n contact_params[:officer].each do |officer|\n o = @company.officers.new(officer)\n @officers << o\n @officer_contacts << Contact::Officer.new(officer: o)\n end\n\n @company.save && @company_contact.save && @officers.each(&:save) && @officer_contacts.each(&:save)\n\n logger.error(company: @company.errors, company_contact: @company_contact.errors, officers: @officers.map(&:errors), officer_contacts: @officer_contacts.map(&:errors))\n\n respond_to :js\n end", "title": "" }, { "docid": "ed9e23cf4ddb9088dac181c38da695cf", "score": "0.55866367", "text": "def list\n respond_to do |format|\n format.html do\n @title = \"Customer List\"\n @customers = OrderUser.paginate(\n :include => ['orders'],\n :order => \"last_name ASC, first_name ASC\",\n :page => params[:page],\n :per_page => 30\n )\n render :action => 'list' and return\n end\n format.csv do\n send_data(\n OrderUser.get_csv_for(OrderUser.find(:all)),\n :filename => Time.now.strftime(\"Customer_list-%m_%d_%Y_%H-%M.csv\"),\n :type => 'text/csv'\n ) and return\n end\n end\n end", "title": "" }, { "docid": "034671f892cdc5d019f4845a4ec03bbe", "score": "0.55852693", "text": "def exporter\n @set = AddressSet.find(params[:id])\n @export_type = params[:export_type].parameterize.underscore.to_sym\n filename = 'NORMALIZED_' + @set.uploaded_file.filename\n respond_to do |format|\n format.html { render partial: 'address_sets/exporter/default' }\n format.csv { send_data(@set.to_csv(@export_type), filename: filename) }\n end\n end", "title": "" }, { "docid": "57faa6a96be4be5d9f797b4966f6360e", "score": "0.5578704", "text": "def index\n @contact_saveds = ContactSaved.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @contact_saveds }\n end\n end", "title": "" }, { "docid": "b726e5bdaa45ac838ffa79657a8e789d", "score": "0.5574198", "text": "def index\n @account_contacts = @account.account_contacts.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @account_contacts }\n end\n end", "title": "" }, { "docid": "108011244b095340dd1959eef601ab89", "score": "0.5566771", "text": "def index\n @bookings = Booking.all.order 'created_at DESC'\n @clients = Client.all\n\n respond_to do |format|\n format.html\n format.csv do\n headers['Content-Disposition'] = \"attachment; filename=\\\"user-list.csv\\\"\"\n headers['Content-Type'] ||= 'text/csv'\n end\n end\n end", "title": "" }, { "docid": "f44a9e5b1615dc91a3d2487533f1ecb2", "score": "0.5564663", "text": "def index\n if session[:saved_contact]\n @saved_contact = Contact.find(session[:saved_contact])\n session[:saved_contact] = nil\n end\n\n if get_case\n @contacts = @case.contacts.where.not(:type => \"Company\")\n @new_path = new_case_contact_path(@case)\n @contacts_a = [@case, Contact.new] #for modal partial rendering\n else\n @contacts = @firm.contacts.where.not(:type => \"Company\")\n @new_path = new_contact_path\n @contacts_a = Contact.new #for modal partial rendering\n end\n\n respond_to do |format|\n format.html\n format.json { render json: ContactsDatatable.new(view_context, current_user, true) }\n end\n end", "title": "" }, { "docid": "37b16c77d7b67871ef1c3fa36bc5252a", "score": "0.5562681", "text": "def index\n @organization_contacts = @organization.contacts\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "title": "" }, { "docid": "8f1e523034a5d7eeded17203de7f6e8d", "score": "0.5561291", "text": "def export\n export_config = active_scaffold_config.export\n if params[:export_columns].nil?\n export_columns = {}\n export_config.columns.each { |col|\n export_columns[col.name.to_sym] = 1\n }\n options = {\n :export_columns => export_columns,\n :full_download => export_config.default_full_download.to_s,\n :delimiter => export_config.default_delimiter,\n :skip_header => export_config.default_skip_header.to_s\n }\n params.merge!(options)\n end\n\n set_includes_for_columns(:export)\n @export_config = export_config\n # Make sure active_scaffold's find_page is dealing with the same list of\n # columns. Prevents an invalid SQL query when exporting after filtering\n # with field_search against a relation column, and that relation column is\n # not included in the set of export columns.\n @list_columns = @export_columns\n\n # this is required if you want this to work with IE\n if request.env['HTTP_USER_AGENT'] =~ /msie/i\n response.headers['Pragma'] = \"public\"\n response.headers['Cache-Control'] = \"no-cache, must-revalidate, post-check=0, pre-check=0\"\n response.headers['Expires'] = \"0\"\n end\n response.headers['Content-Disposition'] = \"attachment; filename=#{export_file_name}\"\n\n unless defined? Mime::XLSX\n Mime::Type.register \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\", :xlsx\n end\n\n respond_to do |format|\n format.csv do\n response.headers['Content-type'] = 'text/csv'\n # start streaming output\n self.response_body = Enumerator.new do |y|\n find_items_for_export do |records|\n @records = records\n str = render_to_string :partial => 'export', :layout => false, :formats => [:csv]\n y << str\n params[:skip_header] = 'true' # skip header on the next run\n end\n end\n end\n format.xlsx do \n response.headers['Content-type'] = 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'\n p = Axlsx::Package.new\n header = p.workbook.styles.add_style sz: 11, b: true,:bg_color => \"69B5EF\", :fg_color => \"FF\", alignment: { horizontal: :center }\n p.workbook.add_worksheet(name: active_scaffold_config.label) do |sheet|\n sheet.add_row(@export_columns.collect { |column| view_context.format_export_column_header_name(column) }, style: header) unless params[:skip_header]\n find_items_for_export do |records|\n records.each do |record|\n sheet.add_row @export_columns.collect{|column| view_context.get_export_column_value(record, column, false)}\n end\n end\n end\n stream = p.to_stream # when adding rows to sheet, they won't pass to this stream if declared before. axlsx issue?\n self.response_body = Enumerator.new do |y|\n y << stream.read \n end\n end\n\n end\n end", "title": "" }, { "docid": "09e9c8d4f054c803b662db4471e2a9dc", "score": "0.55547374", "text": "def export\n @army_list = ArmyList.find_by_uuid!(params[:uuid])\n @verbosity = params[:verbosity]\n @include_magics = params[:magics] == 'nomagics' ? false : true\n\n respond_to do |format|\n format.html { render template: @verbosity.nil? ? 'army_lists/export' : \"army_lists/export_#{@verbosity}\", layout: @verbosity.nil? ? nil : 'pdf.html.erb' }\n format.pdf { render template: \"army_lists/export_#{@verbosity}.html.erb\", pdf: \"9thbuilder_#{@verbosity}_#{params[:magics]}_#{@army_list.uuid}\" }\n end\n end", "title": "" }, { "docid": "4a3ada9c96ad2ec6b7aac81c41c7203a", "score": "0.5544671", "text": "def index\n @contacts = Contact.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contacts }\n end\n end", "title": "" }, { "docid": "4a3ada9c96ad2ec6b7aac81c41c7203a", "score": "0.5544671", "text": "def index\n @contacts = Contact.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @contacts }\n end\n end", "title": "" }, { "docid": "b0983e50d33918ba5ca53df3ecef5f54", "score": "0.55438733", "text": "def index\n @contacts = Contact.find(:all, :order => 'fn')\n\n respond_to do |format|\n format.html # index.rhtml\n format.xml { render :xml => @contacts.to_xml }\n end\n end", "title": "" }, { "docid": "4bf9a8f91d5ad041019a6a0e6171b2f6", "score": "0.55396533", "text": "def index\n @companies = Company.default\n respond_to do |format|\n format.html\n format.js\n format.csv do\n headers['Content-Disposition'] = \"attachment; filename=\\\"companies-#{Date.current}.csv\\\"\"\n headers['Content-Type'] ||= 'text/csv'\n end\n end\n end", "title": "" }, { "docid": "2cc623b43cc0d73542e63e65fa3732b0", "score": "0.55374575", "text": "def index\n respond_to do |format|\n format.html { render :index }\n format.json { render json: @members, status: :ok, location: @member }\n format.csv { send_data to_csv(@members), filename: \"members-#{DateTime.now.strftime('%Y%m%d%H%M%S')}.csv\" }\n format.xlsx do\n response.headers[\n 'Content-Disposition'\n ] = \"attachment; filename=members-#{DateTime.now.strftime('%Y%m%d%H%M%S')}.xlsx\"\n end\n end\n end", "title": "" }, { "docid": "9f141f30fef9074c0ebb375a286d189e", "score": "0.5534673", "text": "def index\n @contacts = Contact.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: {odata: @contacts }}\n end\n end", "title": "" }, { "docid": "694e3935f7effbe146043f0969d1a4ab", "score": "0.55344975", "text": "def download_csv\n if params[:search_id].blank?\n # this is for multiple contacts\n @people = get_search_or_key_contacts(params)\n else\n # this is for a single contact\n @people = []\n @people << User.find_by_id(params[:search_id])\n end\n respond_to do |format|\n format.csv do\n csv_string = CSV.generate do |csv|\n csv << [\"Name\", \"Given Name\", \"Additional Name\", \"Family Name\", \"Yomi Name\", \"Given Name Yomi\", \"Additional Name Yomi\", \"Family Name Yomi\", \"Name Prefix\", \"Name Suffix\", \"Initials\", \"Nickname\", \"Short Name\", \"Maiden Name\", \"Birthday\", \"Gender\", \"Location\", \"Billing Information\", \"Directory Server\", \"Mileage\", \"Occupation\", \"Hobby\", \"Sensitivity\", \"Priority\", \"Subject\", \"Notes\", \"Group Membership\", \"E-mail 1 - Type\", \"E-mail 1 - Value\", \"E-mail 2 - Type\", \"E-mail 2 - Value\", \"Phone 1 - Type\", \"Phone 1 - Value\", \"Phone 2 - Type\", \"Phone 2 - Value\", \"Phone 3 - Type\", \"Phone 3 - Value\", \"Phone 4 - Type\", \"Phone 4 - Value\", \"Organization 1 - Type\", \"Organization 1 - Name\", \"Organization 1 - Yomi Name\", \"Organization 1 - Title\", \"Organization 1 - Department\", \"Organization 1 - Symbol\", \"Organization 1 - Location\", \"Organization 1 - Job Description\"]\n @people.each do |user|\n org = user.organization_name.nil? ? \"\" : user.organization_name\n title = user.title.nil? ? \"\" : user.title\n csv << [user.first_name, user.first_name, \"\", user.last_name, \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", \"\", user.is_staff? ? \"Work\" : \"Other\", user.email, \"Home\", user.personal_email,\n\n csv_name_converter(user.telephone1_label), user.telephone1,\n csv_name_converter(user.telephone2_label), user.telephone2,\n csv_name_converter(user.telephone3_label), user.telephone3,\n csv_name_converter(user.telephone4_label), user.telephone4,\n \"\", org, \"\", title, \"\", \"\", \"\", \"\"]\n end\n end\n send_data csv_string,\n :type => \"text/csv; charset=utf-8\",\n :disposition => \"attachment; filename=contact.csv\"\n end\n end\n end", "title": "" }, { "docid": "fd9616b156a7ebfc2c7b736c40b36eaf", "score": "0.55315524", "text": "def importcontacts\n # setup the query but don't execute yet...\n logger.debug \"Into Alias#importcontacts\"\n \n contactlist = String.new\n contacts = Array.new\n \n service_id = params[:serviceid].to_i\n\n if (service_id == 1)\n # email contacts...\n logger.debug \"service id = 1 (email contacts)\"\n # contacts coming in as parameter as a comma-separated list already...\n contactlist = params[:contactlist]\n contacts = contactlist.split(',').sort\n elsif (service_id == 2)\n # Twitter..\n logger.debug \"service id = 2 (twitter contacts)\"\n contacts = ::TwitterClient.get_friends_by_token params\n# contacts = contacts.sort_by{|x| x.username}\n# contacts.each do |c|\n# contactlist << c.username << ','\n# end \n# contactlist.chomp!(',') # remove last ',' if exists\n elsif (service_id == 3)\n # Facebook...\n logger.debug \"service id = 3 (Facebook contacts)\"\n contacts = ::FacebookClient.get_friends_by_token params\n# contacts = contacts.sort_by{|x| x.username}\n# contacts.each do |c|\n# contactlist << c.username << ','\n# end \n# contactlist.chomp!(',') # remove last ',' if exists\n else\n # unknown - fail...\n respond_to do |format|\n format.json { head :no_content }\n end\n return\n end\n\n # NOTE: for service_id=3 (facebook), c.username is actually c.identifier\n if (service_id != 1)\n contacts = contacts.sort_by{|x| x.username}\n contacts.each do |c|\n contactlist << c.username << ','\n end \n contactlist.chomp!(',') # remove last ',' if exists\n end \n \n query = ::Alias.checkcontacts(params[:auth_token], contactlist, service_id, 0)\n # This will issue a query, but only with the attributes we selected above.\n # It also returns a simple Hash, which is significantly more efficient than a\n # full blown ActiveRecord model.\n results = ActiveRecord::Base.connection.select_all(query)\n results = results.sort_by{|x| x[\"user_id\"]}\n\n # filter out duplicate flux user ids - pick only the first since it doesn't really matter which...\n uniqresults = Array.new\n lastid = -1\n if (results.size > 0)\n results.each do |r|\n if r[\"user_id\"].to_i != lastid\n uniqresults << r\n lastid = r[0].to_i\n end\n end\n end\n\n # now merge two lists based on alias_name and add the profile image URL into the hash...\n uniqresults = uniqresults.sort_by{|x| x[\"alias_name\"].to_s}\n c_idx = 0 \n contactrows = Array.new\n fluxrows = Array.new\n\n if (uniqresults.size > 0)\n uniqresults.each do |r|\n if (service_id == 1)\n # email contacts...\n while (c_idx < contacts.size) && (contacts[c_idx].to_s < r[\"alias_name\"].to_s) do\n # contacts that are not in FLUX\n nr = {alias_name: contacts[c_idx], profile_pic_URL: '',\n display_name: contacts[c_idx],\n social_id: contacts[c_idx],\n user_id: 0, username: '', am_follower: 0, is_following: 0}\n contactrows << nr\n c_idx = c_idx + 1\n end\n\n if (c_idx < contacts.size) && (r[\"alias_name\"].to_s == contacts[c_idx].to_s)\n nr = {alias_name: r[\"alias_name\"],\n display_name: r[\"alias_name\"],\n profile_pic_URL: '',\n social_id: r[\"user_id\"],\n user_id: r[\"user_id\"], username: r[\"username\"], \n am_follower: r[\"am_follower\"], is_following: r[\"is_following\"]}\n # find if the user has an avatar then fetch the thumb path for it\n @user = User.find(r[\"user_id\"])\n path = @user.avatar.path('thumb')\n if (!path.nil?)\n nr[:profile_pic_URL] = path\n end\n fluxrows << nr\n c_idx = c_idx + 1\n end\n elsif ((service_id == 2) || (service_id == 3))\n # Twitter and Facebook contacts...\n while (c_idx < contacts.size) && (contacts[c_idx].username.to_s < r[\"alias_name\"].to_s) do\n # add rows to something to add into r later...\n if (service_id == 2)\n piu = contacts[c_idx].profile_image_uri.to_s\n ident = contacts[c_idx].id\n elsif (service_id ==3)\n piu = 'http://graph.facebook.com/' + contacts[c_idx].identifier + '/picture?type=small'\n ident = contacts[c_idx].identifier\n end\n nr = {alias_name: contacts[c_idx].username, profile_pic_URL: piu,\n display_name: contacts[c_idx].name,\n social_id: ident,\n user_id: 0, username: '', am_follower: 0, is_following: 0}\n contactrows << nr\n c_idx = c_idx + 1\n end\n\n if (c_idx < contacts.size) && (r[\"alias_name\"].to_s == contacts[c_idx].username.to_s)\n nr = {alias_name: r[\"alias_name\"],\n display_name: contacts[c_idx].name,\n profile_pic_URL: '',\n social_id: '',\n user_id: r[\"user_id\"], username: r[\"username\"], \n am_follower: r[\"am_follower\"], is_following: r[\"is_following\"]}\n if (service_id == 2)\n if (contacts[c_idx].profile_image_uri?)\n nr[:profile_pic_URL] = contacts[c_idx].profile_image_uri.to_s\n end\n nr[:social_id] = contacts[c_idx].id\n else\n nr[:profile_pic_URL] = 'http://graph.facebook.com/' + contacts[c_idx].identifier + '/picture?type=small'\n nr[:social_id] = contacts[c_idx].identifier\n end\n fluxrows << nr\n c_idx = c_idx + 1\n end\n end\n end\n \n # now do the rest in the contacts list...\n if (service_id == 1)\n # email contacts...\n while (c_idx < contacts.size) do\n nr = {alias_name: contacts[c_idx], profile_pic_URL: '',\n display_name: contacts[c_idx],\n social_id: contacts[c_idx],\n user_id: 0, username: '', am_follower: 0, is_following: 0}\n contactrows << nr\n c_idx = c_idx + 1\n end\n elsif ((service_id == 2) || (service_id == 3))\n # Twitter & Facebook contacts...\n piu = String.new\n while (c_idx < contacts.size) do\n # add rows to something to add into r later...\n if (service_id == 2)\n piu = contacts[c_idx].profile_image_uri.to_s\n ident = contacts[c_idx].id\n elsif (service_id ==3)\n piu = 'http://graph.facebook.com/' + contacts[c_idx].identifier + '/picture?type=small'\n ident = contacts[c_idx].identifier\n end\n nr = {alias_name: contacts[c_idx].username, profile_pic_URL: piu,\n display_name: contacts[c_idx].name,\n social_id: ident,\n user_id: 0, username: '', am_follower: 0, is_following: 0}\n contactrows << nr\n c_idx = c_idx + 1\n end\n end \n \n elsif (contacts.size > 0)\n if (service_id == 1)\n # email contacts...\n contacts.each do |c|\n nr = {alias_name: c, profile_pic_URL: '',\n display_name: c,\n social_id: c,\n user_id: 0, username: '', am_follower: 0, is_following: 0}\n contactrows << nr\n c_idx = c_idx + 1\n end \n elsif ((service_id == 2) || (service_id == 3))\n contacts.each do |c|\n if (service_id == 2)\n piu = c.profile_image_uri.to_s\n ident = c.id\n elsif (service_id ==3)\n piu = 'http://graph.facebook.com/' + c.identifier + '/picture?type=small'\n ident = c.identifier\n end\n nr = {alias_name: c.username, profile_pic_URL: piu,\n display_name: c.name,\n social_id: ident,\n user_id: 0, username: '', am_follower: 0, is_following: 0}\n contactrows << nr\n end\n end\n end\n \n # spin through the flux contacts and update the profile pic to the flux pic if it exists..\n fluxrows.each do |fr|\n user = User.find(fr[:user_id])\n path = user.avatar.path('thumb')\n if (!path.nil?)\n if (Rails.env == 'production') || (Rails.env == 'staging')\n fr[:profile_pic_URL] = user.avatar.expiring_url(10,'thumb')\n else\n fr[:profile_pic_URL] = user.avatar.url('thumb')\n end\n end\n end\n\n # sort the flux rows and contact rows, then concatenate together\n if (service_id == 2)\n # Twitter - sort by alias_name\n finalresults = fluxrows.sort_by{|x| x[:alias_name].downcase} + contactrows.sort_by{|x| x[:alias_name].downcase}\n else\n finalresults = fluxrows.sort_by{|x| x[:display_name].downcase} + contactrows.sort_by{|x| x[:display_name].downcase}\n end\n\n respond_to do |format|\n# format.html # show.html.erb\n# format.json { render json: @aliases }\n format.json { render json: finalresults }\n end\n end", "title": "" }, { "docid": "bfe10b8331b0ee29210872be92aa2d3c", "score": "0.55302066", "text": "def index\n add_breadcrumb I18n.t(:teleconsults), :teleconsults_path\n options = Hash.new\n options[:status_type] = params[:status_type]\n options[:show_case] = params[:show_case]\n options[:case_id] = params[:case_id]\n options[:appointment_id] = params[:appointment_id]\n if params[:case_id]\n @case = Case.find params[:case_id]\n end\n if params[:appointment_id]\n @appointment = Appointment.find params[:appointment_id]\n end\n respond_to do |format|\n format.html{ }\n format.js{ render 'application/index' }\n format.pdf{}\n format.csv{ params[:length] = 500\n\n json = TeleconsultDatatable.new(view_context, options).as_json\n send_data Teleconsult.to_csv(json[:data]), filename: \"Teleconsult-#{Date.today}.csv\"\n }\n format.json{\n\n render json: TeleconsultDatatable.new(view_context,options)\n }\n end\n end", "title": "" }, { "docid": "28e698fa6b528b47529e3c8366e5a8d4", "score": "0.5528155", "text": "def index\n @dept_contacts = DeptContact.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @dept_contacts }\n end\n end", "title": "" }, { "docid": "e4644cd5ba09445ff49639d3292f94db", "score": "0.5523522", "text": "def index\n authorize ExportFile\n @export_files = ExportFile.order('id DESC').page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @export_files }\n end\n end", "title": "" }, { "docid": "6ff2118a181ace3bfe19d4ff045031e5", "score": "0.5519484", "text": "def index\n @clientele = Clientele.find(params[:clientele][:id])\n @contacts = @clientele.contacts\n\n respond_to do |format|\n if @contacts.empty?\n format.xml { render request.format.to_sym => \"cconErreurA\" } # Aucun Contact collecté\n else\n format.xml { render xml: @contacts }\n end\n end\n end", "title": "" }, { "docid": "86f4fe3379f4c6863e6bc16af41f8959", "score": "0.55162776", "text": "def export\n file_url = AccountsApi::Accounts.csv_exports(account_id: current_user.account_id)\n redirect_to file_url\n end", "title": "" }, { "docid": "7621eff34fa4f94d2e028ce857006415", "score": "0.55134374", "text": "def import_exported_list\n\t\tif (request.post?)\n\t\t\tFiles.save_to_public(params[\"file_staff_list\"], \"staff_list.xls\")\n\t\t\timport_exported(\"public/files/staff_list.xls\")\n\t\tend\n\tend", "title": "" }, { "docid": "8b85821babad5686571545e20c8bde8c", "score": "0.54982513", "text": "def create\n #@consumer_tokens=ConsumerToken.where(:user_id => current_user.id).all\n #@services=OAUTH_CREDENTIALS.keys-@consumer_tokens.collect{|c| c.class.service_name}\n\n @contact = Contact.import_contact(current_user, params[:contact][:name], params[:contact][:email].downcase, 1, nil)\n\n\n respond_to do |format|\n if @contact \n flash[:notice] = 'Contact was successfully created.'\n format.html { redirect_to(@contact) }\n format.xml { render :xml => @contact, :status => :created, :location => @contact }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @contact.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e788d7a393d6268ee99a62b7978a4fe9", "score": "0.5497599", "text": "def index\n @exports = Export.paginate(:page => params[:page]).order(sort_column + \" \" + sort_direction)\n @export = Export.first\n @dbs = get_dbs\n @search = Export.first\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @exports }\n end\n \n end", "title": "" } ]
519326bbc460242b0ca5f698f4dab6c4
Returns the value of attribute description_args.
[ { "docid": "207f17285f3d0ecad0d4f68ec9f11e46", "score": "0.739345", "text": "def description_args; end", "title": "" } ]
[ { "docid": "9a2ce8f739e7e098602d9d4e1bf1c2b4", "score": "0.7218626", "text": "def description\n attributes['description']\n end", "title": "" }, { "docid": "55ca238e83845c93b5a4c57ea05c5230", "score": "0.70798826", "text": "def description\n @attributes['description']\n end", "title": "" }, { "docid": "d85e0a70c3b0d30dc853e45155c450a3", "score": "0.7017557", "text": "def description\n @attributes[:description]\n end", "title": "" }, { "docid": "d85e0a70c3b0d30dc853e45155c450a3", "score": "0.7017557", "text": "def description\n @attributes[:description]\n end", "title": "" }, { "docid": "d85e0a70c3b0d30dc853e45155c450a3", "score": "0.7017557", "text": "def description\n @attributes[:description]\n end", "title": "" }, { "docid": "d85e0a70c3b0d30dc853e45155c450a3", "score": "0.7017557", "text": "def description\n @attributes[:description]\n end", "title": "" }, { "docid": "16c32f5db23a0179545588e993205130", "score": "0.6769204", "text": "def description(*args)\n unless args.empty?\n @description = args.first\n end\n\n @description ||= nil\n end", "title": "" }, { "docid": "a5ec55f130b40b25dff5554835ab8996", "score": "0.6769181", "text": "def description\n @attributes.fetch('description', nil)\n end", "title": "" }, { "docid": "aeb67a5eca0e26bc98677171a63ee4cf", "score": "0.6765453", "text": "def arg_description; end", "title": "" }, { "docid": "f8f0ff16ee0d84569455c3830ef9aa84", "score": "0.6683314", "text": "def desc(*args)\n @desc ||= args\n end", "title": "" }, { "docid": "70fa1ae607787de9b45774df9f96419f", "score": "0.6650317", "text": "def arguments\n attributes.fetch(:arguments)\n end", "title": "" }, { "docid": "cfbf44b48ebe0412cebba0a7567ce20a", "score": "0.6640558", "text": "def description(arg=nil)\n @description = arg if arg\n @description\n end", "title": "" }, { "docid": "fabb8d840bd50f24c85f2be310733f5f", "score": "0.65357864", "text": "def arg_description # :nodoc:\n @arg_names ? \"[#{arg_names.join(',')}]\" : nil\n end", "title": "" }, { "docid": "9e4d25b375107c5d880ab011f420fbf9", "score": "0.6516223", "text": "def get_args(args: nil)\n case descrs.size\n when 0; []\n when 1; descrs.first.text.split(' ')\n else [DESCRS_ABBR]\n end\n end", "title": "" }, { "docid": "866716251091fff7d386d6e683979a88", "score": "0.64830786", "text": "def arg_description # :nodoc:\n @arg_names ? \"[#{(arg_names || []).join(',')}]\" : nil\n end", "title": "" }, { "docid": "b37fb17d272bf12ebd9bbc36c7d87c83", "score": "0.64823294", "text": "def desc(*args)\n self.description = args.first unless args.empty?\n self.description\n end", "title": "" }, { "docid": "a53d5fa49ea84105f1b30a302f7aa5cc", "score": "0.6404326", "text": "def description\n values = super\n values = Deepblue::MetadataHelper.ordered( ordered_values: description_ordered, values: values )\n return values\n end", "title": "" }, { "docid": "2f338eaa02fdba7fbc079cc6988a278a", "score": "0.63936925", "text": "def description\n @options['description']\n end", "title": "" }, { "docid": "4aab167d2c5cbe78ade4a103edcd0fe6", "score": "0.6380087", "text": "def description\n values.length == 1 ? values.first.inspect : values.inspect\n end", "title": "" }, { "docid": "e70eec7f24fff6ed86a56d39fd8e6805", "score": "0.63779294", "text": "def description!\n read_attribute :description\n end", "title": "" }, { "docid": "a3aedc51e5f70ceb94f6da4fccf84941", "score": "0.63594127", "text": "def description\n return @children['description'][:value]\n end", "title": "" }, { "docid": "a3aedc51e5f70ceb94f6da4fccf84941", "score": "0.63594127", "text": "def description\n return @children['description'][:value]\n end", "title": "" }, { "docid": "a3417f5c43b2c7b2f1c52469a12948d5", "score": "0.635203", "text": "def description\n self[:desc]\n end", "title": "" }, { "docid": "6bad0dea8149b980498cebce50ceba35", "score": "0.6315213", "text": "def description(value, target=nil)\n targets = [target].compact\n attribute(:description, value, {}, *targets)\n end", "title": "" }, { "docid": "20f66a8046c80b8c1a6e78344a477e1f", "score": "0.62863505", "text": "def get_description\n self[:description]\n end", "title": "" }, { "docid": "a2b7450175e1ba9c5eb2fcc0beed54fe", "score": "0.627112", "text": "def getDescription\r\n\t\t\t\t\treturn @description\r\n\t\t\t\tend", "title": "" }, { "docid": "a2b7450175e1ba9c5eb2fcc0beed54fe", "score": "0.627112", "text": "def getDescription\r\n\t\t\t\t\treturn @description\r\n\t\t\t\tend", "title": "" }, { "docid": "e143b84fe26873cd97a77d533fb8aba5", "score": "0.6247016", "text": "def description\n description_property ? description_property.ruby_value : nil\n end", "title": "" }, { "docid": "e143b84fe26873cd97a77d533fb8aba5", "score": "0.6247016", "text": "def description\n description_property ? description_property.ruby_value : nil\n end", "title": "" }, { "docid": "fe8b915f0221fd1bb8c88cd6c6ce495a", "score": "0.6231283", "text": "def get_description\n @description\n end", "title": "" }, { "docid": "fe61f2063bac8e2cbe1e353bb1fa0331", "score": "0.6229831", "text": "def get_description\r\n @description\r\n end", "title": "" }, { "docid": "69d32866df029c848f6ddc36578da0f0", "score": "0.6225667", "text": "def description\n self[:description]\n end", "title": "" }, { "docid": "9bb95c3009c37221ba0cf0c78e8fe4bd", "score": "0.62238544", "text": "def description\n self[:description]\n end", "title": "" }, { "docid": "7f33a186d33e05ad238410c1b4934b41", "score": "0.622052", "text": "def description\n # this tells us to puts the title(label) with the @title(value) of the title.\n puts \"description:\" + @title\n # @description is a value\n return @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.62093794", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.62093794", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.62093794", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.62093794", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.62093794", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.62093794", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.62093794", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.62093794", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.62093794", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.62093794", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.62093794", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.62093794", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6209123", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6209123", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6209123", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6209123", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6209123", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6209123", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6209123", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6209123", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6209123", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" }, { "docid": "693110e5b8a83113fa5840ad91468b37", "score": "0.6208937", "text": "def description\n @description\n end", "title": "" } ]
61d0e096b90806575ba3a45dd482a920
See for redirect_uri reasoning
[ { "docid": "870b5117879430872e0a62b043f1bb6c", "score": "0.0", "text": "def build_access_token\n client.auth_code.get_token(\n request.params['code'],\n { redirect_uri: callback_url }.merge(token_params.to_hash(symbolize_keys: true)),\n deep_symbolize(options.auth_token_params)\n )\n end", "title": "" } ]
[ { "docid": "ebd0cb55eca9f4af8c22fb569468f5f0", "score": "0.7769706", "text": "def redirect_uri\r\n @redirect_uri\r\n end", "title": "" }, { "docid": "99145c8a4adfe75e8fc1b8cebdfdbe5f", "score": "0.7619622", "text": "def default_redirect_uri_callback(uri, res)\n newuri = urify(res.header['location'][0])\n if !http?(newuri) && !https?(newuri)\n warn(\"#{newuri}: a relative URI in location header which is not recommended\")\n warn(\"'The field value consists of a single absolute URI' in HTTP spec\")\n newuri = uri + newuri\n end\n if https?(uri) && !https?(newuri)\n raise BadResponseError.new(\"redirecting to non-https resource\")\n end\n puts \"redirect to: #{newuri}\" if $DEBUG\n newuri\n end", "title": "" }, { "docid": "8224ffb21034f5589729e9b7479ab8df", "score": "0.7377783", "text": "def redirect_url; end", "title": "" }, { "docid": "307dc3686edc32b350653930b6095103", "score": "0.73728216", "text": "def redirect_uri\n uri = URI.parse request.url\n uri.path = '/auth/callback'\n uri.query = nil\n uri.scheme = 'https'\n\n return uri.to_s\n end", "title": "" }, { "docid": "8726430b73e1889a4f8e084e21694516", "score": "0.7347437", "text": "def valid_redirect_uri?(_uri)\n true\n end", "title": "" }, { "docid": "b3da3714f11828430e6459d8f54fca6a", "score": "0.7299437", "text": "def redirect_url\n redirect? ? headers['location'] : nil\n end", "title": "" }, { "docid": "a77028ac80356252d0a79078abc3d470", "score": "0.7298619", "text": "def website_redirect_location; end", "title": "" }, { "docid": "5d2df2add51fc45235ac65f56e9f3ca3", "score": "0.7211172", "text": "def redirect_uri\n uri = URI.parse(request.url)\n uri.path = '/oauth2callback'\n uri.query = nil\n uri.to_s\n end", "title": "" }, { "docid": "2de4b0e1bb8212c3911d7729c5cc2b83", "score": "0.7039953", "text": "def redirect_url\n nil\n end", "title": "" }, { "docid": "76feb1ec89763d602e4865d8121d318f", "score": "0.69175696", "text": "def follow_redirect!; end", "title": "" }, { "docid": "76feb1ec89763d602e4865d8121d318f", "score": "0.69175696", "text": "def follow_redirect!; end", "title": "" }, { "docid": "76feb1ec89763d602e4865d8121d318f", "score": "0.69175696", "text": "def follow_redirect!; end", "title": "" }, { "docid": "528b00fa40a531fbe708b3b195bf57ee", "score": "0.6914647", "text": "def valid_redirect_uri?(uri)\n return self.client.valid_redirect_uri?(uri)\n end", "title": "" }, { "docid": "eccbb795450335ffedecdcd0fbd98948", "score": "0.6911373", "text": "def default_redirect_status\n 302\n end", "title": "" }, { "docid": "eccbb795450335ffedecdcd0fbd98948", "score": "0.6911373", "text": "def default_redirect_status\n 302\n end", "title": "" }, { "docid": "5daccc2db4f9f0c3ad9108781eb0f31c", "score": "0.69011533", "text": "def website_redirect_location(value); end", "title": "" }, { "docid": "70ba74bb84f9466776c4573b87d1ef48", "score": "0.6852953", "text": "def access_denied_redirect_url\n root_url\n end", "title": "" }, { "docid": "84ebcac419183d014f4e2fb4e47d797c", "score": "0.6814413", "text": "def redirect(url); end", "title": "" }, { "docid": "87383ffb36861d8bbb2c756f52fca2b8", "score": "0.68088675", "text": "def redirect_url\n @redirect_url\n end", "title": "" }, { "docid": "9326f3e80ffe71cfb17eefa64d749900", "score": "0.6790394", "text": "def redirect?; url != redirect && !redirect.empty? end", "title": "" }, { "docid": "bd32ccede5b0d0f4ea0406219ef37520", "score": "0.6759704", "text": "def url_redirect\n \turl = self.url\n \t(url.include?(\"http://\") || url.include?(\"https://\") ? url : \"http://\"+url)\n end", "title": "" }, { "docid": "6a46a72d8ede1f65f0682ac56eabb0ce", "score": "0.67234516", "text": "def url\n redirect.url\n end", "title": "" }, { "docid": "f236327e3b7b135075751fe28e148e30", "score": "0.66890943", "text": "def redirect_url(realm, return_to = T.unsafe(nil), immediate = T.unsafe(nil)); end", "title": "" }, { "docid": "f4b2c7b6c9d69d18ee27d382c2a5ae14", "score": "0.6675913", "text": "def gather_redirect_url\n if params[:redirect_url].present?\n session[:redirect_url] = params[:redirect_url]\n end\n return session[:redirect_url]\n end", "title": "" }, { "docid": "793d5e48ccb9d0008e9ae54d0ef1f9c0", "score": "0.66606224", "text": "def redirect_url\n headers['Location']\n end", "title": "" }, { "docid": "85b82b0ccb48ea82104163d8535d9379", "score": "0.66518533", "text": "def redirect_url\n params[:redirect_url].blank? ? nil : params[:redirect_url]\n end", "title": "" }, { "docid": "f9b2b2bc138c800a6170bdaf03a6f801", "score": "0.6634011", "text": "def redirect_callbacks\n # derive target redirect route from 'resource_class' param, which was set\n # before authentication.\n devise_mapping = request.env['omniauth.params']['resource_class'].underscore.to_sym\n redirect_route = \"#{request.protocol}#{request.host_with_port}/v1/auth/#{params[:provider]}/callback\"\n\n # preserve omniauth info for success route. ignore 'extra' in twitter\n # auth response to avoid CookieOverflow.\n session['dta.omniauth.auth'] = request.env['omniauth.auth']\n session['dta.omniauth.params'] = request.env['omniauth.params']\n\n set_query_params\n assign_representative_code_session\n assign_locale_session\n\n redirect_to redirect_route\n end", "title": "" }, { "docid": "2c4fbfbfa4f32d000e600f52b72e7e70", "score": "0.6605862", "text": "def redirect_url\n test? ? test_redirect_url : live_redirect_url\n end", "title": "" }, { "docid": "1e27379b4585e2a784203e8d6ab33e71", "score": "0.6604226", "text": "def auth_url\n url = authenticator.authorize_url(:scope => 'user_birthday,user_likes', :display => 'page')\n logger.info \"redirecting to \" + url\n return url\n end", "title": "" }, { "docid": "851896b074ec2153c96b2bd36177eee6", "score": "0.65836257", "text": "def redirect_url()\n # If the redirect URL has been set then return it.\n unless self.instance_variable_defined? :@redirect_url\n raise OpenIDConnectClientException, \"The redirect URL has not been set.\"\n end\n\n @redirect_url\n end", "title": "" }, { "docid": "40acb253304421be5bef381f49f083d1", "score": "0.6571305", "text": "def redirect(location, status = '302'); request.redirect(location, status); end", "title": "" }, { "docid": "40acb253304421be5bef381f49f083d1", "score": "0.6571305", "text": "def redirect(location, status = '302'); request.redirect(location, status); end", "title": "" }, { "docid": "1557512ceeb5f6ea89a6d56c809ad0cb", "score": "0.65449095", "text": "def redirect_url(params,session)\n\t\tredirect_to_url = params.redirect_uri + \"?session_token=#{session.session_token}\"\n\tend", "title": "" }, { "docid": "2c6a86df042fcf11157ed8456dd1d4b5", "score": "0.65229785", "text": "def redirected?\n !!@redirect_url\n end", "title": "" }, { "docid": "4beca661a42cb678893c40cc235d5084", "score": "0.6514182", "text": "def is_redirect?\n case code\n when 300..303, 307\n true\n when 200\n meta_redirect?\n else\n false\n end\n end", "title": "" }, { "docid": "4beca661a42cb678893c40cc235d5084", "score": "0.6514182", "text": "def is_redirect?\n case code\n when 300..303, 307\n true\n when 200\n meta_redirect?\n else\n false\n end\n end", "title": "" }, { "docid": "4beca661a42cb678893c40cc235d5084", "score": "0.6514182", "text": "def is_redirect?\n case code\n when 300..303, 307\n true\n when 200\n meta_redirect?\n else\n false\n end\n end", "title": "" }, { "docid": "4beca661a42cb678893c40cc235d5084", "score": "0.6514182", "text": "def is_redirect?\n case code\n when 300..303, 307\n true\n when 200\n meta_redirect?\n else\n false\n end\n end", "title": "" }, { "docid": "f76911a8bdf771294a891cb89db42dc6", "score": "0.6512945", "text": "def redirect_url(immediate=false)\n @auth_request.redirect_url(realm, return_to, immediate)\n end", "title": "" }, { "docid": "e95ec2e7df190154b67907cf30c375d8", "score": "0.65084904", "text": "def redirect_to_hashed_url_equivalent\n r302(::Ajax.hashed_url_from_traditional(@env['REQUEST_URI']))\n end", "title": "" }, { "docid": "a1b642cf67204907c2352add9767a07d", "score": "0.6490269", "text": "def redirecting\n\tif params[:redirect] =~ %r{^https\\:\\/\\/trusted-site.com\\/.+$}\n\t\tredirect_to params[:redirect]\n\tend\nend", "title": "" }, { "docid": "f3efc2970dc2c4104e15c4480ef2a99b", "score": "0.647604", "text": "def redirect=(_arg0); end", "title": "" }, { "docid": "6bd9f43126a37aa6ee758bdfc1a75db9", "score": "0.6468103", "text": "def is_redirect?\n @code == HTTP_REDIRECT\n end", "title": "" }, { "docid": "6e35631b4e5e32c707f2a823d0796052", "score": "0.6466186", "text": "def validate_oauth2_redirect_url!\n redirect_url = params[:redirect_url]\n raise Vidibus::Oauth2Server::MissingRedirectUrlError if redirect_url.blank?\n raise Vidibus::Oauth2Server::MalformedRedirectUrlError unless valid_uri?(redirect_url)\n unless redirect_url.match(/^https?:\\/\\/([a-z0-9]+\\.)?#{@oauth2_client.domain}/) # allow subdomains but ensure host of client application\n raise Vidibus::Oauth2Server::InvalidRedirectUrlError\n end\n end", "title": "" }, { "docid": "03a131dda2840db80f81304191f8604f", "score": "0.6465726", "text": "def redirect( res )\n uri = res.header['location'][0]\n if /^http/.match( uri ).nil?\n # rebuild full URL path\n uri = \"#{@original_uri.scheme}://#{@original_uri.host}:#{@original_uri.port}#{uri}\"\n end\n if @callback_on_redirect\n if @callback_on_redirect_content_only\n @callback_on_redirect.call( res.content )\n else\n @callback_on_redirect.call( res )\n end\n end\n @logger.debug \"Redirection to: #{uri}\"\n uri\n end", "title": "" }, { "docid": "b1fe44363db1331a344e92a4b01732a6", "score": "0.64654064", "text": "def redirect; end", "title": "" }, { "docid": "89a167a296bb08e7c0321a1622f6e0fe", "score": "0.64464927", "text": "def redirect_uri_errors\n 'sequel.errors.models.doorkeeper/application.attributes.redirect_uri'\n end", "title": "" }, { "docid": "a978c8dd341cc204b96a9db518ad9884", "score": "0.64299875", "text": "def redirect?\n (300..307).include?(@code)\n end", "title": "" }, { "docid": "a978c8dd341cc204b96a9db518ad9884", "score": "0.64299875", "text": "def redirect?\n (300..307).include?(@code)\n end", "title": "" }, { "docid": "5d690e0fd8838d7b602fb08ffa2f54ee", "score": "0.64264125", "text": "def redirect_url\n if response['location'].nil?\n response.body.match(/<a href=\\\"([^>]+)\\\">/i)[1]\n else\n response['location']\n end\n end", "title": "" }, { "docid": "84f7304d434ac7754b49f3966f44e4cf", "score": "0.6421589", "text": "def auth_url\n url = authenticator.authorize_url(:scope => 'publish_stream,email', :display => 'page')\n logger.info \"redirecting to \" + url\n return url\n end", "title": "" }, { "docid": "937e8f926f664d0132e83133719b97d3", "score": "0.6421336", "text": "def redirect?\n (300..307).include?(code)\n end", "title": "" }, { "docid": "4e5180ed0d5a123189c71a3368d9a6c3", "score": "0.64137715", "text": "def authproxy\n @auth_info = env[\"omniauth.auth\"][\"info\"]\n\t @login_url = @auth_info['login_url']\n\t redirect_to @login_url\n\tend", "title": "" }, { "docid": "dea84df77552e3d8696c960ca72cbc77", "score": "0.64087284", "text": "def request_authorization_redirect\n # using an Oauth gem may simplify this\n parameters = {response_type: \"code\", client_id: client_options[:client_id], redirect_uri: client_options[:redirect_uri], state: nil, scope: nil}\n uri = URI(client_options[:authorization_uri])\n uri.query = parameters.to_query\n redirect_to uri.to_s\n end", "title": "" }, { "docid": "6b100c30b4ae4a3adfbf85eeaa43ec54", "score": "0.64074045", "text": "def facebook_request\n redirect_to facebook_authenticate_url\n end", "title": "" }, { "docid": "3a6296cab8ef662a7f71bf8eb42bf04f", "score": "0.64061594", "text": "def callback_url\n options[:redirect_uri] || (full_host + script_name + callback_path)\n end", "title": "" }, { "docid": "08f83357b96bdb7b125f8b94d00868e7", "score": "0.6403175", "text": "def redirect_callbacks\n # derive target redirect route from 'resource_class' param, which was set\n # before authentication.\n devise_mapping = request.env['omniauth.params']['resource_class'].underscore.to_sym\n redirect_route = \"/#{Devise.mappings[devise_mapping].as_json[\"path\"]}/#{params[:provider]}/callback\"\n\n # preserve omniauth info for success route. ignore 'extra' in twitter\n # auth response to avoid CookieOverflow.\n session['dta.omniauth.auth'] = request.env['omniauth.auth'].except('extra')\n session['dta.omniauth.params'] = request.env['omniauth.params']\n\n redirect_to redirect_route\n end", "title": "" }, { "docid": "409d96f4be1fbb89c79512f73ad9cf48", "score": "0.63845664", "text": "def redirect_callbacks\n # derive target redirect route from 'resource_class' param, which was set\n # before authentication.\n devise_mapping = get_devise_mapping\n redirect_route = get_redirect_route(devise_mapping)\n\n # preserve omniauth info for success route. ignore 'extra' in twitter\n # auth response to avoid CookieOverflow.\n session['dja.omniauth.auth'] = request.env['omniauth.auth'].except('extra')\n session['dja.omniauth.params'] = request.env['omniauth.params']\n\n redirect_to redirect_route\n end", "title": "" }, { "docid": "df4da660b2e2f43896536a11d19808af", "score": "0.63790214", "text": "def redirect_url\n if user_signed_in?\n redirect_to previous_url, :status => 401 if current_user.company_id != nil\n else\n redirect_to new_user_session_path\n end\n end", "title": "" }, { "docid": "2f295605f13bc24b8c016910419f6cc4", "score": "0.6372738", "text": "def oauth\n redirect_to Instagram.authorize_url(:redirect_uri => CALLBACK_URL)\n end", "title": "" }, { "docid": "c229c97274a36a646527ef6fb6085b4a", "score": "0.637039", "text": "def reply_with_redirect_url_and_auth_token_and_es?(redirect_url,client,curr_user)\n\t\tAuth.configuration.do_redirect && redirect_url && reply_with_auth_token_es?(client,curr_user)\n\tend", "title": "" }, { "docid": "ea8821ff7abf730c006c643651886481", "score": "0.63628006", "text": "def follow_redirect!(**args); end", "title": "" }, { "docid": "9a742c416e2f1cb9ddf60722ba5f10bc", "score": "0.63583374", "text": "def redirect?\n !self.redirect_url.blank?\n end", "title": "" }, { "docid": "dab4e2f9c024335dcd1393ac53535e11", "score": "0.6349697", "text": "def omniauth\n @redirect_url = params[:redirect_url] || session_url\n omni_auth = request.env['omniauth.auth']\n auth = Credentials::OmniAuthUid.authenticate omni_auth\n unless auth.kind_of? Symbol\n set_session_current_user auth\n Tokens::SessionUid.remove_expired if auto_purge_sessions\n end\n\n respond_to do |format|\n if current_user\n format.html { redirect_to @redirect_url }\n else\n error_text = bounce_notice_text auth\n format.html do\n if params[:redirect_url]\n redirect_to new_session_url, flash: { alert: error_text,\n auth_redirect_url: @redirect_url }\n else\n redirect_to new_session_url, alert: error_text\n end\n end\n end\n end\n end", "title": "" }, { "docid": "9a639ba0f9af1eebe9320a4241005045", "score": "0.63469934", "text": "def redirect?\r\n redirect_status?\r\n end", "title": "" }, { "docid": "f7b22cb0366ce3bf4882a22fafc2ef31", "score": "0.634518", "text": "def redirect?\n @code.in? REDIRECT_RESPONSE_CODES\n end", "title": "" }, { "docid": "dffd952e5be02c26d42ed9bc609637a7", "score": "0.6342612", "text": "def authorize_url(redirect_uri, params={})\n query = authorize_query.update params\n query.update({ client_id: self.client.client_id, redirect_uri: redirect_uri })\n query.update({ force_login: 1 }) if params[:force_login]\n query.update({ confirm_login: 1 }) if params[:confirm_login]\n Util.clean_params query\n uri = URI(self.client.site)\n uri.path = Baidu::OAuth::AUTHORIZATION_ENDPOINT\n uri.query = Util.encode_params(query) unless Util.blank? query\n uri.to_s\n end", "title": "" }, { "docid": "7953693c64ed010833837c5c6a9f55f4", "score": "0.63424325", "text": "def redirect\n @redirect = RedirectFollower.new(original_url) \n end", "title": "" }, { "docid": "54f68c355a8c8002e1b4dda7e1605d7d", "score": "0.63342065", "text": "def single_signon_path(origin)\n session[:user_return_to] = origin\n redirect_uri=CGI::escape(\"#{host}/auth/single_signon/callback\")\n \"#{ENV['AUTH_SITE_URL']}/oauth/authorize?response_type=code&client_id=#{ENV['FINGINIE_KEY']}&redirect_uri=#{redirect_uri}\"\n end", "title": "" }, { "docid": "d5561dafd6815ffd29fe4f8e99453e64", "score": "0.6334", "text": "def signon_redirect(return_path = nil)\n return_path = request&.path || root_url if return_path.blank?\n full_path, anchor = return_path.split('#')\n full_path << (full_path.include?('?') ? '&' : '?')\n full_path << 'refresh=true' # TODO: Implement to avoid using the cached version of the destination page.\n full_path << ('#' + anchor) if anchor.present?\n full_path = CGI.escape(full_path)\n \"#{SIGN_ON_PATH}?redirect=#{full_path}\"\n end", "title": "" }, { "docid": "070b68df62cf18094a47fa549565e42e", "score": "0.6327784", "text": "def social_redirect_uri(website)\n intro = params[:i].blank? ? '' : \"?i=#{params[:i]}\"\n return \"#{request.protocol}#{request.host_with_port}#{connect_path(website)}#{intro}\"\n end", "title": "" }, { "docid": "a8348bfac57c59203059e13e88104fca", "score": "0.63240117", "text": "def check_uri\n redirect_to request.protocol + \"www.\" + request.host_with_port + request.request_uri if !/^www/.match(request.host) if Rails.env == 'production'\n end", "title": "" }, { "docid": "d014917c5f036e9859aee2eb00470443", "score": "0.6318103", "text": "def ensure_scheme\n self.redirect.insert(0, 'http://') unless URI.parse(self.redirect).scheme\n end", "title": "" }, { "docid": "d7c7e640831fc74a9b8c22b6b445e21c", "score": "0.63159883", "text": "def redirect\n client = Signet::OAuth2::Client.new(client_options)\n\n redirect_to client.authorization_uri.to_s\n end", "title": "" }, { "docid": "a48348c539bfb12a3994d2d017e56174", "score": "0.63014036", "text": "def handle_redirected(uri, response)\n update_cluster\n http_client.default_redirect_uri_callback(uri, response)\n end", "title": "" }, { "docid": "a48348c539bfb12a3994d2d017e56174", "score": "0.63014036", "text": "def handle_redirected(uri, response)\n update_cluster\n http_client.default_redirect_uri_callback(uri, response)\n end", "title": "" }, { "docid": "833449810f491a72414c0e4edff4577e", "score": "0.6294061", "text": "def redirect_to(uri)\n return [302, { \"Location\"=>uri.to_s }, [\"You are being redirected\"]]\n end", "title": "" }, { "docid": "3bde5f36ae7f365c22ddb4ff91a9c2d8", "score": "0.62939996", "text": "def redirection_params\n if options[:redirect_uri]\n {:redirect_uri => options[:redirect_uri]}\n else\n {}\n end\n end", "title": "" }, { "docid": "9b23cc75bc9d9bf8dd3174a54bd95f3a", "score": "0.62934303", "text": "def redirection_params\n if options[:redirect_uri]\n {'redirect_uri' => options[:redirect_uri]}\n else\n {}\n end\n end", "title": "" }, { "docid": "109db4c74e496337e709700ec4417241", "score": "0.6289061", "text": "def fb_oauth\n redirect_uri = @dash.fb_oauth\n<<<<<<< HEAD\n puts redirect_uri\n render json: redirect_uri.to_json, status: 200\n=======\n return redirect_uri \n>>>>>>> stripe\n end", "title": "" }, { "docid": "4260d537742e22a8e6f88e28d7ea1625", "score": "0.6287294", "text": "def auth_url(redirect_url)\n \"#{RDStation.host}/auth/dialog?client_id=#{@client_id}&redirect_url=#{redirect_url}\"\n end", "title": "" }, { "docid": "dba261e663085ed86fe201607bf76633", "score": "0.6280883", "text": "def url_redirect (url)\n\treturn Net::HTTP.get_response(URI.parse(url))['location']\nend", "title": "" }, { "docid": "3ac21ed070afea85870c6a06157f1176", "score": "0.62710744", "text": "def filter_redirect; end", "title": "" }, { "docid": "95c8bf2ae7b967585993ebdb7c8bcf0e", "score": "0.62709427", "text": "def get_redirection_url(resp)\n status_code = resp.code.to_i\n (status_code >= 300 && status_code < 400) ? resp['location'] : nil\n end", "title": "" }, { "docid": "5d136bfcfe9a941689745e362d149266", "score": "0.62697625", "text": "def bare\n #session[:bare] = true\n p \"groko\"\n fb_data = base64_url_decode params[:signed_request]\n p fb_data.to_yaml\n redirect_to \"/snippets\"\n # redirect_to request.url[/\\/bare/] = '' #=> broken resolves to / \n end", "title": "" }, { "docid": "41f684d0119299724a9a9432ed2f9313", "score": "0.6267167", "text": "def redirect?\n [301, 302, 303, 307, 308].include?(code)\n end", "title": "" }, { "docid": "cc4e869e9ceb7ed51ee0a9f2da8feefd", "score": "0.6254751", "text": "def callback_url\n options[:redirect_uri] || (full_host + script_name + callback_path)\n end", "title": "" }, { "docid": "cc4e869e9ceb7ed51ee0a9f2da8feefd", "score": "0.6254751", "text": "def callback_url\n options[:redirect_uri] || (full_host + script_name + callback_path)\n end", "title": "" }, { "docid": "cc4e869e9ceb7ed51ee0a9f2da8feefd", "score": "0.6254751", "text": "def callback_url\n options[:redirect_uri] || (full_host + script_name + callback_path)\n end", "title": "" }, { "docid": "cc4e869e9ceb7ed51ee0a9f2da8feefd", "score": "0.6254751", "text": "def callback_url\n options[:redirect_uri] || (full_host + script_name + callback_path)\n end", "title": "" }, { "docid": "cc4e869e9ceb7ed51ee0a9f2da8feefd", "score": "0.6254751", "text": "def callback_url\n options[:redirect_uri] || (full_host + script_name + callback_path)\n end", "title": "" }, { "docid": "1dcfb349594c29b0e49120273e8d9b1b", "score": "0.62425095", "text": "def safety_redirect\n request.env['HTTP_REFERER'] || root_path\n end", "title": "" }, { "docid": "c73e0455cd50b784182e859f50724d8a", "score": "0.62412345", "text": "def safe_location; end", "title": "" }, { "docid": "5382b46c834bda9553cbdd6b8848b07d", "score": "0.6228802", "text": "def adjust_for_redirect\n self.url = fetch_url(self.url)\n end", "title": "" }, { "docid": "4b386590a44f068ff7388d1a9707de95", "score": "0.62257093", "text": "def redirect uri, *args\n if @env[HTTP_VERSION] == 'HTTP/1.1' && @env[REQ_METHOD] != 'GET'\n status 303\n else\n status 302\n end\n\n @response[LOCATION] = url_to(uri.to_s)\n halt(*args)\n end", "title": "" }, { "docid": "527146c1a12ddba6556b84ff99a2c256", "score": "0.62251824", "text": "def handle_redirect(url)\n uri = URI.parse(url)\n tries = 3\n begin\n uri.open(redirect: false, ssl_verify_mode: OpenSSL::SSL::VERIFY_NONE)\n rescue OpenURI::HTTPRedirect => redirect\n uri = redirect.uri\n retry if (tries -= 1) > 0\n raise\n end\n end", "title": "" }, { "docid": "345a9138bed3061bace72c52d00562ab", "score": "0.6222512", "text": "def safety_redirect\n request.env['HTTP_REFERER']\n end", "title": "" }, { "docid": "ba83e504c8c5b208512de870e615b1e6", "score": "0.6220111", "text": "def callback_url\n options.redirect_uri || full_host + script_name + callback_path\n end", "title": "" }, { "docid": "8a1f286bd3fa72561631dac71fb60731", "score": "0.621848", "text": "def redirect(options = {})\r\n end", "title": "" }, { "docid": "c47ba20fe1474c35af25eb943bcd2c5f", "score": "0.6217253", "text": "def redirect_to_auth_service\n auth_service_url = Lintuvaara::ApiConfig::SERVER_AUTH_ADDRESS\n my_service_id = Lintuvaara::ApiConfig::SERVER_ACCOUNT\n request_uri = CGI.escape(request.request_uri)\n redirect_to \"#{auth_service_url}?service=#{my_service_id}&service_uri=#{request_uri}\"\n end", "title": "" }, { "docid": "0a76b6b3909b9346ec75726462744349", "score": "0.62106925", "text": "def redirect_to url\n {url: url, status: 302}\n end", "title": "" } ]
1979a0a3ee8b6d41a9dbdf0b8cd98bc6
PATCH/PUT /evaluation_credits/1 PATCH/PUT /evaluation_credits/1.json
[ { "docid": "5f08d9fd1d47b71cbaa0fb728f103a15", "score": "0.7273072", "text": "def update\n respond_to do |format|\n if @evaluation_credit.update(evaluation_credit_params)\n format.html { redirect_to @evaluation_credit, notice: 'Evaluation credit was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation_credit }\n else\n format.html { render :edit }\n format.json { render json: @evaluation_credit.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "d14c238f993a5568c60a6556160c7c70", "score": "0.68048155", "text": "def update\n @credibility = Credibility.find(params[:id])\n\n respond_to do |format|\n if @credibility.update_attributes(params[:credibility])\n format.html { redirect_to @credibility, notice: 'Credibility was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @credibility.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c0a5653e4ea8456630d0ca02dd88c52", "score": "0.67579424", "text": "def update\n @evaluation = Evaluation.find(params[:id])\n\n respond_to do |format|\n if @evaluation.update_attributes(params[:evaluation])\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c0a5653e4ea8456630d0ca02dd88c52", "score": "0.67579424", "text": "def update\n @evaluation = Evaluation.find(params[:id])\n\n respond_to do |format|\n if @evaluation.update_attributes(params[:evaluation])\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c0a5653e4ea8456630d0ca02dd88c52", "score": "0.67579424", "text": "def update\n @evaluation = Evaluation.find(params[:id])\n\n respond_to do |format|\n if @evaluation.update_attributes(params[:evaluation])\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c0a5653e4ea8456630d0ca02dd88c52", "score": "0.67579424", "text": "def update\n @evaluation = Evaluation.find(params[:id])\n\n respond_to do |format|\n if @evaluation.update_attributes(params[:evaluation])\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74bc440cf3d06ed1168d3568cc5f26a6", "score": "0.6714084", "text": "def update\n authorize @evaluation\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'La evaluación se ha modificado correctamente.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44cea2876406e336b20491aac146f945", "score": "0.66676176", "text": "def update\n respond_to do |format|\n if @change_evaluation.update(change_evaluation_params)\n format.html { redirect_to @change_evaluation, notice: 'Change evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @change_evaluation }\n else\n format.html { render :edit }\n format.json { render json: @change_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "12c9d2c0eed9ef1f056c5ee3db14e6ff", "score": "0.6665127", "text": "def update\n respond_to do |format|\n if @evaluation.update\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb905662fd4ef23f3b2047cd89f746c8", "score": "0.6640229", "text": "def update\n head :not_found and return if submission.blank? || assignment.blank? || originality_report.blank?\n\n response = HTTParty.put(originality_report_edit_url,\n body: { originality_report: originality_report_json(score: params['originality_score']) },\n headers: authorization_header)\n\n originality_report.update_attributes(originality_score: JSON.parse(response.body)['originality_score']) if response.code == 200\n\n render json: response.body, status: response.code\n end", "title": "" }, { "docid": "e549e93d346051e014f5c9058c35bad6", "score": "0.659215", "text": "def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to evaluations_path, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "32c10329a79d2e2adfb9b591ddf2f90b", "score": "0.6590615", "text": "def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to @evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a2340a3a45939c68020018cca9f166e9", "score": "0.6556742", "text": "def edit_credit credit_id, attributes\n perform_patch(\"/videos/#{get_id}/credits/#{credit_id}\", attributes)\n end", "title": "" }, { "docid": "ea467efd869780c286759bb41e4ce0b4", "score": "0.6547714", "text": "def update\n respond_to do |format|\n if @evaluation_factor.update(evaluation_factor_params)\n format.html { redirect_to @evaluation_factor, notice: 'Fator de avaliação atualizado.' }\n format.json { render :show, status: :ok, location: @evaluation_factor }\n else\n format.html { render :edit }\n format.json { render json: @evaluation_factor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "52da2d8e44dc495f2ac02481a8948c93", "score": "0.64580417", "text": "def update\n @loco_evaluation = LocoEvaluation.find(params[:id])\n respond_to do |format|\n if @loco_evaluation.update(loco_evaluation_params)\n format.html { redirect_to :back, notice: 'Loco evaluation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @loco_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2784ed813cd0c230a4620ca611cb9a88", "score": "0.64484584", "text": "def update\n @evaluation_buyer = EvaluationBuyer.find(params[:id])\n\n respond_to do |format|\n if @evaluation_buyer.update_attributes(params[:evaluation_buyer])\n format.html { redirect_to @evaluation_buyer, notice: 'Evaluation buyer was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluation_buyer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2535305b3607c87325e6d7e33fe96cae", "score": "0.6445213", "text": "def update\n# respond_to do |format|\n# if @evaluation.update(evaluation_params)\n# format.html { redirect_to result_url(@evaluation), notice: \"\" }\n# format.json { redirect_to result_url(@evaluation) }\n #else\n # format.html { render :edit }\n # format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n # end\n # end\n end", "title": "" }, { "docid": "0813ebf6735742bd66d6896a8fcc791f", "score": "0.6439499", "text": "def update\n respond_to do |format|\n if @evaluation.update(evaluation_params)\n format.html { redirect_to user_evaluation_path(@user, @evaluation), notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: user_evaluation_path(@user, @evaluation) }\n else\n format.html { render :edit }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "54bf0bf41f48f611ecd71e8525249a46", "score": "0.6436874", "text": "def update\n respond_to do |format|\n if @evaluation.update_attributes(params[:evaluation])\n format.html { redirect_to student_evaluations_path(@student), notice: \"La note a été mise à jour avec succès.\" }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2466a1d08d0033feee4ab0642eb41e51", "score": "0.6403916", "text": "def update\n respond_to do |format|\n if @evaluation_model.update(evaluation_model_params)\n format.html { redirect_to @evaluation_model, notice: 'Modelo de avaliação atualizado.' }\n format.json { render :show, status: :ok, location: @evaluation_model }\n else\n format.html { render :edit }\n format.json { render json: @evaluation_model.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d2a6a7dfe35b2b561fb886ff7cbabce", "score": "0.63908684", "text": "def update\n\n if @expensive.update(expensive_params)\n #format.html { redirect_to @expensive, notice: 'Expensive was successfully updated.' }\n #format.json { render :show, status: :ok, location: @expensive }\n redirect_to expensives_url\n else\n respond_to do |format|\n #format.html { render :edit }\n format.json { render json: @expensive.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4542691962a68baa1a9c47411738412", "score": "0.6372514", "text": "def update\n respond_to do |format|\n if @credit.update(credit_params)\n format.html { redirect_to '/credits', notice: 'Credit was successfully updated.' }\n format.json { render :show, status: :ok, location: @credit }\n else\n format.html { render :edit }\n format.json { render json: @credit.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f89fefe24a1bbc56d15e14661e32eb3", "score": "0.6368858", "text": "def update\n @credit = Credit.find(params[:id])\n \n respond_to do |format|\n if @credit.update_attributes(params[:credit])\n format.html { redirect_to @credit, notice: 'Credit was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @credit.errors, status: :unprocessable_entity }\n end\n end\nend", "title": "" }, { "docid": "5033db3856f15301461808ab3c238489", "score": "0.63521045", "text": "def update\n respond_to do |format|\n if @survey_evaluation.update(survey_evaluation_params)\n format.html { redirect_to @survey_evaluation, notice: 'Evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @survey_evaluation }\n else\n format.html { render :edit }\n format.json { render json: @survey_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e51a28d50f993c1afd4f4802b7aec77", "score": "0.63449025", "text": "def update\n respond_to do |format|\n if @evaluation_score.update(evaluation_score_params)\n format.html { redirect_to @evaluation_score, notice: 'Evaluation score was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation_score }\n else\n format.html { render :edit }\n format.json { render json: @evaluation_score.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5ec2683674d08a2494c907b8a0d3a69", "score": "0.63061774", "text": "def update\n @acquisition = Acquisition.find(params[:id]).update(aquire_params)\n render json: 'Entry has been successfully updated!'\n end", "title": "" }, { "docid": "0b3478c038598f6bf0d9e97e83c72b4c", "score": "0.62985", "text": "def update\n respond_to do |format|\n if @evaluation_code.update(evaluation_code_params)\n format.html { redirect_to @evaluation_code, notice: 'Evaluation code was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @evaluation_code.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "544c8e0be8ca68f0b68bf0a9b597f9ed", "score": "0.6272864", "text": "def update\n @evaluation_detail = EvaluationDetail.find(params[:id])\n\n respond_to do |format|\n if @evaluation_detail.update_attributes(params[:evaluation_detail])\n format.html { redirect_to @evaluation_detail, notice: 'Evaluation detail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluation_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7d2f1d3c68deb31e11e7ec97341cfa46", "score": "0.62726897", "text": "def update\n @valuation = @mint_coin.valuations.find(params[:id])\n\n respond_to do |format|\n if @valuation.update_attributes(params[:valuation])\n format.html { redirect_to mint_coin_valuations_url([@mint_coin]), :notice => 'Valuation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @valuation.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3a61ea1264e3921cf7282b538d50101", "score": "0.62524354", "text": "def update\n @qc_nexteval = QcNexteval.find(params[:id])\n\n respond_to do |format|\n if @qc_nexteval.update_attributes(params[:qc_nexteval])\n format.html { redirect_to @qc_nexteval, notice: 'Qc nexteval was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @qc_nexteval.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f2bdf322e6f276e847f7c8262af6cd20", "score": "0.6244124", "text": "def update\n respond_to do |format|\n if @credit.update(credit_params)\n format.html { redirect_to credits_url, notice: 'Credit was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @credit.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "588ef4415f0818cd50efb895c7951811", "score": "0.62411374", "text": "def update\n respond_to do |format|\n if @module_evaluation.update(module_evaluation_params)\n format.html { redirect_to root_path, notice: 'Modul evaluering er blevet opdateret.' }\n format.json { render :show, status: :ok, location: @module_evaluation }\n else\n format.html { render :edit }\n format.json { render json: @module_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8ec29d73ab69e61c24007b6b81ed84e", "score": "0.62127745", "text": "def update\n respond_to do |format|\n if @data_evaluation_real_time.update(data_evaluation_real_time_params)\n format.html { redirect_to @data_evaluation_real_time, notice: 'Data evaluation real time was successfully updated.' }\n format.json { render :show, status: :ok, location: @data_evaluation_real_time }\n else\n format.html { render :edit }\n format.json { render json: @data_evaluation_real_time.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5419132d0f8ae58254830432a481d819", "score": "0.6207205", "text": "def update\n respond_to do |format|\n if @company_royalty.update(company_royalty_params)\n format.html { redirect_to @company_royalty, notice: 'Company royalty was successfully updated.' }\n format.json { render :show, status: :ok, location: @company_royalty }\n else\n format.html { render :edit }\n format.json { render json: @company_royalty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16f2072e5f150af50ea828b56436da54", "score": "0.6203421", "text": "def update\n respond_to do |format|\n if @contribution.update(contribution_params)\n format.html { redirect_to pending_url, notice: 'Contribution was successfully updated.' }\n format.json { render :show, status: :ok, location: @contribution }\n else\n format.html { render :edit }\n format.json { render json: @contribution.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "60a8cecbf3b3cbcf21d053a291999efd", "score": "0.6202044", "text": "def update\n respond_to do |format|\n if @tecnic_evaluation.update(tecnic_evaluation_params)\n format.html { redirect_to @tecnic_evaluation, notice: 'Tecnic evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @tecnic_evaluation }\n else\n format.html { render :edit }\n format.json { render json: @tecnic_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "01743795c024cdb8a711f3129ea8b4e6", "score": "0.6201718", "text": "def set_evaluation_credit\n @evaluation_credit = EvaluationCredit.find(params[:id])\n end", "title": "" }, { "docid": "bc51763bd924c679086f1dda80a511bb", "score": "0.62013906", "text": "def update\n @evaluation_comment = EvaluationComment.find(params[:id])\n\n respond_to do |format|\n if @evaluation_comment.update_attributes(params[:evaluation_comment])\n format.html { redirect_to @evaluation_comment, notice: 'Evaluation comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluation_comment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c9d200f3bd7dc55b541ec5de8ffcb414", "score": "0.61809707", "text": "def update\n respond_to do |format|\n if @contribution.update(contribution_params)\n format.html { redirect_to @contribution }\n format.json { render :show, status: :ok, location: @contribution }\n else\n format.html { render :edit }\n format.json { render json: @contribution.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9b7b62f8225fe21d25a898a862bd43ec", "score": "0.6180616", "text": "def update\n @commission_rate = CommissionRate.find(params[:id])\n\n respond_to do |format|\n if @commission_rate.update_attributes(params[:commission_rate])\n flash[:success] = \"Change Successful\"\n format.html { redirect_to hotels_path }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @commission_rate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "079e7d297c58ae8e422dc09964af317b", "score": "0.61759543", "text": "def update\n @evaluation = Evaluation.find(params[:id])\n\n respond_to do |format|\n if @evaluation.update_attributes(params[:evaluation])\n flash[:notice] = 'Evaluation was successfully updated.'\n format.html { redirect_to(@evaluation) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @evaluation.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e4dcbb552c173067e074b61275e7888", "score": "0.61698836", "text": "def update\n respond_to do |format|\n if @scratch_card_reward.update(scratch_card_reward_params)\n format.html { redirect_to @scratch_card_reward, notice: 'Scratch card reward was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @scratch_card_reward.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "256ef6bc14522880b48381e67edcab94", "score": "0.6169179", "text": "def update\n @ca_reward = CaReward.find(params[:id])\n\n respond_to do |format|\n if @ca_reward.update_attributes(params[:ca_reward])\n format.html { redirect_to @ca_reward, :notice => 'Ca reward was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @ca_reward.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e5a7cc2ba8efaf9b3bf8039e527ed2a", "score": "0.61659133", "text": "def update\n \n @request_selection = RequestSelection.find(params[:request_selection_id])\n \n @reward = Reward.find(params[:id])\n @skills = Skill.all\n @current_date = DateTime.now\n\n respond_to do |format|\n if @reward.update_attributes(params[:reward])\n \n format.html { redirect_to @reward, notice: 'Reward was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @reward.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a4548bc9088b7a0f6d96b41196a9a0e4", "score": "0.6164901", "text": "def update\n @member = Member.find(params[:id])\n\n params[:skillset].each do | id, evaluation |\n skillEvaluation = SkillEvaluation.find(id)\n if skillEvaluation\n skillEvaluation.evaluation = evaluation\n skillEvaluation.save()\n end\n end\n \n respond_to do |format|\n if @member.update_attributes(params[:member])\n format.html { redirect_to @member, notice: 'Member was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @member.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ed5a63a410d71b262f0c95cd23a2fd00", "score": "0.6164016", "text": "def update\n respond_to do |format|\n if @pricing_capability.update(pricing_capability_params)\n format.html { redirect_to @pricing_capability, notice: \"Pricing capability was successfully updated.\" }\n format.json { render :show, status: :ok, location: @pricing_capability }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @pricing_capability.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4a85f8e81cea7ef46163fc49cd9e38a6", "score": "0.61638635", "text": "def update\n @requirement = @lab.requirements.find(params[:id])\n\n respond_to do |format|\n if @requirement.update_attributes(allowed_params)\n @status = admin_course_lab_url(@course,@lab)\n flash[:notice] = 'Requirement was successfully updated.'\n format.html { redirect_to([:admin,@course,@lab]) }\n format.xml { head :ok }\n else\n @status = \"failed\"\n format.html { render action: \"edit\" }\n format.xml { render xml: @requirement.errors, status: :unprocessable_entity }\n end\n format.js\n end\n end", "title": "" }, { "docid": "55701393d2e439c17820447d1e19aa96", "score": "0.6163835", "text": "def update\n authorize! :update, @competence\n @curriculum.save # Expire cache\n\n respond_to do |format|\n if @competence.update_attributes(params[:competence])\n format.html { redirect_to edit_curriculum_path(@curriculum) }\n else\n format.html { render :action => \"edit\" }\n end\n end\n end", "title": "" }, { "docid": "50e8988ebcd6dff15722aed0822697c1", "score": "0.6163408", "text": "def update\n respond_to do |format|\n if @item_evaluation.update(item_evaluation_params)\n format.html { redirect_to @item_evaluation, notice: 'Item evaluation was successfully updated.' }\n format.json { render :show, status: :ok, location: @item_evaluation }\n else\n format.html { render :edit }\n format.json { render json: @item_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9dee6fde9e7652f45b5baeaedfd7f197", "score": "0.61514884", "text": "def update\n respond_to do |format|\n if @credit_request.update(credit_request_params)\n format.html { redirect_to @credit_request, notice: 'Credit request was successfully updated.' }\n format.json { render :show, status: :ok, location: @credit_request }\n else\n format.html { render :edit }\n format.json { render json: @credit_request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc954b20b9543388315a757a81c30914", "score": "0.6150834", "text": "def update\n respond_to do |format|\n if @contribution.update(params[:contribution])\n format.html { redirect_to @contribution, notice: 'Contribution was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @contribution.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6f0b6d760e1a9d78c559c28eaecb284a", "score": "0.6145881", "text": "def update\n if @contest_evaluation.update(contest_evaluation_params)\n render :show, status: :ok, location: @contest_evaluation\n else\n render json: @contest_evaluation.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e0975ee1ee6df5c6fcc15d78c8a4100c", "score": "0.6144682", "text": "def update\n @evaluation = @exam.evaluations.find(params[:id])\n\n respond_to do |format|\n if @evaluation.update_attributes(params[:evaluation])\n format.html { redirect_to(signature_part_exam_url(@signature, @part, @exam), :notice => 'La nota se actualizo correctamente.') }\n format.xml { render :xml => @evaluation, :status => :created, :location => @evaluation }\n else\n format.html { render 'exams/show' }\n format.xml { render :xml => @evaluation.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b15aa978211291963a3aebfca72283e5", "score": "0.61444986", "text": "def update\n logger.info('PATCH Contribution JSON: ')\n logger.info(request_body)\n\n params = hashed_request\n if params[:cap_profile_id].blank? && params[:sul_author_id].blank?\n log_and_error! \"The request is missing 'sul_author_id' and 'cap_profile_id'.\", :bad_request\n return\n end\n author = params[:cap_profile_id] ? get_cap_author!(params[:cap_profile_id]) : get_sul_author!(params[:sul_author_id])\n return unless author # can't find the author\n return unless author_id_consistent?(author, params[:cap_profile_id]) # ids aren't consistent\n\n if params[:sul_pub_id].blank?\n render json: { error: 'You have not supplied the publication identifier sul_pub_id' }, status: :bad_request,\n format: :json\n return\n end\n\n # Find an existing contribution by author/publication\n contributions = Contribution.where(\n author_id: author.id,\n publication_id: params[:sul_pub_id]\n )\n if contributions.empty?\n log_and_error!(\"SULCAP has no contributions by the author:#{author.id} for the publication:#{params[:sul_pub_id]}\")\n return\n elsif contributions.length > 1\n # Hitting this block of code should be a cause for concern, bad internal data\n log_and_error!(\n \"SULCAP has multiple contributions by the author:#{author.id} for the publication:#{params[:sul_pub_id]}\", :internal_server_error\n )\n return\n end\n pub = contributions.first.publication\n\n unless pub\n # Also a cause for concern, bad internal data\n log_and_error!('No publication found', :internal_server_error)\n return\n end\n\n # We've now got the contribution, gather the new attributes. In a PATCH\n # request, it's OK if some of them are missing; validate only the\n # fields provided. When check for 'featured', use .nil? because it\n # is allowed to have a `false` value.\n unless !contrib_attr[:featured].nil? || contrib_attr[:status].present? || contrib_attr[:visibility].present?\n render json: { error: \"At least one authorship attribute is required: 'featured', 'status', 'visibility'.\" },\n status: :not_acceptable, format: :json\n return\n end\n\n pub_hash = create_or_update_and_return_pub_hash(pub, author, contrib_attr)\n return unless pub_hash\n\n render json: pub_hash.to_json, format: :json, status: :accepted\n end", "title": "" }, { "docid": "c931a063ef595e1f73b321d987b184db", "score": "0.61435646", "text": "def update \n @user_requirement = UserRequirement.find(params[:id])\n if @user_requirement.update_attributes(user_requirement_params) \n render json: @user_requirement, status: :updated\n else \n render json: @user_requirement.errors, status: :unprocessable_entity \n end \n end", "title": "" }, { "docid": "156d860563f75a97a966b3db88021657", "score": "0.613404", "text": "def update\n respond_to do |format|\n if @credit.update(credit_params)\n format.html { redirect_to @credit, notice: 'Credit was successfully updated.' }\n format.json { render :show, status: :ok, location: @credit }\n else\n format.html { render :edit }\n format.json { render json: @credit.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6df44c9785be52b97c2e073310b7ff9d", "score": "0.6122546", "text": "def update\n respond_to do |format|\n if @contribution.update(contribution_params)\n format.html { redirect_to @contribution, notice: 'Contribution was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @contribution.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6df44c9785be52b97c2e073310b7ff9d", "score": "0.6122546", "text": "def update\n respond_to do |format|\n if @contribution.update(contribution_params)\n format.html { redirect_to @contribution, notice: 'Contribution was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @contribution.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44cf21d9c58f83ac3803f9839d6bb50e", "score": "0.6121281", "text": "def update\n authorize :resquest_criminal, :update?\n respond_to do |format|\n if @resquest_criminal.update(resquest_criminal_params)\n format.html { redirect_to @resquest_criminal, notice: 'Resquest criminal was successfully updated.' }\n format.json { render :show, status: :ok, location: @resquest_criminal }\n else\n format.html { render :edit }\n format.json { render json: @resquest_criminal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9cddf5d87d73a64a6a1c9abb1519245c", "score": "0.61195564", "text": "def update\n @competence.update!(competence_params)\n render json: {status: :ok}\n end", "title": "" }, { "docid": "123d8e66e5159bfb5dfc5c1c94af5fce", "score": "0.6117869", "text": "def update\n update_q(@credit, credit_params)\n end", "title": "" }, { "docid": "ffe164a2c8313864a75a5c6202f306a7", "score": "0.6112234", "text": "def update\n respond_to do |format|\n if @coefficient.update(coefficient_params)\n format.html { redirect_to @coefficient, notice: 'Coefficient was successfully updated.' }\n format.json { render :show, status: :ok, location: @coefficient }\n else\n format.html { render :edit }\n format.json { render json: @coefficient.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1bfdba316d8f683159a2de2740fa74b6", "score": "0.6111951", "text": "def update\n @credit = @transaction.credits.find(params[:id])\n\n respond_to do |format|\n if @credit.update_attributes(params[:credit])\n format.html { redirect_to(client_transaction_credit_path(@client, @transaction, @credit), :notice => 'Credit was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @credit.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74d08e2762a076f741f9f2364a3970f9", "score": "0.61089206", "text": "def update\n @acceptance = Acceptance.find(params[:id])\n\n respond_to do |format|\n if @acceptance.update_attributes(params[:acceptance])\n format.html { redirect_to @acceptance, notice: 'Acceptance was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @acceptance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1a29d2e8c828a55f552f787f9a68698a", "score": "0.6107067", "text": "def update\n authorize @requirement\n\n respond_to do |format|\n if @requirement.update(\n name: requirement_params[:name],\n description: requirement_params[:description],\n num_required: requirement_params[:num_required]\n )\n format.html { redirect_to @requirement, notice: 'Requirement was successfully updated.' }\n format.json { render :show, status: :ok, location: @requirement }\n else\n format.html { render :edit }\n format.json { render json: @requirement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "96c233edea8ef8f31567c72a167337c3", "score": "0.61048687", "text": "def update\n respond_to do |format|\n if @contribution.update(contribution_params)\n format.html { redirect_to contributions_url}\n format.json { render :show, status: :ok, location: @contribution }\n else\n format.html { render :edit }\n format.json { render json: @contribution.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "028b0e47e0af87fbf75e3a731a9ae2d6", "score": "0.61036134", "text": "def update\n respond_to do |format|\n if @contribution.update(contribution_params)\n format.html { redirect_to @contribution, notice: 'Contribution was successfully updated.' }\n format.json { render :show, status: :ok, location: @contribution }\n else\n format.html { render :edit }\n format.json { render json: @contribution.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "028b0e47e0af87fbf75e3a731a9ae2d6", "score": "0.61036134", "text": "def update\n respond_to do |format|\n if @contribution.update(contribution_params)\n format.html { redirect_to @contribution, notice: 'Contribution was successfully updated.' }\n format.json { render :show, status: :ok, location: @contribution }\n else\n format.html { render :edit }\n format.json { render json: @contribution.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "028b0e47e0af87fbf75e3a731a9ae2d6", "score": "0.61036134", "text": "def update\n respond_to do |format|\n if @contribution.update(contribution_params)\n format.html { redirect_to @contribution, notice: 'Contribution was successfully updated.' }\n format.json { render :show, status: :ok, location: @contribution }\n else\n format.html { render :edit }\n format.json { render json: @contribution.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "01051e74ed60c40ff3fd189f922f5b72", "score": "0.609189", "text": "def update\n @minimum_requirement = MinimumRequirement.find(params[:id])\n\n respond_to do |format|\n if @minimum_requirement.update_attributes(params[:minimum_requirement])\n format.html { redirect_to @minimum_requirement, notice: 'Minimum requirement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @minimum_requirement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "24255667270cc69b803341f835b34b15", "score": "0.60902977", "text": "def update\n @refresher_course = RefresherCourse.find(params[:id])\n\n respond_to do |format|\n if @refresher_course.update_attributes(params[:refresher_course])\n format.html { redirect_to @refresher_course, notice: 'Refresher course was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @refresher_course.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba2ed9489ca76951805d198d89e6c566", "score": "0.6085941", "text": "def update\n recipe= Recipe.find(params[:id])\n respond_with recipe.update(rate:params[:rate])\n end", "title": "" }, { "docid": "4cf4099e532bf79be32896520e049f68", "score": "0.60854495", "text": "def update\n authorize! :update, CompetenceTier\n \n @competence_tier.update!(competence_tier_params)\n render json: {status: :ok}\n end", "title": "" }, { "docid": "0f6e0ad8319942a076c88745210eaef6", "score": "0.6080975", "text": "def update\n @evaluacion = Evaluacion.find(params[:id])\n\n respond_to do |format|\n if @evaluacion.update_attributes(params[:evaluacion])\n format.html { redirect_to @evaluacion, notice: 'Evaluacion was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluacion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd0f4a95e9bd0a2e3d75acc11b22407d", "score": "0.60802484", "text": "def update\n @loyalty = Loyalty.find(params[:id])\n\n respond_to do |format|\n if @loyalty.update_attributes(params[:loyalty])\n format.html { redirect_to @loyalty, notice: 'Loyalty was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @loyalty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "21d5e4735cb489cca44a486d13165483", "score": "0.6078669", "text": "def update\n respond_to do |format|\n if @course_requirement.update(course_requirement_params)\n format.html { redirect_to @course_requirement, notice: 'Course requirement was successfully updated.' }\n format.json { render :show, status: :ok, location: @course_requirement }\n else\n format.html { render :edit }\n format.json { render json: @course_requirement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3754280e4fbf25f443357caa3f2dfb39", "score": "0.6078445", "text": "def update\n @credit = Credit.find(params[:id])\n\n respond_to do |format|\n if @credit.update_attributes(params[:credit])\n format.html { redirect_to @credit, notice: 'Credito actualizado exitosamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @credit.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8f05e7770c35e8e08a56d3a022d176d", "score": "0.60780734", "text": "def update\n @requirement = Requirement.find(params[:id])\n\n respond_to do |format|\n if @requirement.update_attributes(params[:requirement])\n format.html { redirect_to @requirement, notice: 'Requirement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @requirement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "125fa443795164b6ef1a393e5005d410", "score": "0.60681295", "text": "def update\n if @recipy.update(recipy_params)\n render :show, status: :ok, location: @recipy\n else\n render json: @recipy.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a2d83aec6eaec4a8d0e5c78ba27486fa", "score": "0.6067468", "text": "def update\n check_evaluation_period\n respond_to do |format|\n if @assistant_evaluation.update(assistant_evaluation_params)\n format.html { redirect_to assistant_roles_for_professor_path(current_user.professor), notice: 'Avaliação atualizada com sucesso.' }\n format.json { render action: 'index_for_professor', status: :ok, location: current_user.professor }\n else\n format.html { render action: 'edit' }\n format.json { render json: @assistant_evaluation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ccaf4fc2f25c235012ddbb71004ad8dc", "score": "0.6063921", "text": "def update\n @lab_questions_score = LabQuestionsScore.find(params[:id])\n\n respond_to do |format|\n if @lab_questions_score.update_attributes(params[:lab_questions_score])\n format.html { redirect_to @lab_questions_score, notice: 'Lab question item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lab_questions_score.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2012cae3dc14ae76dbcf2b1e52f430b0", "score": "0.6060646", "text": "def update\n @admin_reclaim_rate = Admin::ReclaimRate.find(params[:id])\n\n respond_to do |format|\n if @admin_reclaim_rate.update_attributes(params[:admin_reclaim_rate])\n format.html { redirect_to admin_reclaim_rates_url }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @admin_reclaim_rate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5c57df702bbab351b5c7e873bca1cdb7", "score": "0.6060512", "text": "def update\n @asset = Asset.find(params[:asset_id])\n @credit = @asset.credits.find(params[:id])\n\n respond_to do |format|\n if @credit.update_attributes(params[:credit])\n format.html { redirect_to(asset_manager_asset_credit_path(@asset, @credit), :notice => 'Credit was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => :edit }\n format.xml { render :xml => @credit.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2e79e489539c90ee76ff18c3f18cd429", "score": "0.6059088", "text": "def update\n respond_to do |format|\n if @monetary_contribution.update(monetary_contribution_params)\n format.html { redirect_to @monetary_contribution, notice: 'Monetary contribution was successfully updated.' }\n format.json { render :show, status: :ok, location: @monetary_contribution }\n else\n format.html { render :edit }\n format.json { render json: @monetary_contribution.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7fd588afcb2bbf1c90b8ca1a6fda597e", "score": "0.6053849", "text": "def update\n @credit = Credit.find(params[:id])\n\n respond_to do |format|\n if @credit.update_attributes(params[:credit])\n flash[:notice] = 'Credit was successfully updated.'\n format.html { redirect_to admin_credits_path }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @credit.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3b3017a556ccd772b66343207460914d", "score": "0.6048564", "text": "def update\n @calculated_data_learner_assessment = CalculatedDataLearnerAssessment.find(params[:id])\n\n respond_to do |format|\n if @calculated_data_learner_assessment.update_attributes(params[:calculated_data_learner_assessment])\n format.html { redirect_to @calculated_data_learner_assessment, notice: 'Calculated data learner assessment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @calculated_data_learner_assessment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "925d2c4275264c061f601f9b579c6973", "score": "0.6045028", "text": "def update\n @course.update!(course_params)\n json_response(@course)\n end", "title": "" }, { "docid": "a33635fdb82b988a785bbe02ddfa883e", "score": "0.60394084", "text": "def update\n @bonus_scheme = BonusScheme.find(params[:id])\n\n respond_to do |format|\n if @bonus_scheme.update_attributes(params[:bonus_scheme])\n format.html { redirect_to @bonus_scheme, notice: 'Bonus scheme was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bonus_scheme.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8cc73d962c321822aa0d810bfb4d16a2", "score": "0.60308343", "text": "def update\n @evaluator = Evaluator.find(params[:id])\n\n respond_to do |format|\n if @evaluator.update_attributes(params[:evaluator])\n format.html { redirect_to @evaluator, notice: 'Evaluator was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @evaluator.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e3bdc94477742c1cca6cea63d790fe0", "score": "0.6028786", "text": "def update\n @pricing = Pricing.find(params[:id])\n\n respond_to do |format|\n if @pricing.update_attributes(params[:pricing])\n format.html { redirect_to @pricing, notice: 'Pricing was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pricing.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d26ce950f96200cdad4e362968cd5daa", "score": "0.60276985", "text": "def update\n @specific_requirement = SpecificRequirement.find(params[:id])\n\n respond_to do |format|\n if @specific_requirement.update_attributes(params[:specific_requirement])\n format.html { redirect_to @specific_requirement, notice: 'Specific requirement was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @specific_requirement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3c991b5ad7c0326450fae76b91f57e0f", "score": "0.60261613", "text": "def update\n respond_to do |format|\n if @c14_lab.update(c14_lab_params)\n format.html { redirect_back(fallback_location: @c14_lab, notice: \"Saved changes to #{@c14_lab.name}.\") }\n format.json { render :show, status: :ok, location: @c14_lab }\n else\n format.html { render :edit }\n format.json { render json: @c14_lab.errors, status: :unprocessable_entity }\n format.turbo_stream { render :form_update, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "506d33c184ee2a38293ca817d0c85a31", "score": "0.60232455", "text": "def update\r\n respond_to do |format|\r\n if @technical_review_expiration.update(technical_review_expiration_params)\r\n format.html { redirect_to @technical_review_expiration, notice: 'Technical review expiration 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: @technical_review_expiration.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "3ec00340b18c3262b0b5c21d9935f5ba", "score": "0.60211587", "text": "def update\n @requirement = Requirement.find(params[:id])\n\n respond_to do |format|\n if @requirement.update_attributes(params[:requirement])\n format.html { redirect_to @requirement.specification, \n notice: 'Requirement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @requirement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "376f2e94caea27f8d0a7636aa07255af", "score": "0.6016645", "text": "def update\n @computation = Computation.find(params[:id])\n\n respond_to do |format|\n if @computation.update_attributes(params[:computation])\n format.html { redirect_to @computation, notice: 'Computation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @computation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "68dbe4a36af4fdd99a760968b026677c", "score": "0.6011878", "text": "def update\n basic_unit = BasicUnit.find(params[:id]);\n @evaluation = Evaluation.create(:rank => params[:rank], :basic_unit_id => basic_unit.id);\n\n respond_to do |format|\n if @basic_unit.update({})\n format.html { redirect_to @basic_unit, notice: 'Basic unit was successfully updated.' }\n format.json { render :show, status: :ok, location: @basic_unit }\n else\n format.html { render :edit }\n format.json { render json: @basic_unit.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3765503a85c0c775b22bab893e3b4eca", "score": "0.6002916", "text": "def update\n @coll_requirement = CollRequirement.find(params[:id])\n\n respond_to do |format|\n if @coll_requirement.update_attributes(params[:coll_requirement])\n format.html { redirect_to @coll_requirement, notice: 'Coll requirement was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @coll_requirement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a23460a6753975a375271053deac4447", "score": "0.5997508", "text": "def update\n @model_reference.update!(secure_params)\n\n render json: {model_reference: @model_reference}\n end", "title": "" }, { "docid": "bf1d8eb9ebe244c9d309d7efc2958548", "score": "0.59940946", "text": "def update!(**args)\n @bidder_location = args[:bidder_location] if args.key?(:bidder_location)\n @cookie_matching_nid = args[:cookie_matching_nid] if args.key?(:cookie_matching_nid)\n @cookie_matching_url = args[:cookie_matching_url] if args.key?(:cookie_matching_url)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @maximum_active_creatives = args[:maximum_active_creatives] if args.key?(:maximum_active_creatives)\n @maximum_total_qps = args[:maximum_total_qps] if args.key?(:maximum_total_qps)\n @number_active_creatives = args[:number_active_creatives] if args.key?(:number_active_creatives)\n end", "title": "" }, { "docid": "bf1d8eb9ebe244c9d309d7efc2958548", "score": "0.59940946", "text": "def update!(**args)\n @bidder_location = args[:bidder_location] if args.key?(:bidder_location)\n @cookie_matching_nid = args[:cookie_matching_nid] if args.key?(:cookie_matching_nid)\n @cookie_matching_url = args[:cookie_matching_url] if args.key?(:cookie_matching_url)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @maximum_active_creatives = args[:maximum_active_creatives] if args.key?(:maximum_active_creatives)\n @maximum_total_qps = args[:maximum_total_qps] if args.key?(:maximum_total_qps)\n @number_active_creatives = args[:number_active_creatives] if args.key?(:number_active_creatives)\n end", "title": "" }, { "docid": "210ef776229fb9736f6e7d23177b1edb", "score": "0.59904253", "text": "def update\n respond_to do |format|\n if @evaluation_item.update(evaluation_item_params)\n format.html { redirect_to @evaluation_item, notice: 'Evaluation item was successfully updated.' }\n format.json { render :show, status: :ok, location: @evaluation_item }\n else\n format.html { render :edit }\n format.json { render json: @evaluation_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
f57b117348ac9dbd710cb433fa93184c
Check if user is displaying Dashboard
[ { "docid": "fcceddd54bf2c8ce4ac497f73836499c", "score": "0.67346513", "text": "def in_dash_board?\n controller.controller_name == 'dash_board'\n end", "title": "" } ]
[ { "docid": "83bd84aae0668f47d5070b64f14601fd", "score": "0.7166879", "text": "def can_view_public_health_dashboard?\n has_role?(:public_health) || has_role?(:public_health_enroller)\n end", "title": "" }, { "docid": "c29bbdc25beddbeea7e66659b1ed3131", "score": "0.701849", "text": "def admin?\n !current_user.AdminScreen?\n end", "title": "" }, { "docid": "08da244c02f946ff70695b9adc356967", "score": "0.68508273", "text": "def can_view_enroller_dashboard?\n has_role?(:enroller)\n end", "title": "" }, { "docid": "86456da93745895da765b05db6e1dbd8", "score": "0.68302506", "text": "def admin_signed_in?\n !current_user.nil? && current_user.AdminScreen?\n end", "title": "" }, { "docid": "13cd1a738faf02efa7ece35b52cf728d", "score": "0.6722428", "text": "def is_dashboard?\n #params[:controller] == 'care_circles'\n #params[:care_circle_id] || (params[:controller] == \"care_circles\")\n params[:controller] == \"care_circles\"\n end", "title": "" }, { "docid": "d7fd39f737f28866c75b060783fb6abb", "score": "0.66556644", "text": "def user_dashboard\n if @current_user.superadmin_role\n path = auth_hub.index_superadmin_url\n elsif @current_user.admin_role\n path = auth_hub.index_admin_url\n elsif @current_user.admin_servizi\n path = auth_hub.index_admin_url\n end\n redirect_to path unless path.blank?\n end", "title": "" }, { "docid": "b7adf38bddcf64159b12eafb8abca1c8", "score": "0.6638051", "text": "def dashboard_exists?(id)\n saved_object_exists?(\"dashboard\", id)\n end", "title": "" }, { "docid": "6efea516143c5e79ea29b33f18ab0e6e", "score": "0.6629199", "text": "def show?\n @current_user.admin?\n end", "title": "" }, { "docid": "d49a301348bb0ba96a0f5d9bbb82ecb4", "score": "0.66162694", "text": "def show?\n !user.nil? && user.admin?\n end", "title": "" }, { "docid": "8c437ae30ffcde6f111748e9438f43d1", "score": "0.6615738", "text": "def admin_only_view\n if !current_user.is_a? Admin and current_user.type != \"AdminAssistant\"\n flash[:error] = \"You are not authorized to view this page.\"\n redirect_to :root\n # Explictly tell the caller that this check failed\n return false\n else\n # Explictly tell the caller that this check was successful\n return true\n end\n end", "title": "" }, { "docid": "54e9a8b4291a9162c76be8df3af10223", "score": "0.6603452", "text": "def show?\n user.active?\n end", "title": "" }, { "docid": "052d6d319139f4f130bd89d3e9c7c701", "score": "0.65769154", "text": "def landing\n redirect_to dashboard_path if current_user\n end", "title": "" }, { "docid": "986b889e3b2acf5535c6e55914f02e7f", "score": "0.6572874", "text": "def show_onboarding?\n User.first.email == 'admin@test.com' && current_user.email == 'admin@test.com' && current_user.is_admin?\n end", "title": "" }, { "docid": "986b889e3b2acf5535c6e55914f02e7f", "score": "0.6572874", "text": "def show_onboarding?\n User.first.email == 'admin@test.com' && current_user.email == 'admin@test.com' && current_user.is_admin?\n end", "title": "" }, { "docid": "29174df1bd5d0236ed310ef4d43c00ca", "score": "0.65348506", "text": "def admin?\n\t self.profile == \"admin\"\n\tend", "title": "" }, { "docid": "0ab0b98dd3747c9c76902a9816cf6477", "score": "0.65307564", "text": "def index?\n is_user_activity_admin_or_admin?\n end", "title": "" }, { "docid": "a8d03e8b3e905a7f61dc16bf6738b2df", "score": "0.6497913", "text": "def show_profile?\n if controller.controller_name == 'hackers'\n true\n else\n false\n end\n end", "title": "" }, { "docid": "6fa3ea596d4fd1d476bf8601e9c516f2", "score": "0.64968306", "text": "def is_admin\n if current_user && !((current_user.roles.first.name==\"Super Admin\" || current_user.roles.first.name==\"Department Admin\") && current_user.role_memberships.first.status==\"A\")\n redirect_to dashboard_index_path\n end\n end", "title": "" }, { "docid": "28edef705be12646539625f196b5338c", "score": "0.64825684", "text": "def show\n is_admin?\n end", "title": "" }, { "docid": "8f45a5690be85dbe7692719da84e2a17", "score": "0.64678496", "text": "def authorized?\n current_user.login == \"Admin\"\n end", "title": "" }, { "docid": "02dcf9763129c16bf941fe10a74f4090", "score": "0.6462319", "text": "def show\n is_admin?\n end", "title": "" }, { "docid": "3353f04c39aa862d61a6ae8af257b7fb", "score": "0.64606535", "text": "def visible?(user=User.current)\n true\n end", "title": "" }, { "docid": "c3d776f85172b52a4969a821a79aec15", "score": "0.64549845", "text": "def dashboard_view(current_account = account)\n preferences[:dashboard_view] || current_account.default_dashboard_view || 'cards'\n end", "title": "" }, { "docid": "2998f6beb3355fac996abd4794d712df", "score": "0.64513004", "text": "def user_is_admin\n unless current_user.admin?\n flash[:notice] = \"You may only view existing scenarios.\"\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "26ba37ef10172ec19cbb09f4c55050bc", "score": "0.64436483", "text": "def display_navbar?\n return true if admin?\n return true if person.is_a?(Mentor) && person.passed_basics?\n return true if person.is_a?(Mentor) && person.current_lead?\n false\n end", "title": "" }, { "docid": "7bc6c03acf6defc46298492f35a77dfa", "score": "0.64435196", "text": "def show\n\t\t\tputs current_user.is_admin?\n\tend", "title": "" }, { "docid": "5f4963a207169ba585fc0099ffb9ca4e", "score": "0.6437031", "text": "def user_admin?\n user_logged_in? && @current_user.type == 'Admin'\n end", "title": "" }, { "docid": "2b0e565c4d8b960ab5e34eb4dc96b0f6", "score": "0.64272004", "text": "def show_private_tab\n current_user && (current_user.admin? || # if current_user is an admin\n current_user.premium? || # current_user is a premium\n current_user.wiki_collaborations.any?) # current_user has any private wiki collaborations\n end", "title": "" }, { "docid": "f30bcd0aa56b9d417355501b36c9a871", "score": "0.6417192", "text": "def index?\n loudly { @user.is_a? Administrator }\n end", "title": "" }, { "docid": "1352ce3e0dc9c5efd8ca46724c557124", "score": "0.6400262", "text": "def show?\n @current_user.permission('Department', :guest)\n end", "title": "" }, { "docid": "f959125048b00431bdb31fd08b1f60cd", "score": "0.639895", "text": "def listing\n @user = User.all\n unless current_user.admin?\n redirect_to dashboard_show_path\n end \n end", "title": "" }, { "docid": "9b6677d3898c875bfc7bdcd2ddde3159", "score": "0.63978857", "text": "def show?\n user.super_admin? or user.digital_store_admin?\n end", "title": "" }, { "docid": "6a8b284bd6833fce8603f451687a4b87", "score": "0.63928616", "text": "def authorized?\n %w(new create plans canceled thanks).include?(self.action_name) || \n ((self.action_name == 'dashboard') && current_user) ||\n admin?\n end", "title": "" }, { "docid": "6a8b284bd6833fce8603f451687a4b87", "score": "0.63928616", "text": "def authorized?\n %w(new create plans canceled thanks).include?(self.action_name) || \n ((self.action_name == 'dashboard') && current_user) ||\n admin?\n end", "title": "" }, { "docid": "c83f1dc977cde6b446b588a1c2633569", "score": "0.6374087", "text": "def dashboard_profile\n @user = current_user\n render \"dashboard/dashboard_profile\" and return\n end", "title": "" }, { "docid": "c3429f7d0980b36e872a5deb8fb5eb36", "score": "0.63630426", "text": "def is_in_admin_view\n !request.path.match(\"/admin\").nil?\n end", "title": "" }, { "docid": "c3429f7d0980b36e872a5deb8fb5eb36", "score": "0.63630426", "text": "def is_in_admin_view\n !request.path.match(\"/admin\").nil?\n end", "title": "" }, { "docid": "42a969be8ce6dd17350a3e513bca8a5a", "score": "0.63430023", "text": "def by_user?\n !@current_user.admin?\n end", "title": "" }, { "docid": "4d7b21b924328280927146e02fa0670e", "score": "0.6342818", "text": "def check_admin\n return redirect_to user_dashboard_path unless current_user.is_admin?\n end", "title": "" }, { "docid": "990bf6bb2f8b13a0b48f74a22b706d63", "score": "0.6320097", "text": "def user_admin?\n unless current_user.present? && current_user.admin?\n redirect_to home_welcome_path and return\n end \n end", "title": "" }, { "docid": "c3c4a87b90160f87d7c35851e4d08d29", "score": "0.63038576", "text": "def ensure_admin_user\n redirect_to dashboard_index_path unless is_admin?\n end", "title": "" }, { "docid": "aa060ae8efc3b6fdac9a08a396d46247", "score": "0.6302648", "text": "def is_admin?\n current_user ? current_user.login == 'admin' : false\n end", "title": "" }, { "docid": "093a03483ce88145db23a897e308bae3", "score": "0.62993413", "text": "def user_only\n redirect_back(fallback_location: admin_dashboards_path) if current_user.admin?\n end", "title": "" }, { "docid": "48ad2da2944a4b5fba67fa1f67e06bae", "score": "0.6294345", "text": "def check_if_current_user_page\n redirect_to('/') and return unless (current_user.id == User.from_param(params[:id])) || current_user.is_admin?\n end", "title": "" }, { "docid": "afb5ea2e06c2513846e9f4c48e7178ff", "score": "0.62920105", "text": "def is_admin?\n current_user && current_user.site=='admin'\n end", "title": "" }, { "docid": "2473f391c73aa1a33c949e8075b2b41f", "score": "0.6285639", "text": "def admin_logged_in?\n !current_admin.nil?\n end", "title": "" }, { "docid": "1abaad6ee95ce1350610f8ac0ab65542", "score": "0.62854725", "text": "def show\n isadmin\n end", "title": "" }, { "docid": "d69aa534a89e9613329f40f0f8931123", "score": "0.627289", "text": "def viewable_by?(user)\n Sugar.public_browsing? || user ? true : false\n end", "title": "" }, { "docid": "2c610be77394034e9cefa5335f4939cc", "score": "0.6270882", "text": "def show_admin_menu_items?\n can?(:read, :admin_dashboard)\n end", "title": "" }, { "docid": "d4e8833258afdc87dfcef44b2c8ab4f3", "score": "0.6267731", "text": "def user_is_admin\n redirect_to root_path unless current_user && current_user.is_admin?\n end", "title": "" }, { "docid": "8bc367633659d3e37af40255916c36bf", "score": "0.62659645", "text": "def logged_in?\n !current_admin.nil?\n end", "title": "" }, { "docid": "8bc367633659d3e37af40255916c36bf", "score": "0.62659645", "text": "def logged_in?\n !current_admin.nil?\n end", "title": "" }, { "docid": "efd3ef4ed9084ab4e7ab91c9d3da8c1c", "score": "0.6265228", "text": "def show?\n @current_user.permission('Fdp', :guest)\n end", "title": "" }, { "docid": "9392e2761aff01f3ae8779d350046aff", "score": "0.6264784", "text": "def verify_admin?\n return if current_user.admin?\n\n flash[:alert] = \"Sorry, only admins allowed to view the dashboard.\"\n redirect_to :root\n end", "title": "" }, { "docid": "e989208b0eabe825128fd1a72a1cfd29", "score": "0.62575364", "text": "def check_permission\n redirect_to dashboard_path, notice: 'You are not authorised to perform this action.' unless current_user&.admin?\n end", "title": "" }, { "docid": "9af99632b3fc4f43697e94cb5d071ef0", "score": "0.6256839", "text": "def has_privilege?\n if (!logged_in?)\n redirect_to '/login' and return\n elsif (params[:user_id].to_i != current_user.id)\n redirect_to user_stories_path(current_user) and return\n end\n end", "title": "" }, { "docid": "a0e0f8002b67f6274f3db1ef1334d76c", "score": "0.6254732", "text": "def eventunscrape?\n @user.is_admin?\n end", "title": "" }, { "docid": "4d3ae10883379c9b1bd8003ec695fce6", "score": "0.62511706", "text": "def is_logged_in_and_admin\n unless current_user && current_user.admin? \n flash[:danger] = \"You do not have the ability to do that!\"\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "57db0ca17745a41e1ecbcf9ccb5f4bcd", "score": "0.62456536", "text": "def doctor_or_admin_view\n if !((current_user.is_a? Doctor) || (current_user.is_a? Admin) || (current_user.is_a? AdminAssistant))\n flash[:error] = \"You are not authorized to view this page.\"\n redirect_to :root\n # Explictly tell the caller that this check failed\n return false\n else\n # Explictly tell the caller that this check was successful\n return true\n end\n end", "title": "" }, { "docid": "007a03f0899b9cddef9a377311c58079", "score": "0.6241248", "text": "def user_admin?\n if current_user.nil? or !current_user.is_admin\n redirect_to \"/\"\n end \n end", "title": "" }, { "docid": "2733a7a3ced89a674b986352d77fb69c", "score": "0.62404984", "text": "def check_logged_in_user\n if signed_in?\n redirect_to dashboard_path\n end\n end", "title": "" }, { "docid": "41c27486691dd5a5bc8dd77901b0e202", "score": "0.6239195", "text": "def show_explore_button?\n current_user.permissions == User::Permissions::NONE\n end", "title": "" }, { "docid": "e8cc55f1a0b918d04d7be7cc8e756ec9", "score": "0.6238162", "text": "def administrate!\r\n\tif !current_user.administrator\r\n\t\tredirect \"/dashboard\"\r\n\tend\r\nend", "title": "" }, { "docid": "245979bd66b3bfefdc2cb880dd7cc265", "score": "0.6226063", "text": "def logged_in?\n current_user.is_a? Administrator\n end", "title": "" }, { "docid": "d10656164a82132684ce97d128a14d91", "score": "0.6225454", "text": "def show_maintenance_mode_page\n \n # read plugin settings\n settings = MaintenanceModeFunctions.get_maintenance_plugin_settings\n \n # only activate maintenance message if maintenance mode is activated or if we're in the middle of a scheduled maintenance \n if settings[:maintenance_active] || MaintenanceModeFunctions.is_now_scheduled_maintenance\n # and only activate it for non-admin users (or sudoers if 'redmine_sudo' plugin is installed)\n unless User.current.admin? || (Redmine::Plugin.installed?(\"redmine_sudo\") && User.current.sudoer?)\n logout_user if User.current.logged?\n require_login unless params[:controller] == \"account\" && params[:action] == \"login\"\n return false\n end\n end\n end", "title": "" }, { "docid": "e7820a2c535d13a2c92c79ce54061613", "score": "0.6225335", "text": "def on_page_portal?\n return (controller.controller_name == \"home\" and controller.action_name == \"portal\") \n end", "title": "" }, { "docid": "5c8cec498ad3f929b582c43edde86688", "score": "0.62244475", "text": "def repository_activity_section?\n %w[admin dashboard status].include?(controller_name)\n end", "title": "" }, { "docid": "a0a743ba25d43369e2073146110de413", "score": "0.62229306", "text": "def show?\n user.admin? || user.po? || record.user == user\n end", "title": "" }, { "docid": "7219a4fd4c5cc60c28e2d693ccb1f5fe", "score": "0.6221448", "text": "def index?\n # @current_user.admin?\n end", "title": "" }, { "docid": "41748c0aad12d5e455dca9c091bba2d6", "score": "0.6219287", "text": "def is_in_admin_view?\n !request.path.match(\"admin\").nil?\n end", "title": "" }, { "docid": "16aab17b0e38d54b562a966d35aa5682", "score": "0.62164813", "text": "def needs_authenticate_user?\n except_actions = %w[index show]\n !except_actions.include?(action_name)\n end", "title": "" }, { "docid": "1e6b679cdfa326a93c3d5bcfec94add8", "score": "0.62138885", "text": "def dashboard_emptied?(an_user_id)\n Bookmark.joins(\"INNER JOIN media_elements ON media_elements.id = bookmarks.bookmarkable_id AND bookmarks.bookmarkable_type = 'MediaElement'\").where('media_elements.is_public = ? AND media_elements.user_id != ? AND bookmarks.user_id = ?', true, an_user_id, an_user_id).any?\n end", "title": "" }, { "docid": "6dbe5d7552682f9a9cbe8ba8188e7e5d", "score": "0.62124103", "text": "def only_your_profile_page\n @admin = Admin.find(params[:admin_id])\n\n if current_admin != @admin\n redirect_to sectors_path, notice: \"Access denied! You can only view your own profile page.\"\n end\n end", "title": "" }, { "docid": "348587f602eb4f9e7382d9e8bb7e2732", "score": "0.620997", "text": "def logged_admin?\n !current_admin.nil?\n end", "title": "" }, { "docid": "41d97f7c3c97a6068f0dfed4ed369c62", "score": "0.62080705", "text": "def show?\n user.id == record.id || user.administrator?\n end", "title": "" }, { "docid": "71862f56ad7becfcd41089a59e168ae0", "score": "0.6206538", "text": "def dashboard\n # displays the admin dashboard if current user is admin\n if current_user.is_admin\n # retrieves a list of all users, ordered by username\n @users = User.order(\"username\")\n render :admin_dashboard\n # sold parameter can be toggled on the dashboard to display either sold or unsold listings\n elsif params[:sold]\n @sold = true\n # retrieves a paginated list of all of the users SOLD listings, ordered by date posted (descending)\n @listings = current_user.listings.where(\"is_sold is true\").order(\"created_at desc\").page params[:page]\n else\n @sold = false\n # retrieves a paginated list of all of the users UNSOLD listings, ordered by date posted (descending)\n @listings = current_user.listings.where(\"is_sold is false\").order(\"created_at desc\").page params[:page]\n end\n end", "title": "" }, { "docid": "46f14b144692128623b38254b9951cc9", "score": "0.6200025", "text": "def adminlogged_in?\n !!current_administrator\n end", "title": "" }, { "docid": "78c357d5ec141e9f18228841f3887e44", "score": "0.6192961", "text": "def user_authorized?(user)\n user == current_user || is_admin?\n end", "title": "" }, { "docid": "0ab2f8c928381e0a516d9a125affb0d0", "score": "0.61859787", "text": "def link_visible?(page_name)\n if current_user.manager? || current_user.admin?\n pages = ['dashboard', 'home', 'products', 'categories', 'users', 'offers']\n else\n pages = ['home']\n end\n\n pages.include?(page_name)\n end", "title": "" }, { "docid": "a82c31fc24460d787eb21d0966d34728", "score": "0.61823034", "text": "def is_admin_user\n if current_user.present? && current_user.admin? == false\n redirect_to '/'\n return\n end\n end", "title": "" }, { "docid": "d3b9ced04e9982f2dd7ddcd6a2c9b6b6", "score": "0.6178435", "text": "def admin_logged_in?\n User.admin_logged_in?\n end", "title": "" }, { "docid": "d3b9ced04e9982f2dd7ddcd6a2c9b6b6", "score": "0.6178435", "text": "def admin_logged_in?\n User.admin_logged_in?\n end", "title": "" }, { "docid": "3e7a16e816fdd7acb3bd8f80a1e6b9cb", "score": "0.61770344", "text": "def admin_user?\n session[:user][:uid] == APP_CONFIG[:admin]\n end", "title": "" }, { "docid": "95cbb99068e677535bcfe25eb4079c85", "score": "0.6172102", "text": "def identity_page?\n active_page? 'accounts' => ['show']\n end", "title": "" }, { "docid": "f1066eb1f0bac02c7c74da940db3f555", "score": "0.6169063", "text": "def show?\n user.try(:admin?) || record.has_member?(user) \n end", "title": "" }, { "docid": "cb517bd56ccfa70dc5ec953858609543", "score": "0.61670583", "text": "def show?\n true unless user.nil?\n end", "title": "" }, { "docid": "60bbe5efa26ea2b99f5004f3c79b312e", "score": "0.61638296", "text": "def logged_in_as_admin?\n !current_admin.nil?\n end", "title": "" }, { "docid": "f6ad302348dfe36c4219711af5001f69", "score": "0.6162537", "text": "def show?\n @user.has_role?(:admin) || @record.course.user_id == @user.id || @record.course.bought(@user) == false\n end", "title": "" }, { "docid": "d3e1097924ca877e1f2ba1066e189ef9", "score": "0.6162167", "text": "def is_admin?\n if login == \"ankit\"\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "e1e0fbd32c10df1232c6e0288b99ce5c", "score": "0.61545885", "text": "def admin_logged_in?\n !current_admin_user.nil?\n end", "title": "" }, { "docid": "7f94d9b9881f0c24a1bef7bfa8276331", "score": "0.6150654", "text": "def is_admin\n render status: :unauthorized unless current_user.admin\n end", "title": "" }, { "docid": "09b3c5945efea8e27f2a4ae16f459ee7", "score": "0.6147767", "text": "def is_admin?\n current_user && current_user.try(:admin?)\n end", "title": "" }, { "docid": "ebd7f590de949b2648ed5d039984c151", "score": "0.6145631", "text": "def authorized?\n\n return false unless current_user\n\n %w{ show index }.include?(action_name) || current_user.is_admin?\n end", "title": "" }, { "docid": "af9bebb43e641bf2fb1b47f2014485e9", "score": "0.6128421", "text": "def index?\n not admin.nobody?\n end", "title": "" }, { "docid": "ccb90a5d230488e671a15174839d2473", "score": "0.61283964", "text": "def is_logged_in?(user)\n return false if is_logged_out?\n\n unless user_dropdown.present?\n @config.screenshot!(\"is_logged_in_\" + Time.now.to_s)\n #byebug\n raise \"page is not in a dom state able to determine logged in user. Please check your workflow.\"\n end\n\n @profile_page = Pages::Community::Profile.new(@config)\n @profile_page.goto_profile\n\n @profile_page.user_name == user.username\n end", "title": "" }, { "docid": "233a9387d9be5397d260db4654a0488a", "score": "0.61267585", "text": "def is_visible?\n is_public? && ProfileStatus::VISIBLE.include?(profile_status)\n end", "title": "" }, { "docid": "5242707e268c81fb66584bbae2e1673c", "score": "0.61245656", "text": "def index\n if current_user\n if !request.referer || (request.env['HTTP_REFERER'] && !(URI(request.env['HTTP_REFERER']).path == dashboard_path))\n redirect_to :controller => 'dashboards', :action => 'show'\n end\n end\n @title = 'Home'\n end", "title": "" }, { "docid": "516cc01afdb0755da0178c0d9c59595a", "score": "0.6124031", "text": "def show\n render layout: 'devise_layout' if current_user.present? && current_user.admin?\n end", "title": "" }, { "docid": "c99a780346c7e0c09ad21fb7ede2e3e4", "score": "0.6118381", "text": "def user_is_admin?\n\tbegin\n\t `gpresult /r /scope user`.split.include? \"Admin\"\n\trescue\n\t false\n\tend\n end", "title": "" }, { "docid": "4799c56dbd07a500c65a459cfe28dc32", "score": "0.61127025", "text": "def dash\n if current_user && current_user.user_role == \"jobseeker\"\n redirect_to jobseekers_dashboard_index_path\n elsif current_user && current_user.user_role == \"employer\"\n redirect_to employers_dashboard_index_path\n elsif current_user && current_user.is_admin?\n redirect_to \"/admin\"\n end\n \n end", "title": "" } ]
e3f8a6cfc9c169700d4e59853a4c196e
before_filter :authorise,:only => [:new, :edit, :delete]
[ { "docid": "6d6a9664b118df603e4e1c81fde15af7", "score": "0.0", "text": "def authorise\n unless signed_in?\n\t\t store_location\n redirect_to signin_path, :notice => \"Please sign in to access this page.\"\n end\n end", "title": "" } ]
[ { "docid": "2faf584a89dcdb915fe22d10611334b0", "score": "0.7381942", "text": "def edit\n authorize User\n end", "title": "" }, { "docid": "0fccedf1ebf66c2f024a215eee321c96", "score": "0.7052395", "text": "def show\n authorize! :show,Administracion::Usuario\n end", "title": "" }, { "docid": "14e89e6638224e31f4c32e45025d2a8e", "score": "0.6994593", "text": "def show\n authorize! :read_admin, User\n\n end", "title": "" }, { "docid": "5eda33fda2f031b3d00b8e8fdad504cd", "score": "0.69880986", "text": "def show\n # authorize! :manage, Calificacion\n end", "title": "" }, { "docid": "e1407f3450d9928b3d5795ae764709c8", "score": "0.6978566", "text": "def edit\n authorize! :admin_edit, @user\n end", "title": "" }, { "docid": "782e660e50b8d9191f4ab7a646ed9a0f", "score": "0.6964751", "text": "def authorize\n\tend", "title": "" }, { "docid": "f7eb88603839798df2d248c2f5718bb6", "score": "0.69570607", "text": "def show\n authorize User\n end", "title": "" }, { "docid": "e1666e52ac3bea743307f81f06886bf4", "score": "0.68923277", "text": "def authorize\n \tredirect_to login_path unless current_user\n end", "title": "" }, { "docid": "8a812ddb4c45a3a21553c323477a8963", "score": "0.68468064", "text": "def edit\n # note: commented next line since before_filter method defines @user \n # @user = User.find( params[:id] )\n end", "title": "" }, { "docid": "d21ca01a318f0ea53c2322fc7043aa6a", "score": "0.68467325", "text": "def YourController < ApplicationController\n access all: [:show, :index], user: {except: [:destroy]}, company_admin: :all\nend", "title": "" }, { "docid": "31b200279f1a3b0ea471240f2a5ff929", "score": "0.68409055", "text": "def show\n authorize! :manage, @todos, :message => \"Not authorized \"\n end", "title": "" }, { "docid": "0c4d5ba5148a49ef2a621c89aa020494", "score": "0.68404025", "text": "def authorize\n return_unauthorized unless current_user && current_user.can_modify_user?(params[:id])\n end", "title": "" }, { "docid": "0c4d5ba5148a49ef2a621c89aa020494", "score": "0.68404025", "text": "def authorize\n return_unauthorized unless current_user && current_user.can_modify_user?(params[:id])\n end", "title": "" }, { "docid": "0c4d5ba5148a49ef2a621c89aa020494", "score": "0.68404025", "text": "def authorize\n return_unauthorized unless current_user && current_user.can_modify_user?(params[:id])\n end", "title": "" }, { "docid": "426a7b6c8e4ba9009a0969f07dee8560", "score": "0.6838538", "text": "def authorize\n \tunless current_user\n \t\tredirect_to login_path\n \tend\n end", "title": "" }, { "docid": "401d5729efa70d1d31f0a8314e3dbc2d", "score": "0.67997134", "text": "def edit\n authorize @staff_student\n end", "title": "" }, { "docid": "0865fd54d8b799ffad0cabe2d0b1d7b2", "score": "0.679564", "text": "def authorize\n redirect_to login_url, alert: \"You must log in to add or edit events\" if current_user.nil?\n end", "title": "" }, { "docid": "6ca042171f2f3b727aaf1246fa5ee0a9", "score": "0.67922246", "text": "def authorize \n redirect_to :controller => 'admin', :action => 'login' unless logged_in?\n end", "title": "" }, { "docid": "79aea7ce4d1e7fecd0109333ab8a08e2", "score": "0.6783169", "text": "def show\n\tauthorize! :manage, @user\n end", "title": "" }, { "docid": "ae65edfd136d40ac72db78834b655307", "score": "0.67830986", "text": "def edit\n authorize @member\n end", "title": "" }, { "docid": "730477116dadc54961b853874293b623", "score": "0.6776685", "text": "def authorize\n redirect_to \"/login\" unless current_user\n end", "title": "" }, { "docid": "730477116dadc54961b853874293b623", "score": "0.6776685", "text": "def authorize\n redirect_to \"/login\" unless current_user\n end", "title": "" }, { "docid": "9b9ffee8fad7595b58a12c18beaa4c3a", "score": "0.67728245", "text": "def authorize\n redirect_to root_path unless current_user\n end", "title": "" }, { "docid": "9b9ffee8fad7595b58a12c18beaa4c3a", "score": "0.67728245", "text": "def authorize\n redirect_to root_path unless current_user\n end", "title": "" }, { "docid": "04363e1fdc5ae889f934304193ddf64a", "score": "0.6769235", "text": "def authorize\n \tunless User.find_by(id: session[:user_id])\n \t\t# redirect_to login_url, notice:\"You trying to access without permit\"\n \tend\n \t\t\n \tend", "title": "" }, { "docid": "983a055be562efcadaa60c734ee08e60", "score": "0.6761459", "text": "def show\n # authorize! :read, @user\n end", "title": "" }, { "docid": "fc8f2a675eda293ff27b3cc4b516cd05", "score": "0.6740228", "text": "def authorize\n redirect_to login_path unless current_user\n end", "title": "" }, { "docid": "50649a21ee062c3ed98f9f7a7cf3a3da", "score": "0.6739553", "text": "def authorize\n redirect_to '/login' unless current_user\n end", "title": "" }, { "docid": "50649a21ee062c3ed98f9f7a7cf3a3da", "score": "0.6739553", "text": "def authorize\n redirect_to '/login' unless current_user\n end", "title": "" }, { "docid": "50649a21ee062c3ed98f9f7a7cf3a3da", "score": "0.6739553", "text": "def authorize\n redirect_to '/login' unless current_user\n end", "title": "" }, { "docid": "50649a21ee062c3ed98f9f7a7cf3a3da", "score": "0.6739553", "text": "def authorize\n redirect_to '/login' unless current_user\n end", "title": "" }, { "docid": "50649a21ee062c3ed98f9f7a7cf3a3da", "score": "0.6739553", "text": "def authorize\n redirect_to '/login' unless current_user\n end", "title": "" }, { "docid": "50649a21ee062c3ed98f9f7a7cf3a3da", "score": "0.6739553", "text": "def authorize\n redirect_to '/login' unless current_user\n end", "title": "" }, { "docid": "50649a21ee062c3ed98f9f7a7cf3a3da", "score": "0.6739553", "text": "def authorize\n redirect_to '/login' unless current_user\n end", "title": "" }, { "docid": "9842c3631d689a5891282df67808b26e", "score": "0.67325616", "text": "def show\n authorize! :index, @user\n end", "title": "" }, { "docid": "9842c3631d689a5891282df67808b26e", "score": "0.67325616", "text": "def show\n authorize! :index, @user\n end", "title": "" }, { "docid": "c02c34421370fcae6f45c0843983197c", "score": "0.67243713", "text": "def authorize\n if not current_user\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "c02c34421370fcae6f45c0843983197c", "score": "0.67243713", "text": "def authorize\n if not current_user\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "a0643ea88ea65607386f8b3561574453", "score": "0.67208296", "text": "def authorize\n redirect_to '/' unless logged_in?\n end", "title": "" }, { "docid": "dc1965751acb883ac71bb1d0b03d0ea0", "score": "0.6701175", "text": "def edit \n #before_action get_current_userで取得\n end", "title": "" }, { "docid": "3580a74dbb6104019f4205ead64eef73", "score": "0.66997683", "text": "def adminDash\n authorize current_user\n end", "title": "" }, { "docid": "2b82f7511c0c9dc3aa1532b40355a4f4", "score": "0.6692154", "text": "def authorize\n\t\t return_unauthorized unless current_user && current_user.can_modify_user?(params[:id])\n\t\tend", "title": "" }, { "docid": "d26b3510a4015edab936a1d80cd11f0f", "score": "0.6687886", "text": "def show\n authorize!\n end", "title": "" }, { "docid": "d26b3510a4015edab936a1d80cd11f0f", "score": "0.6687886", "text": "def show\n authorize!\n end", "title": "" }, { "docid": "d26b3510a4015edab936a1d80cd11f0f", "score": "0.6687886", "text": "def show\n authorize!\n end", "title": "" }, { "docid": "d26b3510a4015edab936a1d80cd11f0f", "score": "0.6687886", "text": "def show\n authorize!\n end", "title": "" }, { "docid": "d26b3510a4015edab936a1d80cd11f0f", "score": "0.6687886", "text": "def show\n authorize!\n end", "title": "" }, { "docid": "d26b3510a4015edab936a1d80cd11f0f", "score": "0.6687886", "text": "def show\n authorize!\n end", "title": "" }, { "docid": "d26b3510a4015edab936a1d80cd11f0f", "score": "0.6687886", "text": "def show\n authorize!\n end", "title": "" }, { "docid": "d26b3510a4015edab936a1d80cd11f0f", "score": "0.6687886", "text": "def show\n authorize!\n end", "title": "" }, { "docid": "f46d39437bbbd77275c58350a2c54f48", "score": "0.6686345", "text": "def authorize_user\n authorize :devise, :standard\n end", "title": "" }, { "docid": "d969f2512ce04357988694cdacc1e0e3", "score": "0.6684837", "text": "def authorize\n unless current_user\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "f5369c0ee80162ce1371087be5f1fc50", "score": "0.6683994", "text": "def adminEdit\n authorize User.find(params[:id])\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "65f56ea2fa905f7760d79f9fc3b8631b", "score": "0.66835856", "text": "def edit\n @user = User.find(params[:id])\n authorize @user\n end", "title": "" }, { "docid": "90bdbbdc4defcb4a4770605c28d8a43d", "score": "0.66786754", "text": "def authorize\nredirect_to '/login' unless current_user\nend", "title": "" }, { "docid": "595883c29ff4f46b0428fc1344263557", "score": "0.667332", "text": "def authorize\n redirect_to root_path unless logged_in?\n end", "title": "" }, { "docid": "c88364f80c71e1fee801b48b4dfe42a0", "score": "0.6669317", "text": "def authorize\n end", "title": "" }, { "docid": "1368bac47b81338d579e8590a0191adb", "score": "0.666741", "text": "def protect_action(*actions)\n before_filter :authenticate_url, :only => actions\n end", "title": "" }, { "docid": "7551544678ccc45880dee6b4e1f6e1f8", "score": "0.6666328", "text": "def authorize\n redirect_to '/users/sign_in' unless current_user\n end", "title": "" }, { "docid": "275c00c262a8a61d56f0d0f9ca23ebe3", "score": "0.6664107", "text": "def edit\n authorize @college\n end", "title": "" }, { "docid": "e0ba9d01a617f9920e29f793614c5c99", "score": "0.66627365", "text": "def show\n authorize @user\n end", "title": "" }, { "docid": "e0ba9d01a617f9920e29f793614c5c99", "score": "0.66627365", "text": "def show\n authorize @user\n end", "title": "" }, { "docid": "e0ba9d01a617f9920e29f793614c5c99", "score": "0.66627365", "text": "def show\n authorize @user\n end", "title": "" }, { "docid": "e0ba9d01a617f9920e29f793614c5c99", "score": "0.66627365", "text": "def show\n authorize @user\n end", "title": "" }, { "docid": "3d2b373266a2c22e158282b81c013cff", "score": "0.6656267", "text": "def authorize \n if (!current_user) \n redirect_to login_path\n end\n end", "title": "" }, { "docid": "d1fbf703ff217b684fd306854da9bdb8", "score": "0.66561615", "text": "def show\n authorize @accion\n end", "title": "" }, { "docid": "baf33d35b9091cd551ab164558c273b1", "score": "0.6645093", "text": "def edit\n login_required\n end", "title": "" }, { "docid": "5d81745e69b257f408db276ac2c237dd", "score": "0.66446674", "text": "def authorize\n unless signed_in?\n redirect_to root_path, alert: 'You must be admin to access this page.' \n end\n end", "title": "" }, { "docid": "e026feb7f91bc0095c8bd34fa18c6e57", "score": "0.66379064", "text": "def index\n # @staff_profiles = StaffProfile.all\nif params[:view]==\"Deactive\"\n @user_deactive =true\n @users=User.only_deleted \n else\n @users = User.all\n end\n @user = User.new\n authorize @users\n end", "title": "" }, { "docid": "b8173179ceeb5e80e9b784f7b0810920", "score": "0.6635767", "text": "def authorize\n return_unauthorized unless current_user\n end", "title": "" }, { "docid": "ef18fe2d5c4ea8ee3fc270b17405a50e", "score": "0.6628079", "text": "def show\n @user = current_user\n # authorize @user\n \n end", "title": "" }, { "docid": "f0c8ac564bd793c6ba6219a20414b367", "score": "0.66222644", "text": "def show\n # see before action filter\n end", "title": "" }, { "docid": "6e867b80a563fe7c94e95029f86c3038", "score": "0.66200763", "text": "def show\n skip_authorization\n end", "title": "" }, { "docid": "6e867b80a563fe7c94e95029f86c3038", "score": "0.66200763", "text": "def show\n skip_authorization\n end", "title": "" }, { "docid": "6e867b80a563fe7c94e95029f86c3038", "score": "0.66200763", "text": "def show\n skip_authorization\n end", "title": "" }, { "docid": "6e867b80a563fe7c94e95029f86c3038", "score": "0.66200763", "text": "def show\n skip_authorization\n end", "title": "" }, { "docid": "734e236681bb5027d52b582a767518bc", "score": "0.66195124", "text": "def authorized_to_edit?\n unless logged_in? && (current_user.id == params[:id].to_i || current_user.admin_status)\n flash[:notice] = \"warning: forbidden path\"\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "70e6de9333996c0dc4e57b87f1bb0114", "score": "0.66130716", "text": "def authorize_index\n unless (current_user == @user)\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "2d62537676e50bcb7505af40b25609a5", "score": "0.65972126", "text": "def edit\n authorize :profile, :edit?\n end", "title": "" }, { "docid": "256cc39f62af780953395b082d4a47e7", "score": "0.6587878", "text": "def index\n @users = User.all\n# authorize! :read, @users\n end", "title": "" }, { "docid": "a30070db22c0a4632dc52126a293227d", "score": "0.65812355", "text": "def show\n \tauthorize! :read, @user\n end", "title": "" }, { "docid": "dbab38746c7e672fe43d4d74af96302f", "score": "0.65715307", "text": "def show\n authorize University\n end", "title": "" }, { "docid": "5e80a470a5ad617fc14f931a6602c7f2", "score": "0.657147", "text": "def show\n authorize EmployeeCategory\n end", "title": "" }, { "docid": "5c56d2a86051819b9431147c2ed12cde", "score": "0.6567203", "text": "def edit\n # before_action\n end", "title": "" }, { "docid": "0b6dd8116c2280702d2e1381d3312782", "score": "0.65655535", "text": "def authorized\n #redirect to root if current_user is nil\n redirect_to '/' unless !current_user.nil?\n end", "title": "" }, { "docid": "bc999ff6fc0d3ad66ec024c4874c4720", "score": "0.65611327", "text": "def authorize\n redirect_to login_url if current_user.nil?\n end", "title": "" }, { "docid": "1a5c47e2407adfaa491df35a394b67d8", "score": "0.6544425", "text": "def authorize\n #@user should have already been found in the check_for_user before_filter @user = User.find_by_id(session[:user_id])\n #return false #disable authentication for now while we're developing\n unless @user and @user.user_type == 'Admin'\n redirect_to login_url, :notice => \"Please log in\"\n end\n end", "title": "" }, { "docid": "ca21ada5c634a4f2c32422da4525c194", "score": "0.6542825", "text": "def show\n authorize! :read, @user\n end", "title": "" }, { "docid": "ca21ada5c634a4f2c32422da4525c194", "score": "0.6542825", "text": "def show\n authorize! :read, @user\n end", "title": "" }, { "docid": "ca21ada5c634a4f2c32422da4525c194", "score": "0.6542825", "text": "def show\n authorize! :read, @user\n end", "title": "" }, { "docid": "2ae26b75254b44c837440eae5a78b9a0", "score": "0.6536964", "text": "def authorize\n unless user_signed_in?\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "37c6ab02f9ab0c6c6aafb3c6396b0da3", "score": "0.6536824", "text": "def authorize!\n unless current_user\n redirect_to login_path\n end\n end", "title": "" }, { "docid": "790b0b884f64f637bfb2fe7cf8ec4c44", "score": "0.6525546", "text": "def authorize\n unless User.find_by(id: session[:user_id])\n redirect_to admin_path, notice: \"Opps, looks like You're not logged in!\"\n end\n end", "title": "" }, { "docid": "d1fbca429e939bec049f9aafb1a6b55f", "score": "0.6521105", "text": "def authorized\n redirect_to login_path unless logged_in?\n end", "title": "" }, { "docid": "d1fbca429e939bec049f9aafb1a6b55f", "score": "0.6521105", "text": "def authorized\n redirect_to login_path unless logged_in?\n end", "title": "" }, { "docid": "afb084168ab6e9686a8bafa5804b8b38", "score": "0.6517115", "text": "def authorize_user_to_edit\n unless current_user.admin? || current_user.moderator?\n flash[:alert] = \"You must be an admin or moderator to do that.\"\n redirect_to topics_path\n end\n end", "title": "" }, { "docid": "5c6f180e6604ee9ebf42e86507e398a2", "score": "0.6516014", "text": "def show\n authorize! :show, Caisse\n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.6514137", "text": "def before_action \n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.6514137", "text": "def before_action \n end", "title": "" }, { "docid": "5c3cfcbb42097019c3ecd200acaf9e50", "score": "0.6514137", "text": "def before_action \n end", "title": "" }, { "docid": "5ee26bbc3daa7f7ca84a1d6ac403d3db", "score": "0.65090764", "text": "def index\n @usuarios = Usuario.all\n authorize @usuarios\n end", "title": "" } ]
ff20265b0f5c871835a9a47f39a884a5
Create a new element image Params: +name+:: image name file +data+:: raw data encoded in base64 format
[ { "docid": "f42def75bfaa6f9247675bb35e283635", "score": "0.67227453", "text": "def initialize(name, data = nil)\n super(name)\n\n # Create a fake ElemImage\n if not data.nil?\n @data = data\n set_preview()\n end\n\n @tags = Array.new\n end", "title": "" } ]
[ { "docid": "3ecea2222e6433864cb3e5075242aca3", "score": "0.8038413", "text": "def add_image(name, data)\n elem = ElemImage.new(name, data)\n add_element(elem)\n end", "title": "" }, { "docid": "b8c98f10b61f50970240e777c1620409", "score": "0.69392025", "text": "def create\n data = image_params[:data]\n\n if data\n @image = Image.new.tap do |t|\n t.data = data.read\n t.description = data.original_filename\n end\n end\n\n respond_to do |format|\n if @image.save\n format.html { redirect_to @image, notice: 'Image was successfully created.' }\n format.json { render :show, status: :created, location: @image }\n else\n format.html { render :new }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7c544323f885ea797a3d18d7a1b7bc1e", "score": "0.67863214", "text": "def create_image(title, description, parent_id, mime_type, file_name)\n\t insert_file(title, description, parent_id, 'application/vnd.google-apps.photo', file_name)\n\tend", "title": "" }, { "docid": "ffd05683c361d8f33e77f33275295608", "score": "0.6761201", "text": "def create\n @image = Image.new(image_params) do |t|\n t.data = Base64.encode64(params[:image][:data].read)\n t.filename = params[:image][:data].original_filename\n t.mime_type = params[:image][:data].content_type\n end\n # @image.name = image_params['name']\n # @image.price = image_params['price']\n # @image.city = image_params['city']\n # @image.description1 = image_params['description1']\n # @image.description2 = image_params['description2'] \n @image.active = true\n @image.admin_ok = false\n @image.user_id = current_user.id\n @image.e_mail = current_user.email\n respond_to do |format|\n if @image.save\n format.html { redirect_to @image, notice: 'Image was successfully created.' }\n format.json { render :show, status: :created, location: @image }\n else\n format.html { render :new }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "034990625b5d117774e7409d95436407", "score": "0.6750616", "text": "def main_image_with_base64=(data)\n image = data\n\n if data.is_a?(String) && data.include?(\"data:image\")\n parts = data.split(',')\n\n meta = parts.first\n content_type = meta.split(';').first.gsub!('data:', '')\n extension = content_type.split('/').last\n extension = (extension == 'jpeg') ? 'jpg' : extension\n\n image = Paperclip.io_adapters.for(data)\n\n image.content_type = content_type\n image.original_filename = [rand(10_000), extension].join('.')\n \n end\n\n self.main_image_without_base64 = image\n end", "title": "" }, { "docid": "6b416667edf23fbfd0ae4aa43e8274c7", "score": "0.65513587", "text": "def create\n image_params = params[:ueditor_image] || {}\n self._create(image_params[:data], image_params[:title])\n # input: { fileName:'', Filename:'', pictitle: '', dir:'', 'file_file_name':'', upfile:'', Upload:submit_button_value, otherparam123:xx}\n # output: { url:'', title:'', original:'', state:'SUCCESS'}\n end", "title": "" }, { "docid": "2db0f644f4b02742dd703a5d3fe141c7", "score": "0.65075296", "text": "def mobile_image_with_base64=(data)\n image = data\n\n if data.is_a?(String) && data.include?(\"data:image\")\n parts = data.split(',')\n\n meta = parts.first\n content_type = meta.split(';').first.gsub!('data:', '')\n extension = content_type.split('/').last\n extension = (extension == 'jpeg') ? 'jpg' : extension\n\n image = Paperclip.io_adapters.for(data)\n\n image.content_type = content_type\n image.original_filename = [rand(10_000), extension].join('.')\n \n end\n\n self.mobile_image_without_base64 = image\n end", "title": "" }, { "docid": "c753064274e8dd75d5743d65418601ce", "score": "0.64962435", "text": "def create_image(image_name)\n open(image_name, 'wb') do |file|\n file << open(URI.escape(@chart)).read\n end\n end", "title": "" }, { "docid": "3c2536fd0b1f64ec6cbb6b0ff90c7c62", "score": "0.64941376", "text": "def create_image_from_DATA\n puts \"Creating file at \" + @desktop_image\n image_data = DATA.read\n new_file = File.new(@desktop_image,\"w+\")\n new_file.write(image_data)\n end", "title": "" }, { "docid": "5fd5e5ece5465886d4b432012351b466", "score": "0.6423913", "text": "def image(name)\n @parts.push(image: \"#{Bioturk::Application.config.image_server_interface}#{name}\")\n end", "title": "" }, { "docid": "7234e2bd96d1aebd8df48fd9347c9faa", "score": "0.62506497", "text": "def create_basic\n ImageGeneratingService.new(self, 'Basic.jpg', 'image/jpeg', 100).generate_resized(600)\n end", "title": "" }, { "docid": "2d2ad6059421966dd82575c08da4d1a8", "score": "0.6248157", "text": "def create_image(filename)\n fixture = file_fixture(filename)\n Image.create(filename: filename,\n size: fixture.size,\n mime_type: MimeMagic.by_path(fixture),\n data: fixture.read)\n end", "title": "" }, { "docid": "0df0129267c06cc56a4abf7ae4c01d15", "score": "0.6239548", "text": "def createIcon(data, icon_name, icon_path)\n \n \n begin\n icon_data = data\n \n # Scaling the icon\n img = Image.from_blob(icon_data).first\n icon = scale(img)\n\n # create dir if it does not exist\n if not (File.exists?(icon_path) && File.directory?(icon_path))\n FileUtils.mkdir_p(icon_path)\n end\n\n # create the file path\n full_path = File.join(icon_path, icon_name)\n \n icon.write(\"png:\"+ full_path)\n\n rescue Exception => e\n putsE(e)\n return false\n end\n\n return true\n end", "title": "" }, { "docid": "587524e86bb677d5cdee915427563887", "score": "0.62000585", "text": "def image_element(url, name)\n abs_url = @base_url + url\n size = content_size(abs_url)\n\n ret = \"<image url=#{abs_url.encode(xml: :attr)} name=#{name.encode(xml: :attr)} size=\\\"#{size}\\\">\\n\"\n ret += \"<checksum type=\\\"sha256\\\" disposition=#{(abs_url + '.sha256').encode(xml: :attr)}/>\\n\"\n ret += \"</image>\"\n ret.html_safe\n end", "title": "" }, { "docid": "b159e4d39376af770697c046f463d793", "score": "0.61777496", "text": "def createIcon(data, icon_name, icon_path)\n\n begin\n icon_data = data\n\n # Scaling the icon\n img = Image.from_blob(icon_data).first\n icon = scale(img)\n\n # create dir if it does not exist\n if not (File.exists?(icon_path) && File.directory?(icon_path))\n FileUtils.mkdir_p(icon_path)\n end\n\n # create the file path\n full_path = File.join(icon_path, icon_name)\n\n icon.write(\"png:\"+ full_path)\n\n rescue Exception => e\n putsE(e)\n return false\n end\n\n return true\n end", "title": "" }, { "docid": "73ec9462fb6fee4c1dc657583ce9b41d", "score": "0.6170078", "text": "def create_image(title, description, parent_id, mime_type, file_name)\n\t insert_file(title, description, parent_id, 'application/vnd.google-apps.video', file_name)\n\tend", "title": "" }, { "docid": "78547237c2d95368e70d97c8be2347af", "score": "0.6150181", "text": "def postEntityImage( entity_id, filedata, image_name)\n params = Hash.new\n params['entity_id'] = entity_id\n params['filedata'] = filedata\n params['image_name'] = image_name\n return doCurl(\"post\",\"/entity/image\",params)\n end", "title": "" }, { "docid": "f28ef962ae8f48fc0ced29514d202222", "score": "0.61439335", "text": "def create_image_frame(request)\n http_request = request.to_http_info(@api_client.config)\n make_request(http_request, :POST, 'File')\n end", "title": "" }, { "docid": "074e01d90247121421fd63484e2ffb2d", "score": "0.6143416", "text": "def create\n if params[:post][:picture_base64].present?\n /data:image\\/(.*);base64,/ =~ params[:post][:picture_base64]\n ext = $1\n data = params[:post][:picture_base64].gsub(/data:image\\/.*;base64,/, '')\n file = Tempfile.new([\"post_picture\", \".#{ext}\"])\n file.binmode\n file.write(Base64.decode64 data)\n params[:post][:picture] = file\n end\n\n @post = Post.new(params[:post])\n\n if @post.save\n redirect_to @post, :notice => 'Post was successfully created.'\n else\n render :action => \"new\"\n end\n\n file.close if params[:post][:picture_base64].present?\n end", "title": "" }, { "docid": "d05c4295c80097bbf5134ee48023a8e1", "score": "0.6119093", "text": "def bike_image=(file_data)\n @file_data = file_data\n end", "title": "" }, { "docid": "98f9d0384a9071c66e14c350f462109a", "score": "0.61123466", "text": "def create\n uploaded_io = params[:image][:content]\n\n @image = Image.new do |image|\n image.name = uploaded_io.original_filename\n image.content_type = uploaded_io.content_type\n image.content = uploaded_io.read\n end\n\n\n respond_to do |format|\n if @image.save\n format.html { redirect_to @image, notice: 'Image was successfully created.' }\n format.json { render json: @image, status: :created, location: @image }\n else\n format.html { render action: \"new\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "590c56bf3a1c46d8fc2ac1c89f8eed20", "score": "0.60803026", "text": "def img_encode_base64(data)\n content_type = data.content_type.split('/')\n return nil unless content_type[0] == 'image' &&\n ['jpeg', 'png', 'gif'].include?(content_type[1])\n\n \"data:image/#{content_type[1]};base64, #{Base64.encode64(data.read)}\"\n end", "title": "" }, { "docid": "5caa6289b914ba1784b151720a0c4d56", "score": "0.6077377", "text": "def create\n\n if negocio_params[:imagen] == nil\n base64 = \"\"\n elsif negocio_params[:imagen] == \"\"\n base64 = \"\"\n else\n base64 = negocio_params[:imagen]\n base64.slice!('data:image/png;base64,')\n end\n\n @negocio = Negocio.new(negocio_params)\n\n respond_to do |format|\n if @negocio.save\n\n format.html { redirect_to @negocio, notice: 'Negocio was successfully created.' }\n format.json { render :show, status: :created, location: @negocio }\n else\n format.html { render :new }\n format.json { render json: @negocio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a2b90b8d2999a6d68ff9af7e48e4a981", "score": "0.60646564", "text": "def encoded_picture\n \"data:image/#{self.extension};base64,#{File.open('public/images/' + self.picture,'rb').read}\"\n end", "title": "" }, { "docid": "7312e733100a82d9b99f59678fc69603", "score": "0.6054008", "text": "def create\n # For uploadify\n if params['Filedata']\n @image = Image.new(:uploadify_file => params['Filedata'])\n @image.user = current_user\n if @image.save\n flash[:success] = t(:image_created)\n flash[:image_id] = @image.id\n render :text => flash.to_json, :status => 200\n else\n flash[:error] = t(:image_create_error)\n render :text => flash[:error], :status => 500 \n end\n else\n @image = Image.new(params[:image])\n @image.user = current_user\n respond_to do |format|\n if @image.save\n flash[:notice] = t(:image_created)\n format.html { redirect_back_or_default(admin_image_path(@image)) }\n format.xml { render :xml => @image, :status => :created, :location => @image }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @image.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "6a1cb22a33b9913488b935b52ea6f78c", "score": "0.60508466", "text": "def register_new_image(image, xml_node, data_item)\n image.set_path(data_item)\n image.is_new = true\n image.id, image.target = @relationship_manager.new_relationship(:image, image.path)\n image.replace_new_image_id!(xml_node, data_item)\n @images << image\n image\n end", "title": "" }, { "docid": "c57d15af4cc7229968ad87b3d4a6d907", "score": "0.6040406", "text": "def create\n @image = Image.new(name: image_params[\"name\"], picture: image_params[\"picture\"], image_file_name:image_params[\"image_file_name\"], user_id: current_user.id)\n if @image.save\n redirect_to images_path\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "a0edcec95e5d091debd05b643d64ff96", "score": "0.6026149", "text": "def create_image(name, options = {})\n ImageCollection.new(:config => config).\n create(options.merge(:instance_id => id,\n :name => name))\n end", "title": "" }, { "docid": "227959f6fe03227beb091c393e18d772", "score": "0.60238487", "text": "def add_image( id, image_name, x_position, speed, width, height )\n OSX::NSLog(\"Received image ##{id} (#{image_name})\")\n# image_name = OSX::NSBundle.mainBundle.pathForImageResource( image_name )\n image_name = \"/Users/alpha/src/cyberart/images/#{image_name}.jpg\"\n image = CAImage.new( id, image_name, x_position, speed, width, height )\n @semaphore.synchronize { temp_images = @images.dup }\n temp_images << image\n @semaphore.synchronize { @images = temp_images }\n end", "title": "" }, { "docid": "48c2e93425f82ec0e6b398e8fec911a4", "score": "0.60199034", "text": "def upload_product_image(rid, add_params = nil)\n p_name = File.basename(file_name)\n fh = File.open(file_name,'r')\n file = {\n :filename => p_name,\n :content => Base64.encode64(fh.read)\n }\n params = {\n uid: uid,\n rid: rid,\n }\n add_params[:file] = file\n add_params[:send_xml] = true\n api_call('/stores/:uid/products/:rid/images/upload(.:format)',:post,params,add_params)\n end", "title": "" }, { "docid": "a7e7f4bb9b03ea931cc2343c6eea2cdf", "score": "0.60181797", "text": "def base64_logo=(data)\n io = Base64FileUpload.new(data)\n self.logo = io\n end", "title": "" }, { "docid": "8cf73425743521bd478bcf3754c936e4", "score": "0.6017442", "text": "def gv_make_image(name=nil)\n return unless gv_object\n name = gv_object.name unless name\n file = \"#{name}.png\"\n gv_object.output(:png => file)\n file\n end", "title": "" }, { "docid": "ccbd106192c07a1c1be34b2a421145ec", "score": "0.5994144", "text": "def build_empty_image\n {\n id: id, src: '', displayPath: '', thumbnail: '',\n thumbnailWidth: 127, thumbnailHeight: 180,\n caption: '', isSelected: false, editPath: '', mimeType: ''\n }\n end", "title": "" }, { "docid": "ccbd106192c07a1c1be34b2a421145ec", "score": "0.5994144", "text": "def build_empty_image\n {\n id: id, src: '', displayPath: '', thumbnail: '',\n thumbnailWidth: 127, thumbnailHeight: 180,\n caption: '', isSelected: false, editPath: '', mimeType: ''\n }\n end", "title": "" }, { "docid": "9b95397a4aaf7108ffe0a3b545a18d38", "score": "0.5984945", "text": "def update_imagem(foto_64)\n foto_64 = \"data:image/jpeg;base64,#{foto_64}\"\n if foto_64 != \"\" && foto_64 != nil\n base_64_encoded_data = foto_64\n string_img = Base64.decode64(base_64_encoded_data['data:image/png;base64,'.length .. -1])\n File.open(\"#{Rails.root}/tmp/motorista2.jpg\", \"wb\") do |file| \n file.write(string_img)\n file.size\n self.imagem = file\n end\n end\n end", "title": "" }, { "docid": "eea0ac4f75001d420fd02e2122e68211", "score": "0.59830534", "text": "def create_image(image)\n self.images.create(image: image) if image.present?\n end", "title": "" }, { "docid": "9874e539f685eea8af11c428e97d4867", "score": "0.5967306", "text": "def parse_image_data(image_data)\n @tempfile = Tempfile.new('item_image')\n @tempfile.binmode\n @tempfile.write Base64.decode64(image_data[:content])\n @tempfile.rewind\n\n uploaded_file = ActionDispatch::Http::UploadedFile.new(\n tempfile: @tempfile,\n filename: image_data[:filename]\n )\n\n uploaded_file.content_type = image_data[:content_type]\n uploaded_file\n end", "title": "" }, { "docid": "40f85c10e30d153056c31670b712df51", "score": "0.5965403", "text": "def new \n @image = Image.new\n end", "title": "" }, { "docid": "d38a387b5bff815a193462e10b5f22d8", "score": "0.59613407", "text": "def create\n @weight_event = WeightEvent.new(weight_event_params)\n raw_image_file = params[:weight_event][:image_file]\n if raw_image_file\n @weight_event.image_file = ImageFile.create(data: raw_image_file.read)\n end\n\n respond_to do |format|\n if @weight_event.save\n format.html { redirect_to @weight_event, notice: 'Weight event was successfully created.' }\n format.json { render :show, status: :created, location: @weight_event }\n else\n format.html { render :new }\n format.json { render json: @weight_event.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e287e47e9a9cfda570623d550c4776dc", "score": "0.5957819", "text": "def parse_image_data(image_data)\n @tempfile = Tempfile.new('item_image')\n @tempfile.binmode\n @tempfile.write Base64.decode64(image_data[:content])\n @tempfile.rewind\n\n uploaded_file = ActionDispatch::Http::UploadedFile.new(\n tempfile: @tempfile,\n filename: image_data[:filename]\n )\n\n uploaded_file.content_type = image_data[:content_type]\n uploaded_file\n end", "title": "" }, { "docid": "878b1fec98a00f562872e6788753bdf6", "score": "0.5955473", "text": "def create\n image_data = Base64.decode64(params[:image_data])\n image_data = image_data.gsub('data:image/jpeg;base64,', '')\n file_name = Digest::MD5.hexdigest(image_data)\n file_path = \"/tmp/#{file_name}.jpeg\"\n f=open(file_path, \"wb\") \n f.puts(image_data) \n f.close\n\n f = open(file_path, \"rb\")\n uploader = ImageUploader.new\n uploader.store!(f)\n \n\n @camera = Camera.new\n @camera.image_url = uploader.filename\n\n user = current_user\n @camera.user_id = user.id\n @camera.camera_place_id = params[:camera_place_id]\n\n respond_to do |format|\n if @camera.save\n format.html { redirect_to @camera, notice: 'Camera was successfully created.' }\n format.json { render json: @camera, status: :created, location: @camera }\n else\n format.html { render action: \"new\" }\n format.json { render json: @camera.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4af851c1d7dd79dcad9dc6ec235a50cb", "score": "0.5953744", "text": "def image_creation(image_name)\n image_path = Rails.root.join('public', 'images', image_name).to_s\n uploader = Dragonfly[:images]\n uploaded_image = uploader.fetch_file(image_path)\n image = Image.create image: uploaded_image\n\n rescue Error => e\n print \"Error creating image: \" + e\nend", "title": "" }, { "docid": "6fe50ef46c77a7d27b3c8558a06cbde3", "score": "0.5940995", "text": "def decode_image(data)\r\n\r\n data_index = data.index('base64') + 7\r\n filedata = data.slice(data_index, data.length)\r\n decoded_image = Base64.decode64(filedata)\r\n\r\n end", "title": "" }, { "docid": "0ab2970745c099881c197e473580d1a1", "score": "0.59302074", "text": "def create\n @product = Product.new(params[:product])\n\n\ttmp = params[:product][:image_name].tempfile\n\t\n\t\n\ttype = params[:product][:image_name].content_type\n\t\n\t\n\t\n \n file = File.join(\"public/resources/images\", params[:product][:image_name].original_filename)\n \n # write the file\n File.open(file, \"wb\") { |f| f.write(params[:product][:image_name].read) }\n\t\n\t@product.image_name = \"resources/images/\" + params[:product][:image_name].original_filename\n\t\n\t\n respond_to do |format|\n if @product.save\n format.html { redirect_to @product, :notice => 'Product was successfully created.' }\n format.json { render :json => @product, :status => :created, :location => @product }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a98cd5a04e40a8975717fd74155ef993", "score": "0.59271103", "text": "def create\n # For uploadify (multi-upload)\n if params['Filedata']\n @image = Image.new(:uploadify_file => params['Filedata'])\n respond_to do |format|\n if @image.save\n flash[:success] = 'Image was successfully created.'\n flash[:image_id] = @image.id\n format.html { render :text => flash.to_json, :status => 200 }\n else\n flash[:error] = 'There was an error creating the image.'\n format.html { render :text => flash[:error], :status => 500 }\n end\n end\n else\n # For normal upload\n @image = Image.new(params[:image])\n\n respond_to do |format|\n if @image.save\n flash[:notice] = 'Image was successfully created.'\n format.html { redirect_to(@image) }\n format.xml { render :xml => @image, :status => :created, :location => @image }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @image.errors, :status => :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "818e7c28ea5666ed8c6c737b78fc614e", "score": "0.59261125", "text": "def image\n Pathname.new(\"#{PATH}#{self.path}\").open{|file|\n return Base64.strict_encode64(file.read)\n }\n end", "title": "" }, { "docid": "7011ebc39624665c686f4f89f833f0b7", "score": "0.5924435", "text": "def create_deskewed_image(request)\n http_request = request.to_http_info(@api_client.config)\n make_request(http_request, :POST, 'File')\n end", "title": "" }, { "docid": "777b972c963694f7ea0837668cde4139", "score": "0.5917628", "text": "def decode_image(filename, data)\n\n data_index = data.index('base64') + 7\n filedata = data.slice(data_index, data.length)\n decoded_image = Base64.decode64(filedata)\n\n end", "title": "" }, { "docid": "9fc16146487c54811128a3664526a71d", "score": "0.58891773", "text": "def create\n par = img_properties\n logger.info(\"parameters: #{par.inspect}\")\n valid = true\n\n begin\n url = par[:original_url] || par[:url]\n\n @image = Image.new do |i|\n #specify all properties to copy explicitly\n i.user = @user\n # set optional parameters\n i.name = par[:name] if !par[:name].blank?\n i.ref = par[:ref] if !par[:ref].blank?\n i.original_url = url if url\n i.page_url = par[:page_url] if !par[:page_url].blank?\n i.source = par[:source] if !par[:source].blank?\n i.image_type = Image::TYPE_LS\n end\n\n # this may fail\n @image.remote_upload_url = url\n\n # set calibration data if specified\n if !par[:calibrate_length].blank?\n @image.calibrate_length = par[:calibrate_length].to_f\n @image.calibrate_unit = par[:calibrate_unit].to_i if !par[:calibrate_unit].blank?\n @image.calibrate_coords = par[:calibrate_coords] if !par[:calibrate_coords].blank?\n @image.ppi = calculate_ppi(@image)\n end\n\n rescue CarrierWave::DownloadError\n @image.errors.add(:remote_upload_url, \"^This url doesn't appear to be valid\")\n valid = false\n rescue CarrierWave::IntegrityError\n @image.errors.add(:remote_upload_url, \"^This url does not appear to point to a valid image\")\n valid = false\n rescue StandardError\n @image.errors.add(:remote_upload_url, \"There does not appear to be an image at this url\")\n valid = false\n end\n\n if valid && @image.save\n # update product if set\n @image.user_product = par[:product] if par[:product]\n\n render :json => @image.js_serialize, :callback => params[:callback]\n else\n render :json => { :error => 403, :messages => prepare_errors(@image), :callback => params[:callback]}, :status => 200\n end\n end", "title": "" }, { "docid": "8298426da4c5c0db965c02b764f69626", "score": "0.5886344", "text": "def parse(image_node)\n if image_node.attributes[\"data-filename\"].present?\n filename = image_node.attributes[\"data-filename\"].value\n encoded_data = image_node.attributes[\"src\"].value\n\n encoded_data[/base64,(.*)/]\n encoded_data = $1\n if encoded_data.present?\n begin\n decoded_data = Base64.decode64(encoded_data)\n #base_dir = ENV.fetch('FILE_STORE_DIR', \"uploads\")\n #if base_dir != \"uploads\"\n # public_uploads = File.join(Rails.root, \"public\", \"uploads\")\n # FileUtils.symlink(base_dir, public_uploads) unless File.symlink?(public_uploads)\n # base_dir = public_uploads\n #end\n #dir = \"#{base_dir}/#{Rails.env}/\"\n #FileUtils::mkdir_p dir\n #tempfile = File.open(dir + filename, 'wb')\n tempfile = Tempfile.new([filename.gsub(File.extname(filename), \"\"), File.extname(filename)])\n tempfile.binmode\n \n tempfile.write(decoded_data)\n tempfile.rewind\n image_node[\"data-filename\"] = filename\n image_node[\"src\"] = yield filename, tempfile\n ensure\n tempfile.unlink\n tempfile.close\n end\n else \n yield image_node.attributes[\"data-filename\"].value, nil\n end\n end\n end", "title": "" }, { "docid": "ae90eebb7a35c836251e632c42e09f35", "score": "0.5861103", "text": "def new\n\t\t@image = Image.new\n\tend", "title": "" }, { "docid": "ae90eebb7a35c836251e632c42e09f35", "score": "0.5861103", "text": "def new\n\t\t@image = Image.new\n\tend", "title": "" }, { "docid": "f9be2c9601448cd28ef2ed585f75f01e", "score": "0.58363557", "text": "def create\n @image = Image.new(params[:image])\n\t\t\n\t\tif (params[:image][:filename])\n \t#function in manage_images.rb\n \tprocess_image(tmp = params[:image][:filename].tempfile)\n\t\tend\n\n respond_to do |format|\n if @image.save\n format.html { redirect_to @image, notice: 'Image was successfully created.' }\n format.json { render json: @image, status: :created, location: @image }\n else\n format.html { render action: \"new\" }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5fadffb1b5fab80bd4f3b1a101bff628", "score": "0.5821309", "text": "def create image_url, page_url, x, y, h, w\n #@img = Img.create(image_url: image_url, page_url: page_url, x: x, y: y, h: h, w: w)\n end", "title": "" }, { "docid": "8b9ffbadb274d715284c2325550eef52", "score": "0.5815994", "text": "def new\n @image = Image.new\n end", "title": "" }, { "docid": "6881fd113628507d87608e7db1d8ecdb", "score": "0.5805092", "text": "def create\n @image = Image.new(image_params)\n @image.name = params[:image][:picture].original_filename\n @image.picture = params[:image][:picture].read\n\n respond_to do |format|\n if @image.save\n format.html { redirect_to images_path, success: 'Image was successfully created.' }\n format.json { render :show, status: :created, location: images_path }\n else\n format.html { render :new }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ea1dbccb661dd08fa84bc357bce757ff", "score": "0.58048886", "text": "def initialize(data)\n ir = ImageReader.new(data)\n @format = :png\n @width, @height = self.send(\"size_of_#{@format}\", ir)\n ir.close\n end", "title": "" }, { "docid": "8dce26a8e7c90a37aeb11309e23c4bb0", "score": "0.57930887", "text": "def initialize image_base64\n @image_base64 = image_base64\n @task_id ||= SecureRandom.random_number(1000000000)\n end", "title": "" }, { "docid": "a9cab032dc65e14b581a59731d9a3e74", "score": "0.5790254", "text": "def create_image_tag(request)\n http_request = request.to_http_info(@api_client.config)\n make_request(http_request, :POST, nil)\n nil\n end", "title": "" }, { "docid": "6075a53afaa04462d37537e8aebfaa0e", "score": "0.57889646", "text": "def decode_base64_string(filename, data)\n\n decoded_image = Base64.decode64(data)\n\nend", "title": "" }, { "docid": "6075a53afaa04462d37537e8aebfaa0e", "score": "0.57889646", "text": "def decode_base64_string(filename, data)\n\n decoded_image = Base64.decode64(data)\n\nend", "title": "" }, { "docid": "bb7cc29ed6e6e88409974e03720329fc", "score": "0.57882273", "text": "def data_uri(image)\n mime_type = image.svg? ? 'image/svg+xml' : image.mime_type\n \"'data:#{mime_type};base64,#{Base64.encode64(image.blob).gsub(/\\r?\\n/, '')}'\"\n end", "title": "" }, { "docid": "b0a18aa93e3da4712e9f0d03793eecff", "score": "0.5782494", "text": "def create_updated_image(request)\n http_request = request.to_http_info(@api_client.config)\n make_request(http_request, :POST, 'File')\n end", "title": "" }, { "docid": "58c2be2532a7f1d135e2b9dba3f5af87", "score": "0.5755476", "text": "def element\n image_name_list = get_image_name_list ORIGINALS_PATH\n image_name_list.each { |image_name| post(image_name) }\n end", "title": "" }, { "docid": "3cda172855d526aed8137c8c0994f0fa", "score": "0.57505304", "text": "def create_temp_with_image\n image, filename, content_type = create_image\n temp = TempImage.new\n temp.transaction do\n temp.image.attach(io: image, filename: filename, content_type: content_type) if temp.save\n end\n temp\n end", "title": "" }, { "docid": "bbf9c793e37ff512dd58a9d5fc86f3e3", "score": "0.5748686", "text": "def create\n\n\n @img_info = ImgInfo.new \n @img_info.img_url=upload_file(params[:img_info]['imgdata']);\n \n respond_to do |format|\n if @img_info.save\n flash[:notice] = 'ImgInfo was successfully created.'\n format.html { redirect_to(@img_info) }\n format.xml { render :xml => @img_info, :status => :created, :location => @img_info }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @img_info.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a56469bd0a2f23ffcc3f4a3a1eeacb68", "score": "0.57466173", "text": "def create\n photo_io = params[:photo][:path]\n if photo_io \n file_ext = File.extname(photo_io.original_filename)\n content = photo_io.read\n new_name = Digest::SHA1.hexdigest(content) + file_ext\n path = Rails.root.join('app','assets','images', new_name).to_path\n File.new(path,'w').syswrite(content)\n end\n @photo = Photo.new do |p|\n photo = params[:photo]\n p.name = photo[:name]\n p.path = new_name if new_name\n p.descrption = photo[:descrption]\n end\n respond_to do |format|\n if @photo.save\n format.html { redirect_to photos_url}\n format.json { render json: @photo, status: :created, location: @photo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @photo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "059345da1e3abfa680858b30e2d4fc99", "score": "0.57424706", "text": "def create\n @s3image = S3image.new(s3image_params)\n s3 = AWS::S3.new\n bucket = s3.buckets['mailmagezineimage']\n\n file = s3image_params[:file]\n fileName = file.original_filename\n\n object = bucket.objects[fileName]\n object.write(file, :acl => :public_read)\n imageUrl = \"https://s3-ap-northeast-1.amazonaws.com/mailmagezineimage/#{fileName}\"\n\n render :json => {'imageUrl' => imageUrl}\n end", "title": "" }, { "docid": "6aa7833d9cf05902381fa864acbd9618", "score": "0.57403076", "text": "def create_image_object\n @user = session_user!\n args = params[:image]\n image = create_and_upload_image(args)\n render_image(image, args)\n rescue StandardError => e\n render_errors(e.to_s, args)\n end", "title": "" }, { "docid": "292ff4fe7e412e6ef979e293b52f3089", "score": "0.57366", "text": "def image= value\n self.image_custom = value\n write_attribute :image_custom, value\n end", "title": "" }, { "docid": "1882a570e62aa5c277f62f530bb435b1", "score": "0.5731994", "text": "def create\n @image = Image.new(image_params)\n\n # fetch tags from google vision API\n helpers.fetch_tags(image_params)\n\n @image.image_file.attach(image_params[:image_file])\n\n respond_to do |format|\n if @image.save()\n format.html { redirect_to @image, notice: \"Image was successfully created.\" }\n format.json { render :show, status: :created, location: @image }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a1df831abd5019edeebbc65fe194de9c", "score": "0.5730434", "text": "def create\n @category = MasterCategory.new\n @category.category_name = params[:category][:category_name]\n @category.category_image = params[:category][:category_image]\n @category.is_active = \"1\"\n# data = StringIO.new(Base64.decode64(params[:category][:category_image]))\n# data.class.class_eval { attr_accessor :original_filename, :content_type }\n# data.original_filename = \"category_image.jpg\"\n# data.content_type = \"image/jpg\"\n# @category.category_image = data\n# @category.category_name = params[:category][:category_name]\n\n if @category.save\n redirect_to category_list_path\n flash[:notice] = \"Category add Successfully\"\n else\n render \"new\"\n end\n end", "title": "" }, { "docid": "61d0b5ead54caf2e31ea9ac88a0db896", "score": "0.5718171", "text": "def add_public_png(work, attributes)\n fs = FactoryGirl.create(:file_set,\n user: User.find_by(login: work.depositor),\n title: ['A contained PNG file'],\n label: 'world.png',\n visibility: Hydra::AccessControls::AccessRight::VISIBILITY_TEXT_VALUE_PUBLIC)\n\n file_path = \"#{Rails.root}/spec/fixtures/world.png\"\n IngestFileJob.perform_now(fs, file_path, attributes.user)\n fs.original_file.mime_type = 'image/png'\n fs.original_file.save\n\n work.ordered_members << fs\n work.thumbnail_id = fs.id\n work.representative_id = fs.id\n work.save\n end", "title": "" }, { "docid": "a5db6b50ab714244b810438802744b32", "score": "0.5703755", "text": "def create\n @icon = Icon.new\n @icon.name_icon = params[:icon][:name_icon]\n\n if params[:icon][:image_icon].present?\n @icon.image_icon = params[:icon][:image_icon].original_filename\n @icon.image_type = params[:icon][:image_icon].content_type\n @icon.image_binary = params[:icon][:image_icon].read\n end\n\n if @icon.save\n redirect_to icons_path\n else\n render :new\n end\n end", "title": "" }, { "docid": "ae5d5a3c885183821f3663b12332b3d7", "score": "0.56886524", "text": "def create\r\n @family = Family.new(family_params)\r\n @image = @family.images.new\r\n @image.generate_filename\r\n @uploaded_io = params[:family][:uploaded_file]\r\n\r\n File.open(Rails.root.join('public', 'images', @image.filename), 'wb') do |file|\r\n file.write(@uploaded_io.read)\r\n end\r\n\r\n respond_to do |format|\r\n if @family.save\r\n format.html { redirect_to @family, notice: 'Family was successfully created.' }\r\n format.json { render :show, status: :created, location: @family }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @family.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "29ce856aaef11d4984737248938965a0", "score": "0.56884044", "text": "def create_image(name, metadata = {})\n requires :id\n response = service.create_image(id, name, metadata)\n begin\n image_id = response.headers[\"Location\"].match(/\\/([^\\/]+$)/)[1]\n Fog::Compute::HPV2::Image.new(:collection => service.images, :service => service, :id => image_id)\n rescue\n nil\n end\n end", "title": "" }, { "docid": "c021b5fdc5a369b8c74a564179b572cb", "score": "0.5682926", "text": "def add_image \n image = CARMD.image(self.vin)\n if image == \"\"\n image = \"http://clipart-library.com/img/2050778.png\"\n end\n self.auto_image = image \n self.save \n end", "title": "" }, { "docid": "a7fb115a56c516577b78a1c3bff8ac5e", "score": "0.5681104", "text": "def image=(string)\n binding.pry\n o = Base64.decode64 string\n self.path = self.path||(SecureRandom.hex(20)+\".jpg\")\n File.open(\"#{PATH}#{self.path}\", \"w+\"){|file|\n file.write(string)\n }\n end", "title": "" }, { "docid": "2e08c0d0923fb7b77bb0315e00f96c07", "score": "0.5678241", "text": "def default_photo\n file_path = File.join(Rails.root, 'public', 'images', 'small', 'trip_default_image.png')\n base64_image = Base64.encode64(File.read(file_path))\n \"data:image/jpg;base64,#{base64_image}\"\n end", "title": "" }, { "docid": "a9b40bc6b96f76b177c5d943ea007e74", "score": "0.5676982", "text": "def create\n @image = Image.create(image_params)\n @image.save\n\n end", "title": "" }, { "docid": "d9a96782f946968a37363d50dbf0e637", "score": "0.56766033", "text": "def postBusiness_toolImage( tool_id, filedata)\n params = Hash.new\n params['tool_id'] = tool_id\n params['filedata'] = filedata\n return doCurl(\"post\",\"/business_tool/image\",params)\n end", "title": "" }, { "docid": "857d4a32b69c717a432cf2a08b316a9b", "score": "0.5675216", "text": "def create_image_object\n user = get_session_user!\n image_args = params[:image]\n\n original_name = image_args[:original_name].to_s\n original_name = \"\" if user && user.keep_filenames == :toss\n\n img_when = Date.new(image_args[:when][(\"1i\")].to_i,\n image_args[:when][(\"2i\")].to_i,\n image_args[:when][(\"3i\")].to_i)\n\n errors = []\n begin\n # TODO: handle invalid date\n image = Image.new(\n created_at: Time.now,\n user: user,\n when: img_when,\n license_id: image_args[:license].to_i,\n notes: image_args[:notes],\n copyright_holder: image_args[:copyright_holder],\n original_name: original_name\n )\n\n if image_args[:url].blank?\n image.image = image_args[:upload]\n else\n image.upload_from_url(image_args[:url])\n end\n\n if !image.save || !image.process_image\n errors += image.formatted_errors\n end\n rescue => e\n errors << e.to_s\n end\n\n if errors.any?\n name = original_name\n name = \"##{image.id}\" if name.empty?\n errors.unshift(:runtime_no_upload_image.t(name: name))\n logger.error(\"UPLOAD_FAILED: #{errors.inspect}\")\n render(text: errors.join(\"\\n\").strip_html, status: 500, layout: false)\n else\n name = original_name\n name = \"##{image.id}\" if name.empty?\n flash_notice(:runtime_image_uploaded.t(name: name))\n render(json: image)\n end\n ensure\n image.try(&:clean_up)\n end", "title": "" }, { "docid": "3b1d2fc73bf7f815b8b00953e0784087", "score": "0.567421", "text": "def call(data, aws_fname)\n client = Aws::S3::Client.new(region: credentials(:region),\n secret_access_key: credentials(:secret_access_key),\n access_key_id: credentials(:access_key_id))\n\n @object_key = \"#{BUCKET_FOLDER}/#{aws_fname}#{IMAGE_EXT}\"\n s3 = Aws::S3::Resource.new(client: client)\n obj = s3.bucket(credentials(:aws_bucket)).object(@object_key)\n # upload string in I/O stream, avoiding need to save it locally as tmp file\n obj.put(body: data, content_type: \"image/svg+xml\")\n # make file public\n # https://docs.aws.amazon.com/sdkforruby/api/Aws/S3/Client.html#put_object_acl-instance_method\n client.put_object_acl(bucket: credentials(:aws_bucket),\n grant_read: \"uri=http://acs.amazonaws.com/groups/global/AllUsers\",\n key: @object_key)\n s3_file_path\n end", "title": "" }, { "docid": "336f590c550c1100b1a94ba0152b0635", "score": "0.5671914", "text": "def build(resource, attachment_name, attributes={})\n @resource = resource\n @attachment_name = attachment_name\n title = attributes.delete(:title) || attachment_name.to_s\n add_class \"paperclip\"\n super title, attributes \n \n # attachment = (@resource.respond_to? @attachment_name.to_sym) ? @resource.send(@attachment_name.to_sym) : nil\n # image_table_for attachment, attributes\n image_table_for @resource, @attachment_name, attributes\n end", "title": "" }, { "docid": "25ea538b8546a607665b437af8d801ba", "score": "0.5670315", "text": "def decode_image_data(img_data,fname)\n cid = URI.unescape(img_data)\n filename = fname\n file = File.open(\"#{Rails.root.to_s}/public/tmp/#{filename}.jpg\",\"wb\")\n temp2 = ActiveSupport::Base64.decode64(cid)\n file.write(temp2)\n file.close\n f = File.open(\"#{Rails.root.to_s}/public/tmp/#{filename}.jpg\")\n self.avatar = f\n f.close\n File.delete(\"#{Rails.root.to_s}/public/tmp/#{filename}.jpg\")\n end", "title": "" }, { "docid": "42b128fd055f0be277c0329779ecbb67", "score": "0.56666183", "text": "def image; end", "title": "" }, { "docid": "c88a198cd92ae66a7e9ddf24b7887fdb", "score": "0.56614226", "text": "def postToolsImage( filedata, type)\n params = Hash.new\n params['filedata'] = filedata\n params['type'] = type\n return doCurl(\"post\",\"/tools/image\",params)\n end", "title": "" }, { "docid": "68711a25347531a02fb88d0bc79af914", "score": "0.5661366", "text": "def create_image_with_local(name, type, container_uuid, path)\n @logger.debug(\"Creating image from file path #{path}\")\n container_id = JSON.parse(\n @client.get('v2.0', \"storage_containers/#{container_uuid}\")\n )['id'].split('::').last\n @logger.debug(\"Container ID is #{container_id}\")\n spec = { name: name, image_type: type, annotation: name }\n @logger.debug(\"Image creation specs => #{spec}\")\n task = JSON.parse(@client.post('v2.0', 'images', spec.to_json))\n task_uuid = task['task_uuid']\n image_uuid = TaskManager.wait_on_task(task_uuid, @client, @logger)\n task = JSON.parse(\n @client.put('v0.8', \"images/#{image_uuid}/upload\",\n File.open(path), nil,\n { 'X-Nutanix-Destination-Container' => container_id })\n )\n task_uuid = task['task_uuid']\n # Timeout is set to 60 minutes as image upload may take time\n TaskManager.wait_on_task(task_uuid, @client, @logger, 60 * 60)\n image_uuid\n rescue => e\n raise e\n end", "title": "" }, { "docid": "436ae644a71870dd0a4d4593a642dfa7", "score": "0.56530184", "text": "def create\n @image = Image.new(image_params)\n @image.ip = ip2long request.remote_ip\n @image.delete_code = (0...50).map { ('a'..'z').to_a[rand(26)] }.join\n @image.homepage = false\n @image.save\n end", "title": "" }, { "docid": "44a93ed8550dcc9aa902198c0a358587", "score": "0.5648959", "text": "def swfupload_file=(data)\r\n data.content_type = MIME::Types.type_for(data.original_filename).to_s if data\r\n self.image = data\r\n end", "title": "" }, { "docid": "3b4fb64c50b7cc5ee5306cecd70e5ed0", "score": "0.56484914", "text": "def image\n return unless object.image.attached?\n\n # object.image.blob.attributes\n # .slice('filename', 'byte_size')\n # .merge(url: image_url)\n # .tap { |attrs| attrs['name'] = attrs.delete('filename') }\n object.image.service_url\n \n end", "title": "" }, { "docid": "d46492f3fdc127bb3198780f81245f4c", "score": "0.5647649", "text": "def create_grid_attachment(name,file)\n data = case\n when file.is_a?(Hash)\n file[:tempfile].read\n else\n file.respond_to?(:read) ? file.read : file\n end\n grid.put(\n data,\n :filename => read_attribute(\"#{name}_name\"),\n :content_type => read_attribute(\"#{name}_type\"),\n :_id => read_attribute(\"#{name}_id\")\n )\n create_attachment_queue.delete(name)\n end", "title": "" }, { "docid": "85373797bd3d931a9f346267ed39eddd", "score": "0.56466997", "text": "def post(original_name)\n img = Magick::ImageList.new(original_name)\n if check? img\n element_name = ELEMENTS_PATH + File.basename(original_name)\n export(img, element_name)\n else\n File.delete original_name\n end\n img.destroy!\n end", "title": "" }, { "docid": "81b4026123730a58b20b97c76a7cfd13", "score": "0.5646672", "text": "def profile_image=(file_data)\n @file_data = file_data\n end", "title": "" }, { "docid": "8279a9fd52fb28f8cc8f7bda391e1691", "score": "0.564328", "text": "def upload_image(file, name = nil)\n io = (file.is_a?(IO) ? file : File.open(file, \"r\"))\n type = FastImage.type(io)\n payload = Faraday::UploadIO.new(io, \"image/#{type}\")\n\n params = {file: payload, header: (name ? 0 : 1), img_type: type}\n params[:name] = name if name\n post(\"/r/#{display_name}/api/upload_sr_img\", params).body[:img_src]\n end", "title": "" }, { "docid": "fd50ac2ba4616221fc65087a9b99628b", "score": "0.5642887", "text": "def create\n file = Tempfile.new(\"oneimage-#{resource[:name]}\")\n File.chmod(0644, file.path)\n\n template = ERB.new <<-EOF\nNAME = \"<%= resource[:name] %>\"\n<% if resource[:description] %>DESCRIPTION = \"<%= resource[:description] %>\"<% end%>\n<% if resource[:type] %>TYPE = <%= resource[:type].upcase %><% end%>\n<% if resource[:persistent] %>PERSISTENT = <%= resource[:persistent] %><% end%>\n<% if resource[:dev_prefix] %>DEV_PREFIX = \"<%= resource[:dev_prefix] %>\"<% end%>\n<% if resource[:driver] %>DRIVER = \"<%= resource[:driver] %>\"<% end %>\n<% if resource[:path] %>PATH = <%= resource[:path] %><% end%>\n<% if resource[:source] %>SOURCE = <%= resource[:source] %><% end%>\n<% if resource[:fstype] %>FSTYPE = <%= resource[:fstype] %><% end%>\n<% if resource[:size] %>SIZE = <%= resource[:size] %><% end%>\nEOF\n\n tempfile = template.result(binding)\n self.debug \"Creating image using tempfile: #{tempfile}\"\n file.write(tempfile)\n file.close\n output = \"oneimage create -d #{resource[:datastore]} #{file.path} \", self.class.login\n `#{output}`\n end", "title": "" }, { "docid": "0e0d618afea2e53be5454cf6d00bd235", "score": "0.564091", "text": "def image_params\n params.require(:data).require(:attributes).permit(:title, :data_uri, :user_id)\n end", "title": "" }, { "docid": "791a8a287b17dcf81b1ddd2fd4217668", "score": "0.56376743", "text": "def image\n end", "title": "" }, { "docid": "791a8a287b17dcf81b1ddd2fd4217668", "score": "0.56376743", "text": "def image\n end", "title": "" }, { "docid": "7158686e1c77716c39c42381f6dfc492", "score": "0.56345785", "text": "def store_image\n if @file_data\n FileUtils.mkdir_p Img_Store\n File.open(image_filename, 'wb') do |f|\n f.write (@file_data.read)\n end\n @file_data = nil\n end\n end", "title": "" } ]
ca0390256cb781c68c57a858d7fef8dc
Toggle rendering, enabling it if it was disabled, and viceversa.
[ { "docid": "3092d6aeb1c2de1a1ad500e3e0e14a9f", "score": "0.8671269", "text": "def toggle_rendering\n\t\t@rendering_enabled = !@rendering_enabled\n\tend", "title": "" } ]
[ { "docid": "a0a465ad921c5fbaf1062ff087bb04a8", "score": "0.7332668", "text": "def enable_rendering\n\t\t@rendering_enabled = true\n\tend", "title": "" }, { "docid": "7735206c60a8a31e97093a12da649662", "score": "0.69366026", "text": "def disable_rendering\n\t\t@rendering_enabled = false\n\tend", "title": "" }, { "docid": "5380b317ba0ecf63d01b8f463a670dc9", "score": "0.66944295", "text": "def before_rendering( renderstate )\n\t\tif renderstate.tag_data[ :rendering_was_enabled ]\n\t\t\tself.log.debug \" rendering was previously enabled: disabling\"\n\t\t\trenderstate.disable_rendering\n\t\telse\n\t\t\tself.log.debug \" rendering was previously disabled: enabling\"\n\t\t\trenderstate.tag_data[ :rendering_was_enabled ] = true\n\t\t\trenderstate.enable_rendering\n\t\tend\n\n\t\treturn nil\n\tend", "title": "" }, { "docid": "525d465d5a95e3a8768038558f69a4b9", "score": "0.64488596", "text": "def rendering_enabled?\n\t\treturn @rendering_enabled ? true : false\n\tend", "title": "" }, { "docid": "4ee48e6d5e525f91595a842c3aa5b1eb", "score": "0.6259498", "text": "def before_rendering( renderstate )\n\n\t\tevaluated_state = self.evaluate( renderstate )\n\t\tevaluated_state = ! evaluated_state if self.inverted\n\n\t\tif renderstate.tag_data[ :rendering_was_enabled ]\n\t\t\tself.log.debug \"Rendering was previously enabled; disabling\"\n\t\t\trenderstate.disable_rendering\n\t\telsif evaluated_state\n\t\t\tself.log.debug \"Rendering was previously disabled, and condition is true; enabling\"\n\t\t\trenderstate.tag_data[ :rendering_was_enabled ] = true\n\t\t\trenderstate.enable_rendering\n\t\tend\n\n\t\treturn nil\n\tend", "title": "" }, { "docid": "6539d8d600c469b8b4a3b3c245bbfac0", "score": "0.613405", "text": "def render( renderstate )\n\n\t\tevaluated_state = self.evaluate( renderstate )\n\t\tevaluated_state = ! evaluated_state if self.inverted\n\n\t\t# Start out with rendering enabled if the tag body evaluates trueishly\n\t\tif evaluated_state\n\t\t\tself.log.debug \"Initial state was TRUE; enabling rendering\"\n\t\t\trenderstate.enable_rendering\n\t\telse\n\t\t\tself.log.debug \"Initial state was FALSE; disabling rendering\"\n\t\t\trenderstate.disable_rendering\n\t\tend\n\n\t\t# Set the tag state to track whether or not rendering has been enabled during the\n\t\t# 'if' for an 'else' or 'elsif' tag.\n\t\trenderstate.with_tag_data( rendering_was_enabled: renderstate.rendering_enabled? ) do\n\t\t\tsuper\n\t\tend\n\n\t\trenderstate.enable_rendering\n\t\treturn nil\n\tend", "title": "" }, { "docid": "b21b4e7dfe1a48b91abf27aa78d06504", "score": "0.6095907", "text": "def toggle\n if on?\n off\n else\n on\n end\n end", "title": "" }, { "docid": "9e8756ab6a2e6ba18e4c680cfb19659c", "score": "0.60773265", "text": "def enable(thing)\n toggle.enable(thing)\n end", "title": "" }, { "docid": "898d582b77feacaac962093202d834a6", "score": "0.5883935", "text": "def render( state )\n\n\t\tevaluated_state = self.evaluate( state )\n\t\tevaluated_state = ! evaluated_state if self.inverted\n\n\t\t# Start out with rendering *disabled* if the tag body evaluates trueishly\n\t\tif evaluated_state\n\t\t\tself.log.debug \"Initial state was TRUE; disabling rendering\"\n\t\t\tstate.disable_rendering\n\t\telse\n\t\t\tself.log.debug \"Initial state was FALSE; enabling rendering\"\n\t\t\tstate.enable_rendering\n\t\tend\n\n\t\t# Set the tag state to track whether or not rendering has been enabled during the\n\t\t# 'unless' for an 'else' tag.\n\t\tstate.with_tag_data( :rendering_was_enabled => state.rendering_enabled? ) do\n\t\t\tself.render_subnodes( state )\n\t\tend\n\n\t\tstate.enable_rendering\n\t\treturn nil\n\tend", "title": "" }, { "docid": "30dba818c364ae11a565b64a36abe87e", "score": "0.5740617", "text": "def toggle\n set_switch(!self.switch) if @switch\n end", "title": "" }, { "docid": "e25050a4bb2fd9d73bbaa0ecb12826c9", "score": "0.5721794", "text": "def enabled_state\n super\n end", "title": "" }, { "docid": "e25050a4bb2fd9d73bbaa0ecb12826c9", "score": "0.5721794", "text": "def enabled_state\n super\n end", "title": "" }, { "docid": "e25050a4bb2fd9d73bbaa0ecb12826c9", "score": "0.5721794", "text": "def enabled_state\n super\n end", "title": "" }, { "docid": "e25050a4bb2fd9d73bbaa0ecb12826c9", "score": "0.5721794", "text": "def enabled_state\n super\n end", "title": "" }, { "docid": "e25050a4bb2fd9d73bbaa0ecb12826c9", "score": "0.5721794", "text": "def enabled_state\n super\n end", "title": "" }, { "docid": "e25050a4bb2fd9d73bbaa0ecb12826c9", "score": "0.5721794", "text": "def enabled_state\n super\n end", "title": "" }, { "docid": "b5031bf88e2546739dcb550701361166", "score": "0.5707016", "text": "def toggle_state\n state\n end", "title": "" }, { "docid": "60768b69299315b427446ff4d8763bf3", "score": "0.5693752", "text": "def toggle\n\t\t@gridOn = !@gridOn\n\tend", "title": "" }, { "docid": "98a6a57c9a857f44ab66113fcc3d79ad", "score": "0.5631464", "text": "def toggle!\n if status\n off!\n return false\n else\n on!\n return true\n end\n end", "title": "" }, { "docid": "918ce1297aac7072b3d458d3612ce849", "score": "0.5577348", "text": "def toggle_state\n puts \"******* toggle_state *******\"\n end", "title": "" }, { "docid": "b5d4e5484e388ef1521def0b4b893d90", "score": "0.5540614", "text": "def enable!\n self.enabled = true\n end", "title": "" }, { "docid": "a32d8f4b0938cceff0743b46e693629f", "score": "0.55032206", "text": "def enabled!\n self\n end", "title": "" }, { "docid": "a04219ab096b46e5f1176147928890de", "score": "0.54970515", "text": "def enable_current\n @disabled = false\n end", "title": "" }, { "docid": "9951769682dd43d2478fa7688df68e6c", "score": "0.5476645", "text": "def render\n _button.btn.btn_primary request, onClick: self.click, disabled: @disabled\n end", "title": "" }, { "docid": "d9d50faad4bb3b5690ea128b0995776c", "score": "0.5459607", "text": "def toggle\n fire\n end", "title": "" }, { "docid": "4e76047bd0068997ad7fedbb7e1ca4ec", "score": "0.54582286", "text": "def toggle_selection\n buffer_current.toggle_selection\n update_status_line\n end", "title": "" }, { "docid": "f7fe9e243b029bebe5c61f4d29f1bdd6", "score": "0.5447271", "text": "def use_rendering_options?\n end", "title": "" }, { "docid": "99b35ef9fe92765ff82c5fe7d67738bd", "score": "0.5438135", "text": "def set_enabled\n\t\t\tself.enabled = true\n\t\tend", "title": "" }, { "docid": "3c82ec5cb17b543099d22375537807cd", "score": "0.5416174", "text": "def render?\n true\n end", "title": "" }, { "docid": "b8918d706aa8c4df8512cf30127f8e9a", "score": "0.54017603", "text": "def enable=(value); self.is_enable = value end", "title": "" }, { "docid": "f221b17f09128be3425968079783fb73", "score": "0.5389029", "text": "def toggle!\n if self.active?\n self.stop!\n else\n self.start!\n end\n end", "title": "" }, { "docid": "3c6ad8fedeb2f57ad63cad504c01c07c", "score": "0.5385339", "text": "def control_light\n if @is_toggled\n @is_emitting_light = true\n else\n @is_emitting_liht = false\n end\n end", "title": "" }, { "docid": "1f67d81f821164930f49dfe89158b7c5", "score": "0.5379507", "text": "def control_light\n if @is_toggled\n @is_emitting_light = true\n else\n @is_emitting_light = false\n end\n end", "title": "" }, { "docid": "4f936a832784b57790d704eb0f090d10", "score": "0.53769773", "text": "def disable\n @enabled = false\n disable_output_method if @output_method\n false\n end", "title": "" }, { "docid": "6045367b7a97bd24f5b9f1eb4c0da78e", "score": "0.5365445", "text": "def toggle_off\n set_state_to(:off)\n end", "title": "" }, { "docid": "2fb2087cdf025dccbec2a9c3e919b16a", "score": "0.53523487", "text": "def enable\n @enabled = true\n end", "title": "" }, { "docid": "717db20c1e8f43bce15520c71a0de503", "score": "0.53326917", "text": "def render?\n true\n end", "title": "" }, { "docid": "b55266bb799b9d50057089535963e847", "score": "0.5315947", "text": "def disable(thing)\n toggle.disable(thing)\n end", "title": "" }, { "docid": "5809e137900e06cf499a1a14df01272d", "score": "0.53105026", "text": "def disable\n @disabled = true\n end", "title": "" }, { "docid": "91bad3c38b0bf4fefc1afdc9d80c054d", "score": "0.53042644", "text": "def enabled\n @mutex.synchronize { !!@enabled }\n end", "title": "" }, { "docid": "91bad3c38b0bf4fefc1afdc9d80c054d", "score": "0.53042644", "text": "def enabled\n @mutex.synchronize { !!@enabled }\n end", "title": "" }, { "docid": "91bad3c38b0bf4fefc1afdc9d80c054d", "score": "0.53042644", "text": "def enabled\n @mutex.synchronize { !!@enabled }\n end", "title": "" }, { "docid": "0eb96dec9940edb34101b623ceaa63ad", "score": "0.5299102", "text": "def use_rendering_options=(setting)\n end", "title": "" }, { "docid": "0d1ae23a2664b731500f91457f0b6242", "score": "0.5283526", "text": "def toggle\n @toggle ||= toggle_class.new(self)\n end", "title": "" }, { "docid": "e484f34407acf628f977ff336f433b71", "score": "0.5268719", "text": "def toggle\n\t\t@toggle ||= Toggle.new(self)\n\tend", "title": "" }, { "docid": "56c95ced26dfdf7173cb6bc82e84d60a", "score": "0.52663004", "text": "def toggle\n write((read==HIGH) ? LOW : HIGH)\n end", "title": "" }, { "docid": "c595c3ed5c269dbe397fe41eeabf8b81", "score": "0.52546734", "text": "def disable!\n @disabled = true\n end", "title": "" }, { "docid": "e721a441ec7b4e06c3660bf624dc0c13", "score": "0.52405196", "text": "def enabled!\n self\n end", "title": "" }, { "docid": "75ffa1074c9f0c4ecc4a540debdef086", "score": "0.52241075", "text": "def toggle\n set_switch(!self.switch) if @switch\n method(@method).call(self.switch) if @method\n end", "title": "" }, { "docid": "1db40096da5f9243a3a3dfd28db78c09", "score": "0.52133405", "text": "def enable!\n @active = true\n change_status(:wait)\n end", "title": "" }, { "docid": "19596d40dc3db45038832c5e138fd1c7", "score": "0.51963425", "text": "def toggle\n return enabled? ? disable : enable if index.nonzero?\n board.toggle(:all)\n end", "title": "" }, { "docid": "b7e74ea047e7fa6a8c471e2629b2f938", "score": "0.519092", "text": "def disable\n @enabled = false\n end", "title": "" }, { "docid": "d47f2cdb68f6eeda8f96b5ced19e06ae", "score": "0.51861453", "text": "def disable!\n @active = false\n change_status(:disabled)\n end", "title": "" }, { "docid": "6df90edd26755420857957c3de63a6b9", "score": "0.5178619", "text": "def disabled!\n self\n end", "title": "" }, { "docid": "3779b8296cd3b62dc63961993f5153e2", "score": "0.517557", "text": "def toggle_scenario\n return unless request.post?\n scenario = @semester.scenarios.find(params[:id])\n if scenario.visible?\n scenario.visible = false\n else\n scenario.visible = true\n end\n if(scenario.save)\n render :update do |page|\n page.replace \"scenario-#{params[:id]}\", :partial => 'scenario', :locals => {:scenario => scenario}\n page.visual_effect :highlight, \"scenario-#{params[:id]}\"\n end\n else\n render :update do |page|\n page.visual_effect :shake, 'head'\n end\n end\n end", "title": "" }, { "docid": "5db3984aaf6fbbf06407d0ab4ff6b9fd", "score": "0.5165775", "text": "def disabled\n `#{@el}.disabled`\n end", "title": "" }, { "docid": "04cb08c11d2354ba8d4378eff9c9508b", "score": "0.5144369", "text": "def disable!\n self.enabled = false\n end", "title": "" }, { "docid": "7f04390b16c7e7723830f43564d34a44", "score": "0.51181793", "text": "def without_cache\n state = @enabled\n @enabled = false\n yield if block_given?\n @enabled = state\n end", "title": "" }, { "docid": "fdb9af0fb2b6095b6c08239bf7a1a1e7", "score": "0.5117381", "text": "def enable\n\n @enabled = true\n\n return self\n\n end", "title": "" }, { "docid": "ee58e269ed37c83f1375a96d5a11171f", "score": "0.51131874", "text": "def disable!\n @enabled = false\n end", "title": "" }, { "docid": "71026634470d6160a587dc19a9607de8", "score": "0.51117754", "text": "def disable!\n @enabled = false\n end", "title": "" }, { "docid": "10a2baed800602523c3bc32fcbe67a5e", "score": "0.510723", "text": "def format_radio\n @attr[:disabled] = :disabled\n super\n end", "title": "" }, { "docid": "10a2baed800602523c3bc32fcbe67a5e", "score": "0.510723", "text": "def format_radio\n @attr[:disabled] = :disabled\n super\n end", "title": "" }, { "docid": "86e4c4a573437e19d58cf5902ac5a87a", "score": "0.5080315", "text": "def toggle_featured!\n self.update_attribute(:featured, !self.featured?)\n self.featured?\n end", "title": "" }, { "docid": "f431e62a79919a2da712e848449949a2", "score": "0.5051176", "text": "def toggler\n render :update do |page|\n page['help'].toggle\n # page << \"if($('toggler').innerHTML == 'help'){\"\n # page << \"$('toggler').innerHTML = ' ';\"\n # page << \"}else{\"\n # page << \"$('toggler').innerHTML = 'help';\"\n # page << \"};return false;\"\n end\n end", "title": "" }, { "docid": "938139e7e15c245e062fa18bb6760c51", "score": "0.50398", "text": "def render(&block)\n self.renderer = block\n end", "title": "" }, { "docid": "505a55ba4e2eef7f0d5896155dacb2a0", "score": "0.50394094", "text": "def disable\n\n @enabled = false\n\n return self\n\n end", "title": "" }, { "docid": "68d231ed19ba969a1dd66d2196639c11", "score": "0.5033027", "text": "def toggle\n @done = !@done\n end", "title": "" }, { "docid": "2f78aa6d31205fef21e669f2cf900fc6", "score": "0.50222754", "text": "def enable\n end", "title": "" }, { "docid": "34a035c0bfc9a24ac459b0424f118c9d", "score": "0.50188065", "text": "def disabled(&_block)\n @disabled = true\n yield\n ensure\n @disabled = false\n end", "title": "" }, { "docid": "23e9e85f7143170314ba261d189c9d37", "score": "0.501719", "text": "def enable\n exclusively do\n @enabled = true\n @manual_toggle = true\n end\n\n save_state\n\n sync_control do\n start_upkeep unless upkeep_running?\n end\n end", "title": "" }, { "docid": "b4ab7b51207d4295c900eec108b1c6d9", "score": "0.50164264", "text": "def in_progressive_render\n @in_progressive_render = true\n yield\n @in_progressive_render = false\n end", "title": "" }, { "docid": "51def0fba6bd2c143568424665b60d35", "score": "0.5004781", "text": "def toggle\n cmd = \"{\\\"id\\\":7,\\\"method\\\":\\\"toggle\\\",\\\"params\\\":[]}\\r\\n\"\n request(cmd)\n end", "title": "" }, { "docid": "b37f65bcf42c003ef4d7d2fe1d9ee2de", "score": "0.49949712", "text": "def toggle!\n self.featured = !self.featured\n save\n end", "title": "" }, { "docid": "f44b1f2b4e01fe2a79b4a3b14d557160", "score": "0.49910522", "text": "def rendered?\n !!@render_opts\n end", "title": "" }, { "docid": "476933deaaa49dcc6d9b7f70f71fb377", "score": "0.49900317", "text": "def inline!\n self.enabled = true \n self.inline = true\n end", "title": "" }, { "docid": "a78fe212ef19a613aab7f159d6c499ab", "score": "0.49720326", "text": "def toggle\n @batch = Batch.find(params[:id])\n @batch.update(:active => @batch.active? ? false : true)\n redirect_to :back\n end", "title": "" }, { "docid": "53031cd580f73fc99ae5970269191452", "score": "0.49663466", "text": "def enable\n end", "title": "" }, { "docid": "539195e0021e7b0148b41223147e6ef6", "score": "0.49489766", "text": "def toggle!\n\t\tif self.can_mark_complete?\n\t\t\tself.mark_complete!\n\t\telsif self.can_re_open?\n\t\t\tself.re_open!\n\t\tend\n\tend", "title": "" }, { "docid": "79616cda53774d2d242f7ba8b1e494fd", "score": "0.4946737", "text": "def toggle_link\n new_params = toggle_params\n\n if enabled\n h.link_to(h.search_path(new_params)) do\n h.check_box_tag(\"category_#{to_param}\", '1', true, disabled: true) +\n h.html_escape(name)\n end\n else\n h.link_to(h.search_path(new_params)) do\n h.check_box_tag(\"category_#{to_param}\", '1', false, disabled: true) +\n h.html_escape(name)\n end\n end\n end", "title": "" }, { "docid": "05ee0e53855e7c44255258e4506583da", "score": "0.49200007", "text": "def disable\n exclusively do\n @enabled = false\n @manual_toggle = true\n end\n\n save_state\n sync_control { stop_upkeep }\n end", "title": "" }, { "docid": "b7ba5e0a176f8080f90b42f1390043ea", "score": "0.4918997", "text": "def prerender?\n !! prerender\n end", "title": "" }, { "docid": "3ab55ddca984e17c909bc41e68fc0396", "score": "0.49183136", "text": "def renderable\n self\n end", "title": "" }, { "docid": "e18bbffc8f4247e80aaa74ce47d849d0", "score": "0.4913844", "text": "def enable\n @service.disabled = false\n end", "title": "" }, { "docid": "315ef4d199362c7a7cf8e4b06b4a7d37", "score": "0.49046472", "text": "def draw_switchable(control, index)\n end", "title": "" }, { "docid": "ec81c7d0fd86f898568deb6ea936414e", "score": "0.49026948", "text": "def toggle_grid\n if @show_grid\n self.show_grid = false\n else\n self.show_grid = true\n end\n end", "title": "" }, { "docid": "a6bd0768ba688eae72b081e4b80a184e", "score": "0.4900613", "text": "def enabled; end", "title": "" }, { "docid": "a6bd0768ba688eae72b081e4b80a184e", "score": "0.4900613", "text": "def enabled; end", "title": "" }, { "docid": "a6bd0768ba688eae72b081e4b80a184e", "score": "0.4900613", "text": "def enabled; end", "title": "" }, { "docid": "a6bd0768ba688eae72b081e4b80a184e", "score": "0.4900613", "text": "def enabled; end", "title": "" }, { "docid": "4771c640b5b7ded03aaf464a4e66945e", "score": "0.4898389", "text": "def disabled?\n !enabled?\n end", "title": "" }, { "docid": "72d0bddf2904abe9298079a84a4c93b2", "score": "0.48967996", "text": "def enabled?\n false\n end", "title": "" }, { "docid": "25e454d95435ce9858400e1b1ceb9ad3", "score": "0.48924285", "text": "def toggle_editmode\n\t\t@editmode = true\n\t\t$screen.write_message(\"Edit mode\")\n\tend", "title": "" }, { "docid": "4df514be23150cae8aff47e8e979af6e", "score": "0.48921603", "text": "def disabled?\n !enabled?\n end", "title": "" }, { "docid": "b542609e999922a7037914fccfce2b9d", "score": "0.48821318", "text": "def toggle\n if visible?\n hide\n\n else\n show\n\n end\n end", "title": "" }, { "docid": "2fbece2966ac4e838812e0c77aade0e0", "score": "0.48725322", "text": "def enabled?\n false\n end", "title": "" }, { "docid": "b27d58c425226bb55c61c93f12b5b8e3", "score": "0.48694083", "text": "def toggle(instance)\n # do nothing\n end", "title": "" }, { "docid": "bb536e0ac9751124b813867385201036", "score": "0.48655242", "text": "def disabled=(value)\n `#{@el}.disabled = #{value}`\n end", "title": "" }, { "docid": "8c15f9c3ad0dbd4a2b1541aca205051a", "score": "0.48590314", "text": "def enabled\n\t\ttrue\n\tend", "title": "" }, { "docid": "f7ea3fef0051ac2e6cd7e2d7ea959364", "score": "0.48544794", "text": "def disabled; end", "title": "" } ]
53d54a8042670f938b69266753afeb9d
find deuplicates and its count in an array using group_by method
[ { "docid": "7c67bced0cbe4b9b1259ef8d7dd9e11a", "score": "0.74002624", "text": "def duplicates_count(arr)\n arr.group_by { |x| arr.count(x) }\nend", "title": "" } ]
[ { "docid": "5acdcb2be3adae0682955c2e27d559c5", "score": "0.6762638", "text": "def grouped_duplicates(collection); end", "title": "" }, { "docid": "29e37938b4c0b50208acafa453d89bcc", "score": "0.66713643", "text": "def no_dupes?(arr)\n count = Hash.new(0)\n arr.each { |el| count[el] += 1 }\n count.keys.select { |el| count[el] == 1 }\n end", "title": "" }, { "docid": "73dfa852d6463428d78de6e32b0cda5d", "score": "0.66671735", "text": "def find_dups(cart)\r\n cart.group_by {|e| e}.select { |k, v| v.size > 1}.map {|k, v| [k.values[0], v.size] }.to_h\r\nend", "title": "" }, { "docid": "c62294321df211284a47c10b2a23f638", "score": "0.66519713", "text": "def find_occurrences(array)\n array.flatten.each_with_object(Hash.new(0)){ |item,count| count[item] += 1 }\n end", "title": "" }, { "docid": "6e6726b9036d95ee20e9ad2556480f9e", "score": "0.66396034", "text": "def no_dupes?(arr)\n ele_count = arr.each_with_object(Hash.new(0)) do |ele, new_hash|\n new_hash[ele] += 1\n end\n\n ele_count.select{ |k, v| v == 1}.keys\nend", "title": "" }, { "docid": "7bf5b6240e671238ae2a43c8aceda461", "score": "0.6614539", "text": "def no_dupes?(arr)\n count = Hash.new(0)\n\n arr.each { |el| count[el] += 1}\n count.keys.select {|ele| count[ele] == 1}\n\nend", "title": "" }, { "docid": "b24ccd9bf72ccf1036e097097fe14cbc", "score": "0.65943074", "text": "def count_elements (array)\n array.uniq.each {|i| count = 0\n array.each {|i2| if i2 == i then count += 1 end}\n i[:count] = count}\nend", "title": "" }, { "docid": "e347fff002e3a036865a79b683a0186d", "score": "0.6587667", "text": "def no_dupes?(arr)\n\n counter = Hash.new(0)\n\n arr.each { |ele| counter[ele]+=1}\n\n counter.select! {|k,v| v==1}\n\n counter.keys\n\nend", "title": "" }, { "docid": "b90586e38c56d3f68531f94cf870ec7b", "score": "0.6553429", "text": "def no_dupes?(arr)\n counts = Hash.new(0)\n arr.each do |ele|\n counts[ele] += 1\n end\n output = []\n counts.each do |k, v|\n if v == 1\n output << k\n end\n end\n output\nend", "title": "" }, { "docid": "e0a516369eb74b50c6307fab82a07cc4", "score": "0.6528831", "text": "def no_dupes?(arr)\n new_hash = Hash.new{|h,k| h[k] = 0} # Hash.new(0)\n arr.each{|el| new_hash[el] += 1}\n new_hash.select{|k,v| v == 1}.keys\nend", "title": "" }, { "docid": "6d7c229b958945271158ba1d538db6d5", "score": "0.65238094", "text": "def count_elements (array)\n # array.count {|name| name > 0}\n array.group_by(&:itself).map{|key, value| key.merge(count: value.length)}\nend", "title": "" }, { "docid": "3816ea5dac938884d95780209e542953", "score": "0.6521262", "text": "def count_occurrences(arr) \n\n h1 = Hash[arr.group_by{|auto| auto}.map{|k,v|[k,v.size]}] \n \n ### other working solutions below ###\n \n \n # h1 = Hash.new(0)\n # arr.uniq.each do |auto_group|\n # h1[auto_group] = arr.count(auto_group)\n # end\n \n\n # h1 = Hash.new(0)\n # arr.each do |vehicle|\n # h1[vehicle] += 1\n # end \n \n \n # arr.each do |word|\n # if h1.has_key?(word)\n # h1[word] += 1\n # # h1[word] = h1[word] + 1\n # binding.pry\n # else\n # h1[word] = 1\n # end\n # end\n\n h1.each {|k,v| puts \"#{k} => #{v}\" }\n \nend", "title": "" }, { "docid": "0e5ea3d20a5b1ae69cf26afd6b5f6e41", "score": "0.6507707", "text": "def remove_dups_add_count(array)\n array.each do |hash|\n \t#the reason you get 2 1 1 instead of 2 2 1 is because after you assign the :count key to the first blake hash, it is no longer the same. \n ap hash[:count] = array.select{|other_hash| other_hash == hash}.length \n end\n #call uniq to remove duplicates based on the value of hash[:name]\n ap array.uniq {|hash| hash[:name]}\n end", "title": "" }, { "docid": "4e8c56df761764c1d940c3ffcefaac8f", "score": "0.65033793", "text": "def find_uniq(arr)\n count_hash = Hash[arr.group_by {|array_value| array_value}.map {|k,v| [k,v.count]}]\n return count_hash.key(1)\nend", "title": "" }, { "docid": "08af205602d881349dc79c1a0edf59e3", "score": "0.64958644", "text": "def count_elements(array)\n new_array = Array.new\n array.uniq.select do |element|\n element[:count] = array.count(element)\n new_array << element\n end\n new_array\n end", "title": "" }, { "docid": "e00997ed1e68f290cdf8ccf28f259a3b", "score": "0.6495185", "text": "def no_dupes?(arr)\n hash = Hash.new(0)\n arr.each { |ele| hash[ele] += 1 }\n hash.select { |k , v| v == 1 }.keys\nend", "title": "" }, { "docid": "c1d942f5c841622f794856348da2543e", "score": "0.64933586", "text": "def find_dup(array)\n result = {}\n array.each do |integer|\n result[integer] = array.count(integer)\n end\n result.key(2)\nend", "title": "" }, { "docid": "e53a2f7a83e8b42bdd405540d9129e96", "score": "0.6479236", "text": "def solution(a)\n a.group_by {|i| i }.length\nend", "title": "" }, { "docid": "ce9c4b40d39e0c0de1d704881311143c", "score": "0.6473103", "text": "def group(arr)\n arr.inject(Hash.new(0)) { |h, e| h[e] += 1 ; h }\nend", "title": "" }, { "docid": "4d90699aae240a2b60a8900a116a6955", "score": "0.64723754", "text": "def count_elements(array)\n array.group_by(&:itself) # group all of the identical elements together\n .map{|k, v| k.merge(count: v.length)} # add the \"count\" element to the hash\nend", "title": "" }, { "docid": "fe4e9525dc3b2892b7fab64d9a96e009", "score": "0.6449806", "text": "def no_dupes?(arr)\n counter = Hash.new(0)\n arr.each { |ele| counter[ele] += 1 }\n counter.keys.select { |key| counter[key] == 1 }\nend", "title": "" }, { "docid": "c06374f6c5efeac2c1293f0e36a8f2d7", "score": "0.64411044", "text": "def no_dupes?(arr)\n hash = Hash.new(0)\n arr.each {|ele| hash[ele] += 1}\n hash.select {|k,v| v == 1}.keys\nend", "title": "" }, { "docid": "b02741d223bb26adc4e5ee05d5040d96", "score": "0.6440272", "text": "def no_dupes?(arr)\n count = Hash.new(0)\n arr.each { |el| count[el] += 1 }\n # count.keys.select { |el| count[el] == 1 }\n no_dupes = []\n count.each do |k, v|\n no_dupes << k if v == 1\n end\n no_dupes\nend", "title": "" }, { "docid": "0a68055f6eeb21dc3124ba59afa2fb13", "score": "0.64315385", "text": "def count_occurrences(array)\n occurrences = {}\n array.uniq.each { |element| occurrences[element] = 0 }\n \n array.each { |element| occurrences[element] += 1 }\n \n occurrences\nend", "title": "" }, { "docid": "f76fd63f44c39070fa474ef4946c75d9", "score": "0.6424516", "text": "def solution(a)\n return a.group_by{|n| n}.size\nend", "title": "" }, { "docid": "6061c7bd20ffe5d6f51107f9d05a199e", "score": "0.64238244", "text": "def no_dupes?(arr)\n count = Hash.new(0)\n res = []\n arr.each { |el| count[el] += 1 }\n count.each do |k, v|\n if v == 1\n res << k\n end\n end\n\n res\nend", "title": "" }, { "docid": "5ef4fa99382e1bb851887b6e76728db0", "score": "0.64119095", "text": "def no_dupes?(arr)\n hash = Hash.new(0)\n arr.each { |ele| hash[ele] += 1 }\n hash.select! { |k, v| v == 1 }\n hash.keys\nend", "title": "" }, { "docid": "8303dc007bc9b890eb3c50c585533901", "score": "0.6380576", "text": "def count_elements(array)\n temp_u = array.uniq\n temp_u.collect do |x|\n c = array.count(x)\n # ???\n x.merge({:count => c})\n end\nend", "title": "" }, { "docid": "6570c1fd208946071ace9829bab9567c", "score": "0.63782066", "text": "def find_unique_elements(arr)\n count_hash = arr.each_with_object (Hash.new(0)) { |element, counts| counts[element] += 1 }\n new_hash = count_hash.select {|key,value| value == 1}\n answer_arr = new_hash.keys\n return answer_arr\nend", "title": "" }, { "docid": "0ee6883cac51d7ab91b63eb35cd6c234", "score": "0.63607407", "text": "def count_elements(arr)\n names = arr.uniq\n\n names.collect do |x|\n x.merge({:count=> arr.count { |item| item[:name]== x[:name] }}) #merge with count of other array\n end\n\nend", "title": "" }, { "docid": "6ca4d091f7e55d6e170e2b5b7102d752", "score": "0.6345714", "text": "def find_dups(arr)\n track = []\n output = {}\n arr.each do |el|\n if track[el] == nil\n track[el] = el\n else\n output[el] =1\n end\n end\n output.keys\nend", "title": "" }, { "docid": "7ea0719a2b8c044cd2ff4f0007cc09a7", "score": "0.6339778", "text": "def distinct_list(arr)\n\thash = Hash.new\n\tarr.each do |x|\n\t\thash[x] = arr.count(x)\n\tend\n\tcounter = 0\n\thash.each do | key, value|\n\t\tif value > 1\n\t\t\tcounter += (value -1)\n\t\tend\n\t\t\n\tend\n\tcounter\nend", "title": "" }, { "docid": "c69974119392b98b8a66e136fd1b5e7f", "score": "0.6339608", "text": "def count(array)\n\thash = Hash.new\n\tarray.each do |item|\n\t\thash[item] = array.select{|other_item| other_item == item}.size\n\tend\n\thash\nend", "title": "" }, { "docid": "f68726f1585790d09a2ab2deffebcf3b", "score": "0.63355094", "text": "def find_unique_elements(arr) #I want to use a hash like in the most-common integer problem. That hash will be populated with keys based on the array and values based on how often that key appears in the array. \n\th = Hash.new(0) #this is my new empty hash\n\tarr.each{ |i| h[i] += 1 } #This each loop will go through the original array, and each time a specific object occurs, it will increase the value of that key in the hash.\n\th.delete_if{ |k, v| v > 1 } #Delete_if goes through the hash and deletes specified objects if the return true. Here they should be deleted if the value is more than 1.\n\treturn h.keys #Returns an array of the remaining keys in h.\nend", "title": "" }, { "docid": "d437aa6c45fa3d99b8243eb7f3ab0098", "score": "0.6327134", "text": "def count_elements(array)\n ans = []\n array.uniq.each do |i|\n ans.push([i,count:array.count(i)].reduce({}, :merge))\n end\n ans\nend", "title": "" }, { "docid": "e3a22871e1479c228fb4f8f4600d8116", "score": "0.6324043", "text": "def no_dupes?(arr)\n hash = Hash.new(0)\n arr.each do |ele|\n hash[ele] += 1 \n end\n\n no_dupe = hash.select {|k, v| v < 2}\n no_dupe.keys\nend", "title": "" }, { "docid": "18d8b3d3d050aa943ddd4e2903ba58b9", "score": "0.63095695", "text": "def unique_occurrences(arr)\n nums_hash = Hash.new(0)\n \n arr.each do |num|\n nums_hash[num] += 1\n end\n \n nums_hash.values == nums_hash.values.uniq\nend", "title": "" }, { "docid": "c00ad147c66a54618b4b7e5f55ea3022", "score": "0.63076407", "text": "def count_occurrences(array)\n unique_arr = array.uniq # [\"car\", \"truck\", \"SUV\", \"motorcycle\", \"suv\"]\n count_hash = Hash.new # {}\n\n unique_arr.each do |elem|\n count_hash[elem] = 0 # count_hash = {\"car\"=>0, \"truck\"=>0, \"SUV\"=>0, \"motorcycle\"=>0, \"suv\"=>0}\n end\n\n array.each do |elem|\n if unique_arr.include?(elem)\n count_hash[elem] += 1\n end\n end\n\n count_hash.each { |k, v| puts \"#{k} => #{v}\" }\n\nend", "title": "" }, { "docid": "30bb19b2a3d86fa01fcf7ae7e2f9e403", "score": "0.62876123", "text": "def count_occurrences(arr)\n arr.uniq.each{ |x| puts \"#{x} => #{arr.count(x)}\" }\nend", "title": "" }, { "docid": "d76a43975d19fd8046354b798d3a5cb2", "score": "0.6273535", "text": "def count_occurrences(array)\n occurrences = {}\n\n array.uniq.each do |element|\n occurrences[element] = array.count(element)\n end\n\n occurrences.each do |element, count|\n puts \"#{element} => #{count}\"\n end\nend", "title": "" }, { "docid": "d76a43975d19fd8046354b798d3a5cb2", "score": "0.6273535", "text": "def count_occurrences(array)\n occurrences = {}\n\n array.uniq.each do |element|\n occurrences[element] = array.count(element)\n end\n\n occurrences.each do |element, count|\n puts \"#{element} => #{count}\"\n end\nend", "title": "" }, { "docid": "a2b082abd525d37cad3ffa2d1727e126", "score": "0.626856", "text": "def find_duplicates(array)\n result_hash = {}\n result_array = []\n\n # loop through array and build a hash with counters\n # where the key is the array element and the counter is the value\n # increase counter when duplicate is found\n array.each do |num|\n if result_hash[num].nil?\n result_hash[num] = 1\n else\n result_hash[num] += 1\n end\n end\n\n # loop through hash and look for values > 1\n result_hash.each do |k, v|\n result_array.push(k) if v > 1\n end\n\n # return keys\n result_array\nend", "title": "" }, { "docid": "8e2d74c458a510f5c0c495d29fb8857a", "score": "0.6260462", "text": "def count_elements(array)\n new_array = []\n array.each do |original|\n key_list = original.keys\n key_list.each do |key| \n i = new_array.find_index { |counted| counted[key] == original[key] }\n i ? new_array[i][:count] += 1 : new_array << {key => original[key], :count => 1}\n end\n end\n new_array\nend", "title": "" }, { "docid": "ca0e095f296b602ccd5dbe97895d7e63", "score": "0.62553096", "text": "def count_occurrences(array)\n results = {}\n\n item1 = array.select do |item|\n item == array[0]\n end\n item2 = array.select do |item|\n item == array[2]\n end\n item3 = array.select do |item|\n item == array[4]\n end\n item4 = array.select do |item|\n item == array[6]\n end\n\n results[item1[0]] = item1.count\n results[item2[0]] = item2.count\n results[item3[0]] = item3.count\n results[item4[0]] = item4.count\n\n results\nend", "title": "" }, { "docid": "bdc5d7854bb9a85ec58b4a3a528a05ee", "score": "0.62534523", "text": "def no_dupes?(arr)\n hash = Hash.new(0)\n arr.each {|ele| hash[ele] += 1 }\n answer = []\n hash.each {|k,v| answer << k if v == 1 }\n answer\nend", "title": "" }, { "docid": "c3fafde5a48060980c98e4b99206a151", "score": "0.6249609", "text": "def dupe_indices(arr)\n counter = Hash.new([])\n\n arr.each_with_index do |ele, i|\n counter[ele] += [i]\n end\n\n counter.select { |key, value| value.length > 1 }\nend", "title": "" }, { "docid": "fda2384a381067f67608788ce33ee159", "score": "0.62446487", "text": "def count_elements (array)\n array.each do |original_hash|\n original_hash[:count]=0\n name = original_hash[:name]\n array.each do |hash|\n if hash[:name] == name\n original_hash[:count] += 1\n end\n end\n end.uniq\nend", "title": "" }, { "docid": "815f35c2c3e30fdfe5afbaec972cbbc3", "score": "0.6244403", "text": "def count_elements(array)\n array.each do |original_hash|\n original_hash[:count] = 0\n name = original_hash[:name]\n array.each do |hash|\n if hash[:name] == name\n original_hash[:count] += 1\n end\n end\n end.uniq\nend", "title": "" }, { "docid": "0adc233c46fe96b845e71ce36083c539", "score": "0.62404263", "text": "def return_dups_hash array\n\t\tdups = {}\n\t\tarray.uniq.each do |val|\n\t\t\tdups[val] = array.count(val)\n\t\tend\n\t\treturn_dups\n\tend", "title": "" }, { "docid": "e78abe08c57862319f3f13725f646cfd", "score": "0.6236292", "text": "def find_duplicates(list)\n frequencies = list.group_by{|num| num}\n return frequencies.select{ |num, instances| instances.length > 1 }.keys\nend", "title": "" }, { "docid": "bb1036ea4dc2c75c84c11363eef2c10b", "score": "0.62360543", "text": "def no_dupes?(arr)\n elements = Hash.new(0)\n unique_elements = []\n arr.each { |k, v| elements[k] += 1 }\n elements.each_key { |key| unique_elements << key if elements[key] == 1 }\n unique_elements\nend", "title": "" }, { "docid": "dd942fdcb9333d9fc57df0e3dbe48df7", "score": "0.62222683", "text": "def solution(a)\n a.uniq.count \nend", "title": "" }, { "docid": "61d5c0e856c5d53a4d5b8947f6dd9991", "score": "0.62205637", "text": "def find_dup(array)\n array\n .group_by(&:itself)\n .values\n .find { |v| v.size > 1 }\n .first\nend", "title": "" }, { "docid": "247077519a8fb5ea6f6dd7170a98dc59", "score": "0.62152064", "text": "def no_dupes(array)\n\n hash = Hash.new(0)\n array.each do |number|\n hash[number]+=1\n end\n\n array = Array.new\n hash.each do |number, count|\n array.push(number)\n end\n\n print array\n\nend", "title": "" }, { "docid": "86a8ee2705d32eb0397372a849f2cf58", "score": "0.61979055", "text": "def find_unique_elements(arr) \n counts = {}\narr.each do |num|\n count = arr.find_all { |x| x == num }.size\n counts[num] = count if count <= 1\nend\n\nelements = arr.find_all { |x| counts.has_key?(x) }\np elements\nend", "title": "" }, { "docid": "e8dd4b022bb990b6c834f14602c975cc", "score": "0.61927056", "text": "def solution(a)\n uniq_array = a.uniq\n real_count = 0\n a.each_with_index do |e,i|\n dest_count = 0\n check_array = []\n\n j = i + 1\n while(j<a.count && uniq_array.count != check_array. count)\n dest_count +=1\n unless check_array.include?a[j]\n check_array.push(a[j]) \n end\n end \n real_count = dest_count if real_count < dest_count\n end\n return real_count \nend", "title": "" }, { "docid": "9b27463dcfda901fcb4a4ec2aa437101", "score": "0.6191744", "text": "def count_occurrences(ary)\n new_ary = ary.uniq\n new_ary.each { |e| puts \"#{e} => #{ary.count(e)}\" }\nend", "title": "" }, { "docid": "845571e8f1a6fa5d6b80885df8c4bbfc", "score": "0.6184936", "text": "def duplicates(arr)\n duplicates = []\n store = Hash.new(0)\n\n arr.each do |el|\n if (store[el] == 1)\n duplicates.push(el)\n store[el] += 1\n elsif (store[el] == 0)\n store[el] = 1\n else\n store[el] += 1\n end\n end\n\n return duplicates\nend", "title": "" }, { "docid": "bf57ed90d608a98b1c685ad1261d576f", "score": "0.6176799", "text": "def find_dup(arr)\n occurances = arr.each_with_object(Hash.new(0)) { |el, hsh| hsh[el] += 1 }\n duplicate = occurances.select { |_, value| value == 2 }\n duplicate.key(2)\nend", "title": "" }, { "docid": "5d4e873a80af4d77c69b417d54ae7178", "score": "0.6174427", "text": "def count_occurrences(arr)\n arr.each_with_object(Hash.new(0)) do |el, hsh|\n hsh[el] += 1\n end\nend", "title": "" }, { "docid": "e17ec4f9787eff1acaceb281169adcdc", "score": "0.61741316", "text": "def count_elements(arr)\n arr.uniq.collect do |el|\n el[:count] = arr.count(el)\n el\n end\nend", "title": "" }, { "docid": "d6327a234dcd3bfd2915bd1d05cf44bd", "score": "0.61716884", "text": "def find_dup(arr)\n arr.tally.key(2)\nend", "title": "" }, { "docid": "c04b0fc2c5aa5730282072dfd98c06ab", "score": "0.61663175", "text": "def count_occurrences(ary)\n ary.inject(Hash.new(0)) { |h,e| h[e] += 1; h }.select {\n |k,v| v >= 1 }.inject({}) { |r, e| r[e.first] = e.last; r }\n end", "title": "" }, { "docid": "959ec821d08218f7da7f6cd1b50efb85", "score": "0.6154113", "text": "def count_elements (array)\n aryHolder = array.uniq\n aryHolder.each do |ele|\n ele[:count] = 0\n end\n for i in 0...aryHolder.length\n for k in 0...array.length\n if aryHolder[i][:name] == array[k][:name]\n aryHolder[i][:count] += 1\n end\n end\n end\n return aryHolder\nend", "title": "" }, { "docid": "b18c5abd08468fd2ee5c71f22a6bb0ba", "score": "0.61489016", "text": "def count_elements(array)\n array.each do |hash|\n hash[:count] = 0 # initialize count to 0\n name = hash[:name] # initializes name to 0\n array.each do |hash2|\n if hash2[:name] == name # if name appears...\n hash[:count] += 1 # count goes up by one\n end\n end\n end.uniq # returns only unique elements (not sure why its here...)\nend", "title": "" }, { "docid": "27f847c036d60f05eb66aa6bc7983368", "score": "0.61479676", "text": "def find_unique_elements(arr)\n counts = Hash.new(0)\n \n arr.each do |obj|\n counts[obj] += 1\n end\n\n uniq_arr = []\n \n counts.each do |k, v|\n if v == 1\n uniq_arr << k \n end\n end\n \n return uniq_arr\n\nend", "title": "" }, { "docid": "306a0a9f30523458c413c08b9781f3ba", "score": "0.6146191", "text": "def count_elements(array)\n counted = array.uniq\n array.each do |hash|\n hash[:count] = 0\n current_name = hash[:name]\n array.each do |element|\n if element[:name] == current_name\n hash[:count] += 1\n end\n end\n end\n counted\nend", "title": "" }, { "docid": "69138a0708470d3fe1db48941502db13", "score": "0.61417305", "text": "def count_occurrences(array)\n array.map { |e| p e + \"=> #{array.count(e)}\"}.uniq\nend", "title": "" }, { "docid": "184f4277b74a57cc203726dd8519fa19", "score": "0.6140287", "text": "def count_occurrences(array)\n results = Hash.new(0)\n\n array.each {|obj| results[obj] = array.count(obj)}\n\n results.each {|k,v| puts \"#{k} => #{v}\"}\nend", "title": "" }, { "docid": "33bccf6ba3d4454f8f0607ea9a92e111", "score": "0.613686", "text": "def findDuplicates(arr)\n\thsh = Hash.new{0}\n\t# iterate over the array, count duplicates\n\tarr.each do |v|\n\t\thsh[v] += 1\n\tend\n\thsh.each do |v, n|\n\t\tputs \"#{v} appears #{n} times\" if n > 1\n\tend\n\t# get uniq elements\n\tarr.uniq!\n\n\treturn arr\nend", "title": "" }, { "docid": "c00baaaf6015975ab4f2427382feb5a9", "score": "0.6134571", "text": "def count_elements(array)\n array.each do |hash_one|\n hash_one[:count] = 0\n name = hash_one[:name]\n array.each do |hash_two|\n if name == hash_two[:name]\n hash_one[:count] += 1\n end\n end\n end\n array.uniq\nend", "title": "" }, { "docid": "22b8282a05bf096cc2c71dbea91afa57", "score": "0.6113407", "text": "def duplicates(arr)\n arr.select { |e| arr.count(e) > 1 }.uniq\nend", "title": "" }, { "docid": "99903750a9598a07f56c3fd0ba240b65", "score": "0.6101639", "text": "def find_unique_elements(arr)\n num_val = Hash.new(0) #This is the new empty hash\n arr.each {|arr| num_val[arr] += 1} #This loops the array into the hash with occurances being the value\n num_val.select { |x,y| y == 1 }.keys #Here we select all the values that are 1\nend", "title": "" }, { "docid": "4f85c04a2e81b00868b494dfd66f3541", "score": "0.6097893", "text": "def find_dup(arr)\n # dup_arr = arr.sort\n # dupe = dup_arr.select.with_index {|num, index| num == dup_arr[index + 1]}\n # dupe[0]\n arr.tally.key(2)\nend", "title": "" }, { "docid": "313f2582885d5f07b7fa77a06d131c78", "score": "0.6088884", "text": "def count_elements(array)\n\n array.each do |element|\n element[:count] = 0\n element_name = element[:name]\n array.each do |hash|\n if hash[:name] == element_name\n element[:count] += 1\n end\n end\n end.uniq # sort out the duplicate hash\n\nend", "title": "" }, { "docid": "2465e809cdddbb8fae936e336e49d219", "score": "0.60839826", "text": "def find_uniq(arr)\n return nill if arr.size < 3\n res = Hash[arr.group_by {|x| x}.map {|k,v| [k,v.count]}]\n res.key(1)\nend", "title": "" }, { "docid": "fdd343796ddc7e75f5b9ebce6663611f", "score": "0.6063428", "text": "def my_uniq(arr)\n counts = Hash.new(0)\n arr.each { |val| counts[val] = true }\n counts.keys\nend", "title": "" }, { "docid": "897e84915cdeae9db93131f3a0e9067f", "score": "0.6051405", "text": "def count_occurrences(array)\n puts array.uniq.map { |x| \"#{x} => #{array.count(x)}\" }\nend", "title": "" }, { "docid": "3b77d93a48bd6082ee4e0ebb20cb2f88", "score": "0.6049837", "text": "def find_dup(array)\n array.select { |elem| array.count(elem) == 2}.uniq.join.to_i\nend", "title": "" }, { "docid": "1d4b5ead88ae6cb1b7504cfc281e293a", "score": "0.60479534", "text": "def dupe_indices(arr)\n count = Hash.new(0)\n dupes = Hash.new\n \n # get count of each element\n arr.each { |el| count[el] += 1 }\n\n # add dupes to hash called dupes with [] default value\n count.each do |k, v|\n if v > 1\n dupes[k] = []\n end\n end\n\n # find and add indices of dupes\n arr.each_with_index do |el, idx|\n dupes[el] << idx if dupes.key?(el)\n end\n\n dupes\nend", "title": "" }, { "docid": "a966a9cd95c77a8cf778f88c245dfdb2", "score": "0.60346735", "text": "def find_dup(array)\n count = Hash.new(0)\n array.each { |elem| count[elem] += 1 }\n count.select { |k,v| v == count.values.max }.keys[0]\nend", "title": "" }, { "docid": "8a9fd0d6d1eed394a3745cc3f5084694", "score": "0.6031044", "text": "def count_occurrences_again(array)\n occurrences = {}\n\n array.each do |element|\n occurrences[element] = array.count(element)\n end\n\n occurrences.each do |element, count|\n puts \"#{element} => #{count}\"\n end\nend", "title": "" }, { "docid": "28e046d80f117e8b21526023bff760b4", "score": "0.6029954", "text": "def repeated_nums array\n # print array.select{ |e| array.count(e) > 1}.sort\n\nend", "title": "" }, { "docid": "ec30e0fbf9ad6ea19cf3139318d626d1", "score": "0.6019427", "text": "def count_elements(array)\n hash_array = []\n array.each do |name_hash|\n name_hash.each do |category, name|\n new_hash = {\n :name => name,\n :count => array.count({category => name})\n }\n hash_array << new_hash\n end\n end\n hash_array.uniq\nend", "title": "" }, { "docid": "4db311e619e5ea0be2db98fc9d4c9b9f", "score": "0.60181123", "text": "def find_unique_elements(arr)\n elements = Hash.new(0)\n arr.each{ |e| elements[e] +=1 }\n elements.select { |key,value| value == 1 }.keys\nend", "title": "" }, { "docid": "671b15c1b9e8d83c0accf4706ed39ddd", "score": "0.6017215", "text": "def my_uniq(arr)\n counts = Hash.new(0)\n res = []\n arr.each do |e|\n if !counts.key?(e)\n res.push(e)\n end\n counts[e] += 1\n end\n return res\nend", "title": "" }, { "docid": "52b0c2f276835260197b4af4e803f2b3", "score": "0.60153544", "text": "def dupe_indices(arr)\n indices = Hash.new { |h,k| h[k] = [] }\n\n arr.each_with_index do |val, idx|\n if arr.count(val) > 1\n indices[val] << idx\n end\n end\n indices\nend", "title": "" }, { "docid": "5ab190bbe0016ed0387759aab2474d64", "score": "0.60127616", "text": "def duplicate_in_array(arr)\n arr.each do |num|\n return false if num < 0 || num >= arr.length\n end\n\n hash = {}\n arr.each do |num|\n if hash[num]\n hash[num] += 1\n else\n hash[num] = 1\n end\n end\n hash.select { |k,v| v > 1}.keys\nend", "title": "" }, { "docid": "07703d7a861a2513e2df71278bab970f", "score": "0.6007813", "text": "def unique_occurrences(arr, num_count = {}, occ_count = {})\n arr.each do |num|\n num_sym = num.to_s.to_sym\n \n if num_count[num_sym]\n num_count[num_sym] += 1\n else \n num_count[num_sym] = 1\n end\n end\n \n num_count.values.each do |occurence|\n occ_sym = occurence.to_s.to_sym\n \n if occ_count[occ_sym]\n return false\n else \n occ_count[occ_sym] = true\n end\n end\n \n true\nend", "title": "" }, { "docid": "fd1f57cd9b3b287c1ce4bd5f1fa35cc6", "score": "0.6004954", "text": "def count_elements(array)\n # count = 0\n # array.each_with_object(Hash.new(0)) { |word,counts| counts[word] += 1 }\n # counts = Hash.new(0)\n # array.inject(Hash.new(0)) {|total, e| total[e] += 1 ;total}\n # count.push(total)\n array.uniq.each {|i| count = 0\n array.each {|i2| if i2 == i then count += 1 end}\n i[:count] = count}\nend", "title": "" }, { "docid": "1a5f2232ce67bfcb54d59171ac8e681f", "score": "0.59904015", "text": "def just_duplicates(arr)\n arr.select { |x| arr.count(x) > 1 }.uniq!\nend", "title": "" }, { "docid": "92a85769215224c938d9486d093acd48", "score": "0.59840375", "text": "def count_occurences(array)\r\n occur = {}\r\n \r\n array.each { |element| occur[element] = array.count(element) }\r\n occur.each { |element, count| puts \"#{element} => #{count}\"}\r\nend", "title": "" }, { "docid": "cb294f732d8d29e36b3767a0df0b96d3", "score": "0.5978138", "text": "def groupings_old\n start = [[1]]\n (2..self).each do |n|\n r = []\n # p \"in = > #{start.inspect}\"\n start.map do |a|\n b = a.dup\n b.each_index do |i|\n if b.length == 1\n c = b.dup\n c[0] += 1\n r << c\n end\n if b[i+1]\n if b[i] > b[i+1]\n c = b.dup\n c[i+1] += 1\n r << c\n end\n else\n b << 1\n r << b.dup\n break\n end\n end\n end\n start = r\n end\n # We get some duplicates\n start.uniq\n end", "title": "" }, { "docid": "512ae63626e31c88af6b560ebb09aa68", "score": "0.5977553", "text": "def dupe_indices(arr)\n count = Hash.new(0)\n elm_hash = Hash.new(0)\n elm_arr = []\n\n arr.each { |elm| count[elm] += 1 }\n arr.each_with_index do |elm, i|\n\n # debugger \n if count[elm] > 1 \n elm_arr << i \n elm_hash[elm] = elm_arr \n end\n\n elm_arr = []\n end \n\n return elm_hash\nend", "title": "" }, { "docid": "9347ea39c1f7229f25cc4673d33e01ed", "score": "0.597686", "text": "def count_occurences_pretty(input_array)\n \n input_array.uniq.each { |value| puts \"#{value} => #{input_array.count value}\"}\n \nend", "title": "" }, { "docid": "41d4ea5d1cf50d3682c69806fff1868d", "score": "0.5965002", "text": "def count_occurrences(array)\n occurrences = {} # => {}\n\n array.uniq.each do |element| # => [\"car\", \"truck\", \"SUV\", \"motorcycle\"]\n occurrences[element] = array.count(element) # => 4, 3, 1, 2\n end # => [\"car\", \"truck\", \"SUV\", \"motorcycle\"]\n\n occurrences.each do |k, v| # => {\"car\"=>4, \"truck\"=>3, \"SUV\"=>1, \"motorcycle\"=>2}\n puts \"#{k} => #{v}\" # => nil, nil, nil, nil\n end # => {\"car\"=>4, \"truck\"=>3, \"SUV\"=>1, \"motorcycle\"=>2}\nend", "title": "" }, { "docid": "dad835d7751f874fa6102c1a0a591c6a", "score": "0.59642124", "text": "def find_dup(array)\n duplicate = array.select do |element|\n (array.count(element) > 1) # counts elements that contain more than 1 duplicate.\n end\n duplicate.uniq # remove duplicates from the returned duplicated values.\nend", "title": "" }, { "docid": "b6d830434ec1a73bd84cf826011c4389", "score": "0.59499025", "text": "def count_elements(array)\n counts = Hash.new(0)\n array.collect {|element| counts[element]+=1 }\n counts.collect do |hash, number|\n hash[:count] = number\n end\n counts.keys\nend", "title": "" }, { "docid": "b6d830434ec1a73bd84cf826011c4389", "score": "0.59499025", "text": "def count_elements(array)\n counts = Hash.new(0)\n array.collect {|element| counts[element]+=1 }\n counts.collect do |hash, number|\n hash[:count] = number\n end\n counts.keys\nend", "title": "" }, { "docid": "04cf959cf1f5144c3c5e5b35e209f8a3", "score": "0.5947995", "text": "def find_dup(arr)\n new_arr = []\n count = new_arr.size \n\n arr.each do |num|\n if arr.count(num) == 2\n new_arr << num\n end\n end\n new_arr.pop.to_s.to_i\nend", "title": "" } ]
c1e4d4be5c2cc86af8977016ed85505f
Turn the clock one year forward
[ { "docid": "c1accbf859d90e3f49c44386373f9448", "score": "0.0", "text": "def one_year_passes\n if @age >= 46\n puts \"The orange tree has died at the age of #{@age}\"\n exit\n end\n @age +=1\n @height += 0.8\n\n if fruit_bearing?\n @bears_fruit = true\n end\n puts \"All the oranges from last season has fallen off during the cold winter\"\n puts \"But new oranges sprout again this summer\"\n # Add an random amount of fruit\n if @bears_fruit\n if @age < 10\n @oranges = 38+rand(10)\n elsif @age < 40 and @age >=10\n @oranges = 70+rand(24)\n else\n @oranges = rand(40)\n end\n end\n end", "title": "" } ]
[ { "docid": "4747a97c7a1773032074bd83f2c29b33", "score": "0.731467", "text": "def advance_years(years)\n advance_to_date(to_date >> (years*12))\n end", "title": "" }, { "docid": "7be38327f35f7cb9d06e375b6131f70f", "score": "0.6926607", "text": "def next_year(years = 1)\n advance(years: years)\n end", "title": "" }, { "docid": "c54d9c5b34cda3c43eef97660aedec57", "score": "0.68707883", "text": "def get_next_yr\n\tset_cur_year(get_cur_year+1)\nend", "title": "" }, { "docid": "03ef5fc4b4c761a25dc5175a08fb8d7c", "score": "0.66842186", "text": "def beginning_of_year\n change(:month => 1,:day => 1,:hour => 0, :min => 0, :sec => 0, :usec => 0)\n end", "title": "" }, { "docid": "c08ace96d92420f86ba862bcda7fe25a", "score": "0.6596192", "text": "def start_year\n Time.now.year - 18\n end", "title": "" }, { "docid": "9e9280f0553b0c40014023734b7df054", "score": "0.6569807", "text": "def advance()\n @date = @date + 1\n end", "title": "" }, { "docid": "9e9280f0553b0c40014023734b7df054", "score": "0.6569807", "text": "def advance()\n @date = @date + 1\n end", "title": "" }, { "docid": "79fdf5ac1fccda64ed4e3b4c581cf2cc", "score": "0.65516174", "text": "def prev_year(years = 1)\n advance(years: -years)\n end", "title": "" }, { "docid": "6eccde053e5dfcd849e8961d88eed432", "score": "0.6467589", "text": "def paid_thru_now\n # Turn off March 1 of year following paid year\n paid_thru_year >= (Date.today - 59).year\n end", "title": "" }, { "docid": "0ea1063b9527b5f140387fc75d7ee399", "score": "0.64138883", "text": "def start_year\n Time.now.year - 75\n end", "title": "" }, { "docid": "66fcaa35ec0e8dbe5c02f48a3f5ec616", "score": "0.6347667", "text": "def restart\n self.year = 2014\n puts \"changed year to #{year}\"\n end", "title": "" }, { "docid": "a7f8970eb0f6cb8563731266556612c3", "score": "0.63415", "text": "def next_years\n current_year = Time.now.year\n current_year..(current_year + 4)\n end", "title": "" }, { "docid": "213fb924e47a211332b993b09cdefe36", "score": "0.62674326", "text": "def advance_1sec!\n\t\tTimecop.travel(Time.now + 1)\n\tend", "title": "" }, { "docid": "4d637287c3e2c0b24581566751044080", "score": "0.62314844", "text": "def end_year\n Time.now.year - 90\n end", "title": "" }, { "docid": "348f163fc08712c070981f09f7505be8", "score": "0.61641276", "text": "def future(year, month, day)\n years = (10 ** 9) / 60 / 60 / 24 / 365\n days = (10 ** 9) / 60 / 60 / 24 % 365\n\n year = year + years\n \n\nend", "title": "" }, { "docid": "0cc452514ff81fe87b33af2f7af4ab23", "score": "0.61595285", "text": "def next!\n if @date.month + 1 > 12\n @date = Date.new(@date.year+1,@date.month,1)\n else\n @date = Date.new(@date.year,@date.month+1,1)\n end\n end", "title": "" }, { "docid": "fef5242447b5cec65f012f8fb52b96df", "score": "0.6148595", "text": "def incrementCalendarYear(adjust)\n # Increment the year.\n @year += adjust\n\n # If we are in Feb make sure we don't trip into voidness.\n if @month == 2\n month_length = CDK::CALENDAR.getMonthLength(@year, @month)\n if @day > month_length\n @day = month_length\n end\n end\n\n # Get the start of the current month.\n @week_day = CDK::CALENDAR.getMonthStartWeekday(@year, @month)\n\n # Redraw the calendar.\n self.erase\n self.draw(@box)\n end", "title": "" }, { "docid": "8b86f95bf7e6784404f015b3851a77fc", "score": "0.60376936", "text": "def advance()\n @time = @time + 1\n end", "title": "" }, { "docid": "e92ac47889bd6717c40e16fd82e14e85", "score": "0.60305136", "text": "def advance(options)\r\n d = ::Date.new(year + (options.delete(:years) || 0), month, day)\r\n d = d >> options.delete(:months) if options[:months]\r\n d = d + options.delete(:days) if options[:days]\r\n d\r\n end", "title": "" }, { "docid": "1af20329f408a9b6e80852204ed71b6b", "score": "0.6016723", "text": "def a_year()\n now = Time.now\n if now.month < 4\n now.year - 1\n else\n now.year\n end\nend", "title": "" }, { "docid": "747a453e768757fae4a1830e5ac66fb3", "score": "0.59875494", "text": "def new_year(input)\n equinox = Integer === input ? @astro.solar_event(:march_equinox, input) : @astro.previous(:march_equinox, input)\n date = local_date(equinox)\n equinox.localtime(utc_offset).hour < 12 ? date : date + 1\n end", "title": "" }, { "docid": "4143468b7bf070ea504e97b2c1ad1814", "score": "0.59155065", "text": "def tomorrow\n advance(days: 1)\n end", "title": "" }, { "docid": "c6e8fc50eeaffcd2a9c38a7463ee269b", "score": "0.5889388", "text": "def year(input) = new_year(input).year - 621", "title": "" }, { "docid": "43986428646479ca0e1969b751cfa4d4", "score": "0.5880947", "text": "def end_year\n Time.now.year \n end", "title": "" }, { "docid": "11176195ba1b6f3a75ea0dac5d85b9d7", "score": "0.58789015", "text": "def setleap ( year )\n if year % 4 == 0\n\tif year % 100 == 0 && year % 400 != 0\n\t return 0\n\telse\n\t return 1\n\tend\n else\n \treturn 0\n end\nend", "title": "" }, { "docid": "48ff143a07c76ad1482e88908aac6359", "score": "0.58521694", "text": "def make_one_year_older\n @age +=1\n end", "title": "" }, { "docid": "272b2ad57d7ca1393eaab06ee88044f5", "score": "0.58484554", "text": "def years\n Thread.current[:datet_mode] = :years\n return self\n end", "title": "" }, { "docid": "8ad01ebdaf0d8ab78842d45a4ba67c5e", "score": "0.5835434", "text": "def make_one_year_older\n @age += 1\n end", "title": "" }, { "docid": "1143a6398d48c8fe2865c33a889b49d9", "score": "0.5812286", "text": "def years_since(years)\n advance(years: years)\n end", "title": "" }, { "docid": "997022454976814c8de04cb42b059647", "score": "0.5811383", "text": "def next_day\n advance(days: 1)\n end", "title": "" }, { "docid": "19c109915bdde78e56f47a60ffdfe4b1", "score": "0.58095855", "text": "def start_new_year\n ResetDB.start_new_year\n redirect_to root_url, notice: I18n.t('messages.candidates_removed')\n end", "title": "" }, { "docid": "59e358779c0ffe88d9a551b2564b71ff", "score": "0.5797507", "text": "def effective_year\n if next_year_start_at && Time.zone.now < 1.year.from_now(next_year_start_at)\n if Time.zone.now < next_year_start_at\n return Time.zone.now.year\n elsif Time.zone.now >= next_year_start_at\n if Time.zone.now.year == next_year_start_at.year\n return Time.zone.now.year + 1\n else\n return Time.zone.now.year\n end\n end\n elsif Time.zone.now.month == 12 && Time.zone.now.day >= 1\n return Time.zone.now.year + 1\n end\n\n Time.zone.now.year\n end", "title": "" }, { "docid": "cc47529af8af820ec039250588564dcf", "score": "0.5791561", "text": "def advance\n if @days_until_next <= 0\n @state = :shock\n @days_until_next = @rng.call\n else\n @state = :normal\n @days_until_next -= 1\n end\n end", "title": "" }, { "docid": "cd26110720dd2b6ab247e3e565c72e6e", "score": "0.5782664", "text": "def start_new_year\n clean_associations(Candidate)\n AppFactory.create_seed_candidate\n today = Time.zone.today\n ConfirmationEvent.find_each do |ce|\n ce.chs_due_date = today\n ce.the_way_due_date = today\n ce.save\n end\n\n Rails.logger.info 'done start new year'\n end", "title": "" }, { "docid": "b73a62e9203ec7438ac75dcb4e4e5417", "score": "0.57789415", "text": "def new_year(date) = ::Date.new(Integer === date ? date : date(date).year, 1, 1, reform_jd).new_start(::Date::GREGORIAN)", "title": "" }, { "docid": "aae349a679e39f4d1bf26c90d1002f8e", "score": "0.5770086", "text": "def advance(options)\n options = options.dup\n d = self\n d = d >> options.delete(:years) * 12 if options[:years]\n d = d >> options.delete(:months) if options[:months]\n d = d + options.delete(:weeks) * 7 if options[:weeks]\n d = d + options.delete(:days) if options[:days]\n d\n end", "title": "" }, { "docid": "8d9a9b6f97fb55fe27df57b39d7d90b9", "score": "0.5767008", "text": "def set_cur_year(yyyy)\n\t$cur_year = yyyy\nend", "title": "" }, { "docid": "70b3e38b9489af6d7b64c42345d7cc52", "score": "0.5719875", "text": "def years() 365 * days end", "title": "" }, { "docid": "0e2e0263080a1e0f95db37ef589b7415", "score": "0.5713398", "text": "def default_year\n Time.now.month <= 5 ? Time.now.year : Time.now.year + 1 \n end", "title": "" }, { "docid": "9d6acd3f9e426935e6a3818f8eb06c49", "score": "0.5704859", "text": "def advance_start_at_duration\n settings(:course).advance_start_at_duration\n end", "title": "" }, { "docid": "4810560fe09f2afdd9aa5f42a6ad0292", "score": "0.5691525", "text": "def transitions(year); end", "title": "" }, { "docid": "4810560fe09f2afdd9aa5f42a6ad0292", "score": "0.5691525", "text": "def transitions(year); end", "title": "" }, { "docid": "6b650f0ba8d969b6ead8b881fb97f113", "score": "0.56806386", "text": "def year() end", "title": "" }, { "docid": "69ef78889fe6817efb2fb3b4d5b71741", "score": "0.56443924", "text": "def succ\n next_hour = Hour.new(\"12 AM\")\n\n next_time = (@hour + 1) % 24\n next_hour.instance_eval { @hour = next_time }\n #puts \" succ called: next_hour is #{next_hour}, #{@hour}, #{next_time}\"\n next_hour\n end", "title": "" }, { "docid": "b087078ab74a249fd8c2eea92917f9fe", "score": "0.56225365", "text": "def real_study_years\n if finished?\n end_date = finished_on.to_time\n elsif absolved?\n end_date = disert_theme.defense_passed_on.to_time\n else\n end_date = Time.now\n end\n return (end_date - enrolled_on.to_time).div(1.year) + 1\n end", "title": "" }, { "docid": "0e6e353f1b400b8afb283ec4dc54750a", "score": "0.5607442", "text": "def retirement_planner\n\n time = Time.new\n\n current_year= time.year\n\n print \"How old are you?\"\n current_age = gets.chomp.to_i\n\n print \"What age do you want to retire?\"\n retire_age = gets.chomp.to_i\n\n time_to_retire = retire_age - current_age\n retirement_year = current_year + time_to_retire\n\n puts \"you have #{time_to_retire} left until you retire\\n\"\n puts \" its #{current_year}, so you can retire in #{retirement_year}\"\nend", "title": "" }, { "docid": "7f04a6e54118c347c8cbbb4d31ecd45e", "score": "0.55917233", "text": "def tick_tock\n @hour += 1\n @minute = 0\n @second = 0\n end", "title": "" }, { "docid": "29282ec75b0d0931cf82bb06852063b7", "score": "0.5591066", "text": "def set_year\n if set_month > 2 and set_month < 13\n @year.to_i\n else\n @year.to_i - 1\n end\n end", "title": "" }, { "docid": "c54651fb392b3326dcdcd88374a4f7d4", "score": "0.5583853", "text": "def move_to_week_and_year!(week, year)\n wday = cwday\n wday = 7 if wday == 0 # sunday. bloody sunday\n\n *saved_hours = start_hour, end_hour\n *saved_minutes = start_minute, end_minute\n\n @date = Date.commercial(year, week, wday).in_time_zone.beginning_of_day\n self.starts_at = self.ends_at = self.week = self.year = nil\n self.start_hour, self.end_hour = *saved_hours\n self.start_minute, self.end_minute = *saved_minutes\n save!\n self\n end", "title": "" }, { "docid": "fe07aa3c2df38cc03ce07fc6af3de96e", "score": "0.55718267", "text": "def celebrate_birthday\n\t\t@age += 1\n\t\tabout(true)\n\tend", "title": "" }, { "docid": "4dafc3c12fe1892c5631b478a8abd42f", "score": "0.55597895", "text": "def next_year\n AcademicYear.find_by(year: self.year + 1)\n end", "title": "" }, { "docid": "9bebfc52e82c0ace8d5e140b258d1994", "score": "0.5536499", "text": "def next_opens\n opening_time.advance(weeks: 1)\n end", "title": "" }, { "docid": "d7b22faa9d2aa648e53de0b70076d78f", "score": "0.5529535", "text": "def decrementCalendarYear(adjust)\n # Make sure we don't go out o bounds.\n if @year - adjust < 1900\n mesg = [\n '<C></U>Error',\n 'Can not go past the year 1900',\n ]\n CDK.Beep\n @screen.popupLabel(mesg, 2)\n return\n end\n\n # Decrement the year.\n @year -= adjust\n\n # If we are in Feb make sure we don't trip into voidness.\n if @month == 2\n month_length = CDK::CALENDAR.getMonthLength(@year, @month)\n if @day > month_length\n @day = month_length\n end\n end\n\n # Get the start of the current month.\n @week_day = CDK::CALENDAR.getMonthStartWeekday(@year, @month)\n\n # Redraw the calendar.\n self.erase\n self.draw(@box)\n end", "title": "" }, { "docid": "4bbd85960afb123376316c07b5eb16d1", "score": "0.5519848", "text": "def day_of_year\n (seconds_since_start_of_year / D_SECS).to_i + 1\n end", "title": "" }, { "docid": "71ffbc368408cc3dda84e61c69fdf18e", "score": "0.5517612", "text": "def advance(seconds:)\n @time += (seconds.to_i * 1_000)\n end", "title": "" }, { "docid": "f62ad9698c3b3d66f40674a3bee89cce", "score": "0.55169183", "text": "def gas_year\n y = year\n if self< Date.new(y,10,1)\n y\n else\n y+1\n end\n end", "title": "" }, { "docid": "3bdbc28f95716c18afa2db09958cfecf", "score": "0.55130255", "text": "def current_planning_year_year\n current_fiscal_year_year + 1\n end", "title": "" }, { "docid": "a9cd843af4fbadbeb2869712abdd2601", "score": "0.55086696", "text": "def years ; self * 365.days ; end", "title": "" }, { "docid": "1c4b154c68e9fb30e1b0cdb89a290b51", "score": "0.5503779", "text": "def next_date\n next_observance.try(:start_on) || 100.years.from_now.to_date\n end", "title": "" }, { "docid": "c8b1745a98d279560992438e643b2b24", "score": "0.5485459", "text": "def clock_succ(clock)\n to_clock(clock,clock_sec_succ(to_clock_sec(clock)))\nend", "title": "" }, { "docid": "f9a343d3d5cba053bd987ce65c06099a", "score": "0.5483739", "text": "def list_leap_years(current, future)\n while current <= future do\n if current % 4 != 0\n puts \"#{current} is a common year.\"\n elsif current % 100 == 0 and current % 400 != 0\n puts \"#{current} is a common year.\"\n else\n puts \"#{current} is a leap year!!!\"\n end\n current += 1\n end\n end", "title": "" }, { "docid": "a41711d63b74328b43a853fe6196ca54", "score": "0.54832983", "text": "def increment_turn\n @players.rotate!\n end", "title": "" }, { "docid": "d41577ae434237cc372e51f75942ddf1", "score": "0.54822946", "text": "def faith_years\n (Time.now.year - 1991).ordinalize\n end", "title": "" }, { "docid": "e0456bf4e431ac6e42638bad8c7e3223", "score": "0.54800487", "text": "def advance_by(time)\n dt = @clock + time\n\n due_to_clock = dt<=>@clock\n raise 'Time is out of range' if due_to_clock < 0\n\n return if due_to_clock == 0\n raise 'Cannot advance while running' if @enabled\n\n self.advance_to dt\n end", "title": "" }, { "docid": "ef2909eb99f291e1555ec16b27110f09", "score": "0.5466964", "text": "def advance(date, time)\n date.advance(hours: time.hour, minutes: time.min, seconds: time.sec)\n end", "title": "" }, { "docid": "7267c7df5df0a7e4b60015fc5bbf7ec1", "score": "0.54653007", "text": "def no_repeat_years(first_year, last_year)\nend", "title": "" }, { "docid": "9d0f2773d08e86e0c277d107c3cdd1f6", "score": "0.5464557", "text": "def year\n @year ||= TODAY.year\n end", "title": "" }, { "docid": "6a519b40e8062ee7d534b5c797bd06ae", "score": "0.5463573", "text": "def year\n if @date.cweek == 1 && @date.month == 12\n @date.year + 1\n elsif @date.cweek == 52 && @date.month == 1\n @date.year - 1\n else\n @date.year\n end\n end", "title": "" }, { "docid": "8d03c23f767792f2238076e67ed8a8f9", "score": "0.54618716", "text": "def remember_time\n 1.year\n end", "title": "" }, { "docid": "d5be203a78347a5ced90cff0cae06979", "score": "0.5455349", "text": "def celebrate_birthday\n\t\t@age = @age + 1\n\t\tputs \"Im #{@age}\"\n\tend", "title": "" }, { "docid": "75f19431227fedad2505eacf4c304552", "score": "0.54533803", "text": "def leap_year?(yr1)\r\n if yr1 % 4 > 0\r\n false\r\n elsif yr1 % 100 == 0\r\n if yr1 % 400 == 0\r\n true\r\n else\r\n false\r\n end\r\n elsif yr1 % 4 == 0\r\n true\r\n end\r\nend", "title": "" }, { "docid": "964815a4bb5939efbcf69bd92a266c4f", "score": "0.5452175", "text": "def index\n @year = set_year\n @travel_dates = TravelDate.for_year(set_year)\n @first_year = TravelDate.first_year\n @final_year = TravelDate.final_year\n @next_year = @year + 1\n @prev_year = @year - 1\n end", "title": "" }, { "docid": "62ba2c07b002076590167ed4f855d1ea", "score": "0.54517984", "text": "def celebrate_birthday(age)\n age = @age += 1\n end", "title": "" }, { "docid": "104b59f61cc0c52419d2df31da4b8d98", "score": "0.5449163", "text": "def years_ago(years)\n advance(years: -years)\n end", "title": "" }, { "docid": "742146012cac229f577b31ba80a429bc", "score": "0.5442892", "text": "def this_year\n year(Time.now)\n end", "title": "" }, { "docid": "65ea341c37cf7457ebcf517795df05ed", "score": "0.54365087", "text": "def set_clocks\n now = DateTime.now\n $current_time.value = now.strftime(DateTimeFormat)\n $universal_time.value = now.new_offset.strftime(DateTimeFormat)\n $lunar_date.value = '%4d\\'%02d\\'%02d' % LunarYear.lunar_date(now.to_date)\n now\nend", "title": "" }, { "docid": "2ac09fa8d2b6ad22408f0545e40768e2", "score": "0.5432099", "text": "def next_turn!\n @campaign.gangs.update_all( retreating: false )\n @campaign.players.update_all( maintenance_required: false )\n\n @campaign.turn += 1\n @campaign.players_hire_and_move!\n\n @campaign.save!\n end", "title": "" }, { "docid": "78f99d61d6923319bc002c569b9c5b2c", "score": "0.54209805", "text": "def advance(options)\n t = self\n t = advance_years(options[:years]) if options[:years]\n t = advance_months(options[:months]) if options[:months]\n t = advance_days(options[:days]) if options[:days]\n t = advance_hours(options[:hours]) if options[:hours]\n t = advance_minutes(options[:mins]) if options[:mins]\n t = advance_seconds(options[:secs]) if options[:secs]\n t\n end", "title": "" }, { "docid": "1d6ed28aa35412c15d3665bed0119038", "score": "0.5420282", "text": "def year\n Time.zone.now.year\n end", "title": "" }, { "docid": "3b64fa90ce29773519be7492899f59a3", "score": "0.5416095", "text": "def celebrate_birthday\r\n @age += 1\r\n end", "title": "" }, { "docid": "3b64fa90ce29773519be7492899f59a3", "score": "0.5416095", "text": "def celebrate_birthday\r\n @age += 1\r\n end", "title": "" }, { "docid": "57f0f8f53cd65f3cf64b215f502633cf", "score": "0.54130286", "text": "def celebrate_birthday\r\n\t\t@age +=1\r\n\tend", "title": "" }, { "docid": "01df3a8c4787246b498d6bdd905a16c3", "score": "0.5407773", "text": "def yday() end", "title": "" }, { "docid": "8488eb3461f175c7269d3c98de6efa06", "score": "0.5405554", "text": "def celebrate_birthday\r\n\t\t@age += 1\r\n\tend", "title": "" }, { "docid": "994ddba64688425c1073bd85ea74b388", "score": "0.54018897", "text": "def next_anniversary_date\n while (@due_date <= Date.today)\n @due_date = Date.new(@year += 1, @month, @day)\n end\n end", "title": "" }, { "docid": "44aec352f32a446c52534fe7f11adef9", "score": "0.53949", "text": "def celebrate_birthday\n @age = @age + 1\n end", "title": "" }, { "docid": "44aec352f32a446c52534fe7f11adef9", "score": "0.53949", "text": "def celebrate_birthday\n @age = @age + 1\n end", "title": "" }, { "docid": "44aec352f32a446c52534fe7f11adef9", "score": "0.53949", "text": "def celebrate_birthday\n @age = @age + 1\n end", "title": "" }, { "docid": "1b6d55bb5cacf131f751c849328063c9", "score": "0.5392715", "text": "def celebrate_birthday\n\t\t@age += 1\n\tend", "title": "" }, { "docid": "1b6d55bb5cacf131f751c849328063c9", "score": "0.5392715", "text": "def celebrate_birthday\n\t\t@age += 1\n\tend", "title": "" }, { "docid": "d840f75a0732779a18d175b434389daa", "score": "0.539249", "text": "def current_year\n Time.current.year\n end", "title": "" }, { "docid": "dd22698b66d5b924a2d4907f9ee020b8", "score": "0.5391739", "text": "def celebrate_birthday\n @age += 1\n end", "title": "" }, { "docid": "03ec46a6dc6c593addfacd49e35b95ff", "score": "0.53871447", "text": "def tick\n\t\tif @sec > 0\n\t\t\t@sec -= 1\n\t\telse\n\t\t\t@sec = 59\n\t\t\tif min > 0\n\t\t\t\t@min -= 1\n\t\t\telse\n\t\t\t\t@min = 59\n\t\t\t\tif @hr > 0\n\t\t\t\t\t@hr -= 1\n\t\t\t\telse\n\t\t\t\t\t@hr = 23\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "9aa9274e012fb5d09e9c4ccea896e4c6", "score": "0.5375584", "text": "def leapyear(n)\n start = (n % 100 != 0 && n % 4 == 0) || (n % 100 == 0 && n % 400 == 0) ? n : n + (4 - (n % 4))\n (0...100).step(4).each do |e|\n year = start + e\n if year % 100 != 0\n puts year\n elsif year % 400 == 0\n puts year\n end\n end\nend", "title": "" }, { "docid": "bcaecf3783dbc59fbe0eff4dc901c416", "score": "0.5373485", "text": "def succ\n FiscalYear.new(self + 1)\n end", "title": "" }, { "docid": "12838f184bcb2082380f2bf212555ddc", "score": "0.53721255", "text": "def year_to_season(y); \"#{y}-#{sprintf('%02d', (y + 1) % 100)}\"; end", "title": "" }, { "docid": "87758110d62a47b80cbb53f1edd7ca6a", "score": "0.5367612", "text": "def forward(days = 365)\n from = ::Date.today + 1\n to = ::Date.today + days\n\n between(from, to)\n end", "title": "" }, { "docid": "b917d9de8a245ba8cdb6b77d5e62cb85", "score": "0.53661674", "text": "def celebrate_birthday(age)\n @age += 1\n end", "title": "" }, { "docid": "2468cd44942fcb09d6afb7969baafa5b", "score": "0.53566307", "text": "def start_of_year\n @start_of_year ||= year_start_date\n end", "title": "" }, { "docid": "d1560b4e4ad84abed9ce32720a17b601", "score": "0.5349075", "text": "def year=(value)\n set_date(value, @month, @day)\n end", "title": "" }, { "docid": "b3ef3a78d063cf53e75059b2d95d409d", "score": "0.5348286", "text": "def amy_years\n (Time.now.year - 1977).ordinalize\n end", "title": "" } ]
4f95cccc616c9fb6bcf866524d280696
renders link with icon
[ { "docid": "a47811c0a747aba8e3c488df2027e469", "score": "0.7504087", "text": "def wrap_with_icon(link, icon)\n content_tag(:span, '', :style => 'float: left; margin-right: 0.3em; margin-left: -5px',\n :class => \"ui-icon ui-icon-%s\" % icon) + link\n end", "title": "" } ]
[ { "docid": "5d65503ce1a8767aee20ed4ad6e63d81", "score": "0.7991619", "text": "def icon_link(title, options = {}, icon = \"\")\n content_tag(:a, options) do\n content_tag(:i, \"\", class: icon) + content_tag(:span, title)\n end\n end", "title": "" }, { "docid": "82d5b9ad68bfb2c46d7d8caa6ba7d31f", "score": "0.7817431", "text": "def icon_link_to body, url, icon, html_options={}\n # if url is a model, then we need to turn it ito a path first\n if url.kind_of? ActiveRecord::Base\n url = url_for(url)\n end\n\n # did we provide an icon for this link\n if icon\n icon_html = icon(icon, html_options[:icon_set])\n body = \"#{icon_html} #{body}\".html_safe\n html_options[:class] = \"#{html_options[:class]} icon\"\n end\n \n return link_to body, url, html_options\n\n end", "title": "" }, { "docid": "edd2e357998cec8e8c8333c5765223f9", "score": "0.77870697", "text": "def link_to_with_icon( body, url, icon, html_options = {})\n\n link_text = html_options.key?(:icon_after) ? \"#{body} \"+fa_icon(icon) : fa_icon(icon)+\" #{body}\"\n html_options.delete(:icon_after)\n\n link_to link_text.html_safe, url, html_options\n\n end", "title": "" }, { "docid": "003e1cab297fcb3c829d3046fdda897f", "score": "0.76961714", "text": "def link_to_with_icon(text, icon, path, options = {})\n link_to(\"#{text} <i class=\\\"icon-#{icon}\\\"></i>\".html_safe, path, options)\n end", "title": "" }, { "docid": "3a209a82f3a2a6051b70a7c5d2c6e66d", "score": "0.7518879", "text": "def action_icon link, icon, text\n icon_path = \"/stylesheets/rails_admin/theme/activo/images/icons/24/%s.png\"\n icon_change = \"this.src='#{icon_path}'\"\n link_to link do\n image_tag (icon_path % icon),\n :alt => text, :title => text,\n :onmouseout => (icon_change % icon),\n :onmouseover => (icon_change % \"#{icon}-hover\")\n end.html_safe\n end", "title": "" }, { "docid": "49e491c9e9c68ad94d06cbc50a8ceb65", "score": "0.7516189", "text": "def icon_link_to(text, icon_key, url, options = {})\n icon = icon_tag(icon_key, options.delete(:icon_options) || {})\n unless url\n content_tag(:a, (icon + text).html_safe, options)\n else\n link_to((icon + text).html_safe, url, options)\n end\n end", "title": "" }, { "docid": "c50194a269e01769151851405b6cf911", "score": "0.7494615", "text": "def link_to_with_icon(icon, link, *args)\n link = wrap_with_icon(link, icon)\n link_to link, *args\n end", "title": "" }, { "docid": "6ab74c44ba853a2a0197016b30f39c24", "score": "0.7411069", "text": "def anchor_icon\n context[:anchor_icon] || '<span aria-hidden=\"true\" class=\"octicon octicon-link\"></span>'\n end", "title": "" }, { "docid": "9c2d368267576dd21d8677a48a8c18ab", "score": "0.73888016", "text": "def link_to_with_icon( body, url, icon, html_options = {})\n\n html_options[:class] ||= \"\"\n html_options[:class].prepend( \" \" ) unless html_options[:class].empty?\n html_options[:class] << ' btn--icon-after' if html_options.key?( :icon_after )\n\n link_text = html_options.key?( :icon_after ) ? \"#{body} #{icon( icon, title: nil )}\" : \"#{icon( icon, title: nil )} #{body}\"\n html_options.delete( :icon_after )\n\n link_to( link_text.html_safe, url, html_options )\n\n end", "title": "" }, { "docid": "6b3a249e9768eccb127172148d8d931a", "score": "0.7383678", "text": "def link_to_icon(icon, the_path)\n html_options = (icon == :delete) ? {\n :method => :delete,\n :confirm => \"Are you sure? Clicking 'OK' will remove this record permanently!\",\n :title => \"Delete\",\n :alt_text => \"Delete\"\n } : {}\n link_to(image_tag(\"#{icon.to_s}.png\", :alt => \"#{icon.to_s.upcase}\"), the_path, {:title => \"#{icon.to_s.upcase}\"}.merge(html_options))\n end", "title": "" }, { "docid": "df66451a2c93e0e11c3ce79fca540712", "score": "0.7284939", "text": "def icon_link(url, icon, alt='', title='')\n title = alt if title.blank?\n alt = title if alt.blank?\n if url.blank? || icon.nil?\n nil\n else\n link_to icon('fab', icon, {class: 'fa-2x'}), url, {target: '_blank', alt: alt, title: title}\n end\n end", "title": "" }, { "docid": "848e6153acf5e4f5485d382ddc2415de", "score": "0.7248334", "text": "def dc_icon_for_link(icon, clas = 'dc-link-img')\n return '' if icon.blank?\n\n if icon.match(/\\./)\n _origin.image_tag(icon, class: clas)\n elsif icon.match('<i')\n icon\n else\n _origin.fa_icon(icon)\n end\nend", "title": "" }, { "docid": "cd81d1fa4cfe9acb6e5de3bec6eebd0e", "score": "0.72337526", "text": "def icon_link_to(title, url, options = {})\n link_to(iconize(title, options[:icon]), url, options.merge(icon: nil))\n end", "title": "" }, { "docid": "f1653bfea9c16ced1446cd58406c6577", "score": "0.7170342", "text": "def link_with_icon(name, object, options = {})\n contents = []\n contents << \"<a href='#{object}' data-toggle='tooltip' title='#{options[:title]}'>\"\n contents << \"<i class='icon-#{options[:icon]}'></i>\"\n contents << \"</a>\"\n contents.join.html_safe\n end", "title": "" }, { "docid": "ef1025a9086947d50cdf9ade4119717d", "score": "0.7149123", "text": "def link_to_with_icon(text, icon, url_opts, html_opts=nil)\r\n html_opts ||= {}\r\n html_opts_icon = html_opts.clone\r\n html_opts_icon[:class] = \"#{html_opts_icon[:class]} float_left #{icon} padding_5_right\"\r\n html_opts_icon[:title] ||= text\r\n s = link_to('', url_opts, html_opts_icon)\r\n s << link_to(text, url_opts, html_opts)\r\n end", "title": "" }, { "docid": "8fabe02b42dea851fcd60b8e02541a40", "score": "0.71459466", "text": "def btlink_to(text, to, icon=nil)\n r= \"<div class='vmenu'><a href='\"+url_for(to)+\"'>\"\n r+=image_tag(icon, :border=>0) if icon\n r+=\"<br><b>\"+ text + \"</b></a></div>\"\n r.html_safe\n end", "title": "" }, { "docid": "a719dc6c6cca95e403761649965c8b5a", "score": "0.71429193", "text": "def header_link(id)\n # Add a material icon\n \"<a href=\\\"##{id}\\\">\"\\\n '<i class=\"material-icons\">link</i></a>'.html_safe\n end", "title": "" }, { "docid": "1699a9113fd7e63110e64e01cfd3f7a0", "score": "0.7131751", "text": "def link_to_with_icon(icon_class, text, url, options = {})\n options[:class] = (options[:class].to_s + ' icon_link').strip\n link_to(font_icon(icon_class) + ' ' + text, url, options)\n end", "title": "" }, { "docid": "a6885d5629c3c0d0832d47b296a28212", "score": "0.71157956", "text": "def edit_icon(link_text = nil)\n delete_icon_filename = 'pencil-square-o'\n h.link_to h.fa_icon(delete_icon_filename, style: 'font-size: x-large') + link_text, \n h.edit_note_path(object)\n end", "title": "" }, { "docid": "fe868202d851ae72bdee80fcb7323316", "score": "0.70792556", "text": "def icon_to(icon_name, name, options = {}, html_options = {})\n html_options.add_class 'text-icon-link'\n link_to options, html_options do\n icon(icon_name) + span_tag(name)\n end\n end", "title": "" }, { "docid": "f722fb37fd7e230bb80195225a7f725d", "score": "0.7066807", "text": "def icon_to(text, *args)\n if args.first.is_a?(Hash)\n return icon_tag(:clear) unless args[0].delete(:if)\n end\n link_to(icon_for(text), *args)\n end", "title": "" }, { "docid": "e9c4b0de5b489af32849c2d8fece2964", "score": "0.7062684", "text": "def important_icon_link(title, icon_name, link, options = {:class => 'important-button'})\n link_to \"#{icon(icon_name)} #{title}\".html_safe, link, options\n end", "title": "" }, { "docid": "0fe4e3afd8249d49c05fd20eaed5cb6d", "score": "0.6986451", "text": "def dc_link_to(caption, icon, parms, rest={})\n if parms.class == Hash\n parms.stringify_keys!\n rest.stringify_keys!\n rest['class'] = rest['class'].to_s + ' dc-animate'\n rest['target'] ||= parms.delete('target')\n end\n# \n if icon\n icon_image = if icon.match(/\\./)\n _origin.image_tag(icon, class: 'dc-link-img dc-animate')\n elsif icon.match('<i')\n icon\n else\n _origin.fa_icon(icon)\n end\n end\n# \n if caption\n caption = t(caption, caption)\n icon_image << ' ' if icon_image\n end\n _origin.link_to(\"#{icon_image}#{caption}\".html_safe, parms, rest) \nend", "title": "" }, { "docid": "7cfac2370b709e8cc61514a0e01c1a22", "score": "0.6966484", "text": "def dc_link_for_edit1(opts, link_text) #:nodoc:\n icon = opts.delete('icon')\n url = _origin.url_for(opts)\n \"<li><div class='drgcms_popmenu_item' style='cursor: pointer;' data-url='#{url}'>\n#{_origin.fa_icon(icon)} #{link_text}</div></li>\\n\"\nend", "title": "" }, { "docid": "7cfac2370b709e8cc61514a0e01c1a22", "score": "0.6966484", "text": "def dc_link_for_edit1(opts, link_text) #:nodoc:\n icon = opts.delete('icon')\n url = _origin.url_for(opts)\n \"<li><div class='drgcms_popmenu_item' style='cursor: pointer;' data-url='#{url}'>\n#{_origin.fa_icon(icon)} #{link_text}</div></li>\\n\"\nend", "title": "" }, { "docid": "a692cb56de7349efe2506b67c353f4d4", "score": "0.68963176", "text": "def table_link label, icon, url\n tag.a class: 'ui compact basic button', href: url do\n concat tag.i class: \"#{icon} icon\"\n concat label\n end\n end", "title": "" }, { "docid": "a663daabd91eec81281474d55d69b443", "score": "0.6818414", "text": "def link_to(title, href = title, opts = {})\n unless opts.key? :icon\n attributes = opts.collect{|k,v| \"#{k}='#{v}'\"}.join(\" \")\n return \"<a href=\\\"#{href}\\\" #{attributes}>#{title}</a>\"\n else\n icon = opts.delete(:icon)\n opts = opts.merge(:href => href)\n return %Q{<a #{opts.collect{|k,v| \"#{k}='#{v}'\"}.join(\" \")}>\n <i class=\"#{icon.gsub(\".\", ' ')}\"></i>\n #{title}\n </a>}\n end\n end", "title": "" }, { "docid": "2b49456792ccf69c93e91bea9d755841", "score": "0.67917836", "text": "def render_link_for(item)\n original_path = value_for(item, :original)\n thumbnail_path = value_for(item, :thumbnail)\n title = @options[:title] ? value_for(item, :title) : nil\n image = @template.image_tag(thumbnail_path, class: @options[:image_class])\n @template.link_to(image, original_path, rel: 'hermitage',\n class: @options[:link_class],\n title: title)\n end", "title": "" }, { "docid": "7cd53640e256035307eb93c58e72a974", "score": "0.674394", "text": "def link_to_fav_icon\n # tag(:link, {:rel => \"shortcut icon\", :href => compute_public_path('favicon.ico', 'images'), :type => \"image/x-icon\"}, true)\n \"<link href=\\\"#{compute_public_path('favicon.ico', 'images')}\\\" rel=\\\"shortcut icon\\\" type=\\\"image/x-icon\\\"/>\"\n end", "title": "" }, { "docid": "2f0e759fd7838c32033080a150dea082", "score": "0.6742295", "text": "def function_icon(text, function)\n link_to(icon_for(text), '#', :onclick => function)\n end", "title": "" }, { "docid": "1c57d7a8b35692661614bf73f539c62f", "score": "0.6687904", "text": "def action_icon(icon, label = nil)\n html = tag.span('', class: \"icon icon-#{icon}\")\n html << ' ' << label if label\n html\n end", "title": "" }, { "docid": "7f8208b73ef96bd9e3f25a9f134be8e1", "score": "0.66784865", "text": "def nav_icon(icon, path)\n content_tag :li, class: \"nav-item p-0\" do\n link_to icon(icon, class: \"fa-fw fa-lg\"), path, class: \"nav-link\"\n end\n end", "title": "" }, { "docid": "256d83e61dddaf7f210bfc9a66af94b2", "score": "0.66729283", "text": "def icon_for(icon)\n content_tag(:i, nil, class: icon.to_s)\n end", "title": "" }, { "docid": "7c367a2ae4ae8f20e0775e9edd67269d", "score": "0.66699994", "text": "def render_icon(var)\n \"<span class='icon icon-#{var.parameterize}' aria-hidden='true'></span>\".html_safe\n end", "title": "" }, { "docid": "5d030310629348f98c7c3c3d8566d588", "score": "0.6647926", "text": "def edit_link(obj, icon = true, compact = false)\n line_break = compact ? \"\" : \"<br/>\".html_safe\n icon_link = link_to(icon_tag('edit'), polymorphic_url([:forge] + Array(obj)) + \"/edit\", :class => \"edit\") if icon\n title_link = content_tag(:small, (link_to \"Edit\", polymorphic_url([:forge] + Array(obj)) + \"/edit\", :class => \"edit\"))\n content = icon_link.blank? ? title_link.html_safe : icon_link.html_safe + line_break + title_link.html_safe\n return content_tag(:div, content, :class => 'item-action') if can?(:edit, obj)\n end", "title": "" }, { "docid": "ba75c6c07f59240da384221888870221", "score": "0.6628239", "text": "def dc_link_to(caption, icon, parms, rest={})\n icon_pos = 'first'\n if parms.class == Hash\n parms.stringify_keys!\n rest.stringify_keys!\n url = parms.delete('url')\n rest['target'] ||= parms.delete('target')\n parms['controller'] ||= 'cmsedit'\n icon_pos = parms.delete('icon_pos') || 'first'\n end\n\n icon_image = dc_icon_for_link(icon)\n if caption\n caption = t(caption, caption)\n icon_image << ' ' if icon_image\n end\n\n body = (%w[first left].include?(icon_pos) ? \"#{icon_image}#{caption}\" : \"#{caption} #{icon_image}\").html_safe\n url ? _origin.link_to(body, url, rest) : _origin.link_to(body, parms, rest)\nend", "title": "" }, { "docid": "6b82d5f4957ddb8b192ee5487f0513c1", "score": "0.65816844", "text": "def dropdown_item_icon(icon, path, label)\n link_to icon(icon, label, class: \"fa-fw\"), path, class: \"dropdown-item\"\n end", "title": "" }, { "docid": "c2588519d5ad821aa7737e85f2acde01", "score": "0.6579822", "text": "def nav_item_icon(content, icon_name, controller, html_options = {})\n html_options[:title] = \"Ir a #{content}\"\n html_options[:active] = controller.to_s == controller_name\n content = fa_icon(icon_name.to_s)\n href = html_options.delete(:href) || send(\"#{controller}_url\")\n nav_item_tag content, href, html_options\n end", "title": "" }, { "docid": "d50b42dd899bca99d1854bc24f7e7db9", "score": "0.65748435", "text": "def icon(icon_name)\n \"<i class=\\\"icon-#{icon_name}\\\"></i>\".html_safe\n end", "title": "" }, { "docid": "bf41ee8ce7bc07b2f19464cde1d63d2b", "score": "0.65718454", "text": "def help_icon(path)\n link_to('#help-modal', class: 'display-modal') do\n concat content_tag(:i, nil, class: 'eui-icon eui-fa-info-circle', data: { 'help-path': path })\n concat content_tag(:span, \"Help modal for #{title}\", class: 'is-invisible')\n end\n end", "title": "" }, { "docid": "a19c8e48cdf946cc60e68374dc06c0db", "score": "0.65676105", "text": "def action_icon(icon, label = nil)\n html = content_tag(:i, \"\", :class => \"icon-#{icon}\")\n html << ' ' << label if label\n html\n end", "title": "" }, { "docid": "4a602f824b79b842fdfe5a67bb9820b8", "score": "0.65621275", "text": "def table_action_link(icon, url, html_options = {})\n add_css_class(html_options, \"icon icon-#{icon}\")\n link_to('', url, html_options)\n end", "title": "" }, { "docid": "8b35ab6a48e09d5c7bde38a31406f479", "score": "0.6545402", "text": "def fa_icon( object)\n \"fa-\" << object.icon\n end", "title": "" }, { "docid": "54a38d480049bcc0b554afad6d4dca7a", "score": "0.6545024", "text": "def service_icon_link(path, service, link_css, wrapper, target = nil, id = nil)\n if service.respond_to?(:icon)\n service_name = service.icon\n else\n service_name = \"#{service}.png\"\n end\n link = %Q{<a #{'id=' + id if id} href=\"#{path}\" #{'target=' + target if target} class=\"service-link #{link_css}\">#{service_icon(service_name, 16, service.name)}</a>}.html_safe\n if wrapper\n content_tag(wrapper, link, :class => 'identity-service').html_safe\n else\n link\n end\n end", "title": "" }, { "docid": "0d62799f8ee005ed7b171a2ee7b5df97", "score": "0.65337574", "text": "def link\n \"<a href='#{path}'>#{title}</a>\"\n end", "title": "" }, { "docid": "a4dadfd3a9eebf0d70c491543dd490ad", "score": "0.6519836", "text": "def icon(filename, link=nil, alt=nil, path=\"#{icons_loc}/\", size='16x16', color='gray')\n image_path = \"#{icons_loc}/#{color}/#{size}/#{filename}.png\"\n image_options = { :size => size, :class => \"icon\", :alt => (alt ? alt : filename) }\n if link\n myconfirm = (filename == \"Trash\" ? \"Are you sure you want to delete this?\" : nil)\n link_to image_tag(image_path, image_options), link, :class => \"icon\", :confirm => myconfirm\n else\n image_tag image_path, image_options\n end\n end", "title": "" }, { "docid": "f8781e031be9f690383a46309c179130", "score": "0.6515587", "text": "def submissions_icon_tag\n fa_icon :send\n end", "title": "" }, { "docid": "ada9711288e7bace2f5fa0022869d109", "score": "0.65119517", "text": "def icon_url; end", "title": "" }, { "docid": "ada9711288e7bace2f5fa0022869d109", "score": "0.65119517", "text": "def icon_url; end", "title": "" }, { "docid": "0ad20cc614cbdbf2fba374ba6a158270", "score": "0.6498228", "text": "def icon_to(source, options = {}, html_options = {}, *parameters_for_method_reference)\n link_to_original(image_tag(source.downcase, :border => 0, :align => \"top\", :title => fmt_icon_title(source)), options, html_options, *parameters_for_method_reference)\n end", "title": "" }, { "docid": "82d9e57d1ae6d6a7e6d49b648ebca387", "score": "0.64815927", "text": "def fa_icon( icon, html_options = {} )\n\n html_options[:class] ||= \"\"\n html_options[:class].prepend \" \" unless html_options[:class].empty?\n html_options[:'aria-hidden'] = \"true\"\n\n if controller_path.starts_with? 'admin/'\n html_options[:class] += \" fa fa-#{icon.split(/\\s+/).join(' fa-')}\"\n tag('i', html_options, true)+'</i>'.html_safe\n else\n \"<svg class=\\\"i--#{icon}#{html_options[:class]}\\\"><use xlink:href=\\\"#icon-#{icon}\\\"/></svg>\".html_safe\n end\n end", "title": "" }, { "docid": "dfe7766861569f7c28d2f874cf26ad63", "score": "0.6453449", "text": "def nav_link(title, icon, url, new_tab: false, role: nil, data: nil)\n if url\n icon_uri = URI(\"fa://#{icon}\")\n render partial: 'layouts/nav/link',\n locals: { title: title, class: 'dropdown-item', icon_uri: icon_uri, url: url.to_s, new_tab: new_tab, role: role, data: data }\n end\n end", "title": "" }, { "docid": "dfe7766861569f7c28d2f874cf26ad63", "score": "0.6453449", "text": "def nav_link(title, icon, url, new_tab: false, role: nil, data: nil)\n if url\n icon_uri = URI(\"fa://#{icon}\")\n render partial: 'layouts/nav/link',\n locals: { title: title, class: 'dropdown-item', icon_uri: icon_uri, url: url.to_s, new_tab: new_tab, role: role, data: data }\n end\n end", "title": "" }, { "docid": "798cd3bc6f4f59871d7c9fdfbc703f3e", "score": "0.6448852", "text": "def table_action_link(icon, url, html_options = {})\n add_css_class(html_options, \"glyphicon glyphicon-#{icon}\")\n link_to('', url, html_options)\n end", "title": "" }, { "docid": "a5ab354eeee8bc41e7e4a29dca489255", "score": "0.64372057", "text": "def build_icon_tag\n fa_icon :'chevron-circle-right', title: 'Next step'\n end", "title": "" }, { "docid": "878fcf8526a421ecfffe0177783a5ce9", "score": "0.6431018", "text": "def fa_icon(icon)\n content_tag :i, class: \"fa fa-{icon}\"\n end", "title": "" }, { "docid": "009a6ff6aacc91275145f0cbdcca2e56", "score": "0.64256996", "text": "def icon_image_thumb(icon)\n \"<a href='/icons/%s' title='%s'><img src='%s' width='72' height='72' class='hidden' /></a>\" % [icon.id, icon.full_name, icon.path]\n end", "title": "" }, { "docid": "a98829b6e23fb4c933aaf5e50a9ba94e", "score": "0.64255774", "text": "def game_icon_link(game)\n game_link( game, image_tag( \"icons/#{game.map.country}.png\" ) ) \n end", "title": "" }, { "docid": "ad0fdb2380a288bb6d5ea9635afd01cf", "score": "0.6408254", "text": "def help_icon(help_text, icon=:help)\n return '' unless help_text\n return %Q(<a href=\"#\" title=\"#{help_text}\" onclick=\"return false\">#{icon_tag(icon, :class => 'help')}</a>)\n end", "title": "" }, { "docid": "325184ed548314f93a39360ab8dbc046", "score": "0.6406595", "text": "def recitation_icon_tag\n fa_icon :'hand-o-up'\n end", "title": "" }, { "docid": "ba5aa77ea541d59779a2c5b181ea1ad2", "score": "0.6398086", "text": "def command_link(command, options={})\n render_favicon_for_command(command) + \" \" + basic_command_link(command, options.merge(:class=>'iconed')) #+ \"- #{any_command_stats(command)}\"\n end", "title": "" }, { "docid": "565c59075779afa78423fa0b235ce83b", "score": "0.6398078", "text": "def nav_link(title, icon, url, target: \"_self\", role: nil)\n render partial: \"layouts/nav/link\", locals: { title: title, faicon: icon, url: url.to_s, target: target, role: role } if url\n end", "title": "" }, { "docid": "d80003c98b061bf282cb910691832553", "score": "0.63813055", "text": "def icon_tag(icon)\n image_tag(\"forge/icons/#{icon}.png\")\n end", "title": "" }, { "docid": "3de35112e792bf3842ccbb9871033c63", "score": "0.638029", "text": "def render_home_page_link(path, link, opts = {}) \n if opts[:i_class]\n content_tag :a, :href => path do \n content_tag(:i, '', :class => opts[:i_class]) << \" \" << link\n end\n else\n content_tag(:a, link, :href => path) \n end\n end", "title": "" }, { "docid": "ce797d22616447ef3f0395d9bb2f0c81", "score": "0.63758135", "text": "def icon\n key, = expand_i18n_keys 'icons', suffix: '_html'\n t key\n end", "title": "" }, { "docid": "86beeb7f25f072eae0c494fe808cc308", "score": "0.63619906", "text": "def ui_button(icon, label_text, url, options = {})\n setup_button(icon, label_text, options)\n link_to(icon_and_text(label_text, icon), url, options).html_safe\n end", "title": "" }, { "docid": "5b6ebe11b612eeb8c95d9de3a1dc228b", "score": "0.63583046", "text": "def action_link(title, link, options = {})\n klass = options[:class] unless options[:class].blank?\n confirmation = options[:confirm] unless options[:confirm].blank?\n icon_link = link_to(icon_tag(options[:icon]), link, :confirm => confirmation) + \"<br />\".html_safe if options[:icon]\n title_link = content_tag(:small, link_to(title, link, :confirm => confirmation))\n content = icon_link.blank? ? title_link.html_safe : icon_link.html_safe + title_link.html_safe\n return content_tag(:div, content.html_safe, :class => \"item-action #{klass}\")\n end", "title": "" }, { "docid": "730cfa3d66d3ba5535be8200ba0bdad3", "score": "0.63509464", "text": "def icon_btn icon_name, text, path, opts={}\n opts[:class] = \"btn btn-#{opts[:class] || 'default'}\"\n link_to path, opts do\n [ icon(icon_name), text ].join(\" \").html_safe\n end\n end", "title": "" }, { "docid": "2c35555da17090a5f08b95ae950d4c37", "score": "0.63487065", "text": "def resource_link(resource, size = 0.4)\n block = String.new\n block << \"<td width='#{146 * size}px'>\"\n block << \"<a href='#{base_url}/admin/#{resource.class.name.underscore}/#{resource.id}' target='_blank'>\"\n block << \"<img width='#{73 * size}px' height='#{43 * size}px'\n src='#{resource_link_icon}'>\"\n block << '</a></td>'\n block\n end", "title": "" }, { "docid": "82b72eba0b712bcfd2de1691f6df9bdb", "score": "0.63483316", "text": "def icon_url style = :original\n icon.url(style, timestamp: false)\n end", "title": "" }, { "docid": "f494c192e4edf163e588c05616c5ae0a", "score": "0.6345536", "text": "def link_favicon(extra={})\n attrs = {:type=>\"image/x-icon\", :rel=>\"icon\", :src=>'/favicon.ico'}\n attrs.merge! extra\n link!(attrs)\n end", "title": "" }, { "docid": "b395f10e7fa710ae25dbfc550d15addf", "score": "0.63382226", "text": "def _whimsy_forms_iconlink(**args)\n if args[:iconlink]\n _div.input_group_btn do\n _a.btn.btn_default type: 'button', aria_label: iconlabel, href: args[:iconlink], target: 'whimsy_help' do\n _span.glyphicon class: args[:icon], aria_label: args[:iconlabel]\n end\n end\n elsif args[:icon]\n _span.input_group_addon do\n _span.glyphicon class: args[:icon], aria_label: args[:iconlabel]\n end\n elsif ['radio', 'checkbox'].include?(args[:type])\n # No-op: do not include blank addon for these controls\n else\n _span.input_group_addon # HACK: include blank addon to ensure consistent sizing\n end\n end", "title": "" }, { "docid": "8abf8e47ea2e1accb8be670b9e717513", "score": "0.6329539", "text": "def icon\n fa_icon\n end", "title": "" }, { "docid": "c96275201e028ff67dee930f625c727d", "score": "0.63273466", "text": "def icon_to_remote(text, *args)\n if args.first.is_a?(Hash)\n return icon_tag(:clear) unless args[0].delete(:if)\n end\n link_to_remote(icon_for(text), *args)\n end", "title": "" }, { "docid": "28ca721cfcaa621586f583c7c2f3b7db", "score": "0.63221943", "text": "def rights_statement_icon_link(rs_data)\n link_to(\n image_tag(rs_data[1][:icon_url], class: 'rights-statement-icon'),\n rs_data[1][:uri], class: 'rights-statement-link', target: '_blank'\n )\n end", "title": "" }, { "docid": "50c597aedadacd9da06665983eecbfc2", "score": "0.632153", "text": "def fa_icon(*args, &block)\n html_options = args.extract_options!\n html_options[:class] = Array html_options[:class]\n html_options[:class] << 'fa'\n args.each { |suffix| html_options[:class] << \"fa-#{fa_map suffix}\" }\n\n content_tag :i, nil, html_options, &block\n end", "title": "" }, { "docid": "deab07230a35955c5532ce7d4875f79d", "score": "0.6312067", "text": "def link(attrs = {})\n add_header \"<link #{html_attrs(attrs)} />\"\n end", "title": "" }, { "docid": "fe53d54f49bb5d02ece785bf2c942c84", "score": "0.63114625", "text": "def tolaria_navigation_link(label, icon, index_path, options = {})\n options[:class] = \"#{options[:class]} current\" if index_path.in?(url_for)\n link_to index_path, options do\n fontawesome_icon(icon) << \" #{label}\"\n end\n end", "title": "" }, { "docid": "1fbf1978d11dc84eff04c227418e76be", "score": "0.63085496", "text": "def dashboard_icon_tag\n fa_icon :dashboard\n end", "title": "" }, { "docid": "b813594ecadd35879c843900c3d3b618", "score": "0.6306549", "text": "def action_link(action, href, html_options = {})\n # join passed html class (if any) with the default class\n html_options[:class] = [html_options[:class], \"action_link\", \"action_link_#{action}\"].compact.join(\" \")\n\n link_to(content_tag(:i, \"\", :class => \"icon-\" + FONT_AWESOME_ICON_MAPPINGS[action.to_sym]), href, html_options)\n end", "title": "" }, { "docid": "c7e0a15e439e5d0b66c30fb69538899f", "score": "0.63022345", "text": "def icon(icon_name)\n content_tag(:span, '', class: \"fas fa-#{icon_name}\")\n end", "title": "" }, { "docid": "65c505638cbe256a273e2d3a6c83bc7e", "score": "0.6299391", "text": "def edit_link_to(text, path, options = {})\n link_to_with_icon(text, \"pencil\", path, options)\n end", "title": "" }, { "docid": "bf03efc2b809dc81461cbddc9c96eeb3", "score": "0.6297671", "text": "def render_link(link, message = nil)\n message ||= link\n \"<#{link}|#{message}>\"\n end", "title": "" }, { "docid": "bf03efc2b809dc81461cbddc9c96eeb3", "score": "0.6297671", "text": "def render_link(link, message = nil)\n message ||= link\n \"<#{link}|#{message}>\"\n end", "title": "" }, { "docid": "a9e16ac24d726af587b716021326faf3", "score": "0.62923115", "text": "def icon(name)\n content_tag(:i, \"\", class: \"icon-#{name}\")\n end", "title": "" }, { "docid": "50791368bc673829aaa86686f555d50f", "score": "0.629202", "text": "def icon\n raise NotImplementedError\n end", "title": "" }, { "docid": "50791368bc673829aaa86686f555d50f", "score": "0.629202", "text": "def icon\n raise NotImplementedError\n end", "title": "" }, { "docid": "26503d3780497c0285144d4dcb327c67", "score": "0.62917805", "text": "def icon_tag(identifier)\n \"<i class='icon-#{identifier}'></i>\".html_safe\n end", "title": "" }, { "docid": "2ce526b40b1953e33b265c5739f954f0", "score": "0.6281256", "text": "def html_link(item)\n tag(:a, yield,\n :href => item.url(@resource),\n :title => item.title(@inject[item.id])\n )\n end", "title": "" }, { "docid": "2537c58ffb8f2d6dbb984f51cb0c12c9", "score": "0.6278509", "text": "def icon_tag(type, text=nil)\n \"<i class='icon-#{ type.to_s }'></i> #{ text }\".html_safe\n end", "title": "" }, { "docid": "f55d4e264327923f15c3b64a5332424f", "score": "0.6277038", "text": "def icon_open_url; end", "title": "" }, { "docid": "02be74281f510a565f5cc86779aa8dac", "score": "0.6267015", "text": "def fontawesome_icon(icon = \"\", options = {})\n icon = icon.to_s.parameterize.tr(\"_\", \"-\")\n content_tag :i, nil, options.reverse_merge({\n :class => \"icon icon-#{icon}\",\n :\"aria-hidden\" => true,\n })\n end", "title": "" }, { "docid": "c9d03a76ce03e463b791e386a67ec999", "score": "0.62620884", "text": "def user_link\n h.link_to(h.user_path(object), class: 'hover-emphasis user-link') do\n (h.content_tag(:div, '', class: 'user-icon inlined') + object.username)\n end\n end", "title": "" }, { "docid": "b494b11064a26ebab415af2e38568d92", "score": "0.62603354", "text": "def nav_link(link_text, link_path, icon = nil)\n class_name = current_page?(link_path) ? 'active' : ''\n content_tag(:li, :class => class_name) do\n if !icon.blank?\n use_svg(icon) + link_to(link_text, link_path)\n else\n link_to(link_text, link_path)\n end\n end\n end", "title": "" }, { "docid": "3d32a28823419cc753564d4fb98a23cf", "score": "0.6253586", "text": "def link_to_discussion\n link_to \"Go to Discussion \"+icon(\"comments\"), :controller => :discussion, :action => :index\n end", "title": "" }, { "docid": "85167a7bb1bec43109a1c920d2e14afa", "score": "0.6244725", "text": "def icon(icon_name)\n content_tag :div, nil, class: \"icon-#{icon_name}\"\n end", "title": "" }, { "docid": "a09c353422c381582875fef657671ef8", "score": "0.62434536", "text": "def icon\n img :src => $imgHostURL + \"/\" + $iconImg + \".png\"\n end", "title": "" }, { "docid": "ff2d3edd5e13c8ff7e3c7d8c19df2c50", "score": "0.6243105", "text": "def remote_star_icon(todo=@todo)\n link_to( image_tag_for_star(todo),\n toggle_star_todo_path(todo),\n :class => \"icon star_item\", :title => t('todos.star_action_with_description', :description => todo.description))\n end", "title": "" }, { "docid": "9f7e92335e6390b85146df28f5afbcfc", "score": "0.6242923", "text": "def btn_link(text, path, type: 'primary', icon: '', outline: false)\n i = ''\n btn_outline = ''\n btn_outline = '-outline' if outline\n i = \"<i class='glyphicon glyphicon-#{icon}'></i>\" unless icon.blank?\n \"<a href='#{h(path)}' class='btn btn#{btn_outline}-#{type}'>#{i} #{h(text)}</a>\".html_safe\n end", "title": "" }, { "docid": "070e41657967c44abc7ab85155b8f2e7", "score": "0.623029", "text": "def material_icon(icon_name, align: '')\n content_tag :i, icon_name, class: \"#{align} material-icons\"\n end", "title": "" } ]
898dcf9c1ccb67d8890a7020572de76f
Traverses in an array, and tests each element with the 'predicate'. If the result of the test is true, applies the function to the element exactly once.
[ { "docid": "e61b0e40d675345b514cc87b4edcbacd", "score": "0.53250706", "text": "def replace(exp, predicate, function)\n if predicate.call(exp) and array?(exp)\n function.call(exp.collect { |item| replace(item, predicate, function) })\n elsif predicate.call(exp) and (not(array?(exp)))\n function.call(exp)\n elsif not(predicate.call(exp)) and array?(exp)\n exp.collect { |item| replace(item, predicate, function) }\n else\n exp\n end\n end", "title": "" } ]
[ { "docid": "7eb22ee6b11db7f3653bdc8d0bef3167", "score": "0.6390763", "text": "def my_one?(array, &prc)\n results = array.select {|ele| prc.call(ele)}\n return 1 == results.length\nend", "title": "" }, { "docid": "efc0d88c460b803cb9b2447e5781f67e", "score": "0.6083891", "text": "def reduce_to_any_true(source_array)\n i = 0 \n while i < source_array.length do\n return true if source_array[i]\n i += 1 \n end\nend", "title": "" }, { "docid": "db4de69f94e50b5381cb08ae4b177333", "score": "0.6051064", "text": "def every?(arr, &proc)\r\n count = 0\r\n arr.each { |el| count += 1 if proc.call(el) }\r\n count == arr.length\r\nend", "title": "" }, { "docid": "af35ea933f9459c0d132cbeb3bbc46cf", "score": "0.6008889", "text": "def every?(arr, &prc)\n count = 0\n arr.each do |ele| \n if prc.call(ele)\n count += 1\n end\n end\n count == arr.length\nend", "title": "" }, { "docid": "095d62417fcbd2531a83690e86f87708", "score": "0.59102327", "text": "def one?(arr)\n counter = 0\n arr.each do |el|\n counter += 1 if yield(el) == true\n return false if counter > 1\n end\n counter == 1\nend", "title": "" }, { "docid": "537101fb542f1eac41a992c5980687d9", "score": "0.5878095", "text": "def my_all?( proc_argument = nil )\n result = []\n\n my_each do |element|\n if block_given? \n result << element if yield(element)\n else\n result << element if proc_argument.call(element)\n end\n end\n\n # If the new array has the same number of true elements as the original array, we know that all elements satisfied the condition\n self.size == result.size ? true : false\n end", "title": "" }, { "docid": "40253fc8ee7d454d87fe8678cbad448b", "score": "0.5812156", "text": "def reduce_to_any_true(source_array)\n i = 0\n\n while i < source_array.length do\n if source_array[i] == true\n return true\n end\n i += 1\n end\n \n return false\nend", "title": "" }, { "docid": "734a4413be0c637a9f57eacb02b81a28", "score": "0.5808063", "text": "def any?(array)\n return false if array.empty?\n result = nil\n\n array.each do |element|\n result = yield(element)\n return result if result == true\n end\n\n result\nend", "title": "" }, { "docid": "1e61b209dd25a18ef3020c2f27046456", "score": "0.57590014", "text": "def my_any?(arr, &prc)\n arr.each do |ele|\n return true if prc.call(ele)\n end\n false\nend", "title": "" }, { "docid": "97eb4b8f451fba2e81cd14f3cc3f9389", "score": "0.57435024", "text": "def reduce_to_any_true(source_array)\n i = 0 \n while i < source_array.length do\n if source_array[i] == true \n return true\n end\n i += 1 \n end\n return false\nend", "title": "" }, { "docid": "6160fce703f38c7244eafdecfd87b66e", "score": "0.5719848", "text": "def any?(array)\n array.each do |element|\n return true if yield(element)\n end\n \n false\nend", "title": "" }, { "docid": "fde85b0151faf6bfb0ab954a11198987", "score": "0.5714687", "text": "def filter(arr)\n results = []\n each arr do |x|\n if yield(x)\n results << x\n end\n end\n results\nend", "title": "" }, { "docid": "da337168c595b9f6e335bb1b10940e20", "score": "0.5705316", "text": "def all?(array)\n i = 0\n score = 0\n\n while i < array.length\n if yield(array[i])\n score += 1\n end\n i += 1\n end\n\n score == array.length\nend", "title": "" }, { "docid": "e067400f8a9bffea05b8761a8c1006d7", "score": "0.5697337", "text": "def test(arr)\n arr.map do |el|\n arr.inject(1) do |memo, el2|\n next memo if arr.index(el2) == arr.index(el)\n memo * el2\n end\n end\nend", "title": "" }, { "docid": "0a305a4b199f68c3c3751029154453c2", "score": "0.5693959", "text": "def reduce_to_any_true(source_array)\n counter = -1 \n while counter < source_array.length\n counter += 1\n while source_array[counter]\n if source_array[counter] == true\n return true\n else\n counter += 1\n end\n end\n end\n return false\nend", "title": "" }, { "docid": "c8fa1f1d35241627a3c73b50adadaf45", "score": "0.5672649", "text": "def every?(arr, &prc)\n\n arr.each do |ele|\n return false if !(prc.call(ele))\n end\n\n true\nend", "title": "" }, { "docid": "af2fd6260ab6fdad41e07f2f82be6a0d", "score": "0.5665868", "text": "def any?(array)\n array.each do |el|\n return true if yield(el)\n end\n\n false\nend", "title": "" }, { "docid": "02f5962ff527e736f765a327eb2325e3", "score": "0.5644134", "text": "def predicate(&block)\n @predicate = block unless block.nil?\n @predicate\n end", "title": "" }, { "docid": "aa485c74d34bfd320f8ccd16effd73d5", "score": "0.56098235", "text": "def some?(array, &prc)\n array.each do |ele|\n return true if prc.call(ele)\n end\n false\nend", "title": "" }, { "docid": "12759340601358e95243007dbec24d55", "score": "0.5590231", "text": "def proctition(arr, &prc)\n true_arr = []\n false_arr = []\n\n arr.each do |ele|\n if prc.call(ele)\n true_arr << ele\n else\n false_arr << ele\n end\n end\n true_arr.concat(false_arr)\nend", "title": "" }, { "docid": "3e4fcf5c0d6e6c8d36946bdbf3563195", "score": "0.5572038", "text": "def predicate?(*args)\n predicate.call(*args)\n end", "title": "" }, { "docid": "5593c079f73bef460d0fb07b0235c95c", "score": "0.5571284", "text": "def any?(arr)\n arr.each { |el| return true if yield(el) }\n false\nend", "title": "" }, { "docid": "5593c079f73bef460d0fb07b0235c95c", "score": "0.5571284", "text": "def any?(arr)\n arr.each { |el| return true if yield(el) }\n false\nend", "title": "" }, { "docid": "5a0e7e7e64a9038cf58eb0af902d987e", "score": "0.55703306", "text": "def reduce_to_all_true(array)\n counter = 0;\n while counter < array.length do\n return false if !array[counter];\n counter += 1;\n end\n return(true);\nend", "title": "" }, { "docid": "4676581167baba5db12b68b6678657db", "score": "0.555725", "text": "def reduce_to_any_true(source_array)\n return source_array.any? {|word| word}\nend", "title": "" }, { "docid": "b76fb6e74fdaecdad246d98008ef7aec", "score": "0.5549542", "text": "def proctition(arr, &prc)\n true_arr = []\n false_arr = []\n\n arr.each do |ele|\n if prc.call(ele)\n true_arr << ele\n else\n false_arr << ele\n end\n end\n\n true_arr + false_arr\nend", "title": "" }, { "docid": "1ae25265e6c80ef4e1e752c44fed639f", "score": "0.55477405", "text": "def any1?(arr, &block)\n return false if arr.empty?\n block.call(arr.first) ? true : any?(arr.drop(1), &block)\nend", "title": "" }, { "docid": "e3ceec06da6235e617c26e4dacfcf4ea", "score": "0.55376744", "text": "def any\n C.curry.(\n ->(f, xs) {\n _f = ->(acc, x) {\n f.(x) ? true : acc\n }\n\n C.fold.(_f, xs, false)\n }\n )\n end", "title": "" }, { "docid": "9c062833e145c67c6161e5e87a6f5d78", "score": "0.5518547", "text": "def reduce_to_all_true(source_array)\n i = 0\n while i < source_array.length do\n return false if !source_array[i]\n i += 1\n end\n return true\nend", "title": "" }, { "docid": "628597b6344f4e9f00a88373097ee89a", "score": "0.55103505", "text": "def reduce_to_all_true(source_array) \n i = 0\n while i < source_array do\n return false if !source_array[i]\n i += 1\n end\nend", "title": "" }, { "docid": "95eb6d05ff777e34d7990a21b7e13d85", "score": "0.5439176", "text": "def filter(arr)\n # create new empty array to populate with filtered elements\n arr2 = []\n # for each element in array, check if it passes the test in the block, called by yield, and if it does add it to the new array\n arr.each { |x| arr2 << x if yield(x) }\n # return the new array, setting the original array to these new values\n arr2\nend", "title": "" }, { "docid": "6049b1c9143d804ea7776469f89e897f", "score": "0.5438448", "text": "def any?(array)\n array.each do |item|\n check = yield(item) if block_given?\n if check == true\n return true\n else\n next\n end\n end\n false\nend", "title": "" }, { "docid": "49898fd4843d47eada2c6e8bc203ee41", "score": "0.5410424", "text": "def array_42(a)\n\ta.any?{|x| x == 42}\nend", "title": "" }, { "docid": "c69d606380a7b9c006c17f9306adce84", "score": "0.54097486", "text": "def array_42(arr)\n arr.map{|x| x== 42}.count{|x| x == true} == 1 ? true : false\nend", "title": "" }, { "docid": "907a5786e5d1d53527e6e3ea86357b29", "score": "0.5403531", "text": "def xnor_select(arr, proc_1, proc_2)\n new_arr = []\n arr.each do |ele|\n new_arr << ele if ( proc_1.call(ele) && proc_2.call(ele) ) || ( !proc_1.call(ele) && !proc_2.call(ele) )\n end\n new_arr\nend", "title": "" }, { "docid": "36b509a536016f1884aa7eb06adfb7cb", "score": "0.534924", "text": "def reduce_to_all_true(source_array)\n index = 0 \n result = true \n while index < source_array.length do \n if source_array[index]\n result\n else\n result = false\n end\n index += 1 \n end\n result\nend", "title": "" }, { "docid": "ad0d00542c69a4f87bda8fa7a8f1b80f", "score": "0.5340911", "text": "def some?(arr, &blk)\n #arr.any? { |el| blk.call(el) }\n arr.each do |el| \n if blk.call(el)\n return true\n end\n end\n return false\nend", "title": "" }, { "docid": "d5e13370dfce785644cc9304760153a2", "score": "0.5333284", "text": "def some?(arr, &prc)\n arr.each { |el| return true if prc.call(el)}\n false\nend", "title": "" }, { "docid": "87f847c8426cab5e7dec73dba2b587dc", "score": "0.5316162", "text": "def reduce_to_all_true(source_array)\n i = 0\n\n while i < source_array.length do\n if source_array[i] == false\n return false\n end\n i += 1\n end\n \n return true\nend", "title": "" }, { "docid": "3f3312ee31019fe38f3502babd7252e5", "score": "0.5304444", "text": "def one?(collection)\n return false if collection.empty?\n\n number_true = 0\n collection.each do |element|\n number_true += 1 if yield(element)\n return false if number_true == 2\n end\n return false if number_true == 0\n true\nend", "title": "" }, { "docid": "0c485d9b916f6a9cdff6f83cfabaf46b", "score": "0.53013396", "text": "def my_all?(arr, &prc)\n arr.each do |ele|\n return false if !prc.call(ele)\n end\n true\nend", "title": "" }, { "docid": "81f2e7a363acb84e86225b2e5bf6a3ae", "score": "0.5299419", "text": "def some?(arr, &prc)\n\n arr.each do |ele|\n return true if prc.call(ele)\n end\nfalse\nend", "title": "" }, { "docid": "527a9580d0839b863438aa38749e8562", "score": "0.5294529", "text": "def one?(collection)\n seen_one = false\n collection.each do |element|\n next unless yield(element)\n return false if seen_one\n seen_one = true\n end\n seen_one\nend", "title": "" }, { "docid": "c285c718eb5f77abc8a5de0886989f17", "score": "0.5275692", "text": "def exactly?(arr, num, &prc)\n count = 0\n\n arr.each do |ele|\n count += 1 if prc.call(ele)\n end\n\n count == num\nend", "title": "" }, { "docid": "7d5373f9c0d9ec8a7af748b5d4116b7e", "score": "0.5263464", "text": "def filter(array, filter)\n i = 0\n output = []\n while i < array.length\n if array[i] == filter\n output << array[i]\n end\n i += 1\n end\n return output\nend", "title": "" }, { "docid": "4f17b3921141faffeedd1444d48976bf", "score": "0.52124757", "text": "def nondupes(array)\n array.map do |elem| \n array.count(elem) == 1\n \n end\n \nend", "title": "" }, { "docid": "36d568810ab161c2e470ab88047d07e5", "score": "0.51861393", "text": "def selected_map!(arr, proc_1, proc_2)\r\n arr.each_with_index { |el, i| arr[i] = proc_2.call(el) if proc_1.call(el) }\r\n nil\r\nend", "title": "" }, { "docid": "0e1650c328df86055edc4bdc380a0512", "score": "0.51809585", "text": "def reduce_to_all_true(source_array)\nend", "title": "" }, { "docid": "09033060e85408bcb5b0af9e682df67c", "score": "0.5171201", "text": "def my_count(arr, &prc)\n count = 0 \n arr.each do |ele|\n if prc.call(ele)\n count += 1 \n end \n end \n count\nend", "title": "" }, { "docid": "45909b7affe91be6d9a74ecadd0cd521", "score": "0.5157725", "text": "def find(predicate)\n filtered = filter_to_array(predicate)\n return nil if filtered.length.zero?\n\n filtered[0]\n end", "title": "" }, { "docid": "d82cae12b88f696ae5f85cb96b891a14", "score": "0.5156796", "text": "def my_any?(&prc)\n i = 0\n while i < self.length\n if prc.call(self[i]) == true\n return true\n end\n i += 1\n end\n return false\n end", "title": "" }, { "docid": "9322abeaaaff5e10d84fe4fd49f15fc9", "score": "0.5151419", "text": "def my_find (collection) # collection is the array described above, passed to the method my_find\n i = 0 # setting up a counter\n while i < collection.length #while the counter is less than the length of the array do something\n return collection[i] if yield(collection[i]) #this is the \"do something\": send an ellement ([i]) to a block and if\n # it is returned to the method as 'true' then make it the return value of the method\n i+=1 # if the condition above is not met then add one to the counter and cycle through the next element in collection\n end #ends the while statement\nend", "title": "" }, { "docid": "0cc72f1547999d872f28668b48d5e8a7", "score": "0.51361936", "text": "def filter_out(arr, &prc)\n new_arr = []\n\n arr.each do |ele|\n new_arr << ele if !prc.call(ele)\n end\n new_arr\nend", "title": "" }, { "docid": "4cfd736d6b1054c0ebf456b16f8f6e2b", "score": "0.5133306", "text": "def every?(arr, &blck)\n # arr.all? { |el| blck.call(el) }\n arr.each do |el|\n if !blck.call(el)\n return false\n end\n end\n return true\nend", "title": "" }, { "docid": "9032c480cf7f5423a413e0cba8cea6ec", "score": "0.5124533", "text": "def array_42(array)\n a = false\n\tarray.each {|i| if i == 42 then a = true end}\n return a \nend", "title": "" }, { "docid": "f9df2d5239b1523d75546b9c9ad75f6d", "score": "0.5123903", "text": "def f_all\n C.curry.(\n ->(f, xs) {\n !any.(->(x) { x == false }, map.(f, xs))\n }\n )\n end", "title": "" }, { "docid": "b15e3a84e11e12a8b91418a484c810a4", "score": "0.51169825", "text": "def one?(collection)\n one = false\n\n collection.each do |element|\n next if !yield(element)\n return false if one\n one = !one\n end\n\n one\nend", "title": "" }, { "docid": "4abcc251cc3d51fce2320bdb8327cb23", "score": "0.51154727", "text": "def selected_map!(arr, proc_1, proc_2)\n arr.each.with_index do |ele, idx|\n if proc_1.call(ele)\n arr[idx] = proc_2.call(ele)\n end\n end\n nil\nend", "title": "" }, { "docid": "dff20357c402bb1b27fd1163f656c0df", "score": "0.5106435", "text": "def reduce_to_all_true(source_array)\n return source_array.all? {|word| word}\nend", "title": "" }, { "docid": "fd0bfd8f1a3697102a968cade3abe044", "score": "0.5105287", "text": "def partition(predicate)\n each_operand(predicate) do |operand|\n case operand\n when Axiom::Function::Binary then partition_binary(operand)\n when Axiom::Function::Unary then partition_unary(operand)\n when Axiom::Attribute::Boolean then partition_attribute(operand)\n else\n partition_proposition(operand)\n end\n end\n end", "title": "" }, { "docid": "313f40ab669b99e7d4ed2f085548a24c", "score": "0.5068463", "text": "def select(array)\n counter = 0\n new_array = []\n while counter < array.size\n value = yield(array[counter])\n if value\n new_array << array[counter]\n end\n counter += 1\n end\n\n new_array\nend", "title": "" }, { "docid": "102552e69f8509f769710c908f27fa61", "score": "0.5068261", "text": "def exactly?(arr, n, &prc)\n count = 0\n arr.each do |ele| \n if prc.call(ele)\n count += 1\n end\n end\n count == n\nend", "title": "" }, { "docid": "f30298c90893dc8fb670155d348de4c8", "score": "0.504898", "text": "def prizz_proc(arr, prc1, prc2)\n new_arr = []\n arr.each do |ele|\n new_arr << ele if prc1.call(ele) != prc2.call(ele) # \bTHIS IS NICE, instead of XOR\n end\n new_arr\nend", "title": "" }, { "docid": "a584bdd8f3eaa6eb492dc9834f060c8a", "score": "0.504746", "text": "def my_any?(&block)\n counter = 0\n my_each do |elem|\n counter += 1 if block.call(elem) == true\n end\n return true if counter.positive?\n\n false\n end", "title": "" }, { "docid": "7087b1eb4a44f6d60cceff3fdd4960f7", "score": "0.5040694", "text": "def my_count(arr, &prc)\n arr.inject(0) { |acc, ele| prc.call(ele) ? acc += 1 : acc }\nend", "title": "" }, { "docid": "3925874959c450ed7bcc604d7a9ccbb9", "score": "0.50335234", "text": "def remove_all(predicate)\n result = []\n each(lambda do |value, index|\n if predicate.call(value, index)\n result.push(value)\n remove(value)\n end\n end)\n result\n end", "title": "" }, { "docid": "435fc66704ea4f4b807e8e8cee976306", "score": "0.5032257", "text": "def filter_out(arr, &prc)\n new_arr = []\n arr.each do |ele| \n if !prc.call(ele)\n new_arr << ele\n end\n end\n new_arr\nend", "title": "" }, { "docid": "ed1248109bdb930637d6cce6d2206078", "score": "0.5027626", "text": "def any?(collection)\n collection.each do |element|\n return true if yield(element)\n end\n false\nend", "title": "" }, { "docid": "5b0d859865eaf86b98bc1c0d3769e443", "score": "0.5024947", "text": "def at_least?(arr, num, &proc)\r\n count = 0\r\n arr.each { |el| count += 1 if proc.call(el) }\r\n count >= num\r\nend", "title": "" }, { "docid": "deaa49186aaa45b973b3aae599639d3e", "score": "0.5022266", "text": "def some?(arr, &prc)\n results = false\n arr.each do |a|\n results |= prc.call(a) # results = result | prc.call(a)\n end\n results\nend", "title": "" }, { "docid": "415ad45bd54b0d5014d09cf7c5717bf6", "score": "0.5005023", "text": "def one?(collection)\n count = 0\n collection.each do |el|\n count += 1 if yield(el)\n return false if count > 1\n end\n count == 1 ? true : false\nend", "title": "" }, { "docid": "063ebbc28b8026d7ac173f3b765abf82", "score": "0.4996869", "text": "def filter_out!(arr, &prc)\n i = 0\n while i < arr.length\n if prc.call(arr[i])\n arr.delete_at(i)\n else\n i += 1\n end\n end \n arr\nend", "title": "" }, { "docid": "bd1e5d5ecaccb55b1d1518a6d271b983", "score": "0.49943197", "text": "def first_index(arr, &proc)\r\n arr.each_with_index { |el, i| return i if proc.call(el) }\r\n nil\r\nend", "title": "" }, { "docid": "708a3d40fa279304ad8e69fcc5077ade", "score": "0.49641365", "text": "def filter(arr, &block)\n if arr.empty?\n []\n else\n head, *tail = arr\n if block.call(head) == true\n [head] + filter(tail, &block)\n else\n filter(tail, &block)\n end\n end\nend", "title": "" }, { "docid": "4fcd26b12147fb88c3243447affc5e70", "score": "0.49605325", "text": "def refute_predicate(object, predicate, message=nil) \n ExecutionAssay.refute!(:message=>message, :backtrace=>caller) do\n object.__send__(predicate)\n end\n end", "title": "" }, { "docid": "75b3ff4ed7cd9c9b8638313a054b180e", "score": "0.49462894", "text": "def find_first &predicate\n\t\treturn nil unless block_given?\n\n\t\tcurrent = self.head\n\t\twhile current\n\t\t\treturn current if predicate.call(current)\n\t\t\tcurrent = current.next\n\t\tend\n\tend", "title": "" }, { "docid": "0380cf99351a6d164a376bdac60413f4", "score": "0.4942757", "text": "def any_is_odd?(arr)\n arr.each do |el|\n return true if el.odd?\n end\n\n false\nend", "title": "" }, { "docid": "a1722a204ab6ccaacd3b121c5a6bbecd", "score": "0.49410388", "text": "def exactly?(arr, n , &prc)\n count = 0\n arr.each do |ele|\n count += 1 if prc.call(ele)\n end\n return true if n == count\n false\nend", "title": "" }, { "docid": "2dfdac0ecd1e9bedd58b1209289f1526", "score": "0.4933345", "text": "def make_predicate( attrtype )\n\t\tself.log.debug \"Generating an attribute predicate for %p\" % [ attrtype ]\n\t\tattrname = attrtype.name\n\t\tif attrtype.single?\n\t\t\tself.log.debug \" attribute is SINGLE, so generating a scalar predicate...\"\n\t\t\treturn lambda { self[attrname] ? true : false }\n\t\telse\n\t\t\tself.log.debug \" attribute isn't SINGLE, so generating an array predicate...\"\n\t\t\treturn lambda { self[attrname].any? {|val| val} }\n\t\tend\n\tend", "title": "" }, { "docid": "150be2acceca41c4f7f77ca7c969e144", "score": "0.4927971", "text": "def prizz_proc(arr, prc1, prc2)\n arr.select do |el|\n prc1.call(el) != prc2.call(el)\n end\nend", "title": "" }, { "docid": "2a618d60b097a91ed0657fbbf79be0ff", "score": "0.48994678", "text": "def find_dup(array)\n while array.size > 0\n el = array.shift\n array.each do |val|\n return el if val == el\n end\n end\nend", "title": "" }, { "docid": "33902d9e8a8d3a150141b82670e792b5", "score": "0.48954037", "text": "def select(array)\n final_selections = []\n\n for elem in array do\n result = yield(elem)\n final_selections << elem if result\n end\n \n final_selections\nend", "title": "" }, { "docid": "5e6bb98b53e1c4d0c3c214258d642e9f", "score": "0.48901668", "text": "def disjunct_select(arr, *procs)\n new_arr = []\n\n arr.each do |ele|\n count = 0\n procs.each do |proc_idx|\n count += 1 if proc_idx.call(ele)\n end\n new_arr << ele if count >= 1\n end\n new_arr\nend", "title": "" }, { "docid": "01682ed6ee80151f2ab8fa111642141f", "score": "0.48896724", "text": "def add_predicate; end", "title": "" }, { "docid": "052ef0be44348657b44ace3d8706d0f6", "score": "0.48882103", "text": "def my_select(arr)\ncounter = 0\nresults = []\nwhile counter < arr.length\n if yield(arr[counter]) == true\n results.push(arr[counter])\n end\n counter += 1\nend\nresults\nend", "title": "" }, { "docid": "3ca544c2fabd2acc048bc502ebfc3204", "score": "0.48589274", "text": "def prizz_proc(arr, prc1, prc2)\n arr.select { |el| [prc1.call(el), prc2.call(el)].one? }\nend", "title": "" }, { "docid": "0d93420a233176a2e64613ec17654f11", "score": "0.4850691", "text": "def true_for_ravenclaw(array, item)\n for i in array\n status= i.include?(item)\n end\n return status\nend", "title": "" }, { "docid": "d23102ab904e39f5518fdb4a1cff1735", "score": "0.48442993", "text": "def my_select(array)\n counter = 0\n new_array = []\n while counter < array.size\n if yield(array[counter])\n new_array << array[counter]\n else\n end\n counter += 1\n end\n return new_array\nend", "title": "" }, { "docid": "509c4b3d3ad038a786fd5cc7242e8588", "score": "0.4841311", "text": "def each_operand(predicate, &block)\n case predicate\n when Axiom::Function::Connective::Disjunction then each_operand(predicate.inverse.optimize, &block)\n when Axiom::Function::Connective::Conjunction then each_conjunction(predicate, &block)\n else\n block.call(predicate)\n end\n end", "title": "" }, { "docid": "f39a7d07a7017846239d86329b1bf6b3", "score": "0.4837589", "text": "def unique_items(ary)\r\n ary.select {|x| ary.count(x) == 1}\r\nend", "title": "" }, { "docid": "cac77167580c381ce16b7a9f6d873144", "score": "0.48374042", "text": "def all?(arr)\n arr.each { |el| return false if yield(el) == false}\n true\nend", "title": "" }, { "docid": "66ba43437266238c0776340c1d49fb45", "score": "0.48350865", "text": "def disjunct_select(arr, *proc_arr)\n arr.select { |ele| proc_arr.any? { |prc| prc.call(ele) } }\nend", "title": "" }, { "docid": "2efc8058e6e4bbd18ad658fc850768ca", "score": "0.4828064", "text": "def has?(predicate)\n predicate = class_of predicate\n @set.any? {|item| item.is_a? predicate}\n end", "title": "" }, { "docid": "433d6d940264cf66885f354b584a075f", "score": "0.48248643", "text": "def conjunct_select(arr, *procs)\n new_arr = []\n\n arr.each do |ele|\n count = 0\n procs.each do |proc_idx|\n count += 1 if proc_idx.call(ele)\n end\n new_arr << ele if count == procs.length\n end\n new_arr\nend", "title": "" }, { "docid": "e5dc1a899d80de0f61c5a78b3296a843", "score": "0.48244822", "text": "def countSheeps array\n count = 0\n array.each do |x|\n x == true ? count += 1 : next\n end\n count\nend", "title": "" }, { "docid": "9310ae24403c4ec4667f1ee4742d94d6", "score": "0.4818789", "text": "def yes_mutate(arr)\n arr.uniq!\nend", "title": "" }, { "docid": "9310ae24403c4ec4667f1ee4742d94d6", "score": "0.4818789", "text": "def yes_mutate(arr)\n arr.uniq!\nend", "title": "" }, { "docid": "9310ae24403c4ec4667f1ee4742d94d6", "score": "0.4818789", "text": "def yes_mutate(arr)\n arr.uniq!\nend", "title": "" }, { "docid": "4eef08695ac7a6db7e04cf9ec31bd6a0", "score": "0.48130137", "text": "def countSheeps(array)\n array.count do |sheep|\n next if sheep.nil?\n sheep == true\n end\nend", "title": "" }, { "docid": "6db7752bfd3bf8251dc0bbda9e9af6fb", "score": "0.47979015", "text": "def my_any?(&prc)\n self.my_each { |el| return true if prc.call(el) }\n false\n end", "title": "" } ]
3b8ed56ebfb182ba19f7b803cc449663
GET /course/1/intervals GET /course/1/intervals.xml
[ { "docid": "3a80fcdf585aede19b449e69afe31ad6", "score": "0.7444021", "text": "def index\n @course = Course.find(params[:course_id])\n @intervals = @course.intervals.find(:all, :limit => @course.repetitions + 1 )\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @intervals }\n end\n end", "title": "" } ]
[ { "docid": "c9c17bb4e5a4da88c6d5dc5b6aa8c97c", "score": "0.63793004", "text": "def instrument_get_active_intervals(opts = {})\n if Configuration.debugging\n Configuration.logger.debug \"Calling API: InstrumentApi#instrument_get_active_intervals ...\"\n end\n \n # resource path\n path = \"/instrument/activeIntervals\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n _header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\n _header_accept_result = @api_client.select_header_accept(_header_accept) and header_params['Accept'] = _header_accept_result\n\n # HTTP header 'Content-Type'\n _header_content_type = ['application/json', 'application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n \n\n auth_names = []\n result = @api_client.call_api(:GET, path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InstrumentInterval')\n if Configuration.debugging\n Configuration.logger.debug \"API called: InstrumentApi#instrument_get_active_intervals. Result: #{result.inspect}\"\n end\n return result\n end", "title": "" }, { "docid": "39628562f1120eceef093a5b3060ff5f", "score": "0.6257539", "text": "def index\n #todo scope by current user meter\n @intervals = Interval.bydate.page params[:page]\n end", "title": "" }, { "docid": "6259d9e3dcbd072ae51cea32ec4b850e", "score": "0.6241868", "text": "def index\n @intervals = Interval.all\n\n render json: @intervals\n end", "title": "" }, { "docid": "0415577b3ebba0e4bda705e122c95ab0", "score": "0.6199742", "text": "def show\n @interval = Interval.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @interval }\n end\n end", "title": "" }, { "docid": "0415577b3ebba0e4bda705e122c95ab0", "score": "0.6199742", "text": "def show\n @interval = Interval.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @interval }\n end\n end", "title": "" }, { "docid": "0415577b3ebba0e4bda705e122c95ab0", "score": "0.6199742", "text": "def show\n @interval = Interval.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @interval }\n end\n end", "title": "" }, { "docid": "0415577b3ebba0e4bda705e122c95ab0", "score": "0.6199742", "text": "def show\n @interval = Interval.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @interval }\n end\n end", "title": "" }, { "docid": "deaed427ebae4be11af1979994f4fd2e", "score": "0.61958367", "text": "def instrument_get_active_intervals_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: InstrumentApi.instrument_get_active_intervals ...\"\n end\n # resource path\n local_var_path = \"/instrument/activeIntervals\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json', 'application/xml', 'text/xml', 'application/javascript', 'text/javascript']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = ['application/json', 'application/x-www-form-urlencoded']\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = []\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'InstrumentInterval')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: InstrumentApi#instrument_get_active_intervals\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "c2d07de64123aacacac41fff5f10d29e", "score": "0.614833", "text": "def get_intervals()\n \n end", "title": "" }, { "docid": "eea752cb99ffa177c205e21e7272e725", "score": "0.5971788", "text": "def get_intervals\n return @intervals\n end", "title": "" }, { "docid": "6dbe43f22c8ccaad8b355f51ce477395", "score": "0.58946216", "text": "def show\n @interval = current_user.intervals.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @interval }\n end\n end", "title": "" }, { "docid": "6628ef31ae2f2fc3ef475722fbf48069", "score": "0.5882617", "text": "def index\n @interval = current_user.opened_interval\n\n respond_to do |format|\n if @interval.nil?\n format.html { redirect_to new_interval_url }\n format.json { head :no_content }\n else\n format.html { redirect_to edit_interval_url(@interval) }\n format.json { head :no_content }\n end\n end\n end", "title": "" }, { "docid": "90cb7dd95b8ba1c8d724fc4ab5e83b90", "score": "0.5804602", "text": "def show\n render json: @interval\n end", "title": "" }, { "docid": "75d56fd87e4c1e2af71801b825bdeedf", "score": "0.56404907", "text": "def get_collection_intervals \n times = []\n i = @opts[:start_time]\n loop do \n times << i\n i += @opts[:interval]\n break if i >= @opts[:end_time] || @opts[:end_time] - @opts[:start_time] < @opts[:interval]\n end\n times\n end", "title": "" }, { "docid": "80e8aa0800d51336aaa30ea8c742cc2a", "score": "0.56326985", "text": "def instrument_get_active_intervals(opts = {})\n data, _status_code, _headers = instrument_get_active_intervals_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "502a683e17ecb09e37895386db0eaa24", "score": "0.5599628", "text": "def new\n @interval = Interval.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @interval }\n end\n end", "title": "" }, { "docid": "502a683e17ecb09e37895386db0eaa24", "score": "0.5599628", "text": "def new\n @interval = Interval.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @interval }\n end\n end", "title": "" }, { "docid": "2179a8dc40319786b2cd78c9644f2307", "score": "0.55657506", "text": "def new\n @interval = Interval.new\n \n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @interval }\n end\n end", "title": "" }, { "docid": "2c14e4f0c7fe46e4649d1c86aa715e60", "score": "0.55587876", "text": "def __parse_intervals(resp)\n intervals = JSON.parse('[' + resp.chomp.gsub(/\\r\\n/, ',') + ']')\n data = []\n intervals.each do |interval|\n data.push([interval[0], 0])\n data.push([interval[1], 0])\n data.push(nil) # break up the intervals\n end\n data\n end", "title": "" }, { "docid": "54dc3cf5a97da247f35ca675a4e3b75d", "score": "0.5450883", "text": "def time_of_use_intervals(load_serving_entity_id, time_of_use_group_id, options = {})\n get(\"public/timeofuses/#{load_serving_entity_id}/#{time_of_use_group_id}/intervals\", interval_params(options)).results\n end", "title": "" }, { "docid": "832ee325e034b8ae175957c2fe7b19f6", "score": "0.541552", "text": "def index\n @assignments = @section.assignments.includes(:lab).visible\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @assignments }\n format.rss { render layout: false }\n format.ics { render text: @section.to_ical}\n end\n end", "title": "" }, { "docid": "5dff279062c9693b00325c8d04a38237", "score": "0.5399722", "text": "def energy_level_intervals\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\n (start_date..end_date).each do |date|\n result[date] = @location.energy_level_intervals(date)\n end\n\n render :json => result\n end", "title": "" }, { "docid": "f7b36285b0ec7c86174f79d3b13a0c5c", "score": "0.53960776", "text": "def create\n @interval = Interval.new(params[:interval])\n\n respond_to do |format|\n if @interval.save\n format.html { redirect_to(@interval, :notice => 'Interval was successfully created.') }\n format.xml { render :xml => @interval, :status => :created, :location => @interval }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @interval.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e61f67130d03c7f6f614604e6eba9c19", "score": "0.5380539", "text": "def attendance_intervals=(value)\n @attendance_intervals = value\n end", "title": "" }, { "docid": "c45e1a96e96f22a14e04eb482a0ffeba", "score": "0.53774965", "text": "def update\n @interval = Interval.find(params[:id])\n\n respond_to do |format|\n if @interval.reset\n if @interval.update_attributes(params[:interval])\n flash[:notice] = 'Interval was successfully updated.'\n end\n else\n flash[:notice] = 'Interval does not need to be updated'\n end\n format.html { redirect_to course_intervals_path(@interval.course) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8777cbb4e58772fc57de66bdb7c34d76", "score": "0.5375965", "text": "def get_activities_by_interval()\n return MicrosoftGraph::Groups::Item::Sites::Item::GetActivitiesByInterval::GetActivitiesByIntervalRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "e6fc80767fc03ee31232eb402094caa6", "score": "0.5360101", "text": "def index\n @jira_countdowns = JiraCountdown.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @jira_countdowns }\n end\n end", "title": "" }, { "docid": "2ce43a0b599b76e467de72d55dc43d89", "score": "0.53515834", "text": "def create\n @interval = Interval.new(params[:interval])\n\n respond_to do |format|\n if @interval.save\n flash[:notice] = 'Interval was successfully created.'\n format.html { redirect_to(@interval) }\n format.xml { render :xml => @interval, :status => :created, :location => @interval }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @interval.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "18aa336f42e47f4f61442b4ca60ad78b", "score": "0.53374934", "text": "def interval\n @attributes[:interval]\n end", "title": "" }, { "docid": "f2e34411ad5e3420dbd419e00874cce3", "score": "0.53304684", "text": "def index\n @course = Course.find(params[:course_id])\n @lessons = @course.lessons.started.reverse\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lessons }\n end\n end", "title": "" }, { "docid": "981dcce9c9494883e8437cba769f34a5", "score": "0.53289264", "text": "def interval_id\n attributes.fetch(:interval_id)\n end", "title": "" }, { "docid": "243b812197e95a100a22c6824649c22f", "score": "0.52993184", "text": "def set_interval\n @interval = Interval.find(params[:id])\n end", "title": "" }, { "docid": "243b812197e95a100a22c6824649c22f", "score": "0.52993184", "text": "def set_interval\n @interval = Interval.find(params[:id])\n end", "title": "" }, { "docid": "def121c84cadb8f9e67d51d3607bf15f", "score": "0.5293709", "text": "def index\n @work_intervals = WorkInterval.where{project_id == my{@project.id}}.where{entry_id == my{@entry.id}}\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @work_intervals }\n end\n end", "title": "" }, { "docid": "d65b708208272275ca605100cce356c6", "score": "0.5267208", "text": "def attendance_intervals\n return @attendance_intervals\n end", "title": "" }, { "docid": "69fffbf41d85e3f8f150d7a2e9812532", "score": "0.5266541", "text": "def get_activities_by_interval()\n return MicrosoftGraph::Drives::Item::Items::Item::GetActivitiesByInterval::GetActivitiesByIntervalRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "5e39c7644bd8f0bdf5ba43c39c51544c", "score": "0.52423936", "text": "def index\n @life_cycles = do_index(LifeCycle, params)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @life_cycles }\n end\n end", "title": "" }, { "docid": "09d839376132452ee8205a133559a251", "score": "0.52409625", "text": "def each_time_interval(zmq_endpt)\n\n req=mk_request(TRP::Message::Command::TIMESLICES_REQUEST )\n get_response_zmq(zmq_endpt,req) do |resp|\n\n slice_id = 0\n total_slices = resp.slices.size \n\n resp.slices.reverse_each do | slc |\n yield slc.time_interval, slice_id, total_slices\n slice_id=slice_id+1 \n end \n end\n end", "title": "" }, { "docid": "de29fcad1a81ba632b649be3a627a99d", "score": "0.5203292", "text": "def index\n @labs = @course.labs.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @labs }\n end\n end", "title": "" }, { "docid": "7f590042c1add596317f2df7bb3724f0", "score": "0.5197974", "text": "def get_intervals\n intervals = []\n CSV.foreach(@filename).each do |line|\n next unless /^Electric usage/.match?(line.first.to_s)\n\n intervals << {\n time: time_from(line[1], line[2]),\n usage: line[4].to_f,\n cost: cost_from(line[6])\n }\n end\n intervals\n end", "title": "" }, { "docid": "6c6e8a802288ac78a89bbde72e5780f4", "score": "0.5191332", "text": "def update\n @interval = Interval.find(params[:id])\n\n respond_to do |format|\n if @interval.update_attributes(params[:interval])\n flash[:notice] = 'Interval was successfully updated.'\n format.html { redirect_to(intervals_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @interval.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "55fe85fea7c697dcc7bd09ae330fc878", "score": "0.5183621", "text": "def index\n @task = current_user.tasks.new\n\n todays_work_intervals = current_user.todays_intervals.select{ |interval| interval.work? }\n\n todays_breaks_intervals = current_user.todays_intervals.select{ |interval| interval.break? }\n\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { \n hash = {\n resume: current_user.tasks.tasks_to_resume,\n start: current_user.tasks.tasks_to_start,\n done_today: current_user.tasks.done.updated_today,\n todays_work_duration: duration_of_intervals(todays_work_intervals),\n todays_breaks_duration: duration_of_intervals(todays_breaks_intervals)\n }\n render json: hash \n }\n end\n end", "title": "" }, { "docid": "cfb8e0d0f47266ed2345f2803ccd66ef", "score": "0.5178263", "text": "def refresh_energy_level_intervals\n @schedule = Schedule.find(params[:selected_schedule])\n end", "title": "" }, { "docid": "ab2f1d3be63b8937f9c1f252cf909852", "score": "0.5176362", "text": "def index\n\t#redirect_to(\"tasks_url\")\n @time_spans = TimeSpan.all\n end", "title": "" }, { "docid": "1f4ba33da6285a504e3a904516fad032", "score": "0.51690024", "text": "def create\n @interval = Interval.new(params[:interval])\n\t\tunless params[:interval][:hours].blank?\n\t\t\t@task = Task.find params[:interval][:task_id]\n\t\t\t@task.intervals(true).find(:all, :conditions => {:created_at => Date.today..Date.today+1}).collect(&:destroy)\n\t\t\t@interval.end = DateTime.now\n\t\t\thours = (parse_as_days(params[:interval][:hours]).to_f * WORKING_HOURS_PER_DAY)\n\t\t\t@interval.start = DateTime.now - hours.hours\n\t\tend\n @interval.user = current_user\n respond_to do |format|\n if @interval.save!\n @interval.task.update_attributes(params[:task])\n flash[:notice] = 'Hours were successfully logged.'\n format.html { redirect_to(root_path) }\n format.xml { render :xml => @interval, :status => :created, :location => @interval }\n\t\t\t\tformat.js {\n\t\t\t\t\trender :update do |page|\n\t\t\t\t\t\t#@el = \"interval_hours_#{@task.id}\"\n\t\t\t\t\t\t#page[@el].val(\"#{@task.time_spent_today}\")\n\t\t\t\t\t\t#page.visual_effect :highlight, @el\t\t\t\t\t\t\n\t\t\t\t\t\tpage.replace \"task_#{@task.id}\", :partial => @task\n\t\t\t\t\t\t#page.visual_effect :highlight, \"task_#{@task.id}\"\t\t\t\t\t\t\n\t\t\t\t\tend\n\t\t\t\t}\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @interval.errors, :status => :unprocessable_entity }\n end\n end\n\t\t#@interval.task.intervals.\n end", "title": "" }, { "docid": "a079b849ea44fa648ab2af15e220ea12", "score": "0.51676255", "text": "def new\n @interval = Interval.new\n\t\t@task = Task.find params[:task_id]\n @interval.task = @task\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @interval }\n end\n #rescue\n # redirect_to intervals_path\n end", "title": "" }, { "docid": "7d8c0343b6a705b9b7931b2f8ea2aedc", "score": "0.5149298", "text": "def update\n @interval = Interval.find(params[:id])\n\n respond_to do |format|\n if @interval.update_attributes(params[:interval])\n flash[:notice] = 'Interval was successfully updated.'\n format.html { redirect_to(@interval) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @interval.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e44e789b4be1b6060d78d043cc08e51e", "score": "0.5134282", "text": "def index\n @segments = Segments.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @segments }\n end\n end", "title": "" }, { "docid": "6a2681b90796ff49589c22206593e04c", "score": "0.51182723", "text": "def get_courses\n\n @courses = Course.all\n\n respond_to do |format|\n format.xml { render :xml => @courses }\n end\n\nend", "title": "" }, { "docid": "796140ee1215d76a3765656386f79a34", "score": "0.51063275", "text": "def live_schedule\n get('sports/en/schedules/live/schedule.xml')\n end", "title": "" }, { "docid": "74e3d9f812228c2723c58d756e22245f", "score": "0.5103025", "text": "def show\n @work_interval = WorkInterval.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @work_interval }\n end\n end", "title": "" }, { "docid": "e509c78f37ce5970c2d697477357e67a", "score": "0.50996095", "text": "def index\n @course = Course.find(params[:course_id])\n @course_schedules = @course.course_schedules.paginate :page => params[:page], :per_page => 10\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @course_schedules }\n end\n end", "title": "" }, { "docid": "655a6e331943b1c318dd52bbd9749a37", "score": "0.50911987", "text": "def update\n @interval = Interval.find(params[:id])\n\n respond_to do |format|\n if @interval.update_attributes(params[:interval])\n format.html { redirect_to(@interval, :notice => 'Interval was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @interval.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "78618976837b446802fdb3191b353a37", "score": "0.5069519", "text": "def schedule(interval)\n scheduler.every interval do |job|\n retrieve ASYNC_URL\n end\n return \"scheduled /counters/increment every #{interval}\"\n end", "title": "" }, { "docid": "0b2c9040c761c1e7bdc09ccd4dcd95d9", "score": "0.5060505", "text": "def interval=(value)\n @interval = value\n end", "title": "" }, { "docid": "f5c7f136929b7058eecf544a0f1ef0a6", "score": "0.50554", "text": "def new\n @interval = Interval.new\n\n\t@date = Date.today\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @interval }\n end\n end", "title": "" }, { "docid": "07c3c9a395cb6a936dadc57845f8230a", "score": "0.5052712", "text": "def create\n @interval = Interval.new(interval_params)\n\n respond_to do |format|\n if @interval.save\n format.html { redirect_to @interval, notice: 'Interval was successfully created.' }\n format.json { render :show, status: :created, location: @interval }\n else\n format.html { render :new }\n format.json { render json: @interval.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13ad88dc9ea3ecb48733cf08cd9d547c", "score": "0.5052306", "text": "def index\n @workshop = Workshop.find_by_year(params[:workshop_id]) \n @courses = Course.scheduled.in_workshop(@workshop)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courses }\n end\n end", "title": "" }, { "docid": "f55771eb77019d952fe3562779992d4d", "score": "0.5037437", "text": "def get_periods(id, starts: nil, ends: nil, threshold: nil, operation: nil)\n params = { start: starts, end: ends, threshold: threshold, op: operation }\n @client.http_get(\"/#{@resource}/#{ERB::Util.url_encode(id)}/periods?\" + encode_params(params))\n end", "title": "" }, { "docid": "232eebb07a9c6793ff4ebc88805b43b0", "score": "0.5036481", "text": "def index\n @discipline = Discipline[params[\"discipline\"]]\n @discipline_names = Discipline.names\n @calculations = Calculations::V3::Calculation.with_results(@year)\n\n respond_to do |format|\n format.html\n format.xml do\n fresh_when RacingAssociation.current, public: true\n all_events\n end\n end\n end", "title": "" }, { "docid": "1b9b6f8a1c7b9ae19ef7a57e3a49d39d", "score": "0.5014721", "text": "def destroy\n @interval = Interval.find(params[:id])\n @interval.destroy\n\n respond_to do |format|\n format.html { redirect_to(intervals_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "1b9b6f8a1c7b9ae19ef7a57e3a49d39d", "score": "0.5014721", "text": "def destroy\n @interval = Interval.find(params[:id])\n @interval.destroy\n\n respond_to do |format|\n format.html { redirect_to(intervals_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "1b9b6f8a1c7b9ae19ef7a57e3a49d39d", "score": "0.5014721", "text": "def destroy\n @interval = Interval.find(params[:id])\n @interval.destroy\n\n respond_to do |format|\n format.html { redirect_to(intervals_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "5fd6d2bf4ef7c9dfe3a4ac8afee442e2", "score": "0.5008755", "text": "def get\n @xml = @paths.map { |path|\n puts \"GET\\t#{@host + path}\"\n RestClient.get(@host + path) { |response, request, result|\n puts \"RESPONSE #{response.code}\"\n response.body\n }\n }.map { |response|\n Nokogiri::XML(response).xpath(\"/*\").to_s\n }\n self\n end", "title": "" }, { "docid": "90c0bf4346765ff7c76309ebaf06c458", "score": "0.50081354", "text": "def update\n @interval = Interval.find(params[:id])\n\n if @interval.update(interval_params)\n head :no_content\n else\n render json: @interval.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e694bc958c97c2cb0ab7a5f7cb721370", "score": "0.50017476", "text": "def index\n @station = Station.find(params[:station_id])\n\t\t@rectifiers = @station.rectifiers\n\t\t\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @rectifiers }\n end\n end", "title": "" }, { "docid": "d3cb5b03f63f030de32ee6ab99a6faa6", "score": "0.5001428", "text": "def index\n @course_dates = CourseDate.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @course_dates }\n end\n end", "title": "" }, { "docid": "b4e262442d571b3d6c3e833edcca8d7a", "score": "0.49945337", "text": "def initialize\n @intervals = nil\n @intervals = ArrayList.new(2) # most sets are 1 or 2 elements\n end", "title": "" }, { "docid": "bfac4c484f8bd08d175e6088d61db46b", "score": "0.49927437", "text": "def intervals\n @intervals ||= begin\n points.map do |p1|\n idx = points.index(p1)\n p2 = points[idx+1]\n\n if p2\n Interval.new(p1, p2)\n else\n nil\n end\n end\n end\n @intervals.compact\n end", "title": "" }, { "docid": "25bfa73aeabd57e5e59390b82ee49765", "score": "0.49737176", "text": "def interval\n @interval ||= calc_interval\n end", "title": "" }, { "docid": "4b6f51815b56ae9df2ad7c4ea9be7ebb", "score": "0.4965936", "text": "def index\n @stops = @schedule.stops.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @stops }\n end\n end", "title": "" }, { "docid": "86e8a0fa902dad958621cb4b1fccb88c", "score": "0.49625042", "text": "def interval(components,comments:[])\n return Interval.new(components:components,comments:comments)\nend", "title": "" }, { "docid": "68190a38874d8cc7cdb2ad7e7a8a3d0d", "score": "0.49610484", "text": "def show\n @survey_range = Csi::SurveyRange.query_status_meaning(I18n::locale).query_range_meaning(I18n::locale).\n query_all_info.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @survey_range }\n end\n end", "title": "" }, { "docid": "3ba4688d7a25938a7babb6b622bd975e", "score": "0.49407664", "text": "def create\n @interval = Interval.new(interval_params)\n\n if @interval.save\n render json: @interval, status: :created, location: @interval\n else\n render json: @interval.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "3a28549be2bead1702f571c4ce4a468d", "score": "0.49377266", "text": "def index\n @tasks = Task.where(enrollment_id: params[:enrollment_id])\n @course = @enrollment.course\n end", "title": "" }, { "docid": "2c0341bbad504a727c7386f7e52ac67e", "score": "0.49375662", "text": "def index\n @course_numbers = CourseNumber.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @course_numbers }\n end\n end", "title": "" }, { "docid": "616653265ca716bfc742ed3456232ce5", "score": "0.49372995", "text": "def index\n @objectives = @course.objectives.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @objectives }\n end\n end", "title": "" }, { "docid": "ee66c935caecb173380447fad875b6b1", "score": "0.49333724", "text": "def interval=(value)\n @interval = value.to_i\n end", "title": "" }, { "docid": "677a8f962ef69fb2fbc592357b5fe3af", "score": "0.49192896", "text": "def index\n @courses = Course.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @courses }\n end\n end", "title": "" }, { "docid": "0ccc5896eca155fc90755e9f0fc11702", "score": "0.49178255", "text": "def index\n# @activities = Activity.all\n ranges = show_time_window('3') # the index value needs to be manually synced with the index.html - selector\n startdate = ranges[0]\n enddate = ranges[1]\n @activities = Activity.show_date_range( 'All', 'All' , startdate, enddate )\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @activities }\n end\n end", "title": "" }, { "docid": "3de9d5c8ea3e984cf65e8428d594fc3f", "score": "0.49149254", "text": "def interval\n return @interval\n end", "title": "" }, { "docid": "1dfde16415fb2bd5f156981fa6b37795", "score": "0.49143144", "text": "def get_study_data\n begin\n url = \"http://stundenplan.htwk-leipzig.de:8080/stundenplan/studienjahr.xml\"\n\n #get semester, semester id, time\n xml_data = Net::HTTP.get_response(URI.parse(url)).body\n doc = REXML::Document.new(xml_data)\n semester = doc.root.elements[\"semester\"].attributes[\"name\"]\n zeitraum = doc.root.elements[\"semester/period\"].attributes[\"name\"]\n sid = doc.root.elements[\"semester\"].attributes[\"id\"]\n\n #choose right semester (season)\n if sid == \"ss\"\n url = 'http://stundenplan.htwk-leipzig.de:8080/stundenplan/semgrp/semgrp_ss.xml'\n else\n url = 'http://stundenplan.htwk-leipzig.de:8080/stundenplan/semgrp/semgrp_ws.xml'\n end\n\n\n\n # get the XML data as a string\n xml_data = Net::HTTP.get_response(URI.parse(url)).body\n\n # Array with parsed strings from xml file\n htwk_strings = []\n\n # extract study_path information\n doc = REXML::Document.new(xml_data)\n doc.elements.each(\"studium/fakultaet/studiengang/semgrp\") do |element|\n htwk_strings.push(element.attributes[\"id\"])\n end\n\n\n\n jahrgang = []\n studiengang = []\n # if no smgrp exists, default\n seminargruppe = [\"\"]\n abschluss = []\n\n htwk_strings.collect do |str|\n jahrgang << str.match(/^\\d{2}/)[0]\n studiengang << str.match(/^\\d{2}(.+)\\-/)[1]\n abschluss << str.match(/\\-(.+)$/)[1]\n end\n\n # get list of seminargroups from string part \"studiengang\"\n studiengang.collect! do |str|\n # it´s a number?\n if /\\d+$/.match(str)\n #fill the array and remove the number from string\n seminargruppe << $&\n str.slice! $&\n str\n end\n str\n end\n\n jahrgang.uniq!.sort!\n studiengang.uniq!.sort!\n seminargruppe.uniq!.sort!\n abschluss.uniq!.sort!\n\n #returns hash with all data\n {\"sid\" => sid, \"semester\" => semester, \"zeitraum\" => zeitraum, \"jahrgang\" => jahrgang, \"studiengang\" => studiengang, \"seminargruppe\" => seminargruppe, \"abschluss\" => abschluss}\n\n #FIXME this exceptions will never be thrown because this function is in an rescue block! see get '/' do\n rescue NoMethodError => e\n @e = throw_error session['error'] = e.to_s + \"<br />(Scheinbar ist der HTWK Kalender Server nicht erreichbar.)\"\n erb :error\n rescue Errno::EHOSTUNREACH => e\n @e = throw_error session['error'] = e.to_s + \"<br />(Scheinbar ist der HTWK Kalender Server nicht erreichbar.)\"\n erb :error\n rescue Exception => e\n @e = throw_error session['error'] = e.to_s + \"<br />(Es ist ein Fehler aufgetreten. Bitte sende mir die Fehlermeldung per Mail.)\"\n erb :error\n end\nend", "title": "" }, { "docid": "2ae69366416a3cb966a0f823728a8ef9", "score": "0.49140844", "text": "def index\n @age_ranges = AgeRange.all(:order => :low)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @age_ranges }\n end\n end", "title": "" }, { "docid": "10d69476fba4e3311fe78848b4683eaf", "score": "0.49116746", "text": "def interval\n @min_interval + @short_interval + @long_interval\n end", "title": "" }, { "docid": "74ef7495da40eeeea6849de1a927ec34", "score": "0.49110994", "text": "def interval\n @interval ||= 1\n end", "title": "" }, { "docid": "7d2c02627b558102048d0033a9299157", "score": "0.49001795", "text": "def index\n @courses = Course.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @courses }\n end\n end", "title": "" }, { "docid": "1fd3be7c5403f32c4ae605d3e7f19277", "score": "0.4898214", "text": "def getresources\n\tstart_time = Time.at(params[:start].to_i)\n end_time = Time.at(params[:end].to_i)\n resources = []\n resources << {:id => 'newevent', :name => 'Select a Time', :readonly => false}\n TimeBlock.where(:starttime => (start_time...end_time)).each do |t|\n e = t.event\n resources << {:id => e.id.to_s, :name => e.title, :readonly => true}\n end\n render :json => resources\n end", "title": "" }, { "docid": "b6b9ddea9ebdd72bd23615ac2be612e5", "score": "0.48951724", "text": "def index\n @courses = Course.all\n\t\t\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @courses }\n end\n end", "title": "" }, { "docid": "90cab6fe6cb1e2d63508fec4564e1019", "score": "0.4895131", "text": "def interval_display\n RecurringPayment.interval_display(interval_units, interval_count)\n end", "title": "" }, { "docid": "beac3427fa051234045ebd6331c2c10c", "score": "0.4893026", "text": "def segments\n template_snapshot.xpath('//psc:study-segment', Psc.xml_namespace)\n end", "title": "" }, { "docid": "15354005bd635e185b3574e9950a28c4", "score": "0.48896503", "text": "def index\n @api_v1_polls_segments = Api::V1::PollsSegment.all\n end", "title": "" }, { "docid": "1ab1b860ba2dd3e52c6c7d712377d669", "score": "0.48857787", "text": "def metrics_for_range query, start_time, end_time, intervals\n\t\tresponse = []\n\t\tinterval = (end_time.to_i - start_time.to_i) / intervals\n\t\tcurrent_time = start_time\n\t\t(0..intervals-1).each do |i|\n\t\t\tnext_time = current_time + interval\n\t\t\tresponse[i] = query.call(current_time..next_time)\n\t\t\tcurrent_time = next_time\n\t\tend\n\t\tresponse\n\tend", "title": "" }, { "docid": "8f65cd04a220b461b0d022b8116bad83", "score": "0.48820925", "text": "def show\n @jira_countdown = JiraCountdown.get(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @jira_countdown }\n end\n end", "title": "" }, { "docid": "8fb0cbe4fa3348f64ebd6a38c69a8d39", "score": "0.48794413", "text": "def index\n @courses = Course.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @courses }\n end\n end", "title": "" }, { "docid": "3c4a9dd2ca6f572a78b878cf946168d2", "score": "0.4877081", "text": "def index\n finder = TimeBlock\n finder = finder.for_task(params[:task_id]) if params[:task_id].present?\n @time_blocks = finder.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @time_blocks }\n end\n end", "title": "" }, { "docid": "f19e55991c191ca20e28ee8a2908b0bc", "score": "0.48748764", "text": "def index\n @secs = Sec.all\n end", "title": "" }, { "docid": "dd3e591534707f865cb65d3049f022e6", "score": "0.48748356", "text": "def get_single_grading_period_courses(course_id,id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"course_id is required\" if course_id.nil?\n raise \"id is required\" if id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :course_id => course_id,\n :id => id\n )\n\n # resource path\n path = path_replace(\"/v1/courses/{course_id}/grading_periods/{id}\",\n :course_id => course_id,\n :id => id)\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n response = mixed_request(:get, path, query_params, form_params, headers)\n response\n \n end", "title": "" }, { "docid": "b94c2e4f328dcebb2fc0b882049ba924", "score": "0.48730034", "text": "def index\n get_iterations\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @iterations }\n end\n end", "title": "" }, { "docid": "387082ed0906b6d94be1678b71bd2266", "score": "0.48720193", "text": "def get_security_interval_movers(opts = {})\n data, _status_code, _headers = get_security_interval_movers_with_http_info(opts)\n return data\n end", "title": "" }, { "docid": "125411a9d2fc1d058955ca5fa6f6f5d8", "score": "0.48709044", "text": "def index\n @sections = @semester.sections.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render xml: @sections }\n end\n end", "title": "" } ]
7dc7f069db6343f5b74000dec1b5d880
The default dataset class to use for the database
[ { "docid": "3ce1b66e226d058c6920158ade193d06", "score": "0.8824762", "text": "def dataset_class_default\n self.class.const_get(:DatasetClass)\n end", "title": "" } ]
[ { "docid": "42028f4ac6f6ea92d18e05889febca3d", "score": "0.75380605", "text": "def dataset\n implemented_in_subclass\n end", "title": "" }, { "docid": "9d9cfac38eaf1d9af87735c2c4248a07", "score": "0.7146395", "text": "def dataset(name)\n datasets[name] = dataset_class.new(**dataset_options(name))\n end", "title": "" }, { "docid": "03e16c0c600d7baf4bee2c2e64044355", "score": "0.70977414", "text": "def dataset_class=(c)\n unless @dataset_modules.empty?\n c = Class.new(c)\n @dataset_modules.each{|m| c.send(:include, m)}\n end\n @dataset_class = c\n reset_default_dataset\n end", "title": "" }, { "docid": "1a5447b0b10f4bdd4cb07819bf5d49f4", "score": "0.7072929", "text": "def dataset(_name)\n @dataset ||= Dataset.new(connection)\n end", "title": "" }, { "docid": "92183167d37943c105b528667266cb16", "score": "0.7054821", "text": "def dataset(opts=nil)\n Sequel::JDBC::MSSQL::Dataset.new(self, opts)\n end", "title": "" }, { "docid": "0f7274a9183e9fb64c0aff63ffcc63ed", "score": "0.70503277", "text": "def dataset\n raise NotImplementedError\n end", "title": "" }, { "docid": "512c70817cbc9b6320583a60d7b14b65", "score": "0.6990955", "text": "def get_dataset(options)\n if options.nil? || !options.is_a?(Hash) || !options.has_key?('dataType')\n return EternosBackup::SiteData.defaultDataSet\n else\n options['dataType']\n end\n end", "title": "" }, { "docid": "c97ee9ce59f71f64bf631017c6b6c0ca", "score": "0.69430125", "text": "def dataset(opts=nil)\n Sequel::JDBC::SQLServer::Dataset.new(self, opts)\n end", "title": "" }, { "docid": "f45bfe529c7066404ea6bfbbb7925dff", "score": "0.69232166", "text": "def dataset(opts=nil)\n Sequel::ADO::MSSQL::Dataset.new(self, opts)\n end", "title": "" }, { "docid": "c343504e5b447c322facb7f2b6988d3b", "score": "0.68604827", "text": "def default_dataset_key\n read(:default_dataset).to_s\n end", "title": "" }, { "docid": "11b435b0d1cc896979197eb10c3db238", "score": "0.68248194", "text": "def data_class\n ::ActiveSupport::Deprecation.warn(\"data_class_name option is deprecated. Use model instead\", caller) if config[:data_class_name]\n model_name = config[:model] || config[:data_class_name]\n @data_class ||= model_name && model_name.constantize\n end", "title": "" }, { "docid": "cb10404724e16b800f8da2346d4136dd", "score": "0.67807186", "text": "def dataset\n Pathname.new(super.to_s)\n end", "title": "" }, { "docid": "11fb78a548c9eab4f38220faff20300a", "score": "0.66971976", "text": "def dataset(name)\n dataset_klass = namespace.const_defined?(:Dataset) ? namespace.const_get(:Dataset) : Dataset\n datasets[name] = dataset_klass.new(config.merge(uri: uri, base_path: name))\n end", "title": "" }, { "docid": "19e3aa42f5f3844043b9e8b0fac83dc0", "score": "0.66932976", "text": "def dataset\n bigquery.dataset(dataset_name) || bigquery.create_dataset(dataset_name)\n end", "title": "" }, { "docid": "88a927b734df42fd1045c633a2f88815", "score": "0.6682651", "text": "def dataset(opts=nil)\n Sequel::JDBC::Oracle::Dataset.new(self, opts)\n end", "title": "" }, { "docid": "88a927b734df42fd1045c633a2f88815", "score": "0.6682651", "text": "def dataset(opts=nil)\n Sequel::JDBC::Oracle::Dataset.new(self, opts)\n end", "title": "" }, { "docid": "da0297f18a5b84c952222e95267dbe17", "score": "0.6676154", "text": "def default_dataset(provenance:, dmp:, json:)\n return nil unless provenance.present? && dmp.present?\n\n ::Dataset.new(\n title: \"Dataset for: #{dmp.title || json[:title]}\",\n dataset_type: 'dataset',\n provenance: provenance\n )\n end", "title": "" }, { "docid": "dcbdba5ec99e8d88ce3af72240241c89", "score": "0.66459113", "text": "def data_class\n @data_class ||= begin\n klass = constantize_class_name(\"Netzke::ModelExtensions::#{config[:model]}For#{short_component_class_name}\") || original_data_class\n end\n end", "title": "" }, { "docid": "56e7d8983d74fd89efb622f2ad6afb83", "score": "0.6644672", "text": "def initialize dataset\n self.dataset = dataset\n end", "title": "" }, { "docid": "a063513913fdfc87b5d390fff37ff5ca", "score": "0.6641863", "text": "def dataset\n @dataset || raise(Error, \"No dataset associated with #{self}\")\n end", "title": "" }, { "docid": "061a76edb497b60c8c535b29f40bafed", "score": "0.66079336", "text": "def data_class\n @data_class ||= begin\n klass = \"Netzke::ModelExtensions::#{config[:model]}For#{short_widget_class_name}\".constantize rescue nil\n klass || original_data_class\n end\n end", "title": "" }, { "docid": "ebc7b30d5f0231dba6acc841f6cf6e47", "score": "0.6600517", "text": "def dataset= value\n @gapi.configuration.query.default_dataset = @service.dataset_ref_from value\n end", "title": "" }, { "docid": "fbf0888b27d8c5b131a1af63aca8bb06", "score": "0.65752757", "text": "def dataset\n model.dataset\n end", "title": "" }, { "docid": "fbf0888b27d8c5b131a1af63aca8bb06", "score": "0.65752757", "text": "def dataset\n model.dataset\n end", "title": "" }, { "docid": "98eb15f02cbf1e09dc955a177f6d2414", "score": "0.65640795", "text": "def sti_subclass_dataset(key)\n ds = super\n if @cti_alias && cti_models[0] != self # SEQUEL5: remove @cti_alias\n ds = ds.from_self(:alias=>@cti_alias)\n end\n ds\n end", "title": "" }, { "docid": "93ea6449107ce7a9fdfdaa6d5c3a0164", "score": "0.6541482", "text": "def dataset(opts = nil)\n TinyTDS::Dataset.new(self, opts)\n end", "title": "" }, { "docid": "0580f2ac042e17f80db83a676a1fe272", "score": "0.6516981", "text": "def dataset\n super.freeze\n end", "title": "" }, { "docid": "0580f2ac042e17f80db83a676a1fe272", "score": "0.6516981", "text": "def dataset\n super.freeze\n end", "title": "" }, { "docid": "9d8225a27409b842bc8f30ab0872e7b7", "score": "0.65101135", "text": "def data_class\n ::ActiveSupport::Deprecation.warn(\"data_class_name option is deprecated. Use model instead\", caller) if config[:data_class_name]\n model_name = config[:model] || config[:data_class_name]\n @data_class ||= model_name.nil? ? raise(ArgumentError, \"No model specified for widget #{global_id}\") : model_name.constantize\n end", "title": "" }, { "docid": "23b58ce0738ae05be5eb6cbdd468b4b2", "score": "0.6428173", "text": "def db_instance_class\n data.db_instance_class\n end", "title": "" }, { "docid": "2344831681a0d857a190a9d876d2b458", "score": "0.64227635", "text": "def data_classes\n configure_core_query(:data_classes)\n end", "title": "" }, { "docid": "a39dc04c9cd9698fcfc4570559b56a8a", "score": "0.6417946", "text": "def dataset\n name\nend", "title": "" }, { "docid": "bb09f08ec0e39e4ededd89bdd140cdbc", "score": "0.6406893", "text": "def [](dataset_name, sequential = false)\r\n if sequential then SequentialDataset[self, dataset_name]\r\n else PartitionedDataset[self, dataset_name]\r\n end\r\n # And pray to your gods that the dataset exists and it is of the specified\r\n # type.\r\n end", "title": "" }, { "docid": "59f9432bb660e2ce1b12ad70436706d5", "score": "0.64041746", "text": "def dataset(name)\n datasets[name] = Dataset.new(connection, dataset_options)\n end", "title": "" }, { "docid": "f0c97b64a1b9ba085ee1da0bccbff69e", "score": "0.6391222", "text": "def dataset(name)\n rql.db(options[:db]).table(name.to_s).run(connection)\n datasets[name] = Dataset.new(rql.table(name.to_s), rql, connection)\n end", "title": "" }, { "docid": "d399edfd88311f5c74fddd5caa03293b", "score": "0.6383593", "text": "def metadata_dataset\n return @metadata_dataset if @metadata_dataset\n ds = dataset\n ds.identifier_input_method = identifier_input_method_default\n ds.identifier_output_method = identifier_output_method_default\n @metadata_dataset = ds\n end", "title": "" }, { "docid": "e843189ee0a5eeeca96a5c26d411a3fc", "score": "0.63776654", "text": "def metadata_dataset\n @metadata_dataset ||= (\n ds = dataset;\n ds.identifier_input_method = identifier_input_method_default;\n ds.identifier_output_method = :downcase;\n ds\n )\n end", "title": "" }, { "docid": "127185da1b82bcaed99608207de52db9", "score": "0.6338989", "text": "def original_data_class\n @original_data_class ||= begin\n ::ActiveSupport::Deprecation.warn(\"data_class_name option is deprecated. Use model instead\", caller) if config[:data_class_name]\n model_name = config[:model] || config[:data_class_name]\n model_name && model_name.constantize\n end\n end", "title": "" }, { "docid": "05087c1085b54b9c354c8a04bc468053", "score": "0.63282907", "text": "def dataset\n self.class.dataset(@session)\n end", "title": "" }, { "docid": "c4477feb0437200de7dffa8191ea4349", "score": "0.63138616", "text": "def data_type_type\n return DataTypes[self.class.to_s]\n end", "title": "" }, { "docid": "407530d3f73ed173e574438d4acf1e2c", "score": "0.63091236", "text": "def set_dataset(*)\n x = super\n set_default_values\n x\n end", "title": "" }, { "docid": "d658bcf84d2ee41a9b77a4c0c9182695", "score": "0.6256425", "text": "def dataset(topic)\n @datasets[topic.to_sym] ||= Dataset.new(self, topic)\n end", "title": "" }, { "docid": "73a07095222e3b68c1b0d452138c7e91", "score": "0.6236764", "text": "def default_dataset_for(table_name)\n shard_number = config.logical_shard_configs(table_name).keys.first\n shard_name = config.logical_shard_configs(table_name)[shard_number]\n self[shard_name][:\"#{schema_for(table_name, shard_number)}__#{table_name}\"]\n end", "title": "" }, { "docid": "bea60fd84b3446580424e132095ee4e0", "score": "0.62351465", "text": "def data_adapter\n @data_adapter ||= \"RademadeAdmin::Model::Adapter::Data::#{orm_type}\".constantize.new(@model)\n end", "title": "" }, { "docid": "3aca82e05d7abd86da8ae5f050a460a0", "score": "0.6232492", "text": "def original_data_class\n @original_data_class ||= begin\n ::ActiveSupport::Deprecation.warn(\"data_class_name option is deprecated. Use model instead\", caller) if config[:data_class_name]\n model_name = config[:model] || config[:data_class_name]\n model_name && constantize_class_name(model_name)\n end\n end", "title": "" }, { "docid": "7e932cd031ce7f6f1a207ef2072142bc", "score": "0.6219133", "text": "def schema\n data_class.schema\n end", "title": "" }, { "docid": "619624d7654b731c36e081900402e7f4", "score": "0.62135285", "text": "def dataset( ds_name )\n data_service.dataset( ds_name.to_s )\n end", "title": "" }, { "docid": "319ef987ec125a59dd75d544b32be757", "score": "0.62107867", "text": "def dataset(ds_name)\n data_service.dataset(ds_name.to_s)\n end", "title": "" }, { "docid": "c22b116113737525d141700103e04a41", "score": "0.61945516", "text": "def data_class\n DpkgTools::Package::Data\n end", "title": "" }, { "docid": "c22b116113737525d141700103e04a41", "score": "0.61945516", "text": "def data_class\n DpkgTools::Package::Data\n end", "title": "" }, { "docid": "263ec9f3af7903af7c11775e844d8015", "score": "0.61932147", "text": "def database_classname\n @classname\n end", "title": "" }, { "docid": "2ae95323a49ac41ee6096000c5d57e0a", "score": "0.6179709", "text": "def data_type(klass=nil)\n klass ||= configurable.class\n setting = klass.default_settings[key]\n\n # HACK to work around Company < Team issue\n unless setting\n setting = Company.default_settings[key]\n end\n\n # Climb the inheritance tree\n until klass == NilClass || setting\n klass = configurable.send(klass.inherit_from).class\n setting = klass.default_settings[key]\n end\n\n setting[0]\n end", "title": "" }, { "docid": "9eb4e4ca587ab7c8704545578edfd096", "score": "0.6178473", "text": "def default_dataset_for(table_name)\n shard_number = config.logical_shard_configs(table_name).keys.sample\n shard_name = config.logical_shard_configs(table_name)[shard_number]\n self[shard_name][:\"#{schema_for(table_name, shard_number)}__#{table_name}\"]\n end", "title": "" }, { "docid": "eff11265de31ebb36fb60028a280349d", "score": "0.61756545", "text": "def dataset(db_table_name)\n @db.from(db_table_name)\n end", "title": "" }, { "docid": "7b973c50fdc91cb862c69cf34c811a48", "score": "0.61697906", "text": "def database\n self.class_database || CouchRest::Model.default_database\n end", "title": "" }, { "docid": "66acca1097c9c3db4d4e4518a4d4abc1", "score": "0.6164831", "text": "def dataset(name)\n connection[name]\n end", "title": "" }, { "docid": "11a0b3265280f7d1059a8c78e78e5b0b", "score": "0.6126816", "text": "def datasourceclassname\n @data['driver-datasource-class-name']\n end", "title": "" }, { "docid": "a0c5a1a60809a4bf27fbe297cdbf1dcf", "score": "0.6124393", "text": "def database_type; end", "title": "" }, { "docid": "5b7662a81256dc611ce961a48c042040", "score": "0.6116902", "text": "def metadata_dataset\n @metadata_dataset ||= _metadata_dataset\n end", "title": "" }, { "docid": "9fad680fcf779c20f663b536f1b6abb2", "score": "0.61091095", "text": "def dataset(name)\n environment.with_current_connection{|c|\n c.dataset(name)\n }\n end", "title": "" }, { "docid": "8891c36f6ec4f27772d7497c49aafef8", "score": "0.60958344", "text": "def dataloader_class=(_arg0); end", "title": "" }, { "docid": "6c32326081f0d52c74a27e3ec5e35140", "score": "0.60915136", "text": "def dataset(options = {})\n dataset_collection.find(options)\n end", "title": "" }, { "docid": "bfb4469fedf588d37c0e410a39c45b95", "score": "0.6071724", "text": "def data_class\n data.first.class\n end", "title": "" }, { "docid": "b70d9d7211abf0e84e14cc859beed2d2", "score": "0.60696024", "text": "def dataset_record_type\n DatasetRecordField.decode_record_type(self.encoded_dataset_record_type)\n end", "title": "" }, { "docid": "da50be61bdd0ff3ad6ec3319182fc2fe", "score": "0.6063022", "text": "def get_dataset(dataset_name)\n Quandl::Dataset.get(dataset_name)\n end", "title": "" }, { "docid": "259695a4de88f08a01697b363863eb1d", "score": "0.6061528", "text": "def data_class\n Object\n end", "title": "" }, { "docid": "f33b49035ac00a1d7342846e57c4f315", "score": "0.60501593", "text": "def dataset=(value)\n raise(TypeError, \"Expected Sequel::Dataset, got #{value.class}\") unless\n value.is_a?(Sequel::Dataset)\n\n @dataset = value\n end", "title": "" }, { "docid": "164c474dbbf5ba52a9208df6da5e2da6", "score": "0.6028605", "text": "def _metadata_dataset\n dataset\n end", "title": "" }, { "docid": "44d5080f06071e5ff605d489a59ba9c5", "score": "0.6024607", "text": "def dataset(name)\n dataset_source = sources.fetch(name.to_s)\n\n datasets[name] = Dataset.new(\n dataset_source.fetch(:data),\n path: dataset_source.fetch(:path),\n file_options: options\n )\n end", "title": "" }, { "docid": "9832d2fbd6c5c0f9aecc52afc59eb7d8", "score": "0.60209143", "text": "def get_data_class(type)\n data_klass = nil\n begin\n data_klass = TaliaCore::DataTypes.const_get(type)\n rescue Exception => e\n puts(\"Could get the data type #{type}: #{e}\")\n Util.print_options\n exit(1)\n end\n \n # Do the basic check\n unless(data_klass && data_klass.kind_of?(Class) && data_klass.method_defined?('data_directory'))\n puts(\"Cannot create data class from #{type}\")\n exit(1)\n end\n \n # Now check if we are a subclass of the data class\n my_instance = data_klass.new\n \n unless(my_instance.kind_of?(TaliaCore::DataTypes::DataRecord))\n puts(\"The class #{data_klass} is not a DataRecord, can't create data for it.\")\n exit(1)\n end\n \n data_klass\n end", "title": "" }, { "docid": "8dd2368d9cab3776afe4cc4768b671be", "score": "0.60057217", "text": "def class\n __data_hash.key?( :class ) ? __data_hash[ :class ] : super\n end", "title": "" }, { "docid": "5a0c521ef2b69594908d4b5b32ea0a21", "score": "0.5987841", "text": "def reset_default_dataset\n Sequel.synchronize{@symbol_literal_cache.clear}\n @default_dataset = dataset\n end", "title": "" }, { "docid": "873ba5da62d248157fcfeb9dc9ec68a2", "score": "0.5977437", "text": "def datasets\n dataset_class = \"RGovData::#{type.to_s.capitalize}DataSet\".constantize\n @datasets ||= dataset_class.load_datasets(self)\n rescue\n []\n end", "title": "" }, { "docid": "53f0acae19286922856325143228cce0", "score": "0.5965322", "text": "def dataset(**options)\n logger = options.fetch(:logger, ::Logger.new(false))\n repo = settings.repository\n if %i(default-graph-uri named-graph-uri).any? {|k| options.key?(k)} \n default_datasets = Array(options[:\"default-graph-uri\"]).map {|u| RDF::URI(u)}\n named_datasets = Array(options[:\"named-graph-uri\"]).map {|u| RDF::URI(u)}\n\n (default_datasets + named_datasets).each do |uri|\n load_opts = {logger: logger, graph_name: uri, base_uri: uri}\n unless repo.has_graph?(uri)\n logger.debug(options) {\"=> load #{uri}\"}\n repo.load(uri.to_s, **load_opts)\n end\n end\n\n # Create an aggregate based on queryable having just the bits we want\n aggregate = RDF::AggregateRepo.new(repo)\n named_datasets.each {|name| aggregate.named(name) if repo.has_graph?(name)}\n aggregate.default(*default_datasets.select {|name| repo.has_graph?(name)})\n aggregate\n end || settings.repository\n end", "title": "" }, { "docid": "de4c7ccf308577d1913a41d82c275735", "score": "0.59190625", "text": "def data_adapter\n @data_adapter ||= Netzke::Basepack::DataAdapters::AbstractAdapter.adapter_class(data_class).new(data_class)\n end", "title": "" }, { "docid": "7c4f587c1b2eee0588bcad4451b7c65a", "score": "0.5916436", "text": "def dataset_from(params)\n dataset_name = params[:dataset].to_sym unless params[:dataset].nil?\n dataset_name ||= nil\n Datasets::Base.dataset_from dataset_name\n end", "title": "" }, { "docid": "8062968e8ec1ccc143f102094a22df98", "score": "0.5882397", "text": "def default klass\n @default_klass = klass\n end", "title": "" }, { "docid": "e8ccccaf61db2038cfeed57b13b102de", "score": "0.5874066", "text": "def load_dataset\n \t\tfile_name = \"public\" + data.url.split(\"?\")[0]\n \t\tcase data_content_type\n \t\twhen FCT_CSV\n \t\t\t@dataset = Roo::CSV.new(file_name, csv_options: {col_sep: \";\"})\n \t\twhen FCT_XLS\n \t\t\t@dataset = Roo::Excel.new(file_name)\n \t\twhen FCT_XLSX\n \t\t\t@dataset = Roo::Excelx.new(file_name)\n \t\twhen FCT_ODS\n \t\t\t@dataset = Roo::OpenOffice.new(file_name)\n \t\tend\n \tend", "title": "" }, { "docid": "daa10d7dee0d591fe65ffc6766045cbc", "score": "0.58631843", "text": "def klass\n @klass ||= metadata.klass\n end", "title": "" }, { "docid": "37f4a2fe34f98fc7a98de879faf66635", "score": "0.58620346", "text": "def record_class\n @record_class ||= _record_class.text_value.to_sym\n end", "title": "" }, { "docid": "2adc43bafb72618a9ec160e94bbc311a", "score": "0.5848508", "text": "def dataset_id\n @gapi.table_reference.dataset_id\n end", "title": "" }, { "docid": "83e6278819d41f3b7deba1a126435c42", "score": "0.5844999", "text": "def datasets\n deep_copy_of_authoritative_value_or_fallback 'datasets'\n end", "title": "" }, { "docid": "853edead8476af99dfd21aad78a4b6b3", "score": "0.5838234", "text": "def dataset(name)\n datasets[name] = Dataset.new(sources.fetch(name.to_s))\n end", "title": "" }, { "docid": "a5a39310a88bbbffd7f440b945456ea0", "score": "0.5829325", "text": "def collect\n MDQuery::Dataset::Dataset.new(self, do_queries)\n end", "title": "" }, { "docid": "d14ec90147f365d5d899d8463157b0e0", "score": "0.5823654", "text": "def initialize(dataset, name, schema)\n @dataset = dataset\n @name = name\n @schema = schema\n end", "title": "" }, { "docid": "9f4c265b4ad771ec800562c4df901972", "score": "0.5821593", "text": "def initialize( * ) # :notnew:\n\t\tThingfish::Metastore::PG::Metadata.dataset = self.class.db[:metadata]\n\t\t@model = Thingfish::Metastore::PG::Metadata\n\tend", "title": "" }, { "docid": "4a58f17f8df2d10a4345a6ea116a79de", "score": "0.5804078", "text": "def dataset dataset_id\n ensure_service!\n gapi = service.get_dataset dataset_id\n Dataset.from_gapi gapi, service\n rescue Google::Cloud::NotFoundError\n nil\n end", "title": "" }, { "docid": "3f1cd2bf847ae599c01b00931d0c9e2a", "score": "0.5797991", "text": "def default_database\n @default_database ||= Database.new(read_inheritable_attribute(:database_uri))\n end", "title": "" }, { "docid": "46d3bd62673f86154ab5f3c4b6e9acb6", "score": "0.57953686", "text": "def data_model_class_name\n \"Reporting::#{data_source.classify}\"\n end", "title": "" }, { "docid": "107e8f07da60192a0ef2a46dc077fa5f", "score": "0.57919717", "text": "def dataset( ds_id )\n data_service.dataset( service_name( ds_id ) )\n end", "title": "" }, { "docid": "fda2463627efe549145e70759401c1cc", "score": "0.5789606", "text": "def orm_class; end", "title": "" }, { "docid": "5c123736f8470e48dbc035a912359052", "score": "0.5782308", "text": "def bigquery_dataset\n @bigquery_dataset ||= application.override_feature_set.empty? ? \"warehouse\" : \"warehouse_\" + current_feature_set.gsub(/\\W/, '_')\n end", "title": "" }, { "docid": "25d7236ced22f785dde04c1354e1c6bb", "score": "0.57802063", "text": "def initialize(dataset)\n dataset.schema.each do |(name, column_schema)|\n field = Field.new(name, column_schema)\n self[name] = field\n\n if @primary_key.nil? && column_schema[:primary_key]\n @primary_key = field\n end\n end\n end", "title": "" }, { "docid": "fff9e93f8da5d123a2565bf5ae1dc905", "score": "0.57769644", "text": "def dataset_id\n @gapi.table_reference.dataset_id\n end", "title": "" }, { "docid": "18564fa399b83375878774034610f53c", "score": "0.57751364", "text": "def default_new_record\n record_class.new\n end", "title": "" }, { "docid": "8491b86a2c8e1c7b110cb54f8e97de24", "score": "0.57586545", "text": "def dataset_id\n return reference.dataset_id if reference?\n @gapi.table_reference.dataset_id\n end", "title": "" }, { "docid": "11da827a4144d970ab6ec931d81e8f4e", "score": "0.5755657", "text": "def db_class\n @engine.db_class(@domain_class)\n end", "title": "" }, { "docid": "4dd09e4a5e89ea83ff718a3683ffe06e", "score": "0.57499504", "text": "def metadata_dataset\n ds = super\n ds.quote_identifiers = true\n ds\n end", "title": "" }, { "docid": "329dea79a34aa0418025416c68fe3db4", "score": "0.57461816", "text": "def type_of?(dataset)\n if snapshot?(dataset)\n :snapshot\n elsif dataset?(dataset)\n :dataset\n else\n :unknown\n end\n end", "title": "" }, { "docid": "6b70a231d87b80c3b7ef8cc4582e6821", "score": "0.5739674", "text": "def storage_class\n data.storage_class\n end", "title": "" } ]
0787b808791bb93c43ca2e79d6482525
Gets all the subscribed events from a certain bookie
[ { "docid": "4edd4697c16b5848e938a182bfa5adc5", "score": "0.662725", "text": "def getSubscribedEventsFrom (email)\n @users[email].subscribedEvents\n end", "title": "" } ]
[ { "docid": "25509ee988e1d9ea19ceb7e66d146967", "score": "0.6712599", "text": "def subscribed_events\n adapter.subscribers.map(&:meta)\n end", "title": "" }, { "docid": "46845641fe8196ad1268b1b4e585b331", "score": "0.65943307", "text": "def subscribers\n event.subscribers_to_notify\n end", "title": "" }, { "docid": "ed0ebd32101616514b5a420aa84af111", "score": "0.6506052", "text": "def deliveries_events\n self.deliveries.each.map { |deliveries| deliveries.events }.flatten\n end", "title": "" }, { "docid": "19908b3d173860aac846deed5a21e69e", "score": "0.64535224", "text": "def burn_events\n return @burn_events ||= []\n end", "title": "" }, { "docid": "4f118b5a7a919d0cbc6f8eb769bb7995", "score": "0.6397555", "text": "def events\n @events ||= self.class.request_and_parse(:get, \"#{@bandsintown_id}/events\").map { |event_hash| Bandsintown::Event.build_from_json(event_hash) }\n end", "title": "" }, { "docid": "2eb2209c0352c50b2083ab4775667dd0", "score": "0.6345425", "text": "def broadcasted_events\n find_related_frbr_objects( :broadcasts, :which_events?) \n end", "title": "" }, { "docid": "8b32f73e217fd6f329af9bdcae3779df", "score": "0.6241083", "text": "def events\n events_tracker.events\n end", "title": "" }, { "docid": "9ea414236d451622f82e28c21538f200", "score": "0.6236542", "text": "def list\n REDIS.hgetall(\"Attending:#{Event.current}\").values.map {|x|JSON.parse(x)}\n end", "title": "" }, { "docid": "d35fe336e0b5c2f71d13fb9b13852944", "score": "0.6231267", "text": "def all_events\n events.keys\n end", "title": "" }, { "docid": "0f4b03dcc338a22e8bc4199fb3fb1906", "score": "0.6191187", "text": "def events\n EVENTS.keys\n end", "title": "" }, { "docid": "1a1673d7d952c34add383e498ac0a45f", "score": "0.61800253", "text": "def list\n return $data_common_events[@common_event_id].list\n end", "title": "" }, { "docid": "1a1673d7d952c34add383e498ac0a45f", "score": "0.61800253", "text": "def list\n return $data_common_events[@common_event_id].list\n end", "title": "" }, { "docid": "1a1673d7d952c34add383e498ac0a45f", "score": "0.61800253", "text": "def list\n return $data_common_events[@common_event_id].list\n end", "title": "" }, { "docid": "4633ee98769f612ca775480c4126e933", "score": "0.617778", "text": "def events\n return @events unless @events.blank?\n @events = self.class.request_and_parse(:get, \"#{api_name}/events\").map { |event| Bandsintown::Event.build_from_json(event) }\n end", "title": "" }, { "docid": "86080f3887dadb383e40cfedbeb892db", "score": "0.615285", "text": "def addSubscribedBookieTo(eventID, bookie)\n events[eventID].addObserver(bookie)\n end", "title": "" }, { "docid": "423093534572ecc202caa68572b644ed", "score": "0.61422944", "text": "def event_subscriptions_for(event_name)\n event_subscriptions[normalize_event(event_name)]\n end", "title": "" }, { "docid": "23071a07716425bbf805e53478274393", "score": "0.6138167", "text": "def get_events\n\t\tev_ids = get_events_ids\n\t\tevs = []\n\t\tev_ids.each do |stuff|\n\t\t\tevs << Event.find(stuff)\n\t\tend\n\t\treturn evs\n\tend", "title": "" }, { "docid": "467be813d02d871adb1631b4c52dd51a", "score": "0.6127333", "text": "def reported_events\n redis.hgetall(\"#{id}:events\").to_a.map{|t,e| [Time.at(t.to_f),e] }.sort_by(&:first)\n end", "title": "" }, { "docid": "4650b2bab19525fc65d51cff73cb257e", "score": "0.6126049", "text": "def list\r\n return $data_common_events[@common_event_id].list\r\n end", "title": "" }, { "docid": "059e14b78ac841b0be177a287b95aa31", "score": "0.610977", "text": "def list_subscribed(&block)\n @native.list(:watched, &block)\n end", "title": "" }, { "docid": "57c8a41e71912fd7079cf1f78dcb5205", "score": "0.60876", "text": "def events\n KlaviyoAPI::Event.all\n end", "title": "" }, { "docid": "43849291adb68ee1db6617959411d4c2", "score": "0.6079769", "text": "def events\n EVENTS.keys\nend", "title": "" }, { "docid": "c16f272a169b4cba46e0a7b820e9dc97", "score": "0.60748494", "text": "def get_events\n found = []\n @state_events.synchronize do\n if @state_events.empty?\n return found\n else\n @state_events_pending.wait_while { @state_events.empty? }\n @state_events.dup.each do |e|\n found.push(e)\n end\n @state_events.clear\n return found\n end\n end\n end", "title": "" }, { "docid": "748ac02c4aac845c5ebd069ac10758f3", "score": "0.60664403", "text": "def next_events\n []\n end", "title": "" }, { "docid": "20b04f74a9fcbdd31ae4ef9b20273423", "score": "0.6060869", "text": "def adverse_events\n get_data_elements('adverse_event')\n end", "title": "" }, { "docid": "ad1b51d4c548595d1ea2bec9f54bdddb", "score": "0.60588", "text": "def getAllEvents\n return @Events \n end", "title": "" }, { "docid": "d2df8ac15c2a36af72d71054174c8046", "score": "0.6053224", "text": "def find_events( type )\n\t\treturn @enqueued_events.find_all do |event|\n\t\t\tevent.type == type\n\t\tend\n\tend", "title": "" }, { "docid": "806433378b7fb33ff9192dbc90c60228", "score": "0.60361785", "text": "def events\n events_map.events\n end", "title": "" }, { "docid": "31cb1eebe69ae7c2d9f685004e5a9761", "score": "0.60287136", "text": "def get_all_events\n result = EM::Synchrony.sync EventMachine::HttpRequest.new(@url).aget\n parse(result.response)\n end", "title": "" }, { "docid": "d0646a73bbe4da973888895966fd117d", "score": "0.59980506", "text": "def poll_events\n end", "title": "" }, { "docid": "5b3af77273fa42e4857cae547fc9c583", "score": "0.59745365", "text": "def events\n return @events\n end", "title": "" }, { "docid": "5b3af77273fa42e4857cae547fc9c583", "score": "0.59745365", "text": "def events\n return @events\n end", "title": "" }, { "docid": "5b3af77273fa42e4857cae547fc9c583", "score": "0.59745365", "text": "def events\n return @events\n end", "title": "" }, { "docid": "a5cdb5a1853d83a0bec86a2c2e5c290d", "score": "0.5969001", "text": "def events\n events_url = API_BASE + \"/events\"\n response = get_api_request(events_url)\n response['items']\n end", "title": "" }, { "docid": "6cd0e2db5e8597b20f5b5aa26aa7e2c0", "score": "0.59680754", "text": "def events\n @events\n end", "title": "" }, { "docid": "30ec189ee4efa47ea9844d742b91aee2", "score": "0.59656703", "text": "def events\n keys = safe { redis.keys([PREFIX, \"*\", \"????\"].join(\"_\")) }\n keys.map { |key| key.split(\"_\")[1] }\n end", "title": "" }, { "docid": "a233944102e6812c373e339d600ed9b9", "score": "0.5952747", "text": "def get_all_events\n return Event.find(:all, :conditions => { :session_id => self.id }, :order => \"date ASC\")\n end", "title": "" }, { "docid": "09ef19b92d377cd170a036f2bf86ab5b", "score": "0.5952138", "text": "def events\n #@todo get hash (:role => event) from event links\n #but: multiple role assignments!\n #now: return event array.\n event_links.collect{|l| l.event}.uniq\n end", "title": "" }, { "docid": "df2966b80370b1c99765fad515fe3c93", "score": "0.5951306", "text": "def events\n @redis.smembers @key_space\n end", "title": "" }, { "docid": "7ae826cea91b1bcb1328620c192e65f7", "score": "0.5940578", "text": "def all_events\n\t\tevents = []\n\t\t\n\t\teach_event { |event| events.push(event) }\n\t\t\n\t\tevents\n\tend", "title": "" }, { "docid": "d5ec63c78de213c89d844b69631c735e", "score": "0.593519", "text": "def get_events()\n Services::EventSpotService.get_events()\n end", "title": "" }, { "docid": "5dd701a07af3df3a597523fcff5d1394", "score": "0.5923424", "text": "def events_awarded\n find_related_frbr_objects( :is_awarded_to, :which_events?) \n end", "title": "" }, { "docid": "ba95c170fb43b47b0c1aa46599f79e0a", "score": "0.5921883", "text": "def subscribers(name)\n @events[name] ||= Array.new\n @events[name]\n end", "title": "" }, { "docid": "6b04ff11e25893a9bd2a827f5f43cd33", "score": "0.5909991", "text": "def subscribers_for(name)\n event_name = EventName.new(name)\n name = event_name.name.to_sym\n namespace = event_name.namespace\n\n result = subscribers[name]\n result = result.map do |e|\n e[:class] if namespace.nil? || e[:namespace] == namespace\n end.compact\n end", "title": "" }, { "docid": "ca4cbfd03c2ba15a210351ffbde7b618", "score": "0.5907214", "text": "def events\n each_parent_object(EventStructure::Signal).to_set\n end", "title": "" }, { "docid": "c9742a68089579356911557bca93ca1a", "score": "0.58947706", "text": "def get_event_keys\r\n @events.keys\r\n end", "title": "" }, { "docid": "b2a454467a3cfb1b8c8c679060e419d4", "score": "0.58915776", "text": "def events\n keys = @redis.keys([PREFIX, \"*\", \"????\"].join(\"_\"))\n keys.map { |key| key.split(\"_\")[1] }\n end", "title": "" }, { "docid": "757d564db6ee5158f69128cbf23b8745", "score": "0.5890247", "text": "def owned_events\n self.object.events\n end", "title": "" }, { "docid": "fc91bf619c31ba52a4b9ce042eb7a628", "score": "0.585178", "text": "def listeners(event_name)\n events[event_name]\n end", "title": "" }, { "docid": "6c0e6bf42308170865afda7ca70e3efc", "score": "0.5848074", "text": "def subscribers_to_notify\n event_subscribers.where(sent_at: nil)\n end", "title": "" }, { "docid": "be775dcc32381e8be67e5104cfbe90a3", "score": "0.5837517", "text": "def get_events\n return @client.get_events\n end", "title": "" }, { "docid": "c4428dd04e4fa256f2f5dfcddfd3cd28", "score": "0.58331996", "text": "def get_all_events\n @events = Event.all\n end", "title": "" }, { "docid": "af26a2416bdfe542cd0361ce442ec65c", "score": "0.58328646", "text": "def events\n object.event_associations_between(period)\n end", "title": "" }, { "docid": "7c1e1f88392abb85e308e8a96821a4ab", "score": "0.58206093", "text": "def poll_events\n\t\treturn POLL_EVENTS.select.with_index {|ev,i| @poller_event[:events][i].nonzero? }\n\tend", "title": "" }, { "docid": "974f8122a6f454e5701aeed9b9336c45", "score": "0.58120525", "text": "def user_events\n self.events\n end", "title": "" }, { "docid": "3d6e1390852c877725a185fcdc3daacd", "score": "0.57852226", "text": "def events\n Event.where(group_id: groups.ids)\n end", "title": "" }, { "docid": "1de6b12ffbd2e99cf51cca13f58dbcc4", "score": "0.5782857", "text": "def events\r\r\n @event_redirect ? @cached_events : @events\r\r\n end", "title": "" }, { "docid": "ebb602cece18397acaece981675b0a0e", "score": "0.5781872", "text": "def surveys_events\n self.surveys.each.map { |survey| survey.events }.flatten\n end", "title": "" }, { "docid": "10e7c15f7b4a3e8832e701ca6c7fc536", "score": "0.5781129", "text": "def events\n collected[:events] ||= {}\n end", "title": "" }, { "docid": "5b3de4aa698e30df72919852cc85b70e", "score": "0.57791543", "text": "def observed_events\n if Cloudfuji::Platform.on_cloudfuji?\n @@observers.map {|observer|\n observer.class.instance_methods - Cloudfuji::EventObserver.instance_methods\n }.flatten.uniq - [:catch_all]\n else\n # Return some dummy events if in development\n %w(dummy_event app_claimed app_destroyed user_added email_opened).map(&:to_sym)\n end\n end", "title": "" }, { "docid": "9fd39162b83cae0cbfee5697fe5aaa56", "score": "0.57753146", "text": "def held_events\n find_related_frbr_objects( :holds, :which_events?) \n end", "title": "" }, { "docid": "a8f806a2080f9453f28bf86187a7d643", "score": "0.5771145", "text": "def get_upcoming_events\n # will return a list of upcoming events\n end", "title": "" }, { "docid": "d14106e577190d9f0d9eac79169eb3cd", "score": "0.57701176", "text": "def poll_events\n ret = req('events', \"id=#{@id}\")\n parse_response(ret)\n end", "title": "" }, { "docid": "0b31b70daa3d5c1bc98c22b820fd6f45", "score": "0.57677585", "text": "def events\n @events_map.keys\n end", "title": "" }, { "docid": "c876017abca6ef6124c0e1af0e29c22e", "score": "0.5765226", "text": "def events\n response.headers[\"Content-Type\"] = \"text/event-stream\"\n channels = current_user.subscribed_channel[:channel]\n redis = Redis.new\n redis.subscribe(channels) do |on|\n on.message do |event, data|\n response.stream.write(\"event: #{event}\\n\")\n response.stream.write(\"data: #{data}\\n\\n\")\n end\n end\n rescue \n IOError\n logger.info \"Stream closed\"\n ensure\n redis.quit\n response.stream.close\n end", "title": "" }, { "docid": "ef1b2385bb52e3c0cbb9bf1694168815", "score": "0.5759236", "text": "def events\n @event_handler.events\n end", "title": "" }, { "docid": "636be389646c7b4f2e8909690c3c9e71", "score": "0.57580215", "text": "def get_events\n {}\n end", "title": "" }, { "docid": "ef81b957011e33ba85e674078f37e89a", "score": "0.57542694", "text": "def events\n flat_map(&:events).uniq\n end", "title": "" }, { "docid": "9e054188840a96622d600d9499632a6e", "score": "0.57528", "text": "def index\n @event_receivers = current_user.event_receivers\n end", "title": "" }, { "docid": "a8c680c72ce4f03d334811693df821f4", "score": "0.5751199", "text": "def publish_events\n until @events.empty?\n @events.keys.each do |event_bus|\n events = @events.delete event_bus\n event_bus.publish events\n end\n end\n end", "title": "" }, { "docid": "3253792e526806e25de61faf2f823b8e", "score": "0.574552", "text": "def events\n @events ||= {}\n end", "title": "" }, { "docid": "350f4b16368abdf80ed5581333644a7e", "score": "0.5744618", "text": "def events\n\t\t@events = []\n\t\t@groups.each do |group|\n\t\t\t@events << group.event.order(:date, :time)\n\t\tend\n\t\treturn @events\n\tend", "title": "" }, { "docid": "4a0e39b310090dd28b52abc700bc4eb6", "score": "0.57284975", "text": "def get_society_current_events\n\t\tsocieties = get_societies\n\t\tevents = []\n\t\tsocieties.each do |soc|\n\t\t\tevents += soc.get_current_events\n\t\tend\n\t\treturn events\n\tend", "title": "" }, { "docid": "0eaab7420e00c46a1d5236e3e2bea95f", "score": "0.57277936", "text": "def events\n @events = Event.all\n end", "title": "" }, { "docid": "0eaab7420e00c46a1d5236e3e2bea95f", "score": "0.57277936", "text": "def events\n @events = Event.all\n end", "title": "" }, { "docid": "f0f528330276ca78a7dce5711948af5d", "score": "0.57243824", "text": "def events\n EVENTS\n end", "title": "" }, { "docid": "bdf3ade6ddc941169cd02064937b37d0", "score": "0.57227457", "text": "def get_all_events_cached\n @events = Event.all_cached\n end", "title": "" }, { "docid": "2f7a1c90a9181f761ed79c0f8e5d7d04", "score": "0.572001", "text": "def get_active_event_types(session_token, locale = nil)\n global.request :bf, :getActiveEventTypes do \n soap.body = { 'bf:request' => { :header => api_request_header(session_token), :locale => locale } }\n end\t\n end", "title": "" }, { "docid": "34cc7aabb961b1b60c5e75c26a7677e9", "score": "0.5701621", "text": "def subscribed_channels\n @subscriptions_by_channel.keys\n end", "title": "" }, { "docid": "2444295a4fc61461f22e0b8c0d2e89b0", "score": "0.5699481", "text": "def getEvents\n pendingEvents = []\n confirmedEvents = []\n allEvents = self.participationInEvent\n allEvents.each do |event|\n if event.isPending?\n pendingEvents.push(event)\n else\n confirmedEvents.push(event)\n end\n end\n organizedEvents = {}\n organizedEvents[\"confirmed\"] = confirmedEvents\n organizedEvents[\"pending\"] = pendingEvents\n return organizedEvents\n end", "title": "" }, { "docid": "bf7142800c24ae716c5cc9fd5b733514", "score": "0.5698749", "text": "def publishable_events_list\n (@publishable_events ||= Array.new).dup\n end", "title": "" }, { "docid": "d28315a1e80786989f5d7a7bd0489d8e", "score": "0.5682748", "text": "def perform\n events = []\n query.each do |eventbrite_event|\n events << Events::Event.new(eventbrite_event)\n end\n return events\n rescue => e\n Rails.logger.error \"Exception fetching Eventbrite events : #{e.class} #{e.message}\"\n Rails.logger.error e.backtrace.join(\"\\n\")\n Rollbar.error(e)\n return []\n end", "title": "" }, { "docid": "53850ccaed3027c69aef6e26b2dc9072", "score": "0.5678974", "text": "def fetch_events\n @start_time ||= (Time.current - 1.minute).to_i * 1000\n $mw_log.debug \"#{log_prefix} Catching Events since [#{@start_time}]\"\n\n new_events = @alerts_client.list_events(\"startTime\" => @start_time, \"tags\" => \"miq.event_type|*\", \"thin\" => true)\n @start_time = new_events.max_by(&:ctime).ctime + 1 unless new_events.empty? # add 1 ms to avoid dups with GTE filter\n new_events\n end", "title": "" }, { "docid": "0b621413c8f63e4b42fa7d0788bf32d0", "score": "0.56739765", "text": "def events\n date = (DateTime.now + 1.week).strftime('%Y-%m-%d')\n\n Event.where(id: Booking.joins(:event).where(\"bookings.building_id IN (?) AND date_trunc('day', events.date) < ? \", building_ids, date).select(:event_id))\n end", "title": "" }, { "docid": "e63ef6e95e6b2052ba81b08c26f29b0b", "score": "0.56736636", "text": "def events\n @eventable_events.clone\n end", "title": "" }, { "docid": "38501a0a8ecd52554eae17adc821eabf", "score": "0.56722873", "text": "def events\n @events ||= graph.get_connections('me', EVENTS_QUERY).map do |facebook_event|\n create_event_from(facebook_event)\n end\n end", "title": "" }, { "docid": "4966db72c3767e38e8d3c36d09157046", "score": "0.5645657", "text": "def event_exchanges(event_id)\n \treturn Exchange.where(event_id: event_id)\n end", "title": "" }, { "docid": "9b7ffd274bc8f5086b07d5d6c784d6fe", "score": "0.5640346", "text": "def events\n @data[:dane_przesylki][:zdarzenia][:zdarzenie]&.map { |e| Event.new(e) } || []\n end", "title": "" }, { "docid": "26617849b1f8fe8ae71f468c77690ede", "score": "0.5635759", "text": "def gtbs_events\n return $game_system.battle_events.values + @extras.values\n end", "title": "" }, { "docid": "7ee283b6ef75b1ed3cdedcaf5f4146a5", "score": "0.56328267", "text": "def get_all_response_of_user(mail)\n mail.mail_events\n end", "title": "" }, { "docid": "d2d1cde96fa221422de1df3b1b3842b3", "score": "0.5630477", "text": "def get_events(args)\n\t\t\tapi_url = \"#{@base_url}/#{args[:collection]}/#{args[:key]}/events/#{args[:event_type]}\"\n\t\t\tdo_the_get_call( url: api_url )\n\t\tend", "title": "" }, { "docid": "9cec73f2293541cf69ce8bc3fb9dac85", "score": "0.56182975", "text": "def subscriptions\n Subscription.filter(:fiction => self)\n end", "title": "" }, { "docid": "4ce66cfc492057a87b91760ad0659e5c", "score": "0.5612193", "text": "def all(options = nil)\n request = Request.new(@client)\n path = \"/events\"\n data = {\n\n }\n\n response = Response.new(request.get(path, data, options))\n return_values = Array.new\n \n a = Array.new\n body = response.body\n for v in body['events']\n tmp = Event(@client)\n tmp.fill_with_data(v)\n a.push(tmp)\n end\n\n return_values.push(a)\n \n\n \n return_values[0]\n end", "title": "" }, { "docid": "d69d320919708e835714423dcbe57abf", "score": "0.56117415", "text": "def events\n Event.where(:user_id => self.id).order_by(:timestamp => -1)\n end", "title": "" }, { "docid": "dad2bac4ff00485b7c82402f34ce125b", "score": "0.5609561", "text": "def channels\n @channel_subscriptions\n end", "title": "" }, { "docid": "0bc43915afc8da3d823edce511c1a836", "score": "0.56079966", "text": "def subscribers_for(event)\n __registry__.subscribers_for(event)\n end", "title": "" }, { "docid": "e237f7525f05c30a589149a69440ca09", "score": "0.5607867", "text": "def find_events(key=nil, value=nil)\n return @client.find_events(key, value)\n end", "title": "" }, { "docid": "038bd6b99bd29cbd01476d0974206b83", "score": "0.5607659", "text": "def subscribers\n subscriptions.map(&:subscriber)\n end", "title": "" }, { "docid": "80571ffa9cc37344642067f7dfe92ede", "score": "0.5607657", "text": "def events\n # Obtenemos todos los eventos\n every_events = created_events.asc.decorate + participated_events.asc.decorate\n every_events += member_events.asc.decorate if musician?\n\n # Ordenamos los eventos\n every_events.uniq.sort_by! { |event| event.date }\n end", "title": "" }, { "docid": "d4477a3046180d261255f505fbd3d6b1", "score": "0.56076556", "text": "def happened_events\n Event.where( event.date < today)\n end", "title": "" } ]
2964d2644cadae830ae13a3de07600bf
all of the methods
[ { "docid": "23e8ac60b5fdae0ecd56abf1351a2e68", "score": "0.0", "text": "def parse_operator(op, args)\n raise_unimplemented\n end", "title": "" } ]
[ { "docid": "1e5e53c4b9e93d9482caa25c8f435412", "score": "0.8471483", "text": "def methods; end", "title": "" }, { "docid": "b327a885692d528cdbf7b43ff9735d01", "score": "0.82936794", "text": "def methods\n\t\tend", "title": "" }, { "docid": "f3aa8ccef9ba023692217c09c4d3cb14", "score": "0.7545052", "text": "def _all; end", "title": "" }, { "docid": "f32be3fd3750b1ba1ed77cf9dfae35ce", "score": "0.738816", "text": "def all; end", "title": "" }, { "docid": "f32be3fd3750b1ba1ed77cf9dfae35ce", "score": "0.738816", "text": "def all; end", "title": "" }, { "docid": "f32be3fd3750b1ba1ed77cf9dfae35ce", "score": "0.738816", "text": "def all; end", "title": "" }, { "docid": "f32be3fd3750b1ba1ed77cf9dfae35ce", "score": "0.738816", "text": "def all; end", "title": "" }, { "docid": "f32be3fd3750b1ba1ed77cf9dfae35ce", "score": "0.738816", "text": "def all; end", "title": "" }, { "docid": "f32be3fd3750b1ba1ed77cf9dfae35ce", "score": "0.738816", "text": "def all; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.73800606", "text": "def operations; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.73800606", "text": "def operations; end", "title": "" }, { "docid": "a29ccf5104a36e90daf739a9e5586ddf", "score": "0.7351245", "text": "def invoke_all; end", "title": "" }, { "docid": "b22ea521ce6dc3254e1f74daf0331724", "score": "0.73252845", "text": "def method\n end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.7262737", "text": "def method; end", "title": "" }, { "docid": "0b278cbf6d4a21a0f7908a7b1fe4c7bd", "score": "0.7096772", "text": "def methds\n []\n end", "title": "" }, { "docid": "ae6ae7b9991fb7bd204dbdc750ebcd1b", "score": "0.7090716", "text": "def method() end", "title": "" }, { "docid": "20d309fac0260c3a410b0ebf06462ff3", "score": "0.70835173", "text": "def visit_methods; end", "title": "" }, { "docid": "f8935bc68578151eef49d2d2fbd8205b", "score": "0.7056437", "text": "def runnable_methods; end", "title": "" }, { "docid": "78715c96fa1cf2097657613c494e2cc6", "score": "0.6978673", "text": "def internal_methods; end", "title": "" }, { "docid": "13cfbe50a73176f08b681f3684afe561", "score": "0.6968859", "text": "def apis; end", "title": "" }, { "docid": "13cfbe50a73176f08b681f3684afe561", "score": "0.6968859", "text": "def apis; end", "title": "" }, { "docid": "7d1b941f9729058fc82edf521f1d813d", "score": "0.6962684", "text": "def all_methods_for(mod); end", "title": "" }, { "docid": "7d1b941f9729058fc82edf521f1d813d", "score": "0.6962684", "text": "def all_methods_for(mod); end", "title": "" }, { "docid": "a1d5aa1e24980d17efed573cc96a01ec", "score": "0.6930665", "text": "def all_relevant_methods_for(mod); end", "title": "" }, { "docid": "a1d5aa1e24980d17efed573cc96a01ec", "score": "0.6930665", "text": "def all_relevant_methods_for(mod); end", "title": "" }, { "docid": "a24acece68194d6305babf181fb8d8b7", "score": "0.6890318", "text": "def all\n \n end", "title": "" }, { "docid": "99d54197ed16886058ae6e084e0da6f4", "score": "0.68469834", "text": "def all\n end", "title": "" }, { "docid": "71527b00e608a2b28284f20807675dbd", "score": "0.6836199", "text": "def all\n raise \"not implemented!\"\n end", "title": "" }, { "docid": "0449f06efe2f54a94f7b470693f24173", "score": "0.6800271", "text": "def methods()\n keys + super()\n end", "title": "" }, { "docid": "b46a0ff5df6a95a3c191d9456a2298ad", "score": "0.6783164", "text": "def methods\n \n methods = {\"initialize\" => \"\", \"methods\" => \"\", \"isBeer\" => \"\", \"isCider\" => \"\", \"isHighAlcohol\" => \"\", \"setPriceWithNtb\" => \"\", \"setPiceWithSellsheet\" => \"\", \"setPriceWithWholesale\" => \"\", \"getNtb\" => \"\", \"getSellsheet\" => \"\", \"getWholesale\" => \"\"}\n \n end", "title": "" }, { "docid": "3af582472321032d67aa318d26fb31fe", "score": "0.67676836", "text": "def list_methods; MethodMission.all_methods; end", "title": "" }, { "docid": "3af582472321032d67aa318d26fb31fe", "score": "0.67676836", "text": "def list_methods; MethodMission.all_methods; end", "title": "" }, { "docid": "35fa18400c637b8ad93179430fcbffd1", "score": "0.67539454", "text": "def all\n \n end", "title": "" }, { "docid": "891a8adca23ec35c24beaa04b31c752e", "score": "0.67450875", "text": "def available_methods; end", "title": "" }, { "docid": "28e230f1bd5c2e2975b6248748fd9c33", "score": "0.6690275", "text": "def regular_method() end", "title": "" }, { "docid": "4804a56e6e9c6ddebfab799fb054efa8", "score": "0.66751724", "text": "def invocations; end", "title": "" }, { "docid": "1822cfc30d9534591bcf24fd97a2644f", "score": "0.66578454", "text": "def method4\n\t\t#...\n\tend", "title": "" }, { "docid": "3c9fe7816cbcdddf1ce5060e94c1d5b8", "score": "0.66516966", "text": "def dispatch; end", "title": "" }, { "docid": "3c9fe7816cbcdddf1ce5060e94c1d5b8", "score": "0.66516966", "text": "def dispatch; end", "title": "" }, { "docid": "c26cb1d2b8333e320191d5aefb038948", "score": "0.664752", "text": "def complete_method_list\n Method.all_methods\n end", "title": "" }, { "docid": "63988ce4a13e0328df9fb84f6c25350c", "score": "0.664664", "text": "def all_methods; [:get, :head, :post, :put, :delete]; end", "title": "" }, { "docid": "36ca5d0d78a7838e98b6fdaaf962c9a8", "score": "0.6612109", "text": "def _callable_methods\n super - preset_methods\n end", "title": "" }, { "docid": "342a305017c5452cbc1f03b556e308d3", "score": "0.66118306", "text": "def initialize_methods\n end", "title": "" }, { "docid": "342a305017c5452cbc1f03b556e308d3", "score": "0.66118306", "text": "def initialize_methods\n end", "title": "" }, { "docid": "df61260c7bfa147f63525b18823b8d81", "score": "0.6608618", "text": "def methods\n super | rpc_methods\n end", "title": "" }, { "docid": "dbc4581d32603fc824a0ce101a7341dd", "score": "0.66032577", "text": "def everything\n raise NoMethodError\n end", "title": "" }, { "docid": "dbc4581d32603fc824a0ce101a7341dd", "score": "0.66032577", "text": "def everything\n raise NoMethodError\n end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.6602523", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.6602523", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.6602523", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.6602523", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.6602523", "text": "def implementation; end", "title": "" }, { "docid": "251118fd3ea6d65c52e25fb81999b7e9", "score": "0.6556653", "text": "def complete_method_list\n HtmlMethod.all_methods\n end", "title": "" }, { "docid": "08a81dede954920b795367591976539b", "score": "0.65492356", "text": "def actions\n public_methods(false).map(&:to_s) - ['call']\n end", "title": "" }, { "docid": "f8821a20eed2695bb6227999318be414", "score": "0.6549129", "text": "def get_all_information\n end", "title": "" }, { "docid": "318a00b009b08fd5fc57e70ebe8b22c7", "score": "0.654268", "text": "def me1thod\r\nend", "title": "" }, { "docid": "a531ea0ab754b28ff2fe083f467522bc", "score": "0.6528051", "text": "def each_commands_methods\n Checker.documented_methods =\n Checker.commands.select {|i| raw_methods.include?(i)}\n Checker.undocumented_methods = Checker.commands - Checker.raw_methods\n Checker.undocumented_methods.delete(:method_missing)\n Checker.orphans =\n Checker.raw_methods - Checker.documented_methods - Checker.undocumented_methods\n end", "title": "" }, { "docid": "c3285b979f713395f60cf13edce8a310", "score": "0.6522663", "text": "def methodmissing; end", "title": "" }, { "docid": "a344215c3161402d928d5c07ee1e0b22", "score": "0.6496771", "text": "def core; end", "title": "" }, { "docid": "6a7f19887a9fbf7b6d3d7e6a088be16b", "score": "0.6490932", "text": "def all\n # TBD\n end", "title": "" }, { "docid": "bc526fc69711984891e703a69534d725", "score": "0.6486977", "text": "def core\r\n end", "title": "" }, { "docid": "7c6a19df4c2cf246e9bf0383cf7c0d83", "score": "0.6480644", "text": "def all_methods_for(mod)\n Pry::Method.all_from_obj(mod, false) + Pry::Method.all_from_class(mod, false)\n end", "title": "" }, { "docid": "f6c6d6f9ab214c11fadcae90989ad334", "score": "0.64805484", "text": "def make_methods\n\t\n\t# the accessible soap objects\n\tsoapobjects = %w{Contact ContactGroup Bookmark BookmarkFolder Note CalendarCategory Event Holiday Task}\n\tmethods = %w{add search get modify sync delete }\n\t\n\t\tsoapobjects.each do |soapobject|\n\t\t\tsymbol=soapobject.underscore.to_sym # Contact -> :contact\n\t\t\t\n\t\t\taction={} # action = generated method names in a hash e.g. {:add=>\"addContact\", :get=>\"getContact\"} for this soapobject\n\t\t\tmethods.each do |newmethod|\n\t\t\t\taction[newmethod.to_sym]=newmethod+soapobject\n\t\t\t\taction[newmethod.to_sym]=\"get\" << soapobject << \"Sync\" if newmethod==\"sync\"\n\t\t\tend\n\t\t\n\t\t\tselfclass.send(:define_method, action[:add]) do |details| \n\t\t\t\tdetailsApicall(action[:add],{symbol => details},[:id]) if fields?(details, NEEDS[symbol]) \n\t\t\tend\n\t\t\n\t\t\tselfclass.send(:define_method, action[:modify]) do |details| \n\t\t\t\tdetailsApicall(action[:modify],{symbol => details},[:ok]) if fields?(details, [NEEDS[symbol], :id].flatten!) \n\t\t\tend\n\t\t\n\t\t\tselfclass.send(:define_method, action[:search]) do |params| \n\t\t\t\tsearchCall(action[:search],params,[:return, symbol]) if fields?(params, [:search]) \n\t\t\tend\n\t\t\n\t\t\tselfclass.send(:define_method, action[:sync]) do |datetime| \n\t\t\t\tgetSyncApiCall(action[:sync],datetime,[:return, symbol]) \n\t\t\tend\n\n\t\t\tselfclass.send(:define_method, action[:get]) do |id| \n\t\t\t\tidApicall(action[:get],id,[:return, symbol]) \n\t\t\tend\n\n\t\t\tselfclass.send(:define_method, action[:delete]) do |id|\n\t\t\t\tidApicall(action[:delete],id,[:ok]) \n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "c4cbe48255a7b6122f562814bbf436be", "score": "0.64710337", "text": "def aruba_methods\n ms = (Aruba::Api.instance_methods - Module.instance_methods)\n .each_with_object([]) { |e, a| a << format(\"* %s\", e) }\n .sort\n\n puts \"Available Methods:\\n#{ms.join(\"\\n\")}\"\n\n nil\n end", "title": "" }, { "docid": "e133261d7e02875440c54ca2115fd0fa", "score": "0.646929", "text": "def all\n raise NotImplementedError\n end", "title": "" }, { "docid": "ee0c6a8ff7b129e33d2079fd096eb0ab", "score": "0.64623815", "text": "def all_commands; end", "title": "" }, { "docid": "67081eb3c98dc9ab87bd978f73a10e81", "score": "0.64234096", "text": "def advanced; end", "title": "" }, { "docid": "67081eb3c98dc9ab87bd978f73a10e81", "score": "0.64234096", "text": "def advanced; end", "title": "" }, { "docid": "a9dd648a5d0d2e7d56223e7c753f5e2e", "score": "0.64128184", "text": "def telegraphical()\n end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.64058405", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.64058405", "text": "def helpers; end", "title": "" } ]
a2096018a4f6f3d0ab663a8a5dcfb25a
PUT /archivos/1 PUT /archivos/1.json
[ { "docid": "3156eb9e85b86c13e4a8d985508849d7", "score": "0.654414", "text": "def update\n @archivo = Archivo.find(params[:id])\n\n respond_to do |format|\n if @archivo.update_attributes(params[:archivo])\n format.html { redirect_to @archivo, :notice => 'Archivo was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @archivo.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "8dfc66e3284735bb097b8723333f3daf", "score": "0.68434274", "text": "def update\n\n params[:archivo][:url] = \"#{Rails.root}/attachments/archivos/\"+params[:archivo][:url]\n\n @archivo = Archivo.find(params[:id])\n\n respond_to do |format|\n if @archivo.update_attributes(params[:archivo])\n format.html { redirect_to archivos_path+\"##{@archivo.idioma_id}\", flash: {mensaje: 'Archivo actualizado con éxito.'} }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @archivo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "47dc157922569f2e376ed77a21ae1c7a", "score": "0.6503294", "text": "def update\n @archivo = Archivo.find(params[:id])\n\n respond_to do |format|\n if @archivo.update_attributes(params[:archivo])\n format.html { redirect_to @archivo, notice: 'Archivo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @archivo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b88e8534e926c1447e1f752c95d2a77", "score": "0.64082265", "text": "def rest_put(path, options = {}, api_ver = @api_version)\n rest_api(:put, path, options, api_ver)\n end", "title": "" }, { "docid": "6b88e8534e926c1447e1f752c95d2a77", "score": "0.64082265", "text": "def rest_put(path, options = {}, api_ver = @api_version)\n rest_api(:put, path, options, api_ver)\n end", "title": "" }, { "docid": "882c8317370987b86425c0adbf5bfe8c", "score": "0.6342018", "text": "def update_aos_version(args = {}) \n put(\"/aosversions.json/#{args[:aosVersionId]}\", args)\nend", "title": "" }, { "docid": "3551a93e8829fecafd58bf691a860eeb", "score": "0.6340461", "text": "def update_object(path, id, info)\n json_parse_reply(*json_put(@target, \"#{path}/#{URI.encode(id)}\", info,\n @auth_header, if_match: info[:meta][:version]))\n end", "title": "" }, { "docid": "e3cc7c93376be3d3b1514d66fbfdb67f", "score": "0.6338617", "text": "def update\n respond_to do |format|\n if @archivo.update(archivo_params)\n format.html { redirect_to @archivo, notice: 'Archivo was successfully updated.' }\n format.json { render :show, status: :ok, location: @archivo }\n else\n format.html { render :edit }\n format.json { render json: @archivo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fbd7c46b15ae2792fd842ba0d764b7d0", "score": "0.63345444", "text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end", "title": "" }, { "docid": "07918d5a67562e424f50e841ebcd6a84", "score": "0.63282555", "text": "def put(path , params = {})\n request(:put , path , params)\n end", "title": "" }, { "docid": "e283bc2c564258897ab0627a4907df6b", "score": "0.6321122", "text": "def update\n @voto = Voto.find(params[:id])\n\n if @voto.update(voto_params)\n head :no_content\n else\n render json: @voto.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "c867af4ca2c09f9990cd96d519ccba2d", "score": "0.6308265", "text": "def update\n @os = Os.find(params[:id])\n\n respond_to do |format|\n if @os.update_attributes(params[:os])\n format.html { redirect_to @os, notice: 'Ordem de Serviço atualizada com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @os.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "56e652cf209d037828381ef5e14e6a80", "score": "0.6290154", "text": "def update\n respond_to do |format|\n if @archivo.update(archivo_params)\n format.html { redirect_to @concurso, notice: 'Archivo was successfully updated.' }\n format.json { render :show, status: :ok, location: @archivo }\n else\n format.html { render :edit }\n format.json { render json: @archivo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bb9fcf47077125bc0c41b125d6aad8e1", "score": "0.6270358", "text": "def update\n respond_to do |format|\n if @objeto.update(archivo_params)\n set_redireccion\n format.html { redirect_to @redireccion, notice: 'Archivo was successfully updated.' }\n format.json { render :show, status: :ok, location: @objeto }\n else\n format.html { render :edit }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "73c92470db5924c0735367cead5ebef8", "score": "0.62633526", "text": "def update\n @foto = Fotosresposta.find(params[:id])\n\n respond_to do |format|\n if @foto.update_attributes(params[:fotosresposta])\n format.html { redirect_to @foto, notice: 'Respostas actualizadas com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @foto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b2d5fc83a907f25e5176864fa6beb3d0", "score": "0.6226575", "text": "def put_rest(path, json) \n run_request(:PUT, create_url(path), json)\n end", "title": "" }, { "docid": "5adfab8b284d5fbe4bcdc307687d2aa3", "score": "0.6204908", "text": "def update\n @opcion = Opcion.find(params[:id])\n\n if @opcion.update(params[:opcion])\n head :no_content\n else\n render json: @opcion.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ae4d0aa8335fe571a4fcc90ded621164", "score": "0.61660135", "text": "def do_update_Json(data, *rest)\n obj, res = REST.put(\"#{self.class.path}/#{id}\",data)\n maybe_json_die(obj,res)\n @blob = obj\n self\n end", "title": "" }, { "docid": "ae4d0aa8335fe571a4fcc90ded621164", "score": "0.61660135", "text": "def do_update_Json(data, *rest)\n obj, res = REST.put(\"#{self.class.path}/#{id}\",data)\n maybe_json_die(obj,res)\n @blob = obj\n self\n end", "title": "" }, { "docid": "5c174b4c4b851bc2b501085b2bda212d", "score": "0.616011", "text": "def update\n respond_to do |format|\n if @arquivo.update(arquivo_params)\n format.html { redirect_to @arquivo, notice: 'Arquivo was successfully updated.' }\n format.json { render :show, status: :ok, location: @arquivo }\n else\n format.html { render :edit }\n format.json { render json: @arquivo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11121476217f458129b11f6447608aee", "score": "0.6153725", "text": "def put(path, params: {}, headers: {})\n request_json :put, path, params, headers\n end", "title": "" }, { "docid": "8e18db431964c254de53caa41795b702", "score": "0.6142969", "text": "def put *args\n make_request :put, *args\n end", "title": "" }, { "docid": "20d4b250d18e97d55879a70728d0e5be", "score": "0.61277205", "text": "def api_put(path, data = {})\n api_request(:put, path, :data => data).parsed\n end", "title": "" }, { "docid": "43fdecba17efc7932ab9d9d4f0786094", "score": "0.6123419", "text": "def put(path, data = nil, model = 'raw')\n request(:put, path, data, model)\n end", "title": "" }, { "docid": "1dc5161b34749c0f0f4f2528af5ae0a8", "score": "0.6110391", "text": "def update\n respond_to do |format|\n if @foto.update(foto_params)\n format.html { redirect_to @foto, notice: 'Foto was successfully updated.' }\n format.json { head :no_content }\n else\n @agendas = Agenda.passadas.recentes\n format.html { render action: 'edit' }\n format.json { render json: @foto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2c2e953ae73a4d41c60f4f6363805c48", "score": "0.60911345", "text": "def put(path, json, headers = {}, options = {})\n request(:PUT, path, headers, options, json)\n end", "title": "" }, { "docid": "4ee5e29ef62a6e95122a8f5d94e1d50d", "score": "0.60897285", "text": "def put(path, params = {})\n request :put, path, params\n end", "title": "" }, { "docid": "f4de9a47c3dc7c025d28b7e84b43915a", "score": "0.6070759", "text": "def put(path, json, headers = {})\n request(:PUT, path, headers, json)\n end", "title": "" }, { "docid": "26038fe278a3a8cb38d0cebce2ba8444", "score": "0.60677594", "text": "def update\n @solicitudrecurso = Solicitudrecurso.find(params[:id])\n \n\n respond_to do |format|\n \n if @solicitudrecurso.update_attributes(:motivos => params[:motivos])\n \n getIndexView\n format.html { render :action => \"index\" }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @solicitudrecurso.errors, :status => :unprocessable_entity }\n end\n \n end\n end", "title": "" }, { "docid": "def83a67e5219aae602ed8fb7a749247", "score": "0.6066436", "text": "def update\n @apodo = Apodo.find(params[:id])\n imagen = params[:apodo][:imagen_url]\n\n if imagen\n params[:apodo][:imagen_url] = FtpUpload.upload_apodo imagen\n end\n\n respond_to do |format|\n if @apodo.update_attributes(params[:apodo])\n format.html { redirect_to \"/apodos/#{@apodo.id}/edit\", notice: 'El apodo se actualizó correctamente.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @apodo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6eccf0cb1ebc7404a9ae8d73fad0c91a", "score": "0.60641015", "text": "def put(*args)\n request :put, *args\n end", "title": "" }, { "docid": "36374c044ade18ad16510bd945afebf7", "score": "0.603622", "text": "def update\n @archivo = Archivo.find(params[:id])\n\n respond_to do |format|\n if @archivo.update_attributes(params[:archivo])\n format.html { redirect_to(@archivo, :notice => 'Archivo actualizado con exito.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @archivo.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "545dadbe32aa3d9d0edf1d22293783fc", "score": "0.60359716", "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": "ea416b077fa0aa7e84ec3fe2ef9c3772", "score": "0.6028171", "text": "def put\n request_method('PUT')\n end", "title": "" }, { "docid": "713161fe04801b44f5b9cdb91a95fe89", "score": "0.6026323", "text": "def test_put\n request = Http::Request.new('PUT', '/file2', {}, 'hello')\n\n response = self.request(request)\n\n assert_equal(201, response.status, \"Incorrect status code received. Full response body: #{response.body_as_string}\")\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file2').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end", "title": "" }, { "docid": "192152c8d3aea9a2095526a4bbfed6ef", "score": "0.60228246", "text": "def put_json(path, obj)\n put path, params: obj.to_json, headers: {'CONTENT_TYPE' => 'application/json'}\n end", "title": "" }, { "docid": "c0b998e143ad2c37de30c76689c22365", "score": "0.60198617", "text": "def put(path, body, options = {})\n options[:body] = body\n json_request('PUT', path, options)\n end", "title": "" }, { "docid": "f09b3d8e1c4b2637086a5570d36ac1b1", "score": "0.6018593", "text": "def put(path, body, options = {})\r\n options[:body] = body\r\n json_request('PUT', path, options)\r\n end", "title": "" }, { "docid": "07125f16aad3873222e039b85b0f4e84", "score": "0.601121", "text": "def put_rest(path, json, headers={})\n run_request(:PUT, create_url(path), headers, json)\n end", "title": "" }, { "docid": "516293bd7a60059a7be7a5ac1a725e64", "score": "0.6008013", "text": "def put(path, data)\n request(:put, path, JSON.dump(data))\n end", "title": "" }, { "docid": "e0e35bb47ec0f1e27d091980aa2db21b", "score": "0.6003656", "text": "def put(path, params = {})\n request(:put, path, params)\n end", "title": "" }, { "docid": "e0e35bb47ec0f1e27d091980aa2db21b", "score": "0.6003656", "text": "def put(path, params = {})\n request(:put, path, params)\n end", "title": "" }, { "docid": "e0e35bb47ec0f1e27d091980aa2db21b", "score": "0.6003656", "text": "def put(path, params = {})\n request(:put, path, params)\n end", "title": "" }, { "docid": "e0e35bb47ec0f1e27d091980aa2db21b", "score": "0.6003656", "text": "def put(path, params = {})\n request(:put, path, params)\n end", "title": "" }, { "docid": "e0e35bb47ec0f1e27d091980aa2db21b", "score": "0.6003656", "text": "def put(path, params = {})\n request(:put, path, params)\n end", "title": "" }, { "docid": "17e5a0d6aea0476a9de9b142494d7b1e", "score": "0.600115", "text": "def update \n @versioned_file = VersionedFile.find(params[:id])\n puts @versioned_file.id\n if @versioned_file.update(versioned_file_params)\n head :no_content\n else\n render json: @versioned_file.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "8030b6a3a618d66537d0f1f7e1a4175e", "score": "0.598545", "text": "def update\n @oficio = Oficio.find(params[:id])\n\n respond_to do |format|\n if @oficio.update_attributes(params[:oficio])\n format.html { redirect_to @oficio, notice: 'Oficio was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @oficio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aa0b87a16ede7353758305dbbaf57c22", "score": "0.5983822", "text": "def put(*a) route 'PUT', *a end", "title": "" }, { "docid": "ca46e3bb83718e90647061d0965168de", "score": "0.5966104", "text": "def put(path, body = nil, ctype = 'application/json')\n make_call(mk_conn(path, 'Content-Type': ctype,\n Accept: 'application/json'),\n :put, nil, body.to_json)\n end", "title": "" }, { "docid": "46c427a6236a62b6611e629963f4204f", "score": "0.5964005", "text": "def put(path, params = {}, options = {})\n request(:put, path, params, options)\n end", "title": "" }, { "docid": "dd32e4f04bf0a2a330b76b490b18b51b", "score": "0.595985", "text": "def update\n respond_to do |format|\n if @tifo.update(tifo_params)\n format.html { redirect_to tifo_photos_path(tifo_id: @tifo.token), notice: 'Tifo was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @tifo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "90075d057a10aaf0f45bf17592724d5d", "score": "0.5957337", "text": "def update\n respond_to do |format|\n if @nome_arquivo.update(nome_arquivo_params)\n format.html { redirect_to @nome_arquivo, notice: 'Renomear was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @nome_arquivo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7675b4e16e960e9d7ba03eab3cf7bf09", "score": "0.5954462", "text": "def update\n respond_to do |format|\n if @archivofotografico.update(archivofotografico_params)\n format.html { redirect_to @archivofotografico, notice: 'Archivofotografico was successfully updated.' }\n format.json { render :show, status: :ok, location: @archivofotografico }\n else\n format.html { render :edit }\n format.json { render json: @archivofotografico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "03f2da2ebf5dd2691a8c2e87c498da5a", "score": "0.59508675", "text": "def put(path, params={})\n request(:put, path, params)\n end", "title": "" }, { "docid": "03f2da2ebf5dd2691a8c2e87c498da5a", "score": "0.59508675", "text": "def put(path, params={})\n request(:put, path, params)\n end", "title": "" }, { "docid": "03f2da2ebf5dd2691a8c2e87c498da5a", "score": "0.59508675", "text": "def put(path, params={})\n request(:put, path, params)\n end", "title": "" }, { "docid": "03f2da2ebf5dd2691a8c2e87c498da5a", "score": "0.59508675", "text": "def put(path, params={})\n request(:put, path, params)\n end", "title": "" }, { "docid": "03f2da2ebf5dd2691a8c2e87c498da5a", "score": "0.59508675", "text": "def put(path, params={})\n request(:put, path, params)\n end", "title": "" }, { "docid": "03f2da2ebf5dd2691a8c2e87c498da5a", "score": "0.59508675", "text": "def put(path, params={})\n request(:put, path, params)\n end", "title": "" }, { "docid": "03f2da2ebf5dd2691a8c2e87c498da5a", "score": "0.59508675", "text": "def put(path, params={})\n request(:put, path, params)\n end", "title": "" }, { "docid": "03f2da2ebf5dd2691a8c2e87c498da5a", "score": "0.59508675", "text": "def put(path, params={})\n request(:put, path, params)\n end", "title": "" }, { "docid": "03f2da2ebf5dd2691a8c2e87c498da5a", "score": "0.59508675", "text": "def put(path, params={})\n request(:put, path, params)\n end", "title": "" }, { "docid": "49ce8d6db66fe253a437068409de4636", "score": "0.5949892", "text": "def update\n respond_to do |format|\n if @archivo.update(archivo_params)\n format.html { redirect_to archivos_url(cod_proyecto:@archivo.cod_proyecto,cod_departamento:@archivo.cod_departamento), notice: 'Archivo was successfully updated.' }\n format.json { render :show, status: :ok, location: @archivo }\n else\n format.html { render :edit }\n format.json { render json: @archivo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad9c1094ad2654e9a48348f00bdd77fc", "score": "0.5941915", "text": "def put(path:, body: {})\n request(method: :put, path: path, body: body)\n end", "title": "" }, { "docid": "bb96bab09259313709de4d5029ee2765", "score": "0.59388447", "text": "def put(path, opts = {})\n request(:put, path, opts)\n end", "title": "" }, { "docid": "eeb208a6ebc42687e9a0f2e182c93d87", "score": "0.5931993", "text": "def update\n @cota = Cota.find(params[:id])\n\n savePictures\n\n respond_to do |format|\n if @cota.update_attributes(params[:cota])\n format.html { redirect_to @cota, notice: 'Cota was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cota.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e47d0244720b1c507aa856e5efed8549", "score": "0.59316945", "text": "def update\n respond_to do |format|\n if @atractivo.update(atractivo_params)\n format.html { redirect_to @atractivo, notice: 'Atractivo was successfully updated.' }\n format.json { render :show, status: :ok, location: @atractivo }\n else\n format.html { render :edit }\n format.json { render json: @atractivo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af9aedd4f428a2c26c3fd57798526020", "score": "0.592951", "text": "def put(path, data = {}, header = {})\n _send(json_request(Net::HTTP::Patch, path, data, header))\n end", "title": "" }, { "docid": "6109548c3281832ecabf0564bcc67946", "score": "0.59289336", "text": "def put(path, options={}, format=format)\n respond request(:put, path, options, format)\n end", "title": "" }, { "docid": "57312ae596e8141d6f9c061b7a0d6341", "score": "0.5926092", "text": "def update\n @producto = Producto.find(params[:id])\n\n if @producto.update(producto_params)\n head :no_content\n else\n render json: @producto.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "79121d7adfeb2d07385a70660e2cb796", "score": "0.59228885", "text": "def update\n respond_to do |format|\n if @topfoto.update(topfoto_params)\n format.html { redirect_to @topfoto, notice: 'Post atualizado' }\n format.json { render :show, status: :ok, location: @topfoto }\n else\n format.html { render :edit }\n format.json { render json: @topfoto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "afecc7845542fce06842e523ac107fce", "score": "0.59209585", "text": "def put(path, options = {})\n request(:put, path, options)\n end", "title": "" }, { "docid": "67c9ab4237b70c6d7f1a4a457785ec83", "score": "0.5917448", "text": "def put(path, opts = {}, &app); add_with_request_method(path, :put, opts, &app); end", "title": "" }, { "docid": "ef43f9fe9873b988901c614e625c03a5", "score": "0.59168893", "text": "def update\n @prefeitura = Prefeitura.find(params[:id])\n unless params[:prefeitura][:logo].nil?\n uploaded_io = params[:prefeitura][:logo]\n if %w(image/png image/jpeg image/jpg image/gif).include?(uploaded_io.content_type.to_s)\n # Salva na prefeitura apenas o nome do arquivo, a imagem vai estar em\n # public/assets/\n params[:prefeitura][:logo] = uploaded_io.original_filename\n File.open(Rails.root.join('public','assets', uploaded_io.original_filename),\n 'wb+') do |file|\n file.write(uploaded_io.read)\n file.close\n end\n else\n # Se o arquivo do upload não for uma imagem salva a imagem padrão\n # \"void.png\" na prefeitura\n params[:prefeitura][:logo] = \"void.png\"\n end\n end\n respond_to do |format|\n if @prefeitura.update_attributes(params[:prefeitura])\n format.html { redirect_to prefeituras_url, notice: \"Prefeitura: #{@prefeitura.nome}, foi atualizada com sucesso.\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @prefeitura.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5dc469fa85ae2ae77f2a3d41b06028ed", "score": "0.59106004", "text": "def put(path, body = {}, options = {})\n request(:put, path, options, body)\n end", "title": "" }, { "docid": "476c34f1955d8e27ff8ba558ce2abe37", "score": "0.5909863", "text": "def test_put_no_parent\n request = Http::Request.new(\n 'PUT',\n '/file1/file2',\n {},\n 'hello'\n )\n\n response = self.request(request)\n assert_equal(409, response.status)\n end", "title": "" }, { "docid": "587dc9f0563ef0779bc576eb3ad41199", "score": "0.59063566", "text": "def update\n @inventario = Inventario.find(params[:id])\n\n respond_to do |format|\n if @inventario.update_attributes(params[:inventario])\n format.html { redirect_to @inventario, notice: 'Inventario was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @inventario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c7d3cd0f218c42e01dbd0246ab7b00c9", "score": "0.5899618", "text": "def put(path, params={}); make_request(:put, host, port, path, params); end", "title": "" }, { "docid": "ef27cbbed9e88abf0aa71432ad587dd5", "score": "0.5894232", "text": "def update\n respond_to do |format|\n if @imagen.update(imagen_params)\n format.html { redirect_to @imagen, notice: 'Evento was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @imagen.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3c57675463bd3d8657476163302a7246", "score": "0.5886912", "text": "def put(path, options={}, format=format)\n request(:put, path, options, format)\n end", "title": "" }, { "docid": "a6174ef5c57f0350802d9d10f71b4a2e", "score": "0.5884402", "text": "def test_finder_put_success\n request = Http::Request.new(\n 'PUT',\n '/file2',\n { 'X-Expected-Entity-Length' => '5' },\n 'hello'\n )\n response = self.request(request)\n\n assert_equal(201, response.status)\n\n assert_equal(\n 'hello',\n @server.tree.node_for_path('file2').get\n )\n\n assert_equal(\n {\n 'X-Sabre-Version' => [Version::VERSION],\n 'Content-Length' => ['0'],\n 'ETag' => [\"\\\"#{Digest::MD5.hexdigest('hello')}\\\"\"]\n },\n response.headers\n )\n end", "title": "" }, { "docid": "eb3b47392d079600695cd66723550ee1", "score": "0.588144", "text": "def update\n @imovel = Imovel.find(params[:id])\n \n# name = @imovel.referencia + \" - principal.jpeg\"\n # directory = \"app/assets/images\"\n # path = File.join(directory, name)\n # File.open(path, \"wb\") { |f| f.write(params[:principal].read) }\n\n\n respond_to do |format|\n if @imovel.update_attributes(params[:imovel])\n format.html { redirect_to @imovel, notice: 'Imovel was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @imovel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "473828cea8dd9de5a6079a640b4703f7", "score": "0.5876535", "text": "def set_archivo\n @objeto = Archivo.find(params[:id])\n end", "title": "" }, { "docid": "d116df6f59799410103509b441125edd", "score": "0.5871514", "text": "def update\n respond_to do |format|\n if @intranet_arquivos_tipo.update(intranet_arquivos_tipo_params)\n format.html { redirect_to @intranet_arquivos_tipo, notice: \"Arquivos tipo was successfully updated.\" }\n format.json { render :show, status: :ok, location: @intranet_arquivos_tipo }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @intranet_arquivos_tipo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a7ac977bc74a758de027bffc68ef38c", "score": "0.58619314", "text": "def put(path, options={})\n request(:put, path, options)\n end", "title": "" }, { "docid": "8a7ac977bc74a758de027bffc68ef38c", "score": "0.58619314", "text": "def put(path, options={})\n request(:put, path, options)\n end", "title": "" }, { "docid": "45ba9b27a0eee1dc2b319c60dc71f938", "score": "0.586109", "text": "def update\n respond_to do |format|\n if @daw_archivo.update(daw_archivo_params)\n format.html { redirect_to @daw_archivo, notice: 'Daw archivo was successfully updated.' }\n format.json { render :show, status: :ok, location: @daw_archivo }\n else\n format.html { render :edit }\n format.json { render json: @daw_archivo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "13e1249f51fe211faa3122d497dd782a", "score": "0.585698", "text": "def put(body: nil, path: nil, headers: nil, id: nil)\n post(body: body, path: path, headers: headers, http_method: :put, id: id)\n end", "title": "" }, { "docid": "e8ffb008aad98ad63d835a4c4d547c50", "score": "0.5856121", "text": "def put(path, data)\r\n fetch(:path => path, :method => 'PUT', :data => data)\r\n end", "title": "" }, { "docid": "6cbbddc73e7fbb152fae713f712777b3", "score": "0.5849954", "text": "def update\n update_resource(@tomato)\n end", "title": "" }, { "docid": "db67514f0b1a43ec77213d4a1b60ad58", "score": "0.5845257", "text": "def update\n @foto = Foto.find(params[:id])\n\n respond_to do |format|\n if @foto.update_attributes(params[:foto])\n format.html {\n render :json => [@foto.to_jq_upload].to_json,\n :content_type => 'text/html',\n :layout => false\n }\n format.json { render json: {files: [@foto.to_jq_upload]}, status: :created, location: [@gallery, @foto] }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @foto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa77ea666a06a484c9e048b748d79d84", "score": "0.5843365", "text": "def put(path, params={}, options={})\n request(:put, path, params, options)\n end", "title": "" }, { "docid": "fa77ea666a06a484c9e048b748d79d84", "score": "0.5843365", "text": "def put(path, params={}, options={})\n request(:put, path, params, options)\n end", "title": "" }, { "docid": "fa77ea666a06a484c9e048b748d79d84", "score": "0.5843365", "text": "def put(path, params={}, options={})\n request(:put, path, params, options)\n end", "title": "" }, { "docid": "9939d104cc69ee0603b44e21eac25e30", "score": "0.5842282", "text": "def update\n @servico = Servico.find(params[:id])\n\n respond_to do |format|\n if @servico.update_attributes(params[:servico])\n format.html { redirect_to @servico, notice: 'Servico foi atualiazado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "140c1eb37482027ae9747c32cb11b6aa", "score": "0.5841316", "text": "def put(path, json, headers={})\n api_request(:PUT, create_url(path), headers, json)\n end", "title": "" }, { "docid": "7d4155ea1d5ec29dfeec7f8f3dfe64e7", "score": "0.5840584", "text": "def put(path, file, content_type=nil)\n path = canonicalized_resource(path)\n body = file.respond_to?(:read) ? file : file.to_s \n date = Time.now.rfc2822\n message = join('PUT', body, content_type, date, nil, path)\n headers = headers(date, message, content_type)\n\n if content_length = content_length(file)\n headers.merge!({'Content-Length' => content_length})\n end\n\n request = Net::HTTP::Put.new(path, headers)\n\n if file.respond_to?(:read)\n request.body_stream = file\n else\n request.body = body\n end\n\n begin\n response = http.start { |http| http.request(request) }\n Presss::HTTP::Response.new(\n response.code,\n response.instance_variable_get('@header'),\n response.body\n )\n rescue EOFError => error\n raise Presss::HTTP::RequestError, error.message\n end\n end", "title": "" }, { "docid": "766986887b72dcdba5ac45cc797979a3", "score": "0.58389604", "text": "def put(path, data=nil, params=nil)\n request('PUT', path, params, data)\n end", "title": "" }, { "docid": "1672475d7ba8467055df2694ed66ed78", "score": "0.58314604", "text": "def update\n render json: Image.update(params[\"id\"], params[\"image\"])\n end", "title": "" }, { "docid": "0a8f96513394213e5fadf5bbb3aab0c9", "score": "0.5825609", "text": "def put(path, options = {}, config = {})\n request(:put, path, options, config)\n end", "title": "" }, { "docid": "8347d51fd953ab0b206f28328a0bfdaf", "score": "0.5823616", "text": "def update\n @arquivo_documento = Arquivo::Documento.find(params[:id])\n\n respond_to do |format|\n if @arquivo_documento.update_attributes(params[:arquivo_documento])\n format.html { redirect_to(@arquivo_documento, :notice => 'Documento atualizado com sucesso.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @arquivo_documento.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
0ce390a52c08b17d1c82810393473a18
adds filters to this context. this does not register the filters with the main Template object. see Template.register_filter for that
[ { "docid": "d1086f5938c6d9349a3615f9c8ee51d6", "score": "0.5614385", "text": "def add_filters(filters)\n filters = [filters].flatten.compact\n\n filters.each do |f|\n raise ArgumentError, \"Expected module but got: #{f.class}\" unless f.is_a?(Module)\n strainer.extend(f)\n end\n end", "title": "" } ]
[ { "docid": "d5c163c58ae74080e5739b62d25853c2", "score": "0.6609158", "text": "def add_collection_filters\n @template.collection_filters.each do |collection_filter|\n collection_filter.duplicate!(\n assign_collection: @collection,\n )\n end\n end", "title": "" }, { "docid": "0fc1899eb1174723a120d449c0d6d216", "score": "0.65188724", "text": "def addFilter( &block )\n\t\t@filters << block\n\tend", "title": "" }, { "docid": "f6a9f27ff9a5720c2d5eea5748bd75b5", "score": "0.64531934", "text": "def add_filter(tag)\n context.add_filter(tag)\n end", "title": "" }, { "docid": "8b6af6531953bb796eeb058a7fbc2267", "score": "0.64346284", "text": "def register_filter(module_name)\n Liquid::Template.register_filter(module_name)\n end", "title": "" }, { "docid": "8b6af6531953bb796eeb058a7fbc2267", "score": "0.64346284", "text": "def register_filter(module_name)\n Liquid::Template.register_filter(module_name)\n end", "title": "" }, { "docid": "aa64990aba4a77f18552069ebec98706", "score": "0.6425935", "text": "def register_filters(mod)\n @@filters << mod\n end", "title": "" }, { "docid": "f0e05e2d739c6cb891675eeffa143230", "score": "0.64223874", "text": "def pre_render\n self.site.load_post_filters unless self.site.post_filters\n\n if self.site.post_filters and is_filterable?\n self.site.post_filters.each do |filter|\n filter.pre_render(self)\n end\n end\n end", "title": "" }, { "docid": "5e6e0462be077a5520602f85fe96e63c", "score": "0.6414296", "text": "def before_filter(*filters)\n @before_filters += filters\n end", "title": "" }, { "docid": "3e0e5899bbe7729c394f3c7c97ad8cc7", "score": "0.62987274", "text": "def add_type_filters\n content_for(:type_filters) do\n render(partial: \"application/content/type_filters\")\n end\n end", "title": "" }, { "docid": "99893b8212791e72f1bb7c16e416da55", "score": "0.6207443", "text": "def post_render\n if self.site.post_filters and is_filterable?\n self.site.post_filters.each do |filter|\n filter.post_render(self)\n end\n end\n end", "title": "" }, { "docid": "84596219c105786b28cbeadf0891b1cf", "score": "0.6148994", "text": "def before_filters\n @before_filters\n end", "title": "" }, { "docid": "38320d6009166636e85f391b236d5ad0", "score": "0.6046649", "text": "def before_filters\n @before_filters ||= {}\n end", "title": "" }, { "docid": "19f1c5269cb7df5e1c4b1983e8dc5b01", "score": "0.6045376", "text": "def show_filters\n initialize_filter_set_if_needed\n @filter_set.render\n end", "title": "" }, { "docid": "b3468a7f6c1b6a95065392783aef7dcd", "score": "0.60368437", "text": "def post_filters; end", "title": "" }, { "docid": "93d142dc442d068ac426abf30e232bfc", "score": "0.6030241", "text": "def load_post_filters\n self.post_filters = Jekyll::PostFilter.subclasses.select do |c|\n !self.safe || c.safe\n end.map do |c|\n c.new(self.config)\n end\n end", "title": "" }, { "docid": "44f17c8df4b86b13ea96bdc3f7574fa7", "score": "0.60197645", "text": "def filters(&block)\n @filters ||= Roar::FilterSet.new(@controller, @view, &block)\n end", "title": "" }, { "docid": "23da000f6665913db1e85304a95a63da", "score": "0.5996306", "text": "def filters\n filters_enabled? ? filter_lookup : {}\n end", "title": "" }, { "docid": "7fc8c2e624b64f5b3b213a6db591dcb9", "score": "0.59945667", "text": "def data_context_filter_1\r\n\r\n ckie = (RUBY_VERSION =~ /^1.8/) ? Iconv.new('UTF-8//IGNORE', 'latin1').iconv(cookies[:active_filters] || \"\") : (cookies[:active_filters] || \"\").force_encoding(Encoding::ISO_8859_1).encode!(Encoding::UTF_8)\r\n if !ckie.blank?\r\n find_hash = AppLocale.named_scope_active_filter_method(ActiveSupport::JSON.decode(ckie))\r\n conds = find_hash[:conditions]\r\n @joins_fields = find_hash[:joins]\r\n\r\n AppLocale.send(:with_scope, {:find => {:conditions => conds, :joins => (@joins_fields || [])}}) {\r\n yield\r\n }\r\n\r\n else\r\n yield\r\n end\r\n end", "title": "" }, { "docid": "2f4e60f8d7f0717f4672ca3fa53b64ae", "score": "0.5983148", "text": "def data_context_filter_1\r\n if !cookies[:active_filters].blank?\r\n find_hash = RootMaveoc.named_scope_active_filter_method(ActiveSupport::JSON.decode(Iconv.new('UTF-8//IGNORE', 'latin1').iconv(cookies[:active_filters] || \"{}\")))\r\n conds = find_hash[:conditions]\r\n @joins_fields = find_hash[:joins]\r\n\r\n RootMaveoc.send(:with_scope, {:find => {:conditions => conds, :joins => (@joins_fields || [])}}) {\r\n yield\r\n }\r\n\r\n else\r\n yield\r\n end\r\n end", "title": "" }, { "docid": "e9ad727840969597ee693cd707379cc6", "score": "0.59744513", "text": "def filters\n add_owner\n set_language\n\n @filters ||= (\n visibility_filters +\n work_filters +\n creator_filters +\n collection_filters +\n tag_filters +\n range_filters\n ).flatten.compact\n end", "title": "" }, { "docid": "db02b7deded3f2122a7d45b0d2943b82", "score": "0.59660614", "text": "def add_filters(filter)\n return unless filter.is_a?(Module)\n strainer.extend(filter)\n end", "title": "" }, { "docid": "21afd594ac7754b95835e615523188f6", "score": "0.5957786", "text": "def data_context_filter_1\r\n\r\n ckie = (RUBY_VERSION =~ /^1.8/) ? Iconv.new('UTF-8//IGNORE', 'latin1').iconv(cookies[:active_filters] || \"\") : (cookies[:active_filters] || \"\").force_encoding(Encoding::ISO_8859_1).encode!(Encoding::UTF_8)\r\n if !ckie.blank?\r\n find_hash = SystemSetting.named_scope_active_filter_method(ActiveSupport::JSON.decode(ckie))\r\n conds = find_hash[:conditions]\r\n @joins_fields = find_hash[:joins]\r\n\r\n SystemSetting.send(:with_scope, {:find => {:conditions => conds, :joins => (@joins_fields || [])}}) {\r\n yield\r\n }\r\n\r\n else\r\n yield\r\n end\r\n end", "title": "" }, { "docid": "6e248db5c370527c8926c3ca5f0d8316", "score": "0.5957011", "text": "def filter(&block)\n filters = self.filters << yield\n metaclass.send(:define_method, :_filters) do\n filters\n end\n end", "title": "" }, { "docid": "5b0d4d4160a2e9a5a0f16d9b50a46ff0", "score": "0.59552795", "text": "def data_context_filter_1\r\n\r\n ckie = (RUBY_VERSION =~ /^1.8/) ? Iconv.new('UTF-8//IGNORE', 'latin1').iconv(cookies[:active_filters] || \"\") : (cookies[:active_filters] || \"\").force_encoding(Encoding::ISO_8859_1).encode!(Encoding::UTF_8)\r\n if !ckie.blank?\r\n find_hash = FileImport.named_scope_active_filter_method(ActiveSupport::JSON.decode(ckie))\r\n conds = find_hash[:conditions]\r\n @joins_fields = find_hash[:joins]\r\n\r\n FileImport.send(:with_scope, {:find => {:conditions => conds, :joins => (@joins_fields || [])}}) {\r\n yield\r\n }\r\n\r\n else\r\n yield\r\n end\r\n end", "title": "" }, { "docid": "652f66d01706c925b3c5f66e20ac74f8", "score": "0.5951554", "text": "def insert_filter_before(filter, other)\n insert_filter(filter, @template_filters.map(&:class).index(other))\n end", "title": "" }, { "docid": "fee02c3d7f1248b80ed2d261b90b0040", "score": "0.5939726", "text": "def before filter\n @befores << filter\n end", "title": "" }, { "docid": "0e021bd29bebf84aaefb845c1ca86afc", "score": "0.593636", "text": "def setup_filters\n \n if !can?(:read, :providers) || params[:npi]\n npi = params[:npi] ? params[:npi] : current_user.npi\n @selected_provider = Provider.where(:npi => \"#{npi}\").first \n authorize! :read, @selected_provider\n end\n \n if request.xhr? \n build_filters\n else\n if can?(:read, :providers)\n\t\t\t\t# updated from bstrezze\n #@providers = Provider.page(@page).per(20).userfilter(current_user).alphabetical\n\t\t\t\t@providers = Provider.user_filter(current_user)\t\t\t\t\t\t\t\t\n\t\t\t\t@providers_for_filter = Provider.user_filter(current_user) #.alphabetical\n if APP_CONFIG['disable_provider_filters']\n @teams = Team.user_filter(current_user).alphabetical\n @page = params[:page]\n else\t\t\t\t\n\t\t\t\t\tother = Team.new(name: \"Other\")\n @providers_by_team = @providers.group_by { |pv| pv.team || other }\n @providers_by_team[other] ||= []\n\t\t\t\t\t@providers_for_filter_by_team = @providers_for_filter.group_by { |pv| pv.team.try(:name) || \"Other\" }\n end\n end\n\n @races = Race.ordered\n @ethnicities = Ethnicity.ordered\n @genders = [{name: 'Male', id: 'M'}, {name: 'Female', id: 'F'}].map { |g| OpenStruct.new(g)}\n @languages = Language.ordered \n end\t\t\t\n end", "title": "" }, { "docid": "f8349be92e690510b6105b796d9c454a", "score": "0.5928625", "text": "def before_filters(&block)\n @_before_filters ||= []\n @_before_filters << block if block_given?\n @_before_filters\n end", "title": "" }, { "docid": "c2655fc7d07f430c04ccbdaa01f13f41", "score": "0.5915508", "text": "def add_filters(filters)\n filters = [filters].flatten.compact\n @filters += filters\n @strainer = nil\n end", "title": "" }, { "docid": "b1a67545eead5a431c15eb1ef11deff0", "score": "0.58974516", "text": "def add_filter(&block)\n self.instrumentable_filters << block\n end", "title": "" }, { "docid": "f5d372eabd0d5144de20507eaccc5919", "score": "0.5888557", "text": "def add_fake_filter exp\n unless @current_class\n Railroader.debug \"Skipping before_filter outside controller: #{exp}\"\n return exp\n end\n\n filter_name = (\"fake_filter\" + rand.to_s[/\\d+$/]).to_sym\n args = exp.block_call.arglist\n args.insert(1, Sexp.new(:lit, filter_name))\n before_filter_call = make_call(nil, :before_filter, args)\n\n if exp.block_args.length > 1\n block_variable = exp.block_args[1]\n else\n block_variable = :temp\n end\n\n if node_type? exp.block, :block\n block_inner = exp.block[1..-1]\n else\n block_inner = [exp.block]\n end\n\n # Build Sexp for filter method\n body = Sexp.new(:lasgn,\n block_variable,\n Sexp.new(:call, Sexp.new(:const, @current_class.name), :new))\n\n filter_method = Sexp.new(:defn, filter_name, Sexp.new(:args), body).concat(block_inner).line(exp.line)\n\n vis = @visibility\n @visibility = :private\n process_defn filter_method\n @visibility = vis\n process before_filter_call\n exp\n end", "title": "" }, { "docid": "e782b6e5292c34754350ef2396bf80c6", "score": "0.58852595", "text": "def initialize_filter_set_if_needed\n helper = \"#{controller.controller_name.singularize}_filters\"\n send(helper) unless @filter_set\n end", "title": "" }, { "docid": "3ecc3271bb4740cce78072569142487c", "score": "0.58816695", "text": "def filters\n @filters ||= {}\n end", "title": "" }, { "docid": "3ecc3271bb4740cce78072569142487c", "score": "0.58816695", "text": "def filters\n @filters ||= {}\n end", "title": "" }, { "docid": "20d4d416148bda14a26251ec3e78a798", "score": "0.58810556", "text": "def data_context_filter_1\r\n\r\n ckie = (RUBY_VERSION =~ /^1.8/) ? Iconv.new('UTF-8//IGNORE', 'latin1').iconv(cookies[:active_filters] || \"\") : (cookies[:active_filters] || \"\").force_encoding(Encoding::ISO_8859_1).encode!(Encoding::UTF_8)\r\n if !ckie.blank?\r\n find_hash = Customer.named_scope_active_filter_method(ActiveSupport::JSON.decode(ckie))\r\n conds = find_hash[:conditions]\r\n @joins_fields = find_hash[:joins]\r\n\r\n Customer.send(:with_scope, {:find => {:conditions => conds, :joins => (@joins_fields || [])}}) {\r\n yield\r\n }\r\n\r\n else\r\n yield\r\n end\r\n end", "title": "" }, { "docid": "caac3357384713db3c3dd54f0fba9211", "score": "0.5848693", "text": "def filters\n @filters ||= {}\n end", "title": "" }, { "docid": "ad820c88a8ad5a01a4af8fd99bc3d13e", "score": "0.58412826", "text": "def load_filters(*args)\n require_rel 'filters'\n ::TeeLogger::Filter.constants.collect {|const_sym|\n ::TeeLogger::Filter.const_get(const_sym)\n }.each do |filter|\n begin\n register_filter(filter)\n if not ENV['TEELOGGER_VERBOSE'].nil? and ENV['TEELOGGER_VERBOSE'].to_i > 0\n puts \"Registered filter #{filter}.\"\n end\n rescue StandardError => err\n if not ENV['TEELOGGER_VERBOSE'].nil? and ENV['TEELOGGER_VERBOSE'].to_i > 0\n puts \"Not registering filter: #{err}\"\n end\n end\n end\n end", "title": "" }, { "docid": "638b28274c4ab1fa267c25d3a5a3df56", "score": "0.58346504", "text": "def data_context_filter_1\r\n\r\n ckie = (RUBY_VERSION =~ /^1.8/) ? Iconv.new('UTF-8//IGNORE', 'latin1').iconv(cookies[:active_filters] || \"\") : (cookies[:active_filters] || \"\").force_encoding(Encoding::ISO_8859_1).encode!(Encoding::UTF_8)\r\n if !ckie.blank?\r\n find_hash = Profile.named_scope_active_filter_method(ActiveSupport::JSON.decode(ckie))\r\n conds = find_hash[:conditions]\r\n @joins_fields = find_hash[:joins]\r\n\r\n Profile.send(:with_scope, {:find => {:conditions => conds, :joins => (@joins_fields || [])}}) {\r\n yield\r\n }\r\n\r\n else\r\n yield\r\n end\r\n end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.5831672", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.5831672", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.5831672", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.5831672", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.5831672", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.5831672", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.5831672", "text": "def filters; end", "title": "" }, { "docid": "255d18245f542f51e271dc75c2e8d3c9", "score": "0.5831672", "text": "def filters; end", "title": "" }, { "docid": "3475b7c2b10c24e8958055625f46f935", "score": "0.582711", "text": "def filters\n @filters ||= {:before => {}, :after => {}}\n end", "title": "" }, { "docid": "0f1664b4b1d8f8aab9f2444ed760a71a", "score": "0.5810974", "text": "def filter_order\n \tsetup_filters\n \tset_up_environment \n end", "title": "" }, { "docid": "4bb9fa1fb01b6aa41e1fba6a63ec6285", "score": "0.57830125", "text": "def data_context_filter_1\r\n\r\n ckie = (RUBY_VERSION =~ /^1.8/) ? Iconv.new('UTF-8//IGNORE', 'latin1').iconv(cookies[:active_filters] || \"\") : (cookies[:active_filters] || \"\").force_encoding(Encoding::ISO_8859_1).encode!(Encoding::UTF_8)\r\n if !ckie.blank?\r\n find_hash = SavedReport.named_scope_active_filter_method(ActiveSupport::JSON.decode(ckie))\r\n conds = find_hash[:conditions]\r\n @joins_fields = find_hash[:joins]\r\n\r\n SavedReport.send(:with_scope, {:find => {:conditions => conds, :joins => (@joins_fields || [])}}) {\r\n yield\r\n }\r\n\r\n else\r\n yield\r\n end\r\n end", "title": "" }, { "docid": "1e4779f0841ba1e61c6dec545363a7e8", "score": "0.5782868", "text": "def initialize_available_filters\n #add_available_filter \"id\", :type => :integer\n add_available_filter \"id\", :type => :integer, :label => :label_contact\n add_available_filter \"name\", :type => :text\n #add_custom_fields_filters(issue_custom_fields)\n #add_associations_custom_fields_filters :project, :author, :assigned_to, :fixed_version\n end", "title": "" }, { "docid": "d3732ff42abd0a618a006d1f24e31e38", "score": "0.5774404", "text": "def add_to_filter_parameters; end", "title": "" }, { "docid": "a395d1fa901fda8d8aa8bd81cb7c5bb0", "score": "0.5771817", "text": "def data_context_filter_1\r\n\r\n ckie = (RUBY_VERSION =~ /^1.8/) ? Iconv.new('UTF-8//IGNORE', 'latin1').iconv(cookies[:active_filters] || \"\") : (cookies[:active_filters] || \"\").force_encoding(Encoding::ISO_8859_1).encode!(Encoding::UTF_8)\r\n if !ckie.blank?\r\n find_hash = SmartQuery.named_scope_active_filter_method(ActiveSupport::JSON.decode(ckie))\r\n conds = find_hash[:conditions]\r\n @joins_fields = find_hash[:joins]\r\n\r\n SmartQuery.send(:with_scope, {:find => {:conditions => conds, :joins => (@joins_fields || [])}}) {\r\n yield\r\n }\r\n\r\n else\r\n yield\r\n end\r\n end", "title": "" }, { "docid": "6ecfb9ccba5f6b6dc94fdd1491a58f59", "score": "0.5755442", "text": "def before_filter(&block)\n @before_filter = block\n end", "title": "" }, { "docid": "2392c040f1fc44f98281fe53d2e874e0", "score": "0.5730514", "text": "def render_filters_for_home\n files = Dir[FILTER_AUTO_LOAD_PATH.to_s + '/_*.erb']\n files.each {|f|\n if f =~ /(before|after)_(body_(start|close)|page_(meta|header|front|sidebar|footer))/\n render :inline => \"\n <% content_for(:#{$~}) do %>\n #{IO.read f}\n <% end %>\n \"\n end\n }\n nil\n end", "title": "" }, { "docid": "aa3b6ef60798866ebe01908b3171c397", "score": "0.57137984", "text": "def register_tilt_filter(name, options = {})\n if constants.map(&:to_s).include?(name.to_s)\n raise \"#{name} filter already defined\"\n end\n\n filter = const_set(name, Module.new)\n filter.extend const_get(options[:extend] || \"Plain\")\n filter.extend TiltFilter\n filter.extend PrecompiledTiltFilter if options.has_key? :precompiled\n\n if options.has_key? :template_class\n filter.template_class = options[:template_class]\n else\n filter.tilt_extension = options.fetch(:extension) { name.downcase }\n end\n\n # All \":coffeescript\" as alias for \":coffee\", etc.\n if options.has_key?(:alias)\n [options[:alias]].flatten.each {|x| Filters.defined[x.to_s] = filter}\n end\n filter\n end", "title": "" }, { "docid": "43a73e60009c89a7b2d194030de4f878", "score": "0.5676418", "text": "def setup_liquid_context(plugin_id, context)\n # Add tags\n (context.registers[:enabled_plugin_tags] ||= Set.new).tap do |set|\n set.merge(self.class.prefixed_liquid_tags(plugin_id).values)\n end\n\n # Add drop with extension\n context['plugins'] ||= {}\n drop = self.to_liquid\n if drop\n drop.extend(Locomotive::Plugin::Liquid::DropExtension)\n drop.set_plugin_id(plugin_id)\n context['plugins'][plugin_id] = drop\n end\n\n # Add filters\n context.add_filters(self.class.prefixed_liquid_filter_module(plugin_id))\n end", "title": "" }, { "docid": "183aeb18ad7e9a3c3f7c8baca31dcb61", "score": "0.5657637", "text": "def add_filters(*filters)\n filters.each do |filter|\n filter.rake_application = rake_application\n filter.pipeline = self\n end\n @filters.concat(filters)\n end", "title": "" }, { "docid": "6bccb340e3359905d00a93229cbbce09", "score": "0.5657265", "text": "def insert_filter(filter, pos = 0)\n if filter.is_a? Class\n filter = filter.new\n end\n @template_filters.insert(pos, filter)\n end", "title": "" }, { "docid": "b097d797c6ab393e62b5860a8fe6a21b", "score": "0.5653078", "text": "def register_filters(hash)\n # puts \"register_filters: #{hash.inspect}\"\n @filters ||= {} \n @filters.merge!(hash)\n return @filters\n end", "title": "" }, { "docid": "39ff8ab3cf1a22a242727ea5edeac023", "score": "0.5642894", "text": "def add_filters\n if self.meta_tag.canonical?\n self.sub_tag.filtered_works.each do |work| \n unless work.filters.include?(self.meta_tag)\n work.filter_taggings.create!(:inherited => true, :filter_id => self.meta_tag.id)\n end\n end\n end \n end", "title": "" }, { "docid": "da39c908ab9f8d555f7d1c3fe786dd49", "score": "0.5641371", "text": "def applied_filter(fragment, filter, machines)\n return machines unless ::Chef.node['fragments']['enable-packer-debugging']\n @fragment += render_template(\n 'applied_filter.html.erb',\n filter: filter,\n machines: machines,\n fragment: fragment\n )\n machines\n end", "title": "" }, { "docid": "d632648ca13a3d3e9cea4e05f969121d", "score": "0.5639396", "text": "def filters\n @filters ||= []\n end", "title": "" }, { "docid": "b0cfaad00aa8885888feb26e36099f14", "score": "0.56189007", "text": "def filter_generate(base, stage, *args)\r\n filters.each do |filter|\r\n filter.send :\"#{stage}_generate\", base, *args if filter.respond_to? :\"#{stage}_generate\"\r\n end if RoutingFilter.active\r\n end", "title": "" }, { "docid": "450a9f4462da707ba4c3fa235fd46524", "score": "0.56139004", "text": "def prepare_filter\n @filters = [[t(:message_2, :scope => [:controller, :students]), 2], [t(:message_3, :scope => [:controller, :students]), 0],\n [t(:message_4, :scope => [:controller, :students]), 3]]\n if (@user.has_one_of_roles?(['leader', 'dean', 'vicerector']))\n if !@user.person.indices.empty?\n @filters.concat([[t(:message_5, :scope => [:controller, :students]), 1], [t(:message_6, :scope => [:controller, :students]), 4]])\n end\n end\n if @user.has_role?('board_chairman')\n @filters.concat([[t(:chairmaned, :scope => [:controller, :students]), 5]])\n end\n if !@user.has_one_of_roles?(['faculty_secretary', 'department_secretary', 'university_secretary'])\n # default filter to waiting for approval\n session[:filter] ||= 2\n else\n session[:filter] ||= 3\n end\n end", "title": "" }, { "docid": "ca34999606dc9d5af6be0de62cd5c0a3", "score": "0.5611106", "text": "def filters\n @filters ||= []\n end", "title": "" }, { "docid": "ca34999606dc9d5af6be0de62cd5c0a3", "score": "0.5611106", "text": "def filters\n @filters ||= []\n end", "title": "" }, { "docid": "070724126c8013fc7041e3664521d204", "score": "0.56108963", "text": "def filter(*args, &block)\n @filters.use(*args, &block)\n end", "title": "" }, { "docid": "8f5d4748227c0a34ad4f611fcaaecdd2", "score": "0.5610305", "text": "def get_filters\n return @filters + get_generated_filters\n end", "title": "" }, { "docid": "479ed99e4226b49d9a433f4cd308644a", "score": "0.5609895", "text": "def registered_filters\n # Initialize if it doesn't exist\n @filters ||= {}\n return @filters\n end", "title": "" }, { "docid": "f7dc9671c291ec2817fb4b7200562cb8", "score": "0.5606106", "text": "def merge_filter filter\n filter.filters.each do |names,arr|\n @filters[names] += arr ## adds all blocksfor this particular field\n end \n end", "title": "" }, { "docid": "cadeb46af0d75b87f804590644b9a903", "score": "0.56030405", "text": "def add_filter(filter_argument = T.unsafe(nil), &filter_proc); end", "title": "" }, { "docid": "67a147e49e36ee8d7ab4774db7c1e0f3", "score": "0.5584436", "text": "def add_filter(permitted = [])\n @filter = JsonApiServer::Filter.new(request, model, permitted)\n self\n end", "title": "" }, { "docid": "953d2a367141dae00515adcd76492a85", "score": "0.5584189", "text": "def after_filters\n @after_filters\n end", "title": "" }, { "docid": "ef918654b7eaca3bd48438e649a329a2", "score": "0.5578204", "text": "def add_products_filter\n name = params[:id]\n # create a new Product Filter\n products_filter = case params[:key_selector]\n when \"by_label\" then ProductByLabel.new(:products_selector_dom_name => \"name\")\n when \"by_shortcut\" then ProductsByShortcut.new(:products_selector_dom_name => \"name\")\n when \"by_specification\"\n pf = ProductsBySpec.new(:products_selector_dom_name => \"name\")\n pf.specification = @current_knowledge.get_specification_by_idurl(\"brand\")\n pf\n else\n raise \"error unknown key_sleector=#{params[:key_selector].inspect}\"\n end\n render :update do |page|\n page.insert_html(:bottom, \"#{name}_extra\",\n :partial => \"products_selector_filter\",\n :locals => { :is_first_product_filter => false,\n :products_filter => products_filter,\n :name => name } )\n end\n \n end", "title": "" }, { "docid": "1665bd7247ad03da728d68d3871ec627", "score": "0.5572302", "text": "def prepare_facet_filters!\n # TODO; This could explode....??\n return unless @filter_facets && @query[:body][:facets] && @query[:body][:filter]\n @query[:body][:facets].each do |k,v|\n @query[:body][:facets][k].merge!({\n facet_filter: @query[:body][:filter]\n })\n end\n end", "title": "" }, { "docid": "eb2996860362f20764d82a1c47575e1a", "score": "0.5554585", "text": "def query_filters; end", "title": "" }, { "docid": "c520e16ce172ddc4f19975b2455b9df9", "score": "0.5546872", "text": "def add_filter!(filter, condition)\n @filter_composition.add_filter!(filter, condition)\n end", "title": "" }, { "docid": "d5f9f73c3fcc5c3c14485251cf48d21d", "score": "0.5542837", "text": "def define_filter(name, &block)\n @filters[name.to_sym] = block\n nil\n end", "title": "" }, { "docid": "0b1483190fc65720b98e5a0c7692485c", "score": "0.5540864", "text": "def with_filters_input(filter)\n render(partial: filter.to_partial_path, locals: {filter: filter})\n end", "title": "" }, { "docid": "5aa111a6cd195caddb80c7829ff3b697", "score": "0.55375797", "text": "def filters\n @filters ||= Hash.new { |h, k| h[k] = [] }\n end", "title": "" }, { "docid": "ca774d57e6f3144fd9baa3dd3e1092b4", "score": "0.55371064", "text": "def post_filters\n @post_filters ||= []\n end", "title": "" }, { "docid": "6956141c2e9cd2c95bd9a9ab52b036df", "score": "0.5516495", "text": "def filter filter\n @befores << filter\n @afters << filter\n end", "title": "" }, { "docid": "6f9269c29de32087adad49956c5d4ff2", "score": "0.55090624", "text": "def prepend_after_filter(*filters, &block)\n conditions = extract_conditions!(filters) \n filters << block if block_given?\n add_action_conditions(filters, conditions)\n prepend_filter_to_chain(\"after\", filters)\n end", "title": "" }, { "docid": "fb5dd1ff1d3dd8e300ccb27c65628c0b", "score": "0.5499788", "text": "def prepend_before_filter(*filters, &block)\n conditions = extract_conditions!(filters) \n filters << block if block_given?\n add_action_conditions(filters, conditions)\n prepend_filter_to_chain(\"before\", filters)\n end", "title": "" }, { "docid": "bc81c05bb49681c4837f490affe0f9bf", "score": "0.54935503", "text": "def available_filters\n @available_filters ||= eval_class_filters\n end", "title": "" }, { "docid": "292555f8d20f5f7cdfc7b9a919df4175", "score": "0.5485489", "text": "def safe_filter(filters = {}, meta = {})\n\n filter(filters, meta, true)\n\n self\n\n end", "title": "" }, { "docid": "321765752f6cef1896c2ab26a04ea82f", "score": "0.5476501", "text": "def render_filter_nav\n if @islay_filter_nav and !@islay_filter_nav.empty?\n if !@islay_filter_nav[:current] and @islay_filter_nav[:default]\n @islay_filter_nav[:default] << true\n end\n\n render(\n :partial => 'islay/admin/shared/filter_nav',\n :locals => {:filters => @islay_filter_nav[:entries]}\n )\n end\n end", "title": "" }, { "docid": "1c148848cd8f8f551137f64ed287e1a3", "score": "0.54676795", "text": "def expression_filters; end", "title": "" }, { "docid": "b564617f8f8b54ebb0e845fd67cb1ba7", "score": "0.5462739", "text": "def available_filters\n\t\t\t{}\n\t\tend", "title": "" }, { "docid": "656e3e62d123f8d16933e24e71ea62da", "score": "0.5444351", "text": "def filters\n @filters\n end", "title": "" }, { "docid": "656e3e62d123f8d16933e24e71ea62da", "score": "0.5444351", "text": "def filters\n @filters\n end", "title": "" }, { "docid": "656e3e62d123f8d16933e24e71ea62da", "score": "0.5444351", "text": "def filters\n @filters\n end", "title": "" }, { "docid": "656e3e62d123f8d16933e24e71ea62da", "score": "0.5444351", "text": "def filters\n @filters\n end", "title": "" }, { "docid": "9c158d0e85a1a11968963890d5eed5f9", "score": "0.54439694", "text": "def prepend_before_filter(*filters, &block)\n filters << block if block_given?\n prepend_filter_to_chain(\"before\", filters)\n end", "title": "" }, { "docid": "31ade3f984434850f4f5ae96fcea5748", "score": "0.54425776", "text": "def filters(title=nil, extensions=nil)\n \t \t\t@filters << {:title => title, :extensions => extensions || self.extension_white_list} if title\n (@filters.empty? && self.extension_white_list) ? [{:title => self.title, :extensions => self.extension_white_list}] : @filters\n \t \tend", "title": "" }, { "docid": "a476e0e85dac6066157d2723eb0c6f07", "score": "0.5438974", "text": "def setup_filters\n @filter = {}\n @filter[:bloques] = params[:bloques]\n @filter[:distritos] = params[:distritos]\n @bloques = load_political_parties\n end", "title": "" }, { "docid": "d184a090027fe910a53a34dd1eed06c6", "score": "0.5436628", "text": "def add_filter(filter=nil,&block) #:nodoc:\n @filters.push(filter) unless filter.nil?\n @filters.push(block) if block_given?\n end", "title": "" }, { "docid": "05af921f8a520237531357547c429b40", "score": "0.5430786", "text": "def apply_filters(*args)\n # Pre-process filter words: we need to have regular expressions everywhere\n words = []\n filter_words.each do |word|\n if word.is_a? Regexp\n words << word\n else\n words << Regexp.new(word.to_s)\n end\n end\n\n # We instanciate each filter once per application, and store the instnaces\n # in a cache for that duration.\n filter_cache = {}\n\n # Pass state on to apply_filters_internal\n state = {\n :words => words,\n :filter_cache => filter_cache,\n :filters => self,\n }\n return apply_filters_internal(state, *args)\n end", "title": "" }, { "docid": "ca0738b14101c2d459a2b987cdbf1641", "score": "0.54200846", "text": "def process_filter\n # TODO\n end", "title": "" }, { "docid": "c93c1b51ab3fa4667ded64bffdfb705d", "score": "0.54175144", "text": "def register_post_filter(post_filter)\n post_filters.push(post_filter)\n end", "title": "" } ]
a2099a77c85e91272ae2f9e35b937953
Only allow a trusted parameter "white list" through.
[ { "docid": "fd375e7fa01b97cf8ac364cb50a91fd0", "score": "0.0", "text": "def new_translation_params\n params.except(:project_id).permit(:key_id, :locale_id)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7943618", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.69572574", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.6887521", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.67666084", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6733912", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.671326", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6705381", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.66612333", "text": "def filtered_parameters; end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.66164786", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.66156906", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.65888846", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6575757", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6572969", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.6572365", "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": "f5e3a87909b3e5022047b4b0a64ca154", "score": "0.65321475", "text": "def parameter_params\n params.require(:parameter).permit(:name, :code, :description, :user_id, :value, :cargapp_model_id, :active)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.65129966", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "58d1451e57b0e767db2fc6721dfaa6be", "score": "0.65128386", "text": "def allowed_parameters\n parameters.keys\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.64990044", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "52d4c66cc205503f7ad6a4feaedab9b8", "score": "0.6491305", "text": "def parameter_params\n params.require(:parameter).permit(:name, :value, :description)\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.6489574", "text": "def need_params\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.6476191", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "e64490ed35123aafa1b4627bd165517d", "score": "0.645836", "text": "def allowed_params\n [:title, :description, :is_template, :template_id, :user_id, :color]\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.64389294", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.6431918", "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": "8c384af787342792f0efc7911c3b2469", "score": "0.642512", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.6420569", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.6420569", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.63804525", "text": "def filter_parameters; end", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.63736504", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6355191", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6355191", "text": "def check_params; true; end", "title": "" }, { "docid": "cac0774e508766d2f487cbca3db95df0", "score": "0.6336598", "text": "def allow_params?\n definition[:param_tokens]\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.6319846", "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": "55aa899fab0dfa44916f71c499998ca8", "score": "0.63113743", "text": "def parameter_params\n params.require(:parameter).permit(:key, :value)\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6292978", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6292978", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.6291", "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.6291", "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": "64ea65f903dbe0c9c0cc0e9a20ed2e7f", "score": "0.6290657", "text": "def good_option_params\n permit_params\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.62724084", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.6266407", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "572f75fa86537d103ddf7b5503f06515", "score": "0.6265082", "text": "def parameter_params\n params.require(:parameter).permit(:title)\n end", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.6262119", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "b4ac8bc6941a87425ac2dc42a226295f", "score": "0.6258491", "text": "def filtered_params_config; end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.6243215", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "63944d10aa4cde014b8332874db87cb9", "score": "0.62372005", "text": "def excluded_from_filter_parameters=(_arg0); end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.6228103", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "6fc2bac4c842e4285d685333ba68e5e9", "score": "0.6226018", "text": "def admin_parameter_params\n params.require(:admin_parameter).permit(:name, :inss_hour_price, :private_hour_price, :is_eval)\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.6225602", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "d8b02fce801fc219417d86d0ca117836", "score": "0.6225602", "text": "def _valid_params\n valid_params # method private cause needed only for internal usage\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.62250364", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "6008e8707eafce375988b3c7ccf098c3", "score": "0.62147176", "text": "def original_params; end", "title": "" }, { "docid": "4ba8f5cdb0399571d60b7242794ce47f", "score": "0.62035644", "text": "def permitted_resource_params\n params[resource.object_name].present? ? params.require(resource.object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "356c5fd5dcbe9214f1330792fa2e18b5", "score": "0.61931455", "text": "def param_whitelist\n whitelist = [\n :name,\n :details,\n :completed,\n :started_at, :finished_at,\n :team_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:team_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b977c2daceb28f26ee659336b2b98aa9", "score": "0.618889", "text": "def params\n raise \"Override protected method `params'.\"\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6180647", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "706df0e25391ed2b932f54a646bb0a10", "score": "0.6180104", "text": "def list_name_param opts={}\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.6175616", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "d3732ff42abd0a618a006d1f24e31e38", "score": "0.61731255", "text": "def add_to_filter_parameters; end", "title": "" }, { "docid": "8e54eaded22dd280d836e96375fed9a4", "score": "0.61730814", "text": "def paramun_params\n params.require(:parametre).permit!\n end", "title": "" }, { "docid": "f8c05c05fb596260a51d3ab4fb42243d", "score": "0.6172509", "text": "def required_parameters\n [ ]\n end", "title": "" }, { "docid": "19080b9212dc7ba3727f80cc9430e426", "score": "0.6172386", "text": "def special_params\n params.require(:special).permit(:name, :description, :function)\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.6163843", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "3da9117a80cdfd040f0f0ed9d3ffed55", "score": "0.6146083", "text": "def allowable_params(unfiltered_params)\n unfiltered_params.permit(:property_id, :branch_id, :client_name, :branch_name,\n :department, :reference_number, :address_name, :address_number, :address_street,\n :address2, :address3, :address4, :address_postcode, :country, :display_address,\n :property_bedrooms, :property_bathrooms, :property_ensuites, :property_reception_rooms,\n :property_kitchens, :display_property_type, :property_type, :property_style,\n :property_age, :floor_area, :floor_area_units, :property_feature1, :property_feature2,\n :property_feature3, :property_feature4, :property_feature5, :property_feature6,\n :property_feature7, :property_feature8, :property_feature9, :property_feature10,\n :price, :for_sale_poa, :price_qualifier, :property_tenure, :sale_by,\n :development_opportunity, :investment_opportunity, :estimated_rental_income,\n :availability, :main_summary, :full_description, :date_last_modified,\n :featured_property, :region_id, :latitude, :longitude,\n flags_attributes: [:title],\n images_attributes: [:url, :modified],\n floorplans_attributes: [:url, :modified],\n epc_graphs_attributes: [:url, :modified],\n epc_front_pages_attributes: [:url, :modified],\n brochures_attributes: [:url, :modified],\n virtual_tours_attributes: [:url, :modified],\n external_links_attributes: [:url, :description, :modified])\n end", "title": "" }, { "docid": "b9e34b5ac2955add85639f9ca0a07b7f", "score": "0.6145458", "text": "def resource_params\n permits = resource_whitelist\n params.require(model_symbol).permit(permits)\n end", "title": "" }, { "docid": "d646c7ba579499db9edadb606c8b9910", "score": "0.61444825", "text": "def permitted_params\n logger.warn \"#{self}: please override `permitted_params` method.\"\n params.require(resource_request_name).permit!\n end", "title": "" }, { "docid": "4425e2f97b4355b14334b9744f19c412", "score": "0.6143515", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "4425e2f97b4355b14334b9744f19c412", "score": "0.6143515", "text": "def additional_permitted_params\n []\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.61364955", "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": "c4a951d3ba89c6d098a96d3d5a2b8643", "score": "0.61280644", "text": "def collection_permitted_params\n params.permit(:format, :page, :per_page, :sort, :include, :locale, fields: {}, filter: {})\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6113519", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "34fb76d8decc10cd29ada824ff70ae63", "score": "0.6112032", "text": "def permitted_resource_params\n p params[object_name].present? ? params.require(object_name).permit! : ActionController::Parameters.new\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.6106793", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "11f5f8959aba1f4022c60509f20e40af", "score": "0.61061025", "text": "def permit_params\n params[:permit]\n end", "title": "" }, { "docid": "45791845cef485d15b7014088dd0be8d", "score": "0.6105072", "text": "def allowed_params\n %i[title body]\n end", "title": "" }, { "docid": "4632c7949842c8534d66b50254032add", "score": "0.6092409", "text": "def parameterization_params\n params.permit(:name, :user_id, :number_value, :money_value)\n end", "title": "" }, { "docid": "bfa951108b69c8eed106b7ad8acbcbfd", "score": "0.60909486", "text": "def data_param\n params.permit(:value)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.60895824", "text": "def filter_params\n end", "title": "" }, { "docid": "63f5e4e9733f9e6b3f98d5e069440292", "score": "0.6083517", "text": "def black_list_params\r\n params.require(:black_list).permit(:user)\r\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.6081807", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6079226", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "44a1ec524e77d2a2c4b85e8341df27db", "score": "0.6077248", "text": "def product_params\n params.permit(:visible)\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.60767365", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "c31ef48e8fd467d94158d7ac7f405a3f", "score": "0.60746986", "text": "def list_params\n params.permit(:id, :public_id, :name, :list, :visibility, values: [])\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.60703695", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.6070048", "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": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.6069783", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "c1f13277dbc8ff3a9f65df027f9d915a", "score": "0.6063365", "text": "def permitted_params(unpermitted_params)\n unpermitted_params.permit(\n :controller,\n :action,\n :site_id,\n :format,\n :type,\n :path_contains,\n :new_url_contains,\n :tagged,\n )\n end", "title": "" }, { "docid": "cf963fb451b51d62fcc986deb020a044", "score": "0.6047726", "text": "def permit_params\n\t\t\t\teval(@configuration.get_params)\n\t\t\tend", "title": "" }, { "docid": "77b78ffc267fcf03379cf09c63ad361c", "score": "0.60399187", "text": "def gallery_params\n params.require(:gallery).permit(:name, :white_list)\n end", "title": "" }, { "docid": "be92e82ba93b35cac91b7c02d6a445f7", "score": "0.6033119", "text": "def get_params\r\n #params.require(:view_adm).permit(:name, :action_scope,:caps,:cols)\r\n params.require(:view_adm).permit!\r\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.6029004", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "5b72cb3f5ae45681ff116df46f5da01b", "score": "0.6025425", "text": "def provider_params\n params.permit(:name)\n end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60199857", "text": "def params; end", "title": "" }, { "docid": "7402112b5e653d343b91b6d38c203c59", "score": "0.60199857", "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": "" } ]
6b71a848773d75d41a9c562747253152
Gets the default arguments used to start a master instance of TokyoTyrant.
[ { "docid": "b97103987c909cd4977ff4a7693faaf3", "score": "0.62984234", "text": "def default_master_server_arguments(port, date)\n {\n :sid => '1',\n :thnum => '16',\n :format => 'tch',\n :bnum => '503316469',\n :apow => '11',\n :fpow => '18',\n :ncnum => '6000000',\n :xmsiz => '1073741824',\n :opts => 'lb',\n :slave => false,\n :date => date.strftime('%Y%m'),\n :port => port\n }\n end", "title": "" } ]
[ { "docid": "3b2d597ef3c45406085348c1a9007303", "score": "0.65190816", "text": "def default_jvmargs\n [ ]\n end", "title": "" }, { "docid": "ed4f95d4f4231c24c454bf60abd8de59", "score": "0.64784163", "text": "def default_old_master_server_arguments(port, date)\n default_master_server_arguments(port, date).merge(:xmsiz => '268435456')\n end", "title": "" }, { "docid": "e75b447c157d360096f88703ce5ed156", "score": "0.6279156", "text": "def config\n @default_args || Surrealist::HashUtils::EMPTY_HASH\n end", "title": "" }, { "docid": "f2a14c1406318ad8d5803f8a7ef444d6", "score": "0.60665154", "text": "def default_options\n environment = ENV['SHELF_ENV'] || 'development'\n default_host = environment == 'development' ? 'localhost' : '0.0.0.0'\n\n { environment: environment, port: 9292, host: default_host }\n end", "title": "" }, { "docid": "7a3adb2bd649799966e555d17d97b552", "score": "0.6041417", "text": "def default_options\n {\n thread_count: DEFAULT_THREAD_COUNT,\n ssh: Hash.new\n }\n end", "title": "" }, { "docid": "7a3adb2bd649799966e555d17d97b552", "score": "0.6041417", "text": "def default_options\n {\n thread_count: DEFAULT_THREAD_COUNT,\n ssh: Hash.new\n }\n end", "title": "" }, { "docid": "9dd5630af20cf91df815728dc0d4a5ed", "score": "0.6040326", "text": "def get_default_options\n get_options([:default_task_heartbeat_timeout, :default_task_schedule_to_close_timeout, :default_task_schedule_to_start_timeout, :default_task_start_to_close_timeout])\n end", "title": "" }, { "docid": "5a700546369efb934a3aa6a69081cb51", "score": "0.6032769", "text": "def default_old_slave_server_arguments(master_host, master_port, slave_port, date)\n default_slave_server_arguments(master_host, master_port, slave_port, date).merge(:xmsiz => '134217728')\n end", "title": "" }, { "docid": "57ae4e151cade7792bbd7daf96a8d201", "score": "0.599031", "text": "def default _args\n \"default _args;\" \n end", "title": "" }, { "docid": "8bf6e591001447f5f8f28fdea14a54bc", "score": "0.5965294", "text": "def set_defaults\n self.help ||= ENV['help_text']\n self.help_url ||= ENV['help_url']\n self.created_at ||= DateTime.current\n end", "title": "" }, { "docid": "94622a947c48c6346d52625380ad2d00", "score": "0.58971816", "text": "def default_slave_server_arguments(master_host, master_port, slave_port, date)\n {\n :sid => '2',\n :thnum => '24',\n :mhost => master_host,\n :mport => master_port,\n :format => 'tch',\n :bnum => '503316469',\n :apow => '11',\n :fpow => '18',\n :ncnum => '3000000',\n :xmsiz => '536870912',\n :opts => 'lb',\n :slave => true,\n :date => date.strftime('%Y%m'),\n :port => slave_port\n }\n end", "title": "" }, { "docid": "0b658f35691160a869f6ea4ecd381daf", "score": "0.58119786", "text": "def options_arguments\n @options_arguments ||= Launchr::OrderedHash.new\n @options_arguments\n end", "title": "" }, { "docid": "5f72500ac17217046843c79053a57cb3", "score": "0.5787639", "text": "def options\n @env || @default_options\n end", "title": "" }, { "docid": "d20353ea40afa1983386b70f19fff7e1", "score": "0.57797545", "text": "def mandatory_arguments\n\t\t\t[:server]\n\t\tend", "title": "" }, { "docid": "2f09a2666c551670e4a440a3ca128628", "score": "0.575687", "text": "def default_args\n args.select &:default\n end", "title": "" }, { "docid": "9504da454a80be880b119db98a2067f1", "score": "0.568173", "text": "def initialize options\n @options = { }\n @test_options = options\n @mandatory_arguments = {}\n @missing_arguments = []\n super do |x|\n x.separator ''\n end\n\n # Fallback to the first entry on the environments list if there's not default environment selected\n default_environment = @test_options.default_environment.nil? ? @test_options.environments.keys.first : @test_options.default_environment\n @options[:server] = @test_options.environments[default_environment]\n\n set_option(:server, \"-s\", \"--server OPT\", @test_options.environments.keys, \"Server to connect. Default: #{default_environment}\")\n\n options.default_options.each do |opt|\n set_option(opt[:symbol].to_sym, *opt[:opts], &opt[:block])\n end\n end", "title": "" }, { "docid": "7c59c404311348791bfbc4560d3d0c59", "score": "0.562193", "text": "def default_options; end", "title": "" }, { "docid": "7c59c404311348791bfbc4560d3d0c59", "score": "0.562193", "text": "def default_options; end", "title": "" }, { "docid": "7c59c404311348791bfbc4560d3d0c59", "score": "0.562193", "text": "def default_options; end", "title": "" }, { "docid": "301a2b17e941aa3b1b45652edabac741", "score": "0.56177473", "text": "def default_args(a,b,c=1)\n puts \"\\nValues of variables: \",a,b,c\nend", "title": "" }, { "docid": "a08d8e68b55d388aee71b44ca160849a", "score": "0.5586123", "text": "def default\r\n @opts[:default]\r\n end", "title": "" }, { "docid": "ed29d9c404ba9c971efadea0cd9b1d19", "score": "0.5574348", "text": "def cli_options\n { returns: [0],\n user: node[:jboss][:user],\n cwd: node[:jboss][:home]\n }\n end", "title": "" }, { "docid": "5106406e53f590886b20443bb1fd5acd", "score": "0.55611956", "text": "def arguments\n \"\"\n end", "title": "" }, { "docid": "7915312d2f5deb56b1e916b7fc77eba2", "score": "0.5560678", "text": "def get_target_args\n\t\t\targs = ARGV.reject {|arg| arg =~ /^-/ || Rake::Task.task_defined?(arg) }\n\t\t\treturn args\n\t\tend", "title": "" }, { "docid": "e670a21eae954fe1a2b5762adf9c515e", "score": "0.5551926", "text": "def add_default_command_options(options)\n defaults = self[:default_run_options]\n options = defaults.merge(options)\n\n env = self[:default_environment]\n env = env.merge(options[:env]) if options[:env]\n options[:env] = env unless env.empty?\n\n shell = options[:shell] || self[:default_shell]\n options[:shell] = shell unless shell.nil?\n\n options\n end", "title": "" }, { "docid": "569cbb76bdf2cddc197dd50145687d4d", "score": "0.5550328", "text": "def default_runner_opts(opts)\n _config_store.default_runner_opts(opts)\n end", "title": "" }, { "docid": "820ff399d6140dc75c0c025d4ae8b5b6", "score": "0.5547552", "text": "def job_options\n job_arguments(-1)\n end", "title": "" }, { "docid": "864485daf3a550b485f842128cdf623b", "score": "0.55209297", "text": "def arguments\n @arguments ||= Launchr::OrderedHash.new\n @arguments\n end", "title": "" }, { "docid": "362bcbcf6c1c44e4bdbe56bd7d3a18ae", "score": "0.5514262", "text": "def use_defaults(*args)\n default_setup(*args)\n default_teardown(*args)\n end", "title": "" }, { "docid": "16249635a7fb4497788f00ce02b65cb9", "score": "0.55098885", "text": "def minimum_runnable_options\n [\n :keypair, :minimum_instances, :maximum_instances, :ami, :security_group,\n :expand_when, :contract_when, :set_master_ip_to\n ]\n end", "title": "" }, { "docid": "3087f144d32847f1c623aac617323d41", "score": "0.55053055", "text": "def default_job_params\n {\n thermocycler_model: TestThermocycler::MODEL,\n program_name: 'CDC_TaqPath_CG',\n qpcr: true\n }\n end", "title": "" }, { "docid": "dbf8b4a84e3cd3fe64ef21a061ff7302", "score": "0.550166", "text": "def default_options\n sync{ @opts || {} }\n end", "title": "" }, { "docid": "d16d05dbc29ff131f6e7f85c4f5523d8", "score": "0.5493289", "text": "def default_environment; end", "title": "" }, { "docid": "41cd5f2bc4a95fed76ea984bb33da995", "score": "0.54786247", "text": "def defaultArguments (x = 22, y = x + 20, z = 50)\n puts \"x = \" + x.to_s\n puts \"y = \" + y.to_s\n puts \"z = \" + z.to_s\n end", "title": "" }, { "docid": "b56cf5eafc3bb65064293f3587f968a8", "score": "0.5476659", "text": "def puppet_cli_options\n Puppet::Settings::REQUIRED_APP_SETTINGS.map do |setting|\n \"--%s %s\" % [setting, @tmpdir]\n end\n end", "title": "" }, { "docid": "44f72c35a22a7538a197dd4d2180c4c1", "score": "0.546039", "text": "def options_defaults(options)\n options[:parallel_run] = 0\n end", "title": "" }, { "docid": "a94812b39de1ce65e5a04e75ab5764b8", "score": "0.54573107", "text": "def default_options()\n options = {\n :verbose => 0, # Logger::DEBUG\n :logfile => STDERR\n }\n config_file = File.join(ENV['HOME'],\"#{File.basename($0, \".*\")}.rc.yaml\")\n if File.exists? config_file then\n config_options = YAML.load_file(config_file)\n options.merge!(config_options)\n end\n return options\n end", "title": "" }, { "docid": "91a3525d2b1d1072d17b3a4a4b78d3e6", "score": "0.54503965", "text": "def default_options; {} end", "title": "" }, { "docid": "2dd16a4ec708140b9e91f94327512868", "score": "0.5437871", "text": "def default_options\n {\n :description => '', # Name\n :type => 0, # 0 - Email, 1 - External script, 2 - SMS, 3 - Jabber, 100 - EzTexting\n :smtp_server => '',\n :smtp_helo => '',\n :smtp_email => '', # Email address of Zabbix server\n :exec_path => '', # Name of external script\n :gsm_modem => '', # Serial device name of GSM modem\n :username => '', # Jabber user name used by Zabbix server\n :passwd => '' # Jabber password used by Zabbix server\n }\n end", "title": "" }, { "docid": "37b02c474eec7768ac601a63a307edb6", "score": "0.5405379", "text": "def std_cmake_parameters\n # The None part makes cmake use the environment's CFLAGS etc. settings\n \"-DCMAKE_INSTALL_PREFIX='#{prefix}' -DCMAKE_BUILD_TYPE=None\"\n end", "title": "" }, { "docid": "abbffb62c2c09a1bbd2eb3e367679d69", "score": "0.54042995", "text": "def defaults\n {\n base_path: base_path,\n colour_mode: detect_colour_mode,\n compression: true,\n debug: false,\n drb: false,\n drb_host: nil,\n drb_port: nil,\n drb_height: 25,\n drb_width: 80,\n interactive: true,\n log: nil,\n log_only: [],\n once: false,\n renderers: [Vedeu::Renderers::Terminal.new],\n root: nil,\n stdin: nil,\n stdout: nil,\n stderr: nil,\n terminal_mode: :raw,\n }\n end", "title": "" }, { "docid": "043fddc9742fc8dc6c71f05aa8f9dbfc", "score": "0.54009944", "text": "def default_options\n {\n name: '', # Name\n description: '', # Description\n type: 0, # 0 - Email, 1 - External script, 2 - SMS, 3 - Jabber, 100 - EzTexting\n smtp_server: '',\n smtp_helo: '',\n smtp_email: '', # Email address of Zabbix server\n exec_path: '', # Name of external script\n gsm_modem: '', # Serial device name of GSM modem\n username: '', # Jabber user name used by Zabbix server\n passwd: '' # Jabber password used by Zabbix server\n }\n end", "title": "" }, { "docid": "a3d4aa893828538751051cbf91b232b6", "score": "0.5399757", "text": "def opts\n load_defaults unless @opts\n @opts\n end", "title": "" }, { "docid": "6ce50b3d024de896b635ef57c592e9d7", "score": "0.5386482", "text": "def default_lock_args_method\n default_job_options[LOCK_ARGS_METHOD] ||\n default_job_options[UNIQUE_ARGS_METHOD]\n end", "title": "" }, { "docid": "ea77bb0247825bda7e61460689449762", "score": "0.53815573", "text": "def default_options\n { \"token_credential_uri\" => self.class::TOKEN_CREDENTIAL_URI,\n \"audience\" => self.class::AUDIENCE,\n \"scope\" => self.class::SCOPE }\n end", "title": "" }, { "docid": "a63a65b4491062cd2054927195e60e13", "score": "0.53717", "text": "def default_job_options\n @default_job_options ||= if Sidekiq.respond_to?(:default_job_options)\n Sidekiq.default_job_options.stringify_keys\n else\n Sidekiq.default_worker_options.stringify_keys\n end\n end", "title": "" }, { "docid": "7d3bb7799c201416a71fb182bc93a65e", "score": "0.5367614", "text": "def default_options\n {\n basic_auth: {\n username: Maestrano[self.class.preset].param('api.id'),\n password: Maestrano[self.class.preset].param('api.key')\n },\n timeout: Maestrano[self.class.preset].param('connec.timeout')\n }\n end", "title": "" }, { "docid": "e0e21350e0b94f9b633c364a6cca98fb", "score": "0.53538066", "text": "def setup_config(*args)\n args.first.is_a?(Hash) ? args.first : { default: args }\n end", "title": "" }, { "docid": "1008e93089125326871aa2035eb4f63d", "score": "0.5334753", "text": "def defaults\n @width ||= 800\n @height ||= 600\n @panel_pos ||= 360\n @notebook_panel_position ||= 400\n @run_command_line ||= \"ruby main.rb\"\n @open_files ||= []\n @open_folders ||= []\n @current_file ||= \"\"\n @current_line ||= 1\n @rdoc_command_line ||= \"rdoc -x README\"\n end", "title": "" }, { "docid": "2ce14e582749ea8e7c9099113613f3b4", "score": "0.5333688", "text": "def default_options\n HashWithIndifferentAccess.new({\n :sunspot_index_queue_name => \"sunspot_index_queue\",\n :user => \"guest\",\n :pass => \"guest\",\n :host => \"localhost\",\n :port => \"5672\",\n :vhost => \"/\",\n :max_attempts_count => 5,\n :retry_interval => 300,\n :index_delay => 0\n })\n end", "title": "" }, { "docid": "863a64f0270faddca5738f2efa564e53", "score": "0.5332501", "text": "def default_options\n {}\n end", "title": "" }, { "docid": "863a64f0270faddca5738f2efa564e53", "score": "0.5332501", "text": "def default_options\n {}\n end", "title": "" }, { "docid": "863a64f0270faddca5738f2efa564e53", "score": "0.53320396", "text": "def default_options\n {}\n end", "title": "" }, { "docid": "a0d7dc850a78312f27c9f3d82e94172d", "score": "0.5329005", "text": "def default_options\n # {}\n end", "title": "" }, { "docid": "a3c4782b3589b41f5ba8ef8766f3cb70", "score": "0.532045", "text": "def default_options=(opts); end", "title": "" }, { "docid": "38e7add3ef8c8d262982e07856c13c60", "score": "0.53186566", "text": "def setup_defaults\n @program_title = 'PROGRAM TITLE'\n @program_site = 'PROGRAM SITE'\n @request_availability = false\n @meeting_times = ''\n @sourcing_options = ''\n @course_options = ''\n @student_id_required = false\n @student_id_format = ''\n @student_id_format_help = ''\n @student_id_excluded_chars = ''\n @contact_email = 'info@bebraven.org'\n @is_preaccelerator_student = false\n end", "title": "" }, { "docid": "240f3fb3270f8a1b07ed48648209fcf6", "score": "0.5317261", "text": "def default_options\n options = {}\n options[:verbose] = false\n options[:copy_only] = false\n options[:output_folder] = FileUtils.pwd\n\n options\n end", "title": "" }, { "docid": "8d96922f81a1efe85abd03f45b922df7", "score": "0.5317118", "text": "def set_default_options\n end", "title": "" }, { "docid": "2728bc067ebad27b416ae8942d300296", "score": "0.53132814", "text": "def default_configuration=(_arg0); end", "title": "" }, { "docid": "ca6ae5a7b9731372f2d3faf671774675", "score": "0.53036606", "text": "def moped_arguments\n [hosts, options]\n end", "title": "" }, { "docid": "102869594d46fe6479de4dcc05550854", "score": "0.53008294", "text": "def default_options\n DEFAULT_OPTIONS\n end", "title": "" }, { "docid": "d1052b05dc4860b87484070bd82d33f8", "score": "0.5298976", "text": "def default_options\n @default_options ||= {}\n end", "title": "" }, { "docid": "528bc157073e6b4b01d467a349ed8624", "score": "0.52982676", "text": "def command_line_params\n params = \"\"\n\n # Disallow password auth. We need to fail if no trusted key is set up.\n params += \"-o PasswordAuthentication=no \"\n\n # Disallow other keyoard-interactive auth methods.\n params += \"-o ChallengeResponseAuthentication=no \"\n\n # Automatically add unknown hosts to the \"known hosts\" file, without prompting.\n params += \"-o StrictHostKeyChecking=no \"\n\n # Also silence warnings since StrictHostKeyChecking=no always issues a warning\n params += \"-o LogLevel=ERROR \"\n\n if !@fail_on_host_changes\n # Ignore when the signature of a host changes. This usually happens when a machine is upgraded,\n # but could also happen due to man-in-the-middle attacks.\n params += \"-o UserKnownHostsFile=/dev/null \"\n end\n\n params\n end", "title": "" }, { "docid": "49d249977b959d1ec4e16e6e0382158e", "score": "0.5292655", "text": "def initialize(default_target, arguments)\n option_parser = OptionParser.new\n option_parser.on('--no-ivy') { @no_ivy = true }\n option_parser.on('--no-compile') { @no_compile = true }\n option_parser.on('--no-demo') { @no_demo = true }\n option_parser.on('--no-schema') { @no_schema = true }\n option_parser.on('--no-jre') { @no_jre = true }\n option_parser.on('--no-no') do \n @no_ivy = true\n @no_demo = true\n @no_schema = true\n end\n option_parser.on('--emma') do Registry[:emma] = true end\n \n @start_time = Time.now\n @basedir = FilePath.new(File.dirname(File.expand_path(__FILE__)), \"..\").canonicalize\n Registry[:basedir] = @basedir\n puts(\"Building with base directory: '#@basedir'.\")\n puts\n @default_target = default_target\n @ant = TerracottaAnt.new\n Registry[:ant] = @ant\n @platform = CrossPlatform.create_implementation(:ant => @ant)\n Registry[:platform] = @platform\n \n # The CommandLineConfigSource actually parses its arguments, and returns only the ones\n # that aren't configuration property settings (e.g., of the form 'a=b').\n arguments = option_parser.parse(arguments)\n @arguments, command_line_source = CommandLineConfigSource.from_args(arguments)\n @internal_config_source = InternalConfigSource.new\n Registry[:internal_config_source] = @internal_config_source\n @config_source = create_config_source(command_line_source, @internal_config_source)\n Registry[:config_source] = @config_source\n Registry[:command_line_config] = command_line_source\n\n @script_results = ScriptResults.new\n\n if Registry[:emma]\n Registry[:emma_home] = FilePath.new(@basedir.to_s, \"..\", \"..\", \"buildsystems\", \"emma-2.0.5312\").canonicalize.to_s\n fail(\"EMMA_HOME does not exist: #{Registry[:emma_home]}\") unless File.exists?(Registry[:emma_home])\n Registry[:emma_lib] = \"#{Registry[:emma_home]}/lib/emma.jar\"\n puts \"EMMA_HOME: #{Registry[:emma_home]}\"\n end\n\n # XXX: this is a hack to get around jruby script converting JAVA_HOME to unix path\n begin\n if `uname` =~ /CYGWIN/i\n ENV['JAVA_HOME'] = `cygpath -w #{ENV['JAVA_HOME']}`.strip\n end\n rescue\n # do nothing\n end\n\n reset\n end", "title": "" }, { "docid": "e9ff4695901e0326f81065a556012900", "score": "0.5288714", "text": "def optparse_args\n if short\n [\"--#{name}\", \"-#{short}\", desc, :REQUIRED]\n else\n [\"--#{name}\", desc, :REQUIRED]\n end\n end", "title": "" }, { "docid": "9521c08f0941a3ee66e762c52470dd70", "score": "0.5284916", "text": "def daemonopts()\n {\n :ontop => false,\n :backtrace => false,\n :dir_mode => :normal,\n :app_name => 'graphiteme',\n :dir => '/var/run/graphiteme/',\n :log_output => true,\n :log_dir => '/var/log/graphiteme/',\n }\nend", "title": "" }, { "docid": "2a5ec1f7fd2ae6d8e47a74849008e1b3", "score": "0.5270529", "text": "def default_envs\n {\n \"PATH\" => \"\"\n }\n end", "title": "" }, { "docid": "c3ac30e3424783497d9788ab11c837a9", "score": "0.5251907", "text": "def default_options\n { dir_mode: :normal, dir: File.expand_path('daemon', project.path),\n multiple: false, log_output: true }\n end", "title": "" }, { "docid": "785823bac69d935d6d595316d86e4adc", "score": "0.52379096", "text": "def extract_master_instance_options(options)\n extract_instance_options('master-', options)\n end", "title": "" }, { "docid": "46aca2e8428b42bed4eae5b4b082a182", "score": "0.5228958", "text": "def arguments\n args = OpenStudio::Ruleset::OSArgumentVector.new\n\n return args\n end", "title": "" }, { "docid": "5253e68dbe73de600809a2b0cf3d9db0", "score": "0.52283823", "text": "def required_defaults; end", "title": "" }, { "docid": "de8f2611b25bb7205af0697d675c3801", "score": "0.5228307", "text": "def x_set_command_options(context)\n defaults = { uuid: false }\n defaults.merge!(dry_run: true) if context.options.key?(:dry_run)\n defaults\n end", "title": "" }, { "docid": "12452c2b139e332c4240d4a238fe5e6c", "score": "0.5227603", "text": "def set_default_options(options)\n opts = options.dup\n\n extra_options = opts.delete(:extra_options)\n extra_options = DEFAULT_EXTRA_OPTIONS.merge(extra_options)\n\n has_timeout_string_arg = extra_options[:mongocryptd_spawn_args].any? do |elem|\n elem.is_a?(String) && elem.match(/\\A--idleShutdownTimeoutSecs=\\d+\\z/)\n end\n\n timeout_int_arg_idx = extra_options[:mongocryptd_spawn_args].index('--idleShutdownTimeoutSecs')\n has_timeout_int_arg = timeout_int_arg_idx && extra_options[:mongocryptd_spawn_args][timeout_int_arg_idx + 1].is_a?(Integer)\n\n unless has_timeout_string_arg || has_timeout_int_arg\n extra_options[:mongocryptd_spawn_args] << '--idleShutdownTimeoutSecs=60'\n end\n\n opts[:bypass_auto_encryption] ||= false\n\n opts.merge(extra_options)\n end", "title": "" }, { "docid": "85b9e1b8316f13947d6c7e017a00a431", "score": "0.5226772", "text": "def arguments()\n args = OpenStudio::Ruleset::OSArgumentVector.new\n\n # this measure will require arguments, but at this time, they are not known\n geometry_profile = OpenStudio::Ruleset::OSArgument::makeStringArgument('geometry_profile', true)\n geometry_profile.setDefaultValue(\"{}\")\n os_model = OpenStudio::Ruleset::OSArgument::makeStringArgument('os_model', true)\n os_model.setDefaultValue('multi-model mode')\n user_id = OpenStudio::Ruleset::OSArgument::makeStringArgument('user_id', true)\n user_id.setDefaultValue(\"00000000-0000-0000-0000-000000000000\")\n job_id = OpenStudio::Ruleset::OSArgument::makeStringArgument('job_id', true)\n #job_id.setDefaultValue(SecureRandom.uuid.to_s)\n ashrae_climate_zone = OpenStudio::Ruleset::OSArgument::makeStringArgument('ashrae_climate_zone', false)\n ashrae_climate_zone.setDefaultValue(\"-1\")\n building_type = OpenStudio::Ruleset::OSArgument::makeStringArgument('building_type', false)\n building_type.setDefaultValue(\"BadDefaultType\")\n\n args << geometry_profile\n args << os_model\n args << user_id\n args << job_id\n args << ashrae_climate_zone\n args << building_type\n\n return args\n end", "title": "" }, { "docid": "f6b0fdb041790a1eaf8990711812ef03", "score": "0.52218515", "text": "def default_options\n { }\n end", "title": "" }, { "docid": "328a6116c823d237891c0852a9e65feb", "score": "0.52187485", "text": "def default_values\n self.mode ||= 'challenge_quick'\n end", "title": "" }, { "docid": "c8862925a92ae32cd2bc450695f8a404", "score": "0.52178913", "text": "def default_parameters\n {}\n end", "title": "" }, { "docid": "5188d5c89d57262410e965467e53bbeb", "score": "0.5207413", "text": "def default_options\n @default_options ||= self.class.default_options\n end", "title": "" }, { "docid": "1b1eed9726503e2bdcd2fb36abc7125f", "score": "0.5205992", "text": "def default_opts\n { :default => default }.merge( opts )\n end", "title": "" }, { "docid": "e72a4bd0f56e00fe1b96f8ba817a59c4", "score": "0.5203822", "text": "def default_options\n {}\n end", "title": "" }, { "docid": "e72a4bd0f56e00fe1b96f8ba817a59c4", "score": "0.5203822", "text": "def default_options\n {}\n end", "title": "" }, { "docid": "e72a4bd0f56e00fe1b96f8ba817a59c4", "score": "0.5203822", "text": "def default_options\n {}\n end", "title": "" }, { "docid": "998f7ea0441f8b6ebd9ba7f9aba9ccc3", "score": "0.52034175", "text": "def arguments\n args = OpenStudio::Ruleset::OSArgumentVector.new\n\n # URL of the DEnCity server that will be posted to\n hostname = OpenStudio::Ruleset::OSArgument::makeStringArgument('hostname', true)\n hostname.setDisplayName('URL of the DEnCity Server')\n hostname.setDefaultValue('http://www.dencity.org')\n args << hostname\n\n # DEnCity server user id at hostname\n user_id = OpenStudio::Ruleset::OSArgument::makeStringArgument('user_id',true)\n user_id.setDisplayName('User ID for DEnCity Server')\n args << user_id\n\n # DEnCIty server user id's password\n auth_code = OpenStudio::Ruleset::OSArgument::makeStringArgument('auth_code', true)\n auth_code.setDisplayName('Authentication code for User ID on DEnCity server')\n args << auth_code\n\n # Building type for DEnCity's metadata\n building_type = OpenStudio::Ruleset::OSArgument::makeStringArgument('building_type', false)\n building_type.setDisplayName('Building type')\n args << building_type\n\n # HVAC system for DEnCity's metadata\n primary_hvac = OpenStudio::Ruleset::OSArgument::makeStringArgument('primary_hvac', false)\n primary_hvac.setDisplayName('Primary HVAC system in building')\n args << primary_hvac\n\n args\n\n end", "title": "" }, { "docid": "9a87a3d8402f85737895bf0d665b8359", "score": "0.5195711", "text": "def standard_args(options = {})\n args = []\n args.push('--username', options[:username]) if options.has_key?(:username)\n args.push('--password', options[:password]) if options.has_key?(:password)\n args.push('--no-auth-cache', '--non-interactive')\n\n args\n end", "title": "" }, { "docid": "8f70632e2965c00f2e8383fbc3871695", "score": "0.5191167", "text": "def arguments\n tailing_args = tailing_non_options\n\n if tailing_args.any? { |arg| arg[0,1] == '-' }\n tailing_args.unshift('--')\n end\n\n return leading_non_options + options + tailing_args\n end", "title": "" }, { "docid": "e8d9c0498f0d27595de059958380ca59", "score": "0.5190933", "text": "def defaults\n default_pass = 'demo'\n \n self.step ||= 0 # can be 0, 1, 2, 3 (done)\n @timerange ||= TimeRange.new(Date.today.strftime(\"%F\"), \"15:00\", \"18:00\")\n self.party_of ||= 'single'\n self.host ||= User.new( :completeness => 'discovery', :password => default_pass ) # can receive current_user from the controller\n self.friend ||= User.new( :completeness => 'invite' ) # only validate if it's a single date\n end", "title": "" }, { "docid": "89896f619f322984bf64a222a230325e", "score": "0.51879483", "text": "def options\n @options ||= args.dig(:options) || {}\n end", "title": "" }, { "docid": "61193043d389426a9eb5e97f826dce66", "score": "0.5187125", "text": "def default_options\n {}\n end", "title": "" }, { "docid": "498a244205f13a77d058fc020b3f9aa5", "score": "0.5183219", "text": "def sh_test_options\n {\n :cmd_pattern => '% ',\n :cmd => '2>&1 ',\n :indents => true,\n :env => {\n 'TAPFILE' => nil,\n 'TAP_GEMS' => nil, \n 'TAP_PATH' => nil,\n 'TAPENV' => nil,\n 'TAPRC' => nil,\n 'TAP_DEBUG' => nil\n },\n :replace_env => false\n }\n end", "title": "" }, { "docid": "7dd7230a056bff57168434fb7ec4c208", "score": "0.51802635", "text": "def default\n options[:default]\n end", "title": "" }, { "docid": "3ff97e5cc13702ba49c566f11e12f31c", "score": "0.5165239", "text": "def default_options\n option_type_config_for :default\n end", "title": "" }, { "docid": "60e6d351e7b087ac6a88e453d6b3e2ef", "score": "0.5165099", "text": "def masterfile_defaults\n {'seq_no' => 1}\n end", "title": "" }, { "docid": "292a67f9e47ee928b88ff0f072e2ae52", "score": "0.51625144", "text": "def initialize\n @argv_option = {}\n @config = {}\n end", "title": "" }, { "docid": "8729e91776739615a514d0b2ab1bb185", "score": "0.5152742", "text": "def arguments()\n args = OpenStudio::Ruleset::OSArgumentVector.new\n \n return args\n end", "title": "" }, { "docid": "8729e91776739615a514d0b2ab1bb185", "score": "0.5152742", "text": "def arguments()\n args = OpenStudio::Ruleset::OSArgumentVector.new\n \n return args\n end", "title": "" }, { "docid": "8729e91776739615a514d0b2ab1bb185", "score": "0.5152742", "text": "def arguments()\n args = OpenStudio::Ruleset::OSArgumentVector.new\n \n return args\n end", "title": "" }, { "docid": "8729e91776739615a514d0b2ab1bb185", "score": "0.5152742", "text": "def arguments()\n args = OpenStudio::Ruleset::OSArgumentVector.new\n \n return args\n end", "title": "" }, { "docid": "8729e91776739615a514d0b2ab1bb185", "score": "0.5152742", "text": "def arguments()\n args = OpenStudio::Ruleset::OSArgumentVector.new\n \n return args\n end", "title": "" }, { "docid": "8729e91776739615a514d0b2ab1bb185", "score": "0.5152742", "text": "def arguments()\n args = OpenStudio::Ruleset::OSArgumentVector.new\n \n return args\n end", "title": "" }, { "docid": "8729e91776739615a514d0b2ab1bb185", "score": "0.5152742", "text": "def arguments()\n args = OpenStudio::Ruleset::OSArgumentVector.new\n \n return args\n end", "title": "" } ]
c7f555b25a321a79387acef2a7617caf
same as the following
[ { "docid": "8e999419fd8f41c06a7a664f3b8f4795", "score": "0.0", "text": "def name=(value)\r\n @name = value\r\n end", "title": "" } ]
[ { "docid": "b6b2bcc0062aeb115edab7b10cbe6930", "score": "0.64513505", "text": "def desired; end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.64160514", "text": "def for; end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.64160514", "text": "def for; end", "title": "" }, { "docid": "3d45e3d988480e2a6905cd22f0936351", "score": "0.64160514", "text": "def for; end", "title": "" }, { "docid": "794a198d95cf296afde54486d8c4e262", "score": "0.6328871", "text": "def avail_out=(*) end", "title": "" }, { "docid": "3ae137b1a40ff3aae4f3cbb2b6082797", "score": "0.62845874", "text": "def reaper; end", "title": "" }, { "docid": "8d1d77531cce0d12539ad149eebad454", "score": "0.620277", "text": "def sub_from; end", "title": "" }, { "docid": "bc658f9936671408e02baa884ac86390", "score": "0.61095005", "text": "def anchored; end", "title": "" }, { "docid": "34112de52c0c813ee37be3cb2c235d6a", "score": "0.6096611", "text": "def apply; end", "title": "" }, { "docid": "34112de52c0c813ee37be3cb2c235d6a", "score": "0.6096611", "text": "def apply; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.60952723", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.60952723", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.60952723", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.60952723", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.60952723", "text": "def bodystmt; end", "title": "" }, { "docid": "9dcc74dd11eb115d21bf9af45b3ec4e3", "score": "0.60952723", "text": "def bodystmt; end", "title": "" }, { "docid": "1151221aa9457e5cad317e4fec922758", "score": "0.60948515", "text": "def adjugate; end", "title": "" }, { "docid": "3caf4c824a6d6a4a5616c13fcab418da", "score": "0.60862744", "text": "def applied; end", "title": "" }, { "docid": "b2557f4b5a7478d6609ae6316fc721fc", "score": "0.6041928", "text": "def first=(_arg0); end", "title": "" }, { "docid": "5ad7e5c7a147626a2b0a2c5956411be5", "score": "0.6008012", "text": "def r; end", "title": "" }, { "docid": "ed25ead5357c739085ed8a8e032480c6", "score": "0.600333", "text": "def result=(_arg0); end", "title": "" }, { "docid": "ed25ead5357c739085ed8a8e032480c6", "score": "0.600333", "text": "def result=(_arg0); end", "title": "" }, { "docid": "423ac542b3d6970c009a6aaf7edd41ba", "score": "0.6003068", "text": "def c2()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "c3c6627016db7a286479315cc543756e", "score": "0.5988031", "text": "def as; end", "title": "" }, { "docid": "18b70bef0b7cb44fc22c66bf7965c231", "score": "0.59541285", "text": "def first; end", "title": "" }, { "docid": "18b70bef0b7cb44fc22c66bf7965c231", "score": "0.59541285", "text": "def first; end", "title": "" }, { "docid": "18b70bef0b7cb44fc22c66bf7965c231", "score": "0.59541285", "text": "def first; end", "title": "" }, { "docid": "18b70bef0b7cb44fc22c66bf7965c231", "score": "0.59541285", "text": "def first; end", "title": "" }, { "docid": "3348909c0296e7fbe2cda8729aab1d01", "score": "0.5941272", "text": "def chain; end", "title": "" }, { "docid": "3348909c0296e7fbe2cda8729aab1d01", "score": "0.5941272", "text": "def chain; end", "title": "" }, { "docid": "67081eb3c98dc9ab87bd978f73a10e81", "score": "0.5939384", "text": "def advanced; end", "title": "" }, { "docid": "67081eb3c98dc9ab87bd978f73a10e81", "score": "0.5939384", "text": "def advanced; end", "title": "" }, { "docid": "b0524789c5daffa9bee39b4c8c981533", "score": "0.59335047", "text": "def ArgsForward; end", "title": "" }, { "docid": "99600866ec9ea9bbca1d3aec99d8f275", "score": "0.5906542", "text": "def %(other); end", "title": "" }, { "docid": "99600866ec9ea9bbca1d3aec99d8f275", "score": "0.5906542", "text": "def %(other); end", "title": "" }, { "docid": "b6857af3a1d9b377dda4c9c405164fe1", "score": "0.5899188", "text": "def reify=(_arg0); end", "title": "" }, { "docid": "b6857af3a1d9b377dda4c9c405164fe1", "score": "0.5899188", "text": "def reify=(_arg0); end", "title": "" }, { "docid": "b6857af3a1d9b377dda4c9c405164fe1", "score": "0.5899188", "text": "def reify=(_arg0); end", "title": "" }, { "docid": "22cedc7bf6749c5a730c17ddb7c38970", "score": "0.5897138", "text": "def used_by=(_arg0); end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.58805186", "text": "def operations; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.58805186", "text": "def operations; end", "title": "" }, { "docid": "a18186567d58d46fbcb43c48faf2ab4b", "score": "0.58765566", "text": "def apply\n\t\t\n\tend", "title": "" }, { "docid": "d4b51441e9803335f40f611467a77896", "score": "0.58750474", "text": "def returned; end", "title": "" }, { "docid": "d4b51441e9803335f40f611467a77896", "score": "0.58750474", "text": "def returned; end", "title": "" }, { "docid": "f08d07e5dae8099bbf64a6863af3e087", "score": "0.58745754", "text": "def result ; end", "title": "" }, { "docid": "8b3569b219e99d9eac85050822f6f885", "score": "0.58726007", "text": "def wrappers; end", "title": "" }, { "docid": "2fbd1141a5d3803251f00ea5c01e38ba", "score": "0.5871853", "text": "def extract; end", "title": "" }, { "docid": "2fbd1141a5d3803251f00ea5c01e38ba", "score": "0.5871853", "text": "def extract; end", "title": "" }, { "docid": "509b59dbf2b53df5bb3658b34205bbe1", "score": "0.58714443", "text": "def returns=(_arg0); end", "title": "" }, { "docid": "509b59dbf2b53df5bb3658b34205bbe1", "score": "0.58714443", "text": "def returns=(_arg0); end", "title": "" }, { "docid": "dd68931a1a7f77eb4fd41ce35988a9bb", "score": "0.5869036", "text": "def returns; end", "title": "" }, { "docid": "dd68931a1a7f77eb4fd41ce35988a9bb", "score": "0.5869036", "text": "def returns; end", "title": "" }, { "docid": "5ffd4221c0adbb90a19d26836dc1440b", "score": "0.5864553", "text": "def parter; end", "title": "" }, { "docid": "37cdba0f8108c8e03598feeca3770ded", "score": "0.5853989", "text": "def objectish; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.5847103", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.5847103", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.5847103", "text": "def wrapped; end", "title": "" }, { "docid": "c9dca2359e04038394b1c66d5d923fa2", "score": "0.5847103", "text": "def wrapped; end", "title": "" }, { "docid": "a85da9ffc9e840feb861c88b57059d1b", "score": "0.5834551", "text": "def results=(_arg0); end", "title": "" }, { "docid": "7ec57c3874853e50086febdbdd3221bf", "score": "0.582975", "text": "def wedding; end", "title": "" }, { "docid": "2db1c02e5bf64bf8ca50a541f2af194c", "score": "0.58270925", "text": "def for\n end", "title": "" }, { "docid": "43a971e329cee954335ed6841a881b8d", "score": "0.58262193", "text": "def result ; end", "title": "" }, { "docid": "0b7cffbc0c78b76d74504cb5a0e59c8e", "score": "0.5824776", "text": "def desired=(_arg0); end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "22eca42bc8ffb4cb933fefb36966d859", "score": "0.5816731", "text": "def call; end", "title": "" }, { "docid": "4e3972712201f930425a392caa47fcd3", "score": "0.58096", "text": "def composite?; end", "title": "" }, { "docid": "1b4413de58cb6f6f9e3ace21a40d26e7", "score": "0.58050716", "text": "def first_value=(_arg0); end", "title": "" }, { "docid": "a9dd648a5d0d2e7d56223e7c753f5e2e", "score": "0.5796871", "text": "def telegraphical()\n end", "title": "" }, { "docid": "941c49774ec326886981dd510f86e0bd", "score": "0.57908416", "text": "def out=(_arg0); end", "title": "" }, { "docid": "5c9ce12b396a1901aa5b7236d9b5e589", "score": "0.5785385", "text": "def next; end", "title": "" }, { "docid": "5c9ce12b396a1901aa5b7236d9b5e589", "score": "0.5785385", "text": "def next; end", "title": "" }, { "docid": "5c9ce12b396a1901aa5b7236d9b5e589", "score": "0.5785385", "text": "def next; end", "title": "" }, { "docid": "5c9ce12b396a1901aa5b7236d9b5e589", "score": "0.5785385", "text": "def next; end", "title": "" }, { "docid": "5c9ce12b396a1901aa5b7236d9b5e589", "score": "0.5785385", "text": "def next; end", "title": "" }, { "docid": "448787f3429a743cc160f05768c31150", "score": "0.5773149", "text": "def in_plain=(_arg0); end", "title": "" }, { "docid": "c66f3477911241684923f50f19928246", "score": "0.57641315", "text": "def d(*) end", "title": "" }, { "docid": "29a83735da59010f07e1633934837c20", "score": "0.57502556", "text": "def underconstruction\n end", "title": "" }, { "docid": "c3285b979f713395f60cf13edce8a310", "score": "0.5748351", "text": "def methodmissing; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.5747459", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.5747459", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.5747459", "text": "def from; end", "title": "" }, { "docid": "f1736df8e6642c2eeb78e4b30e5cf678", "score": "0.5747459", "text": "def from; end", "title": "" } ]
daa3527e63e0a283877feaa277fa08d1
DELETE /palliative_cares/1 DELETE /palliative_cares/1.json
[ { "docid": "3ed1e9c8c19554a1de3e0defe60394a4", "score": "0.6708026", "text": "def destroy\n @palliative_care.destroy\n respond_to do |format|\n format.html { redirect_to palliative_cares_url, notice: 'Palliative care was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "223cbf256c487232bc58c2b2af61d319", "score": "0.7136497", "text": "def destroy\n @causale = Causale.find(params[:id])\n @causale.destroy\n\n respond_to do |format|\n format.html { redirect_to causali_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e039c732859969b941534ea940f72d44", "score": "0.70001245", "text": "def destroy\n @trein_consul_comercial.destroy\n respond_to do |format|\n format.html { redirect_to trein_consul_comercials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d0034e48078cb5f7bc647a44aecebb88", "score": "0.6950375", "text": "def destroy\n @placa.destroy\n respond_to do |format|\n format.html { redirect_to placas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7994cd34350c65161ea797f91a3f5dbd", "score": "0.6909667", "text": "def destroy\n @chaine = Chaine.find(params[:id])\n @chaine.destroy\n\n respond_to do |format|\n format.html { redirect_to chaines_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9492b2f7003db43f1f66a210fe1d306d", "score": "0.690415", "text": "def destroy\n @causal.destroy\n respond_to do |format|\n format.html { redirect_to causals_url, notice: 'Causal was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "96e91674f8b54db13acedffa13601f1a", "score": "0.6888258", "text": "def destroy\n @caballo = Caballo.find(params[:id])\n @caballo.destroy\n\n respond_to do |format|\n format.html { redirect_to caballos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4c1c164b581dbae14285797e584e8fb7", "score": "0.6887301", "text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "c19e2d294f404f937a3d1d2046f59649", "score": "0.68827116", "text": "def destroy\n #@clinica.destroy\n @clinica.update(:status => 0)\n respond_to do |format|\n format.html { redirect_to clinicas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "47aa5d34308db5f7ea511b1114d2fb03", "score": "0.6875783", "text": "def destroy\n @cage.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4c18ec9d1d02e6f9d7481d6a0814212a", "score": "0.686492", "text": "def destroy\n @capacidad = Capacidad.find(params[:id])\n @capacidad.destroy\n\n respond_to do |format|\n format.html { redirect_to capacidades_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9474797ec0039fab575cd3e8c6b9a2a2", "score": "0.68560714", "text": "def destroy\n @areco = Areco.find(params[:id])\n @areco.destroy\n\n respond_to do |format|\n format.html { redirect_to arecos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fc87583554a6949eb6a5b863604fc2d4", "score": "0.68450433", "text": "def destroy\n @colegio = Colegio.find(params[:id])\n @colegio.destroy\n\n respond_to do |format|\n format.html { redirect_to colegios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "09fc2820d9479cac0697e20c559268bf", "score": "0.6844143", "text": "def delete\n render json: Alien.delete(params[\"id\"])\n end", "title": "" }, { "docid": "107c29753ab5025d8005392590ea7a47", "score": "0.6841969", "text": "def destroy\n @cta.destroy\n respond_to do |format|\n format.html { redirect_to cta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d1d4ffa3295b3ac337c5f1e8d2a5073b", "score": "0.68412584", "text": "def destroy\n @capa = Capa.find(params[:id])\n @capa.destroy\n\n respond_to do |format|\n format.html { redirect_to capas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "afdc071209b6a40a43bf01176e7ead6c", "score": "0.68293655", "text": "def destroy\n @aucrecord.destroy\n respond_to do |format|\n format.html { redirect_to aucrecords_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8489c8446c66c1f9a6784d1bedf694e5", "score": "0.68235356", "text": "def destroy\n @cta = Cta.find(params[:id])\n @cta.destroy\n\n respond_to do |format|\n format.html { redirect_to ctas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c6d264050952b86e3aa9674d2ca92712", "score": "0.6820365", "text": "def destroy\n @prueba_json.destroy\n respond_to do |format|\n format.html { redirect_to prueba_jsons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "af20089172da00f6903c1e07d7a88ee8", "score": "0.68093103", "text": "def destroy\n @cadet = Cadet.find(params[:id])\n @cadet.destroy\n\n respond_to do |format|\n format.html { redirect_to cadets_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8677716483d0118472aa081318f26546", "score": "0.68041086", "text": "def destroy\n @persona = Persona.find(params[:id])\n @persona.destroy\n\n respond_to do |format|\n format.json { head :ok }\n end\n \n end", "title": "" }, { "docid": "d1f0a8e8c97a0438790f1ddeeecaca29", "score": "0.6799934", "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": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.67868906", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "5d85c88ba00cfdc05fe4809ae8504f84", "score": "0.6784323", "text": "def destroy\n @arcone = Arcone.find(params[:id])\n @arcone.destroy\n\n respond_to do |format|\n format.html { redirect_to arcones_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b39a03413d606391c52e7c71e957a049", "score": "0.67821735", "text": "def delete\n render json: Company.delete(params[\"id\"])\n end", "title": "" }, { "docid": "8b5c7867755f9bb30a97a34f8bc2c77a", "score": "0.67777294", "text": "def destroy\n @caixa = Caixa.find(params[:id])\n @caixa.destroy\n\n respond_to do |format|\n format.html { redirect_to caixas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f99cc7c873b72bd764431b79fbf76884", "score": "0.677045", "text": "def destroy\n @ca.destroy\n respond_to do |format|\n format.html { redirect_to cas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ac4b5e7332efc21f0e25a63ae6f35541", "score": "0.67634654", "text": "def destroy\n @cerveja = Cerveja.find(params[:id])\n @cerveja.destroy\n\n respond_to do |format|\n format.html { redirect_to cervejas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9cc225ccfdb93dcfd144b72dd30e3256", "score": "0.6752664", "text": "def destroy\n @respuesta = Respuesta.find(params[:id])\n @respuesta.destroy\n\n respond_to do |format|\n format.html { redirect_to respuestas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e5799f918c829d2d7fa613a33caa5b05", "score": "0.67513543", "text": "def destroy\n @pharmacy.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b9953da7041b3362d4494ee4f0e4419b", "score": "0.674954", "text": "def destroy\n @palabra = Palabra.find(params[:id])\n @palabra.destroy\n\n respond_to do |format|\n format.html { redirect_to palabras_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f8ec51d1d5d828ec0c2e2d9eebeb6a17", "score": "0.674759", "text": "def destroy\n @asignatura.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3602fb8ee6a7fb1b3d82951f29bef397", "score": "0.67461383", "text": "def destroy\n @ca = Ca.find(params[:id])\n @ca.destroy\n\n respond_to do |format|\n format.html { redirect_to cas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0cbf2af0c2d7558d11cc96bd45a56ce7", "score": "0.67435384", "text": "def destroy\n @retroaspecto = Retroaspecto.find(params[:id])\n @retroaspecto.destroy\n\n respond_to do |format|\n format.html { redirect_to retroaspectos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6c31addf5595e71a9f7c54d58e08025b", "score": "0.67412114", "text": "def destroy\n @capacitacion = Capacitacion.find(params[:id])\n @capacitacion.destroy\n\n respond_to do |format|\n format.html { redirect_to capacitacions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0b60036da479289e75c835b8ff60b5a3", "score": "0.6736539", "text": "def destroy\n \n @lancamentorapido = Lancamentorapido.find(params[:id])\n @lancamentorapido.destroy \n\n respond_to do |format|\n format.html { redirect_to lancamentorapidos_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fef2606f50dcde1ae10608961836063b", "score": "0.67330545", "text": "def destroy\n @cadavre = Cadavre.find(params[:id])\n @cadavre.destroy\n\n respond_to do |format|\n format.html { redirect_to cadavres_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9415bf442002d5149d7e11f65dea9471", "score": "0.6729806", "text": "def destroy\n @cargaplantilla.destroy\n respond_to do |format|\n format.html { redirect_to cargaplantillas_url, notice: 'Cargaplantilla was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5983cf08e328ca37887469d3eb835e73", "score": "0.6729711", "text": "def destroy\n @apuesta_detail = ApuestaDetail.find(params[:id])\n @apuesta_detail.destroy\n\n respond_to do |format|\n format.html { redirect_to apuesta_details_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c05bba7ca7bec6cf16eb3625edc81b85", "score": "0.67240167", "text": "def destroy\n @retroalimentacion = Retroalimentacion.find(params[:id])\n @retroalimentacion.destroy\n\n respond_to do |format|\n format.html { redirect_to retroalimentacions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ef098bd4943c1a86b17e1b39b89662e3", "score": "0.67114407", "text": "def destroy\n @capacidad.destroy\n respond_to do |format|\n format.html { redirect_to capacidads_url, notice: 'Capacidad was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "285249ffa936b5fa92a35ea4c7f7d863", "score": "0.67048913", "text": "def destroy\n @fulcliente = Fulcliente.find(params[:id])\n @fulcliente.destroy\n\n respond_to do |format|\n format.html { redirect_to fulclientes_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "c2c236861938ad294788a28f3ca2e0ad", "score": "0.670154", "text": "def destroy\n @accolaid.destroy\n respond_to do |format|\n format.html { redirect_to accolaids_url, notice: 'Accolaid was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8e7e3fea4c5b81973a094c307fcec8c1", "score": "0.6700793", "text": "def destroy\n @ruby.destroy\n respond_to do |format|\n format.html { redirect_to rubies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "193e2d8be0ddccca592d7e4b3aae705d", "score": "0.6700017", "text": "def destroy\r\n @sivic_celula.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_celulas_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "e4e53ce68b99e6e94d55e8c86daebcb3", "score": "0.66980666", "text": "def destroy\n @small_concert.destroy\n respond_to do |format|\n format.html { redirect_to '/admin/small_concerts' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8047b555dba29af3009c094024fb7f0f", "score": "0.66918546", "text": "def destroy\n @repa = Repa.find(params[:id])\n @repa.destroy\n\n respond_to do |format|\n format.html { redirect_to repas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8047b555dba29af3009c094024fb7f0f", "score": "0.66918546", "text": "def destroy\n @repa = Repa.find(params[:id])\n @repa.destroy\n\n respond_to do |format|\n format.html { redirect_to repas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e79f7eb39e8696b8a06918d23bb1caf8", "score": "0.6688212", "text": "def destroy\n @couch.destroy\n respond_to do |format|\n format.html { redirect_to couches_url, notice: 'Couche was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b0876f93b091bb0c281a1a5a8d03bab9", "score": "0.66867334", "text": "def destroy\n @cervejaria = Cervejaria.find(params[:id])\n @cervejaria.destroy\n\n respond_to do |format|\n format.html { redirect_to cervejarias_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e48eb4357c7abf088ed82be843c6beb2", "score": "0.6675034", "text": "def destroy\n @factura = Factura.find(params[:factura_id])\n @renglon_factura = @factura.renglon_facturas.find(params[:id]).destroy\n\n respond_to do |format|\n format.html { head :ok }\n #format.json { head :ok }\n end\n end", "title": "" }, { "docid": "b6e8593bd79540bbf009e8a38561c0b2", "score": "0.6670893", "text": "def destroy\n @ramal = Ramal.find(params[:id])\n @ramal.destroy\n\n respond_to do |format|\n format.html { redirect_to ramais_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ef6d2493918edb8769dbadeb9a538e24", "score": "0.66646934", "text": "def destroy\n @contestant = Contestant.find(params[:id])\n @contestant.destroy\n\n respond_to do |format|\n format.html { redirect_to contestants_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "309e35bcaf69927ef8d52e35cc2f9c07", "score": "0.66613793", "text": "def destroy\n @apologetic.destroy\n respond_to do |format|\n format.html { redirect_to apologetics_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1b328e979b3d1e6a3cbe920dccb8d340", "score": "0.66540426", "text": "def destroy\n @aactio = Aactio.find(params[:id])\n @aactio.destroy\n\n respond_to do |format|\n format.html { redirect_to aactios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "73b267982c52285afc2135b9c331649d", "score": "0.6650266", "text": "def destroy\n @cafeterium.destroy\n respond_to do |format|\n format.html { redirect_to cafeteria_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f2e231e14a0aaac81a5d02937b69e56b", "score": "0.66427517", "text": "def destroy\n @agronomiaquimica = Agronomiaquimica.find(params[:id])\n @agronomiaquimica.destroy\n\n respond_to do |format|\n format.html { redirect_to agronomiaquimicas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fb622696b3cadaef2a0d459cf3572785", "score": "0.66403115", "text": "def destroy\n client=Client.find_by_id(params[:id])\n if client != nil\n if client.destroy\n head 204\n end\n else\n head 404\n end\n end", "title": "" }, { "docid": "5f73192c2e615d66100aeab22c2b2202", "score": "0.66390204", "text": "def destroy\n @contum = Contum.find(params[:id])\n @contum.destroy\n\n respond_to do |format|\n format.html { redirect_to conta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c77c20147b142d0eb3583c2c2b4e1695", "score": "0.6638326", "text": "def destroy\n resource.destroy\n render json: {success: true}, status: :ok\n end", "title": "" }, { "docid": "c77c20147b142d0eb3583c2c2b4e1695", "score": "0.6638326", "text": "def destroy\n resource.destroy\n render json: {success: true}, status: :ok\n end", "title": "" }, { "docid": "66943064aa14fed107b111e3e9a3f72c", "score": "0.66360915", "text": "def destroy\n @precio_paquete.destroy\n respond_to do |format|\n format.html { redirect_to precio_paquetes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a70d465f196378c246d3875b58d7356e", "score": "0.663134", "text": "def destroy\n @vachana = Vachana.find(params[:id])\n @vachana.destroy\n\n respond_to do |format|\n format.html { redirect_to vachanas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a70d465f196378c246d3875b58d7356e", "score": "0.663134", "text": "def destroy\n @vachana = Vachana.find(params[:id])\n @vachana.destroy\n\n respond_to do |format|\n format.html { redirect_to vachanas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "483a165b7d4680f239fa0d796513d6ee", "score": "0.66311693", "text": "def destroy\n @cla.destroy\n respond_to do |format|\n format.html { redirect_to clas_path, notice: 'Test was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7bdf2953bfa73dd7073f73849c5ef462", "score": "0.66308415", "text": "def destroy\n @golf_cource = GolfCource.find(params[:id])\n @golf_cource.destroy\n\n respond_to do |format|\n format.html { redirect_to scaffold_golf_cources_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "97e646bdc85a9fcc8afa5822f7408346", "score": "0.6628686", "text": "def destroy\n @advocacy = Advocacy.find(params[:id])\n @advocacy.destroy\n\n respond_to do |format|\n format.html { redirect_to advocacies_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "4bf4dbb1d9d9ea3ce10d09ccb64da3be", "score": "0.66286063", "text": "def destroy\n @cargo_eleicao = CargoEleicao.find(params[:id])\n @cargo_eleicao.destroy\n\n respond_to do |format|\n format.html { redirect_to cargo_eleicaos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "324cf12f179ccb9cc67b76959878f3be", "score": "0.6628116", "text": "def destroy\n @uchronia = Uchronia.find(params[:id])\n @uchronia.destroy\n\n respond_to do |format|\n format.html { redirect_to uchronias_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3eb89249d91140e32f260598630f7aaf", "score": "0.66228443", "text": "def destroy\n @escola = Escola.find(params[:id])\n @escola.destroy\n\n respond_to do |format|\n format.html { redirect_to escolas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dd2645fbfeaf6a3cb2cbe352eb6a2991", "score": "0.66222507", "text": "def destroy\n @causa.destroy\n respond_to do |format|\n format.html { redirect_to causas_url, notice: 'Causa was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0273561097dfcb5a1ef32656dd0f373f", "score": "0.6622038", "text": "def destroy\n @palabras_clafe = PalabrasClave.find(params[:id])\n @palabras_clafe.destroy\n\n respond_to do |format|\n format.html { redirect_to palabras_claves_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e4f9e6879797bafde20a1b75d3289165", "score": "0.662087", "text": "def destroy\n @accolade.destroy\n respond_to do |format|\n format.html { redirect_to accolades_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9409a090e3ab8b8370317c67f249383b", "score": "0.6617608", "text": "def destroy\n @cancha = Cancha.find(params[:id])\n @cancha.destroy\n\n respond_to do |format|\n format.html { redirect_to canchas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "880bedbc317151bfec57037dcbba03e3", "score": "0.6615406", "text": "def destroy\n @resa.destroy\n respond_to do |format|\n format.html { redirect_to resas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9521bbf9303247dd8a055251f5981726", "score": "0.6613997", "text": "def destroy\n @paciente = Paciente.find(params[:id])\n @paciente.destroy\n\n respond_to do |format|\n format.html { redirect_to paciente_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "99170eef19af4181242a1be4bd8d71ab", "score": "0.6612552", "text": "def destroy\n @humanidades1 = Humanidades1.find(params[:id])\n @humanidades1.destroy\n\n respond_to do |format|\n format.html { redirect_to humanidades1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8fbe802377b326723edfe3357d33ca99", "score": "0.66123", "text": "def destroy\r\n @sivic_contabanco.destroy\r\n respond_to do |format|\r\n format.html { redirect_to sivic_contabancos_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "b5d00529f64878033f28156e8d276598", "score": "0.66115904", "text": "def destroy\n @historial = Historial.find(params[:id])\n @historial.destroy\n\n respond_to do |format|\n format.html { redirect_to historials_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "51530da35f452ddd8ba842afba361e48", "score": "0.66112864", "text": "def destroy\n @atracao = Atracao.find(params[:id])\n @atracao.destroy\n\n respond_to do |format|\n format.html { redirect_to atracaos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "628cc739011e7ac0e64d8e6d148c8e2a", "score": "0.6609927", "text": "def destroy\n @relogio = Relogio.find(params[:id])\n @relogio.destroy\n\n respond_to do |format|\n format.html { redirect_to relogios_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "1cea73e0aa0295c5512110d20c98828f", "score": "0.66091686", "text": "def destroy\n @consumo = Consumo.find(params[:id])\n @consumo.destroy\n\n respond_to do |format|\n format.html { redirect_to consumos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4688178cb09a3859cd43c68f1e096230", "score": "0.6606876", "text": "def destroy\n @contacter = Contacter.find(params[:id])\n @contacter.destroy\n\n respond_to do |format|\n format.html { redirect_to contacters_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e7b7c15b7943ee79f89611aeef85d4db", "score": "0.66056484", "text": "def destroy\n @analise.destroy\n respond_to do |format|\n format.html { redirect_to analises_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4a83701cdbc0b6c37938f437d57ab68b", "score": "0.6605645", "text": "def destroy\n @cict.destroy\n respond_to do |format|\n format.html { redirect_to cicts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e8854d3cc24ef61f3df4d34bce8c093b", "score": "0.6604712", "text": "def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e8854d3cc24ef61f3df4d34bce8c093b", "score": "0.6604712", "text": "def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e8854d3cc24ef61f3df4d34bce8c093b", "score": "0.6604712", "text": "def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "06395e1df58fcb33319261c74d6e4b1e", "score": "0.6602822", "text": "def destroy\n @coisa = Coisa.find(params[:id])\n @coisa.destroy\n\n respond_to do |format|\n format.html { redirect_to coisas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b9f768b3abe1fcbd97780b9cae2ebf89", "score": "0.6602816", "text": "def destroy\n @cliente = Cliente.find(params[:id])\n @cliente.destroy\n\n respond_to do |format|\n format.html { redirect_to clientes_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "7ec298caa29fe20a8b3e075fa233c0ef", "score": "0.6602145", "text": "def destroy\n # @observation = Observation.find(params[:id])\n # @observation.destroy\n\n @coral = Coral.find(params[:coral_id])\n @observation = @coral.observations.find(params[:id])\n @observation.destroy\n # redirect_to coral_path(@coral)\n \n respond_to do |format|\n format.html { redirect_to coral_path(@coral) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "814cf289b67a140ab391a7bcd37f1f39", "score": "0.6601222", "text": "def destroy\n @plannegocio = Plannegocio.find(params[:id])\n @plannegocio.destroy\n\n respond_to do |format|\n format.html { redirect_to plannegocios_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fa177fc0190b3a49b9123752c51ef116", "score": "0.66004574", "text": "def destroy\n @pacient.destroy\n respond_to do |format|\n format.html { redirect_to pacients_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9639be13b4b12daacd48e6a27d939a78", "score": "0.6598734", "text": "def destroy\n @cake = Cake.find(params[:id])\n @cake.destroy\n\n respond_to do |format|\n format.html { redirect_to cakes_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e0e772a4e1cfaa15747b976ee2a0ba66", "score": "0.65916306", "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": "d65bb4419dd186abfe35a21c78c21be2", "score": "0.6590046", "text": "def destroy\n @alola.destroy\n respond_to do |format|\n format.html { redirect_to alolas_url, notice: 'Alola was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "72ac27a7d3c22d92045e3a96b3178ab6", "score": "0.6588213", "text": "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "72ac27a7d3c22d92045e3a96b3178ab6", "score": "0.6588213", "text": "def destroy\n @asignatura = Asignatura.find(params[:id])\n @asignatura.destroy\n\n respond_to do |format|\n format.html { redirect_to asignaturas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "928ffdbc7c4fc5be4b3bc4ef34ae4732", "score": "0.6585054", "text": "def destroy\n @cegonha = Cegonha.find(params[:id])\n @cegonha.destroy\n\n respond_to do |format|\n format.html { redirect_to cegonhas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0e70ebe26219522c6ec4dffc55a5582f", "score": "0.6581929", "text": "def destroy\n @recipy = Recipy.find(params[:id])\n @recipy.destroy\n\n respond_to do |format|\n format.html { redirect_to recipies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4c77c5889acca6eecdf2753c1b9c806e", "score": "0.6581238", "text": "def destroy\n @carrera = Carrera.find(params[:id])\n @carrera.destroy\n\n respond_to do |format|\n format.html { redirect_to carreras_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
1fd95aa6b9286e1777f711112d229b65
GET /user_authors/new GET /user_authors/new.json
[ { "docid": "a66f9c295c34da37e6d524a677535611", "score": "0.78689355", "text": "def new\n @user_author = UserAuthor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_author }\n end\n end", "title": "" } ]
[ { "docid": "e7e258e8fe044feb9f812a94a0a12bad", "score": "0.7717221", "text": "def new\n @author = Author.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @author }\n end\n end", "title": "" }, { "docid": "5119fd77183ed6840d7dacf4e176e1e6", "score": "0.7678933", "text": "def new\n @author = Author.new\n render json: @author\n end", "title": "" }, { "docid": "217862b221ba8db619a53b5d71c775bb", "score": "0.76714915", "text": "def new\n @author = Author.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @author }\n end\n end", "title": "" }, { "docid": "d648ba9eccff2210b1b54d6473884359", "score": "0.7656168", "text": "def new\n\t\t@author = Author.new\n\n\t\trespond_to do |format|\n\t\t\tformat.html # new.html.erb\n\t\t\tformat.json { render json: @author }\n\t\tend\n\tend", "title": "" }, { "docid": "fa4c17aaede2d1a133529ab16406adad", "score": "0.7572818", "text": "def new\n @author = Author.new\n @page_title = \"New Author\"\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @author }\n end\n end", "title": "" }, { "docid": "2872311b62db28b953134ecc64526897", "score": "0.73118126", "text": "def new\n @author = Author.new\n \n standard_response @author\n end", "title": "" }, { "docid": "b91ea5e8d56924648c0601493fba4441", "score": "0.72775716", "text": "def new\n @author = Author.new\n\n respond_to do |format|\n format.html # form.html.erb\n format.json { render json: @author }\n end\n end", "title": "" }, { "docid": "d34461d6f692b365197dee64ddd7b744", "score": "0.72467494", "text": "def create\n @author = Author.new(params[:author])\n\n render json: @author\n end", "title": "" }, { "docid": "ccd876f0db0ff05268d1769f3841c4e2", "score": "0.7235038", "text": "def create\n\t\t@author = Author.new(author_params)\n\t\t@author.user_id = current_user.id\n\t\trespond_to do |format|\n\t\t\tif @author.save\n\t\t\t\t@authors= Author.where(\"user_id = ?\", current_user.id).order(\"name\")\n\t\t\t\t@authors = @authors.paginate(page: params[:page], per_page: 18)\n\t\t\t\tformat.html { redirect_to @author; flash[:success]= \"Author was successfully created.\" }\n\t\t\t\tformat.json { render :show, status: :created, location: @author }\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: @author.errors, status: :unprocessable_entity }\n\t\t\t\tformat.js\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "d3753c671f4ad81bc5541c8fdfda55c1", "score": "0.7145367", "text": "def new\n @creator = Creator.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @creator }\n end\n end", "title": "" }, { "docid": "4b4776127dda4edc2436243b32900d49", "score": "0.7134606", "text": "def new\n @template_author = TemplateAuthor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @template_author }\n end\n end", "title": "" }, { "docid": "8f4e0bf7c70c57152ad47a9e791dbfed", "score": "0.70911646", "text": "def create\n @author = Author.new(author_params)\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to authors_url, notice: I18n.t(:author_created_successfully) }\n format.json { render json: Author.all.order(:surname), status: :created }\n else\n format.html { render action: 'new' }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1c0e19fbff21ac58bd6adc319732f5b6", "score": "0.70457184", "text": "def new\n @authorbook = Authorbook.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @authorbook }\n end\n end", "title": "" }, { "docid": "405af40c57424a161e934289685d6fe2", "score": "0.7027667", "text": "def create\n @user_author = UserAuthor.new(params[:user_author])\n\n respond_to do |format|\n if @user_author.save\n format.html { redirect_to @user_author, notice: 'User author was successfully created.' }\n format.json { render json: @user_author, status: :created, location: @user_author }\n else\n format.html { render action: \"new\" }\n format.json { render json: @user_author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "84fef81366db9035e3fb44a747f452f4", "score": "0.7023944", "text": "def create\n @author = @account.authors.find_or_initialize_by_name(params[:author])\n \n respond_to do |format|\n if @author.save\n format.json { render :json => @author, :status => :created }\n end\n end\n end", "title": "" }, { "docid": "a31ac873d7fbdc00ca8a51008941901d", "score": "0.70030224", "text": "def create\n @author = Author.new(params[:author])\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to @author, notice: 'author was successfully created.' }\n format.json { render json: @author, status: :created, location: @author }\n else\n format.html { render action: 'new' }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0607a36bd7e184c8457e5162b18945c", "score": "0.69987047", "text": "def new\n @contributor = Contributor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contributor }\n end\n end", "title": "" }, { "docid": "c087571a1043f4bc55fefc3968b75004", "score": "0.69864315", "text": "def new\n @contributor = Contributor.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contributor }\n end\n end", "title": "" }, { "docid": "09a93fc8995f46e48c05cf9542c1d656", "score": "0.69286144", "text": "def new\n @author = Author.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @author }\n end\n end", "title": "" }, { "docid": "0ce9bd4f1527e5bcbd1435832fb35be1", "score": "0.69285214", "text": "def new\n @author = Author.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @author }\n end\n end", "title": "" }, { "docid": "ae1752ce48af06dc66f752335bb85e4f", "score": "0.6904336", "text": "def new\n @author = Author.new\n end", "title": "" }, { "docid": "ae1752ce48af06dc66f752335bb85e4f", "score": "0.6904336", "text": "def new\n @author = Author.new\n end", "title": "" }, { "docid": "ae1752ce48af06dc66f752335bb85e4f", "score": "0.6904336", "text": "def new\n @author = Author.new\n end", "title": "" }, { "docid": "ae1752ce48af06dc66f752335bb85e4f", "score": "0.6904336", "text": "def new\n @author = Author.new\n end", "title": "" }, { "docid": "ae1752ce48af06dc66f752335bb85e4f", "score": "0.6904336", "text": "def new\n @author = Author.new\n end", "title": "" }, { "docid": "6f611c32374dcee9188ecebccca6fc1a", "score": "0.69025457", "text": "def new\n @post = current_author.posts.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "5bb319c04f40a59e581b066099c75c7f", "score": "0.6895285", "text": "def create\n @author = Author.new(params[:author])\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to painel_author_path(@author), :notice => 'Author was successfully created.' }\n format.json { render :json => @author, :status => :created, :location => @author }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @author.errors , :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "37864df2770d888d7bc7491a165c33da", "score": "0.68769044", "text": "def create\n respond_to do |format|\n if @author.save\n format.html { redirect_to @author, notice: 'Author was successfully created.' }\n format.json { render json: @author, status: :created, location: @author }\n else\n format.html { render action: \"new\" }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e01484527395b59a0aaa30dac1d1302c", "score": "0.6868563", "text": "def new\n @author_role = AuthorRole.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @author_role }\n end\n end", "title": "" }, { "docid": "a7d4fbb128dea5ccadf045cbe9cf5f5f", "score": "0.6855518", "text": "def create\n @author = Author.new(author_params)\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to @author, notice: 'Author was successfully created.' }\n format.json { render action: 'show', status: :created, location: @author }\n else\n format.html { render action: 'new' }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "002e2743dfe9ee218250641a1a49b0b6", "score": "0.68487877", "text": "def create\n @author = Author.new(params[:author])\n\n add_missing_translation_content(@author.author_translations)\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to admin_authors_path, notice: t('app.msgs.success_created', :obj => t('activerecord.models.author')) }\n format.json { render json: @author, status: :created, location: @author }\n else\n format.html { render action: \"new\" }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a01fd82838fe9274da6cf0610724bda4", "score": "0.68227524", "text": "def create\n @author = Author.new(author_params)\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to @author, notice: 'Author was successfully created.' }\n format.json { render :show, status: :created, location: @author }\n else\n format.html { render :new }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a01fd82838fe9274da6cf0610724bda4", "score": "0.68227524", "text": "def create\n @author = Author.new(author_params)\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to @author, notice: 'Author was successfully created.' }\n format.json { render :show, status: :created, location: @author }\n else\n format.html { render :new }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a01fd82838fe9274da6cf0610724bda4", "score": "0.68227524", "text": "def create\n @author = Author.new(author_params)\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to @author, notice: 'Author was successfully created.' }\n format.json { render :show, status: :created, location: @author }\n else\n format.html { render :new }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a01fd82838fe9274da6cf0610724bda4", "score": "0.68227524", "text": "def create\n @author = Author.new(author_params)\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to @author, notice: 'Author was successfully created.' }\n format.json { render :show, status: :created, location: @author }\n else\n format.html { render :new }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a01fd82838fe9274da6cf0610724bda4", "score": "0.68227524", "text": "def create\n @author = Author.new(author_params)\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to @author, notice: 'Author was successfully created.' }\n format.json { render :show, status: :created, location: @author }\n else\n format.html { render :new }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a01fd82838fe9274da6cf0610724bda4", "score": "0.68227524", "text": "def create\n @author = Author.new(author_params)\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to @author, notice: 'Author was successfully created.' }\n format.json { render :show, status: :created, location: @author }\n else\n format.html { render :new }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a01fd82838fe9274da6cf0610724bda4", "score": "0.68227524", "text": "def create\n @author = Author.new(author_params)\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to @author, notice: 'Author was successfully created.' }\n format.json { render :show, status: :created, location: @author }\n else\n format.html { render :new }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4c41dfe1b751c048ac2e39c47bcfcf3a", "score": "0.68041015", "text": "def create\n @author = Author.new(author_params)\n\n if @author.save\n render :show, status: :created, location: @author\n else\n render json: @author.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "14c75eb46087fed6f6d09c17533ffe6f", "score": "0.6784466", "text": "def create\n @author = Author.new(author_params)\n\n respond_to do |format|\n\n @author.updated_by = get_user_id\n\n if @author.save\n format.html { redirect_to authors_url, notice: '作者情報を登録しました。' }\n format.json { render :index, status: :created, location: @author }\n else\n format.html { render :new }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "84e31928ae298f3bb183500fa39d6653", "score": "0.67812127", "text": "def create\n @author = Author.new(author_params)\n\n if @author.save\n render json: @author, status: :created, location: @author\n else\n render json: @author.errors, status: :unprocessable_entity\n end\n\n end", "title": "" }, { "docid": "4376a769296d3f3829a63ba31584c1b5", "score": "0.6780731", "text": "def new\n @admin_template_author = TemplateAuthor.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_template_author }\n end\n end", "title": "" }, { "docid": "cb5c6a0acbf76d6924356273d7a1077e", "score": "0.67755467", "text": "def new\n @autor = Autor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @autor }\n end\n end", "title": "" }, { "docid": "fe154194cfc36e2126dc811dd8a271bd", "score": "0.67474216", "text": "def new\n @contributor_name = ContributorName.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contributor_name }\n end\n end", "title": "" }, { "docid": "238674ef1d7674c7b76121c5dff72960", "score": "0.67470646", "text": "def new\n @user = current_user\n @feed = Feed.new\n @feed.build_author\n respond_to do |format|\n format.html {render :layout => 'standard'}\n format.json { render json: @feed }\n end\n end", "title": "" }, { "docid": "8e052151112154e4d4a4553e8961d7dd", "score": "0.6744919", "text": "def new\n @author = Author.new\n @countries = Country.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @author }\n end\n end", "title": "" }, { "docid": "077116456138518e59bbdbfbc44cea36", "score": "0.6737685", "text": "def create\n @author = Author.new(params[:author])\n respond_to do |format|\n if @author.save\n format.html { redirect_to author_url(@author) }\n format.xml { head :created, :location => author_url(@author) }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @author.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "a2b18b32958423da48f2c7202e94c4b9", "score": "0.673582", "text": "def create\n @author = Author.new(author_params)\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to(authors_url,\n :notice => 'Author was successfully created.') }\n format.xml { render :xml => @author, :status => :created, :location => @author }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @author.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "befa5f938ee76fb90c2c0f55792779f2", "score": "0.67203766", "text": "def new\n @name_author = NameAuthor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @name_author }\n end\n end", "title": "" }, { "docid": "373545daae8b16948dff5f2341bd4641", "score": "0.6716215", "text": "def new\n @owner = Owner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @owner }\n end\n end", "title": "" }, { "docid": "373545daae8b16948dff5f2341bd4641", "score": "0.6716215", "text": "def new\n @owner = Owner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @owner }\n end\n end", "title": "" }, { "docid": "373545daae8b16948dff5f2341bd4641", "score": "0.6716215", "text": "def new\n @owner = Owner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @owner }\n end\n end", "title": "" }, { "docid": "e869450514334812a96228cb730ee582", "score": "0.6710101", "text": "def new\n @article = @user.articles.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @article }\n end\n end", "title": "" }, { "docid": "a462ba45c0f48c8752dd5898efaebb7c", "score": "0.6708244", "text": "def new\n @author = Author.find(params[:author_id])\n render :new\n end", "title": "" }, { "docid": "6cb0ff85030697dcc498e64c268cbec9", "score": "0.67071855", "text": "def new\n @author = Author.find_by_facebookuid(session[:fbuser]['id'])\n @author = Author.new if @author == nil\n @document = Document.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @document }\n end\n end", "title": "" }, { "docid": "fd4b4d0bcbc907f56ee713568dc39d25", "score": "0.669973", "text": "def create\n @author = Author.new(author_params)\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to new_book_path, notice: 'Author was successfully created.' }\n format.json { render :show, status: :created }\n else\n format.html { render :new }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a419bdcd70406b7939f1ad0a99285c3", "score": "0.6684866", "text": "def create\n @author = Author.new\n @author.author_name = params[:author][:author_name].titleize\n @page_title = @author.author_name\n\n respond_to do |format|\n if @author.save\n format.html {redirect_to @author, notice: 'Author was successfully created.' }\n format.json { render json: @author, status: :created, location: @author }\n else\n format.html { render action: \"new\" }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9f3ebd6794993b1df41b01bcdd65cb5b", "score": "0.6677928", "text": "def create\n @author = Author.create(create_params)\n if @author.present?\n render json: @author, status: :ok\n else\n render json: {error: 'Not create'}, status: :error\n end\n end", "title": "" }, { "docid": "40bacc6a29a04c97005e84693c3cf762", "score": "0.6670047", "text": "def new\n @template_type = TemplateAuthor.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @template_type }\n end\n end", "title": "" }, { "docid": "19dc58b12852468ba3d96f9c13988b71", "score": "0.6667157", "text": "def new\n @author_cite = AuthorCite.new\n\t\t@author_cite.user_id = current_user.id\n @author_cite.project_id = current_user.project_id\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @author_cite }\n end\n end", "title": "" }, { "docid": "ed5effda69176b021cc9a4b9d5f91eea", "score": "0.66394114", "text": "def new\n dt = DocumentType.where(abbreviation: 'R').take\n\n @document = Document.new({\n month: Time.now.month,\n year: Time.now.year,\n peer_review: PeerReview.find(2),\n publisher: Dictionaries::Publisher.where(caption: 'DRDC-RDDC').take,\n document_sub_category: DocumentSubCategory.find(dt.peer_review_document_sub_category_id),\n document_type: dt\n })\n\n @document.authors.build({\n person_id: current_user.person_id,\n main_author: true,\n hidden: false,\n order: 1\n })\n authorize! :create, @document\n\n respond_to do |format|\n format.html\n format.js\n end\n end", "title": "" }, { "docid": "d4db6e12be4d75ba07f7ef0d13402345", "score": "0.66328907", "text": "def new\n @author = Author.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render xml: @author }\n format.js\n end\n end", "title": "" }, { "docid": "e51e97863dbd88b7113a4a62bb8712aa", "score": "0.6628206", "text": "def add\n @author = Author.new(name: params[:name])\n @author.save\n render json: { status: :ok, message: 'Success!', author_id: @author.id }\n end", "title": "" }, { "docid": "102864e34fe5b274e1597ecd2956b424", "score": "0.66275615", "text": "def create\n @author = Author.new(params[:author])\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to(@author, :notice => 'Author was successfully created.') }\n format.xml { render :xml => @author, :status => :created, :location => @author }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @author.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf6d3ded72c010dcdb89998d63c77fcd", "score": "0.6614871", "text": "def new\n @book = Book.new\n @book.author_id=params[:author_id]\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @book }\n end\n end", "title": "" }, { "docid": "41d21377456efa92992630c549c41108", "score": "0.6606046", "text": "def create\n @author = Author.new( params[:author] )\n standard_save_on_create_response( @author )\n end", "title": "" }, { "docid": "7e2d919a76a253d72f58e3d0ae6584d0", "score": "0.659985", "text": "def new\n @author.photo_url = \"photo.png\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @author }\n end\n end", "title": "" }, { "docid": "c372a32329cfdd53602f3a2574e969ba", "score": "0.6590058", "text": "def new\n if(user_signed_in?)\n @article = Article.new\n @user = User.find(current_user.id)\n \n if !@user.author\n @author = @user.build_author\n @author.pseudo_last = @user.last_name\n @author.pseudo_first = @user.first_name\n @author.save\n end\n \n #add the article to the user\n respond_with(@article)\n end\n\n #respond_to do |format|\n # format.html # new.html.erb\n # format.xml { render :xml => @article }\n #end\n end", "title": "" }, { "docid": "b824e958921065851c0f09dd9d3ed134", "score": "0.6578787", "text": "def new\n unless current_user.try(:admin?)\n redirect_to \"/\"\n end\n @page = \"pieces\"\n @creator = Creator.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @creator }\n end\n end", "title": "" }, { "docid": "1c920353301cdad7f751b46d495fd466", "score": "0.6568904", "text": "def create\n @author = User.new(author_params)\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to @author, notice: \"User was successfully created.\" }\n format.json { render :show, status: :created, location: @author }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f923a47692f741e11e334cf5894d6e2e", "score": "0.656567", "text": "def create\n @author = Author.new(author_params)\n\n respond_to do |format|\n if @author.save\n auto_login(@author)\n\n format.html { redirect_to articles_path, notice: 'New Author created. Welcome to bloGNote' }\n format.json { render :show, status: :created, location: @author }\n else\n format.html { render :new }\n format.json { render json: @author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e96b536ca51bb257272186bcdd229063", "score": "0.6549057", "text": "def new\n @auteur = Auteur.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @auteur }\n end\n end", "title": "" }, { "docid": "d117ebcd2c5823837177f67d03fd8d30", "score": "0.6544339", "text": "def new\n @author = @document.author.build\n authorize! :create, @author\n\n respond_to do |format|\n format.html\n format.js\n end\n end", "title": "" }, { "docid": "b7db58acb2853af38a14a505d75f1bf5", "score": "0.65303737", "text": "def create\n \t@author = Author.new(params.require(:author).permit(:first_name, :last_name, :year))\n \tif @author.save\n \t\tredirect_to author_url(@author)\n \telse\n \t\tredirect_to authors_url\n \tend\n end", "title": "" }, { "docid": "0b48bda78f0f7a72758bdae8b375a94e", "score": "0.64839554", "text": "def new\n @book = Book.new\n @genres = Genre.all\n @authors = Author.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "59e4f054e2adc48f16b43a0b4dcca58a", "score": "0.64797324", "text": "def new\n @author = Author.new\n # create the translation object for however many locales there are\n # so the form will properly create all of the nested form fields\n I18n.available_locales.each do |locale|\n @author.author_translations.build(:locale => locale.to_s)\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @author }\n end\n end", "title": "" }, { "docid": "92982df7a35fcc4f6c3d1d9453e96cc6", "score": "0.6475103", "text": "def new\n @book = Book.new\n @author = @book.authors.new\n end", "title": "" }, { "docid": "d321216312b4d44f2996c1b5a42f6831", "score": "0.6468394", "text": "def new\n @book = current_user.books.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @book }\n end\n end", "title": "" }, { "docid": "c2178c2a395189ca584f9478d69a18f3", "score": "0.64513755", "text": "def new\n @author = Author.new\n render \"form\"\n end", "title": "" }, { "docid": "ea1afb98bd5fe02b17592f348f220077", "score": "0.6449516", "text": "def new\n @artist_person = ArtistPerson.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @artist_person }\n end\n end", "title": "" }, { "docid": "e817d0a041de6e528b9bcf3e1bd5eedf", "score": "0.64253265", "text": "def new\n @creator_relationship = CreatorRelationship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @creator_relationship }\n end\n end", "title": "" }, { "docid": "c0689c28ca79528819a617a5647d3b01", "score": "0.6420981", "text": "def new\n @new_user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_user }\n end\n end", "title": "" }, { "docid": "2427604f4b2fa4a9c080db76d95b2a3d", "score": "0.6416653", "text": "def new\n\t\t@author = Author.new\n\t\t@books = Book.all\n\tend", "title": "" }, { "docid": "b905829fba65c19c6520c6b5a0fc1819", "score": "0.6413634", "text": "def create\n author_id, is_new_author = get_author_id\n\n @book = Book.new(book_params.merge(:author_id => author_id))\n respond_to do |format|\n if @book.save\n format.html { redirect_to @book, notice: 'Knjiga uspešno ustvarjena.' }\n format.json { render :show, status: :created, location: @book }\n else\n # if is_new_author\n # new_author = Author.find(author_id)\n # new_author.destroy!\n # end\n\n format.html { render :new }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2c6c204f186b5f33ef141b74251523ab", "score": "0.64056057", "text": "def new\n @user = User.new(:organization_id => params[:organization_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "57338be553d44ea7dac05cf3e6c314ff", "score": "0.6405", "text": "def create\n @author = Author.new(params[:author])\n if @author.save\n render \"create\"\n else\n render \"form\"\n end\n end", "title": "" }, { "docid": "0b4af6e63e3c5fc22b1a8a469057a09e", "score": "0.63902926", "text": "def create\n @author = @document.authors.build(author_params)\n authorize! :create, @author\n\n respond_to do |format|\n if @author.save\n format.html { redirect_to @author, notice: \"[#{@author.person}] was successfully created.\" }\n format.js { redirect_to @author, notice: \"[#{@author.person}] was successfully created.\" }\n else\n format.html { render action: 'new' }\n format.js { render action: 'new' }\n end\n end\n end", "title": "" }, { "docid": "6bbfc5cccde170135f2110c37d167b00", "score": "0.6388211", "text": "def new\n\t\t@book = Book.new\n\t\t@authors = Author.all\n\tend", "title": "" }, { "docid": "656a3507fffe940d2a084639962539bd", "score": "0.6365077", "text": "def create\n @author = Author.new(params[:author])\n\n if @author.save\n redirect_to(@author, :flash => {:success => 'Article was successfully created.'})\n else\n flash[:error] = \"There was a problem creating the author.\"\n render :action => \"new\"\n end\n end", "title": "" }, { "docid": "886855e8c82b584e43d5e0eb976cb8d6", "score": "0.6354546", "text": "def new\n @new_user = NewUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_user }\n end\n end", "title": "" }, { "docid": "5122f54cc46de204b2f5390d9bcb7501", "score": "0.6353629", "text": "def new\n @bookmark = ArticlesUser.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bookmark }\n end\n end", "title": "" }, { "docid": "c8e503ed938051f8a0b27a8b5cc2a68e", "score": "0.6317899", "text": "def new\n @creator = Creator.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @creator }\n end\n end", "title": "" }, { "docid": "c9a6a03f7d7ea9243b63dba886bc52ec", "score": "0.6315473", "text": "def new\n @title = t 'view.users.new_title'\n @user = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "59c2b317e75badc472a053e7756a386a", "score": "0.63153946", "text": "def new\n @gist = Gist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gist }\n end\n end", "title": "" }, { "docid": "59c2b317e75badc472a053e7756a386a", "score": "0.63153946", "text": "def new\n @gist = Gist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gist }\n end\n end", "title": "" }, { "docid": "7d5c1e0fad442d1a99db1c8285f0d26e", "score": "0.63038397", "text": "def new\n @creator_book_relationship = CreatorBookRelationship.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @creator_book_relationship }\n end\n end", "title": "" }, { "docid": "369cfae0cd4513488f5c5237e7429872", "score": "0.6297315", "text": "def create\n @author = Author.new(params[:author])\n @author.save!\n redirect_to authors_path, notice: \"Author created successfully\"\n end", "title": "" }, { "docid": "45ce4f904e57278f6c72a59ad70823ae", "score": "0.62960446", "text": "def create\n @creator = Creator.new(params[:creator])\n\n respond_to do |format|\n if @creator.save\n format.html { redirect_to admin_creators_url, notice: 'Creator was successfully created.' }\n format.json { render json: @creator, status: :created, location: @creator }\n else\n format.html { render action: \"new\" }\n format.json { render json: @creator.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ecb51298646b1e4e258acedb7a7b981a", "score": "0.62911576", "text": "def new\n @corpus = Corpus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @corpus }\n end\n end", "title": "" }, { "docid": "46ff78c0d82b56a7a9263d3496fbc5e1", "score": "0.62815577", "text": "def create\n @manage_author = Admin::Author.new(manage_author_params)\n\n respond_to do |format|\n if @manage_author.save\n format.html { redirect_to manage_authors_path, notice: '创建成功' }\n format.json { render :show, status: :created, location: @manage_author }\n else\n format.html { render :new }\n format.json { render json: @manage_author.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
0986ab6ab36c596b997a4df5a75d962d
Read the metadata and content from the post or page
[ { "docid": "312eb9962a861e896cdc5870ceede9ca", "score": "0.6815001", "text": "def read_file\n\n # Load the Jekyll post or page\n self.content = File.read(@filename)\n\n begin\n\n # define a regular expression to find the YAML header \n if /^(---\\s*\\n.*?\\n?)^(---\\s*$\\n?)/m.match(self.content)\n\n # Use the back reference to load the metadata and the postmatch \n # to load the content\n self.metadata = YAML.load($1)\n self.content = $'\n\n end\n rescue => e\n puts \"YAML Exception reading #{filename}: #{e.message}\"\n end\n end", "title": "" } ]
[ { "docid": "856eb347f6319874151375ff1437861b", "score": "0.74100435", "text": "def read_metadata\n meta = read_pairs!(\"metadata.txt\")\n meta.views = meta.views.split\n meta.tags = meta.tags.split\n RuneBlog.blog.post = meta\n meta\n end", "title": "" }, { "docid": "ea14052c9c63658f691317b7ed8252ad", "score": "0.70726466", "text": "def metadata = markdown_page.data", "title": "" }, { "docid": "1e43762a33dcfe651a88fc80183b164b", "score": "0.67821354", "text": "def metadata\n data = @tumblr_post.info\n output = \"---\\n\"\n output << \"title: #{title}\\n\"\n output << \"slug: #{data[:slug]}\\n\"\n output << \"kind: article\\n\"\n output << \"created_at: #{data[:created_at]}\\n\"\n output << \"original_url: #{data[:url]}/#{data[:slug]}\\n\"\n output << \"imported_from: Tumblr\\n\"\n output << \"tags: #{tags}\\n\"\n output << \"layout: \\n\"\n output << \"published: true\\n\"\n output << \"\\n---\\n\\n\"\n end", "title": "" }, { "docid": "54005b7609565695afa07d3ba8529660", "score": "0.66333437", "text": "def read_post_content\n if @options['date']\n # remove date if it exists\n content = read.sub(/date:.*$\\n/, \"\")\n \n # Insert date after title\n content.sub(/(title:.+$)/i, '\\1'+\"\\ndate: #{@options['date']}\")\n else\n read\n end\n end", "title": "" }, { "docid": "f03757af2e68543a6679608d98fb61b1", "score": "0.6525075", "text": "def parse_metadata\n result.title = html.at('meta[name=\"pb-title\"]')['content']\n result.author = html.at('meta[name=\"pb-authors\"]')['content']\n result.license = html.at('meta[name=\"pb-book-license\"]')['content']\n end", "title": "" }, { "docid": "03ad82e71d8b4d95071983310a54bbab", "score": "0.6510951", "text": "def read\n Bridgetown::Hooks.trigger :site, :pre_read, self\n reader.read\n Bridgetown::Hooks.trigger :site, :post_read, self\n end", "title": "" }, { "docid": "31d7e561a9bd9b5b984a882444d0018e", "score": "0.6467689", "text": "def get_content_for_metadata\n if @nodes_for_metadata.nil? || @nodes_for_metadata.empty?\n if @index_h1 > 0\n @page_chapters[0..(@index_h1 - 1)].each do |chapter|\n chapter[:contents].each do |node|\n if node_has_metadata?(node)\n @nodes_for_metadata << node\n end\n end\n end \n else\n raise \"No contents for metadata in page!\"\n end\n end\n end", "title": "" }, { "docid": "d40ef7ecba64d3ca77f28a0622505e97", "score": "0.6432791", "text": "def get_page_content\n data = open(get_uri) { |data| data.read }\n \n data\n end", "title": "" }, { "docid": "ce3dd719de8f08177bf5971845d0d786", "score": "0.6388257", "text": "def show\n add_breadcrumb @post.title, :post_url\n\n @meta_data = {\n page_title: @post.title,\n page_description: @post.description,\n open_graph: {\n image: @post.image.url\n }\n }\n end", "title": "" }, { "docid": "345e37cd28cf08a5c6791f637476614b", "score": "0.63484967", "text": "def content\n source = @tumblr_post.content\n end", "title": "" }, { "docid": "5cf3924446ce3edb024087399b38770c", "score": "0.6338231", "text": "def read\n @post_content ||= begin\n file = @options['path']\n raise \"File #{file} not found.\" if !File.exist? file\n File.read(file)\n end\n end", "title": "" }, { "docid": "919a5aaed87e38498386748271bebdf6", "score": "0.63252693", "text": "def content\n self.post_content.content\n end", "title": "" }, { "docid": "1b60c442d9e61eebe33b86060f131420", "score": "0.63124996", "text": "def show\n @post = Post.published.full_information.find(params[:id])\n raise ActiveRecord::RecordNotFound unless @post\n\n @meta[:description] = @post.summary\n @meta[:title] = @post.title\n end", "title": "" }, { "docid": "c0560ccc6dc8e73d5e8e0215e16508f9", "score": "0.63057935", "text": "def read_metadata\n path = @mds.first\n unless path\n abort \"Must exist a markdown filename which have Yaml Front Matter.\"\n end\n yml, _ = Maliq::FileUtils.retrieveYFM(File.read path)\n return nil if yml.empty?\n metadata = YAML.load(yml).to_symkey\n\n meta_nodes = GEPUB::Metadata::CONTENT_NODE_LIST + [\"unique_identifier\"]\n metadata.select { |k, _| meta_nodes.include? k.to_s }\n end", "title": "" }, { "docid": "612695ff1f2c4b5f6904227a75d45ef4", "score": "0.6232441", "text": "def content()\n content = []\n article_p = ArticleParser.new\n puts 'getting basic information of ' + @url\n\n dom_post_div = @page.css('#content .step').select {|div| div[:id] != 'listheader'}\n dom_post_div.pop\n dom_post_div.each do |div|\n item = OpenStruct.new\n\n dom_title = div.css('.storytitle > a').first\n item.title = dom_title.text\n item.url = dom_title[:href]\n item.post_id = item.url.split('/').last.to_i\n\n dom_author = div.css('.metax').first\n item.author = dom_author.css('a').text\n item.published_at = Time.parse(dom_author.text.split(' ')[-2..-1].join(' ')).to_datetime\n item.category = dom_author.css('em').text.split(':').last.strip\n\n dom_brief = div.css('.storycontent').first \n item.brief = dom_brief.text\n\n dom_comment = div.css('.feedback').first\n item.comment_count = dom_comment.text.split(' ').first.to_i\n\n dom_image = div.css('img').first\n item.image = dom_image[:src]\n\n item.content = article_p.content_by_id(item.post_id)\n\n content.push(item)\n end #each\n return content\n end", "title": "" }, { "docid": "b11575a76cf1a5a728d2d001b841eb53", "score": "0.61966425", "text": "def show\n @page_title = @post.title\n @seo_keywords = @post.body\n end", "title": "" }, { "docid": "b60dfd674f7cdcc4400707bc0a84cd24", "score": "0.6193449", "text": "def content\n \n ## Deal with caching locally, downloading, etc\n refresh if ::Shibkit::MetaMeta.config.auto_refresh? and @metadata_tmpfile == nil\n \n raise \"No content is available, source has not been downloaded\" unless \n metadata_tmpfile.path\n \n return IO.read(metadata_tmpfile.path)\n \n end", "title": "" }, { "docid": "0dd69a2c8418d8bde8e5d19b807b33db", "score": "0.61829513", "text": "def first_post\n page = Nokogiri::HTML(open(@uri))\n \n set_title page\n set_author page\n\n puts @title\n puts @author\n end", "title": "" }, { "docid": "d2528a22c812ed8b6c9d74ecd6a8da6a", "score": "0.61633515", "text": "def content\n @content ||= read_content\n end", "title": "" }, { "docid": "4cebeac8c3c2c557a867c445c5bfe03b", "score": "0.6145279", "text": "def get_data\n begin\n doc = Nokogiri::HTML(open(url))\n self.title = doc.title.to_s\n self.description = doc.xpath(\"/html/head/meta[@name='description']/@content\").to_s\n self.data_recived_on = Time.now\n rescue \n ensure\n end\n\n end", "title": "" }, { "docid": "09f4ccff9272c87ad358a8dcae2862eb", "score": "0.61367166", "text": "def grab_metadata\n begin\n\n timeout(5) do\n begin\n doc = Nokogiri::HTML(open(self.url, allow_redirections: :safe))\n\n og_title = doc.css(\"meta[property='og:title']\")\n og_description = doc.css(\"meta[property='og:description']\")\n\n self.title = og_title.first.attributes[\"content\"] if og_title.length > 0\n self.description = og_description.first.attributes[\"content\"] if og_description.length > 0\n rescue Exception\n end\n\n\n end\n\n rescue Timeout::Error\n puts 'Timeout error'\n end\n\n end", "title": "" }, { "docid": "2cadd4d2603aa1b497af57f6cf21654f", "score": "0.6135969", "text": "def meta(page = current_page)\n page.data\n end", "title": "" }, { "docid": "4499bac5af4efaff8d3372bd42b99f90", "score": "0.61296684", "text": "def read_metadata\n @client.get(metadata_path)\n end", "title": "" }, { "docid": "06de9d98e0c2cdd8c1e1635fa5ac3696", "score": "0.6089773", "text": "def extract\n if summary.blank? || title.blank?\n # http = RubyTubesday.new\n # raw = http.get(link)\n c = Curl::Easy.perform(self.link) do |curl|\n curl.follow_location = true\n end\n data = Nokogiri::HTML(c.body_str)\n no_body = false\n end\n if extended_body.blank?\n self.extended_body = Sanitize.clean(SemanticExtraction::AdHoc.extract_text(link))\n end\n if summary.blank?\n if meta_desc = data.css(\"meta[name='description']\").first \n content = meta_desc['content']\n elsif no_body\n content = \"No summary available\"\n else\n content = Nokogiri::HTML(extended_body)\n content = content.css(\"p\").first.text\n end\n self.summary = content\n end\n if title.blank?\n self.title = data.css(\"title\").first.children.first.to_s\n end\n end", "title": "" }, { "docid": "bf66367daa643e8bfb21ea6b38945e41", "score": "0.60837126", "text": "def load_data_for_preview\n @site = @post.site\n force_locale\n recent_posts\n all_tags\n archive_posts\n end", "title": "" }, { "docid": "4f67525ca206d00d70129dcc6b96cd2a", "score": "0.6081908", "text": "def read_posts_one(blog)\n @doc = Nokogiri::HTML(open(\"#{blog.blog_url}\"))\n if !@doc.nil?\n author_name = @doc.css('title').text\n @doc.css('article.post').each do |node|\n @post = Post.new\n title_url = node.css('h1 a') \n @post.blog_id = blog.id\n blog.blog_title = \"#{author_name}'s blogs\"\n blog.save!\n append_url = \"http://patshaughnessy.net\"\n @post.url = append_url + title_url[0]['href']\n @post.title = node.css('h1').text \n #content_data = node.css('section.content').inner_html.chomp\n #@post.content = content_data.css('p a').last.attr('href') \n #links = \"http://patshaughnessy.net/\" + node.css('section.content').css('a').map{ |link| link['href']}.last \n content_orig = node.css('section.content').inner_html.chomp\n @post.content = full_content(content_orig,append_url,full_string_content=\"\") \n @post.author = author_name\n @post.post_date = node.css('span.date').text.to_date\n @post.save!\n end \n end\n end", "title": "" }, { "docid": "fd7b497ba358ca541b8122b9f0d75b08", "score": "0.6074447", "text": "def page_info(page_id)\n JSON.parse(call_api(\"rest/api/content/#{page_id}\").body)\n end", "title": "" }, { "docid": "d4a7ab63ba409c3e45164d6aeac30137", "score": "0.6073883", "text": "def get_metadata\n login\n page = parse_one_page(@base_uri)\n last = page.search(\"//div//ul[@class='pager']//li[@class='pager-last last']\")\n last_page_link = last.css(\"a\").first[\"href\"]\n begin\n next_page = page.search(\"//div//ul[@class='pager']//li[@class='pager-next']\")\n link = next_page.css(\"a\").first\n if link\n link = link[\"href\"]\n @current_page = @base + link\n puts \"Fetching...\" + @current_page\n page = parse_one_page(@current_page)\n end\n end while link != last_page_link\n\n @metadata_master\n end", "title": "" }, { "docid": "3e706ad7ca47c8170338dd69147ae0cd", "score": "0.6060985", "text": "def read\n read_tags\n read_categories\n read_dates\n end", "title": "" }, { "docid": "3e706ad7ca47c8170338dd69147ae0cd", "score": "0.6060985", "text": "def read\n read_tags\n read_categories\n read_dates\n end", "title": "" }, { "docid": "3e706ad7ca47c8170338dd69147ae0cd", "score": "0.6060985", "text": "def read\n read_tags\n read_categories\n read_dates\n end", "title": "" }, { "docid": "b2d905b9d758865fd31a416bf9f6f270", "score": "0.60585946", "text": "def fetch_content\n # Get text from given wiki URL\n @text = Nokogiri::HTML(open(@url)).css('#bodyContent p').text\n\n # Analyze readability of the wiki text\n @readability = Odyssey.analyze_multi(@text, ['FleschKincaidRe', 'FleschKincaidGl', 'Ari', 'ColemanLiau', 'GunningFog', 'Smog'], true)\n\n # Set the @loaded status to true\n @loaded = true\n end", "title": "" }, { "docid": "b12cd0386ea1180e395e2a8da446d832", "score": "0.605299", "text": "def extract\n if extended_body.blank? || body.blank? || title.blank?\n http = RubyTubesday.new\n raw = http.get(link)\n data = Nokogiri::HTML(raw)\n no_body = false\n end\n if extended_body.blank?\n containers = (data/\"div div\")\n if containers.blank?\n text = raw\n no_body = true\n else\n possibles = []\n containers.each_with_index do |c, index|\n possibles << {:index => index, :count => ((c/\"p\").length - (c/\"div\").sum{|u| (u/\"p\").length})}\n end\n text_index = possibles.max{|a,b| a[:count] <=> b[:count]}[:index]\n text = containers[text_index]\n no_body = false\n end\n self.extended_body = Sanitize.clean(text.text)\n end\n if body.blank?\n if meta_desc = data.css(\"meta[name='description']\").first \n content = meta_desc['content']\n elsif no_body\n content = \"No summary available\"\n else\n content = Nokogiri::HTML(extended_body)\n content = content.css(\"p\").first.text\n end\n self.body = content\n end\n if title.blank?\n self.title = data.css(\"title\").first.children.first.to_s\n end\n end", "title": "" }, { "docid": "22f3f93bc798bb8f9d10d162f8780786", "score": "0.6040369", "text": "def get_metadata\n doc = U.parse_html_from_file_or_uri(@base_uri,@index_html,:force_fetch=>true)\n names = doc.xpath(\"//div[@id='main-content']//h5\")\n links = doc.xpath(\"//div[@id='main-content']//p//a\")\n links.size.times do |x|\n @@metadata_master << { :name => names[x].inner_text,\n :home_url => links[x][\"href\"],\n :url => links[x][\"href\"] }\n end\n @@metadata_master\n end", "title": "" }, { "docid": "5bf484f5578d671faa74cd04cdf4a849", "score": "0.6019477", "text": "def load_meta\n page = load_page\n self.total_pages = page.total_pages\n self.article_count = page.total\n end", "title": "" }, { "docid": "a3223e48a43f4e844691983196929d39", "score": "0.6012158", "text": "def content_for(post)\n File.read(\"app/views/posts/content/_#{post.slug}.html.haml\")\n end", "title": "" }, { "docid": "685d8f2fb63ede7ed80ffddfe90cb153", "score": "0.6002195", "text": "def read(message)\n url = message[:url]\n key = message[:key]\n headers = JSON.parse(headers_path(url, key).read)\n body = body_path(url, key).read\n Page.new(url, key, headers, body, headers[\"last-modified\"], headers[\"etag\"])\n end", "title": "" }, { "docid": "6e72c402b2126c115ecc7f60570d1c9d", "score": "0.5999477", "text": "def get_metadata\n @metadata = Metadata.baseinfo.first\n case params[:controller]\n when 'posts'\n case params[:action]\n when 'index'\n @metadata.metatitle = @metadata.metatitle + ' | Posts'\n when 'show'\n post = Post.find(params[:id])\n @metadata.metadescription = post.metadescription\n @metadata.keywords = post.metakeywords\n @metadata.metatitle = @metadata.metatitle + ' | ' + post.name\n end\n when 'projects'\n case params[:action]\n when 'index'\n @metadata.metatitle = @metadata.metatitle + ' | Projects'\n when 'show'\n project = Project.find(params[:id])\n @metadata.metadescription = project.description\n @metadata.keywords = project.keywords\n @metadata.metatitle = @metadata.metatitle + ' | ' + project.name\n end\n when 'users'\n case params[:action]\n when 'show'\n @metadata = Metadata.baseinfo.first\n user = User.find(@metadata.aboutmeuser)\n @metadata.metatitle = user.name + ' | About Me'\n # Get the description\n description = user.userdetail.description\n # Parsed out using Nokogiri\n desctext = Nokogiri::HTML(description)\n # Setting description\n @metadata.metadescription = desctext.text\n end\n end\n end", "title": "" }, { "docid": "213ee49bec4a7f72acff3a479f001eb0", "score": "0.59959865", "text": "def populate(post, data)\n # we send the slug as the title if there's no title. Don't take it back.\n if data[\"title\"] != post.slug\n post.title = data[\"title\"]\n end\n\n if data[\"description\"]\n post.body = data[\"description\"].strip\n end\n\n post.data[\"link\"] = data[\"link\"]\n \n if d = data[\"dateCreated\"]\n if d.instance_of? XMLRPC::DateTime\n post.date = Date.civil(d.year, d.month, d.day)\n else\n puts \"Can't deal with date #{d}\"\n end\n end\n\n # As tags are available in the keywords field in MarsEdit\n # discard the mt_tags field and replace its content\n # by the content of mt_keywords.\n tags = nil\n if data.include? \"mt_keywords\"\n tags ||= []\n tags += data[\"mt_keywords\"].split(/\\s*,\\s*/)\n data[\"mt_tags\"] = tags\n end\n if not tags.nil?\n post.tags = tags.sort.uniq\n end\n\n\n if data.include? \"mt_convert_breaks\" or data.include? \"mt_basename\"\n # if the file extension is one of the permitted filters, treat it as a filter\n m = post.slug.match(/^(.*)\\.(.*?)$/)\n if m and self.filters.map{|f| f[\"key\"] }.include? m[2]\n basename = m[1]\n filter_key = m[2]\n else\n basename = post.slug\n filter_key = \"0\" # means 'no filter'\n end \n \n if data.include? \"mt_basename\"\n basename = data[\"mt_basename\"]\n end\n\n if data.include? \"mt_convert_breaks\"\n filter_key = data[\"mt_convert_breaks\"]\n if filter_key == \"\"\n filter_key = \"0\"\n end\n end\n \n # have to have _something_\n if not basename.match(/\\../) and filter_key == \"0\"\n filter_key = \"html\"\n end\n \n post.slug = basename\n if filter_key != \"0\"\n post.slug = post.slug.gsub(/\\./,'') + \".\" + filter_key\n end\n end\n\n if data.include? \"custom_fields\"\n for field in data[\"custom_fields\"]\n post.data[ field[\"key\"] ] = field[\"value\"]\n end\n end\n\n # Delete photo and photo-alt-text if they are empty\n post.data.delete_if { |key, value| key == \"photo\" && value.strip.empty? }\n post.data.delete_if { |key, value| key == \"photo-alt-text\" && value.strip.empty? }\n\n # Change the kind (layout) of the post\n if not post.photo.nil?\n post.data[\"layout\"] = \"photo-post\"\n else\n post.data[\"layout\"] = \"post\"\n end\n\n end", "title": "" }, { "docid": "e159d4c35d97d16587353530c91fb090", "score": "0.59768474", "text": "def get_page_content(\n page_info # Wikipedia page info JSON response\n) # String | nil\n page_content_container = page_info.dig(:revisions, 0, :slots, :main)\n return nil if page_content_container.nil?\n\n # We expect only Wikitext content and fail on anything else.\n return nil unless page_content_container.fetch(:contentformat) == 'text/x-wiki'\n\n page_content_container.fetch(:content)\nend", "title": "" }, { "docid": "d6ed5d871467e45b4257c22a3e6165bd", "score": "0.59569216", "text": "def extract_content(page)\n # calculate archive unique id\n offset=@source[:unique_id_scan_result_offset]||0\n uid=page.url.to_s.scan(@source[:unique_id_pattern])[0][offset] rescue page.url.to_s\n puts \"UUUUUUUUUUUUUUU=>#{uid}\"\n uid=@source[:name]+\"-\"+uid\n # puts \"UID is =>#{uid}\"\n # FIXME Check whether this archive is already existed in db.\n # next if Archive.exists?(:uid => uid)\n \n # Check title and Content. If title or content was nil then return\n title=page.doc.at_css('title','TITLE').content rescue nil\n return false,\"title blank\" if title.blank?\n # puts \"blog title => #{title}\"\n content_node_set=fetch_content_nodes(page)\n return false,\"can't find content nodes\" if content_node_set.size<1\n # FIXME Check picture counts, ignore archives which has less than 5 pictures\n img_nodes=content_node_set.css('img')\n return false,\"No enough images=> #{img_nodes.size}\" if img_nodes.size<3\n \n # Check archive publish time filter old archives\n pub_time=fetch_pub_time(page) \n #puts \"Pub time is=> #{pub_time}\"\n return false,\"pub time nil\" if pub_time.nil?\n return false,\"Archive too old #{pub_time}\" if (pub_time+(@source[:max_age].days))<Time.now\n # Do some extra work if needed\n extra_work(content_node_set) if self.respond_to?(:extra_work)\n page_content=content_node_set.inject(''){|c,i|c+=i.to_html(:encoding => 'utf-8')}\n # Get document META info\n desc_meta=page.doc.xpath(\"//meta[@name='description']\")[0]\n desc_text=desc_meta.blank? ? content_node_set.text.strip.truncate(100) : desc_meta['content']\n keywords_meta=page.doc.xpath(\"//meta[@name='keywords']\")[0]\n analyzed_page={\n :title => title, :url => page.url.to_s, :uid => uid, \n :pub_date => pub_time, \n :desc => desc_text,\n :keywords => keywords_meta.blank? ? '' : keywords_meta['content'],\n :content => page_content,\n } \n return true,analyzed_page\n #yield analyzed_page if block_given?\n #return analyzed_page\n end", "title": "" }, { "docid": "d693836694b0d2a098c6379afe5c29b6", "score": "0.5956023", "text": "def content_md\n resource.content_metadata\n end", "title": "" }, { "docid": "5166963a5e49a5029bb60e0d026d212b", "score": "0.5947809", "text": "def page\n content\n end", "title": "" }, { "docid": "c83436e70cb5436c98cc9ab9cb038962", "score": "0.5937122", "text": "def content_metadata(object)\n Harvestdor.content_metadata(object, config.purl)\n end", "title": "" }, { "docid": "98766b1dbdf2a2bee33017fdef78942e", "score": "0.5920057", "text": "def get_interview_content(company_name, doc)\n content = doc.search(\"div.post-content\")[0]\n save_interview_content_as_markdown(company_name, content)\n end", "title": "" }, { "docid": "ec9bb75b8eeeab9b251334f150e5517d", "score": "0.5919259", "text": "def get_content rss_item, body\n case rss_item.link\n when /\\/news\\// then content = get_news_and_articles(body)\n when /\\/articles\\// then content = get_news_and_articles(body)\n when /\\/interviews\\// then content = get_interviews(body)\n else content = rss_item.description\n end\n content\n end", "title": "" }, { "docid": "f5080772acb8273e45d748c3e5976789", "score": "0.59186447", "text": "def read_page(url)\n begin\n puts \"Reading page #{url}\"\n page = Nokogiri::HTML(open(url))\n\n page_element = page.css('div#sites-canvas-main-content div[dir=ltr]')\n\n if page_element.nil?\n nil\n else\n title = page_element[0].css('h1')[0].text\n content = page_element[0]\n\n {title: title,\n content: content}\n end\n rescue\n nil\n end\nend", "title": "" }, { "docid": "9941a202d29bf566e7ed58490b22e522", "score": "0.59137315", "text": "def read_posts(blog)\n @doc = Nokogiri::HTML(open(\"#{blog.blog_url}\"))\n if !@doc.nil?\n @doc.css('div.post').each do |node|\n @post = Post.new\n title_url = node.css('h3.post-title a')\n @post.blog_id = blog.id\n blog.blog_title = @doc.css('h1.title').text\n blog.save!\n @post.url = title_url[0]['href']\n @post.title = node.css('h3.post-title').text \n @post.content = node.css('div.post-body').inner_html.chomp\n @post.author = node.css('span.fn').text \n published_date = node.css('abbr.published') \n @post.post_date = Time.parse(published_date[0]['title'].gsub('T',\" \")) \n @post.save!\n end \n end\n end", "title": "" }, { "docid": "aacf9a3ee7bb6cd3850db95aead80ce2", "score": "0.59014237", "text": "def read_blog_posts(blog)\r\n doc = Nokogiri::HTML(open(\"#{blog.blog_url}\")) \r\n xml_url = doc.css('head link[rel=\"alternate\"]').first['href']\r\n xml_type = doc.css('head link[rel=\"alternate\"]').first['type']\r\n xml_doc_url= xml_url.include?(\"http:\") ? xml_url : \"http:\" + xml_url\r\n @xml_doc = Nokogiri::XML(open(\"#{xml_doc_url}\")) \r\n if !@xml_doc.nil?\r\n if xml_type == 'application/atom+xml'\r\n atom_parsing(blog,@xml_doc)\r\n end\r\n\r\n if xml_type == 'application/rss+xml'\r\n rss_parsing(blog,@xml_doc)\r\n end \r\n end \r\n end", "title": "" }, { "docid": "2a1c41cd1eed1a9cc46c0cf2e1344a0b", "score": "0.58960795", "text": "def content_for_file(file_path)\n file = PageWithoutAFile.new(@site, File.dirname(__FILE__), \"\", file_path)\n\n config = Jekyll.configuration({})\n uri = config['url'] + config['baseurl']\n\n data = {\n :version => \"https://jsonfeed.org/version/1\",\n :title => config['title'],\n :home_page_url => uri,\n :feed_url => uri + \"/feed.json\",\n :items => []\n }\n\n @site.posts.docs.each do |page|\n next if page.data['draft']\n\n page.data['author'] ||= ''\n page.data['excerpt'] ||= ''\n page.data['featured'] ||= false\n page.data['image'] ||= 'https://dummyimage.com/800x800/000/fff.jpg&text=' + CGI.escape(page.data['title'])\n page.data['image_h'] ||= 800\n page.data['image_w'] ||= 800\n page.data['thumb'] ||= 'https://dummyimage.com/80x80/000/fff.jpg&text=' + CGI.escape(page.data['title'])\n page.data['thumb_h'] ||= 80\n page.data['thumb_w'] ||= 80\n\n # Check for relative URLs and add news domain.\n unless page.data['image'].include?('http')\n page.data['image'] = 'https://stockle.com/news' + page.data['image']\n end\n unless page.data['thumb'].include?('http')\n page.data['thumb'] = 'https://stockle.com/news' + page.data['thumb']\n end\n\n data[:items].push({\n :id => page.id,\n :url => uri + page.url,\n :title => page.data['title'],\n :summary => page.data['excerpt'],\n :date_published => DateTime.parse(page.data['date'].to_s).rfc3339,\n :author => page.data['author'],\n :tags => page.data['categories'], # TODO: CSV the array?\n :featured => page.data['featured'],\n :image => page.data['image'],\n :image_h => page.data['image_h'],\n :image_w => page.data['image_w'],\n :thumb => page.data['thumb'],\n :thumb_h => page.data['thumb_h'],\n :thumb_w => page.data['thumb_w']\n })\n end\n\n file.content = JSON.generate(data)\n file.data[\"layout\"] = nil\n file.data[\"sitemap\"] = false\n #file.data[\"xsl\"] = file_exists?(\"feed.xslt.xml\")\n file.output\n\n return file\n end", "title": "" }, { "docid": "d00029bb4bcccc4ef69758fe08fed0f9", "score": "0.5872124", "text": "def content\n self.ensure_id\n Ruhoh::Utils.parse_page_file(Ruhoh.paths.base, @path)['content']\n end", "title": "" }, { "docid": "129164f9dfe25c178fd5c340a62e5b14", "score": "0.5869675", "text": "def extract_metadata\n path = upload.queued_for_write[:original].path\n info = PDF::Info.new(path).metadata\n self.title = (self.title != nil && self.title.empty?)? info[:title] : self.title\n self.keywords = (self.keywords != nil && self.keywords.empty?)? info[:keywords] : self.keywords\n tmp_authors = HTMLEntities.new.decode(info[:author]).split(\",\")\n res = Hash.new\n res.store(\"authors\", \"\")\n tmp_authors.each do |author|\n tmp = Author.where(\"lower(search_name) LIKE :input\", input: \"%#{author.strip.downcase}\")\n if tmp != [] || tmp.size == 1\n self.authors << tmp\n pp tmp\n else\n res.store(\"authors\", res[\"authors\"] + author + \",\") \n end\n end\n pp info\n res.store(\"title\",(self.title != nil && !self.title.empty?)? true : false)\n pp res\n end", "title": "" }, { "docid": "1ad7197c3a09c7df910ac22fcb016613", "score": "0.5868468", "text": "def get_metadata\n {\n title: title,\n description: description,\n image_url: photo,\n url: Rails.application.routes.url_helpers.user_story_url(self.user.handle, self)\n }\n end", "title": "" }, { "docid": "366b66e2a69671b1313f3aee7f58ae38", "score": "0.58681256", "text": "def load(post = nil)\n \n # Query WordPress, if necessary\n if post.nil?\n num_related = 3\n max_description_size = 160\n \n # Fetch the post\n url = \"#{self._wp_url}/?json=get_post&post_type=#{self._wp_post_type}#{self.class.wp_query_string}\"\n \n if self.id\n url += \"&id=#{self.id}\"\n elsif self.slug\n url += \"&slug=#{self.slug}\"\n else\n self.id = nil\n return\n end\n \n content = open(url, self._wp_headers).read\n json = JSON.parse(content)\n \n if json['status'] == 'error'\n self.id = nil\n else\n post = json['post']\n end\n end\n \n return if post.nil?\n \n # Populate the model's fields\n self._wp_fields.each do |field|\n name = field[0]\n if post[\"#{name}\"]\n process_and_set_field(field, post[\"#{name}\"])\n end\n end\n \n if post['custom_fields']\n self._wp_custom_fields.each do |field|\n name = field[0]\n if post['custom_fields'][\"#{name}\"]\n process_and_set_field(field, post['custom_fields'][\"#{name}\"][0])\n end\n end\n end\n \n # Special case for attachments / images\n self.images = self.attachments.map do |attachment|\n return nil unless attachment['images']\n {\n \"files\" => attachment['images'],\n \"caption\" => attachment['caption'],\n \"title\" => attachment['title']\n }\n end.compact\n \n # Custom post processing\n self.send(self._wp_after_load, post) if self._wp_after_load\n \n self\n end", "title": "" }, { "docid": "e9a9a32ccba7a95a11f2294c48fc4fde", "score": "0.5865401", "text": "def readposts(fields={})\n response = perform_get(\"/api/readposts\", :fields => fields)\n response[\"post\"] if not response.nil?\n end", "title": "" }, { "docid": "24d0b90070218a6a9651ebe2ab0334ae", "score": "0.58617616", "text": "def get_metadata\n response = self.class.get(\"/ct2/show/#{id}\", :query => {:displayxml => false})\n html = Nokogiri::HTML(response.body)\n\n metadata = {}\n\n {\n :terms => 0, \n :keywords => 1\n }.each do |key, value|\n metadata[key] = []\n html.search(\"div.indent3:nth-last-child(#{value}) td\").each do |td|\n words = td.inner_html.split(/\\<br\\/?\\>/).collect{|i| i.gsub(/\\<div.*/, \"\").strip.chomp}\n if !words.empty?\n metadata[key] += words\n end\n metadata[key]\n end\n\n end\n \n @terms, @categories, @keywords = metadata[:terms], metadata[:categories], metadata[:keywords]\n metadata\n end", "title": "" }, { "docid": "9ac6c00d101fe1783e5545446bfef7a3", "score": "0.5857971", "text": "def body\n if meta?\n @data[:body]\n else\n @data\n end\n end", "title": "" }, { "docid": "2463ecda04c5f5376ad021ed5e189795", "score": "0.5857867", "text": "def extract_data(content)\n\t\tbegin\n\t\t\tdata = Nokogiri::HTML(content)\n\t\trescue\n\t\t\tputs \"ERROR:Cannot open HTML file\"\n\t\tend\n\t\tbegin\n\t\t\t@text = data.xpath(\"//div[@id='articleBody']/p[not(@id) and not(@class)]\").text\n\t\t\t@title = data.css(\"div#articleHeaderBig h1\").text\n\t\t\t@author = data.css(\"[class=articleAuthors]\").text\n\t\t\t@date = data.css(\"p#articleDate\").text\n\t\t\t@comments_url = data.css(\"[data-dot=c_vase_nazory] a\")[0][\"href\"]\n\t\t\tdata.css(\"div#articleBody [class=articlePhotos] a\").each do |image|\n\t\t\t\t@images_urls << image['href']\n\t\t\tend\n\t\trescue\n\t\t\tputs \"ERROR:Cannot extract data from website\"\n\t\tend\n\n\t\tnormalize_data\n\tend", "title": "" }, { "docid": "fb07aa10728217950bc63ef695aae1f2", "score": "0.5854686", "text": "def read_file\n content = File.read(@filename[:original])\n # Remove the author, if there is one from the Markdown\n content = extract_author(content)\n content = extract_summary(content)\n if WhoNeedsWP::options[:use_term_extractor]\n @tags = YahooTermExtractor.generate_keywords(content)\n elsif WhoNeedsWP::options[:extract_tags]\n content = extract_tags(content)\n else\n @tags = []\n end\n\n @markdown = Kramdown::Document.new(content)\n #,{:coderay => {:wrap => :div, :line_numbers => :inline,\n #:line_number_start => 1, :tab_width => 8, :bold_every => 10, :css => :style}})\n end", "title": "" }, { "docid": "50992bd567f20530ffeedce6b49d491d", "score": "0.58535933", "text": "def get_metadata; end", "title": "" }, { "docid": "b6b20ba227cb585ea70495c51a0e184c", "score": "0.58498186", "text": "def page_description\n content_tag :meta, \"\", {name: \"description\", value: data.page.description } if data.page.description\n end", "title": "" }, { "docid": "c9697adabbd65dce7091e3f1cbf70184", "score": "0.58486116", "text": "def read_contents\n match = YAML_FRONT_MATTER_REGEXP.match(utf_content)\n return unless match\n @body = match.post_match\n @data = YAML.safe_load(match.to_s)\n end", "title": "" }, { "docid": "bd68d2cb4f3e3c515e6dec38f5823ffa", "score": "0.58449256", "text": "def read_info\n parsed_contents['info'] || {}\n end", "title": "" }, { "docid": "d2b9e14cd6c58247fdb5b5a4a2e49ea9", "score": "0.5832137", "text": "def content(key)\n page_content(key).try(:content)\n end", "title": "" }, { "docid": "48fe95dcb94cbafa1f3f13588c3f149b", "score": "0.58264315", "text": "def page_content\n @top_content = PageContent.where(\"category =?\", \"Slogan Bigtv\").first\n @slides = PageContent.where(\"category =?\", \"Slider Top\").published.order('created_at DESC')\n @about_bigtv = PageContent.where(\"category =?\", \"Footer About Bigtv\").first\n @footer = PageContent.where(\"category =?\", \"Footer Content\").first\n end", "title": "" }, { "docid": "78c08d8d03a2a16d1407e660dcb7ee49", "score": "0.582478", "text": "def metadata\n data.fetch('metadata')\n end", "title": "" }, { "docid": "73910a1f290d8b6ee5aef1583fe6fef9", "score": "0.5819627", "text": "def single_post(post, options = {})\n options.reverse_merge!( :comments => true, \n :comment_form => true,\n :heading => :h2, \n :metadata => true, \n :excerpt => false,\n :more_text => 'Read the rest &hellip;',\n :title_link => :blog_post)\n \n output = []\n \n if options[:title_link]\n output << content_tag(options[:heading], link_to(post.title, eval(\"#{options[:title_link]}_url(post)\"), :title => \"Read #{post.title} (with comments)\"), :class => 'title')\n else\n output << content_tag(options[:heading], post.title, :class => 'title')\n end\n \n output << show_metadata(post) if options[:metadata]\n \n # Perform the excerpting\n if options[:excerpt]\n link = link_to(options[:more_text], blog_post_path(post), :title => \"Read the rest of #{post.title}\", :class => 'more' )\n post.content =~ /(.*)<!--\\s?more\\s?-->(.*)/m\n if $2\n post.content = $1 + link\n else\n post.content = post.summary + \"\\r\\n\\r\\n#{link}\"\n end\n end\n\n body = Hpricot(post.content.gsub(/<!--(.*?)-->/m, ''))\n\n # Convert any \"pre\" segments to code\n ['xml', 'yaml', 'ruby'].each do |code|\n convertor = Syntax::Convertors::HTML.for_syntax code\n body.search(\"pre.#{code}\") do |e|\n e.innerHTML = convertor.convert( e.innerHTML ).gsub(/<\\/?pre>/,'')\n end\n end\n\n # Simple format & auto-link the body\n body = simple_format(auto_link(sanitize(body.to_html, :tags => %w(pre ol ul blockquote h1 h2 h3 h4 div p object param embed a img), :attributes => %w(allowscriptaccess allowfullscreen alt class height href name src style title type width value))))\n body = Hpricot(body)\n body.search(\"pre p\"){|e| e.swap(e.inner_html)}\n body.search(\"pre br\").remove # Remove <br /> tags inside <pre> tags -- the simple_format method incorrectly inserts them\n body.search(\"ol>br\").remove\n body.search(\"ul>br\").remove\n \n output << body.to_html\n\n if options[:comments]\n output << content_tag(:h2, 'Conversation in progress&hellip;', :class => 'comments') unless post.comments.blank?\n index = 0\n output << content_tag(:ol, post.comments.collect{|comment| index += 1; single_comment(comment, :class => cycle('odd', 'even') + (index == 1 ? ' first' : ''), :index => index) }.join(\"\\n\\n\"), :class => 'comments')\n new_comment = Comment.new(params[:comment])\n new_comment.post = post\n output << controller.instance_eval{render_to_string(:partial => 'comments/form')} if options[:comment_form]\n end\n \n # Return the output wrapped in a <div class=\"post\">\n content_tag(:div, output.join(\"\\n\\n\\t\\t\"), :class => 'post')\n end", "title": "" }, { "docid": "94252b9e40cb120cf3e1042678146a52", "score": "0.58139384", "text": "def contents\n contents = document.contents\n raise 'Medication content missing' unless contents\n contents\n end", "title": "" }, { "docid": "6143813b9f0fa08c30fdcad38f568b4a", "score": "0.57990605", "text": "def process_contents()\n @css_tags = @contents.xpath( '//link[@rel=\"stylesheet\"]' )\n @js_tags = @contents.xpath( '//script[@src]' )\n @img_tags = @contents.xpath( '//img[@src]' )\n\n # Note: meta tags and links are unused in this example\n find_meta_tags()\n find_links()\n end", "title": "" }, { "docid": "0b4566b7abed8fb034c3a342e46642a1", "score": "0.57988626", "text": "def page_contents\n @page_contents ||=\n Net::HTTP.start(\n page_uri.host,\n page_uri.port,\n ) do |http|\n request = Net::HTTP::Get.new(page_uri, 'User-Agent' => DEFAULT_SCRAPER_AGENT)\n http.request(request)\n end\n rescue Exception =>e\n raise e\n end", "title": "" }, { "docid": "1c99c858e98b63233594b4ef7ac3975b", "score": "0.57959056", "text": "def page_meta\n res = ''\n res << tag(:meta, :name => 'description', :content => @_desc) if @_desc\n res << tag(:meta, :name => 'keywords', :content => @_keys) if @_desc\n return res\n end", "title": "" }, { "docid": "b06898df14e92842ca35243b23f9aee6", "score": "0.5792648", "text": "def read(uid)\n url = Cloudinary::Utils.cloudinary_url public_id(uid), format: ext(uid) || 'jpg'\n #meta = SomeLibrary.get_meta(uid)\n if url\n [\n Cloudinary::Downloader.download(url), # can be a String, File, Pathname, Tempfile\n nil # the same meta Hash that was stored with write\n ]\n else\n nil # return nil if not found\n end\n end", "title": "" }, { "docid": "5d98f052d14ba7037ea1f49ac13c516e", "score": "0.57922614", "text": "def page_content(title)\n\tFile.read(\"pages/#{title}.txt\")\n# rescue Errno::ENOENT\n# \treturn nil\nend", "title": "" }, { "docid": "a802f65ae856c496c8e650806044f759", "score": "0.5791804", "text": "def get_meta\n @body_id = \"articles\"\n @sports = Sport.all\n @categories = Category.all\n @authors = User.authors\n end", "title": "" }, { "docid": "4e964b921788c4b5258de4abd478e1e0", "score": "0.5786734", "text": "def read_posts_two(blog)\n @doc = Nokogiri::HTML(open(\"#{blog.blog_url}\"))\n if !@doc.nil? \n author_name = @doc.css('div#header h1').text\n @doc.css('div.post').each do |node|\n @post = Post.new\n title_url = node.css('div.title a')\n @post.blog_id = blog.id\n blog.blog_title = \"#{author_name}'s blogs\"\n blog.save!\n @post.title = node.css('div.title').text\n @post.post_date = node.css('div.date').text.to_date\n @post.url = \"http://www.alexrothenberg.com/\" + title_url[0]['href']\n @post.content = node.css('div.extract').inner_html.chomp \n @post.author = author_name \n @post.save!\n end \n end\n end", "title": "" }, { "docid": "82b574694be34da1909d8e2a6e28b1e8", "score": "0.57864004", "text": "def get_metadata\n sets = get_subsets\n sets[:links_and_tags].each do | link, tag |\n file = Output.file '/../cache/raw/source/' + tag + '.html'\n doc = U.parse_html_from_file_or_uri(link, file, :force_fetch => true)\n\n subset_metadata = get_metadata_from_subset(doc, tag)\n merge_subset_to_master(subset_metadata)\n end\n @metadata_master\n end", "title": "" }, { "docid": "f1840c6586230755c570368c8ba7cf1b", "score": "0.5784898", "text": "def post\n if @post = @site.posts.published().where(:slug=>params[:id]).first() || Post.published().where(:id=>params[:id]).first()\n @page_title = @post.name\n\n respond_to do |fmt|\n fmt.html\n fmt.text if @post.markdown?\n end\n else\n raise ActiveRecord::RecordNotFound.new\n end\n end", "title": "" }, { "docid": "fdfac11ea621fd4033292040fe8a2489", "score": "0.57844126", "text": "def setup_meta_data(page)\n @page_title = page.title if page.title.present?\n @page_description = page.meta_description if page.meta_description.present?\n @page_keywords = page.meta_keywords if page.meta_keywords.present?\n end", "title": "" }, { "docid": "246f5b180e732bbb7dfb0e01205ffa59", "score": "0.57827103", "text": "def content\n @content ||= File.read(page_file) rescue content = ''\n end", "title": "" }, { "docid": "f3d7ced4aea9c5368c05fa7fa7f1a08e", "score": "0.57796466", "text": "def meta_data\n return if meta_end.nil?\n\n @io.seek 0\n buffer = @io.gets\n while (line = @io.gets) !~ META_SEP\n buffer << line\n end\n\n yaml_load_erb(buffer)\n end", "title": "" }, { "docid": "c60ce30b4346ea6e6b9bd863c2252837", "score": "0.57792246", "text": "def page_metadata\n metadata = Hash.new\n\n metadata[:site_name] = \"Paul Bogardʼs Flight Historian\"\n metadata[:title] = content_for(:title) || metadata[:site_name]\n metadata[:title_and_site] = [content_for(:title), metadata[:site_name]].compact.join(\" – \")\n \n default_description = \"Paul Bogardʼs Flight Historian shows maps and tables for various breakdowns of Paulʼs flight history.\"\n metadata[:description] = content_for?(:meta_description) ? content_for(:meta_description) : default_description\n\n metadata[:url] = request.original_url\n\n if content_for(:og_image)\n metadata[:image] = URI.join(root_url, content_for(:og_image))\n else\n metadata[:image] = URI.join(root_url, image_path(\"open-graph-image.png\"))\n end\n\n return metadata\n end", "title": "" }, { "docid": "ded1ac2fbc596b465c84dca140c2c800", "score": "0.5778366", "text": "def meta_description(page = current_page)\n if content_for?(:meta_description)\n yield_content(:meta_description)\n elsif page.data.description\n page.data.description\n else\n data.site.meta_description\n end\n end", "title": "" }, { "docid": "d53004688812b575a8bf8aabe76a4d11", "score": "0.5777394", "text": "def contents\n read\n end", "title": "" }, { "docid": "0d227e94755cefc93319f8f42bc0e31e", "score": "0.5774415", "text": "def desired_contents\n self.load\n\n @loaded_content[:desired_contents]\n end", "title": "" }, { "docid": "15bf580f8b508a3ca9930e64a98ba5d8", "score": "0.576772", "text": "def read_post\n return unless @model.is_a?(Post)\n if @model.read_status != 'R'\n BoardRead.mark_read(term.current_user, @model, @model.board)\n end\n term.erase_all\n str = ''\n str << \"글쓴이 : #{@model.writer.username} (#{@model.writer.nickname})\\n\"\n str << \"날 짜 : #{@model.created_at}\\n\"\n str << \"제 목 : #{@model.title.unicode_slice(term.columns - 10)}\\n\\n\"\n str << @model.content\n editor = term.readonly_editor.new(term)\n editor.exit_on = %i(n p)\n editor.show(str: str)\n end", "title": "" }, { "docid": "06413a2d6d4205263f678000f8a41136", "score": "0.57625717", "text": "def get_contents\n @feed_metadata.merge({items: @feed_items.map{ |i| get_item_contents(i) } })\n end", "title": "" }, { "docid": "9ba47b4e42b29ab215e898f8cc96860b", "score": "0.57515526", "text": "def meta\n file.meta\n end", "title": "" }, { "docid": "9ba47b4e42b29ab215e898f8cc96860b", "score": "0.57515526", "text": "def meta\n file.meta\n end", "title": "" }, { "docid": "0a15bd6e53dfab404d2abbe535e9eeb3", "score": "0.57460576", "text": "def get_content\n __getobj__()\n end", "title": "" }, { "docid": "22ae9dad61ba7e12792b0dd691a0c446", "score": "0.57437783", "text": "def get_post(blob)\n name = /(?<year>\\d\\d\\d\\d)-(?<month>0[0-9]|1[0-2])-(?<day>[0-2][0-9]|3[01])-(?<title>\\S*).(md|markdown)/.match(blob.name)\n if name\n begin\n date = Date.new name[:year].to_i, name[:month].to_i, name[:day].to_i\n rescue\n return nil\n end\n title = name[:title].gsub /_/, ' '\n source = blob.data.force_encoding(\"UTF-8\")\n history, authors = get_post_history blob\n return Post.new(title: title, date: date, source: source, authors: authors, history: history)\n end\n return nil\n end", "title": "" }, { "docid": "2f2f06a4cb32dca46305448bb414ca44", "score": "0.57407033", "text": "def content\n page.formatted_data\n end", "title": "" }, { "docid": "9a2eeb293d9ecd1e49a29a77fc698c89", "score": "0.5740651", "text": "def get_description_from_stream(stream_object)\n if stream_object.search(\"//meta[@name='description']\")\n description = stream_object.search(\"//meta[@name='description']\").first\n end\n if description == nil\n description = \"\"\n else\n description=description[\"content\"]\n end\n description\nend", "title": "" }, { "docid": "13154d84f9f94722193ac99a3727b032", "score": "0.5738026", "text": "def metadata\n # @metadata ||= \n get_raw_metadata\n end", "title": "" }, { "docid": "f593fec4429641908d9ab1cd39d7df01", "score": "0.5737306", "text": "def extract_metadata(file)\n document = parse_kramdown(file)\n toc = ::Kramdown::Converter::Toc.convert(document.root)\n toc_items = toc[0].children.select { |el| el.value.options[:level] == 2 }.map do |t| \n {:id => t.attr[:id], :text => t.value.children.first.value}\n end\n\n metadata = document.root.options[:metadata]\n metadata[:toc] = toc_items\n metadata[:converted] = document.to_html\n metadata[:technologies] = metadata[:technologies].split(\",\")\n metadata\n end", "title": "" }, { "docid": "ac7bcf89cc930d35baed66a171f2b7c6", "score": "0.5736221", "text": "def metadata\n @data.fetch(\"metadata\")\n end", "title": "" }, { "docid": "8be72ca680ec165bc0bd2562da1e4ce1", "score": "0.5732075", "text": "def docs\n Jekyll.logger.debug(\"metadata\") { \"registering posts, pages, documents hooks\" }\n Jekyll::Hooks.register [:posts, :pages, :documents], :pre_render do |d, p|\n p[\"page\"][\"metadata\"] = Drop.new(Queries::Stat.run({\n path: path_of(d),\n }).as_json)\n end\n end", "title": "" }, { "docid": "b79e361bce1c914f74ca8d6010aa3c4d", "score": "0.5727332", "text": "def parse_post(post_text)\n json = JSON.parse post_text\n post = Post.new\n\n root_url = json[\"website\"][\"authenticUrl\"]\n\n post.author = json[\"item\"][\"author\"][\"displayName\"]\n post.title = json[\"item\"][\"title\"]\n post.published = json[\"item\"][\"publishOn\"]\n post.url = json[\"item\"][\"urlId\"]\n post.filename = \"#{File.basename post.url}.html\"\n post.tags = json[\"item\"][\"tags\"] || []\n next_url = json[\"pagination\"][\"nextItem\"][\"fullUrl\"] unless json[\"pagination\"][\"nextItem\"].nil?\n post.next_url = \"#{root_url}#{next_url}\"\n post.content = json[\"item\"][\"body\"]\n post.content = json[\"item\"][\"promotedBlock\"] if post.content.nil? || post.content.empty?\n post\n end", "title": "" }, { "docid": "5879653966ec0fe3e0dde7e19af13e22", "score": "0.57241774", "text": "def show\n @content = @post\n end", "title": "" }, { "docid": "1499edad7d61ab600a028462ff9748f3", "score": "0.5722211", "text": "def page_content(title)\n\tFile.read(\"pages/#{title}.txt\")\nrescue Errno::ENOENT\n\treturn \"no data on this\"\nend", "title": "" }, { "docid": "7cacfbaaa9b8e2450c57dcf35e9b742c", "score": "0.57221127", "text": "def contents blog\n File.read(blog.file_path).html_safe\n end", "title": "" } ]
f8b8cf1197a776a9fe8c6b741a45aede
calculate total user has pledged for this project
[ { "docid": "db7b4751a51af5ecaf9f87d872db920d", "score": "0.7118034", "text": "def backer_pledged(user)\n total = 0\n self.pledges.each do |pledge|\n if pledge.user == user\n total += pledge.dollar_amount\n end\n end\n return total\n end", "title": "" } ]
[ { "docid": "71a359bf3c8d9b66cf6ba4bb292aba06", "score": "0.6840665", "text": "def individual_final_amount\n self.final_amount / self.users.length\n end", "title": "" }, { "docid": "d6dc4bea121879e49ecd7305f5995fb3", "score": "0.677181", "text": "def money_charity\n total_generated_user = []\n self.users.each do |user|\n total_generated_user << user.searches.count * Euros_per_search\n end\n (total_generated_user.sum + (SEEDED_AMOUNT / Charity.all.count)).round\n end", "title": "" }, { "docid": "97535d16d9a1a847b0fc40fe322e9efa", "score": "0.6681075", "text": "def total_pledged\n end", "title": "" }, { "docid": "5bc02f5278777eaae14042c1a46c8a15", "score": "0.6680192", "text": "def total_number()\n puts \"Total number of users till now: #@@number_of_users\"\n \n end", "title": "" }, { "docid": "69d0aa202636d1a77a94af9aeb717b0c", "score": "0.65684944", "text": "def total_user_count\n return @total_user_count\n end", "title": "" }, { "docid": "2032d6075d63c305213eaf7b19ee9bb5", "score": "0.65622944", "text": "def user_stats\n puts \"Weight: #{self.weight}\" #puts user info (goal, weight)\n puts \"Goal: #{self.goal}\"\n puts \"Workouts: \" #puts all the workouts associated with our user\n UserWorkout.all.select {|workout| workout.user_id == self}\n puts workout\n #puts total calories burnt per workout\n\n #total calories burnt\n #\n end", "title": "" }, { "docid": "03abaae9a3488465cf986530c2ce450f", "score": "0.65075386", "text": "def points\n total = 0\n\n if self.users == nil\n total = 0\n else\n self.users.each do |user|\n total += user.points\n end\n end\n total\n end", "title": "" }, { "docid": "4ba1831d6e6b9abfbc35a14529023de6", "score": "0.65063107", "text": "def total_users_count\n return @total_users_count\n end", "title": "" }, { "docid": "22f9bf916c5f014a9cb9df12bbd63b27", "score": "0.64623594", "text": "def calculate_user(user)\n user_responses = Response.where(user_id: user.user_id)\n (user_responses.where(\"length(response_text) >= 40\").count + calculate_user_q(user)) * 2\n end", "title": "" }, { "docid": "dfc984357750727126b292d4cb75add9", "score": "0.64550346", "text": "def total_level\n total_level = 0\n self.user_skills.each do |user_skill|\n total_level += user_skill.level\n end\n return total_level\n end", "title": "" }, { "docid": "1c1c951d9c3698cfe62fc0dd24cf5f19", "score": "0.64400876", "text": "def total(user)\n tot = 0\n hours = Hour.where(user_id: user.id, approved: true)\n for x in 0..hours.count-1\n tot += hours[x].content\n end\n return tot\n end", "title": "" }, { "docid": "c304629ce867cfcf7b9185ad8fba8b27", "score": "0.6432336", "text": "def cand_score\n\n if self.watchings == []\n watchings_count = 0\n else\n watchings = Watching.all\n watchings_array_user_id = watchings.map { |watching| watching.user_id }\n watchings_filtered = watchings_array_user_id.select {|user_id| user_id == self.id}\n watchings_count = watchings_filtered.compact.count\n end\n\n if self.endorsements == []\n endorsements_count = 0\n else\n endorsements = Endorsements.all\n endorsements_array_user_id = endorsements.map { |endorsements| endorsements.user_id }\n endorsements_filtered = endorsements_array_user_id.select {|user_id| user_id == self.id}\n endorsements_count = endorsements_filtered.compact.count\n end\n\n sum_score = endorsements_count + watchings_count\n end", "title": "" }, { "docid": "1b9a0da6b5814b4589da38ce0b404a88", "score": "0.64174396", "text": "def automatically_calculate_stats\n completed_projects = Project.fundraising_completed\n self.total_lives_impacted = completed_projects.sum(:primary_lives_impacted) + \n completed_projects.sum(:secondary_lives_impacted)\n self.total_completed_projects = completed_projects.size\n \n self.total_unique_donors = Donation.count(:email, :distinct => true)\n self.total_citizen_philanthropists = Role.cp.users.size\n self.total_dollars_donated = \n MoneyConversion.cents_to_dollars(Donation.sum(:project_amount_in_cents, :conditions => \"project_id is not null\"))\n self.total_projects_in_progress = Project.needing_donations.size\n \n self.save\n end", "title": "" }, { "docid": "a21c456a66c31aad0b3c08cb9371d776", "score": "0.6406011", "text": "def user_kudos(user)\n\t\t\tkudos = 0\n\t\t\tuser.posts.each do |post|\n\t\t\t\tkudos += post.cached_votes_score\n\t\t\tend\n\t\t\tuser.comments.each do |comment|\n\t\t\t\tkudos += comment.cached_votes_score\n\t\t\tend\n\t\t\treturn kudos\n\t\tend", "title": "" }, { "docid": "de585e7eb96a0ca13402d9dd67a9c1bd", "score": "0.63873863", "text": "def find_my_projects_sum (user)\n \t\t# returns a mapping [project name, client info, sum of hours, id]\n \t\tuser.staffed_projects.map{\n \t\t\t|p|[p.name, p.client, p.entries.reduce(0) do |sum, entry| \n \t\t\t\t\tsum = sum + entry.hours \n \t\t\t\tend, p.id\n \t\t\t]\n \t\t}\n \tend", "title": "" }, { "docid": "966cf1ada21fe5d9717a75b4df7b32f7", "score": "0.63647026", "text": "def total_reach\n @reach ||= User.where(twitter_id: followers_twitter_ids).select(:followers_counter).map(&:followers_counter).sum\n end", "title": "" }, { "docid": "4a842e96d35e0a24bdae091ada42ef62", "score": "0.6360092", "text": "def total_pledged\n total = 0\n self.pledges.each do |pledge|\n total += pledge.dollar_amount\n end\n return total\n end", "title": "" }, { "docid": "4a842e96d35e0a24bdae091ada42ef62", "score": "0.6360092", "text": "def total_pledged\n total = 0\n self.pledges.each do |pledge|\n total += pledge.dollar_amount\n end\n return total\n end", "title": "" }, { "docid": "c6978c5ea6980e1ed7e5cde9b093b6df", "score": "0.63485914", "text": "def total_pledged()\n pledge_amounts = self.pledges().map() { | pledge | pledge.amount() }\n #Must reduce to 0 and not nil for .above_goal() to work\n pledge_amounts.reduce(0) { | memo, amount | memo + amount }\n end", "title": "" }, { "docid": "a26853157dc107a30838f84d93aec6a2", "score": "0.6340055", "text": "def user_praise_tally(user)\n user.deeds.joins(:votes).where(\"votes.value = 1\").count\n end", "title": "" }, { "docid": "50ce73c0ee79a4e4ca26ebee6cdacf19", "score": "0.63385755", "text": "def total_users\n self.users.uniq.count\n end", "title": "" }, { "docid": "e4b41fc9738fba418953adcd7806ba68", "score": "0.6332665", "text": "def user_total_statistics(user)\n all_user_guesses = user.guesses.count\n all_user_guesses_correct = 0\n \n user.guesses.each do |guess|\n if guess.correct\n all_user_guesses_correct += 1\n end\n end\n \n #calculate percentage\n \tunless all_user_guesses == 0\n total_percent_correct_for_user = (all_user_guesses_correct / all_user_guesses.to_f * 1000).to_i/10.to_f\n \"#{total_percent_correct_for_user}% (#{all_user_guesses_correct} / #{all_user_guesses})\"\n else\n \"No guesses yet\"\n end\n end", "title": "" }, { "docid": "815e80d2df4a4740cd62fe0f0b896c3b", "score": "0.6294578", "text": "def num_users_allergic\n self.users.count\n end", "title": "" }, { "docid": "24fa50442187ccfd2bb7f297e4fb7bf5", "score": "0.62915903", "text": "def times_solved\n User.all.inject(0) { |sum, user| sum + (self.passed?(user) ? 1 : 0) }\n end", "title": "" }, { "docid": "a5e7c2004ac5e8a5d28fe039204e4b75", "score": "0.62651813", "text": "def total_user_membership\nself.memberships.inject(0){|sum, mem| sum += mem.cost}\n\n\nend", "title": "" }, { "docid": "55f2f311ed2663b4231799cdea7844c1", "score": "0.62628466", "text": "def total_upvotes\r\n self.user.master_songs.sum(:song_up_votes_count)\r\n end", "title": "" }, { "docid": "76fec5635257796befae52de92f5b7c9", "score": "0.6256363", "text": "def user_count\n return @user_count\n end", "title": "" }, { "docid": "a22aac6b7b36c8364ce8375f2b967892", "score": "0.6253962", "text": "def org_score\n if self.watchings == []\n watchings_count = 0\n else\n watchings = Watching.all\n watchings_array_user_id = watchings.map { |watching| watching.user_id }\n watchings_filtered = watchings_array_user_id.select {|user_id| user_id == self.id}\n watchings_count = watchings_filtered.compact.count\n end\n\n endorsements = self.endorsements.map { |endorsement| endorsement }\n\n sum_score = endorsements.compact.count + watchings_count\n end", "title": "" }, { "docid": "2f1a4b3f4c02807ab055f9ce69292b7d", "score": "0.6251951", "text": "def running_total\n run_total = 0\n self.chores.where(completed: true).each do |chore|\n run_total += chore.points\n end\n \n self.total = run_total\n end", "title": "" }, { "docid": "2f1a4b3f4c02807ab055f9ce69292b7d", "score": "0.6251951", "text": "def running_total\n run_total = 0\n self.chores.where(completed: true).each do |chore|\n run_total += chore.points\n end\n \n self.total = run_total\n end", "title": "" }, { "docid": "40ab6430cd8daba46a283d47eef07067", "score": "0.62460345", "text": "def get_user_total(user)\n self.get_user_items(user).to_a.sum(&:user_cost)\n end", "title": "" }, { "docid": "1f9fac24f795443250eafe78228cdc12", "score": "0.62387806", "text": "def total_completed\n count = TaskApplication.where( user_id: self.id, approved: true ).to_a.count\n return count\n end", "title": "" }, { "docid": "9683437539bb7f6803a8d2062095891c", "score": "0.6203019", "text": "def total_pledges_amount\n pledges.active.sum(:amount)\n end", "title": "" }, { "docid": "0f8c1da38eba29faae4bd113cf15536b", "score": "0.6199285", "text": "def user_pick_summary\n @users = User.where(admin: false)\n @pick_summary = []\n\n @users.each do |u|\n user_pick_count = 0\n\n @active_week.games.each do |g|\n if g.picks.where(user_id: u.id)[0]\n user_pick_count += 1\n end\n end\n\n @pick_summary.push user_pick_count\n user_pick_count = 0\n end\n end", "title": "" }, { "docid": "899df7ab829d2ead2913c84e2a7d1017", "score": "0.61965954", "text": "def total_points_against\n self.players.sum(:points_against)\n end", "title": "" }, { "docid": "be4b763ddc66d29b01c1e86a803938f7", "score": "0.6189418", "text": "def member_votes_needed\n return self.project.members.length\n end", "title": "" }, { "docid": "cd3ec5aea52dbbe4cb9b6c78e1cac03b", "score": "0.6188964", "text": "def total\n (people * 0.375).ceil\n end", "title": "" }, { "docid": "78c5407d135e0923b25c40067a9e9d9e", "score": "0.6186933", "text": "def user_accessed_count\n total_users_visit_each_functions.values.sum\n end", "title": "" }, { "docid": "a8c5032ad0d89eb13adebaa3e492683f", "score": "0.61835015", "text": "def user_karma_tally(user)\n vote_karma = user.deeds.joins(:votes).sum(\"votes.value\") * KARMA_MODIFIER\n user.payments.each do |p|\n vote_karma += p.karma\n end\n vote_karma\n end", "title": "" }, { "docid": "92a4a4186925c0ab089d015c067eb0c7", "score": "0.6180788", "text": "def user_commitment_score user\n \n user_commitment_score = 0;\n commitment_count = 0;\n \n user.commitments.each do | commitment |\n if (commitment_score(commitment) != {})\n commitment_count += 1\n commitment_score = commitment_score(commitment)\n \n user_commitment_score += commitment_score[user.id]\n\n end\n end\n\n return user_commitment_score == 0 ? 100 : user_commitment_score/commitment_count\n end", "title": "" }, { "docid": "324a746838902f4a01359baa666e76e3", "score": "0.61748224", "text": "def get_work_hours_per_week\n work_hours_per_week = 0\n @project.members.each do |member|\n work_hours_per_week += member.user.custom_field_value(UserCustomField.find_by(name: \"Munkaóra/Hét\").id).to_i\n end\n work_hours_per_week\n end", "title": "" }, { "docid": "10088422cc5d2698c0a9f715a697756b", "score": "0.61729753", "text": "def total_contribution_by(user)\n contributions.where(user: user).with_states(:scheduled, :completed).map(&:amount).inject { |a, e| a + e } || 0\n end", "title": "" }, { "docid": "fac57f7579c5f76bdbea46c193906594", "score": "0.61630744", "text": "def calculate_user_q(user)\n user.completed.to_s(2).scan(/1/).count\n end", "title": "" }, { "docid": "0081342d46002f5b9f33ad0ca1fcaad5", "score": "0.6151523", "text": "def successful_users_count\n return @successful_users_count\n end", "title": "" }, { "docid": "431d6bfe560f18a8594ef3f28da4a8a4", "score": "0.6150728", "text": "def mcount user\n (skills.to_set & user.skills.to_set).size \n end", "title": "" }, { "docid": "431d6bfe560f18a8594ef3f28da4a8a4", "score": "0.6150728", "text": "def mcount user\n (skills.to_set & user.skills.to_set).size \n end", "title": "" }, { "docid": "431d6bfe560f18a8594ef3f28da4a8a4", "score": "0.6150728", "text": "def mcount user\n (skills.to_set & user.skills.to_set).size \n end", "title": "" }, { "docid": "fde48a78871db14878daf1130a342d48", "score": "0.6148481", "text": "def user_shame_tally(user)\n user.deeds.joins(:votes).where(\"votes.value = -1\").count\n end", "title": "" }, { "docid": "270102037b1ddf4b91d4a4ac60d0f48d", "score": "0.61465096", "text": "def panishments_sum\n TasksUser.joins('JOIN tasks ON tasks.id = task_id').where(:panished => true).where('tasks_users.user_id = ?', self.id).sum('tasks.cost').to_i * PANISH_KOEF\n end", "title": "" }, { "docid": "e715246df09093b8f3baa57ad6fc0a23", "score": "0.61410284", "text": "def licensed_user_count\n return @licensed_user_count\n end", "title": "" }, { "docid": "659c12447133b386f99eeffacf9a9b43", "score": "0.61367226", "text": "def user_percents(user)\n\t\tif user.results[\"score\"].present?\n\t\t\treturn user.results[\"score\"]\n\t\tend\n\t\n\t\tcompetition=Competition.find(user.competition_id)\n\t\tproblems_percents=competition.problems_percents\n\t\tproblems=competition.problems\n\t\tuser_results=user.results\n\t\tuser_perc=0\n\n\t\tproblems.each do |p|\n\t\t\tif user.results[\"answer_#{p.id}\"][:check_answer]\n\t\t\t\tuser_perc += problems_percents[\"percent_problem_#{p.id}\"]\n\t\t\tend\n\t\tend\t\t\n\t\tuser.results[\"score\"]=user_perc\n\t\tuser.save!\n\t\treturn user_perc\n\tend", "title": "" }, { "docid": "087ef5112f5d9793fcc8c73a107b13dd", "score": "0.6131566", "text": "def cult_population\n self.followers.count \n end", "title": "" }, { "docid": "8c60f02d6a7c7c3c3740d62f1e915c78", "score": "0.61295354", "text": "def total_user_event_payments()\n\t\tevent = self.event\n\t\tuser = self.user\n\n\t\tevent_payments_already_made = 0\n\t\tif !user.payments.find_all_by_event_id(event).nil?\n\t\t\tuser.payments.find_all_by_event_id(event).each do |payment|\n\t\t\t\tevent_payments_already_made += payment.amount\n\t\t\tend\n\t\tend\n\n\t\tevent_payments_already_made\n\tend", "title": "" }, { "docid": "e55b9de56fc5bb902ac2e9d3154957dc", "score": "0.6121147", "text": "def calculate_progress(course, user)\n total_lessons = 0.0\n completed_lessons = 0.0\n progress_by_user = Set.new\n\n # Pick out the lesson ids of all the lessons the user has completed\n Progress.all.each do |progress|\n if progress.user_id == user.id\n progress_by_user.add(progress.lesson_id)\n end\n end\n\n # Count the amount of total lessons and the amount of lessons completed by the user in this course\n course.sections.each do |section|\n section.lessons.each do |lesson|\n total_lessons += 1\n if progress_by_user.include? lesson.id\n completed_lessons += 1\n end\n end\n end\n\n if total_lessons == 0\n return 0.0\n else\n return completed_lessons / total_lessons\n end\nend", "title": "" }, { "docid": "70555aac0db3a1ed537599794e0d02b6", "score": "0.61202645", "text": "def calculate_users_contribution(user)\n lines = 0\n contributions = get_user_translation_contributions(user)\n contributions.pluck(:text).each do |text|\n lines += Language.score_lines(text)\n end\n lines\n end", "title": "" }, { "docid": "605b03aae13a69bee46ce35d40dfc64b", "score": "0.60961765", "text": "def total_actual_effort\n sum = 0.0\n self.project_phase_deliverables.each do |deliverable|\n sum += deliverable.total_logged_effort\n end\n return sum\n end", "title": "" }, { "docid": "1f97c169503b1bc9e6e47a8ae1d65b28", "score": "0.6095041", "text": "def total_people\n legislatures.map(&:person_count).inject(:+)\n end", "title": "" }, { "docid": "4c742555ea2ac9da4fb14354c7716c03", "score": "0.6092814", "text": "def status\n goals = self.goals \n return 0 if goals.length == 0\n sum = 0\n goals.find_each do |goal|\n sum = sum + goal.goal_grade\n end\n\n return sum/goals.length\n end", "title": "" }, { "docid": "c938d283a48793b75367a892b3e4f42f", "score": "0.6086362", "text": "def find_my_projects_sum\n \t\t# returns a mapping [project name, client info, sum of hours, id]\n \t\tcurrent_user.staffed_projects.map{\n \t\t\t|p|[p.name, p.client, p.entries.reduce(0) do |sum, entry| \n \t\t\t\t\tsum = sum + entry.hours \n \t\t\t\tend, p.id\n \t\t\t]\n \t\t}\n \tend", "title": "" }, { "docid": "694780555c680a6f9af8b8db1fa6982d", "score": "0.60856414", "text": "def cult_population\n self.followers.count\n end", "title": "" }, { "docid": "9ef799c89cec38e02e727cb337aac108", "score": "0.60810447", "text": "def user_usage\n div_0 = lambda {|a,b| b.zero? ? 0 : (a * 100 / b.to_f)}\n retained = lambda do |days|\n 'SELECT COUNT(*) FROM (SELECT user_id, MAX(latest_day_backed_up) AS l, DATE(users.created_at) AS r ' +\n 'FROM backup_sources INNER JOIN users ON users.id=backup_sources.user_id ' +\n \"WHERE users.created_at > '#{days.days.ago.to_s(:db)}' \" +\n 'GROUP BY user_id ' +\n 'HAVING DATEDIFF(l,r) <= ' + days.to_s + ') t'\n end\n\n registrations = Member.active.count\n activations = Member.active.with_sources.count\n activations_30 = Member.active.created_at_gt(1.month.ago).with_sources.count\n activations_90 = Member.active.created_at_gt(3.months.ago).with_sources.count\n retained30 = Member.count_by_sql(retained.call(30))\n retained90 = Member.count_by_sql(retained.call(90))\n \n stats = []\n\n stats << ['a_r', div_0.call(activations,registrations)]\n stats << ['p_retained30', div_0.call(retained30, activations_30)]\n stats << ['p_retained90', div_0.call(retained90, activations_90)]\n\n render :text => stats.map {|stat| stat[0] + ' = ' + stat[1].to_s}.join(\"\\n\")\n end", "title": "" }, { "docid": "e287d8686134de2028a294ef9d5bce59", "score": "0.60772794", "text": "def user_percentage\n users.count / User.count.to_f\n end", "title": "" }, { "docid": "61330116144ee3bc74f3d442d0be3922", "score": "0.607453", "text": "def user_summary (new_user_id)\n user_id = new_user_id || session_user.id\n # user_id = session_user.id\n # shares = Share.where(user_id: user_id) can we sum\n total = Share.where(user_id: user_id).sum(:amount_owed_cents)\n total\n end", "title": "" }, { "docid": "b79c06d4241cfed0ea530c282deebda1", "score": "0.60717756", "text": "def total_exp_pts\n total_exp = 0 \n self.user_skills.each do |user_skill|\n total_exp += user_skill.experience_pts\n end\n return total_exp\n end", "title": "" }, { "docid": "e70ab899b34ad1af8c04673ded3d6ca5", "score": "0.60642725", "text": "def total\n @users = User.all\n end", "title": "" }, { "docid": "bcbf3b9bd34e69696dc1e77c1d6fb48a", "score": "0.6043333", "text": "def total_user_event_purchases()\n\t\tevent = self.event\n\t\tuser = self.user\n\n\t\ttotal_user_event_purchase = 0\n\t\tif !user.purchases.find_all_by_event_id(event).nil?\n\t\t\tuser.purchases.find_all_by_event_id(event).each do |purchase|\n\t\t\t\ttotal_user_event_purchase += purchase.amount\n\t\t\tend\n\t\tend\n\n\t\ttotal_user_event_purchase\n\tend", "title": "" }, { "docid": "60d66486e3e59958a119c9c70b2207f2", "score": "0.6034607", "text": "def pointsFor user\n user.solutions.sum(:score) + user.problems.sum(:score)\n end", "title": "" }, { "docid": "1a531d9c824121fc5b4a03f299350e70", "score": "0.60297257", "text": "def total(object)\n current_user.send(object).collect{|item| item.cost}.inject(0,:+)\n end", "title": "" }, { "docid": "18326603d005e50b968ead598a653fd0", "score": "0.6023924", "text": "def installed_user_count\n return @installed_user_count\n end", "title": "" }, { "docid": "1cfd15f19108df3a46d71c36800bfef3", "score": "0.60120136", "text": "def get_trip_num\n user= User.find(self.id)\n num =(user.trips+user.created_trips).length\n return num\n end", "title": "" }, { "docid": "cb6b39fba74e2fe3855149b7f71de008", "score": "0.6011797", "text": "def total_count\n users = @client.search_users('language:ruby location:Vietnam')\n return users.total_count\n end", "title": "" }, { "docid": "c9fe7dd4a53d34b9fcfdc4c09ad8832e", "score": "0.60069263", "text": "def calc_win_percentage\n users = User.all\n users.map do |user|\n tips = user.tips.count.to_f\n tips_won = user.tips.where({:won => true}).count.to_f \n if tips > 0\n win_percentag = (tips_won/tips)*100\n user[:win_percentage] = win_percentag\n elsif user.win_percentage > 0 \n user[:win_percentage] = user.win_percentage\n else\n user[:win_percentage] = 0\n end\n user.save\n end\n @users.save\n end", "title": "" }, { "docid": "d51b9e629838e441e9dae4c1b83b0a25", "score": "0.60006404", "text": "def user_progress(user, team)\n progress_per_question = 100.fdiv(questions.count)\n total_progress = 0\n\n questions.each do |question|\n answered_correctly = question.answered_by_user?(\n user, team: team, only_correct: true)\n total_progress += progress_per_question if answered_correctly\n end\n\n total_progress\n end", "title": "" }, { "docid": "f9c9b057ef26a9d1b0c863eb9d9835e8", "score": "0.5999936", "text": "def total_members\n total_members_in(@leaderboard_name)\n end", "title": "" }, { "docid": "323e9af3efcbabbefe9b088a6f0b2de6", "score": "0.59962285", "text": "def total_scns user\n\t\tques_count = user.questions.count\n\t\tans_count = user.answers.count\n\t\ttotal_count = ques_count + ans_count\n\tend", "title": "" }, { "docid": "fc018b1164d2f73fcf2cacfac85c557d", "score": "0.59919643", "text": "def prevalence_in_patients # instance method returns number of unique users who have at least 1 obsession w/ theme content\n User.obsessing_about(self).count\n end", "title": "" }, { "docid": "0d30385f0e632fad1be5a37cf52f668d", "score": "0.59857345", "text": "def total_vote_count_for_user(user)\n count = Vote.where(user: user).count\n # count += ModelYearServiceInterval.where(user_id: user.id).count # This was moved to the Vote model\n count += ModelYearServiceRequirementVote.where(user_id: user.id).count\n end", "title": "" }, { "docid": "3baa266c068aa0435a2873440e7f6ff6", "score": "0.5981043", "text": "def check_total\n return self.checkins.count \n end", "title": "" }, { "docid": "c00ae770c04321d3bc66d38b1e57cd14", "score": "0.59781885", "text": "def get_percent_rated( user_id )\n return 100.0 * get_rated_count(user_id) / get_count( user_id ) \n end", "title": "" }, { "docid": "57218420f34245e52c65bdd5b54926fa", "score": "0.5977147", "text": "def cults_following \n recruited = BloodOath.all.select{|bloodoath| bloodoath.follower == self}.count \n joined = BloodOath.all.select{|bloodoath| bloodoath.cult == self}.count\n total = joined + recruited\n total\n end", "title": "" }, { "docid": "8f6e7caeb6289a3ed3a2ab2dff9f960a", "score": "0.597573", "text": "def get_progress(user)\n\t\tInteger(num_completed(user).fdiv(total_sentences) * 100)\n\tend", "title": "" }, { "docid": "7d068677ced9898c0db84f8ae9e014c1", "score": "0.59691745", "text": "def total_user_responses\n total = UserResponse.where(:user_id => object.id).count\n end", "title": "" }, { "docid": "eba434a05d8cdb3453406d5b88d7d39c", "score": "0.5967071", "text": "def progress_for(user: nil)\n return 0 unless user.present?\n\n leaves = self.leaves\n achievable_ids = leaves.map { |r| r.id } # collect all the leave achievable id's\n achievements = user.achievements.where('achievable_id in (?)', achievable_ids)\n achievement_count = achievements.count\n\n # MultipleChoiceRequirements are considered leaves, but will never have associated achievements\n # because they're computed \"on the fly,\" so we need to compute them, too\n leaves.select { |r| r.is_a?(MultipleChoiceRequirement) }.each do |requirement|\n achievement_count += 1 if requirement.completed_by?(user: user)\n end\n\n (achievements.count.to_f / leaves.count.to_f) * 100\n end", "title": "" }, { "docid": "f37c042edbf3e5639b5deb263686c083", "score": "0.59622514", "text": "def total_votes_reached\n c = 0;\n self.all.each {|i| c += i.votes_reached }\n c \n end", "title": "" }, { "docid": "d8bbca1d89b52f16ef90e75aa6ea5fcb", "score": "0.5958711", "text": "def lift_total_sum\n lifters.map { |lifter| lifter.lift_total }.sum\n total = 0\n # memberships.each { |gym| total += gym.lifter.l ift_total } total\n end", "title": "" }, { "docid": "03d093ab13e14721f46d631a7b2568e8", "score": "0.5953653", "text": "def calculate_user_commit_count(commiter_name)\n\t\tcommiter_name = commiter_name.sort\n\t\t$all_user = Hash.new(0)\n\t\tcommiter_name.each { |name| $all_user[name] += 1}\t\n\tend", "title": "" }, { "docid": "5a9109398243cd836d4d3e5f901fd537", "score": "0.5938013", "text": "def get_game_percent_rated( user_id )\n return 100.0 * get_rated_count(user_id) / get_count( user_id )\n end", "title": "" }, { "docid": "e953e844899f80262aff2b25f11f06c5", "score": "0.5935485", "text": "def member_votes\n member_votes = 0\n self.votes.each do |vote|\n if self.project.members.include?(vote.user)\n member_votes += vote.vote\n end\n end\n return member_votes\n end", "title": "" }, { "docid": "fcc83daaf1467949eff195c8cc6d766a", "score": "0.59271145", "text": "def num_completed(user)\n\t\tUserSentenceCompleted.where(user_id:user.id, dataset_id: get_dataset.id).count\n\tend", "title": "" }, { "docid": "168c5bb457429053476119c485905830", "score": "0.59188193", "text": "def amount_borrowed\n \t@total = self.loans.map do |loan|\n \t\tloan.total\n \tend\n \t@total = @total.inject { |sum, n| sum + n }\n \tend", "title": "" }, { "docid": "fe10e84d41630bd7c13a0756a931224b", "score": "0.59135455", "text": "def get_total_worth\n accounts = Account.where(:status => \"Open\")\n total_worth = 0\n accounts.each do |account|\n total_worth += get_latest_ammount(account).to_i\n end\n return total_worth \n end", "title": "" }, { "docid": "af6e380e76d535bb13af9274b62561d2", "score": "0.59086", "text": "def points\n Trip.where(user: self).sum(:points)\n end", "title": "" }, { "docid": "afa1b741b42b80bd21d5b789c7b0e8fa", "score": "0.5906207", "text": "def compute_pending_moderation\n @pending_submissions_count = 0\n if user_signed_in?\n feeds = current_user.owned_feeds\n feeds.each do |f|\n @pending_submissions_count += f.submissions.pending.count\n end\n end\n end", "title": "" }, { "docid": "afa1b741b42b80bd21d5b789c7b0e8fa", "score": "0.5906207", "text": "def compute_pending_moderation\n @pending_submissions_count = 0\n if user_signed_in?\n feeds = current_user.owned_feeds\n feeds.each do |f|\n @pending_submissions_count += f.submissions.pending.count\n end\n end\n end", "title": "" }, { "docid": "afa1b741b42b80bd21d5b789c7b0e8fa", "score": "0.5906207", "text": "def compute_pending_moderation\n @pending_submissions_count = 0\n if user_signed_in?\n feeds = current_user.owned_feeds\n feeds.each do |f|\n @pending_submissions_count += f.submissions.pending.count\n end\n end\n end", "title": "" }, { "docid": "9be11042b107de008a4585322120afca", "score": "0.5905448", "text": "def get_computed_total()\n $committers.reduce(0) {|sum, committer| sum + committer[:commit_count]}\nend", "title": "" }, { "docid": "590cb673c38b7fb529e6b943a6c628a4", "score": "0.5904963", "text": "def update_users_clicks_count\n users = User.all\n users.each do |user|\n notes_clicks = user.notes.sum(\"views_count\")\n blogs_clicks = user.blogs.sum(\"views_count\")\n photos_clicks = user.photos.sum(\"views_count\")\n all_clicks = notes_clicks + blogs_clicks + photos_clicks\n user.update_attribute(:clicks_count, all_clicks) if all_clicks > 0\n end\n redirect_to my_path, notice: t('refresh_succ')\n end", "title": "" }, { "docid": "2c1638db82e8e2921f0d35a064d309f7", "score": "0.59023064", "text": "def user_counter\r\n Allergy.all.select{|allergy|allergy.ingredient == self}.count \r\n end", "title": "" }, { "docid": "faf61f8d86f34bf68474225e292fed39", "score": "0.5899421", "text": "def update_user_game_result_count(user, winner_team)\n if winner_team.users.include? user\n user.win_count += 1\n else\n user.lose_count += 1\n end\n user.save!\n end", "title": "" }, { "docid": "537ec306921ba677b7b60e75d41bef50", "score": "0.5898149", "text": "def user_count\n users.count\n end", "title": "" } ]
7c9d16407651ea441f36507c02e5147a
Helper method to display friendly name instead of select value
[ { "docid": "86cf233477b5dd2a9e089fa8e74e6f4a", "score": "0.0", "text": "def opportunity_availability_friendly(opportunity)\n if opportunity.availability == 0\n 'Tiempo completo'\n elsif opportunity.availability == 1\n 'Medio tiempo'\n elsif opportunity.availability == 2\n 'Menos de 20 horas por semana'\n end\n end", "title": "" } ]
[ { "docid": "e652f1fe8a3db30efbe30374fb0e19e3", "score": "0.7590055", "text": "def dropdown_display_name\n \"#{name} (#{email.presence || 'no email'}, user ##{id})\"\n end", "title": "" }, { "docid": "9313304b9e6e6ff14b8eb7ac84207c9f", "score": "0.75744647", "text": "def choice_field_name(value)\n \"#{name}___#{value}\"\n end", "title": "" }, { "docid": "a12ff4838f819f8c93e63b9a823532ba", "score": "0.75122243", "text": "def name_for_select_for_facture\n @name_for_select = self.factcat.name + \" - \" + self.name\n end", "title": "" }, { "docid": "65b0b9df3592089f43009ae91815083f", "score": "0.7498615", "text": "def display_name\n \t\"#{name}\"\n end", "title": "" }, { "docid": "b1fec8d4f44692e2664cd95bc8e0f55e", "score": "0.73494375", "text": "def display_name(options = {}) # :yields: String\n opt = {\n :type => nil\n }.merge!(options.symbolize_keys)\n\n case opt\n when :for_select_list\n primer.display_name + \" \" + pcr.display_name\n else\n filename\n end\n end", "title": "" }, { "docid": "c51298eee5798d536e868e970a3fe09f", "score": "0.72757924", "text": "def display_name\n\t\tself.name.titleize\n\tend", "title": "" }, { "docid": "b94f0144750a716f31e1331c81b674fe", "score": "0.72609675", "text": "def display_name\n \"#{name}\"\n end", "title": "" }, { "docid": "b94f0144750a716f31e1331c81b674fe", "score": "0.72609675", "text": "def display_name\n \"#{name}\"\n end", "title": "" }, { "docid": "b94f0144750a716f31e1331c81b674fe", "score": "0.72609675", "text": "def display_name\n \"#{name}\"\n end", "title": "" }, { "docid": "7e10760fdc32a52c36717faf91041c0c", "score": "0.72383004", "text": "def display_name\n prefered_name\n end", "title": "" }, { "docid": "53e36d92b600dc5358f686afa0c7192b", "score": "0.7227281", "text": "def display_name\n NAME\n end", "title": "" }, { "docid": "53e36d92b600dc5358f686afa0c7192b", "score": "0.7227281", "text": "def display_name\n NAME\n end", "title": "" }, { "docid": "6e9ee22da6c76e946ed08a7627a916cd", "score": "0.7186798", "text": "def display_name\n name\n end", "title": "" }, { "docid": "6e9ee22da6c76e946ed08a7627a916cd", "score": "0.7186798", "text": "def display_name\n name\n end", "title": "" }, { "docid": "eb17ca7136f9c3aa4a10f40a9456a355", "score": "0.71784365", "text": "def to_s\n name_value.titleize\n end", "title": "" }, { "docid": "5b75a3c2923e41f16658815860baab42", "score": "0.7156066", "text": "def display_name\n name\n end", "title": "" }, { "docid": "5b75a3c2923e41f16658815860baab42", "score": "0.7156066", "text": "def display_name\n name\n end", "title": "" }, { "docid": "5b75a3c2923e41f16658815860baab42", "score": "0.7156066", "text": "def display_name\n name\n end", "title": "" }, { "docid": "619c27c6e8772ca3b22e8905ab2641a5", "score": "0.71158123", "text": "def display_name\n name\n end", "title": "" }, { "docid": "effcf21223d5374e4687f86f458de4c2", "score": "0.71015596", "text": "def campanas_dropdown\n \"#{self.name}\"\n end", "title": "" }, { "docid": "7103d048f10618f2eac8b97f1f2a99d1", "score": "0.70157194", "text": "def display_name\n @name.titlecase\n end", "title": "" }, { "docid": "681614e7cd3504d1453af41d3f38ba9f", "score": "0.6966749", "text": "def label\n key.sub('fullname', 'full name').capitalize\n end", "title": "" }, { "docid": "c6a03bb63e8d3a96f4ae1bd0a3ff47c6", "score": "0.6958383", "text": "def formatted_name\n \"#{self.id} - #{self.name}\"\n #This is used to bring value on each page.\n end", "title": "" }, { "docid": "f6e7da0e443208618f9c4273b50a1a44", "score": "0.69223", "text": "def to_label()\n \"[#{person.initials rescue '??' }] #{name.capitalize}\"\n end", "title": "" }, { "docid": "eac79dceb52ec9e46bc165c353f9a2a7", "score": "0.6912932", "text": "def text_for_html_select_option\n self.common_name ||= \"\"\n end", "title": "" }, { "docid": "06e1f7b8c7ab75ccd7bf37e0f448b3ad", "score": "0.6904596", "text": "def name_display\n self.name[I18n.locale]\n end", "title": "" }, { "docid": "5bd88a0f38b7a0078fa37c569e2834fd", "score": "0.688391", "text": "def display_name\n \"#{id}\"\n end", "title": "" }, { "docid": "05a1e8be5adb7d8d18949f6161e052e3", "score": "0.6859221", "text": "def display_name\n @name\n end", "title": "" }, { "docid": "0417603542f6758a7e6c2f756639b319", "score": "0.6834202", "text": "def show_full_name\n name\n end", "title": "" }, { "docid": "221e2431cda6e0414161f9fd4e88ace5", "score": "0.68243146", "text": "def display_name\n if original_name.nil?\n id\n else\n original_name.text.nil? ? id: original_name.text\n end\n end", "title": "" }, { "docid": "a1885d5678ac09248a5c0fa9a53db722", "score": "0.6817984", "text": "def display\n\t\tname\n\tend", "title": "" }, { "docid": "a1885d5678ac09248a5c0fa9a53db722", "score": "0.6817984", "text": "def display\n\t\tname\n\tend", "title": "" }, { "docid": "a1885d5678ac09248a5c0fa9a53db722", "score": "0.6817984", "text": "def display\n\t\tname\n\tend", "title": "" }, { "docid": "a1885d5678ac09248a5c0fa9a53db722", "score": "0.6817984", "text": "def display\n\t\tname\n\tend", "title": "" }, { "docid": "ee977f73867138d7fdb802f5db19eccf", "score": "0.6801812", "text": "def display_name\n\t\tself.short_name\n\tend", "title": "" }, { "docid": "52c7bb50bec9a091d49bfbc3b56fc39c", "score": "0.6799476", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "efbc67dbeb7fc4f00cfd612b66c7847c", "score": "0.6788572", "text": "def text_for_html_select_option\n html = self.full_address\n html += ' | '\n html += self.owner_full_name\n html.gsub( /\\s\\s/, ' ' )\n end", "title": "" }, { "docid": "89c369289cc1d9075866d907bb66d02d", "score": "0.67823243", "text": "def to_s\n\t\tself.name.titleize\n\tend", "title": "" }, { "docid": "62adb7b720e6d9a3249781123b791805", "score": "0.67816216", "text": "def view_label(value)\n value.tr(\"-\", \" \").capitalize\n end", "title": "" }, { "docid": "18670edf10b9407720ab5ff7c3b65146", "score": "0.6780272", "text": "def to_s() name end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "4fb480c6458d4a1cc9a882721688c52f", "score": "0.6768133", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "d8b4225abb56e393293c03e0c899cced", "score": "0.67647326", "text": "def to_s\n display_name\n end", "title": "" }, { "docid": "eba8c475ae0e7425d1f358b6cf1f7bef", "score": "0.67562747", "text": "def display_name\n self.name\n end", "title": "" }, { "docid": "7c05c24be7fd00967d78fe38b57546ff", "score": "0.67562705", "text": "def display_name\n return @display_name\n end", "title": "" }, { "docid": "e8501fcd985a4f648d6fc52ad553c367", "score": "0.6754194", "text": "def human_name\n @name.is_a?(Symbol) ? I18n.t(\"backend.menus.#{@name}\", :default => @name.to_s.humanize) : @name\n end", "title": "" }, { "docid": "e8501fcd985a4f648d6fc52ad553c367", "score": "0.6754194", "text": "def human_name\n @name.is_a?(Symbol) ? I18n.t(\"backend.menus.#{@name}\", :default => @name.to_s.humanize) : @name\n end", "title": "" }, { "docid": "691ac0915306a929be3427f5c255bc84", "score": "0.6748664", "text": "def fullname()\n\t\t[self.name(), self.sport().titleize, self.variety().titleize].join(\" \")\n\tend", "title": "" }, { "docid": "7b0392e61a9b5c4d1f62da41614faa81", "score": "0.67386144", "text": "def display_name\n @display_name\n end", "title": "" }, { "docid": "7c6d63b7cd4e6ae5d1600e4c3c82808a", "score": "0.67325526", "text": "def display_name\n override_name ||= name\n # default to name if the value of override_name is empty string\n override_name = name if override_name.strip == \"\"\n override_name\n end", "title": "" }, { "docid": "64560953672a7c16f4c5f85cdc5afd6a", "score": "0.67243624", "text": "def name\n super.to_s.titleize\n end", "title": "" }, { "docid": "54ff46ffe32f53510d1d64094e1f14c7", "score": "0.6715737", "text": "def pretty_name\n super || name.humanize\n end", "title": "" }, { "docid": "79261ab0e8069e9b40dc6d243c62271c", "score": "0.6702892", "text": "def name\n @display_name || @name\n end", "title": "" }, { "docid": "c6d74394f4386b5fb78615548c55d6e5", "score": "0.67009383", "text": "def admin_display_name\n \"#{course.organization.abbreviation} #{term.slug} #{course.number} (#{label})\"\n end", "title": "" }, { "docid": "4a8a4d438a867f4d1a753fff127e26d5", "score": "0.67003864", "text": "def to_s\n self.name.humanize\n end", "title": "" }, { "docid": "8077318c3c39350aef80e67c94b68c28", "score": "0.66957647", "text": "def to_s\n short_name\n end", "title": "" }, { "docid": "b7e96881946f5ed6f5d721d9b1ac4cbf", "score": "0.6695018", "text": "def name\n @custom_name || @attribute.to_s.humanize\n end", "title": "" }, { "docid": "9067bbc4da42e9979b0b899c0f821b75", "score": "0.6690499", "text": "def name\n display_name\n end", "title": "" }, { "docid": "8d7a7e7b157ed29530943ef10deba6c8", "score": "0.6688004", "text": "def name_seo_display\n (self.name_seo[I18n.locale].present?) ? self.name_seo[I18n.locale].parameterize : \"-\"\n end", "title": "" } ]
6dcfa46348ed54bd0fb7b1c95aa08985
list of all rss feed url
[ { "docid": "8e65f203050f33bd8b656ecd33d328b7", "score": "0.0", "text": "def index \n if params[:id]\n @feed_url = FeedUrl.find(params[:id])\n else\n @feed_url = FeedUrl.new\n end \n end", "title": "" } ]
[ { "docid": "3aff586f71def02bac36e56b770b16c1", "score": "0.8051392", "text": "def feeds\n @all_feeds ||= begin\n @doc.match(FEED_MATCHES).map do |url|\n case url\n when String\n if url.start_with? \"http\"\n url\n elsif @url\n URI.join(@url , url).to_s\n end\n when Array\n url.map do |u|\n if u.start_with? \"http\"\n u\n elsif @url\n URI.join(@url, u).to_s\n end\n end.uniq\n end\n end\n end\n end", "title": "" }, { "docid": "bb6757e04d3f86c1884586e14037c45a", "score": "0.7845982", "text": "def feed(all = false)\n url = @doc.match([['link[@type=\"application/rss+xml\"]', lambda { |el| el.attr('href') }],\n ['link[@type=\"application/atom+xml\"]', lambda { |el| el.attr('href') }]], all\n )\n \n if url && String === url && url !~ /^http/ && @url\n url = URI.join(@url , url).to_s\n elsif url && Array === url\n url.map! do |u|\n if u !~ /^http/ && @url\n URI.join(@url, u).to_s\n else\n u\n end\n end\n url.uniq!\n end\n \n url\n end", "title": "" }, { "docid": "fac7b12df75e084175a3f7936dee2ee2", "score": "0.7516989", "text": "def feed\n url = @doc.match( ['link[@type=\"application/rss+xml\"]', lambda { |el| el.attr('href') }],\n ['link[@type=\"application/atom+xml\"]', lambda { |el| el.attr('href') }]\n )\n \n if url && url !~ /^http/ && @url\n url = URI.join(@url , url).to_s\n end\n \n url\n end", "title": "" }, { "docid": "95949cecf9376ea2b765b52f95b08a47", "score": "0.744937", "text": "def feed\n UrlChecker.get_feed_url( host )\n end", "title": "" }, { "docid": "e1b267c23ad1b4a9f5c62a96415878ce", "score": "0.74457693", "text": "def index\n @rss_urls = RssUrl.all\n end", "title": "" }, { "docid": "35914806b9447b6adc9232c3ed5e4eb6", "score": "0.72764224", "text": "def links_from_atom_feed(feed)\n links = feed.css(\"a\").collect { |a| a[\"href\"] }\n links.grep(/threadless\\.com/)\n end", "title": "" }, { "docid": "b7ce6ff105c1e027dced99cc86164d7c", "score": "0.72564536", "text": "def index\n @rss_feeds = RssFeed.all \n @entries = RssFeedParser.new().fetch_entries(@rss_feeds.collect(&:feed_url))\n end", "title": "" }, { "docid": "b208b256cf6d56871368caa016aa140f", "score": "0.7193531", "text": "def index\n @rssurls = Rssurl.all\n end", "title": "" }, { "docid": "5652862af9a00440f5263730f50e5ec6", "score": "0.7156326", "text": "def fetch_feed_items\n open(url) do |rss|\n feed = RSS::Parser.parse(rss)\n feed.items.each do |item|\n feed_items << FeedItem.create(title: item.title, link: item.link, pub_date: item.pubDate)\n end\n end \n end", "title": "" }, { "docid": "9beb36f10b2b22fa8a8e7f7a26102758", "score": "0.70748264", "text": "def list_feed_url\n @worksheet_feed_entry.css(\n \"link[rel='http://schemas.google.com/spreadsheets/2006#listfeed']\"\n )[0]['href']\n end", "title": "" }, { "docid": "ccd6a925fddd8cbe6c8f2e37aa908315", "score": "0.70610696", "text": "def feed_url\n blog_index_url(format: :rss)\n end", "title": "" }, { "docid": "ccd6a925fddd8cbe6c8f2e37aa908315", "score": "0.70610696", "text": "def feed_url\n blog_index_url(format: :rss)\n end", "title": "" }, { "docid": "ccd6a925fddd8cbe6c8f2e37aa908315", "score": "0.70610696", "text": "def feed_url\n blog_index_url(format: :rss)\n end", "title": "" }, { "docid": "c5b7a6b6a346ca70fa9de1e594399eb3", "score": "0.70587397", "text": "def get_rss_feed( atempts )\n\t\t\tfeed = Feedzirra::Feed.fetch_and_parse( uri , { :max_redirects => atempts })\n\tend", "title": "" }, { "docid": "3e7c27fa2f5bf852ac00c72120c92775", "score": "0.7053807", "text": "def process_rss_descr(_url)\n\turls = Array.new\n\trss = RSS::Parser.parse(_url, false)\n\tcase rss.feed_type\n\t\twhen 'rss'\n\t\t\trss.items.each { |item|\n\t\t\t\tif item.description =~ /^Host: (.*?)\\, IP addr.* Description\\: (.*)/\n\t\t\t\t\thost = $1\n\t\t\t\t\tdescr = $2\n\t\t\t\t\turls.push(host)\n\t\t\t\tend\n\t\t\t}\n\t\twhen 'atom'\n\t\t\trss.items.each { |item| puts item.description.content }\n\tend\n\treturn urls\nend", "title": "" }, { "docid": "c66979006dda65cdf8f8ac059e3847d3", "score": "0.70063573", "text": "def rss_feed\n Nokogiri::XML(content(url))\n end", "title": "" }, { "docid": "8f2bef02ef3111867c298ca82526bfc8", "score": "0.6995625", "text": "def read_all_items\n open(@feed_start_url) do |rss|\n feed = RSS::Parser.parse(rss)\n puts \"Title: #{feed.channel.title}\" unless @options.quiet\n feed.items.each do |item|\n puts \"Item: #{item.title}\" unless @options.quiet\n end\n end\n\n end", "title": "" }, { "docid": "f86a8c0fee273b0966e1755c1cc1172a", "score": "0.69852746", "text": "def rss_feed_pub_dates(feed_url)\n pub_dates = []\n URI.open(feed_url) do |rss|\n feed = RSS::Parser.parse(rss)\n feed.items.each do |item|\n pub_dates << item.pubDate\n end\n end\n pub_dates\n end", "title": "" }, { "docid": "3e6bab6c0f98638cf9e33e5a0b42eeae", "score": "0.6980741", "text": "def get_news_items\n news_items = @feed_urls.each_with_object(Array.new) do |url, items|\n open(url) do |rss|\n feed = RSS::Parser.parse(rss)\n items.concat feed.items\n end\n end\n return news_items.empty? ? nil : news_items\n end", "title": "" }, { "docid": "d644af5b6ffb3bed5e323dc0c57d7383", "score": "0.6976189", "text": "def find_feed_urls(url, find_feed_language = nil)\n # Fetch content\n content_type, charset, data = open(\n url, \"Accept-Language\" => find_feed_language\n ) {|f| [f.content_type, f.charset, f.read] }\n\n # Parse content\n case content_type\n when 'application/xml', 'application/rss+xml', 'text/xml'\n [url]\n when 'text/html'\n # Parse html\n doc = Nokogiri::HTML.parse(data, nil, charset)\n\n # Handle meta-refresh\n meta_refresh = doc.at('meta[http-equiv=\"refresh\"]')\n if meta_refresh\n redirect_url = meta_refresh['content'][/URL=(.+)/, 1].gsub(/['\"]/, '')\n return find_feed_urls(redirect_url, find_feed_language)\n end\n\n # Find feed urls\n doc.xpath('/html/head/link[@type=\"application/rss+xml\"]')\n .map {|n| URI::join(url, n.attribute('href')).to_s }\n else\n []\n end\n end", "title": "" }, { "docid": "209c0e42f39a477db754f1d571724305", "score": "0.69498366", "text": "def getUrls \n txt = self.getALL\n url = URI::extract(txt, /http(s)?/)\n return url\n end", "title": "" }, { "docid": "1d295ab514ec11cd09589db4bf5e230d", "score": "0.6912438", "text": "def fetch_rss_feed(feed_url = self.url)\n torrents = []\n \n open(feed_url) do |rss|\n result = RSS::Parser.parse(rss.read, false)\n \n if result\n result.items.each do |item|\n torrents << new_torrent_from_rss_item(item)\n end\n end\n end\n \n return torrents\n end", "title": "" }, { "docid": "07d4b5ac3a2e1086823460cc4385c57b", "score": "0.6893985", "text": "def urls\n each_url.to_a\n end", "title": "" }, { "docid": "b1d0d2325e101e4a318383b975ca0283", "score": "0.6881117", "text": "def urls\n @urls = Link.limit(42).order(\"created_at desc\")\n\n respond_to do |format|\n format.rss\n format.tsv\n format.xml {\n render :xml => urls_to_xml(@urls, root_url)\n }\n end\n end", "title": "" }, { "docid": "f73d4c5d3dae579b0a46fd780727ad58", "score": "0.68697476", "text": "def fetch_all_feeds(feed_urls)\n feed_collections = Feedzirra::Feed.fetch_and_parse(feed_urls)\n feed_collections.values\n end", "title": "" }, { "docid": "2e8f9f436a04260deea283d956ed03eb", "score": "0.6846084", "text": "def feed_url\n uri\n end", "title": "" }, { "docid": "fab5048360e260732dab4e91c240b934", "score": "0.6820293", "text": "def parse_rss_url(url)\n begin\n content = Feed::get_url url\n rescue\n raise \"Couldn't get URL \\\"#{url}\\\": #$!.\"\n end\n\n # parse URL content\n doc = REXML::Document.new content\n\n # get channel info\n e = nil\n @title = e.text if e = doc.root.elements['//channel/title']\n @link = e.text if e = doc.root.elements['//channel/link']\n @desc = e.text if e = doc.root.elements['//channel/description']\n @lang = e.text if e = doc.root.elements['//channel/language']\n \n # build list of feed items\n @items = []\n doc.root.elements.each('//item') { |e| \n @items << Feed::Item.new(e.elements['title'].text,\n e.elements['link'].text,\n e.elements['description'].text)\n }\n end", "title": "" }, { "docid": "a7d3ceeef6ea54af515256a9f8215f2d", "score": "0.68195266", "text": "def feed(params = {})\n url = params['url'].presence or raise 'No URL specified'\n open(url) do |rss|\n feed = ::RSS::Parser.parse(rss)\n items = feed.items.map { |item| build_content_item(item) }\n return [items, items.count]\n end\n end", "title": "" }, { "docid": "00c369f95a840c0b6e85e8533b1c854c", "score": "0.6813215", "text": "def getFeeds(url,url_path)\n x = Wombat.crawl do\n base_url url\n path url_path\n document_format :xml\n feeds \"xpath=//body/outline/outline[@type='rss']\" , :iterator do\n name \"xpath=./@title\"\n feedURL \"xpath=./@xmlUrl\"\n htmlURL \"xpath=./@htmlUrl\"\n end\n end\n x[\"feeds\"]\n end", "title": "" }, { "docid": "3d0466cdd39af3eba8b8defba9173d22", "score": "0.6793913", "text": "def all_rss_feed_items\n @all_rss_feed_items ||= all_rss_feeds.map(&:items).flatten\n end", "title": "" }, { "docid": "6e8c846cac51cdb5e8b59d550fbcd899", "score": "0.67716163", "text": "def links_feed\n end", "title": "" }, { "docid": "6378a2dfd82cbb4081ff0819fdc0d62f", "score": "0.67545855", "text": "def feeds(uri)\n Rfeedfinder.feeds(uri, @options.dup)\n end", "title": "" }, { "docid": "8dae71da48724d14b49f80cca1d42647", "score": "0.67220527", "text": "def show\n @entries = RssFeedParser.new().fetch_entries([@rss_feed.feed_url])\n end", "title": "" }, { "docid": "8ed524df4b9cd89c1852057c65393f70", "score": "0.67197305", "text": "def fetch_rss_feed\n RSS::Parser.parse( @rss_url )\n end", "title": "" }, { "docid": "09db31b5bdd95f321fb22015834dbcd0", "score": "0.671634", "text": "def get_feeds\n rss.feed.items.each do |item|\n feed = FeedHandler.new item\n @feeds << feed\n end\n\n return @feeds\n end", "title": "" }, { "docid": "a1df8d05a6765b1120e270539845c131", "score": "0.67160165", "text": "def urls\n doc.xpath(\"//sm:url\", sm: xmlns).map do |s|\n SitemapUrl.from_fragment s\n end\n end", "title": "" }, { "docid": "c3bd622468739b9207617abf2a2a1faf", "score": "0.67033", "text": "def urls\n urls = []\n response = Typhoeus::Request.get(@media_selector_url)\n selector_xml = Nokogiri::XML.parse response.body\n selector_xml.css(\"media[service='iplayer_intl_stream_wma_uk_concrete']\").each do |media|\n playlist = media.css(\"connection\").first['href']\n\n response = Typhoeus::Request.get(playlist)\n asx_xml = Nokogiri::XML.parse response.body\n urls = asx_xml.css(\"Entry ref\").map { |ref| ref[\"href\"] }\n end\n urls\n end", "title": "" }, { "docid": "fcd86a9b4f79bc06b5347d9c4d83b037", "score": "0.6654896", "text": "def get_urlposts(url)\n begin\n extract_entries urlposts_xml_http(url)\n rescue SocketError\n extract_entries urlposts_xml_file(url)\n end\n end", "title": "" }, { "docid": "dd57f8132865079a09d3e5844a5776a4", "score": "0.6646244", "text": "def get_video_urls(feed_url)\n Youtube.notify \"Retrieving videos...\"\n urls_titles = {}\n result_feed = Nokogiri::XML(open(feed_url))\n urls_titles.merge!(grab_urls_and_titles(result_feed))\n\n #as long as the feed has a next link we follow it and add the resulting video urls\n loop do\n next_link = result_feed.search(\"//feed/link[@rel='next']\").first\n break if next_link.nil?\n result_feed = Nokogiri::HTML(open(next_link[\"href\"]))\n urls_titles.merge!(grab_urls_and_titles(result_feed))\n end\n\n filter_urls(urls_titles)\n end", "title": "" }, { "docid": "4ff2bde616f028ba4c4900ad1e3114fb", "score": "0.66362524", "text": "def atom_feed_url\n \"#{root_url}/feed.xml\"\n end", "title": "" }, { "docid": "b0f63d0bbb8f2a5bd7fba15529ff3242", "score": "0.6631162", "text": "def images_from_rss\n require 'rss'\n\n images = []\n \n begin \n rss = RSS::Parser.parse(rss_url)\n rescue\n return []\n end\n \n rss.items.each do |item|\n image_srcs_from_string(item.description).each { |i| images << i }\n end\n\n return images\n end", "title": "" }, { "docid": "e0f9cc81a9d658e4739764df7b83a46d", "score": "0.6629981", "text": "def list_feeds(_environment = 'test')\n ret = http_get('feeds')\n val = []\n ret.each { |f| val.push(f['id']) }\n val\n end", "title": "" }, { "docid": "c8b7b79f7f6f41472241a5b387238293", "score": "0.66172475", "text": "def fetch \n items = []\n # File.open(options[:feeds], 'r').each_line { |f| }\n options[:feeds].each { |url|\n p \"Fetching: #{url}\"\n open(url) do |rss| \n doc = Nokogiri::XML(rss.read) # Nokogiri::XML::ParseOptions::NOCDATA\n doc.xpath('//item').map do |i|\n items << { \n title: i.xpath('title').text, \n description: i.xpath('description').text, \n link: RSS::Util.item_source_url(i),\n image: RSS::Util.item_image_url(i), \n category: i.xpath('category').text, \n pubDate: Time.parse(i.xpath('pubDate').text)\n }\n end\n end \n } \n items.sort_by { |k| k[:pubDate] }.reverse \n end", "title": "" }, { "docid": "d4443306003f19d69a02e2d472a4f0fa", "score": "0.66149753", "text": "def find_feed_url(html)\r\n feed = html.at('head > link[type=\"application/rss+xml\"]')\r\n feed ? feed['href'] : nil\r\n end", "title": "" }, { "docid": "788fdd53296fbdf6b8e7b28a21e990e8", "score": "0.66094106", "text": "def feed_href_list()\n if !defined?(@feed_href_list) || @feed_href_list.nil?\n @feed_href_list_override = false\n if self.updater_options.nil?\n @feed_href_list = nil\n elsif self.updater_options[:feed_href_list].kind_of?(Array)\n @feed_href_list = self.updater_options[:feed_href_list]\n else\n @feed_href_list = nil\n end\n end\n return @feed_href_list\n end", "title": "" }, { "docid": "b58b2e957396676ba44803ca7aa74107", "score": "0.65915334", "text": "def rss_url\n if User.current_user\n feed_events_url(:format => :rss, :key => User.current_user.single_access_token)\n else\n nil\n end\n end", "title": "" }, { "docid": "6c5efa64fecd924e798ba0c83e7c217c", "score": "0.6590527", "text": "def grep_feed_url(line)\n feed_urls = Array.new\n line.scan(/\\\"feedUrl\\\":\\\"(.*?)\"/).each { |furl| \n feed_urls << furl.first.gsub(/\\\\/,'')\n }\n return feed_urls\n end", "title": "" }, { "docid": "004541c1cdaca824755639c038e83537", "score": "0.6583385", "text": "def urls\n links.map { |link| to_absolute(link) }.compact\n end", "title": "" }, { "docid": "9d92f1f3137c082927063c09862d994a", "score": "0.6569909", "text": "def rss_feed\n @feed_items = []\n Blog.public_blogs.each do |blog|\n blog.postings.rss_items.desc(:updated_at).each do |posting|\n if posting.public?\n @feed_items << FeedItem.new(posting.title, posting.body, posting.updated_at, posting_url(posting), posting)\n posting.comments.each do |comment|\n @feed_items << FeedItem.new( (\"%s %% %s\" % [posting.title,comment.name]), comment.comment, comment.updated_at, posting_url(posting),comment)\n end\n end\n end\n end\n\n Page.rss_items.asc(:updated_at).each do |page|\n @feed_items << FeedItem.new(page.title,page.body,page.updated_at,page_url(page),page)\n page.comments.each do |comment|\n @feed_items << FeedItem.new( (\"%s %% %s\" % [page.title,comment.name]), comment.comment, comment.updated_at, page_url(page),comment)\n end\n end\n\n @feed_items.sort! {|a,b| a.updated_at <=> b.updated_at}\n @feed_items\n end", "title": "" }, { "docid": "a13ff7b77a200ec0519d1a1b422207d4", "score": "0.6546903", "text": "def parse_rss_url(url, last_modified = nil)\n begin\n content, modified = Engine::get_url(url, last_modified)\n if $config['log_content']\n meth = 'Raggle::Channel#parse_rss_url'\n $log.debug(meth) {\n content_str = content ? content[0, 80] : '<nil>'\n \"modified: #{modified}, content: #{content_str}\"\n }\n end\n rescue\n raise \"Couldn't get URL \\\"#{url}\\\": #$!.\"\n end\n\n @last_modified = modified\n if content && (!modified || modified != last_modified)\n # strip external entities (work-around for bug in REXML 2.7.1)\n content.gsub!(/<!ENTITY %.*?>/m, '') if \\\n $config['strip_external_entities'] && content =~ /<!ENTITY %.*?>/m\n\n # parse URL content\n doc = REXML::Document.new content\n is_atom = (doc.root.name == 'feed')\n\n \n # get channel info\n e = nil\n\n if is_atom\n # atom channel elements\n @title = e.text if e = doc.root.elements['//feed/title']\n @link = e.attributes['href'] if e = doc.root.elements['//feed/link']\n @desc = e.text if e = doc.root.elements['//feed/tagline']\n else\n # RSS support\n @title = e.text if e = doc.root.elements['//channel/title']\n @link = e.text if e = doc.root.elements['//channel/link']\n @desc = e.text if e = doc.root.elements['//channel/description']\n @image = e.text if e = doc.root.elements['//image/url']\n @lang = e.text if e = doc.root.elements['//channel/language']\n end\n \n \n # build list of feed items\n @items = []\n\n item_element_path = is_atom ? '//feed/entry' : '//item'\n doc.root.elements.each(item_element_path) { |e| \n # get item attributes (the ones that are set, anyway... stupid\n # RSS)\n h = {}\n\n if is_atom\n # parse atom entry\n h = parse_atom_entry(e)\n else\n # basic item attribute element check\n ['title', 'link', 'date', 'description'].each { |val|\n h[val] = (t_e = e.elements[val]) ? fix_character_encoding(t_e) : ''\n }\n\n # more elaborate xpath checks for item attribute elements\n ['link', 'date', 'description'].each { |key|\n h[key] = find_element(e, key)\n }\n\n # handle RSS enclosures for this element\n if $config['enclosure_hook_cmd']\n \n e.elements.each('enclosure') do |enclosure_element|\n handle_rss_enclosure(h, enclosure_element)\n end\n end\n end\n\n # insert new item\n @items << Feed::Item.new(h['title'], h['link'],\n h['description'], h['date'])\n }\n end\n end", "title": "" }, { "docid": "8dba9a9ce426f6457ebe76f281d19b35", "score": "0.6541799", "text": "def list()\n _params = {}\n return @master.call 'urls/list', _params\n end", "title": "" }, { "docid": "8ba8c6147aa02e97ea56f03d889d9e32", "score": "0.6523738", "text": "def feed_url\n # Check attributes\n if @site.config[:base_url].nil?\n raise RuntimeError.new('Cannot build Atom feed: site configuration has no base_url')\n end\n\n @item[:feed_url] || @site.config[:base_url] + @item.rep(:default).path\n end", "title": "" }, { "docid": "ebd25e70b71f12a7f8fe4dece762a222", "score": "0.650259", "text": "def entries(atom_feed)\n RSS::Parser.parse(atom_feed.force_encoding('utf-8')).entries\n end", "title": "" }, { "docid": "4886d777cd460579c55bcf4398fd748d", "score": "0.6493715", "text": "def rss_feed_get(url)\n open(url) do |rss|\n @feed = RSS::Parser.parse(rss, false)\n end\n end", "title": "" }, { "docid": "6de726e1392b69917858fdb54f2e0d7b", "score": "0.64904076", "text": "def feed\n cached = Rails.cache.read('rss')\n return cached unless cached.nil?\n\n resp = HTTParty.get(Rails.configuration.x.application.blog_rss)\n return [] unless resp.code == 200\n\n rss = RSS::Parser.parse(resp.body, false).items.first(5)\n cache_content('rss', rss)\n rss\n rescue StandardError => e\n # If we were unable to connect to the blog rss\n logger.error(\"Caught exception RSS parse: #{e}.\")\n []\n end", "title": "" }, { "docid": "50a197b74bd090e2510deb69895e4b2b", "score": "0.64875203", "text": "def feeds; end", "title": "" }, { "docid": "643c187463d0cc7f9c945a62f02eff87", "score": "0.64840096", "text": "def rss_list(entries)\n entries.sort { |a,b| (b[:meta] ? b[:meta]['created_at'] : b[:date]) <=> (a[:meta] ? a[:meta]['created_at'] : a[:date]) }.each { |entry|\n @xml.item do\n @xml.title entry[:title]\n @xml.pubDate entry[:meta] && entry[:meta]['created_at'] ? entry[:meta]['created_at'] : entry[:date]\n @xml.link entry[:link]\n end\n }\n end", "title": "" }, { "docid": "28735da6506cceb1aaaa1e4689d81961", "score": "0.64825046", "text": "def get_all_links()\n return get_string_array(\"getAllLinks\", [])\n end", "title": "" }, { "docid": "0ccf16f71aaa185de6becedbb113bab6", "score": "0.6481265", "text": "def save_rss_stories\n all_rss_feed_items.each do |item|\n News_rss.create(pub_date: \"#{item.pubDate}\",\n headline: \"#{item.title}\",\n url: \"#{item.link}\",\n pic_url: nil,\n source_name:nil,\n summary: nil,\n # source_name: \"#{rss_url.channel.title}\", #ask john, how to get this\n # summary: \"#{item.description[0..140]}<a href='#{item.link}'>...</a>\", #possibly use for feedly\n keywords: nil)\n end\n end", "title": "" }, { "docid": "a6de6f19e830ac9acb774d30ba347cbc", "score": "0.64619935", "text": "def links\n if @links.nil?\n @links = []\n link_nodes =\n FeedTools::XmlHelper.combine_xpaths_all(self.root_node, [\n \"atom10:link\",\n \"atom03:link\",\n \"atom:link\",\n \"link\",\n \"a\",\n \"url\",\n \"href\"\n ])\n for link_node in link_nodes\n link_object = FeedTools::Link.new\n link_object.href = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:href\",\n \"@atom03:href\",\n \"@atom:href\",\n \"@href\",\n \"@url\",\n \"text()\"\n ], :select_result_value => true)\n if link_object.href.nil? && link_node.base_uri != nil\n link_object.href = \"\"\n end\n begin\n if !(link_object.href =~ /^file:/) &&\n !FeedTools::UriHelper.is_uri?(link_object.href)\n stored_base_uri =\n FeedTools::GenericHelper.recursion_trap(:feed_link) do\n self.base_uri if self.feed != nil\n end\n link_object.href = FeedTools::UriHelper.resolve_relative_uri(\n link_object.href,\n [link_node.base_uri, stored_base_uri])\n end\n rescue\n end\n if self.configurations[:url_normalization_enabled]\n link_object.href =\n FeedTools::UriHelper.normalize_url(link_object.href)\n end\n link_object.href.strip! unless link_object.href.nil?\n next if link_object.href.blank?\n link_object.hreflang = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:hreflang\",\n \"@atom03:hreflang\",\n \"@atom:hreflang\",\n \"@hreflang\"\n ], :select_result_value => true)\n unless link_object.hreflang.nil?\n link_object.hreflang = link_object.hreflang.downcase\n end\n link_object.rel = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:rel\",\n \"@atom03:rel\",\n \"@atom:rel\",\n \"@rel\"\n ], :select_result_value => true)\n unless link_object.rel.nil?\n link_object.rel = link_object.rel.downcase\n end\n link_object.type = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:type\",\n \"@atom03:type\",\n \"@atom:type\",\n \"@type\"\n ], :select_result_value => true)\n unless link_object.type.nil?\n link_object.type = link_object.type.downcase\n end\n link_object.title = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:title\",\n \"@atom03:title\",\n \"@atom:title\",\n \"@title\",\n \"text()\"\n ], :select_result_value => true)\n # This catches the ambiguities between atom, rss, and cdf\n if link_object.title == link_object.href\n link_object.title = nil\n end\n link_object.length = FeedTools::XmlHelper.try_xpaths(link_node, [\n \"@atom10:length\",\n \"@atom03:length\",\n \"@atom:length\",\n \"@length\"\n ], :select_result_value => true)\n if !link_object.length.nil?\n link_object.length = link_object.length.to_i\n else\n if !link_object.type.nil? && link_object.type[0..4] != \"text\" &&\n link_object.type[-3..-1] != \"xml\" &&\n link_object.href =~ /^http:\\/\\//\n # Retrieve the length with an http HEAD request\n else\n link_object.length = nil\n end\n end\n @links << link_object\n end\n if @links.empty? && self.enclosures.size > 0\n # If there's seriously nothing to link to, but there's enclosures\n # available, then add a link to the first one.\n enclosure_link = self.enclosures[0]\n link_object = FeedTools::Link.new\n link_object.href = enclosure_link.url\n link_object.type = enclosure_link.type\n @links << link_object\n end\n end\n return @links\n end", "title": "" }, { "docid": "0ae84ffb5f09f838869bc25979b6fb12", "score": "0.644874", "text": "def feed\n \"http://del.icio.us/rss/#{username}\"\n end", "title": "" }, { "docid": "ebe40876366da44ce3d4d6700e948c5e", "score": "0.64456177", "text": "def all_links\n []\n end", "title": "" }, { "docid": "aedfe73bd91f25f49aee1bab58711253", "score": "0.64431137", "text": "def get_urls(page)\n doc = Nokogiri::XML(open_url(page))\n urls = []\n\n doc.search('nodes > node').each do |node|\n url = nil\n node.search('URL').each do |t|\n url = t.inner_text\n end\n if url\n urls << url\n end\n end\n\n urls\n end", "title": "" }, { "docid": "96a35dbbb7ed44a95ae456b4869b441a", "score": "0.6430896", "text": "def index\n @rss_feeds = RssFeed.user_scope(current_user).all\n end", "title": "" }, { "docid": "6d3732fbf7fd035802be769fc846f5e3", "score": "0.64250773", "text": "def urls\n @urls\n end", "title": "" }, { "docid": "b1aa59fbfa879bc08a4ba9fc306ee825", "score": "0.64132476", "text": "def list()\n _params = {}\n return @master.call 'urls/list', _params\n end", "title": "" }, { "docid": "acbb2ea10be282ccde375da0dd30155a", "score": "0.6399588", "text": "def feed_url\n @feed_url || @feed_url_link || @feed_url_atom10_link\n end", "title": "" }, { "docid": "10b707b3a4548cc31643c851c64d24ac", "score": "0.6399571", "text": "def get_info\n URI.open(self.rss_feed) { |rss|\n feed = RSS::Parser.parse(rss, false)\n\n self.update(podcast_home_url: feed.channel.link)\n \n if feed.channel.description\n self.update(description: feed.channel.description)\n else \n self.update(description: feed.channel.itunes_summary)\n end\n \n self.update(podcast_img_url:feed.channel.itunes_image.href)\n }\n end", "title": "" }, { "docid": "94b42bb0f69127bdbc0d41c86db73dab", "score": "0.6393328", "text": "def show_feeds\n # feed.each do |val|\n # p val\n # end\n for i in @feed\n p i\n end\n end", "title": "" }, { "docid": "08b31be141d69466318e20afd401c5a7", "score": "0.63896745", "text": "def content\n rss = nil\n begin\n rss = SimpleRSS.parse open(url)\n # if we can't open it, just silently ignore it\n rescue OpenURI::HTTPError, SimpleRSSError => e\n return []\n end\n\n # return if feed not updated since we last checked \n last_modified = Time.now.gmtime\n [:pubDate, :updated].each { |tag|\n if rss.channel.respond_to?(:tag)\n last_modified = rss.channel.send(:tag)\n end\n }\n return blog_entries if !last_updated.nil? && last_modified <= last_updated\n\n self.last_updated = Time.now\n\n self.blog_entries.clear\n\n rss.items.each { |item|\n content = item.description || item.content\n self.blog_entries << \n BlogEntry.new({ :title => item.title,\n :link => item.link,\n :date => item.pubDate || item.lastBuildDate || item.modified || item.published || Time.now.gmtime,\n :content => CGI.unescapeHTML(content)}) # NOTE unescaping html here, potentially dangerous!!!\n }\n\n save!\n return blog_entries\n end", "title": "" }, { "docid": "36da8d2eeadf782912094ecf9494bf32", "score": "0.6383467", "text": "def fetch_feed\n rss = \"\"\n begin\n puts self.url\n f = open(self.url, 'r')\n rss = f.read()\n f.close\n rescue Exception => e\n puts e.message\n puts \"Feed::fetch_feed :: Error in opening feed\"\n end\n return rss\n end", "title": "" }, { "docid": "bc8f07b0ebb9002735d2f4fd706cac30", "score": "0.6380834", "text": "def grab_urls_and_titles(feed)\n feed.remove_namespaces! #so that we can get to the titles easily\n urls = feed.search(\"//entry/link[@rel='alternate']\").map { |link| link[\"href\"] }\n titles = feed.search(\"//entry/group/title\").map { |title| title.text }\n Hash[urls.zip(titles)] #hash like this: url => title\n end", "title": "" }, { "docid": "33b9baa5c61dfefbd3d7f3a90976d6b3", "score": "0.6378102", "text": "def raw_urls(sitemap)\n sitemap.urls.map { |u| u.url }\n end", "title": "" }, { "docid": "c9b12b427d41ba852d0a115afe5a7349", "score": "0.6374377", "text": "def link_list\n if (links = @doc.at(\"div.related-items ul\")).nil?\n @logger.write \"Www_economist_com: Could not fetch links.\\n\"\n return [@uri.to_s]\n else\n links = links/\"li a\" # get the right block of links\n end\n #FIXME SP's want last item in links (Offer to Readers) dropped?\n #links = links[0..-2] # drop the last element, Offer to Readers (sloppy)\n hrefs = links.collect { |l| l.attributes['href'] } # return list of href attributes\n hrefs.insert (0, @uri.to_s) unless (hrefs.first == @uri.to_s)\n hrefs # return\n end", "title": "" }, { "docid": "fff6fcb2d801e21ae9754a716b247b81", "score": "0.6340022", "text": "def get_links_for(tweets)\n\turl_regexp = /http:\\/\\/\\w/\n\tresult = []\n\ttweets.each do |item|\n\t\turl = item.text.split.grep(url_regexp)\n\t\tif url != []\n\t\t\titem[:uri] = url.first\n\t\t\tresult << item\n\t\tend\n\tend\n\treturn result\nend", "title": "" }, { "docid": "d436cc260dd3cf9f6268b1122ad99fae", "score": "0.6324778", "text": "def feed_list\n @feed_rsses = FeedRss.paginate(:page => params[:page])\n end", "title": "" }, { "docid": "46a597ce1bb34570a0901ba8988222ee", "score": "0.6318658", "text": "def fetch_feed\n @doc = Nokogiri::XML(open(@url))\n @root_node = @doc.xpath(\"/rss/channel\")\n end", "title": "" }, { "docid": "46a597ce1bb34570a0901ba8988222ee", "score": "0.6318658", "text": "def fetch_feed\n @doc = Nokogiri::XML(open(@url))\n @root_node = @doc.xpath(\"/rss/channel\")\n end", "title": "" }, { "docid": "180408db8b220141fffffcd1c47d15eb", "score": "0.63160056", "text": "def get_feed(page_num=1)\n page_count=page_num\n path='/atom/feed'\n entries=Array.new\n while 0 < page_count && nil != path\n res=get_single_feed(path)\n #puts res.body\n entries=entries + parse_feed(res.body)\n path = get_next_page(res.body)\n page_count=page_count-1\n end\n return entries\n end", "title": "" }, { "docid": "cd24fb554bb679aa13965d39e919da44", "score": "0.63111144", "text": "def all_feeds_posts(feeds)\n\t\t\tall_posts = Array.new\n\t\t\tfeeds.each do |feed|\n\t\t\t\tbegin\n\t\t\t\t\tall_posts.concat feed_posts(feed.url)\n\t\t\t\trescue RuntimeError, RSS::NotWellFormedError, OpenURI::HTTPError, RSS::NotAvailableValueError, SocketError => e\n\t\t\t\t\tnext\n\t\t\t\tend\n\t\t\tend\n\t\t\tall_posts.sort_by{|h| h[:seconds]}\n\n\t\tend", "title": "" }, { "docid": "6c4002f3c5812e246d70776a21e340dc", "score": "0.6307209", "text": "def urls\n return @urls\n end", "title": "" }, { "docid": "a398761deb6c01836b0a3b8538ee435e", "score": "0.63041574", "text": "def remote_xmls\n doc = Nokogiri::HTML open(DOWNLOAD_URL)\n links = doc.css(\"div.rightbar > a\")\n xmls = []\n links.each do |link|\n link_name = link.attributes['href'].to_s\n if link_name\n xmls << link_name.split(\"/\").last if link_name.include? BASE_URL\n end \n end\n xmls.empty? ? nil : xmls\nend", "title": "" }, { "docid": "6b4fe5bdc25300d65a2c22230ed0d890", "score": "0.6295472", "text": "def urls\n @urls = @tribune.links.order(\"created_at desc\").limit(42)\n\n respond_to do |format|\n format.html\n format.rss\n format.tsv { render template: 'welcome/urls'}\n format.xml {render :xml => urls_to_xml(@urls, @tribune.name)}\n end\n\n end", "title": "" }, { "docid": "b3e7313c4112d813e076195526770c7f", "score": "0.6284705", "text": "def feed\n GET base_url \"/feed\"\n end", "title": "" }, { "docid": "3cce740ff0d9287a463fcc7ac678b1d0", "score": "0.62704635", "text": "def list_feeds\n puts\n Feed.all.each do |feed|\n puts feed\n end\n puts\nend", "title": "" }, { "docid": "ec57197ba369fae6361849e395fe4100", "score": "0.6267105", "text": "def get_url(url)\n\t\turl = url.is_a?(Hash) ? url['u'] : url\n\t\tget(\"url/#{Digest::MD5.hexdigest(url)}\", \"rss\")\n\tend", "title": "" }, { "docid": "6562fa13285db1d790a8822fcc455586", "score": "0.6261139", "text": "def urls\n return url\n end", "title": "" }, { "docid": "1ca4641403b8da0d16124d4d3e9fc658", "score": "0.6260169", "text": "def parseFeed(feed_url)\n open(feed_url) do |http|\n response = http.read\n result = RSS::Parser.parse(response, false)\n latest = result.items.first\n rss_item = RssItem.new( { :link => result.channel.link, :title => result.channel.title },\n { :link => latest.link, :title => latest.title, :author => latest.author,\n :content => latest.description, :published_date => latest.pubDate,\n :guid => latest.guid } )\n end\n end", "title": "" }, { "docid": "30319ab778aeadf62855437467b9a408", "score": "0.62583184", "text": "def urls\n @urls ||= []\n end", "title": "" }, { "docid": "0b14959315458b815f20a5226a29ea8c", "score": "0.62564045", "text": "def news_links\n visit LIST_URL\n\n links = doc.css(\".listing ul li a\").collect do |anchor|\n link = Link.new\n link.title = anchor.text\n link.url = URI::join(LIST_URL, anchor[\"href\"]).to_s\n link\n end\n links\n end", "title": "" }, { "docid": "d169a5fc97bf9c3280e4fb6d94e85b38", "score": "0.625576", "text": "def extract_urls\n\t\turls = []\n\t\t@results.each do |result|\n\t\t\tresult[\"entities\"][\"urls\"].each do |url|\n\t\t\t\t #put url[\"url\"]\n urls.push(url[\"expanded_url\"])\n\t\t\tend\n\t\tend\n\t\treturn urls.uniq\n end", "title": "" }, { "docid": "c47eaace2a9cbe68127227c5685b2cf6", "score": "0.6255702", "text": "def blog\n feed_url = 'http://www.mysociety.org/category/projects/whatdotheyknow/feed/'\n all_url = 'http://www.mysociety.org/category/projects/whatdotheyknow/'\n @output = ''\n content = open(feed_url).read\n @data = XmlSimple.xml_in(content)\n @channel = @data['channel'][0]\n @items = @channel['item']\n\n @feed_autodetect = [ { :url => @channel['link'][0]['href'], :title => \"WhatDoTheyKnow blog\"} ]\n end", "title": "" }, { "docid": "06bcd9922ff2e3e04f8e45b4be0ed24e", "score": "0.6251872", "text": "def index\n @feed_urls = FeedUrl.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @feed_urls }\n end\n end", "title": "" }, { "docid": "cf9fdb1a6e001cb794f2456ce0f3c15b", "score": "0.6241293", "text": "def parse_feed(url = 'http://www.elnuevodia.com/rss/noticias.xml')\n open(url) do |rss|\n RSS::Parser.parse(rss)\n end\n end", "title": "" }, { "docid": "db25fb0a3f8a0f976fc4ee45c4f8cae9", "score": "0.6240234", "text": "def feed_items\n feed_item\n end", "title": "" }, { "docid": "64313b1bf889151ed6ee9fc6f9ffbf00", "score": "0.6232939", "text": "def urls\n values(\"URL\")\n end", "title": "" }, { "docid": "64313b1bf889151ed6ee9fc6f9ffbf00", "score": "0.6232939", "text": "def urls\n values(\"URL\")\n end", "title": "" }, { "docid": "64313b1bf889151ed6ee9fc6f9ffbf00", "score": "0.6232939", "text": "def urls\n values(\"URL\")\n end", "title": "" }, { "docid": "64313b1bf889151ed6ee9fc6f9ffbf00", "score": "0.6232939", "text": "def urls\n values(\"URL\")\n end", "title": "" }, { "docid": "c29bbce4dab9803aa6e8b4374d4ea4fc", "score": "0.62317187", "text": "def getAllURLs\n # Don't duplicate effort\n unless @extracted_urls.empty?\n return @extracted_urls\n end\n\n urls = {\n :collection_announcements => [],\n :recent_additions => [],\n :new_additions => []\n }\n\n content_sets = extract()\n content_sets.each do |slug, set|\n set.each do |entry|\n urls[slug] << entry[:href]\n end\n end\n\n @extracted_urls = urls\n return urls\n end", "title": "" }, { "docid": "70aa6142d786cffaf2e42387e5d63d9e", "score": "0.62280333", "text": "def fetch\n urls\n .map do |url|\n parse_feed(Feedjira::Feed.fetch_and_parse(url))\n end\n .inject :+\n end", "title": "" } ]
b724ca343c6b7c4c4a8206661d6dab70
GET /posts GET /posts.json
[ { "docid": "21deba23d264576fe19ca9c1d76c3f0a", "score": "0.0", "text": "def index\n @posts = Post.all\n if current_user == User.first && !current_user.try(:admin?) && User.count == 1\n current_user.update_attribute :admin, true\n end\n end", "title": "" } ]
[ { "docid": "fb578f587fdfe1b0a8d3ac27001f9611", "score": "0.7634022", "text": "def index\n render json: @posts\n end", "title": "" }, { "docid": "4e694f9f0a0313f64d4c0582953f2972", "score": "0.754337", "text": "def show\r\n @posts = Post.find(:all)\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.json { render json: @posts }\r\n end\r\n end", "title": "" }, { "docid": "f2522daa26243ffa98375225ef582787", "score": "0.75354266", "text": "def index\n posts = Post.all\n render json: posts\n end", "title": "" }, { "docid": "c76855d845dad16316d7722c8f2c9241", "score": "0.7507537", "text": "def index\n @posts = Post.all\n \n render json: @posts\n end", "title": "" }, { "docid": "9e4bfaa87507d05255fbaeadc1ecb1d6", "score": "0.7494904", "text": "def index\n @posts = Post.all\n render json: @posts\n end", "title": "" }, { "docid": "e732c729d91c0c1c2965f1f688905fef", "score": "0.7494433", "text": "def index\n @posts = Post.all\n\n render json: @posts\n end", "title": "" }, { "docid": "e732c729d91c0c1c2965f1f688905fef", "score": "0.7494433", "text": "def index\n @posts = Post.all\n\n render json: @posts\n end", "title": "" }, { "docid": "12bb4c6f70647249e7eb56d2da9af91a", "score": "0.7439663", "text": "def index\n @posts = Post.all\n render json: @posts, status: 200\n end", "title": "" }, { "docid": "02fd2572de4e1637312009b0a74b9d4f", "score": "0.74311686", "text": "def show\n @post = Post.find(params[:id])\n @posts = Post.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "3c8f4600800ccf91f365a57dbc4d2273", "score": "0.7391665", "text": "def posts\n #Telling the method to get posts.json\n self.class.get('/posts.json')\n end", "title": "" }, { "docid": "3c8f4600800ccf91f365a57dbc4d2273", "score": "0.7391665", "text": "def posts\n #Telling the method to get posts.json\n self.class.get('/posts.json')\n end", "title": "" }, { "docid": "e528b11a5817aefe746f1e4864ae92ab", "score": "0.7342076", "text": "def posts(status=:published)\n params = {status: status} #converted to strings\n JSON.parse((connection.get do |req|\n req.params = params\n req.url (endpoint(:get_posts))\n req.headers = session_headers\n end).body)\n end", "title": "" }, { "docid": "0127fc68e1d06e28a35cba41df1ed5bc", "score": "0.73152673", "text": "def index\n @posts = User.find(params[:user_id]).posts\n\n respond_to do |format|\n format.html { render 'index' }\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "c371bfadb4ec4bb575458bd7c93c740a", "score": "0.73039687", "text": "def index\n\t\t\t@posts = Post.all\n\n\t\t respond_to do |format|\n\t\t format.html\n\t\t format.json { render json: @posts }\n\t\t end\n end", "title": "" }, { "docid": "221eee20077260db35081540bb4ec812", "score": "0.72948366", "text": "def index\n @posts = Post.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "330b2ce987a343d95ce831ff267f4167", "score": "0.72909105", "text": "def index\n\t\t@posts = Post.all\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.json { render json: @posts }\n\t\tend\n\tend", "title": "" }, { "docid": "8150ff0b8d418a0877e1a80d25b0171f", "score": "0.728645", "text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "8150ff0b8d418a0877e1a80d25b0171f", "score": "0.728645", "text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "8150ff0b8d418a0877e1a80d25b0171f", "score": "0.728645", "text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "8150ff0b8d418a0877e1a80d25b0171f", "score": "0.728645", "text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "8150ff0b8d418a0877e1a80d25b0171f", "score": "0.728645", "text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "8150ff0b8d418a0877e1a80d25b0171f", "score": "0.728645", "text": "def index\n @posts = Post.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "840e7c27bcef9da7684f414e946b1397", "score": "0.72411096", "text": "def index\n @posts = Post.order('created_at DESC').page(params[:page]).per(10)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "3c3dbb836e52b686153b25a8c09e3c7d", "score": "0.7230319", "text": "def show\n user = User.find_by({token: env['HTTP_TOKEN']})\n render json: user.posts.find(params[:id])\n end", "title": "" }, { "docid": "9fb53af70942fe0c974d4b2a927559b1", "score": "0.72259307", "text": "def index\n posts = Post.all\n # send posts as json\n render json: posts\n end", "title": "" }, { "docid": "c987be95cd8d2b324e41ac101a5cb95b", "score": "0.72220576", "text": "def index\n @posts = Post.order(\"updated_at desc\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "91caa1f52b116f662f920b7a0fcaef43", "score": "0.71935153", "text": "def index\n #@posts = list_posts\n @posts = Post.all\n #render json: {posts: @posts}\n \n end", "title": "" }, { "docid": "450dfce9ac15c6242e8b564ebfd1cf63", "score": "0.71907985", "text": "def index\n\t\t@posts = Post.all\n\n\t\trespond_to do |format|\n\t\t\tformat.html #index.html.erb\n\t\t\tformat.json {render json: @posts }\n\t\tend\n\tend", "title": "" }, { "docid": "159445f4b4c848e6ae11f0a0cd9b8d44", "score": "0.71729505", "text": "def list(*args)\n options = args.last.is_a?(Hash) ? args.pop : {}\n response = get('posts/list', options)\n end", "title": "" }, { "docid": "aa4257c08b0461ed4c316a034ce23cc0", "score": "0.7171004", "text": "def get_posts\n url = 'https://www.fimfiction.net/api/v2/blog-posts?'\n url << Fimfiction::Utils.query_builder(@filters) unless @filters.length == 0\n url << \"fields[blog_post]=#{Fimfiction::Utils.query_builder(@attributes)}\" unless @attributes.length == 0\n begin\n request = RestClient::Request.execute(method: :get, url: url, headers: {Authorization: 'Bearer '+@token}, :user_agent => \"gem-Fimfiction by Vertex - https://github.com/IAmVertex/gem-fimfiction\")\n return JSON.parse(request)\n rescue RestClient::ExceptionWithResponse => e\n err_response = JSON.parse(e.response)\n raise Fimfiction::Error.check(err_response[\"errors\"][0][\"code\"]), err_response[\"errors\"][0][\"title\"]\n end\n end", "title": "" }, { "docid": "cbfef57825d28450983814c208c424ec", "score": "0.71689725", "text": "def show\r\n post = Post.find(params[:id])\r\n render json: post\r\n end", "title": "" }, { "docid": "af6de11c87ca6f9e7c81b02523539b57", "score": "0.71627724", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "b6b8667391addb7d82a12dd70447ba94", "score": "0.7144781", "text": "def index\n begin \n respond_to do |format|\n @posts = Post.page(current_page).per(default_page_size).includes(:user, comments: :user).order(created_at: :desc)\n format.json { render json: @posts }\n end\n rescue => e\n format.json { render json: [] }\n end\n end", "title": "" }, { "docid": "da9f71261c418d4496c3d5f1f6e40fbd", "score": "0.71401054", "text": "def show\n @post = Post.find(params[:id])\n render json: to_json(@post)\n end", "title": "" }, { "docid": "c9116466d0f26a86693442db53d02f86", "score": "0.7125", "text": "def index\n @posts = current_user.posts\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "512ad95b6ef13898ed528b26f5c3cf02", "score": "0.71244794", "text": "def index\n\t posts = Post.all\n\n\t render(\n\t json: ActiveModel::ArraySerializer.new(\n\t posts,\n\t each_serializer: Api::V1::PostSerializer,\n\t root: 'posts',\n\t )\n\t )\n\tend", "title": "" }, { "docid": "5c02a1a643c67ee050fd8b15f0a2de9d", "score": "0.71167654", "text": "def posts\n self.list(:posts)\n end", "title": "" }, { "docid": "c884d3048f42b4b1b768c271940bbed7", "score": "0.71163553", "text": "def show\n post_id = params[:id]\n render json: V1::Post.get_a_post(post_id)\n end", "title": "" }, { "docid": "7ea2a927f8efff2e05d209277ead2f16", "score": "0.71119446", "text": "def index\n @posts = Post.includes(:user).order(created_at: :desc).all\n render json: @posts, each_serializer: PostsSerializer\n end", "title": "" }, { "docid": "8597894e3350791c2f885d6a57c440fd", "score": "0.7089143", "text": "def index\n @posts = Post.all\n render json: {\n status: 'SUCCESS',\n data: @posts,\n }, status: :ok\n end", "title": "" }, { "docid": "d77c82adaa2e2cb8f86cc6b6ee4835d3", "score": "0.7067407", "text": "def index\n @posts = access_token.get(\"/posts/get_posts/\").parsed.map{|p| Post.new(p)}\n end", "title": "" }, { "docid": "4325ee38a0d19a0afa0ce121c7e0b630", "score": "0.7061402", "text": "def index\n @posts = Post.order(\"created_at desc\").paginate(page: params[:page], per_page: 10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "cc90c219d9f38c5ef773734974fbe4c1", "score": "0.7053014", "text": "def index\n @posts = Post.all[0..200]\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "9ddd9346264c2f642ba4c15dfb6d697e", "score": "0.70524836", "text": "def index\n @posts = Post.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "adc2c20331ca82ca6c642909beffd70d", "score": "0.7044238", "text": "def index\n canonical_url(\"/posts\")\n @posts = Post.all\n\n respond_with(@posts)\n end", "title": "" }, { "docid": "9ff0a70166fdb8bc37a5dd0346569b0d", "score": "0.70190376", "text": "def index\n \t@posts = Blog.where(published: true)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "050be25378629b632cf2ba46ce217aaf", "score": "0.701741", "text": "def index\n limit = params[:limit].to_i\n page = params[:page].to_i\n per_page = params[:per_page].to_i\n order = params[:order].to_s\n render json: V1::Post.get_all_post(limit,order,page,per_page)\n end", "title": "" }, { "docid": "8a2481f05bc5451c2ccb3722118a5efc", "score": "0.70165825", "text": "def index\n @posts = Post.paginate(:page => params[:page], :per_page =>10)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "3b86b5cf3f36195e0e880413df3b8852", "score": "0.7005685", "text": "def index\n \tposts = Post.where(:user_id => current_user.id)\n \trender :status=>200, :json=>{:status => true, :posts=> posts}\n end", "title": "" }, { "docid": "bcbeb2abcf5878da3e007d92fc48139a", "score": "0.69990975", "text": "def show\n render :json => Post.find(params[:id]) \n end", "title": "" }, { "docid": "b5081731ff0585eb0e72d34378149480", "score": "0.69952136", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "84a25839e52e98062a34db7beeff05d5", "score": "0.69898033", "text": "def index\n posts = paginate Post.public, per_page: 20\n render json: posts, :root => \"posts\", adapter: :json\n end", "title": "" }, { "docid": "d2ed04fd7878a0e9effabb4fc48fab92", "score": "0.69868076", "text": "def index\r\n @posts = Post.all.order('created_at DESC')\r\n\r\n render json: @posts, status: :ok\r\n end", "title": "" }, { "docid": "9b206c5c7969f1d64d85ab9567deb8e4", "score": "0.6952065", "text": "def show\n @post = Post.find(params[:id])\n \n respond_to do |format|\n format.html\n format.json { render :json => @post }\n end\n end", "title": "" }, { "docid": "26608c694104a870bb8f1da34f6ce7b8", "score": "0.69511116", "text": "def index\n @posts = Post.all\n @posts = Post.paginate(:page => params[:page], :per_page => 10)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @posts }\n end\n end", "title": "" }, { "docid": "ff8fca18d632cf777be4ddc02d499ec5", "score": "0.69479007", "text": "def index\n \n posts = current_user.posts.all\n render json: {status: 'SUCCESS', message: 'Loaded Posts', data: posts},status: :ok\n end", "title": "" }, { "docid": "e52b2b68bf17d770ff30cec8edbf0ca2", "score": "0.6946567", "text": "def show\n \n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "7cc53dd0f284f5cb7873cd8b8c1f1e58", "score": "0.69355905", "text": "def index\n @posts = Post.all(:order => \"id DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "060bdb917a36369a9c584e7b4a7145c5", "score": "0.6921306", "text": "def show\n render json: @post\n end", "title": "" }, { "docid": "060bdb917a36369a9c584e7b4a7145c5", "score": "0.6921306", "text": "def show\n render json: @post\n end", "title": "" }, { "docid": "060bdb917a36369a9c584e7b4a7145c5", "score": "0.6921306", "text": "def show\n render json: @post\n end", "title": "" }, { "docid": "060bdb917a36369a9c584e7b4a7145c5", "score": "0.6921306", "text": "def show\n render json: @post\n end", "title": "" }, { "docid": "060bdb917a36369a9c584e7b4a7145c5", "score": "0.6921306", "text": "def show\n render json: @post\n end", "title": "" }, { "docid": "0b940f16df6cb3af41a377800bd61cf6", "score": "0.6918964", "text": "def show\n @post = Post.find(params[:id])\n #render json: {post: @post}\n \n end", "title": "" }, { "docid": "c6bb0112e401fb8de407d88b7f4079c8", "score": "0.6918641", "text": "def show\n render json: @post\n end", "title": "" }, { "docid": "575b480b1ce4ff1542d1efa939455c0e", "score": "0.6915576", "text": "def index(slug: nil)\n if slug.present?\n @post = Post.find_by(slug: slug)\n\n render_json_or_404 @post\n else\n @posts = Post.all\n\n render json: @posts\n end\n end", "title": "" }, { "docid": "01c45c3ca73364af8c64b56c7e08f04b", "score": "0.69140637", "text": "def index\n @posts = Post.order(\"updated_at DESC\")\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "2a7a7acf452f2ddc005f908596eb51cb", "score": "0.6913786", "text": "def index\r\n respond_to do |format|\r\n format.html { # index.html.erb\r\n @posts = Post.all\r\n }\r\n format.json {\r\n @language = ApplicationHelper.preferred_language(request.headers[\"Accept-Language\"])\r\n user_id = request.headers[\"user-id\"]\r\n if user_id\r\n @posts = Post.where(\"user_id = ?\", user_id)\r\n log_event(:post, :retrieve_post, user_id)\r\n render json: @posts.as_json(:only => [:id, :img, :latitude, :longitude, :name, :user_id, :item_info_id, :supply, :supplymaxlevel, :supplyratelevel, :beacontime])\r\n else\r\n create_error(:unprocessable_entity, :get, params[:post], \"User not found\")\r\n end\r\n }\r\n end\r\n end", "title": "" }, { "docid": "2ca86ba133c8f05a764364590c4af5cd", "score": "0.6904826", "text": "def index\n @posts = @society.posts.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "85504e83d199eb39ff381d1fef5d0a90", "score": "0.6903803", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # results.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "c6950dc55b72da8aaee77fb6fa598e7b", "score": "0.6897198", "text": "def index\n\t\tgon.posts = Post.all.as_json\n\tend", "title": "" }, { "docid": "98ec152f6f367ddfbfcb1f5f23be1d41", "score": "0.68922657", "text": "def index\n @posts = Post.all #con el all indica que te recupere todos los datos de la base\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @posts }\n end\n end", "title": "" }, { "docid": "46e4ee4b29994202a5e7d3e200f287e6", "score": "0.6878528", "text": "def show\n @post = Post.find(params[:id])\n\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "7c8f0a853eda389e94594c1e0ed1cc20", "score": "0.68774444", "text": "def show\n @post = Post.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "7c8f0a853eda389e94594c1e0ed1cc20", "score": "0.68774444", "text": "def show\n @post = Post.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "9f6ec07cebfc5fa1e1edcb0f874200ff", "score": "0.6877106", "text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "84c35d2b19d7c0985b63f124045d5dcf", "score": "0.6872863", "text": "def show\n \n @post = Post.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6867125", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6866127", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865636", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" }, { "docid": "b7ee4a7e432c7c37005748fea9d3f89d", "score": "0.6865055", "text": "def show\n @post = Post.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @post }\n end\n end", "title": "" } ]
7e2d76b9adf21dd43bf85346d044e35d
Make sure eql? works the same as ==.
[ { "docid": "41e2689c65f2f8fdaa384bd909a68955", "score": "0.8119481", "text": "def eql?(other)\n self == other\n end", "title": "" } ]
[ { "docid": "b30da7dcac64c9d3d33950e39817b993", "score": "0.8919459", "text": "def eql?(*) end", "title": "" }, { "docid": "83b7f053c4b18617ae9369dae0621ad7", "score": "0.88555115", "text": "def eql?(other); self == other; end", "title": "" }, { "docid": "69537a5ae9840382a4a567d9de6559a7", "score": "0.87794685", "text": "def eql?(other); end", "title": "" }, { "docid": "69537a5ae9840382a4a567d9de6559a7", "score": "0.87794685", "text": "def eql?(other); end", "title": "" }, { "docid": "69537a5ae9840382a4a567d9de6559a7", "score": "0.87794685", "text": "def eql?(other); end", "title": "" }, { "docid": "69537a5ae9840382a4a567d9de6559a7", "score": "0.87794685", "text": "def eql?(other); end", "title": "" }, { "docid": "69537a5ae9840382a4a567d9de6559a7", "score": "0.87794685", "text": "def eql?(other); end", "title": "" }, { "docid": "69537a5ae9840382a4a567d9de6559a7", "score": "0.87794685", "text": "def eql?(other); end", "title": "" }, { "docid": "69537a5ae9840382a4a567d9de6559a7", "score": "0.87794685", "text": "def eql?(other); end", "title": "" }, { "docid": "b25d924bf5652eecbc1743480ea3c114", "score": "0.85995567", "text": "def eql?(ct); end", "title": "" }, { "docid": "b25d924bf5652eecbc1743480ea3c114", "score": "0.85995567", "text": "def eql?(ct); end", "title": "" }, { "docid": "75625a01b95b7d454f5af84faca41759", "score": "0.8517052", "text": "def eql?(other)\n self==other\n end", "title": "" }, { "docid": "ca5a25b076c72f90be07e3e1eaeede45", "score": "0.8498563", "text": "def equal?(other); end", "title": "" }, { "docid": "647da4f45f85a00ab0018ebccaeee403", "score": "0.8461963", "text": "def eql?(other)\n self == other\n end", "title": "" }, { "docid": "647da4f45f85a00ab0018ebccaeee403", "score": "0.8461963", "text": "def eql?(other)\n self == other\n end", "title": "" }, { "docid": "647da4f45f85a00ab0018ebccaeee403", "score": "0.8461963", "text": "def eql?(other)\n self == other\n end", "title": "" }, { "docid": "647da4f45f85a00ab0018ebccaeee403", "score": "0.8461963", "text": "def eql?(other)\n self == other\n end", "title": "" }, { "docid": "2aca512031b7e5929b7ceeb54c28432c", "score": "0.84257483", "text": "def ==(other)\n eql?(other)\n end", "title": "" }, { "docid": "2aca512031b7e5929b7ceeb54c28432c", "score": "0.84257483", "text": "def ==(other)\n eql?(other)\n end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "bfa0a40342998386d3cf689f199fa6d3", "score": "0.82992315", "text": "def ==(other); end", "title": "" }, { "docid": "0adf8e1421f7b72ae129ed1c4c83040a", "score": "0.82536054", "text": "def eql?(p0) end", "title": "" }, { "docid": "0adf8e1421f7b72ae129ed1c4c83040a", "score": "0.82536054", "text": "def eql?(p0) end", "title": "" }, { "docid": "0adf8e1421f7b72ae129ed1c4c83040a", "score": "0.82536054", "text": "def eql?(p0) end", "title": "" }, { "docid": "0adf8e1421f7b72ae129ed1c4c83040a", "score": "0.8250884", "text": "def eql?(p0) end", "title": "" }, { "docid": "0adf8e1421f7b72ae129ed1c4c83040a", "score": "0.8250884", "text": "def eql?(p0) end", "title": "" }, { "docid": "0adf8e1421f7b72ae129ed1c4c83040a", "score": "0.8250884", "text": "def eql?(p0) end", "title": "" }, { "docid": "0adf8e1421f7b72ae129ed1c4c83040a", "score": "0.8250884", "text": "def eql?(p0) end", "title": "" }, { "docid": "695c79a1a4b18ec27e9cb13fdf78d70a", "score": "0.82376146", "text": "def eql? other\n self == other\n end", "title": "" }, { "docid": "7752ce760683da1a6fd15e0e3bf129f9", "score": "0.822384", "text": "def eql?(other)\n\t\tself == other\n\tend", "title": "" }, { "docid": "59f2f4ce4b79f5ea5ac2d319216bc202", "score": "0.8218077", "text": "def eql?(other)\n return false\n end", "title": "" }, { "docid": "8c75697ab793de2b38a90e96df734d4c", "score": "0.82128596", "text": "def eql?(other)\n\n end", "title": "" }, { "docid": "ab2b3aa68b8299c6301afdeb2393de81", "score": "0.82026947", "text": "def ==(other)\n eql?(other)\n end", "title": "" }, { "docid": "2c3a9d7d1f03a42c3bffb7abd5efad8b", "score": "0.81317276", "text": "def ==(other); false; end", "title": "" }, { "docid": "76a7db04905819e134b17bd96accdc07", "score": "0.8088361", "text": "def equal?(o)\n eql?(o)\n end", "title": "" }, { "docid": "cf1e8b93a7175cdad9776d1412c6341f", "score": "0.80604", "text": "def eql?(other)\n return self == other\n end", "title": "" }, { "docid": "0da645c1be25f10b82f7a68b60d90e71", "score": "0.8055105", "text": "def eql?(other)\n self == (other)\n end", "title": "" }, { "docid": "3c21f9251a54806ba6a7b1a3b23428c0", "score": "0.80544853", "text": "def eql?(other)\n super\n end", "title": "" }, { "docid": "3c21f9251a54806ba6a7b1a3b23428c0", "score": "0.80544853", "text": "def eql?(other)\n super\n end", "title": "" }, { "docid": "b866df3f867912ff8522a039e3858a96", "score": "0.8000783", "text": "def ==(ct); end", "title": "" }, { "docid": "b866df3f867912ff8522a039e3858a96", "score": "0.8000783", "text": "def ==(ct); end", "title": "" }, { "docid": "7a58df0e80244efab5faf6610c86eb1a", "score": "0.7999038", "text": "def ==\n end", "title": "" }, { "docid": "a046d33313c167010665380d202be240", "score": "0.7996206", "text": "def eql?(other)\n self == other\n end", "title": "" }, { "docid": "8751e9ee9b1d109c8d41aebaf375f72e", "score": "0.7995946", "text": "def ==(other)\n eql?(other)\n end", "title": "" }, { "docid": "dee9fa279c1787073e0e54357b4fccc8", "score": "0.7963703", "text": "def eql?(arg0)\n end", "title": "" }, { "docid": "dee9fa279c1787073e0e54357b4fccc8", "score": "0.7963703", "text": "def eql?(arg0)\n end", "title": "" }, { "docid": "dee9fa279c1787073e0e54357b4fccc8", "score": "0.7963703", "text": "def eql?(arg0)\n end", "title": "" }, { "docid": "ec0e68b7dfba4384a0d8553eeae57e18", "score": "0.7961588", "text": "def eql?(other)\n if equal?(other)\n return true\n end\n\n unless instance_of?(other.class)\n return false\n end\n\n cmp?(other, :eql?)\n end", "title": "" }, { "docid": "76e02b93d68162b070a88de631d8e820", "score": "0.79277617", "text": "def ==(other)\n end", "title": "" }, { "docid": "df3cc5cf66bb4c652ef55d30c829cb07", "score": "0.79254234", "text": "def ==(*) end", "title": "" }, { "docid": "df3cc5cf66bb4c652ef55d30c829cb07", "score": "0.79254234", "text": "def ==(*) end", "title": "" }, { "docid": "df3cc5cf66bb4c652ef55d30c829cb07", "score": "0.79254234", "text": "def ==(*) end", "title": "" }, { "docid": "38fa321e0d51418297e8f8177b0564ce", "score": "0.79176015", "text": "def ===(other); end", "title": "" }, { "docid": "10dc587f7777e03fa299e0bf8d4ca11c", "score": "0.7914999", "text": "def eql?(other)\n `return self == other ? Qtrue : Qfalse;`\n end", "title": "" }, { "docid": "10dc587f7777e03fa299e0bf8d4ca11c", "score": "0.7914999", "text": "def eql?(other)\n `return self == other ? Qtrue : Qfalse;`\n end", "title": "" }, { "docid": "dcea7870a8e74f4d2cd358dc5f13fd21", "score": "0.79003507", "text": "def eql?(other)\n self == other\n end", "title": "" }, { "docid": "efc962be1f2a1879e8c78e2edc45b6a0", "score": "0.7900337", "text": "def eql?(t)\n self == t\n end", "title": "" }, { "docid": "465a9cf6e7cd88943d92f1b584382539", "score": "0.7891975", "text": "def eql?(obj)\n self == obj\n end", "title": "" }, { "docid": "d8a3a2b4a10cd4df4febcb7e0c6cc456", "score": "0.78638935", "text": "def eql?(c)\n self == c\n end", "title": "" }, { "docid": "4426563602379e62097d6cbce7b02640", "score": "0.7850123", "text": "def eql?(other)\n self.class == other.class and self == other\n end", "title": "" }, { "docid": "28dd4ed4ae1427f2d7d18bea3b25213f", "score": "0.7849615", "text": "def ==(other)\n other.instance_of?(self.class) && eql?(other)\n end", "title": "" }, { "docid": "2d22d08015be332d88f87aaa7b89676a", "score": "0.7838023", "text": "def eql?(ct)\n self == ct\n end", "title": "" }, { "docid": "029216d6bbf1ec2f0139429835ddc65f", "score": "0.7826714", "text": "def eql?(anOther)\n\t\tself == anOther\n\tend", "title": "" }, { "docid": "7938b8813facc2afd5345d82520d59d9", "score": "0.78037274", "text": "def eql?(other)\n other.class == self.class && self == other\n end", "title": "" }, { "docid": "f218841c20663ca6f71bdbeb32d2d948", "score": "0.7803191", "text": "def eql?(other)\n self.class == other.class && self == other\n end", "title": "" }, { "docid": "f218841c20663ca6f71bdbeb32d2d948", "score": "0.7803191", "text": "def eql?(other)\n self.class == other.class && self == other\n end", "title": "" }, { "docid": "f218841c20663ca6f71bdbeb32d2d948", "score": "0.7803191", "text": "def eql?(other)\n self.class == other.class && self == other\n end", "title": "" }, { "docid": "f218841c20663ca6f71bdbeb32d2d948", "score": "0.7803191", "text": "def eql?(other)\n self.class == other.class && self == other\n end", "title": "" }, { "docid": "fb5361e3a711c58c986d8c14b14ea353", "score": "0.7785698", "text": "def ===(other)\n equal? other\n end", "title": "" }, { "docid": "fb5361e3a711c58c986d8c14b14ea353", "score": "0.7785698", "text": "def ===(other)\n equal? other\n end", "title": "" }, { "docid": "a627afc96310e4e2356df6511caeb9ce", "score": "0.7778234", "text": "def eql?(other) #:nodoc:\n return self == other\n end", "title": "" }, { "docid": "85f70255eb3baaa0b975e817438a6410", "score": "0.7756846", "text": "def eql?(other)\n return true if equal?(other)\n instance_of?(other.class) && cmp?(other, :eql?)\n end", "title": "" }, { "docid": "311cbc6103e67d36b9ca9feba4e2865d", "score": "0.7756841", "text": "def eql?(other)\n if equal?(other)\n return true\n end\n\n unless other.instance_of?(self.class)\n return false\n end\n\n cmp?(other, :eql?)\n end", "title": "" }, { "docid": "c4eaf1ccbe7e9255be3aacf03a17cc61", "score": "0.7749226", "text": "def eql?(other)\n same?(other) or complement?(other)\n end", "title": "" }, { "docid": "3c2aa08d2382aea67fcb4b9ae97639dc", "score": "0.77356786", "text": "def eql?(other)\n if equal?(other)\n return true\n end\n\n unless other.kind_of?(self.class)\n return false\n end\n\n cmp?(other, :eql?)\n end", "title": "" } ]
9ffdddae386a866e56a3dc7e49b80305
Calls curl_exec This method exists so it can easily be overridden and mocked.
[ { "docid": "60e5a2f3d9b79f8288dc00f58d2bb7f4", "score": "0.68085855", "text": "def curl_exec(curl_handle, request)\n to_return = nil\n curl_exec_arguments = CurlExecArguments.new(to_return)\n emit('curlExec', [curl_exec_arguments])\n (to_return,) = curl_exec_arguments.to_a\n\n # If nothing modified return, we're using the default behavior.\n if to_return.nil?\n super(curl_handle, request)\n else\n to_return\n end\n end", "title": "" } ]
[ { "docid": "2ba260502f9375d41a6d0c0323e7506f", "score": "0.5980432", "text": "def run_request(method, url, body, headers); end", "title": "" }, { "docid": "7f01544acaf55bb4411551ddec9d645a", "score": "0.58743936", "text": "def curl( opts={} )\n opts[:type] ||= 'yaml'\n\n if opts[:noauth]\n auth = '-k '\n else\n auth = \"--cert #{@configdir}/#{@certname}.pem --key #{@configdir}/#{@certname}.key --cacert #{@configdir}/ca_crt.pem\"\n end\n\n output = opts[:output] ? \"-o #{opts[:output]}\" : ''\n header = \"-H 'Accept: #{opts[:type]}'\"\n\n case opts[:method]\n when 'PUT'\n methodstr = '-X PUT'\n header = \"-H 'Content-Type: text/#{opts[:type]}'\"\n\n if opts[:file]\n filestr = \"--data-binary @#{opts[:file]}\"\n end\n\n if opts[:data]\n datastr = \"--data '#{opts[:data]}'\"\n end\n\n when 'DELETE'\n methodstr = '-X DELETE'\n when 'HEAD'\n methodstr = '-I'\n else\n # default to a GET request\n methodstr = ''\n end\n\n uri = \"https://#{@server}:8140/production/#{opts[:action]}/#{opts[:argument]}\"\n cmd = \"curl #{auth} #{methodstr} #{output} #{filestr} #{datastr} #{header} \\\"#{uri}\\\"\" #quoted uri for fact ampersands\n if @debug\n puts cmd\n else\n if not system(cmd)\n raise StandardError, 'cURL execution failed.'\n end\n puts # newline after curl output\n end\n end", "title": "" }, { "docid": "5474e5ced9c386afc5c88c633ff75bf7", "score": "0.5829879", "text": "def run\n begin code = do_perform end while code == :call_multi_perform\n raise RuntimeError.new(\"an error occured while running perform: #{code}: #{Curl.multi_strerror(code)}\") if code != :ok\n read_info\n end", "title": "" }, { "docid": "689941d654c9e62467380f496eb54871", "score": "0.5812185", "text": "def perform!\n @curl.perform\n @performed = true\n end", "title": "" }, { "docid": "0c6562419c5106cc0381f876886f9528", "score": "0.5731389", "text": "def http_call( opts )\n # [review] - Don't use DEBUG inside Remote class but pull from calling method's class?\n # [review] - Not sure if this is the best/proper way to do things but it works...\n\n # Identify method entry\n debug_print \"#{ self.class } : #{ __method__ }\\n\"\n\n # Merge default options with those passed in by user to form complete opt list\n opts = HTTP_opts.merge(opts)\n\n\n # Check URL in hash and get URI from it, then set up HTTP connection\n if opts[:url] =~ /^#{URI::regexp}$/\n _uri = URI(opts[:url])\n else\n debug_print \"No URL specified in input opts, exiting HTTP call\\n\"\n return false\n end\n\n _http = Net::HTTP.new(_uri.host, _uri.port)\n\n # Print out verbose HTTP request if :verbose is set\n # For hardcore debugging when shit really doesn't work\n _http.set_debug_output $stderr if opts[:verbose] == true\n\n # If SSL is set in hash, set HTTP connection to use SSL\n _http.use_ssl = true if opts[:ssl] == true\n\n # Create request based on HTTP method\n # [review] - Not sure if to fail with no method or default to GET?\n case opts[:method].upcase\n when \"GET\"\n _req = Net::HTTP::Get.new(_uri.request_uri)\n\n when \"POST\"\n _req = Net::HTTP::Post.new(_uri.request_uri)\n\n else\n debug_print \"No method specified, cannot make HTTP request\\n\"\n return false\n end\n\n # Check for basic authentication key in hash\n if opts[:basic_auth].size == 2\n _req.basic_auth(opts[:basic_auth][0], opts[:basic_auth][1])\n end\n\n # Check for Authentication token key in hash to be used in header\n # I think this is pretty universal, but specifically works for GitHub\n # This is standard for OAuth I think...\n if opts[:auth]\n _req[\"Authorization\"] = \"token #{ opts[:auth] }\"\n end\n\n # But sometimes we need we need other headers\n # Set specific header (GitLab requires PRIVATE_TOKEN)\n opts[:headers].each do |header|\n _req[\"#{ header[:field] }\"] = header[:value]\n end\n\n\n # [review] - Add :data_format to use set_form_data vs json body?\n # For now, use Hash or Array, this is to differentiate between\n # putting post data in body vs putting it in the form\n\n # If a POST method, :data is present, and is a Hash, fill request body with data\n if opts[:method].upcase == \"POST\" && opts[:data] && opts[:data].is_a?(Hash)\n _req.body = opts[:data].to_json\n end\n\n # If a POST method, :data is present, and is an Array, use set_form_data\n if opts[:method].upcase == \"POST\" && opts[:data] && opts[:data].is_a?(Array)\n _req.set_form_data(opts[:data][0])\n end\n\n # Make HTTP request\n _resp = _http.request(_req)\n\n # Debug prints for status and message\n debug_print \"HTTP Response Code: #{ _resp.code }\\n\"\n debug_print \"HTTP Response Msg: #{ _resp.message }\\n\"\n\n # [fix] - Not sure if 401 is the only code that gives nonparseable body?\n # Figure out what other response codes are bad news for JSON.parse\n _json = _resp.code == \"401\" ? Hash.new : JSON.parse(_resp.body)\n debug_print \"JSON: \\n #{ _json }\\n\"\n\n # [review] - Returning hash of json + response the right thing to do?\n # return {:json => _json, :resp => _resp}\n return _json, _resp\n end", "title": "" }, { "docid": "27dc33a2399c30c0aed691b3b12e667b", "score": "0.5723352", "text": "def execute_http_request (method, url, args)\n @http_request = method, url.clone, args.clone\n self.http_response = HTTParty.send method, url, args\n Log.debug \"#{@http_response.request.http_method.to_s.split('::').last.upcase} - URL: #{@http_response.request.last_uri}\"\n Log.debug 'HEADER:'\n Log.debug http_response.request.options[:headers]\n # Log.debug @http_response.request.options[:body] if @http_response.request.options[:body]\n Log.debug 'BODY:' if http_response\n Log.debug http_response if http_response\n http_response\n end", "title": "" }, { "docid": "cfdef4a99195ee7c728b919eb29e8781", "score": "0.57037145", "text": "def run_request(method, url, body, headers)\n original_run_request(method, url, \"\", headers)\n end", "title": "" }, { "docid": "617afcbf91c3306771e276582512f65e", "score": "0.5702339", "text": "def perform\n self.multi = Curl::Multi.new if self.multi.nil?\n self.multi.add self\n ret = self.multi.perform\n\n if self.last_result != 0 && self.on_failure.nil?\n error = Curl::Easy.error(self.last_result) \n raise error.first\n end\n\n ret\n end", "title": "" }, { "docid": "2ad0f9d6c07b45b412c67858c541c438", "score": "0.56943285", "text": "def call_remote \n def method_missing(*args)\n method, path = args\n if [:get, :post, :delete].index(method)\n sh \"\\ncurl -w '\\\\n' -X #{method.to_s.upcase} http://ec262discovery.herokuapp.com#{path}\"\n end\n end\n\n yield\n end", "title": "" }, { "docid": "ca8c66e9a548e571927c53c293dc2d21", "score": "0.56421846", "text": "def curl_on(host, cmd, opts = {}, &block)\n on host, \"curl --tlsv1 %s\" % cmd, opts, &block\n end", "title": "" }, { "docid": "0ae19d1ca963586027ae9729b3ab286b", "score": "0.56122506", "text": "def http_get(curl, data, url)\n\n # Define the url we want to hit\n curl.url=url\n\n # Specify the headers we want to hit\n curl.headers = data['header']\n\n # perform the call\n curl.http_get\n\n # Set headers to nil so none get reused elsewhere\n curl.headers = nil\n\n # return the curl object\n return curl\nend", "title": "" }, { "docid": "453ea9d47274f5bfb093a3cd84abd22c", "score": "0.5596814", "text": "def execute(method,\n url,\n body: nil,\n headers: {},\n redirect_limit: @redirect_limit)\n raise ArgumentError, 'HTTP redirect too deep' if redirect_limit.zero?\n\n # setup our HTTP class\n uri = URI.parse(url)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = uri.scheme == 'https'\n http.verify_mode = @ssl_verify\n\n # create our request\n request = net_http_request_class(method).new(uri)\n # copy headers into the request\n headers.each { |k, v| request[k] = v }\n # set body on the request\n if body\n request.content_type = 'application/json'\n request.body = body.to_json\n end\n\n # execute\n resp = http.request(request)\n\n # check response for success, redirect or error\n case resp\n when Net::HTTPSuccess then\n body = resp.body\n if body\n JSON.parse(body)\n else\n resp\n end\n when Net::HTTPRedirection then\n execute(method, resp['location'],\n body: body, headers: headers,\n redirect_limit: redirect_limit - 1)\n else\n Puppet.debug(\"throwing HTTP error: request_method=#{method} request_url=#{url} request_body=#{body} response_http_code=#{resp.code} resp_message=#{resp.message} resp_body=#{resp.body}\")\n stack_trace = caller.join(\"\\n\")\n Puppet.debug(\"Raising exception: #{resp.error_type.name}\")\n Puppet.debug(\"stack trace: #{stack_trace}\")\n message = 'code=' + resp.code\n message += ' message=' + resp.message\n message += ' body=' + resp.body\n raise resp.error_type.new(message, resp)\n end\n end", "title": "" }, { "docid": "cca15c74c58831748f5f1d1cb049ed65", "score": "0.5577837", "text": "def submit_curl_command(cmd, cert_symbol = :regular)\n # Derive the FTP host & path from the URL in config\n host = RedSkyConfig::SERVER[:red_sky_url].split(\"//\")[1].split(\":\")[0]\n host_short_form = host.split(\".\")[0]\n user = get_user_id(cert_symbol)\n pass = get_user_cert_pw(cert_symbol)\n\n output = \"\"\n Net::SSH.start(host, user, :password => pass) do |ssh|\n output = ssh.exec!(cmd)\n end\n\n # We expect a JSON response from the server\n # The recorded output will contain this inside curl's own SDTOUT, so we need to extract the JSON\n output = output[output.index(\"{\") .. output.index(\"}\")]\n JSON.parse(output)\n end", "title": "" }, { "docid": "1dd131e3098ecdc28c41b9e7012bb762", "score": "0.5555299", "text": "def upload(http_post_url, remote_folder, local_file)\n $log.info \"curl -F file=@#{local_file} -F directory=#{remote_folder} #{http_post_url}\"\n return system(\"curl -F file=@#{local_file} -F directory=#{remote_folder} #{http_post_url}\")\nend", "title": "" }, { "docid": "ea6fdcdbcc484b70c9b3194a3c6e7001", "score": "0.5528361", "text": "def exec_api(json_req)\n begin\n req = sign_request(json_req)\n return HttpChannel.new(api_uri).execute(req)\n rescue Curl::Err::CurlError => ex\n return JsonResponse.new(\"fail\", ex.message)\n end\n end", "title": "" }, { "docid": "983fe78b58a43929128683ee4e4a36e9", "score": "0.55194914", "text": "def curl(server, url, args:{}, file:\"\", post:false, json:false, getfile:nil)\n cmd = \"\"\n # Getfile needs json to remove html, but don't parse as json\n cmd << if getfile.nil? then '-i ' else '-H \"Accept: application/json\" ' end\n cmd << '-X POST ' if post\n cmd << '-H \"Accept: application/json\" ' if json\n cmd << \"-F \\'file=@#{file}\\' \" if file != \"\"\n args.each_pair { |k,v| cmd << \"-F \\'#{k}=#{v}\\' \" }\n\n pipe = getfile.nil? ? '' : '-o ' + File.join($workdir, getfile)\n url2 = !getfile.nil? ? url + getfile + \"/\" : url\n\n res = run(\"curl http://#{server}#{url2} #{cmd}#{pipe}\")\n # clean up json output\n if json\n i = res =~ /{/\n res = res[i..-1] if i\n res = JSON::parse(res)\n end\nend", "title": "" }, { "docid": "01d7e5762a9ce45b59235d6f978610ef", "score": "0.5514447", "text": "def call(env)\n self.class.perform_request env\n end", "title": "" }, { "docid": "5c7e09f8626900c25c37df9665e4e7b7", "score": "0.5465691", "text": "def upload_test(path)\n puts \"curl -F 'file=@#{path}' -F 'uKey=fc462b86df69a3373a1c657c68fa78ca' -F '_api_key=3a9cf2ef36199832fc96d03c4d870c42' https://www.pgyer.com/apiv1/app/upload\"\n puts \"uploading #{path}........\"\n puts `curl -F \"file=@#{path}\" -F \"uKey=fc462b86df69a3373a1c657c68fa78ca\" -F \"_api_key=3a9cf2ef36199832fc96d03c4d870c42\" https://www.pgyer.com/apiv1/app/upload`\n puts \"finish uploading #{path}........\"\nend", "title": "" }, { "docid": "c34e759c264db43d0848f761513074d5", "score": "0.54627097", "text": "def execute_call_plain(url)\n res = Net::HTTP.get_response(URI.parse(url))\n case res\n when Net::HTTPRedirection\n # Return the new URL\n res['location']\n when Net::HTTPSuccess\n res.body\n else\n raise TransportError.new(res)\n end\n end", "title": "" }, { "docid": "53879dc301e1ca7d7f9b1a282303e7c3", "score": "0.54354095", "text": "def perform_request\n\t\t# If this is set within the begin block, it will reset 'retries' with every retry\n\t\tsleep_sec = 1\n\t\tretries = 3\n\t\tbegin\n\t\t\t# Can we check if configuration is a valid object of class OzRequestConfiguration?\n\t\t\turl = \"localhost:3000/v1.0\"+path\n\t\t\tcurl_instance.url = url\n\t\t\tcurl_instance.headers = {}.merge!(headers)\n\t\t\t#configuration.config_request(self)\n\n\t\t\tcase method\n\t\t\t\twhen :get\n\t\t\t\t\tcurl_instance.http_get\n\t\t\t\twhen :head\n\t\t\t\t\tcurl_instance.http_head\n\t\t\t\twhen :put\n\t\t\t\t\tcurl_instance.http_put(req_body)\n\t\t\t\twhen :post\n\t\t\t\t\tcurl_instance.http_post(req_body)\n\t\t\t\twhen :delete\n\t\t\t\t\tcurl_instance.http_delete\n\t\t\t\telse\n\t\t\t\t\traise NotImplementedError.new(\"Unsupported http method #{method}\")\n\t\t\tend\n\n\t\t\tresponse = UserHTTPResponse.new(curl_instance)\n\t\t\tresponse\n\t\trescue NotImplementedError => e\n\t\t\traise e\n\t\trescue Curl::Err::TimeoutError, Curl::Err::GotNothingError, Curl::Err::HostResolutionError, Request5xxException => e\n\t\t\tif retries > 0\n\t\t\t\tperform_sleep(sleep_sec)\n\t\t\t\tretries -= 1\n\t\t\t\tsleep_sec *= 2\n\t\t\t\tretry\n\t\t\tend\n\t\t\traise e\n\t\trescue Exception => e\n\t\t\traise configuration.api_error_class.new({exception: e.inspect})\n\t\tend\n\tend", "title": "" }, { "docid": "b0fac11871e025edfa446b84aaf7916e", "score": "0.54316366", "text": "def execute\n options = {\n method: :post,\n timeout: 6000,\n open_timeout: 6000,\n accept: :schema\n }\n options.merge!(url: @url, payload: @html)\n begin\n res = RestClient::Request.execute(options).to_str\n @response = JSON.parse(res)\n rescue => e\n puts \"some problems with #{@url}\"\n puts e\n nil\n end\n end", "title": "" }, { "docid": "f440fa23e871f022ce2d7d81dbf5b75d", "score": "0.5431606", "text": "def call_service\n\t\t\t# puts \"Getting: #{self.url}\"\n\t\t\tresponse = Curl::Easy.perform(self.url)\n\t\t\tHpricot(response.body_str)\n\t\trescue Timeout::Error => e\n\t\t\tretry_service(e)\n\t\trescue Exception => e\n\t\t\tretry_service(e)\n\t\tend", "title": "" }, { "docid": "95fd509f1973ff15204bb09ed487ac90", "score": "0.5420967", "text": "def execute(http_method, path, params = nil, data = nil, headers = nil)\n # Prepare URL and params\n url = _make_url(path, params)\n if [:get, :delete].include? http_method\n unless data.nil?\n puts \"WARNING: #{http_method.to_s.upcase} method does not pass any data. Path '#{path}'\"\n data = nil\n end\n end\n\n # Setup the request\n rest_client_args = {}\n rest_client_args[:method] = http_method\n rest_client_args[:url] = url\n rest_client_args[:payload] = data\n rest_client_args[:user] = @user\n rest_client_args[:password] = @password\n rest_client_args[:headers] = _get_headers(headers)\n\n # Execute\n # TODO: add logger\n begin\n ::RestClient::Request.execute(rest_client_args)\n rescue => e\n raise @exc_class.new(e)\n end\n end", "title": "" }, { "docid": "50d25878328abf2ad6b07b32a274155b", "score": "0.54048795", "text": "def fetch(url) \n puts \"Fetching url #{url}\";\n str = `curl -silent \"#{url}\"`\n return str\nend", "title": "" }, { "docid": "8f08fab6008ec96c777630f38f1e0932", "score": "0.5386774", "text": "def method_missing(symbol, *args)\n @curl.send(symbol, *args)\n end", "title": "" }, { "docid": "6767fb34f00d211296ac279f7fccd8b4", "score": "0.5373875", "text": "def execute_http_request(http_method, path, payload = nil)\n response = RestClient::Request.execute(method: http_method, url: path, payload: payload, headers: DEFAULT_HEADERS)\n # handle response using helper\n handle_response(response)\n end", "title": "" }, { "docid": "dc6ad050d6cc36076dff8e7e4508c95d", "score": "0.5358295", "text": "def test_new_06\n Curl::Easy.new(TestServlet.url) do|curl|\n curl.http_post\n assert_equal \"POST\\n\", curl.body_str\n end\n end", "title": "" }, { "docid": "04473e591e62c36b0b422ac2c13432e9", "score": "0.535165", "text": "def execute(url, method, options = {}, payload = nil)\n request, parser = prepare_and_split_options(url, method, options)\n # Prepare the payload if it is provided\n request[:payload] = payload_from_doc(payload, parser) if payload\n begin\n parse_response(RestClient::Request.execute(request), parser)\n rescue Exception => e\n if $DEBUG\n raise \"Error while sending a #{method.to_s.upcase} request #{uri}\\noptions: #{opts.inspect}\\n#{e}\"\n else\n raise e\n end\n end\n end", "title": "" }, { "docid": "559356aa419c363988383e4235844415", "score": "0.5340823", "text": "def cf_curl(*args)\n output = capture('cf', 'curl', *args)\n JSON.parse output\nend", "title": "" }, { "docid": "383ab0eb139dd0ad7b9e74f5131b847a", "score": "0.53332984", "text": "def curl_fetch(url, target, param='')\n file_dist = File::join(DISTFILES, File::basename(url))\n\n unless File::exists? DISTFILES\n FileUtils::mkdir_p(DISTFILES)\n end\n\n if File::exists? file_dist\n sysprint \"Package file #{file_dist} already exists\"\n package_extract(file_dist, target)\n return\n end\n\n result = 0\n unless sysexec(\"curl -# -L #{param} \\\"#{url}\\\" -o \\\"#{file_dist}\\\"\")\n syserr \"cURL failed\"\n raise\n end\n\n package_extract(file_dist, target)\nend", "title": "" }, { "docid": "24221e294b54d7f52148e92c57d354bb", "score": "0.5332069", "text": "def perform_execute_request(data = {})\n execute_recipe(version, data)\n end", "title": "" }, { "docid": "b8b6c5c28df8b632f603af6c7d16d364", "score": "0.5331008", "text": "def call_rest(action, url, auth_cert, auth_key, ref, content_type, body = nil)\n begin\n # change url based on if we have a ref or not\n if ref.nil?\n url = url\n else\n url = url + \"/\" + ref\n end\n\n # set params for api call\n params = {\n :method => action,\n :url => url,\n :ssl_client_cert => OpenSSL::X509::Certificate.new(auth_cert),\n :ssl_client_key => OpenSSL::PKey::RSA.new(auth_key),\n :verify_ssl => false,\n :headers => { :content_type => content_type, :accept => content_type }\n }\n\n # generate payload data\n content_type == :json ? (params[:payload] = JSON.generate(body) if body) : (params[:payload] = body if body)\n log(:info, \"call_rest: Request: #{url} action: #{action} payload: #{params[:payload]}\")\n\n # execute the request\n RestClient::Request.new(params).execute\n rescue => err\n # log and backtrace the error\n log(:error, \"[#{err}]\\n#{err.backtrace.join(\"\\n\")}\")\n log(:error, \"call_rest: #{err}. Returning nil.\")\n return nil\n end\nend", "title": "" }, { "docid": "ce97e275b89de4a0fb2abbb28146b7c6", "score": "0.532346", "text": "def execute(refresh=false)\n return @response if @response && !refresh \n validate \n build_url \n @done = true\n DomainTools.counter!\n require 'net/http'\n begin\n Net::HTTP.start(@host) do |http|\n req = Net::HTTP::Get.new(@url) \n @http = http.request(req) \n @success = validate_http_status \n return finalize\n end\n rescue DomainTools::ServiceException => e \n @error = DomainTools::Error.new(self,e)\n raise e.class.new(e)\n end\n end", "title": "" }, { "docid": "f34aee6934c23e416816e083c935fe64", "score": "0.53196174", "text": "def make_rest_call(method, url, payload = nil, headers = nil)\n options = call_options_builder(method, url, payload, headers)\n RestClient::Request.execute(options)\n rescue => e\n raise e\n end", "title": "" }, { "docid": "c2c3ce675ee03cc8745df7cbc3ee5b86", "score": "0.5316297", "text": "def exec_api_call(rest_type, req, data = nil, exit_on_fail = false)\n max_retry = RETRIES\n get_hash = nil\n attempts = 0\n is_good = false\n while !is_good && attempts < max_retry\n attempts += 1\n get_hash = call_api(req, rest_type, data)\n is_good = get_hash[:status]\n unless is_good\n exit_script() if exit_on_fail\n puts \"Got Error making API call - #{req} \"\n if attempts < max_retry\n puts \"Retrying #{attempts}\"\n sleep(4 * attempts)\n end\n end\n end\n get_hash\n end", "title": "" }, { "docid": "68e18c67559ee270f8313474a5cf786d", "score": "0.53062123", "text": "def http_post(*args)\n url = args.shift\n c = Curl::Easy.new url\n yield c if block_given?\n c.http_post *args\n c\n end", "title": "" }, { "docid": "08bcb4b2cef531b944acfceebfce1c8a", "score": "0.5291519", "text": "def call(call_url = self.call_url, arguments = self.arguments, resending = false)\n Postage.logger.info \"Sending Request [UID: #{self.uid} URL: #{call_url}] \\n#{arguments.inspect}\\n\"\n \n self.arguments[:uid] = self.uid\n self.arguments[:plugin_version] = Postage::PLUGIN_VERSION\n \n body = { :api_key => Postage.api_key, :arguments => arguments }.to_json\n \n Timeout::timeout(5) do\n self.response = self.class.post( call_url, :headers => HEADERS, :body => body )\n end\n \n Postage.logger.info \"Received Response [UID: #{self.uid}] \\n#{self.response.inspect}\\n\"\n \n resend_failed_requests unless resending\n return Postage::Response.new(self.response)\n \n rescue Timeout::Error, SocketError, Exception => e\n Postage.logger.error \"Failure [UID: #{self.uid}] \\n#{e.inspect}\"\n \n store_failed_request(e) unless resending \n return nil # no response generated\n end", "title": "" }, { "docid": "e84ef5bc8e5ff50f1d6e3aa97949f6f2", "score": "0.52833575", "text": "def call\n return background! if @background\n raise \"Already called\" if @called\n @called = true\n begin\n @client.client.execute @request, self, @context\n rescue Java::JavaNet::SocketTimeoutException => e\n ex = Manticore::SocketTimeout\n rescue Java::OrgApacheHttpConn::ConnectTimeoutException => e\n ex = Manticore::ConnectTimeout\n rescue Java::JavaNet::SocketException => e\n ex = Manticore::SocketException\n rescue Java::OrgApacheHttpClient::ClientProtocolException, Java::JavaxNetSsl::SSLHandshakeException,\n Java::OrgApacheHttpConn::HttpHostConnectException, Java::OrgApacheHttp::NoHttpResponseException,\n Java::OrgApacheHttp::ConnectionClosedException => e\n ex = Manticore::ClientProtocolException\n rescue Java::JavaNet::UnknownHostException => e\n ex = Manticore::ResolutionFailure\n rescue Java::JavaLang::IllegalArgumentException => e\n ex = Manticore::InvalidArgumentException\n rescue Java::JavaLang::IllegalStateException => e\n if (e.message || '').index('Connection pool shut down')\n ex = Manticore::ClientStoppedException\n else\n @exception = e\n end\n rescue Java::JavaLang::Exception => e # Handle anything we may have missed from java\n ex = Manticore::UnknownException\n rescue StandardError => e\n @exception = e\n end\n\n # TODO: If calling async, execute_complete may fail and then silently swallow exceptions. How do we fix that?\n if ex || @exception\n @exception ||= ex.new(e)\n @handlers[:failure].call @exception\n execute_complete\n nil\n else\n execute_complete\n self\n end\n end", "title": "" }, { "docid": "6e51a8ee90b7da88effed990a53528f0", "score": "0.5275601", "text": "def astro_curl(url, params_hash)\n AstroPay::Curl.post(url, params_hash)\n end", "title": "" }, { "docid": "463119eb6a2db116fc696c146ac4c1f5", "score": "0.52640486", "text": "def execute(json_request)\n fetch_response( execute_async(json_request) )\n end", "title": "" }, { "docid": "fc460ca7adc30e65e267475d8e4cdfaf", "score": "0.5258621", "text": "def call\n conn = http_setup\n res = set_up_response(method.to_sym, uri, conn, headers ,body)\n\n response = HttpResponse.new(res)\n response.uri = uri\n raise response.error if !response.success? && !@has_retry_filter\n response\n end", "title": "" }, { "docid": "d390df2bd2a6f96690b1124f662eac6c", "score": "0.52564025", "text": "def curl\n puts \"fetching #{@uri.to_s}\".green.on_black\n start_time = Time.now\n begin\n c = @c\n c.url = @uri.to_s\n c.perform\n end_time = Time.now\n case c.response_code\n when 200 then\n page = Page.new(@uri, response_code: c.response_code,\n response_head: c.header_str,\n response_body: c.body_str,\n response_time: ((end_time-start_time)*1000).round,\n crawled_time: (Time.now.to_f*1000).to_i)\n when 300..307 then\n page = Page.new(@uri, response_code: c.response_code,\n response_head: c.header_str,\n response_body: c.body_str,\n response_time: ((end_time-start_time)*1000).round,\n redirect_url: c.redirect_url)\n when 404 then\n page = Page.new(@uri, response_code: c.response_code,\n response_time: ((end_time-start_time)*1000).round)\n end\n rescue Exception => e\n puts e.inspect\n puts e.backtrace\n end\n end", "title": "" }, { "docid": "187ad7b0dbfc329411a8803613dbb978", "score": "0.52298284", "text": "def http_post(curl, data, url)\n\n # Define the post data\n data2 = ''\n\n # Loop through the data[\"post_data\"] passed in to build up the post data string\n data[\"post_data\"].each do |key, value|\n if (data2 != '') then\n data2 = data2 + '&'\n end\n # If the value is null we don't just want it to look like: item=\n if (value.nil?) then\n data2 = data2 + CGI::escape(key.to_s) + '='\n else\n data2 = data2 + CGI::escape(key.to_s) + '=' + CGI::escape(value.to_s)\n end\n end\n\n # Define the url we want to hit\n curl.url = url\n # Specify the headers we want to hit\n curl.headers = data['header']\n\n # perform the call\n curl.post(data2)\n\n curl.headers = nil\n\n # Set headers to nil so none get reused elsewhere\n curl.headers = nil\n\n # return the curl object\n return curl\n\nend", "title": "" }, { "docid": "b711351e0f66023f918e72f75f9171e1", "score": "0.522841", "text": "def call\n uri = URI(full_url)\n\n request = Net::HTTP::Post.new(uri)\n default_headers.each { |k, v| request[k] = v }\n request.body = to_xml\n\n https = Net::HTTP.new(uri.hostname, uri.port)\n https.use_ssl = true\n https.ssl_version = :TLSv1_2_client\n if Nuncium.configuration.cert_file\n https.verify_mode = OpenSSL::SSL::VERIFY_PEER\n https.cert = Nuncium.configuration.cert_file\n https.key = Nuncium.configuration.private_key\n https.verify_depth = 5\n request.basic_auth(Nuncium.configuration.data_box, '')\n else\n request.basic_auth(\n Nuncium.configuration.username,\n Nuncium.configuration.password\n )\n end\n response = https.request(request)\n call_reponse_wrapper(response)\n end", "title": "" }, { "docid": "4f86fcd30c6f702de8f4e7de050578ec", "score": "0.5219883", "text": "def puts_curl(command, resource, payload=nil, file=nil)\n headers = resource.options[:headers] || {}\n req = RestClient::Request.new(resource.options.merge(\n :method => :get,\n :url => resource.url,\n :headers => headers))\n headers.delete(:content_type) if file\n curl_headers = req.make_headers headers\n curl_headers = curl_headers.map {|e| %Q[-H \"#{e.join(': ')}\"] }.join(' ')\n curl = \"curl -X #{command.upcase} -i #{curl_headers}\"\n if file\n payload = multipart_payload payload || {}, file\n payload = payload.map { |k,v|\n File.file?(v) ? %Q[-F \"#{k}=@#{File.absolute_path(v)}\"] : %Q[-F \"#{k}=#{v}\"]\n }.join ' '\n curl = \"#{curl} #{payload}\"\n else\n curl = %Q[#{curl} -d '#{payload}'] if (payload)\n end\n puts \"#{curl} '#{URI::encode resource.url}'\"\nend", "title": "" }, { "docid": "7eddae9f084adf1b29f810589551344f", "score": "0.5206108", "text": "def call_rest(action, url, headers, ref, body = nil)\n begin\n # change url based on if we have a ref or not\n if ref.nil?\n url = url\n else\n url = url + \"/\" + ref\n end\n\n # set params for api call\n params = {\n :method => action,\n :url => url,\n :verify_ssl => false,\n :headers => headers\n }\n\n # generate payload data\n params[:payload] = body if body\n log(:info, \"call_rest: Request URL: #{url}\")\n log(:info, \"call_rest: Request Action: #{action}\")\n log(:info, \"call_rest: Request Headers: #{headers.inspect}\")\n log(:info, \"call_rest: Request Payload: #{params[:payload]}\")\n\n # execute the request\n RestClient::Request.new(params).execute\n rescue => err\n # log and backtrace the error\n log(:error, \"[#{err}]\\n#{err.backtrace.join(\"\\n\")}\")\n log(:error, \"call_rest: #{err}. Returning nil.\")\n return nil\n end\nend", "title": "" }, { "docid": "5e33e4c822a9867ac8c5dd08dd874f73", "score": "0.5204316", "text": "def http_call(payload); end", "title": "" }, { "docid": "a352fa26cfe0d8a9a3e71476b3427141", "score": "0.51461804", "text": "def curl_stuff(curl_handle)\n to_return = nil\n curl_stuff_arguments = CurlStuffArguments.new(to_return)\n emit('curlStuff', [curl_stuff_arguments])\n (to_return,) = curl_stuff_arguments.to_a\n\n # If nothing modified return, we're using the default behavior.\n if to_return.nil?\n super(curl_handle)\n else\n to_return\n end\n end", "title": "" }, { "docid": "2af243f8b1a070d29c84b0173846713b", "score": "0.51378196", "text": "def execute(json_request, agent_id, host)\n fetch_response( execute_async(json_request, agent_id, host) )\n end", "title": "" }, { "docid": "01a022ad7a398b5ee5c3e28b344a42f4", "score": "0.5111339", "text": "def run_request(method, url, body, headers)\n if !METHODS.include?(method)\n raise ArgumentError, \"unknown http method: #{method}\"\n end\n\n # Resets temp_proxy\n @temp_proxy = proxy_for_request(url)\n\n request = build_request(method) do |req|\n req.options = req.options.merge(:proxy => @temp_proxy)\n req.url(url) if url\n req.headers.update(headers) if headers\n req.body = body if body\n yield(req) if block_given?\n end\n\n builder.build_response(self, request)\n end", "title": "" }, { "docid": "df6efa4b379bacdeeba128fe79c7774c", "score": "0.51065916", "text": "def exec_api(agent, operation, params)\n begin\n uri = agent.uri\n post = JsonRequest.new(operation, params)\n debug { \"uri: \" + uri }\n debug { post.to_s }\n\n if crypto_enabled? then\n ret = http_post(uri, encrypt_for_agent(agent, post.to_json))\n res = decrypt_from_agent(agent, ret)\n else\n res = http_post_json(uri, post.to_json)\n end\n\n ret = JsonResponse.from_json(res)\n debug { ret.to_s }\n return ret\n\n rescue Curl::Err::CurlError => ex\n ret = JsonResponse.new(\"fail\", ex.message, ex.backtrace)\n debug { ret.to_s }\n return ret\n end\n end", "title": "" }, { "docid": "1b0581a80f05b06887f69d79803a982e", "score": "0.5105693", "text": "def do_post(request, out_stream)\n raise Error.new(\"HTTPS over a proxy is not supported.\") if !@use_http and @proxy_host\n\n reset_response_data()\n\n request.basic_auth(@user_name, @api_key)\n request.add_field('User-Agent', @user_agent)\n\n while true\n begin\n return exec_request(request, out_stream)\n rescue Error => err\n if (err.getCode() == '502' or err.getCode() == '503') and @retry_count > @retry\n @retry += 1\n sleep(@retry * 0.1)\n else\n raise\n end\n end\n end\n end", "title": "" }, { "docid": "80df367b5ccb435f03117084f3c35d28", "score": "0.5095635", "text": "def execute_http_request(http, request)\n @response = http.request(request)\n @http_headers = {}\nend", "title": "" }, { "docid": "a4daea127906af4cb7aa0d8212866932", "score": "0.50946337", "text": "def execute!\n validate_request!\n perform_request!\n\n build_response\n end", "title": "" }, { "docid": "4523a054bf782f4f92da7963ba3dfc4f", "score": "0.5093561", "text": "def call\n uri = URI.parse(ovh_domain)\n http = Net::HTTP.new(uri.host, uri.port)\n http.use_ssl = true\n\n request = build_request\n add_headers(request)\n\n response = http.request(request)\n stdout_warn_log \"Made call to API: #{response.body}\"\n stdout_error_log 'Error: Call to API failed' && context.fail! unless response.is_a? Net::HTTPSuccess\n response\n end", "title": "" }, { "docid": "a9cc285b24e0b3df6e335add42166c09", "score": "0.5082549", "text": "def api_execute(path, method, options = {})\n params = options[:params]\n case method\n when :get\n req = build_http_request(Net::HTTP::Get, path, params)\n when :post\n req = build_http_request(Net::HTTP::Post, path, nil, params)\n when :put\n req = build_http_request(Net::HTTP::Put, path, nil, params)\n when :delete\n req = build_http_request(Net::HTTP::Delete, path, params)\n else\n fail \"Unknown http action: #{method}\"\n end\n timeout = options[:timeout] || @read_timeout\n http = Net::HTTP.new(host, port)\n http.read_timeout = timeout\n setup_https(http)\n req.basic_auth(user_name, password) if [user_name, password].all?\n Log.debug(\"Invoking: '#{req.class}' against '#{path}\")\n res = http.request(req)\n Log.debug(\"Response code: #{res.code}\")\n process_http_request(res, req, params)\n end", "title": "" }, { "docid": "84a8976e4ffefdef36b46198684d618f", "score": "0.50814897", "text": "def execute(parameters)\n url = build_url(parameters)\n response = get_response(url)\n handle_errors(response[0]).body\n end", "title": "" }, { "docid": "87c854827f0193550f6894d46c4205f7", "score": "0.5074163", "text": "def astro_curl(url, params)\n AstroPay::Curl.post(url, params)\n end", "title": "" }, { "docid": "c684498691f4384dea3864ebf65d339d", "score": "0.50694525", "text": "def call(method, url, data = nil, options = nil)\n if NO_BODY.include?(method)\n options ||= data\n data = nil\n end\n\n if data\n data = data.is_a?(String) ? data : encode_body(data)\n end\n\n options ||= {}\n url = expand_url(url, options[:uri])\n @adapter.request(self, method, url, data, options)\n end", "title": "" }, { "docid": "061724cbd2897e52f3559f935614f12a", "score": "0.5048904", "text": "def execute(method, path, **options)\n uri = URI(\"#{@base_url}/#{path}\")\n\n case method.to_sym\n when :get\n req = Net::HTTP::Get.new(uri)\n when :post\n req = Net::HTTP::Post.new(uri)\n when :put\n req = Net::HTTP::Put.new(uri)\n when :delete\n req = Net::HTTP::Delete.new(uri)\n else\n raise ARestException, \"Unknown method: #{method}\"\n end\n\n req.form_data = options[:form_data] if options[:form_data]\n\n headers = options[:headers] || @headers \n headers.each { |k,v| req[k] = v } if headers\n\n auth_user = options[:auth_user] || @auth_user\n auth_password = options[:auth_password] || @auth_password\n req.basic_auth auth_user, auth_password if auth_user && auth_password\n\n token = options[:token] || @auth_token\n if token\n req[\"Authorization\"] = \"Token token=#{token}\"\n end\n\n res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|\n http.request(req)\n end\n res\n end", "title": "" }, { "docid": "4480d67e930b8828057eabce64647bb7", "score": "0.5042347", "text": "def post_with_curl\n url = @settings.webhook_url\n `curl -is -X POST -H \"Content-Type:application/json\" -d '#{get_body}' '#{url}'`\n end", "title": "" }, { "docid": "9d6e36a80f46fd2a03a0a102b98925a9", "score": "0.50410867", "text": "def execute!\n validate_request!\n perform_request!\n\n build_response\n end", "title": "" }, { "docid": "0c0f4984a508134492de739f70977266", "score": "0.50410765", "text": "def bin_get(url)\n `#{curl_get_cmd(url)} 2>/dev/null`\n end", "title": "" }, { "docid": "a243f97d05f25535352dbe04e6207b18", "score": "0.50397193", "text": "def curl(url,params)\n uri = URI.parse(url)\n https = Net::HTTP.new(uri.host,uri.port)\n https.use_ssl = true\n base64h = Base64.strict_encode64(\"#{APP_KEY}:#{APP_SECRET}\")\n headers = {'Authorization' => \"Basic #{base64h}\", 'Content-Type' =>'application/x-www-form-urlencoded'}\n request = Net::HTTP::Post.new(uri.request_uri, headers)\n request.set_form_data(params)\n response = https.request(request)\n\nend", "title": "" }, { "docid": "f5f7a88d04819279126328a6d21e247b", "score": "0.50365907", "text": "def setup_curl(uri, auth = false, use_puppet_certs = false)\n curl = Curl::Easy.new(\"#{uri}\")\n if auth\n curl.http_auth_types = :basic\n curl.username = @foreman_user\n curl.password = @foreman_pass\n end\n # puppetdb will want to verify client certs if using https\n if @use_puppet_certs\n curl.cacert = \"#@puppetdir/ssl/certs/ca.pem\"\n curl.cert = \"#@puppetdir/ssl/certs/#{ENV['HOSTNAME']}.pem\"\n curl.cert_key = \"#@puppetdir/ssl/private_keys/#{ENV['HOSTNAME']}.pem\"\n end\n curl.ssl_verify_host = false\n curl.ssl_verify_peer = false\n curl\n end", "title": "" }, { "docid": "8a22dc7833b3dd3976ae2c350dd845b7", "score": "0.5033407", "text": "def do_it(http_method, url:, **options)\n err = nil\n timing = {}\n timing[:start] = Time.now\n begin\n faraday_init = {url: url}\n faraday_init[:ssl] = {verify: false} if options[:https_allow_unverified]\n faraday_init[:request] = {timeout: options[:timeout]} if options[:timeout]\n conn = Faraday.new(faraday_init) do |faraday|\n # Request encoders are relatively safe, as they have built-in checks for suitability.\n # faraday.request(:multipart) # multipart first, takes priority over url_encoded.\n faraday.request(:url_encoded)\n # faraday.response(:logger, nil, bodies: {response: true}) if Rails.env.development?\n faraday.proxy = options[:proxy] if options[:proxy]\n faraday.adapter(Faraday.default_adapter) # must be after middlewares\n faraday.basic_auth(options[:basic_auth][:username], options[:basic_auth][:password]) if options[:basic_auth]\n end\n timing[:start] = Time.now\n response = conn.run_request(http_method, nil, options[:body], options[:headers])\n rescue => e\n err = e\n end\n timing[:end] = Time.now\n timing[:duration] = timing[:end] - timing[:start]\n log_url = options[:log_url] || url\n if err\n Rails.logger.error(http_method.to_s.upcase+\" #{log_url} ERROR (#{(timing[:duration]*1000).round}ms): #{err.class}: #{err.message}\")\n raise err.class, err.message, caller(2)\n else\n Rails.logger.info(http_method.to_s.upcase+\" #{log_url} response (#{(timing[:duration]*1000).round}ms): #{response.status} \"+response.body.inspect.truncate(350, omission: \"... (#{response.body.to_s.length} total)\\\"\")) #\"\n end\n unless options[:return_failed_response] || response.success?\n err = ResponseError.new_from_response(response)\n err.set_backtrace(caller(2))\n raise err\n end\n {success: response.success?, status: response.status, body: response.body, headers: response.headers.to_h, timing: timing}\n end", "title": "" }, { "docid": "d10bbf36929b4552c96129e3f781cac9", "score": "0.5029916", "text": "def perform_http_request\n request_opts = { followlocation: true, ssl_verifypeer: false, timeout: 30 }\n @response = Typhoeus.get(@webpage_request.url, request_opts)\n @response && process_response_data\n @response\n end", "title": "" }, { "docid": "910c8bdb48cfa3259070fabeadfd6ceb", "score": "0.5027077", "text": "def rest_call(url, method, options = {})\n methods = %w{get post put}\n result = {\"status\" => \"ERROR\", \"response\" => \"\", \"message\" => \"\"}\n method = method.downcase\n verbose = get_option(options, \"verbose\") == \"yes\" or get_option(options, \"verbose\")\n headers = get_option(options, \"headers\", {:accept => :json, :content_type => :json})\n return result[\"message\"] = \"ERROR - #{method} not recognized\" unless methods.include?(method)\n log \"Rest URL: #{url}\" if verbose\n begin\n data = get_option(options, \"data\")\n rest_params = {}\n rest_params[:url] = url\n rest_params[:method] = method.to_sym\n rest_params[:verify_ssl] = OpenSSL::SSL::VERIFY_NONE if url.start_with?(\"https\")\n rest_params[:payload] = data.to_json unless data == \"\"\n if options.has_key?(\"username\") && options.has_key?(\"password\")\n rest_params[:user] = options[\"username\"]\n rest_params[:password] = options[\"password\"]\n end\n rest_params[:headers] = headers\n log \"RestParams: #{rest_params.inspect}\" if verbose\n if %{put post}.include?(method)\n return result[\"message\"] = \"ERROR - no data param for post\" if data == \"\"\n response = RestClient::Request.new(rest_params).execute\n else\n response = RestClient::Request.new(rest_params).execute\n end\n rescue Exception => e\n result[\"message\"] = e.message\n raise \"RestError: #{result[\"message\"]}\" unless get_option(options, \"suppress_errors\") == true\n return result\n end\n log \"Rest Response:\\n#{response.inspect}\" if verbose\n if headers[:accept] == :json\n parsed_response = JSON.parse(response) rescue nil\n else\n parsed_response = response\n end\n parsed_response = {\"info\" => \"no data returned\"} if parsed_response.nil?\n result[\"code\"] = response.code\n if response.code < 300\n result[\"status\"] = \"success\"\n result[\"data\"] = parsed_response\n elsif response.code == 422\n result[\"message\"] = \"REST call returned code 422 usually a bad token\"\n else\n result[\"message\"] = \"REST call returned HTTP code #{response.code}\"\n end\n if result[\"status\"] == \"ERROR\"\n raise \"RestError: #{result[\"message\"]}\" unless get_option(options, \"suppress_errors\") == true\n end\n result\n end", "title": "" }, { "docid": "4e02ca01ac535892be1627169a05ae95", "score": "0.5025887", "text": "def do_request(json_obj,truncate_length=5000)\n redirects=0\n begin # This is here for redirects\n http=select_http_obj\n response = nil\n# http.set_debug_output($stderr) #Uncomment to see low level HTTP debug\n headers={'Content-Type'=>'application/json-rpc',\n 'User-Agent'=>'Zbx Ruby CLI'}\n debug(4,:msg=>\"Sending: #{json_obj}\")\n response = http.post(@url.path, json_obj,headers)\n debug(4,:msg=>\"Response Code: #{response.code}\")\n debug(4,:var=>response.body,:msg=>\"Response Body\",:truncate=>truncate_length)\n case response.code.to_i\n when 301\n puts \"Redirecting to #{response['location']}\"\n @url=URI.parse(response['location'])\n\t\t\t\t raise Redirect\n when 500\n raise ZbxAPI_GeneralError.new(\"Zabbix server returned an internal error\\n Call: #{json_obj}\", :retry=>true)\n end\n\n @id+=1 # increment the ID value for the API call\n\n # check return code and throw exception for error checking\n resp = JSON.parse(response.body) #parse the JSON Object so we can use it\n if !resp[\"error\"].nil?\n errcode=resp[\"error\"][\"code\"].to_i\n case errcode\n when -32602 then\n raise ZbxAPI_ExceptionLoginPermission.new(resp[\"error\"],:error_code=>errcode,:retry=>true)\n when -32500 then\n raise ZbxAPI_ExceptionPermissionError.new(resp[\"error\"],:error_code=>errcode,:retry=>true)\n else\n puts \"other error\"\n raise ZbxAPI_GeneralError, resp[\"error\"]\n end\n end\n\n\t\t return resp\n\n\t\trescue Redirect\n\t\t redirects+=1\n\t\t\tretry if redirects<=5\n\t\t\traise ZbxAPI_GeneralError, \"Too many redirects\"\n rescue NoMethodError\n raise ZbxAPI_GeneralError.new(\"Unable to connect to #{@url.host}: \\\"#{e}\\\"\", :retry=>false)\n end\n end", "title": "" }, { "docid": "f49e521fa5630da32a8950a6e597d507", "score": "0.50250775", "text": "def http_call(payload)\n response =\n log_http_call(payload) do\n http = payload[:http] || create_http_connection(payload[:uri])\n http.start do |session|\n if payload[:method] == :get\n session.get(payload[:uri].request_uri, payload[:header])\n else\n session.send(payload[:method], payload[:uri].request_uri, payload[:body], payload[:header])\n end\n end\n end\n handle_response(response)\n end", "title": "" }, { "docid": "f981d31a49992bf48e11f42f8f660d29", "score": "0.50140536", "text": "def execute(http_method, path, request_body = {})\n Connection.send(http_method, path, :body => request_body)\n end", "title": "" }, { "docid": "cfd17ea011616a19de006ae75e79ff22", "score": "0.5005632", "text": "def call(request)\n\t\t\t\t\t\traise ::Protocol::HTTP2::Error, \"Connection closed!\" if self.closed?\n\t\t\t\t\t\t\n\t\t\t\t\t\t@count += 1\n\t\t\t\t\t\t\n\t\t\t\t\t\tresponse = create_response\n\t\t\t\t\t\tresponse.send_request(request)\n\t\t\t\t\t\tresponse.wait\n\t\t\t\t\t\t\n\t\t\t\t\t\treturn response\n\t\t\t\t\tend", "title": "" }, { "docid": "b604bcdc73ee46ce9bdf09119e13879d", "score": "0.5002761", "text": "def do_the_get_call(args)\n\tputs \"----- GET: #{args[:url]} -----\"\n\tc = Curl::Easy.new(args[:url]) do |curl|\n\t\tcurl.http_auth_types = :basic\n\t\tcurl.username = args[:user]\n\tend\n\tc.perform\n\tc.body_str\nend", "title": "" }, { "docid": "224d409cda9207f26a4306413908c0b0", "score": "0.50013715", "text": "def download_with_curl(url, path)\n result = exec(\"curl -o #{path} -f #{url}\")\n if result.success?\n logger.success(\"download #{url} -> #{path} (curl)\")\n true\n else\n logger.warn(\"failed: download #{url} -> #{path} (curl)\")\n false\n end\n end", "title": "" }, { "docid": "9e56dd2b58713644780a3c8ce3676a74", "score": "0.49871504", "text": "def exec_request\n @urls.map { |url| fetch(url) }\n end", "title": "" }, { "docid": "6155c79b0f787094e354f73b49ca3e68", "score": "0.4984078", "text": "def curl_subscribe!\n Helpers.thread { curl_subscribe }\n rescue => e\n Helpers.before_retry(e)\n retry\n end", "title": "" }, { "docid": "d1d035451e7b37f8bdae391185242ddc", "score": "0.49831656", "text": "def execute\n uri = request_uri\n http = Net::HTTP.new(uri.host, uri.port)\n request = Net::HTTP::Get.new(uri.request_uri)\n retries = Europeana.max_retries\n \n begin\n response = http.request(request)\n rescue Timeout::Error, Errno::ECONNREFUSED, EOFError\n retries -= 1\n raise unless retries > 0\n sleep Europeana.retry_delay\n retry\n end\n \n json = JSON.parse(response.body)\n raise Errors::RequestError, json['error'] unless json['success']\n json\n rescue JSON::ParserError\n raise Errors::ResponseError\n end", "title": "" }, { "docid": "dfed18bb0f112a1c9da1bd491ac6d844", "score": "0.49819237", "text": "def execute(parameters={})\n parameters = parameters.clone\n prepare(parameters)\n \n # TODO: abstract the kind of http client we're using\n # TODO: ensure we have some kind of timeout handling\n url = URI.parse(create_url(parameters))\n\n puts \"Calling: #{url.to_s}\"\n puts \" parameters: #{parameters.inspect}\"\n response = nil\n\n # add multipart parameters\n if self.class.multipart\n post_data = parameters\n self.class.multipart.each do |param|\n if parameters[param]\n file_path = parameters.delete(param)\n post_data[param] = File.new(file_path)\n end\n end\n\n response = RestClient.post(url.to_s, post_data).to_str\n else\n response = Net::HTTP.post_form(url, parameters).body\n end\n\n begin\n return JSON.parse(response)\n rescue JSON::ParserError => e\n # it's most likely that the request was invalid and the server has\n # sent back an error page full of html\n # just return nil\n end\n end", "title": "" }, { "docid": "8bb723e021989e98dea7e9971ad88a24", "score": "0.49790668", "text": "def verbose_with_curl(index)\n be_verbose(index)\n puts(\"\\n simulate this call with: \\\"curl TODO\\\"\")\n end", "title": "" }, { "docid": "ff65b85d2adad07177e28012b5d5d0fa", "score": "0.49763423", "text": "def call(method, *args)\n return send_request(method, args)\n end", "title": "" }, { "docid": "6591bb87e2ccd7ae7063ee95a452fd02", "score": "0.4972817", "text": "def execute_request(request:, payload:, api_config:)\n http_request = HTTPI::Request.new(request.url.try(:to_s))\n http_request.body = payload\n\n if api_config[:http_basic_username] && api_config[:http_basic_password]\n http_request.auth.basic(api_config[:http_basic_username], api_config[:http_basic_password])\n end\n\n http_request.auth.ssl.verify_mode = api_config[:ssl_verify_mode] || :peer\n http_request.open_timeout = api_config[:timeout] || 30\n http_request.read_timeout = api_config[:timeout] || 30\n\n if block_given?\n http_request = yield http_request\n end\n\n request.http_request = http_request\n\n begin\n response = HTTPI.request(request.action.http_method, http_request)\n request.http_response = response\n rescue => e\n raise RequestError.new(e, request)\n end\n\n if response.error?\n raise RequestError.new(\"#{request.action.http_method} #{request.url} returned #{response.code}\", request)\n end\n\n request\n end", "title": "" }, { "docid": "cb5c6c1ba26076df337ed02198fdd34b", "score": "0.49670914", "text": "def make_request(call, url)\n request = Net::HTTP.new(url.host, url.port)\n request.read_timeout = 30\n request.use_ssl = true\n\n response = request.start { |http| http.request(call) }\n JSON.parse(response.body)\n end", "title": "" }, { "docid": "da21fb1ed2d31c78ff9d4daf6f62cbd5", "score": "0.49581507", "text": "def download(url, dest, username=nil, password=nil, max_retries=DEFAULT_MAX_DOWNLOAD_RETRIES)\n @errors = []\n retry_count = error_code = 0\n success = false\n reset_wait_time_span\n\n @errors << 'curl is not installed' unless @found_curl\n\n @errors << \"destination file '#{dest}' is a directory\" if File.directory?(dest)\n begin\n FileUtils.mkdir_p(File.dirname(dest)) unless File.directory?(File.dirname(dest))\n rescue Exception => e\n @errors << e.message\n end\n\n return false unless @errors.empty?\n\n # format curl command and redirect stderr away.\n #\n # note: ensure we use double-quotes (\") to surround arguments on command\n # line because single-quotes (') are literals in windows.\n platform = RightScale::Platform\n user_opt = username && password ? \"--user \\\"#{username}:#{password}\\\"\" : \"\"\n dest = platform.filesystem.long_path_to_short_path(dest)\n cmd = \"curl --fail --silent --show-error --insecure --location --connect-timeout 300 --max-time 3600 --write-out \\\"%{http_code} %{size_download} %{speed_download}\\\" #{user_opt} --output \\\"#{dest}\\\" \\\"#{url}\\\"\"\n cmd = platform.shell.format_redirect_stderr(cmd)\n begin\n out = `#{cmd}`\n out = out.split\n success = $?.success? && out.size == 3\n if success\n @size = out[1].to_i\n @speed = out[2].to_i\n @last_url = url\n return true\n else\n retry_count += 1\n error_code = out[0].to_i\n yield error_code if block_given?\n sleep wait_time_span\n end\n end until success || retry_count >= max_retries\n unless success\n @errors << \"#{retry_count} download attempts failed, last HTTP response code was #{error_code}\"\n return false\n end\n true\n end", "title": "" }, { "docid": "53754485410cbcf7eac4c49547024eb9", "score": "0.49533525", "text": "def post_connect(uri, response, body_io); end", "title": "" }, { "docid": "e5d087b1c7bcb89bc44b16d237cd668e", "score": "0.49336067", "text": "def exec_post(req, data, exit_on_fail = false)\n response_hash = exec_api_call('POST', req, data, exit_on_fail)\n response_hash[:response]\n end", "title": "" }, { "docid": "12252d48e852dede48e90f797c3e0322", "score": "0.49334157", "text": "def api_call_method(kt_api_url, version, api_key, secret_key, api_func, arg_assoc_hash)\n\n socket = Socket.new(AF_INET, SOCK_STREAM, 0)\n sockaddr = Socket.sockaddr_in(@m_port, @m_ip)\n \n connected = true\n\n #puts Benchmark.measure{\n begin\n socket.connect_nonblock(sockaddr)\n rescue Errno::EINPROGRESS\n IO.select(nil, [socket])\n begin\n socket.connect_nonblock(sockaddr)\n rescue Errno::EISCONN\n connected = false\n #puts \"Errno::EISCONN!!\"\n end\n end\n #}\n \n if connected\n url_path = get_call_url(kt_api_url, version, api_key, secret_key, api_func, arg_assoc_hash)\n\n buf = \"GET \" + url_path + \" HTTP/1.1\\r\\n\"\n buf << \"Host:\" + @m_ip + \":\" + @m_port.to_s + \"\\r\\n\"\n buf << \"Content-type: application/x-www-form-urlencoded\\r\\n\"\n buf << \"Accept: */*\\r\\n\"\n buf << \"\\r\\n\"\n buf << \"\\r\\n\"\n \n socket.write_nonblock buf\n end\n socket.close\n \n return connected\n end", "title": "" }, { "docid": "264cd11a8b7f0a74eadac9dea735c882", "score": "0.49309132", "text": "def test_exec()\n\t\ttempfile = Tempfile.new('sampleexec', './')\n\t\twrite_sampleexec(tempfile)\n\t\ttempfile.close(false)\n\t\tFileUtils.chmod(0700, tempfile.path)\n\n\t\t# test via direct call\n\t\toutput = Cfruby::Exec::exec(tempfile.path)\n\t\tassert_equal(output.length, 2)\n\t\tassert_equal(10, output[0].length, \"expected 10 lines of stdout\")\n\t\tassert_equal(10, output[1].length, \"expected 10 lines of stderr\")\n\n\t\t# test via the String exec() helper method\n\t\ttempfile.path.exec\n\t\tassert_equal(output.length, 2)\n\t\tassert_equal(10, output[0].length, \"expected 10 lines of stdout\")\n\t\tassert_equal(10, output[1].length, \"expected 10 lines of stderr\")\t\t\n\tend", "title": "" }, { "docid": "b03ed68e49d66a522ae2e309061bcfd8", "score": "0.49183798", "text": "def get_request_via_curl( server_url, request_url, user_email = '', user_token = '' )\n system(\n \"curl -i \" <<\n \"-H \\\"X-User-Email: #{user_email}\\\" -H \\\"X-User-Token: #{user_token}\\\" \" <<\n \"-# http://#{server_url}#{request_url} > /dev/null\"\n )\n end", "title": "" }, { "docid": "8b049025697f3f81928d14ee9982355d", "score": "0.49117774", "text": "def execute_request(method, url, opts = {})\n server.execute_request(\n method,\n [name, url.sub(/^\\//, '')].join('/'),\n opts.merge(username: username, password: password))\n end", "title": "" }, { "docid": "a33cfc59a09d1adc3f372d4389a3ad1a", "score": "0.49098563", "text": "def call(env)\n # catch(:halt) do\n # r = @_request\n # r.block_result(instance_exec(r, &block))\n # @_response.finish\n # end\n [200, { \"Content-Type\": \"text/plain\" }, \"Helo\"]\n end", "title": "" }, { "docid": "1b47932483ea13fb34764c338bb5aa6b", "score": "0.4907885", "text": "def use_curl?\n o = @config[ :curl ]\n if o\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "a66b79ccff23ce1cdca7f2dd707d4e1e", "score": "0.4907565", "text": "def doCurl(method,path,params)\n # api constants\n domain = 'api.centralindex.com'\n endpoint = '/v1'\n path = endpoint+path\n params['api_key'] = @apiKey\n retval = ''\n\n # create an HTTP connection\n http = Net::HTTP.new(domain) \n if @debugMode\n http.set_debug_output $stderr\n end\n\n if(method == 'get') \n # crazy dance to get urlencode parameters from Ruby\n request = Net::HTTP::Get.new(path) \n request.set_form_data( params, sep = '&' )\n request = Net::HTTP::Get.new( path+ '?' + request.body )\n retval = http.request(request)\n end\n if(method == 'post')\n request = Net::HTTP::Post.new(path)\n request.set_form_data(params)\n retval = http.request(request)\n end\n if(method == 'put')\n request = Net::HTTP::Put.new(path)\n request.set_form_data(params)\n retval = http.request(request)\n end\n if(method == 'delete')\n request = Net::HTTP::Put.new(path)\n request.set_form_data(params)\n retval = http.request(request)\n end\n parsed = JSON.parse(retval.body)\n if(parsed)\n return parsed\n else\n return retval.body\n end\n end", "title": "" }, { "docid": "8f36157e043c666dd922de85b5a3d61e", "score": "0.4898989", "text": "def execute\n response = send_request\n response.body.to_s\n rescue HTTP::Redirector::TooManyRedirectsError\n raise ProxyFetcher::Exceptions::MaximumRedirectsReached\n end", "title": "" }, { "docid": "eb1fa845ca44fa864b80ddc3727409a7", "score": "0.48957103", "text": "def postToolsCurl( method, path, filedata, email)\n params = Hash.new\n params['method'] = method\n params['path'] = path\n params['filedata'] = filedata\n params['email'] = email\n return doCurl(\"post\",\"/tools/curl\",params)\n end", "title": "" }, { "docid": "ba66d5945252ade91b5add8e090d490c", "score": "0.48860225", "text": "def execute(url_chunk, options = {})\n options = (@options[:request] || {}).merge(options)\n Request.new(self, url_chunk, options).execute\n end", "title": "" }, { "docid": "5dc8a1b381f3f901f9f69b82fb23ef91", "score": "0.48668632", "text": "def execute_manual_request\n http_method = params[:http_method]\n path = params[:path]\n headers = params[:headers]\n body = params[:body]\n params.each do |key, value|\n if key.start_with?(\"replace_\") && !key.end_with?(\"_by\")\n path.gsub!(\"XXX#{value}XXX\",params[key + \"_by\"]) if params[key + \"_by\"] != \"\"\n headers.gsub!(\"XXX#{value}XXX\",params[key + \"_by\"]) if params[key + \"_by\"] != \"\"\n body.gsub!(\"XXX#{value}XXX\",params[key + \"_by\"]) if params[key + \"_by\"] != \"\"\n end\n end\n if params[:task_id]\n @task = Task.find(params[:task_id])\n @regexpressions = @task.regexpressions\n end\n begin\n if @cloud\n if @cloud.api == \"Atmos\"\n @response, @headers, @url = atmos_request(http_method, path, headers, body)\n elsif @cloud.api == \"Amazon\"\n @response, @headers, @url = amazon_request(http_method, path, headers, body)\n elsif @cloud.api == \"Swift\"\n @response, @headers, @url = swift_request(http_method, path, headers, body)\n end\n else\n url = path\n uri = URI.parse(url)\n headers_to_send = Hash.new\n headers.split(\"\\n\").each do |row|\n hash = eval(row)\n headers_to_send[hash.keys.first.downcase] = hash.values.first.to_s\n end\n if params[:user] != \"\" && params[:password] != \"\"\n login = Base64.urlsafe_encode64(\"#{params[:user]}:#{params[:password]}\")\n headers_to_send[\"Authorization\"] = \"Basic #{login}\"\n end\n @response = http_request(url, uri.port, http_method, headers_to_send, body)\n @headers = headers_to_send\n end\n rescue Exception => e\n @exception = e\n end\n respond_to do |format|\n format.js { render 'shared/execute_manual_request' }\n end\n end", "title": "" }, { "docid": "06618ed2242b96e546bfaf49240e8658", "score": "0.4860851", "text": "def process(request, response)\n indirection, method, key, params = uri2indirection(http_method(request), path(request), params(request))\n\n check_authorization(indirection, method, key, params)\n\n send(\"do_#{method}\", indirection, key, params, request, response)\n rescue SystemExit,NoMemoryError\n raise\n rescue Exception => e\n return do_exception(response, e)\n end", "title": "" }, { "docid": "ba4e8044fc0856e96f00fd298bb3f8d6", "score": "0.48547694", "text": "def remote_call(url_params: {}, params: {})\n endpoint = sprintf(\"#{VERSION}/#{path}\", url_params)\n\n endpoint += authentication.to_query(endpoint)\n if method == :get\n response = client.get(endpoint, params, HEADERS)\n elsif method == :post\n response = client.post(endpoint, json_encode(params), {'Content-Type' => 'application/json'}.merge!(HEADERS))\n end\n\n if response.success?\n Result.new(response.value.body)\n else\n response\n end\n end", "title": "" }, { "docid": "a7eeb66f0f55868a679cd81ca5a337c3", "score": "0.48517135", "text": "def execute_rest(rest_url, params)\n log(:info, \"Running execute_rest...\")\n\n # log the parameters we are using for the rest call\n log(:info, \"Inspecting REST params: #{params.inspect}\") if @debug == true\n\n # execute the rest call and inspect the response\n rest_response = RestClient::Request.new(params).execute\n\n # convert the rest_response into a usable hash\n rest_hash = parse_response(rest_response)\n log(:info, \"Finished running execute_rest...\")\n return rest_hash\n end", "title": "" }, { "docid": "d295dd48cc97ef10ddaddc5f9bccd3e0", "score": "0.48419052", "text": "def perform\n args = {\n :method => method,\n :url => url,\n :headers => headers,\n :timeout => 120,\n :open_timeout => 30\n }\n args[:payload] = payload.to_json if payload\n\n Response.new RestClient::Request.execute(args)\n rescue RestClient::Exception => e\n response = e.response\n\n if e.is_a?(RestClient::RequestTimeout)\n response = JSON.generate({:error => {:cause => 'REQUEST_TIMEDOUT'}})\n end\n\n ErrorResponse.new response\n end", "title": "" } ]
1f328d5ecf93e1b28b717fac90f8e197
WORKSPACE PROPERTIES > Number of slots
[ { "docid": "3fe98582ebf3e3273d8c454f44737f81", "score": "0.64502513", "text": "def capacity\n\t\t@slots.length\n\tend", "title": "" } ]
[ { "docid": "0b041d82523193db5ba84cce529104e8", "score": "0.6466804", "text": "def number_of_slots\n @number_of_slots ||= placements.size\n end", "title": "" }, { "docid": "99000855555955d0cc502ed6f42e28e6", "score": "0.6447161", "text": "def slots_used\n @jobs_run.list.size - 1 \n end", "title": "" }, { "docid": "648756dedc19cc4c212f4ac020de54d2", "score": "0.614049", "text": "def length\n @slots.length\n end", "title": "" }, { "docid": "fe067727569e1af05bce5b953bb4b85d", "score": "0.6093869", "text": "def capacity; end", "title": "" }, { "docid": "fe067727569e1af05bce5b953bb4b85d", "score": "0.60933805", "text": "def capacity; end", "title": "" }, { "docid": "fb5d0921e841ed60bd6265fd33235fd6", "score": "0.60899895", "text": "def prepared_nodes_count\n Bebox::Node.list(self.project_root, self.environment, 'phase-1').count\n end", "title": "" }, { "docid": "e43416f91eaf047c0bf01500596fc8d9", "score": "0.6021574", "text": "def number_of_slots_filled\n @number_of_slots_filled ||= placements.filled.size\n end", "title": "" }, { "docid": "42a4779bc9a9b322677a7f1e33d4b0f5", "score": "0.5966335", "text": "def capacity\n end", "title": "" }, { "docid": "f03ff588ee4e7dd43e42704027107685", "score": "0.59407717", "text": "def number_of_slots_unallocated\n @number_of_slots_unallocated ||= placements.unallocated.size\n end", "title": "" }, { "docid": "8b14163f240f05841daa6a734f45912a", "score": "0.5815942", "text": "def allocation_size=(value); end", "title": "" }, { "docid": "8c26a9148307c07c6886cd6e208eed68", "score": "0.5780578", "text": "def number_of_tiles_needed\n return 7-self.tiles.length\n end", "title": "" }, { "docid": "aeea34a14aca6477b3b9e7062952cee3", "score": "0.5768425", "text": "def slots_free\n @jobs_max - slots_used\n end", "title": "" }, { "docid": "ddbc9e435ba1f7970817633ccbfea12d", "score": "0.5718703", "text": "def getNofInitParamSet()\n return (getConf(:nofInitParamSet) ||\n 2 * @host.maxJobN()) ;\n end", "title": "" }, { "docid": "4dd95c2ba74c14c152b61dc7c289182d", "score": "0.57108754", "text": "def build8192\n slot(2) { num8192 }\nend", "title": "" }, { "docid": "1eb2ba7d532ed9b00bb8eeb755e52cae", "score": "0.56738836", "text": "def size_range; end", "title": "" }, { "docid": "1eb2ba7d532ed9b00bb8eeb755e52cae", "score": "0.56738836", "text": "def size_range; end", "title": "" }, { "docid": "7713134440932e6fd70d25515ce18668", "score": "0.56711566", "text": "def open_slot_count\n return @open_slot_count\n end", "title": "" }, { "docid": "ceeb89b9084b2d3ca234137785f02fe4", "score": "0.56611544", "text": "def parts_per_progress_bar_slot\n return 1 if self.experiment_size <= 0\n\n part_width = CANVAS_WIDTH / self.experiment_size\n [(MINIMUM_SLOT_WIDTH / part_width).ceil, 1].max\n end", "title": "" }, { "docid": "fa77d94f9412e2ebc4b8e3a6c2982926", "score": "0.5655824", "text": "def length\n (@client.redis.multi do\n @client.redis.zcard(\"ql:q:#{@name}-locks\")\n @client.redis.zcard(\"ql:q:#{@name}-work\")\n @client.redis.zcard(\"ql:q:#{@name}-scheduled\")\n end).inject(0, :+)\n end", "title": "" }, { "docid": "85f3d86ee9a393b7386342209ccd5032", "score": "0.5642896", "text": "def create_parking_slots\n slots = {}\n @capacity.times do |slot_number|\n slots[slot_number + 1] = ParkingSlot.new(slot_number + 1) # to avoid slot number starting from zero.\n end\n slots\n end", "title": "" }, { "docid": "0577633f0c6c0985fa8841b71bb73af9", "score": "0.56302106", "text": "def remaining_capacity; end", "title": "" }, { "docid": "0577633f0c6c0985fa8841b71bb73af9", "score": "0.56302106", "text": "def remaining_capacity; end", "title": "" }, { "docid": "0a49371af90f11cdb9a995a97d190aa5", "score": "0.56276244", "text": "def no_of_nodes\n @size\n end", "title": "" }, { "docid": "012034b6acdc75ead6abb55bf33e86be", "score": "0.5610669", "text": "def size=(dimension); end", "title": "" }, { "docid": "fad4ad52c2aaed8626f0d45b1ed6520d", "score": "0.5604612", "text": "def allocate_workspaces\n r.gen_each_arg do |n, t|\n if r.workspace_argument? n\n n = n.downcase\n factor = workspace_size_factor(t)\n \" l#{n} = (int) #{n}[0]; #{n} = new #{t.to_java[0..-3]}[l#{n}#{factor}];\"\n end\n end\n end", "title": "" }, { "docid": "8f930729fa63b9ad9f41bb24d0dabd1e", "score": "0.5565712", "text": "def number_of_rm_properties\n rm_properties.size\n end", "title": "" }, { "docid": "b1f09d6a8d5cb045a78df38ed599291d", "score": "0.55578333", "text": "def total_allocations; end", "title": "" }, { "docid": "7f55bb73a65ed2ff8d032e86bf297bbf", "score": "0.5553171", "text": "def number_of_slots=(number)\n number = number.to_i\n return if number == number_of_slots\n if number > number_of_slots\n (number - number_of_slots).times { |i| placements.build }\n else\n (number_of_slots - number).times do\n placements.find(:all, :conditions => \"person_id IS NULL OR person_id = 0\").pop.destroy rescue nil\n end\n end\n end", "title": "" }, { "docid": "8be5ff7f343417105ad964cd4c6ef2b7", "score": "0.5541762", "text": "def size\n\t\treturn 3\n\tend", "title": "" }, { "docid": "06375065cc126632cbf4d6808b038702", "score": "0.55340856", "text": "def nitems\n end", "title": "" }, { "docid": "be77ba55ec025e9eb36f6bef289b54e0", "score": "0.55337274", "text": "def open_slots\n slots - subscriptions.size\n end", "title": "" }, { "docid": "504f959577ab3d25786980c48c6fa107", "score": "0.553007", "text": "def target_num_containers() ; info[:target_num_containers] ; end", "title": "" }, { "docid": "5f14c02ea6e9ce5fc757e3bf13ce2320", "score": "0.55206144", "text": "def action_queue_size\n\t\t\t# bd_size = village.buildings.find(:type => Building.hashes[:residential], :status => Building::STATUS[:finished]).size\n\t\t\t# self.tech_worker_number * bd_size\n\t\t\t4\n\t\tend", "title": "" }, { "docid": "21e4f0235363c26ae55912cfbe7213e6", "score": "0.55173844", "text": "def active_slots\n slots(true)\n end", "title": "" }, { "docid": "8b351733b4ce42e5c8d6c31aff9b0e35", "score": "0.5516727", "text": "def count_cells\n @current_state.size\n end", "title": "" }, { "docid": "5a18f7187eece4b09c9d900c422c6368", "score": "0.5503392", "text": "def count_ideal_replicas_not_ready\n get_ideal_replicas_not_ready().size\n end", "title": "" }, { "docid": "045ad32253d78b84733e35e627018501", "score": "0.55023456", "text": "def capacity \n @capacity\n end", "title": "" }, { "docid": "04e9f46a05baa767fb2889041aaca0b1", "score": "0.54947007", "text": "def size\n variables.size\n end", "title": "" }, { "docid": "a6db50fb442ef18f6a2dfb0a86a5debb", "score": "0.5489388", "text": "def size\n variables.size\n end", "title": "" }, { "docid": "a6db50fb442ef18f6a2dfb0a86a5debb", "score": "0.5489388", "text": "def size\n variables.size\n end", "title": "" }, { "docid": "ab7930a219a7b52ade3e9c932629f522", "score": "0.5479216", "text": "def num_buckets\n @store.length\n end", "title": "" }, { "docid": "ab7930a219a7b52ade3e9c932629f522", "score": "0.5479216", "text": "def num_buckets\n @store.length\n end", "title": "" }, { "docid": "ab7930a219a7b52ade3e9c932629f522", "score": "0.5479216", "text": "def num_buckets\n @store.length\n end", "title": "" }, { "docid": "ab7930a219a7b52ade3e9c932629f522", "score": "0.5479216", "text": "def num_buckets\n @store.length\n end", "title": "" }, { "docid": "ab7930a219a7b52ade3e9c932629f522", "score": "0.5479216", "text": "def num_buckets\n @store.length\n end", "title": "" }, { "docid": "ab7930a219a7b52ade3e9c932629f522", "score": "0.5479216", "text": "def num_buckets\n @store.length\n end", "title": "" }, { "docid": "ab7930a219a7b52ade3e9c932629f522", "score": "0.5479216", "text": "def num_buckets\n @store.length\n end", "title": "" }, { "docid": "ab7930a219a7b52ade3e9c932629f522", "score": "0.5479216", "text": "def num_buckets\n @store.length\n end", "title": "" }, { "docid": "ab7930a219a7b52ade3e9c932629f522", "score": "0.5479216", "text": "def num_buckets\n @store.length\n end", "title": "" }, { "docid": "ab7930a219a7b52ade3e9c932629f522", "score": "0.5479216", "text": "def num_buckets\n @store.length\n end", "title": "" }, { "docid": "dcbe2ce85fb4b1f4867474a5f8672869", "score": "0.5478945", "text": "def spaces_remaining\n self.capacity - self.registrations.size\n end", "title": "" }, { "docid": "64c1024abb7760a25f9fbc83ac11f5fa", "score": "0.5470498", "text": "def number_of_tj_properties\n tj.size\n end", "title": "" }, { "docid": "36137104fc5ab166873d79b27eb5e33e", "score": "0.54683715", "text": "def size\n @movement[:waypoints][:next].size\n end", "title": "" }, { "docid": "7b1efd45009fe64cacde420876d7b6d7", "score": "0.5466321", "text": "def length\n return 1 unless @next_slot\n 1 + @next_slot.length\n end", "title": "" }, { "docid": "2213967a945aab39727a6de2811d0c52", "score": "0.54502636", "text": "def all_slots\n slots(false)\n end", "title": "" }, { "docid": "e13bf00199bc7adfe7763c7310dc63a5", "score": "0.54476005", "text": "def size\n @atoms.length \n end", "title": "" }, { "docid": "e4e589e696766ace2a2bac579191e431", "score": "0.54417664", "text": "def replicas; end", "title": "" }, { "docid": "db959861994d81fcfaacb328d7f84563", "score": "0.54391694", "text": "def capacity\n @capacity\n end", "title": "" }, { "docid": "46012c0c6aa191e01cdfa5f2ddf50244", "score": "0.5430735", "text": "def count_used_instances\n end", "title": "" }, { "docid": "83b5d8808ab957734cac9be9e250f245", "score": "0.543006", "text": "def test_provisions_4\n # Assignment of multiple tasks per host - fitting exactly to its capacity\n assert_nothing_raised do\n @sim.scheduler_config['allow_evictions'] = false\n @sim.input_file = 'inputs/provisions4.csv'\n @sim.run\n\n set_expected_count_values([1, 2, 7, 1, 1, 2, 2, 0, 1, 0, 30])\n get_sim_count_values(\"sc1\", \"yellowhammer\")\n assert_count_values\n end\n end", "title": "" }, { "docid": "303edd3d0747f16d2b32f2ec8c794f34", "score": "0.5425904", "text": "def length()\n count=0\n self.each(:node){ |resource|\n count+=1\n }\n return count\n end", "title": "" }, { "docid": "9610feb45d9569c1a5eaf601e5a30091", "score": "0.5424365", "text": "def current_size; end", "title": "" }, { "docid": "668bde76ac08150aed527125daa5b106", "score": "0.5420881", "text": "def spots_remaining\n\t\tcapacity - registrations.size\n\tend", "title": "" }, { "docid": "02316ff0783d86df6bdeed2b2b196ed3", "score": "0.5417666", "text": "def entry_count\n @capacity\n end", "title": "" }, { "docid": "9771016a22004f3f01197f08ff529cf7", "score": "0.5417163", "text": "def num_buckets\n @num_buckets\n end", "title": "" }, { "docid": "9771016a22004f3f01197f08ff529cf7", "score": "0.5417163", "text": "def num_buckets\n @num_buckets\n end", "title": "" }, { "docid": "f1d76f4c19f330f525cd7a12a7d871b9", "score": "0.5412697", "text": "def pool_capacity; end", "title": "" }, { "docid": "2033c64fa98f79e770b9ad6ae9e345fc", "score": "0.5410828", "text": "def number_of_partner_properties\n partner_properties.size\n end", "title": "" }, { "docid": "763473a067347cc46efa50e7c30543cb", "score": "0.54048014", "text": "def slot; end", "title": "" }, { "docid": "763473a067347cc46efa50e7c30543cb", "score": "0.54048014", "text": "def slot; end", "title": "" }, { "docid": "a5ff507828053c0410d68e4566cba531", "score": "0.5402171", "text": "def open_slot_count=(value)\n @open_slot_count = value\n end", "title": "" }, { "docid": "76fdefce71adc9ef202dcb0edc8f110e", "score": "0.5401696", "text": "def available_slots \n return capacity - Registration.for_event(id).size\n end", "title": "" }, { "docid": "9aa2fefb724c340f6a51e911a3d5e3d0", "score": "0.54015064", "text": "def variable_count\n variables.keys.length\n end", "title": "" }, { "docid": "f0a8b6f27bb77d8539512c3ec5ce9fcf", "score": "0.5397077", "text": "def capacity=(value); end", "title": "" }, { "docid": "20c6936b2ecab63f03729e2d0086d431", "score": "0.5396268", "text": "def n_partitions\n raise(\"NICs without 10Gb ports cannot be partitioned\") unless n_10gb_ports > 0\n\n if n_10gb_ports == 2 && n_ports == 2\n 4\n else\n 2\n end\n end", "title": "" }, { "docid": "f5841363f8706495022a104b63528db7", "score": "0.5395456", "text": "def node_count\n @hoNodes.size\n end", "title": "" }, { "docid": "d374baba95a74e7175bfc754a1a82be2", "score": "0.5388621", "text": "def generate_tabling_slots(assignments)\n p 'destroying all tabling slots'\n TablingSlot.destroy_all\n p 'creating new tabling slots'\n assignments.keys.each do |time|\n ts = TablingSlot.new\n ts.time = time\n ts.member_ids = assignments[time].map {|x| x.id}\n p ts.time\n p ts.member_ids\n ts.save\n end\n\n p 'there are now ' + TablingSlot.all.length.to_s + ' slots'\nend", "title": "" }, { "docid": "2aff791f97671b13d68063481ceafb3f", "score": "0.53848493", "text": "def burst_size\n super\n end", "title": "" }, { "docid": "7c9118bf1e38982c1d7d2636d9a9b3c5", "score": "0.5378742", "text": "def step_size\n return @size\n end", "title": "" }, { "docid": "73a4031e736225d62840cbdd9fea7618", "score": "0.53783923", "text": "def directory_slots\n page_header[:n_heap] - 2\n end", "title": "" }, { "docid": "87ad4709e59244d49c8b1b790dd46446", "score": "0.53772515", "text": "def size\n @components.size\n end", "title": "" }, { "docid": "235f540d28601758c97eb709349e103b", "score": "0.53731674", "text": "def size\n Sidekiq.redis { |conn| conn.scard(\"processes\") }\n end", "title": "" }, { "docid": "0c05efbee2b4e03072c567f20cf1a87f", "score": "0.5361942", "text": "def variable_count\n variables.length\n end", "title": "" }, { "docid": "0c1f5422f19a95084c4276170440414c", "score": "0.5359049", "text": "def parts_count; end", "title": "" }, { "docid": "60679546a9031ef13833c8033730c072", "score": "0.535377", "text": "def property\n [ @vals[0].size, @vals.map{ |i| i.size }[1..@vals.size-1] ]\n end", "title": "" }, { "docid": "0ce3b1a8ce3500234ab76995ee5b8e59", "score": "0.535169", "text": "def find_parcel_slots(number)\n current_slot = 1\n $max_slots = number\n $parcel_slots << current_slot\n (number - 1).times do\n next_slot = (current_slot <= $max_slots/2) ? ($max_slots - current_slot + 1) : ($max_slots - current_slot + 2)\n $parcel_slots << next_slot\n current_slot = next_slot\n end\n end", "title": "" }, { "docid": "21c655d18e83593b9ec284e5b3476dad", "score": "0.53508806", "text": "def size=(value); end", "title": "" }, { "docid": "518139badbb1e50fce43bcb366eb9780", "score": "0.53474844", "text": "def number_of_properties\n self.instance_variables.count\n end", "title": "" }, { "docid": "b51b88823eeac9e3b6e3d8e3185b025a", "score": "0.53222674", "text": "def initialize_parking_list(max_slot)\n @parking_lot = max_slot.to_i\n @parking_list = {}\n\n @parking_lot.times.each do |index|\n @parking_list[index + 1] = ParkingList.new(\n registration_number: nil,\n colour: nil,\n status: 'free'\n )\n end\n\n puts \"Created a parking lot with #{@parking_lot} slots\\n\"\nend", "title": "" }, { "docid": "f055d70008c4ec5909425f045daca437", "score": "0.53135145", "text": "def number_of_nodes\n @cluster.number_of_nodes\n end", "title": "" }, { "docid": "a11621848da32dfd9e51f7d9f82a4eb3", "score": "0.53134847", "text": "def component_count\n count\n end", "title": "" }, { "docid": "40dbd5719f98765fde565fe60dd85549", "score": "0.5306873", "text": "def current_num_containers() ; info[:current_num_containers] ; end", "title": "" }, { "docid": "489fe9253c0051e7798d68a02d528b29", "score": "0.5305325", "text": "def number_of_rm_properties\n rm.size\n end", "title": "" }, { "docid": "53e65da2675e7daf68b8ad3cdcfd2482", "score": "0.5299974", "text": "def number_of_planets\n return get_size\n end", "title": "" }, { "docid": "d3ad8eddd4303ff326faa1bb0974c36b", "score": "0.52965885", "text": "def nofRunning()\n return @runningParamSetList.size ;\n end", "title": "" }, { "docid": "0bd474a2851625a35e7a4489b02ecd43", "score": "0.52905434", "text": "def number_of_new_nodes\n \t{'New Nodes Added' => aw.node_added_count }\n \tend", "title": "" }, { "docid": "7c5ac0df0b07a629efe8f8300a2328c6", "score": "0.52889276", "text": "def parameter_count\r\n end", "title": "" }, { "docid": "0ec1dcf67354c7b001f613be4dc0f0c0", "score": "0.5287031", "text": "def capacity\n @store.length\n end", "title": "" }, { "docid": "0ec1dcf67354c7b001f613be4dc0f0c0", "score": "0.5287031", "text": "def capacity\n @store.length\n end", "title": "" }, { "docid": "039b7f1eda90792b6fc22f17aeaf385d", "score": "0.5285645", "text": "def number_of_shards\n Elasticsearch::Model.client.cluster.\n health(index: 'opportunities_test')[\"active_shards\"]\n end", "title": "" } ]
1f53cfb68fc9296cdbf33649e2c9f09d
Get the current value for the specified attribute, if the attribute has changed.
[ { "docid": "9e4ad406fa2c84fe94c6443aca56e9ac", "score": "0.63974893", "text": "def attribute_change(attr)\n [changed_attributes[attr], attributes[attr]] if attribute_changed?(attr)\n end", "title": "" } ]
[ { "docid": "53bbced1bbf0ce6846415fd95d47594b", "score": "0.72612715", "text": "def attribute_previously_was(attr)\n attribute_previously_changed?(attr) ? attribute_previous_change(attr).first : attribute_was(attr)\n end", "title": "" }, { "docid": "631dc1d04024d47d9953b9450c51614d", "score": "0.7239485", "text": "def attribute_was(attr)\n attribute_changed?(attr) ? changed_attributes[attr] : __send__(attr)\n end", "title": "" }, { "docid": "631dc1d04024d47d9953b9450c51614d", "score": "0.7239485", "text": "def attribute_was(attr)\n attribute_changed?(attr) ? changed_attributes[attr] : __send__(attr)\n end", "title": "" }, { "docid": "631dc1d04024d47d9953b9450c51614d", "score": "0.7239485", "text": "def attribute_was(attr)\n attribute_changed?(attr) ? changed_attributes[attr] : __send__(attr)\n end", "title": "" }, { "docid": "7ac6b14f6d9c356e8f8333954cd7adc4", "score": "0.7109351", "text": "def attribute_was(attr) # :nodoc:\n attribute_changed?(attr) ? changed_attributes[attr] : __send__(attr)\n end", "title": "" }, { "docid": "f58a3f02cd2ba830417ec27f234dd9f6", "score": "0.69427073", "text": "def attribute_previously_was(attr)\n attr = database_field_name(attr)\n if previous_changes.key?(attr)\n previous_changes[attr].first\n else\n previous_attributes[attr]\n end\n end", "title": "" }, { "docid": "9654dc3078022572f00d10ab4ce64a02", "score": "0.69178504", "text": "def attribute_was(attr)\n attr = database_field_name(attr)\n attribute_changed?(attr) ? changed_attributes[attr] : attributes[attr]\n end", "title": "" }, { "docid": "ecdbd422ebb8fd614e24abcd7637b6a6", "score": "0.679879", "text": "def read_attribute_with_dirty(attr)\n case value = read_attribute_without_dirty(attr)\n when String\n value.freeze\n else\n value\n end\n end", "title": "" }, { "docid": "64cfc493ca5694db12a67560444d9580", "score": "0.67769164", "text": "def read_attribute_value()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "d1008057995d5948a759d11eb270e551", "score": "0.6749528", "text": "def attribute_will_change!(attr)\n changed_attributes[attr] = clone_attribute_value(:read_attribute, attr)\n end", "title": "" }, { "docid": "d1008057995d5948a759d11eb270e551", "score": "0.6749528", "text": "def attribute_will_change!(attr)\n changed_attributes[attr] = clone_attribute_value(:read_attribute, attr)\n end", "title": "" }, { "docid": "fd9ad5ae9957faf7ebbad84e39218a5e", "score": "0.67288166", "text": "def saved_change_to_attribute(attr)\n attr = database_field_name(attr)\n previous_changes[attr]\n end", "title": "" }, { "docid": "5c53b96da5573c163ba9c33377d62f16", "score": "0.6721841", "text": "def attribute_was(attribute)\n instance_variable_get(:\"@#{attribute}_was\")\n end", "title": "" }, { "docid": "a165afe53878e54736bf4dd268f42101", "score": "0.6717023", "text": "def attribute_delta_will_change!(attr, options = {})\n attribute_value = if self.class.delta_changes_options[:attributes].include?(attr)\n value = send(attr)\n value.duplicable? ? value.clone : value\n else\n options[:from] || clone_attribute_value(:read_attribute, attr)\n end\n delta_changed_attributes[attr] = attribute_value\n end", "title": "" }, { "docid": "69aa1ba3076df3567ec3c5dcf1abfb50", "score": "0.6665436", "text": "def attribute_was(name)\n change = modifications[name]\n change ? change[0] : attributes[name]\n end", "title": "" }, { "docid": "49c28170abb24f1dd42c7d5973eb6b23", "score": "0.66588783", "text": "def attribute_delta_was(attr)\n attribute_delta_changed?(attr) ? delta_changed_attributes[attr] : __send__(attr)\n end", "title": "" }, { "docid": "adddd6a8823b09938e198c0037703c12", "score": "0.66393536", "text": "def attribute_will_change!(attr)\n unless changed_attributes.include?(attr)\n value = read_attribute(attr)\n value = value.duplicable? ? value.clone : value\n changed_attributes[attr] = value\n end\n end", "title": "" }, { "docid": "451b091761fbaaeca3627e03ee100cfe", "score": "0.66074365", "text": "def attribute_will_change!(attr)\n return if attribute_changed?(attr)\n\n begin\n value = __send__(attr)\n value = value.duplicable? ? value.clone : value\n rescue TypeError, NoMethodError\n end\n\n set_attribute_was(attr, value)\n end", "title": "" }, { "docid": "9f253c25c24d2851fb22f30bf38efbb6", "score": "0.65890205", "text": "def get_value(attribute)\n send(attribute)\n end", "title": "" }, { "docid": "b9a0bccacca31212dba4d929fdb28859", "score": "0.658397", "text": "def attribute_value\n end", "title": "" }, { "docid": "98684b6c7272d95cdef2ddf2cb298ac1", "score": "0.6567036", "text": "def attribute_get(name)\n case @dirty[name]\n when true\n @attributes[:current][name]\n else\n case @attributes[:copied][name].equal?(NOT_SET)\n when true\n dup = if @attributes[:original][name].is_a?(Spira::Resource)\n @attributes[:original][name]\n else\n begin\n @attributes[:original][name].dup\n rescue TypeError\n @attributes[:original][name]\n end\n end\n @attributes[:copied][name] = dup\n when false\n @attributes[:copied][name]\n end\n end\n end", "title": "" }, { "docid": "8735efcf262d2b5cbd51d4a1a7938164", "score": "0.6547801", "text": "def change\n attributes.fetch(:change)\n end", "title": "" }, { "docid": "18909e3658ea8519b3875035fdc9b371", "score": "0.6527818", "text": "def attribute_will_change!(attr)\n return if attribute_changed?(attr)\n\n begin\n value = __send__(attr)\n value = value.duplicable? ? value.clone : value\n rescue TypeError, NoMethodError,ArgumentError\n end\n\n set_attribute_was(attr, value)\n end", "title": "" }, { "docid": "25879246cbcd5b4238f175d7f9baa189", "score": "0.65238595", "text": "def attribute_value\n end", "title": "" }, { "docid": "a0295d63b3c7c75a822e05ee295c8e8b", "score": "0.6485022", "text": "def attribute_will_change!(attr)\n return if changed_attributes.key?(attr)\n\n changed_attributes[attr] = read_raw_attribute(attr).__deep_copy__\n end", "title": "" }, { "docid": "92014e461a46389fa862d155ed6d1fb1", "score": "0.6477706", "text": "def attribute_change(attr)\n [changed_attributes[attr], __send__(attr)] if attribute_changed?(attr)\n end", "title": "" }, { "docid": "92014e461a46389fa862d155ed6d1fb1", "score": "0.6477706", "text": "def attribute_change(attr)\n [changed_attributes[attr], __send__(attr)] if attribute_changed?(attr)\n end", "title": "" }, { "docid": "92014e461a46389fa862d155ed6d1fb1", "score": "0.6477706", "text": "def attribute_change(attr)\n [changed_attributes[attr], __send__(attr)] if attribute_changed?(attr)\n end", "title": "" }, { "docid": "92014e461a46389fa862d155ed6d1fb1", "score": "0.6477706", "text": "def attribute_change(attr)\n [changed_attributes[attr], __send__(attr)] if attribute_changed?(attr)\n end", "title": "" }, { "docid": "102efe99cf01f5ef624534f6f7fc97dc", "score": "0.6471288", "text": "def attribute_did_change(attribute)\n return unless @attr_observers\n\n if handlers = @attr_observers[attribute]\n new_val = __send__(attribute) if respond_to?(attribute)\n handlers.each { |h| h.call new_val }\n end\n end", "title": "" }, { "docid": "4375aa2296edfeaccf534874b747e24c", "score": "0.6460906", "text": "def attribute_value(attribute_name)\r\n #puts attribute_name\r\n assert_exists()\r\n return_value = get_attribute_value(attribute_name)\r\n @@current_level = 0\r\n return return_value\r\n end", "title": "" }, { "docid": "1b15f9f34bf02cc73529880d3b0503de", "score": "0.6427055", "text": "def last_change_of(attribute)\n raise \"#{attribute} is not audited for model #{self.class}. Audited attributes: #{self.class.audited_attributes}\" unless self.class.audited_attributes.include? attribute.to_sym\n attribute = attribute.to_s # support symbol as well\n last = audits.size - 1\n last.downto(1) do |i|\n if audits[i].modifications[attribute] != audits[i-1].modifications[attribute]\n return audits[i].diff(audits[i-1])[attribute]\n end\n end\n nil\n end", "title": "" }, { "docid": "e54633a2a4bb8474861dc696862ce386", "score": "0.6418177", "text": "def will_change(attribute)\n changed << attribute\n instance_variable_set(:\"@#{attribute}_was\", send(attribute))\n end", "title": "" }, { "docid": "b498016149786b159471eff386ff6114", "score": "0.6375921", "text": "def set_attribute_was(attr, old_value)\n attributes_changed_by_setter[attr] = old_value\n end", "title": "" }, { "docid": "11229e24b0f7b329a5eaabd439791d29", "score": "0.6375352", "text": "def _attribute_changed(attr, current_value, new_value)\n @changed_attributes[attr] = new_value if current_value != new_value\n end", "title": "" }, { "docid": "233c3ab082386e825fddbc502ff8b549", "score": "0.63624567", "text": "def cached_value(issue, attr)\n if issue.is_a?(Integer)\n issue_id = issue\n else\n issue_id = issue.id\n end\n cache_change(issue_id) unless @changes[issue_id]\n case attr\n when :start_date\n @changes[issue_id][:start_date]\n when :due_date\n @changes[issue_id][:due_date] || @changes[issue_id][:start_date]\n end\n end", "title": "" }, { "docid": "dcf2634f40f0439fd82416f56055d5ce", "score": "0.63368064", "text": "def set_attribute_was(attr, old_value)\n attributes_changed_by_setter[attr] = old_value\n end", "title": "" }, { "docid": "a9c6cf6d4dc3d2de1509b5b5aa5ed9b5", "score": "0.63275737", "text": "def attribute_previous_change(attr)\n previous_changes[attr] if attribute_previously_changed?(attr)\n end", "title": "" }, { "docid": "22c0a6317af3b74c5e0a8dd70c16da82", "score": "0.63166106", "text": "def attrib_before_save(attrib)\n attrib = attrib.to_s\n\n # if id just changed from nil then we know the last save was actually a create\n # in this case we just return the current value\n # if the value didn't change, we also just return the current value\n if previous_changes['id'] && previous_changes['id'].first.nil? || !previous_changes.has_key?(attrib)\n send(attrib)\n\n # otherwise, we return the old value\n else\n previous_changes[attrib].first\n end\n end", "title": "" }, { "docid": "bdbc05ad1038d5de6faa46d8aad450db", "score": "0.6312529", "text": "def attribute_previous_change(attr)\n previous_changes[attr] if attribute_previously_changed?(attr)\n end", "title": "" }, { "docid": "96a52e2e0c1ce75c663832c8e985da33", "score": "0.6305696", "text": "def value\n attributes.fetch(:value)\n end", "title": "" }, { "docid": "96a52e2e0c1ce75c663832c8e985da33", "score": "0.6305696", "text": "def value\n attributes.fetch(:value)\n end", "title": "" }, { "docid": "cf5ef259333461b5b75012ea57ca4bb7", "score": "0.6276676", "text": "def atomic_attribute_status( attribute )\n\n return atomic_attributes[ attribute ]\n\n end", "title": "" }, { "docid": "f45db7fbc492da0a79c8136126659212", "score": "0.62456053", "text": "def attribute_change(attr)\n attr = database_field_name(attr)\n [ changed_attributes[attr], attributes[attr] ] if attribute_changed?(attr)\n end", "title": "" }, { "docid": "8390c5f6c418480d840c01dfe75b224d", "score": "0.62195593", "text": "def attribute=(attr, value)\n attr = attr.to_s\n\n # The attribute already had an unsaved change, so check if it is changing back to the original.\n if attribute_changed?(attr)\n old = @changed_attributes[attr]\n @changed_attributes.delete(attr) unless _field_changed?(attr, old, value)\n\n # No existing unsaved change, so simply remember this value if it differs from the original.\n else\n old = clone_attribute_value(:read_attribute, attr)\n @changed_attributes[attr] = old if _field_changed?(attr, old, value)\n end\n\n super(attr, value)\n end", "title": "" }, { "docid": "6190b3e53dba6885f5fbb09c6ed6a072", "score": "0.6219087", "text": "def write_attribute_with_dirty(attr, value)\n attr = attr.to_s\n \n # The attribute already has an unsaved change.\n unless changed_attributes.include?(attr)\n old = clone_attribute_value(:read_attribute, attr)\n \n # Remember the original value if it's different.\n typecasted = if column = column_for_attribute(attr)\n column.type_cast(value)\n else\n value\n end\n changed_attributes[attr] = old unless old == typecasted\n end\n \n # Carry on.\n write_attribute_without_dirty(attr, value)\n end", "title": "" }, { "docid": "71b8c2b38ba22c2ed13ce872b8218c8c", "score": "0.6193429", "text": "def attribute_change(attr)\n attr = database_field_name(attr)\n [changed_attributes[attr], attributes[attr]] if (attribute_changed?(attr) && !attr.nil?)\n end", "title": "" }, { "docid": "d6407af91828aab73410bb08cf52329e", "score": "0.6182704", "text": "def get_value(attribute)\n local_val = instance_variable_get(\"@#{attribute}\")\n local_val.nil? ? YieldStarClient.send(attribute) : local_val\n end", "title": "" }, { "docid": "d6407af91828aab73410bb08cf52329e", "score": "0.6182704", "text": "def get_value(attribute)\n local_val = instance_variable_get(\"@#{attribute}\")\n local_val.nil? ? YieldStarClient.send(attribute) : local_val\n end", "title": "" }, { "docid": "9fbf7517076cc5006ca9925831a776d7", "score": "0.6179037", "text": "def set_if_changed(attribute, new_value)\n variable_name = :\"@#{attribute}\"\n old_value = instance_variable_get(variable_name)\n\n if new_value != old_value\n instance_variable_set(variable_name, new_value)\n\n yield if block_given?\n end\n end", "title": "" }, { "docid": "acaa53c98566d53570ae26512474ffad", "score": "0.6161862", "text": "def attribute(attr)\n get_attribute(attr)\n end", "title": "" }, { "docid": "ad0aa4ed97207bc5da87a23f4db3dbfa", "score": "0.61564684", "text": "def attribute_value(attribute_name)\r\n assert_exists\r\n @element.get_attribute(attribute_name) || ''\r\n end", "title": "" }, { "docid": "88becfa6f1063aba531b7343f9a5e503", "score": "0.615375", "text": "def write_attribute_with_dirty(attr, value)\n attr = attr.to_s\n\n # The attribute already has an unsaved change.\n if changed_attributes.include?(attr)\n old = changed_attributes[attr]\n changed_attributes.delete(attr) unless field_changed?(attr, old, value)\n else\n old = clone_attribute_value(:read_attribute, attr)\n changed_attributes[attr] = old if field_changed?(attr, old, value)\n end\n\n # Carry on.\n write_attribute_without_dirty(attr, value)\n end", "title": "" }, { "docid": "b51f6653507f6290c36c679dffd83d70", "score": "0.6122401", "text": "def attribute_changed?(attribute)\n changed.include?(attribute)\n end", "title": "" }, { "docid": "e1dd23ac6b766e903cb454b05c2bd21c", "score": "0.6106201", "text": "def write_attribute(attr, value)\n attr = attr.to_s\n \n # The attribute already has an unsaved change.\n if changed_attributes.include?(attr)\n old = changed_attributes[attr]\n changed_attributes.delete(attr) if value == old\n else\n old = clone_attribute_value(attr)\n changed_attributes[attr] = old unless value == old\n end\n \n # Carry on.\n super\n end", "title": "" }, { "docid": "e00d70d30f645afa5e3f5eaaa62c6978", "score": "0.6101036", "text": "def non_atomic_attribute_status( attribute )\n\n return non_atomic_attributes[ attribute ]\n\n end", "title": "" }, { "docid": "acbfbd193d916510af3baea2d6c622d4", "score": "0.60992837", "text": "def will_save_change_to_attribute?(attr, **kwargs)\n attribute_changed?(attr, **kwargs)\n end", "title": "" }, { "docid": "1b780f95ce85a2d8ea6487a452cc6e0b", "score": "0.60857964", "text": "def attribute_delta_change(attr)\n [delta_changed_attributes[attr], __send__(attr)] if attribute_delta_changed?(attr)\n end", "title": "" }, { "docid": "7ce13d90980b3658b62b2e73d31fbaed", "score": "0.60787034", "text": "def [](attribute_name)\n\n return @value_cache[attribute_name] if (!@touched && @value_cache[attribute_name])\n\n if attribute_name.nil? then return '' end\n\n value = nil\n attribute_name = attribute_name.to_s\n\n if @attributes[attribute_name].nil? then \n short_attrib_name = attribute_name.split('.')[-1]\n \n if !@attributes[short_attrib_name].nil? then\n value = @attributes[short_attrib_name]\n \n else\n attrib_value = nil\n @attributes.each_pair { |key, value|\n key = key.to_s\n key_array = key.split('.')\n implicit_attr_name = key_array[2]\n\n if !implicit_attr_name.nil? and implicit_attr_name == attribute_name then\n attrib_value = @attributes[key_array[0]+'.'+key_array[1]+'.'+attribute_name]\n end\n }\n value = attrib_value \n end\n \n else \n value = @attributes[attribute_name]\n end\n\n @value_cache[attribute_name] = value\n return value\n\n end", "title": "" }, { "docid": "84ecb5b026337a320409a4eaac3ef37e", "score": "0.6076393", "text": "def update_attribute_value!\n [:value_derived, :value_asserted].each { |k| delete(k) }\n update_obj!(:value_derived, :value_asserted)\n self[:attribute_value]\n end", "title": "" }, { "docid": "7a555ba914b66c35e963288fab689865", "score": "0.6074946", "text": "def attribute_previously_changed?(attr) #:nodoc:\n previous_changes_include?(attr)\n end", "title": "" }, { "docid": "6c6b328a3018c069bf79bf02b8b315b6", "score": "0.6065551", "text": "def persistent_attribute_status( attribute )\n\n return persistent_attributes[ attribute ]\n\n end", "title": "" }, { "docid": "a1d6b1b01552d778cf797657f563fe54", "score": "0.6053491", "text": "def get(attribute)\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "f31c5ae4aa0d1740d761a33e60eadf57", "score": "0.60413957", "text": "def attribute_was(name)\n @data.attribute_was(name)\n end", "title": "" }, { "docid": "927840d3915c636d4dd882ce5c1d3cd9", "score": "0.60264134", "text": "def write_attribute(attr, value)\n attr = attr.to_s\n\n # The attribute already has an unsaved change.\n if attribute_changed?(attr)\n old = @changed_attributes[attr]\n @changed_attributes.delete(attr) unless field_changed?(attr, old, value)\n else\n old = clone_attribute_value(:read_attribute, attr)\n # Save Time objects as TimeWithZone if time_zone_aware_attributes == true\n old = old.in_time_zone if clone_with_time_zone_conversion_attribute?(attr, old)\n @changed_attributes[attr] = old if field_changed?(attr, old, value)\n end\n\n # Carry on.\n super(attr, value)\n end", "title": "" }, { "docid": "82c4d96cba43b0d59bb9e9b4221001bb", "score": "0.60194284", "text": "def write_attribute_with_dirty(attr, value)\n attr = attr.to_s\n\n # The attribute already has an unsaved change.\n unless changed_attributes.include?(attr)\n old = read_attribute(attr)\n\n # Remember the original value if it's different.\n changed_attributes[attr] = old unless old == value\n end\n\n # Carry on.\n write_attribute_without_dirty(attr, value)\n end", "title": "" }, { "docid": "6a43ef08a1c7475cfbeb5ea0047ddbd4", "score": "0.6011086", "text": "def attribute_previously_was(attr_name); end", "title": "" }, { "docid": "6a43ef08a1c7475cfbeb5ea0047ddbd4", "score": "0.6011086", "text": "def attribute_previously_was(attr_name); end", "title": "" }, { "docid": "3eea01295e16ecc9a06b2acff691a70f", "score": "0.6008042", "text": "def write_attribute(attr, value)\n attr = attr.to_s\n\n # The attribute already has an unsaved change.\n if attribute_changed?(attr)\n old = @changed_attributes[attr]\n @changed_attributes.delete(attr) unless _field_changed?(attr, old, value)\n else\n old = clone_attribute_value(:read_attribute, attr)\n # Save Time objects as TimeWithZone if time_zone_aware_attributes == true\n old = old.in_time_zone if clone_with_time_zone_conversion_attribute?(attr, old)\n @changed_attributes[attr] = old if _field_changed?(attr, old, value)\n end\n\n # Carry on.\n super(attr, value)\n end", "title": "" }, { "docid": "bdeeb4b736daa7603fc931e199a78eeb", "score": "0.59993756", "text": "def attribute_was(name)\n @attribute_objects[name.to_sym].was\n end", "title": "" }, { "docid": "088609b1cb45e3074245217e42f8d4f3", "score": "0.59954524", "text": "def value(attribute, default = \"Unknown\")\n self.has_key?(attribute) ? self[attribute].value : default\n end", "title": "" }, { "docid": "58b838ecef8f76812080af513995422c", "score": "0.5994339", "text": "def value\n @attributes[:value]\n end", "title": "" }, { "docid": "58b838ecef8f76812080af513995422c", "score": "0.5994339", "text": "def value\n @attributes[:value]\n end", "title": "" }, { "docid": "58b838ecef8f76812080af513995422c", "score": "0.5994339", "text": "def value\n @attributes[:value]\n end", "title": "" }, { "docid": "1fc9d920028cd0627aff376b00e97452", "score": "0.59929454", "text": "def was\n return nil unless changed?\n @initial_value\n end", "title": "" }, { "docid": "b567862ead4fc1a7d481ebd0d864794f", "score": "0.59703785", "text": "def read_original_attribute(attr_name)\n attr_name = attr_name.to_s\n \n unless original_attribute_stored?(attr_name)\n read_attribute(attr_name)\n else\n if !(value = retrieve_original_attribute_value(attr_name)).nil?\n if column = column_for_attribute(attr_name)\n if unserializable_attribute?(attr_name, column)\n unserialize_attribute(attr_name)\n else\n column.type_cast(value)\n end\n else\n value\n end\n else\n nil\n end\n end\n end", "title": "" }, { "docid": "c7f32216cc1257b4c0391f4b1052c673", "score": "0.5948922", "text": "def attribute=(attribute, value)\n @_her_attributes[attribute] = nil unless @_her_attributes.include?(attribute)\n send(\"#{attribute}_will_change!\") unless value == @_her_attributes[attribute]\n @_her_attributes[attribute] = value\n end", "title": "" }, { "docid": "a88018c70436fd9732d31e29ae270c8d", "score": "0.5940626", "text": "def value\n\t\treturn self.current_value\n\tend", "title": "" }, { "docid": "7cd5fce29f52454d40af47ffe68e3252", "score": "0.5934592", "text": "def saved_change_to_attribute(attr_name)\n mutations_before_last_save.change_to_attribute(attr_name)\n end", "title": "" }, { "docid": "74e782dceacf2c3d0f7dde03f8067650", "score": "0.59345454", "text": "def saved_change_to_attribute(attr_name); end", "title": "" }, { "docid": "3699fc206a90d1b5a929950c1e64b51e", "score": "0.59325546", "text": "def value\r\n assert_exists\r\n attribute_value('value')\r\n end", "title": "" }, { "docid": "5c6b19006e6668f2daf5ad7ccb9c0376", "score": "0.5919155", "text": "def value_for_attribute(attribute)\n if attribute.root_only?\n consumer.spec.send(attribute.name)\n else\n consumer.send(attribute.name) if consumer.respond_to?(attribute.name)\n end\n rescue => e\n results.add_error('attributes', \"Unable to validate `#{attribute.name}` (#{e}).\")\n nil\n end", "title": "" }, { "docid": "a414d24ed5bf920be0fdadbbdd87cbd0", "score": "0.5917864", "text": "def attribute(name)\n current_attributes[name]\n end", "title": "" }, { "docid": "5e2422db072204456531224636ec0615", "score": "0.59041035", "text": "def key_was(attribute)\n key_changed?(attribute) ? changed_keys[attribute] : __send__(attribute)\n end", "title": "" }, { "docid": "5fa336cc82b3e5ba537cbcf52fd51515", "score": "0.5903793", "text": "def old_value_data\n return @old_value_data\n end", "title": "" }, { "docid": "15955504572f0158e7b54c67a09fa927", "score": "0.59018755", "text": "def attribute_changed_in_latest_version?(attr_name)\n if @in_after_callback\n @record.saved_change_to_attribute?(attr_name.to_s)\n else\n @record.attribute_changed?(attr_name.to_s)\n end\n end", "title": "" }, { "docid": "34e27b7f05a053979e337c910060174b", "score": "0.5889079", "text": "def value\n subject[attr_name]\n end", "title": "" }, { "docid": "1193ef3034572d8a94fb81d489798314", "score": "0.58863467", "text": "def get_out_val\n self.attrs[:value]\n end", "title": "" }, { "docid": "1193ef3034572d8a94fb81d489798314", "score": "0.58863467", "text": "def get_out_val\n self.attrs[:value]\n end", "title": "" }, { "docid": "2bb0fa83b8eac5b537128052e544e437", "score": "0.58798665", "text": "def value(node, attribute)\n attribute == :value ? node.value(false) : super\n end", "title": "" }, { "docid": "600e165af9c32066711e78b816d128c6", "score": "0.5879152", "text": "def get_value\n read_attribute('string_value')\n end", "title": "" }, { "docid": "b271e0e8081609cffb7ffa6b019cfae5", "score": "0.58731365", "text": "def current_value\n return custom_value if dirty?\n\n default_value\n end", "title": "" }, { "docid": "0fc81b445bb79f54a9a443cbb9c2b587", "score": "0.58601254", "text": "def current_value\n return @current_value\n end", "title": "" }, { "docid": "29b2f567eeaff3a3f2e363ae9ddf1438", "score": "0.58549637", "text": "def changes\n attributes.fetch(:changes)\n end", "title": "" }, { "docid": "2c55b0d45f74dd77078974ac169ddf1e", "score": "0.58502865", "text": "def attribute_previous_change(attr_name)\n mutations_before_last_save.change_to_attribute(attr_name.to_s)\n end", "title": "" }, { "docid": "2aea416e98ef0cdc727070f561e27abe", "score": "0.5846819", "text": "def [](name)\n attr = get_attribute(name)\n return attr.value unless attr.nil?\n return nil\n end", "title": "" }, { "docid": "2aea416e98ef0cdc727070f561e27abe", "score": "0.5846819", "text": "def [](name)\n attr = get_attribute(name)\n return attr.value unless attr.nil?\n return nil\n end", "title": "" }, { "docid": "1b1333b4ee2a1358f0ac508beea942bb", "score": "0.5841283", "text": "def attribute_in_previous_version(attr_name, is_touch)\n if @in_after_callback && !is_touch\n # For most events, we want the original value of the attribute, before\n # the last save.\n @record.attribute_before_last_save(attr_name.to_s)\n else\n # We are either performing a `record_destroy` or a\n # `record_update(is_touch: true)`.\n @record.attribute_in_database(attr_name.to_s)\n end\n end", "title": "" }, { "docid": "fcc31acecbf89989c19219b823a860af", "score": "0.58375794", "text": "def attribute_previously_changed?(attr_name, **options); end", "title": "" }, { "docid": "fcc31acecbf89989c19219b823a860af", "score": "0.58375794", "text": "def attribute_previously_changed?(attr_name, **options); end", "title": "" } ]
89e641df54c970c360091c2d0b0703dd
returns an array of row of info
[ { "docid": "69f5505da9f85212b5a1a500d0bdbab4", "score": "0.0", "text": "def rownode_to_row(rownode)\n rownode.xpath('td').map &:text\nend", "title": "" } ]
[ { "docid": "d225c3c2af57d1f3b44ea8029e84749e", "score": "0.7486403", "text": "def rows\n @array\n end", "title": "" }, { "docid": "e07c838da6a51602b6609b8e4bf76756", "score": "0.7042674", "text": "def row; end", "title": "" }, { "docid": "838cff6ddfc2ac713e725cb8e5625cd5", "score": "0.699552", "text": "def rows\n @rows\n end", "title": "" }, { "docid": "838cff6ddfc2ac713e725cb8e5625cd5", "score": "0.699552", "text": "def rows\n @rows\n end", "title": "" }, { "docid": "838cff6ddfc2ac713e725cb8e5625cd5", "score": "0.699552", "text": "def rows\n @rows\n end", "title": "" }, { "docid": "637d2ad66f0a0cf70620699f335dde15", "score": "0.6936156", "text": "def rows\n Array.new self\n end", "title": "" }, { "docid": "4e7b4ebbf5cc15b1bbbeb9d352db49ba", "score": "0.6906827", "text": "def rows \n @r\n end", "title": "" }, { "docid": "a87af0d8d951eac394dfd835ca4dc04b", "score": "0.68041325", "text": "def rows\n return @rows\n end", "title": "" }, { "docid": "2a2b35717b689cd6028500a83365023b", "score": "0.67836106", "text": "def rows\n @rows\n end", "title": "" }, { "docid": "01fdcbf477d7175c78f2792405eebaef", "score": "0.67694366", "text": "def get_array_by_row()\n\t\tprepare(@dim_i,@dim_j)\n\t\treturn @myTab\n\tend", "title": "" }, { "docid": "8997684def12a5004ff346736cc4faea", "score": "0.6763869", "text": "def rows\r\n @all_rows\r\n end", "title": "" }, { "docid": "fc3354905b49246f842591720e87abaa", "score": "0.673256", "text": "def rows()\n (cr=@records.get(GRT_COLROW)) ? cr[1] : nil\n end", "title": "" }, { "docid": "7c3a770b2fe6f2d0d32147ddd4e8db7a", "score": "0.65049803", "text": "def to_a\n @rows\n end", "title": "" }, { "docid": "907a18fd1e6e8826fa42d9d5a46a346a", "score": "0.64989346", "text": "def get_row_elements(row)\n @cells[row]\n end", "title": "" }, { "docid": "897fa51c0857f80e9cb13b381d4a29a9", "score": "0.6482777", "text": "def colrow() @records.get_data(GRT_COLROW); end", "title": "" }, { "docid": "8723b109570af6d94833bae41223aa51", "score": "0.636934", "text": "def data_rows\n @rows[@num_header_rows..-1]\n end", "title": "" }, { "docid": "925e6ed56711cfad1a9f2fc093539aa2", "score": "0.63310874", "text": "def row\n :infopark\n end", "title": "" }, { "docid": "55deee5cf3d1f4723d2f13f709531d04", "score": "0.63301545", "text": "def rows\n RowCollection.new(@data)\n end", "title": "" }, { "docid": "b9d470933f4d8896d100123f6eddd87a", "score": "0.6323344", "text": "def rows\n @rows ||= if ActiveRecord::Base.connection.adapter_name == \"PostgreSQL\"\n result.entries\n else\n [].tap do |row_hashes|\n result.entries.map do |row|\n hash = {}\n result.fields.each do |field|\n hash[field] = row[result.fields.index(field)]\n end\n row_hashes << hash\n end\n end\n end\n end", "title": "" }, { "docid": "82c6781633423fe9f08c0fc1bebbcb0a", "score": "0.6279912", "text": "def argument_rows\n rows[1..rows.count] || []\n end", "title": "" }, { "docid": "c78387395fdbfc23a8ef112a3e549cbe", "score": "0.62797254", "text": "def as_array\n row_names = []\n rows = [] \n if @db == @@sdb\n @@sdb.select('select * from `' + @table_name + '`')[:items].each do |row| \n row.each do |row_name, row_data| \n row_names << row_name\n rows << reassemble_sdb_items(row_data)\n end\n end\n elsif @db == @@google_storage\n row_names = as_name_array\n rows = get_rows_from_names(row_names)\n end\n return row_names, rows\n end", "title": "" }, { "docid": "0b13e4afcd08dd531e58413878028706", "score": "0.6271692", "text": "def to_a\n Array.new @row || nilified_row\n end", "title": "" }, { "docid": "4b8f1409b1c714387b0e6f18ae2811e4", "score": "0.62706757", "text": "def get_row(column_label)\n row = []\n\n (0..8).each do |row_label|\n row << get_value( column_label + row_label.to_s )\n end\n return row\n end", "title": "" }, { "docid": "b494df8f10b22e0828075d8ead3c8b53", "score": "0.62440515", "text": "def get\n return [@row, @col]\n end", "title": "" }, { "docid": "fa4e03870149b73cd8db9bb3eba5128d", "score": "0.6222835", "text": "def rows\r\n assert_exists\r\n arr_rows = get_rows\r\n table_rows = Array.new(arr_rows.length)\r\n for i in 0..arr_rows.length - 1 do\r\n table_rows[i] = TableRow.new(@container, :jssh_name, arr_rows[i])\r\n end\r\n return table_rows\r\n end", "title": "" }, { "docid": "cf735d011cd808c0c4e512640696ef92", "score": "0.62203485", "text": "def header_rows\n []\n end", "title": "" }, { "docid": "730440069a4089a70128b4b271d42daa", "score": "0.6217618", "text": "def table_array\r\n @table_array\r\n end", "title": "" }, { "docid": "1f6406ee199b03c0b89e1450e92d30ce", "score": "0.6207739", "text": "def cells\n rows.flatten\n end", "title": "" }, { "docid": "73f2563c3fa6a4f05c94bc56d3afee4b", "score": "0.61984074", "text": "def data\n rows ? rows[1..-1] : \"\"\n end", "title": "" }, { "docid": "2433361aa5d1668d4a27cf6a0c004aa3", "score": "0.6194953", "text": "def row_cells\n rowdata = []\n print_layout.each do |section|\n rowdata += row_cell_items(section[:row_cells])\n end\n rowdata\n end", "title": "" }, { "docid": "e9046506cd50b4fa2dd9b5a8f8571534", "score": "0.6188363", "text": "def getRows\n return @grid.getRows\n end", "title": "" }, { "docid": "bd1afecade7b30d3aa7c4cabf8df6f86", "score": "0.6116231", "text": "def rows #:nodoc:\n @components\n end", "title": "" }, { "docid": "1d561d7c55cb4501d1467ee351a3286f", "score": "0.6107454", "text": "def row_values(row)\r\n assert_exists\r\n arr_rows = rows\r\n cells = arr_rows[row - 1].cells\r\n values = Array.new(cells.length)\r\n for i in 0..cells.length - 1 do\r\n values[i] = cells[i].to_s\r\n end\r\n return values\r\n end", "title": "" }, { "docid": "026b625d3d8651c77c27594bb737744b", "score": "0.6105733", "text": "def all_rows\n @rows\n end", "title": "" }, { "docid": "a7e3e4324ffc5a607c9dd975af5603cc", "score": "0.6093493", "text": "def rows\n @rows ||=\n begin\n rows = []\n @facet_values.each_slice(2) do |pair|\n rows << new_row(pair)\n end\n rows\n end\n end", "title": "" }, { "docid": "f92cb5b1966287435325426e7cda73bf", "score": "0.60819405", "text": "def rows\n @columns.each do |column|\n @rows << Array.new(@columns.size) do |i|\n \"#{column}#{i + 1}\"\n end\n end\n @rows\n end", "title": "" }, { "docid": "75c1b41948b1595a11704cfdf8c529cf", "score": "0.60736287", "text": "def spreadsheet_row\n fields = []\n fields << self.block.shop_order\n if self.block.shop_order == 111\n 5.times do\n fields << \"\"\n end\n else\n fields << self.block.customer_code\n fields << self.block.process_code\n fields << self.block.part_number\n fields << self.block.part_sub\n fields << self.block.part_name.join(\"\\n\")\n end\n fields << self.block.load\n fields << self.block.is_rework\n fields << self.block.is_early\n fields << self.block.is_strip\n fields << self.block.xray_id\n fields << self.block.application\n fields << self.block.directory\n fields << self.block.product\n fields << self.block.number\n if self.block.user\n fields << self.block.user.employee_number\n fields << self.block.user.name\n else\n fields << \"\"\n fields << \"\"\n end\n fields << self.reading_at.strftime(\"%m/%d/%Y\")\n fields << self.reading_at.strftime(\"%H:%M:%S\")\n fields << self.thickness\n if self.alloy.blank?\n fields << \"\"\n else\n fields << self.alloy\n end\n fields << self.x_coordinate\n fields << self.y_coordinate\n fields << self.z_coordinate\n return fields\n end", "title": "" }, { "docid": "5f0672ef3b80498470aae386e8885a45", "score": "0.6065695", "text": "def rows\n return @rows if @rows\n if execute && result['rows']\n @rows ||= result['rows'].map{|v| ViewRow.new(v, model)}\n else \n [ ]\n end\n end", "title": "" }, { "docid": "c15ab7270169e9d467fcd84c92721e29", "score": "0.6061393", "text": "def rows\n rows_and_cols.first\n end", "title": "" }, { "docid": "a844ed34beca813e15fc3739d6f53237", "score": "0.60518026", "text": "def get_data sql\n #$log.debug \"SQL: #{sql} \"\n columns, *rows = @db.execute2(sql)\n #$log.debug \"XXX COLUMNS #{sql}, #{rows.count} \"\n content = rows\n return content\n end", "title": "" }, { "docid": "6875b31a8800f5d24e5dec55547d5be6", "score": "0.6033156", "text": "def create_column_data_array\n\ttable_id = create_table_id('../data/census_column_metadata.csv')\n\tcolumn_id = create_column_id('../data/census_column_metadata.csv')\n\t\n\t[title_processor,table_id,column_id].transpose\n\nend", "title": "" }, { "docid": "fe46ce8c17c6b7c58a3429cb6e1068a0", "score": "0.60036206", "text": "def license_details_table_rows\n resources_details_tables[1].rows_text\n end", "title": "" }, { "docid": "f688d4196f492c96aa00452cb54192db", "score": "0.5993552", "text": "def rows\n @rows ||= begin\n row_indexes.map do |e|\n e.map do |e|\n @input[e]\n end\n end\n end\n end", "title": "" }, { "docid": "6c17adb9560da9416c4582b2fafee335", "score": "0.59900206", "text": "def get_all_information\n result = [['Employee','TaskId - uniqID', 'Status', 'Issue Type' ,'Priority', 'Velocity (SP)', 'Planed estimate(hours)', 'Actual effort(hours)']]\n fetching.each do |issue|\n result.push(issue.to_a)\n end\n result\n end", "title": "" }, { "docid": "fd120cccfe678435fc99c44313b38445", "score": "0.5982549", "text": "def yale_nd_row_as_array i\n yale_nd_row(i, :array)\n end", "title": "" }, { "docid": "b273c95e31236ad02e739b3f0e869ee4", "score": "0.59780955", "text": "def values\n rows.map{|r| r.value}\n end", "title": "" }, { "docid": "d7e67b0b7e2589bc0f39e39146ac8615", "score": "0.5951323", "text": "def stash_info_table_rows\n expand(account_details_icon)\n stash_info_table.rows_text\n end", "title": "" }, { "docid": "cf0faef6fd22a055fd1c0aff1d22851e", "score": "0.59461397", "text": "def rows\n links.map { |link| link.row }\n end", "title": "" }, { "docid": "5d06e84b119cc4e2bb09b1e46a4e320a", "score": "0.59454453", "text": "def colrow_record() @records.get(GRT_COLROW); end", "title": "" }, { "docid": "b8debf22764da117c1d51c285931844c", "score": "0.5934913", "text": "def cells\n rows.map { |r| r[key] }\n end", "title": "" }, { "docid": "251504964f1dff0ba264c092e4cd8fe5", "score": "0.59340215", "text": "def rows\n @rows.lazy\n end", "title": "" }, { "docid": "4e32399044d580a60073f37f7f0e045f", "score": "0.5932615", "text": "def rows\n fail \"Implement #{self.class}#rows\"\n end", "title": "" }, { "docid": "e52f42f0105ffc16811bc2811eb099ed", "score": "0.59299165", "text": "def list_item\n row = []\n list_item_fields.each do |field_name|\n row << field(field_name).to_s\n end\n\n row\n end", "title": "" }, { "docid": "35a30dadb77f631ba3b8e9015179c807", "score": "0.59288806", "text": "def render_rows\n [header.indices, *(records.map &:values)]\n end", "title": "" }, { "docid": "14bb040e50b25cfb6a61094803a06d34", "score": "0.59238183", "text": "def rows\n shape[0]\n end", "title": "" }, { "docid": "265276fcad4a5543d815deb4fae5f8c1", "score": "0.59194696", "text": "def rows\n (report[\"data\"][\"rows\"] || []).map { |row| Row.new(self, row) }\n end", "title": "" }, { "docid": "02fd3176e7fda945adc0f8e11001ce7d", "score": "0.5913263", "text": "def rows\n @rows ||= csv_rows[1..-1]\n end", "title": "" }, { "docid": "02fd3176e7fda945adc0f8e11001ce7d", "score": "0.5913263", "text": "def rows\n @rows ||= csv_rows[1..-1]\n end", "title": "" }, { "docid": "49512a6be35ead6a7aa6d8f32a732848", "score": "0.5910619", "text": "def rows\n csv.rows.map { |row_array|\n Row.new(header: header, row_array: row_array).to_a\n }\n end", "title": "" }, { "docid": "fb853556be10a03051541de299a6a651", "score": "0.5909084", "text": "def get_cells(rows, columns)\n cells = []\n rows.each do |r|\n columns.each do |c|\n cells << @fields[r][c]\n end\n end\n cells\n end", "title": "" }, { "docid": "b3bdd6801938b670a54e3da9143d3dea", "score": "0.59052634", "text": "def get_row(column_label)\n (0..8).each do |row_label|\n @row << get_value( column_label + row_label.to_s )\n end\n return @row\n end", "title": "" }, { "docid": "00b25b0d6924a86e59c460a8db2a1735", "score": "0.5897187", "text": "def to_a\r\n assert_exists\r\n y = []\r\n table_rows = rows\r\n for row in table_rows\r\n x = []\r\n row.each do |td|\r\n x << td.to_s.strip\r\n end\r\n y << x\r\n end\r\n return y\r\n end", "title": "" }, { "docid": "24bd98841153ce5a68fbbfcb07fafcbd", "score": "0.58879286", "text": "def get_row(n)\n\t\tprepare(@dim_i,@dim_j)\n\t\treturn @myTab[n]\n\tend", "title": "" }, { "docid": "061decbad1a35e82205ae9e50308b1f6", "score": "0.5885693", "text": "def get_row_cells row\n\t\treturn (row * 9...row * 9 + 9).to_a\n\tend", "title": "" }, { "docid": "91b094e14a49af07a08a0b89e679a39a", "score": "0.587348", "text": "def data\n vertical? ? columns : rows\n end", "title": "" }, { "docid": "60838e978a79e57d0391601995bfe1e3", "score": "0.5868984", "text": "def rows\n CellCollection.new(@data, @column)\n end", "title": "" }, { "docid": "120c3ce786a5764ed20573a49f783228", "score": "0.5859165", "text": "def storage_details_table_rows\n resources_details_tables[0].rows_text\n end", "title": "" }, { "docid": "f37527a2227e0f7d28864e4c4281983c", "score": "0.5842516", "text": "def to_csv_row\n [@id, @name, @address]\n end", "title": "" }, { "docid": "0c2c24a33fdbda26f46f046010b01d04", "score": "0.58384687", "text": "def row(index)\n @data[index]\n end", "title": "" }, { "docid": "3ca2026a80abe6945855e0621f63b876", "score": "0.5835", "text": "def each_row\n end", "title": "" }, { "docid": "a457ff08154540cb1b4d1dbb514185b4", "score": "0.5831506", "text": "def data_with_head(columnheader)\r\n Array(raw_data_sheet.column(columnheaders_raw.index(columnheader)))\r\n end", "title": "" }, { "docid": "e9053ca5dada419c90a340a0b2b2b0fa", "score": "0.5824855", "text": "def rows\n @pz.group_by.each_with_index { |val, n| row_id(n) }\n end", "title": "" }, { "docid": "58184d161e12cb822ef6b599f7d03961", "score": "0.5810543", "text": "def get_contact_info_array\n rtn = []\n rtn << get_attr(:name)\n rtn << [:provided_by, self.provider.name] # Special case, as the symbol doesn't match the attribute\n rtn << get_attr(:phone)\n rtn << get_attr(:email)\n rtn << get_attr(:url)\n end", "title": "" }, { "docid": "67b8da0a10bb9668797677a37bd00d77", "score": "0.5797066", "text": "def node_row(node)\n [\n node.key,\n node.query.primary_co2_emission,\n *primary_carriers.map { |ca| node.query.primary_demand_of(ca) },\n *final_carriers.map { |ca| node.query.final_demand_of(ca) }\n ]\n end", "title": "" }, { "docid": "d273b64f3f82d15159571c2bebb21ee0", "score": "0.5795456", "text": "def getTableCells tableTr, area\n details = tableTr.collect do |row|\n detail = {}\n [\n [\"id\", 'td[1]/text()'],\n [\"school_name\", 'td[2]/text()'],\n [\"school_address\", 'td[3]/text()'],\n [\"school_type\", 'td[4]/text()'],\n [\"school_url\", 'td[5]/a/text()'],\n ].each do |name , xpath|\n detail[name] = row.at_xpath(xpath).to_s.strip\n end\n detail[\"school_area\"] = area\n detail\n end\n details.each do |eachRecord|\n details.delete_if{|y| y[\"id\"] == \"\"}\n end\n return details\nend", "title": "" }, { "docid": "ac033cdf9c6ba0bec3a3ca709fb252fb", "score": "0.57918435", "text": "def to_row \n if ndim != 1\n raise \"ndim should be 1\"\n end\n return self[1,:%]\n end", "title": "" }, { "docid": "c038988b65da7de75600e0165d5536f2", "score": "0.5791196", "text": "def show\n rowarray = Array.new\n myfile = Trainmodel.find(params[:id]).trainfile\n c = CSV.open(myfile.path)\n c.first(10).each do |row|\n rowarray << row\n @rowarraydisp = rowarray\n end\nend", "title": "" }, { "docid": "29836481b30fe2b26af499a93a8c3966", "score": "0.578147", "text": "def row(index)\n end", "title": "" }, { "docid": "3b6196e85a5f1b219bf5f1d1c3cfdc96", "score": "0.57810247", "text": "def get_row_contents(row)\n @board.slice(row*9,9)\n end", "title": "" }, { "docid": "b4e1969243b4bd3a3472de18c8edb671", "score": "0.5754143", "text": "def rows id\n get_image(id).rows\n end", "title": "" }, { "docid": "900a7f0bba1dcf5f8e096b52e9d7c38f", "score": "0.57510567", "text": "def ug_resource_details_table_rows\n ug_resources_details_table.rows_text[1..-2]\n end", "title": "" }, { "docid": "977a0fb3e2fbc1cd0acedd0d842e5ea1", "score": "0.57500434", "text": "def work_details\r\n unless self.work_informations.blank?\r\n work_arr = []\r\n self.work_informations.each do |work|\r\n work_arr << work.occupation\r\n work_arr << work.company_name\r\n work_arr << work.industry\r\n work_arr << work.company_website\r\n work_arr << work.job_description\r\n end\r\n return work_arr\r\n end\r\n end", "title": "" }, { "docid": "52468db4ff676e747d8fdd282b464e4a", "score": "0.5745641", "text": "def rows_to_array(rows)\n collection = BlocRecord::Collection.new\n rows.each { |row| collection << new(Hash[columns.zip(row)]) }\n collection # return an array\n end", "title": "" }, { "docid": "818d9435447913649abe0ff4303b8e36", "score": "0.57397527", "text": "def get_contents(col)\n @entire.map {|hash| hash[col]}\n end", "title": "" }, { "docid": "141d756cd1f9b82f0daf5964eb91ecb1", "score": "0.57141286", "text": "def datos(row, i)\n data = row[7].nil? ? SIN_DATOS : row[i]\n status = row[i + 31]\n [data, status]\n end", "title": "" }, { "docid": "79af4a6efaafbb99f6cfd0b40a09855e", "score": "0.5706547", "text": "def table_row(obj, out_mode, depth)\n row = []\n variables = out_mode == :full ? obj.class::FIELDS_FULL : obj.class::FIELDS_SUMMARY\n variables.each do |var|\n val = obj.instance_variable_get(\"@#{var}\")\n val = val[0..32] if out_mode == :summary # Shorten data for summary - BRUTE FORCE - should be neater\n row << val\n end\n if depth == :deep\n # Deep! So check the connection, do a search and attach the new column/row\n row << deep_data(obj)\n end\n row\n end", "title": "" }, { "docid": "8ad82771fa45953827af0ab19a38ac4d", "score": "0.5696542", "text": "def row(this_speaker)\n\t\tindexarray = []\n\t\tspeakees = @hash[this_speaker.to_sym].flatten.sort!\n\t\tspeakees.each do |name|\n\n\t\t\tif @speakers.index(name) != nil\n\t\t\tindexarray << @speakers.index(name)\n\t\t\tend\n\n\t\tend\n\n\t\t#Create row of length @speakers\n\t\tmatrixrow = Array.new(@speakers.length, 0)\n\t\tindexarray.each do |i|\n\t\t\tmatrixrow[i] = 1\n\t\tend\n\t\treturn matrixrow\n\tend", "title": "" }, { "docid": "37be4dada7397219816165a92922f06d", "score": "0.56909484", "text": "def csv_row\n #empty by default\n []\n end", "title": "" }, { "docid": "37be4dada7397219816165a92922f06d", "score": "0.56909484", "text": "def csv_row\n #empty by default\n []\n end", "title": "" }, { "docid": "d9c066d0c68581aa83950793a07c0aa8", "score": "0.56823117", "text": "def columns; @columns; end", "title": "" }, { "docid": "568d458cde3b270697d572c5635368d6", "score": "0.5679413", "text": "def rows\n @rows.to_enum\n end", "title": "" }, { "docid": "f8f49d4d67ae2d8b359b340471fa1bab", "score": "0.5673841", "text": "def rows\n @dimension\n end", "title": "" }, { "docid": "0ecba8a7d6d960704a5d778f9a12fd02", "score": "0.56718326", "text": "def extract_row(elem)\n ticker = elem.css(\"td\")[1].text\n company = elem.css(\"td\")[2].text\n sector = elem.css(\"td\")[3].text\n industry = elem.css(\"td\")[4].text\n country = elem.css(\"td\")[5].text\n market_cap = elem.css(\"td\")[6].text\n price_earnings = elem.css(\"td\")[7].text\n price = elem.css(\"td\")[8].text\n\n [ticker, company, sector, industry, country, market_cap, price_earnings, price]\n end", "title": "" }, { "docid": "dd2a55298301cba1ec4a9d434c3f0a19", "score": "0.5668758", "text": "def fetch_curr_table\n Array.new\n end", "title": "" }, { "docid": "572a8fdc1acb901e1bd5bea289ee4652", "score": "0.56658167", "text": "def to_ary\n [\"#{id}: #{description}\", @raw_data]\n end", "title": "" }, { "docid": "23ae94f830f0a61f082121e9995f663d", "score": "0.56624883", "text": "def values(column)\n rows do |row|\n row[column]\n end\n end", "title": "" }, { "docid": "9977e280d65040b34f2985e9c7c3146b", "score": "0.565968", "text": "def row(index)\n row_indexes(index).map do |e|\n @input[e]\n end\n end", "title": "" }, { "docid": "a8cf204e104375672a0fce935c64125e", "score": "0.56570786", "text": "def table_to_array_of_arrays(table=@table)\n array = []\n table.rows.each do |row|\n row_array = []\n row.data.each_with_index do |column, index|\n data = {:text => column}\n if row.cell_format.is_a? Hash\n data.reverse_merge! row.cell_format\n elsif row.cell_format.is_a? Array\n data.reverse_merge! row.cell_format[index]\n end\n row_array << Prawn::Table::Cell.new(data)\n end\n array << row_array\n end\n array\n end", "title": "" }, { "docid": "23ef576f09bd09da5688ea38ad03246b", "score": "0.56545997", "text": "def _get_board_rows()\n array_of_rows = []\n sudoku_board.each { |row| array_of_rows << row }\n end", "title": "" }, { "docid": "b3366ec9e453501a3645a87af342b726", "score": "0.5649998", "text": "def rows\n rows = []\n unless columns.empty?\n 0.upto(columns.first.items.last_i) do |rnum|\n row = {}\n columns.each do |col|\n row[col.header] = col[rnum]\n end\n rows << row\n end\n end\n rows\n end", "title": "" }, { "docid": "862aaa32cf91c532250cb5d2777c88e2", "score": "0.5647217", "text": "def user_to_row(user)\n [user.key,\n user.class,\n nil,\n nil] + user.load_curve.to_a\n end", "title": "" } ]
3741283059e064d2463a92b1c1dd60c9
managers and members only
[ { "docid": "25f1bcb95de81a8fbabcf76652a16102", "score": "0.0", "text": "def role_memberships\n if self.member?\n self.memberships\n else\n self.role_clubs.map{ |c| c.memberships }.flatten\n end\n end", "title": "" } ]
[ { "docid": "f358519f85b70e8dd43a68b06e399262", "score": "0.683985", "text": "def manager\n end", "title": "" }, { "docid": "f358519f85b70e8dd43a68b06e399262", "score": "0.683985", "text": "def manager\n end", "title": "" }, { "docid": "3d70b6884e54b5bb6e443edd3fbc3016", "score": "0.6832532", "text": "def managers\n find_related_frbr_objects( :is_managed_by, :which_roles?) \n end", "title": "" }, { "docid": "bf4627380c4bf476f1b98e5d03a26f9a", "score": "0.67749155", "text": "def members_only?\n true \n end", "title": "" }, { "docid": "689b9bf2c05b383e0feda61247ade97b", "score": "0.6710791", "text": "def members; end", "title": "" }, { "docid": "689b9bf2c05b383e0feda61247ade97b", "score": "0.6710791", "text": "def members; end", "title": "" }, { "docid": "689b9bf2c05b383e0feda61247ade97b", "score": "0.6710791", "text": "def members; end", "title": "" }, { "docid": "689b9bf2c05b383e0feda61247ade97b", "score": "0.6710791", "text": "def members; end", "title": "" }, { "docid": "689b9bf2c05b383e0feda61247ade97b", "score": "0.6710791", "text": "def members; end", "title": "" }, { "docid": "689b9bf2c05b383e0feda61247ade97b", "score": "0.6710791", "text": "def members; end", "title": "" }, { "docid": "689b9bf2c05b383e0feda61247ade97b", "score": "0.6710791", "text": "def members; end", "title": "" }, { "docid": "eb2bbbcfb11c096e50e71dd9741fe888", "score": "0.6710052", "text": "def manager\n\t\t\t# Author\n\t\t\tauthorize! :manage, User\n\n\t\t\t@system_managers = User.search_by_type '', 'system_manager', true\n\t\t\t@user_managers = User.search_by_type '', 'user_manager', true\n\t\t\t@real_estate_managers = User.search_by_type '', 'real_estate_manager', true\n\t\t\t@project_managers = User.search_by_type '', 'project_manager', true\n\t\t\t@appraisers = User.search_by_type '', 'appraiser', true\n\t\t\t@statisticians = User.search_by_type '', 'statistician', true\n\t\tend", "title": "" }, { "docid": "96d2f3c2ae75f94b52eefb1154ccb9b1", "score": "0.6692315", "text": "def members_only?\n false \n end", "title": "" }, { "docid": "1249025fd9628ce6533d30f09b2407cd", "score": "0.6622405", "text": "def manager\n users(:jolly)\n end", "title": "" }, { "docid": "7ba55f03cdd6cdbd156c3f7330b21353", "score": "0.65697455", "text": "def managers\n self.parent.managers\n end", "title": "" }, { "docid": "b53a46fb5a9c05cf38efeff153bd6e76", "score": "0.64804727", "text": "def allow_member?\n true\n end", "title": "" }, { "docid": "6abf0c37a80051adaa5f63f48919dafd", "score": "0.6458475", "text": "def manager?\n current_user&.manager? || false\n end", "title": "" }, { "docid": "067373c05719dfa8880c222492ebc8f2", "score": "0.64546865", "text": "def _managers_specials\n @_managers_specials ||= Hash.new\n end", "title": "" }, { "docid": "5efe7f43666c7458e5baca0a8d87d778", "score": "0.6439789", "text": "def members_only?\n false\n end", "title": "" }, { "docid": "6292cde80b5325b0fe2657fc9563c88e", "score": "0.6415249", "text": "def is_manager\n return current_user.role == User::MANAGER\n end", "title": "" }, { "docid": "30c7cde3e455865d9dffb7625d3e6a61", "score": "0.64117163", "text": "def place_members_only?\n false\n end", "title": "" }, { "docid": "30c7cde3e455865d9dffb7625d3e6a61", "score": "0.64117163", "text": "def place_members_only?\n false\n end", "title": "" }, { "docid": "b2b2bd8ef8d794cdf66c413fdb3c9c8a", "score": "0.64026743", "text": "def just_members\n members - [owner]\n end", "title": "" }, { "docid": "e085a1f5b56d68cbd253f08fe7dcbbcb", "score": "0.6382631", "text": "def managers\n @members = self.user_workspace_memberships.where({:manager => 1})\n @users = []\n @members.each do |member|\n @users.push member.user if member.user\n end\n return @users\n end", "title": "" }, { "docid": "899e2f3e0a274b06cd45f261ea8c46d5", "score": "0.637452", "text": "def member\n end", "title": "" }, { "docid": "b81274600e342ef286d4d5a7eb541ff1", "score": "0.6331941", "text": "def manager_permissions\n can :manage_collection, String do |pid|\n Rails.logger.debug(\"[MANPERM] Checking from STRING\")\n test_manager(pid)\n end\n\n can :manage_collection, DRI::Batch do |obj|\n Rails.logger.debug(\"[MANPERM] Checking from Object\")\n test_manager(obj.id)\n end\n\n can :manage_collection, SolrDocument do |obj|\n Rails.logger.debug(\"[MANPERM] Checking from SolrDoc\")\n cache.put(obj.id, obj)\n test_manager(obj.id)\n end\n\n can :manage, String do |pid|\n Rails.logger.debug(\"[MANPERM] Checking from STRING\")\n test_manager(pid)\n end\n\n can :manage, DRI::Batch do |obj|\n Rails.logger.debug(\"[MANPERM] Checking from Object\")\n test_manager(obj.id)\n end\n\n can :manage, SolrDocument do |obj|\n Rails.logger.debug(\"[MANPERM] Checking from SolrDoc\")\n cache.put(obj.id, obj)\n test_manager(obj.id)\n end\n end", "title": "" }, { "docid": "f335f218674a6dc49ed7d0036af26d50", "score": "0.6309791", "text": "def members(*) end", "title": "" }, { "docid": "c1616b03adf4b0db5f4d28ad9b92bbc9", "score": "0.62690914", "text": "def member_addable_by?(actor)\n return true if public?\n return false\n end", "title": "" }, { "docid": "97055dba243e0fe5998cf599e12d7f8d", "score": "0.6261234", "text": "def manager\n Manager\n end", "title": "" }, { "docid": "03c72e096aad5a42e4f413347d705f15", "score": "0.62079126", "text": "def member; end", "title": "" }, { "docid": "03c72e096aad5a42e4f413347d705f15", "score": "0.62079126", "text": "def member; end", "title": "" }, { "docid": "03c72e096aad5a42e4f413347d705f15", "score": "0.62079126", "text": "def member; end", "title": "" }, { "docid": "03c72e096aad5a42e4f413347d705f15", "score": "0.62079126", "text": "def member; end", "title": "" }, { "docid": "03c72e096aad5a42e4f413347d705f15", "score": "0.62079126", "text": "def member; end", "title": "" }, { "docid": "e3401ba759b55434902942bcc8f8bd00", "score": "0.6200305", "text": "def managed_by? a_user\n owned_by? a_user || program.moderator == a_user\n end", "title": "" }, { "docid": "7a7b4c7e40d5844e240081ad9ffb0588", "score": "0.61673766", "text": "def manager?\n return true if current_user.is_admin?\n raise Blacklight::AccessControls::AccessDenied, t('dri.views.exceptions.access_denied') unless current_user.is_om?\n\n i = Institute.find(params[:id])\n raise Blacklight::AccessControls::AccessDenied, t('dri.views.exceptions.access_denied') unless i&.org_manager == current_user\n end", "title": "" }, { "docid": "07d253a94e634f5c244636aa114b8b92", "score": "0.61630625", "text": "def is_manager?\n user_type == \"manager\"\n end", "title": "" }, { "docid": "82db26d37191048627959266c88c34ad", "score": "0.6143331", "text": "def manager?\n @role == \"manager\"\n end", "title": "" }, { "docid": "a395bb3d27eacaf6988217234f133276", "score": "0.6124456", "text": "def manager?\n return ( self.user_type == User::USER_TYPE_MANAGER or self.user_type == User::USER_TYPE_ADMIN )\n end", "title": "" }, { "docid": "d5c41a799bcd01998d8b9beaee4260b5", "score": "0.61115086", "text": "def manager_or_owner?\n MANAGER_ROLES.include?(CourseUser.roles[role.to_sym])\n end", "title": "" }, { "docid": "df26c351c26f7a8494fcb67ba1b3fe2e", "score": "0.60916275", "text": "def only_members items\n only_ items, :member\nend", "title": "" }, { "docid": "180eca90f40ff82362bf774a231f9b7c", "score": "0.60874367", "text": "def managers\n if @data_object.team_id\n Role.team_managers(@data_object.team_id)\n else\n []\n end\n end", "title": "" }, { "docid": "1d2e37a4e296e8127699661ee0c797f7", "score": "0.60761464", "text": "def project_managers\n people_with_the_role(\"project_manager\")\n end", "title": "" }, { "docid": "776b719158661a1043b6a33258516148", "score": "0.6075687", "text": "def is_manager?\n self.roles.detect { |r| r.manager? } != nil\n end", "title": "" }, { "docid": "2e49aae135273bae3f70560999bd4f4a", "score": "0.60746795", "text": "def members\n users\n end", "title": "" }, { "docid": "2e49aae135273bae3f70560999bd4f4a", "score": "0.60746795", "text": "def members\n users\n end", "title": "" }, { "docid": "9e08550fb934db7bd8988b2951a694cd", "score": "0.605773", "text": "def running?\n !!managers\n end", "title": "" }, { "docid": "234049fd0118e043ceedf51f97c8aa58", "score": "0.6052678", "text": "def manager_user\n redirect_to(root_url) unless current_user && current_user.manager?\n end", "title": "" }, { "docid": "0ae991c0f5760549b6172f54bde6a573", "score": "0.6041077", "text": "def manager\n if self.manager_id > 0\n User.find(self.manager_id)\n else\n User.new( :first_name => 'Not', :last_name => 'Assigned')\n end\n end", "title": "" }, { "docid": "8aee07c577df4e7e5106173a3f93b336", "score": "0.6023535", "text": "def is_manager?\n organization && organization.manager == self\n end", "title": "" }, { "docid": "401b28c1c07e0f287b89b84086707611", "score": "0.60172594", "text": "def min_up_members_state\n super\n end", "title": "" }, { "docid": "f2758f33e5ec9d3997d50bb617674b7a", "score": "0.6003367", "text": "def show\n\n @marina = Marina.find(params[:id])\n @marina.active_managers.each do |manager|\n if manager == current_user\n @manager = current_user\n end\n end\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @marina }\n end\n end", "title": "" }, { "docid": "ab193093f17e514894d338630f6d53cd", "score": "0.5983521", "text": "def has_no_managers?\n national_level_roles = [Role.ADMINISTRATOR,\n Role.NATIONAL_CFR_HEAD,\n Role.NATIONAL_FINANCIAL_CONTROLLER,\n Role.NATIONAL_EVENTS_HEAD,\n Role.CITY_PRESIDENT]\n national_level_roles.include?(self.role)\n end", "title": "" }, { "docid": "17216689bcee2be1e9a0497f6de1bc9e", "score": "0.59557563", "text": "def members?\n user.hoa == hoa\n end", "title": "" }, { "docid": "e62f6b1dbd062bc236c2e110b445f84d", "score": "0.59531194", "text": "def mentor?\n !admin?\n end", "title": "" }, { "docid": "f5caf003bd93661018e6698feb827bcf", "score": "0.5937043", "text": "def members_without_admins\r\n self.members.values.select { |member| !self.is_admin?(member) }\r\n end", "title": "" }, { "docid": "9885733144f196d1fdfe875717bdae9a", "score": "0.5920953", "text": "def owned_by? a_user\n a_user == program.moderator\n end", "title": "" }, { "docid": "041969b08d5ddca1684ffe11a0bb6c94", "score": "0.5878232", "text": "def current_manager?(manager)\n manager == current_manager\n end", "title": "" }, { "docid": "717b17fcf99b91ddd0d2e9cec64d9e00", "score": "0.58669204", "text": "def has_members?\n self.members.count > 0\n end", "title": "" }, { "docid": "06a1f144e6525e5c7a986efb147c893e", "score": "0.58600813", "text": "def members\n\t\t(self.users.to_a + self.admins.to_a).uniq\n\tend", "title": "" }, { "docid": "281c0ec2281a5768ac4dfa31bbe050d1", "score": "0.5848916", "text": "def check_manager_or_admin\n unless current_user && (current_user.privilege_manager? || current_user.privilege_admin?)\n flash[:danger] = \"You do not have permission to perform this operation\"\n redirect_to root_path\n end\n end", "title": "" }, { "docid": "7aa4bdd1a01eb241f12bf35c35f170a8", "score": "0.5840709", "text": "def member\n group&.member_for(user)\n end", "title": "" }, { "docid": "d9ed3e3659685098d191f72a33ce8735", "score": "0.58404046", "text": "def manager\n self.class.manager\n end", "title": "" }, { "docid": "4fc018c5900db107883c43254c684d9a", "score": "0.5836611", "text": "def my_managers\n my_groups = group_users.pluck(:group_id)\n CourseUser.joins(group_users: :group).merge(Course::GroupUser.manager).\n where(Course::Group.arel_table[:id].in(my_groups)).distinct\n end", "title": "" }, { "docid": "cf91353ec766effe38706ea880329b04", "score": "0.5828939", "text": "def is_manager(livian_user_id)\n User.find(:first, :joins => [:role], :conditions => [\"user_id = ? AND roles.name = ?\", livian_user_id, 'team_manager']).present?\n end", "title": "" }, { "docid": "94998de395e27663b0f153eeff6375f2", "score": "0.5826575", "text": "def logged_manager?\n !current_manager.nil?\n end", "title": "" }, { "docid": "6b503ccd07c589fcefddfb358a5871a3", "score": "0.58084136", "text": "def is_owned_by?(member = nil)\n return false if member.blank?\n if self.designer == member or self.client == member\n true\n else\n member.is_super_user? ? true : false\n end\n rescue\n false\n end", "title": "" }, { "docid": "8f9c77a3bd1d07773cb730e9ea0d28b0", "score": "0.5805804", "text": "def set_owner_and_roles\n if Member.where(company_id: self.company_id).count == 1\n self.add_role :director\n self.add_role :manager\n self.add_role :tradesman\n self.company.update(owner_id:self.id)\n end\n end", "title": "" }, { "docid": "010509e2044787c8e18dd08cad903372", "score": "0.5799036", "text": "def manager_name\n self.manager.name\n end", "title": "" }, { "docid": "d7ae7cac6fe58e3459fdbeb8d415d02d", "score": "0.57950085", "text": "def member?\n member.present?\n end", "title": "" }, { "docid": "962552bb14e7a8e86907e22b6ba01756", "score": "0.5792425", "text": "def should_create_manager?\n course && creator &&\n course.course_users.exists?(user: creator) &&\n !group_users.exists?(user: creator)\n end", "title": "" }, { "docid": "01c1e3e5449b232f8d7da0639387097a", "score": "0.5782021", "text": "def manager_user\n redirect_to(root_url) unless current_user.manager?\n end", "title": "" }, { "docid": "5b1a29e25f5165226eb141c6b43714fc", "score": "0.5775076", "text": "def asset_managers\n people_with_the_role(\"asset_manager\")\n end", "title": "" }, { "docid": "1307da26de06aa86a3b7435f40e1a6a1", "score": "0.57721674", "text": "def manager_roles\n\n members = []\n Role.get_open_manager_reviewer_roles.each do |role|\n entry_user = self.board_design_entry_users.detect{ |eu| eu.role_id == role.id }\n members << { :role => role,\n :member_list => role.active_users,\n :member_id => entry_user ? entry_user.user_id : 0,\n :required => !entry_user || (entry_user && entry_user.required?) }\n end\n members\n end", "title": "" }, { "docid": "1523053b10d40a7b828b706e3caa0a0f", "score": "0.57692176", "text": "def members\n self.u_members + self.g_members\n end", "title": "" }, { "docid": "19dc9403b554f4d049a3f183dfa06bba", "score": "0.57626677", "text": "def supervisors\n (self.managers + self.trustees).uniq\n end", "title": "" }, { "docid": "8293c7fdf407e3548d56598b13da559d", "score": "0.57601386", "text": "def manageable?(user)\n self == user || user&.admin?\n end", "title": "" }, { "docid": "dcea3e1fdddb1aebc738fbc4cd0f82eb", "score": "0.57552904", "text": "def ismemberof\n []\n end", "title": "" }, { "docid": "8b1884eacbef4c8c5929ce7d5e8678a7", "score": "0.5754993", "text": "def general_members\n self.members.find_all_by_role_id(MemberRole.general_role.id)\n end", "title": "" }, { "docid": "c96f1bf974b3634054f7388b0dc855f2", "score": "0.57508916", "text": "def index\n @members = Member.where(admin: false)\n end", "title": "" }, { "docid": "feb493200b30debf38cf265db47dd120", "score": "0.5747062", "text": "def has_no_selectable_managers?\n national_level_roles = [Role.ADMINISTRATOR,\n Role.CFR_FELLOW,\n Role.CITY_FINANCIAL_CONTROLLER,\n Role.NATIONAL_CFR_HEAD,\n Role.NATIONAL_FINANCIAL_CONTROLLER,\n Role.NATIONAL_EVENTS_HEAD,\n Role.CITY_PRESIDENT]\n national_level_roles.include?(self.role)\n end", "title": "" }, { "docid": "d980f6f02bf36166f6dc1d961f19fb1d", "score": "0.57437956", "text": "def is_owner\n object == current_user\n end", "title": "" }, { "docid": "cc483da3128bce100f591c48b14fda17", "score": "0.5716338", "text": "def index\n #@members = member.all\n #@members = member.with_restricted_access_access\n @members = policy_scope(Member)\n end", "title": "" }, { "docid": "6239605f04074648c8c797b6a2b12b8d", "score": "0.5703262", "text": "def members\n return @members if @members\n @members = Client.get(\"/organizations/#{id}/members/all\").json_into(Member)\n end", "title": "" }, { "docid": "c0a0f4f3890ed37bc20600d89cfee947", "score": "0.5699667", "text": "def manage?\n super || (@user && @user.is_curator?)\n end", "title": "" }, { "docid": "7f18e84ed28dc7578c054e924aae5970", "score": "0.5692907", "text": "def members\n set_group \n @members = User.joins(:groups).where(\"group_id = ? and acceptance_status = ?\", params[:id], true) if GroupsController.group_member? current_user.id, params[:id]\n end", "title": "" }, { "docid": "e7fca36b6c6ae04a57d01e48b3fa0c1f", "score": "0.5691202", "text": "def min_up_members\n super\n end", "title": "" }, { "docid": "9d1178bc42e610d6ba1191bec0c48109", "score": "0.5691182", "text": "def min_up_members_action\n super\n end", "title": "" }, { "docid": "9f81b21fa1787d5b283f9824ecf90dd8", "score": "0.56875736", "text": "def find_members \n Member.where(:user_guid => self.guid)\n end", "title": "" }, { "docid": "be5c813168ccbc11f9667faea1f7ee7b", "score": "0.56859976", "text": "def staff_member?\n admin? || staff?\n end", "title": "" }, { "docid": "87884b877d6564d46fd0077406b3cf40", "score": "0.56838423", "text": "def managed(manager_id)\n return Manage.where(\"manager_id = ?\", manager_id)\n end", "title": "" }, { "docid": "17cee61e5aea01afd91aece8b75a74a5", "score": "0.5682215", "text": "def add2(env, id)\n member = ActiveFedora::Base.find(id)\n return unless env.current_ability.can?(:edit, member)\n env.curation_concern.ordered_members << member\n end", "title": "" }, { "docid": "1fe317774c3d17b7360c7a415fd4b2ce", "score": "0.5676893", "text": "def only_members\n @requirement = Requirement.find(params[:id])\n @team = @requirement.team\n\n if current_user == nil\n flash.now[:danger] = 'Este time está privado. Você precisa estar logado.'\n redirect_to signin_path\n elsif current_user != @team.user && !current_user.member_of?(@team)\n flash[:danger] = 'Você precisa ser um membro deste time.'\n redirect_to teams_path\n else\n #nothing to do\n end\n end", "title": "" }, { "docid": "7c86c73851b32e03623d0301c1217d52", "score": "0.567584", "text": "def manager_user\n redirect_to(root_url) unless current_user.manager?\n end", "title": "" }, { "docid": "888abc96723d196b801951c5c932eb7e", "score": "0.56758124", "text": "def manage?\n @user && @user.is_admin?\n end", "title": "" }, { "docid": "1a2f8a9ead0a32c9e1ce2f25450d7489", "score": "0.56620735", "text": "def vip_member\n is_admin != true\n end", "title": "" }, { "docid": "9bb5d8a24f238d8ea4a234f9442aba1a", "score": "0.5658894", "text": "def members\n # use this method instead of the 'has_many' macro\n Member.where(\"near_node_id = ? OR far_node_id = ?\", self.id, self.id)\n end", "title": "" }, { "docid": "20872951e9cc79b3f0e380e1c80b60f9", "score": "0.5658197", "text": "def manage\n @memorials = Memorial.find_all_by_user_id(@session[:user].id)\n end", "title": "" }, { "docid": "252e2b06f6121fff319322b6d3f53f54", "score": "0.5655204", "text": "def administrators\n members.where(memberships: { role: 'admin' })\n end", "title": "" }, { "docid": "cd39ad56669746bfbebd79621bdb809d", "score": "0.5651979", "text": "def initialize(user)\n if user.role == \"member\"\n can :index, :all\n can :create, :all\n cannot :index, Passenger\n #cannot :index, Home\n # Jeder Member kann jede Übersicht außer der Übersicht der User sehen\n # und kann alle Elemente erstellen\n can [:show, :update, :destroy], Car do |car|\n car && car.user == user \n end\n can :show, user.get_visible_cars\n # Member können eigene Autos erstellen, editieren und zerstören und alle eigenen und bei teilzunehmenden Fahrten genutzten Autos anschauen \n can [:outbox, :show, :update], Message do |message|\n message && message.writer == user\n end\n can [:show, :update], Message do |message|\n message && message.receiver == user\n end\n cannot [:edit], Message do |message|\n message && message.receiver == user\n end\n # Member können alle mit ihnen in Verbindung stehenden Messages lesen und editieren\n can [:show, :update, :destroy], Request do |request|\n request && request.user == user\n end\n # Member haben kompletten Zugriff auf die eigenen Anfragen\n can :show, Trip\n can [:update, :destroy], Trip do |trip|\n trip && trip.user == user\n end\n # Member können alle Fahrten sehen, jedoch nur die eigenen verändern\n can [:update, :destroy], Rating do |rating|\n rating && rating.author == user\n end\n # Member können nur selbstgeschriebene Ratings verändern\n can :show, user.get_visible_users\n can [:show, :update, :destroy], User do |user1|\n user1 && user1 == user\n end\n # Member können alle User sehen mit denen sie eine Fahrt antreten wollen und ihren eigenen Account verändern\n\n # Rechte der Member\n elsif user.role == \"admin\"\n can :manage, :all\n # Der Admin hat vollständige Zugriffsrechte\n end\n end", "title": "" }, { "docid": "413460b4aa127a194d0e3a030726621b", "score": "0.56519336", "text": "def admin\n #manager\n #include User,CmsRole\n can :manage, :all\n end", "title": "" } ]
a265d981f0ad959f14df1b8a7c6e61cc
def index time = Time.zone.now.hour logger.info "hello" doc2 = Nokogiri::HTML(open(' array = doc2.css('td').to_a
[ { "docid": "bc9374e376d2313a30ab93e1f88dd1d6", "score": "0.6516413", "text": "def today\n\n\t\ttime = Time.zone.now.hour\n\t\tlogger.info \"hello\"\n\t\tdoc2 = Nokogiri::HTML(open('http://app2.nea.gov.sg/anti-pollution-radiation-protection/air-pollution/psi/past-24-hour-psi-readings'))\n\t\tarray = doc2.css('td').to_a\n\n\t\tarrayResult = Array.new\n\t\tarrayResult.push(array[32].content.strip)\n\t\tarrayResult.push(array[33].content.strip)\n\t\tarrayResult.push(array[34].content.strip)\n\t\tarrayResult.push(array[35].content.strip)\n\t\tarrayResult.push(array[36].content.strip)\n\t\tarrayResult.push(array[37].content.strip)\n\t\tarrayResult.push(array[38].content.strip)\n\t\tarrayResult.push(array[39].content.strip)\n\t\tarrayResult.push(array[40].content.strip)\n\t\tarrayResult.push(array[41].content.strip)\n\t\tarrayResult.push(array[42].content.strip)\n\t\tarrayResult.push(array[43].content.strip)\n\t\tarrayResult.push(array[58].content.strip)\n\n\t\tarrayResult.push(array[59].content.strip)\n\t\tarrayResult.push(array[60].content.strip)\n\t\tarrayResult.push(array[61].content.strip)\n\t\tarrayResult.push(array[62].content.strip)\n\t\tarrayResult.push(array[63].content.strip)\n\t\tarrayResult.push(array[64].content.strip)\n\t\tarrayResult.push(array[65].content.strip)\n\t\tarrayResult.push(array[66].content.strip)\n\t\tarrayResult.push(array[67].content.strip)\n\t\tarrayResult.push(array[68].content.strip)\n\t\tarrayResult.push(array[69].content.strip)\n\t\t\n\t\trender :json => arrayResult\n\tend", "title": "" } ]
[ { "docid": "256baaf554c4a93a3f1c1a79a8b3f207", "score": "0.6142688", "text": "def print_html_time()\n @noko.css(\"li.g:first-of-type\").each do |e|\n puts e\n end\n end", "title": "" }, { "docid": "e5c35e19022c1e041614ee9923d2bad5", "score": "0.57693136", "text": "def scrapping_name\n page = Nokogiri::HTML(open(\"https://coinmarketcap.com/all/views/all/\")) \n name_array = Array.new\n (0..200).each do |x|\n name_array << page.xpath(\"//table/tbody/tr[#{x}]/td[3]\").text\n puts \"scrapping : \" + name_array[x]\n end \n return name_array\nend", "title": "" }, { "docid": "50860c51ed9343963132f560199d9661", "score": "0.5746963", "text": "def parse_wa()\n state = \"WA\";\n url = 'https://www.doh.wa.gov/emergencies/coronavirus'\n\n browser = Watir::Browser.new\n browser.goto(url);\n\n sleep 10\n\n html = browser.html\n doc = Nokogiri::HTML.parse(html)\n \n tnow = DateTime.now().strftime();\n\n output_fn = \"data/\"+tnow+'_USA_'+state+'.html';\n f = File.open(output_fn,\"w\");\n\n f.puts(doc)\n \n# list_of_tables = doc.css(\"//table\");\n\n# for table in list_of_tables\n# f.puts(table)\n# end\n\n f.close();\n browser.close(); \n return ;\nend", "title": "" }, { "docid": "a4f42d64a0403c3955fed391c0140906", "score": "0.569869", "text": "def get_time()\n return @noko.css(\"li.g:first-of-type table table\")[0].text\n end", "title": "" }, { "docid": "08ecd7fb27d1fa419179865020325a83", "score": "0.55922043", "text": "def date_time_url\n @slowest_time= 0\n print \"\\nTotal requests grouped by the Date/hour\\n\\n\"\n\t\t\n #taking each date&hour\n @count.each do|val1,val2|\n slowest = 0\n \n #searching on each line to find slowest\n $file.each_line do|line|\n\tif line.include? val1\n\t time = line.match /\\d+$/\n\t if time\n\t #finding slowest time\n\t time = time[0].to_i\n\t if time > slowest\n\t slowest = time\n\t end\n\t end\n\tend\n\tslowest = slowest.to_s\n\t#finding slowest url in corresponding date\n\tif line.include? slowest\n\t @url = line.match /https?:\\/\\/[\\S]+/.to_s\n\tend\n\tslowest = slowest.to_i\n end\n \n #checking plural form of request.\n request = \"request\"\n if val1.to_i > 1\n\trequest += \"s\"\n end \n print \"#{ val1 } : #{ val2 } #{ request } \\tSlowest-Time : #{ slowest } \\tSlowest-URL : #{ @url }\\n\\n\"\n \n #finding slowest URL in the log.\n if slowest > @slowest_time\n @slowest_time = slowest\n @slowest_url = @url\n end\n end \n print \"Slowest URL : #{ @slowest_url }\\n\"\n end", "title": "" }, { "docid": "35f792df3ded4f368cf517fd8cb51194", "score": "0.55851513", "text": "def parse_vt()\n state = \"VT\";\n url = 'https://www.healthvermont.gov/response/infectious-disease/2019-novel-coronavirus'\n\n browser = Watir::Browser.new\n browser.goto(url);\n\n doc = Nokogiri::HTML.parse(browser.html)\n \n tnow = DateTime.now().strftime();\n\n output_fn = \"data/\"+tnow+'_USA_'+state+'.html';\n f = File.open(output_fn,\"w\");\n\n f.puts(doc)\n \n# list_of_tables = doc.css(\"//table\");\n\n# for table in list_of_tables\n# f.puts(table)\n# end\n\n f.close();\n browser.close(); \n return ;\nend", "title": "" }, { "docid": "372b923d1f2d74e50dbc2ec38870472e", "score": "0.555982", "text": "def parse_v2(doc,of,version,debug)\n\n time_stamp = parse_time_stamp(doc,debug,of);\n#------------------------------------------------------------------------------\n# parse yesterday's table data\n# it looks that if I use '//td', then all rows in all tables in the list are returned\n# expect only one table\n#------------------------------------------------------------------------------\n table = doc.xpath(\"//table[@id='usa_table_countries']\");\n if (table.length != 1) then\n printf(\"TROUBLE: ntables: %i, expected 1\\n\",table.length)\n end\n\n print_header(of)\n \n rows = table.xpath('tbody/tr')\n \n for row in rows\n cells = row.xpath('td')\n r = parse_cells(cells,time_stamp,version);\n print_record_to_file(r,of)\n end\n\n return ;\n end", "title": "" }, { "docid": "f9013374e8f784942ea4226a63056182", "score": "0.5555754", "text": "def coins\n page = Nokogiri::HTML(open(\"https://coinmarketcap.com/all/views/all/\")) \n name_array = Array.new\n (0..200).each do |x|\n name_array << page.xpath(\"//table/tbody/tr[#{x}]/td[3]\").text\n end \n return name_array\nend", "title": "" }, { "docid": "98668c71dac866a36999792902538bb6", "score": "0.5518702", "text": "def get_townhall_email\n array1 = []\n get_townhall_urls.each do |i|\n url = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/#{i}\"))\n n = url.xpath('/html/body/div/main/section[2]/div/table/tbody/tr[4]/td[2]')\n array1 << n.text.to_s\n end\n return array1\nend", "title": "" }, { "docid": "efbdbf7565253fcf151433ec607303e4", "score": "0.55101407", "text": "def recolte_monnaie\npage = Nokogiri::HTML(open(\"https://coinmarketcap.com/all/views/all/\")) \n#puts page.class # => Nokogiri::HTML::Document\n#téléchargement de l'ensemble des symboles\nmonnaie_temp = page.xpath('//*[@id]/td[3]')\n# conservation du texte\nmonnaie_final = monnaie_temp.map { |string| string.text }\nend", "title": "" }, { "docid": "d213ddda724613c2cc1f205f4b533aff", "score": "0.55083054", "text": "def parse_v1(doc, of, version, debug)\n#------------------------------------------------------------------------------\n# parse yesterday's table data\n# it looks that if I use '//td', then all rows in all tables in the list are returned\n# table id's : 'usa_table_countries_today' and 'usa_table_countries_yesterday'\n#------------------------------------------------------------------------------\n time_stamp = parse_time_stamp(doc,debug,of).prev_day();\n tables = doc.xpath(\"//div[@class='container']/div/div/div/div/div/table\");\n printf(\"ntables: %i\\n\",tables.length)\n\n for table in tables\n \n if (debug > 0) then\n of.printf(\"------------- //table ID: %s\\n\",table['id'])\n of.puts(table)\n end\n \n if (table['id'] == 'usa_table_countries_yesterday') then\n print_header(of)\n rows = table.xpath('tbody/tr')\n for row in rows\n cells = row.xpath('td')\n r = parse_cells(cells,time_stamp,version);\n print_record_to_file(r,of); # print record to a file\n end\n end\n end\n\n return ;\n end", "title": "" }, { "docid": "91739e40c034d96f85c87c013c0a1e7e", "score": "0.5495663", "text": "def get_index\n # url = \"http://marketdata.set.or.th/mkt/marketsummary.do?language=th&country=TH\"\n # file = File.open('tmp/sample_index.html','w') do |f|\n # f.binmode\n # f << open(url).read\n # end\n file_name= 'tmp/sample_index.html'\n f = File.read(file_name)\n doc = Nokogiri::HTML(f)\n set_index = doc.css('tr:nth-child(8) td')[1].text\n render :text => string2f(set_index)\n end", "title": "" }, { "docid": "813b7282dd8f8eb82e4acbba4f74ddb1", "score": "0.5488256", "text": "def parse_timesheet\n @page.body.scan(/TCMS.oTD.push\\((\\[.*\\])\\)/).map do |match|\n row = match[0].gsub(/\"/, '').split(',')\n row.map { |x|\n CGI.unescape(x.strip).delete('[]')\n }.values_at(0, 7, 8, 9, 11, 12, 14, 15, 32, 1)\n end\n end", "title": "" }, { "docid": "3abfcd6da07e5f0fee6ac12dbfcfc692", "score": "0.5413673", "text": "def debug_v2(doc, of, version, debug = 1)\n#------------------------------------------------------------------------------\n# parse yesterday's table data\n# it looks that if I use '//td', then all rows in all tables in the list are returned\n# starting from Mar 19 table ID : 'usa_table_countries_today' and 'usa_table_countries_yesterday'\n# Mar 09 - Mar 18 : 'usa_table_countries'\n#------------------------------------------------------------------------------\n time_stamp = parse_time_stamp(doc,debug,of);\n table = doc.xpath(\"/div/table[@id='usa_table_countries']\");\n printf(\"ntables: %i\\n\",table.length)\n \n of.printf(\"------------- //table TODAY Mar 18 or before\\n\") if (debug > 0);\n rows = table.xpath('tbody/tr')\n for row in rows\n cells = row.xpath('td')\n r = parse_cells(cells,time_stamp)\n print_record(r,of);\n end\n of.puts(table) if (debug > 0)\n\n return ;\n end", "title": "" }, { "docid": "6ebea05a66f793a9b1a556405935414f", "score": "0.541075", "text": "def time_body\n content_tag :tbody do\n time_rows\n end\n end", "title": "" }, { "docid": "9d461de952b4411895b54fd251773c43", "score": "0.53757477", "text": "def parse_nj()\n state = \"NJ\";\n# url = 'https://www.nj.gov/health/cd/topics/covid2019_dashboard.shtml'\n url = 'https://maps.arcgis.com/apps/opsdashboard/index.html#/ec4bffd48f7e495182226eee7962b422'\n browser = Watir::Browser.new\n browser.goto(url);\n sleep 10\n \n doc = Nokogiri::HTML.parse(browser.html())\n browser.close();\n \n tnow = DateTime.now().strftime();\n\n output_fn = \"data/\"+tnow+'_USA_'+state+'.html';\n f = File.open(output_fn,\"w\");\n\n f.puts(doc)\n \n# list_of_tables = doc.css(\"//table\");\n\n# for table in list_of_tables\n# f.puts(table)\n# end\n\n f.close();\n \n return ;\nend", "title": "" }, { "docid": "4a2fe7acd4cf46dbbaeacb49ce98eb34", "score": "0.53572255", "text": "def page_reading\n page = Nokogiri::HTML(open(\"https://coinmarketcap.com/all/views/all/\"))\n crypto_name_array = []\n crypto_value_array = []\n\n # on récupère \n page.xpath('//tr/td[3]/div').each do |crypto|\n crypto_name_array.push(crypto.text)\n end\n\n page.xpath('//tr/td[5]/div').each do |value|\n crypto_value_array.push(value.text)\n end\n\n general_array = crypto_name_array.zip(crypto_value_array).map { |x, y| {x=>y.delete('$,').to_f}}\n\n return general_array\n\nend", "title": "" }, { "docid": "817b967f95d2bfdc967b543f81b1a39d", "score": "0.53526783", "text": "def parse_dailydev_page\n start = Time.now\n items = @page.search('.ddinfo')\n if items.any?\n items.each do |item|\n desc = item.search('.foot').empty\n desc = item.inner_text.strip\n link_el = item.search('a').select { |item| /\\/deviation\\// === item.attributes['href'] }.first\n link = link_el.attributes['href']\n title = link_el.inner_text\n @daily_data << { :title => title, :desc => desc, :link => link }\n end\n end\n Time.now - start\n end", "title": "" }, { "docid": "0f09bb36b334113d6796af8a257506ab", "score": "0.53203374", "text": "def time\n on_each_node :time\n end", "title": "" }, { "docid": "31b9294c342ba1e422debd8ec4c38785", "score": "0.5282876", "text": "def get_data(doc)\n snapshots = doc.xpath(\"//Cube[@time]\")\n snapshots.each do |snapshot|\n date_str = snapshot.attr(\"time\")\n date = Date.parse(date_str)\n last_date_processed(date)\n if (date <= @last_date_processed) || @last_date_processed.nil?\n output = {}\n snapshot.children.each do |rate|\n currency = rate.attr('currency')\n rate = rate.attr('rate')\n output[currency] = rate.to_f\n @context.options[:store][date] = output\n end\n end\n end\n end", "title": "" }, { "docid": "7d1b6cc138e5bc57750c3c563e202b66", "score": "0.5275664", "text": "def parse_nh()\n state = \"NH\";\n url = 'https://www.nh.gov/covid19/'\n\n browser = Watir::Browser.new\n browser.goto(url);\n doc = Nokogiri::HTML.parse(browser.html())\n browser.close();\n \n tnow = DateTime.now().strftime();\n\n output_fn = \"data/\"+tnow+'_USA_'+state+'.html';\n f = File.open(output_fn,\"w\");\n\n f.puts(doc)\n \n# list_of_tables = doc.css(\"//table\");\n\n# for table in list_of_tables\n# f.puts(table)\n# end\n\n f.close();\n \n return ;\nend", "title": "" }, { "docid": "90a52e235925ef7bd7a37b15f4ae09ee", "score": "0.5268768", "text": "def html_parser(file)\n\n\tpage = Nokogiri::HTML(open(file))\n\n\ttags = page.css(\".started\")\n\ttags.each do |tag| \n\t\t$tweets << {:timestamp => tag.text.strip, :tag => file} \n\tend\n\tp \"Successfully parsed #{file}\"\n\treturn tags\n\nend", "title": "" }, { "docid": "567d65ca18a88bd5a339b3fa26fc371a", "score": "0.5266515", "text": "def log_page(page)\n time = Time.now\n content = page.output.gsub /::time::/ do\n \"<time datetime='#{time.utc.iso8601}'>#{time.localtime.strftime('%Y-%m-%d %H:%M:%s')}</time>\"\n end\n \n file = page.destination page.site.config['destination']\n File.open(file, 'w') { |f| f.write content }\n end", "title": "" }, { "docid": "fab6ead5b165af9ef142a0a602db1924", "score": "0.52663803", "text": "def date\n page.at_xpath(\"//table[@class='MsoNormalTable']/tbody/tr/td[4]/p\").inner_html\n end", "title": "" }, { "docid": "a122ddc73cda2a06620320dfd0353d47", "score": "0.52594244", "text": "def get_the_email_of_a_townhal_from_its_webpage\ndoc = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/95/vaureal.html\"))\n\temail = doc.xpath('/html/body/div/main/section[2]/div/table/tbody/tr[4]/td[2]')\n\tputs email\nend", "title": "" }, { "docid": "2a1e8d9d23aafc88bea1cc69f39697f7", "score": "0.525677", "text": "def issue_date( html )\r\n return Date.parse(html.xpath('//table/tr[2]/td[2]/b/text()')[0].to_s.strip)\r\nend", "title": "" }, { "docid": "d27d86ae8edd549276620a23f3c2f24e", "score": "0.5228156", "text": "def get_dobayashi_result\n Anemone.crawl(DOBAYASHI_URL, @options) do |anemone|\n anemone.on_every_page do |page|\n doc = Nokogiri::HTML.parse(page.body.toutf8)\n doc.xpath('//div[@class=\"PlayerAdBox mb15\"]').each do |node|\n node.xpath('//tr[@class=\"yjM\"]/td').each do |elem|\n p elem.text\n end\n end\n end\n end\n end", "title": "" }, { "docid": "d30607d35e7da0c3e56b89e6467f4de7", "score": "0.51682216", "text": "def nsewc\n\t\tif params[\"type\"] == \"three\"\n\t\t\ttime = Time.zone.now.hour\n\t\t\tdoc2 = Nokogiri::HTML(open('http://app2.nea.gov.sg/anti-pollution-radiation-protection/air-pollution/psi/past-24-hour-psi-readings'))\n\t\t\tarray = doc2.css('td').to_a\n\t\t\tarrayResult = Array.new\n\t\t\tarrayResult.push(array[1].content.strip)\n\t\t\tarrayResult.push(array[4].content.strip)\n\t\t\tarrayResult.push(array[7].content.strip)\n\t\t\tarrayResult.push(array[10].content.strip)\n\t\t\tarrayResult.push(array[13].content.strip)\n\n\t\t\trender :json => arrayResult\n\t\telsif params[\"type\"] == \"twofive\"\n\t\t\ttime = Time.zone.now.hour\n\t\t\tdoc2 = Nokogiri::HTML(open('http://app2.nea.gov.sg/anti-pollution-radiation-protection/air-pollution/psi/past-24-hour-psi-readings'))\n\t\t\tarray = doc2.css('td').to_a\n\t\t\tarrayResult = Array.new\n\t\t\tarrayResult.push(array[2].content.strip)\n\t\t\tarrayResult.push(array[5].content.strip)\n\t\t\tarrayResult.push(array[8].content.strip)\n\t\t\tarrayResult.push(array[11].content.strip)\n\t\t\tarrayResult.push(array[14].content.strip)\n\t\t\trender :json => arrayResult\n\t\telse\n\t\t\ttime = Time.zone.now.hour\n\t\t\tdoc2 = Nokogiri::HTML(open('http://app2.nea.gov.sg/anti-pollution-radiation-protection/air-pollution/psi/past-24-hour-psi-readings'))\n\t\t\tarray = doc2.css('td').to_a\n\t\t\tarrayResult = Array.new\n\t\t\tarrayResult.push(array[2].content.strip)\n\t\t\tarrayResult.push(array[5].content.strip)\n\t\t\tarrayResult.push(array[8].content.strip)\n\t\t\tarrayResult.push(array[11].content.strip)\n\t\t\tarrayResult.push(array[14].content.strip)\n\t\t\trender :json => arrayResult\n\t\tend\n\tend", "title": "" }, { "docid": "a9c4bb381e931f99a3216eb7caa99ea5", "score": "0.51610583", "text": "def get_page_results(date_str)\n url = \"http://sfbay.craigslist.org/sfc/pet/\"\n page = Nokogiri::HTML(open(url))\n\n rows = page.css(\".row .txt\").map do |row|\n {date: row.css(\".pl .date\").text,\n title: row.css(\".pl a\").text,\n loc: row.css(\".l2 .pnr small\").text,\n pic: row.css(\".l2 .pnr .px .p\").text}\n end\n\n get_todays_rows(rows, date_str)\nend", "title": "" }, { "docid": "f444574bf19438e69647e2780c80844f", "score": "0.5160389", "text": "def ot_parser\n # check for params\n puts \">>> PARAMS:\"\n ap params\n \n # Init times array\n response = {}\n # puts '>>> has params check here'\n if params.has_key?(:uid) && params.has_key?(:s) && params.has_key?(:d) && params.has_key?(:t)\n place = Place.find_by_uid(params[:uid])\n end\n \n puts '>>> place:'\n ap place\n \n # See if exists in OT / get Restuarant ID\n if place && place.ot_rid.nil?\n puts '>>> See if exists in OT'\n place.ot_rid = ot_rid(place)\n place.save!\n end\n \n if place && place.ot_rid && place.ot_rid != \"f\"\n # >>> Step 2 - get Times\n # http://m.opentable.com/search/results?Date=2012-12-19T00%3A00%3A00&TimeInvariantCulture=0001-01-01T19%3A30%3A00&PartySize=2&RestaurantID=47\n base_url = 'http://m.opentable.com'\n base_search_url = base_url + '/search/results'\n party_size = params[:s]\n date = params[:d]\n time = params[:t]\n query = '?' + 'Date=' + (CGI::escape date) + '&TimeInvariantCulture=' + (CGI::escape time) + '&PartySize=' + (CGI::escape party_size) + '&RestaurantID=' + place.ot_rid\n url = base_search_url + query\n \n puts '>>> open table url:'\n ap url\n \n # Get a Nokogiri::HTML::Document for the page we’re interested in...\n doc = Nokogiri::HTML(open(url))\n \n # times results array\n times = []\n \n # Search for nodes by css\n doc.css('ul#ulSlots li.ti a').each do |link|\n # doc.css('#ulSlots li a').each do |link|\n time = {}\n time[\"url\"] = base_url + link['href']\n time[\"time\"] = link.content.strip\n \n times << time\n end\n \n if times.empty?\n response[:error] = { :exists => \"true\", :error => \"true\", :url => url }\n else\n response[:error] = { :exists => \"true\", :error => \"false\", :url => url }\n response[:times] = times\n end\n else\n response[:error] = { :exists => \"false\" }\n end\n \n puts '>>> response:'\n ap response\n \n render json: response\n end", "title": "" }, { "docid": "465305102872775862c727f1fdfb4e74", "score": "0.5159853", "text": "def time_file (doc2, estimate)\n\n#Hash to store the count of [Next], [Submit], etc.\n\tcounthash = Hash.new\n\tcounthash[\"[Next]\"] = 0\n\tcounthash[\"[Submit]\"] = 0\n\n#TO DO: update so that it finds the search criteria from the entered keywords\n# Count the number of [Next]s, [Submit, Long]s\n# and multiply by the time assigned to each keyword\n\tdoc2.paragraphs.each do |p|\n\t\tcounthash[\"[Next]\"] += 6*p.to_s.scan(/(\\[(n|N)ext)|((n|N)ext\\])/).size\n\t\tcounthash[\"[Submit]\"] += estimate*p.to_s.scan(/\\[(S|s)ubmit/).size\n\tend\n\n#prints times associated with [Next], [Submit, *], etc.\n\treturn counthash\n\nend", "title": "" }, { "docid": "7fb8bccd4ce473e6f1fe94ccfe5e4cb6", "score": "0.5159642", "text": "def index\n require 'open-uri'\n \n url = \"http://www.sii.cl/pagina/valores/uf/uf2017.htm\"\n html = open(url).read\n time = Time.now\n mes = (time.strftime(\"%m\").to_i) +1\n dia = time.strftime(\"%d\")\n \n @uf = Nokogiri::HTML(html).css(\"tbody tr[#{dia}] td[#{mes}]\").text\n\n link = open(\"http://v2.jaidefinichon.com/\").read\n \n expansions = Nokogiri::HTML(link).css('.image_post img')\n\n\n expansions.each do |exp|\n Expansion.create(\n :link => exp[:src])\n end\n\n @expansions = Expansion.all\n end", "title": "" }, { "docid": "61d9e0ead514d8a97c0ea4a02b5dc331", "score": "0.5157504", "text": "def get_townhall_email\n oui = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/83/toulon.html\"))\n email = oui.xpath ('//*[contains(text(), \"@\")]')\n email_array = []\n email.each do |index_email|\n email_array << index_email.text\n end\n puts email_array\nend", "title": "" }, { "docid": "0436e92a85e716cfcf1ba72f8f89d269", "score": "0.51439285", "text": "def report_time time\n end", "title": "" }, { "docid": "57f9f76c8aac447fb2c077a552518930", "score": "0.5143263", "text": "def scraper(url2)\n dataUrl = Nokogiri::HTML(open(\"http://www.timeout.com#{url2}\"))\n linksUrl = dataUrl.css('#content')\n \n linksUrl.each do |review|\n arr = []\n # name\n arr << review.css('h1.listing_page_title').text.strip\n # neighborhood\n arr << review.css('span.listings_flag').text.strip\n # street-address\n #arr << review.css('span.street-address').text.strip\n # summary\n arr << review.css('h2.review__summary').text.strip\n # food rating\n arr << review.css('ul.star_rating li.sr-only').text[0]\n #cost rating\n arr << review.css('span.listings_flags__price li.icon_highlight').count\n\n return arr\n end \nend", "title": "" }, { "docid": "a3243781198416bc483490f754b75b71", "score": "0.5140454", "text": "def get_hits(timestamp)\n \n end", "title": "" }, { "docid": "8377b530350e199d3799f7c955ccc688", "score": "0.51184684", "text": "def get_html_stats()\n\t\t\t\thtml = %Q{\n\t\t\t\t\t<html><head>\n\t\t\t\t\t\t<script src=\"#{XSSF_GUI_FILES}swfobject.js\" type=\"text/javascript\"></script>\n\t\t\t\t\t\t<script type=\"text/javascript\">\n\t\t\t\t\t\t\tfunction createXHR() {\n\t\t\t\t\t\t\t\tif (window.XMLHttpRequest) return new XMLHttpRequest();\n\t\t\t \n\t\t\t\t\t\t\t\tif (window.ActiveXObject) {\n\t\t\t\t\t\t\t\t\tvar names = [\"Msxml2.XMLHTTP.6.0\", \"Msxml2.XMLHTTP.3.0\", \"Msxml2.XMLHTTP\", \"Microsoft.XMLHTTP\"];\n\t\t\t\t\t\t\t\t\tfor(var i in names) {\n\t\t\t\t\t\t\t\t\t\ttry{ return new ActiveXObject(names[i]); }\n\t\t\t\t\t\t\t\t\t\tcatch(e){}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\tfor i in (1..5)\n\t\t\t\t\thtml << %Q{ \n\t\t\t\t\t\tswfobject.embedSWF(\"#{XSSF_GUI_FILES}ofc.swf\", \"gr#{i}\", \"100%\", \"275\", \"9.0.0\", \"expressInstall.swf\", {\"data-file\":\"#{VICTIM_GUI}?#{PARAM_GUI_JSON}%3Dgr#{i}%26#{PARAM_GUI_PAGE}%3Dstat\"});\n\t\t\t\t\n\t\t\t\t\t\tsetInterval(update#{i}, 3000);\n\t\t\t\t\t\t\n\t\t\t\t\t\tfunction update#{i}() {\n\t\t\t\t\t\t\tchart_#{i} = document.getElementById(\"gr#{i}\");\n\n\t\t\t\t\t\t\txhr#{i} = createXHR();\n\t\t\t\t\t\t\txhr#{i}.open(\"GET\", '#{VICTIM_GUI}?#{PARAM_GUI_JSON}=gr#{i}&#{PARAM_GUI_PAGE}=stat&time=' + escape(new Date().getTime()), true);\n\t\t\t\t\t\t\txhr#{i}.send(null);\n\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\txhr#{i}.onreadystatechange=function() {\tif (xhr#{i}.readyState == 4) { chart_#{i}.load(xhr#{i}.responseText); } }\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\tend\n\n\t\t\t\thtml << %Q{\t\t\t\t\t\n\t\t\t\t\t</script>\n\t\t\t\t\t</head><body bgcolor=black style='font-family:monospace'>\n\t\t\t\t\t\t<table width=100% height=95% cellpadding=0 cellspacing=0 cellmargin=0 BORDER>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td><div id=\"gr1\"></div></td><td><div id=\"gr3\"></div></td><td rowspan=2 width=40%><div id=\"gr5\"></div></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t\t<tr>\n\t\t\t\t\t\t\t\t<td><div id=\"gr2\"></div></td><td><div id=\"gr4\"></div></td>\n\t\t\t\t\t\t\t</tr>\n\t\t\t\t\t\t</table>\n\t\t\t\t\t\t<center><div style=\"color:white\">Charts provided by <a href=\"javascript: top.location='http://teethgrinder.co.uk/open-flash-chart/'\">\"Open Flash Chart\"</a></div></center>\n\t\t\t\t\t</body></html>\n\t\t\t\t}\n\t\t\t\t\n\t\t\t\treturn html\n\t\t\tend", "title": "" }, { "docid": "7d5d7d02a0914bd2ae913f882294a3d5", "score": "0.51171285", "text": "def parse_web(table_cells)\nend", "title": "" }, { "docid": "c6a35c1e45ecf0fe3a35c449d18f2df1", "score": "0.5116704", "text": "def now_temp\n @now_temp = @doc.xpath(\"//span[@class='temp swip']\").text\n end", "title": "" }, { "docid": "f5f71db241c796f5b31d1474a7efdd34", "score": "0.51158005", "text": "def get_jogos\n @dt = Array.new; @dados = \"\"; vetor = Array.new; contador=0;\n @doc[\"entry\"].each do |pontos| \n #p \"Contador: #{contador}\"\n linha = pontos[\"cell\"][0][\"row\"]\n coluna = pontos[\"cell\"][0][\"col\"] \n valor = pontos[\"cell\"][0][\"inputValue\"]\n #pega as datas dos jogos\n if linha.to_i > 2 && contador > 3\n p \"Jogo: #{valor} #{pontos[\"cell\"][0][\"col\"][2]} #{pontos[\"cell\"][0][\"col\"][3] } X #{pontos[\"cell\"][0][\"col\"][5] } #{pontos[\"cell\"][0][\"col\"][6] } \"\n end#fim da linha\n \n contador += contador\n# if coluna == \"2\"\n# if linha.to_i > 2\n# pp \"Jogador A: #{valor} #{contador}\"\n# jogador_a = valor\n# @dados += valor + \" \"\n# end \n# end\n# \n# if coluna == \"3\"\n# if linha.to_i > 2\n# pp \"Pontos A: #{valor} #{contador}\"\n# pontos_a = valor\n# @dados += valor + \" \"\n# end\n# end\n# \n# if coluna == \"4\"\n# if linha.to_i > 2\n# pp \"Versus: #{valor} #{contador}\"\n# versus = valor\n# @dados += valor + \" \"\n# end\n# end\n# \n# if coluna == \"5\"\n# if linha.to_i > 2\n# pp \"Pontos B: #{valor} #{contador}\"\n# pontos_b = valor\n# @dados += valor + \" \"\n# end\n# end\n# \n# if coluna == \"6\"\n# if linha.to_i > 2\n# pp \"Jogador: #{valor} #{contador}\"\n# jogador_b = valor\n# @dados += valor\n# end\n# end\n \n end#fim teste principal\n end", "title": "" }, { "docid": "e4c207f935146796bf5c6af1d28b9b6e", "score": "0.5115522", "text": "def get_townhall_email\r\n @citys_list.each do |city|\r\n city_page = Nokogiri::HTML(URI.open(\"http://annuaire-des-mairies.com/95/#{city}.html\"))\r\n email = city_page.css('td')[7].text\r\n @citys_mail << email\r\n end\r\nend", "title": "" }, { "docid": "0708840368ed2f99980e1981ee0e8646", "score": "0.5113483", "text": "def scrape_table(page_body)\n i=0\n \n data_table = Nokogiri::HTML(page_body).css('table#ctl00_ContentPlaceHolder1_tab21_GVProcesos tr').collect do |row|\n #puts row\n if i==0 then\n i=i+1\n else\n if i<7 and row.css('td')[0].inner_text.include? \"/\" then\n puts row.css('td')[3].css('a').attr('href')\n record = {}\n record['Fecha'] = row.css('td')[0].inner_text\n record['Proceso'] = row.css('td')[1].inner_text\n record['Comentario'] = row.css('td')[2].inner_text\n record['URL'] = row.css('td')[3].css('a').attr('href')\n ScraperWiki.save_sqlite([\"URL\"], record)\n i=i+1\n end\n end\n end\nend", "title": "" }, { "docid": "0708840368ed2f99980e1981ee0e8646", "score": "0.5113483", "text": "def scrape_table(page_body)\n i=0\n \n data_table = Nokogiri::HTML(page_body).css('table#ctl00_ContentPlaceHolder1_tab21_GVProcesos tr').collect do |row|\n #puts row\n if i==0 then\n i=i+1\n else\n if i<7 and row.css('td')[0].inner_text.include? \"/\" then\n puts row.css('td')[3].css('a').attr('href')\n record = {}\n record['Fecha'] = row.css('td')[0].inner_text\n record['Proceso'] = row.css('td')[1].inner_text\n record['Comentario'] = row.css('td')[2].inner_text\n record['URL'] = row.css('td')[3].css('a').attr('href')\n ScraperWiki.save_sqlite([\"URL\"], record)\n i=i+1\n end\n end\n end\nend", "title": "" }, { "docid": "0708840368ed2f99980e1981ee0e8646", "score": "0.5113483", "text": "def scrape_table(page_body)\n i=0\n \n data_table = Nokogiri::HTML(page_body).css('table#ctl00_ContentPlaceHolder1_tab21_GVProcesos tr').collect do |row|\n #puts row\n if i==0 then\n i=i+1\n else\n if i<7 and row.css('td')[0].inner_text.include? \"/\" then\n puts row.css('td')[3].css('a').attr('href')\n record = {}\n record['Fecha'] = row.css('td')[0].inner_text\n record['Proceso'] = row.css('td')[1].inner_text\n record['Comentario'] = row.css('td')[2].inner_text\n record['URL'] = row.css('td')[3].css('a').attr('href')\n ScraperWiki.save_sqlite([\"URL\"], record)\n i=i+1\n end\n end\n end\nend", "title": "" }, { "docid": "0708840368ed2f99980e1981ee0e8646", "score": "0.5113483", "text": "def scrape_table(page_body)\n i=0\n \n data_table = Nokogiri::HTML(page_body).css('table#ctl00_ContentPlaceHolder1_tab21_GVProcesos tr').collect do |row|\n #puts row\n if i==0 then\n i=i+1\n else\n if i<7 and row.css('td')[0].inner_text.include? \"/\" then\n puts row.css('td')[3].css('a').attr('href')\n record = {}\n record['Fecha'] = row.css('td')[0].inner_text\n record['Proceso'] = row.css('td')[1].inner_text\n record['Comentario'] = row.css('td')[2].inner_text\n record['URL'] = row.css('td')[3].css('a').attr('href')\n ScraperWiki.save_sqlite([\"URL\"], record)\n i=i+1\n end\n end\n end\nend", "title": "" }, { "docid": "b90e618754c8cea376ab5bebc4ae48b9", "score": "0.51132613", "text": "def get_page_results(date_str)\n url = \"http://losangeles.craigslist.org/search/lac/pet\"\n page = Nokogiri::HTML(open(url))\n\n # map page elements to a hash with date, title, location\n all_rows = page.css(\".row .txt\").map do |row| {\n date: row.css(\".pl time\").text,\n title: row.css(\".pl a\").text,\n location: row.css(\".l2 .pnr small\").text,\n pic: row.css(\"span .p\").text\n }\n end\n\n get_todays_results(all_rows, date_str)\nend", "title": "" }, { "docid": "4f57cd79ece89f0dacf1c758f043b88c", "score": "0.51079637", "text": "def\tlottery(kind,time=Time.now)\n\tdate = time.strftime('%F')\n\tdata = []\n\tdoc = Nokogiri::HTML(open(\"http://baidu.lecai.com/lottery/draw/list/#{kind}?d=#{date}\"))\n\tdoc.search('tbody').each do |node|\n\t node.search('tr').each do |nd|\n\t\tline = []\n\t\tnd.content.split.each do |n|\n\t\t\tline.push n\n\t\tend\n\t\tdata.push line\n\t end\n end\n return data\nend", "title": "" }, { "docid": "d12828e9e00e80246d37d76f5acf5562", "score": "0.50981396", "text": "def essai\n\npage = Nokogiri::HTML(open('https://coinmarketcap.com'))\nresult = page.css('tbody tr').each do |tr|\n id = tr.css(\"currency-name\").text\n price = tr.css(\"price\").text \n puts id + \"vaut aujourd'hui\" + price\nend\nend", "title": "" }, { "docid": "52417761c93aab39ff2b460df5c08010", "score": "0.50953233", "text": "def return_durations_array(doc)\n durations = doc.css(\".search-content .teaser-item__info-item--total-time\")\n recipe_durations = []\n durations.each do |element|\n recipe_durations << element.text.strip\n end\n return recipe_durations\n end", "title": "" }, { "docid": "27290a448336e5b028ecfeade616e507", "score": "0.5087184", "text": "def read_html\n array = nodes.to_a\n array.each_with_index do |node, index|\n header = (index.modulo(10) == 0) ? \"<h2>!!!!!SLOW DOWN AND ENUNCIATE!!!!!</h2>\" : \"\"\n anchor = \"<a id=section_#{index} href=/pages/#{self.id}/edit?section=#{index}>#{index}</a>\"\n type = nodes.at(index).name\n array[index]=nodes.at(index).replace \"#{header}<#{type}>#{anchor} #{nodes.at(index).inner_html}</#{type}>\"\n end\n array.map(&:to_html).join\n end", "title": "" }, { "docid": "274f0cc3b1276bab70e9e3af41388185", "score": "0.5080377", "text": "def inn\n raw = @doc.css('.table')[0].css('tr')[3].css('td')[1].text\n end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.50781673", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.50781673", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.50781673", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.50781673", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.50781673", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.50781673", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.50781673", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.50781673", "text": "def time; end", "title": "" }, { "docid": "d67a5209cbeedf518097d2a6c15dc1d1", "score": "0.50781673", "text": "def time; end", "title": "" }, { "docid": "e8a45e9349fef7075e1e70482301b9d1", "score": "0.5071931", "text": "def extract_timesheet\n @page.parser.css(\".ErrorText\").each do |n|\n puts \"ERROR: #{n.text}\"\n end\n\n timesheet = parse_timesheet\n\n department = timesheet.first[6]\n employee_id = timesheet.first[7]\n error = timesheet.first[9]\n\n puts \"ERROR: #{error}\" if error\n\n puts \"Employee #{@username} id #{employee_id}, department #{department}\"\n\n puts \"-\" * 80\n\n date = nil\n last_date = nil\n\n timesheet.each do |row|\n date = row[2]\n\n if row[0] == '0' and date == last_date then\n # do nothing\n elsif row[0] == '0' then\n puts \"#{row[2]} no time entered\"\n elsif date == last_date then\n puts \" %s to %s for %3s hours %s\" % row.values_at(3, 4, 5, 8)\n else\n puts \"%s %s to %s for %3s hours %s\" % row.values_at(2, 3, 4, 5, 8)\n end\n\n last_date = date\n end\n end", "title": "" }, { "docid": "36a259f43242c9b65f1ab8582e6cbea6", "score": "0.5058218", "text": "def get_the_email_of_a_townhal_from_its_webpage(page , lien, n_ville)\n\tv_lien = \"\"\n\tpage.css('a[class = lientxt]').each{|y| v_lien = lien.slice(0..30) + y['href'].slice(1..(y['href'].to_s.length)) if y.text == n_ville}\n\tpage_2 = Nokogiri::HTML(open(v_lien))\n \tpage_2.css('td')[7].text\nend", "title": "" }, { "docid": "b55bb9edbda0286ae7284a5cc105fa7a", "score": "0.504909", "text": "def nowFromPage\n request ||= requestHtml\n {\n :last_update => request.xpath(\"//span[@class='paragrafo-padrao']\").text,\n :wind => { :velocity => request.xpath(\"//li[@class='dados-momento-li list-style-none'][4]/span[2]\").text,\n :direction => wind['br'][request.xpath(\"//li[@class='dados-momento-li list-style-none'][1]/span[2]\").text]\n },\n :moisture => request.xpath(\"//li[@class='dados-momento-li list-style-none'][5]/span[2]\").text,\n :condition => request.xpath(\"//li[@class='dados-momento-li list-style-none'][2]/span[2]\").text,\n :pression => request.xpath(\"//li[@class='dados-momento-li list-style-none'][3]/span[2]\").text,\n :temperature => request.xpath(\"//span[@class='left temp-momento top10']\").text\n }\n end", "title": "" }, { "docid": "0fe8d448233f9d2ae24ea05d3e3301f5", "score": "0.5040458", "text": "def return_arr_txts\r\n IO.write(\"./DEBUG\", \"docclass=\"+@doc.to_s+\" andinfoclass= \"+@@info_past.class.to_s+\"=\"+@@info_past.to_s)\r\n @doc = @@info_past[1]\r\n if @doc[\"doc\"].empty?\r\n return [\"0\"]\r\n else\r\n return @doc[\"doc\"] #retorna os nomes dentro de um Array\r\n end\r\n end", "title": "" }, { "docid": "14c1daf8986f96bdc2754a1ca7a946b9", "score": "0.5034484", "text": "def get_sunrise_data(country,city)\n complete_data = []\n month_array = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12]\n month_array.each do |num|\n document = open(\"https://www.timeanddate.com/sun/#{country}/#{city}?month=#{num}&year=2018\")\n content = document.read\n parsed_content = Nokogiri::HTML(content)\n month_input = []\n\n #Variables that represent each data point collected\n sunrise = parsed_content.at_xpath('//td[@class=\"c sep\"]').text.split[0].to_s\n sunrise_unit = parsed_content.at_xpath('//td[@class=\"c sep\"]').text.split[1].to_s\n sunset= parsed_content.at_xpath('//td[@class=\"sep c\"]').text.split[0].to_s\n sunset_unit = parsed_content.at_xpath('//td[@class=\"sep c\"]').text.split[1].to_s\n day_length = parsed_content.at_xpath('//td[@class=\"c tr sep-l\"]').text.split[0]\n cut = day_length.split(\":\")\n hours = cut[0].to_i\n minutes = cut[1].to_i\n\n #Array of complete sunrise/sunset information for one month\n month_input = [ \"#{sunrise.colorize(:yellow)}#{sunrise_unit}\", \"#{sunset.to_s.colorize(:magenta)}#{sunset_unit}\", \"#{hours}hrs:#{minutes}mins\"]\n complete_data.push(month_input)\n end\n return complete_data\nend", "title": "" }, { "docid": "29ab9ff49b68a9e4fdfd5c898ace7b8f", "score": "0.50335944", "text": "def time\n\n end", "title": "" }, { "docid": "d6a805674cc4ec53f10986bebcabaa03", "score": "0.5033319", "text": "def parse_schedule(html)\n table = html.scan(/<table.*?<\\/table>/m).first\n \n slots = table.scan(/<td.*?><font.*?>(.*?)<\\/td>/).inject([[]]) do |m, n| \n m << [] if m[-1].length >= 20\n if n[0] =~ /(\\d+)/ \n m[-1] << $1.to_i\n else\n m[-1] << nil\n end\n m\n end\n \n slots\nend", "title": "" }, { "docid": "0cd8b45de07ca48887c4bf77cf12a8cd", "score": "0.50293267", "text": "def html! node_set\n @stop_page = Stop.new.html! node_set\n @arrival_time = node_set.search('td').first.text.sub('.', ':').sub(/(a|p)(m)$/, ' \\1.M.').upcase # \"12:25pm\" -> \"12:25 P.M\"\n self\n end", "title": "" }, { "docid": "3c54e22e53e78e2812cfc612b3fadb38", "score": "0.50155973", "text": "def get_data\n if @url\n @page = fetch_url(@url)\n @parse_time = parse_dailydev_page\n @page = nil\n self.total_time\n end\n end", "title": "" }, { "docid": "3dda7d7b0cf7488b6cb43f9e0150609a", "score": "0.5002136", "text": "def parse_time_stamp(doc,debug,file)\n year = -1;\n month = -1;\n date = -1;\n hour = -1;\n minutes = -1;\n sec = 0;\n zone = '+00:00';\n\n list = doc.xpath(\"//div[@class='container']/div/div/div/div\");\n\n for i in 0..list.size-1\n div = list[i]\n\n if (debug > 0) then\n file.printf(\"------------- //div \\n\");\n file.puts(div);\n end\n\n word = div.text.split()\n if ((word[0] == 'Last') and (word[1] == 'updated:')) then\n month = get_month(word[2]);\n date = word[3].split(',')[0].to_i;\n year = word[4].split(',')[0].to_i;\n hour = word[5].split(':')[0].to_i;\n minutes = word[5].split(':')[1].to_i;\n if (word[6] != \"GMT\") then\n printf(\"ERROR: undefined zone : %s\\n\",word[6]);\n end\n end\n end\n \n file.puts(\"-------------------- //end of divisions\") if (debug > 0);\n\n return DateTime.new(year,month,date,hour,minutes,0,zone);\n end", "title": "" }, { "docid": "16384b0f1a90d9508d158d360b9286c8", "score": "0.5001701", "text": "def inn\n raw = @doc.css('tr')[6].css('td').text\n end", "title": "" }, { "docid": "9c1c370d9a7b8510f61c827d9a9cc47d", "score": "0.5000268", "text": "def atime() end", "title": "" }, { "docid": "9c1c370d9a7b8510f61c827d9a9cc47d", "score": "0.5000268", "text": "def atime() end", "title": "" }, { "docid": "31db352e30ef5d5b14f77c87e7d7e2c6", "score": "0.49845567", "text": "def scrape\n\t\teachmenus = ''\n\t\tcontent = ''\n\t\tprice = ''\n\t\tcurrentDate = 0\n\t \n #프랜들리\n target = @parsed_data.css('table.table-a tbody td')\n check = 0\n\n @default_dates.each do |dat|\n \teachmenus = \"\"\n target.each do |t|\n if check == 0\n content = t.text\n check = 1\n else\n price = t.text\n if eachmenus == \"\"\n #첫 번째 메뉴면, 콤마없이\n eachmenus += JSON.generate({:name => content, :price => price})\n else\n #하나 이상 메뉴면 콤마 추가\n eachmenus += (',' + JSON.generate({:name => content, :price => price}))\n end\n check = 0\n end\n end\n\t\t #조/중/석이 같은 메뉴입니다. \n\t\t Diet.create(\n :univ_id => 5,\n :name => \"프랜들리\",\n :location => \"바율관1층\",\n :date => dat,\n :time => 'breakfast',\n :diet => ArrJson(eachmenus),\n :extra => nil\n )\n Diet.create(\n :univ_id => 5,\n :name => \"프랜들리\",\n :location => \"바율관1층\",\n :date => dat,\n :time => 'lunch',\n :diet => ArrJson(eachmenus),\n :extra => nil\n )\n Diet.create(\n :univ_id => 5,\n :name => \"프랜들리\",\n :location => \"바율관1층\",\n :date => dat,\n :time => 'dinner',\n :diet => ArrJson(eachmenus),\n :extra => nil\n )\n end\n\n\t\t#파인하우스\n\t\tpinehouse = Array.new\n pinehouse << JSON.generate({:name => \"비빔밥\", :price => \"2,700\"})\n pinehouse << JSON.generate({:name => \"비빔밥(잡곡)\", :price => \"3,200\"})\n pinehouse << JSON.generate({:name => \"돌솥비빔밥\", :price => \"2,700\"})\n pinehouse << JSON.generate({:name => \"돌솥비빔밥(잡곡)\", :price => \"3,500\"})\n pinehouse << JSON.generate({:name => \"치즈돌솥비빔밥\", :price => \"3,200\"})\n pinehouse << JSON.generate({:name => \"청국장\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"육개장\", :price => \"2,700\"})\n pinehouse << JSON.generate({:name => \"찌개(된장/순두부/콩비지/김치)\", :price => \"2,700\"})\n pinehouse << JSON.generate({:name => \"부대찌개\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"김치덮밥\", :price => \"2,700\"})\n pinehouse << JSON.generate({:name => \"덮밥(잡채/마파두부/버섯)\", :price => \"3,200\"})\n pinehouse << JSON.generate({:name => \"들깨순두부\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"공기밥\", :price => \"500\"})\n pinehouse << JSON.generate({:name => \"현미밥\", :price => \"1,000\"})\n pinehouse << JSON.generate({:name => \"버섯두부전골\", :price => \"10,000\"})\n pinehouse << JSON.generate({:name => \"만두전공\", :price => \"10,000\"})\n pinehouse << JSON.generate({:name => \"김치주먹밥\", :price => \"1,300\"})\n pinehouse << JSON.generate({:name => \"샌드위치(사과/야채)\", :price => \"1,500\"})\n pinehouse << JSON.generate({:name => \"베지버거\", :price => \"2,000\"})\n pinehouse << JSON.generate({:name => \"야채김밥\", :price => \"1,700\"})\n pinehouse << JSON.generate({:name => \"치즈김밥/구프랑김밥\", :price => \"2,000\"})\n pinehouse << JSON.generate({:name => \"떡만두국\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"라면\", :price => \"1,700\"})\n pinehouse << JSON.generate({:name => \"치즈라면/만두라면\", :price => \"2,000\"})\n pinehouse << JSON.generate({:name => \"김치떡라면\", :price => \"2,000\"})\n pinehouse << JSON.generate({:name => \"채식라면\", :price => \"2,300\"})\n pinehouse << JSON.generate({:name => \"잔치국수/칼국수\", :price => \"2,500\"})\n pinehouse << JSON.generate({:name => \"토마토스파게티\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"수제비\", :price => \"2,300\"})\n pinehouse << JSON.generate({:name => \"들깨수제비\", :price => \"2,800\"})\n pinehouse << JSON.generate({:name => \"칼국수(들깨/만두/버섯)\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"떡볶이\", :price => \"2,500\"})\n pinehouse << JSON.generate({:name => \"부대떡볶이\", :price => \"5,000\"})\n pinehouse << JSON.generate({:name => \"치즈떡볶이\", :price => \"6,000\"})\n pinehouse << JSON.generate({:name => \"유부초밥\", :price => \"2,500\"})\n pinehouse << JSON.generate({:name => \"우동\", :price => \"1,800\"})\n pinehouse << JSON.generate({:name => \"우동(곱)\", :price => \"2,300\"})\n pinehouse << JSON.generate({:name => \"짜장면\", :price => \"2,300\"})\n pinehouse << JSON.generate({:name => \"짜장면(곱)\", :price => \"2,800\"})\n pinehouse << JSON.generate({:name => \"짬뽕\", :price => \"2,500\"})\n pinehouse << JSON.generate({:name => \"쩜뽕(곱)\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"간짜장\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"간짜장(곱)\", :price => \"3,500\"})\n pinehouse << JSON.generate({:name => \"볶음밥\", :price => \"2,700\"})\n pinehouse << JSON.generate({:name => \"쟁반짜장\", :price => \"6,000\"})\n pinehouse << JSON.generate({:name => \"쟁반짬뽕\", :price => \"7,000\"})\n pinehouse << JSON.generate({:name => \"쟁반쫄면\", :price => \"6,500\"})\n pinehouse << JSON.generate({:name => \"버섯탕수육(2인기준)\", :price => \"8,000\"})\n pinehouse << JSON.generate({:name => \"냉면\", :price => \"2,500\"})\n pinehouse << JSON.generate({:name => \"냉면(곱)\", :price => \"3,000\"})\n pinehouse << JSON.generate({:name => \"냉모밀(2인기준)\", :price => \"5,000\"})\n\n eachmenus = \"\"\n pinehouse.each do |p|\n \tif eachmenus == \"\"\n #첫 번째 메뉴면, 콤마없이\n eachmenus += p\n else\n #하나 이상 메뉴면 콤마 추가\n eachmenus += (',' + p)\n end\n end\n\n #조/중/석이 같은 메뉴입니다.\n @default_dates.each do |dat|\n Diet.create(\n :univ_id => 5,\n :name => \"파인하우스\",\n :location => \"학생회관1층\",\n :date => dat,\n :time => 'breakfast',\n :diet => ArrJson(eachmenus),\n :extra => nil\n )\n Diet.create(\n :univ_id => 5,\n :name => \"파인하우스\",\n :location => \"학생회관1층\",\n :date => dat,\n :time => 'lunch',\n :diet => ArrJson(eachmenus),\n :extra => nil\n )\n Diet.create(\n :univ_id => 5,\n :name => \"파인하우스\",\n :location => \"학생회관1층\",\n :date => dat,\n :time => 'dinner',\n :diet => ArrJson(eachmenus),\n :extra => nil\n )\n end\n\n\tend", "title": "" }, { "docid": "92f698d315dc832081ce805ba1ec9896", "score": "0.4964008", "text": "def index\n @quiebres = Quiebre.all\n @array=[]\n @quiebres_totales=0\n @quiebres.each do |q|\n @quiebres_totales+=q.dineroperdido\n end\n # fecha=@quiebres.first.created_at\n # while(fecha<Date.today)\n # num=@quiebres.where(created_at:fecha).count\n # @array << [fecha.to_datetime.to_i*100, num]\n # fecha=fecha+1.day\n # end\n @grafico=Quiebre.group(\"date(created_at)\").count\n @grafico.each do |g|\n @array << [g[0].to_datetime.to_i*1000, g[1]]\n end\n # if !@\n end", "title": "" }, { "docid": "856b83273571dbd35c5034780c1bea1d", "score": "0.4959056", "text": "def index\n p request.inspect\n push_timer :stupid_sleep\n sleep 2\n pop_timer\n\n <<EOF\n<h2>push_timer/pop_timer methods</h2>\nThis example uses push_timer/pop_timer methods\n\n<pre>\n def index\n push_timer :stupid_sleep\n sleep 2\n pop_timer\n end\n</pre>\n\nIf you run 'fn.rb' (bundle exec fn.rb run), you can check this <a href='http://localhost:4242' target='_blank'>link</a> to get the Fnordmetric dashboard.\n<p />\nSorry for the wait... but congratulations won a vanilla Icecream <a href='/icecream'>Icecream</a> ! May be you prefer <a href='/icecream/strawberry'>strawberry</a>. ?\nEOF\n end", "title": "" }, { "docid": "7097cb4e70328d7023a675ee279ea525", "score": "0.49565336", "text": "def route_de_la_mairie\n page = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/val-d-oise.html\")) \n puts \"nata\"\n #page.xpath('/html/body/table/tbody/tr[3]/td/table/tbody/tr/td[2]/p[2]/object/table/tbody/tr[2]/td/table/tbody/tr/td[2]/p/a').each do |link|\n page.css('html body table tbody tr td table tbody tr td p object#voyance-par-telephone table tbody tr td table.Style20 tbody tr td p a.lientxt').each do |link|\n #page.css('html body table tbody').css('tr')[2].css('td table tbody tr').css('td')[1].css('p')[1].css('object table tbody').css('tr')[1].css('td table tbody tr').css('td')[2].css('p a').each do |link| \n puts link['href']\n puts link.text\n end\nend", "title": "" }, { "docid": "6d8aa61ee5d80b68fc083f770ea15cec", "score": "0.49558038", "text": "def get_the_email_of_a_townhal_from_its_webpage\n emails = \"\"\n tab_url = Nokogiri::HTML(open('http://annuaire-des-mairies.com/95/vaureal.html'))\n tab_url.each do |url_commune|\n pages = Nokogiri::HTML(open(url_commune))\n email = pages.css(\".txt-primary\")[3].text.split(\" \")\n email = email[2]\n emails += email\n end\n return emails\nend", "title": "" }, { "docid": "2c841f169853514d4a6ae6f7fb0370d1", "score": "0.49524602", "text": "def get_townhall_name\npage = Nokogiri::HTML(open(\"http://www.annuaire-des-mairies.com/val-d-oise.html\"))\n#creation du tableau townhall_array\ntownhall_array = []\n#récupération du contenu de la balise attribut avec la class \"lientxt\" qui contient le nom des villes\n page.xpath('//a[@class = \"lientxt\"]').each do |townhall_name|\n\n townhall_array << townhall_name.text\n\n end\n\n return townhall_array\nend", "title": "" }, { "docid": "afc450bd0ecaed5239d73ad0a2320c59", "score": "0.49470863", "text": "def time_all (path1, estimate)\n\tf = File.open('timing_results.txt', 'w')\n\ttotal = 0 #total time \n#loop over the files\n\tDir.glob(path1).each do |docpath|\n#Create a Docx::Document object for our existing docx file\n\t\tif(docpath.to_s.scan(/th/).size > 0)\n\t\t\tdoc = Docx::Document.open(docpath)\n\t\t\tf.puts(docpath)\n\t\t\tb = time_file(doc, estimate)\n\t\t\tb.each {\n\t\t\t\t|key, value| \n\t\t\t\tif(key==\"[Next]\")\n\t\t\t\t\tf.puts \"Total of #{value/6} #{key} taking #{value} seconds\"\n\t\t\t\telse\n\t\t\t\t\tf.puts \"Total of #{value/estimate} #{key} taking #{value} seconds\"\n\t\t\t\tend\n\t\t\t}\n\t\t\tf.puts \"Total Script Time : \" + b.values.inject(:+).to_s + \" (seconds)\" #sum of times [Next], [Submit], etc. in seconds\n\t\t\ttotal += b.values.inject(:+)\n\t\t\tf.puts\n\t\tend\n\tend\n\n\tf.puts \"\\nOverall Lesson Time : \" + total.to_s + \" (seconds)\"\n\tf.close\nend", "title": "" }, { "docid": "364f701fab29a6e6e1866d58348bc18f", "score": "0.49450168", "text": "def set_index\n @index = Nokogiri::HTML(open(@url))\n end", "title": "" }, { "docid": "fd90ccf676a0e4c03b1e7b7096352e7e", "score": "0.4938594", "text": "def getHalfMinuteArticle(showURL,theYear,defaultDate)\n\tpage = Nokogiri::HTML(open(showURL))\n\tshowTitle = page.css('td#contentTd table td h3 strong.title').text.strip\n\tshowDescription = page.css('td#contentTd p').text.strip\n\tepisodeTable = page.css('td#contentTd table td a.hmenu')\n\tepisodeTitle = []\n\tepisodeURL = []\n\tepisodeDate = []\n\tepisodeMaster = []\n\tepisodeDesc = []\n\t\t\n\tepisodeTable.each do |t|\n\t\tepisodeURL.push('http://www.moneyradio.org/'+t['href'])\n\t\ttitleText = t.text.strip\n\t\t#episodeDate.push(titleText.index(theYear))\t\t\n\t\tif(titleText.index(theYear).nil?)\n\t\t\tepisodeDate.push(Date.strptime(defaultDate, '%m/%d/%Y'))\n\t\t\tepisodeTitle.push(t.text.strip)\n\t\t\t#use this print out to debug\n\t\t\t#puts t.text.strip\n\t\telse\n\t\t\tif titleText.index('1011/2007') # this is special case in 2007\n\t\t\t\tepisodeDate.push(Date.strptime(defaultDate, '%m/%d/%Y'))\n\t\t\t\tepisodeTitle.push(t.text.strip)\t\t\t\t\n\t\t\telse\n\t\t\t\tepisodeDate.push(Date.strptime(titleText[0..(titleText.index(theYear)+theYear.length-1)], '%m/%d/%Y'))\n\t\t\t\tepisodeTitle.push(titleText[(titleText.index(theYear)+theYear.length)..titleText.length].to_s.strip)\n\t\t\tend\n\t\t\t#use this print out to debug\n\t\t\t#puts t.text.strip\n\t\tend\n\tend\n\tf = 0\n\t#episodeURL = episodeURL[0..4]\n\tepisodeURL.each do |c|\n\t\tarticlePage = Nokogiri::HTML(open(c))\n\t\tcontent = articlePage.css('td#contentTd p').text.strip\n\t\t#puts content\n\t\tepisodeDesc.push(content)\n\t\tputs f.to_s\n\t\tputs episodeDate[f]\n\t\tputs episodeTitle[f]\n\t\tsleep(3)\n\t\tf = f+1\n\tend\n\t#puts \"title: \"+episodeTitle.length.to_s + \"content: \"+episodeDesc.length.to_s\n\tk = 0\n\tepisodeURL.each do |j|\n\t\tepisode = EpisodePage.new\n\t\tepisode.name = episodeTitle[k]\n\t\tepisode.date = episodeDate[k]\n\t\t#episode.url = j\n\t\tepisode.desc = episodeDesc[k]\n\t\tk = k + 1\n\t\tepisodeMaster.push(episode)\n\tend\n\treturn episodeMaster\nend", "title": "" }, { "docid": "61e0819c5e8e5e36ccc14b32460129f3", "score": "0.49355078", "text": "def get_all_the_urls_townhalls_cot_d_or\n doc = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/cote-d-or.html\"))\n doc2 = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/cote-d-or-2.html\"))\n doc3 = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/cote-d-or-3.html\"))\n doc4 = Nokogiri::HTML(open(\"http://annuaire-des-mairies.com/cote-d-or-4.html\"))\n urlend = []\n tabname = []\n doc.css('.lientxt').each do |i| tabname << i.content end\n doc.css('a.lientxt @href').each do |i| urlend << i.content end\n doc2.css('.lientxt').each do |i| tabname << i.content end\n doc2.css('a.lientxt @href').each do |i| urlend << i.content end\n doc3.css('.lientxt').each do |i| tabname << i.content end\n doc3.css('a.lientxt @href').each do |i| urlend << i.content end\n doc4.css('.lientxt').each do |i| tabname << i.content end\n doc4.css('a.lientxt @href').each do |i| urlend << i.content end\n i = 0\n while i < urlend.size\n begin\n urlend[i] = get_the_email_of_a_townhal_from_its_webpage(\"http://annuaire-des-mairies.com#{urlend[i]}\")\n i += 1\n rescue => exception\n p urlend[i] = (\"L'url de la mairie de #{tabname[i]} est indisponible\")\n i += 1\n ensure\n end\n end \n return myhash = Hash[tabname.zip(urlend)]\n end", "title": "" }, { "docid": "303235b6ca0baed86edc2cd29780e67d", "score": "0.4933056", "text": "def get_anime\n Scraper.new.scrape_anime\n end", "title": "" }, { "docid": "a1831bd18a7f04a36ffb54ae7d4b51aa", "score": "0.49325815", "text": "def index\n @timelogs = Timelog.all\n end", "title": "" }, { "docid": "2667e73959e009a9325238aee197d967", "score": "0.4931856", "text": "def get_the_email_of_a_townhal_from_its_webpage(lien)\n doc = Nokogiri::HTML(open(\"#{lien}\"))\n email = doc.css('html body tr[4] td.style27 p.Style22 font')[1]\nend", "title": "" }, { "docid": "dbd942718d16d271765a28009b16853a", "score": "0.48981178", "text": "def time\n end", "title": "" }, { "docid": "6550281d473f95e16e88c1eaffcd72af", "score": "0.4898072", "text": "def get_data\n page = Nokogiri::HTML(open(\"https://coinmarketcap.com/all/views/all/\")) # ça ouvre la page web coinmarket et enregistre dans la variable page \n noko_o = page.xpath(\"//tbody/tr/td/a[@class='currency-name-container link-secondary']\") # dans la variable page j'ai extrait toutes les noms des currencies de la variable page et je les ai enregistré dans la variable noko_o \n currencies = noko_o.map {|n| n.text} # j'ai fais une boucle à partir des élements de noko_o , et j'enregistre toutes ces valeurs dans l'array currencies en string car j'utlise .text\n return currencies # je récupère toutes les monnaies \nend", "title": "" }, { "docid": "331c71076a4d8b9ec5a1db00f7486113", "score": "0.48949227", "text": "def time\n request :public, :get, :time\n end", "title": "" }, { "docid": "cf818b0aa7820ddbc7930bc52f4cea0d", "score": "0.48863566", "text": "def finished_at; @doc['finished_at']; end", "title": "" }, { "docid": "3cae5ad5dbcf06726b63c6451ff0296b", "score": "0.4883481", "text": "def get_the_email_of_a_townhal_from_its_webpage(page_url)\n doc = Nokogiri::HTML(open(page_url)) # Acceder à la page\n email = doc.css(\".tr-last\")[3].text.split(\" \")[2] # Scraping des données\n email\nend", "title": "" }, { "docid": "fabf2806f509fac4c0694682ffc83a04", "score": "0.48770404", "text": "def get_in_table upto = Time.now.to_i\n request = {\n where: \"time < #{upto}\"\n }\n select(request)\n end", "title": "" }, { "docid": "5e5199f1ec2898a5cf1a9358b1be5da3", "score": "0.48720542", "text": "def local_aqi_index(city)\n\n #If a ranked city instance is supplied, set @city to this instance, otherwise, create a new city instance\n city.nil?? @city = AirQualityIndex::City.new : @city = city\n\n #store location information\n self.city.location_city = self.doc.search(\".ActiveCity\").text.strip\n self.city.location_state = self.doc.search(\"a.Breadcrumb\")[1].text.strip\n\n #store aqi index\n set_msg_or_attribute('current_aqi_index', self.doc.at('.TblInvisible').css('tr td').children[1])\n set_msg_or_attribute('current_aqi_msg', self.doc.search(\"td.AQDataLg\")[0])\n set_msg_or_attribute('current_health_msg', self.doc.search(\"td.HealthMessage\")[0])\n\n #store current aqi/ozone data\n set_msg_or_attribute('current_pm', self.doc.search(\"table\")[14].children.css(\"td\")[4])\n set_msg_or_attribute('current_pm_msg', self.doc.search(\"td.AQDataPollDetails\")[3])\n set_msg_or_attribute('current_ozone', self.doc.search(\"table\")[14].children.css(\"td\")[1])\n set_msg_or_attribute('current_ozone_msg', self.doc.search(\"td.AQDataPollDetails\")[1])\n\n #Extract time from site\n self.city.current_aqi_timestamp = self.timestamp\n self.doc.search(\"td.AQDataContent\")[0].css(\"tr\")[2].text.strip\n\n #store todays forecast data\n set_msg_or_attribute('today_aqi', self.doc.search(\"td.AQDataContent\")[0].css(\"td\")[3])\n set_msg_or_attribute('today_aqi_num', self.doc.search(\"td.AQDataContent\")[0].css(\"tr\")[2])\n set_msg_or_attribute('today_health_msg', self.doc.search(\"td.HealthMessage\")[1])\n\n #store tomorrows forecast data\n set_msg_or_attribute('tomorrow_aqi', self.doc.search(\"td.AQDataContent\")[1].css(\"td\")[3])\n set_msg_or_attribute('tomorrow_aqi_num', self.doc.search(\"td.AQDataContent\")[1].css(\"tr\")[2])\n set_msg_or_attribute('tomorrow_health_msg', self.doc.search(\"td.HealthMessage\")[2])\n\n #save instance to City.all\n self.city.save\n\n #return self\n self\n end", "title": "" }, { "docid": "89ed930f4059347df588135eba6b4f88", "score": "0.48641583", "text": "def get_the_email_of_a_townhal_from_its_webpage(page_url)\n email = ''\n\n element_xpath = '/html/body/div/main/section[2]/div/table/tbody/tr[4]/td[2]'\n\n page = Nokogiri::HTML(open(page_url))\n page.xpath(element_xpath).each do |node|\n email = node.text\n end\n\n email\nend", "title": "" }, { "docid": "c14906fbcb8ab0dd63dbde6571486f66", "score": "0.48640952", "text": "def parse_xml(body)\n xml = Nokogiri::XML(body)\n array = []\n\n times = xml.xpath('//forecast/time')[0...TIME_PART_PER_DAY]\n times.each_with_index do |t, index|\n array[index] = {}\n array[index][:city] = t.at_xpath('//location/name/text()').to_s\n array[index][:timeFrom] = t.at_xpath('@from').to_s\n array[index][:timeTo] = t.at_xpath('@to').to_s\n array[index][:windDirection] = t.at_xpath('windDirection/@name').to_s\n array[index][:windSpeed] = t.at_xpath('windSpeed/@mps').to_s + ' mps'\n array[index][:temperature] = t.at_xpath('temperature/@value').to_s +\n ' ' + t.at_xpath('temperature/@unit').to_s\n array[index][:pressure] = t.at_xpath('pressure/@value').to_s +\n ' ' + t.at_xpath('pressure/@unit').to_s\n array[index][:humidity] = t.at_xpath('humidity/@value').to_s +\n + t.at_xpath('humidity/@unit').to_s\n end\n array\n end", "title": "" }, { "docid": "909ee48c6463ee4ae3edd7132d8334ca", "score": "0.4863351", "text": "def scrape\n\t\tnames = Array.new\n\t\tcontents = Array.new\n\t\teachmenus = ''\n\t\ttime = ''\n\t\tprice = ''\n\t\t\n\t\t#Mon ~ Fri\n\t\t(0..4).each do |day|\n parsed_data = Nokogiri::HTML(open(@urls[day]))\n target = parsed_data.css('table.sk01TBL')[1]\n\n #Store names\n target.css('tr p').each do |tmp|\n if (tmp.text == \"승학 캠퍼스\" || tmp.text == \" \")\n next\n else\n names << tmp.text\n end\n end\n\n #Store contents\n target.css('tr')[9].css('td.sk01TD').each do |tmp|\n if tmp.text.strip == \" \"\n next\n else\n contents << tmp.text.strip.gsub(\"\\n\\n\",\"\\n\").gsub(\"\\n\\n\",\"\\n\").gsub(\"\\n\",\",\")\n end\n end\n\n #Breakfast ~ Dinner\n (0..3).each do |part|\n \t\n \tif contents[part] == \" \"\t#콘텐츠에 문제가 있으면 Skip\n\t\t\t\t\tnext\n end\n\n #교수회관\n if names[part] == \"교수회관\"\n \teachmenus = JSON.generate({:name => contents[part], :price => price})\n \tDiet.create(\n\t :univ_id => 6,\n\t :name => names[part],\n\t :location => '',\n\t :date => @default_dates[day],\n\t :time => 'lunch',\n\t :diet => ArrJson(eachmenus),\n\t :extra => nil\n\t\t )\n \tDiet.create(\n\t :univ_id => 6,\n\t :name => names[part],\n\t :location => '',\n\t :date => @default_dates[day],\n\t :time => 'dinner',\n\t :diet => ArrJson(eachmenus),\n\t :extra => nil\n\t\t )\n end\n\n\t\t\t\t#학생회관, 도서관\n\t\t\t\tif names[part] == \"학생회관\" || names[part] == \"도서관\"\n \teachmenus = JSON.generate({:name => contents[part], :price => price})\n \tDiet.create(\n\t :univ_id => 6,\n\t :name => names[part],\n\t :location => '',\n\t :date => @default_dates[day],\n\t :time => 'breakfast',\n\t :diet => ArrJson(eachmenus),\n\t :extra => nil\n\t \t)\n \tDiet.create(\n\t :univ_id => 6,\n\t :name => names[part],\n\t :location => '',\n\t :date => @default_dates[day],\n\t :time => 'lunch',\n\t :diet => ArrJson(eachmenus),\n\t :extra => nil\n\t \t)\n \tDiet.create(\n\t :univ_id => 6,\n\t :name => names[part],\n\t :location => '',\n\t :date => @default_dates[day],\n\t :time => 'dinner',\n\t :diet => ArrJson(eachmenus),\n\t :extra => nil\n\t \t)\n end\n end #Breakfast ~ Dinner end\n\t\tend\t#Mon ~ Fri end\n\tend", "title": "" }, { "docid": "686f327b0668894e21336f71a9e6884c", "score": "0.4862887", "text": "def parse_schedule(url)\n # Turn class schedule into an array of arrays.\n page = Nokogiri::HTML(open(url))\n schedule = page.search('table')[5]\n rows = schedule.search('tr')\n rows.map { |row| parse_row(row) }\nend", "title": "" }, { "docid": "ff53972c051e724c3aa74b14dbc6f64b", "score": "0.48612425", "text": "def hour_table\n content_tag :div, :class => \"day_div\" do\n content_tag :table, :class => \"day_table\" do\n header + time_body\n end\n end\n end", "title": "" }, { "docid": "a60c4ed0069a36dc71be8af2d5c25755", "score": "0.48588723", "text": "def processIncidentPage(agent, page, output)\n doc = Nokogiri::HTML(page.body);\n incident_info = '';\n\n #Get all information and store it in the incident_information array\n sections = doc.css('tr td')\n incident_info += processSection0(sections[0]);\n incident_info += processSection1(sections[1]);\n incident_info += processSection2(sections[2]);\n\n #Convert the array to a CSV line and Write to CSV\n output.puts(incident_info);\n signalProcessCompletion();\nend", "title": "" }, { "docid": "f0f1096603b7922d2fdee8b25c823e11", "score": "0.48532563", "text": "def get_all_the_urls_of_val_doise_townhalls (web_list)\npage = Nokogiri::HTML(RestClient.get(web_list))#recupere le code html du site\npage.css(\"a.lientxt\").each do |note|\nnote['href'] = note['href'][1..-1]#donne les urls de chaque commune en retirant le premier caractaire c-a-d \".\"\nweb_page = \"http://annuaire-des-mairies.com\" + note['href']\nputs web_page\nget_the_email_of_a_townhal_from_its_webpage(web_page)#rappel la fonction get_the_email_of_a_townhal_from_its_webpage pour recuperer les adresses emails grace aux liens (fonctions recurssive)\nend\nend", "title": "" } ]
758d3a9cc4b4c30e534af7c735b36f2c
The product model has a relation to the user model and has an image attached to it
[ { "docid": "57400d4145eb81eb58f533e22bb24ff7", "score": "0.0", "text": "def can_edit?(user)\n return user == self.user || user.has_role?(:admin)\n end", "title": "" } ]
[ { "docid": "c4d9dc8b6868b4233720d02a438645e8", "score": "0.71660346", "text": "def image\n product.image\n end", "title": "" }, { "docid": "b7d480b4fa609f6c9ed8a974ff7ebfcc", "score": "0.6799131", "text": "def set_product_image\n @product_image = ProductImage.find(params[:id])\n end", "title": "" }, { "docid": "d17d41859d597e31a67992200a2af206", "score": "0.6789598", "text": "def set_product_image\n @product_image = ProductImage.find(params[:id])\n end", "title": "" }, { "docid": "d17d41859d597e31a67992200a2af206", "score": "0.6789598", "text": "def set_product_image\n @product_image = ProductImage.find(params[:id])\n end", "title": "" }, { "docid": "fbae4ef43c962729687af554b7492196", "score": "0.67751974", "text": "def images\n\t\t@user = User.find(params[:id])\n\tend", "title": "" }, { "docid": "aae96c76ae8ef761bf9b93af4451fbae", "score": "0.67406374", "text": "def create\n @product = Product.new(product_params)\n @product.user = current_user\n @product.image.attach(product_params[:image])\n\n if @product.save\n flash[:alert] = \"Your product has been posted for sale.\"\n redirect_to product_path(@product)\n else\n flash[:alert] = @product.errors.full_messages.join\n redirect_to new_product_path\n end\n end", "title": "" }, { "docid": "feb60299bb8424cf5516c7d1df3abfd9", "score": "0.67196596", "text": "def photo\n self.user.photo\n end", "title": "" }, { "docid": "58e583ed11f8f1c2b7167d076db516d1", "score": "0.6709084", "text": "def set_image_user\n @image_user = ImageUser.find(params[:id])\n end", "title": "" }, { "docid": "58e583ed11f8f1c2b7167d076db516d1", "score": "0.6709084", "text": "def set_image_user\n @image_user = ImageUser.find(params[:id])\n end", "title": "" }, { "docid": "58e583ed11f8f1c2b7167d076db516d1", "score": "0.6709084", "text": "def set_image_user\n @image_user = ImageUser.find(params[:id])\n end", "title": "" }, { "docid": "58e583ed11f8f1c2b7167d076db516d1", "score": "0.6709084", "text": "def set_image_user\n @image_user = ImageUser.find(params[:id])\n end", "title": "" }, { "docid": "6314783450f7aa024b155226918e5e32", "score": "0.6697476", "text": "def update\n @user = User.find(params[:user_id])\n @product.user_id = current_user.id if current_user \n \n respond_to do |format|\n if @product.update(product_params)\n \n\n if params[:photos]\n #===== The magic is here ;)\n params[:photos].each { |photo|\n @product.images.create(photo: photo)}\n end\n format.html { redirect_to :back}\n format.json { render :show, status: :ok, location: @product }\n else\n format.html { render :edit }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dfaff2ab19eada56e159dd10410d6132", "score": "0.6645124", "text": "def set_userimage\n @userimage = Userimage.find(params[:id])\n end", "title": "" }, { "docid": "b70b6d83b96747294155730cb52b90bf", "score": "0.6643497", "text": "def index\n #Uses eager loading to get all the products in the Product model.\n @products = Product.all.includes(:user).with_attached_picture\n end", "title": "" }, { "docid": "216e2f5d41939a80c6e016a06e1dad51", "score": "0.6632599", "text": "def set_image\n @image = Image.includes(:user).find(params[:id])\n end", "title": "" }, { "docid": "6a45798ff6c692bca2e96db34acfcb98", "score": "0.66284883", "text": "def images\n @product = Product.find(params[:id])\n end", "title": "" }, { "docid": "9ea77b32401bb99295658f5f2840fe73", "score": "0.6602605", "text": "def create\n @product = Product.new(params[:product])\n # @product.user_id = session[:user_id]\n respond_to do |format|\n if @product.save\n unless params[:image].blank?\n params[:image].each do |i|\n @product.product_images << ProductImage.create(:image=>i)\n end\n end\n flash[:notice] = 'Admin::Product was successfully created.'\n format.html { redirect_to admin_product_path(@product) }\n\n format.xml { render :xml => @product, :status => :created, :location => @product }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @product.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a2f75119336bed10750b8887c958e200", "score": "0.6598969", "text": "def image\n if read_attribute(:image) \n read_attribute(:image) \n elsif product && product.images.first\n product.images.first.file\n else\n nil\n end\n end", "title": "" }, { "docid": "1c6bc68eb4946702c92e1ec6121499fb", "score": "0.65791667", "text": "def create \n @product = current_user.products.create(params[:product])\n if @product.save\n if params[:product][:avatar].blank?\n flash[:notice] = \"Successfully created product.\"\n redirect_to @product\n else\n render :action => \"crop\"\n end\n else\n render :action => 'new'\n end\nend", "title": "" }, { "docid": "59023cc06614fe51d3e5a40647f8d0d1", "score": "0.6565609", "text": "def create\n @product = Product.new(product_params)\n @product.user_id = current_user.id if current_user\n\n\n respond_to do |format|\n if @product.save\n if params[:photos]\n #===== The magic is here ;)\n params[:photos].each { |photo|\n @product.images.create(photo: photo)}\n end\n format.html { redirect_to user_product_path(@product.user, @product) }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "729e9624a13bd6e3588823fcf1329c40", "score": "0.65382737", "text": "def set_image\n @image = @user.images.find(params[:id])\n end", "title": "" }, { "docid": "d4772e878395dd71ece70bf92aeca437", "score": "0.6530808", "text": "def set_product\n @product = Product.find(params[:id])\n Rails.logger.info @product.photo\n Rails.logger.info \"==================\"\n end", "title": "" }, { "docid": "04d00fc2fdbcbf1848528e49301e7fe9", "score": "0.6516093", "text": "def show\n @user = User.find(params[:id])\n @pictures = @user.pictures\n @top_products = @user.products.where(active: true).order('rating DESC')\n @old_products = @user.products.where(active: false).order('rating DESC')\n @recent_activity = Activity.where(user_id: @user.id).order('timestamp DESC').limit(6)\n if current_user.id == @user.id\n @pictures.build\n end\n if !@user.propic_id.nil?\n @propic = ImageAsset.find(@user.propic_id)\n else\n @propic = @user.pictures.last\n end\n end", "title": "" }, { "docid": "c1aa0588c824ae2217321e35d17a6389", "score": "0.6505755", "text": "def assign_to_user!\n user.current_image = self\n self.using = true\n user.save!\n save!\n end", "title": "" }, { "docid": "fe36fc757430f3e4107c04a7c656e8a1", "score": "0.6498772", "text": "def set_image\n @image = current_user.images.find(params[:id])\n end", "title": "" }, { "docid": "89a131d53f44867565fae89aba91c31f", "score": "0.64781797", "text": "def index\n @photo_products = PhotoProduct.all\n # @user_images = current_user.upload\n end", "title": "" }, { "docid": "e46ffbb32672d7f8481a627bec129959", "score": "0.6467375", "text": "def set_image\n @image = current_user.images.find params[:id]\n end", "title": "" }, { "docid": "a9ac28c94320ad5f8726980dcd85fa50", "score": "0.646375", "text": "def create\n build do\n @product = Product.new(product_params)\n @product.producer = current_user\n @product.image.attach Product.missing_png if @product.save!\n message 'Добавление нового товара'\n view 'member/products/show'\n end\n end", "title": "" }, { "docid": "13382653bc17f4bfe96ea6bf8e1c1725", "score": "0.6431795", "text": "def show\n @id = User.find(@image.user_id)\n if current_user.admin?\n @images = Image.where(user_id: @id)\n else\n @images = Image.where(user_id: current_user)\n end\n end", "title": "" }, { "docid": "3ac60cbc8b61b57432498d49c0f00b92", "score": "0.6430211", "text": "def create\n\t\tremove_empty_image params[:product][:photos_attributes]\n\n\t\tuser_info = current_user.user_info\n\t\tadmin = false\n\t\tif user_info.admin\n\t\t\tuser_info = UserInfo.find params[:product][:user_id].to_i\n\t\t\tparams[:product].delete :user_id\n\t\t\tadmin = true\n\t\tend\n\n\t\t@product = Product.new(params[:product]) \n\t\trespond_to do |format|\n\t\t\tif @product.save\n\t\t\t\tuser_info.products.push @product\n\t\t\t\tShopify.create @product if @product.complete_product?\n\t\t\t\tif admin == true\n\t\t\t\t\tformat.html { redirect_to :action => 'retailer', :id => user_info.id } \n\t\t\t\telse \n\t\t\t\t\tformat.html { redirect_to :action => 'index' }\n\t\t\t\tend\t\t\t\t\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @product.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "c4ced3b18d23e9e168406e3a3a748244", "score": "0.6414517", "text": "def with_picture\r\n UserProcessor.new(self).with_picture\r\n end", "title": "" }, { "docid": "43ee8b9e3a37ae644cf5323631f37cc8", "score": "0.64142716", "text": "def images\n self.product.images\n end", "title": "" }, { "docid": "28e4823496917896e8e6fc74ec14477f", "score": "0.64013153", "text": "def get_user_image\n user = User.find(self.User_id)\n return user.avatar\n end", "title": "" }, { "docid": "f7504822ab9bdae092d5a3d3f3da02a0", "score": "0.63773197", "text": "def show\n # @image = @product.images.find(product)\n \n end", "title": "" }, { "docid": "18930da614053a3be613829fb1afefd8", "score": "0.6360614", "text": "def show_image\n\t\t@product = Product.find(params[:id])\n\t\tif @product.image.nil?\n\t\t\tsend_data open(\"#{Rails.root}/lib/seeds/images/no_image.jpg\", \"rb\").read, type: 'image/jpg'\n\t\telse\n\t\t\tsend_data @product.image, type: 'image/jpg'\n\t\tend\n\tend", "title": "" }, { "docid": "b192a0a098a37962371e9e98fef33a2a", "score": "0.6351271", "text": "def show\n @tag = @image.tags.new\n @access = @image.accesses.new\n @user = User.all\n end", "title": "" }, { "docid": "6ba02ff9d65e68b0a634ecc7c82ccd57", "score": "0.63451505", "text": "def user_image(user)\n image_path(user.profile_photo.medium.url) if user&.profile_photo&.medium&.url\n end", "title": "" }, { "docid": "e707c24dba09759832f4f0cef5e503ad", "score": "0.6340256", "text": "def update \n if current_user\n @user = current_user\n @user.image.attach(params[:image])\n @user.save\n redirect_to user_path(@user)\n else\n render root_path\n end\n end", "title": "" }, { "docid": "fc43ccc2bcbb399050d24ee4973f5027", "score": "0.63387114", "text": "def create\n @user = User.find_by_id(current_user.id)\n @product = @user.products.new(product_params)\n @product.modality_name = @product.modality.name\n @product.modtype_name = @product.modtype.name\n @product.manufacturer_name = @product.manufacturer.name\n @product.overallcategory_name = @product.overallcategory.name\n #leaving 'if params[:images]' should work like 'if params[:images].exists?'\n #authorize @product have this if using cancan\n respond_to do |format|\n if @product.save\n #to handle multiple images\n #if params[:images]\n # params[:images].each do |image|\n # @product.product_images.create(:image => image)\n #end\n #end\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render action: 'show', status: :created, location: @product }\n else\n format.html { render action: 'new' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "137eafba36df3ad5fbbdc4f8a11eb915", "score": "0.63044405", "text": "def create\n @cart = ProductsUser.new(product_id: cart_params.values[0], user_id: current_user_id, quantity: 1, size: \"M\")\n @product = Product.find(@cart.product_id)\n if @cart.save\n render json: {product: @cart.product, product_images: @cart.product.product_images, quantity: @cart.quantity}, status: :created\n else\n render json: @cart.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "eac267c94e82c9ebf4ed1238f2d8bcaa", "score": "0.62991345", "text": "def images\n # find all of the images where images.product_id == product.id\n Image.where(:product_id => id)\n end", "title": "" }, { "docid": "d1e452313a90e44145f4e349d32c9ba9", "score": "0.6288838", "text": "def index\n @user = current_user \n @user_images = @user.user_images\n end", "title": "" }, { "docid": "ea778a9b3419413bae7e80159dace16f", "score": "0.6288521", "text": "def set_prod_image\n @prod_image = ProdImage.find(params[:id])\n end", "title": "" }, { "docid": "967b1bfbade806aefd6aafc908f58485", "score": "0.6259158", "text": "def create\n @categories = Category.all\n @user = current_account\n # @product = Product.new(product_params)\n @product = @user.products.build(product_params)\n \n respond_to do |format|\n if @product.save\n unless params[:images].nil?\n params[:images]['url'].each do |img|\n @image = @product.images.create!(url: img, product_id: @product.id)\n end\n end\n format.html { redirect_to product_path(@product), notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a711a689231768adf156857a09afc806", "score": "0.62479615", "text": "def show_image\n\t\t@shop_product = ShopProduct.find(params[:id])\n\t\tif @shop_product.image.nil?\n\t\t\tsend_data open(\"#{Rails.root}/lib/seeds/images/no_image.jpg\", \"rb\").read, type: 'image/jpg'\n\t\telse\n\t\t\tsend_data @shop_product.image, type: 'image/jpg'\n\t\tend\n\tend", "title": "" }, { "docid": "e411d3b71e6f493428f57dffc96c3fb6", "score": "0.62473464", "text": "def user_image(user, size)\n if !user.image_id.nil? and image_exists?(user.image_id)\n image_tag(user.image_id, size: size, class: 'profile-pic')\n else\n default_image(size)\n end\n end", "title": "" }, { "docid": "217b04e1c8b3330b8e9a7984c8f11c07", "score": "0.62374485", "text": "def owner\n self.imageable_type == ImagableType::USER ? self.imageable : self.imageable.user\n end", "title": "" }, { "docid": "d47969d46c9c30ae954cf21272a2e21c", "score": "0.62344617", "text": "def for_product(product)\n User.load product, access_token, client: client\n end", "title": "" }, { "docid": "6ee2b6f24150b7f610ea8cee479dff9f", "score": "0.6227112", "text": "def set_image\n if user = User.friendly.find(params[:username])\n @image = Image.where(user_id: user.id).friendly.find(params[:image_slug])\n else\n @image = Image.find(params[:id])\n end\n end", "title": "" }, { "docid": "838e84baf73a39dccfe63bae5fe66fa4", "score": "0.6218697", "text": "def create\n @product_item = ProductItem.new(product_item_params)\n\t\t@product_item.user_id = current_user.id\n\t\t@product_item.is_active = User.find_role?(current_user) == \"A\" ? true : false\n respond_to do |format|\n if @product_item.save\n\t\t\t\tif params[:images]\n\t\t\t\t\tparams[:images].each { |image|\n\t\t\t\t\t\t@product_item.pictures.create(image: image)\n\t\t\t\t\t}\n\t\t\t\tend\n\t\t\t\tif !User.find_role?(current_user) == \"A\"\n\t\t\t\t\tNotifier.send_product_create_notification(@product_item).deliver\n\t\t\t\tend\n format.html { redirect_to product_items_path, notice: 'Product item was successfully created.' }\n format.json { render action: 'show', status: :created, location: @product_item }\n else\n format.html { render action: 'new' }\n format.json { render json: @product_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6091943dc436fa6d06dd6655bd780671", "score": "0.6217856", "text": "def show\n render json: @image.as_json(user_id: @user.id)\n end", "title": "" }, { "docid": "1c4591b981758b4a0cee92830000bf7d", "score": "0.62155855", "text": "def create\n @product = Product.new(product_params)\n respond_to do |format|\n if @product.save\n attach_placeholder_image unless @product.image.attached?\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n else\n format.html { render :new, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d3d3605e21d6640cfd960faa47e590b", "score": "0.6214095", "text": "def product_params\n params.require(:product).permit(:title, :description, :rating, :price, :location, :photo, user_id: current_user.id)\n end", "title": "" }, { "docid": "e20bd8faf068c12bf7e2a861cce50867", "score": "0.61980146", "text": "def show\n @users = User.all\n @current_user_imageprofile = Imageprofile.where(user_id: current_user.id )[0]\n end", "title": "" }, { "docid": "682f7e2a9c7d0bdce9e7ea1511a0df71", "score": "0.6186497", "text": "def create\n @user = User.find_by(id: params[:user_id])\n \n @image = Image.new(image_params())\n respond_to_image\n end", "title": "" }, { "docid": "8a46f128dfbd067eec3fb3046c320c93", "score": "0.61830056", "text": "def set_user_product\n @user_product = UserProduct.find(params[:id])\n end", "title": "" }, { "docid": "af370cfad82505b9bfe1f630bc60d915", "score": "0.6181284", "text": "def product_params\n params.require(:product).permit(:id, :title, :description, :price, :user_id, :image)\n end", "title": "" }, { "docid": "0f5e6c0c311129f8dedea10ea5fcdb68", "score": "0.61812574", "text": "def new\n #so that pictures are being build from the current user \n @picture = current_user.pictures.build\n end", "title": "" }, { "docid": "df559f5a59ed56619fad686f775fe087", "score": "0.6181066", "text": "def initialize(user, image)\n @image = image\n @user = user\n end", "title": "" }, { "docid": "c303ace5fd78f1ec57f8a7755a272271", "score": "0.61771685", "text": "def avatar\n @user = self.current_user\n end", "title": "" }, { "docid": "31916e604f5963a7ecfb8b134ada14ed", "score": "0.6175576", "text": "def create\n @product = Product.new(product_params)\n\n respond_to do |format|\n if @product.save\n\n unless @product.images.blank?\n img = @product.images.first\n img.is_primary = 1\n img.save\n end\n format.html { redirect_to [:admin, @product], notice: t('.notice') }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d52741d271d58415403fc253db72cde", "score": "0.61686194", "text": "def create\n @product = Product.new(product_params)\n @product.customer_id = session[:user_id]\n @product.product_added = DateTime.now()\n @product.active = 1 \n if @product.save\n if params[:images]\n params[:images].each { |image|\n @product.photos.create(image: image)\n }\n end\n redirect_to product_path(@product)\n else\n @product_type = ProductType.all\n render :new\n end\n end", "title": "" }, { "docid": "b05bf39aed66a72b1ad9a4bbd5be0892", "score": "0.61679494", "text": "def create_user_for_image\n u = User.init_based_on_username(author)\n return false if !u.save\n self.user = u\n end", "title": "" }, { "docid": "77d086ccbd44b7654ce7350f0361d33a", "score": "0.61643976", "text": "def edit\n @company = current_user.id\n @product = Product.find(params[:id])\n @categories = Category.all\n @images = @product.product_images\n end", "title": "" }, { "docid": "75027c98c00f2ee2bc2792ffb3fb076c", "score": "0.6160952", "text": "def product_creator\n User.find_by_id self.product_creator_id \n end", "title": "" }, { "docid": "059f3ce3d70104b6a4a18f47dd7acbe7", "score": "0.6157995", "text": "def set_attributes_and_image( prod , row ) super end", "title": "" }, { "docid": "1d6c59a5cb41c360653b474a34c4336e", "score": "0.6145295", "text": "def index\r\n @products = Product.order(\"RANDOM()\").eager_load(:user, :likes, :material, :categories).with_attached_picture\r\n end", "title": "" }, { "docid": "204c628482505a3eae371c1f1e221d73", "score": "0.6143111", "text": "def product_params\n params.require(:product).permit(:title, :description, :colour, :size, :condition, :location, :price, :user_id, images:[])\n end", "title": "" }, { "docid": "5d2d6dea274795d4542a9edb8e9d2b9f", "score": "0.6134075", "text": "def set_product\n\n # @product = Product.find(params[:user_id])\n @product = Product.find(params[:id])\n end", "title": "" }, { "docid": "2b79379dac87fd937bad9f050fdb0598", "score": "0.612731", "text": "def set_image\n @image = User.find(current_user.id).collections.find(params[:collection_id]).images.find(params[:id])\n end", "title": "" }, { "docid": "7b19ba2d956ab01c1cc51fc5d1ccb982", "score": "0.6124071", "text": "def set_listing\n @user = User.find(params[:id, :image])\n end", "title": "" }, { "docid": "b0cb965399334a1b8683d504fa70c8df", "score": "0.6117484", "text": "def set_image\n @image = Image.where(uid: params[:id]).first\n end", "title": "" }, { "docid": "48daf084f7114fee5278572c1b8cb652", "score": "0.61163217", "text": "def image\n product_picture = products.first ? products.first.picture : nil\n @image ||= product_picture || shop.logo\n end", "title": "" }, { "docid": "0516da7661451cd36854300755146b00", "score": "0.61138874", "text": "def create\n @producto = Producto.new(producto_params)\n @producto.image.attach(producto_params[:image])\n\n if @producto.save\n flash[:success] = \"Producto creado correctamente.\"\n redirect_to @producto\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "9e0d47f8d864700465db6edfbde5d7bc", "score": "0.61053705", "text": "def set_product\n @product = current_user.products.find_by!(id: params[:id]) if current_user\n end", "title": "" }, { "docid": "19b607bc5f2f86fde5c6ba10fd74044d", "score": "0.6102952", "text": "def show\n @owner_id = @article.user_id\n @owner = User.find_by(id: @article.user_id)\n @current_user = User.find_by(id: session[:user_id])\n # @article.image.attach(io: File.open('app/assets/images/test.jpeg'), filename: 'test.jpeg', content_type: 'image/jpeg')\n end", "title": "" }, { "docid": "cc8ef807d8585302d3274909ac19aa0d", "score": "0.610222", "text": "def create\n @photos = current_user.photos\n @photo = Photo.new(photo_params) \n @photo.user = current_user \n @photo.save\n end", "title": "" }, { "docid": "e682832ab766be29b2124553d3c90922", "score": "0.6100142", "text": "def product_params\n params.require(:product).permit(:name, :description, :status, :id_user, :image)\n end", "title": "" }, { "docid": "2f7909a525ee3c9b0e9e28871416ad4e", "score": "0.6097369", "text": "def update\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update_attributes(user_params)\n @user.propic_id = @user.pictures.last.id\n @user.save\n #ImageAsset.new(:attachment => @user[:p, :user_id => @user.id)\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": "93d544ad9b64ddea15fd8660950a7b20", "score": "0.6095661", "text": "def show\n @user = User.find(params[:id])\n @pictures = @user.pictures\n @top_products = @user.products.where(active: true, hidden: false).order('rating DESC')\n @old_products = @user.products.where(active: false, hidden: false).order('rating DESC')\n @recent_activity = Activity.where(user_id: @user.id, activity_type: :comment).order('timestamp DESC').limit(5)\n if !@user.propic_id.nil?\n @propic = ImageAsset.find(@user.propic_id)\n else\n @propic = @user.pictures.last\n end\n end", "title": "" }, { "docid": "9bebb9a46204c262aba91cc54de72c90", "score": "0.60926896", "text": "def image\n @image\n end", "title": "" }, { "docid": "9bebb9a46204c262aba91cc54de72c90", "score": "0.60926896", "text": "def image\n @image\n end", "title": "" }, { "docid": "661b7aa367f605628bca78ce60b9bcd8", "score": "0.6091734", "text": "def create\n @image = Image.find params[:image_id]\n @image_user = @image.image_users.new(image_user_params)\n if @image_user.save\n redirect_to @image, notice: 'Image user was successfully created.'\n else\n render :new \n end\n end", "title": "" }, { "docid": "cbb501192b240109b876cd433396da7a", "score": "0.6079517", "text": "def get_user_image(user_id)\n user_image = User.find(user_id).image\n user_image = ((user_image != \"\") ? user_image : asset_url(\"user.png\", :width => \"48\"))\n return user_image\nend", "title": "" }, { "docid": "af18e3dc8bd743149e81f70ead222fb3", "score": "0.60783094", "text": "def create\n product_ids = params[:product][:product_ids]&.map {|a| eval(a)} || []\n @product = params[:user_id].present? ? Product.new(product_params) : current_user.products.new(product_params)\n @product.user_id = params[:user_id] if params[:user_id].present?\n @product.product_ids = product_ids\n respond_to do |format|\n if @product.save\n RequestProduct.find(params[:request_id]).update(status: true) if params[:request_id].present?\n ProductService.new.tracking_product_quantity(@product.quantity, @product)\n if params[:product][:images]\n params[:product][:images].each do |img|\n @product.images.create(file: img)\n end\n end\n\n # format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.html { redirect_to edit_product_path(@product), notice: 'Product was successfully created.' }\n # format.json { render :show, status: :created, location: @product }\n format.json { render json: @product, status: :created }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5256761a3502bd3eb9e29b5d5605f183", "score": "0.6076194", "text": "def set_shop_item_image\n @shop_item_image = ShopItemImage.find(params[:id])\n end", "title": "" }, { "docid": "f548bc542227947a7369367de4d073f0", "score": "0.6074081", "text": "def find_and_attach_image_to(product_or_variant, filename)\n return if filename.blank?\n\n #The image can be fetched from an HTTP or local source - either method returns a Tempfile\n file = filename =~ /\\Ahttp[s]*:\\/\\// ? fetch_remote_image(filename) : fetch_local_image(filename)\n #An image has an attachment (the image file) and some object which 'views' it\n\n product_image = Spree::Image.new({:attachment => file,\n :viewable_type => \"Product\",\n :viewable_id => product_or_variant[:id],\n :position => product_or_variant.images.length\n })\n\n product_or_variant.images << product_image if product_image.save\n end", "title": "" }, { "docid": "ba87b954641161cf2ceec127f367f5c8", "score": "0.6054233", "text": "def new\n @shop = current_user.shops.build\n # @image = @shop.shop_images.build\n end", "title": "" }, { "docid": "691faa395199a10f5de3fa55bfd65e33", "score": "0.60518044", "text": "def show\n @user.comprobar_link_imagen!\n end", "title": "" }, { "docid": "5f4f3f3d800471913ee70e0a95dc77ab", "score": "0.605127", "text": "def create\n # logger.info params[:images][:direct_upload_url]\n store = Store.find(params[:store_id])\n @product = store.products.create(product_params)\n @product.picture = params[:product][:picture] \n # @image = @product.images.create!(image_params)\n\n respond_to do |format|\n if @product.save\n format.html { redirect_to([@product.store, @product], notice: 'Product was successfully created.') }\n format.json { render action: 'show', status: :created, location: @product }\n else\n format.html { render action: 'new' }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38a9568a0c38b13f3ea4103a5de300fd", "score": "0.6048274", "text": "def create\n @model = User.new(model_params)\n attach_img(@model, params.require(:user), :avatar)\n respond_to do |format|\n if @model.save\n format.json { render :show, status: :created, location: @model }\n else\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n\n end", "title": "" }, { "docid": "7210707a9a58e3bf68e538188b955531", "score": "0.60474664", "text": "def update\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update_attributes(user_params)\n unless @user.pictures.first.nil?\n @user.propic_id = @user.pictures.last.id\n end\n @user.save\n #ImageAsset.new(:attachment => @user[:p, :user_id => @user.id)\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": "e768d61e85d45e27da940d5730708a18", "score": "0.6046207", "text": "def new\n # @pic = Pic.new this is a problem - it isnt specifying WHO created the picture - because i want to diplsay the user id who created the pic (in user.rb) i have to use the below line of code.\n @pic = current_user.pics.build\n end", "title": "" }, { "docid": "062bd74faf5e2edd0b9442bfe58dc9c5", "score": "0.60278016", "text": "def create\n @user = User.new(user_params)\n @user.image.attach(params[:user][:image])\n @user.image = \"default.png\"\n respond_to do |format|\n if @user.save\n format.html { redirect_to @user, notice: 'User was successfully created.' }\n format.json { render :show, status: :created, location: @user }\n else\n format.html { render :new }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4958b23820a5713104faaf4d7dd86e42", "score": "0.60266167", "text": "def create\n @image = Image.new(image_params)\n # current_user.images.create(image_params)\n @image.user_id = current_user.id\n respond_to do |format|\n if @image.save\n format.html { redirect_to @image, notice: 'Image was successfully created.' }\n format.json { render action: 'show', status: :created, location: @image }\n else\n format.html { render action: 'new' }\n format.json { render json: @image.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7566f5db01f8d3db887fd3a24f44b8e0", "score": "0.60206306", "text": "def productphoto_upload\n \n end", "title": "" }, { "docid": "58b5c9af4394186f85e22c3a1fcd8950", "score": "0.6020561", "text": "def set_user\n @user = User.with_attached_avatar.find(params[:id])\n end", "title": "" }, { "docid": "da1494030d19e0ad22863fa505699a21", "score": "0.60173273", "text": "def create\n @product = Product.new(product_params)\n @product.seller = current_user\n @product.status = 'Available'\n\n respond_to do |format|\n if @product.save\n # Get photos directly from the params and save them to the database one by one\n if params[:product][:images]\n params[:product][:images].each { |image|\n Photo.create(product: @product, image: image)\n }\n end\n\n format.html { redirect_to @product, notice: 'Product was successfully created.' }\n format.json { render :show, status: :created, location: @product }\n else\n format.html { render :new }\n format.json { render json: @product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58b4a7e19dff9bc95958735a522703c0", "score": "0.6017256", "text": "def set_product\n @product = current_user.products.find(params[:id])\n end", "title": "" }, { "docid": "58b4a7e19dff9bc95958735a522703c0", "score": "0.6017256", "text": "def set_product\n @product = current_user.products.find(params[:id])\n end", "title": "" }, { "docid": "35eed2c1cb01f50b1513c7f100787b68", "score": "0.60125023", "text": "def by_user\n user = find_obj_or_goto_index(\n model: User, obj_id: params[:by_user].to_s,\n index_path: images_path\n )\n return unless user\n\n query = create_query(:Image, :by_user, user: user)\n show_selected_images(query)\n end", "title": "" } ]
7711752999db370e46b37b5bfafbd8e9
Sign and send a request to the AWS REST API. Method is defined as an "Action" parameter. parameters is an array because order is important for the signing process.
[ { "docid": "176e0bee10b40522e0c215afc0a82842", "score": "0.58783334", "text": "def query(parameters, endpoint, access_key, secret_key, token = nil)\n timestamp = Time.now.utc.strftime('%Y-%m-%dT%H:%M:%SZ')\n\n parameters += [\n ['AWSAccessKeyId', access_key ],\n ['SignatureVersion', '2' ],\n ['SignatureMethod', 'HmacSHA256' ],\n ['Timestamp', timestamp ],\n ]\n if token\n parameters.push(['SecurityToken', token])\n end\n\n sorted_parameters = parameters.sort_by {|k,v| k }\n sorted_params_string = sorted_parameters.map {|k,v| \"#{uri_encode(k)}=#{uri_encode(v)}\" }.join('&')\n params_string = parameters.map {|k,v| \"#{uri_encode(k)}=#{uri_encode(v)}\" }.join('&')\n\n canonical_query = [\n 'GET',\n endpoint,\n '/',\n sorted_params_string\n ].join(\"\\n\")\n\n sha256 = OpenSSL::Digest::Digest.new('sha256')\n signature = OpenSSL::HMAC.digest(sha256, secret_key, canonical_query)\n signature = Base64.encode64(signature).strip\n signature = uri_encode(signature)\n\n req_path = \"/?#{params_string}&Signature=#{signature}\"\n\n retries = 5\n begin\n req = Net::HTTP::Get.new(req_path)\n\n http = Net::HTTP.new(endpoint, 443)\n http.use_ssl = true\n\n response = http.start { http.request(req) }\n\n response\n rescue StandardError, Timeout::Error => e\n Facter.debug(\"Error querying 'http://#{endpoint}/?#{sorted_params_string}' - retries left: #{retries}\")\n sleep 3\n retry if (retries -= 1) > 0\n end\nend", "title": "" } ]
[ { "docid": "53b1b750d17c588dee954ca3d0fc77fc", "score": "0.74963677", "text": "def request(action, params = {})\n # Use a copy so that we don't modify the caller's Hash, remove any keys that have nil or empty values\n params = params.reject { |key, value| value.nil? or value.empty?}\n \n timestamp = Time.now.getutc\n\n params.merge!( {\"Action\" => action,\n \"SignatureVersion\" => signature_version.to_s,\n \"SignatureMethod\" => 'HmacSHA256',\n \"AWSAccessKeyId\" => @access_key_id,\n \"Version\" => API_VERSION,\n \"Timestamp\" => timestamp.iso8601 } )\n\n query = params.sort.collect do |param|\n CGI::escape(param[0]) + \"=\" + CGI::escape(param[1])\n end.join(\"&\")\n\n req = {}\n\n req['X-Amzn-Authorization'] = get_aws_auth_param(timestamp.httpdate, @secret_access_key, action, signature_version)\n req['Date'] = timestamp.httpdate\n req['User-Agent'] = @user_agent\n\n response = connection.post(@path, query, req)\n \n response_class = AWS::SES.const_get( \"#{action}Response\" )\n result = response_class.new(action, response)\n \n if result.error?\n raise ResponseError.new(result)\n end\n \n result\n end", "title": "" }, { "docid": "d411382bd69e1b9ddb260a779dc4869c", "score": "0.6862355", "text": "def make_request(action, params, data='')\n\n @http.start do\n\n # remove any keys that have nil or empty values\n params.reject! { |key, value| value.nil? or value.empty?}\n\n params.merge!( {\"Action\" => action,\n \"SignatureVersion\" => \"2\",\n \"SignatureMethod\" => 'HmacSHA256',\n \"AWSAccessKeyId\" => @access_key_id,\n \"Version\" => api_version,\n \"Timestamp\"=>Time.now.getutc.iso8601} )\n\n sig = get_aws_auth_param(params, @secret_access_key, @server)\n\n query = params.sort.collect do |param|\n CGI::escape(param[0]) + \"=\" + CGI::escape(param[1])\n end.join(\"&\") + \"&Signature=\" + sig\n\n req = Net::HTTP::Post.new(@path)\n req.content_type = 'application/x-www-form-urlencoded'\n req['User-Agent'] = \"github-amazon-ec2-ruby-gem\"\n\n response = @http.request(req, query)\n\n # Make a call to see if we need to throw an error based on the response given by EC2\n # All error classes are defined in EC2/exceptions.rb\n aws_error?(response)\n return response\n\n end\n\n end", "title": "" }, { "docid": "148d42ffd03b724c688ba9caa59c14df", "score": "0.68420035", "text": "def signed_request(method, url, params = nil)\n args = Vidibus::Secure.sign_request(method, url, params, this.secret)\n self.send(method, *args)\n end", "title": "" }, { "docid": "66f0360496aab06e7c476ceaec50226f", "score": "0.6686085", "text": "def sign_method(method, parameters = {})\n raise ArgumentError, \"Method required\" if method.empty?\n \n parameters[\"api_key\"] = @api_key\n parameters[\"method\"] = method\n \n # Sort alphabetically and concatenate into one string using namevalue scheme.\n signature_string = parameters.sort.join(\"\")\n \n # And finally append the api secret\n signature_string += @api_secret\n\n Digest::MD5.hexdigest(signature_string)\n end", "title": "" }, { "docid": "c7a2cd8b24722d1e403ac219240d3665", "score": "0.65874016", "text": "def sign_request(options)\n args = Hash[options[:params].sort_by{|k,v| k}].map{|k,v| \"#{k}=#{v}\"}.join\n options[:params][:sig] = Digest::MD5.hexdigest(args + options[:api_secret])\n Hash[options[:params].sort_by{|k,v| k}].map{|k,v| \"#{k}=#{v}\"}.join('&')\n end", "title": "" }, { "docid": "58a76410e766caef578e3e285de544f8", "score": "0.6532032", "text": "def sign(params)\n Adyen::Signature.sign(params, :rest)\n end", "title": "" }, { "docid": "c6359dba17bf50552459375aeb4f8652", "score": "0.6531593", "text": "def call(action, params = {}, &block)\n query = {\n 'Action' => camelcase(action),\n 'Version' => self.class::API_VERSION,\n 'Timestamp' => Time.now.utc.strftime('%Y-%m-%dT%H:%M:%SZ')\n }\n query.merge! queryize_params(params)\n query.merge! @signer.signature(query) if @signer\n\n request = Request.new(self, method, query)\n request_id = \"#{self.class.name}##{action} (#{request.object_id})\"\n AWS.logger.info \"Calling #{request_id}\"\n AWS.logger.debug \"#{request_id} params: #{query}\"\n\n request.callback(&block) if block\n\n if AWS.logger.info?\n request.callback do |r|\n duration = Time.now - request.start_time\n AWS.logger.info \"Completed #{request_id} in #{duration} seconds\"\n AWS.logger.debug \"#{request_id} result: #{r.result}\"\n end\n\n request.errback do |r|\n duration = Time.now - request.start_time\n AWS.logger.info \"Failed #{request_id} in #{duration} seconds\"\n AWS.logger.debug \"#{request_id} result: #{r.result}\"\n end\n end\n\n handle_request(request)\n\n end", "title": "" }, { "docid": "9e2cc2e11cb0ab082b905d134955bc1d", "score": "0.6483733", "text": "def direct(params)\n aws_request.submit(params)\n end", "title": "" }, { "docid": "c65a303e03390c56778c329d145483a7", "score": "0.6434388", "text": "def direct(params)\n @aws_request.submit(params)\n end", "title": "" }, { "docid": "4daf11a9ff23c7230d3517f35e8d97df", "score": "0.64148074", "text": "def generate_request(method, path, params={}, body=nil, headers={}) # :nodoc:\n # Params\n params.delete_if{ |key, val| val.right_blank? }\n unless params.right_blank?\n path += \"?\" + params.to_a.collect{ |key,val| \"#{AwsUtils::amz_escape(key)}=#{AwsUtils::amz_escape(val.to_s)}\" }.join(\"&\")\n end\n # Headers\n headers['content-type'] ||= 'text/xml' if body\n headers['date'] = Time.now.httpdate\n # Auth\n signature = AwsUtils::sign(@aws_secret_access_key, headers['date'])\n headers['X-Amzn-Authorization'] = \"AWS3-HTTPS AWSAccessKeyId=#{@aws_access_key_id},Algorithm=HmacSHA1,Signature=#{signature}\"\n # Request\n path = \"#{@params[:service]}#{@params[:api_version]}/#{path}\"\n request = \"Net::HTTP::#{method.capitalize}\".right_constantize.new(path)\n request.body = body if body\n # Set request headers\n headers.each { |key, value| request[key.to_s] = value }\n # prepare output hash\n { :request => request,\n :server => @params[:server],\n :port => @params[:port],\n :protocol => @params[:protocol] }\n end", "title": "" }, { "docid": "fef98dc39f146ac4e72dfb57ee8468b5", "score": "0.63980466", "text": "def request(method, params)\n @client.request.execute(self.buildAPI(method), params)\n end", "title": "" }, { "docid": "b46d4059919aeaae119a214eb9ccbed0", "score": "0.6387847", "text": "def send_query_request(params)\n standard_options = {\n 'AWSAccessKeyId' => @access_key,\n 'Version' => API_VERSION,\n 'Timestamp' => Time.now.utc.strftime('%Y-%m-%dT%H:%M:%S.000Z'),\n 'SignatureVersion' => SIGNATURE_VERSION,\n 'SignatureMethod' => 'HmacSHA256'\n }\n params = standard_options.merge(params)\n\n #Put parameters into query string format\n params_string = params.delete_if{|k,v| v.nil?}.sort{|a,b|\n a[0].to_s <=> b[0].to_s\n }.collect{|key, val|\n \"#{CGI::escape(key.to_s)}=#{CGI::escape(val.to_s)}\"\n }.join('&')\n params_string.gsub!('+', '%20')\n\n #Create request signature\n signature_string = \"GET\\n#{host}\\n/\\n#{params_string}\"\n signature = sign(signature_string, 'sha256')\n\n #Attach signature to query string\n params_string << \"&Signature=#{CGI::escape(signature)}\"\n\n url = \"https://#{host}/?#{params_string}\"\n response = process_request('GET', url)\n if response.is_a?(Net::HTTPSuccess)\n response\n else\n raise Awsum::Error.new(response)\n end\n end", "title": "" }, { "docid": "bd4bbb92ff9822c51bf83c95d947c0e4", "score": "0.6366476", "text": "def sign(method, uri, headers); end", "title": "" }, { "docid": "bd020951c712b50dfc480c03b115649f", "score": "0.63317335", "text": "def generate_request(action, param={}) # :nodoc:\n param.each{ |key, value| param.delete(key) if (value.nil? || key.is_a?(Symbol)) }\n service_hash = { \"Action\" => action,\n \"AWSAccessKeyId\" => @aws_access_key_id }\n service_hash.update(param)\n service_params = signed_service_params(@aws_secret_access_key, service_hash, :get, @params[:server], '/')\n request = Net::HTTP::Get.new(\"/?#{service_params}\")\n # prepare output hash\n { :request => request, \n :server => @params[:server],\n :port => @params[:port],\n :protocol => @params[:protocol] }\n end", "title": "" }, { "docid": "e607576daaeb7ad2df52587f85d2f42c", "score": "0.6315213", "text": "def sign_request(method, url, form_args = {})\n @http.sign_request(method, url, form_args)\n end", "title": "" }, { "docid": "f18647c6123dc2e4a1dff3b21c186f4c", "score": "0.62945247", "text": "def api_call(action, args = {})\n timestamp, request_id = generate_request_id_tuple()\n request_signature = signature(timestamp, request_id)\n\n args = args.merge(\n Version: VERSION,\n ACSAccessKeyId: @access_key,\n Format: FORMAT,\n Timestamp: timestamp,\n Rndguid: request_id,\n Signature: request_signature,\n Action: action\n )\n\n response = @transport.send_request(args)\n if response.has_key? \"error\"\n fail AtlanticNetException.new(self, response, response[\"error\"][\"message\"])\n end\n\n response\n end", "title": "" }, { "docid": "753e30d36a7d6192547c3dbcb72525d9", "score": "0.62125933", "text": "def generate_rest_request(method, param) # :nodoc:\n sns_uri = param[:sns_url] ? URI(param[:sns_url]).path : '/'\n message = param[:message] # extract message body if nesessary\n # remove unset(=optional) and symbolyc keys\n param.each{ |key, value| param.delete(key) if (value.nil? || key.is_a?(Symbol)) }\n # created request\n param_to_str = param.to_a.collect{|key,val| key.to_s + \"=\" + CGI::escape(val.to_s) }.join(\"&\")\n param_to_str = \"?#{param_to_str}\" unless param_to_str.right_blank?\n request = \"Net::HTTP::#{method.capitalize}\".right_constantize.new(\"#{sns_uri}#{param_to_str}\")\n request.body = message if message\n # set main headers\n request['content-md5'] = ''\n request['Content-Type'] = 'text/plain'\n request['Date'] = Time.now.httpdate\n # generate authorization string\n auth_string = \"#{method.upcase}\\n#{request['content-md5']}\\n#{request['Content-Type']}\\n#{request['Date']}\\n#{CGI::unescape(sns_uri)}\"\n signature = AwsUtils::sign(@aws_secret_access_key, auth_string)\n # set other headers\n request['Authorization'] = \"AWS #{@aws_access_key_id}:#{signature}\"\n #request['AWS-Version'] = API_VERSION\n # prepare output hash\n { :request => request,\n :server => @params[:server],\n :port => @params[:port],\n :protocol => @params[:protocol] }\n end", "title": "" }, { "docid": "3adc33317fd168448b1ed8b59d3360d4", "score": "0.6209349", "text": "def send_s3_request(method = 'GET', options = {}, &block)\n bucket = options[:bucket] || ''\n key = options[:key] || ''\n parameters = options[:parameters] || {}\n data = options[:data]\n headers = {}\n (options[:headers] || {}).each { |k,v| headers[k.downcase] = v }\n\n #Add the host header\n host_name = \"#{bucket}#{bucket.blank? ? '' : '.'}#{host}\"\n headers['host'] = host_name\n\n # Ensure required headers are in place\n if !data.nil? && headers['content-md5'].nil?\n if data.respond_to?(:read)\n if data.respond_to?(:rewind)\n digest = Digest::MD5.new\n while chunk = data.read(1024 * 1024)\n digest << chunk\n end\n data.rewind\n\n headers['content-md5'] = Base64::encode64(digest.digest).gsub(/\\n/, '')\n end\n else\n headers['content-md5'] = Base64::encode64(Digest::MD5.digest(data)).gsub(/\\n/, '')\n end\n end\n if !data.nil? && headers['content-length'].nil?\n headers['content-length'] = (data.respond_to?(:lstat) ? data.lstat.size : data.size).to_s\n end\n headers['date'] = Time.now.rfc822 if headers['date'].nil?\n headers['content-type'] ||= ''\n if !data.nil?\n headers['expect'] = '100-continue'\n end\n\n signature_string = generate_rest_signature_string(method, bucket, key, parameters, headers)\n puts \"signature_string: \\n#{signature_string}\\n\\n\" if ENV['DEBUG']\n\n signature = sign(signature_string)\n\n headers['authorization'] = \"AWS #{@access_key}:#{signature}\"\n\n url = \"https://#{host_name}#{key[0..0] == '/' ? '' : '/'}#{key}#{parameters.size == 0 ? '' : \"?#{parameters.collect{|k,v| v.nil? ? k.to_s : \"#{CGI::escape(k.to_s)}=#{CGI::escape(v.to_s)}\"}.join('&')}\"}\"\n\n process_request(method, url, headers, data) do |response|\n if response.is_a?(Net::HTTPSuccess)\n if block_given?\n block.call(response)\n else\n response\n end\n else\n raise Awsum::Error.new(response)\n end\n end\n end", "title": "" }, { "docid": "5a1fcfe50bfd444b8e27dfd196582e90", "score": "0.6145473", "text": "def private_request method, params = {}\n nonce = Time.now.to_i.to_s\n message = nonce + @client_id.to_s + @api_key\n sha256 = OpenSSL::Digest::SHA256.new\n hash = OpenSSL::HMAC.digest(sha256, @secret, message)\n signature = Base64.encode64(hash).chomp.gsub(\"\\n\",'')\n required = { 'key' => @api_key, 'nonce' => nonce, 'signature' => signature }\n params = required.merge(params)\n url = @api_url + method\n raise ArgumentError if not url.is_a? String\n uri = URI.parse url\n http = Net::HTTP.new uri.host, uri.port\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n req = Net::HTTP::Post.new(uri.path)\n req.set_form_data params\n res = http.request req\n data = res.body\n if not data.is_a? String or not data.is_json?\n raise RuntimeError, \"Server returned invalid data.\"\n end\n result = JSON.parse data\n end", "title": "" }, { "docid": "f0dfa4a2ca0ff59ad5e2ed5fffe87199", "score": "0.6115743", "text": "def generate_request(action, params={}) # :nodoc:\n # Sometimes we need to use queue uri (delete queue etc)\n # In that case we will use Symbol key: 'param[:queue_url]'\n service = params[:sns_url] ? URI(params[:sns_url]).path : '/'\n # remove unset(=optional) and symbolyc keys\n params.each{ |key, value| params.delete(key) if (value.nil? || key.is_a?(Symbol)) }\n # prepare output hash\n service_hash = { \"Action\" => action,\n \"Expires\" => (Time.now + REQUEST_TTL).utc.strftime(\"%Y-%m-%dT%H:%M:%SZ\"),\n \"AWSAccessKeyId\" => @aws_access_key_id }\n #\"Version\" => API_VERSION }\n service_hash.update(params)\n service_params = signed_service_params(@aws_secret_access_key, service_hash, :get, @params[:server], service)\n request = Net::HTTP::Get.new(\"#{AwsUtils::URLencode(service)}?#{service_params}\")\n # prepare output hash\n { :request => request,\n :server => @params[:server],\n :port => @params[:port],\n :protocol => @params[:protocol] }\n end", "title": "" }, { "docid": "5846c1a67e6ae04c52869af44a3378df", "score": "0.61137044", "text": "def signature(method, parameters, time, nonce)\n formatted_method = method.to_s.camelize(:lower)\n parameters ||= {}\n input = convert_array_to_hash(parameters.values)\n options = {\n '__method' => formatted_method,\n '__service' => api_service,\n '__hostname' => @endpoint,\n '__timestamp' => time,\n '__nonce' => nonce\n\n }\n input.merge!(options)\n raise \"Invalid RSA key\" unless @key =~ /-----BEGIN (RSA )?PRIVATE KEY-----(.*)-----END (RSA )?PRIVATE KEY-----/sim\n serialized_input = serialize_parameters(input)\n\n digest = Digest::SHA512.new.digest(serialized_input)\n asn_header = \"\\x30\\x51\\x30\\x0d\\x06\\x09\\x60\\x86\\x48\\x01\\x65\\x03\\x04\\x02\\x03\\x05\\x00\\x04\\x40\"\n\n # convert asn_header literal to ASCII-8BIT\n if RUBY_VERSION.split('.')[0] == \"2\"\n asn = asn_header.b + digest\n else\n asn = asn_header + digest\n end\n private_key = OpenSSL::PKey::RSA.new(@key)\n encrypted_asn = private_key.private_encrypt(asn)\n readable_encrypted_asn = Base64.encode64(encrypted_asn)\n urlencode(readable_encrypted_asn)\n end", "title": "" }, { "docid": "f5e907cb42aaf84aeb83ad5942000549", "score": "0.6113461", "text": "def generate_request(action, params={}) # :nodoc:\n # Sometimes we need to use queue uri (delete queue etc)\n # In that case we will use Symbol key: 'param[:queue_url]'\n queue_uri = params[:queue_url] ? URI(params[:queue_url]).path : '/'\n # remove unset(=optional) and symbolyc keys\n params.each{ |key, value| params.delete(key) if (value.nil? || key.is_a?(Symbol)) }\n # prepare output hash\n service_hash = { \"Action\" => action,\n \"Expires\" => (Time.now + REQUEST_TTL).utc.strftime(\"%Y-%m-%dT%H:%M:%SZ\"),\n \"AWSAccessKeyId\" => @aws_access_key_id,\n \"Version\" => API_VERSION,\n \"SignatureVersion\" => signature_version }\n service_hash.update(params)\n # prepare string to sight\n string_to_sign = case signature_version\n when '0' : service_hash[\"Action\"] + service_hash[\"Expires\"]\n when '1' : service_hash.sort{|a,b| (a[0].to_s.downcase)<=>(b[0].to_s.downcase)}.to_s\n end\n service_hash['Signature'] = AwsUtils::sign(@aws_secret_access_key, string_to_sign)\n request_params = service_hash.to_a.collect{|key,val| key.to_s + \"=\" + CGI::escape(val.to_s) }.join(\"&\")\n request = Net::HTTP::Get.new(\"#{queue_uri}?#{request_params}\")\n # prepare output hash\n { :request => request, \n :server => @params[:server],\n :port => @params[:port],\n :protocol => @params[:protocol] }\n end", "title": "" }, { "docid": "d7e58eb72e472855b492117962e9d500", "score": "0.6108803", "text": "def request(method, *params)\n @base_uri ||= Echosign::Request.get_base_uris(@token).fetch('api_access_point')\n Echosign::Request.send(method, @token, @base_uri, *params)\n end", "title": "" }, { "docid": "e9e0f9ebc28974fb0f43d92cfb74b981", "score": "0.6098261", "text": "def _send_request(url, values, sign: false, post: true)\n headers = {}\n\n if sign\n values['timestamp'] = Time.now.to_i\n values['nonce'] = SecureRandom.hex(10)\n values['endpoint'] = url[4..-1]\n headers['cpt-key'] = @key\n signdata = Base64.urlsafe_encode64(JSON.generate(values))\n headers['cpt-hmac'] = OpenSSL::HMAC.hexdigest('sha512', @secret, signdata)\n data = { data: signdata }\n else\n data = values\n end\n if post\n response = _send(:post, \"#{@baseURL}#{url}\", headers, payload: data)\n else\n url = \"#{@baseURL}#{url}\"\n url += \"?#{URI.encode_www_form(data)}\" if data.length > 0\n response = _send(:get, url, headers)\n end\n _format_response(response)\n end", "title": "" }, { "docid": "54e6943e8981221fb4d8e2df65c9a640", "score": "0.60937154", "text": "def add_signature!(params)\n \n # supply timestamp, signature method, signature version and access key if not already provided\n params[\"Timestamp\"] ||= Time.now.iso8601\n params[\"AWSAccessKeyId\"] ||= access_key\n params[\"SignatureMethod\"] ||= \"HmacSHA256\"\n params[\"SignatureVersion\"] ||= \"2\"\n # Existing \"Signature\"? That's gotta go before we generate a new\n # signature and add it.\n params.delete(\"Signature\")\n \n query_string = canonical_querystring(params)\n \n string_to_sign = string_to_sign(query_string)\n \n sign = OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha256'), @secret_key, string_to_sign)\n # chomp is important! the base64 encoded version will have a newline at the end\n signature = Base64.encode64(sign).chomp\n \n params[\"Signature\"] = signature\n \n #order doesn't matter for the actual request, we return the hash\n #and let client turn it into a url.\n return params\n end", "title": "" }, { "docid": "e487ce71a8c8d305072ab6d0d60cdcc4", "score": "0.606088", "text": "def sign(parameters)\n parameters.merge!(client_and_channel_by_key)\n path_and_query = \"#{URI.parse(provider_url).path}?\"\\\n \"#{URI.encode_www_form(parameters)}\"\n raw_private_key = url_safe_base64_decode(secret_by_key)\n digest = OpenSSL::Digest.new('sha1')\n raw_signature = OpenSSL::HMAC.digest(\n digest, raw_private_key, path_and_query\n )\n parameters[:signature] = url_safe_base64_encode(raw_signature)\n parameters\n end", "title": "" }, { "docid": "38d1a946ea561314da295c6bce92daa5", "score": "0.6053254", "text": "def sign_request(request, content = nil, headers = {})\n unless request.is_a?(Net::HTTPRequest)\n raise ArgumentError,\n \"Expected Net::HTTPRequest, not #{request.class}\"\n end\n\n unless request.path =~ /^(\\/.*?)(?:\\?.*)?$/i\n raise S3Error, \"Invalid request path: #{request.path}\"\n end\n \n path = $1\n \n request['Host'] = REST_ENDPOINT\n request['Date'] = Time.new.httpdate()\n \n if content.nil?\n request['Content-Length'] = 0\n elsif content.is_a?(IO)\n # Generate an MD5 hash of the stream's contents.\n md5 = Digest::MD5.new\n content.rewind\n \n while buffer = content.read(65536) do\n md5 << buffer\n end\n \n content.rewind\n \n # Set headers.\n request['Content-Type'] = 'binary/octet-stream'\n request['Content-Length'] = content.stat.size\n request['Content-MD5'] = Base64.encode64(md5.digest).strip\n else\n request['Content-Type'] = 'binary/octet-stream'\n request['Content-Length'] = content.length\n request['Content-MD5'] = Base64.encode64(Digest::MD5.digest(\n content)).strip\n end\n\n headers.each {|key, value| request[key] = value }\n \n hmac = OpenSSL::HMAC.new(@secret_access_key, OpenSSL::Digest::SHA1.new)\n hmac << \"#{request.method}\\n#{request['Content-MD5']}\\n\".toutf8 +\n \"#{request['Content-Type']}\\n#{request['Date']}\\n\".toutf8\n \n request.to_hash.keys.sort.each do |key|\n if key =~ /^x-amz-/i\n hmac << \"#{key.downcase.strip}:#{request[key].strip}\\n\".toutf8\n end\n end\n \n hmac << path.toutf8\n \n signature = Base64.encode64(hmac.digest).strip\n \n request['Authorization'] = \"AWS #{@access_key_id}:#{signature}\"\n \n return request\n end", "title": "" }, { "docid": "efdc96591d7127d75244521f433596af", "score": "0.605224", "text": "def signature(params)\n signature_params = {\n AWSAccessKeyId: access_key,\n SignatureVersion: 2,\n SignatureMethod: 'HmacSHA256'\n }\n param_string = signable_params params.merge(signature_params)\n signature_params[:Signature] = hmac_sign param_string\n signature_params\n end", "title": "" }, { "docid": "7d732c374953960dcd9edb55b48eb836", "score": "0.60476327", "text": "def sign(method, host, path, params)\n\tcanon = [method.upcase, host.downcase, path]\n\targs = []\n\tescape_regex = Regexp.new(\"[^-_.~a-zA-Z\\\\d]\")\n\tparams.sort.each do |k, v|\n\t\targs << URI.escape(k, escape_regex) + '=' + URI.escape(v, escape_regex)\n\tend\n\tcanon << args.join(\"&\")\n\tcanon = canon.join(\"\\n\")\n\n\thmac = OpenSSL::HMAC.new(SKEY, 'sha1')\n\thmac.update(canon)\n\n\t# This is the string for the Authorization header.\n\t# (Note: removing all linebreaks from Base64 output as required)\n\t\"Basic \" + Base64.encode64(IKEY + \":\" + hmac.hexdigest).gsub(/\\n/, '')\nend", "title": "" }, { "docid": "7e4be2da020091bcf760dd38453b6127", "score": "0.60446966", "text": "def signature(method, parameters, time, nonce)\n formatted_method = method.to_s.lower_camelcase\n parameters ||= {}\n input = convert_array_to_hash(parameters.values)\n options = {\n '__method' => formatted_method,\n '__service' => SERVICE,\n '__hostname' => @endpoint,\n '__timestamp' => time,\n '__nonce' => nonce\n\n }\n input.merge!(options)\n raise \"Invalid RSA key\" unless @key =~ /-----BEGIN (RSA )?PRIVATE KEY-----(.*)-----END (RSA )?PRIVATE KEY-----/sim\n serialized_input = serialize_parameters(input)\n\n digest = Digest::SHA512.new.digest(serialized_input)\n asn_header = \"\\x30\\x51\\x30\\x0d\\x06\\x09\\x60\\x86\\x48\\x01\\x65\\x03\\x04\\x02\\x03\\x05\\x00\\x04\\x40\"\n asn = asn_header + digest\n private_key = OpenSSL::PKey::RSA.new(@key)\n encrypted_asn = private_key.private_encrypt(asn)\n readable_encrypted_asn = Base64.encode64(encrypted_asn)\n urlencode(readable_encrypted_asn)\n end", "title": "" }, { "docid": "5f71a919015816894022a6623f4a0fbf", "score": "0.5971865", "text": "def add_signature!(params)\n \n # supply timestamp and access key if not already provided\n params[\"Timestamp\"] ||= Time.now.iso8601\n params[\"AWSAccessKeyId\"] ||= access_key\n # Existing \"Signature\"? That's gotta go before we generate a new\n # signature and add it. \n params.delete(\"Signature\")\n\n query_string = canonical_querystring(params)\n\n string_to_sign = string_to_sign(query_string)\n \n # chomp is important! the base64 encoded version will have a newline at the end\n # which amazon does not want. \n digest = OpenSSL::Digest.new('sha256')\n signature = Base64.encode64(OpenSSL::HMAC.digest(digest, secret_key, string_to_sign)).chomp\n \n params[\"Signature\"] = signature\n\n #order doesn't matter for the actual request, we return the hash\n #and let client turn it into a url.\n return params\n end", "title": "" }, { "docid": "12fa4a32e8bf7b4ee39397b7aba9bea7", "score": "0.5960112", "text": "def create_request_url(params)\n params['merchant_id'] = MERCHANT_ID\n params['api_username'] = API_USERNAME\n params['api_password'] = API_PASSWORD\n params['algo_mode'] = 'hmac'\n params = params.sort.to_h\n\n data = data = params.map(&:last).join('')\n data_sign = OpenSSL::HMAC.hexdigest('SHA1', SECURE_PASS, data)\n\n params['data_sign'] = data_sign\n\n request = Net::HTTP.post_form(URI.parse(\"#{BAOKIM_URL}\"), params)\n\n return request\n end", "title": "" }, { "docid": "420c16113fc3bad9e173da8ad06e33b0", "score": "0.5953552", "text": "def call(params)\n raise \"Cannot call the Amazon API without key and secret key.\" \\\n if configuration.key.blank? || configuration.secret.blank?\n\n debug = configuration.debug\n\n #get the signed query, and assemble the querystring\n log :debug, \"Started Amazonian request for params: #{params.map {|p| \"#{p[0]}=>#{p[1]}\" }.join ','}\" if debug\n\n #memoize the last request for faster API querying...\n query = assemble_querystring params\n if configuration.cache_last && query == @query && @response && @response.body\n log :debug, \"MEMO'D! Shortcutting API call for dup request.\"\n return Crack::XML.parse @response.body\n end\n @query = query\n\n #sign the query\n signed = sign_query query\n\n #assemble the full URL\n @request = \"http://#{configuration.host}#{configuration.path}?#{signed}\"\n\n #make the call\n log :info, \"performing rest call to '#{@request}'\" if debug\n @response = patron.get @request\n\n log :debug, \"Response Code: #{@response.status}\" if debug\n\n #todo, this memo logic is broken....an error code is not always without a body\n log :error, \"Amazon API Error: #{@response.status}\" if @response.status >= 400\n\n #parse the response and return it\n Crack::XML.parse @response.body\n end", "title": "" }, { "docid": "2e89b5f3305a788665ab794886e025ed", "score": "0.59425825", "text": "def send(params = {})\n post @endpoint, params\n end", "title": "" }, { "docid": "3224c8b9a7a01afb7ec6369d49a83ffc", "score": "0.5939278", "text": "def api_request(method:, path:, params: {})\n authenticate_client\n begin\n RestClient::Request.execute(\n method: method,\n url: url(path),\n payload: params.to_json,\n headers: headers\n )\n rescue RestClient::ExceptionWithResponse => err\n ErrorParser.parse_error(err.response)\n end\n end", "title": "" }, { "docid": "70b7c98d139eff09646f50c744ba612d", "score": "0.593663", "text": "def call(action, params={}, headers={}, options={})\n @api.call(@name, action, params, headers, options)\n end", "title": "" }, { "docid": "b7feb88ec4fbeefdf7456e58f9c0a43e", "score": "0.5933492", "text": "def build_request(method, path, options = {})\n if options[:bucket]\n path = \"/#{options[:bucket]}/#{path}\".gsub(\"//\", \"/\")\n end\n\n request = SimpleAWS::Request.new method, self.uri, path\n\n (options[:params] || {}).each do |k, v|\n request.params[k] = v\n end\n\n (options[:headers] || {}).each do |k, v|\n request.headers[k] = v\n end\n\n if options[:file]\n options[:body] = options.delete(:file)\n end\n\n signing_params = {}\n request.params.delete_if {|k, v|\n if k =~ /^response-/i\n signing_params[k] = v\n true\n end\n }\n\n if signing_params.length > 0\n to_add = signing_params.map {|k, v|\n \"#{k}=#{v}\"\n }.join(\"&\")\n\n request.path = request.path + \"?#{to_add}\"\n end\n\n request.body = options[:body]\n\n if request.body.respond_to?(:read)\n request.headers[\"Content-Type\"] ||= \"application/octet-stream\"\n request.headers[\"Content-Length\"] = File.size(request.body).to_s\n request.headers[\"Expect\"] = \"100-continue\"\n end\n\n request\n end", "title": "" }, { "docid": "c1b6c0f54687f4f202003e4be4c81e1c", "score": "0.5930141", "text": "def send(params = {})\n post @endpoint, params\n end", "title": "" }, { "docid": "bca237cc7f7aa30a74488af0802561d6", "score": "0.59298", "text": "def request(method, path, params={}, signature_params=params)\n # request_setup = request_setup(method, path, params, signature_params)\n # connection.send(method.to_sym, path, signed_parameters).env\n connection.send(method.to_sym, path, signed_parameters(params)).env\n rescue Faraday::Error::ClientError\n raise AmazonPa::Error::ClientError\n end", "title": "" }, { "docid": "581edb5f2a6595255d0cfa7b954aa292", "score": "0.59189713", "text": "def sign(parameters)\n phrase = []\n parameters.sort.to_h.each do |k, v|\n phrase << [k, v].join('=')\n end\n phrase.push(@options[:signature_phrase])\n phrase.unshift(@options[:signature_phrase])\n Digest::SHA256.hexdigest(phrase.join)\n end", "title": "" }, { "docid": "1d5854074b06deb8238c771a1a237132", "score": "0.5912537", "text": "def sign_request(access_key, secret_key, ua='enstratus.rb', http_method='GET', path='/geography/Cloud', api_version='2012-02-29')\n\n timestamp = (Time.now.to_i * 1000)\n sign_path = \"/api/enstratus/#{api_version}#{path}\"\n\n parts = []\n parts << access_key << http_method << sign_path << timestamp << ua\n to_sign = parts.join(\":\")\n\n digest = OpenSSL::HMAC.digest(OpenSSL::Digest::Digest.new('sha256'), secret_key, to_sign)\n b64auth = Base64.encode64(digest).strip\n \nend", "title": "" }, { "docid": "750c06decfffcfa7baeb60240c203cf9", "score": "0.5898703", "text": "def generate_request(action, param={}) # :nodoc:\n # For operation requests on a queue, the queue URI will be a parameter,\n # so we first extract it from the call parameters. Next we remove any\n # parameters with no value or with symbolic keys. We add the header\n # fields required in all requests, and then the headers passed in as\n # params. We sort the header fields alphabetically and then generate the\n # signature before URL escaping the resulting query and sending it.\n queue_uri = param[:queue_url] ? URI(param[:queue_url]).path : '/'\n param.each{ |key, value| param.delete(key) if (value.nil? || key.is_a?(Symbol)) }\n request_hash = { \"Action\" => action,\n \"Expires\" => (Time.now + REQUEST_TTL).utc.strftime(\"%Y-%m-%dT%H:%M:%SZ\"),\n \"AWSAccessKeyId\" => @aws_access_key_id,\n \"Version\" => API_VERSION,\n \"SignatureVersion\" => SIGNATURE_VERSION }\n request_hash.update(param)\n request_data = request_hash.sort{|a,b| (a[0].to_s.downcase)<=>(b[0].to_s.downcase)}.to_s\n request_hash['Signature'] = AwsUtils::sign(@aws_secret_access_key, request_data)\n request_params = request_hash.to_a.collect{|key,val| key.to_s + \"=\" + val.to_s }.join(\"&\")\n request = Net::HTTP::Get.new(AwsUtils.URLencode(\"#{queue_uri}?#{request_params}\"))\n # prepare output hash\n { :request => request, \n :server => @params[:server],\n :port => @params[:port],\n :protocol => @params[:protocol] }\n end", "title": "" }, { "docid": "42c37694e85ad8120682487b8f6e9e1b", "score": "0.5883123", "text": "def _sign(request_url)\n config = Base.config\n public_key = config.public_key\n private_key = config.private_key\n timestamp = Time.now.to_i\n\n remote_addr = ENV['REMOTE_ADDR'].nil? ? '82.77.82.161' : ENV['REMOTE_ADDR']\n\n headers = {\n 'X-MW-PUBLIC-KEY': public_key,\n 'X-MW-REMOTE-ADDR': remote_addr,\n 'X-MW-TIMESTAMP': timestamp,\n }\n @client.add_header(headers)\n\n params = headers\n\n params.merge!(@client.params_post).merge!(@client.params_put).merge!(@client.params_delete)\n\n sorted_params = Base.sort_by_key(params, true) {|x, y| x.to_s.downcase <=> y.to_s}\n\n separator = '?'\n if request_url.include? \"?\"\n if @client.params_get.empty?\n separator = ''\n else\n separator = '&'\n end\n end\n\n signature_string = @client.method.upcase + ' ' + request_url + separator + URI.encode_www_form(Base.encode(sorted_params))\n\n hmac = OpenSSL::HMAC.hexdigest('sha1', private_key, signature_string)\n\n @client.add_header({'X-MW-SIGNATURE': hmac})\n end", "title": "" }, { "docid": "00e8897a4b4902e145909203f4c11631", "score": "0.58731395", "text": "def request method, params\n self.class.request(method, params)\n end", "title": "" }, { "docid": "43755d97a1de5d32a312e5cd14b7a825", "score": "0.58722436", "text": "def request(method, params = {})\n http = Net::HTTP.new(Api::ADDRESS, (@https ? 443 : 80))\n http.use_ssl = @https\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n request = Net::HTTP::Post.new(Api::ENDPOINT+method.to_s)\n request.basic_auth @username, @password\n request.set_form_data(params)\n http.start { http.request(request) }\n end", "title": "" }, { "docid": "406bbcb2a5d5776a0c4f8c5f4785c510", "score": "0.586389", "text": "def send_request(params) \n str_block = \"\"\n params.each{|method, value| \n if value.nil?\n str_block << \"#{method} nil \\n\"\n else\n str_block << \"#{method} '#{value}'\\n\"\n end\n }\n \n client.request do\n eval(str_block)\n end\n end", "title": "" }, { "docid": "843ea4301830aa36e4407307676fe71c", "score": "0.58601624", "text": "def generate_rest_request(method, headers) # :nodoc:\n # calculate request data\n server, path, path_to_sign = fetch_request_params(headers)\n data = headers[:data]\n # remove unset(==optional) and symbolyc keys\n headers.each{ |key, value| headers.delete(key) if (value.nil? || key.is_a?(Symbol)) }\n #\n headers['content-type'] ||= ''\n headers['date'] = Time.now.httpdate\n # create request\n request = \"Net::HTTP::#{method.capitalize}\".constantize.new(path)\n request.body = data if data\n # set request headers and meta headers\n headers.each { |key, value| request[key.to_s] = value }\n #generate auth strings\n auth_string = canonical_string(request.method, path_to_sign, request.to_hash)\n signature = AwsUtils::sign(@aws_secret_access_key, auth_string)\n # set other headers\n request['Authorization'] = \"AWS #{@aws_access_key_id}:#{signature}\"\n # prepare output hash\n { :request => request, \n :server => server,\n :port => @params[:port],\n :protocol => @params[:protocol] }\n end", "title": "" }, { "docid": "e8ef096234ec812b905039cc45ae4ad7", "score": "0.58510226", "text": "def signed_request(method, uri, body = nil, headers = nil)\n # Add the OAuth resource request signature if we have credentials\n if @access_token\n parameters = {}\n if query = uri.query\n parameters.update(CGI.parse(query))\n end \n case method\n when 'POST', 'PUT'\n if body.is_a?(Hash) && !body.any? { |k, v| v.is_a?(IO) }\n parameters.update(body)\n end\n end\n uri = uri.dup\n uri.query = resource_access_query(method, uri, parameters)\n end\n return [method, uri, body, headers]\n end", "title": "" }, { "docid": "3f4a524791b79649eb9e73bcbac96758", "score": "0.58474344", "text": "def add_signature!(params)\n\n # supply timestamp and access key if not already provided\n params[\"Timestamp\"] ||= Time.now.iso8601\n params[\"AWSAccessKeyId\"] ||= access_key\n # Existing \"Signature\"? That's gotta go before we generate a new\n # signature and add it.\n params.delete(\"Signature\")\n\n query_string = canonical_querystring(params)\n\n string_to_sign = string_to_sign(query_string)\n\n hmac = HMAC::SHA256.new( secret_key )\n hmac.update( string_to_sign )\n # chomp is important! the base64 encoded version will have a newline at the end\n signature = Base64.encode64(hmac.digest).chomp\n\n params[\"Signature\"] = signature\n\n #order doesn't matter for the actual request, we return the hash\n #and let client turn it into a url.\n return params\n end", "title": "" }, { "docid": "c5ee3f0c61fd3bc71f7c3fe343bf5079", "score": "0.58413416", "text": "def post_request(method, params)\n post_params = { \"api_key\" => FACEBOOK_API_KEY, \n \"call_id\" => Time.now.to_f.to_s, \n \"method\" => method, \n \"v\" => FACEBOOK_API_VERSION,\n \"session_key\" => session_key }.merge(params.stringify_keys) # Net::HTTP (and Facebook prob) expects keys to be strings\n post_http_request(FACEBOOK_API_URL, FACEBOOK_API_PATH, post_params.merge({ \"sig\" => signature_from(post_params) } ))\n end", "title": "" }, { "docid": "aa627aa6b217baf2d5cd9efcca8c198b", "score": "0.5836099", "text": "def request(action, params={}, attachment=nil, attachment_name=nil)\n accesskeyid, signature = generate_accesskeyid\n params ||= {}\n\n params.merge! :Version => @version unless params.has_key?(:Version)\n params.merge! :Locale => @locale unless params.has_key?(:Locale)\n params.merge! :Action => action,\n :AccessKeyId => accesskeyid,\n :Signature => signature\n\n begin\n if attachment.nil?\n @uri.query = encode_params(params)\n resp = @service.request_get(@uri.request_uri, @headers)\n else\n #multipart post\n boundary = \"BOUNDARY#{Time.now.to_i}\"\n body = create_multipart_body(params, attachment, attachment_name, boundary)\n @headers['Content-Type'] = \"multipart/form-data; boundary=#{boundary}\"\n @uri.query = nil #clear query params from previous request\n\n resp = @service.request_post(@uri.request_uri, body, @headers)\n end\n rescue => e\n # special treatment for errors like \"Errno::ETIMEDOUT: Connection timed out - connect(2)\"? (when proxy not set)\n raise e\n end\n\n# p resp.body\n # API endpoint only returns HTTPSuccess, so different code means connection issues (http proxy, etc.)\n unless resp.is_a?(Net::HTTPSuccess)\n $stderr.print 'error: ' + $!\n raise $!\n end\n\n xml = XmlSimple.xml_in(resp.body)\n #check for connection errors, incl. NTP sync and auth related errors\n raise \"#{xml['responseStatus'][0]}: #{xml['responseMessage'][0]}\" unless xml['responseStatus'].to_s =~ /SUCCESS/\n\n xml\n end", "title": "" }, { "docid": "e0094f3a3b0ca977ed3125669d8722fc", "score": "0.58246607", "text": "def signature(params)\n # always sign the parameters with the API secret\n return signature_helper(params, @api_secret)\n end", "title": "" }, { "docid": "226cb7e50d1430070a94b8a5f558cd2d", "score": "0.58209896", "text": "def generate_rest_request(method, param) # :nodoc:\n queue_uri = param[:queue_url] ? URI(param[:queue_url]).path : '/'\n message = param[:message] # extract message body if nesessary\n # remove unset(=optional) and symbolyc keys\n param.each{ |key, value| param.delete(key) if (value.nil? || key.is_a?(Symbol)) }\n # created request\n param_to_str = param.to_a.collect{|key,val| key.to_s + \"=\" + CGI::escape(val.to_s) }.join(\"&\")\n param_to_str = \"?#{param_to_str}\" unless param_to_str.blank?\n request = \"Net::HTTP::#{method.capitalize}\".constantize.new(\"#{queue_uri}#{param_to_str}\")\n request.body = message if message\n # set main headers\n request['content-md5'] = ''\n request['Content-Type'] = 'text/plain'\n request['Date'] = Time.now.httpdate\n # generate authorization string\n auth_string = \"#{method.upcase}\\n#{request['content-md5']}\\n#{request['Content-Type']}\\n#{request['Date']}\\n#{CGI::unescape(queue_uri)}\"\n signature = AwsUtils::sign(@aws_secret_access_key, auth_string)\n # set other headers\n request['Authorization'] = \"AWS #{@aws_access_key_id}:#{signature}\"\n request['AWS-Version'] = API_VERSION\n # prepare output hash\n { :request => request, \n :server => @params[:server],\n :port => @params[:port],\n :protocol => @params[:protocol] }\n end", "title": "" }, { "docid": "70eb4e6334570eea9ae4f9f49e4b6d32", "score": "0.58063424", "text": "def method_missing(method, *args)\n action = method.to_s.dasherize\n params = args.first\n\n request(action, params)\n end", "title": "" }, { "docid": "8801c0376bb852ea30b8bf4a36cfb653", "score": "0.57673645", "text": "def sign(method, uri, headers, body, debug = false, service_name=nil)\n @method = method.upcase\n @uri = uri\n @headers = headers\n @body = body\n @service = service_name || @uri.host.split(\".\", 2)[0]\n date_header = headers[\"Date\"] || headers[\"DATE\"] || headers[\"date\"]\n @date = (date_header ? Time.parse(date_header) : Time.now).utc.strftime(RFC8601BASIC)\n debug_logs if debug\n signed = headers.dup\n signed['Authorization'] = authorization(headers)\n signed\n end", "title": "" }, { "docid": "456cedd375cf321b107e91b5db063591", "score": "0.5753336", "text": "def request(req_type, path, url_params={}, form_params={}, data=nil,\n options={})\n\n # convert parameters to correct format\n url_params = jsonify_parameters(url_params)\n form_params = jsonify_parameters(form_params)\n\n # build full request path\n path = strip(path, '/')\n if path == ''\n request_url = @url\n else\n request_url = @url + path + '/'\n end\n\n content_type = ''\n request_body = form_params\n if data\n content_type = 'application/json'\n request_body = data\n end\n\n headers = {:params => url_params}\n if content_type != ''\n headers[:content_type] = content_type\n end\n\n if @token_auth\n headers[:authorization] = 'Token ' + @token\n else\n json_hash = ''\n # if uploading data, compute sha1 hash\n if data\n sha1 = Digest::SHA1.digest(data)\n json_hash = Base64.encode64(sha1)\n end\n\n # add key_id to url parameters\n url_params.merge!(:key_id => @key_id)\n \n # parameters for sign string are url parameters and form parameters\n sign_params = url_params.merge(form_params)\n\n # request expires 2 minutes from now\n expires = (Time.now.to_f * 1000).to_i + 120000\n\n sign_string = req_type + \"\\n\"\n sign_string += @api_name + \"\\n\"\n sign_string += \"/#{@version}/#{path}/\\n\"\n sign_string += json_hash.chomp + \"\\n\"\n sign_string += content_type + \"\\n\"\n sign_string += expires.to_s + \"\\n\"\n\n # alphabetical key (symbol) order\n sorted_params = sign_params.sort_by {|sym| sym.to_s}\n\n # iterate parameters alphabetically by symbol\n sorted_params.each do |option|\n s = \"#{option[0]}: #{url_encode(option[1])}\\n\"\n sign_string += s\n end\n\n digested = OpenSSL::HMAC.digest('sha1', @secret, sign_string)\n encoded = Base64.encode64(digested).chomp\n\n # add sig, expires to params\n url_params.merge!(:sig => encoded, :expires => expires)\n\n # add the session cookie\n headers[:cookie] = @session_cookie\n end\n\n begin\n # make the request\n method = RestClient.method(req_type.downcase)\n if ['PUT', 'POST', 'PATCH'].include?(req_type)\n # these have a request body\n response = method.call(request_url, request_body, headers)\n else\n response = method.call(request_url, headers)\n end\n\n # update the cookie\n if !@token_auth and response.headers[:set_cookie]\n session_cookie = response.headers[:set_cookie].select {|a| a.match(/^session/)}\n @session_cookie = session_cookie[0]\n end\n rescue RestClient::Exception => e\n begin\n message = JSON.parse(e.http_body)\n rescue JSON::ParserError\n message = e.http_body\n end\n raise LuminosoError.new(message, e.http_code)\n end\n\n if options[:raw]\n return response\n else\n return JSON.parse(response)['result']\n end\n end", "title": "" }, { "docid": "da1364b08168b9b39bace86935263d5b", "score": "0.5741172", "text": "def make_request(method, path, options = {})\n @api_service.make_request(method, path, options.merge(envelope_key: envelope_key))\n end", "title": "" }, { "docid": "bd1a421d5507c76535e5cc495028728a", "score": "0.57370317", "text": "def request(api_method, parameters = {}, request_method = 'get')\n Base.request(api_method, parameters, request_method)\n end", "title": "" }, { "docid": "bdeff3798cfa6fe5c8e660237873dbbe", "score": "0.57276464", "text": "def perform_request(method, path, params={}, body=nil, headers=nil)\n client.perform_request method, path, params, body, headers\n end", "title": "" }, { "docid": "462b4a41c4058ca05d5395d2e322decc", "score": "0.57134724", "text": "def send_request(params)\n if @project_id\n params['projectId'] = @project_id\n end\n params['response'] = 'json'\n params['apiKey'] = @api_key\n\n params_arr = []\n params.sort.each { |elem|\n params_arr << elem[0].to_s + '=' + CGI.escape(elem[1].to_s).gsub('+', '%20').gsub(' ','%20')\n }\n data = params_arr.join('&')\n signature = OpenSSL::HMAC.digest('sha1', @secret_key, data.downcase)\n signature = Base64.encode64(signature).chomp\n signature = CGI.escape(signature)\n\n if @api_url.nil? || @api_url.empty?\n puts \"Error: Please specify a valid API URL.\"\n exit 1\n end\n\n url = \"#{@api_url}?#{data}&signature=#{signature}\"\n Chef::Log.debug(\"URL: #{url}\")\n uri = URI.parse(url)\n\n http = http_client_builder.new(uri.host, uri.port)\n\n if uri.scheme == \"https\"\n http.use_ssl = true\n # Still need to do some testing on SSL, so will fix this later\n if @no_ssl_verify\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n else\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n end\n request = Net::HTTP::Get.new(uri.request_uri)\n response = http.request(request)\n\n if !response.is_a?(Net::HTTPOK) then\n case response.code\n when \"432\"\n puts \"\\n\"\n puts \"Error #{response.code}: Your account does not have the right to execute this command is locked or the command does not exist.\"\n else\n puts \"Error #{response.code}: #{response.message}\"\n puts JSON.pretty_generate(JSON.parse(response.body))\n puts \"URL: #{url}\"\n end\n exit 1\n end\n\n json = JSON.parse(response.body)\n json[params['command'].downcase + 'response']\n end", "title": "" }, { "docid": "2b1b158c0da976a054e204caf6b079f5", "score": "0.57115585", "text": "def envelope_submit_operation(args={})\n user_name , document_name , order_number , expiration_date ,\n password , culture , sign_device_support , envelope_id ,\n template_id , parameters =\n args[:user_name] , args[:document_name] , args[:order_number] , args[:expiration_date] ,\n args[:password] , args[:culture] , args[:sign_device_support] , args[:envelope_id] ,\n args[:template_id] , args[:parameters]\n\n envelope = construct_envelope do |xml|\n xml.Submit(\"xmlns\" => \"https://www.assuresign.net/Services/DocumentNOW/Submit\") do\n xml.Documents do\n xml.Document(\"ContextIdentifier\" => Starapi.assure_context_identifier) do\n xml.Metadata(\"UserName\" => user_name,\n \"DocumentName\" => document_name,\n \"OrderNumber\" => order_number,\n \"ExpirationDate\" => expiration_date,\n \"Password\" => password,\n \"Culture\" => culture,\n \"SignatureDeviceSupportEnabled\" => sign_device_support) do\n xml.TermsAndConditions do\n xml.AdditionalComplianceStatement \" AdditionalComplianceStatement \"\n xml.AdditionalAgreementStatement \" AdditionalAgreementStatement \"\n xml.AdditionalExtendedDisclosures \"AdditionalExtendedDisclosures \"\n end\n end\n xml.Template(\"Id\" => template_id) do\n xml.Parameters do\n parameters.each do |key, value|\n xml.Parameter(\"Name\" => key, \"Value\" => value)\n end\n end\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "09aea254e6d53e8554a0cdead58551bb", "score": "0.5689174", "text": "def execute(method, path, parameters, headers = { accept: :json }, &block)\n payload = {}.merge(parameters)\n url = base_url + path\n\n request_arguments = {\n method: method,\n url: url,\n payload: payload,\n headers: headers\n }\n\n RestClient::Request.execute(request_arguments, &block)\n rescue RestClient::Unauthorized\n raise AuthError, \"Authentication failed\"\n rescue RestClient::InternalServerError\n raise ServerError, \"Server error\"\n rescue RestClient::Forbidden => e\n raise BadRequest, e.http_body\n end", "title": "" }, { "docid": "d6db0fb2fb418b3b1e082c53a0c34fd3", "score": "0.5679396", "text": "def sign_request\n if credentials[:key_type] == 'sha1_extended'\n str = @fields['Ds_Merchant_Amount'].to_s +\n @fields['Ds_Merchant_Order'].to_s +\n @fields['Ds_Merchant_MerchantCode'].to_s +\n @fields['Ds_Merchant_Currency'].to_s\n\n case Redsys.transaction_from_code(@fields['Ds_Merchant_TransactionType'])\n when :recurring_transaction\n str += @fields['Ds_Merchant_SumTotal']\n end\n\n str += @fields['Ds_Merchant_TransactionType'].to_s +\n @fields['Ds_Merchant_MerchantURL'].to_s # may be blank!\n\n str += credentials[:secret_key]\n\n Digest::SHA1.hexdigest(str)\n\n elsif credentials[:key_type] == 'sha256'\n\n encoded_merchant_params = Base64.strict_encode64(merchant_params_json)\n key = SHA256Helper.encrypt_3des(credentials[:secret_key], @fields['Ds_Merchant_Order'])\n\n SHA256Helper.hmac256(key, encoded_merchant_params)\n end\n end", "title": "" }, { "docid": "3be28520ad1135b59eed1423e28a6ffa", "score": "0.56539315", "text": "def send_request method, params, &block\n @request_mutex.synchronize do\n message = {\n jsonrpc: \"2.0\",\n method: method,\n params: params,\n id: @next_request_id\n }\n json = message.to_json\n requests[@next_request_id] = Request.new(@next_request_id, &block)\n envelope = \"Content-Length: #{json.bytesize}\\r\\n\\r\\n#{json}\"\n queue envelope\n @next_request_id += 1\n logger.info \"Server sent #{method}\"\n logger.debug params\n end\n end", "title": "" }, { "docid": "b0409db33e0d7ef33dd2dc74d8fda710", "score": "0.5651309", "text": "def _do_request(path, params = nil, method = \"get\", extra_params = nil)\n unless params.nil?\n params = to_hash.update(params)\n params = {params: params} if [\"post\", \"put\", \"delete\"].include? method\n params.merge!(extra_params) unless extra_params.nil?\n end\n Transloadit::Request.new(path, transloadit.secret).public_send(method, params)\n end", "title": "" }, { "docid": "75c20fd0491fd1bb91f8811195b337e3", "score": "0.5649463", "text": "def sign(key, secret, request_url, hash_params = {}, token = \"\", token_secret = \"\")\n\t\n\ttstamp = generate_timestamp\n\tnonce = generate_nonce\n\n\n\tparameters = {\n\t\t\"oauth_signature_method\" => 'HMAC-SHA1',\n\t\t\"oauth_consumer_key\" => key,\n\t\t\"oauth_timestamp\" => tstamp,\n\t\t\"oauth_nonce\" => nonce,\n\t\t\"oauth_version\" => '1.0',\n\t\t\"oauth_token\" => token\n\t}\n\n\tsorted_hash = {}\n\tparams_keys = hash_params.keys.sort\n\n\t# This sorts the hash params if any were passed in\n\tparams_keys.each { |param_key| sorted_hash.merge!(Hash[CGI.escape(param_key), CGI.escape(hash_params[param_key])]) }\n\n\t#This sorts the parameters defined above that oauth needs\n\tsorted_keys = parameters.keys.sort\n\n\tsorted_keys.each { |sorted_key| sorted_hash.merge!(Hash[CGI.escape(sorted_key), CGI.escape(parameters[sorted_key])]) }\n\n\toutput_string = sorted_hash.keys.map {|k| \"#{k}=#{sorted_hash[k]}\"}.join('&')\n\t\n\tsig_string = \"POST&#{CGI.escape(request_url)}&#{CGI.escape(output_string)}\"\n\n\t# If you don't need a token secret, this will skip it but the & is necessary.\n\tsig_key = \"#{CGI.escape(secret)}&#{CGI.escape(token_secret)}\"\n\n\tdigester = OpenSSL::Digest.new('sha1')\n\thmac_code = OpenSSL::HMAC.digest(digester, sig_key, sig_string)\n\tfinished_sig = Base64.encode64(hmac_code).chomp.gsub(/\\n/, '')\n\n\n\n return output_string + '&oauth_signature=' + CGI.escape(finished_sig)\nend", "title": "" }, { "docid": "f88c5616659b1534b6a97216bcab7250", "score": "0.5639362", "text": "def signable_params(params)\n if method == :get\n param_array = params.collect{|pair| \"#{uri_escape(pair[0])}=#{uri_escape(pair[1])}\"}\n else\n param_array = params.collect{|pair| \"#{form_escape(pair[0])}=#{form_escape(pair[1])}\"}\n end\n param_string = param_array.sort.join('&')\n \"#{method.to_s.upcase}\\n#{host}\\n#{path}\\n#{param_string}\"\n end", "title": "" }, { "docid": "d8a387108126c3ccf6d02d0d8d545496", "score": "0.56310886", "text": "def sign(method, uri, headers)\n \"#{account_name}:#{super(signable_string(method, uri, headers))}\"\n end", "title": "" }, { "docid": "86e3410ce10d3acd278486e4408fcb5c", "score": "0.5612214", "text": "def create(method, url, params, hmac_key)\n query = normalize_query_parameters(params)\n base_string = concatenate_request_elements(method, url, query)\n digest = hmac_sha1(base_string, hmac_key)\n # 9.2.1. Generating Signature\n Base64.strict_encode64 digest\n end", "title": "" }, { "docid": "6d643de90c065678b48691a00116e7fa", "score": "0.5606886", "text": "def send(method, params = [], id = nil)\n check_auth()\n\n json = {\n :id => id.nil? || id.is_a?(Integer) == false ? rand(999 - 100) + 100 : id,\n :jsonrpc => \"2.0\",\n :method => method,\n :params => params.is_a?(Array) ? params : []\n }.to_json\n\n uri = URI.parse(API_URL)\n http = http_or_http_proxy(uri)\n\n req = Net::HTTP::Post.new(uri.request_uri, @headers)\n req.basic_auth(@login, @password)\n req.add_field('User-Agent', \"sdk=RUBY; sdk-version=#{SDK_VERSION}; lang-version=#{RUBY_VERSION}; platform=#{RUBY_PLATFORM}\")\n req.add_field('CALLR-Login-As', @login_as) unless @login_as.to_s.empty?\n\n begin\n res = http.request(req, json)\n if res.code.to_i != 200\n raise CallrException.new(\"HTTP_CODE_ERROR\", -1, {:http_code => res.code.to_i, :http_message => res.message})\n end\n return parse_response(res)\n rescue Timeout::Error, Errno::EINVAL, Errno::ECONNRESET, EOFError, Errno::ETIMEDOUT, Errno::ECONNREFUSED,\n Net::HTTPBadResponse, Net::HTTPHeaderSyntaxError, Net::ProtocolError => e\n raise CallrException.new(\"HTTP_EXCEPTION\", -2, {:exception => e})\n end\n end", "title": "" }, { "docid": "da578cc9e946b9c636e0f754330d5f64", "score": "0.560343", "text": "def sign_jssdk params\n params_str = create_sign_str params\n\n Digest::SHA1.hexdigest params_str\n end", "title": "" }, { "docid": "726436a060124ae695c0da3e8e9ace21", "score": "0.55940706", "text": "def call(method, params = nil)\n url = @url + \"/\" + method\n header = { \"Content-Type\" => \"application/json\" }\n \n if @auth_token\n header[\"Authorization\"] = \"Bearer #{@auth_token}\"\n end\n \n res = Net::HTTP.post URI(url), params.to_json, header\n status = res.code.to_i\n \n if status >= 400\n begin\n body = JSON.parse(res.body)\n rescue\n raise Error.new(status)\n end\n raise Error.new(status, body[\"type\"], body[\"message\"])\n end\n \n res.body\n end", "title": "" }, { "docid": "bbd62d7a504e42d76307bf7ec0af6811", "score": "0.558633", "text": "def send_request(method, params, &block)\n message = {\n jsonrpc: \"2.0\",\n method: method,\n params: params,\n id: @next_request_id,\n }\n json = message.to_json\n requests[@next_request_id] = { id: @next_request_id, callback: block_given? ? Proc.new(&block) : nil }\n envelope = \"Content-Length: #{json.bytesize}\\r\\n\\r\\n#{json}\"\n queue envelope\n @next_request_id += 1\n logger.info \"Server sent #{method}\"\n logger.debug params\n end", "title": "" }, { "docid": "a80a118ade89926a1cc633c6b52fc3b0", "score": "0.5581838", "text": "def create_sign_multisig_request(raw, access_token: nil)\n path = '/multisigs'\n payload = {\n action: 'sign',\n raw: raw\n }\n access_token ||= access_token('POST', path, payload.to_json)\n authorization = format('Bearer %<access_token>s', access_token: access_token)\n client.post(path, headers: { 'Authorization': authorization }, json: payload)\n end", "title": "" }, { "docid": "bb3d08268332cc1a2f2f258c1791148f", "score": "0.55758363", "text": "def send_custom_request(method, parameters)\n broadcast('@type' => 'sendCustomRequest',\n 'method' => method,\n 'parameters' => parameters)\n end", "title": "" }, { "docid": "a6c6dd0650c3a56129d25c18eea23863", "score": "0.55756813", "text": "def request(method, path, params = {})\n request_headers = {}\n if credentials?\n uri = URI(@endpoint) + path\n authorization = auth_header(method, uri, params)\n request_headers[:authorization] = authorization.to_s\n end\n\n response = connection.run_request(method, path, nil, request_headers) do |request|\n unless params.empty?\n case request.method\n when :post, :put\n request.body = params\n else\n request.params.update(params)\n end\n end\n end\n response.body\n end", "title": "" }, { "docid": "d4b65e7ce17eed631f7cd92eaf9e6229", "score": "0.5571393", "text": "def send_request(params)\n params['response'] = 'json'\n params['apiKey'] = @api_key\n\n params_arr = []\n params.sort.each { |elem|\n params_arr << elem[0].to_s + '=' + CGI.escape(elem[1].to_s).gsub('+', '%20').gsub(' ','%20')\n }\n\n debug_output JSON.pretty_generate(params) if @debug\n\n data = params_arr.join('&')\n signature = OpenSSL::HMAC.digest('sha1', @secret_key, data.downcase)\n signature = Base64.encode64(signature).chomp\n signature = CGI.escape(signature)\n\n url = \"#{@api_url}?#{data}&signature=#{signature}\"\n puts url if @debug\n\n uri = URI.parse(url)\n http = Net::HTTP.new(uri.host, uri.port)\n \n if uri.scheme == 'https'\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n\n begin\n response = http.request(Net::HTTP::Get.new(uri.request_uri))\n rescue\n puts \"Error connecting to API:\"\n puts \"#{@api_url} is not reachable\"\n exit 1\n end\n\n \n if response.is_a? Net::HTTPOK\n begin \n json = JSON.parse(response.body)\n json = json[params['command'].downcase + 'response']\n rescue JSON::ParserError\n puts \"Error parsing response from server:\"\n puts response.body\n exit 2\n end\n else\n begin \n json = JSON.parse(response.body)\n puts \"Error executing command...\"\n puts json if @debug\n json = json[params['command'].downcase + 'response']\n puts \"#{json['errorcode']}: #{json['errortext']}\"\n rescue\n puts \"Error parsing response from server...\"\n puts \"#{response.code}: #{response.body}\"\n end\n exit 3\n end\n end", "title": "" }, { "docid": "379fb884c64d623086262d9be71e4fb6", "score": "0.5570209", "text": "def sign(params, type = :hpp)\n shared_secret = params.delete('sharedSecret')\n raise ArgumentError, \"Cannot sign parameters without a shared secret\" unless shared_secret\n sig = OpenSSL::HMAC.digest(OpenSSL::Digest.new('sha256'), Array(shared_secret).pack(\"H*\"), string_to_sign(params, type))\n Base64.encode64(sig).strip\n end", "title": "" }, { "docid": "456527907246fb545cb077378c25030d", "score": "0.5569694", "text": "def send_request(api_method, params)\n params.reverse_merge!(default_params)\n uri = URI.parse(server_url + api_method)\n\n req = Net::HTTP::Post.new(uri.path)\n req.set_form_data(params)\n\n https = Net::HTTP.new(uri.host, uri.port)\n https.use_ssl = uri.scheme == \"https\"\n\n response = https.start { |http| http.request(req) }\n response_hash = JSON.parse(response.body, symbolize_names: true)\n response_hash[:success] = true if response.kind_of? Net::HTTPSuccess\n response_hash\n end", "title": "" }, { "docid": "6ae70defa1ad40e58fd9384819fcb909", "score": "0.5565244", "text": "def instant(params={})\n self.request(__method__, params, https=true)\n end", "title": "" }, { "docid": "e54e8033c6c40436f695eedce255d90f", "score": "0.5561633", "text": "def sign(params)\n RubyDesk.logger.debug {\"Params to sign: #{params.inspect}\"}\n\n concatParams = norm_params(params)\n\n # concatenate secret with names, values\n concatenated = @api_secret + concatParams\n\n RubyDesk.logger.debug {\"concatenated: #{concatenated}\"}\n\n # Calculate and return md5 of concatenated string\n md5 = Digest::MD5.hexdigest(concatenated)\n\n RubyDesk.logger.debug {\"md5: #{md5}\"}\n\n return md5\n end", "title": "" }, { "docid": "0f18062729369ba341aa0875728571a1", "score": "0.55546296", "text": "def call(action, args)\n # Set local variable with base url\n url = self.base_api_url\n\n # Set params\n params = {'svc': action.to_s.sub('_', '/'), 'params': JSON.generate(args), 'sid': self.sid}\n \n # Replacing global params with local params\n all_params = self.default_params.replace(params)\n\n if self.debug\n puts \"=========\"\n puts \"Query URL: #{url} - Params: #{all_params}\"\n puts \"=========\"\n puts \"#{url}&svc=#{action.to_s.sub('_', '/')}&params=#{JSON.generate(args)}&sid=#{self.sid}\"\n puts \"=========\"\n end\n\n uri = URI.parse(url)\n \n # Curl request\n request = Net::HTTP::Post.new(uri)\n\n request.set_form_data(\n \"svc\" => action.to_s.sub('_', '/'),\n \"params\" => JSON.generate(args),\n \"sid\" => self.sid\n )\n\n req_options = { use_ssl: (uri.scheme == \"https\") }\n\n response = Net::HTTP.start(uri.hostname, uri.port, req_options) do |http|\n http.request(request)\n end\n\n response = JSON.parse(response.body, symbolize_names: true)\n\n if response.class == Hash\n if !response[:error].nil?\n return {\n status: 400,\n reason: parse_errors(response[:error]),\n result: response\n }\n end\n end\n\n return {\n status: 200,\n result: response\n }\n end", "title": "" }, { "docid": "45dbf55eff61287ae378be7de37de578", "score": "0.55486494", "text": "def sign!(*args, **kwargs)\n credentials = args.pop\n proxy = RequestProxy.new(*args, **kwargs)\n Signature.sign!(proxy, credentials)\n end", "title": "" }, { "docid": "11878775781b6abc92323b23899c4e57", "score": "0.5547912", "text": "def make_request(resource_name, method_name, params = {}, response_key = nil)\n params.merge!(auth_key: auth_key) if auth_key.present?\n\n response_key ||= resource_name\n response = client.send(\"#{resource_name}.#{method_name}\", request_params.merge(params))\n response = self.class.parse_response(response_key, response)\n\n response.errors.present? ? raise(Syncano::ApiError.new(response.errors)) : response\n end", "title": "" }, { "docid": "622a2ae2e7772ffd2a6a0e92e645a2e1", "score": "0.55459714", "text": "def request(method, params={}, secure=false)\n refresh_token if @comm_token\n \n url = \"#{secure ? 'https' : 'http'}://grooveshark.com/more.php?#{method}\"\n body = {\n 'header' => {\n 'client' => get_method_client(method),\n 'clientRevision' => get_method_client_revision(method),\n 'country' => @country,\n 'privacy' => 0,\n 'session' => @session,\n 'uuid' => @uuid\n },\n 'method' => method,\n 'parameters' => params\n }\n body['header']['token'] = create_token(method) if @comm_token\n\n begin\n data = RestClient.post(url, body.to_json, {\n 'User-Agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_4) AppleWebKit/537.1 (KHTML, like Gecko) Chrome/21.0.1180.77 Safari/537.1',\n 'Content-Type' => 'application/json',\n 'Referer' => get_method_referer(method)\n })\n rescue Exception => ex\n raise GeneralError, ex.message\n end\n\n data = JSON.parse(data)\n data = data.normalize if data.kind_of?(Hash)\n\n if data.key?('fault')\n raise ApiError.new(data['fault'])\n else\n data['result']\n end\n end", "title": "" }, { "docid": "c5fcad91128559f048e4e7264c28b028", "score": "0.5544607", "text": "def request\n if self.class.access_key_id.nil? ||\n self.class.secret_access_key.nil? ||\n self.class.associate_tag.nil?\n raise \"PA api requires AWS credentials. Please set access_key_id, secret_access_key and associate_tag, try again.\"\n end\n raise \"Invalid region. region: #{self.region}\" unless END_POINTS.include?(self.region)\n\n unsigned_uri = URI.parse(\"#{END_POINTS[self.region]}?#{request_params_string}\")\n uri = add_signature(unsigned_uri)\n\n response = get_response uri\n @header = response.header\n @body = response.body\n\n response\n end", "title": "" }, { "docid": "b902c97398dccafd77432abac435f189", "score": "0.55401057", "text": "def send_request(method, endpoint, query_params: {}, payload: {}, sign_body: false)\n url = @base_url + endpoint\n headers = {\n \"User-Agent\" => \"DeroMerchant_Client_Ruby/1.0\",\n \"X-API-Key\" => @api_key\n }\n\n res = nil\n\n if method == Net::HTTP::Get\n res = HTTParty.get(url, :headers => headers, :query => query_params, timeout: @timeout)\n elsif method == Net::HTTP::Post\n headers[\"Content-Type\"] = \"application/json\"\n headers[\"Accept\"] = \"applciation/json\"\n \n json_payload = JSON.generate(payload)\n\n if sign_body == true\n signature = DeroMerchant::CryptoUtil::sign_message(json_payload, @secret_key)\n headers[\"X-Signature\"] = signature\n end\n\n res = HTTParty.post(url, body: json_payload, :headers => headers, :query => query_params, timeout: @timeout)\n else\n raise ArgumentError.new(\"method must be Net::HTTP::Get or Net::HTTP::Post\")\n end\n\n res_json = nil\n\n begin\n res_json = JSON.parse(res.body)\n rescue\n # Do nothing\n end\n\n if res.code < 200 || res.code > 299\n if res_json != nil\n raise DeroMerchant::APIError.new(res_json[\"error\"][\"code\"], res_json[\"error\"][\"message\"])\n else\n if res.code == 404\n raise StandardError.new(\"DeroMerchant Client: error 404: page #{res.request.last_uri.to_s} not found\")\n else\n raise StandardError.new(\"DeroMerchant Client: error #{res.status_code} returned by #{res.request.last_uri.to_s}\")\n end\n end\n else\n return res_json\n end\n end", "title": "" }, { "docid": "96a59ef3240fdd717153b4681a023501", "score": "0.5536652", "text": "def signature(params)\n formatted_params = params.sort.flatten.map(&:to_s).join\n OpenSSL::HMAC.hexdigest(OpenSSL::Digest.new('sha256'), @secret, formatted_params)\n end", "title": "" }, { "docid": "352a6f5585322de17796ba46ee135f5d", "score": "0.5531211", "text": "def request(method,hash={})\n r = RequestMessage.new\n r.method = method.to_s\n r.parameters = hash\n r.id = 123 # not important here - could generate a random number.\n request_message(r)\n end", "title": "" }, { "docid": "9dc01fbbc73f5fbfdf40273a3a1cc66d", "score": "0.55306095", "text": "def act(action,params, version='')\n @action_path = File.join(@service_path,version,action.to_s)\n @params = params\n request\n end", "title": "" }, { "docid": "5371c3665b765fd53c26266a18aac582", "score": "0.55284643", "text": "def sign(method, uri, headers)\n super(signable_string(method, uri, headers))\n end", "title": "" }, { "docid": "e8660c1844e292905657a626191406f4", "score": "0.5527602", "text": "def call(method, uri, body=nil, request_factory=Request)\n request = request_factory.new(method, uri, body)\n yield request if block_given?\n sign_request(request)\n request.request!\n end", "title": "" }, { "docid": "59167a96d45c8196bd28960468757008", "score": "0.5524115", "text": "def signature\n hashed_canonical_request = Digest::SHA256.hexdigest(canonical_request)\n string_to_sign = \"AWS4-HMAC-SHA256\\n\" +\n \"#{formatted_time}\\n\" +\n \"#{scope}\\n\" +\n hashed_canonical_request\n # All of the intermediate HMAC operations are not hex-encoded.\n mac = hmac(\"AWS4#{secret_access_key}\", formatted_date)\n mac = hmac(mac, region)\n mac = hmac(mac, 'sts')\n signing_key = hmac(mac, 'aws4_request')\n # Only the final HMAC operation is hex-encoded.\n hmac_hex(signing_key, string_to_sign)\n end", "title": "" }, { "docid": "ce039e1039e5bd9dc90ecd1e1daacae5", "score": "0.55202127", "text": "def digest_signature(params)\n signing_params = params.merge(api_key: @api_key)\n\n # We use a map function below instead of to_query on the Hash of params, since per Mixpanel,\n # we are not to include ampersands between key-value pairs. As well, we are to provide the\n # resource request arguments in alphabetical (sorted) order.\n Digest::MD5.hexdigest(\n params.map { |key, value| \"#{key}=#{value}\" }.sort.join + @api_secret\n )\n end", "title": "" }, { "docid": "c5f16f359b21789dd7e0a3644c599bf4", "score": "0.55111074", "text": "def perform_request(method, path, params, body)\n Octo.logger.debug \"--> #{method.upcase} #{path} #{params} #{body}\"\n\n CONNECTION.run_request \\\n method.downcase.to_sym,\n path,\n ( body ? MultiJson.dump(body): nil ),\n {'Content-Type' => 'application/json'}\n end", "title": "" }, { "docid": "e1836b700ff78d774aade6621503c941", "score": "0.5501263", "text": "def send()\n set_signature\n\n request = log_request(@params)\n response = self.class.get(service_end_point, query: @params)\n response = strip_response(response)\n\n log_response(response, request)\n return response\n end", "title": "" }, { "docid": "98753a83fa616ad1a85e538ad7e6eb53", "score": "0.5497629", "text": "def invoke( method_name, host, params )\n path = \"/#{ AKISMET_VERSION }/#{ method_name }\"\n data = url_encode( params )\n\n Net::HTTP.start( host, PORT ) do |http|\n http.post( path, data, HEADERS )\n end\n end", "title": "" }, { "docid": "fef528abfc1edfb4021ed7a7828144cf", "score": "0.54944205", "text": "def generate_method_signature( params )\n str = params.keys.sort.inject('') do |str, key|\n str << key << params[key]\n end\n Digest::MD5.hexdigest( str << api_secret )\n end", "title": "" }, { "docid": "afa7c9809e0e3cff4a0a59db7551443c", "score": "0.54940933", "text": "def send_request(method: required('method'), url: required('url'), body: nil,\n content_type: nil, encoding: nil)\n req_type = case method\n when 'GET'\n :get\n when 'POST'\n :post\n when 'PUT'\n :put\n when 'DELETE'\n :delete\n else\n fail 'Method was not \"GET\" \"POST\" \"PUT\" or \"DELETE\"'\n end\n\n headers = {'User-agent' => 'UARubyLib/' + Urbanairship::VERSION}\n headers['Accept'] = 'application/vnd.urbanairship+json; version=3'\n headers['Content-type'] = content_type unless content_type.nil?\n headers['Content-Encoding'] = encoding unless encoding.nil?\n\n debug = \"Making #{method} request to #{url}.\\n\"+\n \"\\tHeaders:\\n\"\n debug += \"\\t\\tcontent-type: #{content_type}\\n\" unless content_type.nil?\n debug += \"\\t\\tcontent-encoding: gzip\\n\" unless encoding.nil?\n debug += \"\\t\\taccept: application/vnd.urbanairship+json; version=3\\n\"\n debug += \"\\tBody:\\n#{body}\" unless body.nil?\n\n logger.debug(debug)\n\n response = RestClient::Request.execute(\n method: method,\n url: url,\n headers: headers,\n user: @key,\n password: @secret,\n payload: body,\n timeout: 5\n )\n\n logger.debug(\"Received #{response.code} response. Headers:\\n\\t#{response.headers}\\nBody:\\n\\t#{response.body}\")\n Response.check_code(response.code, response)\n\n self.class.build_response(response)\n end", "title": "" }, { "docid": "9fd9f80d899a55145f667808831fcd5f", "score": "0.54917294", "text": "def request(method, params)\n client = RestClient::Resource.new api_url, :timeout => @timeout\n request = { method: method, params: params, jsonrpc: '2.0', id: '0' }.to_json\n response = JSON.parse client.post(request,\n user: @username, password: @password, accept: 'json',\n content_type: 'json' )\n\n raise JsonResponseError.new response if response.has_key? 'code'\n raise ResponseError.new response['error'] if response.has_key? 'error'\n\n response['result']\n end", "title": "" } ]
9ec8665ecc4fcf9f20f20e6836dc86e4
Accesses the current user from the session. Future calls avoid the database because nil is not equal to false.
[ { "docid": "6ebaf874d01bc7bc75cd7714da2cbb8d", "score": "0.7849185", "text": "def current_user\n @current_user ||= (login_from_session) unless @current_user == false\n end", "title": "" } ]
[ { "docid": "1e18c3c1350a659fd2c853c420d264d3", "score": "0.814083", "text": "def current_user\n # Memoization -- we will only make the network call the first time and future calls just return the value\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n end", "title": "" }, { "docid": "6feb3050f3fc107e1f522417a8606f3e", "score": "0.8079609", "text": "def current_user\n return nil if read_only_mode_enabled?\n\n return @current_user if @current_user.present?\n\n @current_user = User.find_by(id: session[:user_id])\n\n return nil if @current_user.blank?\n\n if @current_user.suspended?\n log_off_user\n return redirect_to root_path, alert: t('login.user_suspended')\n end\n\n if @current_user.last_seen_at.blank? || @current_user.last_seen_at < 5.minutes.ago\n UpdateUserActivityJob.perform_later(@current_user.id, Time.now.utc.to_s, request.remote_ip)\n end\n\n @current_user\n end", "title": "" }, { "docid": "4da4930cbbc23c932735866cac04d71b", "score": "0.8054293", "text": "def current_user \n @user ||= User.find_by_id(session[:user_id]) if session[:user_id]\n #limits calls to db by seeing if a current user is set, if not looks inside the sessions hash to find user_id and sets the currentuser. \n end", "title": "" }, { "docid": "1a0058b4b9efa7a75d0d8882659a3b4c", "score": "0.8014915", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n # return current_user if it exits || set it as DB response & return the same\n end", "title": "" }, { "docid": "a13ea236d2559e88739887b04af37e06", "score": "0.80123955", "text": "def current_user\n # save current_user to @current_user\n # so subsequent calls to current_user() does not hit the database again\n # i.e. this function searches the database iff @current_user is nil\n @current_user ||= User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "1cb8fccdb7b1d16f7770321060569ab9", "score": "0.8001899", "text": "def current_user\n #@current_user || = checks to see if the user information has already been returned so the program doesn't continually check the database during a session.\n #if the user object has already been returned, the rest of the line is not executed. If there is no user object, then it goes to the database and pulls it.\n @current_user || User.find(session[:user_id]) if session[:user_id] #return the \"user\" for whatever user-ID is logged in, so we can access the entire user object, not just id\n end", "title": "" }, { "docid": "47ba3560d661e084204df81a74ab405b", "score": "0.79976594", "text": "def current_user\n # storing in a instance variable, which hits the db the 1st time but\n # returns the instance variable immediately on subsequents invocations\n @current_user ||= User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "6d593944e3667b37820938a6804100c1", "score": "0.7990023", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id] # if instance var exits, does not hit the database\n end", "title": "" }, { "docid": "dd33e709a19c22c4e4cbc63dbb1b49b6", "score": "0.7982175", "text": "def user_from_session\n self.current_user = User.find(session[:user]) if session[:user]\n end", "title": "" }, { "docid": "2fb79ceea9c172d55feb427602e98a45", "score": "0.79793733", "text": "def current_user\n return @current_user if @current_user # memoization\n\n current_user_id = session[:current_user_id]\n if (current_user_id)\n @current_user = User.find(current_user_id)\n else\n nil\n end\n end", "title": "" }, { "docid": "245f35ecb64224a36a2942a5d9eb7011", "score": "0.7926813", "text": "def current_user\n # if current_user is et use it otherwise ask the data store\n @current_user ||= User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "184e7805bc6a7d7af4e6a4ffa4c3074f", "score": "0.79251724", "text": "def current_user\n\t\t# because we've put the id in the session we can pull it out using the same code\n\t\t# find_by returns nil rather than an error if the user doesn't exist\n\t\t# remembers the @current_user value so we dont have to hit the database over and over\n\t\t@current_user = @current_user || User.find_by(id: session[:user_id])\n\tend", "title": "" }, { "docid": "14240bd664c72f783abe01aaeec2f06d", "score": "0.7920191", "text": "def current_user\n return nil if session[:user_id].nil?\n @user = User.find(session[:user_id])\n end", "title": "" }, { "docid": "083a3d4921f921d658b441fe3ba31cac", "score": "0.7902044", "text": "def current_user\n # use find_by method with data from session\n @current_user = User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "ecdd8389c090e32cbefa0d3cddae6152", "score": "0.79020256", "text": "def current_user\n return nil if session[:user].nil?\n return @u unless @u.nil?\n @u = User.find_by_id(session[:user])\n end", "title": "" }, { "docid": "aaf078c5ef66ebc62df70f3dbf306a7c", "score": "0.7898954", "text": "def current_user\n return false unless session[:user_id] \n @current_user ||= User.find( session[:user_id] )\n end", "title": "" }, { "docid": "fa1fb014d7318fe361e0207269eb48a9", "score": "0.7898583", "text": "def current_user\n return @current_user unless @current_user.blank?\n return nil if @current_user == false\n self.current_user = (login_from_session || login_from_basic_auth || login_from_cookie)\n @current_user\n end", "title": "" }, { "docid": "92ece582416e6099269c320e8b8a1633", "score": "0.78967535", "text": "def current_user\n return nil unless session[:session_token]\n\n #make this an instance variable to save the results of the first query\n #so any subsequent calls of this method can just return the instance variable\n #instead of making another query (this is a tactic to avoid N+1 queries)\n @current_user ||= User.find_by(session_token: session[:session_token])\n end", "title": "" }, { "docid": "cf1c5a31e260b75002ce71317980d697", "score": "0.7894308", "text": "def current_user #return the current user if current user has already been called, \n #otherwise return from session hash if session hash is not nil \n @current_user ||= User.find(session[:user_id]) if session[:user_id] \n end", "title": "" }, { "docid": "c8fb3fb180c22b24447b2e131b53c339", "score": "0.78941196", "text": "def current_user\n\t\t@current_user ||= (login_from_session) unless @current_user == false\n end", "title": "" }, { "docid": "c8fb3fb180c22b24447b2e131b53c339", "score": "0.78941196", "text": "def current_user\n\t\t@current_user ||= (login_from_session) unless @current_user == false\n end", "title": "" }, { "docid": "b7910a52b15c0f6a456b116426ff46ca", "score": "0.78878313", "text": "def current_user \n @current_user ||= User.find_by(id: session[:user_id], disabled: false)\n end", "title": "" }, { "docid": "05a9f9fdc59b8989caca1e575a6ba366", "score": "0.78834563", "text": "def current_user\n @current_user ||= (login_from_session || login_from_cookie) unless @current_user == false\n #@current_user ||= (login_from_session) unless @current_user == false\n end", "title": "" }, { "docid": "bc1ba05d63dfa19a2413a6cbc8201a6b", "score": "0.78778267", "text": "def current_user\n # if there is a current user rtn that if not then rtn nil\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n end", "title": "" }, { "docid": "5952ec0e19baae0eb404d9d2d90eeba4", "score": "0.7870098", "text": "def get_current_user\n if User.exists?(session[:user_id])\n @current_user = User.find(session[:user_id])\n else\n @current_user = nil\n end\n end", "title": "" }, { "docid": "536f7331a8211af988a6120f13e86eef", "score": "0.7863749", "text": "def current_user\n @current_user ||= (login_from_session) unless @current_user == false\n end", "title": "" }, { "docid": "52126aaa8824658de56cceb06426499d", "score": "0.7863477", "text": "def current_user\n if session[:user_id].present?\n @current_user ||= User.find session[:user_id] # ||= will only assign @current_user if it is nil. Otherwise continue using it's\n end\n end", "title": "" }, { "docid": "e9a2c695e22ddae26f9950c5c14d6a5e", "score": "0.7855815", "text": "def current_user\n @_user ||= Workout::Credentialing.current_user(session.fetch(:user_id, nil))\n end", "title": "" }, { "docid": "6aeed2ac7d6f0e0e5c33f5c8d297def2", "score": "0.78540236", "text": "def current_user\n User.find_by(id: session[:user_id])#finds user thats logged in by key value pair in users_controller \n #User.find(session[user_id]) would work also but we need a truthy or a falsey value\n end", "title": "" }, { "docid": "274118a51a489d40b53e2d3ff83415ac", "score": "0.78529984", "text": "def current_user \n @user = (User.find_by(id: session[:user_id]) || User.new)\n end", "title": "" }, { "docid": "d2bb735228d44e61da94d8f9dd97dc9e", "score": "0.7848192", "text": "def current_user\n # Checks if there is already a current user and uses that. If not then it runs the User.find command (stops multiple checks to db when accessing multiple )\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n end", "title": "" }, { "docid": "2aafdd68f2b10c046e92df8a409e6d00", "score": "0.7846775", "text": "def current_user\n @user = (user.find_by(id: session[:user_id]) || User.new)\n end", "title": "" }, { "docid": "319d3f8de3ad758e795ffefa664ecbe9", "score": "0.78441745", "text": "def current_user\n @user = (User.find_by(id: session[:user_id]) || User.new)\n end", "title": "" }, { "docid": "ee968fde54b61ddb0d82e109f33d2aba", "score": "0.7840366", "text": "def current_user\n unless session[:user_id].nil?\n @user || User.find(session[:user_id])\n end\n end", "title": "" }, { "docid": "352b19a8904ae78b4a7372a7887ec433", "score": "0.7835866", "text": "def current_user\n return @current_user if defined? @current_user\n return nil unless session[:current_user_key]\n @current_user = User.find(session[:current_user_key])\n return @current_user unless @current_user.nil?\n\n return session[:current_user_key] = nil\n end", "title": "" }, { "docid": "257f81f3241d7ccba140f252922f857e", "score": "0.78347814", "text": "def current_user\n set_current_user { User.where(id: session[:user_id]).first }\n end", "title": "" }, { "docid": "224b7fa3a880c6f047bfbc5e72e0eb1c", "score": "0.7834186", "text": "def fetch_user\n @current_user = User.find_by(:id => session[:user_id]) if session[:user_id]\n\n session[:user_id] = nil unless @current_user.present?\n end", "title": "" }, { "docid": "4a4d413bb417f8c553652a4521536b94", "score": "0.78333217", "text": "def current_user\r\n return unless session[:user_id]\r\n @current_user ||= session[:user_id]\r\n end", "title": "" }, { "docid": "40e495afe35af059b7f5f001f49a28e4", "score": "0.78332156", "text": "def current_user\n #caches the logged in user in a member variable (persists outside of the method) @current_user\n #if we have already cached current_user, just return it\n #note: use the find_by instead of the find method (even though the default search key for find is id) because find will fail if\n #the session does not contain a valid id.\n @current_user ||= User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "bddcf5c48ca9e34aae1479ab0c0e8906", "score": "0.7831878", "text": "def current_user\n @_current_user ||= session[:user_id] &&\n User.find(session[:user_id])\n end", "title": "" }, { "docid": "b3561bf5f62d533e2ed6a154bbbe27b8", "score": "0.7826829", "text": "def current_user\n \n # if there is a session user id stored in hash find in database\n # @current_user is used for optimization to have not multiple hits\n # in the database if current user is already in session.\n @current_user ||=User.find(session[:user_id]) if session[:user_id] \n \n end", "title": "" }, { "docid": "ba4738b88b47cdabdaaee902e0496797", "score": "0.78229463", "text": "def get_user\n \tif session[:user_id]\n \t\t@current_user = User.find(session[:user_id])\n \telse\n \t\t@current_user = nil\n \tend\n end", "title": "" }, { "docid": "6129e6a85bdc9a5305c9bffb6df8c4bf", "score": "0.7820239", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id] #return user if session user id matched session hash from user DB \n end", "title": "" }, { "docid": "c4268ed197cdc9cb9be91239c0aa3ef2", "score": "0.78199744", "text": "def current_user\n @_current_user ||= session[:user_id] && User.find(session[:user_id])\n end", "title": "" }, { "docid": "c4268ed197cdc9cb9be91239c0aa3ef2", "score": "0.78199744", "text": "def current_user\n @_current_user ||= session[:user_id] && User.find(session[:user_id])\n end", "title": "" }, { "docid": "d1d74b765c30fb23e9fe96f233edfd30", "score": "0.78164834", "text": "def current_user\n if session[:user_id]\n #This line makes use of Memoization.\n #Definition: Memoization is the process of storing\n #a computed value to avoid duplicated work by future calls.\n #see: http://gavinmiller.io/2013/basics-of-ruby-memoization/\n @current_user ||= User.find(session[:user_id])\n end\n end", "title": "" }, { "docid": "f1686ff25e90c4eed30ded68773b94b9", "score": "0.781532", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n # if session because it will throw an exception if it cannot find a user\n # the @current instance variable is for memoization because this method\n # continued... will be called many times.\n end", "title": "" }, { "docid": "ca3c7932e69d3cb92663d3f27eb11a53", "score": "0.7814539", "text": "def current_user\n unless @current_user\n # Is true when there is a current user session and it has a user.\n @current_user = current_user_session && current_user_session.user\n end\n @current_user\n\tend", "title": "" }, { "docid": "aed191887f5118ea699983c13c93f2e2", "score": "0.7814529", "text": "def current_user\r\n @user ||= User.where(\"id=?\", session[:user_id]).first\r\n end", "title": "" }, { "docid": "c682fc86e0f9b8070d2ba167b8d4053b", "score": "0.7809015", "text": "def current_user\n auth_keepalive_session\n @current_user ||= ( session[:user_id] ? User.find( session[:user_id] ) : nil )\nend", "title": "" }, { "docid": "7026dddfa44468757a6e504db9bfb97a", "score": "0.7807597", "text": "def current_user\n #if there's an authenticated user, return the user obj\n #else return nil\n\n @current_user ||= User.find(session[:user_id]) if session[:user_id] #this will return nil if the session[:user_id] does not exist..which is what we'd want (the nil); otherwise, it will return the value of the found session id\n # '||=' is for memoization; it allows the user to hit the database only once rather than many times (when we call the 'current_user' method, which could be MANY times, like for example, when we want to display the up & down arrows that the logged-in user would have access to); ||= says that \"If this instance variable exists already, then don't run this execution code--this 'current_user' method.\"\n end", "title": "" }, { "docid": "512ef64d78797d1cb7afe7c6ae23aa0f", "score": "0.780758", "text": "def current_user\n # @_current_user ||= session[:current_user_id] && User.find(session[:current_user_id])\n @user = User.first\n end", "title": "" }, { "docid": "641d7742e90e8136e75b0b23eb06cf9e", "score": "0.78070056", "text": "def current_user\n @_current_user ||= session[ :current_user_id ] &&\n Account.find_by_id( session[ :current_user_id ])\n end", "title": "" }, { "docid": "aa7d534ca72cc248948310d6e4d0c4ff", "score": "0.7805939", "text": "def current_user\n\t# if there is session data, use it to lookup user\n\tif session[:user_id].present?\n\t\tUser.find(session[:user_id])\n\telse\n\tend\nend", "title": "" }, { "docid": "101f35cf8ccdf73d57c415155774872f", "score": "0.7798856", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id] # return current user (if it's already been found in the database) OR make user available if the user is logged in\n end", "title": "" }, { "docid": "453da5ea3da4a19cc7b7a951055b530c", "score": "0.77985823", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id] # means that this code will return nil if the user has no session and the part after ||= is only executed if @current_user is nil\n # ||= is for \"memoization\" to not hit the database too many times.\nend", "title": "" }, { "docid": "ba4dbda6ec09968e9a58d9b1c81332ad", "score": "0.77981025", "text": "def current_user\n if @current_user.present?\n return @current_user\n end\n\n @current_user = User.find(session[:user_id])\n end", "title": "" }, { "docid": "8bdc0d47f1b4ac162594b15f5214b502", "score": "0.7797701", "text": "def current_user\n # byebug\n # User.find would throw an error if we cannot find the user\n User.find_by({ id: session[:user_id] })\n end", "title": "" }, { "docid": "becdb20173fbff0bd8d16f19bb9fd5c3", "score": "0.7795081", "text": "def current_user\n if session[:user_id]\n @current_user = User.find(session[:user_id])\n @current_user\n else\n false\n end\n end", "title": "" }, { "docid": "becdb20173fbff0bd8d16f19bb9fd5c3", "score": "0.7795081", "text": "def current_user\n if session[:user_id]\n @current_user = User.find(session[:user_id])\n @current_user\n else\n false\n end\n end", "title": "" }, { "docid": "3f69d62faf09f9fa5be2d3b6afa8ad8e", "score": "0.77908456", "text": "def current_user\n\n # Look up the current user based on user_id in the session cookie:\n @current_user = User.find(session[:user_id]) if session[:user_id]\n end", "title": "" }, { "docid": "3b705e57e706f38e824f8934cddd5cb2", "score": "0.7790739", "text": "def current_user\n\t\tif session[:user_id]\n\t\t\t@user = User.find(session[:user_id])\n\t\telse\n\t\t\t@user = nil\n\t\tend\n\tend", "title": "" }, { "docid": "11d76c91d70c8ca75eea9ba4d4837bb2", "score": "0.77895397", "text": "def current_user\n @current_user ||= (login_from_session_without_account || login_from_session_with_account) unless @current_user == false\n end", "title": "" }, { "docid": "321301d66b0a0de639311234bad7682b", "score": "0.7785064", "text": "def current_user\n @_current ||= User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "273704e14be2722ac672f478b3e61de6", "score": "0.7781265", "text": "def current_user\n \t@current_user ||= User.find(session[:user_id]) if session[:user_id] #memoization hence ||= is used.\n end", "title": "" }, { "docid": "7af257fb248ab04bf35cbf773be5453e", "score": "0.77806705", "text": "def current_user\n unless session[:user_id].nil?\n return User.get(session[:user_id])\n end\n nil\nend", "title": "" }, { "docid": "459ccfd3b7d60c10f94c22e0ee7ec105", "score": "0.77806187", "text": "def current_user \n return nil if !session[:auth] || !session[:auth]['id']\n # Avoid multiple request\n return @current_user if @current_user\n # find by_id will return nil if not found and no exception\n @current_user = User.find_by_id(session[:auth]['id'])\n end", "title": "" }, { "docid": "a63c77b7e169954b2af979393197584a", "score": "0.77805734", "text": "def current_user\n # checks to see if session exists and if so then load user\n # and save into an instance variable\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n end", "title": "" }, { "docid": "e645ff2ed6ea2d9b6e4e920863de94ea", "score": "0.7779188", "text": "def get_current_user\n if !session[:user_id].nil?\n @user = User.find_by_id( session[:user_id] )\n end\n end", "title": "" }, { "docid": "e9e48c7f6320b6b9d1104811a90f079b", "score": "0.7777733", "text": "def current_user\n # if session contains a user_id (we logged in and session isn't destroyed/user_id isn't removed)\n # And if there isn't a value for @current_user (we haven't assigned it a value). \n # ^ This is to minimise redundant database queries if we've already returned the user.\n # Then return the user object\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n end", "title": "" }, { "docid": "bac757021fca064593156a1a0a4b923e", "score": "0.7776844", "text": "def current_user\n # my solution\n User.find(session[:user_id])\n\n # school solution\n # @user = (User.find_by(id: session[:user_id]) || User.new)\n end", "title": "" }, { "docid": "21dff7dfa6c1e3da4ef311577bcc6f08", "score": "0.7765635", "text": "def current_user\n user_id = @session[:user_id]\n @user ||= user_id && User.find(user_id)\n end", "title": "" }, { "docid": "b1fff38917fbc01bd5c11fe7b8e30716", "score": "0.7764587", "text": "def current_user\n if session[:user_id]\n @current_user = User.find(session[:user_id])\n else\n false\n end\n end", "title": "" }, { "docid": "d9a5e2ec34de1919c269b1e9c4c73ec0", "score": "0.7764516", "text": "def current_user #returns detials of the currently logged user || its a helper method\n if session[:user_id]\n @current_user ||=User.find(session[:user_id]) #that @current_user ||= lets memorize current user if they are actually logged in. that way we dont block db \n \n end\n end", "title": "" }, { "docid": "3eeedaade95508493624d4123c8b156c", "score": "0.7763807", "text": "def current_user\n return nil if session[:user_id].nil?\n @current_user ||= load_current_user\n end", "title": "" }, { "docid": "6701d3a6375cc2d2b521d7facf756d47", "score": "0.7760968", "text": "def current_user\r\n return @current_user if defined?(@current_user)\r\n @current_user = current_user_session && current_user_session.user\r\n end", "title": "" }, { "docid": "fa94f5d0de4fdf4a0ece318345475e01", "score": "0.7760931", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n # return user if session user_id is in DB\n # return @current_user if already set, if not find the user and set current_user\n end", "title": "" }, { "docid": "33775ab47fd7dde1cfd2e432e2cbf72e", "score": "0.7759318", "text": "def current_user\n #return current_user if not find the user from the databse \n @current_user ||= User.find(session[:user_id]) if session[:user_id]\n end", "title": "" }, { "docid": "56635191e57cd23438479c783f91d949", "score": "0.7755256", "text": "def current_user\n return @current_user_cached unless @current_user_cached.blank?\n\n @current_user_cached = \n if !session[:rbac_user_id].blank?\n User.find(session[:rbac_user_id])\n else\n nil\n end\n return @current_user_cached\n rescue\n # puts \"def current_user RESCUE #{session[:rbac_user_id]}\"\n remove_current_user\n redirect_to login_path\n end", "title": "" }, { "docid": "7e3ef2e0c60dbcf69e7c11208e7fc61f", "score": "0.7752215", "text": "def current_user\n @_current_user ||= session[:current_user_id] &&\n User.find_by_id(session[:current_user_id])\n end", "title": "" }, { "docid": "969eab3a32bd6fb1c4a4fd6a0e45238d", "score": "0.7750729", "text": "def current_user\n @current_user ||= User.find_by(id: session[:user_id]) if session[:user_id]\n\n # The above code is equivalent to:\n # if session[user_id]\n # \t@current_user = User.find_by(id: session[:user_id])\n # else\n # \t@current_user = false\n # end\n end", "title": "" }, { "docid": "1ba7ad6d16670ffc273d1e6496531e3c", "score": "0.7749052", "text": "def current_user\n #returns nil unless session[:s.t.] is a truthy...aka not nil\n #if there is a session token, then that means there's someone logged in\n return nil unless session[:session_token] \n \n #finds the currently logged in user...aka the user that has this session's session token\n #use lazy instantialization to only run a query the first time you call this method\n @current_user ||= User.find_by(session_token: session[:session_token])\n end", "title": "" }, { "docid": "676a0fd794feb4e6665fad3252c11c48", "score": "0.77486205", "text": "def current_user\n if session[:user_id]\n #memoize the current user so we dont need to run a db query every we use current_user which we do frequently\n #this says if @current_user is nil, find the user in the session\n @current_user ||= User.find(session[:user_id])\n end\n end", "title": "" }, { "docid": "15a576b5bd85e9a15b04982f5e27149f", "score": "0.77456063", "text": "def current_user\n session[:user_id] ? User.get(session[:user_id]) : nil\nend", "title": "" }, { "docid": "1acfb7cd4fadda21cb52680707cd6312", "score": "0.7744283", "text": "def current_user\n @_current_user ||= session[:current_user_id] &&\n User.find_by(id: session[:current_user_id])\n end", "title": "" }, { "docid": "14399ac56a0aa0a60569b9a0b568901a", "score": "0.77434015", "text": "def curr_user\n return @curr_user if @curr_user\n @curr_user = User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "0a6c880f3ac53bd4d444762c6b14eb92", "score": "0.77423245", "text": "def current_user\n return unless session[:user_id]\n @curent_user ||= User.find_by_id(session[:user_id])\n end", "title": "" }, { "docid": "aa057b5a4c8022b95c08642829e87d57", "score": "0.7740861", "text": "def current_user\n @user = User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "aa057b5a4c8022b95c08642829e87d57", "score": "0.7740861", "text": "def current_user\n @user = User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "bd4f37474b37b1ed2077f4dcd7c65313", "score": "0.7740744", "text": "def current_user\n @current_user || User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "c2f3526511c45076b6951996bcda9a69", "score": "0.7738784", "text": "def current_user\n #@current_user ||= User.find_by_id(session[:user])\n @_current_user ||= session[:current_user_id] && User.find_by(id: session[:current_user_id])\n end", "title": "" }, { "docid": "9c61ad03ede0a64712735871ef347389", "score": "0.7737238", "text": "def current_user\n if @current_user.nil?\n if session[:user_id]\n @current_user = User.get_by_id(session[:user_id])\n end\n @current_user ||= :false\n end\n return @current_user==:false ? nil : @current_user\n end", "title": "" }, { "docid": "120bd8de504c0a2deb8d8bbf9724f629", "score": "0.77366394", "text": "def current_user\n @_current_user ||= User.find_by_id( session[:user_id] )\n end", "title": "" }, { "docid": "aee932615015fb216e4ad6d17ba0963f", "score": "0.77363133", "text": "def current_user\n @current_user ||= (user_from_session || :false)\n end", "title": "" }, { "docid": "4e4e6428650f9e40bbda92c3c546b619", "score": "0.7735643", "text": "def current_user\r\n return nil if session[:user_id].nil?\r\n\r\n User.find(session[:user_id])\r\n end", "title": "" }, { "docid": "44b3530958f60f496e0c788348ed454e", "score": "0.7735322", "text": "def current_user\n if @current_user.nil?\n @current_user = User.find_by(id: session[:user_id])\n else\n @current_user\n end\n end", "title": "" }, { "docid": "c28f899a920423c4254a04341f5cecc9", "score": "0.77341205", "text": "def current_user\n # User.find(session[:user_id]) did not work\n # but User.find_by(id: session[:user_id]) works... Why?\n @current_user ||= User.find_by(id: session[:user_id]) if session[:user_id]\n end", "title": "" }, { "docid": "eea812da280b97fe603d28d0363b36ee", "score": "0.77336305", "text": "def current_user\n @user ||= User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "dfc4b02a4f0894ea62c16041d78330fb", "score": "0.77335906", "text": "def current_user\n if @user\n return @user\n else\n if logged_in?\n @user = User.find(session[:user_id])\n end\n end\n end", "title": "" } ]
1f443bb606e88d9927c27699e682634c
method to check user number input to confirm they gave a valid entry
[ { "docid": "e7634875bab4833791b6aae624ef29f0", "score": "0.0", "text": "def num_check num, number_type\n until num.class == Integer || num.class == Float\n puts \"I'm sorry that doesn't seem to be a number.\"\n puts \"Do you have some else in mind?\"\n num = float_or_integer(number_type)\n spacing\n end\n return num\nend", "title": "" } ]
[ { "docid": "92c10f4267972dd955fd4007e1bbc39b", "score": "0.8094338", "text": "def valid_number?(number_string) # this method will check if the user submitted a valid number that we can use in our program\n number_string.to_i.to_s == number_string\nend", "title": "" }, { "docid": "deb9fd310a0f8165272aa2339d579f9a", "score": "0.7971907", "text": "def num_checker\n number = gets.to_i\n if number.between?(1, 10)\n puts \"valid\"\n else\n puts \"invalid\"\n end\nend", "title": "" }, { "docid": "e58e19d64fd865491efce5b0b9db53c2", "score": "0.7853563", "text": "def check_valid\n puts \"Give me a random number\"\n num = gets.to_i\n if num >=1 && num <=10\n puts \"Valid\"\n else\n puts \"Invalid\"\n end\nend", "title": "" }, { "docid": "05bde42c711216f547310ed8f05547f4", "score": "0.7768909", "text": "def valid_number?(num); end", "title": "" }, { "docid": "05bde42c711216f547310ed8f05547f4", "score": "0.7768909", "text": "def valid_number?(num); end", "title": "" }, { "docid": "05bde42c711216f547310ed8f05547f4", "score": "0.7768909", "text": "def valid_number?(num); end", "title": "" }, { "docid": "05bde42c711216f547310ed8f05547f4", "score": "0.7768909", "text": "def valid_number?(num); end", "title": "" }, { "docid": "c513b610e9848848516cc22c24ab94e9", "score": "0.77155334", "text": "def number_validation (number)\n # If the user input is different of a number prompt again, and ask for the value again.\n while (number != '0') && (number.to_i.to_s != number.strip && number.to_f.to_s != number.strip) do\n print \" \\\"#{number}\\\" is not a valid entry. \"\n print \"Please enter a valid number: \"\n number = gets.chomp\n end\n # If the user enter a correct value just return the value.\n number = number.to_f\n return number\nend", "title": "" }, { "docid": "624fc4a231b5361d79d7776b8e0f267c", "score": "0.76935434", "text": "def get_and_validate_user_input\n\t\n\tputs \"Please input a number between 5 and 20.\"\n\tnum_times = gets.chomp.to_i\n\n\tif num_times > 5 && num_times < 20\n\t\tnum_times\n\telse\n\t\tputs \"That is not a valid number.\"\n\t\t# we have an invalid number. keep going\n\t\tget_and_validate_user_input\n\tend\n\nend", "title": "" }, { "docid": "b8a4d014666266ea94cb2ce68209059f", "score": "0.7673889", "text": "def check_input_valid? user_input\n if (user_input >= 0 && user_input < 9)\n return true\n end\n return false\nend", "title": "" }, { "docid": "4777d327214b6cabed402f25777029a2", "score": "0.76166826", "text": "def valid_input?(number)\n (number.to_i.abs.to_s == number) && (number.to_i != 0)\nend", "title": "" }, { "docid": "4a5d0abc992d687981c82256eeb3717a", "score": "0.7588842", "text": "def check_input\n input = gets.strip\n puts \"-----------------------------------------------------------------------\"\n if input.to_i < 21 && input.to_i > 0 && input =~ /^\\d+$/\n display_info(input)\n puts \"-----------------------------------------------------------------------\"\n puts \"If you would like to see another show, please put in a number (1-20)\".colorize(:yellow)\n puts \"-----------------------------------------------------------------------\"\n check_input\n elsif input.downcase == \"list\"\n list_shows\n check_input\n elsif input.downcase == \"exit\" || input.downcase ==\"end\"\n puts \"Thank you for using the New Series Suggester.\"\n puts \"Goodbye!\"\n puts \"-----------------------------------------------------------------------\"\n else\n puts \"I'm sorry but that is not a correct input\".colorize(:light_red)\n puts \"Only numbers 1 - 20, list, exit, or end are valid inputs\".colorize(:light_red)\n puts \"-----------------------------------------------------------------------\"\n check_input\n end\n end", "title": "" }, { "docid": "7e22202dac897484c8193f6aa924e083", "score": "0.75764745", "text": "def valid_number?(input)\n input.to_i > 0 && input.to_i <= RaEvents::Event.all.length\n end", "title": "" }, { "docid": "c6774a897a56030ca7a604f1dd179ecc", "score": "0.75617236", "text": "def verify_input(input)\n if !(input.match?(/^[1-9]$/))\n print \"This is not a valid input. \"\n elsif !(board.squares[input.to_i-1] == ' ')\n print \"This square is taken already. \"\n else\n input\n end\n end", "title": "" }, { "docid": "8ac09576f146d0f98dca0674acd96475", "score": "0.7549763", "text": "def input_number\n puts \"Please enter your phone number. It should not have 1 or 0\"\n number = gets.chomp\n phone_validity(number)\n end", "title": "" }, { "docid": "6b271f494af4859bf84d194d98f4478c", "score": "0.75115675", "text": "def num_validate(user_input)\n until user_input.match(/[0-9]/)\n print \" Error, invalid entry. Please re-enter selection: \"\n user_input = gets.chomp\n end\n return user_input\nend", "title": "" }, { "docid": "a93269c74deedb599c3712aa94e2dec0", "score": "0.7508345", "text": "def input_validation (user_input)\n until user_input.to_i.to_s == user_input\n print \"Your input was invalid. Please enter a number: \"\n user_input = gets.chomp\n end\n user_input.to_i\nend", "title": "" }, { "docid": "ff5b27205a2c2df7808d050efaf7b96c", "score": "0.750203", "text": "def user_input_valid input\n if integer?(input) && input.to_i.between?(0, @num)\n return input.to_i - 1\n else\n puts 'Sorry, we don\\'t carry that here. Please choose something else.'\n get_user_input\n end\n end", "title": "" }, { "docid": "14c805d9b0ec5f86bc4e3afa520ab1d1", "score": "0.7476281", "text": "def input_validation (user_input)\n until user_input.to_i.to_s == user_input && user_input.to_i > 0\n print \"Your input was invalid. Please enter a number: \"\n user_input = gets.chomp\n end\n user_input.to_i\nend", "title": "" }, { "docid": "d33941924b1c539d5922da029b36f261", "score": "0.7448126", "text": "def input_validator(number)\n input = gets.strip\n self.exit?(input) \n while input != \"Human\" && input != \"Elf\" && input != \"Hobbit\" && input != \"Dwarf\" && input != \"Orc\" && input != \"Maiar\" && input != \"Ent\"\n self.input_error_message(number)\n input = gets.strip\n self.exit?(input) \n end\n input\n end", "title": "" }, { "docid": "a2579c8e8c3475679e26a3561d7b4387", "score": "0.7434385", "text": "def check_input(num)\n if num.match(/\\A\\d+\\Z/) #regex check of string having a number\n return \"number\"\n elsif num == \"sort\" # if user types calculate then they are done entering numbers\n return \"exit\"\n else\n return \"error\" # if user didn't type calculate or a number then they didn't type in acceptable entry\n end\nend", "title": "" }, { "docid": "a2579c8e8c3475679e26a3561d7b4387", "score": "0.7434385", "text": "def check_input(num)\n if num.match(/\\A\\d+\\Z/) #regex check of string having a number\n return \"number\"\n elsif num == \"sort\" # if user types calculate then they are done entering numbers\n return \"exit\"\n else\n return \"error\" # if user didn't type calculate or a number then they didn't type in acceptable entry\n end\nend", "title": "" }, { "docid": "c02e650e1fdee4d5c5f126902b7c8836", "score": "0.74286544", "text": "def check_valid_number(user_number)\n # if user input contains a digit, convert to an integer. otherwise, display error message\n if /^\\d+$/.match(user_number)\n return user_number.to_i\n else \n puts \"That's not a valid number. Try again.\"\n exit \n end \nend", "title": "" }, { "docid": "a4e45a96de1dbdc29f77d297f8265d99", "score": "0.7425284", "text": "def is_number_valid\n puts \"Please give me a 10 digit number to format into a phone number.\"\n @number = gets.chomp.to_i\n if (Math.log10(@number).to_i) + 1 == 10\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "8d25733e585b828ab8618fd30effc7bf", "score": "0.7419723", "text": "def input_check_int\r\n input = gets().strip.to_i\r\n flag = true\r\n while flag\r\n if (input.is_a? Integer and input.between?(1,5))\r\n flag = false\r\n else\r\n puts \"Invalid input\"\r\n input = gets().strip.to_i\r\n end\r\n end\r\n return input\r\n end", "title": "" }, { "docid": "2ef2caf1a84890d140343bae49df9f85", "score": "0.7395414", "text": "def validate_number(number)\n until number.to_i.to_s == number\n puts \"Please enter a number.\"\n number = gets.chomp\n end\n return number = number.to_i\nend", "title": "" }, { "docid": "e5e19c82c7e64c8cb1fcc57f0c1ceb0c", "score": "0.738888", "text": "def check_number(number)\n\t# Check to make sure the user did not input '0'.\n\tif number.chomp == \"0\"\n\t\treturn \"\\nSadly, both for science and the Romans, they did not have a value for 0.\\n\\n\"\n\telse\n\t\t# Any strings that are not numbers will be converted to 0. \n\t\t# Floats will be converted to integers.\n\t\tnumber = number.to_i\n\t\tif number == 0\n\t\t\treturn \"\\nSadly, we can only process integer numbers.\\n\\n\"\n\t\telsif number < 0\n\t\t\treturn \"\\nSadly, the Romans had no interest in negative numbers.\\n\\n\"\n\t\telsif number > 3000 \n\t\t\treturn \"\\nSadly, the Romans had no interest in numbers larger than 3000.\\n\\n\"\n\t\telse\n\t\t\treturn true\n\t\tend\n\tend\nend", "title": "" }, { "docid": "5ee78826dec0b3130d207189223c7cbe", "score": "0.7379383", "text": "def check_input(input)\n if input.match(/\\D/) \n puts \"We only accept whole numbers.\"\n prompt_user_input\n else\n # if input is valid, convert to an integer\n pi_to_decimal_place(input.to_i)\n end\nend", "title": "" }, { "docid": "5fe33162350f023186c328be2c710670", "score": "0.7371419", "text": "def checkif_valid_num(input)\n valid_num = false\n # puts \"Input was: #{input}, type: #{input.class}\"\n until valid_num == true do\n if input == input.to_i.to_s\n input = input.to_i\n valid_num = true\n elsif input == input.to_f.to_s\n input = input.to_f\n valid_num = true\n else\n puts \"That's not a valid entry, please enter a number:\"\n input = gets.chomp\n end\n end\n return input\nend", "title": "" }, { "docid": "20f0b0e9b5aa0fad014e0bc1bc109b7b", "score": "0.7365563", "text": "def valid_input(input)\n /^[1-9]\\d*$/ === input\nend", "title": "" }, { "docid": "12c404711e00bda9ff2b377d2adf7a4d", "score": "0.7363668", "text": "def prompt_input_number(min, max, prompt_msg = nil, invalid_err_msg = nil)\n prompt_msg = \"Enter a number between #{min} and #{max} : \" if prompt_msg.nil?\n invalid_err_msg = \"Invalid input, try again : \" if invalid_err_msg.nil?\n \n print prompt_msg\n \n valid = false\n number = 0\n until valid\n input = gets.chomp\n number = input.to_i\n\n if !(input =~ /^-?[0-9]+$/) || number < min || number > max\n print invalid_err_msg\n next\n end \n\n valid = true\n end \n\n number\nend", "title": "" }, { "docid": "6050f3a0ef37fc26104e87c471927d0b", "score": "0.73550856", "text": "def number_reprompt\n puts \"Please enter a valid number.\"\nend", "title": "" }, { "docid": "cdbbab94403026001eb68264cfafc28a", "score": "0.73501813", "text": "def valid_number(num_p)\n until num_p.to_i.to_s == num_p\n puts \"I'm not sure that's a number... try again please!\"\n puts \"You can enter an integer (like 1 or 5).\"\n print \"\\nPlease re-enter your number ==> \"\n num_p = gets.chomp\n end\n return num_p.to_i\nend", "title": "" }, { "docid": "f778a73c72ab6fb7284fd0da2fc59a09", "score": "0.733312", "text": "def validate_number\n options.last =~ /\\A\\d+\\z/\n end", "title": "" }, { "docid": "2dc9f0171eb3b25515955751e9d84cf8", "score": "0.73068225", "text": "def validInput?(input)\n #check if input is a number\n #if not num then return false\n input.each do |val|\n return false if val.to_i == 0 && val != \"0\"\n end\n true\n end", "title": "" }, { "docid": "afc6f2d22092086c8783e91676983970", "score": "0.72972006", "text": "def required_input(user_input)\r\n if user_input >= 1 && user_input <= 100\r\n true\r\n else\r\n false\r\n end\r\n end", "title": "" }, { "docid": "48bdb653006f62332e14ac8041e04694", "score": "0.72701204", "text": "def is_valid num\n if num <= 10 && num >= 1\n 'Valid'\n else\n 'Invalid'\n end\nend", "title": "" }, { "docid": "c1b2f9ebc7aaa6899b677bb8d1fdceb7", "score": "0.72494876", "text": "def is_number?(num)\n while (num.to_i).zero?\n puts \"Please enter a valid number greater than 0\"\n num = gets.chomp\n end\n num.to_i\nend", "title": "" }, { "docid": "2794ba2c0875de6cefd489b823bce71d", "score": "0.7244113", "text": "def get_valid_phone_number\n puts \"Enter phone number which doesn't have 0 and 1 as well as length of 10\"\n num = gets.chomp\n if validate_number(num)\n num #return valid num\n else\n puts \"You have entered Invalid Number.\"\n get_valid_phone_number # Get valid input from user\n end\nend", "title": "" }, { "docid": "623603ebf6c88049ac5477e6b38ff20a", "score": "0.72383595", "text": "def valid_input?(number)\n number.to_i.abs.to_s == number || number.to_f.abs.to_s == number\nend", "title": "" }, { "docid": "bc819fed90bb4d9ba399673ddcec1c94", "score": "0.72381264", "text": "def integer_validation?(user_input)\n user_input = user_input.to_i\n return true if user_input.between?(0..7)\n end", "title": "" }, { "docid": "299188467aac8555a3aaf9bb2f001a9d", "score": "0.72249734", "text": "def is_valid?\n number.is_a?(Integer) &&\n number.positive? &&\n number.to_s.length == 10 &&\n !number.to_s.include?(\"0\") && !number.to_s.include?(\"1\")\n end", "title": "" }, { "docid": "23259a62eada81846424f3aba4ef65aa", "score": "0.72203594", "text": "def valid?(number)\n number.to_s.to_i == number\nend", "title": "" }, { "docid": "5c44baf3b0b40b1fdee66bb79a3444c6", "score": "0.7215601", "text": "def num_valid(user_num)\n until user_num >= 12 && user_num <= 21 \n print \"Enter integer value between 12 and 21: \"\n user_num = gets.chomp.to_i\n end\nend", "title": "" }, { "docid": "0fbed4ba9d52451a5e83e0591077de03", "score": "0.72155404", "text": "def verify(user_input)\n until user_input.to_i.to_s == user_input\n puts \"Please enter a number: \"\n user_input = gets.chomp\n end\n return user_input.to_i\nend", "title": "" }, { "docid": "c7041d45b121e52f0b900bc1b51785f7", "score": "0.7212247", "text": "def num_valid(num)\n if num < 10\n puts \"Valid\"\n else\n puts \"Invalid\"\n end\nend", "title": "" }, { "docid": "a2074c2d0f34b4b7ed1c16c501c89897", "score": "0.7212078", "text": "def valid_number?(arg)\n arg.to_i >= 1 && arg.to_i <= 250\n end", "title": "" }, { "docid": "32b4fce62f35d4fd8bd0e4addc7b6802", "score": "0.71989197", "text": "def valid_number?(number)\n @numbers.include?(number)\n end", "title": "" }, { "docid": "82bfd9e8109e1ac7f298c2c671fd10e3", "score": "0.7197533", "text": "def validate!\n raise \"number doesn't match format\" if number !~ NUMBER_FORMAT\n raise 'number cannot be nil' if number.nil?\n end", "title": "" }, { "docid": "350dfb35ec31e2da0d5a353c721dbc9f", "score": "0.71955407", "text": "def valid_number?(number)\n number.to_i.to_s == number\nend", "title": "" }, { "docid": "cc85a034cf6081b46d5ad4b58723ef84", "score": "0.7192864", "text": "def not_valid\n puts \"Please enter a valid number\"\n return get_number\nend", "title": "" }, { "docid": "e8442d440f9f78d1a11ffe4d414d1c1b", "score": "0.71852684", "text": "def check_input(input); end", "title": "" }, { "docid": "e8442d440f9f78d1a11ffe4d414d1c1b", "score": "0.71852684", "text": "def check_input(input); end", "title": "" }, { "docid": "e8442d440f9f78d1a11ffe4d414d1c1b", "score": "0.71852684", "text": "def check_input(input); end", "title": "" }, { "docid": "e699eef373ccf897f2e6b79932de4eea", "score": "0.71850944", "text": "def valid_number(user_number)\n user_number = gets.chomp.to_f\n until user_number > 0\n puts \"We need a positive number here!\"\n print \"Please enter a number greater than 0 ==> \"\n user_number = gets.chomp.to_f\n end\n return user_number.to_f\nend", "title": "" }, { "docid": "5c67ab1a097ff978af84c2482e70d2bb", "score": "0.71720934", "text": "def valid_input(num)\n if num.to_i().to_s() == num\n return true\n elsif num.to_f().to_s() == num\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "187d1af002da149deb99c9a43ff30443", "score": "0.7171309", "text": "def needed_input(user_input)\r\n if user_input >= 1 && user_input <= 100\r\n true\r\n else\r\n false\r\n end\r\n end", "title": "" }, { "docid": "4ba8d84c58e0129793325516e45847fc", "score": "0.7170775", "text": "def num_checker(num)\n if num >= 1 && num <=10\n print \"valid\"\n else\n print \"invalid\"\n end\nend", "title": "" }, { "docid": "192fbd19db7d5d48d39f56fabbd88b51", "score": "0.71429783", "text": "def get_number\n input = gets.chomp\n # continue to ask for a number until you get one. check_input checks for a number and if it isn't a number or calculate it returns error\n while check_input(input) == \"error\" \n puts \"Please only input a number\"\n input = gets.chomp\n end\n return input\nend", "title": "" }, { "docid": "192fbd19db7d5d48d39f56fabbd88b51", "score": "0.71429783", "text": "def get_number\n input = gets.chomp\n # continue to ask for a number until you get one. check_input checks for a number and if it isn't a number or calculate it returns error\n while check_input(input) == \"error\" \n puts \"Please only input a number\"\n input = gets.chomp\n end\n return input\nend", "title": "" }, { "docid": "fb70a0745f48885c781daa0f4436f797", "score": "0.7142211", "text": "def valid_loan_amount?(input)\n Integer(input) rescue false\nend", "title": "" }, { "docid": "c4d85ece735ddd8472e5a83a3f29dcf1", "score": "0.71403027", "text": "def valid_number?(num)\n num.to_i.to_s == num\nend", "title": "" }, { "docid": "fb5310ad6814dab71ef794f32acb48ce", "score": "0.7138469", "text": "def validate_input(number)\n Integer(number)\n rescue StandardError\n raise InvalidNumberError, 'The input is not a valid number, should be digits.'\n end", "title": "" }, { "docid": "e158fc229de906ebdfbee1cada28886f", "score": "0.7134963", "text": "def get_valid_int\n gets.chomp.to_i\nend", "title": "" }, { "docid": "e9c4c64b3da11402f72187407c4730f2", "score": "0.71300304", "text": "def input_and_check\n begin\n num = Kernel.gets.match(/^[1-3]$/)[0]\n rescue\n puts \"Erroneous input! Try again...\"\n retry\n else \n num.to_i - 1\n end\n end", "title": "" }, { "docid": "a8d80c4fd05f57029bf5624991074e7a", "score": "0.7117197", "text": "def number_is_valid? number\n if number.length != 10\n false\n else \n true\n end\n end", "title": "" }, { "docid": "60cbed065e6b496895519c65b432b8f9", "score": "0.711021", "text": "def check_input\n input = gets.chomp\n loop do\n if (input.to_i.to_s == input) && (input.to_i != 0)\n break\n else\n prompt(\"Enter a valid number!\")\n input = gets.chomp\n end\n end\n input\nend", "title": "" }, { "docid": "5bd48ba0c9fc1a9a067cad484a70562e", "score": "0.7106212", "text": "def verify_number(number, which)\n until number.to_f.to_s == number || number.to_i.to_s == number\n print \"Please enter a numerical value for your #{which} number: \"\n number = gets.chomp\n end\n return number.to_f\nend", "title": "" }, { "docid": "ace0ae283cba23f9eb5ad72083fea1e4", "score": "0.7103732", "text": "def isValid(num)\n if num >= 1 && num <= 10\n puts \"Valid\"\n else\n puts \"Invalid\"\n end\nend", "title": "" }, { "docid": "0c99a54313c1620e1d0a292777167e1a", "score": "0.7100767", "text": "def valid_int?(input)\n input.to_i.to_s == input\nend", "title": "" }, { "docid": "fb789f09be8e42b2baaa487308fe52e6", "score": "0.70849663", "text": "def num_input\n puts \"Type number:\"\n num = gets.chomp\n check = num.to_i\n checkf = num.to_f\n if num == (check.to_s || checkf.to_s)\n @equation << num.to_f\n else\n puts\n puts \"ERROR: Invalid entry, please enter a number.\"\n puts\n num_input\n end\nend", "title": "" }, { "docid": "f78412636e96ed29d5433dc7cbca193a", "score": "0.708416", "text": "def valid_number?(num)\n (num.to_i.to_f > 0) && (num.length > 3) && (num.length < 9)\nend", "title": "" }, { "docid": "5d4025ebcebe6d1c6d9b541d88ac4d47", "score": "0.7075491", "text": "def valid?\n @value.length > 1 && @value.chars.last.to_i == check_digit\n end", "title": "" }, { "docid": "69d765c940cee3e8eb9dd932b373490a", "score": "0.70635915", "text": "def val(number_to_val)\n # Call class String method to check\n # Alternative? --> while (number_to_val != '0' && number_to_val.to_i.to_f.to_s != number_to_val.strip)\n unless number_to_val.numeric?\n puts \"Please enter a valid integer\" ## CONTINUE TO STAY TRUE\n number_to_val = gets.chomp\n end\n return number_to_val\nend", "title": "" }, { "docid": "8308821625250fe2a2ace9dab0b36cda", "score": "0.7062954", "text": "def is_valid_input(input)\n return (input.to_i.to_s == input) && ((1..100).to_a.count(input.to_i) > 0)\nend", "title": "" }, { "docid": "302cb48cf1be31ba7611bc5ee4af6a41", "score": "0.7057155", "text": "def checkValidInput(value)\r\n\r\nflag=true\r\n\r\n if value[0]==nil\t\t\t\t\t\t#To Check Empty Input\r\n puts \"No Input Given\"\r\n flag=false\r\n elsif (value.match(/\\d*/)[0]<=>value)!=0 then \t#To Check The Input Is An Positive Integer\r\n puts \"Not A Positive Integer Number\"\r\n flag=false\r\n end\r\n\r\nreturn flag\r\nend", "title": "" }, { "docid": "302cb48cf1be31ba7611bc5ee4af6a41", "score": "0.7057155", "text": "def checkValidInput(value)\r\n\r\nflag=true\r\n\r\n if value[0]==nil\t\t\t\t\t\t#To Check Empty Input\r\n puts \"No Input Given\"\r\n flag=false\r\n elsif (value.match(/\\d*/)[0]<=>value)!=0 then \t#To Check The Input Is An Positive Integer\r\n puts \"Not A Positive Integer Number\"\r\n flag=false\r\n end\r\n\r\nreturn flag\r\nend", "title": "" }, { "docid": "04beb6b8098307c6c13310a4e955a11d", "score": "0.70545346", "text": "def verify(num)\n # the first check verifies that there is a digit somewhere, the second half sets the allowed format\n num.match(/\\d/) && num.match(/^\\d*.?\\d*$/)\nend", "title": "" }, { "docid": "a98bfea0e49d777bf18de9137b58042b", "score": "0.705302", "text": "def final_check\n if sum_digits_over_10.sum % 10 == 0\n \"The number is valid!\"\n else\n \"The number is invalid!\"\n end\n end", "title": "" }, { "docid": "2e9581b989f3e3433ae56f3f2db37d04", "score": "0.70508665", "text": "def input_validator(input)\n\t\tif input =~ /^[a-c][1-3]$/\n\t\t\tunless already_picked(input)\n\t\t\t\treturn false\n\t\t\telse\n\t\t\t\tputs \"Sorry, that square is full. Try again.\"\n\t\t\t\treturn true\n\t\t\tend\n\t\telse\n\t\t\tputs \"Sorry, that input was invalid. Try again.\"\n\t\t\treturn true\n\t\tend\n\tend", "title": "" }, { "docid": "ce52039b30fe757ba679493a65baf10c", "score": "0.7044683", "text": "def valid?\n # check if number provided has proper format\n return false unless has_proper_format?\n validate\n end", "title": "" }, { "docid": "9c8344b06e8ea185850e39ff318e9fb7", "score": "0.70406365", "text": "def get_number\n valid_number = false\n until valid_number do\n print \"Please enter a number: \"\n number = gets.chomp\n if number.to_i != 0 || number == \"0\"\n valid_number = true\n else\n puts \"Invalid entry. Try again.\"\n end\n end\n return number\nend", "title": "" }, { "docid": "6f9f6cee95e6fb4705593344a4d7aef1", "score": "0.70343435", "text": "def valid_number?(input)\n (input.to_i.to_s == input || input.to_f.to_s == input)\nend", "title": "" }, { "docid": "9dc0c3eb05cd7e061730d2fc4ebe7385", "score": "0.70322317", "text": "def valid_num(number)\n while number != Integer\n puts \"I need a number please!\"\n number = gets.chomp\n end\n return number.to_f\nend", "title": "" }, { "docid": "1491c4f0459c17633b7c6203f2df3c25", "score": "0.7025789", "text": "def valid_num(num)\n while num =~ /[a-zA-Z]/ || num.empty?\n puts \"Invalid selection.\"\n print \"Please enter a valid number: > \"\n num = gets.chomp\n end\n return num\nend", "title": "" }, { "docid": "7ad8ef166165f22bda2a70c2abd47c7a", "score": "0.7023449", "text": "def validate(number)\n error = {\n status: \"error\", \n code: \"invalid number\", \n message: \"input should be a 10 digit number and should not contain 0 or 1\"\n }\n\n # check input is not null, is a number and not contains 0 or 1\n return error if number.nil? || \n number.length != 10 || \n number.split('').select{\n |a|(a.to_i == 0 || a.to_i == 1)\n }.length > 0\n\n return true\n end", "title": "" }, { "docid": "d022ebdbde59f0b62d8f64f7ed1c2d81", "score": "0.7018302", "text": "def checks_input_number(num)\n # while num.to_i.to_s != num || num.to_f.to_s != num\n while num.to_f.to_s != num && num.to_i.to_s != num\n puts inserts_blank_line()\n puts \"Oops! Your entry was invalid. Please enter a number.\"\n num = gets.chomp\n end\n return num.to_f\nend", "title": "" }, { "docid": "fce1d01f6cddffcc5a6065a25d6b6853", "score": "0.7015264", "text": "def check_integer_input\n until @n != nil do\n puts \"Please, just integers\"\n print \">>\"\n @n = Integer(gets.chomp) rescue nil\n end\n end", "title": "" }, { "docid": "c742cb5f7b900b075bf508550832deb2", "score": "0.7014952", "text": "def valid_number?(number_string)\n\n number_string.to_i.to_s == number_string\n\nend", "title": "" }, { "docid": "855dbd0c87439c08814519c66c7d2ad8", "score": "0.7007959", "text": "def validate(num)\n\n # raise exception if input isn't an integer\n if ! /^\\d+$/.match(num)\n raise InvalidInputError, \"Invalid number. Only integers are supported. You passed #{num}\"\n end\n\n num = num.to_i\n # raise exception if input isn't an postiive integer\n if num < 0\n raise InvalidInputError, 'Invalid number. Must be positive number'\n end\n\n num\n end", "title": "" }, { "docid": "440180752450dca046768e256e08c107", "score": "0.7003163", "text": "def validate num\n if num < 100 \n al100 num\n elsif num < 500\n al500 num\n elsif num < 1000\n al1000 num\n end\n end", "title": "" }, { "docid": "a4f5996b924b1c88a076a6a5de2f1e0e", "score": "0.6997415", "text": "def validIn? (inStr)\n if inStr.to_i == 0\n puts \"Invalid input!\"\n return false\n end\n return true\nend", "title": "" }, { "docid": "333563aebdfc95bd5b2c21e9a71d0e11", "score": "0.6982531", "text": "def four_digit_input_checker\n four_digit_input_check = true\n while four_digit_input_check do\n input = gets.to_i\n if input < 1000 || input > 9999\n puts \"Invalid input. Please try again\"\n else\n four_digit_input_check = false\n end\n end\n return input\n end", "title": "" }, { "docid": "afb431e4b759183ddf746716e3aa1338", "score": "0.6982178", "text": "def valid_numeric?(input)\n input.numeric? && input.to_i.between?(1,@header.search_by_key(@location).length)\n end", "title": "" }, { "docid": "5c551b23bfd8e61b30cbd5d3858093af", "score": "0.69701856", "text": "def error_num(num)\n while num!= num.to_f.to_s && num != num.to_i.to_s\n print \"Invalid input, enter numbers only: \"\n num = gets.chomp\n end\n return num\nend", "title": "" }, { "docid": "445ec9045ee7c0c6bf01b30c639d73b3", "score": "0.6962848", "text": "def check_input(num)\n if num.zero?\n print \"Please enter a number > 0: \"\n num = check_input(gets.chomp.to_f)\n else\n return num\n end\nend", "title": "" }, { "docid": "7863c1af04bf90b3801c353d27cb3b3d", "score": "0.6956379", "text": "def number_checker guessed_number\n\n # You will need a regular expression.\n if guessed_number <= 0 or guessed_number > 10\n puts \"Sorry, please guess an integer number between 1 and 10, inclusive.\"\n return false\n else\n return true\n end\nend", "title": "" }, { "docid": "5ee4ab50ae2bfb414adce237cd873354", "score": "0.6951925", "text": "def alert_invalid_input() end", "title": "" }, { "docid": "5a0c19d463ff88c5e617f84aab6e3111", "score": "0.69361943", "text": "def valid_check_digits?\n ##Das Ergebnis muss 1 sein, ansonsten ist die IBAN falsch.\n numerify.to_i % 97 == 1\n end", "title": "" }, { "docid": "8f0c45af2a169e8a75643c40a679a8b5", "score": "0.692774", "text": "def validate!(num)\n end", "title": "" }, { "docid": "c65ecc228d0edeee11a43c0487ed38f4", "score": "0.6920185", "text": "def check(num)\n until /^[\\d]+(\\.[\\d]+){0,1}$/ === num\n puts \"That was not a number, try again: \"\n num = gets\n end\n num.to_i\nend", "title": "" } ]
43700fc6bd72419c91bc042bb663f2cf
caracteres, utilizando .select .
[ { "docid": "5e00b12068925460dc26fca159046a18", "score": "0.49641606", "text": "def select_largo_may_5(names)\n imp= names.select{|nombres|nombres.length >5} \n print \"los nombres que son más largos de 5#{imp} \\n\"\nend", "title": "" } ]
[ { "docid": "32d823942f10fda4a947f8dbe06c8ffb", "score": "0.7074299", "text": "def select_chars(&block)\n chars.select(&block)\n end", "title": "" }, { "docid": "2c79799a7a682072924da27ec999fe6f", "score": "0.6338609", "text": "def test_character_classes_give_options_for_a_character\n animals = [\"cat\", \"bat\", \"rat\", \"zat\"]\n assert_equal ['cat', 'bat', 'rat'], animals.select { |a| a[/[cbr]at/] }\n end", "title": "" }, { "docid": "13b5eeb151588e845398ee22a74dbb37", "score": "0.62669224", "text": "def test_character_classes_give_options_for_a_character\n animals = [\"cat\", \"bat\", \"rat\", \"zat\"]\n assert_equal [\"cat\", \"bat\", \"rat\"], animals.select { |a| a[/[cbr]at/] }\n end", "title": "" }, { "docid": "191869189f985d14a99487d24a9b1c27", "score": "0.6179054", "text": "def select_text(str_or_rx)\n select.select(str_or_rx)\n end", "title": "" }, { "docid": "2df4a3d5ef97bbd28dd4b17120b93716", "score": "0.58777803", "text": "def select_elements_starting_with_c(arr)\n arr.select { |e| e.start_with? 'c' }\n #puts \"select method : #{arr.select { |e| e.start_with? 'c' }}\\n\\n\"\nend", "title": "" }, { "docid": "5e1bebd1c07f68b44fa3c39e25547894", "score": "0.57886565", "text": "def nombres_p(nombres) \n nombres.select{|x| x =~ /P/} # [\"Paula\", \"Pía\"]\nend", "title": "" }, { "docid": "19702817d10bc75d1ab1135d113542e2", "score": "0.5711764", "text": "def select(val)\n raise \"select requires a String.\" unless val.is_a? String\n @select = val\n self\n end", "title": "" }, { "docid": "f2542226fc185692b29aa39a3dc4819a", "score": "0.5689818", "text": "def select(*rest) end", "title": "" }, { "docid": "f2542226fc185692b29aa39a3dc4819a", "score": "0.5689818", "text": "def select(*rest) end", "title": "" }, { "docid": "4b9bc857e1f2f1532509a8006b67e471", "score": "0.56891686", "text": "def matchers\n @find.chars.map { |char| char == '-' ? allowed_letters : \"#{char}{1}\" }.join ''\n end", "title": "" }, { "docid": "a7968b9e66a6ec02e8a9667c4168982f", "score": "0.56265277", "text": "def select_by(how, what); end", "title": "" }, { "docid": "1a9abab7280e6b95470c4aae0f60c2e5", "score": "0.56103563", "text": "def test_select\n assert_equal(%w[Assign Assign Assign Assign], @ab.select { |res| res == 'Assign' })\n assert_equal(%w[Buzz Buzz], @ab.select { |res| res == 'Buzz' })\n assert_equal(['AssignBuzz'], @ab.select { |res| res == 'AssignBuzz' })\n end", "title": "" }, { "docid": "142ce909655865f67dbfb137b1bd4f24", "score": "0.55936813", "text": "def select(*) end", "title": "" }, { "docid": "435ec51293e0f5fc7b9e081e4382879f", "score": "0.5554249", "text": "def select; end", "title": "" }, { "docid": "435ec51293e0f5fc7b9e081e4382879f", "score": "0.5554249", "text": "def select; end", "title": "" }, { "docid": "67ba9cd7677c38cf7d5369b1d534b692", "score": "0.5544519", "text": "def select\r\n assert_exists\r\n if(@how == :text)\r\n @select_list.select(@what)\r\n elsif(@how == :value)\r\n @select_list.select_value(@what)\r\n end \r\n end", "title": "" }, { "docid": "41350abb1deb8fb9d629dea4d6912b82", "score": "0.5525337", "text": "def regexp; end", "title": "" }, { "docid": "41350abb1deb8fb9d629dea4d6912b82", "score": "0.5525337", "text": "def regexp; end", "title": "" }, { "docid": "27250273065b960e28d1b20e707cf027", "score": "0.55213076", "text": "def my_select(&prc)\n selection = []\n i = 0\n while i < self.length\n if prc.call(self[i])\n selection << self[i]\n end\n i += 1\n end\n return selection\n end", "title": "" }, { "docid": "d08b101acc3767cf0683bae9e82cc481", "score": "0.5476319", "text": "def char_selected(prompt='chose :', srcs)\n print prompt\n while true\n res = gets.chop!\n case res\n when /[#{srcs}]/i\n \n return res\n \n end\n end\nend", "title": "" }, { "docid": "0ee75b01da05a30200d1984744464214", "score": "0.54731435", "text": "def spec_letter(array, char)\n # select through the array\n array.select do |str|\n # using include to find the substrings\n # if str has specific letter\n str.include? char\n end\nend", "title": "" }, { "docid": "d5192185d2e40e71d30090244b431d25", "score": "0.5455338", "text": "def test_select\n assert_equal(%w[Bar Bar Bar Bar], @kbb.select { |res| res == 'Bar' })\n assert_equal(%w[Baz Baz], @kbb.select { |res| res == 'Baz' })\n assert_equal(['BarBaz'], @kbb.select { |res| res == 'BarBaz' })\n end", "title": "" }, { "docid": "df0150ff466ec53ac6b284b7b981863d", "score": "0.54287815", "text": "def select_option(selector, selection)\r\n options = selector.options.select { |o| o.text == selection }\r\n options = selector.options.select { |o| o.value == selection } if options.empty?\r\n options = selector.options.select { |o| o.text.gsub(/[^a-zA-Z0-9]/,\"\") == selection } if options.empty?\r\n options = selector.options.select { |o| o.value.gsub(/[^a-zA-Z0-9]/,\"\") == selection } if options.empty?\r\n options = selector.options.select { |o| o.text.include?(selection) } if options.empty?\r\n options = selector.options.select { |o| o.value.include?(selection) } if options.empty?\r\n\r\n option = options.first\r\n option.select() unless option.nil?\r\n return option\r\n end", "title": "" }, { "docid": "3b4de42d5d7e1139a815b377effc0bc8", "score": "0.54179144", "text": "def select_option(selector, selection)\n options = selector.options.select { |o| o.text == selection }\n options = selector.options.select { |o| o.value == selection } if options.empty?\n options = selector.options.select { |o| o.text.gsub(/[^a-zA-Z0-9]/,\"\") == selection } if options.empty?\n options = selector.options.select { |o| o.value.gsub(/[^a-zA-Z0-9]/,\"\") == selection } if options.empty?\n options = selector.options.select { |o| o.text.include?(selection) } if options.empty?\n options = selector.options.select { |o| o.value.include?(selection) } if options.empty?\n\n option = options.first\n option.select() unless option.nil?\n return option\n end", "title": "" }, { "docid": "f155c55ab71c76307e4386f50de0c5f1", "score": "0.5398005", "text": "def select(*a)\n page.select selector_for(*a)\n end", "title": "" }, { "docid": "26e6cf757c2378562f255fefb9945fc3", "score": "0.5384342", "text": "def get_gender \n PROMPT.select(\"Enter your gender:\", %w(Male Female Other))\nend", "title": "" }, { "docid": "fce0bbba236f1e9a20726461716de219", "score": "0.53828025", "text": "def filter caracter\n\t\tcaracter if /[0-9|\\.]/.match caracter\n\tend", "title": "" }, { "docid": "d6fabeec62fbb09973a8a89d8c2cea7e", "score": "0.53718877", "text": "def select_with_name(val)\n option_locator = \"label=regexi:^#{val}$\"\n @driver.sc_select(:view, option_locator, self.abs_path)\n stall :select\n end", "title": "" }, { "docid": "03f64b0cd6628b9c1e5b5ce0e48814df", "score": "0.53366154", "text": "def scan_for_dots(token); end", "title": "" }, { "docid": "845497d7ca2a0b3f56542f23f217a626", "score": "0.533008", "text": "def select_regexp(table_name)\n %r{SELECT (`?(?:#{table_name})?`?.?\\\\*) FROM}\n end", "title": "" }, { "docid": "583b80593e0af1baa9005419955bf2e6", "score": "0.52879304", "text": "def select(*args) \n return nil if (args.length==1 and (Integer===args[0] or Symbol===args[0]))\n raise ArgumentError, \"Unexpected nil selection matcher\" if args.any? {|arg| arg.nil?}\n []\n end", "title": "" }, { "docid": "f4324e8944a72b6cfe38d0c2ce330344", "score": "0.5277751", "text": "def match(regexp); end", "title": "" }, { "docid": "3744940a1e5c39f4cdd3197099f1f064", "score": "0.52427787", "text": "def select(*names)\n result = []\n names.each { |name|\n name = Field.name_canonicalize(name)\n result.concat(find_all { |n, v|\n n.downcase == name\n })\n }\n result\n end", "title": "" }, { "docid": "695c3b0452f7f2a0028d1ad11061a648", "score": "0.5222337", "text": "def select_inicia_P(names)\n imp= names.select{|nombres|nombres if nombres[0] =='P'} \n print \"los nombres en que inician con P #{imp} \\n\"\nend", "title": "" }, { "docid": "423c7bde2b7bd56c32094f2993db38b8", "score": "0.5209079", "text": "def processed\n self.scan(/[a-z]/i).join.downcase\n end", "title": "" }, { "docid": "03b3404b87d51cc9afa4144dbc459c3b", "score": "0.51992863", "text": "def which_matches(sel, dev)\n # regex match :)\n sel.each { |str|\n return str if dev[:name] =~ /^#{str}$/\n }\n return nil\nend", "title": "" }, { "docid": "ed9bceb79d7f89fbad64bce73246f0eb", "score": "0.51845384", "text": "def find_a(arry)\n\n arry.select do |word|\n \"#{word}\".start_with?(\"a\")\n\n end\n # newlist\n end", "title": "" }, { "docid": "de34b8f129a18ee820e455403a716901", "score": "0.51757956", "text": "def match(tt)\n \ttt = \"#{tt}\"\n tt = tt.to_s.split(',')\n out = Cites.match(tt)\n puts out\n end", "title": "" }, { "docid": "26017307d8f30ebb62e02a485c6ce54c", "score": "0.5174036", "text": "def letters\n self.chars.select { |c| c.match(/[a-z]/i) }.join\nend", "title": "" }, { "docid": "211f1dbed9f50ade0272f5dcd1ad3224", "score": "0.51720816", "text": "def nombres_abc(nombres)\n nombres.select{|x| x =~ /A/ || x =~ /B/ || x =~ /C/}.count # 2\nend", "title": "" }, { "docid": "cb7dbc102f8d99a53ae6c7595f1e3e94", "score": "0.5164953", "text": "def select_letter(sentence, character)\n selected_chars = ''\n counter = 0\n\n loop do\n break if counter == sentence.size\n current_char = sentence[counter]\n\n if current_char == character\n selected_chars << current_char\n end\n\n counter += 1\n end\n\n selected_chars\nend", "title": "" }, { "docid": "27c6d20f2da1ceb8f06962b315bdcc4c", "score": "0.5153885", "text": "def select_options\n map {|e| [e.text, e.to_s] }\n end", "title": "" }, { "docid": "defe01bfae92efd1485c6f530eff2943", "score": "0.5147015", "text": "def scan_for_dash(token); end", "title": "" }, { "docid": "6b0a5c1c32a924beced115db7005b175", "score": "0.51464766", "text": "def select_elements_starting_with_vowel(array)\n array.select {|i| i[0] == \"a\" || i[0] ==\"e\" || i[0] == \"i\" || i[0] == \"o\" || i[0] == \"u\"}\nend", "title": "" }, { "docid": "d2d04d75d0a1d5a8e71d97400254d9f0", "score": "0.5140287", "text": "def match choice\n choice.select { |entry| entry if entry.downcase.split(//).sort == self.word.downcase.split(//).sort && entry.downcase != self.word.downcase} \n end", "title": "" }, { "docid": "aa51e7c02220decc95dffe52cab5f4fa", "score": "0.50930613", "text": "def pre_match() end", "title": "" }, { "docid": "6de673fd5605187d85278c5dc6596934", "score": "0.5090619", "text": "def visual_select(command)\n @visual_selection_range = [0,0]\n case command\n when 've'\n visual_select_word\n when 'v$'\n visual_select_input\n when /^vt(.)$/\n visual_select_char(command)\n end\n @visual_selection_range\n end", "title": "" }, { "docid": "64669509f9cff29e462c7d1724ecaba6", "score": "0.5086266", "text": "def test_scan_is_like_find_all\n assert_equal ['one', 'two', 'three'], \"one two-three\".scan(/\\w+/)\n end", "title": "" }, { "docid": "b04479c4d2f7f5a0895b1211254fafc2", "score": "0.5078698", "text": "def make_select(values, &block)\n return nil unless values\n raise ArgumentError unless values.class == String\n\n result = []\n values.split(',').each do |s|\n s.strip!\n s = yield(s) if block_given?\n result.push(s)\n end\n result\n end", "title": "" }, { "docid": "05f7e058ba206b3b8dce65af285d4edf", "score": "0.50693506", "text": "def vowels\r\n matches = []\r\n self.split(//).each do |c| \r\n VOWELS.include?(c) ? (matches << c) : nil\r\n end\r\n matches\r\n end", "title": "" }, { "docid": "77eb34409f28eebee7a1629805a2a3a3", "score": "0.50648385", "text": "def elements_ending_in_er\n collection.select {|word| word.end_with?(\"er\")}\n end", "title": "" }, { "docid": "71492d7b73f38b996d6de45b58d7eb52", "score": "0.5056176", "text": "def test_scan_is_like_find_all\n assert_equal [\"one\", \"two\", \"three\"], \"one two-three\".scan(/\\w+/)\n end", "title": "" }, { "docid": "71492d7b73f38b996d6de45b58d7eb52", "score": "0.5056176", "text": "def test_scan_is_like_find_all\n assert_equal [\"one\", \"two\", \"three\"], \"one two-three\".scan(/\\w+/)\n end", "title": "" }, { "docid": "cc46cede492700d1dc08f460f9827c6c", "score": "0.5051906", "text": "def select( item )\r\n select_item_in_select_list(:text, item)\r\n end", "title": "" }, { "docid": "b158614effc38411f2bdcc890f294d20", "score": "0.50425607", "text": "def def_split_select_feature( name, pattern, split_pattern = nil)\n self.send(:define_method, name.to_s + \"_split\" ) do |str|\n if split_pattern\n str.split(split_pattern)\n else\n str.split\n end\n end\n\n self.send( :define_method, name.to_s + \"_select\") do |strs|\n strs.select{ |w| w=~ pattern }\n end\n\n self.send( :define_method, name.to_s + \"_split_select\" ) do |str|\n strs = self.send(name.to_s + \"_split\", str)\n self.send(name.to_s + \"_select\", strs )\n end\n\n self.send(:define_method, name.to_s + \"_context\" ) do |str|\n { name.to_s => self.send(name.to_s + \"_split_select\", str).length }\n end\n end", "title": "" }, { "docid": "7e004873f53ed28f903f5eacf92cf981", "score": "0.5041767", "text": "def select_word\n @answer = \"\"\n @word = \"\"\n while not is_valid?\n @word = IO.readlines(\"../5desk.txt\")[rand(61405)].chomp\n end\n @word.downcase!\n puts @word\n @word.scan(/./){@answer << '*'}\n puts @answer\n end", "title": "" }, { "docid": "838802f012070cf625fce780d9ae2121", "score": "0.50337577", "text": "def scrooge_select_regex\n @@scrooge_select_regexes[self.table_name] ||= Regexp.compile( \"SELECT (`?(?:#{table_name})?`?.?\\\\*) FROM\" )\n end", "title": "" }, { "docid": "b48ae33d7d5645ba545530e920ad40ff", "score": "0.50253534", "text": "def select_elements_starting_with_vowel(array)\n\t n = ['john', 'david', 'omar', 'fred', 'idris', 'angela']\n\t n.select { |name| name.start_with?('a','e','i','o','u')}\nend", "title": "" }, { "docid": "706d3634d894627538fda58b74c3404d", "score": "0.5021507", "text": "def select_value(str_or_rx)\n select.select_value(str_or_rx)\n end", "title": "" }, { "docid": "18dc1356c29ea68c4b58b53209ad71f6", "score": "0.50191367", "text": "def get_letters(instr)\n MORSE.each { |c, re|\n if (instr =~ re) then\n yield c,$1\n end\n }\nend", "title": "" }, { "docid": "7644c27fa9178225c619756f23089f76", "score": "0.5013429", "text": "def select_letter(string, selection_criteria)\n new_string = \"\"\n counter = 0\n\n loop do\n break if counter == string.size\n if string[counter] == selection_criteria\n new_string << string[counter]\n end\n counter += 1\n end\n\n new_string\nend", "title": "" }, { "docid": "ecc89e609d0eced9d6021e1ac917743c", "score": "0.50083774", "text": "def cat_mouse(x)\n # Your code here\n x = x.split(\"\")\n x[1] == \"m\" || x[2] == \"m\" || x[3] == \"m\" || x[4] == \"m\"? \"Caught!\" : \"Escaped!\"\nend", "title": "" }, { "docid": "a43787e95c58ffda1f62498dcc533f8f", "score": "0.4990127", "text": "def select_elements_starting_with_vowel(array)\n array.select{|element|element.start_with?('a','e','i','o','u')}\nend", "title": "" }, { "docid": "bd10c9cc9930229dbcabaacc546e4f79", "score": "0.49880406", "text": "def test_a_vertical_pipe_means_or\n grays = /(James|Dana|Summer) Gray/\n assert_equal 'James Gray', \"James Gray\"[grays]\n assert_equal 'Summer', \"Summer Gray\"[grays, 1]\n assert_equal nil, \"Jim Gray\"[grays, 1]\n end", "title": "" }, { "docid": "642cd6fc1ee9655c9913a1a72a8cdaaf", "score": "0.49813792", "text": "def test_scan_is_like_find_all\n ##assert_equal __, \"one two-three\".scan(/\\w+/)\n assert_equal [\"one\", \"two\", \"three\"], \"one two-three\".scan(/\\w+/)\n end", "title": "" }, { "docid": "b5e01ff4c7504c4ca89999760e67c05d", "score": "0.4977164", "text": "def find_a(strings)\n strings.select do |string|\n string.start_with?(\"a\")\n end\nend", "title": "" }, { "docid": "95eaa6a024e7615e21749393698c4d7e", "score": "0.49744245", "text": "def select_by(how, what)\n case how\n when :text\n select_by_text what\n when :index\n select_by_index what\n when :value\n select_by_value what\n else\n raise ArgumentError, \"can't select options by #{how.inspect}\"\n end\n end", "title": "" }, { "docid": "792ba505b6d58de84e7a2d94fa83b67a", "score": "0.4972197", "text": "def find_a(array)\n a_words = array.select do |word|\n word[0] === \"a\" || word[0] === \"A\"\n end\n \n a_words\nend", "title": "" }, { "docid": "4e34b3499ae31b7e1c5cd5b29ddbcb9b", "score": "0.49661183", "text": "def contain_a(strings)\n strings.select do |string|\n string.include?(\"a\")\n end\nend", "title": "" }, { "docid": "f2c07a1be40faae751f60c4d34f5d2cd", "score": "0.4954242", "text": "def translate_matches\n char_class_re = /(.)-(.)/.freeze\n source.gsub!(char_class_re) { translate_range(*_1.split('-')) }\n nil\n end", "title": "" }, { "docid": "f6e705ade7a894d0cd6dc8eba685c5c1", "score": "0.49447516", "text": "def my_select(&prc)\n\t\tnew_array = []\n\n\t\tself.my_each do |ele|\n\t\t\tnew_array << ele if prc.call(ele)\t\t\t\t\n\t\tend\n\n\t\tnew_array\n\tend", "title": "" }, { "docid": "7601819794f0c7cb2cdea81d2d0d3fdc", "score": "0.4937624", "text": "def all_capChar_ascii_gr8ter_72(input)\n input.select do |c|\n c.upcase.ord > 72\n end\nend", "title": "" }, { "docid": "d3be039064039d05549c5bdbdd86d660", "score": "0.49337125", "text": "def monocle(inputString)\n\toptic = Regexp.new(inputString)\n\treturn optic\nend", "title": "" }, { "docid": "ed74cdd406ec1d9267fb64257f7c2673", "score": "0.49330878", "text": "def processed_content\n scan(/[a-z]/i).join.downcase\n end", "title": "" }, { "docid": "a77c59af4739069a103f926015c51e11", "score": "0.49304506", "text": "def o_words(sentence)\n select_words = sentence.split.select { |word| word.include?(\"o\") }\n return select_words\nend", "title": "" }, { "docid": "b2a27295aaa3c6455f9c14bc443150cc", "score": "0.49289805", "text": "def letter_select array, letter\n # iterates\n array.each do |value|\n # checks for letter at each index\n if value.include?(letter)\n # if letter is included in value at index, puts value\n puts value\n end\n end\n end", "title": "" }, { "docid": "9b60dec6e16bad7bd337392c4f1a9d2d", "score": "0.49264714", "text": "def one_letter array,letter\n array.select do |value|\n value.include?(letter)\n end\nend", "title": "" }, { "docid": "44688380f8208290b4578b28034c5cb0", "score": "0.49210927", "text": "def select_type_montant\n [\n \t['montant_ht', \"Montant Hors-Taxe\"],\n \t['montant_ttc', \"Montant TTC\"],\n \t['montant_net', \"Net à payer\"]\n ].in_select(id:'facture_montant_id', name:\"facture[montant_id]\")\nend", "title": "" }, { "docid": "5c218125ba2e73434d9f0e8f965eee17", "score": "0.4915969", "text": "def regexp=(_arg0); end", "title": "" }, { "docid": "ada9485342afa9e2682a823088db17e9", "score": "0.49144146", "text": "def select(how, what)\n case how\n when :text, :index, :value\n raise NotImplementedError\n else\n raise ArgumentError, \"can't select options by #{how.inspect}\"\n end\n end", "title": "" }, { "docid": "2a9b58ed63324e42eb41212d14720b7e", "score": "0.49003872", "text": "def extract(pattern); end", "title": "" }, { "docid": "ef823ec1d7393c2d7603c47d66cbccff", "score": "0.48998165", "text": "def phrase_select\n PHRASES.sample\n end", "title": "" }, { "docid": "bd02dcd83db60d8e78265faccf02de59", "score": "0.4891927", "text": "def contain_a(arr)\n arr.select do |word| \n word.include?(\"a\")\n end\nend", "title": "" }, { "docid": "005682d861feeb224d51492165c5d6bb", "score": "0.48904768", "text": "def select_option_value\n self.identifier.gsub(/\\//, '--')\n end", "title": "" }, { "docid": "71390b09f40ee4b2589038ef6c0dd4ad", "score": "0.488808", "text": "def characters(string); end", "title": "" }, { "docid": "71390b09f40ee4b2589038ef6c0dd4ad", "score": "0.488808", "text": "def characters(string); end", "title": "" }, { "docid": "b308cf13f7abd0287c84d0cc4ef5c2f0", "score": "0.4875977", "text": "def select_by_text(value)\n uf2 = find('select[id$=UF]')\n uf2.click\n uf2.find('option', text: value).click\n end", "title": "" }, { "docid": "6099250d89fbb11f7d2e00979167fbfd", "score": "0.48746154", "text": "def match(pattern); end", "title": "" }, { "docid": "997fafe0de92a77b4e05d7cbcb67c8f1", "score": "0.48724887", "text": "def my_select(&prc)\n arr = []\n self.my_each { |el| arr << el if prc.call(el) }\n arr\n end", "title": "" }, { "docid": "16a952da8e5afccc204248d84f857627", "score": "0.48671165", "text": "def select_option(selectName, text)\t\r\n\t\t\t\tSelenium::WebDriver::Support::Select.new(find_element(:name, selectName)).select_by(:text, text)\r\n end", "title": "" }, { "docid": "d8eaf0ea0b1b20b263509938a6780da5", "score": "0.48670232", "text": "def collection_select(method, collection, value_method, text_method, options = T.unsafe(nil), html_options = T.unsafe(nil)); end", "title": "" }, { "docid": "c6e7203cf5d1dde66e9daad09cec7891", "score": "0.48654723", "text": "def my_select(&prc)\n result_array = []\n self.my_each {|el| result_array << el if prc.call(el)}\n result_array\n end", "title": "" }, { "docid": "4350a987e01dd3ed8c1247714305b5a8", "score": "0.48550868", "text": "def regex_col(col, thing)\n all.find_all {|row| Regexp.new(row[col], Regexp::IGNORECASE) =~ thing}\n end", "title": "" }, { "docid": "108c006aa6a05a4683212e17b817daf8", "score": "0.48545638", "text": "def choose_character(character_1, character_2)\n character_1\n end", "title": "" }, { "docid": "e2169a882baadceef80fba615282eb43", "score": "0.48535204", "text": "def set_selection_for_char char=nil\n char = _ask_a_char unless char\n return :UNHANDLED if char == :UNHANDLED\n #alert \"got #{char}\"\n @oldrow = @current_index\n @last_regex = /^#{char}/i\n ix = next_regex @last_regex\n return unless ix\n @current_index = ix[0] \n #alert \"curr ind #{@current_index} \"\n @search_found_ix = @current_index\n @curpos = ix[1]\n ensure_visible\n return @current_index\n end", "title": "" }, { "docid": "f4b04e16fddb9df89895bf52edc7f281", "score": "0.48489767", "text": "def select(elem, selector)\n case selector\n when :element then elem\n when :inner_text, :inner_html, :outer_html then elem.send(selector)\n when /^@./ then elem[selector[1..-1]]\n when /^\\$[0-9]+$/\n i = selector[1..-1].to_i\n scrape_data(elem, i..i)\n when /^\\$[0-9]+(\\.\\.\\.?[0-9]+)?$/\n m = /\\.\\.\\.?/.match(selector)\n first, last = m.pre_match[1..-1].to_i, m.post_match.to_i\n last -= 1 if m[0] == \"...\"\n scrape_data(elem, first..last)\n else raise \"invalid selector #{selector.inspect} given\"\n end\n end", "title": "" }, { "docid": "de84f500737ce0bad0cb7065a19f1d57", "score": "0.4845688", "text": "def list_by_character(input)\n characterArray = Amiiboproject::Amiibo.all.select do |x| \n x.name.downcase == input\n end\n list_all(characterArray)\n end", "title": "" }, { "docid": "f1ed4c95245aa689655524f58ca85e6a", "score": "0.4842023", "text": "def selection\n [@fields.currentText, @entry.text.force_encoding('utf-8')]\n end", "title": "" }, { "docid": "eb354494dacea2435f323abc1ebe9e95", "score": "0.48416483", "text": "def select( &block )\r\n\t\t\treturn @contents.select( &block )\r\n\t\tend", "title": "" }, { "docid": "a22f74377268c829e13b995b77720c0b", "score": "0.48413476", "text": "def processed_content\n scan(/[a-z]/i).join.downcase\n\n # self.letters.downcase\n end", "title": "" } ]
163db73770cfcd69c4675ffff2f2dc80
PATCH/PUT /mixes/1 PATCH/PUT /mixes/1.json
[ { "docid": "1b746e2c12d5b4ecb61ab46d711563d8", "score": "0.5818874", "text": "def update\n @mix = Mix.friendly.find(params[:id])\n\n respond_to do |format|\n if @mix.update(mix_params)\n format.html {\n if params[:mix][:avatar].present?\n render \"crop\"\n else\n redirect_to edit_admin_mix_path(@mix), notice: 'The mix was successfully created.'\n end\n }\n format.json { render action: 'show', status: :created, location: @mix }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mix.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "3a5db9b3e30d1a95c0de9d00b590b893", "score": "0.6853158", "text": "def update\n respond_to do |format|\n if @mix.update(mix_params)\n format.html { redirect_to @mix, notice: 'Mix was successfully updated.' }\n format.json { render :show, status: :ok, location: @mix }\n else\n format.html { render :edit }\n format.json { render json: @mix.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8d6a61f3186174209e44862cb0ae05d7", "score": "0.6163822", "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": "4c4cc2178915bcb7ca2cffd7a27ca92c", "score": "0.6129167", "text": "def update\n respond_to do |format|\n if @mixture.update(mixture_params)\n format.html { redirect_to @mixture, notice: \"Mixture was successfully updated.\" }\n format.json { render :show, status: :ok, location: @mixture }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @mixture.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e0e59715d19dce2a47fccc2c67326dd", "score": "0.59912837", "text": "def patch!\n request! :patch\n end", "title": "" }, { "docid": "d37b39a795a6e081d6480942ece1c538", "score": "0.5901836", "text": "def put!\n request! :put\n end", "title": "" }, { "docid": "75d60dc5b8f58dcafe5c2ba43c86c669", "score": "0.5867231", "text": "def update\n respond_to do |format|\n if @dish_mixture.update(dish_mixture_params)\n format.html { redirect_to @dish_mixture, notice: 'Dish mixture was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @dish_mixture.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9514999ec34049df6c3290cb322e8cff", "score": "0.57934517", "text": "def update\n @mixproducto = Mixproducto.find(params[:id])\n\n respond_to do |format|\n if @mixproducto.update_attributes(params[:mixproducto])\n format.html { redirect_to @mixproducto, notice: 'Mixproducto was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @mixproducto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ccdc54b5a816d857ae51a0fa06c1fd60", "score": "0.5778131", "text": "def set_mix\n @mix = Mix.find(params[:id])\n end", "title": "" }, { "docid": "939213d9663059bf0d64fe1ce04983ed", "score": "0.5760242", "text": "def update\n recipe.update(recipe_params)\n render json: recipe\n end", "title": "" }, { "docid": "ddc3dabaac834d6e13990ac52c0f2aa9", "score": "0.5747377", "text": "def update\n @data = @recipe.update(params[:id], recipe_params)\n render json: @data\n end", "title": "" }, { "docid": "a1469411d5bbeccedd9ec2a9fc44438c", "score": "0.5744801", "text": "def set_mix\n @mix = Mix.find(params[:id])\n end", "title": "" }, { "docid": "54f95a361000b6219275e377b8bf4555", "score": "0.5743469", "text": "def update options={}\n client.put(\"/#{id}\", options)\n end", "title": "" }, { "docid": "576f27e4c99d0868b0454fedc7deba0c", "score": "0.56694686", "text": "def update # PATCH\n raise NotImplementedError\n end", "title": "" }, { "docid": "855f81d29ee8ff100cfefb3479cedcdd", "score": "0.5661261", "text": "def update(url, data)\n RestClient.put url, data, :content_type => :json\nend", "title": "" }, { "docid": "2657ddbb191e753274097d67026ec17a", "score": "0.56455755", "text": "def update\n respond_to do |format|\n if @crop_mix.update(crop_mix_params)\n format.html { redirect_to @crop_mix, notice: 'Crop mix was successfully updated.' }\n format.json { render :show, status: :ok, location: @crop_mix }\n else\n format.html { render :edit }\n format.json { render json: @crop_mix.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27bf2343b43b279f3787ae78d10bd689", "score": "0.56098396", "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": "0018379efbe593a993ef4a8d2edfdc94", "score": "0.55699366", "text": "def update\n if @mix.user == current_user && @mix.update(mix_params)\n redirect_to @mix.user\n else\n render :edit\n end\n end", "title": "" }, { "docid": "b0fc01b384fb0119c2a1f5121d050842", "score": "0.55488145", "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": "c42bde476d51212fa13cbbdb620fb4b8", "score": "0.5520767", "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": "1167cd27cd1fb43f4943b64e7be17837", "score": "0.5488271", "text": "def update\n ingredient.update(ingredient_params)\n render json: ingredient\n end", "title": "" }, { "docid": "d4ef989d8743bdf8c57e55d4d894dddc", "score": "0.54848766", "text": "def patch(path, data)\n request 'PATCH', path, body: data.to_json\n end", "title": "" }, { "docid": "1028973cffc69617bd7b2c272318642c", "score": "0.54573447", "text": "def update_radios_for_array(args = {}) \n id = args['id']\n temp_path = \"/radios.json/{arrayId}\"\n path = temp_path\nargs.keys.each do |key|\n if (key == \"radioId\")\n args.delete(key)\n path = temp_path.gsub(\"{#{key}}\", id)\n end\nend\n puts \" PATH : #{path}\"\n put(path, args)\nend", "title": "" }, { "docid": "1994a4eaa1450d63a6f230f4fbc18092", "score": "0.54551476", "text": "def update\n respond_to do |format|\n cube = Cube.find(params[:id])\n \n if cube.save!\n format.html { redirect_to @cube, notice: 'Cube was successfully updated.' }\n format.json { render :show, status: :ok, location: @cube }\n else\n format.html { render :edit }\n format.json { render json: @cube.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "951e2d5f363e6a4b2acd28e437137a98", "score": "0.545001", "text": "def update\n # @recipe = Recipe.find(params[:id])\n #\n update! do |success, failure|\n # success.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n # success.json { head :ok }\n # failure.html { render action: \"edit\" }\n # failure.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end", "title": "" }, { "docid": "909b760f54f181542cb95aee2413689b", "score": "0.5448151", "text": "def patch\n end", "title": "" }, { "docid": "e7663d0348b74542ff1d2f4fd96156fe", "score": "0.5433446", "text": "def api_patch(path, data = {})\n api_request(:patch, path, :data => data)\n end", "title": "" }, { "docid": "566b79a755478221953c8e53a0770812", "score": "0.5430282", "text": "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "title": "" }, { "docid": "566b79a755478221953c8e53a0770812", "score": "0.5430282", "text": "def patch options\n rest_request({ method: :patch }.merge(options))\n end", "title": "" }, { "docid": "e3f82a0be1587113f2d871aa5c0e0a22", "score": "0.54298896", "text": "def update\n @cake = Cake.find(params[:id])\n\n respond_to do |format|\n if @cake.update_attributes(params[:cake])\n format.html { redirect_to @cake, notice: 'Cake was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cake.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b06e17a6ee3195795af4a38c911c058f", "score": "0.54243535", "text": "def put(id, json)\n with_endpoint do |endpoint|\n url = [endpoint, @resource_name, id].compact.join('/')\n url += \"/\" \n return HTTParty.put(url, :body => json, :timeout => 4, :headers => { 'Content-Type' => 'application/json' })\n end\n end", "title": "" }, { "docid": "6aa809630cc29fb9a8a453f9804b5bc1", "score": "0.5409932", "text": "def update\n respond_to do |format|\n if @recipe.update(recipe_params)\n params[:recipe][:ingredients].each do |ingredient_id|\n next if ingredient_id.to_i == 0\n ingredient = Ingredient.find(ingredient_id.to_i)\n @recipe.ingredients << ingredient\n end\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "98ffa158acbf02cbf2dc20af8c117e34", "score": "0.53999186", "text": "def update\n put :update\n end", "title": "" }, { "docid": "3cca714dabb3f471a53e174c24f14c01", "score": "0.5399402", "text": "def update_radios_for_array(args = {}) \n put(\"/radios.json/#{args[:arrayId]}\", args)\nend", "title": "" }, { "docid": "d3abc8887989710dfc28e7e38b9df59f", "score": "0.5397158", "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": "129813f878bdb65e40141aa72a205f4e", "score": "0.53811705", "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": "85d2ed02d760acd40f7badcfec78a18a", "score": "0.5380812", "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": "17394723967eced6a5486f67c71d4516", "score": "0.53759336", "text": "def update\n @fabric = Fabric.find(params[:id])\n\n respond_to do |format|\n if @fabric.update_attributes(params[:fabric])\n format.html { redirect_to @fabric, notice: 'Fabric was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fabric.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dd2562dcce7d02f68335913edcc1145e", "score": "0.5373145", "text": "def update\n begin\n recipe = Recipe.find(params[:id])\n\n if recipe.update_attributes(recipe_params)\n render json: { status: 'SUCCESS', message: 'Recipe updated!', data: recipe }, status: :ok\n else\n render json: { status: 'ERROR', message: 'Error updating recipe', data: recipe.errors }, status: :unprocessable_entity\n end\n rescue\n render json: { status: 'ERROR', message: 'Error finding recipe', data: {} }, status: :not_found\n end\n end", "title": "" }, { "docid": "931f17c5c899a79322a439bd3a6eca7b", "score": "0.5358966", "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": "449f05da0e025824189fbafe4280c276", "score": "0.535828", "text": "def update\n params[:recipe][:ingredient_ids] ||= []\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6c08e3b498de211018a92efbff9e7b3e", "score": "0.53553027", "text": "def update\n if @spice.update(spice_params)\n head :no_content\n else\n render json: @spice.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "6eccf0cb1ebc7404a9ae8d73fad0c91a", "score": "0.5332749", "text": "def put(*args)\n request :put, *args\n end", "title": "" }, { "docid": "7cbcb2cda6e100042f124dacd474f3be", "score": "0.5329821", "text": "def update_tenant_circle(args = {}) \n put(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "13b3fe4bcbe95f2191ff8aef474bf89d", "score": "0.53151757", "text": "def update\n respond_to do |format|\n if @remixer.update(remixer_params)\n format.html { redirect_to @remixer, notice: 'Remixer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @remixer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cfa491c1da43aa78b384f86b93b0251d", "score": "0.5314599", "text": "def update\n @ipack = Ipack.find(params[:id])\n\n respond_to do |format|\n if @ipack.update_attributes(params[:ipack])\n format.html { redirect_to ipacks_url, notice: 'Collection successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ipack.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "940920178270999adda137b703502c20", "score": "0.53062373", "text": "def update\n respond_to do |format|\n if @cookbook.update(cookbook_params)\n format.html { redirect_to cookbook_path(@cookbook), notice: 'Cookbook was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @cookbook.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b3d6af3e1ade5f41124866b57a6b326", "score": "0.5302905", "text": "def patch(path, **args); end", "title": "" }, { "docid": "4569bee346a677d19613e288edaa480b", "score": "0.5294888", "text": "def update\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to recipes_path, notice: 'Recipe successfully changed!!' }\n format.json { render json: @recipe }\n else\n #flash[:notice] = 'Recipe has not been changed!'\n format.html { render action: :edit }\n format.json { render json: @recipe.errors }\n end\n end\n end", "title": "" }, { "docid": "fb88fef9ffa0d872f40dcfb6a7c29bc5", "score": "0.5279446", "text": "def patch(path, opts = {})\n request(:patch, path, opts).body\n end", "title": "" }, { "docid": "5b2913c3ebc1d3cf210759c11129945b", "score": "0.527909", "text": "def update\n @box = Box.find(params[:id])\n\n respond_to do |format|\n if @box.update_attributes(params[:box])\n format.html { redirect_to @box, notice: 'Box was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @box.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d1d0a1cfae8d276693aa145776d8152", "score": "0.5278651", "text": "def update\n respond_with []\n end", "title": "" }, { "docid": "d12fbc13d258a640a94368623904b957", "score": "0.52778226", "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": "5f376145d5c693a9a2ba8654f4f5db3e", "score": "0.52772355", "text": "def update\n @meteor = Meteor.find(params[:id])\n\n respond_to do |format|\n if @meteor.update_attributes(params[:meteor])\n format.html { redirect_to @meteor, notice: 'Meteor was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @meteor.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b0a3604ed81fb943014dea0229e2a90e", "score": "0.52736473", "text": "def update\n @choice = Choice.find(params[:id])\n\n if @choice.update(choice_params)\n head :no_content\n else\n render json: @choice.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "c5fda1156132902df609e0f71d17ab2f", "score": "0.526592", "text": "def update\n respond_to do |format|\n if @recipe.update(recipe_params)\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0a7f39244b84a933f5e2778f23a356bd", "score": "0.5259944", "text": "def update\n @set.update_attributes({ :data => params[:data] })\n render_json :entry => @set and return\n end", "title": "" }, { "docid": "0a7f39244b84a933f5e2778f23a356bd", "score": "0.5259944", "text": "def update\n @set.update_attributes({ :data => params[:data] })\n render_json :entry => @set and return\n end", "title": "" }, { "docid": "02d287ec571eb8b3a16ae3178ed19588", "score": "0.5245432", "text": "def set_mixture\n @mixture = Mixture.find(params[:id])\n end", "title": "" }, { "docid": "6b145c6d2c00c746f2574828e2f7c552", "score": "0.524371", "text": "def update\n @tack = Tack.find(params[:id])\n\n if @tack.update(tack_params)\n head :no_content\n else\n render json: @tack.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "44c433e964eca048ede6ca0e1f4adac5", "score": "0.52393204", "text": "def update\n respond_to do |format|\n if @cake_cake.update(cake_cake_params)\n format.html { redirect_to @cake_cake, notice: 'Cake cake was successfully updated.' }\n format.json { render :show, status: :ok, location: @cake_cake }\n else\n format.html { render :edit }\n format.json { render json: @cake_cake.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c11ced844c55b314d94c5d5a413f2b8d", "score": "0.523635", "text": "def update\n respond_to do |format|\n if @cake.update(cake_params)\n format.html { redirect_to @cake, notice: 'Cake was successfully updated.' }\n format.json { render :show, status: :ok, location: @cake }\n else\n format.html { render :edit }\n format.json { render json: @cake.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7b4020428f9a76ff055033b757892ae7", "score": "0.5228607", "text": "def update\n @coin_set = CoinSet.find(params[:id])\n \n respond_to do |format|\n if @coin_set.update_attributes(params[:coin_set])\n # an update should be coming from the coin_set show page.\n format.html { redirect_to @coin_set, notice: 'Coin set was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @coin_set.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c7c439954870330e9b0632d3efee5e37", "score": "0.5226988", "text": "def update\n dream = Dream.find params[:id]\n dream.update dream_params\n render json: {dream: dream}\n end", "title": "" }, { "docid": "4dd0750b154299ddba8eec67a5724981", "score": "0.52253044", "text": "def update\n @stuff = Stuff.find(params[:id])\n\n respond_to do |format|\n if @stuff.update_attributes(params[:stuff])\n format.html { redirect_to @stuff, :notice => 'Stuff was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @stuff.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a53c36becde87694e36b10d69ce32c74", "score": "0.52239186", "text": "def modify(name: nil, avatar: nil, channel_id: nil)\n RestClient.patch(@url, { name: name, avatar: avatarise(avatar), channel_id: channel_id }.compact.to_json, content_type: :json)\n end", "title": "" }, { "docid": "a982787b853a4461c0f662934f52dc55", "score": "0.5223311", "text": "def update\n respond_to do |format|\n if @bits_1.update(bits_1_params)\n format.html { redirect_to @bits_1, notice: 'Bits 1 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @bits_1.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b3dd073938b8b5857cc5f4c138281107", "score": "0.5220985", "text": "def update\n respond_to do |format|\n require 'rest-client'\n response = RestClient.put('localhost:3001/colores/'+@color.id.to_s, color_params.as_json, {:Authorization => 'admin irizREhyoG6Ejwr4AcjsQME9'})\n if response.code == 200\n @color = JSON.parse(response.body)\n\n format.html { redirect_to @color, notice: \"Color was successfully updated.\" }\n format.json { render :show, status: :ok, location: @color }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @color.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b6d684353ff76566c0bd53501d608515", "score": "0.5220884", "text": "def update\n @animal.update(animal_params)\n respond_with(@shelter)\n end", "title": "" }, { "docid": "5655b98df6460a73de7b81851d822c78", "score": "0.52179945", "text": "def update\n @bundle = Bundle.find(params[:id])\n\n\n respond_to do |format|\n params[:bundle][:category] = params[:bundle][:category].strip.downcase\n params[:bundle][:style] = params[:bundle][:style].strip.downcase\n params[:bundle][:color] = params[:bundle][:color].strip.downcase\n params[:bundle][:brand] = params[:bundle][:brand].strip.downcase\n params[:bundle][:make] = params[:bundle][:make].strip.downcase\n params[:bundle][:location] = params[:bundle][:location].strip.downcase\n\n if @bundle.update_attributes(params[:bundle])\n format.html { redirect_to @bundle, notice: 'Bundle was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @bundle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aaa53a5c120c23c441cb5ffdaf2db9f6", "score": "0.5216413", "text": "def update\n #Finding the specific chore where the id matches the one we pass in with the body\n @v1_chore = Chore.where(id: params[:id]).first\n #Here we're checking if we have user_id in our body, and if we do, we'll change the selected chore's properties\n #with the parameters of the body, we go through the specific group to our specific chore with the path\n if v1_chore_params[:user_id]\n @v1_chore.user_id = params[:user_id]\n @v1_chore.assigned = true\n if @v1_chore.save\n render :show, status: :ok\n end\n else\n render json: @v1_chore.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "14c905f394d21126bbf18a315ee60cad", "score": "0.5215516", "text": "def update(*args)\n put(*args)\n end", "title": "" }, { "docid": "14c905f394d21126bbf18a315ee60cad", "score": "0.5215516", "text": "def update(*args)\n put(*args)\n end", "title": "" }, { "docid": "53727df11c5bedd4f46e599f8a76aab8", "score": "0.52140653", "text": "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @response = args[:response] if args.key?(:response)\n end", "title": "" }, { "docid": "1ed82904109bb057044fdad5412d06cf", "score": "0.5207916", "text": "def update\n @pack = Pack.find(params[:id])\n\n respond_to do |format|\n if @pack.update_attributes(params[:pack])\n format.html { redirect_to(@pack, :notice => 'Product Mixed was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @pack.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7acab3ee92f9ba484a4bda0492c9862a", "score": "0.5205758", "text": "def update\n\n #@recipe.ingredients = params[:recipe_ingredients].map {|k, v|\n #ingredient = @recipe.ingredients.find(k) || @recipe.ingredients.build\n #ingredient.update_attributes(:item => Food.find(v[:item_id]), :quantity => v[:quantity]) unless v[:item_id].blank?\n #ingredient\n #}.compact if params[:ingredients]\n\n @recipe.tags = params[:tags].split(/,/).map { |t|\n Tag.find_or_create_by_name(t.strip.downcase)\n }.compact if params[:tags]\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99de1ee51639b741650413b6ad94732a", "score": "0.52046597", "text": "def update\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99de1ee51639b741650413b6ad94732a", "score": "0.52046597", "text": "def update\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99de1ee51639b741650413b6ad94732a", "score": "0.52046597", "text": "def update\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99de1ee51639b741650413b6ad94732a", "score": "0.52046597", "text": "def update\n @recipe = Recipe.find(params[:id])\n\n respond_to do |format|\n if @recipe.update_attributes(params[:recipe])\n format.html { redirect_to @recipe, notice: 'Recipe was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "75d646eb1fda852f0dcd7d966d083d80", "score": "0.51987433", "text": "def create\n @mix = Mix.new(mix_params)\n\n respond_to do |format|\n if @mix.save\n format.html { redirect_to @mix, notice: 'Mix was successfully created.' }\n format.json { render :show, status: :created, location: @mix }\n else\n format.html { render :new }\n format.json { render json: @mix.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e339c7bb15421f3a5125b7652cef4048", "score": "0.51950914", "text": "def update\n redirect_to root_url\n\n # respond_to do |format|\n # if @fluke.update(fluke_params)\n # format.html { redirect_to @fluke, notice: 'Fluke was successfully updated.' }\n # format.json { render :show, status: :ok, location: @fluke }\n # else\n # format.html { render :edit }\n # format.json { render json: @fluke.errors, status: :unprocessable_entity }\n # end\n # end\n end", "title": "" }, { "docid": "678b4a422929c754df75bdc1490ff353", "score": "0.51937175", "text": "def update\n render_json :status => :forbidden and return unless @collection.write?(@user, @client)\n if !params[:collection]\n render_json :status => :bad_request, :messages => \"Tried to update collection with no data.\" and return\n end\n @collection.update_attributes(params[:collection].slice(:metadata, :read_only, :title, :tags, :priv))\n render_json :entry => @collection.to_hash(@user, @client) and return\n end", "title": "" }, { "docid": "f6bfa7214db02c1d0fe4ac0995a2e235", "score": "0.5188395", "text": "def update\n respond_to do |format|\n if @chocolate.update(chocolate_params)\n format.html { redirect_to @chocolate, notice: \"Chocolate was successfully updated.\" }\n format.json { render :show, status: :ok, location: @chocolate }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @chocolate.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c98462aaf3625945a5abf580260ad41c", "score": "0.51834863", "text": "def put(*args)\n request(:put, *args)\n end", "title": "" }, { "docid": "593a44661145186c50e85fe3c02ffd96", "score": "0.5178479", "text": "def patch(path, params = {})\n request(:patch, path, params)\n end", "title": "" }, { "docid": "593a44661145186c50e85fe3c02ffd96", "score": "0.5178479", "text": "def patch(path, params = {})\n request(:patch, path, params)\n end", "title": "" }, { "docid": "7961ba1d763ad0d47914ddcbcf089d8e", "score": "0.5177926", "text": "def patch(path, params)\n time(\"PATCH #{path}\") { Cloudflarer.new.patch(path, params) }\n end", "title": "" }, { "docid": "4eda75ad731bcff02704fca4657354dd", "score": "0.5175264", "text": "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n end", "title": "" }, { "docid": "2cd92b4b1b6525c20ab2a5e811797804", "score": "0.51748854", "text": "def update\n respond_to do |format|\n if @potluck_recipe.update(potluck_recipe_params)\n format.html { redirect_to @potluck_recipe, notice: 'Potluck recipe was successfully updated.' }\n format.json { render :show, status: :ok, location: @potluck_recipe }\n else\n format.html { render :edit }\n format.json { render json: @potluck_recipe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "358dc1a0e9b1990682d8964e3192e76c", "score": "0.5166956", "text": "def update\n @cookbook = Cookbook.find(params[:id])\n\n respond_to do |format|\n if @cookbook.update_attributes(params[:cookbook])\n format.html { redirect_to @cookbook, notice: 'Cookbook was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cookbook.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f75edb99a52b3aa998fbcfde258bb05c", "score": "0.5165934", "text": "def update\n render json: Alien.update(params[\"id\"], params[\"alien\"])\n end", "title": "" }, { "docid": "2f6dfe822a5ee4ccd5c66da915a6b7eb", "score": "0.51639634", "text": "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n end", "title": "" }, { "docid": "f31380ffdd653343a94bc92d7fa4597a", "score": "0.5158676", "text": "def update\n @kit = Kit.find(params[:id])\n\n respond_to do |format|\n if @kit.update_attributes(params[:kit])\n format.html { redirect_to @kit, notice: 'Kit was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @kit.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fd670cc4a9888ff3de9a8a9f2dd3b9a8", "score": "0.51569784", "text": "def update\n @model = Model.find(params[:id])\n # @model.name = \"test\"\n @model.scale = 1\n respond_to do |format|\n if @model.update_attributes(params[:model])\n format.html { redirect_to @model, notice: 'Model was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @model.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0bb7608514ecec423e08eeebe600d68b", "score": "0.5156017", "text": "def update\n do_patch { return } # check if patch and do submission and return early if it is a patch (submission)\n # otherwise this is a PUT of the dataset metadata\n check_status { return } # check it's in progress, clone a submitted or raise an error\n respond_to do |format|\n format.json do\n dp = if @resource\n DatasetParser.new(hash: params['dataset'], id: @resource.identifier, user: @user) # update dataset\n else\n DatasetParser.new(hash: params['dataset'], user: @user, id_string: params[:id]) # upsert dataset with identifier\n end\n @stash_identifier = dp.parse\n ds = Dataset.new(identifier: @stash_identifier.to_s) # sets up display objects\n render json: ds.metadata, status: 200\n end\n end\n end", "title": "" }, { "docid": "2a642a611c63a85b6ef6e72d09830e50", "score": "0.51540977", "text": "def update\n render json: Post.update(params[\"id\"], params[\"post\"])\n end", "title": "" }, { "docid": "60d38fce2778c1e5cb50eae932692650", "score": "0.5154046", "text": "def update!(**args)\n @id = args[:id] if args.key?(:id)\n @kind = args[:kind] if args.key?(:kind)\n @name = args[:name] if args.key?(:name)\n @starred = args[:starred] if args.key?(:starred)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "97cf4143d957113abf699a1c614c5646", "score": "0.51516116", "text": "def update\n respond_to do |format|\n if @couch.update(couch_params)\n format.html { redirect_to @couch, notice: 'Couche was successfully updated.' }\n format.json { render :show, status: :ok, location: @couch }\n else\n format.html { render :edit }\n format.json { render json: @couch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b4fc82a67f9d1a2b001a6081ef37e57", "score": "0.5148482", "text": "def update\n render json: Item.update(params[\"id\"], params[\"item\"])\n end", "title": "" }, { "docid": "f92fba8e95e00b3dd2c5ecf63c292f9c", "score": "0.5146091", "text": "def put(path, data = {})\n request 'PUT', path, body: data.to_json\n end", "title": "" } ]
0e10f658611c5e12edd30987d0a5101e
Set Top Row row : row shown on top
[ { "docid": "d5f18f33533008b3d88bd777dd04d65b", "score": "0.7395049", "text": "def top_row=(row)\n # If row is less than 0, change it to 0\n if row < 0\n row = 0\n end\n # If row exceeds row_max - 1, change it to row_max - 1\n if row > row_max - 1\n row = row_max - 1\n end\n # Multiply 1 row height by 32 for y-coordinate of window contents\n # transfer origin\n self.oy = row * 32\n end", "title": "" } ]
[ { "docid": "0a0499827522473363ec44d814ecd10d", "score": "0.74246645", "text": "def top_row=(row)\n row = 0 if row < 0\n row = row_max - 1 if row > row_max - 1\n self.oy = @all_line_ys.empty? ? row * item_height : @all_line_ys[row]\n update_padding_bottom\n end", "title": "" }, { "docid": "76e95ff7e6d3d120cdb0397385fff202", "score": "0.74222684", "text": "def top_row=(row)\n row = 0 if row < 0\n row = row_max - 1 if row > row_max - 1\n self.oy = row * @item_sq_spacing\n end", "title": "" }, { "docid": "4e1b3e2addb32eb36e81608b0d156122", "score": "0.7421293", "text": "def top_row(*val) #:nodoc:\n if val.empty?\n @toprow\n else\n @toprow = val[0] || 0\n end\n @repaint_required = true\n end", "title": "" }, { "docid": "4e1b3e2addb32eb36e81608b0d156122", "score": "0.7421293", "text": "def top_row(*val) #:nodoc:\n if val.empty?\n @toprow\n else\n @toprow = val[0] || 0\n end\n @repaint_required = true\n end", "title": "" }, { "docid": "c33f3080dfc2e210af772567c94c8028", "score": "0.7403686", "text": "def top_row(*val) \n if val.empty?\n @toprow\n else\n @toprow = val[0] || 0\n end\n @repaint_required = true\n end", "title": "" }, { "docid": "25283639a6b59a504f03c4b415a4081c", "score": "0.7350438", "text": "def top_row=(row)\n # if row is less than 0\n if row < 0\n # change it to 0\n row = 0\n # if row exceeds row_max - 1\n elsif row > row_max - 1\n # change it to row_max - 1\n row = row_max - 1\n end\n # row height offset\n self.oy = row * 64\n end", "title": "" }, { "docid": "fc19ee10339a3f78ae7d949cf91d08eb", "score": "0.7321328", "text": "def top_row=(row)\r\n # If row is less than 0, change it to 0\r\n # If row exceeds row_max - 1, change it to row_max - 1\r\n row = [[row, 0].max, row_max - 1].min\r\n # Multiply 1 row height by 32 for y-coordinate of window contents\r\n # transfer origin\r\n self.oy = row * self.oh\r\n end", "title": "" }, { "docid": "e9457c9528222b8b3a2f40d98d81e7c3", "score": "0.72318226", "text": "def top_row=(row)\n row = 0 if row < 0\n row = row_max - 1 if row > row_max - 1\n self.oy = row * @line_h\n end", "title": "" }, { "docid": "e9457c9528222b8b3a2f40d98d81e7c3", "score": "0.72318226", "text": "def top_row=(row)\n row = 0 if row < 0\n row = row_max - 1 if row > row_max - 1\n self.oy = row * @line_h\n end", "title": "" }, { "docid": "033a2c8228f42dde010f5c77396c70c3", "score": "0.7220334", "text": "def bottom_row=(row)\n self.top_row = row - (page_row_max - 1)\n end", "title": "" }, { "docid": "34d5c4732ae669c75bbd9dad3f69ec90", "score": "0.7215264", "text": "def top_row=(row)\n r = item_rect(row)\n if r.y <= oy\n super(row)\n @top_row = row\n self.oy = r.y\n elsif @contents_height - oy - real_height > 0\n i = top_row\n h = (i..@index).inject(0) { |h,n| h += item_rect(n).height }\n while h > real_height\n i += 1\n h = (i..@index).inject(0) { |h,n| h += item_rect(n).height }\n end\n super(i)\n @top_row = i\n self.oy = item_rect(i).y\n end\n end", "title": "" }, { "docid": "f6320722e36a2475bc022d42d6080cfd", "score": "0.71995115", "text": "def top_row=(row)\n row = 0 if row < 0\n row = row_max - 1 if row > row_max - 1\n self.oy = row * WLH\n end", "title": "" }, { "docid": "afa2ae19358a5a3ef1cb515eacf3be91", "score": "0.7181284", "text": "def scroll_top\n @current_row = 0\n\n noutrefresh\n end", "title": "" }, { "docid": "018fa9f01b7693eaf618d7688e2e922b", "score": "0.70419306", "text": "def top_row\n @top_row\n end", "title": "" }, { "docid": "80cf3190b37cb61573efd50cc2204aa3", "score": "0.6908843", "text": "def top_row=(row)\n if row < 0\n row = 0\n end\n if row > row_max - 1\n row = row_max - 1\n end\n self.oy = row * 116 #116\n end", "title": "" }, { "docid": "ab1160c42a3fb008a799b3afb4cc39ff", "score": "0.6831542", "text": "def top_row(&block)\n @top_rows << @context.capture(&block)\n end", "title": "" }, { "docid": "1c8a80512fdb68efb326066dad649438", "score": "0.6825735", "text": "def top_row(*args)\n r = @all_line_ys.empty? ? nil : @all_line_ys.index(oy)\n r ? r : super(*args)\n end", "title": "" }, { "docid": "1bf2b7a40600a5160fa3ca198db9addc", "score": "0.65452373", "text": "def top\n @top ||= total_height - ((height + grid.row_gutter) * @i.to_f)\n end", "title": "" }, { "docid": "7d42fcc9d72f86c38409fb60835c58e8", "score": "0.65190554", "text": "def first_row\n @first_row ||= top_rows\n end", "title": "" }, { "docid": "0cd80ccfa4203524b1f4e2bb5c8c3eb9", "score": "0.6397411", "text": "def assume_top_position\n update_attribute(position_column, 1)\n end", "title": "" }, { "docid": "53bad4b38cd9bbe96a463fe736427581", "score": "0.6350938", "text": "def ensure_cursor_visible\r\n self.top_row = row if row < top_row\r\n self.bottom_row = row if row > bottom_row\r\n end", "title": "" }, { "docid": "438e8cc708e416beb3180f84d87b9300", "score": "0.63113374", "text": "def ensure_cursor_visible\n self.top_row = row if row < top_row\n self.bottom_row = row if row > bottom_row\n end", "title": "" }, { "docid": "8e119038e9e1fe4cd5c4b65013ed9592", "score": "0.6278245", "text": "def set_form_row\n r,c = rowcol\n @rows_panned ||= 0\n\n # when the toprow is set externally then cursor can be mispositioned since \n # bounds_check has not been called\n if @current_index < @toprow\n # cursor is outside table\n @current_index = @toprow # ??? only if toprow 2010-10-19 12:56 \n end\n\n row = r + (@current_index-@toprow) + @rows_panned \n # row should not be < r or greater than r+height TODO FIXME\n\n setrowcol row, nil\n\n end", "title": "" }, { "docid": "592f4b2dd79a4668f87fe016dac55b6c", "score": "0.6267065", "text": "def assume_top_position\n update_attribute(position_column, 1)\n end", "title": "" }, { "docid": "296b720d08a20cf5481e9c8f3661e1bb", "score": "0.62613946", "text": "def assume_top_position\n update_attribute position_column, 1\n end", "title": "" }, { "docid": "296b720d08a20cf5481e9c8f3661e1bb", "score": "0.62613946", "text": "def assume_top_position\n update_attribute position_column, 1\n end", "title": "" }, { "docid": "296b720d08a20cf5481e9c8f3661e1bb", "score": "0.62613946", "text": "def assume_top_position\n update_attribute position_column, 1\n end", "title": "" }, { "docid": "8cc6e9ed95e28061b682125f4a36b783", "score": "0.62552494", "text": "def insert_row_above row\n new_row = create_row 1\n row.previous_sibling = new_row\n new_row\n end", "title": "" }, { "docid": "219c92ff9bf52c474a98b223afb92b75", "score": "0.623187", "text": "def setTop(i)\n\t\t@first=i\n\t\tdebug(\"setTop: first==#{@first}, selected==#{@selected}\")\n\t\trefresh\n\tend", "title": "" }, { "docid": "bd460d3c3db9f6e956a9301954c16076", "score": "0.62251544", "text": "def ensure_cursor_visible\n self.top_row = row if row < top_row\n self.bottom_row = row if row > bottom_row\n end", "title": "" }, { "docid": "bd460d3c3db9f6e956a9301954c16076", "score": "0.62251544", "text": "def ensure_cursor_visible\n self.top_row = row if row < top_row\n self.bottom_row = row if row > bottom_row\n end", "title": "" }, { "docid": "83944e26de14d77f20713a28bdf9dd00", "score": "0.61383057", "text": "def assume_top_position\n update_position 1\n end", "title": "" }, { "docid": "c511badf36a3942ea8d56853cef6f1af", "score": "0.6103816", "text": "def hide_top!\n top(false)\n end", "title": "" }, { "docid": "c511badf36a3942ea8d56853cef6f1af", "score": "0.6103816", "text": "def hide_top!\n top(false)\n end", "title": "" }, { "docid": "22047a1cdac4e3856e04fc3d7952d96d", "score": "0.60970885", "text": "def move_to_top\n move_to(0)\n end", "title": "" }, { "docid": "c8d0d8a9849f578d8786dbd0ff51dfe5", "score": "0.6080222", "text": "def top_level_row row\n end", "title": "" }, { "docid": "c8d0d8a9849f578d8786dbd0ff51dfe5", "score": "0.6080222", "text": "def top_level_row row\n end", "title": "" }, { "docid": "1f49671a19e30c4071dfe7c1aaac1a26", "score": "0.6078721", "text": "def top\n @place = \"top\"\n self\n end", "title": "" }, { "docid": "2b691b80c03338d1c140c1a53bef7928", "score": "0.60731477", "text": "def assume_top_position\n update_attribute(position_column, 1)\n end", "title": "" }, { "docid": "1b3bd8dd5332fd84a175494976656b38", "score": "0.6047961", "text": "def set_screen_row_col top, left=-1\n @top = top\n @left = left unless left < 0\n end", "title": "" }, { "docid": "9591d0a7ff9f56de355d0c36252c8fc3", "score": "0.6033561", "text": "def top_horizontal\n @top_horizontal ||= Vedeu::Cells::TopHorizontal.new(cell_attributes)\n end", "title": "" }, { "docid": "4fb3c66cc0fcf06bfa4942e1b793fc02", "score": "0.6029831", "text": "def show_top!\n top(true)\n end", "title": "" }, { "docid": "4fb3c66cc0fcf06bfa4942e1b793fc02", "score": "0.6029831", "text": "def show_top!\n top(true)\n end", "title": "" }, { "docid": "fc091385c77daf53ba7ae02e785f0895", "score": "0.6025411", "text": "def scroll_top\n activate 0\n end", "title": "" }, { "docid": "1ceb85251425ef1c8164d0fe063e79be", "score": "0.5977588", "text": "def set_row(index = 0)\n src_rect.y = index*src_rect.height\n end", "title": "" }, { "docid": "8d16db4cc059db8e246ecc230ad8305e", "score": "0.5945858", "text": "def move_to_top\n move_to(1)\n end", "title": "" }, { "docid": "a2e3c681d3948a2937c09448cfb26121", "score": "0.5932193", "text": "def set_top(style)\n @top = style\n end", "title": "" }, { "docid": "7adb4ad958aafa2726d809c56eb3368e", "score": "0.5912936", "text": "def set_form_row\n r,c = rowcol\n @form.row = r + (@current_index-@toprow) \n end", "title": "" }, { "docid": "d02152f5f8108b2fd5b6c667681c9a15", "score": "0.58958393", "text": "def ensure_visible row = @current_index\n unless is_visible? row\n @prow = @current_index - @_header_adjustment\n end\n end", "title": "" }, { "docid": "d02152f5f8108b2fd5b6c667681c9a15", "score": "0.58958393", "text": "def ensure_visible row = @current_index\n unless is_visible? row\n @prow = @current_index - @_header_adjustment\n end\n end", "title": "" }, { "docid": "f07e95882a58dd0a3d403c9e4cdb4aac", "score": "0.5871494", "text": "def set_MinRow(value)\n set_input(\"MinRow\", value)\n end", "title": "" }, { "docid": "f07e95882a58dd0a3d403c9e4cdb4aac", "score": "0.5871494", "text": "def set_MinRow(value)\n set_input(\"MinRow\", value)\n end", "title": "" }, { "docid": "56748ed43d24cdd927b4c3338b541b2a", "score": "0.5868684", "text": "def change_border_top(weight='thin')\n change_border(:top, weight)\n end", "title": "" }, { "docid": "295b02d609a472a3430e040abd2c9c86", "score": "0.5868201", "text": "def move_to_top\n return unless in_list?\n self.class.transaction do\n adjust_positions_on_higher_items(1, !number_enabled? ? -1 : 0)\n assume_top_position\n end\n end", "title": "" }, { "docid": "04e912825995a145cfc996c8ece2f57e", "score": "0.5842202", "text": "def scrollatrow\n if @suppress_borders\n @height - 1 \n else\n @height - 3 \n end\n end", "title": "" }, { "docid": "3dcdd6a6657ec5e817f57b9ab31ee0c4", "score": "0.58412594", "text": "def top(value)\n boolean = value ? true : false\n\n model.show_top = boolean\n end", "title": "" }, { "docid": "182c048ddf4f290ec3cf47036b4d700d", "score": "0.58063847", "text": "def content_top(options = {})\n concat tag(:div, {:id => \"contentTopRow\"}, true)\n yield\n concat '</div>'\n end", "title": "" }, { "docid": "ffa798aca2f422213aadedbd26b84aff", "score": "0.580265", "text": "def top_row\n return self.oy / 64\n end", "title": "" }, { "docid": "48662759e6e777e9c10da0637a2dfab6", "score": "0.5794868", "text": "def cursor_pageup\n if top_row > 0\n @index = [@index - page_item_max, 0].max\n self.top_row -= page_row_max - @item_sq_spacing \n end\n end", "title": "" }, { "docid": "bd4544027a14b29169af234c118375a9", "score": "0.57840425", "text": "def restore_rows_for_header row_stk\r\n until row_stk.empty?\r\n node = col_node = row_stk.pop\r\n loop do\r\n restore_vertical node\r\n node = node.right\r\n break if node == col_node\r\n end\r\n end\r\n end", "title": "" }, { "docid": "dd5e6b0f16b1842b0e9f5b0178f83a15", "score": "0.5779473", "text": "def insertRowAbove(row)\n newRow=createRow(1)\n row.previous_sibling=newRow\n return newRow\n end", "title": "" }, { "docid": "fff24141882307372fc0776925c630cc", "score": "0.5773883", "text": "def set_grid_rows(rows)\n TSApi.tsapi_setDefinedRows(rows)\n end", "title": "" }, { "docid": "18041260e8b5202f3d81afd12f29cda5", "score": "0.57698226", "text": "def top(player)\n (player == :black) ? 0 : @max_row\n end", "title": "" }, { "docid": "bbe45b892f73ad5fdaabb657e0d079aa", "score": "0.57677865", "text": "def insertRowAbove(row)\n newRow = createRow(1)\n row.previous_sibling = newRow\n return newRow\n end", "title": "" }, { "docid": "6067a9b8200be121367d967a24239428", "score": "0.57660615", "text": "def top=(value)\n @top = value\n end", "title": "" }, { "docid": "ee97b843ba532c98132e2e2236ff369c", "score": "0.57503456", "text": "def cursor_pageup\n if top_row > 0\n @index = [@index - page_item_max, 0].max\n self.top_row -= page_row_max\n end\n end", "title": "" }, { "docid": "ccc86aa8219b8427b528b5fdb3c89250", "score": "0.57194877", "text": "def rows\n top...(top + height)\n end", "title": "" }, { "docid": "22d8bcb9d5cd3c0a62aeefe1ab7a16dd", "score": "0.57185644", "text": "def set_TopParent(value)\n set_input(\"TopParent\", value)\n end", "title": "" }, { "docid": "eeed3d39180fee93e692eb5653457065", "score": "0.570432", "text": "def restore_selected_row header_stk, row_stk_stk\r\n until header_stk.empty?\r\n row_stk = row_stk_stk.pop\r\n header = header_stk.pop\r\n\r\n restore_horizontal header\r\n restore_rows_for_header row_stk\r\n end\r\n end", "title": "" }, { "docid": "a2747af73843a73f4ed42ce1a099e335", "score": "0.56917804", "text": "def set_pad_top_left top, left=-1\n $log.debug \"#{@name} inside set_pad_top_left to #{top} #{left} earlier #{@pminrow}, #{@pmincol}\"\n @pminrow = top unless top < 0\n @pmincol = left unless left < 0\n end", "title": "" }, { "docid": "9def85c0d95896e23b1e976b7ba0cd3a", "score": "0.5689053", "text": "def flight_bar_top(row_number)\n \treturn @chart_top + (row_number * @name_height) + @flight_bar_margin\n end", "title": "" }, { "docid": "d0a3836692c47db91f43d360622446c2", "score": "0.56699765", "text": "def ensure_visible _row = @current_index\n unless is_visible? _row\n @pstart = _row\n end\n end", "title": "" }, { "docid": "0ae6fa15f5c89da8abcc784260d4ebbd", "score": "0.5666589", "text": "def scroll_top; end", "title": "" }, { "docid": "0ae6fa15f5c89da8abcc784260d4ebbd", "score": "0.5666589", "text": "def scroll_top; end", "title": "" }, { "docid": "a62074a85c042f9173a37356cc11bce1", "score": "0.5665294", "text": "def move_to_top\n self.class.transaction do\n increment_position_of_higher_items\n set_top_position\n end\n end", "title": "" }, { "docid": "422dee4c95080126022a988ea5cf4335", "score": "0.5654925", "text": "def insertRowBelow(row)\n newRow=createRow(1)\n row.next_sibling=newRow\n #-----------------------------------------------------------------------\n # Cave: etwaige Wiederholungen uebertragen\n #-----------------------------------------------------------------------\n repetitions=row.attributes[\"table:number-rows-repeated\"]\n if(repetitions)\n row.attributes.delete(\"table:number-rows-repeated\")\n newRow.next_sibling=createRow(repetitions.to_i)\n end\n return newRow\n end", "title": "" }, { "docid": "6df95a43b47ab291efbb3ba8bfc1fdcd", "score": "0.5651434", "text": "def top_index=(index)\n index = 0 if index < 0\n index = item_max - visible_max if index > item_max - visible_max\n @actor_viewport.oy = index * actor_height\n end", "title": "" }, { "docid": "439c1ed7bfaaa9392d0f7f6fb3945afa", "score": "0.564986", "text": "def insert_row_below row\n new_row = create_row 1\n row.next_sibling = new_row\n repetitions = row.attributes[\"table:number-rows-repeated\"]\n if repetitions\n row.attributes.delete \"table:number-rows-repeated\"\n new_row.next_sibling = create_row repetitions.to_i\n end\n new_row\n end", "title": "" }, { "docid": "9d3e71567ef3bfecb0e53cba1148ea7b", "score": "0.56245494", "text": "def place(tabletop)\n @tabletop = tabletop\n end", "title": "" }, { "docid": "5a8ae87776f7a0bc9c87437bfb2eac76", "score": "0.562253", "text": "def scroll_to row\n height = Curses.lines - 2\n\n if row < @current_row then\n @current_row = row\n elsif row > @current_row + height then\n @current_row = row\n end\n\n noutrefresh\n end", "title": "" }, { "docid": "4f796807162c846f8ff4c1e21e487ed2", "score": "0.5618741", "text": "def insertRowBelow(row)\n newRow = createRow(1)\n row.next_sibling = newRow\n #-----------------------------------------------------------------------\n # Cave: etwaige Wiederholungen uebertragen\n #-----------------------------------------------------------------------\n repetitions = row.attributes[\"table:number-rows-repeated\"]\n if(repetitions)\n row.attributes.delete(\"table:number-rows-repeated\")\n newRow.next_sibling = createRow(repetitions.to_i)\n end\n return newRow\n end", "title": "" }, { "docid": "ed8947354968ef9ebcef8fc6cf58f717", "score": "0.55846405", "text": "def by_row!\n @mode = :row\n\n self\n end", "title": "" }, { "docid": "b3773eb955ddeaa486baddea456a2618", "score": "0.5583383", "text": "def assume_top_position\n update_attribute_and_timestamp(position_column, 1)\n end", "title": "" }, { "docid": "10bc2cab562c16815a66dd2a520cee8a", "score": "0.55626655", "text": "def set_Row(value)\n set_input(\"Row\", value)\n end", "title": "" }, { "docid": "4b4c0ec237f7356a3d42948741398a55", "score": "0.55552715", "text": "def move_to_top\n return unless in_list?\n acts_as_list_class.transaction do\n increment_positions_on_higher_items\n assume_top_position\n end\n end", "title": "" }, { "docid": "029d65950e2d95019f898b813f5e670b", "score": "0.55534816", "text": "def delete_row_above row\n previous_row = row.previous_sibling\n die \"row is already first row in row\" unless previous_row\n previous_repetitions = previous_row.attributes[\"table:number-rows-repeated\"]\n if previousRepetitions && previousRepetitions.to_i > 1\n previous_row.attributes[\"table:number-rows-repeated\"] = (previous_repetitions.to_i-1).to_s\n else\n table = row.elements[\"ancestor::table:table\"]\n unless table\n die \"Could not extract parent-table of row #{row}\"\n end\n table.elements.delete previous_row\n end\n end", "title": "" }, { "docid": "83d6df485c60b30205426e06507ffc40", "score": "0.55523956", "text": "def top=(val)\n @top = val\n end", "title": "" }, { "docid": "48520f59d36f2a878650eee2ac113e3f", "score": "0.5541856", "text": "def scrollatrow\n if @suppress_borders # NOT TESTED XXX\n @height - 2 # we forgot to remove 1 from height in border.\n else\n @height - 4 # we forgot to remove 1 from height in border.\n end\n end", "title": "" }, { "docid": "9b979e518918fb07d7ffc10c9d73a324", "score": "0.55385005", "text": "def row\n @xpos = 30\n @ypos += 130\n end", "title": "" }, { "docid": "c096b292012989dacf5ac80c01a4d01f", "score": "0.5523208", "text": "def move_to_top\n return unless in_list?\n acts_as_list_class.transaction do\n increment_positions_on_higher_items\n assume_top_position\n end\n end", "title": "" }, { "docid": "932b3f2977f9a0fe466a046c09544779", "score": "0.55090034", "text": "def pagination_top(*parts, row: nil, css: '.pagination-top', **opt)\n prepend_css!(opt, \"row-#{row}\") if row\n prepend_css!(opt, css)\n html_div(*parts, opt)\n end", "title": "" }, { "docid": "b1535697175bcd7889d69a0579971a26", "score": "0.5507159", "text": "def set_default_row(height = nil, zero_height = nil)\n height ||= @original_row_height\n zero_height ||= 0\n\n if height != @original_row_height\n @default_row_height = height\n\n # Store the row change to allow optimisations.\n @row_size_changed = 1\n end\n\n if ptrue?(zero_height)\n @default_row_zeroed = 1\n end\n end", "title": "" }, { "docid": "2da2f8c1c9c18242f256911ca950ea0f", "score": "0.54985714", "text": "def rowOff; end", "title": "" }, { "docid": "049f7f8048b8169de81c242b14ceaf01", "score": "0.5497756", "text": "def min_row; return -1; end", "title": "" }, { "docid": "e2c500789998d4c2691d837624df62f7", "score": "0.5484286", "text": "def set_row(*args)\n return unless args[0]\n\n row = args[0]\n height = args[1] || @default_height\n xf = args[2]\n hidden = args[3] || 0\n level = args[4] || 0\n collapsed = args[5] || 0\n\n # Get the default row height.\n default_height = @default_row_height\n\n # Use min col in check_dimensions. Default to 0 if undefined.\n min_col = @dim_colmin || 0\n\n # Check that row and col are valid and store max and min values.\n check_dimensions(row, min_col)\n store_row_col_max_min_values(row, min_col)\n\n height ||= default_height\n\n # If the height is 0 the row is hidden and the height is the default.\n if height == 0\n hidden = 1\n height = default_height\n end\n\n # Set the limits for the outline levels (0 <= x <= 7).\n level = 0 if level < 0\n level = 7 if level > 7\n\n @outline_row_level = level if level > @outline_row_level\n\n # Store the row properties.\n @set_rows[row] = [height, xf, hidden, level, collapsed]\n\n # Store the row change to allow optimisations.\n @row_size_changed = true\n\n # Store the row sizes for use when calculating image vertices.\n @row_sizes[row] = [height, hidden]\n end", "title": "" }, { "docid": "c1a5b5898f9b8f1ca5018b768804144a", "score": "0.54754615", "text": "def move_top_button_locator(fieldsets, row_index)\n {:xpath => fieldset_move_top_btn_xpath(fieldsets, row_index)}\n end", "title": "" }, { "docid": "ab9fe38d699a6447b293793203f37c38", "score": "0.5469524", "text": "def scroll_top=(_arg0); end", "title": "" }, { "docid": "ab9fe38d699a6447b293793203f37c38", "score": "0.5469524", "text": "def scroll_top=(_arg0); end", "title": "" } ]
9cdf484dd7cd6fd70631b3159fd55403
This allows for more declarative subclassing of strategies by allowing default options to be set using a simple configure call.
[ { "docid": "6fe90161b8a0b0a80511902f7a5ad4a3", "score": "0.0", "text": "def configure_options(options = nil)\n if block_given?\n yield default_options\n else\n default_options.deep_merge!(options)\n end\n end", "title": "" } ]
[ { "docid": "20c1959d731fe7c769b02617cd46b796", "score": "0.7310064", "text": "def configure_with strategy = :default, options = {}, &block\n @options[:strategy] = strategy\n configuration.strategy = strategy\n # use configuration to load adapter!\n configuration.load_adapter\n\n # apply options to config\n config.apply_options! options\n\n yield config if block_given?\n config\n end", "title": "" }, { "docid": "fa0d978bb81c0485c87079e67fff4a99", "score": "0.6871474", "text": "def default_strategies(*strategies); end", "title": "" }, { "docid": "c849f58e3835cdd507f4fd67d8f006e8", "score": "0.6716572", "text": "def configure(settings = {})\n abstract_method\n end", "title": "" }, { "docid": "9d13e6a40cc48d4e7db33837e3007583", "score": "0.6432805", "text": "def test_configure_with_in_derived\n \n klass = Class.new\n klass.extend ConfigurationDsl\n klass.configure_with Module.new {\n def name(value = \"chris\")\n value.to_s\n end\n def age(value)\n value.to_i\n end\n }\n klass.configure do\n age 31\n end\n \n derived = Class.new(klass)\n assert_equal \"chris\", derived.configuration.name\n assert_equal 31, derived.configuration.age\n \n derived.configure_with Module.new {\n def birthday(date)\n date\n end\n def gender(v)\n v\n end\n }\n derived.configure do\n birthday \"03/11/1980\"\n gender \"male\"\n end\n\n assert_raise(NoMethodError){ derived.configuration.name }\n assert_raise(NoMethodError){ derived.configuration.age }\n assert_equal \"03/11/1980\", derived.configuration.birthday\n assert_equal \"male\", derived.configuration.gender\n\n # Make sure nothing happened to our base class.\n assert_equal \"chris\", klass.configuration.name\n assert_equal 31, klass.configuration.age\n end", "title": "" }, { "docid": "72890e3e7354fe619bbf8122e53aac95", "score": "0.6294289", "text": "def configure(options)\n behavior = nil\n injection = nil\n @@behaviors.map do |identifier, injector|\n if identifier = parameter(identifier, options)\n if behavior\n raise Error::Mutant, \"More than one type of behavior expected.\"\n else\n if @@injections[injector].include?(:configuration)\n injection = @@injections[behavior = injector][:configuration]\n options[:behavior] ||= behavior\n end\n end\n end\n end\n\n options[:type] ||= behavior\n injection || proc { @configuration }\n end", "title": "" }, { "docid": "52a47dbe1bb48697704bca74649ad2b1", "score": "0.6285769", "text": "def default_strategies(*strategies)\n if strategies.empty?\n @config[:default_strategies]\n else\n @config[:default_strategies] = strategies.flatten\n end\n end", "title": "" }, { "docid": "60740c1070622fc779e48c81d62b893b", "score": "0.62189406", "text": "def configure(options = T.unsafe(nil)); end", "title": "" }, { "docid": "fc17b86341a496346ebc3cd0b96246c4", "score": "0.62108195", "text": "def with_options(opts)\n __new__(config, options.merge(opts))\n end", "title": "" }, { "docid": "8a08c14e693cb7cf6c994cc5f9bc7cf3", "score": "0.61647767", "text": "def configure(options = T.unsafe(nil), &block); end", "title": "" }, { "docid": "b538691e3bf2a1711115d83019dd1460", "score": "0.61612487", "text": "def configure( options )\n end", "title": "" }, { "docid": "1a2ab0ca2cc96767df362f16228f12d0", "score": "0.60833645", "text": "def configure(*a, &b)\n options.configure(*a, &b)\n end", "title": "" }, { "docid": "c5c391620508d6207796c95dee167d1c", "score": "0.6033513", "text": "def initialize(options = {})\n # seed the sensible defaults here\n options = {\n symbolize: true,\n interpolation: false,\n default_configuration: {\n environment: nil,\n secrets_dir: '~/.aws',\n disallow_environments: %w(cucumber test),\n strategy: :blue_green,\n package: {\n dir: 'pkg',\n verbose: false,\n includes: DEFAULT_INCLUDES,\n exclude_files: [],\n exclude_dirs: DEFAULT_EXCLUDE_DIRS\n },\n options: {},\n inactive: {}\n }\n }.merge(options)\n super(options)\n end", "title": "" }, { "docid": "ccb5a141fffb7ab23d67d293bf4ac805", "score": "0.6010736", "text": "def strategy(*args, &block)\n strategy = Strategy.new(*args, &block)\n add_strategy(strategy)\n end", "title": "" }, { "docid": "bde8870a90501d67b4c66f5b33abb6d4", "score": "0.6006164", "text": "def configure(*args)\n # Load config from the arguments passed to the constructor.\n # This *may* override defaults and it's a feature.\n infer_config(*args) unless args.empty?\n\n # Load adapters explicitly here to ensure their plugins are present for later use\n load_adapters\n\n # Allow customizations now\n yield(self) if block_given?\n\n # Register gateway components based on current config\n register_gateways\n\n self\n end", "title": "" }, { "docid": "ee692b3fea9de289f7101ba7599770ac", "score": "0.59657663", "text": "def inherited(base)\n base.config = Configuration.new\n base.configure do |config|\n config.keep_alive = true\n config.transport = Thrift::FramedTransport\n config.protocol = Thrift::BinaryProtocol\n config.pool_size = 12\n config.pool_timeout = 2\n config.rpc_timeout = 2\n config.statsd = NullStatsd.new\n config.stack = MiddlewareStack.new\n end\n end", "title": "" }, { "docid": "b789d6642b7c9e61b88e64b3afe31a34", "score": "0.5957414", "text": "def method_missing(meth, *args, &block)\n Conf.respond_to?(meth) ? Conf.send(meth, *args, &block) : super\n end", "title": "" }, { "docid": "094d8e18131b2f8409828683c6265f9e", "score": "0.59398615", "text": "def configure(options = nil)\n if block_given?\n yield default_options\n else\n default_options.deep_merge!(options)\n end\n end", "title": "" }, { "docid": "c898007fa1641e6eb1ff2b5b8cd5e29b", "score": "0.5933808", "text": "def configure(**options, &block)\n # save class state over to configured subclass\n copy_over = instance_variables.map do |n|\n v = instance_variable_get(n)\n # Scorched::Options and Scorched::Collection are \"inheritable\" so we\n # may not bother copying them onto configured subclass\n [n, v] unless v.is_a? Scorched::Options or v.is_a? Scorched::Collection\n end\n copy_over = Hash[copy_over.compact]\n\n controller = Class::new(self) do\n copy_over.each_pair do |n, v|\n instance_variable_set(n, v)\n end\n config << options\n class_eval(&block) if block_given?\n end\n controller.configured\n controller\n end", "title": "" }, { "docid": "6c1851d6e22a8d4723bef5d80ca3b6b1", "score": "0.5913756", "text": "def configure(options={})\n configure_by_hash(options) unless options.empty?\n yield self if block_given?\n self\n end", "title": "" }, { "docid": "b3d7daf28d47f81b5434c55fa25dc1c7", "score": "0.5913682", "text": "def with_default_options(options)\n config = RSpec.configuration\n\n {\n cookbook_root: config.cookbook_root || calling_cookbook_root(options, caller),\n cookbook_path: config.cookbook_path || calling_cookbook_path(options, caller),\n role_path: config.role_path || default_role_path,\n environment_path: config.environment_path || default_environment_path,\n file_cache_path: config.file_cache_path,\n log_level: config.log_level,\n path: config.path,\n platform: config.platform,\n version: config.version,\n }.merge(options)\n end", "title": "" }, { "docid": "5d08027790abc6a7fe1a73328695be59", "score": "0.5901551", "text": "def default_options\n return @default_options if instance_variable_defined?(:@default_options) && @default_options\n existing = superclass.respond_to?(:default_options) ? superclass.default_options : {}\n @default_options = OmniHooks::Strategy::Options.new(existing)\n end", "title": "" }, { "docid": "b6495fbe9c71b38bf82f2afe1f95a788", "score": "0.58964145", "text": "def register_strategy(config_name, klass)\n strategies[config_name.to_sym] = klass\n end", "title": "" }, { "docid": "2010f172513c446c493ee6b71ce492b7", "score": "0.5876799", "text": "def config\n @_config ||= ActiveSupport::InheritableOptions.new(self.class.config)\n end", "title": "" }, { "docid": "ec2338e06745664bfc0a987f91da46f6", "score": "0.5864858", "text": "def strategy\n @strategy ||= @strategy_klass.new(self)\n end", "title": "" }, { "docid": "44fe5b136b8d5f70b500ec1f9a873a2d", "score": "0.5861846", "text": "def configure(conf)\n super\n @conf = conf\n # TO DO Add code to choke if config parameters are not there\n end", "title": "" }, { "docid": "405c16d81857730f68025c78ab17fbe5", "score": "0.5857087", "text": "def configure(options={})\n Configuration.configure(options)\n end", "title": "" }, { "docid": "9876c9819fd9d3cc4be7328b9991a5d8", "score": "0.58302504", "text": "def configure(options)\n @options = options\n end", "title": "" }, { "docid": "c1f17b4c0bfebbcf0f4e3989650b5d15", "score": "0.5830034", "text": "def override(name, base = DEFAULT_CONFIG, &block)\n unless get(base)\n raise NotYetConfiguredError, \"#{base} policy not yet supplied\"\n end\n override = @configurations[base].dup\n override.instance_eval(&block) if block_given?\n add_configuration(name, override)\n end", "title": "" }, { "docid": "f9c897e043f70bdafac5e5df4abf5c0e", "score": "0.58286744", "text": "def with options = {}\n overridden = @overridden + options.keys.map { |k| k.to_sym }\n self.class.new(@options.merge(options).\n merge(:__create_options__ => @create_options,\n :__overridden__ => overridden))\n end", "title": "" }, { "docid": "d17eefee2781aec0bcc56faabf3cebd4", "score": "0.5823517", "text": "def configure(base, instance)\n return @config unless @config.respond_to?(:call)\n\n recursive = self < AuxiliaryStatement::Recursive\n settings = Settings.new(base, instance, recursive)\n settings.instance_exec(settings, &@config)\n settings\n end", "title": "" }, { "docid": "1606970308417c6713be15840cb6b698", "score": "0.58105725", "text": "def configure(slot, value=None)\n if slot.kind_of? Hash\n slot.each{|slot,value| configure slot, value}\n return self\n end\n\n slot = slot.to_s\n\n if @option_methods.include?(slot)\n unless @option_methods[slot][:cget]\n if value.kind_of?(Symbol)\n @option_setting[slot] = value.to_s\n else\n @option_setting[slot] = value\n end\n end\n return self.__send__(@option_methods[slot][:set], value)\n end\n\n tbl = @delegates[slot]\n tbl = @delegates['DEFAULT'] unless tbl\n\n begin\n if tbl\n last = nil\n tbl.each{|opt, wins|\n opt = slot if opt == 'DEFAULT'\n wins.each{|w| last = w.configure(opt, value)}\n }\n return last\n end\n rescue\n end\n\n super(slot, value)\n end", "title": "" }, { "docid": "0267b952391a52d7890815d2a7900f48", "score": "0.5802929", "text": "def method_missing(sym,*args,&block)\n if self.class.options.has_key? sym\n if args.length == 1\n instance_options[sym] = args[0]\n end\n options[sym]\n else\n super\n end\n end", "title": "" }, { "docid": "0b18d6b98256caf3384336294a5693c4", "score": "0.58019346", "text": "def configure\n raise NotImplementedError.new(\"You must implement configure.\")\n end", "title": "" }, { "docid": "8a464de1f10c5b1f7c080d36112da49e", "score": "0.57987374", "text": "def configure()\n raise NotImplementedException, \"Subclasses need to implement 'configure' for themselves.\", caller()\n end", "title": "" }, { "docid": "a8691bde7de2eda0a2274f5c2449a7c0", "score": "0.578804", "text": "def configure(options = {}, &block)\n @singleton ||= new(options, &block)\n self\n end", "title": "" }, { "docid": "6abf9250d1cbad35da6df1bfad827ed7", "score": "0.5782313", "text": "def use(strategy)\n tap do |mergeable|\n mergeable.strategy = strategy\n end\n end", "title": "" }, { "docid": "0809bb8698981ef6e89a918667e56af9", "score": "0.57775843", "text": "def use(strategy)\n tap do |mergeable|\n mergeable.strategy = strategy\n end\n end", "title": "" }, { "docid": "de1e4f1890cbff91ead4bc7f556b5d2f", "score": "0.5771404", "text": "def option(name, options = {})\n defaults[name] = settings[name] = options[:default]\n\n class_eval <<-RUBY\n def #{name}\n settings[#{name.inspect}]\n end\n\n def #{name}=(value)\n settings[#{name.inspect}] = value\n end\n\n def #{name}?\n #{name}\n end\n RUBY\n end", "title": "" }, { "docid": "eefb341d32eafc9cf0596359d1f6b5dd", "score": "0.5769453", "text": "def defaults_and_options options\n super\n end", "title": "" }, { "docid": "dc848b17852690a9c66a2bc237869c99", "score": "0.57617885", "text": "def strategies; end", "title": "" }, { "docid": "2783ba2b616f43620271c5b2dddb81f1", "score": "0.5754994", "text": "def strategy\n @strategy || ->(h) { new h }\n end", "title": "" }, { "docid": "d90fba6e1e7396a2f591ee49d2a7335b", "score": "0.57486004", "text": "def default(options = {})\n new do |transport|\n transport.headers default_headers\n\n # Configure adapter & API\n if options[:site] && options[:api_key]\n configure_for_agentless(transport, options)\n else\n configure_for_agent(transport, options)\n end\n\n # Additional options\n unless options.empty?\n # Change default API\n transport.default_api = options[:api_version] if options.key?(:api_version)\n\n # Add headers\n transport.headers options[:headers] if options.key?(:headers)\n\n # Execute on_build callback\n options[:on_build].call(transport) if options[:on_build].is_a?(Proc)\n end\n\n # Call block to apply any customization, if provided.\n yield(transport) if block_given?\n end\n end", "title": "" }, { "docid": "13b3918dc136def70dad33cf4676fa53", "score": "0.5713419", "text": "def strategy( strategy = nil )\n if strategy \n self.strategy=( strategy ) \n else\n @strategy_instance ||= setup_strategy( @strategy || :calltime )\n end\n end", "title": "" }, { "docid": "8e1b4133f938a1154c5295aaf19913d0", "score": "0.5712452", "text": "def configure(matcher = :default, options = {}, &block)\n config = if matcher == :default\n default_configuration_instance\n else\n # Get or add the configuration\n resolver.get(matcher) || resolver.add(matcher, default_configuration)\n end\n\n # Apply the settings\n config.configure(options, &block)\n config\n end", "title": "" }, { "docid": "edb2f5e3f93b2b41ab729053e2c9c1d8", "score": "0.5708632", "text": "def new_route_config_options(options={}); route_config_options_class.new(options); end", "title": "" }, { "docid": "51e8096b94479898c601d48669760c68", "score": "0.57002276", "text": "def initialize(app, options={})\n default_strategies = options.delete(:default_strategies)\n\n @app, @config = app, Watchman::Config.new(options)\n @config.default_strategies(*default_strategies) if default_strategies\n yield @config if block_given?\n self\n end", "title": "" }, { "docid": "cd0e73ff3be86261f27a1adeac13db04", "score": "0.5688733", "text": "def configure_by_hash(options)\n DEFAULT_OPTIONS.keys.each do |k|\n send(\"#{k}=\", options[k])\n end\n end", "title": "" }, { "docid": "204ebb83c6c653f8e8dc21c6f46d9e9d", "score": "0.5686692", "text": "def configure(*args)\n infer_config(*args) unless args.empty?\n\n config.inflector = Inflector\n\n # Load adapters explicitly here to ensure their plugins are present already\n # while setup loads components and then triggers finalization\n setup.load_adapters\n\n # Register gateway components in case some custom configuration needs a gateway\n # already\n setup.register_gateways\n\n # TODO: this is tricky because if you want to tweak the config in the block\n # you end up doing `config.config.foo = \"bar\"` so it would be good\n # to yield configuration object + its config or rename this whole class\n # because it's a configuration *DSL* that builds up a config object too\n yield(self) if block_given?\n\n # No more changes allowed\n config.freeze\n\n self\n end", "title": "" }, { "docid": "ee0ebaaf0cbbbd79eb33d1c161e6596e", "score": "0.56864405", "text": "def setup(opts = {})\n opts.keys.each do |key|\n next if default_options.keys.include?(key)\n raise InvalidOptionError.new(\":#{key} is not a valid option for #{self.superclass.name}.\")\n end\n\n @default_options = default_options.merge(opts)\n end", "title": "" }, { "docid": "6fec0a5527de474fe7d63fc94978da35", "score": "0.56858045", "text": "def add_strategy(name, klass)\n strategy_sym = name.to_sym\n raise DuplicateStrategy, \":#{name} already defined, please use another name\" if strategies.key?(strategy_sym)\n\n new_strategies = strategies.dup.merge(strategy_sym => klass).freeze\n self.strategies = new_strategies\n end", "title": "" }, { "docid": "ec0841fe4a2e12dc3cbb48a84e0b3117", "score": "0.5683835", "text": "def configure(options=nil, &block)\n config_class = @provisioner.config_class\n return if !config_class\n\n @logger.debug(\"Configuring provisioner with: #{config_class}\")\n @config = config_class.new\n @config.set_options(options) if options\n block.call(@config) if block\n end", "title": "" }, { "docid": "871d6d9a075a3ff954a271c751525400", "score": "0.56700927", "text": "def initialize_config(overrides={})\n @config = ConfigHash.new(overrides).bind(self)\n end", "title": "" }, { "docid": "5ac723b2e4c64112f5ae53a64ad2110e", "score": "0.56606364", "text": "def configure\n load_defaults\n yield self\n true\n end", "title": "" }, { "docid": "bb5c77759eea040ea91b27e53d883805", "score": "0.5658426", "text": "def strategies\n self.class.strategies\n end", "title": "" }, { "docid": "73fa132af508faaa3910dd9481f1565f", "score": "0.5656256", "text": "def initialize(strategy = :none, *args)\n args << {} unless args.last.is_a?(Hash)\n @strategy = strategy\n case @strategy\n when :oauth\n raise ArgumentError, \"The :oauth strategy requires two or four arguments - consumer_key, consumer_secret, access_key and access_secret.\" unless [3,5].include?(args.size)\n if args.size == 5\n @consumer_key, @consumer_secret, @access_key, @access_secret, @options = *args\n else\n @consumer_key, @consumer_secret, @options = *args\n end\n when :basic\n raise ArgumentError, \"The :basic strategy requires two arguments - screen_name and password.\" unless args.size == 3\n @screen_name, @password, @options = *args\n when :none\n raise ArgumentError, \"The :none strategy does not take any mandatory arguments, only options.\" unless args.size == 1\n @options = *args\n else\n raise ArgumentError, \"Valid strategies are :oauth, :basic and :none.\"\n end\n\n @options = TwitterDispatch::Dispatcher.default_options.merge(@options)\n end", "title": "" }, { "docid": "507023a5082d16685b0c8095540ed8ea", "score": "0.56554884", "text": "def with_options(opts)\n __new__(options.merge(opts))\n end", "title": "" }, { "docid": "197b3be76de98da84bc9b7007134329f", "score": "0.56474584", "text": "def initialize processor = nil, options = {}\n super processor\n\n @options = DEFAULT_OPTIONS.merge options\n end", "title": "" }, { "docid": "ebf082d9afb3a191c8231ff5a1fa1654", "score": "0.5639454", "text": "def configure &block\n yield @defaults\n end", "title": "" }, { "docid": "5280da5a2d43d7fcd7ddba45693f9f3f", "score": "0.56384975", "text": "def initialize(args = nil)\n configure args if args\n end", "title": "" }, { "docid": "6fdf0393dea048242391b83c45838596", "score": "0.5638077", "text": "def nestable(options = {})\n nestable_options.merge!(options)\n nestable_options[:strategy] = case nestable_options[:strategy]\n when String then nestable_options[:strategy].constantize\n when Symbol then Strategy.const_get(nestable_options[:strategy].to_s.classify)\n else nestable_options[:strategy]\n end\n implement Interface and include nestable_options[:strategy]\n end", "title": "" }, { "docid": "ef8a6ce4c62b2b88399eebe8cff79828", "score": "0.5637891", "text": "def initialize(*args)\n @options = {}\n @config = {}\n @default_config = {}\n @opt_parser = nil\n\n # Set the banner\n @banner = self.class.banner\n\n # Dupe the class options for this instance\n klass_options = self.class.options\n klass_options.keys.inject(@options) { |memo, key| memo[key] = klass_options[key].dup; memo }\n\n # If use_separate_defaults? is on, default values go in @default_config\n defaults_container = if self.class.use_separate_defaults?\n @default_config\n else\n @config\n end\n\n # Set the default configuration values for this instance\n @options.each do |config_key, config_opts|\n config_opts[:on] ||= :on\n config_opts[:boolean] ||= false\n config_opts[:required] ||= false\n config_opts[:proc] ||= nil\n config_opts[:show_options] ||= false\n config_opts[:exit] ||= nil\n config_opts[:in] ||= nil\n if config_opts.key?(:default)\n defaults_container[config_key] = config_opts[:default]\n end\n end\n\n super(*args)\n end", "title": "" }, { "docid": "296d45345ae355622b37f11f285eb881", "score": "0.5636582", "text": "def default_for_option(config, name, options, default); end", "title": "" }, { "docid": "8bc37d4025d21b91843360faeabe66b2", "score": "0.56347114", "text": "def initialize_with_config *args\n initialize_without_config *args\n configure!\n end", "title": "" }, { "docid": "d1e664d0e8de7273b606e8723755c804", "score": "0.56339914", "text": "def configure opts = {}\n opts.symbolize_keys!\n @options = Options.new opts\n @connection = Connection.new\n end", "title": "" }, { "docid": "d38575a105f59dbc5043d9e4836cd144", "score": "0.56324226", "text": "def configure(&block); end", "title": "" }, { "docid": "d38575a105f59dbc5043d9e4836cd144", "score": "0.56324226", "text": "def configure(&block); end", "title": "" }, { "docid": "d38575a105f59dbc5043d9e4836cd144", "score": "0.56324226", "text": "def configure(&block); end", "title": "" }, { "docid": "d38575a105f59dbc5043d9e4836cd144", "score": "0.56324226", "text": "def configure(&block); end", "title": "" }, { "docid": "b13dddb791036483676bf373b1d2e93b", "score": "0.5625798", "text": "def method_missing(name, *args, &block)\n case\n when self.config.include?(name.to_s)\n self.config[name.to_s]\n else\n begin\n self.send.__send__(name, *args, &block)\n rescue NoMethodError => e\n super(name, *args, &block)\n end\n end\n end", "title": "" }, { "docid": "525ab560d73b5785fab85275beaa5069", "score": "0.5619167", "text": "def default_options\n options[:class] ||= [:hint]\n options[:id] ||= \"#{object_name}_#{method}_hint\"\n end", "title": "" }, { "docid": "201d03d2c0b6ca3f6e34a7cffa58c8e1", "score": "0.5615777", "text": "def opt(*args, &block)\n self.opts.define(self, *args, &block)\n end", "title": "" }, { "docid": "4d32641d3695634cb77ba6f4e38e9eee", "score": "0.5609629", "text": "def configure; yield; end", "title": "" }, { "docid": "71641c5cfff25fbff20f0506b5f92e76", "score": "0.56042117", "text": "def inherited(klass)\n super\n klass.configuration_builder = ConfigurationBuilder.new\n end", "title": "" }, { "docid": "84c65ec339432d5ad76ee39e32319138", "score": "0.55947506", "text": "def with_options(opts)\n __new__(**options.merge(opts))\n end", "title": "" }, { "docid": "12b970250dd483e8ef3a953ea74a24b5", "score": "0.5587736", "text": "def configure\n config = @base_instance.configuration\n if block_given?\n yield config\n self\n else\n config\n end\n end", "title": "" }, { "docid": "17c4c3f598676d6b9e98ed5fcd3402ce", "score": "0.5586377", "text": "def configure!\n pre_configure\n instance_eval(&@configure_block) if @configure_block\n post_configure\n self\n end", "title": "" }, { "docid": "9a5b1c64d4e6258082524b652ce717f2", "score": "0.55855215", "text": "def initialize(*args)\n @options = Hash.new\n @config = Hash.new\n @default_config = Hash.new\n @opt_parser = nil\n\n # Set the banner\n @banner = self.class.banner\n\n # Dupe the class options for this instance\n klass_options = self.class.options\n klass_options.keys.inject(@options) { |memo, key| memo[key] = klass_options[key].dup; memo }\n\n # If use_separate_defaults? is on, default values go in @default_config\n defaults_container = if self.class.use_separate_defaults?\n @default_config\n else\n @config\n end\n\n # Set the default configuration values for this instance\n @options.each do |config_key, config_opts|\n config_opts[:on] ||= :on\n config_opts[:boolean] ||= false\n config_opts[:required] ||= false\n config_opts[:proc] ||= nil\n config_opts[:show_options] ||= false\n config_opts[:exit] ||= nil\n\n if config_opts.has_key?(:default)\n defaults_container[config_key] = config_opts[:default]\n end\n end\n\n super(*args)\n end", "title": "" }, { "docid": "b67f55f043daeb1a4ff9f25a8050a7e9", "score": "0.5577052", "text": "def blueprint(name, &block)\n @strategies[name.to_sym] = block\n self\n end", "title": "" }, { "docid": "9de3b527a6469fcfd7b57869fe3f78a4", "score": "0.557026", "text": "def initialize(options = {})\n @name = options.fetch(:name) { self.class.name.split(\"::\").last.downcase }\n @path = options.fetch(:path) { default_config_path }\n end", "title": "" }, { "docid": "1c2dbaf3bf1c1125e23c14f118cf5135", "score": "0.55660766", "text": "def strategy(name = nil, &block)\n Chewy.current[:chewy_strategy] ||= Chewy::Strategy.new\n if name\n if block\n Chewy.current[:chewy_strategy].wrap name, &block\n else\n Chewy.current[:chewy_strategy].push name\n end\n else\n Chewy.current[:chewy_strategy]\n end\n end", "title": "" }, { "docid": "2728bc067ebad27b416ae8942d300296", "score": "0.5565375", "text": "def default_configuration=(_arg0); end", "title": "" }, { "docid": "f99f7b3adfd9852f04f86d5eb0600b2b", "score": "0.55630696", "text": "def configure(conf)\n super\n # do the usual configuration here\n end", "title": "" }, { "docid": "f99f7b3adfd9852f04f86d5eb0600b2b", "score": "0.55630696", "text": "def configure(conf)\n super\n # do the usual configuration here\n end", "title": "" }, { "docid": "10822385aa32e315bb7e3ced21eef2c4", "score": "0.5562184", "text": "def runner_options(transport, state = {}, platform = nil, suite = nil)\n super(transport, state, platform, suite).tap do |options|\n self.class::ConfigureInspecRunnerBackend.call hostname: state.fetch(:hostname), options: options\n self.class::ConfigureInspecRunnerHost.call hostname: state.fetch(:hostname), options: options\n self.class::ConfigureInspecRunnerPort.call group: state.fetch(:group), options: options\n self\n .class::ConfigureInspecRunnerSSHKey\n .call(\n group: state.fetch(:group),\n options: options\n )\n self.class::ConfigureInspecRunnerUser.call group: state.fetch(:group), options: options\n self.class::ConfigureInspecRunnerAttributes\n .call(driver: driver, group: state.fetch(:group), terraform_state: driver[:state]).bind do |attributes|\n config.store :attributes, attributes\n end\n self.class::ConfigureInspecRunnerControls.call group: state.fetch(:group), options: options\n end\n end", "title": "" }, { "docid": "c7026a8cb98640b4081eef8a88033cab", "score": "0.55616295", "text": "def set_config(strategy, config)\n strategy.const_set(\"CONFIG\", config) unless strategy.const_defined?(\"CONFIG\")\n end", "title": "" }, { "docid": "1fad05eb962ef1af4ae408f1282df355", "score": "0.5560152", "text": "def setup_defaults\n # this can be overridden in the spec, but ec2 is the default\n using :ec2\n options[:keypair] ||= keypair rescue nil\n options[:rules] = {:expand => dsl_options[:expand_when], :contract => dsl_options[:contract_when]}\n dependency_resolver 'chef' \n # enable :haproxy unless dsl_options[:haproxy] == :disabled\n end", "title": "" }, { "docid": "6cd2ce90aa538c5fd3e115cb3d9793cb", "score": "0.55433816", "text": "def handle_options\n set_default_options()\n super\n end", "title": "" }, { "docid": "c4c9b2bdb83350915227a351a22ddf27", "score": "0.55383295", "text": "def initialize(strategy)\n @strategy = strategy\n end", "title": "" }, { "docid": "c4c9b2bdb83350915227a351a22ddf27", "score": "0.55383295", "text": "def initialize(strategy)\n @strategy = strategy\n end", "title": "" }, { "docid": "d0524c05893d5aadc6216085a4b2dfa9", "score": "0.5528659", "text": "def options\n super || {}\n end", "title": "" }, { "docid": "a5bd795baee4be9b12889013a9fe7878", "score": "0.55255955", "text": "def post_configure\n super\n end", "title": "" }, { "docid": "3fbdd66989c81040d80224f616c42213", "score": "0.5524008", "text": "def initialize(opts)\n @configuration = DEFAULT_OPTS.merge(opts)\n end", "title": "" }, { "docid": "248c7c901b7d66868096b9c2ed974136", "score": "0.5522428", "text": "def set_strategy(strategy)\n @strategy = strategy\n end", "title": "" }, { "docid": "0ee7aff0c54434563fd6f02da4076482", "score": "0.5519392", "text": "def initialize(options = {}, &block)\n @__methods__ = options.fetch(:methods) { ::Hash.new }\n @__not_configured__ = options.fetch(:not_configured) { ::Hash.new }\n\n @data = __configuration_hash__\n\n __instance_eval__(&options[:defaults]) if options[:defaults]\n __instance_eval__(&block) if block\n\n __install_configuration_methods__\n end", "title": "" }, { "docid": "e8691c4de9a42ce8a3f8e3d7b92d74cb", "score": "0.55158377", "text": "def add_cmd_line_options\n add_command_line_section('Configuration options') do |slop|\n slop.on 'config-file', 'Specify a config file.', :argument => true\n slop.on 'config-override', 'If specified override all other config.', :argument => false\n end\n end", "title": "" }, { "docid": "8f950609942da168d85c6a2a437d373e", "score": "0.5512397", "text": "def initialize(options={})\n Echowrap::Configurable.keys.each do |key|\n instance_variable_set(:\"@#{key}\", options[key] || Echowrap.instance_variable_get(:\"@#{key}\"))\n end\n end", "title": "" }, { "docid": "76a3dd19c2224f25e6beacd1909c09ff", "score": "0.55113816", "text": "def setup!(options)\n rubies_to_use = options[:rubies] || rubies\n options_to_use = options[:specific_options] || specific_options\n test_framework_to_use = options[:test_framework] || config.test_framework\n framework_to_use = options[:app_framework] || config.app_framework\n use_verbose = options[:verbose] || config.verbose\n config.use(\n :rubies => rubies_to_use,\n :specific_options => options_to_use,\n :test_framework => test_framework_to_use,\n :app_framework => framework_to_use,\n :cucumber => options[:cucumber],\n :verbose => use_verbose)\n config.skip_bundler! if options[:skip_bundler?]\n add_heuristics!\n heuristics_users_high_priority!\n end", "title": "" }, { "docid": "2503d299f7667b394eefa979858c735f", "score": "0.55061895", "text": "def default_connection_options=(options); end", "title": "" }, { "docid": "d9b593f8bb20ee6844462850787e5ee7", "score": "0.55023324", "text": "def initialize(opts={})\n @opts = {}\n @undefaulted_opts = {}\n if opts != false\n if (!opts[:without_defaults]) \n @opts.merge! DEFAULT_OPTIONS\n @opts.merge! DEFAULT_BROWSERS\n @opts.merge!({:application_port => Sauce::Config.get_application_port})\n\n @undefaulted_opts.merge! load_options_from_yaml\n @undefaulted_opts.merge! load_options_from_environment\n @undefaulted_opts.merge! load_options_from_heroku unless ENV[\"SAUCE_DISABLE_HEROKU_CONFIG\"]\n \n global_config = Sauce.get_config\n @undefaulted_opts.merge! global_config.opts if global_config.opts\n @whitelisted_capabilities = global_config.whitelisted_capabilities\n end\n\n @undefaulted_opts.merge! opts\n @opts.merge! @undefaulted_opts\n end\n end", "title": "" }, { "docid": "3896ae593ad9c1103b453f310f5faf5c", "score": "0.5493496", "text": "def strategy=(strategy)\n @strategy = strategy\n end", "title": "" }, { "docid": "e2794769d4933b4a1258b6278f801aab", "score": "0.5484935", "text": "def configure(conf)\n super\n end", "title": "" } ]
3743c3de29db9e5aa344b8bbffdf2877
The nutricional indicator of an Aliment is described by a number from 0 to 3 which means that the food has a Low nutricional impact if this item is within 0 and 1; it has a Regular impact if it's within 1 and 2 or an High impact if it's withing 2 and 3.
[ { "docid": "9bdbad24baf5e8a9e1ae14cf41c57273", "score": "0.7137873", "text": "def nutricional_indicator()\n\t\t\t\t(indicator_energia() + indicator_carbono())/2\n\t\t\tend", "title": "" } ]
[ { "docid": "d5d94bc2159130fedb5d95d9fe5ea829", "score": "0.65989566", "text": "def huella_nutricional\n ((get_impacto_energia + get_impacto_gei)/2).ceil(2)\n end", "title": "" }, { "docid": "c2e702c90d6a2ab81afd483bb46cbff5", "score": "0.6366289", "text": "def huella_nutricional\n\t\tif( (indice_impacto == 1) && (vct < 670) && (suma_gramos < 800))\n\t\t\thuella_nutricional = 'Bajo'\n\t\telsif( (indice_impacto == 2) && ((vct > 670) || (vct < 830)) && ((suma_gramos > 800) || (suma_gramos < 1200)))\n\t\t\thuella_nutricional = 'Regular'\n\t\telsif( ( indice_impacto == 3) && (vct > 830 ) && (suma_gramos > 1200))\n\t\t\thuella_nutricional = 'Alta'\n\t\tend\n\t\t\treturn huella_nutricional\n\t\tend", "title": "" }, { "docid": "4d1ebe8132bfcd56726d45f8fc4fe71e", "score": "0.636438", "text": "def huella_nutricional\n numero1 = self.calculo_valor_calorico_total\n numero2 = self.calculo_emisiones_diarias\n\n if numero1 < 670\n ienergia = 1\n elsif numero1 <=830\n ienergia = 2\n else\n ienergia = 3\n end\n\n if numero2 < 800\n icarbono = 1\n elsif numero2 <= 1200\n icarbono = 2\n else\n icarbono = 3\n end\n\n media = (ienergia + icarbono)/2\n end", "title": "" }, { "docid": "b8f9549757b78f6fc5a32b38b664fff3", "score": "0.60678375", "text": "def indicator_energia()\n\t\t\t\te = totalCaloricValue() / @alimentsList.length\n\n\t\t\t\tif e < 670\n\t\t\t\t\treturn 1.0\n\t\t\t\telsif e <= 830\n\t\t\t\t\treturn 2.0\n\t\t\t\telse\n\t\t\t\t\treturn 3.0\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "e97480881983d997fb35d050b3f36b4a", "score": "0.60488254", "text": "def defense_bonus(lv)\n (80 * 3 * lv.to_f / 2 + 250) / 100 + 5\n end", "title": "" }, { "docid": "ff54ea10a37ccff84ab52b0c38812a3c", "score": "0.5838796", "text": "def flour_quantity\n weight / (1 + percentages_except_flour) * pizzas\n end", "title": "" }, { "docid": "1bc8a3282af34f2de2bdcef4118e81b9", "score": "0.5831644", "text": "def huella_nutricional\n (valor_calorico() + huella_carbono()) / 2\n end", "title": "" }, { "docid": "9dd3073f6ddae2c84b2a3b2a9ae7b2eb", "score": "0.57525814", "text": "def natural_bonus\n 0\n end", "title": "" }, { "docid": "9041c22352fbd5122f75e9587ec9cb9b", "score": "0.5727978", "text": "def spirit_defense\n defense_bonus = calc_spirit_defense\n defense_bonus > 0 ? (defense_bonus * spi).to_i : 0\n end", "title": "" }, { "docid": "e497a2b28f8b2555d88aa630f8ed3735", "score": "0.57244676", "text": "def attack_roll(item)\r\r\n \r\r\n bonus = (item.magical? || item.speed > 60) ? 4 : 0\r\r\n \r\r\n if item.physical?\r\r\n if item.is_missile\r\r\n return self.difficulty_class('dex',-10,false) + bonus\r\r\n else\r\r\n return self.difficulty_class('str',-10,false) + bonus\r\r\n end\r\r\n elsif item.magical?\r\r\n return self.difficulty_class('int',-8,false) + bonus\r\r\n end\r\r\n \r\r\n return 20\r\r\n end", "title": "" }, { "docid": "8d9ecf066a94611d5eea0cef81490925", "score": "0.56723464", "text": "def attack_bonus(lv)\n (110 * 3 * lv.to_f + 250) / 100 + 5\n end", "title": "" }, { "docid": "94626ae15015df6f3cb35ba177d02814", "score": "0.56673545", "text": "def indicator_carbono()\n\t\t\t\tc = totalGei() / @alimentsList.length\n\t\t\t\t# c is the avg grams of co2 per plate\n\n\t\t\t\tif c < 670\n\t\t\t\t\treturn 1.0\n\t\t\t\telsif c <= 830\n\t\t\t\t\treturn 2.0\n\t\t\t\telse\n\t\t\t\t\treturn 3.0\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "28b09a746c9cf073859468bc40a1113f", "score": "0.5654424", "text": "def inventory_for_longitudinal_presentation_unit_type_measurement\n inventories.map(& :quantity).inject(0) { |s,v| s += v } * packing_material.quantity\n end", "title": "" }, { "docid": "804254d7a1a74797f7f8af7dd5040775", "score": "0.56338245", "text": "def total_nutrientes\n\t\ti = 0\n\t\tproteinas = carbohidratos = lipidos = 0.0\n\t\twhile i < @lista_alimentos.size do\n\t\t\tproteinas += (@lista_alimentos[i].proteinas)*(@lista_cantidades[i])\n\t\t\tcarbohidratos += (@lista_alimentos[i].carbohidratos)*(@lista_cantidades[i])\n\t\t\tlipidos += (@lista_alimentos[i].lipidos)*(@lista_cantidades[i])\n\t\t i+= 1\n\t\tend\n\t\treturn proteinas + lipidos + carbohidratos\n\tend", "title": "" }, { "docid": "fb2f7009a320465ce2387108fc5b54e5", "score": "0.56273866", "text": "def huellaAmbiental\r\n indiceCarbono = 0.0\r\n if @geiTotal < 800.0\r\n indiceCarbono = 1.0\r\n elsif @geiTotal <= 1200.0\r\n indiceCarbono = 2.0\r\n else\r\n indiceCarbono = 3.0\r\n end\r\n\r\n indiceEnergia = 0.0\r\n if kcalPlato < 670.0\r\n calorias = 1.00\r\n elsif kcalPlato <= 830.0\r\n calorias = 2.0\r\n else\r\n calorias = 3.0\r\n end\r\n\r\n return (indiceCarbono + indiceEnergia)/2\r\n end", "title": "" }, { "docid": "964219ece76cfb5bbd8d5210da66678b", "score": "0.5609731", "text": "def huella_ambiental\r\n energia = 0.0\r\n carbono = 0.0\r\n huella = 0.0\r\n if vct < 670 then\r\n energia = 1.0\r\n elsif vct <= 830 then\r\n energia = 2.0\r\n else\r\n energia = 3.0\r\n end\r\n if gei < 800 then\r\n carbono = 1.0\r\n elsif terrenos <= 1200 then\r\n carbono = 2.0\r\n else\r\n carbono = 3.0\r\n end\r\n huella = (energia + carbono)/2\r\n return huella\r\n \r\n end", "title": "" }, { "docid": "97da5a55e086f6ac3683f4595ab2defe", "score": "0.5607615", "text": "def equivalent_level\n parsed_hd = parse_dice(self.class::HIT_DICE)\n \n if parsed_hd[-2] == '-'\n return 1\n else\n return parsed_hd.first + 1 + (parsed_hd.size > 3 ? 1 : 0)\n end\n end", "title": "" }, { "docid": "dae3ea351617f6451738020eea4bdb0c", "score": "0.5586082", "text": "def item_effect_effective_correction(effective, item)\r\n return effective |= item.hit < 100\r\n end", "title": "" }, { "docid": "f583b72d96d52771c7885d043ee6f717", "score": "0.55458623", "text": "def calc_real_thac0(item)\r\r\n thac0_bonus = item.thac0\r\r\n thac0_bonus = 20 if item.is_a?(RPG::Item)\r\r\n \r\r\n if self.actor?\r\r\n for equip in equips\r\r\n next if equip.nil?\r\r\n thac0_bonus += equip.thac0 rescue nil\r\r\n end\r\r\n end\r\r\n \r\r\n for skill in $data_notetagged_items\r\r\n next if skill.nil? || !skill.is_a?(RPG::Skill)\r\r\n next unless self.skills.include?(skill) && skill_equip_ready?(skill)\r\r\n \r\r\n bonus = skill.thac0 ? thac0 : 0 rescue nil\r\r\n bonus = 0 if bonus.nil?\r\r\n thac0_bonus += bonus\r\r\n end\r\r\n \r\r\n for state in self.states\r\r\n next if state.nil?\r\r\n \r\r\n bonus = state.thac0 ? state.thac0 : 0 rescue nil\r\r\n bonus = 0 if bonus.nil?\r\r\n thac0_bonus += bonus\r\r\n end\r\r\n \r\r\n return thac0_bonus\r\r\n end", "title": "" }, { "docid": "a23c193d52538b6bd428387f985fd9df", "score": "0.5520787", "text": "def rent_percept_for_renter\n rent_value = 0\n self.accessories.each{|accessory|\n rent_value += ((accessory.base + accessory.tarif)*( 1 + (accessory.tax/100) ))\n }\n return rent_value\n end", "title": "" }, { "docid": "42d9eeeb349d3e808c140b662a23333f", "score": "0.54916096", "text": "def getRarity(defindex = \"\")\n item = nil\n item = $itemh[\"items_game\"][\"items\"][defindex]\n if(!item.nil?)\n if(!item[\"item_rarity\"].nil?)\n return item[\"item_rarity\"].to_s\n else\n return \"common\"\n end\n else\n return \"common\"\n end\nend", "title": "" }, { "docid": "2df47cdd882d3cd33381a4b4f1c57ac1", "score": "0.547772", "text": "def find_meaning(lexical_item)\n \n end", "title": "" }, { "docid": "7aefe0de96e3ad338fd5b42f1b021842", "score": "0.541487", "text": "def og_prediction\n (1 + (0.035 * @efficiency * @grist_weight / @batch_volume)).round(3)\n end", "title": "" }, { "docid": "bf9beac4c8e72e848ceab7208555fdd8", "score": "0.5410122", "text": "def sky_diffuse_irradiance\n @diffuse_horizontal_irradiance * (anisotropy_index * geometric_factor + \n (1 - anisotropy_index) * ((BigDecimal('1') + bigdecimal_cos(degree_to_radian(@surface_tilt))) / BigDecimal('2')) * anisotropic_correction_factor)\n end", "title": "" }, { "docid": "99428d65c34be0fa441128ad6207cf14", "score": "0.53756905", "text": "def food_eaten\n max_vegetation = 1300 # max size of vegetation jungle 13\n max_food = max_health / 3.0\n\n field.vegetation.size * max_food / max_vegetation\n end", "title": "" }, { "docid": "e9bd982e18e8944b133748992fc60ca4", "score": "0.53722996", "text": "def total_magnesium\n food.magnesium * quantity\n end", "title": "" }, { "docid": "737c43c8e588802994abfb64a085a40a", "score": "0.53622127", "text": "def total_vitaminD\n food.vitaminD * quantity\n end", "title": "" }, { "docid": "bfe0b47751e4fc081316f58a7bd728ab", "score": "0.5346704", "text": "def item_effect(item)\n # Clear critical flag\n self.critical = false\n # If item scope is for ally with 1 or more HP, and your own HP = 0,\n # or item scope is for ally with 0 HP, and your own HP = 1 or more\n if ((item.scope == 3 or item.scope == 4) and self.hp == 0) or\n ((item.scope == 5 or item.scope == 6) and self.hp >= 1)\n # End Method\n return false\n end\n # Clear effective flag\n effective = false\n # Set effective flag if common ID is effective\n effective |= item.common_event_id > 0\n # Determine hit\n hit_result = (rand(100) < item.hit)\n # Set effective flag is skill is uncertain\n effective |= item.hit < 100\n # If hit occurs\n if hit_result == true\n # Calculate amount of recovery\n recover_hp = maxhp * item.recover_hp_rate / 100 + item.recover_hp\n recover_sp = maxsp * item.recover_sp_rate / 100 + item.recover_sp\n if recover_hp < 0\n recover_hp += self.pdef * item.pdef_f / 20\n recover_hp += self.mdef * item.mdef_f / 20\n recover_hp = [recover_hp, 0].min\n end\n # Element correction\n recover_hp *= elements_correct(item.element_set)\n recover_hp /= 100\n recover_sp *= elements_correct(item.element_set)\n recover_sp /= 100\n # Dispersion\n if item.variance > 0 and recover_hp.abs > 0\n amp = [recover_hp.abs * item.variance / 100, 1].max\n recover_hp += rand(amp+1) + rand(amp+1) - amp\n end\n if item.variance > 0 and recover_sp.abs > 0\n amp = [recover_sp.abs * item.variance / 100, 1].max\n recover_sp += rand(amp+1) + rand(amp+1) - amp\n end\n # If recovery code is negative\n if recover_hp < 0\n # Guard correction\n if self.guarding?\n recover_hp /= 2\n end\n end\n # Set damage value and reverse HP recovery amount\n self.damage = -recover_hp\n # HP and SP recovery\n last_hp = self.hp\n last_sp = self.sp\n self.hp += recover_hp\n self.sp += recover_sp\n effective |= self.hp != last_hp\n effective |= self.sp != last_sp\n # State change\n @state_changed = false\n effective |= states_plus(item.plus_state_set)\n effective |= states_minus(item.minus_state_set)\n # If parameter value increase is effective\n if item.parameter_type > 0 and item.parameter_points != 0\n # Branch by parameter\n case item.parameter_type\n when 1 # Max HP\n @maxhp_plus += item.parameter_points\n when 2 # Max SP\n @maxsp_plus += item.parameter_points\n when 3 # Strength\n @str_plus += item.parameter_points\n when 4 # Dexterity\n @dex_plus += item.parameter_points\n when 5 # Agility\n @agi_plus += item.parameter_points\n when 6 # Intelligence\n @int_plus += item.parameter_points\n end\n # Set to effective flag\n effective = true\n end\n # If HP recovery rate and recovery amount are 0\n if item.recover_hp_rate == 0 and item.recover_hp == 0\n # Set damage to empty string\n self.damage = \"\"\n # If SP recovery rate / recovery amount are 0, and parameter increase\n # value is ineffective.\n if item.recover_sp_rate == 0 and item.recover_sp == 0 and\n (item.parameter_type == 0 or item.parameter_points == 0)\n # If state is unchanged\n unless @state_changed\n # Set damage to \"Miss\"\n self.damage = \"Miss\"\n end\n end\n end\n # If miss occurs\n else\n # Set damage to \"Miss\"\n self.damage = \"Miss\"\n end\n # If not in battle\n unless $game_temp.in_battle\n # Set damage to nil\n self.damage = nil\n end\n # End Method\n return effective\n end", "title": "" }, { "docid": "6770e613feb5397acce61b19504af817", "score": "0.5334787", "text": "def get_tip\n (meal * tip) / 100\n end", "title": "" }, { "docid": "8223b05db7b4ba181cc8767627886bfd", "score": "0.5327451", "text": "def lipidos\n food = @ingredientes.head\n lipidos = 0.0\n while food != nil do\n lipidos += food[:value].lipidos * (food[:value].gramos / 1000.0)\n food = food[:next]\n end\n lipidos * (100.0 / @total_nutricional)\n end", "title": "" }, { "docid": "22c6669d5d3ce1b2cf6798d85698474a", "score": "0.52872604", "text": "def rarity\r\n 6\r\n end", "title": "" }, { "docid": "5f8227823d7624bd8db138c264e7ddb3", "score": "0.528655", "text": "def skill_effect_effective_correction(effective, hit)\r\n return effective |= hit < 100\r\n end", "title": "" }, { "docid": "a4e42afdc222a2d03274344133db8631", "score": "0.5282423", "text": "def dodge_bonus\n 0\n end", "title": "" }, { "docid": "8a504aef220d381cbd5371ee765fbc9f", "score": "0.5278052", "text": "def shield_bonus\n 0\n end", "title": "" }, { "docid": "3f9c5ccad26546393e5b57e1a3c89da2", "score": "0.5274849", "text": "def tricipital \n\t\t(@tricipital[0] + @tricipital[1] + @tricipital[2])/3\n\tend", "title": "" }, { "docid": "1a5489510c04ba8199671a454f2c1f57", "score": "0.52598023", "text": "def invention_chance\n\tbase_chance = 0.0\n\tgid = self.item.groupID\n\ttid = self.item.typeID\n\tif gid == 27 || gid == 419 || tid == 22544\n\t\tbase_chance = 0.2\n\telsif gid == 26 || gid == 28 || tid == 22548\n\t\tbase_chance = 0.25\n\telsif gid == 25 || gid == 420 || gid == 513 || tid == 22546\n\t\tbase_chance = 0.3\n\telse\n\t\tbase_chance = 0.4\n\tend\n\n# TODO determine which datacores are needed and the skill level associated with that datacore\n# character = Character.find(char_id)\n# encryption_skill_level = character.skill_level(...)\n# datacore_1_skill_level = character.skill_level(...)\n# datacore_2_skill_level = character.skill_level(...)\n\tencryption_skill_level = 3\n\tdatacore_1_skill_level = 3\n\tdatacore_2_skill_level = 3\n\tmeta_level = 0\n\tdecryptor_modifier = 1.0\n\tbase_chance * (1.0 + (0.01 * encryption_skill_level)) * (1.0 + ((datacore_1_skill_level + datacore_2_skill_level) * (0.1 / (5.0 - meta_level)))) * decryptor_modifier\nend", "title": "" }, { "docid": "4e55850f09ffa3e303300cf0f32f7fa9", "score": "0.5253729", "text": "def item_effect_dispersion(recover_hp, recover_sp, item)\r\n if item.variance > 0 and recover_hp.abs > 0\r\n amp = [recover_hp.abs * item.variance / 100, 1].max\r\n recover_hp += rand(amp+1) + rand(amp+1) - amp\r\n end\r\n if item.variance > 0 and recover_sp.abs > 0\r\n amp = [recover_sp.abs * item.variance / 100, 1].max\r\n recover_sp += rand(amp+1) + rand(amp+1) - amp\r\n end\r\n return recover_hp, recover_sp\r\n end", "title": "" }, { "docid": "c2c194173f34121c3abbd8a116544f7f", "score": "0.5250321", "text": "def defense\n total_for(:defense)\n end", "title": "" }, { "docid": "ee727fae1366dd31f1e3af5cbc06b434", "score": "0.5246805", "text": "def behavior_hungry\n @world.food.each do |food|\n if distance_from_point(food.position) < (food.quantity + ROID_SIZE*5)\n @delta -= self.position - food.position\n end \n if distance_from_point(food.position) <= food.quantity + 5\n eat food\n end \n end \n end", "title": "" }, { "docid": "ec2ba1cca83b147248795e32c0d01476", "score": "0.5237471", "text": "def item_effect(item)\r\n # Item Effect Setup\r\n item_effect_setup\r\n # Return False If Out of Scope\r\n return false if item_effect_scope(item)\r\n # Setup Effective\r\n effective = item_effect_effective_setup(item)\r\n # First hit detection\r\n hit_result = item_effect_hit_result(item)\r\n # Set effective flag if skill is uncertain\r\n effective = item_effect_effective_correction(effective, item)\r\n # If hit occurs\r\n if hit_result\r\n # Calculate amount of recovery\r\n recover_hp, recover_sp = item_effect_recovery(item)\r\n # Element correction\r\n recover_hp, recover_sp = item_effect_element_correction(recover_hp, \r\n recover_sp, item)\r\n # If recovery code is negative\r\n if recover_hp < 0\r\n # Guard correction\r\n recover_hp = item_effect_guard_correction(recover_hp)\r\n end\r\n # Dispersion\r\n recover_hp, recover_sp = item_effect_dispersion(recover_hp, \r\n recover_sp, item)\r\n # Damage & Recovery\r\n effective = item_effect_damage(recover_hp, recover_sp, effective)\r\n # State change\r\n @state_changed = false\r\n effective |= states_plus(item.plus_state_set)\r\n effective |= states_minus(item.minus_state_set)\r\n # If parameter value increase is effective\r\n if item.parameter_type > 0 and item.parameter_points != 0\r\n # Item Effect Parameter Points\r\n item_effect_parameter_points(item)\r\n # Set to effective flag\r\n effective = true\r\n end\r\n # Item effect no recovery\r\n item_effect_no_recovery(item)\r\n # If miss occurs\r\n else\r\n # Item effect miss\r\n item_effect_miss\r\n end\r\n # Item effect damage fix\r\n item_effect_damagefix\r\n # End Method\r\n return effective\r\n end", "title": "" }, { "docid": "5c3b5f77c7de42a833213c5b8ce86b35", "score": "0.5233909", "text": "def fow_bonus(unit)\n return 0\n end", "title": "" }, { "docid": "d6fdc63ee7502eabc3c7f30e330f5f54", "score": "0.5229473", "text": "def volume_alcohol\n # hashing the 2 arrays, \"ratio\" & \"ingredient_volume_alcohol\"\n # into one 2-d array of hashes\n array_ratio = ratio.map { |ingredient_ratio| { ratio: ingredient_ratio } }\n array_volume_alcohol = ingredient_volume_alcohol\n .map do |ingredient_volume_alcohol|\n { volume_alcohol: ingredient_volume_alcohol }\n end\n hash_combined = hashing_value_from_2_arrays(\n array_ratio,\n array_volume_alcohol\n )\n\n # weighted average for the result\n # - the total of each ingredient's \"ratio * volume_alcohol\"\n numerator = hash_combined.reduce(0) do |accumulator, sub_hash|\n accumulator + sub_hash[:ratio].to_f * sub_hash[:volume_alcohol].to_f\n end\n\n # - the sum of all ingredient's ratio\n denominator = hash_combined.reduce(0) do |accumulator, sub_hash|\n accumulator + sub_hash[:ratio].to_f\n end\n\n (numerator / denominator).round(2)\n end", "title": "" }, { "docid": "e6b5ecff637e368a5ec355b8fbba37de", "score": "0.522869", "text": "def proficiency_bonus\n\t\t(level()+3)/4 + 1\n\tend", "title": "" }, { "docid": "a5453761125333c1565d79d79a34f210", "score": "0.5220655", "text": "def imc\n\t\tnum = (@peso/(@talla*@talla)).round(2)\n\t\tif num < 18.5\n\t\t\tnum #- Bajo peso\"\n\t\telsif num > 18.5 and num < 24.9\n\t\t\tnum #- Adecuado\"\n\t\telsif num > 25.0 and num < 29.9\n\t\t\tnum #- Sobrepeso\"\n\t\telsif num > 30.0 and num < 34.9\n\t\t\tnum #Obesidad grado 1\"\n\t\telsif num > 35.0 and num < 39.9\n\t\t\tnum #- Obesidad grado 2\"\n\t\telsif num > 40\n\t\t\tnum #- Obesidad grado 2\"\n\t\tend\t\t\t\n\tend", "title": "" }, { "docid": "b8adfddd8a58ace8441688ac4eccc251", "score": "0.52158076", "text": "def total_iron\n food.iron * quantity\n end", "title": "" }, { "docid": "f13aaf7ecc20d5bf3c6e7022855f4756", "score": "0.5214564", "text": "def eat(food)\n if food.veggie? && !@carnivore\n @hunger -= 10\n elsif food.meat? && @carnivore\n @hunger -= 10\n end\n @hunger = 0 if @hunger < 0\n end", "title": "" }, { "docid": "020a2311c91591968601707befee664a", "score": "0.5210432", "text": "def nature(level)\n data = @data['families'].find { |type| type['name'] == 'Nature' }\n badge = data['earnedAchievements'].find { |le| le['familyOrder'] == (level - 1) }\n HQTrivia::Badge.new(badge)\n end", "title": "" }, { "docid": "79f423b40e112f943196d33008ae83a4", "score": "0.52055", "text": "def huella_nutricional_plato\n\n\t\tenergia_plato = valor_calorico_total\n\n\t\tii_energia_plato = 0\n\t\trange_energia = [670,830]\n\n\t\tif energia_plato <= range_energia.first\n\t\t\tii_energia_plato = 1\n\t\telsif energia_plato > range_energia.first && energia_plato <= range_energia.last\n\t\t\tii_energia_plato = 2\n\t\telsif energia_plato > range_energia.last\n\t\t\tii_energia_plato = 3\n\t\tend\n\n\t\tgei_plato = emisiones_gei\n\n\t\tii_gei_plato = 0\n\n\t\trange_gei = [800,1200]\n\n\t\tif gei_plato <= range_gei.first\n\t\t\tii_gei_plato = 1\n\t\telsif gei_plato > range_gei.first && gei_plato <= range_gei.last\n\t\t\tii_gei_plato = 2\n\t\telsif gei_plato > range_gei.last\n\t\t\tii_gei_plato = 3\n\t\tend\n\t\t\t\n\t\thn_plato = ((ii_gei_plato + ii_energia_plato) / 2).round\n\n\tend", "title": "" }, { "docid": "2b945751038a4d489aafa9dede644784", "score": "0.5189259", "text": "def effective_level\n level + level_bonus\n end", "title": "" }, { "docid": "a0485cf6ba82444539e61437bb8ebc2e", "score": "0.51737684", "text": "def deflection_bonus\n 0\n end", "title": "" }, { "docid": "f6f3c243105e66316a5ac1ad3549e3b9", "score": "0.5154371", "text": "def item_bonus\n features_sum(:item_bonus)\n end", "title": "" }, { "docid": "1b7050403a0ab379d6ed95131faac6b0", "score": "0.5151413", "text": "def calc_spirit_defense\n features_sum(:spirit_defense)\n end", "title": "" }, { "docid": "11b92f9415860d016530f12c832c2614", "score": "0.5144431", "text": "def item_effect_scope(item)\r\n return (((item.scope == 3 or item.scope == 4) and self.hp == 0) or\r\n ((item.scope == 5 or item.scope == 6) and self.hp >= 1))\r\n end", "title": "" }, { "docid": "d0ee6dd0a2a634d613def18afe751ddd", "score": "0.5144092", "text": "def total_sodium\n food.sodium * quantity\n end", "title": "" }, { "docid": "8b63cd2467bd22e3af0bb31a216df6f0", "score": "0.512919", "text": "def meal\n\t'Evening'\nend", "title": "" }, { "docid": "96545ce3950af93ad8c9114dffabd2af", "score": "0.51269287", "text": "def special_skill(launcher, target, skill)\n case skill.symbol\n when :s_counter #Riposte & co\n if skill.id == 64 and (count = target.skill_category_amount(1)) > 0\n @IA_Info[:other_factor] = rand * 0.6 + count * 0.1\n elsif skill.id == 243 and (count = target.skill_category_amount(2)) > 0\n @IA_Info[:other_factor] = rand * 0.6 + count * 0.1\n else\n @IA_Info[:other_factor] = rand * 0.7\n end\n else\n return false\n end\n return true\n end", "title": "" }, { "docid": "dc61fb99ef3ad6407ec5c29df720abdd", "score": "0.51134014", "text": "def food_consumption\n return residents.length * 2\n end", "title": "" }, { "docid": "019b97a3ad403d45509cc0c8c6d681c7", "score": "0.51126295", "text": "def level; self['Amplifier'] end", "title": "" }, { "docid": "c9f3b2685264640b98f419ace53e4939", "score": "0.5110102", "text": "def artificial?\n @attributes[\"artificial\"] ? @attributes[\"artificial\"] == \"1\" : false\n end", "title": "" }, { "docid": "d1c7a2585694ebf228c78c792f0e7200", "score": "0.51092404", "text": "def item_effect_miss\r\n self.damage = 'Miss'\r\n end", "title": "" }, { "docid": "a08e2705fc8ad7b60c3dfd96099c1161", "score": "0.51030594", "text": "def inventory_for_superficie_presentation_unit_type_measurement\n surface = packing_material.presentation_unit_type_measure.side_dimension_x * packing_material.presentation_unit_type_measure.side_dimension_y\n inventories.map(& :quantity).inject(0) { |s,v| s += v } * surface\n end", "title": "" }, { "docid": "ae5eb87a264af7cffed4c62ebf8469e9", "score": "0.5098157", "text": "def weaponInjury\n injury = self.weapon.injury\n if( self.weapon.type == :versatile && @shield.value == 0)\n injury += 2\n end\n injury\n end", "title": "" }, { "docid": "5a329873c7732b0c5536ca343d0927c5", "score": "0.5093868", "text": "def calculate_tip(amount, rating)\n amount = amount.to_i\n if rating == \"Terrible\"\n return (amount * 0).to_i\n elsif rating == \"Poor\"\n return (amount * 0.05).to_i\n elsif rating == \"Good\"\n return (amount * 0.10).to_i\n elsif rating == \"Great\"\n return (amount * 0.15).to_i\n elsif rating == \"Excellent\"\n return (amount * 0.20).to_i\n else \n return \"rating not recognized.\"\n end \nend", "title": "" }, { "docid": "42732f1087b2ebe772971b549d0a2930", "score": "0.5090584", "text": "def bonus integer, boolean\n boolean == true ? (integer / 2.0) : 0\nend", "title": "" }, { "docid": "5fdb986ebaf7eeef5e743c8645608861", "score": "0.5088917", "text": "def can_train_peasant?\n gold >= 90 && food >= 5\n end", "title": "" }, { "docid": "5fdb986ebaf7eeef5e743c8645608861", "score": "0.5088917", "text": "def can_train_peasant?\n gold >= 90 && food >= 5\n end", "title": "" }, { "docid": "a61e7d92bd75b060605cb2d62058cb5c", "score": "0.508708", "text": "def slip_damage_effect\r\n # Set damage\r\n slip_damage_effect_base_damage\r\n # Dispersion\r\n slip_damage_effect_dispersion\r\n # Subtract damage from HP\r\n slip_damage_effect_damage\r\n # End Method\r\n return true\r\n end", "title": "" }, { "docid": "b85ad95b797cf0d044ba8f0625f114bc", "score": "0.50768703", "text": "def spirit_attack\n attack_bonus = calc_spirit_attack\n attack_bonus > 0 ? (attack_bonus * spi).to_i : 0\n end", "title": "" }, { "docid": "bbe1760be9d2506442871f698840a71a", "score": "0.50756496", "text": "def sci_fi_bonus\n\t \tif self.genres.include?(\"Sci-Fi\") || self.genres.include?(\"Fantasy\")\n\t \t\treturn 1.5\n\t \telse\n\t \t\treturn 0\n\t \tend\n end", "title": "" }, { "docid": "29a9a7794669bc03cd847f2e85ad1626", "score": "0.5071241", "text": "def virality\n 0\n end", "title": "" }, { "docid": "c894b2afe4d4796d37f79b92478ed875", "score": "0.5067836", "text": "def item_effect_recovery(item)\r\n recover_hp = maxhp * item.recover_hp_rate / 100 + item.recover_hp\r\n recover_sp = maxsp * item.recover_sp_rate / 100 + item.recover_sp\r\n if recover_hp < 0\r\n recover_hp += self.pdef * item.pdef_f / 20\r\n recover_hp += self.mdef * item.mdef_f / 20\r\n recover_hp = [recover_hp, 0].min\r\n end\r\n return recover_hp, recover_sp\r\n end", "title": "" }, { "docid": "831ac54bd0a7bb9032723816360cda85", "score": "0.506368", "text": "def score\n 3*@tally + 5*@strength + 2*@wealth + @food + 30*@monsters_killed\n end", "title": "" }, { "docid": "8706680b270b866424eb19f64ad44fc9", "score": "0.506366", "text": "def effect_desc(atk_mul, immune=false)\n # Check for wonderguard.\n if @modes.include?(:wonderguard) && atk_mul <= 1\n return \"#{BLACK}not effective#{RESET}\"\n end\n\n # Check for immunity abilities.\n return \"#{BLACK}not effective#{RESET}\" if immune\n\n case atk_mul\n when 0\n \"#{BLACK}not effective#{RESET}\"\n when 0.25\n \"#{PURPLE}hardly effective#{RESET}\"\n when 0.5\n \"#{DARKGREEN}not very effective#{RESET}\"\n when 1\n \"#{WHITE}normally effective#{RESET}\"\n when 2\n \"#{YELLOW}super effective#{RESET}\"\n when 4\n \"#{RED}ultra effective#{RESET}\"\n end\n end", "title": "" }, { "docid": "fba3203dc19232c9335df90c5654d97d", "score": "0.5055324", "text": "def number_of_calories\n self.ingredients.sum(\"calories\")\n end", "title": "" }, { "docid": "96886568b0ed36a04da1cddef00a9820", "score": "0.50527793", "text": "def stock_level()\n\n if @quantity >= 10\n return \"high\"\n elsif @quantity >= 5 && @quantity <= 9\n return \"medium\"\n elsif @quantity <= 4\n return \"low\"\n end\n end", "title": "" }, { "docid": "209f7de5029b2969468b517b9c47e716", "score": "0.504956", "text": "def attack_effect_dispersion\r\n if self.damage.abs > 0\r\n amp = [self.damage.abs * 15 / 100, 1].max\r\n self.damage += rand(amp+1) + rand(amp+1) - amp\r\n end\r\n end", "title": "" }, { "docid": "7f09d8d090291d2bbe481a6dab9a90fc", "score": "0.5047937", "text": "def total_saturated\n food.saturated * quantity\n end", "title": "" }, { "docid": "1200c69f770316d5474e3b0520922b02", "score": "0.50471485", "text": "def food_question3(food_answer3)\n if food_answer3 == \"none\"\n @food_score3 = 0\n elsif food_answer3 == \"1 meal\"\n @food_score3 = 1\n elsif food_answer3 == \"2+ meals\"\n @food_score3 = 2\n end\n @food_score3\nend", "title": "" }, { "docid": "5d4f04772f1d42dc5b0e3e8376178b0e", "score": "0.5046639", "text": "def skill_effect(user, skill)\n # Clear critical flag\n self.critical = false\n # If skill scope is for ally with 1 or more HP, and your own HP = 0,\n # or skill scope is for ally with 0, and your own HP = 1 or more\n if ((skill.scope == 3 or skill.scope == 4) and self.hp == 0) or\n ((skill.scope == 5 or skill.scope == 6) and self.hp >= 1)\n # End Method\n return false\n end\n # Clear effective flag\n effective = false\n # Set effective flag if common ID is effective\n effective |= skill.common_event_id > 0\n # First hit detection\n hit = skill.hit\n if skill.atk_f > 0\n hit *= user.hit / 100\n end\n hit_result = (rand(100) < hit)\n # Set effective flag if skill is uncertain\n effective |= hit < 100\n # Si Golpeas\n if hit_result == true\n if Wep::Atribute_mod_skills[skill.id] != nil\n # Extract and calculate effect\n # Calculate power\n ef = Wep::Atribute_mod_skills[skill.id][0] + user.atk * skill.atk_f / 100\n ef -= self.pdef * skill.pdef_f / 200\n ef -= self.mdef * skill.mdef_f / 200\n # Calculate rate\n ra = 20\n ra += (user.str * skill.str_f / 100)\n ra += (user.dex * skill.dex_f / 100)\n ra += (user.agi * skill.agi_f / 100)\n ra += (user.int * skill.int_f / 100)\n # Calculate total effect\n total_ef = ef * ra / 20\n # Apply dispersion\n if skill.variance > 0\n amp = [total_ef * skill.variance / 100, 1].max\n total_ef += rand(amp+1) + rand(amp+1) - amp\n end\n \n # Apply if exist\n case Wep::Atribute_mod_skills[skill.id][1]\n \n when 'maxhp':\n self.atr_mod_list.maxhp += total_ef\n when 'maxsp':\n self.atr_mod_list.maxsp += total_ef\n \n when 'str':\n self.atr_mod_list.str += total_ef\n when 'dex':\n self.atr_mod_list.dex += total_ef\n when 'int':\n self.atr_mod_list.int += total_ef\n when 'agi':\n self.atr_mod_list.agi += total_ef\n \n when 'atk':\n self.atr_mod_list.atk += total_ef\n when 'pdef':\n self.atr_mod_list.pdef += total_ef\n when 'mdef':\n self.atr_mod_list.mdef += total_ef\n when 'eva':\n self.atr_mod_list.eva += total_ef\n end\n end\n \n # Calculate power\n power = skill.power + user.atk * skill.atk_f / 100\n if power > 0\n power -= self.pdef * skill.pdef_f / 200\n power -= self.mdef * skill.mdef_f / 200\n power = [power, 0].max\n end\n # Calculate rate\n rate = 20\n rate += (user.str * skill.str_f / 100)\n rate += (user.dex * skill.dex_f / 100)\n rate += (user.agi * skill.agi_f / 100)\n rate += (user.int * skill.int_f / 100)\n # Calculate basic damage\n self.damage = power * rate / 20\n # Element correction\n self.damage *= elements_correct(skill.element_set)\n self.damage /= 100\n # If damage value is strictly positive\n if self.damage > 0\n # Guard correction\n if self.guarding?\n self.damage /= 2\n end\n end\n # Dispersion\n if skill.variance > 0 and self.damage.abs > 0\n amp = [self.damage.abs * skill.variance / 100, 1].max\n self.damage += rand(amp+1) + rand(amp+1) - amp\n end\n # Second hit detection\n eva = 8 * self.agi / user.dex + self.eva\n hit = self.damage < 0 ? 100 : 100 - eva * skill.eva_f / 100\n hit = self.cant_evade? ? 100 : hit\n hit_result = (rand(100) < hit)\n # Set effective flag if skill is uncertain\n effective |= hit < 100\n end\n # If hit occurs\n if hit_result == true\n # If physical attack has power other than 0\n if skill.power != 0 and skill.atk_f > 0\n # State Removed by Shock\n remove_states_shock\n # Set to effective flag\n effective = true\n end\n # Substract damage from HP\n last_hp = self.hp\n self.hp -= self.damage\n effective |= self.hp != last_hp\n # State change\n @state_changed = false\n if Wep::Skill_state_rates[skill.id] != nil\n state_add = []\n state_remove = []\n # Loop over state rates and check the posibiltys. Create a state list.\n for state_rate in Wep::Skill_state_rates[skill.id]\n if rand(100) < state_rate[1]\n state_add.push(state_rate[0])\n for s in state_rate[2]\n state_remove.push(s)\n end\n end\n end\n states_plus(state_add)\n states_minus(state_remove)\n #effective |= states_plus(state_add)\n #effective |= states_minus(state_remove)\n else\n states_plus(skill.plus_state_set)\n states_minus(skill.minus_state_set)\n #effective |= states_plus(skill.plus_state_set)\n #effective |= states_minus(skill.minus_state_set)\n end\n # If power is 0\n if skill.power == 0\n # No damage\n self.damage = \"\"\n # If state does not change\n unless @state_changed\n # Miss\n self.damage = \"Miss\"\n end\n end\n else\n # Miss\n self.damage = \"Miss\"\n end\n unless $game_temp.in_battle\n self.damage = nil\n end\n return effective\n end", "title": "" }, { "docid": "73644bcb3d2e61ffdae036ece6865c61", "score": "0.5038847", "text": "def total_cholesterol\n food.cholesterol * quantity\n end", "title": "" }, { "docid": "601e6c79d76f7a1478886cca11c2b1ad", "score": "0.5038278", "text": "def nutritionally(unaffirmed_excisor, undubbed_palindromic)\n hatful_radsimir(dumbfounder, kaka_propheticly)\n end", "title": "" }, { "docid": "857671f7719e1094947e1a18c085f5da", "score": "0.5026746", "text": "def total_sugars\n food.sugars * quantity\n end", "title": "" }, { "docid": "09634fee4e76d06ce7f68089c8834469", "score": "0.50242054", "text": "def effective_val(a, d)\n # Check whether the attacker is effective against the defender d\n if get_effective_against(a).include?(d.type)\n 2.0\n elsif get_effective_against(d).include?(a.type) || (a.type == d.type && a.type==KudomonTypes::PSYCHIC)\n 0.5\n else\n 1.0\n end\n end", "title": "" }, { "docid": "4f0a918a121725fbc67286fbc9dfc4bb", "score": "0.50160754", "text": "def item_effect_add_state_normal(user, item, effect)\n super(user, item, effect)\n $game_party.add_bestiary_data(@enemy_id, :sta, effect.data_id)\n end", "title": "" }, { "docid": "e7daa2188d4b90f030a30fbfdba0d45e", "score": "0.50140864", "text": "def haul\n @totalhaul = @silvercounter * SILVERVAL + @goldcounter * GOLDVAL\n @totalhaul\n end", "title": "" }, { "docid": "d84f210faa0292e28e9993bbd85454bf", "score": "0.50132775", "text": "def skill_effect_disperation(skill)\r\n if skill.variance > 0 and self.damage.abs > 0\r\n amp = [self.damage.abs * skill.variance / 100, 1].max\r\n self.damage += rand(amp+1) + rand(amp+1) - amp\r\n end\r\n end", "title": "" }, { "docid": "d5c47a71183747926f9be64b7ed1d942", "score": "0.50106275", "text": "def carbohidratos\n food = @ingredientes.head\n carbos = 0.0\n while food != nil do\n carbos += food[:value].carbohidratos * (food[:value].gramos / 1000.0)\n food = food[:next]\n end\n carbos * (100.0 / @total_nutricional)\n end", "title": "" }, { "docid": "d2f419c7dd83c8bf99c349edc05d2e04", "score": "0.5008884", "text": "def commensurably_nemathecium(contentional, arraignment_yeo)\n objectization_underpressure_beautifully()\n adolescent(government)\n end", "title": "" }, { "docid": "79916d1c1cb760064b6bf444b5129111", "score": "0.50072366", "text": "def cure\n puts\"Vous soignez votre animal \\n\"\n @mental +=30\n @health +=60\n return 3\n end", "title": "" }, { "docid": "fba4a366becda3fb6bf06b873cc96e64", "score": "0.5006858", "text": "def annualy_insurance\n return @capital * @insurance * -1\n end", "title": "" }, { "docid": "8cce077871fdcda80d0d1ee2847c9c0d", "score": "0.5005617", "text": "def sale_hotdogs(n)\n #your code here\n n < 5? 100 * n : n < 10? 95*n : 90*n\nend", "title": "" }, { "docid": "f8311c7aead0d98a655878979c7da1b1", "score": "0.5005036", "text": "def mood\n if self.happiness && self.nausea\n mood = self.happiness - self.nausea\n mood > 0 ? \"happy\" : \"sad\"\n end\nend", "title": "" }, { "docid": "2e9b9498ae3ec73151db6b38b679c357", "score": "0.49987912", "text": "def psh_bonuses(roll)\n case roll\n when 1..5\n @@skills << \"Brawling\"\n puts \"Brawling skill\"\n when 6..10\n @@skills << \"Stealth\"\n puts \"Stealth skill\"\n when 11..15\n @@skills << \"Weapons Expert\"\n puts \"Wpn expert!\"\n when 16..20\n @@skills << \"Dodge\"\n puts \"Dodge skill\"\n when 21..37\n @@endurance += 1\n @@strength += 1\n @@agility += 1\n @@accuracy += 1\n @@willpower += 1\n @@intelligence += 1\n @@perception += 1\n @@appearance += 1\n puts \"+1 to each attribute\"\n when 38..44\n @@endurance += (d(6) + d(6))\n puts \"+2d6 endurance\"\n when 45..51\n @@strength += (d(6) + d(6))\n puts \"+2d6 strength\"\n when 52..58\n @@agility += (d(6) + d(6))\n puts \"+2d6 agility\"\n when 59..65\n @@accuracy += (d(6) + d(6))\n puts \"+2d6 accuracy\"\n when 66..74\n @@intelligence += (d(6) + d(6) + d(6))\n puts \"+3d6 intelligence\"\n when 75..83\n @@willpower += (d(6) + d(6))\n puts \"+2d6 willpower\"\n when 84..90\n @@appearance += (d(6) + d(6) + d(6))\n puts \"+3d6 appearance\"\n when 91..97\n @@skills << \"Martial Arts\"\n puts \"Martial arts skill!\"\n when 98..99\n @@endurance += 2\n @@strength += 2\n @@agility += 2\n @@accuracy += 2\n @@willpower += 2\n @@intelligence += 2\n @@perception += 2\n @@appearance += 2\n puts \"+2 to each attribute\"\n when 100\n @@endurance += d(6)\n @@strength += d(6)\n @@agility += d(6)\n @@accuracy += d(6)\n @@willpower += d(6)\n @@intelligence += d(6)\n @@perception += d(6)\n @@appearance += d(6)\n puts \"JACKPOT -- +d6 to EACH Attribute!\"\n end\n\n end", "title": "" }, { "docid": "fcbeefbd58f5ab3f6e028cef3f218aaa", "score": "0.499716", "text": "def slip_damage_effect_dispersion\r\n # Dispersion\r\n if self.damage.abs > 0\r\n amp = [self.damage.abs * 15 / 100, 1].max\r\n self.damage += rand(amp+1) + rand(amp+1) - amp\r\n end\r\n end", "title": "" }, { "docid": "36a3906f03d69e1574c15f5511130e3f", "score": "0.49946627", "text": "def level_bonus\n (MAX_LEVEL - level) / MAX_LEVEL\n end", "title": "" }, { "docid": "5252118c5b55d3bb9dc7616aa34d4adc", "score": "0.49925864", "text": "def total_totalFat\n food.totalFat * quantity\n end", "title": "" }, { "docid": "db5170a8881d2a59a38b8cb13a888ca4", "score": "0.49884227", "text": "def stock_level()\n if @quantity >= 10\n return \"high\"\n elsif @quantity >= 5 && @quantity <= 9\n return \"medium\"\n elsif @quantity <= 4\n return \"low\"\n end\nend", "title": "" }, { "docid": "20adb53d90acc158d4aaecfbc2b3f1c7", "score": "0.4985683", "text": "def idme_loa\n attributes['level_of_assurance']&.to_i\n end", "title": "" }, { "docid": "4323ba126fc4947593f3c22548a2788f", "score": "0.49824202", "text": "def meal\n\treturn 'Breakfast'\n\t'Dinner'\nend", "title": "" }, { "docid": "f9a1a3e597324c30d7391c25050db073", "score": "0.49813282", "text": "def proteinas\n food = @ingredientes.head\n protein = 0.0\n while food != nil do\n protein += food[:value].proteinas * (food[:value].gramos / 1000.0)\n food = food[:next]\n end\n protein * (100.0 / @total_nutricional)\n end", "title": "" } ]
9b143d6627e6106e5432e4a4dabf30c8
GET /estoques/1 GET /estoques/1.xml
[ { "docid": "0e9ac458547eb9781803d5ff531c2a16", "score": "0.6875047", "text": "def show\n @estoque = Estoque.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @estoque }\n end\n end", "title": "" } ]
[ { "docid": "e75e677adbb21f72d7fbb42e8fe8b081", "score": "0.7281696", "text": "def index\n @estoques = Estoque.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @estoques }\n end\n end", "title": "" }, { "docid": "4159dec1fcfba12b50c1143c634653fc", "score": "0.65589756", "text": "def show\n @toque = Toque.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @toque }\n end\n end", "title": "" }, { "docid": "72d06ef8d27a103e5d319bf0a4f9a101", "score": "0.6480945", "text": "def index\n @toques = Toque.find(:all, :order=>\"cuando DESC\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @toques }\n end\n end", "title": "" }, { "docid": "cd57753d054edd4729a149ff38bc9b02", "score": "0.6376989", "text": "def index\n @questoes = Questao.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questoes }\n end\n end", "title": "" }, { "docid": "cba80f09090d851db9c986fe3f6ab24a", "score": "0.63296074", "text": "def new\n @estoque = Estoque.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @estoque }\n end\n end", "title": "" }, { "docid": "c50afbf0df87b5ebca9e194450959ad5", "score": "0.6247876", "text": "def show\n @queen = Queen.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @queen }\n end\n end", "title": "" }, { "docid": "81643fb7b33bdae8272baa5fa18b9640", "score": "0.6232983", "text": "def show\n @quelle = Quelle.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @quelle }\n end\n end", "title": "" }, { "docid": "9779c70cfc4e8cbfe8f3c48b29bacfaf", "score": "0.62201875", "text": "def index\n @questionaires = Questionaire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questionaires }\n end\n end", "title": "" }, { "docid": "fabf43f8ddc6fc646665732d3a27c41c", "score": "0.62096745", "text": "def show\n @question = Question.find(params[:id])\n \n respond_to do |format|\n format.html \n format.xml { render xml: @question }\n end\n end", "title": "" }, { "docid": "1d40ea3807de78971e92c54bdd1f4ffe", "score": "0.6209275", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quizzes }\n end\n end", "title": "" }, { "docid": "764de76443daf13beda61b14a266ea71", "score": "0.61886936", "text": "def get_xml\n end", "title": "" }, { "docid": "de7f5be5e070415b63df7505bb428c16", "score": "0.61805916", "text": "def index\n @quizzes = Quiz.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quizzes }\n end\n end", "title": "" }, { "docid": "de7f5be5e070415b63df7505bb428c16", "score": "0.61805916", "text": "def index\n @quizzes = Quiz.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quizzes }\n end\n end", "title": "" }, { "docid": "fee9dc0ec287dd007fac762875c0f589", "score": "0.61696607", "text": "def index\n @questions = Question.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questions }\n end\n end", "title": "" }, { "docid": "fee9dc0ec287dd007fac762875c0f589", "score": "0.61696607", "text": "def index\n @questions = Question.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questions }\n end\n end", "title": "" }, { "docid": "e0ba2da9fd2e578eb3aa752e01abdc82", "score": "0.61682576", "text": "def index\n @qxes = Qx.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @qxes }\n end\n end", "title": "" }, { "docid": "58d47a3dc866616f4279b9a06273a4d5", "score": "0.61584014", "text": "def index\n @questions = Question.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questions }\n end\n end", "title": "" }, { "docid": "58d47a3dc866616f4279b9a06273a4d5", "score": "0.61584014", "text": "def index\n @questions = Question.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questions }\n end\n end", "title": "" }, { "docid": "58d47a3dc866616f4279b9a06273a4d5", "score": "0.61584014", "text": "def index\n @questions = Question.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questions }\n end\n end", "title": "" }, { "docid": "58d47a3dc866616f4279b9a06273a4d5", "score": "0.61584014", "text": "def index\n @questions = Question.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questions }\n end\n end", "title": "" }, { "docid": "58d47a3dc866616f4279b9a06273a4d5", "score": "0.61584014", "text": "def index\n @questions = Question.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questions }\n end\n end", "title": "" }, { "docid": "58d47a3dc866616f4279b9a06273a4d5", "score": "0.61584014", "text": "def index\n @questions = Question.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questions }\n end\n end", "title": "" }, { "docid": "482f3c440e89ab0d1ae45dd41b1073e4", "score": "0.614602", "text": "def index\n @exam = Exam.find(params[:exam_id])\n @questions = @exam.question\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questions }\n end\n end", "title": "" }, { "docid": "b110f7764fe036cc82604e5492b94ee7", "score": "0.61394644", "text": "def show\n respond_to do |format|\n format.html\n format.xml { render :xml => @q }\n end\n end", "title": "" }, { "docid": "627be04146567c085c6a1d568d20e2cf", "score": "0.6134825", "text": "def index\n @quiz_questions = @quiz_page.quiz_questions.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quiz_questions }\n end\n end", "title": "" }, { "docid": "6a2681b90796ff49589c22206593e04c", "score": "0.6099862", "text": "def get_courses\n\n @courses = Course.all\n\n respond_to do |format|\n format.xml { render :xml => @courses }\n end\n\nend", "title": "" }, { "docid": "d5f8d99d65b19a512b79d246f3375de2", "score": "0.60825485", "text": "def index\n respond_to do |format|\n format.xml\n end\n end", "title": "" }, { "docid": "e2ceda7d4a986ecfb5b6e3a48403ac09", "score": "0.6073736", "text": "def rss\n @answers = Answer.find :all, :order => 'answers.created_at DESC', :limit => 20\n\n respond_to do |format|\n format.xml\n end\n end", "title": "" }, { "docid": "6744a39d0d8aa416daba7fbf82a94929", "score": "0.60647106", "text": "def index\n @questions = @test.questions.find(:all)\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questions }\n end\n end", "title": "" }, { "docid": "6f4adc356cee44a7b2e31413ca84867a", "score": "0.6062874", "text": "def index\r\n @cuentum = Cuentum.find(params[:cuentum_id])\r\n @chequeras = @cuentum.chequeras\r\n \r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @chequeras}\r\n end\r\n end", "title": "" }, { "docid": "e825331feb12c19bb2d652fb72de235c", "score": "0.6033906", "text": "def new\n @toque = Toque.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @toque }\n end\n end", "title": "" }, { "docid": "f2f8039ffbdcedbc60bb69ee66fc281b", "score": "0.60283566", "text": "def show\n @scrap_xml = ScrapXml.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @scrap_xml }\n end\n end", "title": "" }, { "docid": "b1380eaffdcb07d8fbe10b5e6d016a35", "score": "0.6011122", "text": "def index\n @qas = Qa.order(\"id desc\").all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @qas }\n end\n end", "title": "" }, { "docid": "0c0dab280ccba04e16f60edacf4b3843", "score": "0.6003902", "text": "def faq\n respond_to do |format|\n format.html # faq.html.erb\n format.xml { render :xml => nil }\n end\n end", "title": "" }, { "docid": "4d0208e7b8e4c89bad251ec25f7b5f03", "score": "0.5992777", "text": "def show\n @questions = @test.questions.find(:all)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @question }\n end\n end", "title": "" }, { "docid": "2833c36889cde6ab68e4f198c70ea7e4", "score": "0.5992027", "text": "def show\n @question = Question.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @question }\n end\n end", "title": "" }, { "docid": "8b65e1a9384788b3413ccf5a31550809", "score": "0.5991566", "text": "def show\n @questao = Questao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @questao }\n end\n end", "title": "" }, { "docid": "7429624b899b36b4288be4e314105c20", "score": "0.59829074", "text": "def index\n @questions = @survey.questions.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questions }\n end\n end", "title": "" }, { "docid": "d3385240c14870f65ec7fa31a59f4e29", "score": "0.5969057", "text": "def show\n @quizz = Quizz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @quizz }\n end\n end", "title": "" }, { "docid": "c3e5027ae7c713ec1b80c37dfee492ad", "score": "0.5957839", "text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @question }\n end\n end", "title": "" }, { "docid": "e8978cda5c855c730ebc980e07015a6a", "score": "0.59576917", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @question }\n end\n end", "title": "" }, { "docid": "f2cf07952b3745e196a26336274244c0", "score": "0.59558123", "text": "def index\n @quizzes = Quiz.find(:all)\n @users = User.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quizzes }\n end\n end", "title": "" }, { "docid": "41af017d21a6be6c232d9ee5a5aceaba", "score": "0.59384644", "text": "def show\n @requisicao = Requisicao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @requisicao }\n end\n end", "title": "" }, { "docid": "0a5cd0d832f2b06085085d0dd26a4138", "score": "0.5929397", "text": "def show\n @faq = Faq.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @faq }\n end\n end", "title": "" }, { "docid": "223fa6cdacba886c66fd04fb8f8e3c48", "score": "0.5921123", "text": "def index\n respond_to do |format|\n format.html {redirect_to edit_quiz_path(@quiz)}\n format.xml { render :xml => @quiz.questions }\n end\n end", "title": "" }, { "docid": "50bdb05751586638412bc0deb7589ff1", "score": "0.5920363", "text": "def show\n @questionaire = Questionaire.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @questionaire }\n end\n end", "title": "" }, { "docid": "75cbcf56e70b6f05f18bf63abd4293fd", "score": "0.59143436", "text": "def index\n self.class.get(\"/cards/index.xml\");\n end", "title": "" }, { "docid": "1d60aba1e4169c1e60d19110b5e8abf5", "score": "0.58952236", "text": "def read_xml\n end", "title": "" }, { "docid": "de256e073db783355b77b1293889aec3", "score": "0.5894101", "text": "def read(id=nil)\r\n request = Net::HTTP.new(@uri.host, @uri.port)\r\n \r\n if id.nil?\r\n response = request.get(\"#{@uri.path}.xml\") \r\n else\r\n response = request.get(\"#{@uri.path}/#{id}.xml\") \r\n end\r\n \r\n response.body\r\n end", "title": "" }, { "docid": "ea44cd9d067396e9ecc1f15be2344181", "score": "0.58920926", "text": "def index\n @questionnaires = Questionnaire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questionnaires }\n end\n end", "title": "" }, { "docid": "8e20eb5833efdb447a3e196cd53326a9", "score": "0.58920074", "text": "def show\n @enquete = Enquete.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @enquete }\n end\n end", "title": "" }, { "docid": "a378256ce3d6338af7180ff544f22b3c", "score": "0.5889825", "text": "def xml_report\n RestClient::get \"#{@base}/OTHER/core/other/xmlreport/\"\n end", "title": "" }, { "docid": "aafd4bc57042088228cd177c373b7dcc", "score": "0.5886922", "text": "def index\n @publishquizzes = Publishquiz.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @publishquizzes }\n end\n end", "title": "" }, { "docid": "c4e135e5d80ac252046cd90ee661b9ba", "score": "0.58783287", "text": "def show\n @solicitud = Solicitud.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @solicitud }\n end\n end", "title": "" }, { "docid": "591bfed4166d3482b02ecc822338cee1", "score": "0.58753806", "text": "def show\n @quest = Quest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @quest }\n end\n end", "title": "" }, { "docid": "4325fe17243a001ff69ea6a7d4947724", "score": "0.5873867", "text": "def index\n @concessionaires = Concessionaire.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @concessionaires }\n end\n end", "title": "" }, { "docid": "b92143418a09fec73f915dae8f935d78", "score": "0.58729994", "text": "def index\n @ques = Que.all\n end", "title": "" }, { "docid": "25d0ee475097a7ac36059b34d61c5f2d", "score": "0.5872101", "text": "def index\n @soustraitants = @paramun.soustraitants\n\n respond_to do |format|\n if @soustraitants.empty?\n format.xml { render request.format.to_sym => \"ssouErreurA\" } ## Aucun Soustraitant collecté\n else\n format.xml { render xml: @soustraitants }\n end\n end\n end", "title": "" }, { "docid": "7eae91cf377ac7a7ec2d1c6996057857", "score": "0.5866554", "text": "def index\n @questions = Question.where(:survey_id => session[:surveyid]).all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questions }\n end\n end", "title": "" }, { "docid": "5593e1eda22844d141af63f81ae97647", "score": "0.58583236", "text": "def index\n @questions = Question.all\n \n respond_to do |format|\n format.html\n format.xml { render xml: @questions }\n format.json { render json: @questions }\n end\n end", "title": "" }, { "docid": "613b207c9f3b78b26b890f2c7691caba", "score": "0.58581465", "text": "def index\n #@questions = Question.all\n @questions = Question.paginate :page => params[:page], :order => \"id DESC\", :per_page => 10\n \n respond_to do |format|\n format.html \n format.xml { render :xml => @questions }\n end\n end", "title": "" }, { "docid": "5287660ffc1da7d33d5de8abe3f2ebbf", "score": "0.5854765", "text": "def xml_report\n RestClient::get \"#{base}/OTHER/core/other/xmlreport/\"\n end", "title": "" }, { "docid": "006c65cc1b0e5fffc6dd4472ab012124", "score": "0.58526725", "text": "def index\r\n @questionares = Questionare.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @questionares }\r\n end\r\n end", "title": "" }, { "docid": "36016c802487e063bbc01b8de7e211ad", "score": "0.58509123", "text": "def index\n @recettes = @paramun.recettes\n\n respond_to do |format|\n if @recettes.empty?\n format.xml { render request.format.to_sym => \"rrecErreurA\" } ## Aucune Recettes\n else\n format.xml { render xml: @recettes }\n end\n end\n end", "title": "" }, { "docid": "08eab574a3c9a42139b69fbe490130ef", "score": "0.58489233", "text": "def index\n @existencias = Existencia.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @existencias }\n end\n end", "title": "" }, { "docid": "397fec6060da1425dfa58db30b1d36cb", "score": "0.58391935", "text": "def index\n @enquiries = Enquiry.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @enquiries }\n end\n end", "title": "" }, { "docid": "8204cc58659a716b3c7d03b6a8e7c09a", "score": "0.5837362", "text": "def show\n respond_to do |format|\n format.html { render_template } # show.html.erb\n format.xml { render xml: @faq }\n end\n end", "title": "" }, { "docid": "540abe889dc5764110eb430016b254e5", "score": "0.5836696", "text": "def show\n @quiz = Quiz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @quiz }\n end\n end", "title": "" }, { "docid": "540abe889dc5764110eb430016b254e5", "score": "0.5836696", "text": "def show\n @quiz = Quiz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @quiz }\n end\n end", "title": "" }, { "docid": "540abe889dc5764110eb430016b254e5", "score": "0.5836696", "text": "def show\n @quiz = Quiz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @quiz }\n end\n end", "title": "" }, { "docid": "540abe889dc5764110eb430016b254e5", "score": "0.5836696", "text": "def show\n @quiz = Quiz.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @quiz }\n end\n end", "title": "" }, { "docid": "7c507d89e5446ecfdec26da4eee394af", "score": "0.58298916", "text": "def show\n @cheque_diferido = ChequeDiferido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cheque_diferido }\n end\n end", "title": "" }, { "docid": "b33f427c5d215b968938e6d241043f1b", "score": "0.582813", "text": "def show\n @estagiarios = Estagiario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @estagiarios }\n end\n end", "title": "" }, { "docid": "f40624225e2d0de13901509a9a142f18", "score": "0.5822503", "text": "def index\n @destaques = Destaque.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @destaques }\n end\n end", "title": "" }, { "docid": "bf5b78d4bc34427b1731ebbd8d118bc1", "score": "0.5817372", "text": "def show\n @what_qo = WhatQo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @what_qo }\n end\n end", "title": "" }, { "docid": "ca769343bf556d73c4797e81160c809b", "score": "0.58096296", "text": "def index\n @cabcargachequeters = Cabcargachequeter.paginate(:per_page =>15, :page => params[:page] || 1, :order => ['ccht_fecha DESC, id DESC'])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @cabcargachequeters }\n end\n end", "title": "" }, { "docid": "d52c54f74133395f5c7a688466dd9bae", "score": "0.58052087", "text": "def index\n @topics = Topic.all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @topics }\n end\n end", "title": "" }, { "docid": "1ff6afebf5783639349ea27fff1b6361", "score": "0.58032954", "text": "def index\n @topics = Topic.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @topics }\n end\n end", "title": "" }, { "docid": "1ff6afebf5783639349ea27fff1b6361", "score": "0.58032954", "text": "def index\n @topics = Topic.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @topics }\n end\n end", "title": "" }, { "docid": "7e9c5255cea7e6e1155e3284e1e695f2", "score": "0.5799352", "text": "def index\n @quiz_answers = QuizAnswer.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quiz_answers }\n end\n end", "title": "" }, { "docid": "b2069cc1c3a228f7167cb5be372a1d96", "score": "0.57992715", "text": "def show\n @historique = Historique.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @historique }\n end\n end", "title": "" }, { "docid": "3b396eafb76e1626f53ba333bd7aae29", "score": "0.57980055", "text": "def show\n respond_to do |format|\n format.html\n format.xml { render xml: @question }\n format.json { render json: @question }\n end\n end", "title": "" }, { "docid": "06480155b130d0196afe8b6930d851e0", "score": "0.5796173", "text": "def show\r\n @cuentum = Cuentum.find(params[:cuentum_id])\r\n @chequera = @cuentum.chequeras.find(params[:id])\r\n\r\n respond_to do |format|\r\n format.html # show.html.erb\r\n format.xml { render :xml => @chequera }\r\n end\r\n end", "title": "" }, { "docid": "c9d87ac2027629d9945c2254d9c8a8db", "score": "0.57956344", "text": "def show\n @etiquetum = Etiquetum.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @etiquetum }\n end\n end", "title": "" }, { "docid": "219675f818311e83d809ad50537f49e6", "score": "0.578783", "text": "def apis\n respond_to do |format|\n format.xml\n end\n end", "title": "" }, { "docid": "63a23ab2fbf5c386056c741d36f28586", "score": "0.57867897", "text": "def show\n\n @puntuacione = Puntuacione.find(params[:id])\n respond_to do |format| \n format.xml { render xml: @puntuacione }\n end\n end", "title": "" }, { "docid": "2b21fb71bf9f12909d66e59f6f7b1d38", "score": "0.5784763", "text": "def index\n @ques = current_manager.ques \n end", "title": "" }, { "docid": "b8e356b719fd93875010a84ef54a5440", "score": "0.57818913", "text": "def show\n @bodequero = Bodequero.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @bodequero }\n end\n end", "title": "" }, { "docid": "d65f2d60dd8efbd9f84cb4ccd105e81c", "score": "0.5775594", "text": "def show\n @qa = Qa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @qa }\n end\n end", "title": "" }, { "docid": "c0c90e45c9538c7b2cf7b8637852aec3", "score": "0.5773328", "text": "def index\n @ques = Que.all\n respond_to do |format|\n format.json { render json: @ques }\n end\n end", "title": "" }, { "docid": "d01a9043ea8d3492be7c36c52c120198", "score": "0.57656914", "text": "def index\n\t@survey = Survey.find(params[:survey_id])\n @questions = @survey.questions #Question.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @questions }\n end\n end", "title": "" }, { "docid": "6b161c02ef6e8c324c46c8d0e2bf3b72", "score": "0.57642674", "text": "def show\n @solicitante = Solicitante.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @solicitante }\n end\n end", "title": "" }, { "docid": "aa35ad8038235955532d6a7ec5908e17", "score": "0.57628626", "text": "def show\n @questao = Questao.find(params[:id])\n \n load_respostas\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @questao }\n end\n end", "title": "" }, { "docid": "493ff9377a2b6850c726938d2c9affa8", "score": "0.57593143", "text": "def show\n @question = Question.find(params[:id])\n\n respond_to do |format|\n format.html # show.rhtml\n format.xml { render :xml => @question.to_xml }\n end\n end", "title": "" }, { "docid": "4e4b3a139f498b748dacb2228ee399e9", "score": "0.57590145", "text": "def index\n @question_comments = QuestionComment.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @question_comments }\n end\n end", "title": "" }, { "docid": "174e058b21f92ce49082501a1997afe4", "score": "0.57568747", "text": "def show \n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @qx }\n end\n end", "title": "" }, { "docid": "25c8f4b6a339da83f2b2f5093e9d1715", "score": "0.57559735", "text": "def index\n @quiz_pages = @section.quiz_pages\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @quiz_pages }\n end\n end", "title": "" }, { "docid": "66b9ae0d08eca24b5081ecf21e31d943", "score": "0.5746508", "text": "def show\n @qq = Qq.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @qq }\n end\n end", "title": "" }, { "docid": "23be1fa3c69355a2afdf11259e97c207", "score": "0.5742724", "text": "def show\n @exemplo = Exemplo.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @exemplo }\n end\n end", "title": "" }, { "docid": "21d6eae31bf57f65862e268c5229f7d5", "score": "0.5741861", "text": "def index\n @convidados = Convidado.find_all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @convidados }\n end\n end", "title": "" } ]
91204b53bf87072901d2190cc3854d16
PUT /attempts/1 PUT /attempts/1.xml
[ { "docid": "db3c7d97104172f23bc0cf4e09a528f3", "score": "0.5763596", "text": "def update\n @attempt = Attempt.find(params[:id])\n\n if @attempt.update_attributes(params[:attempt])\n redirect_to(@attempt, :flash => { :success => 'Contact Attempt successfully updated' })\n else\n @title = \"Editing Attempt\"\n render :action => \"edit\"\n end\n end", "title": "" } ]
[ { "docid": "3d067ffa4baab8b2ecc0828eed14c94a", "score": "0.64279157", "text": "def update\n @attempt = Attempt.find(params[:id])\n\n respond_to do |format|\n if @attempt.update_attributes(params[:attempt])\n format.html { redirect_to(@attempt, :notice => 'Attempt was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @attempt.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2b9fb472ccefb2976344e05612f567b8", "score": "0.62504786", "text": "def update_attempts\n attempt_count = self.attempts\n self.update_attributes({:attempts => attempt_count + 1})\n end", "title": "" }, { "docid": "5b0ab8bddbd467ffbe596eb13214b281", "score": "0.6150478", "text": "def update\n @attempt = Attempt.find(params[:id])\n\n respond_to do |format|\n if @attempt.update_attributes(params[:attempt])\n format.html { redirect_to @attempt, notice: 'Attempt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b0ab8bddbd467ffbe596eb13214b281", "score": "0.6150478", "text": "def update\n @attempt = Attempt.find(params[:id])\n\n respond_to do |format|\n if @attempt.update_attributes(params[:attempt])\n format.html { redirect_to @attempt, notice: 'Attempt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e63c5dc44d3d34e2199948de878e22c", "score": "0.59728044", "text": "def attempts=(value)\n doc['attempts'] = value.to_i\n end", "title": "" }, { "docid": "84f8c0dd4f36cd7e42ab7210007938f3", "score": "0.5798539", "text": "def update\n respond_to do |format|\n if @attempt.update(attempt_params)\n format.html { redirect_to @attempt, notice: \"Attempt was successfully updated.\" }\n format.json { render :show, status: :ok, location: @attempt }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "15fecef8c740be9754e0546909ff0ec3", "score": "0.5766108", "text": "def update\n @quiz = Quiz.find(params[:id])\n @attempts= @quiz.attempts\n if @attempts.any?\n @attempts.each do |attempt|\n attempt.destroy\n end\n end\n respond_to do |format|\n if @quiz.update_attributes(params[:quiz])\n format.html { redirect_to @quiz, notice: 'Quiz was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @quiz.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "238fd956be713471aa406c76bf19254a", "score": "0.57594305", "text": "def test_should_update_status_post_via_API_XML\r\n get \"/logout\"\r\n put \"/status_posts/1.xml\", :status_post => {:body => 'API Status Post 1' }\r\n assert_response 401\r\n end", "title": "" }, { "docid": "6033ebd641ac13b37bfdaba33c6af8af", "score": "0.57342666", "text": "def update\n respond_to do |format|\n if @attempt.update(attempt_params)\n format.html { redirect_to @attempt, notice: 'Attempt was successfully updated.' }\n format.json { render :show, status: :ok, location: @attempt }\n else\n format.html { render :edit }\n format.json { render json: @attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6033ebd641ac13b37bfdaba33c6af8af", "score": "0.57342666", "text": "def update\n respond_to do |format|\n if @attempt.update(attempt_params)\n format.html { redirect_to @attempt, notice: 'Attempt was successfully updated.' }\n format.json { render :show, status: :ok, location: @attempt }\n else\n format.html { render :edit }\n format.json { render json: @attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6033ebd641ac13b37bfdaba33c6af8af", "score": "0.57342666", "text": "def update\n respond_to do |format|\n if @attempt.update(attempt_params)\n format.html { redirect_to @attempt, notice: 'Attempt was successfully updated.' }\n format.json { render :show, status: :ok, location: @attempt }\n else\n format.html { render :edit }\n format.json { render json: @attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6033ebd641ac13b37bfdaba33c6af8af", "score": "0.57342666", "text": "def update\n respond_to do |format|\n if @attempt.update(attempt_params)\n format.html { redirect_to @attempt, notice: 'Attempt was successfully updated.' }\n format.json { render :show, status: :ok, location: @attempt }\n else\n format.html { render :edit }\n format.json { render json: @attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e9d8d122911c5287d8b5baabbe7af350", "score": "0.5718678", "text": "def update\n @attempt_attribute = AttemptAttribute.find(params[:id])\n\n respond_to do |format|\n if @attempt_attribute.update_attributes(params[:attempt_attribute])\n format.html { redirect_to @attempt_attribute, notice: 'Attempt attribute was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @attempt_attribute.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a655b02c07fd3ff7073e037ed74339b2", "score": "0.5672011", "text": "def update\n respond_to do |format|\n if @attempt.update(attempt_params)\n format.html { redirect_to @attempt, notice: 'attempt was successfully updated.' }\n format.json { render :show, status: :ok, location: @attempt }\n else\n format.html { render :edit }\n format.json { render json: @attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23b8fd20c4f863cc9fd1d0f2eeefb2e5", "score": "0.56675506", "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": "4d90f01a6c06c2408192bd2dc721385e", "score": "0.56591374", "text": "def update\n @attempt = Attempt.find(params[:id])\n respond_to do |format|\n if @attempt.update_attributes(:attempt_values => params[:attempt][:attempt_values_attributes]) and @attempt.update_attributes(params[:attempt])\n format.html { redirect_to @attempt, notice: 'Attempt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c99238efa98a6e05678c5d303dd5515d", "score": "0.56513464", "text": "def update_ticket(ticket_num)\n \n url = ['/tickets/',ticket_num,'.xml'].join\n result = @connection.put url, \n (\n xml = Builder::XmlMarkup.new( :indent => 2 )\n xml.instruct! :xml, :encoding => \"UTF-8\"\n xml.ticket do |t|\n t.tag! \"solved-at\", Time.now\n t.tag! \"status-id\", \"3\"\n end\n )\n end", "title": "" }, { "docid": "9ddf960eb3f437e62b9b99d34992bc0f", "score": "0.55721325", "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": "4887dbbe58b944b6f789e053762ef808", "score": "0.5570596", "text": "def attempts=(value)\n @attempts = value.to_i\n @attempts = ATTEMPTS_DEFAULT if (@attempts == 0)\n end", "title": "" }, { "docid": "17db4d6207bb189b623e1934e92385bc", "score": "0.5567525", "text": "def update\n @attempt = Attempt.find_by_id(params[:id])\n @attempt.update_attribute(:completed_at, Time.now)\n\n score = calcuate_score(@attempt)\n @attempt.update_attribute(:score, score)\n\n @attempt.save\n render json: @attempt, status: :ok\n\n end", "title": "" }, { "docid": "2dbb249365ad3ea4990b09bd6af53c02", "score": "0.5556625", "text": "def update(name, num_attempts)\n if num_attempts <= 5\n #puts \"#{name} is not genuine.\"\n else\n puts \"#{name} is genuine: No of attempts required: #{num_attempts}.\"\n end\n end", "title": "" }, { "docid": "604af662a07f197bafd136f815b98f69", "score": "0.55354625", "text": "def update\n params[:requests].each_pair do |id, quantity|\n unless quantity.blank?\n request = UserInviteRequest.find(id)\n request.quantity = quantity.to_i\n request.save!\n end\n end\n setflash; flash[:notice] = 'Requests were successfully updated.'\n redirect_to user_invite_requests_url\n end", "title": "" }, { "docid": "ad54471b285e5e357d9be959c8ade2d8", "score": "0.553401", "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": "bd9ab1132de10ed9da4a7f169979803b", "score": "0.5532134", "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": "bd9ab1132de10ed9da4a7f169979803b", "score": "0.5532134", "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": "1e56f92a9aaa2e5cedc0bc92c2d85893", "score": "0.55286837", "text": "def update\n @try = Try.find(params[:id])\n\n respond_to do |format|\n if @try.update_attributes(params[:try])\n format.html { redirect_to(@try, :notice => 'Try was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @try.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "966ff77a899158c3b83bfb3655562639", "score": "0.549267", "text": "def update\n respond_to do |format|\n if @exam_attempt.update(exam_attempt_params)\n format.html { redirect_to @exam_attempt, notice: 'Exam attempt was successfully updated.' }\n format.json { render :show, status: :ok, location: @exam_attempt }\n else\n format.html { render :edit }\n format.json { render json: @exam_attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cda8b4fecb13cbc3241d1e43a4794577", "score": "0.5482774", "text": "def update\n respond_to do |format|\n if @attempt.update(attempt_params)\n format.html { redirect_to course_quiz_attempt_results_url(@course,@quiz,@attemt), notice: 'Quiz Responses successfully updated.' }\n format.json { render :show, status: :ok, location: @attempt }\n else\n format.html { render :edit }\n format.json { render json: @attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "18ab900b035bae7ae05e4049ad5bed83", "score": "0.5474805", "text": "def test_should_update_friendship\n login_as(:jane)\n put :update, :user_id => users(:jane).id, :id => 1, :friendship => { }\n\n assert_response :success\n end", "title": "" }, { "docid": "9d72302bc12e3c8440c5cdd35fdc604c", "score": "0.5452996", "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": "e8a57ee957edf16d5dc2a9dda2802661", "score": "0.5430857", "text": "def set_attempt\n @attempt = Attempt.find(params[:id])\n end", "title": "" }, { "docid": "e8a57ee957edf16d5dc2a9dda2802661", "score": "0.5430857", "text": "def set_attempt\n @attempt = Attempt.find(params[:id])\n end", "title": "" }, { "docid": "e8a57ee957edf16d5dc2a9dda2802661", "score": "0.5430857", "text": "def set_attempt\n @attempt = Attempt.find(params[:id])\n end", "title": "" }, { "docid": "e8a57ee957edf16d5dc2a9dda2802661", "score": "0.5430857", "text": "def set_attempt\n @attempt = Attempt.find(params[:id])\n end", "title": "" }, { "docid": "e8a57ee957edf16d5dc2a9dda2802661", "score": "0.5430857", "text": "def set_attempt\n @attempt = Attempt.find(params[:id])\n end", "title": "" }, { "docid": "e8a57ee957edf16d5dc2a9dda2802661", "score": "0.5430857", "text": "def set_attempt\n @attempt = Attempt.find(params[:id])\n end", "title": "" }, { "docid": "e8a57ee957edf16d5dc2a9dda2802661", "score": "0.5430857", "text": "def set_attempt\n @attempt = Attempt.find(params[:id])\n end", "title": "" }, { "docid": "e8a57ee957edf16d5dc2a9dda2802661", "score": "0.5430857", "text": "def set_attempt\n @attempt = Attempt.find(params[:id])\n end", "title": "" }, { "docid": "e8a57ee957edf16d5dc2a9dda2802661", "score": "0.5430857", "text": "def set_attempt\n @attempt = Attempt.find(params[:id])\n end", "title": "" }, { "docid": "e8a57ee957edf16d5dc2a9dda2802661", "score": "0.5430857", "text": "def set_attempt\n @attempt = Attempt.find(params[:id])\n end", "title": "" }, { "docid": "e8a57ee957edf16d5dc2a9dda2802661", "score": "0.5430857", "text": "def set_attempt\n @attempt = Attempt.find(params[:id])\n end", "title": "" }, { "docid": "e8a57ee957edf16d5dc2a9dda2802661", "score": "0.5430857", "text": "def set_attempt\n @attempt = Attempt.find(params[:id])\n end", "title": "" }, { "docid": "e8a57ee957edf16d5dc2a9dda2802661", "score": "0.5430857", "text": "def set_attempt\n @attempt = Attempt.find(params[:id])\n end", "title": "" }, { "docid": "323af30920559fe4d77e8abf75826168", "score": "0.5416539", "text": "def update\n @attempt_value = AttemptValue.find(params[:id])\n\n respond_to do |format|\n if @attempt_value.update_attributes(params[:attempt_value])\n format.html { redirect_to @attempt_value, notice: 'Attempt value was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @attempt_value.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9a22b4c664c0ee1b272ef1af0553060c", "score": "0.53643167", "text": "def rest_put( url, payload, tries = DEFAULT_RETRIES )\n attempts = 0\n while attempts < tries\n puts \"WARNING: request timeout: #{url} after #{self.timeout} second(s), retrying...\" if attempts != 0\n status, response = rest_send_internal( url, :put, payload )\n return status, response if status != 408\n attempts += 1\n end\n\n # done trying...\n puts \"ERROR: request timeout: #{url}; gave up after #{tries} try(s)\"\n return 408, {}\n end", "title": "" }, { "docid": "fbd7c46b15ae2792fd842ba0d764b7d0", "score": "0.5364305", "text": "def put uri, args = {}; Request.new(PUT, uri, args).execute; end", "title": "" }, { "docid": "38905740d2ed825881142b7adb5e3012", "score": "0.53593755", "text": "def increment_execution_attempts!\n @store.incr(msg_id, :attempts)\n end", "title": "" }, { "docid": "d353c9b1e6ca07b9ff0dc2c09611f3a6", "score": "0.5348994", "text": "def increment_failed_attempts!\n self.failed_attempts ||= 0\n self.failed_attempts += 1\n\n if attempts_exceeded?\n lock_access! unless access_locked?\n else\n save(validate: false)\n end\n end", "title": "" }, { "docid": "5e7f56eb1e62b28a791b8dded85ac5c5", "score": "0.5329025", "text": "def update_rest\n @v1_item_usage = V1ItemUsage.find(params[:id])\n\n respond_to do |format|\n if @v1_item_usage.update_attributes(params[:v1_item_usage])\n flash[:notice] = 'V1ItemUsage was successfully updated.'\n format.html { redirect_to(@v1_item_usage) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @v1_item_usage.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99d24a74bc96db3bd84b0451ef3afb5f", "score": "0.5270508", "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": "9603ad21f6e0b5401650f267a1d920de", "score": "0.52653885", "text": "def put\n status 404\n nil\n end", "title": "" }, { "docid": "afb59f66ecdaa6c9d7a47a38d3e9de98", "score": "0.5263366", "text": "def touch(path, options = {})\n checkPrivliage('SETTIMES', %w(modificationtime accesstime))\n res = operate_requests('PUT', path, 'SETTIMES', options)\n res.code == '200'\n end", "title": "" }, { "docid": "e414bc6b371202ea398da559f2c3017d", "score": "0.5263093", "text": "def failed\n @attempts += 1\n end", "title": "" }, { "docid": "a64115747869aba9787a6890a8a1d951", "score": "0.52600795", "text": "def update\n @lesson_attempt = LessonAttempt.find(params[:id])\n\n respond_to do |format|\n if @lesson.update_attributes(params[:lesson_attempt])\n format.html { redirect_to @lesson, notice: 'Lesson was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lesson.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23b5f5e4dacfb330cb1e0ffd4590ef63", "score": "0.52514905", "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": "220a9d99821f5e418f89abca08b77072", "score": "0.523985", "text": "def set_attempt\n @attempt = Attempt.find(params[:id])\n authorize @attempt\n end", "title": "" }, { "docid": "b60a72afdf5b58420c6eb2895735c097", "score": "0.5235797", "text": "def update\n @fail = current_user.fails.find(params[:id])\n\n respond_to do |format|\n if @fail.update_attributes(params[:fail])\n format.html { redirect_to @fail, notice: 'fail was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @fail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5edb8a9b2cad14c7874c5f42c5809e9", "score": "0.5233287", "text": "def test_put_user\n json_data = '{\"name\":\"test\", \"last_name\":\"test\", \"document\" : \"098\"}'\n put '/users/4', json_data\n assert_equal 204, last_response.status, 'Código de respuesta incorrecto'\n end", "title": "" }, { "docid": "9098e2b4086b3206904aa94912a4898e", "score": "0.52308315", "text": "def update_views\n @idea = Idea.find(params[:id])\n\n @idea.views += 1\n\n respond_to do |format|\n if @idea.update_attributes(params[:idea])\n format.html { redirect_to @idea }\n format.json { head :no_idea }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @idea.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "24177b5626837a078d82ab2f4fde808e", "score": "0.52283496", "text": "def update_rest\n @entry_question = EntryQuestion.find(params[:id])\n\n respond_to do |format|\n if @entry_question.update_attributes(params[:entry_question])\n flash[:notice] = 'EntryQuestion was successfully updated.'\n format.html { redirect_to(@entry_question) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @entry_question.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ebf988f831798fe1d0c1316c7930f2d3", "score": "0.52281004", "text": "def update\n note = Note.find(params[:id])\n note.approved_counter += 1\n respond_with note.save\n end", "title": "" }, { "docid": "980d9ac459831b983cba4b6243d3b820", "score": "0.5210467", "text": "def attempt=(value)\n @attempt = value.to_i\n end", "title": "" }, { "docid": "ab7b511e7fdb14f278ada05c46659bfc", "score": "0.5200742", "text": "def _update_item(http, headers, path, body, name)\n resp = retry_request(http, \"PATCH\", path, body, headers)\n if resp.is_a?(Net::HTTPOK)\n Chef::Log.info(\"Updated keystone item '#{name}'\")\n else\n _raise_error(resp, \"Unable to update item '#{name}'\", \"_update_item\")\n end\nend", "title": "" }, { "docid": "6b978d3351e5898f02ace2b9b8395be0", "score": "0.51862633", "text": "def update\n new_scores = student_attempt_params[:problem_attempts_attributes].values\n respond_to do |format|\n if @student_attempt.update(problem_attempts_attributes: new_scores)\n format.html { redirect_to @course_instance, notice: \"#{@student.name} attempt at #{@assessment.name} was successfully updated.\" }\n format.json { render :show, status: :ok, location: @student_attempt }\n else\n format.html { render :edit }\n format.json { render json: @student_attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "115c2715cb351208695a6ca8929c46d2", "score": "0.5170296", "text": "def destroy\n @attempt = Attempt.find(params[:id])\n @attempt.destroy\n\n respond_to do |format|\n format.html { redirect_to(attempts_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e6f925674ab859778b1c91400164fe32", "score": "0.516847", "text": "def update\n @point_after_attempt = PointAfterAttempt.find(params[:id])\n\n respond_to do |format|\n if @point_after_attempt.update_attributes(params[:point_after_attempt])\n format.html { redirect_to @point_after_attempt, notice: 'Point after attempt was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @point_after_attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d63c9b70f20a31eb362573aeec3e8871", "score": "0.51670843", "text": "def test_accept_booking_from_diff_res\n ini_bookings\n\n put \"resources/99/bookings/2\"\n assert_equal 409, last_response.status\n end", "title": "" }, { "docid": "199179cf4e3b569f249f0b4ceb73d94a", "score": "0.51646054", "text": "def update\n respond_to do |format|\n if @quiz_attempt.update(quiz_attempt_params)\n format.html { redirect_to @quiz_attempt, notice: 'Quiz has been successfully attempted.' }\n format.json { render :show, status: :ok, location: @quiz_attempt }\n @quiz_attempt.set_correct_answers\n @quiz_attempt.set_attempted_answers\n @quiz_attempt.set_earned_marks\n @quiz_attempt.set_status\n else\n format.html { render :edit }\n format.json { render json: @quiz_attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "545dadbe32aa3d9d0edf1d22293783fc", "score": "0.5145775", "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": "94b5532bab91bbaadc2cfbc04474739f", "score": "0.51447207", "text": "def attempts\n doc['attempts'] || 0\n end", "title": "" }, { "docid": "f33a359b5ce868f66eba1131c160e250", "score": "0.51433206", "text": "def update\n @request = current_user.requests.find(params[:id])\n\n respond_to do |format|\n if @request.update_attributes(params[:request])\n format.html { redirect_to requests_url, notice: 'Request was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @request.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e6fc7fc32d45dd610a922a55c22788ef", "score": "0.51389945", "text": "def attempt_params\n params.require(:attempt).permit(:call_id, :url, :http_code, :http_status, :status)\n end", "title": "" }, { "docid": "4ac7eead209cb686e70a6d29c95ff83f", "score": "0.51389456", "text": "def update\n @exam = Exam.find(params[:id])\n\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n format.html { redirect_to(signature_part_exam_url(@signature, @part, @exam), :notice => 'El examen se modifico correctamente..') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exam.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7eeed48e7f05f1ef829e83baf9a334f8", "score": "0.513427", "text": "def update_item(path, body, name)\n resp = session.patch(path, body)\n if resp.is_a?(Net::HTTPOK)\n Chef::Log.info(\"Updated keystone item '#{name}'\")\n else\n raise_error(resp, \"Unable to update item '#{name}'\", \"update_item\")\n end\nend", "title": "" }, { "docid": "07918d5a67562e424f50e841ebcd6a84", "score": "0.51307374", "text": "def put(path , params = {})\n request(:put , path , params)\n end", "title": "" }, { "docid": "4de8d067c151eda0c5d4fabee90dd31d", "score": "0.5120276", "text": "def update_rest\n @item = Item.find(params[:id])\n\n respond_to do |format|\n if @item.update_attributes(params[:item])\n flash[:notice] = 'Item was successfully updated.'\n format.html { redirect_to(@item) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @item.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9193eba34b9ecc98a2ef7c1bb43a6497", "score": "0.51195", "text": "def update\n respond_to do |format|\n if @assertion.update(assertion_params)\n format.html { redirect_to edit_check_path(@assertion.check), notice: 'Assertion was successfully updated.' }\n format.json { render :show, status: :ok, location: @assertion }\n else\n format.html { render :edit }\n format.json { render json: @assertion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dcff644781ff45b7ef0af5b99687d66f", "score": "0.51175106", "text": "def update\n @checkpoint_achievemint = CheckpointAchievemint.find(params[:id])\n\n respond_to do |format|\n if @checkpoint_achievemint.update_attributes(params[:checkpoint_achievemint])\n flash[:notice] = 'CheckpointAchievemint was successfully updated.'\n format.html { redirect_to(@checkpoint_achievemint) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @checkpoint_achievemint.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6fbb1953d7f4d33671bae63c8abbd68a", "score": "0.5111038", "text": "def test_finder_put_fail\n request = Http::Request.new(\n 'PUT',\n '/file2',\n { 'X-Expected-Entity-Length' => '5' },\n ''\n )\n\n response = self.request(request)\n\n assert_equal(403, response.status)\n end", "title": "" }, { "docid": "bb96bab09259313709de4d5029ee2765", "score": "0.51055616", "text": "def put(path, opts = {})\n request(:put, path, opts)\n end", "title": "" }, { "docid": "d40399b92446274a01a28c8d7e3a24c3", "score": "0.51037306", "text": "def update\n redirect_to(exams_url) and return if params['cancel']\n @exam = current_user.organization.exams.find(params[:id])\n\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n flash[:notice] = 'Exam was successfully updated.'\n format.html { redirect_to(destination_given_params(params)) and return }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exam.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "67c32d31d644126b7f224414d4858f3e", "score": "0.50984806", "text": "def renew_put\r\n\t\t\t@instance = current_user.instances.find(params[:id])\r\n\t\t\trender 'renew'\r\n\tend", "title": "" }, { "docid": "193f2ca8d5f1cc4b248587329ea37aa2", "score": "0.5096938", "text": "def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n flash[:notice] = 'Exercise was successfully updated.'\n format.html { redirect_to(:back) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exercise.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f43d79cb8ce757f5e82d8476fd01962", "score": "0.5081166", "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": "" }, { "docid": "db3d74752dde5ec343c34d4f19d039d6", "score": "0.50618434", "text": "def put(path, pwd)\n path = Pathname.new path\n pwd = Pathname.new pwd\n @accounts.each do |acct|\n acct.put path, pwd\n end\n end", "title": "" }, { "docid": "2206059a563b5a0aba4c64f770011604", "score": "0.50549054", "text": "def test_attempt_to_write_nonexistent_id\n post \"/db/simpletest/4\", params = {:test => \"nonexistent\"}\n\n assert_equal 404, last_response.status\n end", "title": "" }, { "docid": "313d43dbee04c45759fc81d18061c56b", "score": "0.5051481", "text": "def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n format.html { redirect_to(@exercise, :notice => 'Exercise was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exercise.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e73139db4bdafe9e0ee1a9dd5a6508a", "score": "0.5049204", "text": "def update\n @exam = Exam.find(params[:id])\n\n if @exam.update!(exam_params)\n render json: @exam, status: :ok\n else\n render json: @exam.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "5596bcf32e2257bd3b9d8db1d090db5c", "score": "0.5047179", "text": "def update\n respond_to do |format|\n if @quiz_attempt.update(quiz_attempt_params)\n format.html { redirect_to @quiz_attempt, notice: 'Quiz attempt was successfully updated.' }\n format.json { render :show, status: :ok, location: @quiz_attempt }\n else\n format.html { render :edit }\n format.json { render json: @quiz_attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5596bcf32e2257bd3b9d8db1d090db5c", "score": "0.5047179", "text": "def update\n respond_to do |format|\n if @quiz_attempt.update(quiz_attempt_params)\n format.html { redirect_to @quiz_attempt, notice: 'Quiz attempt was successfully updated.' }\n format.json { render :show, status: :ok, location: @quiz_attempt }\n else\n format.html { render :edit }\n format.json { render json: @quiz_attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c7d3cd0f218c42e01dbd0246ab7b00c9", "score": "0.5046697", "text": "def put(path, params={}); make_request(:put, host, port, path, params); end", "title": "" }, { "docid": "904d62ab098481a042a804da784b54d2", "score": "0.5045346", "text": "def attempt_params\n params.require(:attempt).permit(:question_id, :student_id, :hit)\n end", "title": "" }, { "docid": "16bb47a59ec25745e565e0e7020053b7", "score": "0.50449705", "text": "def update\n @check = Check.find(params[:id])\n @check.attributes = params[:check]\n\n require \"pp\"\n pp params[:check]\n\n respond_to do |format|\n if @check.switch_inv!(@check.import_time + 1)\n format.html { redirect_to(current_god_checks_path, :notice => 'Reimport finished.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"reimport\" }\n format.xml { render :xml => @check.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e0c598a3697c812a6d367f6fdd01c841", "score": "0.5037767", "text": "def up_score\n @attemp = Attemp.find(params[:id])\n @attemp.correct_answers += 1\n @attemp.total_answers += 1\n @attemp.update_score\n @attemp.save\n redirect_to quiz_path(@attemp.quiz_id) if @attemp.total_answers == 3\n end", "title": "" }, { "docid": "e284838eb3764bbdcd46b86e7d362af2", "score": "0.50369906", "text": "def update\n @exercise = Exercise.find(params[:id])\n\n respond_to do |format|\n if @exercise.update_attributes(params[:exercise])\n flash[:notice] = 'Exercise was successfully updated.'\n format.html { redirect_to(@exercise) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @exercise.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "376770d4daf61e7c7c7d4873be1c38b4", "score": "0.5035724", "text": "def test_should_update_status_post_via_API_JSON\r\n get \"/logout\"\r\n put \"/status_posts/1.json\", :api_key => 'testapikey',\r\n :status_post => {:body => 'API Status Post 1' }\r\n assert_response :success\r\n end", "title": "" }, { "docid": "93116eb1506d7ebe48f06e52969eebf1", "score": "0.5032633", "text": "def create\n @question = Question.find(params[:question_id])\n params[:attempt][:answer] = params[:attempt][:answer].map{|a| a.to_s}.compact.join(\", \")\n params[:attempt][:user_id] = current_user.id\n @attempt = @question.attempts.new(params[:attempt])\n\n respond_to do |format|\n if @attempt.save\n current_user.increment!(:marks_count, @attempt.calculate_score)\n format.html { redirect_to @attempt, notice: 'Attempt was successfully created.' }\n format.json { render json: @attempt, status: :created, location: @attempt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @attempt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f0686f191a0def3b6c3ad6edfbcf2f03", "score": "0.50292563", "text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n )\n end", "title": "" }, { "docid": "47fecb8c247d5e051a50489f2dc72d64", "score": "0.50274897", "text": "def set_attempt\n @attempt = QuizAttempt.find(params[:id])\n end", "title": "" }, { "docid": "cdd95ae9a0eabe9dbfd24975af3e268d", "score": "0.50265586", "text": "def index\n @attempts = Attempt.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @attempts }\n end\n end", "title": "" } ]
90c59a933b824d2757fc69cfd4f1b84e
Function that will print one line according to the selected format
[ { "docid": "f16a4ee3dae834426100ed456a043e2a", "score": "0.0", "text": "def pretty_print(format, separator, hash, commit, line, line_nb, commit_count)\n desc = format.\n gsub(/%Ccommit/, commit[:color]).\n gsub(/%H/, hash).\n gsub(/%h/, hash[0,10]).\n gsub(/%an/, commit[:author]).\n gsub(/%ae/, commit[:author_mail]).\n gsub(/%ad/, commit[:author_time].strftime(\"%d. %b %Y %R\")).\n gsub(/%Cgreen/, \"\\033[32m\").\n gsub(/%Cblue/, \"\\033[34m\").\n gsub(/%L/, line_nb.to_s).\n gsub(/%Cwhite/, \"\\033[37m\").\n gsub(/%BCreset/, \"\\033[0m\")\n\n # Minus 4 for the characters \"%L%M\" that hasn't been replaced yet\n length = desc.length - 4\n\n desc = desc.\n gsub(/%F/, \" \"* (separator - length)).\n gsub(/%M/, line)\n\n # Every commit change switch the background\n if (commit_count % 2 == 0)\n puts \"\\033[40m\" + desc\n else\n puts desc\n end\nend", "title": "" } ]
[ { "docid": "11c25d01f8bd2b890e114b62b8ca8a65", "score": "0.7183405", "text": "def print_linetype_4_helper(line, prefix_format, specline_format, pdf)\n pdf.spec_box \"#{line.txt1.text}.\", prefix_format.merge(:at => [26.mm, pdf.y])\n pdf.spec_box \"#{line.txt4.text}\", specline_format.merge(:at =>[30.mm, pdf.y]) \nend", "title": "" }, { "docid": "aed7815b9fc0f5a4a384db0d4215d0ad", "score": "0.7028222", "text": "def print_linetype_3_helper(line, prefix_format, specline_format, pdf)\n pdf.spec_box \"#{line.txt1.text}.\", prefix_format.merge(:at => [26.mm, pdf.y])\n pdf.spec_box \"#{line.txt4.text}: #{line.txt5.text}\", specline_format.merge(:at =>[30.mm, pdf.y]) \nend", "title": "" }, { "docid": "b7657c0595f5ca3048ed54c89c8d435e", "score": "0.69069904", "text": "def print_linetype_12_helper(line, indent_format, specline_format, pdf)\n pdf.spec_box '-', indent_format.merge(:at => [20.mm, pdf.y]) \n pdf.spec_box \"#{line.txt4.text}: #{line.txt5.text}\", specline_format.merge(:at =>[23.mm, pdf.y]) \nend", "title": "" }, { "docid": "9d7a68d2bc3996e44f86cd0c14870477", "score": "0.6904476", "text": "def print_linetype_7_helper(line, indent_format, specline_format, pdf)\n pdf.spec_box '-', indent_format.merge(:at => [20.mm, pdf.y]) \n pdf.spec_box \"#{line.txt4.text}\", specline_format.merge(:at =>[23.mm, pdf.y]) \nend", "title": "" }, { "docid": "8c5e3e642e3f5058b2d07153030ba038", "score": "0.688705", "text": "def print_linetype_8_helper(line, indent_format, specline_format, pdf)\n pdf.spec_box '-', indent_format.merge(:at => [20.mm, pdf.y]) \n pdf.spec_box \"#{line.txt4.text}: #{line.txt5.text}\", specline_format.merge(:at =>[23.mm, pdf.y]) \nend", "title": "" }, { "docid": "a1d05d77c16df3ee4a4d10c471688e77", "score": "0.68365806", "text": "def print_line( line )\n i = 0\n substr = nil\n index = nil\n while i < line.length\n substr = line[ i..-1 ]\n if @continued_format_class\n close_index, close_match_text = find_closing_match( substr, @close_token_regexps[ @continued_format_class ], i == 0 )\n\n if close_match_text.nil?\n print_string truncate_off_screen( substr, i )\n print_padding_from( line.length )\n i = line.length\n else\n end_index = close_index + close_match_text.length\n print_string truncate_off_screen( substr[ 0...end_index ], i )\n @continued_format_class = nil\n i += end_index\n end\n else\n first_index, first_token_class, first_word = find_opening_match( substr, MATCH_ANY, i == 0 )\n\n if @lang_stack.length > 0\n prev_lang, close_token_class = @lang_stack[ -1 ]\n close_index, close_match_text = find_closing_match( substr, $diakonos.close_token_regexps[ prev_lang ][ close_token_class ], i == 0 )\n if close_match_text and close_index <= first_index\n if close_index > 0\n # Print any remaining text in the embedded language\n print_string truncate_off_screen( substr[ 0...close_index ], i )\n i += substr[ 0...close_index ].length\n end\n\n @lang_stack.pop\n set_language prev_lang\n\n print_string(\n truncate_off_screen( substr[ close_index...(close_index + close_match_text.length) ], i ),\n @token_formats[ close_token_class ]\n )\n i += close_match_text.length\n\n # Continue printing from here.\n next\n end\n end\n\n if first_word\n if first_index > 0\n # Print any preceding text in the default format\n print_string truncate_off_screen( substr[ 0...first_index ], i )\n i += substr[ 0...first_index ].length\n end\n print_string( truncate_off_screen( first_word, i ), @token_formats[ first_token_class ] )\n i += first_word.length\n if @close_token_regexps[ first_token_class ]\n if change_to = @settings[ \"lang.#{@language}.tokens.#{first_token_class}.change_to\" ]\n @lang_stack.push [ @language, first_token_class ]\n set_language change_to\n else\n @continued_format_class = first_token_class\n end\n end\n else\n print_string truncate_off_screen( substr, i )\n i += substr.length\n break\n end\n end\n end\n\n print_padding_from i\n end", "title": "" }, { "docid": "76bed6f3180b122f25489ef985e749c6", "score": "0.6789256", "text": "def print(line)\n end", "title": "" }, { "docid": "615aa3c8e0524945a54037a84ba043e0", "score": "0.67813855", "text": "def print_linetype_11_helper(line, indent_format, specline_format, pdf)\n pdf.spec_box '-', indent_format.merge(:at => [20.mm, pdf.y]) \n pdf.spec_box \"#{line.perform.performkey.text}: #{line.identity.perform.performvalue.full_perform_value}\", specline_format.merge(:at =>[23.mm, pdf.y]) \nend", "title": "" }, { "docid": "3156caf7016a2e63ea4aa04b3d6ebebe", "score": "0.67079765", "text": "def print_linetype_10_helper(line, indent_format, specline_format, pdf)\n pdf.spec_box '-', indent_format.merge(:at => [20.mm, pdf.y]) \n if line.identity.identkey.text == \"Manufacturer\" \n pdf.spec_box \"#{line.identity.identkey.text}: #{line.identity.identvalue.company.company_name}\", specline_format.merge(:at =>[23.mm, pdf.y]) \n else\n pdf.spec_box \"#{line.identity.identkey.text}: #{line.identity.identvalue.identtxt.text}\", specline_format.merge(:at =>[23.mm, pdf.y]) \n end\nend", "title": "" }, { "docid": "fbbc27beb7205dad097939b7481a51d3", "score": "0.66816413", "text": "def print_linetype_1_helper(project, line, specline_format, pdf)\n pdf.move_down(4.mm)\n pdf.spec_box \"#{full_clause_code(project, line)}\", specline_format.merge(:at =>[0.mm, pdf.y]) \n pdf.spec_box \"#{line.clause.clausetitle.text}\", specline_format.merge(:at =>[20.mm, pdf.y]) \nend", "title": "" }, { "docid": "bd6a01a1eaeab39643f509b66b6537bf", "score": "0.66551405", "text": "def format_output(line)\n \"#{number} #{line.chomp}\"\n end", "title": "" }, { "docid": "b9e26282570ee2780d8b6e1e5002e931", "score": "0.6616321", "text": "def output_line(line)\n puts \" <p>#{line}</p>\"\n end", "title": "" }, { "docid": "41d57b7ed61acb5a85ca47f62dc87e4f", "score": "0.65762126", "text": "def format_line(line)\n case line\n when /^-----> / then banner(line.gsub(/^[ >-]{6} /, \"\"))\n when /^>>>>>> / then error(line.gsub(/^[ >-]{6} /, \"\"))\n when /^ / then info(line.gsub(/^[ >-]{6} /, \"\"))\n else info(line)\n end\n end", "title": "" }, { "docid": "3a60105bb4b0f065e2f4ed5509bacd1f", "score": "0.65600467", "text": "def format_line(line)\n case line\n when /^-----> / then banner(line.gsub(/^[ >-]{6} /, ''))\n when /^>>>>>> / then error(line.gsub(/^[ >-]{6} /, ''))\n when /^ / then info(line.gsub(/^[ >-]{6} /, ''))\n else info(line)\n end\n end", "title": "" }, { "docid": "1b3a0cd911dda8918b78e75398a59b87", "score": "0.65256125", "text": "def output_line(line)\n puts line\n end", "title": "" }, { "docid": "1b3a0cd911dda8918b78e75398a59b87", "score": "0.65256125", "text": "def output_line(line)\n puts line\n end", "title": "" }, { "docid": "57db8fb8618db6d48ca87408eff5135e", "score": "0.6488361", "text": "def formatting; end", "title": "" }, { "docid": "6a59cdb334a8e20f5d01deeb6ff25fea", "score": "0.6479039", "text": "def format line\n\twords = line.strip().split(\"\\t\")\n\tif words.length == 2\n\t\texpression = words[0]\n\t\tmeaning = words[1]\n\t\treading = words[0]\n\telse\n\t\texpression = words[0]\n\t\tmeaning = words[2]\n\t\treading = words[1]\n\tend\n\t#puts \"Original: #{line}\"\n\t#puts \"Expression: #{expression}\"\n\t#puts \"Meaning: #{meaning}\"\n\t#puts \"Reading: #{reading}\"\n\treturn \"#{expression}\\t#{meaning}\\t#{reading}\\ty\\ty\"\nend", "title": "" }, { "docid": "43f0dd8ef7a8eac6d29500de95da0282", "score": "0.6469438", "text": "def formatted; end", "title": "" }, { "docid": "43f0dd8ef7a8eac6d29500de95da0282", "score": "0.6469438", "text": "def formatted; end", "title": "" }, { "docid": "ad6b44d3480a21487c203ebfe2dffb9d", "score": "0.64358586", "text": "def format line\n\twords = line.strip().split(\"\\t\")\n\texpression = words[2]\n\tmeaning = words[4]\n\treading = words[3]\n\t#puts \"Original: #{line}\"\n\t#puts \"Expression: #{expression}\"\n\t#puts \"Meaning: #{meaning}\"\n\t#puts \"Reading: #{reading}\"\n\treturn \"#{expression}\\t#{meaning}\\t#{reading}\\ty\\ty\"\nend", "title": "" }, { "docid": "471b292ba9d2fefce5917f8a25beafd8", "score": "0.63468814", "text": "def format line\n\twords = line.strip().split(\"\\t\")\n\tif words.length == 2\n\t\texpression = words[0]\n\t\tmeaning = words[1]\n\t\treading = words[0]\n\telse\n\t\texpression = words[0]\n\t\tmeaning = words[2]\n\t\treading = words[1]\n\tend\n\t#puts \"Original: #{line}\"\n\t#puts \"Expression: #{expression}\"\n\t#puts \"Meaning: #{meaning}\"\n\t#puts \"Reading: #{reading}\"\n\treturn \"#{expression}\\t#{meaning}\\t#{expression}[#{reading}]\"\nend", "title": "" }, { "docid": "31ad5c60ad964696d6abaa8483aac2e1", "score": "0.6337586", "text": "def print_line(line)\n line.each do |value|\n print '|'\n print value.nil? ? ' ' : value.to_s\n end\n print \"|\\n\"\n end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.628538", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.628538", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.628538", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.628538", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.628538", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.628538", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.628538", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.628538", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.628538", "text": "def format; end", "title": "" }, { "docid": "bf77a777425f979cea802eca29bf8316", "score": "0.628538", "text": "def format; end", "title": "" }, { "docid": "762816e37c619efb2f038fc23fe59bbd", "score": "0.6277504", "text": "def format!; end", "title": "" }, { "docid": "4d84e91b11066482f2c6c483512ffa85", "score": "0.62648356", "text": "def display(res, l_n)\n if res.is_a? String\n if check_flag(res)\n puts \"Line #{l_n.get}: #{res}\"\n return\n end\n end\n\n puts res if (res != '' || res.is_a?(Integer)) && !check_flag(res.to_s)\n end", "title": "" }, { "docid": "ff512e5c02fd24e3e4b76dfac5a56dad", "score": "0.6233367", "text": "def print_line\n puts ' - [L] Line'\n puts ' - [N] Line'\n puts ' - [6] Line'\n puts '-=' * 20\n puts ' - [Q] Exit'\n puts '-=' * 20\nend", "title": "" }, { "docid": "eed3c204c47579a996b28ffb033eb754", "score": "0.622965", "text": "def print_fmt( *args )\n return if args.length < 1\n args[0] = format( args[0] )\n return puts( *args )\n end", "title": "" }, { "docid": "855bc3ec3eac08f1514a77e68758158c", "score": "0.622108", "text": "def line(katz_deli=katz_deli)\n output = \"The line is currently\" #this string can be used with both possibilities of \"if\"\n if katz_deli.length == 0\n output += \" empty.\"\n else\n output += \":\"\n for i in 0..katz_deli.length-1 do\n output += \" #{i+1}. #{katz_deli[i]}\"\n end #for\n end #if\n puts output\nend", "title": "" }, { "docid": "4f9c3ad1fca5c952eeb075e0a72b278f", "score": "0.6189052", "text": "def print(line = nil)\r\n if (line == nil)\r\n puts\r\n else\r\n puts line\r\n end\r\n end", "title": "" }, { "docid": "d57b3e0ee6a8c1db3208a6f247a3818c", "score": "0.6170926", "text": "def print_out line\n\tKernel.print \"#{line}\\n\"\nend", "title": "" }, { "docid": "534f7f993e5d0145e7a938e1910da087", "score": "0.6141832", "text": "def singleline_format(output = T.unsafe(nil), _maxwidth = T.unsafe(nil), _newline = T.unsafe(nil), _genspace = T.unsafe(nil)); end", "title": "" }, { "docid": "4d494c11a15b11a77cfbe6a42e4afdef", "score": "0.61199266", "text": "def format\n end", "title": "" }, { "docid": "0d571392835b7fafb8dbdc43e26b7933", "score": "0.6104238", "text": "def pretty_print(print_type)\n return unless print_type == real_type\n print \"#{name}: T=#{total_lines}, I=#{item_count} \"\n print \"B=#{base_lines},\" if type == 'base'\n if real_type == 'base'\n print \" D=#{delete_count}, \"\n print \"M=#{modified_count}, \"\n print \"A=#{added_lines}\"\n end\n puts\n end", "title": "" }, { "docid": "5790e17560629b7baa27da729f898072", "score": "0.60979164", "text": "def format(line_prefix: '// ', first_line: nil, last_line: nil,\n max_line_length: 80)\n return if @text.empty?\n\n yield first_line if first_line\n\n paragraphs(max_line_length - line_prefix.length) do |line|\n yield \"#{line_prefix}#{line}\".rstrip\n end\n\n yield last_line if last_line\n end", "title": "" }, { "docid": "f6af4d207413264819373a603fd094f4", "score": "0.60670906", "text": "def console_print(line)\n end", "title": "" }, { "docid": "7c4bcc0a5da82a0af142a0577dee903d", "score": "0.60619026", "text": "def print_highest_word_frequency_across_lines(format)\n puts format\n end", "title": "" }, { "docid": "cdea6d6fb54bb775ede0bb639c73ca9f", "score": "0.6054284", "text": "def print(line)\n @shell.say(line, nil, true)\n end", "title": "" }, { "docid": "023ac04f54631abb5b13ccf773dbac1e", "score": "0.60355145", "text": "def formatLine(contents)\n\t\tfirst = true\n\t\tdetail = ''\n\t\tcontents.each do |val|\n\t\t\tdetail = detail + \"\\\"\" + val + \"\\\"\" if first\n\t\t\tdetail = detail + \",\" + \"\\\"\" + val + \"\\\"\" if not first\n\t\t\tfirst = false\n\t\tend\n\t\treturn detail\n\tend", "title": "" }, { "docid": "26428a523ec43d8cb099232c25af0351", "score": "0.6023754", "text": "def print\n\t\t# lines\n\t\t(1..@n).each do |i|\n\t\t\tline = \"\"\n\t\t\t# rows of w\n\t\t\t(1..@n).each do |j|\n\t\t\t\tline << printable(get_w(i,j))\n\t\t\t\tline << ' '\n\t\t\tend\n\t\t\tline << '| ' + printable(get_W(i))\n\t\t\tline << '| ' + get_v(i).to_s\n\n\t\t\tputs line\n\t\tend\n\tend", "title": "" }, { "docid": "ad693cc55958e2927f9f57611833b4df", "score": "0.6008379", "text": "def line(*font)\n @io.puts(tag(:hr))\n end", "title": "" }, { "docid": "3cde4c9feecd2692467696ac9b6dd2c2", "score": "0.5996907", "text": "def print_line(length, asterisks)\n case asterisks\n when 1\n puts (\" \" * ((length - asterisks) / 2)) + (\"*\" * asterisks) + (\" \" * ((length - asterisks) / 2))\n else\n puts (\" \" * ((length - asterisks) / 2)) + \"*\" + (\" \" * (asterisks - 2)) + \"*\" + (\" \" * ((length - asterisks) / 2))\n end\nend", "title": "" }, { "docid": "1d20959b8c2b605b107786d70ec47444", "score": "0.59961987", "text": "def format_line(data, o_type)\n case o_type\n when \"annovar\" \n \"chr\" + data.chr + \" \" + data.coor + \" \" + data.coor + \" \" +\n data.ref + \" \" + data.var + \" comments: \"\n when \"ensembl\" # chr2 99554095 99554095 G/A\n \"chr\" + data.chr + \" \" + data.coor + \" \" + data.coor + \" \" +\n data.ref + \"/\" + data.var + \" \" + data.ori\n end\n end", "title": "" }, { "docid": "18091c9d9ab822802d84cb25eef02664", "score": "0.59923565", "text": "def print_line(string)\n print \"#{string}\\n\".white\nend", "title": "" }, { "docid": "44c102065462a88d6fe46b747f6cb251", "score": "0.5979764", "text": "def format(path, text); end", "title": "" }, { "docid": "aecbe3b8521801f05e3b737fb1cfbb8c", "score": "0.5970788", "text": "def f; @formatter end", "title": "" }, { "docid": "944f7aca6880f6dd4f0459798d716f2a", "score": "0.5970198", "text": "def display_output(str, same_line=false)\n same_line ? (print str) : (puts str)\n end", "title": "" }, { "docid": "e2363b1188daaa1911880b4304afdb1d", "score": "0.59568954", "text": "def print_in_same_line(log_string); end", "title": "" }, { "docid": "de9fc45e757792eb590f3798f1d7c93c", "score": "0.59411085", "text": "def output_line\n puts \"=============================================\"\n end", "title": "" }, { "docid": "e6b2eef99af5f764da58397a73c8444f", "score": "0.5934528", "text": "def format_line(line)\n escape(line)\n end", "title": "" }, { "docid": "8a976f8f8a9afb5c719d87ba550c3dce", "score": "0.59279895", "text": "def line\n\tputs \"--------------\"\n\tputs \"Subway lines\"\n\tputs \"N\"\n\tputs \"L\"\n\tputs \"6\"\n\tprint \"Choose which subway line you are going to use: \"\nend", "title": "" }, { "docid": "9a0836f64cafca91193aad9fc225c9d5", "score": "0.59246004", "text": "def smart_printf(opts={})\n printf_template = ''\n # assret its a AoA\n width=self[0].size\n deb width\n for k in (0 .. width-1) # { |k|\n max = self.map{|line| line[k].to_s.length }.max\n deb( [k, max].join(':'))\n printf_template += \"%-#{max}s \"\n end\n printf_template += \"\\n\"\n deb(\"printf_template: #{printf_template}\")\n self.each{ |line| \n puts( printf_template % line ) # [0], line[1]\n }\n end", "title": "" }, { "docid": "866fc97c1ece072139fe83666ebc9d59", "score": "0.59114397", "text": "def insert_text_format; end", "title": "" }, { "docid": "b226d78bc4336097802b6efe88442bbc", "score": "0.591138", "text": "def formatter; end", "title": "" }, { "docid": "b226d78bc4336097802b6efe88442bbc", "score": "0.591138", "text": "def formatter; end", "title": "" }, { "docid": "b226d78bc4336097802b6efe88442bbc", "score": "0.591138", "text": "def formatter; end", "title": "" }, { "docid": "9464faac9f5f859d53218357b63ddb2c", "score": "0.5887918", "text": "def printFormatted(a,more=true)\n if more\n puts \"ID : #{a[APT_ID]}\"\n puts \"IATA : #{a[APT_IATA]}\"\n puts \"ICAO : #{a[APT_ICAO]}\"\n puts \"City : #{a[APT_CITY]}\"\n puts \"Desc : #{a[APT_DESC]}\"\n puts \"Region : #{a[APT_REG]}\"\n puts \"Runways : #{a[APT_RWYS]}\"\n puts \"Longest : #{fmtsep(a[APT_LONG])} (ft)\"\n puts \"Elevation : #{fmtsep(a[APT_ELEV])} (ft)\"\n puts \"Country : #{a[APT_CTRY]}\"\n puts \"Continent : #{a[APT_CONT]}\"\n puts \"Latitude : #{a[APT_LAT]}\"\n puts \"Longitude : #{a[APT_LON]}\"\n else\n printf \"%4s, %s, %s, %s, %s, %s, %s\\n\",a[0],a[1],a[2],a[4],a[3],a[5],a[9]\n end\n end", "title": "" }, { "docid": "2b8546ebac55b2f2e16e77a2e31ae03f", "score": "0.5880361", "text": "def formats; end", "title": "" }, { "docid": "2b8546ebac55b2f2e16e77a2e31ae03f", "score": "0.5880361", "text": "def formats; end", "title": "" }, { "docid": "9f5267afbb98714dd78fe4f7c7667bbd", "score": "0.5868967", "text": "def print_line(line, to_outfile)\n if to_outfile\n @outfile.syswrite(\"#{line}\")\n else\n print \"#{line}\"\n end\n end", "title": "" }, { "docid": "36fdaa05c155098dab81711e47c34f30", "score": "0.5852953", "text": "def format\n end", "title": "" }, { "docid": "fe29a8bee0c0129faa38b293cf072b5f", "score": "0.582999", "text": "def print_line(time, line)\n if time.nil?\n puts line\n else\n puts \"#{time.strftime('%I:%M')} #{line}\"\n end\nend", "title": "" }, { "docid": "ce4af37820e5b21f48df3bb9bba3c516", "score": "0.58220553", "text": "def line(a, b, c)\n\t\tputs \" \" * 3 + \"|\" + a + \"|\" + \" \" * 2 + \" .\" + \" \" * 3 + \"|\" + b + \"|\" + \" \" * 2 + \" .\" + \" \" * 3 + \"|\" + c + \"\" \" \" * 2\n\tend", "title": "" }, { "docid": "1a3de0ebc9276c6e9c40cb3389134fc7", "score": "0.58168936", "text": "def format\n text\n end", "title": "" }, { "docid": "ea68b6b8048003d3224b3822c42ff3ac", "score": "0.5816805", "text": "def line\n puts \"-------------------------------------------------\"\n end", "title": "" }, { "docid": "a7c832c912b703880093e806db314c70", "score": "0.5803999", "text": "def write_line(line = \"\")\n puts(line)\n end", "title": "" }, { "docid": "52ede2dfc491bdea497019b18514200f", "score": "0.580167", "text": "def print_empty_line; end", "title": "" }, { "docid": "1f30d589c23b7e44815b37879ecd814b", "score": "0.5799781", "text": "def do_line(line)\n\t\tend", "title": "" }, { "docid": "ba39298ffcf6d0bbcb1b724661725338", "score": "0.5798446", "text": "def format_line(l)\n s = l\n s.gsub!(/ +\\(/, '(') unless s =~ /\\A\\s*\\/\\/|copyright|\\A#/i\n %w{if for while switch do}.each do |c|\n s.gsub!(/#{c}\\(/, \"#{c} (\")\n end\n s.gsub!(/\\/\\/!</, '//')\n s.gsub!(/\\}else/, '} else')\n s.gsub!(/else\\{/, 'else {')\n s.gsub!(/\\(\\s+/, '(')\n s.gsub!(/ +\\)/, ')')\n s.gsub!(/\\s\\[/, '[')\n s.gsub!(/\\[\\s+/, '[')\n s.gsub!(/\\s+\\]/, ']')\n s.gsub!(/\\)\\{/, ') {')\n s.gsub!(/\\s+\\z/, '')\n s.gsub!(/([^\\s])\\s+;/, '\\1;')\n s.gsub!(/\\A +\\t/, \"\\t\")\n s.gsub!(/([^\\s\\/])\\s?\\/\\//, '\\1 //')\n s.gsub!(/\\/\\/([^ \\/])/, '// \\1')\n s.gsub!(/,([^\\s])/, ', \\1')\n s.gsub!(/([^ ])(\\&\\&|\\|\\|)/, '\\1 \\2')\n s.gsub!(/(\\&\\&|\\|\\|)([^ ])/, '\\1 \\2')\n s.gsub!(/([^\\s=!<>\\|\\+\\-\\*\\/\\&\\^])=/, '\\1 =') unless s =~ /'[^=]*=[^=]*'|\"[^=]*=[^=]*\"/\n s.gsub!(/=([^\\s=])/, '= \\1') unless s =~ /'[^=]*=[^=]*'|\"[^=]*=[^=]*\"/\n s.gsub!(/([^\\s])\\{/, '\\1 {')\n s.gsub!(/\\}([^\\s,;])/, '} \\1')\n s\nend", "title": "" }, { "docid": "809f2146b28653acff6c4a5f6fceda24", "score": "0.5795794", "text": "def print\n status = \"\"\n puts \"-\" * LINE_WIDTH\n puts \"#{@label.upcase}\".center(LINE_WIDTH)\n # puts $line\n puts \"-\" * LINE_WIDTH\n # puts \"Index | Item | Deadline\"\n puts \"#{'Index'.ljust(INDEX_COL_WIDTH)} | #{'Item'.ljust(ITEM_COL_WIDTH)} | #{'Deadline'.ljust(DEADLINE_COL_WIDTH)} | Done\"\n # puts $line\n puts \"-\" * LINE_WIDTH\n @items.each.with_index do |item, i|\n # puts \"#{i}\".ljust(6) + $sep + \"#{item.title}\".ljust(21) + $sep + \"#{item.deadline}\"\n item.done ? status = \"[✓]\" : status = \"[ ]\"\n puts \"#{i.to_s.ljust(INDEX_COL_WIDTH)} | #{item.title.ljust(ITEM_COL_WIDTH)} | #{item.deadline.ljust(DEADLINE_COL_WIDTH)} | #{status}\"\n end\n # puts $line\n puts \"-\" * LINE_WIDTH\n end", "title": "" }, { "docid": "f76cfc0d04fd7c031ad64826fbd125b2", "score": "0.5794628", "text": "def process line\n case\n when (line =~ START_OF_RECORD)\n puts \"\\n!!!#{in_record.inspect}\\n\" if self.in_record\n line.gsub!(/^\\s+/,'')\n print line.chomp\n self.in_record = true\n when (line =~ END_OF_RECORD)\n puts line\n self.in_record = false\n else\n print(line.chomp, '&#10;') if self.in_record\n end\n end", "title": "" }, { "docid": "55806972ed6e9d33ada3fa8d4510c867", "score": "0.57907695", "text": "def line\n \"#{@name},b,#{@cal}\"\n end", "title": "" }, { "docid": "5d1ed688c7633bedc17f56565ccab01c", "score": "0.57795894", "text": "def display(line, column=0) #:yield:\n result = \"\\e[s\"\n result << \"\\e[#{line.to_i};#{column.to_i}H\"\n if block_given?\n result << yield\n result << \"\\e[u\"\n #elsif string\n # result << string\n # result << \"\\e[u\"\n end\n result\n end", "title": "" }, { "docid": "e87b82e0583f4935f5ba507498482133", "score": "0.5778893", "text": "def line\n puts \"#######################################################\"\nend", "title": "" }, { "docid": "da15da6820aa0d4c80caf68fbe05c880", "score": "0.5778058", "text": "def print_by_line(card, line)\n case card.color\n when 0\n color = :red\n when 1\n color = :blue\n when 2\n color = :green\n else\n\n end\n \n case card.shape\n when 0\n case line\n when 1, 8\n print(Paint[\"_________________\", color])\n when 2, 3, 4, 6, 7\n print(Paint[\"|\", color])\n shading(card, 15, color)\n print(Paint[\"|\", color])\n when 5\n print(Paint[\"| #{card.number} |\", color])\n else\n\n end\n\n when 1\n case line\n when 1\n print(Paint[\" /\\\\ \", color])\n when 2\n print(Paint[\" /\", color])\n shading(card, 2, color)\n print(Paint[\"\\\\ \", color])\n when 3\n print(Paint[\" /\", color])\n shading(card, 4, color)\n print(Paint[\"\\\\ \", color])\n when 4\n print(Paint[\" /\", color])\n shading(card, 6, color)\n print(Paint[\"\\\\ \", color])\n when 5\n print(Paint[\" /\", color])\n shading(card, 8, color)\n print(Paint[\"\\\\ \", color])\n when 6\n print(Paint[\" / #{card.number} \\\\ \", color])\n when 7\n print(Paint[\" /\", color])\n shading(card, 12, color)\n print(Paint[\"\\\\ \", color])\n when 8\n print(Paint[\"/______________\\\\ \", color])\n else\n\n end\n\n when 2\n case line\n when 1\n print(Paint[\" __________ \", color])\n when 2\n print(Paint[\" /\", color])\n shading(card, 10, color)\n print(Paint[\"\\\\ \", color])\n when 3\n print(Paint[\" /\", color])\n shading(card, 12, color)\n print(Paint[\"\\\\ \", color])\n when 4\n print(Paint[\"/\", color])\n shading(card, 14, color)\n print(Paint[\"\\\\ \", color])\n when 5\n print(Paint[\"| #{card.number} | \", color])\n when 6\n print(Paint[\"\\\\\", color])\n shading(card, 14, color)\n print(Paint[\"/ \", color])\n when 7\n print(Paint[\" \\\\\", color])\n shading(card, 12, color)\n print(Paint[\"/ \", color])\n when 8\n print(Paint[\" \\\\__________/ \", color])\n end\n else\n\n end\n\n end", "title": "" }, { "docid": "7de64713d8e1c55c1effdaec8d32f2c2", "score": "0.5776738", "text": "def print_line(time, line)\n if time.nil?\n puts line\n else\n puts \"#{time.strftime('%H:%M')} #{line}\"\n end\nend", "title": "" }, { "docid": "51cd9170e92e1f474098a7ba300d6fb2", "score": "0.57706136", "text": "def block_format(text); end", "title": "" }, { "docid": "cea392615d30e298de4ae072d3b36eea", "score": "0.57628095", "text": "def line_chooser(which_line)\n\tn_stops = \"Times Square(ts), 34th(34th-n), 28th(28th-n), 23rd(23rd-n), Union Square(us), 8th(8th-n)\"\n\tl_stops = \"8th(8th-l), 6th(6th), Union Square(us), 3rd(3rd), 1st(1st)\"\n\ts_stops = \"Grand Central(gc), 33rd(33rd), 28th(28th-s), 23rd(23rd-s), Union Square(us), Astor(a)\"\n\tcase which_line\n\twhen :n\n\t\tputs n_stops\n\twhen :l\n\t\tputs l_stops\n\twhen :s\n\t\tputs s_stops\n\telse\n\t\tputs \"That's not a line!\"\n\tend\nend", "title": "" }, { "docid": "63c779aa3dc35b9a9796f03940c7cc65", "score": "0.5754997", "text": "def output_format; end", "title": "" }, { "docid": "a7ef075b19062e7c92edc648900c5d84", "score": "0.57442", "text": "def line_sep(title=nil); print \"\\n#{title} ----\\n\\n\"; end", "title": "" }, { "docid": "a7ef075b19062e7c92edc648900c5d84", "score": "0.57442", "text": "def line_sep(title=nil); print \"\\n#{title} ----\\n\\n\"; end", "title": "" }, { "docid": "ade8853cea7ddd0d19cdb9fb07909987", "score": "0.5740263", "text": "def print_line(obj=\"\")\n string = obj.to_s\n\n string = truncate_to_console_width(string) if console_width\n string = strip_ascii_color(string) unless color_enabled?\n\n write(string + \"\\n\")\n output.flush\n end", "title": "" }, { "docid": "3f748f4a1a658a465e8ef8b5c9870465", "score": "0.5740194", "text": "def newline_before_multiline_output?; end", "title": "" }, { "docid": "326707d5a1a3e0181975138da6434b73", "score": "0.5738533", "text": "def output(line)\n\tmatch = $command.match(line) \n\tif(match)\n\t process_command(line,match)\n\tend\n\n\tif(match)\n\t \tputs line\n\telsif($old_line =~ line)\n\t\tln = $old_ln.shift\n\t\tputs \"< #{$old_index[ln]}\"\n\telsif($new_line =~ line)\n\t\tln = $new_ln.shift\n\t\tputs \"> #{$new_index[ln]}\"\n\telsif($divider =~ line)\n\t\tputs line\n\tend\t\nend", "title": "" }, { "docid": "ea49a1bce718325a90912f43095f3e3a", "score": "0.57330155", "text": "def format_type(text, type1)\n code1 = COLOUR_CODE[type1.to_sym]\n puts \"\\e[#{code1}m#{text}\\e[0m\"\nend", "title": "" }, { "docid": "355769bc6b20f73a027b8edb048e2d27", "score": "0.5730654", "text": "def print_line( str = '', unmute = false )\n return if only_positives?\n return if muted? && !unmute\n\n # We may get IO errors...freaky stuff...\n begin\n puts str\n rescue\n end\n end", "title": "" }, { "docid": "4e93bab0977fd7b3e5e1b108d83ea03f", "score": "0.57282114", "text": "def print_line(num, chars, iter, cols)\n \n # First iter, just print num as a binary\n if iter == 0\n #puts \"num #{num} iter #{iter}\"\n puts (\"%0#{chars}b\" % num).gsub(\"1\", FILLED_CHAR).gsub(\"0\", EMPTY_CHAR).center(cols)\n return num\n end\n\n # special case, num = 0\n if num == 0\n puts (EMPTY_CHAR * chars).center(cols)\n return 0\n end\n\n # shift it twice to get two trailing zeros\n num = num << 2\n\n # track return value\n ret = 0\n\n # calculate and print the line\n line = \"\"\n (0..chars-1).each do |count|\n # mask off everything but the last three bits to get\n # the index into the rule_map\n idx = num & 7\n if @rule_map[idx] == 1\n line << FILLED_CHAR\n ret += 2 ** count\n else\n line << EMPTY_CHAR\n end\n # Shift to the next position\n num = num >> 1\n end\n\n # Reverse the line and print it centered\n puts line.reverse.center(cols)\n\n # Return the value of the current line\n return ret\n end", "title": "" }, { "docid": "85ebb2c8d6bf40dd67ef65d150f7e5b5", "score": "0.5724915", "text": "def line(katz_deli)\t\n\tif katz_deli.size == 0 \n \t \tputs \"The line is currently empty.\"\n \telse\n\t\tstring = \"The line is currently:\" \n\t\tkatz_deli.each_with_index do |person, index|\n\t\t\tindex+=1\n\t\t\tstring += \" #{index}. #{person}\"\n\t\tend\n\t\tputs string\n\tend\nend", "title": "" }, { "docid": "8cc00f76b512254e817bc2e76fe7db16", "score": "0.5724561", "text": "def line(someone) \n cur_line = \"The line is currently:\" \n someone.each.with_index(1) do |num, name|\n cur_line << \" #{name}. #{num}\"\n end\n someone.length < 1 ? (puts \"The line is currently empty.\") : (puts cur_line)\nend", "title": "" }, { "docid": "059ebb0e32a688998a0c79e06307c942", "score": "0.5722876", "text": "def pprint\n (0..19).each do |y|\n line = (0..19).map do |x|\n stone = get(x, y)\n if stone.nil?\n '.'\n else\n stone.color == 0 ? 'b' : 'w'\n end\n end.join\n puts line\n end\n end", "title": "" }, { "docid": "f739b874c94fd311190b982372166ebf", "score": "0.5720403", "text": "def print_line(line = \"\", color = :green)\n case color\n when :green\n $win.color_set(1)\n when :cyan\n $win.color_set(2)\n when :white\n $win.color_set(3)\n end\n\n $win.setpos($win.cury, 0)\n $win.deleteln\n $win.addstr(line + \"\\n\")\n\n $win.color_set(1)\nend", "title": "" }, { "docid": "4ffabaf840310498afbd67a07cfdec5c", "score": "0.5710491", "text": "def show_line(length = 70)\n puts \"-\" * length\nend", "title": "" } ]
077e5a3af650ffe53812099d2eefa1ac
Public: Initialize a new ip address object ip_address The ip address socket_type The address familly of this ip address. Socket::AF_INET for ip v4 Socket::AF_INET6 for ip v6 Examples IpLookUp.new("192.168.0.1", Socket::AF_INET) IpLookUp.new("ff02::1", Socket::AF_INET6) Returns the object
[ { "docid": "cf5db9197ad569a36216120addbf5cc9", "score": "0.7629243", "text": "def initialize(ip_address, socket_type)\n @ip_address = IPAddr.new(ip_address, socket_type)\n end", "title": "" } ]
[ { "docid": "c364de75bb0672f1367bb167744218e5", "score": "0.6994686", "text": "def find_for_ip(string)\n begin\n ip = IPAddr.new(string)\n type = ip.ipv4? ? TYPE_IPV4 : TYPE_IPV6\n _definitions(type).each do |_, definition|\n return factory(type, *definition) if IPAddr.new(definition.first).include?(ip)\n end\n rescue ArgumentError\n # continue\n nil\n end\n raise AllocationUnknown, \"IP Allocation for `#{string}' unknown\"\n end", "title": "" }, { "docid": "8faf6ab3793810e5af4c0aa61657b1c1", "score": "0.675655", "text": "def initialize(params = {})\n @ip = params[:ip] ||\n Socket.getaddrinfo(params[:address], params[:protocol])[0][3]\n end", "title": "" }, { "docid": "8faf6ab3793810e5af4c0aa61657b1c1", "score": "0.675655", "text": "def initialize(params = {})\n @ip = params[:ip] ||\n Socket.getaddrinfo(params[:address], params[:protocol])[0][3]\n end", "title": "" }, { "docid": "423ee1ec31bd00be0bfb4ecc4dee9d73", "score": "0.66547745", "text": "def ip\n @ip ||= select { |type,value| type == :ip }.map do |(type,value)|\n IPAddr.new(value)\n end\n end", "title": "" }, { "docid": "5a4382f56aeb0a936366c713c053a87e", "score": "0.6260015", "text": "def initialize(arg = nil, addr: nil, binary: nil, **args)\n\n @net_class = IPv6Net\n\n if arg\n if arg.kind_of?(Integer)\n @addr = arg\n elsif arg.respond_to?(:to_ipv6addr)\n @addr = arg.to_ipv6addr.to_i\n elsif defined?(::IPAddr) && arg.kind_of?(::IPAddr)\n @addr = arg.to_i\n elsif arg.respond_to?(:to_s)\n addr = arg.to_s\n addr = $1 if addr =~ /^\\[(.*)\\]$/i\n\n case addr\n when ''\n raise ArgumentError, 'empty address'\n when /^::ffff:(\\d+\\.\\d+\\.\\d+\\.\\d+)$/i\n @addr = IPv4Addr.new($1).to_i | 0xffff00000000\n when /^::(\\d+\\.\\d+\\.\\d+\\.\\d+)$/i\n @addr = IPv4Addr.new($1).to_i\n when /[^0-9a-f:]/i\n raise FormatNotRecognized, \"#{addr.inspect}: invalid character(s)\"\n when /::.*::/\n raise FormatNotRecognized, \"#{addr.inspect}: multiple zero compressions\"\n when /:::/\n raise FormatNotRecognized, \"#{addr.inspect}: invalid format\"\n when /^(.*)::(.*)$/\n addr, right = $1, $2\n\n l = addr.split(':')\n r = right.split(':')\n rest = 8 - l.size - r.size\n\n @addr = (l + Array.new(rest, '0') + r).inject(0) { |i, s| i << 16 | s.hex }\n else\n @addr = addr.split(':').inject(0) { |i, s| i << 16 | s.hex }\n end\n else\n raise ArgumentError, \"Cannot initialize from #{arg.inspect}\"\n end\n else\n if addr\n initialize(addr, **args)\n elsif binary\n raise FormatNotRecognized, \"Size not equal to 16 octets\" if binary.length != 16\n\n @addr = binary.unpack('N4').inject(0) { |i, x| (i << 32) + x }\n else\n raise ArgumentError, 'Neither addr or binary specified'\n end\n\n end\n\n freeze\n end", "title": "" }, { "docid": "243752c97e612b864b79b5c680fb7e44", "score": "0.62568635", "text": "def IPAddress(str)\n IPAddress::parse str\nend", "title": "" }, { "docid": "243752c97e612b864b79b5c680fb7e44", "score": "0.62568635", "text": "def IPAddress(str)\n IPAddress::parse str\nend", "title": "" }, { "docid": "a5c429e5c148aedba0481dfda2f88b2c", "score": "0.62288433", "text": "def ip\n ip = nil\n\n unless valid?\n return nil\n end\n\n begin\n case name\n when /\\.in-addr\\.arpa$/\n name_without_suffix = name.sub(/\\.in-addr\\.arpa$/, '')\n quads = name_without_suffix.split('.')\n if quads.size == 4\n quads.reverse!\n ip = quads.join('.')\n end\n when /\\.ip6\\.arpa$/\n name_without_suffix = name.sub(/\\.ip6\\.arpa$/, '')\n nibbles = name_without_suffix.split('.')\n nibbles.each do |nibble|\n if nibble.empty?\n raise DnsRecord::EmptyNibbleError\n end\n end\n if nibbles.size == 32\n n = nibbles.reverse!\n ip = \\\n n[0..3].join('') + \":\" +\n n[4..7].join('') + \":\" +\n n[8..11].join('') + \":\" +\n n[12..15].join('') + \":\" +\n n[16..19].join('') + \":\" +\n n[20..23].join('') + \":\" +\n n[24..27].join('') + \":\" +\n n[28..31].join('')\n \n ip = NetAddr::CIDR.create(ip).ip(:Short => true)\n end\n end\n rescue DnsRecord::EmptyNibbleError\n ip = nil\n end\n\n ip\n end", "title": "" }, { "docid": "f0d40f66be397c31d2afbb17d2c36de3", "score": "0.6218752", "text": "def get_ip_address(type)\n network[:interfaces].each do |iface, info|\n next unless info['type'] == 'eth'\n info[:addresses].each do |addr, detail|\n next unless detail['family'] == 'inet'\n case type\n when :public_ip\n return addr if !is_private?(addr)\n when :private_ip\n return addr if is_private?(addr)\n end\n end\n end\n return nil\n end", "title": "" }, { "docid": "f3fde8d27d7a526995e3f6734f75c288", "score": "0.61567396", "text": "def first\n IPAddr.new(@addr & @mask_addr, @family)\n end", "title": "" }, { "docid": "3f7c4eb70c86f7c65733ca0353911788", "score": "0.6114779", "text": "def initialize(ip, netmask=nil, tag={}, wildcard_mask=nil, wildcard_mask_bit_flipped=false)\n @ip = ip\n\n if ( self.kind_of?(NetAddr::CIDRv4) )\n @version = 4\n @address_len = 32\n else\n @version = 6\n @address_len = 128\n end\n @all_f = 2**@address_len - 1\n\n if (netmask)\n @netmask = netmask\n else\n @netmask = 2**@address_len - 1\n end\n\n @network = (@ip & @netmask)\n @hostmask = @netmask ^ @all_f\n @tag = tag\n\n if (!wildcard_mask)\n @wildcard_mask = @netmask\n else\n @wildcard_mask = wildcard_mask\n @wildcard_mask = ~@wildcard_mask if (wildcard_mask_bit_flipped)\n end\n\n end", "title": "" }, { "docid": "94afdde1701096ba3e64bbce8482ba5c", "score": "0.6073652", "text": "def hiqnet_address\r\n address ||= OpenStruct.new(\r\n node: 0x1002,\r\n virtual_device: 0x03,\r\n object: 0x000147,\r\n sv: 0x0000\r\n ).tap do |o|\r\n o.define_singleton_method(:to_a) {\r\n [\r\n node >> 8 & 0xFF, node & 0xFF,\r\n virtual_device,\r\n object >> 16 & 0xFF, object >> 8 & 0xFF, object & 0xFF,\r\n sv >> 8 & 0xFF, sv & 0xFF\r\n ]\r\n }\r\n end\r\nend", "title": "" }, { "docid": "ca6d3234dbaec6b00aa4e10b8f08e201", "score": "0.6070478", "text": "def get_ip_addresses\n sa = MainSettings.instance\n begin\n s = UDPSocket.new(Socket::AF_INET)\n s.connect(\"8.8.8.8\", 1)\n if (s.addr[0] == \"AF_INET\")\n @ipv4 = IPAddr.new(s.addr.last)\n end\n rescue SocketError => e\n $stderr.puts \"Unable to determine IPv4 address: #{e}\"\n rescue Errno::ENETUNREACH => e\n $stderr.puts \"Unable to determine IPv4 address: #{e}\"\n end\n puts \"Finished acquiring IPv4 address\" if $verbose\n\n# begin\n# s = UDPSocket.new(Socket::AF_INET6)\n# s.connect(\"2001:4860:b006::2\", 1)\n# if (s.addr[0] == \"AF_INET6\")\n# @ipv6 = IPAddr.new(s.addr.last)\n# end\n# rescue SocketError => e\n# $stderr.puts \"Unable to determine IPv6 address: #{e}\"\n# rescue Errno::ENETUNREACH => e\n# $stderr.puts \"Unable to determine IPv6 address: #{e}\"\n# end\n# puts \"Finished acquiring IPv6 address\" if $verbose\n end", "title": "" }, { "docid": "eb2a320f1c0b80464277bd02f9feec76", "score": "0.60639584", "text": "def ip\n orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true # turn off reverse DNS resolution temporarily\n UDPSocket.open do |s|\n s.connect '64.233.187.99', 1\n s.addr.last\n end\n ensure\n Socket.do_not_reverse_lookup = orig\n end", "title": "" }, { "docid": "73302b84c763f2535e907a001d0951e9", "score": "0.6061194", "text": "def abs_adr(ip)\n Verneuil::Address.new(ip, self)\n end", "title": "" }, { "docid": "549b3c582b547d287c2e516bceba9946", "score": "0.6053981", "text": "def address_for(network); end", "title": "" }, { "docid": "013565efbabde1904bbac90f9f7c927e", "score": "0.60496676", "text": "def ipv6_init (ip)\n @ip = IPAddr.new ip\n @server = server_ipv6\n end", "title": "" }, { "docid": "b17a8bd9e4e92a27f46578d2a92ea77b", "score": "0.6037832", "text": "def get_internal_ip_address\r\n sock = UDPSocket.new\r\n sock.connect('1.0.0.1', 1) #@igd_location.split('//').last.split('/').first.split(':').first\r\n return sock.addr.last\r\n rescue Exception\r\n return \"127.0.0.1\"\r\n end", "title": "" }, { "docid": "8735d89eb04416d903543ba6a800a159", "score": "0.6033819", "text": "def &(in_ip)\n raise RuntimeError, \"Can not compare IPV4 with IPV6!\" if @version != in_ip.version\n Ip.new(@ip_int & in_ip.to_i, @version)\n end", "title": "" }, { "docid": "50ff3fd1e1a3e81e2639a21c2b162800", "score": "0.6028007", "text": "def ip(options=nil)\n known_args = [:Objectify, :Short]\n objectify = false\n short = false\n\n if (options)\n if (!options.kind_of?(Hash))\n raise ArgumentError, \"Expected Hash, but \" +\n \"#{options.class} provided.\"\n end\n NetAddr.validate_args(options.keys,known_args)\n\n if( options.has_key?(:Short) && options[:Short] == true )\n short = true\n end\n\n if( options.has_key?(:Objectify) && options[:Objectify] == true )\n objectify = true\n end\n end\n\n\n if (!objectify)\n ip = NetAddr.ip_int_to_str(@ip, @version)\n ip = NetAddr.shorten(ip) if (short && @version == 6)\n else\n ip = NetAddr.cidr_build(@version,@ip)\n end\n\n return(ip)\n end", "title": "" }, { "docid": "3aa9b4e7b865cafdca408feff20a3508", "score": "0.60234416", "text": "def ipaddr; end", "title": "" }, { "docid": "b6492b3be3d92b6a5800e378d912cfe5", "score": "0.59856", "text": "def get_ip_address(name, eth)\n if eth_iface = network[:interfaces][eth]\n eth_iface[:addresses].each do |key, info|\n jpc2[name] = key if info['family'] == 'inet'\n end\n end\nend", "title": "" }, { "docid": "37675d76f63459aad27e82e7206a81fd", "score": "0.5982863", "text": "def to_ipaddr\n unless ip_addr?\n lookup = `host #{to_s} | grep address`.split(/\\s+/)\n return to_s unless lookup.length == 4\n lookup[3]\n else \n to_s\n end\n end", "title": "" }, { "docid": "71ec1f665412b6ceac39c6389703a237", "score": "0.5973145", "text": "def detect_ipvers(address)\n if address =~ /^\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}\\.\\d{1,3}/\n :ipv4\n elsif address =~ /\\h{0,4}::?\\h{1,4}/i\n :ipv6\n else\n nil\n end\n end", "title": "" }, { "docid": "f9e6a6591d7caffc49b7650352f743d4", "score": "0.5967608", "text": "def ipaddr?; end", "title": "" }, { "docid": "798bfe6174ff7a98645c2aadf1c14117", "score": "0.5950508", "text": "def ip\n if ifconfig =~ /inet addr:([0-9.]+)/\n $1\n else\n \"0.0.0.0\"\n end\n end", "title": "" }, { "docid": "d140638dadfe448205bc26ec2d0b27b3", "score": "0.5920295", "text": "def init(s1, ip)\n @mf = MessageFormat.new\n @node_socket = s1\n @this_ip = ip\n puts ip\n if ip !~ /\\b(?:[0-9]{1,3}\\.){3}[0-9]{1,3}:[0-9]{1,6}\\b/\n raise TypeError, 'Please use an IP address in the format of IP:PORT'\n end\n end", "title": "" }, { "docid": "836f61e32d3edb286a81647c539e95b9", "score": "0.58790857", "text": "def device_ipaddress=(_arg0); end", "title": "" }, { "docid": "836f61e32d3edb286a81647c539e95b9", "score": "0.58790857", "text": "def device_ipaddress=(_arg0); end", "title": "" }, { "docid": "55a95e0b192b9e6f72e8f984ccd2b10f", "score": "0.58781266", "text": "def typecast_value_ipaddr(value)\n case value\n when IPAddr\n value\n when String\n IPAddr.new(value)\n else\n raise Sequel::InvalidValue, \"invalid value for inet/cidr: #{value.inspect}\"\n end\n end", "title": "" }, { "docid": "55a95e0b192b9e6f72e8f984ccd2b10f", "score": "0.58781266", "text": "def typecast_value_ipaddr(value)\n case value\n when IPAddr\n value\n when String\n IPAddr.new(value)\n else\n raise Sequel::InvalidValue, \"invalid value for inet/cidr: #{value.inspect}\"\n end\n end", "title": "" }, { "docid": "117cf3377808c9d1b86d5a828c583430", "score": "0.58684963", "text": "def lookup(ip)\n uri = Addressable::URI.parse(\"https://ip-api.com/xml/#{ip}\")\n res = Net::HTTP.get_response(uri.normalize)\n MetaData.parse(res.body, single: true).freeze\n end", "title": "" }, { "docid": "6a36c22e03afcee760b3b51400822e3a", "score": "0.5860506", "text": "def initialize(in_ip, in_v=4)\n \n if in_ip.is_a?(String)\n @version = Ip.version(in_ip)\n @ip_string = in_ip\n elsif in_ip.is_a?(Integer)\n if in_ip > Ip::IPMAX_V4\n @version = 6\n else\n @version = in_v\n end\n @ip_string = Iptools.i_to_dots(in_ip, @version)\n else\n raise RuntimeError, \"Invalid IP addresse #{in_ip} (should be a string or an interger)\"\n end\n \n @dots = Ip.valid?(@ip_string, @version)\n \n raise RuntimeError, \"Invalid IP addresse #{in_ip}\" if (@dots.nil?)\n @ip_int = to_i\n end", "title": "" }, { "docid": "f7d3b814122a3efbdb05137c138c6cdb", "score": "0.58337015", "text": "def addr(address, type = 1)\n Label.new address, type\n end", "title": "" }, { "docid": "fee9153641b07723d405209f1ca8d754", "score": "0.58273846", "text": "def addr\n return @addr if @addr\n @addr = P::Addr.new\n @addr.time, @addr.service, @addr.ip, @addr.port =\n Time.now.tv_sec, @version.services, @host, @port\n @addr\n end", "title": "" }, { "docid": "3a2042913d3ae8f8686af144e9e74abc", "score": "0.5800222", "text": "def address(public_ip)\n addresses(public_ip)[0]\n end", "title": "" }, { "docid": "22e0a097fc11c012a4630ac292a6f0f9", "score": "0.5798909", "text": "def initialize(*args)\n options = args.first.is_a?(Hash) ? args.first : {}\n @result = self.class.get('/get_xml.php', query: options)[\"HostipLookupResultSet\"][\"featureMember\"][\"Hostip\"]\n end", "title": "" }, { "docid": "7a18a266abcc164eaf4b378f1d3b41bc", "score": "0.5784434", "text": "def from_string(value)\n const_get(value)\n rescue NameError\n IpProtocol.send(:new, 'UNKNOWN', value)\n end", "title": "" }, { "docid": "93ab2b3aa9cecf44f67435947015b694", "score": "0.57772064", "text": "def parse_addr(string)\n # Split host and port number from string.\n case string\n when /\\A\\[(?<address> .* )\\]:(?<port> \\d+ )\\z/x # string like \"[::1]:80\"\n address, port = $~[:address], $~[:port]\n when /\\A(?<address> [^:]+ ):(?<port> \\d+ )\\z/x # string like \"127.0.0.1:80\"\n address, port = $~[:address], $~[:port]\n else # string with no port number\n address, port = string, nil\n end\n\n # Pass address, port to Addrinfo.getaddrinfo. It will raise SocketError if address or port is not valid.\n # IPAddr currently cannot handle ::1 notation, use Addrinfo instead\n ary = Addrinfo.getaddrinfo(address, port)\n\n # An IP address is exactly one address.\n ary.size == 1 or raise SocketError, \"expected 1 address, found #{ary.size}\"\n ary.first\nend", "title": "" }, { "docid": "05b669b57d224d9291f4211427c502a3", "score": "0.57726675", "text": "def initialize(ip)\n @address = IPAddr.new(ip)\n @subnet = 32 - Math.log2(@address.to_range.to_a.size).round\n end", "title": "" }, { "docid": "728293ef16dbad36a677e819c57570ec", "score": "0.575173", "text": "def network(options=nil)\n known_args = [:Objectify, :Short]\n objectify = false\n short = false\n\n if (options)\n if (!options.kind_of?(Hash))\n raise ArgumentError, \"Expected Hash, but \" +\n \"#{options.class} provided.\"\n end\n NetAddr.validate_args(options.keys,known_args)\n\n if( options.has_key?(:Short) && options[:Short] == true )\n short = true\n end\n\n if( options.has_key?(:Objectify) && options[:Objectify] == true )\n objectify = true\n end\n end\n\n\n if (!objectify)\n ip = NetAddr.ip_int_to_str(@network, @version)\n ip = NetAddr.shorten(ip) if (short && @version == 6)\n else\n ip = NetAddr.cidr_build(@version,@network)\n end\n\n return(ip)\n end", "title": "" }, { "docid": "61721eb9d35d4bd19cef1c8f4d4a6de4", "score": "0.57471406", "text": "def get_ip_address(name, eth)\n if ( eth_iface = network[:interfaces][eth] )\n eth_iface[:addresses].each do |key, info|\n linode[name] = key if info[\"family\"] == \"inet\"\n end\n end\n end", "title": "" }, { "docid": "ec5876fccfc92c77a79366c8b42ff545", "score": "0.57358336", "text": "def local_ip\n orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true # turn off reverse DNS resolution temporarily\n\n UDPSocket.open do |s|\n s.connect '64.233.187.99', 1\n s.addr.last\n end\nensure\n Socket.do_not_reverse_lookup = orig\nend", "title": "" }, { "docid": "d49cefab5d49c4a46770a294b3b59a09", "score": "0.5730552", "text": "def ipaddr(iface=nil)\n @ipaddr[iface || default_iface]\n end", "title": "" }, { "docid": "93a7ca129867ba996539592649591f71", "score": "0.5723368", "text": "def local_ip\n # turn off reverse DNS resolution temporarily\n orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true\n\n UDPSocket.open do |s|\n s.connect '64.233.187.99', 1 # google\n s.addr.last\n end\n ensure\n Socket.do_not_reverse_lookup = orig\n end", "title": "" }, { "docid": "732bbe81ddc4ad78ce405f6898a8490f", "score": "0.572232", "text": "def get_ipaddr(dns_query, parsed_dns, length)\n address = \"\"\n case length\n when IPV4_ADDR_LENGTH\n address = dns_query[parsed_dns[:index], length].unpack(\"CCCC\").join('.')\n when IPV6_ADDR_LENGTH\n address = dns_query[parsed_dns[:index], length].unpack(\"nnnnnnnn\").map{|v| sprintf(\"%x\", v)}.join(':')\n end\n parsed_dns[:index] += length\n return address\n end", "title": "" }, { "docid": "89ec7e8a47fda4b28ce4689d924b6efa", "score": "0.57184017", "text": "def address_type(addr)\n begin\n ipaddr = IPAddr.new addr\n\n if ipaddr.ipv4?\n return \"IP\"\n elsif ipaddr.ipv6?\n return \"IP6\"\n else\n return Error.new('Unknown IP type')\n end\n rescue\n if /^(\\h{2}:){5}\\h{2}$/ =~ addr\n return \"MAC\"\n else\n return Error.new('Unknown address type')\n end\n end\n end", "title": "" }, { "docid": "c1eafa99ac3dd260206fa6166c698773", "score": "0.5716067", "text": "def local_ip\n orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true # turn off reverse DNS resolution temporarily\n\n UDPSocket.open do |s|\n s.connect '64.233.187.99', 1\n s.addr.last\n end\n ensure\n Socket.do_not_reverse_lookup = orig\n end", "title": "" }, { "docid": "ba7cf0ff3f5a0f2308882288defc9f9c", "score": "0.57025945", "text": "def set_ip_address\n @ip_address = IpAddress.find(params[:id])\n end", "title": "" }, { "docid": "0b628d322514c9bcc61a2acf1eb8ed44", "score": "0.5685843", "text": "def local_ip\n # turn off reverse DNS resolution temporarily\n orig = Socket.do_not_reverse_lookup\n Socket.do_not_reverse_lookup = true\n\n UDPSocket.open do |s|\n # ip is for Google\n s.connect '64.233.187.99', 1\n s.addr.last\n end\n ensure\n # restore previous setting\n Socket.do_not_reverse_lookup = orig\n end", "title": "" }, { "docid": "0093fd137ec9db9e87071343c21d08aa", "score": "0.56834155", "text": "def define_addrinfo_with_netmask\n @netmask = @options[:netmask]\n @ipaddr = NetAddr::CIDR.create(\n format('%<ip>s/%<mask>s', ip: @options[:ipaddr], mask: @netmask)\n )\n @wildcard = @ipaddr.wildcard_mask(true)\n end", "title": "" }, { "docid": "c62d5bf623533526d4b921d70394d740", "score": "0.5660047", "text": "def ip_from_num(i)\n \"192.168.90.#{i+IP_OFFSET}\"\nend", "title": "" }, { "docid": "a3ada259b0222cfd960666b258639d83", "score": "0.56433135", "text": "def locate\n @result ||= self.class.get(\n \"/\",\n :query => {:ip => @ip},\n :format => :xml\n )['HostipLookupResultSet']['gml:featureMember']\n end", "title": "" }, { "docid": "df3cb6223a361e05c4741e6dec66e8e3", "score": "0.5639725", "text": "def ip_address; end", "title": "" }, { "docid": "df3cb6223a361e05c4741e6dec66e8e3", "score": "0.5639725", "text": "def ip_address; end", "title": "" }, { "docid": "df3cb6223a361e05c4741e6dec66e8e3", "score": "0.5639725", "text": "def ip_address; end", "title": "" }, { "docid": "df3cb6223a361e05c4741e6dec66e8e3", "score": "0.5639725", "text": "def ip_address; end", "title": "" }, { "docid": "df3cb6223a361e05c4741e6dec66e8e3", "score": "0.5639725", "text": "def ip_address; end", "title": "" }, { "docid": "df3cb6223a361e05c4741e6dec66e8e3", "score": "0.5639725", "text": "def ip_address; end", "title": "" }, { "docid": "4f26b1b7fd1382631c6d22e309af40fa", "score": "0.5630459", "text": "def get_ip_address(name, eth)\n network[:interfaces][eth][:addresses].each do |key, info|\n rackspace[name] = key if info['family'] == 'inet'\n end\nend", "title": "" }, { "docid": "14ad7d9ab7ca4e7b9d63a8cbe898294b", "score": "0.5601554", "text": "def initialize(request, host_search=false)\n @host_search = host_search\n @host = nil\n if request.instance_of? IPAddr\n if request.ipv4?\n @ip = request\n @server = server_ipv4\n elsif request.ipv6?\n @ip = request\n @server = server_ipv6\n else\n raise WhoisExceptionError.new(1)\n end\n elsif Resolv::IPv4::Regex =~ request\n ipv4_init request\n unless @server\n raise WhoisException.new(\"no server found for this IPv4 : #{request}\")\n end\n elsif Resolv::IPv6::Regex =~ request\n ipv6_init request\n unless @server\n raise WhoisException.new(\"no server found for this Ipv6 : #{request}\")\n end\n else\n # Test if the request is an host or not\n begin\n ip = Resolv.getaddress request\n @ip = IPAddr.new ip\n @server = server_ipv4\n @host = request\n rescue Resolv::ResolvError\n raise WhoisException.new(\"host #{request} has no DNS result\")\n end\n end\n \n search_host unless @host\n end", "title": "" }, { "docid": "b7d8ec5d2454a5e4c37306cda4239e1e", "score": "0.5589875", "text": "def device_ipaddress; end", "title": "" }, { "docid": "b7d8ec5d2454a5e4c37306cda4239e1e", "score": "0.5589875", "text": "def device_ipaddress; end", "title": "" }, { "docid": "18606beb8cb0765fa43e18277a479828", "score": "0.55828005", "text": "def get_ip_address\n items = `ifconfig | grep \"inet addr\"`.split\n addresses = []\n items.each do |item|\n addresses << item if item =~ /addr:/\n end\n ip = \"\"\n addresses.each do |address|\n ip = address.split(':')[1]\n if ip != '127.0.0.1'\n break\n end\n end\n ip\nend", "title": "" }, { "docid": "0393e0383287dd31606cd44c0a75c743", "score": "0.55664706", "text": "def extract_ip(addrinfo)\n addrinfo[2]\n end", "title": "" }, { "docid": "39bbe1dc2e4dc923b505718c89d5d76b", "score": "0.55629677", "text": "def ipv4_init (ip)\n @ip = IPAddr.new ip\n @server = server_ipv4\n end", "title": "" }, { "docid": "28dfd3f3ca03025bd411c60156103c68", "score": "0.5562533", "text": "def last\n if @family == Socket::AF_INET\n IPAddr.new(first.to_i | (@mask_addr ^ IPAddr::IN4MASK), @family)\n elsif @family == Socket::AF_INET6\n IPAddr.new(first.to_i | (@mask_addr ^ IPAddr::IN6MASK), @family)\n else\n raise \"unsupported address family.\"\n end\n end", "title": "" }, { "docid": "bf109fbf9cc99726e72abda6b3b32912", "score": "0.55621016", "text": "def lookup_device(ip)\n\t\t@map[ip]\n\tend", "title": "" }, { "docid": "9fd73780064ef71580d4008112380aef", "score": "0.5560117", "text": "def getIpFromNum(ii)\n \"172.31.0.#{100+ii}\"\nend", "title": "" }, { "docid": "be1ef57b8347540edc8b118a559c6f89", "score": "0.5558189", "text": "def arp_src_ip= i; typecast \"arp_src_ip\", i; end", "title": "" }, { "docid": "b30a623f981b22b178e7d67569261285", "score": "0.5555302", "text": "def external_ip\n begin\n ip = OpenURI.open_uri(\"http://myip.dk\") {|f|f.read.scan(/([0-9]{1,3}\\.){3}[0-9]{1,3}/); $~.to_s}\n rescue\n ip = local_ip\n puts \"Seems like there is a problem adquiring external IP address, ...using local address: (#{ip})\"\n end\n ip\n end", "title": "" }, { "docid": "c9078a49b66d66af9a699f6b62af9515", "score": "0.55539286", "text": "def get_ipaddress(asset_tag=asset_tag, pool)\n @connection.ipaddress_allocate!(asset_tag, pool, count = 1)\n end", "title": "" }, { "docid": "165788ab2a09de2108860313e89b3a4c", "score": "0.5541591", "text": "def ip_address\n Socket.ip_address_list.find { |ai| ai.ipv4? && !ai.ipv4_loopback? }.ip_address\n end", "title": "" }, { "docid": "bdbace42cacdc92c7ad52c9070fb1081", "score": "0.5531323", "text": "def ip_address_record(env)\n data_type = env[:machine].provider_config.private_only ? \"primaryBackendNetworkComponent\" : \"primaryNetworkComponent\"\n data_type = \"primaryBackendNetworkComponent\" if env[:machine].provider_config.force_private_ip\n mask = \"#{data_type}.primaryIpAddressRecord.id,#{data_type}.primaryIpAddressRecord.ipAddress\"\n record = sl_warden { env[:sl_machine].object_mask(\"mask[#{mask}]\").getObject }\n return {\n :address => record[data_type][\"primaryIpAddressRecord\"][\"ipAddress\"],\n :id => record[data_type][\"primaryIpAddressRecord\"][\"id\"]\n }\n end", "title": "" }, { "docid": "fa2ee570d0bea212a2fbd5eb4657ac70", "score": "0.55246407", "text": "def ip\n @ip ||= Socket.ip_address_list.detect{|intf| intf.ipv4_private?}.ip_address\n end", "title": "" }, { "docid": "115dab1f40d01cf63120a4cd4c315fea", "score": "0.55236673", "text": "def host_address\n @address ||= (\n begin\n # turn off reverse DNS resolution temporarily\n orig, Socket.do_not_reverse_lookup = Socket.do_not_reverse_lookup, true\n\n # A connection is not actually attempted to the external address.\n UDPSocket.open do |s|\n s.connect '64.233.187.99', 1\n s.addr.last\n end\n rescue => error\n @log.warn \"Unable to determine host address: #{error}\"\n ensure\n Socket.do_not_reverse_lookup = orig\n end\n )\n end", "title": "" }, { "docid": "07bebad9d5a777436cf248a1c09b848a", "score": "0.5510692", "text": "def assoc(private_ip, public_ip=nil)\n\n\t\t\t# check that the private ip exists within our internal model and infer the\n\t\t\t# interface from that, throw exception otherwise\n\n\t\t\t# if the public_ip parameter is specified use the AWS api to find an\n\t\t\t# existing \"elastic ip\" in this account and throw exception if it does not\n\t\t\t# exist or is otherwise unavailable (if already associated with another\n\t\t\t# instance or interface). if parameter not provided, create a new elastic\n\t\t\t# ip using the AWS api\n\n\t\t\t# associate this EIP with the provided private ip and the eni device we\n\t\t\t# inferred from it using the AWS api\n\n\t\t\t# return the public ip\n\t\tend", "title": "" }, { "docid": "2aa8ccde1e5dc85fc69aaa80c916d1de", "score": "0.5507503", "text": "def arp_dest_ip= i; typecast \"arp_dest_ip\", i; end", "title": "" }, { "docid": "994d313b972920e5908b988d77c3e43e", "score": "0.5499157", "text": "def addr_type; ADDR_TYPES[ self[:atype] ] ; end", "title": "" }, { "docid": "6a3abff52c3c6aa31c6e146ba6f20fe1", "score": "0.54792255", "text": "def ip_address\n @ip_address ||= nil\n end", "title": "" }, { "docid": "b1ece149c8acf3cc8a9e57feda6bef79", "score": "0.54759777", "text": "def ip_first\n NetAddr::CIDR.create(cidr_obj.to_i(:network) + 2).ip\n end", "title": "" }, { "docid": "f1403d1e8f81ef6dc65a14ea4fe3e212", "score": "0.5471977", "text": "def next_ip\n\t\treturn false if not valid?\n\t\tif (@curr_addr > @ranges[@curr_range][1])\n\t\t\tif (@curr_range >= @ranges.length - 1)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\t@curr_range += 1\n\t\t\t@curr_addr = @ranges[@curr_range][0]\n\t\tend\n\t\taddr = Rex::Socket.addr_itoa(@curr_addr, @ranges[@curr_range][2])\n\t\t@curr_addr += 1\n\t\treturn addr\n\tend", "title": "" }, { "docid": "8535f1893c960df46609eea12dd447ba", "score": "0.5471137", "text": "def read_host_ip(ip)\n\t UDPSocket.open do |s|\n\t if(ip.kind_of?(Array))\n\t s.connect(ip.last, 1)\n\t else\n\t s.connect(ip, 1)\n\t end\n\t s.addr.last\n\t end\n\tend", "title": "" }, { "docid": "fb5ee7a2c0207abf7a074463183a21ce", "score": "0.54698974", "text": "def |(in_ip)\n raise RuntimeError, \"Can not compare IPV4 with IPV6!\" if @version != in_ip.version\n Ip.new(@ip_int | in_ip.to_i, @version)\n end", "title": "" }, { "docid": "ace4c7f727c59b0fa2fd0f57a348d080", "score": "0.54593736", "text": "def define_addrinfo_with_wildcard\n @ipaddr = NetAddr::CIDR.create(\n @options[:ipaddr],\n WildcardMask: [@wildcard, true]\n )\n @netmask = nil\n end", "title": "" }, { "docid": "ff93791df07d21a1687bb5e888e29fb7", "score": "0.54321027", "text": "def normalize_ip(ip)\n case ip\n when nil then nil\n when String then IPAddr.new(ip)\n when Integer then IPAddr.new(ip, Socket::AF_INET)\n when IPAddr then ip\n else raise ArgumentError, \"IP must be a String, IPAddr, or Integer, not: #{ip.inspect}\"\n end\n end", "title": "" }, { "docid": "be19206ad8138151d2ba32908d705aaa", "score": "0.5432063", "text": "def get_network_by_interface(interface)\n\n ifconfig = `ifconfig`.split(\"\\n\\n\").index_by{|x| x[/\\w+/,0]}\n inet = ifconfig[interface][/inet addr:([^\\s]*)/, 1].split('.')\n broadcast = ifconfig[interface][/Bcast:([^\\s]*)/, 1].split('.')\n mask = ifconfig[interface][/Mask:([^\\s]*)/, 1].split('.')\n\n start_first = inet[0].to_i & mask[0].to_i\n start_second = inet[1].to_i & mask[1].to_i\n start_third = inet[2].to_i & mask[2].to_i\n start_fourth = inet[3].to_i & mask[3].to_i\n\n first_range = start_first..broadcast[0].to_i\n second_range = start_second..broadcast[1].to_i\n third_range = start_third..broadcast[2].to_i\n fourth_range = start_fourth..broadcast[3].to_i\n \n @ips_to_check = []\n first_range.each do |first|\n second_range.each do |second|\n third_range.each do |third|\n fourth_range.each do |fourth|\n @ips_to_check << \"#{first}.#{second}.#{third}.#{fourth}\"\n end\n end\n end\n end\n puts \"Checking ips in (#{first_range}).(#{second_range}).(#{third_range}).(#{fourth_range})\"\n \n @ips_to_check\n end", "title": "" }, { "docid": "fde14dffc5d39315b8a70ee00019ba6f", "score": "0.54312325", "text": "def ptr(ip)\n # use cache if ip was already resolved\n return @cache[ip] if @cache[ip]\n\n begin\n name = @hypedns.getname(ip).to_s\n @cache[ip] = name\n return name\n rescue Resolv::ResolvError, SocketError\n return nil\n end\n end", "title": "" }, { "docid": "1cf4d58a6d33654b90e15507f7da9de0", "score": "0.54310244", "text": "def set_ip_adress\n @ip_adress = IpAddress.find(params[:id])\n end", "title": "" }, { "docid": "1bf3f6fd4c770832813502ae163f06ac", "score": "0.54257154", "text": "def find_private_ip\n ip_addresses = interface_addresses\n ip_addresses.each do |ip|\n if ip.start_with?(\"192\") || ip.start_with?(\"10\")\n return ip\n end\n end\n return nil\n end", "title": "" }, { "docid": "b8137feb76a3fa6b8d524cbf7dca31e5", "score": "0.5423108", "text": "def ip; end", "title": "" }, { "docid": "b8137feb76a3fa6b8d524cbf7dca31e5", "score": "0.5423108", "text": "def ip; end", "title": "" }, { "docid": "1224a99eb5154183d6f53ef357ebc60d", "score": "0.54110444", "text": "def local_ip_address\n conf['base_address'] ||\n %x{ip addr show #{conf['base_interface'] || 'br0'} | grep inet}.split(' ')[1].to_s.strip.split('/').first.to_s\nend", "title": "" }, { "docid": "c5e32f552f38a97e7c6cc6dc327cba71", "score": "0.5409651", "text": "def checkip?(ip)\n if ip =~ %r=^172.|^192.168.|^10.$=\n return \"Private Class C IP Range\"\n elsif ip =~ %r=^127.$=\n return \"Local Loopback\"\n end\n end", "title": "" }, { "docid": "bd0468a679fd90e5dd296547f3e273c7", "score": "0.54078454", "text": "def ip_address(env)\n ip_address_record(env)[:address]\n end", "title": "" }, { "docid": "5966aab3d8b7b5c14112b311ab8ccdd2", "score": "0.5405624", "text": "def ip\n @ip ||= @node.search('IP/listEntry').map(&:inner_text)\n end", "title": "" }, { "docid": "d38ac9816190d79cd9b448925eed4a46", "score": "0.5403607", "text": "def check(ip_addr)\n ip = IPAddr.new(ip_addr)\n\t\tquery = \"#{@key}.#{ip.reverse.gsub(\"in-addr.arpa\", \"dnsbl.httpbl.org\")}\"\n\n\t\tbegin\n\t\t\tlookup = Resolv.getaddress(query)\n\t\t\tvalues = lookup.split(\".\")\n\t\t\t{ :last_activity => values[1],\n\t\t\t :threat => values[2],\n\t\t\t :type => TYPE[values[3]],\n\t\t\t :raw_data => lookup\n\t\t\t}\n\t\trescue\n\t\t\treturn { :type => [:error] }\n\t\tend\n\tend", "title": "" }, { "docid": "3bba2afbb817ad4fb3f7bceeb2c12fa8", "score": "0.5396284", "text": "def ip\n TestLab::Utility.ip(self.address)\n end", "title": "" }, { "docid": "258d4a7d3f29603e0250ceea6f822d22", "score": "0.5393514", "text": "def address_type; @address_impl.getType; end", "title": "" }, { "docid": "e448e46b4320fbcdc2f95c6b45a3fa61", "score": "0.53894895", "text": "def location(ip, v = nil)\n r = db.look_up(ip)\n return v if r.nil?\n if v\n v.ip_latitude = r[:latitude]\n v.ip_longitude = r[:longitude]\n v.ip_country_code = r[:country_code]\n v.ip_country_name = r[:country_name]\n v.ip_city = r[:city]\n v.ip_dma_code = r[:dma_code]\n v.ip_area_code = r[:area_code]\n v.ip_region = r[:region]\n v\n else\n r\n end\n end", "title": "" } ]
a28e478681ac9d29c5dd796aa824781d
PATCH/PUT /users/1 PATCH/PUT /users/1.json
[ { "docid": "ffc3d5d53a32b27737c1e3e70476cbfa", "score": "0.0", "text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to :back, flash: {success: 'Podatki uspešno spremenjeni.'} }\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": "f0686f191a0def3b6c3ad6edfbcf2f03", "score": "0.72427535", "text": "def update_user(email)\n url = Addressable::URI.new(\n scheme: 'http',\n host: 'localhost',\n port: 3000,\n path: '/users/2.json'\n ).to_s\n\n puts RestClient.patch(\n url,\n { user: { email: email } }\n )\n end", "title": "" }, { "docid": "3b79ec0097a76ef85fc6e9656edc3daf", "score": "0.72292125", "text": "def patch_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .patch()\n .go()\n end", "title": "" }, { "docid": "8883f8815a6b9292435769a8a84d49f6", "score": "0.70357394", "text": "def update\n @user = User.patch(params[:id], params[:user])\n respond_with(@user)\n end", "title": "" }, { "docid": "060d1f9e03ff05ffa8c109da1c913458", "score": "0.69922626", "text": "def update\n @user.update!(user_params)\n render json: @user\n end", "title": "" }, { "docid": "bb443a428f2563539f43b17c71594928", "score": "0.68795586", "text": "def update_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end", "title": "" }, { "docid": "1ebfa5c43a28c0c6ae3c7116c2834ee3", "score": "0.6840641", "text": "def update_user(user_id, request)\n start.uri('/api/user')\n .url_segment(user_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end", "title": "" }, { "docid": "072e5b03e910a6eec48902b51969403c", "score": "0.6840263", "text": "def update \n @user = User.find(params[:id])\n if @user.update(user_params)\n render json: @user \n else \n render status: 400, nothing: true \n end \n end", "title": "" }, { "docid": "c0f436afe080be01e3d9a900ae80f8ab", "score": "0.68305945", "text": "def update\n head :no_content\n # @api_v1_user = Api::V1::User.find(params[:id])\n\n # if @api_v1_user.update(api_v1_user_params)\n # head :no_content\n # else\n # render json: @api_v1_user.errors, status: :unprocessable_entity\n # end\n end", "title": "" }, { "docid": "385ac3bc89323aa86c512d98dcdd5ca2", "score": "0.68114096", "text": "def update\n user = current_user\n if user.update(user_params)\n render json: user, status: 200, location: [:api_v1, user]\n else\n render json: { errors: user.errors }, status: 422\n end\n end", "title": "" }, { "docid": "bd6e920c3d00772f92e93b7f64b473a9", "score": "0.6797128", "text": "def update\n User.resource[params[:id]].patch(params)\n head :no_content\n end", "title": "" }, { "docid": "832c248ba3eb8c446af4c6ce62926569", "score": "0.6771281", "text": "def update\n if @api_v1_user.update(api_v1_user_params)\n render json: @api_v1_user\n else\n render json: @api_v1_user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ef6c6cbfc7de8fe531f74bc52240477b", "score": "0.6743114", "text": "def update\n user = User.find(params[:user][:user_id])\n params[:user].delete(:user_id)\n user.update(update_params)\n render json: { message: 'user updated' }\n end", "title": "" }, { "docid": "4dcb9429c1396178cff3eed0c55252a1", "score": "0.6742539", "text": "def update\n current_user.update!(user_params)\n render json: current_user\n end", "title": "" }, { "docid": "759be2484912d28bb67ffe03d6a24228", "score": "0.67381346", "text": "def update\n user = User.find(params[:id])\n\n if user.update_attributes(user_params)\n render json: user.to_json, status: 200\n else\n render json: {error: \"User update failed\", status: 400}, status: 400\n end\n end", "title": "" }, { "docid": "84d001a77df4c6c16e42ac2b0f89b9c6", "score": "0.67277765", "text": "def update\n update_and_respond(@user, user_params)\n end", "title": "" }, { "docid": "08157edea9cb74ae2a3906e7f885a93d", "score": "0.67020273", "text": "def update \n @user = User.find(params[:id])\n if @user.update_attributes(user_params) \n render json: @user, status: :updated\n else \n render json: @user.errors, status: :unprocessable_entity \n end \n end", "title": "" }, { "docid": "568a6defa7393f06936468d8c0b16b0a", "score": "0.6675837", "text": "def update\n user = find_user\n user.update(user_params)\n render json: user\n end", "title": "" }, { "docid": "ad628f1fbccc9ec84489acc4f44a2ff1", "score": "0.6674548", "text": "def patch_update\n user = @company.public_send(ScimRails.config.scim_users_scope).find(params[:id])\n update_status(user)\n json_scim_response(object: user)\n end", "title": "" }, { "docid": "cd593b8d281f9ba376a1bc786702fe2f", "score": "0.6665781", "text": "def update(*args)\n arguments(args) do\n permit VALID_USER_PARAMS_NAMES\n end\n\n patch_request(\"/user\", arguments.params)\n end", "title": "" }, { "docid": "25b787bcfdea3803945cd20447f2f4bb", "score": "0.6647506", "text": "def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:user])\n head :no_content\n else\n render :json => @user.errors, :status => :unprocessable_entity\n end\n end", "title": "" }, { "docid": "699d9259b5511ca444c672d0fdd17ed2", "score": "0.6645178", "text": "def modify_user(user)\n query_api_object User, \"/rest/user\", user.dump(), \"PUT\"\n end", "title": "" }, { "docid": "a79f25da2a38da334c5847d6f9c1ce16", "score": "0.66246253", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n # TODO check if fitbit token should be removed\n if @user.update_attributes(params[:user])\n flash[:success] = \"User #{@user.email} was successfully updated.\"\n format.html { redirect_to users_url }\n format.json { head :ok }\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": "9701fa7622582362b473432231ef2840", "score": "0.6621718", "text": "def update\n\t\tuser = find_user\n\t\tuser.update(user_params)\n\t\trender json: user\n\tend", "title": "" }, { "docid": "d93b3aa6659ae62851c0e2c5b2aff72c", "score": "0.6620583", "text": "def update\n @user_1 = User1.find(params[:id])\n\n respond_to do |format|\n if @user_1.update_attributes(params[:user_1])\n format.html { redirect_to @user_1, notice: 'User 1 was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_1.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d8054e3c41b8df3c2ec3d070c63961f3", "score": "0.66162497", "text": "def update\n puts params[:id]\n user = User.find(params[:id])\n user.update(name: params[:name], email: params[:email])\n render json: {success: \"Successful updating\"}\n end", "title": "" }, { "docid": "d190f524c5924d87588ecb666cbf5cc4", "score": "0.66130805", "text": "def update\n @user = User.find(params[:id])\n \n if @user.update(user_params)\n render json: @user, status: :ok \n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "691e3bde861cbda7d0bb533fcbb31672", "score": "0.6607845", "text": "def update\n user = User.find(params[:id])\n if user.update(params_user)\n render json: user, status: 200\n else\n render json: user.errors, status: 422\n end\n\n end", "title": "" }, { "docid": "2963118f3ea04813a21d6d6a6bf0d05f", "score": "0.6604596", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update(user_update_params)\n format.json { render json: @user, status: :ok }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "52120d456f84e9bcd29d003142e95e92", "score": "0.66040903", "text": "def update\n user = User.find(params[:id])\n if user.update(user_params)\n render json: user, status: :ok\n else\n render json: { errors: user.errors }, status: 422\n end\n end", "title": "" }, { "docid": "f2f8c20b7eef84bb400714fdc59a8b0e", "score": "0.65904814", "text": "def update\n @user = User.find(params[:id])\n\n if @user.update_attributes(params[:User])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "224d657a0871919d0f25b180f9c2446d", "score": "0.65897244", "text": "def update\n respond_with User.update(params[:id], params[:user])\n end", "title": "" }, { "docid": "ef86e31e230f2cf2499d83448f680ebc", "score": "0.6581143", "text": "def update\n respond_with User.update(params[:id],params[:user])\n end", "title": "" }, { "docid": "85554d9b1b0279f5b254674ca18b848d", "score": "0.65683705", "text": "def update\n user = current_user\n\n if user.update(user_params)\n render json: user, status: 200, location: [:api, user]\n else\n render json: { errors: user.errors }, status: 422\n end\n end", "title": "" }, { "docid": "67afc5f4539aa0577fa25e1ee5778898", "score": "0.6566744", "text": "def update\n @user = current_user\n respond_to do |format|\n puts \"1\"\n if @user.update_attributes(JSON.parse(params[:user]))\n puts \"2\" \n #format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { render json: {:user=>Api::V3::UsersPresenter.new().as_json(@user), :success=>true}, location: @user }\n else\n puts \"3\"\n #format.html { render action: \"edit\" }\n format.json { render json: {:error=>@user.errors}, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fbdfe5c2d8dc0cf9b6a2bc65f049e93", "score": "0.6563839", "text": "def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_to do |format|\n format.html\n format.js\n format.json { render :json => @users }\n end\n end", "title": "" }, { "docid": "b5edb8a9b2cad14c7874c5f42c5809e9", "score": "0.656064", "text": "def test_put_user\n json_data = '{\"name\":\"test\", \"last_name\":\"test\", \"document\" : \"098\"}'\n put '/users/4', json_data\n assert_equal 204, last_response.status, 'Código de respuesta incorrecto'\n end", "title": "" }, { "docid": "2dc50f32a6a1be907e61d6655f19f1ba", "score": "0.65604085", "text": "def update\n user = User.find(params[:id])\n user.update(user_params)\n if user.valid?\n render json: user\n else\n render json: user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e81343b0e51f5be5257d1da040d9178e", "score": "0.65600294", "text": "def update\n # update the user\n api_client.update_user(params[:id], user_params)\n\n # update custom attributes\n api_client.set_custom_attribute_to_user(params[:id], custom_user_params)\n\n respond_to do |format|\n unless api_client.error\n format.html { redirect_to user_path(params[:id]), 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": "018e1818e03cc3d12f1b20effb2bc0a8", "score": "0.6559064", "text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "018e1818e03cc3d12f1b20effb2bc0a8", "score": "0.6559064", "text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "018e1818e03cc3d12f1b20effb2bc0a8", "score": "0.6559064", "text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "999ac837f35b530d4bd762c41f60ff19", "score": "0.65519947", "text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: @user.errors.full_messages, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "d0a9ca650949efc2e171cbc48421587b", "score": "0.65519744", "text": "def update\n update_user(users_path)\n end", "title": "" }, { "docid": "bb6685f93098d590da8a15e2e3160b60", "score": "0.65517956", "text": "def update\n user = current_user\n if user.update(user_params)\n render json: user, status: 200\n else\n render json: { errors: user.errors }, status: 422\n end\n end", "title": "" }, { "docid": "ee5a6d46ae0ee543c53228f424ad8451", "score": "0.6550495", "text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.json { render json: @user, status: :ok }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e330994c9e2d5c3f2ffe71077b0f26b", "score": "0.6542808", "text": "def update\n params.permit!\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_url, notice: 'User #{@user.name} was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "257b82e17e5b1f88db9df740805e6185", "score": "0.65415585", "text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: { status: 400, msg: 'Something went wrong' }\n end\n end", "title": "" }, { "docid": "d25a98492709b07b6951f4fdabc78603", "score": "0.6541178", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(users_url, notice: \"User #{@user.name} was successfully updated.\") }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ccf9ed09d600e760d6f263e0380c88ca", "score": "0.6540148", "text": "def update\n update_resource(@user)\n end", "title": "" }, { "docid": "ccf9ed09d600e760d6f263e0380c88ca", "score": "0.6540148", "text": "def update\n update_resource(@user)\n end", "title": "" }, { "docid": "29ffafd0a884c0baaf0c44106d79b94e", "score": "0.6533376", "text": "def update\n if @user.update(user_params)\n render json: @user \n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "7b27015c5775023de1161dea2fca6f0c", "score": "0.6532168", "text": "def update\n\t\tunless api_key_is_valid?\n\t\t\treturn render json: 'Invalid API key.', status: 401\n\t\tend\n\n\t\tuser = User.find(params[:id])\n\n\t\tsaved = false\n\t\tif user.present?\n\t\t\tparams[:fields].each do |k, v|\n\t\t\t\tbegin\n\t\t\t\t\tif user.update(\"#{k}\" => \"#{v}\")\n\t\t\t\t\t\tsaved = true\n\t\t\t\t\telse\n\t\t\t\t\t\treturn render json: user.errors, status: 500\n\t\t\t\t\tend\n\t\t\t\trescue ActiveRecord::UnknownAttributeError\n\t\t\t\t\treturn render json: \"User has no attribute #{k}.\", status: 400\n\t\t\t\tend\n\t\t\tend\n\t\telse\n\t\t\treturn render json: 'User not found.', status: 404\n\t\tend\n\n\t\tif saved\n\t\t\treturn render json: 'Changes saved.', status: 200\n\t\tend\n\tend", "title": "" }, { "docid": "a0d52b546f97d92c94f2906309376f8b", "score": "0.65302396", "text": "def update\n if @user.update(user_params)\n render json: @user\n else\n render json: { errors: @user.errors.full_messages }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ca5a9b4918333eb8cfd2505d5f1391c4", "score": "0.6527617", "text": "def update\n @user = User.find(params[:id])\n if current_user != @user\n respond_to do |format|\n format.json { render json: {}, status: :forbidden }\n end\n return\n end\n @user.update!(user_params)\n respond_to do |format|\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "80e7b0afa5cc4038fef85a7d7967666c", "score": "0.65270513", "text": "def update\n @user = User.find(params[:id])\n\t\n if @user.update(user_params(params[:user]))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "f2311cf292680016035c4213cc419c6d", "score": "0.65211135", "text": "def update_user(id, options)\n patch(\"/users/#{id}\", options)\n end", "title": "" }, { "docid": "f372faa6dbb1d6bc23f764dc3d392f5f", "score": "0.6516041", "text": "def update\n @user = User.find(params[:id])\n\n if @user.update(params[:user])\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "d002d44210be9632166f45081da464a5", "score": "0.65133846", "text": "def update\n @user.update(user_params)\n if @user.errors.any? \n render json: @user.errors, status: :unprocessable_entity\n else \n render json: @user, status: 201\n end \n end", "title": "" }, { "docid": "66240190834ac643f4d2e903b4a1f268", "score": "0.6509425", "text": "def update\n respond_to do |format|\n\n\n if @user.update(user_params)\n format.html { redirect_to users_path }\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": "4ca1914328cc71b605f6951f6b137fb1", "score": "0.650918", "text": "def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_with @user\nend", "title": "" }, { "docid": "45243d79e4275cc253be6a5d7415542e", "score": "0.650836", "text": "def update\n @user1 = User1.find(params[:id])\n\n respond_to do |format|\n if @user1.update_attributes(params[:user1])\n format.html { redirect_to @user1, notice: 'User1 was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user1.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd5963d908b40b1b87884d30b85d7a1e", "score": "0.65073454", "text": "def update\n user = current_user\n if user.update(user_params)\n render json: user, status: 200, location: [:api, user]\n else\n failed_to_update(user, \"user\")\n end\n end", "title": "" }, { "docid": "f40637d728484ec41ef659e304a15a44", "score": "0.65065366", "text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params(params[:user]))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "f40637d728484ec41ef659e304a15a44", "score": "0.65065366", "text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params(params[:user]))\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "748ea080c08e00cbdc2f345f8393af81", "score": "0.65051883", "text": "def update\n @user = User.find(params[:id])\n @user.update_attributes(params[:user])\n respond_with @user\n end", "title": "" }, { "docid": "adfff4175048d9c7f39b404371ccdaa6", "score": "0.6493821", "text": "def update\n @user = User.friendly.find(params[:id])\n # render json: @user\n # render json: params\n # render json: user_params\n # render json: params['user']\n\n respond_to do |format|\n if @user.update(user_params)\n @user.name = \"#{@user.first_name} #{@user.last_name}\"\n @user.slug = nil\n @user.save!\n format.html { redirect_to user_path(@user), notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "488fbded3c7b2d58be882d2aa457befb", "score": "0.6492729", "text": "def update\n @user = User.find(params[:id])\n @user.name= params[:user][:name]\n @user.email = params[:user][:email]\n \n respond_to do |format|\n format.html { redirect_to users_url }\n format.json { render :json => @user }\n end\n\n end", "title": "" }, { "docid": "c77c61632e7a5655fa8215c4d35a24f0", "score": "0.648818", "text": "def update\n @user = User.find_by_name(params[:id])\n @user.update_attributes(params[:user])\n \n respond_with @user, :stautus => :ok\n end", "title": "" }, { "docid": "302fd13d7fd5b632d7924e0c6a21e2fd", "score": "0.6486198", "text": "def update_user(options)\n patch \"user\", options\n end", "title": "" }, { "docid": "0c6476ef6a283ef342d6514756380eec", "score": "0.6480151", "text": "def edit\n user = User.find(params[:id])\n render json: user, only: [:username, :name, :location, :bio, :resource_request, :skills, :seeking, :preferred_contact], status: 200\n end", "title": "" }, { "docid": "807151b4b1dc86c0466dabbb2f6b2986", "score": "0.64745855", "text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.html { redirect_to users_path }\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": "0c20e6139df1707ae18d5e5c8b3c7033", "score": "0.6469649", "text": "def update\n user = User.find(params[:auth][:uid]) if params.has_key?(:auth)\n user = current_user if current_user\n\n respond_to do |format|\n if user && user.update_with_params(params[:user])\n format.html { redirect_to user, notice: 'User updated.' }\n format.json do \n if params.has_key?(:v) && params[:v].to_f >= 2.0\n render json: user\n else\n render json: { user: user }\n end\n end\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": "104cbd2d12f682ecee2b34caa4135ba4", "score": "0.64647204", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to(users_url, notice: \"User #{@user.username} 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": "77dc518adf976c10fd53e7c05b8ddcac", "score": "0.6464228", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_url, notice: 'User 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": "96d6039ed862a309382ea5a83efcec51", "score": "0.64638144", "text": "def update\n respond_to do |format|\n if @user.update(user_params)\n format.json { render @user, status: :ok, location: @user }\n else\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2ca334319ebfe0313bcbdc205e5dbf52", "score": "0.6460054", "text": "def update\n @user = User.(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to @user, notice: 'User #{@user.name} was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0c5a0b20e34a514cfd2174f4e4a702e9", "score": "0.6460021", "text": "def update\n @user = User.find(params[:id])\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_path, 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": "c5694c8d217cc016ffb3ea0daa9befc5", "score": "0.6455952", "text": "def update( params={ })\n normalize! params\n filter! DEFAULT_USER_OPTIONS, params\n\n put_request(\"/1.0/user\", DEFAULT_USER_OPTIONS.merge(params))\n\n end", "title": "" }, { "docid": "e987d5794882412b52deac114f439a55", "score": "0.64545417", "text": "def update\n # only change password\n # needs to be improved\n if @user.update_attributes(params[:user])\n respond_with(@user, only: [:id, :email, :first_name, :last_name])\n else\n render_error(404, request.path, 20005, \"Failed to update profile\")\n end\n end", "title": "" }, { "docid": "7200012410b8baedd92126f2e65bbbf0", "score": "0.64533865", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_path, 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": "7200012410b8baedd92126f2e65bbbf0", "score": "0.64533865", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_path, 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": "60706fab7b5976d6dff187d4a935b4b7", "score": "0.64456457", "text": "def update\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_path, :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": "b3d5a2b6aa59d6b7e2095f563f52e52b", "score": "0.644536", "text": "def update\n @user = User.find(params[:id])\n \n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_path, :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": "6583af00c9399d5f20be0f96f43e0b79", "score": "0.64323884", "text": "def update\n @user = User.find(params[:id])\n\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_path, notice: 'User was successfully updated.' }\n format.json { head :ok }\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": "fc0f39f918df73dd51cfeaa86b3a4b50", "score": "0.6432322", "text": "def update\n # retrieve user data from request (params)\n email = params[:email]\n\n # query DB for the specific user \n user = User.where(:email => email)\n\n @user = user.update(user_params) #update the user \n json_response(@user) # return created user, to signify that the user was updated\n end", "title": "" }, { "docid": "d178facf1848fa3573fdb9fc32e78bda", "score": "0.64295447", "text": "def update\n @user = User.where(id: params[:id]).first\n if @user.blank?\n render nothing: true, status: :not_found\n else\n @user.update_attributes(params.require(:user).permit(:email, :name))\n respond_with(@user)\n end\n end", "title": "" }, { "docid": "47f1b8bbb51dc45ffacf38d5030fd63d", "score": "0.6426872", "text": "def update\n user = User.find_by!(id: params[:id])\n if user \n user.name = params[:name]\n user.surname = params[:surname]\n user.role_id = params[:role_id]\n user.phone = params[:phone]\n user.job = params[:job]\n user.email = params[:email]\n user.adress = params[:adress]\n user.confirmed = params[:confirmed]\n user.save\n render json: user, status: 200 \n else\n render json: { errors: \"This link is invalid.\"}, status: 404\n end\n end", "title": "" }, { "docid": "0b9c1bef7f401fa06802170d53d4d7b9", "score": "0.642487", "text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0b9c1bef7f401fa06802170d53d4d7b9", "score": "0.642487", "text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0b9c1bef7f401fa06802170d53d4d7b9", "score": "0.642487", "text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0b9c1bef7f401fa06802170d53d4d7b9", "score": "0.642487", "text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0b9c1bef7f401fa06802170d53d4d7b9", "score": "0.642487", "text": "def update\n @user = User.find(params[:id])\n\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "8b66794bad0b225767640e65afead74b", "score": "0.6420009", "text": "def update\n \tif @user.update(user_params)\n \t\trespond_with @user\n \telse\n \t\trespond_using @user, :edit\n end\n end", "title": "" }, { "docid": "f2232536d3cf1f3f02bc5b90475f4ef0", "score": "0.6418265", "text": "def update\n authorize @user\n\n if @user.update(user_params)\n render json: { status: :ok, user: @user }\n else\n render json: { errors: @user.errors, status: :unprocessable_entity }\n end\n end", "title": "" }, { "docid": "e3d6cb8e35fe44e9d2a8d7515d67121b", "score": "0.6407123", "text": "def update_user(user_id, opts={})\n\trequest_type = \"PATCH\"\n\turl = \"user/#{user_id}\"\n\tdata = {}\n\tdata[:email] = opts[:email] unless opts[:email].blank?\n\tdata[:test_mode] = opts[:test_mode] unless opts[:test_mode].blank?\n\tdata[:language] = opts[:language] unless opts[:language].blank?\n\tcontent = data.to_json\n\thash = create_hmac(request_type, url, content)\n\tresponse = http_send(request_type, url, hash, content)\nend", "title": "" }, { "docid": "67f08b8d6f982f4805b13cd8d6b1e2c1", "score": "0.6405411", "text": "def update\n @user.name = params[:user][:name]\n @user.email = params[:user][:email].downcase\n @user.nickname = params[:user][:nickname]\n\n respond_to do |format|\n if @user.update\n format.html { redirect_to @user, notice: 'User was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f97b9af2d44b331cfb3d2025b2c29702", "score": "0.6405221", "text": "def update\n @user = User.find(params[:id])\n if @user.update(user_params)\n head :no_content\n else\n render json: @user.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "c54a2b6c1d4b8ac5c8b393c83bf8043f", "score": "0.6404195", "text": "def update\n @user = User.get(params[:id])\n \n respond_to do |format|\n if @user.update(params[:user])\n format.json { render :json => @user.to_json, :status => 200 }\n format.xml { head :ok }\n format.html { redirect_to @user, :notice => 'User was successfully updated.' }\n else\n format.json { render :text => \"Could not update user\", :status => :unprocessable_entity } \n format.xml { head :ok }\n format.html { render :action => :new, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b8dcd2491b197c0c62a8f6716a37c05a", "score": "0.6399668", "text": "def update\n # Atualiza as informações o usuário\n \tif @user.update(users_params) \n \t\trender json: :success, status: 200\n \telse\n \t\trender json: @user.errors, status: :unprocessable_entity\n \tend\n end", "title": "" }, { "docid": "8a4badd6a01a0bcfec7ca6e8d84e14bf", "score": "0.63978", "text": "def update\n\t\tuser_id = params[:id]\n\t\t@user = User.find(user_id)\n\t\tif @user.update(user_params)\n\t\t\trender json: @user\n\t\telse\n\t\t\trender json: {\n\t\t\t\terror: {\n\t\t\t\t\tmessage: @user.errors.full_messages.to_sentence\n\t\t\t\t}\n\t\t\t}\n\t\tend\n end", "title": "" }, { "docid": "3c23c76ca3b13eb13ffea56bd5be1156", "score": "0.6397745", "text": "def update\n respond_to do |format|\n if @user.update_attributes(params[:user])\n format.html { redirect_to users_path, flash: { success: \"User '#{@user.name}' was successfully updated.\" } }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
b048378aadc73d1df7f549acfe048668
$ rake 2:1 Write a program that reads in two integers typed on the keybaord and outputs their sum, difference, and product Standard input will be like "9 2\n" and will expect you to print "11\n7\n18\n" to standard output.
[ { "docid": "034778eeb7c7a1a8254376ea341f55a3", "score": "0.7313733", "text": "def sum_difference_product\n # your code goes here\n #puts 'test'\n line = gets.chomp.split(' ')\n #line = line.chomp.split(' ')\n # puts line[0]\n # puts line[1]\n\n # arg1 = line[0].to_i\n # arg2 = line[1].to_i\n\n puts line[0].to_i + line[1].to_i\n puts line[0].to_i - line[1].to_i\n puts line[0].to_i * line[1].to_i\nend", "title": "" } ]
[ { "docid": "9352c9272e7fe029e246c08126a59e7f", "score": "0.79588056", "text": "def sum_difference_product\n a , b = gets.split.map { |num| num.to_i }\n puts a + b\n puts a - b\n puts a * b\n end", "title": "" }, { "docid": "d1e9bfef5cb0bd35cee1dc28a7237a47", "score": "0.7936032", "text": "def sum_difference_product\n a , b = gets.split.map { |num| num.to_i }\n puts a + b\n puts a - b\n puts a * b\nend", "title": "" }, { "docid": "6afd5c0acbddc594f639b25f2e23d55e", "score": "0.7864319", "text": "def sum_difference_product\n a , b = gets.split.map { |x| x.to_i }\n puts a + b\n puts a - b\n puts a * b\nend", "title": "" }, { "docid": "da60db4ba3c998d1d624bf045e0ab5c3", "score": "0.77463883", "text": "def sum_difference_product\n puts \"Please enter any two numbers, like this: 6, 5.\"\n a, b = gets.split.map {|n| n.to_i}\n puts \"The sum of these numbers is #{a + b}\"\n puts \"The difference of these numbers is #{a - b}\"\n puts \"The product of these numbers is #{a * b}\"\nend", "title": "" }, { "docid": "b75076e1e9d9d3f43e3d1c0e33154bee", "score": "0.7696487", "text": "def sum_difference_product\ninput = gets.split(\" \").map!(&:to_i)\nsum = input[0]+input[1]\ndiff = input[0]-input[1]\nprod = input[0]*input[1]\nprint \"#{sum}\\n#{diff}\\n#{prod}\\n\"\nend", "title": "" }, { "docid": "de1c805bc3e175a11cb0fc5f6064d3fa", "score": "0.76913995", "text": "def sum_difference_product\n\tnr1, nr2 = gets.split.map { |nr| nr.to_i }\n\tsum = nr1 + nr2\n\tdiff = nr1 - nr2\n\tprod = nr1 * nr2\n\tputs \"#{sum}\\n#{diff}\\n#{prod}\\n\"\nend", "title": "" }, { "docid": "5d9267f20020cc45e4c8e4cb08dfe891", "score": "0.76471955", "text": "def sum_difference_product\n # puts 'Integers: '\n int1, int2 = gets.split.map do |number|\n number.to_i\n end\n\n\n puts \"#{int1 + int2}\"\n puts \"#{int1 - int2}\"\n puts \"#{int1 * int2}\"\nend", "title": "" }, { "docid": "fed4a066f19734d6d1523af741c7389c", "score": "0.7640161", "text": "def sum_difference_product\n # your code goes here\n a = gets.split(\" \")\n\n n1 = a[0].to_i\n\n n2 = a[1].to_i\n\n puts \"#{n1 + n2}\\n#{n1 - n2}\\n#{n1 * n2}\\n\"\nend", "title": "" }, { "docid": "82c74f3084473a97e83b612c515f6c0b", "score": "0.7569929", "text": "def sum_difference_product\n\tarray1 = gets.split.map(&:to_i)\n\tputs array1[0] + array1[1]\n\tputs array1[0] - array1[1] \n\tputs array1[0] * array1[1]\nend", "title": "" }, { "docid": "91fb3a335ad1abf10f9f4fbc82991a21", "score": "0.75697434", "text": "def sum_difference_product\n puts \"Enter two integers\"\n nos = $stdin.gets.chomp.split(' ')\n puts \"#{nos[0].to_i + nos[1].to_i}\"\n puts \"#{nos[0].to_i - nos[1].to_i}\"\n puts \"#{nos[0].to_i * nos[1].to_i}\"\nend", "title": "" }, { "docid": "fd6b6b80b29339e44b9e032d5addc566", "score": "0.7568188", "text": "def sum_difference_product\n\t# puts \"enter two integers\"\n\n\ta, b = gets.split.map! {|x| x.to_i}\n\t#array.map! {|x| x.to_i}\n\t# sum = a + b\n\t# subtract = a - b\n\t# times = a * b\n\n\tputs (a + b)\n\tputs (a - b)\n\tputs (a * b)\nend", "title": "" }, { "docid": "9b80d0548797b42d6eafc56d7b846cfb", "score": "0.75580657", "text": "def sum_difference_product \n arr = gets.chomp.split(' ') \n a = arr[0].to_i \n b = arr[1].to_i \n puts a + b, a -b, a * b \nend", "title": "" }, { "docid": "91ec8ae79cca3d6fa3e1d661ca8bfbd7", "score": "0.75576526", "text": "def sum_difference_product\n input = $stdin.gets.chomp\n i = input.split(' ').map {|a| a.to_i}\n \n sum = i[0] + i[1]\n diff = i[0] - i[1]\n prod = i[0] * i[1]\n\n print sum.to_s + \"\\n\" + diff.to_s + \"\\n\" + prod.to_s + \"\\n\" \nend", "title": "" }, { "docid": "c852c1e13b54e47bdaa4e3acefa46a53", "score": "0.7528304", "text": "def sum_difference_product\n puts \"Please enter two integers, seperated by a space...\"\n inputs = gets.chomp.split(' ')\n inputs.each_with_index {|n, i| inputs[i] = n.to_i}\n sum = inputs[0] + inputs[1]\n difference = inputs[0] - inputs[1]\n product = inputs[0] * inputs[1]\n\n puts sum\n puts difference\n puts product\nend", "title": "" }, { "docid": "628277104646b3e221a8a4b03b172ca0", "score": "0.75061077", "text": "def sum_difference_product\n # your code goes here\n puts \"Please enter two integers\"\n \n int1, int2 = gets.chomp.map { |num| num.to_i}\n\n puts (int1 + int2)\n puts (int1 - int2)\n puts (int1 * int2)\nend", "title": "" }, { "docid": "7b4f50677fe552ec8342afc856cbe315", "score": "0.7471443", "text": "def sum_difference_product\n # your code goes here\n input = gets.chomp.split()\n a = input[0].to_f\n b = input[1].to_f\n sum = a + b\n difference = a - b\n product = a * b\n\n puts \"#{sum} #{difference} #{product}\"\nend", "title": "" }, { "docid": "114f8c1f11d2be4590e48b2482e676a8", "score": "0.74651235", "text": "def sum_difference_product\ninput = gets.chomp.split\nputs \"#{input[0].to_i + input[1].to_i}\\n#{input[0].to_i - input[1].to_i}\\n#{input[0].to_i * input[1].to_i}\"\nend", "title": "" }, { "docid": "a79a3acbadb9fb926f894f774e2d09b2", "score": "0.7458353", "text": "def sum_difference_product\n puts \"Please give me two numbers to give you its sum, difference and product\"\n integer1 = gets.chomp.to_i\n integer2 = gets.chomp.to_i\n sum = integer1 + integer2\n difference = integer1 - integer2\n product = integer1 * integer2\n puts \"Here are your results respectively: #{sum}, #{difference}, #{product}\"\nend", "title": "" }, { "docid": "04b179e2d5af3bd1a61ccdf7547e5cc7", "score": "0.745469", "text": "def sum_difference_product\n puts \"Please enter 2 integers\"\n num_arr = gets.chomp.split(\" \").map(&:to_i)\n num1 = num_arr[0]\n num2 = num_arr[1]\n puts num1 + num2\n puts num1 - num2\n puts num1 * num2\n puts\nend", "title": "" }, { "docid": "890257e9b403747dfed86317b5747794", "score": "0.7435284", "text": "def sum_difference_product\n puts \"Input 2 Intergers seperated with a space\"\n\ninput = gets.chomp\na = input.split(' ').map(&:to_i)\nputs \"#{a[0] + a[1]}\"\nputs \"#{a[0] - a[1]}\"\nputs \"#{a[0] * a[1]}\"\nend", "title": "" }, { "docid": "36754dc13b8e1c9609d827444dfefd61", "score": "0.7435167", "text": "def sum_difference_product\n x , y = gets.split.map do |number| \n \tnumber.to_i\n end\n puts x + y \n puts x - y \n puts x * y\nend", "title": "" }, { "docid": "de829dad771e4283d655d96a91980ebd", "score": "0.74197584", "text": "def sum_difference_product\n puts 'Type 2 numbers'\n int = gets.chomp.to_i\n int2 = gets.chomp.to_i\n print \"#{int + int2}\\n#{int - int2}\\n#{int * int2}\\n\"\nend", "title": "" }, { "docid": "dfce350967b35a1a3031a0613221c3f5", "score": "0.74081725", "text": "def sum_difference_product\n input = gets.chomp.split(\" \")\n first = input[0].to_i\n second = input[1].to_i\n puts first + second\n puts first - second\n puts first * second\nend", "title": "" }, { "docid": "ae3ac6c2cabffd6b36091e56f2c58e0a", "score": "0.74061114", "text": "def sum_difference_product\n # your code goes here\n numbers = gets.chomp.split(\" \").map! {|num| num.to_i}.sort\n sum = numbers[0] + numbers[1]\n diff = numbers[0] - numbers[1]\n prod = numbers[0] * numbers[1]\n\n puts sum\n puts diff\n puts prod \nend", "title": "" }, { "docid": "b431734eca8c1d293dbb2691794c9092", "score": "0.73881966", "text": "def sum_difference_product\n comp = gets.split(\" \").map {|num| num.to_i}\n\n a = (comp[0] + comp[1])\n b = (comp[0] - comp[1])\n c = (comp[0] * comp[1])\n \n puts a\n puts b\n puts c\nend", "title": "" }, { "docid": "adaa46afe413ea49953d83bf6bd65219", "score": "0.7371762", "text": "def sum_difference_product\n\tstr = gets \n\tnum = str.split.map {|num| num.to_i}\n\tsum = num[0] + num[1]\n\tdifference = num[0] - num[1]\n\tproduct = num[0] * num[1]\n\tputs \"#{sum}\\n #{difference}\\n #{product}\\n\"\nend", "title": "" }, { "docid": "48b6b5cceedcb98f6097e1ab78f420cc", "score": "0.7364658", "text": "def sum_difference_product\n input = gets().split(\" \") # take the input from user and split into array\n no1 = input[0].to_i # turn the string input into integers and assign the two array values to variable\n no2 = input[1].to_i\n print \"#{no1 + no2}\\n#{no1 - no2}\\n#{no1 * no2}\\n\" # print string using interpolation\nend", "title": "" }, { "docid": "0c6f6c367cf02df855e9d1f8291808a3", "score": "0.7347006", "text": "def sum_difference_product\n operands = gets().chomp.split(\" \").map {|i| Integer(i)}\n puts operands[0] + operands[1], operands[0] - operands[1], operands[0] * operands[1]\nend", "title": "" }, { "docid": "469dbaab8a3888615edffcd93ba2b9a6", "score": "0.7338092", "text": "def sum_difference_product\n # your code goes here\n line = gets\n line.strip!\n int = line.split(' ')\n x = int[0].to_i\n y = int[1].to_i\n sum = x + y\n product = x * y\n difference = x - y\n\n puts \"#{sum}\\\\n#{difference}\\\\n#{'product'}\"\nend", "title": "" }, { "docid": "03babe60a372dfd1a3b644a6dd3aed36", "score": "0.73314667", "text": "def sum_difference_product\n # your code goes here\n\n nums = gets.chomp\n numarr = nums.split(\" \")\n\n a = numarr[0].to_i\n b = numarr[1].to_i\n\n sum = a + b\n diff = a - b\n prod = a * b\n\n puts sum\n puts diff\n puts prod\n\nend", "title": "" }, { "docid": "7358e4ce446b012d364d249e89544af9", "score": "0.732124", "text": "def sum_difference_product\n num = gets.chomp\n a = num.split\n x = a[0].to_i\n y = a[1].to_i\n\n puts x + y\n puts x - y\n puts x * y # your code goes here\nend", "title": "" }, { "docid": "9a33408829f30c7e0e4b2b9ef754c43a", "score": "0.730581", "text": "def sum_difference_product\n num = gets.chomp.split( ).map(&:to_i)\n sum = num.sum\n diff = num[0] - num[1]\n prod = num.inject(&:*)\n \"#{sum}\\n#{diff}\\n#{prod}\\n\"\nend", "title": "" }, { "docid": "5204c92466e901d88ef7418e4185534f", "score": "0.73003465", "text": "def sum_difference_product\n nums = gets.chomp\n both = nums.split(\" \")\n both.map!(&:to_i)\n puts both[0] + both[1]\n puts both[0] - both[1]\n puts both[0] * both[1]\nend", "title": "" }, { "docid": "5fbb8fd8cae0b086e152481638699c6b", "score": "0.72879803", "text": "def sum_difference_product\n raw_input = gets.chomp\n raw_numbers = raw_input.split(' ')\n numbers = []\n raw_numbers.each{|nr| numbers << nr.to_i}\n\n sum = numbers[0] + numbers[1]\n difference = numbers[0] - numbers[1]\n product = numbers[0]*numbers[1]\n\n puts sum, difference, product\n\nend", "title": "" }, { "docid": "dad1626c2ccd78769703e6c90a17062f", "score": "0.72686505", "text": "def sum_difference_product\n\n numbers = gets\n numbers = numbers.split(\" \")\n\n x = numbers[0].to_i\n y = numbers[1].to_i\n\n print \"#{x + y}\\n\" \"#{x - y}\\n\" \"#{x * y}\".to_s\n \nend", "title": "" }, { "docid": "f91a3bec2492c9c45142049161c80552", "score": "0.725845", "text": "def sum_difference_product\nputs \"Please type two integers separated by a space i.e. \\\"9 2\\\"\"\n\nint_array = gets.chomp.split\nint1 = int_array[0].to_i\nint2 = int_array[1].to_i\n\nputs int1 + int2\nputs int1-int2\nputs int1*int2\n\nend", "title": "" }, { "docid": "d11407aed54944f310dcc2b4566643ab", "score": "0.72439784", "text": "def sum_difference_product\n\n puts \"Enter two Integers separated by a space\"\n number = gets.chomp\n \n ar = number.split(\" \").map { |chr| chr.to_i}\n\n puts ar[0] + ar[1]\n puts ar[0] - ar[1]\n puts ar[0] * ar[1]\nend", "title": "" }, { "docid": "da357b1abb0c516971e51ae379eac415", "score": "0.72371286", "text": "def sum_difference_product\n s = gets\n a = s.split\n puts \"#{a[0].to_i + a[1].to_i} #{a[0].to_i - a[1].to_i} #{a[0].to_i * a[1].to_i}\"\nend", "title": "" }, { "docid": "5c396430d41e30b3f98da0a918dac85a", "score": "0.72347456", "text": "def sum_difference_product\n input = gets.chomp\n number_1 = input.split(\" \")[0].to_i\n number_2 = input.split(\" \")[1].to_i\n\n sum = number_1 + number_2\n diff = number_1 - number_2\n prod = number_1 * number_2\n\n print sum.to_s + \"\\n\"\n print diff.to_s + \"\\n\"\n print prod.to_s + \"\\n\"\nend", "title": "" }, { "docid": "81ad9440c8567c069c5d798f119855dd", "score": "0.71928525", "text": "def sum_difference_product\n # your code goes here\n puts \"Enter two numbers\"\n str=gets.chomp\n print str.split(\" \").inject {|sum, n| sum.to_i + n.to_i}.to_s+\"\\n\"+\n str.split(\" \").inject {|sum, n| sum.to_i - n.to_i}.to_s+\"\\n\"+\n str.split(\" \").inject {|sum, n| sum.to_i * n.to_i}.to_s+\"\\n\"\nend", "title": "" }, { "docid": "6de952d7f243e2342e7dc94f55567e24", "score": "0.7172765", "text": "def sum_difference_product\n # your code goes here\n print \"enter first number:\"\n n = gets.chomp\n n = n.to_i\n print \"enter second number:\"\n b = gets.chomp\n b = b.to_i\n sum = n + b\n diff = n - b\n prod = n * b\n puts sum\n puts diff\n puts prod\nend", "title": "" }, { "docid": "ab51316a335835c4fdf170765090d79c", "score": "0.7171342", "text": "def sum_difference_product\n #Firstly we store the input from gets in input.\n input = gets\n #Each number should be separated by a space so we can therefore call split on the string to convert to an array. The numbers can now be accessed independently.\n array = input.split\n #Save each of the numbers in separate variables.\n a = array[0].to_i\n b = array[1].to_i\n #Now print them to console.\n puts a + b\n puts a - b\n puts a * b\nend", "title": "" }, { "docid": "607b29480a4c669d071f4f793a395d2d", "score": "0.7163503", "text": "def sum_difference_product\n\tinput = gets.chomp\n\tarr= input.scan(/-?\\d+/)\n\ta = arr[0].to_i\n\tb = arr[1].to_i\n\tp (a+b).to_s\n\tp (a-b).to_s\n\tp (a*b).to_s\nend", "title": "" }, { "docid": "f4dad22ff96d93feacb6ddaf026294ca", "score": "0.71416235", "text": "def sum_difference_product\n\t#use .map to return the new values - .each leaves the original array intact\n array = gets.split.map {|num| num.to_i}\n \tputs array[0] + array[1]\n \tputs array[0] - array[1]\n \tputs array[0] * array[1]\nend", "title": "" }, { "docid": "96795fb964cce6c438a08445ab7d9570", "score": "0.71314126", "text": "def sum_difference_product \nintegers = gets.chomp\narray = integers.split.map {|x| x.to_i}\nputs array[0] + array[1]\nputs array[0] - array[1]\nputs array[0] * array[1]\n \nend", "title": "" }, { "docid": "64fdaef13e64b43f3fa645c57bfaf6da", "score": "0.7122442", "text": "def sum_difference_product\n n = gets\n n = n.chomp.split\n print \"#{n[0].to_i+n[1].to_i}\\\\n#{n[0].to_i-n[1].to_i}\\\\n#{n[0].to_i*n[1].to_i}\\\\n\"\nend", "title": "" }, { "docid": "0bbd2173fd605b8ce947ce019ac00c89", "score": "0.7110262", "text": "def sum_difference_product\n print \"Enter two integers separated with a space: \"\n numbers = gets.chomp.split( )\n numbers.each_index { |i| numbers[i] = numbers[i].to_i }\n puts (numbers[0] + numbers[1]).to_s\n puts (numbers[0] - numbers[1]).to_s\n puts (numbers[0] * numbers[1]).to_s\nend", "title": "" }, { "docid": "55f6c203b65bce21746f9734a65e2359", "score": "0.705724", "text": "def sum_difference_product\n\n puts \"Please type in a number:\"\n number_1 = gets.chomp.to_i\n puts \"Please type in a second number:\"\n number_2 = gets.chomp.to_i\n\n sum = number_1 + number_2\n difference = number_1 - number_2\n product = number_1 * number_1\n\n puts \"The sum of your two numbers is #{sum}\", \"The difference of your two numbers is #{difference}\", \"and the product of your two numbers is #{product}\"\n\nend", "title": "" }, { "docid": "83941b26b695d9bc91244a190b5cb8fb", "score": "0.705504", "text": "def sum_difference_product\n input = gets.chomp\n ary = input.split(\" \")\n x = ary[0].to_i\n y = ary[1].to_i\n # p ARGV\n # p ary\n # x = ary[0].to_i\n # y = ary[1].to_i\n print \"#{x + y}\\n#{x - y}\\n#{x * y}\\n\"\n # puts x + y\n # puts x - y\n # puts x * y\nend", "title": "" }, { "docid": "7b7844f68ff755947c51aae963797d3e", "score": "0.70430946", "text": "def sum_difference_product\n a = gets.chomp.split(\" \").map(&:to_i)\n # gets obtains the user's string and adds\n # a new line (/n) at the end of the\n # input.\n\n # gets.chomp obtains the user's string\n # and removes the /n.\n\n # .split(\" \") splits the user's string\n # at each blank space in the user's\n # string.\n\n # .map maps each of the split out values\n # from the user's string to an array of\n # substrings, e.g.\n # => user's input = \"1 2\"\n # => [\"1\", \"2\"]\n\n # (&:to_i) converts the array elements\n # from substrings into integers\n\n # Finally, the resulting integer array is\n # assigned to the variable \"a\"\n\n puts a[0] + a[1]\n puts a[0] - a[1]\n puts a[0] * a[1]\n\n # a[0] picks index[0] in the array, e.g.\n # => 1\n # a[1] picks index[1] in the array, e.g.\n # => 2\n # Using the above, ruby is then able to\n # perform the calculations required, e.g.\n # +, - and *.\n\nend", "title": "" }, { "docid": "a639c101febf1458ff9d75ea6c58453d", "score": "0.70393366", "text": "def sum_difference_product\n string = gets.chomp.to_s # input our text as a string\n var1, var2 = string.split.map {|num| num.to_i} # break our string, convert each part to integer var\n puts \"#{var1+var2}\\n #{var1-var2}\\n #{var1*var2}\\n\" # make some math and output it\nend", "title": "" }, { "docid": "36657b0630e2becababa8968015be5c5", "score": "0.70163643", "text": "def sum\n puts.(\"What is the first number?\")\n num1 = Kernel.gets().chomp()\n\n puts.(\"What is the second number?\")\n num2 = Kernel.gets().chomp()\n\n answer = num1.to_i + num2.to_i\n\n puts.(\"The answer is #{answer}.\")\nend", "title": "" }, { "docid": "93bc8a8d097e0fa4d76ca9b2b99c0f4e", "score": "0.6992554", "text": "def sum_difference_product\n\tnum = gets.chomp\n\tnum_array = num.split(' ')\n\tsum = num_array[0].to_i + num_array[1].to_i\n\tdifference = num_array[0].to_i - num_array[1].to_i\n\tproduct = num_array[0].to_i * num_array[1].to_i\n\tprint sum, difference, product\nend", "title": "" }, { "docid": "8c8ddb6f96d0e10212c6cdd3f4d84928", "score": "0.6973409", "text": "def sum_difference_product\n puts \"Enter two numbers separated by a space\"\n numbers = gets.chomp.split\n\n firstnum = numbers[0].to_i\n secnum = numbers[1].to_i\n puts firstnum + secnum\n puts firstnum - secnum\n puts firstnum * secnum\n \nend", "title": "" }, { "docid": "3ae91061154b983223d25936b3331de3", "score": "0.692748", "text": "def sum_difference_product\n print \"Please type a number, followed by a space and then another number, then press enter:\"\n user_input = gets.chomp.split(\" \")\n first_int = user_input[0].to_i\n second_int = user_input[1].to_i\n puts first_int + second_int\n puts first_int - second_int\n puts first_int * second_int\nend", "title": "" }, { "docid": "7c4214d56bef5e103fefd2232b2ccdc5", "score": "0.6857538", "text": "def sum_difference_product\n\tarray = gets.chomp.split(\" \")\n\tto_i = array.map { |i| i.to_i }\n\tputs to_i[0] + to_i[1]\n\tputs to_i[0] - to_i[1]\n\tputs to_i[0] * to_i[1]\nend", "title": "" }, { "docid": "a44f02ca99c8070b93e11855285fb182", "score": "0.6857096", "text": "def sum_difference_product\n input = gets.chomp\n arr = input.split(\" \")\n sum = arr[0].to_i + arr[1].to_i\n difference = arr[0].to_i - arr[1].to_i\n product = arr[0].to_i * arr[1].to_i\n puts sum.to_s\n puts difference.to_s\n puts product.to_s\nend", "title": "" }, { "docid": "4dbf37bb44c0243e2c97087c313eb6ed", "score": "0.6828638", "text": "def sum_difference_product\n result = []\n integers = gets.chomp\n integers = integers.split(\" \")\n integers.each_slice(2) { |a, b| result << a.to_i + b.to_i }\n integers.each_slice(2) { |a, b| result << a.to_i - b.to_i }\n integers.each_slice(2) { |a, b| result << a.to_i * b.to_i }\n print result.join(\"\\n\")\nend", "title": "" }, { "docid": "afd0c6f4e83c5324ad6ee16fd9c1ddd5", "score": "0.6781299", "text": "def sum_difference_product\nz = gets.chomp\n\nn,a = z.split\" \"\n\nb = n.to_i \nc = a.to_i\n\nputs b+c\n\n\nputs b-c\n\n\nputs b*c\n\nend", "title": "" }, { "docid": "e22d58ebcf581a46798f677dfe50d3c4", "score": "0.6775703", "text": "def add_two_numbers\n puts \"enter first number\"\n a = gets.chomp.to_i\n puts \"enter second number\"\n b = gets.chomp.to_i\n result = a + b\n puts \"#{a} + #{b} = #{result}\"\nend", "title": "" }, { "docid": "be2745d83b2cf684d0529e568d72a1f9", "score": "0.6765113", "text": "def sum_difference_product\n x, y = gets.split(\" \").map { |s| s.to_f } \n # split on space\n # luckily, float works for integers in his tesss\n puts x + y, x - y, x * y\n \nend", "title": "" }, { "docid": "75c8ead01874b224b3911e7a6c44bbd0", "score": "0.6747146", "text": "def sum_difference_product\n sum=0\n difference=0\n product=0\n\n array = (ARGF.read.split(\" \")).map {|a| a.to_i}\n sum = array[0]+array[1]\n difference =array[0]-array[1]\n product= array[0]*array[1]\n $stdout << sum <<difference<<product\n end", "title": "" }, { "docid": "20e57a67d7cfb9b9adaf87b0fd8649c1", "score": "0.6692281", "text": "def subtraction\nprint \"What is your first number? \"\nfirst_num_sub = gets().to_i\n\nprint \"What is your second number? \"\nsecond_num_sub = gets().to_i\nresult = first_num_sub - second_num_sub\nputs \"#{first_num_sub} - #{second_num_sub} = #{result}\"\nend", "title": "" }, { "docid": "b3923818ec91df5e77da14ba49c87d28", "score": "0.6688062", "text": "def addition\n puts \"Please enter the two numbers you want to add\"\n number1 = gets.to_i\n number2 = gets.to_i\n p \"#{number1} + #{number2} = #{number1+number2}\"\nend", "title": "" }, { "docid": "e19bf3dff7c91819734b38efe5868785", "score": "0.6685579", "text": "def sum_difference_product\n\tflag = false\n\tx = -1\n\tc = gets\n\twhile flag == false\n\t\tx+=1\n\t\tif c[x] == \" \"\n\t\t\tflag = true\n\t\tend\n\tend\n\ta = c[0..x-1].to_i\n\tb = c[x+1..-1].to_i\n\n\tputs a + b\n\tputs a - b\n\tputs a * b\nend", "title": "" }, { "docid": "5b724b0a521ecebcd5c958bf6e3a21bc", "score": "0.6648828", "text": "def sum_difference_product(number = gets)\n # your code goes here\n arr = number.split\n arr_nospace = arr.map {|x| Integer(x) rescue nil}.compact\n\n puts arr_nospace[0] + arr_nospace[1]\n puts arr_nospace[0] - arr_nospace[1]\n puts arr_nospace[0] * arr_nospace[1]\n\nend", "title": "" }, { "docid": "b8710f4165bf376e0202092fcad8e1f4", "score": "0.66351306", "text": "def sum_difference_product\n arr = []\n while inputnumber = gets # While input comes in, keep adding to array\n break if inputnumber == \"\\n\" # Break if 'enter' is pressed\n inputnumber.split.map do |integer| # Split input based on empty space between inputs\n arr << integer.to_i # Add integer to array in integer format\n end\n #print arr\n end\n\n # calculations\n puts arr[0] + arr[1]\n puts arr[0] - arr[1]\n puts arr[0] * arr[1]\nend", "title": "" }, { "docid": "7993c6b5468822278bd319bfea443653", "score": "0.6537126", "text": "def multiply()\n puts \"Please enter first number to be multiplied\"\n num1 = gets.chomp\n puts num1.to_s + \" will be mulitplied by, enter second number: \"\n num2 = gets.chomp\n puts \"The result is: \" \n p num1.to_i * num2.to_i \nend", "title": "" }, { "docid": "2b9f5311d9e11aee74b7991eb4fd520f", "score": "0.6524834", "text": "def addition(input1, input2)\n\tprint \"The sum of #{input1} and #{input2} is #{input1 + input2} \\n\"\nend", "title": "" }, { "docid": "1d097569c49da49204a3194ec1868a25", "score": "0.6518444", "text": "def arithmetic\n puts \"==> Enter the first number:\"\n num1 = gets.chomp.to_i\n\n puts \"==> Enter the second number:\"\n num2 = gets.chomp.to_i\n\n puts \"==> #{num1} + #{num2} = #{num1 + num2}\"\n puts \"==> #{num1} - #{num2} = #{num1 - num2}\"\n puts \"==> #{num1} * #{num2} = #{num1 * num2}\"\n puts \"==> #{num1} / #{num2} = #{num1 / num2}\"\n puts \"==> #{num1} % #{num2} = #{num1 % num2}\"\n puts \"==> #{num1} ** #{num2} = #{num1 ** num2}\"\nend", "title": "" }, { "docid": "bb645f10326ae5482619d8542db16f6c", "score": "0.6500403", "text": "def add\n print \"What is your first number? \"\n first_number = gets.to_f ## turns inputs into a float\n\n print \"What is your second number? \"\n second_number = gets.to_f\n## tha math of 2 inputs given\n result = first_number + second_number\n## prints the result out\n puts \"The result is #{result}\"\n\nend", "title": "" }, { "docid": "981f44aef7f1658bec28f6930ed3c18e", "score": "0.6470184", "text": "def easy_pythagoras\n\n puts \"A ?\"\n a_string = gets.chomp\n a = a_string.to_i\n puts \"B ?\"\n b_string = gets.chomp\n b = b_string.to_i\n\n a_final = a ** 2\n b_final = b ** 2\n step1 = a_final + b_final\n answer = step1 ** 2\n\n answer_if_restart()\n\n\nend", "title": "" }, { "docid": "913c1519a856abd2c684b357026de83a", "score": "0.6468056", "text": "def subtract()\n\t\tputs \"enter numbers to get the difference \"\n\t\ta=gets.to_i\n\t\tb=gets.to_i\n\t\tm=a-b\n\t\tputs m\n\tend", "title": "" }, { "docid": "9ff7dd34ce956f5ebab46f1b104eed19", "score": "0.64623445", "text": "def sum_difference_product\n input = gets\n array = input.chomp.split(\" \")\n array = array.map {|index| index.to_i }\n difference = (array[0] - array[1])\n sum = array.inject(0){|sum,x|sum+x}\n product = array.inject{|sum,x|sum*x}\n print \"#{sum}\\n#{difference}\\n#{product}\\n\"\nend", "title": "" }, { "docid": "54f931768ab911beb47e69d6e985ca7a", "score": "0.6450772", "text": "def calc_sum_two(first, second)\n puts \"The sum of #{first} and #{second} is #{first + second}\"\nend", "title": "" }, { "docid": "6647f41fde05245918421c6f429f07bd", "score": "0.6448167", "text": "def addition\n # defining addition\n print \"What is your first number?\"\n first_num = gets().to_i #turns a string into an integer\n\n print \"What is the second number?\"\n second_num = gets().to_i\n\n result = first_num + second_num\n puts \"#{first_num} + #{second_num} = #{result}\"\nend", "title": "" }, { "docid": "f5feaabf0ec1253349a8575aba0d15c4", "score": "0.6444759", "text": "def multiply()\n\t\tputs\"enter 2 numbers to multiply\"\n\t\ta=gets.to_i\n\t\tb=gets.to_i\n\t\tm=a*b\n\t\tputs m\n\tend", "title": "" }, { "docid": "fe3f7558073c0ce910eff7dc4e9939df", "score": "0.64438736", "text": "def add\n\tputs \"What is your first number?\"\n\tfirst_num = gets.to_f\n\tputs \"What is your second number?\"\n\tsecond_num = gets.to_f\n\n\tputs \"The result is #{first_num + second_num}\"\nend", "title": "" }, { "docid": "35d87bbc109092d8ec5f429c58498138", "score": "0.64415425", "text": "def simple_maths\n p \"What is the first number\"\n a = gets.chomp.to_i\n p \"What is the second number\"\n b = gets.chomp.to_i\n puts \"#{a} + #{b} = #{a+b}\\n#{a} - #{b} = #{a-b}\\n#{a} * #{b} = #{a*b}\\n#{a} / #{b} = #{a/b}\"\nend", "title": "" }, { "docid": "d7b1f97d0ee73a505efe945d999d2c3e", "score": "0.64298975", "text": "def main(input, output)\n sum = 0\n current_buffer = []\n current_multiplier = MULTIPLIERS.fetch('+')\n\n input.each_char do |c|\n if c.strip == ''\n break\n elsif c == '+' || c == '-'\n sum += sum_buffer(current_buffer, current_multiplier)\n current_multiplier = MULTIPLIERS.fetch(c)\n current_buffer = []\n else\n current_buffer << c.to_i\n end\n end\n\n sum += sum_buffer(current_buffer, current_multiplier)\n\n puts sum\nend", "title": "" }, { "docid": "4516ba39dcff9a834d0bb82fdf48ee74", "score": "0.6427979", "text": "def calculator\n loop do # same as `while true do`\n print '>'\n input = gets.chomp.split(' ')\n # p input\n command = input[0].downcase\n # arg1 = input[1].to_f\n # arg2 = input[2].to_f\n # parallel assignment\n # arg1, arg2 = input[1].to_f, input[2].to_f\n arg1, arg2 = input[1, 2].map!(&:to_f)\n\n # p command, arg1, arg2\n case command\n when 'q'\n break\n when 'add', 'sum', 'plus'\n puts arg1 + arg2\n when 'multiply', 'product', '*', 'times'\n puts arg1 * arg2\n when 'substract', 'minus', 'difference', '-'\n puts arg1 - arg2\n when 'divide', '/'\n puts arg1 / arg2\n else\n puts \"I don't understand that.\"\n end\n puts\n end\n puts 'goodbye'\nend", "title": "" }, { "docid": "b1c025f5e9a4964753b045134e8cb786", "score": "0.6411486", "text": "def addition\n print \"What is your first number?\"\n first_num = gets().to_i #turns a string into an integer\n\n print \"What is the second number?\"\n second_num = gets().to_i\n\n result = first_num + second_num\n puts \"#{first_num} + #{second_num} = #{result}\"\nend", "title": "" }, { "docid": "3db97f1ff413a112a936651a1b3b6889", "score": "0.6404366", "text": "def calculator_v2\n loop do # same as `while true do`\n print '>'\n input = gets.chomp.split(' ')\n\n command = input[1].downcase\n # arg1, arg2 = input[0..-1].map! { |n| n.to_f}\n arg1 = input[0].to_f\n arg2 = input[2].to_f\n\n puts command, arg1, arg2\n case command\n when 'q'\n break\n when 'add', 'sum', 'plus', '+'\n puts arg1 + arg2\n when 'multiply', 'product', '*', 'times'\n puts arg1 * arg2\n when 'substract', 'minus', 'difference', '-'\n puts arg1 - arg2\n when 'divide', '/'\n puts arg1 / arg2\n else\n puts \"I don't understand that.\"\n end\n puts\n end\n puts 'goodbye'\nend", "title": "" }, { "docid": "720afe5e0c9cae91ffca8171fe85cd03", "score": "0.64036834", "text": "def calculator\n\tloop do\n\t\tprint '> '\n\t\tinput = gets.chomp.split(' ')\n\t\t# p input\n\t\tcommand = input[0].downcase\n\t\t# parallel assignment\n\t\targ1, arg2 = input[1,2].map! { |n| n.to_f }\n\t\t# p command, arg1, arg2\n\t\tcase command\n\t\twhen \"quit\"\n\t\t\tbreak\n\t\twhen \"add\", \"sum\", \"plus\", \"+\"\n\t\t\tputs arg1 + arg2\n\t\twhen \"multiply\", \"product\", \"*\", \"times\"\n\t\t\tputs arg1 * arg2\n\t\twhen \"subtract\", \"minus\", \"-\", \"difference\"\n\t\t\tputs arg1 - arg2\n\t\twhen \"divide\", \"/\"\n\t\t\tputs arg1 / arg2\n\t\telse\n\t\t\tputs \"I don't understand that\"\n\t\tend\n\t\tputs\n\tend\n\tputs \"goodbye\"\nend", "title": "" }, { "docid": "f492b30d6442187447173a05679a138c", "score": "0.63958174", "text": "def addition\n print \"First value: \"\n first_value = gets.to_f\n print \"Second value: \"\n second_value = gets.to_f\n result = first_value + second_value\n puts \"The result is #{result}\"\nend", "title": "" }, { "docid": "9f6fa09888246699c41b25881b464e03", "score": "0.6391563", "text": "def add\n #prints line and gets inputs, saved in variables (.to_i = convert input to int.)\n print \"What is the first number? \"\n first_num = gets().to_f\n\n print \"What is the second number? \"\n second_num = gets().to_f\n\n result = first_num + second_num #add variables and store in result\n\n puts \"The result is #{result}\" #print result with new line\n puts \"\" #extra space\nend", "title": "" }, { "docid": "5de124e5dee1fd0d89201d6be56d9cad", "score": "0.6381099", "text": "def sum(num_1, num_2)\n puts \"#{num_1} + #{num_2} = #{num_1 + num_2}\"\nend", "title": "" }, { "docid": "b329b6ffbe163e39c59c0f798d1f4411", "score": "0.6380504", "text": "def sum(num1, num2)\n puts \"Adding #{num1} and #{num2}\"\n return num1 + num2\nend", "title": "" }, { "docid": "5e90ab482aa5bb43155e96ef12f507fe", "score": "0.6380125", "text": "def add\n puts \"What is the first number?\"\n num1 = gets.chomp.to_i\n puts \"What is the second number?\"\n num2 = gets.chomp.to_i\n\n sum = num1 + num2\n puts \"The sum of the two numbers is #{sum}\"\nend", "title": "" }, { "docid": "72c589287b92f2ffcf6ead175f11f2eb", "score": "0.6379937", "text": "def add\n puts \"Please enter your first number. \"\n num1 = gets.chomp.to_i\n puts \"Please enter your second number. \"\n num2 = gets.chomp.to_i\n result = num1 + num2\n puts \"#{num1} + #{num2} = #{result}.\"\nend", "title": "" }, { "docid": "2ed0b038a2b56995455a2f2bda63e6a2", "score": "0.63794035", "text": "def add_two_numbers(num1, num2)\n puts \"I'm solving a math problem.\"\n num1 + num2\nend", "title": "" }, { "docid": "67e6233aac6ed29dd81046feea308c41", "score": "0.6367877", "text": "def multiplication\n puts \"Pick your first number.\"\n a = gets.chomp \n puts \"Pick your second number.\"\n b = gets.chomp\n a.to_i * b.to_i\nend", "title": "" }, { "docid": "34ca2d388aff3e59a30a356aeb2943d9", "score": "0.636278", "text": "def run_interface\n n = gets.to_i\n k = gets.split(' ').map(&:to_i)\n puts solution(n, k)\n end", "title": "" }, { "docid": "34ca2d388aff3e59a30a356aeb2943d9", "score": "0.636278", "text": "def run_interface\n n = gets.to_i\n k = gets.split(' ').map(&:to_i)\n puts solution(n, k)\n end", "title": "" }, { "docid": "34ca2d388aff3e59a30a356aeb2943d9", "score": "0.636278", "text": "def run_interface\n n = gets.to_i\n k = gets.split(' ').map(&:to_i)\n puts solution(n, k)\n end", "title": "" }, { "docid": "34ca2d388aff3e59a30a356aeb2943d9", "score": "0.636278", "text": "def run_interface\n n = gets.to_i\n k = gets.split(' ').map(&:to_i)\n puts solution(n, k)\n end", "title": "" }, { "docid": "0fa312c62119b1b653ea63b2301cb146", "score": "0.63575125", "text": "def subtract\n # Ask for some inputs, after some text\n # Turn those inputs into a float, and saves it in some variable\n print \"What is your first number? \"\n first_number = gets.to_f\n\n print \"What is your second number? \"\n second_number = gets.to_f\n\n # Add the two inputs give together and save the result\n result = first_number - second_number\n\n # Print these things out to the screen\n puts \"The result is #{result}\"\n\nend", "title": "" }, { "docid": "eba1a53cb9c830ba1d92796b6a8b8c51", "score": "0.6330241", "text": "def numbers(a, b)\n puts \"The sum of #{a} and #{b} is:\"\n puts a + b\nend", "title": "" }, { "docid": "77154034cd4f1a62237b5a8d6033c8e7", "score": "0.632723", "text": "def sum(n1, n2)\n p \"Add #{n1} + #{n2}\"\nreturn n1 + n2\nend", "title": "" }, { "docid": "f2d1f53662072f0c04ba6fd345d82d57", "score": "0.63219815", "text": "def multiple\n # Ask for some inputs, after some text\n # Turn those inputs into a float, and saves it in some variable\n print \"What is your first number? \"\n first_number = gets.to_f\n\n print \"What is your second number? \"\n second_number = gets.to_f\n\n # Add the two inputs give together and save the result\n result = first_number * second_number\n\n # Print these things out to the screen\n puts \"The result is #{result}\"\n\nend", "title": "" } ]
d538a9ba620050d707fab6bcf24af26d
check whether the uri contains any alias or script_alias keys
[ { "docid": "1b28edc8d29f9d7a60ad60850b666298", "score": "0.0", "text": "def match? type\n match_result = false\n keys = search_space type\n keys.each do |e| \n match_result = @uri.include? e\n if match_result then break end\n end\n match_result\n end", "title": "" } ]
[ { "docid": "05280b45f00c16cecdca6cf604e8e2e7", "score": "0.8441824", "text": "def script_alias?(uri)\n @script_alias.any? {|k,v| uri.include?(k)}\n end", "title": "" }, { "docid": "95eec4d28d9e6eb00f63e867573e0190", "score": "0.7916682", "text": "def alias?(uri)\n @alias.any? {|k,v| uri.include? k}\n end", "title": "" }, { "docid": "48701224ef034aa2eec50b47ec3100bf", "score": "0.688656", "text": "def url_alias_reserved?(alias_to_check)\n if alias_to_check.blank?\n false\n elsif Rails.application.config.reserved_slugs.include?(alias_to_check)\n true\n else\n begin\n Rails.application.routes.recognize_path \"/#{alias_to_check.split('/').first}\"\n return true\n rescue ActionController::RoutingError\n return false\n end\n end\n end", "title": "" }, { "docid": "2bffdf820fb77356fbd6123f36b5be76", "score": "0.67153764", "text": "def alias_exists?(alias_name)\n http_client\n .headers(accept: \"application/json\", content_type: \"application/json\")\n .get(\"#{base_url}/_alias/#{alias_name}\")\n\n true\n rescue SearchFlip::ResponseError => e\n return false if e.code == 404\n\n raise e\n end", "title": "" }, { "docid": "0ee33de0b5f432dc63c6ed83a26256f5", "score": "0.66114354", "text": "def has_alias?(name)\r\n end", "title": "" }, { "docid": "4ffa894f152d92410fc540a1bf95e112", "score": "0.65873414", "text": "def has_aliases?\n return false if aliases.blank? || aliases.nil?\n return false if aliases.downcase == \"none\" || aliases.downcase == \"n/a\" || aliases.downcase == \"no\"\n true\n end", "title": "" }, { "docid": "2079f71686b6285f3ffeb3688bccc10c", "score": "0.6556052", "text": "def alias?\n !@alias.nil? && !@alias.empty?\n end", "title": "" }, { "docid": "8e5f00c94f69a4a18e638a425461084e", "score": "0.6539877", "text": "def alias?(key)\n @aliases.key? key\n end", "title": "" }, { "docid": "719ed3b724e3d452ef31d35bc4f794d9", "score": "0.65199375", "text": "def alias_only?(key)\n true if key && key[0] == '&' && key.split.size == 1\n end", "title": "" }, { "docid": "f07fea7a1e868f7450cfe9549864f04a", "score": "0.6515877", "text": "def is_alias?\n end", "title": "" }, { "docid": "704bc10048f5b24d2340bc352872236d", "score": "0.6340512", "text": "def is_alias?\n return false unless namespace.is_a?(NamespaceObject)\n namespace.aliases.key? self\n end", "title": "" }, { "docid": "376192888d0245ae7a113584065bdcdf", "score": "0.63110894", "text": "def script?\n @uri.include?(@http_conf.script_alias(\"/cgi-bin/\"))\n end", "title": "" }, { "docid": "f8dab51a49de13cab04482c8bcfe2fc4", "score": "0.6309031", "text": "def alias? \n not @alias.nil?\n end", "title": "" }, { "docid": "21711446e2599595aa856e71c5d053ae", "score": "0.6218071", "text": "def alias?\n tags.include?(\"alias of\")\n end", "title": "" }, { "docid": "742d7aecf3a93846d24e53d5a871aa0e", "score": "0.619964", "text": "def is_alias?\n false\n end", "title": "" }, { "docid": "89f68a79523c6f2882c5372793b117cc", "score": "0.6189442", "text": "def matches?(uri); end", "title": "" }, { "docid": "0e2ee7c20b76f915256b55eb9a2bec70", "score": "0.617747", "text": "def alias?\n (not self.symlink?) and self.attribute?('a')\n end", "title": "" }, { "docid": "bf9cc6cd564a598c0b59d820c83692ff", "score": "0.6171326", "text": "def has_key?(uri)\r\n @@keys.has_key?(uri)\r\n end", "title": "" }, { "docid": "96c56b1414b257b982cf4b605c852089", "score": "0.61648256", "text": "def has_key?(uri)\n @@keys.has_key?(uri)\n end", "title": "" }, { "docid": "93b75af8075a8a6c8c251b2d0ff99a19", "score": "0.616266", "text": "def valid_uri?(uri)\n return false unless uri&.host\n\n # iOS/Android/FireOS mobile app links\n return false if %w[itunes.apple.com play.google.com www.amazon.com].include?(uri.host)\n\n # Executable files\n return false if uri.host.end_with?('.exe')\n\n # Links to source code (except exactly github.com/gitlab.com, which are scopes on hackerone)\n return false if %w[github.com gitlab.com].include?(uri.host) && !['', '/'].include?(uri.path)\n\n # Additions for CSE #\n # CSE doesn't like wildcards in the middle of the hostname\n return false if uri.host.index('*', 1)\n\n true\nend", "title": "" }, { "docid": "324a7395c7151b50ec5115087b38ae2a", "score": "0.61475843", "text": "def both_uri_and_standard?(config)\n config.has_key?(:uri) && config.keys.any? do |key|\n STANDARD.include?(key.to_sym)\n end\n end", "title": "" }, { "docid": "324a7395c7151b50ec5115087b38ae2a", "score": "0.61475843", "text": "def both_uri_and_standard?(config)\n config.has_key?(:uri) && config.keys.any? do |key|\n STANDARD.include?(key.to_sym)\n end\n end", "title": "" }, { "docid": "8a750113b937dc17a2f906a9b0cf0453", "score": "0.61404127", "text": "def uri?\n defined? @uri\n end", "title": "" }, { "docid": "edcc9fe74ca231702aaa295d9b10a079", "score": "0.61144453", "text": "def external?(uri)\n link = uri.to_s.downcase.strip\n matches_internal = !@internal_patterns.select{|pattern| link.match(pattern)}.empty?\n matches_external = !@external_patterns.select{|pattern| link.match(pattern)}.empty?\n puts \"LINK=> #{link.to_s} MATCH_INT=>#{matches_internal} MATCH_EXT=>#{matches_external}\"\n return (matches_external || !matches_internal)\n end", "title": "" }, { "docid": "05a67f5e96156b29979d2be3b0ee1e04", "score": "0.6112567", "text": "def check_hrefs\n if absolute.match(/^.*[0-9]$/)\n self.absolute = \"#{absolute}#{Rails.application.config.os_suffix}\"\n end\n\n unless aliases.nil? || aliases.empty?\n self.aliases = aliases.split(' ').map do |aliase|\n aliase.match(/^.*[0-9]$/) && aliase = \"#{aliase}#{Rails.application.config.os_suffix}\"\n end.join(' ')\n end\n end", "title": "" }, { "docid": "b835d4aba2f0d3cff9aaef1a783fc558", "score": "0.6075499", "text": "def alias?\n !@repo.complex_alias? && @repo.alias? && !rootfs?\n end", "title": "" }, { "docid": "1742c72a1ba6e0ff1efcff033707de93", "score": "0.6067642", "text": "def alias_exists?(address, goto = nil)\n malias = if goto\n ::Postfix::Alias.find_by_address_and_goto(address, goto)\n else\n ::Postfix::Alias.find_by_address(address)\n end\n !malias.nil?\n end", "title": "" }, { "docid": "3f073b3bc35a975a9e89fd8263361c33", "score": "0.6050452", "text": "def internal?(uri)\n link = uri.to_s.downcase.strip\n matches_internal = !@internal_patterns.select{|pattern| link.match(pattern)}.empty?\n matches_external = !@external_patterns.select{|pattern| link.match(pattern)}.empty?\n puts \"LINK=> #{link.to_s} MATCH_INT=>#{matches_internal} MATCH_EXT=>#{matches_external}\"\n return (matches_internal && !matches_external)\n end", "title": "" }, { "docid": "0e0b6202d77dfac4a37cc0baa2fd98f7", "score": "0.60417706", "text": "def has?(uri)\n headers[uri] != nil\n end", "title": "" }, { "docid": "a9528ed890dddca6aff303fda14ee70d", "score": "0.59928244", "text": "def valid?(uri); end", "title": "" }, { "docid": "b7d39003d19cd722ee6c91c8d447f0ad", "score": "0.5991905", "text": "def acceptable_from_uri?(uri); end", "title": "" }, { "docid": "905560fc4929698551239bf585f7c374", "score": "0.5953157", "text": "def internal_uri?(uri)\n uri.host.nil? or ((uri.host == root_uri.host) and (uri.port == root_uri.port))\n end", "title": "" }, { "docid": "cf6fa9d5c33901e619e1e6b19eded14c", "score": "0.5942456", "text": "def has_alias?(id, options = {})\n if aliases[id]\n if options[:ignore_context]\n true\n else\n packages = resolve_packages(options)\n modes = resolve_modes(options)\n configurations = resolve_configurations(options)\n begin\n aliases[id][:packages].include?(:all) || aliases[id][:packages].empty? ||\n packages.any? { |package| aliases[id][:packages].include?(package) }\n end && begin\n aliases[id][:modes].include?(:all) || aliases[id][:modes].empty? ||\n modes.any? { |mode| aliases[id][:modes].include?(mode) }\n end && begin\n aliases[id][:configurations].include?(:all) || aliases[id][:configurations].empty? ||\n configurations.any? { |config| aliases[id][:configurations].include?(config) }\n end\n end\n else\n false\n end\n end", "title": "" }, { "docid": "b41658c41938f2f3746ba90ec1163315", "score": "0.5936129", "text": "def check_uri_for_api_key(uri)\n unless uri.user\n fail ArgumentError, \"URI doesn't include an API key\"\n end\nend", "title": "" }, { "docid": "7396f84692d53e9eca92d22173752a6f", "score": "0.59284306", "text": "def is_alias?; end", "title": "" }, { "docid": "a5aafc3d080877602e224383e2b70e36", "score": "0.5926345", "text": "def complex_alias?\n if !alias?\n return false\n\n else\n !!root_data.find do |_, v|\n (v.is_a?(self.class) || v.is_a?(Hash)) && queryable?(:query_data => v) \\\n && by_tag(:query_data => v)\n end\n end\n end", "title": "" }, { "docid": "c3641afc473454ad700ad89df612eff3", "score": "0.5907501", "text": "def alias?(name)\n @aliases.include? name.to_s\n end", "title": "" }, { "docid": "c3641afc473454ad700ad89df612eff3", "score": "0.5907501", "text": "def alias?(name)\n @aliases.include? name.to_s\n end", "title": "" }, { "docid": "45f301c494e44a0f11c110e0078c7e38", "score": "0.5891791", "text": "def alias? name\n @aliases.include? name.to_s\n end", "title": "" }, { "docid": "6833b71427364bbc9e433c0bc44a7bf4", "score": "0.588869", "text": "def is_uri?\n self =~ URI_PATTERN ? true : false\n end", "title": "" }, { "docid": "e403d5033f0d1b2a40995032792bed85", "score": "0.5882162", "text": "def blacklisted_path?(uri)\r\n\t\tshare_path = \"/#{@share_name}\"\r\n\t\tpayload_path = \"#{share_path}/#{@basename}.exe\"\r\n\t\tcase uri\r\n\t\t\twhen payload_path\r\n\t\t\t\treturn false\r\n\t\t\twhen share_path\r\n\t\t\t\treturn false\r\n\t\t\telse\r\n\t\t\t\treturn true\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "ac18da57e0fe08d8b7afc16b8df5ab3a", "score": "0.588134", "text": "def no_hosts_or_uri?(config)\n !config.has_key?(:hosts) && !config.has_key?(:uri)\n end", "title": "" }, { "docid": "ac18da57e0fe08d8b7afc16b8df5ab3a", "score": "0.588134", "text": "def no_hosts_or_uri?(config)\n !config.has_key?(:hosts) && !config.has_key?(:uri)\n end", "title": "" }, { "docid": "b15fc865257902be8b8e9560065c9327", "score": "0.58783334", "text": "def exist?(uri)\n basename = File.basename(uri)\n !list(File.dirname(uri)).find{|entry| File.fnmatch(basename, entry.path)}.nil?\n end", "title": "" }, { "docid": "9b4bcb4b427c50ddd605ecf9f6fce5a5", "score": "0.5875631", "text": "def internal_resource_uri?(uri)\n uri = URI.parse(uri) if uri.is_a?(String)\n base_uri = URI.parse(Conf.base_uri)\n\n uri.relative? || uri.host == base_uri.host && uri.port == base_uri.port\nend", "title": "" }, { "docid": "92811c98128da5755d309ed999dafe2a", "score": "0.5862003", "text": "def is_alias?\n raise CapabilitiesExceeded\n end", "title": "" }, { "docid": "63bc44cef61af05a4405b7f37ac8aced", "score": "0.58611965", "text": "def blacklisted_path?(uri)\r\n\t\tshare_path = \"/#{@share_name}\"\r\n\t\tpayload_path = \"#{share_path}/#{@basename}.exe\"\r\n\t\tcase uri\r\n\t\twhen payload_path\r\n\t\t\treturn false\r\n\t\twhen share_path\r\n\t\t\treturn false\r\n\t\telse\r\n\t\t\treturn true\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "5384132ee2bb58cd024915eaa2133b43", "score": "0.58343625", "text": "def exist_alias(alias_user)\n name_query = DBCon.single_user_query('alias', \"'#{alias_user}'\").size == 1\nend", "title": "" }, { "docid": "2ca190b04bce6ffca6085b2c8544de81", "score": "0.58267075", "text": "def registered?(uri)\n uri = sanitize_uri(uri)\n return @endpoint_mappings.has_key?(uri)\n end", "title": "" }, { "docid": "bd719b2b42d60425dd5086b02d91f789", "score": "0.5817155", "text": "def allows?(uri)\n !forbids?(uri)\n end", "title": "" }, { "docid": "23bc332b684f390de82a021d3fe2888d", "score": "0.5815748", "text": "def check_alias\n self.alias_str = self.alias_str_was\n end", "title": "" }, { "docid": "dbb1aa720dc4053bcab9e5ccb22815a0", "score": "0.5811593", "text": "def checkalias (opts)\n default_options = {\n :alias => ''\n }\n\n opts.reverse_merge! default_options\n post 'checkalias', opts\n end", "title": "" }, { "docid": "83cccaa16732a3ba5bc8060ed8c967bf", "score": "0.58112305", "text": "def term_id_expects_uri?\n return false if term_config.nil? || !(term_config.key? :term_id)\n term_config[:term_id] == \"URI\"\n end", "title": "" }, { "docid": "83cccaa16732a3ba5bc8060ed8c967bf", "score": "0.58112305", "text": "def term_id_expects_uri?\n return false if term_config.nil? || !(term_config.key? :term_id)\n term_config[:term_id] == \"URI\"\n end", "title": "" }, { "docid": "8096f3d4dc0d3f69ff4b13f5f8f3b111", "score": "0.5803658", "text": "def meta_uri?(uri)\n c = uri_components(uri)\n return c.size == 1 && c[0] == 'cloudkit-meta'\n end", "title": "" }, { "docid": "4249550a13e2fdfb1e6a4050aa0f2cc4", "score": "0.580303", "text": "def internal_source?(uri)\n uri = URI(uri)\n\n internal_host?(uri.host) if uri.host\n end", "title": "" }, { "docid": "5c5840ba091216b7c178a8be7d62a888", "score": "0.5792784", "text": "def ensure_alias_sanity\n ALIASES.each do |alph, als|\n als.each do |al|\n ALIASES.each do |alph2, als2|\n next if (alph2 == alph)\n if als2.include?(al) then\n $stderr.printf(\"alias error: alias %p for %p also declared for %p\\n\", alph, al, alph2)\n exit(1)\n elsif alph2 == al then\n $stderr.printf(\"alias error: alias %p for %p is also named %p\\n\", alph, al, alph2)\n exit(1)\n end\n end\n end\n end\nend", "title": "" }, { "docid": "25cd127b6f885ac38af89a73d308ef01", "score": "0.5783911", "text": "def handled_path?( request )\n\t\treturn ! request.path.match( %r|^/?[\\w\\-]+/metadata| )\n\tend", "title": "" }, { "docid": "aeb9802c9834caa424d31898b567825b", "score": "0.57478285", "text": "def asset_path_matched?\n @request.path.start_with?(@prefix) && asset_exists?\n end", "title": "" }, { "docid": "137c9e6ece89073ca20a7b680bb1658a", "score": "0.57445127", "text": "def reference?(uri)\n begin\n ref = URI.parse uri\n rescue URI::InvalidURIError\n return false\n end\n\n return false if ref.host == 'web.theplatform.com'\n return false unless ref.scheme == \"http\" || ref.scheme == \"https\"\n return false unless ref.host.end_with? \".theplatform.com\"\n return false if ref.host.start_with? 'feed.media.theplatform'\n\n true\n end", "title": "" }, { "docid": "31c3166cf453feb7953311ecedb2bebb", "score": "0.5727936", "text": "def blacklisted_path?(uri)\r\n share_path = \"/#{@share_name}\"\r\n payload_path = \"#{share_path}/#{@basename}.dll\"\r\n case uri\r\n when payload_path\r\n return false\r\n when share_path\r\n return false\r\n else\r\n return true\r\n end\r\n end", "title": "" }, { "docid": "a65d008d10630b599364bddb409cfcae", "score": "0.5725401", "text": "def accessible_uri?(uri)\n return false unless valid_uri?(uri)\n _uri = URI.parse(uri)\n path = _uri.path.blank? ? '/' : _uri.path\n begin\n http = Net::HTTP.new(_uri.host, _uri.port)\n if _uri.scheme == 'https'\n http.use_ssl = true\n http.verify_mode = OpenSSL::SSL::VERIFY_NONE\n end\n http.start do |http|\n code = http.head(path).code\n return (code and code.to_i < 400)\n end\n rescue SocketError => e\n if defined?(Rails) and Rails.logger\n Rails.logger.error \"Accessing #{_uri.host} on port #{_uri.port} failed: #{e.inspect}\"\n end\n false\n end\n end", "title": "" }, { "docid": "1c16e4c100e0ecf6b29ef745e7e07eed", "score": "0.572075", "text": "def dodgy_uri?(uri)\r\n uri = uri.to_s\r\n\r\n # special case for poorly-formed entities (missing ';')\r\n # if these occur *anywhere* within the string, then throw it out.\r\n return true if (uri =~ /&\\#(\\d+|x[0-9a-f]+)[^;\\d]/mi)\r\n\r\n # Try escaping as both HTML or URI encodings, and then trying\r\n # each scheme regexp on each\r\n [unescapeHTML(uri), CGI.unescape(uri)].each do |unesc_uri|\r\n DODGY_URI_SCHEMES.each do |scheme|\r\n\r\n regexp = \"#{scheme}:\".gsub(/./) do |char|\r\n \"([\\000-\\037\\177\\s]*)#{char}\"\r\n end\r\n\r\n # regexp looks something like\r\n # /\\A([\\000-\\037\\177\\s]*)j([\\000-\\037\\177\\s]*)a([\\000-\\037\\177\\s]*)v([\\000-\\037\\177\\s]*)a([\\000-\\037\\177\\s]*)s([\\000-\\037\\177\\s]*)c([\\000-\\037\\177\\s]*)r([\\000-\\037\\177\\s]*)i([\\000-\\037\\177\\s]*)p([\\000-\\037\\177\\s]*)t([\\000-\\037\\177\\s]*):/mi\r\n return true if (unesc_uri =~ %r{\\A#{regexp}}mi)\r\n end\r\n end\r\n\r\n nil\r\n end", "title": "" }, { "docid": "61be3cb72f3dad0cb71107fba88afa26", "score": "0.57085884", "text": "def uri?\n false\n end", "title": "" }, { "docid": "24b082fcaed76adeee79dc4246c08548", "score": "0.57065284", "text": "def might_allow_prefix?(prefix)\n !@prefix_denylist.include?(prefix)\n end", "title": "" }, { "docid": "f9b6f71dc73856ab2c1d8af6328054c2", "score": "0.569491", "text": "def check_for_uri(value)\n if value =~ /\\A#{URI::regexp}\\z/\n return true # emits OK result.\n else\n # if it doesn't pass the check, it's a problem.\n return false\n end\n end", "title": "" }, { "docid": "d7f5308ce9265796f3e609e27e6c6cf5", "score": "0.56897503", "text": "def valid_asset_uri?(str)\n # Quick prefix check before attempting a full parse\n str.start_with?(\"file://\".freeze) && parse_asset_uri(str) ? true : false\n rescue URI::InvalidURIError\n false\n end", "title": "" }, { "docid": "724c66712a14f53f3f37119997dd8fa5", "score": "0.568541", "text": "def is_uri?(path)\n path =~ %r{^([-a-z]+:)?//|^cid:}\n end", "title": "" }, { "docid": "eab07a9c161baa4c50c3e2eca1c80629", "score": "0.5682499", "text": "def check_url_for call\n call[3].each do |arg|\n if hash? arg\n if value = hash_access(arg, :only_path)\n return false if false?(value)\n end\n end\n end\n\n true\n end", "title": "" }, { "docid": "45844ed76a33bb85a49068dcfdd5fe90", "score": "0.5676525", "text": "def in_aliases?(aliases, name)\n Array(aliases).map(&:downcase).any? do |element|\n element.downcase == name\n end\n end", "title": "" }, { "docid": "4dc00199ea43c7f823f535d3d7cf334a", "score": "0.5670683", "text": "def valid_asset_uri?(str); end", "title": "" }, { "docid": "4dc00199ea43c7f823f535d3d7cf334a", "score": "0.5670683", "text": "def valid_asset_uri?(str); end", "title": "" }, { "docid": "a1f9f94c95f3eb750b0acfe276522822", "score": "0.5660539", "text": "def allowed?(uri)\n\n uri = objectify_uri(uri)\n path = (uri.path || \"/\") + (uri.query ? '?' + uri.query : '')\n path_allowed?(@robot_id, path)\n\n end", "title": "" }, { "docid": "1043729212b656a264fdea03d3bd7a7e", "score": "0.5660148", "text": "def allowed?(uri)\n parse_host(uri).allowed?(uri, @user_agent)\n end", "title": "" }, { "docid": "798b27e8b26cba9bb2b5cc2f5254a60a", "score": "0.565869", "text": "def should_not_have_reserved_url_alias\n errors.add(:url_alias, :reserved_url_alias) if self.class.url_alias_reserved?(url_alias)\n end", "title": "" }, { "docid": "0819f2dd5c2fa7807ff26ee8b884c68d", "score": "0.56456584", "text": "def external?\n !!(slug.match(/^https?:\\/\\/.+/))\n end", "title": "" }, { "docid": "36738573630ba2324bc60792d0860946", "score": "0.5639836", "text": "def matches_alias?(search_term)\n aliases.include? search_term\n end", "title": "" }, { "docid": "e6f92e91c55cdee0d5a389d511b2d2fc", "score": "0.56378996", "text": "def is_set?(uri) \n if instance.explorator::set == nil\n return false\n end \n instance.all_explorator::set.collect {|x| x.to_s }.include?(uri) \n end", "title": "" }, { "docid": "b3ae69938f3eea76b03024fda2d1b2ed", "score": "0.5637467", "text": "def accepts_uri?(uri)\n parsed_uri = XMLDBApi::DatabaseManager.strip_URI(uri)\n return true if @name == parsed_uri[\"db_name\"]\n return false\n end", "title": "" }, { "docid": "b8274d025920c3316581cc841639585e", "score": "0.56261444", "text": "def native_uri?(uri)\n uri.scheme.present? && uri.path.present?\n end", "title": "" }, { "docid": "c4a2fa71a73e43370c0f93a582e40cad", "score": "0.56231743", "text": "def is_valid_s3_path(uri)\n uri.scheme == 's3' && uri.host && !uri.path[1, uri.path.length].to_s.empty?\n end", "title": "" }, { "docid": "228c187ef5ec30070b4a1d724a05b198", "score": "0.5616813", "text": "def exists?\n if @access_url\n http_head.response_code != 404\n end\n end", "title": "" }, { "docid": "68463b658198883743be5a4952857acd", "score": "0.5611258", "text": "def item?(uri)\n uri.include?('/items/')\n end", "title": "" }, { "docid": "ac213ae2efb278f71b083d2e3c5ac7b5", "score": "0.56096035", "text": "def valid?\n URI::Scheme.valid?(scheme) && URI::Suffix.valid?(host)\n end", "title": "" }, { "docid": "4518e46d962994cf17ec887005089806", "score": "0.560325", "text": "def route_path_usable? path\n res = path.respond_to?( :~ ) || # skip regex\n path =~ /(?:\\:\\w+)|\\*/ || # keys and splats\n path =~ /[\\%\\\\]/ || # special chars\n path[0..-2].include?(\"?\") # an ending ? is acceptable, it'll be chomped\n !res\n end", "title": "" }, { "docid": "33334ccc0af7f7184688903bdb7da2a9", "score": "0.55990106", "text": "def migrate_linked_file?(uri)\n host = uri.host.to_s\n path = uri.path.to_s\n if(host == 'varme.uio.no' or host == 'www.fys.uio.no')\n if(path != '/' and path != '')\n return true\n else\n return false\n end\n elsif(host != '')\n return false\n end\n return super(uri)\n end", "title": "" }, { "docid": "5b1262fc3e0fdbb8f0f49d781d0d8c41", "score": "0.5589643", "text": "def uri_link?(str)\n str && (str.include? ':') && str =~ UriRegexp\n end", "title": "" }, { "docid": "4733d73f76f221b208424aa2bc119a78", "score": "0.55672795", "text": "def verify_uri?\n @enabled ? @verify_uri : @enabled\n end", "title": "" }, { "docid": "a8d5f04108ee859947b5edb4762c5518", "score": "0.55661994", "text": "def link_contains_anchor?(link)\n uri = URI.parse(link)\n uri.fragment.present?\n rescue URI::InvalidURIError\n false\n end", "title": "" }, { "docid": "1c99e081a903b381aee8c062f674051b", "score": "0.55628395", "text": "def blacklisted_path?(uri)\r\n return true if uri =~ /\\.exe/i\r\n return true if uri =~ /\\.(config|manifest)/i\r\n return true if uri =~ /desktop\\.ini/i\r\n return true if uri =~ /lib.*\\.dll/i\r\n return true if uri =~ /\\.tmp$/i\r\n return true if uri =~ /(pcap|packet)\\.dll/i\r\n false\r\n end", "title": "" }, { "docid": "236d756fc6569528aa3908119580a703", "score": "0.5557181", "text": "def trackable?(uri)\n uri && uri.absolute? && %w(http https).include?(uri.scheme)\n end", "title": "" }, { "docid": "ff8447567003b23642202b5245a9a84a", "score": "0.55564547", "text": "def asset_match?(env)\n @request = Rack::Request.new(env)\n @request.path.match(/^#{@prefix}/) && @digests[@request.path.sub(/^#{@prefix}\\//, \"\")]\n end", "title": "" }, { "docid": "6019ebef2fac2cd6fc2936d463c98dc3", "score": "0.5556327", "text": "def contains_uris? string\n not URI.extract(string, /https?/i).empty?\n end", "title": "" }, { "docid": "1bede72415a35f045614394ff49b86b8", "score": "0.55520594", "text": "def resource?(uri)\n uri.include?('/resources/')\n end", "title": "" }, { "docid": "4ffdb6bd0605c0826aa312c19efb1d31", "score": "0.554394", "text": "def client_has_alias?\n client_alias != client_id\n end", "title": "" }, { "docid": "8ead9bd01057ddf70af6076e37cee92f", "score": "0.5541825", "text": "def symbol_alias?(command); end", "title": "" }, { "docid": "2f4630dddf59e2a662a2b884be6ddf1d", "score": "0.55377364", "text": "def valid_host?(host)\n return false if host.nil?\n host = host.host if host.is_a?(URI)\n host == tenancy_host || tenancy_host_aliases.include?(host)\n end", "title": "" }, { "docid": "93765403d557bc042daeff1c5d0e15e7", "score": "0.5532284", "text": "def check_url_for call\n arg = call.first_arg\n\n if hash? arg\n if value = hash_access(arg, :only_path)\n return false if false?(value)\n end\n end\n\n true\n end", "title": "" }, { "docid": "a212ca43ef936e7f6c4303a8d29ac3df", "score": "0.5520948", "text": "def blacklisted_path?(uri)\r\n\t\treturn true if uri =~ /\\.exe/i\r\n\t\treturn true if uri =~ /\\.(config|manifest)/i\r\n\t\treturn true if uri =~ /desktop\\.ini/i\r\n\t\treturn true if uri =~ /lib.*\\.dll/i\r\n\t\treturn true if uri =~ /\\.tmp$/i\r\n\t\treturn true if uri =~ /(pcap|packet)\\.dll/i\r\n\t\tfalse\r\n\tend", "title": "" }, { "docid": "fadd09af7ac9a8b221f028ac6f3f6c1d", "score": "0.55187297", "text": "def alias?\n !!(aliased_tag && aliased_tag != tag)\n end", "title": "" }, { "docid": "3a0eafff54910e209647eb092453aa01", "score": "0.55183905", "text": "def link_present(uri)\n\t @classes.each do |cl|\n\t if cl[:link].uri.to_s.include?(uri)\n\t return true\n\t end\n\t end\n\n\t return false\n\tend", "title": "" } ]
2448469ebd227d45a3a21231a7fa25ba
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.user_mailer.hello.subject
[ { "docid": "d7cd47a2889b7d821e25b26ff03213a1", "score": "0.0", "text": "def hello(user)\n @greeting = \"Hi\"\n attachments[\"hello.zip\"] = File.read(\"c:\\archiv.zip\")\n mail to: user.email\n \n end", "title": "" } ]
[ { "docid": "ea740e704e8f1173fb87b45dfcaaf989", "score": "0.80438447", "text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end", "title": "" }, { "docid": "8928fe4f050d7ebd3e9aa992b07e320a", "score": "0.78464913", "text": "def subject_for\n ActiveSupport::Deprecation.warn \"subject_for\"\n I18n.t(:\"subject\", scope: [:notifications, :mailer],\n default: [:subject])\n end", "title": "" }, { "docid": "542885bb44aabef24a05ce9d9749449c", "score": "0.76297104", "text": "def subject_for(key)\n I18n.t(:\"#{devise_mapping.name}_subject\", scope: [:devise, :mailer, key],\n default: [:subject, key.to_s.humanize])\n end", "title": "" }, { "docid": "0057005be13d2471732baf09ab7f3e03", "score": "0.74186206", "text": "def subject\n \"[#{I18n.t('app_name')} #{Rails.env.upcase}] #{message.subject}\"\n end", "title": "" }, { "docid": "d559f396e2aaf6d814c15d1286fe3fa4", "score": "0.72460455", "text": "def translate(mapping, key)\n I18n.t(:\"#{mapping.name}_subject\", :scope => [:devise, :mailer, key],\n :default => [:subject, key.to_s.humanize])\n end", "title": "" }, { "docid": "dc7d12811f6d234ea98ad06ca7ef51d8", "score": "0.71172893", "text": "def default_i18n_subject(interpolations = {}) # :doc:\n mailer_scope = self.class.mailer_name.tr(\"/\", \".\")\n I18n.t(:subject, **interpolations.merge(scope: [mailer_scope, action_name], default: action_name.humanize))\n end", "title": "" }, { "docid": "f2fecd58a29b9acf94ad3b95a78dc2e7", "score": "0.70042133", "text": "def welcome_email_subject\n @attributes[:welcome_email_subject]\n end", "title": "" }, { "docid": "c99eda28be9b3fe1f10546bb5e4340fb", "score": "0.69939303", "text": "def digest_email_subject(digest_group = nil)\n if digest_group\n translate_path = \"digest_notifier.#{digest_group.i18n_name_space}.email_subjsct\"\n \"#{DigestNotifier.app_name} #{I18n::t(translate_path, :default => 'todays updates')}\"\n else\n \"#{DigestNotifier.app_name} #{I18n::t('digest_notifier.email_subject', :default => 'todays updates')}\"\n end\n end", "title": "" }, { "docid": "75e4ae88ce617fd153e0a7564934bd04", "score": "0.68753374", "text": "def default_subject\n DEFAULT_SUBJECT\n end", "title": "" }, { "docid": "c4a674d85e621eef1f1b8d2584c5ccf4", "score": "0.6834474", "text": "def subject\n I18n.t('flowdock.inbox_message.subject', message_type: I18n.t(\"flowdock.inbox_message.type.#{@type}\"), store_name: current_store.name)\n end", "title": "" }, { "docid": "0c3396cb0dae322e35cdf4231cd444d6", "score": "0.68343043", "text": "def formatted_subject(text)\n name = PersonMailer.global_prefs.app_name\n label = name.blank? ? \"\" : \"[#{name}] \"\n \"#{label}#{text}\"\n end", "title": "" }, { "docid": "a88f0f72dc91909c2d67b95574182c34", "score": "0.6791094", "text": "def subject\n @msg['Subject']\n end", "title": "" }, { "docid": "a88f0f72dc91909c2d67b95574182c34", "score": "0.6791094", "text": "def subject\n @msg['Subject']\n end", "title": "" }, { "docid": "8ce192cb0eeac1cca7c1d5f1295be992", "score": "0.67902106", "text": "def subject\n @subject ||= convert(Mail::Encodings.decode_encode(message.subject || '', :decode))\n end", "title": "" }, { "docid": "25da83c993ce4cf1f7b9941e027ed63a", "score": "0.6757736", "text": "def subject\n email_message.subject\n end", "title": "" }, { "docid": "65bc93ce070dc297b0749b44e859fbe2", "score": "0.6730358", "text": "def default_i18n_subject(interpolations = {})\n I18n.t(:subject, interpolations.merge(i18n_default_params))\n end", "title": "" }, { "docid": "6140e73ee355af7cdcaa1bec13316266", "score": "0.6726518", "text": "def subject\n @subject ||= @email.subject.to_s\n end", "title": "" }, { "docid": "c6afc3626cbbe68cf6cd38b69eea3b85", "score": "0.6692999", "text": "def setup_mail( recipient, data, key, translation_data = {} )\n subject \"[#{ self.class.site_name }] #{ translate( key, translation_data ) }\"\n from NOTIFICATION_EMAILS_COME_FROM # config/initializers/50_general_settings.rb\n recipients recipient\n sent_on Time.now\n content_type 'text/plain'\n body render(\n :file => \"canvass_mailer/#{ key }.txt.erb\",\n :body => { :data => data }\n )\n end", "title": "" }, { "docid": "d2f26cb27e81ae8b03fd141a0f231955", "score": "0.66744024", "text": "def subject=(subject); @message_impl.setSubject subject; end", "title": "" }, { "docid": "adc4d6f399275aa030fdd9d865497b26", "score": "0.664807", "text": "def subject(subj)\n if not subj.instance_of? String\n STDERR.puts \"ELTmail::Mail: subject ERROR: requires a String\"\n exit 1\n end\n @subject=subj\n @message.header.subject=@subject\n end", "title": "" }, { "docid": "086f3cabbe22eb51f456ff15266621f2", "score": "0.6531292", "text": "def subject=(s)\n msg = Message.new\n msg.subject = s\n send(msg)\n end", "title": "" }, { "docid": "519f685ed317139cbea72085c30086ef", "score": "0.64444697", "text": "def subject(*extra)\n subject = []\n\n subject.concat(extra) if extra.present?\n\n if core_config['email_subject_suffix'].present?\n subject << core_config['email_subject_suffix']\n end\n\n subject.join(' | ')\n end", "title": "" }, { "docid": "dc0e2948b8652d7848b464a5ec15a020", "score": "0.6418674", "text": "def subject(string)\n self << \"SUBJECT\" << string\n end", "title": "" }, { "docid": "6878d37f22ad2148cc944a89743c0f15", "score": "0.6407194", "text": "def set_title\n @title = t(:message_1, :scope => [:controller, :students])\n end", "title": "" }, { "docid": "2d6331689dbede789150dacf78dbe51f", "score": "0.63844", "text": "def subject( default = nil )\n if h = @header['subject']\n h.body\n else\n default\n end\n end", "title": "" }, { "docid": "3595e96093bf4fdb3c90ed70810c54bc", "score": "0.6365464", "text": "def subject(string)\n return add_params(SUBJECT, string)\n end", "title": "" }, { "docid": "d3fe97d40a71821834b836df97a93c27", "score": "0.6363446", "text": "def test_set_subject\n email = SendgridRuby::Email.new\n\n email.set_subject(\"Test Subject\")\n assert_equal(\"Test Subject\", email.get_subject)\n end", "title": "" }, { "docid": "5b97accc2422140e68c3765af2839e19", "score": "0.6346362", "text": "def subject\n\n unless @subject\n subject = mail.subject.strip rescue \"\"\n ignores = config['ignore']['text/plain']\n if ignores && ignores.detect{|s| s == subject}\n @subject = \"\"\n else\n @subject = transform_text('text/plain', subject).last\n end\n end\n\n @subject\n end", "title": "" }, { "docid": "8e5e8a32e59042d47143922abe60d271", "score": "0.6345629", "text": "def get_subject(params = {}, alternate_text = '')\n\n # set the subject to the default if nothing else better comes along\n subject = alternate_text\n\n # we have to guard against templates not being loaded\n if @notification_template && @notification_template.subject\n subj_template = Liquid::Template.parse(@notification_template.subject) rescue nil\n subject = subj_template.render({'params' => params})\n end\n subject\n end", "title": "" }, { "docid": "cb3903bb72c279531d812f561910449a", "score": "0.6315795", "text": "def email_changed(record, opts = {})\n opts[:subject] = \"#{default_title}: #{t(:email_changed)}\"\n super\n end", "title": "" }, { "docid": "ab155e65d0a7fb6e58826542bee8d360", "score": "0.63104635", "text": "def auto_reply_subject(enquiry)\n I18n.t('integral.contact_mailer.auto_reply.subject', reference: enquiry.reference)\n end", "title": "" }, { "docid": "18b111f45ada5085dece93ef7fd198d8", "score": "0.6296295", "text": "def topic_subject\n \"#{subject_topic} - #{name}\"\n end", "title": "" }, { "docid": "20e4267b6397ef5409d8d48a8cdac18d", "score": "0.6288781", "text": "def add_default_subject\n self.subject = 'IMPORTANT!!!'\n end", "title": "" }, { "docid": "441e62b981d3668556119f56fbc674a3", "score": "0.6263069", "text": "def set_subject(default_subject)\n Rails.env.production? ? default_subject : \"TEST-#{default_subject}\"\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.626251", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.62617695", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.62617695", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.62617695", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.62617695", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.62617695", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.62617695", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.62617695", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.62617695", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.62617695", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "8a5f0f8f2669885dc872baa7143b45c7", "score": "0.6259406", "text": "def subject_label=(label)\n @subject_label = label\n @subject_label_customized = true\n end", "title": "" }, { "docid": "d7702d3009c5fbeb7c0ccbba6ee0a076", "score": "0.6252611", "text": "def mailer_t(key, options = {})\n t(\n \".#{key}\",\n **options,\n default: t(key, **options, scope: [:mailers])\n )\n end", "title": "" }, { "docid": "0aa1cc7584224f23051efac49931c5e7", "score": "0.6246486", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "0aa1cc7584224f23051efac49931c5e7", "score": "0.6246486", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "0aa1cc7584224f23051efac49931c5e7", "score": "0.6246486", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "01df34cad757e9ffe18fd8399921934c", "score": "0.6242941", "text": "def subject\n @config[\"subject\"]\n end", "title": "" }, { "docid": "0d214ce6c70e5f2f96c759e4cff712c7", "score": "0.6232089", "text": "def subject\n fetch('educator.subject')\n end", "title": "" }, { "docid": "d0e1de61fdd3b17c2381046c60ded7bd", "score": "0.6215184", "text": "def subject_name\n subject_full_name\n end", "title": "" }, { "docid": "01135c890b85dbc9c9f897f87df4fe98", "score": "0.62089103", "text": "def subject=(s)\n raise ArgumentError, \"subject must be a String, or respond to to_s\" unless s.is_a?(String) or s.respond_to?(\"to_s\")\n\n @alert.subject = s\n end", "title": "" }, { "docid": "3ced77486c3fe9f91298bd4216254c91", "score": "0.6195171", "text": "def subject_name\n nil unless @subject\n if subject_class.respond_to?(:human_name)\n subject_class.human_name(:locale => Remarkable.locale)\n else\n subject_class.name\n end\n end", "title": "" }, { "docid": "00b6a5821d086aac53df53d687eee6bd", "score": "0.6175678", "text": "def subject=(subject)\n Cproton.pn_message_set_subject(@impl, subject)\n end", "title": "" }, { "docid": "845e4f68ce289ae4e1388b791bd21f8d", "score": "0.616083", "text": "def set_title\n @title = t(:message_2, :scope => [:controller, :terms])\n end", "title": "" }, { "docid": "de234bc160d6b9ea980e7d1cfb28d1e4", "score": "0.6160693", "text": "def subject\n SMail::MIME.decode_field(subject_raw)\n end", "title": "" }, { "docid": "6a26cb28e002fcdcabff93f31a7d3216", "score": "0.6105884", "text": "def subject=(subject)\n @content[pn(:Subject)] = pl(subject)\n end", "title": "" }, { "docid": "5fb60ea7315445d7605e1eead17dd1e9", "score": "0.60996044", "text": "def subject\n env['trinity.subject']\n end", "title": "" }, { "docid": "50f888854f638edf42618d35300fb025", "score": "0.608952", "text": "def subject=( str )\n set_string_attr 'Subject', str\n end", "title": "" }, { "docid": "91927af29dd0e00c0374e761ec60174c", "score": "0.60891795", "text": "def subject_prefix\n return \"[#{SUBJECT_PREFIX}] \" if Object.const_defined?('SUBJECT_PREFIX')\n ''\n end", "title": "" }, { "docid": "422b8a96f3d51add2d884b8ab82a0752", "score": "0.6084036", "text": "def massage_subject(subject='',errata=nil)\n \"ET: #{\"#{errata.name_release_and_short_title}\" if errata}#{\"#{' - ' if errata}#{subject}\" if !subject.blank?}\"\n end", "title": "" }, { "docid": "4ff9c58cae5e6739edda949291e18f0b", "score": "0.6074548", "text": "def subject=(text)\n self.subject_raw = SMail::MIME.encode_field(text)\n end", "title": "" }, { "docid": "592a4cdad3b2f1f9377bb8994ad24ca8", "score": "0.6069679", "text": "def default_subject_prefix\n @default_subject_prefix || \"[VALIDATION ERROR]\"\n end", "title": "" }, { "docid": "acf6d147f72804aba88819156ef816a8", "score": "0.6050634", "text": "def subject=(subject)\n @subject=subject\n end", "title": "" }, { "docid": "23eff6c61a6c900432383b9130c65add", "score": "0.60472715", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.60449684", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.60449684", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.60449684", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.60449684", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.60449684", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.60449684", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.60449684", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "c467d463e8e174d4b909bb1a9e466b55", "score": "0.60380584", "text": "def subject\n envelope[:subject]\n end", "title": "" }, { "docid": "6e74d38982d77ab2d4f1247a232115b0", "score": "0.60303175", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "f4f7fbf7a6c1b9a18070b243febadd82", "score": "0.601148", "text": "def subject\n @message.split(/$/).first\n end", "title": "" }, { "docid": "f4f7fbf7a6c1b9a18070b243febadd82", "score": "0.601148", "text": "def subject\n @message.split(/$/).first\n end", "title": "" }, { "docid": "fa33adbf1eecc39bcd457b78590d6d3f", "score": "0.5993702", "text": "def subject=(s)\n\t\t@subject = s\n\tend", "title": "" }, { "docid": "cf2a25634b64117bc458dafa8c7f8602", "score": "0.5990069", "text": "def subject=(s)\n self.cached_alert_group = nil\n attribute_set(:subject, s)\n end", "title": "" }, { "docid": "3e1425a9bedfe6a65d651b5d5841dbf2", "score": "0.59893054", "text": "def sns_subject\n return default_sns_subject unless subject\n context = self\n eruby = Erubis::Eruby.new(fix_subject_encoding(subject))\n fix_subject_encoding(eruby.evaluate(context))[0..99]\n end", "title": "" }, { "docid": "adab5fbcef94747391c4ce52e337047e", "score": "0.5973806", "text": "def subject=(subject)\n set_content_for :subject, subject\n end", "title": "" }, { "docid": "98da9102c01851fa213c08ba869b9856", "score": "0.59674484", "text": "def subject=(subject)\n @subject = subject\n end", "title": "" }, { "docid": "7a71c38641a8e1e8d966f64a383149ae", "score": "0.59573305", "text": "def translation_email\n @translations = get_translation_by_lang\n lang_parsed = JSON.parse(@translations)\n @data = lang_parsed['data']\n @mailT = @data[0]['Miscellaneous']['mail']\n\n end", "title": "" }, { "docid": "2316f65233b6fb2d5ca6cbcf9856af69", "score": "0.5946036", "text": "def deliver_invitation(options = {})\n super(options.merge(subject: _('A Data Management Plan in %{application_name} has been shared with you') % {application_name: Rails.configuration.branding[:application][:name]}))\n end", "title": "" }, { "docid": "0bb51af8e2fb83533ca430c259063010", "score": "0.59442693", "text": "def subject(subj = nil)\n set_multi_simple(:subject, subj)\n end", "title": "" }, { "docid": "d8decc4e6f01660c7e8f4bb726fe5ad1", "score": "0.59252256", "text": "def set_subject(s)\n self.subject = s\n self\n end", "title": "" }, { "docid": "917cbe14183cf342539eabdfc66fca4c", "score": "0.59205544", "text": "def subject\n @header[:subject]\n end", "title": "" }, { "docid": "dfa4ecb662f4081560f4e222e22056ef", "score": "0.5919164", "text": "def define_subject(subject)\n if subject =~ /^Re: /\n subject\n else\n \"Re: #{subject}\"\n end\n end", "title": "" }, { "docid": "60a2d908c8044990c844333ae54c7235", "score": "0.5917369", "text": "def SetSubject(subject)\n #Subject of document\n @subject = subject\n end", "title": "" }, { "docid": "9f95361cf5e95156660c6c2cbddcb24a", "score": "0.59098876", "text": "def subject_and_body\n if subject.blank?\n body.blank? ? '' : body\n else\n body.blank? ? subject : \"#{subject} - #{body}\"\n end\n end", "title": "" }, { "docid": "6427ec8e71d712ad7ec5452db3e52455", "score": "0.590904", "text": "def mail_to_subscriber(email)\n begin\n @lang = Helper.getLang\n @setting = Setting.where(lang: @lang, id: 1, deleted_at: nil).select(:email, :address, :phone_dn).first\n mail(to: email, subject: '[ANS Asia] BrSE School - ' + t('mail_title_thanks_for_subscribing'))\n rescue\n end\n end", "title": "" }, { "docid": "d02590da2d541720cfc9e50f188c9ac4", "score": "0.5907527", "text": "def email\n @subtitle = \"Email\"\n end", "title": "" }, { "docid": "08611253a1d3cae6dfbc8b4238e247ee", "score": "0.5897482", "text": "def subject\n @subject = page.present? ? page.present_title(vars) : nil\n end", "title": "" }, { "docid": "0e679dd9a9eb0f4062d41f4be02e2f76", "score": "0.5895592", "text": "def subjects\n @subjects ||= {\n :price => t('subjects_price'),\n :questions => t('subjects_questions'),\n :marketing => t('subjects_marketing'),\n :design => t('subjects_design'),\n :hosting => t('subjects_hosting'),\n :other => t('subjects_other')\n }\n end", "title": "" }, { "docid": "c4fcd9e3a0747f45ee564b57aae08035", "score": "0.5894115", "text": "def setup_mail(record, key)\n scope_name = Devise::Mapping.find_scope!(record)\n mapping = Devise.mappings[scope_name]\n\n subject translate(mapping, key)\n from mailer_sender(mapping)\n recipients record.email\n sent_on Time.now\n content_type Devise.mailer_content_type\n body render_with_scope(key, mapping, mapping.name => record, :resource => record)\n end", "title": "" }, { "docid": "23e44ff15cdae487c2ad8105539c6cf7", "score": "0.58901733", "text": "def headers\n {\n :subject => \"New locl shows message\",\n :to => \"brockdonovan@gmail.com\",\n :from => %(\"#{name}\" <#{email}>)\n }\n end", "title": "" }, { "docid": "1f23f200a3e5878c4bd5453d4bf9dafe", "score": "0.58783025", "text": "def subject=(s)\n replace_element_text('subject', s)\n end", "title": "" }, { "docid": "d7d5a9a0a42ea8916b34a3e34963e03c", "score": "0.5876992", "text": "def generate_subject\n hostname = get_nagios_var(\"NAGIOS_HOSTNAME\")\n service_desc = get_nagios_var(\"NAGIOS_SERVICEDESC\")\n notification_type = get_nagios_var(\"NAGIOS_NOTIFICATIONTYPE\")\n state = get_nagios_var(\"NAGIOS_#{@state_type}STATE\")\n\n subject=\"#{hostname}\"\n subject += \"/#{service_desc}\" if service_desc != \"\"\n\n if @state_type == \"SERVICE\"\n long_subject=\"#{notification_type} Service #{subject} is #{state}\"\n else\n long_subject=\"#{notification_type} Host #{subject} is #{state}\"\n end\n\n @content[:subject] = long_subject\n @content[:short_subject] = \"\"\n end", "title": "" }, { "docid": "8609ca995a383a5dc956d31e69ecd413", "score": "0.5875067", "text": "def translate( key, translation_data = {} )\n I18n.t(\n \"uk.org.pond.canvass.canvass_mailer.#{ key }\",\n translation_data.merge!( :default => key )\n )\n end", "title": "" }, { "docid": "3b0a8a1542280ae47a5043ebc8f96723", "score": "0.5874841", "text": "def headers\n {\n :subject => \"[#{about}] #{subject}\",\n :to => '#{ORG::EMAIL}',\n :from => %(\"#{username}\" <#{email}>)\n }\n end", "title": "" }, { "docid": "d1218dbdf1f4d6440a7052ed9c17a370", "score": "0.5872186", "text": "def message\n t(\".message\", name: params[:personal_library].user.first_name, letter: params[:personal_library].user.last_name.first.upcase, document: params[:personal_library].label )\n end", "title": "" } ]
fc711f62b38c39ac33c7810aff68584f
returns snow info for the given resort
[ { "docid": "1dae761f842902ff73918d453d6ce4aa", "score": "0.7812233", "text": "def snow_info_for_resort(resort)\n resort_id = resort.SyndicObjectID\n @snow_svc.Objects.filter(\"STATION eq '#{resort_id}'\").order_by(\"Updated\")\n @snow_svc.execute\n end", "title": "" } ]
[ { "docid": "e97688117b43443e97d05f760aee4f96", "score": "0.6475013", "text": "def info_for_resort(resort_name)\n @resort_svc.Objects.filter(\"NOMSTATION eq '#{resort_name}'\")\n @resort_svc.execute\n end", "title": "" }, { "docid": "9e248125a22b30a8d73a9a4890c7702d", "score": "0.5929289", "text": "def weather_for_resort(resort)\n resort_id = resort.SyndicObjectID\n @weather_svc.Objects.filter(\"STATION eq '#{resort_id}'\").order_by(\"day(Updated)\")\n .order_by(\"month(Updated)\")\n .order_by(\"year(Updated)\")\n @weather_svc.execute\n end", "title": "" }, { "docid": "ab4b760104a1c3bc799797c3c95ba1e5", "score": "0.5821582", "text": "def determine_snow_jacket_points\n weather_data['list'][0..3].any? { |wd| wd['snow'].try(:keys).try(:any?) } ? 10 : 0\n end", "title": "" }, { "docid": "553615748379eb1317152fc2f9352135", "score": "0.5788754", "text": "def _state_snow_report(state_id)\n get(subscription, 'region/resorts/snow', state_id, options: { type: :array })\n end", "title": "" }, { "docid": "fdec3f3a358a1f2fd8db85f1a937919f", "score": "0.53934354", "text": "def scrape_season\n doc = Nokogiri::HTML(open(url))\n \n seasonality_url = doc.search(\"#survival-guide ul li:nth-child(2) a\").attr(\"href\").text #get country weather url\n weather_pg = Nokogiri::HTML(open(seasonality_url))\n \n #get high, low, and best time to visit information\n @high_season = weather_pg.search(\"div.card--page__content p:nth-child(1)\").text\n @low_season = weather_pg.search(\"div.card--page__content p:nth-child(5)\").first.text\n\n shoulder_season = weather_pg.search(\"div.card--page__content p:nth-child(3)\").first.text\n @best_visit_season = \"Best time to visit \" + shoulder_season[16..-1]\n end", "title": "" }, { "docid": "0e96c25374d9f640dd7717bf028d9cca", "score": "0.5384278", "text": "def get_first_name_of_season_winner(data, season)\n data.each do |season_iteration, stats|\n if season_iteration == season\n stats.find do |winner|\n if winner[\"status\"] == \"Winner\"\n return winner[\"name\"].split.first\n end\n end\n end\n end\nend", "title": "" }, { "docid": "238b20cf7b47bc42475a597fe574c4bf", "score": "0.53406596", "text": "def get_winner(season)\n winner = nil\n season.each do |contestant|\n if contestant[\"status\"] == \"Winner\"\n winner = contestant[\"name\"]\n end\n end\n #binding.pry\n winner\nend", "title": "" }, { "docid": "6bd6f2cc6b69f6ec3740d650a42ce5b9", "score": "0.53335947", "text": "def get_stats (stats)\n if stats.season_exists\n stats.update_stats\n stats.display\n else\n puts \"There are no recorded statistics for that season.\"\n end\nend", "title": "" }, { "docid": "bedaebe07f869af1c040ceb2c5ddb9e9", "score": "0.5313397", "text": "def flu_season\n event_display(\"It's flu season!\\n One player has been infected and needs some time to recuperate.\")\n {Game.last.players.sample.id.to_s =>\n {wellbeing: -100}\n }\n end", "title": "" }, { "docid": "eb62359c9117f8ebe814d735e8eba86c", "score": "0.52775884", "text": "def planet_info #(there's no parameter here)\n puts \"#{@name} has #{@orbital} days in one of its years, weighs #{@mass} earth, has #{@moons}, and is #{@distance_from_sun} million miles from the sun.\"\n end", "title": "" }, { "docid": "31e3eb29e6e75fe04e3ba5ff566c747f", "score": "0.52642155", "text": "def get_contestant_name(data, occupation)\n data.each do |season_hash, info|\n info.each do |detail|\n if detail[\"occupation\"] == occupation\n return detail[\"name\"]\n end\n end\n end\n# binding.pry\nend", "title": "" }, { "docid": "559741bd6edaa66d453bcd5abbda46e7", "score": "0.52074426", "text": "def darksky_response\n connect_darksky.get(\"/forecast/#{ENV[\"DARK_SKY_API_KEY\"]}/#{@lat},#{@lng}\")\n end", "title": "" }, { "docid": "a7ee64f42fd07c79dbbc7b9832ab7cf3", "score": "0.5204019", "text": "def rain_chance\n new_array = client.weather_data[\"hourly\"][\"data\"].find_all {|r| r[\"precipProbability\"] > 0}\n first_rain = new_array[0]\n time_of_rain = first_rain[\"time\"]\n datetime_rain = Time.at(time_of_rain).to_datetime\n now = Time.now\n time_til_rain_seconds = time_of_rain.to_i - now.to_i\n time_til_rain_hours = time_til_rain_seconds / 3600\n rain_intensity = first_rain[\"precipIntensity\"]\n end", "title": "" }, { "docid": "cf0c21f1f79ec176b510c89c25cdaa41", "score": "0.5156767", "text": "def get_first_name_of_season_winner(data, season)\n data[season].each do |person| \n return person[\"name\"].split.first if person[\"status\"] == \"Winner\"\n end\nend", "title": "" }, { "docid": "cd24ffddd7648a7a3f1fbf1d843e3e37", "score": "0.515191", "text": "def skeins\n data[:skeins]\n end", "title": "" }, { "docid": "f93de3642b6f73e7ce49c56c4c101464", "score": "0.51387745", "text": "def show\n @resort = Resort.find(params[:id])\n @resort.update_weather\n\n render json: { resort: @resort }\n end", "title": "" }, { "docid": "2f33b1755a3d8b30fad6febed7bf8c3b", "score": "0.51313466", "text": "def get_first_name_of_season_winner(data, season)\n data[season].each do |person|\n person.each do |k,v|\n if v == \"Winner\"\n full_name = person[\"name\"].split\n return full_name[0]\n end\n end\n end\nend", "title": "" }, { "docid": "319482e28a805bd0c41952dd4c8fda94", "score": "0.5112494", "text": "def get_occupation(data, hometown)\n data.each do |season_hash, info|\n info.each do |detail|\n if detail[\"hometown\"] == hometown\n return detail[\"occupation\"]\n end \n end \n end\nend", "title": "" }, { "docid": "e7eb8e0e0c32ae6d8cb532fb1bb682f6", "score": "0.5081377", "text": "def second_supply_for_fourth_of_july(holiday_hash)\n holiday_hash.each do |season, details|\n details.each do |holiday, supplies|\n if holiday == :fourth_of_july\n return supplies[1]\n end\n end\n end\nend", "title": "" }, { "docid": "8b817a9267d1a965a0bfbb3734ed7915", "score": "0.50738627", "text": "def getMidSeasonStatistics()\n for player in @skater_data\n begin\n stats = JSON.parse((RestClient.get \"https://statsapi.web.nhl.com/api/v1/people/#{player[5]}/stats?stats=statsSingleSeason\"))[\"stats\"][0][\"splits\"][0][\"stat\"]\n gamesLeft = 82 - @games_played[player[player.length-1]]\n player[6] = ((player[6].to_f/82)*gamesLeft + stats[\"goals\"]).to_i\n player[7] = ((player[7].to_f/82)*gamesLeft + stats[\"assists\"]).to_i\n player[8] = ((player[8].to_f/82)*gamesLeft + stats[\"powerPlayPoints\"]).to_i\n player[9] = ((player[9].to_f/82)*gamesLeft + stats[\"plusMinus\"]).to_i\n player[10] = ((player[10].to_f/82)*gamesLeft + stats[\"shots\"]).to_i\n player[11] = ((player[11].to_f/82)*gamesLeft + stats[\"hits\"]).to_i\n rescue\n gamesLeft = 82 - @games_played[player[player.length-1]]\n player[6] = ((player[6].to_f/82)*gamesLeft).to_i\n player[7] = ((player[7].to_f/82)*gamesLeft).to_i\n player[8] = ((player[8].to_f/82)*gamesLeft).to_i\n player[9] = ((player[9].to_f/82)*gamesLeft).to_i\n player[10] = ((player[10].to_f/82)*gamesLeft).to_i\n player[11] = ((player[11].to_f/82)*gamesLeft).to_i\n end\n puts player\n end\n for goalie in @goalie_data\n begin\n stats = JSON.parse((RestClient.get \"https://statsapi.web.nhl.com/api/v1/people/#{goalie[5]}/stats?stats=statsSingleSeason\"))[\"stats\"][0][\"splits\"][0][\"stat\"]\n gamesLeft = 82 - @games_played[goalie[goalie.length-1]]\n goalie[6] = ((goalie[6].to_f/82)*gamesLeft + stats[\"gamesStarted\"]).to_i\n goalie[7] = ((goalie[7].to_f/82)*gamesLeft + stats[\"wins\"]).to_i\n goalie[9] = (((goalie[9].to_f)*gamesLeft + stats[\"savePercentage\"]*@games_played[goalie[13]])/82).round(4)\n goalie[11] = (((goalie[11].to_f)*gamesLeft + stats[\"goalAgainstAverage\"]*@games_played[goalie[13]])/82).round(4)\n goalie[12] = ((goalie[12].to_f/82)*gamesLeft + stats[\"shutouts\"]).to_i\n rescue\n gamesLeft = 82 - @games_played[goalie[goalie.length-1]]\n goalie[6] = ((goalie[6].to_f/82)*gamesLeft).to_i\n goalie[7] = ((goalie[7].to_f/82)*gamesLeft).to_i\n goalie[9] = ((goalie[9].to_f/82)*gamesLeft).to_i\n goalie[11] = ((goalie[11].to_f/82)*gamesLeft).to_i\n goalie[12] = ((goalie[12].to_f/82)*gamesLeft).to_i\n end\n puts goalie\n end\nend", "title": "" }, { "docid": "fe60364403b77ee1ea2cacc21940ca97", "score": "0.5069717", "text": "def currently_snowing?\n\tomaha_coordinates = \"41.2524,-95.9980\"\n\n\tapi_url = \"https://api.darksky.net/forecast/#{ENV[\"DARK_SKY_API_KEY\"]}/#{omaha_coordinates}\"\n\n\tresponse = HTTParty.get(api_url)\n\n\tresponse_hash = response.to_h\n\n\tcurrent_weather = response_hash[\"currently\"]\n\n\tif current_weather[\"icon\"].downcase == \"snow\"\n\t\treturn true\n\telse\n\t\treturn false\n\tend\nend", "title": "" }, { "docid": "c113b24c2c142e257550ad9f533c3eeb", "score": "0.5068731", "text": "def get_season_hall_of_fame\n @seasons_hall_of_fame ||= retrieve_season_hall_of_fame\n end", "title": "" }, { "docid": "87276398584b9fd51edf704a9a6ba4d4", "score": "0.5060477", "text": "def season_summary(season, team_id)\n season = season.to_i\n team_id = team_id.to_i\n season_summary_hash(season, team_id)\n end", "title": "" }, { "docid": "04f3efe668cf8c769303e8cd5129c80a", "score": "0.5060287", "text": "def winter_paralympics_sport\n fetch('sport.winter_paralympics')\n end", "title": "" }, { "docid": "401aa03cfae70779235c8e6f3a5727e2", "score": "0.50521886", "text": "def pri_sos\n team_stats.opp_pyth / 50.0 \n end", "title": "" }, { "docid": "3614a9f9fe41da2fde3a93902d3750ce", "score": "0.50328577", "text": "def precip(info)\n\treturn info[\"currently\"][\"precipIntensity\"]\nend", "title": "" }, { "docid": "4736b6363c132eb516b9078e32bddfba", "score": "0.5021462", "text": "def show\n @metar_station = MetarStation.find_by(number:@metar_raport.station).name\n end", "title": "" }, { "docid": "9952daa7c3f6561435e177fd8f41035e", "score": "0.5012498", "text": "def planet_information(some_planet)\n @planets.each do |planet|\n if some_planet.downcase == planet.name.downcase\n return planet.organized_planet_details\n end\n end\n end", "title": "" }, { "docid": "2283ae11523d21208777d0986a6bda9b", "score": "0.5009895", "text": "def most_hits(seasonasstring) # shots in game team stats\n #get a list of all teams that played in that season\n #use above list to sum all shots across all games in season\n #find highest across list\n #return team name as found in 139\n end", "title": "" }, { "docid": "e89aa3dd4715628be39f5cd117f38b5e", "score": "0.5001069", "text": "def get_occupation(data, hometown)\n data.each do |season_iteration, stats|\n stats.find do |town|\n if town[\"hometown\"] == hometown\n return town[\"occupation\"]\n end\n end\n end\nend", "title": "" }, { "docid": "2c66ffd484fdf3dd97c4c934f98e901b", "score": "0.4993371", "text": "def precipIntensity(weather_info)\n\tweather_info[\"currently\"][\"precipIntensity\"]\nend", "title": "" }, { "docid": "c96b245ec8282a6310c8414083d34198", "score": "0.49910533", "text": "def show\n @photos = @spot.photos.all\n @schools = @spot.schools.all\n gon.seasons = []\n @spot.seasons.each do |s|\n gon.seasons[s.sport.id] = s.get_months_array\n end\n\n\n if request.path != country_spot_path(@country, @spot)\n return redirect_to [@country, @spot], :status => :moved_permanently\n end\n \n end", "title": "" }, { "docid": "c96b245ec8282a6310c8414083d34198", "score": "0.49910533", "text": "def show\n @photos = @spot.photos.all\n @schools = @spot.schools.all\n gon.seasons = []\n @spot.seasons.each do |s|\n gon.seasons[s.sport.id] = s.get_months_array\n end\n\n\n if request.path != country_spot_path(@country, @spot)\n return redirect_to [@country, @spot], :status => :moved_permanently\n end\n \n end", "title": "" }, { "docid": "4a01459bc4b507d0266511d5c4b81573", "score": "0.498363", "text": "def get_first_name_of_season_winner(data, season)\n winner = match_contestant(data[season], 'status', 'Winner')\n winner['name'].split[0]\nend", "title": "" }, { "docid": "e0cf99850d66ad9b0d35912a0d56fb24", "score": "0.4982155", "text": "def get_surf_data\n url = \"http://magicseaweed.com/api/#{ENV['MAGIC_SEAWEED_API_KEY']}/forecast/?spot_id=6128&units=UK\"\n uri = URI(url)\n\n response = Net::HTTP.get(uri)\n ActiveSupport::JSON.decode(response) if response != ''\n end", "title": "" }, { "docid": "6d0067f52ac24e2c74bddb7579f6d11c", "score": "0.49814072", "text": "def determine_wind_jacket_points\n wind_speed = weather_data['list'].first['wind']['speed']\n (wind_speed / jacket_required_wind_speed) * 40\n end", "title": "" }, { "docid": "905dbb7ceb61d5e36199229dd7f8340c", "score": "0.49794656", "text": "def fewest_hits(seasonasstring) # shots in game team stats\n #inverse of above\n end", "title": "" }, { "docid": "50624479895a3920b8e740adb62391d6", "score": "0.4959315", "text": "def stats(season = nil)\n stats_request(\"statsSingleSeason\", season).first\n end", "title": "" }, { "docid": "32275b9b747439b0d2d8b51235d09322", "score": "0.49542516", "text": "def skater_stats(stats)\n skater_stats = Hash.new\n skater_stats[:seasons] = stats.seasons\nend", "title": "" }, { "docid": "3b44a1f8fd650003206ea2e699c45585", "score": "0.49429926", "text": "def return_solar_system_info\n solar_system_output = \"\"\n @solar_system.each do |planet_object| # planet_object represents a new planet instance\n #add to planet_output string\n solar_system_output += planet_object.planet_output\n end\n return solar_system_output\n end", "title": "" }, { "docid": "ee15844fea7c596ffc051ab2b5682ec5", "score": "0.4939417", "text": "def resort_scraper\nstates = [\"CO\", \"CA\", \"WY\", \"ID\", \"MT\", \"NY\", \"UT\", \"VT\", \"WA\"]\n states.map do |state|\n url = \"https://opensnow.com/state/#{state}#forecasts\"\n unparsed_page = HTTParty.get(url)\n parsed_page = Nokogiri::HTML(unparsed_page)\n resorts_array = Array.new\n all_resorts = parsed_page.css('div.compare-item')\n all_resorts.each do |resort|\n resort = {\n state_id: states.index(state) + 1, \n name: resort.css('div.title-location').text\n }\n resorts_array << resort\n end \n resorts_array.each do |resort|\n Resort.create(resort)\n puts \"creating #{resort[:name]}\" \n end \n end\nend", "title": "" }, { "docid": "4031d220a3bd1190b6bbe59f185f81c5", "score": "0.4927344", "text": "def updateWeather\n self.setWeather\n harsh = [:HEAVYRAIN, :HARSHSUN].include?(@battle.pbWeather)\n # snow particles\n for j in 0...72\n next if !@sprites[\"w_snow#{j}\"]\n if @sprites[\"w_snow#{j}\"].opacity <= 0\n z = rand(32)\n @sprites[\"w_snow#{j}\"].param = 0.24 + 0.01*rand(z/2)\n @sprites[\"w_snow#{j}\"].ey = -rand(64)\n @sprites[\"w_snow#{j}\"].ex = 32 + rand(@sprites[\"bg\"].bitmap.width - 64)\n @sprites[\"w_snow#{j}\"].end_x = @sprites[\"w_snow#{j}\"].ex\n @sprites[\"w_snow#{j}\"].toggle = rand(2) == 0 ? 1 : -1\n @sprites[\"w_snow#{j}\"].speed = 1 + 2/((rand(5) + 1)*0.4)\n @sprites[\"w_snow#{j}\"].z = z - (@focused ? 0 : 100)\n @sprites[\"w_snow#{j}\"].opacity = 255\n end\n min = @sprites[\"bg\"].bitmap.height/4\n max = @sprites[\"bg\"].bitmap.height/2\n scale = (2*Math::PI)/((@sprites[\"w_snow#{j}\"].bitmap.width/64.0)*(max - min) + min)\n @sprites[\"w_snow#{j}\"].opacity -= @sprites[\"w_snow#{j}\"].speed\n @sprites[\"w_snow#{j}\"].ey += @sprites[\"w_snow#{j}\"].speed\n @sprites[\"w_snow#{j}\"].ex = @sprites[\"w_snow#{j}\"].end_x + @sprites[\"w_snow#{j}\"].bitmap.width*0.25*Math.sin(@sprites[\"w_snow#{j}\"].ey*scale)*@sprites[\"w_snow#{j}\"].toggle\n end\n # rain particles\n for j in 0...72\n next if !@sprites[\"w_rain#{j}\"]\n if @sprites[\"w_rain#{j}\"].opacity <= 0\n z = rand(32)\n @sprites[\"w_rain#{j}\"].param = 0.24 + 0.01*rand(z/2)\n @sprites[\"w_rain#{j}\"].ox = 0\n @sprites[\"w_rain#{j}\"].ey = -rand(64)\n @sprites[\"w_rain#{j}\"].ex = 32 + rand(@sprites[\"bg\"].bitmap.width - 64)\n @sprites[\"w_rain#{j}\"].speed = 3 + 2/((rand(5) + 1)*0.4)\n @sprites[\"w_rain#{j}\"].z = z - (@focused ? 0 : 100)\n @sprites[\"w_rain#{j}\"].opacity = 255\n end\n @sprites[\"w_rain#{j}\"].opacity -= @sprites[\"w_rain#{j}\"].speed*(harsh ? 3 : 2)\n @sprites[\"w_rain#{j}\"].ox += @sprites[\"w_rain#{j}\"].speed*(harsh ? 8 : 6)\n end\n # starstorm particles\n for j in 0...72\n next if !@sprites[\"w_starstorm#{j}\"]\n if @sprites[\"w_starstorm#{j}\"].opacity <= 0\n z = rand(32)\n @sprites[\"w_starstorm#{j}\"].param = 0.24 + 0.01*rand(z/2)\n @sprites[\"w_starstorm#{j}\"].ox = 32 + rand(@sprites[\"bg\"].bitmap.width - 64)\n @sprites[\"w_starstorm#{j}\"].ey = 0\n @sprites[\"w_starstorm#{j}\"].ex = 0\n @sprites[\"w_starstorm#{j}\"].speed = 3 + 2/((rand(5) + 1)*0.4)\n @sprites[\"w_starstorm#{j}\"].z = z - (@focused ? 0 : 100)\n @sprites[\"w_starstorm#{j}\"].opacity = 255\n end\n @sprites[\"w_starstorm#{j}\"].opacity -= @sprites[\"w_starstorm#{j}\"].speed\n @sprites[\"w_starstorm#{j}\"].ex += @sprites[\"w_starstorm#{j}\"].speed*2\n end\n # volcanic ash particles\n for j in 0...72\n next if !@sprites[\"w_volc#{j}\"]\n if @sprites[\"w_volc#{j}\"].opacity <= 0\n z = rand(32)\n @sprites[\"w_volc#{j}\"].param = 0.24 + 0.01*rand(z/2)\n @sprites[\"w_volc#{j}\"].ox = 0\n @sprites[\"w_volc#{j}\"].ey = -rand(64)\n @sprites[\"w_volc#{j}\"].ex = 32 + rand(@sprites[\"bg\"].bitmap.width - 64)\n @sprites[\"w_volc#{j}\"].speed = 3 + 1/((rand(8) + 1)*0.4)\n @sprites[\"w_volc#{j}\"].z = z - (@focused ? 0 : 100)\n @sprites[\"w_volc#{j}\"].opacity = 255\n end\n @sprites[\"w_volc#{j}\"].opacity -= @sprites[\"w_volc#{j}\"].speed\n @sprites[\"w_volc#{j}\"].ox += @sprites[\"w_volc#{j}\"].speed*2\n end\n # sun particles\n for j in 0...3\n next if !@sprites[\"w_sunny#{j}\"]\n #next if j > @shine[\"count\"]/6\n @sprites[\"w_sunny#{j}\"].zoom_x += 0.04*[0.5, 0.8, 0.7][j]\n @sprites[\"w_sunny#{j}\"].zoom_y += 0.03*[0.5, 0.8, 0.7][j]\n @sprites[\"w_sunny#{j}\"].opacity += @sprites[\"w_sunny#{j}\"].zoom_x < 1 ? 8 : -12\n if @sprites[\"w_sunny#{j}\"].opacity <= 0\n @sprites[\"w_sunny#{j}\"].zoom_x = 0\n @sprites[\"w_sunny#{j}\"].zoom_y = 0\n @sprites[\"w_sunny#{j}\"].opacity = 0\n end\n end\n # sandstorm particles\n for j in 0...2\n next if !@sprites[\"w_sand#{j}\"]\n @sprites[\"w_sand#{j}\"].update\n end\n end", "title": "" }, { "docid": "289049985018f59649bb43c51e667fac", "score": "0.49174714", "text": "def get_contestant_name(data, occupation)\n # code here\n data.each { |season, array|\n #puts array\n array.each {|hash|\n hash.each {|detail, info|\n if info == occupation\n return hash[\"name\"]\n end\n }\n #return puts attribute, stat\n #if stat == \"occupation\"\n # #if stat\n # return name\n #end\n }\n\n }\n\nend", "title": "" }, { "docid": "4c147c5bd506a23004ae830378d26f47", "score": "0.49134308", "text": "def get_first_name_of_season_winner(data, season)\n first_name = nil\n\n data.each do |season_number, contestant_array|\n # binding.pry\n if season_number == season\n contestant_array.each do |contestant|\n # binding.pry\n if contestant[\"status\"] == \"Winner\"\n first_name = contestant[\"name\"].split.shift\n # binding.pry\n end\n end\n end\n end\n\n first_name\nend", "title": "" }, { "docid": "e8809984bf637f1e15210a2adf472b07", "score": "0.49054018", "text": "def return_solar_system_info\n solar_system_output = \"\"\n @planets_collection.each do |planet_object| # planet_object represents a new planet instance\n #add to planet_output string\n solar_system_output += planet_object.planet_output\n end\n return solar_system_output\n end", "title": "" }, { "docid": "c2d9bb0fe31a1b69a1499cf0ac2c537c", "score": "0.4900799", "text": "def retrieve_season_hall_of_fame\n seasons_hall_of_fame = []\n get_involved_teams unless @involved_teams\n\n @involved_teams.each do |team|\n team_placement = {}\n team_placement[:team] = team\n %w[first_place second_place third_place].each_with_index do |rank, index|\n placement = index + 1\n team_placement[rank.to_sym] = team.computed_season_ranking.joins(:season).where(\"seasons.season_type_id = #{@season_type.id} AND computed_season_rankings.rank = #{placement}\").count\n end\n seasons_hall_of_fame << team_placement\n end\n seasons_hall_of_fame.sort { |p, n| (n[:first_place] * 10_000 + n[:second_place] * 100 + n[:third_place]) <=> (p[:first_place] * 10_000 + p[:second_place] * 100 + p[:third_place]) }\n end", "title": "" }, { "docid": "981a80f3e24f7e57b55762903004cfb7", "score": "0.48905072", "text": "def index\n @snowfalls = Snowfall.all\n end", "title": "" }, { "docid": "5506b71243d5b76bd786ac15ba548da0", "score": "0.4883711", "text": "def all_info(the_planet_i_care_about)\n return @planets.each do |each_planet_in_my_solar_system|\n if each_planet_in_my_solar_system.name == the_planet_i_care_about\n puts each_planet_in_my_solar_system.info\n end\n end\n end", "title": "" }, { "docid": "a99d869b23ed1c4bef6507523797e6da", "score": "0.4878487", "text": "def show\n @station = Station.where(number:@forecast.station_number).last\n end", "title": "" }, { "docid": "9420c49b3f7ea156b2ab4749754988b8", "score": "0.4877987", "text": "def dominant_octopus(the_sea)\n\nend", "title": "" }, { "docid": "5a0666413e97a49b905a082f35250c71", "score": "0.4874277", "text": "def info_risks\n\t\t\t\t\twhere(:severity => 0).where(:rollup_finding => false)\n\t\t\t\tend", "title": "" }, { "docid": "9a22a04664cfc26124ab3254205c49aa", "score": "0.48741543", "text": "def show\n @gun_dps = @rat.gun_dps\n @missile_dps = @rat.missile_dps\n end", "title": "" }, { "docid": "ac49fa3560a287c97486d3353f9ec4ce", "score": "0.4855524", "text": "def spares\n if style == :road\n { chain: '10-speed',\n tire_size: '23',\n tape_color: tape_color }\n else\n { chain: '10-speed',\n tire_size: '2.1',\n rear_shock: rear_shock }\n end\n end", "title": "" }, { "docid": "5c0ceb47090272b7cec7648e12561f12", "score": "0.4838845", "text": "def winter_olympics_sport; end", "title": "" }, { "docid": "f757f3bffcb4fe09ddcd84ee1d79bb18", "score": "0.48380366", "text": "def find_name_by( name:, season: )\n recs = @clubs[ name ]\n if recs\n season = Season( season ) ## make sure season is a season obj (and NOT a string)\n ## check season records for name; use linear search (assume only few records)\n recs.each do |rec|\n if season >= rec[0]\n return strip_geo( rec[1][1][1][0] ) # use second arg\n end\n end\n ## if we get here use last name\n strip_geo( recs[-1][1][1][0][0] ) # use first arg\n else\n nil\n end\n end", "title": "" }, { "docid": "73c836719e9c7ff997a9092a408b3af8", "score": "0.48331466", "text": "def yards_per_skein\n data[:yards_per_skein]\n end", "title": "" }, { "docid": "839bab8b23a542e866fdaf1aad3ca3c6", "score": "0.4832376", "text": "def on_pace_stats(season = nil)\n stats_request(\"onPaceRegularSeason\", season).first\n end", "title": "" }, { "docid": "230210fa90dcff6ab99361d6f8d772ae", "score": "0.4832217", "text": "def winter_olympics_sport\n fetch('sport.winter_olympics')\n end", "title": "" }, { "docid": "e1e588b09d384e2c05bfb54f030bef23", "score": "0.4826424", "text": "def spares\n if style == :road\n {\n chain: '10-speed',\n tire_size: '23', # millimeters\n tape_color: tape_color\n }\n else\n {\n chain: '10-speed',\n tire_size: '2.1', # inches\n rear_shock: rear_shock\n }\n end\n end", "title": "" }, { "docid": "7fe3578ad01c22d8339d793b681252b3", "score": "0.48249328", "text": "def spares\n if style == :road\n { chain: '11-speed', \n tire_size: '23', # millimeters\n tape_color: tape_color }\n else\n { chain: '11-speed',\n tire_size: '2.1', # inches\n front_shock: front_shock }\n end\n end", "title": "" }, { "docid": "fb2838ce9f813f4310ead1e04c983b2b", "score": "0.4823601", "text": "def forecast\n deck = data.decks.first\n Statistics.forecast(deck: deck.deck)\n end", "title": "" }, { "docid": "f244c9936c955dea00140e5657ca10ca", "score": "0.4822857", "text": "def get_west_series\n self.get_page\n self.get_teams\n # listOfSeries has a value of every single playoff matchup (except the finals)\n # listOfSeries[0] is the play-in game so that will be removed\n listOfSeries = @html_doc.css(\"h4\").text.split(\"[edit]\")\n listOfSeries.delete_at(0)\n i = 0\n listOfSeries.each do | selected |\n # 4, 5, 6, 7, are WC first round\n if (i >= 4 && i < 8)\n Series.create(\"Western\", \"First Round\", selected)\n # 10 and 11 are Lakers/Rockets Nuggets/Clippers\n elsif (i >= 10 && i < 12)\n Series.create(\"Western\", \"Second Round\", selected)\n # 12 is ECF\n elsif (i == 13)\n Series.create(\"Western\", \"Conference Finals\", selected)\n end\n i += 1\n end\n end", "title": "" }, { "docid": "5c3f38d8f1549b0b05e149051c1fb7f7", "score": "0.48129177", "text": "def national_sport; end", "title": "" }, { "docid": "bbe99b8c050aebf4e390fe46dd121e5a", "score": "0.48126167", "text": "def skater\n @list = \"Skater\"\n csv_text = File.read(Rails.root + 'StatProjector/PProjections.csv')\n @projections = CSV.parse(csv_text, :headers => true)\n @count = 0 \n render 'rankings'\n end", "title": "" }, { "docid": "87ab0897f2858460d052168b93008d02", "score": "0.4801939", "text": "def summary\n return \"Welcome to planet #{name} - #{distance_from_sun_km}km from the sun. We spin a #{color} mass of #{mass_kg}. Did you know, #{name} is [the] #{fun_fact}!\"\n end", "title": "" }, { "docid": "4596774abf4796edc6ff4dff11d7aad2", "score": "0.48019266", "text": "def get_research_info\n PlanetsHelper.fetch_research_data(self)\n end", "title": "" }, { "docid": "2ca8867037ea89a8a408bbc2558abf71", "score": "0.47990122", "text": "def get_contestant_name(data, occupation)\n data.each do |season, info|\n info.each do |people|\n people.each do |k,v|\n if v == occupation\n return people[\"name\"]\n end\n end\n end\n end\nend", "title": "" }, { "docid": "0f5c3bcce538ac120f16db1578f67da8", "score": "0.47811303", "text": "def spares\n if style == :road\n { chain: '11-speed', tire_size: '23', tape_color: tape_color }\n else\n { chain: '11-speed', tire_size: '2.1', front_shock: front_shock }\n end\n end", "title": "" }, { "docid": "bdae053346fa4cb25f5d6cce91e234f0", "score": "0.47761714", "text": "def get_contestant_name(data, occupation)\n data.each do |season_key, contestants_array|\n contestants_array.each do |contestant_info| \n if contestant_info[\"occupation\"] == occupation\n return contestant_info[\"name\"]\n end \n end \n end \nend", "title": "" }, { "docid": "bf0dbc28092ce996b5cc8dd3d11e4377", "score": "0.47647202", "text": "def shoe_size(name)\n game_hash.each do |location, attributes|\n attributes[:players].each do |player, stats|\n if player == name\n return stats[:shoe]\n end\n end\n end\nend", "title": "" }, { "docid": "c9a0f4a3bde22cb55dcf0c0505d2438a", "score": "0.47606587", "text": "def season\n number = ((self.day - 1) / 30) % 4\n case number\n when 0\n return \"spring\"\n when 1\n return \"summer\"\n when 2\n return \"fall\"\n when 3\n return \"winter\"\n end\n end", "title": "" }, { "docid": "ff73d4dc4e6d7d01f62f4fdf8406470f", "score": "0.47600466", "text": "def get_planet_details(solar_system)\n print \"What is the name of the planet you want to learn about?\"\n planet_name =gets.chomp.strip\n\n # the found planet is an instance of planet class\n found_planet = solar_system.find_planet_by_name(planet_name)\n\n puts found_planet.summary\nend", "title": "" }, { "docid": "363b371d980677edd3152289f293d076", "score": "0.4759896", "text": "def call\n\n self.get_nationwide_data\n puts self.todays_rankings_output\n self.get_more_info?\n end", "title": "" }, { "docid": "e4b84bef60f8e035e441e5c8d13d7f1e", "score": "0.47536898", "text": "def summer_olympics_sport; end", "title": "" }, { "docid": "265c87aca0ec4eaef9f91694e622096f", "score": "0.4745556", "text": "def unusual_sport; end", "title": "" }, { "docid": "bed4ed3fdff66de5a1871c581a43f144", "score": "0.47445345", "text": "def get_contestant_name(data, occupation)\n data.each do |season_iteration, stats|\n stats.find do |job|\n if job[\"occupation\"] == occupation\n return job[\"name\"]\n end\n end\n end\nend", "title": "" }, { "docid": "63944a3dfe63dda313f6597063ebc297", "score": "0.47436833", "text": "def crops_in_season\n CropType.where(\"season = ?\", self.season)\n end", "title": "" }, { "docid": "3a29cce6d1ebbd223541e57e80b78f66", "score": "0.47404957", "text": "def shoe_size(name)\n game_hash.each do |location, team_data|\n team_data[:players].each do |player_name, data|\n if player_name == name\n return data[:shoe]\n end\n end\n end\nend", "title": "" }, { "docid": "2bdad7482cf28704921c70b8d9054151", "score": "0.47377706", "text": "def stats(id, season = nil)\n Stats.new(Client.get(\"/v1.2/stats/by-summoner/#{id}/summary\", query: {\"season\" => season.to_s}))\n end", "title": "" }, { "docid": "c4dff257448292d5ea4a3713d542fa99", "score": "0.4730454", "text": "def get_contestant_name(data, occupation)\ncontestant_name = data.each do |season,contestant|\n #binding.pry\ncontestant.each do |x|\n #binding.pry\n if x[\"occupation\"] == occupation\n name = x[\"name\"]\n return name\n end\nend\nend\nend", "title": "" }, { "docid": "9e395dce5bbbd17239e29b8e952049cb", "score": "0.47300342", "text": "def get_planet_info\n \"#{@name} has a mass of #{@mass} kilograms, a mean diameter of \" +\n \"#{@diameter} kilometers, and #{@moons} moon(s). It is #{@sun_distance}\" +\n \" million kilometers from the sun and one planetary year on #{@name} is\" +\n \" equal to #{@planetary_year} Earth days. If you were to stand on the \" +\n \" surface of #{@name}, you would experience a gravitational force of \" +\n \"#{@gravity} meters per second squared and a mean temperature of \" +\n \"#{@temp} degrees Kelvin. That's approximately \" +\n \"#{kelvin_to_fahrenheit(@temp).to_i} degrees Fahrenheit! \"\n end", "title": "" }, { "docid": "6ffa68939bfce5bfedb189eefeb3aebb", "score": "0.47290075", "text": "def shoe_size(player_name)\n # using .each do |location, team_data| to iterate over each piece of data to expose specific data, in this case the team_players\n game_hash.each do |location, team_data|\n # goes through all of the players and then a name and its value\n team_data[:players].each do |name, data|\n # if the key \"name\" is equal to player_name then the value of shoe should be returned\n if name == player_name\n return data[:shoe]\n end\n end\n end\nend", "title": "" }, { "docid": "b59aa89b763b2df876b313d16b9f4641", "score": "0.47281134", "text": "def show\n @rounds = set_rounds\n @matches = @competition.matches.select { |match| match.season == @competition.curr_season }\n @matches = @matches.sort_by{ |m| m.round }\n end", "title": "" }, { "docid": "c78902964dd42670cce40976dfdd672d", "score": "0.47259045", "text": "def planet_details(solarsystem)\n puts \"which planet would you like to know more about?\"\n planet = gets.chomp.downcase\n solarsystem.planets.each do |planetlist|\n if planetlist.name.downcase == planet\n puts planetlist.summary\n else puts \"this planet is not in this solar system! try a different planet!\"\n end\n end\nend", "title": "" }, { "docid": "92a192199ebd82a3975b90c5e99788f4", "score": "0.47220844", "text": "def straights\n @analysis[:straights]\n end", "title": "" }, { "docid": "41bf99e1f5c95b83ceabe850dcb1e08c", "score": "0.4719031", "text": "def seasonal_summary(team_id)\n team_id = team_id.to_i\n seasonal_summary_hash(team_id)\n end", "title": "" }, { "docid": "a16b4d6e0948417976a2b48be6d7eb33", "score": "0.47186333", "text": "def rushing\n @rushing ||= if response[\"rushing\"]\n response[\"rushing\"] = parse_out_hashes response[\"rushing\"]\n Sportradar::Api::Football::StatPack::Rushing.new(response[\"rushing\"])\n end\n end", "title": "" }, { "docid": "d975830f2ba19c008aac749e4263f121", "score": "0.47154927", "text": "def get_saturadas\n @_100=((@saturadas*100)/@peso)\n @ir_100=(@_100/20)*100\n @porcion=((@saturadas*@gramos_porciones)/@peso)\n @ir_porcion=(@porcion/20)*100\n\t\t#p \"| #{@saturadas} | #{@_100} | #{@ir_100.round(1)}% | #{@porcion} | #{@ir_porcion.round(1)}% |\"\n [ @saturadas , @_100 , @ir_100.round(1) , @porcion , @ir_porcion.round(1) ]\n end", "title": "" }, { "docid": "e3f0992b7c2f1c9b09ab02c7e15c6f7c", "score": "0.47074717", "text": "def salons\n FindSalon::Salon.all.map do |salon|\n salon.id.to_s + ' ' + salon.name + ' | ' + 'Rating: ' + salon.rating.to_s + ' | ' + 'Address: ' + salon.vicinity\n end\n end", "title": "" }, { "docid": "93f6242d92ec3947ccd157f56851de26", "score": "0.4705713", "text": "def summary\n return \"\\nThis planet is called #{@name}. It is #{@color} in color, #{@mass_kg} kilograms in weight, \n and #{@distance_from_sun_km} kilometers from the sun. A fun fact about this planet: #{@fun_fact}.\"\n end", "title": "" }, { "docid": "74a00ad9b6a450b730804580a28302e5", "score": "0.46983188", "text": "def player_stats (player_name)\n lookup_by_player(player_name);\nend", "title": "" }, { "docid": "d94e73a9949736e062ff7b395d8751d0", "score": "0.46974543", "text": "def show\n @capitle = @serie.capitles.for_season(params[:season]).\n where(:order => params[:capitle_order]).first\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @capitle }\n end\n end", "title": "" }, { "docid": "859d15bedfd3944a744076848592672c", "score": "0.46957195", "text": "def find_theaters_selling_at(postal_code)\n Fandango.loop_on_bad_response do\n Fandango.movies_near(postal_code).each_with_object([]) do |feed_hash, theaters_selling|\n theater_source = Fandango::TheaterSource.new_from_feed_entry(feed_hash)\n if theater_source.selling?(self)\n theater_source = theater_source.find_or_create!\n theaters_selling << theater_source.theater\n end\n end\n end\n end", "title": "" }, { "docid": "a2c07a4a682cbc195e47e614c37a545b", "score": "0.46956927", "text": "def virus_effects\n predicted_deaths \n speed_of_spread \n end", "title": "" }, { "docid": "a2c07a4a682cbc195e47e614c37a545b", "score": "0.46956927", "text": "def virus_effects\n predicted_deaths \n speed_of_spread \n end", "title": "" }, { "docid": "324fac52110b4885d5ab55be48f4440f", "score": "0.46954212", "text": "def show\n respond_with(@sicoss_situation)\n end", "title": "" }, { "docid": "917c32aad47174121f9d494bf9fcf760", "score": "0.46940365", "text": "def show\n @weather = ForecastIO.forecast(@location.latitude, @location.longitude)\n @current_weather = @weather['currently']\n @forecast = @weather['daily']['data']\n end", "title": "" }, { "docid": "1f16264b8d9d21950bd5b172604c8256", "score": "0.46939272", "text": "def daily_forecast(info)\n info[\"weather\"][0][\"description\"]\nend", "title": "" }, { "docid": "3c453f78ba06740086a025cfc419d522", "score": "0.4693213", "text": "def index\n @sightings = Sighting.where('created_at >= ?', (Time.now - 28800))\n gon.array_of_cor = Sighting.get_cordinates(@sightings)\n # @gon = gon.array_of_cor\n end", "title": "" }, { "docid": "1942e0e74e3e832a17047e04931e8d53", "score": "0.46908617", "text": "def virus_effects\n print predicted_deaths\n puts speed_of_spread\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "37233775ca0b328fa9828eec6f53a69c", "score": "0.0", "text": "def set_skip_content_rule\n @skip_content_rule = SkipContentRule.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": "" } ]
a9bd81d67c0ebccc3275925d4f2854f4
GET /region_lethalities GET /region_lethalities.json
[ { "docid": "368f19656ca393a0bfee6eb1399d2dd5", "score": "0.7768989", "text": "def index\n @region_lethalities = RegionLethality.all\n end", "title": "" } ]
[ { "docid": "c3b6e075e2f1989f9d71701ce5b4f9b1", "score": "0.63730067", "text": "def set_region_lethality\n @region_lethality = RegionLethality.find(params[:id])\n end", "title": "" }, { "docid": "8e466dd4d014383bf56af4d36f638ddc", "score": "0.6319834", "text": "def cities_in_region\n render json: City.where(region_id: controller_params).order(:name)\n end", "title": "" }, { "docid": "a42672db56eb7f67cdd97b948dac6829", "score": "0.6311683", "text": "def cities\n self.class.get(\"/v1/cities\")\n end", "title": "" }, { "docid": "4bb1eaff438740060ee0d18bd01f7fa3", "score": "0.62649", "text": "def geographic_regions\n self.dig_for_array(\"geographicRegions\")\n end", "title": "" }, { "docid": "d558052b4b78b0651391e3da6c0219c0", "score": "0.6095219", "text": "def geographic_regions\n self.dig_for_array(\"listingSummary\", \"geographicRegions\")\n end", "title": "" }, { "docid": "703133523d57dfa160b4ac01862dc95c", "score": "0.6090867", "text": "def populate_region_list\n @region_list = Array.new\n #not an api-official way, but all the regions are listed in this not-api-key-limited query\n responseJSON = get_json_response('http://status.leagueoflegends.com/shards')\n #iterates over the response and adds the region tag at the end of the list\n responseJSON.each do |child|\n @region_list.push(child['slug'])\n end\n end", "title": "" }, { "docid": "8dea7dde0ad264f11bf238a6fd852bf2", "score": "0.6089809", "text": "def index\n @regionals = Regional.all\n end", "title": "" }, { "docid": "6df810ebbfb3edd893c184333b60faa2", "score": "0.6089042", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @area.localities }\n end\n end", "title": "" }, { "docid": "81cd7a90b9cacfac51b0558e3b82fbb8", "score": "0.5995516", "text": "def regions\n #@nationwide = Location.get_nationwide\n #@provinces = Location.provinces.where('id != ?', @nationwide.id).collect {|p| [p.name.capitalize, p.id]}\n @regions = Region.order('region_iso').all\n #@user_regions = User.find(current_user.id).regions.pluck(:region_iso)\n @user_regions = {}\n end", "title": "" }, { "docid": "7edbaab809968088e945dd2819ca6cc6", "score": "0.5908427", "text": "def index\n @regionals = Regional.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @regionals }\n end\n end", "title": "" }, { "docid": "55a0957c2b3ac0400d31972f8779c7da", "score": "0.58811915", "text": "def locations()\n get('transactionLocations')\n end", "title": "" }, { "docid": "a3281fc0222f16dfd7315f0b6efe7b48", "score": "0.586574", "text": "def index\n\n @regions = Region.all\n\n render json: @regions\n\n end", "title": "" }, { "docid": "38be310547aba4f8fb0c52ff08c9c679", "score": "0.58500266", "text": "def regions\n @regions = Airport.find_by_fuzzy_name(params[:name])\n if @regions\n render :json => @regions\n else\n render :json => {:error => \"Region not found for given name\"}.to_json, :status => 404\n end\n end", "title": "" }, { "docid": "84390c39c3c35e497bd32c6f654a0115", "score": "0.5845715", "text": "def index\n @lesion_locations = LesionLocation.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lesion_locations }\n end\n end", "title": "" }, { "docid": "a22f6c94ffedfafd22b9bb23e8819a2e", "score": "0.580812", "text": "def index\n get_paginated_regions\n if @regions.to_json \n History.create(:name => 'Wilayah Sales Area', :status => 'Completed')\n render json: @regions.to_json\n else\n History.create(:name => 'Wilayah Sales Area', :status => 'Failed')\n end\n end", "title": "" }, { "docid": "56533f9cd11aea9d02f6ce5355d3158b", "score": "0.57726157", "text": "def multiple_regions\n @attributes[:multiple_regions]\n end", "title": "" }, { "docid": "b51aa8258aaf7bdc0fc304889d474bdf", "score": "0.57610756", "text": "def show\n\n #@response = HTTParty.get('http://api.oodle.com/api/v2/listings?key=90984BE28A8F&region=canada&category=housing/sale')\n#@oodle = Oodle::API.new(API_KEY)\n@regions = {\"nation\"=>[{\"@url\"=>\"canada\", \"@name\"=>\"Canada\", \"region\"=>[{\"@url\"=>\"abbotsford\", \"@name\"=>\"Abbotsford\"}, {\"@url\"=>\"barrie\", \"@name\"=>\"Barrie\"}, {\"@url\"=>\"brantford\", \"@name\"=>\"Brantford\"}, {\"@url\"=>\"calgary\", \"@name\"=>\"Calgary\"}, {\"@url\"=>\"charlottetown\", \"@name\"=>\"Charlottetown\"}, {\"@url\"=>\"chathamkent\", \"@name\"=>\"Chatham-Kent\"}, {\"@url\"=>\"edmonton\", \"@name\"=>\"Edmonton\"}, {\"@url\"=>\"guelph\", \"@name\"=>\"Guelph\"}, {\"@url\"=>\"halifaxns\", \"@name\"=>\"Halifax\"}, {\"@url\"=>\"hamilton\", \"@name\"=>\"Hamilton\"}, {\"@url\"=>\"iqaluit\", \"@name\"=>\"Iqaluit\"}, {\"@url\"=>\"kelowna\", \"@name\"=>\"Kelowna\"}, {\"@url\"=>\"kingstonon\", \"@name\"=>\"Kingston\"}, {\"@url\"=>\"kitchener\", \"@name\"=>\"Kitchener\"}, {\"@url\"=>\"londonon\", \"@name\"=>\"London, ON\"}, {\"@url\"=>\"moncton\", \"@name\"=>\"Moncton\"}, {\"@url\"=>\"montreal\", \"@name\"=>\"Montreal\"}, {\"@url\"=>\"oshawa\", \"@name\"=>\"Oshawa\"}, {\"@url\"=>\"ottawa\", \"@name\"=>\"Ottawa-Gatineau\"}, {\"@url\"=>\"peterboroughcan\", \"@name\"=>\"Peterborough\"}, {\"@url\"=>\"quebec\", \"@name\"=>\"Quebec City\"}, {\"@url\"=>\"regina\", \"@name\"=>\"Regina\"}, {\"@url\"=>\"saguenay\", \"@name\"=>\"Saguenay\"}, {\"@url\"=>\"saintjohn\", \"@name\"=>\"Saint John\"}, {\"@url\"=>\"saskatoon\", \"@name\"=>\"Saskatoon\"}, {\"@url\"=>\"sherbrooke\", \"@name\"=>\"Sherbrooke\"}, {\"@url\"=>\"niagara\", \"@name\"=>\"St. Catharines-Niagara\"}, {\"@url\"=>\"stjohns\", \"@name\"=>\"St. John's\"}, {\"@url\"=>\"sudbury\", \"@name\"=>\"Sudbury\"}, {\"@url\"=>\"thunderbay\", \"@name\"=>\"Thunder Bay\"}, {\"@url\"=>\"toronto\", \"@name\"=>\"Toronto\"}, {\"@url\"=>\"troisrivieres\", \"@name\"=>\"Trois-Rivieres\"}, {\"@url\"=>\"vancouver\", \"@name\"=>\"Vancouver\"}, {\"@url\"=>\"victoria\", \"@name\"=>\"Victoria\"}, {\"@url\"=>\"whitehorse\", \"@name\"=>\"Whitehorse\"}, {\"@url\"=>\"windsor\", \"@name\"=>\"Windsor\"}, {\"@url\"=>\"winnipeg\", \"@name\"=>\"Winnipeg\"}, {\"@url\"=>\"yellowknife\", \"@name\"=>\"Yellowknife\"}]}, {\"@url\"=>\"uk\", \"@name\"=>\"United Kingdom\", \"region\"=>[{\"@url\"=>\"aberdeen\", \"@name\"=>\"Aberdeen\"}, {\"@url\"=>\"barnsley\", \"@name\"=>\"Barnsley\"}, {\"@url\"=>\"bath\", \"@name\"=>\"Bath\"}, {\"@url\"=>\"belfast\", \"@name\"=>\"Belfast\"}, {\"@url\"=>\"birminghamgb\", \"@name\"=>\"Birmingham\"}, {\"@url\"=>\"blackburn\", \"@name\"=>\"Blackburn\"}, {\"@url\"=>\"blackpool\", \"@name\"=>\"Blackpool\"}, {\"@url\"=>\"bolton\", \"@name\"=>\"Bolton\"}, {\"@url\"=>\"bournemouth\", \"@name\"=>\"Bournemouth\"}, {\"@url\"=>\"bradford\", \"@name\"=>\"Bradford\"}, {\"@url\"=>\"brighton\", \"@name\"=>\"Brighton\"}, {\"@url\"=>\"bristol\", \"@name\"=>\"Bristol\"}, {\"@url\"=>\"bromley\", \"@name\"=>\"Bromley\"}, {\"@url\"=>\"cambridge\", \"@name\"=>\"Cambridge\"}, {\"@url\"=>\"canterbury\", \"@name\"=>\"Canterbury\"}, {\"@url\"=>\"cardiff\", \"@name\"=>\"Cardiff\"}, {\"@url\"=>\"carlisle\", \"@name\"=>\"Carlisle\"}, {\"@url\"=>\"chelmsford\", \"@name\"=>\"Chelmsford\"}, {\"@url\"=>\"chester\", \"@name\"=>\"Chester\"}, {\"@url\"=>\"colchester\", \"@name\"=>\"Colchester\"}, {\"@url\"=>\"coventry\", \"@name\"=>\"Coventry\"}, {\"@url\"=>\"crewe\", \"@name\"=>\"Crewe\"}, {\"@url\"=>\"croydon\", \"@name\"=>\"Croydon\"}, {\"@url\"=>\"darlington\", \"@name\"=>\"Darlington\"}, {\"@url\"=>\"dartford\", \"@name\"=>\"Dartford\"}, {\"@url\"=>\"derby\", \"@name\"=>\"Derby\"}, {\"@url\"=>\"doncaster\", \"@name\"=>\"Doncaster\"}, {\"@url\"=>\"dorchester\", \"@name\"=>\"Dorchester\"}, {\"@url\"=>\"dudley\", \"@name\"=>\"Dudley\"}, {\"@url\"=>\"dumfries\", \"@name\"=>\"Dumfries\"}, {\"@url\"=>\"dundee\", \"@name\"=>\"Dundee\"}, {\"@url\"=>\"durham\", \"@name\"=>\"Durham\"}, {\"@url\"=>\"edinburgh\", \"@name\"=>\"Edinburgh\"}, {\"@url\"=>\"enfield\", \"@name\"=>\"Enfield\"}, {\"@url\"=>\"england\", \"@name\"=>\"England\"}, {\"@url\"=>\"exeter\", \"@name\"=>\"Exeter\"}, {\"@url\"=>\"falkirk\", \"@name\"=>\"Falkirk\"}, {\"@url\"=>\"galashiels\", \"@name\"=>\"Galashiels\"}, {\"@url\"=>\"glasgow\", \"@name\"=>\"Glasgow\"}, {\"@url\"=>\"gloucester\", \"@name\"=>\"Gloucester\"}, {\"@url\"=>\"guildford\", \"@name\"=>\"Guildford\"}, {\"@url\"=>\"halifax\", \"@name\"=>\"Halifax\"}, {\"@url\"=>\"harrogate\", \"@name\"=>\"Harrogate\"}, {\"@url\"=>\"harrow\", \"@name\"=>\"Harrow\"}, {\"@url\"=>\"hemelhempstead\", \"@name\"=>\"Hemel Hempstead\"}, {\"@url\"=>\"hereford\", \"@name\"=>\"Hereford\"}, {\"@url\"=>\"huddersfield\", \"@name\"=>\"Huddersfield\"}, {\"@url\"=>\"hull\", \"@name\"=>\"Hull\"}, {\"@url\"=>\"ilford\", \"@name\"=>\"Ilford\"}, {\"@url\"=>\"inverness\", \"@name\"=>\"Inverness\"}, {\"@url\"=>\"ipswich\", \"@name\"=>\"Ipswich\"}, {\"@url\"=>\"kilmarnock\", \"@name\"=>\"Kilmarnock\"}, {\"@url\"=>\"kingston\", \"@name\"=>\"Kingston upon Thames\"}, {\"@url\"=>\"kirkcaldy\", \"@name\"=>\"Kirkcaldy\"}, {\"@url\"=>\"kirkwall\", \"@name\"=>\"Kirkwall\"}, {\"@url\"=>\"lancastergb\", \"@name\"=>\"Lancaster\"}, {\"@url\"=>\"leeds\", \"@name\"=>\"Leeds\"}, {\"@url\"=>\"leicester\", \"@name\"=>\"Leicester\"}, {\"@url\"=>\"lerwick\", \"@name\"=>\"Lerwick\"}, {\"@url\"=>\"lincolngb\", \"@name\"=>\"Lincoln\"}, {\"@url\"=>\"liverpool\", \"@name\"=>\"Liverpool\"}, {\"@url\"=>\"llandrindodwells\", \"@name\"=>\"Llandrindod Wells\"}, {\"@url\"=>\"llandudno\", \"@name\"=>\"Llandudno\"}, {\"@url\"=>\"london\", \"@name\"=>\"London\"}, {\"@url\"=>\"luton\", \"@name\"=>\"Luton\"}, {\"@url\"=>\"manchester\", \"@name\"=>\"Manchester\"}, {\"@url\"=>\"medway\", \"@name\"=>\"Medway\"}, {\"@url\"=>\"middlesbrough\", \"@name\"=>\"Middlesbrough\"}, {\"@url\"=>\"miltonkeynes\", \"@name\"=>\"Milton Keynes\"}, {\"@url\"=>\"motherwell\", \"@name\"=>\"Motherwell\"}, {\"@url\"=>\"newcastle\", \"@name\"=>\"Newcastle\"}, {\"@url\"=>\"newport\", \"@name\"=>\"Newport\"}, {\"@url\"=>\"northampton\", \"@name\"=>\"Northampton\"}, {\"@url\"=>\"nireland\", \"@name\"=>\"Northern Ireland\"}, {\"@url\"=>\"norwich\", \"@name\"=>\"Norwich\"}, {\"@url\"=>\"nottingham\", \"@name\"=>\"Nottingham\"}, {\"@url\"=>\"oldham\", \"@name\"=>\"Oldham\"}, {\"@url\"=>\"oxford\", \"@name\"=>\"Oxford\"}, {\"@url\"=>\"paisley\", \"@name\"=>\"Paisley\"}, {\"@url\"=>\"perthgb\", \"@name\"=>\"Perth\"}, {\"@url\"=>\"peterborough\", \"@name\"=>\"Peterborough\"}, {\"@url\"=>\"plymouth\", \"@name\"=>\"Plymouth\"}, {\"@url\"=>\"portsmouth\", \"@name\"=>\"Portsmouth\"}, {\"@url\"=>\"preston\", \"@name\"=>\"Preston\"}, {\"@url\"=>\"reading\", \"@name\"=>\"Reading\"}, {\"@url\"=>\"redhill\", \"@name\"=>\"Redhill\"}, {\"@url\"=>\"richmondgb\", \"@name\"=>\"Richmond\"}, {\"@url\"=>\"romford\", \"@name\"=>\"Romford\"}, {\"@url\"=>\"rotherham\", \"@name\"=>\"Rotherham\"}, {\"@url\"=>\"salisbury\", \"@name\"=>\"Salisbury\"}, {\"@url\"=>\"scotland\", \"@name\"=>\"Scotland\"}, {\"@url\"=>\"sheffield\", \"@name\"=>\"Sheffield\"}, {\"@url\"=>\"shrewsbury\", \"@name\"=>\"Shrewsbury\"}, {\"@url\"=>\"slough\", \"@name\"=>\"Slough\"}, {\"@url\"=>\"southall\", \"@name\"=>\"Southall\"}, {\"@url\"=>\"southampton\", \"@name\"=>\"Southampton\"}, {\"@url\"=>\"southend\", \"@name\"=>\"Southend\"}, {\"@url\"=>\"stalbans\", \"@name\"=>\"St. Albans\"}, {\"@url\"=>\"stevenage\", \"@name\"=>\"Stevenage\"}, {\"@url\"=>\"stockport\", \"@name\"=>\"Stockport\"}, {\"@url\"=>\"stoke\", \"@name\"=>\"Stoke-on-Trent\"}, {\"@url\"=>\"sunderland\", \"@name\"=>\"Sunderland\"}, {\"@url\"=>\"sutton\", \"@name\"=>\"Sutton\"}, {\"@url\"=>\"swansea\", \"@name\"=>\"Swansea\"}, {\"@url\"=>\"swindon\", \"@name\"=>\"Swindon\"}, {\"@url\"=>\"taunton\", \"@name\"=>\"Taunton\"}, {\"@url\"=>\"telford\", \"@name\"=>\"Telford\"}, {\"@url\"=>\"torquay\", \"@name\"=>\"Torquay\"}, {\"@url\"=>\"truro\", \"@name\"=>\"Truro\"}, {\"@url\"=>\"tunbridge\", \"@name\"=>\"Tunbridge Wells\"}, {\"@url\"=>\"wakefield\", \"@name\"=>\"Wakefield\"}, {\"@url\"=>\"wales\", \"@name\"=>\"Wales\"}, {\"@url\"=>\"walsall\", \"@name\"=>\"Walsall\"}, {\"@url\"=>\"warrington\", \"@name\"=>\"Warrington\"}, {\"@url\"=>\"watford\", \"@name\"=>\"Watford\"}, {\"@url\"=>\"wigan\", \"@name\"=>\"Wigan\"}, {\"@url\"=>\"wolverhampton\", \"@name\"=>\"Wolverhampton\"}, {\"@url\"=>\"worcester\", \"@name\"=>\"Worcester\"}, {\"@url\"=>\"york\", \"@name\"=>\"York\"}]}, {\"@url\"=>\"usa\", \"@name\"=>\"United States\", \"region\"=>[{\"@url\"=>\"abilene\", \"@name\"=>\"Abilene, TX\"}, {\"@url\"=>\"albany\", \"@name\"=>\"Albany, NY\"}, {\"@url\"=>\"albanyga\", \"@name\"=>\"Albany, GA\"}, {\"@url\"=>\"albuquerque\", \"@name\"=>\"Albuquerque, NM\"}, {\"@url\"=>\"alexandriala\", \"@name\"=>\"Alexandria, LA\"}, {\"@url\"=>\"allentown\", \"@name\"=>\"Allentown, PA\"}, {\"@url\"=>\"altoona\", \"@name\"=>\"Altoona, PA\"}, {\"@url\"=>\"amarillo\", \"@name\"=>\"Amarillo, TX\"}, {\"@url\"=>\"anchorage\", \"@name\"=>\"Anchorage, AK\"}, {\"@url\"=>\"annistonal\", \"@name\"=>\"Anniston, AL\"}, {\"@url\"=>\"appleton\", \"@name\"=>\"Appleton, WI\"}, {\"@url\"=>\"asheville\", \"@name\"=>\"Asheville, NC\"}, {\"@url\"=>\"athensga\", \"@name\"=>\"Athens, GA\"}, {\"@url\"=>\"atlanta\", \"@name\"=>\"Atlanta, GA\"}, {\"@url\"=>\"atlanticcity\", \"@name\"=>\"Atlantic City, NJ\"}, {\"@url\"=>\"auburn\", \"@name\"=>\"Auburn, AL\"}, {\"@url\"=>\"augusta\", \"@name\"=>\"Augusta, GA\"}, {\"@url\"=>\"austin\", \"@name\"=>\"Austin, TX\"}, {\"@url\"=>\"bakersfield\", \"@name\"=>\"Bakersfield, CA\"}, {\"@url\"=>\"baltimore\", \"@name\"=>\"Baltimore, MD\"}, {\"@url\"=>\"bangorme\", \"@name\"=>\"Bangor, ME\"}, {\"@url\"=>\"barnstablema\", \"@name\"=>\"Barnstable, MA\"}, {\"@url\"=>\"batonrouge\", \"@name\"=>\"Baton Rouge, LA\"}, {\"@url\"=>\"beaumont\", \"@name\"=>\"Beaumont, TX\"}, {\"@url\"=>\"bellingham\", \"@name\"=>\"Bellingham, WA\"}, {\"@url\"=>\"bentonharbor\", \"@name\"=>\"Benton Harbor, MI\"}, {\"@url\"=>\"billings\", \"@name\"=>\"Billings, MT\"}, {\"@url\"=>\"biloxi\", \"@name\"=>\"Biloxi, MS\"}, {\"@url\"=>\"binghamton\", \"@name\"=>\"Binghamton, NY\"}, {\"@url\"=>\"birmingham\", \"@name\"=>\"Birmingham, AL\"}, {\"@url\"=>\"bismarck\", \"@name\"=>\"Bismarck, ND\"}, {\"@url\"=>\"bloomington\", \"@name\"=>\"Bloomington, IL\"}, {\"@url\"=>\"bloomingtonin\", \"@name\"=>\"Bloomington, IN\"}, {\"@url\"=>\"boise\", \"@name\"=>\"Boise, ID\"}, {\"@url\"=>\"boston\", \"@name\"=>\"Boston, MA\"}, {\"@url\"=>\"brownsville\", \"@name\"=>\"Brownsville, TX\"}, {\"@url\"=>\"bryantx\", \"@name\"=>\"Bryan, TX\"}, {\"@url\"=>\"buffalo\", \"@name\"=>\"Buffalo, NY\"}, {\"@url\"=>\"burlington\", \"@name\"=>\"Burlington, VT\"}, {\"@url\"=>\"canton\", \"@name\"=>\"Canton, OH\"}, {\"@url\"=>\"casper\", \"@name\"=>\"Casper, WY\"}, {\"@url\"=>\"cedarrapids\", \"@name\"=>\"Cedar Rapids, IA\"}, {\"@url\"=>\"champaign\", \"@name\"=>\"Champaign, IL\"}, {\"@url\"=>\"charleston\", \"@name\"=>\"Charleston, SC\"}, {\"@url\"=>\"charlestonwv\", \"@name\"=>\"Charleston, WV\"}, {\"@url\"=>\"charlotte\", \"@name\"=>\"Charlotte, NC\"}, {\"@url\"=>\"charlottesville\", \"@name\"=>\"Charlottesville, VA\"}, {\"@url\"=>\"chattanooga\", \"@name\"=>\"Chattanooga, TN\"}, {\"@url\"=>\"cheyenne\", \"@name\"=>\"Cheyenne, WY\"}, {\"@url\"=>\"chicago\", \"@name\"=>\"Chicago, IL\"}, {\"@url\"=>\"chico\", \"@name\"=>\"Chico, CA\"}, {\"@url\"=>\"cincinnati\", \"@name\"=>\"Cincinnati, OH\"}, {\"@url\"=>\"clarksvilletn\", \"@name\"=>\"Clarksville, TN\"}, {\"@url\"=>\"cleveland\", \"@name\"=>\"Cleveland, OH\"}, {\"@url\"=>\"coloradosprings\", \"@name\"=>\"Colorado Springs, CO\"}, {\"@url\"=>\"columbiamo\", \"@name\"=>\"Columbia, MO\"}, {\"@url\"=>\"columbia\", \"@name\"=>\"Columbia, SC\"}, {\"@url\"=>\"columbus\", \"@name\"=>\"Columbus, OH\"}, {\"@url\"=>\"columbusga\", \"@name\"=>\"Columbus, GA\"}, {\"@url\"=>\"corpuschristi\", \"@name\"=>\"Corpus Christi, TX\"}, {\"@url\"=>\"corvallis\", \"@name\"=>\"Corvallis, OR\"}, {\"@url\"=>\"cumberland\", \"@name\"=>\"Cumberland, MD\"}, {\"@url\"=>\"dallas\", \"@name\"=>\"Dallas, TX\"}, {\"@url\"=>\"danvilleva\", \"@name\"=>\"Danville, VA\"}, {\"@url\"=>\"davenport\", \"@name\"=>\"Davenport, IA\"}, {\"@url\"=>\"dayton\", \"@name\"=>\"Dayton, OH\"}, {\"@url\"=>\"daytonabeach\", \"@name\"=>\"Daytona Beach, FL\"}, {\"@url\"=>\"decatural\", \"@name\"=>\"Decatur, AL\"}, {\"@url\"=>\"decaturil\", \"@name\"=>\"Decatur, IL\"}, {\"@url\"=>\"denver\", \"@name\"=>\"Denver, CO\"}, {\"@url\"=>\"desmoines\", \"@name\"=>\"Des Moines, IA\"}, {\"@url\"=>\"detroit\", \"@name\"=>\"Detroit, MI\"}, {\"@url\"=>\"dothan\", \"@name\"=>\"Dothan, AL\"}, {\"@url\"=>\"doverde\", \"@name\"=>\"Dover, DE\"}, {\"@url\"=>\"dubuque\", \"@name\"=>\"Dubuque, IA\"}, {\"@url\"=>\"duluth\", \"@name\"=>\"Duluth, MN\"}, {\"@url\"=>\"eauclaire\", \"@name\"=>\"Eau Claire, WI\"}, {\"@url\"=>\"elpaso\", \"@name\"=>\"El Paso, TX\"}, {\"@url\"=>\"elkhart\", \"@name\"=>\"Elkhart, IN\"}, {\"@url\"=>\"elmira\", \"@name\"=>\"Elmira, NY\"}, {\"@url\"=>\"enidok\", \"@name\"=>\"Enid, OK\"}, {\"@url\"=>\"erie\", \"@name\"=>\"Erie, PA\"}, {\"@url\"=>\"eugene\", \"@name\"=>\"Eugene, OR\"}, {\"@url\"=>\"evansville\", \"@name\"=>\"Evansville, IN\"}, {\"@url\"=>\"fargo\", \"@name\"=>\"Fargo, ND\"}, {\"@url\"=>\"fayettevillear\", \"@name\"=>\"Fayetteville, AR\"}, {\"@url\"=>\"fayettevillenc\", \"@name\"=>\"Fayetteville, NC\"}, {\"@url\"=>\"flagstaff\", \"@name\"=>\"Flagstaff, AZ\"}, {\"@url\"=>\"florenceal\", \"@name\"=>\"Florence, AL\"}, {\"@url\"=>\"florencesc\", \"@name\"=>\"Florence, SC\"}, {\"@url\"=>\"fortcollins\", \"@name\"=>\"Fort Collins, CO\"}, {\"@url\"=>\"fortmyers\", \"@name\"=>\"Fort Myers, FL\"}, {\"@url\"=>\"fortpierce\", \"@name\"=>\"Fort Pierce, FL\"}, {\"@url\"=>\"fortsmith\", \"@name\"=>\"Fort Smith, AR\"}, {\"@url\"=>\"ftwaltonbeach\", \"@name\"=>\"Fort Walton Beach, FL\"}, {\"@url\"=>\"fortwayne\", \"@name\"=>\"Fort Wayne, IN\"}, {\"@url\"=>\"fresno\", \"@name\"=>\"Fresno, CA\"}, {\"@url\"=>\"gadsden\", \"@name\"=>\"Gadsden, AL\"}, {\"@url\"=>\"gainesville\", \"@name\"=>\"Gainesville, FL\"}, {\"@url\"=>\"glensfalls\", \"@name\"=>\"Glens Falls, NY\"}, {\"@url\"=>\"goldsboronc\", \"@name\"=>\"Goldsboro, NC\"}, {\"@url\"=>\"grandforks\", \"@name\"=>\"Grand Forks, ND\"}, {\"@url\"=>\"grandjunction\", \"@name\"=>\"Grand Junction, CO\"}, {\"@url\"=>\"grandrapids\", \"@name\"=>\"Grand Rapids, MI\"}, {\"@url\"=>\"greatfalls\", \"@name\"=>\"Great Falls, MT\"}, {\"@url\"=>\"greenbay\", \"@name\"=>\"Green Bay, WI\"}, {\"@url\"=>\"greensboro\", \"@name\"=>\"Greensboro, NC\"}, {\"@url\"=>\"greenvillenc\", \"@name\"=>\"Greenville, NC\"}, {\"@url\"=>\"greenville\", \"@name\"=>\"Greenville, SC\"}, {\"@url\"=>\"harrisburg\", \"@name\"=>\"Harrisburg, PA\"}, {\"@url\"=>\"hartford\", \"@name\"=>\"Hartford, CT\"}, {\"@url\"=>\"hattiesburg\", \"@name\"=>\"Hattiesburg, MS\"}, {\"@url\"=>\"hendersonville\", \"@name\"=>\"Hendersonville, NC\"}, {\"@url\"=>\"hickory\", \"@name\"=>\"Hickory, NC\"}, {\"@url\"=>\"honolulu\", \"@name\"=>\"Honolulu, HI\"}, {\"@url\"=>\"houma\", \"@name\"=>\"Houma, LA\"}, {\"@url\"=>\"houston\", \"@name\"=>\"Houston, TX\"}, {\"@url\"=>\"huntingtonwv\", \"@name\"=>\"Huntington, WV\"}, {\"@url\"=>\"huntsville\", \"@name\"=>\"Huntsville, AL\"}, {\"@url\"=>\"indianapolis\", \"@name\"=>\"Indianapolis, IN\"}, {\"@url\"=>\"iowacity\", \"@name\"=>\"Iowa City, IA\"}, {\"@url\"=>\"jacksonmi\", \"@name\"=>\"Jackson, MI\"}, {\"@url\"=>\"jackson\", \"@name\"=>\"Jackson, MS\"}, {\"@url\"=>\"jacksontn\", \"@name\"=>\"Jackson, TN\"}, {\"@url\"=>\"jacksonville\", \"@name\"=>\"Jacksonville, FL\"}, {\"@url\"=>\"jacksonvillenc\", \"@name\"=>\"Jacksonville, NC\"}, {\"@url\"=>\"jamestownny\", \"@name\"=>\"Jamestown, NY\"}, {\"@url\"=>\"janesville\", \"@name\"=>\"Janesville, WI\"}, {\"@url\"=>\"johnsoncity\", \"@name\"=>\"Johnson City, TN\"}, {\"@url\"=>\"johnstown\", \"@name\"=>\"Johnstown, PA\"}, {\"@url\"=>\"jonesboro\", \"@name\"=>\"Jonesboro, AR\"}, {\"@url\"=>\"joplin\", \"@name\"=>\"Joplin, MO\"}, {\"@url\"=>\"kalamazoo\", \"@name\"=>\"Kalamazoo, MI\"}, {\"@url\"=>\"kc\", \"@name\"=>\"Kansas City, MO\"}, {\"@url\"=>\"killeen\", \"@name\"=>\"Killeen, TX\"}, {\"@url\"=>\"knoxville\", \"@name\"=>\"Knoxville, TN\"}, {\"@url\"=>\"kokomo\", \"@name\"=>\"Kokomo, IN\"}, {\"@url\"=>\"lacrosse\", \"@name\"=>\"La Crosse, WI\"}, {\"@url\"=>\"lafayettein\", \"@name\"=>\"Lafayette, IN\"}, {\"@url\"=>\"lafayettela\", \"@name\"=>\"Lafayette, LA\"}, {\"@url\"=>\"lakecharles\", \"@name\"=>\"Lake Charles, LA\"}, {\"@url\"=>\"lakeland\", \"@name\"=>\"Lakeland, FL\"}, {\"@url\"=>\"lancaster\", \"@name\"=>\"Lancaster, PA\"}, {\"@url\"=>\"lansing\", \"@name\"=>\"Lansing, MI\"}, {\"@url\"=>\"laredo\", \"@name\"=>\"Laredo, TX\"}, {\"@url\"=>\"lascruces\", \"@name\"=>\"Las Cruces, NM\"}, {\"@url\"=>\"lasvegas\", \"@name\"=>\"Las Vegas, NV\"}, {\"@url\"=>\"lawrenceks\", \"@name\"=>\"Lawrence, KS\"}, {\"@url\"=>\"lawtonok\", \"@name\"=>\"Lawton, OK\"}, {\"@url\"=>\"lewistonme\", \"@name\"=>\"Lewiston, ME\"}, {\"@url\"=>\"lexington\", \"@name\"=>\"Lexington, KY\"}, {\"@url\"=>\"lima\", \"@name\"=>\"Lima, OH\"}, {\"@url\"=>\"lincoln\", \"@name\"=>\"Lincoln, NE\"}, {\"@url\"=>\"littlerock\", \"@name\"=>\"Little Rock, AR\"}, {\"@url\"=>\"longviewtx\", \"@name\"=>\"Longview, TX\"}, {\"@url\"=>\"la\", \"@name\"=>\"Los Angeles, CA\"}, {\"@url\"=>\"louisville\", \"@name\"=>\"Louisville, KY\"}, {\"@url\"=>\"lubbock\", \"@name\"=>\"Lubbock, TX\"}, {\"@url\"=>\"lynchburg\", \"@name\"=>\"Lynchburg, VA\"}, {\"@url\"=>\"macon\", \"@name\"=>\"Macon, GA\"}, {\"@url\"=>\"madison\", \"@name\"=>\"Madison, WI\"}, {\"@url\"=>\"manchesternh\", \"@name\"=>\"Manchester, NH\"}, {\"@url\"=>\"mansfieldoh\", \"@name\"=>\"Mansfield, OH\"}, {\"@url\"=>\"mcallen\", \"@name\"=>\"McAllen, TX\"}, {\"@url\"=>\"medford\", \"@name\"=>\"Medford, OR\"}, {\"@url\"=>\"melbournefl\", \"@name\"=>\"Melbourne, FL\"}, {\"@url\"=>\"memphis\", \"@name\"=>\"Memphis, TN\"}, {\"@url\"=>\"merced\", \"@name\"=>\"Merced, CA\"}, {\"@url\"=>\"meridian\", \"@name\"=>\"Meridian, MS\"}, {\"@url\"=>\"miami\", \"@name\"=>\"Miami, FL\"}, {\"@url\"=>\"milwaukee\", \"@name\"=>\"Milwaukee, WI\"}, {\"@url\"=>\"minneapolis\", \"@name\"=>\"Minneapolis, MN\"}, {\"@url\"=>\"missoula\", \"@name\"=>\"Missoula, MT\"}, {\"@url\"=>\"mobileal\", \"@name\"=>\"Mobile, AL\"}, {\"@url\"=>\"modesto\", \"@name\"=>\"Modesto, CA\"}, {\"@url\"=>\"monroela\", \"@name\"=>\"Monroe, LA\"}, {\"@url\"=>\"montgomery\", \"@name\"=>\"Montgomery, AL\"}, {\"@url\"=>\"muncie\", \"@name\"=>\"Muncie, IN\"}, {\"@url\"=>\"myrtlebeach\", \"@name\"=>\"Myrtle Beach, SC\"}, {\"@url\"=>\"naples\", \"@name\"=>\"Naples, FL\"}, {\"@url\"=>\"nashville\", \"@name\"=>\"Nashville, TN\"}, {\"@url\"=>\"natchez\", \"@name\"=>\"Natchez, MS\"}, {\"@url\"=>\"newlondon\", \"@name\"=>\"New London, CT\"}, {\"@url\"=>\"neworleans\", \"@name\"=>\"New Orleans, LA\"}, {\"@url\"=>\"ny\", \"@name\"=>\"New York, NY\"}, {\"@url\"=>\"newark\", \"@name\"=>\"Newark, NJ\"}, {\"@url\"=>\"norfolk\", \"@name\"=>\"Norfolk, VA\"}, {\"@url\"=>\"ocala\", \"@name\"=>\"Ocala, FL\"}, {\"@url\"=>\"odessa\", \"@name\"=>\"Odessa, TX\"}, {\"@url\"=>\"oklahomacity\", \"@name\"=>\"Oklahoma City, OK\"}, {\"@url\"=>\"omaha\", \"@name\"=>\"Omaha, NE\"}, {\"@url\"=>\"orlando\", \"@name\"=>\"Orlando, FL\"}, {\"@url\"=>\"owensboro\", \"@name\"=>\"Owensboro, KY\"}, {\"@url\"=>\"panamacity\", \"@name\"=>\"Panama City, FL\"}, {\"@url\"=>\"parkersburg\", \"@name\"=>\"Parkersburg, WV\"}, {\"@url\"=>\"pensacola\", \"@name\"=>\"Pensacola, FL\"}, {\"@url\"=>\"peoria\", \"@name\"=>\"Peoria, IL\"}, {\"@url\"=>\"philly\", \"@name\"=>\"Philadelphia, PA\"}, {\"@url\"=>\"phoenix\", \"@name\"=>\"Phoenix, AZ\"}, {\"@url\"=>\"pinebluff\", \"@name\"=>\"Pine Bluff, AR\"}, {\"@url\"=>\"pittsburgh\", \"@name\"=>\"Pittsburgh, PA\"}, {\"@url\"=>\"pittsfieldma\", \"@name\"=>\"Pittsfield, MA\"}, {\"@url\"=>\"pocatello\", \"@name\"=>\"Pocatello, ID\"}, {\"@url\"=>\"portcharlotte\", \"@name\"=>\"Port Charlotte, FL\"}, {\"@url\"=>\"portland\", \"@name\"=>\"Portland, OR\"}, {\"@url\"=>\"portlandme\", \"@name\"=>\"Portland, ME\"}, {\"@url\"=>\"providence\", \"@name\"=>\"Providence, RI\"}, {\"@url\"=>\"provo\", \"@name\"=>\"Provo, UT\"}, {\"@url\"=>\"pueblo\", \"@name\"=>\"Pueblo, CO\"}, {\"@url\"=>\"puntagorda\", \"@name\"=>\"Punta Gorda, FL\"}, {\"@url\"=>\"raleigh\", \"@name\"=>\"Raleigh, NC\"}, {\"@url\"=>\"rapidcity\", \"@name\"=>\"Rapid City, SD\"}, {\"@url\"=>\"readingpa\", \"@name\"=>\"Reading, PA\"}, {\"@url\"=>\"redding\", \"@name\"=>\"Redding, CA\"}, {\"@url\"=>\"reno\", \"@name\"=>\"Reno, NV\"}, {\"@url\"=>\"richlandwa\", \"@name\"=>\"Richland, WA\"}, {\"@url\"=>\"richmond\", \"@name\"=>\"Richmond, VA\"}, {\"@url\"=>\"roanoke\", \"@name\"=>\"Roanoke, VA\"}, {\"@url\"=>\"rochester\", \"@name\"=>\"Rochester, NY\"}, {\"@url\"=>\"rochestermn\", \"@name\"=>\"Rochester, MN\"}, {\"@url\"=>\"rockfordil\", \"@name\"=>\"Rockford, IL\"}, {\"@url\"=>\"rockymount\", \"@name\"=>\"Rocky Mount, NC\"}, {\"@url\"=>\"sacramento\", \"@name\"=>\"Sacramento, CA\"}, {\"@url\"=>\"saginaw\", \"@name\"=>\"Saginaw, MI\"}, {\"@url\"=>\"salinas\", \"@name\"=>\"Salinas, CA\"}, {\"@url\"=>\"saltlakecity\", \"@name\"=>\"Salt Lake City, UT\"}, {\"@url\"=>\"sanangelo\", \"@name\"=>\"San Angelo, TX\"}, {\"@url\"=>\"sanantonio\", \"@name\"=>\"San Antonio, TX\"}, {\"@url\"=>\"sandiego\", \"@name\"=>\"San Diego, CA\"}, {\"@url\"=>\"sf\", \"@name\"=>\"San Francisco, CA\"}, {\"@url\"=>\"sanluisobispo\", \"@name\"=>\"San Luis Obispo, CA\"}, {\"@url\"=>\"santabarbara\", \"@name\"=>\"Santa Barbara, CA\"}, {\"@url\"=>\"santafe\", \"@name\"=>\"Santa Fe, NM\"}, {\"@url\"=>\"sarasota\", \"@name\"=>\"Sarasota, FL\"}, {\"@url\"=>\"savannah\", \"@name\"=>\"Savannah, GA\"}, {\"@url\"=>\"scranton\", \"@name\"=>\"Scranton, PA\"}, {\"@url\"=>\"seattle\", \"@name\"=>\"Seattle, WA\"}, {\"@url\"=>\"sebring\", \"@name\"=>\"Sebring, FL\"}, {\"@url\"=>\"sharonpa\", \"@name\"=>\"Sharon, PA\"}, {\"@url\"=>\"sheboygan\", \"@name\"=>\"Sheboygan, WI\"}, {\"@url\"=>\"shermantx\", \"@name\"=>\"Sherman, TX\"}, {\"@url\"=>\"shreveport\", \"@name\"=>\"Shreveport, LA\"}, {\"@url\"=>\"siouxcity\", \"@name\"=>\"Sioux City, IA\"}, {\"@url\"=>\"siouxfalls\", \"@name\"=>\"Sioux Falls, SD\"}, {\"@url\"=>\"southbend\", \"@name\"=>\"South Bend, IN\"}, {\"@url\"=>\"spokane\", \"@name\"=>\"Spokane, WA\"}, {\"@url\"=>\"springfieldil\", \"@name\"=>\"Springfield, IL\"}, {\"@url\"=>\"springfieldma\", \"@name\"=>\"Springfield, MA\"}, {\"@url\"=>\"springfieldmo\", \"@name\"=>\"Springfield, MO\"}, {\"@url\"=>\"stlouis\", \"@name\"=>\"St Louis, MO\"}, {\"@url\"=>\"stcloud\", \"@name\"=>\"St. Cloud, MN\"}, {\"@url\"=>\"stjosephmo\", \"@name\"=>\"St. Joseph, MO\"}, {\"@url\"=>\"statecollege\", \"@name\"=>\"State College, PA\"}, {\"@url\"=>\"steubenville\", \"@name\"=>\"Steubenville, OH\"}, {\"@url\"=>\"stockton\", \"@name\"=>\"Stockton, CA\"}, {\"@url\"=>\"sumtersc\", \"@name\"=>\"Sumter, SC\"}, {\"@url\"=>\"syracuse\", \"@name\"=>\"Syracuse, NY\"}, {\"@url\"=>\"tallahassee\", \"@name\"=>\"Tallahassee, FL\"}, {\"@url\"=>\"tampa\", \"@name\"=>\"Tampa, FL\"}, {\"@url\"=>\"terrehaute\", \"@name\"=>\"Terre Haute, IN\"}, {\"@url\"=>\"texarkana\", \"@name\"=>\"Texarkana, TX\"}, {\"@url\"=>\"thevillages\", \"@name\"=>\"The Villages, FL\"}, {\"@url\"=>\"toccoa\", \"@name\"=>\"Toccoa, GA\"}, {\"@url\"=>\"toledo\", \"@name\"=>\"Toledo, OH\"}, {\"@url\"=>\"topeka\", \"@name\"=>\"Topeka, KS\"}, {\"@url\"=>\"trenton\", \"@name\"=>\"Trenton, NJ\"}, {\"@url\"=>\"tucson\", \"@name\"=>\"Tucson, AZ\"}, {\"@url\"=>\"tulsa\", \"@name\"=>\"Tulsa, OK\"}, {\"@url\"=>\"tuscaloosa\", \"@name\"=>\"Tuscaloosa, AL\"}, {\"@url\"=>\"tylertx\", \"@name\"=>\"Tyler, TX\"}, {\"@url\"=>\"utica\", \"@name\"=>\"Utica, NY\"}, {\"@url\"=>\"victoriatx\", \"@name\"=>\"Victoria, TX\"}, {\"@url\"=>\"visalia\", \"@name\"=>\"Visalia, CA\"}, {\"@url\"=>\"waco\", \"@name\"=>\"Waco, TX\"}, {\"@url\"=>\"dc\", \"@name\"=>\"Washington, DC\"}, {\"@url\"=>\"waterlooia\", \"@name\"=>\"Waterloo, IA\"}, {\"@url\"=>\"wausau\", \"@name\"=>\"Wausau, WI\"}, {\"@url\"=>\"westpalmbeach\", \"@name\"=>\"West Palm Beach, FL\"}, {\"@url\"=>\"wheeling\", \"@name\"=>\"Wheeling-Steubenville, WV\"}, {\"@url\"=>\"wichita\", \"@name\"=>\"Wichita, KS\"}, {\"@url\"=>\"wichitafallstx\", \"@name\"=>\"Wichita Falls, TX\"}, {\"@url\"=>\"williamsportpa\", \"@name\"=>\"Williamsport, PA\"}, {\"@url\"=>\"wilmington\", \"@name\"=>\"Wilmington, NC\"}, {\"@url\"=>\"winstonsalem\", \"@name\"=>\"Winston-Salem, NC\"}, {\"@url\"=>\"winterhaven\", \"@name\"=>\"Winter Haven, FL\"}, {\"@url\"=>\"woodbridge\", \"@name\"=>\"Woodbridge, VA\"}, {\"@url\"=>\"yakima\", \"@name\"=>\"Yakima, WA\"}, {\"@url\"=>\"yorkpa\", \"@name\"=>\"York, PA\"}, {\"@url\"=>\"youngstown\", \"@name\"=>\"Youngstown, OH\"}, {\"@url\"=>\"yubacity\", \"@name\"=>\"Yuba City, CA\"}, {\"@url\"=>\"yuma\", \"@name\"=>\"Yuma, AZ\"}]}, {\"@url\"=>\"india\", \"@name\"=>\"India\", \"region\"=>[{\"@url\"=>\"ahmedabad\", \"@name\"=>\"Ahmedabad\"}, {\"@url\"=>\"bangalore\", \"@name\"=>\"Bangalore\"}, {\"@url\"=>\"bhopal\", \"@name\"=>\"Bhopal\"}, {\"@url\"=>\"chennai\", \"@name\"=>\"Chennai\"}, {\"@url\"=>\"delhi\", \"@name\"=>\"Delhi\"}, {\"@url\"=>\"hyderabad\", \"@name\"=>\"Hyderabad\"}, {\"@url\"=>\"indore\", \"@name\"=>\"Indore\"}, {\"@url\"=>\"jaipur\", \"@name\"=>\"Jaipur\"}, {\"@url\"=>\"kanpur\", \"@name\"=>\"Kanpur\"}, {\"@url\"=>\"kolkata\", \"@name\"=>\"Kolkata\"}, {\"@url\"=>\"lucknow\", \"@name\"=>\"Lucknow\"}, {\"@url\"=>\"mumbai\", \"@name\"=>\"Mumbai\"}, {\"@url\"=>\"nagpur\", \"@name\"=>\"Nagpur\"}, {\"@url\"=>\"patna\", \"@name\"=>\"Patna\"}, {\"@url\"=>\"pune\", \"@name\"=>\"Pune\"}, {\"@url\"=>\"surat\", \"@name\"=>\"Surat\"}]}, {\"@url\"=>\"ireland\", \"@name\"=>\"Ireland\", \"region\"=>[{\"@url\"=>\"cork\", \"@name\"=>\"Cork\"}, {\"@url\"=>\"dublin\", \"@name\"=>\"Dublin\"}, {\"@url\"=>\"galway\", \"@name\"=>\"Galway\"}, {\"@url\"=>\"limerick\", \"@name\"=>\"Limerick\"}, {\"@url\"=>\"waterford\", \"@name\"=>\"Waterford\"}]}]} \n#@oodle.region = 'canada'\n#@oodle.category = 'housing/sale'\n#@oodle.num = '15'\n#@oodle.sort = 'ctime_reverse'\n#@results = @oodle.fetch_listings\n#@num = @results['meta']['returned']\n#@listings = @results['listings']\nurl = 'http://api.oodle.com/api/v2/listings?key=90984BE28A8F&region=canada&category=housing/sale&num=2' \nxml_data = Net::HTTP.get_response(URI.parse(url)).body\n\n@r = REXML::Document.new(xml_data)\n@titles = []\n@links = []\n@r.elements.each('oodle_response/current/region/name') do |ele|\n @titles << ele.text\nend\n@r.elements.each('oodle_response/listings/element/title') do |ele|\n @links << ele.text\nend\n#puts r.elements[\"getserver/uploadform\"].first\n\n @project = Project.find(params[:id])\n respond_to do |format|\n format.xml { render xml: @project}\n format.html # show.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "2e80d4f8b1a713fb1239b35a5b38a1cf", "score": "0.5745185", "text": "def index\n @administrative_regions = AdministrativeRegion.all\n end", "title": "" }, { "docid": "29b78d7dc7a5ab34704f260eea1625df", "score": "0.57230526", "text": "def index\n\t\t@leagues = Elimination.where(private_access: false, active: true, published: true, full:false, locked:false)\n\t\trender json: @leagues\n\tend", "title": "" }, { "docid": "3206ae75f576605c10a4b15be5669a6c", "score": "0.5700401", "text": "def index\n response = HTTParty.get('https://congress.api.sunlightfoundation.com/legislators/locate?zip='+current_user.zipcode.to_s+'&apikey=' + ENV[\"sunlight_api_key\"])\n @legislators = response[\"results\"]\n end", "title": "" }, { "docid": "5075e78eef9008dc0e8540afa1a15fa7", "score": "0.56950694", "text": "def all_locations\n @locations = Vendor.select(:district).order(:district).distinct.pluck(:district)\n\n if @locations.nil?\n render json: { message: \"Cannot find locations\" }, status: :not_found\n else\n render json: @locations\n end\n end", "title": "" }, { "docid": "bd77b833dca29c9ff2e2a6c8c88b572d", "score": "0.56943226", "text": "def index\n @regions = Region.includes(:state).all\n end", "title": "" }, { "docid": "efc9016b98610f9e041b28291fa298b6", "score": "0.5690405", "text": "def create\n @region_lethality = RegionLethality.new(region_lethality_params)\n\n respond_to do |format|\n if @region_lethality.save\n format.html { redirect_to region_lethalities_path, notice: 'Region lethality was successfully created.' }\n else\n format.html { render action: 'new' }\n format.json { render json: @region_lethality.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "555f67efc6d22b510d2ad818e9ab6109", "score": "0.5671324", "text": "def additional_regions\n [\n {:name => \"germanycentral\", :description => \"Germany Central\"},\n {:name => \"germanynortheast\", :description => \"Germany Northeast\"},\n {:name => \"usgovarizona\", :description => \"US Gov Arizona\"},\n {:name => \"usgoviowa\", :description => \"US Gov Iowa\"},\n {:name => \"usgovtexas\", :description => \"US Gov Texas\"},\n {:name => \"usgovvirginia\", :description => \"US Gov Virginia\"}\n ]\n end", "title": "" }, { "docid": "af073a36eb737efc7d2afab8a754c6b0", "score": "0.56691766", "text": "def obtain_cities\n # We want it to return an array\n # for each city, a has of href and name\n uri = URI('https://api.teleport.org/api/urban_areas/')\n response = Net::HTTP.get(uri)\n data = JSON.parse(response)\n data['_links']['ua:item']\nend", "title": "" }, { "docid": "1c0ec9465e7eedd8a73bc73552455edb", "score": "0.56288487", "text": "def index\n @legs = Leg.all\n\n render json: @legs\n end", "title": "" }, { "docid": "e551a8eff39cec2d4de08cdc121c007a", "score": "0.5626248", "text": "def fetch_regions\n @partial_regions = Region.having_reports\n end", "title": "" }, { "docid": "203006a2bcb0ecf00135cf1579ad3656", "score": "0.56252116", "text": "def locations\n city_states = []\n if params.include?(:locality) && !params[:locality].empty?\n addresses = Address.where( \"locality LIKE ?\", \"%#{params[:locality]}%\").select(\"locality, state\").distinct\n #pg version: addresses = Address.where( \"locality ~* ?\", params[:locality]).select(\"locality, state\").distinct\n end\n addresses.each do |aid| \n city_states << \"#{aid.locality.split.map(&:capitalize).*(' ')}, #{aid.state}\"\n end\n render json: city_states\n end", "title": "" }, { "docid": "0328c4221b5d97bd8a9ec0fb2d28b857", "score": "0.5606434", "text": "def index\n\t\tauthorize! :index, Regional\n @regionales = Regional.all\n end", "title": "" }, { "docid": "a2d81959c8b683921b56d8a6fdfd091d", "score": "0.5602406", "text": "def index\n @lab_regions = LabRegion.all\n end", "title": "" }, { "docid": "75898b041a350b590970faf071095d98", "score": "0.5599244", "text": "def region_lethality_params\n params.require(:region_lethality).permit(:disease_id, :province_id, :lethality)\n end", "title": "" }, { "docid": "b807202fedb3ee817447ebb329bb4675", "score": "0.5589033", "text": "def index\n @regions = Region.all\n end", "title": "" }, { "docid": "b807202fedb3ee817447ebb329bb4675", "score": "0.5589033", "text": "def index\n @regions = Region.all\n end", "title": "" }, { "docid": "b807202fedb3ee817447ebb329bb4675", "score": "0.5589033", "text": "def index\n @regions = Region.all\n end", "title": "" }, { "docid": "b807202fedb3ee817447ebb329bb4675", "score": "0.5589033", "text": "def index\n @regions = Region.all\n end", "title": "" }, { "docid": "b807202fedb3ee817447ebb329bb4675", "score": "0.5589033", "text": "def index\n @regions = Region.all\n end", "title": "" }, { "docid": "fc4efb257f9b47239bf613d5fc5478b6", "score": "0.5587805", "text": "def show\n\n @region = Region.find(params[:id])\n @districts = @region.districts\n\n @modems = @region.modems.paginate(page: params[:page])\n @printers = @region.printers.paginate(page: params[:page])\n @devices = @region.devices.paginate(page: params[:page])\n @computers = @region.computers.paginate(page: params[:page])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @region }\n end\n end", "title": "" }, { "docid": "73c54c7a183d8d929d0b114e47e9bb28", "score": "0.5582001", "text": "def index\n @regionwindlights = Regionwindlight.all\n end", "title": "" }, { "docid": "5e42c1d25616c64aa3ddc4f1c648c601", "score": "0.5576192", "text": "def print_cities\n response = RestClient.get\"http://data.orghunter.com/v1/charitysearch?user_key=#{ENV['API_KEY']}&state=NY\"\n response_hash = JSON.parse(response)\n orgs = response_hash[\"data\"]\n orgs.each do |org|\n puts \"City: #{org['city']}\"\n end\nend", "title": "" }, { "docid": "4efc5599b9a4e800b1a4d02a30f61ff0", "score": "0.557341", "text": "def index\n @regions = Region.all\n \n end", "title": "" }, { "docid": "806ae3499520cd2ae0d1813dfc350abd", "score": "0.5569427", "text": "def departments\n render json: Department.all.includes(:regional_name).map{|x| {id: x.id, name: x.rgnl_name}}\n end", "title": "" }, { "docid": "858d0fc3227cb7de9bfbce5c9d9106eb", "score": "0.5568897", "text": "def get_universities\n\t\t@universities = University.all\n\t\trender :json => (@universities.map { |u| u.as_json(:only => [:id,:name, :acronym, :logo])}).to_json\n\tend", "title": "" }, { "docid": "2f5024d15e1eccd0d522a783b937f077", "score": "0.55670416", "text": "def index\n @regions = Region.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @regions }\n end\n end", "title": "" }, { "docid": "2f5024d15e1eccd0d522a783b937f077", "score": "0.55670416", "text": "def index\n @regions = Region.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @regions }\n end\n end", "title": "" }, { "docid": "2e1f62b59634c591edb2e8f320c5a098", "score": "0.5566164", "text": "def cities(country_code)\n request(:get, \"/api/cities?country=#{country_code}\")\n end", "title": "" }, { "docid": "78d02b5983655fa6a42f9a350c40cb74", "score": "0.5561357", "text": "def destroy\n @region_lethality.destroy\n respond_to do |format|\n format.html { redirect_to region_lethalities_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "516a859dc31282ef9fe2476a7598613e", "score": "0.5552293", "text": "def regions\n @regions ||= %w{\n us-east-1\n us-west-2\n ap-southeast-2\n }\n end", "title": "" }, { "docid": "fadc4a6468b44967a3c2ab0ef6c4f096", "score": "0.5539326", "text": "def unique_regions\n regions = WbInfo.uniq.pluck(:region)\n\n render json: regions\n end", "title": "" }, { "docid": "d36dca1b86492ab36b251791d72fb152", "score": "0.5522251", "text": "def index\n @localities = Locality.all\n end", "title": "" }, { "docid": "2b9a94d5f7302c6e4fa6a5f34b05009a", "score": "0.5520129", "text": "def index\n @regions = Region.all\n end", "title": "" }, { "docid": "0fef7e521cbcc79217e2b3deee6778e7", "score": "0.5512575", "text": "def cities\n\t\tCity.cities_in_country('SE')\n\tend", "title": "" }, { "docid": "1cf0f2a8521b9d206c71930a4323d24a", "score": "0.5510993", "text": "def index\n @roles = @location.roles.location_only # TODO change to roles\n end", "title": "" }, { "docid": "9d464629ea621f1151861edf7dc43c68", "score": "0.5499703", "text": "def list_dishes_by_region\n puts \"------------ Dishes by Region ------------\"\n regions = Souschef::ApiHandler.fetch_dish_regions\n regions[\"meals\"].each { |dish| puts dish[\"strArea\"] }\n puts \"------------------------------------------\"\n search_by_region\n end", "title": "" }, { "docid": "0d9f424714adc77bc19b18636ef1ec03", "score": "0.549719", "text": "def index\n @helplines = current_region.helplines.paginate(page: params[:page], per_page: 10)\n end", "title": "" }, { "docid": "0e368f3007dd4beab5e11272ee2d5665", "score": "0.5487434", "text": "def regions\n @carrierRegions = []\n if session[:carrier]\n soap_client = MyFreightWorldCarrier.new\n @carrierRegions = soap_client.getRegions(session[:carrier][\"token\"])\n end\n\n render :json => @carrierRegions\n end", "title": "" }, { "docid": "57d4952db85f96c6bfaec512dccaa35c", "score": "0.5485927", "text": "def index\n @universities = University.search(params[:search])\n \n if !params[:area].blank?\n # select only university which has city in correct area\n @universities = @universities.where('universities.city IN (?)', University::AREAS[params[:area].to_i])\n end\n \n #respond with js format, index.js.erb will be run\n respond_to do |format|\n format.html {}\n format.js {}\n format.json { render json: @universities, status: :ok }\n end\n end", "title": "" }, { "docid": "2717c753bfd3efa273e0621fb3475e0e", "score": "0.5483496", "text": "def all\n subregions = Subregions.all( params[:urn] )\n render :json => { :subregions => subregions }\n end", "title": "" }, { "docid": "8feeca36b5ebe8a552c5a6796fb78e33", "score": "0.5481582", "text": "def legalities\n Legality.where(uuid: self.uuid)\n end", "title": "" }, { "docid": "c869636a4cb372377fafb8549217f5aa", "score": "0.5463004", "text": "def index\n @location_levels = LocationLevel.all\n end", "title": "" }, { "docid": "e2a25f9b2dd3dee50e4a9ca119a361d9", "score": "0.54506123", "text": "def index\n @major_regions = MajorRegion.all\n end", "title": "" }, { "docid": "97e2312fbcc336bfbb316edc56e8a886", "score": "0.54486513", "text": "def sitelist\n @fulllist = sitelist_data\n region_list = {}\n @fulllist.map do |k, _v|\n k.each do |key, value|\n @auth = value if key == 'unitaryAuthArea'\n @name = value if key == 'name'\n end\n region_list[@auth] = @name\n end\n region_list # Return list of locations\nend", "title": "" }, { "docid": "97e2312fbcc336bfbb316edc56e8a886", "score": "0.54486513", "text": "def sitelist\n @fulllist = sitelist_data\n region_list = {}\n @fulllist.map do |k, _v|\n k.each do |key, value|\n @auth = value if key == 'unitaryAuthArea'\n @name = value if key == 'name'\n end\n region_list[@auth] = @name\n end\n region_list # Return list of locations\nend", "title": "" }, { "docid": "1d5c30e997f83162c4fcb1ef75f261b5", "score": "0.5447989", "text": "def index\n if params[:city]\n @landmarks = Landmark.all\n @city_name = params['city']\n @city = City.find_by(:name => @city_name)\n if @city \n @city_id = @city.id\n render :json => @landmarks.where(:city_id => @city_id), status: 200\n else\n render :json => { :status => 'error', :message => 'No such city in the database' }, status: 401\n end\n else\n @landmarks = Landmark.all\n render :json => @landmarks\n end\n end", "title": "" }, { "docid": "96ec82e4038e6103ac5aa9a102d2d948", "score": "0.54472774", "text": "def index\n @account = current_user.account\n @location_roles = LocationRole.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @location_roles }\n end\n end", "title": "" }, { "docid": "664b0db53c2faf6a96c54a71627230c8", "score": "0.54439604", "text": "def loyalties(format: \"json\", pretty: false)\n request_catalogue(\"/catalog/loyalties\", format, pretty)\n end", "title": "" }, { "docid": "9c083253341f9ee883a5d97ceef0d50a", "score": "0.5442926", "text": "def index\n\t\t@leagues = Fantasy.where(private_access: false, active: true, published: true, full:false, locked:false)\n\t\trender json: @leagues\n\tend", "title": "" }, { "docid": "d197ab58ce1535876cff290e04b7a26d", "score": "0.54409957", "text": "def index\n @districts = @state.districts\n @districts = @districts.map{|d| {id: d.id, name: d.name[@language]}}\n end", "title": "" }, { "docid": "166667b768eb33378f8e79d48a4dc840", "score": "0.5434239", "text": "def regions\n DefinitionFactory.regions_repository.all\n end", "title": "" }, { "docid": "d37dcd37637ec5da282bf4fc41f5e8f0", "score": "0.5429848", "text": "def regions\n DigitalOcean::Resource::Region.new(@faraday)\n end", "title": "" }, { "docid": "9578a19f2d6fde8185d54eaba4d3b84f", "score": "0.54280174", "text": "def localities\n @collecting_geography&.localities_dataset ||\n discipline.localities_dataset\n end", "title": "" }, { "docid": "55b909231bf3a3ddee60a9d526989f83", "score": "0.54270357", "text": "def region\n region_conditions = [\"name LIKE (?)\", \"#{params[:value]}%\"]\n\n regions = Region.where(region_conditions)\n regions = regions.map do |r|\n \"<li value='#{r.name}'>#{r.name}</li>\"\n end\n render plain: regions.join('').html_safe and return\n end", "title": "" }, { "docid": "9b100b0cd5588fbfb08fac5e40045a90", "score": "0.5425", "text": "def show_state\n\t\trecords = Coli.where(state: params[:state])\n\t\tlocations = Array.new\n\n\t\trecords.each do |record|\n\t\t\tlocations << record.attributes.except('id', 'created_at', 'updated_at')\n\t\tend\n\n\t\tif locations.present?\n\t\t\treturn render json: locations, status: 200\n\t\telse\n\t\t\treturn render json: [], status: 404\n\t\tend\n\tend", "title": "" }, { "docid": "eeff39c9ed6d8b53db6094d727d928ed", "score": "0.5424966", "text": "def index\n @regionArray = getRegionArray\n end", "title": "" }, { "docid": "65de7cc4face4aed49766ee1ff7c2595", "score": "0.5424726", "text": "def renderRegions\n\n begin\n regionsData = self.getRegionsData\n rescue CustomException => e\n render :json=>\"Problem in retrieving data for all nodes: \"+e.data, :status => :service_unavailable\n return\n end\n \n \n if regionsData == nil\n render :json=>\"Problem in retrieving data: no data\", :status => :service_unavailable\n return\n end\n render :json => regionsData.to_json\n end", "title": "" }, { "docid": "1d45c003fc41a2c59ff1c7f999845ee1", "score": "0.5421782", "text": "def ldap_regions_list\n ldap_region_build_list\n\n update_gtl_div(\"ldap_regions_list\") if !params[:button] && pagination_or_gtl_request?\n end", "title": "" }, { "docid": "1bdd03fa29cc0f26e4c86c00152c497b", "score": "0.5416279", "text": "def index\n @localities = Locality.paginate(page: @page, per_page: @per_page)\n end", "title": "" }, { "docid": "9471a0d4f6fc6cb806ceeea6df184d1b", "score": "0.5406601", "text": "def index\n @user_regions = UserRegion.all\n end", "title": "" }, { "docid": "9471a0d4f6fc6cb806ceeea6df184d1b", "score": "0.5406601", "text": "def index\n @user_regions = UserRegion.all\n end", "title": "" }, { "docid": "2e402a5ae39262524c03d861763f447a", "score": "0.5402192", "text": "def regions\n self.campus.map {|x| x.city.region_id}\n end", "title": "" }, { "docid": "2e402a5ae39262524c03d861763f447a", "score": "0.5402192", "text": "def regions\n self.campus.map {|x| x.city.region_id}\n end", "title": "" }, { "docid": "8b321ecc12a6974ee82356903ca43ac1", "score": "0.5399037", "text": "def available_school_districts\n @results = current_user.school_districts\n respond_with(@results)\n end", "title": "" }, { "docid": "6d85ab4671bbe5df90f869ff7c6a941a", "score": "0.5387916", "text": "def index\n @title = t 'view.regions.index_title'\n @searchable = true\n @regions = @regions.filtered_list(params[:q]).page(params[:page]).uniq('id')\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @regions }\n end\n end", "title": "" }, { "docid": "dda9d32eee8a09e0ccf547886b61ef97", "score": "0.5382692", "text": "def cities\n res = RestClient.get('https://nomadlist.com/api/v2/list/cities/', headers={})\n dict = JSON.parse(res.body)\n dict[\"result\"].map{ |item| item[\"info\"][\"city\"]}\nend", "title": "" }, { "docid": "6714835fd5f0ee7d74daad6222d24ea8", "score": "0.5382238", "text": "def universities_in_city\n universities = City.find(params[:id]).universities.order(name: :asc)\n\n render json: universities.to_json(), status: :ok\n end", "title": "" }, { "docid": "c4d6bb73c45fad5959b48f4282dfd14d", "score": "0.5379866", "text": "def cities\n state = params[:state]\n respond_to do |format|\n format.json { render json: {cities: CS.cities(state)}}\n format.html { render json: {cities: CS.cities(state)}}\n end\n end", "title": "" }, { "docid": "ed3b732afe9aaacdf213bc69c1d2ae1e", "score": "0.5377491", "text": "def index\n manage_filter_state\n @towns = Town.includes(province: [:region]).paginate(:page => params[:page], :per_page => per_page).order(sort_column + ' ' + sort_direction)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @towns }\n format.js\n end\n end", "title": "" }, { "docid": "8d74e07271818aec67d87fd36236d850", "score": "0.5373396", "text": "def tracked_locations(username, page = 1)\n get \"users/#{username}/metro_areas/tracked.#{format}\", page\n end", "title": "" }, { "docid": "077768bf9cdf9f20e031483224aee0a0", "score": "0.53712094", "text": "def show\n @regional = Regional.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @regional }\n end\n end", "title": "" }, { "docid": "077768bf9cdf9f20e031483224aee0a0", "score": "0.53712094", "text": "def show\n @regional = Regional.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @regional }\n end\n end", "title": "" }, { "docid": "a9628bca5f69be61d9b31cf03ac69ef8", "score": "0.53687674", "text": "def index\n @interest_locations = InterestLocation.all\n end", "title": "" }, { "docid": "a7f4af7213ec2eb87f6342887cac3fd7", "score": "0.53684574", "text": "def list_regions(options={}) path = \"/api/v2/definitions/regions\"\n get(path, options, AvaTax::VERSION) end", "title": "" }, { "docid": "9d2a32eff52e387e7f3818f2b9381beb", "score": "0.53652126", "text": "def yelp_restaurants\n render json: Restaurant.fetch_restaurants(params['lon'], params['lat'])\n end", "title": "" }, { "docid": "e47fad4c9aee10b6c5111168dd2fb0d8", "score": "0.53647214", "text": "def index\n @region_managers = RegionManager.all\n end", "title": "" }, { "docid": "52532c1150c28cd2e85e1cc18539c515", "score": "0.53639483", "text": "def more_locations_weather(city1,city2)\n p JSON.parse(self.class.get(\"/group?id=\" + \"#{city1}\" + \",\" + \"#{city2}\" + \"&units=metric\" + \"#{@token}\").body)\n end", "title": "" }, { "docid": "34866f321e02df29b03fb358910e419a", "score": "0.53604364", "text": "def regions\n country_code = params[:country_code]\n @users = User.where(country_code: country_code).includes(:statistic)\n \n region_stats = {}\n\n @users.each do |user|\n if user.statistic\n count_permutations = user.statistic.stats['permutations']\n jvm_state_code = user.jvm_state_code(country_code, user.state)\n region_stats[jvm_state_code] = region_stats[jvm_state_code].to_i + count_permutations.to_i if jvm_state_code\n end\n end\n\n render json: region_stats.to_json\n end", "title": "" }, { "docid": "f5af96521179717c71022b5a94e91c67", "score": "0.5357978", "text": "def index\n @conservedregions = Conservedregion.all\n end", "title": "" }, { "docid": "0279d49ec9a8a612f6ef389994c9f14d", "score": "0.53575736", "text": "def regions_list\n [\n { slug: 'australia-new-zealand',\n countries: %w[australia fiji new-zealand papua-new-guinea],\n name: 'Australia/New Zealand' },\n { slug: 'caribbean',\n countries: %w[barbados costa-rica cuba dominican-republic jamaica trinidad-and-tobago],\n name: 'Caribbean' },\n { slug: 'central-and-eastern-europe',\n countries: %w[bosnia-and-herzegovina bulgaria croatia czech-republic hungary macedonia poland romania serbia slovakia slovenia],\n name: 'Central and Eastern Europe' },\n { slug: 'china',\n countries: %w[china],\n name: 'China' },\n { slug: 'south-america',\n countries: %w[argentina bolivia brazil chile colombia ecuador guyana mexico panama peru uruguay venezuela],\n name: 'South America' },\n { slug: 'mediterranean-europe',\n countries: %w[cyprus greece israel italy portugal spain],\n name: 'Mediterranean Europe' },\n { slug: 'middle-east',\n countries: %w[afghanistan bahrain iran iraq jordan kuwait lebanon oman pakistan palestine qatar saudi-arabia the-united-arab-emirates],\n name: 'Middle East' },\n { slug: 'nato',\n countries: %w[nato],\n name: 'NATO' },\n { slug: 'nordic-and-baltic',\n countries: %w[denmark estonia finland iceland latvia lithuania norway sweden],\n name: 'Nordic & Baltic' },\n { slug: 'north-africa',\n countries: %w[algeria egypt libya morocco tunisia],\n name: 'North Africa' },\n { slug: 'north-america',\n countries: %w[canada the-usa],\n name: 'North America' },\n { slug: 'north-east-asia',\n countries: %w[japan south-korea taiwan],\n name: 'North East Asia' },\n { slug: 'south-asia',\n countries: %w[bangladesh india nepal sri-lanka],\n name: 'South Asia' },\n { slug: 'south-east-asia',\n countries: %w[brunei burma cambodia indonesia malaysia philippines singapore thailand vietnam],\n name: 'South East Asia' },\n { slug: 'sub-saharan-africa',\n countries: %w[angola cameroon ethiopia ghana ivory-coast kenya mauritius mozambique namibia nigeria rwanda senegal seychelles south-africa tanzania uganda zambia],\n name: 'Sub Saharan Africa' },\n { slug: 'turkey-russia-and-caucasus',\n countries: %w[armenia azerbaijan georgia kazakhstan mongolia russia tajikistan turkey turkmenistan ukraine uzbekistan],\n name: 'Turkey, Russia & Caucasus' },\n { slug: 'western-europe',\n countries: %w[austria belgium france germany ireland luxembourg netherlands switzerland],\n name: 'Western Europe' },\n ].sort_by { |region| region[:name] }\n end", "title": "" }, { "docid": "529bb102697201f3e304da9079641897", "score": "0.5354626", "text": "def geo_search\n\n @locations = Question.select(:city_state).where(\"city_state ILIKE ?\", \"%#{params[:term]}%\").group(:city_state)\n respond_to do |format|\n format.json { render json: @locations.map(&:city_state) }\n format.html { redirect_to root_path }\n end\n\n end", "title": "" }, { "docid": "89beb28413c1bc67763aa8965c88d05f", "score": "0.53543586", "text": "def get_shipping_regions\n shipping_regions = ShippingRegion.all\n json_response(shipping_regions)\n end", "title": "" }, { "docid": "99da0cd8614ebc66d7a8d239ba434c6d", "score": "0.5351304", "text": "def select_region\n\n origin_labs = Strain.find_by_sql(\"select origin_lab from strains group by origin_lab\")\n @lab_menu = []\n origin_labs.each do |lab|\n @lab_menu << lab.origin_lab if (lab.origin_lab != nil && lab.origin_lab != '')\n end\n\n origin_country = Strain.find_by_sql(\"select origin from strains group by origin\")\n @country_menu = []\n origin_country.each do |country|\n @country_menu << country.origin if (country.origin != nil && country.origin != '')\n end\n\n chromosomes = MapPosition.find_by_sql(\"select chromosome_label from map_positions where map_id = 1 group by chromosome_label order by chromosome_number asc\")\n @chromosome_menu = []\n chromosomes.each do |chr|\n @chromosome_menu << chr.chromosome_label\n end\n\n @strains = Strain.find(:all, :conditions => ['taxon_id = ?',10116], :order => \"symbol ASC\")\n\n end", "title": "" } ]
f435b8948398a2da9b0aa75a61fbbd61
subsequence for that Array. You may assume that the Array always contains at least one number. def sum_of_sums(numbers) sum_total = 0 1.upto(numbers.size) do |count| sum_total += numbers.slice(0, count).reduce(:+) end sum_total end
[ { "docid": "2203708b56d83851ec0bb99ae18a7b72", "score": "0.8483748", "text": "def sum_of_sums(numbers)\n sum_total = 0 # variable to collect the total sum\n 1.upto(numbers.size) do |count| # used to generate the correct size of the numbers in the array\n sum_total += numbers.slice(0, count).reduce(:+) # gets the subset and then uses reduce to get sum.\n end\n sum_total\nend", "title": "" } ]
[ { "docid": "4f633b9a25effc106296643778de9291", "score": "0.8660823", "text": "def sum_of_sums(array)\n \n total_sum = 0\n subsequence_sum = 0\n array.each do |num|\n subsequence_sum += num\n total_sum += subsequence_sum\n end\n total_sum\nend", "title": "" }, { "docid": "3cda4695f3751303a1e0d8ed7d0ddcef", "score": "0.84466213", "text": "def sum_of_sums(arr)\n subsequences = []\n arr.each_with_index do |num, index|\n subsequences << arr.slice(0, index + 1)\n end\n \n subsequences.flatten.sum\nend", "title": "" }, { "docid": "f3e37abc9c24c2792348ae2794e58211", "score": "0.8386628", "text": "def sum_of_sums(numbers)\n sum_total = 0\n 1.upto(numbers.size) do |count|\n sum_total += numbers.slice(0, count).reduce(:+)\n end\n sum_total\nend", "title": "" }, { "docid": "f3e37abc9c24c2792348ae2794e58211", "score": "0.8386628", "text": "def sum_of_sums(numbers)\n sum_total = 0\n 1.upto(numbers.size) do |count|\n sum_total += numbers.slice(0, count).reduce(:+)\n end\n sum_total\nend", "title": "" }, { "docid": "f3e37abc9c24c2792348ae2794e58211", "score": "0.8386628", "text": "def sum_of_sums(numbers)\n sum_total = 0\n 1.upto(numbers.size) do |count|\n sum_total += numbers.slice(0, count).reduce(:+)\n end\n sum_total\nend", "title": "" }, { "docid": "f3e37abc9c24c2792348ae2794e58211", "score": "0.8386628", "text": "def sum_of_sums(numbers)\n sum_total = 0\n 1.upto(numbers.size) do |count|\n sum_total += numbers.slice(0, count).reduce(:+)\n end\n sum_total\nend", "title": "" }, { "docid": "00415c501c5fe02478463e8d0dfbef88", "score": "0.830272", "text": "def sum_of_sums(array)\n (1..array.size).reduce(0) { |sum, n| sum += array.take(n).reduce(:+) }\nend", "title": "" }, { "docid": "bbfda6d20ffdd7eaa52b39775f6b0c40", "score": "0.8217553", "text": "def sum_of_sums(array)\n array_to_add = []\n array.each_index do |indx|\n (array.size - indx).times { array_to_add << array[indx] }\n end\n array_to_add.inject(:+)\nend", "title": "" }, { "docid": "20991af3cb9f541162f75d403558df6f", "score": "0.8128929", "text": "def sum_of_sums(array)\n sum_total = 0\n array.size.times do \n sum_total += array.reduce(:+)\n array.pop\n end\n\n sum_total\nend", "title": "" }, { "docid": "f5b32e770c887f4e54bf6e739d663d9a", "score": "0.8123656", "text": "def sum_of_sums(array)\n sum = 0\n array.size.times do |idx|\n sum += array[0..idx].inject(:+)\n end\n sum\nend", "title": "" }, { "docid": "89c131cd2d03bfa3dcb31b3943cddb3b", "score": "0.8120174", "text": "def sum_of_sums(arr)\n (0...arr.size).reduce(0) do |memo, index|\n memo + arr.slice(0..index).reduce(:+)\n end\nend", "title": "" }, { "docid": "94c857e7c803c80ab035b5a36c4c74bf", "score": "0.8092705", "text": "def sum_of_sums(numbers)\n amount = numbers.length\n temp_array = []\n numbers.each do |num|\n amount.times {temp_array << num}\n amount -= 1\n end\n # at this point if numbers = [3,5,2]\n # temp array = [3,3,3,5,5,2]\n temp_array.reduce(:+)\nend", "title": "" }, { "docid": "991dd0155f0195fff34e13bac17fe48d", "score": "0.80925757", "text": "def sum_of_sums(numbers)\n sum = 0\n numbers.size.times do |index|\n sum += numbers[0,index + 1].reduce(:+)\n end\n sum\nend", "title": "" }, { "docid": "e098604316514ec99a2ee5a31b7fac9d", "score": "0.8082473", "text": "def sum_of_sums(arr)\n total = 0\n\n (0..(arr.length - 1)).each do |run_length|\n total += arr[(0..run_length)].inject(:+)\n end\n \n total\nend", "title": "" }, { "docid": "88e0b94a1947742dcce2194533a0f772", "score": "0.8076778", "text": "def sum_of_sums(array)\n sums = []\n array.each_with_index do |element, index|\n sums << array.slice(0..index).inject(&:+)\n end\n \n sums.inject(&:+)\nend", "title": "" }, { "docid": "af396fae941ca2d0b6d6fff5c9f8eaf7", "score": "0.80626285", "text": "def sum_of_sums(array)\n total = 0\n array.each_with_index do |e, i|\n total += array[0..i].reduce(:+)\n end\n total\nend", "title": "" }, { "docid": "f707f697452626c609dedbc38a54d9bf", "score": "0.8055227", "text": "def sum_of_sums(array)\n array.each_index.with_object([]) { |idx, num| num << array[0..idx].reduce(:+) }.reduce(:+)\nend", "title": "" }, { "docid": "0ad6c43b550c80675289125a7489e21c", "score": "0.80494744", "text": "def sum_of_sums(arr)\n sum = 0\n arr.each_index do |index|\n sum += arr.slice(0, index + 1).reduce(:+)\n end\n sum\nend", "title": "" }, { "docid": "64ebeaf24266daf5f38d444a9b4a1978", "score": "0.80416685", "text": "def sum_of_sums(array)\n\n answer = 0\n\n array.each_with_index do |num, index|\n answer += array.slice(0..index).sum\n end\n\n answer\n\nend", "title": "" }, { "docid": "dcf4652d0e681ce61cdcb27492c3d40e", "score": "0.8038191", "text": "def sum_of_sums(array)\n (1..array.size).reduce(0) { |sum, n| sum += array[0, n].reduce(:+) }\nend", "title": "" }, { "docid": "0baf5ea82703ed66408bcfa0e9d061c8", "score": "0.8036504", "text": "def sum_of_sums(array)\n result = 0\n array.each_index do |i|\n result += array[i] * (array.size - i)\n end\n result\nend", "title": "" }, { "docid": "2ed49e132577625a24f7797a8d0b5bb9", "score": "0.79561603", "text": "def sum_of_sums(array)\n sums = 0\n array.map { |num| sums += num }.reduce(:+)\nend", "title": "" }, { "docid": "88b70a35b7b7bde319eedfd4bec98f46", "score": "0.7954192", "text": "def sum_of_sums(array)\n current = 0\n sum = 0\n\n array.each do |num|\n current += num\n sum += current\n end\n\n sum\nend", "title": "" }, { "docid": "ad7bc87cca6821db54135dba69509231", "score": "0.7939208", "text": "def sum_of_sums(arr)\n result = 0\n arr.size.times do\n result += arr.reduce(:+)\n arr.pop\n end\n result\nend", "title": "" }, { "docid": "4359b8040106120422fab150304ab187", "score": "0.7938659", "text": "def sum_of_sums(numbers)\n sum_total = 0\n counter = 1\n return numbers[0] if numbers.size == 1\n loop do \n sum_total += numbers.slice(0, counter).reduce(:+)\n counter += 1\n break if counter > numbers.size \n end\n p sum_total\nend", "title": "" }, { "docid": "f18e949cd68d69310e5b8c475704a32b", "score": "0.79290724", "text": "def sum_of_sums(arr)\n sums = []\n (0..arr.size-1).each { |i| sums << arr[0..i].inject(:+) }\n sums.inject(:+)\nend", "title": "" }, { "docid": "f99fa7cdb56268803620993273dc6f8e", "score": "0.792558", "text": "def sum_of_sums arr\n result = 0\n arr.each_index { |index| result += arr[0..index].reduce(:+) }\n result\nend", "title": "" }, { "docid": "545275ba6433e2085402d1d358adbbe3", "score": "0.7924963", "text": "def sum_of_sums(array)\n sum = 0\n total = 0\n\n array.each do |num|\n sum += num\n total += sum\n end\n total\nend", "title": "" }, { "docid": "a3ed2cf0caaef59cb8ca62b5d4600a05", "score": "0.7917661", "text": "def sum_of_sums(array)\n array_builder = []\n current_numbers = 0\n\n array.each do |integer|\n current_numbers += integer\n array_builder << current_numbers\n end\n array_builder.sum\nend", "title": "" }, { "docid": "a1e21221db94089fd22552a0c2fc5a3e", "score": "0.790656", "text": "def sum_of_sums(array)\n sum = 0\n 0.upto(array.length) do |length|\n sum += array[0,length].sum\n end\n sum\nend", "title": "" }, { "docid": "fb0b2e7f0c8f8fa65e1bcf274632fd6a", "score": "0.7898622", "text": "def sum_of_sums(array)\n sum = 0\n array.each_with_index do |elem,index|\n sum += array[0..index].inject(:+)\n end\n sum\nend", "title": "" }, { "docid": "d055a2730821e9aff44d2316dc376621", "score": "0.7891146", "text": "def parts_sums(array)\n sub_parts = []\n 0.upto(array.size-1) do |start_index|\n sub_parts << array[start_index..-1]\n end\n sub_parts.map{|subarray| subarray.sum} << 0\nend", "title": "" }, { "docid": "4a6b65cafe0ce179bc86593724f4a091", "score": "0.7885562", "text": "def sum_of_sums(array)\n array.map.with_index { |_, index| array.take(index + 1).inject(:+) }.inject(:+)\nend", "title": "" }, { "docid": "b9976d424cde97805d7c7f6c7f143191", "score": "0.78677183", "text": "def sum_of_sums(arr)\n total = 0\n subtract = 1\n arr.each do |num|\n total += arr[0..(arr.size - subtract)].sum\n subtract += 1\n end\n total\nend", "title": "" }, { "docid": "b4a26d8db4c72aecfb2073ea018f9109", "score": "0.7843381", "text": "def sum_of_sums(array)\n result = 0\n array.each_index { |i| result += array[0..i].sum }\n result\nend", "title": "" }, { "docid": "100289d400a52ba794661cbbc1471677", "score": "0.7831303", "text": "def sum_upon_sums(array)\n sum = (1..array.length).to_a.inject(:+)\n array.each { |el| sum -= el }\n sum\nend", "title": "" }, { "docid": "c0c14f20437dad6cc56b75ee0e205ee2", "score": "0.7820468", "text": "def sum_of_sums(arr)\n arr.map.with_index { |_, i| arr[0..i].reduce(:+) }.reduce(:+)\nend", "title": "" }, { "docid": "86140e3aad012e74bcd2b86299807f60", "score": "0.7818488", "text": "def sum_of_sums(array)\n index = 0\n count = 1\n total_sum = 0\n \n until count == array.size + 1\n total_sum += array.slice(index, count).sum\n count += 1\n end\n total_sum\nend", "title": "" }, { "docid": "d4ddc667250c061f8928908c304d5e62", "score": "0.7818154", "text": "def sum_upon_sums(array)\n array_sum = array.inject(:+)\n total = (0..n).to_a.inject(:+)\n total - array_sum\nend", "title": "" }, { "docid": "87374e3dde8267f7081b43482cbb0111", "score": "0.7810489", "text": "def sum_add_arrays(numbers)\n total =0\n for sum in numbers\n\n total += sum\n end\n return total\n\n end", "title": "" }, { "docid": "492ff05cfeaa4e8838fdb127ea1997f6", "score": "0.78040296", "text": "def sum_of_sums(nums)\n nums.map.with_index { |_, idx| nums[0..idx].reduce(:+) }.reduce(:+)\nend", "title": "" }, { "docid": "a9cf30344f706f38ab11cfc01b440e8c", "score": "0.77749896", "text": "def sum_of_sums(array_of_int)\n result = 0\n final_index = 0\n loop do\n result += array_of_int[0..final_index].sum\n final_index += 1\n break if final_index == array_of_int.size\n end\n \n result\nend", "title": "" }, { "docid": "6281644407eb3d8b56aca12e117d11d5", "score": "0.7765884", "text": "def sum_of_sums(numbers)\n total = 0\n numbers.each_with_index{ |num,i| total += num * (numbers.size - i)}\n total\nend", "title": "" }, { "docid": "622419a1afc1530d8dda5af8e2435677", "score": "0.7760181", "text": "def sum(array_of_numbers)\n return array_of_numbers.reduce(:+)\n end", "title": "" }, { "docid": "f16a74ce0ad0302b7bcee3678578a1ae", "score": "0.775942", "text": "def sum_of_sums(ary)\n final_sum = 0\n current_sum = 0\n \n ary.each do |n|\n current_sum += n\n final_sum += current_sum\n end\n final_sum\nend", "title": "" }, { "docid": "b426f97f5bdf6bb23a0a93401480dc69", "score": "0.77567375", "text": "def sum_of_sums(array)\n sum = 0\n array.each_with_index do |num, index|\n sum += array[0..index].sum\n end\n sum\nend", "title": "" }, { "docid": "d1da82915aec428f587edf4e8e16a9f1", "score": "0.7747231", "text": "def sum_of_sums(array)\n sum = 0\n sum_arr = array.map do |n|\n sum += n\n end \n sum_arr.inject(:+)\nend", "title": "" }, { "docid": "e15d4064e50fad2c37fcb678a1a00503", "score": "0.7736529", "text": "def sum_of_sums(array)\n sum_array = []\n sum = 0\n\n array.each do |integer|\n sum_array << integer\n sum += sum_array.sum\n end\n \n sum\nend", "title": "" }, { "docid": "2be9d6dac18786dcccaaed874cba0e13", "score": "0.7714905", "text": "def sum_of_sums(arr)\n total = 0\n sum = []\n arr.each do |element|\n sum << total += element\n end\n sum.reduce(:+)\nend", "title": "" }, { "docid": "16294a0f07e6415b2ecf8f878a868c44", "score": "0.7701079", "text": "def array_summer(array_to_sum)\n sum = 0\n length = array_to_sum.length\n for i in 0...length\n sum += array_to_sum[i]\n end\n sum\nend", "title": "" }, { "docid": "34b372c9bb6c60ce8348108dc7bbe764", "score": "0.7695438", "text": "def array_sum(numbers)\n\n\t# the result of the array sum\n\tresult = 0\n\n\t# add the array\n\tnumbers.each do |number|\n\t\tresult += number.to_i\n\t\t#puts result\n\tend \n\n\t# return the result \n\treturn result\nend", "title": "" }, { "docid": "9c60184e61cd77918eef0320312e190b", "score": "0.76939833", "text": "def sum_of_sums(arr)\n sums = []\n total = 0\n\n arr.each do |num|\n total += num\n sums << total\n end\n\n sums.sum\nend", "title": "" }, { "docid": "83cbad9a4efa46c30aef8d2f794becd1", "score": "0.7687", "text": "def sums2(array)\n total = 0\n accumu = 0 \n \n array.each do |num|\n accumu += num\n total += accumu \n end \n \n total \nend", "title": "" }, { "docid": "ebed9bed50fc0efe865b67bf1ba3b546", "score": "0.7672207", "text": "def sum_of_sums(arr)\n arr.each_index.inject(0) { |sum, idx, a| sum += arr[0..idx].sum }\nend", "title": "" }, { "docid": "df618c9e178202571bd38676ef522661", "score": "0.7671731", "text": "def sum_array(numbers)\n numbers.inject(:+)\nend", "title": "" }, { "docid": "f186304f4024965a70f9237178670292", "score": "0.7657409", "text": "def sum_of_sums(array)\n\tindex = 0\n\ttotal_sum = 0\n\tloop do \n\t\ttotal_sum = array[index] + \n\t\tindex += 1\n\t\tbreak if index == array.size\n\tend\n\ttotal_sum\nend", "title": "" }, { "docid": "bff7c8768669d2805915566b5db1502d", "score": "0.76537097", "text": "def sum_of_sums(arr)\n sum = 0\n size = arr.size\n arr.each_with_index do |int, idx|\n sum += int * (arr.size - idx)\n end\n sum\nend", "title": "" }, { "docid": "b259b948dfa097ba4492e566d7875e22", "score": "0.7646371", "text": "def total(array_numbers)\n\tsum = 0\n\tarray_numbers.each {|number| sum= sum + number}\n\treturn sum\nend", "title": "" }, { "docid": "254344766f4f33143ef634b2f209a131", "score": "0.7638963", "text": "def sum_of_sums(arr)\n sums = arr.map.with_index do |_, index|\n arr[0..index].reduce(:+)\n end\n sums.reduce(:+)\nend", "title": "" }, { "docid": "0745c9c492e0ec397abf01b80f04d246", "score": "0.7620043", "text": "def sum_of_sums(int_arr)\n total = 0\n number_times = 1\n int_arr.each do |num|\n total += int_arr[0, number_times].sum\n number_times += 1\n end\n total\nend", "title": "" }, { "docid": "31d09a265d2ca035538e4813447da7e1", "score": "0.7614419", "text": "def sum_of_sums(arr)\n accumulator = 0\n total = 0\n\n arr.each do |num|\n accumulator += num\n total += accumulator\n end\n\n total\nend", "title": "" }, { "docid": "8a498f5cbe2bf2a99c8700b279454491", "score": "0.76010203", "text": "def sum_of_sums(numbers)\n sum = 0\n size = numbers.size\n counter = 0\n\n while counter < size\n inner_counter = 0\n while inner_counter <= counter\n sum += numbers[inner_counter]\n\n inner_counter += 1\n end\n\n counter += 1\n end\n\n sum\nend", "title": "" }, { "docid": "ee383c37fc3c6a182e1c92013b5e20ad", "score": "0.76009923", "text": "def sub_sums(array)\n\n subs_arrays = []\n\n array.each_index do |index|\n i = index\n while i < array.length\n subs_arrays << array[index..i]\n i += 1\n end\n end\n\n max_sub = subs_arrays.max_by {|sub_array| sub_array.inject(:+)}\n\n max_sub.inject(:+)\n\nend", "title": "" }, { "docid": "c4ca856fb1ab99618d51ca92eaa372d6", "score": "0.75980943", "text": "def sum_of_sums2(arr)\n new_arr = []\n arr.each_with_index{|_, i| new_arr << arr[0..i]}\n new_arr.flatten.sum\nend", "title": "" }, { "docid": "1cad4faa6966d0d193e7acd273ce4815", "score": "0.75946516", "text": "def sum_of_sums(arr)\n collection = []\n arr.map do |element|\n collection << element\n collection.reduce(&:+)\n end\n .reduce(&:+)\nend", "title": "" }, { "docid": "5f83f85b9838d1cb138660e8a8c587e1", "score": "0.7594135", "text": "def sum_arrays(array)\n sum =0\n array.each do |num|\n sum += num\n end\nsum\nend", "title": "" }, { "docid": "b06c2c1cd7a8fac238735930ed2b4a82", "score": "0.7592516", "text": "def sum_of_sums(arr)\n (0...arr.size).map do |index_limit|\n arr[0..index_limit].reduce(:+)\n end.reduce(:+)\nend", "title": "" }, { "docid": "ec9155cd5e0d861eb996927c9078a4d6", "score": "0.75815177", "text": "def total(array_of_numbers)\n\tsum = 0\n\n\tarray_of_numbers.each do |num|\n\t\tsum += num\n\tend\n\treturn sum\nend", "title": "" }, { "docid": "5f66aa71c9eee2e0e548688499bc4216", "score": "0.75770456", "text": "def sum_of_sums(array)\n counter = 1\n sum = 0\n \n until counter > array.count\n array.slice(0, counter).each do |num|\n sum += num\n end\n counter += 1\n end\n \n p sum\nend", "title": "" }, { "docid": "11a9f6ba01ee392a7fbcef589e61ab2b", "score": "0.7575226", "text": "def sum_of_sums(arr)\n total = 0\n sum = 0\n arr.size.times do |ind|\n sum += arr[ind]\n total += sum\n end\n total\nend", "title": "" }, { "docid": "0ee5002209812adba0de7829aa752944", "score": "0.75709575", "text": "def sum_array(array)\n total = 0\n array.each do |num|\n total += num\n end\n return total\n end", "title": "" }, { "docid": "1a578b09064c6d9ddd54cdaefe3b6adc", "score": "0.75653464", "text": "def sum_array(array_of_numbers)\n array_of_numbers.inject(0){|sum,x| sum + x }\nend", "title": "" }, { "docid": "007f621171bba1c96283f337e048d3e9", "score": "0.756367", "text": "def sum_of_sums(ary)\n curr_sum = 0\n sum = 0\n ary.each do |num|\n curr_sum += num\n sum += curr_sum\n end\n\n sum\nend", "title": "" }, { "docid": "09ed5092ffd96f3dae986d34a36509e0", "score": "0.7563449", "text": "def sum_of_sums(arr)\n running_total = 0\n total = 0\n arr.map do |number|\n running_total += number\n total += running_total\n end\n total\nend", "title": "" }, { "docid": "b8947b4adb2414b67feb1644a2aa44b7", "score": "0.7548252", "text": "def sum_of_sums(arr)\n sums = []\n\n sums << arr.inject(0) do |total, num|\n sums << total\n total + num\n end\n\n sums.sum\nend", "title": "" }, { "docid": "cae5d63659579cc70c9f7ec807034dd3", "score": "0.75083196", "text": "def sum(array)\n\ttotal = 0\n\n\tarray.count.times do |nb|\n\t\ttotal += array[nb]\t\n\tend\n\treturn total\nend", "title": "" }, { "docid": "98b22f9ba618f9018e09ff4e33af46ba", "score": "0.7495842", "text": "def sum_elements array_of_numbers\n array_of_numbers.reduce(:+)\nend", "title": "" }, { "docid": "d739a3b1cf5ec14d5a25eb6b946ef5ef", "score": "0.74918073", "text": "def sum_array(array)\n array.inject { |sum, n| sum + n }\n end", "title": "" }, { "docid": "7ba57ef3d9331d79c5e55ccd5b4d65f2", "score": "0.74900115", "text": "def sum_array(numbers)\n total = 0\n for number in numbers\n total += number\n end\n return total\n\nend", "title": "" }, { "docid": "4ca7ef452851b1b018bb87f88cdbb04c", "score": "0.7489246", "text": "def sum_upon_sums(array)\n n = array.size\n total = (n * (n + 1)) / 2\n array.each do |el|\n total -= el\n end\n total\nend", "title": "" }, { "docid": "97e724403c249f76fc13ccef9b7a4ca1", "score": "0.7486994", "text": "def sum_of_sums(arr)\n sum = 0\n total = 0\n totals_arr = []\n arr.each do |num|\n total += num\n totals_arr.push(total)\n end\n totals_arr.each { |num| sum += num }\n sum\nend", "title": "" }, { "docid": "8a4fdee1135e207a4b87f9bb9a31bae3", "score": "0.748532", "text": "def sum_of_sums(array)\n sum = 0\n sum_group = []\n array.each do |num|\n sum_group << num \n sum += sum_group.inject(0){|total, n| total + n}\n # can also do this\n # sum += (sum_group << num).inject(0){|total, n| total + n}\n end\n sum\nend", "title": "" }, { "docid": "501c2f3ffe1619999053a7761ba53b28", "score": "0.74747115", "text": "def sum_of_sums(array)\n new_array = []\n sum = 0\n array.map do |element|\n new_array << sum += element\n end\n new_array.sum\nend", "title": "" }, { "docid": "5fa713bb0d2e184466a6d2f44d7cdf56", "score": "0.7473794", "text": "def running_total(array_of_integers)\n \n result_array = []\n \n array_of_integers.each_with_index do |number, index|\n result_array << array_of_integers[0..index].sum\n end\n \n result_array\nend", "title": "" }, { "docid": "f2baa6ee0dd9a322d18e85b7b0f67e24", "score": "0.74708587", "text": "def sum_array(array)\n array.inject{|sum,x| sum+x}\n # http://stackoverflow.com/questions/1538789/how-to-sum-array-of-numbers-in-ruby\nend", "title": "" }, { "docid": "28f1fe1011082d651396dcb56629e3c2", "score": "0.7470026", "text": "def sum(seq)\n seq.each do |seq| # loop through everything in seq\n $sum+=seq #Add each number to sum\n end\n end", "title": "" }, { "docid": "7f09f0aa2a7b0babd9610e5947c2a3c9", "score": "0.7463596", "text": "def sum_array(sum)\n sum.inject(0) do |sum, value|\n sum += value\n end\nend", "title": "" }, { "docid": "48cdd785c12ea919f2d9838b422d3c52", "score": "0.7462409", "text": "def sum(array)\n\ttotal = 0\n\tarray.each { |x|\n\t\ttotal += x\n\t}\n\treturn total\nend", "title": "" }, { "docid": "b679722d6e7e30fd16366484cf460003", "score": "0.7461813", "text": "def sum_of_sums(arr)\n sum_arr = []\n result = 0\n arr.each do |int|\n sum_arr << int\n result += sum_arr.sum\n end\n result\nend", "title": "" }, { "docid": "01127bb1a78e4fc42a9fd63a57ba65a6", "score": "0.74613494", "text": "def sum_array(array)\n array.inject(0) { |sum, n| sum + n}\nend", "title": "" }, { "docid": "8fd983e297441d8b0b11b0a8749b2b3f", "score": "0.7457687", "text": "def sum_array(integers)\n integers.inject { |sum, n| sum + n }\nend", "title": "" }, { "docid": "375b06d73eda4b226f95896883d80690", "score": "0.74509686", "text": "def sum_of_sums(arr)\n sum = 0\n size = arr.size\n loop do\n sum += arr.take(size).sum\n size -= 1\n break if size < 0\n end\n sum\nend", "title": "" }, { "docid": "76adc355a5a22220bd7c5cd653082a95", "score": "0.74503726", "text": "def sum(array)\n\ts=0\n\tif array.length > 0\n\t\tarray.each do |d|\n\t\t\ts+=d\n\t\tend\n\t\treturn s\n else return 0\n\tend\nend", "title": "" }, { "docid": "eda12ad556ced6073353ed37fa4e9d2b", "score": "0.74436355", "text": "def sum_array\n total = 0\n#total starts from 0\n for number in @numbers\n#first number in an array @numbers would add to the total\n total += number\n#total = total + 0\n end\n return total\n#total is 1 when it goes in a loop for the first time\n end", "title": "" }, { "docid": "6c394c940b9a112de4abe9a15a719147", "score": "0.7443097", "text": "def sum(array)\n array.reduce(0) { |sum, number| sum + number }\nend", "title": "" }, { "docid": "65e4a7a057586eb755afc4cdd6d36797", "score": "0.7442142", "text": "def find_sum nums\n sum = 0\n (0...nums.length).each do |i|\n sum += nums[i]\n end\n return sum\nend", "title": "" }, { "docid": "65e4a7a057586eb755afc4cdd6d36797", "score": "0.7442142", "text": "def find_sum nums\n sum = 0\n (0...nums.length).each do |i|\n sum += nums[i]\n end\n return sum\nend", "title": "" }, { "docid": "55704aceca6eddc749b97fcea84d6ff9", "score": "0.743079", "text": "def sum(*numbers)\n numbers.inject 0 do |result, n|\n result + n\n end\n end", "title": "" }, { "docid": "f19e43b3dca6c41f22414efcb49f76e8", "score": "0.7428642", "text": "def sum\n @numbers.flatten.compact.reduce(0) { |pre, cur| pre + cur }\n end", "title": "" }, { "docid": "011ab40e6d6e4c4e722aae15c40f227e", "score": "0.7419768", "text": "def total (array)\n sum = 0\n array.each do |num|\n sum += num\n end\n return sum\n end", "title": "" } ]
db29c607d06a11c2c704336bfed4018c
Returns a Note object from the notes hash
[ { "docid": "5c69219cc40fb10e875b1c16f163283a", "score": "0.56674", "text": "def notes(options = {})\n options = {\n id: nil,\n type: nil\n }.update(options)\n notes_found = Hash.new do |h, k|\n h[k] = {}\n end\n _notes.filter(options[:id]).each do |id, hash|\n hash.filter(options[:type]).each do |type, note|\n notes_found[id][type] = note\n end\n end\n if notes_found.empty?\n nil\n elsif notes_found.size == 1\n notes_found.values.first.values.first\n else\n notes_found\n end\n end", "title": "" } ]
[ { "docid": "8efd87a634fc274eb169544262a7bb85", "score": "0.652366", "text": "def notes_get(id)\n options = create_params({})\n note = self.class.get(\"/notes/#{id}\", options)['note']\n\n return nil unless note\n\n # Complete hack, because the API is still broken\n content = '__content__'\n Note.new({\n id: note['id'],\n # Remove whitespace around the title,\n # because of missing xml tag around\n title: note[content].gsub(/\\n| +/, ''),\n length: note['length'][content].to_i,\n text: note['text'][content]\n })\n end", "title": "" }, { "docid": "a662329b57a0eb638f552c35355d3d00", "score": "0.6495577", "text": "def notes_hash\n latest_snapshot = self.snapshots.last\n notes_hash = Hash.new\n latest_snapshot.snapshot_alphas.collect { |d| notes_hash.store(d.alpha_id, d.notes) } if latest_snapshot.present?\n notes_ids_hash\n end", "title": "" }, { "docid": "42817e49a45e3ec5bbaec7f68f51bda6", "score": "0.6290571", "text": "def note()\n sql = \"SELECT * FROM notes\n WHERE id = $1\"\n values = [@note_id]\n results = SqlRunner.run(sql, values)\n return Note.new(results.first)\n end", "title": "" }, { "docid": "d60f5188421bccccd1e0f0a04efaa67d", "score": "0.62358457", "text": "def notes_raw\n data[:notes]\n end", "title": "" }, { "docid": "d60f5188421bccccd1e0f0a04efaa67d", "score": "0.62358457", "text": "def notes_raw\n data[:notes]\n end", "title": "" }, { "docid": "b82b25fbb12b8d149f42d49e87fb8396", "score": "0.6234777", "text": "def _notes\n @_notes ||= Hash.new do |h, k|\n h[k] = {}\n end\n end", "title": "" }, { "docid": "f45c33c08d173c6cce2e611791e91fe9", "score": "0.619472", "text": "def _notes\n @_notes ||= Hash.new do |h, k|\n h[k] = {}\n end\n end", "title": "" }, { "docid": "e330d89ca3b102e111b970e7e22edeb3", "score": "0.6145132", "text": "def notes_list\n options = create_params({})\n notes = self.class.get('/notes/list', options)['notes']['note']\n notes = [] if notes.nil?\n notes = [*notes]\n notes.map { |p| Note.new(Util.symbolize_keys(p)) }\n end", "title": "" }, { "docid": "a9f1a62895e052a1f8c8d657b14083dd", "score": "0.6018242", "text": "def note\n descMetadata.note.present? ? descMetadata.note.zip(descMetadata.note.type).map{|a|{note: a[0],type: a[1]}} : []\n end", "title": "" }, { "docid": "c12011ce2abfa46fd78271f009022bf5", "score": "0.59749883", "text": "def notes_attributes=(notes_hashes)\n notes_hashes.values.each do |note_attributes|\n # DO NOT CREATE A NOTE IF IT DOESN'T HAVE CONTENT\n if note_attributes[:content].present?\n note = Note.find_or_create_by(content: note_attributes[:content])\n # DON'T ADD A NOTE TO A SONG IF IT ALREADY HAS IT\n if !self.notes.include?(note)\n self.notes << note\n end\n end\n end\n end", "title": "" }, { "docid": "f37fba3988eeaeaea6f938125b23ff2d", "score": "0.593912", "text": "def note_hash(chan, note)\n return (chan << 8) + note\n end", "title": "" }, { "docid": "70c6202dfa50a1a4cabea0b67bb7dc59", "score": "0.5936702", "text": "def note\n if params[:id]\n Note.find_by_id params[:id]\n else\n Note.new\n end\n end", "title": "" }, { "docid": "eb8c1090ded94cbc00f251b3e2dd4961", "score": "0.59220123", "text": "def parse(json)\n notes = super(json)\n return [] if notes.nil?\n notes.collect do |raw_note|\n note = Note.new\n note.id = raw_note[\"id\"]\n note.name = raw_note[\"name\"]\n note.body = raw_note[\"body\"]\n note.body_show = raw_note[\"body_show\"]\n note.date = raw_note[\"date\"]\n note.project = Nozbe::Project.new\n note.project.id = raw_note[\"project_id\"]\n note.project.name = raw_note[\"project_name\"]\n note.context = Nozbe::Context.new\n note.context.id = raw_note[\"context_id\"]\n note.context.name = raw_note[\"context_name\"]\n note.context.icon = raw_note[\"context_icon\"]\n note\n end\n end", "title": "" }, { "docid": "1a31c7233832002d8bff608a31e13556", "score": "0.59051144", "text": "def notes()\n sql = \"SELECT * from notes WHERE bake_id = $1\"\n values = [@id]\n results = SqlRunner.run(sql,values)\n notes = results.map{|note| Note.new(note)}\n return notes\n end", "title": "" }, { "docid": "f22796a2375ff78f0fc66d2293d1ead4", "score": "0.5902655", "text": "def notes\n @attributes[:notes]\n end", "title": "" }, { "docid": "f22796a2375ff78f0fc66d2293d1ead4", "score": "0.5902655", "text": "def notes\n @attributes[:notes]\n end", "title": "" }, { "docid": "0a786762a603b547ce0eb25eca810ef5", "score": "0.58977914", "text": "def note\n @attributes[:note]\n end", "title": "" }, { "docid": "0a786762a603b547ce0eb25eca810ef5", "score": "0.58977914", "text": "def note\n @attributes[:note]\n end", "title": "" }, { "docid": "50eec303487bed29dd1797b305348999", "score": "0.58489877", "text": "def note\n if (self.attributes.include?('note'))\n self.attributes['note']\n else\n nil\n end\n end", "title": "" }, { "docid": "e8f56f5d9f9c8ada3f93079c4b119423", "score": "0.5836235", "text": "def list\n response = client.get(\"/notes/list\")\n response.fetch(\"notes\", EMPTY_ARRAY).map do |note_hash|\n NoteSummary.from_hash(note_hash)\n end\n end", "title": "" }, { "docid": "d567a16204c1897724272ab268351c2b", "score": "0.57990366", "text": "def to_a\n notes.map{ |n| n.to_h }\n end", "title": "" }, { "docid": "39add53f34512b019b1bf49ced70a053", "score": "0.5795236", "text": "def initialize(z_pk, znote, ztitle, zdata, creation_time, modify_time, account, folder, notestore)\n super()\n # Initialize some other variables while we're here\n @plaintext = nil\n @decompressed_data = nil\n @encrypted_data = nil\n @note_proto = nil\n @crypto_iv = nil\n @crypto_tag = nil\n @crypto_key = nil\n @crypto_salt = nil\n @crypto_iterations = nil\n @crypto_password = nil\n @is_password_protected = false\n\n # This holds objects directly in the note itself\n @embedded_objects = Array.new()\n # This holds objets embedded in other objects\n @embedded_objects_recursive = Array.new()\n\n # Feed in our arguments\n @primary_key = z_pk\n @note_id = znote\n @title = ztitle\n @compressed_data = zdata\n @creation_time = convert_core_time(creation_time)\n @modify_time = convert_core_time(modify_time)\n @account = account\n @folder = folder\n @notestore = notestore\n @database = @notestore.database\n @backup = @notestore.backup\n @logger = @backup.logger\n @uuid = \"\"\n\n # Handle pinning, added in iOS 11\n @is_pinned = false\n\n # Cache HTML once generated, useful for multiple outputs that all want the HTML\n @html = nil\n\n # Treat legacy stuff different\n if @notestore.version == AppleNoteStore::IOS_LEGACY_VERSION\n @plaintext = @compressed_data\n @compressed_data = nil\n else\n # Unpack what we can\n @is_compressed = is_gzip(zdata) \n decompress_data if @is_compressed\n extract_plaintext if @decompressed_data\n replace_embedded_objects if @plaintext\n end\n end", "title": "" }, { "docid": "d1a69613cc2091ebf82eb29e69783113", "score": "0.578185", "text": "def footnote(search)\n # Create new hash object to hold data\n word_object = Hash.new\n definition_data = Hash.new\n\n # set meta data\n word_object[\"word\"] = search\n word_object[\"speech\"] = \"[ note ]\"\n word_object[\"data\"] = []\n definition_data['definition'] = \"Enter footnote information...\"\n word_object[\"data\"][0] = definition_data\n\n return word_object.to_json\n end", "title": "" }, { "docid": "087ae0244972391ee162117afe3cfda0", "score": "0.57740676", "text": "def get_notes\n Resources::Note.parse(request(:get, \"Notes\"))\n end", "title": "" }, { "docid": "b6eedf65f624f2a6a0d42ca5ee403ba2", "score": "0.57683134", "text": "def note\n response[\"note\"]\n end", "title": "" }, { "docid": "253e8fd1324649ef157cc2efe25b1b11", "score": "0.5758736", "text": "def song_notes_1=(note)\n self.notes.first = Note.find_or_create_by(content: note)\n end", "title": "" }, { "docid": "049a704ff1fd70347b4bf2775349b7d2", "score": "0.5738715", "text": "def note_hash(chan, note)\n\treturn (chan << 8) + note\n end", "title": "" }, { "docid": "fad53981591d5e3dcdffa770525006b1", "score": "0.5725622", "text": "def load_notes(ids)\n if ids.empty?\n []\n else\n $redis.mget(*ids.map { |id| \"note-#{id}\" }).map { |raw| Marshal.load(raw) }\n end\nend", "title": "" }, { "docid": "c0d6293c95015cde9bf8e2953af73fd7", "score": "0.5717226", "text": "def notes(options = {})\n options = {\n id: nil,\n type: nil\n }.update(options)\n notes_found = Hash.new do |h, k|\n h[k] = {}\n end\n _notes.filter(options[:id]).each do |id, hash|\n hash.filter(options[:type]).each do |type, note|\n notes_found[id][type] = note\n end\n end\n if notes_found.empty?\n nil\n elsif notes_found.size == 1\n notes_found.values.first.values.first\n else\n notes_found\n end\n end", "title": "" }, { "docid": "f19efcada8120b00bf0fb31838c2b6de", "score": "0.570983", "text": "def notes( params={} )\n notes = get_connections(\"notes\", params)\n return map_connections notes, :to => Facebook::Graph::Note\n end", "title": "" }, { "docid": "f19efcada8120b00bf0fb31838c2b6de", "score": "0.570983", "text": "def notes( params={} )\n notes = get_connections(\"notes\", params)\n return map_connections notes, :to => Facebook::Graph::Note\n end", "title": "" }, { "docid": "05c67d744267d37841da052ce0e1d777", "score": "0.56899977", "text": "def find!(id)\n res = get \"/notes/#{id}\"\n send(:build_from_hash,res.parsed_response['notes'].first ) if send(:ok?,res)\n end", "title": "" }, { "docid": "8fcada1b8745900ca642395ff3cf47ab", "score": "0.5667148", "text": "def note\n\t\t@user = load_user\n\t\t@notes = Note.all\n\t\t@note = Note.new\n\tend", "title": "" }, { "docid": "394c940de79587d22a6fe5c9f79957fa", "score": "0.5659601", "text": "def generic_hashes_for_notes(note_title, parsed_rows)\n parsed_rows.map do |row|\n text_from_fields = generic_text_from_fields(row[:source_json])\n text = \"#{note_title}\\n\\n#{text_from_fields}\"\n {\n student_id: row[:student_id],\n educator_id: row[:educator_id],\n recorded_at: row[:source_timestamp],\n is_restricted: false,\n event_note_type_id: 304,\n text: text\n }\n end\n end", "title": "" }, { "docid": "1f22b75d3c3becdf8cfc7868ed2f2966", "score": "0.56374794", "text": "def base_note\n {\n :text_value => note_string.text_value,\n :key => key,\n :pitch => pitch,\n :accidental => accidental,\n :octave => octave,\n :attack => attack,\n :decay => decay,\n :duration => duration\n }\n end", "title": "" }, { "docid": "391e924d37c85b3667ca384f7951d60f", "score": "0.55901814", "text": "def initialize(z_pk, znote, ztitle, zdata, creation_time, modify_time, account, folder, notestore)\n # Initialize some other variables while we're here\n @plaintext = nil\n @decompressed_data = nil\n @encrypted_data = nil\n @crypto_iv = nil\n @crypto_tag = nil\n @crypto_key = nil\n @crypto_salt = nil\n @crypto_iterations = nil\n @crypto_password = nil\n @is_password_protected = false\n @embedded_objects = Array.new()\n\n # Feed in our arguments\n @primary_key = z_pk\n @note_id = znote\n @title = ztitle\n @compressed_data = zdata\n @creation_time = convert_core_time(creation_time)\n @modify_time = convert_core_time(modify_time)\n @account = account\n @folder = folder\n @notestore = notestore\n @database = @notestore.database\n @backup = @notestore.backup\n\n # Treat legacy stuff different\n if @notestore.version == AppleNoteStore::IOS_LEGACY_VERSION\n @plaintext = @compressed_data\n @compressed_data = nil\n else\n # Unpack what we can\n @is_compressed = is_gzip(zdata) \n decompress_data if @is_compressed\n extract_plaintext if @decompressed_data\n replace_embedded_objects if @plaintext\n end\n end", "title": "" }, { "docid": "6eaf8be02c5ab25bd284f6e9c3cec7a2", "score": "0.55769557", "text": "def klone\n Kopy.new(self.attributes.slice(:title, :body, :tags).merge({ :knote => self }))\n end", "title": "" }, { "docid": "03950310fb4bdfca7b59d1ae9599f1fa", "score": "0.5537892", "text": "def get\n print \"Type the Note ID:\"\n note_id = gets.chomp\n puts \"Getting note contents...\"\n if note_list[note_id]\n note_list[note_id].each do |key, value|\n return value if key == \"note\"\n end\n else\n return \"This Note does not exist!\"\n end\n options\n end", "title": "" }, { "docid": "42c860ee10ce74997a51d118fb57c7a5", "score": "0.5522892", "text": "def get_notes(user_key)\n Nozbe::Note.list_for_context(user_key, id).collect { |note|\n note.context = self\n note\n }\n end", "title": "" }, { "docid": "a7e2841c5fca45c404cc688d3b97044b", "score": "0.55213434", "text": "def cached_notes(user)\n Rails.cache.fetch([self, user, \"notes\"]) { notes.where(user: user).to_a }\n end", "title": "" }, { "docid": "68608b7c93c3f5e86331d30b7d41c231", "score": "0.5504091", "text": "def build_notification_hash\n note = {\n id: self.id.to_s,\n created_at: self.created_at,\n notice_type: self.notice_type,\n user: {\n first_name: self.notified_by.first_name,\n last_name: self.notified_by.last_name,\n avatar: self.notified_by.avatar.url || \"/assets/images/default-image.png\",\n user_name: self.notified_by.user_name,\n id: self.notified_by.id.to_s\n }\n }\n note[:identifier] = self.identifier if self.identifier\n if self.post\n post = self.post\n note[:post] = post.build_post_hash\n end\n return note\n end", "title": "" }, { "docid": "6151ebd7015251015d25398009035f83", "score": "0.55015695", "text": "def create_note(input)\n self.note = input\n end", "title": "" }, { "docid": "b7607f890c3bf74f687834122c8e4a23", "score": "0.54951686", "text": "def notes\n @notes ||= NotesService.new(@http_client)\n end", "title": "" }, { "docid": "cd1b8379df7a0412f0aa4015b9f9f267", "score": "0.5480737", "text": "def initialize(note)\n @note = note\n end", "title": "" }, { "docid": "99e6e08e152b0b4a4e002786333dfb38", "score": "0.5477985", "text": "def new\n @note = Note.new\n end", "title": "" }, { "docid": "c400ac91f84adb3446e8d63cbda808b1", "score": "0.54741395", "text": "def find_note\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "a042ff59795604858c4378fcb6fe966f", "score": "0.5459324", "text": "def note_contents\n self.notes.map(&:content)\n end", "title": "" }, { "docid": "8d13386629ae2564ae9064a5c917b1cd", "score": "0.5453935", "text": "def notes\n da = get_association :notes\n if da\n da.full_object[:notes]\n else\n associate :notes, ''\n ''\n end\n end", "title": "" }, { "docid": "b82ec6c7dd72674e24bf31d954ac9612", "score": "0.5451088", "text": "def notes(force_reload = false)\n unless force_reload\n return @note_list unless @note_list.nil? \n end\n return nil unless self.id\n \n @note_list = UserNoteList.new({:user_id => self.id})\n return @note_list\n end", "title": "" }, { "docid": "c6bd2f00bdd6fe1a06e2452ac8318ae2", "score": "0.5448355", "text": "def new_note\n if params.has_key? 'note_id' then\n @replay = true\n Note.find(params['note_id'])\n else\n Note.new({\n :body=>\"Click to enter a new note...\",\n :view=>action_name,\n # timestamp will be rendered by ActiveSupport::TimeWithZone.to_param\n :view_at=> @at,\n :user_id=>session[:user_id]\n })\n end\n end", "title": "" }, { "docid": "0b987659d30c32031cfc6e889157d870", "score": "0.5437397", "text": "def note\n map_to_bibtex_value('annote', 'note')\n end", "title": "" }, { "docid": "9c70914003e1ecd16992b157f3b7ae01", "score": "0.54200923", "text": "def note_contents\n self.notes.collect(&:content)\n end", "title": "" }, { "docid": "a3c932c255d7cf2712ad6f09295813f8", "score": "0.54129654", "text": "def note_contents=(notes)\n notes.each do |note_content|\n if note_content != \"\" && note_content != \" \"\n note = Note.create(content: note_content)\n self.notes << note\n end\n end\n end", "title": "" }, { "docid": "d1b407457747ddca718bdf570fbc5e61", "score": "0.5403741", "text": "def parse_note(xml, object_id)\n # Find the note node, then find the corresponding value to get the note\n # itself\n\n note = nil\n note_key_node = xml.xpath(\"//object[string = '#{object_id}.notes']/string[. = '#{object_id}.notes']\").first\n\n note_node = nil\n if note_key_node\n keys_array = note_key_node.parent\n values_array = keys_array.next_element\n\n if (key_index = keys_array.element_children.index(note_key_node))\n note_value_node = values_array.element_children[key_index]\n note_node = note_value_node.element_children.first.element_children.first\n end\n end\n\n # If the first method didn't work, try an alternative method that seems to\n # be used in some xibs\n if note_node.nil?\n note_value_node = xml.xpath(\"//dictionary[@key = 'flattenedProperties']/object[@key = '#{object_id}.notes']\").first\n note_node = note_value_node.element_children.first.element_children.first if note_value_node\n end\n\n if note_node\n case note_node.name\n when 'bytes'\n note = Base64.decode64(padded_base64(note_node.inner_text))\n note.force_encoding 'UTF-8'\n when 'characters'\n note = note_node.inner_text\n end\n end\n\n return note\n end", "title": "" }, { "docid": "6a9ecee0c9a322ad88b3ca0fd3fd8350", "score": "0.5403481", "text": "def note_contents\n contents = []\n self.notes.each do |note|\n contents << note.content\n end\n contents\n end", "title": "" }, { "docid": "bf2b7ce5c5ef64b20b4f345c64ac1486", "score": "0.53969", "text": "def new\n @note = Note.new \n end", "title": "" }, { "docid": "33d522a58d48098eeca0511e5f9377cf", "score": "0.538841", "text": "def show\n render inertia: 'Notes/Show', props: {\n note: @note.as_json(only: [:id, :title, :content])\n }\n end", "title": "" }, { "docid": "dc66bff37fb278a66ec0ca8392e356a6", "score": "0.5360697", "text": "def new\n @note = Note.new\n end", "title": "" }, { "docid": "60758a00d7a5882ed2f0239e347058f4", "score": "0.5357889", "text": "def notes\n return unless property.valid?\n bookmark = Bookmark.find_by(user_id: current_user.id,property_id: property.id)\n bookmark = Bookmark.create!(user_id: current_user.id,property_id: property.id,rating: 1) if bookmark.nil?\n bookmark.note = params[:note]\n bookmark.note_updated = Time.now\n bookmark.save!\n render json: {saved: true} \n end", "title": "" }, { "docid": "d51042ca3806b7b2a0e8654ef413bfc7", "score": "0.53557014", "text": "def notes(filters={})\n get_blocks(\"Note\", filters)\n end", "title": "" }, { "docid": "f66dcf8e5806b26eb3a0978f85d259cb", "score": "0.5355671", "text": "def note_contents\n \t# arr = []\n \t# Note.all.each do |n|\n \t# \tif n.song_id == self.id\n \t# \t\tarr << n.content \n \t# \tend\n \t# end\n \t# byebug\n \t# arr\n \tarr = []\n \tself.notes.each do |n|\n \t\tarr << n.content\n \tend\n \tarr\n end", "title": "" }, { "docid": "e5d6c54dc820dddca91f6d7b2b5265d0", "score": "0.5340873", "text": "def note_from_file\n @note_from_file ||= @file.read.gsub(\"\\n\", \" \").split(/\\s{2,}/)\n end", "title": "" }, { "docid": "6d6fc8f18e9d147a3297ceebed140208", "score": "0.53381205", "text": "def notes\n parse('coffee.notes')\n end", "title": "" }, { "docid": "51a00a2c480a8c2e9926d39de188088b", "score": "0.53335303", "text": "def note\n note = Note.find(params[:note_id])\n render json: note_to_json(note)\n end", "title": "" }, { "docid": "8ba48bfd40848baee416dd8b58e0379c", "score": "0.53221005", "text": "def show\n delete_note_refferer\n note_store_location\n notes_order = current_user.notes_order_inline\n @notes = @challenge.notes.order(\"id #{notes_order}\").paginate(:page => params[:page], :per_page => 5)\n @note = @challenge.notes.build\n end", "title": "" }, { "docid": "15ad70d54bbb0a2d775bc28b29fa647b", "score": "0.5303387", "text": "def notes()\n sql = \"SELECT notes.* FROM notes\n INNER JOIN todos ON\n todos.note_id = notes.id\n WHERE todos.day_id = $1;\"\n values = [@id]\n results = SqlRunner.run(sql, values)\n return results.map {|note| Note.new(note)}\n end", "title": "" }, { "docid": "c5bde34a1049ad017b8a2643daa08a86", "score": "0.52974373", "text": "def note_detail(id:, **args)\n params = parameters(args) do\n optional_params\n end\n request(:get, \"notes/#{id}\", params)\n end", "title": "" }, { "docid": "3af11c515303f099344c55d933cd1fd5", "score": "0.5289466", "text": "def create_note(note)\n post(\"/notes\", :query => note)\n end", "title": "" }, { "docid": "5ab67db8edee76ee7c638b0a1a5f7cd3", "score": "0.52777797", "text": "def show\n attrs = \"name, body, latitude, longitude, altitude, privacy_on, updated_at, user_id, id\"\n @note = Note.where(id: params[:id]).select(attrs).first\n end", "title": "" }, { "docid": "868246619433f304ac2bb5763a5f28c4", "score": "0.5275527", "text": "def note_contents=(contents)\n contents.each do |content|\n if content != \"\"\n note = Note.find_or_create_by(content: content)\n self.notes << note\n end\n end\n end", "title": "" }, { "docid": "cdc926c762e6db5a0a63f0843c745504", "score": "0.52688646", "text": "def test_serialize_to_json\n setup_notes\n\n @user.notes = [@note, @note2]\n @user.save\n\n assert_match /\\[.+\\]/, @user.read_attribute(:notes)\n\n assert_match /\\\"title\\\":\\\"First\\\"/, @user.read_attribute(:notes)\n assert_match /\\\"body\\\":\\\"Perfect body\\\"/, @user.read_attribute(:notes)\n assert_match /\\\"title\\\":\\\"Second\\\"/, @user.read_attribute(:notes)\n assert_match /\\\"body\\\":\\\"Score!\\\"/, @user.read_attribute(:notes)\n end", "title": "" }, { "docid": "47794e19a35354e3a37a94fd3d83b4c0", "score": "0.5267822", "text": "def notes\n YAML.load(git.capturing.notes({:ref => 'vendor'}, 'show', rev))\n end", "title": "" }, { "docid": "477fdeb0ec03c0cdfc88943ddca1966b", "score": "0.5266978", "text": "def get_note(identifier, opts = {})\n data, _status_code, _headers = get_note_with_http_info(identifier, opts)\n return data\n end", "title": "" }, { "docid": "fb8f2cf3ed4e2a6a3b6b58836f25d3b1", "score": "0.5261721", "text": "def set_note\n @note = Note.friendly.find(params[:id])\n end", "title": "" }, { "docid": "868363049f53e48a8664c3aa22eeda1c", "score": "0.5257642", "text": "def note_content(body)\n if body.is_a?(Hash)\n warn 'Passing the note body as a Hash is deprecated. You should just pass the String.'\n body\n else\n { body: body }\n end\n end", "title": "" }, { "docid": "2f9eeab585595191d4e616ce8ca244f7", "score": "0.5253009", "text": "def song_notes=(notes)\n notes.each do |note|\n self.notes.build(content: note)\n end\n end", "title": "" }, { "docid": "167a182cd3025c87c21eb185333a177a", "score": "0.5252635", "text": "def to_json_hash\n {\n :objectType => \"note\",\n :title => @title\n }.merge(super)\n end", "title": "" }, { "docid": "3357e9d6e315052641ab13354790a336", "score": "0.52406865", "text": "def set_note\n @note = Note.where(:id => params[:id], :user_id => current_user.id, :deleted => 0).first\n end", "title": "" }, { "docid": "add16809e3865f6fda0dab26ef64088e", "score": "0.523391", "text": "def notes\n content.notes\n end", "title": "" }, { "docid": "8cf2f494f38f3a9d655e5c69d218856e", "score": "0.52279824", "text": "def getNotes\r\n\t\t\t\t\treturn @notes\r\n\t\t\t\tend", "title": "" }, { "docid": "c785b86d9638a99aec68cce243b6d736", "score": "0.5222254", "text": "def set_history_note\n @history_note = HistoryNote.find(params[:id])\n end", "title": "" }, { "docid": "bfecbcfeb717bcf772d2f2b55d4c3ecb", "score": "0.5201073", "text": "def show\n @overview = @note.body.slice(0, 200)\n @title = @note.title\n if current_user\n @bookmark = Bookmark.new\n @bookmark.note_id = @note.id\n @bookmark.user_id = current_user.id\n end\n end", "title": "" }, { "docid": "8519140cea6d82fc6ae13132bbf09d61", "score": "0.52005744", "text": "def notes\n return @notes\n end", "title": "" }, { "docid": "8519140cea6d82fc6ae13132bbf09d61", "score": "0.52005744", "text": "def notes\n return @notes\n end", "title": "" }, { "docid": "8519140cea6d82fc6ae13132bbf09d61", "score": "0.52005744", "text": "def notes\n return @notes\n end", "title": "" }, { "docid": "8519140cea6d82fc6ae13132bbf09d61", "score": "0.52005744", "text": "def notes\n return @notes\n end", "title": "" }, { "docid": "b5beebbd9b61fce2802d3bf6bea97227", "score": "0.5199289", "text": "def note_contents=(notes)\n\n\n # if self.notes.empty?\n notes.each { |bit|\n # byebug\n if !bit.empty?\n self.notes << Note.find_or_create_by(content: bit)\n end\n }\n\n # else\n # self.notes.each { |note|\n # Note.find_or_create_by(content: note.content)\n # }\n # end\n # byebug\n end", "title": "" }, { "docid": "be6a0fea54412f3c9cb568dbc10b6a8d", "score": "0.5198847", "text": "def note_contents=(notes)\n notes.each do |content|\n self.notes.build(content: content) if !content.empty?\n end\n end", "title": "" }, { "docid": "e2e77e3d4692b97a7841734d5d35a0ec", "score": "0.51883507", "text": "def from_hash(hash); end", "title": "" }, { "docid": "e2e77e3d4692b97a7841734d5d35a0ec", "score": "0.51883507", "text": "def from_hash(hash); end", "title": "" }, { "docid": "e2e77e3d4692b97a7841734d5d35a0ec", "score": "0.51883507", "text": "def from_hash(hash); end", "title": "" }, { "docid": "86bc24f2bd8db0ee03f7a31fe50ae8ff", "score": "0.5177555", "text": "def set_herb_note\n @herb_note = HerbNote.find(params[:id])\n end", "title": "" }, { "docid": "81f2d48a9510f30cf799c8027a876804", "score": "0.517585", "text": "def test_note(type)\n notes = {\n first: [0, 0, 0, '5'],\n legato_slide: [0, 15, 0, '2'],\n shift_slide: [0, 15, 2, '2'],\n slide_in_from_below: [0, 15, 4, '2'],\n slide_in_from_above: [0, 15, 5, '2'],\n slide_out_and_downwards: [0, 15, 6, '2'],\n slide_out_and_upwards: [0, 15, 7, '2'],\n }\n note = notes.fetch(type)\n track_number = note[0]\n bar_number = note[1]\n beat_number = note[2]\n string_number = note[3]\n subject { song.tracks[track_number].bars[bar_number].get_beat(beat_number).strings[string_number] }\nend", "title": "" }, { "docid": "3ca655f6ac660a752d70b2064859f285", "score": "0.51727265", "text": "def note_params\n params.require(:note).permit(:note_title, :note_contents, :published, :lock_version)\n end", "title": "" }, { "docid": "6632652d02d14cc46810d63f1310d151", "score": "0.51671946", "text": "def show\n @note = Note.find(params[:id])\n end", "title": "" }, { "docid": "d523f5ef5aa20403b2bf9198ab92fe54", "score": "0.5167194", "text": "def create_note(title,contents)\n Resource.client.create_note(self, title, contents)\n end", "title": "" }, { "docid": "31c240b0e54e4923fe3aa31c99d015b5", "score": "0.51647496", "text": "def convert_notes(notes)\n return unless notes\n # First, parse the notes as XML and extract the contents of the <note> tag\n note_html = (Hpricot.XML(notes)/'/note').inner_html\n # Then parse the HTML\n html = Hpricot(note_html)\n # Then swap any <alias> tags with their unencoded content\n # TODO: this is a hack - it would be much better to understand the binary structure of the <alias> tag.\n while html.at('alias')\n html.at('alias').swap( aliastostring(html).gsub(/^.*\\000\\022\\000.(.*?)\\000.*$/m, 'file:///\\1') )\n end\n # Produce the HTML in \"plain text\" format, which shows the links in brackets\n result=html.to_plain_text\n # Eliminate double URIs of the form 'URI [URI]' (i.e. when the link text is the URI itself)\n result.gsub(/([\\w]+:.*)\\s+\\[\\1\\]/, '\\1')\n end", "title": "" }, { "docid": "121f95aee8f066e55d8b883a3699f4ca", "score": "0.5159751", "text": "def note\n return (not response.first.last.kind_of?(Hash) or response.first.last[\"create_hold\"].nil?) ? \"\" : \": #{response.first.last[\"create_hold\"][\"note\"][\"__content__\"]}\" if response.instance_of?(Hash)\n end", "title": "" }, { "docid": "d7d972375b0b0a65895fea4ea5021637", "score": "0.5149544", "text": "def fetch_notes(token, params)\n params.to_options!\n \n # Setup params.\n setup_params_logic = lambda do |last_request, params|\n # Do nothing.\n end\n \n # Parse the response.\n response_parse_logic = lambda do |response| \n content_keys = {}\n doc = Nokogiri::XML(response.body)\n \n doc.xpath(\"/notes/note\").each do |note|\n id = note.search('id').first.inner_html\n content_keys[id] = note.to_s\n end\n content_keys\n end\n \n url = get_api_url('notes')\n url = format_project_url(url, params[:project_id])\n url = format_story_url(url, params[:story_id])\n fetch(::PivotalTracker::Note, token, url, \n response_parse_logic, setup_params_logic, false)\n end", "title": "" }, { "docid": "bd7e4adc09af8bc7095ff9f35b727b49", "score": "0.51477236", "text": "def initialize(primary_key, uuid, uti, note)\n # Set this object's variables\n @primary_key = primary_key\n @uuid = uuid\n @type = uti\n @conforms_to = uti\n @note = note\n @is_password_protected = @note.is_password_protected\n @backup = @note.backup\n @database = @note.database\n @logger = @backup.logger\n @filepath = \"\"\n @filename = \"\"\n @backup_location = nil\n\n # Zero out cryptographic settings\n @crypto_iv = nil\n @crypto_tag = nil\n @crypto_key = nil\n @crypto_salt = nil\n @crypto_iterations = nil\n @crypto_password = nil\n\n if @is_password_protected\n add_cryptographic_settings\n end\n\n @logger.debug(\"Note #{@note.note_id}: Created a new Embedded Object of type #{@type}\")\n \n # Create an Array to hold Thumbnails and add them\n @thumbnails = Array.new\n search_and_add_thumbnails\n\n # Create an Array to hold child objects, such as for a gallery\n @child_objects = Array.new\n end", "title": "" } ]
e8986e84adc6a52e649c8b3ec67a2736
This method downloads and installs the java build
[ { "docid": "2977c4664ae65a31d047c467166ae8b5", "score": "0.68147165", "text": "def install_build(entry, java_home, version)\n installer = File.join(Dir.tmpdir, \"ibmjava\" + version.to_s + \"-installer\")\n properties = File.join(Dir.tmpdir, \"installer.properties\")\n expected_checksum = entry['sha256sum']\n\n # Download the IBM Java installer from source url to the local machine\n remote_file installer do\n src_url = entry['uri']\n source src_url.to_s\n mode '0755'\n checksum entry['sha256sum']\n action :create\n notifies :run, \"ruby_block[Verify Checksum of #{installer} file]\", :immediately\n end\n\n # Verify Checksum of the downloaded IBM Java build\n ruby_block \"Verify Checksum of #{installer} file\" do\n block do\n checksum = Digest::SHA256.hexdigest(File.read(installer))\n if checksum != expected_checksum\n raise \"Checksum of the downloaded IBM Java build #{checksum} does not match the expected checksum #{expected_checksum}\"\n end\n end\n action :nothing\n end\n\n # Create installer properties for silent installation\n file \"Create installer properties file for IBM Java#{version}\" do\n path properties\n content \"INSTALLER_UI=silent\\nUSER_INSTALL_DIR=#{java_home}\\nLICENSE_ACCEPTED=TRUE\\n\"\n action :create\n end\n\n # Install IBM Java build\n execute \"Install IBM Java#{version} build\" do\n command \"#{installer} -i silent -f #{properties}\"\n action :run\n end\n end", "title": "" } ]
[ { "docid": "258beeeed51534788e11217f01492afa", "score": "0.7179834", "text": "def install_build(entry, java_home, version)\n binary = File.join(Dir.tmpdir, \"openjdk\" + version.to_s + \"_openj9.tgz\")\n # Download the Openjdk build from source url to the local machine\n remote_file binary do\n src_url = entry['uri']\n source src_url.to_s\n mode '0755'\n checksum entry['sha256sum']\n action :create\n notifies :run, \"ruby_block[Verify Checksum of #{binary} file]\", :immediately\n end\n\n # Verify Checksum of the downloaded IBM Java build\n ruby_block \"Verify Checksum of #{binary} file\" do\n block do\n checksum = Digest::SHA256.hexdigest(File.read(binary))\n expected_checksum = entry['sha256sum']\n if checksum != expected_checksum\n raise \"Checksum of the downloaded OpendJDK build #{checksum} does not match the #{expected_checksum}\"\n end\n end\n action :nothing\n end\n\n execute \"Remove old java build installed at #{java_home}\" do\n command \"rm -rf #{java_home}\"\n action :run\n end\n\n # Extract the OpenJDK build\n execute \"Extract OpenJDK#{version} build\" do\n command \"tar -zxf #{binary}\"\n action :run\n end\n\n execute \"Move the OpenJDK#{version} build to #{java_home} dir\" do\n command \"mv ./#{entry['release']} #{java_home}\"\n action :run\n end\n end", "title": "" }, { "docid": "dcc29d0a3101f6a3ee52234a9898e913", "score": "0.7002802", "text": "def install!\n download_package\n install_package\n end", "title": "" }, { "docid": "dcc29d0a3101f6a3ee52234a9898e913", "score": "0.7002802", "text": "def install!\n download_package\n install_package\n end", "title": "" }, { "docid": "4d92795981d685f3b0dbb2d3af9f8822", "score": "0.6946204", "text": "def jruby_install\n\n root = \"#{local_root}/lib/jruby\"\n distro = \"/tmp/jruby-bin-#{jruby_version}.tar.gz\"\n\n dist_install( 'curl', minimal: true, check_install: true )\n\n sudo <<-SH\n if [ ! -d #{jruby_dist_path} ]; then\n mkdir -p #{root}\n mkdir -p #{root}/gems\n curl -sSL -o #{distro} #{jruby_bin_url}\n SH\n\n hash_verify( hash, distro, user: :root ) if hash\n\n sudo <<-SH\n tar -C #{root} -zxf #{distro}\n rm -f #{distro}\n mkdir -p #{gemrc_path}\n cd #{root} && ln -sfn jruby-#{jruby_version} jruby\n cd #{local_root}/bin && ln -sf ../lib/jruby/jruby/bin/jirb .\n fi\n SH\n\n rput( 'jruby/bin/', \"#{local_root}/bin/\", excludes: :dev, user: :root )\n end", "title": "" }, { "docid": "88f13f954b3704b84c60ad25fd074f42", "score": "0.6928826", "text": "def install\n jruby_install\n install_gemrc\n end", "title": "" }, { "docid": "c1e94b4ba340aa9221826d7529e1bb4d", "score": "0.6862293", "text": "def install\n bin.install \"bin/Linux/KaKs_Calculator\"\n java = share/\"java\"\n java.install Dir[\"bin/Linux/*\"]\n\n end", "title": "" }, { "docid": "b4a113283ba7143b5e0be4e3b92c2e02", "score": "0.68453765", "text": "def do_src_install\n\n puts \"Downloading source from ... \"+@source_url\n Download.new(@source_url, @src_dir)\n fp = FNParser.new(@source_url)\n src_tarball_fname, src_tarball_bname = fp.name\n # major, minor, patch = fp.version\n\n src_extract_folder = File.join(@build_dir, src_tarball_bname)\n @src_build_dir = src_extract_folder\n\n if Dir.exists?(src_extract_folder)\n puts \"Source file folder exists in \"+src_extract_folder\n puts \"Deleting it\"\n self.Run( ['rm -rf', src_extract_folder].join(' ') )\n end\n puts \"Extracting...\"\n self.Run( \"tar xf \"+File.realpath(File.join(@src_dir, src_tarball_fname))+\" -C \"+@build_dir )\n\n opts = [\"--prefix=\"+@prefix]+@conf_options\n\n if @need_sudo\n inst_cmd = \"sudo make install\"\n else\n inst_cmd = \"make install\"\n end\n\n @env['CC'] = 'gcc'\n @env['CXX'] = 'g++'\n\n # Ok let's rock!\n puts \"Compiling (with #{@Processors} processors) and Installing ...\"\n cmds = [\n \"cd\", src_extract_folder, \"&&\",\n File.join(src_extract_folder,\"configure\"),\n opts.join(\" \"), \"&&\",\n \"nice make -j\", @Processors.to_s, \"&&\",\n inst_cmd\n ]\n self.RunInstall( env: @env, cmd: cmds.join(\" \") )\n\n self.WriteInfo\n\n puts \"Let's install additional packages!\"\n npm_cmd = File.join(@prefix,'bin/npm')\n self.RunInstall( cmd: \"#{npm_cmd} install -g #{$npm_global_pkgs.join(' ')}\" )\n\n end", "title": "" }, { "docid": "425c5d2ddcc47538afc5ddd8f088f0fa", "score": "0.6832392", "text": "def download_and_install_wls\n installation_map = {\n 'droplet' => @droplet,\n 'wls_sandbox_root' => @wls_sandbox_root,\n 'config_cache_root' => @buildpack_config_cache_root\n }\n\n download(@wls_version, @wls_uri) do |input_file|\n wls_installer = JavaBuildpack::Container::Wls::WlsInstaller.new(input_file, installation_map)\n result_map = wls_installer.install\n\n @java_home = result_map['java_home']\n @wls_install = result_map['wls_install']\n end\n end", "title": "" }, { "docid": "ef6999ae884aaa54720958ceb0154758", "score": "0.6812393", "text": "def compile\n @version, @uri = OpenJdk.find_openjdk(@configuration)\n download_start_time = Time.now\n\n print \"-----> Downloading OpenJdk #{@version} from #{@uri} \"\n\n LibertyBuildpack::Util::Cache::ApplicationCache.new.get(@uri) do |file| # TODO: Use global cache\n puts \"(#{(Time.now - download_start_time).duration})\"\n expand file\n end\n copy_killjava_script\n end", "title": "" }, { "docid": "b5aeeaf51c19d24c5c6e3aab1d9133c9", "score": "0.6739037", "text": "def do_bin_install\n\n puts \"Downloading binary packages from ... #{@bin_url}\"\n @bin_fname = @bin_url.split('/')[-1]\n @bin_fname_base = @bin_fname.split('.')[0..-3].join('.')\n\n Download.new(@bin_url, @src_dir, source_ctl='', mode='wget', \n source_ctl_opts='')\n\n ver = @bin_fname_base.split('-')[1].delete('v')\n @Version = ver.split('.')\n\n puts \"Extracting the binary package ...\"\n self.Run(\"tar xvf #{File.join(@src_dir, @bin_fname)} -C #{@build_dir}/\")\n\n puts \"Installing to #{@prefix} directory!\"\n if @need_sudo\n sudo_cmd = 'sudo -H'\n else\n sudo_cmd = ''\n end\n cmd = [\n sudo_cmd,\n 'cp -vfr',\n \"#{File.join(@build_dir, @bin_fname_base)}/bin\",\n \"#{@prefix}/\", \"&&\",\n sudo_cmd,\n 'cp -vfr',\n \"#{File.join(@build_dir, @bin_fname_base)}/include\",\n \"#{@prefix}/\", \"&&\",\n sudo_cmd,\n 'cp -vfr',\n \"#{File.join(@build_dir, @bin_fname_base)}/lib\",\n \"#{@prefix}/\", \"&&\",\n sudo_cmd,\n 'cp -vfr',\n \"#{File.join(@build_dir, @bin_fname_base)}/share\",\n \"#{@prefix}/\",\n ]\n\n self.RunInstall( cmd: cmd.join(' ') )\n\n self.WriteInfo(build_system='bin')\n\n puts \"Let's install additional packages!\"\n npm_cmd = File.join(@prefix,'bin/npm')\n self.RunInstall( cmd: \"#{npm_cmd} install -g #{$npm_global_pkgs.join(' ')}\" )\n\n end", "title": "" }, { "docid": "f3db0db7ef674ac59193dfd3a80f76e1", "score": "0.6729504", "text": "def install\n system \"./bootstrap\"\n system \"./configure\", *osquery_autoconf_flags,\n \"--disable-java\"\n system \"make\"\n system \"make\", \"install\"\n end", "title": "" }, { "docid": "a7a651c2c6a25eb4b8bebb345c0677b2", "score": "0.672893", "text": "def jruby_install!\n url = ( \"http://jruby.org.s3.amazonaws.com/downloads/#{jruby_version}/\" +\n \"jruby-bin-#{jruby_version}.tar.gz\" )\n\n root = \"#{common_prefix}/lib/jruby\"\n\n sudo <<-SH\n mkdir -p #{root}\n mkdir -p #{root}/gems\n curl -sSL #{url} | tar -C #{root} -zxf -\n cd #{root} && ln -sfn jruby-#{jruby_version} jruby\n cd #{common_prefix}/bin && ln -sf ../lib/jruby/jruby/bin/jirb .\n SH\n\n rput( 'usr/local/bin/', :excludes => :dev, :user => 'root' )\n end", "title": "" }, { "docid": "5bf60dd77c7f3093df5ce3440a99f532", "score": "0.67276704", "text": "def install\n # system \"cmake . #{std_cmake_parameters}\"\n system \"make\"\n system \"cp -r {bin,include,lib} #{prefix}\"\n end", "title": "" }, { "docid": "bcbcb4cda023eb210e8a03fcf9b80393", "score": "0.67016673", "text": "def install_ruby_build\n poise_git ::File.join(options['prefix'], 'install', options['install_rev']) do\n repository options['install_repo']\n revision options['install_rev']\n user 'root'\n end\n end", "title": "" }, { "docid": "e09f07e4ab4aaeeaad771471cbf78864", "score": "0.6612993", "text": "def install; end", "title": "" }, { "docid": "e09f07e4ab4aaeeaad771471cbf78864", "score": "0.6612993", "text": "def install; end", "title": "" }, { "docid": "1fffb98a240afe00820b477bf7d89980", "score": "0.6607487", "text": "def install\n ENV.universal_binary if build.universal?\n\n system \"cmake\", \".\", \"-DBUILD_JAVA=OFF\", \"-DBUILD_MATLAB=OFF\", *std_cmake_args\n system \"make install\"\n end", "title": "" }, { "docid": "8dd61b55efc50b1ae575a42f5144f7f0", "score": "0.6582693", "text": "def install\n ENV.cxx11\n system \"./autogen.sh\"\n system \"./configure\", \"--disable-debug\", \"--disable-dependency-tracking\",\n \"--prefix=#{prefix}\", \"--with-zlib\"\n system \"make\"\n system \"make\", \"check\" if build.with?(\"test\") || build.bottle?\n system \"make\", \"install\"\n if build.with? \"java\"\n Dir.chdir(\"./java/\")\n # system \"echo\", \"================ TEST JAVA ===============\"\n # system \"pwd\"\n # system \"echo\", \"#{buildpath}\"\n system \"mvn\", \"test\"\n system \"mvn\", \"install\"\n system \"mvn\", \"package\"\n system \"cp\", \"#{buildpath}/java/core/target/protobuf-java-3.3.0.jar\", \"#{prefix}/bin/\"\n system \"cp\", \"#{buildpath}/java/util/target/protobuf-java-util-3.3.0.jar\", \"#{prefix}/bin/\"\n end\n end", "title": "" }, { "docid": "343b4179c0e519e0fd25ccfb5de8261b", "score": "0.6573871", "text": "def install_package\r\n begin\r\n download_update_package\r\n @dialog_sw.update_progress(@update_prg_ind =40) if @dialog_sw\r\n untar_downloaded_package\r\n @dialog_sw.update_progress(@update_prg_ind =80) if @dialog_sw\r\n execute_manifest\r\n @dialog_sw.update_progress(@update_prg_ind =90) if @dialog_sw\r\n restart_application\r\n rescue\r\n str = \"Install new software version failed.\\n -> #{$!}\"\r\n @log.error(str)\r\n raise(\"Errore: update del programma NON riuscita.\\nCausa:\\n#{str}\") \r\n end\r\n end", "title": "" }, { "docid": "5b8f162e473ab8b3161b80d06325e54b", "score": "0.6571066", "text": "def install\n system \"cmake . #{std_cmake_parameters}\"\n system \"make install\"\n end", "title": "" }, { "docid": "5b8f162e473ab8b3161b80d06325e54b", "score": "0.6571066", "text": "def install\n system \"cmake . #{std_cmake_parameters}\"\n system \"make install\"\n end", "title": "" }, { "docid": "aee7ff1340ff51abfe62bc01f2e35e85", "score": "0.6540153", "text": "def install\n build if not File.exists? @build_dir\n run_in_build \"make install 2> /dev/null\"\n end", "title": "" }, { "docid": "719d4bf3befb0c1ed492aab65bae60a1", "score": "0.651462", "text": "def install\n system \"cp #{PACKAGING_SRC}/* .\"\n system \"ls -lrt\"\n ENV['FULL_VERSION']=\"#{version}\"\n system \"bash\", \"do-component-build\"\n\n system \"sh ./install_zookeeper.sh --build-dir=build/zookeeper-#{version} --doc-dir=#{doc} --prefix=#{prefix}\"\n end", "title": "" }, { "docid": "135488d09245bba8926b04213b345cbd", "score": "0.65102524", "text": "def install\n system \"python\", \"setup.py\", \"build\"\n system \"python\", \"setup.py\", \"install\", \"--prefix=#{prefix}\"\n \n end", "title": "" }, { "docid": "b955a3eeb29d2f23d15e416be036b6b7", "score": "0.64799505", "text": "def install\n system \"cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX:PATH=#{prefix} .\"\n system \"make\"\n system \"make install\"\n end", "title": "" }, { "docid": "b955a3eeb29d2f23d15e416be036b6b7", "score": "0.64799505", "text": "def install\n system \"cmake -G 'Unix Makefiles' -DCMAKE_INSTALL_PREFIX:PATH=#{prefix} .\"\n system \"make\"\n system \"make install\"\n end", "title": "" }, { "docid": "2b1869e4dfe9b6909bd16460c4e81493", "score": "0.6477743", "text": "def install!\n STDERR.puts \"Phantomjs does not appear to be installed in #{phantomjs_path}, installing!\"\n FileUtils.mkdir_p Phantomjs.base_dir\n\n # Purge temporary directory if it is still hanging around from previous installs,\n # then re-create it.\n temp_dir = File.join(temp_path, 'phantomjs_install')\n FileUtils.rm_rf temp_dir\n FileUtils.mkdir_p temp_dir\n\n Dir.chdir temp_dir do\n unless system \"curl -L -O #{package_url}\" or system \"wget #{package_url}\"\n raise \"\\n\\nFailed to load phantomjs! :(\\nYou need to have cURL or wget installed on your system.\\nIf you have, the source of phantomjs might be unavailable: #{package_url}\\n\\n\"\n end\n\n case package_url.split('.').last\n when 'bz2'\n system \"bunzip2 #{File.basename(package_url)}\"\n system \"tar xf #{File.basename(package_url).sub(/\\.bz2$/, '')}\"\n when 'zip'\n system \"unzip #{File.basename(package_url)}\"\n else\n raise \"Unknown compression format for #{File.basename(package_url)}\"\n end\n\n # Find the phantomjs build we just extracted\n extracted_dir = Dir['phantomjs*'].find { |path| File.directory?(path) }\n\n # Move the extracted phantomjs build to $HOME/.phantomjs/version/platform\n if FileUtils.mv extracted_dir, File.join(Phantomjs.base_dir, platform)\n STDOUT.puts \"\\nSuccessfully installed phantomjs. Yay!\"\n end\n\n # Clean up remaining files in tmp\n if FileUtils.rm_rf temp_dir\n STDOUT.puts \"Removed temporarily downloaded files.\"\n end\n end\n\n raise \"Failed to install phantomjs. Sorry :(\" unless File.exist?(phantomjs_path)\n end", "title": "" }, { "docid": "47a06bbae4a507a48c998fa83d14accf", "score": "0.6442872", "text": "def jruby_install\n unless exist?( \"#{common_prefix}/lib/jruby/jruby-#{jruby_version}\" )\n jruby_install!\n end\n jruby_install_gemrc\n end", "title": "" }, { "docid": "edf8230642bde5a905a2d3d111cb5a0b", "score": "0.6442832", "text": "def install!; end", "title": "" }, { "docid": "ff369286fe67da4320689e988b143a15", "score": "0.6442778", "text": "def install\n system \"echo 'Building Julia from source. This will take a while!'\"\n system \"ENV[prefix]=#{prefix}\"\n system \"make\", \"install\"\n end", "title": "" }, { "docid": "f65a79d1e1c92a80e420c29a0110b978", "score": "0.6418297", "text": "def install\n end", "title": "" }, { "docid": "a2b8c228bdbc2d53964da4ae519fde3b", "score": "0.64069813", "text": "def install\n # system \"python\", *Language::Python.setup_install_args(prefix)\n # system \"./configure\", \"--prefix=#{prefix}\"\n system \"python\", \"setup.py\", \"build\"\n system \"python\", \"setup.py\", \"--no-user-cfg\", \"install\", \"--prefix=#{prefix}\", \"--record=installed.txt\"\n # system \"./configure\"\n # system \"make\"\n # system \"make\", \"install\"\n\n # system \"python\", \"setup.py\", \"install\"\n # system \"pip\", \"install\", \"-e\", \".\"\n\n # bin.install 'bin'\n # share.install 'share'\n # lib.install 'lib'\n end", "title": "" }, { "docid": "76cfb6e002793d8abbc33d1f3d6e66e5", "score": "0.6400648", "text": "def download_and_install_payara\n installation_map = {\n 'droplet' => @droplet,\n 'payara_sandbox_root' => @payara_sandbox_root,\n 'config_cache_root' => @buildpack_config_cache_root,\n 'payara_install' => @payara_install,\n 'payara_home' => @payara_home,\n 'payara_asadmin' => @payara_asadmin\n }\n\n log(\"Downloding Payara, Version[#{@payara_version}] from #{@payara_uri}\")\n download(@payara_version, @payara_uri) do |input_file|\n payara_installer = JavaBuildpack::Container::Payara::PayaraInstaller.new(input_file, installation_map)\n result_map = payara_installer.install\n\n @java_home = result_map['java_home']\n @java_binary = result_map['java_binary']\n @payara_install = result_map['payara_install']\n @payara_home = result_map['payara_home']\n @payara_asadmin = result_map['payara_asadmin']\n log(\"Payara_AS.download_and_install_payara: @java_home -> #{@java_home}\")\n log(\"Payara_AS.download_and_install_payara: @payara_install -> #{@payara_install}\")\n log(\"Payara_AS.download_and_install_payara: @payara_home -> #{@payara_home}\")\n log(\"Payara_AS.download_and_install_payara: @payara_asadmin -> #{@payara_asadmin}\")\n\n end\n end", "title": "" }, { "docid": "839bc62c0f7a2197d176123a18735dc5", "score": "0.6392949", "text": "def install\n\n end", "title": "" }, { "docid": "e1c7fc96935e0c3ba7b9d204a7392d4a", "score": "0.6389107", "text": "def install\n system \"cmake\", *std_cmake_args\n system \"make\"\n system \"make\", \"install\"\n end", "title": "" }, { "docid": "7a66a75ac75397ad2ce61db1f543c81d", "score": "0.6385856", "text": "def install\n # move to bin folder\n Dir.mkdir \"bin\"\n Dir['jslurp.groovy'].each { |f| mv f, \"bin/#{f.gsub('.groovy', '')}\" }\n \n# resource(\"additional_files\").stage { Dir['jlistcomp.groovy'].each { |f| mv f, \"bin/#{f.gsub('.groovy', '')}\" } }\n \n prefix.install_metafiles\n prefix.install Dir['*']\n end", "title": "" }, { "docid": "f772a7e7a238123cdafb22ea7bd394b3", "score": "0.6385757", "text": "def install\n system \"cmake\", \"-S\", \".\", \"-B\", \"build\", *std_cmake_args\n system \"cmake\", \"--build\", \"build\"\n system \"cmake\", \"--install\", \"build\"\n end", "title": "" }, { "docid": "9d6c38d5f71900f247260e034844e677", "score": "0.63846225", "text": "def install\n ENV.prepend_create_path 'PYTHONPATH', libexec+'lib/python2.7/site-packages'\n install_args = [ \"setup.py\", \"install\", \"--prefix=#{libexec}\" ]\n #cd \"host\"\n mkdir \"build\"\n cd \"build\"\n system \"cmake\",\"../\",\"-DCMAKE_INSTALL_PREFIX=#{prefix}\",*std_cmake_args\n # system \"cmake\", \".\", *std_cmake_args\n system \"make\"\n system \"make install\" # if this fails, try separate make/make install steps\n end", "title": "" }, { "docid": "425d0892db3f299a8f412b9cb541623d", "score": "0.63833815", "text": "def install\n system \"cmake\", *std_cmake_args\n system \"make\", \"install\"\n end", "title": "" }, { "docid": "820693b07116e7ccd75cff1137bec5a1", "score": "0.6381842", "text": "def install\n # use the brew python to install the tools needed\n\t system 'python', 'setup.py', 'install'\n\n # install the gyp executable\n bin.install(\"gyp\")\n bin.install(\"gyp_main.py\")\n end", "title": "" }, { "docid": "088c516f0dcc9b56fbd34ba154e6c42e", "score": "0.6355184", "text": "def install\n system \"configure\"\n system \"make\"\n system \"make install\"\n end", "title": "" }, { "docid": "bcc69f7cf7079a8731b11285bbf072ed", "score": "0.63548046", "text": "def install\n system \"./configure\", \"--prefix=#{prefix}\", \"--disable-debug\", \"--disable-dependency-tracking\"\n# system \"cmake . #{cmake_std_parameters}\"\n system \"make install\"\n end", "title": "" }, { "docid": "bcc69f7cf7079a8731b11285bbf072ed", "score": "0.63548046", "text": "def install\n system \"./configure\", \"--prefix=#{prefix}\", \"--disable-debug\", \"--disable-dependency-tracking\"\n# system \"cmake . #{cmake_std_parameters}\"\n system \"make install\"\n end", "title": "" }, { "docid": "bcc69f7cf7079a8731b11285bbf072ed", "score": "0.63548046", "text": "def install\n system \"./configure\", \"--prefix=#{prefix}\", \"--disable-debug\", \"--disable-dependency-tracking\"\n# system \"cmake . #{cmake_std_parameters}\"\n system \"make install\"\n end", "title": "" }, { "docid": "cfa29e093a515da04ba074657ad9392f", "score": "0.63466614", "text": "def install\n args = std_cmake_args\n\n system \"cmake\", \".\", *args\n system \"make\", \"install\"\n prefix.install \"install_manifest.txt\"\n end", "title": "" }, { "docid": "cfa29e093a515da04ba074657ad9392f", "score": "0.63466614", "text": "def install\n args = std_cmake_args\n\n system \"cmake\", \".\", *args\n system \"make\", \"install\"\n prefix.install \"install_manifest.txt\"\n end", "title": "" }, { "docid": "11153952e3bbe5b23ba6652a48205ba2", "score": "0.63448226", "text": "def download_jruby(jruby_version, force=false)\n dist = \"#{Dir.home}/.jruby-jar\"\n unless force || (File.exists?(\"#{dist}/jruby-complete-#{jruby_version}.jar\") && File.size(\"#{dist}/jruby-complete-#{jruby_version}.jar\") > 0)\n mkdir_p dist\n base_dir = Dir.pwd\n cd dist\n $stderr.puts \"JRuby complete jar not found. Downloading... (May take awhile)\"\n download(jruby_version)\n cd base_dir\n end\n end", "title": "" }, { "docid": "a20e0427fffde63aaa17cd6664a614e9", "score": "0.63438976", "text": "def install\n pyver = Language::Python.major_minor_version \"python\"\n pathsitetail = \"lib/python\"+pyver+\"/site-packages\"\n pathvendor = libexec+\"vendor\"\n pathvendorsite = pathvendor+pathsitetail\n pathsite = libexec+pathsitetail\n ENV.prepend_create_path \"PYTHONPATH\", pathvendorsite\n resources.each do |r|\n r.stage do\n system \"python\", *Language::Python.setup_install_args(pathvendor)\n end\n end\n ENV.prepend_create_path \"PYTHONPATH\", pathsite\n system \"python\", *Language::Python.setup_install_args(libexec)\n bin.install Dir[libexec/\"bin/*\"]\n bin.env_script_all_files(libexec/\"bin\", :PYTHONPATH => ENV[\"PYTHONPATH\"])\n ENV.prepend_create_path \"PYTHONPATH\", libexec\n %w[\"imgs\" | \"otherstuff\" | \"stuff\" | 'imgs/gui'].each do |d|\n libexec.install Dir[d]\n end\n end", "title": "" }, { "docid": "232c20a9c7609e4f8f925f3430d88af5", "score": "0.63376504", "text": "def install_ruby\n ruby_installer = Resource::RemoteFile.new(\"fetch ruby-#{version}\", run_context)\n ruby_installer.path(installer_download_path)\n ruby_installer.source(installer_url)\n ruby_installer.backup(false)\n ruby_installer.run_action(:create)\n\n install_command = %(#{installer_download_path} /verysilent /dir=\"#{ruby_install_path}\" /tasks=\"assocfiles\")\n\n execute = Resource::Execute.new(\"install ruby-#{version}\", run_context)\n execute.command(install_command)\n execute.run_action(:run)\n end", "title": "" }, { "docid": "103f57529c07642ee203c9bfd17c575b", "score": "0.6333975", "text": "def build()\n cmd = client_cmd(\"-v #{Dir.pwd}:/src -t\", \"/src/sbin/package_jar.sh\")\n system cmd\n cleanup_client()\nend", "title": "" }, { "docid": "1a3c204ff82cbab9fdb29f8df16a538e", "score": "0.63131124", "text": "def install_ruby\n end", "title": "" }, { "docid": "0cb54a6ea6fbfb409474cdd050554b58", "score": "0.6279101", "text": "def install\n system \"cmake\", \".\", *std_cmake_args\n system \"make install\" # if this fails, try separate make/make install steps\n end", "title": "" }, { "docid": "266082f0b979c650984f0132021aa537", "score": "0.6273559", "text": "def install\n resource('Mozilla::PublicSuffix').stage do\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 if not build.include? 'unbundle-publicsuffix'\n\n resource('Term::ReadLine::Gnu').stage do\n system \"perl\", \"Makefile.PL\", \"INSTALL_BASE=#{libexec}\"\n system \"make\"\n system \"make\", \"install\"\n end if not build.include? 'disable-readline'\n\n inreplace \"sieve-connect.pl\",\n /(# No user-serviceable parts below)/,\n '\\1'\"\\nuse lib '#{libexec}/lib/perl5';\"\n\n system \"mkdir\", \"-p\", bin, man1\n system \"make\", \"PREFIX=#{prefix}\", \"MANDIR=share/man\", \"install\"\n end", "title": "" }, { "docid": "b940236cd60c81a5ffd103f9821d4db6", "score": "0.62629753", "text": "def install\n system \"./configure\", \"--prefix=#{prefix}\", \"--disable-debug\", \"--disable-dependency-tracking\"\n# system \"cmake\", \".\", *std_cmake_args\n system \"make install\"\n end", "title": "" }, { "docid": "86b0965037045ffd093d99f6e6f41a67", "score": "0.6253898", "text": "def install(version = nil)\n version = super(version)\n base = \"closure-compiler-#{version}\"\n filename = download(@download_link % version)\n target = File.join(@install_dir, path)\n\n Zip::ZipFile.open(filename) do |file|\n file.extract(\"README\", File.join(target, version, \"README\"))\n file.extract(\"compiler.jar\", File.join(target, \"bin\", \"#{base}.jar\"))\n end\n end", "title": "" }, { "docid": "97843b1458aebbbe7d9926797e978555", "score": "0.62337196", "text": "def install\n mkdir \"build\" do\n system \"cmake\", \"..\", *std_cmake_args\n system \"make\", \"install\"\n end\n end", "title": "" }, { "docid": "86b6d995b007af99b56f7d7083d1a8b8", "score": "0.6210436", "text": "def install\n # Define GOPATH\n ENV[\"GOPATH\"] = buildpath/\"go\"\n\n # Create the required directories\n (buildpath/\"go/bin\").mkpath\n (buildpath/\"go/pkg\").mkpath\n (buildpath/\"go/src\").mkpath\n (buildpath/\"go/src/github.com/Dids\").mkpath\n\n # Symlink the package directory\n ln_s buildpath, buildpath/\"go/src/github.com/Dids/xcodebuild-remote\"\n\n # Install build dependencies\n system \"cd go/src/github.com/Dids/xcodebuild-remote && dep ensure\"\n\n # Print out target version\n ohai \"Building version #{version}..\"\n\n ## NOTE: Homebrew/Formula/Ruby doesn't seem to like escaping quotes,\n ## so we had to resort to using a build script/wrapper instead\n\n # Build the application\n system \"./.scripts/build.sh\", version, buildpath/\"xcodebuild-remote\"\n\n # Print the version\n system buildpath/\"xcodebuild-remote\", \"--version\"\n\n # Install the application\n bin.install buildpath/\"xcodebuild-remote\"\n\n # Test that the version matches\n if \"xcodebuild-remote version #{version}\" != `#{bin}/xcodebuild-remote --version`.strip\n odie \"Output of 'xcodebuild-remote --version' did not match the current version (#{version}).\"\n end\n end", "title": "" }, { "docid": "54e707d103bac5aaa39ab2dc75892cfd", "score": "0.6210429", "text": "def netdiscover_installer\n\tDir.chdir(INSTALL) {\n\t\tsystem('wget http://nixgeneration.com/~jaime/netdiscover/releases/netdiscover-0.3-beta6.tar.gz')\n\t\tsystem('tar zxvf netdiscover-0.3-beta6.tar.gz')\n\t\tDir.chdir('netdiscover-0.3-beta6') {\n\t\t\tsystem('./configure')\n\t\t\tsystem('make')\n\t\t\tsystem('sudo make install')\n\t\t}\n\t}\nend", "title": "" }, { "docid": "102bb31c05cac7c5c9248e6b375b726c", "score": "0.62083095", "text": "def install\n system \"./configure\", \"--prefix=#{prefix}\", \"--disable-debug\", \"--disable-dependency-tracking\"\n# system \"cmake\", \".\", *std_cmake_args\n system \"make\", \"install\"\n end", "title": "" }, { "docid": "818d3e5878a7dc4a32af19bff7a60321", "score": "0.6199299", "text": "def install\n ENV[\"GOPATH\"] = buildpath\n mkdir_p buildpath/\"src/github.com/getmillipede\"\n ln_s buildpath, buildpath/\"src/github.com/getmillipede/millipede-go\"\n Language::Go.stage_deps resources, buildpath/\"src\"\n system \"go\", \"build\", \"-o\", \"#{bin}/millipede-go\", \"./cmd/millipede-go\"\n end", "title": "" }, { "docid": "e39d6cd03e80e1387d292c1c629bb7b2", "score": "0.6181844", "text": "def install\n system \"/bin/sh\", \"./build.sh\"\n inreplace 'install.sh', '$1/nimrod', '$1'\n system \"/bin/sh\", \"./install.sh\", libexec\n end", "title": "" }, { "docid": "6a3d2115072c80d90e210dec58ce7593", "score": "0.6165378", "text": "def install\n # ENV.j1 # if your formula's build system can't parallelize\n\n system \"./configure\", \"--disable-debug\", \"--disable-dependency-tracking\",\n \"--prefix=#{prefix}\"\n # system \"cmake\", \".\", *std_cmake_args\n system \"make\", \"install\" # if this fails, try separate make/make install steps\n end", "title": "" }, { "docid": "abb7cfa3c215cdf96beb92e26fa3e02f", "score": "0.61532813", "text": "def aircrack_installer\n\tDir.chdir(INSTALL) {\n\t\tsystem('wget http://download.aircrack-ng.org/aircrack-ng-1.2-beta1.tar.gz')\n\t\tsystem('tar zxvf aircrack-ng-1.2-beta1.tar.gz')\n\t\tDir.chdir('aircrack-ng-1.2-beta1') {\n\t\t\tsystem('make sqlite=true')\n\t\t\tsystem('sudo make sqlite=true install')\n\t\t}\n\t}\nend", "title": "" }, { "docid": "58f37e0ee4bd251f78d3fae6763b0d97", "score": "0.6148631", "text": "def install\n system \"make\"\n mkdir bin\n system \"make\", \"INSTALLDIR=#{bin}\", \"install\"\n doc.install \"manual.html\"\n pkgshare.install \"tools\", \"test\"\n end", "title": "" }, { "docid": "77f7cf0f1febadf4e971d0f7eec7abd0", "score": "0.6148362", "text": "def install \n system \"make\", \"-C\", \"py2app\", \"install\"\n end", "title": "" }, { "docid": "25115afb59a61f7780e8de1e3b306381", "score": "0.6144582", "text": "def install\n # get spec information\n @spec = compute_spec\n # define name and platform\n if @installname\n @spec[:installname] = @installname\n else\n @spec[:installname] = name_and_platform(@spec[:name])\n end\n # set install dir\n @installdir = \"#{@spec[:installname]}-#{@spec[:version]}\"\n # install gem\n Gem::Installer.new(@filename, :env_shebang => true, :ignore_dependencies => true,\n :install_dir => File.expand_path(@installdir), :bin_dir => File.expand_path(\"#{@installdir}/bin\"),\n :wrappers => true).install\n # install build files\n install_build_files\n # get file list\n files\n # build tar.gz\n build_source\n end", "title": "" }, { "docid": "ac3c2d924aa969055ff0ccbe623d3d42", "score": "0.6144365", "text": "def install\n system \"xcodebuild install -target ctfconvert -target ctfdump -target ctfmerge DSTROOT=build\"\n bin.install Dir['build/usr/local/bin/*']\n end", "title": "" }, { "docid": "90bb7fd446117d7e790402a5200f9008", "score": "0.6132761", "text": "def install\n system \"./autogen.sh\" if build.head?\n system \"./configure\", *std_configure_args\n system \"make\", \"install\"\n end", "title": "" }, { "docid": "038316abb440f9f22d92232429c0c1e3", "score": "0.61149776", "text": "def download\n Maven2.download(self) || JCenter.download(self) || Bintray.download(self) || Gradle.download(self) || GradleReleases.download(self) || GradleLocal.download(self) || KotlinEap.download(self) || Torquebox.download(self) || JBoss.download(self) || GeoMajas.download(self)\n end", "title": "" }, { "docid": "882d6fe374ca5d8a83bc8ceec48098ff", "score": "0.6106889", "text": "def install\n bin.install \"get-to-work\"\n end", "title": "" }, { "docid": "bce39f11eb907a200d15e8954bcb333a", "score": "0.6099963", "text": "def install\n end", "title": "" }, { "docid": "85ffd76217e359026ef2e6b6dc28a1b7", "score": "0.6094359", "text": "def install\n system \"make\"\n system \"make install PREFIX=#{prefix}\"\n end", "title": "" }, { "docid": "f4500472d47e845c7e97859a4b249ea5", "score": "0.6092516", "text": "def install\n system \"unzip\", \"source.zip\"\n system \"/bin/bash\", \"build.sh\"\n bin.install \"objconv\"\n end", "title": "" }, { "docid": "6036b79f793a048f4fbdee86d9cff125", "score": "0.6088475", "text": "def action_install\n # First inner converge for the Python install.\n notifying_block do\n install_python\n end\n # Second inner converge for the support tools. This is needed because\n # we run a python command to check if venv is available.\n notifying_block do\n install_pip\n install_setuptools\n install_wheel\n install_virtualenv\n end\n end", "title": "" }, { "docid": "68cc60dee4835de8d56d8bcef163b5d0", "score": "0.60874057", "text": "def install\n resources.each do |res|\n res.stage(buildpath/\"External\"/res.name)\n end\n mv \"External/SPIRV-Tools\", \"External/glslang/External/spirv-tools\"\n mv \"External/SPIRV-Headers\", \"External/glslang/External/spirv-tools/external/spirv-headers\"\n\n # Build glslang\n cd \"External/glslang\" do\n system \"./build_info.py\", \".\",\n \"-i\", \"build_info.h.tmpl\",\n \"-o\", \"build/include/glslang/build_info.h\"\n end\n\n # Build spirv-tools\n mkdir \"External/glslang/External/spirv-tools/build\" do\n # Required due to files being generated during build.\n system \"cmake\", \"..\", *std_cmake_args\n system \"make\"\n end\n\n # Build ExternalDependencies\n xcodebuild \"ARCHS=#{Hardware::CPU.arch}\", \"ONLY_ACTIVE_ARCH=YES\",\n \"-project\", \"ExternalDependencies.xcodeproj\",\n \"-scheme\", \"ExternalDependencies-macOS\",\n \"-derivedDataPath\", \"External/build\",\n \"SYMROOT=External/build\", \"OBJROOT=External/build\",\n \"build\"\n\n # Build MoltenVK Package\n xcodebuild \"ARCHS=#{Hardware::CPU.arch}\", \"ONLY_ACTIVE_ARCH=YES\",\n \"-project\", \"MoltenVKPackaging.xcodeproj\",\n \"-scheme\", \"MoltenVK Package (macOS only)\",\n \"-derivedDataPath\", \"#{buildpath}/build\",\n \"SYMROOT=#{buildpath}/build\", \"OBJROOT=build\",\n \"build\"\n\n (libexec/\"lib\").install Dir[\"External/build/Intermediates/XCFrameworkStaging/Release/\" \\\n \"Platform/lib{SPIRVCross,SPIRVTools,glslang}.a\"]\n glslang_dir = Pathname.new(\"External/glslang\")\n Pathname.glob(\"External/glslang/{glslang,SPIRV}/**/*.{h,hpp}\") do |header|\n header.chmod 0644\n (libexec/\"include\"/header.parent.relative_path_from(glslang_dir)).install header\n end\n (libexec/\"include\").install \"External/SPIRV-Cross/include/spirv_cross\"\n (libexec/\"include\").install \"External/glslang/External/spirv-tools/include/spirv-tools\"\n (libexec/\"include\").install \"External/Vulkan-Headers/include/vulkan\" => \"vulkan\"\n (libexec/\"include\").install \"External/Vulkan-Headers/include/vk_video\" => \"vk_video\"\n\n frameworks.install \"Package/Release/MoltenVK/MoltenVK.xcframework\"\n lib.install \"Package/Release/MoltenVK/dylib/macOS/libMoltenVK.dylib\"\n lib.install \"build/Release/libMoltenVK.a\"\n include.install \"MoltenVK/MoltenVK/API\" => \"MoltenVK\"\n\n bin.install \"Package/Release/MoltenVKShaderConverter/Tools/MoltenVKShaderConverter\"\n frameworks.install \"Package/Release/MoltenVKShaderConverter/\" \\\n \"MoltenVKShaderConverter.xcframework\"\n include.install Dir[\"Package/Release/MoltenVKShaderConverter/include/\" \\\n \"MoltenVKShaderConverter\"]\n\n inreplace \"MoltenVK/icd/MoltenVK_icd.json\",\n \"./libMoltenVK.dylib\",\n (lib/\"libMoltenVK.dylib\").relative_path_from(share/\"vulkan/icd.d\")\n (share/\"vulkan\").install \"MoltenVK/icd\" => \"icd.d\"\n end", "title": "" }, { "docid": "0f06c4f0d691e35923675a9e03f14d56", "score": "0.60847974", "text": "def install_dependencies\n return if options['no_dependencies']\n poise_build_essential 'build_essential'\n unless options['version'].start_with?('jruby')\n pkgs = node.value_for_platform_family(\n debian: %w{libreadline6-dev zlib1g-dev libssl-dev libyaml-dev libsqlite3-dev libxml2-dev libxslt1-dev},\n rhel: %w{tar bzip2 readline-devel zlib-devel libffi-devel openssl-devel libxml2-devel libxslt-devel},\n suse: %w{zlib-devel libffi-devel sqlite3-devel libxml2-devel libxslt-devel},\n )\n package pkgs if pkgs\n end\n end", "title": "" }, { "docid": "cd36a60632b6efad6df2d3a16f90681f", "score": "0.6078921", "text": "def install\n bash_completion.install \"diskutil_completion\" => \"diskutil\"\n bin.install \"complete_diskutil.py\" => \"complete_diskutil.py\"\n # system 'ln', '-s', \n\n # ENV.deparallelize # if your formula fails when building in parallel\n # Remove unrecognized options if warned by configure\n # https://rubydoc.brew.sh/Formula.html#std_configure_args-instance_method\n # system \"./configure\", *std_configure_args, \"--disable-silent-rules\"\n # system \"cmake\", \"-S\", \".\", \"-B\", \"build\", *std_cmake_args\n end", "title": "" }, { "docid": "4ba71a9ca7db48c6d38eccdce1e32d20", "score": "0.6075742", "text": "def compile\n download_start_time = Time.now\n print \"-----> Downloading Mono #{@version} from #{@uri} \"\n\n NETBuildpack::Util::ApplicationCache.new.get(@uri) do |file| # TODO Use global cache #50175265\n puts \"(#{(Time.now - download_start_time).duration})\"\n expand file\n end\n\n print \"-----> Downloading Mozilla certificate data \"\n NETBuildpack::Util::ApplicationCache.new.get(MOZILLA_CERTS_URL) do |file| \n puts \"(#{(Time.now - download_start_time).duration})\"\n add_cert_installation_to_startup file\n end\n end", "title": "" }, { "docid": "a3f93f461872dba5e946cd0426d0ac05", "score": "0.60717404", "text": "def install\n system \"./bootstrap\"\n system \"./configure\", \"--prefix=#{prefix}\"\n system \"make\"\n system \"make\", \"install\"\n end", "title": "" }, { "docid": "6a5e2f9bf1ae3f0476a0f04c464f41f7", "score": "0.6069997", "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 # At some point, the keg for readline from brew got built \"x86_64\"-only, not dual x86_64/i386,\n # which breaks the build here\n system \"env\", \"ARCHFLAGS=-arch x86_64\", \"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 #before = (libexec/\"bin\").children\n system \"make\", \"PERL5LIB=#{ENV[\"PERL5LIB\"]}\", \"PREFIX=#{prefix}\", \"MANDIR=share/man\", \"install\"\n #after = (libexec/\"bin\").children\n\n #bin_to_link = after - before\n #bin.install bin_to_link\n bin.env_script_all_files(libexec/\"bin\", :PERL5LIB => ENV[\"PERL5LIB\"])\n end", "title": "" }, { "docid": "fee329c51f387c24883906f75a4bf340", "score": "0.6059436", "text": "def copy_install\n shell \"mkdir -p #{version_directory}\"\n shell \"cp -dR #{File.join(package_directory,'*')} #{install_directory}\"\n link_current\n end", "title": "" }, { "docid": "caf9c5e37f322f8322322771343922f6", "score": "0.60545915", "text": "def installTestContent\n setSystemExePath(getSystemExePath + [ \"#{@RepositoryDir}/Binaries\" ])\n end", "title": "" }, { "docid": "aaf1d050ad12569f7394523beccbcfad", "score": "0.6053789", "text": "def install\n mkdir \"build\" do\n system \"meson\", *std_meson_args, \"..\"\n system \"ninja\", \"-v\"\n system \"ninja\", \"install\", \"-v\"\n end\n end", "title": "" }, { "docid": "e32f97d4e37fdcb4c08f7e45dfaab830", "score": "0.6046548", "text": "def step_install()\n\t\t\t\tDir.chdir(build_dir_name) {|dir|\n\t\t\t\t\tif (!system(\"make\", *install_targets))\n\t\t\t\t\t\traise InstallFailed, \"Install failed with error: #{$?}\"\n\t\t\t\t\tend\n\t\t\t\t}\n\t\t\t\treturn []\n\t\t\tend", "title": "" }, { "docid": "314c9ec3e605b6851838b8150cefdc21", "score": "0.6043958", "text": "def install\n # Reduce memory usage for CircleCI\n ENV[\"MAKEFLAGS\"] = \"-j4\" if ENV[\"CIRCLECI\"]\n\n system \"make\"\n rm Dir[\"bin/*.R\"]\n\n bin.install Dir[\"bin/*\"]\n doc.install %w[LICENSE README.md]\n end", "title": "" }, { "docid": "098469bb303daf48f698ea33a2c4de90", "score": "0.6042593", "text": "def download_installer\n puts pe_installer_url\n unless `curl #{pe_installer_url} -o ./file_cache/installers/#{installer_filename}`\n fail \"Error downloading the PE installer\"\n end\n gzip_installer if PRE_RELEASE\nend", "title": "" }, { "docid": "f4d7f5525e495b1561cfbc1bc3d70112", "score": "0.6041084", "text": "def compile\n download(@version, @uri) { |file| expand file }\n\n @config_vars[\"HOME\"] = @app_dir\n set_mono_config_vars\n\n time_operation \"Installing Mozilla certificate data to .config/.mono/certs\" do\n sh \"ln -s #{stage_time_absolute_path(\"vendor\")} /app/vendor\", {:silent => true, :env => @config_vars}\n sh \"#{stage_time_absolute_path(mozroots_exe)} --import --sync\", {:silent => true, :env => @config_vars}\n end\n end", "title": "" }, { "docid": "15bc05c25c6ebea9929644ad5b69d545", "score": "0.6038327", "text": "def install\n puts \"Build Dir #{builddir}\"\n puts \"Build Dir #{destdir}\"\n FileUtils.cp_r File.join(builddir,'.'), destdir\n end", "title": "" }, { "docid": "49d5a2ad907d8cd32f376b364e12fd46", "score": "0.60246634", "text": "def install(version = nil)\n version = super((version || latest).gsub(/\\./, \"_\"))\n base = \"rhino#{version}\"\n filename = download(File.join(@website, \"#{base}.zip\"))\n target = File.join(@install_dir, path)\n\n Zip::ZipFile.open(filename) do |file|\n FileUtils.mkdir_p(File.join(target, version))\n\n begin\n file.extract(\"#{base.sub(/-RC\\d/, \"\")}/LICENSE.txt\", File.join(target, version, \"LICENSE.txt\"))\n rescue Exception\n # Fail silently, some releases don't carry the license\n end\n\n file.extract(\"#{base.sub(/-RC\\d/, \"\")}/js.jar\", File.join(target, \"bin\", \"#{base}.jar\"))\n end\n end", "title": "" }, { "docid": "3dc95b78ba5f15bcebf205942ea600da", "score": "0.6020486", "text": "def install\n self.ShowTitle\n self.SetURL\n if @run_install\n self.do_install\n end\n end", "title": "" }, { "docid": "dd3d0d7bce064f16a9c18c4eef01b1a1", "score": "0.6014891", "text": "def install\n args = %W[\n -DBUILD_TOOLS=ON\n -DCMAKE_INSTALL_RPATH=#{rpath}\n ]\n\n mkdir \"build\" do\n system \"cmake\", \"..\", *args, *std_cmake_args\n system \"make\", \"install\"\n end\n end", "title": "" }, { "docid": "c2dcc31c5eb4c407f84b3e74930b1bb5", "score": "0.60130644", "text": "def install\n bin.install \"release/rust-http-server\"\n end", "title": "" }, { "docid": "c6d68e783b89486853b483ef954454b6", "score": "0.6000741", "text": "def install\n true\n end", "title": "" }, { "docid": "e2f401cdb70f0e17a267ec57a641fa82", "score": "0.59922713", "text": "def install\n unless File.exists?(Mobo.android_home)\n if SystemCheck.ubuntu?\n Mobo.cmd(\"curl -o #{path}/android-sdk_r24.3.4-linux.tgz http://dl.google.com/android/android-sdk_r24.3.4-linux.tgz\")\n Mobo.cmd(\"tar -xf #{path}/android-sdk_r24.3.4-linux.tgz -C #{path}\")\n Mobo.cmd(\"mv #{path}/android-sdk-linux #{Mobo.android_home}\")\n elsif SystemCheck.osx?\n Mobo.cmd(\"curl -o #{path}/android-sdk_r24.3.4-macosx.zip http://dl.google.com/android/android-sdk_r24.3.4-macosx.zip\")\n Mobo.cmd(\"unzip #{path}/android-sdk_r24.3.4-macosx.zip -d #{path}\")\n Mobo.cmd(\"mv #{path}/android-sdk-macosx #{Mobo.android_home}\")\n else\n Mobo.log.error(\"Platform not yet supported! Please raise a request with the project to support it.\")\n end\n end\n add_to_path\n end", "title": "" }, { "docid": "c12242f80f7b847b1df2ae735c8d21dd", "score": "0.59859186", "text": "def install\n bin.install Dir[\"bin/*\"]\n end", "title": "" }, { "docid": "e0c9a9631e4a7180afab7d65af6c6e99", "score": "0.59859055", "text": "def install_binary(name)\n topic \"Installing #{name}\"\n bin_dir = \"bin\"\n FileUtils.mkdir_p bin_dir\n Dir.chdir(bin_dir) do |dir|\n if name.match(/^node\\-/)\n @node_installer.install\n # need to set PATH here b/c `node-gyp` can change the CWD, but still depends on executing node.\n # the current PATH is relative, but it needs to be absolute for this.\n # doing this here also prevents it from being exported during runtime\n node_bin_path = File.absolute_path(\".\")\n # this needs to be set after so other binaries in bin/ don't take precedence\"\n ENV[\"PATH\"] = \"#{ENV[\"PATH\"]}:#{node_bin_path}\"\n elsif name.match(/^yarn\\-/)\n FileUtils.mkdir_p(\"../vendor\")\n Dir.chdir(\"../vendor\") do |vendor_dir|\n @yarn_installer.install\n yarn_path = File.absolute_path(\"#{vendor_dir}/#{@yarn_installer.binary_path}\")\n ENV[\"PATH\"] = \"#{yarn_path}:#{ENV[\"PATH\"]}\"\n end\n else\n @fetchers[:buildpack].fetch_untar(\"#{name}.tgz\")\n end\n end\n end", "title": "" }, { "docid": "e2e2e629aab0e08481af1c10287a2e37", "score": "0.59852475", "text": "def install\n if build.head?\n system \"mvn\", \"clean\", \"install\"\n else\n man1.install \"man/rampart.1\"\n prefix.install Dir[\"*\"]\n end\n end", "title": "" }, { "docid": "eb40ec4837fa27fa6c81bae751f2dd47", "score": "0.59681094", "text": "def install\n ENV.deparallelize\n ENV.no_optimization\n system \"sudo\", \"chgrp\", \"-R\", \"staff\", \"/usr/local\"\n system \"sudo\", \"chgrp\", \"-R\", \"staff\", \"/Library/Python\"\n system \"sudo\", \"chmod\", \"-R\", \"+wg\", \"/usr/local\"\n system \"sudo\", \"chmod\", \"-R\", \"+wg\", \"/Library/Python\"\n system \"sudo\", \"easy_install\", \"PyYAML\", \"txaws\", \"pydot\", \"oauth\", \"txzookeeper\"\n system \"sudo\", \"python\",\"setup.py\", \"install\"\n end", "title": "" }, { "docid": "e29bae6cad752ee9749f582699579a78", "score": "0.596409", "text": "def install\n system \"make\"\n system \"mkdir #{prefix}/bin\"\n system \"mkdir #{prefix}/share\"\n system \"cp xtrv #{prefix}/bin/\"\n system \"cp unxtrv #{prefix}/bin/\"\n system \"cp -rf man #{prefix}/share\"\n end", "title": "" }, { "docid": "84e54114cff13ceebe4f0e96267c3712", "score": "0.5956554", "text": "def compile\n download_start_time = Time.now\n print \"-----> Downloading Groovy #{@version} from #{@uri} \"\n\n JavaBuildpack::Util::ApplicationCache.new.get(@uri) do |file| # TODO: Use global cache #50175265\n puts \"(#{(Time.now - download_start_time).duration})\"\n expand(file, @configuration)\n end\n end", "title": "" } ]
634652a8052bf80c025728db8187d16e
Method to update the quantity of an item input:list, item, quantity steps: update list to passed in quantity output: list
[ { "docid": "6638ca56b827cdde11aa56b61560a65d", "score": "0.76147354", "text": "def update_item(list, item, quantity)\n\tlist[item] = quantity\n\treturn list\nend", "title": "" } ]
[ { "docid": "00220631c0081c97ea4c5988d06a91f1", "score": "0.8526499", "text": "def update_quantity(item, list, quantity)\n add_item(item, list, quantity)\nend", "title": "" }, { "docid": "94d5e4d9ab2fd4bb2cd99ed6f8224e40", "score": "0.84101313", "text": "def update_quantity(list, item, quantity)\n\tadd_to_list(list, item, quantity)\nend", "title": "" }, { "docid": "60c56ec32ba5073dba8975e73e0c43c0", "score": "0.83146465", "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": "f571a264a1f92c01a2e3a8cb70c3cd4a", "score": "0.8200628", "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": "79c49291ff47b154eebf7bf0be01c8d0", "score": "0.8045134", "text": "def update_qty(shopping_list, item, quantity)\r\n\r\n\tadd_item(shopping_list, item, quantity)\r\n\r\nend", "title": "" }, { "docid": "dd08a39d02eea0e83a2b26ed6828e544", "score": "0.8013299", "text": "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\n\tlist\nend", "title": "" }, { "docid": "eceb5b093ea2f605f051f158f47110a5", "score": "0.7925596", "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": "119e0964b46a12e44075c0ea60aaed86", "score": "0.79239964", "text": "def update_quantity(list, item_name, quantity)\n\tlist[item_name] = quantity.to_i\n\tlist\nend", "title": "" }, { "docid": "48128830c39f0cb23e3e5b193b3c45ac", "score": "0.78993165", "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": "7a52c8dab4b9f90115cf769c1ad55b61", "score": "0.7895663", "text": "def update_qty(item_list, item, qty)\r\n item_list[item] = qty\r\n item_list\r\nend", "title": "" }, { "docid": "9522637f9186187515d6a1a1a392f82a", "score": "0.7875562", "text": "def update_quantity(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "title": "" }, { "docid": "9522637f9186187515d6a1a1a392f82a", "score": "0.7875562", "text": "def update_quantity(list, item_name, quantity)\n\tlist[item_name] = quantity\n\tlist\nend", "title": "" }, { "docid": "b1b320f4cc8d56162b17f763f38522f0", "score": "0.7870855", "text": "def update_quantity_of_items(list, item, quantity)\n list[item] = quantity\nend", "title": "" }, { "docid": "2e430ad20d485e8efbc2d0c7a50d247b", "score": "0.7831492", "text": "def update_item(list, item, new_quantity)\n\tlist[item] = new_quantity\n\tlist\nend", "title": "" }, { "docid": "c0ad72b9b9704ee122acf4c3909d07c3", "score": "0.7805556", "text": "def updated_quantity(list, item_name, quantity)\r\n\tlist[item_name] = quantity\r\n\tlist\r\nend", "title": "" }, { "docid": "4013641490fac1775a2c33ff25376757", "score": "0.77977234", "text": "def update_quantity(list, item, quantity)\n #method to update quantity\n #can also add items\n list[item] = quantity\nend", "title": "" }, { "docid": "8ead57b705dc18950976d3779465e023", "score": "0.77611315", "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": "7649a37dfaf16f0a198911cc69b1e9ce", "score": "0.77453065", "text": "def update_quantity(list, item, quantity)\n\tlist[item] = quantity\n\tp list\nend", "title": "" }, { "docid": "56a7690470d5454d7a6bb20bd1053f26", "score": "0.7740413", "text": "def update_quantity(item, list, quantity)\n list[item] = quantity\n return list\nend", "title": "" }, { "docid": "cead9882cdd95daadda77076d180fa07", "score": "0.77353", "text": "def update_quantity(list,item,item_count)\n\tlist[item] = item_count\nend", "title": "" }, { "docid": "16a2d39317f46d6c613bca5a1ea863cd", "score": "0.7722881", "text": "def update_item_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "title": "" }, { "docid": "36cbf0f68b9983bc05b8ec4d23efea41", "score": "0.77179545", "text": "def update_quantity(list, item, qty)\n list[item] = qty\n list\nend", "title": "" }, { "docid": "c5c55086fd9194e3407199fb141f0d60", "score": "0.7700034", "text": "def update(list, item, quantity)\n\tlist[item] = quantity\n\tlist\nend", "title": "" }, { "docid": "cd8d1acd9c722b2087236480408906ac", "score": "0.7698314", "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": "9a6e551393c7adb07fc0d5ece31ad8ee", "score": "0.76969635", "text": "def update_quantity(list, item, updated_quantity)\n list[item] = updated_quantity\n list\nend", "title": "" }, { "docid": "d8f0297d6e091c457c2b9147c7dafc98", "score": "0.76967955", "text": "def update_quantity(grocery_list, item, quantity)\r\n add_item(grocery_list, item, quantity)\r\n \r\nend", "title": "" }, { "docid": "b583127eb8c3afdf1ff08b03659359df", "score": "0.7677082", "text": "def update_quantity(list, item, quantity)\r\n\tlist[item] = quantity\r\n\treturn list\r\nend", "title": "" }, { "docid": "1dc1787baf895feecbb0aedc6fca8dc0", "score": "0.7648737", "text": "def update(list, item, qty)\n add_item(list, item, qty)\nend", "title": "" }, { "docid": "a96e6223cb13b91ecb6ddd9b52ca9060", "score": "0.76485777", "text": "def update_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "title": "" }, { "docid": "a96e6223cb13b91ecb6ddd9b52ca9060", "score": "0.76485777", "text": "def update_quantity(list, item, quantity)\n list[item] = quantity\n list\nend", "title": "" }, { "docid": "12d9012b43432b1920ae1deabd91fa2b", "score": "0.76266885", "text": "def update_quantity(new_list, item_name, quantity)\r\n \r\n new_list[item_name] = quantity\r\nend", "title": "" }, { "docid": "acde4d0bfa43d4b9aa6fa80073c4088e", "score": "0.76217514", "text": "def updating_item(list,item,quantity)\r\n\r\n adding_item(list,item, quantity)\r\n\r\nend", "title": "" }, { "docid": "73787c09305d639756d914353d1ab9fb", "score": "0.7594398", "text": "def update_quantity(list, item, quant)\n list[item] = quant\nend", "title": "" }, { "docid": "d2cf8d73296a640e8d8fd0fb96e2058c", "score": "0.7590906", "text": "def item_quantity(list, item_to_update, quantity)\n list[item_to_update] = quantity \nend", "title": "" }, { "docid": "bceb099d123556bfb278c1abf8cf0c38", "score": "0.7580094", "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": "8b68324d9b5de47d220f1e84aceeb59b", "score": "0.7564783", "text": "def update_quantity(list, item_name, qty)\n list[item_name] = qty\nend", "title": "" }, { "docid": "8941d0431fd15aa9379ba694fae6176c", "score": "0.75572205", "text": "def update(item,quantity,list)\n\tlist[item] = quantity\nend", "title": "" }, { "docid": "f8e5dd9123a3761a6c5a19d302d8e33c", "score": "0.7542007", "text": "def update_quant(current_list, item, quantity)\n current_list[item] = quantity\n current_list\nend", "title": "" }, { "docid": "eaf8bee2933d6b742ebf03edf30be117", "score": "0.7539632", "text": "def update_quantity(shopping_list, item, quantity)\n shopping_list[item] = quantity\nend", "title": "" }, { "docid": "6a6ddbe6b9900b71a2d0da32bb929d4f", "score": "0.7539579", "text": "def update_quantity(list, item, quantity)\n list[item] = quantity\nend", "title": "" }, { "docid": "3b675ce6b1812e23dd5220dd001060fa", "score": "0.75348914", "text": "def update_quantity(list, item, quant)\n list[item] = quant\nend", "title": "" }, { "docid": "87a1194c5af3e05b2357fb433cc5cec9", "score": "0.75255895", "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": "00bdf14ef889eb261fcee4a90c35a4db", "score": "0.7519607", "text": "def change_quantity(list, item, qty)\n list[item] = qty\n list\nend", "title": "" }, { "docid": "96ce48e033782f6e6b16fa71755b2d77", "score": "0.75181884", "text": "def update_quantity (list, item, quantity)\n list[item] = quantity\nend", "title": "" }, { "docid": "96ce48e033782f6e6b16fa71755b2d77", "score": "0.75181884", "text": "def update_quantity (list, item, quantity)\n list[item] = quantity\nend", "title": "" }, { "docid": "6e3ecb834c572d22064be28de7a2d150", "score": "0.75140136", "text": "def update_item (list,item,quantity)\n\tlist[item] = quantity\nend", "title": "" }, { "docid": "0d6b5823c0d0aa1ec139824b29c678f3", "score": "0.7504753", "text": "def update_item(item,quantity_changed,first_list)\n first_list[item] = quantity_changed\n\nend", "title": "" }, { "docid": "4ae010f5258134f4834408039503bf56", "score": "0.750464", "text": "def update_quantity(list, item_name, new_quantity)\n list[item_name] = new_quantity\nend", "title": "" }, { "docid": "4ae010f5258134f4834408039503bf56", "score": "0.750464", "text": "def update_quantity(list, item_name, new_quantity)\n list[item_name] = new_quantity\nend", "title": "" }, { "docid": "8ab24ddae845e983f00062670ff891f2", "score": "0.74935985", "text": "def update_quantity(list, item, quantity)\n list[item] = quantity.to_i\n list\nend", "title": "" }, { "docid": "1f5f0db8bd8adb422a56e00ebd3bdccb", "score": "0.74933", "text": "def update_quantity(list, item, quantity)\n list[item] = quantity\nend", "title": "" }, { "docid": "ac5b284fc183fbe4ea6638f041c1de30", "score": "0.7483447", "text": "def change_quantity(list, item, new_qty)\n list[item] = new_qty\nend", "title": "" }, { "docid": "edc3f8666f20f32dafc6d54b90118739", "score": "0.74725467", "text": "def update_quantity(list, item, quantity)\nlist[item] = quantity\nlist\nend", "title": "" }, { "docid": "d99ba35447fffe8218503e11428390b4", "score": "0.74582577", "text": "def update_quantity (item,list, quantity)\n list[item] = quantity\nlist\nend", "title": "" }, { "docid": "438e0f891c1d8f53c5d0460b24685f42", "score": "0.7449959", "text": "def update_quantity(list, item_name, quantity)\r\n list[item_name] = quantity\r\nend", "title": "" }, { "docid": "78177dbcf5038a94a8e5608ff64e351c", "score": "0.7445038", "text": "def update_item_quantity(hash_of_items, item, quantity)\n hash_of_items[item] = quantity\n hash_of_items\nend", "title": "" }, { "docid": "06057e2e70098ce26a22888b293c2a62", "score": "0.7441128", "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": "6cce61fbd9cac0cc9b9f5f9403b5c218", "score": "0.74383956", "text": "def add_to_list(list,item,quantity)\n\tupdate_item(list,item,quantity)\nend", "title": "" }, { "docid": "99569f6b2b4b46895dc56da9d843de8f", "score": "0.7436154", "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": "9133b610543770e77070ea7bb4ae3952", "score": "0.7428912", "text": "def update_list(item_name, item_list, quantity)\n add_list(item_name, item_list, quantity)\nend", "title": "" }, { "docid": "5492199e2818503ee90f6075c250d7ac", "score": "0.74268275", "text": "def update_quantity(grocery_list, item_to_update, qty)\n grocery_list[item_to_update] = qty\n grocery_list\nend", "title": "" }, { "docid": "b2054c9a36ca634e27472784f7b1ae1c", "score": "0.7405336", "text": "def update_quantity(grocery_list, item, quantity)\r\n\tgrocery_list[item] = quantity\r\n\tgrocery_list\r\nend", "title": "" }, { "docid": "e4adaad1a3c97e42a7be01ed7bbbdb29", "score": "0.7399925", "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": "a68bbc7128414c74485325af6778f485", "score": "0.7395445", "text": "def update (list, item, quantity)\n\tlist[item] = quantity\nend", "title": "" }, { "docid": "a948a04be60f2e3d849b463d9e3154c5", "score": "0.7393463", "text": "def update(list, item, quantity)\n\tlist[item] = quantity\nend", "title": "" }, { "docid": "0f586fae4f27a13b181d6f599773cef2", "score": "0.73880833", "text": "def update_item(list,item,quantity)\n list[item] = quantity\nend", "title": "" }, { "docid": "0f586fae4f27a13b181d6f599773cef2", "score": "0.73880833", "text": "def update_item(list,item,quantity)\n list[item] = quantity\nend", "title": "" }, { "docid": "1004853f29974d754e899382069ef477", "score": "0.738211", "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": "c0793657727badd2bb053272d066734e", "score": "0.73644656", "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": "959a38b950941e4d67228c81487e9864", "score": "0.7356874", "text": "def update_quantity(item, grocery_list, quantity)\n grocery_list[item] = quantity\n return grocery_list\n end", "title": "" }, { "docid": "959a38b950941e4d67228c81487e9864", "score": "0.7356874", "text": "def update_quantity(item, grocery_list, quantity)\n grocery_list[item] = quantity\n return grocery_list\n end", "title": "" }, { "docid": "2d73126afb4aebda05fee982dbdcceff", "score": "0.73256147", "text": "def update_quantity(item_name, grocery_list, quantity)\n grocery_list[item_name] = quantity\n grocery_list\n end", "title": "" }, { "docid": "fb36230d84a94107317607ba3970ecad", "score": "0.7317215", "text": "def update(list, item, quantity)\n list[item] = quantity\n list\nend", "title": "" }, { "docid": "5222747987839330b404cf2060b1265f", "score": "0.7310132", "text": "def input (list, item, quantity)\n\tlist[item] = quantity\nend", "title": "" }, { "docid": "6c64a6e7a41674a15a008521c7e12c0a", "score": "0.72964185", "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": "c1c1f8e582e073b981dfeef4147eca93", "score": "0.72821945", "text": "def add_or_update_item_qty(shopping_list, item, quantity)\n shopping_list[item] = quantity\nend", "title": "" }, { "docid": "3d0d0f619b5890e16fadcd81e6251799", "score": "0.728102", "text": "def update_quantity(list,item,quantity)\nlist[item]= quantity\n p list\nend", "title": "" }, { "docid": "9cb65fc6d7ea7db8a42c1322b63af1ab", "score": "0.7278845", "text": "def update_quantity(list_item,quantity,user_list)\n user_list[list_item] = quantity\n user_list\nend", "title": "" }, { "docid": "008a9647ab85ecd6d1c0dc769c90a5ab", "score": "0.7274991", "text": "def update(items)\n # clear!\n self.items.each do |i|\n number = items[i.id].blank? ? 1 : items[i.id].to_i <= 0 ? 1 : items[i.id]\n number.to_i < 99 ? i.quantity = number.to_i : i.quantity=99\n end\n # items.each { |id, quantity| add_items(id, quantity) }\n end", "title": "" }, { "docid": "802de5e9047ed6465489b88c0039e718", "score": "0.72742337", "text": "def update_quantity(grocery_list, item_name, quantity)\n\tadd_item(grocery_list, item_name, quantity)\n\treturn grocery_list\nend", "title": "" }, { "docid": "4e4f2b46795f142441e02a8d6a55b4b6", "score": "0.7259778", "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": "d9baf5e1ded11b5859f5da76ce83edb9", "score": "0.7257903", "text": "def update_list(list, item, quantity)\n\tlist[item] = quantity\n\tp list\nend", "title": "" }, { "docid": "b1d602990c05f3c701b89b30642b6d88", "score": "0.725189", "text": "def update_quantity(name, quantity, list)\n list[name] += quantity\nend", "title": "" }, { "docid": "eff5969522bf18af1fcbb58badea295d", "score": "0.72504205", "text": "def update(list, item_name, quantity)\n\tlist[item_name] = quantity\nend", "title": "" }, { "docid": "9843d806dde1a6fb2b3dcfddd663e3a1", "score": "0.7231986", "text": "def update_quantity(grocery_list, item, quantity)\n grocery_list[item] = quantity\n grocery_list\nend", "title": "" }, { "docid": "8fe77bf2b56c41efa5e42017be98baec", "score": "0.7230588", "text": "def update_list(item,quantity,list)\n list[item]=quantity\nend", "title": "" }, { "docid": "edccc8301ef9ca53d78379bb4838432a", "score": "0.7227825", "text": "def update_quantity (grocery_list, item, quantity)\n\tif grocery_list[item] == nil\n\t\tputs \"Item not on list.\"\n\telse\n\t\tadd_item(grocery_list, item, quantity)\n\tend\n\treturn grocery_list\nend", "title": "" }, { "docid": "19a9e085a245a44de5745e77da852b09", "score": "0.7221411", "text": "def update_quantity(list, item, quantity)\n list[item] = quantity\n p list\nend", "title": "" }, { "docid": "4c6942135759895107f2ac382f878cba", "score": "0.72208977", "text": "def update_quantity(grocery_list, item, quantity)\n grocery_list[item] = quantity.to_i \n grocery_list\nend", "title": "" }, { "docid": "be2fe1ce6e8f2da72ea0fdd2d59db210", "score": "0.7220075", "text": "def update_quantity(grocery_list, item_name, qty = 1)\n\tgrocery_list = add_item(grocery_list, item_name, qty)\n\treturn grocery_list\nend", "title": "" }, { "docid": "8877932924df89174d5def72c84586fc", "score": "0.72195596", "text": "def update_quantity(grocery_list, item_name, qty = 1)\r\n\tgrocery_list = add_item(grocery_list, item_name, qty)\r\n\treturn grocery_list\r\nend", "title": "" }, { "docid": "df6b0682215a354f9901b2ef0fe13159", "score": "0.7213287", "text": "def update_quantity(list, string, integer)\n\tlist[string]=integer\n\treturn list\nend", "title": "" }, { "docid": "df6b0682215a354f9901b2ef0fe13159", "score": "0.7213287", "text": "def update_quantity(list, string, integer)\n\tlist[string]=integer\n\treturn list\nend", "title": "" }, { "docid": "02540a65b25192d586d402b3a0c2b30f", "score": "0.72095835", "text": "def update_quantity(grocery_list, item, quantity)\n grocery_list[item] = quantity\nend", "title": "" }, { "docid": "ee274a28d4b59c9840e82be4ddea8c09", "score": "0.7194969", "text": "def update_quanity(list, item_name, new_quantity)\n\n\tlist[item_name] = new_quantity\n\tp list\nend", "title": "" }, { "docid": "804ac7bb5eae921b589601fc552bced2", "score": "0.71914357", "text": "def update_qty(grocery_list, item, qty)\n grocery_list[item] = qty\n grocery_list\nend", "title": "" }, { "docid": "6220df500ce7cc81536fcc89669ed053", "score": "0.7183375", "text": "def update_list(new_list,item,new_qty)\n new_list[item]=new_qty\n return new_list\nend", "title": "" }, { "docid": "3d6a05dac98455f788426f7c6cbff6fb", "score": "0.71808594", "text": "def update_quantity(master_list, item, quantity)\n master_list.merge!(item => quantity)\n return master_list\nend", "title": "" }, { "docid": "51446dae8524e77a70b0e2c4757a4e37", "score": "0.7169252", "text": "def update_quan(list, item, quantity)\n list[item] = quantity\nend", "title": "" }, { "docid": "c62291669b48c0cd9b778b534db50ae0", "score": "0.7162224", "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": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "219fdda3b207ea07a262c469acdcbbf6", "score": "0.0", "text": "def set_location\n @location = Location.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": "" } ]
5e6abb6f044065ccf1214c4dc70051c0
Add and remove favorite recipes for current_user
[ { "docid": "9e1202fa185e511ef7fda6069c0b95ad", "score": "0.6074319", "text": "def favorite\n type = params[:type]\n if type == \"favorite\"\n current_user.favorites << @recipe\n redirect_to pages_favoritas_path, notice: 'You favorited #{@recipe.name}'\n\n elsif type == \"unfavorite\"\n current_user.favorites.delete(@recipe)\n redirect_back fallback_location: root_path, notice: 'Unfavorited #{@recipe.name}'\n\n else\n # Type missing, nothing happens\n redirect_to :back, notice: 'Nothing happened.'\n end\n end", "title": "" } ]
[ { "docid": "b2a55c7a7548411db39bebbd4291fb34", "score": "0.73621935", "text": "def add_recipe_to_favorites(recipe)\n UserFavorite.find_or_create_by_recipe_id_and_user_id(:recipe_id => recipe.id, :user_id => self.id)\n end", "title": "" }, { "docid": "7b190d53d478ae77ffe5f9e7e4920cc2", "score": "0.72514486", "text": "def update\n user = User.find_by(id: params[:user_id])\n recipe_id = params[:id]\n user_recipe_favorite = UserRecipeFavorite.new(user_id: user.id, recipe_id: recipe_id)\n authorize user_recipe_favorite\n if params[:favorite] == 'false' # if favorite is not checked\n user.user_recipe_favorites.where(recipe_id: recipe_id).first.destroy # remove recipe from favorites.\n elsif !user.user_recipe_favorites.exists?(recipe_id: recipe_id) # if favorite is checked but recipe doesn't exist in favaorites yet\n user.user_recipe_favorites.create(user_id: user.id, recipe_id: recipe_id) # add to recipe favorites\n end\n render json: {}\n end", "title": "" }, { "docid": "7e49786e095eb754baeb0432ed54f1fe", "score": "0.6840955", "text": "def toggle_favourite(user_id)\n if existing = favourites.find_by_user_id(user_id)\n favourites.delete(existing)\n else\n favourites.create!(:user_id => user_id)\n end \n end", "title": "" }, { "docid": "249a674cd445f7819f8472c20f0b81de", "score": "0.6799939", "text": "def index\n @user_favourite_recipes = UserFavouriteRecipe.where(user_id: current_user.id)\n end", "title": "" }, { "docid": "5d6f2e2e73fc52092b09c549535dcf6f", "score": "0.6747028", "text": "def add_to_my_recipes\n recipe = Recipe.find params[:id]\n @current_user.recipes << recipe\n redirect_to(:back)\n end", "title": "" }, { "docid": "9fef7f35926c410095152ccde1d74a11", "score": "0.6746402", "text": "def add_fav(user)\n raise StandardError, \"このアイテムのオーナー様は、アイテムをお気に入り登録できません\" if self.user_id == user.id\n user.favorites.create!(item_id: self.id)\n end", "title": "" }, { "docid": "109fbaee71b4536d9a858f33f67f5e51", "score": "0.66924506", "text": "def set_favorite_recipe\n @favorite_recipe = current_user.favorite_recipes.find(params[:id])\n end", "title": "" }, { "docid": "2b96200ee2c93acbd054b3118daf2513", "score": "0.6635331", "text": "def remove_from_favorites\n favorite = Favorite.find_by(user_id: self.id)\n favorite.delete\n end", "title": "" }, { "docid": "a365993d26f6ca2afbc11d787962d56e", "score": "0.6610958", "text": "def add_favorite(user)\n Favorite.create!(user: user, question: self)\n end", "title": "" }, { "docid": "c56c13cfb1e910985fb0a8991441d492", "score": "0.6608308", "text": "def favorite_from(user)\n if user.favorite_snippets.find_by(:id => self.id)\n self.fans.destroy(user)\n return \"Snippet removed from your favorites\"\n else\n self.fans << user\n return \"Snippet now in favorites\"\n end\n end", "title": "" }, { "docid": "94a4a3151911d3f2333a2b003270040b", "score": "0.6594178", "text": "def set_user_favourite_recipe\n @user_favourite_recipe = UserFavouriteRecipe.find(params[:id])\n end", "title": "" }, { "docid": "e1abad5d6b8f984e25ec2b8908d22714", "score": "0.65891045", "text": "def favorite\n @recipe = Recipe.find(params[:id])\n type = params[:type]\n if type == \"favorite\"\n current_user.favorites << @recipe\n redirect_to :back, notice: 'You favorited #{@recipe.name}'\n\n elsif type == \"unfavorite\"\n #@recipe = Recipe.find(params[:id])\n current_user.favorites.delete(@recipe)\n redirect_to :back, notice: 'Unfavorited #{@recipe.name}'\n\n else\n # Type missing, nothing happens\n redirect_to :back, notice: 'Nothing happened.'\n end\n end", "title": "" }, { "docid": "7f0b3261c6d87e2f99a51006e2c9c52d", "score": "0.6464857", "text": "def favorite?(user_id)\n user_recipe_favorites.exists?(user_id: user_id)\n end", "title": "" }, { "docid": "34666766118af365dfff993b28c82f9f", "score": "0.6438923", "text": "def favorite\n type = params[:type]\n if type == \"favorite\"\n if \n current_user.favorites.include?(@item)\n else\n current_user.favorites << @item\n end\n elsif type == \"unfavorite\"\n current_user.favorites.delete(@item)\n end\n end", "title": "" }, { "docid": "8e2e19a59510a18751a8e0c0959e924b", "score": "0.6412034", "text": "def user_favorite\n if params[:is_add] == '1'\n render json: UsersFavoriteRealEstate.add_favorite(params[:id])\n else\n render json: UsersFavoriteRealEstate.remove_favorite(params[:id])\n end\n end", "title": "" }, { "docid": "18b3d1a29cbb8642602e256ef4e3a60d", "score": "0.6396919", "text": "def switch_favourite\n if session[:user_id].nil?\n return \n end\n \n user = User.find(session[:user_id])\n user2 = User.find(params[:user_id])\n \n if user.get_favourites.include? user2\n user.remove_favourite(user2)\n else\n user.add_favourite(user2)\n end\n \n end", "title": "" }, { "docid": "b3a07407cea6446a9c8bacf3ca21ffe0", "score": "0.639043", "text": "def add_to_fav(user)\n return 'Invalid story' unless valid?\n return 'Oops, cannot fav your own story!' unless self.user != user\n\n begin\n user.favorites << self\n return user.save ? 'Faved!' : 'Please try again'\n rescue\n user.favorites.delete self\n return 'Unfaved'\n end\n end", "title": "" }, { "docid": "ea741d98b72564b50c51dbab8d0c5e75", "score": "0.6389794", "text": "def remove\n return if current_user == nil\n\n # Remove favorite\n radio_id = params[:id]\n Favorite.delete_all([\"radio_id = ? AND user_id = ?\", radio_id, current_user.id])\n\n respond_to do |format|\n format.json { render :json => {:msg => \"Removed from your list\", :status => :OK }}\n end\n end", "title": "" }, { "docid": "0f65608be3178dc23fb51fd712dfef49", "score": "0.636799", "text": "def set_favorites_recipe\n @favorites_recipe = FavoritesRecipe.find(params[:id])\n end", "title": "" }, { "docid": "0e3dfc86547a286b1d7e8093ca9825fc", "score": "0.6361553", "text": "def favorite(user_id)\n user = User.find_by(id: user_id)\n\n if not user.nil? and not user.favorites.include? self.id\n user.favorites << self.id\n user.save\n self.favorited << user.id\n self.save\n puts \"Added link# #{self.id} to user# #{user_id}'s favorites\"\n end\n end", "title": "" }, { "docid": "095fd7e31997474391387da53627d34b", "score": "0.63563615", "text": "def add_my_favorite \n favorites = Favorite.where(:idea_id => params[:idea_id], :user_id => current_user.id)\n \n go = true\n \n # check if favorite exists\n if favorites.count > 0\n go = false\n end\n \n # check if this is the current user\n if Idea.find(params[:idea_id]).user.id == current_user.id\n go = false\n end\n \n if go == true\n f = Favorite.new\n f.user_id = current_user.id\n f.idea_id = params[:idea_id]\n f.save\n end\n \n respond_to do |format|\n format.html { redirect_to(idea_path(params[:idea_id])) }\n end\n \n end", "title": "" }, { "docid": "bf06455b19bc51958f82962f2cb52c3c", "score": "0.6322289", "text": "def favorite\n type = params[:type]\n @recipe = Recipe.find(params[:id])\n if type == \"favorite\"\n #current_user.favorites << @recipe\n current_user.favorites << @recipe\n redirect_to :back, notice: 'Sikeresen kedvencnek jelölted: ' + @recipe.name\n\n elsif type == \"unfavorite\"\n current_user.favorites.delete(@recipe)\n redirect_to :back, notice: 'Sikeresen törölted a kedvencek közül: '+@recipe.name\n\n else\n # Type missing, nothing happens\n redirect_to :back, notice: 'Nothing happened.'\n end\n end", "title": "" }, { "docid": "e50f72d3cfffdb59ba97801d1439906a", "score": "0.62699103", "text": "def toggle_favorite(user)\n scope = Activity.for_subject(self).for_owner(user).where(action: \"favorite\")\n\n if activity = scope.first\n activity.destroy\n false\n else\n scope.create\n true\n end\n end", "title": "" }, { "docid": "1288f9a03e06a5a80669926cddbec240", "score": "0.62672883", "text": "def users_favorites\n\tputs \"Creating Users and Favorites\"\n\tUser.delete_all\n\tFavorite.delete_all\n\talphabet = \"a\"\n\t20.times do \n\t\tu = User.create(email: \"#{alphabet}@#{alphabet}.com\", password: \"a\")\n\t\tputs \"USER: #{u.email}(#{u.id})\"\n\t\t20.times do\n\t\t\trandom_recipe = Recipe.all.sample.id\n\t\t\twhile !(Favorite.find_by(user_id: u.id, recipe_id: random_recipe)).nil?\n\t\t\t\trandom_recipe = Recipe.all.sample.id\n\t\t\tend\n\t\t\tf = Favorite.create(user_id: u.id, recipe_id: random_recipe)\n\t\t\tputs \"\\tFAVORITE: #{f.recipe.name}(#{f.id})\"\n\t\tend\n\t\talphabet.next!\n\tend\nend", "title": "" }, { "docid": "fc5bb4c4b34dcb224bbb636c40683645", "score": "0.6180378", "text": "def defavorite_from(user)\n if user.favorite_snippets.find_by(:id => self.id)\n user.favorite_snippets.destroy(self)\n return \"Snippet correctly removed from favorites\"\n else\n return \"Snippet not in favorites\"\n end\n end", "title": "" }, { "docid": "27cc01c7747b1aa1795df335b5680ef6", "score": "0.61710054", "text": "def set_favoritelist\n @favoritelist = current_user.favoritelist || current_user.create_favoritelist\n end", "title": "" }, { "docid": "4a3582b5ed034efdccd97893a1173663", "score": "0.6162898", "text": "def toggle_favorite\n is_favorite = false\n\n favorite = Favorite.where(:item_id => params[:item_id], :user_id => current_user.id).first\n\n if favorite.nil?\n favorite = Favorite.new\n favorite.item_id = params[:item_id]\n favorite.user_id = current_user.id\n favorite.save\n is_favorite = true\n else\n favorite.delete\n is_favorite = false\n end\n respond_to do |format|\n format.json { render :json => {favorite: is_favorite}.to_json }\n end\n end", "title": "" }, { "docid": "78ef6de4a95c93ce116d9f42394d0c92", "score": "0.6140335", "text": "def toggle_favorite\n current_user.favorited?(@task) ? current_user.unfavorite(@task) : current_user.favorite(@task)\n end", "title": "" }, { "docid": "0635fc28ffaec183b8048aaa3ba81896", "score": "0.6123287", "text": "def remove\n current_user.favorites.find(params[:favorite]).destroy\n redirect_to '/users/profile'\n end", "title": "" }, { "docid": "56d8f5795baadb7c2a2c70266ae7c126", "score": "0.6098277", "text": "def add_pro_favorite?(pro_user)\n # Add a tasks to search in a favorite DB table\n end", "title": "" }, { "docid": "e5f783fe186246fbef3c22df4edd0666", "score": "0.6096753", "text": "def favorite\n current_user.wineries << @winery\n redirect_to current_user\n end", "title": "" }, { "docid": "aa878034f887929c232821bc771724fd", "score": "0.6083395", "text": "def favorite\n if Favorite.where(user_id: current_user.id, link_id: params[:id]).exists?\n Favorite.where(user_id: current_user.id, link_id: params[:id]).destroy_all\n else\n Favorite.create(user_id: current_user.id, link_id: params[:id])\n end\n redirect_to :back\n end", "title": "" }, { "docid": "0d8bdb10b314609fe29d995eaa4951f4", "score": "0.6079438", "text": "def favourites\n @favourite_tasks = current_user.favorited_by_type('Task')\n end", "title": "" }, { "docid": "314818145028d9e31e1e755848776d4c", "score": "0.6057082", "text": "def get_favorites(user)\n @favorites = Favorite.where(user_id: user.id)\n unless @favorites.nil?\n item_ids = []\n @favorites.each do |favorite|\n item_ids << favorite.item_id\n end\n @favorite_items = Item.find(item_ids)\n end\n end", "title": "" }, { "docid": "7de64c5607f1b521387e08f7d103adc8", "score": "0.60313547", "text": "def post_favorite\n if current_user != nil\n if object.favorites.exists?(user_id: current_user.id)\n object.favorites.where(user_id: current_user.id).first\n else\n Favorite.new\n end\n else\n Favorite.new\n end\n end", "title": "" }, { "docid": "8fd19a48c9f2db22d559b977c3edaf1e", "score": "0.60212845", "text": "def remove_from_favorites\n\t\tcurrent_user.favorites.delete(params[:id])\n\t\n\t\trespond_to do |format|\n\t\t\tformat.json {render :json => {:message => \"success\"}}\n\t\tend\n\tend", "title": "" }, { "docid": "65f2110555a3a0e4c08d3c100bbaa07c", "score": "0.5999764", "text": "def add\n return if current_user == nil\n\n # Check if radio already exists\n radio_id = params[:id]\n current_user_id = current_user.id\n radios = Favorite.where(\"radio_id = #{radio_id} AND user_id = #{current_user_id}\")\n\n # Add radio if it doesn't exist\n if radios != nil && radios.size == 0\n @favorite = Favorite.new(:radio_id => radio_id, :user_id => current_user_id)\n @favorite.save\n result = {:notificationMsg => \"Added to your list\", :newMsg => \"[Remove from your favorites]\", :status => :OK }\n else\n result = {:notificationMsg => \"Already in your list\", :newMsg => \"[Add to favorites]\", :status => :ERROR }\n end\n\n respond_to do |format|\n format.json { render :json => result }\n end\n\n end", "title": "" }, { "docid": "2a637139c003845f4d9482dae224eaee", "score": "0.599736", "text": "def addIngredient\n\t\tif user_signed_in?\n\t\t\tif User.exists?(current_user.id)\n\t\t\t\tUser.find(current_user.id).recipes.find(params[:id]).ingredients.push(Ingredient.find(params[:ingredient_id]))\n\t\t\t\t@success = true\n\t\t\telse\n\t\t\t\t@success = false\n\t\t\tend\n\t\telse\n\t\t\t@success = false\n\t\tend\n\tend", "title": "" }, { "docid": "968e148112bb1ebb843283eaf685c3fa", "score": "0.5989245", "text": "def undo_favorite\n request('favorite/undo').auth_required!\n end", "title": "" }, { "docid": "8b29a834d957bebf0a1963c303098287", "score": "0.5987893", "text": "def add_to_user_favorites(user_passed)\n FavoritePokemon.create(user: user_passed, pokemon: self)\n\n system(\"clear\")\n puts \"\\n#{name.capitalize} added to Favorites. There is a strong bond between you and #{name.capitalize}.\".light_green\n\n # Return user to main_menu\n user_passed.main_menu\n end", "title": "" }, { "docid": "834a33a7cdc965800f70a999d9c5cea0", "score": "0.59865683", "text": "def favorite_params\n params.require(:favorite).permit(:recipe_id, :user_id)\n end", "title": "" }, { "docid": "ac9d459973241cbf6d54e47dbb80388f", "score": "0.59858954", "text": "def remove_from_user_favorites(user_passed)\n favorite_pokemon.find_by(user: user_passed).delete\n\n system(\"clear\")\n puts \"\\n#{name.capitalize} was removed from Favorites. You hurt #{name.capitalize}'s feelings, but it forgives you.\".light_green\n\n # Return user to main_menu\n user_passed.main_menu\n end", "title": "" }, { "docid": "9bb8031d4d81922220176983f2389cb0", "score": "0.59852153", "text": "def set_favorite\n @favorite = Favorite.find(params[:user_id])\n end", "title": "" }, { "docid": "2c7db8e9a233171baca8d0ecfa4a3241", "score": "0.5958707", "text": "def remove_favor favoriter\n ActsAsFavorite::Favorite.find_for(self, favoriter).delete_all\n reload && favoriter.reload\n end", "title": "" }, { "docid": "487d90e6bb0810d519db53dd7179b651", "score": "0.594875", "text": "def user_recipes\n @recipes = Recipe.all\n end", "title": "" }, { "docid": "d8852ac25b017fcc5e21fce711831d8c", "score": "0.59465015", "text": "def delete_from_my_recipes\n recipe = Recipe.find params[:id]\n @current_user.recipes.delete( params[:id] )\n redirect_to(:back)\n end", "title": "" }, { "docid": "5de90dae190d06b47ffa49fd7fc58303", "score": "0.594471", "text": "def record_favorite\n unless current_user.nil?\n if params[:actionToDo] == 'add'\n if current_user.emotes.count <= current_user.favorites_count\n \n favorite_emote = FavoriteEmote.where :user_id => current_user.id, :emote_id => params[:id]\n emote = Emote.find(params[:id])\n \n # Update the popularity value by 4\n # emote.popularity = emote.popularity + 4\n # emote.popularity.incr 4\n Emote.popularity.incr(emote.id, 4)\n emote.favorites.increment\n emote.favorites_all_time.increment\n \n if favorite_emote.empty?\n favorite_emote = FavoriteEmote.new\n favorite_emote.user_id = current_user.id\n favorite_emote.emote_id = params[:id]\n favorite_emote.save\n \n render :text => \"#{emote.text} successfully saved as a favorite.\"\n else\n render :text => \"#{emote.text} is already saved as a favorite.\"\n end\n else\n render :text => \"You have reached your maximum allocation of favorites.\"\n end\n elsif params[:actionToDo] == 'remove'\n favorite_emote = FavoriteEmote.where :user_id => current_user.id, :emote_id => params[:id]\n emote = Emote.find(params[:id])\n\n Emote.popularity.decr(emote.id, 2)\n emote.favorites.decrement\n #emote.popularity = emote.popularity - 2\n \n unless favorite_emote.empty?\n favorite_emote.first.destroy\n\n render :text => \"#{emote.text} favorite successfully deleted.\"\n else\n render :text => \"No favorite for #{emote.text} found.\"\n end\n end\n end\n end", "title": "" }, { "docid": "567ab7614f88632c080fcff4ebf57856", "score": "0.5944611", "text": "def add_favorite(playlist)\n Favorite.create(playlist_id: playlist.id, user_id: self.id)\n end", "title": "" }, { "docid": "e1855e2c3fbc643f2b936bfa68d09834", "score": "0.59436524", "text": "def set_favorite\n @favorite = Favorite.find_by(user_id: current_user.id, tutorial_id: params[:id])\n end", "title": "" }, { "docid": "4b28ce4d56a21120c4a65b062f91f196", "score": "0.5937975", "text": "def favorites\n Favorite.all.filter do |favorite|\n favorite.user_id === self.object.id\n end\n end", "title": "" }, { "docid": "65d66cf515a6e28f2e1e31dd42bd3a1d", "score": "0.5936903", "text": "def find_my_favorite(user)\n user && self.favorites.find_by_user_id( user.id )\n end", "title": "" }, { "docid": "5711adbc604a095d2d21e859c5536939", "score": "0.5903486", "text": "def favourite\n\t\t@favourite_check = current_user.favourites.where(\"user_id = ? and post_id = ? \",current_user.id, params[:id])\n\t\t@favourite = current_user.favourites.build(post_id: params[:id])\n\t\trespond_to do |format|\n\t\t\tif @favourite_check.exists?\n\t\t\t\t@favourite_check.delete_all\n\t\t\t\tformat.js\n\t\t\telse\n\t\t\t\t@favourite.save\n\t\t\t\tformat.js\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "aa5e370f8daf534ad5726761560096fa", "score": "0.5898579", "text": "def favorite\n @event = Event.find(params[:id])\n if !current_user.favorites.include?(@event)\n current_user.favorites << @event\n else\n current_user.favorites.delete(@event)\n end\n respond_to do |format|\n format.html { redirect_to events_path }\n format.js { render :nothing => true }\n end\n end", "title": "" }, { "docid": "9e625d4757682c2644dfc6dd4ace7348", "score": "0.58838654", "text": "def load_user_love_recipes(user = @current_user)\n @love_recipes_set = love_recipes(user, '21')\n @love_recipes_set_count = @love_recipes_set.size\n end", "title": "" }, { "docid": "a808736a78cdf11e6febc93b2cb056bc", "score": "0.58753145", "text": "def create\n @story.favers << current_user\n update\n end", "title": "" }, { "docid": "0225777c8a0b37425003932f8776d864", "score": "0.5861946", "text": "def favorited_toggle\n # 1. get token\n # byebug\n token = request.headers[\"Authorization\"]\n # 2. Decode token to get user info, specifically the id\n user_id = JWT.decode(token, ENV[\"MIXIT_SECRET\"], true, {algorithm: 'HS384'})[0][\"user_id\"]\n # 3. Using the user_id and the drink_id, see if a userDrink already exists in UserDrink.all\n @user_drink = UserDrink.find_by(user_id: user_id, drink_id: params[:id]) #not found => nil\n #\n # If drink exists in UserDrinks already, and is NOT favorited already, then favorite it\n if already_exists?(@user_drink) && @user_drink.favorited != true\n @user_drink.update(favorited: true)\n elsif already_exists?(@user_drink) && @user_drink.favorited === true\n # If @user_drink is in UserDrinks, but is ALREADY favorited, unfavorite it\n @user_drink.update(favorited: false)\n else\n # If drink doesn't exist in UserDrinks, then make a new entry and mark as favorited\n @user_drink = UserDrink.create(\n user_id: user_id,\n drink_id: params[:id],\n favorited: true\n )\n end\n # Finally, render the favorited state of the drink\n render json: @user_drink\n end", "title": "" }, { "docid": "d07059c90cc615c7445edc72048bed87", "score": "0.585714", "text": "def remove_favorite\n puts \"Triggered remove_favorite action\"\n\n @fave_to_delete_arr = Favorite.where(\n user_id: params[:user_id],\n source: params[:source]\n )\n # .delete or destroy only takes the Id of the row in the favorites table\n @delete_favorite = Favorite.delete(@fave_to_delete_arr[0].id)\n puts @delete_favorite\n end", "title": "" }, { "docid": "ea2dcae1085108ed0f94fd10d30c05df", "score": "0.5853628", "text": "def add_favorite(puppy)\n if self.favorites.where(id: puppy.id).empty?\n FavoritePuppy.create(user: self, puppy: puppy)\n end\n end", "title": "" }, { "docid": "4220e950b2ce02981da3982dc2a15842", "score": "0.58419585", "text": "def create\n # recipe = Recipe.create(recipe_params)\n # current_user.recipe << recipe\n recipe = current_user.recipes.create(recipe_params)\n redirect_to recipe_path(recipe)\n end", "title": "" }, { "docid": "a84ffa516454e3f9c59ceb8987f3f54e", "score": "0.5836371", "text": "def set_fav_recipe\n @fav_recipe = FavRecipe.find(params[:id])\n end", "title": "" }, { "docid": "671fa3fb58cc95547dadb6720785c16f", "score": "0.5833926", "text": "def index\n save_user_pref(current_user)\n @menu = current_user.menus.empty? ? create_menu : current_user.menus.last \n \n if current_user.user_ingredients.count == 0 \n @menu.recipes.each do |recipe|\n recipe.ingredients.each do |ingredient|\n create_user_ingredients(ingredient, recipe)\n end\n end\n end\n\n @user_ingredients = policy_scope(current_user.user_ingredients) \n\n end", "title": "" }, { "docid": "e98fa56226e18066d4be4c9b03710524", "score": "0.5833151", "text": "def set_favorite\n @favorite = Favorite.find(user_id: @authenticated_user_id, id: params[:id])\n end", "title": "" }, { "docid": "1aa0954c959e7393824a403e78334d69", "score": "0.5824177", "text": "def add_as_favorite(service)\n favorites.create(service_id: service.id)\n end", "title": "" }, { "docid": "078cfcaaf2ed670c84700a3ab1d61843", "score": "0.5821946", "text": "def favorite\n if @crossword && @current_user\n if @current_user.favorites.include? @crossword\n alert_js('You have already favorited that crossword.')\n else\n if FavoritePuzzle.create(user_id: @current_user.id, crossword_id: @crossword.id)\n render :favorite_unfavorite\n end\n end\n end\n end", "title": "" }, { "docid": "bcedaf4db2d2983543b2aec8b6fb1108", "score": "0.5819121", "text": "def destroy\n @viewer.listrecipes(@cookbook.all)\n index = @viewer.ask_user_for_index.to_i - 1\n @cookbook.remove_recipe(index)\n @viewer.listrecipes(@cookbook.all)\n end", "title": "" }, { "docid": "ae8cbf17837806d0e40d873a04209ef9", "score": "0.5815737", "text": "def favorite\n @item = Item.find(params[:id])\n type = params[:type]\n if type == \"favorite\"\n current_user.favorites << @item\n redirect_to \"/ootds\", notice: 'Item was saved to your favorites!'\n\n elsif type == \"unfavorite\"\n current_user.favorites.delete(@item)\n redirect_to \"/ootds\", notice: 'Item was unsaved from your favorites!'\n\n else\n # Type missing, nothing happens\n redirect_to \"/ootds\", notice: 'Nothing happened.'\n end\n end", "title": "" }, { "docid": "1f0ab09249dc0be4c5d87f41d24df44e", "score": "0.58115906", "text": "def act_as_favorite_new(listing, favorites=nil, with_label = false, as_link = false)\n listing_id = listing.id\n\n if not user_signed_in? or favorites.nil? or listing.account == current_user.account\n return\n end\n\n # Remove links generated if the listing already is a favorite on the account\n if favorites.include?(listing_id.to_s)\n if with_label\n return link_to(content_tag('i','', class: 'icon-heart icon-white') + content_tag('span', t('global.unfavorite')), favorite_url(listing_id), remote: true, method: :delete, class: 'btn btn-warning bookmarked text', id: \"favorite-#{listing_id}\")\n end\n\n if as_link\n return link_to(content_tag('i','', class: 'icon-heart') + ' ' + t('favorites.remove_as_favorite'), favorite_url(listing_id), remote: true, method: :delete, class: 'btn btn-link bookmark link', id: \"favorite-#{listing_id}\")\n end\n\n return link_to(content_tag('i','', class: 'icon-heart icon-white'), favorite_url(listing_id), remote: true, method: :delete, class: 'btn btn-warning btn-small bookmarked', id: \"favorite-#{listing_id}\", title: t('favorites.delete'))\n end\n\n # Create links generated if the listing isn't a favorite on the account\n if with_label\n return link_to(content_tag('i','', class: 'icon-heart') + content_tag('span', t('global.favorite')), add_as_favorite_url(listing_id), remote: true, class: 'btn bookmark text', id: \"favorite-#{listing_id}\")\n end\n\n if as_link\n return link_to(content_tag('i','', class: 'icon-heart') + ' ' + t('listing.add_as_favorite'), add_as_favorite_url(listing_id), remote: true, class: 'btn btn-link bookmark link', id: \"favorite-#{listing_id}\")\n end\n\n link_to(content_tag('i','', class: 'icon-heart'), add_as_favorite_url(listing_id), remote: true, class: 'btn btn-small bookmark', title: t('listing.add_as_favorite'), id: \"favorite-#{listing_id}\")\n end", "title": "" }, { "docid": "9390baf23adf088e1461355977a54631", "score": "0.58061147", "text": "def favorite_user(user_id)\n\t\tfavorites.find_by(user_id: user_id)\n\tend", "title": "" }, { "docid": "a2e2347c3da4a795e07b1d79e6583edc", "score": "0.58005667", "text": "def favorite\n turing_machine = TuringMachine.find(params[:id])\n user = User.find(session[:user_id])\n if not user.like_ids.include? turing_machine.id\n turing_machine.increase_users_count\n user.likes << turing_machine\n end\n \n respond_to do |format|\n format.html { redirect_to :back }\n format.json { render :json => { 'favorited' => true, 'href' => unfavorite_turing_machine_path(turing_machine), 'users_count' => turing_machine.users_count } }\n end\n end", "title": "" }, { "docid": "a5c17e9aacde4ac71a80fc8d07cdcd49", "score": "0.5797662", "text": "def favorites\n handle_error { sendsecure_connection.get(\"api/v2/enterprises/#{@enterprise_account}/users/#{@user_id}/favorites.json\") }\n end", "title": "" }, { "docid": "18bc97950cff75fc9da5511df981154c", "score": "0.57618576", "text": "def favorite\n \tuser = current_user\n \tvenue = Venue.find_by(id: params[:venue_id])\t\n \tuser.favorites.include?(venue) ? user.favorites.delete(venue) : user.favorites << venue\n \trender json: user,\n \t\tinclude: ['favorites']\n end", "title": "" }, { "docid": "c6038a4adf7b3a00a16dd29bf76faed9", "score": "0.57532", "text": "def add\n\t\t@id = nil\n\t\tif user_signed_in?\n\t\t\tif User.exists?(current_user.id)\n\t\t\t\tu = User.find(current_user.id).recipes.create(:title => params[:title], :description => params[:description])\n\t\t\t\t@success = true\n\t\t\t\t@id = u.id\n\t\t\telse\n\t\t\t\t@success = false\n\t\t\tend\n\t\telse\n\t\t\t@success = false\n\t\tend\n\tend", "title": "" }, { "docid": "204511f357fb75826b272bd4d754d849", "score": "0.57481205", "text": "def unfavorite\n self.favorited = false\n self.save!\n end", "title": "" }, { "docid": "584eadf0990de6fb51a4a9e6259e08e8", "score": "0.5742764", "text": "def load_user_love_recipes(user = nil)\n @love_recipes_set = love_recipes(user, '21')\n @love_recipes_set_count = @love_recipes_set.size\n end", "title": "" }, { "docid": "75a9fc1dd289d23187d5b83454141d5f", "score": "0.574207", "text": "def index\n @recipes = Recipe.where(\"user_id = ?\", current_user.id)\n end", "title": "" }, { "docid": "8a2e556b5e6a673ae5edbd076409b524", "score": "0.5742037", "text": "def set_user_favorite_list\n @user_favorite_list = UserFavoriteList.find(params[:id])\n end", "title": "" }, { "docid": "4eac70cf646994396b0ea508bea5c55f", "score": "0.5741851", "text": "def index\n @recipes = current_user.recipes\n end", "title": "" }, { "docid": "e30761cce2a5ff0ae7bde70391e62a28", "score": "0.5738294", "text": "def post_favorite\n if object.favorites.exists?(user_id: current_user.id)\n object.favorites.where(user_id: current_user.id).first\n else\n Favorite.new\n end\n end", "title": "" }, { "docid": "f7cd6f1110cbad686f20661c884a3ab9", "score": "0.5737277", "text": "def add_to_favorite\n if current_user.favorites.count == 0\n current_user.favorites.create\n end\n answer = Answer.find(params[:answer_id])\n if not current_user.favorites[0].answers.to_a.include? answer\n #current_user.favorites[0].answers.to_a << Answer.find(params[:answer_id])\n @favorite = current_user.favorites[0]\n @favorite.answers << answer\n @favorite.save\n current_user.favorites[0].inc(answers_count: 1)\n redirect_to question_path(answer.question.id, page: (answer.question.answers.desc(:votes, :created_at).to_a.index(answer) / Answer.default_per_page + 1), anchor: answer.id), notice: 'Created successfully'\n else\n redirect_to question_path(answer.question.id, page: (answer.question.answers.desc(:votes, :created_at).to_a.index(answer) / Answer.default_per_page + 1), anchor: answer.id), notice: 'Favorites already contain this answer'\n end\n end", "title": "" }, { "docid": "443c010e442d44ca6f4feabe8e0e9014", "score": "0.57360137", "text": "def remove_favor favorable\n ActsAsFavorite::Favorite.find_for(favorable, self).delete_all\n reload && favorable.reload\n end", "title": "" }, { "docid": "64a90153ace391613dc7ebb1a52f8487", "score": "0.57294554", "text": "def favorite\n type = params[:type]\n @restaurant = Restaurant.find(params[:id])\n if type == \"favorite\"\n\n current_user.favorites << @restaurant\n redirect_to :back, notice: 'You favorited the restaurant succesfully.'\n elsif type == \"unfavorite\"\n current_user.favorites.delete(@restaurant)\n redirect_to :back, notice: 'Unfavorited the restaurant succesfully.'\n else\n redirect_to :back, notice: 'Nothing happened'\n end\n end", "title": "" }, { "docid": "98fc67967a1a6654f7b09d9cbe1a0583", "score": "0.57279557", "text": "def create\n @recipe = current_user.recipes.new(recipe_params)\n if @recipe.save\n @recipe.add_ingredients(recipe_ingredient_params)\n redirect_to recipe_path(@recipe)\n else\n render :new\n end\n end", "title": "" }, { "docid": "9e6545774c2858b35e48592fca5654e6", "score": "0.5726697", "text": "def index\n @favorites_recipes = FavoritesRecipe.all\n end", "title": "" }, { "docid": "4c9ef6968048875ad22f4f996e642315", "score": "0.5697659", "text": "def user_favourites(current_user: , product:)\n Favourite.where(user_id: current_user, product_id: product).exists?\n end", "title": "" }, { "docid": "117c777bacbcdbcade6d9ed467ddfdfe", "score": "0.56937003", "text": "def index\n\n @recipes = Recipe.all.where(user_id: current_user.id)\n\n end", "title": "" }, { "docid": "816f3c797533a84f14b41b2b99d8846e", "score": "0.56890136", "text": "def remove_from_favorite\n @structure = Structure.find(params[:id])\n @structure.user_favorites.where(user_id: current_user.id).first.try(:destroy)\n respond_to do |format|\n format.html { redirect_to user_followings_path(current_user), notice: \"#{@structure.name} n'est plus dans vos favoris\"}\n format.json { render json: { succes: true } }\n end\n end", "title": "" }, { "docid": "7767621ca52b3ed6bc18c9ae220f23b2", "score": "0.5687507", "text": "def favorites(user=nil)\n self.class.visibility_filter(favorites_list.saved_items(user),'saved_items',user)\n end", "title": "" }, { "docid": "0c6541f3cc387a74a7002779b2bac464", "score": "0.5684724", "text": "def favorite\n self.favorited = true\n self.save!\n end", "title": "" }, { "docid": "53dfaba7e176b20785958455dae7cf95", "score": "0.56846255", "text": "def set_user_favorite\n @user_favorite = UserFavorite.find(params[:id])\n end", "title": "" }, { "docid": "1c3c3f0b96dc71b893b0f503a66324a3", "score": "0.5683606", "text": "def destroy\n @users_favorite.destroy\n end", "title": "" }, { "docid": "e268cd05ca32167b9afaf55039a6f5cf", "score": "0.56791097", "text": "def add_favorite(options={})\n response = get(\"add_favorite/\", options)\n end", "title": "" }, { "docid": "cd99776176d2e3d8bcf73556a252a5a4", "score": "0.56751925", "text": "def user_recipes(user, object)\n object.recipes.select{|r| r.user == user }\n end", "title": "" }, { "docid": "25640abc1a6959f80d1690b87670811c", "score": "0.56747484", "text": "def favorite!\n self.favorite = true\n self.save!\n end", "title": "" }, { "docid": "3961cad809a33221bdd2b49f03d2db69", "score": "0.56742805", "text": "def likes\n @user = find_current_user()\n @user.add_to_favorites(params[:id])\n respond_to do |format|\n format.html { redirect_to shops_url, notice: 'Shop was successfully liked.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1a72e26d300efff511623aa8a096c3fc", "score": "0.56735355", "text": "def destroy\n recipe = Recipe.find(params[:id])\n if current_user.recipes.include? recipe\n recipe.destroy\n respond_to do |format|\n format.html { redirect_to recipes_url }\n format.json { head :no_content }\n end\n else\n redirect_to recipes_url\n end\n end", "title": "" }, { "docid": "d1cf701c425ab227cd271d21e3f011b6", "score": "0.567106", "text": "def user_favorites(user_id, options={})\n self.class.get(\"/users/#{user_id}/favorites\", options)\n end", "title": "" }, { "docid": "315428df6b9ff850581fa7df8882e1ef", "score": "0.56582665", "text": "def create\n restaurant = find_restaurant\n\n current_user.favorite_restaurants << restaurant\n\n expose current_user.favorite_restaurants\n end", "title": "" }, { "docid": "c67b953a39c864cc035153b939ec7174", "score": "0.5656666", "text": "def create_favorites\n self.cook_books << CookBook.new(name: \"Favorites\", description: \"This recipes I love!\")\n end", "title": "" }, { "docid": "cadefabbb00dfd22cf883a962ead96b2", "score": "0.5648952", "text": "def set_favourite\n @favourite = @user.favourites.find(params[:id])\n end", "title": "" }, { "docid": "2d5fbde6626e9810280179d9b5157038", "score": "0.56463885", "text": "def show\n @recipe_instruction_phases = RecipeInstructionPhase.where(recipe_id: @recipe.id).order(phase: :asc)\n unless current_user.nil?\n @favorite_recipe = FavoriteRecipe.find_by(user_id: current_user.id, recipe_id: @recipe.id)\n end\n end", "title": "" } ]
169ca518c86684abf5bb6f2d660b0c6e
GET /blabs GET /blabs.json
[ { "docid": "22964602fb3c6e77bab5bd9c6a46d3b2", "score": "0.7193773", "text": "def index\n\t\t@search = Blab.search(params[:q])\n\t\t@blabs = @search.result\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blabs }\n end\n end", "title": "" } ]
[ { "docid": "a83730b65ceaefadc49a3ce371b518df", "score": "0.692829", "text": "def index\n @labs = Lab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @labs }\n end\n end", "title": "" }, { "docid": "7737786d9969d55bc4ef094a74eb8219", "score": "0.66876465", "text": "def show\n @blab = Blab.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blab }\n end\n end", "title": "" }, { "docid": "19a8c06841a4e671d674d0c09c74a0a9", "score": "0.66106457", "text": "def breaches(domain=\"\")\n get_resource('https://haveibeenpwned.com/api/v3/breaches',{:domain => \"\"})\nend", "title": "" }, { "docid": "7690dcc3a44f522ec4bb0e6d5f2ed57c", "score": "0.6580315", "text": "def index\n @blabs = Blab.all.includes(:author)\n #the only way to pass information from controller to view is to use\n #instance variables\n #local variables will not be passed to the view\n\n # render json: blabs\n # render :test #this is the block given to the \"yield\" in application.html.erb\n #rails knows where to find this test view inside the blabs folder\n #and finds test.html.erb\n render :index\n #RESTful convention is we want to match the name of the controller action\n end", "title": "" }, { "docid": "fd26d6d1919c1b08fd0491c9ee7f0cee", "score": "0.6514569", "text": "def index\n @vet_labs = VetLab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @vet_labs }\n end\n end", "title": "" }, { "docid": "e53faa80d9855021f3852cb124bb4a5f", "score": "0.6510497", "text": "def index\n @blerts = Blert.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blerts }\n end\n end", "title": "" }, { "docid": "3764d923c50d9f0636832ef563f91921", "score": "0.6375707", "text": "def show\n @lbb = Lbb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lbb }\n end\n end", "title": "" }, { "docid": "7512436056673fdbf94e6aa6303b9189", "score": "0.6285706", "text": "def index\n @lab_badges = LabBadge.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @lab_badges }\n end\n end", "title": "" }, { "docid": "9d8eaf1129d12732e19f81cb3dec9ac4", "score": "0.6254609", "text": "def index\n @brain_candies = BrainCandy.includes(:difficulty_level).all\n\n respond_to do |format|\n format.html # index.html.erb.erb\n format.json { render json: @brain_candies }\n end\n end", "title": "" }, { "docid": "75990965d19a658128ff0f7ba2d4c485", "score": "0.6247237", "text": "def index\n # index page ordering all blabs by newest first (Top-down)\n @blabs = Blab.all.order(\"created_at DESC\")\n end", "title": "" }, { "docid": "89dc3b117bc719b8f695fa52670150f2", "score": "0.6242241", "text": "def index\n @budgets = Budget.all\n render json: @budgets\n end", "title": "" }, { "docid": "674b572127b1855ef3252684646bc7f9", "score": "0.62347627", "text": "def get_blasts()\n exec_get(\"#{@base_path}/api/v2/customers/blasts.json?api_key=#{@api_key}\")\n end", "title": "" }, { "docid": "d33ca622d968f9f3f1eb3f66cdd13f08", "score": "0.6207811", "text": "def index\n @labours = Labour.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @labours }\n end\n end", "title": "" }, { "docid": "ddc034b58d152ff4ed0ce2cfa51a6a50", "score": "0.6207659", "text": "def get(path)\n response = kolkrabbi_client.get do |request|\n request.url path\n request.headers[\"Content-Type\"] = \"application/json\"\n request.headers[\"Authorization\"] = \"Bearer #{client.heroku.token}\"\n end\n\n JSON.parse(response.body)\n end", "title": "" }, { "docid": "e27729d4ea768b422214fdf952e2065f", "score": "0.61771387", "text": "def get_brandings\n request :get,\n '/v3/brandings.json'\n end", "title": "" }, { "docid": "38c771c2ba8b2b248667b81304eeb7ec", "score": "0.615727", "text": "def show\n @labs = Lab.where(:lab_rack_id => params[:id])\n end", "title": "" }, { "docid": "32e283a990f7c45d92d68affd2344f34", "score": "0.6145737", "text": "def index\n @bmps = Bmp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bmps }\n end\n end", "title": "" }, { "docid": "f89751be9c95c4af1d2e1cae4c4ab3c5", "score": "0.6141848", "text": "def test_get_all_brands\n get 'brands.json'\n data = JSON.parse last_response.body\n assert(0 != data.length)\n end", "title": "" }, { "docid": "f7f8d2c8859a8e08d00f8c345c8c4234", "score": "0.6140656", "text": "def index\n @baosong_bs = BaosongB.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @baosong_bs }\n end\n end", "title": "" }, { "docid": "b927d9e5a8b214a777c81b986e0cf48f", "score": "0.6111258", "text": "def brands\n call_api('/brands')\n end", "title": "" }, { "docid": "7e4343abaf36e23c9f20df39c8cef898", "score": "0.6102282", "text": "def index\n @biblebooks = Biblebook.all\n\n respond_to do |format|\n format.html\n format.json{ render json: @biblebooks, root: false}\n end\n end", "title": "" }, { "docid": "2695f265ee3aac4aed7f07bde49fab5a", "score": "0.6096095", "text": "def index\n @branches = Api::V1::Branch.all\n\n render json: @branches\n end", "title": "" }, { "docid": "4ab10e014bac730641fa6f3844256f1b", "score": "0.60835356", "text": "def get_house_bills_from_api\n api_url = \"https://api.propublica.org/congress/v1/115/house/bills/passed.json\"\n response_string = RestClient::Request.execute(\n :method => :get,\n :url => api_url,\n :headers => {\"X-API-Key\" => ENV['PRO_PUBLICA_API_KEY']}\n )\n response_hash = JSON.parse(response_string)\nend", "title": "" }, { "docid": "2f6c2d8d3842fb342cf729ef008754fb", "score": "0.6048857", "text": "def bundles_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: DefaultApi.bundles ...\"\n end\n # resource path\n local_var_path = \"/bundles.json\".sub('{format}','json')\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # HTTP header 'Accept' (if needed)\n local_header_accept = ['application/json']\n local_header_accept_result = @api_client.select_header_accept(local_header_accept) and header_params['Accept'] = local_header_accept_result\n\n # HTTP header 'Content-Type'\n local_header_content_type = []\n header_params['Content-Type'] = @api_client.select_header_content_type(local_header_content_type)\n\n # form parameters\n form_params = {}\n\n # http body (model)\n post_body = nil\n auth_names = ['basic']\n data, status_code, headers = @api_client.call_api(:GET, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => 'BundleList')\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#bundles\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "74158f6569547b5d6e6e56e55304fcc2", "score": "0.6043396", "text": "def lb\n Apis.client.get('/currency/lb')\n end", "title": "" }, { "docid": "364d4156f6844fb28a5d7aaaaddb90fd", "score": "0.6038847", "text": "def show\n @vet_lab = VetLab.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @vet_lab }\n end\n end", "title": "" }, { "docid": "cf95d762ac7641f58133ea554f46c858", "score": "0.60354036", "text": "def index\n @labs = ::Lab.all\n end", "title": "" }, { "docid": "aa9cbcb48d5344d98ac7970916c8e5d0", "score": "0.6031929", "text": "def index\n @labs = Lab.all\n end", "title": "" }, { "docid": "aa9cbcb48d5344d98ac7970916c8e5d0", "score": "0.6031929", "text": "def index\n @labs = Lab.all\n end", "title": "" }, { "docid": "aa9cbcb48d5344d98ac7970916c8e5d0", "score": "0.6031929", "text": "def index\n @labs = Lab.all\n end", "title": "" }, { "docid": "44be54147d3017688bad00f73db3c9c0", "score": "0.60014254", "text": "def index\n @labs = Lab.all\n end", "title": "" }, { "docid": "77149f3f72c7a626c2d455430221c934", "score": "0.59949154", "text": "def index\n @load_balancers = LoadBalancer.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @load_balancers }\n end\n end", "title": "" }, { "docid": "480899854cf2343150613640468de070", "score": "0.59901077", "text": "def show\n @lab_cat = LabCat.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab_cat }\n end\n end", "title": "" }, { "docid": "d0ac63f6e3efa726d85f4c33acb3a118", "score": "0.5986022", "text": "def show\n @bounty = Bounty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bounty }\n end\n end", "title": "" }, { "docid": "d0ac63f6e3efa726d85f4c33acb3a118", "score": "0.5986022", "text": "def show\n @bounty = Bounty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bounty }\n end\n end", "title": "" }, { "docid": "250ceed52347894a69ed189ee4a5bdd7", "score": "0.59790725", "text": "def show\n @labour = Labour.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @labour }\n end\n end", "title": "" }, { "docid": "6b19d35581d1ecbb877ad7d9a318145f", "score": "0.5976507", "text": "def show\n @unit = Unit.find(params[:id])\n @labs = @unit.labs\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @unit }\n end\n end", "title": "" }, { "docid": "4b26daa0885af51765294d3feb589619", "score": "0.59757835", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @lab_badge }\n end\n end", "title": "" }, { "docid": "d866928f3b66cbec5f2f10b79fd51ecc", "score": "0.5971848", "text": "def index\n @cryps = Cryp.all\n #require 'net/http'\n #require 'json'\n\n @url = 'https://api.coinmarketcap.com/v1/ticker/'\n @uri = URI(@url)\n @response = Net::HTTP.get(@uri)\n @lookup_cryps = JSON.parse(@response)\n end", "title": "" }, { "docid": "690df90c9f18de66503c61d17a607d4a", "score": "0.5971631", "text": "def show\n @bounty = Bounty.find(params[:id])\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bounty }\n end\n end", "title": "" }, { "docid": "c1d408e90ce204f3651b8dbea131b150", "score": "0.59661645", "text": "def show\n @blert = Blert.find(params[:id])\n\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @blert }\n end\n end", "title": "" }, { "docid": "5b0429578bcfbd2bb44891095ddd409b", "score": "0.5957407", "text": "def index\n @brainstorms = Brainstorm.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @brainstorms }\n end\n end", "title": "" }, { "docid": "1caefa9ec2fdcdf9fbdaf0b81ebbedc6", "score": "0.5953599", "text": "def index\n if request.referrer.split('/').last == \"preview\"\n @deleted_from_preview = true\n end\n\n @labs = Lab.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @labs }\n end\n end", "title": "" }, { "docid": "4265b3c67829b409804705cad7ed6232", "score": "0.5938788", "text": "def index\n @api_v1_budgets = Api::V1::Budget.all\n end", "title": "" }, { "docid": "487636fe1f62e719d723ff68412de928", "score": "0.5907317", "text": "def show\n @lab_check = LabCheck.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab_check }\n end\n end", "title": "" }, { "docid": "d845c8696ff0386cdde2b941d980682d", "score": "0.59023434", "text": "def index\n @brigades = Brigade.all\n\n respond_to do |format|\n format.html { render layout: 'aquila' }\n format.json { render json: @brigades }\n end\n end", "title": "" }, { "docid": "fa2bea9a754ce13b0b3f63db42619a97", "score": "0.58915544", "text": "def index\n @clubbers = Clubber.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clubbers }\n end\n end", "title": "" }, { "docid": "0f0be60e5dc622c558d7f22296f80fe0", "score": "0.5891197", "text": "def show\n @lbcc = Lbcc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lbcc }\n end\n end", "title": "" }, { "docid": "aadeae2626a7e71ee85d652f75c6520b", "score": "0.5890593", "text": "def index\n @boats = Boat.all\n render :json => @boats.as_json\n end", "title": "" }, { "docid": "484eeec15e07fb021c93b983f3692116", "score": "0.5888018", "text": "def index\n @birds = Bird.all\n respond_to do |format|\n format.json { render json: get_birds_response(@birds), status: :ok } # Method available in birds_helper.rb\n end\n end", "title": "" }, { "docid": "8c5b562261dfcd8dc32264ca5be79e83", "score": "0.58874923", "text": "def dropletList()\n http, req = initReq(\"droplets/\")\n JSON.parse(http.request(req).body)\nend", "title": "" }, { "docid": "8c5b562261dfcd8dc32264ca5be79e83", "score": "0.58874923", "text": "def dropletList()\n http, req = initReq(\"droplets/\")\n JSON.parse(http.request(req).body)\nend", "title": "" }, { "docid": "72b6c363439e453b356e4cf019f385c0", "score": "0.58800167", "text": "def show\n @lab = Lab.find(params[:id])\n @units = @lab.groups\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab }\n end\n end", "title": "" }, { "docid": "20ee409a045a3153cf6346eeedb7af46", "score": "0.586954", "text": "def index\n @api_bottles = Api::Bottle.all\n end", "title": "" }, { "docid": "afdb98801882d6eee5a25e69817a58bc", "score": "0.5858575", "text": "def index\n @response = HTTParty.get(\"https://rails-api-ipo.herokuapp.com/api/v1/companies.json\")\n @companies = []\n @response.each do |comp|\n @companies.push(comp)\n end\n end", "title": "" }, { "docid": "ba93fc134bb78fbafcf48f3a2a954e09", "score": "0.5858241", "text": "def index\n @blocs = Bloc.all(sort: :position)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blocs }\n end\n end", "title": "" }, { "docid": "688b3a3cabd7ad3cb6487eed273a3745", "score": "0.585808", "text": "def show\n @bounty = Bounty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bounty }\n end\n end", "title": "" }, { "docid": "71b39e7f848700929ddb52c516615665", "score": "0.5857084", "text": "def index\n @blender_configs = BlenderConfig.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blender_configs }\n end\n end", "title": "" }, { "docid": "b210b8353099f06597394ccff15c2896", "score": "0.5852317", "text": "def index\n @blacklists = Blacklist.all\n\n render json: @blacklists\n end", "title": "" }, { "docid": "6cd943f70aaed28459ab4cc66cc1d74c", "score": "0.5849297", "text": "def show\n @crumb = Crumb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @crumb }\n end\n end", "title": "" }, { "docid": "6cd943f70aaed28459ab4cc66cc1d74c", "score": "0.5849297", "text": "def show\n @crumb = Crumb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @crumb }\n end\n end", "title": "" }, { "docid": "4837939cc89f017f6e147a6945825cfa", "score": "0.58477026", "text": "def index\n @slabs = Slab.all\n end", "title": "" }, { "docid": "8cfa54268caad12170cde2d11d43ab5b", "score": "0.5839775", "text": "def index\n @birds = Bird.all_visible\n render json: {birds: @birds.as_json}, status: :ok\n end", "title": "" }, { "docid": "5037ea414fdca36fc2dfb5b59fd9b186", "score": "0.5836096", "text": "def show\n @lab2 = Lab2.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lab2 }\n end\n end", "title": "" }, { "docid": "38b8d1987a1a2ef7aa950abbca19c1eb", "score": "0.5833002", "text": "def index\n @birst_spaces = BirstSpace.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @birst_spaces }\n end\n end", "title": "" }, { "docid": "bab8419c55ce4e40316df4e07c481345", "score": "0.582485", "text": "def index\n @undead_banes = UndeadBane.all\n\n render json: @undead_banes\n end", "title": "" }, { "docid": "c7c34bdcdd3a8eac4066bae2ec8637bc", "score": "0.5822598", "text": "def index\n url = 'https://petapi-1.herokuapp.com/'\n @response = RestClient.get(url)\n @parsed = JSON.parse(@response)\n end", "title": "" }, { "docid": "b69d942d526a77bddf5f3bc995aa960e", "score": "0.5811586", "text": "def list_penalized_arrays(args = {}) \n get(\"/arrays.json/backoffice/penalty\", args)\nend", "title": "" }, { "docid": "f2e6b97f79ec872e176002221665f256", "score": "0.5810377", "text": "def show\n @brt = Brt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @brt }\n end\n end", "title": "" }, { "docid": "6f607ab4d7a5b50acb543cfe4700dea8", "score": "0.5809816", "text": "def show\n @lbbb = Lbbb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lbbb }\n end\n end", "title": "" }, { "docid": "f5a77a1b19bbc43a4a33bcf2aee1fc1f", "score": "0.5809748", "text": "def index\n @bulbs = Bulb.all\n end", "title": "" }, { "docid": "d939cfac054bccce927d8ebfe9ccbb04", "score": "0.58071256", "text": "def index\n # specifying json format in the URl\n\t\turi = \"#{API_BASE_URL}/companies.json\"\n\t\t\n # It will create new rest-client resource so that we can call different methods of it\n rest_resource = RestClient::Resource.new(uri, USERNAME, PASSWORD)\n\n # this next line will give you back all the details in json format, \n #but it will be wrapped as a string, so we will parse it in the next step.\n \n companies = rest_resource.get\n\n # we will convert the return data into an array of hash. see json data parsing here\n @companies = JSON.parse(companies, :symbolize_names => true)\n end", "title": "" }, { "docid": "01c4dfdd31a086baa75f5ddee3e343e9", "score": "0.5805867", "text": "def show\n @brakes_system = BrakesSystem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @brakes_system }\n end\n end", "title": "" }, { "docid": "cfdaecec2d7fc38638bb0529e942835d", "score": "0.5798937", "text": "def GET(api_url)\n url = URI(ENV['API_URL'] + api_url)\n # url = URI(\"https://mnmapi.mdsol.com/falcon/api/v1/rave/sites?return_key=url\")\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n request = Net::HTTP::Get.new(url)\n request[\"Content-Type\"] = 'application/json'\n request[\"Authorization\"] = $bearerToken\n request[\"Cache-Control\"] = 'no-cache'\n $response = http.request(request)\n #puts $response.code\n $lastJsonResponse = JSON.parse($response.read_body)\n #puts $lastJsonResponse\nend", "title": "" }, { "docid": "0afd85a7ffc0aaaabedf5cd374b221ef", "score": "0.57976156", "text": "def index\n @beaches = Beach.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @beaches }\n end\n end", "title": "" }, { "docid": "22f9ae71b63565c974bec2bfad4f0e04", "score": "0.5794959", "text": "def index\n # @bulbs = Bulb.all\n end", "title": "" }, { "docid": "22f9ae71b63565c974bec2bfad4f0e04", "score": "0.5794959", "text": "def index\n # @bulbs = Bulb.all\n end", "title": "" }, { "docid": "6ebcca494b7c600b2fd9e18b1776a92f", "score": "0.5794002", "text": "def show\n @lba = Lba.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lba }\n end\n end", "title": "" }, { "docid": "49636fed4d8c8280ea6ecdaf4bfe2b57", "score": "0.57810825", "text": "def show\n @bbs_group = BbsGroup.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bbs_group }\n end\n end", "title": "" }, { "docid": "e7944d7a54326c0a6e28f5f6a5e80507", "score": "0.5774798", "text": "def list_brands\n brands = Brand.all.select('id', 'name')\n\n render json: {status: 0, data: {brands: brands}}\n end", "title": "" }, { "docid": "7da1bb9eaa4ada491cf158dcbe5fa0d6", "score": "0.575909", "text": "def show\n @bell = Bell.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bell }\n end\n end", "title": "" }, { "docid": "68d920b8f87fc92435c7da1e34d2d1cf", "score": "0.57532734", "text": "def index\n @baskets = Basket.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @baskets }\n end\n end", "title": "" }, { "docid": "68d920b8f87fc92435c7da1e34d2d1cf", "score": "0.57532734", "text": "def index\n @baskets = Basket.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @baskets }\n end\n end", "title": "" }, { "docid": "68d920b8f87fc92435c7da1e34d2d1cf", "score": "0.57532734", "text": "def index\n @baskets = Basket.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @baskets }\n end\n end", "title": "" }, { "docid": "7b3904cb4c7d1de71b8ac751744f0a12", "score": "0.57467794", "text": "def index\n @freelaws = Freelaw.ordered_roots\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @freelaws }\n end\n end", "title": "" }, { "docid": "a9fcc56bd0979c5d2bd197b79ba35968", "score": "0.57458127", "text": "def labs_api_version\n @labs_api_version ||= LABS_API_VERSION\n end", "title": "" }, { "docid": "b0b576f1b30449bd66728da1e19ec1b5", "score": "0.5742146", "text": "def show\n @bass = Bass.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bass }\n end\n end", "title": "" }, { "docid": "4f87b97f180cf0f497e8b9225fec1583", "score": "0.57383794", "text": "def index\n @bolets = Bolet.all\n end", "title": "" }, { "docid": "b51465ff66e814a6dc465e2c86dd85bf", "score": "0.572978", "text": "def index\n @combos = Combo.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @combos }\n end\n end", "title": "" }, { "docid": "177fc29d3a4e4d3d1128807c2ff6f3f6", "score": "0.57240653", "text": "def index\n @lyks = Lyk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lyks }\n end\n end", "title": "" }, { "docid": "76e0dcca81474e5ec82c5b4a5e9f0591", "score": "0.57199216", "text": "def show\n @boook = Boook.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @boook }\n end\n end", "title": "" }, { "docid": "2cc52635e061a234d40dfbfd3d3d558c", "score": "0.57139987", "text": "def index\n @user_labs = UserLab.all\n end", "title": "" }, { "docid": "2a68b5326352e478f9ab063fae840d90", "score": "0.57118833", "text": "def index\n @branches = Branche.all(params[:project_id])\n\n respond_to do |format|\n format.json { render json: @branches, status: 200 }\n end\n end", "title": "" }, { "docid": "73c2958da08e6723ae4d35eb7dba9798", "score": "0.57117504", "text": "def index\n @hobbies = Hobby.all\n render json: @hobbies\n end", "title": "" }, { "docid": "d17bfef952fc3b93a766fd498dfc6c99", "score": "0.571007", "text": "def index\n @battles = Battle.all\n\n render json: @battles\n end", "title": "" }, { "docid": "606250cf78e6e49e75c74c05d4cb5fa7", "score": "0.570996", "text": "def show\n @testbb = Testbb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @testbb }\n end\n end", "title": "" }, { "docid": "1c017650687cc57f84b05840deaf701d", "score": "0.5707951", "text": "def index\n @blorescrapurls = Blorescrapurl.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @blorescrapurls }\n end\n end", "title": "" }, { "docid": "5eb78b3c16b59dd7c7577403aed78130", "score": "0.5707333", "text": "def show\n @load_balancer = LoadBalancer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @load_balancer }\n end\n end", "title": "" }, { "docid": "35fc49e74d2b2eabfe9df6ed50c06bd1", "score": "0.57048714", "text": "def index\n @bottles = Bottle.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @bottles }\n end\n end", "title": "" }, { "docid": "8e711ef13cb1187832cfe6aebc57cdfe", "score": "0.57033646", "text": "def show\n @bet = Bet.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @bet }\n end\n end", "title": "" } ]
e15298b27578d8908a8b8e41ad38e353
generates NokokGiri data from selected movies IMDB page
[ { "docid": "6e3f0252d777610df1e6a20452d0835a", "score": "0.0", "text": "def trivia_url(selected_movie)\r\n movie_page = movie_page(selected_movie)\r\n movie_url = movie_url(selected_movie)\r\n resource = movie_page.css(\"div#trivia a.nobr\")[0][\"href\"].to_s\r\n trivia_url = movie_url.to_s + resource\r\n end", "title": "" } ]
[ { "docid": "df5b2be2fb48a9d447befb771f89ed01", "score": "0.7494284", "text": "def movie_page(selected_movie)\r\n movie_html = movie_url(selected_movie)\r\n Nokogiri::HTML(open(movie_html))\r\n end", "title": "" }, { "docid": "f7771437af9b09ba2e9e093014acec5c", "score": "0.72894144", "text": "def scrape_top_5_movies_from_imdb\n html_file = open(\"#{IMDB_URL}chart/top\").read\n html_doc = Nokogiri::HTML(html_file)\n\n movies_array = []\n\n html_doc.search(\".titleColumn\")[0..4].each do |element|\n href = element.search('a').attribute('href').value\n title = element.search('a').text.strip\n\n movies_array << { title: title, href: href }\n end\n\n movies_array\nend", "title": "" }, { "docid": "164acb4e705365a3da1286b2d36dc6f4", "score": "0.6909121", "text": "def get_now_showing_movies()\n LOG.info(\"Fetching all movies that are showing from #{IMDB_NOW_SHOWING_URL}\")\n doc_tree = Nokogiri::HTML(fetch(IMDB_NOW_SHOWING_URL))\n nodes = doc_tree.xpath(\"//div[@itemscope]//*[@itemprop='name']/a\")\n nodes.collect { |mov| link_from_node(mov) }\nend", "title": "" }, { "docid": "0019abac3bed0a9d13ec37d9b98b9e9c", "score": "0.6814203", "text": "def get_movie_info(movie_title)\n #page = HTTParty.get('http://www.imdb.com/title/tt0119081/')\n page = HTTParty.get(movie_title)\n # this is where we transform our http response into a nokogiri object so that we can parse it\n parse_page = Nokogiri::HTML(page)\n #now we grab the HTML content we want\n #GET TITLE\n movie_name = parse_page.xpath('//h1').text.strip\n p \"this is the movie_name \" + movie_name\n\n #GET Director\n director = parse_page.css('.credit_summary_item').text.gsub(\"\\n\",'').gsub(\"Director:\",\"\").strip\n director = director.split(\" \")[0]\n p \"this is the direcor \" + director\n\n\n #GET actors\n actors = []\n\n actor_1 = parse_page.xpath('//*[@id=\"title-overview-widget\"]/div[3]/div[2]/div[1]/div[4]/span[1]/a/span').inner_html\n actor_2 = parse_page.xpath('//*[@id=\"title-overview-widget\"]/div[3]/div[2]/div[1]/div[4]/span[2]/a/span').inner_html\n actor_3 = parse_page.xpath('//*[@id=\"title-overview-widget\"]/div[3]/div[2]/div[1]/div[4]/span[3]/a/span').inner_html\n p actors\n if actor_1 == \"\"\n p \"actors are NOT defined! ! ! \"\n actor_1 = parse_page.xpath('//*[@id=\"title-overview-widget\"]/div[3]/div[1]/div[4]/span[1]/a/span').inner_html\n actor_2 = parse_page.xpath('//*[@id=\"title-overview-widget\"]/div[3]/div[1]/div[4]/span[2]/a/span').inner_html\n actor_3 = parse_page.xpath('//*[@id=\"title-overview-widget\"]/div[3]/div[1]/div[4]/span[3]/a/span').inner_html\n else\n p \"it's all good homie.. here is actor _1 \"\n p actor_1\n end\n\n actors = [actor_1, actor_2, actor_3]\n\n p \"these are the main actors... \"\n p actors\n\n # characters = []\n # # char_1 = parse_page.xpath('//*[@id=\"titleCast\"]/table/tbody/tr[16]/td[4]/div/a')\n # char_1 = parse_page.xpath('//*[@id=\"titleCast\"]/table/tbody/tr[2]/td[4]/div/a').inner_html\n # char_2 = parse_page.xpath('//*[@id=\"titleCast\"]/table/tbody/tr[2]/td[4]').inner_html\n # # character_2 = parse_page.xpath('//*[@id=\"titleCast\"]/table/tbody/tr[3]/td[4]/div/a').inner_html\n # character_3 = parse_page.xpath('//*[@id=\"titleCast\"]/table/tbody/tr[4]/td[4]/div/a').inner_html\n # characters = [character_1, character_2, character_3]\n # p \"this the main characters... \"\n # p char_2\n\n # get rating\n rating = parse_page.xpath('//*[@id=\"title-overview-widget\"]/div[2]/div[2]/div/div[1]/div[1]/div[1]/strong/span').inner_html\n p \"this is the rating\"\n p rating\n new_rating = (rating.to_f)/10\n p \"this is the new rating\"\n p new_rating\n #GET TIME\n time = parse_page.xpath('//time').text.gsub(\"\\n\",'').strip[-7, 7]\n p \"this the time ... \"\n p time\n\n #GET plot\n # plot = parse_page.xpath('//*[@id=\"titleStoryLine\"]/div[1]/p').inner_html.gsub(\"\\n\",\" \")\n # plot = plot.split('<em', 2)\n # plot = plot[0].split('.',2)\n # plot_words = plot[1].scan(/\\w+ \\w+/)\n\n #GET keywords\n keywords = []\n kw_1 = parse_page.xpath('//*[@id=\"titleStoryLine\"]/div[2]/a[1]/span').inner_html\n kw_2 = parse_page.xpath('//*[@id=\"titleStoryLine\"]/div[2]/a[2]/span').inner_html\n kw_3 = parse_page.xpath('//*[@id=\"titleStoryLine\"]/div[2]/a[3]/span').inner_html\n kw_4 = parse_page.xpath('//*[@id=\"titleStoryLine\"]/div[2]/a[4]/span').inner_html\n keywords = [ kw_1,kw_2, kw_3, kw_4]\n p \"these are the keywords : \"\n p keywords\n\n # get tagline\n # tagline = parse_page.xpath('//*[@id=\"titleStoryLine\"]/div[3]').text\n # tagline = tagline.gsub(\"\\n\",\" \")\n # tagline = tagline.rpartition(\"Taglines:\")[2]\n # tagline = tagline.split(\"See more\")[0]\n\n\n #get review\n # review_page = movie_title.split('?', 2)\n # review_page = review_page[0] << \"reviews?ref_=tt_urv\"\n #\n # page = HTTParty.get(review_page)\n # # this is where we transform our http response into a nokogiri object so that we can parse it\n # parse_page = Nokogiri::HTML(page)\n # review = parse_page.xpath('//*[@id=\"tn15content\"]/p[10]').text.gsub(\"\\n\",\" \")\n\n\n movie_info = {\n time: time,\n actors: actors,\n # plot: plot,\n keywords: keywords,\n # characters: characters,\n director: director,\n movie_name: movie_name,\n # review: review,\n new_rating: new_rating,\n # tagline: tagline,\n }\n\n rescue\n end", "title": "" }, { "docid": "c22f08c75929ec3972ceef0ef4c8e772", "score": "0.67683935", "text": "def trivia_page(selected_movie) \r\n trivia_html = trivia_url(selected_movie)\r\n Nokogiri::HTML(open(trivia_html))\r\n end", "title": "" }, { "docid": "3d1429c9f366bcd1e0f4bfad6b2d8db6", "score": "0.6726353", "text": "def fetch_movie_urls\n url = \"https://www.imdb.com/chart/top\"\n doc = Nokogiri::HTML(open(url).read)\n movies = doc.search(\".titleColumn a\")[0...5]\n movies.map do |movie_link|\n end_url = movie_link.attribute(\"href\").value\n \"http://www.imdb.com#{end_url}\"\n\n end\n\nend", "title": "" }, { "docid": "1e610651e0eb081a2cb02b98f8e263a7", "score": "0.67086065", "text": "def fetch_movies_url\n # Visiter le site imdb: https://www.imdb.com/chart/top\n raw_html = URI.open(IMDB_TOP_CHART_URL).read\n # Utiliser nokogiri pour parser le fichier html recu\n html_doc = Nokogiri::HTML(raw_html)\n urls = []\n\n # Rechercher avec nokogiri les urls des 5 premiers films\n html_doc.search('.titleColumn a').first(5).each do |link|\n # Stocker dans un tableau\n urls << \"https://www.imdb.com#{link.attribute('href').value}\"\n end\n\n urls\nend", "title": "" }, { "docid": "a499330caed973627b504e990b330776", "score": "0.66753477", "text": "def scrape_movie(url)\n html_doc = parse_url(url)\n\n pattern = /^(?<title>.+)[[:space:]]\\((?<year>\\d{4})\\)$/\n\n match_data = html_doc.search(\"h1\").text.strip.match(pattern)\n title = match_data[:title]\n year = match_data[:year].to_i\n storyline = html_doc.search(\".summary_text\").text.strip\n director = html_doc.search(\".credit_summary_item a\").first.text\n\n cast_div = html_doc.search(\".credit_summary_item\")\n\n # cast = []\n # cast_div.last.search(\"a\").take(3).each do |element|\n # cast << element.text\n # end\n\n cast = cast_div.last.search(\"a\").take(3).map do |element|\n element.text\n end\n\n {\n title: title,\n year: year,\n storyline: storyline,\n director: director,\n cast: cast\n }\nend", "title": "" }, { "docid": "c19fb563a1c84112854bb8736d2fa3d5", "score": "0.6576758", "text": "def movies_list\n return top_rated if query.nil?\n\n content = {}\n encoded_query = CGI.escape(@query)\n html = parse_html(\"/search/?q=#{encoded_query}\")\n all_series = html.css('table.catalogTable').search('tr')\n all_series[1...-1].each do |movie|\n ru_title = movie.css('td > a')[0].text\n content[:\"#{ru_title}\"] = {\n en_title: movie.css('td > .catalogTableSubHeader')[0].text,\n link: movie.css('td > a')[0]['href'],\n movie_id: movie.css('td > a')[0]['href'][/\\d+/],\n watchers: movie.css('td')[2].text,\n seasons: movie.css('td')[4].text,\n year: movie.css('td')[5].text\n }\n end\n content\n rescue NoMethodError\n logger.error \"Can't apply selectors in '#{__method__}' method. DOM structure apparently was changed.\"\n end", "title": "" }, { "docid": "161731ff2c11036d126bd7fba1dbcf28", "score": "0.6510013", "text": "def scrape\n\tmonday = getMonday\n\n\t# create url to retrieve all movies from current date onwards\n\tallMoviesURL = getMoviesURL(monday)\n\t\n\t# retrieve page\n\tpage = Nokogiri::HTML(open(allMoviesURL))\n\n\t# select the movies\n\tmovieListingNodes = getMovieListingNodes(page)\n\n\t# parse the movies\n\tmovieListings = parseMovieListings(movieListingNodes)\n\t\n\treturn movieListings\nend", "title": "" }, { "docid": "b4ca0b155cb2fe004836a4b97fb46123", "score": "0.65089554", "text": "def ScrapAnalyseOneMovie(oneMovieXML)\n movie_info = {}\n \n movie_info['id'] = oneMovieXML.elements['id'].text\n movie_info['id_allocine'] = oneMovieXML.elements['id_allocine'].text\n movie_info['id_imdb'] = oneMovieXML.elements['id_imdb'].text\n movie_info['last_change'] = oneMovieXML.elements['last_change'].text\n movie_info['url'] = oneMovieXML.elements['url'].text\n movie_info['title'] = oneMovieXML.elements['title'].text\n movie_info['originaltitle'] = oneMovieXML.elements['originaltitle'].text\n movie_info['year'] = oneMovieXML.elements['year'].text\n movie_info['runtime'] = oneMovieXML.elements['runtime'].text\n movie_info['plot'] = oneMovieXML.elements['plot'].text\n \n movie_info['images'] = {}\n images = oneMovieXML.elements[\"images\"]\n if not images.nil?\n images.each_element(\"image\") do |image|\n img_id = image.attributes['id']\n img_size = image.attributes['size']\n \n if not movie_info['images'].has_key? img_id\n movie_info['images'][img_id] = {}\n end\n \n movie_info['images'][img_id]['type'] = image.attributes['type']\n if not movie_info['images'][img_id].has_key? img_size\n movie_info['images'][img_id][img_size] = {}\n end\n movie_info['images'][img_id][img_size]['url'] = image.attributes['url']\n movie_info['images'][img_id][img_size]['width'] = image.attributes['width']\n movie_info['images'][img_id][img_size]['height'] = image.attributes['height']\n end\n end\n \n movie_info['ratings'] = {}\n movie_info['ratings']['cinepassion'] = {}\n movie_info['ratings']['allocine'] = {}\n movie_info['ratings']['imdb'] = {}\n ratings = oneMovieXML.elements[\"ratings\"]\n ratings_cinepassion = ratings.elements[\"rating[@type='cinepassion']\"]\n movie_info['ratings']['cinepassion']['votes'] = ratings_cinepassion.attributes['votes']\n movie_info['ratings']['cinepassion']['value'] = ratings_cinepassion.text\n ratings_allocine = ratings.elements[\"rating[@type='allocine']\"]\n movie_info['ratings']['allocine']['votes'] = ratings_allocine.attributes['votes']\n movie_info['ratings']['allocine']['value'] = ratings_allocine.text\n ratings_imdb = ratings.elements[\"rating[@type='imdb']\"]\n movie_info['ratings']['imdb']['votes'] = ratings_imdb.attributes['votes']\n movie_info['ratings']['imdb']['value'] = ratings_imdb.text\n \n nfo_base = \"#{@siteurl}/scraper/index.php?id=#{movie_info['id']}&Download=1\"\n movie_info['nfo'] = {}\n movie_info['nfo']['Babylon'] = {}\n movie_info['nfo']['Camelot'] = {}\n nfo_babylon = \"#{nfo_base}&Version=0\"\n movie_info['nfo']['Babylon']['fr'] = \"#{nfo_babylon}&Lang=fr&OK=1\"\n movie_info['nfo']['Babylon']['en'] = \"#{nfo_babylon}&Lang=en&OK=1\"\n nfo_camelot = \"#{nfo_base}&Version=1\"\n movie_info['nfo']['Camelot']['fr'] = \"#{nfo_camelot}&Lang=fr&OK=1\"\n movie_info['nfo']['Camelot']['en'] = \"#{nfo_camelot}&Lang=en&OK=1\"\n \n return movie_info\n end", "title": "" }, { "docid": "a6dadc96f07b5d6507591d45e9302f02", "score": "0.64935267", "text": "def movies\n @movies ||= parse_movie_infos\n end", "title": "" }, { "docid": "8f303363d022fb7f1a48198d12ff0bfe", "score": "0.6483646", "text": "def movies_of(target)\n begin\n return @crawler.get_data_from(target,'movie')\n rescue Exception => e\n raise e\n end\n end", "title": "" }, { "docid": "70cbdcb265fdfa496b9877ebcf960e63", "score": "0.6480767", "text": "def parse_movies(job)\n details.css(\"div[id^='#{job}Movie-tt']\").map do |row|\n imdb_id = row.at(\"a[href^='/title/tt']\")['href'].parse_imdb_id\n title = row.at('a').text.strip\n year = row.at('.year_column').text.parse_year\n\n [imdb_id, title, year]\n end.map do |values|\n Spotlite::Movie.new(*values)\n end\n end", "title": "" }, { "docid": "48356b37313f01c0c90f833a94314cae", "score": "0.6426015", "text": "def scrape_details(selected_movie)\n\n # data = UpcomingMovies::New_movies.find(index)\n doc = Nokogiri::HTML(open(selected_movie.href))\n\n selected_movie.details(\n title: doc.search(\"h1\").text.strip.split(\"\\n\").first,\n release_date: doc.search(\"ul.movie-details__detail li.movie-details__release-date\").text.strip,\n synopsis: doc.search(\"p.mop__synopsis-content\").text.strip)\n # selected_movie.save\n # binding.pry\n\n\n\n # @movie_data.details({\n # title: doc.search(\"h1.subnav__title.heading-style-1.heading-size-xl\").text.strip.split(\"\\n\").first,\n # release_date: doc.search(\"ul.movie-details__detail li.movie-details__release-date\").text.strip,\n # synopsis: doc.search(\"p.mop__synopsis-content\").text.strip})\n\n # UpcomingMovies::New_movies.new.details({\n # title: doc.search(\"h1.subnav__title.heading-style-1.heading-size-xl\").text.strip.split(\"\\n\").first,\n # release_date: doc.search(\"ul.movie-details__detail li.movie-details__release-date\").text.strip,\n # synopsis: doc.search(\"p.mop__synopsis-content\").text.strip})\n # binding.pry\n\n\n\n # title = doc.search(\"h1.subnav__title.heading-style-1.heading-size-xl\").text.strip.split(\"\\n\").first\n # release_date = doc.search(\"ul.movie-details__detail li.movie-details__release-date\").text.strip\n # synopsis = doc.search(\"p.mop__synopsis-content\").text.strip\n # UpcomingMovies::New_movies.details(title, release_date, synopsis)\n # end\n\n\n # title = doc.search(\"h1.subnav__title.heading-style-1.heading-size-xl\").text.strip.split(\"\\n\").first\n # release_date = doc.search(\"ul.movie-details__detail li.movie-details__release-date\").text.strip\n # synopsis = doc.search(\"p.mop__synopsis-content\").text.strip\n # UpcomingMovies::Movie_data.new(title, release_date, synopsis)\n # end\n\n\n end", "title": "" }, { "docid": "7f0bd0b941397184a1325b175eae6137", "score": "0.6422419", "text": "def imdb_top_movie_urls\n url = \"https://www.imdb.com/chart/top\"\n html_string = open(url).read\n doc = Nokogiri::HTML(html_string)\n movie_link_elements = doc.search('.lister-list .titleColumn a').first(5)\n movie_link_elements.map do |element|\n \"http://www.imdb.com#{element.attr(\"href\")}\"\n end\nend", "title": "" }, { "docid": "8087ddd3d34834d54b5324bb0353bf4b", "score": "0.6362787", "text": "def scrape_all_movies\n\t\tscraper = MetacriticScraper.new\n\t\tindex_pages = YAML.load_file('index_pages.yml')\n\t\tmovies_pages = []\n \t\tindex_pages.each do | index_page |\n \t\t\tresult = scraper.scrape_for_movies(index_page)\n \t\t\tmovies_pages += result\n \t\t\tp \"CURRENT INDEX PAGE IS #{index_page}\"\n\n \t\t\t# because we get blocked scraping - we write the movies list each time\n \t\t\tFile.open(\"movies_list.yml\", \"w+\") do |f|\n\t \tf.write(movies_pages.to_yaml)\n\t \tf.close\n\t \tend\n\n \t\t\tsleep(rand(2..3))\n \t\tend\n\tend", "title": "" }, { "docid": "b52828905821514f9c044b89185cbebf", "score": "0.6315752", "text": "def movie_page\r\n\t TopOneHundredMovies::Scraper.new.movie_page(self)\r\n\tend", "title": "" }, { "docid": "62e1a7c4eb52ea993fcd48f0d1e851dd", "score": "0.62977844", "text": "def movies_as(category)\n movies = document.css(\"#filmo-head-#{category.downcase}\").first.next_element.children.to_a\n movies.reject! { |movie| movie.class == Nokogiri::XML::Text }\n movies.map do |movie|\n movie_id = movie.attr('id')[/\\d+/]\n Movie.new(movie_id)\n end\n end", "title": "" }, { "docid": "585474bf63367174726c6a0dac651971", "score": "0.62504494", "text": "def movie_data\n response = RestClient.get(\"critics.api.mks.io/movie-genres\")\n JSON.parse(response)\nend", "title": "" }, { "docid": "cef5729a2bb76de786f782603d9205a5", "score": "0.6247771", "text": "def quotes_page(selected_movie) \r\n quotes_html = quotes_url(selected_movie)\r\n Nokogiri::HTML(open(quotes_html))\r\n end", "title": "" }, { "docid": "a5f46e66d08e2aabd0fee0abacf28dc7", "score": "0.6240881", "text": "def show_character_movies(character)\n urls_of_films = get_character_movies_from_api(character)\n films_hash = add_film_urls(urls_of_films)\n parse_character_movies(films_hash)\nend", "title": "" }, { "docid": "23b6165712c6b741d737c878358d7674", "score": "0.62334824", "text": "def lookupMovie\n \n # Validation\n if self.tz_title.nil?\n logger.warn \"This movie doesn't have a title!\"\n return\n end\n \n if self.status == Movie::LOADED\n logger.warn \"This movie has already been loaded!\"\n return\n end\n \n logger.debug 'Loading movie...' + self.inspect\n begin\n # Search for the movie and grab the first result\n logger.debug \"Requesting the movie search URL...\" \n result = self.class.agent.get(Movie::ROTTEN_TOMATOES_SEARCH_URL + CGI::escape(self.tz_title))\n logger.debug \"Parsing result of RT search...\" \n doc = Nokogiri::HTML(Movie::EXTRACT_BODY_REGEX.match(result.body)[0])\n row = doc.css('#search_results_main table tbody tr:first')\n self.rt_link = Movie::ROTTEN_TOMATOES_URL + row.css('td:first a')[0]['href']\n self.year = row.css('td:last strong')[0].text.strip unless row.css('td:last strong')[0].nil?\n\n # Load the movie page\n result = self.class.agent.get(self.rt_link)\n body = Movie::EXTRACT_BODY_REGEX.match(result.body)[0]\n doc = Nokogiri::HTML(body)\n \n logger.debug \"Parsing the movie page...\"\n self.rt_title = doc.css('h1.movie_title')[0].content\n self.rt_img = doc.css('.movie_tools_area img:first')[0]['src'] unless doc.css('.movie_tools_area img:first')[0].nil?\n self.rt_rating = doc.css('#tomatometer_score span:first')[0].content unless doc.css('#tomatometer_score span:first')[0].nil?\n\n # Nokogiri gives encoding errors when outputting the contents of the #movie_info_box\n # so we have to use these convoluted regular expressions to get the content.\n #self.rt_info = Movie::EXTRACT_MOVIE_INFO_BOX.match(body)[0] #doc.css('#movie_info_box')[0].to_s unless doc.css('#movie_info_box')[0].nil?\n inner_divs = doc.css('#movie_info_box div').length\n rt_info = Movie::EXTRACT_MOVIE_INFO_REGEX.call(inner_divs).match(body)[0]\n rt_info.gsub!(Movie::EXTRACT_SCRIPT_REGEX, '')\n self.rt_info = rt_info\n \n rescue Exception\n logger.warn \"Failed loading movie #{self.tz_title} (Id: #{self.id}, Hash: #{self.tz_hash})\" \n self.status = Movie::FAILED\n \n else\n self.status = Movie::LOADED\n \n ensure\n self.save\n end\n\n self\n end", "title": "" }, { "docid": "5202702b236257f1d7670f7162d153bb", "score": "0.6221718", "text": "def movie_page\r\n\t Scraper.new.movie_page(self)\r\n\tend", "title": "" }, { "docid": "d894ba9066df8520c1c1e738bc807d9c", "score": "0.61993843", "text": "def get_movie_bio(id)\n doc = Nokogiri::HTML(open(IMDB_URL + \"/title/\" + id))\n title = doc.css(\"h1.header\").text.split(\"\\n\").delete_if {|x| x==\"\"}.first\n bio = doc.css(\"#maindetails_center_bottom\").css(\".article p\").text\n image_link = doc.css(\"#img_primary img\").first.attributes[\"src\"].value if doc.css(\"#img_primary img\").first\n cast = get_cast(doc.css(\"table.cast_list td.name\"))\n\n {:title => title, :bio => bio, :image_link => image_link, :cast => cast}\n end", "title": "" }, { "docid": "f56a56edd6310ee0dace34bdd723e794", "score": "0.61921567", "text": "def find_movie_by_title(arg)\n query_response = RestClient.get(\"http://www.omdbapi.com/?t=#{arg}&apikey=a2d3299b\") #query the database\n parsed_response = JSON.parse(query_response) #parse the response into a useable hash\n movie_deets_hash = #extract relevant details from the hash\n {\"Title\" => parsed_response[\"Title\"],\n \"Released\" => parsed_response[\"Released\"].slice(-4..).to_i,\n \"Genre\" => parsed_response[\"Genre\"],\n \"Director\" => parsed_response[\"Director\"]}\n add_movie_to_database(movie_deets_hash) #create a movie_object for the selected movie, if it doesn't already exist\n end", "title": "" }, { "docid": "d3f4711d9ecf0d69e7ba1c1b4dc4fdcc", "score": "0.61561996", "text": "def genres\n document.search(\"h5[text()='Genre:'] ~ a[@href*=/Sections/Genres/']\").map { |link| link.innerHTML.strip.imdb_unescape_html } rescue []\n end", "title": "" }, { "docid": "cfd2d8c13f9e7c091c6868018a7af9ca", "score": "0.61492515", "text": "def basic_generate_all\r\n puts \"This is IMDb's Top 100 Movie List.\"\r\n scraper = TopOneHundred::Scraper.new\r\n all_movies = scraper.initialize_all_movies\r\n all_movies.each{|movie| movie.print_details}\r\n all_movies\r\n end", "title": "" }, { "docid": "d373d035fcfb404ed1499341306e7738", "score": "0.61199254", "text": "def show_character_movies(character)\n films_hash = get_character_movies_from_api(character) #returns films list/url\n parse_character_movies(films_hash)\nend", "title": "" }, { "docid": "a58f69f4b99ac8337b62bb14e315fd27", "score": "0.60913086", "text": "def run\n page = parse(\"#{url}#{URI.encode('A Christmas Prince')}\")\n binding.pry\n page.css('#movieSection .results_ul li:first-child').each do |row|\n # movie = Movie.find_or_initialize_by(title: title(row), year: year(row))\n # if movie.persisted?\n # movie.update(update_params(row))\n # update(movie, row)\n # else\n # movie.assign_attributes(create_params(row))\n # movie.save\n # end\n end\n end", "title": "" }, { "docid": "701cdf2526af7bbba49e19cff29e1e68", "score": "0.6088419", "text": "def movies()\n sql = \"SELECT movies.* FROM movies INNER JOIN castings ON movies.id = castings.movie_id WHERE star_id = $1\"\n values = [@id]\n movie_data = SqlRunner.run(sql, values)\n return Movie.map_items(movie_data)\n end", "title": "" }, { "docid": "0f3dcb1c6bc867898c0cc300ab61b214", "score": "0.60747427", "text": "def best_movies\n doc.search('#BestFilmList a').map(&:text)\n end", "title": "" }, { "docid": "33ebcdb69b7179a8e9f9377a9155a0e2", "score": "0.6062325", "text": "def show\n tmdb_id = @movie.tmdb_id\n # mongo_movie = @cli[:TMDBMovies].find(:id => tmdb_id).first\n # @posters = mongo_movie[\"posters\"].uniq.take 5\n # videos = mongo_movie[\"youtube_trailers\"]\n # @urls = videos.map {|v| v[\"urL\"]}\n @crews = @movie.crew_relations.includes(:person).to_a\n @crews = @crews.take 5\n #@workers = @movie.crews\n @crews.sort_by! {|crew| crew.job} \n @casts = @movie.cast_relations.includes(:person).to_a\n @casts.reject! {|cast| cast.character.size == 0}\n @casts.sort_by! {|cast| cast.order}\n num = @movie.genres.size\n if num > 0\n rnd = Random.new\n offset = rnd.rand(num)\n @genre = @movie.genres[offset]\n @related_movies = @genre.movies.take 6\n @related_movies = @related_movies- [@movie]\n if @related_movies.size > 5\n @related_movies = @related_movies.take 5\n end\n else \n @related_movies = []\n end \n #@actors = @movie.casts\n end", "title": "" }, { "docid": "d76e6e4d4a055874aeb4ffd94a06899a", "score": "0.6057344", "text": "def scrape_recent\n\t\trecent_movies = []\n\t\tscraper = MetacriticScraper.new\n\n\t\t# import file with recent reviews hash that shows movie-uri and number of reviews\n\t\trecent_movie_links = scraper.scrape_recent_movies\n\t\trecent_movie_links.each_with_index do | movie_link, i |\n\t\t\tmovie_uri = movie_link.attributes[\"href\"].value\n\t\t\treviews = scraper.scrape_one_movies_reviews(\"http://www.metacritic.com#{movie_uri}\")\n\t\t\tsave_data(reviews, movie_uri)\n\t\tend\n\tend", "title": "" }, { "docid": "84cdba2dc124753beb5aec1515e25221", "score": "0.60392934", "text": "def load_movie_details (movies)\n\t\tmovies.each do |movie|\n\t\t\tload_ratings(movie)\n\t\t\tload_reviews(movie)\n\t\t\tload_genres(movie)\n\t\tend\n\t\treturn movies\n\tend", "title": "" }, { "docid": "8a5c803cd3a98d4d078b2996c4c77443", "score": "0.6019252", "text": "def basic_generate_all\r\n puts \"This is IMDb's Top 100 Scary Movie List....this could take a few minutes\"\r\n scraper = TopOneHundred::Scraper.new\r\n all_movies = scraper.initialize_all_movies\r\n all_movies.each{|movie| movie.print_details}\r\n all_movies\r\n end", "title": "" }, { "docid": "814417c1d71d2527929dd2e48a637671", "score": "0.59968513", "text": "def movie_url(selected_movie)\r\n index = selected_movie.index\r\n resource = self.class.index_page.css(\".lister-item-header a\")[index][\"href\"]\r\n\t movie_url = \"https://www.imdb.com\" + resource\r\n end", "title": "" }, { "docid": "47f76e7086051f39da260d8264bec13a", "score": "0.5996373", "text": "def movies\n get('Movies')\n end", "title": "" }, { "docid": "4fa4ba203b718fb50c9281c6d494c958", "score": "0.5994078", "text": "def show\n @imdb_movie = Movie.find(params[:id])\n end", "title": "" }, { "docid": "2d21b66b5a33c579cd85ea6fa0fa6681", "score": "0.5993078", "text": "def director\n document.search(\"h5[text()^='Director'] ~ a\").map { |link| link.innerHTML.strip.imdb_unescape_html } rescue []\n end", "title": "" }, { "docid": "3eb958674e01478825296b502d50349c", "score": "0.5971105", "text": "def extract_video_page_urls(webpage,options)\r\n puts \"Extracting data from html5 data\"\r\n webpage.css('li.regularitem').each do |post|\r\n link = post.css('h4.itemtitle').css('a').first\r\n description = post.css('div.itemcontent').first.text\r\n download_episode(link.child.text,link['href'],description, options)\r\n end\r\nend", "title": "" }, { "docid": "5688cdda8bc9964a00cc07f2e872c531", "score": "0.5970745", "text": "def get_movie_cast(mov)\n link = mov[:link] + \"/fullcredits\"\n LOG.info(\"Retrieving movie cast for #{mov[:name]} from '#{link}'.\")\n doc_tree = Nokogiri::HTML(fetch(link))\n cast = doc_tree.xpath(\"//table[@class='cast_list']//td[@itemprop='actor']/a\")\n cast.collect { |c| link_from_node(c) }\nend", "title": "" }, { "docid": "4f79aa3c9e7a18a2ec3218da5613862b", "score": "0.5952222", "text": "def retrieve imdb_id\r\n #http://www.omdbapi.com/?i=tt0133093&plot=short&r=json\r\n host = \"http://www.omdbapi.com/\"\r\n #parms = \"title=Matrix\"\r\n #imdb_id = \"tt0133093\"\r\n if already_downloaded imdb_id\r\n return false\r\n end\r\n filename = imdb_id + \".json\"\r\n\r\n # Other parms\r\n #parms = parms + \"&actors=S&format=JSON\"\r\n parms = \"#{imdb_id}&plot=full&r=json\"\r\n\r\n url = \"#{host}?i=#{parms}\"\r\n print \"#{url} ..\"\r\n\r\n # FIXME sometimes some characters after the number cause a crash such as double quote\r\n # or less than.\r\n uri = URI(url)\r\n\r\n response = Net::HTTP.get_response(uri)\r\n\r\n puts response.body\r\n name, year = parse_response response.body\r\n bold \"#{year} #{name} \\n\"\r\n # can we check response body for false and error\r\n # \"Incorrect IMDb ID\"\r\n File.open(filename, 'w') {|f| f.write(response.body) } \r\n return true\r\nend", "title": "" }, { "docid": "8441ca3035253d454a69c32dcf4d0c92", "score": "0.59412307", "text": "def resolv_movie(movie)\n raise MovieNotFoundError unless movie.is_a?(ImdbApi::Object)\n url = Imdb.build_url('/title/maindetails', :tconst => movie.id)\n result = JSON.parse(Imdb.get(url))\n if result.is_a?(Array)\n return result.map{|movie| Object.new(movie)} \n else\n return Object.new(result)\n end\n end", "title": "" }, { "docid": "100ba03089a4c857c408ddbc11f21d88", "score": "0.5938539", "text": "def movie_search\n\n puts \"Please enter the name of the movie you would like to search\"\n input = gets.chomp\n system \"clear\"\n query_response = RestClient.get(\"http://www.omdbapi.com/?s=#{input}&apikey=a2d3299b\") #send query to database to search for movies containing the the user's input in the title\n\n parsed_response = JSON.parse(query_response) #parse the response into a hash\n\n movie_results = parsed_response[\"Search\"].map do |movie| #iterate through the hash and extract the movie titles into an array\n movie[\"Title\"] \n end\n puts \"Your search returned the following results:\"\n\n #todo !iterate through the hash again (movie_reslts) to get the release year of each movie\n movie_years = parsed_response[\"Search\"].map do |movie| #iterate through the hash and extract the movie year into an array\n movie[\"Year\"]\n end\n\n\n movie_results.each.with_index(1).map do |movie, index| #iterate through the array of movie titles and print them to the screen, along with their index # + 1\n puts \"#{index}. #{movie}\"\n end\n find_movie_from_list(movie_results) #allow the user to select a movie from their movie list\n end", "title": "" }, { "docid": "aabf8cc42d9de7d6cb500275ddf7aa9f", "score": "0.59312546", "text": "def show_character_movies(character)\n films_hash = get_character_movies_from_api(character)\n parse_character_movies(films_hash)\nend", "title": "" }, { "docid": "734a221af6d25daf1f80e837fac0beb3", "score": "0.5931005", "text": "def get_page_by_genre(genre)\n if genre == \"Action\"\n Nokogiri::HTML(open(\"https://www.rottentomatoes.com/top/bestofrt/top_100_action__adventure_movies/\"))\n elsif genre == \"Comedy\"\n Nokogiri::HTML(open(\"https://www.rottentomatoes.com/top/bestofrt/top_100_comedy_movies/\"))\n elsif genre == \"Documentary\"\n Nokogiri::HTML(open(\"https://www.rottentomatoes.com/top/bestofrt/top_100_documentary_movies/\"))\n elsif genre == \"Drama\"\n Nokogiri::HTML(open(\"https://www.rottentomatoes.com/top/bestofrt/top_100_drama_movies/\"))\n elsif genre == \"Horror\"\n Nokogiri::HTML(open(\"https://www.rottentomatoes.com/top/bestofrt/top_100_horror_movies/\"))\n elsif genre == \"Family\"\n Nokogiri::HTML(open(\"https://www.rottentomatoes.com/top/bestofrt/top_100_kids__family_movies/\"))\n elsif genre == \"Mystery\"\n Nokogiri::HTML(open(\"https://www.rottentomatoes.com/top/bestofrt/top_100_mystery__suspense_movies/\"))\n elsif genre == \"Romance\"\n Nokogiri::HTML(open(\"https://www.rottentomatoes.com/top/bestofrt/top_100_romance_movies/\"))\n else genre == \"Science Fiction\"\n Nokogiri::HTML(open(\"https://www.rottentomatoes.com/top/bestofrt/top_100_science_fiction__fantasy_movies/\"))\n end\nend", "title": "" }, { "docid": "4879f4de7991c2345993472bedb32f8a", "score": "0.5927882", "text": "def fetch_movie_data_and_cache_in_json_files\n query = Imdb::Top250.new\n movies = query.movies.map do |m|\n HTTParty.get(\"http://www.omdbapi.com/?i=tt#{m.id}&plot=short&r=json\")\n end\n movies = fetch_movie_data_from_list\n File.open('db/data/movie_data.json', 'w') { |file| file.write(movies.to_json) }\nend", "title": "" }, { "docid": "1c641f864732175c731d834dc84a5f07", "score": "0.5910019", "text": "def parse_character_movies(films_hash)\n # some iteration magic and puts out the movies in a nice list\nend", "title": "" }, { "docid": "e4286aa7593355daa0afe7378a68fd86", "score": "0.5890411", "text": "def opening(m, params, url, num = 5)\n\n xml = fetchurl(url)\n unless xml\n m.reply \"faild to fetch feed\"\n return\n end\n\n begin\n doc = Document.new xml\n rescue => ex\n if xml.include? '<html>' then\n return m.reply(\"rottentomatoes rss feeds are currently down\")\n else\n return m.reply(\"error parsing feed: \" + ex)\n end\n end\n\n begin\n\n movies = []\n doc.elements.each(\"rss/channel/item\") {|e|\n\n title = e.elements[\"title\"].text.strip\n\n if not e.elements[\"RTmovie:tomatometer_percent\"].text.nil?\n # movie has a rating\n title = title.slice(title.index(' ')+1, title.length) if title.include? '%'\n percent = e.elements[\"RTmovie:tomatometer_percent\"].text + \"%\"\n rating = e.elements[\"RTmovie:tomatometer_rating\"].text\n else\n # not yet rated\n percent = \"n/a\"\n rating = \"\"\n end\n\n movies << OpenStruct.new({:title => title, :percent => percent, :rating => rating})\n }\n\n rescue => ex\n error ex.inspect\n error ex.backtrace.join(\"\\n\")\n\n end\n\n if num < movies.size then\n m.reply sprintf(\"displaying top %s of %s movies opening this weekend. use rt <num> to show more\", num, movies.size)\n end\n\n num = 5 if num < 0\n movies[0,num].each { |t|\n m.reply sprintf(\"%s - %s = %s\", t.title, t.percent, t.rating).strip\n }\n\n end", "title": "" }, { "docid": "6a3950730e30f2c553efc88c178cfabb", "score": "0.5854027", "text": "def movie(id, details = nil)\n get(\"/catalog/titles/movies/#{id.to_s}#{details.nil? ? \"\" : \"/#{details}\"}\")\n end", "title": "" }, { "docid": "98a22f732558730f35d391085b92e6c2", "score": "0.5853969", "text": "def recommended_movies\n details.css('.rec-title').reject do |node|\n # reject movies that don't have a release year yet\n node.at('span').nil?\n end.reject do |node|\n # reject everything other than featured film\n /\\d{4}-\\d{4}/.match(node.at('span').text) ||\n /Series|Episode|Video|Documentary|Movie|Special|Short|Game|Unknown/.match(node.at('span').text)\n end.map do |node|\n imdb_id = node.at(\"a[href^='/title/tt']\")['href'].parse_imdb_id\n title = node.at('a').text.strip\n year = node.at('span').text.parse_year\n\n [imdb_id, title, year]\n end.map do |values|\n Spotlite::Movie.new(*values)\n end\n end", "title": "" }, { "docid": "fb4090ef609389beb14065802af6b06d", "score": "0.58524567", "text": "def index\n page = 1\n request_url = MOVIE_DB_URL + \"&api_key=#{ENV[\"API_KEY\"]}\"\n request_url += \"&page=#{page}\"\n # if sort by release date\n # request_url += RELEASE_DATE_DESC_URL\n # if sort by title\n # request_url += RELEASE_DATE_DESC_URL;\n @movies = Unirest.get(request_url).body[\"results\"]\n end", "title": "" }, { "docid": "3ff820a26225cccf06e2918f5d4611bf", "score": "0.58489114", "text": "def movie\n @movie ||= parse_json\n end", "title": "" }, { "docid": "155d567680784083474d3ff5c5aba3f5", "score": "0.5845015", "text": "def get_tomato_movie_by_imdb_id(imdb_id) # if we take away self, we have to put in Film\n Film.get('http://api.rottentomatoes.com/api/public/v1.0/movie_alias.json?apikey=' + ENV['API_KEY'] + '&type=imdb&id=' + imdb_id, query: {imdb_id: imdb_id})\n end", "title": "" }, { "docid": "eb7cda48886802c82ba4788b54100e84", "score": "0.5840643", "text": "def get_movies\n\t\t@movies = Movie.order(\"RANDOM()\").where(\"release_date > ?\", 3.years.ago).order('random()').joins(:critic_movies).group('movies.id').having(\"count(movie_id) >= #{CUTOFF}\")\n\t\t.limit(750).to_a\n\t\t@movies.each do | movie | \n\t\t\tmovie.title = movie.title.split.map(&:capitalize).join(' ')\n\t\tend\n\t\t@movies = @movies.to_a.map(&:serializable_hash).to_json\n\t\trender :json => @movies\n\tend", "title": "" }, { "docid": "572ba36a48d0f30c96c4bfb2e7859a94", "score": "0.57865965", "text": "def query_imdb(search)\n url = URI.parse(\"http://www.omdbapi.com/?type=movie&s=#{URI::encode(search)}\")\n response = Net::HTTP.start(url.host, url.port) {|http|\n http.request(Net::HTTP::Get.new(url.to_s))\n }\n return parse_response(response.body) if response.code.to_i == 200\n puts 'Failed to query the imdb server'\nend", "title": "" }, { "docid": "476c4801986985fd58f234b3a927a9d2", "score": "0.5774992", "text": "def first_movie\n doc.search(\"a[title='Первый фильм']\").text\n end", "title": "" }, { "docid": "07037e4c105722a7269d4e1ac88eb8b1", "score": "0.5773893", "text": "def parse_json\n attributes = JSON.parse(document)\n Omdb::Movie.new(attributes)\n end", "title": "" }, { "docid": "4b9466343fac4990517d3686bd002caf", "score": "0.5766289", "text": "def parse_first_movie_id(doc)\n link = doc.at_css('#rw3 h4 a')\n link['href'].match(/movie_id=(?<movie_id>\\d+)/)[:movie_id]\n end", "title": "" }, { "docid": "5391ccd70f49e9c490244de495758cb4", "score": "0.5765271", "text": "def show\n \t@movie = Tmdb::Movie.detail(params[:id])\n \t@images = Tmdb::Movie.images(params[:id])\n \t@cast = Tmdb::Movie.casts(params[:id])\n \t@trailers = Tmdb::Movie.trailers(params[:id])\n \t@similar_movies = Tmdb::Movie.similar_movies(params[:id])\n end", "title": "" }, { "docid": "667d1443e0665a61604d9a05151f71e4", "score": "0.57370067", "text": "def download_movie_info(title)\n # Fetch movie data from IMBD per the title entered.\n raw_movie_data = Imdb::Search.new(title).movies.first\n\n # Organize the fetched movie data into array\n array_movie_data = []\n array_movie_data << raw_movie_data.title << raw_movie_data.year << raw_movie_data.company << raw_movie_data.genres.join(\", \").to_s << raw_movie_data.length << raw_movie_data.director << raw_movie_data.mpaa_rating << raw_movie_data.tagline << raw_movie_data.poster << raw_movie_data.release_date\n\n # Save the array into 'movies.csv' file as pipe-separated data for later access\n f = File.new('movies.csv', 'a+')\n f.puts(array_movie_data.join(\"|\"))\n f.close\n return array_movie_data\nend", "title": "" }, { "docid": "c4e60ad30c8a991c7d1fa4aefbab3252", "score": "0.573262", "text": "def print_movies(films)\n # some iteration magic and puts out the movies in a nice list\n films.each do |film|\n puts \"---------- #{film[\"title\"]} ----------\\n\"\n #puts \"Title: #{film[\"title\"]}\"\n puts \"Episode: #{film[\"episode_id\"]}\"\n puts \"Director: #{film[\"director\"]}\"\n puts \"Producer(s): #{film[\"producer\"]}\"\n puts \"Release Date: #{film[\"release_date\"]}\"\n puts \"This move had: #{film[\"characters\"].length} character(s), #{film[\"species\"].length} specie(s) & #{film[\"planets\"].length} planet(s)!!\"\n\n # puts \"Opening Crawl: #{film[\"opening_crawl\"][0..100]}\" + \"...\"\n end\nend", "title": "" }, { "docid": "e22d4a52b4016806ac8c9d92bdac332b", "score": "0.57301635", "text": "def show_movies\n puts \"****************************\"\n puts \"****************************\"\n puts \"Movie Information: \"\n puts \"Title: #{@title}\"\n puts \"Rated: #{@rated}\"\n puts \"Director: #{@director}\"\n puts \"Runtime: #{@runtime} Hours\"\n puts \"Reviews: #{@criticreview}\"\n puts \"****************************\"\n puts \"****************************\"\n end", "title": "" }, { "docid": "bd7e97066134aa9b4be04edc578d28b3", "score": "0.5728207", "text": "def show_character_movies(character)\n get_character_movies_from_api(character)\n # parse_character_movies(films_hash)\nend", "title": "" }, { "docid": "770c1265f2817c789a021a8e95ca1647", "score": "0.5723112", "text": "def show_character_movies(character)\n films = get_character_movies_from_api(character)\n print_movies(films)\n\n\n\nend", "title": "" }, { "docid": "d4f2751c94f44dd63e261f690340128f", "score": "0.57200754", "text": "def show_character_movies(character)\n films = get_character_movies_from_api(character)\n print_movies(films)\nend", "title": "" }, { "docid": "bc8c743a246592bc3a1bdffb6816f538", "score": "0.57131654", "text": "def get_movie_characters_from_api(movie)\nmovie_hash = make_search('http://www.swapi.co/api/films/')\ncharacters_array = []\n movie_hash[\"results\"].each do |item|\n if item[\"title\"].downcase == movie\n item[\"characters\"].each do |character| #urls \n character_info_hash = make_search(character)\n characters_array << character_info_hash\n end \n end\n end \n #characters_array #all the info on films an array of hashes\n parse_movie_character(characters_array)\nend", "title": "" }, { "docid": "77ab7efb2d09de5355dc84614505c3f9", "score": "0.57084334", "text": "def create_movie(movie)\n# puts movie.inspect\n props=[:movie_id, :title,:tagline,:released].find_all{ |p| movie[p] }.collect { |p| \"#{p} : '#{clean(movie[p])}'\" }.join(', ')\n actors = movie[:actors].collect { |a| \"create unique movie<-[:ACTED_IN {role : '#{clean(a[:role])}'}]-({id : '#{a[:id]}', name: '#{a[:name]}'})-[:PERSON]->people \"}.join(\" \\n\") + \"\\n\"\n directors = movie[:directors].collect { |a| \"create unique movie<-[:DIRECTED]-({id : '#{a[:id]}', name: '#{a[:name]}'})-[:PERSON]->people \"}.join(\" \\n\") + \"\\n\"\n genres = movie[:genres].collect { |g| \"create unique movie-[:GENRE]->({genre : '#{g}'})-[:GENRE]->genres \"}.join(\" \\n\")\n \" start root=node(0) \n match\n root-[:GENRES]->genres, \n root-[:MOVIES]->movies, \n root-[:PEOPLE]->people \n create movie={#{props}} \n \" + genres + actors + directors + \";\"\nend", "title": "" }, { "docid": "583105bdae7d281493c8587b8fdd1e38", "score": "0.56981957", "text": "def video_gallery_document\n @video_gallery_document ||= Nokogiri::HTML(Imdb::Person.find_by_id(@id, 'videogallery'))\n end", "title": "" }, { "docid": "28c772a42a4988c7179b400c05c129ae", "score": "0.5690102", "text": "def pull_movies(options = {})\n response = HTTParty.get(build_url('movie', options), headers: HEADERS, debug_output: $stdout)\n JSON.parse(response.body)\n end", "title": "" }, { "docid": "1e4e809b4584a81b5a08d719f2ec4ee9", "score": "0.56876916", "text": "def show_character_movies(character)\n films = get_character_movies_from_api(character)\n #print_movies(films)\nend", "title": "" }, { "docid": "f37d606223ead9ce8d8ed4dd7c31dd2d", "score": "0.56675625", "text": "def movies\n movies = []\n @rating_list.each_value do |rating|\n movies << rating.movie_id\n end\n return movies\n end", "title": "" }, { "docid": "cf9d152f30079110e1f5663eaf420db6", "score": "0.5663183", "text": "def print_movies(films)\n films.each do |film|\n puts film[\"title\"]\n end\nend", "title": "" }, { "docid": "f2bfecb7ebc430ca8891b7eea4168836", "score": "0.5660798", "text": "def callAPI(name)\n unless name.nil?\n # I chose to use the title_popular option over the title_exact option since\n # we don't know the full title and over the title_substring since it seemed\n # to return videos related to our search term instead of movies\n json = JSON.parse(open(\"http://www.imdb.com/xml/find?json=1&nr=1&tt=on&q=#{name}\") { |x| x.read })\n # Should do more date validation but I will assume it's always the first 4 characters\n return \"Title: \" + json[\"title_popular\"][0][\"title\"] + \"\\nYear: \" + json[\"title_popular\"][0][\"title_description\"][0..3] unless json[\"title_popular\"].nil?\n \"No movie with the specified title\"\n else\n \"Please specify a movie title\"\n end\nend", "title": "" }, { "docid": "56430f3fce1053766e83b0a34ef65536", "score": "0.5658577", "text": "def show\n @page_title = @genre.name\n @pagy, @movies = pagy(@genre.movies.where(status: 0).order(popularity: :desc, release_date: :desc), items: @per_page)\n end", "title": "" }, { "docid": "e5474e6b5b035cc6ef6e577eb03071b4", "score": "0.56351495", "text": "def build_movie(movie_file)\n extension = File.extname(movie_file)\n \n if(extension == \".xml\")\n return build_from_xml(movie_file)\n elsif(extension == \".json\")\n update_all(\"MovieBuilder\", \"Creating movie from JSON\")\n json_builder = JSONBuilder.new\n return json_builder.build_movie(movie_file)\n else\n update_all(\"MovieBuilder\", \"Unknown extension. See documentation for supported formats and markups\")\n end\n return nil\n end", "title": "" }, { "docid": "3ac9ce12c5f786dcfe4a85346c10e070", "score": "0.5631013", "text": "def index\n @omdb_movies = OmdbMovie.all\n end", "title": "" }, { "docid": "9c1aed758bcb7a1f21189fe637636082", "score": "0.5610319", "text": "def pull_data\n @pulling = true\n\n model_updating\n\n # pull the page from the url\n page = Nokogiri::HTML(open(@url))\n \n # get the title for the film\n title = page.css(\"h1.film-title\").text\n define_singleton_method(:title, lambda{title})\n\n # get the runtime for the film\n runtime_cap = page.css(\".text-link\").text.match(/(\\d+) mins/)\n if runtime_cap\n runtime = runtime_cap.captures[0].to_i\n else\n runtime = 0\n end\n define_singleton_method(:runtime, lambda{runtime})\n\n # get the tagline for the film\n tagline = page.css(\".tagline\").text\n define_singleton_method(:tagline, lambda{tagline})\n\n # get the overview for the film\n overview = page.css(\"div.truncate\").text.strip\n define_singleton_method(:overview, lambda{overview})\n \n @pulled = true\n @pulling = false\n\n model_updated\n end", "title": "" }, { "docid": "596722579937ef7e13a793a93a1b7f7c", "score": "0.5609243", "text": "def moviePage\n 1197628\nend", "title": "" }, { "docid": "2ab0c051c70051ebf2d828762edade9d", "score": "0.56045055", "text": "def parse_character_movies(character)\n get_character_movies_from_api(character).collect do |film_name|\n film_resp_string = RestClient.get(film_name)\n JSON.parse(film_resp_string)\n end \n response_hash[\"results\"].each do |hash|\n if character == hash[\"name\"]\n desired_films = hash[\"films\"]\n end\nend\n desired_films\nend", "title": "" }, { "docid": "50ff7f2b3a1dd4c0d2680fa46d709a84", "score": "0.56014407", "text": "def index\n if params[:s]\n @movies = Movie.where(\"title LIKE '\\%#{params[:s]}\\%'\").order('created_at DESC').paginate :per_page => 20, :page => params[:page]\n @movies = Movie.where(\"alt_title LIKE '\\%#{params[:s]}\\%'\").order('created_at DESC').paginate :per_page => 20, :page => params[:page] unless @movies.size>0\n @movies = Movie.where(\"\\\"cast\\\" LIKE '\\%#{params[:s]}\\%'\").order('created_at DESC').paginate :per_page => 20, :page => params[:page] unless @movies.size>0\n @movies = Movie.where(\"\\\"director\\\" LIKE '\\%#{params[:s]}\\%'\").order('created_at DESC').paginate :per_page => 20, :page => params[:page] unless @movies.size>0\n elsif params[:m]\n @movies = Movie.where(\"tvserie != ''\").order('created_at DESC').paginate :per_page => 20, :page => params[:page]\n else\n if params[:order]\n case params[:order]\n when 'score'\n order = \"imdb_score DESC\"\n when 'title'\n order = \"title ASC\"\n when 'year'\n order = \"year DESC\"\n when 'average'\n order = \"average_score DESC\"\n end\n else\n order = \"created_at DESC\"\n end\n if params[:genre]\n @movies = Movie.tagged_with(params[:genre]).order(order).paginate(:per_page => 20, :page => params[:page]) unless @movies\n else\n @movies = Movie.order(order).paginate(:per_page => 20, :page => params[:page]) unless @movies\n end\n end\n\n respond_to do |format|\n format.html # index.html.erb\n #format.iphone # index.iphone.erb\n format.rss { render :layout => false } #index.rss.builder\n format.json { render_for_api :base, :json => @movies }\n format.xml { render_for_api :base, :xml => @movies, :root => :movies }\n end\n end", "title": "" }, { "docid": "f97a09f5e9de6cd28e7323b59cef2ae3", "score": "0.55972034", "text": "def show_character_movies(character)\n films_hash = get_character_movies_from_api(character)\n\n if films_hash\n parse_character_movies(films_hash)\n else\n puts \"Cannot find character\"\n end\nend", "title": "" }, { "docid": "4ee433be90e3a72fc991b8239ef24acc", "score": "0.5580995", "text": "def search_movies(name)\n # The TMDB api wrapper returns an instance of a 'results' object\n # This object (OpenStruct?) contains the meta data of the request made to the api\n # in a instance variable called table, which also contains a list of TMDB::Movie\n # Objects that represent the movies the api returned as results of the search\n\n # Store the raw results object from the api\n results_object = Tmdb::Search.movie(name)\n\n # Check if the part of the 'results' object that contains the actual list of movies\n # is empty and if it is return nil (Meaning movie was not found) and exit the function\n if results_object.instance_variable_get('@table')[:results][0] == nil\n return nil\n end\n\n # Strip the results object of the attributes and store them in the results hash\n results_hash = results_object.instance_variable_get('@table')\n # Get the list of movies and store them in an array\n movie_array = results_hash[:results]\n # map over the array to substitute a hash for each movie object containing only their\n # name and id (also stored under @table instance variable on the object)\n movie_array.map do |movie|\n {\n name: movie.instance_variable_get('@table')[:title],\n id: movie.instance_variable_get('@table')[:id]\n }\n end\n # returns the array\n end", "title": "" }, { "docid": "70a72116dd02d71bab85f7061b2e8ffb", "score": "0.5570603", "text": "def populate_db_titles\n\n setup_population\n while !@total_pages || @pages_retrieved < @total_pages\n response = movie_api.pull_movies(set_discover)\n unless response[\"success\"] || response[\"results\"]\n puts \"Request Error: #{response[\"status_message\"]}, #{response[\"status_code\"]}\"\n break\n end\n\n set_pages(response[\"total_pages\"], response[\"page\"])\n Movie.save_movies(response[\"results\"])\n ddos_protect(movie_api::MAX_PER_MIN)\n end\n\n end", "title": "" }, { "docid": "f2a7565c06f15cb740549c94c4d5fe67", "score": "0.5560389", "text": "def show\n\t\tmr = MovieRetriever.new\n\t\t@movie = mr.get_movie(params[:id])\n\t\t@movie[\"ratings\"] = Rating.by_movie(params[:id])\n\t\t@movie[\"reviews\"] = Review.by_movie(params[:id])\n\n\t\tif params[\"page\"].to_i >= 2\n\t\t\t@movie[\"reviews\"] = Review.by_movie(params[:id], params[\"page\"].to_i)\n\t\tend\n\n\t\tif params[\"page\"]\n\t\t\t@next_page = params[\"page\"].to_i + 1\n\t\telse\n\t\t\t@next_page = 2\n\t\tend\n\n\t\tif Review.by_movie(@movie[\"id\"], @next_page).size >= 1\n\t\t\t@movie[\"more_reviews\"] = true\n\t\telse \n\t\t\t@movie[\"more_reviews\"] = false\n\t\tend\n\n\t\t@poster = mr.poster_config(3)\n\t\tif @movie[\"title\"] == nil\n\t\t\trender plain: \"Uhhh your movie doesn't seem to exist in the database. Maybe we took a wrong turn at Albuquerque...\"\n\t\tend\n\tend", "title": "" }, { "docid": "2ffd01b08d3402c017b9bcb2fe764f86", "score": "0.55280995", "text": "def get_character_movies_from_api(character)\n #make the web request\n all_characters = RestClient.get('http://www.swapi.co/api/people/')\n character_hash = JSON.parse(all_characters)\n film_urls = get_film_urls(character_hash, character)\n\n parse_character_movies(parse_films(film_urls))\nend", "title": "" }, { "docid": "0eebea349d6615d9836704aff7009ad6", "score": "0.55231595", "text": "def scrape_altgenres(starting_number)\n n = starting_number\n loop do\n begin \n netflix_page = agent.get(\"http://movies.netflix.com/WiAltGenre?agid=#{n}\")\n rescue \n retry\n end\n genre = netflix_page.at('#page-title a').content\n puts \"netflix genre #{n} is #{genre}\"\n File.open(\"netflix_genres.txt\", 'a+') {|f| f.write( n.to_s + \"\\t\" + genre + \"\\n\") } \n n += 1\n end \nend", "title": "" }, { "docid": "3b9060a8c9c733675a40db34bc223aa4", "score": "0.5522284", "text": "def show\n @movies = Genre.find(params[:id]).movies\n p @movies\n end", "title": "" }, { "docid": "73e5f7244a5981f6266908cbb2616644", "score": "0.5518573", "text": "def main_page\n Nokogiri::HTML(open(\"http://mars.jpl.nasa.gov/msl/multimedia/raw/\"))\n end", "title": "" }, { "docid": "dc0135ff3ec02337e6c61f43743633d7", "score": "0.55016804", "text": "def search_query(output_vars, predicates)\n variables = output_vars.map do |var|\n (var.is_a? Symbol) ? var.to_s.prepend('?') : var\n end\n q = %Q(\n SELECT ?id ?title ?release_date ?imdb #{variables.join(' ')}\n WHERE {\n ?movies rdf:type movie:film .\n ?movies movie:filmid ?id .\n ?movies rdfs:label ?title .\n ?movies movie:initial_release_date ?release_date .\n #{predicates}\n ?movies foaf:page ?imdb .\n FILTER regex(str(?imdb), '^http://www.imdb.com/title/')\n }\n ORDER BY ?title\n )\n response = RemoteData.linkedmdb_query(q)\n movies = response[:results][:bindings].map do |binding|\n movie = OpenStruct.new\n binding.keys.each do |attr|\n movie[attr] = binding[attr][:value]\n end\n movie[:imdb] = binding[:imdb][:value].split('/').last\n movie\n end\n movies\n end", "title": "" }, { "docid": "1b376da5d7d8bd004552f70888a56e5f", "score": "0.5495338", "text": "def initialize(imdb_id)\n @imdb_id = imdb_id\n @url = \"http://www.imdb.com/name/nm#{imdb_id}/\"\n end", "title": "" }, { "docid": "f5d69aca7ada1587d727c46153a95256", "score": "0.5492184", "text": "def set_movie\n if params[:imdb_code].nil?\n @movie = Movie.find(params[:id])\n else\n @movie = Movie.find_by_imdb_code(params[:imdb_code])\n end\n end", "title": "" }, { "docid": "305de20aafe7bf8ce4151308ac0f607e", "score": "0.5492124", "text": "def index\n @search = NiconicoMovie.search(params[:q])\n @niconicomovies = @search.result.order(\"id DESC\").page(params[:page]).per(25)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @niconicomovies }\n end\n end", "title": "" }, { "docid": "801baadaa369e8c8230b9d3477f50f8f", "score": "0.54919046", "text": "def set_omdb_movie\n @omdb_movie = OmdbMovie.find(params[:id])\n end", "title": "" }, { "docid": "8dcf29879b6807719717545e57d6b67c", "score": "0.54905504", "text": "def print_movies(films)\n # some iteration magic and puts out the movies in a nice list\n films.each do |film|\n response_string = RestClient.get(film)\n response_hash = JSON.parse(response_string)\n puts response_hash[\"title\"]\n end\nend", "title": "" }, { "docid": "0ceac7c2b50d7d3fffdf8bda1e4f26ef", "score": "0.5490402", "text": "def index\n @movie = Movie.find(params[:movie_id])\n end", "title": "" }, { "docid": "bd7ffb23eee6c4f67b4cd6c9f9e1687f", "score": "0.54852796", "text": "def index\n @movies = Movie.all\n\t# @alloCineJson = JSON.parse(open(\"http://api.allocine.fr/rest/v3/movielist?partner=YW5kcm9pZC12M3M&count=25&filter=nowshowing&order=toprank&format=json\").read)[\"feed\"]\n\t@alloCineJson = JSON.parse(open(\"http://api.allocine.fr/rest/v3/movielist?partner=YW5kcm9pZC12M3M&count=40&filter=nowshowing&order=toprank&format=json&profile=small\").read)[\"feed\"]\n\tresponse = {}\n\tmovies = []\n\t@alloCineJson[\"movie\"].each{ |mv|\n\t\tmovie=Movie.where(:alloCineCode => mv[\"code\"]).first\n\t\tif !movie\n\t\t\tmovie = Movie.create(:alloCineCode => mv[\"code\"], :title=>mv[\"title\"])\n\t\tend\n\t\tmovieHash = {}\n\t\tmovieHash[\"id\"] = movie.id\n\t\tmovieHash[\"code\"] = movie[\"title\"]\n\t\tmovieHash[\"code\"] = mv[\"title\"]\n\t\tmovieHash[\"title\"] = mv[\"title\"]\n\t\tmovieHash[\"poster\"] = mv[\"poster\"][\"href\"]\n\t\tmovies << movieHash\n\t}\n\tresponse[\"movies\"] = movies\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: response }\n end\n end", "title": "" }, { "docid": "f0c27e855bbbf373c6ac5b6ce9db1fde", "score": "0.54850113", "text": "def parse_character_movies(films_hash)\n films_hash.each do |film|\n puts # blank line\n puts \"Your character appears in:\"\n puts \"Star Wars Episode #{film[\"episode_id\"]}\"\n puts film[\"title\"]\n puts film[\"opening_crawl\"]\n end\nend", "title": "" }, { "docid": "28543ce91d1c06c1908d0b2a72b46a4b", "score": "0.54811776", "text": "def parse_character_movies(films_hash)\n # binding.pry\n films_hash.each_with_index do |movie_url, num|\n get_movie_info = RestClient.get(movie_url)\n movie_info = JSON.parse(get_movie_info)\n title = movie_info[\"title\"]\n puts \"#{num+1}. #{title}\"\n end\n\nend", "title": "" }, { "docid": "77a38f782cb4fd0f4a7218a13b2b85e9", "score": "0.54752487", "text": "def get_popular_movies\n\t\t\tmovies = Array.new\n\t\t\tname = \"TmdbService#GetPopularMovies\"\n\t\t\tpath = \"/3/movie/popular\"\n\t\t\tparams = {\n api_key: @key\n\t\t\t}\n\t\t\t@headers.merge('X-Service-Name' => name)\n\t\t\tbegin\n \traw_response = @conn.get(path, params, @headers)\n\t\t\trescue\n\t\t\t\t#do something exceptional\n\t\t\tend\n\t\t\tmovies = @data_mapper.list_of_movies(raw_response)\n\t\tend", "title": "" } ]
12a862c73df20dd995e7b6c34629e12d
Whether the end of this input method has been reached, returns +true+ if there is no more data to read. See IOeof? for more information.
[ { "docid": "9f663cd14cc2f4c4c1bda01d6352bdbc", "score": "0.8012307", "text": "def eof?\n @eof\n end", "title": "" } ]
[ { "docid": "7efb7bd15fe0e51bab09723fee77e806", "score": "0.8427429", "text": "def eof?\n @input.eof?\n end", "title": "" }, { "docid": "37aca095aebd40ec4c37ab990ac5972f", "score": "0.832628", "text": "def eof?\n @io.eof?\n end", "title": "" }, { "docid": "37aca095aebd40ec4c37ab990ac5972f", "score": "0.832628", "text": "def eof?\n @io.eof?\n end", "title": "" }, { "docid": "37aca095aebd40ec4c37ab990ac5972f", "score": "0.832628", "text": "def eof?\n @io.eof?\n end", "title": "" }, { "docid": "0a1f273c619a1951b4e1505378cd4d4f", "score": "0.8318066", "text": "def eof?\n if @buffer.size > 0\n false\n else\n @io.eof?\n end\n end", "title": "" }, { "docid": "3452fd7adcb1fcb47a0746994be807ad", "score": "0.82539546", "text": "def eof?\n @stdin.eof?\n end", "title": "" }, { "docid": "3452fd7adcb1fcb47a0746994be807ad", "score": "0.82539546", "text": "def eof?\n @stdin.eof?\n end", "title": "" }, { "docid": "3452fd7adcb1fcb47a0746994be807ad", "score": "0.82539546", "text": "def eof?\n @stdin.eof?\n end", "title": "" }, { "docid": "f0ad0bedcdaabeb54b9433e0193e3517", "score": "0.8233367", "text": "def eof?\n io.eof?\n end", "title": "" }, { "docid": "3cde62e15e0cd2b3a0a62c0c8a26062b", "score": "0.8093231", "text": "def eof?\n @read >= @size\n end", "title": "" }, { "docid": "01d0ce6c08ff15c29e36b6897adc7dd0", "score": "0.808894", "text": "def eof?\n\t\t\t\tfill_read_buffer if !@eof && @read_buffer.empty?\n\t\t\t\t\n\t\t\t\treturn @eof && @read_buffer.empty?\n\t\t\tend", "title": "" }, { "docid": "9478fbe394d20b81742c99ba72fda7d7", "score": "0.8054506", "text": "def eof?\n !@io || (@io.closed? || @io.eof?) && @buffer.empty?\n end", "title": "" }, { "docid": "9478fbe394d20b81742c99ba72fda7d7", "score": "0.8054506", "text": "def eof?\n !@io || (@io.closed? || @io.eof?) && @buffer.empty?\n end", "title": "" }, { "docid": "d7ebe6de74efeaa87af450ffccdd8ec3", "score": "0.8053915", "text": "def eof?\n @io.closed? || @io.eof?\n end", "title": "" }, { "docid": "e3acc042abff6439a1ef6953f1092561", "score": "0.8012644", "text": "def eof?\n @eof\n end", "title": "" }, { "docid": "e3acc042abff6439a1ef6953f1092561", "score": "0.8012644", "text": "def eof?\n @eof\n end", "title": "" }, { "docid": "e3acc042abff6439a1ef6953f1092561", "score": "0.8012644", "text": "def eof?\n @eof\n end", "title": "" }, { "docid": "1debc99de46b8ae2f12dda877b5e558d", "score": "0.7957908", "text": "def eof?\n if @stdin.wait_readable(0.00001)\n c = @stdin.getc\n result = c.nil? ? true : false\n @stdin.ungetc(c) unless c.nil?\n result\n else # buffer is empty\n false\n end\n end", "title": "" }, { "docid": "d82f04d1736ff78ba8cb7c2cacd7c639", "score": "0.7953812", "text": "def eof?\n $stdin.closed?\n end", "title": "" }, { "docid": "ca7fa8287a8012cf7e9b3f01a6afdb5b", "score": "0.79524726", "text": "def eof?\n return @stream.eof?\n end", "title": "" }, { "docid": "a36d7c3f097a4d51fbe27019adc36dfd", "score": "0.7923191", "text": "def eof?\n @stream.eof?\n end", "title": "" }, { "docid": "adb7183a11d3c7cb8431a8f1fff32a08", "score": "0.7903363", "text": "def eof?\r\n false\r\n end", "title": "" }, { "docid": "b3b24b4775ab330aa84b55d4fbc86fce", "score": "0.777345", "text": "def at_end?\n peek.type == :eof\n end", "title": "" }, { "docid": "92bfc079644cbd3221aa319a8f4a5569", "score": "0.7767067", "text": "def eof?\n @pos == @data.bytesize\n end", "title": "" }, { "docid": "0f4106ee3a62eaf225a23f3365c7800b", "score": "0.77192146", "text": "def eof?()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "67988095ce2ff7b33b9795a40ec2fade", "score": "0.77071553", "text": "def eof?\n ready_token\n if @buffer\n @buffer.empty? && @io.eof?\n else\n @io.eof?\n end\n end", "title": "" }, { "docid": "a6b5ef97b12eaa74eb3a0f9b17b13259", "score": "0.7697173", "text": "def eof?\n end", "title": "" }, { "docid": "61a45d937bb41c63463f2f09d09e5c41", "score": "0.76912916", "text": "def eof?\n not busy?\n end", "title": "" }, { "docid": "5e9a00d31def0d467f30faab21c45edd", "score": "0.7646698", "text": "def eof?\n raise IOError, 'not opened for reading' if closed?\n @total == @size && @buffer.empty?\n end", "title": "" }, { "docid": "48156b58c78e1afd3b5b7087e57b55b7", "score": "0.76062226", "text": "def eof_found?\n @eof_found\n end", "title": "" }, { "docid": "7ed3263dbc6eae891b70d7fec2128447", "score": "0.75143504", "text": "def eof?\n wait_for_chars(1)\n @cursor == @buffer.length && @eof_found\n end", "title": "" }, { "docid": "6a96917257c487277b90673a2da55a5b", "score": "0.7500592", "text": "def end_of_stream?\n @next_chunk.nil?\n end", "title": "" }, { "docid": "44c175024135645dfb217bf2b103f065", "score": "0.74618", "text": "def eof?\n stream = @_st_stream\n stream and stream.eof?\n end", "title": "" }, { "docid": "757e92ecaa0d67a8734dfd2d768308de", "score": "0.7457943", "text": "def eof?\n fill_rbuff if !@eof && @rbuffer.empty?\n @eof && @rbuffer.empty?\n end", "title": "" }, { "docid": "b0469d9f01f4e323f2ebf5093b2b5235", "score": "0.7412038", "text": "def eof?() end", "title": "" }, { "docid": "b0469d9f01f4e323f2ebf5093b2b5235", "score": "0.7412038", "text": "def eof?() end", "title": "" }, { "docid": "b0469d9f01f4e323f2ebf5093b2b5235", "score": "0.7412038", "text": "def eof?() end", "title": "" }, { "docid": "381f660533fcc5288f2bd7cd014d7936", "score": "0.73788697", "text": "def eof\n @pushback.nil? and (@input.nil? or @input.eof)\n end", "title": "" }, { "docid": "a84fbf926b8cf5403cf562fed5ecbf94", "score": "0.7365459", "text": "def eof?\n @position >= @size\n end", "title": "" }, { "docid": "c5584e679dd6bda8e3c5b80f35fe0da7", "score": "0.73610854", "text": "def readable_after_eof?\n false\n end", "title": "" }, { "docid": "c5584e679dd6bda8e3c5b80f35fe0da7", "score": "0.73610854", "text": "def readable_after_eof?\n false\n end", "title": "" }, { "docid": "945039f12656e70c5021d57c31d93780", "score": "0.7306711", "text": "def eof\n if @sio_closed_read ; __require_readable ; end\n @sio_pos >= @sio_string.length\n end", "title": "" }, { "docid": "fa7d23dd9e0bfea77cbf4f80869ebdcf", "score": "0.72562355", "text": "def readable_after_eof?\n true\n end", "title": "" }, { "docid": "fa7d23dd9e0bfea77cbf4f80869ebdcf", "score": "0.72562355", "text": "def readable_after_eof?\n true\n end", "title": "" }, { "docid": "fa7d23dd9e0bfea77cbf4f80869ebdcf", "score": "0.72562355", "text": "def readable_after_eof?\n true\n end", "title": "" }, { "docid": "8191fa536209f047d9e215d5d398a929", "score": "0.7238867", "text": "def prim_eof?\n false\n end", "title": "" }, { "docid": "bd09d07bcf31f344713a33a7f834b1c3", "score": "0.71786857", "text": "def readable_after_eof?\n true\n end", "title": "" }, { "docid": "bd09d07bcf31f344713a33a7f834b1c3", "score": "0.71786857", "text": "def readable_after_eof?\n true\n end", "title": "" }, { "docid": "bd09d07bcf31f344713a33a7f834b1c3", "score": "0.71786857", "text": "def readable_after_eof?\n true\n end", "title": "" }, { "docid": "bd09d07bcf31f344713a33a7f834b1c3", "score": "0.71786857", "text": "def readable_after_eof?\n true\n end", "title": "" }, { "docid": "bd09d07bcf31f344713a33a7f834b1c3", "score": "0.71786857", "text": "def readable_after_eof?\n true\n end", "title": "" }, { "docid": "8404862ebe524c7658613b01985df2d6", "score": "0.7132318", "text": "def eof?; @io.size == @rio end", "title": "" }, { "docid": "b6918b494739184eb3726da5f3d523e7", "score": "0.7041744", "text": "def input_finished?\n @output_buffer.empty? && internal_input_finished?\n end", "title": "" }, { "docid": "6e25abc3b5257cfa12e7d88b3ea6b642", "score": "0.70262754", "text": "def eof?\n code == FX_EOF\n end", "title": "" }, { "docid": "43aa5d40687331aa0e430a4c97e5a04b", "score": "0.70182675", "text": "def eof?\n ref_line.nil? && output_line.nil?\n end", "title": "" }, { "docid": "91793b1be89999ddc23757aea9dc356b", "score": "0.6991343", "text": "def eof?\n\t\tnot peak\n\tend", "title": "" }, { "docid": "ce1600a2925eeda65ad5bb57e6acff1b", "score": "0.69869024", "text": "def eof_flag\n @eof_flag\n end", "title": "" }, { "docid": "7f125258a6acdbc1037bc5daa96bc558", "score": "0.6982433", "text": "def eof?\n peek_lit(nil).nil?\n end", "title": "" }, { "docid": "c5d5e4711eb8c5075204fe7d23d7f300", "score": "0.6981464", "text": "def track_eof?\n true if track_eof\n end", "title": "" }, { "docid": "03325206d852a7502f87dc3ea4acb479", "score": "0.69786924", "text": "def eof?\n @stmt.done?\n end", "title": "" }, { "docid": "7b03a4d9c4688018f452bf738e43bcb0", "score": "0.69786775", "text": "def input_finished?\n @outputBuffer.empty? && internal_input_finished?\n end", "title": "" }, { "docid": "5cf6cc2242232c1f48dc2f394eda060d", "score": "0.69102526", "text": "def stream_is_done?\n @stream.nil? || @stream.closed? || @stream.eof?\n end", "title": "" }, { "docid": "a43e5059415b830f614eccfc931501e8", "score": "0.68996274", "text": "def read?\n !@read.nil?\n end", "title": "" }, { "docid": "4b9b526c1a95ad904e18261a29e297b8", "score": "0.6896134", "text": "def eof?\n @sock.closed?\n end", "title": "" }, { "docid": "806b53cc729fd7eb2dd98979ba6ed17c", "score": "0.6884858", "text": "def end?\r\n\t\tif(@allLines.empty?)\r\n\t\t\treturn true\r\n\t\telse\r\n\t\t\treturn false\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "28aba3dfe671a2a6e4d1cb1bd3d629a5", "score": "0.6860151", "text": "def eof?\n @state.eof_reached? && get_player_output.size < 1\n end", "title": "" }, { "docid": "9f685e0411764cd9f193cfdccbaa1940", "score": "0.6759001", "text": "def eof?\n @socket.eof?\n rescue IOError, SystemCallError\n true\n end", "title": "" }, { "docid": "e15e7e0336effd52668394e9ff120288", "score": "0.6758636", "text": "def eos?\n @pos >= @string.size\n end", "title": "" }, { "docid": "7cc5ecba5c9d6b5a35668f0a550ce32a", "score": "0.6601622", "text": "def eof?; end", "title": "" }, { "docid": "7cc5ecba5c9d6b5a35668f0a550ce32a", "score": "0.6601622", "text": "def eof?; end", "title": "" }, { "docid": "aca2c8f35c09a5005e8ee1832f6af9e9", "score": "0.65618366", "text": "def closed?\n io.closed?\n end", "title": "" }, { "docid": "9e5562732c567600820bf3bdd7afcd2a", "score": "0.6550231", "text": "def data_in_stdin?\n require 'fcntl'\n STDIN.fcntl(Fcntl::F_GETFL, 0) == 0 ? true : false\n end", "title": "" }, { "docid": "fa931c0ba7c44637e4d69bf92a646a4a", "score": "0.6530639", "text": "def closed?\n io.closed?\n end", "title": "" }, { "docid": "dce5a2d0b3e4cb34a1b0bf94f37d8d80", "score": "0.6525932", "text": "def given?\n return true unless @data.nil? || @data.empty?\n\n false\n end", "title": "" }, { "docid": "896e42d4733981239fd981a4f713b65c", "score": "0.6475389", "text": "def haspdueof?; return !@pdus[\"EOF\"].nil? end", "title": "" }, { "docid": "ce25bb6c3a9c7bed1877f058dc51595c", "score": "0.642876", "text": "def handle_eof\n # do this check again for thread safety\n if @state.eof_reached?\n STDOUT.flush\n @callback[:end_of_file].call\n @state.handle_eof\n end\n true\n end", "title": "" }, { "docid": "17fb08515af51307cb9b789a2ff8575d", "score": "0.6422513", "text": "def eof\n end", "title": "" }, { "docid": "48874fbac82b6991cfac60e5b00c0e03", "score": "0.6412905", "text": "def closed?\n @io.closed?\n end", "title": "" }, { "docid": "bb3e800634777f2da39551e802e44950", "score": "0.63706666", "text": "def input_complete?(next_input)\n InputParser.new(next_input).input.complete_command?\n end", "title": "" }, { "docid": "4521ad3ef87c8d407d5318304ed10ccd", "score": "0.63534087", "text": "def empty?\n @buffer.empty? && stream_is_done?\n end", "title": "" }, { "docid": "4ffcf2f08a545accd78d9d16fda9acc6", "score": "0.63457054", "text": "def next?\n !@push.nil? ? true : @input.nil? ? false : @input.empty? ? false : @index >= @input.length ? false : true\n end", "title": "" }, { "docid": "6458b7c68e0893f29d9b705baa57ad25", "score": "0.6330143", "text": "def closed_read?() end", "title": "" }, { "docid": "2fa26510fec3c44bd33b6bb67dbb7c3e", "score": "0.63228583", "text": "def eof!; end", "title": "" }, { "docid": "a0e44ac93a6dc755bd13f4ff8bf6bd04", "score": "0.6310471", "text": "def eof; @file.eof; end", "title": "" }, { "docid": "11c5b1b06eec9ee021ae3dc06b8c5f15", "score": "0.6289572", "text": "def end?()\n END_MARKER.equal? _next_element\n end", "title": "" }, { "docid": "9eb90e239e79e6b95ca7276f276e2a04", "score": "0.62710583", "text": "def eos?; end", "title": "" }, { "docid": "a76a49b4d3bdd41b126e04eed4e876dc", "score": "0.6270437", "text": "def finished?\n @buffer.size == @size\n end", "title": "" }, { "docid": "31650785416c0894dd3615b5abd11b9b", "score": "0.6257894", "text": "def complete?\n buff.length < @maxlen\n end", "title": "" }, { "docid": "7b36934c0a69f2c9877c41fcdbcc7a41", "score": "0.62232023", "text": "def empty?\n @stream.eof and @tokens.empty?\n end", "title": "" }, { "docid": "d6481a3b001b50d75abcb9d82a0ab1e0", "score": "0.6208658", "text": "def has_more?\n !@done || !@row_buffer.empty?\n end", "title": "" }, { "docid": "d813d8565d1a3d845de90004e5268a85", "score": "0.6185193", "text": "def closed_read?()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "2cccd601605b07365a7daca2f395499c", "score": "0.6174073", "text": "def element_end?\n @reader.node_type == XML::Reader::TYPE_END_ELEMENT\n end", "title": "" }, { "docid": "cec2c5fd23635f4876b75e687add4256", "score": "0.6149192", "text": "def alive?\n return false if closed?\n\n if IO.select([self], nil, nil, 0)\n !eof? rescue false\n else\n true\n end\n rescue IOError\n false\n end", "title": "" }, { "docid": "cec2c5fd23635f4876b75e687add4256", "score": "0.6149192", "text": "def alive?\n return false if closed?\n\n if IO.select([self], nil, nil, 0)\n !eof? rescue false\n else\n true\n end\n rescue IOError\n false\n end", "title": "" }, { "docid": "0f349780dafbf0a1484515472af77289", "score": "0.6146881", "text": "def closed_read?\n end", "title": "" }, { "docid": "b022cf8cb5f9a68552ba6afd10219349", "score": "0.61343145", "text": "def eof() end", "title": "" }, { "docid": "b022cf8cb5f9a68552ba6afd10219349", "score": "0.61343145", "text": "def eof() end", "title": "" }, { "docid": "b022cf8cb5f9a68552ba6afd10219349", "score": "0.61343145", "text": "def eof() end", "title": "" } ]
deaffe302290823e37b5dd328344d7db
Check if the host is responding.
[ { "docid": "f70410d1defd1350ea9ba7b5c65495fb", "score": "0.0", "text": "def port_open?(host, port)\n begin\n Timeout::timeout(1) do\n begin\n s = TCPSocket.new(host, port)\n s.close\n return true\n rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH\n return false\n end\n end\n rescue Timeout::Error\n end\n return false\nend", "title": "" } ]
[ { "docid": "d83de2a8136f35719999b2ae307aab36", "score": "0.73534924", "text": "def alive?(host)\n puts \"Checking host: #{host}\"\n Timeout::timeout(@timeout) do\n result = `ping -c 1 #{host}`\n if result.include?(\"time=\")\n return true\n end\n end\n rescue\n return false\n end", "title": "" }, { "docid": "f2556e2a27324de86d9ec71d8e9ee772", "score": "0.7332674", "text": "def check_host\n result = `ping -q -c 2 #{@conn[:host]}`\n # return true or false if exit status is 0\n $?.exitstatus == 0\n end", "title": "" }, { "docid": "71ab25fc555a5a14941f5fd225d874dd", "score": "0.7084833", "text": "def is_healthy?\n if @real_socket == nil\n logger.debug \"Performing health check for #{self}\"\n begin\n request = Packet.pack_request(\"echo_req\", \"ping\")\n response = send_request(request, 3)\n logger.debug \"Health check response for #{self} is #{response.inspect}\"\n raise ProtocolError unless response[0] == :echo_res and response[1] == \"ping\"\n return true\n rescue NetworkError\n logger.debug \"NetworkError -- unhealthy\"\n return false\n rescue ProtocolError\n logger.debug \"ProtocolError -- unhealthy\"\n return false\n end\n end\n end", "title": "" }, { "docid": "5a24a763557f81603efbd9a03159adce", "score": "0.70605034", "text": "def ifHostUp(host)\n Net::Ping::TCP.econnrefused = true\n Net::Ping::TCP.new(host).ping?\n end", "title": "" }, { "docid": "9e7fca09f9a79e870768b34144f74e7b", "score": "0.7001155", "text": "def running?\n begin\n ping\n rescue Errno::EBADF, Errno::ECONNREFUSED => e\n return false\n end\n return true\n end", "title": "" }, { "docid": "322dd85bd5251c258dd73fc9c888a9e2", "score": "0.69388324", "text": "def host_avail?(hostname)\n host_available = false\n puts \"Pinging host #{hostname}...\"\n exit_status = system(\"ping -q -c 1 #{hostname} >/dev/null 2>&1\")\n if exit_status\n puts \" --> Host #{hostname} is available.\"\n host_available = true\n else\n puts \" --> Host #{hostname} is unavailable!\"\n end\n host_available\n end", "title": "" }, { "docid": "2b0ef7b06f000451dafc13812966ef8f", "score": "0.6840082", "text": "def reachable?\n ping\n true\n rescue Orocos::ComError\n false\n end", "title": "" }, { "docid": "95354961e01a9ba5a727197b1390b141", "score": "0.6816437", "text": "def valid?\n ping\n end", "title": "" }, { "docid": "fa34243dae0529bbfbc2d1023ceae6b5", "score": "0.6805728", "text": "def ping(host)\n begin\n Timeout.timeout(5) do\n s = TCPSocket.new(host, 'echo')\n s.close\n return true\n end\n rescue Errno::ECONNREFUSED\n return true\n rescue Timeout::Error, Errno::ENETUNREACH, Errno::EHOSTUNREACH\n return false\n end\n end", "title": "" }, { "docid": "9105e869ddc3f8f042888f9885924d43", "score": "0.6791436", "text": "def alive?\n Utils::NetworkUtils.port_open?(@host, @port)\n end", "title": "" }, { "docid": "303f51669ca6c68a9ad5af65946fa6cf", "score": "0.6763754", "text": "def ping?(host = @host, options = {})\n ping(host, options).status_code == 0\n end", "title": "" }, { "docid": "eec193e22fd884c5f6b6fcfe4fec635f", "score": "0.6743961", "text": "def ping?\n cmd = \"ping -c #{@count} -i #{@wait} #{@host}\"\n\n # Execute command and handle resulting exit status from command.\n Open3.popen3(cmd) do |_, _, stderr, thread|\n case thread.value.exitstatus\n when 0 # At least one response was heard from the specified host.\n return true\n when 1 # (Linux) The transmission was successful but no responses were received.\n return false\n when 2 # (OSX) The transmission was successful but no responses were received.\n return false\n else # Error\n raise StandardError, \"Unknown return value from execution of command: #{cmd.inspect}\"\n end\n end\n end", "title": "" }, { "docid": "cfb3474474f194873cc8095548e26d56", "score": "0.6717462", "text": "def server_reachable?\n puts \"Checking #{@address}:#{@port}\"\n res = Net::HTTP.start(@address, @port) {|http| http.get('/') }\n return res.code == \"200\"\n end", "title": "" }, { "docid": "a5aa7e2f7a14f3b3011853072f5816a7", "score": "0.6715379", "text": "def alive?\n return false unless @socket\n if IO.select([@socket], nil, nil, 0)\n close\n return false\n end\n true\n end", "title": "" }, { "docid": "db7127ac6254a5c46830dab83479a0ab", "score": "0.6701634", "text": "def is_ok?\n return (self.status == HostResult::STATUS_OK)\n end", "title": "" }, { "docid": "91867c7caf524844a4b7fa393d5e095c", "score": "0.6694624", "text": "def check_host(host, path = '/', timeout = 5)\n begin\n status = Timeout::timeout(timeout) do\n Net::HTTP.start(URI.parse(host).host) do |http|\n response = http.get(path)\n\n if not response.code.match(/200/)\n log_error(\"Web Server down or not responding: #{response.code} #{response.message}\")\n return false;\n end\n\n if @test_regex && ! response.body.match(@test_regex)\n log_error(\"The response did not contain the regex '#{@test_regex}'\")\n return false\n end\n end\n end\n rescue SocketError => socket_error\n log_error(\"Error Connecting To Web: #{socket_error}\")\n return false;\n rescue TimeoutError => timeout_error\n log_error(\"Timeout occured checking #{host}#{path} after #{timeout} seconds.\")\n return false;\n rescue Exception => e\n log_error(\"An unknown error occured checking #{host}#{path}: #{e}\")\n return false;\n end\n\n return true\n end", "title": "" }, { "docid": "31ee6709e84b8c12c359152307f4d723", "score": "0.6603106", "text": "def host_is_okay\n return false unless @report_data[:host]\n return false unless valid_ip(@report_data[:host])\n return false unless @report_data[:state] == Msf::HostState::Alive\n if @args[:blacklist]\n return false if @args[:blacklist].include?(@report_data[:host])\n end\n return true\n end", "title": "" }, { "docid": "1ef22844a00fe1479ca6259ca2d49a2d", "score": "0.65892154", "text": "def wan_up?\n `ping -c 1 8.8.8.8 -W 1`.include? \"1 received\"\n end", "title": "" }, { "docid": "870451e68683ab49de3cd89831e4a576", "score": "0.6564017", "text": "def check\n tcp_socket_request\n mark_message \"Ping check to #{host}:#{port} successful\"\n rescue => e\n mark_message \"Error: '#{e}'\"\n mark_failure\n end", "title": "" }, { "docid": "dd49839faaa8871ab039a15b8f3a5f1b", "score": "0.6560936", "text": "def healthy?\n %w(run sleep).include?(@transmitter.status)\n end", "title": "" }, { "docid": "55021cc35d50095e850745d7cc73972d", "score": "0.6544338", "text": "def ping?\n false\n end", "title": "" }, { "docid": "9a089dbd92a7b6b7bbe2e2a0b5b689c1", "score": "0.65432996", "text": "def ping\n stats\n true\n rescue Errno::ECONNREFUSED\n false\n end", "title": "" }, { "docid": "916014aa4cf69d9e0e314b3300c808cd", "score": "0.6512557", "text": "def doi_server_reachable?\n Ezid::Client.new.server_status.up? rescue false\n end", "title": "" }, { "docid": "916014aa4cf69d9e0e314b3300c808cd", "score": "0.6512557", "text": "def doi_server_reachable?\n Ezid::Client.new.server_status.up? rescue false\n end", "title": "" }, { "docid": "916014aa4cf69d9e0e314b3300c808cd", "score": "0.6512557", "text": "def doi_server_reachable?\n Ezid::Client.new.server_status.up? rescue false\n end", "title": "" }, { "docid": "712c4bee58a9fe99b65e9037c68780e2", "score": "0.6504147", "text": "def alive?(ip)\n\n ping = \"ping -q -c 1 -w 4\"\n result = `#{ping} #{ip}`\n return $?.exitstatus == 0\n\n end", "title": "" }, { "docid": "49ce87b826a3437a9d610c4d6e96bb9c", "score": "0.6489403", "text": "def ping(host)\n begin\n Timeout.timeout(5) do\n s = TCPSocket.new(host, 'echo')\n s.close\n return true\n end\n rescue Errno::ECONNREFUSED\n return true\n rescue Timeout::Error, Errno::ENETUNREACH, Errno::EHOSTUNREACH\n return false\n end\nend", "title": "" }, { "docid": "33ed4dd7a65db0c8276bbe2fa4c3634b", "score": "0.6479633", "text": "def connected?\n @host && @port\n end", "title": "" }, { "docid": "1db512656d0b133f72b8ff40db2ef374", "score": "0.64732057", "text": "def server_probably_launched?\n success? || server_error?\n end", "title": "" }, { "docid": "38716876f7564ca83ed7ed405350ef49", "score": "0.6426562", "text": "def doi_server_reachable?\n # Invoke the API and get response\n true\n end", "title": "" }, { "docid": "1539f8f68553851ae714554f7098570d", "score": "0.6419135", "text": "def host_agent_ready?\n # Localhost\n uri = URI.parse(\"http://#{LOCALHOST}:#{@port}/\")\n req = Net::HTTP::Get.new(uri)\n\n response = make_host_agent_request(req)\n\n if response && (response.code.to_i == 200)\n @host = LOCALHOST\n return true\n end\n\n return false unless @is_linux\n\n # We are potentially running on Docker in bridged networking mode.\n # Attempt to contact default gateway\n uri = URI.parse(\"http://#{@default_gateway}:#{@port}/\")\n req = Net::HTTP::Get.new(uri)\n\n response = make_host_agent_request(req)\n\n if response && (response.code.to_i == 200)\n @host = @default_gateway\n return true\n end\n false\n rescue => e\n Instana.logger.error \"#{__method__}:#{File.basename(__FILE__)}:#{__LINE__}: #{e.message}\"\n Instana.logger.debug e.backtrace.join(\"\\r\\n\")\n return false\n end", "title": "" }, { "docid": "092d0820914183b354e9cdc9607a3659", "score": "0.6396852", "text": "def ping\n true\n end", "title": "" }, { "docid": "7c91e3e3a8372ae2265f052c49eda5f3", "score": "0.63433653", "text": "def started?\n begin\n ping\n return true\n rescue => ex\n return false\n end\n end", "title": "" }, { "docid": "5f0784b5272c2824d8a99d4c61d43a22", "score": "0.63362783", "text": "def ping(host)\n res = `ping #{host} -c 1`\n res.include?(\"0% packet loss\")\n end", "title": "" }, { "docid": "287e0a170060e51ba5a74a0a81a5c057", "score": "0.6309961", "text": "def connectable?\n begin; ping; rescue; false; end\n end", "title": "" }, { "docid": "1d7e2866fe391793f94020c3ed9cac5a", "score": "0.62860566", "text": "def alive?\n sock_arr = [ @socket ]\n if Kernel::select(sock_arr, nil, sock_arr, 0)\n # The eof? call is supposed to return immediately since select\n # indicated the socket is readable. However, if @socket is a TLS\n # socket, eof? can block anyway - see RUBY-2140.\n begin\n Timeout.timeout(0.1) do\n eof?\n end\n rescue ::Timeout::Error\n true\n end\n else\n true\n end\n end", "title": "" }, { "docid": "b92beadcf2b0826035c06e713a733242", "score": "0.6282944", "text": "def ping(host=@host)\n super(host)\n\n bool = false\n start_time = Time.now\n\n # Failure here most likely means bad host, so just bail.\n begin\n addr = Socket.getaddrinfo(host, port)\n rescue SocketError => err\n @exception = err\n return false\n end\n\n begin\n # Where addr[0][0] is likely AF_INET.\n sock = Socket.new(Socket.const_get(addr[0][0]), Socket::SOCK_STREAM, 0)\n\n # This may not be entirely necessary\n sock.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, 1)\n\n begin\n # Where addr[0][3] is an IP address\n sock.connect_nonblock(Socket.pack_sockaddr_in(port, addr[0][3]))\n rescue Errno::EINPROGRESS\n # No-op, continue below\n rescue Exception => err\n # Something has gone horribly wrong\n @exception = err\n return false\n end\n\n resp = IO.select(nil, [sock], nil, timeout)\n\n if resp.nil? # Assume ECONNREFUSED if nil\n if @@service_check\n bool = true\n else\n bool = false\n @exception = Errno::ECONNREFUSED\n end\n else\n sockopt = sock.getsockopt(Socket::SOL_SOCKET, Socket::SO_ERROR)\n\n if sockopt.int != 0\n if @@service_check && sockopt.int == Errno::ECONNREFUSED::Errno\n bool = true\n else\n bool = false\n @exception = SystemCallError.new(sockopt.int)\n end\n else\n bool = true\n end\n end\n ensure\n sock.close if sock\n end\n\n # There is no duration if the ping failed\n @duration = Time.now - start_time if bool\n\n bool\n end", "title": "" }, { "docid": "82ba47e12323f6fa493e790a07a2785c", "score": "0.6273166", "text": "def responds?\n begin\n @patron.head(\"/#{@path}/\")\n true\n rescue Patron::ConnectionFailed\n false\n end\n end", "title": "" }, { "docid": "4e936fc21cc0ef6d3246db45b4c4539f", "score": "0.6267607", "text": "def connected?\n with_timeout { listening? }\n end", "title": "" }, { "docid": "4e936fc21cc0ef6d3246db45b4c4539f", "score": "0.6267607", "text": "def connected?\n with_timeout { listening? }\n end", "title": "" }, { "docid": "30ae680aeb13c8da3889a6334fcee2c9", "score": "0.6257703", "text": "def ready_for_read?\n begin\n connected? && IO.select([socket], nil, nil, 0.1)\n rescue Exception\n triggered_close $!.message, :terminated\n raise\n end\n end", "title": "" }, { "docid": "b94c7b573deaef50526d3e3833e61091", "score": "0.62536573", "text": "def ping?\n tcp_ping.ping?\n end", "title": "" }, { "docid": "6f9e27d1ff097f961644eedee83a28c3", "score": "0.6234887", "text": "def try(host = 'nodeinfo.hype')\n begin\n Timeout::timeout(5) do\n return true if aaaa(host)\n end\n rescue Timeout::Error\n return false\n end\n end", "title": "" }, { "docid": "79e5411edd5882696a7fdef30e566253", "score": "0.6205149", "text": "def wait\n config.ui.logger.debug { \"Waiting for socket to become available; timeout after #{config.wait} seconds.\" }\n Timeout.timeout(config.wait) do\n until ready?\n config.ui.logger.debug { \"Sleeping 1 second.\" }\n sleep(1)\n end\n end\n true\n rescue Timeout::Error => e\n config.ui.logger.warn { \"socket(#{config.host}:#{config.port}) timeout!\" }\n false\n end", "title": "" }, { "docid": "44c6e31a048d8d4fb7134d183fd50b72", "score": "0.6204491", "text": "def healthy?\n return true\n end", "title": "" }, { "docid": "3d9a3d72a5701d260f7207da458ef307", "score": "0.6191033", "text": "def ready?\n config.host.nil? and log_and_raise(TCPSocketCheckError, \"You must supply a host!\")\n config.port.nil? and log_and_raise(TCPSocketCheckError, \"You must supply a port!\")\n\n socket = TCPSocket.new(config.host, config.port)\n\n if config.data.nil?\n config.ui.logger.debug { \"read(#{config.host}:#{config.port})\" }\n ((IO.select([socket], nil, nil, config.timeout) && socket.gets) ? true : false)\n else\n config.ui.logger.debug { \"write(#{config.host}:#{config.port}, #{config.data.size} bytes)\" }\n ((IO.select(nil, [socket], nil, config.timeout) && socket.write(config.data)) ? true : false)\n end\n\n rescue Errno::ETIMEDOUT, Errno::ECONNREFUSED, Errno::ECONNRESET, Errno::EHOSTUNREACH, Errno::EHOSTDOWN, Errno::ENETUNREACH => e\n config.ui.logger.debug { \"#{config.host}:#{config.port} - #{e.message}\" }\n false\n ensure\n (socket && socket.close)\n end", "title": "" }, { "docid": "a864fab192103b44c6f3d8d83696bf6a", "score": "0.6187975", "text": "def ready?(host, timeout = 60, sleep_time = 10, options = {})\n timeout_at = Time.now + timeout\n ip = resolve_host(host)\n return false if ip.empty?\n\n msg = \"Waiting for host #{host} (#{ip}); next attempt in #{sleep_time} seconds until #{timeout_at}\"\n\n nobj = Node.find_by_name(host)\n reboot_requesttime = nobj[:crowbar_wall][:wait_for_reboot_requesttime] || 0\n\n wait_until(msg, timeout_at.to_i, sleep_time, options) do\n port_open?(ip, 22) && reboot_done?(ip, reboot_requesttime, options) && ssh_cmd(ip, runlevel_check_cmd(host))\n end\n end", "title": "" }, { "docid": "214c7df444e5e9da0f2f812e26e25a0a", "score": "0.61775136", "text": "def exists?\n start_time = Time.now\n timeout = resource[:timeout]\n try_sleep = resource[:try_sleep]\n\n success = validator.attempt_connection\n\n while success == false && ((Time.now - start_time) < timeout)\n # It can take several seconds for an HTTP service to start up;\n # especially on the first install. Therefore, our first connection attempt\n # may fail. Here we have somewhat arbitrarily chosen to retry every 2\n # seconds until the configurable timeout has expired.\n Puppet.notice(\"Failed to make an HTTP connection; sleeping #{try_sleep} seconds before retry\")\n sleep try_sleep\n success = validator.attempt_connection\n end\n\n if success\n Puppet.debug(\"Connected to the host in #{Time.now - start_time} seconds.\")\n else\n Puppet.notice(\"Failed to make an HTTP connection within timeout window of #{timeout} seconds; giving up.\")\n end\n\n success\n end", "title": "" }, { "docid": "2f5add94502cc2e3c2e89dcbc508dffd", "score": "0.61693066", "text": "def ping\n return_code, response = send_command(\"ping\")\n return_code == \"200\"\n end", "title": "" }, { "docid": "138d0a4a81b129862fbe6150ad7af005", "score": "0.6168304", "text": "def ping?\n response = perform_request\n !!(response =~ Regexp.union(%r(<str name=\"status\">OK</str>), %r(\"status\":\"OK\")))\n end", "title": "" }, { "docid": "6f7e5bce54c51b6a2086c52137ac1664", "score": "0.61620224", "text": "def response_unavailable?\n !!(content_for_scanner =~ /Server too busy, try again later/)\n end", "title": "" }, { "docid": "999ae3af60c5ccef975d75745d9f3d85", "score": "0.61529726", "text": "def working?\n return true if @httpserv and @httpserv.working_count > 0\n return false\n end", "title": "" }, { "docid": "f8c5dffcb7263c621b95b6d0077a0b94", "score": "0.6151514", "text": "def server_running?\n http = Net::HTTP.new(\"localhost\", @port)\n req = Net::HTTP::Get.new(\"/index.html\")\n http.request(req).is_a?(Net::HTTPOK)\n rescue Errno::ECONNREFUSED\n false\n end", "title": "" }, { "docid": "e65c9d2902f15d41eb72cb48157999a4", "score": "0.61513466", "text": "def connected?\n !!@socket && @socket.alive?\n end", "title": "" }, { "docid": "9820a03c7f7b405ef94f89fe613b1b5e", "score": "0.6146725", "text": "def confirm_listening_on_port(port, timeout=10)\n checker_th = Thread.new { ssh_cmd \"while [[ `netstat -ln | grep :#{port} | wc -l` -lt 1 ]] ; do sleep 1; done\" }\n raise \"Nothing is listening on #{@ip}:#{port} after #{timeout} seconds\" unless checker_th.join(timeout)\n true\n end", "title": "" }, { "docid": "3451b7d6c2e913c787b08ad0336814c8", "score": "0.61297166", "text": "def check_connection\n one_wait = 5\n max_wait = 5\n request = Net::HTTP::Get.new('/')\n wait = 0;\n while (wait < max_wait)\n begin\n response = Net::HTTP.start(@url.host, @url.port) {|http|\n http.request(request)\n }\n break if Net::HTTPForbidden === response\n break if Net::HTTPNotFound === response\n break if Net::HTTPSuccess === response\n # When we try to connect to a down server with an Apache proxy, \n # we'll get Net::HTTPBadGateway and get here\n rescue Errno::ECONNREFUSED\n # When we try to connect to a down server without an Apache proxy, \n # such as a dev instance, we'll get here\n end\n sleep one_wait;\n wait += one_wait\n end\n if (wait == max_wait)\n puts(\"-- ERROR: couldn't connect to test host on \" + @url.host.to_s)\n return false\n end\n puts(\"-- SUCCESS: test host is alive !\\n\")\n return true\nend", "title": "" }, { "docid": "618e50fd76f143c688454d330ed66f4d", "score": "0.61183155", "text": "def ping?\n rpc.request Util::MessageCode::PING_REQUEST\n\n return rpc.status\n end", "title": "" }, { "docid": "3ab5b75d42812fcf548c8ae1f779756c", "score": "0.61099374", "text": "def listening?\n @listen_thread && @listen_thread.alive?\n end", "title": "" }, { "docid": "3327e9f39627f8da14be6f30a8e87c49", "score": "0.61087346", "text": "def alive?\n\t\tconnection.alive?\n\tend", "title": "" }, { "docid": "3327e9f39627f8da14be6f30a8e87c49", "score": "0.61087346", "text": "def alive?\n\t\tconnection.alive?\n\tend", "title": "" }, { "docid": "814aa8b31ff283f984247c0ad9fc1fee", "score": "0.61080307", "text": "def can_we_connect\n\t\tbegin\n\t\t\t@sys_time = @manager.get_value(\"sysUpTime.0\")\n\t\trescue SNMP::RequestTimeout => e\n\t\t\tprint_error(\"#{e}\")\n\t\t\tprint_error(\"Can't connect using '#{@string.chomp}'!\")\n\t\t\t$fail=1\n\t\tend\n\tend", "title": "" }, { "docid": "965d236d33f6ee7b97a525165cfc7eed", "score": "0.6104007", "text": "def ping\n @client.peek( name )\n return true\n end", "title": "" }, { "docid": "8df0e78bb1503fc3e1126ce52aeb4492", "score": "0.610311", "text": "def port_available? port\n server = TCPServer.open port\n server.close\n true\n rescue Errno::EADDRINUSE\n false\n end", "title": "" }, { "docid": "10ab261a0b12ae755e9e305d07207e02", "score": "0.61023706", "text": "def port_open?\n begin\n Timeout.timeout(1) do\n begin\n s = TCPSocket.new(@host, @port)\n s.close\n return true\n rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH\n return false\n end\n end\n rescue Timeout::Error\n return false\n end\n\n false\n end", "title": "" }, { "docid": "244d9471769c03082b5810ca188ea22e", "score": "0.6081479", "text": "def pingable?\n true\n end", "title": "" }, { "docid": "d86e85e7e953e631669e4b9f3ee4e7b0", "score": "0.60663056", "text": "def received_host?\n message? && target.downcase.eql?(@handler.bot.channel.name.downcase) &&\n /:\\w+ is now hosting you./.match?(@payload)\n end", "title": "" }, { "docid": "0605c3c428aaf6a3ab130fee34547737", "score": "0.60553014", "text": "def up?(host)\n check = Net::Ping::External.new(host)\n check.ping?\nend", "title": "" }, { "docid": "514e37a96eb017220b33ba0d5ef1c2f9", "score": "0.60485774", "text": "def alive?\n begin\n alive_check!\n return true\n rescue\n return false\n end\n end", "title": "" }, { "docid": "a9144cfcd41591b3432db00ab0d69e5b", "score": "0.6047233", "text": "def ping\n http_get('/') == 'Consul Agent'\n rescue\n false\n end", "title": "" }, { "docid": "efb12e99724b4766a8962f3979f8b8c0", "score": "0.60448587", "text": "def status\n return true unless config.managed?\n return false if pid.nil?\n\n begin\n Process.getpgid(pid)\n rescue Errno::ESRCH\n return false\n end\n\n begin\n TCPSocket.new(host, port).close\n\n Net::HTTP.start(host, port) do |http|\n http.request(Net::HTTP::Get.new('/'))\n end\n\n true\n rescue Errno::ECONNREFUSED, Errno::EINVAL\n false\n end\n end", "title": "" }, { "docid": "273588208877a95ef8cc2ff2c9ee6451", "score": "0.60406333", "text": "def port_bound?(host, port)\n Timeout.timeout(1) do\n s = TCPSocket.new(host, port)\n s.close rescue nil\n return true\n end\nrescue Timeout::Error, Errno::ECONNREFUSED, Errno::EHOSTUNREACH, \\\n Errno::ENETUNREACH, Errno::EACCES, Errno::ENOTCONN, \\\n Errno::EADDRNOTAVAIL\n return false\nend", "title": "" }, { "docid": "0812c6c93a150be4d55d0c04097a0281", "score": "0.6033509", "text": "def online?\n sock = UDPSocket.new()\n online = false\n begin\n sock.connect('193.0.14.129', 25) # that address is k.root-servers.net\n online = true\n sock.close\n rescue Exception => exception\n puts \"\n------------------------------------------------------------\nCannot bind to socket:\n #{exception}\n\nThis is an indication you have network problems.\nNo online tests will be run!!\n------------------------------------------------------------\n\"\n end\n online\nend", "title": "" }, { "docid": "c19503c45ac752395854a1269add9454", "score": "0.60319835", "text": "def socket?() end", "title": "" }, { "docid": "859131edcb5b6e02482da5cb789e17d2", "score": "0.60276556", "text": "def is_alive?\n res = @http_client.get_response( URI.parse(\"#{@url}/admin/ping?wt=ruby\") )\n \n if res.code != \"200\"\n raise IndexUnavailableError, \"Index HTTP error #{res.code}\"\n else\n data = eval(res.body)\n if data[\"status\"] === \"OK\"\n return true\n else\n raise IndexUnavailableError, \"Index Error: #{res.body}\"\n end\n end\n end", "title": "" }, { "docid": "fac1be9d69c66e6f1822292435703fae", "score": "0.60187846", "text": "def port_available?(port, ip = \"127.0.0.1\", seconds = 1)\n Timeout::timeout(seconds) do\n begin\n TCPSocket.new(ip, port).close\n false\n rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH\n true\n end\n end\n rescue Timeout::Error\n false\n end", "title": "" }, { "docid": "84828876dfcfc55d5603fc89b9ff8a90", "score": "0.6013112", "text": "def tcp_ssh_alive(hostname,port=22)\n tcp_socket = TCPSocket.new(hostname, port)\n readable = IO.select([tcp_socket], nil, nil, 5)\n if readable\n Chef::Log.debug(\"sshd accepting connections on #{hostname}, banner is #{tcp_socket.gets}\")\n true\n else\n false\n end\n \n rescue Errno::ETIMEDOUT\n false\n rescue Errno::EPERM\n false\n rescue Errno::ECONNREFUSED\n sleep 2\n false\n rescue Errno::EHOSTUNREACH, Errno::ENETUNREACH\n sleep 2\n false\n ensure\n tcp_socket && tcp_socket.close\n end", "title": "" }, { "docid": "cca9e0d1040d8caaffa739b7bfdae56c", "score": "0.60019433", "text": "def started?\n server_exist = false\n begin\n @soc = UDPSocket.open\n @soc.bind(\"\", DiscoverableServer::DEFAULT_PORT)\n @soc.close\n rescue Errno::EADDRINUSE\n server_exist = true\n end\n\n server_exist\n end", "title": "" }, { "docid": "80ccb357bfeee4eb820ff48335b9f449", "score": "0.59900767", "text": "def connected?\n start_ssh {|ssh| } # do nothing\n rescue *CONNECTION_EXCEPTIONS => ex\n @connection_error = ex\n return false\n else\n return true\n end", "title": "" }, { "docid": "ae15ff852fe2eec39bfc5c57e9ec6e04", "score": "0.59862256", "text": "def alive?\n return true if ws && ts\n return false\n end", "title": "" }, { "docid": "62ae66e3396499bcf7f987e753777396", "score": "0.5963752", "text": "def portainer?(ip, segundos=1) \n Timeout::timeout(segundos) do \n begin\n TCPSocket.new(ip, \"#{$port}\").close # Check Portainer port.\n true\n rescue Errno::ECONNREFUSED, Errno::EHOSTUNREACH, SocketError\n false # If Exception, do not count this host.\n end\n end\n rescue Timeout::Error # If Timeout, do not count this host.\n false\nend", "title": "" }, { "docid": "542709ccbb817eb4fc3385a5267950c0", "score": "0.5962817", "text": "def timeout?\n @status == :timeout\n end", "title": "" }, { "docid": "12984718a2f440a1d22b33498e19c75b", "score": "0.5957", "text": "def readable?\n return false if @socket.closed?\n r,_,_ = Kernel.select([@socket], nil, nil, @timeout) rescue nil\n return !(r.nil? or r.empty?)\n end", "title": "" }, { "docid": "9d4c89999ee32984f265ee2e7168fb8f", "score": "0.5954557", "text": "def server_available?\n !in_latency_window.empty?\n end", "title": "" }, { "docid": "db84ea8e0f352f46a5b7af10b567ebb2", "score": "0.59512395", "text": "def alive?\n unless(@recvthread.instance_of?(Thread))\n return false\n end\n \n ret=@recvthread.alive?\n @sendthreads.each_value{|t|\n ret&=t\n }\n ret&=(!@socket.closed?)\n \n return ret\n end", "title": "" }, { "docid": "15e40f1345fde9d2f499286ebd70d51b", "score": "0.5946434", "text": "def ping?\n false unless connected?\n false|stat('/')\n rescue ZK::Exceptions::KeeperException\n false\n end", "title": "" }, { "docid": "ee646e666c5825c5fe508cfbce3c5729", "score": "0.59291404", "text": "def is_error?\n return (self.status == HostResult::STATUS_ERROR)\n end", "title": "" }, { "docid": "7d78bd61ed33b0bec288dcd1d7bbddfd", "score": "0.5924574", "text": "def check_connection\n return\n check = HTTParty.get(\"#{@host}/api/process/check_connection?api_key=#{@api_key}\")\n if check.nil? || check[\"status\"][\"code\"] < 0\n @helper.terminate(\"Script was unable to establish connection with dFlow at #{@host}\")\n end\n end", "title": "" }, { "docid": "579790422341b0a8fbef2ee867c4aeaf", "score": "0.5921435", "text": "def computer_exists?(fwip)\n system(\"ping -c1 -w1 #{fwip}\")\nend", "title": "" }, { "docid": "1990d636a7ab91ce9bf7bafd2349e1cf", "score": "0.5919328", "text": "def server_is_available?\n return true\n !@http_client.send_request(:get, \"#{@configuration.protocol}://#{@configuration.host}:#{@configuration.port}\", nil, {:timeout => 5}).nil?\n end", "title": "" }, { "docid": "66b479d608660b95922a350ca2094210", "score": "0.59144527", "text": "def port_open?(ip, port, timeout)\n\n\tstart_time = Time.now\n\tcurrent_time = start_time\n \twhile (current_time - start_time) <= timeout\n\t\tbegin\n \t\t TCPSocket.new(ip, port)\n \t\t return true\n \t rescue Errno::ECONNREFUSED\n \t\t\tsleep 0.1\n \t\tend\n \t\tcurrent_time = Time.now\n \tend\n\n \treturn false\n\n end", "title": "" }, { "docid": "ed6d5d628e874ca63374794c84610246", "score": "0.59066737", "text": "def reachable?\n !!client\n end", "title": "" }, { "docid": "ed6d5d628e874ca63374794c84610246", "score": "0.59066737", "text": "def reachable?\n !!client\n end", "title": "" }, { "docid": "99aa4fc9edec59670b4180b3f77dcd63", "score": "0.5906344", "text": "def available?\n # If we haven't tried an ssh command yet, @available will be nil. Running\n # a first no-op command will populate it to true or false.\n if @available.nil?\n ssh_cmd 'echo ping' rescue nil\n end\n @available\n end", "title": "" }, { "docid": "74c201c3cda827e5779a2928cae4db7a", "score": "0.59028184", "text": "def waited_on_connect?\n @waited_on_connect\n end", "title": "" }, { "docid": "ccd3c1ad3a486f7fc8499342e503b2f2", "score": "0.5897096", "text": "def terminated?\n !! @status\n end", "title": "" }, { "docid": "a781dcdb43cc9e7971300fd40e7d18c7", "score": "0.589655", "text": "def connected?\n !!@socket\n end", "title": "" }, { "docid": "a781dcdb43cc9e7971300fd40e7d18c7", "score": "0.589655", "text": "def connected?\n !!@socket\n end", "title": "" }, { "docid": "48c92240eb9f7fcf2a7f5b187145e357", "score": "0.58934474", "text": "def running?\n @server_thread && @server_thread.alive?\n end", "title": "" }, { "docid": "369781a53e8fa1d399bbd929ef799732", "score": "0.5891925", "text": "def isAlive()\n if @hp > 0\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "199824410fbd319ec53f3987326e3518", "score": "0.58903074", "text": "def alive?\n return false if not @thread or not @fd\n @thread.alive?\n end", "title": "" }, { "docid": "234eed6f0503204797952709f81c5aa6", "score": "0.58895504", "text": "def healthy?\n !unhealthy?\n end", "title": "" } ]
e561e11bcf379ef5dc139c210017366b
Only allow a list of trusted parameters through.
[ { "docid": "ff4b8f132e6c7f8a499bdad2a803d7f4", "score": "0.0", "text": "def request_params\n params.require(:request).permit(:start_city, :start_street_address, :start_zip, :end_city, :end_street_address, :end_zip, :trip_time, :distance, :highest_price_to_pay, :matched_availability_id, :request_status)\n end", "title": "" } ]
[ { "docid": "c1f317213d917a1e3cfa584197f82e6c", "score": "0.69480115", "text": "def allowed_params\n ALLOWED_PARAMS\n end", "title": "" }, { "docid": "e662f0574b56baff056c6fc4d8aa1f47", "score": "0.6813417", "text": "def strong_params\n params.require(:listing_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "7ac5f60df8240f27d24d1e305f0e5acb", "score": "0.68023044", "text": "def parameters_list_params\n params.require(:parameters_list).permit(:name, :description, :is_user_specific)\n end", "title": "" }, { "docid": "a91e9bf1896870368befe529c0e977e2", "score": "0.67950493", "text": "def param_whitelist\n [:role, :title]\n end", "title": "" }, { "docid": "f12336a181f3c43ac8239e5d0a59b5b4", "score": "0.67457634", "text": "def param_whitelist\n whitelist = [\n :username, :name,\n :parent_id,\n :headline, :description, :video,\n :policy, :signup_mode, :category,\n :website, :facebook, :twitter, :linkedin,\n :founded_at,\n privacy: [\n :events,\n :resources\n ],\n permission: [\n :profile,\n :members,\n :children,\n :statistics,\n :posts,\n :listings,\n :resources,\n :events\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:parent_id)\n unless current_user.role_in(@community) === 'owner'\n whitelist.delete(:privacy)\n whitelist.delete(:permission)\n end\n end\n \n whitelist\n end", "title": "" }, { "docid": "e164094e79744552ae1c53246ce8a56c", "score": "0.6741017", "text": "def strong_params\n params.require(:user).permit(param_whitelist)\n end", "title": "" }, { "docid": "c25a1ea70011796c8fcd4927846f7a04", "score": "0.65274155", "text": "def param_whitelist\n if @user.present? && current_user != @user\n return [:followed]\n end\n \n whitelist = [\n :username, :email, :password,\n :first_name, :last_name,\n :birthday, :gender,\n :headline, :biography, :ask_about, :focus,\n :website, :facebook, :linkedin, :twitter, :github,\n roles: [],\n skills: [],\n interests: [],\n privacy: { contact: [] },\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n if action_name === 'update'\n whitelist.delete(:email)\n whitelist.delete(:password)\n end\n \n whitelist\n end", "title": "" }, { "docid": "1677b416ad07c203256985063859691b", "score": "0.6519536", "text": "def allow_params_authentication!; end", "title": "" }, { "docid": "7a24fee4eabdabf0eae6fc4a9442b5d4", "score": "0.6491671", "text": "def whitelisted_args\n args.select &:allowed\n end", "title": "" }, { "docid": "89821ecc64d69b0e108ff0205d42848d", "score": "0.64317423", "text": "def safe_list_sanitizer; end", "title": "" }, { "docid": "89821ecc64d69b0e108ff0205d42848d", "score": "0.64317423", "text": "def safe_list_sanitizer; end", "title": "" }, { "docid": "89821ecc64d69b0e108ff0205d42848d", "score": "0.64317423", "text": "def safe_list_sanitizer; end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.63975054", "text": "def filtered_parameters; end", "title": "" }, { "docid": "21b124098cb3c128802e22b776b3f0ec", "score": "0.6354703", "text": "def sanitize_params_for user, params, allowed_params\n params.each do |key, val|\n #if allowed_params.include?(key)\n #sanitize!(user, params, key) if key =~ /_attributes|_ids$/\n #else\n #params.delete(key)\n #end\n params.delete(key) unless allowed_params.include?(key.to_sym)\n end\n end", "title": "" }, { "docid": "068f8502695b7c7f6d382f8470180ede", "score": "0.63543284", "text": "def strong_params\n params.require(:team_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "b32229655ba2c32ebe754084ef912a1a", "score": "0.6346128", "text": "def expected_permitted_parameter_names; end", "title": "" }, { "docid": "9f3b62fe05ad1542504f6ef13056ac4e", "score": "0.63437325", "text": "def sanitize_parameters!(sanitizer, params)\n # replace :readwrite with :onlyif\n if params.has_key?(:readwrite)\n warn \":readwrite is deprecated. Replacing with :onlyif\"\n params[:onlyif] = params.delete(:readwrite)\n end\n\n # add default parameters\n bindata_default_parameters.each do |k,v|\n params[k] = v unless params.has_key?(k)\n end\n\n # ensure mandatory parameters exist\n bindata_mandatory_parameters.each do |prm|\n if not params.has_key?(prm)\n raise ArgumentError, \"parameter ':#{prm}' must be specified \" +\n \"in #{self}\"\n end\n end\n\n # ensure mutual exclusion\n bindata_mutually_exclusive_parameters.each do |param1, param2|\n if params.has_key?(param1) and params.has_key?(param2)\n raise ArgumentError, \"params #{param1} and #{param2} \" +\n \"are mutually exclusive\"\n end\n end\n end", "title": "" }, { "docid": "c5f294dd85260b1f3431a1fbbc1fb214", "score": "0.63382536", "text": "def strong_params\n params.require(:education).permit(param_whitelist)\n end", "title": "" }, { "docid": "ecb9b1c8e860f69081e55e2f9432197e", "score": "0.6327421", "text": "def safe_list_sanitizer=(_arg0); end", "title": "" }, { "docid": "ecb9b1c8e860f69081e55e2f9432197e", "score": "0.6327421", "text": "def safe_list_sanitizer=(_arg0); end", "title": "" }, { "docid": "ecb9b1c8e860f69081e55e2f9432197e", "score": "0.6327421", "text": "def safe_list_sanitizer=(_arg0); end", "title": "" }, { "docid": "bb32aa218785dcd548537db61ecc61de", "score": "0.6313337", "text": "def safe_params\n resurce_name = self.class.resource_name\n params_method_name = \"#{resurce_name}_params\".to_sym\n if params[resurce_name]\n if respond_to?(params_method_name) || private_methods.include?(params_method_name)\n send(params_method_name)\n else\n raise ActiveModel::ForbiddenAttributesError, \"Please, define the '#{params_method_name}' method in #{self.class.name}\"\n end\n end\n end", "title": "" }, { "docid": "12fa2760f5d16a1c46a00ddb41e4bce2", "score": "0.62992483", "text": "def param_whitelist\n [:rating, :review]\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.6264163", "text": "def check_params; true; end", "title": "" }, { "docid": "533f1ba4c3ab55e79ed9b259f67a70fb", "score": "0.62611693", "text": "def strong_params\n params.require(:experience).permit(param_whitelist)\n end", "title": "" }, { "docid": "3683f6af8fc4e6b9de7dc0c83f88b6aa", "score": "0.6258709", "text": "def validate_search_inputs\n @whitelisted = params.fetch(:user, nil)\n if @whitelisted.blank?\n render_error(400, \"#{I18n.t('general_error.params_missing_key')}\": [I18n.t('general_error.params_missing_value', model: \"review\")])\n return\n else\n @whitelisted = @whitelisted.permit(:name, :uen, :description)\n end\n end", "title": "" }, { "docid": "0e757d0df3a64e9e53edcc2ec32e976f", "score": "0.62363225", "text": "def allowed?(*_)\n true\n end", "title": "" }, { "docid": "3eef50b797f6aa8c4def3969457f45dd", "score": "0.62266946", "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": "d06d4a4f5db50f0e92ab46e724235bf9", "score": "0.6220734", "text": "def secure_params\n return @secure_params if @secure_params\n\n defn = implementation_class.definition\n field_list = [:master_id] + defn.field_list_array\n\n res = params.require(controller_name.singularize.to_sym).permit(field_list)\n res[implementation_class.external_id_attribute.to_sym] = nil if implementation_class.allow_to_generate_ids?\n @secure_params = res\n end", "title": "" }, { "docid": "aabfd0cce84d7f71b1ccd2df6a6af7c3", "score": "0.6218731", "text": "def allowed_params(parameters)\n parameters.select do |name, values|\n values.location != \"path\"\n end\n end", "title": "" }, { "docid": "5f16bb22cb90bcfdf354975d17e4e329", "score": "0.6208625", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6198651", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "c04a150a23595af2a3d515d0dfc34fdd", "score": "0.6196825", "text": "def strong_params\n params.require(:community).permit(param_whitelist)\n end", "title": "" }, { "docid": "d17287b48784257580d7e0971173c983", "score": "0.61735505", "text": "def permit( params, whitelist, name = nil )\n raise 'Parametrization not yet configured' unless @configured\n whitelist ||= []\n px = params.respond_to?( :permit ) ? params : ActionController::Parameters.new( params )\n px = dig(px, name)\n px.permit( *whitelist )\n end", "title": "" }, { "docid": "86b2d48cb84654e19b91d9d3cbc2ff80", "score": "0.6156472", "text": "def valid_params?; end", "title": "" }, { "docid": "7a218670e6f6c68ab2283e84c2de7ba8", "score": "0.61557126", "text": "def trim_whitelisted(params, whitelist)\n # remove any parameters that are not whitelisted\n params.each do |key, value|\n # if white listed\n if whitelist.include? key\n # strip the parameters of any extra spaces, save as string\n params[key] = value.to_s.strip\n else\n # delete any unauthorized parameters\n params.delete key\n end\n end\n params\n end", "title": "" }, { "docid": "014122b5717338df29c0e4d5adba899e", "score": "0.6152413", "text": "def url_allowlist=(_arg0); end", "title": "" }, { "docid": "60ccf77b296ed68c1cb5cb262bacf874", "score": "0.61360085", "text": "def param_whitelist\n whitelist = [\n :description,\n :progress,\n :kpi_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:kpi_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "631f07548a1913ef9e20ecf7007800e5", "score": "0.6121824", "text": "def restricted_params\n #params.require(self.controller_name.classify.underscore.to_sym).permit([])\n raise(\"No strong params set, override restricted_params method in your controller. E.g. params.require(:model).permit(:attribute1, :attribute2)\")\n end", "title": "" }, { "docid": "2b19f8222e09c2518b0d19b4bf1f69d3", "score": "0.6111878", "text": "def list_params\n params.permit(:list_name)\n end", "title": "" }, { "docid": "9d23b31178b8be81fe8f1d20c154336f", "score": "0.6073894", "text": "def valid_params_request?; end", "title": "" }, { "docid": "b074031c75c664c39575ac306e13028f", "score": "0.6072067", "text": "def safe_params\n params.permit(:id, :name, :origin, :emails => []); #emails is an array\n end", "title": "" }, { "docid": "64a51034b538cd75dee66f5200107c1f", "score": "0.60599715", "text": "def param_list(param_type, name, type, required, description = nil, allowed_values = [], hash = {})\n hash.merge!({allowable_values: {value_type: \"LIST\", values: allowed_values}})\n param(param_type, name, type, required, description, hash)\n end", "title": "" }, { "docid": "030323bf4ecb827028514f0ceb36cb9b", "score": "0.60567504", "text": "def safelists; end", "title": "" }, { "docid": "4c4d28432d3282cbb227f3039cf94caf", "score": "0.60456306", "text": "def authorize_own_lists\n authorize_lists current_user.lists\n end", "title": "" }, { "docid": "bc65ba6d2f3ef5cb8923d613e49b8274", "score": "0.60358804", "text": "def listed_params\n params.permit(:listed, :list_id, :listable_id, :listable_type, :campsite_id)\n end", "title": "" }, { "docid": "44ade9754ddcdac40382d0923cd63048", "score": "0.602103", "text": "def lists_params\n params.require(:list).permit(:name)\n\n end", "title": "" }, { "docid": "39096b2b2caa0b5a8223deec5f5b0f9f", "score": "0.6018436", "text": "def list_params\n params.require(:list).permit(:name, :user_id)\n end", "title": "" }, { "docid": "e3b7e73d151796bb56ed85e0f3116fa9", "score": "0.6016431", "text": "def list_params\n params.require(:list).permit(:name, :description, :type, :privacy, :allow_edit, :rating, :votes_count, :user_id)\n end", "title": "" }, { "docid": "5ee931ad3419145387a2dc5a284c6fb6", "score": "0.60101944", "text": "def check_params\n true\n end", "title": "" }, { "docid": "c341544076effe9e0db47fa6752829ff", "score": "0.60098845", "text": "def authorize_own_or_shared_lists\n authorize_lists current_user.all_lists\n end", "title": "" }, { "docid": "b7a657010a7f394737d8c2d719a06993", "score": "0.60079944", "text": "def user_pref_list_params\n\t\tparams.require(:user).permit(:preference_list)\n\tend", "title": "" }, { "docid": "66334278044b7f2b0463ae63d80ca602", "score": "0.60078126", "text": "def may_contain!(*keys)\n self.allow_only_permitted = true\n self.permitted_keys = [*permitted_keys, *keys].uniq\n end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.600349", "text": "def filter_parameters; end", "title": "" }, { "docid": "bd826c318f811361676f5282a9256071", "score": "0.600349", "text": "def filter_parameters; end", "title": "" }, { "docid": "6bc2c20d55fe920f0edd90f300d70955", "score": "0.5998145", "text": "def whitelist; end", "title": "" }, { "docid": "423b4bad23126b332e80a303c3518a1e", "score": "0.59945565", "text": "def article_params_whitelist\n params.require(:article).permit(:title, :description, category_ids: [])\n end", "title": "" }, { "docid": "ad2d2efdf4826b61db96adbdcdb0135b", "score": "0.5993332", "text": "def list_params\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "67fe19aa3f1169678aa999df9f0f7e95", "score": "0.5985075", "text": "def list_params\n params.permit(:name)\n end", "title": "" }, { "docid": "09ccbed54e2a0b8847b53b642b40efb5", "score": "0.5972061", "text": "def recipient_list_params\n params.require(:recipient_list).permit(:name, :list, :references)\n end", "title": "" }, { "docid": "93783c9b6c03c3bd41f75234b31911f8", "score": "0.5969419", "text": "def cancan_parameter_sanitizer\n resource = controller_name.singularize.to_sym\n method = \"#{resource}_params\"\n params[resource] &&= send(method) if respond_to?(method, true)\n end", "title": "" }, { "docid": "54e04b941ee9071107179fe993e57c26", "score": "0.5966198", "text": "def list_params\n params.require(:list).permit(:name).merge(user_id: current_user.id)\n end", "title": "" }, { "docid": "29eec3df393336ba76ae5f63ed9b4858", "score": "0.5964372", "text": "def whitelist_place_params\n params.require(:place).permit(:place_name, :unlock, :auth, :is_deep_checked, :parent_ADM4, :parent_ADM3, :parent_ADM2, :parent_ADM1, :parent_country, feature_code: [], same_as: [], related_authority: [], altlabel: [], note: []) # Note - arrays need to go at the end or an error occurs!\n end", "title": "" }, { "docid": "3697f53f660a77b18ff5af51bcf1ca8d", "score": "0.59624404", "text": "def list_params\n params.fetch(:list, {}).permit(:user_id, :name, :active)\n end", "title": "" }, { "docid": "9a2a1af8f52169bd818b039ef030f513", "score": "0.59604996", "text": "def permitted_strong_parameters\n :all #or an array of parameters, example: [:name, :email]\n end", "title": "" }, { "docid": "ab49b0baeea5bf6f204adca9e864094e", "score": "0.5933609", "text": "def secure_params(require_param, permit_keys)\n params.require(require_param).permit(*permit_keys)\n end", "title": "" }, { "docid": "fe4025b0dd554f11ce9a4c7a40059912", "score": "0.59290427", "text": "def grant_params\n @whitelisted = params.require(:grant).permit(:name, :description, :agency_id, :acronym)\n end", "title": "" }, { "docid": "4fc36c3400f3d5ca3ad7dc2ed185f213", "score": "0.5922008", "text": "def permitted_params\n []\n end", "title": "" }, { "docid": "31fc4d8ac77808ea64c22b8bff20997d", "score": "0.5909074", "text": "def price_list_params\n params.fetch(:price_list, {}).permit(:name, :valid_from, :valid_to, :active,\n :all_warehouses, :all_users, :all_contact_groups,\n warehouse_ids: [], price_lists_user_ids: [], contact_group_ids: [])\n end", "title": "" }, { "docid": "4658b5ebaf35abb1b89c071aed7e018c", "score": "0.5904428", "text": "def admin_review_params\n params.fetch(:review, {}).permit(whitelisted_params)\n end", "title": "" }, { "docid": "1791be75c23b0ab94b8d566561cf903e", "score": "0.59025145", "text": "def params(list)\n @declared_params = list\n end", "title": "" }, { "docid": "ca90e8f0ec041d26b42d00aa2cbda1e5", "score": "0.5893613", "text": "def saved_list_params\n params.require(:saved_list).permit(:user_id)\n end", "title": "" }, { "docid": "043c7c33fa58658709ce0014319e7aec", "score": "0.5889188", "text": "def allow(ids); end", "title": "" }, { "docid": "34c6b2119736eea4b71998dec50f5f1a", "score": "0.58822787", "text": "def list_params\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "34c6b2119736eea4b71998dec50f5f1a", "score": "0.58822787", "text": "def list_params\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "34c6b2119736eea4b71998dec50f5f1a", "score": "0.58822787", "text": "def list_params\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "e310f8ae001392da6281c299a2572677", "score": "0.58715767", "text": "def filter_params(param_set, **kwargs)\r\n begin\r\n key = kwargs[:key]\r\n params.require(key).permit(*param_set)\r\n rescue Exception\r\n params.permit(*param_set)\r\n end\r\n end", "title": "" }, { "docid": "4d77abbae6d3557081c88dad60c735d0", "score": "0.586071", "text": "def valid_parameters\n sort_symbols(@interface.allowed_parameters)\n end", "title": "" }, { "docid": "37656a050c4e4765c2ea464cd3d4e764", "score": "0.5852823", "text": "def validate_paramified_params\n self.class.paramify_methods.each do |method|\n params = send(method)\n transfer_errors_from(params, TermMapper.scope(params.group)) if !params.valid?\n end\n end", "title": "" }, { "docid": "102e96b584d087beda32598a28a382f5", "score": "0.5845353", "text": "def list_params\n params.require(:list).permit(:name)\n end", "title": "" }, { "docid": "7befdf5d03aadb61b4c6e74ed07cd447", "score": "0.58434", "text": "def secure_params\n return @secure_params if @secure_params\n\n @implementation_class = implementation_class\n resname = @implementation_class.name.ns_underscore.gsub('__', '_').singularize.to_sym\n @secure_params = params.require(resname).permit(*permitted_params)\n end", "title": "" }, { "docid": "2554d771097b60c5d766de7d29c2dfe5", "score": "0.5834174", "text": "def refine_permitted_params(param_list)\n res = param_list.dup\n\n ms_keys = res.select { |a| columns_hash[a.to_s]&.array }\n ms_keys.each do |k|\n res.delete(k)\n res << { k => [] }\n end\n\n res\n end", "title": "" }, { "docid": "43f8788590c98e3b2ddf0bd6c62b24c8", "score": "0.58324045", "text": "def recipient_list_params\n params.require(:recipient_list).permit(:name, :description, recipient_id_array: [])\n end", "title": "" }, { "docid": "d6bf948034a6c8adc660df172dd7ec6e", "score": "0.58297354", "text": "def sponsor_params\n params.require(:sponsor).permit(WHITE_LIST)\n end", "title": "" }, { "docid": "81d27d51beb59227f68929587fe9a1be", "score": "0.582973", "text": "def safelist; end", "title": "" }, { "docid": "68815c1979e028984e7c2d5abadc2552", "score": "0.58170927", "text": "def valid_for_params_auth?; end", "title": "" }, { "docid": "547b7ab7c31effd8dcf394d3d38974ff", "score": "0.58145744", "text": "def default_param_whitelist\n [\"mode\"]\n end", "title": "" }, { "docid": "e3089e0811fa34ce509d69d488c75306", "score": "0.58141696", "text": "def devise_filter\r\n logger.debug(\"In devise_filter =>PARAMS: #{params.inspect}\")\r\n\r\n # White list for sign_up\r\n devise_parameter_sanitizer.for(:sign_up) { |u| u.permit(user_whitelist) }\r\n\r\n # White list for account update\r\n devise_parameter_sanitizer.for(:account_update) { |u| u.permit(user_whitelist, :current_password) }\r\n\r\n # White list for Invitation creation\r\n devise_parameter_sanitizer.for(:invite) { |u| u.permit(:account_type, :email, :invitation_token)}\r\n\r\n # White list for accept invitation\r\n devise_parameter_sanitizer.for(:accept_invitation) { |u| u.permit(user_whitelist, :invitation_token)}\r\n\r\n end", "title": "" }, { "docid": "d4c0e2d7913e01bfa09b10bbeb5341ac", "score": "0.5811205", "text": "def shopping_list_params\n params.require(:shopping_list).permit!\n end", "title": "" }, { "docid": "16e18668139bdf8d5ccdbff12c98bd25", "score": "0.5801582", "text": "def permitted_params\n declared(params, include_missing: false)\n end", "title": "" }, { "docid": "16e18668139bdf8d5ccdbff12c98bd25", "score": "0.5801582", "text": "def permitted_params\n declared(params, include_missing: false)\n end", "title": "" }, { "docid": "3a9a65d2bba924ee9b0f67cb77596482", "score": "0.5799815", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "7c51a57439a63c303a45aca2ac638401", "score": "0.5794471", "text": "def permitters\n @_parametrizr_permitters || {}\n end", "title": "" }, { "docid": "c8d1b09827dbe3a963c60c741dc68594", "score": "0.5784839", "text": "def allow_params(action, keys: nil, except: nil, &blk)\n keys &&= Array.wrap(keys)\n keys ||= User.field_names\n except &&= Array.wrap(except)\n except ||= %i[id email]\n devise_parameter_sanitizer.permit(action, keys: keys, except: except, &blk)\n end", "title": "" }, { "docid": "0cbc6ed0eac413e6d26c1e1418b6c62e", "score": "0.5781441", "text": "def list_params\n if current_user && current_user.role == 'admin'\n params.require(:list).permit(:name, :url, :description, :user_id,\n ideas_attributes: [:id, :list_id, :body, :due_date, :completion_status, :_destroy])\n else\n params.require(:list).permit(:name, :description,\n ideas_attributes: [:body, :due_date, :completion_status]) \n end\n end", "title": "" }, { "docid": "7a108e48bed2cdf492c12286b1c59903", "score": "0.5777732", "text": "def whitelist(params)\n send_request_of_type(GlobalConstant::PrivateOpsApi.private_ops_api_type, 'post', '/token-sale/whitelist', params)\n end", "title": "" }, { "docid": "572ddb6fcaa0b57a2624259cc183bdb0", "score": "0.5775411", "text": "def valid_access_params\n params.require(:valid_access).permit(:wish_list_id, :user_id)\n end", "title": "" }, { "docid": "09edac0c32ae61b998679363610353e6", "score": "0.576802", "text": "def url_allowlist; end", "title": "" }, { "docid": "0b6129d775136b0d6037453613f331dd", "score": "0.5767721", "text": "def ensure_redirected_params_are_safe!(passed_params)\n unless passed_params.is_a?(ActionController::Parameters) && passed_params.permitted?\n error_message = if passed_params.is_a?(ActionController::Parameters)\n unsafe_parameters = passed_params.send(:unpermitted_keys, params)\n \"[Rails::Prg] Error - Must use permitted strong parameters. Unsafe: #{unsafe_parameters.join(', ')}\"\n else\n \"[Rails::Prg] Error - Must pass strong parameters.\"\n end\n raise error_message\n end\n end", "title": "" }, { "docid": "2be6c6279f55d8b4842688b8f3cc75f1", "score": "0.5762444", "text": "def data_collection_params\n allow = [:name,:description,:institution,:collection_name,:country_id,:province_id,:city_id]\n params.require(:data_collection).permit(allow)\n end", "title": "" }, { "docid": "3c8ffd5ef92e817f2779a9c56c9fc0e9", "score": "0.5757933", "text": "def quote_params\n params.permit!\n end", "title": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "bfce5f87de24f081bf8820e373a19b6a", "score": "0.0", "text": "def set_report\n @report = Report.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": "" } ]
f74c29bdfc4a183e1ec1b91334cd5be2
Use callbacks to share common setup or constraints between actions.
[ { "docid": "4bf36d229c62cf82112ea67f3925ae14", "score": "0.0", "text": "def find_delivery\n @delivery = Delivery.find(params[:id])\n end", "title": "" } ]
[ { "docid": "631f4c5b12b423b76503e18a9a606ec3", "score": "0.60310465", "text": "def process_action(...)\n run_callbacks(:process_action) do\n super\n end\n end", "title": "" }, { "docid": "7b068b9055c4e7643d4910e8e694ecdc", "score": "0.60152966", "text": "def on_setup_callbacks; end", "title": "" }, { "docid": "311e95e92009c313c8afd74317018994", "score": "0.5920606", "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.5912896", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "8315debee821f8bfc9718d31b654d2de", "score": "0.5912896", "text": "def initialize(*args)\n super\n @action = :setup\nend", "title": "" }, { "docid": "bfea4d21895187a799525503ef403d16", "score": "0.5898134", "text": "def define_action_helpers\n super\n define_validation_hook if runs_validations_on_action?\n end", "title": "" }, { "docid": "352de4abc4d2d9a1df203735ef5f0b86", "score": "0.5887081", "text": "def required_action\n # TODO: implement\n end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5887026", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5887026", "text": "def actions; end", "title": "" }, { "docid": "801bc998964ea17eb98ed4c3e067b1df", "score": "0.5887026", "text": "def actions; end", "title": "" }, { "docid": "8713cb2364ff3f2018b0d52ab32dbf37", "score": "0.5876557", "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.5860066", "text": "def actions\n\n end", "title": "" }, { "docid": "930a930e57ae15f432a627a277647f2e", "score": "0.5807812", "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.57404715", "text": "def setup\n common_setup\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.57310694", "text": "def perform_setup\n end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.5715928", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "9c186951c13b270d232086de9c19c45b", "score": "0.5701527", "text": "def callbacks; end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.569245", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "100180fa74cf156333d506496717f587", "score": "0.5669733", "text": "def do_setup\n\t\tget_validation\n\t\tprocess_options\n\tend", "title": "" }, { "docid": "2198a9876a6ec535e7dcf0fd476b092f", "score": "0.56503016", "text": "def initial_action; end", "title": "" }, { "docid": "b9b75a9e2eab9d7629c38782c0f3b40b", "score": "0.5648064", "text": "def setup_intent; end", "title": "" }, { "docid": "471d64903a08e207b57689c9fbae0cf9", "score": "0.5636733", "text": "def setup_controllers &proc\n @global_setup = proc\n self\n end", "title": "" }, { "docid": "468d85305e6de5748477545f889925a7", "score": "0.5623887", "text": "def inner_action; end", "title": "" }, { "docid": "bb445e7cc46faa4197184b08218d1c6d", "score": "0.56089544", "text": "def pre_action\n # Override this if necessary.\n end", "title": "" }, { "docid": "48804b0fa534b64e7885b90cf11bff31", "score": "0.559635", "text": "def execute_callbacks; end", "title": "" }, { "docid": "432f1678bb85edabcf1f6d7150009703", "score": "0.5595486", "text": "def target_callbacks() = commands", "title": "" }, { "docid": "5aab98e3f069a87e5ebe77b170eab5b9", "score": "0.55868655", "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.55584484", "text": "def global_callbacks; end", "title": "" }, { "docid": "9efbca664902d80a451ef6cff0334fe2", "score": "0.55584484", "text": "def global_callbacks; end", "title": "" }, { "docid": "482481e8cf2720193f1cdcf32ad1c31c", "score": "0.5507632", "text": "def required_keys(action)\n\n end", "title": "" }, { "docid": "353fd7d7cf28caafe16d2234bfbd3d16", "score": "0.55033326", "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.5466339", "text": "def on_setup(&block); end", "title": "" }, { "docid": "dcf95c552669536111d95309d8f4aafd", "score": "0.54640555", "text": "def layout_actions\n \n end", "title": "" }, { "docid": "8ab2a5ea108f779c746016b6f4a7c4a8", "score": "0.54472816", "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.54455507", "text": "def before(action)\n invoke_callbacks *options_for(action).before\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.54398936", "text": "def post_setup\n end", "title": "" }, { "docid": "07fd9aded4aa07cbbba2a60fda726efe", "score": "0.5415934", "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.5407991", "text": "def action_methods; end", "title": "" }, { "docid": "dbebed3aa889e8b91b949433e5260fb5", "score": "0.5407991", "text": "def action_methods; end", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.54", "text": "def post_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5394463", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.5394463", "text": "def before_setup; end", "title": "" }, { "docid": "cb5bad618fb39e01c8ba64257531d610", "score": "0.5391065", "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.5388469", "text": "def _setup\n setup_notification_categories\n setup_intelligent_segments\n end", "title": "" }, { "docid": "f099a8475f369ce73a38d665b6ee6877", "score": "0.5376582", "text": "def action_run\n end", "title": "" }, { "docid": "2c4e5a90aa8efaaa3ed953818a9b30d2", "score": "0.5355932", "text": "def execute(setup)\n @action.call(setup)\n end", "title": "" }, { "docid": "725216eb875e8fa116cd55eac7917421", "score": "0.5348422", "text": "def setup\n @controller.setup\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.53466004", "text": "def setup_phase; end", "title": "" }, { "docid": "118932433a8cfef23bb8a921745d6d37", "score": "0.53451854", "text": "def register_action(action); end", "title": "" }, { "docid": "bd03e961c8be41f20d057972c496018c", "score": "0.5343858", "text": "def post_setup\n controller.each do |name,ctrl|\n ctrl.post_setup\n end\n end", "title": "" }, { "docid": "c6352e6eaf17cda8c9d2763f0fbfd99d", "score": "0.5339292", "text": "def initial_action=(_arg0); end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.532725", "text": "def before_setup\n\n end", "title": "" }, { "docid": "669ee5153c4dc8ee81ff32c4cefdd088", "score": "0.53038853", "text": "def ensure_before_and_after; end", "title": "" }, { "docid": "c77ece7b01773fb7f9f9c0f1e8c70332", "score": "0.52850133", "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.52815986", "text": "def set_minimum_up_member_action(opts)\n opts = check_params(opts,[:actions])\n super(opts)\n end", "title": "" }, { "docid": "63a9fc1fb0dc1a7d76ebb63a61ed24d7", "score": "0.5257178", "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.5257024", "text": "def rails_controller_callbacks(&block)\n rails_controller_instance.run_callbacks(:process_action, &block)\n end", "title": "" }, { "docid": "fc88422a7a885bac1df28883547362a7", "score": "0.5248709", "text": "def pre_setup_actions\n @@pre_setup_actions ||= []\n end", "title": "" }, { "docid": "8945e9135e140a6ae6db8d7c3490a645", "score": "0.5244428", "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.5239302", "text": "def after_setup\n end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5235414", "text": "def action; end", "title": "" }, { "docid": "e6d7c691bed78fb0eeb9647503f4a244", "score": "0.5235414", "text": "def action; end", "title": "" }, { "docid": "1dddf3ac307b09142d0ad9ebc9c4dba9", "score": "0.5230717", "text": "def external_action\n raise NotImplementedError\n end", "title": "" }, { "docid": "5772d1543808c2752c186db7ce2c2ad5", "score": "0.52270764", "text": "def actions(state:)\n raise NotImplementedError\n end", "title": "" }, { "docid": "64a6d16e05dd7087024d5170f58dfeae", "score": "0.5222752", "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.5222485", "text": "def before(action)\n invoke_callbacks *self.class.send(action).before\n end", "title": "" }, { "docid": "db0cb7d7727f626ba2dca5bc72cea5a6", "score": "0.52205867", "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.52127427", "text": "def pick_action; end", "title": "" }, { "docid": "7bbfb366d2ee170c855b1d0141bfc2a3", "score": "0.52127236", "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.520801", "text": "def define_action_helpers\n if action_hook\n @action_hook_defined = true\n define_action_hook\n end\n end", "title": "" }, { "docid": "6a98e12d6f15af80f63556fcdd01e472", "score": "0.5204501", "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": "2aba2d3187e01346918a6557230603c7", "score": "0.5204178", "text": "def ac_action(&blk)\n @action = blk\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.52039874", "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.52032334", "text": "def create_setup\n \n end", "title": "" }, { "docid": "691d5a5bcefbef8c08db61094691627c", "score": "0.5198697", "text": "def performed(action)\n end", "title": "" }, { "docid": "ad33138fb4bd42d9785a8f84821bfd88", "score": "0.51944995", "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.51944995", "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.51913106", "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.5178707", "text": "def setup(instance)\n action(:setup, instance)\n end", "title": "" }, { "docid": "9f1f73ee40d23f6b808bb3fbbf6af931", "score": "0.51781213", "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.5172379", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5172379", "text": "def setup(resources) ; end", "title": "" }, { "docid": "b4f4e1d4dfd31919ab39aecccb9db1d0", "score": "0.5172379", "text": "def setup(resources) ; end", "title": "" }, { "docid": "7a0c9d839516dc9d0014e160b6e625a8", "score": "0.5163576", "text": "def setup(request)\n end", "title": "" }, { "docid": "e441ee807f2820bf3655ff2b7cf397fc", "score": "0.5152934", "text": "def after_setup; end", "title": "" }, { "docid": "1d375c9be726f822b2eb9e2a652f91f6", "score": "0.5142308", "text": "def before *actions, &proc\n actions = ['*'] if actions.size == 0\n actions.each { |a| @callbacks[:a][a] = proc }\n end", "title": "" }, { "docid": "2fcff037e3c18a5eb8d964f8f0a62ebe", "score": "0.51392764", "text": "def setup(params)\n end", "title": "" }, { "docid": "c594a0d7b6ae00511d223b0533636c9c", "score": "0.51391184", "text": "def code_action_provider; end", "title": "" }, { "docid": "faddd70d9fef5c9cd1f0d4e673e408b9", "score": "0.51387095", "text": "def setup_action\n return unless PONY::ERRNO::check_sequence(current_act)\n new_sequence = @action_sequence[@sequence_index+1...@action_sequence.size]\n @sequence_index = 0\n new_sequence = DND::SkillSequence::ACTS[@acts[1]] + new_sequence\n execute_sequence\n end", "title": "" }, { "docid": "111fd47abd953b35a427ff0b098a800a", "score": "0.51351416", "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.5115222", "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.51131564", "text": "def setup\n transition_to(:setup)\n end", "title": "" }, { "docid": "4c7a1503a86fb26f1e4b4111925949a2", "score": "0.51114494", "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.5107052", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5107052", "text": "def action\n end", "title": "" }, { "docid": "975ecc8d218b62d480bbe0f6e46e72bb", "score": "0.5107052", "text": "def action\n end", "title": "" }, { "docid": "63849e121dcfb8a1b963f040d0fe3c28", "score": "0.51055247", "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.5102995", "text": "def block_actions options ; end", "title": "" }, { "docid": "0d1c87e5cf08313c959963934383f5ae", "score": "0.50979155", "text": "def on_action(action)\n @action = action\n self\n end", "title": "" }, { "docid": "916d3c71d3a5db831a5910448835ad82", "score": "0.50949734", "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.5091706", "text": "def add_callbacks(base); end", "title": "" } ]
77404931075fd3c652d999cd7e17f508
all field is the same about except other_tex dont' exest.
[ { "docid": "ab7afd9f7ff7a1d08138f797f026ef71", "score": "0.0", "text": "def test_summary_warnings_42\n @dir = \"sample_c/src\"\n # gets a list of diff_warning from database\n diff_warnings = DiffWarning.summary_warnings(nil,\n @dir,\n false,\n \"dir\",\n \"2\",\n \"2\",\n \"2\",\n \"5972\",\n \"status\",\n \"ASC\",\n \"1\")\n\n # the list must be empty\n assert_equal(0, diff_warnings.size)\n end", "title": "" } ]
[ { "docid": "8e82a100523ec4b856b8e83a5105ddce", "score": "0.5452911", "text": "def duplicate?\n\t\tother = Ng2::WordDetail.find(@word).last\n\t\t!other.nil? &&\n\t\tother.file_path == self.file_path &&\n\t\tother.line_no == self.line_no &&\n\t\tother.word_no == self.word_no\n\tend", "title": "" }, { "docid": "496b6a504241b4062b88bbdd8deb8837", "score": "0.541419", "text": "def textfields_exact(value)\n eles_by_json _textfield_exact_string value\n end", "title": "" }, { "docid": "11dc53a4de3079dd6ad76f2ea1d8b7d1", "score": "0.5216305", "text": "def text\n other_phrased\n end", "title": "" }, { "docid": "7f3b397ca008a686a8dd59d809208d4c", "score": "0.51694626", "text": "def text_similarity(text,other_model)\n other_model.text_commonality(text) / text_commonality(text)\n end", "title": "" }, { "docid": "adf8b40695fd29d5a9446c979832a163", "score": "0.510272", "text": "def primary_text_field\n return @primary_text_field if defined? @primary_text_field\n\n @primary_text_field = begin\n candidate_fields = [primary_field, list_view_fields, fields].flatten.compact\n candidate_fields.reject(&:restricted?).find { |f| f.is_a?(Field::Text) }\n end\n end", "title": "" }, { "docid": "78e442235b863352bba045fdad14cfaf", "score": "0.5071218", "text": "def same_field?(field)\n self.vertical_line == field.vertical_line && self.horizontal_line == field.horizontal_line\n end", "title": "" }, { "docid": "0225a9f23a0fa436bcdab339adc872dd", "score": "0.50510955", "text": "def same; end", "title": "" }, { "docid": "d9e323af5b34c7f670e60122297ad616", "score": "0.49794653", "text": "def ==(other)\n return super(@values, other.values) unless font?\n equals?(@values, other.values)\n end", "title": "" }, { "docid": "a04e0c86f7622964cb94e79bd6225249", "score": "0.4968782", "text": "def subject_other_subvy_search\n @subject_other_subvy_search ||= begin\n vals = subject_temporal ? Array.new(subject_temporal) : []\n gvals = term_values([:subject, :genre])\n vals.concat(gvals) if gvals\n\n # print a message for any temporal encodings\n subject.temporal.each { |n|\n sw_logger.info(\"#{druid} has subject temporal element with untranslated encoding: #{n.to_xml}\") unless n.encoding.empty?\n }\n\n vals.empty? ? nil : vals\n end\n end", "title": "" }, { "docid": "f5acdaccb6b8acd3dd4e5608384de53b", "score": "0.49425152", "text": "def search_text_fields\n #self.content_columns.select {|c| [:string,:text].include?(c.type) }.map {|c| c.name }\n \n end", "title": "" }, { "docid": "e07fcaccb890403c0eb0530a8b89da1d", "score": "0.4934324", "text": "def identical?\n #Song.first.attributes.each { |v,k| Song.find(:all, :conditions => [\" #{v} like ?\", \"%blah%\"])}\n Song.find(:all, :conditions => [\"name = ? or length = ?\", \"#{self.name}\", self.length]) do |x| \n x.hash == self.hash\n end\n end", "title": "" }, { "docid": "a84d27be524a4fb374f38642ae958f01", "score": "0.49297825", "text": "def old_text\n return @old_text\n end", "title": "" }, { "docid": "28953e5c08c6ed515a256ea58bac684c", "score": "0.49168685", "text": "def prepare_reuse_validation_diff(other)\n original = self.reload!.comparable\n reference = other.reload!.comparable\n unique_identifiers.each { |id| reference[id] = original[id] }\n [original, reference]\n end", "title": "" }, { "docid": "87c44587ca7ee467b3b78f80759bae4c", "score": "0.49149674", "text": "def text_only\n @text_only = @text.gsub(@@PRIREG, '')\n #.gsub(@@CONREG, '').gsub(@@PROREG, '')\n end", "title": "" }, { "docid": "cad3f9e9e0003f2cb1918faa20cb6882", "score": "0.49034166", "text": "def ==(other)\n @key == other.key && @text == other.text\n end", "title": "" }, { "docid": "d708b327f6f59d065b28348807e15a3a", "score": "0.48912248", "text": "def save_unmatched_words # :nodoc:\n tokens = phrase_without_matches.split(' ')\n unmatched_db = Corpus.new(\"unmatched-#{program_name}.db\")\n tokens.each do |token|\n if !complex_token_matches?(token) # token was not transformed earlier\n @to_match << token\n unmatched_db[token] = @processor.original_text\n end\n end\n unmatched_db.close\n end", "title": "" }, { "docid": "3d33a071066df409b7b8151fb3cf01ae", "score": "0.48907375", "text": "def word_not_changed\n errors.add(:word, :cant_be_changed) if @tag && @tag.word != self.word\n end", "title": "" }, { "docid": "0c75d007bdd8e1db58e22451114e5095", "score": "0.48871678", "text": "def numero_fattura_must_be_unique_in_anno_and_data_fattura\n #return if field.blank?\n not_uniq = self.class.count(:conditions => [\"anno = ? AND numero_fattura = ? AND YEAR(data_fattura) = ?\", self.anno, self.numero_fattura, self.data_fattura.year])\n if not_uniq > 0\n #self.errors.add(:data_fattura, \"anno, numero_fattura e anno di data_fattura devono essere unici\")\n flash[:error] = \"anno, numero_fattura e anno di data_fattura devono essere unici\"\n end\n #not_uniq = self.class.where(:anno=>self.anno,:numero_fattura=>self.numero_fattura).where(\"YEAR(data_fattura) = ?\",data_fattura.year).first\n #self.errors.add(:data_fattura, \"anno, numero_fattura e anno di data_fattura devono essere unici\") if not_uniq\n end", "title": "" }, { "docid": "767f8346962b804f7fd29d72ea5fe4ff", "score": "0.48579225", "text": "def show_other_filled field_id, value, field_name\n coder = HTMLEntities.new # create a coder to code value fields for each question\n retVal = '<span id=\"other_'+field_id+'\" class=\"other_field\" style=\"padding:0px;\"><br/><br/>Please specify:'\n retVal += '<input id=\"' + field_id + '_input\" type=\"text\" title=\"other\" style=\"width:75%;\" name=\"' + field_name + '\" value = \"' + coder.encode(value) + '\"></span>'\n return retVal\n end", "title": "" }, { "docid": "20f9e78fc1501016ee9f56f6685a5954", "score": "0.4855329", "text": "def duplicate_field_author(oldval, val)\n [oldval, val].join(' and ')\n end", "title": "" }, { "docid": "ca2955192bc9ec4b7c9538fa53f4a16b", "score": "0.48532003", "text": "def old_combine_notes\n notes = self.notes\n full_text = \"\"\n\n for note in notes\n full_text << \" //- \"\n full_text << note.body.strip\n # if @note != @notes[-1]\n # @full_text << \" //- \"\n # end\n end\n\n self.combined_notes = full_text\n puts self.combined_notes\n self.save \n end", "title": "" }, { "docid": "81d5512e66dfeb7e22268dbcd2041b34", "score": "0.48529828", "text": "def ==(o)\n self.text == o.text && self.type == o.type\n end", "title": "" }, { "docid": "81d5512e66dfeb7e22268dbcd2041b34", "score": "0.48529828", "text": "def ==(o)\n self.text == o.text && self.type == o.type\n end", "title": "" }, { "docid": "210b0357ad90197962d45bef88c39d21", "score": "0.4847553", "text": "def difftotextpst()\n merge(gadrdifftotextpst: 'true')\n end", "title": "" }, { "docid": "ddc7e538e1eeb2c0fdc896df6b1bd4f0", "score": "0.4828526", "text": "def textfield_exact(value)\n raise_error_if_no_element textfields_exact(value).first\n end", "title": "" }, { "docid": "9f47d5072aef4acd5a5c4ac3b76585b6", "score": "0.48248914", "text": "def difftotext(value)\n merge(gadrdifftotext: value.to_s)\n end", "title": "" }, { "docid": "9bdde17e0bc01d7479728ef65ed0ef43", "score": "0.48119467", "text": "def texts\n @texts ||= fields.select { |f| f.class == Text }\n end", "title": "" }, { "docid": "4c9433d7c292ffe17c4e84e1b4d22f0a", "score": "0.48030657", "text": "def all_text_fields\n @text_fields ||= text_fields_hash.values.map { |set| set.to_a }.flatten\n end", "title": "" }, { "docid": "d3645dece61d7a736d524bbf5707fec9", "score": "0.47768858", "text": "def unique_text_name\n title = all_subjects.map(&:text_name).uniq.sort.join(\" & \")\n if title.blank?\n :image.l + \" ##{id || \"?\"}\"\n else\n title + \" (#{id || \"?\"})\"\n end\n end", "title": "" }, { "docid": "d49b75d88b3fa1a081e9a720b100b766", "score": "0.47723466", "text": "def master_text_changed(master_text)\n master_text.localized_texts.where(needs_entry: false).update_all(needs_review: true)\n end", "title": "" }, { "docid": "9b96a9c60ffa62ee4e71a5223c7c52ca", "score": "0.47395888", "text": "def docmp(itemA, itemB)\n itemA[:alias] != itemB[:alias] or itemA[:format] != itemB[:format]\n end", "title": "" }, { "docid": "5ee59663a0ff8313c097eef565e023e1", "score": "0.46994284", "text": "def strip_text_unique(passage)\n strip_text(passage).uniq#unique\nend", "title": "" }, { "docid": "505ce52b83b2555334a7c4471beb97d4", "score": "0.46971792", "text": "def remove_all_text_content_before_second_record_id(txt)\n # split text into lines\n lines = txt.split(\"\\n\")\n # empty all lines up to second record_id\n record_id_counter = 0\n lines.each_with_index do |line, idx|\n record_id_counter += 1 if /\\A\\^\\^\\^/ =~ line\n lines[idx] = ''\n break if record_id_counter >= 2\n end\n if record_id_counter < 2\n # No second record_id found, return original text\n puts 'Warning: Could not find second record_id'\n txt\n else\n # return modified text\n lines.join(\"\\n\")\n end\n end", "title": "" }, { "docid": "9291a494162a7dd2fb0f56965441f2c8", "score": "0.4694341", "text": "def flexi_fields_except_fk\n _field_names = self.associations.values.flatten.map { |_v| :\"#{_v.to_s.singularize}_id\" }\n if none_flexi_fields.present?\n none_flexi_fields.each do |field|\n ['file_name', 'content_type', 'file_size', 'updated_at'].each do |_suffix|\n _field_names << :\"#{field.name.to_s}_#{_suffix}\"\n end\n end\n end\n self.flexi_fields.select { |_f| !_field_names.include?(_f.name.to_sym) }\n end", "title": "" }, { "docid": "6298b71fbbcec7e59cd9334701bc0fe1", "score": "0.4687038", "text": "def texts_score(text1, text2)\n words1 = text1.downcase.scan(/[a-zA-Z]+/) - noise_words\n words2 = text2.downcase.scan(/[a-zA-Z]+/) - noise_words\n common_words = words1 & words2\n p common_words\n common_words.length.to_f / (words1.length + words2.length)\n end", "title": "" }, { "docid": "af43d41de0d420a21cb2731f609227a0", "score": "0.46783125", "text": "def same_row?(character_one, character_two)\n character_one[:row] == character_two[:row]\n end", "title": "" }, { "docid": "d0c6760a7bc30f00e64409da7a4b2442", "score": "0.466887", "text": "def unique_text_name\n if target\n target.unique_text_name\n else\n orphan_title.t.html_to_ascii\n end\n end", "title": "" }, { "docid": "d0c6760a7bc30f00e64409da7a4b2442", "score": "0.466887", "text": "def unique_text_name\n if target\n target.unique_text_name\n else\n orphan_title.t.html_to_ascii\n end\n end", "title": "" }, { "docid": "07337460526528d91830741d86e6d47d", "score": "0.46594468", "text": "def check_other_links!\n self.gsub!(OTHER_LINK_PATTERN) do |orig|\n result = orig\n prefix, type, id = $1, $2, $3\n matches = [\n ['comment'],\n ['image', 'img'],\n ['location', 'loc'],\n ['name'],\n ['observation', 'obs', 'ob'],\n ['project', 'proj'],\n ['species_list', 'spl'],\n ['user']\n ].select {|x| x[0] == type.downcase || x[1] == type.downcase}\n if matches.length == 1\n if id.match(/^\\d+$/)\n label = \"#{type} #{id}\"\n else\n label = id\n end\n result = \"#{prefix}x{#{matches.first.first.upcase} __#{label}__ }{ #{id} }x\"\n end\n result\n end\n end", "title": "" }, { "docid": "7f62ff6926415c7f10c78c6f2671c84f", "score": "0.46566936", "text": "def filter(doc)\n genus_text = doc['genus_text']\n\n if (genus_text == nil) then return true\n end\n\n genus_text = genus_text.downcase\n\n if (genus_text == 'papaver' or genus_text == 'psilocybe' or genus_text == 'erythroxylum')\n then return false\n end\n\n material_facet = doc['material_facet']\n\n if (genus_text == 'cannabis' and (!material_facet or material_facet.downcase != 'fiber & textiles'))\n then return false\n end\n\n coll_date_text = doc['coll_date_text']\n\n if (coll_date_text =~ /\\b(\\d{4})\\b/) and ($1.to_i >= 1970)\n then return false\n end\n\n return true \nend", "title": "" }, { "docid": "89799a548d06028a192adea03569adee", "score": "0.4645839", "text": "def texts_exact(value)\n eles_by_json_visible_exact UIAStaticText, value\n end", "title": "" }, { "docid": "3aeadc42b8ba0748a822020380b2a06b", "score": "0.46445808", "text": "def calculate_similarity(other_doc)\n self.terms.inject(0.0) do |dot_product, term|\n dot_product + (self.tfidf(term.word) * other_doc.tfidf(term.word))\n end\n end", "title": "" }, { "docid": "5a75e0079ae3cb7fa34d445a99a3e925", "score": "0.46424273", "text": "def cmp(thenode, text)\n if renamed? thenode\n t2 = read thenode\n return t2 != text\n end\n super(thenode, text)\n end", "title": "" }, { "docid": "7075728f46728aae04ff657172e497e5", "score": "0.46206716", "text": "def texts=(texts); end", "title": "" }, { "docid": "7075728f46728aae04ff657172e497e5", "score": "0.46206716", "text": "def texts=(texts); end", "title": "" }, { "docid": "82dbdbccd1831e7d2ec33bfe5e2870cc", "score": "0.4613967", "text": "def query_wo_exact_phrases(txt)\n self.query_without_exact_phrases ||= txt.gsub(Awesome::Definitions::Stopwords::QUOTED_REGEX, '')\n end", "title": "" }, { "docid": "41c7f6095a968f02c7d3715be8dd3724", "score": "0.46061495", "text": "def test_text_invariant(t)\n\tt1 = t.text.gsub(\"\\n\", \"\\\\n\")\n\trep = \"line indices: [#{t.line_indices.join(', ')}], text = #{t1}\"\n\n\tassert(t.text.gsub(/[^\\n]/, '').length == t.line_indices.length, \"Incorrect number of newlines: #{rep}\")\n\tassert(t.line_indices == t.line_indices.sort)\n\tt.line_indices.each do |i| \n\t\tassert(t.text[i,1] == \"\\n\", \"line_indices false positive: #{rep}\")\n\tend\nend", "title": "" }, { "docid": "405612a8d44fb77448f4325a8372abfa", "score": "0.45960456", "text": "def action_comparer_many other_texts=[], params={}\n\t\tac = ActionComparer.new params\n\t\tac.too_similar_texts self, other_texts\n\tend", "title": "" }, { "docid": "4a40d15a87944ec81c280420e2ce898a", "score": "0.45934784", "text": "def old_text=(value)\n @old_text = value\n end", "title": "" }, { "docid": "17f074a304d95ec8bee3cec2483aaed8", "score": "0.45912015", "text": "def disambiguate_fields\n if name_changed? # New, Updated\n fields = self.class.specific.where(\"LOWER(name) = LOWER(?)\", self.name)\n fields.update_all(:disambiguate => fields.many?)\n end\n\n if name_was # Updated, Destroyed\n fields = self.class.specific.where(\"LOWER(name) = LOWER(?)\", self.name_was)\n fields.update_all(:disambiguate => fields.many?)\n end\n end", "title": "" }, { "docid": "485c05f603afc648f62b4885fd6a6994", "score": "0.45805562", "text": "def text_field?(field_name); end", "title": "" }, { "docid": "e0d515b35de5ac981daf101d7fd21c26", "score": "0.45782876", "text": "def unique_text_name\n string_with_id(name.real_search_name)\n end", "title": "" }, { "docid": "6f43f402aa698f4353f92d3655589296", "score": "0.4573605", "text": "def replicate_match(words)\n @text_lines.each_with_index do |line, i|\n line.replicate_match(words, @sltn_lines[i])\n end\n end", "title": "" }, { "docid": "bf54b5f51662b8836ef7cd7caf44a692", "score": "0.4570553", "text": "def ensure_search_terms_are_unique\n uniques = self.search_terms.dup.uniq\n if uniques != self.search_terms\n duplicates = find_duplicates(self.search_terms)\n errors.add(:search_terms, \"contains duplicated values: #{duplicates.join(', ')}\")\n end\n end", "title": "" }, { "docid": "d83b5f23412b2b42b1974bd21030dc7a", "score": "0.4564919", "text": "def fix_common_typos!\n # well, I don't know what kind of typos people do!\n @pattern.squish!\n end", "title": "" }, { "docid": "b498b2bf32bd32a3d59ba8b632ab4e72", "score": "0.4553954", "text": "def first_textfield\n _textfield_with_predicate\n end", "title": "" }, { "docid": "53a1935ad81a3f7ffcca7dd12f177f77", "score": "0.4541708", "text": "def text_field?(field_name)\n texts.find { |f| f.name == field_name }\n end", "title": "" }, { "docid": "9800e59307caf761720ce24313bfe2d7", "score": "0.45407334", "text": "def work_entry_other_ids(field)\n case field.tag\n when /(760|762|765|767|770|772|773|774|775|777|780|785|786|787)/\n field.subfields.select { |sf| work_entry_other_id_subfields(field).include?(sf.code) }\n .map { |sf| remove_parenthetical_id_prefix_from_sf_w(sf) }\n end\n end", "title": "" }, { "docid": "208481325a77d4e74e9e5d77f5547022", "score": "0.45396215", "text": "def check_other_links!\n self.gsub!(/\n (^|\\W) (?:_+) ([a-z]+) \\s+ ([^_\\s](?:[^_\\n]+[^_\\s])?) (?:_+) (?!\\w)\n /x) do |orig|\n result = orig\n prefix, type, id = $1, $2, $3\n if ['comment',\n 'image',\n 'location',\n 'name',\n 'observation',\n 'project',\n 'species_list',\n 'user'\n ].include?(type.downcase)\n if id.match(/^\\d+$/)\n label = \"#{type.downcase.capitalize_first.to_sym.l} ##{id}\"\n else\n label = id\n end\n result = \"#{prefix}x{#{type.upcase} __#{label}__ }{ #{id} }x\"\n end\n result\n end\n end", "title": "" }, { "docid": "8f2bbfea31172c9c17a6d87e7d231d81", "score": "0.45336148", "text": "def adv_search_set_text\n if @edit[@expkey].history.idx.zero? # Are we pointing at the first exp\n @edit[:adv_search_applied][:text] = if @edit[:new_search_name]\n _(\" - Filtered by \\\"%{text}\\\"\") % {:text => @edit[:new_search_name]}\n else\n _(\" - Filtered by \\\"%{text}\\\" report\") %\n {:text => @edit[:adv_search_report]}\n end\n else\n @edit[:custom_search] = true\n @edit[:adv_search_applied][:text] = _(\" - Filtered by custom search\")\n end\n end", "title": "" }, { "docid": "de7cad6a32d3606cd333f5fd72283361", "score": "0.45276636", "text": "def texte_entier\n @texte_entier ||= TextAnalyzer::Analyse::WholeText.new(self)\n end", "title": "" }, { "docid": "e8eb09f8f973fb2e348d435385b27728", "score": "0.45266634", "text": "def texts_exact(value)\n complex_finds_exact TEXT_VIEW, value\n end", "title": "" }, { "docid": "6b1fc6293bc0ced45c4f1fb4cd9ff1ad", "score": "0.4522383", "text": "def isSame(tab)\n for x in 0..3\n for y in 0..3\n return(false) if (self.val(x,y) != tab.val(x,y)) ;\n end\n end\n return true ;\n end", "title": "" }, { "docid": "a2056f002af003902e3ad84e40e8b15a", "score": "0.45161918", "text": "def inqtext(x, y, string)\n inquiry [{ double: 4 }, { double: 4 }] do |tbx, tby|\n super(x, y, string, tbx, tby)\n end\n end", "title": "" }, { "docid": "60a357624f00086463bcea4738de6781", "score": "0.45143527", "text": "def unique_text_name\n string_with_id(text_name)\n end", "title": "" }, { "docid": "97a2a762768f045c1be6eb26ee51785f", "score": "0.4507266", "text": "def get_original_text\n original_text.text\n end", "title": "" }, { "docid": "02f25ad5f832f5d05f471568901fae06", "score": "0.45071834", "text": "def is_other?\n\t\tkey == 'other'\n\tend", "title": "" }, { "docid": "02f25ad5f832f5d05f471568901fae06", "score": "0.45071834", "text": "def is_other?\n\t\tkey == 'other'\n\tend", "title": "" }, { "docid": "2db3cae8e040da35224715195b8ffddb", "score": "0.4505057", "text": "def done(initial_text, text)\n if text == '__no_save__'\n dbg '__no_save__'\n return nil\n end\n\n dbg 'Save text'\n if initial_text == text\n dbg 'Got the same text'\n return nil\n end\n\n return text\n end", "title": "" }, { "docid": "9ff7b41c78b948619a0161dd30d715b0", "score": "0.45045078", "text": "def difftotextpst()\n merge(rvdifftotextpst: 'true')\n end", "title": "" }, { "docid": "ff4b66eea260ecb3f9f1b0a04a362dcd", "score": "0.4503047", "text": "def subject_other_search\n @subject_other_search ||= begin\n vals = subject_occupations ? Array.new(subject_occupations) : []\n vals.concat(subject_names) if subject_names\n vals.concat(subject_titles) if subject_titles\n vals.empty? ? nil : vals\n end\n end", "title": "" }, { "docid": "7ce348add90ed01b20b9738cd813c0da", "score": "0.45002913", "text": "def mis_ramos\n\n\tend", "title": "" }, { "docid": "fd8ed22143a3699cc6f0af28330eb67c", "score": "0.44980434", "text": "def altered_clause_text(clause_title, selected_revision, current_project) \n \n last_clause_change = Change.where('project_id = ? AND clause_id = ? AND clause_add_delete =?', current_project.id, clause_title.id, 2).last\n if selected_revision.id == last_clause_change[:revision_id]\n \"<table width='100%' class='rev_table'><tr id='#{clause_title.id.to_s}'class='clause_title_2'><td class='rev_clause_code'>#{clause_title.clauseref.subsection.section.ref.to_s}#{clause_title.clauseref.subsection.ref.to_s}.#{clause_title.clauseref.clausetype_id.to_s}#{clause_title.clauseref.clause.to_s}#{clause_title.clauseref.subclause.to_s}</td><td class ='rev_clause_title'> #{clause_title.clausetitle.text.to_s}</td><td class='rev_line_menu_mob'>#{rev_mob_menu(clause_title)}</td><td class='rev_line_menu'>#{reinstate_original_clause(clause_title)}#{change_info_clause(clause_title)}</td></tr><tr class='rev_mob_menu_popup'><td class='mob_rev_menu' colspan=3 >#{reinstate_original_clause(clause_title)}#{change_info_clause(clause_title)}</td></tr></table>\".html_safe \n else\n \"<table width='100%' class='rev_table'><tr id='#{clause_title.id.to_s}'class='clause_title_2'><td class='rev_clause_code'>#{clause_title.clauseref.subsection.section.ref.to_s}#{clause_title.clauseref.subsection.ref.to_s}.#{clause_title.clauseref.clausetype_id.to_s}#{clause_title.clauseref.clause.to_s}#{clause_title.clauseref.subclause.to_s}</td><td class ='rev_clause_title'> #{clause_title.clausetitle.text.to_s}</td><td class='rev_line_menu_mob'>#{rev_mob_menu(clause_title)}</td><td class='rev_line_menu'>#{change_info_clause(clause_title)}</td></tr><tr class='rev_mob_menu_popup'><td class='mob_rev_menu' colspan=3 >#{change_info_clause(clause_title)}</td></tr></table>\".html_safe \n end\n end", "title": "" }, { "docid": "1cd447371e3c3cfcb8a0a98e798d0f77", "score": "0.44942087", "text": "def ==(other)\n\t\tself.date == other.date && \n\t\tself.user == other.user && \n\t\tself.text == other.text\n\tend", "title": "" }, { "docid": "e6b54799ab98ed040cb1b81b0907e677", "score": "0.4492466", "text": "def clean_primary_subject()\n self.area_of_study = self.clean_subject_string(self.area_of_study)\n self.save\n end", "title": "" }, { "docid": "918f7488d54c52121ebaf60e0c55032b", "score": "0.44905332", "text": "def find_and_replace_all(text_fields, text, replacement)\n total = 0\n text_fields.each do |model_class, fields|\n fields.each do |field_sym|\n results = find_text(model_class, field_sym.to_s, text)\n puts \"Found #{results.count} in #{model_class}##{field_sym.to_s}\"\n total+= results.count\n results.each do |model|\n replace_text(model, field_sym.to_s, text, replacement)\n end\n end\n end\n puts \"Total Found: #{total}\"\nend", "title": "" }, { "docid": "743263f480c2f1a0b75a8984ab445a38", "score": "0.44816333", "text": "def fill_fields(bf, ef)\n bf.each do |key, value|\n if value != \" \"\n ef.delete(key)\n end\n end\nend", "title": "" }, { "docid": "75e742237229be8305fd48bae1618810", "score": "0.44812196", "text": "def resource_match\n ret_str = ''\n ret_str = I18n.t('plugins.aspace-import-excel.error.res_ead') if @resource['ead_id'].blank?\n ret_str = ' ' + I18n.t('plugins.aspace-import-excel.error.row_ead') if @row_hash['ead'].blank?\n if ret_str.blank?\n ret_str = I18n.t('plugins.aspace-import-excel.error.ead_mismatch', :res_ead => @resource['ead_id'], :row_ead => @row_hash['ead']) if @resource['ead_id'] != @row_hash['ead']\n end\n ret_str.blank? ? nil : ret_str\n end", "title": "" }, { "docid": "143209041d3af33424e87a194b4590e0", "score": "0.4480751", "text": "def sentence_similarity(sentence,other_model)\n other_model.sentence_commonality(sentence) / sentence_commonality(sentence)\n end", "title": "" }, { "docid": "fd5497f1af1be638cbf15eb4f0aeeacc", "score": "0.44759536", "text": "def warn_about_duplicate_keys(h1, h2); end", "title": "" }, { "docid": "bc121d22db01311e4b32861dcacf6cc0", "score": "0.44703883", "text": "def adv\n @words1 = Word.all.sample(1)[0].word\n @words2 = Word.all.sample(1)[0].word\n end", "title": "" }, { "docid": "2e776539a67e0161ba4c256c701d8a35", "score": "0.4467511", "text": "def show_other\n\t\t@field_size = params[:field_size].nil? ? \"small\" : params[:field_size]\n\t\t@field_id = params[:field_id]\n\t\tif !params.nil? && !params[:selected].nil?\n\t\t\tsel = params[:selected].downcase\t\n\t\t\tif !sel.nil? && (sel.match(/^other\\.{3}?$/i))\n\t\t\t\t@field_name = params[:field_name]\n\t\t\t\t@new_field_id = 'other_' + @field_id.to_s\t\t\t\t\n\t\t\t\trender 'specify_other/show_input.js.erb'\n\t\t\telse\n\t\t\t\t@new_field_id = 'other_' + @field_id.to_s\n\t\t\t\trender 'specify_other/remove_input.js.erb'\n\t\t\tend\t\n\t\telse\n\t\t\t@new_field_id = 'other_' + @field_id.to_s\t\n\t\t\trender 'specify_other/remove_input.js.erb'\n\t\tend\t\n\tend", "title": "" }, { "docid": "8d17f6488dbe5bccd3fa819e0e7b22ba", "score": "0.44651285", "text": "def uniqify_fields\n begin\n self.uniq_title = self.title.to_uniq\n self.uniq_position = self.position.to_uniq\n self.uniq_playbacks_count = self.playbacks_count.to_uniq\n self.uniq_likes_count = self.likes_count.to_uniq\n self.uuid = UUIDTools::UUID.timestamp_create().to_s if self.uuid.nil?\n rescue\n end\n end", "title": "" }, { "docid": "c488447335a728100828dc7fb9ddc2a7", "score": "0.446282", "text": "def should_render_show_field?(document, solr_field)\n if solr_field.field.include?('description')\n field_no_tesim = solr_field.field.gsub('_tesim', '')\n split_fields = field_no_tesim.split(/\\s*_\\s*/)\n if ISO_639.find(split_fields[-1]).nil?\n if (!document[split_fields.join('_') << '_gle_tesim'].nil?)\n return false\n else\n super(document, solr_field)\n end\n elsif ISO_639.find(split_fields[-1]).include?('eng')\n split_fields.pop\n if !document[split_fields.join('_') << '_gle_tesim'].nil?\n super(document, solr_field)\n else\n return false\n end\n else\n super(document, solr_field)\n end\n else\n super(document, solr_field)\n end\n end", "title": "" }, { "docid": "b6f9aa7d52cfb3cc3175ec5cad468b2e", "score": "0.44627774", "text": "def diffyable\n # add appropriate diff column data for diff.right and diff.left and update other attrs to the Diffy way®\n\n w1id = self.work1\n w2id = self.work2\n w1work = Work.find(w1id)\n w2work = Work.find(w2id)\n w1md = w1work.file_content_md\n w2md = w2work.file_content_md\n w1txt = w1work.file_content_text\n w2txt = w2work.file_content_text\n\n html = Diffy::Diff.new(w1md, w2md).to_s(:html)\n md = Diffy::Diff.new(w1md, w2md).to_s\n text = Diffy::Diff.new(w1txt, w2txt).to_s\n \n lucy = Diffy::SplitDiff.new(w1md, w2md, :format => :html).left\n recha = Diffy::SplitDiff.new(w1md, w2md, :format => :html).right\n\n html.force_encoding(\"UTF-8\").scrub!\n md.force_encoding(\"UTF-8\").scrub!\n text.force_encoding(\"UTF-8\").scrub!\n\n lucy.force_encoding(\"UTF-8\").scrub!\n recha.force_encoding(\"UTF-8\").scrub!\n\n self.update_attributes(left: lucy, right: recha, diff_md: md, diff_html: html, diff_text: text)\n self.save\n end", "title": "" }, { "docid": "106135c7f96f3fdabc98ea1f26139b26", "score": "0.4462649", "text": "def data_righttest_label_bad(db); end", "title": "" }, { "docid": "361ef591d3d278fdd29b92673bc4bc94", "score": "0.44626024", "text": "def test_compare_string_overlap_defs\n v1 = Vertex.new(\"speech\", 2, 1, 0, 0, 1, \"NN\")\n v2 = Vertex.new(\"delivering\", 2, 1, 0, 0, 1, \"VB\")\n assert_equal(1, instance.compare_strings(v1, v2, speller))#no POS is considered for hypernyms and hyponyms\n end", "title": "" }, { "docid": "f302afa5c9aec049cdf05da940faaf53", "score": "0.44597265", "text": "def textField(textField, completions:somecompletions, forPartialWordRange:partialWordRange, indexOfSelectedItem:theIndexOfSelectedItem)\n matches = Entry.where(:title).contains(textField.stringValue,NSCaseInsensitivePredicateOption).map(&:title).uniq\n matches\n end", "title": "" }, { "docid": "402cd5a34e8bf909a694ae8f3cf7e69c", "score": "0.44544095", "text": "def clean_latex_document\n cache_literal(@polytex, :latex).tap do |doc|\n expand_input!(doc,\n Proc.new { |source| cache_literal(source, :latex) },\n 'tex')\n end\n end", "title": "" }, { "docid": "b0a082f09b2049fc78b4e897677a2a1b", "score": "0.44543135", "text": "def atualizaTxt\n #abre o arquivo para leitura\n uploaded_file = params[:file]\n uploaded_file = uploaded_file.read();\n\n #declara a regexp a ser utilizada para o parse\n regexp = /(aspx\\?cod=([\\d]{6}))|(<div align=\"center\">([A-Z]{2})<\\/div>)/\n\n #faz o scan no arquivo\n result = uploaded_file.scan(regexp)\n\n #Transforma de matchData para um vetor de hash\n #i é uma flag auxiliar para orientar qual o indice a ser gravado no hash, visto\n #que o matchData armazena matchs diferentes em posicoes diferentes \n #a matricula está em [1] e a menção em [3].\n i = true\n array = Array.new()\n novoElem = Hash.new()\n result.each do |elem|\n if i\n sql = \"select id from disciplinas where codigo = \" + elem[1]\n records_array = ActiveRecord::Base.connection.execute(sql)\n if records_array[0] != nil\n records_array = records_array[0]\n novoElem[:id] = records_array[\"id\"]\n else\n novoElem[:id] = 1\n end\n i = false\n else\n novoElem[:nota] = elem[3]\n i = true\n array.push(novoElem)\n novoElem = Hash.new()\n end\n end\n\n #remove as disciplinas em que o aluno reprovou\n array.delete_if {|disc| (disc[:nota] != \"MM\" && disc[:nota] != \"MS\" && disc[:nota] != \"SS\")}\n \n #adiciona as disciplinas no Resultado da pessoa\n\n\n i = 0\n array.each do |disc|\n i = i + 1\n resultado = Resultado.new\n resultado.aluno_id = current_user.id\n resultado.mencao = disc[:nota]\n resultado.disciplina_id = disc[:id]\n resultado.comentario = \"Adicao Automatica\"\n resultado.semestre = \"2000/01\"\n resultado.save\n end\n\n #redirect_back(fallback_location: root_path)\n\n\n #puts array\n end", "title": "" }, { "docid": "9891bcfefb8d5d5bfac9af54996685d3", "score": "0.44498402", "text": "def textfield_exact(value)\n ele_by_json _textfield_exact_string value\n end", "title": "" }, { "docid": "dd3046d6c10de1bbf73f93596aeef2d5", "score": "0.4445535", "text": "def sanitize text\n SANITIZE_THIS.each { |s| text = text.gsub(/#{s}/,'') }\n\n #római számok kiegészítés\n text = text.gsub(/\\W*(#{ROMAISZAMOK.keys.join('|')})\\.\\W*(\\w+)/) do \n ROMAISZAMOK[$1] ? ( ROMAISZAMOK[$1] + ' ' + $2 ) : $&\n end\n \n #századok\n text = text.gsub(/(\\W*)(#{(1..21).to_a.join('|')})\\.\\W+század/) do\n $1 + ROMAISZAMOK.values[($2.to_i - 1)]+' század'\n end\n\n #törtek ( itt mind , mind . után jön egy számsorozat\n text = text.gsub(/(\\d+)[,.](\\d+)/) { $1 + ' egész,' + $2 + ' ' }\n\n #külön írt számok, ha az első nem csatlakozik karakterhez, mint bolygónevek pl M4079 448 km/sec\n # és a második 3 karakter, hogy táblázatban lévő évszámokat pl ne vonjon össze\n text = text.gsub(/(\\W\\d+)\\s(\\d{3})/) { $1 + $2 }\n\n #idegesített az isbn\n text = text.gsub(/(ISBN)\\s*([0-9\\-]+)$/i) { 'iesbéen ' + $2.split('').join(' ') }\n\n # ie isz kr e kr u\n text = text.gsub(/(i\\.{0,1}\\s{0,1}sz\\.{0,1})\\s{0,1}(\\d)/i){ ' időszámításunk szerint ' + $2 }\n text = text.gsub(/([kK]r\\.{0,1}\\s{0,1}sz\\.{0,1})\\s{0,1}(\\d)/){ ' Krisztus szerint ' + $2 }\n text = text.gsub(/([kK]r\\.{0,1}\\s{0,1}u\\.{0,1})\\s{0,1}(\\d)/){ ' Krisztus után ' + $2 }\n text = text.gsub(/(i\\.{0,1}\\s{0,1}e\\.{0,1})\\s{0,1}(\\d)/){ ' időszámításunk előtt ' + $2 }\n text = text.gsub(/([kK]r\\.{0,1}\\s{0,1}e\\.{0,1})\\s{0,1}(\\d)/){ ' Krisztus előtt ' + $2 }\n\n # kis mértékegység hekk\n text = text.gsub(/\\Wkm\\/h\\W/,' km per óra ')\n text = text.gsub(/\\WkW\\W/,' kilo watt ')\n text = text.gsub(/\\Wkg\\W/i,' kilo gramm ')\n text = text.gsub(/(\\d+)\\W+m\\W/) { $1 + ' méter '}\n text = text.gsub(/°/,' fok')\n text = text.gsub(/[&]i/,' és ')\n # négyzet - sokszor előfordul földrajzban\n text = text.gsub(/km\\W{0,1}²/i){ ' négyzet km ' }\n # négyzet - matekban változó után jön. :/, mértékegységeknél előtte, mértékegységeket ki kéne szedni tömbbe\n text = text.gsub(/²/){ ' négyzet ' }\n text = text.gsub(/\\+\\/\\-/,' plussz minusz ')\n text = text.gsub(/×/,' szor ')\n\n # deokosvagyok rövidítésekbű\n text = text.gsub(/\\sstb\\.\\s/i, ' satöbbi ')\n text = text.gsub(/\\sun\\.\\s/i, ' úgy nevezett ')\n text\nend", "title": "" }, { "docid": "425fcda3b404103ae0624f51e98a9eca", "score": "0.44418514", "text": "def replace_text()\n @replace['replace']['tables'].each do |table, fields|\n fields.each do |field|\n #begin\n query = update_query(@replace['replace']['find'], @replace['replace']['replace'], table, field)\n puts query\n @dbconn.query(query)\n #rescue\n # return false\n #end\n end\n end\n return true\n end", "title": "" }, { "docid": "55ea49c70c9922c15b21274586fc0705", "score": "0.44299284", "text": "def fields_need_editing(obj) \n \teditable_fields(obj).select {|k,v| v == true }\n end", "title": "" }, { "docid": "fa071b44811ced83facdedb4b71ed311", "score": "0.44201094", "text": "def text_reports\n form_text_ids = @form_data.select do |field|\n field[:type] == 'text'\n end.map { |field| field['id'] }\n\n @report_data.select do |report_field|\n form_text_ids.include? report_field.report_id\n end\n end", "title": "" }, { "docid": "6a9a2172f81d127a06376447f66a2d2c", "score": "0.44197142", "text": "def field_names\n (text_fields + html_fields + atom_fields + datetime_fields +\n number_fields + geo_fields).uniq\n end", "title": "" }, { "docid": "79eb9acfbd864fa78bad52bb86fa7602", "score": "0.44153666", "text": "def identical?(record1, record2)\n if regexp\n if (str1_match_data = regexp.match(record1.whole)) and (str2_match_data = regexp.match(record2.whole))\n str1_match_data.captures.join.downcase == str2_match_data.captures.join.downcase\n else\n nil\n end\n else\n proc.call record1.original, record2.original\n end\n end", "title": "" }, { "docid": "ba4794696b070235edc62c7681ab9142", "score": "0.44144", "text": "def delete_useless!\n @eng_sentence = @eng_sentence - @useless_eng_words\n @rus_sentence = @rus_sentence - @useless_rus_words\n end", "title": "" }, { "docid": "f97ca4dcfade282edaa6545a1ebbd8fa", "score": "0.441433", "text": "def first_name_ocr_comparison_field\n 'first_name'\n end", "title": "" }, { "docid": "deba9af1cba375c157a327ff0a5bfa4c", "score": "0.44133902", "text": "def ==(other)\n date == other.date &&\n user == other.user &&\n text == other.text\n end", "title": "" }, { "docid": "17858d0b5bea8401ad046f51ae760703", "score": "0.44127205", "text": "def plain_text_field(*a, &b)\n text_field(*a, &b)\n end", "title": "" } ]
33fa950185bc7e2277d30d15897eb6c7
Gets a push zone specified by the zone_id parameter
[ { "docid": "add5136c753d78651960295ecaf128e3", "score": "0.8457574", "text": "def get_push_zone zone_id, options={}\n request :get, \"/{self.company_alias}/zones/push.json/#{zone_id}?#{options.to_q}\"\n end", "title": "" } ]
[ { "docid": "1c1f9cfd9330b7355bccc14432294d15", "score": "0.7370819", "text": "def zone zone_id\n ensure_connection!\n resp = connection.get_zone zone_id\n if resp.success?\n Zone.from_gapi resp.data, connection\n else\n nil\n end\n end", "title": "" }, { "docid": "abf487412f650911b2b4d87b77652048", "score": "0.7286495", "text": "def get_pull_zone zone_id, options={}\n request :get, \"/#{self.company_alias}/zones/pull.json/#{zone_id}?#{options.to_q}\"\n end", "title": "" }, { "docid": "8138d78ad5139c804fa67ab964127b4c", "score": "0.696616", "text": "def zone zone_id\n ensure_service!\n gapi = service.get_zone zone_id\n Zone.from_gapi gapi, service\n rescue Google::Cloud::NotFoundError\n nil\n end", "title": "" }, { "docid": "8c6ae87168ac744bf5224d9797000830", "score": "0.69594836", "text": "def get_zone(zone_id)\n request(\n :expects => 200,\n :method => 'GET',\n :parser => Fog::Parsers::DNS::Bluebox::GetZone.new,\n :path => \"/api/domains/#{zone_id}.xml\"\n )\n end", "title": "" }, { "docid": "d9f1dd50725d7e62f04f7f199069735c", "score": "0.68788403", "text": "def find(zone_id)\n new(call('domain.zone.info', zone_id))\n end", "title": "" }, { "docid": "f26642c17fe67309ea28e280fce622ae", "score": "0.67151207", "text": "def get_zone(zone=nil) \n zone ||= @zone\n get(\"Zone/#{zone}\")\n end", "title": "" }, { "docid": "4a1ef85381b8090956c2ee310a69ec6a", "score": "0.6632763", "text": "def get_zone(id)\n return $data.mapinfos[id].name if $data.mapinfos[id].name.include?('@')\n return map_zone_or_nil(id)\n end", "title": "" }, { "docid": "ba6c9a2faa5fd51d2338c44f51469188", "score": "0.6581829", "text": "def delete_push_zone zone_id\n request :delete, \"/#{self.company_alias}/zones/push.json/#{zone_id}\"\n end", "title": "" }, { "docid": "3325b0cbf40e524551973f23f67d8619", "score": "0.6565809", "text": "def zone_id\n route_53_client.\n list_hosted_zones[:hosted_zones].\n each.\n select { |z| z[:name] == zone }.\n map {|z| z[:id] }.\n first\n end", "title": "" }, { "docid": "969b44f0c5d11ceb2b353eb1bf6b9709", "score": "0.64743984", "text": "def get_zone(name)\n params = {\n 'command' => 'listZones',\n 'available' => 'true'\n }\n json = send_request(params)\n\n networks = json['zone']\n return nil unless networks\n\n networks.each { |z|\n if name.is_uuid? then\n return z if z['id'] == name\n else\n return z if z['name'] == name\n end\n }\n nil\n end", "title": "" }, { "docid": "09dd1ef4b3eead857262119af21a0408", "score": "0.64475715", "text": "def zone(id, &block)\n object_query(Spree::Zone, zone_uri(id), &block)\n end", "title": "" }, { "docid": "46f50a83be97eb4238b6031756519405", "score": "0.6433724", "text": "def zone(zone)\n raise NSOne::MissingParameter, \"zone cannot be blank\" if blank?(zone)\n perform_request(HTTP_GET, \"/zones/#{zone}\")\n end", "title": "" }, { "docid": "a945f7991dc05b5ec4effe478e2895b5", "score": "0.6419257", "text": "def get_zone_by_id(project_key, id, opts = {})\n data, _status_code, _headers = get_zone_by_id_with_http_info(project_key, id, opts)\n data\n end", "title": "" }, { "docid": "6688547778bff7041c293b5193c76ed8", "score": "0.6416259", "text": "def get_zone hash\n self.client.get_hosted_zone hash\n end", "title": "" }, { "docid": "49202d0da683d80c7d9db5eb7c8c4c31", "score": "0.63765293", "text": "def get_zone_id\n uri = URI.parse(@cf_uri)\n params = \"name=#{@zone}\"\n request = \"Net::HTTP::Get.new(uri.path+'?'+params, headers)\"\n response = \"json.fetch('result').first['id']\"\n make_request(params, uri, request, response)\n end", "title": "" }, { "docid": "15e6c06016d0cad1a0903150be0d70f3", "score": "0.6362268", "text": "def info(zone_id)\n call('domain.zone.info', zone_id)\n end", "title": "" }, { "docid": "ec1dfcf5ba559bde9187dff44ddb5ca9", "score": "0.6203901", "text": "def zone\n Zone.find(self.zone_id)\n end", "title": "" }, { "docid": "84ca840bb5380239953f043a4ef94411", "score": "0.61863714", "text": "def get(name_or_id)\n if zone = service.get_managed_zone(name_or_id).to_h\n new(zone)\n end\n rescue ::Google::Apis::ClientError => e\n raise e unless e.status_code == 404\n nil\n end", "title": "" }, { "docid": "5cd561fd9cb0b1ad04c5957f0820a635", "score": "0.61481506", "text": "def delete_pull_zone zone_id\n request :delete, \"/#{self.company_alias}/zones/pull.json/#{zone_id}\"\n end", "title": "" }, { "docid": "891df47499aafa63f4098984982ccbb5", "score": "0.5978217", "text": "def find(shipping_zone_id)\n path = \"/shipping-zones/#{shipping_zone_id}\"\n\n response, status = BeyondApi::Request.get(@session,\n path)\n\n handle_response(response, status)\n end", "title": "" }, { "docid": "0d162116eba098f9ab976a5ec0d03e6f", "score": "0.5919881", "text": "def show(id:)\n raise 'railgun id required' if id.nil?\n cf_get(path: \"/zones/#{zone_id}/railguns/#{id}\")\n end", "title": "" }, { "docid": "a76d7e2841ff84145779b3f43214c669", "score": "0.58686334", "text": "def fetch_zone\n route53 = Fog::DNS.new(connection_params)\n @zone = route53.zones.get(@current_resource.zone_id)\nend", "title": "" }, { "docid": "cb496ef59a290cff265a5c827f20e7b6", "score": "0.5800793", "text": "def get_default_zone\n params = {\n 'command' => 'listZones',\n 'available' => 'true'\n }\n json = send_request(params)\n\n zones = json['zone']\n return nil unless zones\n\n zones.first\n end", "title": "" }, { "docid": "0f44f604ca7fa8350a1a0b53a59ff3b9", "score": "0.5775163", "text": "def fetch_zone(zone)\n case node[:dns][:zone_strategy]\n when 'hybrid'\n zone_data = hybrid_zone zone\n when 'bags'\n zone_data = bag_zone zone\n else\n zone_data = attr_zone zone\n end\n zone_data\n end", "title": "" }, { "docid": "d686d105e0720381cff7c2faa53bd6a7", "score": "0.57607925", "text": "def get_default_zone\n params = {\n 'command' => 'listZones',\n 'available' => 'true'\n }\n json = send_request(params)\n\n zones = json['zone']\n return nil unless zones\n # zones.sort! # sort zones so we always return the same zone\n # !this gives error in our production environment so need to retest this\n zones.first\n end", "title": "" }, { "docid": "d7e0fd7fd7d7c56ba971594116bc99e6", "score": "0.5753691", "text": "def by_name name\n begin\n self.get_zone( :id => \n list_zones.find { |z| z[:name] == name }[:id]\n )\n rescue NoMethodError\n puts '='*80 + \"\\n Failed to find hosted DNS zone by name: #{name}\\n\" +'='*80\n nil\n end\n end", "title": "" }, { "docid": "fc6152f01868daaac5a8a11e7b5c3fbc", "score": "0.57283723", "text": "def seats_in_zone(zone)\n self.zones[zone.short_name]\n end", "title": "" }, { "docid": "7e9cff3ed5b620c415b008a7a5f66ca7", "score": "0.56367177", "text": "def zone_template\n @zone_template ||= ZerigoDNS::ZoneTemplate.find(zone_template_id)\n end", "title": "" }, { "docid": "de90364fb36df0ff69c45ad41c7ce60b", "score": "0.5632094", "text": "def enable_push_zone zone_id, options={}\n request :enable, \"/#{self.company_alias}/zones/push.json/#{zone_id}\"\n end", "title": "" }, { "docid": "42333a1477ee1cadb4c22bbd77627791", "score": "0.5626854", "text": "def zone_lookup(user_key, zone)\n send_req({act: :zone_lookup, user_key: user_key, zone_name: zone}) \n end", "title": "" }, { "docid": "41c7913154416cbc91af7e66f9b74022", "score": "0.56245214", "text": "def get_by_subscription(id)\n params = { :id => id }\n DataSift.request(:GET, 'push/get', @config, params)\n end", "title": "" }, { "docid": "b4696c287d8225b3ce73042ab2732296", "score": "0.5622326", "text": "def zone_id\n @zone_id ||= @client.zones.all_zones(account_id).data.find { |z|\n z.name == @opts.get('domain')\n }.id\n end", "title": "" }, { "docid": "c10f4f8e4ff922714468feb173b8f2ab", "score": "0.5620108", "text": "def show(id:)\n id_check('id', id)\n\n cf_get(path: \"/zones/#{zone_id}/custom_hostnames/#{id}\")\n end", "title": "" }, { "docid": "eac0f2548b11e8fb5b298f19796bf3d6", "score": "0.5596234", "text": "def show(id:)\n id_check('dns record id', id)\n cf_get(path: \"/zones/#{zone_id}/dns_records/#{id}\")\n end", "title": "" }, { "docid": "6f3f77521198fc34797216621feb9e44", "score": "0.55874103", "text": "def get_zone_by_name(domain)\n client = Aws::Route53::Client.new\n\n zones = client.list_hosted_zones_by_name({\n dns_name: domain,\n max_items: 1\n })\n zones.hosted_zones[0].id.tr(\"/hostedzone/\", \"\")\nend", "title": "" }, { "docid": "28451b5c429581b8129073a9aeb7a957", "score": "0.55794036", "text": "def update_push_zone zone_id, options={}\n request :put, \"/#{self.company_alias}/zones/push.json/#{zone_id}?#{options.to_q}\"\n end", "title": "" }, { "docid": "e9723e3cf92bbe6fce15eef1a8efccc5", "score": "0.5563821", "text": "def update_pull_zone zone_id, options={}\n request :put, \"/#{self.company_alias}/zones/pull.json/#{zone_id}?#{options.to_q}\"\n end", "title": "" }, { "docid": "f6c866140fe45a97172b65f0037705e6", "score": "0.5550141", "text": "def find_zone(str)\n find(str,:object=>:zone)\n end", "title": "" }, { "docid": "9f8ea68801bf433251651c6f2261d065", "score": "0.5544424", "text": "def get_zone_stats(zone_id)\n request(\n :expects => 200,\n :method => 'GET',\n :parser => Fog::Parsers::Zerigo::DNS::GetZoneStats.new,\n :path => \"/api/1.1/zones/#{zone_id}/stats.xml\"\n )\n end", "title": "" }, { "docid": "6f71b4a2424916018ae62b4d27bced58", "score": "0.5536968", "text": "def enable_pull_zone zone_id, options={}\n request :enable, \"/#{self.company_alias}/zones/pull.json/#{zone_id}\"\n end", "title": "" }, { "docid": "aad44180b2b7a92bf18a4c0906d442c2", "score": "0.5521456", "text": "def zone\n fetch('games.sonic_the_hedgehog.zone')\n end", "title": "" }, { "docid": "e0fcbcd88d3dae4a884b59da9067dfbe", "score": "0.5516892", "text": "def disable_push_zone zone_id, options={}\n request :disable, \"/#{self.company_alias}/zones/push.json/#{zone_id}\"\n end", "title": "" }, { "docid": "ff219d2c7b6ab32c608720403d380bcd", "score": "0.55149245", "text": "def get_record zone, name\n rec_load_all(zone)['response']['recs']['objs'].each do |rec|\n return rec if rec['display_name'] == name && rec['zone_name'] == zone\n end rescue NoMethodError\n nil\n end", "title": "" }, { "docid": "7e1c6e38b3d9f40a7d5c000cabaf7253", "score": "0.5488621", "text": "def get_zone_by_name(name)\n if name.match(/^Z[A-Z0-9]{13}$/) # id is 14 char upcase string starting with Z\n name\n else\n matches = route53.list_hosted_zones.hosted_zones.select do |zone|\n zone.name.match(name)\n end\n case matches.size\n when 0\n say \"no hosted zones matching #{name}\", :red\n exit\n when 1\n matches.first.id\n else\n say \"ambiguous hosted zone, matches: #{matches.map(&:name).join(', ')}\", :yellow\n exit\n end\n end\n end", "title": "" }, { "docid": "9b3ac65823ffebaaa16350356932f0bb", "score": "0.5481447", "text": "def zone_identifier; end", "title": "" }, { "docid": "90834e33cb9991a497d71753fd196e56", "score": "0.54737604", "text": "def list_push_zones options={}\n request :get, \"/#{self.company_alias}/zones/push.json?#{options.to_q}\"\n end", "title": "" }, { "docid": "9dfb93a24ec66c64c85282635adb4f6d", "score": "0.5466015", "text": "def show\n @zone = Zone.find(params[:id])\n end", "title": "" }, { "docid": "5fdae8ef4857d3846185af6271e81b6e", "score": "0.5453122", "text": "def zone_name\n @name\n end", "title": "" }, { "docid": "696d2cc614de78f4eb187bdee0c8f245", "score": "0.5445064", "text": "def zone\n if @zone\n @zone\n elsif !self[Place.zone_predicate].empty?\n @zone = Zone.find(self[Place.zone_predicate].first)\n else\n nil\n end\n end", "title": "" }, { "docid": "a51e9d228da2303693f008c6e18305b9", "score": "0.5444457", "text": "def zone_id(zone)\n\t\t# Example host_url: /hostedzone/zoneID\n\t\treturn zone.host_url.split('/')[2]\n\tend", "title": "" }, { "docid": "338c35a672ea55fd686900537d8306ac", "score": "0.54299015", "text": "def zone(uuid, headers = {})\n Resources::Zone.new(self, get_zone(uuid, headers).body)\n end", "title": "" }, { "docid": "338c35a672ea55fd686900537d8306ac", "score": "0.54299015", "text": "def zone(uuid, headers = {})\n Resources::Zone.new(self, get_zone(uuid, headers).body)\n end", "title": "" }, { "docid": "1b9569f39ce94754513b1fa5efbf8d8a", "score": "0.5422896", "text": "def zone\n @rdatelist.getTzid.getID\n end", "title": "" }, { "docid": "12c8a1cda6cd3fa20563024d7a710d18", "score": "0.54227984", "text": "def vpc_zone_identifier\n data[:vpc_zone_identifier]\n end", "title": "" }, { "docid": "a6ecaecb23d934b850daf11c542c071a", "score": "0.54221016", "text": "def zone_qps(zone)\n raise NSOne::MissingParameter, \"zone cannot be blank\" if blank?(zone)\n normalize_names!(zone)\n perform_request(HTTP_GET, \"/stats/qps/#{zone}\")\n end", "title": "" }, { "docid": "f8d683a649662963d796141df311da00", "score": "0.53953564", "text": "def info(session, id)\n read_task('rvpe.zone.info', session) do\n zone = Zone.find_by_id(id)[0]\n raise \"Zone[#{id}] is not found.\" unless zone\n\n zone_e = zone.to_xml_element(session)\n doc = REXML::Document.new\n doc.add(zone_e)\n\n [true, doc.to_s]\n end\n end", "title": "" }, { "docid": "d9f0de57be167a2503e5dce98b656eb1", "score": "0.53931975", "text": "def zone\n self\n end", "title": "" }, { "docid": "47a050bfb6c3ba70d1e8778a301569b7", "score": "0.538103", "text": "def get_timezone(zone_identifier)\n TZInfo::Timezone.get(zone_identifier)\nend", "title": "" }, { "docid": "79e5abba61cc3664882efb00108b93dc", "score": "0.5341695", "text": "def path\n \"/hostedzone/#{id}\"\n end", "title": "" }, { "docid": "c2e4384c526fee85d6c342b4be9d8ec2", "score": "0.53390896", "text": "def delete(zone_id)\n call('domain.zone.delete', zone_id)\n end", "title": "" }, { "docid": "d22a17eca0e5b8b08fe8ddcfd24b3089", "score": "0.53373563", "text": "def zone\n Spree::Zone.find_each do |zone|\n return zone if zone.members.detect { |member| member.zoneable.try(:iso).eql?(country_code) }\n end\n end", "title": "" }, { "docid": "1451b3076f20c828f61776ca48130b40", "score": "0.5335957", "text": "def get_resource_id_from_zone(name, zone_name, search_str)\n pool = RenkeiVPE::ZonePool.new(RenkeiVPE::Client.new)\n result = pool.info\n if RenkeiVPE.is_error?(result)\n $stderr.puts 'Error: ' + result.message\n exit 1\n end\n\n if zone_name.match(/^[0123456789]+$/)\n zones = pool.select { |z| z.id == zone_name.to_i }\n else\n zones = pool.select { |z| z.name == zone_name }\n end\n\n if zones.size == 1\n zone = zones[0]\n zone.each(search_str) do |h|\n return h['ID'] if h['NAME'] == name\n end\n $stderr.puts \"Error: Host[#{name}] is not found in Zone[#{zone_name}].\"\n exit 1\n elsif zones.size > 1\n $stderr.puts \"Error: There are multiple zone's with name #{zone_name}.\"\n exit 1\n else\n $stderr.puts \"Error: Zone[#{zone_name}] is not found.\"\n exit 1\n end\n end", "title": "" }, { "docid": "1d0b165688a29dd948727d632b5605ad", "score": "0.53306085", "text": "def zone_check(disk_zone)\n begin\n zone = client.zones.get(disk_zone)\n return zone\n rescue Google::Compute::ResourceNotFound\n Chef::Application.fatal!(\"Zone '#{disk_zone}' not found\")\n end\n end", "title": "" }, { "docid": "a956217a461cfa9854c67ff1b3483036", "score": "0.53216356", "text": "def load_one( zone_name )\n raise ArgumentError, \"Zone name expected to be a string\" unless zone_name.kind_of? String\n load\n if zone = zones.find{ |z| z.name == zone_name }\n zone.load\n end\n zone\n end", "title": "" }, { "docid": "c87586a9d423db07bd0a5e7b0e2d755a", "score": "0.53069395", "text": "def find_zone(time_zone); end", "title": "" }, { "docid": "c87586a9d423db07bd0a5e7b0e2d755a", "score": "0.53069395", "text": "def find_zone(time_zone); end", "title": "" }, { "docid": "ad5d8fdaddcc41d35c7643999c6800d8", "score": "0.5306545", "text": "def get_by_id(id)\n HttpClient::Preconditions.assert_class('id', id, String)\n r = @client.request(\"/reference/regions/#{CGI.escape(id)}\").get\n ::Io::Flow::V0::Models::Region.new(r)\n end", "title": "" }, { "docid": "ad5d8fdaddcc41d35c7643999c6800d8", "score": "0.5306545", "text": "def get_by_id(id)\n HttpClient::Preconditions.assert_class('id', id, String)\n r = @client.request(\"/reference/regions/#{CGI.escape(id)}\").get\n ::Io::Flow::V0::Models::Region.new(r)\n end", "title": "" }, { "docid": "ad86443d2ff71d422a9187b60c918927", "score": "0.52874506", "text": "def zone_at(x, y, z = 0)\n zones[x, y, z]\n end", "title": "" }, { "docid": "7c30539a550b0e249907da4e0f61c8c3", "score": "0.527113", "text": "def zone_name\n caz_data['name']\n end", "title": "" }, { "docid": "fc0f4f7e1c11a75cbda509fe8a13ff6e", "score": "0.52580744", "text": "def zones_delete zID: \n call_adglare_api 'zones_delete', {zID: zID}\n end", "title": "" }, { "docid": "4c8ea6726b41ab2d9416fce138862f50", "score": "0.5252071", "text": "def find_zone(time_zone)\n find_zone!(time_zone) rescue nil\n end", "title": "" }, { "docid": "4c8ea6726b41ab2d9416fce138862f50", "score": "0.5252071", "text": "def find_zone(time_zone)\n find_zone!(time_zone) rescue nil\n end", "title": "" }, { "docid": "6d17cdfbb914b5e7757a8d8d577dd28a", "score": "0.5243387", "text": "def zone( force_refresh = false )\n @zone = Zone.find(self.zone_id) if @zone.nil? || force_refresh\n @zone\n end", "title": "" }, { "docid": "cdd3f5e1572916c36273a315f81febc6", "score": "0.5240128", "text": "def zone\n period.zone_identifier.to_s\n end", "title": "" }, { "docid": "34785b8cee6ce4fd84c13f4c6dc5fa28", "score": "0.5237318", "text": "def zone_uuids()\n q = Net::HTTP::Get.new('/api/v5/zones')\n q['X-Api-Key'] = @apikey\n r = @api.request(q)\n return r.code, r.body\n end", "title": "" }, { "docid": "6151359562d8d1b5bab652fc67b0359f", "score": "0.5218106", "text": "def get_zone_pool(id, pool)\n begin\n zone = OZones::OpenNebulaZone.new(id)\n return zone.pool_to_json(pool)\n rescue => e\n return [404, OZones::Error.new(e.message).to_json]\n end\n end", "title": "" }, { "docid": "e64e7a0049a79fd8efe0f03ff03b5a65", "score": "0.51869977", "text": "def zone\n @time.getZone.getID\n end", "title": "" }, { "docid": "d4e26cccdc8897a9e3df5c8091fe85d7", "score": "0.5156604", "text": "def details\n data = Storm::Base::SODServer.remote_call '/Network/Zone/details',\n :id => @id\n self.from_hash data\n end", "title": "" }, { "docid": "f50defa1c6a87fa6fb4ae2da49f24e6c", "score": "0.5144302", "text": "def zone_list(id)\n result = []\n GameData::Zone.all.each_with_index do |zone, index|\n result << index if zone.worldmap_id == id\n end\n return result\n end", "title": "" }, { "docid": "51d7c214acfc3b3308d62ef1f26708ba", "score": "0.51433283", "text": "def get_zones\n\t\t#Eager Loading Associations. http://guides.rubyonrails.org/active_record_querying.html#eager-loading-associations\n\t\tzones = Post.includes(:zones => :messages).find(params[:id])\n\t\t\n\t\trespond_to do |format| \n\t\t\t#format.html { render :json => output } \n\t\t\t\n\t\t\t#output the json and tell it what to include...\n\t\t\tformat.html { render:json => zones.to_json( \n\t\t\t :include => {\n\t\t\t :zones => {\n\t\t\t :include => :messages\n\t\t\t }\n\t\t\t }\n\t\t\t)}\n\t\t\t\n\t\t\t#format.xml { head :ok } \n\t\tend\n\t\t\n\tend", "title": "" }, { "docid": "25411472d544eb7a2b1d8a916db0ccff", "score": "0.51419234", "text": "def get_record(zone_id, record_id)\n request(\n :expects => 200,\n :method => 'GET',\n :parser => Fog::Parsers::DNS::Bluebox::GetRecord.new,\n :path => \"/api/domains/#{zone_id}/records/#{record_id}.xml\"\n )\n end", "title": "" }, { "docid": "12fa9c2349b5172ed6a6f98f4c46b717", "score": "0.5140155", "text": "def get_zone_by_id_with_http_info(project_key, id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: DefaultApi.get_zone_by_id ...'\n end\n # verify the required parameter 'project_key' is set\n if @api_client.config.client_side_validation && project_key.nil?\n fail ArgumentError, \"Missing the required parameter 'project_key' when calling DefaultApi.get_zone_by_id\"\n end\n # verify the required parameter 'id' is set\n if @api_client.config.client_side_validation && id.nil?\n fail ArgumentError, \"Missing the required parameter 'id' when calling DefaultApi.get_zone_by_id\"\n end\n # resource path\n local_var_path = '/{projectKey}/zones/{ID}'.sub('{' + 'projectKey' + '}', CGI.escape(project_key.to_s)).sub('{' + 'ID' + '}', CGI.escape(id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'expand'] = @api_client.build_collection_param(opts[:'expand'], :multi) if !opts[:'expand'].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] || 'Zone'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['oauth_2_0']\n\n new_options = opts.merge(\n :operation => :\"DefaultApi.get_zone_by_id\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: DefaultApi#get_zone_by_id\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "ecd65cb3c036ef5bd645183fbb40baee", "score": "0.51280236", "text": "def show(id:)\n id_check('id', id)\n\n cf_get(path: \"/zones/#{zone_id}/keyless_certificates/#{id}\")\n end", "title": "" }, { "docid": "5a5f1dc1211494f7a48590f7a3efa0dc", "score": "0.5102569", "text": "def get(network_id)\n return get_dummy_public if network_id == 'public'\n return get_dummy_private if network_id == 'private'\n\n vpc = get_raw(network_id)\n vpc ? parse_backend_obj(vpc) : nil\n end", "title": "" }, { "docid": "190f3ebca765588f7264e5277bada540", "score": "0.5100691", "text": "def zones_list zID: nil, zgID: nil \n call_adglare_api 'zones_list', {zId: zID, zgID: zgID}\n end", "title": "" }, { "docid": "60cb15ec258716cbb464ade88434586c", "score": "0.5097702", "text": "def get_zone_data(zone)\n file = File.join(ZONE_FILE_PATH, zone)\n\n if !File.exists?(file)\n raise Timezone::Error::InvalidZone, \"'#{zone}' is not a valid zone.\"\n end\n\n File.read(file)\n end", "title": "" }, { "docid": "b9425f7062c5c7b7574057894c53c81f", "score": "0.5096743", "text": "def get_transport_zone(zone_id, opts = {})\n data, _status_code, _headers = get_transport_zone_with_http_info(zone_id, opts)\n return data\n end", "title": "" }, { "docid": "59c8871f485274f907a7913adec8f4ab", "score": "0.5058496", "text": "def set_zone\n @zone = Zone.find(params[:id])\n end", "title": "" }, { "docid": "59c8871f485274f907a7913adec8f4ab", "score": "0.5058496", "text": "def set_zone\n @zone = Zone.find(params[:id])\n end", "title": "" }, { "docid": "f4793b24875706b7dd6945136feda2fb", "score": "0.5051015", "text": "def zone_for( host, port )\n config.each_pair do |zone, info|\n return zone if info['host'] == host and info['port'] == port.to_i\n end\n nil\n end", "title": "" }, { "docid": "5b377656f409840917d5ddba42443c7a", "score": "0.5045961", "text": "def disable_pull_zone zone_id, options={}\n request :disable, \"/#{self.company_alias}/zones/pull.json/#{zone_id}\"\n end", "title": "" }, { "docid": "0aa03a35cb22b7a672d8cd33568e0e3f", "score": "0.50318515", "text": "def show\n @zone = @shop.zones.find params[:id]\n\n respond_to do |format|\n format.html\n format.json { render json: @zone }\n end\n end", "title": "" }, { "docid": "dd66de9bdf2fa8f162c4d9f740925d41", "score": "0.50131637", "text": "def get_time_zone\n method = \"getTimeZone\"\n post_request(method)\n end", "title": "" }, { "docid": "dd66de9bdf2fa8f162c4d9f740925d41", "score": "0.50131637", "text": "def get_time_zone\n method = \"getTimeZone\"\n post_request(method)\n end", "title": "" }, { "docid": "9fd44e2c6f1de8533f62bce15e6490bc", "score": "0.50105447", "text": "def deleteZone\n Puppet.debug \"Delete Zone \"+resource[:name]\n \n id = lookupId\n \n params = { \n :id => id,\n }\n #Puppet.debug \"deleteZone PARAMS = \"+params.inspect\n response = self.class.http_get('deleteZone', params) \n end", "title": "" }, { "docid": "fd0afafd04a04b781b50e93815a8e84b", "score": "0.50081456", "text": "def zone_name\n @data.env.current_zone_name\n end", "title": "" }, { "docid": "a4ecaee443cb7e95261f9ca66c5b81cf", "score": "0.50006866", "text": "def fetch_znode(zk, id)\n zk.get(\"#{BROKERS_PATH}/#{id}\")[0]\n rescue ZK::Exceptions::NoNode\n nil\n end", "title": "" }, { "docid": "773571529ad6836ecc70ea94c39eabbc", "score": "0.4996552", "text": "def bag_zone(zone)\n data_bag_item(node[:dns][:bag_name], Helpers::DataBags.escape_bagname(zone))\n end", "title": "" }, { "docid": "af9615ff1a24be39ce6a741cc2fd1e8a", "score": "0.49936846", "text": "def set_zone\n @zone = Zone.find(params[:id])\n end", "title": "" } ]
62bbef3777d9f30f9494e01aaac7b628
PUT /panel/organization_invitations/1 PUT /panel/organization_invitations/1.json
[ { "docid": "7f656ef330f7b7c0f8f981a34fbdb0fe", "score": "0.76772195", "text": "def update\n @panel_organization_invitation = Panel::OrganizationInvitation.find(params[:id])\n\n respond_to do |format|\n if @panel_organization_invitation.update_attributes(params[:panel_organization_invitation])\n format.html { redirect_to(@panel_organization_invitation, :notice => 'Organization invitation was successfully updated.') }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @panel_organization_invitation.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "b4492824a9e6106cb7d32a5515a76abc", "score": "0.71569407", "text": "def organization_invite\n params['host'] = Ind.http_api\n params['api_key'] = Accounts.new.find_by_email(params['email']).api_key\n\n org_res = Organizations.new.list(params).orgs\n\n org_res[0][:related_orgs] << params['org_id']\n org_res[0][:api_key] = params['api_key']\n org_res[0][:email] = params['email']\n org_res[0][:host] = Ind.http_api\n\n res = Organizations.new.update(org_res[0])\n redirect_to root_url\n end", "title": "" }, { "docid": "54e64c273613e3b982c6fc7f06e68f0d", "score": "0.66928715", "text": "def UpdateOrganization params = {}\n \n APICall(path: 'organizations.json',method: 'PUT',payload: params.to_json)\n \n end", "title": "" }, { "docid": "cd7f160ffc56806fcf0e29996761e0cc", "score": "0.66679204", "text": "def update\n @organization = Organization.find(params[:id])\n @organization.update_attributes(params[:organization])\n respond_with @organization\n end", "title": "" }, { "docid": "a7eeb16cacdb30e1a76fe10e1081bb09", "score": "0.66372114", "text": "def update\n @organization = Organization.find(params[:id])\n @organization.update_attributes(organization_params)\n \n respond_with(@organization, :location => admin_organizations_path)\n end", "title": "" }, { "docid": "57c0dc8a6feb7795c1d6a66c79cdfecd", "score": "0.6632444", "text": "def update\n @organization.update(organization_params)\n respond_with(@organization)\n end", "title": "" }, { "docid": "f31b97d437c976831d580e2c908bf255", "score": "0.6585123", "text": "def update\n @organization = Organization.find(params[:id])\n\n if current_user.has_role?('admin')\n @organization.is_pending = false\n end\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n flash[:notice] = 'Organization was successfully updated.'\n format.html { redirect_to(@organization) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @organization.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af018bcc3e50449cf5cd877fde08c738", "score": "0.6566135", "text": "def update\n authorize @organization_membership\n\n if @organization_membership.update(organization_membership_update_params)\n head :no_content\n else\n render json: @organization_membership.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "6616bef843b1b15ce74789929ca79e31", "score": "0.65359825", "text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2de167f333ee5f62d165ec46b12c4c13", "score": "0.6511515", "text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to admin_organizations_path, notice: \"Organization #{@organization.name} was successfully updated.\" }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "66575dea7ad08af23fd4bb4008a41c01", "score": "0.6448994", "text": "def update\n respond_to do |format|\n if @partnering_organization.update(partnering_organization_params)\n format.html { redirect_to @partnering_organization, notice: 'Partnering organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @partnering_organization }\n else\n format.html { render :edit }\n format.json { render json: @partnering_organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dfb3231fe3d598af7ba5f709764cca7b", "score": "0.6428732", "text": "def update\n @invitations = Invitation.where(:specification_id => session[:specification_sel_id]).all\n \n @act.update(act_params)\n @act.docencia = params[\"doc\"]\n @act.investigacion = params[\"inv\"]\n @act.extension = params[\"ext\"]\n @act.apoyo = params[\"apoyoA\"]\n @act.responsable = @act.responsable.upcase\n @act.justificacion = @act.justificacion.upcase\n @act.providencia = @act.providencia.upcase\n respond_to do |format|\n if @act.save\n format.html { redirect_to @act, notice: 'Act was successfully updated.' }\n format.json { render :show, status: :ok, location: @act }\n else\n format.html { render :edit }\n format.json { render json: @act.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.64223915", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.64223915", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.64223915", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.64223915", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.64223915", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.64223915", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ed9edf74dfac47ee56db5679bc439c8", "score": "0.64223915", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "77d6189c4db2e7f85d0e1e9986666231", "score": "0.6402334", "text": "def update\n if @organization.update(organization_params)\n render :show, status: :ok, location: @organization\n else\n render json: @organization.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "089cfb3387a1d7504409feb6fd6fac0e", "score": "0.63751113", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "089cfb3387a1d7504409feb6fd6fac0e", "score": "0.63751113", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a7485e11cc770c8d65e2aeba7b0b2d2a", "score": "0.63707715", "text": "def update\n @participating_organization = ParticipatingOrganization.find(params[:id])\n\n respond_to do |format|\n if @participating_organization.update_attributes(params[:participating_organization])\n format.html { redirect_to(participating_organizations_path, :notice => 'Participating Organization was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @participating_organization.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "98ebddd960fc8a8c119ebb3086abfcf4", "score": "0.636257", "text": "def update\n @linked_in_invitation = LinkedInInvitation.find(params[:id])\n\n respond_to do |format|\n if @linked_in_invitation.update_attributes(params[:linked_in_invitation])\n format.html { redirect_to @linked_in_invitation, notice: 'Linked in invitation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @linked_in_invitation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4bf2eeaf3406791351912e4310fbd01b", "score": "0.63610166", "text": "def edit_organization(org, options={})\n patch \"/orgs/#{org}\", :body => options\n end", "title": "" }, { "docid": "478032aecfbe7efbcd4b7c0db10295c9", "score": "0.63357687", "text": "def update\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n format.html { redirect_to admin_organization_path, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { redirect_to admin_organization_path, notice: 'Organization could not be updated.' }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fb7bbf76af7a52ceb6122b59a47cf37f", "score": "0.63356733", "text": "def edit\n @organization = Organization.find(params[:id])\n end", "title": "" }, { "docid": "2768b794218f5830978a5ad0cc64f9c4", "score": "0.6327328", "text": "def update\n\t\trespond_to do |format|\n\t\t\tif @organization.update_attributes(params[:organization])\n\t\t\t\tformat.html { redirect_to(@organization, :notice => 'Organization was successfully updated.') }\n\t\t\t\tformat.xml { head :ok }\n\t\t\telse\n\t\t\t\tformat.html { render :action => \"edit\" }\n\t\t\t\tformat.xml { render :xml => @organization.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "486c70b662f78c8e1d14e0ddebe257e9", "score": "0.6324896", "text": "def update\n authorize! :update, Organization\n respond_to do |format|\n if @organization.update(organization_params)\n format.js\n else\n format.js { render :edit }\n end\n end\n end", "title": "" }, { "docid": "c384f6d95bfd41cddd0c56201f510771", "score": "0.6321155", "text": "def update\n if @organization.update(organization_params)\n render :show, status: :ok, location: @organization\n else\n render json: @organization.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "d7e3d4e44ad9ee174987a8a3dddbfe40", "score": "0.63174266", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to edit_admin_organization_path(@organization), notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n flash[:error] = \"#{@organization.errors.full_messages.first}\"\n format.html { redirect_to edit_admin_organization_path(@organization) }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5cd3319f3d39b00fc36a3dd6786878a", "score": "0.6314934", "text": "def update\n @invitation = Invitation.find(params[:id])\n @invitation.update_attributes(params[:invitation])\n respond_with(@invitation)\n end", "title": "" }, { "docid": "61d22294f873f58177e3132ef2122c52", "score": "0.63144094", "text": "def update\n @organization = Organization.find(params[:id])\n\n if @organization.update_attributes(params[:organization])\n redirect_to admin_organizations_url, :notice => t('organization.messages.update.success')\n else\n render action: \"edit\"\n end\n end", "title": "" }, { "docid": "7ea845af6d379f0667ed4f34d7d0e123", "score": "0.6298091", "text": "def update\n @organization = Organization.find(params[:id])\n\n authorize! :update, @organization\n\n respond_to do |format|\n if @organization.update_attributes(permitted_params)\n format.html { redirect_to @organization, notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { @title = edit_action_title; render action: \"edit\" }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f216b5d82e610b0eff6db1003a2bba42", "score": "0.6298075", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to edit_organization_path(@organization), notice: 'Organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "76085e27e2dd385c399bd689c88e627a", "score": "0.62911105", "text": "def update\n @organization_membershipship = current_person.organization_memberships.find(params[:id])\n\n respond_to do |format|\n if @organization_membershipship.update_attributes(params[:organization_membershipship])\n format.html { redirect_to(@organization_membershipship, :notice => 'Organization membership was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @organization_membershipship.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6aa7a5b56dba46b6cf932da204a7a362", "score": "0.62896323", "text": "def update\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n flash[:notice] = 'Organization was successfully updated.'\n format.html { redirect_to @organization }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @organization.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9e8c8b1846ee382cecec5a6cdcbef30b", "score": "0.62789375", "text": "def update\n @organization.update(organization_params)\n if @organization.save\n render json: { success: \"organization updated successfully\"}, status: :ok\n else\n render json: { errors: @orgnanization.errors.full_messages }, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "6d57afa86937cfc1042023c64b294289", "score": "0.627638", "text": "def update\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to organization_path(@organization), notice: 'Организация успешно обновлена.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "26cdc038babd808682faa786cfde19f9", "score": "0.6252702", "text": "def update\n @organization.user_updated_id = current_user.id\n respond_to do |format|\n if @organization.update(organization_params)\n format.html { redirect_to @organization, notice: 'Información actualizada satisfactoriamente.' }\n format.json { render :show, status: :ok, location: @organization }\n else\n format.html { render :edit }\n format.json { render json: @organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cc4527305b0979916ca63a1b6c950926", "score": "0.6215768", "text": "def update\n respond_to do |format|\n if @user_organization.update(user_organization_params)\n format.html { redirect_to @user_organization, notice: 'User organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @user_organization }\n else\n format.html { render :edit }\n format.json { render json: @user_organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5c36f011269f89cf531db90ea5d03174", "score": "0.6212325", "text": "def update_invitations\n # user: nil is here to make sure invitations are linked only once\n invitations << Invitation.where(token: invitation_token, user: nil)\n end", "title": "" }, { "docid": "e7db4ed16e6339970ddbde244e955655", "score": "0.6204796", "text": "def update\n respond_to do |format|\n if @organization.update_attributes( params[:organization],\n :as => ( permitted_to?( :admin, @organization ) ? :admin : :default ) )\n flash[:notice] = 'Organization was successfully updated.'\n format.html { redirect_to(@organization) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @organization.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3de33020a46f83a7045cbfc3392cd2b3", "score": "0.61993134", "text": "def destroy\n @panel_organization_invitation = Panel::OrganizationInvitation.find(params[:id])\n @panel_organization_invitation.destroy\n\n respond_to do |format|\n format.html { redirect_to(panel_organization_invitations_url) }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "d432a5bbb98390a0711ca9cf4cd07648", "score": "0.6192119", "text": "def update\n @invitation = Invitation.with_token!(params[:id])\n\n authorize! @invitation\n\n @invitation.update_attributes(invitation_params)\n\n head 204\n end", "title": "" }, { "docid": "c0743ecadfb56303657c6b2c7a4836ed", "score": "0.61755306", "text": "def show\n @panel_organization_invitation = Panel::OrganizationInvitation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @panel_organization_invitation }\n end\n end", "title": "" }, { "docid": "d511d8caba16dfe37d9b30152aec77bc", "score": "0.6165757", "text": "def update\n respond_to do |format|\n if @admins_organization.update(admins_organization_params)\n format.html { redirect_to @admins_organization, notice: 'Organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @admins_organization }\n else\n format.html { render :edit }\n format.json { render json: @admins_organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c7135cd7b81f7d446b9e77c899ae1dfc", "score": "0.61571515", "text": "def update\n @organization_person = OrganizationPerson.find(params[:id])\n\n if @organization_person.update(organization_person_params)\n render json: @organization_person\n else\n render json: @organization_person.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "9b9dac6d8b591c7690261aaf7cd791af", "score": "0.61505896", "text": "def update!(**args)\n @invitations = args[:invitations] if args.key?(:invitations)\n end", "title": "" }, { "docid": "c43b4589cb5bebec60255542429d377b", "score": "0.61462796", "text": "def update\n @external_organization = ExternalOrganization.find(params[:id])\n\n respond_to do |format|\n if @external_organization.update_attributes(params[:external_organization])\n format.html { redirect_to @external_organization, notice: 'External organization was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @external_organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0444542b99ac3e325ea2c8f80cf7b99d", "score": "0.6144734", "text": "def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n format.html { redirect_to @invitation, :notice => 'Invitation was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @invitation.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "431641ca98bd4e4138d0e74176387658", "score": "0.61445785", "text": "def update\n respond_to do |format|\n if @org.update(org_params)\n format.html do\n redirect_to @org, notice: 'Org was successfully updated.'\n end\n format.json { render :show, status: :ok, location: @org }\n else\n format.html { render :edit }\n format.json { render json: @org.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a01fe4c372347c51fcff2eeb8d876480", "score": "0.6139643", "text": "def update\n respond_to do |format|\n if @people_organization.update(people_organization_params)\n format.html { redirect_to @people_organization, notice: 'People organization was successfully updated.' }\n format.json { render :show, status: :ok, location: @people_organization }\n else\n format.html { render :edit }\n format.json { render json: @people_organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e9923b6596d48cf41a31fe30a9ea6c30", "score": "0.6134984", "text": "def update\n respond_to do |format|\n if @clients_organization.update(clients_organization_params)\n format.json { render :show, status: :ok, location: @clients_organization }\n else\n format.json { render json: @clients_organization.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d84907e2a147c9159adf51f36a02a946", "score": "0.6129139", "text": "def update\n @organization = Organization.find(params[:id])\n\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n flash[:notice] = 'Organization was successfully updated.'\n #format.html { redirect_to(@organization) }\n format.html { redirect_to :controller => 'organizations', :action => 'show' , :organization=> @organization.site_name }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @organization.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "779fe4c863811de73b802661d605b0c2", "score": "0.61117285", "text": "def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n format.html { redirect_to @invitation, flash: { success: 'Invitation was successfully updated.' } }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d39a950b27f9de3a91e03dc513da4a47", "score": "0.6110598", "text": "def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n format.html { redirect_to @invitation, notice: 'Invitation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d39a950b27f9de3a91e03dc513da4a47", "score": "0.6110598", "text": "def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n format.html { redirect_to @invitation, notice: 'Invitation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d39a950b27f9de3a91e03dc513da4a47", "score": "0.6110598", "text": "def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n format.html { redirect_to @invitation, notice: 'Invitation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "de3cf222b22b097f6437f1e06e91c07a", "score": "0.60936093", "text": "def update\n @organization = Organization.find(params[:id])\n params[:organization][:admin_email_to_add] = params[:organization_admin_email_to_add] if params[:organization]\n return false unless user_can_edit? @organization\n if @organization.update_attributes_with_admin(params[:organization])\n redirect_to @organization, notice: 'Organization was successfully updated.'\n else\n render action: \"edit\"\n end\n end", "title": "" }, { "docid": "97a07937cf4e572c57d8211207c91fd8", "score": "0.6082365", "text": "def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(invitation_params)\n format.html { redirect_to @invitation, notice: 'Invitation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "795a78d7b0f8450534537db420d570bf", "score": "0.6082044", "text": "def update\n @issuing_institution = IssuingInstitution.find(params[:id])\n\n respond_to do |format|\n if @issuing_institution.update_attributes(params[:issuing_institution])\n format.html { redirect_to @issuing_institution, :notice => 'Orgão Emissor atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @issuing_institution.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c6935b9c0a8ea3b714bc031008ecf12b", "score": "0.607954", "text": "def create\n @panel_organization_invitation = Panel::OrganizationInvitation.new(params[:panel_organization_invitation])\n\n respond_to do |format|\n if @panel_organization_invitation.save\n format.html { redirect_to(@panel_organization_invitation, :notice => 'Organization invitation was successfully created.') }\n format.json { render :json => @panel_organization_invitation, :status => :created, :location => @panel_organization_invitation }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @panel_organization_invitation.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "235bc01d63ed2970fc994cbe1cd5ba31", "score": "0.60756683", "text": "def update\n begin\n @collection = Collection.find(params[:id])\n if params[:collection][:invite_only] && params[:invitations]\n @collection.invited_user_ids = params[:invitations][:user_ids] \n end\n @collection.assign_attributes(params[:collection])\n\n @collection.transaction do\n @collection.save!\n end\n\n render \"show\", handlers: [:rabl]\n \n rescue ActiveRecord::RecordInvalid => invalid\n render :json => @collection.errors.full_messages, status: 422\n end\n end", "title": "" }, { "docid": "ba1ff29e03c9571d24c3c49c1d6a7794", "score": "0.6044671", "text": "def index\n @pending_invitations = @organization.invitations.pending\n @declined_invitations = @organization.invitations.declined\n @contributors = @organization.contributors\n @invitation = Invitation.new(organization: @organization)\n\n authorize! @invitation\n end", "title": "" }, { "docid": "f3aa42826cc4ad45a918b12a2c1a69fd", "score": "0.603635", "text": "def set_invitation\n @invitation = CollaborationInvitation.find(params[:id])\n end", "title": "" }, { "docid": "634a1acd696a76d6cb7b094ac1d4e555", "score": "0.60359097", "text": "def update\n @invoice = current_organization.invoices.find(params[:id])\n \n if @invoice.update_attributes(params[:invoice])\n add_success 'Invoice was successfully updated.'\n redirect_to(@invoice)\n else\n render :edit\n end\n end", "title": "" }, { "docid": "03c0d3fe4c1420f42f9ed875634938b9", "score": "0.6030779", "text": "def index\n @invitations = Invitation.where(organization_id: current_user.organization_id).all\n end", "title": "" }, { "docid": "16e61000b6ca2bbcf35281b8749d222f", "score": "0.60214317", "text": "def update\n if @organization.update_attributes(organization_params)\n flash[:notice] = 'Organization updated!'\n # tells certain role (in common_actions) that an org (currently vendor)\n # is updated\n CommonActions.notification_process('Organization', @organization)\n end\n respond_with(@organization)\n end", "title": "" }, { "docid": "9d85e00611883bc1a9b5eb00fb5387db", "score": "0.6008454", "text": "def update\n respond_to do |format|\n if @invitation.update(invitation_params)\n format.html { redirect_to @invitation}\n format.json { render :show, status: :ok, location: @invitation }\n else\n format.html { render :edit }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e54f54d30c5adb3756dcd12805522b7", "score": "0.60069984", "text": "def update\n respond_to do |format|\n if @invitation.update(invitation_params)\n format.html { redirect_to @invitation, notice: 'Invitation was successfully updated.' }\n format.json { render :show, status: :ok, location: @invitation }\n else\n format.html { render :edit }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e54f54d30c5adb3756dcd12805522b7", "score": "0.60069984", "text": "def update\n respond_to do |format|\n if @invitation.update(invitation_params)\n format.html { redirect_to @invitation, notice: 'Invitation was successfully updated.' }\n format.json { render :show, status: :ok, location: @invitation }\n else\n format.html { render :edit }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e54f54d30c5adb3756dcd12805522b7", "score": "0.60069984", "text": "def update\n respond_to do |format|\n if @invitation.update(invitation_params)\n format.html { redirect_to @invitation, notice: 'Invitation was successfully updated.' }\n format.json { render :show, status: :ok, location: @invitation }\n else\n format.html { render :edit }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e54f54d30c5adb3756dcd12805522b7", "score": "0.60069984", "text": "def update\n respond_to do |format|\n if @invitation.update(invitation_params)\n format.html { redirect_to @invitation, notice: 'Invitation was successfully updated.' }\n format.json { render :show, status: :ok, location: @invitation }\n else\n format.html { render :edit }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e54f54d30c5adb3756dcd12805522b7", "score": "0.60069984", "text": "def update\n respond_to do |format|\n if @invitation.update(invitation_params)\n format.html { redirect_to @invitation, notice: 'Invitation was successfully updated.' }\n format.json { render :show, status: :ok, location: @invitation }\n else\n format.html { render :edit }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ee3e0c83ae383a9544005cbe48d66d3d", "score": "0.6006947", "text": "def update\n respond_to do |format|\n if @organization.update_attributes(params[:organization])\n flash[:notice] = VALIDATION_MESSAGE[\"ORGANIZATION\"][\"UPDATE\"] rescue nil\n format.html { redirect_to admin_organization_path(@organization.id) }\n else\n flash[:error] = @organization.errors.full_messages.join(\", \")\n format.html { render :action => \"edit\",:id => @organization.id }\n end\n end\n end", "title": "" }, { "docid": "d0e07da49af88fa694addf1f4d842675", "score": "0.59928924", "text": "def set_organization\n @organization = Organization.find(params[:id])\n end", "title": "" }, { "docid": "d0e07da49af88fa694addf1f4d842675", "score": "0.59928924", "text": "def set_organization\n @organization = Organization.find(params[:id])\n end", "title": "" }, { "docid": "d0e07da49af88fa694addf1f4d842675", "score": "0.59928924", "text": "def set_organization\n @organization = Organization.find(params[:id])\n end", "title": "" }, { "docid": "d0e07da49af88fa694addf1f4d842675", "score": "0.59928924", "text": "def set_organization\n @organization = Organization.find(params[:id])\n end", "title": "" }, { "docid": "34d0333b00b1c9bb00c26bb5bfc4e335", "score": "0.59899896", "text": "def update\n @organization_profile = OrganizationProfile.find(params[:id])\n\n respond_to do |format|\n if @organization_profile.update_attributes(params[:organization_profile])\n format.html { redirect_to @organization_profile, notice: 'Organization profile was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @organization_profile.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "439448a5c58e0368d8667010493d3dd2", "score": "0.5984767", "text": "def update\n respond_to do |format|\n if @invitation.update(invitation_params)\n format.html { redirect_to @invitation, notice: 'Invitation was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @invitation.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8d44b3cc45b3754957ec19fe2bc5c4f", "score": "0.5970723", "text": "def set_organization\n # @org = Organization.find(params[:id])\n end", "title": "" }, { "docid": "7e584e6bd78f55f53fc99df07c89d104", "score": "0.5959437", "text": "def update\n if !current_user.admin?\n head :forbidden\n else\n if @organisation.update(organisation_params)\n render json: @organisation.to_json, status: :ok\n else\n render json: @organisation.errors, status: :unprocessable_entity\n end\n end\n end", "title": "" }, { "docid": "8dabd09eb34768b1332948e7b5d4d347", "score": "0.59546906", "text": "def new\n @panel_organization_invitation = Panel::OrganizationInvitation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @panel_organization_invitation }\n end\n end", "title": "" }, { "docid": "2ae269b5589acbd80216ae473db94fe4", "score": "0.592839", "text": "def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n format.html { redirect_to(@invitation, :notice => 'Invitation was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invitation.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "52abaf2d98c9cd4ad43a43190799f529", "score": "0.5918962", "text": "def update\n @invitation = @event.invitations.find(params[:id])\n if @invitation.key != params[:invitation][:key]\n redirect_to friendly_page_url(@page)\n return\n end\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n format.html { redirect_to(\n friendly_page_url(@page, :invitation_key => @invitation.key),\n :notice => 'Invitation was successfully updated.') }\n format.xml { head :ok }\n format.js\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invitation.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "93c1aa50b32dddb54ff10a3de7c99662", "score": "0.5915697", "text": "def update\n respond_to do |format|\n if @sourcing_org.update(sourcing_org_params)\n format.html { redirect_to @sourcing_org, notice: 'Sourcing org was successfully updated.' }\n format.json { render :show, status: :ok, location: @sourcing_org }\n else\n format.html { render :edit }\n format.json { render json: @sourcing_org.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d1c7cab22d315fee3a1e0a294023064", "score": "0.5905794", "text": "def update\n @invitation = Invitation.find(params[:id])\n \n if (params[:invitation_type] == '0')\n flash[:notice] = \"Invitation created (not emailed out): #{$SERVER_URL}/intro/#{@invitation.token}\"\n else\n Emailer.deliver_invitation(@invitation, nil, intro_invitation_url(@invitation.token), params[:invitation_type])\n flash[:notice] = \"Invitation sent to #{@invitation.recipient_email}\"\n end\n respond_to do |format|\n format.html { redirect_to invitations_url }\n format.js {}\n end\n end", "title": "" }, { "docid": "7cc13c41dcc0117cfe01564f44cf0f46", "score": "0.58946705", "text": "def update\n @organization_member = OrganizationMember.find(params[:id])\n\n respond_to do |format|\n if @organization_member.update_attributes(params[:organization_member])\n format.html { redirect_to(@organization_member, :notice => 'Organization member was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @organization_member.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "53e5dba5440bfd3e3b16501377e504da", "score": "0.58932245", "text": "def update\n @invitation = Invitation.find(params[:id])\n\n respond_to do |format|\n if @invitation.update_attributes(params[:invitation])\n flash[:notice] = 'Invitation was successfully updated.'\n format.html { redirect_to invitation_url(@invitation) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @invitation.errors.to_xml }\n end\n end\n end", "title": "" }, { "docid": "637a51191e5b5438e070dd7a857b7e1a", "score": "0.58827615", "text": "def set_organization\n @organization = Organization.find(params[:id])\n end", "title": "" }, { "docid": "637a51191e5b5438e070dd7a857b7e1a", "score": "0.58827615", "text": "def set_organization\n @organization = Organization.find(params[:id])\n end", "title": "" }, { "docid": "637a51191e5b5438e070dd7a857b7e1a", "score": "0.58827615", "text": "def set_organization\n @organization = Organization.find(params[:id])\n end", "title": "" }, { "docid": "637a51191e5b5438e070dd7a857b7e1a", "score": "0.58827615", "text": "def set_organization\n @organization = Organization.find(params[:id])\n end", "title": "" }, { "docid": "637a51191e5b5438e070dd7a857b7e1a", "score": "0.58827615", "text": "def set_organization\n @organization = Organization.find(params[:id])\n end", "title": "" }, { "docid": "637a51191e5b5438e070dd7a857b7e1a", "score": "0.58827615", "text": "def set_organization\n @organization = Organization.find(params[:id])\n end", "title": "" }, { "docid": "637a51191e5b5438e070dd7a857b7e1a", "score": "0.58827615", "text": "def set_organization\n @organization = Organization.find(params[:id])\n end", "title": "" }, { "docid": "637a51191e5b5438e070dd7a857b7e1a", "score": "0.58827615", "text": "def set_organization\n @organization = Organization.find(params[:id])\n end", "title": "" }, { "docid": "637a51191e5b5438e070dd7a857b7e1a", "score": "0.58827615", "text": "def set_organization\n @organization = Organization.find(params[:id])\n end", "title": "" }, { "docid": "637a51191e5b5438e070dd7a857b7e1a", "score": "0.58827615", "text": "def set_organization\n @organization = Organization.find(params[:id])\n end", "title": "" } ]
dfb5c21b1741eabeafd8715ca8cf3040
The brand and model number of the camera that took the photo.
[ { "docid": "dcc1d6ca57b65cb382b931206607d719", "score": "0.7301788", "text": "def camera_model\n object[\"camera_model\"]\n end", "title": "" } ]
[ { "docid": "282c22dfaa8ff6664685658a4245119c", "score": "0.76330024", "text": "def brand_with_model\n fetch('camera.brand_with_model')\n end", "title": "" }, { "docid": "e6835a9f39b99d0b9b95e89cf708f6cd", "score": "0.72515863", "text": "def camera_make\n object[\"camera_make\"]\n end", "title": "" }, { "docid": "7067945fbed1f74e19a3f2688f085b12", "score": "0.6961647", "text": "def camera_model\n ExifTags::camera_model(self.exif)\n end", "title": "" }, { "docid": "991a44cf5ada3c7c2808f0659204678c", "score": "0.67895037", "text": "def camera_model_count_hash\n hash = Hash.new(0)\n self.each do |photo|\n model = photo.version(1).attributes['exifProperties']['Model']\n hash[model] += 1\n end\n\n return hash\n end", "title": "" }, { "docid": "3493f980106e24041a938f6fb6149742", "score": "0.6781766", "text": "def model\n fetch('camera.model')\n end", "title": "" }, { "docid": "9a39af5150db56f3a5836ecdf5514d25", "score": "0.675208", "text": "def camera_model\n return @camera_model\n end", "title": "" }, { "docid": "061610b39315bc63d6fcfe0238fa79b9", "score": "0.6643898", "text": "def camera_make\n return @camera_make\n end", "title": "" }, { "docid": "3dccda0df6010df8b661be1021c03452", "score": "0.66096884", "text": "def camera_model=(value)\n @camera_model = value\n end", "title": "" }, { "docid": "2c8662300231ed774f640eeef58665ee", "score": "0.64953345", "text": "def get_profile_info_brand(m)\n\t\tsize = CompanySize.find(m.company_size).name\n\t\tsectors = Sector.find(m.sector_ids)\n\t\tchannels = Channel.find(m.channel_ids)\n\t\treturn size, sectors, channels\n\tend", "title": "" }, { "docid": "2303e13dbe36c92a02915524c5cb4acb", "score": "0.6419957", "text": "def get_camera\n @camera\n end", "title": "" }, { "docid": "9cb00d95253d9388eca5ad3a2064fe46", "score": "0.6339854", "text": "def camera\n BubbleWrap::Device::CameraWrapper\n end", "title": "" }, { "docid": "842bbd6c8cd118d74ae482d0c4bc13b9", "score": "0.632113", "text": "def camera_params\n params.require(:camera).permit(:brand, :model, :description, :title, :color, :condition, :price, :image)\n end", "title": "" }, { "docid": "ac00d59d49e80b27242bc48bcd1e5dea", "score": "0.629864", "text": "def camera_make=(value)\n @camera_make = value\n end", "title": "" }, { "docid": "22d1b2229a8b1036b0440571a1f86207", "score": "0.6264148", "text": "def get_camera\n return @camera\n end", "title": "" }, { "docid": "c951b5077ff076e4d80fdb5e495da7ca", "score": "0.60872203", "text": "def lens_model_count_hash\n hash = Hash.new(0)\n self.each do |photo|\n model = photo.version(1).attributes['exifProperties']['LensModel']\n hash[model] += 1\n end\n\n return hash\n end", "title": "" }, { "docid": "b946a6aafbf8469ab29c3a1ba0bbdbd3", "score": "0.6021267", "text": "def device_brand\n ActiveDevice::Brand.mobile_brand request.user_agent\n end", "title": "" }, { "docid": "970757e23861e527cf74a4b161305132", "score": "0.5987363", "text": "def brand\n if !defined?(@brand) || empty?(@brand)\n self.class.brand?(number)\n else\n @brand\n end\n end", "title": "" }, { "docid": "0172f89a49fecdb01a40ccae4a7ba7cf", "score": "0.5985948", "text": "def model_id\n Model.get_id_for_name(@work_xml.xpath(\"exif/model\").text)\n end", "title": "" }, { "docid": "4ea4f69ff2dc49d9b236a55a1e83ce4c", "score": "0.5979512", "text": "def manufacturer_model\n get_prop('ro.product.model')\n end", "title": "" }, { "docid": "c85980e3e112941d3283da8c7eb8f970", "score": "0.59570545", "text": "def get_caminfo\n xml = get('/get_caminfo')\n return xml if xml.eql? 'Olympia: NET ERROR'\n\n begin\n doc = REXML::Document.new xml\n return doc.root.elements['model'].text\n rescue\n return 'Olympia: XML ERROR'\n end\n end", "title": "" }, { "docid": "cc08311ecec1000c2cb6b020aae22e77", "score": "0.59567636", "text": "def device_model\n ActiveDevice::Model.brand_model request.user_agent\n end", "title": "" }, { "docid": "30d9511390b897eccdda051395edda5b", "score": "0.5896671", "text": "def camera_params\n params.require(:camera).permit(:description, :deviceid, :model, :nickname, :user_id, :app_version)\n end", "title": "" }, { "docid": "c23239542cb380841523f7734dfb3b22", "score": "0.58854604", "text": "def brand_name\n car.try(:brand_name) || ant_queen_record_hub.try(:car_brand)\n end", "title": "" }, { "docid": "fee4f7ca050f7fe1aa82096f40900a9c", "score": "0.58327615", "text": "def capture_device\n val = %w[Make Model LensModel].map { |tag| fetch_metadata tag }\n .compact.join ', '\n val = val[0..127] unless val.size <= 128\n val\n end", "title": "" }, { "docid": "8bbc3f80e9a347dac0bae751a564945e", "score": "0.58293146", "text": "def brand\n cc_type\n end", "title": "" }, { "docid": "8bbc3f80e9a347dac0bae751a564945e", "score": "0.58293146", "text": "def brand\n cc_type\n end", "title": "" }, { "docid": "8bbc3f80e9a347dac0bae751a564945e", "score": "0.58293146", "text": "def brand\n cc_type\n end", "title": "" }, { "docid": "a7da6e23decb1b04e150e89dda55d256", "score": "0.5826458", "text": "def model_information\n processor_type = [\n \t\t\"Original OEM Processor\",\n \t\t\"Intel OverDrive\",\n \t\t\"Dual Processor\"\n \t]\n\n \t{:family => family, :model => model, :type => type, :step => stepping, :model_string => processor_type[type]}\n \tend", "title": "" }, { "docid": "9f02356cc0894551e8af9874a21b5c1e", "score": "0.5814187", "text": "def brand_name\n \tobject.brand.name\n end", "title": "" }, { "docid": "8150ae73f85046f04d0f7bec834b9171", "score": "0.58107245", "text": "def brand\n return @brand\n end", "title": "" }, { "docid": "6c16d22b4158249f9e1151ff12b13bb9", "score": "0.5779351", "text": "def model \n ext_model = ((signature >> 16) & 0xf) \n (ext_model << 4) | ((signature >> 3) & 0xf)\n end", "title": "" }, { "docid": "6c5ec40d455c9e333635784cb6b4fe93", "score": "0.5649406", "text": "def brand\n @brand = self.try(:vehicle_model).try(:vehicle_brand).try(:id) if self\n end", "title": "" }, { "docid": "b273313ec2714d0eb7b500b12bc2bbb3", "score": "0.56440926", "text": "def card_brand\n return nil unless card.present?\n\n {\n amex: 'American Express',\n diners: 'Diners Club',\n discover: 'Discover',\n jcb: 'JCB',\n mastercard: 'MasterCard',\n unionpay: 'UnionPay',\n visa: 'Visa',\n unknown: 'Unknown'\n }[card[:brand].to_sym]\n end", "title": "" }, { "docid": "6e1317135999fcc849830c8fed92dd7e", "score": "0.56409156", "text": "def camera_params\n params.fetch(:camera, {})\n end", "title": "" }, { "docid": "04369553c2b211e252cbb4dc4feeac44", "score": "0.5632789", "text": "def set_camera_model\n @camera_model = CameraModel.find(params[:id])\n end", "title": "" }, { "docid": "5b50ce0bed1af2710347198ec6a30473", "score": "0.56173706", "text": "def camera\n end", "title": "" }, { "docid": "5b50ce0bed1af2710347198ec6a30473", "score": "0.56173706", "text": "def camera\n end", "title": "" }, { "docid": "dfb8a3bb1317944c68f151d388ed19d8", "score": "0.5614402", "text": "def camera\n sql = \"SELECT * FROM cameras WHERE id = #{@camera_id};\"\n return Camera.map_item(sql)\n end", "title": "" }, { "docid": "e8924abd8b5846d9002df04aac6e14f3", "score": "0.5569059", "text": "def camera_params\n params.require(:camera).permit(:manufactor, :model, :owner, :name)\n end", "title": "" }, { "docid": "695389a7c791767d8246984f28353fef", "score": "0.55631584", "text": "def show\n @merk_camera = MerkCamera.friendly.find(params[:id])\n end", "title": "" }, { "docid": "2fd3e20af0d21f654b8e56c9dc661788", "score": "0.55595624", "text": "def name\n \"#{self.year} #{self.brand} #{self.model}\"\n end", "title": "" }, { "docid": "b77ffb5f4f8ab2bc666953e0449a0dbd", "score": "0.5537365", "text": "def car_info\n p \"#{@modelyear} #{@make}\"\n end", "title": "" }, { "docid": "33c7128b3ca032893a50df7f67862717", "score": "0.55105317", "text": "def intune_brand\n return @intune_brand\n end", "title": "" }, { "docid": "79803c1a29b6c68e7836d77bec9e503b", "score": "0.54807246", "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": "1519964bd4565b16d8409f57693e6920", "score": "0.5466284", "text": "def capture_device_name\n return @capture_device_name\n end", "title": "" }, { "docid": "ddfe4c0ead32d315ca81411527f6418b", "score": "0.5459837", "text": "def info\r\n output = Image.run_command(\"identify #{@filename}\")\r\n info_array = output.split \r\n return({\r\n :format => info_array[1].downcase.to_sym,\r\n :width => info_array[2].match(/^\\d+/)[0].to_i,\r\n :height => info_array[2].match(/\\d+$/)[0].to_i \r\n })\r\n \r\n end", "title": "" }, { "docid": "f7c58d68ba004b328ec8b9b2b1e58458", "score": "0.54404056", "text": "def get_camera_params\n\t\t\tresponse = @connection.get('get_camera_params.cgi')\n\t\t\tparams = response.success? ? parse_response(response) : {}\n\t\t\tparams.empty? ? nil : ::Foscam::Model::Camera.new(params)\n\t\tend", "title": "" }, { "docid": "6e66bf8be5f9b79a9fa71df8fb89fe6f", "score": "0.5437584", "text": "def capture_device\n ng_xml.css(\"fits > metadata > image > captureDevice\").map(&:text)\n end", "title": "" }, { "docid": "e7eb5d5864c9891c903d3c90dc521bde", "score": "0.5424195", "text": "def camera_params\n params.require(:camera).permit(:name, :ip_address, :cam_type, :lense, :config, :other_info)\n end", "title": "" }, { "docid": "ca3a05ea0d6db01a0b76eff192ca01e9", "score": "0.54230607", "text": "def get_info\n puts \"The #{model} bike has #{wheels} wheels and a #{frame_size} frame.\"\n end", "title": "" }, { "docid": "422973b4854b19e2fbdd49147cb9c713", "score": "0.5421833", "text": "def camera_present\n\n UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceTypeCamera)\n\n end", "title": "" }, { "docid": "1c215d07707b8ea93155ed252ef2ca25", "score": "0.5420813", "text": "def manufacturer_name; manufacname; end", "title": "" }, { "docid": "28abe3b274b9c4de375e81019fc1a404", "score": "0.54177415", "text": "def camera_present\n UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceTypeCamera)\n end", "title": "" }, { "docid": "28abe3b274b9c4de375e81019fc1a404", "score": "0.54177415", "text": "def camera_present\n UIImagePickerController.isSourceTypeAvailable(UIImagePickerControllerSourceTypeCamera)\n end", "title": "" }, { "docid": "9fb82f114e10bbb603532f587002c093", "score": "0.54112583", "text": "def get_info\n puts \"The #{@model} bike has #{@wheels} wheels and a #{@frame_size} frame\"\n end", "title": "" }, { "docid": "097048a52f404b5026fc20c121e225a8", "score": "0.5397665", "text": "def info\n \"The bike model is: #{@model}, it has #{@wheels} and the frame is #{@frame_size}cm\"\n end", "title": "" }, { "docid": "c3c60524a87eb7f4b7c707578254ae2a", "score": "0.5394486", "text": "def render_camera_models\n model_names.map do |model|\n make = make_for_model(model)\n @title = build_title(\"Camera make #{make}, and model #{model}\")\n @thumbnails = works_with_make_and_model(make, model)\n @navigation = [make]\n {html: render(:model), filename: slug(model)}\n end\n end", "title": "" }, { "docid": "6ba6f41be0a4c6bfa91c3840908f75ba", "score": "0.5390106", "text": "def brand\n fetch('commerce.brand')\n end", "title": "" }, { "docid": "64d29ca7d81e84c9a7c2f23b7e3aa1a6", "score": "0.538797", "text": "def get_car_model\n car ? car.model : 'N/A'\n end", "title": "" }, { "docid": "87c9a6a618477dedb29af586a99b438c", "score": "0.53858465", "text": "def image_name() ; info[:image_name] ; end", "title": "" }, { "docid": "87c9a6a618477dedb29af586a99b438c", "score": "0.53858465", "text": "def image_name() ; info[:image_name] ; end", "title": "" }, { "docid": "d87d493bb053eb1c34cf85958ff8ce0c", "score": "0.5373337", "text": "def car_name\n\t\t\"#{self.car_maker.name} #{self.car_model.name}\"\n\tend", "title": "" }, { "docid": "21170e932f90330532e2ac6772f49cdc", "score": "0.5372827", "text": "def get_all\n @config['camera']\n end", "title": "" }, { "docid": "33dd2ee4279c910e7dcd58756145626f", "score": "0.5364666", "text": "def determine_capture_device\n # User given capture device or format\n # @see https://www.ffmpeg.org/ffmpeg.html#Main-options\n return advanced[:f] if advanced[:f]\n return advanced[:fmt] if advanced[:fmt]\n\n if OS.windows?\n 'gdigrab'\n elsif OS.linux?\n 'x11grab'\n elsif OS.mac?\n 'avfoundation'\n else\n raise NotImplementedError, 'Your OS is not supported.'\n end\n end", "title": "" }, { "docid": "11a28a56baff11481fd4433f04a9a192", "score": "0.53582084", "text": "def manufacturer\n @hash[\"manufacturer\"]\n end", "title": "" }, { "docid": "11a28a56baff11481fd4433f04a9a192", "score": "0.53582084", "text": "def manufacturer\n @hash[\"manufacturer\"]\n end", "title": "" }, { "docid": "dd936c1e79db2f81b0c461bb68b9587e", "score": "0.5343117", "text": "def make_id\n Make.get_id_for_name(@work_xml.xpath(\"exif/make\").text)\n end", "title": "" }, { "docid": "3720c6a2c25f6fe2eb6ac8264589e2ba", "score": "0.5342364", "text": "def brand\n Rails.application.config.brand\n end", "title": "" }, { "docid": "3720c6a2c25f6fe2eb6ac8264589e2ba", "score": "0.5342364", "text": "def brand\n Rails.application.config.brand\n end", "title": "" }, { "docid": "6971b4e454710075560d4fa48e049a8a", "score": "0.53419244", "text": "def image_reference\n return nil unless is_light_stemcell?\n\n {\n 'publisher' => @image['publisher'],\n 'offer' => @image['offer'],\n 'sku' => @image['sku'],\n 'version' => @image['version']\n }\n end", "title": "" }, { "docid": "8a77db79150555c25714c0818387dde2", "score": "0.53418815", "text": "def get_info\n \"The #{@model} bike has #{@wheels} wheels and a #{@frame} frame.\"\n end", "title": "" }, { "docid": "65c5451667c85892e7abe928e2f9f926", "score": "0.53400284", "text": "def brand_and_color\n # \"Nike - lime green\"\n \"#{self.brand.try(:name)} - #{self.color}\"\n end", "title": "" }, { "docid": "ee2c93685e44010bb7f00bd6f8d6d08e", "score": "0.5332973", "text": "def brand_id_and_colors\n \"#{self.brand_id.try(:name)} - #{self.color} \" \n\n end", "title": "" }, { "docid": "fbcdf7861d9c256a3c98e562f9d47f8d", "score": "0.53315765", "text": "def get_info\n p \"The #{@model} bike has #{@wheels} wheels and a #{@frame_size} cm frame.\"\n end", "title": "" }, { "docid": "6f3f1d06449a61addb546875640b1ecc", "score": "0.53282356", "text": "def is_brand? brand\n ActiveDevice::Handset.is_brand? request.user_agent, brand\n end", "title": "" }, { "docid": "5e9d3a317d3a86e64a9834b671f801e4", "score": "0.5327387", "text": "def brand_code\n self.dig_for_string(\"officeSummary\", \"brandCode\")\n end", "title": "" }, { "docid": "6b8b63ccb53c97a6d7f60e50100ed226", "score": "0.53266746", "text": "def format_for_save\n model.upcase! unless model.nil?\n brand.capitalize! unless brand.nil?\n screen_resolution.downcase! unless screen_resolution.nil?\n self.screen_size = screen_size.round(2) unless screen_size.nil?\n self.camera = camera.round(2) unless camera.nil?\n self.sd_memory_card = sd_memory_card.round(2) unless sd_memory_card.nil?\n end", "title": "" }, { "docid": "eb30d6f83b5d02b97fcb57ef1a2c1d9b", "score": "0.5322836", "text": "def show\n @camera_brand = CameraBrand.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @camera_brand }\n end\n end", "title": "" }, { "docid": "acf1cf49b8801062eb4060485f3cfa66", "score": "0.5319752", "text": "def set_merk_camera\n @merk_camera = MerkCamera.friendly.find(params[:id])\n end", "title": "" }, { "docid": "2ac50dc50a8e6b8dbcf559a8d0906fa9", "score": "0.5314033", "text": "def preview\n @camera.preview\n end", "title": "" }, { "docid": "33e39187eadcc6ad87ea33c280bcede5", "score": "0.5310105", "text": "def image_reference\n return nil unless is_light_stemcell?\n {\n 'publisher' => @image['publisher'],\n 'offer' => @image['offer'],\n 'sku' => @image['sku'],\n 'version' => @image['version']\n }\n end", "title": "" }, { "docid": "1cfdda9f3ebf493dfe02d7be7d967751", "score": "0.5281687", "text": "def camera_params\n params.require(:camera).permit(:name, :camera_id, :description, :verified, :vms_id)\n end", "title": "" }, { "docid": "1ccfa6f572ce1864ad115d5654ca2de2", "score": "0.52781755", "text": "def display_name\n \"#{self.brand} ****#{self.last4}\"\n end", "title": "" }, { "docid": "7b89c45fc4f6864203d760a6a50b2bf0", "score": "0.52743936", "text": "def getModelNumber ()\n return readValue(\"rPDUIdentModelNumber.0\")\n end", "title": "" }, { "docid": "c4f0ae1aae6d3a748527cbeca3ebdb18", "score": "0.5269268", "text": "def device_model; property(@device.PROP_DEVICE_MODEL) end", "title": "" }, { "docid": "3ee80ee7645d287d5d3d5a5954afea6c", "score": "0.5262931", "text": "def default_brand\n Rails.application.class.module_parent_name\n end", "title": "" }, { "docid": "2163302640e7997d03c8d670b5b82b50", "score": "0.5260681", "text": "def camera_available?\n UIImagePickerController.isSourceTypeAvailable UIImagePickerControllerSourceTypeCamera \n end", "title": "" }, { "docid": "4bfc9d688e1b41163dd90e3c60f73769", "score": "0.5259385", "text": "def set_camera\n @camera = Camera.find(params[:id])\n end", "title": "" }, { "docid": "4bfc9d688e1b41163dd90e3c60f73769", "score": "0.5259385", "text": "def set_camera\n @camera = Camera.find(params[:id])\n end", "title": "" }, { "docid": "4bfc9d688e1b41163dd90e3c60f73769", "score": "0.5259385", "text": "def set_camera\n @camera = Camera.find(params[:id])\n end", "title": "" }, { "docid": "4bfc9d688e1b41163dd90e3c60f73769", "score": "0.5259385", "text": "def set_camera\n @camera = Camera.find(params[:id])\n end", "title": "" }, { "docid": "4bfc9d688e1b41163dd90e3c60f73769", "score": "0.5259385", "text": "def set_camera\n @camera = Camera.find(params[:id])\n end", "title": "" }, { "docid": "4bfc9d688e1b41163dd90e3c60f73769", "score": "0.5259385", "text": "def set_camera\n @camera = Camera.find(params[:id])\n end", "title": "" }, { "docid": "63b0b75a9d388e6ad52a40348c708eac", "score": "0.52557325", "text": "def update\n @camera_brand = CameraBrand.find(params[:id])\n\n respond_to do |format|\n if @camera_brand.update_attributes(params[:camera_brand])\n flash[:notice] = 'CameraBrand was successfully updated.'\n format.html { redirect_to(@camera_brand) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @camera_brand.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e0b2aa747b3905fd41e84ff7f2418f4", "score": "0.52455646", "text": "def set_camera\n @camera = Camera.find(params[:id])\n end", "title": "" }, { "docid": "f0d3d0aa3c945a238f77e6b942a74a93", "score": "0.5242448", "text": "def create\n @camera_brand = CameraBrand.new(params[:camera_brand])\n\n respond_to do |format|\n if @camera_brand.save\n flash[:notice] = 'CameraBrand was successfully created.'\n format.html { redirect_to(@camera_brand) }\n format.xml { render :xml => @camera_brand, :status => :created, :location => @camera_brand }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @camera_brand.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3d34f2edc8ae7cd454fd1ffe456bdb12", "score": "0.5240013", "text": "def face_value\n RunoCards::CARDS[internal_value]\n end", "title": "" }, { "docid": "918f39b86e1c69f9ced88055cac85972", "score": "0.52342457", "text": "def cpu_model\n info[:model]\n end", "title": "" }, { "docid": "641154d7f423b61e21861c73347e6473", "score": "0.52324665", "text": "def description\n\t\tdescription = self.brand + \" \" + self.model + \" \" + self.year.to_s\n\tend", "title": "" }, { "docid": "ca2db91acbc6337ecef6b5763e5f54ad", "score": "0.5231394", "text": "def create\n# @camera = Camera.new(camera_params)\n @camera = Camera.where(deviceid: camera_params[:deviceid]).first_or_create(camera_params)\n if (!camera_params[:app_version].nil?)\n if (@camera[:app_version] != camera_params[:app_version])\n # update the version...\n if (@camera[:app_version].nil?)\n logger.debug \"old app version: nil, new version: \" + camera_params[:app_version]\n else\n logger.debug \"old app version: \" + @camera[:app_version] + \", new version: \" + camera_params[:app_version]\n end\n @camera.update_attributes(camera_params)\n end\n end\n\n respond_to do |format|\n if @camera.save\n format.html { redirect_to @camera, notice: 'Camera was successfully created/updated.' }\n format.json { render json: @camera, status: :created, location: @camera }\n else\n format.html { render action: \"new\" }\n format.json { render json: @camera.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
e7afe295102c0ad60dc6f8d122a59074
Because is difrent scope between method and this parrameter has difrent name
[ { "docid": "e42f1fb8aa685ff827d931d838179663", "score": "0.0", "text": "def set_box\n @box = Box.friendly.find(params[:box_id])\n end", "title": "" } ]
[ { "docid": "a9c3d6a9cee3eb85d330b5e72e96f90a", "score": "0.6709706", "text": "def scope; end", "title": "" }, { "docid": "a9c3d6a9cee3eb85d330b5e72e96f90a", "score": "0.6709706", "text": "def scope; end", "title": "" }, { "docid": "a9c3d6a9cee3eb85d330b5e72e96f90a", "score": "0.6709706", "text": "def scope; end", "title": "" }, { "docid": "a9c3d6a9cee3eb85d330b5e72e96f90a", "score": "0.6709706", "text": "def scope; end", "title": "" }, { "docid": "a9c3d6a9cee3eb85d330b5e72e96f90a", "score": "0.6709706", "text": "def scope; end", "title": "" }, { "docid": "a9c3d6a9cee3eb85d330b5e72e96f90a", "score": "0.6709706", "text": "def scope; end", "title": "" }, { "docid": "a9c3d6a9cee3eb85d330b5e72e96f90a", "score": "0.6709706", "text": "def scope; end", "title": "" }, { "docid": "a9c3d6a9cee3eb85d330b5e72e96f90a", "score": "0.6709706", "text": "def scope; end", "title": "" }, { "docid": "a9c3d6a9cee3eb85d330b5e72e96f90a", "score": "0.6709706", "text": "def scope; end", "title": "" }, { "docid": "a9c3d6a9cee3eb85d330b5e72e96f90a", "score": "0.6709706", "text": "def scope; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.6652282", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.6652282", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.6652282", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.6652282", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.6652282", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.6652282", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.6652282", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.6652282", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.6652282", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.6652282", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.6652282", "text": "def method; end", "title": "" }, { "docid": "20898baa64ab5fd26066acd36fb4bbbd", "score": "0.6652282", "text": "def method; end", "title": "" }, { "docid": "a5432aadd8cc5947db0ccf866c05e0a0", "score": "0.6607856", "text": "def scope=(_); end", "title": "" }, { "docid": "117bc71cd8976d01e54c03e8a55ef09e", "score": "0.6427573", "text": "def scope=(_arg0); end", "title": "" }, { "docid": "117bc71cd8976d01e54c03e8a55ef09e", "score": "0.6427573", "text": "def scope=(_arg0); end", "title": "" }, { "docid": "117bc71cd8976d01e54c03e8a55ef09e", "score": "0.6427573", "text": "def scope=(_arg0); end", "title": "" }, { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.63992393", "text": "def private; end", "title": "" }, { "docid": "ede8516c91636f45c76174d0432c7319", "score": "0.6352615", "text": "def scope() binding end", "title": "" }, { "docid": "ccfe4044a5371ef1ee52c0eaecd344fc", "score": "0.626646", "text": "def called_from; end", "title": "" }, { "docid": "ccfe4044a5371ef1ee52c0eaecd344fc", "score": "0.626646", "text": "def called_from; end", "title": "" }, { "docid": "a265fe5e200ae985db3fc3d804b9fd77", "score": "0.6229288", "text": "def method_name; end", "title": "" }, { "docid": "a265fe5e200ae985db3fc3d804b9fd77", "score": "0.6229288", "text": "def method_name; end", "title": "" }, { "docid": "a265fe5e200ae985db3fc3d804b9fd77", "score": "0.6229288", "text": "def method_name; end", "title": "" }, { "docid": "a265fe5e200ae985db3fc3d804b9fd77", "score": "0.6229288", "text": "def method_name; end", "title": "" }, { "docid": "a265fe5e200ae985db3fc3d804b9fd77", "score": "0.6229288", "text": "def method_name; end", "title": "" }, { "docid": "a265fe5e200ae985db3fc3d804b9fd77", "score": "0.6229288", "text": "def method_name; end", "title": "" }, { "docid": "a265fe5e200ae985db3fc3d804b9fd77", "score": "0.6229288", "text": "def method_name; end", "title": "" }, { "docid": "a265fe5e200ae985db3fc3d804b9fd77", "score": "0.6229288", "text": "def method_name; end", "title": "" }, { "docid": "a265fe5e200ae985db3fc3d804b9fd77", "score": "0.6229288", "text": "def method_name; end", "title": "" }, { "docid": "a265fe5e200ae985db3fc3d804b9fd77", "score": "0.6229288", "text": "def method_name; end", "title": "" }, { "docid": "a265fe5e200ae985db3fc3d804b9fd77", "score": "0.6229288", "text": "def method_name; end", "title": "" }, { "docid": "a265fe5e200ae985db3fc3d804b9fd77", "score": "0.6229288", "text": "def method_name; end", "title": "" }, { "docid": "0a556b1952ad83e39c4a887f1f85e9bc", "score": "0.62023497", "text": "def method\n\t\t# code code\n\tend", "title": "" }, { "docid": "1583066df6622d3412e97e27d90a2159", "score": "0.62019557", "text": "def name #use and initlizer to set name as an instance variable\n @name\nend", "title": "" }, { "docid": "635968fe7f4f8d075dcc776421ca761c", "score": "0.6167779", "text": "def local_method\n :local_method\n end", "title": "" }, { "docid": "f4ad13bf5fa71b1e7bc47220336ffdbf", "score": "0.6165733", "text": "def methods() end", "title": "" }, { "docid": "f376290fa6a3566015baa254c91e42c0", "score": "0.6164104", "text": "def caller; end", "title": "" }, { "docid": "78cda9762ae33548e20f3172c31a8769", "score": "0.61509615", "text": "def method_one\n end", "title": "" }, { "docid": "78cda9762ae33548e20f3172c31a8769", "score": "0.61509615", "text": "def method_one\n end", "title": "" }, { "docid": "2cc9969eb7789e4fe75844b6f57cb6b4", "score": "0.6138061", "text": "def refutal()\n end", "title": "" }, { "docid": "530e65cba197567f73b8125444ac33cc", "score": "0.6133346", "text": "def private_method\n end", "title": "" }, { "docid": "1f91f380211b4495b828cbddf85898c3", "score": "0.61173975", "text": "def method_name=(_arg0); end", "title": "" }, { "docid": "1f91f380211b4495b828cbddf85898c3", "score": "0.61173975", "text": "def method_name=(_arg0); end", "title": "" }, { "docid": "33c34da1740946d7191350c88248bf63", "score": "0.6079795", "text": "def reload_self(scope)\n t,a = get_arg(scope,:self)\n end", "title": "" }, { "docid": "1f276d4bd1010aa611fcf76c5997e16b", "score": "0.6037434", "text": "def s1\n end", "title": "" }, { "docid": "8a391425187ceff6461e558601ca3c06", "score": "0.60326326", "text": "def method_one; end", "title": "" }, { "docid": "bbafb6243eac8aa73662abbbdfc3959e", "score": "0.602905", "text": "def name() end", "title": "" }, { "docid": "2a77a5c9a41f66fcf2e47ce6042526ef", "score": "0.6028935", "text": "def name; super; end", "title": "" }, { "docid": "2a77a5c9a41f66fcf2e47ce6042526ef", "score": "0.6028935", "text": "def name; super; end", "title": "" }, { "docid": "ae43cd0b58480edd1f9e64195f1da86c", "score": "0.6026836", "text": "def method2() end", "title": "" }, { "docid": "93c116146067f5a3d83ecf76082eaaef", "score": "0.6017755", "text": "def name=(_); end", "title": "" }, { "docid": "93c116146067f5a3d83ecf76082eaaef", "score": "0.6017755", "text": "def name=(_); end", "title": "" }, { "docid": "93c116146067f5a3d83ecf76082eaaef", "score": "0.6017755", "text": "def name=(_); end", "title": "" }, { "docid": "93c116146067f5a3d83ecf76082eaaef", "score": "0.6017755", "text": "def name=(_); end", "title": "" }, { "docid": "93c116146067f5a3d83ecf76082eaaef", "score": "0.6017755", "text": "def name=(_); end", "title": "" }, { "docid": "93c116146067f5a3d83ecf76082eaaef", "score": "0.6017755", "text": "def name=(_); end", "title": "" }, { "docid": "93c116146067f5a3d83ecf76082eaaef", "score": "0.6017755", "text": "def name=(_); end", "title": "" }, { "docid": "93c116146067f5a3d83ecf76082eaaef", "score": "0.6017755", "text": "def name=(_); end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" }, { "docid": "6e1ada2a1ca2235d1d4411d51623a583", "score": "0.60063237", "text": "def name; end", "title": "" } ]
9bf262cf8a9bcc7977ccbe1295457a56
filtro para validar q el usuario esta logado en cualquier accion del controlador de administracion
[ { "docid": "d57856989d86182f874ca68a58142ee9", "score": "0.0", "text": "def check_authentication\n unless session[:user]\n session[:intended_action] = action_name\n session[:intended_controller] = controller_name \n redirect_to :action => \"signin\"\n end\n end", "title": "" } ]
[ { "docid": "9e322c53d009596b9952dc3462a87245", "score": "0.66421837", "text": "def validarLogIn\n\n if (params[:nombreDeUsuario].present? && params[:clave].present?) \n admin=Administrator.where(nomUsuario: params[:nombreDeUsuario],password: params[:clave] )\n if admin.blank? then\n flash[:notice]=\" Email o Contraseña inválida \"\n redirect_to '/iniciarSesion'\n else \n redirect_to controller: 'administrators', action: 'sesionIniciada', id: 1 #deber ser el id del admin\n end \n end\n \n end", "title": "" }, { "docid": "62998ac3d8f5bf690febc4fe5a9cda4c", "score": "0.6541631", "text": "def control_usuario\n if current_cuentum.email == \"admin@admin.com\"\n redirect_back(fallback_location: 'welcome/index')\n return\n end\n usuarios = Usuario.all\n usuarios.each do |u|\n if cuentum_signed_in? && current_cuentum.id == u.cuenta_id\n if u.rol == \"ADMINISTRADOR\" || u.rol == \"OPERARIO\"\n redirect_to \"welcome/index\" \n end\n end\n end\n end", "title": "" }, { "docid": "26735a6048afdee859f1a7e3a7277aa3", "score": "0.64664054", "text": "def usuario_logado\n session[:usuario] != nil && session[:usuario].login_valido?\n end", "title": "" }, { "docid": "01a02292a22c2a28a5eb76b0c2d93637", "score": "0.64032006", "text": "def filtra_usuario_responsable(lista_usuarios)\n if Rails.configuration.x.cor1440_permisos_por_oficina &&\n current_usuario.oficina_id\n lista_usuarios = lista_usuarios\n .where(oficina_id: current_usuario.oficina_id)\n end\n lista_usuarios\n end", "title": "" }, { "docid": "43f0352f468871083f9f21f952b68a26", "score": "0.6283222", "text": "def control_usuario \n\t usuarios = Usuario.all\n\t usuarios.each do |u|\n\t if cuentum_signed_in? && current_cuentum.id == u.cuenta_id\n\t if u.rol == \"USUARIO\" \n\t redirect_to \"welcome/index\" \n\t end\n\t end\n\t end\n\t end", "title": "" }, { "docid": "1e7dc590e8a7972a80095aa81b78fa54", "score": "0.6273054", "text": "def verifica_se_usuario_logado_e_admin\n @usuario_logado = current_usuario\n if @usuario_logado.nome != \"admin\"\n sign_out :usuario\n redirect_to \"/usuarios/sign_in\"\n end\n end", "title": "" }, { "docid": "19b6e2a1e8994c0f510960813bbe506c", "score": "0.62614673", "text": "def validar_admin\n \n \n logger.debug \"<<<<< validar sesion en empleados #{session[:intranet].inspect}>>>>>\" \n if(session[:intranet]!=nil)\n \n @employees=session[:intranet]\n if(session[:intranet]['admin']==false)\n redirect_to intranet_path\n end\n else\n redirect_to intranet_path \n end\n \n end", "title": "" }, { "docid": "19b6e2a1e8994c0f510960813bbe506c", "score": "0.62614673", "text": "def validar_admin\n \n \n logger.debug \"<<<<< validar sesion en empleados #{session[:intranet].inspect}>>>>>\" \n if(session[:intranet]!=nil)\n \n @employees=session[:intranet]\n if(session[:intranet]['admin']==false)\n redirect_to intranet_path\n end\n else\n redirect_to intranet_path \n end\n \n end", "title": "" }, { "docid": "19b6e2a1e8994c0f510960813bbe506c", "score": "0.62614673", "text": "def validar_admin\n \n \n logger.debug \"<<<<< validar sesion en empleados #{session[:intranet].inspect}>>>>>\" \n if(session[:intranet]!=nil)\n \n @employees=session[:intranet]\n if(session[:intranet]['admin']==false)\n redirect_to intranet_path\n end\n else\n redirect_to intranet_path \n end\n \n end", "title": "" }, { "docid": "738cd13cafec5966d88a125c22c57ac6", "score": "0.62125844", "text": "def control_usuario \n usuarios = Usuario.all\n usuarios.each do |u|\n if cuentum_signed_in? && current_cuentum.id == u.cuenta_id\n if u.rol == \"USUARIO\" \n redirect_to \"welcome/index\" \n end\n end\n end\n end", "title": "" }, { "docid": "738cd13cafec5966d88a125c22c57ac6", "score": "0.62125844", "text": "def control_usuario \n usuarios = Usuario.all\n usuarios.each do |u|\n if cuentum_signed_in? && current_cuentum.id == u.cuenta_id\n if u.rol == \"USUARIO\" \n redirect_to \"welcome/index\" \n end\n end\n end\n end", "title": "" }, { "docid": "10e05449eccdf63d97fcb6a85ab698e4", "score": "0.62001675", "text": "def is_valid_usuario relacion_row, tipo_usuario, modificador_usuario\n errores = []\n # Modificamos el modificador de modo que funcione el metodo\n if modificador_usuario.length > 0\n modificador_usuario += \" \"\n end\n if Persona.where({tipo_documento_id: relacion_row[\"#{modificador_usuario}tipo documento\"], documento: relacion_row[\"#{modificador_usuario}documento\"]}).count > 0\n errores.push(\"documento_repetido\") #jeyson se habilita por que se repiten usuarios\n \n end\n\n if TipoDocumento.where(:id => relacion_row[\"#{modificador_usuario}tipo documento\"]).count ==0\n errores.push(\"tipo_documento_invalido\")\n end\n if !EmailValidator.valid?(relacion_row[\"#{modificador_usuario}email\"])\n errores.push(\"email_invalido\")\n end\n if Persona.where(:email => relacion_row[\"#{modificador_usuario}email\"]).count > 0\n errores.push(\"email_repetido\")\n end\n case tipo_usuario\n #when \"profesores\"\n #if SeccionesEducativa.where(:id => relacion_row[\"#{modificador_usuario}seccion\"]).count == 0\n # errores.push(\"seccion_educativa_invalida\")\n # end\n #if SecretariasEducacion.where(:id => relacion_row[\"#{modificador_usuario}secretaria educacion\"]).count == 0\n # errores.push(\"secretaria_educacion_invalida\")\n #end\n #puts 'se comentare porque en la carga de profesor vs camarografo no va'\n when \"observadores\"\n if CanalRegional.where(:id => relacion_row[\"#{modificador_usuario}canal regional\"]).count == 0\n errores.push(\"canal_regional_invalido\")\n end\n end\n errores\n end", "title": "" }, { "docid": "f385e3bca8850230bfc0464202ec45ed", "score": "0.61922103", "text": "def cal_filtro_logueado\n unless session[:cal_usuario]\n reset_session\n flash[:alert] = \"Debe iniciar sesión\"\n redirect_to :action => \"index\", :controller => \"cal_inicio\" \n return false\n end\n end", "title": "" }, { "docid": "808cc22a4b7a6d2c8e022c47ba087500", "score": "0.61556417", "text": "def logado\n if session[:usuario] == \"logado\"\n @usuario_logado = CoreUsuario.find(session[:usuario_atual])\n if @usuario_logado.ultimo_acesso + 2.hours > DateTime.now#1.minute > DateTime.now\n if @usuario_logado.status\n atualizar_data_hora_da_sessao; return true\n else\n flash[:erro] = \"Usuário não Ativo\"\n session[:usuario] = \"naologado\"\n redirect_to core_login_index_path\n end\n else\n flash[:erro] = \"Sessão Expirada por tempo limite!\"\n session[:usuario] = \"naologado\"\n redirect_to core_login_index_path\n end\n else\n redirect_to core_login_index_path\n end\n end", "title": "" }, { "docid": "acff44a03bf999d2aecf5737100fb997", "score": "0.61494523", "text": "def validate_login_and_email\n self.errors.add(:login, \"и Email не могут быть пустыми одновременно\") if(login.blank? && email.blank?)\n self.errors.add(:login, \"уже есть в нашей базе\") if(login.present? && User.where(login: login).present?)\n self.errors.add(:email, \"уже есть в нашей базе\") if(email.present? && User.where(email: email).present?)\n self.errors.messages.blank?\n end", "title": "" }, { "docid": "457078a3ca7909f25ab0e1ad9c887383", "score": "0.60939556", "text": "def login_filter(attr = {})\n is_get = (request.request_method == 'GET')\n\n # 1. check login\n unless login?\n if is_get\n redirect to('/user/signin?returnurl=' + CGI.escape(request.path))\n else\n halt 555, (json ret: \"error\", msg: \"请先登录\")\n end\n end\n\n # 2. check account\n unless user = @_current_user\n if is_get\n redirect to(\"/notice?reason=accounterror&ext_0=#{user.login_name}\")\n else\n halt 555, (json ret: \"error\", msg: \"登录账户数据有误\")\n end\n end\n\n # 3. check status filtering\n status = attr[:required_status]\n\n if status != false\n # if status == false (literally, the boolean value)\n # it will not check this part, which means\n # ALL status can access\n\n if status.nil? || status.empty?\n status = [ User::Status::NORMAL ]\n end\n\n if status.index(user.status).nil? && !settings.ignore_status_limit\n if is_get\n redirect to(\"/notice?reason=statuserror&ext_0=#{user.login_name}&ext_1=#{user.status}\")\n else\n halt 555, (json ret: \"error\", msg: \"账户当前状态有误\")\n end\n end\n end\n\n # 4. check roles filtering\n roles = attr[:required_roles]\n\n if roles != false\n if roles.nil? || roles.empty?\n roles = [ User::Role::USER ]\n end\n\n if roles.index(user.role).nil? && !settings.ignore_roles_limit\n if is_get\n redirect to(\"/notice?reason=roleerror&ext_0=#{user.login_name}&ext_1=#{user.role}\")\n else\n halt 555, (json ret: \"error\", msg: \"账户角色有误\")\n end\n end\n end\n\n user # end: if all OK, return current user object\n end", "title": "" }, { "docid": "7b3b468bac16cbff547e777ffa57e805", "score": "0.6077854", "text": "def validate_admin_user\n\n # Rails.configuration.each do |conf|\n\n # logger.info \"CONF \"+conf\n\n # end\n\n if current_user.nil?\n\n redirect_to \"/\"\n\n end\n\n if (current_user.email != Rails.configuration.admin_email)\n\n logger.info \"CURRENT USER IS: \"+current_user.email\n \n redirect_to \"/\"\n end\n\n end", "title": "" }, { "docid": "b2d750b83ef467729a2c5c7c7e902e31", "score": "0.6071805", "text": "def valida_rol\n lv_exito = false\n r = Administration::UserSession.find.record.attributes['role']\n # Si es administrador o Analista Prsupuestador\n if (r == 'ADMIN' or r== 'APRE' or r=='JEFUNI' or r=='COORD')\n lv_exito = true\n end\n lv_exito\n end", "title": "" }, { "docid": "5b69883e645d18010e1a1c2c34a4fc5b", "score": "0.60584086", "text": "def validate_user\n\t\tif current_user.email == \"admin@dropque.com\" || current_user.email == \"ibukun@dropque.com\" || current_user.email == \"opeyemi@dropque.com\" || current_user.email == \"yinka@dropque.com\" || current_user.email == \"mustapha@dropque.com\"\n\t\t\t\n\t\telse \n\t\t\tredirect_to landing_path\n\t\tend\n\tend", "title": "" }, { "docid": "a36ab97204b533bfe4627da058b313cb", "score": "0.60099304", "text": "def index\n if usuario_logado && user.cadastro_id == 1\n @usuarios = Usuario.all\n else\n redirect_to root_path\n end\n\n end", "title": "" }, { "docid": "29874b954fcf8539d5f0aeab12e3b407", "score": "0.60015607", "text": "def management\n @usuario = helpers.current_user\n @todosusuarios ||= Usuario.where(ativo: false)\n if @todosusuarios.blank?\n flash.now[:notice] = \"Não há nenhum usuário para ter o acesso liberado.\"\n end\n end", "title": "" }, { "docid": "ff6fc7de67599c7f303b26617e1a38f9", "score": "0.5958166", "text": "def permisos_usuario\n authorize! :permisos_usuario,Administracion::Usuario\n @controladores = Administracion::Controlador.all\n end", "title": "" }, { "docid": "2721928b7c697560aeba187f98c19e54", "score": "0.5956762", "text": "def solo_admins_pueden_crear_usuarios!\n redirect_to root_path unless user_signed_in? && current_user.tipo.id==1 \n end", "title": "" }, { "docid": "ef55cc535417eae122507c55438a9dc0", "score": "0.5937775", "text": "def usuarios\n ldap, ldap_config = autenticacion\n criterio = \"*\"\n filtro = Net::LDAP::Filter.eq(ldap_config['attribute'], criterio)\n ldap.search(base: ldap_config['base'], filter: filtro)\n end", "title": "" }, { "docid": "368ff743771b8406983afd951a317c07", "score": "0.5937571", "text": "def verificar_autenticado\n\n if params[:controller] != 'users' && params[:action] != 'cadastrar'\n\n end\n\n\n if action_name == 'login'\n autenticar_usuario\n end\n\n if action_name == 'logout'\n session.delete(:user)\n\n # Se o usuário não estiver logado, então redireciona para a tela de login\n elsif session[:user].nil?\n respond_to do |format|\n\n if params[:action] == 'login'\n format.html {redirect_to '/', notice: \"Nome de usuário ou senha inválida\"}\n else\n format.html {render '/users/login'}\n end\n end\n\n # Se o usuário estiver logado\n elsif !session[:user].nil?\n\n # E se a id do usuário for nula\n # TODO Revisar essa parte para não precisar setar se é como string ou como chave\n if session[:user][\"id\"].nil?\n usuario_atual = session[:user][:id]\n elsif session[:user][:id].nil?\n usuario_atual = session[:user][\"id\"]\n end\n\n # Se o perfil do usuário for diferente de Administrador e o nome do controlador que tiver acessando for diferente\n # de condominio\n if session[:user][\"perfil\"] != 'Administrador' && controller_name != 'condominios'\n\n # Abre o dashboard\n return dashboard_system_index_path\n else\n\n if Modulo.where(\"users_id = #{usuario_atual} and modulo_nome = '#{controller_name.singularize}'\").size == 0\n if session[:user][\"perfil\"] != 'Administrador' && session[:user].nil?\n respond_to do |format|\n format.html {render :template => \"users/login\"}\n end\n end\n end\n end\n end\n\n\n end", "title": "" }, { "docid": "35c90f79a4d407d7f794e2283ae5a11e", "score": "0.5928072", "text": "def login_required\n unless (@yo and (@yo.estado_id > Usuario::ESTADO_SIN_ACTIVAR))\n envia_a_login(\"Debe identificarse como usuario para acceder\")\n end\n end", "title": "" }, { "docid": "62bfa30753d409fb67f4efa4df7e4869", "score": "0.5899984", "text": "def usuario_valido\n unless ( @usuario && @usuario.activado? && \n @usuario.autentificado?(:reseteo, params[:id]))\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "0096acb9d5688e87a9057c78881e260d", "score": "0.58934873", "text": "def validate\n \tif self.resource_type == RESOURCE_TYPE[:tutor]\n\t\t\tcurrent_user\n\t\t\t@owner = current_user.resource\n\t\t\t@tutors = Tutor.find(:all, :conditions => [\"owner_id = ?\",@owner.id])\n\t\t\t#@Tutor_users should not remain nil while using with << method.\n\t\t\t@tutor_users = []\n\t\t\tif @tutors\n\t\t\t\t@tutors.each do |tutor|\n\t\t\t\t\t@tutor_users << tutor.user\n\t\t\t\tend\n\t\t\tend\n\t\t\t#Finds all Users who are not Tutor.\t\t\t\n\t\t\t@non_tutors = User.find(:all, :conditions => [\"resource_type != ?\",'Tutor'])\n\t\t\t#Combines two arrays (@tutor_users and @non_tutors) into one array and checks if login available.\n\t\t\tfor user in @tutor_users.concat(@non_tutors)\t\t\n\t\t\t\terrors.add(:login, \"has already been taken.\") if self.login == user.login\n\t\t\t\terrors.add(:email, \"has already been taken.\") if self.email == user.email\n\t\t\tend\t\t\t\n \tend\n end", "title": "" }, { "docid": "beb950bb3dae8ad5c22d27992af72189", "score": "0.5886378", "text": "def user_index\n\t\tputs \"#{params[:user]} - #{params[:tent]} - #{params[:admin]}!!!!!!!!!!!!!!!!!!!!!!!!!!\"\n\t\t# Filtro para seleccion un rol especifico de usuarios\n\t\tif params[:user].present?\n\t\t @users = User.where(role: 0)\n\t\telsif params[:tent].present?\n\t\t @users = User.where(role: 1)\n\t\telsif params[:admin].present?\n\t\t @users = User.where(role: 2)\n\t\telse\n\t\t\t#Bandera para mostrar lista vacia\n\t\t\t@vacio = true\n\t\tend\n\tend", "title": "" }, { "docid": "43731e3e695c9184110911f5ddaade07", "score": "0.58647597", "text": "def index\n if has_role_with_hierarchy?(:superadministrador)\n # muestra todos los usuarios, excepto al superaministrador\n @users = User.all :conditions => ['role_id != ?', 4]\n else\n # muestra todos los usuarios (registrados y desarrolladores), excepto a los otros administradores\n @users = User.all :conditions => ['role_id <= ?', 2]\n end\n end", "title": "" }, { "docid": "0dc3e241eae0f88d19b43e89b5088143", "score": "0.5863806", "text": "def is_valider\n\t\tret=false\n\t\tself.roles.each do |role|\n\t\t\tif role.title.left(5)=='valid'\n\t\t\tret=true\n\t\t\tend\n\t\t\tret\n\t\tend\n\t# all(:select => \"login, email\",\n\t# :order => :login,\n\t# :conditions => \"roles.title like 'valid%'\",\n\t# :joins => \"inner join roles on users.role_id = roles.id\")\n\tend", "title": "" }, { "docid": "58071cb928191298f90708594da97fc0", "score": "0.58321923", "text": "def zalogowany_user\n unless zalogowany?\n pamietaj_lokalizacje\n redirect_to loguj_path, notice: \"Zaloguj sie.\"\n end\n end", "title": "" }, { "docid": "3c3d32ec821931a83cdb5227b8068e74", "score": "0.5815615", "text": "def valid_usuario\n unless (@usuario && @usuario.activated? &&\n @usuario.authenticated?(:reset, params[:id]))\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "09c16c8fb239cc4282f191d3c87400df", "score": "0.58071804", "text": "def require_admin\n if logged_in? and !(current_user.tipo == 'Jefe de departamento') \n redirect_to root_path\n end \n end", "title": "" }, { "docid": "aedabc8c6dbf5a34f7454d15b21223a5", "score": "0.58049256", "text": "def autorizado\n no_autorizado unless current_user == @user or current_user.admin\n end", "title": "" }, { "docid": "c5510ea22d268563ab2e75e6dc900455", "score": "0.5799619", "text": "def is_not_admin\n if current_user != @user and !current_user.admin?\n flash[:danger] = \"Debes loguearte \"\n render 'new'\n end\n end", "title": "" }, { "docid": "6a20da2745471344b532513d0ea427ff", "score": "0.5795979", "text": "def valid?\n\t\t\t\tparams[:user] && params[:user][:login] && cfg &&\n\t\t\t\t\t!User.where(\n\t\t\t\t\t\tusername: params[:user][:login],\n\t\t\t\t\t\tldap_user: false\n\t\t\t\t\t).exists? && super\n\t\t\tend", "title": "" }, { "docid": "6e415b5d60f42658a630ae96d17c6b1d", "score": "0.5794604", "text": "def auth_user\n @gruppo = Gruppo.find(params[:gruppo_id])\n if @gruppo.utenti.exists?(current_user)\n flash[:notice] = 'gruppo a cui sei gia aggiunto'\n redirect_to root_url\n end\n end", "title": "" }, { "docid": "076e5f8df2dd8005d523f6c918301066", "score": "0.57914096", "text": "def check_if_admin\n user = User.find_by(email: params[:user][:login])\n\n if user.nil?\n redirect_to :back, notice: 'This email is not registered with us. Please correct and try again.'\n elsif user.type != 'Admin'\n redirect_to :back, notice: 'This login is only for admin.'\n end\n end", "title": "" }, { "docid": "38b39c565cecf0c1e4c68ae002ec08f1", "score": "0.5772688", "text": "def todos_usuarios\n return User.find_by_sql(\"SELECT users.* from users inner join roles_users ru on users.id=ru.user_id\n INNER JOIN roles r on ru.role_id=r.id\n WHERE (users.blocked=0 or users.blocked IS NULL) AND r.name='#{self.name}'\")\n end", "title": "" }, { "docid": "433aa7f6a6ed82c82ae366c0bf354513", "score": "0.5748823", "text": "def show\n verifica_se_usuario_logado_e_admin\n end", "title": "" }, { "docid": "c052732f3a9303e3eeb4a812f799fc35", "score": "0.57427704", "text": "def checklogueado\n\t \t\t\tunless session[:user_id]\n\t\t\t\t\t\t@current_user = nil\n\t\t\t\t\t\treturn false\n\t\t\t\t\telse\n\t\t\t\t\t\t# set current user object to @current_user object variable\n\t\t\t\t\t\t@current_user = User.find(session[:user_id])\n\t\t\t\t\t\treturn true\n\t\t\t\t\tend\n\t end", "title": "" }, { "docid": "6f0c2df47bc7c8b4cf5df6c38fbc3946", "score": "0.57379967", "text": "def gerente_ds_user\n unless current_user.gerente_ds?\n flash[:danger] = \"No posee permisos para Eliminar Usuarios\"\n redirect_to current_user\n end\n end", "title": "" }, { "docid": "fb9cd3df319a1d61927c30b34510f12a", "score": "0.5731418", "text": "def logar(log, pass)\n if File.exist?('usuarios.txt')\n lines = File.readlines('usuarios.txt')\n lines.each do |line|\n info = line.split\n if log == info[1] && pass == info[2]\n self.id = info[0]\n self.login = info[1]\n self.nome = info[3]\n if info[4] == \"true\"\n self.perfil = true\n else\n self.perfil = false\n end \n self.disciplinas = info[5]\n return true\n end\n end\n end\n return false\n end", "title": "" }, { "docid": "f80013f0e5e6fa3578d8918f21ddb1d3", "score": "0.5727884", "text": "def rol_usuario\n end", "title": "" }, { "docid": "e56f0c66a64d6422087e78525753c02e", "score": "0.57211214", "text": "def filter_in_user_table() #:doc:\r\n filter_logged_in or return false\r\n user_table_id ? true : false\r\n end", "title": "" }, { "docid": "763641ea177fe4d8909193d23dc3b125", "score": "0.5713516", "text": "def ha_accedido? \t\t### logged_in? ###\n\t\t!usuario_actual.nil?\n\tend", "title": "" }, { "docid": "36a27d90ec14110363f8f386df3c92ab", "score": "0.5687978", "text": "def index\n @users = User.all\n# if @current_user.try(:role) != \"admin\"\n# flash[:error] = \"Accès interdit\"\n# return redirect_to request.referrer || root_path\n# end\n\n @user = User.all\n end", "title": "" }, { "docid": "d4f0b2c5965272217196aab99414a9c2", "score": "0.5674821", "text": "def usuario_login\n showError(\"Correo electronico o contraseña vacio\") and return if params[:email].blank? || params[:password].blank?\n\n @user = RestaurantesUsuario.where(:email => params[:email], :password => OpenSSL::HMAC.hexdigest('sha256', 'colombia', params[:password]) )\n\n if @user.exists?\n respond_to do |format|\n format.json { render json: @restaurantesReservas }\n format.xml { render '/app/views/api_mesafijas/usuario_login.xml.builder' }\n end\n else\n showError(\"Correo electronico o contraseña incorrecto\") and return\n end\n\n # 6c4ad053e5c9b1a678e34c3d0bbfa82fd5b477f54e6a0fdba8595025c620e671 == 70887088\n end", "title": "" }, { "docid": "3ce56fc1683e31edc3c8bf5a4801386b", "score": "0.5669765", "text": "def authorize\n unless Usuario.find_by_id(session[:usuario_id]) or Usuario.count == 0\n session[:original_uri] = request.request_uri\n flash[:notice] = \"Por favor autentiquese en el sistema\"\n redirect_to(:controller => \"login\" , :action => \"login\" )\n end\n\n if Usuario.count == 0\n if request.path_parameters[:action]==\"agregar_usuario\" and request.path_parameters[:controller]==\"login\"\n #nothing\n else\n session[:original_uri] = request.request_uri\n flash[:notice] = \"Esta es la primera vez que ha iniciado la aplicación, por favor cree un usuario\"\n redirect_to(:controller => \"login\" , :action => \"agregar_usuario\" )\n end\n end\n end", "title": "" }, { "docid": "8780be28a1fee8416f9859399bec5d43", "score": "0.5658339", "text": "def userIsAdmin\n\t\tif isAdmin?\n\t\t\t@usuario = Usuario.find(params[:id])\n\t\t\tif params[:accion] == \"y\"\n\t\t\t\t@datos = {\"admin\"=>\"si\"}\t\t\t\n\t\t\telse\n\t\t\t\t@datos = {\"admin\"=>\"no\"}\n\t\t\tend\n\t\t\t@usuario.update_attributes(@datos)\n\t\telse\n\t\t\tredirect_to root_path\n\t\tend\n\tend", "title": "" }, { "docid": "daca775f36d526e8985a45ed089a7174", "score": "0.56555337", "text": "def registro_login_ventas\n\n #consierar que no si no es nadie (cualquier cosa diferente de supervisor, admin, ventas, por ejemplo nil u otro valor desconocido, ok ted.) sea ventas el acceso.\n if( (session[:current_user].to_s != \"ventas\") && ( session[:current_user].to_s != \"supervisor\") && (session[:current_user].to_s != \"admin\") )\n session[:current_user] = \"ventas\"\n @accesot = Accesot.new\n @accesot.usuario = \"ventas\"\n @accesot.tipoacceso = \"login\"\n @accesot.fechayhora = Time.now\n @accesot.ip = request.env['action_dispatch.remote_ip'].to_s # registro la ip desde donde se hace el request. ok.\n @accesot.save\n \n end \n\n if( (session[:current_user].to_s == \"admin\") || (session[:current_user].to_s == \"supervisor\") )\n\n #registrar LOGOUT de admin o de supervisor, dependiendo valor de la session ok: \n @accesot = Accesot.new\n @accesot.usuario = session[:current_user].to_s # selecciono el usuario a hacer logout. ok. (puede contener \"admin\" o \"supervisor\" solamente porque esta dentro del if condition ok ted.)\n @accesot.tipoacceso = \"logout\"\n @accesot.fechayhora = Time.now\n @accesot.ip = request.env['action_dispatch.remote_ip'].to_s # registro la ip desde donde se hace el request. ok.\n @accesot.save\n\n #registrar login ventas:\n session[:current_user] = \"ventas\"\n @accesot = Accesot.new\n @accesot.usuario = \"ventas\"\n @accesot.tipoacceso = \"login\"\n @accesot.fechayhora = Time.now\n @accesot.ip = request.env['action_dispatch.remote_ip'].to_s # registro la ip desde donde se hace el request. ok.\n @accesot.save\n\n #crear el scaffold de este modelo.\n #ver lo del after_filter action ok.\n #probarlo.\n #continuar lo mismo pero para admin, en los controladores requeridos.\n \n end \n\n # if session[:current_user] == nil, asignar \"ventas\" a session[:current_user] y registrar nuevo login\n # if session[:current_user] == admin, asignar \"ventas\" a session[:current_user] y registrar nuevo login de usuario ventas y registrar como salida de usuario admin.\n # if session[:current_user] == supervisor, asignar \"ventas\" a session[:current_user] y registrar nuevo login de usuario ventas y registrar como salida de usuario supervisor.\n # if session[:current_user] == ventas, no hacer nada, ya estaba logeado ok.\n # if session[:current_user] != admin, supervisor, ventas, asignar \"ventas\" a session[:current_user] y registrar nuevo login usuario ventas.\n\n\n\n end", "title": "" }, { "docid": "81319b517fe8414b4a327a73d9c033c3", "score": "0.5632395", "text": "def loginAdmin(email, motDePasse)\n\n if !motDePasse.strip.empty? && !email.strip.empty?\n administrateur = Administrateur.find_by(email_administrateur: email, motDePasse_administrateur: motDePasse, etat: false)\n else\n administrateur = nil\n end \n\n end", "title": "" }, { "docid": "6387e777f15f6ef654b89f16ec9f7024", "score": "0.56321096", "text": "def Verificar_Administrador\n if current_user.role == 1 or current_user.role == 2\n flash[:error] = \"No tiene permisos.\"\n redirect_to \"/\"\n end\n end", "title": "" }, { "docid": "51dad795c17f1799ced7f62cde78fc38", "score": "0.563152", "text": "def index\n @users = User.limit(10)\n\n if session[:user_id] != nil && session[:user_id] != 0\n @estaLogado = true\n end\n end", "title": "" }, { "docid": "7ca4421eb92378358e4574249db7e0cf", "score": "0.56312656", "text": "def user_filter_differs_to_logged_in_user?\n if user_id_filter\n logged_in_user_id != user_id_filter\n else\n false\n end\n end", "title": "" }, { "docid": "953f720946804943d443487a80eb74b3", "score": "0.56293046", "text": "def admin?\n get_user =~ /^(riccardo|fabio|rcarlesso|fmattei)$/\n end", "title": "" }, { "docid": "9b65497ad4069503e86126f925f9bf7b", "score": "0.56291926", "text": "def create\n @admin_user = AdminUser.find_by(username: params[:username])\n if @admin_user && @admin_user.authenticate(params[:password])\n # inloggen gelukt, maak sessie, schrijf log entry en toon hoofdpagina\n session[:admin_user_id] = @admin_user.id\n log self.class.name, LogEntry::INFORMATIONAL, \"Beheerder #{@admin_user.username} is ingelogd\"\n redirect_to root_path\n else\n # inloggen mislukt, toon formulier opnieuw met melding\n flash.now[:error] = \"Foutieve gebruikersnaam of wachtwoord\" \n render :new\n end\n end", "title": "" }, { "docid": "26d093ea493fbf277f744d475eee2fe9", "score": "0.560514", "text": "def filter_in_user_table() #:doc:\n filter_logged_in or return false\n user_table_id ? true : false\n end", "title": "" }, { "docid": "c4c37cd227a4b70c3ebcb58b07021cf4", "score": "0.5601403", "text": "def signed_in_user_filter\n if signed_in?\n redirect_to root_path, notice: \"Already logged in\"\n end\n end", "title": "" }, { "docid": "a44930a511ccb8194e0fcc8b2ca54a35", "score": "0.5598356", "text": "def check_login \n if self.login && self.login.downcase.match(/(account|activate|admin|anonymous|contact|locations|login|logout|register|search|session|signup|sitemap|stories|users)/)\n self.errors.add(nil, \"You may not use #{self.login} as your login, sorry!\")\n \tend\n end", "title": "" }, { "docid": "b06f840bc9ada1db01264b14ebb7b4f5", "score": "0.559096", "text": "def set_user_buscar\n @campo = params[:campo]\n @valor = params[:valor]\n if @campo == 'codigo'\n @user = User.find(params[:valor])\n elsif @campo == 'login'\n @user = User.limit(10).where(\"login LIKE '%#{@valor}%'\")\n else\n @user = User.limit(10).where(\"nombre LIKE '%#{@valor}%'\")\n end\n end", "title": "" }, { "docid": "1ec6f433059fee1be86cf2355d785c70", "score": "0.5587442", "text": "def verify_user\n if current_user.to_s.blank?\n flash[:notice] = I18n.t('admin.need_login') and raise Blacklight::Exceptions::AccessDenied\n elsif Rails.configuration.x.admin_users_email.include? current_user.email\n else\n raise Pundit::NotAuthorizedError\n end\n end", "title": "" }, { "docid": "b3c0e206b316ae8ba4f3e65c4454a9cd", "score": "0.55814373", "text": "def verifica_usuarios\n# @user_pages, @usuarios = paginate :users, :per_page => 10\n @usuarios = User.find(:all, :order => 'nombre')\n @rol = Rol.find(params[:id])\n @usuarios = @rol.users\n end", "title": "" }, { "docid": "b26b0ce5a658e5b5a80db39e1f1d467b", "score": "0.55645096", "text": "def authenticate_user_or_doctor\n unless current_user || current_doctor\n flash[:alert] = 'Xin hãy đăng nhập trước!'\n redirect_to user_session_path\n end\n end", "title": "" }, { "docid": "2c60399400104719ef5271f1af4b299c", "score": "0.55640334", "text": "def is_user_valid?\n\n #on recherche cet utilisateur\n query = Agent.find_by(phone: @mat)\n if query\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "fa0b370289f1eeb359cbd5cbd538dd99", "score": "0.55560076", "text": "def logged_in_employee\n unless logged_in? && current_employee.admin?\n flash[:error] = \"Por favor inicia sesión como administrador.\"\n redirect_to employees_directory_path\n end\n end", "title": "" }, { "docid": "a771e10f1d71bbf5747c7d245da4a12e", "score": "0.5554959", "text": "def filter_logged_in() #:doc:\r\n _logger.debug(\"In filter_logged_in\")\r\n if logged_in?\r\n _logger.debug(\"\\tlogged_in? returned true\")\r\n return true\r\n elsif !UCB::Rails::Security::CASAuthentication.filter(self)\r\n _logger.debug(\"\\tUCB::Rails::Security::CASAuthentication.filter returned false\")\r\n return false\r\n end\r\n application_login\r\n true\r\n end", "title": "" }, { "docid": "25b99734b51d608435063de3e9c96aad", "score": "0.5551788", "text": "def index\n @users = User.all\n @journalsaccepted = Journal.where(\"status like ?\", \"%ccept%\")\n @journalspublished = Journal.where(\"status like ?\", \"%ublish%\")\n @journalsrejected = Journal.where(\"status like ?\", \"%eject%\")\n @journalspresented = Journal.where(\"status like ?\", \"%resent%\")\n @journalssubmitted = Journal.where(\"status like ?\", \"%ubmitte%\")\n @user = User.find(session[:user_id])\n if @user.name != 'rishikeshwar'\n redirect_to login_url\n end\n end", "title": "" }, { "docid": "3f081b9dda82a152f3f29d77d69b5296", "score": "0.55504084", "text": "def check_user\n unless current_user == App.find(params[:id]).user or is_admin\n flash[:error] = \"You do not have the authority to do that\"\n redirect_to root_path\n end \n end", "title": "" }, { "docid": "f83b721ab9ab6babb1b6252c580f631c", "score": "0.55501956", "text": "def check_users(account_users)\n return false unless allow_manage_users?\n\n account_users.filtered_users.any?\n end", "title": "" }, { "docid": "4b59aa5e2b7cea7120bc57316ecc43ea", "score": "0.5538143", "text": "def validate_opciones\n opciones = []\n for rol in @usuario.roles\n opciones = opciones | rol.opciones\n end\n ruta = self.class.controller_path\n opcion = nil\n if ruta == 'prestamos/consulta_prestamo' && (self.action_name == 'view' || self.action_name == 'tasa_historico_list_view' || self.action_name == 'tasa_historico_list')\n ruta = ruta + \"/#{self.action_name}\"\n end\n if session[:menu_string].nil?\n if ruta == 'basico/ayuda' || ruta=='inicio' || opciones.find {|opcion| opcion.ruta == ruta }\n @valid_menu, valid = fill_menu(Menu.find(:all, :conditions=>['parent_id isnull'], :order=>'orden'), opciones)\n logger.debug \"Valid Menu ========> #{@valid_menu.inspect}\"\n logger.debug \"Opcion ========> #{opcion.inspect}\"\n return [true, opcion]\n logger.debug \"(no quitar este logger debug) deja de funcionar el validate_opciones en basico/instancia_comite_nacional\" \n else\n return [false, nil]\n logger.debug \"(no quitar este logger debug) deja de funcionar el validate_opciones en basico/instancia_comite_nacional\" \n end\n else\n logger.debug \"Paso por el else\"\n @valid_menu = session[:menu_string]\n if ruta == 'basico/ayuda' || ruta=='inicio' || opciones.find {|opcion| opcion.ruta == ruta }\n return [true, opcion]\n logger.debug \"(no quitar este logger debug) deja de funcionar el validate_opciones en basico/instancia_comite_nacional\" \n end \n end\n end", "title": "" }, { "docid": "9629388376fdea5caa13a0192976d39a", "score": "0.55377275", "text": "def filter_logged_in() #:doc:\n #_logger.debug(\"In filter_logged_in\")\n if logged_in?\n #_logger.debug(\"\\tlogged_in? returned true\")\n return true\n elsif !UCB::Rails::Security::CASAuthentication.filter(self)\n #_logger.debug(\"\\tUCB::Rails::Security::CASAuthentication.filter returned false\")\n return false\n end\n application_login\n true\n end", "title": "" }, { "docid": "730f8a07abd4f4f4d668f01fa716d2e6", "score": "0.5537424", "text": "def verifica_usuario(user_id)\n if self.user_id == 0 or self.user_id == nil\n r = 'SOLICITANTE'\n else\n r= self.user.name\n end\n end", "title": "" }, { "docid": "7920e909b4eecf94f92dd7fd5a3d1a75", "score": "0.5532342", "text": "def check_admin_rights\n unless logged_in? and current_user.is_admin?\n flash[:error] = \"Permiso denegado\"\n redirect_to '/'\n end\n end", "title": "" }, { "docid": "ae0a11120bf2e45129276fcbac5205a1", "score": "0.5530664", "text": "def login\n user = User.where(cpf: params[:cpf].get_only_digits).last\n if user && user.valid_password?(params[:senha])\n if user.ativo\n user = {id: user.id, nome: user.nome, email: user.email, cpf: user.cpf, ativo: user.ativo, permissoes: user.permissoes, admin: user.admin}\n render json: { status: \"OK\", usuario: user }\n else\n render json: { status: \"USUARIO_DESATIVADO\" }\n end\n else\n render json: { status: \"USUARIO_NAO_ENCONTRADO\" }\n end\n end", "title": "" }, { "docid": "1f0240b0d19b1b060ae84abf05c1ea8b", "score": "0.55297357", "text": "def tarjetas\n\t\tif admin_signed_in?\n\t\t\t@usuarios = Usuario.all\n\t\telse\n\t\t\tflash[:alert] = \"Usted no tiene permiso para ver esto\"\n\t\t\tredirect_to root_path\n\t\tend\n\tend", "title": "" }, { "docid": "691c78f5958b844eb953acb9fd216589", "score": "0.5520673", "text": "def authenticate_admin_user!\n redirect_to '/' and return if user_signed_in? && ![\"jekhokie@gmail.com\", \"keith.griffis@gmail.com\"].include?(current_user.email)\n authenticate_user!\n end", "title": "" }, { "docid": "0d27fdcb1037255cfdea8497cc580a64", "score": "0.55195457", "text": "def check_property\n return true if @current_user.is_admin?\n\n if !params[:user_id].blank? #|| ADMIN\n if @current_user.nil?\n @user = User.find_by_id(params[:user_id])\n else\n @user = @current_user\n end\n # respond_to do |format|\n # format.html do\n unless @user.organizer.id == @organizer.id\n security_exit\n # redirect_to(root_path(@user, @user.organizer), alert: 'Solo puedes operar sobre la organización que tu hayas creado.')\n return\n end\n # end\n # end\n end\n\n if @organizer && !@current_user.is_admin?\n if @organizer.user != @current_user && !@current_user.is_admin?\n security_exit\n # redirect_to(root_path, alert: 'Solo puedes operar sobre la organización que tu hayas creado.')\n return\n end\n else\n security_exit\n # redirect_to(root_path, alert: 'Solo puedes operar sobre la organización que tu hayas creado.')\n return\n end\n end", "title": "" }, { "docid": "3e0574b83232d6c389be65e1e8cec426", "score": "0.5515617", "text": "def authorized_todo\n if current_user.present?\n if current_user.isManager || current_user.isUser\n flash[:notice] = \"Da haben wir einen Riegel vorgeschoben und zwar keinen Schokoriegel!\"\n redirect_to root_path and return\n end\n end\n end", "title": "" }, { "docid": "0b01d3fb89737620c4f592eeb722f4e7", "score": "0.5514678", "text": "def usuario_validator\n params.require(:usuario).permit(:nombre,:apellido,:informacion)\n #Yo creo que aquí se ejecutaría la validación, del contenido, si es un umero\n #de telefono que sean sólo números... etc\n end", "title": "" }, { "docid": "ce76c011a9dace1cbf13998fdcc7ef2f", "score": "0.5508671", "text": "def check_user\n render json: 'You are unauthorized!', status: 401 unless @user.id == current_user.id || @user.facilitator_id == current_user.id || current_user.admin\n end", "title": "" }, { "docid": "76d30e5fe85a4929315404c3ed49ec4a", "score": "0.55012023", "text": "def require_admin\n if logged_in? and !(current_user.tipo == 'Enfermera') \n redirect_to root_path\n end \n end", "title": "" }, { "docid": "606825d8ec13c40c6454a3aa657fdd3f", "score": "0.54926497", "text": "def check_user\n render json: 'You are unauthorized!', status: 401 unless @user.id == current_user.id || @user.facilitator_id == current_user.id || current_user.admin\n end", "title": "" }, { "docid": "606825d8ec13c40c6454a3aa657fdd3f", "score": "0.54926497", "text": "def check_user\n render json: 'You are unauthorized!', status: 401 unless @user.id == current_user.id || @user.facilitator_id == current_user.id || current_user.admin\n end", "title": "" }, { "docid": "bb366743d27c123e0ec3da56c5a2cd5a", "score": "0.5492513", "text": "def check_for_admin\n \n user = User.find_by_id(session[:user_id])\n unless user.is_admin\n flash[:msg]=\"You are not adminstrator ?? , Are You ? Login as administrator .... to access it\"\n redirect_to_home\n end \n end", "title": "" }, { "docid": "591dd93060c978663e57618d790f3b1f", "score": "0.5491952", "text": "def admin?\n return self.tipo_usuario == ADMIN\n end", "title": "" }, { "docid": "93d701d761153cf65e182ba81fb2e8f4", "score": "0.54913425", "text": "def validate_user\n unless @note.author_id == session[:user_id] || @note.users.include?(@current_user)\n flash[:notice] = \"You don't have permission to access this note!\"\n redirect_to notes_path\n end\n end", "title": "" }, { "docid": "7fc874c3e5d25fdd8cdcb17c39d8c6ec", "score": "0.54909146", "text": "def user_access\n if current_user && !current_user.access?(:journal_new_edit_delete)\n flash[:notice] = \"Du har ikke adgang til denne side\"\n redirect_to login_path\n end\n end", "title": "" }, { "docid": "7a41649d54b55e02e7f9e5255d5f3217", "score": "0.54899436", "text": "def permisos_administrador?\n \n if socio_signed_in?\n \n if current_socio.admin==false\n \n redirect_to error_path\n \n else\n return true\n \n end\n \n \n else\n \n redirect_to new_socio_session_path\n end\n \n \n end", "title": "" }, { "docid": "e99b6a87f1d5bb6f3a8bc865f415bf9a", "score": "0.54850554", "text": "def validate_cas\n if RubyCAS::Filter.filter(self)\n return set_logged_in_cas_user_if_logged_in\n else\n return false\n end\n end", "title": "" }, { "docid": "4cffa1a43103f17587b06120cebe92d1", "score": "0.5483959", "text": "def admin?\n session[:usuario] and session[:usuario][:tipo] == 'admin'\n end", "title": "" }, { "docid": "7993d5e1891e7024bb89174adbdd1015", "score": "0.5473571", "text": "def get_user_admin_logins() end", "title": "" }, { "docid": "7993d5e1891e7024bb89174adbdd1015", "score": "0.5473571", "text": "def get_user_admin_logins() end", "title": "" }, { "docid": "509228ca34ff566e0192277eca3e3dd7", "score": "0.54717124", "text": "def loginEmpresa \n if User.exists?(:email=>params[:txtUser],:id=>params[:txtPassword])\n user = User.select('id_perfi,id').where(:email=>params[:txtUser],:id=>params[:txtPassword]).first\n \n user_session = User.select('nombre').where(:email=>params[:txtUser],:id=>params[:txtPassword]).first\n user_sessionA = User.select('apellido').where(:email=>params[:txtUser],:id=>params[:txtPassword]).first\n userContra = User.select('contrasena').where(:email=>params[:txtUser],:id=>params[:txtPassword]).first\n \n session[:nombre] = user_session.nombre \n session[:apellido] = user_sessionA.apellido\n session[:usercontra] = userContra\n\n \n\n \n session[:datos] = User.select('U.id, U.nombre, U.apellido, C.salario, C.cargo, C.tipo_contrato, C.fecha_ingreso, C.fecha_retiro, E.id as \"nit\", E.nombre').joins(' U JOIN \"Web\".\"tbContratos\" C ON C.id = U.id_contrato JOIN \"Web\".\"tbEmpresa\" E ON E.id = U.id_empresa JOIN \"Web\".\"tbUsuarios\"\n ON U.id =' << user.id.to_s).first\n \n session[:datosNomina] = Paysheet.select('N.dias_laborados, N.neto_pagado, N.id, N.comisiones, N.auxilio_trasporte, N.recargos,N.prima, N.prestamos, N.salud, N.pension').joins(' N JOIN \"Web\".\"tbUsuarios\" U ON U.id =' << user.id.to_s)\n\n\n \n if user.id.eql?(params[:txtPassword].to_i)\n render 'cambiocontr'\n else\n if user.id_perfi.eql?(1)\n render 'company', layout: 'homeEmpresa'\n else\n render 'employee', layout: 'home'\n end\n end\n else \n @mensaje = 'usuario y contraseña incorrecta'\n @tipo ='error'\n render 'indexcompany'\n end\n end", "title": "" }, { "docid": "7cda7e1ba59f7e83a3d85c576f3e63d5", "score": "0.54707867", "text": "def verificar_perfil_administrador\n\tif current_usuario.rol ==3\n\t\t redirect_to paciente_path\n\tend\nend", "title": "" }, { "docid": "5ee26bbc3daa7f7ca84a1d6ac403d3db", "score": "0.54703087", "text": "def index\n @usuarios = Usuario.all\n authorize @usuarios\n end", "title": "" }, { "docid": "b486a9ae698bbcdf5f191ee8b5330501", "score": "0.5470147", "text": "def check_if_entrepreneur\n if (!@user) || (@user && @user.user_type != \"Entrepreneur\") #if user is not logged in, or a logged in user is not a manager\n redirect_to fashions_path, notice: \"Only Entrepreneurs are authorized to perform this function\" \n end\n end", "title": "" }, { "docid": "d4cda927fe6502e1ed4b594c64be9387", "score": "0.54693013", "text": "def index\n redirect_to(:action => 'login') unless logged_in? # || Noruser.count > 0\n# if logged_in? || Noruser.count > 0\n# flash[:notice] = \"loggin: #{session[:noruser]}\"\n# else\n# redirect_to(:action => 'signup')\n# end\n end", "title": "" }, { "docid": "78253ffbf1a816ec6ec67230244ad713", "score": "0.54656506", "text": "def authorized_login_required\n (if current_user.login == \"benoror\"\n true\n else\n flash[:notice] = \"No tienes acceso a esta seccion\"\n false\n end) || access_denied\n end", "title": "" }, { "docid": "4e3ae377be1dfb79af74564908a61589", "score": "0.54593265", "text": "def utilisateur\n\n end", "title": "" } ]
2a20c47e9ed1bff15882256c4506f600
Metodo para establecer por default el estado del juego, se usa para la carga previa del nivel
[ { "docid": "77518f118398c7d853969caa8f860f1c", "score": "0.0", "text": "def setup\n super\n @background = Image['Bg level1.png']\n viewport.lag = 0\n viewport.game_area = [0, 0, 3000, 1000]\n @gilbert = Gilbert.create(x: 50, y: 900, limited: viewport.game_area.width)\n @level = File.join(ROOT, 'levels', self.filename + '.yml')\n load_game_objects(file: @level)\n\n @plataformas = Plataforma2.all\n @music = Song.new('media/Songs/Music Level1.mp3')\n @loser_song = Song.new('media/Songs/gameover.ogg')\n\n @moneda = Moneda.all.first\n\n @meta_on = false\n\n @marco_name = Image['MarcoName.png']\n @marco_score = Image['MarcoPoint.png']\n\n @score = 0\n @msj_name = Chingu::Text.new(@player_name, x: 85, y: 25, size: 30, color: Gosu::Color::WHITE)\n @msj_score = Chingu::Text.new(@score.to_s, x: $window.width - 130, y: 30, size: 35)\n @mensaje = Chingu::Text.new('Has encontrado todas las monedas', x: 320, y: 20, size: 25, color: Gosu::Color::GREEN)\n @mensaje2 = Chingu::Text.new('Encuentra la Meta', x: @msj_name.x, y: 45, size: 30, color: Gosu::Color::YELLOW)\n\n @music.play(true) if @sonido\n end", "title": "" } ]
[ { "docid": "e92e8859ba9a495f8a8ce17ecc6844e2", "score": "0.5879561", "text": "def valores_por_default\n \t\tself.costo ||= 0\n \tend", "title": "" }, { "docid": "8b121d3a9b7bc0164136cd7e30a93ae5", "score": "0.57018423", "text": "def set_default_status\n\t self.status = 0 \n\tend", "title": "" }, { "docid": "a33ca458bc2c454b6b0cf5360c4b96e6", "score": "0.5695524", "text": "def turno_nivel_facil\n if tem_naipe_da_rodada_ou_trunfo?\n return joga_maior_carta\n else\n return joga_menor_carta\n end\n end", "title": "" }, { "docid": "5359848dc46462d7c1b35a17101dc51f", "score": "0.5654757", "text": "def set_default_stage\n if self.stage.blank?\n self.stage = self.instance.deal_stages.where(:percent.gt => 0).sorted_by_percentage.first\n end\n end", "title": "" }, { "docid": "a21a5c6bfd63159ce14ca67959129b6b", "score": "0.5643178", "text": "def turno_nivel_normal\n if tem_naipe_da_rodada_ou_trunfo?\n if pontos_da_mesa > 0\n return joga_a_menor_carta_suficiente_para_ganhar_a_rodada\n end\n end\n joga_menor_carta\n end", "title": "" }, { "docid": "2c2afcbd4fd7657287319c00d4974178", "score": "0.5584485", "text": "def changerEnVide\n\t\t@couleur=-1\n\tend", "title": "" }, { "docid": "8d1dac9992d66608e3d517733d789a07", "score": "0.55668455", "text": "def set_default\n end", "title": "" }, { "docid": "add42526893e910f62ed731ebdbba774", "score": "0.55564135", "text": "def nivel_no_final\r\n #collect llama al bloque una vez por cada elemento del mismo y crea un nuevo arreglo que contiene los valores retornados\r\n #nivels = movimiento.collect{ |valor_pos| valor_pos.nivel }\r\n \r\n if jugador_actual == 'O'\r\n movimiento.collect{ |valor_pos| valor_pos.nivel }.min\r\n #nivels.max\r\n else\r\n movimiento.collect{ |valor_pos| valor_pos.nivel }.max\r\n end\r\n end", "title": "" }, { "docid": "6ac99d9af4191b7fab9e4ffa6b8a7da5", "score": "0.5460797", "text": "def set_defaults\n self.active ||= true\n end", "title": "" }, { "docid": "b5ad63cbd5de8533d8c54a0abed43871", "score": "0.5460125", "text": "def set_default_params\n self.difficulty = 0\n self.result = \"active\"\n self.board_size = 3\n end", "title": "" }, { "docid": "37413e45506372eada42c4e30e64cf79", "score": "0.5459086", "text": "def set_default_status\n self.status ||= :proposed\n end", "title": "" }, { "docid": "d405654ae82b17f6da124c44b6f78ecd", "score": "0.54590213", "text": "def turno_nivel_dificil\n if tem_naipe_da_rodada_ou_trunfo?\n if pontos_da_mesa > 0\n if tem_carta_maior_do_que_a_maior_carta_da_mesa?\n return joga_maior_carta\n end\n end\n end\n joga_menor_carta\n end", "title": "" }, { "docid": "7156f68c6c13b99fab2f43c634cc15c2", "score": "0.5432588", "text": "def set_defaults\n self.active ||= false\n end", "title": "" }, { "docid": "8b9337271ff2063f7e5adf2a6e3404a3", "score": "0.5379362", "text": "def default_values\n self.active ||= false\n end", "title": "" }, { "docid": "1ff8aca43ee0523e12b47ebe43da075b", "score": "0.53776497", "text": "def default_values\n self.tramito = 'Lic. Hector Hernandez Rolon' unless self.tramito\n self.autorizo = 'Dr. Salvador Becerra Rodriguez' unless self.autorizo\n end", "title": "" }, { "docid": "2f7891ddb237a97f999c7c5799620ec2", "score": "0.53693736", "text": "def bienvenida\n if session[:rol].class.to_s.eql?(\"Docente\")\n @titulo_pagina= \"Materias\"\n elsif session[:rol].class.to_s.eql?(\"Administrador\")\n @titulo_pagina= \"Administrador\" \n elsif session[:rol].class.to_s.eql?(\"Estudiante\")\n @titulo_pagina= \"Materias\" \n end\n \n end", "title": "" }, { "docid": "143537659894436d9cac0e83cafb7c10", "score": "0.53645813", "text": "def default_values\n self.state = RUNNING if self.state.blank?\n end", "title": "" }, { "docid": "143537659894436d9cac0e83cafb7c10", "score": "0.53645813", "text": "def default_values\n self.state = RUNNING if self.state.blank?\n end", "title": "" }, { "docid": "ad244bd0c45d5d9274f7612fa6fee986", "score": "0.5357303", "text": "def suivre; end", "title": "" }, { "docid": "75c6f97731702399a46b40ddc05904b3", "score": "0.53410083", "text": "def anular\n self.estado = Cancelacion::ESTADOS[:anulada]\n end", "title": "" }, { "docid": "d57a4cb1d006f85e53178a49762fe917", "score": "0.53263724", "text": "def default_values\n \t self.status ||= '0'\n \tend", "title": "" }, { "docid": "14792482b9a5961e3fe44f2d3431b0d3", "score": "0.53099346", "text": "def active=(_arg0); end", "title": "" }, { "docid": "14792482b9a5961e3fe44f2d3431b0d3", "score": "0.53099346", "text": "def active=(_arg0); end", "title": "" }, { "docid": "3b98fd1f6047a22e750ac7861adf45fe", "score": "0.5279135", "text": "def default\n self.status = \"In Progress\"\n end", "title": "" }, { "docid": "a5782bcfbaece0e1d64cb8b6ceef6c1c", "score": "0.52589417", "text": "def default_position\n self.position = (TeambuildTarget.maximum(:position) || 0) + 1\n end", "title": "" }, { "docid": "2f07d73c16577f9a8164859250f47c7f", "score": "0.52542305", "text": "def excede_control_de_pago_x_ticket_x_parlay(last_tickect_current_user, entrada) # define el monto maximo a sacar por parlay, ej. pago max para tripletas, cuartetas etc.. no por ticket sino por tipo de ticket parlay ok\n @sumatoria_posible_pago_todos_tickets_de_hoy_ese_parlay = 0 # inicializacion de variable de sumatoria en cero ok.\n #verificar tipo de parlay de ese ticket:\n parlay_count = Jugadalot.where(:ticket_id => last_tickect_current_user).count\n #parlay_count\n\n #switch case para asignar tipo de jugada segun tipo de parlay para buscar en control de pago:\n tipo_jugada = \"default\" # valor vacio para posible uso fuera de contexto de septimetas en adelante, hacer que retorne false la funcion ok. (no encontrado)\n \n #el switch case lo haremos de modo simple con el if statement por ahora ok:\n if parlay_count.to_i == 1\n tipo_jugada = \"directo\" \n end\n\n if parlay_count.to_i == 2\n tipo_jugada = \"pale\" \n end\n\n if parlay_count.to_i == 3\n tipo_jugada = \"tripleta\" \n end\n\n if parlay_count.to_i == 4\n tipo_jugada = \"cuarteta\" \n end\n\n if parlay_count.to_i == 5\n tipo_jugada = \"quinteta\" \n end\n\n if parlay_count.to_i == 6\n tipo_jugada = \"sexteta\" \n end\n\n if parlay_count.to_i == 7\n tipo_jugada = \"septimeta\" \n end\n\n if parlay_count.to_i == 8\n tipo_jugada = \"octaveta\" \n end\n\n control_monto_max_pago = Controldepagogt.where(:tipojugada => tipo_jugada ).first.limiteglobal.to_i\n\n #acabo de conseguir el limite global de ese parlay en curso, ahora buscar la sumatoria de todos las jugadalots.posiblepago de los ticket activo de hoy y ver si no sbobrepara ese limiet ok\n t_ids = Ticket.today.where(:activo => \"si\", :parlay => tipo_jugada.to_s ).ids # todos los ticket actio de hoy con ese parlay ok\n \n @listado_jugadas_a_sumar = Jugadalot.where(:ticket_id => t_ids)# POstgres casting sum string error ok..sum(:posiblepago).to_i\n \n if not @listado_jugadas_a_sumar.nil?\n @listado_jugadas_a_sumar.each do |jugada|\n @sumatoria_posible_pago_todos_tickets_de_hoy_ese_parlay += jugada.posiblepago.to_i\n end\n end\n\n \n\n #Sumar posible pago de esas jugadas de cada ticket parlay ok.\n #@sumatoria_posible_pago_todos_tickets_de_hoy_ese_parlay = 0\n #t.each do |ticket|\n # @sumatoria_posible_pago_todos_tickets_de_hoy_ese_parlay += Jugadalot.where(:ticket_id => ticket.id).last.posiblepago.to_i\n #end\n\n if @sumatoria_posible_pago_todos_tickets_de_hoy_ese_parlay.to_i <= control_monto_max_pago.to_i\n # si es menor todo ok\n false # no excede\n else\n true #si excede \n end\n\n\n end", "title": "" }, { "docid": "5a39e33e08e5bc95334774364d51aad8", "score": "0.5253626", "text": "def setNivel=(value)\r\n @nivel = value\r\n end", "title": "" }, { "docid": "af1d99657cd139eadb4e7ba4468208db", "score": "0.5250167", "text": "def default_level\n self.levels[nil]\n end", "title": "" }, { "docid": "c6cc41a369eb4c2d0cd6826b30ad69b7", "score": "0.5237361", "text": "def jugada_max\r\n movimiento.max_by{|x| x.nivel} #Devuelve el objeto de enumeración que da el valor máximo\r\n end", "title": "" }, { "docid": "ce5077d2ad44ba4378122e2b15cd6604", "score": "0.5220368", "text": "def default_current_status\n current_status ||= 'Active'\n end", "title": "" }, { "docid": "00c9ca9162c6d83b739e1b90bc3fb8bb", "score": "0.5215029", "text": "def set_defaults\n self.active = self.active.nil? ? true : self.active\n end", "title": "" }, { "docid": "00c9ca9162c6d83b739e1b90bc3fb8bb", "score": "0.5215029", "text": "def set_defaults\n self.active = self.active.nil? ? true : self.active\n end", "title": "" }, { "docid": "00c9ca9162c6d83b739e1b90bc3fb8bb", "score": "0.5215029", "text": "def set_defaults\n self.active = self.active.nil? ? true : self.active\n end", "title": "" }, { "docid": "6bdc4fbdd5ee280c63b8bfb732360713", "score": "0.52000517", "text": "def is_house_default\n self.is_master = false\n end", "title": "" }, { "docid": "07f4aba74008200310213b63a5f3de3f", "score": "0.51964766", "text": "def zuruecksetzen()\n end", "title": "" }, { "docid": "57c6be2f4e8555366f44db0fe2f3af60", "score": "0.5186068", "text": "def initial?; end", "title": "" }, { "docid": "ecf4e09ee8448343831c852d6537ee95", "score": "0.5183654", "text": "def default\n children.where(:is_default => true).order(:position_value).first\n end", "title": "" }, { "docid": "2a881facd5b607ccd640714b03f85769", "score": "0.517481", "text": "def excede_control_de_pago_x_ticket(last_tickect_current_user, entrada)\n #verificar tipo de parlay de ese ticket:\n parlay_count = Jugadalot.where(:ticket_id => last_tickect_current_user).count\n #parlay_count\n\n #switch case para asignar tipo de jugada segun tipo de parlay para buscar en control de pago:\n tipo_jugada = \"default\" # valor vacio para posible uso fuera de contexto de septimetas en adelante, hacer que retorne false la funcion ok. (no encontrado)\n \n #el switch case lo haremos de modo simple con el if statement por ahora ok:\n if parlay_count.to_i == 1\n tipo_jugada = \"directo\" \n end\n\n if parlay_count.to_i == 2\n tipo_jugada = \"pale\" \n end\n\n if parlay_count.to_i == 3\n tipo_jugada = \"tripleta\" \n end\n\n if parlay_count.to_i == 4\n tipo_jugada = \"cuarteta\" \n end\n\n if parlay_count.to_i == 5\n tipo_jugada = \"quinteta\" \n end\n\n if parlay_count.to_i == 6\n tipo_jugada = \"sexteta\" \n end\n\n if parlay_count.to_i == 7\n tipo_jugada = \"septimeta\" \n end\n\n if parlay_count.to_i == 8\n tipo_jugada = \"octaveta\" \n end\n\n control_monto_max_pago = Controldepagogt.where(:tipojugada => tipo_jugada ).first.limitexticket.to_i\n\n #verificar posible pago: riesgo\n entrada = entrada[1..(entrada.size-1)] # \"SOBREESCRIBO ESTO ASI: ..250 => .250\" ESTO PARA QUE LUEGO SE TRANSFORME DE .250 A 250 DENTRO DE LA FUNCION. REUCUERDA QUE EN ESTA SECCION DE CODIGO ENTRADA DE DE COBRO FINAL NO DE EVALUACION DE PAGO: ..250 ES DE COBRO FINAL. OK. TED.\n riesgo = procesar_posible_pago(last_tickect_current_user, entrada)# procesar_posible_pago retorna array ok ted.\n\n if (riesgo != nil) # esto para evitar errores de nil. ya no necesario porue depuramos no jugadas vacias para computar pero lo dejaremos ok. ted\n if (riesgo[1].to_i <= control_monto_max_pago)\n false # no excede ok\n else\n true # execede\n end\n end\n\n end", "title": "" }, { "docid": "e5e0d851f512ef0d6877d24593bae049", "score": "0.5155478", "text": "def default\n @default = true\n end", "title": "" }, { "docid": "af37f0e1819acb56193fc9dbdd11602d", "score": "0.51456136", "text": "def default_values\n\t\tself.status = 0\n\tend", "title": "" }, { "docid": "1b32dbfb5c4033670c1e7a8aed770154", "score": "0.51453245", "text": "def mi_carrera\n\n\tend", "title": "" }, { "docid": "cdc04a5491a032b4ac392e5f00eac730", "score": "0.51427925", "text": "def default; end", "title": "" }, { "docid": "cdc04a5491a032b4ac392e5f00eac730", "score": "0.51427925", "text": "def default; end", "title": "" }, { "docid": "8d19c5a7ff773bf998fad8e175eb5b88", "score": "0.5134611", "text": "def active; end", "title": "" }, { "docid": "8d19c5a7ff773bf998fad8e175eb5b88", "score": "0.5134611", "text": "def active; end", "title": "" }, { "docid": "ca097545995bba092374cf5ab88c48b3", "score": "0.51271755", "text": "def active?; end", "title": "" }, { "docid": "c9c0442309d18acd4d77e01fc5f89082", "score": "0.5121157", "text": "def set_default\n self.state ||= :new\n self.days ||= 365\n end", "title": "" }, { "docid": "d5103105c77abcc60f7c56feeaf0c888", "score": "0.51128775", "text": "def default_values\n\t\tself.status = false\n\tend", "title": "" }, { "docid": "a75ff0857dea76f52b125b8ed07a6a5b", "score": "0.5111825", "text": "def set_default_priority\n # ToDo Override on nomination regeneration\n self.priority_position = :last\n end", "title": "" }, { "docid": "607c31354585e9b1bc45dfdc55ed4624", "score": "0.50962484", "text": "def estado\n if titular\n \"Vendido\"\n else\n \"Sin vender\"\n end\n end", "title": "" }, { "docid": "ff8ee17d2eed0f0e2b203178af4fece7", "score": "0.50960195", "text": "def top_down\n\t\t@roof_status = \"open\" if @convertible\n\tend", "title": "" }, { "docid": "ceeb23aec8f03b7e0a9ca5c3a19a99ac", "score": "0.5093047", "text": "def set_per_nacionalidad\n self.per_nacionalidad ||= 122 if self.respond_to?(:per_nacionalidad)\n end", "title": "" }, { "docid": "330538f6b60e269433ad6e5e890a8a06", "score": "0.50884604", "text": "def set_defaults\n self.featured ||= 1\n end", "title": "" }, { "docid": "44634b5c60fe3f5ae2325d894d30cd98", "score": "0.50704247", "text": "def top_down\n\t\t@roof_status = \"open\"\n\tend", "title": "" }, { "docid": "80a3a29bf5315ddb656f67a95ea7bbcb", "score": "0.50682926", "text": "def initialize(value)\r\n @value = value\r\n @changeable = true\r\n default_value?\r\nend", "title": "" }, { "docid": "1007c73424de04a3d7a30e1bbd796de4", "score": "0.5060118", "text": "def get_default\n if self.current_defaults\n self.current_defaults.first\n else\n raise \"Cette instance ne possède de #{self.class.name} par default\"\n end\n end", "title": "" }, { "docid": "6d0fb2974214e8179a37c6526b2d9c2c", "score": "0.5049718", "text": "def stage=(_)\n Nitro.mode = :stage\n end", "title": "" }, { "docid": "e06476045786cbe4fcb2bcd3c180723b", "score": "0.5045654", "text": "def datos_default\n if new_record?\n lastRecord = MovMovimiento.last\n if lastRecord\n self.hoja = lastRecord.hoja\n end\n\n num_abonos = ComPago.where(com_compra: com_compra).count + 1\n self.concepto = \"Abono #{num_abonos} a compra \\\"#{com_compra.title}\\\"\"\n end\n end", "title": "" }, { "docid": "14e9d086ee4083b6658b4a060761a7a5", "score": "0.5043067", "text": "def default\n end", "title": "" }, { "docid": "150ffc1f446c07b1f63e2229d4ade267", "score": "0.50358635", "text": "def set_defaults\n self.completed ||= false\n end", "title": "" }, { "docid": "a637c6de2d42c0882f71e99c6eda6ce9", "score": "0.50340813", "text": "def set_defaults\n self.active = self.active.nil? ? true : self.active\n self.state ||= SystemConfig.instance.default_state_code\n end", "title": "" }, { "docid": "646a84e83da7fa67dde90854609a9470", "score": "0.50306267", "text": "def default_values\n # always uses the same elevator system\n self.elevator_system ||= ElevatorSystem.first\n # always starts on the first floor\n self.floor ||= Floor.where(number: 1).first\n end", "title": "" }, { "docid": "b131de8ef517c3377e8415442dbf3351", "score": "0.5029298", "text": "def mi_horario\n\n\tend", "title": "" }, { "docid": "a08d8e68b55d388aee71b44ca160849a", "score": "0.50283706", "text": "def default\r\n @opts[:default]\r\n end", "title": "" }, { "docid": "febaea3303b185ac5daa07e4b755104d", "score": "0.5022826", "text": "def cumple_requisitos?\n propietario.hangar.nivel >= 4 && propietario.cuenta.tecnologia_energia.nivel >= 3 && propietario.cuenta.tecnologia_laser.nivel >= 6 && super\n end", "title": "" }, { "docid": "5c262079a51acaca95d7f9d6a6980d6d", "score": "0.5020714", "text": "def default_status\n\n self.status = \"active\"\n\n end", "title": "" }, { "docid": "328a6116c823d237891c0852a9e65feb", "score": "0.5012569", "text": "def default_values\n self.mode ||= 'challenge_quick'\n end", "title": "" }, { "docid": "5e1f218c5ef458581eca2dee8e90f628", "score": "0.50124973", "text": "def default_values\n if self.status.nil?\n self.status = 1\n end\n end", "title": "" }, { "docid": "5c5774342f77b328d0ad0ebda145d553", "score": "0.5001354", "text": "def restore_mode; end", "title": "" }, { "docid": "5c5774342f77b328d0ad0ebda145d553", "score": "0.5001354", "text": "def restore_mode; end", "title": "" }, { "docid": "a5c61dd02cf98f7cfc5264204a4a2377", "score": "0.4997952", "text": "def set_default_status\n self['status'] = 'active' if status.blank?\n end", "title": "" }, { "docid": "4e5e8e9aa7242e357031eb74dba9a25e", "score": "0.49954677", "text": "def init\n \tself.mode = \"Manual\"\n \tself.status = \"Off\"\n end", "title": "" }, { "docid": "dc1b250b34cf55a287dfdcc3089a519c", "score": "0.49907705", "text": "def defaults_for_new\n self.status = 0\n end", "title": "" }, { "docid": "1c14c90f8e6e3d03ae644c597ff1e31b", "score": "0.49878696", "text": "def init\n self.current_time ||= 1800\n self.setting_time ||= 1800\n self.enabled ||= true\n self.state ||= false\n self.mode ||= 'auto'\n end", "title": "" }, { "docid": "3069f028450fff2dd319d16eb805ed1f", "score": "0.49796507", "text": "def set_default\n self.state ||= :active\n self.validity_days ||= 14\n end", "title": "" }, { "docid": "af84f62843b924838056dfa514bdc3c0", "score": "0.49779394", "text": "def default\n html = '<div class=\"menu0-div\"><ul>'\n @selected = find_selected\n level_0 = DcBigMenu.where(dc_site_id: @site._id, parent: nil, active: true).sort(order: 1).to_a\n level_0.each do |item|\n# menu can be hidden from user \n can_view, msg = dc_user_can_view(@parent, item)\n next unless can_view\n klas = item.id == @selected.id ? \"menu0-selected\" : \"menu0-item\"\n html << \"<li class='#{klas}'>#{ link_4menu(item) }</li>\\n\"\n end\n html << \"</ul></div>\"\n# submenu\n level_1 = DcBigMenu.where(dc_site_id: @site._id, parent: @selected.id, active: true).sort(order: 1).to_a\n html << \"<div class='menu1-div'><ul>\\n\"\n level_1.each do |item1|\n# menu can be hidden from user \n can_view, msg = dc_user_can_view(@parent, item1)\n next unless can_view\n html << \" <li class='menu1-item'>#{link_4menu(item1)}</li>\\n\"\n end\n html << '</ul></div>'\nend", "title": "" }, { "docid": "30858be404aadc463f81dcd378f80d17", "score": "0.49773657", "text": "def letzte_komponente\n \n end", "title": "" }, { "docid": "580939157632761ee96e11e11653d8ce", "score": "0.49758", "text": "def defaults\n self.status ||= UNKNOWN\n end", "title": "" }, { "docid": "e02d6605f0c92b0ef59db746f5e7fb21", "score": "0.49753514", "text": "def lvlres\n @level = 0\n lvlup\n end", "title": "" }, { "docid": "14bc48d7a270bf47ba283a1a39a2024b", "score": "0.49729824", "text": "def default=(_arg0); end", "title": "" }, { "docid": "cfb4c5b41522e9fca5de0b4a69846b50", "score": "0.49697214", "text": "def set_fecha\n self.fecha ||= self.fechahora_atencion if self.fechahora_atencion\n end", "title": "" }, { "docid": "eba97e4ccc9404094b074472c12d9a5e", "score": "0.4968298", "text": "def moverPrimasADespacho(cantidad_lotes)\n\t\n\nend", "title": "" }, { "docid": "2bd0f2a09ac78a4fdc728f9928ef3570", "score": "0.49637765", "text": "def defaults\n self.leaver ||= 0\n end", "title": "" }, { "docid": "5a851d3af42be5a759e4d10a8018eb66", "score": "0.49621102", "text": "def seleciona_novo_imigrante\n if (has_novo_imigrante_btn?(wait: 3))\n puts \"Selecionando novo imigrante\"\n novo_imigrante_btn.click\n selecionar_rnm(\"Não\")\n puts \"Clicando Proximo\"\n proximo_btn.click\n aguardar_carregamento_load\n end\n end", "title": "" }, { "docid": "be757b85845de38460358a4c968fd264", "score": "0.49536046", "text": "def extraer_delante\n if(@tam == 0)\n puts \"La Lista está vacía\"\n else\n aux = @cabeza\n @cabeza = @cabeza[:Next_]\n @cabeza[:prev] = nil\n @tam = @tam - 1\n return aux[:value]\n end\n end", "title": "" }, { "docid": "551b43e49a4a7539ad042257085a7d09", "score": "0.49518344", "text": "def permanent; end", "title": "" }, { "docid": "cb10e441477541d961cb8ae6186ba1a7", "score": "0.4946767", "text": "def set_default_values\n self.is_paid = false\n self.is_served = false\n self.is_preparation_started = false\n self.is_preparation_done = false\n return true\n end", "title": "" }, { "docid": "24fb481cfb4e61735fca9f7ef2059163", "score": "0.4943578", "text": "def initial\n if @default.nil?\n # no default - choose the middle option\n choices.size / 2\n elsif default_choice = choices.find_by(:name, @default)\n # found a Choice by name - use it\n choices.index(default_choice)\n else\n # default is the index number\n @default - 1\n end\n end", "title": "" }, { "docid": "de370077526ed3c633d177eb799f8cec", "score": "0.49421537", "text": "def default\n @default ||= highest\n end", "title": "" }, { "docid": "695d3681f6fd8b87311cb378d0f32a4c", "score": "0.4941195", "text": "def set_defaults\n self.active = self.active.nil? ? true : self.active\n self.estimated_cost ||= 0\n self.anticipated_cost ||= 0\n end", "title": "" }, { "docid": "96e18266f4f3afe7e0838b514124041f", "score": "0.49391344", "text": "def recolectar_una\n\t\test = \"\"\n\t\tif @estado == ESTADO::MUERTE\n\t\t\test = \"El árbol está muerto\"\n\t\telse\n\t\t\tif @contador == 0\n\t\t\t\test = \"No hay más naranjas\"\n\t\t\telse\n\t\t\t\test = \"La naranja estaba deliciosa\"\n\t\t\t\t@contador -= 1\n\t\t\tend\n\t\tend\n\t\test\n\tend", "title": "" }, { "docid": "c511cb7a921fc03d6427fc0cc315afa2", "score": "0.49315363", "text": "def initialize_current_gfx(game_type)\r\n @last_selected_gametype = game_type\r\n # reset the title\r\n initial_board_text\r\n \r\n ##initialize a current local game\r\n init_local_game(game_type)\r\n end", "title": "" }, { "docid": "3b07f86089021d5646ac48ee78b0934e", "score": "0.49290133", "text": "def set_defaults\n self.active = self.active.nil? ? true : self.active\n self.show_in_dashboard = self.show_in_dashboard.nil? ? true : self.show_in_dashboard\n self.system_activity = self.system_activity.nil? ? false : self.system_activity\n self.frequency_quantity ||= 1\n end", "title": "" }, { "docid": "199226a42f9177d9318a4b20586b53fd", "score": "0.49253005", "text": "def set_defaults\n self.active = self.active.nil? ? true : self.active\n end", "title": "" }, { "docid": "cb59022059cded49d4dc4f8c7aff6f44", "score": "0.49250185", "text": "def cmd_default\n cmd_info\n cmd_tree\n end", "title": "" }, { "docid": "5faf9ca984c09e109a73553c803bdaf9", "score": "0.49241462", "text": "def changerEnRouge\n\t\t@couleur=1\n\tend", "title": "" }, { "docid": "1b0ddc80c967bdf112a2741914266958", "score": "0.49241212", "text": "def active?; @active; end", "title": "" }, { "docid": "1b0ddc80c967bdf112a2741914266958", "score": "0.49241212", "text": "def active?; @active; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.49233106", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.49233106", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.49233106", "text": "def state; end", "title": "" } ]