query_id
stringlengths
32
32
query
stringlengths
7
6.75k
positive_passages
listlengths
1
1
negative_passages
listlengths
88
101
85055360fdf5569e0f5a36d1814242f2
vague priority ordering inferred from test suite. this will grow unwieldy if we get many more challenges.
[ { "docid": "25fcea6ea25284e5ec1db2723a106e03", "score": "0.0", "text": "def select_response\n response ||= chill! if input.shouting?\n \n # these are effectively redundant *today* but a slightly altered test suite\n # might make us glad to have them explicitly called out.\n response ||= chill! if input.shouting? && input.questioning?\n response ||= chill! if input.shouting? && input.numbers?\n response ||= chill! if input.shouting? && input.gibberish?\n\n response ||= \"Sure.\" if input.questioning?\n response ||= default_response if input.forceful?\n\n # overrides\n response = default_response if input.acronyms?\n response = 'Fine. Be that way.' unless input.letters?\n\n response || default_response\n end", "title": "" } ]
[ { "docid": "25f09fb2d8332a5b3a80138f6a137331", "score": "0.6465157", "text": "def test_priorities_basic\n expected = {:title => \"Jog\"}\n task = \"Jog\"\n priorities = {\"0\" => 0, \"!!!\" => 3, \"!2\" => 2, \"!5\" => 3}\n priorities.each{|str,p|\n title = [task,str].join(\" \")\n expected[:priority] = p\n assert_equal(expected, Autopopulate.autopopulate(title))\n }\n end", "title": "" }, { "docid": "169182cdb78de5f4c93943de92b336c4", "score": "0.64160776", "text": "def test_order; end", "title": "" }, { "docid": "169182cdb78de5f4c93943de92b336c4", "score": "0.64160776", "text": "def test_order; end", "title": "" }, { "docid": "cd69fbd0525d6bccf2c04d3da7440655", "score": "0.6277673", "text": "def test_order\n CoreExt.test_order ||= :random\n end", "title": "" }, { "docid": "64fc2cd28ba39d77ca6c4b92c5bb2bd6", "score": "0.6103971", "text": "def get_sorted_tactics\n return tactics.order(\"priority DESC\")\n end", "title": "" }, { "docid": "2185a74bf1016d98651cd313f365e011", "score": "0.61004716", "text": "def test_play_always_pick_unsorted\n faceoff = contests(:faceoff_optimization)\n 3.times {|i| e = faceoff.entries.build(:title => \"#{i}\", :description => 'boo'); e.user_id = faceoff.user_id; e.save}\n faceoff.approve(users(:an_admin))\n assert_equal 3, faceoff.questions.count\n\n user = users(:a_user)\n get :play, {:id => faceoff.id }, {:user => user}\n question = assigns['question']\n contest_response = assigns['contest_response']\n #p contest_response.ranked_entries.each {|e| p \"#{e.id} #{e.points} #{e.sorted}\" }\n assert_not_nil question\n assert_not_nil contest_response\n assert_equal 1, contest_response.ranked_entries.sorted(:all).size\n assert_equal 2, contest_response.ranked_entries.count\n assert_equal 1, contest_response.ranked_entries.unsorted(:all).size\n\n e1, e2 = question.entries.first, question.entries.last\n unsorted_entry = contest_response.ranked_entries.find_by_entry_id(contest_response.ranked_entries.find_by_entry_id(e1.id).sorted? ? e2.id : e1.id)\n sorted_entry = contest_response.ranked_entries.find_by_entry_id(contest_response.ranked_entries.find_by_entry_id(e1.id).sorted? ? e1.id : e2.id)\n a,b = sorted_entry, unsorted_entry\n\n assert a.sorted?\n assert !b.sorted?\n assert_equal 0, a.points\n assert_equal 0, b.points\n assert_equal 0, a.lower_bound\n assert_equal 0, b.lower_bound\n assert_equal 0, a.upper_bound\n assert_equal 1, b.upper_bound\n\n post :answer, {:id => faceoff.id, :question_id => question.id, :answer => {:question_option_id => question.options.find_by_entry_id(b.entry_id).id} }, {:user => user}\n b.reload\n #assert_equal 1, b.lower_bound\n #assert_equal a.points + 1, b.lower_bound\n #assert_equal 1, b.upper_bound\n assert_equal 1, b.points\n assert b.sorted?\n\n get :play, {:id => faceoff.id }, {:user => user}\n question = assigns['question']\n contest_response = assigns['contest_response']\n\n e1, e2 = question.entries.first, question.entries.last\n unsorted_entry = contest_response.ranked_entries.find_by_entry_id(contest_response.ranked_entries.find_by_entry_id(e1.id).sorted? ? e2.id : e1.id)\n sorted_entry = contest_response.ranked_entries.find_by_entry_id(contest_response.ranked_entries.find_by_entry_id(e1.id).sorted? ? e1.id : e2.id)\n c = unsorted_entry\n assert_equal 2, contest_response.ranked_entries.sorted(:all).size\n assert !c.sorted?\n assert_equal b, sorted_entry\n assert_equal 1, b.points\n assert_equal 0, c.lower_bound\n assert_equal 2, c.upper_bound\n\n post :answer, {:id => faceoff.id, :question_id => question.id, :answer => {:question_option_id => question.options.find_by_entry_id(unsorted_entry.entry_id).id} }, {:user => user}\n\n c.reload\n assert_equal 1, b.points\n #assert_equal 1, c.lower_bound\n #assert_equal 3, c.upper_bound\n assert_equal 2, c.points\n assert c.sorted?\n\n get :play, {:id => faceoff.id }, {:user => user}\n unsorted_entry.reload\n assert unsorted_entry.sorted?\n end", "title": "" }, { "docid": "3e5f1f9e17b8f9b67adca7d172618b7e", "score": "0.6079218", "text": "def order(tests)\n tests\n end", "title": "" }, { "docid": "08ac54d7e6efe272caf1c0a1a39c2d86", "score": "0.6074904", "text": "def test_asc_by_heuristics\n assert_heuristics({\n \"AsciiDoc\" => \"AsciiDoc/list.asc\",\n \"AGS Script\" => \"AGS Script/GlobalScript.asc\",\n \"Public Key\" => all_fixtures(\"Public Key\", \"*.asc\")\n })\n end", "title": "" }, { "docid": "b2a562669bcbf4b5dae8136e59d09462", "score": "0.6034527", "text": "def test_play_always_pick_sorted\n faceoff = contests(:faceoff_optimization)\n 3.times {|i| e = faceoff.entries.build(:title => \"#{i}\", :description => 'boo'); e.user_id = faceoff.user_id; e.save}\n faceoff.approve(users(:an_admin))\n assert_equal 3, faceoff.questions.count\n\n user = users(:a_user)\n get :play, {:id => faceoff.id }, {:user => user}\n question = assigns['question']\n contest_response = assigns['contest_response']\n assert_not_nil question\n assert_not_nil contest_response\n assert_equal 2, contest_response.ranked_entries.count\n assert_equal 1, contest_response.ranked_entries.unsorted(:all).size\n\n e1, e2 = question.entries.first, question.entries.last\n sorted_entry = contest_response.ranked_entries.find_by_entry_id(contest_response.ranked_entries.find_by_entry_id(e1.id).sorted? ? e1.id : e2.id)\n unsorted_entry = contest_response.ranked_entries.find_by_entry_id(contest_response.ranked_entries.find_by_entry_id(e1.id).sorted? ? e2.id : e1.id)\n a, b = sorted_entry, unsorted_entry\n\n #assert_equal -1, sorted_entry.lower_bound\n #assert_equal 1000000, sorted_entry.upper_bound\n assert_equal 0, a.points\n assert a.sorted?\n assert !b.sorted?\n assert_equal 0, b.lower_bound\n assert_equal 1, b.upper_bound\n\n post :answer, {:id => faceoff.id, :question_id => question.id, :answer => {:question_option_id => question.options.find_by_entry_id(a.entry_id).id} }, {:user => user}\n b.reload\n a.reload\n assert_equal 0, b.points\n assert_equal 1, a.points\n\n end", "title": "" }, { "docid": "255314ccbf4f7aedb5cc706702642f77", "score": "0.60255", "text": "def priority; end", "title": "" }, { "docid": "255314ccbf4f7aedb5cc706702642f77", "score": "0.60255", "text": "def priority; end", "title": "" }, { "docid": "255314ccbf4f7aedb5cc706702642f77", "score": "0.60255", "text": "def priority; end", "title": "" }, { "docid": "f3f92a1d757d7a2021ea3e8002c2257f", "score": "0.601561", "text": "def test_order\n ancestors.each do |ancestor|\n order = @@test_orders[ancestor]\n return order if order\n end\n AVAILABLE_ORDERS.first\n end", "title": "" }, { "docid": "8842c8161c1364cd3abf2d5c995731b6", "score": "0.59616286", "text": "def order\n question\n answer\n switch_players\n score\n end", "title": "" }, { "docid": "5f2f8c63089fe4a5d2892c3a1b08e049", "score": "0.59539044", "text": "def test_order\n ActiveSupport.test_order ||= :random\n end", "title": "" }, { "docid": "5f2f8c63089fe4a5d2892c3a1b08e049", "score": "0.59539044", "text": "def test_order\n ActiveSupport.test_order ||= :random\n end", "title": "" }, { "docid": "5f2f8c63089fe4a5d2892c3a1b08e049", "score": "0.59539044", "text": "def test_order\n ActiveSupport.test_order ||= :random\n end", "title": "" }, { "docid": "2a4870e4c5aee831c7dcda2460b2a60f", "score": "0.59163505", "text": "def priorities\n self.collect{|issue| issue.priority}.uniq.sort\n end", "title": "" }, { "docid": "1092faa4d5d26590758b50f2fd280257", "score": "0.5855144", "text": "def winners\n case self.algorithm\n when \"majority\" then majority\n # and so on...\n else\n majority\n end\n end", "title": "" }, { "docid": "ab2ff0a8b921818168a68b8e3a8be96d", "score": "0.58399725", "text": "def test_order\n test_order = ActiveSupport.test_order\n\n if test_order.nil?\n ActiveSupport::Deprecation.warn \"You did not specify a value for the \" \\\n \"configuration option `active_support.test_order`. In Rails 5, \" \\\n \"the default value of this option will change from `:sorted` to \" \\\n \"`:random`.\\n\" \\\n \"To disable this warning and keep the current behavior, you can add \" \\\n \"the following line to your `config/environments/test.rb`:\\n\" \\\n \"\\n\" \\\n \" Rails.application.configure do\\n\" \\\n \" config.active_support.test_order = :sorted\\n\" \\\n \" end\\n\" \\\n \"\\n\" \\\n \"Alternatively, you can opt into the future behavior by setting this \" \\\n \"option to `:random`.\"\n\n test_order = :sorted\n self.test_order = test_order\n end\n\n test_order\n end", "title": "" }, { "docid": "d2531742730b09724c82b695cff85bbe", "score": "0.58390385", "text": "def claims_order_working\n claims.working.order( 'priority ASC' )\n end", "title": "" }, { "docid": "5de0035c568f28c50b31aa0040c8e021", "score": "0.5794447", "text": "def collect_compare_priority\n @compare_quque = []\n @compare_quque = ComparisonTable.sort_by{|k, dar|\n DisplayOrder[StringTable[dar.first]] ? DisplayOrder[StringTable[dar.first]] : DisplayOrder[MISC_text]\n }.collect{|p| p[0]}\n end", "title": "" }, { "docid": "f080d12ed45e899cf96201581a1b3c9b", "score": "0.57777345", "text": "def priority\n end", "title": "" }, { "docid": "6f096e4381eddca48b776fd3043862f4", "score": "0.5755061", "text": "def applicable_experiments input\n experiments.select{|e| e.applicable?(input)}.sort_by{|e| e.priority}\n end", "title": "" }, { "docid": "399ef74d9908e53ce94f8f66cd1bfecb", "score": "0.57377744", "text": "def useable_order\n defaults = self.class.default_order\n intersection = order & defaults\n\n if intersection.length != defaults.length\n # Merge specified options with those missing.\n intersection.concat(defaults - intersection)\n end\n\n intersection\n end", "title": "" }, { "docid": "9dff406fdb896cc4a474928cbdafb542", "score": "0.57310915", "text": "def expected_order_of_new_questions\n [\n \"UIN-#{Time.zone.today.strftime('%m%d')}:no_response-11\",\n \"UIN-#{Time.zone.today.strftime('%m%d')}:rejected-21\",\n \"UIN-#{Time.zone.today.strftime('%m%d')}:unassigned-01\",\n \"UIN-#{Date.tomorrow.strftime('%m%d')}:no_response-12\",\n \"UIN-#{Date.tomorrow.strftime('%m%d')}:rejected-22\",\n \"UIN-#{Date.tomorrow.strftime('%m%d')}:unassigned-02\",\n \"UIN-#{Date.yesterday.strftime('%m%d')}:no_response-10\",\n \"UIN-#{Date.yesterday.strftime('%m%d')}:rejected-20\",\n \"UIN-#{Date.yesterday.strftime('%m%d')}:unassigned-00\",\n ]\nend", "title": "" }, { "docid": "84301e4012d38815fa10ba12df130a3a", "score": "0.57221115", "text": "def priority\r\n return 50\r\n end", "title": "" }, { "docid": "85655de225122569675db0e4e8001999", "score": "0.57136405", "text": "def test_pp_by_heuristics\n assert_heuristics({\n \"Pascal\" => all_fixtures(\"Pascal\", \"*.pp\"),\n \"Puppet\" => all_fixtures(\"Puppet\", \"*.pp\") - [\"#{samples_path}/Puppet/stages-example.pp\", \"#{samples_path}/Puppet/hiera_include.pp\"]\n })\n end", "title": "" }, { "docid": "de2cf9de0b6479bf338cb77a8c6a41e6", "score": "0.5688469", "text": "def follow_on_priority\n default_priority\n end", "title": "" }, { "docid": "288975bb654deeb64ce92cc3b5996244", "score": "0.5683564", "text": "def match_when_sorted?; end", "title": "" }, { "docid": "5b4e834c99cff69056ab6eccb4d7283a", "score": "0.5670469", "text": "def _priority; @priority || 0; end", "title": "" }, { "docid": "d8978880aca2cfc69d7c0878318b3734", "score": "0.56580323", "text": "def next_priority\n self.matching_project_and_iteration.count + 1\n end", "title": "" }, { "docid": "ce07d730b846ad3c9b5f15b6dba43eb9", "score": "0.56517774", "text": "def get_benefits_order priority\n benefits_order = ['consolidate', 'fix-rates', 'incorrect-parts', 'service-calls', 'happier-customers']\n case priority\n when \"Optimize Fleets\"\n return benefits_order.insert(0, benefits_order.delete('consolidate'))\n when \"Improve Time to Repair\"\n return benefits_order.insert(0, benefits_order.delete('service-calls'))\n when \"Reducing Incorrect Part\"\n return benefits_order.insert(0, benefits_order.delete('incorrect-parts'))\n when \"Happy Customers\"\n return benefits_order.insert(0, benefits_order.delete('happier-customers'))\n when \"Return Visits\"\n return benefits_order.insert(0, benefits_order.delete('fix-rates'))\n else\n return benefits_order\n end\n end", "title": "" }, { "docid": "594bf77c6c675eb2284ead6cc8ff36a1", "score": "0.5642435", "text": "def order_of_keys\n %w(\n CVE\n yaml_instructions\n curated_instructions\n curated\n reported_instructions\n reported\n announced_instructions\n announced\n published_instructions\n published\n description_instructions\n description\n bounty_instructions\n bounty\n reviews\n bugs\n repo\n fixes_vcc_instructions\n fixes\n vccs\n upvotes_instructions\n upvotes\n unit_tested\n discovered\n autodiscoverable\n specification\n subsystem\n interesting_commits\n i18n\n ipc\n lessons\n mistakes\n CWE_instructions\n CWE\n CWE_note\n nickname_instructions\n nickname\n )\nend", "title": "" }, { "docid": "66627177646d1ceb9f70d9440a719501", "score": "0.56421196", "text": "def order; end", "title": "" }, { "docid": "3429a50b04e9ae99de871a00e907cc78", "score": "0.56409025", "text": "def test_hack_by_heuristics\n assert_heuristics({\n \"Hack\" => \"Hack/funs.php\",\n \"PHP\" => \"PHP/Model.php\"\n })\n end", "title": "" }, { "docid": "b22b3546c20a91573ef3c2c8c18b3a0f", "score": "0.5631035", "text": "def main_sort_running_order; end", "title": "" }, { "docid": "9fe0f82d1f2f13285520e53ee3b51af3", "score": "0.56126606", "text": "def default_priority\n 2\n end", "title": "" }, { "docid": "393566cffbdf797eaaf663d6296da188", "score": "0.56074125", "text": "def priority_compare(other); end", "title": "" }, { "docid": "46fb878bb7eb85ca460b23044328509a", "score": "0.5604754", "text": "def order_only_prerequisites; end", "title": "" }, { "docid": "0f75d58d666f44db54828ac3b0373c8f", "score": "0.5586289", "text": "def valid_ordering?(proposed_ordering)\n achievements_hash.keys.sort == proposed_ordering.sort\n end", "title": "" }, { "docid": "765ebd85cebcff1f1ee31bdd1b10003f", "score": "0.55704147", "text": "def priority\n self_score = ( self.type.to_s =~ /Trade/ ) ? 40 : 0\n self_score += ( self.type =~ /IsWaitingForApproval/ ) ? 60 : 0\n self_score += 10 if self.expires_at && self.expires_at - Time.now < 6.hours\n self_score += 20 if self.waiting?\n self_score += 100 if self.starred\n self_score\n end", "title": "" }, { "docid": "0b679094c24c5cc2532ed0a78c06c36d", "score": "0.5567275", "text": "def priority\n sites = %w[\n Pixiv Twitter\n Anifty ArtStation Baraag Bilibili BCY Booth Deviant\\ Art Fantia Foundation Furaffinity Hentai\\ Foundry Lofter Newgrounds Nico\\ Seiga Nijie Pawoo Fanbox Pixiv\\ Sketch Plurk Reddit Skeb Tinami Tumblr Weibo Misskey.io Misskey.art Misskey.design\n Ask.fm Facebook FC2 Gumroad Instagram Ko-fi Livedoor Mihuashi Mixi.jp Patreon Piapro.jp Picarto Privatter Sakura.ne.jp Stickam Twitch Youtube\n Amazon Circle.ms DLSite Doujinshi.org Erogamescape Mangaupdates Melonbooks Toranoana Wikipedia\n ]\n\n sites.index(site_name) || 1000\n end", "title": "" }, { "docid": "39fa0979961594bb22534264f06d8829", "score": "0.5566172", "text": "def winning_strategies; end", "title": "" }, { "docid": "c2a5b45793a2e99123ce44f1669c67ee", "score": "0.5562757", "text": "def order_of_keys\n\n %w(\n CVE\n yaml_instructions\n curated_instructions\n curation_level\n reported_instructions\n reported\n announced_instructions\n announced\n published_instructions\n published\n description_instructions\n description\n bounty_instructions\n bounty\n reviews\n bugs\n repo\n fixes_vcc_instructions\n fixes\n vccs\n upvotes_instructions\n upvotes\n unit_tested\n discovered\n autodiscoverable\n specification\n subsystem\n interesting_commits\n i18n\n ipc\n lessons\n mistakes\n CWE_instructions\n CWE\n CWE_note\n nickname_instructions\n nickname\n )\nend", "title": "" }, { "docid": "b6ad242428e4cc433c8b13d8511fe36b", "score": "0.5555671", "text": "def test_priority\n assert_equal(0, @thread.priority) # The default\n assert_nothing_raised{ @thread.priority = 5 }\n assert_equal(5, @thread.priority)\n end", "title": "" }, { "docid": "2d061ed91b7b0ac2412beb22541811cb", "score": "0.5555016", "text": "def sort_key\n main = case overall_state\n when :acceptable then\n 0\n when :review then\n 10000 - review_percentage * 100\n when :testing then\n 20000 - testing_percentage * 100\n when :building then\n 30000 - build_progress[:percentage] * 100\n when :failed then\n 40000\n when :unacceptable then\n 50000\n when :empty\n 60000\n else\n Rails.logger.error \"untracked #{overall_state}\"\n return\n end\n main + letter.ord()\n end", "title": "" }, { "docid": "c9ab58c44292d51e2addd728bc7178d9", "score": "0.5551822", "text": "def test_pro_by_heuristics\n assert_heuristics({\n \"Prolog\" => all_fixtures(\"Prolog\", \"*.pro\"),\n \"IDL\" => all_fixtures(\"IDL\", \"*.pro\"),\n \"INI\" => all_fixtures(\"INI\", \"*.pro\"),\n \"QMake\" => all_fixtures(\"QMake\", \"*.pro\")\n })\n end", "title": "" }, { "docid": "2dff6596c87a244e7af84893c446cb62", "score": "0.5540542", "text": "def ensure_ranks\n # sort the option settings by existing rank and then re-assign to ensure sequentialness\n # if the options are already sorted this way, nothing will change\n # if a rank is null, we sort it to the end\n optionings.sort_by{|o| o.rank || 10000000}.each_with_index{|o, idx| o.rank = idx + 1}\n end", "title": "" }, { "docid": "15df9f2f22612eaabb430dba65116e01", "score": "0.55369735", "text": "def test_php_by_heuristics\n assert_heuristics({\n \"Hack\" => all_fixtures(\"Hack\", \"*.php\"),\n \"PHP\" => all_fixtures(\"PHP\", \"*.php\")\n })\n end", "title": "" }, { "docid": "c2c9ff6382f5b300f039977e64b0759b", "score": "0.55268455", "text": "def run_order\n -5\n end", "title": "" }, { "docid": "c2c9ff6382f5b300f039977e64b0759b", "score": "0.55268455", "text": "def run_order\n -5\n end", "title": "" }, { "docid": "90b5012f0a315d9e8f30507cb5fcb05a", "score": "0.55247736", "text": "def criteria\n (option_pairs + extra_option_pairs).sort\n end", "title": "" }, { "docid": "8ab759b290f6d98ade826141faa565e8", "score": "0.5515157", "text": "def test_collection_order\n items = collection_order([\"shoe lace\",\"rusty nail\",\"leg warmers\"])\n assert_equal([\"c1\", \"c9\", \"c10\"], items)\n items = collection_order([\"hanger\",\"deodorant\",\"candy wrapper\", \"rubber band\"])\n assert_equal([\"a10\",\"a4\",\"c8\",\"b9\"], items)\n end", "title": "" }, { "docid": "5063be79aee0a627cb3225dc73b7de22", "score": "0.55147606", "text": "def test_top_matches_inverted\n movies = Recommendation.transform_prefs(@critics)\n assert_equal Recommendation.top_matches(movies,'Superman Returns'),\n [[0.6579516949597695, \"You, Me and Dupree\"], [0.4879500364742689, \"Lady in the Water\"], [0.11180339887498941, \"Snakes on a Plane\"], \n [-0.1798471947990544, \"The Night Listener\"], [-0.42289003161103106, \"Just My Luck\"]]\n end", "title": "" }, { "docid": "badd68b4d74b32afcfdbc0accb586440", "score": "0.55086", "text": "def players_order\n names = @game.players.collect {|player| player.name}\n puts \"The player order based on highest population on each hand (first means first turn or player 1): \" + names.to_s\n end", "title": "" }, { "docid": "85c52cf184b23a59f7af32d6e5ccc4e9", "score": "0.54903525", "text": "def order_of_keys\n %w(\n CVE\n yaml_instructions\n curated_instructions\n curated\n reported_instructions\n reported_date\n announced_instructions\n announced_date\n published_instructions\n published_date\n description_instructions\n description\n bounty_instructions\n bounty\n reviews\n bugs\n repo\n fixes_vcc_instructions\n fixes\n vccs\n upvotes_instructions\n upvotes\n unit_tested\n discovered\n autodiscoverable\n specification\n subsystem\n interesting_commits\n i18n\n ipc\n lessons\n mistakes\n CWE_instructions\n CWE\n CWE_note\n nickname_instructions\n nickname\n )\nend", "title": "" }, { "docid": "f77583df9020c3a5bb742e32a044d374", "score": "0.54884946", "text": "def applicable_experiments input\n experiments.select{|e| e.applicable?(input)}.sort_by{|e| e.priority}\n end", "title": "" }, { "docid": "d6ddbde0bc426340948e04c2c24aded9", "score": "0.54879296", "text": "def order_of_keys\n %w(\n CVE\n yaml_instructions\n curated_instructions\n curated\n reported_instructions\n reported_date\n announced_instructions\n announced_date\n published_instructions\n published_date\n description_instructions\n description\n bounty_instructions\n bounty\n reviews\n bugs\n repo\n fixes_vcc_instructions\n fixes\n vccs\n upvotes_instructions\n upvotes\n unit_tested\n discovered\n autodiscoverable\n specification\n subsystem\n interesting_commits\n i18n\n sandbox\n ipc\n lessons\n mistakes\n CWE_instructions\n CWE\n CWE_note\n nickname_instructions\n nickname\n )\nend", "title": "" }, { "docid": "22b4e52f3d7989fc2a36eb85e1ebbcdf", "score": "0.5477172", "text": "def solve_naive(reqs)\n order = ''\n reqs = reqs.dup\n\n to_be_done = (reqs.map { |r| r[0] } + reqs.map{ |r| r[1] }).uniq\n while !to_be_done.empty? do\n cannot_be_done = reqs.map { |r| r[1] }.uniq\n\n done = (to_be_done - cannot_be_done).sort.first\n order << done\n\n to_be_done.delete(done)\n reqs.delete_if { |r| r[0] == done }\n end\n\n return order\nend", "title": "" }, { "docid": "159d8004685e8944907833f9e84def81", "score": "0.54743576", "text": "def compatibility_generator(user)\n ranking = 0\n compatiblilty_hash = {\n \"aries\" => {\n favorable: [\"aries\", \"leo\", \"sagittarius\", \"gemini\", \"aquarius\"],\n negative: [\"taurus\", \"virgo\", \"capricorn\", \"cancer\"],\n },\n \"taurus\" => {\n favorable: [\"taurus\", \"virgo\", \"capricorn\", \"cancer\", \"scorpio\", \"pisces\"],\n negative: [\"aries\", \"sagittarius\", \"gemini\", \"aquarius\"],\n },\n \"gemini\" => {\n favorable: [\"aries\", \"leo\", \"sagittarius\", \"gemini\", \"libra\", \"aquarius\"],\n negative: [\"taurus\", \"virgo\", \"capricorn\", \"cancer\", \"scorpio\", \"pisces\"],\n },\n \"cancer\" => {\n favorable: [\"taurus\", \"virgo\", \"capricorn\", \"cancer\", \"scorpio\", \"pisces\"],\n negative: [\"aries\", \"gemini\", \"libra\", \"aquarius\"],\n },\n \"leo\" => {\n favorable: [\"aries\", \"leo\", \"sagittarius\", \"gemini\", \"libra\", \"aquarius\"],\n negative: [],\n },\n \"virgo\" => {\n favorable: [\"taurus\", \"virgo\", \"capricorn\", \"cancer\", \"scorpio\"],\n negative: [\"leo\", \"sagittarius\", \"libra\", \"aquarius\"],\n },\n \"libra\" => {\n favorable: [\"aries\", \"leo\", \"sagittarius\", \"gemini\", \"libra\", \"aquarius\"],\n negative: [\"virgo\", \"cancer\", \"scorpio\", \"pisces\"],\n },\n \"scorpio\" => {\n favorable: [\"taurus\", \"virgo\", \"capricorn\", \"cancer\", \"scorpio\", \"pisces\"],\n negative: [\"aries\", \"gemini\", \"libra\"],\n },\n \"sagittarius\" => {\n favorable: [\"aries\", \"leo\", \"sagittarius\", \"libra\", \"aquarius\"],\n negative: [\"taurus\", \"virgo\", \"capricorn\", \"scorpio\"],\n },\n \"capricorn\" => {\n favorable: [\"taurus\", \"virgo\", \"capricorn\", \"cancer\", \"scorpio\", \"pisces\"],\n negative: [\"aries\", \"leo\", \"sagittarius\", \"libra\", \"aquarius\"],\n },\n \"aquarius\" => {\n favorable: [\"aries\", \"sagittarius\", \"gemini\", \"libra\", \"aquarius\"],\n negative: [\"taurus\", \"capricorn\", \"cancer\", \"scorpio\", \"pisces\"],\n },\n \"pisces\" => {\n favorable: [\"taurus\", \"capricorn\", \"cancer\", \"scorpio\", \"pisces\"],\n negative: [\"gemini\"],\n },\n }\n # if compatiblilty_hash[user.sun]\n # ranking += 1\n # elsif compatiblilty_hash[user.sun].negative.include?(sun)\n # ranking -= 1\n # end\n ranking = compatiblilty_hash[user.sun]\n end", "title": "" }, { "docid": "ae5c9dd16d26e3c4aad965dfa9923cd6", "score": "0.54713845", "text": "def step_match_with_priority(*args)\n step_match_without_priority(*args)\n rescue Ambiguous => e\n resolve_ambiguity_through_priority(e).first\n end", "title": "" }, { "docid": "c4764b47b0b793e10dd668d6c416c9c6", "score": "0.54525256", "text": "def ordered_by_qualifications(candidates)\n candidates_array = []\n candidates.each do |candidate|\n candidates_array.push(candidate)\n end\n\n pp candidates_array.sort_by {|person| person[:years_of_experience] || person[:github_points]}.reverse\n\nend", "title": "" }, { "docid": "1987593782947cb3cc699a3ccdc80bd3", "score": "0.5442224", "text": "def test_challenge_35\n # uno\n # dos\n tres\n end", "title": "" }, { "docid": "401213264dbff7322e6029e99dbd6927", "score": "0.5440249", "text": "def struggle_priority\n GameData::Skill[ID_Struggle].priority * DeltaPrio\n end", "title": "" }, { "docid": "e4989de208e12c4abba7d41e5418bce1", "score": "0.54382616", "text": "def by_priority\n @rules.sort_by(&:priority)\n end", "title": "" }, { "docid": "14e2e2ffda6998104645c13260503635", "score": "0.54229194", "text": "def setup_expected_score\n @players.each do |player|\n @expected_scores += get_meta_from_config_list(@levels_config, player.nivel)\n end\n end", "title": "" }, { "docid": "e8bbc0d6a6e66d3ce57e4782919a7f48", "score": "0.5422783", "text": "def ranked_answers\n\t\tanswers.sort {|a,b| b.score <=> a.score }\n\tend", "title": "" }, { "docid": "30cb080f8279c398b438842c306632f6", "score": "0.5417044", "text": "def getStepOrder(steps, letter, order)\n steps.each do |_step|\n order += 1 if _step['prerequisites'].include? letter\n end\n order\nend", "title": "" }, { "docid": "be67a0db9ec2db8cbc42d4df1a226bbd", "score": "0.5416941", "text": "def priority=(_arg0); end", "title": "" }, { "docid": "c1afd9bc9dcaee7671124b6ba80692df", "score": "0.54116106", "text": "def sort_jugglers(circuit_jugglers)\n circuit_jugglers.each do |course, jugglers|\n sorted_jugglers = jugglers.sort! do |x,y|\n # get x juggler's score\n jug_x_score = x[:scores][y[:current_pref]].values[0]\n # get y juggler's score\n jug_y_score = y[:scores][y[:current_pref]].values[0]\n\n # if the scores are equal, the juggler who's preference for this course\n # is higher wins\n if jug_y_score == jug_x_score \n y[:current_pref] <=> x[:current_pref]\n else\n jug_y_score <=> jug_x_score\n end\n end\n end\n end", "title": "" }, { "docid": "6d34fe2c72adabafa23a5eeb6e210413", "score": "0.5400532", "text": "def priority\n raise NotDefinedError\n end", "title": "" }, { "docid": "f7a1222246c49cf8d3bf02e2c82b6d40", "score": "0.5392624", "text": "def priority_map\n {\n EducatorsImporter => 0,\n CoursesSectionsImporter => 1,\n EducatorSectionAssignmentsImporter => 2,\n StudentsImporter => 3,\n StudentSectionAssignmentsImporter => 4,\n BehaviorImporter => 5,\n AttendanceImporter => 5,\n StudentSectionGradesImporter => 5,\n X2AssessmentImporter => 6,\n StarMathImporter => 6,\n StarReadingImporter => 6,\n EdPlansImporter => 7,\n EdPlanAccommodationsImporter => 8,\n StudentVoiceSurveyImporter => 9,\n ReadingBenchmarkSheetsImporter => 10,\n TeamMembershipImporter => 11\n }\n end", "title": "" }, { "docid": "9aa21c54e48e63d5d256f4b18d6a5ed2", "score": "0.53925365", "text": "def _prefered_order\n @insert_order || []\n end", "title": "" }, { "docid": "0d215cef49a0585d011c923af9fa1ba3", "score": "0.53887016", "text": "def process_order_LUT\n {Research: 1,\n Analyze: 2,\n Ideate: 3,\n Build: 4,\n Communicate: 5}\n end", "title": "" }, { "docid": "70ed4c7b7a6efed300dd0b68ea5bc43a", "score": "0.53873676", "text": "def valid_ordering?(proposed_ordering)\n questions_hash.keys.sort == proposed_ordering.sort\n end", "title": "" }, { "docid": "489b7b5e67fc10512a1b66aeb770f097", "score": "0.5386362", "text": "def sort_possible_attacks\n attack_priority = { king: 1, queen: 2, rook: 3, bishop: 4, knight: 5, pawn: 6 }\n piece_names = { \"♚\" => :king, \"♛\" => :queen, \"♜\" => :rook, \"♝\" => :bishop, \"♞\" => :knight, \"♟\" => :pawn }\n \n attacks_array = to_a(possible_attacks)\n attacks_array.sort_by do |start_pos, end_pos|\n enemy_piece = @board[end_pos]\n piece_name = piece_names[enemy_piece.symbol]\n attack_priority[piece_name]\n end\n end", "title": "" }, { "docid": "dd1cea480f42352526ed2628e0229245", "score": "0.5385619", "text": "def priorities\n p = company.priorities # see priorities.rb in lib\n end", "title": "" }, { "docid": "e26fb5b8a0de2d75faf8cda4ccfa25e9", "score": "0.53853124", "text": "def test_priorities_with_punctuation\n title = \"Jog !.\"\n expected = {:title => \"Jog\", :priority => 1}\n assert_equal(expected, Autopopulate.autopopulate(title))\n \n title = \"!1 Jog.\"\n expected = {:title => \"Jog.\", :priority => 1} \n assert_equal(expected, Autopopulate.autopopulate(title))\n \n title = \"!!!, Jog\"\n expected = {:title => \"Jog\", :priority => 3}\n assert_equal(expected, Autopopulate.autopopulate(title)) \n \n title = \"Jog.!!!\"\n expected = {:title => \"Jog\", :priority => 3}\n assert_equal(expected, Autopopulate.autopopulate(title)) \n\n title = \"Jog (!!!) slowly\"\n expected = {:title => \"Jog slowly\", :priority => 3}\n assert_equal(expected, Autopopulate.autopopulate(title)) \n end", "title": "" }, { "docid": "b26dad243fdaf7e3f5fe56fc0021d680", "score": "0.53843707", "text": "def get_priorities\n result = get('get_priorities')\n\n result.collect do |priority|\n TestRail::Priority.new(priority.merge({ :api => self }))\n end\n end", "title": "" }, { "docid": "9de5ea8e20eb10db8135e9aebdaeaad6", "score": "0.53832155", "text": "def find_order(num_courses, prereqs)\n prereqs_hash = {}\n indegree = Array.new(num_courses, 0)\n\n prereqs.each do |(course, prereq)|\n indegree[course] += 1\n\n if prereqs_hash[prereq]\n prereqs_hash[prereq] << course\n else\n prereqs_hash[prereq] = [course]\n end\n end\n\n class_order = []\n queue = []\n\n indegree.each_with_index do |degree, course|\n queue << course if degree == 0\n end\n\n until queue.empty?\n current_course = queue.shift\n\n class_order << current_course\n\n if prereqs_hash[current_course]\n prereqs_hash[current_course].each do |course| \n indegree[course] -= 1\n queue << course if indegree[course] == 0\n end\n end\n end\n\n indegree.select {|degree| degree > 0}.any? ? [] : class_order\nend", "title": "" }, { "docid": "622dd8568c81e9c4bd40f483649057c7", "score": "0.53802365", "text": "def problem_order?\n problem\n end", "title": "" }, { "docid": "bcaebdec1fb06c501468bb4dfc51a52f", "score": "0.53787315", "text": "def custom_order\n return proc do |command_output|\n case command_output.first\n when /modular/ then 1\n when /classic/ then 2\n when /tests/ then 3\n else 4\n end\n end\n end", "title": "" }, { "docid": "92a5f539b452d67867b1d6a60b4a7dc1", "score": "0.5370434", "text": "def run_order\n -10\n end", "title": "" }, { "docid": "50fe6b4250bb7d72464b74d9daf036f4", "score": "0.5368734", "text": "def test_as_ordered_each_exclusivity_group\n\t\tgroups = []\n\t\tcandy = Candy.acts_as_ordered_each_exclusivity_group do |group|\n\t\t\tgroups << group\n\t\tend\n\n\t\tassert_equal 0.upto(4).collect{|i| 0.upto(9).collect{|j| i*10 + j }}.to_a, groups.collect{|g| g.collect{|c| c.id} }.sort{|x,y| x.first <=> y.first}\n\tend", "title": "" }, { "docid": "182b8bbdcf45f05ddf351976bb2e73ad", "score": "0.53645635", "text": "def make_first_order_challenge_completion\n if user\n try_to_give_reward(user)\n user.introduced.from_wechat.each do |user|\n try_to_give_reward(user)\n end\n end\n end", "title": "" }, { "docid": "3056db6f71e965e196cf81587ca1e24c", "score": "0.536431", "text": "def ordered_by_qualifications(candidates)\n # candidates.sort { |a,b| (a.years_of_experience == b.years_of_experience) ? a.github_points <=> b.github_points : a.years_of_experience <=> b.years_of_experience }\n @candidates.sort do |b, a|\n comp = (a[:years_of_experience] <=> b[:years_of_experience])\n if comp.zero?\n \tcomp = a[:github_points] <=> b[:github_points]\n end\n comp\n \tend\n end", "title": "" }, { "docid": "598c11adeb16cb4197ba35db490fff25", "score": "0.5362495", "text": "def test_multiple_string_number_2\n # x2-g8 < x2-y7 < x2-y08 < x8-y8\n assert_equal %w(x02-g8 x2-y7 x02-y08 x8-y8), %w(x02-y08 x8-y8 x2-y7 x02-g8).natural_sort\n end", "title": "" }, { "docid": "64016601b4d37b15cd8626f68e89bf6c", "score": "0.5355721", "text": "def railties_order=(_arg0); end", "title": "" }, { "docid": "02eea5ff714c1e939921122b181c1ed5", "score": "0.5349241", "text": "def candidate_results_by_coalition_proportional_and_coalition_draw_order\n candidate_results_in_election_order\n .reorder('coalition_proportionals.number desc, candidate_results.coalition_draw_order asc')\n end", "title": "" }, { "docid": "48a9390550a6275a793d79ccf43c60ee", "score": "0.53490007", "text": "def kanban_order\n\t\tprogress.to_i - expected_progress.to_i\n\tend", "title": "" }, { "docid": "db6aa9f02a23e6ad31888ae65353893e", "score": "0.53465474", "text": "def priority\n return nil unless needs_fix?\n return 1 unless in_ht\n return 3 if notes == ['CAPTION:this IA serial lacks caption']\n 2\n end", "title": "" }, { "docid": "6843c0dd484f0a4c3f483b9c94cc2337", "score": "0.5326507", "text": "def do_magic\n remove_preferences_from_unavailable_professor\n remove_preferences_in_conflict_with_already_assigned\n while (get_first_priority_assignable(get_professors_and_offerings_for_assigning[:offerings]) != [] ||\n get_second_priority_assignable(get_professors_and_offerings_for_assigning[:offerings]) != [] ||\n get_third_priority_assignable(get_professors_and_offerings_for_assigning[:offerings]) != [])\n remove_preferences_from_unavailable_professor\n remove_preferences_in_conflict_with_already_assigned\n first_easy\n remove_preferences_from_unavailable_professor\n remove_preferences_in_conflict_with_already_assigned\n second_easy\n remove_preferences_from_unavailable_professor\n remove_preferences_in_conflict_with_already_assigned\n third_easy\n end\n remove_preferences_in_conflict_with_already_assigned\n remove_preferences_from_unavailable_professor\n second_round_tie_braker_past_lectures\n remove_preferences_in_conflict_with_already_assigned\n third_round_tie_braker_past_preferences\n #end of the method \n end", "title": "" }, { "docid": "79eb60c16bc7a71ae4c55f70c2d9cebe", "score": "0.53206116", "text": "def schulze_ranking\n spath = self.strongest_path\n\n return options.sort do |a,b|\n case\n when spath[[a,b]] < spath[[b,a]]\n 1\n when spath[[a,b]] > spath[[b,a]]\n -1\n else\n 0\n end\n end\n end", "title": "" }, { "docid": "95c1265fc83599e239cc05af971e8c8a", "score": "0.5318599", "text": "def test_sorting\r\n @a1.add_partner(@p2)\r\n @a1.add_partner(@p3)\r\n @a1.add_partner(@p4)\r\n @a1.add_partner(@p5)\r\n @a1.add_partner(@p6)\r\n assert_equal(@a1.partners_to_s, \"Vierter Kunde\\nDritter Mensch\\nSechster Muggle\\nErster Partner\\nZweiter Typ\\nFünftes Wesen\")\r\n end", "title": "" }, { "docid": "1774cca42ef2f366d1ffa6f36f3fd091", "score": "0.5310886", "text": "def each\n sorted = @classification.sort do |a,b|\n if b[1].points == a[1].points\n if (b[1].goals_favor - b[1].goals_against) == (a[1].goals_favor - a[1].goals_against)\n b[1].goals_favor <=> a[1].goals_favor\n else\n b[1].goals_favor - b[1].goals_against <=> a[1].goals_favor - a[1].goals_against\n end\n else\n b[1].points <=> a[1].points\n end\n end\n sorted.each { |e| yield e[1] }\n end", "title": "" }, { "docid": "b82264962b01a4171c8ea1c100994b85", "score": "0.5306624", "text": "def test_retuns_job_in_a_specific_order_if_only_one_has_dependency\n sequence = Sequence.new()\n sequence.add(\"a =>\n b => c\n c =>\")\n sequence.ordered.each do |job|\n assert (%w[a b c].include?(job))\n end\n assert sequence.ordered.index(\"c\") < sequence.ordered.index(\"b\")\n end", "title": "" }, { "docid": "455fa1cdcd67757e810c0735804b20fb", "score": "0.5306425", "text": "def play_again_states_order(states)\n\tsorted_states = states.sort_by{|w| w[:correct]} \n\treturn sorted_states\nend", "title": "" }, { "docid": "69e4a602af34ef580d4468dd4391f112", "score": "0.5306151", "text": "def run_order\n 0\n end", "title": "" }, { "docid": "78e2f7a6bf8d85707f774b3fdabbbb26", "score": "0.5304751", "text": "def prioritize(tasks)\n prioritized = {}\n tasks.each do |task|\n PRIORITIES.each do |p|\n prioritized[p.k] ||= []\n prioritized[p.k] << task.strip[2..-1] if task.strip[0..0] == p.k\n end\n end\n prioritized\nend", "title": "" }, { "docid": "792d02126ea22d06bff1b94be247fcdd", "score": "0.52950436", "text": "def apply_default_sort(campaign, influencers)\n # Sort option by influencers' influential\n if ((campaign.sports ? 1 : 0 )+ (campaign.travel ? 1 : 0 ) +\n (campaign.luxury ? 1 : 0 )+ (campaign.technology ? 1 : 0) +\n (campaign.politics ? 1 : 0 )+ (campaign.fashion ? 1 : 0 ) +\n (campaign.music ? 1 : 0 )+ (campaign.movies ? 1 : 0 ) == 1)\n influencers = influencers.order(\"sports_influential desc\") if campaign.sports\n influencers = influencers.order(\"travel_influential desc\") if campaign.travel\n influencers = influencers.order(\"technology_influential desc\") if campaign.technology\n influencers = influencers.order(\"politics_influential desc\") if campaign.politics\n influencers = influencers.order(\"fashion_influential desc\") if campaign.fashion\n influencers = influencers.order(\"luxury_influential desc\") if campaign.luxury\n influencers = influencers.order(\"music_influential desc\") if campaign.music\n influencers = influencers.order(\"movies_influential desc\") if campaign.movies\n end\n if ((campaign.moms ? 1 : 0 )+ (campaign.teens ? 1 : 0 ) +\n (campaign.college_students ? 1 : 0 )+ (campaign.young_men ? 1 : 0 ) +\n (campaign.young_women ? 1 : 0 )+ (campaign.adult_men ? 1 : 0 ) +\n (campaign.adult_women ? 1 : 0 ) == 1)\n influencers = influencers.order(\"moms_influential desc\") if campaign.moms\n influencers = influencers.order(\"teens_influential desc\") if campaign.teens\n influencers = influencers.order(\"college_influential desc\") if campaign.college_students\n influencers = influencers.order(\"young_men_influential desc\") if campaign.young_men\n influencers = influencers.order(\"young_women_influential desc\") if campaign.young_women\n influencers = influencers.order(\"adult_men_influential desc\") if campaign.adult_men\n influencers = influencers.order(\"adult_women_influential desc\") if campaign.adult_women\n end\n\n # Sort option for sex\n if campaign.males && !campaign.females\n influencers = influencers.order(\"males_count desc\")\n elsif campaign.females && !campaign.males\n influencers = influencers.order(\"females_count desc\")\n end\n\n # Sort options for age\n columns = []\n columns << \"audiences.moms_count\" if campaign.moms\n columns << \"audiences.teens_count\" if campaign.teens\n columns << \"audiences.college_students_count\" if campaign.college_students\n columns << \"audiences.young_women_count\" if campaign.young_women\n columns << \"audiences.young_men_count\" if campaign.young_men\n columns << \"audiences.adult_women_count\" if campaign.adult_women\n columns << \"audiences.adult_men_count\" if campaign.adult_men\n if columns.size > 0\n influencers = influencers.select(\"(#{columns.join(' + ')}) as sum_age\").order('sum_age desc')\n end\n\n # Sort options for hobbies\n columns = []\n columns << \"audiences.sports_count\" if campaign.sports\n columns << \"audiences.fashion_count\" if campaign.fashion\n columns << \"audiences.music_count\" if campaign.music\n columns << \"audiences.movies_count\" if campaign.movies\n columns << \"audiences.politics_count\" if campaign.politics\n columns << \"audiences.technology_count\" if campaign.technology\n columns << \"audiences.travel_count\" if campaign.travel\n columns << \"audiences.luxury_count\" if campaign.luxury\n if columns.size > 0\n influencers = influencers.select(\"(#{columns.join(' + ')}) as sum_hobbies\").order('sum_hobbies desc')\n end\n\n influencers.order('audiences.followers desc')\n end", "title": "" } ]
36945aa0a24ebef49b9022095fd71fd3
Make a pending membership request.
[ { "docid": "2aadcd217055be055c48803d3a25007e", "score": "0.0", "text": "def request(user, group, send_mail = nil)\n if send_mail.nil?\n send_mail = global_prefs.email_notifications? &&\n group.owner.connection_notifications?\n end\n if user.groups.include?(group) or Membership.exists?(user, group)\n nil\n else\n if group.public? or group.private?\n transaction do\n create(:user => user, :group => group, :status => PENDING)\n if send_mail\n membership = user.memberships.find(:first, :conditions => ['group_id = ?',group])\n Notifier.deliver_membership_request(membership)\n end\n end\n if group.public?\n membership = user.memberships.find(:first, :conditions => ['group_id = ?',group])\n membership.accept\n if send_mail\n Notifier.deliver_membership_public_group(membership)\n end\n end\n end\n true\n end\n end", "title": "" } ]
[ { "docid": "adefcae6b0667ee96881d232c82d8eab", "score": "0.6533535", "text": "def create_membership_request\n member = Member.new(squad: @squad, user: current_user, membership: 'request')\n member.save(validate: false)\n end", "title": "" }, { "docid": "b4306f372be2530f3d91d9824d8e9b02", "score": "0.6460296", "text": "def allow_membership_pending_approval(membership)\n if logged_in?\n if membership.user_established_at == nil\n return membership.user_id == current_user.id\n elsif membership.network_established_at == nil\n return membership.network.administrator?(current_user)\n end \n else\n return false\n end\n end", "title": "" }, { "docid": "4599ae528e704457e35fdb1927e2dc7d", "score": "0.64228445", "text": "def pending_members\n set_group \n @pending_members = GroupsController.pending_members(params[:id], current_user.id)\n end", "title": "" }, { "docid": "c6195683ccaa2b2a83de58ed6fffd38e", "score": "0.64043486", "text": "def pending\n @user = current_user\n @friendship_requests = current_user.requested_friendships\n end", "title": "" }, { "docid": "5c761bedca694dafef45b2ff80da262c", "score": "0.62697357", "text": "def is_pending?\n level == Membership::LEVELS[:pending]\n end", "title": "" }, { "docid": "6233e94a9ab0aac6d0ef8ffef070797b", "score": "0.6235212", "text": "def pending_friend_requests_to\n \tself.friendships.where(state: \"pending\")\n end", "title": "" }, { "docid": "b01ac775cb1e5bf54abf45c39f1ae08b", "score": "0.61804444", "text": "def allow_request_membership?(user = User.current_user)\n user.present? &&\n project_administrators.any? &&\n !has_member?(user) &&\n ProjectMembershipMessageLog.recent_requests(user.try(:person),self).empty?\n end", "title": "" }, { "docid": "1440c5e333c9c019225c73f3ba78c9fe", "score": "0.61451924", "text": "def request_friend(friend)\n self.friendships.create!(friend_id: friend.id, status: 'requested')\n friend.friendships.create!(friend_id: self.id, status: 'pending')\n end", "title": "" }, { "docid": "f3caa52d993c9566b49c35dd95590313", "score": "0.60909736", "text": "def allow_request_membership?(user = User.current_user)\n user.present? &&\n project_administrators.any? &&\n !has_member?(user) &&\n MessageLog.recent_project_membership_requests(user.try(:person),self).empty?\n end", "title": "" }, { "docid": "6bb35bbae7e5ad0f8fab593e5444d0f4", "score": "0.6090587", "text": "def request_status_pending?\n friend_request_exists? && @friend.pending?\n end", "title": "" }, { "docid": "c54e9b64385027ed2c685d4e3f43ce9c", "score": "0.6079871", "text": "def initialize_pending(requestor)\n return false unless setup_group\n return false unless requestor.join_group(self.id)\n requestor.change_role_level(\"adult sponsor\")\n send_notifications(requestor)\n true\n end", "title": "" }, { "docid": "c591f728572ec37744735488ba29928d", "score": "0.6065759", "text": "def pending_friend_requests_from\n \tself.inverse_friendships.where(state: \"pending\")\n end", "title": "" }, { "docid": "2c3ddf96277e0fd3e086df420e894667", "score": "0.604258", "text": "def do_accept\n InviteRequest.clear_pending_request_activities(self.user, self.wants_to_join)\n end", "title": "" }, { "docid": "121763e07b03afc7aceda097a96c7e6e", "score": "0.6041842", "text": "def allow_request_membership?(user = User.current_user)\n user.present? &&\n project_administrators.any? &&\n !has_member?(user) &&\n MessageLog.recent_project_membership_requests(user.try(:person),self).empty?\n end", "title": "" }, { "docid": "bc51a13b416e1988fbb3f667d6e8d472", "score": "0.60352856", "text": "def pending?(user)\n membership_status(user) == StudentMembership::STATUSES[:pending]\n end", "title": "" }, { "docid": "ee179e34fc7ca7bb37f30e46c91fde9b", "score": "0.60095686", "text": "def pending!\n self.update_attribute(:status, ConfigCenter::User::PENDING)\n end", "title": "" }, { "docid": "3a97ec501b7cf152cb53911ee14f39ad", "score": "0.59713036", "text": "def pending_friend_requests_to\n self.friendships.where(state: \"pending\")\n end", "title": "" }, { "docid": "514249248022f02a2ccc504f91459174", "score": "0.5948691", "text": "def do_pending \n make_activation_code\n ClaimingMailer.deliver_confirmation_request(self) if self.email && self.activation_code\n end", "title": "" }, { "docid": "26c12f7435359f56284ac4dd13458b25", "score": "0.59464407", "text": "def accept! = self.user.create_accepted_request", "title": "" }, { "docid": "5cd0bc3a1c7c61121e84a78b3b9c04c1", "score": "0.59436077", "text": "def approve_pending_membership(person, email_address=nil)\n membership = community_memberships.where(:person_id => person.id, :status => \"pending_email_confirmation\").first\n if membership && (email_address.nil? || email_allowed?(email_address))\n membership.update_attribute(:status, \"accepted\")\n return true\n end\n return false\n end", "title": "" }, { "docid": "5cd0bc3a1c7c61121e84a78b3b9c04c1", "score": "0.59436077", "text": "def approve_pending_membership(person, email_address=nil)\n membership = community_memberships.where(:person_id => person.id, :status => \"pending_email_confirmation\").first\n if membership && (email_address.nil? || email_allowed?(email_address))\n membership.update_attribute(:status, \"accepted\")\n return true\n end\n return false\n end", "title": "" }, { "docid": "3ba5bdf607183450a753b4930a27c0b2", "score": "0.59407383", "text": "def pending\n @user = User.find(params[:id])\n end", "title": "" }, { "docid": "5bb4b54d7d7d47737abc5d32cdd84daf", "score": "0.5937439", "text": "def pending_requests_to_join\n ContributorRequest.includes(\n :user\n ).where(\n organization: self\n ).select(&:pending?)\n end", "title": "" }, { "docid": "5e08f9cea99137df02844b0ad241ac8d", "score": "0.5923858", "text": "def create\n # TODO: test if \"user_established_at\" and \"network_established_at\" can be hacked (ie: set) through API calls,\n # thereby creating memberships that are already 'accepted' at creation.\n user = User.find_by_id(params[:membership][:user_id])\n if user.nil?\n render_404(\"User not found.\")\n elsif !Membership.find_by_user_id_and_network_id(params[:membership][:user_id], params[:membership][:network_id]) ||\n Network.find(params[:membership][:network_id]).owner?(user)\n\n @membership = Membership.new(params[:membership])\n\n @membership.user_established_at = nil\n @membership.network_established_at = nil\n if @membership.message.blank?\n @membership.message = nil\n end\n \n respond_to do |format|\n\n if @membership.save\n # Take into account network's new member policy setting\n if (@membership.network.open?)\n @membership.accept!\n \n begin\n user = @membership.user\n network = @membership.network\n Notifier.deliver_auto_join_group(user, network, base_host) if network.administrators(true).any? {|a| a.send_notifications?}\n rescue\n logger.error(\"ERROR: failed to send email notification for auto join group. Membership ID: #{@membership.id}\")\n end\n \n flash[:notice] = 'You have successfully joined the Group.'\n elsif (@membership.network.membership_by_request?)\n @membership.user_establish!\n \n begin\n user = @membership.user\n network = @membership.network\n Notifier.deliver_membership_request(user, network, @membership, base_host) if network.administrators(true).any? {|a| a.send_notifications?}\n rescue Exception => e\n logger.error(\"ERROR: failed to send Membership Request email notification. Membership ID: #{@membership.id}\")\n logger.error(\"EXCEPTION:\" + e)\n end\n \n flash[:notice] = 'Membership was successfully requested.'\n end\n\n format.html { redirect_to user_membership_path(current_user.id, @membership) }\n else\n format.html { render :action => \"new\" }\n end\n end\n else\n respond_to do |format|\n flash[:error] = \"Membership not created (already exists)\"\n format.html { render :action => \"new\" }\n end\n end\n end", "title": "" }, { "docid": "16742d894600bcdcd6f862b6d912d49d", "score": "0.59084463", "text": "def has_request\n request_status_pending? && @friend.requester != current_user\n end", "title": "" }, { "docid": "7e8e4b40b5be752d3fc672b8b1a4debe", "score": "0.590488", "text": "def pending_friend_requests_from\n self.inverse_friendships.where(state: \"pending\")\n end", "title": "" }, { "docid": "030a1efe0713d77f24a3df660eae83a6", "score": "0.59048146", "text": "def is_requested\n request_status_pending? && @friend.requester == current_user\n end", "title": "" }, { "docid": "33f0f949b7808b21a1a3c6331e8a254f", "score": "0.58848935", "text": "def create\n\n @pending_membership = PendingMembership.new(club_id: params[:user][:pending_membership][:club_id])\n\n params[:user].delete(\"pending_membership\")\n\n @user = User.new(params[:user])\n @possible_memberships = PendingMembership.where(user_email: @user.email)\n\n if @possible_memberships.length > 0 && @user.save\n new_user = User.last\n @membership = Membership.new\n @membership.user_id = new_user.id\n @membership.club_id = @possible_memberships.first.club_id\n @possible_memberships.first.destroy\n @membership.save\n session[:user_id] = @user.id\n redirect_to @user, notice: 'Account and membership successfuly created.'\n elsif @user.save\n @pending_membership.user_id = @user.id \n @pending_membership.user_first_name = @user.first_name\n @pending_membership.user_last_name = @user.last_name\n @pending_membership.user_email = @user.email\n @pending_membership.save\n UserMailer.admin_verification(@pending_membership).deliver\n UserMailer.welcome(@user).deliver\n session[:user_id] = @user.id\n redirect_to @user, notice: 'Account successfuly created.' \n else\n # needed for render 'new' in case of form errors \n @user.pending_memberships.build\n render action: \"new\"\n end\n end", "title": "" }, { "docid": "d8dc0fc78cbb6add3e382f8e0a07cdfe", "score": "0.5858978", "text": "def pending_requests; end", "title": "" }, { "docid": "d8dc0fc78cbb6add3e382f8e0a07cdfe", "score": "0.5858978", "text": "def pending_requests; end", "title": "" }, { "docid": "d8dc0fc78cbb6add3e382f8e0a07cdfe", "score": "0.5858978", "text": "def pending_requests; end", "title": "" }, { "docid": "c7b0bcca0d9b5a453cd6c85420505d89", "score": "0.58464974", "text": "def approve_join_request\n join_request = JoinRequest.find(params[:id])\n team = join_request.team\n # Only authorize the captain to do this\n if current_user.id == team.captain_id\n membership = Membership.create(\n team_id: join_request.team_id,\n user_id: join_request.user_id,\n admin: false\n )\n if membership.valid?\n join_request.destroy\n render json: {\n team: TeamSerializer.new(team),\n user: UserSerializer.new(current_user)\n }, status: :accepted\n else\n # invalid request\n render json: {\n message: \"Invalid request\",\n errors: membership.errors.full_messages\n }, status: :not_acceptable\n end\n else\n render json: { message: \"Only the captain is allowed to accept join requests\"}, status: :not_acceptable\n end\n end", "title": "" }, { "docid": "cfa016cff43adf0c1f7ef70f3879ff44", "score": "0.58183604", "text": "def set_pending_friend_request\n @pending_friend_request = PendingFriendRequest.find(params[:id])\n end", "title": "" }, { "docid": "13b8d61f67f02388095eaee9b4cfc3c7", "score": "0.5803284", "text": "def pending_with(id, page_options = default_paging_options, scope = Amico.default_scope_key)\n members(\"#{Amico.namespace}:#{Amico.pending_with_key}:#{scope}:#{id}\", page_options)\n end", "title": "" }, { "docid": "e738158a932f612cb26ee20d3cd9c6f0", "score": "0.5794839", "text": "def create\n @membership = Membership.find_or_create_by_user_id_and_group_id(params[:membership][:user_id], params[:group_id])\n\n if params[:autoconfirm]\n @membership.update_attributes(:level => Membership::LEVELS[:regular])\n else\n @membership.update_attributes(:level => Membership::LEVELS[:pending])\n end\n \n auth!\n\n respond_to do |format|\n if @membership.save\n process_notification(@membership, {:level => @membership.level_name, :adder => current_user.id}, :action => 'create', :owner => @membership.user, :recipient => @membership.group)\n format.html { redirect_to(edit_group_path(@group), :notice => t(:membership_created)) }\n format.xml { render :xml => @group, :status => :created, :location => @group }\n else\n format.html { redirect_to @group }\n format.xml { render :xml => @membership.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "44bd06c79d2d23367340bad29afa8704", "score": "0.5781373", "text": "def do_pending\n make_activation_code\n # send the user an email with an activation code\n UserMailer.deliver_signup_notification(self)\n end", "title": "" }, { "docid": "d216f07efe9ac28ba59e48a14f70bb75", "score": "0.5780641", "text": "def pending(id, page_options = default_paging_options, scope = Amico.default_scope_key)\n members(\"#{Amico.namespace}:#{Amico.pending_key}:#{scope}:#{id}\", page_options)\n end", "title": "" }, { "docid": "fab113ec458f66c02b179f65811f39b5", "score": "0.57638776", "text": "def pending\n\t\tpending_friends | requested_friendships\n\tend", "title": "" }, { "docid": "0211cd09c2d61c2914a17a720da749ed", "score": "0.5761221", "text": "def pending!\n self.update_attribute(:status, PENDING)\n self.registration.update_attribute(:status, PENDING) if self.registration\n end", "title": "" }, { "docid": "28449a38acba4941c9e910471eac8350", "score": "0.57612014", "text": "def request_membership_of(user_group)\n Membership.create!(:user => self,\n :admin => false,\n :user_group => user_group)\n end", "title": "" }, { "docid": "aa42c6c603a0726d1c18c44739e04934", "score": "0.57180727", "text": "def request_approved(request)\n @request = request\n @email = @request.clid + '@louisiana.edu'\n mail to: @email, subject: \"Room Change Request Approved\"\n end", "title": "" }, { "docid": "d99971c3d4089a8ed4b8bd1ca0fc2ef0", "score": "0.56911314", "text": "def request\n if Pending.approved.include? @@item.attach\n 'unapprove'\n elsif Pending.unapproved.include? @@item.attach\n 'approve'\n elsif @@item.approved and @@item.approved.include? User.initials\n 'unapprove'\n else\n 'approve'\n end\n end", "title": "" }, { "docid": "e93c58acaf84b5f17e91cdfbd731cba4", "score": "0.568227", "text": "def create\n pending_request = PendingTutorRequest.create(tutor_request_params)\n tutee = User.find(params[:student_id])\n course = Course.find(TutorSubject.find(params[:tutor_subject_id]).course_id)\n\n course_code = course.course_prefix + course.course_code\n\n data = {\n course: course_code,\n tutee: tutee.first_name\n }\n\n notifcation_params = { 'user_id' => params[:tutor_id],\n 'title' => 'Request',\n 'body' => 'You have a new pending request for ' + course_code,\n 'icon' => 'request_new',\n 'color' => 'lightgrey',\n 'type' => 'request',\n 'associated_data' => data.to_json }\n\n if pending_request.valid?\n Notifications.send_notification(notifcation_params)\n json_response(pending_request, :created)\n else\n json_response(pending_request.errors, :unprocessable_entity)\n end\n end", "title": "" }, { "docid": "ca0b9e29877a5418c98a5cabb21f163f", "score": "0.5668235", "text": "def pending\n pending_friends | requested_friendships\n end", "title": "" }, { "docid": "ca0b9e29877a5418c98a5cabb21f163f", "score": "0.5668235", "text": "def pending\n pending_friends | requested_friendships\n end", "title": "" }, { "docid": "c63906500a955f50f2790e80088c8d23", "score": "0.5661278", "text": "def not_pending\n if user.incoming_friend_requests.pluck(:user_id).include?(friend_id)\n errors.add(:friend, 'already requested friendship')\n end\n end", "title": "" }, { "docid": "893be05c3c7d3c0aac36639123baddbe", "score": "0.56490546", "text": "def pending\n pending_friends | pending_friend_requests\n end", "title": "" }, { "docid": "8cdadabf486ee79cbccdb037c7874214", "score": "0.56101555", "text": "def create\n\n @user = current_user\n if @user.is_admin? and not session[:express_token]\n # Make a new membership.\n @membership = Membership.new(membership_params)\n @membership.purchase_date = DateTime.now\n payment_complete = true\n else\n # Do the PayPal purchase\n payment_complete = false\n notice_message_for_user = \"Something went wrong, sorry!\"\n @user = current_user\n @membership = @user.memberships.build(:valid_from => (@user.last_membership.try(:expiry_date) or DateTime.now), :duration => session[:express_purchase_membership_duration], :purchase_date => DateTime.now)\n\n if session[:express_autodebit]\n # It's an autodebit, so set that up\n # 1. setup autodebit by requesting payment\n ppr = PayPal::Recurring.new({\n :token => session[:express_token],\n :payer_id => session[:express_payer_id],\n :amount => (session[:express_purchase_price] / 100),\n :ipn_url => \"#{payment_notifications_url}\",\n :currency => 'AUD',\n :description => session[:express_purchase_description]\n })\n response_request = ppr.request_payment\n logger.info \"XXXXXXXXXXXX\"\n logger.info response_request.to_json\n # raise \"Response denied\"\n logger.info \"XXXXXXXXXXXX\"\n\n if response_request.approved?# and response_request.completed?\n # 2. create profile & save recurring profile token\n # Set :period to :daily and :frequency to 1 for testing IPN every minute\n ppr = PayPal::Recurring.new({\n :token => session[:express_token],\n :payer_id => session[:express_payer_id],\n :amount => (session[:express_purchase_price] / 100),\n :currency => 'AUD',\n :description => session[:express_purchase_description],\n :frequency => session[:express_purchase_membership_duration], # 1,\n :period => :monthly, # :daily,\n :reference => \"#{current_user.id}\",\n :ipn_url => \"#{payment_notifications_url}\",\n :start_at => (@membership.valid_from + session[:express_purchase_membership_duration].months), # Time.now\n :failed => 1,\n :outstanding => :next_billing\n })\n\n response_create = ppr.create_recurring_profile\n if not(response_create.profile_id.blank?)\n @membership.paypal_profile_id = response_create.profile_id\n # If successful, update the user's membership date.\n # update_membership_expiry_date\n # Reset refund if they had one in the past\n @membership.refund = nil\n\n # TODO: Background task\n # TODO: Check paypal recurring profile id still valid\n # TODO: Setup future update_membership_expiry_date\n\n # Save the PayPal data to the @membership model for receipts\n save_paypal_data_to_membership_model\n payment_complete = true\n else\n # Why didn't this work? Log it.\n logger.warn \"create_recurring_profile failed: #{response_create.params}\"\n end\n else\n # Why didn't this work? Log it.\n logger.warn \"request_payment failed: #{response_request.params}\"\n notice_message_for_user = response_request.params[:L_LONGMESSAGE0]\n raise \"Request payment failed\"\n end\n else\n # It's a single purchase so make the PayPal purchase\n response = EXPRESS_GATEWAY.purchase(session[:express_purchase_price], express_purchase_options)\n\n if response.success?\n # If successful, update the user's membership date.\n # update_membership_expiry_date\n logger.info \"Paypal is happy!\"\n save_paypal_data_to_membership_model\n payment_complete = true\n else\n # The user probably hit back and refresh or paypal is broken.\n logger.info \"Paypal is sad.\"\n logger.warn response.params\n notice_message_for_user = response.message\n # redirect_to user_path(current_user), notice: response.message\n # return\n end\n end\n\n end\n\n respond_to do |format|\n if payment_complete and @membership.save\n format.html { redirect_to user_path(@user), notice: 'Membership was successfully created.' }\n format.json { render action: 'show', status: :created, location: @membership }\n else\n logger.info \"Uh oh, couldn't save.......\"\n raise \"couldn't save.\"\n format.html { render action: 'index', notice: @membership.errors }\n format.json { render json: @membership.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "abb601c646a8db876a92f2447a50296c", "score": "0.5609503", "text": "def accept\n Membership.accept(user_id, group_id)\n end", "title": "" }, { "docid": "8a447589e70f22ac26b28417768eb316", "score": "0.56074375", "text": "def claim!\n interested.unrequested.each do |membership|\n self << membership\n end\n end", "title": "" }, { "docid": "25d42d051ca084b66aacb6bfd85aa6e5", "score": "0.5589248", "text": "def new\n @user = User.new\n @user.pending_memberships.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user }\n end\n end", "title": "" }, { "docid": "4e49427d9de86205153b152c03be0fed", "score": "0.5585607", "text": "def pending!(purchase)\n post(purchase, \"#{collection_path}/pending\")\n end", "title": "" }, { "docid": "4e49427d9de86205153b152c03be0fed", "score": "0.5585607", "text": "def pending!(purchase)\n post(purchase, \"#{collection_path}/pending\")\n end", "title": "" }, { "docid": "88bc6a6c7537be193d212d8f2415e6e7", "score": "0.558325", "text": "def create_and_invite\n puts \"MembersController#create_and_invite\"\n # Convert month/year params to date\n params[:joined_at] = \"#{params[:joined_at_y]}-#{params[:joined_at_m]}-1\".to_date\n # Left_at should be the first of next month. A member who's left_at is set to 1st of August will\n # only pay for July.\n params[:left_at] = \"#{params[:left_at_y]}-#{params[:left_at_m]}-1\".to_date.next_month #.end_of_month\n \n # Invite a new member or add an existing to a project\n if params[:invite_or_add] == \"add\"\n # Add to existing project\n @member = Member.find(params[:member][:id])\n # Add member to existing project\n existing_project = Project.find(params[:project_id])\n puts \"Assign project '#{existing_project.name}' (#{params[:project_id]}) with admin #{existing_project.admin_id}, to member '#{@member.name}'.\"\n project_name = existing_project.name\n if existing_project.admin_id == current_member.id\n # Make sure that current member is admin of the project.\n @member.projects << existing_project\n membership = @member.memberships.where(\"project_id = ?\", existing_project.id)\n membership.update(joined_at: params[:joined_at], left_at: params[:left_at])\n @member.save\n \n # Member saved to db. Send invitiation email.\n if params[:send_invitation]\n @member.send_invitation_email sender: current_member, project: existing_project\n flash[:info] = \"Invitation email sent to #{@member.email} from #{current_member.name}. Invited to project #{existing_project.name}.\"\n end\n\n set_current_project_id existing_project.id\n redirect_to root_path and return\n else\n cancel_invite \"NOT PROJECT ADMIN. Member #{current_member.id} is not #{existing_project.admin_id}.\"\n return false\n end\n else\n # Create new and add to existing/newly created project\n # Init Member\n @member = Member.new(member_params)\n if @member.save\n # Saved member (along with project) to database\n puts \"Saved member #{@member.name} to db.\"\n # Choose an existing project or create a new?\n if params[:new_or_existing] == \"new\" && !params[:project][:name].blank?\n # Logged in member wants to create a new project\n project_name = params[:project][:name]\n params[:project][:admin_id] = current_member.id\n if current_member.projects.where(\"admin_id = ? AND name = ?\", current_member.id, project_name).empty?\n # Member is not the admin of a project with this name, create it\n puts \"Will create new Project: '#{project_name}'\"\n # Create project\n puts \"Assign project '#{project_name}' to member '#{@member.name}\"\n puts \"Assign project admin privileges to current member '#{current_member.name}\"\n current_member.projects.build(project_params)\n current_member.save\n else\n flash[:danger] = \"A project named '#{project_name}' already exists. Choose another name.\"\n puts \"A project named '#{project_name}' already exists. Choose another name.\"\n cancel_invite \"PROJECT ALREADY EXISTS\"\n return false\n end\n elsif params[:new_or_existing] == \"existing\" && params[:project_id] != \"0\"\n # Add member to existing project\n existing_project = Project.find(params[:project_id])\n p existing_project\n puts \"Assign project '#{existing_project.name}' (#{params[:project_id]}) with admin #{existing_project.admin_id}, to member '#{@member.name}'.\"\n project_name = existing_project.name\n if existing_project.admin_id == current_member.id\n # Make sure that current member is admin of the project.\n @member.projects << existing_project\n else\n cancel_invite \"NOT PROJECT ADMIN. Member #{current_member.id} is not #{existing_project.admin_id}.\"\n return false\n end\n else\n flash[:danger] = \"Enter a name for a new Project or choose an existing one.\"\n puts \"Enter a name for a new Project or choose an existing one.\"\n cancel_invite \"NO NEW PROJECT NAME or NO PROJECT SELECTED\"\n return false\n end\n @member.current_project_id = params[:project_id]\n @member.save\n\n project = @member.projects.find_by(name: project_name)\n unless project.nil?\n membership = @member.memberships.where(\"project_id = ?\", project.id)\n membership.update(joined_at: params[:joined_at], left_at: params[:left_at])\n @member.save\n\n if project.rents.empty?\n project.rents.create(amount: params[:monthly_rent], due_date: project.start_date.prev_month.change(day: 25))\n end\n end\n\n # Member saved to db. Send invitiation email.\n if params[:send_invitation]\n @member.send_invitation_email sender: current_member, project: project\n flash[:info] = \"Invitation email sent to #{@member.email} from #{current_member.name}. Invited to project #{project_name}.\"\n end\n set_current_project_id project.id\n redirect_to root_path\n else\n flash[:danger] = \"#{@member.name} could not be saved.\"\n p @member.errors.messages\n @projects = current_member.projects.where(admin_id: current_member.id)\n render 'invite'\n end\n end\n\n end", "title": "" }, { "docid": "40dd8030fc649c1ec41855d8fb65a111", "score": "0.55713075", "text": "def check_pending\n\t\t# Picked a random 'check' user service and temporary set it's status to pending\n\t\tuser_service \t\t= UserService.find_by(relationship_type: 'check')\n\t\tuser_service.status = 'complete'\n\t\tUserServicesMailer.check_updated(user_service)\n\tend", "title": "" }, { "docid": "abb20d0aa873fda0abeade472f37029a", "score": "0.55671364", "text": "def pending!\n self.update_attribute(:status, PENDING)\n end", "title": "" }, { "docid": "9e75f9ade813e491b293202d5ab6586d", "score": "0.5544921", "text": "def pending(params = {})\n @api.get(\"#{@api.path}/List/#{@id}/Recipients/Pending\", params: params)\n end", "title": "" }, { "docid": "7f009b484745e1bb890376e11cfb404d", "score": "0.5544635", "text": "def set_pending\n item = SharedItem.find_by(name: params[:name], user_id: current_user.id, pending: false)\n if item\n item.update(pending: true)\n redirect_to current_user\n else\n redirect_to current_user, notice: \"Item could not be found.\"\n end\n end", "title": "" }, { "docid": "e01013e0908aa63b941c4929cebc7024", "score": "0.5541684", "text": "def new_user_waiting_for_approval(faculty)\n @faculty = faculty\n\n mail(to: '[email protected]', subject: 'A new faculty member is awaiting approval!', body: 'A new faculty member is awaiting your approval!')\n end", "title": "" }, { "docid": "fae3c23e238fb45f6531bb836a4c99cf", "score": "0.55393815", "text": "def create\n @membership = Membership.where(user_id: params[:membership][:user_id], group_id: params[:group_id]).first_or_create\n\n if params[:autoconfirm] || current_user.is_admin?\n @membership.update_attributes(level: Membership::LEVELS[:regular])\n else\n @membership.update_attributes(level: Membership::LEVELS[:pending])\n end\n\n @membership.perms[:screen] = params[:screen]\n @membership.perms[:feed] = params[:feed]\n\n auth!\n\n respond_to do |format|\n if @membership.save\n process_notification(@membership, {}, process_notification_options({\n params: {\n level: @membership.level_name,\n member_id: @membership.user.id,\n member_name: @membership.user.name,\n group_id: @membership.group.id,\n group_name: @membership.group.name\n },\n recipient: @membership.group}))\n if can? :update, @group\n format.html { redirect_to(manage_members_group_path(@group), notice: t(:membership_created)) }\n else\n format.html { redirect_to(group_path(@group), notice: t(:membership_applied_for)) }\n end\n format.xml { render xml: @group, status: :created, location: @group }\n else\n if can? :update, @group\n format.html { redirect_to manage_members_group_path(@group) }\n else\n format.html { redirect_to group_path(@group) }\n end\n format.xml { render xml: @membership.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5071480deeefdc2cadf83e9a318ba37b", "score": "0.5519377", "text": "def request_friendship_with(friend)\n\t\t\t\t\tunless is_friends_or_pending_with?(friend) || self == friend\n \t \t::Friendship.create!(:friendshipped_by_me => self, :friendshipped_for_me => friend)\n\t\t\t\t\tend\n \t end", "title": "" }, { "docid": "289027b62a87686808127a8ebc5627ac", "score": "0.5508426", "text": "def match_to_invitation_or_send_email\n if invitation = joinable.membership_invitation_for(user)\n invitation.accept(invitation.user)\n else\n UserMailer.project_membership_request_created_email(joinable.who_can?(:manage), self).deliver\n end\n end", "title": "" }, { "docid": "d57ddbe75a3f5eec1c2c8c6ea2b52480", "score": "0.54966635", "text": "def require_requestor_recipients!\n return true if memberships.requestor.any?\n send_registration_required_notice!\n false\n end", "title": "" }, { "docid": "6ba04bfa1c6508b6460b5735ae998e95", "score": "0.54963994", "text": "def create\n #sanity checks, can only modify memberships that you own\n if params[:user_id].to_i != current_user.id then\n render json: {message:'You do not own the membership list'}, :status => :unprocessable_entity\n return\n end\n\n #ensure the membership params is there\n unless params.has_key? :memberships then\n #render json: {message:'memberships list not found'}, :status => :unprocessable_entity\n #return\n #this could me no membership at all\n params[:memberships] = {}\n end\n\n #set the new memberships state\n current_user.set_memberships params[:memberships]\n\n render json: {\n message:'message received from server',\n memberships:User.find(params[:user_id]).memberships.map{ |x| x.attributes.merge({club_name: x.club_name})}\n }\n end", "title": "" }, { "docid": "2306f12fffe5e41cdf3e8b6c71167cc3", "score": "0.5492386", "text": "def approved\n @req = Request.last\n RequestMailer.approved(@req)\n end", "title": "" }, { "docid": "7c1b9be5e5b19e7eb2628326c1cec5af", "score": "0.548913", "text": "def sent_friend_requests\n self.followed_users.where(\"friend_status = 'PENDING'\")\n end", "title": "" }, { "docid": "042ce1bb6f844ad5d99dc37bdd50e803", "score": "0.5472861", "text": "def pending\n tutor_requests = PendingTutorRequest\n .select('users.id AS user_id, users.first_name,\n users.last_name, users.agg_user_rating, users.num_user_rating,\n tutor_subjects.rate, users.phone_number, courses.course_prefix,\n courses.course_code, pending_tutor_requests.id')\n .joins(:student, tutor_subject: :course).where(tutor_id: params[:tutor_id])\n json_response(tutor_requests.all)\n end", "title": "" }, { "docid": "b79bb3646891076f2052c544adbc4338", "score": "0.5464846", "text": "def create\n\n @user = User.where(firstName: params[:user][:firstName]).first\n @loop = Loop.find(params[:loop_id])\n\n if @user\n lm = @user.loop_memberships.build(loop_id: @loop.id)\n lm.status = \"pending\"\n lm.author_id = current_user.id\n lm.save\n flash[:success] = \"invitation sent\"\n redirect_to loop_path(@loop)\n else \n flash[:error] = \"error with invitation\"\n redirect_to loop_path(@loop)\n end\n\n end", "title": "" }, { "docid": "1078f480bff0c0cffc7f9b335093c6b8", "score": "0.5459395", "text": "def update_status\n @request_group.request.change_status_to_accepted\n end", "title": "" }, { "docid": "8a21b046d6ebd9d53a24fe28aba57af9", "score": "0.5455249", "text": "def send_friendship_request(other_user)\n friendship_requests.create!(requested_user: other_user) if !self.friends_with?(other_user)\n end", "title": "" }, { "docid": "6547e3481c21e10c507c64c37a51acaa", "score": "0.5455239", "text": "def pending?\n status == :pending\n end", "title": "" }, { "docid": "4532f322729d21c1b3c9d3b67e1d8d5f", "score": "0.5453741", "text": "def request_approval\n reservation = Reservation.first\n ReservationMailer.request_approval(reservation)\n end", "title": "" }, { "docid": "a3e2593ee09a001c660188642443188b", "score": "0.54395056", "text": "def is_pending_for(another_user)\n return false unless is_associated_to_somebody_else_than(another_user)\n\n existing_friendship = @swimmer.associated_user.find_any_friendship_with(another_user)\n !!(\n existing_friendship &&\n existing_friendship.pending? &&\n (existing_friendship.friendable_id == another_user.id) # Another user is the one *sending* the invite\n )\n end", "title": "" }, { "docid": "a9d4234fa7fbdb78ec37d520f2de32a7", "score": "0.54361403", "text": "def finish_pending_request!(request_info={accepted: false})\n\t\tself.time_accepted = Time.now\n\t\tself.confirmation_code = SecureRandom.hex(3)\n\t\tself.accepted = request_info[:accepted]\n\t\tif save\n\t\t\tanswer_request\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend", "title": "" }, { "docid": "4a944b3567e93f076481303da0d84e32", "score": "0.5433437", "text": "def membership_params\n params.require(:membership).permit(:user_id, :valid_from, :duration, :purchase_date, :cancellation_date, :refund, :price_paid)\n end", "title": "" }, { "docid": "d6bedae491a5da9cc4106318bb67e358", "score": "0.5426321", "text": "def pending_request\n sent_requests.where(confirmed: nil)\n end", "title": "" }, { "docid": "7f23e7e5d24e7cc483ad42060ea1c021", "score": "0.5418698", "text": "def pending \n @user = current_user\n @inviters = @user.pending_invited_by\n if @inviters.empty?\n flash[:no_pending] = \"You have no pending requests $blue\" \n redirect_to action: 'index'\n else \n @inviters = @inviters.paginate(:per_page => 5, :page=> params[:page])\n render layout: 'mobile_template'\n end \n end", "title": "" }, { "docid": "4849025071e656e015547b107ef57321", "score": "0.53991365", "text": "def to_pending!\n self.status = 'pending'\n self.save\n end", "title": "" }, { "docid": "9cd76d821960e0185fa8103d80f3ea0c", "score": "0.5391316", "text": "def pending_acceptance\n merge(CourseUser.with_invited_state)\n end", "title": "" }, { "docid": "693d8af7e8b7e674457da71fd1f3dd9f", "score": "0.53857493", "text": "def uniqueness_of_pending_request\n return true if UserRequest.pending_requests.where(team: team, user: user).empty?\n\n errors.add(:user, I18n.t('requests.already_pending'))\n end", "title": "" }, { "docid": "e40b3d89dfaa176f7617188ac874df53", "score": "0.53846806", "text": "def create_request\n Effective::QbRequest.new_requests_for_unsynced_items.first\n end", "title": "" }, { "docid": "278b36e6d033d200ea13fd18f867d7d7", "score": "0.5379206", "text": "def accept!()\n self.status = Invite::Status::ACCEPTED\n invitable.add_member invitee\n save!\n end", "title": "" }, { "docid": "0626bf5dcacbb7336453b436475ddec7", "score": "0.53754306", "text": "def pending?\n status == \"pending\"\n end", "title": "" }, { "docid": "8f2c66142a419028f2c4d394a43f8cdf", "score": "0.53740036", "text": "def pending_friend_requests\n if ! ensure_same_as_logged_person(params['user_id'])\n render_json :status => :forbidden and return\n end\n render_json :entry => @user.pending_contacts\n end", "title": "" }, { "docid": "df758d5331a26b5bf3fbc02b21b93bb7", "score": "0.53739035", "text": "def accept\n self.status = :accepted\n self.group.add_members(self.receiver, self.role, :was_invited, self.sender)\n self.save\n end", "title": "" }, { "docid": "26ca3607fe6443d590a60e605d660d5d", "score": "0.5373588", "text": "def pending?\n status == 'pending'\n end", "title": "" }, { "docid": "6647d7257df9bcbdda482f149f4c0e67", "score": "0.53709596", "text": "def pending?\n (status == ConfigCenter::User::PENDING)\n end", "title": "" }, { "docid": "f3274696e6c69daa7e725c3c236e13df", "score": "0.537089", "text": "def pending?(allow_unconfirmed: false)\n params = {\n include_only_confirmed: !allow_unconfirmed,\n _access: :exists\n }\n\n rpc(:pending_exists, :hash, params) == 1\n end", "title": "" }, { "docid": "27fa858c0f04d8260d0dee777814f6cd", "score": "0.53626287", "text": "def enter_pending\n update_attribute(:status, :pending)\n end", "title": "" }, { "docid": "541ab1d7fc0f3487b7e6a24153d2a1af", "score": "0.5361686", "text": "def request_not_pending\n return if @request.pending?\n\n flash[:danger] = t \"request.noti.no_edit\"\n return redirect_to admin_requests_path if current_user.admin?\n\n redirect_to requests_path\n end", "title": "" }, { "docid": "869b8a0628b80d6283c6f570efc72ab0", "score": "0.53596467", "text": "def user_must_own_membership\n # User ID match\n @membership = @user.memberships.find_by(id: params[:id])\n return if @membership && @membership.invite_status != 'left'\n\n alert_and_redirect('Invalid membership or user has left.', login_path, :bad_request)\n end", "title": "" }, { "docid": "9bf774a4b0d0d44839222d50ce333a49", "score": "0.5358526", "text": "def pending?\n status == 'pending'\n end", "title": "" }, { "docid": "3c296b7674b3bddb7b0ae4b69a406aa8", "score": "0.5353373", "text": "def friend_request\n @friend_requests = FriendRequest.where(:friend_id=>current_user.id,:status=>\"friend request pending\")\n end", "title": "" }, { "docid": "ec0631ea7cfab1ae63b79e7ece3ae29a", "score": "0.5351933", "text": "def create\n\t\tFriendship::request(@user, @friend)\n\t\tUserMailer::friend_request(\n\t\t\t:user => @user,\n\t\t\t:friend => @friend,\n\t\t\t:user_url => profile_for(@user),\n\t\t\t:accept_url => url_for(:action => \"accept\", :id => @user.screen_name),\n\t\t\t:decline_url => url_for(:action => \"decline\", :id => @user.screen_name)\n\t\t).deliver_now\n\t\tflash[:notice] = \"Friend request sent.\"\n\t\tredirect_to profile_for(@friend)\n\tend", "title": "" }, { "docid": "bc5e7da7ea2aa6cdf6ff424c00f1af29", "score": "0.535139", "text": "def grant_auth(from, to)\n ownusr = User.first(:nickname=>from)\n\n tousr = User.first(:nickname=>to)\n return ret_fail('user not found!') if tousr == nil #the user is not in the database\n\n contact = ownusr.contacts.first(:userid => tousr.id)\n return ret_fail(to+' not in your contact list') if contact==nil #first add the user before accepting auth_request!\n\n\n #check the authorization state\n hiscontact = tousr.contacts.first(:userid => ownusr.id)\n return ret_fail('not in list of '+to) if hiscontact==nil\n return ret_fail(to+' is already authorized') if hiscontact.authgiven =='t'\n return ret_fail('authorization was not requested') if hiscontact.authgiven=='f' #makes no sense to grant before getting a request...\n\n #so state is pending -> lets change to given\n hiscontact.authgiven = 't'\n hiscontact.save\n\n #append notification to queue and save db record\n tousr.messages.create(:data => JSON.generate({'type'=>'auth_grant','from'=>from}))\n\n return ret_success\nend", "title": "" }, { "docid": "dfce185db8ae630dd9f8c174dd426103", "score": "0.53505886", "text": "def friend_requests\n FriendRequest.all.select do |req|\n req.to_user_id == self.id && req.pending\n end\n end", "title": "" }, { "docid": "dd6d3576ded534547bbeea92a3e2edb2", "score": "0.53505605", "text": "def get(incoming={})\n opts = HttpClient::Helper.symbolize_keys(incoming)\n query = {\n :org_guid => HttpClient::Preconditions.assert_class_or_nil('org_guid', HttpClient::Helper.to_uuid(opts.delete(:org_guid)), String),\n :org_key => HttpClient::Preconditions.assert_class_or_nil('org_key', opts.delete(:org_key), String),\n :user_guid => HttpClient::Preconditions.assert_class_or_nil('user_guid', HttpClient::Helper.to_uuid(opts.delete(:user_guid)), String),\n :role => HttpClient::Preconditions.assert_class_or_nil('role', opts.delete(:role), String),\n :limit => HttpClient::Preconditions.assert_class_or_nil('limit', opts.delete(:limit), Integer),\n :offset => HttpClient::Preconditions.assert_class_or_nil('offset', opts.delete(:offset), Integer)\n }.delete_if { |k, v| v.nil? }\n @client.request(\"/membership_requests\").with_query(query).get.map { |hash| Apidoc::Models::MembershipRequest.new(hash) }\n end", "title": "" }, { "docid": "8584ceeb59d4b7d2eed331d99d7cd03a", "score": "0.53505373", "text": "def pending?\n status == :pending\n end", "title": "" }, { "docid": "c03934ebf5cedfc46b5c2e578dba6d6c", "score": "0.53492963", "text": "def accept_invite\n group = Group.find(params[:group_id])\n user = User.find(params[:user_id])\n membership = Membership.find_by_group_id_and_user_id(group, user)\n unless membership.nil?\n membership.update_attributes :acceptance_status => true\n respond_to do |format|\n format.html { redirect_to group_path(group), alert: \"Now member of #{group.name}\" }\n format.json { head :no_content }\n end\n else\n respond_to do |format|\n format.html { redirect_to groups_path, alert: \"Not accepted. You have not been invited to the group\" }\n format.json { render json: \"You have not been invited to the group\", status: :forbidden}\n end\n end\n end", "title": "" }, { "docid": "e6fc950ef39411e464765dd34896c690", "score": "0.5345496", "text": "def sendreq\n newReq = Joinrequest.new(:resolved => false, :manager_id => params[:id], :property_id => params[:pid], :tenant_id => session[:user_id])\n newReq.save\n redirect_to \"/tenants/show\"\n end", "title": "" }, { "docid": "fa43b076ea76852c9c87fdbaf7031c69", "score": "0.53375405", "text": "def request(data)\n # student start requesting\n current_user.change_state('requesting')\n fetch_tutor_count = Settings.single_notification_tutor_count\n tutors = TutorOnlineQueue.instance.poll(fetch_tutor_count)\n if !tutors.empty?\n # broadcast the student request to tutors\n for tutor_id in tutors\n msg = { student_id: current_user.id, plan_id: data['plan_id'] }\n MessageBroadcastJob.perform_later(msg,\n 'comming_request',\n tutor_id: tutor_id)\n end\n else\n # tutor is not available\n MessageBroadcastJob.perform_later(\n I18n.t('students.errors.appointment.busy'),\n 'error', student_id: current_user.id)\n # student back to online state\n current_user.change_state('online')\n end\n end", "title": "" } ]
67082cb725546ed00db28db4feb584ec
Sets the old properties of the given relationship, overwrites old properties
[ { "docid": "61d8903e14d46027e94432b4173850fc", "score": "0.70303506", "text": "def set_rel_props(rel, hash)\n @batch_inserter.set_relationship_properties(rel, hash)\n end", "title": "" } ]
[ { "docid": "0047f1efd4c1db4e0614a70e8e966b30", "score": "0.6898457", "text": "def update(attrs)\n @attrs.update(attrs[:relationship]) unless attrs[:relationship].nil?\n self\n end", "title": "" }, { "docid": "b9fe890161f193fe7a93e47e7bb22708", "score": "0.68010914", "text": "def update(attrs)\n @attrs ||= {}\n @attrs.update(attrs[:relationship]) unless attrs[:relationship].nil?\n self\n end", "title": "" }, { "docid": "f695810c23b6af55abb8dff09a84a8f9", "score": "0.6620428", "text": "def relationship_set_props id, data\n headers = {\n 'Accept' => 'application/json; charset=UTF-8',\n 'Content-Type' => 'application/json',\n }\n\n put_request 'relationship/' + id + '/properties', data, headers\n end", "title": "" }, { "docid": "f8f2f540aee33168a088fa7a4d2aad61", "score": "0.65673685", "text": "def relationship_set_property id, name, value\n headers = {\n 'Accept' => 'application/json; charset=UTF-8',\n }\n\n put_request 'relationship/' + id + '/properties/' + name, value, headers\n end", "title": "" }, { "docid": "e6a9f749cd4366af139cc17783ec570e", "score": "0.63573366", "text": "def affect_relation_values!\n Relations.new(@klass).affect_relation_values!\n end", "title": "" }, { "docid": "42654f3cf9aa8f29e3518a5d45410b0f", "score": "0.6292885", "text": "def update_from_relation(field_name, related = Ladder::Config.settings[:with_relations])\n objects = send(field_name).to_a\n\n if related || embedded_relations[field_name]\n # Force autosave of related documents to ensure correct serialization\n methods.select { |i| i[/autosave_documents/] }.each { |m| send m }\n\n # update inverse relation properties\n relation = relations[field_name]\n objects.each { |object| object.resource.set_value(relation.inverse, rdf_subject) } if relation.inverse\n objects.map(&:update_resource)\n else\n # remove inverse relation properties\n objects.each { |object| resource.delete [object.rdf_subject] }\n objects.map(&:rdf_subject)\n end\n end", "title": "" }, { "docid": "759097a01acbef9eb5beec48b89c6de4", "score": "0.6113233", "text": "def relationship_attributes=(attrs)\n\n # Don't try to set relationships that fail validation\n validate_relationships(attrs)\n @invalid_rels.each do |rel|\n attrs = attrs.reject{|a| a['relationship_name'] == rel.relationship_name && a['relationship_value'] == rel.relationship_value }\n end\n\n # Clear out old relationships\n rels_ext_edit_fields.each do |predicate_name|\n pred = ActiveFedora::Predicates.find_graph_predicate(predicate_name)\n clear_relationship(pred)\n end\n\n attrs = attrs.reject{|e| e['relationship_name'].blank? || e['relationship_value'].blank? }\n\n # Only accept fields that users are allowed to edit\n attrs = attrs.reject{|e| !rels_ext_edit_fields.include?(e['relationship_name'].to_sym) }\n\n attrs.each do |attr|\n predicate_name = attr['relationship_name'].to_sym\n pred = ActiveFedora::Predicates.find_graph_predicate(predicate_name)\n add_relationship(pred, 'info:fedora/' + attr['relationship_value'])\n end\n self.rels_ext.content = rels_ext.to_rels_ext()\n end", "title": "" }, { "docid": "ebfae63f1152ae5ad3923c1c6bf0da1f", "score": "0.59993005", "text": "def set(source, target)\n assert_kind_of 'source', source, source_model\n assert_kind_of 'target', target, target_model, NilClass\n\n @relationship.set(source, [ target ].compact)\n target\n end", "title": "" }, { "docid": "202f9b857e0802bf3a39efc682b3501c", "score": "0.59749883", "text": "def update!(**args)\n @relation_descriptor = args[:relation_descriptor] if args.key?(:relation_descriptor)\n end", "title": "" }, { "docid": "f0dd489c52fa73b1c3846fa43727c29e", "score": "0.5939472", "text": "def update!(**args)\n @object_id_prop = args[:object_id_prop] if args.key?(:object_id_prop)\n @relation = args[:relation] if args.key?(:relation)\n @subject_id = args[:subject_id] if args.key?(:subject_id)\n end", "title": "" }, { "docid": "1e3e67de67e57bdd351242446bc8010e", "score": "0.59253293", "text": "def update!(**args)\n @relation = args[:relation] if args.key?(:relation)\n end", "title": "" }, { "docid": "042846d9da4842954a224210be679310", "score": "0.5924041", "text": "def update_relationship_dates\n return true if self.is_a? Relationship\n\n relationships.each do |ass|\n ass.date = self.date\n ass.save\n end\n end", "title": "" }, { "docid": "09433a2a973dc4bfe0aae70e3dacb2a4", "score": "0.59152335", "text": "def relationship=(value)\n @relationship = value\n end", "title": "" }, { "docid": "c7a2880c3da02b3708afc43c48d37f2e", "score": "0.59024155", "text": "def update(context={})\n self.pre_cast_attributes\n m2o = @relations.reject{|k, v| !self.class.many2one_relations.has_key?(k)}\n vals = @attributes.reject {|key, value| key == 'id'}.merge(m2o.merge(m2o){|k, v| v.is_a?(Array) ? v[0] : v})\n self.class.rpc_execute('write', self.id, vals, context)\n reload_from_record!(self.class.find(self.id, :context => context))\n end", "title": "" }, { "docid": "d32d40da3b89797d2bc3fdabb5adec62", "score": "0.5900995", "text": "def add_relationship(rel_attr); end", "title": "" }, { "docid": "5c1be7a073a04da1f167d86a3706961f", "score": "0.58814174", "text": "def default_attributes\n target_key = relationship.target_key.map { |property| property.name }\n source_scope = relationship.source_scope(source)\n super.except(*target_key).update(source_scope).freeze\n end", "title": "" }, { "docid": "3cf2174db94c3cd6cf901f85a1df5593", "score": "0.5783363", "text": "def update!(**args)\n @attribute_id = args[:attribute_id] if args.key?(:attribute_id)\n @entity_relationship = args[:entity_relationship] if args.key?(:entity_relationship)\n @freebase_mid = args[:freebase_mid] if args.key?(:freebase_mid)\n @personal_entity_child = args[:personal_entity_child] if args.key?(:personal_entity_child)\n end", "title": "" }, { "docid": "ea25adea5b43c27e6c84f27ad88c3d9f", "score": "0.5739855", "text": "def set_properties(hash)\n hash.each do |key, value|\n add_or_remove_ostruct_member(key, value)\n end\n rest_reset_properties\n end", "title": "" }, { "docid": "73b836ca1149688b3de03743e522b47b", "score": "0.5712002", "text": "def reset_properties(hash)\n @table.keys.each{|key| remove_ostruct_member(key)}\n hash.each{|key,value| new_ostruct_member(key,value)}\n rest_reset_properties\n end", "title": "" }, { "docid": "9039a1d41c2c8f338e83e23e3cc7b41a", "score": "0.57035536", "text": "def update!(**args)\n @annotated_relationship = args[:annotated_relationship] if args.key?(:annotated_relationship)\n @annotations = args[:annotations] if args.key?(:annotations)\n @collections = args[:collections] if args.key?(:collections)\n @entity_join = args[:entity_join] if args.key?(:entity_join)\n @id = args[:id] if args.key?(:id)\n @mrf = args[:mrf] if args.key?(:mrf)\n end", "title": "" }, { "docid": "04d852f097552fddba7307c269790ac9", "score": "0.56736034", "text": "def update(related, parent, options)\n parent.send(\"#{options.foreign_key}=\", related.id); related\n end", "title": "" }, { "docid": "20ce501c17769f432041d566b9559b38", "score": "0.5651181", "text": "def set_relationship\n @relationship = Relationship.find(params[:id])\n end", "title": "" }, { "docid": "20ce501c17769f432041d566b9559b38", "score": "0.5651181", "text": "def set_relationship\n @relationship = Relationship.find(params[:id])\n end", "title": "" }, { "docid": "20ce501c17769f432041d566b9559b38", "score": "0.5651181", "text": "def set_relationship\n @relationship = Relationship.find(params[:id])\n end", "title": "" }, { "docid": "20ce501c17769f432041d566b9559b38", "score": "0.5651181", "text": "def set_relationship\n @relationship = Relationship.find(params[:id])\n end", "title": "" }, { "docid": "20ce501c17769f432041d566b9559b38", "score": "0.5651181", "text": "def set_relationship\n @relationship = Relationship.find(params[:id])\n end", "title": "" }, { "docid": "20ce501c17769f432041d566b9559b38", "score": "0.5651181", "text": "def set_relationship\n @relationship = Relationship.find(params[:id])\n end", "title": "" }, { "docid": "20ce501c17769f432041d566b9559b38", "score": "0.5651181", "text": "def set_relationship\n @relationship = Relationship.find(params[:id])\n end", "title": "" }, { "docid": "20ce501c17769f432041d566b9559b38", "score": "0.5651181", "text": "def set_relationship\n @relationship = Relationship.find(params[:id])\n end", "title": "" }, { "docid": "20ce501c17769f432041d566b9559b38", "score": "0.5651181", "text": "def set_relationship\n @relationship = Relationship.find(params[:id])\n end", "title": "" }, { "docid": "90e3afb814e144b866e2d649d3e3b809", "score": "0.56458896", "text": "def freeze\n associations\n super\n associations.freeze\n self\n end", "title": "" }, { "docid": "7743300d458dedb05b7d2682d5bab6a9", "score": "0.5645784", "text": "def _refresh_set_values(hash)\n @associations.clear if @associations\n super\n end", "title": "" }, { "docid": "2c02f9d9f88d07130fb79d4351cf3fb7", "score": "0.5634138", "text": "def nullify\n target.send(metadata.foreign_key_setter, nil)\n target.send(:remove_instance_variable, \"@#{metadata.inverse(target)}\")\n base.send(:remove_instance_variable, \"@#{metadata.name}\")\n target.save\n end", "title": "" }, { "docid": "34bb4fe6b4630a2d1a646cb2a42efc6a", "score": "0.5616782", "text": "def set_property_related\n @property_related = PropertyRelated.find(params[:id])\n @archive = @property_related.archive\n end", "title": "" }, { "docid": "6b836f3655eb4e00c05e85a68193d7cb", "score": "0.5591432", "text": "def _inverse_relation\n _relation.inverse_setter.delete(\"=\")\n end", "title": "" }, { "docid": "001055e9e1dd9d795c4e9e52e16bf915", "score": "0.55713904", "text": "def update_attributes_hash(replacement)\n if replacement\n _base.attributes.merge!(_association.store_as => replacement.attributes)\n else\n _base.attributes.delete(_association.store_as)\n end\n end", "title": "" }, { "docid": "e6bbada9486358da1b99df6916de52f8", "score": "0.556923", "text": "def save\n if self.changed? || self.relationships_changed?\n self._version = current_version + 1\n super\n revise\n end\n end", "title": "" }, { "docid": "00fcbeab9b05081e96946b13cae2de8d", "score": "0.5566263", "text": "def set_relationship\n #find relationship\n @relationship = Relationship.find_by_id(params[:id])\n end", "title": "" }, { "docid": "69a962ce6f615ddddbed72e523f97674", "score": "0.5544529", "text": "def reload(*)\n result = super\n\n self.class.relations_of_type(:has_many).each do |klass|\n attr_name = klass.to_s.pluralize.underscore\n instance_variable_set(\"@#{attr_name}\", nil)\n end\n\n result\n end", "title": "" }, { "docid": "9872eebd3f66070e07184ed8c8051a83", "score": "0.5538611", "text": "def set_property\n @property = Property.all\n end", "title": "" }, { "docid": "ea3b6f13961c39f62979bd099c93dc37", "score": "0.55325806", "text": "def setRelatedObject objid\n attribute_set(:relatedObjectId, objid)\n end", "title": "" }, { "docid": "69c4cbf96b6faa288d702200f44721a1", "score": "0.55046874", "text": "def update!(**args)\n @relation = args[:relation] if args.key?(:relation)\n @source = args[:source] if args.key?(:source)\n @target = args[:target] if args.key?(:target)\n end", "title": "" }, { "docid": "85a79fb5c3cc199e689344861658b09b", "score": "0.54965127", "text": "def _update!\n self.class.properties.each do |property, predicate|\n if dirty?(property)\n self.class.repository_or_fail.delete([subject, predicate[:predicate], nil])\n if self.class.is_list?(property)\n repo = RDF::Repository.new\n attribute_get(property).each do |value|\n repo << RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(value, self.class.properties[property][:type]))\n end\n self.class.repository_or_fail.insert(*repo)\n else\n self.class.repository_or_fail.insert(RDF::Statement.new(subject, predicate[:predicate], self.class.build_rdf_value(attribute_get(property), self.class.properties[property][:type])))\n end\n end\n @dirty[property] = nil\n @attributes[:original][property] = attribute_get(property)\n end\n self.class.repository_or_fail.insert(RDF::Statement.new(@subject, RDF.type, type)) unless type.nil?\n end", "title": "" }, { "docid": "9b482a295162deb31878dbac3155d0c7", "score": "0.5479649", "text": "def touch_associations\n model.touched_associations.each do |assoc, column|\n r = model.association_reflection(assoc)\n next unless r.can_have_associated_objects?(self)\n ds = send(r.dataset_method)\n\n if ds.send(:joined_dataset?)\n # Can't update all values at once, so update each instance individually.\n # Instead if doing a simple save, update via the instance's dataset,\n # to avoid going into an infinite loop in some cases.\n send(assoc).each{|x| x.this.update(column=>touch_association_value)}\n else\n # Update all values at once for performance reasons.\n ds.update(column=>touch_association_value)\n associations.delete(assoc)\n end\n end\n end", "title": "" }, { "docid": "8375062c60ee40992547d1391e5a7f05", "score": "0.5476614", "text": "def clear_relationships\n @relationships = {}\n end", "title": "" }, { "docid": "c7783745e45050ac531b5df1c3fab58e", "score": "0.54731023", "text": "def up_via!(property, group)\n #parameter passed a property type?\n return if property.class != Property\n return if group.class != Group\n #get all relationships for this entity via the given group\n relationships = property_relations_via group\n relationship = EntityPropertyRelationship.find_by(entity_id: self.id, property_id: property.id, group_id: group.id)\n #relationship exist?\n return if relationship.nil?\n #already last?\n return if relationship.position == 0\n #relationship after property\n swap = self.property_relations_via(group)[relationship.position - 1]\n #move the property below the passed property up\n swap.update_attribute(:position, swap.position + 1)\n #move the passed property down\n relationship.update_attribute(:position, relationship.position - 1)\n end", "title": "" }, { "docid": "f467a3ac4d35fbe8fad4531743c00dc1", "score": "0.5450236", "text": "def merge(relationship)\n if !documentation\n self.documentation = relationship.documentation\n elsif documentation != relationship.documentation\n documentation.merge(relationship.documentation)\n end\n relationship.properties.each do |property|\n unless properties.find { |my_prop| my_prop.property_definition.name == property.property_definition.name && my_prop.value == property.value}\n properties << property\n end\n end\n @access_type ||= relationship.access_type\n end", "title": "" }, { "docid": "76c84461976d0fb8f1bbea04d66ee087", "score": "0.54494", "text": "def update_relationship_attribute(database_id:, collection_id:, key:, on_delete: nil)\n path = '/databases/{databaseId}/collections/{collectionId}/attributes/{key}/relationship'\n .gsub('{databaseId}', database_id)\n .gsub('{collectionId}', collection_id)\n .gsub('{key}', key)\n\n if database_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"databaseId\"')\n end\n\n if collection_id.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"collectionId\"')\n end\n\n if key.nil?\n raise Appwrite::Exception.new('Missing required parameter: \"key\"')\n end\n\n params = {\n onDelete: on_delete,\n }\n \n headers = {\n \"content-type\": 'application/json',\n }\n\n @client.call(\n method: 'PATCH',\n path: path,\n headers: headers,\n params: params,\n response_type: Models::AttributeRelationship\n )\n end", "title": "" }, { "docid": "d9e6ff8b284a8500583457dba95afb5d", "score": "0.5439139", "text": "def set!(resource, association)\n resource.instance_variable_set(instance_variable_name, association)\n end", "title": "" }, { "docid": "3b0124cf66dc7cb669551d498026a8d3", "score": "0.54254633", "text": "def reload\n new_attributes = resource.find(self)._attributes_\n @_attributes_ = nil\n mass_assign(new_attributes)\n self\n end", "title": "" }, { "docid": "cebf1456ccfe2d8bdcb1262d66876f27", "score": "0.5424696", "text": "def apply_relation_changes(object, changes)\n # The operation is done in two parts to avoid problems with\n # creating cycles in the graph: first we remove the old edges, then\n # we add the new ones.\n changes.each_slice(3) do |rel, parents, children|\n next if rel.copy_on_replace?\n\n parents.each_slice(2) do |parent, info|\n parent.remove_child_object(self, rel)\n end\n children.each_slice(2) do |child, info|\n remove_child_object(child, rel)\n end\n end\n\n # See comment above about keeping the two loops separate\n changes.each_slice(3) do |rel, parents, children| # rubocop:disable Style/CombinableLoops\n parents.each_slice(2) do |parent, info|\n parent.add_child_object(object, rel, info)\n end\n children.each_slice(2) do |child, info|\n object.add_child_object(child, rel, info)\n end\n end\n end", "title": "" }, { "docid": "495ca18c31b8dd3b4d80b521f62af648", "score": "0.5423638", "text": "def update!(**args)\n @agency_associations = args[:agency_associations] if args.key?(:agency_associations)\n end", "title": "" }, { "docid": "4358b2d244628b3c1056be409f0add93", "score": "0.54221934", "text": "def _change\n @save_mixin.json_dict = @json_dict\n @save_mixin._deleted = @_deleted\n @save_mixin._change\n @json_dict = @save_mixin.json_dict\n end", "title": "" }, { "docid": "032d5cf81d8710f5fa1c4945f2134acf", "score": "0.54028887", "text": "def _set_associated_object(opts, o)\n a = associations[opts[:name]]\n return if a && a == o && !set_associated_object_if_same?\n run_association_callbacks(opts, :before_set, o)\n remove_reciprocal_object(opts, a) if a\n send(opts._setter_method, o)\n associations[opts[:name]] = o\n add_reciprocal_object(opts, o) if o\n run_association_callbacks(opts, :after_set, o)\n o\n end", "title": "" }, { "docid": "c6f155af68cd0594c76b6f8251dd64a2", "score": "0.5392903", "text": "def after_update\n super\n touch_associations\n end", "title": "" }, { "docid": "6631cca1afe62ae8ed333c8370f50826", "score": "0.5377321", "text": "def freeze\n @touched_associations.freeze\n\n super\n end", "title": "" }, { "docid": "a7c262fe69d096d97575cb824bed68a6", "score": "0.53750855", "text": "def replace(other)\n if loaded?\n orphan_resources(self)\n end\n other = other.map { |r| r.kind_of?(Hash) ? new(r) : r }\n relate_resources(other)\n super(other)\n end", "title": "" }, { "docid": "43818facc6bca1b57d8708b0a4532653", "score": "0.5373663", "text": "def setter(name, metadata)\n re_define_method(\"#{name}=\") do |object|\n without_autobuild do\n if value = get_relation(name, metadata, object)\n if value.respond_to?(:substitute)\n set_relation(name, value.substitute(object.substitutable))\n end\n else\n __build__(name, object.substitutable, metadata)\n end\n end\n end\n self\n end", "title": "" }, { "docid": "1966cc52204bdf1e35ce3d7bf916aaab", "score": "0.5356413", "text": "def parent=(new_parent) \n parent.children.delete(self) if @parent #=> this is the old parent removing the child that is being adopted \n @parent = new_parent #=> I have a new mommy! \n new_parent.children << self unless @parent == nil || new_parent.children.include?(self) \n end", "title": "" }, { "docid": "2c7d159ba6e2eb6ab6f45fe1c4f277e0", "score": "0.53538895", "text": "def relate base, name, metadata\n base.relations_sleeping_king_studios.update metadata.relation_key => metadata\n end", "title": "" }, { "docid": "b4e0bbf4b8d55f2a2eaba5500141a6d3", "score": "0.5348715", "text": "def init_on_load(persisted_node, properties)\n self.class.extract_association_attributes!(properties)\n @_persisted_obj = persisted_node\n changed_attributes_clear!\n @attributes = convert_and_assign_attributes(properties)\n end", "title": "" }, { "docid": "10e41ec39ba2af73495ccece21c2d8a3", "score": "0.5321707", "text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "title": "" }, { "docid": "10e41ec39ba2af73495ccece21c2d8a3", "score": "0.5321707", "text": "def update!(**args)\n @subobject_properties = args[:subobject_properties] if args.key?(:subobject_properties)\n end", "title": "" }, { "docid": "37d9f18cc9b05f1ae122195a0bca39fb", "score": "0.53215736", "text": "def cascade_preservation\n self.reload\n if self.can_perform_cascading?\n self.cascading_elements.each do |pib|\n pib.preservation_profile = self.preservation_profile\n pib.save\n end\n end\n end", "title": "" }, { "docid": "90eb11c2004ef3532227b6ca9ce6e895", "score": "0.5304182", "text": "def relationship(rel_class)\n @relationship = rel_class\n self\n end", "title": "" }, { "docid": "dbe9cacf38fa9d01fb8405b34f8f28b9", "score": "0.5301427", "text": "def replace_related_type(old, new)\n $db.execute \"UPDATE destination.series_relationships SET type = ? WHERE type = ?\", new, old;\nend", "title": "" }, { "docid": "e380d527447bc17a6eb272144760a18d", "score": "0.5300342", "text": "def creators_rels_attributes=(args={})\n args.each_pair do |k,v|\n destroy = v[\"__destroy\"] == \"1\"\n if k.include?(\"new\") or v[\"id\"].empty? # this is a newly added relationship\n unless destroy\n self.save #first we need to persist the document. \n creator = v[\"class\"].constantize.find_or_create_by(:name => v[\"end_node_name\"])\n creator_role = Creator.new(:creators, self, creator, {:role => v[\"role\"] })\n creator_role.save\n end\n else # existing relationship, lets check it. \n if destroy \n creator = Creator.find(v[\"id\"])\n creator.destroy \n else\n creator = Creator.find(v[\"id\"])\n unless creator.role == v[\"role\"]\n creator.role = v[\"role\"]\n creator.save\n end\n end\n end\n end\n end", "title": "" }, { "docid": "dbec8023ca8a4f74fce16ea9a3eba93a", "score": "0.529696", "text": "def apply_relationships(obj, json, opts, new_record = false)\n delete_existing_relationships(obj) if !new_record\n\n @relationships.each do |relationship_name, relationship_defn|\n property_name = relationship_defn.json_property\n\n # If there's no property name, the relationship is just read-only\n next if !property_name\n\n # For each record reference in our JSON data\n ASUtils.as_array(json[property_name]).each_with_index do |reference, idx|\n record_type = parse_reference(reference['ref'], opts)\n\n referent_model = relationship_defn.participating_models.find {|model|\n model.my_jsonmodel.record_type == record_type[:type]\n } or raise \"Couldn't find model for #{record_type[:type]}\"\n\n referent = referent_model[record_type[:id]]\n\n if !referent\n raise ReferenceError.new(\"Can't relate to non-existent record: #{reference['ref']}\")\n end\n\n # Create a new relationship instance linking us and them together, and\n # add the properties from the JSON request to the relationship\n properties = reference.clone.tap do |properties|\n properties.delete('ref')\n end\n\n properties[:aspace_relationship_position] = idx\n properties[:system_mtime] = Time.now\n properties[:user_mtime] = Time.now\n\n relationship_defn.relate(obj, referent, properties)\n\n # If this is a reciprocal relationship (defined on both participating\n # models), update the referent's lock version to ensure that a\n # concurrent update to that object won't clobber our changes.\n\n if referent_model.find_relationship(relationship_name, true) && !opts[:system_generated]\n DB.increase_lock_version_or_fail(referent)\n end\n end\n end\n end", "title": "" }, { "docid": "80dee7cd979e5ccad4d64249705b24d0", "score": "0.5285231", "text": "def update_links\n return if self.suppress_recreate_trigger == true\n \n marc_foreign_objects = Hash.new\n \n # All the allowed relation types *must* be in this array or they will be dropped\n allowed_relations = [\"people\", \"standard_titles\", \"standard_terms\", \"institutions\", \"catalogues\", \"liturgical_feasts\", \"places\"]\n \n # Group all the foreign associations by class, get_all_foreign_associations will just return\n # a flat list of objects\n marc.get_all_foreign_associations.each do |object_id, object|\n next if object.is_a? Source\n \n foreign_class = object.class.name.pluralize.underscore\n marc_foreign_objects[foreign_class] = [] if !marc_foreign_objects.include? (foreign_class)\n \n marc_foreign_objects[foreign_class] << object\n \n end\n \n # allowed_relations explicitly needs to contain the classes we will repond to\n # Log if in the Marc there are \"unknown\" classes, should never happen\n unknown_classes = marc_foreign_objects.keys - allowed_relations\n # If there are unknown classes purge them\n related_classes = marc_foreign_objects.keys - unknown_classes\n \n if !unknown_classes.empty?\n puts \"Tried to relate with the following unknown classes: #{unknown_classes.join(',')}\"\n end\n \n related_classes.each do |foreign_class|\n relation = self.send(foreign_class)\n \n # The foreign class array holds the correct number of object\n # We want to delete or add only the difference betweend\n # what is in marc and what is in the DB relations\n new_items = marc_foreign_objects[foreign_class] - relation.to_a\n remove_items = relation.to_a - marc_foreign_objects[foreign_class]\n \n # Delete or add to the DB relation\n relation.delete(remove_items)\n relation << new_items\n\n # If this item was manipulated, update also the src count\n # Unless the suppress_update_count is set\n if !self.suppress_update_count_trigger\n (new_items + remove_items).each do |o|\n o.update_attribute( :src_count, o.sources.count )\n end\n end\n \n end\n \n # update the parent manuscript when having 773/772 relationships\n update_77x unless self.suppress_update_77x_trigger == true \n end", "title": "" }, { "docid": "dd3a338ae6fe78f6c68d40a2f01ba55c", "score": "0.5282047", "text": "def association_changed(record)\n\t\ttouch if persisted?\n\tend", "title": "" }, { "docid": "11776ff92c9e9c467a3d8a27196ec962", "score": "0.52802825", "text": "def reload_relations\n relations.each_pair do |name, meta|\n if instance_variable_defined?(\"@#{name}\")\n if _parent.nil? || instance_variable_get(\"@#{name}\") != _parent\n remove_instance_variable(\"@#{name}\")\n end\n end\n end\n end", "title": "" }, { "docid": "a2032c0769692b1749c3146b9d3b301f", "score": "0.5274538", "text": "def persist_collection_relationships(record)\n record.class.reflect_on_all_associations\n .select { |ref| ref.collection? && !ref.through_reflection && record.association(ref.name).any? }\n .map do |ref|\n [\n ref.has_inverse? ? ref.inverse_of.name : ref.options[:as],\n record.association(ref.name).target\n ]\n end\n .to_h.each do |name, targets|\n targets.each { |t| t.update name => record }\n end\n end", "title": "" }, { "docid": "9d5323c15df396666ef792cde2d203fe", "score": "0.52673304", "text": "def down_via!(property, group)\n #parameter passed a property type?\n return if property.class != Property\n return if group.class != Group\n #get all relationships for this entity via the given group\n relationships = property_relations_via group\n relationship = EntityPropertyRelationship.find_by(entity_id: self.id, property_id: property.id, group_id: group.id)\n #relationship exist?\n return if relationship.nil?\n #already last?\n return if relationship.position == relationships.count - 1\n #relationship after property\n swap = self.property_relations_via(group)[relationship.position + 1]\n #move the property below the passed property up\n swap.update_attribute(:position, swap.position - 1)\n #move the passed property down\n relationship.update_attribute(:position, relationship.position + 1)\n end", "title": "" }, { "docid": "3c352cd6851dc9d698ab7e2b08194405", "score": "0.5265783", "text": "def save(*)\n update_magic_properties\n clear_association_cache\n create_or_update\n end", "title": "" }, { "docid": "593de84fa9950baa68153e4fa9b6e17c", "score": "0.5259512", "text": "def apply_properties!(properties)\n # Non-commutitivity etc. eventually.\n end", "title": "" }, { "docid": "6fe6e8df338a1f07d832eeed53755a59", "score": "0.5250866", "text": "def replace(serialize_context: new_serialize_context, deserialize_context: new_deserialize_context, lock_owner: nil, &block)\n write_association(serialize_context: serialize_context, deserialize_context: deserialize_context, lock_owner: lock_owner, &block)\n end", "title": "" }, { "docid": "e0c7b2542cbbf6f7e40726e16de21d53", "score": "0.5246744", "text": "def set_game_gameset_relationship\n @game_gameset_relationship = GameGamesetRelationship.find(params[:id])\n end", "title": "" }, { "docid": "2e7354fede50f2195d344e84a8350381", "score": "0.52360713", "text": "def replace_to_one_relationship(source_record:, new_related_record:, relationship_type:)\n relationship_method = \"replace_#{relationship_type}?\"\n authorize_relationship_operation(\n source_record: source_record,\n relationship_method: relationship_method,\n related_record_or_records: new_related_record\n )\n end", "title": "" }, { "docid": "e10aad0f6f07d18ca582b4252f284a5f", "score": "0.52324116", "text": "def relationship(rel_class)\n @relationship = rel_class\n self\n end", "title": "" }, { "docid": "c255cf9303353509aedd4a06b3de2b1a", "score": "0.5226271", "text": "def set_fedora_obsolete_parent_digital_object_pid_relationships\n # This method also ensures that we only save pids for Objects that actually exist. Invalid pids will cause it to fail.\n values = @parent_digital_object_pids.map { |object_pid| ActiveFedora::Base.find(object_pid).internal_uri }\n set_fedora_object_relationship(:cul_obsolete_from, values)\n end", "title": "" }, { "docid": "53e026e276f8807500ecc80e015ac872", "score": "0.52256316", "text": "def nested_attributes_update_attributes(meta, obj, attributes)\n nested_attributes_check_key_modifications(meta, obj) do\n nested_attributes_set_attributes(meta, obj, attributes)\n end\n end", "title": "" }, { "docid": "6ffa81d33240241cb8f04b61518f1875", "score": "0.5223455", "text": "def change_father(father)\n\t\t@father = father\n\tend", "title": "" }, { "docid": "afba14a6f82ca1168979613e050b36ce", "score": "0.52162707", "text": "def update(object, *names)\n key_name = attributes.key[0].name\n key_value = object.public_send(key_name)\n tuple = dump(object)\n fields = names.map { |name| attributes[name].field }\n relation.update({ key_name => key_value }, tuple.reject { |k, _| !fields.include?(k) })\n end", "title": "" }, { "docid": "1c12f310aca206a2cefff8c291007668", "score": "0.5208652", "text": "def update!(**args)\n @property = args[:property] if args.key?(:property)\n @schema = args[:schema] if args.key?(:schema)\n end", "title": "" }, { "docid": "0f6ea4c54f9bc18020c08410f67289cd", "score": "0.51934755", "text": "def change_properties(new_current_floor, new_next_floor, new_movement)\n @current_floor = new_current_floor\n @next_floor = new_next_floor\n @movement = new_movement\n end", "title": "" }, { "docid": "0dcbfeb34442bf58db5551a53426bacd", "score": "0.5180568", "text": "def detach_relationship(data) #FIXME: Method doesn't work, RelationshipManager cannot access to id attribute.\n return @client.raw(\"post\", \"/config/relationships/detach\", nil, data)\n end", "title": "" }, { "docid": "81f407188db9f1fc766feb4b402b62f1", "score": "0.5177533", "text": "def restore\n _update_hash = {}\n object.attributes.reject {|k,v| object.class.ignore_fields_on_restore.include?(k)}.each do |key, value|\n _update_hash.merge! get_restore_hash(key,value)\n end\n object.update_attributes(parameterize(_update_hash))\n end", "title": "" }, { "docid": "a3e4caa1e66cde7db0b2dee0c1d965ad", "score": "0.51738673", "text": "def update!(**args)\n @entity_index = args[:entity_index] if args.key?(:entity_index)\n @link_property_name = args[:link_property_name] if args.key?(:link_property_name)\n end", "title": "" }, { "docid": "b0c100f7371856fabecfe9e31399bf98", "score": "0.5172598", "text": "def update_relationship(table_id, relationship_id, qb_realm_hostname, authorization, opts = {})\n data, _status_code, _headers = update_relationship_with_http_info(table_id, relationship_id, qb_realm_hostname, authorization, opts)\n data\n end", "title": "" }, { "docid": "2d651c618031329abb869ada7bf840ff", "score": "0.5171423", "text": "def update!(**args)\n @attribute = args[:attribute] if args.key?(:attribute)\n @pivot_entity_slot = args[:pivot_entity_slot] if args.key?(:pivot_entity_slot)\n @remodelings = args[:remodelings] if args.key?(:remodelings)\n end", "title": "" }, { "docid": "4d7e441a21bc75402fb757521cf40efe", "score": "0.51690876", "text": "def update_relations\n # relational saves require an id\n return false unless @id.present?\n # verify we have relational changes before we do work.\n return true unless relation_changes?\n raise \"Unable to update relations for a new object.\" if new?\n # get all the relational changes (both additions and removals)\n additions, removals = relation_change_operations\n\n responses = []\n # Send parallel Parse requests for each of the items to update.\n # since we will have multiple responses, we will track it in array\n [removals, additions].threaded_each do |ops|\n next if ops.empty? #if no operations to be performed, then we are done\n responses << client.update_object(parse_class, @id, ops, session_token: _session_token)\n end\n # check if any of them ended up in error\n has_error = responses.any? { |response| response.error? }\n # if everything was ok, find the last response to be returned and update\n #their fields in case beforeSave made any changes.\n unless has_error || responses.empty?\n result = responses.last.result #last result to come back\n set_attributes!(result)\n end #unless\n has_error == false\n end", "title": "" }, { "docid": "561a7833f21f9478b04a76795078ad31", "score": "0.51684207", "text": "def propagate_changes\n if !(changed_attributes.keys & %w(winner winner_id)).empty?\n parent.reset_results if parent.present?\n self.reload\n end\n end", "title": "" }, { "docid": "ea5b3e8d5a09e250234af8b392ee7c05", "score": "0.51623994", "text": "def reset_persistence_values\n self.id = nil\n\n if respond_to?(:updated_at=)\n self.updated_at = nil\n self.updated_at_will_change!\n end\n\n if respond_to?(:created_at=)\n self.created_at = nil\n self.created_at_will_change!\n end\n\n # mark all other attributes is changing\n (attributes.keys - changes.keys).each{ |key| self.send(:\"#{key}_will_change!\") }\n end", "title": "" }, { "docid": "774f436da36b85357811ff8d3c63afe5", "score": "0.51598316", "text": "def give_to(player)\n\t\t\tplayer.game.log '[%s] Gave %s to %s' % [ @owner.name, @name, player.name ]\n\t\t\[email protected] self\n\t\t\t@owner = player\n\t\t\tplayer.properties << self\n\t\tend", "title": "" }, { "docid": "6023bedd6fbb921040a273aa8eb45b5c", "score": "0.515554", "text": "def reload_uncached_association\n \n end", "title": "" }, { "docid": "44756fd86dd095556580199f7e78936f", "score": "0.5148267", "text": "def modified_properties=(value)\n @modified_properties = value\n end", "title": "" }, { "docid": "43b78eb1786dd22d06edb545f7d4b52c", "score": "0.51480955", "text": "def update_attributes!(attributes)\n super(mark_for_destruction(attributes))\n end", "title": "" }, { "docid": "3f64eef5b87a890db1bba6d3f7b7c327", "score": "0.51471394", "text": "def inherited(klass)\n klass.instance_variable_set(:@associations, associations.clone)\n super\n end", "title": "" }, { "docid": "139b0f69c35ef0ace43366e66883173f", "score": "0.5146153", "text": "def update\n @relationship = Relationship.find(params[:id])\n @relationship.update_attributes(params[:relationship])\n @relationships = Relationship.paginate(:page => params[:page], :per_page => 30).order('updated_at DESC')\n end", "title": "" }, { "docid": "e6b4feb04a58cb7dfa31cf43bf6db2a4", "score": "0.5141331", "text": "def reload\n attributes.each_key { |key| send \"#{key}=\", target.send(key) }\n end", "title": "" } ]
c70fffdf12d341bcf1b29d000c3702df
GET /events/1 GET /events/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "aa321cb61c328d7641f0ffee4f6e0b70", "score": "0.75027657", "text": "def show\n @event = Event.find(params[:id])\n render json: @event\n end", "title": "" }, { "docid": "64b8f8ad44f7b6e6250a9fc54b79647c", "score": "0.7400539", "text": "def get(event_id)\n @client.request \"events/#{event_id}\"\n end", "title": "" }, { "docid": "7ea2f3391994b9f86e40689a351e606f", "score": "0.7360897", "text": "def show\n event_id = params[:id]\n if event_id.present?\n @event = Com::Nbos::Events::Event.active_events.where(id: event_id, tenant_id: @user.tenant_id)\n if @event.present?\n render :json => @event\n else\n render :json => {messageCode: \"event.notfound\", message: \"Event Not Found\"}, status: 404\n end\n else\n render :json => {messageCode: \"bad.request\", message: \"Bad Request\"}, status: 400\n end\n end", "title": "" }, { "docid": "64993e34378a276f8adcb75e4c244500", "score": "0.7348184", "text": "def get_events()\n @client.make_request(:get, @client.concat_user_path(\"#{CALL_PATH}/#{id}/events\"))[0]\n end", "title": "" }, { "docid": "5febda362ddaf472b8c6c6319cecc36f", "score": "0.7346945", "text": "def events\n response = self.class.get('/v1/events.json')\n response.code == 200 ? JSON.parse(response.body) : nil\n end", "title": "" }, { "docid": "68ed11088389be43b322d4f0dc75f7d6", "score": "0.7336607", "text": "def index\n #returns all events from eventbrite API, need to change to pull from her endpoint\n @eventList = Event.retrieve_all_events params\n render json: @eventList, status: 200\n end", "title": "" }, { "docid": "2bdaa9476f459d05fdb7080f25fe0657", "score": "0.73168355", "text": "def index\n @events = Event.all\n render json: @events, status: 200\n end", "title": "" }, { "docid": "503c52c8507e6cd5116f3c85d6259631", "score": "0.7287131", "text": "def index\n @event = Event.all\n render json: @event\n end", "title": "" }, { "docid": "cadb01f018a744e64738122bd3b9e9a6", "score": "0.7280633", "text": "def index\n @events = Event.find(:all)\n respond_to do |format|\n format.html\n format.json\n end\n end", "title": "" }, { "docid": "3963988a2e369ae69d3e2e5e5e64680b", "score": "0.7245571", "text": "def index\n respond_to do |format|\n format.html\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "6dfa825090a0345739db26145778532e", "score": "0.72305113", "text": "def get_events\n Resources::Event.parse(request(:get, \"Events\"))\n end", "title": "" }, { "docid": "a069e984b7364b889a975fb865b92e2e", "score": "0.72188705", "text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "a069e984b7364b889a975fb865b92e2e", "score": "0.72188705", "text": "def show\n @event = Event.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "f49e5c498dd19a73abbea8842b47d303", "score": "0.7218353", "text": "def index\n @events = Event.live\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "f49e5c498dd19a73abbea8842b47d303", "score": "0.7218353", "text": "def index\n @events = Event.live\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "ac497f0b2547d185cde2324c46c8d7ee", "score": "0.72150075", "text": "def details\n get(\"v1/event/#{@id}\")\n end", "title": "" }, { "docid": "66cec9200352931dc624c60aa268ea93", "score": "0.72042197", "text": "def index\n @events = Event.all\n render json: @events\n end", "title": "" }, { "docid": "acae2adc8dfe263a567c53eb56360d88", "score": "0.7198604", "text": "def show\n\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "e231dd9cb81b650e9ce6b8a7848baf7f", "score": "0.7196775", "text": "def show\n @myevent = Myevent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @myevent }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.71922696", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "b55800920566b8d1705156e86e9a3d26", "score": "0.7191933", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "53f03fe240698fa4821da04fd48001bd", "score": "0.71898276", "text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "66d5c6cb4c349ed9046c5af8da477cc5", "score": "0.7189658", "text": "def show\n @event_event = Event::Event.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event_event }\n end\n end", "title": "" }, { "docid": "30abc7ae4ca20aae4e8b4cf39f0e15d7", "score": "0.7185299", "text": "def index\n event = Event.find(params[:event_id])\n render json: event.route, status: :ok\n end", "title": "" }, { "docid": "831625ad3437c99223738a7273964a0e", "score": "0.71837133", "text": "def index\n @events = Event.all\n\n render json: @events\n end", "title": "" }, { "docid": "5dc63496ec6579ff32c5e1b7834621ba", "score": "0.7182193", "text": "def show\n render json: @event, status: :ok\n end", "title": "" }, { "docid": "0b7c3e89c4b68b06c2b05ee624907497", "score": "0.7177447", "text": "def index\n @events = Event.all\n respond_to do |format|\n format.html \n format.json do\n render :json => {events: @events}\n end\n end\n end", "title": "" }, { "docid": "039d907486dd3765ff7f603f4c7f5b8a", "score": "0.7164624", "text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "02c59efd4b6fa83ff3da6d18c0a1c8ef", "score": "0.71634454", "text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event } \n end\n end", "title": "" }, { "docid": "9fd0f47e8d6f6e1b84073d8ea0206aaf", "score": "0.71586883", "text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "9fd0f47e8d6f6e1b84073d8ea0206aaf", "score": "0.71577144", "text": "def show\n @event = Event.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @event }\n end\n end", "title": "" }, { "docid": "7d4e016f658d1ada57b50906680c9360", "score": "0.7120297", "text": "def show\n render json: @event\n end", "title": "" }, { "docid": "7d4e016f658d1ada57b50906680c9360", "score": "0.7120297", "text": "def show\n render json: @event\n end", "title": "" }, { "docid": "7d4e016f658d1ada57b50906680c9360", "score": "0.7120297", "text": "def show\n render json: @event\n end", "title": "" }, { "docid": "7d4e016f658d1ada57b50906680c9360", "score": "0.7120297", "text": "def show\n render json: @event\n end", "title": "" }, { "docid": "7d4e016f658d1ada57b50906680c9360", "score": "0.7120297", "text": "def show\n render json: @event\n end", "title": "" }, { "docid": "4f5d0e118792c84c74dcb9beec4eddfb", "score": "0.7103938", "text": "def index\n @events = Event.all\n respond_to do |format|\n format.html \n format.json \n end\n end", "title": "" }, { "docid": "f6f4af65302278ae936c507fc7d363d4", "score": "0.70985645", "text": "def show\n render json: EventSerializer.new(@event).as_json, status: 200\n end", "title": "" }, { "docid": "9a92fb4eeb25a829b330537e6b7df70b", "score": "0.70859015", "text": "def event(event, options = {})\n get \"events/#{event}\", options\n end", "title": "" }, { "docid": "89f1661868d77cc9f743b39a8863b415", "score": "0.7074526", "text": "def index\n response = { events: Event.all }\n respond_to do |format|\n format.json { render json: response.to_json }\n format.html { render :index }\n end\n end", "title": "" }, { "docid": "560d74a779cccf860b46fa2caa9c6234", "score": "0.70712733", "text": "def index\n render json: Event.all, status: :ok\n end", "title": "" }, { "docid": "356491f9a7223dbc58effe14eece54f9", "score": "0.7068908", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "356491f9a7223dbc58effe14eece54f9", "score": "0.7068908", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "f2444e288c75eb695c3ab473656d0458", "score": "0.7066203", "text": "def index\n @events = current_user.events\n\n render json: @events\n end", "title": "" }, { "docid": "3c4e170782dc6c5c9532137bcdcd1d62", "score": "0.7059939", "text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "3c4e170782dc6c5c9532137bcdcd1d62", "score": "0.7059939", "text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "3c4e170782dc6c5c9532137bcdcd1d62", "score": "0.7059939", "text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "3c4e170782dc6c5c9532137bcdcd1d62", "score": "0.7059939", "text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "3c4e170782dc6c5c9532137bcdcd1d62", "score": "0.7059939", "text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "3c4e170782dc6c5c9532137bcdcd1d62", "score": "0.7059939", "text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "3c4e170782dc6c5c9532137bcdcd1d62", "score": "0.7059939", "text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "3c4e170782dc6c5c9532137bcdcd1d62", "score": "0.7059939", "text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "3c4e170782dc6c5c9532137bcdcd1d62", "score": "0.7059939", "text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "3c4e170782dc6c5c9532137bcdcd1d62", "score": "0.7059939", "text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "2a4065c60615aa5c5b80c230b071c0f1", "score": "0.7050139", "text": "def event(id, options = {})\n get \"events/#{id}\", options\n end", "title": "" }, { "docid": "d44a8e838669941717329a06bf82a09d", "score": "0.7042667", "text": "def index\n @events = Event.all\n @event = Event.new\n\n respond_to do |format|\n format.html\n format.json { render 'events/index', events: @events }\n end\n end", "title": "" }, { "docid": "5ec7da7697cadc81f4b64a191bb45900", "score": "0.7038084", "text": "def show\n @event = Event.find(params[:id])\n @client = Client.find(@event.client_id)\n @event_type = EventType.find(@event.event_type_id)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end", "title": "" }, { "docid": "c920f694973b8f492fc9196243d7dfa2", "score": "0.70323914", "text": "def index\n @events = Event.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @events }\n end\n end", "title": "" }, { "docid": "6f8bb0d26e9d5c9f722d69903c5b6d1a", "score": "0.7026831", "text": "def get_event ( event_key )\n get_api_resource \"#{@@api_base_url}event/#{event_key}\"\n end", "title": "" }, { "docid": "04b1a5a70f53f056cdc67f164f9201dd", "score": "0.70242524", "text": "def get_events(args)\n\tapi_url = \"#{@base_url}/#{args[:collection]}/#{args[:key]}/events/#{args[:event_type]}\"\n\tdo_the_get_call( url: api_url, user: @user )\nend", "title": "" }, { "docid": "c85abde336dba7a685d43b96531521e6", "score": "0.70195365", "text": "def index\n @event = Event.find(params[:event_id])\n\n end", "title": "" }, { "docid": "1a86abd79b9765670265c58570ed0907", "score": "0.69930404", "text": "def index\n @upcoming_events = Event.upcoming\n @past_events = Event.past\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "27c00ad1ec65511d53558267fff54314", "score": "0.69843376", "text": "def show\n \trender json: @event\n end", "title": "" }, { "docid": "b915baf4a044fba3e32a2d99c59dda88", "score": "0.6972568", "text": "def index\n @events = current_user.events\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "5f8829616313ba2e255ab6b5ea3f792c", "score": "0.69676083", "text": "def index\n @events = getUpcomingEvents()\n \n @page_title = \"Events\"\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @events }\n end\n end", "title": "" }, { "docid": "c23c8b7fbd2763578fdc166b9f4489e1", "score": "0.6949749", "text": "def index\n respond_with(@events)\n end", "title": "" }, { "docid": "855048cc3c10fd4a5d397620f19a6cda", "score": "0.6949619", "text": "def show\n render json: format_event(@event)\n end", "title": "" }, { "docid": "0943b149b3ddd06aa72cfb9d3ff1c739", "score": "0.6943386", "text": "def show\n @current_event = CurrentEvent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @current_event }\n end\n end", "title": "" }, { "docid": "e89ff72b149e65373b234956aff7b2fc", "score": "0.692872", "text": "def get_events\n if @user.uuid.present?\n @events = @user.events.active_events.page(params[:page])\n paginate json: @events, per_page: params[:per_page]\n elsif @user.uuid == \"guest\"\n @events = Com::Nbos::Events::Event.active_events.where(tenant_id: @user.tenant_id)\n render json: @events\n else\n render :json => {messageCode: \"bad.request\", message: \"Bad Request\"}, status: 400\n end\n end", "title": "" }, { "docid": "deb3768202f23a0009ca6409d1b5da2b", "score": "0.692616", "text": "def show\n begin\n @event = Event.find(params[:id])\n rescue ActiveRecord::RecordNotFound\n logger.error \"Attempt to show invalid event #{params[:id]}\"\n redirect_to events_path, notice: 'Invalid event ID'\n else\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @event }\n end\n end\n end", "title": "" }, { "docid": "69da1f3e3a70a7f027d1ccd90e818785", "score": "0.69220835", "text": "def index\n @events = @category.events\n render json: @events \n end", "title": "" }, { "docid": "2a3ec900bb55481d6c47bec1ede33bbc", "score": "0.69186485", "text": "def index\n\t\t@events = Event.all.order('created_at desc')\n\n\t\trespond_to do |format|\n\t\t\tformat.html\n\t\t\tformat.json { render :json => @events }\n\t\tend\n\tend", "title": "" }, { "docid": "2af3244b949e0148538956aee5580e4a", "score": "0.69128555", "text": "def show\n @event = Event.find(params[:id])\n\n respond_to do |format|\n format.json { render json: @event, methods: [:talks] }\n end\n end", "title": "" }, { "docid": "afcc16aeb5231c628466106dadff7854", "score": "0.68916076", "text": "def get_events\n response = request(:get, \"/devmgr/v2/events\")\n #status(response, 200, 'Failed to get current events from server')\n #JSON.parse(response.body)\n response\n end", "title": "" }, { "docid": "601f96ad37e1890a4d15eaca7e6e76d6", "score": "0.6890777", "text": "def index\n if params[:user]\n @events = Event.where(user: params[:user]).first\n else\n @events = Event.all.order('created_at asc')\n end\n\n render json: @events, :only => [:id, :date, :user, :event_type, :message, :otheruser]\n end", "title": "" }, { "docid": "8f86c1c2d3110226e2c3d57c46e03196", "score": "0.6875479", "text": "def get_event(session, options={})\n json_request \"get\", {:session => session}, options\n end", "title": "" }, { "docid": "f6c242ab68f50d06b5cdb469ad87ef85", "score": "0.685323", "text": "def index\n \n @events = current_user.events\n \n \n respond_to do |format|\n format.html {}\n format.json { render json: Event.events_to_json(@events) }\n end\n end", "title": "" }, { "docid": "68045e6c48582b2d4c53f672b1292914", "score": "0.68514514", "text": "def show\n @calendar = Calendar.find(params[:id])\n @events = Event.find(@calendar.event_ids)\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @calendar }\n end\n end", "title": "" } ]
884b72fd8acad05d9c5a850d57a2ce67
Common method to render create new resource
[ { "docid": "8f9dca8c9d134d41fe7d6199d9719de8", "score": "0.6801487", "text": "def render_created message: nil, data: nil\n render_success message: message, data: data, status_code: 201\n end", "title": "" } ]
[ { "docid": "38e9f2058a8b3239a052ca64755013dc", "score": "0.7496953", "text": "def render_create(resource, meta = {})\n if resource.persisted?\n render_params = { json: resource, status: 201, include: params[:include] }\n render_params.merge!(meta: meta) if meta.present?\n\n render render_params\n else\n render_error resource\n end\n end", "title": "" }, { "docid": "927b65d55f8769c74d2d6f0ae3a58b50", "score": "0.7400162", "text": "def create\n render :new\n end", "title": "" }, { "docid": "007166b793dc94e8ad9e1590f3cd115f", "score": "0.7313627", "text": "def new\r\n build_resource\r\n render_with_scope :new\r\n end", "title": "" }, { "docid": "d464a12a25182faa7b43b90dd7ae698e", "score": "0.72481763", "text": "def create\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n logger.debug \"\\nformat is #{format.html}\\n\"\n if @resource.save\n flash[:notice] = 'Resource was successfully created.'\n format.html { redirect_back_or_default( resource_url(@resource) ) }\n format.xml { head :created, :location => resource_url(@resource) }\n format.js\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @resource.errors.to_xml }\n format.js { render :action => \"nolayout\" }\n end\n end\n end", "title": "" }, { "docid": "bd7b47bae4e0e9f7ed4dced65e280320", "score": "0.71725106", "text": "def resource_new_content\n action_name == 'new' ? new_resource_content : create_resource_content\n end", "title": "" }, { "docid": "4c672fb1bb92c967136880c17eb6c140", "score": "0.7167693", "text": "def create\n self.resource = new_resource\n \n respond_to do |format|\n if resource.save\n format.html do\n flash[:notice] = \"#{resource_name.humanize} was successfully created.\"\n redirect_to resource_url\n end\n format.js\n format.xml { render :xml => resource, :status => :created, :location => resource_url }\n else\n format.html { render :action => \"new\" }\n format.js { render :action => \"new\" }\n format.xml { render :xml => resource.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "75828962bb6a63b52a0c2858329c2acd", "score": "0.7131686", "text": "def create\n resource_set resource_klass.new(resource_params)\n\n respond_to do |wants|\n result = resource_get.save\n call_hook :after_save, result\n if result\n flash[:notice] = t 'messages.record_created', model: t(\"models.#{resource_name}\")\n wants.html { redirect_to(resource_get) }\n wants.json { render :json => resource_get, :status => :created, :location => resource }\n else\n wants.html { render :action => \"new\" }\n wants.json { render :json => resource_get.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f8795dc2de9fa870a3f4b180dae82556", "score": "0.71192396", "text": "def new_create\n respond_to do |format|\n format.html\n end\n end", "title": "" }, { "docid": "419797e0ea40e5327e43816ce7da5864", "score": "0.706838", "text": "def create_created(resource:)\n render json: resource, status: :created\n end", "title": "" }, { "docid": "e1bc9a5c7d5dc36da2fd873d88e65d1f", "score": "0.700325", "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": "89be5c01b92850f074630109d0323b87", "score": "0.6960641", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @resource }\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "d3879bd7f050f2b383fcc31e82782b9a", "score": "0.6954926", "text": "def create\n @resource = Resource.new(params[:resource])\n render :json => @resource.id if @resource.save \n # respond_to do |format|\n # if @resource.save\n # format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n # format.json { render json: @resource, status: :created, location: @resource }\n # else\n # format.html { render action: \"new\" }\n # format.json { render json: @resource.errors, status: :unprocessable_entity }\n # end\n # end\n end", "title": "" }, { "docid": "0dd9aabe824afc2269273fc658fccfcb", "score": "0.6954312", "text": "def render(*args)\n # Automatically add the resource breadcrumb\n if @add_resource_breadcrumb\n resource = self.controller_name.singularize\n if self.instance_variables.include? \"@#{resource}\".to_sym\n resource_instance = self.instance_variable_get(\"@#{resource}\")\n\n if resource_instance.new_record?\n add_breadcrumb \"New #{resource.titleize}\", ''\n else\n add_breadcrumb resource_instance, ''\n end\n end\n end\n\n super(*args)\n end", "title": "" }, { "docid": "8ca42330a2a3f3f1ba3c75f36395eb0b", "score": "0.6946342", "text": "def create_resource\n raise NotImplementedError, \"#{self.class}#create_resource is not implemented\"\n end", "title": "" }, { "docid": "a1b96f5457c4fc53621724c71a18f17d", "score": "0.69188106", "text": "def create\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to(@resource, :notice => 'Resource was successfully created.') }\n format.xml { render :xml => @resource, :status => :created, :location => @resource }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @resource.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a560c1783c5aa91a4a5e58eae3c99115", "score": "0.6917071", "text": "def protected_new_resource_link(name=nil, html_options={})\n name ||= \"New #{resource_instance_name}\"\n link_to(\n name,\n new_resource_path,\n html_options\n ) if resource_class.creatable?\n end", "title": "" }, { "docid": "e18ad7a2dc6c5ab51abdd1e6504e6b16", "score": "0.6906337", "text": "def create\n\tputs \"create\"\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7d252d496701fcad35e802aef2f09435", "score": "0.68505126", "text": "def create\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created -- now fetching...' }\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5e5dcaa505fd8030c6ab79f523c8295", "score": "0.6847972", "text": "def create\n respond_to do |format|\n if @resource.save\n data = handle_successful_creation\n format.html { redirect_to data[:url], notice: data[:notice] }\n else\n handle_invalid\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "6e4bff348c44f323080f620352911339", "score": "0.68348753", "text": "def new\n render render_params\n end", "title": "" }, { "docid": "b9eec964fa42a0c64b38ad86614dbb29", "score": "0.6834194", "text": "def create_resource_for(resource_name); end", "title": "" }, { "docid": "40d6d51b0691c7ff1568afb463a16c23", "score": "0.68329406", "text": "def create\n render :\"book/create\"\n\n \n end", "title": "" }, { "docid": "bc021e43758756a5197d4d183faedc14", "score": "0.68238354", "text": "def create\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5ec65a47785bb0c3972ac06f1cf6a804", "score": "0.68232524", "text": "def new\n build_responder.call(new_resource, :action => :new)\n end", "title": "" }, { "docid": "b6fc8253c0dec0d6dd901dc589c79306", "score": "0.68222654", "text": "def page_create_render\n 'create'\n end", "title": "" }, { "docid": "9dd287617c2172ad2695cb0e3587be92", "score": "0.68221474", "text": "def new\n render 'new'\n end", "title": "" }, { "docid": "a368f11be0d9f9b3129ee13a70d86ffb", "score": "0.6808578", "text": "def new\n build_resource({})\n end", "title": "" }, { "docid": "e93781fcbcfbae5e130c29bbdb738e05", "score": "0.6801843", "text": "def create\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n flash[:notice] = 'Resource was successfully created.'\n format.html { redirect_to(@resource) }\n format.xml { render :xml => @resource, :status => :created, :location => @resource }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @resource.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9bff006f190975e3a997ddea63f7212", "score": "0.679654", "text": "def create\n @resource = Resource.new(resource_params)\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render action: 'show', status: :created, location: @resource }\n else\n format.html { render action: 'new' }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9bff006f190975e3a997ddea63f7212", "score": "0.679654", "text": "def create\n @resource = Resource.new(resource_params)\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render action: 'show', status: :created, location: @resource }\n else\n format.html { render action: 'new' }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0186de454da1bbacc0c0e11f5e4361ac", "score": "0.67948616", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "0186de454da1bbacc0c0e11f5e4361ac", "score": "0.67948616", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "0186de454da1bbacc0c0e11f5e4361ac", "score": "0.67948616", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "0186de454da1bbacc0c0e11f5e4361ac", "score": "0.67948616", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "0186de454da1bbacc0c0e11f5e4361ac", "score": "0.67948616", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\n end", "title": "" }, { "docid": "f3cb393b8a86e58511632ae42671049e", "score": "0.6793577", "text": "def new\n # require global create permissions for this object type\n require_privilege(Alberich::Privilege::CREATE, ParentResource)\n @parent_resource = ParentResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @parent_resource }\n end\n end", "title": "" }, { "docid": "c38f1a3603b5de5824f457cac4925b2d", "score": "0.6793519", "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": "f5d6a578268610c046c2be60beba8b3c", "score": "0.6793501", "text": "def create\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n url = @resource.url\n format.json { render :json => {:url => url }}\n # format.html { redirect_to(courses_path, :notice => 'Resource was successfully created.') }\n # format.xml { render :xml => [:admin,@resource], :status => :created, :location => @admin_resource }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @admin_resource.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b4a5248055860036afd4fc3e91d76f41", "score": "0.6782813", "text": "def new\n invoke_callback(:before_new)\n @resourceful_item ||= resourceful_model.new\n send(self.class.authorize_method, :new, @resourceful_item, request)\n init_instance_variables\n invoke_callback(:respond_to_new)\n unless performed?\n respond_to do |format|\n format.html { render :new }\n format_json_and_xml(format, :message => \"Format not supported! Use the html format.\")\n end\n end\n invoke_callback(:after_new)\n end", "title": "" }, { "docid": "21fad0ec71375c6046206eee448daf8f", "score": "0.67787683", "text": "def new\n\t\t#nothing here, just for creating a url\n render 'layouts/application'\n end", "title": "" }, { "docid": "13a23eda502e9dd16e0289166632f867", "score": "0.6759321", "text": "def create_resource(resource)\n if resource.save\n render :show, status: 201, location: dynamic_resource_path(resource)\n else\n if resource.errors[:uuid] == [\"has already been taken\"]\n render json: {errors: resource.errors.full_messages}, status: 409\n else\n render json: {errors: resource.errors.full_messages}, status: 403\n end\n end\n end", "title": "" }, { "docid": "3c65793d200ca9cd16b7b52a0bb0b553", "score": "0.6755987", "text": "def new_resource_class\n 'new'\n end", "title": "" }, { "docid": "0eb1e08613a69bba99133087aeb7242c", "score": "0.67506814", "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.67506444", "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.67506444", "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.67506444", "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.67506444", "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.67506444", "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.67506444", "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": "c2be97fc25bcb6dfdc4a609505922b85", "score": "0.67450756", "text": "def new\n @resource_type = ResourceType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @resource_type }\n format.xml { render :xml => @resource_type }\n end\n end", "title": "" }, { "docid": "df84751e5ad1c3ba28c4bd5ab7d32692", "score": "0.67407644", "text": "def create\n @resource = Resource.new(resource_params)\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to resources_url, notice: 'Resource was successfully created.' }\n format.json { render :show, status: :created, location: @resource }\n else\n format.html { render :new }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cdb0ea59017a18488e85ac8895817883", "score": "0.672716", "text": "def create\n @item = Item.new resource_params\n \n render :new unless resource.save\n end", "title": "" }, { "docid": "759cd7f5661394d17dea7a919f2a23c2", "score": "0.6724099", "text": "def new\n render :new # optional; this is the default behavior\n end", "title": "" }, { "docid": "d88f0c9cc21d2a423e0155a892df1503", "score": "0.6722259", "text": "def new\n render\n end", "title": "" }, { "docid": "879fc3e648ec3297a803ddec654da8a8", "score": "0.6718614", "text": "def new\n render 'new'\n end", "title": "" }, { "docid": "879fc3e648ec3297a803ddec654da8a8", "score": "0.6718614", "text": "def new\n render 'new'\n end", "title": "" }, { "docid": "de792f1bf6e99233d5f17a43af6c5986", "score": "0.6709071", "text": "def create\r\n @resource = Resource.new(resource_params)\r\n\r\n respond_to do |format|\r\n if @resource.save\r\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\r\n format.json { render :show, status: :created, location: @resource }\r\n else\r\n format.html { render :new }\r\n format.json { render json: @resource.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "8dd4368e9c3d087fae9be9e134cc897d", "score": "0.67085564", "text": "def create\n render nothing: true, status: 200\n end", "title": "" }, { "docid": "af3ff5d07be7811e90e4f318c5e7ad6d", "score": "0.6704002", "text": "def create\n @resource = Resource.new(resource_params)\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render :show, status: :created, location: @resource }\n else\n format.html { render :new }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af3ff5d07be7811e90e4f318c5e7ad6d", "score": "0.6704002", "text": "def create\n @resource = Resource.new(resource_params)\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render :show, status: :created, location: @resource }\n else\n format.html { render :new }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af3ff5d07be7811e90e4f318c5e7ad6d", "score": "0.6704002", "text": "def create\n @resource = Resource.new(resource_params)\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, notice: 'Resource was successfully created.' }\n format.json { render :show, status: :created, location: @resource }\n else\n format.html { render :new }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c568d55e6aca955b0ca21b281a12f106", "score": "0.6688108", "text": "def new\n\t\t@resource = Resource.new\n\tend", "title": "" }, { "docid": "97505784b66621b281b287b93572dbb3", "score": "0.66863096", "text": "def new\n # require global create permissions for this object type\n require_privilege(Alberich::Privilege::CREATE, StandaloneResource)\n\n @standalone_resource = StandaloneResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @standalone_resource }\n end\n end", "title": "" }, { "docid": "01909d446c8e2491ae6ca33900e91b51", "score": "0.6683413", "text": "def create\n authorize! :create, resource\n current_model_service.create resource, params\n yield if block_given? # after_create\n respond_with resource, location: helpers.show_path(resource)\n end", "title": "" }, { "docid": "bb0d037b109b0cf0135571bb24eaca10", "score": "0.6667965", "text": "def create\n @resource = Resource.new(resource_params)\n\n respond_to do |format|\n if @resource.save\n format.html do\n redirect_path = if params[:commit].to_s.downcase.include? 'another'\n new_resource_path\n else\n @resource\n end\n redirect_to redirect_path, notice: 'Resource was successfully created.'\n end\n format.json { render :show, status: :created, location: @resource }\n else\n format.html { render :new }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25e9781fc44ddc6df2ea0130a2a38c55", "score": "0.6666627", "text": "def new\n build_resource({})\n self.resource.person = Person.new\n respond_with self.resource\n end", "title": "" }, { "docid": "201ddcc35954d92c5f55903b1a7acd54", "score": "0.66646975", "text": "def create\n if params[:resource][:site_name]\n params[:site_name] = params[:resource].delete(:site_name)\n end\n if params[:resource][:resource_type_name]\n params[:resource_type_name] = params[:resource].delete(:resource_type_name)\n end\n @resource = Resource.new(params[:resource])\n if (params[:site_name]) #HTML form\n @resource.site = Site.find_by_name(params[:site_name])\n end\n if (params[:resource_type_name]) #HTML form\n @resource.resource_type = ResourceType.find_by_name(params[:resource_type_name])\n end\n respond_to do |format|\n if @resource.save\n format.html { redirect_to @resource, :notice => 'Resource was successfully created.' }\n format.json { render :json => @resource, :status => :created, :location => @resource }\n format.xml { render :xml => @resource, :status => :created, :location => @resource }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @resource.errors, :status => :unprocessable_entity }\n format.xml { render :xml => @resource.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d57ee1d24809d86f3fde1d5bb998a88f", "score": "0.66364723", "text": "def new\n @resource = Resource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @resource }\n end\nend", "title": "" }, { "docid": "2bf8f36caa0d8f80223fb0788ff1fe22", "score": "0.66260505", "text": "def new\n resource = build_resource({})\n respond_with resource\n end", "title": "" }, { "docid": "ca494de63ce487590b5b10c33a899f3e", "score": "0.6616548", "text": "def new\n\t\trender 'new'\n\tend", "title": "" }, { "docid": "ca494de63ce487590b5b10c33a899f3e", "score": "0.6616548", "text": "def new\n\t\trender 'new'\n\tend", "title": "" }, { "docid": "ca494de63ce487590b5b10c33a899f3e", "score": "0.6616548", "text": "def new\n\t\trender 'new'\n\tend", "title": "" }, { "docid": "ca494de63ce487590b5b10c33a899f3e", "score": "0.6616548", "text": "def new\n\t\trender 'new'\n\tend", "title": "" }, { "docid": "012788894c5cbe111bbe9e378645ee7b", "score": "0.6612826", "text": "def new\n resource_set resource_klass.new\n respond_with resource_get\n end", "title": "" }, { "docid": "20c32d5d9cfa96e92c5f3f7c4ce2158e", "score": "0.66098684", "text": "def create\n nested_resource_pre_build\n\n respond_to do |format|\n if @create_resource.save\n after_create_action\n\n format.html do\n flash[flash_status_type] = flash_created_message\n\n redirect_to location_after_create\n end\n format.json { render :show, status: :created, location: location_after_create }\n else\n nested_resource_build\n\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @create_resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8e19d07d2c3975b080b063ab1e74305", "score": "0.66033", "text": "def new\n build_resource\n respond_with resource\n end", "title": "" }, { "docid": "8718839c1873ebb1d41aaf909b25c347", "score": "0.65987307", "text": "def new\n do_new_resource\n get_project_if_exists\n do_set_attributes\n do_authorize_instance\n\n respond_new\n end", "title": "" }, { "docid": "8718839c1873ebb1d41aaf909b25c347", "score": "0.65987307", "text": "def new\n do_new_resource\n get_project_if_exists\n do_set_attributes\n do_authorize_instance\n\n respond_new\n end", "title": "" }, { "docid": "b2641fe0454e0412ac51aa32469cfc1a", "score": "0.6596863", "text": "def create\n super do |resource|\n # custom code\n end\n end", "title": "" }, { "docid": "d15c7920c650026a591294a3e92f2e62", "score": "0.6596171", "text": "def create\n update\n # render :update\n end", "title": "" }, { "docid": "52c4d0aea9b9c53a682ee42f7da7b8e7", "score": "0.6594194", "text": "def create\n\n if @resource[:lv_extend] == :true\n lv_extended()\n else\n lv_creates()\n end\n\n end", "title": "" }, { "docid": "7a20df6477d15b527a5076f6bc1dba7e", "score": "0.6588951", "text": "def new\n render plain: \"new action not available in API\"\n end", "title": "" }, { "docid": "e69117895f4cbeb66209aaf8a0f064b0", "score": "0.65813", "text": "def create\r\n @resource = Resource.new(params[:resource])\r\n if @resource.save\r\n flash[:notice] = 'Resource was successfully created.'\r\n redirect_to :controller => 'admin', :action => 'show_resources'\r\n else\r\n flash[:notice] = 'Resource not created.'\r\n render :action => 'new'\r\n end\r\n end", "title": "" }, { "docid": "53cde2155b8a3a28f0a2719add57d001", "score": "0.65755814", "text": "def new_template\n template :new\n end", "title": "" }, { "docid": "4fceff20f115cf7680c6b6393ebcde0f", "score": "0.6570043", "text": "def new\n @page_resource = PageResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @page_resource }\n end\n end", "title": "" }, { "docid": "143e31479ee31024197cd0207ef17238", "score": "0.6567542", "text": "def new\n build_resource({})\n @disable_nav = true\n @title = \"회원가입\" #for mobile\n respond_with resource do |format|\n format.html { render_by_device }\n end\n end", "title": "" }, { "docid": "3ceccca3dd5d117c73d3cd6a8797e276", "score": "0.65666974", "text": "def new\n @resource_type = ResourceType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_type }\n end\n end", "title": "" }, { "docid": "3ceccca3dd5d117c73d3cd6a8797e276", "score": "0.65666974", "text": "def new\n @resource_type = ResourceType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @resource_type }\n end\n end", "title": "" }, { "docid": "3c357d6180aff759e6a0a019380f57ae", "score": "0.65656716", "text": "def new\n @common_resource = CommonResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @common_resource }\n end\n end", "title": "" }, { "docid": "783f870b5d34484a698072cd3222b605", "score": "0.65650225", "text": "def create\n create! do |success, failure|\n success.json { render :show }\n success.xml { render :show }\n failure.json { render json: resource.errors, status: :unprocessable_entity }\n failure.xml { render xml: resource.errors, status: :unprocessable_entity }\n end\n end", "title": "" }, { "docid": "69e441a150856dd7101e50ba29150e09", "score": "0.6550133", "text": "def create\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @client.resources << @resource\n flash[:notice] = 'Resource was successfully created.'\n format.html { redirect_to client_resource_url(@client, @resource) }\n format.xml { render :xml => @resource, :status => :created, :location => [@client, @resource] }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @resource.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e675b9202ef45c73d7bd0d05ca067473", "score": "0.65489143", "text": "def create\n\n update\n\n # render :update\n\n end", "title": "" }, { "docid": "3fec1c69c518b011418ca7f3b4ee5536", "score": "0.65443575", "text": "def new\n # default: render 'new' template\nend", "title": "" }, { "docid": "5ba6b6cfbb443dafd604df68be1f0575", "score": "0.65406317", "text": "def create\n @resource = Resource.new(params[:resource])\n\n respond_to do |format|\n if @resource.save\n format.html { redirect_to upload_resource_path(@resource) }\n format.json { render json: @resource, status: :created, location: @resource }\n else\n format.html { render action: \"new\" }\n format.json { render json: @resource.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eecd7885e1913dc6c3f6000a64f6fda8", "score": "0.6533586", "text": "def create\n #render plain: params.inspect\n @book = Book.new(resource_params)\n if @book.save\n render plain: 'sukses menambah buku'\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "8b1fbf56cf6dbda29b867d7e711ccf6f", "score": "0.6530759", "text": "def create_resource\n @resource = @scope.new(data: request.request_parameters)\n if @resource.save\n render json: @resource, status: :created, location: resource_url(@resource.name, @resource.id)\n else\n render json: @resource.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "17a7ff16f5b925c5a7376a86bbdcc5b6", "score": "0.65268207", "text": "def new\n @dummy_resource = DummyResource.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dummy_resource }\n end\n end", "title": "" }, { "docid": "edfa1acd7a807e43e8a183d308257578", "score": "0.6518592", "text": "def create\n @resource = Resource.new(resource_params)\n\n if @resource.save\n render json: @resource\n else\n render json: @resource.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "08616b6b3092cf4f19706dc47bff77c8", "score": "0.6518069", "text": "def create\n # Making sure only signed in users can access\n # if user_signed_in?\n resource = Resource.create(resource_params)\n if resource.valid?\n render json: resource\n else\n render json: resource.errors, status: :unprocessable_entity\n end\n # else\n # render status: 403, plain: 'Please Sign In to Access'\n # end\n end", "title": "" }, { "docid": "71dc33c34bfd4fe21c581fa6f6486f27", "score": "0.65155655", "text": "def create\n @common_resource = CommonResource.new(params[:common_resource])\n\n respond_to do |format|\n if @common_resource.save \n format.html { redirect_to(@common_resource, :notice => '公共资源添加成功.') }\n format.xml { render :xml => @common_resource, :status => :created, :location => @common_resource }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @common_resource.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" } ]
1b4d5b5522f03e33a04c1b768a35eae3
Set the value of the Amount input for this Choreo.
[ { "docid": "dab4385da7e8782e1ac4124239cc853a", "score": "0.7636373", "text": "def set_Amount(value)\n set_input(\"Amount\", value)\n end", "title": "" } ]
[ { "docid": "891bc9a49411fe8548eb52881d2bff6a", "score": "0.73611635", "text": "def set_Amount(value)\n set_input(\"Amount\", value)\n end", "title": "" }, { "docid": "891bc9a49411fe8548eb52881d2bff6a", "score": "0.73611635", "text": "def set_Amount(value)\n set_input(\"Amount\", value)\n end", "title": "" }, { "docid": "891bc9a49411fe8548eb52881d2bff6a", "score": "0.73611635", "text": "def set_Amount(value)\n set_input(\"Amount\", value)\n end", "title": "" }, { "docid": "891bc9a49411fe8548eb52881d2bff6a", "score": "0.73611635", "text": "def set_Amount(value)\n set_input(\"Amount\", value)\n end", "title": "" }, { "docid": "891bc9a49411fe8548eb52881d2bff6a", "score": "0.73611635", "text": "def set_Amount(value)\n set_input(\"Amount\", value)\n end", "title": "" }, { "docid": "891bc9a49411fe8548eb52881d2bff6a", "score": "0.73611635", "text": "def set_Amount(value)\n set_input(\"Amount\", value)\n end", "title": "" }, { "docid": "891bc9a49411fe8548eb52881d2bff6a", "score": "0.73611635", "text": "def set_Amount(value)\n set_input(\"Amount\", value)\n end", "title": "" }, { "docid": "891bc9a49411fe8548eb52881d2bff6a", "score": "0.73611635", "text": "def set_Amount(value)\n set_input(\"Amount\", value)\n end", "title": "" }, { "docid": "891bc9a49411fe8548eb52881d2bff6a", "score": "0.73611635", "text": "def set_Amount(value)\n set_input(\"Amount\", value)\n end", "title": "" }, { "docid": "891bc9a49411fe8548eb52881d2bff6a", "score": "0.73611635", "text": "def set_Amount(value)\n set_input(\"Amount\", value)\n end", "title": "" }, { "docid": "501f764337db42d4bb90b27d628f5704", "score": "0.7297183", "text": "def amount=(amount)\n raise(ArgumentError, \"Amount cannot be nil\") unless amount\n raise(ArgumentError, \"Amount cannot be negative\") if amount < 0\n @amount = BigDecimal.new(amount.to_s)\n end", "title": "" }, { "docid": "9d134f885a03c7dc28570d96200093e0", "score": "0.7150778", "text": "def amount=(amount)\n if amount.nil?\n fail ArgumentError, \"amount cannot be nil\"\n end\n\n if amount < 0\n fail ArgumentError, \"invalid value for 'amount', must be greater than or equal to 0.\"\n end\n\n @amount = amount\n end", "title": "" }, { "docid": "9d134f885a03c7dc28570d96200093e0", "score": "0.7150778", "text": "def amount=(amount)\n if amount.nil?\n fail ArgumentError, \"amount cannot be nil\"\n end\n\n if amount < 0\n fail ArgumentError, \"invalid value for 'amount', must be greater than or equal to 0.\"\n end\n\n @amount = amount\n end", "title": "" }, { "docid": "9d134f885a03c7dc28570d96200093e0", "score": "0.7150778", "text": "def amount=(amount)\n if amount.nil?\n fail ArgumentError, \"amount cannot be nil\"\n end\n\n if amount < 0\n fail ArgumentError, \"invalid value for 'amount', must be greater than or equal to 0.\"\n end\n\n @amount = amount\n end", "title": "" }, { "docid": "891d0849ec58a316134e2394b7880b73", "score": "0.7134717", "text": "def amount=(amount)\n\n if !amount.nil? && amount < 1\n fail ArgumentError, \"invalid value for 'amount', must be greater than or equal to 1.\"\n end\n\n @amount = amount\n end", "title": "" }, { "docid": "2d51e7dbaee7076ba2feb0fb9956d7d0", "score": "0.7045627", "text": "def amountSet=(value)\n @amount = value\n end", "title": "" }, { "docid": "9fc678a8ee2464efce1dd671a651a225", "score": "0.68801075", "text": "def amount=(value)\n @amount = value.to_d\n end", "title": "" }, { "docid": "b813fd33ac62eafadd823b4d63d6d86f", "score": "0.68044734", "text": "def amount=(amount)\n\t\t\t\tself.value = amount.to_f / 100\n\t\t\tend", "title": "" }, { "docid": "4a8d5e44ffa78d70bd216560ecf23cc4", "score": "0.64782655", "text": "def amount=(amount)\n if amount.is_a?(Money)\n self[:amount] = amount.to_d\n else\n self[:amount] = amount\n end\n end", "title": "" }, { "docid": "2749b9c9f9d91615482a4daad7540871", "score": "0.6426153", "text": "def amount=(amount)\n self[:amount] =\n case amount\n when String\n separator = I18n.t('number.currency.format.separator')\n number = amount.delete(\"^0-9-#{separator}\\.\").tr(separator, '.')\n number.to_d if number.present?\n end || amount\n end", "title": "" }, { "docid": "36021b4c93c9432cee5427ec3976094c", "score": "0.6392135", "text": "def set_amount\n @amount = Amount.find(params[:id])\n end", "title": "" }, { "docid": "dc1607e84398f6e48f6926bb7b61b8b0", "score": "0.6312822", "text": "def amount= value\n raw_write_attribute(:amount, value)\n end", "title": "" }, { "docid": "9d9117214479cd54e399f9961e6ec387", "score": "0.6294267", "text": "def value=(amount)\n raise ArgumentError.new(\"Amount must be a non-negative numeric value\") unless amount.is_a?(Numeric) && amount >= 0 \n\n @value = amount.to_f\n end", "title": "" }, { "docid": "8cff282e16f28d69b50da7314b538236", "score": "0.62765414", "text": "def amount=(amount)\n write_attribute(:amount, amount ? (amount*100).round : nil) # Some very strange rounding errors happen if\n end", "title": "" }, { "docid": "45a9de1209727a060e60ec0f5c1df22a", "score": "0.60816896", "text": "def set_amount\n self.amount = Integer(amount_decimal * 100)\n end", "title": "" }, { "docid": "6e368b627aac5f12d55f6b96fa2cd412", "score": "0.60397774", "text": "def set_amount\n self.amount = input_invoice.payment_amount\n end", "title": "" }, { "docid": "aa1b0b4cef14af5862d62b07ba6abe60", "score": "0.60267675", "text": "def amount=(new_amount)\n new_amount = new_amount.gsub(/[^0-9.]/i, '') unless new_amount.is_a?(Numeric)\n self[:amount] = new_amount\n end", "title": "" }, { "docid": "9e1a23b4f0e80c2de09bcd3fddcb5d28", "score": "0.59826726", "text": "def amount=(n)\n @amount = n\n reassign\n n\n end", "title": "" }, { "docid": "7074e2de9bd13267f6119a9475a831e0", "score": "0.5928155", "text": "def total=(value)\n self[:amount] = value\n end", "title": "" }, { "docid": "9fd83c250f16bf37d009ec5d621a99b2", "score": "0.59177506", "text": "def amount=(net_money_amount)\n self.net_amount = net_money_amount\n end", "title": "" }, { "docid": "26555b4723368ad11364a52d421b8d52", "score": "0.5839236", "text": "def amount=(net_money_amount)\n self.net_amount = net_money_amount\n end", "title": "" }, { "docid": "06dc97b7b8c681b1fffa643f050a534e", "score": "0.57566124", "text": "def amount=(value) # :nodoc:\n super(value.instance_of?(String) ? value.gsub(/,/, '') : value)\n end", "title": "" }, { "docid": "1a98a23b4ef318eae89b700b4d45fe1c", "score": "0.5702553", "text": "def set_long_term_rent_to(amount)\n find(RENTAL_INCOME_INPUT).set(amount)\n end", "title": "" }, { "docid": "7f160e97ecbb9a726818595f03e70645", "score": "0.5700555", "text": "def amount=(money)\n cents = money.respond_to?(:cents) ? money.cents : money\n if money.is_a?(String) or cents.to_i <= 0\n raise ArgumentError, 'money amount must be either a Money object or a positive integer in cents.'\n end\n add_field mappings[:amount], sprintf(\"%.2f\", cents.to_f/100)\n end", "title": "" }, { "docid": "6770176c9a2d9edd4e7d04d13df80074", "score": "0.56974745", "text": "def amount=(val)\n\t\tsuper val.to_f * 100\n\tend", "title": "" }, { "docid": "dc95dfb674920790898fd7179acb22c9", "score": "0.56382626", "text": "def amount=(new_amount) \n new_amount > 0 ? super(-new_amount) : super(new_amount)\n end", "title": "" }, { "docid": "d9514a6ae587125d7fa6671540fd465a", "score": "0.56088775", "text": "def amount=(val)\n self.cents = val ? (val * 100).to_i : nil\n end", "title": "" }, { "docid": "d09baa9c6e478aaa44b0e2719786aae9", "score": "0.5606035", "text": "def amount=(money)\n cents = money.respond_to?(:cents) ? money.cents : money\n raise ArgumentError, \"amount must be a Money object or an integer\" if money.is_a?(String)\n raise ActionViewHelperError, \"amount must be greater than $0.00\" if cents.to_i <= 0\n\n add_field(mappings[:amount], sprintf(\"%.2f\", cents.to_f/100))\n end", "title": "" }, { "docid": "ff7fabb07a89a0c1d647f72dd5faa196", "score": "0.5537343", "text": "def Amount(value)\n return value if value.is_a? Amount\n Amount.new(value)\n end", "title": "" }, { "docid": "a8da736ec641de3dbf52335117f65789", "score": "0.5488326", "text": "def set_quantity=(amount)\n @old_quantity = quantity || 0 unless old_quantity\n self.quantity = amount\n end", "title": "" }, { "docid": "be4493a579052975e9f85ef1d3157154", "score": "0.54731786", "text": "def set_amount(product, amount, group, options = {})\n return nil if product.nil?\n if amount > 0\n order_item = order_items.find_by(product: product) || insert_single(product, amount, group)\n order_item.update(amount: amount)\n else\n order_items.where(product: product).destroy_all\n end\n end", "title": "" }, { "docid": "01307b606eacc0e948da461789e58dd4", "score": "0.54700345", "text": "def amount=(setter)\n amount = setter.to_s.strip\n numbersinamount = amount.gsub(/[^\\d\\.]/, \"\")\n raise NoAmountCodeError, \"Cannot determine amount: #{setter}\" if numbersinamount == \"\"\n @amount = numbersinamount.to_f\n end", "title": "" }, { "docid": "d886aa93d18264f3d582a4cf349d3758", "score": "0.54516125", "text": "def amount=(val)\n write_attribute(:amount, val.to_s.gsub(/,/, ''))\n end", "title": "" }, { "docid": "31e33d1060cd19051d94dd1cd8203ced", "score": "0.54474604", "text": "def set_payment_amount\n payment.amount = total if payment\n end", "title": "" }, { "docid": "cbc4183ddda701e669c5419c332fe8ca", "score": "0.54211", "text": "def set_amount_type\n @amount_type = AmountType.find(params[:id])\n end", "title": "" }, { "docid": "76dfc42c3d13caff6e134f95882a140a", "score": "0.5392291", "text": "def spend=(amount)\n super(strip_non_decimal(amount))\n end", "title": "" }, { "docid": "9edda8e4bba255b2404c473ac3a25caf", "score": "0.53795135", "text": "def balance=(amount)\n @balance = amount\n end", "title": "" }, { "docid": "cb37698fdc10357f4528d8be4719df8e", "score": "0.5366854", "text": "def set(point, amount)\n @store[point] = amount\n end", "title": "" }, { "docid": "450fea40552c42e100d3a71d2d82313e", "score": "0.5344359", "text": "def balance=(new_amount)\n @balance = new_amount\n end", "title": "" }, { "docid": "d6c99c9f156641d4e6b1b29002e0e3d7", "score": "0.53362066", "text": "def set_amount_order\n @amount_order = AmountOrder.find(params[:id])\n end", "title": "" }, { "docid": "3387ffa21760f1dd30cd805e37c50a2a", "score": "0.5327667", "text": "def set_DownPaymentAmount(value)\n set_input(\"DownPaymentAmount\", value)\n end", "title": "" }, { "docid": "44bf2d76411c5a20be3392770df4d11a", "score": "0.5310224", "text": "def set_price(amount)\n #using a setter as a filter / data normalizer\n if (amount*100).to_i == amount * 100\n @price = amount\n else\n puts \"Price seems malformed for this setting\"\n end\n end", "title": "" }, { "docid": "98bb97be29204a3ca20bf1641e330cad", "score": "0.52820563", "text": "def balance=(amount)\n raise ArgumentError, \"Cannot set balance on account with type #{account_type.name}\" unless has_balance?\n # adjust balance date for the user's time zone\n tz = User.current && User.current.time_zone\n balance_date = tz ? Time.now.in_time_zone(tz) : Time.now\n AccountBalance.create!(:account => self, :balance => Currency.normalize(amount).to_d, :balance_date => balance_date)\n end", "title": "" }, { "docid": "981a0b79e5b6a415e088fe96881e28f7", "score": "0.52819866", "text": "def initialize(amount = 0)\n fail ArgumentError unless amount.instance_of?(Fixnum)\n @amount = amount\n end", "title": "" }, { "docid": "fee24d68ea77fb32eee7479053d74650", "score": "0.5267306", "text": "def payment_amount=(payment_amount)\n if !payment_amount.nil? && payment_amount > 99999999.99\n fail ArgumentError, 'invalid value for \"payment_amount\", must be smaller than or equal to 99999999.99.'\n end\n\n if !payment_amount.nil? && payment_amount < 0\n fail ArgumentError, 'invalid value for \"payment_amount\", must be greater than or equal to 0.'\n end\n\n @payment_amount = payment_amount\n end", "title": "" }, { "docid": "8254841be0b3ca7b448ea021e049f76e", "score": "0.5266466", "text": "def set_amount\n self.transfer_amount = payment_forming.amount\n end", "title": "" }, { "docid": "3679414cdee6319cd5b5a309d3cf67f2", "score": "0.52473456", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" }, { "docid": "3679414cdee6319cd5b5a309d3cf67f2", "score": "0.52473456", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" }, { "docid": "3679414cdee6319cd5b5a309d3cf67f2", "score": "0.52473456", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" }, { "docid": "3679414cdee6319cd5b5a309d3cf67f2", "score": "0.52473456", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" }, { "docid": "3679414cdee6319cd5b5a309d3cf67f2", "score": "0.52473456", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" }, { "docid": "3679414cdee6319cd5b5a309d3cf67f2", "score": "0.52473456", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" }, { "docid": "3679414cdee6319cd5b5a309d3cf67f2", "score": "0.52473456", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" }, { "docid": "652eaaf8b5a450fc9e2e04addad52c40", "score": "0.52104217", "text": "def amount=(amnt)\n write_attribute :amount,amnt.to_s.gsub(',','.')\n end", "title": "" }, { "docid": "fda28302aeddea9aee83e1c4325643dc", "score": "0.52072996", "text": "def org_amount=(org_amount)\n if org_amount.nil?\n fail ArgumentError, \"org_amount cannot be nil\"\n end\n\n if org_amount < 0\n fail ArgumentError, \"invalid value for 'org_amount', must be greater than or equal to 0.\"\n end\n\n @org_amount = org_amount\n end", "title": "" }, { "docid": "a16e76d73f750275fcb601ef69d0b9b0", "score": "0.5200628", "text": "def set_FacillitatorAmount(value)\n set_input(\"FacillitatorAmount\", value)\n end", "title": "" }, { "docid": "a16e76d73f750275fcb601ef69d0b9b0", "score": "0.5200628", "text": "def set_FacillitatorAmount(value)\n set_input(\"FacillitatorAmount\", value)\n end", "title": "" }, { "docid": "bf2aa09a92dd967e6ec844ce298c71dc", "score": "0.5192369", "text": "def change_amount(futurepay_id, amount)\n make_request futurePayId: futurepay_id, amount: amount, 'op-adjustRFP' => ''\n end", "title": "" }, { "docid": "7e947257876c78abadd94b3add24b004", "score": "0.51849365", "text": "def amount=(amount_dollars)\n if amount_dollars.present?\n write_attribute(:amount_cents, (amount_dollars.to_f * 100).to_i)\n else\n write_attribute(:amount_cents, 0)\n end\n end", "title": "" }, { "docid": "f2a940581c41fa9d7c655e1d9a9e1415", "score": "0.5141682", "text": "def amount=(amount_dollars)\n if amount_dollars.present?\n write_attribute(:amount_cents, (amount_dollars.to_s.to_d * 100).to_i)\n else\n write_attribute(:amount_cents, 0)\n end\n end", "title": "" }, { "docid": "e8610501e22f1ab1873b8ffb29f5f737", "score": "0.51230776", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" }, { "docid": "e8610501e22f1ab1873b8ffb29f5f737", "score": "0.51230776", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" }, { "docid": "e8610501e22f1ab1873b8ffb29f5f737", "score": "0.51230776", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" }, { "docid": "e8610501e22f1ab1873b8ffb29f5f737", "score": "0.51230776", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" }, { "docid": "e8610501e22f1ab1873b8ffb29f5f737", "score": "0.51230776", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" }, { "docid": "e8610501e22f1ab1873b8ffb29f5f737", "score": "0.51230776", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" }, { "docid": "e8610501e22f1ab1873b8ffb29f5f737", "score": "0.51230776", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" }, { "docid": "e8610501e22f1ab1873b8ffb29f5f737", "score": "0.51230776", "text": "def set_Currency(value)\n set_input(\"Currency\", value)\n end", "title": "" }, { "docid": "cb0189ae74cc337f1c525e70c78bb5df", "score": "0.5107534", "text": "def amount\n\t\t param = params.permit(:amount)\n\t\t \tparam[:amount].to_f\n\t\tend", "title": "" }, { "docid": "7cc5f054fae19e479e7e71b5ce175461", "score": "0.50682503", "text": "def send_amount(amount)\n raise Keoken::Error::IdNotFound unless @id\n @data_script =\n [\n Keoken::VERSION_NODE,\n Keoken::TYPE_SEND_TOKEN,\n [@id.to_i].pack('L>').unpack('H*'),\n [amount.to_i].pack('q>').unpack('H*')\n ].flatten.join\n self\n end", "title": "" }, { "docid": "fd45839d95422887b1056a4ac3bdfeb4", "score": "0.5032308", "text": "def set_usd_amount\n self.usd_amount = CurrencyExchangeRate.convert_to_usd(amount, currency, date_posted)\n end", "title": "" }, { "docid": "da980bfaae8651df81fde4c7bc1d2caf", "score": "0.5026986", "text": "def line_amount=(value)\n end", "title": "" }, { "docid": "812ef46fcecacb4c4ead49cfd61dd6bf", "score": "0.5026639", "text": "def amount\n Money.from_amount(BigDecimal.new(params['amount_net']), currency)\n end", "title": "" }, { "docid": "be344c56b241363d61f43c674693a416", "score": "0.50181067", "text": "def amount\n @amount ||= currency_convert(params[:amount], params[:currency], 'USD')\n end", "title": "" }, { "docid": "e3cea1741e8bd229ca66ee72e9b1fbec", "score": "0.5015927", "text": "def line_amount=(value); raise SettingTotalDirectlyNotSupported.new(:line_amount); end", "title": "" }, { "docid": "299aa938a9355791970a08e8dc0aa2b7", "score": "0.49935555", "text": "def set_price (amount)\n @price = amount\n end", "title": "" }, { "docid": "1679a3e88e15b9c44d8d1ae1951218f0", "score": "0.4992145", "text": "def deposit(amount)\n raise ArgumentError.new(\"deposit amount must be >= 0\") if amount < 0\n @balance += amount\n end", "title": "" }, { "docid": "64b50d376edff60fa95254ed91afd5bd", "score": "0.49768463", "text": "def deposit! amount\n raise ApiExceptions::AccountError::InvalidTransactionAmountError.new(\"transaction amount is invalid\") if amount.to_f <= 0\n\n amount = amount.to_f\n self.balance -= amount\n ledger = Ledger.new(account_id: self.id, entry_type: :deposit, amount: amount, balance: self.balance)\n save_ledger_and_save(ledger)\n end", "title": "" } ]
4a6f50430c76279099322850dbd3f6a9
Returns true if this object has been destroyed, otherwise returns false.
[ { "docid": "ebb9ea2e14988ef155601376f95935a7", "score": "0.8246868", "text": "def destroyed?\n sync_with_transaction_state\n @destroyed\n end", "title": "" } ]
[ { "docid": "654919b070351d7b04989d480062ca58", "score": "0.8626681", "text": "def destroyed?\n @destroyed == true\n end", "title": "" }, { "docid": "f54e4d729d16154f372f9a8a598a0725", "score": "0.8613514", "text": "def destroyed?\n return false\n end", "title": "" }, { "docid": "201417c5ec0ae386572883deed86b459", "score": "0.8611748", "text": "def destroyed?\n @destroyed == true\n end", "title": "" }, { "docid": "201417c5ec0ae386572883deed86b459", "score": "0.8611748", "text": "def destroyed?\n @destroyed == true\n end", "title": "" }, { "docid": "0e0dfbcf560131506ced504212b59739", "score": "0.8603435", "text": "def destroyed?\n !!@destroyed\n end", "title": "" }, { "docid": "2d7e2dc95e97f0fc8d0bd0df107967e0", "score": "0.857574", "text": "def destroyed? #:nodoc:\n false\n end", "title": "" }, { "docid": "fd89a8fbea97b12ecd99c33f1bd3f901", "score": "0.8568146", "text": "def destroyed?\n self.is_destroyed\n end", "title": "" }, { "docid": "a1be2f08895e03d954a9a4d47fc10a66", "score": "0.85646045", "text": "def destroyed?\n @destroyed == true\n end", "title": "" }, { "docid": "3bf5dc9d575243b824e90014281fe437", "score": "0.8546368", "text": "def destroyed?\n @destroyed\n end", "title": "" }, { "docid": "3bf5dc9d575243b824e90014281fe437", "score": "0.8546368", "text": "def destroyed?\n @destroyed\n end", "title": "" }, { "docid": "3bf5dc9d575243b824e90014281fe437", "score": "0.8546368", "text": "def destroyed?\n @destroyed\n end", "title": "" }, { "docid": "db23e0ab12fea18249cd6e140dc10da6", "score": "0.8541531", "text": "def destroyed?\n @destroyed\n end", "title": "" }, { "docid": "db23e0ab12fea18249cd6e140dc10da6", "score": "0.8541531", "text": "def destroyed?\n @destroyed\n end", "title": "" }, { "docid": "db23e0ab12fea18249cd6e140dc10da6", "score": "0.8541531", "text": "def destroyed?\n @destroyed\n end", "title": "" }, { "docid": "db23e0ab12fea18249cd6e140dc10da6", "score": "0.8541531", "text": "def destroyed?\n @destroyed\n end", "title": "" }, { "docid": "db23e0ab12fea18249cd6e140dc10da6", "score": "0.8541531", "text": "def destroyed?\n @destroyed\n end", "title": "" }, { "docid": "db23e0ab12fea18249cd6e140dc10da6", "score": "0.8541531", "text": "def destroyed?\n @destroyed\n end", "title": "" }, { "docid": "db23e0ab12fea18249cd6e140dc10da6", "score": "0.8541531", "text": "def destroyed?\n @destroyed\n end", "title": "" }, { "docid": "07e42d0fd381b2c859b2639011493bea", "score": "0.85412097", "text": "def destroyed?\n !!@destroyed\n end", "title": "" }, { "docid": "715490d7239edeba6b45bc25025d500e", "score": "0.85156476", "text": "def destroyed?\n return true if @destroyed\n false\n end", "title": "" }, { "docid": "ad50884459f1177c9bc71956a6855b12", "score": "0.850874", "text": "def destroyed?\n false\n end", "title": "" }, { "docid": "9bd32cb2fc788a3ca134b798d5fcdfc9", "score": "0.8453452", "text": "def destroyed?\n @destroyed ||= false\n end", "title": "" }, { "docid": "9bd32cb2fc788a3ca134b798d5fcdfc9", "score": "0.8453452", "text": "def destroyed?\n @destroyed ||= false\n end", "title": "" }, { "docid": "9bd32cb2fc788a3ca134b798d5fcdfc9", "score": "0.8453452", "text": "def destroyed?\n @destroyed ||= false\n end", "title": "" }, { "docid": "9bd32cb2fc788a3ca134b798d5fcdfc9", "score": "0.8453452", "text": "def destroyed?\n @destroyed ||= false\n end", "title": "" }, { "docid": "9ed55fb10592c31536bb83352736cf8c", "score": "0.82439786", "text": "def destroyed?\n @_deleted\n end", "title": "" }, { "docid": "39f0251d569631b5bb9770b5918dcbc4", "score": "0.8212462", "text": "def destroyed?\n return @destoryed\n end", "title": "" }, { "docid": "d6266f74c9108b2b1acd55c943ce3f41", "score": "0.8159207", "text": "def destroyed?\n @data.destroyed?\n end", "title": "" }, { "docid": "d936c37b4de0698a11f0b021c6ea811d", "score": "0.80500126", "text": "def destroyed?\n @destroyed ||= false\n end", "title": "" }, { "docid": "d936c37b4de0698a11f0b021c6ea811d", "score": "0.80500126", "text": "def destroyed?\n @destroyed ||= false\n end", "title": "" }, { "docid": "c655192e312627fe53626deb5fbef07d", "score": "0.8008947", "text": "def destroyed?\n self._removed || self.frozen?\n end", "title": "" }, { "docid": "f84005c8ad005b3ea92fbd34dfe03030", "score": "0.7995584", "text": "def destroyed?\n !!(@__metadata__.cas && @__metadata__.key.nil?)\n end", "title": "" }, { "docid": "30efe724c8cf9a87a3aba296101419f3", "score": "0.7924405", "text": "def destroyed?\n to_address == ZERO_ADDRESS\n end", "title": "" }, { "docid": "b981e80ad9794ea1fe04f4c9eefdaea5", "score": "0.7910308", "text": "def destroyed?\n @_deleted || (!new_record? && !exist?)\n end", "title": "" }, { "docid": "dfd9a54b63bd98a3c5247c4a22b49421", "score": "0.78922206", "text": "def being_destroyed?\n @being_destroyed\n end", "title": "" }, { "docid": "3cb974e2032196c7db23c1bb6c52420e", "score": "0.78743815", "text": "def destroyed?\n @destroyed || !!deleted_at\n end", "title": "" }, { "docid": "140c82402bd2444fd92b9d2456cb5e63", "score": "0.78565645", "text": "def destroyed?\n !deleted_at.nil?\n end", "title": "" }, { "docid": "31398a49a05529515d6beb72ccd97624", "score": "0.7836453", "text": "def destroyed?\n @_deleted # || (!new_record? && !self.class.load_entity(_orient_id))\n end", "title": "" }, { "docid": "0b9eba69a79c92b6bc5f23815f5693e5", "score": "0.7801931", "text": "def destroyed?\n (@destroyed ||= false) || !!deleted_at\n end", "title": "" }, { "docid": "3b09c401a34b77980dbbae2db806b17b", "score": "0.7733359", "text": "def destroyed?\n not_implemented :destroyed?\n end", "title": "" }, { "docid": "2b8bdcd56e10ae07b33959ca3aa5d397", "score": "0.77005213", "text": "def destroyed?\n @_deleted || (!new_record? && !self.class.load_entity(neo_id))\n end", "title": "" }, { "docid": "a3834700b883b11059934153d2a417e4", "score": "0.7415171", "text": "def being_destroyed?\n instances_being_destroyed.include?(id) \n end", "title": "" }, { "docid": "7558d9bbd8c32e7a0bc52ca27840e168", "score": "0.7297448", "text": "def destroyed?\n deleted_at > EPOCH_DATE\n end", "title": "" }, { "docid": "458d4d122716a1927f8cb6a0423c8901", "score": "0.7294283", "text": "def marked_for_destruction?\n return @destroy\n end", "title": "" }, { "docid": "bb40ee39c1c2cc0532a31b00f01e2f6d", "score": "0.7234182", "text": "def _destroy\n return marked_for_destruction?\n end", "title": "" }, { "docid": "831fc9a573eb35de16d66f430b37fd74", "score": "0.71499026", "text": "def destroyed?\n deleted\n end", "title": "" }, { "docid": "f798f6afd55638ebc83baa0f921b273b", "score": "0.710831", "text": "def destroy?\n @destroy\n end", "title": "" }, { "docid": "d184174cbf1d50e9ff980b68091e6cab", "score": "0.7049991", "text": "def detached?\n @obj.nil?\n end", "title": "" }, { "docid": "d184174cbf1d50e9ff980b68091e6cab", "score": "0.7049991", "text": "def detached?\n @obj.nil?\n end", "title": "" }, { "docid": "3774fbacb16b5778b934a0f58d33ef52", "score": "0.704013", "text": "def destroyed?\n @operator.destroyed?\n end", "title": "" }, { "docid": "110d3599988e0a919d7d8c9fb3d00c37", "score": "0.701508", "text": "def destroyed_dependent?(klass)\n _class_hash(klass).key?(:_destroyed)\n end", "title": "" }, { "docid": "88f6973c1e2ac583e8a15611429bd3c8", "score": "0.7005611", "text": "def is_destroyed_by_association?\n destroyed_by_association.present?\n end", "title": "" }, { "docid": "0eb23c47e680f40bd09b5eefcd37ffae", "score": "0.70024055", "text": "def contains_destroyed?\n if contains_ship?\n @data.destroyed?\n else\n false\n end\n end", "title": "" }, { "docid": "8f12714fde46e123acc6b0c8a6a82933", "score": "0.6942964", "text": "def previously_persisted?\n !new_record? && destroyed?\n end", "title": "" }, { "docid": "c0eece619d56dececde8044531ef7afb", "score": "0.692076", "text": "def _destroy\n marked_for_destruction?\n end", "title": "" }, { "docid": "c0eece619d56dececde8044531ef7afb", "score": "0.692076", "text": "def _destroy\n marked_for_destruction?\n end", "title": "" }, { "docid": "c0eece619d56dececde8044531ef7afb", "score": "0.692076", "text": "def _destroy\n marked_for_destruction?\n end", "title": "" }, { "docid": "08700ae1a9129c1b2fed8c588955cbfb", "score": "0.6851442", "text": "def destroy?\n true\n end", "title": "" }, { "docid": "08700ae1a9129c1b2fed8c588955cbfb", "score": "0.6851442", "text": "def destroy?\n true\n end", "title": "" }, { "docid": "52bd0ffb6a540a61a13e35575acbe97e", "score": "0.6799728", "text": "def will_be_destroyed?(association_name, attributes)\n has_destroy_flag?(attributes)\n end", "title": "" }, { "docid": "b9d8b8fce19d4df2d2be0d28398068f6", "score": "0.6753013", "text": "def destroyed?; end", "title": "" }, { "docid": "b9d8b8fce19d4df2d2be0d28398068f6", "score": "0.6753013", "text": "def destroyed?; end", "title": "" }, { "docid": "5f371df935dea7b9ac13509a7ed11078", "score": "0.67328966", "text": "def can_destroyed?\n=begin\n # list of associations to check (automatic)\n has_assocs = []\n self.class.reflections.each do |r_name, r|\n has_assocs << r_name if [:has_one, :has_many, :has_and_belongs_to_many].include? r.macro\n end\n\n # check for emptyness\n has_assocs.each do |r_name|\n assoc = self.send(r_name)\n nothing = assoc.respond_to?('empty?') ? assoc.empty? : assoc.nil?\n return false unless nothing\n end\n=end\n true\n end", "title": "" }, { "docid": "a955c339081a3ff372398ab934e6d8b0", "score": "0.672391", "text": "def destroy?\n run_mode == :destroy\n end", "title": "" }, { "docid": "b70ee3aa249794617e2f36cdc1122133", "score": "0.67048776", "text": "def destroyed?\n param&.action_type == 'destroy'\n end", "title": "" }, { "docid": "b21f23090a9707f28795fb400e6758e6", "score": "0.6684038", "text": "def marked_for_destruction?\n false\n end", "title": "" }, { "docid": "0371f30a334a58cd19c73426a17337a9", "score": "0.6670905", "text": "def marked_for_destruction?\n false\n end", "title": "" }, { "docid": "57e1c2eac9732de1848c78ab08e588d8", "score": "0.6620577", "text": "def killed?\n @killed\n end", "title": "" }, { "docid": "c8ed7c5ed72ee652998417ec144da57d", "score": "0.6620126", "text": "def exists_only_destroyed? *args\n destroyed.exists?(*args)\n end", "title": "" }, { "docid": "c26c76732d6b805ea073c43920514b62", "score": "0.66193163", "text": "def flagged_for_destroy?\n @flagged_for_destroy ||= false\n end", "title": "" }, { "docid": "418cde8e9fd054c602323dd36fd2f74f", "score": "0.6610316", "text": "def can_destroyed?\n # list of associations to check (automatic)\n has_assocs = []\n self.class.reflections.each do |r_name, r|\n has_assocs << r_name if [:has_one, :has_many, :has_and_belongs_to_many].include? r.macro\n end\n\n # check for emptyness\n has_assocs.each do |r_name|\n assoc = self.send(r_name)\n nothing = assoc.respond_to?('empty?') ? assoc.empty? : assoc.nil?\n return false unless nothing\n end\n \n true\n end", "title": "" }, { "docid": "418cde8e9fd054c602323dd36fd2f74f", "score": "0.6610316", "text": "def can_destroyed?\n # list of associations to check (automatic)\n has_assocs = []\n self.class.reflections.each do |r_name, r|\n has_assocs << r_name if [:has_one, :has_many, :has_and_belongs_to_many].include? r.macro\n end\n\n # check for emptyness\n has_assocs.each do |r_name|\n assoc = self.send(r_name)\n nothing = assoc.respond_to?('empty?') ? assoc.empty? : assoc.nil?\n return false unless nothing\n end\n \n true\n end", "title": "" }, { "docid": "418cde8e9fd054c602323dd36fd2f74f", "score": "0.6610316", "text": "def can_destroyed?\n # list of associations to check (automatic)\n has_assocs = []\n self.class.reflections.each do |r_name, r|\n has_assocs << r_name if [:has_one, :has_many, :has_and_belongs_to_many].include? r.macro\n end\n\n # check for emptyness\n has_assocs.each do |r_name|\n assoc = self.send(r_name)\n nothing = assoc.respond_to?('empty?') ? assoc.empty? : assoc.nil?\n return false unless nothing\n end\n \n true\n end", "title": "" }, { "docid": "524536cea98b02772c047d06682da36f", "score": "0.65983015", "text": "def destroy?\n self.event == 'destroy'\n end", "title": "" }, { "docid": "1763755ee657a4df6a4a0e6288f2ab8b", "score": "0.65900004", "text": "def exists_only_destroyed? *args\n destroyed.exists?(*args)\n end", "title": "" }, { "docid": "786d1bf04d5aa8e7246d65394974b75d", "score": "0.65671986", "text": "def dead?\r\n @obj == nil\r\n end", "title": "" }, { "docid": "2e50c71785d2d8dca7804958ae07222c", "score": "0.65436614", "text": "def can_destroyed?\n return false if self.modem_short_messages.any? { |short_message| not short_message.can_destroyed? }\n true\n end", "title": "" }, { "docid": "0f2d60640abfa4fd9b10145bf018d228", "score": "0.6538045", "text": "def has_destroy_flag?(hash)\n Type::Boolean.new.cast(hash[\"_destroy\"])\n end", "title": "" }, { "docid": "99dbc9ad3ee1bc4d6adec0e46693374b", "score": "0.653421", "text": "def destroy?\n #NOTE: restore if/when you need to get it back, not used anywhere at the moment\n #!record.discarded? && update? && record != user\n false\n end", "title": "" }, { "docid": "f641c0483eab17b5a9810412699e4fb9", "score": "0.65218055", "text": "def disposed?\n @entity.destroyed?\n end", "title": "" }, { "docid": "9cdbdb26b916c450302ff523a73bab04", "score": "0.6503905", "text": "def terminated?\n false\n end", "title": "" }, { "docid": "9cdbdb26b916c450302ff523a73bab04", "score": "0.6503905", "text": "def terminated?\n false\n end", "title": "" }, { "docid": "0765378bbe01ac6be8f1bcddd1838668", "score": "0.650324", "text": "def destroy\n return false if callback(:before_destroy) == false\n result = alt_destroy_without_callbacks\n callback(:after_destroy)\n self\n end", "title": "" }, { "docid": "163f402a1e43508e9155201c86b3a677", "score": "0.64929354", "text": "def terminated?\r\n @terminated\r\n end", "title": "" }, { "docid": "81b1907d8a93d54977749aa01b2a1b23", "score": "0.6489286", "text": "def terminated?\n is?(final_state)\n end", "title": "" }, { "docid": "38eaadabf7a4d56bd8034e35b2030981", "score": "0.64873743", "text": "def done?\n killed?\n end", "title": "" }, { "docid": "3dc4a1bea0a1e326fa164560a2514da1", "score": "0.6478395", "text": "def has_destroy_flag?(hash)\n ActiveModel::Type::Boolean.new.cast(hash[\"_destroy\"])\n end", "title": "" }, { "docid": "504217657588764d676774b75355f6d5", "score": "0.6424993", "text": "def can_destroyed?\n self.status != 'SEND-PROCESS'\n end", "title": "" }, { "docid": "750029adc2ca80f1f7c47e905c6a3744", "score": "0.6414915", "text": "def is_destructor?\n __boolean(OCI_ATTR_IS_DESTRUCTOR)\n end", "title": "" }, { "docid": "689a5867bb470ea92d3eb7db18659cfb", "score": "0.6404565", "text": "def entity_destroyed?(entity)\n !entity_exists?(entity) or\n Morrow.entities_to_be_destroyed.include?(entity)\n end", "title": "" }, { "docid": "2b74aaeff9f3d7d28a924a1e696ec682", "score": "0.6404211", "text": "def marked_for_destruction?\n false\n end", "title": "" }, { "docid": "547db0afc5bb28d9d22f25232d92bb02", "score": "0.6390574", "text": "def has_destroy_flag?(hash)\n Type::Boolean.new.cast(hash['_destroy'])\n end", "title": "" }, { "docid": "e17737d15e48f52b6f70f3ecaeb7ed90", "score": "0.6377842", "text": "def deallocated?\n id == -1\n end", "title": "" }, { "docid": "7a8ad51f913a6c73bc73e91d3c2ee35c", "score": "0.63662577", "text": "def destroy #:nodoc:\n return false if callback(:before_destroy) == false\n result = super\n callback(:after_destroy)\n result\n end", "title": "" }, { "docid": "4506cc2fbb6931aec359f7a40b703ab0", "score": "0.6361927", "text": "def destroyable?\n true\n end", "title": "" }, { "docid": "39dfca3621ef5a6c646aee76cf24b0ff", "score": "0.6360395", "text": "def will_be_destroyed?(association_name, attributes)\n allow_destroy?(association_name) && has_destroy_flag?(attributes)\n end", "title": "" }, { "docid": "dc782a66e66f96a252dca061f90c0cd9", "score": "0.6355917", "text": "def dead?\n !self.alive?\n end", "title": "" }, { "docid": "b5849a7e5c5cccba550a250f0b1f3b0f", "score": "0.63477623", "text": "def destroyable?\n (self.count == 0) || (self.direct? && self.count == 1)\n end", "title": "" }, { "docid": "c31df211b94719ab8559bd8181e14cc5", "score": "0.63440627", "text": "def finished?\n !self.finished_at.nil?\n end", "title": "" }, { "docid": "c31df211b94719ab8559bd8181e14cc5", "score": "0.63440627", "text": "def finished?\n !self.finished_at.nil?\n end", "title": "" } ]
8a9b5e074fb6a2062920badd5f09031b
GET /tipos_projetos/new GET /tipos_projetos/new.json
[ { "docid": "80add858c7df7a9f9873ac618da28f2e", "score": "0.8222527", "text": "def new\n @tipos_projeto = TiposProjeto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipos_projeto }\n end\n end", "title": "" } ]
[ { "docid": "106137a65920dc3ffd9ac1cbc47fb8c3", "score": "0.7811353", "text": "def create\n @tipos_projeto = TiposProjeto.new(params[:tipos_projeto])\n\n respond_to do |format|\n if @tipos_projeto.save\n format.html { redirect_to @tipos_projeto, notice: 'Tipos projeto was successfully created.' }\n format.json { render json: @tipos_projeto, status: :created, location: @tipos_projeto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tipos_projeto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c91792d657b8f0ba82f01cc9260e7cbd", "score": "0.7640618", "text": "def new\n @projet = Projet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @projet }\n end\n end", "title": "" }, { "docid": "365af6b8884c3a2208e4f91e8dca4315", "score": "0.7501062", "text": "def create\n @projeto_ti = ProjetoTi.new(projeto_ti_params)\n\n respond_to do |format|\n if @projeto_ti.save\n format.html { redirect_to @projeto_ti, notice: 'Projeto de TI criado com sucesso.' }\n format.json { render action: 'show', status: :created, location: @projeto_ti }\n else\n format.html { render action: 'new' }\n format.json { render json: @projeto_ti.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "418912bb7d0ea9eac7e1b03b9b51de2d", "score": "0.7440058", "text": "def new\n @root = \"projects\"\n @branch = \"new\"\n \n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "cb5cd9c32243151a20b6a1788be2293c", "score": "0.7370055", "text": "def new\n @new_project = NewProject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @new_project }\n end\n end", "title": "" }, { "docid": "0ab240ff6e137ba048bc8d53395c00f6", "score": "0.7343114", "text": "def new\n @projekt = Projekt.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @projekt }\n end\n end", "title": "" }, { "docid": "fbdd1bfd7ac419524e65db0d10b86c9b", "score": "0.729159", "text": "def new\n @project = Project.new\n get_repo_list\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "331773cec7c30cc048544475537fa69b", "score": "0.7284299", "text": "def new\n @prodotto = Prodotto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @prodotto }\n end\n end", "title": "" }, { "docid": "4982146b969f284d95705c7ea569ec86", "score": "0.72555745", "text": "def new\n @project = Project.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "7dcb1b83bf3230200e460c03a8a2221a", "score": "0.723149", "text": "def new\n @proj = Proj.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @proj}\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7177102", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "eb8756e371f1158d2340fec9bde6ddda", "score": "0.7176785", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "331669688833aa4d4c60688c1bc7022e", "score": "0.71684206", "text": "def new\n @etude = @projet.etudes.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @etude }\n end\n end", "title": "" }, { "docid": "e61b74200f46dc002d5991da43bd5fc1", "score": "0.71464163", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n #~ format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "5db20e4d01b68c131c5e05f916e14737", "score": "0.7143986", "text": "def new\n @project = Project.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "0f369e8e579bc0b230955dab7ed9cf35", "score": "0.7138712", "text": "def new\n @project = Project.new\n\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "d941b855d1abaca3e3ac71e0f9599893", "score": "0.71203035", "text": "def new\n @punto_servicio = PuntoServicio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @punto_servicio }\n end\n end", "title": "" }, { "docid": "5501acd8f1f8d023fce5bab3b2e34c8c", "score": "0.7111414", "text": "def new\n @tipo = Tipo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo }\n end\n end", "title": "" }, { "docid": "f6bd54783685b5c7c2370dab1f3f06b2", "score": "0.7101445", "text": "def new\n @parceiros = Parceiro.all \n @novidades = Novidade.order('created_at').last(6) \n \n @contato = Contato.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contato }\n end\n end", "title": "" }, { "docid": "2871a5f262700c3f9596698042f29bda", "score": "0.70967567", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @project }\n end\n end", "title": "" }, { "docid": "2871a5f262700c3f9596698042f29bda", "score": "0.70967567", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @project }\n end\n end", "title": "" }, { "docid": "2871a5f262700c3f9596698042f29bda", "score": "0.70967567", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @project }\n end\n end", "title": "" }, { "docid": "2871a5f262700c3f9596698042f29bda", "score": "0.70967567", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @project }\n end\n end", "title": "" }, { "docid": "b9262111287352b740877afbde453c94", "score": "0.7068073", "text": "def new\n @tipo_nota = TipoNota.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_nota }\n end\n end", "title": "" }, { "docid": "d366ab03122805a9fae9fb408d755a7c", "score": "0.7065907", "text": "def create\n @projet = Projet.new(params[:projet])\n\n respond_to do |format|\n if @projet.save\n format.html { redirect_to @projet, notice: 'Projet was successfully created.' }\n format.json { render json: @projet, status: :created, location: @projet }\n else\n format.html { render action: \"new\" }\n format.json { render json: @projet.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fee09f13b6895bbe0e0a10a8b2585af5", "score": "0.7061592", "text": "def new\n @project = Project.new\n\n respond_to do |format|\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "2325ae30f789d38827e0c28721684871", "score": "0.7048449", "text": "def new\n @torneotipo = Torneotipo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @torneotipo }\n end\n end", "title": "" }, { "docid": "85b996d448f9a01e24f638560b59c171", "score": "0.7038075", "text": "def new\n @posizione = Posizione.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @posizione }\n end\n end", "title": "" }, { "docid": "53bbd2e90919e690971c302ea68167fe", "score": "0.7028057", "text": "def new\n @project_task = ProjectTask.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project_task }\n end\n end", "title": "" }, { "docid": "5e2dd02c7ad5833a1133dd8c78a7438c", "score": "0.70183927", "text": "def new\n @project = current_user.projects.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "5e2dd02c7ad5833a1133dd8c78a7438c", "score": "0.70183927", "text": "def new\n @project = current_user.projects.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "07bc945e42fc1400e2644d41827a1af2", "score": "0.7018317", "text": "def new\n @project = Project.new\n @title = \"Create Project\"\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "d7a16fdd53a2005a247d0d63e064730c", "score": "0.69852525", "text": "def new\n @tipo_personaje = TipoPersonaje.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_personaje }\n end\n end", "title": "" }, { "docid": "b084f53eb7f7e20d470868275daa1e11", "score": "0.69802237", "text": "def new\n @task = Task.new :project_id => params[:project_id]\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @task }\n end\n end", "title": "" }, { "docid": "7eabac21b8f95ebb5f95fe652aeaf539", "score": "0.6978836", "text": "def create\n @tarefa_do_projeto = TarefaDoProjeto.new(tarefa_do_projeto_params)\n\n respond_to do |format|\n if @tarefa_do_projeto.save\n format.html { redirect_to @tarefa_do_projeto, notice: 'Tarefa do projeto was successfully created.' }\n format.json { render :show, status: :created, location: @tarefa_do_projeto }\n else\n format.html { render :new }\n format.json { render json: @tarefa_do_projeto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c006696b4323851445bdc95c2b498361", "score": "0.69691765", "text": "def new\n @project = Project.find(params[:project_id])\n @pages = @project.pages\n @task = Task.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @task }\n end\n end", "title": "" }, { "docid": "754a3a6c031c2d1d5fd147b53a1ea9f6", "score": "0.6953047", "text": "def new\n @tipocarga = Tipocarga.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @tipocarga }\n end\n end", "title": "" }, { "docid": "8eef0ac46628e58964d1258b59b184fa", "score": "0.69515836", "text": "def new\n @title = \"Новый бриф\"\n @project = Project.new\n @project.name = \"Новый бриф\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "56a141712699fdc2e05e93f8b8670295", "score": "0.6941609", "text": "def new\n @projeto = Projeto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @projeto }\n end\n end", "title": "" }, { "docid": "812d911af36fe6f3f621f91cf63041b5", "score": "0.6939082", "text": "def new\n @precio = Precio.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @precio }\n end\n end", "title": "" }, { "docid": "a0788c16c833d75df4ca8171338b16a7", "score": "0.6936268", "text": "def new\n @puntaje = Puntaje.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puntaje }\n end\n end", "title": "" }, { "docid": "9a90a12e934f62aca4acf0b037c3891d", "score": "0.693515", "text": "def new\n @tipolog = Tipolog.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipolog }\n end\n end", "title": "" }, { "docid": "4469e4dc7e1aa11a9082e1b0f842086e", "score": "0.69340014", "text": "def new\n @personal_project = PersonalProject.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @personal_project }\n end\n end", "title": "" }, { "docid": "dbf8997514d4777a750c3731737f5501", "score": "0.6925114", "text": "def new\n @propietario = Propietario.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @propietario }\n end\n end", "title": "" }, { "docid": "48a0f1e0d710706c3500a907cd699efe", "score": "0.69217235", "text": "def new\n \t@project = Project.new\n\n \trespond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "e9a2602baa22c4242a91b07248a7db43", "score": "0.69214755", "text": "def new\n @tipp = Tipp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipp }\n end\n end", "title": "" }, { "docid": "902df3dfde0974b122eefbbdf4e340d3", "score": "0.69213283", "text": "def new\n @tipo_contributo = TipoContributo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_contributo }\n end\n end", "title": "" }, { "docid": "9660261bedfb6adbb3f8d848f8d7a6c0", "score": "0.6917136", "text": "def new\n @initial_project = InitialProject.new(:name => \"myblog\")\n\n respond_to do |format|\n format.html\n format.json { render json: @initial_project }\n end\n end", "title": "" }, { "docid": "f9686c3babb5adb98d81cec3bdad236c", "score": "0.69166094", "text": "def new\n\tadd_breadcrumb \"Nuevo noticia\", :new_noticia_path\n @noticia = Noticia.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @noticia }\n end\n end", "title": "" }, { "docid": "956f5474889108458870bdc7c3f84ae5", "score": "0.6916142", "text": "def create\n @punto = Punto.new(punto_params)\n @punto.proyecto_id = params[:proyecto_id]\n\n respond_to do |format|\n if @punto.save\n format.html { redirect_to @punto, notice: 'Punto was successfully created.' }\n format.json { render :show, status: :created, location: @punto }\n else\n format.html { render :new }\n format.json { render json: @punto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0da16db4b6460aa9ee452d03105308b4", "score": "0.6914367", "text": "def create\n @projeto = Projeto.new(projeto_params)\n\n respond_to do |format|\n if @projeto.save\n format.html { redirect_to @projeto, notice: 'Projeto foi adicionado(a) com sucesso.' }\n format.json { render :show, status: :created, location: @projeto }\n else\n format.html { render :new }\n format.json { render json: @projeto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ee239bd99c785a4dfd1749fd4d91e4d9", "score": "0.69116575", "text": "def new\n @project = @tracker.projects.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "62fdd35255e2aea16afb169a339e2ca0", "score": "0.6906531", "text": "def new\n @project = Project.new\n @backlink = root_path\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @project }\n end\n end", "title": "" }, { "docid": "a77301f8ba173248806c0e5ab7304f45", "score": "0.6897747", "text": "def new\n add_breadcrumb :new\n\n @project = current_user.projects.new\n respond_with(@project)\n end", "title": "" }, { "docid": "a77301f8ba173248806c0e5ab7304f45", "score": "0.6897747", "text": "def new\n add_breadcrumb :new\n\n @project = current_user.projects.new\n respond_with(@project)\n end", "title": "" }, { "docid": "0361af803aad997b57901f3ed31cf7f4", "score": "0.68959093", "text": "def new\n @provi = Provi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @provi }\n end\n end", "title": "" }, { "docid": "3ad9f0359ada5d3fa63cc3441ccd678e", "score": "0.68909264", "text": "def new\n @projecttype = Projecttype.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @projecttype }\n end\n end", "title": "" }, { "docid": "0bc0f610502a53cc7a5910a5cb41083a", "score": "0.6884905", "text": "def new\n @punto_de_ventum = PuntoDeVentum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @punto_de_ventum }\n end\n end", "title": "" }, { "docid": "b6db449e029e107f1b5e6a663097a835", "score": "0.6884417", "text": "def create\n @projekt = Projekt.new(params[:projekt])\n\n respond_to do |format|\n if @projekt.save\n format.html { redirect_to @projekt, notice: 'Projekt was successfully created.' }\n format.json { render json: @projekt, status: :created, location: @projekt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @projekt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "185ed4e8eb307ce58bd527362483384f", "score": "0.6880042", "text": "def new\n @projecttag = Projecttag.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @projecttag }\n end\n end", "title": "" }, { "docid": "1ea896342cdb10f577ed968ec0599d6d", "score": "0.6872746", "text": "def create\n @prodotto = Prodotto.new(params[:prodotto])\n\n respond_to do |format|\n if @prodotto.save\n format.html { redirect_to @prodotto, notice: 'Prodotto creato con successo.' }\n format.json { render json: @prodotto, status: :created, location: @prodotto }\n else\n format.html { render action: \"new\" }\n format.json { render json: @prodotto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38d89c21036adce47d5f96192564349b", "score": "0.68650925", "text": "def new\n @pelicula = Pelicula.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @pelicula }\n end\n end", "title": "" }, { "docid": "ba12a8e5199f8b29945ac9767c3b58cc", "score": "0.6859039", "text": "def new\n @parceiro = Parceiro.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @parceiro }\n end\n end", "title": "" }, { "docid": "f22dd473f434187333a7095d9bd933a1", "score": "0.68439806", "text": "def create\n @parceiros = Parceiro.all \n @novidades = Novidade.order('created_at').last(6) \n \n @contato = Contato.new(params[:contato])\n\n respond_to do |format|\n if @contato.save\n format.html { redirect_to @contato, notice: 'Contato enviado com sucesso' }\n format.json { render json: @contato, status: :created, location: @contato }\n else\n format.html { render action: \"new\" }\n format.json { render json: @contato.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e0dad26b213e95f3699908d4f3807d5b", "score": "0.6839227", "text": "def new\n @tipo_cargo = TipoCargo.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_cargo }\n end\n end", "title": "" }, { "docid": "23443d842bd622d29c4bc5c1eb53f699", "score": "0.6835609", "text": "def new\n @puesto = Puesto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @puesto }\n end\n end", "title": "" } ]
2855a4b448b5a4258f229231c2b297b7
GET /spelling_errors/new GET /spelling_errors/new.json
[ { "docid": "329007458141deda5281a37a26800092", "score": "0.0", "text": "def new\n \n end", "title": "" } ]
[ { "docid": "412fab05da8fd9b5d70c8aff4c07d53d", "score": "0.6892578", "text": "def new\n @term = @glossary.terms.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @term }\n end\n end", "title": "" }, { "docid": "50156afaf32206c443c62c2600875a52", "score": "0.6751729", "text": "def new\n @error = Error.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @error }\n end\n end", "title": "" }, { "docid": "307818eb5b78b721d51c7440770b5164", "score": "0.6577962", "text": "def new\n @word_meaning = WordMeaning.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word_meaning }\n end\n end", "title": "" }, { "docid": "011fccd5db8976c7890f7472b6ea0011", "score": "0.6574484", "text": "def new\n @lsa_word = LsaWord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lsa_word }\n end\n end", "title": "" }, { "docid": "5e4536a9ec79c62f338585b6c031c402", "score": "0.65495914", "text": "def new\n @glossary = Glossary.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @glossary }\n end\n end", "title": "" }, { "docid": "6855c49b6ecde191b33bcead47e05b47", "score": "0.6469234", "text": "def new\n @term = Term.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @term }\n end\n end", "title": "" }, { "docid": "6855c49b6ecde191b33bcead47e05b47", "score": "0.6469234", "text": "def new\n @term = Term.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @term }\n end\n end", "title": "" }, { "docid": "6855c49b6ecde191b33bcead47e05b47", "score": "0.6469234", "text": "def new\n @term = Term.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @term }\n end\n end", "title": "" }, { "docid": "6855c49b6ecde191b33bcead47e05b47", "score": "0.6469234", "text": "def new\n @term = Term.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @term }\n end\n end", "title": "" }, { "docid": "6855c49b6ecde191b33bcead47e05b47", "score": "0.6469234", "text": "def new\n @term = Term.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @term }\n end\n end", "title": "" }, { "docid": "6916f38ec6ff0804486194ae4aa7f0b7", "score": "0.6461521", "text": "def new\n @term = Term.new\n @terms = Term.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @term }\n end\n end", "title": "" }, { "docid": "cb8d9cd4cce2822f716c0478492952d8", "score": "0.64586574", "text": "def new\n @lower_phrase = LowerPhrase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lower_phrase }\n end\n end", "title": "" }, { "docid": "32e57ffdccd8db1384b675fb5639ac00", "score": "0.6449468", "text": "def new\n @suggestion = Suggestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @suggestion }\n end\n end", "title": "" }, { "docid": "32e57ffdccd8db1384b675fb5639ac00", "score": "0.6449468", "text": "def new\n @suggestion = Suggestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @suggestion }\n end\n end", "title": "" }, { "docid": "32e57ffdccd8db1384b675fb5639ac00", "score": "0.6449468", "text": "def new\n @suggestion = Suggestion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @suggestion }\n end\n end", "title": "" }, { "docid": "95f43b8f31c6baac24f78ccc6396a438", "score": "0.6410816", "text": "def new\n @ng_word = NgWord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ng_word }\n end\n end", "title": "" }, { "docid": "0fa3f89bd06127b3509883b96c7c1af5", "score": "0.6402013", "text": "def new\n @word = Word.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "8895f60d6b4132ed40591a6ae9569a44", "score": "0.63956404", "text": "def new\n @rubyterm = Rubyterm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @rubyterm }\n end\n end", "title": "" }, { "docid": "3a4a89dc5abbf61e24c226a0d302db21", "score": "0.6370377", "text": "def new\n @lost_found = LostFound.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lost_found }\n end\n end", "title": "" }, { "docid": "598fd263a086d38fb59a055704b2b23c", "score": "0.6357179", "text": "def new\n @suggested_keyword = SuggestedKeyword.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @suggested_keyword }\n end\n end", "title": "" }, { "docid": "8177758ca924661d28cda65c3a5ccccc", "score": "0.63543856", "text": "def new\n @errors = Errors.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @errors }\n end\n end", "title": "" }, { "docid": "c78fff913fabaa35ffb77b1b95ac3505", "score": "0.6350894", "text": "def new\n @word = Word.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "06639fcc54716d5a7afd1344d606c862", "score": "0.63465214", "text": "def new\n @word = Word.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @word }\n end\n end", "title": "" }, { "docid": "06639fcc54716d5a7afd1344d606c862", "score": "0.63465214", "text": "def new\n @word = Word.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @word }\n end\n end", "title": "" }, { "docid": "fcc57b3f7ba1697f34ab7aa16027b9c2", "score": "0.6335133", "text": "def new\r\n @word = Word.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @word }\r\n end\r\n end", "title": "" }, { "docid": "5ac132a9ca148bee90b1ee8307efc51d", "score": "0.63325155", "text": "def new\n @my_glossary = MyGlossary.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @my_glossary }\n end\n end", "title": "" }, { "docid": "ec0a341e6d217bdcf439c5fdecd8c42a", "score": "0.6318663", "text": "def new\n @scerror = Scerror.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @scerror }\n end\n end", "title": "" }, { "docid": "4eeda7b666dfea4a7836a494177f14e8", "score": "0.6294015", "text": "def new\n @word_set = WordSet.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word_set }\n end\n end", "title": "" }, { "docid": "30867783e5555afc0d1a4aa4d615cbfc", "score": "0.6263224", "text": "def new\n @word_type = WordType.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word_type }\n end\n end", "title": "" }, { "docid": "17d7da60333d97967bcd96628c11fd45", "score": "0.6259595", "text": "def new\n json_404\n end", "title": "" }, { "docid": "8970d3d64c8d5ea3539b2f0bfe83582e", "score": "0.6253767", "text": "def new\n @my_word = MyWord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @my_word }\n end\n end", "title": "" }, { "docid": "a409d8b6557bbf39f92adbc14a4ddf4c", "score": "0.62492895", "text": "def new\n @search_phrase = SearchPhrase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search_phrase }\n end\n end", "title": "" }, { "docid": "56b37d23a07ed25fbee414c0e385c9b7", "score": "0.6246645", "text": "def new\n @correct = Correct.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @correct }\n end\n end", "title": "" }, { "docid": "1bcda0ac884e0c4fbf5142aca8040dc0", "score": "0.6246215", "text": "def new\n @noun = Noun.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @noun }\n end\n end", "title": "" }, { "docid": "806d43e08eece0a9807f1bfee9f1a93a", "score": "0.6233075", "text": "def new\n @wordup = Wordup.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wordup }\n end\n end", "title": "" }, { "docid": "922eefbb3ab06385c06b9c148346f1cf", "score": "0.62216705", "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": "f856f738c7a4047aefe25bbc1daa7b66", "score": "0.621774", "text": "def create\n @spell = Spell.new(spell_params)\n\n if @spell.save\n render json: @spell, status: :created, location: @spell\n else\n render json: @spell.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "d2902c3731e5dfbfbda3f084dae747c2", "score": "0.62084204", "text": "def create\n @spelling_word = SpellingWord.new(spelling_word_params)\n\n respond_to do |format|\n if @spelling_word.save\n format.html { redirect_to @spelling_word, notice: 'Spelling word was successfully created.' }\n format.json { render :show, status: :created, location: @spelling_word }\n else\n format.html { render :new }\n format.json { render json: @spelling_word.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "acf226bb2dfd5f1d3ce45920caffc8d6", "score": "0.62045276", "text": "def new\n @keyword = keyword.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @keyword }\n end\n end", "title": "" }, { "docid": "cc034e0c2d24f7e21c60636b8d6283dd", "score": "0.61957175", "text": "def new\n @quest = Quest.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quest }\n end\n end", "title": "" }, { "docid": "8ddfa8abbdc2d4cfbcc00fbad19df562", "score": "0.61923295", "text": "def new\n @quest = Quest.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @quest }\n end\n end", "title": "" }, { "docid": "a98a717b070f7507c84f8249aaca69f9", "score": "0.6191244", "text": "def new\n @phrase = Phrase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @phrase }\n end\n end", "title": "" }, { "docid": "a98a717b070f7507c84f8249aaca69f9", "score": "0.6191244", "text": "def new\n @phrase = Phrase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @phrase }\n end\n end", "title": "" }, { "docid": "179b4d6685e0596517a8289355eca03e", "score": "0.61850744", "text": "def new\n @glossary_term = GlossaryTerm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @glossary_term }\n end\n end", "title": "" }, { "docid": "198a213650ceb7acfa7c03a5cbfc60ed", "score": "0.61764234", "text": "def new\n @keyword = Keyword.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @keyword }\n end\n end", "title": "" }, { "docid": "198a213650ceb7acfa7c03a5cbfc60ed", "score": "0.61764234", "text": "def new\n @keyword = Keyword.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @keyword }\n end\n end", "title": "" }, { "docid": "83cab81b489aff1c482166e9331cdb70", "score": "0.61587334", "text": "def new\n @gloss = Gloss.build_from_only_valid(params)\n @path = params[:path].try(:sub, /(gloss.*)\\[\\d*\\]/, \"\\\\1[#{Time.now.to_i}]\")\n @dictionaries = Dictionary.where(id: params[:dictionaries])\n @langs = Dictionary.langs_hash_for(@dictionaries)\n\n respond_to do |format|\n format.html do\n render partial: 'form' if request.xhr?\n end\n format.xml { render xml: @gloss }\n end\n end", "title": "" }, { "docid": "810c2f192ff3d937fefa6592eb1e41c7", "score": "0.6158663", "text": "def new\n @word_list = WordList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word_list }\n end\n end", "title": "" }, { "docid": "2b8302468514f5bd8099b72a2768d174", "score": "0.61482763", "text": "def new\n @tmp_word = TmpWord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tmp_word }\n end\n end", "title": "" }, { "docid": "770f5cabaaaeea177aafa0c5dd236cc5", "score": "0.6146791", "text": "def create\n @term = @glossary.create_term(params[:glossaries_term])\n\n respond_to do |format|\n if @term.save\n format.html { redirect_to glossary_term_path(@glossary, @term), notice: 'Term was successfully created.' }\n format.json { render json: @term, status: :created, location: @term }\n else\n format.html { render action: \"new\" }\n format.json { render json: @term.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5e68ee62f2d01e34583dc5c0b1f17c39", "score": "0.61282206", "text": "def new\n @legislation = Legislation.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @legislation }\n end\n end", "title": "" }, { "docid": "44ee2887ecd8af70b68b52ad15c1ff57", "score": "0.61175954", "text": "def new\n @entity_term = EntityTerm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @entity_term }\n end\n end", "title": "" }, { "docid": "62b39d18c405ff8d3edff23c403c403b", "score": "0.6108706", "text": "def new\n @system_error = SystemError.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @system_error }\n end\n end", "title": "" }, { "docid": "8d42ec3d9ca87c50efaeab746be3984c", "score": "0.6105546", "text": "def new\n @errors ||= []\n @question = Question.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @question }\n end\n end", "title": "" }, { "docid": "2ff4d802e4653cc966f63f6590e39e51", "score": "0.60939735", "text": "def new\n @upper_phrase = UpperPhrase.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @upper_phrase }\n end\n end", "title": "" }, { "docid": "55877ea489c2f9092ab41855bb80a34f", "score": "0.60872346", "text": "def new\n @hint = Hint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hint }\n end\n end", "title": "" }, { "docid": "55877ea489c2f9092ab41855bb80a34f", "score": "0.60872346", "text": "def new\n @hint = Hint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hint }\n end\n end", "title": "" }, { "docid": "55877ea489c2f9092ab41855bb80a34f", "score": "0.60872346", "text": "def new\n @hint = Hint.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hint }\n end\n end", "title": "" }, { "docid": "d73c14cbde2671b66652375a04961119", "score": "0.6086496", "text": "def new\n @termunit = Termunit.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @termunit }\n end\n end", "title": "" }, { "docid": "83005c1217e18203095d4a69ade4f9f9", "score": "0.60836196", "text": "def new\n @title = t('view.hints.new_title')\n @hint = @app.hints.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @hint }\n end\n end", "title": "" }, { "docid": "23aada16b4994555701fe5bbc860ab51", "score": "0.60795045", "text": "def new\n @import_error = ImportError.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @import_error }\n end\n end", "title": "" }, { "docid": "47aa238b94a2fa0b50636358e59924be", "score": "0.60787636", "text": "def new\n @objective = Objective.find(params[:id])\n @word = @objective.words.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "767f0b26d8d51718f64c34e2a3351aeb", "score": "0.6068343", "text": "def new\n @key_word = KeyWord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @key_word }\n end\n end", "title": "" }, { "docid": "defb1c5fd3a694fb6f5842fb9a44c4a0", "score": "0.6059014", "text": "def create\n @error = Error.new(params[:error])\n\n respond_to do |format|\n if @error.save\n format.html { redirect_to @error, notice: 'Error was successfully created.' }\n format.json { render json: @error, status: :created, location: @error }\n else\n format.html { render action: \"new\" }\n format.json { render json: @error.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "519c4e1d73b030a013a229b635db31ad", "score": "0.60575694", "text": "def new\n @unsolved = Unsolved.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @unsolved }\n end\n end", "title": "" }, { "docid": "6936bce3d0116525a49a642904e6bd98", "score": "0.60478413", "text": "def new\n @metaword = Metaword.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @metaword }\n end\n end", "title": "" }, { "docid": "2a1d210c390a698821fd20c0d3a73581", "score": "0.6045041", "text": "def new\n @failure = Failure.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @failure }\n end\n end", "title": "" }, { "docid": "bd74d051a04d1142881386320588ba50", "score": "0.6040929", "text": "def create\n @spell = Spell.new(spell_params)\n\n respond_to do |format|\n if @spell.save\n format.html { redirect_to @spell, notice: 'Spell was successfully created.' }\n format.json { render :show, status: :created, location: @spell }\n else\n format.html { render :new }\n format.json { render json: @spell.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5a9b53ac64d9ba118df8b05fa33ec63", "score": "0.60408664", "text": "def new\n error_404\n end", "title": "" }, { "docid": "5a3874c9141bbe207acd954285ea688b", "score": "0.6039372", "text": "def new\n @reason = Reason.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reason }\n end\n end", "title": "" }, { "docid": "edf6ed3ead44a4ecbcd2ae05cb6a956b", "score": "0.6039358", "text": "def create\n @mistake = Mistake.new(mistake_params)\n\n respond_to do |format|\n if @mistake.save\n format.html { redirect_to @mistake, notice: 'Mistake was successfully created.' }\n format.json { render :show, status: :created, location: @mistake }\n else\n format.html { render :new }\n format.json { render json: @mistake.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8ee462f657bfc1adb5d8d88d18a6c461", "score": "0.6033549", "text": "def new\n @languagestring = Languagestring.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @languagestring }\n end\n end", "title": "" }, { "docid": "9946eb048935a214116da7de3bc8c421", "score": "0.6033304", "text": "def new\n @keyword = Keyword.new\n @title = 'New Keyword'\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @keyword }\n end\n end", "title": "" }, { "docid": "08cc1fbb12d58220a1311416afa9b57b", "score": "0.6032955", "text": "def new\n @lsa_sentence = LsaSentence.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lsa_sentence }\n end\n end", "title": "" }, { "docid": "ca42a2d3343decd05fc7d3cb45bdebb3", "score": "0.6032932", "text": "def new\n @word_property = WordProperty.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word_property }\n end\n end", "title": "" }, { "docid": "9da1b4c9c88b5fc81cfc2e8484599db1", "score": "0.6029669", "text": "def new\n @problem = Problem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @problem }\n end\n end", "title": "" }, { "docid": "9da1b4c9c88b5fc81cfc2e8484599db1", "score": "0.6029669", "text": "def new\n @problem = Problem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @problem }\n end\n end", "title": "" }, { "docid": "9da1b4c9c88b5fc81cfc2e8484599db1", "score": "0.6029669", "text": "def new\n @problem = Problem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @problem }\n end\n end", "title": "" }, { "docid": "9da1b4c9c88b5fc81cfc2e8484599db1", "score": "0.6029669", "text": "def new\n @problem = Problem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @problem }\n end\n end", "title": "" }, { "docid": "9da1b4c9c88b5fc81cfc2e8484599db1", "score": "0.6029669", "text": "def new\n @problem = Problem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @problem }\n end\n end", "title": "" }, { "docid": "63717f6a5c68f8200bb603abd67895ae", "score": "0.6025684", "text": "def new\n @taxonomy_term = TaxonomyTerm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @taxonomy_term }\n end\n end", "title": "" }, { "docid": "cb6be56a0077f7f95880fe609295ca74", "score": "0.60131264", "text": "def new\n @ais_term = AisTerm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @ais_term }\n end\n end", "title": "" }, { "docid": "1ba9dca240b7316ceebe1b7b02171f3d", "score": "0.600847", "text": "def new\n @problem = Problem.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @problem }\n end\n end", "title": "" }, { "docid": "228cc15659571d541b5bcde282d48451", "score": "0.59869224", "text": "def new\n @gloss = Gloss.new(params.slice(Gloss.new.attribute_names))\n @path = params[:path].try(:sub, /(gloss.*)\\[\\d*\\]/, '\\1['+Time.now.to_i.to_s+']')\n @dictionaries = Dictionary.where(id: params[:dictionaries]).all\n @langs = Dictionary.langs_hash_for(@dictionaries)\n \n respond_to do |format|\n format.html do\n \tif request.xhr?\n \t\trender :partial => \"form\"\n \tend\n end\n format.xml { render :xml => @gloss }\n end\n end", "title": "" }, { "docid": "004450e9e5cf0adae01f4c8e1ee99ceb", "score": "0.5985901", "text": "def new\n @grammar = Grammar.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @grammar }\n end\n end", "title": "" }, { "docid": "15c8f3becdc5760a716f14d5206faf01", "score": "0.5981728", "text": "def new\n @traction = Traction.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @traction }\n end\n end", "title": "" }, { "docid": "b63c1dd64bb697443461c822f2a41096", "score": "0.5970571", "text": "def create\n @spell_type = SpellType.new(spell_type_params)\n\n if @spell_type.save\n render json: @spell_type, status: :created, location: @spell_type\n else\n render json: @spell_type.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "1ab6a4deaa98d0865b15e3a001c82c86", "score": "0.5969674", "text": "def new\n @search_string = SearchString.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @search_string }\n end\n end", "title": "" }, { "docid": "9631a6e52416eea7cfc5f2c6d1dd9d27", "score": "0.59605354", "text": "def new\n @lda_topic_word = LdaTopicWord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lda_topic_word }\n end\n end", "title": "" }, { "docid": "2641c43266ca9efa283fff9a6a3b2acc", "score": "0.59574664", "text": "def new\n @crossword_solution = CrosswordSolution.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @crossword_solution }\n end\n end", "title": "" }, { "docid": "ab2c3a97cdb578fdad0e41c8042e4d1d", "score": "0.59560144", "text": "def new\n @conflict = Conflict.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @conflict }\n end\n end", "title": "" }, { "docid": "340726714a6ee856ef6b34722d094e31", "score": "0.5951096", "text": "def new\n @title = \"Добавление симптома\"\n @symptom = Symptom.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @symptom }\n end\n end", "title": "" }, { "docid": "38e5db3b7b81960d7260257ec9e8a768", "score": "0.59498495", "text": "def new\n @would = Would.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @would }\n end\n end", "title": "" }, { "docid": "e0ff8c4669e4ba1440370540dece950a", "score": "0.5941606", "text": "def new\n @preterm = Preterm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @preterm }\n end\n end", "title": "" }, { "docid": "6b138e3948293d3c565f4b175221ea53", "score": "0.59414643", "text": "def new\n @word = Word.new\n @wh = @word.word_histories.build\n @word.definitions.build\n @word.usages.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @word }\n end\n end", "title": "" }, { "docid": "3baea4cb592d01716cddebd2f8ef41bb", "score": "0.5941194", "text": "def new\n @unfix_issue = UnfixIssue.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @unfix_issue }\n end\n end", "title": "" }, { "docid": "2a4976481fc13323f968d2703105fb9f", "score": "0.5940438", "text": "def new\n @lenguage = Lenguage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @lenguage }\n end\n end", "title": "" }, { "docid": "04db5469938d90669917018f7f2774e0", "score": "0.5939748", "text": "def new\n @code_problem = CodeProblem.new\n\n @code_problem.statement = render_to_string 'code_problems/_format', :layout => false\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @code_problem }\n end\n end", "title": "" }, { "docid": "cf5372605e83a81bd3e7df2ccb2abf62", "score": "0.59350294", "text": "def create\n @glossary = Glossary.new(params[:glossary])\n\n respond_to do |format|\n if @glossary.save\n format.html { redirect_to @glossary, notice: 'Glossary was successfully created.' }\n format.json { render json: @glossary, status: :created, location: @glossary }\n else\n format.html { render action: \"new\" }\n format.json { render json: @glossary.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "082eec75647cd163a90459ca07d187c1", "score": "0.59235555", "text": "def new\n @norm = Norm.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @norm }\n end\n end", "title": "" }, { "docid": "5e01168c69c3ae20e584ce3ef26e4ed4", "score": "0.5922082", "text": "def new\n @code_problem = CodeProblem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @code_problem }\n end\n end", "title": "" } ]
b7cb6bddcebf60856c480314c5d90dc1
GET /clubs/1 GET /clubs/1.xml
[ { "docid": "a4758c9dd0675bc4c1bb6dc9d51ee647", "score": "0.63465446", "text": "def show\n @club = Club.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @club }\n format.iphone # index.html.erb\n end\n end", "title": "" } ]
[ { "docid": "462ec44b4c583d6b59a0a581bedbd5a9", "score": "0.7531889", "text": "def show\n @club = Club.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @club }\n end\n end", "title": "" }, { "docid": "462ec44b4c583d6b59a0a581bedbd5a9", "score": "0.7531889", "text": "def show\n @club = Club.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @club }\n end\n end", "title": "" }, { "docid": "fc9056be159a26bad154dfc39a07c6f3", "score": "0.75160563", "text": "def index\n @clubs = Club.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @clubs }\n end\n end", "title": "" }, { "docid": "f7e29d8447d9724897ca38d178026b6f", "score": "0.6982572", "text": "def show\n @club_membership = ClubMembership.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @club_membership }\n end\n end", "title": "" }, { "docid": "8a9e6749c0f5d09086bb9a21f4346941", "score": "0.69475526", "text": "def index\n @clubs = Club.find(:all, :order => \"name ASC\")\n @title = \"List of Clubs\"\n session[:club_id] = nil\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @clubs }\n end\n end", "title": "" }, { "docid": "827d423a4ad3a4ada96ec137c6479302", "score": "0.69412684", "text": "def index\n @memberships = Membership.find(:all)\n @club = Club.find(params[:club_id])\n session[:club_id] = params[:club_id].to_i\n @title = @club.initials + \": Members\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @memberships }\n end\n end", "title": "" }, { "docid": "e935a29e2ea2ba267575d7aa80d222d2", "score": "0.68212", "text": "def show\n respond_to do |format|\n format.html { redirect_to(club_memberships_path(@club)) }\n format.xml { render :xml => @membership }\n end\n end", "title": "" }, { "docid": "762b9da63a7dc10eac85c2c715931691", "score": "0.6747339", "text": "def show\n @club = Club.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @club }\n end\n end", "title": "" }, { "docid": "762b9da63a7dc10eac85c2c715931691", "score": "0.6747339", "text": "def show\n @club = Club.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @club }\n end\n end", "title": "" }, { "docid": "a25b50a7515e80ba6d0bd0e5059a5405", "score": "0.6713569", "text": "def show\n @club = Club.find(params[:id])\n respond_to do |format|\n format.html \n end\n end", "title": "" }, { "docid": "b0009e9668d2f82199e936883e27b786", "score": "0.66564", "text": "def index\r\n #@clubs = Club.all\r\n @clubs = Club.paginate(:page => params[:page])\r\n @title=\"All clubs\"\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.xml { render :xml => @clubs }\r\n end\r\n end", "title": "" }, { "docid": "0a6225f3583796dd1f07d589c05a4a67", "score": "0.66544956", "text": "def index\n @page_title = \"Club Directory\"\n @site_section = \"hub\"\n @page_left = \"club_tags_list\"\n \n #TODO: only send @clubs that are tagged with club\n @clubs = Club.find(:all, :conditions => [\"live=?\",true], :include => :tags, :order => \"name ASC\")\n @tags = Club.find_related_tags(\"club\") \n \n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @clubs }\n end\n end", "title": "" }, { "docid": "698ecc18c7b725b120e40b19e2c5b31a", "score": "0.6603987", "text": "def new\n @club = Club.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @club }\n end\n end", "title": "" }, { "docid": "698ecc18c7b725b120e40b19e2c5b31a", "score": "0.6603987", "text": "def new\n @club = Club.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @club }\n end\n end", "title": "" }, { "docid": "698ecc18c7b725b120e40b19e2c5b31a", "score": "0.6603987", "text": "def new\n @club = Club.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @club }\n end\n end", "title": "" }, { "docid": "698ecc18c7b725b120e40b19e2c5b31a", "score": "0.6603987", "text": "def new\n @club = Club.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @club }\n end\n end", "title": "" }, { "docid": "8593107bdab3077d5011643b77215510", "score": "0.65979046", "text": "def index\n @clubs = Club.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @clubs }\n end\n end", "title": "" }, { "docid": "f6b9b070dbddf169ff89578a272bd126", "score": "0.6586964", "text": "def index\n @albums = @club.albums\n\n @page_title = \"Album Listing\"\n @site_section = \"clubs\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @albums }\n end\n end", "title": "" }, { "docid": "1f39dde0bd16f73bc554e08f8f478e8b", "score": "0.65773356", "text": "def index\n @clubs = Club.all\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @clubs }\n end\n end", "title": "" }, { "docid": "bf601a388c3cb36a31a2127c968232b3", "score": "0.6504155", "text": "def index\n @clubs = Club.all\n end", "title": "" }, { "docid": "bf601a388c3cb36a31a2127c968232b3", "score": "0.6504155", "text": "def index\n @clubs = Club.all\n end", "title": "" }, { "docid": "bf601a388c3cb36a31a2127c968232b3", "score": "0.6504155", "text": "def index\n @clubs = Club.all\n end", "title": "" }, { "docid": "bf601a388c3cb36a31a2127c968232b3", "score": "0.6504155", "text": "def index\n @clubs = Club.all\n end", "title": "" }, { "docid": "bf601a388c3cb36a31a2127c968232b3", "score": "0.6504155", "text": "def index\n @clubs = Club.all\n end", "title": "" }, { "docid": "bf601a388c3cb36a31a2127c968232b3", "score": "0.6504155", "text": "def index\n @clubs = Club.all\n end", "title": "" }, { "docid": "bf601a388c3cb36a31a2127c968232b3", "score": "0.6504155", "text": "def index\n @clubs = Club.all\n end", "title": "" }, { "docid": "bf601a388c3cb36a31a2127c968232b3", "score": "0.6504155", "text": "def index\n @clubs = Club.all\n end", "title": "" }, { "docid": "bf601a388c3cb36a31a2127c968232b3", "score": "0.6504155", "text": "def index\n @clubs = Club.all\n end", "title": "" }, { "docid": "399f5ca7019ebcc3a8baf90969f54b6e", "score": "0.6402983", "text": "def index\n @staticpages = Staticpage.find(:all, :conditions => ['club_id=?', params[:club_id]])\n @club = Club.find(params[:club_id])\n @title = \"Admin: Static Pages for #{@club.initials}\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @staticpages }\n end\n end", "title": "" }, { "docid": "8c2542bae8b05117068eaf012ec13c19", "score": "0.63902885", "text": "def show\n @sport_club = SportClub.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @sport_club }\n end\n end", "title": "" }, { "docid": "c07bf8c23105a0775256a14112aae70a", "score": "0.63599455", "text": "def getClub(tag)\n tag = validateTag(tag)\n get(\"/club?tag=#{tag}\")\n end", "title": "" }, { "docid": "98d190f5d69f04fc129012f6cb5d2069", "score": "0.6315641", "text": "def index\n @download_folders = @club.download_folders\n \n @page_title = \"Download Folder Listing\"\n @site_section = \"clubs\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @download_folders }\n end\n end", "title": "" }, { "docid": "ba2933b8e3f76a8f278bd8f6e91962e3", "score": "0.6285946", "text": "def show\n respond_with Club.find(params[:id])\n end", "title": "" }, { "docid": "c7938295f95ef18adff189decc61f80c", "score": "0.6285544", "text": "def show\n @sub_club = SubClub.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @sub_club }\n end\n end", "title": "" }, { "docid": "37ea6d1c902f3abbf845053657cc63b6", "score": "0.62425894", "text": "def show\n @download_folder = @club.download_folders.find(params[:id])\n @page_title = \"Showing \" + @download_folder.name\n @site_section = \"clubs\"\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @download_folder }\n end\n end", "title": "" }, { "docid": "bd0759246bd3134e1f349d99eb2a13ea", "score": "0.62424666", "text": "def show\n @clubber = Clubber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clubber }\n end\n end", "title": "" }, { "docid": "11c720e01ee539de6f31063da6890e2c", "score": "0.6237249", "text": "def index\n club_id = session[:club_id]\n @club = Club.find_by_id(session[:club_id])\n \n @title = @club.name + \": Crews\"\n @teams = Team.find(:all, :conditions => [\"club_id=? and season_id=?\", club_id, params[:season_id]], :order => \"season_id DESC, roworder DESC\")\n @seasons = Season.find(params[:season_id]) \n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @teams }\n end\n end", "title": "" }, { "docid": "d11dbfff732c2533cc649535d70b1eef", "score": "0.62330234", "text": "def show\n @book_club = BookClub.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @book_club }\n end\n end", "title": "" }, { "docid": "15eeb8d1d4c584c42b7721ce8ead6d0d", "score": "0.6197992", "text": "def show\n @club = Club.find(params[:id])\n @moderator = false\n @token = generate_token OpenTok::RoleConstants::PUBLISHER\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @club }\n end\n end", "title": "" }, { "docid": "828e361e9fb7228d1df230b292f70d06", "score": "0.6158335", "text": "def showlist\n @clubs = Club.all\n end", "title": "" }, { "docid": "8782fa22d9b12d2a589e2762cc6b9c32", "score": "0.61494714", "text": "def show\n @teams = @season.teams\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @season }\n end\n end", "title": "" }, { "docid": "915a4ac032e5c4f43241ba87fcf97390", "score": "0.6143809", "text": "def create\n @club = Club.new(params[:club])\n\n respond_to do |format|\n if @club.save\n flash[:notice] = 'Club was successfully created.'\n format.html { redirect_to(@club) }\n format.xml { render :xml => @club, :status => :created, :location => @club }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @club.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1872df4426e36de14812fab868bf4487", "score": "0.6137082", "text": "def show\n @album = @club.albums.find(params[:id], :include => :tags)\n\n @page_title = \"Showing \" + @album.name + \" Album\"\n @site_section = \"clubs\"\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @album }\n end\n end", "title": "" }, { "docid": "75cbcf56e70b6f05f18bf63abd4293fd", "score": "0.612528", "text": "def index\n self.class.get(\"/cards/index.xml\");\n end", "title": "" }, { "docid": "f644110f6d6e9cc2bce84766025fc58e", "score": "0.6122337", "text": "def show\n render :json => current_user.clubs.find(params[:id])\n end", "title": "" }, { "docid": "ba78e39b83ba91628f3d182136f12764", "score": "0.6095458", "text": "def show\n @tournament = Tournament.find(params[:id])\n\n respond_to do |format|\n format.html # show.rb\n format.xml { render :xml => @tournament }\n end\n end", "title": "" }, { "docid": "63c9ee4b13dc8db7c2c802102804f0f1", "score": "0.60905516", "text": "def index\n if params[:user_id]\n @user = User.find(params[:user_id])\n render json: @user.clubs\n else\n\n @clubs = Club.all\n render json: @clubs\n end\n end", "title": "" }, { "docid": "8284e8d691b98b25120d5f4b5ea27c89", "score": "0.6067571", "text": "def index\n @campuses = Campus.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @campuses }\n end\n end", "title": "" }, { "docid": "e7ecdd3e7d0c7ba79cfa17cc85d56e7f", "score": "0.6065636", "text": "def new\n @club_membership = ClubMembership.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @club_membership }\n end\n end", "title": "" }, { "docid": "aa0c5d210425e8b5443a2a88491abbd3", "score": "0.60653263", "text": "def index\n @clubs_members = ClubsMember.all\n end", "title": "" }, { "docid": "1320a17b63ca5775181c0cc579283d7a", "score": "0.6058557", "text": "def show\n @sport = Sport.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sport }\n end\n end", "title": "" }, { "docid": "d87dc8ee293c8884105440bb65d7682d", "score": "0.6056951", "text": "def show\n @tournament = Tournament.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @tournament }\n end\n end", "title": "" }, { "docid": "350548ab21c92aaf33dda2475a2325db", "score": "0.6054369", "text": "def index\n #@clubs = Club.find(:all)\n \n @clubs = Club.paginate(:order => 'clubname ASC', \n :per_page => 10,\n :page => params[:page])\n \n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @clubs }\n format.iphone # index.html.erb\n end\n end", "title": "" }, { "docid": "d7070711c1f76aec7fe7282233a9c00b", "score": "0.60488605", "text": "def new\n\n @season = Season.new\n @club = Club.find_by_id(session[:club_id])\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @season }\n end\n end", "title": "" }, { "docid": "41dceacf63b2727bc2ec06f5da5d9299", "score": "0.6047019", "text": "def index\n if current_user then\n memberships = current_user.memberships\n all_clubs = memberships.collect {|mbrs| mbrs.club}\n @clubs = all_clubs.uniq.sort {|a,b| a.name <=> b.name}\n# @clubs = Member.find(session[:member_id]).clubs.sort(:name).all\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @clubs }\n end\n end\n\n end", "title": "" }, { "docid": "24f8371dc16ecd99fd5fdbecb1089083", "score": "0.60468", "text": "def new\n @new_club = Club.new\n \n @page_title = \"New Club\"\n @site_section = \"admin\"\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @new_club }\n end\n end", "title": "" }, { "docid": "fa2bea9a754ce13b0b3f63db42619a97", "score": "0.6038488", "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": "0e3cd25a7b6e2b5c63b8616100689980", "score": "0.6032576", "text": "def index\n @beer_clubs = BeerClub.all\n end", "title": "" }, { "docid": "0e3cd25a7b6e2b5c63b8616100689980", "score": "0.6032576", "text": "def index\n @beer_clubs = BeerClub.all\n end", "title": "" }, { "docid": "0e3cd25a7b6e2b5c63b8616100689980", "score": "0.6032576", "text": "def index\n @beer_clubs = BeerClub.all\n end", "title": "" }, { "docid": "0e3cd25a7b6e2b5c63b8616100689980", "score": "0.6032576", "text": "def index\n @beer_clubs = BeerClub.all\n end", "title": "" }, { "docid": "0e3cd25a7b6e2b5c63b8616100689980", "score": "0.6032576", "text": "def index\n @beer_clubs = BeerClub.all\n end", "title": "" }, { "docid": "0e3cd25a7b6e2b5c63b8616100689980", "score": "0.6032576", "text": "def index\n @beer_clubs = BeerClub.all\n end", "title": "" }, { "docid": "a212cf6d0088bd09784c0e50d6daa679", "score": "0.6022593", "text": "def show\n @club = @crew.club\n end", "title": "" }, { "docid": "8a6e0c90519b71826277c9a38929bcc3", "score": "0.6014875", "text": "def show\n\t\t@club = @team.club\n\tend", "title": "" }, { "docid": "307e0a7fea5436b5326777dfa9f5d83a", "score": "0.6005241", "text": "def show\n @clubsession = Clubsession.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clubsession }\n end\n end", "title": "" }, { "docid": "e6d29ea3b511596483de1f3fac0b7b67", "score": "0.5998619", "text": "def show\n @climb = Climb.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @climb }\n end\n end", "title": "" }, { "docid": "d078ae44bb52324e4e747688e1541667", "score": "0.59838295", "text": "def index\n @club_members = ClubMember.all\n end", "title": "" }, { "docid": "ede37002ef2f45dd69e7f92d103432fc", "score": "0.59829074", "text": "def index\n @teams = @club.teams.all\n end", "title": "" }, { "docid": "0fe789e24d0b4ca7b117159932e87ac0", "score": "0.5967036", "text": "def index\n @groups = @club.groups\n @grouplist = @club.groups.find(:all, :conditions => [\"bns_parent_id IS NOT ?\", nil], :order => 'lft')\n \n @page_title = \"Group Listing\"\n @site_section = \"clubs\"\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @groups }\n end\n end", "title": "" }, { "docid": "8c8f5c613d53c99064e1cc1faf8630bf", "score": "0.5956467", "text": "def show\n @club = Club.find(params[:id])\n @meetings = @club.meetings.sort(:meeting_date.asc)\n @active_members = @club.active_members\n @header_text = @club.name\n \n session[:club_id] = @club.id\n \n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @club }\n end\n end", "title": "" }, { "docid": "1e768613b17358c334a5b9b76a4a1d86", "score": "0.5952432", "text": "def show\n @equipo_y_cuerpo_tecnico = EquipoYCuerpoTecnico.find(params[:id])\n @clubes = Club.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @equipo_y_cuerpo_tecnico }\n end\n end", "title": "" }, { "docid": "1f9cde473d386afcd895cc49c801032a", "score": "0.59494144", "text": "def show\n @church = Church.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @church }\n end\n end", "title": "" }, { "docid": "c6273c26ef46b2ce9312ea7b19ca671a", "score": "0.59441394", "text": "def show\n @clue = @team.clues.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @clue }\n format.json { render :text => @clue.to_json }\n end\n end", "title": "" }, { "docid": "b076b96f82c383e05b483090a1d98f30", "score": "0.59371215", "text": "def show\n @championship = Championship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @championship }\n end\n end", "title": "" }, { "docid": "0fc898cc85ae7e15bf42440e65a58606", "score": "0.5931255", "text": "def show\n @campu = Campus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @campu }\n end\n end", "title": "" }, { "docid": "51d335adb16ab24bf10d060748268529", "score": "0.59292537", "text": "def index\n respond_with Club.search(club_search_params)\n end", "title": "" }, { "docid": "28976e33e457fc3532a21e3dcd3c4fa7", "score": "0.59276", "text": "def clubSearch(name)\n get(\"/club/search?name=#{name.gsub(' ', '%20')}\")\n end", "title": "" }, { "docid": "f8984d6c95ab3dd73d0c7fc9d74467f7", "score": "0.5922611", "text": "def show\n @club = Club.find_by_web_name(params[:id], :include => :tags)\n \n @page_title = \"\"\n @site_section = \"clubs\"\n \n @setting = @club.settings.find(:first, :conditions => [\"option_name = ? AND name = ?\", 'HomePage', 'pages']) \n @page = @club.pages.find(:first, :conditions => [\"id = ?\", @setting.value]) unless @setting.blank?\n if @setting.blank? || @page.blank?\n respond_to do |format|\n format.html {\n @feed = feed_output([@club.small_posts, @club.large_posts, @club.events], feed_list_length, :all, :order => \"created_at DESC\", :limit => feed_list_length)\n @feed_earliest_time = feed_earliest_time(@feed)\n render :action => 'news'\n }\n format.xml {\n @feed = feed_output([@club.small_posts, @club.large_posts, @club.events], feed_rss_length, :all, {:order => \"created_at DESC\", :limit => feed_rss_length})\n if @feed[0] == nil\n render :xml => @club\n end \n } \n end\n else\n respond_to do |format|\n format.html\n end\n end\n\n end", "title": "" }, { "docid": "3d8ea430782c79989129feec59de2e30", "score": "0.59172523", "text": "def index\n @kas_clubs = KasClub.all\n end", "title": "" }, { "docid": "f2f8039ffbdcedbc60bb69ee66fc281b", "score": "0.58925503", "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": "73cf1cac80e69d86badd9e2e556d04af", "score": "0.5887535", "text": "def set_club\n @club = Club.find(params[:id])\n end", "title": "" }, { "docid": "73cf1cac80e69d86badd9e2e556d04af", "score": "0.5887535", "text": "def set_club\n @club = Club.find(params[:id])\n end", "title": "" }, { "docid": "73cf1cac80e69d86badd9e2e556d04af", "score": "0.5887535", "text": "def set_club\n @club = Club.find(params[:id])\n end", "title": "" }, { "docid": "5509595d2f30c3a0e6060baaed56446f", "score": "0.58826894", "text": "def index\n @comedy_clubs = ComedyClub.all\n end", "title": "" }, { "docid": "7b23e104aac452301c7c0e69b280ba13", "score": "0.5875495", "text": "def index\n @health_clubs = HealthClub.all\n end", "title": "" }, { "docid": "dbdd679ef766ff50fc0a3a52be06db56", "score": "0.58697456", "text": "def index\n @clues = @team.clues\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @clues }\n format.json { render :text => @clues.to_json }\n end\n end", "title": "" }, { "docid": "8646125aef083cf682baa315d179b2af", "score": "0.58623266", "text": "def destroy\n @club = Club.find(params[:id])\n @club.destroy\n \n respond_to do |format|\n format.html { redirect_to(clubs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a8f794b52183124f2e9a7e0c0e70f8a0", "score": "0.5861607", "text": "def destroy\n @club = Club.find(params[:id])\n @club.destroy\n\n respond_to do |format|\n format.html { redirect_to(clubs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a8f794b52183124f2e9a7e0c0e70f8a0", "score": "0.5861607", "text": "def destroy\n @club = Club.find(params[:id])\n @club.destroy\n\n respond_to do |format|\n format.html { redirect_to(clubs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a8f794b52183124f2e9a7e0c0e70f8a0", "score": "0.5861607", "text": "def destroy\n @club = Club.find(params[:id])\n @club.destroy\n\n respond_to do |format|\n format.html { redirect_to(clubs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "a8f794b52183124f2e9a7e0c0e70f8a0", "score": "0.5861607", "text": "def destroy\n @club = Club.find(params[:id])\n @club.destroy\n\n respond_to do |format|\n format.html { redirect_to(clubs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "0cb8b6c38cf930844b52daa3c40ca49e", "score": "0.5861488", "text": "def show\n @group = @club.groups.find(params[:id])\n @page = @club.pages.find(:first, :conditions=> [\"title=?\",@group.name])\n \n @page_title = \"Showing \" + @group.name\n @site_section = \"clubs\"\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @group }\n end\n end", "title": "" }, { "docid": "efd30cc3a439cd9618b70eaee8d95bcc", "score": "0.5844406", "text": "def show\n @league_membership = LeagueMembership.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @league_membership }\n end\n end", "title": "" }, { "docid": "6b4351f73507e651ef0e76a6b0d1d75d", "score": "0.584375", "text": "def show\n @club = Club.find(params[:id]) \n @public_offers = @club.public_offers\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @club }\n end\n end", "title": "" }, { "docid": "e4c48078a89c162a4f6a91c980be5345", "score": "0.5842001", "text": "def show\n @club_affiliation = ClubAffiliation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @club_affiliation }\n end\n end", "title": "" }, { "docid": "27519824b67207bccfba0de28d5b2919", "score": "0.58384407", "text": "def url; \"http://localhost:3000/sdn.xml\"; end", "title": "" }, { "docid": "6d345c3b08d30038cb9b619f5c6a2684", "score": "0.5833961", "text": "def show\n @clilab = Clilab.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @clilab }\n end\n end", "title": "" }, { "docid": "8352276b4cf1286c25dd8265495b0b53", "score": "0.5824679", "text": "def show\n @event = @club.events.find(params[:id])\n\n @page_title = \"Showing \" + @event.name\n @site_section = \"clubs\"\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @event }\n end\n end", "title": "" }, { "docid": "f61323040a49e41c3b1d16ad3d7b545b", "score": "0.58188283", "text": "def set_xclub\n @xclub = Xclub.find(params[:id])\n end", "title": "" } ]
8dd6643b2edc8d519698dbd0a5c01276
constants and config? any admin functions? Add download functions.
[ { "docid": "d656ba61d068a64bdc4ed49a4f3424bf", "score": "0.0", "text": "def upload\n # post = save_file(params[:upload], params[:uuid].to_s())\n upload = params[:upload]\n @mdo = Msg_dohicky.new(get_remote_addr, Home)\n \n if (upload.to_s.empty?)\n @mdo.set_message(\"No file name so nothing was uploaded.\", true)\n redirect_to :action => 'index'\n return\n end\n\n name = upload.original_filename\n base_name = File.basename(name)\n\n # Cleanse bad chars from file names.\n base_name.gsub!(/[^A-Za-z0-9\\-_\\.]/, '_')\n save_dir = Orig\n dir_label = \"origin directory\"\n\n if (! File.exists?(save_dir))\n @mdo.set_message(\"Directory #{save_dir} does not exist. File not saved.\", true)\n redirect_to :action => 'index'\n return \n end\n\n # Create the full file path\n # path = File.join(directory, name)\n # write the file\n File.open(\"#{save_dir}/#{base_name}\", \"wb\") { |myupload|\n myupload.write(upload.read)\n }\n @mdo.set_message(\"File #{base_name} has been uploaded to #{dir_label}.\", true)\n\n redirect_to :action => 'index'\n end", "title": "" } ]
[ { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "2a8a06514acfc42e4e9bd17aa7026d42", "score": "0.6379226", "text": "def config; end", "title": "" }, { "docid": "37760c3b969c84aec77912c99e5eb92c", "score": "0.6318871", "text": "def conf; end", "title": "" }, { "docid": "30ed07240e27b7bd763c27d6671ebce9", "score": "0.62768495", "text": "def site_admin\n end", "title": "" }, { "docid": "8d3e2f6695659386a9f5d95e1daf8385", "score": "0.6255022", "text": "def utilities\n end", "title": "" }, { "docid": "8d3e2f6695659386a9f5d95e1daf8385", "score": "0.6255022", "text": "def utilities\n end", "title": "" }, { "docid": "8d3e2f6695659386a9f5d95e1daf8385", "score": "0.6255022", "text": "def utilities\n end", "title": "" }, { "docid": "8d3e2f6695659386a9f5d95e1daf8385", "score": "0.6255022", "text": "def utilities\n end", "title": "" }, { "docid": "601f75cba7fbba0a2d2e21a86c1131d0", "score": "0.61021674", "text": "def settings; end", "title": "" }, { "docid": "601f75cba7fbba0a2d2e21a86c1131d0", "score": "0.61021674", "text": "def settings; end", "title": "" }, { "docid": "601f75cba7fbba0a2d2e21a86c1131d0", "score": "0.61021674", "text": "def settings; end", "title": "" }, { "docid": "601f75cba7fbba0a2d2e21a86c1131d0", "score": "0.61021674", "text": "def settings; end", "title": "" }, { "docid": "601f75cba7fbba0a2d2e21a86c1131d0", "score": "0.61021674", "text": "def settings; end", "title": "" }, { "docid": "601f75cba7fbba0a2d2e21a86c1131d0", "score": "0.61021674", "text": "def settings; end", "title": "" }, { "docid": "601f75cba7fbba0a2d2e21a86c1131d0", "score": "0.61021674", "text": "def settings; end", "title": "" }, { "docid": "601f75cba7fbba0a2d2e21a86c1131d0", "score": "0.61021674", "text": "def settings; end", "title": "" }, { "docid": "601f75cba7fbba0a2d2e21a86c1131d0", "score": "0.61021674", "text": "def settings; end", "title": "" }, { "docid": "601f75cba7fbba0a2d2e21a86c1131d0", "score": "0.61021674", "text": "def settings; end", "title": "" }, { "docid": "601f75cba7fbba0a2d2e21a86c1131d0", "score": "0.61021674", "text": "def settings; end", "title": "" }, { "docid": "c66bae5aa37aac1df5f61e262d46ce97", "score": "0.59782207", "text": "def configuration; end", "title": "" }, { "docid": "c66bae5aa37aac1df5f61e262d46ce97", "score": "0.59782207", "text": "def configuration; end", "title": "" }, { "docid": "c66bae5aa37aac1df5f61e262d46ce97", "score": "0.59782207", "text": "def configuration; end", "title": "" }, { "docid": "c66bae5aa37aac1df5f61e262d46ce97", "score": "0.59782207", "text": "def configuration; end", "title": "" }, { "docid": "c66bae5aa37aac1df5f61e262d46ce97", "score": "0.59782207", "text": "def configuration; end", "title": "" }, { "docid": "c66bae5aa37aac1df5f61e262d46ce97", "score": "0.59782207", "text": "def configuration; end", "title": "" }, { "docid": "c66bae5aa37aac1df5f61e262d46ce97", "score": "0.59782207", "text": "def configuration; end", "title": "" }, { "docid": "c66bae5aa37aac1df5f61e262d46ce97", "score": "0.59782207", "text": "def configuration; end", "title": "" }, { "docid": "c66bae5aa37aac1df5f61e262d46ce97", "score": "0.59782207", "text": "def configuration; end", "title": "" }, { "docid": "c66bae5aa37aac1df5f61e262d46ce97", "score": "0.59782207", "text": "def configuration; end", "title": "" }, { "docid": "c66bae5aa37aac1df5f61e262d46ce97", "score": "0.59782207", "text": "def configuration; end", "title": "" }, { "docid": "c66bae5aa37aac1df5f61e262d46ce97", "score": "0.59782207", "text": "def configuration; end", "title": "" }, { "docid": "c66bae5aa37aac1df5f61e262d46ce97", "score": "0.59782207", "text": "def configuration; end", "title": "" }, { "docid": "f3d02fe7051b45ee2f0cbc63de778efb", "score": "0.5934953", "text": "def cfg; end", "title": "" }, { "docid": "f3d02fe7051b45ee2f0cbc63de778efb", "score": "0.5934953", "text": "def cfg; end", "title": "" }, { "docid": "8610fbfd62af735738ae177d36e8f4fe", "score": "0.5921962", "text": "def local_settings; end", "title": "" }, { "docid": "f82c115be55cd2a530533b206c75ecda", "score": "0.5920424", "text": "def default_data\n @title = Admin::SiteConfig.first.title\n @meta_description = Admin::SiteConfig.first.description\n @admin_brands = Admin::Brand.all.where(:is_public => true)\n @admin_site_config = Admin::SiteConfig.first\n\n @host_name = \"http://www.opulunion.com\"\n\n @main_visials_verification = Admin::SiteConfig.first.get_pc_images.limit(1)\n @phone_main_visials_verification = Admin::SiteConfig.first.get_phone_images.limit(1)\n\n @og_image = Admin::SiteConfig.first.get_pc_images.first.file.large.url if Admin::SiteConfig.first.get_pc_images.present?\n\n get_controller()\n get_action()\n end", "title": "" }, { "docid": "e144c55fb8680de35acf575932b5572e", "score": "0.5863901", "text": "def configurations; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.583368", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.583368", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.583368", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.583368", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.583368", "text": "def helpers; end", "title": "" }, { "docid": "24b81a43da354a4659b9f55714ae634b", "score": "0.5794893", "text": "def get_settings; end", "title": "" }, { "docid": "48077f0488fe12130a3bd823bb7d2759", "score": "0.5784938", "text": "def settings\n\n end", "title": "" }, { "docid": "018c5c2cd45cc6f4fe5080993d58346e", "score": "0.5757463", "text": "def included_constants; end", "title": "" }, { "docid": "fb02522d93b9bb37cab32563f12d86c9", "score": "0.57277834", "text": "def administration\n \n end", "title": "" }, { "docid": "200c2c37826736d13906b1a1b406cd9f", "score": "0.5726653", "text": "def define_url_helpers\n self.instance_eval{\n define_index_url;\n define_new_url;\n define_show_url;\n define_edit_url\n }\n end", "title": "" }, { "docid": "7689b6b2ed36529e631c670063e9e66e", "score": "0.5720245", "text": "def setup_url; end", "title": "" }, { "docid": "a397e7d70fb46699b1298d584daf15a8", "score": "0.571765", "text": "def config_hook\n end", "title": "" }, { "docid": "28c951299ba6dcd137fa55e7c62d7c58", "score": "0.5708794", "text": "def public_file_server; end", "title": "" }, { "docid": "abf47155aecd3f42d99cad1887f49f7b", "score": "0.56876385", "text": "def computed_config; end", "title": "" }, { "docid": "2d87c01768b7fd2b0480f3665bbb136a", "score": "0.5665321", "text": "def index\n @admin_configurations = AdminConfiguration.not_in(config_type: AdminConfiguration::FIRECLOUD_ACCESS_NAME)\n @current_firecloud_status = AdminConfiguration.current_firecloud_access\n\n case @current_firecloud_status\n when 'on'\n @download_status = true\n @download_status_label = \"<span class='label label-success'><i class='fas fa-check'></i> Enabled</span>\".html_safe\n when 'readonly'\n @download_status = true\n @download_status_label = \"<span class='label label-warning'><i class='fas fa-exclamation-circle'></i> Read Only</span>\".html_safe\n when 'off'\n @download_status = false\n @download_status_label = \"<span class='label label-danger'><i class='fas fa-times'></i> Disabled</span>\".html_safe\n when 'local-off'\n @download_status = false\n @download_status_label = \"<span class='label label-danger'><i class='fas fa-times'></i> Disabled Locally</span>\".html_safe\n end\n @users = User.all.to_a\n\n # load actions for UI\n @administrative_tasks = []\n @task_descriptions = {}\n @task_http_methods = {}\n available_admin_actions.each do |action|\n @administrative_tasks << [action[:name], action[:url]]\n @task_descriptions[action[:name]] = action[:description]\n @task_http_methods[action[:name]] = action[:method]\n end\n end", "title": "" }, { "docid": "4be42c929cc54397332aa8dee5bb7546", "score": "0.5663188", "text": "def config info\n end", "title": "" }, { "docid": "49b0e6ee1d434f7fdec5afd912a33549", "score": "0.5647432", "text": "def get_config\n\t\tend", "title": "" }, { "docid": "f270b69c9c365bf49fe07050e1390d8e", "score": "0.56191367", "text": "def admin_init_actions\n I18n.locale = current_site.get_admin_language\n @_admin_menus = {}\n @_admin_breadcrumb = []\n @_extra_models_for_fields = []\n self.append_view_path(Rails.root.join(\"app\", \"apps\"))\n end", "title": "" }, { "docid": "385f4a40646868a2a5dc9d650b5dd2ed", "score": "0.5607228", "text": "def actions() ; ext_info[:actions] ; end", "title": "" }, { "docid": "385f4a40646868a2a5dc9d650b5dd2ed", "score": "0.5607228", "text": "def actions() ; ext_info[:actions] ; end", "title": "" }, { "docid": "57f1076df378e41ce9f749579f2c3f39", "score": "0.55915874", "text": "def add_dsl_constants!\n create_modules(\n self,\n [ # Databases\n ['MySQL', 'PostgreSQL', 'MongoDB', 'Redis', 'Riak'],\n # Storages\n ['S3', 'CloudFiles', 'Ninefold', 'Dropbox', 'FTP',\n 'SFTP', 'SCP', 'RSync', 'Local'],\n # Compressors\n ['Gzip', 'Bzip2', 'Custom', 'Pbzip2', 'Lzma'],\n # Encryptors\n ['OpenSSL', 'GPG'],\n # Syncers\n [\n { 'Cloud' => ['CloudFiles', 'S3'] },\n { 'RSync' => ['Push', 'Pull', 'Local'] }\n ],\n # Notifiers\n ['Mail', 'Twitter', 'Campfire', 'Prowl', 'Hipchat', 'Pushover']\n ]\n )\n end", "title": "" } ]
2d071be0b873c11535d354a210667dc2
This unit test check for the valid next move city got by the move_turns_dynamic_palisades.
[ { "docid": "5d43d0fb55aad4fa93257fe1a59281fa", "score": "0.62446755", "text": "def test_move_turns_dynamic_palisades\n ruby_rush=RubyRush.new(1, 2, 3)\n ruby_rush.turn=10\n ruby_rush.random(ruby_rush.seed)\n ruby_rush.move_turns_dynamic_palisades\n assert_includes ['Matzburg', 'Hash Crossing'], ruby_rush.city\n end", "title": "" } ]
[ { "docid": "65b56371d0cf72ea95a9f0a30a0bea3f", "score": "0.6684479", "text": "def test_next_valid\n\t prng = Minitest::Mock.new\n\t def prng.rand(num); 1; end\n\t\tcity = City.new(\"Fake City\", 7, 0, prng)\n\t\tcity1 = City.new(\"Fake City 1\", 7, 0, prng)\n\t\tcity2 = City.new(\"Fake City 2\", 7, 0, prng)\n\t\tcity.link_neighbors [city1, city2]\n\t\tcity = city.next\n\t\tassert_includes [city1, city2], city\n\tend", "title": "" }, { "docid": "680188453765fd2c2b00292b5a4e72d3", "score": "0.6481473", "text": "def check_next_city\n @next_city = true if @rubies_found.zero? && @fake_rubies_found.zero?\n end", "title": "" }, { "docid": "aac34310cae3eb3d22be4e1b26909bff", "score": "0.6357586", "text": "def check_valid_move to_move\r\n\t\t\r\n\t\tif to_move == 0\r\n\t\t\tif driver.location.west_road == nil\r\n\t\t\t\treturn false\r\n\t\t\telse\r\n\t\t\t\treturn true\r\n\t\t\tend\r\n\t\t\r\n\t\telsif to_move == 1\r\n\t\t\tif driver.location.north_road == nil\r\n\t\t\t\treturn false\r\n\t\t\telse\r\n\t\t\t\treturn true\r\n\t\t\tend\r\n\t\t\r\n\t\telsif to_move == 2\r\n\t\t\tif driver.location.east_road == nil\r\n\t\t\t\treturn false\r\n\t\t\telse\r\n\t\t\t\treturn true\r\n\t\t\tend\r\n\t\t\r\n\t\telsif to_move == 3\r\n\t\t\tif driver.location.south_road == nil\r\n\t\t\t\treturn false\r\n\t\t\telse\r\n\t\t\t\treturn true\r\n\t\t\tend\r\n\t\telse\r\n\t\t\traise \"The location does not exist. Error\"\r\n\t\t\r\n\t\tend\r\n\t\treturn false\r\n\tend", "title": "" }, { "docid": "1c13788ea3a593eae622e1d4649d922f", "score": "0.59769547", "text": "def make_move(valid)\n @move = \"\"\n until (valid.rules).has_key?(@move) \n puts \"#{@name}, pick your move: #{valid.rules.keys}\"\n @move = gets.chomp\n puts \"not a valid move\" if (valid.rules).include?(@move) == false\n end\n end", "title": "" }, { "docid": "e4eb26ec2906dca73e51bc277f78af26", "score": "0.5957188", "text": "def test_validate_cities\n skip('this is a helper method for validating location names')\n # ignored cities are ones for which I don't know the location code\n # that the API accepts\n ignored_cities = %w(chongqing koln cologne dusseldorf eugene honolulu\n milan southbay)\n cities = %w(amsterdam austin berlin calgary columbus denver firenze\n frankfurt hamburg miami montreal muenchen\n newyorkcity portland rheinland roma sandiego seattle stockholm\n stuttgart torino toronto twincities vancouver washingtondc\n wien)\n\n cities.each do |city|\n @caruby2go = Caruby2go.new(ENV['CONSUMER_KEY'], city)\n puts \"#{city}\"\n payload = @caruby2go.gasstations\n puts \"#{city}:\\n#{payload}\"\n end\n puts \"Done with valid cities (#{cities.size})\"\n puts 'Did not look for the following cities as they have previously failed validation:'\n ignored_cities.each do |city|\n puts city\n end\n end", "title": "" }, { "docid": "5a643944a000d28cc785217c28f2212e", "score": "0.59294844", "text": "def valid_move?(move)\n # Array of all posiible moves , check the board and map out the possible moves from there.\n end", "title": "" }, { "docid": "2aaed3eb9948edbd1fbf553accb33aea", "score": "0.5906788", "text": "def movement_validation(player_mov)\n\t\tcorrect_mov = []\n\t\tpiece_movs = {\n\t\t\t\"king\" => [[0,1], [1,1], [1,0], [1,-1], [0,-1], [-1,-1], [-1,0], [-1,1]],\n\t\t\t\"knight\" => [[-2,1], [-2,-1], [-1,-2], [1,-2], [2,-1], [2,1], [1,2], [-1,2]],\n\t\t\t\"rook\" => [[0,1], [1,0], [0,-1], [-1,0]],\n\t\t\t\"bishop\" => [[1,1], [1,-1], [-1,-1], [-1,1]],\n\t\t\t\"queen\" => [[0,1], [1,1], [1,0], [1,-1], [0,-1], [-1,-1], [-1,0], [-1,1]],\n\t\t\t\"pawn\" =>\t[[0,1], [0,-1], [1,1], [-1,1], [1,-1], [-1,-1], [0,2], [0,-2]]\n\t\t}\n\t\t\n\t\t#if the final move equals to one of the moves of the king or knight pieces.\n\t\tif [\"king\", \"knight\"].include?(@piece_name)\n\t\t\t#iterates through each basic move of the corresponding piece.\n\t\t\tpiece_movs[@piece_name].each do |mov|\n\t\t\t\t#if the final node color is nil or different from the start node color.\n\t\t\t\tif mov == player_mov && (@final_node.color != @current_player.color || @final_node.color == nil)\n\t\t\t\t\treturn true\n\t\t\t\t#if check analysis is in progress, the final node color equals to the current player color and the final node name is king.\n\t\t\t\telsif (mov == player_mov && @check_on_curse == true) && (@final_node.color == @current_player.color && @final_node.name == \"king\") \n\t\t\t\t\treturn true\t\t\t\t\n\t\t\t\tend\n\t\t\tend\n\t\t#if the final move equals to one of the moves of the rook, bishop or queen pieces.\n\t\telsif [\"rook\", \"bishop\", \"queen\"].include?(@piece_name)\n\t\t\t#iterates through each basic move of the corresponding piece.\n\t\t\tpiece_movs[@piece_name].each do |mov|\n\t\t\t\t#iterates through number 1 to 7 multiplying the basics pieces moves and saving it.\n\t\t\t\t(1..7).each do |num|\n\t\t\t\t\titeration = [mov[0]*num, mov[1]*num]\n\t\t\t\t\t#if the final move equals to multiplication of a basic move by a certain number and the way to the destination square is clear.\n\t\t\t\t\tif iteration == player_mov && cleared_way?(mov) == true\t\t\t\n\t\t\t\t\t\treturn true\t\t\n\t\t\t\t\tend\n\t\t\t\tend\n\t\t\tend\n\t\t#if start node name is a pawn piece.\n\t\telsif @piece_name == \"pawn\"\n\t\t\t#one positive rank move from a white piece to a nil node.\n\t\t\tif piece_movs[\"pawn\"][0].include?(player_mov) && (@final_node.color == nil && @start_node.color == \"white\")\n\t\t\t\treturn true\n\t\t\t#one negative rank move from a black piece to a nil code.\n\t\t\telsif piece_movs[\"pawn\"][1].include?(player_mov) && (@final_node.color == nil && @start_node.color == \"black\")\n\t\t\t\treturn true\t\n\t\t\t#a positive diagonal move from a white piece to a node of the opponent color.\t\n\t\t\telsif (piece_movs[\"pawn\"][2..3].include?(player_mov) && @start_node.color == \"white\") && (@final_node.color != @current_player.color && @final_node.color != nil)\n\t\t\t\treturn true\t\n\t\t\t#a negative diagonal move from a black piece to a node of the opponent color.\n\t\t\telsif (piece_movs[\"pawn\"][4..5].include?(player_mov) && @start_node.color == \"black\") && (@final_node.color != @current_player.color && @final_node.color != nil)\n\t\t\t\treturn true\n\t\t\t#a double positive rank move from a white piece on rank 2 position to a nil color node.\n\t\t\telsif (piece_movs[\"pawn\"][6] == player_mov && @final_node.color == nil) && (@start_node.color == \"white\" && @first_coord_convertion[1] == \"2\")\n\t\t\t\treturn true\n\t\t\t#a double negative rank move from a black piece on rank 7 position to a nil color node.\n\t\t\telsif (piece_movs[\"pawn\"][7] == player_mov && @final_node.color == nil) && (@start_node.color == \"black\" && @first_coord_convertion[1] == \"7\")\n\t\t\t\treturn true\t\n\t\t\tend\n\t\tend\n\t\treturn false\n\tend", "title": "" }, { "docid": "ebd161bcf8c98ce3f323095801fd5c1e", "score": "0.590382", "text": "def test_movement_check_one_way\r\n\t\tdriver = Driver::new(\"Driver 1\")\r\n\t\thospital = Location::new(\"Hospital\", \"Foo St.\", \"Fourth Ave.\")\r\n\t\tmuseum = Location::new(\"Museum\", \"Bar St.\", \"Fifth Ave.\")\r\n\t\tcathedral = Location::new(\"Cathedral\", \"Bar St.\", \"Fourth Ave.\")\r\n\t\r\n\t\thospital.new_one_way cathedral\r\n\t\thospital.new_two_way museum\r\n\r\n\t\tdriver.current_location(hospital)\r\n\t\tdriver_move(driver, 0)\r\n\t\tassert_equal cathedral, driver.location\r\n\tend", "title": "" }, { "docid": "de9c5fe4c4e62b9d5381108cc29e908f", "score": "0.58912003", "text": "def is_move_valid(current_state, proposed_change)\n proposed_floor = current_state[:elevator] + proposed_change[:elevator]\n return false if proposed_change.length < 2 || proposed_change.length > 3\n return false if proposed_floor < 0 || proposed_floor > 3\n\n proposed_state = get_new_state(current_state, proposed_change)\n generators = []\n chips = []\n proposed_state[:floors][proposed_floor].each do |item|\n binding.pry if item == nil\n if item[0] == :gen\n generators << item[1]\n else\n chips << item[1]\n end\n end\n if generators.length > 0\n chips.each do |chip_type|\n return false if !generators.include?(chip_type)\n end\n end\n\n return false if @visited_states.include? proposed_state.to_s\n @visited_states << proposed_state.to_s\n # binding.pry\n proposed_state\nend", "title": "" }, { "docid": "1cf6f832499033dbf8a7d2a698ba9d37", "score": "0.58704275", "text": "def valid_move?(index)\n puts \"Turn #{turn_count}\"\n index.between?(0,8) && !position_taken?(index)\n end", "title": "" }, { "docid": "ab6b87d439d2ac15bdfbf3aebcff6da0", "score": "0.5848346", "text": "def generate_moves\n @delta.each do |step|\n (1..7).each do |i|\n new_pos = [@pos[0] + step[0] * i, @pos[1] + step[1] * i]\n if valid_coord?(new_pos)\n @move_list << new_pos\n break if @board[new_pos]\n else\n break\n end\n end\n end\n end", "title": "" }, { "docid": "c24e5ea3b22a96247facd1d3744a4825", "score": "0.583773", "text": "def valid_moves\n\n end", "title": "" }, { "docid": "1a8494d5ab8af5856ca303067ef7d89b", "score": "0.5825522", "text": "def is_valid_move x,y\n return false unless (0..3) === x\n return false unless (0..3) === y\n return @field[x][y].player == 0\n end", "title": "" }, { "docid": "1c7e1ec2440dbdd5c37525a847107f67", "score": "0.58192647", "text": "def validate_fake_pos_with_previous_turn_data( turn )\n if @data[ turn-1 ]\n @data[ turn ][ :fake_pos ] = @data[ turn ][ :fake_pos ] & cities_around_last_spotted_cities( turn )\n end\n end", "title": "" }, { "docid": "5bbda4d2bbf0c8c4fc9e511bb45ecd3c", "score": "0.5806988", "text": "def next_move gameboard\n @counter += 1\n @counter = 0 if @counter == gameboard.valid_moves.count\n gameboard.valid_moves[@counter]\n end", "title": "" }, { "docid": "49bf47139e9584b2a1b42de48a81f6ca", "score": "0.5773685", "text": "def valid_move?(destination)\n possible_moves.select do |move|\n on_board?(move) && open?(move)\n end\n\n possible_moves.include?(destination)\n end", "title": "" }, { "docid": "ca73ad1ab2c1bf152187b6b8064aeabd", "score": "0.57543105", "text": "def test_travel_iteration_six\n fake_state = Minitest::Mock.new\n assert_equal([8, 7], @game.travel(6, fake_state, 8, 7))\n end", "title": "" }, { "docid": "b49178f2f3966c243b196a95083fafe8", "score": "0.57504255", "text": "def validate_player_move(move)\r\n \r\n #Return a value of false is the square has already been\r\n #selected\r\n return false if move == \"A1\" && $A1 != \" \"\r\n return false if move == \"B1\" && $B1 != \" \"\r\n return false if move == \"C1\" && $C1 != \" \"\r\n return false if move == \"A2\" && $A2 != \" \"\r\n return false if move == \"B2\" && $B2 != \" \"\r\n return false if move == \"C2\" && $C2 != \" \"\r\n return false if move == \"A3\" && $A3 != \" \"\r\n return false if move == \"B3\" && $B3 != \" \"\r\n return false if move == \"C3\" && $C3 != \" \" \r\n \r\n #Return a value of true if the square is available\r\n return true\r\n \r\n end", "title": "" }, { "docid": "d5575e15ff8e84f85888e650d9658852", "score": "0.57491994", "text": "def valid_moves\n moves = []\n\n # go in all directions\n (-1..1).each do |_x_step|\n (-1..1).each do |_y_step|\n # start walking in that direction\n (1..7).each do |steps|\n x = x_coordinate + steps * x_direction\n y = y_coordinate + steps * y_direction\n\n # stop walking if you hit a wall\n break unless valid_move?(x, y)\n\n # remember the valid moves\n moves.push(Move.new(x, y))\n end\n end\n end\n moves\n end", "title": "" }, { "docid": "e2263c4a938d201d5669eea4896a219c", "score": "0.5736702", "text": "def test_movement_check_two_way\r\n\t\tdriver = Driver::new(\"Driver 1\")\r\n\t\thospital = Location::new(\"Hospital\", \"Foo St.\", \"Fourth Ave.\")\r\n\t\tmuseum = Location::new(\"Museum\", \"Bar St.\", \"Fifth Ave.\")\r\n\t\tcathedral = Location::new(\"Cathedral\", \"Bar St.\", \"Fourth Ave.\")\r\n\t\r\n\t\thospital.new_one_way cathedral\r\n\t\thospital.new_two_way museum\r\n\r\n\t\tdriver.current_location(hospital)\r\n\t\tdriver_move(driver, 1)\r\n\t\tassert_equal museum, driver.location\r\n\tend", "title": "" }, { "docid": "f243c3d5b1b49db77d92a255d70411f3", "score": "0.5730757", "text": "def get_good_move\n loop do\n\t\t @player_move = self.get_player_move\n break if @current_state[@player_move].nil?\n puts \"That position is taken. Try another.\"\n end\n @player_move\n end", "title": "" }, { "docid": "857a89e40fa445033ba8a923e836f60a", "score": "0.5729397", "text": "def make_move(valid)\n @move = valid.rules.keys.sample\n end", "title": "" }, { "docid": "4728e08c0609c98b2011914a2eee13dc", "score": "0.57244676", "text": "def validMove(piece, newLocation)\n # piece can move to any empty adjacent space.\n # might need to account for placing pieces. can be counted as a fly move i guess \n\n if newLocation == nil || piece == nil\n return false\n end\n\n # check if its a fly move. \n if @player1.isActive\n if @player1.numPlayedPieces <= 3\n fly = true \n else\n fly = false\n end\n else\n if @player2.numPlayedPieces <= 3\n fly = true \n else\n fly = false\n end\n end\n\n\n #checks if space is empty:\n if newLocation.isEmpty()\n # check if its a fly move\n if fly\n # if its a fly and the target location is empty its allowed. \n return true\n elsif piece.location == nil\n return true\n else\n # should return true if the move is valid.\n return @board.isAdjacent(piece,newLocation)\n end\n else\n # should the space is not empty, the move is invalid\n return false\n end\n\n end", "title": "" }, { "docid": "f9123404860753151e12bd5baee231b7", "score": "0.57203925", "text": "def validate_move(move)\n @rules_matrix.has_key?(move)\n end", "title": "" }, { "docid": "13a247f234051cb9318fb54d89f2d220", "score": "0.5714538", "text": "def validate_move?(move)\n return true if open_spots.include?(move)\n false\n end", "title": "" }, { "docid": "785c97e2d4e77ddcef77c48ab6dc9e0a", "score": "0.57006216", "text": "def valid_moves\n moves = []\n # If the floor is on the bottom or top floor, it can only go One Direction\n if @current_floor == 0\n # Has to go up\n # We can take up just this item\n @floors[@current_floor].items.compact.each do |item|\n new_building = self.dup\n destination_floor = new_building.floors[@current_floor+1]\n\n if destination_floor.can_have?([item])\n # Valid move\n new_building.floors[@current_floor].items[item] = nil\n new_building.floors[@current_floor+1].items[item] = item\n moves << new_building\n end\n end\n\n # Or we can take two items\n @floors[@current_floor].items.compact.permutation(2).each do |items|\n new_building = self.dup\n destination_floor = new_building.floors[@current_floor+1]\n\n if destination_floor.can_have?(items)\n # Valid move\n items.each do |item|\n new_building.floors[@current_floor].items[item] = nil\n new_building.floors[@current_floor+1].items[item] = item\n end\n moves << new_building\n end\n end\n elsif @current_floor == 3\n # Has to go down\n else\n # Can go up or down\n end\n\n moves\n end", "title": "" }, { "docid": "b09f5ba7c5cefd9fab50c9d9486166a2", "score": "0.5690843", "text": "def test_game_loop_change_city\n\t\tg = Game.new(0,0,0)\n\t\tmocked_miner = Minitest::Mock.new(\"mocked miner\")\n\t\tdef mocked_miner.current_city; 0; end\n\t\tdef mocked_miner.increase_rubies(x,y); nil; end\n\t\tdef mocked_miner.change_city(x); nil; end\n\n\t\tmocked_city = Minitest::Mock.new(\"mocked city\")\n\t\tdef mocked_city.get_rubies(x); [0,0]; end\n\t\tdef mocked_city.name; 'Town'; end\n\t\tdef mocked_city.get_neighboring_city(x); 0; end\n\n\t\tmocked_printer = Minitest::Mock.new(\"mocked printer\")\n\t\tdef mocked_printer.print_day(x,y); nil; end\t\n\t\t\n\t\tassert_output(\"Heading from Town to Town.\\n\") {g.game_loop(mocked_miner, 2, mocked_printer, [mocked_city])}\n\tend", "title": "" }, { "docid": "aeff6103cac258aee26ef3f67a1e285b", "score": "0.568605", "text": "def validate_place(x,y,direction,placed,place_position)\n params=place_position.split(',')\n if is_integer(params[0]) && is_integer(params[1]) # Checking invalid inputs\n temp_x=params[0].to_i\n temp_y=params[1].to_i\n else\n return x,y,direction,placed # Place invalid, return\n end \n if validate(temp_x) && validate(temp_y) # Checking board boundaries\n if ['NORTH','EAST','WEST','SOUTH'].include?(params[2]) # Checking valid Directions\n x=temp_x\n y=temp_y\n direction=params[2]\n return x,y,direction,true #place is valid return updated coordinates and placed_state\n end\n end\n return x,y,direction,placed # Place invalid, return\n end", "title": "" }, { "docid": "bc4378b5d41878fc8e13a1d6684f9df8", "score": "0.56694716", "text": "def validate_move(move) \n move_from_file = @data[\"moves\"][move]\n move_from_file ? valid = true : valid = false\n end", "title": "" }, { "docid": "615331ef40408758d67a5a26eedcc9e4", "score": "0.5662863", "text": "def test_travel_iteration_five\n fake_state = Minitest::Mock.new\n def fake_state.max_silver\n 0\n end\n\n def fake_state.max_gold\n 0\n end\n\n def fake_state.city_name\n 'test1'\n end\n\n def fake_state.edge_cities\n [Location.new('test1', 0, 0)]\n end\n\n assert_equal([6, 2], @game.travel(5, fake_state, 6, 2))\n end", "title": "" }, { "docid": "d315dd3f115cb4da7e4c4a43c5594d09", "score": "0.5661058", "text": "def is_move_valid(move)\n @moves.include? move\n end", "title": "" }, { "docid": "48f0ffb37148ebd76ae23509b96db27a", "score": "0.56573504", "text": "def valid_move_seq?(move_seq)\n test_board = @board.dup_board\n # debugger\n if test_board[@position].perform_moves!(move_seq)\n return true\n else\n raise InvalidMoveError\n end\n end", "title": "" }, { "docid": "edcd9e1b3701bcbeed695f34527d4706", "score": "0.5642495", "text": "def valid_move?(move)\n move.to_i.between?(1,9) && !taken?(move)\n end", "title": "" }, { "docid": "ecd206af8bcc40f8a4440f91f9aeec6e", "score": "0.5614354", "text": "def valid_move?\n\t\tvalid_1 = (0..2).include? (@take_from)\n\t\tvalid_2 = (0..2).include? (@move_to)\n\t\tif valid_1 == false || valid_2 == false\n\t\t\tputs \"I'm sorry, please input your move in a 'x,y' format, ensuring that you are selecting numbers between 1 and 3!\"\n\t\t\tmove_input\n\t\telsif @pegs[@take_from][0] == nil\n\t\t\tputs \"I'm sorry, I'm not in the mood for a philosophical debate so let's just agree that you cannot move nothing and you can try again.\"\n\t\t\tmove_input\n\t\tend\n\tend", "title": "" }, { "docid": "4840da9af0135367afed86edfaa06e28", "score": "0.5611486", "text": "def validates_move move\n\t\[email protected]?(move) && move.index.between?(1,10)\n\tend", "title": "" }, { "docid": "26a3615cf47f52da0dc7a21acdf473d3", "score": "0.5611424", "text": "def valid_moves(starting_position, board, owner)\n next_pos = [starting_position[0] + @move[0], starting_position[1] + @move[1]]\n return non_slide_move(next_pos, board, owner) unless @sliding\n\n generate_slide_moves(next_pos, board, owner)\n end", "title": "" }, { "docid": "eb002796027d85d0dda1e39ea77d68ac", "score": "0.56099105", "text": "def validate_move(move)\n until @moves.include?(@move) \n puts \"Your move is invalid. Try again. Choose: rock / paper / scissors\"\n @move = gets.chomp.capitalize.to_s\n end\n @current_moves << @move\n p @current_moves\n end", "title": "" }, { "docid": "eb604ebbeedbb62cff3d72467863292b", "score": "0.5588995", "text": "def validate_move(world, new_coords)\n true if new_coords[0].between?(0, world.size-1) && new_coords[1].between?(0, world.size-1)\n end", "title": "" }, { "docid": "eb7d9e1166739c0f38e417d4a12b0963", "score": "0.5586402", "text": "def valid_moves\n (slide_moves + jump_moves).select { |move| valid_move_seq?([move]) }\n end", "title": "" }, { "docid": "9379a9070ff7322037156a7a719b9738", "score": "0.55789167", "text": "def test_exposed_check_by_move\n board = ChessBoard.new\n piece = Knight.new(:white)\n board.add(piece, 'd4')\n\n board.add(King.new(:white), 'd1')\n board.add(Rook.new(:black), 'd8')\n\n refute(piece.valid_move?('d4', 'e6', board), 'Knight cannot expose king to check')\n end", "title": "" }, { "docid": "9caf39c1ae0afc86b62f7c49467c9f67", "score": "0.5564229", "text": "def check_if_moveisvalid(move)\n @all_available_moves.each do |avail_move|\n return true if move.is_equal_to?(avail_move)\n end\n return false\n end", "title": "" }, { "docid": "6ff2e47b289cf56ea4c6a6e3c776b1c1", "score": "0.5562634", "text": "def valid_move?\n\t\[email protected]_on_table?(@robot_direction, @x, @y)\n\tend", "title": "" }, { "docid": "8732ff0f585e29223d9d27bd9f472f6b", "score": "0.55617", "text": "def valid_move?\n\t\t# Now let's make sure all of the moves are valid.\n\t\t# I'll do this by seeing if the sorted version of each\n\t\t# column equals the @board version.\n\t\ttemp_board = Marshal.load(Marshal.dump(@board))\n\t\ttemp = temp_board[@move_from].shift\n\t\ttemp_board[@move_to].unshift(temp)\n\n\t\ttemp_board.each do |column|\n\t\t\tif column.sort != column\n\t\t\t\treturn false\n\t\t\tend\n\t\tend\n\t\t# If they all pass, we're good!\n\t\treturn true\n\tend", "title": "" }, { "docid": "d473ffbdd575f7bf384b3008f149a884", "score": "0.55534744", "text": "def valid_move(user_input)\n user_input.split(' ').first == 'move' &&\n ['north','south', 'east', 'west'].include?(user_input.split(' ').last)\n end", "title": "" }, { "docid": "771dddcdb2d45ea39eb77fc2be75ab4f", "score": "0.5544814", "text": "def winning_state_for_next_move?\n # for each possible move that could be made:\n # return true if the move leaves a losing_state_for_next_move for the opponent\n # else\n # false\n # end\n\n\n # a player can win with one move\n # / there is a move that makes true losing_state_for_next_move\n\n # if you can set up 1,1,1 by making your move, it's a winning move\n end", "title": "" }, { "docid": "aaaffc7387fedff82c1c9ea4d7d74dd7", "score": "0.5543939", "text": "def is_valid_space?(state, move, turn)\n board = JSON.parse(state)\n src, dst = move \n \n # Get the piece that is going to be\n # moved \n srcpiece = board[src[0]][src[1]]\n dstpiece = board[dst[0]][dst[1]]\n \n # Make sure the src piece is the\n # same as the turn and the destination\n # is an empty space\n if srcpiece.downcase != turn or dstpiece != ' '\n return false \n end\n\n return true \n end", "title": "" }, { "docid": "700d0ff4b2f27f571f664d3581fec1e6", "score": "0.55409855", "text": "def test_for_not_museum\n testLocation = LocationNode.new(\"Hillman\",nil,nil,nil,nil)\n assert_equal false, incrementToy(testLocation)\n end", "title": "" }, { "docid": "3fa6ff57684c25f618fb9ac2d3491ae6", "score": "0.5536866", "text": "def next_state(state, move)\n # Deep copy position (is this the easiest way?)\n position = Marshal.load(Marshal.dump(state[:position]))\n player = state[:player]\n opp = opponent(player)\n pieces = Marshal.load(Marshal.dump(state[:pieces]))\n from = move[0]\n to = move[1]\n force_analysis = false\n check = false\n moving_piece = pieces[player].find { |piece| piece.location == from }\n if !moving_piece\n puts \"ERROR--no piece to move!\"\n end\n # Check for capture\n if position[to[0]][to[1]] != \".\"\n # Remove enemy piece\n pieces[opp].delete_if { |piece| piece.location == to }\n # Force AI to continue analysis\n force_analysis = true\n end\n # Check for promotion\n if moving_piece.class == Pawn && to[0] == end_row(player)\n # Replace pawn with queen\n # (Underpromotion not yet implemented)\n pieces[player].delete(moving_piece)\n moving_piece = Queen.new(self, to, player)\n pieces[player] << moving_piece\n end\n # Move piece\n position[from[0]][from[1]] = \".\"\n position[to[0]][to[1]] = moving_piece.icon\n moving_piece.location = to\n # Complete castling by moving rook\n if moving_piece.class == ChessKing && (from[1] - to[1]).abs == 2\n rook_column = to[1] == 6 ? 7 : 0\n castling_rook = pieces[player].find { |piece| piece.location == [from[0], rook_column] }\n if castling_rook\n rook_dest = to[1] == 6 ? 5 : 3\n position[from[0]][rook_column] = \".\"\n position[to[0]][rook_dest] = castling_rook.icon\n castling_rook.location = [to[0], rook_dest]\n else\n puts \"Castling error -- can't find rook!\"\n end\n end\n # Switch active player\n next_player = opp\n # # Create new state for testing whether king is in check\n # new_position_state = {\n # :position => position,\n # :player => player,\n # :pieces => pieces,\n # :check => false,\n # :force_analysis => false\n # }\n # # Test whether opponent's king is now in check\n # check = check?(new_position_state)\n # force_analysis = true if check\n # Return new state\n {\n :position => position,\n :player => next_player,\n :pieces => pieces,\n :check => check,\n :force_analysis => force_analysis\n }\n end", "title": "" }, { "docid": "1335ddf8a35f4ad1cb152ca99e31d9ea", "score": "0.55308235", "text": "def test_red_move(st_x, st_y, type, moves)\n moves.each do |move|\n mv_x, mv_y = move\n if legal_red_move(st_x, st_y, mv_x, mv_y, @game.board)\n @game.board[st_y][st_x] = 0\n @game.board[mv_y][mv_x] = 2\n if king_me(mv_x, mv_y, type)\n @game.turn_count = 1\n @game.save\n return {:board => @game.board, :turn_count => @game.turn_count, :message_type => 1, :message => \"Move successful, you now have a king!\"}\n end\n else\n return {:board => @game.board, :message_type => 0, :message => \"Move unsuccessful\"}\n end\n end\n @game.turn_count = 1\n @game.save\n {:board => @game.board, :turn_count => @game.turn_count, :message_type => 1, :message => \"Move successful\"}\n end", "title": "" }, { "docid": "aa8c2e4444f10317f2c4c3436894242f", "score": "0.55276954", "text": "def travel\n @prev_city = @current_city\n case @current_city\n when 'Enumerable Canyon'\n @random_num = @prng.rand(2)\n @current_city = ec_travel\n when 'Duck Type Beach'\n @random_num = @prng.rand(2)\n @current_city = dtb_travel\n when 'Monkey Patch City'\n @random_num = @prng.rand(3)\n @current_city = mpc_travel\n when 'Nil Town'\n @random_num = @prng.rand(3)\n @current_city = nt_travel\n when 'Matzburg'\n @random_num = @prng.rand(4)\n @current_city = m_travel\n when 'Hash Crossing'\n @random_num = @prng.rand(3)\n @current_city = hc_travel\n when 'Dynamic Palisades'\n @random_num = @prng.rand(2)\n @current_city = dp_travel\n end\n end", "title": "" }, { "docid": "77d5da6fb144c081cbe27eede3df71c9", "score": "0.5525401", "text": "def next_move_correct?(ary,attacking = false)\n movement_correct = false\n Possible_moves.each{|move|\n if (@current_position[0]+move[0]) == ary[0] && (@current_position[1]+move[1]) == ary[1]\n movement_correct = true\n break\n end\n }\n movement_correct\n end", "title": "" }, { "docid": "77d5da6fb144c081cbe27eede3df71c9", "score": "0.5525401", "text": "def next_move_correct?(ary,attacking = false)\n movement_correct = false\n Possible_moves.each{|move|\n if (@current_position[0]+move[0]) == ary[0] && (@current_position[1]+move[1]) == ary[1]\n movement_correct = true\n break\n end\n }\n movement_correct\n end", "title": "" }, { "docid": "b3033c73ff320cfd98f2032a6e5470e4", "score": "0.55188495", "text": "def valid_move?(location)\n location.to_i.between?(1,9) && !position_taken?(location.to_i-1)\n end", "title": "" }, { "docid": "d5b5a17e034396b05e2949a6f9975c82", "score": "0.5511182", "text": "def valid_move?(current_obj, next_obj, current_cell, test_cell)\n cc_row = current_cell[0]\n cc_col = current_cell[1]\n tc_row = test_cell[0]\n tc_col = test_cell[1]\n\n next_obj == current_obj &&\n cc_row == tc_row - 1 && cc_col == tc_col - 1 || \\\n cc_row == tc_row - 1 && cc_col == tc_col || \\\n cc_row == tc_row - 1 && cc_col == tc_col + 1 || \\\n cc_row == tc_row && cc_col == tc_col + 1 || \\\n cc_row == tc_row + 1 && cc_col == tc_col + 1 || \\\n cc_row == tc_row + 1 && cc_col == tc_col || \\\n cc_row == tc_row + 1 && cc_col == tc_col - 1 || \\\n cc_row == tc_row && cc_col == tc_col - 1 \n end", "title": "" }, { "docid": "ad3ba54325b29bc9abce9ddb0da3210c", "score": "0.55008245", "text": "def is_valid_move?(proposed_row, proposed_col, solution)\n return true\nend", "title": "" }, { "docid": "e13be5626501f432a9d5dabc270805a3", "score": "0.54992664", "text": "def test_live_cell_with_four_neighbors_dies\n refute @life.will_live?(true, 4)\n end", "title": "" }, { "docid": "12acac49c32e11441196590b027fa462", "score": "0.5497483", "text": "def valid_move?(move_index)\r\n #valid if position is NOT taken\r\n valid = !self.position_taken?(move_index)\r\n if valid == true\r\n if move_index.between?(0,8)\r\n valid = true\r\n else\r\n valid = false\r\n end\r\n end\r\n valid\r\n end", "title": "" }, { "docid": "0faa13fb80d6a845e93ebbbedadffab2", "score": "0.549673", "text": "def test_possible_location_from_museum_if_rand_is_one\r\n\t\toakland = City::new\r\n\t\trand_val = 1\r\n\t\thillman = oakland.generate_museum_locs(oakland, rand_val)\r\n\r\n\t\tassert_equal hillman[0], \"Hillman\"\r\n\t\tassert_equal hillman[1][0], \"Fifth Ave.\"\r\n\tend", "title": "" }, { "docid": "aab3fcf85c1974a09e7e9352ddbf643e", "score": "0.5490847", "text": "def valid_move?(location)\n location.to_i.between?(1,9) && !taken?(location)\n end", "title": "" }, { "docid": "e5d038ad70b86129158b4e8e6ef47a2b", "score": "0.5483718", "text": "def determine_moves(loc)\n\n piece = @spaces[loc]\n\n moveset = []\n attackset = []\n new_moves = []\n\n x = loc[0]\n y = loc[1]\n\n enemy_king_checked = false\n\n\n case piece.type\n\n when \"pawn\"\n\n if piece.color == \"white\"\n\n new_moves << [x, y+1]\n new_moves << [x,y+2] if y == 1\n\n if @spaces[new_moves[0]].nil?\n\n moveset << new_moves[0]\n moveset << new_moves[1] if y == 1\n\n end\n\n atk_moves = [[x+1, y+1], [x-1, y+1]]\n atk_moves.each do |move|\n attackset << move if @spaces[move].nil?.! and @spaces[move].color == \"black\"\n if @spaces[move].nil?.!\n enemy_king_checked = true if @spaces[move].color == \"black\" and @spaces[move].type == \"king\"\n end\n end\n \n\n elsif piece.color == \"black\"\n\n new_moves = [[x, y-1]]\n new_moves << [x,y-2] if y == 6\n\n if @spaces[new_moves[0]].nil?\n\n moveset << new_moves[0]\n moveset << new_moves[1] if loc[1] == 6\n\n end\n\n atk_moves = [[x+1, y-1], [x-1, y-1]]\n atk_moves.each do |move|\n attackset << move if @spaces[move].nil?.! and @spaces[move].color == \"white\"\n if @spaces[move].nil?.!\n enemy_king_checked = true if @spaces[move].color == \"white\" and @spaces[move].type == \"king\"\n end\n end\n end\n\n @spaces[loc].moveset = moveset\n @spaces[loc].attackset = attackset\n \n\n when \"rook\"\n\n runner(loc, :north)\n runner(loc, :east)\n runner(loc, :south)\n runner(loc, :west)\n\n when \"knight\"\n\n possible_directions =\n [ [x+1, y+2],\n [x+1, y-2],\n [x-1, y+2],\n [x-1, y-2],\n [x+2, y+1],\n [x+2, y-1],\n [x-2, y+1],\n [x-2, y-1] ]\n\n moveset = possible_directions.select do |d|\n (d[0].between?(0,7) & d[1].between?(0,7)) and @spaces[d].nil?\n end\n\n attackset = possible_directions.select do |d|\n (d[0].between?(0,7) & d[1].between?(0,7)) and (@spaces[d].nil?.! and @spaces[d].color != @spaces[loc].color)\n end\n\n @spaces[loc].moveset = moveset\n @spaces[loc].attackset = attackset\n\n\n when \"bishop\"\n\n runner(loc, :northeast)\n runner(loc, :southeast)\n runner(loc, :northwest)\n runner(loc, :southwest)\n\n\n when \"queen\"\n\n runner(loc, :north)\n runner(loc, :northeast)\n runner(loc, :east)\n runner(loc, :southeast)\n runner(loc, :south)\n runner(loc, :southwest)\n runner(loc, :west)\n runner(loc, :northwest)\n\n\n when \"king\"\n\n runner(loc, :north, 1)\n runner(loc, :northeast, 1)\n runner(loc, :east, 1)\n runner(loc, :southeast, 1)\n runner(loc, :south, 1)\n runner(loc, :southwest, 1)\n runner(loc, :west, 1)\n runner(loc, :northwest, 1)\n\n end\n\n\n end", "title": "" }, { "docid": "fd5ae70b287ba9a352135de12c10955b", "score": "0.5480829", "text": "def test_move(params)\n @game = Game.find(params[\"id\"].to_i)\n user_id = params[\"user_id\"]\n start_x = params[\"x\"]\n start_y = params[\"y\"]\n current_user = User.find(user_id)\n type = @game.board[start_y][start_x]\n\n \tif ((type == 1 || type == 3) && current_user = @game.players.first) || ((type == 2 || type == 4) && current_user = @game.players.second)\n \t case type\n \t when 1\n \t test = test_black_move(start_x, start_y, type, params[\"move\"])\n \t when 2\n \t\t test = test_red_move(start_x, start_y, type, params[\"move\"])\n \t when 3\n \t\t test = test_king_move(start_x, start_y, type, params[\"move\"])\n when 4\n \t\t test = test_king_move(start_x, start_y, type, params[\"move\"])\n \t end\n \tend\n test\n end", "title": "" }, { "docid": "eb45e5b712143a3e74c64f531f902bc2", "score": "0.54721713", "text": "def valid_move?(board, index)\n# binding.pry\n index.between?(0,8) && !position_taken?(board, index)\nend", "title": "" }, { "docid": "e2809e170ac8159d086cbd82cc7249b8", "score": "0.5470396", "text": "def valid_move_seq? move_sequence\n dup_board = self.board.dup\n \n begin\n dup_board.perform_moves!(move_sequence)\n rescue InvalidMoveError => e\n puts e.message\n else\n return true\n end \n end", "title": "" }, { "docid": "aa3d1087c6c96911cf8a1b7eb2694fdf", "score": "0.54670197", "text": "def generate_possible_moves(state)\n end", "title": "" }, { "docid": "e11159394c01dba25caec319c4d88f99", "score": "0.54652655", "text": "def test_possible_location_from_cathedral_if_rand_is_one\r\n\t\toakland = City::new\r\n\t\trand_val = 1\r\n\t\tmuseum = oakland.generate_cathedral_locs(oakland, rand_val)\r\n\r\n\t\tassert_equal museum[0], \"Museum\"\r\n\t\tassert_equal museum[1][0], \"Bar St.\"\r\n\tend", "title": "" }, { "docid": "c96fe743a338012636bd94935777a6dd", "score": "0.5457053", "text": "def valid_move?(board, posn_str, team = \"X\")\n posn = posn_str.to_i\n posn -= 1\n if ((posn.between?(0,8)) && !(position_taken?(board,posn)))\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "4853918348808961be8bb266e9c6b19c", "score": "0.5456585", "text": "def next_move(game_state: nil)\n #We add only what is new, just in case the state_delta contains less info...\n new_moves = []\n if @board_state.length < game_state.length\n (@board_state.length...game_state.length).each do |i| \n @board_state << game_state[i] \n new_moves << game_state[i]\n end\n end\n moves = translate_acn(new_moves, board)\n update_board(@board, moves, @score)\n return decide_best_move @board, @score, @depth\n end", "title": "" }, { "docid": "78993a155c6fd239d32cb243c698f0b6", "score": "0.545293", "text": "def test_fun_city_locs\n\t@city = GoldRush::new\n\tassert_equal \"El Dorado Canyon\", @city.dorado.location\n\tassert_equal \"Midas\", @city.midas.location\n\tassert_equal \"Virginia City\", @city.virginia.location\n\tassert_equal \"Nevada City\", @city.nevada.location\n\tassert_equal \"Coloma\", @city.coloma.location\n\tassert_equal \"Angels Camp\", @city.angels.location\n\tassert_equal \"Sutter Creek\", @city.sutter.location\n end", "title": "" }, { "docid": "9f2927d68d411324cd77272a8ec8b1dc", "score": "0.54476583", "text": "def legal_move?(new_x, new_y)\n return false unless actual_move?(new_x, new_y)\n return_val = false\n piece_moved_start_x = x_position\n piece_moved_start_y = y_position\n piece_captured = nil\n piece_captured_x = nil\n piece_captured_y = nil\n # check if you are moving pawn in en passant capture of enemy pawn\n if type == PAWN && !square_occupied?(new_x, new_y)\n if (new_x - piece_moved_start_x).abs == 1 && (new_y - piece_moved_start_y).abs == 1\n piece_captured = game.get_piece_at_coor(new_x, piece_moved_start_y)\n piece_captured_x = new_x\n piece_captured_y = piece_moved_start_y\n end\n end\n # return false if move is invalid for this piece for any of the reasons checked in piece #valid_move?\n return false unless valid_move?(new_x, new_y)\n # If square is occupied, respond according to whether piece is occupied by friend or foe\n if square_occupied?(new_x, new_y)\n occupying_piece = game.get_piece_at_coor(new_x, new_y)\n return false if (occupying_piece.is_white && is_white?) || (!occupying_piece.is_white && !is_white?)\n # since player is trying to capture a friendly piece\n piece_captured = occupying_piece\n piece_captured_x = occupying_piece.x_position\n piece_captured_y = occupying_piece.y_position\n capture_piece(occupying_piece)\n end\n # only here do we update coordinates of piece moved, once we have saved all starting coordinates of piece moved and any piece it captured\n update(x_position: new_x, y_position: new_y)\n increment_move\n return_val = true unless game.check?(is_white)\n update(x_position: piece_moved_start_x, y_position: piece_moved_start_y)\n piece_captured.update(x_position: piece_captured_x, y_position: piece_captured_y) unless piece_captured.nil?\n decrement_move\n return_val\n end", "title": "" }, { "docid": "5e3e92ae688985fe8ea692b4fcba448c", "score": "0.5443122", "text": "def is_valid_sequence?(state, sequence, turn)\n board = JSON.parse(state)\n valid = true \n\n sequence = sequence[0]\n\n sequence.each do |move|\n valid = valid and self.is_valid_space?(state, move, turn)\n\n if not valid\n return false\n end\n\n # Get the move \n src, dst = move\n\n # Make the move \n board[src[0]][src[1]],\n board[dst[0]][dst[1]] = ' ', board[src[0]][src[1]]\n\n # if the move was a jump\n if (src[0] - dst[0]).abs == 2 and (src[1] - dst[1]).abs == 2\n r = (src[0] + dst[0]) / 2\n c = (src[1] + dst[1]) / 2\n\n board[r][c] = ' '\n end\n end\n\n return true \n end", "title": "" }, { "docid": "77ecd27b9b340a874b3f9153c17602df", "score": "0.54426306", "text": "def valid_move?(board, i)\n if board[i.to_i-1] == \"X\" || board[i.to_i-1] == \"O\" || i.to_i < 1 || i.to_i > 9\n valid = false\n else\n valid = true\n end\nend", "title": "" }, { "docid": "f901ded351ce98d84c02aac47c45a0f6", "score": "0.54330057", "text": "def check_next_player(input)\n if input[:game].next_player_id == input[:user].id\n Success(input)\n else\n Failure(\"Unexpected move from #{input[:user].login}\")\n end\n end", "title": "" }, { "docid": "b93bd862f4d62c2cbadc7ed88413be6c", "score": "0.54193264", "text": "def test_move_turns_nil_town\n ruby_rush=RubyRush.new(1, 2, 3)\n ruby_rush.turn=10\n ruby_rush.random(ruby_rush.seed)\n ruby_rush.move_turns_nil_town\n assert_includes ['Monkey Patch City', 'Hash Crossing'], ruby_rush.city\n end", "title": "" }, { "docid": "5f962402a821bb26eb04503b3df56fe5", "score": "0.5415438", "text": "def valid_move?(cur_pos, next_pos)\n return false if @all_positions[next_pos] # no need to add already seen pos \n cur_col, cur_row = cur_pos\n next_col, next_row = next_pos\n bool_1 = (next_col - cur_col).abs == 2 && (next_row - cur_row).abs == 1\n bool_2 = (next_row - cur_row).abs == 2 && (next_col - cur_col).abs == 1\n bool_1 || bool_2\n end", "title": "" }, { "docid": "f42bcea2abdbc974a956f73e7f5fa9e8", "score": "0.5410775", "text": "def valid_move? move\n@board[move] == PIECE[:blank]\nend", "title": "" }, { "docid": "81443fbfeeeb81a0b60e6b9f06eef0c0", "score": "0.5409554", "text": "def move_valid?\n @board.first_disk = 0\n\n #determine disk piece to be moved\n @board.board.each do |row, arr|\n if arr[@player.from] != 0\n @board.first_disk = arr[@player.from]\n break\n end\n end\n\n #determine the highest disk available in that column\n @board.board.each do |row, arr|\n if arr[@player.to] != 0\n @board.second_disk = arr[@player.to]\n break\n else\n @board.second_disk = arr[@player.to]\n end\n end\n\n #conditional test to see if move is valid\n if @board.first_disk == 0\n puts \"No disks in this column, try again\"\n get_input\n elsif @board.second_disk == 0 || @board.first_disk < @board.second_disk\n move_disk\n else\n puts \"Move is invalid\"\n puts \"Please check the rules and input a new move\"\n get_input\n end\n end", "title": "" }, { "docid": "a3d10ddcd3dc25ccfd3759598754a079", "score": "0.53941965", "text": "def legal_move?(move)\n captured_piece = @board.data[move[0]][move[1]]\n move_current_piece(move)\n king = @king_location || move\n result = safe_king?(king)\n @board.data[move[0]][move[1]] = captured_piece\n result\n end", "title": "" }, { "docid": "a3d10ddcd3dc25ccfd3759598754a079", "score": "0.53941965", "text": "def legal_move?(move)\n captured_piece = @board.data[move[0]][move[1]]\n move_current_piece(move)\n king = @king_location || move\n result = safe_king?(king)\n @board.data[move[0]][move[1]] = captured_piece\n result\n end", "title": "" }, { "docid": "e1ffba0dc28ef3277b1bed6c101b9057", "score": "0.53909844", "text": "def valid_move?(move)\n move = move.to_i if move.is_a? String\n return false unless move.is_a? Integer\n move.between?(1, 9) && !position_taken?(move-1) \n end", "title": "" }, { "docid": "bd36f6a2dbace43c9055ba7c579c7c6d", "score": "0.5387034", "text": "def valid_move?(board, i)\n if i.between?(0,8) && !position_taken?(board, i)\n true\n end\n end", "title": "" }, { "docid": "12a51f45f96661c784d9be1c32a0f752", "score": "0.53820413", "text": "def test_first_move_places_x_on_board\n @game.move(1, 1)\n assert @game.spaces.include?('X')\n end", "title": "" }, { "docid": "76a5ce692c885d1672e2fdc2f77c96dd", "score": "0.53811395", "text": "def test_choose_next_town\n map = create_towns\n t = Town::new 'Enumerable Canyon', ['Duck Type Beach'], 1, 1\n p1 = Prospector::new t\n test_i = p1.choose_next_town map\n assert_equal test_i, 1\n end", "title": "" }, { "docid": "01efbcfe4b74d2521e7f4f8a36fec3ac", "score": "0.53766745", "text": "def done?(state)\n legal_moves(state).empty?\n end", "title": "" }, { "docid": "f214bf65938aaa82a8c4f96ebac807ac", "score": "0.5376583", "text": "def valid_move?(board, index)\n if index.between?(0,8) && !position_taken?(board, index)\n puts \"this is a valid move\"\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "474ce4dd5635533111cbabb9c3560def", "score": "0.5375088", "text": "def get_valid_move\nwhile true\nmove = get_move\nif valid_move?(move)\nreturn move\nelse\nputs \"Position #{ move + 1 } is occupied...Enter a free position\"\nend\nend\nend", "title": "" }, { "docid": "7255559b08e20df7807446e52a000c04", "score": "0.5374638", "text": "def valid_move(start, stop, board)\r\n if start[0] == stop[0] && start[1] != stop[1]\r\n path = calculate_path(start, stop)\r\n path.each_with_index do |pair, i|\r\n return false if !board[pair[0]][pair[1]].nil? && i != path.size - 1\r\n end\r\n return true\r\n end\r\n if start[1] == stop[1] && start[0] != stop[0]\r\n path = calculate_path(start, stop)\r\n path.each_with_index do |pair, i|\r\n return false if !board[pair[0]][pair[1]].nil? && i != path.size - 1\r\n end\r\n return true\r\n end\r\n return false\r\n end", "title": "" }, { "docid": "caa1e326e4510e905ff926e0e0ae2666", "score": "0.53741115", "text": "def create_moves\n valid_moves = []\n MOVES.each do |move|\n location = [move[0] + loc[0], move[1] + loc[1]]\n valid_moves << location if location[0].between?(0,7) && location[1].between?(0,7)\n end\n valid_moves\n end", "title": "" }, { "docid": "1df0d5bccc149be783a8cca417318f0d", "score": "0.5372125", "text": "def valid_move?(board, new_index)\n if 8 < new_index || new_index < 0\n return false\n elsif position_taken?(board, new_index) == true\n return false\n else\n return true\n end\nend", "title": "" }, { "docid": "0e887b3884f8e4d94e2ef29c8dc557dd", "score": "0.53716195", "text": "def valid_move?(input)\n input.to_i.between?(1, 9) && !taken?(input)\n # binding.pry\n # input.to_i.between?(1, 9) && position(input) == \" \"\n end", "title": "" }, { "docid": "1f65bf1f8f34b628e137e8c84f3b0200", "score": "0.53670263", "text": "def make_move\n move = nil\n loop do\n move = input_move\n break if @board.legal?(move, @current_player)\n\n puts 'Please enter a legal move'\n end\n update_fifty_move_counter(move)\n @board.move_piece(move)\n @previous_positions.push(Position.new(@board.clone, @opposing_player.clone, @current_player.clone))\n end", "title": "" }, { "docid": "052cf7e19808b9a7f7a1956e78e3ac68", "score": "0.53656465", "text": "def move_is_valid(index)\n return true if ((index >= 1) && (index <= 9)) && (@board[index].nil?)\n return false \n end", "title": "" }, { "docid": "7a4ee18fccae44fda187568d8a942da7", "score": "0.536495", "text": "def make_move(player)\n while true \n from, to = player.get_move\n break if valid_move?(from, to, player)\n puts \"Invalid move\"\n end\n move_piece(from, to)\n end", "title": "" }, { "docid": "7265f763eb96cc8176cfd58fdcb4080f", "score": "0.5358236", "text": "def valid_move?(board, index)\n if index.between?(0, 8) && position_taken?(board, index) == false\n true\n else position_taken?(board, index) == true\n nil\n end\nend", "title": "" }, { "docid": "84f9ee1343094228a74e8eb4177581ae", "score": "0.5355567", "text": "def next_move(player,board,move)\n completed = false;\n blocking = false;\n if(move == 1) #First Move (hard coded)\n puts \"2 0\";\n elsif(move == 2) #Second Move (hard coded)\n if(board[1][1] == 'X')\n puts \"2 2\";\n else\n puts \"1 1\";\n end \n elsif(move == 3) #Third move (hard coded)\n if(board[0][1] == 'O' || board[1][0] == 'O' || board[1][2] == 'O' || board[2][1] == 'O')\n puts \"1 1\";\n elsif(board[1][1] == 'O')\n puts \"0 2\";\n elsif(board[0][2] == 'O' || board[2][2] == 'O')\n puts \"0 0\";\n else\n puts \"2 2\";\n end\n else #Any move after the 3rd\n completed = can_complete(player,board)\n if(completed == false)\n blocking = must_block(player,board);\n if(blocking == false)\n prevent = can_complete(player,board)\n if(move == 4 && (board[0][0] == 'X' || board[0][2] == 'X' || board[2][0] == 'X' || board[2][2] == 'X') && (board[0][1] == 'X' || board[1][0] == 'X' || board[1][2] == 'X' || board[2][1] == 'X'))\n if(board[0][1] == 'X' || board[2][1] == 'X')\n puts \"1 0\";\n else\n puts \"0 1\";\n end\n elsif(move == 4 && ((board[0][0] == 'X' && board[2][2] == 'X') || (board[0][2] == 'X' && board[2][0] == 'X') || (board[0][1] == 'X' && board[2][1] == 'X') || (board[1][0] == 'X' && board[1][2] == 'X')))\n if((board[0][0] == 'X' && board[2][2] == 'X') || (board[0][2] == 'X' && board[2][0] == 'X'))\n puts \"0 1\";\n else\n puts \"0 0\";\n end\n elsif(move == 6 && (board[2][1] == 'X' || board[0][1] == 'X') && (board[1][0] == 'X' || board[1][2] == 'X') && board[2][2] == '_')\n puts \"2 2\";\n elsif(board[0][0] == \"_\")\n puts \"0 0\";\n elsif(board[0][2] == \"_\")\n puts \"0 2\";\n elsif(board[2][2] == \"_\")\n puts \"2 2\";\n elsif(board[2][0] == \"_\")\n puts \"2 0\";\n elsif(board[0][1] == \"_\")\n puts \"0 1\";\n elsif(board[2][1] == \"_\")\n puts \"2 1\";\n elsif(board[1][0] == \"_\")\n puts \"1 0\";\n elsif(board[1][2] == \"_\")\n puts \"1 2\";\n else\n puts \"1 1\";\n end\n end\n end\n end\nend", "title": "" }, { "docid": "db286a0f7515f3e4fdd710a4bec72fee", "score": "0.5354548", "text": "def done?\n # legal_moves(state).empty?\n # Try to speed up by disregarding possibility of draw\n false\n end", "title": "" }, { "docid": "db3bf3d6827fa7b7caafe5276b31dbb6", "score": "0.535265", "text": "def valid?(move)\n @board.valid_move?(move)\n end", "title": "" }, { "docid": "68f846da36e43d6e9cae325591462c13", "score": "0.5351285", "text": "def castle_move\r\n return false if @sx.abs != 2\r\n # If the king is moving two spaces to the left:\r\n if @x1 < @x0\r\n @target_rook = game.pieces.where(x_position: 1, y_position: @y0).first\r\n # If the king is moving two spaces to the right:\r\n else\r\n @target_rook = game.pieces.where(x_position: 8, y_position: @y0).first\r\n end\r\n return false if @target_rook.nil?\r\n # Neither the king nor the rook have moved:\r\n return false if !first_move? || !@target_rook.first_move?\r\n # Move the rook to the other side of the moved king:\r\n if @target_rook.x_position == 1\r\n @target_rook.update_attributes(x_position: 4)\r\n Move.create(game_id: game.id, piece_id: @target_rook.id, move_count: 1, old_x: 1, new_x: 4, old_y: @y0, new_y: @y0)\r\n else\r\n @target_rook.update_attributes(x_position: 6)\r\n Move.create(game_id: game.id, piece_id: @target_rook.id, move_count: 1, old_x: 8, new_x: 6, old_y: @y0, new_y: @y0)\r\n end\r\n true\r\n end", "title": "" }, { "docid": "3cd30a309d4ce88110a40ab8edfe216d", "score": "0.53502524", "text": "def test_possible_location_from_museum_if_rand_is_zero\r\n\t\toakland = City::new\r\n\t\trand_val = 0\r\n\t\tcathedral = oakland.generate_museum_locs(oakland, rand_val)\r\n\r\n\t\tassert_equal cathedral[0], \"Cathedral\"\r\n\t\tassert_equal cathedral[1][0], \"Bar St.\"\r\n\tend", "title": "" }, { "docid": "22f7e42e80ed47a90b3e30fa27376d33", "score": "0.5347591", "text": "def move_valid?(x, y)\n coordinate_valid?(x, y) && !@visited[y][x]\n end", "title": "" }, { "docid": "22f7e42e80ed47a90b3e30fa27376d33", "score": "0.5347591", "text": "def move_valid?(x, y)\n coordinate_valid?(x, y) && !@visited[y][x]\n end", "title": "" } ]
70243e55e4e7f36254b81edb317ea793
Returns an array containing courses to send notifications for. There are two possible cases where it is necessary to send a message to the user: when seats become available (zero seats to nonzero seats) and when seats become completely filled (nonzero seats to zero seats). All other changes are irrelevant. This method has the side effect of updating the Course table with the new number of seats regardless of whether any courses are returned. Parameters: user The User whose courses to check. Returns: An array containing Course instances to send notifications for. Author: Branden Ogata
[ { "docid": "e56e12b4a9ca0dbd8bb2142a1c5fff10", "score": "0.7464529", "text": "def courses_to_email(user)\n courses = []\n \n # For each course that the user is tracking\n Tracking.where(user_id: user.id).each do |t|\n course = Course.find(t.course_id)\n seats = course.seats\n \n # Check the UH Course Availability site for an updated seat count\n url = \"https://www.sis.hawaii.edu/uhdad/avail.classes?i=MAN&t=201430&s=#{course.name[0..course.name.index(' ')]}\"\n page = Nokogiri::HTML(open(url)).css('table.listOfClasses')\n \n match = page.css(\"tr\").select {|tr| tr.content.include?(course.name) &&\n tr.content.include?(\"%03d\" % course.section)}.first\n current_seats = match.css(\"td\")[7].text.to_i\n puts \"Course #{course.name + '-' + (\"%03d\" % course.section)}: #{seats} seats to #{current_seats} seats\"\n \n # If transition between zero and non-zero, then send email\n if (seats != current_seats) && ((seats == 0) || (current_seats == 0))\n courses.push course\n end\n \n # Update the Course in the database\n course.seats = current_seats.to_i\n course.save\n end\n \n puts \"Courses: #{courses}\"\n return courses\n end", "title": "" } ]
[ { "docid": "a3c376790b9c47d93468c2e0d9129b2d", "score": "0.59762615", "text": "def add_to_waiting_list(user, course)\n\t\t#Checks for available seats and adds students to waiting list if seats are filled\n\t\t#Else registers them for the course\n\t\tcourse.users << user\n\t\tif course.seats <= course.users.count \n\t\t\tregistration = course.registrations.where(:user_id => u.id)\n\t\t\tregistration.first.update_attribute(:wl, true)\n\t\tend\n\tend", "title": "" }, { "docid": "82f36e1c6aa4d668fd058cb531951353", "score": "0.572863", "text": "def counselor_unread_chats(user)\n return unless user.receive_notification\n @user = user\n mail to: user.email, subject: \"Summarize unread chats\"\n end", "title": "" }, { "docid": "afe1dfdd94a2cf6dcad46c4a46b68e20", "score": "0.5414835", "text": "def process_courses(user)\n # A user can manage a CourseOffering if they are enrolled in that\n # offering and have a CourseRole where can_manage_course? is true.\n\n can :read, CourseOffering, user.course_offerings do |offering|\n true\n end\n\n can :manage, CourseOffering, user.managing_course_offerings do |offering|\n true\n end\n\n # Likewise, a user can only manage enrollments in a CourseOffering\n # that they have can_manage_courses? permission in.\n can :manage, CourseEnrollment do |enrollment|\n user_enrollment = CourseEnrollment.where(\n user_id: user.id,\n course_offering_id: enrollment.course_offering.id).first\n\n user_enrollment && user_enrollment.course_role.can_manage_course?\n end\n end", "title": "" }, { "docid": "254b731a2a1dbdca68009b727c77e4b9", "score": "0.5408354", "text": "def process_courses(user)\n if !user.global_role.can_edit_system_configuration? &&\n !user.global_role.can_manage_all_courses?\n\n # Everyone can manage their own course enrollments\n can :manage, CourseEnrollment, user_id: user.id\n\n can :enroll, CourseOffering, self_enrollment_allowed: true\n\n can :unenroll, CourseOffering\n\n # A user can manage a CourseOffering if they are enrolled in that\n # offering and have a CourseRole where can_manage_course? is true.\n can [:edit, :update], CourseOffering,\n CourseOffering.managed_by_user(user) do |co|\n co.is_manager? user\n end\n\n # A user can grade a CourseOffering if they are enrolled in that\n # offering and have a CourseRole where can_grade_submissions? is true.\n can :generate_gradebook, CourseOffering do |co|\n co.is_staff? user\n end\n\n # Likewise, a user can only manage enrollments in a CourseOffering\n # that they have can_manage_courses? permission in.\n can :manage, CourseEnrollment do |enrollment|\n enrollment.course_offering.is_manager? user\n end\n end\n end", "title": "" }, { "docid": "bdf9a7e0fc8ab4e6960da9d063738eb2", "score": "0.5390211", "text": "def infer_courses_from_user\n return [] if user.blank?\n user.courses.where('start <= ?', date).where('end >= ?', date)\n end", "title": "" }, { "docid": "9c1ed4a24f8677a389d214b92c9ca947", "score": "0.5355881", "text": "def course_for_user(u)\n if u and users.include?(u) and feedbacks.find_by_user_id(u.id)\n courses.find feedbacks.find_by_user_id(u.id).course_ids\n end\n end", "title": "" }, { "docid": "2064d1ca1ffbe7e3b4e7176ee37e3689", "score": "0.52441716", "text": "def subscriptions_for(user_id)\n subs = []\n @subscriptors.each do |key, s|\n subs.push key if s[:user_id] == user_id\n end\n return subs\n end", "title": "" }, { "docid": "602f99485ee4cc509439f31c4982e9f9", "score": "0.51948345", "text": "def course_list_of_ta(user)\n\t\tcourse_list = []\n\t\tuser.tacourses.each do |each_ta_course|\n\t\t\tcourse_list << each_ta_course.id\n\t\tend\n\t\treturn course_list\n\tend", "title": "" }, { "docid": "4704920a371c3e2c3f180e87314ec691", "score": "0.5168265", "text": "def email_course(notification)\n course_users = notification.course.course_users.includes(:user)\n course_users.each do |course_user|\n @pending_emails <<\n ConsolidatedOpeningReminderMailer.email(recipient: course_user.user,\n notification: notification,\n view_path: notification_view_path(notification),\n layout_path: 'no_greeting_mailer')\n end\n end", "title": "" }, { "docid": "f4c038fb7d2ed042afc8fbd24857438e", "score": "0.5164443", "text": "def email_course(notification)\n notification.course.users.each do |user|\n @pending_emails << ActivityMailer.email(recipient: user, notification: notification,\n view_path: notification_view_path(notification))\n end\n end", "title": "" }, { "docid": "fbbfae125f229ea29f82c3190456e83d", "score": "0.514019", "text": "def seats_available\n maximum_seats - EnrolledCourse.where(course_id: id).count\n end", "title": "" }, { "docid": "aa0823a60c947224984183ce30301521", "score": "0.51290363", "text": "def email_course(notification)\n notification.course.users.each do |user|\n @pending_emails << ActivityMailer.email(recipient: user,\n notification: notification,\n view_path: notification_view_path(notification),\n layout_path: 'no_greeting_mailer')\n end\n end", "title": "" }, { "docid": "940c521519e0d471d10d8e30671f90f2", "score": "0.5125774", "text": "def notify_email(user, courses)\n \t@user = user\n \t@courses = courses\n \tmail(to: @user.email, subject: \"Notification Test\") if [email protected]?\n end", "title": "" }, { "docid": "062595c464d8f580fc5b19f29b3aa695", "score": "0.5007633", "text": "def refresh_for(user)\n future_intervals = future_intervals_for_user(user)\n\n if future_intervals.length > 0\n intervals_to_keep = []\n period_to_remove = []\n existing_periods = user.future_critical_periods.all.to_a\n existing_periods.each do |existing|\n existing_interval = { from: existing.from, to: existing.to }\n if future_intervals.include?(existing_interval)\n intervals_to_keep.push(existing_interval)\n else\n period_to_remove.push(existing)\n end\n end\n intervals_to_create = future_intervals - intervals_to_keep\n\n period_to_remove.each { |existing_period| existing_period.delete }\n intervals_to_create.each { |data| user.future_critical_periods.create!(data) }\n\n @notification_builder.rebuild_for(user)\n true\n else\n user.future_critical_periods.delete_all\n false\n end\n end", "title": "" }, { "docid": "41f57188abc93114a12736a1e91da57b", "score": "0.49481475", "text": "def get_channel_last_viewed(user)\n self.subscriptions.where(:user_id => user.id).map(&:last_viewed)\n end", "title": "" }, { "docid": "578f005716ffbf812ce468340472d027", "score": "0.48906666", "text": "def pending_surveys(user_course)\n if user_course.is_student?\n self.surveys.where(\"open_at < ? and expire_at > ? and publish = 1\", Time.now, Time.now).select {|s| !s.submission_by(user_course) }\n else\n []\n end\n end", "title": "" }, { "docid": "be3a4dba2c61bcd6959d57c1d76ca79a", "score": "0.48790747", "text": "def courses\n store_location\n @user = User.find(params[:id])\n @courses = @user.courses #Course.where(user_id: params[:id])\n end", "title": "" }, { "docid": "8a0dc7d53720ec91503e4453ce72b56b", "score": "0.48715627", "text": "def channels_for_time(time = Time.now)\n user_schedule.inject([]) do |channels, schedule|\n if time.between?(schedule[:start_time], schedule[:end_time])\n channels << [ schedule[:channel], schedule[:end_time] ]\n end\n channels\n end\n end", "title": "" }, { "docid": "cbec81ed08a509b8c820dba7df508c9e", "score": "0.48590988", "text": "def list_of_commmessages_for_user(user_id,opts={})\n query_param_keys = [\n :user_id,\n :start_time,\n :end_time\n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"user_id is required\" if user_id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :user_id => user_id\n )\n\n # resource path\n path = path_replace(\"/v1/comm_messages\",\n )\n headers = nil\n form_params = select_params(options, form_param_keys)\n query_params = select_query_params(options, query_param_keys)\n\n RemoteCollection.new(connection, CommMessage, path, query_params)\n \n end", "title": "" }, { "docid": "9ea2899704f7073144157750580c4a68", "score": "0.48029467", "text": "def new_statuses_allowed_to(user)\n statuses = status.find_new_statuses_allowed_to(user.roles_for_project(project), @cm_change_tracker)\n statuses << status unless statuses.empty?\n statuses = statuses.uniq.sort\n blocked? ? statuses.reject {|s| s.is_closed?} : statuses\n end", "title": "" }, { "docid": "aebc06fab0bb99e066933cc6c32e20bd", "score": "0.4789797", "text": "def attendee_invitations_for_user(user)\n @attendees_user_unaccepted = Attendee.where(user: user, accepted: false)\n @attendees_user_invitations = []\n @attendees_user_unaccepted.each do |attendee|\n if attendee.booking.open\n @attendees_user_invitations << attendee\n end\n end\n return @attendees_user_invitations\n end", "title": "" }, { "docid": "636e234e85a491e710a02d4e311fd457", "score": "0.47837427", "text": "def users_to_notify\n [user]\n end", "title": "" }, { "docid": "1760b513e761ed8c3e8234928d649fb0", "score": "0.47655743", "text": "def active_course_for(user)\n # We want an exact match, so we put the name between ^ and $\n courses = Courses.search_by_students(\"^#{user.login_name}$\")\n if courses\n dputs(3) { \"Courses : #{courses.inspect}\" }\n courses.each { |c|\n dputs(3) { \"Searching course #{c}\" }\n if c.name and c.start and c.end\n dputs(3) { \"Searching course for #{user.full_name}\" }\n dputs(3) { [c.name, c.start, c.end].inspect }\n begin\n c_start = Date.strptime(c.start, '%d.%m.%Y')\n c_end = Date.strptime(c.end, '%d.%m.%Y')\n rescue\n c_start = c_end = Date.new\n end\n if c_start <= Date.today and Date.today <= c_end\n return true\n end\n end\n }\n end\n return false\n end", "title": "" }, { "docid": "31900cd316b9f728a0533e88437b50bb", "score": "0.4762558", "text": "def achievements_obtained(user)\n user_achievements = UserAchievement.where(:sport_session_id => self.id, :user_id => user.id)\n achievements = user_achievements.map { |user_achievement| user_achievement.achievement }\n end", "title": "" }, { "docid": "7edfcac8fbb257d2a6b88f9b47b16274", "score": "0.47507298", "text": "def new_statuses_allowed_to(user)\n statuses = status.find_new_statuses_allowed_to(user.roles_for_project(project), @cm_item_tracker)\n statuses << status unless statuses.empty?\n statuses = statuses.uniq.sort\n blocked? ? statuses.reject {|s| s.is_closed?} : statuses\n end", "title": "" }, { "docid": "3bf816c7be22ad3197f51af14e2a57d8", "score": "0.4748777", "text": "def user_deliveries_completed(user)\n rArr = []\n user.deliveries.each do | sel |\n if sel.delivered == true\n rArr << sel\n end\n end\n if rArr.length == 0\n return nil\n else\n return rArr\n end\n end", "title": "" }, { "docid": "5a19e8ea1f085f8b4fe7b66852c0c2b6", "score": "0.47439268", "text": "def get_private_channel(user)\n @users.keys\n .map { |channel| @channels[channel] }\n .compact\n .find { |channel| channel.private }\n # the server doesn't send PMs you don't have access to\n end", "title": "" }, { "docid": "8941f13cb5bc41f9bfd0114d76e1ed4a", "score": "0.4741549", "text": "def create_notifications\n notifications = []\n User.find_each do |u|\n notifications << Notification.new(recipient: u,\n notifiable_id: @course.id,\n notifiable_type: 'Course',\n action: 'create')\n end\n Notification.import notifications\n end", "title": "" }, { "docid": "d0c3ba8ea926302c039a1794da5d9649", "score": "0.47392148", "text": "def send_messages(users)\n logger.info \"Gathering all users\"\n users.each do |u|\n logger.info \"Starting algorithm for user_id: #{u.id}\"\n logger.info \"Finding User's courses\"\n user_courses = findUserActiveCourse(u.id) # Get the Course(s) that the user is subscribed to(returns array)\n user_courses.each do |uc|\n logger.info \"Course found. Course_id: #{uc.course_id}\"\n logger.info \"Finding lessons that the user has completed for this course\"\n user_lesson_completions = findUserLessonCompletions(u.id, uc.course_id) #Get the Lessons that the user has completed\n # If the User has not yet started on the course,\n # then send the first lesson of the first\n # subject on that course\n if user_lesson_completions.empty?\n logger.info \"User has not completed any lessons for this course\"\n logger.info \"Sending the first lesson of the first subject\"\n subject_matter = Course.find(uc.course_id).subject_matters.first_active\n if subject_matter.present?\n lesson = SubjectMatter.find(subject_matter.id).lesson.first_active\n logger.info \"Sending lesson #{lesson.name} for subject: #{lesson.subject_matter.name}\"\n CalculateLessonTranslationsWorker.perform_async(u.id,lesson.id)\n else\n logger.info \"There are no subjects assigned to this course\"\n end\n else\n last_lesson_sent = LessonCompletion.where(:user_id => u.id, :course_id => uc.course_id).order('created_at desc').first\n # If the last lesson that was sent is not the last \n # lesson in the subject, then send the next\n # lesson, otherwise proceed to next check\n if last_lesson_sent.lesson.next.present?\n logger.info \"Sending the next lesson in the subject\"\n lesson = last_lesson_sent.lesson.next\n logger.info \"Sending lesson #{lesson.name} for subject: #{lesson.subject_matter.name}\"\n CalculateLessonTranslationsWorker.perform_async(u.id,lesson.id)\n else \n # If the last lesson sent was the last lesson in the\n # subject, then move on to the next subject's\n # first lesson\n if last_lesson_sent.subject_matter.next.present?\n logger.info \"Starting the next subject on this course for this user: #{u.id}\"\n lesson = last_lesson_sent.subject_matter.next.lesson.first_active\n logger.info \"Sending lesson #{lesson.name} for subject: #{lesson.subject_matter.name}\"\n CalculateLessonTranslationsWorker.perform_async(u.id,lesson.id)\n else\n logger.info \"Course has been completed by the user\"\n user_course = UserCourse.find(uc.id)\n user_course.is_complete = true\n user_course.save\n end\n end\n end\n end\n logger.info \"Finished sending messages\"\n end\n end", "title": "" }, { "docid": "398596decaf876a39988a457908eff9f", "score": "0.47282475", "text": "def retrieve_channels(user_id)\n return Channel.find(:all, :conditions => [\"user_id = ?\", user_id])\n end", "title": "" }, { "docid": "3bfa5cfac237163ed08afa748fc11946", "score": "0.4724538", "text": "def only(user)\n self.receiver = [user]\n end", "title": "" }, { "docid": "844c817b4ca02b643e58bcf2ee1d6532", "score": "0.47194374", "text": "def notify_course_staff(course, course_user)\n Course::Mailer.user_registered_email(course, course_user).deliver_later\n true\n end", "title": "" }, { "docid": "e51c7512f6e80991ed725c1ad23af2da", "score": "0.4706117", "text": "def get_invitation(user)\n\t\tschedule = []\n\n\t\tmeeting_participations = user.meeting_participations.joins(:meeting)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .where(response_status: MeetingParticipation::Response_statuses[:pending])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t .order('meetings.start_date')\n\t\tcurrent_day = nil\n\n\t\tmeeting_participations.each do |mp|\n\t\t\tif current_day.nil? || (mp.meeting.start_date.midnight != current_day)\n\t\t\t\t# Change the current day\n\t\t\t\tcurrent_day = mp.meeting.start_date.midnight\n\t\t\t\tschedule.push current_day\n\t\t\tend\n\t\t\tschedule.push mp.meeting # maybe push also response status??\n\t\tend\n\t\tschedule\n\tend", "title": "" }, { "docid": "8b1d17348d1e9bf96706102f62ba5631", "score": "0.47005317", "text": "def create\n @user = User.where(:user_id => user_params[:user_id]).first\n @course = Course.find(params[\"user\"][\"course_id\"])\n\n respond_to do |format|\n if @user and [email protected]? @user\n @course.users << @user\n format.html { redirect_to @user, notice: 'User was successfully added.' }\n else\n if @course.users.include? @user\n flash.now[:error] = \"User with ID: #{user_params[:user_id]} already enrolled in this class!\"\n else\n flash.now[:error] = \"User with ID: #{user_params[:user_id]} does not exist!\"\n end\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "a12c5a0fad48f3bb91cbf7efa240e222", "score": "0.46869093", "text": "def open_course_override(user)\n user_row = all_users.detect { |item| item.text.include? user }\n sleep 5 #Wait for the elements\n begin\n if user_row.visible?\n link = user_row.find_link('1 Course')\n if link.nil? && !link.visible?\n raise \"No link for courses found with #{link.text}\"\n else\n if link.visible?\n link.click\n true\n else\n refresh_browser unless flash_notice.visible?\n link.click if link.visible?\n true\n end\n end\n end\n rescue Capybara::ElementNotFound\n false\n end\n end", "title": "" }, { "docid": "c25a5880035602c221fe3bb3676b1244", "score": "0.46838441", "text": "def user_deliveries_pending(user)\n if (user.deliveries == [])\n return nil\n end\n rArr = []\n user.deliveries.each do | sel |\n if (sel.delivered == false || sel.delivered == nil)\n rArr << sel\n end\n end\n return rArr\n end", "title": "" }, { "docid": "be22825ef8afc5bac8f3c54f769f150d", "score": "0.46720678", "text": "def credits_about_to_expire(user)\n subject \"You have credits about to expire\"\n recipients user.email\n from APP_CONFIG[CONFIG_ADMIN_EMAIL]\n\n body :user => user,\n :url => login_url(url_options)\n end", "title": "" }, { "docid": "280eaffb75c49a4616776981ca19bb86", "score": "0.46681857", "text": "def remove_user_from_course(course, user)\n logger.info \"Removing #{user.role} UID #{user.uid} from course site ID #{course.site_id}\"\n load_users_page course\n hide_canvas_footer\n wait_for_user user\n wait_for_update_and_click link_element(xpath: \"//tr[@id='user_#{user.canvas_id}']//a[contains(@class,'al-trigger')]\")\n confirm(true) { wait_for_update_and_click link_element(xpath: \"//tr[@id='user_#{user.canvas_id}']//a[@data-event='removeFromCourse']\") }\n remove_user_success_element.when_visible Utils.short_wait\n end", "title": "" }, { "docid": "20a4e8d835069a606175f9ef972fbb4a", "score": "0.46645588", "text": "def future_intervals_for_user(user)\n future_intervals = []\n periods = user.critical_periods.order_by(:from => 'desc').limit(@to_consider).all.to_a\n if periods.length > 0\n average_period_values = average_period_values(periods)\n average_cycle = average_period_values[:average_cycle]\n average_length = average_period_values[:average_length]\n\n future_period_from = periods[0].from\n @to_predict.times do ||\n future_period_from = future_period_from + average_cycle.days\n future_period_to = future_period_from + average_length.days\n future_intervals.push(from: future_period_from, to: future_period_to)\n end\n end\n future_intervals\n end", "title": "" }, { "docid": "301743bb589a8fe690f637f21a801d5d", "score": "0.46574733", "text": "def get_courses_to_schedule(action)\n # courses which begins between the busy time\n clash_start = Schedule.all(\n :conditions => {\n :room_id => action.busy_room.id,\n :new_start => action.busy_start..action.busy_end-1\n }\n ).map(&:course_id)\n # courses which ends between the busy time\n clash_end = Schedule.all(\n :conditions => {\n :room_id => action.busy_room.id,\n :new_end => action.busy_start+1..action.busy_end\n }\n ).map(&:course_id)\n \tclash_start | clash_end # OR conjunction, return value\n end", "title": "" }, { "docid": "c69fc5aad3feb5d7aff7bad00cb331e7", "score": "0.46497598", "text": "def unread_count_for(user)\n user.conversations.select { |c| !c.read_by? user }.count\n end", "title": "" }, { "docid": "2c3c699f17862f99609079f1f163e51b", "score": "0.46475247", "text": "def mark_all_user_notifications_as_read(user)\n # update_all is a direct SQL request. It does no go through callbacks\n user.notifications.unread.update_all(read: true, read_at: Time.now)\n end", "title": "" }, { "docid": "146579f12e8ae7088feee2e89a2c330a", "score": "0.46426582", "text": "def list_user_communication_channels(user_id,opts={})\n query_param_keys = [\n \n ]\n\n form_param_keys = [\n \n ]\n\n # verify existence of params\n raise \"user_id is required\" if user_id.nil?\n # set default values and merge with input\n options = underscored_merge_opts(opts,\n :user_id => user_id\n )\n\n # resource path\n path = path_replace(\"/v1/users/{user_id}/communication_channels\",\n :user_id => user_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 RemoteCollection.new(connection, CommunicationChannel, path, query_params)\n \n end", "title": "" }, { "docid": "f27d4d5e5df70c5157125bbfc85bb077", "score": "0.46307826", "text": "def update\n @user = User.find(params[:id])\n @user.name = params[:user][:name]\n @user.email = params[:user][:email]\n @user.is_admin = params[:user][:is_admin]\n @user.is_registrar = params[:user][:is_registrar]\n @courses = Course.where(:id => params[:user][:course_ids])\n #we destroy the users courses before adding the new ones\n @user.courses.destroy_all\n @user.courses << @courses\n respond_to do |format|\n if @user.save()\n format.html { redirect_to users_path}\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": "9d4ffef353c68d985eed6dc10daee153", "score": "0.46219546", "text": "def subscriptions\n user_s = Subscription.select(:discussion_id).where(:user_id => id)\n user_s.map {|s| s.discussion_id}\n end", "title": "" }, { "docid": "115c141d304791128fd6bc237b7f70bb", "score": "0.4619537", "text": "def getcourseswithusers\n coursearr = Array.new;\n res = Hash.new\n apikey = request.headers[\"apikey\"]\n if apikey != nil\n user = User.where(apikey: apikey ).take\n if user!=nil\n @course = Course.all\n res[:status] =\"OK\"\n res[:total] = @course.count\n @course.each do |cs|\n c = Hash.new\n c[:course_id] = cs.id\n c[:course_name] = cs.course_name\n c[:total] = 0\n c[:course_users] = Hash.new\n c[:course_users][:users] = cs.apiusers\n c[:total] = cs.apiusers.count\n # p cs.apiusers\n coursearr.push(c)\n end\n res[:courses] = coursearr\n else\n res[:status] = \"fail\"\n res[:message] = \"No such user find.\"\n end \n else\n res[:status] = \"Fail\"\n res[:message] = \"ApiKey Missing.\"\n end\n render json: res;\n end", "title": "" }, { "docid": "33ae9b086a72d821af7d8f8d43987af9", "score": "0.4615688", "text": "def index\n\t\t@user_courses = UserCourse.includes(:user, :course).all\n\tend", "title": "" }, { "docid": "380114738a0b6123d06c8010f37bb9bf", "score": "0.45922884", "text": "def assignments_for(user)\n assignments.by_deadline.select { |a| a.can_read_schedule? user }\n end", "title": "" }, { "docid": "7f9adca9e2fd2e422deacb14b19a05c6", "score": "0.4586624", "text": "def get_user_courses\n\n @user = User.find(:first, :conditions => {'email' => params[:email]})\n if [email protected]?\n @usercourses = UserCourse.find(:all, :conditions => { 'user_id' => @user.id })\n\n @courses = []\n @usercourses.each do |uc|\n\t@courses << Course.find(uc.course_id)\n end\n else\n \t@courses = []\n\n end\n\n respond_to do |format|\n format.xml { render :xml => @courses }\n end\n\nend", "title": "" }, { "docid": "7899c404ed3a80d24470d347b0562b35", "score": "0.45865062", "text": "def authorized_critical_processes(user)\n critical_processes = []\n\n self.critical_processes.uniq_by { |x| x.cp_secondary_id }.each do |x|\n cps = CriticalProcess.where(:cp_secondary_id => x.cp_secondary_id)\n if user.has_access_to(cps.first) || user.is_admin\n cps = cps.sort { |x, y| y.updated_at <=> x.updated_at }\n else\n cps = cps.select { |x| x.review.stage == 'approved' if x.review && x.review.stage }\n cps = cps.sort { |x, y| y.updated_at <=> x.updated_at }\n end\n critical_processes << cps.first unless cps.blank?\n end\n critical_processes\n end", "title": "" }, { "docid": "04e70360337f990930a19029857e1c76", "score": "0.45804113", "text": "def all_courses\n courses = self.courses.to_a\n self.leaderships.each do |leadership|\n courses << leadership.course unless courses.include?(leadership.course)\n end\n return courses\n end", "title": "" }, { "docid": "45a1111849c99859fef915ef62a7702a", "score": "0.4576773", "text": "def existing_enrolment(user)\n if user.kind_of?(User)\n enrolments.where('student_user_id = ? AND scheduled_course_id = ? AND DATE(end_date) >= DATE(?) AND unsubscribe = (?) ', user.id, scheduled_course.id, Time.zone.now.end_of_day, false).first\n else\n nil\n end\n end", "title": "" }, { "docid": "60c7f70ba1f51b50d603bd8f1e760faf", "score": "0.4576472", "text": "def pending_user_on_course(teachers, user, course, network)\n headers[\"X-SMTPAPI\"] = '{\"category\": \"pending user on course\"}'\n @user = user\n @course = course\n @subdomain = network.subdomain\n\n mail to: teachers.all.map(&:email).join(\", \")\n end", "title": "" }, { "docid": "4ba448d40711c4afefe59ed555e4dfee", "score": "0.45536983", "text": "def acknowledge(user)\n assert is_valid?\n assert user.is_a? String\n\n num_acks = 0\n\n @lobby.each do |user_info|\n if user == user_info[\"username\"]\n user_info[\"ack\"] = true\n end\n\n if user_info[\"ack\"]\n num_acks += 1\n end\n end\n\n if num_acks == @lobby.size\n return true\n end\n\n return false\n end", "title": "" }, { "docid": "397aad3a30c8f613fb73e826ca8782b5", "score": "0.45426968", "text": "def request_course_users\n all_users = []\n params = \"include[]=enrollments&per_page=100\"\n while params do\n response = request_uncached \"#{request_path}?#{params}\"\n break unless (response && response.status == 200 && users_list = safe_json(response.body))\n all_users.concat(users_list)\n\n if @paging_callback.present?\n parsed_link_header = LinkHeader.parse(response['link'])\n last_link = parsed_link_header.find_link(['rel', 'last']).href\n current_link = parsed_link_header.find_link(['rel', 'current']).href\n current_page_number = /\\bpage=([0-9]+)/.match(current_link)[1]\n last_page_number = /\\bpage=([0-9]+)/.match(last_link)[1]\n @paging_callback.background_job_set_total_steps(last_page_number)\n @paging_callback.background_job_complete_step(\"Retrieving Canvas Course Users - Page #{current_page_number} of #{last_page_number}\")\n end\n\n params = next_page_params(response)\n end\n all_users\n end", "title": "" }, { "docid": "5ba0bebea070b40595336e49b324793e", "score": "0.45334703", "text": "def set_user_channels\n @user_channels = UserChannel.where(user_id: params[:user_id]).order(:id)\n end", "title": "" }, { "docid": "20b630eac516e91aec62a59503b25075", "score": "0.45321074", "text": "def find_free_slots(users_string, meeting_start_date)\n #Split the incoming array of user ID into an array.\n users = users_string.split(\",\")\n #Add the ID of the logged in user to the end of the array.\n users << session[:user_id]\n session[:users_for_meeting] = users\n @invited_users = users\n \n #Create an empty array to store the free slots.\n free_slots_array = []\n \n #Set up an array of binary numbers, representing times between 9:00 and 18:00\n #Assume all users are free, so assign 1 to each slot, 0 means 1 or more user is \n #not available to meet in that slot.\n slots_which_suit_all = [1,1,1,1,1,1,1,1,1]\n \n user_num = 0 #Used as a counter to fill free_slot_array, 1 entry of array for each user\n \n users.each do |user|\n free_slots_array[user_num] = []\n timeslot = 0\n \n for i in 9..17 #Check each hour from 9:00 to 17:00\n if(is_available(user,meeting_start_date,i))\n #User is available at hour i, so insert 1 into relevant slot of array\n free_slots_array[user_num][timeslot] = 1\n else\n #User is busy at hour i so insert 0 into relevant slot of array\n free_slots_array[user_num][timeslot] = 0\n end\n \n timeslot+=1\n end\n user_num += 1\n end\n \n #Combine all users free slots together using the & operator.\n free_slots_array.each do |free_slots|\n for j in 0..8\n slots_which_suit_all[j] &= free_slots[j]\n end\n end\n \n #Convert array of bits showing free/busy into corresponding array of DateTimes \n suitable_times = []\n index = 0\n \n for x in 9..17 #Check each hour from 9:00 to 17:00\n if(slots_which_suit_all[index] == 1)\n suitable_times << \"#{meeting_start_date} #{x}:00:00\".to_datetime\n end\n index+=1\n end\n\n return suitable_times\n end", "title": "" }, { "docid": "d8b25b803dbad82190dbe73eeeb1f9bc", "score": "0.45309353", "text": "def get_inconsistent_meetings(user)\n\t\tlist_of_all_inconsistencies = []\n\n\t\tinconsistent_mp = user.meeting_participations.joins(:meeting)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.where(is_consistent: false)\n\t\t\t\t\t\t\t\t\t\t\t\t\t.where.not(response_status: MeetingParticipation::Response_statuses[:declined])\n\t\t\t\t\t\t\t\t\t\t\t\t\t.order('meetings.start_date')\n\n\t\tcurrent_day = nil\n\t\tinconsistent_mp.each do |mp|\n\n\t\t\talready_present = false\n\t\t\tlist_of_all_inconsistencies.each do |single_group|\n\n\t\t\t\tbegin\n\t\t\t\t\tif single_group.include? mp\n\t\t\t\t\t\talready_present = true\n\t\t\t\t\t\tbreak\n\t\t\t\t\tend\n\t\t\t\trescue NoMethodError\n\t\t\t\t\tnext\n\t\t\t\tend\n\t\t\tend\n\t\t\tif already_present\n\t\t\t\tnext\n\t\t\tend\n\n\t\t\tif current_day.nil? || (mp.meeting.start_date.midnight != current_day)\n\t\t\t\t# Change the current day\n\t\t\t\tcurrent_day = mp.meeting.start_date.midnight\n\t\t\t\tlist_of_all_inconsistencies.push current_day\n\t\t\tend\n\t\t\tsingle_group = [mp]\n\t\t\tsingle_group = fill_inconsistency(mp, single_group)\n\t\t\tlist_of_all_inconsistencies.push single_group\n\t\tend\n\t\treturn list_of_all_inconsistencies\n\tend", "title": "" }, { "docid": "69a6adc84ef4402d4e011d55df59ea6c", "score": "0.4530776", "text": "def index\n @chats = Chat.where('user_1_id = ? or user_2_id = ?', current_user.id, current_user.id)\n\n blocked_user_ids = current_user.blocked_users.select(:blocked_user_id)\n @chats = @chats.where.not(:user_1_id => blocked_user_ids)\n @chats = @chats.where.not(:user_2_id => blocked_user_ids)\n\n render json: @chats\n end", "title": "" }, { "docid": "112e9667f092ee63db755b24c0afb735", "score": "0.45217004", "text": "def bookings_open_for_user(user)\n bookings_open = []\n # All Attendees for User where User has accepted:\n attendees_user_accepted = Attendee.where(user: user, accepted: true)\n\n if attendees_user_accepted.count != 0\n # Create array of Bookings if Booking for that restaurant and Booking open\n attendees_user_accepted.each do |attendee|\n if attendee.booking.open == true\n bookings_open << attendee.booking\n end\n end\n end\n return bookings_open\n end", "title": "" }, { "docid": "63511f2c9f845a9d18147b2062f881a1", "score": "0.45178938", "text": "def evaluate(course_user)\n @course_user = course_user\n @course = course_user.course\n\n update_conditions(satisfiability_graph.evaluate(@course_user))\n end", "title": "" }, { "docid": "8eb5cfa0a9f783570668d0916900038f", "score": "0.45172596", "text": "def for_user(user)\n events.select { |event| event.planned_for_user?(user) }\n end", "title": "" }, { "docid": "d4b45703654db303018463885c643bc7", "score": "0.45139065", "text": "def other_participants_than(user)\n relation = Userconversation.where(:conversation_id => self.id.to_s)\n participants = Array.new\n relation.each do |rel|\n if user != rel.user\n participants << rel.user\n end\n end\n return participants\n end", "title": "" }, { "docid": "da0268b0ef0b7ae9ce2b9f9fcd17625e", "score": "0.45053613", "text": "def send_new_proposal_notifier_email(user)\n \tuser.each do |u|\n \t\t@user = u\n\t mail( :to => u.email,\n\t :subject => \"My friend recommended you.\" )\n\tend\n end", "title": "" }, { "docid": "736c16f3ae4944fba84419afaaa1dc11", "score": "0.45027268", "text": "def update_course_user(course_user_params)\n course_user_requested = @course_user.requested?\n result = @course_user.update(course_user_params)\n if course_user_requested && @course_user.approved?\n Course::Mailer.user_added_email(current_course, @course_user).deliver_later\n end\n\n result\n end", "title": "" }, { "docid": "2fcd99413aa2853c56d00486997eec78", "score": "0.4495313", "text": "def compile_watchlist(user)\n w = Watchlist.find_all_by_user_id(user)\n return w.map {|x| x.player_id }\n end", "title": "" }, { "docid": "e07af5df34f413c17d50bfdda7dd37c6", "score": "0.44909763", "text": "def channels_with_user nick\n @channels.select { |channel| channel.user_by_nick nick }\n end", "title": "" }, { "docid": "e07af5df34f413c17d50bfdda7dd37c6", "score": "0.44909763", "text": "def channels_with_user nick\n @channels.select { |channel| channel.user_by_nick nick }\n end", "title": "" }, { "docid": "134477f69d91fac4588902d34e5b90ce", "score": "0.44907", "text": "def notifications\n Notification.where(user_type: 'Student', user_id: self.id)\n end", "title": "" }, { "docid": "e31332e0ab26d9a3932ef95b3fa494b8", "score": "0.44699335", "text": "def create\n @course = Course.new(course_params)\n @course.users << current_user\n \n\n respond_to do |format|\n if @course.save\n format.html { redirect_to root_url, notice: 'course was successfully created.' } \n else\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "8c45e4be11a97a684c2461b6652e2cac", "score": "0.4469907", "text": "def index\n @courses = Course.where(user_id: current_user.id)\n end", "title": "" }, { "docid": "9c8bdded327703a9c448d3c2feef5c64", "score": "0.44689178", "text": "def get_user_subscriptions\n self.subscriptions(User.name).joins(\" INNER JOIN users u on u.id=\\\n d360_core_subscribes.content_id\").where(\"u.status = true\")\n end", "title": "" }, { "docid": "17f6e66a6fd430a4d274bb60d4e44fc1", "score": "0.44673425", "text": "def notify!(users)\n Array(users).select do |user|\n user.notify!(self)\n end\n end", "title": "" }, { "docid": "07077f9e8bce2f35c61d97683b154ec5", "score": "0.44660205", "text": "def subscribe_course\n \n\t@course = Course.find(:first, :conditions => {'initials' => params[:course]})\n \t@user = User.find(:first, :conditions => {'email' => params[:email]})\n\n\texisting = UserCourse.find(:first, :conditions => {'user_id' => @user.id, 'course_id' => @course.id})\n\t#Add the ascociation only if it does not exist yet\n\tif existing.nil?\n\t\t@assoc = UserCourse.new\n\t\[email protected]_id = @user.id\n\t\[email protected]_id = @course.id\n\t\[email protected]\n\tend\n\n\t@courses = Course.all\n\trender 'assocs'\nend", "title": "" }, { "docid": "9d154c68b6f47f10f8e355d4325ca92e", "score": "0.44532573", "text": "def full_chat_with(user)\n outgoing = sent_messages.includes(:message_recipient)\n .where(message_recipients: { recipient: user })\n incoming = received_messages.select { |m| m.creator_id == user.id }\n (outgoing + incoming).sort_by!(&:created_at)\n end", "title": "" }, { "docid": "d8bf3ef2c241c044c1edf84e1d2b2c50", "score": "0.44446027", "text": "def news(user)\n @user = user\n @action = \"Announcing the #{CONFIG[:name]} iPhone app. It's free!\"\n @source = \"email_iphone_app\"\n\n generate_attributes(@user,0,@user,EmailPurpose::News)\n\n recipients @user.email\n from EMAILS[:contact]\n subject @action\n end", "title": "" }, { "docid": "71fe35992dda7b375fe6f0c5ad80565c", "score": "0.44401172", "text": "def chats=(value)\n @chats = value\n end", "title": "" }, { "docid": "140f82b45198befef964d29d00bfe645", "score": "0.44330162", "text": "def messages_with(user)\n Message.where(\"(receiver_id = ? AND sender_id = ?)\n OR (receiver_id = ? AND sender_id = ?)\",\n user.id, id, id, user.id)\n end", "title": "" }, { "docid": "144ac8a2077dab4c97bd8604f53ccb3c", "score": "0.44303927", "text": "def seats\n @seats ||= seat_incumbencies.map(&:seat).flatten.uniq.compact\n end", "title": "" }, { "docid": "2394f63856de14b163516ad790bd017b", "score": "0.44297287", "text": "def get_user_subscription(user, sport)\n subscription = CoachClient::UserSubscription.new(self, user, sport)\n subscription.update\n end", "title": "" }, { "docid": "e3141146037bbb576c1f9450d0004dc9", "score": "0.44269323", "text": "def course_unique_for_each_user\n number = Register.where('course_id = ? and user_id = ?', course_id, user_id).length\n if(number == 1)\n errors.add(:course_id, \"is already registered.\")\n end\n end", "title": "" }, { "docid": "43e1d7796a83af65a9eaf833f5843090", "score": "0.4425978", "text": "def append(user)\n unless include?(user)\n u_id = user.id\n ot_usr = OtUser.new(u_id, user.nick, user.unique_id)\n @subscribers << ot_usr\n store.transaction do\n ot_list = store[u_id] ||= []\n ot_list << ot_usr\n end\n end\n end", "title": "" }, { "docid": "e0281e0299d181f276332523c976943c", "score": "0.4419409", "text": "def get_pt_messages_of_type type\n # We turn this into an array because otherwise it would return an ActiveRecord::ActiveRelation\n # that automagically updates the links that we're about to update, and since it maintains\n # the relation of seen:false, when we change it to seen:true below, this would return an\n # empty number of ActiveRelations!\n user_messages = self.pt_messages.where(deleted: false, seen: false, message_type: type).to_a\n # Now mark them all as read\n self.pt_messages.where(deleted: false, seen: false, message_type: type).update_all(seen: true)\n return user_messages\n end", "title": "" }, { "docid": "b6fd78e5c83e91faaf31f965853b74e9", "score": "0.44118273", "text": "def get_users\n update_users\n users = []\n self.day_slots.each do |slot|\n slot.semester_break_plan_connections.each do |con|\n if !con.user.inactive\n users << con.user\n elsif self.solution\n eval(self.solution).each do |slot|\n if slot[:user] == con.user.id\n users << con.user\n end\n end\n end\n end\n end\n users.uniq!\n users\n\n end", "title": "" }, { "docid": "0d2f8f0d4b734f6388c5c7636f093bb6", "score": "0.44078037", "text": "def unread_messages_count_for(user)\n speaker = find_speaker_by_user(user)\n messages.where(\"updated_at > ?\", speaker.updated_at ).where(\"user_id != ?\", speaker.id ).count\n end", "title": "" }, { "docid": "412ee45af67d4a7321d98ab1081a65f2", "score": "0.44022533", "text": "def list_check_notice(user)\n @user = user\n @contents = @user.lists.where(\"mylists.active IN (?)\", true).pluck(:content)\n mail to: user.email, subject: \"リストふりかえり通知\"\n end", "title": "" }, { "docid": "d78cdcef1be4037c50db22e28428b775", "score": "0.4401982", "text": "def user_defeats(user)\n # TODO: (?) add explicit \"never show this again\" option?\n recent_views = user.clicks\n .select(:notebook_id)\n .where('updated_at > ?', 30.days.ago)\n .distinct\n .map(&:notebook_id)\n owned = user.notebooks.map(&:id)\n created = user.notebooks_created.map(&:id)\n updated = user.notebooks_updated.map(&:id)\n stars = user.stars.map(&:id)\n Set.new(recent_views + owned + created + updated + stars)\n end", "title": "" }, { "docid": "b9fcec6df576714b4946412fffbdb16f", "score": "0.4401803", "text": "def client_left( user )\n @clients.delete( user )\n msg = \"\\\"#{user}\\\" no longer connected.\"\n self.logger( msg )\n self.process_msg( \"ChatServer\", msg )\n end", "title": "" }, { "docid": "336d3a570c385cb7e8026cf89414ba73", "score": "0.44009233", "text": "def tracking_email(user, course)\n\t\t@user = user\n\t\t@course = course\n\t\tmail(to: @user.email, subject: \"Now tracking #{@course.name + '-' +\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t (\"%03d\" % @course.section)}\")\n end", "title": "" }, { "docid": "6424464809886160270522bbf1751939", "score": "0.43966913", "text": "def user_added_email(course, user)\n @course = course\n @recipient = user.user\n\n mail(to: @recipient.email, subject: t('.subject', course: @course.title))\n end", "title": "" }, { "docid": "82dbee9c97a3770694067161b25c8036", "score": "0.43923837", "text": "def notify_users\n []\n end", "title": "" }, { "docid": "e1619cf7c2b4ec927b61fee684303e18", "score": "0.4383197", "text": "def invoke client, data\n return if data.presence != 'active'\n # handles both data.users and data.user in case of batched presence change events\n user_ids = data.users || [data.user]\n user_ids.each do |slack_id|\n deliver_unread_messages(client, slack_id)\n end\n end", "title": "" }, { "docid": "da3b9663cf5cbdee282db10c8a86dee3", "score": "0.43807238", "text": "def save(user)\n vals = to_h\n vals.delete(:user)\n vals.delete(:partnership)\n vals.delete(:sport)\n vals.delete_if { |_k, v| v.nil? || v.to_s.empty? }\n payload = Gyoku.xml(subscription: vals)\n response = CoachClient::Request.put(url, username: user.username,\n password: user.password,\n payload: payload,\n content_type: :xml)\n unless response.code == 200 || response.code == 201\n fail CoachClient::NotSaved.new(self), 'Could not save subscription'\n end\n self\n end", "title": "" }, { "docid": "2805a22bab3d94dcff5002150caf5241", "score": "0.43780562", "text": "def all_courses\n # Anyone can get data for nonprivate courses; only admins can private course data.\n @courses = current_user&.admin? ? Course.all : Course.nonprivate\n end", "title": "" }, { "docid": "77a28eb53dfc427309fe51c896cf690a", "score": "0.43756118", "text": "def existing_chats_users\n existing_chat_users = []\n self.chats.each do |chat|\n existing_chat_users.concat(chat.subscriptions.where.not(user_id: self.id)\n .map {|subscription| subscription.user})\n end \n existing_chat_users.uniq\n end", "title": "" }, { "docid": "0a2cefb86b48dcc365b8eb807b86c9d3", "score": "0.4375351", "text": "def existing_chats_users\n existing_chat_users = []\n\n self.chats.each do |chat|\n # Returns all chat subscriptions that are not to themselves\n user_subscription = chat.subscriptions.where.not(user_id: self.id)\n # Adds all the users available for chat beside self to existing_chat_user \n existing_chat_users.concat(\n user_subscription.map { |subscription| subscription.user }\n ) \n end\n\n # Returns only unique user chat instances\n existing_chat_users.uniq\n end", "title": "" }, { "docid": "e0314e1b1690f55416e949cbbff84044", "score": "0.43735924", "text": "def send_notifications(course_id, announcement)\n course = Course.find(course_id)\n\tmessage = \"(#{course.subjectCode}-#{course.courseNumber}) New #{announcement.atype} Posted: #{announcement.title} is Due On #{announcement.dueDate}\"\n\tlogger.debug message\n\t\n\t# Iterate through the users courses and send them the message\n course.users.each do |user|\n if user.phone and user.isStudent\n logger.debug \"Sending text to: #{user.phone}\"\n\t\t\tsend_text(user.phone, message)\n end\n end\nend", "title": "" }, { "docid": "59d4f125596ec3ed0fb4ff878ed27030", "score": "0.43730783", "text": "def create\n @user = User.new()\n @user.name = params[:user][:name]\n @user.email = params[:user][:email]\n @user.is_admin = params[:user][:is_admin]\n @user.is_registrar = params[:user][:is_registrar]\n @courses = Course.where(:id => params[:user][:course_ids])\n @user.courses << @courses\n respond_to do |format|\n if @user.save\n format.html { redirect_to users_path}\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": "f4a5f92edfc27058c7de94f46c9751ad", "score": "0.43667608", "text": "def subscribe_users\n @channel.users << User.where(id: params[:channel][:user_ids])\n\n respond_to do |format|\n if @channel.save\n format.html { redirect_to channel_messages_path(@channel), notice: 'Abonnenten erfolgreich hinzugefuegt.' }\n format.json { render action: 'show', status: :created, location: @channel }\n else\n format.html { render action: 'show', location: @channel }\n format.json { render json: @channel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c9c1257ee50d793c17e1960c1775352", "score": "0.4363019", "text": "def user_inscription(user)\n\t\tinscriptions.each do |i|\n\t\t\ti.participations.each do |p|\n\t\t\t\tif p.user == user\n\t\t\t\t\treturn i\n\t\t\t\tend\n\t\t\tend\n\t\tend\n\tend", "title": "" } ]
07d567dcca4a02b452151d4a9e6bf09b
Test that this user is authorized with DigitalNZ. This is assumed to be true if an access token is available. Calling the optional test parameter will always make an HTTP connection to DigitalNZ to test the authorization.
[ { "docid": "77625b0ec89b10e2fd1f714eece2e3c9", "score": "0.7834095", "text": "def authorized?(test = false)\n if test\n if access_token\n access_token.get('/oauth/test_request').is_a?(Net::HTTPSuccess)\n else\n false\n end\n else\n !!access_token\n end\n\n rescue Exception => e\n false\n end", "title": "" } ]
[ { "docid": "10f7b05f5627c0b0262d5c8049d614dc", "score": "0.64515775", "text": "def authorize(oauth_verifier)\n @access_token = request_access_token(oauth_verifier)\n @authorized = true\n return true\n rescue\n puts $! if @@verbose\n return false\n end", "title": "" }, { "docid": "6ee46b8101c026a5a3c9a95867075f7d", "score": "0.6305978", "text": "def authorize!\n api_key = ApiKey.find_by_access_token(params[:access_token])\n head :unauthorized unless api_key\n return false\n end", "title": "" }, { "docid": "1a33c40ab746dc0d1c1aaf6acd3cec30", "score": "0.6288205", "text": "def test_authentication\n load_token\n return false if !@token || @token.empty?\n res = get '/'\n !res.key?('error')\n end", "title": "" }, { "docid": "ff450f33d6f155bbfb96903e66834fe8", "score": "0.62724304", "text": "def authorized?\n !!@access_token\n end", "title": "" }, { "docid": "2678fbc8ec2034946c76ff607fc16999", "score": "0.6239658", "text": "def auth_test(params = {})\n response = @session.do_post \"#{SCOPE}.test\", params\n Slack.parse_response(response)\n end", "title": "" }, { "docid": "3b1e4cfed85d2f412a81117d220e5717", "score": "0.6122353", "text": "def authorize(user=\"no\")\n if user.nil?\n not_authorized(\"User not found.\")\n false\n elsif user == 'no'\n require_login\n !!current_user\n else\n if user_authorized?(user)\n true\n else\n not_authorized\n false\n end\n end\n end", "title": "" }, { "docid": "85d4390f7d20cc234e34e78553cd4f30", "score": "0.6112434", "text": "def authorized?\n if Vermonster::Client.connection.get(\"me\").status == 200\n true\n else\n false\n end\n end", "title": "" }, { "docid": "534a07400fe52f845349074a6d6d8ce1", "score": "0.61110246", "text": "def authorized?\n true\n end", "title": "" }, { "docid": "d1c0704ad9076165b998c678030ad650", "score": "0.6072449", "text": "def authorize\n \n token = decode_token(@auth_header)\n data = get_canvas_data(@canvas, token.first[\"user_id\"])\n \n data[\"group_id\"] == token.first[\"group_id\"] && data[\"has_access\"] == \"true\"\n \n rescue StandardError => _\n false\n end", "title": "" }, { "docid": "4e0568b0c2a69913cf2248420e8385fa", "score": "0.60540223", "text": "def verify_access_token\n Rails.logger.debug \"====== request.headers['Authorization'] = #{request.headers['Authorization']} ======\"\n\n server = AuthorizationServer.new(Application.authorization_server,\n Application.resource_server)\n\n result, @authorized_user = server.authorize_request(request)\n Rails.logger.debug \"------ authorized_user = #{@authorized_user.inspect} ------\"\n\n # If the result is OK, proceed with the operation\n head result unless result == :ok\n end", "title": "" }, { "docid": "bdbd4e91f9243698c6fe8a8c40fc1110", "score": "0.6038412", "text": "def test_login\n if @auth!='' then\n result = do_request(json_obj('user.checkauth',\n {'sessionid'=>@auth}))\n if !result['result'] then\n @auth=''\n return false #auth hash bad\n end\n return true #auth hash good\n else\n return false\n end\n end", "title": "" }, { "docid": "307d7c3e5bc9af9324714bcebe8d7aed", "score": "0.5994246", "text": "def authorise!\n begin\n response = Birdman::Requester.post(\"oauth/token\", {}, {\n :client_id => \"#{client_id}\",\n :client_secret => \"#{client_secret}\",\n :grant_type => \"client_credentials\"\n })\n self.access_token = response.access_token\n true\n rescue Birdman::Exception::Api\n self.access_token = nil\n false\n end\n end", "title": "" }, { "docid": "0b474081ffe6e52cf8c25a174d7298f0", "score": "0.5988845", "text": "def authorized?\n true\n end", "title": "" }, { "docid": "0fc452f67140d408331ccac75b15049e", "score": "0.59839636", "text": "def authorized?\n return if session[:access_token]\n end", "title": "" }, { "docid": "8f615b3489d24676d6441039cb8bd998", "score": "0.5975315", "text": "def test_index_authorized\n authorize @valid_user\n get :index\n assert_response :success\n assert_template \"index\"\n end", "title": "" }, { "docid": "c05e9d65eccaca38aec84456202907ab", "score": "0.597025", "text": "def test_authentication\n @api.test_authentication\n return\n end", "title": "" }, { "docid": "4a33d4f59cbda41a92feb60d8ba5ec78", "score": "0.59653205", "text": "def authorize\n if session[\"allcool\"] == 1\n return true\n end\n login,password = get_auth_data\n @test = User.find_by_login(login)\n if @test && @test.authenticated?(password) # && @test.is_admin\n session[\"allcool\"] = 1\n return true\n end\n session[\"allcool\"] = 0\n headers[\"Status\"] = \"Unauthorized\" \n headers[\"WWW-Authenticate\"] = 'Basic realm=\"Realm\"'\n self.status = 401\n render \"Authentication Required\"\n return false\n end", "title": "" }, { "docid": "dcf76373b02fd0349aca514afecea550", "score": "0.5964113", "text": "def test_that_authentication_returns_access_token\n response = MercadoPago::Authentication.access_token(CREDENTIALS[:client_id], CREDENTIALS[:client_secret])\n assert response['access_token']\n end", "title": "" }, { "docid": "bc438d2438a8d3311376f8da6716f9b3", "score": "0.59588844", "text": "def verify_access\n authenticate_or_request_with_http_basic(\"Documents Realm\") do |username, password|\n username == 'rdi' && password == 'btc'\n end\n end", "title": "" }, { "docid": "871d5a9b3ad7334d6d9143309fb26056", "score": "0.5937952", "text": "def authorized?(user)\n true\n end", "title": "" }, { "docid": "fc63396f9167fa5e34874b3caf36fcc5", "score": "0.5925532", "text": "def is_authorized?\n @authorized\n end", "title": "" }, { "docid": "fc63396f9167fa5e34874b3caf36fcc5", "score": "0.5925532", "text": "def is_authorized?\n @authorized\n end", "title": "" }, { "docid": "01cfb38cbec4ffff1abbf5bb201b4268", "score": "0.5921991", "text": "def authorize(username, password)\n resp = call_api_method(\"pnet.api.authorize\", :username => username, :passwd => password)\n\n if resp['success'] == 1 && resp.has_key?('authkey')\n DEFAULT_PARAMS.merge!(:username => username, :authkey => resp['authkey'])\n end\n end", "title": "" }, { "docid": "5368c430541852aec3be68b7b5e9aff0", "score": "0.59154475", "text": "def authorized?\n !auth.nil?\n end", "title": "" }, { "docid": "1f953685d46ff995ca1dd5a164bd2dd4", "score": "0.5875659", "text": "def test_connection\n args = get_connection_args(\"#{endpoint}/auth\")\n args[:raw_response] = true\n RestClient::Request.execute(args)\n end", "title": "" }, { "docid": "b47d03af479487f2c8c1e5871f340ada", "score": "0.58720833", "text": "def authorize?(user)\n true\n end", "title": "" }, { "docid": "de9aa1c7dbe61bd8462efe1e8567bb6a", "score": "0.58474237", "text": "def authorize\n if session[:dc_access_token].nil? or session[:dc_address_for_token] != session[:dc_address] then\n session[:dc_address_for_token] = session[:dc_address]\n redirect \"#{settings.FQDN}/oauth/authorize?client_id=#{settings.api_key}&scope=DC&redirect_uri=#{settings.redirect_url}\"\n else\n redirect '/getDeviceCapabilities'\n end\nend", "title": "" }, { "docid": "3ba48c0bb8b049b9aec4e57500c34303", "score": "0.5846945", "text": "def test_access\n oid = 10590515\n\ttype = \"jpg150\"\n\tip = request.remote_ip\n\thost = request.host_with_port\n\tfull_url = \"http://\"+host+\"/auth?oid=\"+oid.to_s+\"&type=\"+type+\"&ip=\"+ip\n\tlogger.info \"auth path:\"+full_url\n\tresource = RestClient::Resource.new(full_url)\n\tpage = resource.get()\n\tpage = page.to_s\n\tlogger.info page\n\treturn_msg = \"default\"\n\tif page == \"authorized\"\n\t\treturn_msg = \"you we able to pass the test access conditions\"\n\telsif page == \"unauthorized\"\n\t\treturn_msg = \"try cas\"\n\telse \n\t\treturn_msg = \"last else condition, this shouldn't happen\"\n\tend\t\n\trender :text => return_msg\n\treturn\n end", "title": "" }, { "docid": "4ed0fa91bdad157d13196766c56edc6b", "score": "0.58395493", "text": "def allow\n Test::Spec::Rails::Macros::Authorization::TestGenerator.new(test_case,\n :access_denied?, false,\n 'Expected access to be allowed'\n )\n end", "title": "" }, { "docid": "a309a1148654bd27221dfdf117df0803", "score": "0.5835695", "text": "def authok?\n @authok\n end", "title": "" }, { "docid": "a309a1148654bd27221dfdf117df0803", "score": "0.5835695", "text": "def authok?\n @authok\n end", "title": "" }, { "docid": "a309a1148654bd27221dfdf117df0803", "score": "0.5835695", "text": "def authok?\n @authok\n end", "title": "" }, { "docid": "a309a1148654bd27221dfdf117df0803", "score": "0.5835695", "text": "def authok?\n @authok\n end", "title": "" }, { "docid": "7511e539267a0563fe11f478eac9936d", "score": "0.5832719", "text": "def set_test\n @test = authorize Test.find(params[:id])\n end", "title": "" }, { "docid": "942b050a91e1470f94f172c58fdb4648", "score": "0.58313304", "text": "def authorized?\n\t\t\t@authenticated\n\t\tend", "title": "" }, { "docid": "136ea0b9cd27c16e4b566adfb8b46c14", "score": "0.5820924", "text": "def authorized?(user, request, params)\n true\n end", "title": "" }, { "docid": "aa7aeabdfa2167d583542bc7ec8a6f2c", "score": "0.581508", "text": "def verify_access_token\n if bypass_auth?\n true\n else\n authenticate_or_request_with_http_token do |token, opts|\n current_user && token && current_user.access_token.token == token\n end\n end\n end", "title": "" }, { "docid": "4a67041415557ccb76ee6ac828ff2110", "score": "0.580805", "text": "def authorize!\n response = auth_connection.post(\n \"/api/v1/access_token\",\n grant_type: \"password\",\n username: @username,\n password: @password\n )\n\n @access = Access.new(response.body)\n reset_connection!\n end", "title": "" }, { "docid": "5e9f90c60bc6e8e7ec16499da3dc3c6a", "score": "0.5805186", "text": "def authorize(_subject, _auth)\n false\n end", "title": "" }, { "docid": "42f59ee8f5f853de9135eed347b6fcb7", "score": "0.5800676", "text": "def authorize\n if @api_user\n authorize_user\n else\n authorize_unauthenticated_user\n end\n end", "title": "" }, { "docid": "815568ceb52c27935a401c109af98eca", "score": "0.5785786", "text": "def test_login_oauth_success_for_external_client_user_grants_permission\n # Step 1\n @user = TurtleUser.new({ 'external_client' => true })\n\n turtle_response = @user.register\n assert_response(turtle_response, :success)\n assert(@user.id)\n\n # Step 2\n turtle_response = @user.login_oauth_for_external_client('Allow')\n assert_response(turtle_response, :success)\n\n # Step 3\n turtle_response = @user.verify_oauth_token(@user.oauth_token)\n assert_response(turtle_response, :success)\n\n # Step 4\n referer = 'http://something.at.xx.com/path'\n\n turtle_response = @user.logout(referer)\n assert_response(turtle_response, :redirect)\n assert_equal(referer, turtle_response['location'])\n end", "title": "" }, { "docid": "cd2de9cbb4e92e4f2e4d4c08e5803fac", "score": "0.57757354", "text": "def authorize\n (render :json => { :error => \"Authentication error\" }, :status => :unauthorized and return) unless User.current.present?\n authorized ? true : deny_access\n end", "title": "" }, { "docid": "1ec206c477bd3b02d6a23643555ee3b5", "score": "0.5767193", "text": "def user_authorizes_token?\n params[:authorize] == '1'\n end", "title": "" }, { "docid": "1ec206c477bd3b02d6a23643555ee3b5", "score": "0.5767193", "text": "def user_authorizes_token?\n params[:authorize] == '1'\n end", "title": "" }, { "docid": "1ec206c477bd3b02d6a23643555ee3b5", "score": "0.5767193", "text": "def user_authorizes_token?\n params[:authorize] == '1'\n end", "title": "" }, { "docid": "bef31ff2933028c93ade06f3e22dbefa", "score": "0.5760302", "text": "def authorized?\n # TODO(samstern): Check for expired token.\n !(session[:user_id].nil?)\n end", "title": "" }, { "docid": "abd0e9560f2df20f3b420d7a54751e5e", "score": "0.5756532", "text": "def login_test\n \tauth_params = {\n login: 'guest',\n password: 'connecpath',\n school: {admin_api_key: \"e85e87600d707233c96d69080dd949abbb6892e7a4ac9d452f6c58a2799f9f99\",\n \t\tadmin_username: \"shaunakdas2020\", code: \"global\"}\n }\n resp= JSON.parse(post_call('/user/login', (auth_params)).body)\n\n if resp.has_key?('global') && \n \tresp['global'].has_key?('api_key') && \n \tresp['global']['api_key'].has_key?('user') && \n \tresp['global']['api_key']['user'].has_key?('username')\n \tputs \"#Test Result: Success. Username in response:\" + resp['global']['api_key']['user']['username']\n else\n \tputs \"#Test Result: Failure. Response:\" + resp\n end\n end", "title": "" }, { "docid": "d888c6836714832f9493c52513fcaf3e", "score": "0.5751295", "text": "def authorize(username, password)\np username\np password\n username == settings.username && password == settings.password\n end", "title": "" }, { "docid": "9401a555f07e79097721a6a7cae4830d", "score": "0.5748276", "text": "def test_auth_use_available\n user = User.authenticate('MyString');\n if(user)\n assert true\n else\n assert false, 'find user false'\n end\n end", "title": "" }, { "docid": "f343c14fee03e4084848059541c26d0f", "score": "0.5747936", "text": "def authorized?(**args)\n true\n end", "title": "" }, { "docid": "c9183a13bea1383a67ac96cbb446933a", "score": "0.5747387", "text": "def authorized\n\t\tif current_user\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend", "title": "" }, { "docid": "d34fdd3d250cc7046e2523f04c8ebaf9", "score": "0.5747128", "text": "def authorize(login, password)\n return true unless CloudCrowd.config[:use_http_authentication]\n return CloudCrowd.config[:login] == login &&\n CloudCrowd.config[:password] == password\n end", "title": "" }, { "docid": "f09a7c0ac44a1aeca6ca6a4d1665426c", "score": "0.5732761", "text": "def authenticate_if_needed\n # Disable this extra authentication in test mode\n return true if Rails.env.test?\n if (is_hidden || is_staging) && !is_api_or_pdf\n authenticate_or_request_with_http_basic do |username, password|\n username == \"samvera\" && password == \"hyku\"\n end\n end\n end", "title": "" }, { "docid": "af3b3a053d7a0051e5d7eab8e14e7ca8", "score": "0.5725226", "text": "def user_authorizes_token?\n return true if params[:authorize]\n\n end", "title": "" }, { "docid": "e4558296809451db1c3a70c1f987f378", "score": "0.5720126", "text": "def test_realm\n make_controller :realm\n get :index\n assert_protected\n assert_equal 'Basic realm=\"GOURANGA!\"', @response.headers['WWW-Authenticate']\n end", "title": "" }, { "docid": "d34ed17d4fbde4545ab4cab9354e7ffe", "score": "0.5713978", "text": "def authorize(params = {})\n open_url authorize_url(params)\n end", "title": "" }, { "docid": "c88364f80c71e1fee801b48b4dfe42a0", "score": "0.5712483", "text": "def authorize\n end", "title": "" }, { "docid": "c88364f80c71e1fee801b48b4dfe42a0", "score": "0.5712483", "text": "def authorize\n end", "title": "" }, { "docid": "cb6cfdaddd51a777dc406e6a64ba2b41", "score": "0.5711744", "text": "def test_auth_only_actually_logging_in\n test_auth_only\n login :secret_ferret_brigade, 'ferret', 'REVOLUTION'\n assert_response :success\n login :secret_ferret_brigade, 'ferret', 'WRONGPASSWORD'\n assert_protected\n end", "title": "" }, { "docid": "4d857065a38b5cacf755f484360b8373", "score": "0.5701459", "text": "def authorized?\n logged_in?\n end", "title": "" }, { "docid": "4d857065a38b5cacf755f484360b8373", "score": "0.5701459", "text": "def authorized?\n logged_in?\n end", "title": "" }, { "docid": "d5a6835cd12112834d4822e0477deb62", "score": "0.5698369", "text": "def test_auth_only\n make_controller :auth_only\n get :index\n assert_response :success\n get :secret_ferret_brigade\n assert_protected\n end", "title": "" }, { "docid": "c47597da1a02cc1ac9939dc1f2b680c4", "score": "0.5697759", "text": "def is_authorized?\n !!token && !token.expired?\n end", "title": "" }, { "docid": "c47597da1a02cc1ac9939dc1f2b680c4", "score": "0.5697759", "text": "def is_authorized?\n !!token && !token.expired?\n end", "title": "" }, { "docid": "b91ac3ca1402d95b364b1e1145b48137", "score": "0.56927246", "text": "def authorize(record, query = nil)\n return record if Rails.env.test?\n super\n end", "title": "" }, { "docid": "f519ad573c4802008169b620020b609b", "score": "0.5688489", "text": "def auth_works?(server)\n return false unless (server && server.token && server.token.access_token)\n vspinner \"Testing if authentication works using current access token\" do\n Kontena::Client.new(server.url, server.token).authentication_ok?(master_account.userinfo_endpoint)\n end\n end", "title": "" }, { "docid": "a7554124efdde8073d3c9bee24146a44", "score": "0.5688206", "text": "def authorize\n render :text => \"Authorization error\", :status => 401\n false\n end", "title": "" }, { "docid": "a2b5b39035e50d49fe6ad73ca4d0553d", "score": "0.5684704", "text": "def authorized?\n logged_in?\n end", "title": "" }, { "docid": "9b3ac7e3f8a3fd1025baeae41e81b44c", "score": "0.56668264", "text": "def authorize_show\n user = requested_user(:user_id)\n if request.format.ics?\n unauthorized(\"Invalid privacy token.\") unless params[:pt] == user.privacy_token\n else\n unauthorized unless user == current_user\n end\n true\n end", "title": "" }, { "docid": "72a760f2235a94c0871840294c83c3c2", "score": "0.56664246", "text": "def authorize?(_user)\n true\n end", "title": "" }, { "docid": "72a760f2235a94c0871840294c83c3c2", "score": "0.56664246", "text": "def authorize?(_user)\n true\n end", "title": "" }, { "docid": "adc16b2dc07092cb71f3fd89d0239dd2", "score": "0.56657", "text": "def authorized?\n @authorized ||= User.get(@env).present?\n end", "title": "" }, { "docid": "058f8f41ad3d2a5441f003d78551dc91", "score": "0.5664703", "text": "def authorized?\n logged_in?\n end", "title": "" }, { "docid": "058f8f41ad3d2a5441f003d78551dc91", "score": "0.5664703", "text": "def authorized?\n logged_in?\n end", "title": "" }, { "docid": "80dda3541799c1e4ca26708c4abbb3f1", "score": "0.5658991", "text": "def authorize\n @user = User.find_by_id_and_multitrack_token(params[:user_id], params[:token])\n head(@user ? :ok : :forbidden)\n end", "title": "" }, { "docid": "fc1820cf3fe7b755871de937ea755580", "score": "0.56540996", "text": "def authorize(access)\n @user = AuthorizeController.authorize(request)\n if @user == nil or not @user.has_access?(access)\n render status: :forbidden\n end\n end", "title": "" }, { "docid": "00a210ddc01bbd251a12059a4cfe27c5", "score": "0.56522703", "text": "def authorized?\n if token.present?\n # Client is confidential, therefore client authentication & authorization\n # is required\n if token.application_id?\n # We authorize client by checking token's application\n server.client && server.client.application == token.application\n else\n # Client is public, authentication unnecessary\n true\n end\n end\n end", "title": "" }, { "docid": "879d97612deb7b9d14a7d12a51aa2d5a", "score": "0.56507504", "text": "def authenticated?\n !!@access_token\n end", "title": "" }, { "docid": "041b859704a364bfc9169f5d359c32f6", "score": "0.5645692", "text": "def must_authenticate \n if @authenticated_user && (@user_is_viewing_themselves != false)\n return true\n else\n request_http_basic_authentication(\"Social bookmarking service\") \n return false\n end \n end", "title": "" }, { "docid": "b5d9df28866f98a47597cd6761aad586", "score": "0.5643121", "text": "def test_get_access_token\n end", "title": "" }, { "docid": "70d777b50cafd6ebcfbd02953b2922b4", "score": "0.5640624", "text": "def authorized?\n @user_id = nil\n @token = extract_token\n begin\n payload, header = JWT.decode(@token, settings.verify_key, true)\n\n @exp = header[\"exp\"]\n\n # check to see if the exp is set (we don't accept forever tokens)\n if @exp.nil?\n puts \"Access token doesn't have exp set\"\n return false\n end\n\n @exp = Time.at(@exp.to_i)\n\n # make sure the token hasn't expired\n if Time.now > @exp\n puts \"Access token expired\"\n return false\n end\n\n @user_id = payload[0]\n\n rescue JWT::DecodeError => e\n return false\n end\n true\n end", "title": "" }, { "docid": "8ee707bbfa1751b61e6b34f2f2225326", "score": "0.56350434", "text": "def login_required\n username, passwd = get_auth_data\n logged_in? && authorized? ? true : access_denied\n end", "title": "" }, { "docid": "382df51c85d0a0b4ac679e3b5c26a8fe", "score": "0.5620988", "text": "def test_logged_in_user_access_to_userland_approved\n # first log in\n post '/login', { :username => GOOD_USERNAME, :password => GOOD_PASSWORD }\n\n # then specifically request the index page in userland\n get '/in/index'\n assert last_response.ok?\n assert last_response.body.include?('You are logged in as') \n assert last_response.body.include?(GOOD_USERNAME) \n end", "title": "" }, { "docid": "ac7a9db4a511f7b83d1a865ce860a7ea", "score": "0.5617409", "text": "def authorize?(user)\n true\n #user.login == \"administrador\"\n end", "title": "" }, { "docid": "f025988ea9bf88eea16263fd6028e254", "score": "0.5600623", "text": "def authorize(user,pass)\n @uri.path += 'auth'\n @uri.query = \"user=\" + user + \"&pass=\" + pass\n response = @caller.request_get(@uri)\n raise RestApiCallerError::AuthorizationError unless response.code == '200'\n @token = JSON.parse(response.body)[\"token\"]\n raise RestApiCallerError::AuthorizationError unless @token\n end", "title": "" }, { "docid": "966e8ec5d0b92bfd04ca3748b1ae1cf0", "score": "0.5598971", "text": "def authorized?\n @authorized ||= current_user.present? # TODO: Check for authorization\n end", "title": "" }, { "docid": "5bc28ab0fa369f1328f21bf55df99a09", "score": "0.5594969", "text": "def authenticated?\n not @access_token.nil?\n end", "title": "" }, { "docid": "29b2d897d131b5e7861563af79192085", "score": "0.5577114", "text": "def authorized?\n\t\tif session[:authorization]\n\t\t\treturn true\n\t\telse\n\t\t\treturn false\n\t\tend\n\tend", "title": "" }, { "docid": "be9077c7fe9c6f9069acd78a2d41f01d", "score": "0.55680686", "text": "def authorized?\n logged_in?\n end", "title": "" }, { "docid": "387582bfe23318c4b6073ba52af5ea02", "score": "0.5562549", "text": "def test(config)\n # Simulated credentials to be injected with InjectorMiddleware\n credential_injector_middleware(config, config.x.rails_auth.test_credentials ||= {})\n end", "title": "" }, { "docid": "c865f1de7701282bbafeb7bb65346f0d", "score": "0.5550157", "text": "def check_access_token\n @access_token = session[:access_token]\n\n begin\n @client = Octokit::Client.new :access_token => @access_token\n @user = @client.user\n rescue => e\n # The token has been revoked, so invalidate the token in the session.\n session[:access_token] = nil\n authenticate!\n end\nend", "title": "" }, { "docid": "5a2439dcec198d5d913a98a9d0e575bd", "score": "0.55307305", "text": "def test_authentication\n status = false\n\n Net::HTTP.start(\"#{@subdomain}.#{@options[:host]}\", 80) do |http|\n req = Net::HTTP::Get.new(@options[:pathname])\n\n if authentication_set?\n req.ntlm_auth(@username, @options[:domain], @password)\n end\n\n response = http.request(req)\n\n if response.code.to_i.between?(200,399)\n status = true\n else\n status = false\n end\n end\n\n return status\n end", "title": "" }, { "docid": "d859b82efcdd2e0a704386e82202dc48", "score": "0.5525294", "text": "def show\n authorize @publishers_test\n end", "title": "" }, { "docid": "e891add9caa456544777440a36272224", "score": "0.55242324", "text": "def authorized?\n @auth ||= Rack::Auth::Basic::Request.new(request.env)\n user = ENV[\"HTTP_USER\"]\n pass = ENV[\"HTTP_PASS\"]\n @auth.provided? && @auth.basic? && @auth.credentials && @auth.credentials == [user, pass]\n end", "title": "" }, { "docid": "6783b486164f5b0c8244386ea718e8af", "score": "0.5523796", "text": "def authorize!\n redirect '/auth' unless authorized?\n end", "title": "" }, { "docid": "57dc156e34530dcdf74b580ce1cbb39b", "score": "0.5523322", "text": "def authorize(auth = {})\n @authentication ||= TaskMapper::Authenticator.new(auth)\n auth = @authentication\n if (auth.account.nil? and auth.username.nil? and auth.password.nil?)\n raise \"Please provide at least an url (subdomain), username and password)\"\n end\n ZendeskAPI.authenticate(auth.account, auth.username, auth.password)\n end", "title": "" }, { "docid": "445c5348f82bd5feb5f6213b3b1d85b4", "score": "0.5520414", "text": "def authorize!\n response = till_response { send_raw_request(authorization_params) }\n raise AuthenticationError.new(\"Could not authenticate with Zabbix API at #{uri}: #{response.error_message}\") if response.error?\n raise AuthenticationError.new(\"Malformed response from Zabbix API: #{response.body}\") unless response.string?\n @auth = response.result\n end", "title": "" }, { "docid": "1b53b60c51ef3d0fe2ec2f2b1e18decf", "score": "0.5515692", "text": "def authenticate\n unless params[:just_retrieving_resources_to_prove_they_exist_in_client_test]\n render json: { errors: ['You are not authorized'] }, status: :unauthorized\n end\n end", "title": "" }, { "docid": "85a145cd6d4fac343f629a0b55e46fd8", "score": "0.5515497", "text": "def authorized?\n user = ENV['ADMIN_USER'] || 'admin'\n pass = ENV['ADMIN_PASSWORD'] || 'ch0p'\n\n @auth ||= Rack::Auth::Basic::Request.new(request.env)\n @auth.provided? && @auth.basic? && @auth.credentials && @auth.credentials == [user, pass]\n end", "title": "" }, { "docid": "1bfb3eefcbcbadd5c8a42f3a3a92113d", "score": "0.5513751", "text": "def authorized?(user, action)\n\t\ttrue\n\tend", "title": "" } ]
3cc00b2179fa084065408f274a7c0281
PATCH/PUT /institutions_branches/1 PATCH/PUT /institutions_branches/1.json
[ { "docid": "f4b0dbc812f63ae33a0277a1bab97e67", "score": "0.68093634", "text": "def update\n respond_to do |format|\n if @institutions_branch.update(institutions_branch_params)\n format.html { redirect_to @institutions_branch, notice: 'Institutions branch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @institutions_branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "0a968ac8d66a6978d82d509a3877a65b", "score": "0.6976165", "text": "def update\n respond_to do |format|\n if @branch.update(branch_params)\n format.json { render json: @branch, status: :ok }\n else\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e383df024bc3b62d8d0523ba9ee9682e", "score": "0.69319326", "text": "def update\n @branch = Api::V1::Branch.find(params[:id])\n\n if @branch.update(branch_params)\n head :ok\n else\n render json: @branch.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0fec075b52142f62769b22de6120980f", "score": "0.67456734", "text": "def update\n respond_to do |format|\n\n if params[:parent_id]\n @parent = @project.branches.where('id = ?', params[:parent_id]).first\n if @parent\n @branch.parent = @parent\n else\n @branch.parent = nil\n end\n end\n\n if @branch.update(permitted_params.branch)\n format.html { redirect_to project_branches_url(@project), notice: 'Branch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c1e2a2be148ac9d126896b991419e296", "score": "0.6644434", "text": "def update\n if @branch.update(branch_params)\n render :show, status: :ok, location: @branch\n else\n render json: @branch.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "19f5987f975e1eb6799869e99489f1f5", "score": "0.66088915", "text": "def update\n respond_to do |format|\n if @lab_branch.update(lab_branch_params)\n format.html { redirect_to @lab_branch, notice: 'Lab branch was successfully updated.' }\n format.json { render :show, status: :ok, location: @lab_branch }\n else\n format.html { render :edit }\n format.json { render json: @lab_branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5afd01a4b4f59d9f2cbb356ce9a920fc", "score": "0.6536026", "text": "def update\n if @admin_branch.update(admin_branch_params)\n render json: {success: true}\n end\n end", "title": "" }, { "docid": "e93f63763b55e7011186eb93a7eb0ea7", "score": "0.652823", "text": "def update\n @branch = @pharmacy.branches.find(params[:id])\n\n respond_to do |format|\n if @branch.update_attributes(params[:branch])\n format.html { redirect_to [@pharmacy, @branch], notice: 'Branch was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d83226f01c7a6ada683fd5d33738d3ee", "score": "0.65195715", "text": "def update\n @branch = TipBranch.find(params[:id])\n\n respond_to do |format|\n if @branch.update_attributes(params[:branch])\n format.html { redirect_to @branch, notice: 'Branch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "10d7502bfb8e4df7f69f19a96021b334", "score": "0.6463899", "text": "def update\n respond_to do |format|\n if @branch.update_attributes(params[:branch])\n format.html { redirect_to @branch, notice: 'Branch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb1c0eca6c5b07c4f55e752e6613dc5c", "score": "0.64421266", "text": "def update\n @branch = Branch.find(params[:id])\n\n respond_to do |format|\n if @branch.update_attributes(params[:branch])\n format.html { redirect_to @branch, notice: 'Branch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eb1c0eca6c5b07c4f55e752e6613dc5c", "score": "0.64421266", "text": "def update\n @branch = Branch.find(params[:id])\n\n respond_to do |format|\n if @branch.update_attributes(params[:branch])\n format.html { redirect_to @branch, notice: 'Branch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "be6a1ef1b5b1b5a6c78aeb791735d7d0", "score": "0.64102393", "text": "def update\n @client_branch = ClientBranch.find(params[:id])\n\n respond_to do |format|\n if @client_branch.update_attributes(params[:client_branch])\n format.html { redirect_to @client_branch, notice: 'Client branch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @client_branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f5d559ad898c01b91bbf7f50d7f1e594", "score": "0.63860095", "text": "def update\n @branch.update(branch_params) \n end", "title": "" }, { "docid": "87d094b4a2f0d9de1554417d4bf32e28", "score": "0.637329", "text": "def update\n @branch = Branch.find_by_permalink(params[:id])\n\n respond_to do |format|\n if @branch.update_attributes(params[:branch])\n format.html { redirect_to edit_branch_path(@branch), notice: 'Branch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1e0a62975cdc7df6ea8bd60151cee9ab", "score": "0.6370013", "text": "def update\n get_parent_contest\n get_this_branch\n\n respond_to do |format|\n if @branch.update_attributes(params[:branch])\n format.html { redirect_to [@contest, @branch], notice: 'Branch was successfully updated.' }\n format.mobile { redirect_to [@contest, @branch], notice: 'Branch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.mobile { render action: \"edit\" }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8a1fc5200cf51639b8e5c3d64cca74ee", "score": "0.636097", "text": "def update\n @cms_reference_branch = ReferenceBranch.find(params[:id])\n\n respond_to do |format|\n if @cms_reference_branch.update_attributes(params[:reference_branch])\n format.html { redirect_to cms_reference_branches_url, notice: t('cms.update.success', name: ReferenceBranch.model_name.human) }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @cms_reference_branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5385d5ad4ea87af7952e673d76248d85", "score": "0.6353673", "text": "def update\n ret_url = @branch.entity\n respond_to do |format|\n if @branch.update(branch_params)\n format.html { redirect_to ret_url, notice: 'La sede ha sido editada exitosamente.' }\n format.json { render :show, status: :ok, location: @branch }\n else\n format.html { render :edit }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "02125afefe4f77c422feee93db6e832f", "score": "0.6350891", "text": "def update\n respond_to do |format|\n if @branch_info.update(branch_info_params)\n format.html { redirect_to @branch_info, notice: 'Branch info was successfully updated.' }\n format.json { render :show, status: :ok, location: @branch_info }\n else\n format.html { render :edit }\n format.json { render json: @branch_info.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "05d4d82fce087a6a166ebd0bbdd755da", "score": "0.63414377", "text": "def update\n respond_to do |format|\n if @branch.update(branch_params)\n format.html { redirect_to @branch, notice: 'Branch was successfully updated.' }\n format.json { render :show, status: :ok, location: @branch }\n else\n format.html { render :edit }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "05d4d82fce087a6a166ebd0bbdd755da", "score": "0.63414377", "text": "def update\n respond_to do |format|\n if @branch.update(branch_params)\n format.html { redirect_to @branch, notice: 'Branch was successfully updated.' }\n format.json { render :show, status: :ok, location: @branch }\n else\n format.html { render :edit }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "05d4d82fce087a6a166ebd0bbdd755da", "score": "0.63414377", "text": "def update\n respond_to do |format|\n if @branch.update(branch_params)\n format.html { redirect_to @branch, notice: 'Branch was successfully updated.' }\n format.json { render :show, status: :ok, location: @branch }\n else\n format.html { render :edit }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af215293f1690c61e5c7ac220b2a05f8", "score": "0.63318264", "text": "def update\n respond_to do |format|\n if @branch.update(branch_params)\n format.html { redirect_to @branch, notice: 'Сведения о филиале обновлены.' }\n format.json { render :show, status: :ok, location: @branch }\n else\n format.html { render :edit }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5f138cf3ddf67c7c3b7e1c97865c811f", "score": "0.63236576", "text": "def update\n respond_to do |format|\n if @branch.update(branch_params)\n format.html { redirect_to branches_path, notice: 'La sucursal se actualizó correctamente.' }\n format.json { render :show, status: :ok, location: @branch }\n else\n format.html { render :edit }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aa316e3b3e8ae58657bc136ac977f160", "score": "0.62753814", "text": "def update\n respond_to do |format|\n if @branchinfo.update(branchinfo_params)\n format.html { redirect_to @branchinfo, notice: 'Branchinfo was successfully updated.' }\n format.json { render :show, status: :ok, location: @branchinfo }\n else\n format.html { render :edit }\n format.json { render json: @branchinfo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7f467b116fc73d5229bfbaed4ecc9d39", "score": "0.6219494", "text": "def patch_branch\n num = 1\n branch_name = params['title'].parameterize\n return branch_name unless branch_exists?(branch_name)\n branch = \"#{branch_name}-#{num}\"\n while branch_exists?(branch)\n num += 1\n branch = \"#{branch_name}-#{num}\"\n end\n branch\n end", "title": "" }, { "docid": "7dcb32dd82f1cbefe7ab99e448f1aea9", "score": "0.6206036", "text": "def update\n respond_to do |format|\n if @branch.update(branch_params)\n format.html { redirect_to @branch, notice: 'Se guardo correctamente.' }\n format.json { render :show, status: :ok, location: @branch }\n else\n format.html { render :edit }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f261803503e1722792e9b1d1f8d40a0f", "score": "0.6201963", "text": "def fetch_branches\n JSON.parse(open(\"https://api.github.com/repos/#{full_name}/branches?oauth_token=#{oauth_token}\").read).each do |result|\n branch = branches.where(:name => result['name']).first || branches.new\n branch.name = result['name']\n branch.sha = result['commit']['sha']\n branch.save\n end\n end", "title": "" }, { "docid": "531a828c9df532e4fb7008bd325cacda", "score": "0.6139884", "text": "def update\n @branch = Branch.find(params[:id])\n\n respond_to do |format|\n if @branch.update_attributes(params[:branch])\n format.html { redirect_to partner_branch_path(@branch), notice: 'Partner branch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df79e0742644224bb265551638ed5bcd", "score": "0.61394036", "text": "def update\n @clinicbranch = Clinicbranch.find(params[:id])\n\n respond_to do |format|\n if @clinicbranch.update_attributes(params[:clinicbranch])\n format.html { redirect_to @clinicbranch, notice: 'Clinicbranch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @clinicbranch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "083bc80f5ad5ec6bb711671d8dd49e0a", "score": "0.6134544", "text": "def update\n \t@branch =Branch.find(params[:branch_id])\n \t@dataordinance = @branch.data_ordinances.find(params[:id])\n respond_to do |format|\n if @dataordinance.update(data_ordinance_params)\n format.json { render json: @dataordinance, status: :ok }\n else\n format.json { render json: @dataordinance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fa5d34ebbe416f5d4d969b99991e6dff", "score": "0.61289376", "text": "def set_branch\n @branch = Branch.find_by_id(params[:id])\n if @branch\n else\n \trender json: { valid: false}, status: 404\n end\n end", "title": "" }, { "docid": "7ca588ce76c2fe53453c5be94ef71970", "score": "0.6080268", "text": "def update\n respond_to do |format|\n if @documentation_branch.update(documentation_branch_params)\n format.html { redirect_to @documentation_branch, notice: 'Branch was successfully updated.' }\n format.json { render :show, status: :ok, location: @documentation_branch }\n else\n format.html { render :edit }\n format.json { render json: @documentation_branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "566c244f1e6b81b26e88210091fce04f", "score": "0.60762227", "text": "def update\n respond_to do |format|\n if @branch.id == branch_params[:master_id]\n format.html { render :edit, notice: '哪有自己隶属于自己的呢?' }\n elsif @branch.master_id == 1 && branch_params[:master_id] != 1\n format.html { render :edit, notice: '这是个顶级网点,暂不支持给它降级~' }\n else\n if @branch.update(branch_params)\n format.html { redirect_to branches_path, notice: '部门信息更新成功,可喜可赫.' }\n format.json { render :show, status: :ok, location: @branch }\n else\n format.html { render :edit }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "75e34b36c31d21a36842fc3ea162ca7b", "score": "0.60086775", "text": "def update\n respond_to do |format|\n if @github_branch.update(github_branch_params)\n format.html { redirect_to @github_branch, notice: 'Github branch was successfully updated.' }\n format.json { render :show, status: :ok, location: @github_branch }\n else\n format.html { render :edit }\n format.json { render json: @github_branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6507f1b693bf8e606e216f414d22a0ee", "score": "0.59782434", "text": "def patch_branch\n @patch_branch ||= begin\n num = 1\n branch = \"patch-#{num}\"\n puts branches.inspect\n while branches.any? { |b| b.name == branch } do\n num = num + 1\n branch = \"patch-#{num}\"\n end\n branch\n end\n end", "title": "" }, { "docid": "7d94ec2fa39f499c47546694a3f646a2", "score": "0.59774566", "text": "def update\n flash[:notice] = 'Se actualizó el Branch.' if @branch.update_attributes(params[:branch])\n respond_with(@branch)\n end", "title": "" }, { "docid": "9039ac9fcaa5c65da0053b3dd5ff7e71", "score": "0.5972526", "text": "def update\n respond_to do |format|\n if @branch_architecture.update(branch_architecture_params)\n format.html { redirect_to @branch_architecture, notice: 'Branch architecture was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @branch_architecture.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "301983cce9f804adbe61406ebdbd47c8", "score": "0.59695256", "text": "def update\n @branch = Branch.find(params[:id])\n\n respond_to do |format|\n if @branch.update_attributes(params[:branch])\n format.html { redirect_to(\"/settings/show#branch\", :notice => 'Branch was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @branch.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6ffe968ef267ece35b0e8b67615451d6", "score": "0.59692097", "text": "def update\n @company_branch = CompanyBranch.find(params[:id])\n\n respond_to do |format|\n if @company_branch.update_attributes(params[:company_branch])\n format.html { redirect_to(@company_branch, :notice => 'Company branch was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @company_branch.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f2fdc13e97ace3925569ce8272f44357", "score": "0.5953416", "text": "def update\n @branch = Branch.find(params[:id])\n\n respond_to do |format|\n if @branch.update_attributes(params[:branch])\n flash[:notice] = 'Branch was successfully updated.'\n format.html { redirect_to(admin_branch_path(@branch)) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @branch.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "72016263f8b2eb56c9cac5feb52548a7", "score": "0.5949047", "text": "def update\n respond_to do |format|\n if @branch_type.update(branch_type_params)\n format.html { redirect_to backend_shop_branch_type_path(@current_shop.slug, @branch_type), notice: '商户分类成功保存.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @branch_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "92cbcfb192d315f8662da8e77c8d244d", "score": "0.59456533", "text": "def set_branchinfo\n @branchinfo = Branchinfo.find(params[:id])\n end", "title": "" }, { "docid": "4d70ce7f3fc3ce1e9294ba20ead83a0e", "score": "0.59362864", "text": "def set_institutions_branch\n @institutions_branch = InstitutionsBranch.find(params[:id])\n end", "title": "" }, { "docid": "7352a6729669ff245fafda057243deba", "score": "0.5922966", "text": "def set_branch_info\n @branch_info = BranchInfo.find(params[:id])\n end", "title": "" }, { "docid": "266d354d792aaacc5eaeb6a2d7e6ea47", "score": "0.59212464", "text": "def update\n @branch = Branch.find(params[:id])\n\n respond_to do |format|\n if @branch.update_attributes(params[:branch])\n flash[:notice] = 'Branch 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 => @branch.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "346318457cab14e1ad3fe28db29d56f8", "score": "0.58799815", "text": "def branch_update_with_http_info(project_id, name, branch_update_parameters, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BranchesApi.branch_update ...'\n end\n # verify the required parameter 'project_id' is set\n if @api_client.config.client_side_validation && project_id.nil?\n fail ArgumentError, \"Missing the required parameter 'project_id' when calling BranchesApi.branch_update\"\n end\n # verify the required parameter 'name' is set\n if @api_client.config.client_side_validation && name.nil?\n fail ArgumentError, \"Missing the required parameter 'name' when calling BranchesApi.branch_update\"\n end\n # verify the required parameter 'branch_update_parameters' is set\n if @api_client.config.client_side_validation && branch_update_parameters.nil?\n fail ArgumentError, \"Missing the required parameter 'branch_update_parameters' when calling BranchesApi.branch_update\"\n end\n # resource path\n local_var_path = '/projects/{project_id}/branches/{name}'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s)).sub('{' + 'name' + '}', CGI.escape(name.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])\n header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] || @api_client.object_to_http_body(branch_update_parameters) \n\n # return_type\n return_type = opts[:return_type] || 'Branch' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Basic', 'Token']\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(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: BranchesApi#branch_update\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n response = ::Phrase::Response.new(data, headers)\n return response, status_code, headers\n end", "title": "" }, { "docid": "1b89b79656d7d6e17f8fc504d271a31b", "score": "0.5845893", "text": "def update\n respond_to do |format|\n if @promotion_branch.update(promotion_branch_params)\n format.html { redirect_to @promotion_branch, notice: 'Promotion branch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @promotion_branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "022968dc094e6b3b3466836a495b7f46", "score": "0.5840546", "text": "def set_branch\n @branch = Branch.find(params[:id])\n end", "title": "" }, { "docid": "022968dc094e6b3b3466836a495b7f46", "score": "0.5840546", "text": "def set_branch\n @branch = Branch.find(params[:id])\n end", "title": "" }, { "docid": "022968dc094e6b3b3466836a495b7f46", "score": "0.5840546", "text": "def set_branch\n @branch = Branch.find(params[:id])\n end", "title": "" }, { "docid": "022968dc094e6b3b3466836a495b7f46", "score": "0.5840546", "text": "def set_branch\n @branch = Branch.find(params[:id])\n end", "title": "" }, { "docid": "7c3b8bd7f269c27c8f6fedf42f11c5d3", "score": "0.5833806", "text": "def update\n respond_to do |format|\n if @branch_office.update(branch_office_params)\n format.html { redirect_to @branch_office, notice: \"Branch office was successfully updated.\" }\n format.json { render :show, status: :ok, location: @branch_office }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @branch_office.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "157984c2efca876da3623d88d63eceee", "score": "0.5833239", "text": "def update\n respond_to do |format|\n if @branch_office.update(branch_office_params)\n format.html { redirect_to @branch_office, notice: 'Branch office was successfully updated.' }\n format.json { render :show, status: :ok, location: @branch_office }\n else\n format.html { render :edit }\n format.json { render json: @branch_office.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "174df78690a8fcdae02a0f71046ce0de", "score": "0.5823688", "text": "def set_lab_branch\n @lab_branch = LabBranch.find(params[:id])\n end", "title": "" }, { "docid": "3541335681c22cc3b03ae52893dbd483", "score": "0.58209693", "text": "def update\n @build = Build.find(params[:id])\n @build.branch = Branch.find(params[:branch_id])\n\n respond_to do |format|\n if @build.update_attributes(params[:build])\n format.html { redirect_to :action => :index, :notice => 'Build was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @build.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b04614a2bdd1eff5effa30e98d065c5", "score": "0.5816856", "text": "def branch_vanity_url_details\n vanity_url = params[:vanity_url]\n branch_id = vanity_url.split('-').last\n branch_id = branch_id.to_i\n branch = Agents::Branch.where(id: branch_id).last\n if branch\n children_vanity_urls = branch.assigned_agents.map(&:vanity_url)\n branch = branch.as_json\n branch['children_vanity_urls'] = children_vanity_urls\n render json: branch, status: 200\n else\n render json: { message: 'Branch not present in the db' }, status: 400\n end\n end", "title": "" }, { "docid": "d4c771bcee9e45d0c99a273c6da4d126", "score": "0.5805368", "text": "def branch_update(project_id, id, params)\n path = sprintf(\"/api/v2/projects/%s/branches/%s\", project_id, id)\n data_hash = {}\n post_body = nil\n \n if params.present?\n unless params.kind_of?(PhraseApp::RequestParams::BranchParams)\n raise PhraseApp::ParamsHelpers::ParamsError.new(\"Expects params to be kind_of PhraseApp::RequestParams::BranchParams\")\n end\n end\n \n data_hash = params.to_h\n err = params.validate\n if err != nil\n return nil, err\n end\n reqHelper = PhraseApp::ParamsHelpers::BodyTypeHelper.new(data_hash, post_body)\n rc, err = PhraseApp.send_request(@credentials, \"PATCH\", path, reqHelper.ctype, reqHelper.body, 200)\n if err != nil\n return nil, err\n end\n \n return PhraseApp::ResponseObjects::Branch.new(JSON.load(rc.body)), err\n end", "title": "" }, { "docid": "b64dc0bf11a52606a770b7ab92d425d7", "score": "0.57600814", "text": "def update\n @military_branch = MilitaryBranch.find(params[:id])\n\n respond_to do |format|\n if @military_branch.update_attributes(params[:military_branch])\n format.html { redirect_to @military_branch, notice: 'Military branch was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @military_branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b978e53a7196f9ba6a05c2dc6fc4bbab", "score": "0.5723308", "text": "def branch(**new_options); end", "title": "" }, { "docid": "de3311b35948edf142096120468231ef", "score": "0.57217884", "text": "def create\n @contest = get_parent_contest\n @branch = @contest.branches.build(params[:branch_id])\n # @branch.update_attributes(:contest_id => :contest)\n # write_invisible_branch_attributes\n respond_to do |format|\n if @branch.update_attributes(params[:branch])\n # format.js \n format.html { redirect_to [@contest, @branch], notice: 'Branch was successfully created.' }\n format.mobile { redirect_to [@contest, @branch], notice: 'Branch was successfully created.' }\n format.json { render json: [@branch], status: :created, location: [@branch] }\n else\n format.html { render action: \"new\" }\n format.mobile { render action: \"new\" }\n format.json { render json: @branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1b38cf1f1dfa4a5dee62d86adb4b105f", "score": "0.5718258", "text": "def update\n @exam = Exam.find(params[:id])\n @oldexam = Exam.find(params[:id])\n respond_to do |format|\n if @exam.update_attributes(params[:exam])\n if params[:branch_id]==\"\"\n @exam.branch_id = @oldexam.branch_id\n else\n @exam.branch_id = params[:branch_id]\n end\n @exam.save\n format.html { redirect_to @exam, notice: 'Exam was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @exam.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "60359d4dc203c34e3c6b615786640965", "score": "0.5712825", "text": "def set_branch\n @branch = Branch.find(params[:id])\n end", "title": "" }, { "docid": "60359d4dc203c34e3c6b615786640965", "score": "0.5712825", "text": "def set_branch\n @branch = Branch.find(params[:id])\n end", "title": "" }, { "docid": "60359d4dc203c34e3c6b615786640965", "score": "0.5712825", "text": "def set_branch\n @branch = Branch.find(params[:id])\n end", "title": "" }, { "docid": "60359d4dc203c34e3c6b615786640965", "score": "0.5712825", "text": "def set_branch\n @branch = Branch.find(params[:id])\n end", "title": "" }, { "docid": "60359d4dc203c34e3c6b615786640965", "score": "0.5712825", "text": "def set_branch\n @branch = Branch.find(params[:id])\n end", "title": "" }, { "docid": "60359d4dc203c34e3c6b615786640965", "score": "0.5712825", "text": "def set_branch\n @branch = Branch.find(params[:id])\n end", "title": "" }, { "docid": "60359d4dc203c34e3c6b615786640965", "score": "0.5712825", "text": "def set_branch\n @branch = Branch.find(params[:id])\n end", "title": "" }, { "docid": "60359d4dc203c34e3c6b615786640965", "score": "0.5712825", "text": "def set_branch\n @branch = Branch.find(params[:id])\n end", "title": "" }, { "docid": "60359d4dc203c34e3c6b615786640965", "score": "0.5712825", "text": "def set_branch\n @branch = Branch.find(params[:id])\n end", "title": "" }, { "docid": "60359d4dc203c34e3c6b615786640965", "score": "0.5712825", "text": "def set_branch\n @branch = Branch.find(params[:id])\n end", "title": "" }, { "docid": "035f08e5b091c4704fa100b63904cc5c", "score": "0.5708151", "text": "def update(controller)\n @model.clear\n controller.repository.branches.each do |branch|\n itr = @model.append\n itr[0] = branch.name\n end\n end", "title": "" }, { "docid": "13372b93de4fb7e5f324dffdc8f5097d", "score": "0.56573176", "text": "def set_client_branch\n @client_branch = ClientBranch.find(params[:id])\n end", "title": "" }, { "docid": "4d88a5e87fb8705d12b3da5ce5962a48", "score": "0.56547916", "text": "def branch_params\n params.require(:branch).permit(:name, :company_id)\n end", "title": "" }, { "docid": "627b426c1b2a89e2f47dc88242dc2685", "score": "0.565149", "text": "def create\n @institutions_branch = InstitutionsBranch.new(institutions_branch_params)\n\n respond_to do |format|\n if @institutions_branch.save\n format.html { redirect_to @institutions_branch, notice: 'Institutions branch was successfully created.' }\n format.json { render action: 'show', status: :created, location: @institutions_branch }\n else\n format.html { render action: 'new' }\n format.json { render json: @institutions_branch.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aef9bc4a68afc6e060662e12d2fa524a", "score": "0.5650871", "text": "def branch_params\n params.require(:branch).permit(:branch_id, :branch, :master_id, :description, :manager_id, :group )\n end", "title": "" }, { "docid": "153ad71c334555a798a03568ac7dbef4", "score": "0.5648569", "text": "def branch_params\n params.require(:branch).permit(:project_id, :name)\n end", "title": "" }, { "docid": "3707efae5db40423a1da6a6036f49b68", "score": "0.5639477", "text": "def version_specific_branches\n @branches ||= github_api_authenticated_get(\"/repos/#{repository_slug}/branches\").map do |x|\n if x.fetch('name') =~ /\\A(\\d)-(\\d)-\\w+\\z/\n { name: x['name'], version: Gem::Version.new($1 + '.' + $2) }\n end\n end.compact\nend", "title": "" }, { "docid": "c86ae3e2dfc492ec68d17dafb627e6af", "score": "0.5638274", "text": "def branch_params\n params.require(:branch).permit(:nombre, :direccion, :telefono, :company_id)\n end", "title": "" }, { "docid": "d9ee2d3a2bfe7f14368d62a85e311212", "score": "0.5600339", "text": "def test_push_branch_heirarchy\n svc = service :push, @data\n\n stub_payload svc.payload\n\n svc.payload['ref'] = 'refs/heads/feature/branch_name'\n\n @stubs.post \"/v3/bots/post\" do |env|\n body = JSON.parse(env[:body])\n assert_equal expected_description(branch: 'feature/branch_name'), body['text']\n [200, {}, '']\n end\n\n svc.receive_push\n end", "title": "" }, { "docid": "dad66ed757afe6bccb28aaf4b8dfadef", "score": "0.55819917", "text": "def api_update\n ##############################\n ### STEP 1: UPDATE COMMITS ###\n ##############################\n\n # gather commits from GitHub api\n # for new branch, just grab first 100 commits (bleeds into past branches)\n commits_data = Branch.api(auto_paginate: false).\n commits(Branch.repo_path, sha: self.name, per_page: 100)\n unless commits.length.zero?\n # for existing branch, grab up to 500 commits in successive api calls\n # limit of 500 is abitrary, but the madness must stop somewhere if we\n # can't find any existing commits\n call_count = 1\n while commits.where(sha: commits_data.pluck(:sha)).count.zero? &&\n call_count < 5\n commits_data.concat(\n Branch.api(auto_paginate: false).commits(\n Branch.repo_path, sha: self.name, per_page: 100,\n page: call_count + 1\n )\n )\n call_count += 1\n end\n end\n\n # add/update commits to database. Hold on to commits so we can more easily\n # create memberships. Thankfully, these commits should already be ordered\n # (most recent first), so we can use this\n # to generate the new ordering. We also add memberships at this point,\n # (implicit in create_or_update_from_github_hash) but they will be updated\n # by the ordering code below\n commits = commits_data.map do |gh_hash|\n Commit.create_or_update_from_github_hash(github_hash: gh_hash,\n branch: self)\n end\n\n # for new commits, they need their test cases loaded. This is an expensive\n # set of api calls that grows with the number of \"new\" commits.\n commits.select { |c| c.test_case_count == 0 }.each do |c|\n c.api_update_test_cases\n c.save\n end\n\n ############################################\n ### STEP 2: UPDATE MEMBERSHIPS/POSITIONS ###\n ############################################\n\n # get position of \"oldest\" commit in this collection (if there is one)\n earliest_position = (branch_memberships.where.not(commit: commits).\n maximum(:position) || 0) + 1\n\n # create the membership hashes. Reverse the list of ids so that \"old\"\n # commits come first, and thus have smaller positions, which are derived\n # from their position in this reversed array\n membership_hashes = []\n commits.reverse.each_with_index do |commit, i|\n membership_hashes << {\n branch_id: self.id,\n commit_id: commit.id,\n position: earliest_position + i\n }\n end\n\n # dump it all into the database, updating existing membership's positions\n # and creating the rest from scratch. upsert_all is amazing.\n BranchMembership.upsert_all(membership_hashes,\n unique_by: [:commit_id, :branch_id])\n\n # update head to most recent (highest position) commit, and save to the db\n self.head = branch_memberships.where.not(position: nil).\n order(position: :desc).first.commit\n self.save\n end", "title": "" }, { "docid": "392160cce1a2bb18c3db770aaa6c239b", "score": "0.5577962", "text": "def show\n render json: @branch\n end", "title": "" }, { "docid": "bcaed1b681735de26008db8b7d825a13", "score": "0.55762655", "text": "def build_branches; end", "title": "" }, { "docid": "ef88ae20f7884fa8f70645dfa6ca7d14", "score": "0.55696756", "text": "def update\n respond_to do |format|\n if @branch_product.update(branch_product_params)\n format.html { redirect_to @branch_product, notice: 'Branch product was successfully updated.' }\n format.json { render :show, status: :ok, location: @branch_product }\n else\n format.html { render :edit }\n format.json { render json: @branch_product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ed253bee43880c7885d3945bca475d21", "score": "0.5555599", "text": "def update\n branch_options\n respond_to do |format|\n if @cover.update(cover_params)\n format.html { redirect_to location_covers_path, notice: \"Cobertura (#{@cover.name}) foi atualizada com sucesso\"}\n format.json { render :show, status: :ok, location: @cover }\n else\n format.html { render :edit }\n format.json { render json: @cover.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c914166d2c63259b57fe70e5c104ed62", "score": "0.55526286", "text": "def branches(num)\n config_set(:branches, num)\n end", "title": "" }, { "docid": "a6d8de34384a421aaa1345eb85c0adcf", "score": "0.55509645", "text": "def branch_params\n params.require(:branch).permit(:name, :description, :company_id, :manager_id, :city_id, :state_id, :code, :fleet_cost)\n end", "title": "" }, { "docid": "8e73edf522ad44be2a8b3702511b4524", "score": "0.55497104", "text": "def branch\n updateModuleInfo unless @branch\n @branch\n end", "title": "" }, { "docid": "6e16a4b1ab1fac9e4408f3ff87b8499f", "score": "0.554806", "text": "def update\n @branch_comment = BranchComment.find(params[:id])\n\n respond_to do |format|\n if @branch_comment.update_attributes(params[:branch_comment])\n format.html { redirect_to @branch_comment, notice: 'Branch comment was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @branch_comment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "abfd11cb47444526eb8f2a6173d0a8f1", "score": "0.5544358", "text": "def set_branch\n @branch = Branch.find(params[:id])\n end", "title": "" }, { "docid": "abfd11cb47444526eb8f2a6173d0a8f1", "score": "0.5544358", "text": "def set_branch\n @branch = Branch.find(params[:id])\n end", "title": "" }, { "docid": "a5f6d696b9a6cd933c145a6a6a5d7140", "score": "0.55278623", "text": "def update\n @root = \"projects\"\n @branch = \"new\" \n \n @project = Project.find(params[:id])\n\n respond_to do |format|\n if @project.update_attributes(params[:project])\n format.html { redirect_to @project, notice: 'Project was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "db450dcae1f6a3899397870b27b9898c", "score": "0.5525776", "text": "def branches_list_with_http_info(project_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: BranchesApi.branches_list ...'\n end\n # verify the required parameter 'project_id' is set\n if @api_client.config.client_side_validation && project_id.nil?\n fail ArgumentError, \"Missing the required parameter 'project_id' when calling BranchesApi.branches_list\"\n end\n # resource path\n local_var_path = '/projects/{project_id}/branches'.sub('{' + 'project_id' + '}', CGI.escape(project_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?\n query_params[:'per_page'] = opts[:'per_page'] if !opts[:'per_page'].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 header_params[:'X-PhraseApp-OTP'] = opts[:'x_phrase_app_otp'] if !opts[:'x_phrase_app_otp'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:body] \n\n # return_type\n return_type = opts[:return_type] || 'Array<Branch>' \n\n # auth_names\n auth_names = opts[:auth_names] || ['Basic', 'Token']\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: BranchesApi#branches_list\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n response = ::Phrase::Response.new(data, headers)\n return response, status_code, headers\n end", "title": "" }, { "docid": "b44f501c4cfc94f2e7b48de8e59dbb09", "score": "0.55198324", "text": "def update\n @branch_flyer = BranchFlyer.find(params[:id])\n\n respond_to do |format|\n if @branch_flyer.update_attributes(params[:branch_flyer])\n format.html { redirect_to @branch_flyer, notice: 'Branch flyer was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @branch_flyer.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2695f265ee3aac4aed7f07bde49fab5a", "score": "0.5517698", "text": "def index\n @branches = Api::V1::Branch.all\n\n render json: @branches\n end", "title": "" }, { "docid": "fa86b3fa6e59e04ff28b64a79d201c56", "score": "0.5515973", "text": "def update_crumbs\n\t\t\t@crumb = JSON.parse(get_json('/crumbIssuer').body)\n\t\tend", "title": "" }, { "docid": "ba81089be8acc24579740054c86a0ebc", "score": "0.55152744", "text": "def update_pull_branch(repo, pull_number, options = {})\n opts = options.dup\n opts[:accept] = 'application/vnd.github.lydian-preview+json' if opts[:accept].nil?\n\n put \"#{Repository.path repo}/pulls/#{pull_number}/update-branch\", opts\n end", "title": "" }, { "docid": "81b45656d39727f7be6711369a9d3a3a", "score": "0.5513647", "text": "def set_branch\n puts params[:restaurant_id]\n @restaurant = Restaurant.find(params[:restaurant_id])\n @branch = @restaurant.branches.find(params[:id])\n \n end", "title": "" }, { "docid": "570cf099b6dfc05316cd36853e0e78ec", "score": "0.55112463", "text": "def new\n @branch = current_staff.company.branches.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @branch }\n end\n end", "title": "" }, { "docid": "4b8237c1cade0c6f643ad31125ac51fc", "score": "0.55027974", "text": "def set_external_branch\n @external_branch = ExternalBranch.find(params[:id])\n end", "title": "" } ]
4cf59afe20b63297fc53389c5355b544
GET /discussions/new GET /discussions/new.json
[ { "docid": "40e4291641c417fe8cce4a908401f4d7", "score": "0.68824583", "text": "def new\n @discussion = Discussion.new\n if !params[:establish].nil?\n @note = Establish.find(params[:establish]).chapter.find(params[:chapter]).note.find(params[:note])\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.js\n end\n end", "title": "" } ]
[ { "docid": "02ddb1c0b894ef1539299a309f036bf6", "score": "0.8492052", "text": "def new\n @discussion = Discussion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @discussion }\n end\n end", "title": "" }, { "docid": "02ddb1c0b894ef1539299a309f036bf6", "score": "0.8492052", "text": "def new\n @discussion = Discussion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @discussion }\n end\n end", "title": "" }, { "docid": "02ddb1c0b894ef1539299a309f036bf6", "score": "0.8492052", "text": "def new\n @discussion = Discussion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @discussion }\n end\n end", "title": "" }, { "docid": "82f211fd34d6f556273dac71866ecb4a", "score": "0.7827007", "text": "def new\n @discussion = Discussion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @discussion }\n end\n end", "title": "" }, { "docid": "39ae940e10470d7f009106087bfb3824", "score": "0.77731997", "text": "def new\n @discuss = Discuss.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @discuss }\n end\n end", "title": "" }, { "docid": "e3af470198e361c056066bc9f61583d9", "score": "0.77585775", "text": "def new\n @discussion = Discussion.new\n render :new\n end", "title": "" }, { "docid": "c94306bcd6f18cf1b37d59886fb40152", "score": "0.77571326", "text": "def new\n @project = Project.find(params[:project_id])\n @discussion = @project.discussions.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @discussion }\n end\n end", "title": "" }, { "docid": "e83d59461fa6b9b890559e82308484d7", "score": "0.7593768", "text": "def create\n @discussion = Discussion.new(params[:discussion])\n\n respond_to do |format|\n if @discussion.save\n format.html { redirect_to @discussion, notice: 'Discussion was successfully created.' }\n format.json { render json: @discussion, status: :created, location: @discussion }\n else\n format.html { render action: \"new\" }\n format.json { render json: @discussion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "775f0858008eae528458084dd87c188d", "score": "0.73149246", "text": "def create\n @discussion = @issue.discussions.build(discussion_params)\n\n respond_to do |format|\n if @discussion.save\n format.html { redirect_to lecture_issue_discussion_path(discussion_id: @discussion.id), notice: 'Discussion was successfully created.' }\n format.json { render :show, status: :created, location: @discussion }\n else\n format.html { render :new }\n format.json { render json: @discussion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "189eb8778dd8bdb4a4bdb5044df86760", "score": "0.73138326", "text": "def create\n @discussion = current_user.discussions.new(discussion_params)\n\n respond_to do |format|\n if @discussion.save\n format.html { redirect_to discussions_path, notice: 'Discussion was successfully created.' }\n format.json { render :show, status: :created, location: @discussion }\n else\n format.html { redirect_to discussions_path, alert: 'Discussion not successfully created' }\n format.json { render json: @discussion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a5a5cef98125bc91a6376b45d3bb2e55", "score": "0.72955024", "text": "def new\n @issue = Issue.new\n\n @new = true\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @issue }\n end\n end", "title": "" }, { "docid": "617a600e44ad33631c4b575cadbf17ad", "score": "0.7284995", "text": "def create\n @discussion = current_user.discussions.build(params[:discussion])\n\n respond_to do |format|\n if @discussion.save\n log_add @discussion\n\n format.html { redirect_to discussions_path, flash: { success: 'Discussion had been created.' } }\n format.json { render json: @discussion, status: :created, location: @discussion }\n else\n format.html { render action: \"new\" }\n format.json { render json: @discussion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5cdec3c2f76f026a0ff64fa243fc01eb", "score": "0.72212857", "text": "def new\n @talk_comment = TalkComment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @talk_comment }\n end\n end", "title": "" }, { "docid": "94ac1c221762c13bad60159cf04f08a4", "score": "0.71637005", "text": "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "title": "" }, { "docid": "94ac1c221762c13bad60159cf04f08a4", "score": "0.7162685", "text": "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "title": "" }, { "docid": "94ac1c221762c13bad60159cf04f08a4", "score": "0.7162685", "text": "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "title": "" }, { "docid": "94ac1c221762c13bad60159cf04f08a4", "score": "0.7162685", "text": "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "title": "" }, { "docid": "94ac1c221762c13bad60159cf04f08a4", "score": "0.7162685", "text": "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "title": "" }, { "docid": "94ac1c221762c13bad60159cf04f08a4", "score": "0.7162685", "text": "def new\n @topic = Topic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "title": "" }, { "docid": "9bc9d588cf56a86eaad978c51af6c416", "score": "0.7113582", "text": "def new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "title": "" }, { "docid": "4941c29c041cebf0f33e2dbdfb552e40", "score": "0.71094346", "text": "def create\n @discussion = Discussion.new(discussion_params)\n if @discussion.save\n redirect_to discussions_path\n else \n render :new\n end\n end", "title": "" }, { "docid": "27e8822ed1b4df0abcfc2b14a4b84be8", "score": "0.7107508", "text": "def create\n @discussion = Discussion.new(discussion_params)\n\n respond_to do |format|\n if @discussion.save\n format.html { redirect_to @discussion, notice: 'Discussion was successfully created.' }\n else\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "811460cb36e62bb7354935ea69cd2054", "score": "0.7095746", "text": "def create\n @discussion = Discussion.new(discussion_params)\n\n respond_to do |format|\n if @discussion.save\n format.html { redirect_to [@course, @discussion], notice: 'Discussion was successfully created.' }\n format.json { render :show, status: :created, location: @discussion }\n else\n format.html { render :new }\n format.json { render json: @discussion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3019a4e38ed29b24b9ed428ca12e92b3", "score": "0.7083812", "text": "def new\n @discussions = current_user.discussions.order(\"updated_at DESC\")\n #@discussion = Discussion.find(params[:id]) \n @message = @discussion.messages.new\n\n if params[:recipient_id].present?\n @recipient = User.find(params[:recipient_id])\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "af56e53d9176e313d41fc8cbb3779065", "score": "0.7068273", "text": "def new\n @issue = Issue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @issue }\n end\n end", "title": "" }, { "docid": "7cfdb17c0e91274c03ab2d1717cc71f8", "score": "0.70648736", "text": "def create\n @project = Project.find(params[:project_id])\n @discussion = @project.discussions.new(params[:discussion])\n\n respond_to do |format|\n if @discussion.save\n format.html { redirect_to(project_discussion_path(@project, @discussion), :notice => 'Discussion was successfully created.') }\n format.xml { render :xml => @discussion, :status => :created, :location => @discussion }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @discussion.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3772671a7527733a754ac0d7a46d6cba", "score": "0.7040067", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @forum }\n end\n end", "title": "" }, { "docid": "b529a6c6bf5864aeed05c4a4d18360c3", "score": "0.70378333", "text": "def new\n @reply = Reply.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @reply }\n end\n end", "title": "" }, { "docid": "53af054b1a2ea3765ea3b799f2edbd11", "score": "0.70339", "text": "def new\n @announcement = Announcement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @announcement }\n end\n end", "title": "" }, { "docid": "ce6aa8626adcf9b91f92de195878f292", "score": "0.70265347", "text": "def new\n @comment = @posting.comments.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "7b00db6013cdb4983929029ec5e6145f", "score": "0.70236385", "text": "def new\n @announce = Announce.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @announce }\n end\n end", "title": "" }, { "docid": "667f010d344e5e433162b1c57c6de657", "score": "0.70231956", "text": "def new\n @discussion = Discussion.new\n @comment_assignment = CommentAssignments.new\n end", "title": "" }, { "docid": "6c7d7a3e7c92adc73426128a00c4c793", "score": "0.7019881", "text": "def new\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "6c7d7a3e7c92adc73426128a00c4c793", "score": "0.7019881", "text": "def new\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "6c7d7a3e7c92adc73426128a00c4c793", "score": "0.7019881", "text": "def new\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "6c7d7a3e7c92adc73426128a00c4c793", "score": "0.7019881", "text": "def new\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "6c7d7a3e7c92adc73426128a00c4c793", "score": "0.7019881", "text": "def new\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "6c7d7a3e7c92adc73426128a00c4c793", "score": "0.7019881", "text": "def new\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "6c7d7a3e7c92adc73426128a00c4c793", "score": "0.7019881", "text": "def new\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "6c7d7a3e7c92adc73426128a00c4c793", "score": "0.7019881", "text": "def new\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "6c7d7a3e7c92adc73426128a00c4c793", "score": "0.7019881", "text": "def new\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "6c7d7a3e7c92adc73426128a00c4c793", "score": "0.7019881", "text": "def new\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "6c7d7a3e7c92adc73426128a00c4c793", "score": "0.7019881", "text": "def new\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "6c7d7a3e7c92adc73426128a00c4c793", "score": "0.7019881", "text": "def new\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "0fcb92c3b840bd76177c19636fbd6c6f", "score": "0.701349", "text": "def create\n @discussion = Discussion.new(params[:discussion])\n\n respond_to do |format|\n if @discussion.save\n flash[:notice] = 'Discussion was successfully created.'\n format.html { redirect_to(@discussion) }\n format.xml { render :xml => @discussion, :status => :created, :location => @discussion }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @discussion.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8477534dd23b16faeda5411810e3d9ef", "score": "0.7010334", "text": "def new\n @forum = Forum.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @forum }\n end\n end", "title": "" }, { "docid": "0077053012a542d6f5a12b0baab5071e", "score": "0.7008491", "text": "def create\n\t\t@discussion = Discussion.new(params[:discussion])\n\t\[email protected] = self.current_user\n\n\t\trespond_to do |format|\n\t\t\tif @discussion.save\n\t\t\t\tif params[:skills]\n\t\t\t\t\tparams[:skills].uniq.each do |skill_id|\n\t\t\t\t\t\tDiscussionTag.create(:discussion => @discussion, :skill_id => skill_id)\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\tif @discussion.owner.nil?\n\t\t\t\t\t# Tell the whiteboard about this new discussion\n\t\t\t\t\tWhiteboard.createActivity(:created_discussion, \"{user.link} created a new discussion {tag.link}.\", @discussion)\n\t\t\t\telsif @discussion.owner.is_a?(Group)\n\t\t\t\t\tfor user in @discussion.owner.users(:discussion_notifications)\n\t\t\t\t\t\t# @todo I know it was my idea but lets switch to rails 3 polymorphic instead of tag!\n\t\t\t\t\t\tNotification.create(:notifiable_type => @discussion.tag!, :user_id => user.id, :message => \"{triggered.link} created a discussion on {tag.owner.link} go read {tag.link}.\", :link => @discussion.url, :bucket => :discussions)\n\n\t\t\t\t\t\t# Tell the whiteboard about this new discussion if the discussions are public\n\t\t\t\t\t\tif @discussion.owner.permissions.public_discussions\n\t\t\t\t\t\t\tWhiteboard.createActivity(:created_discussion, \"{user.link} created a new discussion {tag.link}.\", @discussion)\n\t\t\t\t\t\tend\n\t\t\t\t\tend\n\t\t\t\tend\n\n\t\t\t\t# Log a analytic about the discussion creation\n\t\t\t\tself.log_analytic(:discussion_creation, \"New discussion was created.\", @discussion, [], :discussions)\n\n\t\t\t\tformat.html { redirect_to @discussion, notice: 'Discussion was successfully created.' }\n\t\t\t\tformat.json { render json: @discussion, status: :created, location: @discussion }\n\t\t\telse\n\t\t\t\tformat.html { render action: \"new\" }\n\t\t\t\tformat.json { render json: @discussion.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "80d74132ba4103ec3fba9d1df8a99bc5", "score": "0.7006813", "text": "def new\n @topic = Topic.new\n @page_title = \"New Topic\"\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "title": "" }, { "docid": "a7a79ef8095b60116f5ae4d0590b1b59", "score": "0.7005808", "text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @notes }\n end\n end", "title": "" }, { "docid": "2b61f2dbe5878756f73e56e12efbdafe", "score": "0.6999881", "text": "def new\n @story_comment = StoryComment.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @story_comment }\n end\n end", "title": "" }, { "docid": "e36d999eded61103c7bb4e26988e2e83", "score": "0.69836754", "text": "def new\n load_data\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "a8a00278b3c896e78ae17b03f9dc8db3", "score": "0.69773173", "text": "def new\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @comment }\n end\n end", "title": "" }, { "docid": "a8a00278b3c896e78ae17b03f9dc8db3", "score": "0.69773173", "text": "def new\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @comment }\n end\n end", "title": "" }, { "docid": "c2f96a613cdfd6b2a7af8dba427e925b", "score": "0.69719124", "text": "def new\n @comment = Comment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "da4818f012c3033f1d9fc68cd2ae84dd", "score": "0.6958411", "text": "def new\n @news_post = NewsPost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news_post }\n end\n end", "title": "" }, { "docid": "da4818f012c3033f1d9fc68cd2ae84dd", "score": "0.6958411", "text": "def new\n @news_post = NewsPost.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news_post }\n end\n end", "title": "" }, { "docid": "3009139465d2c4e30d06f777ece4a48a", "score": "0.6949606", "text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @note }\n end\n end", "title": "" }, { "docid": "3009139465d2c4e30d06f777ece4a48a", "score": "0.6949606", "text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @note }\n end\n end", "title": "" }, { "docid": "3009139465d2c4e30d06f777ece4a48a", "score": "0.6949606", "text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @note }\n end\n end", "title": "" }, { "docid": "3009139465d2c4e30d06f777ece4a48a", "score": "0.6949606", "text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @note }\n end\n end", "title": "" }, { "docid": "bfe3a2c256e9edd1fef2efed3abfa4fb", "score": "0.6945672", "text": "def new\n @comment = @commentable.comments.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @comment }\n end\n end", "title": "" }, { "docid": "a4dce94ffb5b1b00758f8b8bad53362c", "score": "0.6921555", "text": "def create\n @discussion = Discussion.new(discussion_params)\n @discussion.user = @user\n respond_to do |format|\n if @discussion.save\n format.html { redirect_to @discussion, notice: 'Discussion was successfully created.' }\n format.json { render :show, status: :created, location: @discussion }\n else\n format.html { render :new }\n format.json { render json: @discussion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b6eb08445dfe3df19f6a3f1834824e55", "score": "0.6898681", "text": "def new\n @issue = @issuable.issues.new\n @issue.comments.build\n\n respond_to do |format|\n format.html { render layout: 'form' }# new.html.erb\n format.json { render json: @issue }\n end\n end", "title": "" }, { "docid": "012e700a9e22a40ec4803ed0d7bfd2d3", "score": "0.68982124", "text": "def new\n @thread = Discussion.new\n @post = Post.new\n end", "title": "" }, { "docid": "fd048681fb350fbe611102d0642340f0", "score": "0.6895963", "text": "def new\n @normal_issue = NormalIssue.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @normal_issue }\n end\n end", "title": "" }, { "docid": "c1de4196d7641700bac9b72866e27e81", "score": "0.6894376", "text": "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @story }\n end\n end", "title": "" }, { "docid": "c1de4196d7641700bac9b72866e27e81", "score": "0.6894376", "text": "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @story }\n end\n end", "title": "" }, { "docid": "c1de4196d7641700bac9b72866e27e81", "score": "0.6894376", "text": "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @story }\n end\n end", "title": "" }, { "docid": "c1de4196d7641700bac9b72866e27e81", "score": "0.6894376", "text": "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @story }\n end\n end", "title": "" }, { "docid": "2dea65612fc14726fc90a0ebda1740c8", "score": "0.68922883", "text": "def new\n @topic = Topic.new\n respond_to do |format|\n format.html { render 'form' }\n format.json { render json: @topic }\n end\n end", "title": "" }, { "docid": "9da1b4c9c88b5fc81cfc2e8484599db1", "score": "0.6891474", "text": "def new\n @problem = Problem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @problem }\n end\n end", "title": "" }, { "docid": "9da1b4c9c88b5fc81cfc2e8484599db1", "score": "0.6891474", "text": "def new\n @problem = Problem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @problem }\n end\n end", "title": "" }, { "docid": "b07319ec09915764633db02e44945fe4", "score": "0.68810344", "text": "def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news }\n end\n end", "title": "" }, { "docid": "b07319ec09915764633db02e44945fe4", "score": "0.68808883", "text": "def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news }\n end\n end", "title": "" }, { "docid": "b07319ec09915764633db02e44945fe4", "score": "0.6879789", "text": "def new\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news }\n end\n end", "title": "" }, { "docid": "c7301abf3bc31a0c97e703af0d3eab40", "score": "0.6873601", "text": "def new\n @news = News.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news }\n end\n end", "title": "" }, { "docid": "c63fe512145bb19ee2e8a866fbe2e907", "score": "0.68724006", "text": "def create\n @board = Board.friendly.find(params[:board_id])\n @discussion = @board.discussions.build(discussion_params)\n\n respond_to do |format|\n if @discussion.save\n format.html { redirect_to board_discussion_path(@board, @discussion), flash: {success: 'Discussion was successfully created.' } }\n format.json { render action: 'show', status: :created, location: @discussion }\n else\n format.html { redirect_to @board, alert: \"Discussion could not be created.\" }\n format.json { render json: @discussion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c2eae2e9c41ccc8a3636f85cb2cc15dd", "score": "0.68700385", "text": "def new\n @community_topic = CommunityTopic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @community_topic }\n end\n end", "title": "" }, { "docid": "936c67a7c1d78b79c77dce97b1e986b5", "score": "0.6867637", "text": "def new\n @note = Note.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @note }\n end\n end", "title": "" }, { "docid": "cc43d27a962a6f9280e9cc99bb29463b", "score": "0.68581486", "text": "def new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @news_post }\n end\n end", "title": "" }, { "docid": "176f2ddb9f303a7165454386636652dc", "score": "0.68560165", "text": "def new\n @conversation = Conversation.new\n logger.debug \"In new!\"\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @conversation }\n end\n end", "title": "" }, { "docid": "a0fc944bb2df67beb24d15a2f65036db", "score": "0.68559283", "text": "def new\n # Create new news\n @news = News.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @news }\n end\n end", "title": "" }, { "docid": "ea3f4a75be51a4df566feae3f8666770", "score": "0.6852146", "text": "def new\n @problem = Problem.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @problem }\n end\n end", "title": "" }, { "docid": "ecb4dd029861d5891de0b5a34dd71b70", "score": "0.68496513", "text": "def new\n @talk = Talk.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @talk }\n end\n end", "title": "" }, { "docid": "ecb4dd029861d5891de0b5a34dd71b70", "score": "0.68496513", "text": "def new\n @talk = Talk.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @talk }\n end\n end", "title": "" }, { "docid": "420faaf90103a36dc92c0573016e6787", "score": "0.6848459", "text": "def new\n @bug_comment = BugComment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @bug_comment }\n end\n end", "title": "" }, { "docid": "ab0a58c4d637bcbea479bbc99c8fa5c8", "score": "0.68449044", "text": "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @story }\n end\n end", "title": "" }, { "docid": "ab0a58c4d637bcbea479bbc99c8fa5c8", "score": "0.68449044", "text": "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @story }\n end\n end", "title": "" }, { "docid": "ab0a58c4d637bcbea479bbc99c8fa5c8", "score": "0.68449044", "text": "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @story }\n end\n end", "title": "" }, { "docid": "ab0a58c4d637bcbea479bbc99c8fa5c8", "score": "0.68449044", "text": "def new\n @story = Story.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @story }\n end\n end", "title": "" }, { "docid": "117e404e83927cd827ee85c4baf2e712", "score": "0.6833356", "text": "def create\n @discussion_comment = DiscussionComment.new(discussion_comment_params)\n\n respond_to do |format|\n if @discussion_comment.save\n format.html { redirect_to @discussion_comment, notice: 'DiscussionComment was successfully created.' }\n format.json { render json: @discussion_comment }\n else\n format.html { render :new }\n format.json { render json: @discussion_comment.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "05b72d3cd9bbf321372a114fd558befe", "score": "0.68322766", "text": "def new\n @neighborhood_topic = NeighborhoodTopic.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @neighborhood_topic }\n end\n end", "title": "" }, { "docid": "0fb090e90a536631956e262fb8d92fe3", "score": "0.6831242", "text": "def new\n @talk = Talk.new\n\n respond_to do |format|\n format.html # new.html.haml\n format.json { render json: @talk }\n end\n end", "title": "" }, { "docid": "9fc1f6fd83aaa38c233495d4fd4246d4", "score": "0.6817735", "text": "def new\n @forum = Forum.find(params[:forum_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @topic }\n end\n end", "title": "" }, { "docid": "b3ab61cb691f96949ceb9c56499bfa46", "score": "0.68049675", "text": "def new\n @talk_category = TalkCategory.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @talk_category }\n end\n end", "title": "" }, { "docid": "598b631f0aa0246713c7705594a49107", "score": "0.6800804", "text": "def new\n @talk = Talk.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @talk }\n end\n end", "title": "" }, { "docid": "e5cb766fd310f47d626d290181a0cb53", "score": "0.67874736", "text": "def new\n @dish_comment = @dish.dish_comments.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @dish_comment }\n end\n end", "title": "" }, { "docid": "4560fed8f38589c3b11d11a81b990851", "score": "0.678169", "text": "def create\n @discussion = Discussion.new(params[:discussion])\n if @discussion.save\n render :partial => 'discussion',\n :locals => {\n :discussion => @discussion,\n :li_number => @discussion.page.discussions.size\n }\n else\n render :xml => @discussion.errors.to_xml, :status => 500\n end\n end", "title": "" }, { "docid": "540e26ec2082baa58c36a1b4edb21683", "score": "0.6777477", "text": "def new\n \n @post = Post.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @post }\n end\n end", "title": "" }, { "docid": "92fed82c2ee53e7cddb321b8a89e5905", "score": "0.677568", "text": "def new\n @questionnaire = Questionnaire.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @questionnaire }\n end\n end", "title": "" } ]
692aa71a499b165dbbdfc9563f68d14f
Ask the user about missing dependencies. This method will use a user interface to know what to do with missing dependencies. For each dependency, choices are: Install it Ignore it Change the context to find it (select directory...) Parameters:: ioInstaller (_Installer_): The RDI installer iMissingDependencies (list): The missing dependencies list Return:: list: The corresponding user choices
[ { "docid": "dcee931dfb7e14a2af161e75548cd85c", "score": "0.76604766", "text": "def execute(ioInstaller, iMissingDependencies)\n # List of corresponding dependencies user choices\n # list< DependencyUserChoice >\n rDependenciesUserChoices = []\n\n @Called = true\n @MissingDependencies = iMissingDependencies\n iMissingDependencies.each do |iDepDesc|\n rDependenciesUserChoices << RDI::Model::DependencyUserChoice.new(ioInstaller, 'RegressionUI', iDepDesc)\n end\n if (@Ignore)\n rDependenciesUserChoices.each do |ioDepUserChoice|\n ioDepUserChoice.set_ignore\n end\n elsif (@Locate)\n rDependenciesUserChoices.each do |ioDepUserChoice|\n ioDepUserChoice.set_locate\n ioDepUserChoice.affect_context_modifier('SystemPath')\n end\n elsif (@InstallOtherLocation)\n # We want to install to another location\n rDependenciesUserChoices.each do |ioDepUserChoice|\n iInstallName, iInstallContent, iContextModifiers = ioDepUserChoice.DepDesc.Installers[0]\n # Read the installer plugin\n ioInstaller.access_plugin('Installers', iInstallName) do |iPlugin|\n lIdx = 0\n iPlugin.PossibleDestinations.each do |iDestInfo|\n iFlavour, iLocation = iDestInfo\n if (iFlavour == DEST_OTHER)\n # Found it\n ioDepUserChoice.set_installer(0, lIdx)\n ioDepUserChoice.select_other_install_location(iLocation)\n break\n end\n lIdx += 1\n end\n end\n end\n else\n # We want to install.\n # Make sure we do so in the local destination\n rDependenciesUserChoices.each do |ioDepUserChoice|\n iInstallName, iInstallContent, iContextModifiers = ioDepUserChoice.DepDesc.Installers[0]\n # Read the installer plugin\n ioInstaller.access_plugin('Installers', iInstallName) do |iPlugin|\n lIdx = 0\n iPlugin.PossibleDestinations.each do |iDestInfo|\n iFlavour, iLocation = iDestInfo\n if (iFlavour == DEST_LOCAL)\n # Found it\n ioDepUserChoice.set_installer(0, lIdx)\n @InstallLocation = iLocation\n break\n end\n lIdx += 1\n end\n end\n end\n end\n\n return rDependenciesUserChoices\n end", "title": "" } ]
[ { "docid": "71bac829bb330e7286927fbd1d31e05c", "score": "0.7524566", "text": "def askUserForMissingDeps(iMissingDependencies, iPreferredViewsList)\n rDependenciesUserChoices = []\n\n lViewsList = iPreferredViewsList\n if ((iPreferredViewsList == nil) or\n (iPreferredViewsList.empty?))\n # Set all views as being preferred\n lViewsList = @Plugins.get_plugins_names('Views')\n end\n if (lViewsList.empty?)\n log_bug 'No view was accessible among plugins. Please check your Plugin/Views directory.'\n else\n # Now we try to select 1 view that is accessible without any dependency installation\n lPlugin = nil\n lViewsList.each do |iViewName|\n lPlugin, _ = @Plugins.get_plugin_instance('Views', iViewName,\n :OnlyIfExtDepsResolved => true,\n :RDIInstaller => self\n )\n if (lPlugin != nil)\n # Found one\n log_debug \"Executing View #{iViewName}\"\n break\n end\n end\n if (lPlugin == nil)\n # Now we try to install them\n lViewsList.each do |iViewName|\n lPlugin, _ = @Plugins.get_plugin_instance('Views', iViewName,\n :RDIInstaller => self\n )\n if (lPlugin != nil)\n # Found one\n log_debug \"Executing View #{iViewName}\"\n break\n end\n end\n end\n if (lPlugin == nil)\n log_bug 'After trying all preferred views, we are still unable to have one.'\n else\n # Call it\n rDependenciesUserChoices = lPlugin.execute(self, iMissingDependencies)\n end\n end\n\n return rDependenciesUserChoices\n end", "title": "" }, { "docid": "cbc85174c0915f055a00342e077eaf39", "score": "0.6933034", "text": "def testInputMissingDeps\n lCalled = false\n setupAppDir do\n setupRegressionUI('RDI::Test::Flows::UIFlows::RegressionUI') do\n # Call the installer expecting the GUI to appear\n lDesc = getSimpleDesc\n lError, lCMApplied, lIgnoredDeps, lUnresolvedDeps = @Installer.ensure_dependencies( [ lDesc ], {\n :preferred_views => [ 'RegressionUI' ]\n } )\n assert_equal(nil, lError)\n assert_equal( [], lIgnoredDeps )\n assert_equal( [], lUnresolvedDeps )\n # Get the plugin back\n @Installer.access_plugin('Views', 'RegressionUI') do |iPlugin|\n # Check that it was called correctly\n lCalled = iPlugin.Called\n assert_equal( { 'DummyBinary' => [ [ 'SystemPath', iPlugin.InstallLocation ] ] }, lCMApplied )\n # Check input parameters were given correctly\n assert_equal([ lDesc ], iPlugin.MissingDependencies)\n end\n end\n end\n assert_equal(true, lCalled)\n end", "title": "" }, { "docid": "07d538ca6b1a8f42c2ef8d913542771f", "score": "0.64553463", "text": "def ensure_dependencies(iDepDescList, iParameters = {})\n rError = nil\n rAppliedContextModifiers = {}\n rIgnoredDeps = []\n rUnresolvedDeps = []\n\n lAutoInstall = @DefaultOptions[:auto_install]\n if (iParameters.has_key?(:auto_install))\n lAutoInstall = iParameters[:auto_install]\n end\n lAutoInstallLocation = @DefaultOptions[:auto_install_location]\n if (iParameters.has_key?(:auto_install_location))\n lAutoInstallLocation = iParameters[:auto_install_location]\n end\n lPossibleContextModifiers = @DefaultOptions[:possible_context_modifiers]\n if (iParameters.has_key?(:possible_context_modifiers))\n lPossibleContextModifiers = iParameters[:possible_context_modifiers]\n end\n lPreferredViews = @DefaultOptions[:preferred_views]\n if (iParameters.has_key?(:preferred_views))\n lPreferredViews = iParameters[:preferred_views]\n end\n lPreferredProgressViews = @DefaultOptions[:preferred_progress_views]\n if (iParameters.has_key?(:preferred_progress_views))\n lPreferredProgressViews = iParameters[:preferred_progress_views]\n end\n # First, test if the dependencies are already accessible\n lDepsToResolve = []\n iDepDescList.each do |iDepDesc|\n if (!test_dependency(iDepDesc))\n lDepsToResolve << iDepDesc\n end\n end\n if (!lDepsToResolve.empty?)\n # Try resolving those dependencies with additional locations\n lMissingDependencies = []\n # Check if we can try some ContextModifiers that might find the missing dependencies\n if (lPossibleContextModifiers == nil)\n lMissingDependencies = lDepsToResolve\n else\n lMissingDependencies = getMissingDeps(lDepsToResolve, lPossibleContextModifiers, rAppliedContextModifiers)\n end\n if (!lMissingDependencies.empty?)\n # If we ask for auto-installation, go on\n if (lAutoInstall == nil)\n # Ask the user what to do with those missing dependencies\n rDepsUserChoices = askUserForMissingDeps(lMissingDependencies, lPreferredViews)\n # Create a progression view\n setupPreferredProgress(lPreferredProgressViews) do |ioProgressView|\n # Be careful, as ioProgressView can be nil if no view was found\n if (ioProgressView != nil)\n ioProgressView.set_range(rDepsUserChoices.size)\n end\n # Parse what was returned by the user choices\n rDepsUserChoices.each do |iDepUserChoice|\n lDepDesc = iDepUserChoice.DepDesc\n lIgnore = false\n if (iDepUserChoice.Locate)\n if (ioProgressView != nil)\n ioProgressView.set_title(\"Locate #{lDepDesc.ID}\")\n end\n if (lDepDesc.Testers.size == iDepUserChoice.ResolvedTesters.size)\n # This one was resolved using ContextModifiers.\n # Apply them.\n iDepUserChoice.ResolvedTesters.each do |iTesterName, iCMInfo|\n iCMName, iCMContent = iCMInfo\n access_plugin('ContextModifiers', iCMName) do |ioPlugin|\n ioPlugin.add_location_to_context(iCMContent)\n end\n end\n # Remember what we applied\n rAppliedContextModifiers[lDepDesc.ID] = iDepUserChoice.ResolvedTesters.values\n else\n rUnresolvedDeps << lDepDesc\n lIgnore = true\n end\n elsif (iDepUserChoice.IdxInstaller != nil)\n if (ioProgressView != nil)\n ioProgressView.set_title(\"Install #{lDepDesc.ID}\")\n end\n # This one is to be installed\n # Get the installer plugin\n lInstallerName, _, _ = lDepDesc.Installers[iDepUserChoice.IdxInstaller]\n access_plugin('Installers', lInstallerName) do |ioInstallerPlugin|\n lLocation = nil\n if (ioInstallerPlugin.PossibleDestinations[iDepUserChoice.IdxDestination][0] == DEST_OTHER)\n lLocation = iDepUserChoice.OtherLocation\n else\n lLocation = ioInstallerPlugin.PossibleDestinations[iDepUserChoice.IdxDestination][1]\n end\n lInstallEnv = {}\n rError = install_dependency(lDepDesc, iDepUserChoice.IdxInstaller, lLocation, lInstallEnv)\n # Get what has been modified in the context\n rAppliedContextModifiers[lDepDesc.ID] = lInstallEnv[:ContextModifiers]\n # If an error occurred, cancel\n if (rError != nil)\n break\n end\n end\n else\n if (ioProgressView != nil)\n ioProgressView.set_title(\"Ignore #{lDepDesc.ID}\")\n end\n rIgnoredDeps << lDepDesc\n lIgnore = true\n end\n if (ioProgressView != nil)\n ioProgressView.inc_value\n end\n if (!lIgnore)\n if (ioProgressView != nil)\n ioProgressView.set_title(\"Test #{lDepDesc.ID}\")\n end\n # Test if it was installed correctly\n if (!test_dependency(lDepDesc))\n # Still missing\n rUnresolvedDeps << lDepDesc\n end\n end\n end\n end\n else\n # Create a progression view\n setupPreferredProgress(lPreferredProgressViews) do |ioProgressView|\n # Be careful, as ioProgressView can be nil if no view was found\n if (ioProgressView != nil)\n ioProgressView.set_range(lMissingDependencies.size)\n end\n lMissingDependencies.each do |iDepDesc|\n if (ioProgressView != nil)\n ioProgressView.set_title(\"Installing #{iDepDesc.ID}\")\n end\n # Try to find an installer and a location for the lAutoInstall value\n lIdxInstaller = 0\n lLocation = nil\n iDepDesc.Installers.each do |iInstallerInfo|\n iInstallerName, _, _ = iInstallerInfo\n access_plugin('Installers', iInstallerName) do |iPlugin|\n iPlugin.PossibleDestinations.each do |iDestinationInfo|\n iLocationFlavour, iLocation = iDestinationInfo\n if (iLocationFlavour == lAutoInstall)\n # We found it\n if (iLocationFlavour == DEST_OTHER)\n lLocation = lAutoInstallLocation\n else\n lLocation = iLocation\n end\n break\n end\n end\n end\n if (lLocation != nil)\n break\n end\n lIdxInstaller += 1\n end\n if (lLocation == nil)\n # We were unable to find a correct default location for lAutoInstall\n rError = RuntimeError.new(\"Unable to find a default location for #{lAutoInstall}.\")\n else\n lInstallEnv = {}\n rError = install_dependency(iDepDesc, lIdxInstaller, lLocation, lInstallEnv)\n # Get what has been modified in the context\n rAppliedContextModifiers[iDepDesc.ID] = lInstallEnv[:ContextModifiers]\n # Test if it was installed correctly\n if (!test_dependency(iDepDesc))\n # Still missing\n rUnresolvedDeps << iDepDesc\n end\n end\n if (rError != nil)\n # An error occurred: cancel\n break\n end\n if (ioProgressView != nil)\n ioProgressView.inc_value\n end\n end\n end\n end\n end\n end\n\n return rError, rAppliedContextModifiers, rIgnoredDeps, rUnresolvedDeps\n end", "title": "" }, { "docid": "3b5255bd2d1b5f39b470f9f0e1e95128", "score": "0.6072457", "text": "def testNoCallUIWithExistingDeps\n lCalled = false\n setupAppDir do\n setupRegressionUI('RDI::Test::Flows::UIFlows::RegressionUI') do\n # Call the installer expecting the GUI to appear\n lDesc = getSimpleDesc\n # First install the dependency\n lError, lCMApplied, lIgnoredDeps, lUnresolvedDeps = @Installer.ensure_dependencies( [ lDesc ], {\n :auto_install => DEST_LOCAL\n } )\n # Then try again with UI\n lError, lCMApplied, lIgnoredDeps, lUnresolvedDeps = @Installer.ensure_dependencies( [ lDesc ], {\n :preferred_views => [ 'RegressionUI' ]\n } )\n assert_equal(nil, lError)\n assert_equal( {}, lCMApplied )\n assert_equal( [], lIgnoredDeps )\n assert_equal( [], lUnresolvedDeps )\n # Get the plugin back\n @Installer.access_plugin('Views', 'RegressionUI') do |iPlugin|\n # Check that it was called correctly\n lCalled = iPlugin.Called\n end\n end\n end\n assert_equal(false, lCalled)\n end", "title": "" }, { "docid": "b1131da7c4a6baf3419c68ed1f07c33c", "score": "0.607164", "text": "def getMissingDeps(iDepsToResolve, iPossibleContextModifiers, ioAppliedContextModifiers)\n rMissingDeps = []\n\n # We might have some install environments to try\n iDepsToResolve.each do |iDepDesc|\n lDepID = iDepDesc.ID\n lCMListsToTry = iPossibleContextModifiers[lDepID]\n lDepResolved = false\n if (lCMListsToTry != nil)\n # We can try several ones. We want at least 1 of those sets to resolve the dependency.\n lCMListsToTry.each do |iCMSetToTry|\n # Try to add the locations to the context\n lAppliedCMs = []\n iCMSetToTry.each do |iContextModifierInfo|\n iName, iContent = iContextModifierInfo\n access_plugin('ContextModifiers', iName) do |ioPlugin|\n if (!ioPlugin.is_location_in_context?(iContent))\n # We try this one.\n ioPlugin.add_location_to_context(iContent)\n lAppliedCMs << iContextModifierInfo\n end\n end\n end\n # Now, test if this has resolved the dependency (don't try if nothing changed)\n if (!lAppliedCMs.empty?)\n lDepResolved = test_dependency(iDepDesc)\n # If we found it, it's ok\n if (lDepResolved)\n ioAppliedContextModifiers[iDepDesc.ID] = lAppliedCMs\n break\n else\n # Rollback those context modifications as they were useless\n lAppliedCMs.each do |iContextModifierInfo|\n iName, iContent = iContextModifierInfo\n access_plugin('ContextModifiers', iName) do |ioPlugin|\n ioPlugin.remove_location_from_context(iContent)\n end\n end\n end\n end\n end\n end\n # If none of them resolved the dependency, add the dependency to the missing ones\n if (!lDepResolved)\n rMissingDeps << iDepDesc\n end\n end\n\n return rMissingDeps\n end", "title": "" }, { "docid": "222a82f6a2579a806d1be5223a71e697", "score": "0.5831616", "text": "def testNoCallUIWithResolvedDeps\n lCalled = false\n setupAppDir do\n setupRegressionUI('RDI::Test::Flows::UIFlows::RegressionUI') do\n # Call the installer expecting the GUI to appear\n lDesc = getSimpleDesc\n lError, lCMApplied, lIgnoredDeps, lUnresolvedDeps = @Installer.ensure_dependencies( [ lDesc ], {\n :possible_context_modifiers => {\n 'DummyBinary' => [\n [\n [ 'SystemPath', \"#{@RepositoryDir}/Binaries\" ]\n ]\n ]\n },\n :preferred_views => [ 'RegressionUI' ]\n } )\n assert_equal(nil, lError)\n assert_equal( { 'DummyBinary' => [ [ 'SystemPath', \"#{@RepositoryDir}/Binaries\" ] ] }, lCMApplied )\n assert_equal( [], lIgnoredDeps )\n assert_equal( [], lUnresolvedDeps )\n # Get the plugin back\n @Installer.access_plugin('Views', 'RegressionUI') do |iPlugin|\n # Check that it was called correctly\n lCalled = iPlugin.Called\n end\n end\n end\n assert_equal(false, lCalled)\n end", "title": "" }, { "docid": "971626c9f5140e4044cc33ff27ccefca", "score": "0.57026815", "text": "def testIgnoreDep\n lCalled = false\n setupAppDir do\n setupRegressionUI('RDI::Test::Flows::UIFlows::RegressionUI') do\n # Tune the UI's behaviour\n @Installer.access_plugin('Views', 'RegressionUI') do |ioPlugin|\n ioPlugin.Ignore = true\n end\n # Call the installer expecting the GUI to appear\n lDesc = getSimpleDesc\n lError, lCMApplied, lIgnoredDeps, lUnresolvedDeps = @Installer.ensure_dependencies( [ lDesc ], {\n :preferred_views => [ 'RegressionUI' ]\n } )\n # Check results\n assert_equal(nil, lError)\n assert_equal( {}, lCMApplied )\n assert_equal( [ lDesc ], lIgnoredDeps )\n assert_equal( [], lUnresolvedDeps )\n # Get the plugin back\n @Installer.access_plugin('Views', 'RegressionUI') do |iPlugin|\n # Check that it was called correctly\n lCalled = iPlugin.Called\n end\n # Check that the dependency is not resolved\n @Installer.access_plugin('Testers', 'Binaries') do |iPlugin|\n assert_equal(false, iPlugin.is_content_resolved?(['DummyBinary']))\n end\n end\n end\n assert_equal(true, lCalled)\n end", "title": "" }, { "docid": "2affa3f4fa902c86b3c37d92dc2f9332", "score": "0.56897324", "text": "def packages_missing_candidates\n @packages_missing_candidates ||=\n begin\n missing = []\n each_package do |package_name, new_version, current_version, candidate_version, magic_version|\n missing.push(package_name) if magic_version.nil? && candidate_version.nil?\n end\n missing\n end\n end", "title": "" }, { "docid": "90c3e41a44853d356c11c2ae802061d1", "score": "0.5682449", "text": "def install_dependencies(dependencies, force, install_dir)\n return if @options[:ignore_dependencies]\n installed_gems = []\n dependencies.each do |dependency|\n if @options[:include_dependencies] ||\n\t ask_yes_no(\"Install required dependency #{dependency.name}?\", true)\n remote_installer = RemoteInstaller.new(@options)\n installed_gems << remote_installer.install(\n\t dependency.name,\n\t dependency.version_requirements,\n\t force,\n\t install_dir)\n else\n raise DependencyError.new(\"Required dependency #{dependency.name} not installed\")\n end\n end\n installed_gems\n end", "title": "" }, { "docid": "c2350ec86867e13d0f55f88b3bf5b415", "score": "0.56685734", "text": "def forced_packages_missing_candidates\n @forced_packages_missing_candidates ||=\n begin\n missing = []\n each_package do |package_name, new_version, current_version, candidate_version, magic_version|\n next if new_version.nil? || current_version.nil?\n\n if use_magic_version?\n if !magic_version && candidate_version.nil?\n missing.push(package_name)\n end\n else\n if !version_requirement_satisfied?(current_version, new_version) && candidate_version.nil?\n missing.push(package_name)\n end\n end\n end\n missing\n end\n end", "title": "" }, { "docid": "3c886f9ed6ec79a5a88007168acfe923", "score": "0.5625275", "text": "def testInstallDep\n lCalled = false\n setupAppDir do\n setupRegressionUI('RDI::Test::Flows::UIFlows::RegressionUI') do\n # Call the installer expecting the GUI to appear\n lDesc = getSimpleDesc\n lError, lCMApplied, lIgnoredDeps, lUnresolvedDeps = @Installer.ensure_dependencies( [ lDesc ], {\n :preferred_views => [ 'RegressionUI' ]\n } )\n # Check results\n assert_equal(nil, lError)\n assert_equal( [], lIgnoredDeps )\n assert_equal( [], lUnresolvedDeps )\n # Get the plugin back\n @Installer.access_plugin('Views', 'RegressionUI') do |iPlugin|\n # Check that it was called correctly\n lCalled = iPlugin.Called\n # Get the first install destination (this is where it will be installed\n assert_equal( { 'DummyBinary' => [ [ 'SystemPath', iPlugin.InstallLocation ] ] }, lCMApplied )\n end\n # Check that the dependency is resolved\n @Installer.access_plugin('Testers', 'Binaries') do |iPlugin|\n assert_equal(true, iPlugin.is_content_resolved?(['DummyBinary']))\n end\n end\n end\n assert_equal(true, lCalled)\n end", "title": "" }, { "docid": "7d70b61eaf6209f47d053bd9d25e2001", "score": "0.5606488", "text": "def install_dependencies\n\t\tself.prompt.say \"Installing dependencies\"\n\t\truby '-S', 'gem', 'i', '-Ng'\n\tend", "title": "" }, { "docid": "816f8fc124c02cf67ccd826262eaae7f", "score": "0.55011195", "text": "def add_missing_required_dependencies(database)\n requires = requires(database)\n requires.each do |name|\n unless dependencies[name]\n dependencies[name] = Extension.new(name)\n end\n end\n end", "title": "" }, { "docid": "c1d91c533bbc4d5eb0494c1bbd675621", "score": "0.5404808", "text": "def validate_dependencies\n Spiceweasel::Log.debug(\"cookbook validate_dependencies: '#{@dependencies}'\")\n @dependencies.each do |dep|\n unless member?(dep)\n STDERR.puts \"ERROR: Cookbook dependency '#{dep}' is missing from the list of cookbooks in the manifest.\"\n exit(-1)\n end\n end\n end", "title": "" }, { "docid": "ca7ac1122232e4df66bab788987cbdaa", "score": "0.5395885", "text": "def install_dependencies\n raise 'Not implemented'\n end", "title": "" }, { "docid": "b2e5735f605438c5eb5627609c925902", "score": "0.5392692", "text": "def get_dependencies(_fidl, _interaction_types, _project_dependencies)\n # noop\n end", "title": "" }, { "docid": "942379b4da5ad3a6cbd13fd8c8135342", "score": "0.53849447", "text": "def dep_check\n $gems_required.each do |current_gem|\n begin\n if current_gem.include? \",\"\n tokens = current_gem.split(\",\")\n gem tokens[0], tokens[1]\n else\n gem current_gem\n end\n rescue Gem::LoadError\n if current_gem.include? \",\"\n $gems_missing_version << current_gem\n else\n $gems_missing << current_gem\n end\n end\n end\n if $gems_missing.length == 0 && $gems_missing_version.length == 0\n return true\n else\n return false\n end\nend", "title": "" }, { "docid": "5d725b4dc7104f079526360932a54fe2", "score": "0.53775525", "text": "def install_gems\n puts \"[Checking for missing required gems]\"\n while (gemspecs = get_requirements).any?\n gemspecs.each do |gemspec|\n install_gem(gemspec)\n end\n end\n end", "title": "" }, { "docid": "1d28757a37139c69fa6ad3dbb1f19a58", "score": "0.53749156", "text": "def check_all_packages\n packages_not_installed = []\n Constants::PACKAGES.each do |pkg|\n string = \"Looking for package #{pkg}...\"\n installed = check_package(pkg)\n installed ? string << green(\"Found\") : string << red(\"Not Found\")\n log_print string\n if !installed\n #if not installed append package name to packages_not_installed list\n packages_not_installed << pkg\n end #if\n end #do\n \n packages_not_installed\n end", "title": "" }, { "docid": "aff211dd5cf3bda958acbe9c1f82852c", "score": "0.53632843", "text": "def deps(pkg) # FIXME: \"*** PACKAGE MAY NOT BE DELETED *** \"\n if pkg.status != :available\n components = `#{@cmd} -n #{pkg.name}`.split(\"Requires:\\n\")\n if components.size > 1\n return components[1].strip\n else\n return \"[No depends]\"\n end\n else\n if File.exist?(File.expand_path(\"~/Library/Application Support/Guigna/pkgsrc/INDEX\"))\n # TODO: parse INDEX\n end\n \"[Not available]\"\n end\n end", "title": "" }, { "docid": "d2ff060cba082588b8c85664310221fd", "score": "0.5332767", "text": "def install_dependencies(spec)\n di = Gem::DependencyInstaller.new\n\n spec.development_dependencies.each do |dep|\n unless source_index.search(dep).last\n if config[\"install_development_dependencies\"]\n say \"Installing test dependency #{dep.name} (#{dep.requirement})\"\n di.install(dep) \n else\n if ask_yes_no(\"Install development dependency #{dep.name} (#{dep.requirement})?\")\n say \"Installing test dependency #{dep.name} (#{dep.requirement})\"\n di.install(dep) \n else\n alert_error \"Failed to install dependencies required to run tests. Aborting.\"\n raise Gem::TestError\n end\n end\n end\n end\n end", "title": "" }, { "docid": "a4c71f52c0f1f3f85b2e1125b07f9e10", "score": "0.5309303", "text": "def load_dependencies\r\n @local_gems.each do |gem_info|\r\n gem_file_name = gem_info.gem_file\r\n gem_name = installed_as_name_for( short_form_of_gem_name( gem_file_name ) )\r\n @required_gem_names.delete gem_file_name\r\n end\r\n @required_gem_paths.each do |gem_path|\r\n gem_short_name = short_form_of_gem_name gem_path\r\n if @required_gem_names.include? gem_short_name\r\n puts \"installing #{gem_path}\"\r\n installer = @force_require ? PreloadingInstaller.new( gem_path, @local_gems ) : Installer.new( gem_path )\r\n installer.install\r\n end\r\n end\r\n end", "title": "" }, { "docid": "8c91d4750714e26da4cce0910f326f55", "score": "0.5251874", "text": "def skipDeps(deps) \n deps = deps.select { |ding| !ding.include?(\"/commons-cli\") }\n deps = deps.select { |ding| !ding.include?(\"/commons-logging\") }\n deps = deps.select { |ding| !ding.include?(\"/commons-lang-2.1\") }\n deps = deps.select { |ding| !ding.include?(\"/commons-pool\") }\n return deps\nend", "title": "" }, { "docid": "ec4a547322be939a31ee19847fa08271", "score": "0.5251313", "text": "def resolve_dependencies(dependencies)\n dependencies.inject([]) do |deps, dep|\n deps + dep.determine(:ubuntu, :precise).map do |pkg, version|\n !version.nil? ? \"#{pkg} (#{version})\" : pkg\n end\n end.join(', ')\n end", "title": "" }, { "docid": "a59590891a2c7f02f2eb6a9e982f197c", "score": "0.52341497", "text": "def testInstallDepOtherLocation\n lCalled = false\n setupAppDir do\n setupRegressionUI('RDI::Test::Flows::UIFlows::RegressionUI', 'RDI::Test::Flows::UIFlows::RegressionUI::Directory') do\n # Tune the UI\n @Installer.access_plugin('Views', 'RegressionUI') do |ioPlugin|\n ioPlugin.InstallOtherLocation = true\n end\n lInstallDir = \"#{@Installer.TempDir}/Regression\"\n @Installer.access_plugin('LocationSelectors_RegressionUI', 'Directory') do |ioPlugin|\n # Set the directory where we want to install\n ioPlugin.Directory = lInstallDir\n end\n # Call the installer expecting the GUI to appear\n lDesc = getSimpleDesc\n lError, lCMApplied, lIgnoredDeps, lUnresolvedDeps = @Installer.ensure_dependencies( [ lDesc ], {\n :preferred_views => [ 'RegressionUI' ]\n } )\n # Check results\n assert_equal(nil, lError)\n assert_equal( [], lIgnoredDeps )\n assert_equal( [], lUnresolvedDeps )\n # Get the plugin back\n @Installer.access_plugin('Views', 'RegressionUI') do |iPlugin|\n # Check that it was called correctly\n lCalled = iPlugin.Called\n # Get the first install destination (this is where it will be installed\n assert_equal( { 'DummyBinary' => [ [ 'SystemPath', lInstallDir ] ] }, lCMApplied )\n end\n # Check that the dependency is resolved\n @Installer.access_plugin('Testers', 'Binaries') do |iPlugin|\n assert_equal(true, iPlugin.is_content_resolved?(['DummyBinary']))\n end\n end\n end\n assert_equal(true, lCalled)\n end", "title": "" }, { "docid": "58c624af92f6b1994e93cca2d1bb0f1f", "score": "0.5231564", "text": "def output_dependency_debugging\n\t\tself.prompt.say( \"Dependencies\", color: :bright_green )\n\t\ttable = self.generate_dependencies_table\n\t\tif table.empty?\n\t\t\tself.prompt.warn( \"None.\" )\n\t\telse\n\t\t\tself.prompt.say( table.render(:unicode, padding: [0,1]) )\n\t\tend\n\t\tself.prompt.say( \"\\n\" )\n\tend", "title": "" }, { "docid": "f7b617a0be511a15393406b0f504d41c", "score": "0.520239", "text": "def testLocateDepError\n lLocatorCalled = false\n lCalled = false\n setupAppDir do\n setupRegressionUI('RDI::Test::Flows::UIFlows::RegressionUI', 'RDI::Test::Flows::UIFlows::RegressionUI::Directory') do\n # Tune the UI's behaviour\n @Installer.access_plugin('Views', 'RegressionUI') do |ioPlugin|\n ioPlugin.Locate = true\n end\n @Installer.access_plugin('LocationSelectors_RegressionUI', 'Directory') do |ioPlugin|\n # We give a wrong directory here\n ioPlugin.Directory = \"#{@RepositoryDir}/Libraries\"\n end\n # Call the installer expecting the GUI to appear\n lDesc = getSimpleDesc\n lError, lCMApplied, lIgnoredDeps, lUnresolvedDeps = @Installer.ensure_dependencies( [ lDesc ], {\n :preferred_views => [ 'RegressionUI' ]\n } )\n # Check results\n assert_equal(nil, lError)\n assert_equal( {}, lCMApplied )\n assert_equal( [], lIgnoredDeps )\n assert_equal( [ lDesc ], lUnresolvedDeps )\n # Get the plugins back\n @Installer.access_plugin('Views', 'RegressionUI') do |iPlugin|\n # Check that it was called correctly\n lCalled = iPlugin.Called\n end\n @Installer.access_plugin('LocationSelectors_RegressionUI', 'Directory') do |iPlugin|\n # Check that it was called correctly\n lLocatorCalled = iPlugin.Called\n end\n # Check that the dependency is resolved\n @Installer.access_plugin('Testers', 'Binaries') do |iPlugin|\n assert_equal(false, iPlugin.is_content_resolved?(['DummyBinary']))\n end\n end\n end\n assert_equal(true, lCalled)\n assert_equal(true, lLocatorCalled)\n end", "title": "" }, { "docid": "ff7b519196c1953185b01727e628e2ac", "score": "0.5190734", "text": "def non_gem_requirements\n @metadata[:requires].nil? ? [] :\n @metadata[:requires].select { |r| !r.gem? }\n end", "title": "" }, { "docid": "3e85fd906cc74f7be32741c2e3e93016", "score": "0.5170879", "text": "def InitRemainingPackages\n Builtins.y2milestone(\"Looking for remaining packages\")\n\n file_remaining_packages = Ops.add(\n Installation.destdir,\n \"/var/lib/YaST2/remaining\"\n )\n file_remaining_srcs = Ops.add(\n Installation.destdir,\n \"/var/lib/YaST2/srcremaining\"\n )\n\n # Packages remaining for installation\n if FileUtils.Exists(file_remaining_packages)\n @remaining = Convert.convert(\n SCR.Read(path(\".target.ycp\"), [file_remaining_packages, []]),\n :from => \"any\",\n :to => \"list <map <string, any>>\"\n )\n @remaining = [] if @remaining == nil\n Builtins.y2milestone(\n \"File %1 contains %2 packages\",\n file_remaining_packages,\n Builtins.size(@remaining)\n )\n end\n\n # repositories remaining for installation\n if FileUtils.Exists(file_remaining_srcs)\n @srcremaining = Convert.convert(\n SCR.Read(path(\".target.ycp\"), [file_remaining_srcs, []]),\n :from => \"any\",\n :to => \"list <string>\"\n )\n @srcremaining = [] if @srcremaining == nil\n Builtins.y2milestone(\n \"File %1 contains %2 packages\",\n file_remaining_srcs,\n Builtins.size(@srcremaining)\n )\n end\n\n nil\n end", "title": "" }, { "docid": "13804649237e20bd7d3b24bd29427dd6", "score": "0.5168218", "text": "def required_dependencies\n dependencies - optional_dependencies\n end", "title": "" }, { "docid": "a796d5670b284d0ccd725a0e62321dd1", "score": "0.51436305", "text": "def set_dependencies\n Console.show 'There are no dependencies for this scroll', 'info'\n end", "title": "" }, { "docid": "1e01e5d3a5304a2b3bb2b09420996b18", "score": "0.51381624", "text": "def optional(*args)\n normalize_list(args).each do |dependency|\n @available.add_optional(dependency)\n end\n end", "title": "" }, { "docid": "b05694b56c550e43055ce26bd32e6295", "score": "0.5069041", "text": "def dependencies\n if @options[:dependencies]\n deps = [] << @options[:dependencies]\n deps.flatten.collect { |item|\n item = File.join(item,'**/*') if File.directory?(item)\n Dir.glob item\n }.flatten.uniq.collect { |item|\n File.directory?(item) ? nil : item\n }.compact\n else\n false\n end\n end", "title": "" }, { "docid": "009c6dd51d800aacd0c5ef06474c6c40", "score": "0.5051195", "text": "def check_for_installed_software_only\n check_all_installed @options\n end", "title": "" }, { "docid": "d43b2211738acd2c4c9ca9b3fb73afe4", "score": "0.5037472", "text": "def dependencies( *args )\n names = args # note: for now assume all args are just names\n # e.g. 'pluto-models', 'pluto-update', etc.\n deps = @versions.select do |rec| names.include?( rec[0] ) end\n .map do |rec| [rec[0], rec[1]] end\n\n ## todo/fix: throw exception if dependency is missing!\n ## names.size == deps.size\n puts \"names.size == deps.size #{names.size} == #{deps.size}\"\n deps\n end", "title": "" }, { "docid": "fd4daf34513ef098f28aa74ce857c30e", "score": "0.50364447", "text": "def depends_all\n pkg_depends = self.class.depends_all\n if self.class.omnibus_package\n self.class.omnibus_recipes.each { |omni_recipe|\n recipe_file = File.expand_path(omni_recipe + '.rb', File.dirname(filename))\n\n Book.instance.load_recipe(recipe_file, config) do |recipe|\n pkg_depends << recipe.depends_all\n end\n }\n end\n\n pkg_depends.flatten.uniq\n end", "title": "" }, { "docid": "fd4daf34513ef098f28aa74ce857c30e", "score": "0.50364447", "text": "def depends_all\n pkg_depends = self.class.depends_all\n if self.class.omnibus_package\n self.class.omnibus_recipes.each { |omni_recipe|\n recipe_file = File.expand_path(omni_recipe + '.rb', File.dirname(filename))\n\n Book.instance.load_recipe(recipe_file, config) do |recipe|\n pkg_depends << recipe.depends_all\n end\n }\n end\n\n pkg_depends.flatten.uniq\n end", "title": "" }, { "docid": "6c84468c7e4b82f196e468ce46b365be", "score": "0.5024525", "text": "def installed_plugins(required_plugins)\n required_plugins.reduce([]) do |missing, plugin|\n if Vagrant.has_plugin?(plugin)\n missing\n else\n puts \"#{plugin} plugin is missing. Installing...\"\n %x(set -x; vagrant plugin install #{plugin})\n missing << plugin\n end\n end\nend", "title": "" }, { "docid": "607a9d5e5138360523dcaeac4924e390", "score": "0.50182974", "text": "def candidates_exist_for_all_uninstalled?\n packages_missing_candidates.empty?\n end", "title": "" }, { "docid": "fb75f97658891298373eec07ff8a71c4", "score": "0.5011938", "text": "def os_dependencies\n []\n end", "title": "" }, { "docid": "45c7730f810cae89edc9979029821aad", "score": "0.5004692", "text": "def required(pkg)\n abort 'No such package exists.' unless @pkg.key?(pkg)\n warn 'Warning: A option to display obsolete package is available only for finding orphan.' if @include_obsolete\n\n sputs \"Package(s) required by #{pkg}\"\n putpkg(@pkg[pkg])\n end", "title": "" }, { "docid": "8687a56b4c4eb9f08506a4901bc3541a", "score": "0.49920863", "text": "def enumerate_dependencies\n raise DependencyEnumerationNotImplementedError\n end", "title": "" }, { "docid": "a41e6ce3df83ac4b8d29f39ccd8f4da1", "score": "0.49805042", "text": "def enabled_dependencies\n @dependencies.reject(&:ignore?)\n end", "title": "" }, { "docid": "e28f2fad7791fd0626868e1566e3b211", "score": "0.49721628", "text": "def ask_confirmation\n $stdout.print(\"This operation will uninstall following packages:\n docker,\n vagrant,\n libvirt-client,\n libvirt-dev,\nas well as all installed vagrant plugins and 'default' libvirt pool.\nAre you sure you want to continue? [y/N]: \")\n while (input = gets.strip)\n return true if input == 'y'\n return false if input == 'N'\n $stdout.print('Please enter one of the options [y/N]: ')\n end\n end", "title": "" }, { "docid": "ec581385e5f38f3a26aa7465156326b6", "score": "0.49625477", "text": "def run_package_for_missing(bundle_info)\n puts 'Packaging dependencies missing for current platform'\n\n $usePrecompiled = true\n\n puts 'Making sure databases are loaded...'\n databases = getDefaultDatabases\n\n if databases\n success 'Databases loaded'\n else\n onError 'database loading failed'\n end\n\n to_package = []\n\n all_dependencies.each do |dep|\n puts \"Checking dependency: #{dep.Name}\"\n\n precompiled = getSupportedPrecompiledPackage dep\n\n next if precompiled\n\n puts 'No precompiled available. Creating package'\n\n to_package.append dep\n end\n\n if to_package.empty?\n success 'No missing precompiled dependencies found'\n return\n end\n\n package_dependencies to_package, bundle_info\nend", "title": "" }, { "docid": "a32ddcaa1dd24267105a93427ba43e2b", "score": "0.49584004", "text": "def if_missing_dependencies\n #TODO: Test on Linux\n missing = []\n [['ffmpeg','-version'], ['mp3splt', '-v'], ['mp3wrap']].each do |cmdline|\n begin\n out, err, status = Open3.capture3(*cmdline)\n rescue\n missing.push(cmdline.first)\n end #begin\n end #...].each do |cmdline|\n yield(missing) unless missing.empty?\n end", "title": "" }, { "docid": "52b938be752758e70ff05e37443c48f2", "score": "0.49520597", "text": "def requires(*args)\n normalize_list(args).each do |dependency|\n @available.add_required(dependency)\n end\n end", "title": "" }, { "docid": "67ced52f116582056225a2dd68b7bc0d", "score": "0.4948596", "text": "def validate_dependencies_are_present!\n if @podfile_dependency_cache.target_definition_list.all?(&:empty?)\n add_warning 'The Podfile does not contain any dependencies.'\n end\n end", "title": "" }, { "docid": "d34a65622fa37b720163daa2bade7e42", "score": "0.4928002", "text": "def unused_dependencies_list\n imports = all_unique_imports.map { |import| import.split.last }\n dependency_list - imports\n end", "title": "" }, { "docid": "6f8920e8941eb04b116db2f1ffc1cfe9", "score": "0.4927763", "text": "def RemoveObsoleteResolvables\n Builtins.y2milestone(\"--------- removing obsolete selections ---------\")\n\n # this removes only information about selections and applied patches\n # it doesn't remove any package\n Builtins.y2milestone(\n \"Removing all information about selections and patches in %1\",\n Installation.destdir\n )\n Pkg.TargetStoreRemove(Installation.destdir, :selection)\n\n # disabled by FATE #301990, bugzilla #238488\n # Pkg::TargetStoreRemove (Installation::destdir, `patch);\n\n Builtins.y2milestone(\"--------- removing obsolete selections ---------\")\n\n nil\n end", "title": "" }, { "docid": "886406d0f69a95a01b7c88b841d12832", "score": "0.49232176", "text": "def required_by(dependency, dependent_name)\n dependencies_by_requirer_name[dependent_name] ||= []\n dependencies_by_requirer_name[dependent_name] << dependency\n dependencies << dependency\n\n if acceptable_versions.empty?\n message = \"Unable to satisfy the following requirements:\\n\\n\"\n dependencies_by_requirer_name.each do |name, dependencies|\n dependencies.each do |dep|\n message << \"- `#{dep}` required by `#{name}`\\n\"\n end\n end\n raise Informative, message\n end\n end", "title": "" }, { "docid": "9a92bfa4c9204d93e734da76ed0b8a53", "score": "0.49103096", "text": "def validate_dependencies # :nodoc:\n warning_messages = []\n @specification.dependencies.each do |dep|\n prerelease_dep = dep.requirements_list.any? do |req|\n Gem::Requirement.new(req).prerelease?\n end\n\n warning_messages << \"prerelease dependency on #{dep} is not recommended\" if\n prerelease_dep && [email protected]?\n\n open_ended = dep.requirement.requirements.all? do |op, version|\n not version.prerelease? and (op == '>' or op == '>=')\n end\n\n if open_ended\n op, dep_version = dep.requirement.requirements.first\n\n segments = dep_version.segments\n\n base = segments.first 2\n\n recommendation = if (op == '>' || op == '>=') && segments == [0]\n \" use a bounded requirement, such as '~> x.y'\"\n else\n bugfix = if op == '>'\n \", '> #{dep_version}'\"\n elsif op == '>=' and base != segments\n \", '>= #{dep_version}'\"\n end\n\n \" if #{dep.name} is semantically versioned, use:\\n\" \\\n \" add_#{dep.type}_dependency '#{dep.name}', '~> #{base.join '.'}'#{bugfix}\"\n end\n\n warning_messages << [\"open-ended dependency on #{dep} is not recommended\", recommendation].join(\"\\n\") + \"\\n\"\n end\n end\n if warning_messages.any?\n warning_messages.each {|warning_message| warning warning_message }\n end\n end", "title": "" }, { "docid": "37f16a5cb5265b6e51973d2dd548e38a", "score": "0.49069726", "text": "def remove_unused_dependencies\n # puts 'removing unused dependencies list.'\n dependencies = @target.dependencies\n dependencies.each do |dependency|\n dependency.remove_from_project if unused_dependencies_list.include? dependency.display_name\n end\n end", "title": "" }, { "docid": "c629bf88d0fc55012f375da737a8744c", "score": "0.4905189", "text": "def check_idl_dependencies\n BRIX11.log(4, \"[%s] check_idl_dependencies\", self)\n @idl_files.each_value do |fidl|\n # is this IDLFile managed by a recipe yet?\n if fidl.recipes.empty?\n # find/create the recipe to manage this IDLFile\n check_idl_recipe(fidl)\n end\n check_idl_file_dependencies(fidl)\n end\n end", "title": "" }, { "docid": "2f91d1ea32d0982648e7f5e2112b514e", "score": "0.49029484", "text": "def missing_required_arguments\n model.arguments.find_all do |arg|\n arg_sym = arg.name.to_sym\n if arguments.has_key?(arg_sym)\n TaskArguments.delayed_argument?(arguments.fetch(arg_sym))\n else\n arg.required?\n end\n end\n end", "title": "" }, { "docid": "c8706244775ea59d0569c9bd1f3df0f9", "score": "0.48790717", "text": "def check_idl_dependencies\n recipes.each { |rcp| rcp.check_idl_dependencies }\n end", "title": "" }, { "docid": "e9d330299c823ce22610103b64bc64f9", "score": "0.48696885", "text": "def validateDependencies\n params[:dependencies].split(\"&\").each do |dependency|\n dependency_values = dependency.split(\"=\")\n versions = Version.where(:part_name => dependency_values[0])\n\n if versions.empty?\n render :text => \"Part: #{dependency_values[0]} does not exist.\", status: 400\n return\n else\n part = versions.where(:version => dependency_values[1]).first\n if part.nil?\n render :text => \"Part: #{dependency_values[0]} with version: #{dependency_values[1]} does not exist\", status: 400\n return\n end\n end\n end\n\n render :nothing => true, status: 200\n end", "title": "" }, { "docid": "4f26732803e34a9c3d9465ce0413f4b1", "score": "0.48676276", "text": "def require_libraries\n return if @libraries.nil?\n\n missing_dependencies = []\n\n @libraries.each do |lib|\n begin\n vrequire(lib)\n rescue LoadError\n # rubocop:disable Metrics/LineLength\n vputs \"[**:#{@name}](#{lib}) Unable to require; adding to install list...\"\n # rubocop:enable Metrics/LineLength\n missing_dependencies << lib\n end\n end\n\n requirer = new_dependency_requirer(dependency_installer)\n install_missing_dependencies(missing_dependencies, requirer).resume\n end", "title": "" }, { "docid": "24c081de3bd868adc54f2553558ab3ce", "score": "0.48544022", "text": "def excluded_deps\n missing_deps_for(upstream_gem)\n end", "title": "" }, { "docid": "ba6c81d7d1ded906757a1d7b50bbe455", "score": "0.48314095", "text": "def parse_missing(input)\n matches = input.match(/Missing these required gems:([\\s\\S]*)You're running:/)\n return [] if matches.nil?\n matches[1].strip.split(\"\\n\").map do |line|\n m = line.match(/^\\s*(\\S+)\\s+(\\S+\\s+[0-9.]+)/)\n p line if m.nil?\n {:name => m[0], :version => m[1]}\n end\n end", "title": "" }, { "docid": "8f007de016304fecadde1778f305cd9a", "score": "0.48034602", "text": "def gem_installer(ignore_deps, force, install_dir)\n Gem::DependencyInstaller.new(:ignore_dependencies => ignore_deps,\n :force => force,\n :install_dir => install_dir)\n end", "title": "" }, { "docid": "ec9a945bb123763888db77a80ea8ecb2", "score": "0.47954047", "text": "def install\n result = @dependency_manager.install_dependencies\n if @dependency_manager.should_install?('libvirt')\n result = result.and_then { install_vagrant_plugins }\n .and_then { create_libvirt_pool }\n .and_then { export_libvirt_default_uri }\n end\n if @dependency_manager.should_install?('terraform')\n result = result.and_then { install_terraform }\n end\n if result.error?\n @ui.error(result.error)\n else\n @ui.info('Dependencies successfully installed.')\n @ui.info('Please restart your computer in order to apply changes.')\n end\n result\n end", "title": "" }, { "docid": "515f0d98bc06151fc74e86af6e4dffb9", "score": "0.4795152", "text": "def dependencies_satisfied?\n missing_dependencies.empty?\n end", "title": "" }, { "docid": "a3316d903af6b4642ce805af72263850", "score": "0.4790362", "text": "def activate_dependencies\n unresolved = Gem::Specification.unresolved_deps\n\n self.runtime_dependencies.each do |spec_dep|\n if loaded = Gem.loaded_specs[spec_dep.name]\n next if spec_dep.matches_spec? loaded\n\n msg = \"can't satisfy '#{spec_dep}', already activated '#{loaded.full_name}'\"\n e = Gem::LoadError.new msg\n e.name = spec_dep.name\n\n raise e\n end\n\n begin\n specs = spec_dep.to_specs\n rescue Gem::MissingSpecError => e\n raise Gem::MissingSpecError.new(e.name, e.requirement, \"at: #{self.spec_file}\")\n end\n\n if specs.size == 1\n specs.first.activate\n else\n name = spec_dep.name\n unresolved[name] = unresolved[name].merge spec_dep\n end\n end\n\n unresolved.delete self.name\n end", "title": "" }, { "docid": "015b0b97984b2fd9869e510a575bb020", "score": "0.47848755", "text": "def conflicting_dependencies\n [@failed_dep.dependency, @activated.request.dependency]\n end", "title": "" }, { "docid": "015b0b97984b2fd9869e510a575bb020", "score": "0.47848755", "text": "def conflicting_dependencies\n [@failed_dep.dependency, @activated.request.dependency]\n end", "title": "" }, { "docid": "015b0b97984b2fd9869e510a575bb020", "score": "0.47848755", "text": "def conflicting_dependencies\n [@failed_dep.dependency, @activated.request.dependency]\n end", "title": "" }, { "docid": "72edfa0b424953a27d4f593537c192c2", "score": "0.4766022", "text": "def dependencies\n @dependencies ||= ElmPackage.dependencies 'elm-package.json',\n silent: false\n end", "title": "" }, { "docid": "e20080c6d06ae0dad1df8af0fffb3f16", "score": "0.4764688", "text": "def complete\n unless options[:quiet]\n puts \"*\" * 75\n puts \" \"\n puts \">> Questionnaire has been installed successfully.\"\n puts \">> You're all ready to go!\"\n puts \" \"\n puts \">> Enjoy!\"\n end\n end", "title": "" }, { "docid": "fd07fb2e848bc50ae0887df8a470365f", "score": "0.47646278", "text": "def install_deps(*deps)\n return unless Sunshine.auto_dependencies?\n\n options = {:call => @shell, :prefer => pkg_manager}\n options.merge! deps.delete_at(-1) if Hash === deps.last\n\n args = deps << options\n Sunshine.dependencies.install(*args)\n end", "title": "" }, { "docid": "f291c5b5c234c1de98101521696f68df", "score": "0.47608438", "text": "def missing_deps_for(gem)\n # Comparison by name here assuming if it is in existing spec,\n # spec author will have ensured versions are correct for their purposes\n gem.deps.select { |dep| requirements_for_gem(dep.name).empty? }\n end", "title": "" }, { "docid": "a8c97b45d2c6489345920d17a283d222", "score": "0.47578079", "text": "def installed_versions(name, requirement)\n if gem_installed?(name, requirement)\n Chef::Log.info \"Gem #{name} (#{requirement}) found in OpsWorks user space.\"\n # from rubygems/specification.rb#find_all_by_name\n Gem::Dependency.new(name, requirement).matching_specs\n else\n Chef::Log.debug \"Gem #{name} (#{requirement}) not found in OpsWorks user space.\"\n []\n end\n end", "title": "" }, { "docid": "6d50fd16d407b51a34ea9f909096b80c", "score": "0.4751053", "text": "def ignore_conditions_for(options, dependency)\n # Find where the name matches then get an array of version requirements, e.g. [\"4.x\", \"5.x\"]\n found = options.find { |ig| dependency.name.match?(ig['name']) }\n found ? found['versions'] || [] : []\nend", "title": "" }, { "docid": "e01e1bb9ddcbbd4250ef668e95f42532", "score": "0.4743619", "text": "def check_for_required_files(opts={})\n missing_files = 0\n $generated_files.each do |f|\n if !File.exists?(f)\n puts \"Required file missing: #{f}\"\n missing_files +=1\n end\n end\n if missing_files > 0\n error = \"#{missing_files} required files not found. Run `rake build` before deploying.\"\n if opts[:warning] then puts error else fail error end\n end\nend", "title": "" }, { "docid": "6d92dad04691c36261cc436e02dc942a", "score": "0.47427595", "text": "def _fail_because_missing(missing_frags)\n fail <<-MSG\n You have not specified a valid environment. The following machine fragments\n require additional dependencies:\n\n #{PP.pp(missing_frags, '')}\n MSG\n end", "title": "" }, { "docid": "6b5f173e471549fe2ebb277811a0bf72", "score": "0.47411954", "text": "def missing_step_inputs inputs\n inputs_names = inputs.keys\n inputs_names ||= []\n results = []\n @steps.each do |step|\n output_names = step.outputs\n missing = step.missing_inputs inputs_names\n inputs_names += output_names\n missing.each do |miss|\n results << [step.name, miss]\n end\n end\n results\n end", "title": "" }, { "docid": "cccba824379c571a0c7155b570de7e1c", "score": "0.47395647", "text": "def testLocateDep\n lLocatorCalled = false\n lCalled = false\n setupAppDir do\n setupRegressionUI('RDI::Test::Flows::UIFlows::RegressionUI', 'RDI::Test::Flows::UIFlows::RegressionUI::Directory') do\n # Tune the UI's behaviour\n @Installer.access_plugin('Views', 'RegressionUI') do |ioPlugin|\n ioPlugin.Locate = true\n end\n @Installer.access_plugin('LocationSelectors_RegressionUI', 'Directory') do |ioPlugin|\n ioPlugin.Directory = \"#{@RepositoryDir}/Binaries\"\n end\n # Call the installer expecting the GUI to appear\n lDesc = getSimpleDesc\n lError, lCMApplied, lIgnoredDeps, lUnresolvedDeps = @Installer.ensure_dependencies( [ lDesc ], {\n :preferred_views => [ 'RegressionUI' ]\n } )\n # Check results\n assert_equal(nil, lError)\n assert_equal( { 'DummyBinary' => [ [ 'SystemPath', \"#{@RepositoryDir}/Binaries\" ] ] }, lCMApplied )\n assert_equal( [], lIgnoredDeps )\n assert_equal( [], lUnresolvedDeps )\n # Get the plugins back\n @Installer.access_plugin('Views', 'RegressionUI') do |iPlugin|\n # Check that it was called correctly\n lCalled = iPlugin.Called\n end\n @Installer.access_plugin('LocationSelectors_RegressionUI', 'Directory') do |iPlugin|\n # Check that it was called correctly\n lLocatorCalled = iPlugin.Called\n end\n # Check that the dependency is resolved\n @Installer.access_plugin('Testers', 'Binaries') do |iPlugin|\n assert_equal(true, iPlugin.is_content_resolved?(['DummyBinary']))\n end\n end\n end\n assert_equal(true, lCalled)\n assert_equal(true, lLocatorCalled)\n end", "title": "" }, { "docid": "f96e995b458026c8b9afcc0b746ef1b1", "score": "0.47184998", "text": "def find_dependencies\n\t\tunless GEMDEPS_FILE.readable?\n\t\t\tself.prompt.warn \"Deps file (%s) is missing or unreadable, assuming no dependencies.\" %\n\t\t\t\t[ GEMDEPS_FILE ]\n\t\t\treturn []\n\t\tend\n\n\t\tfinder = Rake::DevEiate::GemDepFinder.new( GEMDEPS_FILE )\n\t\tfinder.load\n\t\treturn finder.dependencies\n\tend", "title": "" }, { "docid": "b8b166e23544cab12b0f4d3126cfc0d4", "score": "0.47166127", "text": "def getDeliverableDependencies(ioDeliverable, oDependencies)\n # Look for references in cmd, dir and parameters of the process\n lProcessInfo, lProcessParams = ioDeliverable.getProcessInfo\n if (lProcessInfo != nil)\n lAliases = ioDeliverable.Context.Aliases.merge(params2aliases(lProcessParams))\n replaceAliases(lProcessInfo[:Dir], lAliases, oDependencies)\n replaceAliases(lProcessInfo[:Cmd], lAliases, oDependencies)\n lProcessParams.each do |iParam, iValue|\n replaceAliases(iValue, lAliases, oDependencies)\n end\n end\n end", "title": "" }, { "docid": "0aa7feb6026d9f1df2a0fb5273fcc88c", "score": "0.4709921", "text": "def allow_missing?(dependency)\n false\n end", "title": "" }, { "docid": "b5c719da3f2a39e6f1de25b71c9f10ae", "score": "0.47048044", "text": "def required(*plugins)\n if Vagrant.in_installer?\n for plugin in plugins\n unless Vagrant.has_plugin?(plugin)\n raise Vagrant::Errors::PluginNotInstalled.new :name => plugin\n end\n end\n end\nend", "title": "" }, { "docid": "6c0024b279d8b21395469e73e7d07b19", "score": "0.47041795", "text": "def output_missing(missing)\n puts \"\"\n puts \"ERROR: Missing input parameters for steps:\"\n output = missing.collect {|step, miss| \" #{step} is missing #{miss}\"}\n output.each {|o| puts o}\n puts \"\"\n end", "title": "" }, { "docid": "66bbff54a906ea4dbdcb190f7b3b1a59", "score": "0.47033623", "text": "def vendor(dependencies)\n return nil if dependencies.nil? || dependencies.empty?\n @dep_list = Resolver.resolve(dependencies, @cache, @cwd, @backend)\n end", "title": "" }, { "docid": "2bfa7a7aded4ece4d9a5fcf3eb908cf4", "score": "0.46937796", "text": "def getInstalledFiles\n warning \"This dependency (#{@Name}) doesn't support getting file list for \" \\\n 'precompiled binary'\n false\n end", "title": "" }, { "docid": "cae2780da41eed0634bbb00a0c339dc1", "score": "0.46918386", "text": "def dependencies\n EMPTY_SET\n end", "title": "" }, { "docid": "e2680aead78c880cd818a131e4084a0e", "score": "0.46894267", "text": "def non_gem_build_requirements\n @metadata[:build_requires].nil? ? [] :\n @metadata[:build_requires].select { |r| !r.gem? }\n end", "title": "" }, { "docid": "fed245d7689483d5f52f8aff94356702", "score": "0.46879992", "text": "def check_dependents \r\n self.class.send(:dependent_tables).each{|sym_dependent_table|\r\n raise LookupItemInUseException.new if self.send(sym_dependent_table).size > 0\r\n }\r\n end", "title": "" }, { "docid": "bb23b184b0acac964b70ee72cca93b64", "score": "0.46859464", "text": "def find_dependencies(deps=nil, verbose=false)\n \n deps ||= all_dependencies\n\n search_list = Array(deps)\n found = []\n ret = []\n \n # if we discover a new local package via indirect dependencies then\n # it's dependencies will be fetchable one time.\n fetchable = Set.new\n \n until search_list.empty?\n name, version = search_list.shift\n\n if dup = found.find{|p| p.name == name}\n # already found, check for conflicts\n next if satisfied_by?(version, dup.version)\n raise PackageConflictError.new(name, dup.version, version)\n end\n\n pkg = locate_package(name, version, verbose)\n if pkg.nil? && fetchable.include?(name)\n fetchable.reject! { |x| x == name }\n core_fetch_dependency(name, version, :runtime, true) \n pkg = locate_package name, version, verbose\n end\n \n raise PackageNotFoundError.new(name, version) unless pkg\n\n found << pkg\n\n # Look up dependencies of dependencies\n new_deps = Array(pkg.dependencies) + Array(pkg.dependencies_build)\n if has_local_package? pkg.name\n new_deps += Array(pkg.dependencies_development)\n new_deps.each { |dep| fetchable.add dep.first }\n end\n \n search_list += new_deps\n\n ret << pkg\n end\n\n ret\n end", "title": "" }, { "docid": "993312d3f373927e8bc373db8905a4e4", "score": "0.46838358", "text": "def missing_dev_deps_for(gem)\n # Same note as in #missing_deps_for above\n gem.dev_deps.select { |dep| build_requirements_for_gem(dep.name).empty? }\n end", "title": "" }, { "docid": "3ecd9ec00b12305fc39a31c138449619", "score": "0.4683241", "text": "def depends *syms\n syms.each { |sym| raise ArgumentError, \"unknown option '#{sym}'\" unless @specs[sym] }\n @constraints << [:depends, syms]\n end", "title": "" }, { "docid": "59374784a99d9305cef00f19422a10a5", "score": "0.46824363", "text": "def confirm_or_prompt_for_system_requirements\n generate_generatable_options\n validate_root_dns_maps_to_core_ip\n ensure_security_group_prepared\n validate_compute_flavor(core_server_flavor)\n admin_emails\n confirm_or_upload_release\n confirm_or_upload_stemcell\n end", "title": "" }, { "docid": "93a55a017f6ddd7516fb4d6f346b2995", "score": "0.46711022", "text": "def available\n return unless Node.source.eql?(:asset)\n\n errors.add(:dependency_not_found, name) unless TTY::Which.exist?(name)\n end", "title": "" }, { "docid": "4fd558fc7e58429e794054aa5ebb160e", "score": "0.4662998", "text": "def requires\n require_items.collect(&:package)\n end", "title": "" }, { "docid": "db8f8a76f6cf73297e0333b233ec7e3c", "score": "0.4661326", "text": "def check_required_options(option_set_name, options = {})\n required_options = REQUIRED_OPTIONS[option_set_name]\n missing = []\n required_options.each{|option| missing << option if options[option].nil?}\n \n unless missing.empty?\n raise MissingInformationError.new(\"Missing #{missing.collect{|m| \":#{m}\"}.join(', ')}\")\n end\n end", "title": "" }, { "docid": "51a825c7541ccbcd4700544558f9bc03", "score": "0.46424845", "text": "def install_dependent_roles\n ansible_directory = File.join(\"deployment\", \"ansible\")\n ansible_roles_txt = File.join(ansible_directory, \"roles.txt\")\n\n File.foreach(ansible_roles_txt) do |line|\n role_name, role_version = line.split(\",\")\n role_path = File.join(ansible_directory, \"roles\", role_name)\n galaxy_metadata = galaxy_install_info(role_name)\n\n if galaxy_metadata[\"version\"] != role_version.strip\n unless system(\"ansible-galaxy install -f -r #{ansible_roles_txt} -p #{File.dirname(role_path)}\")\n $stderr.puts \"\\nERROR: An attempt to install Ansible role dependencies failed.\"\n exit(1)\n end\n\n break\n end\n end\nend", "title": "" }, { "docid": "95949d3d11a473019a7f17ce7f19b581", "score": "0.4635992", "text": "def dependencies(pkg)\n pkg.resolve_optional_dependencies\n deps_rock_packages = pkg.dependencies.map do |pkg_name|\n debian_name(Autoproj.manifest.package(pkg_name).autobuild)\n end.sort\n\n pkg_osdeps = Autoproj.osdeps.resolve_os_dependencies(pkg.os_packages)\n # There are limitations regarding handling packages with native dependencies\n #\n # Currently gems need to converted into debs using gem2deb\n # These deps dependencies are updated here before uploading a package\n # \n # Generation of the debian packages from the gems can be done in postprocessing step\n # i.e. see convert_gems\n \n deps_osdeps_packages = []\n native_package_manager = Autoproj.osdeps.os_package_handler\n _, native_pkg_list = pkg_osdeps.find { |handler, _| handler == native_package_manager }\n\n deps_osdeps_packages += native_pkg_list if native_pkg_list\n\n # Update global list\n @osdeps += deps_osdeps_packages\n\n non_native_handlers = pkg_osdeps.collect do |handler, pkg_list|\n if handler != native_package_manager\n [handler, pkg_list]\n end\n end.compact\n\n non_native_handlers.each do |pkg_handler, pkg_list|\n # Convert native ruby gems package names to rock-xxx \n if pkg_handler.kind_of?(Autoproj::PackageManagers::GemManager)\n pkg_list.each do |name,version|\n @ruby_gems << [name,version]\n deps_osdeps_packages << debian_ruby_name(name)\n end\n else\n raise ArgumentError, \"cannot package #{pkg.name} as it has non-native dependencies (#{pkg_list}) -- #{pkg_handler.class} #{pkg_handler}\"\n end\n end\n\n # Remove duplicates\n @osdeps.uniq!\n @ruby_gems.uniq!\n\n # Return rock packages and osdeps\n [deps_rock_packages, deps_osdeps_packages]\n end", "title": "" }, { "docid": "0fecb5e103755f456504b77c03b5de09", "score": "0.46338585", "text": "def install(libraries)\n\t\t\t# Abort with a friendly message if the running OS is not supported yet\n\t\t\tabort \"We're sorry but currently we don't support #{@os_name} package installation\" if(!is_os_available?(@os_name))\n\n\t\t\t# Message shown handled by the displayer already\n\t\t\tabort if libraries.count == 0\n\t\t\tinstalled_libraries = []\n\t\t\tfailed_libraries = []\n\n\t\t\tlibraries.each do |library|\n\t\t\t\tinstalled = self.send(\"#{@os_name}_installer\", library)\n\t\t\t\tif(installed == true)\n\t\t\t\t\tinstalled_libraries << library\n\t\t\t\telse\n\t\t\t\t\tfailed_libraries << library\n\t\t\t\tend\n\t\t\tend\n\n\t\t\tif(failed_libraries.count > 0)\n\t\t\t\tabort \"#{failed_libraries.count} libraries failed to be installed: #{failed_libraries}\"\n\t\t\telse\n\t\t\t\tabort \"#{installed_libraries.count} libraries installed successfully!\"\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "f753f381fd061096eeaf6940f62abe60", "score": "0.46300492", "text": "def install_build_dependencies(build_dependencies) # rubocop:disable Metrics/AbcSize\n http = []\n pkgutil = []\n noasks = [\"instance=overwrite\", \"partial=nocheck\", \"runlevel=nocheck\", \"idepend=nocheck\", \"rdepend=nocheck\", \"space=nocheck\", \"setuid=nocheck\", \"conflict=nocheck\", \"action=nocheck\", \"basedir=default\"]\n noask_command = noasks.map { |noask| \"echo '#{noask}' >> /var/tmp/noask\" }.join('; ')\n\n build_dependencies.each do |build_dependency|\n if build_dependency =~ /^http.*\\.gz/\n # Fetch, unpack, install...this assumes curl is present.\n package = build_dependency.sub(/^http.*\\//, '')\n http << \"tmpdir=$(#{mktemp}); (cd ${tmpdir} && curl --silent --show-error --fail -O #{build_dependency} && gunzip -c #{package} | pkgadd -d /dev/stdin -a /var/tmp/noask all)\"\n else\n # Opencsw dependencies. At this point we assume that pkgutil is installed.\n pkgutil << build_dependency\n end\n end\n\n command = ''\n unless pkgutil.empty?\n command << \"/opt/csw/bin/pkgutil -y -i #{pkgutil.join(\"\\s\")}; \"\n end\n\n unless http.empty?\n command << \"echo -n > /var/tmp/noask; #{noask_command}; \"\n command << http.join('; ')\n end\n\n command\n end", "title": "" }, { "docid": "07b8f81e94452dd7920cff6983f62a75", "score": "0.46283618", "text": "def get_requirements\n result = `rake gems 2>&1`\n parse_required(result) + parse_missing(result) + parse_deps(result)\n end", "title": "" }, { "docid": "658020ae4d78fe01e0fce608151acdc8", "score": "0.46093598", "text": "def install_instructions\n []\n end", "title": "" } ]
b5836e11bb00af21be99de6b8afc92a7
Registro Federal de Contribuyentes (R.F.C.) para persona moral
[ { "docid": "e952fd3b4cd87b88f5d89b93e75241a9", "score": "0.5332825", "text": "def rfc_persona_moral\n consonants_n_amp = CONSONANTS + ['Ñ', '&']\n all_letters = consonants_n_amp + VOWELS\n [fetch_sample(all_letters, count: 3), date, fetch_sample(HOMOCLAVE, count: 3)].flatten.join\n end", "title": "" } ]
[ { "docid": "53f8b63278f00b0f57f77c74131b3f22", "score": "0.5541764", "text": "def municipality_from_cadastrial # :doc:\n data.municipalities.find do |m|\n m.cadastrial_code == term.upcase\n end\n end", "title": "" }, { "docid": "7992b31d451ca327426d9ee59582a32c", "score": "0.54249936", "text": "def fiscal_years\n get_fiscal_years\n end", "title": "" }, { "docid": "7992b31d451ca327426d9ee59582a32c", "score": "0.54249936", "text": "def fiscal_years\n get_fiscal_years\n end", "title": "" }, { "docid": "5fd9c91997c8f8f90407dc95de9b9054", "score": "0.5401714", "text": "def current_planning_year\n fiscal_year(current_planning_year_year)\n end", "title": "" }, { "docid": "81bd53c9b7c139d5bd40e4d9b80547fc", "score": "0.53973216", "text": "def federal_legislator_params\n params.require(:federal_legislator).permit(:first_name, :last_name, :enters_office_on, :leaves_office_on)\n end", "title": "" }, { "docid": "ccdbb318b2eb9b07a41b33e91275b6da", "score": "0.53846383", "text": "def legislative_memberships\n person.memberships.where(legislative_period_id: term.id)\n end", "title": "" }, { "docid": "31296b0353933ef52e568ca58a0313b3", "score": "0.53839344", "text": "def full_cpr=(cpr)\n unless cpr.empty?\n day = cpr[0..1]\n month = cpr[2..3]\n flag = cpr[9]\n if (flag == \"0\") \n year = \"20\" << cpr[4..5] \n else \n year = \"19\" << cpr[4..5]\n end\n self.dateofbirth = Date.civil(year.to_i,month.to_i,day.to_i)\n self.cpr = cpr[6..9]\n end\n end", "title": "" }, { "docid": "6a41e879a4d2fe1b371a2dae235bc271", "score": "0.53697425", "text": "def set_cpr_nr\n dato = self.birthdate.to_s.split(\"-\")\n dato[0] = dato[0][2..3]\n self.cpr = dato.reverse.join\n end", "title": "" }, { "docid": "a1c9dabee18edcb7a9cd5926328a925a", "score": "0.53335977", "text": "def current_fiscal_year\n fiscal_year(current_fiscal_year_year)\n end", "title": "" }, { "docid": "8355d12d7bc1e82812b202081d56435a", "score": "0.53264314", "text": "def fiscal_year\n\t\tbegin\n\t\t\ttemp = Date.new(2000, 9, 30)\n\t\t\tcase\n\t\t\t\twhen (self.BFD19 <= temp)\n\t\t\t\t0\n\t\t\t\twhen (self.BFD19 <= temp + 5.years)\n\t\t\t\t1\n\t\t\t\twhen (self.BFD19 <= temp + 10.years)\n\t\t\t\t2\n\t\t\t\twhen (self.BFD19 <= temp + 15.years)\n\t\t\t\t3\n\t\t\t\twhen (self.BFD19 <= temp + 16.years)\n\t\t\t\t4\n\t\t\t\twhen (self.BFD19 <= temp + 17.years)\n\t\t\t\t5\n\t\t\telse\n\t\t\t\tputs \"error\"\n\t\t\tend\n\t\trescue\n\t\t\tputs \"error\"\n\t\tend\n\tend", "title": "" }, { "docid": "7bcc38fe8c567bfdcb8fa2de35e16a71", "score": "0.53045624", "text": "def rfc\n fetch_sample([rfc_persona_moral, rfc_persona_fisica])\n end", "title": "" }, { "docid": "b9c2ef6678ec26306278c065d7c5b527", "score": "0.5300733", "text": "def requirements!\n allowed_municipalities\n minimum_age\n end", "title": "" }, { "docid": "c33e5da737e96176c7ea46c20dedad8f", "score": "0.5288508", "text": "def asFamille(famille)\n ctes = Constantes.instance\n MontantCotisation.validate\n @montantBase.taxable = Constantes.instance.baseFamille\n \n # Adultes supplementaires\n num_adultes = famille.membres.sum { |m| m.adulte? ? 1 : 0 }\n if num_adultes > 2\n @adultesAdditionels = Constantes.instance.adulte_additionel * (num_adultes - 2)\n end\n \n # Autres couts\n montantActiviteFamille(famille)\n @montantNatation = montantDesCoursDeNatation(famille)\n @montantBronze = montantDesBronze(famille)\n \n # Rabais pour inscription hative\n @rabaisPreInscription = ctes.rabaisPreInscriptionFamille if Date.today() <= ctes.finPreInscription\n end", "title": "" }, { "docid": "253a81372adc294e00f307c64dee2f41", "score": "0.5254921", "text": "def fiscal_end\n fiscalstart + 1.year - 1.day\n end", "title": "" }, { "docid": "41a0fccfad85060cdc860f8664079669", "score": "0.5250738", "text": "def set_federal_legislator\n @federal_legislator = FederalLegislator.find(params[:id])\n end", "title": "" }, { "docid": "2dd8203324186e7b88515d89ba0c4a88", "score": "0.52407986", "text": "def close_corporation_registration_number\n Faker::Company.south_african_close_corporation_registration_number\n end", "title": "" }, { "docid": "6bf4ae40aa27a2823d43fbefd24ee59a", "score": "0.5214614", "text": "def formal_name \n salutation = self.company.salutation_types.find_by_id(self.salutation_id).try(:alvalue)\n format_full_name(salutation || \"\" , self.first_name, self.middle_name, self.last_name, self.nickname ,\"formal\")\n end", "title": "" }, { "docid": "04a27ae53e182de40631dabc6fe86d14", "score": "0.52081585", "text": "def campus_patron_permissions\n end", "title": "" }, { "docid": "809dfa8d89e07c530d41e8c8f9d48aea", "score": "0.51865685", "text": "def attr\n {\n rfc: 'Rfc',\n name: 'Nombre',\n tax_classification: 'RegimenFiscal'\n }\n end", "title": "" }, { "docid": "c568ddc221ddc66d38727f6173a76ddb", "score": "0.5160562", "text": "def formaladdress\n\t\t[salutation, surname].join ' '\n\tend", "title": "" }, { "docid": "25bb191bb30fba37600797bd4843b0a5", "score": "0.5138259", "text": "def family; end", "title": "" }, { "docid": "25bb191bb30fba37600797bd4843b0a5", "score": "0.5138259", "text": "def family; end", "title": "" }, { "docid": "01b09e00e7221311361633b276ba7df6", "score": "0.5128996", "text": "def new\n @person = Person.new\n if @invite\n @conference = @invite.conference\n @accepts_reg = @conference.in_reg_period?\n @person.firstname = @invite.firstname\n @person.famname = @invite.famname\n @person.email = @invite.email\n end\n end", "title": "" }, { "docid": "35f147b384a1472ed3ddfe9ee3995bab", "score": "0.50948256", "text": "def pentecost(g_year = self.year)\n in_calling_calendar(easter(g_year).fixed + 49)\n end", "title": "" }, { "docid": "3bdbc28f95716c18afa2db09958cfecf", "score": "0.5086755", "text": "def current_planning_year_year\n current_fiscal_year_year + 1\n end", "title": "" }, { "docid": "a2181b9d38132faab616fdc89578d5b3", "score": "0.5080338", "text": "def montantActiviteFamille(famille)\n return if !famille.ontDesActivites?\n \n # Est-ce qu'il y au moins un des membres qui a des activites et qui\n # a moins de quinze ans. Si oui, les frais sont non taxables\n famille.membres.each do | m |\n if m.aMoinsDeQuinzeAns? and m.aDesActivites?\n @montantActivite.nonTaxable = Constantes.instance.activiteFamille\n return\n end\n end\n \n @montantActivite.taxable = Constantes.instance.activiteFamille\n end", "title": "" }, { "docid": "ff3c367338af0560ed66e1715aa236cd", "score": "0.5067369", "text": "def set_endereco_franquium\n @endereco_franquium = EnderecoFranquium.find(params[:id])\n end", "title": "" }, { "docid": "98d07600d5b56cddd4e9bb35b296e770", "score": "0.5064126", "text": "def loyalty_program_merchants\n end", "title": "" }, { "docid": "090379cf71a523a2fbd9dbccf2c244b9", "score": "0.50456935", "text": "def exempte_rrq(debut)\n # Est-ce que la derniere journee de la periode de paie est dans le mois suivant\n # le mois de l'anniversaire de l'employe de ses 18 ans. Si oui, exempte\n self.naissance.beginning_of_month.next_month.years_since(18) > debut\n end", "title": "" }, { "docid": "35def80d08c177a835f9eb009d5f429d", "score": "0.5041472", "text": "def year() civil[0] end", "title": "" }, { "docid": "35def80d08c177a835f9eb009d5f429d", "score": "0.5041472", "text": "def year() civil[0] end", "title": "" }, { "docid": "51c0f19a35afb77ae9a0e011a164a181", "score": "0.5040155", "text": "def participating_schools; end", "title": "" }, { "docid": "922c5fd3b81a43c5dcb003bb3c11764f", "score": "0.50374657", "text": "def name\n primary_family_member.last_name\n end", "title": "" }, { "docid": "78e0254513379e291f5bbc01b22c4162", "score": "0.5026163", "text": "def registrant\n fetch(:@registrant) { |isrc_string| isrc_string[2,3] }\n end", "title": "" }, { "docid": "01d690020e58e441e8442d342d75ca47", "score": "0.502291", "text": "def civility(gender)\n ''\n end", "title": "" }, { "docid": "53737062e3a02b262fe8b900b211a72b", "score": "0.5021767", "text": "def geschlechter\n %w[Herr Frau]\n end", "title": "" }, { "docid": "197340cc076185d95931e46cee4681c4", "score": "0.5011419", "text": "def law_used_full\n if self.law_used == 'foi'\n return _(\"Freedom of Information\")\n elsif self.law_used == 'eir'\n return _(\"Environmental Information Regulations\")\n else\n raise \"Unknown law used '\" + self.law_used + \"'\"\n end\n end", "title": "" }, { "docid": "384e3f5987eff602d2a20460c9fcb64b", "score": "0.5010833", "text": "def local_marc_org_codes\n %w[NcDurC NcDurCL]\n end", "title": "" }, { "docid": "3b53065828ee3c6cb51cf0233cdc081c", "score": "0.5010745", "text": "def current_academic_year\n nil\n end", "title": "" }, { "docid": "0f4348a81792f59f306aff5841c3af3e", "score": "0.5010717", "text": "def family_invitation\n Relative.with_invited_email(email).find_by(year: Membership.maximum(:year))\n end", "title": "" }, { "docid": "b4fa8b6a444258da9767cf9eb09198a3", "score": "0.5009608", "text": "def family_name\n \"\"\n end", "title": "" }, { "docid": "e18912066bcb77bb0547eff2029fed99", "score": "0.50095385", "text": "def as_full\n \"#{country}-#{registrant}-#{year}-#{designation}\"\n end", "title": "" }, { "docid": "85a3f5ce8188dc000e6eb0178301528c", "score": "0.4987101", "text": "def create\n \n @person = Person.new(params[:person])\n \n if @person.valid?\n \n @person.build_op({user_id: current_user.id, filial_id: current_user.filial_id, active: 0})\n \n @person.representative.mark_for_destruction if @person.representative.fam.blank?\n @person.addres_p.mark_for_destruction if @person.addres_p.npname.blank?\n @person.foreigner.mark_for_destruction if @person.foreigner.ig_docdate.blank?\n \n \n if @person.save(:validate => false)\n redirect_to new_vizit_person_url(@person), notice: @person.fam + ' ' + @person.im + ' ' + @person.ot + ' добавлен(а) в базу.'\n else\n flash[:error] = \"В программе произошла серьезная ошибка. Обратитесь к администратору.\"\n render :new\n end\n else\n flash[:error] = \"Сохранить не получилось, проверьте ошибки в параметрах.\"\n render :new\n end\n # require \"net/http\"\n # str_guid = Net::HTTP.get(URI.parse(URI.encode(\"http://mozilla.pettay.fi/cgi-bin/mozuuid.pl\")))\n \n# @person.update_attributes(params[:person].except(:admin))!!кроме :admin, что бы не удалять :predstavitel\n end", "title": "" }, { "docid": "dc56c333556c40daa785c8557066951f", "score": "0.497709", "text": "def mday() civil[2] end", "title": "" }, { "docid": "dc56c333556c40daa785c8557066951f", "score": "0.497709", "text": "def mday() civil[2] end", "title": "" }, { "docid": "a8a482b7fa79642703250b29b00fc16b", "score": "0.49765828", "text": "def legislator_name(zip_code)\n civic_info = Google::Apis::CivicinfoV2::CivicInfoService.new\n civic_info.key = 'AIzaSyClRzDqDh5MsXwnCWi0kOiiBivP6JsSyBw'\n\n begin\n civic_info.representative_info_by_address(\n address: zip_code,\n levels: 'country',\n roles: %w[legislatorUpperBody legislatorLowerBody]\n ).officials\n rescue StandardError\n 'you can look it up yourself by visiting www.commoncause.org/take-action/find-elected-officials'\n end\nend", "title": "" }, { "docid": "0ec8a97d02457955ab721125bed144ef", "score": "0.49753377", "text": "def fiscal_year_epoch_year\n 2010\n end", "title": "" }, { "docid": "5760be44ca52c550ccb0f17a4f8f4d7e", "score": "0.4970049", "text": "def listed_company_registration_number\n Faker::Company.south_african_listed_company_registration_number\n end", "title": "" }, { "docid": "0e8c707fe7168ecc0fb31247f1558e63", "score": "0.49676144", "text": "def local_edd_patron_groups\n %w[PULEDD]\nend", "title": "" }, { "docid": "d0a444e795c811c3cd869e7245b1e905", "score": "0.49657866", "text": "def nonprofit_orgs_register\n end", "title": "" }, { "docid": "f1004f31edf70d42a4c617d1c75e535b", "score": "0.49631235", "text": "def commission_fee\n 0.1\n end", "title": "" }, { "docid": "718b7b02557af7829e0561fb8a86980e", "score": "0.49616754", "text": "def competitor_bib_numbers\n registrant_bib_numbers(\"Male\") + registrant_bib_numbers(\"Female\")\n end", "title": "" }, { "docid": "fb902af3ee140bacc17bcc6de2322588", "score": "0.49580985", "text": "def local_marc_org_codes\n %w[NcD NcD-B NcD-D NcD-L NcD-M NcD-W NcDurDH]\n end", "title": "" }, { "docid": "fb902af3ee140bacc17bcc6de2322588", "score": "0.49580985", "text": "def local_marc_org_codes\n %w[NcD NcD-B NcD-D NcD-L NcD-M NcD-W NcDurDH]\n end", "title": "" }, { "docid": "ca6477a59813953b6a257e9eba484f94", "score": "0.49574888", "text": "def cri;party_bonus(ex_attr_cri, :cri);end", "title": "" }, { "docid": "ea64a739e7751339e6671afc57b4c4ad", "score": "0.49574775", "text": "def diocesan_organelle_skyey(marialite_concatenator, resident_innaturally)\n unweary_semilens()\n end", "title": "" }, { "docid": "7440d855f609959732e54d903c90c95a", "score": "0.49557945", "text": "def initialize(benefit_sponsor, next_calendar_year_period, determination_timespan = 3.years)\n\t\tfinal_adjustment_factor \t\t= -0.0001\n\n\t\tvariable_adjustment_factor = next_calendar_year_period.adjustment_factor\n\n\t\tcalendar_year_period_id \t\t= next_calendar_year_period._id\n\t\tadministration_fee \t\t\t\t\t= next_calendar_year_period.administration_fee\n\t\tinitial_tax_rate \t\t\t\t\t\t= next_calendar_year_period.initial_tax_rate\n\t\tmaximum_tax_rate \t\t\t\t\t\t= next_calendar_year_period.maximum_tax_rate\n\t\ttax_rate \t\t\t\t\t\t\t\t\t\t= [raw_tax_rate, maximum_tax_rate].min\n\n\n\t\treserve_account_starting_balance\t= benefit_sponsor.reserve_balance_on(prior_year_period.start_on - 1.day)\n\t\tcontribution_amount \t\t\t\t\t\t\t= benefit_sponsor.net_contribution_amount_for(prior_year_period)\n\t\tinterest_earned_amount\t\t\t\t\t\t= benefit_sponsor.interest_income_for(prior_year_period)\n\t\treserve_account_ending_balance \t\t= previous_reserve + interest_earned + benefit_contributions - benefits_charged\n\tend", "title": "" }, { "docid": "33b1e52549979fffd64fa82fba478850", "score": "0.49543765", "text": "def current_financial_year\n end_year = configuration.current_academic_year.start_year\n start_year = end_year - 1\n\n \"6 April #{start_year} and 5 April #{end_year}\"\n end", "title": "" }, { "docid": "854c333d9cc3b7d56656075085964562", "score": "0.49512762", "text": "def federal_tax_rate\n FEDERAL_TAX_RATE\n end", "title": "" }, { "docid": "35828bd4c361e5e093dbd9d43ecfb8fc", "score": "0.4950331", "text": "def cwyear() commercial[0] end", "title": "" }, { "docid": "a079bb2addb337bab033336556b29eea", "score": "0.49431098", "text": "def localized_gender\n @@gender[female] || ''\n end", "title": "" }, { "docid": "c3bdd9766e6e5c0efc33423d7ff40de3", "score": "0.49415118", "text": "def start_of_planning_year\n start_of_fiscal_year current_planning_year_year\n end", "title": "" }, { "docid": "4b1f1c5588748f568b1753de9d0892fc", "score": "0.4940787", "text": "def monthly_fee\n \n end", "title": "" }, { "docid": "9a9f7bc86302f34c2d4e090e5e0abb9b", "score": "0.49317467", "text": "def prevalida_cfd\n \n # TODO validar si es emitido que el RFC y datos ficales del emisor coincidan con el perfil\n # TODO validar si es recibido que el RFC y datos fiscales del receptor coincidan con el perfil\n \n end", "title": "" }, { "docid": "a65e00127c80beee350e7076cab29461", "score": "0.4930006", "text": "def campus_patron_permissions\n anonymous_permissions\n end", "title": "" }, { "docid": "a65e00127c80beee350e7076cab29461", "score": "0.4930006", "text": "def campus_patron_permissions\n anonymous_permissions\n end", "title": "" }, { "docid": "edbeaf459565dca599918cb08a39d19b", "score": "0.4925859", "text": "def last_fiscal_year_year\n current_fiscal_year_year + SystemConfig.instance.num_forecasting_years\n end", "title": "" }, { "docid": "847a9ca448d5437eb2b81475c968ddb0", "score": "0.49254936", "text": "def schubert\n fetch('opera.german.by_franz_schubert')\n end", "title": "" }, { "docid": "a506af728c4f0bbac9b1048152ec0df8", "score": "0.49106514", "text": "def endereco_franquium_params\n params[:endereco_franquium]\n end", "title": "" }, { "docid": "6ce5565f6e517860395129436d149b91", "score": "0.4909384", "text": "def role_contact_name\n contact_name = nil\n \n if !self.person.blank?\n contact_name = self.person.last_name.downcase + ' ' + self.person.first_names.downcase\n elsif !self.organisation.blank?\n contact_name = self.organisation.organisation_list_name.downcase\n end \n \n return contact_name\n \n end", "title": "" }, { "docid": "3afffd546318cafd1c185b7d6a1cf7bd", "score": "0.4901848", "text": "def possible_mercenaries(v)\n land_forcelimit(12*v)\n end", "title": "" }, { "docid": "3afffd546318cafd1c185b7d6a1cf7bd", "score": "0.4901848", "text": "def possible_mercenaries(v)\n land_forcelimit(12*v)\n end", "title": "" }, { "docid": "3ecbb9e79d63778a57abab2b4a864563", "score": "0.4898073", "text": "def get_firm_name\n self.firm.nil? ? \"\" : self.firm.get_full_name\n end", "title": "" }, { "docid": "3ecbb9e79d63778a57abab2b4a864563", "score": "0.4898073", "text": "def get_firm_name\n self.firm.nil? ? \"\" : self.firm.get_full_name\n end", "title": "" }, { "docid": "10e629521b32fa4c600f3c3279449fa9", "score": "0.48959124", "text": "def gender; 0; end", "title": "" }, { "docid": "5a7a2d9304cd3eacfefc5712df61d0a9", "score": "0.48948053", "text": "def service_period(start = service_provider_service_start,\n finish = service_provider_service_end)\n if start && finish\n start..finish\n else\n # fy = funded_person.fiscal_year(created_at)\n fy = FiscalYear.new(part_b_fiscal_year)\n service_period(fy.begin, fy.end)\n end\n end", "title": "" }, { "docid": "1ed9e9dd270fe2a8fc879f2f9f8a70ca", "score": "0.48886463", "text": "def personality\n reduce_list(prep_name, @consonants)\n end", "title": "" }, { "docid": "b28e694d3b630c0459fb5bb19c5bb1a0", "score": "0.48868597", "text": "def add_field_term(member, params={})\n location = params[:residence_location] || Location.random\n ministry= params[:ministry] || Ministry.random\n employment_status = params[:employment_status] || EmploymentStatus.random\n if SHORT_TERM_EMPLOYMENT_STATUSES.include?(employment_status)\n default_duration = (rand(24)+1).months\n else\n default_duration = (rand(46) + 1).months\n end\n duration = params[:duration] || default_duration\n start_date = params[:start_date] \n if start_date.nil?\n # Come up with a reasonable current term based on what the last term, if any, was\n last_term = member.field_terms.last\n if last_term.nil? #if this is the first term being created for the person...\n start_date=member.personnel_data.date_active\n else # base current term on the end of the last term\n if last_term.end_date.nil?\n start_date=last_term.start_date + (rand(46) + 7).months \n else\n start_date=last_term.end_date + (rand(9) + 3).months \n end\n end\n end \n return nil if start_date > Date::today\n end_date = params[:end_date] || start_date + duration\n est_start_date = params[:est_start_date] # No default on this one\n est_end_date = params[:est_end_date] || est_start_date + duration if est_start_date\n employment_status = params[:employment_status] || EmploymentStatus.random\n f = member.field_terms.create( :primary_work_location => location, :ministry=>ministry,\n :start_date=>start_date, :end_date =>end_date,\n :est_start_date=>est_start_date, :est_end_date=>est_end_date,\n :employment_status=>employment_status\n )\n end", "title": "" }, { "docid": "15ec27234576b4ecaca211eccc04d944", "score": "0.48855272", "text": "def century(year)\n \n\nend", "title": "" }, { "docid": "06f54a02eebaabb7c057004fb687cc60", "score": "0.4883629", "text": "def fcm\n return nil if doc_head==nil\n fee_m_code=doc_head.doc_type==1 ? FeeCodeMatch.find_by_fee_code(\"07\") : FeeCodeMatch.find_by_fee_code(\"08\")\n if fee\n fcm= FeeCodeMatch.find_by_fee_code(fee.code)\n if fcm\n fee_m_code=fcm\n end\n end\n return fee_m_code\n end", "title": "" }, { "docid": "e4579ff45b5de0e7dc6c172703868b27", "score": "0.48745492", "text": "def family_monthly_income\n current_user.family.monthly_income\n end", "title": "" }, { "docid": "03344b00799a986e54f56317fe3cd27a", "score": "0.48736104", "text": "def person_local_province() loc_state end", "title": "" }, { "docid": "7510a42ec1f1ec8db8de05e6ffc02ed0", "score": "0.4870073", "text": "def supplier_rfc()\n if self.supplier.taxpayer_reg == nil\n r = \"...\"\n else\n r=self.supplier.taxpayer_reg\n end\n end", "title": "" }, { "docid": "5c7a65fd23791c3b73b33b0a1f899419", "score": "0.48693073", "text": "def west_london_family_court\n Court.find_or_create_by(id: 'west-london-family-court') do |court|\n court.name = \"West London Family Court\"\n court.gbs = \"Y691\"\n court.cci_code = nil\n court.address = {\n \"town\" => \"Feltham\",\n \"type\" => \"Visit or contact us\",\n \"county\" => \"Greater London\",\n \"postcode\" => \"TW14 0LR\",\n \"description\" => nil,\n \"address_lines\" => [\n \"Gloucester House\",\n \"4 Dukes Green Avenue\"\n ],\n \"fields_of_law\" => nil\n }\n court.email = \"[email protected]\"\n end\n end", "title": "" }, { "docid": "3be7facddf15a3143c629a022041e6e0", "score": "0.48637992", "text": "def party_type\n 'Person'\n end", "title": "" }, { "docid": "b5cacf5c82f72d2a0447d856d866b1b2", "score": "0.48593757", "text": "def everyone\n if @force_region\n \"in \" + Region.with_id(@force_region).reg_name\n elsif @force_affiliate\n \"in \" + Affiliate.with_id(@force_affiliate).aff_short_name\n else\n \"\"\n end\n end", "title": "" }, { "docid": "f72e1fd84f0bb2925cf9c4a6470d8cb2", "score": "0.48550686", "text": "def governador_1\n governadors.first\n end", "title": "" }, { "docid": "d625b9cca9ed1161e80f41ec42658c38", "score": "0.4848356", "text": "def proteasefamily\n self.meropsfamily\n end", "title": "" }, { "docid": "c6bc6837a009c6257f2cfccc6b748e3a", "score": "0.48465675", "text": "def family\n @family\n end", "title": "" }, { "docid": "21d78fa781588ae83068d5ea93a528f7", "score": "0.48407513", "text": "def full_name\n \t\t\"#{abr_profesion} #{persona_nombre} #{persona_apellido}\"\n\tend", "title": "" }, { "docid": "a3816821b2559477f00f4564960b8c41", "score": "0.48406833", "text": "def campoord_inicial\n 'fecharec'\n end", "title": "" }, { "docid": "a3816821b2559477f00f4564960b8c41", "score": "0.48406833", "text": "def campoord_inicial\n 'fecharec'\n end", "title": "" }, { "docid": "95770fe17b4c2fca6971d044306407e4", "score": "0.48348138", "text": "def indice_corporal\n if @datos.indice_masa_corporal <= 18.5\n \"Bajo peso\"\n elsif @datos.indice_masa_corporal > 18.5 and @datos.indice_masa_corporal <= 24.9\n \"Peso adecuado\"\n elsif @datos.indice_masa_corporal > 25.0 and @datos.indice_masa_corporal <= 29.9\n \"Sobrepeso\"\n elsif @datos.indice_masa_corporal > 30.0 and @datos.indice_masa_corporal <= 34.9\n \"Obesidad grado 1\"\n elsif @datos.indice_masa_corporal > 35.0 and @datos.indice_masa_corporal <= 39.9\n \"Obesidad grado 2\"\n elsif @datos.indice_masa_corporal > 40\n \"Obesidad grado 3\"\n end\n end", "title": "" }, { "docid": "bed080a1f9f8d33339a7fdaf1d31a321", "score": "0.48312637", "text": "def gen_term_restriction(admin_info, year_id)\n season = admin_info[2]\n year_abbrev = (year_id + 1990).to_s.slice(2, 3) + '-' +\n (year_id + 1 + 1990).to_s.slice(2, 3)\n if (admin_info[1] == 'sg')\n terms = \" \"\n else\n if (season == 'fall')\n terms = \" AND (terms.abbreviation = 'S1') \"\n else\n terms = \" AND (terms.abbreviation = 'S2' or \" +\n \"terms.abbreviation = '#{year_abbrev}') \"\n end\n end\n return terms\nend", "title": "" }, { "docid": "494a06d9b5cf76beaefc3025bddbcb54", "score": "0.4829914", "text": "def female_name\n case rand(9)\n when 0, 5 then \"#{first_name(:female)} #{middle_name(:female)}\"\n else first_name(:female)\n end\n end", "title": "" }, { "docid": "9e87182081ebb73e84c7e5d4a438093b", "score": "0.48267463", "text": "def e201_nome_do_registro\n return \"E201\"\n end", "title": "" }, { "docid": "4a77a8a05e913388e7cee44a3328e071", "score": "0.4824729", "text": "def cliente_nomefantasia\n\tcliente.nomefantasia if cliente\n end", "title": "" }, { "docid": "eeea4a4fb18875e3e7d60a00a1e6276d", "score": "0.4824195", "text": "def getFiscalYearObjName\r\n\t\t return \"fiscal_year__c\"\r\n\t\tend", "title": "" }, { "docid": "4c4681fafe0093a550332b336e513950", "score": "0.48239976", "text": "def trust_registration_number\n Faker::Company.south_african_trust_registration_number\n end", "title": "" }, { "docid": "dfde32a38d376092fe0d90894da89dca", "score": "0.4823197", "text": "def descripcion\n\t\t\"#{rif.upcase} | #{razon_social}\"\n\tend", "title": "" } ]
2f0843052be1e220ad6308f12480dc19
Example of duties: manager, designer, programmer, tester. Finds TeamsUser and save preferred Duty
[ { "docid": "8e4ec92383615de583e51efc0715a60b", "score": "0.5616523", "text": "def update_duties\n team_user = TeamsUser.find(params[:teams_user_id])\n team_user.update_attribute(:duty_id, params[:teams_user]['duty_id'])\n redirect_to controller: 'student_teams', action: 'view', student_id: params[:participant_id]\n end", "title": "" } ]
[ { "docid": "7f95c08b1439db6120a962f9e4bc3a05", "score": "0.58251715", "text": "def populate_judge_team_for_testing(judge_team, judge_user, attorneys)\n attorneys.each do |u|\n judge_team.users << u\n attorney_orgsuser = OrganizationsUser.existing_record(u, judge_team)\n DecisionDraftingAttorney.create!(organizations_user: attorney_orgsuser)\n end\n judge_team.users << judge_user\n attorney_orgsuser = OrganizationsUser.existing_record(attorneys.first, judge_team)\n attorney_orgsuser.update!(admin: true)\n judge_orguser = OrganizationsUser.existing_record(judge_user, judge_team)\n judge_orguser.update!(admin: true)\n JudgeTeamLead.create!(organizations_user: judge_orguser)\n end", "title": "" }, { "docid": "347053372042c66f5f875e5febd26cfc", "score": "0.57211965", "text": "def add_user(user)\n super.tap do |org_user|\n class_name = (users.count == 1) ? JudgeTeamLead : DecisionDraftingAttorney\n class_name.find_or_create_by(organizations_user: org_user)\n end\n end", "title": "" }, { "docid": "dddab89e1dd7b7045ca5636042164928", "score": "0.56024224", "text": "def duty_id\n participant = team_user\n return participant.duty_id if participant\n end", "title": "" }, { "docid": "fec7edad038243cae8eac3d167ed2801", "score": "0.5471556", "text": "def designer\n \n if self.designer_id > 0\n User.find(self.designer_id)\n else\n User.new(:first_name => 'Not', :last_name => 'Assigned')\n end\n \n end", "title": "" }, { "docid": "afcf2ebc222fbc598b327e9540a0b65c", "score": "0.5430376", "text": "def pick_defender(team)\n puts \"Pick your Defender from second name\"\n list_of_names = selected_data_def_array.map do |element|\n element[\"second_name\"]\n end\n puts list_of_names\n your_defender_name = gets.chomp\n if Player.all.any? {|player_obj| player_obj.second_name == your_defender_name}\n Player.all.each do\n |player_obj|if player_obj.second_name == your_defender_name && player_obj.element_type == 2\n Selection.create(team_id: team.id, player_id: player_obj.id)\n puts \"#{your_defender_name} has been added to your team!\"\n end\n end\n else\n puts \"Invalid name. Please select again.\"\n pick_defender(team)\n end\nend", "title": "" }, { "docid": "1282c591e1a2004c824a3f57ac383cc2", "score": "0.5409076", "text": "def opponent_name=(opponent_name)\n self.opponent = User.find_by(full_name: opponent_name) if opponent_name.present?\n end", "title": "" }, { "docid": "3f7c121e0b46aac133a2f12de66c8e9e", "score": "0.5371213", "text": "def default_team\n if teams.present?\n teams.first\n else\n team = Team.create(name: \"Demo Team\")\n set_team!(team)\n return team\n end\n end", "title": "" }, { "docid": "76e750e8360b730e8c54bfca0bbda7d9", "score": "0.53591204", "text": "def developer\n find_or_create_user(\"developer\")\n end", "title": "" }, { "docid": "8e682b417df30c07925cd6f1eca206ac", "score": "0.5315292", "text": "def find_attendees (performers_id)\n\tif performers_id == \"LCD Soundsystem\"\n\tusers = $DATABASE.execute(\"SELECT user.name, performer.band_name FROM user JOIN performer ON user.performer_id = performer.performers_id WHERE performers_id = 13\")\n\tputs \"Head to the Green Stage at 8:10 pm and watch LCD Soundsystem with the following friends:\"\n\tusers.each do |user|\n\t\tputs \"#{user['name']}\"\n\tend \n\n\telsif performers_id == \"Madame Gandhi\"\n\tusers = $DATABASE.execute(\"SELECT user.name, performer.band_name FROM user JOIN performer ON user.performer_id = performer.performers_id WHERE performers_id = 1\")\n\tputs \"Head to the Red Stage at 1:00 pm and watch Madame Gandhi with the following friends:\"\n\tusers.each do |user|\n\t\tputs \"#{user['name']}\"\n\tend\n\n\telsif performers_id == \"Priests\"\n\tusers = $DATABASE.execute(\"SELECT user.name, performer.band_name FROM user JOIN performer ON user.performer_id = performer.performers_id WHERE performers_id = 2\")\n\tputs \"Head to the Green Stage at 1:45 pm and watch Priests with the following friends:\"\n\tusers.each do |user|\n\t\tputs \"#{user['name']}\"\n\tend\n\n\telsif performers_id == \"Dawn Richard\"\n\tusers = $DATABASE.execute(\"SELECT user.name, performer.band_name FROM user JOIN performer ON user.performer_id = performer.performers_id WHERE performers_id = 3\")\n\tputs \"Head to the Blue Stage at 2:30 pm and watch Dawn Richard with the following friends:\"\n\tusers.each do |user|\n\t\tputs \"#{user['name']}\"\n\tend\n\n\telsif performers_id == \"Hiss Golden Messenger\"\n\tusers = $DATABASE.execute(\"SELECT user.name, performer.band_name FROM user JOIN performer ON user.performer_id = performer.performers_id WHERE performers_id = 4\")\n\tputs \"Head to the Red Stage at 3:00 pm and watch Hiss Golden Messenger with the following friends:\"\n\tusers.each do |user|\n\t\tputs \"#{user['name']}\"\n\tend\n\n\telsif performers_id == \"Vince Staples\"\n\tusers = $DATABASE.execute(\"SELECT user.name, performer.band_name FROM user JOIN performer ON user.performer_id = performer.performers_id WHERE performers_id = 5\")\n\tputs \"Head to the Green Stage at 4:00 pm and watch Vince Staples with the following friends:\"\n\tusers.each do |user|\n\t\tputs \"#{user['name']}\"\n\tend\n\n\telsif performers_id == \"William Tyler\"\n\tusers = $DATABASE.execute(\"SELECT user.name, performer.band_name FROM user JOIN performer ON user.performer_id = performer.performers_id WHERE performers_id = 6\")\n\tputs \"Head to the Blue Stage at 4:00 pm and watch William Tyler with the following friends:\"\n\tusers.each do |user|\n\t\tputs \"#{user['name']}\"\n\tend\n\n\telsif performers_id == \"Thurston Moore\"\n\tusers = $DATABASE.execute(\"SELECT user.name, performer.band_name FROM user JOIN performer ON user.performer_id = performer.performers_id WHERE performers_id = 7\")\n\tputs \"Head to the Red Stage at 5:00 pm and watch Thurston Moore Group with the following friends:\"\n\tusers.each do |user|\n\t\tputs \"#{user['name']}\"\n\tend\n\n\telsif performers_id == \"Frankie Cosmos\"\n\tusers = $DATABASE.execute(\"SELECT user.name, performer.band_name FROM user JOIN performer ON user.performer_id = performer.performers_id WHERE performers_id = 8\")\n\tputs \"Head to the Blue Stage at 5:15 pm and watch Frankie Cosmos with the following friends:\"\n\tusers.each do |user|\n\t\tputs \"#{user['name']}\"\n\tend\n\n\telsif performers_id == \"Danny Brown\"\n\tusers = $DATABASE.execute(\"SELECT user.name, performer.band_name FROM user JOIN performer ON user.performer_id = performer.performers_id WHERE performers_id = 9\")\n\tputs \"Head to the Green Stage at 6:00 pm and watch Danny Brown with the following friends:\"\n\tusers.each do |user|\n\t\tputs \"#{user['name']}\"\n\tend\n\n\telsif performers_id == \"Kamaiyah\"\n\tusers = $DATABASE.execute(\"SELECT user.name, performer.band_name FROM user JOIN performer ON user.performer_id = performer.performers_id WHERE performers_id = 10\")\n\tputs \"Head to the Blue Stage at 6:30 pm and watch Kamaiyah with the following friends:\"\n\tusers.each do |user|\n\t\tputs \"#{user['name']}\"\n\tend\n\n\telsif performers_id == \"Dirty Projectors\"\n\tusers = $DATABASE.execute(\"SELECT user.name, performer.band_name FROM user JOIN performer ON user.performer_id = performer.performers_id WHERE performers_id = 11\")\n\tputs \"Head to the Red Stage at 7:00 pm and watch Dirty Projectors with the following friends:\"\n\tusers.each do |user|\n\t\tputs \"#{user['name']}\"\n\tend\n\n\telsif performers_id == \"Arca & Jesse Kanda\"\n\tusers = $DATABASE.execute(\"SELECT user.name, performer.band_name FROM user JOIN performer ON user.performer_id = performer.performers_id WHERE performers_id = 12\")\n\tputs \"Head to the Blue Stage at 7:45 pm and watch Arca & Jesse Kanda with the following friends:\"\n\tusers.each do |user|\n\t\tputs \"#{user['name']}\"\n\tend\n\t\n\telse \n\t\tputs \"We couldn't process your request, please retry\"\n\tend\nend", "title": "" }, { "docid": "f3c101c6b7f8c8031e48c47f027907ac", "score": "0.5295661", "text": "def submitter_team\n @submitter_team ||= competition.teams.joins(:users).where({ users: { id: user.id } }).first\n end", "title": "" }, { "docid": "1e3f971634de942e2810aa6d6846ae53", "score": "0.5290972", "text": "def who_its_with\n tandu = object.current_team_and_user\n if tandu.user.present? && h.current_user.responding_teams.include?(tandu.team)\n tandu.user.full_name\n else\n tandu.team&.name\n end\n end", "title": "" }, { "docid": "caff859020fecb6ba5b6f3a285b70470", "score": "0.526661", "text": "def bye_dude\n puts \"BYE #{user.name}\"\n get_user\nend", "title": "" }, { "docid": "0275a9a884201e63e8734921e202a1e3", "score": "0.52644706", "text": "def founder\n return self.created_by if self.created_by_type == User.name\n return self.created_by.organisers.first if self.created_by_type == League.name\n return User.find(self.created_by_id) if self.created_by_id && self.created_by_type.nil?\n nil\n end", "title": "" }, { "docid": "74bc0a3a830946e41886efbd520f91bd", "score": "0.52558696", "text": "def setup_universal\n @a1 = admins(:elle_woods)\n @a2 = admins(:vivian_kensington)\n @a3 = admins(:emmett_richmond)\n @a4 = admins(:paulette_bonafonte)\n @a5 = admins(:professor_callahan)\n @a6 = admins(:warner_huntington)\n\n @u1 = users(:connery)\n @u2 = users(:lazenby)\n @u3 = users(:moore)\n @u4 = users(:dalton)\n @u5 = users(:brosnan)\n @u6 = users(:craig)\n @u7 = users(:blofeld)\nend", "title": "" }, { "docid": "cfaf4dcd690f2b696ff78c21c0e9e9a5", "score": "0.5243156", "text": "def update\n @duty = Duty.find(params[:id])\n\n respond_to do |format|\n if @duty.update_attributes(params[:duty])\n format.html { redirect_to @duty, notice: 'Duty was successfully updated.' }\n format.json { head :no_content }\n else\n @assigner_select = User.order('last_name ASC').collect{|s| [s.first_name + \" \" + s.last_name, s.id]}\n format.html { render action: \"edit\" }\n format.json { render json: @duty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bac05e232ac5516516227b8005f63929", "score": "0.5219535", "text": "def lifestyle_matches\n @user = Deet.where(lifestyle: lifestyle_types).where(user: basic_matches).map(&:user_id)\n end", "title": "" }, { "docid": "e8df6cba34553bc740f6c18ad6b82b1c", "score": "0.5212605", "text": "def user\n if trial?\n 'trial couple'\n elsif couple?\n 'couple'\n else\n 'guest'\n end\n end", "title": "" }, { "docid": "e6ad63892b9c9670bf5aad89f9c4a86e", "score": "0.5193158", "text": "def try_to_assign_user\n # Step 1: Try to see if there was a previous donation from the same email/bank reference\n if @donation.donor_id.blank?\n donation = search_for_similar_assigned_donation\n @donation.donor_id = donation.donor_id if donation\n end\n\n # Step 2: If that didn't work and we have a bank reference, check if there's a user with a paymentid field that matches\n if @donation.donor_id.blank? && [email protected]_reference.blank?\n # Step 2.1: Divide the bank reference into words and search for them independently. For example \"12345 John Smith\" >> ['12345', 'John', 'Smith']\n search_string = @donation.bank_reference.split(\" \").map{|string| \"paymentid LIKE '%#{Mysql2::Client.escape(string)}%'\"}.join(\" OR \")\n users = Donor.where(search_string)\n # Step 2.2: Only accept as valid those users whose complete bank reference matches. For example, accept \"John Smith\" or \"12345 John\". But not \"John Johansen\".\n users.select!{|u| @donation.bank_reference.include?(u.paymentid)}\n if users.size == 1\n @donation.donor_id = users.first.id\n elsif users.size > 1\n return :multiple_users_found\n end\n end\n\n # Step 3: If that didn't work and we have en email, try to find an existing user via email\n if @donation.donor_id.blank? && [email protected]?\n user = Donor.find_by_any_email(@donation.email).first\n if user\n @donation.donor_id = user.id\n end\n end\n\n # Step 4: If we have not had luck yet, create a new user\n if @donation.donor_id.blank? && [email protected]?\n user = Donor.new(user_email: @donation.email, first_name: @first_name, last_name: @last_name)\n user.role = \"single_supporter\"\n user.save\n @donation.donor_id = user.id\n end\n\n # Step 5: store a boolean value to facilitate searching\n if @donation.donor_id.blank?\n @donation.user_assigned = false\n return :no_user_found\n else\n @donation.user_assigned = true\n @donation.save\n return :user_assigned\n end\n end", "title": "" }, { "docid": "169961c9b8b2ac622b3f428a6c8460d5", "score": "0.51924926", "text": "def user_with_proficiency(value)\n skillset = Skillset.find_by_proficiency(value)\n user_id = skillset.user_id\n user_name = User.find(user_id)\n user_name\n end", "title": "" }, { "docid": "f1e7f2973ed21f67a3ebe76953559897", "score": "0.5143603", "text": "def create_default_practice\n DefaultPractice.create :user_id => self.id\n end", "title": "" }, { "docid": "eab56334f5cf78063c85e04646d068e6", "score": "0.51315844", "text": "def best_person_for_the_task\n best_fit=Task.candidate_set - users\n if best_fit.count==0 && users.pluck(:id).count.zero?\n best_fit = User.all.order(last_sign_in_at: :desc)\n end\n best_fit.first\n end", "title": "" }, { "docid": "c55624259db0bfaa11dd6525fa26f816", "score": "0.5131489", "text": "def lead_teacher\n teacher = teachers.first\n raise Mongoid::Errors::DocumentNotFound.new(self.class, {}) unless teacher\n\n teacher\n end", "title": "" }, { "docid": "5e4fab52bd26ad36301ed328afd3b6c1", "score": "0.51313657", "text": "def other_person(exclude = nil)\n # don't choose the excluded person or ourself\n options = room.users.reject{|u| u[:name] =~ /^(#{exclude}|#{self.name})/ }\n # return the other person's first name, or nil if we didn't find one\n options.any? ? options[rand(options.size)][:name].split(' ').first : nil\n end", "title": "" }, { "docid": "a91c44afebfd94613e8355330b1a1434", "score": "0.51158977", "text": "def get_default\n if(Team.all.count == 0 || Member.all.count == 0)\n response = response_api(\n \"https://71119a58-557b-497b-9bb2-9971014d44ec.mock.pstmn.io/teams\"\n )\n\n response[\"teams\"].each do |team_info|\n # Create the team\n team = Team.find_or_create_by(\n name:team_info[\"name\"], \n home_town:team_info[\"homeTown\"], \n formed:team_info[\"formed\"], \n active:team_info[\"active\"]\n )\n\n # Create the members of this team\n team_info[\"members\"].each do |hero|\n team.members.find_or_create_by(\n name:hero[\"name\"],\n age:hero[\"age\"],\n secret_identity:hero[\"secretIdentity\"],\n powers:hero[\"powers\"]\n )\n end\n end\n end\n end", "title": "" }, { "docid": "f768133cd54242e349cbbcc28a006318", "score": "0.5092544", "text": "def auto_pick(matchday, users)\n lastyr = last_yr_standings\n # creates array of picked teams for each user\n users.each do |user|\n pickedteams = []\n # Array of teams from begining of half until current matchday\n picked = picked_teams_for_auto(user, matchday)\n\n picked.each do |pick|\n pickedteams.push(pick.team_id) unless pick.team_id.nil?\n end\n # cycles thru last years standings finding highest placed\n # team yet to be selected\n puts 'USER' + user.to_s\n lastyr.each do |team|\n if pickedteams.include?(team)\n puts 'Picked' + team\n else\n puts 'AUTO PICK ' + team\n future_picked?(user, team, matchday)\n autopick = Pick.where(matchday: matchday, user_id: user)\n autopick.update(team_id: team)\n break\n end\n end\n end\n end", "title": "" }, { "docid": "6f6daf4a1f8e704366a646b869ecc082", "score": "0.5088251", "text": "def best_name_possible\n nickname || real_name || \"user_#{id}\"\n end", "title": "" }, { "docid": "7bf1098afb53d71a9fe9f5335accd163", "score": "0.50872296", "text": "def set_team_captain\n return unless team_captain.nil? && !users.empty?\n update_attribute(:team_captain, users.first)\n end", "title": "" }, { "docid": "310b8c53439542915033695ca4445745", "score": "0.50851583", "text": "def new_dream_team(name)\n\tnew_team = DreamTeam.new\n\tnew_team.user_id = @@current_user.id\n\tnew_team.player_id = Player.find_by(name: \"#{name}\").id\n\tnew_team.save\nend", "title": "" }, { "docid": "7f3831990e0bc34db697e04eed1a896f", "score": "0.5077018", "text": "def get_team_by_captain(user)\n teams.find { |x| x.team_captain?(user) }\n end", "title": "" }, { "docid": "5b9113f2af642025afc3491c4cfe4055", "score": "0.5074978", "text": "def create\n @duty = Duty.new(params[:duty])\n @duty.assigned_user = current_user\n respond_to do |format|\n if @duty.save\n @duty.user_ids.each do |user_id|\n @user1 = User.find(user_id)\n DutyAssignment.assignment_email(@user1, @duty.assigned_user, @duty).deliver\n end\n format.html { redirect_to @duty, notice: 'Duty was successfully created.' }\n format.json { render json: @duty, status: :created, location: @duty }\n else\n #@duty.user_id = current_user.id\n @assigner_select = User.order('last_name ASC').collect{|s| [(s.first_name + \" \" + s.last_name), s.id]}\n format.html { render action: \"new\" }\n format.json { render json: @duty.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "18ecbd7f30feb57b01b02108efe9ca2a", "score": "0.5068651", "text": "def getTeacher\n if User.find_by_id(self.teacher).presence\n User.find_by_id(self.teacher).fullName\n else\n \"Invalid teacher\"\n end\n end", "title": "" }, { "docid": "a67860434ef64a5afb3ad5c04b4c0f82", "score": "0.5058366", "text": "def ultimate_matches\n @user = User.where(id: first_date_match_user_ids).where(id: lifestyle_matches)\n end", "title": "" }, { "docid": "d9cbe11e476864a4eb84abf6eda3f92d", "score": "0.5056507", "text": "def contributor\n Team.find_by(id: reviewee_id)\n end", "title": "" }, { "docid": "f4b77e963c15b7d59587d9c8c64df700", "score": "0.50554645", "text": "def set_advisor\n advisors = BOACUtils.get_dept_advisors @dept\n case @dept\n when BOACDepartments::ADMIN\n @advisor = BOACUser.new({:uid => Utils.super_admin_uid})\n when BOACDepartments::ASC\n @advisor = advisors.first\n when BOACDepartments::COE\n uid = CONFIG['test_coe_advisor_uid']\n @advisor = uid ? (advisors.find { |a| a.uid.to_i == uid }) : advisors.first\n when BOACDepartments::L_AND_S\n uid = CONFIG['test_l_and_s_advisor_uid']\n @advisor = uid ? (advisors.find { |a| a.uid.to_i == uid }) : advisors.first\n when BOACDepartments::PHYSICS\n @advisor = advisors.first\n else\n logger.error 'What kinda department is that??'\n fail\n end\n end", "title": "" }, { "docid": "cdf107de8dd1bf0001032ee77a1624fa", "score": "0.50535923", "text": "def pbFindUser(choice,targets)\n move=choice[2]\n target=choice[3]\n user=self # Normally, the user is self\n # Targets in normal cases\n case pbTarget(move)\n when PBTargets::SingleNonUser\n if target>=0\n [email protected][target]\n if !pbIsOpposing?(targetBattler.index)\n if !pbAddTarget(targets,targetBattler)\n pbAddTarget(targets,pbOpposing2) if !pbAddTarget(targets,pbOpposing1)\n end\n else\n pbAddTarget(targets,targetBattler.pbPartner) if !pbAddTarget(targets,targetBattler)\n end\n else\n pbRandomTarget(targets)\n end\n when PBTargets::SingleOpposing\n if target>=0\n [email protected][target]\n if !pbIsOpposing?(targetBattler.index)\n if !pbAddTarget(targets,targetBattler)\n pbAddTarget(targets,pbOpposing2) if !pbAddTarget(targets,pbOpposing1)\n end\n else\n pbAddTarget(targets,targetBattler.pbPartner) if !pbAddTarget(targets,targetBattler)\n end\n else\n pbRandomTarget(targets)\n end\n when PBTargets::OppositeOpposing\n pbAddTarget(targets,pbOppositeOpposing) if !pbAddTarget(targets,pbOppositeOpposing2)\n when PBTargets::RandomOpposing\n pbRandomTarget(targets)\n when PBTargets::AllOpposing\n # Just pbOpposing1 because partner is determined late\n pbAddTarget(targets,pbOpposing2) if !pbAddTarget(targets,pbOpposing1)\n when PBTargets::AllNonUsers\n for i in 0...4 # not ordered by priority\n pbAddTarget(targets,@battle.battlers[i]) if i!=@index\n end\n when PBTargets::UserOrPartner\n if target>=0 # Pre-chosen target\n [email protected][target]\n pbAddTarget(targets,targetBattler.pbPartner) if !pbAddTarget(targets,targetBattler)\n else\n pbAddTarget(targets,self)\n end\n when PBTargets::Partner\n pbAddTarget(targets,pbPartner)\n else\n move.pbAddTarget(targets,self)\n end\n return user\n end", "title": "" }, { "docid": "cdf107de8dd1bf0001032ee77a1624fa", "score": "0.50535923", "text": "def pbFindUser(choice,targets)\n move=choice[2]\n target=choice[3]\n user=self # Normally, the user is self\n # Targets in normal cases\n case pbTarget(move)\n when PBTargets::SingleNonUser\n if target>=0\n [email protected][target]\n if !pbIsOpposing?(targetBattler.index)\n if !pbAddTarget(targets,targetBattler)\n pbAddTarget(targets,pbOpposing2) if !pbAddTarget(targets,pbOpposing1)\n end\n else\n pbAddTarget(targets,targetBattler.pbPartner) if !pbAddTarget(targets,targetBattler)\n end\n else\n pbRandomTarget(targets)\n end\n when PBTargets::SingleOpposing\n if target>=0\n [email protected][target]\n if !pbIsOpposing?(targetBattler.index)\n if !pbAddTarget(targets,targetBattler)\n pbAddTarget(targets,pbOpposing2) if !pbAddTarget(targets,pbOpposing1)\n end\n else\n pbAddTarget(targets,targetBattler.pbPartner) if !pbAddTarget(targets,targetBattler)\n end\n else\n pbRandomTarget(targets)\n end\n when PBTargets::OppositeOpposing\n pbAddTarget(targets,pbOppositeOpposing) if !pbAddTarget(targets,pbOppositeOpposing2)\n when PBTargets::RandomOpposing\n pbRandomTarget(targets)\n when PBTargets::AllOpposing\n # Just pbOpposing1 because partner is determined late\n pbAddTarget(targets,pbOpposing2) if !pbAddTarget(targets,pbOpposing1)\n when PBTargets::AllNonUsers\n for i in 0...4 # not ordered by priority\n pbAddTarget(targets,@battle.battlers[i]) if i!=@index\n end\n when PBTargets::UserOrPartner\n if target>=0 # Pre-chosen target\n [email protected][target]\n pbAddTarget(targets,targetBattler.pbPartner) if !pbAddTarget(targets,targetBattler)\n else\n pbAddTarget(targets,self)\n end\n when PBTargets::Partner\n pbAddTarget(targets,pbPartner)\n else\n move.pbAddTarget(targets,self)\n end\n return user\n end", "title": "" }, { "docid": "d6eb3459ad83d504631fd96629439ce6", "score": "0.5048292", "text": "def auth_professor(professors)\n #@user_cur = User.find_user(emailCheckit.to_s)\n #@user_cur.each |s| \n # x = s.id \n #end\n #cur = User.find x \n if Directory.exists? self.email.to_s then\n found = Directory.find self.email.to_s\n if found.professor then\n self.professor = true\n self.save\n end\n end\n\n end", "title": "" }, { "docid": "1cafb09f3eca71090a6dd851127d1805", "score": "0.5042886", "text": "def profile\n restrict('allow only doctor admins') or begin\n @doctor = current_doctor\n end\n end", "title": "" }, { "docid": "dd6b851eaca5f5530742fe0f3db29638", "score": "0.5037244", "text": "def get_fighter(name)\n\t\tfighter = Fighter.where(:user_name => name).first\n\n\t\tif fighter.nil?\n\t\t\tfighter = Fighter.create(:user_name => name, :xp_points => 0)\n\t\t\tfighter.save\n\t\tend\n\n\t\treturn fighter\n\tend", "title": "" }, { "docid": "8818da90e7ccebfe075aa0099cc6781f", "score": "0.5035237", "text": "def get_user\n @discobot ||= User.find_by({username: \"discobot\"})\n\n unless @discobot\n @discobot = User.create(\n name: \"Discobot\",\n username: \"discobot\",\n approved: true, active: true,\n admin: true,\n password: SecureRandom.hex,\n email: \"#{SecureRandom.hex}@anon.#{Discourse.current_hostname}\",\n trust_level: 4,\n trust_level_locked: true,\n created_at: 10000.years.ago\n )\n\n @discobot.grant_admin!\n @discobot.activate\n\n # TODO Pull the user avatar from that thread for now. In the future, pull it from a local file or from some central discobot repo.\n UserAvatar.import_url_for_user(\n \"https://cdn.discourse.org/dev/uploads/default/original/2X/e/edb63d57a720838a7ce6a68f02ba4618787f2299.png\",\n @discobot,\n override_gravatar: true )\n end\n @discobot\nend", "title": "" }, { "docid": "3243edaa4252256383633967e55a203e", "score": "0.5034868", "text": "def peer\n \n if self.peer_id > 0\n User.find(self.peer_id)\n else\n User.new(:first_name => 'Not', :last_name => 'Assigned')\n end\n \n end", "title": "" }, { "docid": "34b11624db156ab3a6dc9ddb33ee9d12", "score": "0.502778", "text": "def get_plant_by_name(current_user, common_name)\n #helper method\n\n desired_plant = Plant.find_by(common_name: common_name, member_id: current_user.id)\n desired_plant\n\n #saves the selected plant and current user to a variable to be passed into water_plants , and then into plant_to_water\n end", "title": "" }, { "docid": "1c64697f843b82e3351de9736b9f6a1d", "score": "0.5027223", "text": "def pick_user\n puts \"Let's find your records, or make a new username for you.\"\n puts \"If you need to remove a user, enter pi to 5 decimal places\"\n puts \"What's your name?\"\n input = Helper.query_user\n if input == \"3.14159\"\n delete_user\n else\n # binding.pry\n # if User.find_by(name: input) == true\n # puts \"Welcome back, #{input}!\"\n # end\n @user = User.find_or_create_by(name: input)\n end\n choose_next_steps\n end", "title": "" }, { "docid": "5e16265acbaeeae009198566a399bf9f", "score": "0.501678", "text": "def contact_devil(teams)\n\tteams.each do |team|\n\t\tid = Client.users_info(user: '@' + team)[:user][:id]\n\t\tputs 'login is ' + team + ', id is ' + id\n\t\tClient.chat_postMessage(channel: id, text: 'You have been selected to play the Devil\\'s Advocate role at Rabbit Cloud\\'s weekly meeting. You will be one of 3 people tasked with this role and your job is to ensure each team is challenged with atleast 1 question during their presentation. Please let me know if you cannot make this meeting or perform this role. Thanks', as_user: true)\n\tend\nend", "title": "" }, { "docid": "84ec302b0c2bbf35379f0995613f6a59", "score": "0.50107455", "text": "def find_and_suggest(user_id)\n user = find(user_id)\n random_movie_id = MOVIES.map { |m| m[:id] }[rand(0...MOVIES.length)]\n user.merge!(suggested: random_movie_id)\n end", "title": "" }, { "docid": "292433dd55a3fe40a9fdbcae941b132f", "score": "0.50060165", "text": "def contributor\n Team.find_by(id: self.reviewee_id)\n end", "title": "" }, { "docid": "292433dd55a3fe40a9fdbcae941b132f", "score": "0.50060165", "text": "def contributor\n Team.find_by(id: self.reviewee_id)\n end", "title": "" }, { "docid": "8c6d98d737309c194f1176a5436769ff", "score": "0.50047415", "text": "def display_name_for(other_user = nil)\n if has_user? other_user\n \"#{name} (Your team)\"\n else\n name\n end\n end", "title": "" }, { "docid": "898f0839070e0f307cc656d9dcfc2dbe", "score": "0.5001824", "text": "def doer\n u = User.find_by(id: user_id.to_i)\n if u\n u.login\n else\n '?'\n end\n end", "title": "" }, { "docid": "fc5a2b987acd8563ceacacdf8029352f", "score": "0.49994543", "text": "def pick_name\n @user = User.find(params[:id])\n @user.assigned=\"steph\" if (@user.username) == \"gavin\"\n @user.assigned=\"jon\" if (@user.username) == \"steve\"\n @user.assigned=\"andrew\" if (@user.username) == \"kristin\"\n @user.assigned=\"josie\" if (@user.username) == \"lila\"\n @user.assigned=\"keith\" if (@user.username) == \"bryan\"\n @user.assigned=\"kristin\" if (@user.username) == \"kris\"\n @user.assigned=\"jack\" if (@user.username) == \"andrew\"\n @user.assigned=\"gavin\" if (@user.username) == \"billy\"\n @user.assigned=\"lila\" if (@user.username) == \"jon\"\n @user.assigned=\"kris\" if (@user.username) == \"keith\"\n @user.assigned=\"steve\" if (@user.username) == \"della\"\n @user.assigned=\"billy\" if (@user.username) == \"josie\"\n @user.assigned=\"bryan\" if (@user.username) == \"jack\"\n @user.assigned=\"della\" if (@user.username) == \"steph\"\n @user.save!\n redirect_to :action => 'list'\n end", "title": "" }, { "docid": "4c3105180d488165db9c698bb6a85768", "score": "0.4990066", "text": "def find_user(walkin)\n user = User.where(phone: walkin.phone)\n if user.count == 1\n walkin.user_id = user.pluck(:id)[0]\n walkin.name = user.pluck(:name)[0]\n walkin.email = user.pluck(:email)[0]\n walkin.save!\n else\n walkin.name = 'Customer'\n end\n end", "title": "" }, { "docid": "7ece70d808005937ee1c4123150e08f6", "score": "0.49810132", "text": "def team_for_user\n assigned_teams = @kase.assignments.where(role: @assignment_role).map(&:team)\n raise UserNotFoundError, self if assigned_teams.empty?\n\n user_teams = @user.team_roles.where(role: @team_role).map(&:team)\n (assigned_teams & user_teams).first\n end", "title": "" }, { "docid": "ef7a390b76988b1a6b1482ba2e34a19c", "score": "0.49721003", "text": "def create_random_user()\n\tfirst_names = [\"Aadit\",\"Aahron\",\"Aaran\",\"Aaren\",\"Aarez\",\"Aarman\",\"Aaron\",\"Aaron-James\",\"Aarron\",\"Aaryan\",\"Aaryn\",\"Aayan\",\"Aazaan\",\"Abaan\",\"Abbas\",\"Abdallah\",\"Abdalroof\",\"Abdihakim\",\n\t\t\"Abdirahman\",\"Abdisalam\",\"Abdul\",\"Abdul-Aziz\",\"Abdulbasir\",\"Abdulkadir\",\"Abdulkarem\",\"Abdulkhader\",\"Abdullah\",\"Abdul-Majeed\",\"Abdulmalik\",\"Abdul-Rehman\",\"Abdur\",\"Abdurraheem\",\n\t\t\"Babur\",\"Bader\",\"Badr\",\"Badsha\",\"Bailee\",\"Bailey\",\"Bailie\",\"Bailley\",\"Baillie\",\"Baley\",\"Balian\",\"Banan\",\"Barath\",\"Barkley\",\"Barney\",\"Baron\",\"Barrie\",\"Barry\",\"Bartlomiej\",\"Bartosz\",\n\t\t\"Basher\",\"Basile\",\"Baxter\",\"Baye\",\"Bayley\",\"Beau\",\"Beinn\",\"Bekim\",\"Believe\",\"Ben\",\"Bendeguz\",\"Benedict\",\"Benjamin\",\"Benjamyn\",\"Benji\",\"Benn\",\"Bennett\",\"Benny\",\"Benoit\",\"Bentley\",\"Berkay\",\n\t\t\"Caelen\",\"Caethan\",\"Cahl\",\"Cahlum\",\"Cai\",\"Caidan\",\"Caiden\",\"Caiden-Paul\",\"Caidyn\",\"Caie\",\"Cailaen\",\"Cailean\",\"Caileb-John\",\"Cailin\",\"Cain\",\"Caine\",\"Cairn\",\"Cal\",\"Calan\",\"Calder\",\"Cale\",\n\t\t\"Cayden-Robert\",\"Cayden-Tiamo\",\"Ceejay\",\"Ceilan\",\"Ceiran\",\"Ceirin\",\"Ceiron\",\"Cejay\",\"Celik\",\"Cephas\",\"Cesar\",\"Cesare\",\"Chad\",\"Chaitanya\",\"Chang-Ha\",\"Charles\",\"Charley\",\"Charlie\",\"Charly\",\n\t\t\"Daegan\",\"Daegyu\",\"Dafydd\",\"Dagon\",\"Dailey\",\"Daimhin\",\"Daithi\",\"Dakota\",\"Daksh\",\"Dale\",\"Dalong\",\"Dalton\",\"Damian\",\"Damien\",\"Damon\",\"Dan\",\"Danar\",\"Dane\",\"Danial\",\"Daniel\",\"Daniele\",\n\t\t\"Diarmaid\",\"Diarmid\",\"Diarmuid\",\"Didier\",\"Diego\",\"Diesel\",\"Diesil\",\"Digby\",\"Dilan\",\"Dilano\",\"Dillan\",\"Dillon\",\"Dilraj\",\"Dimitri\",\"Dinaras\",\"Dion\",\"Dissanayake\",\"Dmitri\",\"Doire\",\"Dolan\",\n\t\t\"Eddie\",\"Eden\",\"Ediomi\",\"Edison\",\"Eduardo\",\"Eduards\",\"Edward\",\"Edwin\",\"Edwyn\",\"Eesa\",\"Efan\",\"Efe\",\"Ege\",\"Ehsan\",\"Ehsen\",\"Eiddon\",\"Eidhan\",\"Eihli\",\"Eimantas\",\"Eisa\",\"Eli\",\"Elias\",\"Elijah\",\n\t\t\"Ethan\",\"Etienne\",\"Etinosa\",\"Euan\",\"Eugene\",\"Evan\",\"Evann\",\"Ewan\",\"Ewen\",\"Ewing\",\"Exodi\",\"Ezekiel\",\"Ezra\",\"Fabian\",\"Fahad\",\"Faheem\",\"Faisal\",\"Faizaan\",\"Famara\",\"Fares\",\"Farhaan\",\"Farhan\",\n\t\t\"Farren\",\"Farzad\",\"Fauzaan\",\"Favour\",\"Fawaz\",\"Fawkes\",\"Faysal\",\"Fearghus\",\"Feden\",\"Felix\",\"Fergal\",\"Fergie\",\"Fergus\",\"Ferre\",\"Fezaan\",\"Fiachra\",\"Fikret\",\"Filip\",\"Filippo\",\"Finan\",\"Findlay\",\n\t\t\"Forbes\",\"Forgan\",\"Forrest\",\"Fox\",\"Francesco\",\"Francis\",\"Francisco\",\"Franciszek\",\"Franco\",\"Frank\",\"Frankie\",\"Franklin\",\"Franko\",\"Fraser\",\"Frazer\",\"Fred\",\"Freddie\",\"Frederick\",\"Fruin\",\"Fyfe\",\n\t\t\"Gerard\",\"Ghyll\",\"Giacomo\",\"Gian\",\"Giancarlo\",\"Gianluca\",\"Gianmarco\",\"Gideon\",\"Gil\",\"Gio\",\"Girijan\",\"Girius\",\"Gjan\",\"Glascott\",\"Glen\",\"Glenn\",\"Gordon\",\"Grady\",\"Graeme\",\"Graham\",\"Grahame\",\n\t\t\"Grant\",\"Grayson\",\"Greg\",\"Gregor\",\"Gregory\",\"Greig\",\"Griffin\",\"Griffyn\",\"Grzegorz\",\"Guang\",\"Guerin\",\"Guillaume\",\"Gurardass\",\"Gurdeep\",\"Gursees\",\"Gurthar\",\"Gurveer\",\"Gurwinder\",\"Gus\",\"Gustav\",\n\t\t\"Harjeevan\",\"Harjyot\",\"Harlee\",\"Harleigh\",\"Harley\",\"Harman\",\"Harnek\",\"Harold\",\"Haroon\",\"Harper\",\"Harri\",\"Harrington\",\"Harris\",\"Harrison\",\"Harry\",\"Harvey\",\"Harvie\",\"Harvinder\",\"Hasan\",\"Haseeb\",\n\t\t\"Hishaam\",\"Hogan\",\"Honey\",\"Hong\",\"Hope\",\"Hopkin\",\"Hosea\",\"Howard\",\"Howie\",\"Hristomir\",\"Hubert\",\"Hugh\",\"Hugo\",\"Humza\",\"Hunter\",\"Husnain\",\"Hussain\",\"Hussan\",\"Hussnain\",\"Hussnan\",\"Hyden\",\"I\",\"Iagan\",\n\t\t\"Iain\",\"Ian\",\"Ibraheem\",\"Ibrahim\",\"Idahosa\",\"Idrees\",\"Idris\",\"Iestyn\",\"Ieuan\",\"Igor\",\"Ihtisham\",\"Ijay\",\"Ikechukwu\",\"Ikemsinachukwu\",\"Ilyaas\",\"Ilyas\",\"Iman\",\"Immanuel\",\"Inan\",\"Indy\",\"Ines\",\"Innes\",\n\t\t\"Ioannis\",\"Ireayomide\",\"Ireoluwa\",\"Irvin\",\"Irvine\",\"Isa\",\"Isaa\",\"Isaac\",\"Isaiah\",\"Isak\",\"Isher\",\"Ishwar\",\"Isimeli\",\"Isira\",\"Ismaeel\",\"Ismail\",\"Israel\",\"Issiaka\",\"Ivan\",\"Ivar\",\"Izaak\",\"J\",\"Jaay\",\n\t\t\"Jac\",\"Jace\",\"Jack\",\"Jacki\",\"Jackie\",\"Jack-James\",\"Jackson\",\"Jacky\",\"Jacob\",\"Jacques\",\"Jad\",\"Jaden\",\"Jadon\",\"Jadyn\",\"Jae\",\"Jagat\",\"Jago\",\"Jaheim\",\"Jahid\",\"Jahy\",\"Jai\",\"Jaida\",\"Jaiden\",\"Jaidyn\",\n\t\t\"Jaydyn\",\"Jayhan\",\"Jay-Jay\",\"Jayke\",\"Jaymie\",\"Jayse\",\"Jayson\",\"Jaz\",\"Jazeb\",\"Jazib\",\"Jazz\",\"Jean\",\"Jean-Lewis\",\"Jean-Pierre\",\"Jebadiah\",\"Jed\",\"Jedd\",\"Jedidiah\",\"Jeemie\",\"Jeevan\",\"Jeffrey\",\"Jensen\",\n\t\t\"Kabir\",\"Kacey\",\"Kacper\",\"Kade\",\"Kaden\",\"Kadin\",\"Kadyn\",\"Kaeden\",\"Kael\",\"Kaelan\",\"Kaelin\",\"Kaelum\",\"Kai\",\"Kaid\",\"Kaidan\",\"Kaiden\",\"Kaidinn\",\"Kaidyn\",\"Kaileb\",\"Kailin\",\"Kain\",\"Kaine\",\"Kainin\",\n\t\t\"Kieron\",\"Kieryn\",\"Kile\",\"Killian\",\"Kimi\",\"Kingston\",\"Kinneil\",\"Kinnon\",\"Kinsey\",\"Kiran\",\"Kirk\",\"Kirwin\",\"Kit\",\"Kiya\",\"Kiyonari\",\"Kjae\",\"Klein\",\"Klevis\",\"Kobe\",\"Kobi\",\"Koby\",\"Koddi\",\"Koden\",\"Kodi\",\n\t\t\"Landon\",\"Lang\",\"Lasse\",\"Latif\",\"Lauchlan\",\"Lauchlin\",\"Laughlan\",\"Lauren\",\"Laurence\",\"Laurie\",\"Lawlyn\",\"Lawrence\",\"Lawrie\",\"Lawson\",\"Layne\",\"Layton\",\"Lee\",\"Leigh\",\"Leigham\",\"Leighton\",\"Leilan\",\n\t\t\"Luke\",\"Lukmaan\",\"Luqman\",\"Lyall\",\"Lyle\",\"Lyndsay\",\"Lysander\",\"Maanav\",\"Maaz\",\"Mac\",\"Macallum\",\"Macaulay\",\"Macauley\",\"Macaully\",\"Machlan\",\"Maciej\",\"Mack\",\"Mackenzie\",\"Mackenzy\",\"Mackie\",\"Macsen\",\n\t\t\"Marc-Anthony\",\"Marcel\",\"Marcello\",\"Marcin\",\"Marco\",\"Marcos\",\"Marcous\",\"Marcquis\",\"Marcus\",\"Mario\",\"Marios\",\"Marius\",\"Mark\",\"Marko\",\"Markus\",\"Marley\",\"Marlin\",\"Marlon\",\"Maros\",\"Marshall\",\"Martin\",\n\t\t\"Matthew\",\"Matthew-William\",\"Matthias\",\"Max\",\"Maxim\",\"Maximilian\",\"Maximillian\",\"Maximus\",\"Maxwell\",\"Maxx\",\"Mayeul\",\"Mayson\",\"Mazin\",\"Mcbride\",\"McCaulley\",\"McKade\",\"McKauley\",\"McKay\",\"McKenzie\",\n\t\t\"Moyes\",\"Msughter\",\"Mueez\",\"Muhamadjavad\",\"Muhammad\",\"Muhammed\",\"Muhsin\",\"Muir\",\"Munachi\",\"Muneeb\",\"Mungo\",\"Munir\",\"Munmair\",\"Munro\",\"Murdo\",\"Murray\",\"Murrough\",\"Murry\",\"Musa\",\"Musse\",\"Mustafa\",\n\t\t\"Nathaniel\",\"Nathan-Rae\",\"Nawfal\",\"Nayan\",\"Neco\",\"Neil\",\"Nelson\",\"Neo\",\"Neshawn\",\"Nevan\",\"Nevin\",\"Ngonidzashe\",\"Nial\",\"Niall\",\"Nicholas\",\"Nick\",\"Nickhill\",\"Nicki\",\"Nickson\",\"Nicky\",\"Nico\",\"Nicodemus\",\n\t\t\"Nicol\",\"Nicolae\",\"Nicolas\",\"Nidhish\",\"Nihaal\",\"Nihal\",\"Nikash\",\"Nikhil\",\"Niki\",\"Nikita\",\"Nikodem\",\"Nikolai\",\"Nikos\",\"Nilav\",\"Niraj\",\"Niro\",\"Niven\",\"Noah\",\"Noel\",\"Nolan\",\"Noor\",\"Norman\",\"Norrie\",\"Nuada\",\n\t\t\"Olivier\",\"Oliwier\",\"Ollie\",\"Olurotimi\",\"Oluwadamilare\",\"Oluwadamiloju\",\"Oluwafemi\",\"Oluwafikunayomi\",\"Oluwalayomi\",\"Oluwatobiloba\",\"Oluwatoni\",\"Omar\",\"Omri\",\"Oran\",\"Orin\",\"Orlando\",\"Orley\",\"Orran\",\"Orrick\",\n\t\t\"Orrin\",\"Orson\",\"Oryn\",\"Oscar\",\"Osesenagha\",\"Oskar\",\"Ossian\",\"Oswald\",\"Otto\",\"Owain\",\"Owais\",\"Owen\",\"Owyn\",\"Oz\",\"Ozzy\",\"Pablo\",\"Pacey\",\"Padraig\",\"Paolo\",\"Pardeepraj\",\"Parkash\",\"Parker\",\"Pascoe\",\"Pasquale\",\n\t\t\"Patrick\",\"Patrick-John\",\"Patrikas\",\"Patryk\",\"Paul\",\"Pavit\",\"Pawel\",\"Pawlo\",\"Pearce\",\"Pearse\",\"Pearsen\",\"Pedram\",\"Pedro\",\"Peirce\",\"Peiyan\",\"Pele\",\"Peni\",\"Peregrine\",\"Peter\",\"Phani\",\"Philip\",\"Philippos\",\n\t\t\"Phinehas\",\"Phoenix\",\"Phoevos\",\"Pierce\",\"Pierre-Antoine\",\"Pieter\",\"Pietro\",\"Piotr\",\"Porter\",\"Prabhjoit\",\"Prabodhan\",\"Praise\",\"Pranav\",\"Pravin\",\"Precious\",\"Prentice\",\"Presley\",\"Preston\",\"Preston-Jay\",\n\t\t\"Raithin\",\"Raja\",\"Rajab-Ali\",\"Rajan\",\"Ralfs\",\"Ralph\",\"Ramanas\",\"Ramit\",\"Ramone\",\"Ramsay\",\"Ramsey\",\"Rana\",\"Ranolph\",\"Raphael\",\"Rasmus\",\"Rasul\",\"Raul\",\"Raunaq\",\"Ravin\",\"Ray\",\"Rayaan\",\"Rayan\",\"Rayane\",\n\t\t\"Reily\",\"Reis\",\"Reiss\",\"Remigiusz\",\"Remo\",\"Remy\",\"Ren\",\"Renars\",\"Reng\",\"Rennie\",\"Reno\",\"Reo\",\"Reuben\",\"Rexford\",\"Reynold\",\"Rhein\",\"Rheo\",\"Rhett\",\"Rheyden\",\"Rhian\",\"Rhoan\",\"Rholmark\",\"Rhoridh\",\"Rhuairidh\",\n\t\t\"Seaan\",\"Seamas\",\"Seamus\",\"Sean\",\"Seane\",\"Sean-James\",\"Sean-Paul\",\"Sean-Ray\",\"Seb\",\"Sebastian\",\"Sebastien\",\"Selasi\",\"Seonaidh\",\"Sephiroth\",\"Sergei\",\"Sergio\",\"Seth\",\"Sethu\",\"Seumas\",\"Shaarvin\",\"Shadow\",\"Shae\",\n\t\t\"Sheafan\",\"Sheigh\",\"Shenuk\",\"Sher\",\"Shergo\",\"Sheriff\",\"Sherwyn\",\"Shiloh\",\"Shiraz\",\"Shreeram\",\"Shreyas\",\"Shyam\",\"Siddhant\",\"Siddharth\",\"Sidharth\",\"Sidney\",\"Siergiej\",\"Silas\",\"Simon\",\"Sinai\",\"Skye\",\"Sofian\",\n\t\t\"Tanzeel\",\"Taonga\",\"Tarik\",\"Tariq-Jay\",\"Tate\",\"Taylan\",\"Taylar\",\"Tayler\",\"Taylor\",\"Taylor-Jay\",\"Taylor-Lee\",\"Tayo\",\"Tayyab\",\"Tayye\",\"Tayyib\",\"Teagan\",\"Tee\",\"Teejay\",\"Tee-jay\",\"Tegan\",\"Teighen\",\"Teiyib\",\n\t\t\"Ty-Alexander\",\"Tye\",\"Tyelor\",\"Tylar\",\"Tyler\",\"Tyler-James\",\"Tyler-Jay\",\"Tyllor\",\"Tylor\",\"Tymom\",\"Tymon\",\"Tymoteusz\",\"Tyra\",\"Tyree\",\"Tyrnan\",\"Tyrone\",\"Tyson\",\"Ubaid\",\"Ubayd\",\"Uchenna\",\"Uilleam\",\"Umair\",\n\t\t\"Umar\",\"Umer\",\"Umut\",\"Urban\",\"Uri\",\"Usman\",\"Uzair\",\"Uzayr\",\"Valen\",\"Valentin\",\"Valentino\",\"Valery\",\"Valo\",\"Vasyl\",\"Vedantsinh\",\"Veeran\",\"Victor\",\"Victory\",\"Vinay\",\"Vince\",\"Vincent\",\"Vincenzo\",\"Vinh\",\"Vinnie\",\n\t\t\"Vithujan\",\"Vladimir\",\"Vladislav\",\"Vrishin\",\"Vuyolwethu\",\"Wabuya\",\"Wai\",\"Walid\",\"Wallace\",\"Walter\",\"Waqaas\",\"Warkhas\",\"Warren\",\"Warrick\",\"Wasif\",\"Wayde\",\"Wayne\",\"Wei\",\"Wen\",\"Wesley\",\"Wesley-Scott\",\"Wiktor\",\n\t\t\"Wilkie\",\"Will\",\"William\",\"William-John\",\"Willum\",\"Wilson\",\"Windsor\",\"Wojciech\",\"Woyenbrakemi\",\"Wyatt\",\"Wylie\",\"Wynn\",\"Xabier\",\"Xander\",\"Xavier\",\"Xiao\",\"Xida\",\"Xin\",\"Xue\",\"Yadgor\",\"Yago\",\"Yahya\",\"Yakup\",\n\t\t\"Yang\",\"Yanick\",\"Yann\",\"Yannick\",\"Yaseen\",\"Yasin\",\"Yasir\",\"Yassin\",\"Yoji\",\"Yong\",\"Yoolgeun\",\"Yorgos\",\"Youcef\",\"Yousif\",\"Youssef\",\"Yu\",\"Yuanyu\",\"Yuri\",\"Yusef\",\"Yusuf\",\"Yves\",\"Zaaine\",\"Zaak\",\"Zac\",\"Zach\",\n\t\t\"Zachariah\",\"Zacharias\",\"Zacharie\",\"Zacharius\",\"Zachariya\",\"Zachary\",\"Zachary-Marc\",\"Zachery\",\"Zack\",\"Zackary\",\"Zaid\",\"Zain\",\"Zaine\",\"Zaineddine\",\"Zainedin\",\"Zak\",\"Zakaria\",\"Zakariya\",\"Zakary\",\"Zaki\",\"Zakir\",\n\t\t\"Zinedine\",\"Zion\",\"Zishan\",\"Ziya\",\"Ziyaan\",\"Zohaib\",\"Zohair\",\"Zoubaeir\",\"Zubair\",\"Zubayr\",\"Zuriel\",\"Aaima\",\"Aaiva\",\"Aakriti\",\"Aaliyah\",\"Aamanee\",\"Aamina\",\"Aaminah\",\"Aamirah\",\"Aamna\",\"Aanya\",\"Aara\",\"Aaraa\",\n\t\t\"Aarifah\",\"Aarthi\",\"Aayat\",\"Aayma\",\"Abaigeal\",\"Abar\",\"Abbe\",\"Abbegail\",\"Abbey\",\"Abbeygail\",\"Abbeygale\",\"Abbi\",\"Abbie\",\"Abbiegail\",\"Abbie-Leigh\",\"Abbie-Rose\",\"Abbigail\",\"Abbigale\",\"Abbi-Lee\",\"Abby\",\n\t\t\"Avah\",\"Ava-Jae\",\"Ava-Mae\",\"Avanya\",\"Avesta\",\"Avril\",\"Avsta\",\"Avya\",\"Aya\",\"Ayaana\",\"Ayah\",\"Ayanna\",\"Ayat\",\"Ayda\",\"Ayeesha\",\"Ayeisha\",\"Ayesha\",\"Ayiah\",\"Ayla\",\"Aylea-Louise\",\"Ayleen\",\"Ayleigh\",\"Aylesha\",\"Aylie\",\n\t\t\"Babyjane\",\"Baighley\",\"Baileigh\",\"Balqees\",\"Barbara\",\"Bay\",\"Bayleigh\",\"Bayli\",\"Baylie\",\"Beatrice\",\"Beatriz\",\"Becca\",\"Becky\",\"Bekki\",\"Bella\",\"Belle\",\"Bena\",\"Bente\",\"Beraka\",\"Berlin\",\"Bernadette\",\"Betane\",\"Beth\",\n\t\t\"Breanna\",\"Bree\",\"Breeanna\",\"Brenae\",\"Brenna\",\"Brenna-Louise\",\"Briagha\",\"Briana\",\"Brianna\",\"Brieghanna\",\"Brier\",\"Brigitte\",\"Briony\",\"Bronagh\",\"Bronte\",\"Bronwen\",\"Bronwyn\",\"Brook\",\"Brookelyn\",\"Brooke-Marie\",\n\t\t\"Caceylee\",\"Cacie\",\"Cadance\",\"Cadee-Alyssa\",\"Cadence\",\"Cadey\",\"Cadey-Lee\",\"Cadey-Leigh\",\"Cadhla\",\"Cadie\",\"Cadi-Lee\",\"Cady\",\"Caela\",\"Caelainn\",\"Caelinn\",\"Caelyn\",\"Caera\",\"Caidie\",\"Caidy\",\"Caileen\",\"Cailie\",\"Cailyn\",\n\t\t\"Chizaram\",\"Chloe\",\"Chloe-Ann\",\"Chloe-Anne\",\"Chloe-Louise\",\"Choco\",\"Choire\",\"Chrislyn\",\"Chrissie\",\"Christabel\",\"Christianna\",\"Christin\",\"Christina\",\"Christine\",\"Chrystal\",\"Chymari\",\"Ciara\",\"Cilla\",\"Cindy\",\n\t\t\"Dacey-Raine\",\"Dacia\",\"Daigan\",\"Daisy\",\"Daisy-Mae\",\"Dakotah\",\"Dallace\",\"Damaris\",\"Damiana\",\"Damla\",\"Dana\",\"Daneesa\",\"Danelle\",\"Dani\",\"Dania\",\"Danica\",\"Daniela\",\"Daniella\",\"Danielle\",\"Danika\",\"Danikah\",\"Danna\",\n\t\t\"Demmi\",\"Denhi\",\"Deni\",\"Denise\",\"Dennie\",\"Deonaid\",\"Derri\",\"Derryne\",\"Destiny\",\"Devayani\",\"Dewi\",\"Dhara\",\"Dharci\",\"Dhrishti\",\"Diana\",\"Diane\",\"Diaz\",\"Diella\",\"Dilly\",\"Dilsa\",\"Dilya\",\"Dilys-Liliana\",\"Dineo\",\n\t\t\"Elice\",\"Elidh\",\"Elin\",\"Elis\",\"Elisa\",\"Elisabeth\",\"Elisabetta\",\"Elise\",\"Elish\",\"Elisha\",\"Elisia\",\"Eliska\",\"Elissa\",\"Elita\",\"Elivia\",\"Eliyah\",\"Eliza\",\"Elizabeth\",\"Elizaveta\",\"Elize\",\"Ella\",\"Ella-Angela\",\n\t\t\"Emer\",\"Emi\",\"Emilia\",\"Emilie\",\"Emilie-Jane\",\"Emilija\",\"Emillie\",\"Emilly\",\"Emily\",\"Emilyann\",\"Emilyjo\",\"Emilylee\",\"Emily-Louise\",\"Emma\",\"Emma-Clare\",\"Emmajane\",\"Emma-Jayne\",\"Emma-Louise\",\"Emma-Marie\",\"Emme\",\n\t\t\"Farah\",\"Faria\",\"Farisya\",\"Farrah\",\"Faryn\",\"Fasai\",\"Fatama\",\"Fathema\",\"Fathima\",\"Fathma\",\"Fatiha\",\"Fatima\",\"Fatimah\",\"Fatou\",\"Fauve\",\"Fay\",\"Faye\",\"Fearn\",\"Fearne\",\"Fedora\",\"Felicia\",\"Felicity\",\"Fendi\",\n\t\t\"Fenella\",\"Fenn\",\"Fern\",\"Ferne\",\"Ffion\",\"Fia\",\"Fion\",\"Fiona\",\"Fionnah\",\"Fiza\",\"Fizzah\",\"Fleur\",\"Flora\",\"Florence\",\"Foosiya\",\"Frances\",\"Francesca\",\"Francisca\",\"Fraya\",\"Freia\",\"Freja\",\"Freya\",\"Freya-Jessica\",\n\t\t\"Geraldine\",\"Ghalya\",\"Giada\",\"Giane\",\"Gigha\",\"Gillian\",\"Gioia\",\"Giselle\",\"Giuliana\",\"Giyia\",\"Glydel\",\"Gomana\",\"Grace\",\"Gracealexandra\",\"Gracie\",\"Gracie-Lee\",\"Gracielynn\",\"Gracie-Sue\",\"Graidi\",\"Grainne\",\n\t\t\"Hailie\",\"Haillie\",\"Hajirah\",\"Hajjrah\",\"Hajra\",\"Hajrah\",\"Hala\",\"Haleema\",\"Haley\",\"Halina\",\"Halle\",\"Halley\",\"Hallie\",\"Halyda\",\"Hamani\",\"Hamna\",\"Hana\",\"Hanania\",\"Haneeah\",\"Haneen\",\"Hania\",\"Hanim\",\"Haniya\",\n\t\t\"Haniyah\",\"Hanna\",\"Hannah\",\"Hannah-Louise\",\"Hanya\",\"Happy\",\"Hariot\",\"Harleen\",\"Harlie\",\"Harneet\",\"Harnisha\",\"Harriet\",\"Harriette\",\"Hasini\",\"Hattie\",\"Havin\",\"Hawaa\",\"Hayla\",\"Hayleigh\",\"Hayley\",\"Hayley-Jane\",\n\t\t\"Ilona\",\"Ilsa\",\"Ilysa\",\"Imaan\",\"Imama\",\"Imani\",\"Imman\",\"Imogem\",\"Imogen\",\"Ina\",\"Inaara\",\"Inaaya\",\"Inara\",\"Inayah\",\"Indi\",\"India\",\"India-Leoni\",\"Indiana\",\"Indie\",\"Inemesit\",\"Inez\",\"Inga\",\"Ingrid\",\"Inika\",\n\t\t\"Iniobong\",\"Inka\",\"Innis\",\"Insiya\",\"Ioanna\",\"Iola\",\"Iona\",\"Iqra\",\"Irem\",\"Irene\",\"Irfa\",\"Iria\",\"Iris\",\"Irmak\",\"Irza\",\"Isabel\",\"Isabela\",\"Isabell\",\"Isabella\",\"Isabelle\",\"Isadora\",\"Iseabel\",\"Isha\",\"Ishaal\",\n\t\t\"Jaya\",\"Jayda\",\"Jayde\",\"Jayden-Maree\",\"Jaye\",\"Jaying\",\"Jayla\",\"Jaymai-Leigh\",\"Jayme\",\"Jaymee-Lyn\",\"Jaymi\",\"Jaymie-Leigh\",\"Jazmin\",\"Jazmine\",\"Jeanie\",\"Jeanie-May\",\"Jeanna\",\"Jeannie\",\"Jem\",\"Jema\",\"Jemima\",\n\t\t\"Jodi\",\"Jodie\",\"Jodi-Marie\",\"Joelle\",\"Joely\",\"Johanna\",\"Jolie\",\"Jomana\",\"Jools\",\"Jordanna\",\"Jordanne\",\"Jordin\",\"Jorgie\",\"Jorja\",\"Jorji\",\"Jorjia\",\"Josephina\",\"Josephine\",\"Josi\",\"Josie\",\"Joude\",\"Joy\",\"Joyce\",\n\t\t\"Karhys\",\"Kari\",\"Karice\",\"Karima\",\"Karina\",\"Karine\",\"Karis\",\"Karishma\",\"Kariss\",\"Karissa\",\"Karla\",\"Karleigh\",\"Karley\",\"Karli\",\"Karlie\",\"Karly\",\"Karmen\",\"Karmyn\",\"Karn\",\"Karolina\",\"Karrah\",\"Karris\",\"Karyn\",\n\t\t\"Kelsie\",\"Kelsiee\",\"Kelsie-Leigh\",\"Kelsie-Louise\",\"Kemi\",\"Kenadie\",\"Kendal\",\"Kendra\",\"Kendyl\",\"Kendyll\",\"Kenna\",\"Kennedi\",\"Kennedy\",\"Kenza\",\"Kenzie-lee\",\"Kenzie-Leigh\",\"Kenzii\",\"Kenzi-Lea\",\"Keonah-Jade\",\n\t\t\"Lene\",\"Leni\",\"Lennix\",\"Lenzy\",\"Leona\",\"Leonah\",\"Leone\",\"Leoni\",\"Leonie\",\"Letitia\",\"Letizia\",\"Lettice\",\"Lexi\",\"Lexie\",\"Lexine\",\"Lexis\",\"Lexy\",\"Leya\",\"Leyia\",\"Leyla\",\"Leyna\",\"Leyre\",\"Lia\",\"Liala\",\"Liana\",\n\t\t\"Logyn\",\"Logyne\",\"Lois\",\"Lok-Sum\",\"Lola\",\"Lorelei\",\"Loren\",\"Lorena\",\"Lori\",\"Lori-ann\",\"Lorin\",\"Lorna\",\"Lorraine\",\"Lotta\",\"Lotte\",\"Lotti\",\"Lottie\",\"Lotus\",\"Louanne\",\"Louella\",\"Louisa\",\"Louise\",\"Loulou\",\n\t\t\"Machaela\",\"Maci\",\"Macie\",\"Macie-Rose\",\"Maci-Jo\",\"Mackalya\",\"Mackena\",\"Macy-Ellie\",\"Maddi\",\"Maddie\",\"Maddison-Leigh\",\"Madeeha\",\"Madelaine\",\"Madeleine\",\"Madeline\",\"Madelyn\",\"Madiha\",\"Madilyn\",\"Madinah\",\n\t\t\"Michaella\",\"Michela\",\"Michelle\",\"Mikaela\",\"Mikayla\",\"Mikella\",\"Mikka\",\"Miku\",\"Mila\",\"Milana\",\"Milandra\",\"Milena\",\"Miley\",\"Mili\",\"Milie\",\"Milla\",\"Millan\",\"Milley\",\"Milli\",\"Millicent\",\"Millie\",\"Millie-May\",\n\t\t\"Naideen\",\"Naila\",\"Naima\",\"Naimh\",\"Naina\",\"Nairne\",\"Naisha\",\"Nakeisha\",\"Nala\",\"Nana\",\"Nancy\",\"Naoise\",\"Naomi\",\"Naomie\",\"Narissa\",\"Nasifa\",\"Natalia\",\"Natalie\",\"Natane\",\"Natania\",\"Natascha\",\"Natasha\",\"Nathalie\",\n\t\t\"Nevaeh\",\"Neve\",\"Ngaire\",\"Nia\",\"Niah\",\"Nialla\",\"Niamh\",\"Nichole\",\"Nicola\",\"Nicole\",\"Nicolina\",\"Nicoll\",\"Nidba\",\"Nidhi\",\"Nieve\",\"Nigar\",\"Niharika\",\"Nika\",\"Nikela\",\"Nikitta\",\"Nikiya\",\"Nikki\",\"Nikol\",\"Nikola\",\n\t\t\"Olufunke\",\"Olutobilola\",\"Oluwabukunmi\",\"Oluwademilade\",\"Oluwaferanmi\",\"Oluwanifemi\",\"Oluwatamilore\",\"Oluwateniolami\",\"Oluwatimilehin\",\"Oluwatosin\",\"Olympia\",\"Omolola\",\"Oona\",\"Oonagh\",\"Ophelia\",\"Oriana\",\n\t\t\"Oriane\",\"Orla\",\"Orlagh\",\"Orlah\",\"Orlaidh\",\"Orlaigh\",\"Orlaith\",\"Orlaithe\",\"Orlanna\",\"Oshun\",\"Otilia\",\"Otilija\",\"Pagan\",\"Page\",\"Paidamoyo\",\"Paige\",\"Paisley\",\"Paislie\",\"Palmer\",\"Pamela\",\"Pamindar\",\"Pari\",\n\t\t\"Paris\",\"Parisa\",\"Parmin\",\"Parwana\",\"Parya\",\"Patience\",\"Patricia\",\"Patrycja\",\"Patsy\",\"Paula\",\"Paulina\",\"Pauline\",\"Payton\",\"Peaches\",\"Pearl\",\"Peebles\",\"Peggy\",\"Peige\",\"Penelope\",\"Penny\",\"Perrie\",\"Petra\",\n\t\t\"Peyton\",\"Phebe\",\"Philippa\",\"Phillipa\",\"Phoebe\",\"Pia\",\"Pipa\",\"Piper\",\"Pippa\",\"Plamedie\",\"Pola\",\"Polly\",\"Poppie\",\"Poppy\",\"Porsha\",\"Portia\",\"Possum\",\"Prabhasees\",\"Prabhjot\",\"Prasheeta\",\"Preet\",\"Primrose\",\n\t\t\"Rania\",\"Raniyah\",\"Ranya\",\"Raonaid\",\"Raphaela\",\"Rawia\",\"Raya\",\"Rayann\",\"Rayna\",\"Razan\",\"Rea\",\"Reaiah\",\"Rebbecah\",\"Rebbecca\",\"Rebeca\",\"Rebecca\",\"Rebecca-Lee\",\"Rebecka\",\"Rebeka\",\"Rebekah\",\"Rebekha\",\n\t\t\"Romina\",\"Romy\",\"Rona\",\"Roni\",\"Roos\",\"Rosa\",\"Rosalie\",\"Rosalin\",\"Rosalind\",\"Rosalyn\",\"Rosangel\",\"Rosanna\",\"Rose\",\"Rosea\",\"Roseanne-Charlotte\",\"Rosemary\",\"Rosheen\",\"Roshni\",\"Rosie\",\"Rosie-Willow\",\"Rosina\",\n\t\t\"Sabrine\",\"Sabriyah\",\"Sacha\",\"Sadhbh\",\"Sadie\",\"Sadie-Jane\",\"Sadiqa\",\"Sadiyah\",\"Safa\",\"Safara\",\"Safeena\",\"Saffa\",\"Saffron\",\"Safi\",\"Safia\",\"Safiya\",\"Safiyyah\",\"Sahana\",\"Sahar\",\"Sahara\",\"Saharra\",\"Sahra\",\"Sai\",\n\t\t\"Soukina\",\"Sree\",\"Stacey\",\"Stacy\",\"Starr\",\"Stefanie\",\"Stefany\",\"Steff\",\"Steffie\",\"Stella\",\"Stephanie\",\"Stephanie-Anne\",\"Stephany\",\"Stevey\",\"Stevie-Jay\",\"Stevie-Leigh\",\"Storm\",\"Suhaira\",\"Sukhman\",\"Sukhmani\",\n\t\t\"Takira\",\"Takua\",\"Tal\",\"Tala\",\"Talia\",\"Taliah\",\"Talise\",\"Taliya\",\"Talya\",\"Tamara\",\"Tamarah\",\"Tamika\",\"Tami-Marie\",\"Tamlah\",\"Tammara\",\"Tammi\",\"Tammie\",\"Tammi-Jo\",\"Tammy\",\"Tammy-Jo\",\"Tammylee\",\"Tamsin\",\n\t\t\"Tillie\",\"Tilly\",\"Tiona\",\"Tione\",\"Tira\",\"Tiya\",\"Tokunbo\",\"Toluwani\",\"Toluwanimi\",\"Toni\",\"Toni-Lee\",\"Tori\",\"Torri\",\"Torrie\",\"Torrie-Lee\",\"Tracey\",\"Tracy\",\"Trassa\",\"Triniti\",\"Trinity\",\"Tru\",\"Trudie\",\"Trudy\",\n\t\t\"Valerie\",\"Vanessa\",\"Vanni\",\"Vanya\",\"Vasemaca\",\"Vasiliki\",\"Veera\",\"Verity\",\"Veronica\",\"Veronika\",\"Vhairi\",\"Vicki\",\"Vicky\",\"Victoria\",\"Victoria-Leigh\",\"Viki\",\"Vikki\",\"Viktoria\",\"Violet\",\"Virginia\",\"Virginie\",\n\t\t\"Vivian\",\"VJay\",\"Wanessa\",\"Wang\",\"Wardah\",\"Wendy\",\"Weronika\",\"Wezi\",\"Wiktoria\",\"Wiktorja\",\"Wilhelmina\",\"Willa\",\"Willow\",\"Wing\",\"Wing-Yee\",\"Winnifred\",\"Witney\",\"Wren\",\"Wu\",\"Xaniamh\",\"Xanthe\",\"Xanthia\",\"Xiong\",\n\t\t\"Xsara-Louise\",\"Yana\",\"Yangxi\",\"Yaris\",\"Yasemin\",\"Yasmeen\",\"Yasmin\",\"Yasmine\",\"Yazmin\",\"Yelena\",\"Yingzi\",\"Yi-Qing\",\"Yishuka\",\"Yi-Xuan\",\"Yolanda\",\"Yolwandle\",\"Youer\",\"Yusra\",\"Yutong\",\"Yva\",\"Zaheerah\",\"Zahide\",\n\t\t\"Zahira\",\"Zahra\",\"Zahraa\",\"Zaina\",\"Zainab\",\"Zainib\",\"Zakiyya\",\"Zalfa\",\"Zanab\",\"Zara\",\"Zarah\",\"Zaya\",\"Zaynab\",\"Zaynah\",\"Zeenat\",\"Zehra\",\"Zeinab\",\"Zella\",\"Zena\",\"Zenab\",\"Zenah\",\"Zenub\",\"Zeynep\",\"Zian\",\"Zinto\",\n\t\t\"Zita\",\"Zoe\",\"Zoe-Jane\",\"Zoey\",\"Zofia\",\"Zoha\",\"Zohra\",\"Zosia\",\"Zoya\",\"Zuhrah\",\"Zulaikha\",\"Zunaira\",\"Zunairah\",\"Zunera\",\"Zuzanna\",\"Zuzia\",\"Zuzu\"]\n\n\tlast_names = ['Abbott', 'Acevedo', 'Acosta', 'Adams', 'Adkins', 'Aguilar', 'Aguirre', 'Albert', 'Alexander', 'Alford', 'Allen', 'Allison', 'Alston', 'Alvarado', 'Alvarez', 'Anderson', \n\t\t'Andrews', 'Anthony', 'Armstrong', 'Arnold', 'Ashley', 'Atkins', 'Atkinson', 'Austin', 'Avery', 'Avila', 'Ayala', 'Ayers', 'Bailey', 'Baird', 'Baker', 'Baldwin', 'Ball', 'Ballard', \n\t\t'Banks', 'Barber', 'Barker', 'Barlow', 'Barnes', 'Barnett', 'Barr', 'Barrera', 'Barrett', 'Barron', 'Barry', 'Bartlett', 'Barton', 'Bass', 'Bates', 'Battle', 'Bauer', 'Baxter', \n\t\t'Beach', 'Bean', 'Beard', 'Beasley', 'Beck', 'Becker', 'Bell', 'Bender', 'Benjamin', 'Bennett', 'Benson', 'Bentley', 'Benton', 'Berg', 'Berger', 'Bernard', 'Berry', 'Best', 'Bird', \n\t\t'Bishop', 'Black', 'Blackburn', 'Blackwell', 'Blair', 'Blake', 'Blanchard', 'Blankenship', 'Blevins', 'Bolton', 'Bond', 'Bonner', 'Booker', 'Boone', 'Booth', 'Bowen', 'Bowers', \n\t\t'Bowman', 'Boyd', 'Boyer', 'Boyle', 'Bradford', 'Bradley', 'Bradshaw', 'Brady', 'Branch', 'Bray', 'Brennan', 'Brewer', 'Bridges', 'Briggs', 'Bright', 'Britt', 'Brock', 'Brooks', \n\t\t'Brown', 'Browning', 'Bruce', 'Bryan', 'Bryant', 'Buchanan', 'Buck', 'Buckley', 'Buckner', 'Bullock', 'Burch', 'Burgess', 'Burke', 'Burks', 'Burnett', 'Burns', 'Burris', 'Burt', \n\t\t'Burton', 'Bush', 'Butler', 'Byers', 'Byrd', 'Cabrera', 'Cain', 'Calderon', 'Caldwell', 'Calhoun', 'Callahan', 'Camacho', 'Cameron', 'Campbell', 'Campos', 'Cannon', 'Cantrell', \n\t\t'Cantu', 'Cardenas', 'Carey', 'Carlson', 'Carney', 'Carpenter', 'Carr', 'Carrillo', 'Carroll', 'Carson', 'Carter', 'Carver', 'Case', 'Casey', 'Cash', 'Castaneda', 'Castillo', 'Castro', \n\t\t'Cervantes', 'Chambers', 'Chan', 'Chandler', 'Chaney', 'Chang', 'Chapman', 'Charles', 'Chase', 'Chavez', 'Chen', 'Cherry', 'Christensen', 'Christian', 'Church', 'Clark', 'Clarke', \n\t\t'Clay', 'Clayton', 'Clements', 'Clemons', 'Cleveland', 'Cline', 'Cobb', 'Cochran', 'Coffey', 'Cohen', 'Cole', 'Coleman', 'Collier', 'Collins', 'Colon', 'Combs', 'Compton', 'Conley', \n\t\t'Conner', 'Conrad', 'Contreras', 'Conway', 'Cook', 'Cooke', 'Cooley', 'Cooper', 'Copeland', 'Cortez', 'Cote', 'Cotton', 'Cox', 'Craft', 'Craig', 'Crane', 'Crawford', 'Crosby', 'Cross', \n\t\t'Cruz', 'Cummings', 'Cunningham', 'Curry', 'Curtis', 'Dale', 'Dalton', 'Daniel', 'Daniels', 'Daugherty', 'Davenport', 'David', 'Davidson', 'Davis', 'Dawson', 'Day', 'Dean', 'Decker', \n\t\t'Dejesus', 'Delacruz', 'Delaney', 'Deleon', 'Delgado', 'Dennis', 'Diaz', 'Dickerson', 'Dickson', 'Dillard', 'Dillon', 'Dixon', 'Dodson', 'Dominguez', 'Donaldson', 'Donovan', 'Dorsey', \n\t\t'Dotson', 'Douglas', 'Downs', 'Doyle', 'Drake', 'Dudley', 'Duffy', 'Duke', 'Duncan', 'Dunlap', 'Dunn', 'Duran', 'Durham', 'Dyer', 'Eaton', 'Edwards', 'Elliott', 'Ellis', 'Ellison', \n\t\t'Emerson', 'England', 'English', 'Erickson', 'Espinoza', 'Estes', 'Estrada', 'Evans', 'Everett', 'Ewing', 'Farley', 'Farmer', 'Farrell', 'Faulkner', 'Ferguson', 'Fernandez', 'Ferrell', \n\t\t'Fields', 'Figueroa', 'Finch', 'Finley', 'Fischer', 'Fisher', 'Fitzgerald', 'Fitzpatrick', 'Fleming', 'Fletcher', 'Flores', 'Flowers', 'Floyd', 'Flynn', 'Foley', 'Forbes', 'Ford', \n\t\t'Foreman', 'Foster', 'Fowler', 'Fox', 'Francis', 'Franco', 'Frank', 'Franklin', 'Franks', 'Frazier', 'Frederick', 'Freeman', 'French', 'Frost', 'Fry', 'Frye', 'Fuentes', 'Fuller', \n\t\t'Fulton', 'Gaines', 'Gallagher', 'Gallegos', 'Galloway', 'Gamble', 'Garcia', 'Gardner', 'Garner', 'Garrett', 'Garrison', 'Garza', 'Gates', 'Gay', 'Gentry', 'George', 'Gibbs', 'Gibson', \n\t\t'Gilbert', 'Giles', 'Gill', 'Gillespie', 'Gilliam', 'Gilmore', 'Glass', 'Glenn', 'Glover', 'Goff', 'Golden', 'Gomez', 'Gonzales', 'Gonzalez', 'Good', 'Goodman', 'Goodwin', 'Gordon', \n\t\t'Gould', 'Graham', 'Grant', 'Graves', 'Gray', 'Green', 'Greene', 'Greer', 'Gregory', 'Griffin', 'Griffith', 'Grimes', 'Gross', 'Guerra', 'Guerrero', 'Guthrie', 'Gutierrez', 'Guy', \n\t\t'Guzman', 'Hahn', 'Hale', 'Haley', 'Hall', 'Hamilton', 'Hammond', 'Hampton', 'Hancock', 'Haney', 'Hansen', 'Hanson', 'Hardin', 'Harding', 'Hardy', 'Harmon', 'Harper', 'Harrell', \n\t\t'Harrington', 'Harris', 'Harrison', 'Hart', 'Hartman', 'Harvey', 'Hatfield', 'Hawkins', 'Hayden', 'Hayes', 'Haynes', 'Hays', 'Head', 'Heath', 'Hebert', 'Henderson', 'Hendricks', \n\t\t'Hendrix', 'Henry', 'Hensley', 'Henson', 'Herman', 'Hernandez', 'Herrera', 'Herring', 'Hess', 'Hester', 'Hewitt', 'Hickman', 'Hicks', 'Higgins', 'Hill', 'Hines', 'Hinton', 'Hobbs', \n\t\t'Hodge', 'Hodges', 'Hoffman', 'Hogan', 'Holcomb', 'Holden', 'Holder', 'Holland', 'Holloway', 'Holman', 'Holmes', 'Holt', 'Hood', 'Hooper', 'Hoover', 'Hopkins', 'Hopper', 'Horn', \n\t\t'Horne', 'Horton', 'House', 'Houston', 'Howard', 'Howe', 'Howell', 'Hubbard', 'Huber', 'Hudson', 'Huff', 'Huffman', 'Hughes', 'Hull', 'Humphrey', 'Hunt', 'Hunter', 'Hurley', 'Hurst', \n\t\t'Hutchinson', 'Hyde', 'Ingram', 'Irwin', 'Jackson', 'Jacobs', 'Jacobson', 'James', 'Jarvis', 'Jefferson', 'Jenkins', 'Jennings', 'Jensen', 'Jimenez', 'Johns', 'Johnson', 'Johnston', \n\t\t'Jones', 'Jordan', 'Joseph', 'Joyce', 'Joyner', 'Juarez', 'Justice', 'Kane', 'Kaufman', 'Keith', 'Keller', 'Kelley', 'Kelly', 'Kemp', 'Kennedy', 'Kent', 'Kerr', 'Key', 'Kidd', 'Kim', \n\t\t'King', 'Kinney', 'Kirby', 'Kirk', 'Kirkland', 'Klein', 'Kline', 'Knapp', 'Knight', 'Knowles', 'Knox', 'Koch', 'Kramer', 'Lamb', 'Lambert', 'Lancaster', 'Landry', 'Lane', 'Lang', \n\t\t'Langley', 'Lara', 'Larsen', 'Larson', 'Lawrence', 'Lawson', 'Le', 'Leach', 'Leblanc', 'Lee', 'Leon', 'Leonard', 'Lester', 'Levine', 'Levy', 'Lewis', 'Lindsay', 'Lindsey', 'Little', \n\t\t'Livingston', 'Lloyd', 'Logan', 'Long', 'Lopez', 'Lott', 'Love', 'Lowe', 'Lowery', 'Lucas', 'Luna', 'Lynch', 'Lynn', 'Lyons', 'Macdonald', 'Macias', 'Mack', 'Madden', 'Maddox', \n\t\t'Maldonado', 'Malone', 'Mann', 'Manning', 'Marks', 'Marquez', 'Marsh', 'Marshall', 'Martin', 'Martinez', 'Mason', 'Massey', 'Mathews', 'Mathis', 'Matthews', 'Maxwell', 'May', 'Mayer', \n\t\t'Maynard', 'Mayo', 'Mays', 'Mcbride', 'Mccall', 'Mccarthy', 'Mccarty', 'Mcclain', 'Mcclure', 'Mcconnell', 'Mccormick', 'Mccoy', 'Mccray', 'Mccullough', 'Mcdaniel', 'Mcdonald', \n\t\t'Mcdowell', 'Mcfadden', 'Mcfarland', 'Mcgee', 'Mcgowan', 'Mcguire', 'Mcintosh', 'Mcintyre', 'Mckay', 'Mckee', 'Mckenzie', 'Mckinney', 'Mcknight', 'Mclaughlin', 'Mclean', 'Mcleod', \n\t\t'Mcmahon', 'Mcmillan', 'Mcneil', 'Mcpherson', 'Meadows', 'Medina', 'Mejia', 'Melendez', 'Melton', 'Mendez', 'Mendoza', 'Mercado', 'Mercer', 'Merrill', 'Merritt', 'Meyer', 'Meyers', \n\t\t'Michael', 'Middleton', 'Miles', 'Miller', 'Mills', 'Miranda', 'Mitchell', 'Molina', 'Monroe', 'Montgomery', 'Montoya', 'Moody', 'Moon', 'Mooney', 'Moore', 'Morales', 'Moran', 'Moreno', \n\t\t'Morgan', 'Morin', 'Morris', 'Morrison', 'Morrow', 'Morse', 'Morton', 'Moses', 'Mosley', 'Moss', 'Mueller', 'Mullen', 'Mullins', 'Munoz', 'Murphy', 'Murray', 'Myers', 'Nash', 'Navarro', \n\t\t'Neal', 'Nelson', 'Newman', 'Newton', 'Nguyen', 'Nichols', 'Nicholson', 'Nielsen', 'Nieves', 'Nixon', 'Noble', 'Noel', 'Nolan', 'Norman', 'Norris', 'Norton', 'Nunez', 'Obrien', 'Ochoa', \n\t\t'Oconnor', 'Odom', 'Odonnell', 'Oliver', 'Olsen', 'Olson', 'Oneal', 'Oneil', 'Oneill', 'Orr', 'Ortega', 'Ortiz', 'Osborn', 'Osborne', 'Owen', 'Owens', 'Pace', 'Pacheco', 'Padilla', \n\t\t'Page', 'Palmer', 'Park', 'Parker', 'Parks', 'Parrish', 'Parsons', 'Pate', 'Patel', 'Patrick', 'Patterson', 'Patton', 'Paul', 'Payne', 'Pearson', 'Peck', 'Pena', 'Pennington', 'Perez', \n\t\t'Perkins', 'Perry', 'Peters', 'Petersen', 'Peterson', 'Petty', 'Phelps', 'Phillips', 'Pickett', 'Pierce', 'Pittman', 'Pitts', 'Pollard', 'Poole', 'Pope', 'Porter', 'Potter', 'Potts', \n\t\t'Powell', 'Powers', 'Pratt', 'Preston', 'Price', 'Prince', 'Pruitt', 'Puckett', 'Pugh', 'Quinn', 'Ramirez', 'Ramos', 'Ramsey', 'Randall', 'Randolph', 'Rasmussen', 'Ratliff', 'Ray', \n\t\t'Raymond', 'Reed', 'Reese', 'Reeves', 'Reid', 'Reilly', 'Reyes', 'Reynolds', 'Rhodes', 'Rice', 'Rich', 'Richard', 'Richards', 'Richardson', 'Richmond', 'Riddle', 'Riggs', 'Riley', \n\t\t'Rios', 'Rivas', 'Rivera', 'Rivers', 'Roach', 'Robbins', 'Roberson', 'Roberts', 'Robertson', 'Robinson', 'Robles', 'Rocha', 'Rodgers', 'Rodriguez', 'Rodriquez', 'Rogers', 'Rojas', \n\t\t'Rollins', 'Roman', 'Romero', 'Rosa', 'Rosales', 'Rosario', 'Rose', 'Ross', 'Roth', 'Rowe', 'Rowland', 'Roy', 'Ruiz', 'Rush', 'Russell', 'Russo', 'Rutledge', 'Ryan', 'Salas', 'Salazar', \n\t\t'Salinas', 'Sampson', 'Sanchez', 'Sanders', 'Sandoval', 'Sanford', 'Santana', 'Santiago', 'Santos', 'Sargent', 'Saunders', 'Savage', 'Sawyer', 'Schmidt', 'Schneider', 'Schroeder', \n\t\t'Schultz', 'Schwartz', 'Scott', 'Sears', 'Sellers', 'Serrano', 'Sexton', 'Shaffer', 'Shannon', 'Sharp', 'Sharpe', 'Shaw', 'Shelton', 'Shepard', 'Shepherd', 'Sheppard', 'Sherman', \n\t\t'Shields', 'Short', 'Silva', 'Simmons', 'Simon', 'Simpson', 'Sims', 'Singleton', 'Skinner', 'Slater', 'Sloan', 'Small', 'Smith', 'Snider', 'Snow', 'Snyder', 'Solis', 'Solomon', 'Sosa', \n\t\t'Soto', 'Sparks', 'Spears', 'Spence', 'Spencer', 'Stafford', 'Stanley', 'Stanton', 'Stark', 'Steele', 'Stein', 'Stephens', 'Stephenson', 'Stevens', 'Stevenson', 'Stewart', 'Stokes', \n\t\t'Stone', 'Stout', 'Strickland', 'Strong', 'Stuart', 'Suarez', 'Sullivan', 'Summers', 'Sutton', 'Swanson', 'Sweeney', 'Sweet', 'Sykes', 'Talley', 'Tanner', 'Tate', 'Taylor', 'Terrell', \n\t\t'Terry', 'Thomas', 'Thompson', 'Thornton', 'Tillman', 'Todd', 'Torres', 'Townsend', 'Tran', 'Travis', 'Trevino', 'Trujillo', 'Tucker', 'Turner', 'Tyler', 'Tyson', 'Underwood', 'Valdez', \n\t\t'Valencia', 'Valentine', 'Valenzuela', 'Vance', 'Vang', 'Vargas', 'Vasquez', 'Vaughan', 'Vaughn', 'Vazquez', 'Vega', 'Velasquez', 'Velazquez', 'Velez', 'Villarreal', 'Vincent', 'Vinson', \n\t\t'Wade', 'Wagner', 'Walker', 'Wall', 'Wallace', 'Waller', 'Walls', 'Walsh', 'Walter', 'Walters', 'Walton', 'Ward', 'Ware', 'Warner', 'Warren', 'Washington', 'Waters', 'Watkins', 'Watson', \n\t\t'Watts', 'Weaver', 'Webb', 'Weber', 'Webster', 'Weeks', 'Weiss', 'Welch', 'Wells', 'West', 'Wheeler', 'Whitaker', 'White', 'Whitehead', 'Whitfield', 'Whitley', 'Whitney', 'Wiggins', \n\t\t'Wilcox', 'Wilder', 'Wiley', 'Wilkerson', 'Wilkins', 'Wilkinson', 'William', 'Williams', 'Williamson', 'Willis', 'Wilson', 'Winters', 'Wise', 'Witt', 'Wolf', 'Wolfe', 'Wong', 'Wood', \n\t\t'Woodard', 'Woods', 'Woodward', 'Wooten', 'Workman', 'Wright', 'Wyatt', 'Wynn', 'Yang', 'Yates', 'York', 'Young', 'Zamora', 'Zimmerman']\n\n\tcompany_names = [\"3Com Corp\", \"3M Company\", \"A.G. Edwards Inc.\", \"Abbott Laboratories\", \"Abercrombie & Fitch Co.\", \"ABM Industries Incorporated\", \"Ace Hardware Corporation\", \"ACT Manufacturing Inc.\",\n\t\t\"Acterna Corp.\", \"Adams Resources & Energy Inc.\", \"ADC Telecommunications Inc.\", \"Adelphia Communications Corporation\", \"Administaff Inc.\", \"Adobe Systems Incorporated\", \n\t\t\"Adolph Coors Company\", \"Advance Auto Parts Inc.\", \"Advanced Micro Devices Inc.\", \"AdvancePCS Inc.\", \"Advantica Restaurant Group Inc.\", \"The AES Corporation\", \"Aetna Inc.\", \n\t\t\"Affiliated Computer Services Inc.\", \"AFLAC Incorporated\", \"AGCO Corporation\", \"Agilent Technologies Inc.\", \"Agway Inc.\", \"Apartment Investment and Management Company\", \n\t\t\"Air Products and Chemicals Inc.\", \"Airborne Inc.\", \"Airgas Inc.\", \"AK Steel Holding Corporation\", \"Alaska Air Group Inc.\", \"Alberto-Culver Company\", \"Albertson's Inc.\", \"Alcoa Inc.\",\n\t\t\"Alleghany Corporation\", \"Allegheny Energy Inc.\", \"Allegheny Technologies Incorporated\", \"Allergan Inc.\", \"ALLETE Inc.\", \"Alliant Energy Corporation\", \"Allied Waste Industries Inc.\", \n\t\t\"Allmerica Financial Corporation\", \"The Allstate Corporation\", \"ALLTEL Corporation\", \"The Alpine Group Inc.\", \"Amazon.com Inc.\", \"AMC Entertainment Inc.\", \"American Power Conversion Corporation\",\n\t\t\"Amerada Hess Corporation\", \"AMERCO\", \"Ameren Corporation\", \"America West Holdings Corporation\", \"American Axle & Manufacturing Holdings Inc.\", \"American Eagle Outfitters Inc.\", \n\t\t\"American Electric Power Company Inc.\", \"American Express Company\", \"American Financial Group Inc.\", \"American Greetings Corporation\", \"American International Group Inc.\", \n\t\t\"American Standard Companies Inc.\", \"American Water Works Company Inc.\", \"AmerisourceBergen Corporation\", \"Ames Department Stores Inc.\", \"Amgen Inc.\", \"Amkor Technology Inc.\", \"AMR Corporation\",\n\t\t\"AmSouth Bancorp.\", \"Amtran Inc.\", \"Anadarko Petroleum Corporation\", \"Analog Devices Inc.\", \"Anheuser-Busch Companies Inc.\", \"Anixter International Inc.\", \"AnnTaylor Inc.\", \"Anthem Inc.\", \n\t\t\"AOL Time Warner Inc.\", \"Aon Corporation\", \"Apache Corporation\", \"Apple Computer Inc.\", \"Applera Corporation\", \"Applied Industrial Technologies Inc.\", \"Applied Materials Inc.\", \"Aquila Inc.\", \n\t\t\"ARAMARK Corporation\", \"Arch Coal Inc.\", \"Archer Daniels Midland Company\", \"Arkansas Best Corporation\", \"Armstrong Holdings Inc.\", \"Arrow Electronics Inc.\", \"ArvinMeritor Inc.\", \"Ashland Inc.\",\n\t\t\"Astoria Financial Corporation\", \"AT&T Corp.\", \"Atmel Corporation\", \"Atmos Energy Corporation\", \"Audiovox Corporation\", \"Autoliv Inc.\", \"Automatic Data Processing Inc.\", \"AutoNation Inc.\",\n\t\t\"AutoZone Inc.\", \"Avaya Inc.\", \"Avery Dennison Corporation\", \"Avista Corporation\", \"Avnet Inc.\", \"Avon Product Inc.\", \"Baker Hughes Incorporated\", \"Ball Corporation\", \"Bank of America Corporation\",\n\t\t\"The Bank of New York Company Inc.\", \"Bank One Corporation\", \"Banknorth Group Inc.\", \"Banta Corporation\", \"Barnes & Noble Inc.\", \"Bausch & Lomb Incorporated\", \"Baxter International Inc.\", \n\t\t\"BB&T Corporation\",\"The Bear Stearns Companies Inc.\",\"Beazer Homes USA Inc.\",\"Beckman Coulter Inc.\",\"Becton\",\"Dickinson and Company\",\"Bed Bath & Beyond Inc.\",\"Belk Inc.\",\n\t\t\"Bell Microproducts Inc.\",\"BellSouth Corporation\",\"Belo Corp.\",\"Bemis Company Inc.\",\"Benchmark Electronics Inc.\",\"Berkshire Hathaway Inc.\",\"Best Buy Co. Inc.\",\"Bethlehem Steel Corporation\",\n\t\t\"Beverly Enterprises Inc.\",\"Big Lots Inc.\",\"BJ Services Company\",\"BJ's Wholesale Club Inc.\",\"The Black & Decker Corporation\",\"Black Hills Corporation\",\"BMC Software Inc.\",\"The Boeing Company\",\n\t\t\"Boise Cascade Corporation\",\"Borders Group Inc.\",\"BorgWarner Inc.\",\"Boston Scientific Corporation\",\"Bowater Incorporated\",\"Briggs & Stratton Corporation\",\"Brightpoint Inc.\",\n\t\t\"Brinker International Inc.\",\"Bristol-Myers Squibb Company\",\"BroadwingInc.\",\"Brown Shoe CompanyInc.\",\"Brown-Forman Corporation\",\"Brunswick Corporation\",\"Budget GroupInc.\",\n\t\t\"Burlington Coat Factory Warehouse Corporation\",\"Burlington IndustriesInc.\",\"Burlington Northern Santa Fe Corporation\",\"Burlington Resources Inc.\",\"C. H. Robinson Worldwide Inc.\",\n\t\t\"Cablevision Systems Corp\",\"Cabot Corp\",\"Cadence Design SystemsInc.\",\"Calpine Corp.\",\"Campbell Soup Co.\",\"Capital One Financial Corp.\",\"Cardinal Health Inc.\",\"Caremark Rx Inc.\",\n\t\t\"Carlisle Cos. Inc.\",\"Carpenter Technology Corp.\",\"Casey's General Stores Inc.\",\"Caterpillar Inc.\",\"CBRL Group Inc.\",\"CDI Corp.\",\"CDW Computer Centers Inc.\",\"CellStar Corp.\",\"Cendant Corp\",\n\t\t\"Cenex Harvest States Cooperatives\",\"Centex Corp.\",\"CenturyTel Inc.\",\"Ceridian Corp.\",\"CH2M Hill Cos. Ltd.\",\"Champion Enterprises Inc.\",\"Charles Schwab Corp.\",\"Charming Shoppes Inc.\",\n\t\t\"Charter Communications Inc.\",\"Charter One Financial Inc.\",\"ChevronTexaco Corp.\",\"Chiquita Brands International Inc.\",\"Chubb Corp\",\"Ciena Corp.\",\"Cigna Corp\",\"Cincinnati Financial Corp.\",\n\t\t\"Cinergy Corp.\",\"Cintas Corp.\",\"Circuit City Stores Inc.\",\"Cisco Systems Inc.\",\"Citigroup\",\"Inc\",\"Citizens Communications Co.\",\"CKE Restaurants Inc.\",\"Clear Channel Communications Inc.\",\n\t\t\"The Clorox Co.\",\"CMGI Inc.\",\"CMS Energy Corp.\",\"CNF Inc.\",\"Coca-Cola Co.\",\"Coca-Cola Enterprises Inc.\",\"Colgate-Palmolive Co.\",\"Collins & Aikman Corp.\",\"Comcast Corp.\",\"Comdisco Inc.\",\n\t\t\"Comerica Inc.\",\"Comfort Systems USA Inc.\",\"Commercial Metals Co.\",\"Community Health Systems Inc.\",\"Compass Bancshares Inc\",\"Computer Associates International Inc.\",\"Computer Sciences Corp.\",\n\t\t\"Compuware Corp.\",\"Comverse Technology Inc.\",\"ConAgra Foods Inc.\",\"Concord EFS Inc.\",\"Conectiv\",\"Inc\",\"Conoco Inc\",\"Conseco Inc.\",\"Consolidated Freightways Corp.\",\"Consolidated Edison Inc.\",\n\t\t\"Constellation Brands Inc.\",\"Constellation Emergy Group Inc.\",\"Continental Airlines Inc.\",\"Convergys Corp.\",\"Cooper Cameron Corp.\",\"Cooper Industries Ltd.\",\"Cooper Tire & Rubber Co.\",\n\t\t\"Corn Products International Inc.\",\"Corning Inc.\",\"Costco Wholesale Corp.\",\"Countrywide Credit Industries Inc.\",\"Coventry Health Care Inc.\",\"Cox Communications Inc.\",\"Crane Co.\",\n\t\t\"Crompton Corp.\",\"Crown Cork & Seal Co. Inc.\",\"CSK Auto Corp.\",\"CSX Corp.\",\"Cummins Inc.\",\"CVS Corp.\",\"Cytec Industries Inc.\",\"D&K Healthcare ResourcesInc.\",\"D.R. Horton Inc.\",\n\t\t\"Dana Corporation\",\"Danaher Corporation\",\"Darden Restaurants Inc.\",\"DaVita Inc.\",\"Dean Foods Company\",\"Deere & Company\",\"Del Monte Foods Co\",\"Dell Computer Corporation\",\"Delphi Corp.\",\n\t\t\"Delta Air Lines Inc.\",\"Deluxe Corporation\",\"Devon Energy Corporation\",\"Di Giorgio Corporation\",\"Dial Corporation\",\"Diebold Incorporated\",\"Dillard's Inc.\",\"DIMON Incorporated\",\n\t\t\"Dole Food CompanyInc.\",\"Dollar General Corporation\",\"Dollar Tree StoresInc.\",\"Dominion ResourcesInc.\",\"Domino's Pizza LLC\",\"Dover CorporationInc.\",\"Dow Chemical Company\",\n\t\t\"Dow Jones & CompanyInc.\",\"DPL Inc.\",\"DQE Inc.\",\"Dreyer's Grand Ice CreamInc.\",\"DST SystemsInc.\",\"DTE Energy Co.\",\"E.I. Du Pont de Nemours and Company\",\"Duke Energy Corp\",\n\t\t\"Dun & Bradstreet Inc.\",\"DURA Automotive Systems Inc.\",\"DynCorp\",\"Dynegy Inc.\",\"E*Trade GroupInc.\",\"E.W. Scripps Company\",\"EarthlinkInc.\",\"Eastman Chemical Company\",\"Eastman Kodak Company\",\n\t\t\"Eaton Corporation\",\"Echostar Communications Corporation\",\"Ecolab Inc.\",\"Edison International\",\"EGL Inc.\",\"El Paso Corporation\",\"Electronic Arts Inc.\",\"Electronic Data Systems Corp.\",\n\t\t\"Eli Lilly and Company\",\"EMC Corporation\",\"Emcor Group Inc.\",\"Emerson Electric Co.\",\"Encompass Services Corporation\",\"Energizer Holdings Inc.\",\"Energy East Corporation\",\"Engelhard Corporation\",\n\t\t\"Enron Corp.\",\"Entergy Corporation\",\"Enterprise Products Partners L.P.\",\"EOG ResourcesInc.\",\"Equifax Inc.\",\"Equitable Resources Inc.\",\"Equity Office Properties Trust\",\n\t\t\"Equity Residential Properties Trust\",\"Estee Lauder Companies Inc.\",\"Exelon Corporation\",\"Exide Technologies\",\"Expeditors International of Washington Inc.\",\"Express Scripts Inc.\",\n\t\t\"ExxonMobil Corporation\",\"Fairchild Semiconductor International Inc.\",\"Family Dollar Stores Inc.\",\"Farmland Industries Inc.\",\"Federal Mogul Corp.\",\"Federated Department Stores Inc.\",\n\t\t\"Federal Express Corp.\",\"Felcor Lodging Trust Inc.\",\"Ferro Corp.\",\"Fidelity National Financial Inc.\",\"Fifth Third Bancorp\",\"First American Financial Corp.\",\"First Data Corp.\",\n\t\t\"First National of Nebraska Inc.\",\"First Tennessee National Corp.\",\"FirstEnergy Corp.\",\"Fiserv Inc.\",\"Fisher Scientific International Inc.\",\"FleetBoston Financial Co.\",\n\t\t\"Fleetwood Enterprises Inc.\",\"Fleming Companies Inc.\",\"Flowers Foods Inc.\",\"Flowserv Corp\",\"Fluor Corp\",\"FMC Corp\",\"Foamex International Inc\",\"Foot Locker Inc\",\"Footstar Inc.\",\n\t\t\"Ford Motor Co\",\"Forest Laboratories Inc.\",\"Fortune Brands Inc.\",\"Foster Wheeler Ltd.\",\"FPL Group Inc.\",\"Franklin Resources Inc.\",\"Freeport McMoran Copper & Gold Inc.\",\n\t\t\"Frontier Oil Corp\",\"Furniture Brands International Inc.\",\"Gannett Co.Inc.\",\"Gap Inc.\",\"Gateway Inc.\",\"GATX Corporation\",\"Gemstar-TV Guide International Inc.\",\"GenCorp Inc.\",\n\t\t\"General Cable Corporation\",\"General Dynamics Corporation\",\"General Electric Company\",\"General Mills Inc\",\"General Motors Corporation\",\"Genesis Health Ventures Inc.\",\"Gentek Inc.\",\n\t\t\"Gentiva Health Services Inc.\",\"Genuine Parts Company\",\"Genuity Inc.\",\"Genzyme Corporation\",\"Georgia Gulf Corporation\",\"Georgia-Pacific Corporation\",\"Gillette Company\",\"Gold Kist Inc.\",\n\t\t\"Golden State Bancorp Inc.\",\"Golden West Financial Corporation\",\"Goldman Sachs Group Inc.\",\"Goodrich Corporation\",\"The Goodyear Tire & Rubber Company\",\"Granite Construction Incorporated\",\n\t\t\"Graybar Electric Company Inc.\",\"Great Lakes Chemical Corporation\",\"Great Plains Energy Inc.\",\"GreenPoint Financial Corp.\",\"Greif Bros. Corporation\",\"Grey Global Group Inc.\",\n\t\t\"Group 1 Automotive Inc.\",\"Guidant Corporation\",\"H&R Block Inc.\",\"H.B. Fuller Company\",\"H.J. Heinz Company\",\"Halliburton Co.\",\"Harley-Davidson Inc.\",\"Harman International Industries Inc.\",\n\t\t\"Harrah's Entertainment Inc.\",\"Harris Corp.\",\"Harsco Corp.\",\"Hartford Financial Services Group Inc.\",\"Hasbro Inc.\",\"Hawaiian Electric Industries Inc.\",\"HCA Inc.\",\n\t\t\"Health Management Associates Inc.\",\"Health Net Inc.\",\"Healthsouth Corp\",\"Henry Schein Inc.\",\"Hercules Inc.\",\"Herman Miller Inc.\",\"Hershey Foods Corp.\",\"Hewlett-Packard Company\",\n\t\t\"Hibernia Corp.\",\"Hillenbrand Industries Inc.\",\"Hilton Hotels Corp.\",\"Hollywood Entertainment Corp.\",\"Home Depot Inc.\",\"Hon Industries Inc.\",\"Honeywell International Inc.\",\"Hormel Foods Corp.\",\n\t\t\"Host Marriott Corp.\",\"Household International Corp.\",\"Hovnanian Enterprises Inc.\",\"Hub Group Inc.\",\"Hubbell Inc.\",\"Hughes Supply Inc.\",\"Humana Inc.\",\"Huntington Bancshares Inc.\",\n\t\t\"Idacorp Inc.\",\"IDT Corporation\",\"IKON Office Solutions Inc.\",\"Illinois Tool Works Inc.\",\"IMC Global Inc.\",\"Imperial Sugar Company\",\"IMS Health Inc.\",\"Ingles Market Inc\",\"Ingram Micro Inc.\",\n\t\t\"Insight Enterprises Inc.\",\"Integrated Electrical Services Inc.\",\"Intel Corporation\",\"International Paper Co.\",\"Interpublic Group of Companies Inc.\",\"Interstate Bakeries Corporation\",\n\t\t\"International Business Machines Corp.\",\"International Flavors & Fragrances Inc.\",\"International Multifoods Corporation\",\"Intuit Inc.\",\"IT Group Inc.\",\"ITT Industries Inc.\",\"Ivax Corp.\",\n\t\t\"J.B. Hunt Transport Services Inc.\",\"J.C. Penny Co.\",\"J.P. Morgan Chase & Co.\",\"Jabil Circuit Inc.\",\"Jack In The Box Inc.\",\"Jacobs Engineering Group Inc.\",\"JDS Uniphase Corp.\",\n\t\t\"Jefferson-Pilot Co.\",\"John Hancock Financial Services Inc.\",\"Johnson & Johnson\",\"Johnson Controls Inc.\",\"Jones Apparel Group Inc.\",\"KB Home\",\"Kellogg Company\",\"Kellwood Company\",\n\t\t\"Kelly Services Inc.\",\"Kemet Corp.\",\"Kennametal Inc.\",\"Kerr-McGee Corporation\",\"KeyCorp\",\"KeySpan Corp.\",\"Kimball International Inc.\",\"Kimberly-Clark Corporation\",\"Kindred Healthcare Inc.\",\n\t\t\"KLA-Tencor Corporation\",\"K-Mart Corp.\",\"Knight-Ridder Inc.\",\"Kohl's Corp.\",\"KPMG Consulting Inc.\",\"Kroger Co.\",\"L-3 Communications Holdings Inc.\",\"Laboratory Corporation of America Holdings\",\n\t\t\"Lam Research Corporation\",\"LandAmerica Financial Group Inc.\",\"Lands' End Inc.\",\"Landstar System Inc.\",\"La-Z-Boy Inc.\",\"Lear Corporation\",\"Legg Mason Inc.\",\"Leggett & Platt Inc.\",\n\t\t\"Lehman Brothers Holdings Inc.\",\"Lennar Corporation\",\"Lennox International Inc.\",\"Level 3 Communications Inc.\",\"Levi Strauss & Co.\",\"Lexmark International Inc.\",\"Limited Inc.\",\n\t\t\"Lincoln National Corporation\",\"Linens 'n Things Inc.\",\"Lithia Motors Inc.\",\"Liz Claiborne Inc.\",\"Lockheed Martin Corporation\",\"Loews Corporation\",\"Longs Drug Stores Corporation\",\n\t\t\"Louisiana-Pacific Corporation\",\"Lowe's Companies Inc.\",\"LSI Logic Corporation\",\"The LTV Corporation\",\"The Lubrizol Corporation\",\"Lucent Technologies Inc.\",\"Lyondell Chemical Company\",\n\t\t\"M & T Bank Corporation\",\"Magellan Health Services Inc.\",\"Mail-Well Inc.\",\"Mandalay Resort Group\",\"Manor Care Inc.\",\"Manpower Inc.\",\"Marathon Oil Corporation\",\"Mariner Health Care Inc.\",\n\t\t\"Markel Corporation\",\"Marriott International Inc.\",\"Marsh & McLennan Companies Inc.\",\"Marsh Supermarkets Inc.\",\"Marshall & Ilsley Corporation\",\"Martin Marietta Materials Inc.\",\n\t\t\"Masco Corporation\",\"Massey Energy Company\",\"MasTec Inc.\",\"Mattel Inc.\",\"Maxim Integrated Products Inc.\",\"Maxtor Corporation\",\"Maxxam Inc.\",\"The May Department Stores Company\",\n\t\t\"Maytag Corporation\",\"MBNA Corporation\",\"McCormick & Company Incorporated\",\"McDonald's Corporation\",\"The McGraw-Hill Companies Inc.\",\"McKesson Corporation\",\"McLeodUSA Incorporated\",\n\t\t\"M.D.C. Holdings Inc.\",\"MDU Resources Group Inc.\",\"MeadWestvaco Corporation\",\"Medtronic Inc.\",\"Mellon Financial Corporation\",\"The Men's Wearhouse Inc.\",\"Merck & Co.Inc.\",\n\t\t\"Mercury General Corporation\",\"Merrill Lynch & Co. Inc.\",\"Metaldyne Corporation\",\"Metals USA Inc.\",\"MetLife Inc.\",\"Metris Companies Inc\",\"MGIC Investment Corporation\",\"MGM Mirage\",\n\t\t\"Michaels Stores Inc.\",\"Micron Technology Inc.\",\"Microsoft Corporation\",\"Milacron Inc.\",\"Millennium Chemicals Inc.\",\"Mirant Corporation\",\"Mohawk Industries Inc.\",\"Molex Incorporated\",\n\t\t\"The MONY Group Inc.\",\"Morgan Stanley Dean Witter & Co.\",\"Motorola Inc.\",\"MPS Group Inc.\",\"Murphy Oil Corporation\",\"Nabors Industries Inc\",\"Nacco Industries Inc\",\"Nash Finch Company\",\n\t\t\"National City Corp.\",\"National Commerce Financial Corporation\",\"National Fuel Gas Company\",\"National Oilwell Inc\",\"National Rural Utilities Cooperative Finance Corporation\",\n\t\t\"National Semiconductor Corporation\",\"National Service Industries Inc\",\"Navistar International Corporation\",\"NCR Corporation\",\"The Neiman Marcus Group Inc.\",\"New Jersey Resources Corporation\",\n\t\t\"New York Times Company\",\"Newell Rubbermaid Inc\",\"Newmont Mining Corporation\",\"Nextel Communications Inc\",\"Nicor Inc\",\"Nike Inc\",\"NiSource Inc\",\"Noble Energy Inc\",\"Nordstrom Inc\",\n\t\t\"Norfolk Southern Corporation\",\"Nortek Inc\",\"North Fork Bancorporation Inc\",\"Northeast Utilities System\",\"Northern Trust Corporation\",\"Northrop Grumman Corporation\",\"NorthWestern Corporation\",\n\t\t\"Novellus Systems Inc\",\"NSTAR\",\"NTL Incorporated\",\"Nucor Corp\",\"Nvidia Corp\",\"NVR Inc\",\"Northwest Airlines Corp\",\"Occidental Petroleum Corp\",\"Ocean Energy Inc\",\"Office Depot Inc.\",\n\t\t\"OfficeMax Inc\",\"OGE Energy Corp\",\"Oglethorpe Power Corp.\",\"Ohio Casualty Corp.\",\"Old Republic International Corp.\",\"Olin Corp.\",\"OM Group Inc\",\"Omnicare Inc\",\"Omnicom Group\",\n\t\t\"On Semiconductor Corp\",\"ONEOK Inc\",\"Oracle Corp\",\"Oshkosh Truck Corp\",\"Outback Steakhouse Inc.\",\"Owens & Minor Inc.\",\"Owens Corning\",\"Owens-Illinois Inc\",\"Oxford Health Plans Inc\",\n\t\t\"Paccar Inc\",\"PacifiCare Health Systems Inc\",\"Packaging Corp. of America\",\"Pactiv Corp\",\"Pall Corp\",\"Pantry Inc\",\"Park Place Entertainment Corp\",\"Parker Hannifin Corp.\",\n\t\t\"Pathmark Stores Inc.\",\"Paychex Inc\",\"Payless Shoesource Inc\",\"Penn Traffic Co.\",\"Pennzoil-Quaker State Company\",\"Pentair Inc\",\"Peoples Energy Corp.\",\"PeopleSoft Inc\",\"Pep Boys Manny\",\n\t\t\"Moe & Jack\",\"Potomac Electric Power Co.\",\"Pepsi Bottling Group Inc.\",\"PepsiAmericas Inc.\",\"PepsiCo Inc.\",\"Performance Food Group Co.\",\"Perini Corp\",\"PerkinElmer Inc\",\"Perot Systems Corp\",\n\t\t\"Petco Animal Supplies Inc.\",\"Peter Kiewit Sons'Inc.\",\"PETsMART Inc\",\"Pfizer Inc\",\"Pacific Gas & Electric Corp.\",\"Pharmacia Corp\",\"Phar Mor Inc.\",\"Phelps Dodge Corp.\",\n\t\t\"Philip Morris Companies Inc.\",\"Phillips Petroleum Co\",\"Phillips Van Heusen Corp.\",\"Phoenix Companies Inc\",\"Pier 1 Imports Inc.\",\"Pilgrim's Pride Corporation\",\"Pinnacle West Capital Corp\",\n\t\t\"Pioneer-Standard Electronics Inc.\",\"Pitney Bowes Inc.\",\"Pittston Brinks Group\",\"Plains All American Pipeline LP\",\"PNC Financial Services Group Inc.\",\"PNM Resources Inc\",\"Polaris Industries Inc.\",\n\t\t\"Polo Ralph Lauren Corp\",\"PolyOne Corp\",\"Popular Inc\",\"Potlatch Corp\",\"PPG Industries Inc\",\"PPL Corp\",\"Praxair Inc\",\"Precision Castparts Corp\",\"Premcor Inc.\",\"Pride International Inc\",\"Primedia Inc\",\n\t\t\"Principal Financial Group Inc.\",\"Procter & Gamble Co.\",\"Pro-Fac Cooperative Inc.\",\"Progress Energy Inc\",\"Progressive Corporation\",\"Protective Life Corp\",\"Provident Financial Group\",\n\t\t\"Providian Financial Corp.\",\"Prudential Financial Inc.\",\"PSS World Medical Inc\",\"Public Service Enterprise Group Inc.\",\"Publix Super Markets Inc.\",\"Puget Energy Inc.\",\"Pulte Homes Inc\",\"Qualcomm Inc\",\n\t\t\"Quanta Services Inc.\",\"Quantum Corp\",\"Quest Diagnostics Inc.\",\"Questar Corp\",\"Quintiles Transnational\",\"Qwest Communications Intl Inc\",\"R.J. Reynolds Tobacco Company\",\"R.R. Donnelley & Sons Company\",\n\t\t\"Radio Shack Corporation\",\"Raymond James Financial Inc.\",\"Raytheon Company\",\"Reader's Digest Association Inc.\",\"Reebok International Ltd.\",\"Regions Financial Corp.\",\"Regis Corporation\",\n\t\t\"Reliance Steel & Aluminum Co.\",\"Reliant Energy Inc.\",\"Rent A Center Inc\",\"Republic Services Inc\",\"Revlon Inc\",\"RGS Energy Group Inc\",\"Rite Aid Corp\",\"Riverwood Holding Inc.\",\"RoadwayCorp\",\n\t\t\"Robert Half International Inc.\",\"Rock-Tenn Co\",\"Rockwell Automation Inc\",\"Rockwell Collins Inc\",\"Rohm & Haas Co.\",\"Ross Stores Inc\",\"RPM Inc.\",\"Ruddick Corp\",\"Ryder System Inc\",\"Ryerson Tull Inc\",\n\t\t\"Ryland Group Inc.\",\"Sabre Holdings Corp\",\"Safeco Corp\",\"Safeguard Scientifics Inc.\",\"Safeway Inc\",\"Saks Inc\",\"Sanmina-SCI Inc\",\"Sara Lee Corp\",\"SBC Communications Inc\",\"Scana Corp.\",\n\t\t\"Schering-Plough Corp\",\"Scholastic Corp\",\"SCI Systems Onc.\",\"Science Applications Intl. Inc.\",\"Scientific-Atlanta Inc\",\"Scotts Company\",\"Seaboard Corp\",\"Sealed Air Corp\",\"Sears Roebuck & Co\",\n\t\t\"Sempra Energy\",\"Sequa Corp\",\"Service Corp. International\",\"ServiceMaster Co\",\"Shaw Group Inc\",\"Sherwin-Williams Company\",\"Shopko Stores Inc\",\"Siebel Systems Inc\",\"Sierra Health Services Inc\",\n\t\t\"Sierra Pacific Resources\",\"Silgan Holdings Inc.\",\"Silicon Graphics Inc\",\"Simon Property Group Inc\",\"SLM Corporation\",\"Smith International Inc\",\"Smithfield Foods Inc\",\"Smurfit-Stone Container Corp\",\n\t\t\"Snap-On Inc\",\"Solectron Corp\",\"Solutia Inc\",\"Sonic Automotive Inc.\",\"Sonoco Products Co.\",\"Southern Company\",\"Southern Union Company\",\"SouthTrust Corp.\",\"Southwest Airlines Co\",\"Southwest Gas Corp\",\n\t\t\"Sovereign Bancorp Inc.\",\"Spartan Stores Inc\",\"Spherion Corp\",\"Sports Authority Inc\",\"Sprint Corp.\",\"SPX Corp\",\"St. Jude Medical Inc\",\"St. Paul Cos.\",\"Staff Leasing Inc.\",\"StanCorp Financial Group Inc\",\n\t\t\"Standard Pacific Corp.\",\"Stanley Works\",\"Staples Inc\",\"Starbucks Corp\",\"Starwood Hotels & Resorts Worldwide Inc\",\"State Street Corp.\",\"Stater Bros. Holdings Inc.\",\"Steelcase Inc\",\"Stein Mart Inc\",\n\t\t\"Stewart & Stevenson Services Inc\",\"Stewart Information Services Corp\",\"Stilwell Financial Inc\",\"Storage Technology Corporation\",\"Stryker Corp\",\"Sun Healthcare Group Inc.\",\"Sun Microsystems Inc.\",\n\t\t\"SunGard Data Systems Inc.\",\"Sunoco Inc.\",\"SunTrust Banks Inc\",\"Supervalu Inc\",\"Swift Transportation\",\"Inc\",\"Symbol Technologies Inc\",\"Synovus Financial Corp.\",\"Sysco Corp\",\"Systemax Inc.\",\n\t\t\"Target Corp.\",\"Tech Data Corporation\",\"TECO Energy Inc\",\"Tecumseh Products Company\",\"Tektronix Inc\",\"Teleflex Incorporated\",\"Telephone & Data Systems Inc\",\"Tellabs Inc.\",\"Temple-Inland Inc\",\n\t\t\"Tenet Healthcare Corporation\",\"Tenneco Automotive Inc.\",\"Teradyne Inc\",\"Terex Corp\",\"Tesoro Petroleum Corp.\",\"Texas Industries Inc.\",\"Texas Instruments Incorporated\",\"Textron Inc\",\n\t\t\"Thermo Electron Corporation\",\"Thomas & Betts Corporation\",\"Tiffany & Co\",\"Timken Company\",\"TJX Companies Inc\",\"TMP Worldwide Inc\",\"Toll Brothers Inc\",\"Torchmark Corporation\",\"Toro Company\",\n\t\t\"Tower Automotive Inc.\",\"Toys 'R' Us Inc\",\"Trans World Entertainment Corp.\",\"TransMontaigne Inc\",\"Transocean Inc\",\"TravelCenters of America Inc.\",\"Triad Hospitals Inc\",\"Tribune Company\",\n\t\t\"Trigon Healthcare Inc.\",\"Trinity Industries Inc\",\"Trump Hotels & Casino Resorts Inc.\",\"TruServ Corporation\",\"TRW Inc\",\"TXU Corp\",\"Tyson Foods Inc\",\"U.S. Bancorp\",\"U.S. Industries Inc.\",\"UAL Corporation\",\n\t\t\"UGI Corporation\",\"Unified Western Grocers Inc\",\"Union Pacific Corporation\",\"Union Planters Corp\",\"Unisource Energy Corp\",\"Unisys Corporation\",\"United Auto Group Inc\",\"United Defense Industries Inc.\",\n\t\t\"United Parcel Service Inc\",\"United Rentals Inc\",\"United Stationers Inc\",\"United Technologies Corporation\",\"UnitedHealth Group Incorporated\",\"Unitrin Inc\",\"Universal Corporation\",\n\t\t\"Universal Forest Products Inc\",\"Universal Health Services Inc\",\"Unocal Corporation\",\"Unova Inc\",\"UnumProvident Corporation\",\"URS Corporation\",\"US Airways Group Inc\",\"US Oncology Inc\",\"USA Interactive\",\n\t\t\"USFreighways Corporation\",\"USG Corporation\",\"UST Inc\",\"Valero Energy Corporation\",\"Valspar Corporation\",\"Value City Department Stores Inc\",\"Varco International Inc\",\"Vectren Corporation\",\n\t\t\"Veritas Software Corporation\",\"Verizon Communications Inc\",\"VF Corporation\",\"Viacom Inc\",\"Viad Corp\",\"Viasystems Group Inc\",\"Vishay Intertechnology Inc\",\"Visteon Corporation\",\n\t\t\"Volt Information Sciences Inc\",\"Vulcan Materials Company\",\"W.R. Berkley Corporation\",\"W.R. Grace & Co\",\"W.W. Grainger Inc\",\"Wachovia Corporation\",\"Wakenhut Corporation\",\"Walgreen Co\",\n\t\t\"Wallace Computer Services Inc\",\"Wal-Mart Stores Inc\",\"Walt Disney Co\",\"Walter Industries Inc\",\"Washington Mutual Inc\",\"Washington Post Co.\",\"Waste Management Inc\",\"Watsco Inc\",\n\t\t\"Weatherford International Inc\",\"Weis Markets Inc.\",\"Wellpoint Health Networks Inc\",\"Wells Fargo & Company\",\"Wendy's International Inc\",\"Werner Enterprises Inc\",\"WESCO International Inc\",\n\t\t\"Western Digital Inc\",\"Western Gas Resources Inc\",\"WestPoint Stevens Inc\",\"Weyerhauser Company\",\"WGL Holdings Inc\",\"Whirlpool Corporation\",\"Whole Foods Market Inc\",\"Willamette Industries Inc.\",\n\t\t\"Williams Companies Inc\",\"Williams Sonoma Inc\",\"Winn Dixie Stores Inc\",\"Wisconsin Energy Corporation\",\"Wm Wrigley Jr Company\",\"World Fuel Services Corporation\",\"WorldCom Inc\",\n\t\t\"Worthington Industries Inc\",\"WPS Resources Corporation\",\"Wyeth\",\"Wyndham International Inc\",\"Xcel Energy Inc\",\"Xerox Corp\",\"Xilinx Inc\",\"XO Communications Inc\",\"Yellow Corporation\",\n\t\t\"York International Corp\",\"Yum Brands Inc.\",\"Zale Corporation\",\"Zions Bancorporation\"]\n\n\tstreets = [\"West Velvetleaf Way\",\"Fox Creek Mount\",\"East Foothill Vista\",\"North Jessup Row\",\"Minoru Trail\",\"Sunken Meadow Causeway\",\"Dares Wharf Promenade\",\"Lynestra Vale West\",\"Sugden Bypass\",\"Southwest Halevy Grove\",\n\t\t\"Binscombe Green\",\"Aldfield Rise\",\"Mac Donald\",\"East Berkmans Manor\",\"North Scouller Mount\",\"East Burngarten Grove\",\"Copped Hall West\",\"Gona Trace South\",\"South Deacon Haynes Circle\",\"South Battles Pathway\",\n\t\t\"Canon Barns Trace\",\"West House of Correction Loop\",\"Father Capodanno Route\",\"Anthony Hill Row\",\"East Elrose Way\",\"Creasys Canyon\",\"Chuter Court East\",\"Northwest Middlegate Close\",\"West Aladdin Quay\",\"East Half Moon Bay Hill\",\n\t\t\"Southeast Whisperwillow Garth\",\"North Weston Bay Rise\",\"Cabrito Bypass West\",\"Kulas Knoll\",\"North Kempston Parkway\",\"Saint Moritz\",\"Cliff View North\",\"Don Mills\",\"Northeast Revensey Spur\",\"Southeast Barnmead Trail\",\n\t\t\"South Van Tines\",\"Eastland Arch South\",\"Alta Sierra\",\"Stillman Knoll West\",\"Northwest Millbeck Way\",\"Southwest Green Court Trace\",\"East Stonestile Loop\",\"Baja Spur West\",\"Molle Quay\",\"Hancock Grade\"]\n\n\tcities = [\"Toronto\",\"Montreal\",\"Vancouver\",\"Lachine\",\"Mississauga\",\"Leamington\",\"Camrose\",\"Richmond\",\"Markham\",\"Creston\",\"Coquitlam\",\"Victoria\",\"Port Coquitlam\",\"North Vancouver\",\"Burnaby\",\"Surrey\",\"Delta\",\"Vernon\",\"New Westminster\",\n\t\t\"Langley\",\"Kamloops\",\"Maple Ridge\",\"Abbotsford\",\"Chilliwack\",\"Whistler Village\",\"Kelowna\",\"Port Moody\",\"Calgary\",\"Lethbridge\",\"Edmonton\",\"Lacombe\",\"Fort McMurray\",\"Fort Saskatchewan\",\"Red Deer\",\n\t\t\"Morinville\",\"Spruce Grove\",\"Sherwood Park\",\"Okotoks\",\"Strathmore\",\"Airdrie\",\"High Level\",\"Fairview, Alberta\",\"Leduc\",\"Grande Prairie\",\"Chatham\",\"Tavistock\",\"Perth\",\"Midland\",\"Laval\",\"Hamilton\",\"Ottawa\",\n\t\t\"Fergus\",\"Scarborough\",\"Cambridge\",\"Waterloo\",\"Welland\",\"Vieux-Saint-Laurent\",\"Kitchener\",\"Longueuil\",\"Oshawa\",\"Brampton\",\"Rougemont\",\"Saint-Remi\",\"London\",\"Milton\",\"Pointe-Claire\",\"Sherbrooke\",\"Kanata\",\n\t\t\"Gatineau\",\"Lasalle\",\"Quebec\",\"Beauport\",\"Donnacona\",\"Charlesbourg\",\"Saint-Augustin\",\"Joliette\",\"Saint-Felicien\",\"Dolbeau-Mistassini\",\"Albanel\",\"Port Clements\",\"Queen Charlotte\",\"Masset\",\"Ingersoll\",\n\t\t\"Alma\",\"Hawkesbury\",\"Shannonville\",\"Elk Point\",\"Burgessville\",\"Brantford\",\"Woodstock\",\"Thornhill\",\"Stoney Creek\",\"Caledonia\",\"Burlington\",\"Grimsby\",\"Vineland Station\",\"Beamsville\",\"Niagara Falls\",\n\t\t\"Smithville\",\"Jordan\",\"Peterborough\",\"Granby\",\"Cowansville\",\"Boisbriand\",\"Levis\",\"Sorel\",\"Blainville\",\"Mont-Royal\",\"Saint-Michel-des-Saints\",\"Saint-Hubert-de-Riviere-du-Loup\",\"Rosemere\",\"Sainte-Marthe\",\n\t\t\"Nominingue\",\"Saint-Eustache\",\"Sainte-Catherine\",\"Terrebonne\",\"Saint-Leonard\",\"Westmount\",\"Kirkland\",\"Delson\",\"Saint-Sauveur\",\"Saint-Jean-sur-Richelieu\",\"Sabrevois\",\"Saint-Lambert\",\"Mascouche\",\n\t\t\"Saint-Jerome\",\"Chambly\",\"Varennes\",\"Mirabel\",\"Rivière-du-Loup\",\"Brossard\",\"Repentigny\",\"Sainte-Therese\",\"Dorval\",\"Leonard\",\"Saint-Lin-Laurentides\",\"Verdun\",\"Saint-Agapit\",\"Boucherville\",\"Jonquiere\",\n\t\t\"Chicoutimi\",\"Saint-Lambert\",\"Brossard\",\"Candiac\",\"Kincardine\",\"North Perth\",\"Stratford\",\"Les Escoumins\",\"Saint-Jacques\",\"L'Assomption\",\"Greenfield Park\",\"Deux-Montagnes\",\"Waterville\",\"Amos\",\n\t\t\"La Morandiere\",\"Barraute\",\"Val-d'Or\",\"Rouyn-Noranda\",\"Saint-Prosper\",\"Saint-Georges\",\"Saint-Simon-de-Rimouski\",\"Saint-Victor\",\"La Guadeloupe\",\"Alma\",\"Drummondville\",\"Roberval\",\"Asbestos\",\"Rimouski\",\n\t\t\"Saint-Anaclet-de-Lessard\",\"Trois-Rivières\",\"Magog\",\"Shawinigan\",\"Sainte-Agathe-des-Monts\",\"Sainte-Adele\",\"Sainte-Anne-des-Monts\",\"Salaberry-de-Valleyfield\",\"Saint-Germain-de-Grantham\",\"Thetford-Mines\",\n\t\t\"Champlain\",\"North York\",\"Aurora\",\"Richmond Hill\",\"Orleans\",\"Etobicoke\",\"Guelph\",\"Whitby\",\"Pickering\",\"Vercheres\",\"Saint-Gabriel-de-Valcartier\",\"Canning\",\"Wolfville\",\"Kentville\",\"Centreville\",\"Cambridge\",\n\t\t\"Ancaster\",\"Jerseyville\",\"North Russell\",\"Cote-Saint-Luc\",\"Mont-Tremblant\",\"Saint-Faustin--Lac-Carre\",\"Plessisville\",\"Port-Cartier\",\"Sept-Iles\",\"Montmagny\",\"Notre-Dame-du-Mont-Carmel\",\"Shawinigan-Sud\",\n\t\t\"Saint-Mathieu\",\"Windsor\",\"Belle River\",\"Tecumseh\",\"Kingsville\",\"Amherstburg\",\"Newmarket\",\"Essex\",\"Harrow\",\"Wheatley\",\"Tecumseh\",\"Memphremagog\",\"Stettler\",\"Rocky Mountain House\",\"Banff\",\"Canmore\",\"Didsbury\",\n\t\t\"Carstairs\",\"Blairmore\",\"Pincher Creek\",\"Coleman\",\"Cowley\",\"Taber\",\"Brooks\",\"Drumheller\",\"High River\",\"Drayton Valley\",\"Barrhead\",\"Edson\",\"Lloydminster\",\"Vermilion\",\"Winnipeg\",\"Hinton\",\"Jasper\",\"Westlock\",\n\t\t\"Kimberley\",\"Cranbrook\",\"Marysville\",\"Fernie\",\"Canyon\",\"Golden\",\"Invermere\",\"Fairmont Hot Springs\",\"Penticton\",\"Summerland\",\"Okanagan Centre\",\"Westbank\",\"Chase\",\"Nelson\",\"Coldstream\",\"Port Alberni\",\"Sooke\",\n\t\t\"Courtenay\",\"Comox\",\"Parksville\",\"Cumberland\",\"Winfield\",\"Enderby\",\"Salmon Arm\",\"Armstrong\",\"Sorrento\",\"Williams Lake\",\"Grand Forks\",\"Greenwood\",\"Peachland\",\"Regina\",\"Rosetown\",\"Canora\",\"Kindersley\",\"La Ronge\",\n\t\t\"Humboldt\",\"Warman\",\"Melfort\",\"Meadow Lake\",\"Unity\",\"Esterhazy\",\"Kamsack\",\"North Battleford\",\"Weyburn\",\"Maidstone\",\"Estevan\",\"Yorkton\",\"Melville\",\"Maple Creek\",\"Moosomin\",\"Saint-Pierre-de-Broughton\",\n\t\t\"Saint-Hyacinthe\",\"Steinbach\",\"Stonewall\",\"Selkirk\",\"Teulon\",\"Pine Falls\",\"Beausejour\",\"Thompson\",\"St. Paul\",\"Portage la Prairie\",\"Tsawwassen\",\"White Rock\",\"Sechelt\",\"Mission\",\"Biggar\",\"Midale\",\"Nipawin\",\n\t\t\"Lampman\",\"Saskatoon\",\"Halifax\",\"Bridgewater\",\"Italy Cross\",\"Lunenburg\",\"Shelburne\",\"Mahone Bay\",\"Dartmouth\",\"Eastern Passage\",\"Sydney\",\"Truro\",\"Springhill\",\"Halifax\",\"Sackville\",\"Mount Uniacke\",\"Beaver Bank\",\n\t\t\"Port Dover\",\"Canfield\",\"Dunnville\",\"Hagersville\",\"Waterford\",\"Cayuga\",\"Sidney\",\"Crofton\",\"Saanichton\",\"North Saanich\",\"Mayne\",\"Shawnigan Lake\",\"Duncan\",\"Chemainus\",\"Lake Cowichan\",\"Cobble Hill\",\"Ladysmith\",\n\t\t\"Powell River\",\"Van Anda\",\"Sault Ste. Marie\",\"Manitouwadge\",\"Wawa\",\"Thunder Bay\",\"Atikokan\",\"Terrace Bay\",\"Schreiber\",\"Woodbridge\",\"Shelburne\",\"Bolton\",\"Puslinch\",\"York\",\"Acton\",\"Stouffville\",\"Ajax\",\n\t\t\"Orangeville\",\"Glencoe\",\"Caledon\",\"Oakville\",\"Norfolk County\",\"Tillsonburg\",\"Orillia\",\"Millbrook\",\"Arthur\",\"North Hatley\",\"Roxboro\",\"Crabtree\",\"Huntingdon\",\"Beloeil\",\"Rawdon\",\"Bourget\",\"Niagara-on-the-Lake\",\n\t\t\"Concord\",\"Maskinonge\",\"Saint-Maurice\",\"Saint-Barthelemy\",\"Batiscan\",\"Pierreville\",\"Becancour\",\"Nicolet\",\"Saint-Etienne-des-Gres\",\"Yamachiche\",\"Gaspé\",\"Baie-Comeau\",\"Saint-Pierre\",\"Sainte-Angele-de-Premont\",\n\t\t\"Chandler\",\"Val-David\",\"Yamaska\",\"Matane\",\"Saint-Ulric\",\"Saint-Leonard-d'Aston\",\"Deschaillons-sur-Saint-Laurent\",\"Aston-Jonction\",\"Sainte-Perpetue\",\"Saint-Cyrille-de-Wendover\",\"Roxton Falls\",\"Richmond\",\n\t\t\"Disraeli\",\"Normandin\",\"Saint-Gedeon\",\"Louiseville\",\"Saint-Dominique\",\"East Broughton\",\"Desbiens\",\"Hebertville\",\"Carmel\",\"Sainte-Anne-de-la-Perade\",\"Ayer's Cliff\",\"Windsor\",\"Tumbler Ridge\",\"Osoyoos\",\"Oliver\",\n\t\t\"Fenelon Falls\",\"Lindsay\",\"Bobcaygeon\",\"Dunsford\",\"Potter\",\"Vaughan\",\"Murray River\",\"Charlottetown\",\"New Glasgow\",\"Trenton\",\"Stellarton\",\"Sydney\",\"North Sydney\",\"Villa Marie\",\"Yarmouth\",\"Digby\",\"Brookfield\",\n\t\t\"Victoria\",\"Clarke's Beach\",\"Harbour Grace\",\"Bellevue\",\"Bay Roberts\",\"Heart's Delight-Islington\",\"Summerside\",\"Coleman\",\"Annapolis Royal\",\"Oxford\",\"Amherst\",\"Fogo\",\"Greenspond\",\"Lumsden\",\"Digby\",\"Antigonish\",\n\t\t\"Kensington\",\"Arichat\",\"Port Hawkesbury\",\"D'Escousse\",\"Petit-de-Grat\",\"Cornwall\",\"Georgetown\",\"New Hamburg\",\"St. John's\",\"Mount Pearl\",\"Bedford\",\"Church Point\",\"Placentia\",\"Meteghan River\",\"East Chezzetcook\",\n\t\t\"Sydney Mines\",\"Stratford\",\"Windsor\",\"Barrie\",\"King City\",\"Beeton\",\"Alliston\",\"Bradford\",\"Uxbridge\",\"Angus\",\"Schomberg\",\"Tottenham\",\"Caledon\",\"Greater Sudbury\",\"Lively\",\"Chelmsford\",\"New Liskeard\",\"Timmins\",\n\t\t\"Copper Cliff\",\"Elliot Lake\",\"Blind River\",\"Casimir\",\"Massey\",\"Rockwood\",\"Belleville\",\"Sturgeon Falls\",\"North Bay\",\"Aylmer\",\"Garson\",\"Port Elgin\",\"Hanover\",\"Listowel\",\"Mildmay\",\"Palmerston\",\"Wingham\",\n\t\t\"Mount Forest\",\"Chesley\",\"Kingston\",\"Napanee\",\"Simcoe\",\"Marmora\",\"Campbellford\",\"Napanee\",\"Winchester\",\"Walkerton\",\"Chesterville\",\"Cornwall\",\"Kapuskasing\",\"Picton\",\"Fort-Coulonge\",\"Owen Sound\",\"Durham\",\n\t\t\"Britt\",\"Gore Bay\",\"Dundas\",\"Waterdown\",\"Carlisle\",\"Hanna\",\"Lougheed\",\"Wetaskiwin\",\"Cold Lake\",\"Calmar\",\"Clairmont\",\"Bonnyville\",\"Aylesford\",\"Berwick\",\"Greenwood\",\"Middleton\",\"Kingston\",\"Three Mile Plains\",\n\t\t\"Saint-Frederic\",\"Rigaud\",\"Huntsville\",\"Bracebridge\",\"Gravenhurst\",\"Parry Sound\",\"Maple\",\"Saint-Joseph-de-Beauce\",\"La Patrie\",\"Saint-Camille\",\"Eastman\",\"Napierville\",\"Austin\",\"Martinville\",\"Compton\",\n\t\t\"Sawyerville\",\"Sainte-Marie\",\"Saint-Louis-de-Gonzague\",\"Trenton\",\"Corbyville\",\"Petawawa\",\"Pembroke\",\"Grenville\",\"Elora\",\"Vaudreuil-Dorion\",\"Lachute\",\"Saint-Basile-le-Grand\",\"Chateauguay\",\n\t\t\"Sainte-Sophie-d'Halifax\",\"Pointe-aux-Trembles\",\"Mont-Saint-Hilaire\",\"Otterburn Park\",\"Circonscription electorale d'Anjou\",\"Howick\",\"Pointe-Calumet\",\"La Pocatiere\",\"Ange-Gardien\",\"Saint Romuald\",\n\t\t\"Saint-Honore-de-Temiscouata\",\"Dollard-Des Ormeaux\",\"Sainte-Julie\",\"L'Epiphanie\",\"La Prairie\",\"Baie-D'Urfe\",\"Oka\",\"Saint-Jean-de-l'Ile-d'Orleans\",\"Beaupre\",\"Marieville\",\"Clarence-Rockland\",\"Contrecoeur\",\n\t\t\"Maniwaki\",\"Saint-Lin\",\"Lavaltrie\",\"Hampton\",\"Saint John\",\"Luskville\",\"Hudson\",\"Bruno\",\"Saint-Joachim-de-Shefford\",\"McMasterville\",\"Mercier\",\"Sainte-Julienne\",\"Saint-Antonin\",\"Tadoussac\",\"Chute-aux-Outardes\",\n\t\t\"Pointe-Lebel\",\"Beaconsfield\",\"Saint-Marc-sur-Richelieu\",\"Portneuf\",\"Farnham\",\"Saint-Venant-de-Paquette\",\"Vallee-Jonction\",\"Sutton\",\"Saint-Zacharie\",\"Lac-Megantic\",\"Brome\",\"Sainte-Cecile-de-Whitton\",\n\t\t\"Ormstown\",\"Stanbridge East\",\"Dudswell\",\"Saint-Elzear\",\"St. Catharines\",\"Callander\",\"Renfrew\",\"Gibsons\",\"Prince George\",\"Princeton\",\"Merritt\",\"Fort Nelson\",\"Mackenzie\",\"Roberts Creek\",\"Halfmoon Bay\",\"La Sarre\",\n\t\t\"Dupuy\",\"Notre-Dame-du-Nord\",\"Ville-Marie\",\"Temiscaming\",\"Macamic\",\"Massueville\",\"Saint-Hugues\",\"Malartic\",\"Bearn\",\"La Tuque\",\"Laverlochere\",\"Richmond\",\"St. Thomas\",\"Nepean\",\"Stewiacke\",\"Valley\",\"Westville\",\n\t\t\"Eureka\",\"Pictou\",\"Marystown\",\"Troy\",\"La Conception\",\"Middle Musquodoboit\",\"Hebron\",\"Cavendish\",\"Grono Road\",\"Jordan Falls\",\"Barrington Passage\",\"Barrington\",\"Crapaud\",\"Brigus\",\"Clarenville\",\"Blackville\",\n\t\t\"Scotsburn\",\"Hant's Harbour\",\"Carbonear\",\"Holyrood\",\"Cornwallis\",\"Black Diamond\",\"Trochu\",\"Three Hills\",\"Bonne Bay\",\"Fortune\",\"Morell\",\"Bridgetown\",\"Clementsvale\",\"Bear River\",\"Springdale\",\"Murray Harbour\",\n\t\t\"Seldom-Little Seldom\",\"Liverpool\",\"Port Medway\",\"Paradise Cove\",\"Victoria Cove\",\"Birchy Bay\",\"Gander\",\"Twillingate\",\"Burin\",\"St. Alban's\",\"West Lake\",\"Margaretsville\",\"Hampton\",\"Corner Brook\",\"Wainwright\",\n\t\t\"Daniel's Harbour\",\"Tusket\",\"Saulnierville\",\"Rockville\",\"Chester\",\"Baie Verte\",\"Happy Valley-Goose Bay\",\"Gambo\",\"Granville Ferry\",\"Western Bay\",\"Old Perlican\",\"Bay de Verde\",\n\t\t\"Circonscription electorale d'Outremont\",\"Bromont\",\"Victoriaville\",\"Acton Vale\",\"Valcourt\",\"Metabetchouan-Lac-a-la-Croix\",\"Wickham\",\"Warwick\",\"La Presentation\",\"Saint-Damase\",\"La Baie\",\"L'Anse-Saint-Jean\",\n\t\t\"Pont-Rouge\",\"Baie-Saint-Paul\",\"Mitchell\",\"Paisley\",\"Iroquois Falls\",\"Kirkland Lake\",\"Levack\",\"Omemee\",\"Pefferlaw\",\"Goderich\",\"Clinton\",\"Exeter\",\"Bayfield\",\"Prescott\",\"Berthierville\",\"Lakefield\",\"Cobourg\",\n\t\t\"Baltimore\",\"Port Hope\",\"Port Perry\",\"Kitimat\",\"Terrace\",\"Smithers\",\"Prince Rupert\",\"Roseneath\",\"Brandon\",\"Stittsville\",\"Norway House\",\"Winkler\",\"Port Colborne\",\"Noyan\",\"Fredericton\",\"Moncton\",\"Perth-Andover\",\n\t\t\"Tracadie–Sheila\",\"Miramichi\",\"Woodstock\",\"Edmundston\",\"Campbellton\",\"Bathurst\",\"Souris\",\"Coniston\",\"Saint-Quentin\",\"Plaster Rock\",\"Neguac\",\"Canterbury\",\"Rogersville\",\"Doaktown\",\"Lavillette\",\"Hartland\",\n\t\t\"Nackawic\",\"Pointe-Verte\",\"Dover\",\"Lewisporte\",\"Port Saunders\",\"Saint Fintan's\",\"L'Anse-au-Loup\",\"Deer Lake\",\"Grand Falls-Windsor\",\"Conception Bay South\",\"Hantsport\",\"Bay Bulls\",\"Dieppe\",\"Berry Mills\",\n\t\t\"Rothesay\",\"Quispamsis\",\"South Porcupine\",\"Haileybury\",\"Grand Bay–Westfield\",\"Timberlea\",\"Elmsdale\",\"Carters Cove\",\"Mira Gut\",\"Sable River\",\"Alberton\",\"Glace Bay\",\"New Waterford\",\"Portugal Cove\",\n\t\t\"Grand Falls\",\"Pouch Cove\",\"Sicamous\",\"Tappen\",\"Pritchard\",\"Pitt Meadows\",\"Fort St. John\",\"Onoway\",\"St. Albert\",\"Oyama\",\"Aldergrove\",\"Squamish\",\"Garibaldi\",\"Brackendale\",\"Trail\",\"Castlegar\",\"Hope\",\n\t\t\"Vanderhoof\",\"Fort St. James\",\"Lumby\",\"Sexsmith\",\"McLennan\",\"Peace River\",\"Grimshaw\",\"Beaverlodge\",\"Rycroft\",\"Irricana\",\"Turner Valley\",\"Bassano\",\"Innisfail\",\"Blackfalds\",\"Sylvan Lake\",\"Ponoka\"]\n\n\tprovinces = [\"AB\",\"BC\",\"MB\",\"NB\",\"NL\",\"NT\",\"NS\",\"NU\",\"ON\",\"PE\",\"QC\",\"SK\",\"YT\"]\n\tchars = (\"A\"..\"Z\").to_a\n\n\tfirst = first_names[rand(first_names.length)]\n\tlast = last_names[rand(last_names.length)]\n\tif rand(2) == 1 \n\t\tusr = User.new(first_name: first, last_name: last, email: \"#{first}_#{last}@example.com\", password:\"password\", password_confirmation: 'password')\n\t\tusr.add_role :employee\n\t\tusr.skip_confirmation!\n\t\tusr.save\n\telse\n\t\tcompany_name = company_names[rand(company_names.length)]\n\t\tusr = User.new(first_name: first, last_name: last, email: \"#{first}_#{last}@example.com\", password:\"password\", password_confirmation: 'password', \n\t\t\tcompany_name: company_name, company_address: (111 + rand(999)).to_s << \" \" << streets[rand(streets.length)], company_city: cities[rand(cities.length)], \n\t\t\tcompany_province: provinces[rand(provinces.length)], company_postal_code: chars[rand(chars.length)] << rand(9).to_s << chars[rand(chars.length)] << \" \" + rand(9).to_s << chars[rand(chars.length)] << rand(9).to_s)\n\t\tusr.add_role :employer\n\t\tusr.skip_confirmation!\n\t\tusr.save\n\tend\n\treturn usr\nend", "title": "" }, { "docid": "ded9cf92bba809b4bb49c0a7ac3fe169", "score": "0.49674943", "text": "def select_team(team_id: nil, team_name: nil)\n t_id = (team_id || ENV['FASTLANE_ITC_TEAM_ID'] || '').strip\n t_name = (team_name || ENV['FASTLANE_ITC_TEAM_NAME'] || '').strip\n\n if t_name.length > 0 && t_id.length.zero? # we prefer IDs over names, they are unique\n puts(\"Looking for App Store Connect Team with name #{t_name}\") if Spaceship::Globals.verbose?\n\n teams.each do |t|\n t_id = t['contentProvider']['contentProviderId'].to_s if t['contentProvider']['name'].casecmp(t_name).zero?\n end\n\n puts(\"Could not find team with name '#{t_name}', trying to fallback to default team\") if t_id.length.zero?\n end\n\n t_id = teams.first['contentProvider']['contentProviderId'].to_s if teams.count == 1\n\n if t_id.length > 0\n puts(\"Looking for App Store Connect Team with ID #{t_id}\") if Spaceship::Globals.verbose?\n\n # actually set the team id here\n self.team_id = t_id\n return self.team_id\n end\n\n # user didn't specify a team... #thisiswhywecanthavenicethings\n loop do\n puts(\"Multiple #{'App Store Connect teams'.yellow} found, please enter the number of the team you want to use: \")\n if ENV[\"FASTLANE_HIDE_TEAM_INFORMATION\"].to_s.length == 0\n puts(\"Note: to automatically choose the team, provide either the App Store Connect Team ID, or the Team Name in your fastlane/Appfile:\")\n puts(\"Alternatively you can pass the team name or team ID using the `FASTLANE_ITC_TEAM_ID` or `FASTLANE_ITC_TEAM_NAME` environment variable\")\n first_team = teams.first[\"contentProvider\"]\n puts(\"\")\n puts(\" itc_team_id \\\"#{first_team['contentProviderId']}\\\"\")\n puts(\"\")\n puts(\"or\")\n puts(\"\")\n puts(\" itc_team_name \\\"#{first_team['name']}\\\"\")\n puts(\"\")\n end\n\n # We're not using highline here, as spaceship doesn't have a dependency to fastlane_core or highline\n teams.each_with_index do |team, i|\n puts(\"#{i + 1}) \\\"#{team['contentProvider']['name']}\\\" (#{team['contentProvider']['contentProviderId']})\")\n end\n\n unless Spaceship::Client::UserInterface.interactive?\n puts(\"Multiple teams found on App Store Connect, Your Terminal is running in non-interactive mode! Cannot continue from here.\")\n puts(\"Please check that you set FASTLANE_ITC_TEAM_ID or FASTLANE_ITC_TEAM_NAME to the right value.\")\n raise \"Multiple App Store Connect Teams found; unable to choose, terminal not interactive!\"\n end\n\n selected = ($stdin.gets || '').strip.to_i - 1\n team_to_use = teams[selected] if selected >= 0\n\n if team_to_use\n self.team_id = team_to_use['contentProvider']['contentProviderId'].to_s # actually set the team id here\n return self.team_id\n end\n end\n end", "title": "" }, { "docid": "f43d2189208577b20a75f6c33ce5958c", "score": "0.49626505", "text": "def dire\n @dire ||= Team.new(raw_live_league['dire_team'])\n end", "title": "" }, { "docid": "9f54d1e53ef6db36a5454fa18b627274", "score": "0.49546126", "text": "def the_doctor\n fetch('dr_who.the_doctors')\n end", "title": "" }, { "docid": "96be91d9d92f8034b10954eceb78d096", "score": "0.49471176", "text": "def set_leagues_user\n @leagues_user = LeaguesUser.find(params[:id])\n end", "title": "" }, { "docid": "8b8ee75196ba1311ca7e381c9fae9eb9", "score": "0.49469203", "text": "def user_administrative_department(user)\n # which is the administrative department of a given user\n user.departments_members(:conditions => {:administrative_department => true}).first.department\nend", "title": "" }, { "docid": "cc1d54a1d4725f347be76cfbd298bcd1", "score": "0.49412516", "text": "def set_dentist\n @dentist = @current_brand.users.find(params[:id])\n end", "title": "" }, { "docid": "5dda8e86ae2e869500180041bfee1291", "score": "0.49348107", "text": "def show_by_twiki\n redirect_to :action => 'robots' if robot?\n host = get_http_host()\n if !(host.include?(\"info.sv.cmu.edu\") || host.include?(\"info.west.cmu.edu\")) && (current_user.nil?)\n flash[:error] = 'You don''t have permissions to view this data.'\n redirect_to(people_url)\n return\n end\n\n twiki_name = params[:twiki_name]\n @person = Person.find_by_twiki_name(twiki_name)\n\n if @person.nil?\n @person = Person.new\n @person.twiki_name = twiki_name\n names = Person.parse_twiki(twiki_name)\n @person.first_name = names[0] unless names.nil?\n @person.last_name = names[1] unless names.nil?\n @person.webiso_account = Time.now.to_f.to_s #This line probably not necessary since I added it to Person.before_validation\n @person.is_active = true\n @person.updated_by_user_id = current_user.id if current_user\n @person.image_uri = \"/images/mascot.jpg\"\n @person.local_near_remote = \"Unknown\"\n# @person.save\n @person.save_without_session_maintenance\n\n GenericMailer.deliver_email(\n :to => \"[email protected]\",\n :cc => \"[email protected]\",\n :subject => \"rails user account automatically created for #{twiki_name}\",\n :message => \"Action Required: update this user's andrew id in the rails database.<br/><br/>The twiki page for #{twiki_name} was rendered on the twiki server. This page asked rails to generate user data from the rails database. This user did not exist in the rails database, so rails created it.<br/>Note: this person can not edit their own information until their record is updated with their andrew login.<br/><br/>first_name: #{@person.first_name}<br/>last_name: #{@person.last_name}<br/>email: #{@person.email}<br/>is_active?: #{@person.is_active?}\",\n :url_label => \"Edit this person's information\",\n :url => \"http://rails.sv.cmu.edu\" + edit_person_path(@person)\n )\n\n end\n\n if(@person && @person.papers.size > 0 )\n @show_my_papers_link = true\n end\n\n respond_to do |format|\n if @person.nil?\n flash[:error] = \"Person #{params[:twiki_name]} is not in this system.\"\n format.html { redirect_to(people_url) }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n else\n format.html { render :html => @person, :layout => false }# show.html.erb\n format.xml { render :xml => @person }\n end\n end\n end", "title": "" }, { "docid": "c03e68e93bdf2cff5946d2bca7307e07", "score": "0.4931851", "text": "def find_fake_team(team_name)\n owner = Owner::TEAM_NAME_MAP.find do |o|\n o[:team_names].keys.include?(team_name.to_sym)\n end\n owner[:team_names][team_name.to_sym]\n end", "title": "" }, { "docid": "c03e68e93bdf2cff5946d2bca7307e07", "score": "0.4931851", "text": "def find_fake_team(team_name)\n owner = Owner::TEAM_NAME_MAP.find do |o|\n o[:team_names].keys.include?(team_name.to_sym)\n end\n owner[:team_names][team_name.to_sym]\n end", "title": "" }, { "docid": "4dba8a3c167a707f561c28ade8e4e27d", "score": "0.4923278", "text": "def set_dancer_team\n @dancer_team = DancerTeam.find(params[:id])\n end", "title": "" }, { "docid": "78add1c0aafd10bb1dcdbe37d1538df5", "score": "0.49202794", "text": "def create_account\n\tputs \"Please tell us your first name\"\n\tfirst_name = gets.chomp\n\n\tputs \"Please tell us your last_name\"\n\tlast_name = gets.chomp\n\n\tputs \"Please provide a username for login access\"\n\tloop do\n\tusername = gets.chomp\n\n\tif Adopter.find_by(username:username)\n\t\tputs \"We're sorry, that username already exists. Please try another\"\n\telse\n\t\tputs \"Thanks for joining!\"\n\t\tAdopter.create(username: username, first_name: first_name, last_name: last_name)\n\t\t# binding.pry\n\t\t$user = Adopter.all.last\n\t\tputs\n\t\t67.times do print \"*\" end\n\t\tputs\n\t\tputs\n\t\tputs \"To help us help you, please follow the following prompts:\"\n\t\tputs\n\t\t67.times do print \"*\" end\n\t\tputs\n\t\tputs\n\t\t#go through preferences\n\t\t$user.set_preferred_species\n\t\t$user.set_preferred_temperament\n\t\t$user.set_preferred_size\n\t\t$user.set_preferred_zip\n\t\t$user.present_options\n\t\tbreak\n\tend\n\tend\nend", "title": "" }, { "docid": "6fd77459406395331cb560ad10123da8", "score": "0.49194568", "text": "def getOtherPlayerName(user)\n if user.id == player1_id\n return User.find(player2_id).displayName\n end\n User.find(player1_id).displayName\n end", "title": "" }, { "docid": "fe7ce11757a02668bc6e30fff69045fd", "score": "0.49182636", "text": "def set_drop_team\n @drop_team = @current_user.teams.find(params[:id])\n end", "title": "" }, { "docid": "78da1aa205680fdf14230547cb5d4d64", "score": "0.49157783", "text": "def test_02_normaluser_donation()\n\tlogin(\"[email protected]\", \"123456\")\n\tsearchStory(\"Harvard College\")\n\tcreateFundraise(\"Harvard College\", \"FR3 for Harvard College\", \"Summary Part \", \"Story Part\", \n\t\"http://www.youtube.com/watch?v=HNVSI_r9SVg\" , \"With Designation\", \"11\", \"Suggested Description\",\n\t\"100\", \"link=31\")\nend", "title": "" }, { "docid": "0595b4468bbd4c070f59b763b8bb0b42", "score": "0.49157745", "text": "def test_pending_dues\n\t\tcreate_user_with_pending_dues(200, @@user_details)\n\n\t\tpending_dues = User.dues(@@user_details['name'])\n\t\tassert_equal(pending_dues, 200)\n\tend", "title": "" }, { "docid": "f7c7c3625b050a2be0b2741e73ed4521", "score": "0.49130645", "text": "def set_team_captain\n update_attributes(team_captain: users.first) if team_captain.nil? && !users.empty?\n end", "title": "" }, { "docid": "da8b196dc9d6886febf2bf6313722b44", "score": "0.49102852", "text": "def partner\n self.players.find_by_player_number(1).user\n end", "title": "" }, { "docid": "89e037aba1d71591a0163b7a54ac7765", "score": "0.49093795", "text": "def tongue_twister\n fetch('bojack_horseman.tongue_twisters')\n end", "title": "" }, { "docid": "6fb47dfd00c161afbe4a36cfd9d6b2f1", "score": "0.49092606", "text": "def test_create_team_manager\n buser = User.find_by_login \"mark\"\n assert_not_nil buser\n assert buser.team_admin?\n assert !buser.league_admin?\n assert !buser.scout_admin?\n end", "title": "" }, { "docid": "f3a2e28dc7d44f05f1c549ee739c0aeb", "score": "0.49078968", "text": "def opponent_for(user)\n self.player1_id == user.id ? self.player2 : self.player1\n end", "title": "" }, { "docid": "e669b753100ee26d15130ab961354979", "score": "0.49057707", "text": "def tutors_for_dow (desired_dow)\n tutors = Set.new []\n\n Slot.find_each do |slot|\n tutor = slot.tutor\n next if tutors.include? tutor\n current_dow = slot.start_time.strftime('%a')\n if @requires_availability\n tutors.add tutor if (current_dow == desired_dow && tutor.slots.any?)\n else\n tutors.add tutor if (current_dow == desired_dow)\n end\n end\n\n tutors.to_a()\n end", "title": "" }, { "docid": "64e46a1d6f35c7266bf8b53bf47c4ac7", "score": "0.4902689", "text": "def set_duser\n @duser = Duser.find(params[:id])\n end", "title": "" }, { "docid": "64e46a1d6f35c7266bf8b53bf47c4ac7", "score": "0.4902689", "text": "def set_duser\n @duser = Duser.find(params[:id])\n end", "title": "" }, { "docid": "64e46a1d6f35c7266bf8b53bf47c4ac7", "score": "0.4902689", "text": "def set_duser\n @duser = Duser.find(params[:id])\n end", "title": "" }, { "docid": "e895f540e560ff5f2677c902065b88dd", "score": "0.49013406", "text": "def lookup_name(user, site)\n if site.data['contributors'].key?(user)\n site.data['contributors'][user].fetch('name', user)\n else\n user\n end\nend", "title": "" }, { "docid": "fe80cb36a5f9e47e575844bda64c42fb", "score": "0.49003226", "text": "def find_or_create_participant(project_id, user_id)\n participant = Participant.where(:project_id => project_id, :user_id => user_id).first\n if participant.nil?\n # You can add someone to a project simply by assigning him a todo.\n participant = Participant.create(:project_id => project_id, :user_id => user_id)\n end\n participant\n end", "title": "" }, { "docid": "2ec75ab96a1370ddd000bad5d5e7d600", "score": "0.48959738", "text": "def set_team\n # Find preselected team if user logged in and associated to a swimmer\n # and the team associated to actual season_type\n if current_user && current_user.swimmer\n swimmer = current_user.swimmer\n @team = swimmer.teams.joins(:badges).where(['badges.season_id = ?', @season.id]).first\n end\n end", "title": "" }, { "docid": "456bd616796234a68d4b960fa986a775", "score": "0.48929727", "text": "def pick_username(ideal)\n name = ideal\n i = 0\n\n while user_exists?(name)\n i += 1\n name = \"#{ideal}_#{i}\"\n end\n\n name\n end", "title": "" }, { "docid": "3eca1382d4bbda75b18e8da1a9be73ea", "score": "0.48925874", "text": "def auditor_name(section_id, teammate_list, lead)\n teammate = teammate_list.detect { |tmate| tmate.section_id == section_id }\n if teammate\n teammate.user.name\n else\n lead.name\n end\n end", "title": "" }, { "docid": "fa41bd2ab5a338ff949292f0938694cb", "score": "0.4890941", "text": "def find_or_create_swim_meet\n puts \"Please enter the name of Swim Meet or if you don't have one pick a name of your Swim meet\"\n input = gets.chomp.capitalize()\n swim_meet_name = SwimMeet.find_or_create_by(name: input)\n\n puts \"\\n<--Coach-->\\n\"\n if swim_meet_name.coach_id == nil\n coach_name = find_coach\n swim_meet_name.coach = coach_name\n swim_meet_name.coach.save!\n coach_name.swim_meets.push(swim_meet_name)\n puts \"\\nSwim Meet: #{swim_meet_name.name}, Coach ID: #{swim_meet_name.coach_id}, Coach Name: #{swim_meet_name.coach.name} \\n\"\n else \n puts \"\\nSwim Meet: #{swim_meet_name.name}, Coach ID: #{swim_meet_name.coach_id}, Coach Name: #{swim_meet_name.coach.name}\\n\"\n end \n\n puts \"\\n\\n<--Student-->\\n\"\n if swim_meet_name.student_id == nil\n student_name = find_student\n swim_meet_name.student = student_name\n swim_meet_name.student.save!\n student_name.swim_meets.push(swim_meet_name) \n puts \"\\nSwim Meet: #{swim_meet_name.name}, Coach Name: #{swim_meet_name.coach.name}, Student ID: #{swim_meet_name.student_id}, Student Name: #{swim_meet_name.student.name}\\n\"\n else \n puts \"\\nSwim Meet: #{swim_meet_name.name}, Coach Name: #{swim_meet_name.coach.name}, Student ID: #{swim_meet_name.student_id}, Student Name: #{swim_meet_name.student.name}\\n\"\n\n end\n puts \"\\nReturn the menu? Press any key to return the menu\"\n gets.chomp\n coach\n end", "title": "" }, { "docid": "b5d115f7d6330ed5f69a2b18d2110b1b", "score": "0.48893818", "text": "def name_to_display(user, team)\n return user.name if current_user.owner?(team) || current_user == user\n user.anonymous_id\n end", "title": "" }, { "docid": "57125cafad04cb33bfe1fe9d5a8cec7f", "score": "0.48888054", "text": "def ask_for_team_name(user)\n puts \"What do you what to name your team?\"\n your_team = gets.chomp\n return Team.create(team_name: your_team, user_id: user.id)\nend", "title": "" }, { "docid": "a89f95d0daa1b5f7fc1cf959780173aa", "score": "0.48744005", "text": "def get_user(users, user_id)\n user_who_wrote_review = Hash.new\n users.each do |user|\n if user.id == user_id\n user_who_wrote_review = user\n break\n end\n end\n return user_who_wrote_review\n end", "title": "" }, { "docid": "58e5708ced769baf48ab33dc65f61b90", "score": "0.48732018", "text": "def set_besteacher\n @besteacher = Besteacher.find(params[:id])\n end", "title": "" }, { "docid": "578ba38341b96f0fbbce387886107d8f", "score": "0.48688778", "text": "def default_department\n Department.find_by_id(default_dept) || (user.departments.empty? ? nil : user.departments.first)\n end", "title": "" }, { "docid": "3108a5aeefb820c2947fda0eaf9c252a", "score": "0.48645616", "text": "def propeller_twist\n dinucleotide_lookup(@@PROPELLER)\n end", "title": "" }, { "docid": "7bc18fdaf2cf52c7d8fcbd096d235d78", "score": "0.48619267", "text": "def set_user_practitioner\n @user_practitioner = UserPractitioner.find(params[:id])\n end", "title": "" }, { "docid": "84694e1d35713f665c3c06b9ab4905db", "score": "0.48614508", "text": "def dund\n @degreecourses = Degree.all\n @dund = Degree.where(:uname => \"University of Dundee\").all\nend", "title": "" }, { "docid": "1cc4a5daa3cfc11bdfa6f1fb3489964b", "score": "0.48563957", "text": "def same_teacher_required\n unless @current_user == User.find(:first, :conditions => [\"specified_type = 'Teacher' AND specified_id = (?)\", params[:id]])\n flash[:error] = \"Non puoi modificare un utente diverso dal tuo\"\n redirect_to timetables_url\n end\n end", "title": "" }, { "docid": "e37d42eb42ccd36aa0dc39bc32f359a1", "score": "0.48554042", "text": "def team\n @solution = Solution.find_by_crossword_id_and_key(params[:id], params[:key])\n if @crossword && @solution\n @team = true\n @cells = @crossword.cells.asc_indices\n if @current_user\n SolutionPartnering.find_or_create_by(solution_id: @solution.id, user_id: @current_user.id) unless (@solution.user == @current_user)\n end\n render :show\n else\n #some sort of error\n end\n end", "title": "" }, { "docid": "9aaa357629f55db5a098346071b7f5aa", "score": "0.4851326", "text": "def test_white_list_approved_profanity_in_names\n # Step 1\n opts = {\n 'first_name' => 'hookr',\n 'last_name' => 'Hooker'\n }\n\n @user = TurtleUser.new(opts)\n turtle_response = @user.register\n assert_response(turtle_response, :success)\n turtle_response = @user.login\n assert_response(turtle_response, :success)\n assert(@user.id, turtle_response.body)\n\n @user.login_oauth\n refute_nil(@user.oauth_token, 'oauth_token is missing!')\n\n get_user_info(@user.oauth_token)\n assert_equal(opts['first_name'], @parsed_response['first_name'], @parsed_response)\n assert_equal(opts['last_name'], @parsed_response['last_name'], @parsed_response)\n assert_equal('Hookr H.', @parsed_response['display_name'], @parsed_response)\n\n # Step 2\n params = {\n 'user' => {\n 'first_name' => 'Hooker',\n 'user_name' => 'hooker'\n }\n }\n\n put \"/usr/#{@user.cookie_id}\", params\n assert_response(@response, :success)\n assert_equal(@user.cookie_id, @parsed_response['cookie_id'], @parsed_response)\n assert_equal(params['user']['first_name'], @parsed_response['first_name'], @parsed_response)\n assert_equal('Hooker H.', @parsed_response['display_name'], @parsed_response)\n assert_equal(params['user']['user_name'], @parsed_response['user_name'], @parsed_response)\n end", "title": "" }, { "docid": "7463f894b0d697179a6ef5230a7b9e91", "score": "0.4847544", "text": "def national_committee\n \t@users = User.find_all_by_national_committee(true)\n end", "title": "" }, { "docid": "c26724475818870654ccf834af0830bf", "score": "0.48473746", "text": "def create_empty_user\n signing_up_as_dance_studio? ? @dance_studio = DanceStudio.new : @dancer = Dancer.new\n end", "title": "" }, { "docid": "73ecbc2cb55f9c89242aa1ffed2caeea", "score": "0.4845891", "text": "def other_participant(current_user)\n current_user.id == mentor_id ? mentee : mentor\n end", "title": "" }, { "docid": "088af88942f2166a58fa0c0bc61195cf", "score": "0.48457465", "text": "def set_users\n @giver = User.where(slack_id: karma_params[:slack_id_giver]).first_or_create\n @receiver = User.where(slack_id: karma_params[:slack_id_receiver]).first_or_create\n @karma = karma_params[:karma]\n end", "title": "" }, { "docid": "18e2a73cfa30d6433a53dd65e986ca28", "score": "0.4845464", "text": "def user_made\n @nytimes_user = User.find_by_username('nytimes')\n @user_puzzles = Crossword.where.not(user_id: @nytimes_user.id)\n end", "title": "" }, { "docid": "cc2503780ffee49b24452a62c5803742", "score": "0.484488", "text": "def enter_teammate\n Printer.prompt(\"Enter a teammate pick\")\n\n input = check_for_duplicates(ShortFind.object(Hero.all))\n return if !input\n\n @draft.withheroes << input\n end", "title": "" } ]
0bf2704dcb8daf0dbba6c62fda817676
lexer rule lpar! (LPAR) (in Hephaestus.g)
[ { "docid": "84b4593d63765b661783fca9d770de00", "score": "0.7796226", "text": "def lpar!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 41 )\n\n\n\n type = LPAR\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 83:7: '('\n match( 0x28 )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 41 )\n\n\n end", "title": "" } ]
[ { "docid": "e28ff289ad793f52a137a8a2c7feac34", "score": "0.7948812", "text": "def lpar!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 5 )\n\n type = LPAR\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 13:8: '('\n match( 0x28 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 5 )\n\n end", "title": "" }, { "docid": "5ed97334a71750feeb5f7c4825459344", "score": "0.73309636", "text": "def rpar!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n\n type = RPAR\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 14:8: ')'\n match( 0x29 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n end", "title": "" }, { "docid": "fa1d6078ac965dda00fc642108b2b1af", "score": "0.7292677", "text": "def rpar!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 43 )\n\n\n\n type = RPAR\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 85:7: ')'\n match( 0x29 )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 43 )\n\n\n end", "title": "" }, { "docid": "66b6524379203a7f71eddf3dd765b1af", "score": "0.68440944", "text": "def lp!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 14)\n\n type = LP\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 356:5: '('\n match(?()\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 14)\n\n end", "title": "" }, { "docid": "d00df91a221872792de927ac3dd446be", "score": "0.67881703", "text": "def lp!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 45 )\n\n\n\n type = LP\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 122:5: '('\n match( 0x28 )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 45 )\n\n\n end", "title": "" }, { "docid": "4b41bfb3f7128b57699a8f795e0e6167", "score": "0.66613245", "text": "def open_par!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 8)\n\n type = OPEN_PAR\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 45:14: '('\n match(?()\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 8)\n\n end", "title": "" }, { "docid": "c5887dc3a85849b641d465d315abcd6a", "score": "0.65009713", "text": "def continue_lex(string, &b); end", "title": "" }, { "docid": "e750bfa377c742d24aa1f724a7f21cce", "score": "0.6497658", "text": "def continue_lex(*a, &b); end", "title": "" }, { "docid": "4bf714b1db26df5825b239de9ccce0ba", "score": "0.63310295", "text": "def lb!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 41 )\n\n type = LB\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 418:6: '('\n match( 0x28 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 41 )\n\n end", "title": "" }, { "docid": "fd1302708bc5ae826358bb8384d63e69", "score": "0.62985194", "text": "def langle!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 107 )\n\n\n\n type = LANGLE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 267:10: '<'\n match( 0x3c )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 107 )\n\n\n end", "title": "" }, { "docid": "dafc404a6d983b07106dae92a8b008a9", "score": "0.6258122", "text": "def tilde!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 106 )\n\n\n\n type = TILDE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 266:9: '~'\n match( 0x7e )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 106 )\n\n\n end", "title": "" }, { "docid": "a31665535ad69b4a4f95ffcc62dba933", "score": "0.62509257", "text": "def t__65!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 43)\n\n type = T__65\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 49:9: '!'\n match(?!)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 43)\n\n end", "title": "" }, { "docid": "05653a9b916e40b1275616bf9cb6b4ed", "score": "0.6216912", "text": "def tilde!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n type = TILDE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 174:9: '~'\n match( 0x7e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 35 )\n\n end", "title": "" }, { "docid": "cb99dc494b18ce0f40c3322dffee711f", "score": "0.62152916", "text": "def lparen!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 102 )\n\n\n\n type = LPAREN\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 262:10: '('\n match( 0x28 )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 102 )\n\n\n end", "title": "" }, { "docid": "c7caa68689721edba1e0f7bd445b08e7", "score": "0.619931", "text": "def le!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 60 )\n\n type = LE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 439:6: '<='\n match( \"<=\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 60 )\n\n end", "title": "" }, { "docid": "4bc95db0d95a5d4f4f6894ae2330e968", "score": "0.61761624", "text": "def t__90!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n type = T__90\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 41:9: '.'\n match( 0x2e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 35 )\n\n end", "title": "" }, { "docid": "8198fff12c673490b2389c96f09125f2", "score": "0.6142172", "text": "def rp!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 44 )\n\n\n\n type = RP\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 121:5: ')'\n match( 0x29 )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 44 )\n\n\n end", "title": "" }, { "docid": "67038407d501b785a2fdef8dca397075", "score": "0.61332995", "text": "def lparen!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 7 )\n\n type = LPAREN\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 27:10: '('\n match( 0x28 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 7 )\n\n end", "title": "" }, { "docid": "45159f20986aac2319bbd07ea1f261b0", "score": "0.6127267", "text": "def t__31!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 11 )\n\n type = T__31\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 20:9: ';'\n match( 0x3b )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 11 )\n\n end", "title": "" }, { "docid": "3b38c7ec7b3cd6a1be816d9a1213f4e1", "score": "0.6125322", "text": "def t__79!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 57)\n\n type = T__79\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 63:9: '|'\n match(?|)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 57)\n\n end", "title": "" }, { "docid": "d62c0b6e09dab022b9eb673ad743731d", "score": "0.6112975", "text": "def t__44!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 22)\n\n type = T__44\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 28:9: ':'\n match(?:)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 22)\n\n end", "title": "" }, { "docid": "746527e8fad10921ab4af5248ff450ad", "score": "0.6099307", "text": "def t__11!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 1)\n\n type = T__11\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 7:9: ';'\n match(?;)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 1)\n\n end", "title": "" }, { "docid": "2bf6d8bfe99ccaae44fed8aee3109bd1", "score": "0.60981953", "text": "def close_par!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 9)\n\n type = CLOSE_PAR\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 46:14: ')'\n match(?))\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 9)\n\n end", "title": "" }, { "docid": "6da1efca7e834729ae8402bdb178586f", "score": "0.60909", "text": "def t__29!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 9 )\n\n type = T__29\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 18:9: ')'\n match( 0x29 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 9 )\n\n end", "title": "" }, { "docid": "b428df990bc41510447af9b43269ba37", "score": "0.60620314", "text": "def t__39!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 31 )\n\n type = T__39\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 37:9: '-'\n match(0x2d)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 31 )\n\n end", "title": "" }, { "docid": "de3ca1918ce6e1565f7b90c29417a584", "score": "0.60560256", "text": "def semi!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 96 )\n\n\n\n type = SEMI\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 256:8: ';'\n match( 0x3b )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 96 )\n\n\n end", "title": "" }, { "docid": "cd019db0c7d7d99f519b75ceacc952bd", "score": "0.6055242", "text": "def not!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 64 )\n\n type = NOT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 444:7: '!'\n match( 0x21 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 64 )\n\n end", "title": "" }, { "docid": "63a1407b50f0274789c2a95b1045fe95", "score": "0.605376", "text": "def lt!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 26 )\n\n\n\n type = LT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 82:5: '<'\n match( 0x3c )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 26 )\n\n\n end", "title": "" }, { "docid": "3264b6789590f05617c100650e208bd8", "score": "0.60493785", "text": "def t__98!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 76)\n\n type = T__98\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 82:9: 'continue'\n match(\"continue\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 76)\n\n end", "title": "" }, { "docid": "f8690fd87b3ab4fc2132999cb5107324", "score": "0.60470414", "text": "def t__43!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 35 )\n\n type = T__43\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 41:9: '\\\\''\n match(0x27)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 35 )\n\n end", "title": "" }, { "docid": "80fb71afdd7d2d8b1663278208bcff77", "score": "0.60376346", "text": "def lt!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 2)\n\n type = LT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 341:5: '<'\n match(?<)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 2)\n\n end", "title": "" }, { "docid": "1dee70bf344c53594264e45e1301d15d", "score": "0.60308444", "text": "def le!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 5)\n\n type = LE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 344:5: '<='\n match(\"<=\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 5)\n\n end", "title": "" }, { "docid": "aca684c1ea39d3bde6b4fdef4b6a0be4", "score": "0.60229254", "text": "def pipeline_operator!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 10)\n\n type = PIPELINE_OPERATOR\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 49:3: ( '&&' | '||' | '|' | '&' )\n alt_14 = 4\n look_14_0 = @input.peek(1)\n\n if (look_14_0 == ?&) \n look_14_1 = @input.peek(2)\n\n if (look_14_1 == ?&) \n alt_14 = 1\n else\n alt_14 = 4\n end\n elsif (look_14_0 == ?|) \n look_14_2 = @input.peek(2)\n\n if (look_14_2 == ?|) \n alt_14 = 2\n else\n alt_14 = 3\n end\n else\n nvae = NoViableAlternative(\"\", 14, 0)\n raise nvae\n end\n case alt_14\n when 1\n # at line 49:5: '&&'\n match(\"&&\")\n\n when 2\n # at line 49:12: '||'\n match(\"||\")\n\n when 3\n # at line 49:19: '|'\n match(?|)\n\n when 4\n # at line 49:25: '&'\n match(?&)\n # --> action\n @cmd_start = true \n # <-- action\n\n end\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 10)\n\n end", "title": "" }, { "docid": "e83369fb24c553431ca55a18d90890fe", "score": "0.6022135", "text": "def lbrace!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 49 )\n\n\n\n type = LBRACE\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 128:9: '{'\n match( 0x7b )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 49 )\n\n\n end", "title": "" }, { "docid": "bcaa2a1e5732dd4b8c5a8f0f61ed1ae7", "score": "0.60208625", "text": "def star!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 100 )\n\n\n\n type = STAR\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 260:8: '*'\n match( 0x2a )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 100 )\n\n\n end", "title": "" }, { "docid": "39a9a53af0a08f80bbd39c6ab29d9f14", "score": "0.60180026", "text": "def lt!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 22 )\n\n type = LT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 160:6: '<'\n match( 0x3c )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 22 )\n\n end", "title": "" }, { "docid": "226db3b8c2ad825878a9b310e2591e31", "score": "0.60148406", "text": "def mod!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 34 )\n\n\n\n type = MOD\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 94:6: '%'\n match( 0x25 )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 34 )\n\n\n end", "title": "" }, { "docid": "94b58f44390be989771213c73cd1821a", "score": "0.59985626", "text": "def lexes_cleanly?(lexer); end", "title": "" }, { "docid": "93d6267323ab3a779578baa158ad4c44", "score": "0.59974194", "text": "def lt!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 58 )\n\n type = LT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 437:6: '<'\n match( 0x3c )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 58 )\n\n end", "title": "" }, { "docid": "90162e2f2d8b0bf20c57ad289141835d", "score": "0.59970886", "text": "def t__93!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 38 )\n\n type = T__93\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 44:9: '$'\n match( 0x24 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 38 )\n\n end", "title": "" }, { "docid": "ed564c35370e8ab34811dc6d07886a9e", "score": "0.59826785", "text": "def mod!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 5 )\n\n type = MOD\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 25:7: '%'\n match( 0x25 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 5 )\n\n end", "title": "" }, { "docid": "e15eec513fe2b0f2b9cecc0dbd1630d9", "score": "0.5982103", "text": "def t__29!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 21 )\n\n type = T__29\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 27:9: '%'\n match(0x25)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 21 )\n\n end", "title": "" }, { "docid": "04d3873868f43b1a990f557f65c12962", "score": "0.5979777", "text": "def rp!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 15)\n\n type = RP\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 357:5: ')'\n match(?))\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 15)\n\n end", "title": "" }, { "docid": "a54f3856f83c814ca07810a9aa61fc09", "score": "0.59751505", "text": "def t__34!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 26 )\n\n type = T__34\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 32:9: '~'\n match(0x7e)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 26 )\n\n end", "title": "" }, { "docid": "425502ab6fa28e121e874f5b4574f7f4", "score": "0.597265", "text": "def mod!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 55 )\n\n type = MOD\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 433:7: '%'\n match( 0x25 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 55 )\n\n end", "title": "" }, { "docid": "b243fa59a39f39c6d051b2cfaf84da00", "score": "0.5968736", "text": "def t__59!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 37)\n\n type = T__59\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 43:9: '--'\n match(\"--\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 37)\n\n end", "title": "" }, { "docid": "fa21a98ebefdf415cd184176f474ef63", "score": "0.5953081", "text": "def t__42!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 25 )\n\n type = T__42\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 33:9: ';'\n match( 0x3b )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 25 )\n\n end", "title": "" }, { "docid": "d64bfefb6eea0e5fbed230700c1db364", "score": "0.5951843", "text": "def rb!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 42 )\n\n type = RB\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 419:6: ')'\n match( 0x29 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 42 )\n\n end", "title": "" }, { "docid": "125eb01d6b43301da20a37d81b790660", "score": "0.59493935", "text": "def t__40!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 20 )\n\n type = T__40\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 29:9: '.'\n match( 0x2e )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 20 )\n\n end", "title": "" }, { "docid": "643ae1d2af38b75fe9cda22c47985634", "score": "0.5947111", "text": "def t__34!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 14 )\n\n type = T__34\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 23:9: ','\n match( 0x2c )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 14 )\n\n end", "title": "" }, { "docid": "29d980c3a8b0fb570db533d8ffb51986", "score": "0.59409386", "text": "def t__39!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 19 )\n\n type = T__39\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 28:9: '='\n match( 0x3d )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 19 )\n\n end", "title": "" }, { "docid": "b34683cba82befba3cb45f33671fba8c", "score": "0.592962", "text": "def t__43!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 26 )\n\n type = T__43\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 34:9: ':'\n match( 0x3a )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 26 )\n\n end", "title": "" }, { "docid": "d186ccd6751d1907646c2bb07d78849f", "score": "0.59285897", "text": "def mult!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 32 )\n\n\n\n type = MULT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 92:7: '*'\n match( 0x2a )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 32 )\n\n\n end", "title": "" }, { "docid": "6154ae1798528847fdadf7f457e0b253", "score": "0.59252715", "text": "def token!\n # at line 1:39: ( QUOTED_STRING | SL_COMMENT | ML_COMMENT | SQL_SEPARATOR )\n alt_14 = 4\n case look_14 = @input.peek( 1 )\n when 0x27, 0x6e then alt_14 = 1\n when 0x2d then alt_14 = 2\n when 0x2f then alt_14 = 3\n when 0xa, 0x3b then alt_14 = 4\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n raise NoViableAlternative( \"\", 14, 0 )\n end\n case alt_14\n when 1\n # at line 1:41: QUOTED_STRING\n quoted_string!\n\n when 2\n # at line 1:55: SL_COMMENT\n sl_comment!\n\n when 3\n # at line 1:66: ML_COMMENT\n ml_comment!\n\n when 4\n # at line 1:77: SQL_SEPARATOR\n sql_separator!\n\n end\n end", "title": "" }, { "docid": "f39aea7330917e98823dfab5fd07ef18", "score": "0.5919318", "text": "def t__40!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 18)\n\n type = T__40\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 24:9: '{'\n match(?{)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 18)\n\n end", "title": "" }, { "docid": "244edcc325cfb64f84000f1cdee100d2", "score": "0.59173346", "text": "def t__11!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 3 )\n\n type = T__11\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 9:9: ';'\n match(0x3b)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 3 )\n\n end", "title": "" }, { "docid": "f7dce41042bbad4de33fbdcb4e2e0edc", "score": "0.5911219", "text": "def leq!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 26 )\n\n\n\n type = LEQ\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 60:6: '<='\n match( \"<=\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 26 )\n\n\n end", "title": "" }, { "docid": "5db3ae0e8de0b6af77fd96615cdf863d", "score": "0.5908347", "text": "def t__83!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 28 )\n\n type = T__83\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 34:9: ')'\n match( 0x29 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 28 )\n\n end", "title": "" }, { "docid": "c75d26018082d5764d8448d5fd342ce3", "score": "0.590493", "text": "def leq!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 27 )\n\n\n\n type = LEQ\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 83:6: '<='\n match( \"<=\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 27 )\n\n\n end", "title": "" }, { "docid": "3db1850e0d19512c6b5de63cede86228", "score": "0.5903815", "text": "def t__77!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 55)\n\n type = T__77\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 61:9: '||'\n match(\"||\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 55)\n\n end", "title": "" }, { "docid": "cf0c91137261e093e8654d69839e67b2", "score": "0.59036946", "text": "def t__24!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 2)\n\n type = T__24\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 8:9: ';'\n match(?;)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 2)\n\n end", "title": "" }, { "docid": "72dc4218aa970b535cd26eb4322793d7", "score": "0.5903383", "text": "def mult!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 28 )\n\n\n\n type = MULT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 62:7: '*'\n match( 0x2a )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 28 )\n\n\n end", "title": "" }, { "docid": "879c5dad3d4773ccac55711b5494ea16", "score": "0.5902709", "text": "def t__41!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 19)\n\n type = T__41\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 25:9: '}'\n match(?})\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 19)\n\n end", "title": "" }, { "docid": "56069afa3c7731e94cbe858fc7bc698f", "score": "0.5895528", "text": "def lb!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 46 )\n\n\n\n type = LB\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 123:5: '['\n match( 0x5b )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 46 )\n\n\n end", "title": "" }, { "docid": "18463bd1cd13c10815a56bf3a3e010ab", "score": "0.589171", "text": "def lexinit\n $buf = ''\n $nexttoken = ''\n $line = 1\nend", "title": "" }, { "docid": "b75304115337e44c38549e98b18a3daf", "score": "0.5882333", "text": "def t__80!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 25 )\n\n type = T__80\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 31:9: ','\n match( 0x2c )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 25 )\n\n end", "title": "" }, { "docid": "8582613f1872fdebcf1f0f2536b4f9d6", "score": "0.5877287", "text": "def ident!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 115 )\n\n\n\n type = IDENT\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 275:9: ( LETTER | '_' ) ( LETTER | DIGIT | '_' )*\n if @input.peek( 1 ).between?( 0x41, 0x5a ) || @input.peek(1) == 0x5f || @input.peek( 1 ).between?( 0x61, 0x7a )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n # at line 275:25: ( LETTER | DIGIT | '_' )*\n while true # decision 1\n alt_1 = 2\n look_1_0 = @input.peek( 1 )\n\n if ( look_1_0.between?( 0x30, 0x39 ) || look_1_0.between?( 0x41, 0x5a ) || look_1_0 == 0x5f || look_1_0.between?( 0x61, 0x7a ) )\n alt_1 = 1\n\n end\n case alt_1\n when 1\n # at line \n if @input.peek( 1 ).between?( 0x30, 0x39 ) || @input.peek( 1 ).between?( 0x41, 0x5a ) || @input.peek(1) == 0x5f || @input.peek( 1 ).between?( 0x61, 0x7a )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n\n end\n\n\n\n else\n break # out of loop for decision 1\n end\n end # loop for decision 1\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 115 )\n\n\n end", "title": "" }, { "docid": "ce8fb5367d18493c133e0f5e8bcff530", "score": "0.58662635", "text": "def t__10!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n\n type = T__10\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 8:9: ';'\n match( 0x3b )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 2 )\n\n end", "title": "" }, { "docid": "95d4d89e8e03fbc9abefcdef312b032f", "score": "0.58643043", "text": "def t__80!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 58)\n\n type = T__80\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 64:9: '^'\n match(?^)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 58)\n\n end", "title": "" }, { "docid": "02f4d0502b89631f88fedd214c79ee0c", "score": "0.58563495", "text": "def t__122!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 83 )\n\n\n\n type = T__122\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 89:10: 'skip'\n match( \"skip\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 83 )\n\n\n end", "title": "" }, { "docid": "b4ab7a88b79221c852dfce835281f10c", "score": "0.585258", "text": "def t__91!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 36 )\n\n type = T__91\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 42:9: '?'\n match( 0x3f )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 36 )\n\n end", "title": "" }, { "docid": "d5fbfa56266cf3cebee59f081ddc35c8", "score": "0.58274", "text": "def sl_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n\n type = SL_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 150:5: '--' (~ ( '\\\\n' | '\\\\r' ) )* ( '\\\\r' )? '\\\\n'\n match( \"--\" )\n # at line 150:10: (~ ( '\\\\n' | '\\\\r' ) )*\n while true # decision 3\n alt_3 = 2\n look_3_0 = @input.peek( 1 )\n\n if ( look_3_0.between?( 0x0, 0x9 ) || look_3_0.between?( 0xb, 0xc ) || look_3_0.between?( 0xe, 0xffff ) )\n alt_3 = 1\n\n end\n case alt_3\n when 1\n # at line 0:0: ~ ( '\\\\n' | '\\\\r' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 3\n end\n end # loop for decision 3\n # at line 150:24: ( '\\\\r' )?\n alt_4 = 2\n look_4_0 = @input.peek( 1 )\n\n if ( look_4_0 == 0xd )\n alt_4 = 1\n end\n case alt_4\n when 1\n # at line 0:0: '\\\\r'\n match( 0xd )\n\n end\n match( 0xa )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 2 )\n\n end", "title": "" }, { "docid": "d34f4cf02f6844191b0ffdc23c6bbe55", "score": "0.58270633", "text": "def t__49!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 27)\n\n type = T__49\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 33:9: ')'\n match(?))\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 27)\n\n end", "title": "" }, { "docid": "f925ee582136c3d69cc1eb207b1e98b1", "score": "0.5826633", "text": "def synpred239_Plsql\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 606 )\n\n # at line 486:9: cursor_loop_param\n @state.following.push( TOKENS_FOLLOWING_cursor_loop_param_IN_synpred239_Plsql_3114 )\n cursor_loop_param\n @state.following.pop\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 606 )\n\n end", "title": "" }, { "docid": "45dfdcfeefc5ff9373da2a8951fc3f6c", "score": "0.58227223", "text": "def sl_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 14 )\n\n type = SL_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 134:4: '--' (~ ( '\\\\n' | '\\\\r' ) )* ( '\\\\r' )? '\\\\n'\n match( \"--\" )\n # at line 134:9: (~ ( '\\\\n' | '\\\\r' ) )*\n while true # decision 4\n alt_4 = 2\n look_4_0 = @input.peek( 1 )\n\n if ( look_4_0.between?( 0x0, 0x9 ) || look_4_0.between?( 0xb, 0xc ) || look_4_0.between?( 0xe, 0xffff ) )\n alt_4 = 1\n\n end\n case alt_4\n when 1\n # at line 134:9: ~ ( '\\\\n' | '\\\\r' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 4\n end\n end # loop for decision 4\n # at line 134:23: ( '\\\\r' )?\n alt_5 = 2\n look_5_0 = @input.peek( 1 )\n\n if ( look_5_0 == 0xd )\n alt_5 = 1\n end\n case alt_5\n when 1\n # at line 134:23: '\\\\r'\n match( 0xd )\n\n end\n match( 0xa )\n # --> action\n channel=HIDDEN;\n # <-- action\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 14 )\n\n end", "title": "" }, { "docid": "0e541b5407f579c544db0f522cb161d7", "score": "0.58201206", "text": "def t__58!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 36)\n\n type = T__58\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 42:9: '++'\n match(\"++\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 36)\n\n end", "title": "" }, { "docid": "1a214bb2493190aee8bee802cb0b345a", "score": "0.58154255", "text": "def token!\n # at line 1:8: ( PLUS | MINUS | MULT | DIV | MOD | EXP | LPAREN | RPAREN | T__19 | INT | FLOAT | MODVAR | UNMODVAR | WHITESPACE )\n alt_3 = 14\n alt_3 = @dfa3.predict( @input )\n case alt_3\n when 1\n # at line 1:10: PLUS\n plus!\n\n when 2\n # at line 1:15: MINUS\n minus!\n\n when 3\n # at line 1:21: MULT\n mult!\n\n when 4\n # at line 1:26: DIV\n div!\n\n when 5\n # at line 1:30: MOD\n mod!\n\n when 6\n # at line 1:34: EXP\n exp!\n\n when 7\n # at line 1:38: LPAREN\n lparen!\n\n when 8\n # at line 1:45: RPAREN\n rparen!\n\n when 9\n # at line 1:52: T__19\n t__19!\n\n when 10\n # at line 1:58: INT\n int!\n\n when 11\n # at line 1:62: FLOAT\n float!\n\n when 12\n # at line 1:68: MODVAR\n modvar!\n\n when 13\n # at line 1:75: UNMODVAR\n unmodvar!\n\n when 14\n # at line 1:84: WHITESPACE\n whitespace!\n\n end\n end", "title": "" }, { "docid": "488d1ef72e797d8a93589280de27aaba", "score": "0.5814053", "text": "def t__63!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 41)\n\n type = T__63\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 47:9: '&'\n match(?&)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 41)\n\n end", "title": "" }, { "docid": "bfb76d55ba73cd9d99b47f1c950ec649", "score": "0.5804546", "text": "def mult!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 3 )\n\n type = MULT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 11:8: '*'\n match( 0x2a )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 3 )\n\n end", "title": "" }, { "docid": "60f95d9a449b28bd59ba4e7b417bc796", "score": "0.579057", "text": "def mult!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 3 )\n\n type = MULT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 23:8: '*'\n match( 0x2a )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 3 )\n\n end", "title": "" }, { "docid": "53bd7820fe37cc9577b049c5af4a30b3", "score": "0.5771318", "text": "def bar!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 111 )\n\n\n\n type = BAR\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 271:7: '|'\n match( 0x7c )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 111 )\n\n\n end", "title": "" }, { "docid": "ed1e923be99d48f306f1b19724bbd10f", "score": "0.57698816", "text": "def t__71!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 16 )\n\n type = T__71\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 22:9: ';'\n match( 0x3b )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 16 )\n\n end", "title": "" }, { "docid": "476496705cbd91ca2aaa6b2a6c90d5c0", "score": "0.5769777", "text": "def t__12!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 4 )\n\n type = T__12\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 10:9: 'not'\n match( \"not\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 4 )\n\n end", "title": "" }, { "docid": "7d5e72c81d21878b1c56b24f8f871474", "score": "0.5767937", "text": "def ml_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 40 )\n\n type = ML_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 469:4: '/*' ( . )* '*/'\n match( \"/*\" )\n # --> action\n if @input.peek(1) == ?* then type = DOC_COMMENT else channel = HIDDEN end \n # <-- action\n # at line 469:88: ( . )*\n while true # decision 4\n alt_4 = 2\n look_4_0 = @input.peek( 1 )\n\n if ( look_4_0 == 0x2a )\n look_4_1 = @input.peek( 2 )\n\n if ( look_4_1 == 0x2f )\n alt_4 = 2\n elsif ( look_4_1.between?( 0x0, 0x2e ) || look_4_1.between?( 0x30, 0xffff ) )\n alt_4 = 1\n\n end\n elsif ( look_4_0.between?( 0x0, 0x29 ) || look_4_0.between?( 0x2b, 0xffff ) )\n alt_4 = 1\n\n end\n case alt_4\n when 1\n # at line 469:88: .\n match_any\n\n else\n break # out of loop for decision 4\n end\n end # loop for decision 4\n match( \"*/\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 40 )\n\n end", "title": "" }, { "docid": "2a830ac3989544168b9bf57135c58279", "score": "0.57675004", "text": "def t__35!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 13)\n\n type = T__35\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 19:9: 'long'\n match(\"long\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 13)\n\n end", "title": "" }, { "docid": "8de8afbdd78a151a0e16d579fc3ff897", "score": "0.5764133", "text": "def lsthe!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 12 )\n\n type = LSTHE\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 20:9: '<='\n match( \"<=\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 12 )\n\n end", "title": "" }, { "docid": "136f95c26c373cc8372bf509e13151c0", "score": "0.57634234", "text": "def sl_comment!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 2 )\n\n type = SL_COMMENT\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 58:5: '--' (~ ( '\\\\n' | '\\\\r' ) )* ( '\\\\r' )? ( '\\\\n' | EOF )\n match( \"--\" )\n # at line 58:10: (~ ( '\\\\n' | '\\\\r' ) )*\n while true # decision 3\n alt_3 = 2\n look_3_0 = @input.peek( 1 )\n\n if ( look_3_0.between?( 0x0, 0x9 ) || look_3_0.between?( 0xb, 0xc ) || look_3_0.between?( 0xe, 0xffff ) )\n alt_3 = 1\n\n end\n case alt_3\n when 1\n # at line 58:10: ~ ( '\\\\n' | '\\\\r' )\n if @input.peek( 1 ).between?( 0x0, 0x9 ) || @input.peek( 1 ).between?( 0xb, 0xc ) || @input.peek( 1 ).between?( 0xe, 0xff )\n @input.consume\n else\n @state.backtracking > 0 and raise( ANTLR3::Error::BacktrackingFailed )\n\n mse = MismatchedSet( nil )\n recover mse\n raise mse\n end\n\n\n\n else\n break # out of loop for decision 3\n end\n end # loop for decision 3\n # at line 58:24: ( '\\\\r' )?\n alt_4 = 2\n look_4_0 = @input.peek( 1 )\n\n if ( look_4_0 == 0xd )\n alt_4 = 1\n end\n case alt_4\n when 1\n # at line 58:24: '\\\\r'\n match( 0xd )\n\n end\n # at line 58:30: ( '\\\\n' | EOF )\n alt_5 = 2\n look_5_0 = @input.peek( 1 )\n\n if ( look_5_0 == 0xa )\n alt_5 = 1\n else\n alt_5 = 2\n end\n case alt_5\n when 1\n # at line 58:31: '\\\\n'\n match( 0xa )\n\n when 2\n # at line 58:38: EOF\n match( ANTLR3::EOF )\n\n\n end\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 2 )\n\n end", "title": "" }, { "docid": "8791909cb510750566bdff09157cd993", "score": "0.57584035", "text": "def t__86!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 31 )\n\n type = T__86\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 37:9: '=>'\n match( \"=>\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 31 )\n\n end", "title": "" }, { "docid": "f056f4aa833984355030fdfa0459f700", "score": "0.5756838", "text": "def t__41!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 21 )\n\n type = T__41\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 30:9: 'this'\n match( \"this\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 21 )\n\n end", "title": "" }, { "docid": "2263432ea663c181d62f4ea60ca9f81d", "score": "0.57405984", "text": "def t__67!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 12 )\n\n type = T__67\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 18:9: 'lexer'\n match( \"lexer\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 12 )\n\n end", "title": "" }, { "docid": "e82b1fc0916d1392c6c93fc170824937", "score": "0.5730305", "text": "def t__25!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 3)\n\n type = T__25\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 9:9: ','\n match(?,)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 3)\n\n end", "title": "" }, { "docid": "3b7f7a05a4e95cf49708f3e8b70443dd", "score": "0.572823", "text": "def lsth!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 10 )\n\n type = LSTH\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 18:8: '<'\n match( 0x3c )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 10 )\n\n end", "title": "" }, { "docid": "100268d2d27e8e1bd66d9c7705c0f3b3", "score": "0.5719021", "text": "def t__33!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 13 )\n\n type = T__33\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 22:9: ']'\n match( 0x5d )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 13 )\n\n end", "title": "" }, { "docid": "744582728d18e1db47687b54eed7bfb8", "score": "0.5716621", "text": "def lexer_error_tokenizer\n /\\s*\\S*/n\n end", "title": "" }, { "docid": "3a07fa6baddf3248ddf169438a248907", "score": "0.5709633", "text": "def t__26!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 4)\n\n type = T__26\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 10:9: '='\n match(?=)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 4)\n\n end", "title": "" }, { "docid": "404ef7078880f3782e135e11e39ddae0", "score": "0.57021934", "text": "def rb!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 47 )\n\n\n\n type = RB\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 124:5: ']'\n match( 0x5d )\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 47 )\n\n\n end", "title": "" }, { "docid": "7dcf1e47c1be542ccf5532eb1c2c6af3", "score": "0.57008207", "text": "def t__26!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 6 )\n\n type = T__26\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 15:9: 'void'\n match( \"void\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 6 )\n\n end", "title": "" }, { "docid": "a07dcd6b696de1c3ff43c71e7d688157", "score": "0.5698458", "text": "def t__28!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 20 )\n\n type = T__28\n channel = ANTLR3::DEFAULT_CHANNEL\n\n\n # - - - - main rule block - - - -\n # at line 26:9: '@'\n match(0x40)\n\n\n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 20 )\n\n end", "title": "" }, { "docid": "1d6dab9f9ddb801d38a2cad96f25e22a", "score": "0.5695233", "text": "def t__18!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 8 )\n\n type = T__18\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 14:9: 'PROCEDURE'\n match( \"PROCEDURE\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 8 )\n\n end", "title": "" }, { "docid": "e191346fcf8da921cd08ec72cc03b55c", "score": "0.5693447", "text": "def t__57!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 35)\n\n type = T__57\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 41:9: '%'\n match(?%)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 35)\n\n end", "title": "" } ]
2d779c961b99882da41899e369e195a0
Replaces the existing method definition, if there is one, with the passed block as its body.
[ { "docid": "a934aebb964e9d33d252da6120a5fbd5", "score": "0.5928495", "text": "def redefine_method(method, &block)\n visibility = method_visibility(method)\n remove_possible_method(method)\n define_method(method, &block)\n\n # The following line doesn't work as expected when overriding private methods as public\n # Example: Define a rails scope named #public, which is also a private method on every ruby class.\n # This will override #public (which is a private method), making the new method private again,\n # but we don't want that, since scopes should be public\n # send(visibility, method)\n end", "title": "" } ]
[ { "docid": "ff457cb94601b4982be98084e7ddb51a", "score": "0.6770566", "text": "def redefine_method(method, &block); end", "title": "" }, { "docid": "ff457cb94601b4982be98084e7ddb51a", "score": "0.6770566", "text": "def redefine_method(method, &block); end", "title": "" }, { "docid": "ff457cb94601b4982be98084e7ddb51a", "score": "0.6770566", "text": "def redefine_method(method, &block); end", "title": "" }, { "docid": "b93c0aef56a070ec28d21a92b7014c1c", "score": "0.66892904", "text": "def redefine_method(method, &block)\n remove_possible_method(method)\n define_method(method, &block)\n end", "title": "" }, { "docid": "34ddcfaaa09c6f49e774395d9b35f58a", "score": "0.66045934", "text": "def wrapping_block(method_name, **defaults); end", "title": "" }, { "docid": "34ddcfaaa09c6f49e774395d9b35f58a", "score": "0.66045934", "text": "def wrapping_block(method_name, **defaults); end", "title": "" }, { "docid": "0c18c8b67008c4eeeeeec0edc6416361", "score": "0.64164704", "text": "def on_method_add_block(method, block)\n method.block = block\n\n return method\n end", "title": "" }, { "docid": "85ef96421a15ee50c840f9ad1f1e6a08", "score": "0.62884486", "text": "def replace(name, options={}, &block)\n blocks[name.to_sym] = nil\n self.define_block_container(name, options, &block)\n nil\n end", "title": "" }, { "docid": "85ef96421a15ee50c840f9ad1f1e6a08", "score": "0.62884486", "text": "def replace(name, options={}, &block)\n blocks[name.to_sym] = nil\n self.define_block_container(name, options, &block)\n nil\n end", "title": "" }, { "docid": "8ec24a919573b65d5ec456a9147bf585", "score": "0.62174076", "text": "def redefine_method(method, &block)\n visibility = method_visibility(method)\n silence_redefinition_of_method(method)\n define_method(method, &block)\n send(visibility, method)\n end", "title": "" }, { "docid": "d76a95d6b52216ea74f4f97db0c6871c", "score": "0.6213153", "text": "def body(method = nil, &block)\n if block_given? || method\n @body = block_given? ? block : method\n end\n @body\n end", "title": "" }, { "docid": "96bcff861520c85fe0b7511c90020bf2", "score": "0.62076855", "text": "def define_body(&block)\n @body_block = block\n end", "title": "" }, { "docid": "567daf94f8154ffc8a2c1ba727da1e74", "score": "0.61828727", "text": "def MethodAddBlock(call, block, location = Location.default)\n MethodAddBlock.new(call: call, block: block, location: location)\n end", "title": "" }, { "docid": "eeea569ed4b8fa8631cd83ff420f2f45", "score": "0.61724657", "text": "def define_method_taking_block(name, &method_body_proc)\n self.class.send :define_method, \"__quirky_bird_helper_#{name}__\", &method_body_proc\n\n eval <<-EOM\n def #{name}(a_value, &a_proc)\n __quirky_bird_helper_#{name}__(a_value, a_proc)\n end\n EOM\n \n puts <<-METHOD\n def #{name}(a_value, &a_proc)\n #{method_body_proc.source}\n __quirky_bird_helper_#{name}__(a_value, a_proc)\n end\n\n\n METHOD\nend", "title": "" }, { "docid": "9b7fbadfb98b421b3f12e709a9aa579a", "score": "0.61666226", "text": "def body(method = nil, &block)\n\n if block_given? || method\n\n @body = block_given? ? block : method\n\n end\n\n @body\n\n end", "title": "" }, { "docid": "7275df02b27a36d967b7f9e1542c3dfb", "score": "0.61193746", "text": "def define_method(name, &block)\n return add_child_method(name, :method, &block)\n end", "title": "" }, { "docid": "ddc953f003fd9ef3ce3f524d5afe1305", "score": "0.6118034", "text": "def define_method(name, &block)\n return add_child_method(:method, name, &block)\n end", "title": "" }, { "docid": "8527874752f2a7b6113eaaa035b1e6c5", "score": "0.6066975", "text": "def replace(name, content=nil, &block)\n content = capture(&block) if block_given?\n add_instruction_to_area(name, :replace, [content])\n nil\n end", "title": "" }, { "docid": "371ed5746c83896fb9541f15ccb0b1c4", "score": "0.6037921", "text": "def def(name, &block)\n @defined_methods[name.to_s] = block\n end", "title": "" }, { "docid": "833f73e52aa7a7ca0d16b0313c02c8e7", "score": "0.603487", "text": "def on_block(node)\n node = super\n send, args, body = *node\n args = nil if !args.nil? && args.children.empty? && args.loc.expression.nil?\n node.updated(nil, [send, args, body])\n end", "title": "" }, { "docid": "f8fa663de79a03732fe14d7b21d10a1f", "score": "0.6034053", "text": "def def(name, &block)\n @runtime_methods[name.to_s] = block\n end", "title": "" }, { "docid": "f8fa663de79a03732fe14d7b21d10a1f", "score": "0.6034053", "text": "def def(name, &block)\n @runtime_methods[name.to_s] = block\n end", "title": "" }, { "docid": "395c0398ecdad1ca81c4ff6e6f9dfb5f", "score": "0.5954426", "text": "def override(name, &block)\n current = Module.new\n method = instance_method(name)\n current.send(:define_method, name) do |*args|\n method.bind(self).call(*args[0...method.arity])\n end\n \n include current\n define_method(name, &block)\n end", "title": "" }, { "docid": "a9632de2d47b7fcb7e9094e0087fcd1b", "score": "0.59125143", "text": "def without_module_patch(mod, method_name)\n method_body = mod.instance_method(method_name)\n mod.remove_method(method_name)\n yield if block_given?\n ensure\n mod.define_method(method_name, method_body)\n end", "title": "" }, { "docid": "f18728c7802f3c44c739f4afc5a791ad", "score": "0.5911514", "text": "def def(name, &block)\n\t\t@runtime_methods[name.to_s] = block\n\tend", "title": "" }, { "docid": "2a6293ac45bbe105352e534c3d8313ac", "score": "0.58446765", "text": "def redefine_singleton_method(method, &block); end", "title": "" }, { "docid": "2a6293ac45bbe105352e534c3d8313ac", "score": "0.58446765", "text": "def redefine_singleton_method(method, &block); end", "title": "" }, { "docid": "2a6293ac45bbe105352e534c3d8313ac", "score": "0.58446765", "text": "def redefine_singleton_method(method, &block); end", "title": "" }, { "docid": "1ba7fa75a933353732c3f16ff280c088", "score": "0.5844585", "text": "def wrap_method(name, &block)\n existing = self.instance_method(name)\n\n define_method name do |*args|\n instance_exec(*args, existing ? existing.bind(self) : nil, &block)\n end\n end", "title": "" }, { "docid": "80f690d288eee31f24f2c9d10ffe08be", "score": "0.5806575", "text": "def process(method_id_or_description, &blk)\n append(:process, method_id_or_description, &blk)\n end", "title": "" }, { "docid": "9622b9f7396c180ddac6720846f3bce8", "score": "0.57811254", "text": "def block(params, optionals, rest_params, params_after_rest, keywords,\n rest_of_keywords, block_param, body)\n raise NotImplementedError.new('block')\n end", "title": "" }, { "docid": "90baaea80f1e6b5ddf6d57532aba4179", "score": "0.576164", "text": "def meth_with_block(hello, &block)\n p hello\n block.call(\"eg\")\nend", "title": "" }, { "docid": "7d8015f735634d760223a2f292ed0a16", "score": "0.57571185", "text": "def define name, &block\n define_method(name, &block)\n end", "title": "" }, { "docid": "e9e68edd4c2a1654b3b100b9b3f18375", "score": "0.57470924", "text": "def method_block(&block)\n block.call\nend", "title": "" }, { "docid": "0651d537f6dd0f5678eacae19bf7aee0", "score": "0.5737939", "text": "def add_method(name,&ruby_block)\n # puts \"add_method with name=#{name} and parameters=#{ruby_block.parameters}\"\n unless name.empty? then\n if RESERVED.include?(name.to_sym) then\n raise AnyError, \n \"Resevered name #{name} cannot be overridden.\"\n end\n # Deactivated: overriding is now accepted.\n # if self.respond_to?(name) then\n # raise AnyError,\n # \"Symbol #{name} is already defined.\"\n # end\n define_singleton_method(name,&ruby_block) \n end\n end", "title": "" }, { "docid": "62428c984c8d988f96480334fd736848", "score": "0.5733179", "text": "def compile_method block, source, options\n body_block = CompiledBlock.new\n body_block.name = source['name']\n\n # Arguments & default values\n args = source['args']\n args.data_matchers.each do |matcher|\n body_block.add_instr [GET, 'args', matcher.index, 'default']\n body_block.add_instr [DEF_MEMBER, matcher.name, 'default']\n end\n\n compile_ body_block, source['body'], options\n body_block.add_instr [CALL_END]\n\n @mod.add_block body_block\n\n # Create a function object and store in namespace/scope\n block.add_instr [METHOD, source['name'], body_block.id]\n end", "title": "" }, { "docid": "4d3c6351074c634bd0d3f974a0dd62e6", "score": "0.5727886", "text": "def define_method(name, &block)\n (class << self; self; end).__send__(:define_method, &block)\n end", "title": "" }, { "docid": "df757504886c432f3ee4e7384fd75e07", "score": "0.5650995", "text": "def MethodAddBlock(call, block, location = T.unsafe(nil)); end", "title": "" }, { "docid": "0e3cdcb89c84e693b575d11e25e02be4", "score": "0.56461954", "text": "def rewrite_block(exp)\n add_junk_methods(add_junk_calls(exp))\n exp\n end", "title": "" }, { "docid": "a17a283d6587253a20c820f20210e2f0", "score": "0.5645282", "text": "def def_instruct(receiver, name, args, body, opts = {})\n opts = {value: false}.merge(opts)\n body.scope = current_scope\n block, new_proc = create_block_temporary(args, body)\n new_proc.line_number = opts[:line_number]\n new_proc.annotations = body.parent.comment.annotation_map if body.parent.comment\n call_instruct(receiver, 'define_method', name, block, raise: false)\n const_instruct(nil) if opts[:value]\n end", "title": "" }, { "docid": "63c85b8a71149eb263f8e938b872c19b", "score": "0.5621875", "text": "def body(&block)\n @body = block\n self\n end", "title": "" }, { "docid": "826f3c35abd12615d0fb3c979b0bada1", "score": "0.5609571", "text": "def override_method(obj, method_name, &block)\n # Get the singleton class/eigenclass for 'obj'\n klass = class << obj; self; end\n\n # Undefine the old method (using 'send' since 'undef_method' is protected)\n klass.send(:undef_method, method_name)\n\n # Create the new method\n klass.send(:define_method, method_name, block)\n end", "title": "" }, { "docid": "05fc32b13a9ad399a4b839f8988beddf", "score": "0.5603013", "text": "def block_methods(*methods)\n methods.each do |method|\n self.class.class_eval <<-EOT\n def #{method}(*name, &block)\n blockify(\"#{method}\".apachify, name, &block)\n end\n EOT\n end\n end", "title": "" }, { "docid": "c14299560c57f523bfee3982522914b8", "score": "0.55771613", "text": "def set_method (a_method, a_block)\n #Van a necesitar un Hash para poder obtener el bloque a partir del nombre del metodo\n self.bloques << [a_method,a_block]\n self.singleton_class.send(:define_method,a_method,&a_block)\n\n self.interested.each { |interesado|\n if !interesado.implements_own?(a_method) then\n interesado.create_proto_ref_method(a_method, self.method(a_method).arity)\n end\n }\n end", "title": "" }, { "docid": "77642950ce0461029302b1bb22a529ca", "score": "0.55750847", "text": "def meta_def(name, &method_body)\n meta_eval do\n define_method(name) { |*args, &block| method_body.call(*args, &block) }\n end\n end", "title": "" }, { "docid": "192f00d5cdf8c75ba84b21e7ce64bbdc", "score": "0.5566353", "text": "def on_method_add_block(call, block); end", "title": "" }, { "docid": "aaea2496a88e0c2fbda72bc13d1c93b2", "score": "0.5526503", "text": "def define_block(name, &block)\n @blocks[name.to_sym] = block\n nil\n end", "title": "" }, { "docid": "49590357c7172924c7ac7ae61cd9d312", "score": "0.5518771", "text": "def visit_method_add_block(node)\n visit(node.call)\n with_scope(current_scope) { visit(node.block) }\n end", "title": "" }, { "docid": "6d3738604debef204dfcb73e21f65366", "score": "0.5518305", "text": "def define_method_taking_block(name, &method_body_proc)\n self.class.send :define_method, \"__cardinal_helper_#{name}__\", method_body_proc\n eval <<-EOM\n def #{name}(a_value, &a_proc)\n __cardinal_helper_#{name}__(a_value, a_proc)\n end\n EOM\nend", "title": "" }, { "docid": "92ce2b9e05d0e8693d85ee75af7e3d82", "score": "0.5516303", "text": "def block=(block)\n @block = block\n parse_block!\n end", "title": "" }, { "docid": "24e006e0dbbb050584b18411527bd1e5", "score": "0.55096984", "text": "def add_update(&block)\n @update_method = block\n end", "title": "" }, { "docid": "3508e1de66cd8392d241dc9fdf867fe8", "score": "0.5508512", "text": "def crazy_method(&block)\n another_crazy_method block\nend", "title": "" }, { "docid": "3478c1d4f65e30ddb7ae1816fb9895ef", "score": "0.54853475", "text": "def visit_method_add_block(node)\n node.copy(call: visit(node.call), block: visit(node.block))\n end", "title": "" }, { "docid": "803bc469fad675b72a78d13a3b74d63d", "score": "0.54760885", "text": "def method_block_example(&block)\n block.call 'hello world'\n yield 'hello world'\nend", "title": "" }, { "docid": "3fcc8ee5ea7340546e32ac1fd8c03b6b", "score": "0.5470423", "text": "def replace &block\n @rules = []\n update(&block)\n end", "title": "" }, { "docid": "52c47896e42248fe37625795e6853e5b", "score": "0.54703724", "text": "def my_method(&my_block)\n \n puts \"hello method\"\n\n my_block.call\n\n return my_block\n\nend", "title": "" }, { "docid": "456e1946da2d1a9cf311d7bfb4593ed7", "score": "0.5454211", "text": "def definition_methods(&block); end", "title": "" }, { "docid": "0c0eba0a7da0ecd50c883957f72f2819", "score": "0.5446005", "text": "def trigger!(klass, method_name)\n block = const_get(CONST_EXECUTION_BLOCK) rescue nil\n raise ExecuteBlockWasNotDefined, \"You must define execute block in your #{self.name}\" unless block\n block.call(klass, method_name)\n end", "title": "" }, { "docid": "c8d2f1621d4edf2b30c96530bc001c4f", "score": "0.5443852", "text": "def create_method(name, &block)\n\t\t\tself.class.send(:define_method, name, &block)\n\t\tend", "title": "" }, { "docid": "a943fba1cecdc3e9e9bb36abd965df08", "score": "0.5443733", "text": "def foo(&block); end", "title": "" }, { "docid": "eed0c8ccec77cad7f9a8006f983fefcf", "score": "0.5431285", "text": "def replace_with(replacement = nil, &block)\n raise ArgumentError, 'Cannot replace with both data and block' if replacement && block\n\n @replacement = replacement || block || default_replacement\n end", "title": "" }, { "docid": "059c97c7b4d22d59736a64c5c84a82ab", "score": "0.54293704", "text": "def define_block(name, &block)\n blocks[name.to_sym] = block\n nil\n end", "title": "" }, { "docid": "0ef22c14b78615d6b96e48773a3e714a", "score": "0.54289573", "text": "def generate_method(method_name, block)\n method_name = method_name.to_sym\n define_method(method_name, &block)\n method = instance_method(method_name)\n remove_method(method_name)\n method\n end", "title": "" }, { "docid": "aaee605f60a4befb17616ca85e4b6ba7", "score": "0.5422586", "text": "def set_block!(&block)\n set!(_prepare_block(block))\n self\n end", "title": "" }, { "docid": "c4bb08029a9b26bf51c4299aece95e3b", "score": "0.5416083", "text": "def block(&_block)\n @_block = _block\n end", "title": "" }, { "docid": "3b1641ef5321bb1b7547901f467842a9", "score": "0.5413724", "text": "def to_method(body)\n mod = Module.new {\n define_method(:dummy, body)\n }\n mod.instance_method(:dummy).bind(body.binding.receiver)\n end", "title": "" }, { "docid": "fc2caf817b1949ba76369b870568f026", "score": "0.5409923", "text": "def create_method( name, &block )\n self.class.send( :define_method, name, &block )\n end", "title": "" }, { "docid": "e26f952d35aa682cbf85d7c9c3e6cdd3", "score": "0.5409826", "text": "def generate_snake_method_body(api, options, &def_block)\n if def_block\n if options[:fails]\n ->(*args, &block){ (res = def_block.(api, *args, &block)) == options[:fails] ? nil: res }\n elsif options[:boolean]\n ->(*args, &block){ def_block.(api, *args, &block) != 0 }\n else\n ->(*args, &block){ def_block.(api, *args, &block) }\n end\n else\n if options[:fails]\n ->(*args, &block){ (res = block ? block[api.call(*args)] : api.call(*args)) == options[:fails] ? nil : res }\n elsif options[:boolean]\n ->(*args, &block){ block ? block[api.call(*args)] : api.call(*args) != 0 }\n else\n ->(*args, &block){ block ? block[api.call(*args)] : api.call(*args) }\n end\n end\n end", "title": "" }, { "docid": "84cc16f27e4c7b873daa31dbe5b4a0a6", "score": "0.5409002", "text": "def stub(method_name, &block); end", "title": "" }, { "docid": "2529cc8ea2c619f53213ca505c46ef46", "score": "0.54026294", "text": "def define_instance_method( name, *blocks, &block )\n blocks << block if block\n blocks.compact! if blocks.first.nil?\n\n #\n # Because this is a class-level function, the user's blocks don't have an object context, and \n # we need to give them one. In order to do this, we must convert the blocks to methods, so we \n # can bind them to the object when called. The same goes for any wrapper method we create. \n # In order to avoid polluting the namespace, we just use the method name each time, replacing \n # each existing method with the block version, and than with a wrapper method that calls them\n # both, by way of variables. Note: because of this last bit (the use of variables to hold the\n # different versions, we can't eliminate the tail recursion, as we need a separate \"copy\" of\n # the variables for each wrapper.\n\n current_method = nil\n if blocks.first === true then\n blocks.shift\n begin; current_method = instance_method(name) ; rescue Exception ; end\n end\n\n send( :define_method, name, &(blocks.shift) )\n\n if current_method then\n block_method = instance_method( name )\n send( :define_method, name ) do |*args|\n current_method.bind(self).call(*args)\n block_method.bind(self).call(*args)\n end \n end\n \n define_instance_method( name, true, *blocks ) unless blocks.empty?\n end", "title": "" }, { "docid": "c6904bfc097240899686e2941c469bb9", "score": "0.5395338", "text": "def call_with_explicit_block(block_arg_bindings, block_sexp)\n body_block = create_block\n body_value, body_proc = create_block_temporary block_arg_bindings, block_sexp, @current_block\n call_instruct(body_value, :lexical_self=, self_instruct, raise: false, value: false)\n @graph.add_edge(@current_block, body_block,\n ControlFlowGraph::EDGE_BLOCK_TAKEN | ControlFlowGraph::EDGE_ABNORMAL)\n result = yield(body_value)\n after = @current_block # new block caused by method call\n block_exit = build_block_exit_block body_block, after\n body_proc.exit_block = block_exit\n walk_block_body block_arg_bindings, body_block, block_exit, block_sexp, after\n start_block after\n result\n end", "title": "" }, { "docid": "e0db56940d6e62135943ea1a9eb83700", "score": "0.538678", "text": "def block=(_); end", "title": "" }, { "docid": "e0db56940d6e62135943ea1a9eb83700", "score": "0.538678", "text": "def block=(_); end", "title": "" }, { "docid": "e0db56940d6e62135943ea1a9eb83700", "score": "0.538678", "text": "def block=(_); end", "title": "" }, { "docid": "e0db56940d6e62135943ea1a9eb83700", "score": "0.538678", "text": "def block=(_); end", "title": "" }, { "docid": "e0db56940d6e62135943ea1a9eb83700", "score": "0.538678", "text": "def block=(_); end", "title": "" }, { "docid": "9681a59372647cc8e8fc8344e0585ca6", "score": "0.5385114", "text": "def replace(selector, content = nil, &block)\n @commands[:replace] ||= {}\n content ||= yield\n @commands[:replace][selector] = content\n end", "title": "" }, { "docid": "689de5ed54b70f6433e4301027343755", "score": "0.5371782", "text": "def override_existing_method(method_name)\n sclass.class_eval <<-EOS\n def #{method_name}(*args, &block)\n method_missing(:#{method_name}, *args, &block)\n end\n EOS\n end", "title": "" }, { "docid": "52deaf95579029396421b70c70d2b439", "score": "0.53701735", "text": "def rewrite_block(exp)\n # Take the leading atom (:block) of the s-expression, we'll put it back\n # on before returning. This way, the rotate independent code doesn't\n # have to worry about the leading atom for the original sexp.\n atom = exp.shift\n \n # Preserve the return statement – in ruby the last statement\n # is always the returned value. It cannot necessarily be\n # re-ordered.\n return_exp = exp.pop\n \n # Rotate the remaining statements and then replace the original\n # atom and return s-expressions.\n rotate_independent(exp).unshift(atom).push(return_exp)\n end", "title": "" }, { "docid": "005fc5bde08ce2aba0c601de36220af9", "score": "0.5368399", "text": "def block=(block)\n @block = block\n end", "title": "" }, { "docid": "005fc5bde08ce2aba0c601de36220af9", "score": "0.5368399", "text": "def block=(block)\n @block = block\n end", "title": "" }, { "docid": "8e968c485260416e508eb2e4e1eb348a", "score": "0.5364047", "text": "def modify(&block)\n\t\t\t@modify = block\n\t\tend", "title": "" }, { "docid": "36ba8516b944ab5f71461a31eeb1a26b", "score": "0.5334848", "text": "def visit_method_add_block(node); end", "title": "" }, { "docid": "36ba8516b944ab5f71461a31eeb1a26b", "score": "0.5334848", "text": "def visit_method_add_block(node); end", "title": "" }, { "docid": "d8a9b9ef8acef74ce1bad488e5adbd31", "score": "0.53237784", "text": "def method_missing(meth, *args, &block)\n @body.__send__(meth, *args, &block)\n end", "title": "" }, { "docid": "80acff80362cd63cd8f17e4437da8156", "score": "0.53199065", "text": "def scaffold_define_method(name, &block)\n scaffolded_methods.add(name)\n\n define_method(name) do |*args|\n scaffold_check_nonidempotent_requests\n request.params['id'] = args.shift if args.length > 0\n instance_eval(&block)\n end\n end", "title": "" }, { "docid": "8e37153defd3ca265df424e88edd8d99", "score": "0.5312629", "text": "def replace! method, context\n (class << self; self; end).class_eval{ define_method(method.name.to_s.gsub(\"#{context}_\",\"\"), method) }\n end", "title": "" }, { "docid": "269720477af539ed9ca8c9df1dd2197d", "score": "0.5311804", "text": "def existing_method clazz, method_name, meta, &block\n return if redefined?(clazz, method_name, &block)\n\n old_method = Validator.validate_existing_definition clazz, method_name\n Validator.validate_method_arity clazz, method_name, old_method, &block\n Validator.validate_decoration_meta clazz, method_name, old_method, meta\n\n old_method\n end", "title": "" }, { "docid": "8791d1f6f0df85e3f8d602ecb3a3b5e3", "score": "0.53077525", "text": "def on_method_add_block(call, block)\n location = call.location.to(block.location)\n\n case call\n when Break, Next, ReturnNode\n parts = call.arguments.parts\n\n node = parts.pop\n copied =\n node.copy(block: block, location: node.location.to(block.location))\n\n copied.comments.concat(call.comments)\n parts << copied\n\n call.copy(location: location)\n when Command, CommandCall\n node = call.copy(block: block, location: location)\n node.comments.concat(call.comments)\n node\n else\n MethodAddBlock.new(call: call, block: block, location: location)\n end\n end", "title": "" }, { "docid": "cf410807794ffc7d55ea2a7b8be0009e", "score": "0.5301628", "text": "def after(method,&block)\n unbound = @klass.instance_method(method)\n @klass.class_eval do\n define_method(method) do |*outer_args|\n block.call(self, *unbound.bind(self).call(*outer_args))\n end\n end\n end", "title": "" }, { "docid": "76dbce492590b516cadcccb959759d64", "score": "0.52996826", "text": "def implementation(&block)\n @implementation_block = block\n end", "title": "" }, { "docid": "eb11379565819d22e52e62391fb70dcd", "score": "0.52972925", "text": "def dsl_method(name_, delegate_=nil)\n name_ = name_.to_sym\n if delegate_\n delegate_ = delegate_.to_sym\n elsif delegate_.nil?\n delegate_ = name_\n end\n @_blockenspiel_methods[name_] = delegate_\n unless @_blockenspiel_module.public_method_defined?(name_)\n @_blockenspiel_module.module_eval(\"def #{name_}(*params_, &block_); val_ = ::Blockenspiel._target_dispatch(self, :#{name_}, params_, block_); ::Blockenspiel::NO_VALUE.equal?(val_) ? super(*params_, &block_) : val_; end\\n\")\n end\n end", "title": "" }, { "docid": "041fe0fb2cb150ae8988e4f9a54aba30", "score": "0.5292687", "text": "def alter(&block); end", "title": "" }, { "docid": "041fe0fb2cb150ae8988e4f9a54aba30", "score": "0.5292687", "text": "def alter(&block); end", "title": "" }, { "docid": "2c5a88efd71219504982a0ecd8790519", "score": "0.52923524", "text": "def my_method(&block)\n puts 'Test'\n block.call\nend", "title": "" }, { "docid": "f2cc2032d1e7bec2c88ef7858b8d5965", "score": "0.5289221", "text": "def create_instance_method(method,&block)\n self.class_eval do\n define_method method do |*args|\n block.call *args\n end\n end\n end", "title": "" }, { "docid": "e3484f14f7909b43143094b1318133be", "score": "0.52728724", "text": "def create_method( name, &block )\n self.class.send( :define_method, name, &block )\n end", "title": "" }, { "docid": "e3484f14f7909b43143094b1318133be", "score": "0.52728724", "text": "def create_method( name, &block )\n self.class.send( :define_method, name, &block )\n end", "title": "" }, { "docid": "4b0fec2785feb1fadd53bac5b8c941da", "score": "0.526808", "text": "def add_block(name, &block)\n @server_class.class_eval do\n define_method(name) do |*args|\n block.call caller, *args\n end\n end\n end", "title": "" }, { "docid": "85c509cf5a945a5b79be41f1f242f804", "score": "0.52622366", "text": "def override_method(obj, method_name, &block)\n # Get the singleton class/eigenclass for 'obj'\n klass = class <<obj; self; end\n\n # Undefine the old method (using 'send' since 'undef_method' is protected)\n klass.send(:undef_method, method_name)\n\n # Create the new method\n klass.send(:define_method, method_name, block)\nend", "title": "" } ]
d37c20141b47d514d5790e08d89dc4c7
always returns void array
[ { "docid": "bc03dee2049f31a8649d2c7bacdf47b1", "score": "0.0", "text": "def lower_priority_elements\n []\n end", "title": "" } ]
[ { "docid": "e43fd1f5ecafa38ed0f0bf061da1a7b5", "score": "0.76345444", "text": "def void_array(*args)\n return nil.to_a\n end", "title": "" }, { "docid": "98ce7de31cb5fa948b0ef71cac8a0222", "score": "0.70904154", "text": "def array\n raise \"Not implemented\"\n end", "title": "" }, { "docid": "98e578020ee0626fbc230ecf5ae315c0", "score": "0.69696146", "text": "def __array__; self; end", "title": "" }, { "docid": "c30de60e30a8227f09e6164300319913", "score": "0.6880728", "text": "def Array(p0) end", "title": "" }, { "docid": "cf862ee5a12d195b7c191da90773b8cf", "score": "0.6811293", "text": "def another; return []; end", "title": "" }, { "docid": "e4e5c6ec46d3ea485b4e10ab636e390d", "score": "0.6810788", "text": "def calls_array\n a = return_array\n a[1]\n end", "title": "" }, { "docid": "5d0640c8ac43732260c8fd335da88f52", "score": "0.6632464", "text": "def returns_array?\n false\n end", "title": "" }, { "docid": "5d0640c8ac43732260c8fd335da88f52", "score": "0.6632464", "text": "def returns_array?\n false\n end", "title": "" }, { "docid": "79b8f4a79c417de41dd631b4d274c8bd", "score": "0.65949976", "text": "def array()\n\t\t@array\n\tend", "title": "" }, { "docid": "6bd9481bb70d8ab96546ecd9cd867063", "score": "0.6544727", "text": "def returns_array?\n false\n end", "title": "" }, { "docid": "f07e7aaa70ae1f83f1d91e48b4c05507", "score": "0.6507024", "text": "def array\n @@array\n end", "title": "" }, { "docid": "23f6c2b118e8c03fa6ad79579b5319c4", "score": "0.65004545", "text": "def returns_array?\n true\n end", "title": "" }, { "docid": "f991cf98ac1068373545eec3c4634fb9", "score": "0.64901567", "text": "def get_array\n\t\tsynchronize do\n\t\t\[email protected]_until{@array.size > 0}\n\t\t\ta = @array\n\t\t\t@array = []\n\t\t\treturn a\n\t\tend\n\tend", "title": "" }, { "docid": "c5bbad9757075e8d488bb34a0acbedbe", "score": "0.64698076", "text": "def array\n @array\n end", "title": "" }, { "docid": "ce1137f3bd52ee51acfed15391ec7bb1", "score": "0.64687544", "text": "def ret_array(_array, _ret, _id)\n if !_ret.nil?\n _ret.each do |_r|\n _array = _array << _r.read_attribute(_id) unless _array.include? _r.read_attribute(_id)\n end\n end\n end", "title": "" }, { "docid": "ce1137f3bd52ee51acfed15391ec7bb1", "score": "0.64687544", "text": "def ret_array(_array, _ret, _id)\n if !_ret.nil?\n _ret.each do |_r|\n _array = _array << _r.read_attribute(_id) unless _array.include? _r.read_attribute(_id)\n end\n end\n end", "title": "" }, { "docid": "ce1137f3bd52ee51acfed15391ec7bb1", "score": "0.64687544", "text": "def ret_array(_array, _ret, _id)\n if !_ret.nil?\n _ret.each do |_r|\n _array = _array << _r.read_attribute(_id) unless _array.include? _r.read_attribute(_id)\n end\n end\n end", "title": "" }, { "docid": "ce1137f3bd52ee51acfed15391ec7bb1", "score": "0.64687544", "text": "def ret_array(_array, _ret, _id)\n if !_ret.nil?\n _ret.each do |_r|\n _array = _array << _r.read_attribute(_id) unless _array.include? _r.read_attribute(_id)\n end\n end\n end", "title": "" }, { "docid": "ff040f75ab6f6be018702c2320443fe1", "score": "0.6429359", "text": "def returns_array?\n true\n end", "title": "" }, { "docid": "925e77cfe3c1041198462621a7ffee49", "score": "0.6389867", "text": "def to_a; Array(force) end", "title": "" }, { "docid": "f4d403fa59f63e26210be936eac1a44f", "score": "0.63702494", "text": "def to_ary; nil; end", "title": "" }, { "docid": "d4296c89e28a56764ca1041696917971", "score": "0.6307573", "text": "def to_ary\n\t []\n\tend", "title": "" }, { "docid": "5a921b7bdd43c4707d68fc39b63b8ef1", "score": "0.6305049", "text": "def converted_arrays; end", "title": "" }, { "docid": "9d97d7df71b44b399effff4694313984", "score": "0.6223931", "text": "def to_ary; []; end", "title": "" }, { "docid": "ec4915dc036e275a22d54abe30eca950", "score": "0.6180212", "text": "def array\n\t\t#create an array of\n\t\tarray = [0, 1, 2, 3, 4, 5, 6, 7, 8]\n\tend", "title": "" }, { "docid": "b1aba97da17ba1f66d43bfd1bee3c942", "score": "0.61751467", "text": "def to_a; []; end", "title": "" }, { "docid": "c6c316dda3131f3fffebe3f0291e3699", "score": "0.6141801", "text": "def my_select\n\ti = 0\n\tarr = Array.new\n\tself.my_each do |a| \n\t\tif yield (a)\n\t\t\tarr[i] = a\n\t\t\ti +=1\n\t\telse\n\t\t\tfalse\n\t\tend\n\tend\n\tarr\nend", "title": "" }, { "docid": "5fc838c0a471548ded2e66ab2416a8d0", "score": "0.61414814", "text": "def to_ary()\n return nil;\n end", "title": "" }, { "docid": "6fc9663e6667335eec699c260c3b8f51", "score": "0.60912395", "text": "def get_items\r\n @arr.to_a\r\n end", "title": "" }, { "docid": "3198afcc31a344025a9c09aae7b6de06", "score": "0.60438776", "text": "def array_method(input)\n\treturn \"thanks for the sweet array!\"\nend", "title": "" }, { "docid": "3e5af2f4706af16d7e4e0a7e4e23462d", "score": "0.60422754", "text": "def visit_array(h); end", "title": "" }, { "docid": "e97dfa28bf7d56031abd8f5b1e695826", "score": "0.60053796", "text": "def to_a; [Array]; end", "title": "" }, { "docid": "1c1c68ee44273bca26a001f6178ca7da", "score": "0.59813505", "text": "def to_ary\n nil\n end", "title": "" }, { "docid": "99e2e0dc156b8ff01f669199560ceb1f", "score": "0.5973767", "text": "def to_a\n @arr\n end", "title": "" }, { "docid": "8492675a584c2219b10c5ece2919e378", "score": "0.59423155", "text": "def get_elements(array)\n\n elements = []\n if array != nil\n elements = array.to_a\n end\n return elements\n\nend", "title": "" }, { "docid": "f400cfe904f9f1d08b2e9a956687cb3b", "score": "0.59347224", "text": "def airports_normal\n return Array.new\n end", "title": "" }, { "docid": "7fb9dea566155489be1ad97a020d0131", "score": "0.59321284", "text": "def all\n @rarray\n end", "title": "" }, { "docid": "7020ee8a88325780b76647976b30a943", "score": "0.5902024", "text": "def to_ary\n nil\n end", "title": "" }, { "docid": "7020ee8a88325780b76647976b30a943", "score": "0.5902024", "text": "def to_ary\n nil\n end", "title": "" }, { "docid": "7020ee8a88325780b76647976b30a943", "score": "0.5902024", "text": "def to_ary\n nil\n end", "title": "" }, { "docid": "7020ee8a88325780b76647976b30a943", "score": "0.5902024", "text": "def to_ary\n nil\n end", "title": "" }, { "docid": "87d1ddcdbdd45109adeecdec184cc835", "score": "0.59013736", "text": "def array(op, len, work) # DK:P297\n\t\t\t\twarn \"array is not implemented\"\n\t\t\tend", "title": "" }, { "docid": "e4b4086d00639e02569a85144c16a3ab", "score": "0.5894269", "text": "def airports_out_of_region\n return Array.new\n end", "title": "" }, { "docid": "44c98132df361e8cb159713ecb13f25f", "score": "0.58899796", "text": "def to_ary\n nil\n end", "title": "" }, { "docid": "44c98132df361e8cb159713ecb13f25f", "score": "0.58899796", "text": "def to_ary\n nil\n end", "title": "" }, { "docid": "44c98132df361e8cb159713ecb13f25f", "score": "0.58899796", "text": "def to_ary\n nil\n end", "title": "" }, { "docid": "44c98132df361e8cb159713ecb13f25f", "score": "0.58899796", "text": "def to_ary\n nil\n end", "title": "" }, { "docid": "6d8fa4cee43124b27d500a764e7b6323", "score": "0.5886873", "text": "def build_array\n arr = []\n yield(arr)\n arr \n end", "title": "" }, { "docid": "8def7dfd830c7e1e87023dbd58e1c390", "score": "0.5880804", "text": "def getArray _args\n \"getArray _args;\" \n end", "title": "" }, { "docid": "a79f2786901902825b30e9c36b52cce2", "score": "0.58724165", "text": "def mass_return\n [1,2]\nend", "title": "" }, { "docid": "1ace50e8e2b65b3f4b42af964877af1e", "score": "0.58711433", "text": "def handle_return_args(arr)\n newa = []\n arr.each do |obj|\n newa << handle_return_object(obj)\n end\n\n return newa\n end", "title": "" }, { "docid": "77cee6ab521b1967a47dbf8314a13eee", "score": "0.5833476", "text": "def copy_and_return(result_or_array)\r\n if result_or_array.nil?\r\n nil\r\n elsif result_or_array.is_a?(Array)\r\n result_or_array.map {|r| copy_and_return(r) }\r\n else\r\n result_or_array.clone\r\n end\r\n end", "title": "" }, { "docid": "145f46115cc26ba5ad5c1c401443f53c", "score": "0.5825913", "text": "def get_items\n\t\t@arr\n\tend", "title": "" }, { "docid": "fb0a34df9510bed1a48212791dd6a62f", "score": "0.58196205", "text": "def double_array(array)\n # your code here\nend", "title": "" }, { "docid": "7ef4be445d108d5c61b5f2e10cf90dbe", "score": "0.5818896", "text": "def array\n\t\treturn @hand_contents\n\tend", "title": "" }, { "docid": "492bda3552c284d4ca6e20bb4827dfa6", "score": "0.5786586", "text": "def to_ary() end", "title": "" }, { "docid": "0fe8d448233f9d2ae24ea05d3e3301f5", "score": "0.57682955", "text": "def return_arr_txts\r\n IO.write(\"./DEBUG\", \"docclass=\"[email protected]_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": "40f44c3afdbd1ef2b5a57f5849800dd3", "score": "0.5762706", "text": "def ArithGeo(arr)\n\n # code goes here\n return arr \n \nend", "title": "" }, { "docid": "c205418fffc7d0c16d8b9451e8f135db", "score": "0.5759668", "text": "def hello(array)\n i = 0\n collection = [] # set a (new) empty array\n while i < array.length\n collection << yield(array[i]) # push the return value into new array\n i += 1\n end\n collection # return new array after while loop has completed\nend", "title": "" }, { "docid": "4adce898ad757db3e0912e77160081a6", "score": "0.5749986", "text": "def create_an_array\n [\"a\", \"b\", \"c\", \"d\"]\nend", "title": "" }, { "docid": "1bafff3f38cd1c02745c051c80f78b7a", "score": "0.57480556", "text": "def rb_array(len: T.unsafe(nil)); end", "title": "" }, { "docid": "8e82f245acfc9e32c7d468aa3316faab", "score": "0.5733315", "text": "def to_a; [self] end", "title": "" }, { "docid": "8e82f245acfc9e32c7d468aa3316faab", "score": "0.5733315", "text": "def to_a; [self] end", "title": "" }, { "docid": "a5e330f3dff20a5c19c18684a812d5a8", "score": "0.57218367", "text": "def instantiate_new_array\n<<<<<<< HEAD\n Array.new\nend", "title": "" }, { "docid": "756649aa2320fefc683c0649e31148d3", "score": "0.57002145", "text": "def coin_array; end", "title": "" }, { "docid": "8a7b7771383b0a86d6ce89f3e27f27b8", "score": "0.5684404", "text": "def my_array\n return @my_hash.values\n \n end", "title": "" }, { "docid": "be5904bee8e9bedb3f067d1fae085012", "score": "0.5682041", "text": "def nothing\n return lambda do |pos|\n return []\n end\nend", "title": "" }, { "docid": "e8e36363139f3a3ee344cf722d6fc60b", "score": "0.5674452", "text": "def lcts(array)\nend", "title": "" }, { "docid": "b568e48ed2a9628075f6e1c81e6a3968", "score": "0.5667649", "text": "def to_a; [self]; end", "title": "" }, { "docid": "31806479694a3de8953756a75b1288a8", "score": "0.5661545", "text": "def get_data\n $test_logger.log(\"Get data\")\n\n if @data.is_a?(Array) \n data_copy = Array.new(@data.size)\n @data.each_with_index{|d, i|\n if !d.to_s.include? CmdManager::DONT_CARE\n data_copy[i] = BioPacket.swap_dword(d)\n else\n data_copy[i] = d\n end \n } \n else\n data_copy = Common.get_obj_copy(@data)\n end \n data_copy\n end", "title": "" }, { "docid": "b2439e74d205d557059757e884ee2dec", "score": "0.5656457", "text": "def in_memory\n []\n end", "title": "" }, { "docid": "1bb4999beb20b1d793c3c426be3b79b8", "score": "0.56507784", "text": "def array_start\n []\n end", "title": "" }, { "docid": "26327ac9b7c40e50a41865434acb0abe", "score": "0.56493974", "text": "def get_animloop_array\n result = AnimLoop[phase_sequence[battle_phase].call]\n return result if result\n return rescued_error\n end", "title": "" }, { "docid": "449d47ea755f4e42883f060476543063", "score": "0.56489635", "text": "def to_index_array a=[]\n\t\[email protected] do |p|\n\t\t\ta += p[:verts]\n\t\tend\n\t\ta\n\tend", "title": "" }, { "docid": "5038e9ada359588f02605a0889dec5a8", "score": "0.5647438", "text": "def collect\n [false, nil]\n end", "title": "" }, { "docid": "55092bf853ca77fcc27e41555269cebe", "score": "0.5634396", "text": "def array?\n false\n end", "title": "" }, { "docid": "a2939d2cc194667ef74b639299235846", "score": "0.5628917", "text": "def _getarray\n if @document.nil?\n return @list\n else\n return @document.native_text\n end\n end", "title": "" }, { "docid": "7d25337aa4330897ed7639cffb7d3768", "score": "0.56265664", "text": "def in_memory\n []\n end", "title": "" }, { "docid": "7d25337aa4330897ed7639cffb7d3768", "score": "0.56265664", "text": "def in_memory\n []\n end", "title": "" }, { "docid": "02a4d79adea1e5829db657e1d17a594c", "score": "0.561337", "text": "def to_a\n array\n end", "title": "" }, { "docid": "6932df1ba1301c5d5489cdc46d65d60f", "score": "0.5607076", "text": "def values(*) end", "title": "" }, { "docid": "884465f5fbfb298696608a114ef5a75c", "score": "0.5605911", "text": "def to_a\n Array(each)\n end", "title": "" }, { "docid": "0bfa18644b0f8a962d4f83a08477d069", "score": "0.5602527", "text": "def array?\n false\n end", "title": "" }, { "docid": "c96ae571ddf821f2185a34a16a364359", "score": "0.5601424", "text": "def to_a; end", "title": "" }, { "docid": "c96ae571ddf821f2185a34a16a364359", "score": "0.5601424", "text": "def to_a; end", "title": "" }, { "docid": "c96ae571ddf821f2185a34a16a364359", "score": "0.5601424", "text": "def to_a; end", "title": "" }, { "docid": "c96ae571ddf821f2185a34a16a364359", "score": "0.5601424", "text": "def to_a; end", "title": "" }, { "docid": "c96ae571ddf821f2185a34a16a364359", "score": "0.5601424", "text": "def to_a; end", "title": "" }, { "docid": "c96ae571ddf821f2185a34a16a364359", "score": "0.5601424", "text": "def to_a; end", "title": "" }, { "docid": "c96ae571ddf821f2185a34a16a364359", "score": "0.5601424", "text": "def to_a; end", "title": "" }, { "docid": "c96ae571ddf821f2185a34a16a364359", "score": "0.5601424", "text": "def to_a; end", "title": "" }, { "docid": "5fc227f705f303e59a9087376fe9b6e0", "score": "0.5565174", "text": "def map_to_no_change(array)\n return array\nend", "title": "" }, { "docid": "7cfe97c93aa023d053f89eac4b27c3ae", "score": "0.5560224", "text": "def to_ary; self.to_a; end", "title": "" }, { "docid": "becc1dc80fa9986d1dd64f844d0101c2", "score": "0.555706", "text": "def select(array)\n counter = 0\n ret_array = []\n while counter < array.size\n ret = yield(array[counter])\n ret_array << array[counter] if ret\n counter += 1\n end\n ret_array\nend", "title": "" }, { "docid": "c419f87c56ca9dd46738c8934a2bdad8", "score": "0.55509585", "text": "def fetch\n fetch0(Array, false)\n end", "title": "" }, { "docid": "8d11f44be0350c206c2608f1608dfc0b", "score": "0.55470216", "text": "def [] i\n @array[i]\n end", "title": "" }, { "docid": "0d112d4290272048ce7c446e01be3b96", "score": "0.554317", "text": "def values\n []\n end", "title": "" }, { "docid": "c235d883f77ccd3ddb360361d7d81a35", "score": "0.5542536", "text": "def array_nl()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "d19f99df018ed746f6c37aa87bdd432f", "score": "0.5539557", "text": "def values() end", "title": "" }, { "docid": "f6d06e994673f959ec4795af7bb25f36", "score": "0.55369663", "text": "def as_array\n @fm.dup\n end", "title": "" }, { "docid": "12cf142cb4ecff43cca88fc073530f4d", "score": "0.5529708", "text": "def &(arr)\n raise 'Not Implemented'\n end", "title": "" } ]
18eeaccd1aae1f12e12bded336fa6539
POST /movimientos POST /movimientos.json
[ { "docid": "96260ba5505ced11e03466b83051ce6a", "score": "0.5909531", "text": "def create\n @movimiento = Movimiento.new(movimiento_params)\n @movimiento.empresa_id = current_user.empresa_id\n @movimiento.usuario = current_user\n flash[:cuenta_id] = @movimiento.cuenta_id\n\n respond_to do |format|\n if @movimiento.save\n format.html { redirect_to movimientos_url, notice: 'El movimiento se creó correctamente.' }\n format.json { render :show, status: :created, location: @movimiento }\n else\n @transacciones = current_user.transacciones.all_for_select(@movimiento.tipo_transaccion_id)\n format.html { render :new }\n format.json { render json: @movimiento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "00776654abdf8cc6884c5699d846ebf6", "score": "0.68400335", "text": "def create\n @moviesttt = Moviesttt.new(moviesttt_params)\n\n respond_to do |format|\n if @moviesttt.save\n format.html { redirect_to @moviesttt, notice: 'Moviesttt was successfully created.' }\n format.json { render :show, status: :created, location: @moviesttt }\n else\n format.html { render :new }\n format.json { render json: @moviesttt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f4a3584adf1c9262a56da8560d35dd12", "score": "0.67787176", "text": "def create\n @movimiento = Movimiento.new(params[:movimiento])\n\n respond_to do |format|\n if @movimiento.save\n format.html { redirect_to @movimiento, notice: 'Movimiento was successfully created.' }\n format.json { render json: @movimiento, status: :created, location: @movimiento }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movimiento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dbfbfa83b471e4d43f3720f42ff4398a", "score": "0.6754538", "text": "def create\n @movimento = Movimento.new(params[:movimento])\n\n respond_to do |format|\n if @movimento.save\n format.html { redirect_to @movimento, notice: 'Movimento was successfully created.' }\n format.json { render json: @movimento, status: :created, location: @movimento }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movimento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3afa4b958c696e17a925439104c047e0", "score": "0.6708519", "text": "def create\n @movimento = Movimento.new(movimento_params)\n\n respond_to do |format|\n if @movimento.save\n format.html { redirect_to @movimento, notice: 'Movimento was successfully created.' }\n format.json { render :show, status: :created, location: @movimento }\n else\n format.html { render :new }\n format.json { render json: @movimento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "333eaadc67ccbede7200a13f2af73a09", "score": "0.670222", "text": "def create\n @movimentantion = Movimentantion.new(movimentantion_params)\n\n respond_to do |format|\n if @movimentantion.save\n format.html { redirect_to @movimentantion, notice: 'Movimentantion was successfully created.' }\n format.json { render :show, status: :created, location: @movimentantion }\n else\n format.html { render :new }\n format.json { render json: @movimentantion.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c43ff44f55f3c3523afb8d57b29fc533", "score": "0.66785234", "text": "def create\n @moviestore = Moviestore.new(moviestore_params)\n\n respond_to do |format|\n if @moviestore.save\n format.html { redirect_to @moviestore, notice: 'Moviestore was successfully created.' }\n format.json { render :show, status: :created, location: @moviestore }\n else\n format.html { render :new }\n format.json { render json: @moviestore.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "98f041795dbc5114c04b39c142531e27", "score": "0.66628355", "text": "def create\n Rails.logger.info(\"*CAMISAS* CAMISAS***********************\")\n Rails.logger.info( params[:musculo][:atividade_ids].inspect)\n Rails.logger.info(\"***************************************\")\n\n @musculo = Musculo.new(musculo_params)\n\n respond_to do |format|\n if @musculo.save\n format.html { redirect_to @musculo, notice: 'Registro criado.' }\n format.json { render action: 'show', status: :created, location: @musculo }\n else\n format.html { render action: 'new' }\n format.json { render json: @musculo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c2579d518fe27964592559b6031dcecf", "score": "0.66263986", "text": "def create\n @movi = Movi.new(movi_params)\n\n respond_to do |format|\n if @movi.save\n format.html { redirect_to @movi, notice: 'Movi was successfully created.' }\n format.json { render :show, status: :created, location: @movi }\n else\n format.html { render :new }\n format.json { render json: @movi.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1b62bea844332350375ff59ff7f67132", "score": "0.66144276", "text": "def create\n @movimentacaoproduto = Movimentacaoproduto.new(movimentacaoproduto_params)\n\n respond_to do |format|\n if @movimentacaoproduto.save\n format.html { redirect_to @movimentacaoproduto, notice: 'Movimentacaoproduto was successfully created.' }\n format.json { render :show, status: :created, location: @movimentacaoproduto }\n else\n format.html { render :new }\n format.json { render json: @movimentacaoproduto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "08ce6eff307085118e27188b215eeca7", "score": "0.6588164", "text": "def create\n @movimentacao = Movimentacao.new(params[:movimentacao])\n\n respond_to do |format|\n if @movimentacao.save\n format.html { redirect_to @movimentacao, notice: 'Movimentacao was successfully created.' }\n format.json { render json: @movimentacao, status: :created, location: @movimentacao }\n else\n format.html { render action: \"new\" }\n format.json { render json: @movimentacao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0f15acba13c3cafe7da60d91a3e7728", "score": "0.6583992", "text": "def create\n @mov = Mov.new(mov_params)\n\n respond_to do |format|\n if @mov.save\n \n format.html { redirect_to @mov, notice: 'Mov was successfully created.' }\n format.json { render :show, status: :created, location: @mov }\n else\n format.html { render :new }\n format.json { render json: @mov.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aa988e19ac2124f9d04101fc6e23edbf", "score": "0.65806454", "text": "def create\n @episode = Episode.find(params[:episode_id])\n @trabajador = Trabajador.find(@episode.trabajador_id)\n\n @sintoma = @episode.build_sintoma(sintoma_params)\n\n respond_to do |format|\n if @sintoma.save\n\n actualizaEpisodio\n\n format.html { redirect_to trabajador_path(@trabajador), notice: 'Sintoma agregados al ingreso.' }\n format.json { render :show, status: :created, location: @sintoma }\n else\n format.html { render :new }\n format.json { render json: @sintoma.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a217a255d4aa73118ef609a9189d8799", "score": "0.6527312", "text": "def create\n @movietable = Movietable.new(movietable_params)\n\n respond_to do |format|\n if @movietable.save\n format.html { redirect_to @movietable, notice: 'Movietable was successfully created.' }\n format.json { render :show, status: :created, location: @movietable }\n else\n format.html { render :new }\n format.json { render json: @movietable.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0b1f56b0a1a25a9cd545a3fd6a41519", "score": "0.64423895", "text": "def create\n @movimentacao = Movimentacao.new(movimentacao_params)\n\n respond_to do |format|\n if @movimentacao.save\n format.html { redirect_to @movimentacao, notice: \"Movimentacao was successfully created.\" }\n format.json { render :show, status: :created, location: @movimentacao }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @movimentacao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df05b1c06e91070f168e3452c7ec8711", "score": "0.6399998", "text": "def create\n @movimientos_inventario = MovimientosInventario.new(params[:movimientos_inventario])\n\n respond_to do |format|\n if @movimientos_inventario.save\n format.html { redirect_to(@movimientos_inventario, :notice => 'MovimientosInventario was successfully created.') }\n format.xml { render :xml => @movimientos_inventario, :status => :created, :location => @movimientos_inventario }\n else\n @tipos_movimientos = TiposMovimiento.all\n format.html { render :action => \"new\" }\n format.xml { render :xml => @movimientos_inventario.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc33e555b748b1a16e0dd54bbb3c8b8f", "score": "0.63999236", "text": "def create\n @movimento_servico_servico = MovimentoServicoServico.new(movimento_servico_servico_params)\n\n respond_to do |format|\n if @movimento_servico_servico.save\n format.html { redirect_to @movimento_servico_servico, notice: 'Movimento servico servico was successfully created.' }\n format.json { render :show, status: :created, location: @movimento_servico_servico }\n else\n format.html { render :new }\n format.json { render json: @movimento_servico_servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9062000ca733976d98ee7410dd52659e", "score": "0.634654", "text": "def create\n @mov_estoque = MovEstoque.new(mov_estoque_params)\n\n respond_to do |format|\n if @mov_estoque.save\n format.html { redirect_to @mov_estoque, notice: 'Mov estoque was successfully created.' }\n format.json { render :show, status: :created, location: @mov_estoque }\n else\n format.html { render :new }\n format.json { render json: @mov_estoque.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f5e63831d7bf45d0b6d623ac3f4eccf1", "score": "0.63419735", "text": "def create\n @tipo_de_movimiento = TipoDeMovimiento.new(tipo_de_movimiento_params)\n\n respond_to do |format|\n if @tipo_de_movimiento.save\n format.html { redirect_to tipos_de_movimientos_url, notice: 'Tipo de movimiento was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_de_movimiento }\n else\n format.html { render :new }\n format.json { render json: @tipo_de_movimiento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc83ea78c6cc4f27deee070125022696", "score": "0.6340809", "text": "def create\n @movimiento = Movimiento.new(movimiento_params)\n\n respond_to do |format|\n if @movimiento.save\n format.html { redirect_to @movimiento, notice: 'Se ha registrado correctamente.' }\n format.json { render :show, status: :created, location: @movimiento }\n else\n format.html { render :new }\n format.json { render json: @movimiento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d20162aa0634fbf4b68f579a76d244bc", "score": "0.62956846", "text": "def create\n @meteo = Meteo.new(meteo_params)\n respond_to do |format|\n if @meteo.save\n format.html { redirect_to @meteo, notice: 'Meteo was successfully created.' }\n format.json { render json: @meteo, status: :saved }\n else\n format.html { render :new }\n format.json { render json: @meteo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8be2189a02e052b18a790e0bd60aa6b9", "score": "0.62909406", "text": "def create\n @moperario = Moperario.new(moperario_params)\n\n respond_to do |format|\n if @moperario.save\n format.html { redirect_to @moperario, notice: 'Moperario was successfully created.' }\n format.json { render :show, status: :created, location: @moperario }\n else\n format.html { render :new }\n format.json { render json: @moperario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a854928d3204eac9b54aad640c24b55e", "score": "0.62461805", "text": "def create\n @termo_uso = TermoUso.new(params[:termo_uso])\n\n respond_to do |format|\n if @termo_uso.save\n format.html { redirect_to @termo_uso, notice: 'Termo uso was successfully created.' }\n format.json { render json: @termo_uso, status: :created, location: @termo_uso }\n else\n format.html { render action: \"new\" }\n format.json { render json: @termo_uso.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ed27910874dd5701ccb49d5b5a5bc053", "score": "0.6218484", "text": "def create\n\trequire 'rubygems'\n\trequire 'rest_client'\n\trequire 'json'\n\t\n\tunless params[:m_id].nil?\n\t\tm_id = params[:m_id]\t\n\t\n\t\theaders = {:accept => \"application/json\"}\n\t\tresponse = RestClient.get \"http://api.themoviedb.org/3/movie/#{m_id}?api_key=8f8bdc43aaf51d09127c3eb023007a53\", headers \t\n\t\tparsed_json = JSON.parse(response)\n\t\t \t\n\t\tmovie_act = Movie.new\n\t\t\n\t\tempty_check=%w[release_date overview poster_path]\n\t\tempty_check.each {|e| if parsed_json[e].nil? || parsed_json[e].empty? then parsed_json[e]=\"brak danych\" end }\n\t\t\n\t\tif parsed_json[\"production_countries\"].nil? || parsed_json[\"production_countries\"].empty?\n\t\t\tmovie_act.country=\"brak danych\"\n\t\telse\n\t\t\tcountry = parsed_json[\"production_countries\"].map {|e| e[\"name\"]+\" \"}\n\t\t\tmovie_act.country=country[0].to_s\n\t\tend\n\t\tmovie_act.title = parsed_json[\"original_title\"].to_s\n\t\tmovie_act.year=parsed_json[\"release_date\"].to_s\n\t\tif parsed_json[\"genres\"].nil? || parsed_json[\"genres\"].empty?\n\t\t\tmovie_act.genre = \"brak danych\"\n\t\telse\n\t\t\tgenre=parsed_json[\"genres\"].map {|e| e[\"name\"]+\" \"}\n\t\t\tmovie_act.genre=genre[0].to_s\n\t\tend\n\t\tmovie_act.overview = parsed_json[\"overview\"].to_s\n\t\tmovie_act.poster_path = parsed_json[\"poster_path\"].to_s\n\t\tmovie_act.id2 = parsed_json[\"id\"].to_s\n\t\n\t\t@mid = m_id\n\t\t@movie = movie_act\n\t\t\n\telse\n\t\t@movie = Movie.new(params[:movie])\n\tend\n\n respond_to do |format|\n\t if Movie.where(\"id2 = ?\", @movie.id2).first\n\t if current_user.statuses.exists?(:movie_id => Movie.where(\"id2 = ?\", @movie.id2).first.id)\n\t\t format.html { redirect_to wyszukaj_path, notice: 'Masz już ten film na liście.' }\n\t\telse\n\t @movie_spr = Movie.where(\"id2 = ?\", @movie.id2).first\n\t format.html { redirect_to new_status_path, :flash => { :movie_id => @movie_spr.id } }\n format.json { render json: @movie, status: :created, location: @movie }\n\t\tend\n else\t\t\n if @movie.save\n format.html { redirect_to new_status_path, :flash => { :movie_id => @movie.id } }\n format.json { render json: @movie, status: :created, location: @movie }\n else\n format.html { render action: \"new\", notice: 'Nie dodano nowego filmu do bazy danych. Spróbuj ponownie.' }\n format.json { render json: @movie.errors, status: :unprocessable_entity }\n end\n end\n end\n end", "title": "" }, { "docid": "93bf4a0946f20a8ea446eaca3b3e7e37", "score": "0.61654866", "text": "def create\n @movie = Movie.new(params[:movie])\n\n if @movie.save\n render json: @movie, status: :created, location: @movie\n else\n render json: @movie.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "2ebc5b87010be65f181d8a0366bd7306", "score": "0.6159148", "text": "def create\n @ventum = Ventum.new(ventum_params)\n\n respond_to do |format|\n if @ventum.save\n @carrito.each do |c|\n @articulo = Articulo.create({:venta_id => @ventum.id, :producto_id => c.producto.id, :cantidad => c.cantidad})\n end\n format.html { redirect_to @ventum, notice: 'La venta ha sido guardada con exito' }\n format.json { render action: 'show', status: :created, location: @ventum }\n else\n format.html { render action: 'new' }\n format.json { render json: @ventum.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e93dfddbbfa5a50312453e44cc5ba7c4", "score": "0.61520594", "text": "def create\n musica = Musica.find(params[:musica_id])\n @musica_selecionada = @evento.musica_selecionadas.build(\n musica: musica,\n momento: params[:momento] || '<momento não nomeado>'\n )\n\n respond_to do |format|\n if @musica_selecionada.save\n format.html { redirect_to @musica_selecionada.evento, notice: 'Musica selecionada was successfully created.' }\n format.json { render :show, status: :created, location: @musica_selecionada }\n else\n format.html { render :new }\n format.json { render json: @musica_selecionada.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d6d0cdbec28925d472513925f8b929d", "score": "0.6140568", "text": "def create\n @movimento_estoque = MovimentoEstoque.new(movimento_estoque_params)\n\n respond_to do |format|\n if @movimento_estoque.save\n format.html { redirect_to @movimento_estoque, notice: 'Movimento estoque was successfully created.' }\n format.json { render :show, status: :created, location: @movimento_estoque }\n else\n format.html { render :new }\n format.json { render json: @movimento_estoque.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c739bef06234dc0de0e5e1a9ee3decf0", "score": "0.61298263", "text": "def create\n @agenda_movimentacao = AgendaMovimentacao.find(session[:agenda_movimentacao_id])\n @movimento_servico = current_user.empresa.movimento_servicos.build(movimento_servico_params)\n @movimento_servico.agenda_movimentacao_id = @agenda_movimentacao.id\n if @movimento_servico.save\n flash[:success] = t(\"flash.actions.#{__method__}.success\", resource_name: @movimento_servico.class)\n redirect_to empresa_agendas_path(current_user.empresa)\n else\n flash[:error] = t(\"flash.actions.#{__method__}.alert\", resource_name: @movimento_servico.class)\n render :new\n end\n end", "title": "" }, { "docid": "afbd0ff835bb682697bfa897eb3e3ea0", "score": "0.612584", "text": "def create\n @pago = Pago.new(pago_params)\n @pago.update_descuentos_cuotas(cuotas_params)\n\n respond_to do |format|\n if @pago.save\n format.html { redirect_to @pago, notice: 'Pago fue creado exitosamente.' }\n format.json { render json: pago_path(@pago), status: :created, location: @pago }\n else\n # Es solo para que funcione los botones de agregar y remover NO SACAR\n if not params[:pago].key?(:pagos_metodos_attributes)\n @pago.pagos_metodos.build\n end\n format.html { render :new }\n format.json { render json: @pago.errors.full_messages, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3566c378a559bbb51aeb7c7e6110b78", "score": "0.6120806", "text": "def create\n @metodologium = Metodologium.new(metodologium_params)\n\n respond_to do |format|\n if @metodologium.save\n format.html { redirect_to new_publicacion_esperada_path }\n format.json { render :show, status: :created, location: @metodologium }\n else\n format.html { render :new }\n format.json { render json: @metodologium.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5b7063e8f2b085e7b4ee2c2a90ff412e", "score": "0.6113828", "text": "def create\n @movimiento = Movimiento.new(params[:movimiento])\n\n respond_to do |format|\n if @movimiento.save\n format.html { redirect_to(@movimiento, :notice => 'Movimiento was successfully created.') }\n format.xml { render :xml => @movimiento, :status => :created, :location => @movimiento }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @movimiento.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1311b7632604fd7a2e2cd53f54a58bf5", "score": "0.6110393", "text": "def create\n @establecimiento = Establecimiento.new(establecimiento_params)\n\n if @establecimiento.save\n render json: @establecimiento, status: :created, location: @establecimiento\n else\n render json: @establecimiento.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "9cc9cbc7ab6af7bb13569c7505c2248b", "score": "0.6092306", "text": "def create\r\n @sivic_movimentofinanceiro = SivicMovimentofinanceiro.new(sivic_movimentofinanceiro_params)\r\n\r\n respond_to do |format|\r\n if @sivic_movimentofinanceiro.save\r\n format.html { redirect_to @sivic_movimentofinanceiro, notice: 'Registro inserido com sucesso.' }\r\n format.json { render action: 'show', status: :created, location: @sivic_movimentofinanceiro }\r\n else\r\n format.html { render action: 'new' }\r\n format.json { render json: @sivic_movimentofinanceiro.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "299a7e2612cd1ed496eafc743bc76e5a", "score": "0.60796446", "text": "def create\n @anuncio = Anuncio.new(anuncio_params)\n @anuncio.id_usuario = Usuario.find_token(@anuncio.token).id\n @anuncio.negocio_fechado = false\n @anuncio.visualizacoes = 0\n Termo.gravartermo(@anuncio.titulo)\n #Termo.gravartermo(@anuncio.descricao)\n\n respond_to do |format|\n if @anuncio.save\n format.html { redirect_to @anuncio, notice: 'Anuncio was successfully created.' }\n format.json { render :show, status: :created, location: @anuncio }\n else\n format.html { render :new }\n format.json { render json: @anuncio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "637d8b8d5647e351e04c8026daa58ca6", "score": "0.6073997", "text": "def create\n @servicio = Servicio.new(servicio_params)\n respond_to do |format|\n # Creacion de Asientos de Servicio para el Servicio recien creado\n t = @servicio.transaction do\n @servicio.save\n for i in [email protected]\n AsientoDeServicio.create(nro: i, estado: true, servicio_id: @servicio.id)\n end\n end\n if t\n format.html { redirect_to @servicio, notice: 'Servicio was successfully created.' }\n format.json { render :show, status: :created, location: @servicio }\n else\n format.html { render :new }\n format.json { render json: @servicio.errors, status: :unprocessable_entity }\n end\n end \n end", "title": "" }, { "docid": "53073a3b1113f9ed1748cd3fc0177284", "score": "0.60739744", "text": "def create\n @tipo_medico = TipoMedico.new(tipo_medico_params)\n\n respond_to do |format|\n if @tipo_medico.save\n format.html { redirect_to @tipo_medico, notice: 'Tipo medico was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_medico }\n else\n format.html { render :new }\n format.json { render json: @tipo_medico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3e359a9a26bae55051f1a5721a27e20e", "score": "0.60669655", "text": "def create\n @medicao = Medicao.new(medicao_params)\n\n respond_to do |format|\n if @medicao.save\n format.html { redirect_to @medicao, notice: 'Medicao was successfully created.' }\n format.json { render :show, status: :created, location: @medicao }\n else\n format.html { render :new }\n format.json { render json: @medicao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3352b69213a0c4cc273e0bc321468daf", "score": "0.60529053", "text": "def index\n get_movimientos\n end", "title": "" }, { "docid": "b96285619d24d9b6886168c6d3eb80cc", "score": "0.6050368", "text": "def create\n @medico = Medico.new(params[:medico])\n\n respond_to do |format|\n if @medico.save\n format.html { redirect_to @medico, :notice => 'Medico was successfully created.' }\n format.json { render :json => @medico, :status => :created, :location => @medico }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @medico.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b96285619d24d9b6886168c6d3eb80cc", "score": "0.6050368", "text": "def create\n @medico = Medico.new(params[:medico])\n\n respond_to do |format|\n if @medico.save\n format.html { redirect_to @medico, :notice => 'Medico was successfully created.' }\n format.json { render :json => @medico, :status => :created, :location => @medico }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @medico.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aa1402410531ea910fea50d13a3e92d8", "score": "0.6045844", "text": "def create\n @episodio = Episodio.new\n @episodio.titulo = params[:episodio][:titulo]\n @episodio.duracao = params[:episodio][:duracao]\n @episodio.serie_id = Integer(params[:episodio][:serie_id])\n if @episodio.save\n @episodios = Episodio.where(serie_id: params[:episodio][:serie_id],ativo: true)\n render json: @episodios\n else\n render json: @episodio.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "a8849dfd17d3390e84eacd811c1fa2a9", "score": "0.6034311", "text": "def create\n @servico = Servico.new(params[:servico])\n\n respond_to do |format|\n if @servico.save\n format.html { redirect_to @servico, notice: 'Servico was successfully created.' }\n format.json { render json: @servico, status: :created, location: @servico }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a8849dfd17d3390e84eacd811c1fa2a9", "score": "0.6034311", "text": "def create\n @servico = Servico.new(params[:servico])\n\n respond_to do |format|\n if @servico.save\n format.html { redirect_to @servico, notice: 'Servico was successfully created.' }\n format.json { render json: @servico, status: :created, location: @servico }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2662cee579e84be606c397ab223e4d67", "score": "0.6020574", "text": "def create\n @movie = Movie.create!(movie_params)\n render json: @movie\n end", "title": "" }, { "docid": "9938e3fe67a47ad9b51e07092a6a2edd", "score": "0.6015825", "text": "def create\n @voluntario_temporal = VoluntarioTemporal.new(voluntario_temporal_params)\n\n respond_to do |format|\n if @voluntario_temporal.save\n format.html { redirect_to @voluntario_temporal, notice: 'Voluntario creado correctamente.' }\n format.json { render :show, status: :created, location: @voluntario_temporal }\n else\n format.html { render :new }\n format.json { render json: @voluntario_temporal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eac33be99cf32a21f95add6e6a10ed28", "score": "0.6014374", "text": "def create\n params[:tipo_aula][:video_id] = TipoAula.getVideoId(params[:tipo_aula][:video_id])\n @tipo_aula = TipoAula.new(params[:tipo_aula])\n\n respond_to do |format|\n if @tipo_aula.save\n format.html { redirect_to @tipo_aula, :flash => { :success => 'Tipo de aula (modalidade) criado com sucesso.' } }\n format.json { render :json => @tipo_aula, :status => :created, :location => @tipo_aula }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @tipo_aula.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f966369bf8f761468449211feca54f51", "score": "0.60133964", "text": "def create\n\n local_params = muestreo_params\n local_params[:proyecto_id] = session[:proyecto_id]\n \n @muestreo = Muestreo.new(local_params)\n #@id = local_params\n #render inline: \"<%= @id %> \"\n respond_to do |format|\n if @muestreo.save\n total = local_params[:meta].to_i\n time = Time.now\n minimo = local_params[:minimo].to_i\n maximo = local_params[:maximo].to_i\n #puts total\n #puts local_params\n for i in 0..total\n Schedule.create({muestreo_id: @muestreo.id, hora: time})\n time = time + (minimo + rand((maximo - minimo).abs)).minutes\n end\n format.html { redirect_to @muestreo, notice: 'Muestreo was successfully created.' }\n format.json { render :show, status: :created, location: @muestreo }\n else\n format.html { render :new }\n format.json { render json: @muestreo.errors, status: :unprocessable_entity }\n end\n\n end\n end", "title": "" }, { "docid": "7fc68f47ed355876412c4c7f310fee51", "score": "0.6010992", "text": "def create\n @medico = Medico.new(medico_params)\n\n respond_to do |format|\n if @medico.save\n format.html { redirect_to @medico, notice: 'Médico ingresado exitosamente.' }\n format.json { render :show, status: :created, location: @medico }\n else\n format.html { render :new }\n format.json { render json: @medico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c8999374ce14d8b5c75eeb2e22b3b5f2", "score": "0.6005212", "text": "def create\n @movimento = Movimento.new(params[:movimento])\n\n respond_to do |format|\n if @movimento.save\n format.html { redirect_to(@movimento, :notice => 'Movimento was successfully created.') }\n format.xml { render :xml => @movimento, :status => :created, :location => @movimento }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @movimento.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99c62ad9015be03bdb638fe60dc40397", "score": "0.60048246", "text": "def create\n @movement = Movement.new(movement_params)\n\n respond_to do |format|\n if @movement.save\n format.html { redirect_to movements_path, notice: 'Movimento criado com sucesso.' }\n format.json { render :show, status: :created, location: @movement }\n else\n format.html { render :new }\n format.json { render json: @movement.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f2ad201d602e5bc7f748fbd4638d052", "score": "0.6002917", "text": "def create\n @manutencao = Manutencao.new(manutencao_params)\n # @manutencao = manutencao_params([:veiculo_id])\n\n respond_to do |format|\n if @manutencao.save\n format.html { redirect_to @manutencao, notice: 'Manutencao was successfully created.' }\n format.json { render :show, status: :created, location: @manutencao }\n else\n format.html { render :new }\n format.json { render json: @manutencao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25d94928acd6d6544b47be9018b9f852", "score": "0.59971195", "text": "def matrimonio_params\n params.require(:matrimonio).permit(:esposo_id,\n :esposa_id,\n :boda_civil,\n :boda_eclesiastica,\n :observacion)\n end", "title": "" }, { "docid": "3d154156f4aad255b450d07e73503a57", "score": "0.5993573", "text": "def generar_movimientos\n Transaccion.transaction do\n conds = Colegiado.conds_exento_pago\n conds[0] = \"not (#{conds[0]} or situacion_colegial = ?)\"\n conds << 'baja_colegial'\n conds[0] << \" and domiciliar_pagos is true\" if destinatarios == 'colegiados_domiciliaciones'\n conds[0] << \" and domiciliar_pagos is not true\" if destinatarios == 'colegiados_caja'\n Colegiado.find(:all, :conditions => conds, :order => 'num_colegiado').each{|colegiado|\n begin\n m = Movimiento.create(:titular => colegiado, :origen => self,\n :fecha => (Time.utc(fecha_cobro.year, fecha_cobro.month, fecha_cobro.day) if fecha_cobro),\n :concepto_de => concepto_de,\n :concepto => concepto, \n :forma_pago => forma_pago,\n :caja => (Thread.current[:current_user].caja if Movimiento::FORMAS_PAGO_CAJA),\n :importe => importe) \n raise \"Se produjo un error al guardar el movimiento, no se ha generado ninguno. El error es: #{m.errors.full_messages}\" unless m.valid?\n rescue Exception => e\n raise \"Se produjo un error al guardar el movimiento, no se ha generado ninguno. El error es: #{e.message}\"\n end\n }\n end\n end", "title": "" }, { "docid": "f22dd473f434187333a7095d9bd933a1", "score": "0.59926593", "text": "def create\n @parceiros = Parceiro.all \n @novidades = Novidade.order('created_at').last(6) \n \n @contato = Contato.new(params[:contato])\n\n respond_to do |format|\n if @contato.save\n format.html { redirect_to @contato, notice: 'Contato enviado com sucesso' }\n format.json { render json: @contato, status: :created, location: @contato }\n else\n format.html { render action: \"new\" }\n format.json { render json: @contato.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "366b4f3b6f170eefb977759f1bead397", "score": "0.59925574", "text": "def create\n @servico = Servico.new(servico_params)\n\n respond_to do |format|\n if @servico.save\n format.html { redirect_to @servico, notice: 'Servico was successfully created.' }\n format.json { render :show, status: :created, location: @servico }\n else\n format.html { render :new }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e200d64db2a641c2d02188b9e2167969", "score": "0.5990333", "text": "def create\n @cambio_moneda = CambioMoneda.new(cambio_moneda_params)\n\n respond_to do |format|\n if @cambio_moneda.save\n format.html { redirect_to cambio_monedas_path, notice: 'Cambio moneda fue creado satisfactoriamente.' }\n format.json { render :index, status: :created, location: @cambio_moneda }\n else\n format.html { render :new }\n format.json { render json: @cambio_moneda.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "930f315d5ab3d5e15b0f22b54ca55e6b", "score": "0.5985711", "text": "def create\n @magazines_serie = MagazinesSerie.new(magazines_serie_params)\n\n respond_to do |format|\n if @magazines_serie.save\n format.html { redirect_to @magazines_serie, notice: 'Magazines serie was successfully created.' }\n format.json { render json: @magazines_serie, status: :created, location: @magazines_serie }\n else\n format.html { render action: \"new\" }\n format.json { render json: @magazines_serie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59036be2747b539fc485039e380995fb", "score": "0.5984477", "text": "def create\n @micropo = Micropo.new(params[:micropo])\n\n respond_to do |format|\n if @micropo.save\n format.html { redirect_to @micropo, notice: 'Micropo was successfully created.' }\n format.json { render json: @micropo, status: :created, location: @micropo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @micropo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "93ede6772c3ca18ad6c8e2c19858b02d", "score": "0.59796125", "text": "def create\n @servicios_turistico = ServiciosTuristico.new(servicios_turistico_params)\n\n respond_to do |format|\n if @servicios_turistico.save\n format.html { redirect_to @servicios_turistico, notice: 'Servicios turistico was successfully created.' }\n format.json { render :show, status: :created, location: @servicios_turistico }\n else\n format.html { render :new }\n format.json { render json: @servicios_turistico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c8cc48e4c7a69a1086b2328a6f3abd2e", "score": "0.597616", "text": "def create\n @medico = Medico.new(medico_params)\n\n respond_to do |format|\n if @medico.save\n format.html { redirect_to @medico, notice: 'Medico was successfully created.' }\n format.json { render :show, status: :created, location: @medico }\n else\n format.html { render :new }\n format.json { render json: @medico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a8491201b30b56b00d5d602c6f9c79f8", "score": "0.59692717", "text": "def create\n @mision = Mision.new(mision_params)\n\n respond_to do |format|\n if @mision.save\n format.html { redirect_to @mision, notice: 'Mision was successfully created.' }\n format.json { render :show, status: :created, location: @mision }\n else\n format.html { render :new }\n format.json { render json: @mision.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70c2b1164de988c41f26d940aea67f2e", "score": "0.5962575", "text": "def create\n movie = Movie.create!(movie_params)\n\n render json: movie\n end", "title": "" }, { "docid": "057d8d98408022f3cfca76496d9bddff", "score": "0.59622794", "text": "def movimento_params\n params.require(:movimento).permit(:es, :qtd, :preco, :produto_id)\n end", "title": "" }, { "docid": "c1dd780953cdb277f5a4cd6bc17dd516", "score": "0.59574276", "text": "def create\n @administracao_motivo = Administracao::Motivo.new(administracao_motivo_params)\n\n respond_to do |format|\n if @administracao_motivo.save\n format.html { redirect_to @administracao_motivo, notice: 'Motivo foi criado com sucesso.' }\n format.json { render :show, status: :created, location: @administracao_motivo }\n else\n format.html { render :new }\n format.json { render json: @administracao_motivo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74f8d2e8ca10597020ec4e3abe4f89e6", "score": "0.59549135", "text": "def create\n @ttramo = Ttramo.new(params[:ttramo])\n\n respond_to do |format|\n if @ttramo.save\n format.html { redirect_to @ttramo, notice: 'Ttramo was successfully created.' }\n format.json { render json: @ttramo, status: :created, location: @ttramo }\n else\n format.html { render action: \"new\" }\n format.json { render json: @ttramo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c8a10afb78dfe9739f4e9108d1c6236a", "score": "0.5949369", "text": "def create\n request = Typhoeus.get(\"www.omdbapi.com\", params: {t: params[\"movie\"][\"title\"], y: params[\"movie\"][\"year\"]})\n\n movie1 = JSON.parse(request.body)\n\n params[:movie][:imdbid] = movie1[\"imdbID\"]\n\n movie2 = params[:movie].permit(:title, :year, :imdbid)\n # create new movie object from params\n\n # add object to movie db\n new_movie = Movie.create(movie2)\n # show movie page\n # render :index\n render :show\n end", "title": "" }, { "docid": "59029deba3e5d584d88e1f913a4ff18c", "score": "0.5948833", "text": "def create\n @dosimetro = Dosimetro.new(dosimetro_params)\n\n respond_to do |format|\n if @dosimetro.save\n format.html { redirect_to @dosimetro, notice: 'Dosimetro cadastrado com sucesso.' }\n format.json { render :show, status: :created, location: @dosimetro }\n else\n format.html { render :new }\n format.json { render json: @dosimetro.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1ea7a9aca7bf35dbe842f0465c2a7071", "score": "0.59468585", "text": "def create\n @medico_paciente = MedicoPaciente.new(medico_paciente_params)\n\n respond_to do |format|\n if @medico_paciente.save\n format.html { redirect_to @medico_paciente, notice: 'Medico paciente was successfully created.' }\n format.json { render :show, status: :created, location: @medico_paciente }\n else\n format.html { render :new }\n format.json { render json: @medico_paciente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0158738dd17d1187f354a180ba7104c5", "score": "0.59440625", "text": "def create\n @rent_a_movie = RentAMovie.new(rent_a_movie_params)\n\n respond_to do |format|\n if @rent_a_movie.save\n format.html { redirect_to @rent_a_movie, notice: 'Rent a movie was successfully created.' }\n format.json { render :show, status: :created, location: @rent_a_movie }\n else\n format.html { render :new }\n format.json { render json: @rent_a_movie.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "848df95c9aaad49ec13ae7f9205836d5", "score": "0.5942562", "text": "def create\n @servico = Servico.new(params[:servico])\n\n respond_to do |format|\n if @servico.save\n format.html { redirect_to @servico, notice: 'Servico foi criado com sucesso.' }\n format.json { render json: @servico, status: :created, location: @servico }\n else\n format.html { render action: \"new\" }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4f8aa34af5a1f0c93830b66158ac4164", "score": "0.5941901", "text": "def create\n @cuenta = Cuenta.find(params[:movimiento][:cuenta_id])\n @movimiento = @cuenta.movimientos.new(movimiento_params)\n\n respond_to do |format|\n if @movimiento.save\n format.html { redirect_to @movimiento, notice: 'Movimiento was successfully created.' }\n format.json { render :show, status: :created, location: @movimiento }\n format.js {\n self.new\n self.update_table\n }\n else\n format.html { render :new }\n format.json { render json: @movimiento.errors, status: :unprocessable_entity }\n format.js\n end\n end\n end", "title": "" }, { "docid": "e409c45cc130a52908a622f322f73dde", "score": "0.5940438", "text": "def create\n @motocicleta = Motocicleta.new(motocicleta_params)\n\n respond_to do |format|\n if @motocicleta.save\n format.html { redirect_to @motocicleta, notice: 'Motocicleta was successfully created.' }\n format.json { render :show, status: :created, location: @motocicleta }\n else\n format.html { render :new }\n format.json { render json: @motocicleta.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8242b5b4d32eedad8ea334a06a1db170", "score": "0.59368306", "text": "def create\n puts \"###[medicos_controller] def create...\"\n verifica_se_usuario_logado_e_admin\n @medico = Medico.new(medico_params)\n @params = params #consultando parametros\n #PESSOAL, quando o botao do create new e pressionado precisamos dos parametros\n #pra poder ver se vieram especialidades no parametro.\n #la no form tem um esquema que prefixa com esp_ todas as especialidades checadas\n #entao a gente pega os parametros que comacam com esp_ e o valor do parametro e\n #justamente o id da especialidade.\n #Entao a gente usa esse id da especialidade pra dar um find e obter o registro dessa especialidade\n @params.each do |p|\n puts p\n if p[0].start_with?(\"esp_\");\n esp = Especialidade.find(p[1]);\n @medico.especialidades << esp\n end \n end\n\n respond_to do |format|\n if @medico.save\n format.html { redirect_to @medico, notice: 'Medico was successfully created.' }\n format.json { render :show, status: :created, location: @medico }\n else\n format.html { render :new }\n format.json { render json: @medico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c02d5869e2dda3152c2dc964cb4c090a", "score": "0.5928376", "text": "def create\n @tipo_imovel = TipoImovel.new(params[:tipo_imovel])\n\n respond_to do |format|\n if @tipo_imovel.save\n format.html { redirect_to @tipo_imovel, notice: 'Tipo imovel was successfully created.' }\n format.json { render json: @tipo_imovel, status: :created, location: @tipo_imovel }\n else\n format.html { render action: \"new\" }\n format.json { render json: @tipo_imovel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2352ab253e0f2c15793b7b9be3202fab", "score": "0.5921659", "text": "def create\n @objeto = Mejora.new(mejora_params)\n\n respond_to do |format|\n if @objeto.save\n format.html { redirect_to @objeto, notice: 'Mejora was successfully created.' }\n format.json { render :show, status: :created, location: @objeto }\n else\n format.html { render :new }\n format.json { render json: @objeto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "68ccc1394bae4f5934ecc50e4c174b9e", "score": "0.5919758", "text": "def create\n @movimiento_inventario = MovimientoInventario.new(movimiento_inventario_params)\n @movimiento_inventario.codigo_movimiento = Faker::Code.unique.ean\n\n art = Articulo.find_by(codigo_articulo: @movimiento_inventario.codigo_articulo)\n\n if @movimiento_inventario.tipo_movimiento==\"ENTRADA\"\n art.total_inventario += @movimiento_inventario.cantidad\n art.save!\n else\n art.total_inventario -= @movimiento_inventario.cantidad\n art.save!\n end\n\n\n respond_to do |format|\n if @movimiento_inventario.save\n format.html { redirect_to @movimiento_inventario, notice: 'Movimiento inventario was successfully created.' }\n format.json { render :show, status: :created, location: @movimiento_inventario }\n else\n format.html { render :new }\n format.json { render json: @movimiento_inventario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b2246fae7da98f831fae6c9eeffd0ad2", "score": "0.59066755", "text": "def create\n @waymo_slomo = WaymoSlomo.new(waymo_slomo_params)\n\n respond_to do |format|\n if @waymo_slomo.save\n format.html { redirect_to @waymo_slomo, notice: 'Waymo slomo was successfully created.' }\n format.json { render :show, status: :created, location: @waymo_slomo }\n else\n format.html { render :new }\n format.json { render json: @waymo_slomo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "03e6f0fac0fdd1e9661b6650c0386d2a", "score": "0.590539", "text": "def create\n @peticion = Peticion.new(params[:peticion])\n @peticion.usuario = self.usuario_en_sesion\n @maquina = Maquina.find(@peticion.maquina_id)\n @peticion.maquina = @maquina\n \n respond_to do |format|\n if @peticion.save\n flash[:notice] = 'La Petición fue exitosamente enviada'\n format.html { redirect_to(:action => \"show\", :id => @peticion) }\n format.xml { render :xml => @peticion, :status => :created, :location => @peticion }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @peticion.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "50846a8c746652318d3d2f5218d0f5d9", "score": "0.5903432", "text": "def create\n @movil = Movil.new(params[:movil])\n\n respond_to do |format|\n if @movil.save\n format.html { redirect_to(@movil, :notice => 'Movil was successfully created.') }\n format.xml { render :xml => @movil, :status => :created, :location => @movil }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @movil.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "81bc45736ce4ea2d602e57b490a125ad", "score": "0.5894133", "text": "def create\n @micropo = Micropo.new(micropo_params)\n\n respond_to do |format|\n if @micropo.save\n format.html { redirect_to @micropo, notice: 'Micropo was successfully created.' }\n format.json { render action: 'show', status: :created, location: @micropo }\n else\n format.html { render action: 'new' }\n format.json { render json: @micropo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "60863adc1d68a679175498048ae2bf2f", "score": "0.5893751", "text": "def create\n @servico = Servico.new(servico_params)\n\n respond_to do |format|\n if @servico.save\n format.html { redirect_to @servico, notice: 'Servico criado com sucesso!' }\n format.json { render :show, status: :created, location: @servico }\n else\n format.html { render :new }\n format.json { render json: @servico.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fde7a779545fd2af418c64023f4e76b9", "score": "0.5890641", "text": "def create\n @servico_passeio = Servico::Passeio.new(servico_passeio_params)\n\n respond_to do |format|\n if @servico_passeio.save\n format.html { redirect_to @servico_passeio, notice: 'Passeio was successfully created.' }\n format.json { render action: 'show', status: :created, location: @servico_passeio }\n else\n format.html { render action: 'new' }\n format.json { render json: @servico_passeio.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49a372145da8b9fefc82337247c721cf", "score": "0.58902234", "text": "def create\n @questao = Questao.new(params[:questao])\n\n respond_to do |format|\n if @questao.save\n format.html { redirect_to @questao, notice: 'Questao was successfully created.' }\n format.json { render json: @questao, status: :created, location: @questao }\n else\n format.html { render action: \"new\" }\n format.json { render json: @questao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49a372145da8b9fefc82337247c721cf", "score": "0.58902234", "text": "def create\n @questao = Questao.new(params[:questao])\n\n respond_to do |format|\n if @questao.save\n format.html { redirect_to @questao, notice: 'Questao was successfully created.' }\n format.json { render json: @questao, status: :created, location: @questao }\n else\n format.html { render action: \"new\" }\n format.json { render json: @questao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "576417d63a51e28bdd35dc24f2423752", "score": "0.58896375", "text": "def create\n @temazo = Temazo.new(params[:temazo])\n\n respond_to do |format|\n if @temazo.save\n format.html { redirect_to temazos_url, notice: 'Un temazo mas en la lista. Gracias!.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end", "title": "" }, { "docid": "a76066df067346d9dbfdbb1941aa472c", "score": "0.5888667", "text": "def create\n @multiples_ruta = MultiplesRuta.new(multiples_ruta_params)\n\n respond_to do |format|\n if @multiples_ruta.save\n format.html { redirect_to @multiples_ruta, notice: 'Multiples ruta was successfully created.' }\n format.json { render :show, status: :created, location: @multiples_ruta }\n else\n format.html { render :new }\n format.json { render json: @multiples_ruta.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9dcb151a3f32dadb5e921de731eadc2b", "score": "0.5885798", "text": "def create\n @prato_montado = PratoMontado.new(prato_montado_params)\n\n respond_to do |format|\n if @prato_montado.save\n format.html { redirect_to @prato_montado, notice: 'Prato montado was successfully created.' }\n format.json { render :show, status: :created, location: @prato_montado }\n else\n format.html { render :new }\n format.json { render json: @prato_montado.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c9920d04279527a7270a887c514f5262", "score": "0.58822465", "text": "def new\n @movimiento = Movimiento.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @movimiento }\n end\n end", "title": "" }, { "docid": "106d981c05d10e1bc0eaeb5b8981772b", "score": "0.58812875", "text": "def create\n @momo = Momo.new(momo_params)\n\n respond_to do |format|\n if @momo.save\n format.html { redirect_to @momo, notice: 'Momo was successfully created.' }\n format.json { render :show, status: :created, location: @momo }\n else\n format.html { render :new }\n format.json { render json: @momo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bccde7dce7f15b150ff08b3aaec0193b", "score": "0.587654", "text": "def create\n @mobiliario = Mobiliario.new(mobiliario_params)\n\n respond_to do |format|\n if @mobiliario.save\n format.html { redirect_to @mobiliario, notice: 'Mobiliario was successfully created.' }\n format.json { render :show, status: :created, location: @mobiliario }\n else\n format.html { render :new }\n format.json { render json: @mobiliario.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3e88b79580ef2675f02e6bbb7a21c54a", "score": "0.5869668", "text": "def movimento_params\n params.require(:movimento).permit(:data, :quantidade, :pessoa_id, :operacao_id, :produto_id)\n end", "title": "" }, { "docid": "e795ea71f82a08e665765c110752cae4", "score": "0.58641547", "text": "def create\n @movieu = Movieu.new(movieu_params)\n\n respond_to do |format|\n if @movieu.save\n format.html { redirect_to @movieu, notice: 'Movieu was successfully created.' }\n format.json { render :show, status: :created, location: @movieu }\n else\n format.html { render :new }\n format.json { render json: @movieu.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "92948b7158e67f750acd197623b21668", "score": "0.58635646", "text": "def create\n \n @veiculo = Veiculo.new(veiculo_params)\n @veiculo.marca_id = params[:marca_id]\n @veiculo.modelo_id = params[:modelo_id]\n \n respond_to do |format|\n if @veiculo.save\n flash.now[:notice] = 'Veiculo cadastrado com sucesso.'\n format.html { redirect_to veiculos_path }\n format.json { render :show, status: :created, location: @veiculo }\n else\n @marcas = Marca.all.order(:descricao)\n @modelos = Modelo.all.order(:descricao)\n @cores = CorVeiculo.all.order(:descricao)\n @tipo_veiculos = TipoVeiculo.all.order(:descricao) \n \n format.html { render :new }\n format.json { render json: @veiculo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "04f5f1bcd1249f155a1e9fdf2c75863e", "score": "0.5861644", "text": "def create\n @emitente = Emitente.new(params[:emitente])\n\n respond_to do |format|\n if @emitente.save\n format.html { redirect_to @emitente, :notice => 'Emitente cadastrado com sucesso.' }\n format.json { render :json => @emitente, :status => :created, :location => @emitente }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @emitente.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "55a70c3deffb2d086cd09d771af5f0f7", "score": "0.58574355", "text": "def create\n @videomonitoramento = Videomonitoramento.new(videomonitoramento_params)\n\n respond_to do |format|\n if @videomonitoramento.save\n format.html { redirect_to @videomonitoramento, notice: 'Videomonitoramento criado com sucesso.' }\n format.json { render action: 'show', status: :created, location: @videomonitoramento }\n else\n format.html { render action: 'new' }\n format.json { render json: @videomonitoramento.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "659714b8ae0b6b8feedbc4d6b84126a1", "score": "0.5856271", "text": "def create\n @mejoramientosestado = Mejoramientosestado.new(params[:mejoramientosestado])\n\n respond_to do |format|\n if @mejoramientosestado.save\n flash[:notice] = 'Mejoramientosestado was successfully created.'\n format.html { redirect_to(@mejoramientosestado) }\n format.xml { render :xml => @mejoramientosestado, :status => :created, :location => @mejoramientosestado }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @mejoramientosestado.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ed177038ce9ef23fd200676ee015a2a3", "score": "0.58544475", "text": "def create\n @objetivo_semanal = ObjetivoSemanal.new(objetivo_semanal_params)\n @objetivo_semanal.mes = params[:date][:mes]\n @objetivo_semanal.anio = params[:date][:anio]\n @objetivo_semanal.punto_venta_id = current_user.punto_venta_id\n respond_to do |format|\n if @objetivo_semanal.save\n format.html { redirect_to @objetivo_semanal, notice: 'Objetivo semanal creado con exito.' }\n format.json { render :show, status: :created, location: @objetivo_semanal }\n else\n format.html { render :new }\n format.json { render json: @objetivo_semanal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e91fb3f01ed8f70cadb5935a0626e2d5", "score": "0.58541393", "text": "def create\n @sermon = Sermon.new(sermon_params)\n\n respond_to do |format|\n if @sermon.save\n format.html { redirect_to @sermon, notice: 'Sermon was successfully created.' }\n format.json { render json: @sermon.to_json }\n else\n format.html { render action: 'new' }\n format.json { render json: @sermon.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "83d6006b76d2269e8fae14bc6417f95a", "score": "0.5849331", "text": "def create\n @manutencao = @carro.manutencoes.new(manutencao_params)\n\n respond_to do |format|\n if @manutencao.save\n format.html { redirect_to [@unidade, @patio, @carro, @manutencao], notice: 'Manutencao was successfully created.' }\n format.json { render :show, status: :created, location: [@unidade, @patio, @carro, @manutencao] }\n else\n format.html { render :new }\n format.json { render json: @manutencao.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "169aafefa47b81a8ae49c42c9efab4a9", "score": "0.58464026", "text": "def create\n @miembro = Miembro.new(miembro_params)\n\n respond_to do |format|\n if @miembro.save\n format.html { redirect_to @miembro, notice: 'Miembro was successfully created.' }\n format.json { render :show, status: :created, location: @miembro }\n else\n format.html { render :new }\n format.json { render json: @miembro.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
c8b3310bc8ec20dd44d6c2000a93c8df
binding.pry look though output and display name and ratings
[ { "docid": "7d886a68f6b55635833006959456c561", "score": "0.0", "text": "def process_output\n\tcounter = 1\n\t\t@parsed[\"businesses\"].each do |x|\n\t\t\tputs \"#{counter} Name: \" + x[\"name\"] + \" Rating:\" + x[\"rating\"].to_s\n\t\t\tcounter +=1 \n\t\tend\n\tend", "title": "" } ]
[ { "docid": "5b5fb4170bc32f57aa036c34877c3bd9", "score": "0.6639469", "text": "def wrestler_output\n\n\t\tputs \"Name: #{self.values[:name]}\"\n\t\tputs \"Set: #{self.values[:set]}\"\n\t\tputs \"Singles Priority: #{self.values[:prioritys]}\"\n\t\tputs \"Tag Team Priority: #{self.values[:priorityt]}\"\n\t\tputs \"TT Probability: #{self.statistics[:tt_probability]}\"\n\t\tputs \"Card Rating: #{self.statistics[:total_card_rating]}\"\n\t\tputs \"OC Probability: #{self.statistics[:oc_probability]}\"\n\t\tputs \"Total Points-Per-Round: #{self.statistics[:total_card_points_per_round]}\"\n\t\tputs \"DQ Probability-Per-Round: #{self.statistics[:dq_probability_per_round]}\"\n\t\tputs \"P/A Probability-Per-Round: #{self.statistics[:pa_probability_per_round]}\"\n\t\tputs \"Submission Roll Probability-Per-Round: #{self.statistics[:sub_probability_per_round]}\"\n\t\tputs \"XX Roll Probability-Per-Round: #{self.statistics[:xx_probability_per_round]}\"\n\t\tputs \"Submission Loss Probability: #{self.points[:sub_prob]}\"\n\t\tputs \"Tag Team Save Probability: #{self.points[:tag_prob]}\"\n\t\tputs \"\\n\"\n\n\t\ttt_probability = \"%.1f\" % (self.statistics[:tt_probability] * 100) + \"%\"\n\t\tcard_rating = \"%.1f\" % self.statistics[:total_card_rating]\n\t\toc_probability = \"%.1f\" % (self.statistics[:oc_probability] * 100) + \"%\"\n\t\ttotal_card_points_per_round = \"%.3f\" % self.statistics[:total_card_points_per_round]\n\t\tdq_probability_per_round = \"%.1f\" % (self.statistics[:dq_probability_per_round] * 100) + \"%\"\n\t\tpa_probability_per_round = \"%.1f\" % (self.statistics[:pa_probability_per_round] * 100) + \"%\"\n\t\tsub_probability_per_round = \"%.1f\" % (self.statistics[:sub_probability_per_round] * 100) + \"%\"\n\t\txx_probability_per_round = \"%.1f\" % (self.statistics[:xx_probability_per_round] * 100) + \"%\"\n\t\t\n\t\tsub_prob = \"%.1f\" % (self.points[:sub_prob] * 100) + \"%\"\n\t\ttag_prob = \"%.1f\" % (self.points[:tag_prob] * 100) + \"%\"\n\n\t\tf = File.new('files/results.csv', 'a')\n\t\tf.write(\"#{self.values[:name]},#{self.values[:set]}, #{self.values[:prioritys]}, #{self.values[:priorityt]}, #{tt_probability}, #{card_rating}, #{oc_probability}, #{total_card_points_per_round}, #{dq_probability_per_round}, #{pa_probability_per_round}, #{sub_probability_per_round}, #{xx_probability_per_round}, #{sub_prob}, #{tag_prob}, \\n\")\n\t\tf.close\n\tend", "title": "" }, { "docid": "e10ae46915e7eb218b4a46c3868ca3fb", "score": "0.65206164", "text": "def printf\n @items.each { |movie| puts \"#{movie.title}: #{movie.rating}\" }\n end", "title": "" }, { "docid": "3066ef30fabe37362f31b879cb519a32", "score": "0.6203679", "text": "def rating _args\n \"rating _args;\" \n end", "title": "" }, { "docid": "eafad63de96c4a15ad6f6cbb1c586e08", "score": "0.6191117", "text": "def printf\n ([email protected]).each do |i|\n item = @items[i]\n puts(\"#{item.title}: #{item.rating}\")\n end\n end", "title": "" }, { "docid": "a3c1bc14ea1d924e544bdc427c2b74a9", "score": "0.6114496", "text": "def read_review\n index = 0\n puts \"Here are the reviews and ratings for: #{@title}\"\n @ratings.each {|rating_num|\n puts \"Rating: #{rating_num}\"\n puts \"Review: #{@reviews[index]}\"\n index += 1\n }\n end", "title": "" }, { "docid": "040fbff3eebe35dadbaa369746036fe4", "score": "0.6092231", "text": "def display_story(title,rating)\n puts(\"#{title} is rated #{rating}.\")\n \nend", "title": "" }, { "docid": "c149fb1c3482e0702c03d3b330cb2f2c", "score": "0.60304224", "text": "def show_info()\n\t\tputs \"ID: #{@@id}\"\n\t\tputs \"Name: #{@car_name}\"\n\t\tputs \"Make: #{@@make}\"\n\t\tputs \"Cost: #{calc_total_cost} INR\"\n\t\tputs\n\t\tputs \"Review: #{@review}\"\n\t\tputs \"Rating: #{@rating} stars\"\n\tend", "title": "" }, { "docid": "7349aecc55b7797bc3c840150e0f7060", "score": "0.6023623", "text": "def print_beer(beer)\n puts \" \"\n puts \"#{beer.name} has an ABV of \".light_blue + \"#{beer.abv}.\".light_red\n puts \" \"\n puts \"Description: \".light_blue + \"#{beer.description}\".light_yellow\n puts \" \"\n puts \"#{beer.name} pairs well with the following meals: \".light_blue + \"#{beer.meals}.\".light_yellow\n puts \" \"\n puts \"Have an ingredient from one of the meals above? Try using that in your next search!\"\n puts \" \"\n puts \" \"\n end", "title": "" }, { "docid": "2d23b491edd3ddd2ddd18d7d78b170d9", "score": "0.5995056", "text": "def print_stats(viking)\n puts \"#{viking.name} Information:\"\n puts \"Name: #{viking.name}\".blue\n puts \"Health: #{viking.health}\".green\n puts \"Age: #{viking.age}\".yellow\n puts \"Strength: #{viking.strength}\".red\n\n puts(\"\\n\")\nend", "title": "" }, { "docid": "13c53e723bdc78f82adff2e3c3c2ec39", "score": "0.5980325", "text": "def display\n self.print\n puts \"#{@headline} -- (Liked: #{@like_number})\"\n end", "title": "" }, { "docid": "9ebeb677982d5a383944fc99fb1c8be5", "score": "0.59643173", "text": "def display_info\n \n puts \"\\nPlayer Name: #{self.name}\"\n puts \"Current Rank: #{self.rank}\"\n puts \"Position: #{self.position}\"\n puts \"School/Club: #{self.schoolclub}\"\n # binding.pry\n #if there is no class_year, nothing is displayed\n puts \"Year: #{self.class_year}\"\n #\n puts \"Height/Weight: #{self.height}, #{self.weight} \"\n puts \"Age: #{self.age}\"\n puts \"Last rank: #{self.last_rank}\"\n puts \"Scouting Report: #{self.blurb}\"\n puts \"------------------------------------\"\n end", "title": "" }, { "docid": "b09a163c376f94678dd1a15af1239d2c", "score": "0.59432423", "text": "def to_s\n return \"#{@name} - #{@description} : #{@rating}\"\n end", "title": "" }, { "docid": "e5d10d2479ae41c288f667ff1b1e11bb", "score": "0.5940956", "text": "def rating_display(rating)\n rating = default_class(rating)\n return nil if rating.nil?\n if %w[fa ga fl].include? rating\n return rating\n else\n return rating[0] # use the first letter of the rating as the abbreviated version\n end\n end", "title": "" }, { "docid": "5390a6030d564ac54ee3681aae0e909d", "score": "0.5922853", "text": "def list_ratings\n final_result = []\n # grab all of the rating attributes and counts and turn them into an array\n rating_results = rating.count_attributes.to_a\n \n # order the rating counts and attributes\n ordered_results = []\n ['one', 'two', 'three', 'four'].each do |order|\n rating_results.each do |result|\n if order == result[0]\n ordered_results << result\n end\n end\n end\n \n # add in the friendly name\n for i in 0...ordered_results.length\n final_result << [AppConstants::FRIENDLY_RATING_NAMES[i],ordered_results[i][0],(ordered_results[i][1].to_f/total_votes.to_f)*100]\n end\n \n final_result\n end", "title": "" }, { "docid": "43412e659f08d464e8a1a59f240ceaf6", "score": "0.58717304", "text": "def details\n \"sugar: #{@sugar} / butter: #{@butter}\"\n end", "title": "" }, { "docid": "fff8867fcfd780760aca79155266c218", "score": "0.5864503", "text": "def rating_descriptions\n raters.map { |rater| rater.description }\n end", "title": "" }, { "docid": "328eb27da02ca63579509430afba965c", "score": "0.5862398", "text": "def print_class\n\n puts \"* #{name.capitalize} *\".colorize(:light_green).bold.indent(10)\n puts\n puts short_description.to_s.colorize(:green).indent(10)\n puts\n stats.each_pair do |name, value|\n print \"| \".colorize(:green).indent(10)\n print \" #{name.capitalize} :\".colorize(:light_green)\n print \" #{value}\"\n print \" |\".colorize(:green)\n end\n puts\n puts\n\n end", "title": "" }, { "docid": "d64406bd3f85bc07fe72b03bab5b88b3", "score": "0.58564085", "text": "def preetify\n preety_print do |instance|\n instance['users'].each_with_index do |user, index|\n puts \"user_#{index}\".to_s.ljust(30) + user['name'].to_s\n end\n\n instance['tickets'].each_with_index do |ticket, index|\n puts \"ticket_#{index}\".to_s.ljust(30) + ticket['subject'].to_s\n end\n end\n end", "title": "" }, { "docid": "523b64c0da01d0e92b759f5d70bb11a2", "score": "0.5851987", "text": "def results\r\n print_books\r\n print_toys\r\n print_classes\r\n end", "title": "" }, { "docid": "f238c141e90f15f77388b16a1fbf7641", "score": "0.5850654", "text": "def display_book_info(book)\n puts \"*\" * 20\n puts \"\"\n puts \"Title: \" + book[\"volumeInfo\"][\"title\"]\n puts \"Snippet: \" + book[\"searchInfo\"][\"textSnippet\"]\n puts \"\"\nend", "title": "" }, { "docid": "6a082d16740ee017493941283ee3f1d4", "score": "0.5837081", "text": "def print_results(db, athlete_name)\n ath_reps = db.execute 'SELECT athletes.name, repetitions.distance, repetitions.effort, athlete_repetitions.elapsed_time, repetition_sets.date FROM athletes JOIN athlete_repetitions ON athletes.id = athlete_repetitions.athlete_id JOIN repetition_sets ON athlete_repetitions.repetition_set_id = repetition_sets.id JOIN repetitions ON repetition_sets.repetition_id = repetitions.id WHERE athletes.name = (?)', [athlete_name]\n ath_reps.each { |row| p \"#{row[0]} ran #{row[1]}m at #{row[2]}% effort in #{row[3]}s on #{row[4]}\" }\n end", "title": "" }, { "docid": "a9f14cc480298057fc092e0e6db79463", "score": "0.5798461", "text": "def print_reps(input)\n @list = if input != \"ALL\"\n @@all.select { |rep| rep.party.strip == input.to_s }\n else\n @@all\n end\n @list.each_with_index do |rep, index|\n puts <<-DOC\n #{index + 1}. #{rep.name} - Party: #{rep.party.rstrip}, #{rep.district}\n Phone: #{rep.phone}, Email: #{rep.email}\n DOC\n end\n end", "title": "" }, { "docid": "9a037fd2865908d0ec51d6dfd52a620b", "score": "0.57726514", "text": "def print_trail_info\n puts \"Rating: #{self.rating}\"\n puts \"Distance: #{self.distance} mi\"\n puts \"Surface Type(s): #{self.surface}\"\n puts \"Brief Description: #{self.info}\\n\"\n puts \"--------------------------------------------------------------------------------\\n\"\n end", "title": "" }, { "docid": "58d2e3fef935129c6d89c5b66a4ad3cf", "score": "0.57700914", "text": "def summary\n divider = \"-\" * 60\n \"#{divider}\\n#{title}\\n#{divider}\\nReleased: \" +\n \"#{release_date.strftime(\"%d %b %Y\")}\\n#{divider}\\n#{plot}\\n#{divider}\" +\n \"\\nCast: #{cast}\\n#{divider}\\n#{rating_summary}\\n\"\n end", "title": "" }, { "docid": "ca213fb3302c621bb6a571f620c1c624", "score": "0.5765481", "text": "def outputStandard(reviews, store)\n if reviews.any?\n puts \"=== Store: #{store[:name]}\"\n\n reviews.each_with_index do |review, index|\n puts sprintf(%{%s %s, \"%s\", by %s, for version %s, on %s},\n review[:rating], review[:rating] > 1 ? \"stars\" : \"star\", review[:subject],\n review[:author], review[:version], review[:date])\n puts review[:body]\n puts \"--\\n\" if index + 1 < reviews.size\n end\n end\nend", "title": "" }, { "docid": "e43d454caaf1cf69536ce35cb28bc2a8", "score": "0.5758268", "text": "def print_primary_attributes\n \"Strenght(STR):#{str}, Dexterity(DEX):#{dex}, Inteligence(INT):#{int}, Constitution(CON):#{con}, Appearence(APP):#{app}, Power(POW):#{pow}, Size:#{siz}, Education:#{edu}\"\n end", "title": "" }, { "docid": "aa6bd93cc06aac5c503316eb7a0b8c35", "score": "0.5749455", "text": "def idi_rating_str(program)\n render_program_row(\"IDI Rating\", sprintf(\"%3.1f\", program.rating)) if program.rating\n # end\n end", "title": "" }, { "docid": "d70e23e30b0a5b52eaf895c3070716f1", "score": "0.5742534", "text": "def display_story(user_title, user_rating)\n puts user_title + \" got a score of \" + user_rating\nend", "title": "" }, { "docid": "90e2530666e14a100dc08db1efcd5ee6", "score": "0.57404494", "text": "def preetify\n preety_print do |instance|\n org = instance['organization'] || { 'name' => 'N/A' }\n puts 'organization_name'.to_s.ljust(30) + org['name']\n\n %w[submitter assignee].each do |user_key|\n user = instance[user_key] || { 'name' => 'N/A' }\n puts user_key.ljust(30) + user['name']\n end\n end\n end", "title": "" }, { "docid": "e22d4a52b4016806ac8c9d92bdac332b", "score": "0.5732421", "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": "d5aa09a0ea306ffb39d5201248df9c69", "score": "0.5730465", "text": "def rating; \"Д/379 (stub)\"; end", "title": "" }, { "docid": "55cab854e92f14b343045ce93a48e78c", "score": "0.572314", "text": "def display_story(user_title, user_rating)\n\tputs(\"You've rate the movie #{title} #{rating}\")\nend", "title": "" }, { "docid": "4f22762ad8dd74b7113c55b47217cd88", "score": "0.57119775", "text": "def grab_rating(char_id, slot_id)\n\t @char_id = char_id\n\t @slot_id = slot_id\n\t# puts \"#{@gladiator[@char_id]} uses #{@stat_name[@char_id][@slot_id]}\" #shows gladiator and randomly selected rating name\n\t @rating = @stat[@char_id][@slot_id]\n\t# puts \"#{@stat_name[char_id][slot_id]} @rating is #{@rating}\" # shows rating name and rating\n\tend", "title": "" }, { "docid": "7e21d54b5ff98d2952316333c663dfe3", "score": "0.5705268", "text": "def rating\n rating_id.get_object.name\n end", "title": "" }, { "docid": "685995fb35222367660b63070771dff2", "score": "0.56992507", "text": "def get_info\n @output = \"Voter, #{@name}, #{@politics}\"\n end", "title": "" }, { "docid": "f5a5aadf883bb9ce105f11dc732e26c2", "score": "0.56926316", "text": "def display\n puts \"#{GtCommon.capitalize(@headline)} -- (Liked: #{@like_number}) \\n\\n\"\n puts @sentence \n end", "title": "" }, { "docid": "5957bc17b942e97e1a141adf1919a586", "score": "0.56902397", "text": "def display_story(title, rating)\n\tputs(\"You've rated the movie #{title} #{rating}\")\nend", "title": "" }, { "docid": "d0c33d0cd7eee7407b2a84a5b8bd7107", "score": "0.5684167", "text": "def print_movies(films)\n # some iteration magic and puts out the movies in a nice list\n title = films.map {|film| film[\"title\"]}\n # binding.pry\nend", "title": "" }, { "docid": "b2e2fcfc141a53b2b6d79d82bd8026ab", "score": "0.5674176", "text": "def display\n puts \"Title: #{@title}\"\n puts \"Author: #{@author}\"\n puts \"Price: #{@price}\"\n end", "title": "" }, { "docid": "1252481b7db7eecdb5beb28bf8234892", "score": "0.5672315", "text": "def get_breakdown()\n info = @critic_pages.search(\"ol.reviews.critic_reviews div.review_stats\")\n rating = {}\n info.each do |review|\n rating[review.search(\"div.review_critic div.source\").text] = review.search(\"div.review_grade.critscore\").text.to_i\n # breakdown << rating\n end\n return rating\n end", "title": "" }, { "docid": "5001ab3875e9af65913933a53d3ac6aa", "score": "0.56721383", "text": "def display_card_details(choice)\n puts \"=====================\"\n puts \"| #{choice[\"name\"].upcase}\"\n puts \"=====================\"\n puts \"| INTELLIGENCE:.. #{choice[\"intelligence\"]}\"\n puts \"| STRENGTH:...... #{choice[\"strength\"]}\"\n puts \"| SPEED:......... #{choice[\"speed\"]}\"\n puts \"| DURABILITY:.... #{choice[\"durability\"]}\"\n puts \"| POWER:......... #{choice[\"power\"]}\"\n puts \"| COMBAT:........ #{choice[\"combat\"]}\"\n puts \"=====================\"\nend", "title": "" }, { "docid": "c904ffdb6459170b591e942b13e875d3", "score": "0.5671262", "text": "def display\n puts\n puts \"* Class: #{self.class_name} *\"\n puts\n puts \"Description: #{self.description}\"\n puts\n puts \"Spellcasting: #{spellcasting}\"\n puts\n puts \"-----------------------------\"\n end", "title": "" }, { "docid": "e574c0cb5fdd939d8ae9e9a48070390a", "score": "0.56585354", "text": "def display_individual_treatments(treatment)\n puts \"Treatment: #{treatment.name}\\n\\n\".magenta \n puts \"The Package: #{treatment.description}\\n\\n\" \n puts \"The Cost: #{treatment.price} spa points\\n\\n\\n\".green\nend", "title": "" }, { "docid": "0f41df72ed6bccf56622a16aafb10bd0", "score": "0.56544566", "text": "def show\n goodreads = Goodreads.new.book_by_isbn(@book.isbn)\n @rating = goodreads.average_rating.to_f\n @num_ratings = goodreads.work.ratings_count\n rescue\n @rating = 0.0\n @ratings_count = 0\n end", "title": "" }, { "docid": "541ec213f7468a9a0fc1582975d52e6f", "score": "0.5652477", "text": "def show_qualified\n pp ordered_by_qualifications\nend", "title": "" }, { "docid": "a26d16d2ae2b5f58b00765babf3f8276", "score": "0.5635879", "text": "def pretty_print_nds(nds)\n d= directors_database\n #binding.pry\n pp d\n\nend", "title": "" }, { "docid": "dfdadb50a02ad4749bbc643f3aaca1fd", "score": "0.56289035", "text": "def report(driver_sum, money_result, rate_result)\n puts \"\\nPerformance Report: \\n\\n\"\n\n driver_sum.each do |item|\n puts \"Driver ##{item[:id]}: #{item[:ride_num]} rides, made $#{item[:total_money]}, averate rate #{item[:aver_rate]}\"\n end\n\n puts \"\\nDriver(s) made the most money $#{money_result[0]}: #{money_result[1]}\"\n puts \"Driver(s) got the highese average rating #{rate_result[0]}: #{rate_result[1]}\\n\\n\"\nend", "title": "" }, { "docid": "d9ddc1a648a72e5100bae49d399590f9", "score": "0.5612613", "text": "def show\n @overall = overall_rating\n end", "title": "" }, { "docid": "2c46168210721f8b6cad1b7014f0268d", "score": "0.56114787", "text": "def pretty_print_nds(nds)\n # Change the code below to pretty print the nds with pp\n #binding.pry\n pp nds\nend", "title": "" }, { "docid": "be6407357b0685c5c7355f87ea584ebd", "score": "0.5607654", "text": "def print_details( result_counts, score )\n puts ('=' * 10) << \"\\n\"\n @groups.each_with_index { |group, index| group.each { |row| puts \"#{row} Group \" << (index + 1).to_s } }\n puts '-' * (@groups[0][0].length * 3)\n puts \"#{result_counts} Score\"\n puts \"\\nTotal Score: #{score}\\n\"\n end", "title": "" }, { "docid": "28754c0a7a112c72f56797cd03a89b30", "score": "0.56060654", "text": "def display_story(title, rating)\n puts(\"The story title is #{title} and its rating is #{rating}.\")\nend", "title": "" }, { "docid": "45d2e2aea826eda8df59643dd49b431c", "score": "0.5605615", "text": "def display(reviews)\n puts \"\\n\\nTop #{REVIEWS_TO_FIND} Overly Positive Endorsements of McKaig Chevrolet Buick\\n\\n\"\n\n reviews.each_with_index do |review, idx|\n puts \"#{idx + 1}. #{review}\"\n end\nend", "title": "" }, { "docid": "6205581097b1a2d3151ed7152a4dff3b", "score": "0.5596844", "text": "def output_details io, max = nil\n io.puts\n\n each_by_score max do |class_method, score, call_list|\n self.print_score io, class_method, score\n\n if option[:details] then\n call_list.sort_by { |k,v| -v }.each do |call, count|\n io.puts \" %6.1f: %s\" % [count, call]\n end\n io.puts\n end\n end\n end", "title": "" }, { "docid": "7809187951beb82be6c7ad54ebde19be", "score": "0.5594025", "text": "def fav_recipes_names(fav_recipes)\n fav_recipes.each.with_index(1) do |rating, i|\n puts \"#{i}. Title: #{rating.recipe.title.capitalize}\"\n puts \" Ingredients: #{rating.recipe.ingredients_name_string}\"\n puts \" Steps: \\n #{rating.recipe.steps}\"\n\n puts \"------------------------------------------------------------------------------------------------------\".colorize(:cyan).bold\n end\n end", "title": "" }, { "docid": "621ce2006803271c33465600dbb33795", "score": "0.55878097", "text": "def print_basic_info\n \"Name:#{name}, Occupation:#{occupation}, Sex:#{sex}\"\n end", "title": "" }, { "docid": "a45ea1f612c31a098b1857c2841ca9b4", "score": "0.5586599", "text": "def display_predictions(name)\n first_name = name.split(\" \")[0]\n last_name = name.split(\" \")[1]\n\n puts \"Predictions for \" + name + \" are - \"\n @predictions.each do |prediction|\n if (prediction == 'first_name_dot_last_name')\n puts first_name.downcase + \".\" + last_name.downcase + \"@\" + @domain_name\n end\n\n if (prediction == 'first_name_dot_last_initial')\n puts first_name.downcase + \".\" + last_name[0].downcase + \"@\" + @domain_name\n end\n\n if (prediction == 'first_initial_dot_last_name')\n puts first_name[0].downcase + \".\" + last_name.downcase + \"@\" + @domain_name\n end\n\n if (prediction == 'first_initial_dot_last_initial')\n puts first_name[0].downcase + \".\" + last_name[0].downcase + \"@\" + @domain_name\n end\n end\n puts \"-\" * 50\n end", "title": "" }, { "docid": "0b4d594434094b845d56a1291dcbab67", "score": "0.5581501", "text": "def stars\n details.css(\"div.plot_summary_wrapper span[itemprop='actors'] a[href^='/name/nm']\").map do |node|\n imdb_id = node['href'].parse_imdb_id\n name = node.text.strip\n\n [imdb_id, name]\n end.map do |values|\n Spotlite::Person.new(*values)\n end\n end", "title": "" }, { "docid": "4274fcc5780b09c16cbb2e8d8ab8d40d", "score": "0.5580942", "text": "def show\n @reviews = @dog.reviews\n @rating = Review.get_average_rating(@dog)\n end", "title": "" }, { "docid": "bc5d1c38603080023270e58e2a2b4cb5", "score": "0.55779785", "text": "def show\n @preliminaries = Match.preliminary.group_by { |m| m.group.to_s }.sort_by { |group, m| group }\n @finals = Match.final.group_by { |m| m.round }\n @tips = current_user.tips\n @user = current_user\n end", "title": "" }, { "docid": "6968574de342cf252cdcc6c338c9d010", "score": "0.5572973", "text": "def recipePrintHelper(name)\n myrecipe = @RecipeHash[name]\n puts \"#{myrecipe.name} #{myrecipe.calories}\"\n # Loop through each ingredient and print out the required ingredient name and\n # and the associated calories.\n myrecipe.ingredients.each do |ingredient|\n puts \" #{@BasicHash[ingredient].name} #{@BasicHash[ingredient].calories}\\n\"\n end\n end", "title": "" }, { "docid": "01b5d4bec4e4e661e67332fc5b785bcd", "score": "0.55693007", "text": "def print_results(name, result, score, separator = \"\\n\")\n print \" \" + name.ljust(24).slice(0, 23) +\n \" Result: \" + result.ljust(10).slice(0, 9) +\n \" Score: \" + score.to_s.ljust(10).slice(0, 9) +\n separator\n end", "title": "" }, { "docid": "80bd8fc72bd7b350df75a440c2839a48", "score": "0.5568098", "text": "def report_body\n order_sorted_body.each_with_object([]) do |result, obj|\n rating = rate(result[:last], result[:min], result[:max])\n\n obj << \"#{avg_label} #{result[:avg].to_s.ljust(12)} \" \\\n \"#{min_label} #{result[:min].to_s.ljust(12)} \" \\\n \"#{max_label} #{result[:max].to_s.ljust(12)} \" \\\n \"#{run_label(rating)} #{result[:last].to_s.ljust(12)} \" \\\n \"#{des_label} #{result[:desc]}\\n\"\n end.join\n end", "title": "" }, { "docid": "51d9e64828f2b6885348f237967c1c04", "score": "0.5562843", "text": "def PersonDetails()\n\t\tgenderList()\n\t\tputs \"\"\n\t\tputs \"Top Male List regarding salary\\n\"\n\t\ttop10salary($MaleList);\n\t\tputs \"\"\n\t\tputs \"Top Female List regarding salary\\n\"\n\t\ttop10salary($FemaleList);\n\tend", "title": "" }, { "docid": "671f4e4ffa21f02180e6ffdaef811ecf", "score": "0.55622977", "text": "def rating\n @rating\n end", "title": "" }, { "docid": "9cc222f9e3d21c612980b885b1d0c4ba", "score": "0.55600625", "text": "def summarize\n print \"# of asks: #{ask_count}\\n# of bids: #{bid_count}\\nAsk volume: #{ask_volume.to_s('F')}\\nBid volume: #{bid_volume.to_s('F')}\\n\"\n $stdout.flush\n end", "title": "" }, { "docid": "152ef10df100a46fa7cdea5f2eb7059d", "score": "0.5554283", "text": "def pretty_print_nds(nds)\n pp directors_database\nend", "title": "" }, { "docid": "71b809c8df07dbab5c188de1ee7cc77b", "score": "0.5554201", "text": "def rating_text(rating)\n base = \" Level Opportunity\"\n if rating>9\n \"Ruby\"+base\n elsif rating>7.5\n \"Gold\"+base\n elsif rating>6\n \"Silver\"+base\n else\n \"Bronze\"+base\n end\nend", "title": "" }, { "docid": "194e97ca6a3e186996c5c1e91fead1f0", "score": "0.55451196", "text": "def details\n \"sugar: #{@sugar} | flour: #{@flour}\"\n end", "title": "" }, { "docid": "40c3a8facb73dca4607e2279fd5a376f", "score": "0.55306345", "text": "def application_info(name, stars=3)\n puts \"#{name} currently has #{stars} stars\"\nend", "title": "" }, { "docid": "1c725c843c28b85c842b9684b3d7afee", "score": "0.55174744", "text": "def apt_viewer(db)\n apts = db.execute(\"SELECT * FROM apt_list\")\n apts.each do |apt|\n puts \"\\n\\nApt #{apt['id']}) #{apt['name']}, located at #{apt['address']} is rated #{apt['rating']} because #{apt['comments']}.\\nThe monthly rent is in the range of #{apt['rent_range']} and includes #{apt['amenities']} with an average rush-hour commute time of #{apt['commute']} minutes.\"\n end\nend", "title": "" }, { "docid": "5a0666413e97a49b905a082f35250c71", "score": "0.5516095", "text": "def info_risks\n\t\t\t\t\twhere(:severity => 0).where(:rollup_finding => false)\n\t\t\t\tend", "title": "" }, { "docid": "241cf630d259551b5c434b7cf2626040", "score": "0.5507261", "text": "def prettyPrint\n\t\tputs \"'#{@name}' : #{@ingredient.length} ingredients\"\n\n\t\t\t# The 0..X operator generates a list that contains\n\t\t\t# integers starting at 0 and going up to and including\n\t\t\t# \"X\", so\n\t\t\t# 0..4\n\t\t\t# produces the list\n\t\t\t# [ 0, 1, 2, 3, 4 ]\n\t\t\t#\n\t\t\t# The \"for loop\" here therefore will run as many times\n\t\t\t# as the \"@ingredient\" list has items, and \"i\" will\n\t\t\t# take on the values 0, 1, 2... in turn\n\t\t\t#\n\t\tfor i in [email protected]\n\t\t\tputs \" #{@ingredient[i].amount} #{@ingredient[i].units} #{@ingredient[i].name}\"\n\t\tend\n\n\t\t\t# if we have a garnish, then print it\n\t\tif @garnish\n\t\t\tputs \" Garnish with #{@garnish}\"\n\t\tend\n\tend", "title": "" }, { "docid": "39e9463c84d711b384b2c471a42ab5c8", "score": "0.5507025", "text": "def print_name_and_health(player)\n puts \"#{player.name.ljust(20,'.')}#{player.score}\"\n player.each_treasure do |treasure|\n puts \"#{treasure.points} points from #{treasure.name}\"\n end\n puts \"...for a grand total of #{player.points} points.\"\n end", "title": "" }, { "docid": "639090cf5bd0a1f8f78d928bcf40c16f", "score": "0.55034846", "text": "def print_results\r\n @cordinators.each do |c|\r\n print c.klass.to_s.ljust(25, ' ')\r\n c.print_stats\r\n end\r\n end", "title": "" }, { "docid": "e63e5b4e5255542a0797226757b5aed2", "score": "0.5501874", "text": "def display_each\n puts \" * #{self.experience} experience at #{self.company_name}\"\n end", "title": "" }, { "docid": "ce6893b76d3d0ae9ae101f75322cae40", "score": "0.5495323", "text": "def format_results\n speakers_hash.each_pair do |speaker, lines|\n puts \"#{speaker.titleize}: #{lines}\"\n end\n end", "title": "" }, { "docid": "b9ed7d6afc1827f77a8ff4b7b8628392", "score": "0.54816544", "text": "def display\n\t\tputs \"#{@guess_line.join(' ')} | #{@incorrect_guesses_count} | #{@misses.join(' ')}\"\n\tend", "title": "" }, { "docid": "6dc24663ab126693f8e0defaf42acf7b", "score": "0.5477088", "text": "def display\n\t\t\"SUITE: #{@suite}, RANK: #{@rank}, VALUE: #{@value}\"\n\tend", "title": "" }, { "docid": "3841fe16ac7f340dd173afc90fad4dc1", "score": "0.5475543", "text": "def print_reindeer_ranking\n puts @reindeer_ranking\n end", "title": "" }, { "docid": "bd03c3322037a2ca64cab77ad544291d", "score": "0.54704976", "text": "def look_pretty(list)\n puts \"Here is your grocery list:\"\n list.each { |item, quantity| puts \"#{item}: #{quantity}\" }\nend", "title": "" }, { "docid": "cb2bee912daa3ab2c0770652163304da", "score": "0.546815", "text": "def get_info\n puts \"#{@title} by #{@author} is #{@status}.\"\n if @description\n puts \"#{@title} description: #{@description}.\"\n end\n end", "title": "" }, { "docid": "ba756c2067fe8bf12ca8a2bb0d935107", "score": "0.54673976", "text": "def print_contents\n\t\tputs \"Artist: %s\" % [@artist]\n\t\tputs \"Album: %s\" % [@title]\n\t\tputs \"Released: %s\" % [@year]\n\n\t\tif @cd_count > 0\n\t\tputs \"CD(%d): %s\" % [@cd_count, @cd_id]\n\t\tend\n\n\t\tif @tape_count > 0\n\t\tputs \"Tape(%d): %s\" % [@tape_count, @tape_id]\n\t\tend\n\n\t\tif @vinyl_count > 0\n\t\tputs \"Vinyl(%d): %s\" % [@vinyl_count, @vinyl_id]\n\t\tend\n\n\tend", "title": "" }, { "docid": "b78fdaf7bec35edf6c3d4cbcce13f58d", "score": "0.54657096", "text": "def show\n\t\tputs @gender+\" - \"+@blood_type+\" - \"+@weight+\" - \"+@infected\n\tend", "title": "" }, { "docid": "d3be61558d989958388ca8e6bc0c4b82", "score": "0.54566646", "text": "def print_score io, name, score\n location = method_locations[name]\n if location then\n sep = \" \"\n sep = \"%-11s\" % \"\\n\" if option[:extended]\n io.puts \"%8.1f: %-32s%s%s\" % [score, name, sep, location]\n else\n io.puts \"%8.1f: %s\" % [score, name]\n end\n end", "title": "" }, { "docid": "f827b2ef34db14ef41a33bc82a4c0a60", "score": "0.5451993", "text": "def print_person\n puts \"Name: #{name}\"\n puts \"Age: #{age} years old\"\n puts \"ID: VCN#{id}\"\n end", "title": "" }, { "docid": "a159af6b499e8810b631f7d5bfd01f55", "score": "0.5449956", "text": "def pretty_print_nds(nds)\n #写了binding.pry再learn=>会导致running停在这里,这时候打nds就可以看到它的具体数据\n=begin [{:name=>\"Stephen Spielberg\",WhenUsingPpToDisplayComplexDataStructures>)> nds\n :movies=>\n [{:title=>\"Jaws\",\n :studio=>\"Universal\",\n :worldwide_gross=>260000000,\n :release_year=>1975},\n {:title=>\"Close Encounters of the Third Kind\",\n :studio=>\"Columbia\",\n :worldwide_gross=>135189114,\n :release_year=>1977},\n {:title=>\"Raiders of the Lost Ark\",\n :studio=>\"Paramount\",\n=end\n#nil =>这个是原来存在的,要把这个改了\n pp nds # Change the code below to pretty print the nds with pp\n #这边也可以是pp directors_database,因为数据在那个DB里面\nend", "title": "" }, { "docid": "c93e8531d0ca51b469ec93c00e9d5ac1", "score": "0.5445652", "text": "def about\n\t\tputs \"Gender: #{@gender}\"\n\t\tputs \"Ethnicity: #{@ethnicity}\"\n\t\tputs \"Age: #{@age}\"\n\t\tp \"Reindeer Ranking: #{@reindeer_ranking}\"\n\tend", "title": "" }, { "docid": "ad54166704e7fef66c09ad5c3441550f", "score": "0.54435354", "text": "def dump_votes\n namings.map do |n|\n str = \"#{n.id} #{n.name.real_search_name}: \"\n if n.votes.empty?\n str += \"no votes\"\n else\n votes = n.votes.map do |v|\n \"#{v.user.login}=#{v.value}\" + (v.favorite ? \"(*)\" : \"\")\n end\n str += votes.join(\", \")\n end\n str\n end.join(\"\\n\")\n end", "title": "" }, { "docid": "d2855e804e2bdea20b05caf650e87577", "score": "0.5442247", "text": "def print_details\n puts \"#{@dog_walker.name} walked #{@dog.name} for #{length_in_minutes} minutes.\"\n end", "title": "" }, { "docid": "877f25853e8f3fae4645f5e83237a088", "score": "0.54399174", "text": "def print_summary\n puts \"\\n\\nScore : # Instances\\n\" << (\"=\" * 19)\n @summary_totals.each_with_index { |value, index| puts \" %5d:%8d\\n\" % [index, value] unless value.nil? }\n puts \"\\n** End of Report\"\n end", "title": "" }, { "docid": "725e5e299bdfefc03ecc801576295be4", "score": "0.5438185", "text": "def prettyPrint\n\t\tputs \"'#{@name}' : #{@ingredient.length} ingredients\"\n\n\t\tfor i in [email protected]\n\t\t\tputs \" #{@ingredient[i].amount} #{@ingredient[i].units} #{@ingredient[i].name}\"\n\t\tend\n\n\t\tif @garnish\n\t\t\tputs \" Garnish with #{@garnish}\"\n\t\tend\n\tend", "title": "" }, { "docid": "c215ad63364f1279eceffbec92f08a8e", "score": "0.54356575", "text": "def print_table(db, title, rating, comments)\r\n\t\tputs \" - - Title - - Rating - - Comments--\"\r\n\t\tmovie = db.execute(\"SELECT * FROM movies ORDER BY rating ASC\")\r\n\t\tmovie.each do |mov|\r\n\t\t\tprintf \" * %-13s| %-4s| %-5s\\n\", \"#{mov['title']}\", \"#{mov['rating']}\", \"#{mov['comments']}\"\r\n\t\tend\r\n\t\tputs\"-\"*60\r\n\tend", "title": "" }, { "docid": "c2f6844f7636798da118c4d3e606be50", "score": "0.5434788", "text": "def show\n # binding.pry\n \n end", "title": "" }, { "docid": "dd7d26d24dacdc0925015448552f2496", "score": "0.54283196", "text": "def show_information_card\n puts \"------------------------------\"\n puts \"Name: #{@name}\"\n puts \"Address: #{@address}\"\n puts \"Email: #{@email}\"\n puts \"Random Fact: #{@random_fact}\"\n puts \"-----------------------------\"\n end", "title": "" }, { "docid": "cb4ab6043b49b03d2e8b4e01ecc25efa", "score": "0.5427954", "text": "def display_score\n puts \"-----#{@name}-----\"\n puts \"Score: #{@score} \"\n puts \"Lives left: #{@lives}\"\n puts \"---------------\"\n end", "title": "" }, { "docid": "33b4d886f5b2fa564ec9e5b1fbcd5154", "score": "0.54249406", "text": "def print_details(inst)\n print \"ID: \".bold, inst[:id], \" Name: \".bold, inst[:name], \" State: \".bold, inst[:state]\n if inst[:state] == 'running'\n print \", launched at #{inst[:launched]}\"\n elsif inst[:reason]\n print \" via #{inst[:reason]}\"\n end\n puts\n\n if inst[:vpc]\n print \"VPC: \".bold, inst[:vpc], \" Subnet: \".bold, inst[:subnet]\n else\n print \"EC2 Classic\".bold\n end\n print \" Private IP: \".bold, echo_ip( inst[:private_ip] )\n if inst[:vpc] and not inst[:private_ip]\n print \" Public IP is not allocated\".bold\n else\n print \" Public IP: \".bold, echo_ip( inst[:public_ip] )\n end\n puts\n\n print \"EC2 Class: \".bold, inst[:ec2_class], \" [#{inst[:virtualization_type]}]\", \" Arch: \".bold, inst[:arch]\n print \" [Spot]\".bold if inst[:spot]\n print \" [Monitoring]\".bold if inst[:monitoring]\n if inst[:windows]\n print \" [Windows]\".bold\n else\n print \" Keypair: \".bold, inst[:key_pair]\n end\n puts\n\n print \"AMI: \".bold, inst[:ami], \" (#{inst[:ami_desc]})\"\n puts\n\n print \"Security Groups: \".bold, inst[:sec_groups]\n puts\nend", "title": "" }, { "docid": "aa2aca69e296523f2e9ef4354e63d20f", "score": "0.542116", "text": "def pretty_text_pokemon(pokemon_ins)\n puts \"#{pokemon_ins.name.capitalize}\\n\"\n print \"Type: #{pokemon_ins.types_array[0].name.capitalize}\" \n print \"/#{pokemon_ins.types_array[1].name.capitalize}\" if pokemon_ins.types_array[1] \n puts \"\"\n puts \"\\n#{pokemon_ins.pokedex_entry}\"\n puts \"\\nHeight: #{(pokemon_ins.height * 3.937).round(2)} in / #{(pokemon_ins.height * 0.1).round(2)} m\"\n puts \"Weight: #{(pokemon_ins.weight / 4.536).round(1)} lb / #{(pokemon_ins.weight * 0.1).round(2)} kg\"\n end", "title": "" }, { "docid": "b70b33842419a70aec1a78bc350b928c", "score": "0.5419509", "text": "def rating\n response[\"rating\"]\n end", "title": "" }, { "docid": "e4cc276bb571069f49baeeef78677720", "score": "0.54145443", "text": "def pretty_print_nds(nds)\n pp directors_database\nend", "title": "" }, { "docid": "e4cc276bb571069f49baeeef78677720", "score": "0.54145443", "text": "def pretty_print_nds(nds)\n pp directors_database\nend", "title": "" }, { "docid": "b087ed44610beacb4e689a06bb108a6e", "score": "0.54140824", "text": "def inspect\n [self,(\"(#{pretty_score})\" if @score),(\"(language:#{language})\" if language)].compact.join(\" \")\n end", "title": "" } ]
c5d2e5a71683bf52d3a7e79610ca7b0a
POST /projects POST /projects.json
[ { "docid": "ea62dc94c8a4f362d9fdf07bd686dae1", "score": "0.0", "text": "def create\n @project = Project.new(project_params)\n @project.user_id = current_user.id\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "3987b362caed851c61fc0c13c211f4a8", "score": "0.7338948", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.json { render :json => @project, :status => :created, :location => @project }\n format.html { redirect_to(projects_path) }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @project.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ad2bc5d86b98a702829abd9ac259c794", "score": "0.73139244", "text": "def create_project(name)\n post('projects', {:name => name})[\"project\"]\n end", "title": "" }, { "docid": "a689a8ab25b302b12b72f65ca83402b0", "score": "0.7308003", "text": "def create\n @project = Project.new(project_params)\n\n if @project.save\n render json: @project, status: 200\n else\n render json: { errors: @project.errors.messages }, status: 200\n end\n end", "title": "" }, { "docid": "56bee2a584e5cdcb55aea35841fd4c42", "score": "0.7299582", "text": "def create\n @project = Project.new(project_params)\n\n if @project.save\n render json: @project, status: :created\n else\n render json: @project.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "fffab1d63dd52e8b1d3eca95d68801a1", "score": "0.7227503", "text": "def create\n @urlroot = Designax::Application.config.urlroot\n if params[:pk] == \"new\" and params[:name] == \"project_name\"\n project_name = params[:value]\n @project = Project.new()\n @project.project_name = project_name\n else\n @project = Project.new(params[:project])\n end\n\n respond_to do |format|\n if @project.save\n redirect_url = @urlroot + \"/projects\"\n response_url = { \"url\" => redirect_url }\n format.json { render json: response_url, status: 200 }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d36b4caf16f2c60303960edae31d7f7e", "score": "0.7225945", "text": "def create\n @project = Project.new(params[:project] || JSON.parse(request.body.read))\n\n if (params[:id])\n @project.id = params[:id]\n end\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to(@project, :notice => 'Project was successfully created.') }\n format.xml { render :xml => @project, :status => :created, :location => @project }\n format.json { render :json => @project }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @project.errors, :status => :unprocessable_entity }\n format.json { render :text => \"error creating project via http/json\" }\n end\n end\n end", "title": "" }, { "docid": "8f02de7f9d657ea96c5e01b3fc34b964", "score": "0.71982473", "text": "def test_should_create_project_via_API_JSON\r\n get \"/logout\"\r\n post \"/projects.json\", :api_key => 'testapikey',\r\n :project => {:user_id => 1,\r\n :url => 'http://www.apiproject.com',\r\n :name => 'API Project',\r\n :description => 'API Project Desc' }\r\n assert_response :created\r\n project = JSON.parse(response.body)\r\n check_new_project(project) \r\n end", "title": "" }, { "docid": "f719b7397393c8c24dc72f27c491f2b7", "score": "0.71170384", "text": "def create\n\t\t@project = current_user.projects.new(project_params)\n\n\t\trespond_to do |format|\n\t\t\tif @project.save\n\t\t\t\tformat.json { render :show, status: :created }\n\t\t\telse\n\t\t\t\tformat.json { render json: @project.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "405f971fe23d69237297c0ac81a5e34f", "score": "0.7104803", "text": "def create\n @projects = current_user.projects\n @project = current_user.projects.new(project_params)\n\n respond_to do |format|\n if @projects << @project\n format.html { redirect_to user_projects_path(current_user), notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "99bdb47bf8218042f3c377a86db83d1a", "score": "0.7095263", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.json { render json: @project, status: :created, location: @project }\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n else\n format.json { render json: @project.errors, status: :unprocessable_entity }\n format.html { render action: \"new\" }\n end\n end\n end", "title": "" }, { "docid": "13388bc888c2dc5dd6a69754079a1706", "score": "0.7070636", "text": "def create\n @project = current_user.projects.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9c66a6d63a12b1687073fadedff2d30", "score": "0.70408624", "text": "def create(attributes={})\n raw_response = post_request('projects', project: attributes)\n parse_response(raw_response, :project)\n end", "title": "" }, { "docid": "9b88a2860a538397f208681fbbd0af31", "score": "0.70358187", "text": "def create\n #byebug\n @project = Project.new(create_params)\n @project.user_id = @current_user.id\n @project.save\n #@project = Project.create(name_project: \"prueba\", subsidy: true, parking: true, user_id: @current_user.id)\n #byebug\n render json: @project, status: :created\n end", "title": "" }, { "docid": "aad78ab40ffc8be59f17b00d2cdb9660", "score": "0.7024969", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to(@project, :notice => 'Project was successfully created.') }\n format.json { render :json => @project, :status => :created, :location => @project }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @project.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e43ba57907e1c9a4560b1306964a11bd", "score": "0.70191896", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to projects_path, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f7bbc093f38304c086b9bccdf27a9a39", "score": "0.7009597", "text": "def create\n @project = Project.new(project_params)\n if @project.save\n render json: @project, status: :ok\n else\n render json: {error: @project.errors.full_messages.to_sentence } , status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "c4d226c4e286cbc591d90797ca21acbb", "score": "0.698481", "text": "def create\n @user = current_user\n @project = @user.projects.build(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "20c6c8efe93a1212182c919f5df09eac", "score": "0.697517", "text": "def create\n @project = current_user.projects.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html {redirect_to \"/projects\", notice: \"Project was successfully created.\"}\n format.json {render :show, status: :created, location: @project}\n else\n format.html {render :new, status: :unprocessable_entity}\n format.json {render json: @project.errors, status: :unprocessable_entity}\n end\n end\n end", "title": "" }, { "docid": "42e2aa9dcf3e5566345fd826ebfb1114", "score": "0.6963753", "text": "def create\n @project = current_user.projects.build(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: \"Project was successfully created.\" }\n User.find(current_user.id).projects << Project.find(@project.id)\n @projects_user = ProjectsUser.find_by(user_id: current_user.id, project_id: @project.id)\n format.json { render :show, status: :created, location: @project }\n\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25e9345e1c7a1d33ecb8ab97ce692ec3", "score": "0.6963096", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: t('models.project.create') }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11062254dfa4d0874b8b12c47fd71ca4", "score": "0.6948756", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11062254dfa4d0874b8b12c47fd71ca4", "score": "0.6948756", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11062254dfa4d0874b8b12c47fd71ca4", "score": "0.6948756", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11062254dfa4d0874b8b12c47fd71ca4", "score": "0.6948756", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11062254dfa4d0874b8b12c47fd71ca4", "score": "0.6948756", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11062254dfa4d0874b8b12c47fd71ca4", "score": "0.6948756", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11062254dfa4d0874b8b12c47fd71ca4", "score": "0.6948756", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11062254dfa4d0874b8b12c47fd71ca4", "score": "0.6948756", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "11062254dfa4d0874b8b12c47fd71ca4", "score": "0.6948756", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "18123671d5c213fa093617873e2453fe", "score": "0.6944626", "text": "def create\n @api_project = Project.new(api_project_params)\n\n respond_to do |format|\n if @api_project.save\n format.html { redirect_to @api_project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @api_project }\n else\n format.html { render :new }\n format.json { render json: @api_project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "18256176a7ca400b727f81598dfea325", "score": "0.69397265", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to projects_path, notice: \"Project was successfully created.\" }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new, status: :unprocessable_entity }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f752a4ae689122c766a06486c0c8e8e5", "score": "0.6938008", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to projects_path, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e836ddf07d449226266b238e39a3bfb", "score": "0.69204897", "text": "def create\n @project = @client.projects.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @client, notice: 'Project was successfully created.' }\n else\n format.html { render action: \"new\" }\n end\n end\n end", "title": "" }, { "docid": "27a5184c346b310821730ec4ed0cdf0c", "score": "0.6911497", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.json { render json: @project, status: 200 }\n else\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "127416b252202b8cba89413547026474", "score": "0.6908809", "text": "def create\n @project = current_user.projects.build(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to projects_path, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9918a78b5d58bf11964fb94b936a0818", "score": "0.6907813", "text": "def create\n @project = Project.new(project_params)\n @project.user_id = @user.id\n if @project.save\n render json: {status: :success, project: @project}\n else\n render json: {status: :failed, project: @project}\n end\n end", "title": "" }, { "docid": "2c814df732a312adea249ce61ce59094", "score": "0.6894293", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to projects_path, notice: 'Project was successfully created.' }\n format.json { render action: 'show', status: :created, location: @project }\n else\n format.html { render action: 'new' }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dd8b79f9fe7ad356b2ec87d4e14bfa1f", "score": "0.689054", "text": "def create\n respond_to do |format|\n if project.save\n format.html { redirect_to project, notice: 'Project was successfully created.' }\n format.json { render json: project, status: ':created', location: project }\n else\n format.html { render action: 'new' }\n format.json { render json: project.errors, status: ':unprocessable_entity' }\n end\n end\n end", "title": "" }, { "docid": "de6fcca89bdbe32f27395a6032b10ed2", "score": "0.68847734", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: 'new' }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "31cb3f7e9074f72aaa6703ec48e7639d", "score": "0.6879909", "text": "def create\n @project = current_user.projects.new(project_params)\n if @project.save\n render :show\n else\n render json: { errors: @project.errors }\n end\n end", "title": "" }, { "docid": "fffef68ef0a39d18b7dfd786160759a8", "score": "0.68794346", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to admin_projects_url, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "374f19e779c22c9338785d5aad6ee2db", "score": "0.6879012", "text": "def create\n @project = Project.new(project_params)\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "97cc4be0e078a9e9ec81bcd12511c228", "score": "0.68784195", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, flash: {success: 'Project was successfully created.'} }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ba700c214886315dcde307f818e2065", "score": "0.6868972", "text": "def create\n # authenticate_user!\n @project = Project.new\n @project[:category] = params[:category]\n @project[:title] = params[:title]\n @project[:body] = params[:body]\n @project[:location] = params[:location]\n @project[:image_link] = params[:image_link]\n @project[:project_url] = params[:project_url]\n @project[:year] = params[:year]\n @project[:likes] = params[:likes]\n @project.save\n\n render json: @project\n end", "title": "" }, { "docid": "6df0c80f4f0b8f3960e4e959e2a6b0f1", "score": "0.68664163", "text": "def create\n @project = Project.new(project_params.merge(user_id: current_user.id))\n\n respond_to do |format|\n if @project.save\n format.json { render :show, status: :created, location: @project }\n else\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "95faa526efe10efe90994075218387fa", "score": "0.68660194", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7706747d57b836d85da32cb8dc4b9a0", "score": "0.68657774", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7706747d57b836d85da32cb8dc4b9a0", "score": "0.68657774", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7706747d57b836d85da32cb8dc4b9a0", "score": "0.68657774", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7706747d57b836d85da32cb8dc4b9a0", "score": "0.68657774", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7706747d57b836d85da32cb8dc4b9a0", "score": "0.68657774", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7706747d57b836d85da32cb8dc4b9a0", "score": "0.68657774", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7706747d57b836d85da32cb8dc4b9a0", "score": "0.68657774", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7706747d57b836d85da32cb8dc4b9a0", "score": "0.68657774", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7706747d57b836d85da32cb8dc4b9a0", "score": "0.68657774", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7706747d57b836d85da32cb8dc4b9a0", "score": "0.68657774", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7706747d57b836d85da32cb8dc4b9a0", "score": "0.68657774", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7706747d57b836d85da32cb8dc4b9a0", "score": "0.68657774", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7706747d57b836d85da32cb8dc4b9a0", "score": "0.68657774", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7706747d57b836d85da32cb8dc4b9a0", "score": "0.68657774", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7706747d57b836d85da32cb8dc4b9a0", "score": "0.68657774", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e7706747d57b836d85da32cb8dc4b9a0", "score": "0.6865554", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fc5bf03a320844ead887d44ace86f0f8", "score": "0.68598175", "text": "def create\n @project = Project.new(project_params)\n \n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d20d51557c825f06aacd1e1f9d3e40c5", "score": "0.6858278", "text": "def create\n @client = Client.find(params[:client_id])\n @project = @client.projects.build(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to client_projects_path(@client), notice: 'Project was successfully created.' }\n format.json { render json: client_projects_path(@client), status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: client_projects_path(@client).errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4cc66d23df6453fcb6b78a7b9dd30bcb", "score": "0.6846567", "text": "def create\n @project = current_user.projects.build(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to root_path, notice: 'Enhorabuena! Tienes un nuevo proyecto. A trabajar!' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fd8b91177fdfba7154b48a786ae2dd3", "score": "0.6828604", "text": "def create\n @project = Project.create project_params\n current_user.memberships.create(\n project_id: @project.id,\n owner_at: Time.now\n )\n\n if @project.save\n render 'projects/create', status: 201\n else\n render 'projects/error', status: 422\n end\n end", "title": "" }, { "docid": "1edd7c0496fb3ae705a236c7c612b548", "score": "0.68193066", "text": "def create\n @project = @client.projects.build(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to(client_projects_url(@client), notice: 'Project was successfully created.') }\n format.xml { render xml: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.xml { render xml: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "023e04ca33793e88248cdb25c4bb690b", "score": "0.6806436", "text": "def create\n @create_project = current_user.projects.build(params[:project])\n flash[:notice] = \"Project #{@create_project.description} successfully created\" if @create_project.save\n respond_with(@create_project, layout: !request.xhr?)\n end", "title": "" }, { "docid": "39141b39b44d4ee41f9b041354a73c00", "score": "0.678643", "text": "def new_project\n @request = Request.new(data_type: :project)\n @request.build_contact\n @request.build_project\n @request.build_general_information\n\n render 'new'\n end", "title": "" }, { "docid": "b35573dbf00cdfed62747459ddd8899f", "score": "0.6784763", "text": "def create\t\t\t\t\t\t\t\t\t# Creates record in db and redirects (porbably to index)\n\t\t@project = Project.new(projects_params)\t# Passes only title and desc.\n\n \trespond_to do |format|\t\t\t\t\t# All this is doing is rendering stuff in case of json\n \t\tif @project.save\n \t\tformat.html { redirect_to @project, notice: 'Created a new project!' }\n \t\tformat.json { render :show, status: :created, location: @project }\n \t\telse\n \t\tformat.html { render :new }\n \t\t\tformat.json { render json: @project.errors, status: :unprocessable_entity }\n \t\tend\n \tend\n\tend", "title": "" }, { "docid": "ecf14c1524c5aacb8e8dabd18d3f7005", "score": "0.6773288", "text": "def create\n if params[:project_id]\n cloned_from = Project.find(params[:project_id])\n @project = cloned_from.clone(params, @cur_user.id)\n else\n @cloned_project = nil\n @project = Project.new project_params\n @project.user_id = @cur_user.id\n end\n\n respond_to do |format|\n if @project.save\n format.html do\n redirect_to @project, notice: 'Project was successfully created.'\n end\n format.json do\n render json: @project.to_hash(false),\n status: :created, location: @project\n end\n else\n flash[:error] = @project.errors.full_messages\n format.html { redirect_to projects_path }\n format.json do\n render json: @project.errors, status: :unprocessable_entity\n end\n end\n end\n end", "title": "" }, { "docid": "2dccf05a3ded2ece11ee2419b04b5a72", "score": "0.675545", "text": "def create_project(key, name, params = {})\n params[:key] = key\n params[:name] = name\n post('projects', params)\n end", "title": "" }, { "docid": "7e041ffd4733d7ab6061236930d5d9b0", "score": "0.6750235", "text": "def create\n @project = Project.new(project_params)\n @project.owner = current_user unless @project.owner\n if @project.save\n render :show, status: :created, location: @project\n else\n render json: @project.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "f2f5b6a2c4319a68725291b3bf1ccaf7", "score": "0.67379624", "text": "def create_project(optional={})\n\t\targs = self.class.new_params\n\t\targs[:method] = 'POST'\n\t\targs[:pattern] = '/projects'\n\t\targs[:query]['Action'] = 'CreateProject'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'http'\n\t\tif optional.key? :project\n\t\t\targs[:body]['Project'] = optional[:project]\n\t\tend\n\t\tself.run(args)\n\tend", "title": "" }, { "docid": "82660b3d8bf45c925c8bc322dc10768c", "score": "0.6718913", "text": "def projects\n resource 'projects'\n end", "title": "" }, { "docid": "00adaaa19dd36c1f683247034247b25d", "score": "0.6716745", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n build_projects_user\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7e2b822ac6725c13d272539fff1877b2", "score": "0.67009157", "text": "def create\n project_attrs = params[:project].merge(validate_repo_connectivity: true)\n @project = current_user.owned_projects.create(project_attrs, as: :owner)\n respond_with @project do |format|\n format.json do\n if @project.valid?\n render json: decorate(@project).to_json, status: :created\n else\n render json: {project: @project.errors.as_json}.to_json, status: :unprocessable_entity\n end\n end\n end\n end", "title": "" }, { "docid": "b874052eec6196d2d14cb52d49377574", "score": "0.66877806", "text": "def create\n @project = Project.new(params[:project])\n\t\[email protected]_id =current_user.id\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "89becd055496085e1729644764341517", "score": "0.6686259", "text": "def create\n @project = Project.new(params[:project])\n @project.skills = params[:skills]\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "392b707aa5d7a33d97a4145d4ba15fce", "score": "0.668621", "text": "def create\n @project = Project.create(project_params)\n if @project.errors.blank?\n flash[:success] = t('controllers.projects.create.success', project: @project.name)\n else\n flash.now[:alert] = @project.errors.full_messages.unshift(t('controllers.projects.create.failure'))\n end\n respond_with @project, location: projects_url\n end", "title": "" }, { "docid": "97b8cbb528906f726239ca77e0be5248", "score": "0.66856426", "text": "def create\n @new_nav = true;\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n if params[:project_attachments]\n create_attachments\n end\n\n if params[:project_fields]\n create_fields\n end\n\n if params[:slider_objects]\n create_slider_objects\n end\n\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "03142783795b9dba729b6ea12b41fa49", "score": "0.66838706", "text": "def create\n @project = Project.new(project_params)\n @project.user = current_user\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "28743d77ad141ffadfc086b19fde4f34", "score": "0.6680505", "text": "def create\n @project = Project.new(project_params)\n\n begin\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors.full_messages, status: :unprocessable_entity }\n end\n end\n rescue Exception => e\n @project.destroy\n respond_to do |format|\n format.html { render :new }\n format.json { render json: e.as_json, status: :service_unavailable }\n end\n end\n end", "title": "" }, { "docid": "f24ef46a72288063542781af8018678f", "score": "0.66770595", "text": "def project_create(global_options, options)\n result = Excon.post(\n \"#{global_options[:fenton_server_url]}/projects.json\",\n body: project_json(options),\n headers: { 'Content-Type' => 'application/json' }\n )\n\n [result.status, JSON.parse(result.body)]\n end", "title": "" }, { "docid": "6ababaec05ec76e62a2f4fe9a32c0ce4", "score": "0.6670888", "text": "def create\n @project = Project.new(params[:project])\n\n respond_to do |format|\n if @project.save\n @project.user_projects.create(:user_id => current_user.id, :status => true, :role => 1)\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f2e44a58350957a590536ef73a7db587", "score": "0.6668133", "text": "def create\n @project = Project.new(project_params)\n respond_to do |format|\n if @project.save\n flash[:alert] = \"Project created successfully.\"\n format.html { redirect_back(fallback_location: root_path) }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d517ba340627cf1170494cef404bf7c8", "score": "0.66572726", "text": "def create\n @project = Project.new(project_params)\n\n if is_organization_admin? and @project.save\n @project.team_members.create(user_id: @project.organization.owner_id)\n render json: {\n name: @project.name,\n organization: @project.organization.name,\n url: project_dashboard_path(@project.id)\n }\n else\n render json: @project.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "7da67cd1dccff547f02e6b92243ff25f", "score": "0.66528344", "text": "def create\n @project = Project.new(project_params)\n\n if params[\"project\"][\"client_id\"] != \"\"\n @project.client = Client.find params[\"project\"][\"client_id\"]\n end\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Novo projeto cadastrado com sucesso.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "60d245908357b7b298be8147c3736bef", "score": "0.66518456", "text": "def create\n @project = current_user.projects.create(params[:project])\n \n if @project.save\n record_activity(\"created new project: \" + @project.id.to_s)\n redirect_to root_path, :notice => \"Project created successfully\"\n else\n render 'new'\n end\n end", "title": "" }, { "docid": "d0fcf8a3b0c027fa985e62c30bae82ef", "score": "0.66511416", "text": "def create\n find_projects(params[:api_key])\n end", "title": "" }, { "docid": "8b2b12c9ca8bc8c68e9d3cb073a8c132", "score": "0.6649628", "text": "def create\n\n @project = Project.new(project_params)\n @project.user_id = current_user.id\n\n respond_to do |format|\n if @project.save\n\n format.html { redirect_to @project, success: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf31b3092a4751c617b8e397641687bb", "score": "0.6649045", "text": "def create\n @project = Project.new(:project_title => params[:project_title], :start_date => params[:startDate], :end_date => params[:endDate],\n :status => params[:project_status])\n\n @project.user_id = current_user.id\n\n\n respond_to do |format|\n if @project.save\n p \"pass on projects controller\"\n format.html { redirect_to @project}\n format.json { render json: \"ok\" }\n else\n p \"fail on projects controller\"\n end\n end\n\n\n end", "title": "" }, { "docid": "ca5887fb645a57e073452bc5f6796f6a", "score": "0.6642436", "text": "def create_project_with_http_info(opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ProjectApi.create_project ...'\n end\n # resource path\n local_var_path = '/projects'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_project_body'])\n\n # return_type\n return_type = opts[:debug_return_type] || 'Project'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['oryAccessToken']\n\n new_options = opts.merge(\n :operation => :\"ProjectApi.create_project\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ProjectApi#create_project\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "9cdbb23c2e4b8959a92b9592c8c90595", "score": "0.6638429", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to :projects, notice: \"Project was successfully created.\" }\n format.json { render :show, status: :created, location: @project }\n else\n format.html do\n @teams = Team.order(:name)\n render :new\n end\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fe887e6f8eb35a24c547f5f834f549fe", "score": "0.6634081", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n @project.team.touch\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n render_errors(format, @project.errors, :new)\n end\n end\n end", "title": "" }, { "docid": "0a8a383d2f18bcf6a9aee343f3ef3b7c", "score": "0.66324985", "text": "def create\n @project = Project.new(project_params)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to [:user, @project], notice: 'Project temp was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "736b99a51bf42939eeea2bebe09104d5", "score": "0.6629944", "text": "def create\n @project = Project.new(project_params)\n\n render text: params[:project].inspect\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to projects_path, notice: 'Proyecto creado sastifactoriamente' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "62c6f24e3a2bca6fc9a0451fd74fc36a", "score": "0.6628171", "text": "def create\n @project = Project.new(params[:project])\n @project.status = \"Etat zero\"\n creator = current_user\n ProjectUser.create(:project => @project, :user => creator, :admin => true)\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5448b89ac493a9d58f3765b5b23c8482", "score": "0.66263485", "text": "def create\n @project = Project.new(project_params)\n @project.user_id = current_user.id\n\n respond_to do |format|\n if @project.save\n format.html { redirect_to @project, notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0d2af42a86d9d1704e96473d3bc0814f", "score": "0.66259176", "text": "def create\n @project = @projectable.projects.new(params[:project])\n\n respond_to do |format|\n if @project.save\n track_activity @project\n format.html { redirect_to [@projectable, @project], notice: 'Project was successfully created.' }\n format.json { render json: @project, status: :created, location: @project }\n else\n format.html { render layout: 'form', action: \"new\" }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b28b9b90bcde6c892ad2196cee84f6f8", "score": "0.66255814", "text": "def create\n\n #Acá se retorna de la vista New (o de cualquier lugar que llame a create con POST). Le llega el hash project_params con \n # los datos que retornó la vista.\n\n #Crea el nuevo usuario.\n @project = Project.new(project_params)\n\n respond_to do |format| #Esta linea es curiosa. Si el request le llegó por HTML, entonces fue un navegador. Si le llego\n #por JSON, entonces probablemente fue otra cosa, un app movil por ejemplo.\n if @project.save #Esto guarda el proyecto nuevo en la base de datos y retorna True si no hubo problema, y False si hubo un error.\n # Es importante notar que al llamar .save, primero pasa por el modelo, el cual revisa que no falte ningún dato.\n # Por ejemplo, si el modelo necesita que se incluya el nombre del proyecto, si o si, y no se le pasó el nombre,\n # Entonces el modelo va a guardar ese error en un hash llamado errors, dentro de el mismo (@projects.errors)\n # y va a hacer que .save retorne False.\n\n\n format.html { redirect_to :controller => \"misc\", :action =>\"about\", notice: 'Project was successfully created.' }\n format.json { render :show, status: :created, location: @project }\n else\n format.html { render :new }\n format.json { render json: @project.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
833559763b13605a4672fd8d99609813
task_duration Description: This method returns the duration of the task. Parameters: None
[ { "docid": "ad19c5232e4c853ffc7ba1e1de8e90a6", "score": "0.8230649", "text": "def task_duration\n\n if self.complete?\n sprintf(\"%4.1f\", (self.completed_on - self.created_on) / 1.day)\n else\n '0'\n end\n\n end", "title": "" } ]
[ { "docid": "fedc269d733b5ce605d01e3fed02de49", "score": "0.8556176", "text": "def task_duration\n if status == :active\n formatted_duration(running_time) \n else\n formatted_duration(duration)\n end\n end", "title": "" }, { "docid": "82299bcf683c5d2a6c5be9329bedc708", "score": "0.81545484", "text": "def calculate_duration_of(task) ; 5 ; end", "title": "" }, { "docid": "1998b3c204492073988f06e1ffd7c9bb", "score": "0.7577559", "text": "def duration\n e_date = start_date\n all_tasks.each do |task|\n e_date = task.end_date if task.end_date > e_date\n end\n (e_date - start_date).to_i\n end", "title": "" }, { "docid": "2315dc3fddfbaeb6790f7fa6e4a2feb5", "score": "0.7559778", "text": "def get_duration()\n puts \"The task will take #{(@date_end - @date_start).to_i} days\"\n end", "title": "" }, { "docid": "323235fe0ab6ee46c8dc723349f3074e", "score": "0.70374715", "text": "def execution_duration\n duration = nil\n unless self.stopped_at.nil?\n duration_seconds = self.stopped_at - self.started_at\n dhc = duration_seconds / 3600 # hours component\n dhc_mod = duration_seconds % 3600\n dhm = dhc_mod / 60 # minutes component\n dhs = dhc_mod % 60 # seconds component\n\n duration = format('%02d:%02d:%02d', dhc, dhm, dhs)\n end\n\n duration\n end", "title": "" }, { "docid": "6532cdc7aef268680d91be3ae0748699", "score": "0.6912407", "text": "def duration\n return @duration\n end", "title": "" }, { "docid": "6532cdc7aef268680d91be3ae0748699", "score": "0.6912407", "text": "def duration\n return @duration\n end", "title": "" }, { "docid": "cc3505b738e53d6fe8251c2020f46c92", "score": "0.6898078", "text": "def getDuration\r\n\t\t\t\t\treturn @duration\r\n\t\t\t\tend", "title": "" }, { "docid": "b4e79a608ce56ef1036e99ea1bf31707", "score": "0.6887434", "text": "def duration\n @duration\n end", "title": "" }, { "docid": "e554a40ace208471b03527c36d109868", "score": "0.6884795", "text": "def duration\n if start_time && end_time\n end_time.to_i - start_time.to_i\n else\n 0.0\n end\n end", "title": "" }, { "docid": "56e3b6661ff0b56708222db055ea0f6e", "score": "0.6834529", "text": "def duration()\n\t\t\treturn @duration\n\t\tend", "title": "" }, { "docid": "b89fb2b3f758e98f84a5621a2c6b0d6b", "score": "0.6803513", "text": "def entry_duration(entry)\n if !entry.completed_datetime.nil?\n (entry.completed_datetime - entry.scheduled_datetime) / 1.hour\n else\n 0.0\n end\n end", "title": "" }, { "docid": "1342ad535170b3aacacb11eabc66efbf", "score": "0.6770805", "text": "def duration\n if @end_time.nil?\n raise StandardError.new(\"Cannot calculate trip duration. Trip is still in progress.\")\n else\n time_in_seconds = @end_time - @start_time\n time_in_hours = time_in_seconds / 3600\n end\n end", "title": "" }, { "docid": "6f00d9a3c12c98f9bb0a10044b5ecd91", "score": "0.67527694", "text": "def duration\n ran? ? (completed_at || failed_at) - started_at : 0\n end", "title": "" }, { "docid": "fc1fc3d1084440ea3401dde1eb4799f4", "score": "0.6731245", "text": "def duration\n self.end_time - self.start_time\n end", "title": "" }, { "docid": "777822c6a608babe81c0c366f28e8e8c", "score": "0.6692159", "text": "def entry_duration(entry)\n (entry.scheduled_datetime - entry.completed_datetime) / 1.hour\n end", "title": "" }, { "docid": "968bbb7eac56ea043886909a6d6a8e22", "score": "0.66827", "text": "def duration\n start = start_time.to_i\n end_with_delay = end_time.to_i + (@parts.last.target_delay * 1.minutes)\n\n end_with_delay - start\n end", "title": "" }, { "docid": "4cdf6b2ccd4ec6079fd879c9b4edde3a", "score": "0.6676912", "text": "def duration\n (finish - start)/3600\n end", "title": "" }, { "docid": "9fe4b1f498546fa6e24f5d78b329ae2b", "score": "0.667061", "text": "def duration\n @started_at ? Time.now - @started_at : nil\n end", "title": "" }, { "docid": "58ba611ce92a991c95b160f8447e613c", "score": "0.6638022", "text": "def duration_in_seconds\n return @duration_in_seconds\n end", "title": "" }, { "docid": "7bf92851c9b7875461db91fdd7134a49", "score": "0.6630885", "text": "def duration\n\t\tt =(Time.now- @start)\n\t\treturn t\n\tend", "title": "" }, { "docid": "537df94439ab8935f6f92ac6e3b27f23", "score": "0.6604598", "text": "def duration\n duration = data(\"duration\")\n duration_to_seconds(duration.to_f) if duration\n end", "title": "" }, { "docid": "410d380a8b0232ce871c1ec811336c17", "score": "0.65855354", "text": "def duration\n return -1.0 if @start_time.nil? || @end_time.nil?\n (@end_time - @start_time) / 60.0\n end", "title": "" }, { "docid": "309a47dbabc88d01cd8314d5ed584441", "score": "0.65664446", "text": "def get_duration\n ((finish - start) / 60 / 60) - (break_length / 60)\n end", "title": "" }, { "docid": "a29f5279bb27de2c62288d20391718fc", "score": "0.6556267", "text": "def duration; ((endtime()- starttime()) / 60).to_i; end", "title": "" }, { "docid": "5d7e71c32d0fcd675af69f01b4d34bec", "score": "0.6555427", "text": "def duration # (in seconds)\n if self.end_time and self.start_time \n return (self.end_time - self.start_time).to_i\n end\n walk_time.to_i +\n transit_time.to_i +\n wait_time.to_i\n end", "title": "" }, { "docid": "20c90950037c36002938dbadc96ba0b3", "score": "0.65516853", "text": "def duration\n return unless finished_at\n\n elapsed_time(started_at, finished_at)\n end", "title": "" }, { "docid": "bf927aae3139fb326c0d5509d2c0afc2", "score": "0.65462196", "text": "def duration\n raw_duration.to_f/time_scale\n end", "title": "" }, { "docid": "bf927aae3139fb326c0d5509d2c0afc2", "score": "0.65462196", "text": "def duration\n raw_duration.to_f/time_scale\n end", "title": "" }, { "docid": "b70fbc580159c19e6af2df591dade8c1", "score": "0.65411747", "text": "def duration\n @end_date - @begin_date\n end", "title": "" }, { "docid": "edcb6d59b0ab279b0adaa72cd91ebe67", "score": "0.65174663", "text": "def duration\n data.duration\n end", "title": "" }, { "docid": "e7c6146f3fe2354a5df0dc28082a2bc9", "score": "0.6511313", "text": "def duration\n @duration = to_seconds @data.fetch('duration', 0)\n end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.6494074", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.6494074", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.6494074", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.6494074", "text": "def duration; end", "title": "" }, { "docid": "a7e5629fc62462a7756b53952f2ae328", "score": "0.6494074", "text": "def duration; end", "title": "" }, { "docid": "7bb6b083e6d7813309d45b26b06265ab", "score": "0.64927936", "text": "def duration\n (Time.now.to_f - @start) * 1000\n end", "title": "" }, { "docid": "e9f2291901cc9c76146044ee34c6057a", "score": "0.64821213", "text": "def duration\n (@stop_time.nil? ? Time.now : @stop_time) - @start_time\n end", "title": "" }, { "docid": "b007ca2e0ee3f4d7fb819c45523399ec", "score": "0.6480335", "text": "def meeting_duration\n return @meeting_duration\n end", "title": "" }, { "docid": "62e4b3383eae350c4c97515899f20836", "score": "0.64713305", "text": "def what_task\n if running_task?\n puts \"Current task: \" + get_last_task_name + \", #{(Time.now.to_i - get_last_task_stime.to_i).duration}\"\n else\n puts \"No task running!\"\n end\n end", "title": "" }, { "docid": "b130dd8b5bc86f1d510f5dcf69c4256e", "score": "0.64293593", "text": "def duration\n self.end - time\n end", "title": "" }, { "docid": "5c28305f125567035f7ac69c8822edc7", "score": "0.642087", "text": "def duration\n # TODO: make sure this case handling for trip in prgress fits specs\n if end_time == nil\n return 0\n end\n start_in_sec = (@start_time.hour * 3600) + (@start_time.min * 60) + @start_time.sec\n end_in_sec = (@end_time.hour * 3600) + (@end_time.min * 60) + @end_time.sec\n return end_in_sec - start_in_sec\n end", "title": "" }, { "docid": "2c8c680c65f8195f97ebc2c8bb8ed9aa", "score": "0.63956124", "text": "def calc_duration\n @duration = (Time.now - @start) * 1000.0\n end", "title": "" }, { "docid": "10f089a79a9a0a974d2c45cddb73cf86", "score": "0.6389014", "text": "def duration\n @duration ||= timestamp_delta / 256.0\n end", "title": "" }, { "docid": "75d72cdfba45bcfa55efbfdf156350aa", "score": "0.63765424", "text": "def duration\n finished? ? finished_at.to_f - started_at.to_f : -1\n end", "title": "" }, { "docid": "0ef7f2ab3dc6969b89a92d4e695ec2be", "score": "0.6339314", "text": "def duration\n (self.end_date.to_i/60/60/24) - (self.start_date.to_i/60/60/24)\n end", "title": "" }, { "docid": "f27fe4a4c57598c94017ab202ecb9c94", "score": "0.6337543", "text": "def duration\n 1 + (@end_date - @start_date).to_i\n end", "title": "" }, { "docid": "c670ad54a014795330933aee11d7f5e0", "score": "0.6335379", "text": "def duration_in_days\n return @duration_in_days\n end", "title": "" }, { "docid": "c62537dca4067af1a1003142f183a9c7", "score": "0.6329447", "text": "def duration\n assignment.duration + (extension&.time_delta || 0)\n end", "title": "" }, { "docid": "18df8adc15856e29fc09a99df388e7c9", "score": "0.62984866", "text": "def get_duration\n duration_instance.span\n end", "title": "" }, { "docid": "f5a1162054be00c82bac93b21642f201", "score": "0.62957954", "text": "def duration\n @duration ||=\n self.starts_at && self.ends_at &&\n ((self.ends_at - self.starts_at) / 60.0 / 60.0)\n end", "title": "" }, { "docid": "3cd422201bec8f257eaf88ec682b6a22", "score": "0.6289928", "text": "def duration_time\n if !block_given?\n if @cached_duration_time != nil\n return @cached_duration_time\n end\n return @cached_duration_time = @j_del.java_method(:durationTime, []).call()\n end\n raise ArgumentError, \"Invalid arguments when calling duration_time()\"\n end", "title": "" }, { "docid": "d25740ed46cef4853cf1cc0fc051ec9b", "score": "0.62888414", "text": "def duration\n TingYun::Helper.time_to_millis(@exit_timestamp - @entry_timestamp)\n end", "title": "" }, { "docid": "ddaf09ce8a3f3cded4a9f8a64a0b555b", "score": "0.62797296", "text": "def duration\n @duration ||= (range[1] - range[0]) / 1000.0\n end", "title": "" }, { "docid": "5fcd3385e6628bf843c0b70693264eb3", "score": "0.6279427", "text": "def duration\n 30\n end", "title": "" }, { "docid": "989392027ed3267994266fe400d087a5", "score": "0.6273889", "text": "def duration\n vpm * 0.01\n end", "title": "" }, { "docid": "b377a9badc97ec487c81fc582c538968", "score": "0.62620646", "text": "def total_tasks\n return @total_tasks\n end", "title": "" }, { "docid": "b377a9badc97ec487c81fc582c538968", "score": "0.62620646", "text": "def total_tasks\n return @total_tasks\n end", "title": "" }, { "docid": "cf2d58ad904fe904d13f157a5d45ffed", "score": "0.6260638", "text": "def calculate_duration(duration)\n [duration.to_i, 'seconds']\n end", "title": "" }, { "docid": "2d79147355a462a37428a4c197a34403", "score": "0.6225356", "text": "def duration_options\n Task.durations.map do |key, val|\n [I18n.t(\"activerecord.attributes.task.duration-text.#{key}\"), val]\n end\n end", "title": "" }, { "docid": "4e58cc47dd3dad3d65318d51319de430", "score": "0.62198395", "text": "def process_duration\n return 0.0 unless process_ended_at && process_started_at\n\n (process_ended_at - process_started_at).ceil(3)\n end", "title": "" }, { "docid": "ce102284864bdff2f7d14377654dee25", "score": "0.6219063", "text": "def time_duration\n t1 = Time.now.to_f\n Time.now.to_f - t1\nend", "title": "" }, { "docid": "638fd4077f4b0b72a7106955c1519b03", "score": "0.6183295", "text": "def duration\n 0\n end", "title": "" }, { "docid": "9bf038ff1831015121ba575cbd505c5a", "score": "0.61709595", "text": "def timeInterval()\n\t\t@duration\n\tend", "title": "" }, { "docid": "1af76b3b591ddc172ecb309acedbdc23", "score": "0.61645985", "text": "def effective_duration\n if start_time.nil?\n accommodated_duration\n else\n effective_end_time - start_time\n end\n end", "title": "" }, { "docid": "4747633557803ae88d769baaae6b8ba6", "score": "0.61612254", "text": "def minutes_as_duration\n WorkEntry.minutes_as_duration(self.minutes)\n end", "title": "" }, { "docid": "041abeacd0a35979963a27c19d763887", "score": "0.61607784", "text": "def durations; end", "title": "" }, { "docid": "964798d0fa410f7921744aebbf9fe3e1", "score": "0.6155232", "text": "def total_tasks_count\n return @total_tasks_count\n end", "title": "" }, { "docid": "f6b2aafbf78c4c81220626e2cd944013", "score": "0.6139196", "text": "def process_duration\n t1 = Process.times.utime\n Process.times.utime - t1\nend", "title": "" }, { "docid": "26d4594af789f2073072e6f2b35ac7e5", "score": "0.61387116", "text": "def getDurationHours\r\n\t\t\t\t\treturn @durationHour\r\n\t\t\t\tend", "title": "" }, { "docid": "d0378a012583a08a2b5514387a0bb4f8", "score": "0.6113458", "text": "def update_duration()\r\n self.started_at = Time.now\r\n self.duration += self.added_time.abs\r\n self.added_time = 0\r\n self.active_task = true\r\n self.is_finished = false\r\n self.save\r\n end", "title": "" }, { "docid": "dc3173884cc4ce675ec8bc89b31d537d", "score": "0.60992384", "text": "def total_duration\n self.inject(0) do |accum,trip|\n accum += trip.duration\n accum\n end\n end", "title": "" }, { "docid": "95fdf8f6549df6ab4a4141e87891e241", "score": "0.607449", "text": "def string_as_duration\n Timecode.string_as_duration(@tc_mode, @tc_count)\n end", "title": "" }, { "docid": "c5270eabad27c33d3bf109212266d27a", "score": "0.607448", "text": "def durationInMinutes\n @duration/60.0 #Force floating pt.\n end", "title": "" }, { "docid": "f32ed9bf353a01d54d527cee15b2011e", "score": "0.60664225", "text": "def media_duration\n return @media_duration\n end", "title": "" }, { "docid": "6ce201124df92d8c22841838ff4a27a0", "score": "0.605605", "text": "def task_count()\n @tasks.size\n end", "title": "" }, { "docid": "086d307bd342c82b6cfd330cc65964a8", "score": "0.604947", "text": "def duration\n @duration ||= tick * @data.values[0].length\n end", "title": "" }, { "docid": "53b2fdcfc53362a07374f8bd1e98a034", "score": "0.6046964", "text": "def duration_number\n expr = self.timing_duration.blank? ? \"\" : self.timing_duration.split.first\n @duration_number.nil? ? expr : @duration_number\n end", "title": "" }, { "docid": "e194540bae56f7c88516f6e7ae5d6534", "score": "0.6041278", "text": "def total_duration\n duration = 0\n trips.each { |trip| duration += trip.duration }\n return duration\n end", "title": "" }, { "docid": "bd48448221ec4e9ed150d50babb455da", "score": "0.6032015", "text": "def weather_duration\n return @duration\n end", "title": "" }, { "docid": "fba60f637a088deacce1d7f1b06669b3", "score": "0.6023747", "text": "def daily_activity_duration(activity)\n self.timeblocks_today\n .where(activity_id: activity)\n .sum(:duration) +\n ((Time.now - self.timeblocks_today\n .where(activity_id: activity,\n endtime: nil)\n .first.starttime rescue 0)).to_i\n end", "title": "" }, { "docid": "2883df19c5c964ab33684d9023ae346f", "score": "0.6012726", "text": "def get_duration\n return \"#{self.duration.to_s.sub!('.', ',')} #{I18n.t(\"labels.datetime.hour_short\")}\"\n end", "title": "" }, { "docid": "6b9725008c5bb2b6af606c64decdc22c", "score": "0.6000386", "text": "def time_elapsed\n if !self.finished.blank?\n ((self.finished - self.started) / 60).to_i\n end\n end", "title": "" }, { "docid": "43dd672f50a1dbe3166627e063797adc", "score": "0.59898835", "text": "def total_duration\n media_segments.reduce(0.0) do | a, e |\n a + e.duration\n end\n\n end", "title": "" }, { "docid": "1195c28dd6ce01ac4431bc039fdd6f22", "score": "0.5974146", "text": "def duration(input)\n process(:duration, input)\n end", "title": "" }, { "docid": "e794cde9c25b16c9269edd917830095a", "score": "0.59720254", "text": "def get_task_count\n variables.has_key?(:task_count) ? variables[:task_count] : 14\n end", "title": "" }, { "docid": "f672ef267f1a90dedf06dd50688d3aec", "score": "0.5965157", "text": "def duration\n if properties.is_a?(String)\n JSON.parse(properties)['duration']\n else\n properties.with_indifferent_access[:duration]\n end\n end", "title": "" }, { "docid": "fe39e177aca69098fd05a0647ff39047", "score": "0.596333", "text": "def end_time\n start_time + duration\n end", "title": "" }, { "docid": "ab6a865a222f3426e750a131aa427943", "score": "0.5948185", "text": "def time_duration(mytime, start_time, end_time)\n # implement this\n return 9999999\n end", "title": "" }, { "docid": "b2688a86380fd1794e12e584f7fb6672", "score": "0.59480274", "text": "def duration_seconds\n hours = hours_flight\n minutes = minutes_flight\n if hours && minutes\n hours * 3600 + minutes * 60\n else\n 0\n end\n end", "title": "" }, { "docid": "87048ef6a4aef3748c3e09bfede00445", "score": "0.5945486", "text": "def stay_duration_seconds\n return 0 unless next_segment\n # when we arrive at the next airport, minus when we arrived at this\n # airport.\n (next_segment.departure_time.to_time - arrival_time.to_time).to_i\n end", "title": "" }, { "docid": "236ec774882089b93f9e082f80b151da", "score": "0.5944664", "text": "def duration # in days\n @due_date - @start_date + 1\n end", "title": "" }, { "docid": "98b78679aaca06371d63d6e79882b79b", "score": "0.59427863", "text": "def duration(state = :started)\n state = state_to_const(state)\n if state == @state\n Time.now - state_at(state)\n elsif state < @state and state_at(state)\n next_state_at(state) - state_at(state)\n else\n nil\n end\n end", "title": "" }, { "docid": "cfadf3e91c4097f1ab11c12d15958b42", "score": "0.5941868", "text": "def duration_ms\n @scope_layer.total_call_time*1000 # ms\n end", "title": "" }, { "docid": "a584a53e08a532730ac41fd5009ef951", "score": "0.5936013", "text": "def estimated_stop_time\n result = 0\n recipe.schedule.tasks.each do |t|\n result += t.duration + t.ramp_estimate\n end\n\n start_time + result.seconds\n end", "title": "" }, { "docid": "000c8d6e7d9acd13004ec2ef4976a275", "score": "0.59312326", "text": "def get_duration_integer_minutes\n\t\t((end_time - start_time) / 60).to_i\n\tend", "title": "" }, { "docid": "b3e0b2f568afdf4228c2df24afb1a42a", "score": "0.59222555", "text": "def completed_task_count\n @executor.getCompletedTaskCount\n end", "title": "" }, { "docid": "c2079244bf068cec58369def5a1ab8a2", "score": "0.59137434", "text": "def duration\n self.updated_at - self.created_at\n end", "title": "" }, { "docid": "9dcca551079ef455ec8387f30f2975cc", "score": "0.59080935", "text": "def duration_datetime\n scheduled_datetime + 1.hour\n end", "title": "" } ]
7e986c67a41edf18fbd307618a082241
Sets the version property value. The version of the policy
[ { "docid": "be66a75eb49c2712f2221c0f3fc27028", "score": "0.7961405", "text": "def version=(value)\n @version = value\n end", "title": "" } ]
[ { "docid": "ce63b532d3c9a0ee99aa6c226439a5d1", "score": "0.7842722", "text": "def version=(v)\n @version = v\n end", "title": "" }, { "docid": "d3630952995feebfe266a7272c6183eb", "score": "0.7689886", "text": "def set(new_version)\n self.version = new_version\n end", "title": "" }, { "docid": "1996f1bdc6169b484a989783d4af11b2", "score": "0.7640939", "text": "def version=(version)\n @version = version\n end", "title": "" }, { "docid": "aaeac538e6c7cc72ef01c0aa2add296e", "score": "0.76357025", "text": "def setVersion(version)\r\n\t\t\t\t\t@version = version\r\n\t\t\t\tend", "title": "" }, { "docid": "8e4aa63df687298a2b4fc9c6257d8587", "score": "0.73911536", "text": "def version=(version)\n mutate_config(:version) { version.dup }\n end", "title": "" }, { "docid": "c7db8760b4f99adc216610219734d367", "score": "0.73392147", "text": "def version=(value)\n @children['version'][:value] = value\n end", "title": "" }, { "docid": "c7db8760b4f99adc216610219734d367", "score": "0.73392147", "text": "def version=(value)\n @children['version'][:value] = value\n end", "title": "" }, { "docid": "79205e473203554cd5dc77ebd75286e3", "score": "0.7173288", "text": "def version=(arg)\n @version = arg.to_s\n end", "title": "" }, { "docid": "fb6b9989ea0ff6d3791bb027d3defa1f", "score": "0.71713877", "text": "def version=(version) # :nodoc:\n @fields['version'] = version.to_s\n end", "title": "" }, { "docid": "928530bb0153b9335cd3a2d0ae683a2c", "score": "0.70935243", "text": "def version_number=(value)\n @version_number = value\n end", "title": "" }, { "docid": "95e30ba780dd6ff567d1acb3282c0976", "score": "0.70162094", "text": "def ver=(value)\n @values['ver'] = value\n end", "title": "" }, { "docid": "e8ce0e278756869a7d7034d16a7c69bf", "score": "0.6946324", "text": "def set_version revision\n # this call is idempotent for a given kudu run\n return if version_updated\n if /\\d+\\.\\d+\\.\\d+/ =~ revision\n self.version = revision\n else\n major_minor_file = File.join(directory, 'MAJOR_MINOR_VER')\n major_minor = File.exist?(major_minor_file) ? IO.read(major_minor_file) : '1.0'\n self.version = major_minor + \".\" + revision\n end\n ver_file = File.join(directory, 'VERSION')\n IO.write(ver_file, self.version)\n end", "title": "" }, { "docid": "c9e132781fadd8a809aba95dac1d2b97", "score": "0.69140536", "text": "def set_version(value)\n if value.nil?\n @version = 'latest'\n else\n return skip_resource 'Invalid character in version' unless value.to_s =~ /^(latest|[\\d\\.-]+)$/\n @version = value\n end\n end", "title": "" }, { "docid": "fbb206884e0a72531b54d207415c295d", "score": "0.6852358", "text": "def set_version\n self.version ||= latest_version + 1\n end", "title": "" }, { "docid": "2ea6275ae9cea196d775201431de9b6c", "score": "0.6791021", "text": "def ver=(value)\n if value == @defaults['ver']\n @values.delete 'ver' if @values.key? 'ver'\n else\n @values['ver'] = value\n end\n end", "title": "" }, { "docid": "d12308cb0559893b0c639d76913c42e8", "score": "0.67562866", "text": "def version=(version)\n case version\n when VersionNumber\n @version = version\n when Hash\n major = version['major']\n minor = version['minor']\n patch = version['patch']\n build = version['build']\n\n @version = VersionNumber.new(major,minor,patch,build)\n when String\n @version = VersionNumber.parse(version.to_s)\n else\n raise(InvalidMetadata,\"version must be a Hash or a String\")\n end\n end", "title": "" }, { "docid": "0d3b3542ab322760b89a61ff2ef86ae5", "score": "0.6745986", "text": "def app_version=(value)\n @app_version = value\n end", "title": "" }, { "docid": "0d3b3542ab322760b89a61ff2ef86ae5", "score": "0.6745986", "text": "def app_version=(value)\n @app_version = value\n end", "title": "" }, { "docid": "3e7e83751ff8af5d274ac972f096445a", "score": "0.67322826", "text": "def version=(newversion)\t\n notice \"Version of #{resource[:name]} does not match the required version.\"\n destroy\n create\n end", "title": "" }, { "docid": "689d641def4c88a6e6e7a55da03a7817", "score": "0.67177284", "text": "def version(version = nil)\n @version = version if version\n @version\n end", "title": "" }, { "docid": "f491d8bf506f4b5b24b9f77b1f648994", "score": "0.66975325", "text": "def set_version\n if @properties\n @properties.each{|p| p.extend(version_module)}\n else\n @property.extend(version_module)\n end\n end", "title": "" }, { "docid": "81289de3578dbcc3c426248152e52590", "score": "0.66704303", "text": "def identity_version=(value)\n @identity_version = value\n end", "title": "" }, { "docid": "0f112fcd5e3d5d7eb3722ed36fbad837", "score": "0.6653173", "text": "def assign_specification_version(specification:)\n specification.version = value\n self\n end", "title": "" }, { "docid": "bf482610c51401f16933a4afbeadf9cd", "score": "0.6646976", "text": "def version(version_rule)\n raise \"No version plan is defined - cannot use 'version'\" unless version_plan\n\n @version_rule = version_rule\n end", "title": "" }, { "docid": "2251954f23be41e06a079210ed1500e4", "score": "0.6640829", "text": "def version(value = nil)\n if value.nil?\n @version\n else\n @version = value\n end\n end", "title": "" }, { "docid": "379a6435343ea389b57bc952c64f275f", "score": "0.6579972", "text": "def version value = nil\n return @version if value.nil?\n @version = value\n end", "title": "" }, { "docid": "0526af0156522487080a70c7911cff6a", "score": "0.655", "text": "def version_id=(value)\n @version_id = value\n end", "title": "" }, { "docid": "d55a543e4905ad8a4d44dd64350166f4", "score": "0.6528752", "text": "def set_version\n @version = Version.find(params[:id])\n end", "title": "" }, { "docid": "fc8bfe83047b8cfd700d39f3f0f011ed", "score": "0.6525444", "text": "def http_version=(value)\n Curl.set_option(:http_version, value_for(value, :enum, :http_version), handle)\n end", "title": "" }, { "docid": "be508f0621662ca9495061d427733793", "score": "0.65236753", "text": "def update!(**args)\n @requested_policy_version = args[:requested_policy_version] if args.key?(:requested_policy_version)\n end", "title": "" }, { "docid": "be508f0621662ca9495061d427733793", "score": "0.65236753", "text": "def update!(**args)\n @requested_policy_version = args[:requested_policy_version] if args.key?(:requested_policy_version)\n end", "title": "" }, { "docid": "be508f0621662ca9495061d427733793", "score": "0.65236753", "text": "def update!(**args)\n @requested_policy_version = args[:requested_policy_version] if args.key?(:requested_policy_version)\n end", "title": "" }, { "docid": "be508f0621662ca9495061d427733793", "score": "0.65236753", "text": "def update!(**args)\n @requested_policy_version = args[:requested_policy_version] if args.key?(:requested_policy_version)\n end", "title": "" }, { "docid": "be508f0621662ca9495061d427733793", "score": "0.65236753", "text": "def update!(**args)\n @requested_policy_version = args[:requested_policy_version] if args.key?(:requested_policy_version)\n end", "title": "" }, { "docid": "be508f0621662ca9495061d427733793", "score": "0.65236753", "text": "def update!(**args)\n @requested_policy_version = args[:requested_policy_version] if args.key?(:requested_policy_version)\n end", "title": "" }, { "docid": "be508f0621662ca9495061d427733793", "score": "0.65236753", "text": "def update!(**args)\n @requested_policy_version = args[:requested_policy_version] if args.key?(:requested_policy_version)\n end", "title": "" }, { "docid": "be508f0621662ca9495061d427733793", "score": "0.65236753", "text": "def update!(**args)\n @requested_policy_version = args[:requested_policy_version] if args.key?(:requested_policy_version)\n end", "title": "" }, { "docid": "297843e03e768ab1c6f8773a217c0a1b", "score": "0.64919233", "text": "def default_version=(v)\n @default_version = v\n end", "title": "" }, { "docid": "161f6502f802417f4c5a950ad3ad35a5", "score": "0.6480498", "text": "def set_default_policy_version(optional={})\n\t\targs = self.class.new_params\n\t\targs[:query]['Action'] = 'SetDefaultPolicyVersion'\n\t\targs[:region] = optional[:_region] if (optional.key? :_region)\n\t\targs[:scheme] = 'https'\n\t\tif optional.key? :_method\n\t\t\traise ArgumentError, '_method must be GET|POST' unless 'GET|POST'.split('|').include? optional[:_method]\n\t\t\targs[:method] = optional[:_method]\n\t\tend\n\t\tif optional.key? :policy_name\n\t\t\targs[:query]['PolicyName'] = optional[:policy_name]\n\t\tend\n\t\tif optional.key? :version_id\n\t\t\targs[:query]['VersionId'] = optional[:version_id]\n\t\tend\n\t\tself.run(args)\n\tend", "title": "" }, { "docid": "ff6f6ad9bb06cd211e966456f2354a76", "score": "0.64373255", "text": "def ver=(value)\n if value == @defaults['ai.application.ver']\n @values.delete 'ai.application.ver' if @values.key? 'ai.application.ver'\n else\n @values['ai.application.ver'] = value\n end\n end", "title": "" }, { "docid": "ff249ef240a843cba31491daaf3213c0", "score": "0.64312166", "text": "def ver\n @values.fetch('ver') { \n @values['ver'] = 1\n }\n end", "title": "" }, { "docid": "4b559698dc7098a63e0986cb60c3ff35", "score": "0.64081836", "text": "def version=(version)\n @version = Gem::Version.create(version)\n # skip to set required_ruby_version when pre-released rubygems.\n # It caused to raise CircularDependencyError\n if @version.prerelease? && (@name.nil? || @name.strip != \"rubygems\")\n self.required_rubygems_version = '> 1.3.1'\n end\n invalidate_memoized_attributes\n\n return @version\n end", "title": "" }, { "docid": "420ba7694c2ae5ba15c026762c7d2004", "score": "0.63829905", "text": "def application_version=(value)\n @application_version = value\n end", "title": "" }, { "docid": "420ba7694c2ae5ba15c026762c7d2004", "score": "0.63829905", "text": "def application_version=(value)\n @application_version = value\n end", "title": "" }, { "docid": "384f53ba751cbe5f937a52bd5fe48780", "score": "0.6374686", "text": "def show_version\n \t\t@policy = Policy.find(params[:id])\n\t\t@versions = @policy.versions\n \t@policy = @policy.versions[params[:version].to_i].reify if params[:version]\n \tend", "title": "" }, { "docid": "43d05ce0218192c21a898a5a7000994c", "score": "0.6361277", "text": "def configuration_version=(value)\n @configuration_version = value\n end", "title": "" }, { "docid": "6c5f828d3aed81d2aa30d65b49c566a1", "score": "0.63541865", "text": "def openurl_ver=(ver)\n @openurl_ver = ver\n @admin[\"ctx_ver\"][\"value\"] = ver\n end", "title": "" }, { "docid": "817a046a6ab3a9a312b83e96169d6355", "score": "0.63385046", "text": "def major_version=(val)\n self.major_number = val\n end", "title": "" }, { "docid": "b3e8b245a7f573b8b41ee390030259ab", "score": "0.63375", "text": "def version(ver)\n Runner.instance.version = ver\n end", "title": "" }, { "docid": "fbec63aa67ea8805f23aefe55a13df4f", "score": "0.6318354", "text": "def requested_access_token_version=(value)\n @requested_access_token_version = value\n end", "title": "" }, { "docid": "ff53dfc5266c2f67b759bcc98d1c2b2b", "score": "0.63169825", "text": "def db_version=(version)\n Neo4j::Transaction.run do\n migration_meta_node[:_db_version] = version\n end\n end", "title": "" }, { "docid": "a8f7cc83e890a1bb550cc00a37db13c9", "score": "0.63132715", "text": "def __assign_version(data)\n data[self.class::VERSION_MEMBER] = self.class::VERSION_NUMBER\n end", "title": "" }, { "docid": "fcf34e89bf2b769f000dbfc06aa9d309", "score": "0.6312224", "text": "def resp_version=(resp_version)\n if resp_version.nil?\n fail ArgumentError, 'invalid value for \"resp_version\", resp_version cannot be nil.'\n end\n @resp_version = resp_version\n end", "title": "" }, { "docid": "fdf45b6425e838d73ee21c32023e6474", "score": "0.63008624", "text": "def version=(version)\n swap(\n @config,\n /\\$config\\['app_version'\\] = '.*?';/i,\n \"$config['app_version'] = '#{version}';\"\n )\n end", "title": "" }, { "docid": "8c4ee5106b9c6646a465c3d7c14b204c", "score": "0.6298377", "text": "def soap_version=(version)\n raise ArgumentError, \"Invalid SOAP version: #{version}\" unless SOAP::Versions.include? version\n @version = version\n end", "title": "" }, { "docid": "0116882f2c1812047babc61cbea8d8d7", "score": "0.6293826", "text": "def version(str)\n @version = str\n end", "title": "" }, { "docid": "24b200ca789fce9cfa90ddc9fb6e516a", "score": "0.62898827", "text": "def update_version\n if (VersionControl.any?) \n obj = VersionControl.all.first\n else\n obj = VersionControl.create(version: 3.0)\n end\n\n obj.version += 0.1\n obj.save\n end", "title": "" }, { "docid": "5a2f1147c423c967c241f11ddf26ccb9", "score": "0.62741643", "text": "def version(version)\n @@version = version\n end", "title": "" }, { "docid": "1889f3ca2074178e76fbec1c2b25f188", "score": "0.62628186", "text": "def sslversion=(value)\n Curl.set_option(:sslversion, value_for(value, :enum, :sslversion), handle)\n end", "title": "" }, { "docid": "4612c09c17016f105ba124c1c6650642", "score": "0.6215873", "text": "def _version\n special_attribute('@version'.freeze)\n end", "title": "" }, { "docid": "9fa31550bb3dfdd183a9d85a300783ae", "score": "0.6211689", "text": "def version s=nil; @version = s if s; @version end", "title": "" }, { "docid": "1903ee318cadb12249b653c60bff1a0a", "score": "0.62104744", "text": "def version\n version_property ? version_property.ruby_value : nil\n end", "title": "" }, { "docid": "4f248245540635d007ce5e69925a2e4b", "score": "0.61910284", "text": "def platform_version=(value)\n @platform_version = value\n end", "title": "" }, { "docid": "3ed9d7fca03fc2653b0d05bccc5890d9", "score": "0.6172501", "text": "def new_version\n @version = Time.now.to_i\n end", "title": "" }, { "docid": "539b1ed842e7e10e066e9c2983926448", "score": "0.61542314", "text": "def version= new_version\n if new_version.nil?\n @grpc.attributes.delete \"x-goog-version\"\n else\n @grpc.attributes[\"x-goog-version\"] = new_version\n end\n end", "title": "" }, { "docid": "5f71d94a1277f797648d4d6ce01873aa", "score": "0.6109929", "text": "def set_version(version = nil)\n begin\n if (defined?(version) && not(version.nil? ))\n then\n return version\n else\n return Settings[:CURRENT_VERSION]\n end\n rescue\n return Settings[:CURRENT_VERSION]\n end\n end", "title": "" }, { "docid": "071244f1f7a62b26ab3e7f594ea32ec3", "score": "0.6102898", "text": "def version=(string)\n @table[:version] = Version::Number.new(string) if string\n end", "title": "" }, { "docid": "21b186d34c7fdf99dfd85ff086a67d50", "score": "0.60994416", "text": "def gem_version=(version)\n @gem_version = version\n end", "title": "" }, { "docid": "bb2441f638244d9b12e6f7f128f36ce2", "score": "0.6083655", "text": "def patch_kubernetes_version_policy(moid, kubernetes_version_policy, opts = {})\n data, _status_code, _headers = patch_kubernetes_version_policy_with_http_info(moid, kubernetes_version_policy, opts)\n data\n end", "title": "" }, { "docid": "6febdf20f85288de75e8a69a41152bba", "score": "0.60757583", "text": "def set_version(version)\n file_sub(GEMSPEC, /(\\.version\\s*=\\s*).*/, \"\\\\1'#{version}'\")\n file_sub(VERSION_RB, /^(\\s*VERSION\\s*=\\s*).*/, \"\\\\1'#{version}'\")\nend", "title": "" }, { "docid": "f340b3b524525061cc673c474b7937f2", "score": "0.60749817", "text": "def ibooks_version(val)\n @book.ibooks_version=val\n end", "title": "" }, { "docid": "a29b1f7b2422d2dc9e70451d4884caca", "score": "0.6064936", "text": "def version_number\n @version\n end", "title": "" }, { "docid": "93bfd53b2f66c8f60fd276db425aab4d", "score": "0.6057165", "text": "def min_version=(version)\n unless MIN_MAX_VERSIONS.include? version\n raise ArgumentError, \"Invalid SSL min_version #{version.inspect}\\n\" +\n \"Please specify one of #{MIN_MAX_VERSIONS.inspect}\"\n end\n\n @min_version = version\n end", "title": "" }, { "docid": "39078dfe5ae0e23dd4e973896531f5ae", "score": "0.6051353", "text": "def set_cookbook_version(version)\n return unless get_cookbook_version() != version\n contents = ''\n cookbook_path = get_cookbook_path(@cookbook_name)\n File.foreach(\"#{cookbook_path}/metadata.rb\") do |line|\n line.gsub!(/(version[\\t\\s]+)(.*)/i,\"\\\\1 \\\"#{version}\\\"\\n\")\n contents = contents << line\n end\n File.open(\"#{cookbook_path}/metadata.rb\", 'w') {|f| f.write(contents) }\n return true\n end", "title": "" }, { "docid": "452ff8700f0692696a838825061ffba7", "score": "0.6013791", "text": "def set_version(override_version=nil)\n versioned_request = VersionCake::VersionedRequest.new(request, override_version)\n @requested_version = versioned_request.extracted_version\n @derived_version = versioned_request.version\n @is_latest_version = versioned_request.is_latest_version?\n if !versioned_request.is_version_supported?\n raise UnsupportedVersionError.new('Unsupported version error')\n end\n @_lookup_context.versions = versioned_request.supported_versions\n end", "title": "" }, { "docid": "4bae1ea843376277ecff6c0ff7eb8af4", "score": "0.60128605", "text": "def app_ver=(value)\n if value == @defaults['appVer']\n @values.delete 'appVer' if @values.key? 'appVer'\n else\n @values['appVer'] = value\n end\n end", "title": "" }, { "docid": "03fc1462cb4e041522a909771369b8c2", "score": "0.60073996", "text": "def version=(val)\n if (val.kind_of?(Integer)) \n make_major_minor_version(val & 0xff)\n elsif(val.kind_of?(String))\n raise ArgumentError, \"Value should be 1-byte, but was #{val.length}.\" if (val.length != 1) \n make_major_minor_version(val.unpack('C')[0])\n else\n raise ArgumentError, \"Expected Integer, but #{val.class} provided.\" \n end\n end", "title": "" }, { "docid": "bb22f9427a515dca80717e609fb50b41", "score": "0.6006789", "text": "def set\n @version = get_version\n return unless version_exists?(@version )\n \n # only allow project owners to set the default version\n if @version and @version.project and @version.project.owned_by?(current_or_anon_user)\n @version.update_attribute(:updated_at, Time.now)\n flash[:success] = \"Default Project Download has been changed.\"\n @project.set_default_version(@version)\n else\n flash[:error] = \"Version no longer exists.\" \n end\n \n back_to_project\n end", "title": "" }, { "docid": "396cc45761a3055a535ff94f717d48f8", "score": "0.5992502", "text": "def app_version=(v)\n Axlsx.validate_string v\n @app_version = v\n end", "title": "" }, { "docid": "9783044d847cb26829823c5024e6cc83", "score": "0.59896904", "text": "def store(new_version)\n self.version = new_version\n cache.store(CACHE_VERSION_KEY, {'version' => new_version, 't' => cache_timestamp})\n end", "title": "" }, { "docid": "61816eb9407951d6fe045db504581cd8", "score": "0.5983408", "text": "def set_version(version)\n begin\n version = HeaderNames::DFC[version] || version\n case version.downcase.to_sym\n when HeaderNames::DFC[HeaderOption::DFC::STL_30]\n @fps = 29.97\n @gsi.dfc = HeaderOption::DFC::STL_30\n when HeaderNames::DFC[HeaderOption::DFC::STL_25]\n @fps = 25.0\n @gsi.dfc = HeaderOption::DFC::STL_25\n else\n version = HeaderDefault::DFC\n raise ArgumentError\n end\n rescue ArgumentError\n retry\n end\n end", "title": "" }, { "docid": "e56e6982607e626cd2fc1d9a6dbbc10e", "score": "0.5975748", "text": "def requirement=(version_requirement)\n @requirement = VersionRequirement.create(version_requirement.to_s)\n end", "title": "" }, { "docid": "565017de1104a23902851139fb7485fb", "score": "0.5950984", "text": "def version_property\n @version_property ||= RiCal::PropertyValue::Text.convert(self, \"2.0\")\n end", "title": "" }, { "docid": "81d95f9de2a1a4908e76cc31dbc39b3c", "score": "0.5947564", "text": "def set_schema_version(version)\n ActiveRecord::Base.connection.update(<<-ESQL\n UPDATE #{self.class.schema_info_table_name} \n SET version = #{down? ? version.to_i - 1 : version.to_i} \n WHERE plugin_name = '#{self.current_plugin.name}'\n ESQL\n )\n end", "title": "" }, { "docid": "1f4b98dc67ae2d0611c283f4e3525dfc", "score": "0.5940583", "text": "def accepted_version=(value)\n @accepted_version = value\n end", "title": "" }, { "docid": "940973dfb47109f370a3ada580492846", "score": "0.5914599", "text": "def version\n @version ||= '1.0'\n end", "title": "" }, { "docid": "01ba44a60c293028975575828618be8d", "score": "0.59116346", "text": "def version\n @version || 0\n end", "title": "" }, { "docid": "ab6e32421ffc8ecd0a6b70d2dde9a5b2", "score": "0.59057206", "text": "def set_default_version(version)\n return unless version\n \n self.download_url = version.download.url\n self.save\n end", "title": "" }, { "docid": "2bdd97b1c74ba9a290b88e4bef8e1f4c", "score": "0.59011346", "text": "def set_new_version\n @saving_version = new_record? || save_version?\n self.send(\"#{self.class.version_column}=\", next_version) if new_record? || (!locking_enabled? && save_version?)\n end", "title": "" }, { "docid": "02b9159b9a0efadcb22e7c2264ba8332", "score": "0.5894244", "text": "def os_ver=(value)\n if value == @defaults['osVer']\n @values.delete 'osVer' if @values.key? 'osVer'\n else\n @values['osVer'] = value\n end\n end", "title": "" }, { "docid": "8f6d09232322a4b52090d504fa7b9dc4", "score": "0.5881857", "text": "def management_sdk_version=(value)\n @management_sdk_version = value\n end", "title": "" }, { "docid": "8b14aaf91d12e9b42fe87e76738a0035", "score": "0.58802384", "text": "def schema_version=(schema_version)\n if schema_version.nil?\n fail ArgumentError, 'invalid value for \"schema_version\", schema_version cannot be nil.'\n end\n @schema_version = schema_version\n end", "title": "" } ]
0aea87ac137c06d6962bfced69153ad7
Return the minimum role required for +action+, and, if specified, +property+.
[ { "docid": "2a5436e746bfdf2948a3d57fd1862fba", "score": "0.8429756", "text": "def minimum_role(action, resource_config, property=nil)\n if property.nil?\n p = resource_config[:permission]\n raise Error, \"undefined #{action.inspect} permission\" unless p\n p[action]\n else\n hash = resource_config[:properties][property]\n hash ? hash[to_r_or_w(action)] : :nobody\n end || :anonymous\n end", "title": "" } ]
[ { "docid": "781015ac55f58d33e44a6d20ecbfda47", "score": "0.594379", "text": "def require_role\n action = request.params[:action]\n if (current_user && action.starts_with?(current_user.role_str))\n\n else\n store_location\n error_403\n return false\n end\n end", "title": "" }, { "docid": "2c949ca0c90bc4031e306c69f85c088a", "score": "0.5910852", "text": "def params_check_action_and_role(action, role, resource_config)\n invalid = []\n params.each_pair do |property, value|\n next if [FILTER_KEY, SEARCH_KEY, SHOW_KEY].include?(property)\n if !authorized?(action, role, resource_config, property.intern)\n invalid << property\n end \n end\n unless invalid.empty?\n error 400, convert(body_for(:invalid_params, invalid))\n end\n end", "title": "" }, { "docid": "404d36eead8c53fcb402bcc02a3e0f4e", "score": "0.5860746", "text": "def authorized?(action, role, resource_config, property=nil)\n klass = resource_config[:roles]\n klass.validate_role(role)\n klass.satisfies?(role, minimum_role(action, resource_config, property))\n end", "title": "" }, { "docid": "7575f665b6c7693b9db9d9f34ea2ba81", "score": "0.55992526", "text": "def is_authorized_to_perform(action)\n permission = role.shift_management_permissions_table.read_attribute(:\"#{action}\")\n return permission != :nobody\n end", "title": "" }, { "docid": "0815e0434145496758386a6564f3eb4a", "score": "0.5402875", "text": "def check_permission(action, role, resource_config)\n before_authorization(action, role, resource_config)\n unless authorized?(action, role, resource_config)\n error 401, convert(body_for(:unauthorized))\n end\n end", "title": "" }, { "docid": "87333ad3271e63b0bcb10d98bfda7abe", "score": "0.5327717", "text": "def get_role_action(key)\n key = Access::Validate.role(key)\n get_hash_value(Access::Core.roles_hash, key, :action)\n end", "title": "" }, { "docid": "80630ef7960e47806215057fca685b92", "score": "0.529065", "text": "def role_required?\n @role_required || false\n end", "title": "" }, { "docid": "aa001c7ddec9daf15794fd4185b1051d", "score": "0.52535516", "text": "def should_require_role(role, *args)\n args = Hash[*args]\n redirect_url = args.delete :redirect_url\n redirect_url ||= '/login'\n args.each do |action, verb|\n should \"require role for '#{action}' action\" do\n if [:put, :delete].include?(verb) # put and delete require an id even if it is a bogus one\n send(verb, action, :id => 1)\n else\n send(verb, action)\n end\n ensure_flash(/permission/i)\n assert_redirected_to(redirect_url)\n end\n end\n end", "title": "" }, { "docid": "5eebcf3d2139a3deb6e3b988e1f8da1d", "score": "0.5245118", "text": "def action_allowed?\n case params[:action]\n when 'show', 'set_priority', 'index'\n ['Instructor',\n 'Teaching Assistant',\n 'Administrator',\n 'Super-Administrator',\n 'Student'].include?(current_role_name) &&\n ((%w[list].include? action_name) ? are_needed_authorizations_present?(params[:id], 'participant', 'reader', 'submitter', 'reviewer') : true)\n else\n ['Instructor',\n 'Teaching Assistant',\n 'Administrator',\n 'Super-Administrator'].include? current_role_name\n end\n end", "title": "" }, { "docid": "51ea460387a019e9d977e7ef7c709af2", "score": "0.5193314", "text": "def require_privilege(action, *type_and_perm_obj)\n perm_obj = nil\n type_and_perm_obj.each do |obj|\n perm_obj=obj if obj.is_a?(ActiveRecord::Base)\n end\n @perm_obj = perm_obj\n unless check_privilege(action, *type_and_perm_obj)\n raise PermissionError.new(\n _('You have insufficient privileges to perform the selected action.'))\n end\n end", "title": "" }, { "docid": "325d9d21fee79845014a1e8d40a44c49", "score": "0.5161846", "text": "def role_allowed?(required_role)\n if role_hierarchy.find_index(required_role.to_sym)\n role_hierarchy.find_index(role.to_sym) >= role_hierarchy.find_index(required_role.to_sym)\n else\n false\n end\n end", "title": "" }, { "docid": "e393addf5e0191f21970d8f65efc6c61", "score": "0.50562465", "text": "def authorization(action, object = \"default - missing something?\")\n if action == \"create\"\n not_authorised and return unless current_user.can_create?\n elsif action == \"update\"\n not_authorised and return unless current_user.can_update?(object)\n elsif action == \"destroy\"\n not_authorised and return unless current_user.can_destroy?(object)\n elsif action == \"owner\"\n not_authorised and return unless current_user.owner?(object)\n elsif action == \"admin\"\n not_authorised and return unless current_user.admin_only\n end\n end", "title": "" }, { "docid": "693a4c21196ed6d827368f68c2019b99", "score": "0.5046859", "text": "def require_privilege(action, *type_and_perm_obj)\n perm_obj = nil\n type_and_perm_obj.each do |obj|\n perm_obj=obj if obj.is_a?(ActiveRecord::Base)\n end\n @perm_obj = perm_obj\n unless check_privilege(action, *type_and_perm_obj)\n raise PermissionError.new(\n \"You do not have permission to access this resource\")\n end\n end", "title": "" }, { "docid": "0a9723cff14e89e2afb621612d8b5733", "score": "0.503409", "text": "def index\n if @property.nil? || @property.user.id != @user.id\n redirect_to properties_path, notice: \"Not Authorized\" \n end\n end", "title": "" }, { "docid": "8a24bb6ca679f3d69a0345f283783c76", "score": "0.49906477", "text": "def action_allowed?\n ['Instructor',\n 'Teaching Assistant',\n 'Administrator'].include? current_role_name\n end", "title": "" }, { "docid": "8a24bb6ca679f3d69a0345f283783c76", "score": "0.49906477", "text": "def action_allowed?\n ['Instructor',\n 'Teaching Assistant',\n 'Administrator'].include? current_role_name\n end", "title": "" }, { "docid": "8a24bb6ca679f3d69a0345f283783c76", "score": "0.49906477", "text": "def action_allowed?\n ['Instructor',\n 'Teaching Assistant',\n 'Administrator'].include? current_role_name\n end", "title": "" }, { "docid": "34065ad9610db9833c2030edac5b2fcf", "score": "0.49869174", "text": "def check_params(action, role, resource_config, leaf)\n return unless leaf\n params_check_action(action)\n params_check_action_and_role(action, role, resource_config)\n end", "title": "" }, { "docid": "6300cd8d9980a3eacbc3a195b469c7f8", "score": "0.4973876", "text": "def can(action,resource)\n actions = [*action]\n actions << :all\n ruleset = resource.rules.where('permittee' => self, 'action' => actions)\n if ruleset.count > 0\n return true\n end\n return false\n end", "title": "" }, { "docid": "96c1804c16737f41689d37c751f16944", "score": "0.492842", "text": "def conditionally_require_on_setting(property, dependent_properties)\n dependent_properties = Array(dependent_properties)\n\n requirements.assert(:configure) do |a|\n a.assertion do\n # Needs to be set and truthy to require dependent properties\n if new_resource.send(property)\n dependent_properties.all? { |dep_prop| new_resource.property_is_set?(dep_prop) }\n else\n true\n end\n end\n\n message = format(\"Setting property :%<property>s requires properties :%<properties>s to be set as well on resource %<resource_name>s\",\n property: property,\n properties: dependent_properties.join(\", :\"),\n resource_name: current_resource.to_s)\n\n a.failure_message message\n end\n end", "title": "" }, { "docid": "0b628b17906bdf280bf4c797dc1abd5a", "score": "0.4928354", "text": "def required?(action = nil)\n if !action.nil? && options[:required].is_a?(Array)\n (options[:required] & Array(action)).any?\n else\n !!options[:required]\n end\n end", "title": "" }, { "docid": "8725dfd1f63222e9c3bdc2bd38daf3bd", "score": "0.49243298", "text": "def role\n if self.admin || (Setting.no_security == \"true\")\n return :admin\n elsif self.reviewer\n return :reviewer\n else\n return :default\n end\n end", "title": "" }, { "docid": "93fd91c1f388b82777c4231c3f74909c", "score": "0.4909961", "text": "def access_to_action(action)\n access = false\n\n # Editors can :edit\n\n if editor_access_level? & (AccessLevels::EDITOR_ACTIONS.include? action)\n access = true\n end\n\n # Admins can :delete\n\n if admin_access_level?\n access = true\n end\n\n return access\n end", "title": "" }, { "docid": "12d7f7ff734cba1b563977f106e65d6f", "score": "0.48895788", "text": "def action_allowed?\n ['Instructor', 'Teaching Assistant', 'Administrator'].include? current_role_name\n end", "title": "" }, { "docid": "e15f6e1b839c2cdf2791378e906c57f7", "score": "0.4882417", "text": "def validate_action?(action)\n\t\tres = subset?([action], @action_list)\n\t\tif ! res\n\t\t\tputs \"Action #{action}, is not valid\"\n\t\tend\n\n\t return res\n\tend", "title": "" }, { "docid": "63028bf03ca5f5221f7f248b0e439c19", "score": "0.48751664", "text": "def require_role(roles, options = {})\n options.assert_valid_keys(:if, :unless,\n :for, :only,\n :for_all_except, :except\n )\n\n # only declare that before filter once\n unless (@before_action_declared||=false)\n @before_action_declared=true\n before_action :check_roles\n end\n\n # convert to an array if it isn't already\n roles = [roles] unless Array===roles\n\n options[:only] ||= options[:for] if options[:for]\n options[:except] ||= options[:for_all_except] if options[:for_all_except]\n\n # convert any actions into symbols\n for key in [:only, :except]\n if options.has_key?(key)\n options[key] = [options[key]] unless Array === options[key]\n options[key] = options[key].compact.collect{|v| v.to_sym}\n end\n end\n\n self.role_requirements||=[]\n self.role_requirements << {:roles => roles, :options => options }\n end", "title": "" }, { "docid": "b99655f7bccf0a4e88eb805e1a753f94", "score": "0.48742315", "text": "def authorization_required\n case action_name.to_s\n when /index/, /show/ then list_authorized?\n when /create/ then create_authorized?\n when /update/ then update_authorized?\n when /destroy/ then delete_authorized?\n end\n false\n end", "title": "" }, { "docid": "565147b04ffe7ab0c4a2645c0ddd34f4", "score": "0.48645446", "text": "def role\n @role\n end", "title": "" }, { "docid": "17541bbd8adc727b9873666516284d84", "score": "0.4861851", "text": "def role\n permission_type\n end", "title": "" }, { "docid": "799510989b536829ad375b3dc9788f4c", "score": "0.483072", "text": "def role(req)\n \"admin:#{dealership(req).id}\"\n end", "title": "" }, { "docid": "ac3f7a4bb75bae95d863421f7ae2322f", "score": "0.48070693", "text": "def role\n admin ? \"admin\" : \"user\"\n end", "title": "" }, { "docid": "a83712c75196aad255e5e2e27198ec6e", "score": "0.47849974", "text": "def checkrole\n if roles_mask == 4\n 'User'\n elsif roles_mask == 6\n 'Administrator'\n end\n end", "title": "" }, { "docid": "9494c9de78409b3be6cbee25a8baefa7", "score": "0.4778787", "text": "def switch_role(student_action, tutor_action)\n case @prop[:role]\n when \"student\"\n student_action\n when \"Tutor\"\n tutor_action\n else\n puts 'You have selected an invalid option'\n end \n end", "title": "" }, { "docid": "51cc9cd90be0800ab6f36d4725941b6d", "score": "0.47762477", "text": "def edit\n if @property.user.id != @user.id\n redirect_to properties_path, notice:\"Not authorized\"\n end\n end", "title": "" }, { "docid": "8e783b6545c662f8f18d1a9777fc4f23", "score": "0.47750053", "text": "def check_roles\n if current_user.roles.include?(Role['owner'])\n return true\n elsif request.format.symbol == :json && params[:action] == 'index'\n return true\n end\n\n redirect_to root_path\n end", "title": "" }, { "docid": "92b2b52c852ce82ff0e3cfdefcafa001", "score": "0.47722104", "text": "def admin_assistant?\n if self.role and self.role < 3 \n true\n end\n end", "title": "" }, { "docid": "0f41a5f72bc9a6841ddca6fc86a0ade9", "score": "0.4759816", "text": "def required?(controller, action)\n action = action.to_sym\n results = evaluate_rules(controller, action)\n \n return true if results[:permitted_to].include?(action)\n return false if results[:restricted_from].include?(action)\n results[:default] == :permit\n end", "title": "" }, { "docid": "3723c786617f1b194a94eea3858675ff", "score": "0.4751788", "text": "def get_full_role\n if role == \"admin\"\n return \"Administrator\"\n elsif role == \"lead\"\n return \"Organization Lead\"\n end\n end", "title": "" }, { "docid": "3580a469d78f85e1cec161b25d1c320e", "score": "0.47500348", "text": "def invalid_role?\r\n self.role.blank? || self.role < 0\r\n end", "title": "" }, { "docid": "1fd817f354d6cb0ff1886ca0a2b6cce4", "score": "0.47487038", "text": "def validate_actions\n errors.add(:base, :should_give_at_least_one_action) if !manage? && !forecasting? && !read? && !api?\n end", "title": "" }, { "docid": "4cb4f765475ff633c90761f26d1d2f57", "score": "0.47434148", "text": "def check_user_role \t \n redirect_to root_path unless current_user.roles.first.name == \"empleado\" or current_user.roles.first.name == \"supervisor\"or current_user.roles.first.name == \"admin\" \n end", "title": "" }, { "docid": "720fa5370d0bbe5d4f9363f8396f1a78", "score": "0.4740384", "text": "def role; end", "title": "" }, { "docid": "720fa5370d0bbe5d4f9363f8396f1a78", "score": "0.4740384", "text": "def role; end", "title": "" }, { "docid": "966f189f67b7b51a1e7f6d6e96daedbf", "score": "0.47364852", "text": "def permission_role_or_subject_for(target, context, proles=nil)\n permission_subject_for(target, context) || permission_role_for(target, context, proles)\n end", "title": "" }, { "docid": "57e8a5872836f16bbdf0936274a398bc", "score": "0.47291583", "text": "def get_role\n\t\tif self.roles[0]\t\n\t\t\tself.roles[0].role_type \n\t\telse\n\t\t\t0\n\t\tend\n\tend", "title": "" }, { "docid": "128a315117717ee440b1d896e2eabaa1", "score": "0.47167072", "text": "def largest_property_name(properties)\n if properties.empty?\n 6 # we'll include \"action\" even without properties and it's 6 chars long\n else\n properties.max_by { |x| x[\"name\"].size }[\"name\"].size\n end\n end", "title": "" }, { "docid": "165a4525d6066671213c3fbd9aa11b8f", "score": "0.47097248", "text": "def action_required?\n !senior.blank? && !senior.triage_audit_logs.blank? && senior.triage_audit_logs.action_required.length > 0\n end", "title": "" }, { "docid": "4bdfe1ee5fc98d03d204a81cbd598922", "score": "0.4700587", "text": "def primary_role\n return nil if user.person_role.blank?\n user.person_role\n end", "title": "" }, { "docid": "1260a4817de37c90038f9693954f026d", "score": "0.46979558", "text": "def authorization\n authorization = 'participant'\n authorization = 'reader' if !can_submit && can_review && can_take_quiz\n authorization = 'submitter' if can_submit && !can_review && !can_take_quiz\n authorization = 'reviewer' if !can_submit && can_review && !can_take_quiz\n authorization\n end", "title": "" }, { "docid": "62e0086eede97cdb57af00030e96f960", "score": "0.469608", "text": "def allowed?(method:, by: nil, action: '')\n case by&.role_id\n when ROLE_ID[:admin]\n true\n else\n false\n end\n end", "title": "" }, { "docid": "b476296169399b86d0140c213f22f2c3", "score": "0.4681947", "text": "def role\n return @role\n end", "title": "" }, { "docid": "12835fce08dae6ccd07fa7e617839752", "score": "0.46789542", "text": "def allowed?(method:, by: nil, action: '')\n return readable?(by: by, action: action) if method == 'GET'\n\n case by&.role_id\n when ROLE_ID[:admin]\n true\n else # nologin, ...\n false\n end\n end", "title": "" }, { "docid": "556599eb5a32bfc2da6dc2091c95866c", "score": "0.46773908", "text": "def get_role\n\t\tself.role\n\tend", "title": "" }, { "docid": "64aa34f5feb506c4a30a0d5b9de4f9aa", "score": "0.467599", "text": "def check_permission(event, role)\n case role\n when 'botmaster'\n {\n granted: event.user.id == BOTMASTER_ID,\n allowed: ['botmasters']\n }\n else\n names = Role.owners(role).pluck(:username)\n {\n granted: Role.exists(event.user.id, role),\n allowed: role.pluralize #names\n }\n end\nend", "title": "" }, { "docid": "9b65b50984405152801e849206dd3d2f", "score": "0.46637836", "text": "def show\n @contact = Contact.find(params[:contact_id])\n @property = Property.find(params[:id])\n authorize @property\n end", "title": "" }, { "docid": "3b261da19e2340070311b80d3bd399b0", "score": "0.46582437", "text": "def can_do?(test_role)\n test_priority = PRIORITIES[test_role.to_sym] || 1000\n my_priority = PRIORITIES[role.to_sym] || 1000\n\n if test_priority == my_priority\n test_role.to_s == :owner ? owner? : test_role.to_sym == role.to_sym\n else\n my_priority < test_priority\n end\n end", "title": "" }, { "docid": "9130b6b1440e8263c17217660a46710f", "score": "0.46559653", "text": "def role\n @manifest_options[:role] || \"\"\n end", "title": "" }, { "docid": "3d9415dedba0287c51b497e961e71f6c", "score": "0.46528086", "text": "def required_permission\n #\n # return the permission record if we have the Permission model\n #\n @required_permission ||= defined?(Permission) ? wulin_permits_required_permission : OpenStruct.new(name: [controller_name, action_name].join(\"#\"))\n end", "title": "" }, { "docid": "817880d36e62179032a79a62baee2fb2", "score": "0.46457785", "text": "def allowed?(method:, by: nil, action: '')\n return readable?(by: by, action: action) if method == 'GET'\n\n case by&.role_id\n when ROLE_ID[:admin]\n true\n when ROLE_ID[:writer]\n readable?(by: by, action: action)\n when ROLE_ID[:participant]\n return false if method == 'DELETE'\n\n id == by.id\n else # nologin, ...\n false\n end\n end", "title": "" }, { "docid": "629cb3cfd9908fa6c1451e80f66350c7", "score": "0.46355587", "text": "def valid_action_by_screen_configuration?(action)\n (action[:only].blank? and action[:except].blank?) ||\n (action[:only].present? and params[:screen].present? and action[:only].include?(params[:screen].intern)) ||\n (action[:except].present? and params[:screen].present? and action[:except].exclude?(params[:screen].intern))\n end", "title": "" }, { "docid": "c7ef853ecd0c653eb65151f04b1705e3", "score": "0.4633082", "text": "def allowed_to?(action)\n if action.is_a? Hash\n authorized = allowed_actions.include? \"#{action[:controller]}/#{action[:action]}\"\n else\n authorized = allowed_permissions.include? action\n end\n logger.debug \"Authorizing: Granted: #{authorized}\"\n authorized\n end", "title": "" }, { "docid": "305c840f3588a51ae57cefc8789c2e93", "score": "0.46273696", "text": "def permit?(action)\n case action\n # -- list\n when :list\n permit?(:list_cases)\n\n # -- create\n when :create\n source? && @settings.working_hours?\n when :create_assignment\n agent? || enroller? || governor?\n when :create_note\n agent? || enroller?\n\n # -- edit\n when :edit\n agent? || governor? || enroller?\n when :edit_address\n agent? || source?\n when :edit_contact\n agent? || source?\n when :edit_address_geography\n source?\n when :edit_household\n agent? || governor? || permit?(:edit_household_source)\n when :edit_household_source\n permit?(:edit_household_ownership) || permit?(:edit_household_proof_of_income)\n when :edit_household_size\n agent? || governor?\n when :edit_household_ownership\n (agent? || source?) && requirement?(R::HouseholdOwnership)\n when :edit_household_proof_of_income\n (agent? || source?) && !requirement?(R::HouseholdProofOfIncomeDhs)\n when :edit_household_dhs_number\n (agent? || governor?) && proof_of_income?(P::Dhs)\n when :edit_household_size\n agent? || governor?\n when :edit_household_income\n (agent? || governor?) && proof_of_income?(P::Dhs)\n when :edit_supplier_account\n (agent? || source?) && requirement?(R::SupplierAccountPresent)\n when :edit_supplier\n agent? || (source? && !supplier?)\n when :edit_supplier_account_active_service\n agent? && requirement?(R::SupplierAccountActiveService)\n when :edit_food\n (source? || agent?) && requirement?(R::FoodDietaryRestrictions)\n when :edit_benefit\n agent? || enroller?\n when :edit_benefit_amount\n (agent? || enroller?)\n when :edit_benefit_contract\n (agent?) && requirement?(R::ContractPresent)\n when :edit_documents\n agent?\n when :edit_admin\n agent?\n\n # -- view\n when :view\n agent? || source? || enroller?\n when :view_details\n permit?(:view)\n when :view_details_status\n agent? || enroller?\n when :view_details_enroller\n agent?\n when :view_supplier_account\n permit?(:view) && requirement?(R::SupplierAccountPresent)\n when :view_food\n permit?(:view) && requirement?(R::FoodDietaryRestrictions)\n when :view_household_size\n (agent? || enroller?)\n when :view_household_ownership\n permit?(:view) && requirement?(R::HouseholdOwnership)\n when :view_household_proof_of_income\n (agent? || enroller?) && !requirement?(R::HouseholdProofOfIncomeDhs)\n when :view_household_dhs_number\n (agent? || enroller?) && proof_of_income?(P::Dhs)\n when :view_household_income\n (agent? || enroller?) && proof_of_income?(P::Dhs)\n when :view_supplier_account_active_service\n (agent? || enroller?) && requirement?(R::SupplierAccountActiveService)\n\n # -- actions\n when :convert\n agent?\n when :referral\n agent?\n when :complete\n agent? || enroller?\n\n # -- destroy\n when :destroy\n agent?\n when :destroy_assignment\n agent?\n\n # -- archive\n when :archive\n agent?\n else\n super\n end\n end", "title": "" }, { "docid": "9bb76ef25df16d6361aefed0bf00c634", "score": "0.462411", "text": "def role\r\n r = read_attribute(:role)\r\n r.capitalize unless r.nil?\r\n end", "title": "" }, { "docid": "bcd9bf73237f21cad1b43e7b65e5f70b", "score": "0.46179855", "text": "def role\n @role ||=\n if is_admin?\n :admin\n else\n :customer\n end\n end", "title": "" }, { "docid": "59fa932e3d94b6402553ed12b4770c73", "score": "0.46156427", "text": "def pcb_management_role\n self.roles.detect { |r| r.name == 'Manager' }\n end", "title": "" }, { "docid": "584e075d16d6a2c0a704f1193d131f07", "score": "0.46136856", "text": "def can_edit?(required_role)\n \n perm = current_user.permissions.select { |p| p.role.name == required_role}[0]\n \n @readonly= perm.nil? ? false : perm.readOnly?\n \n end", "title": "" }, { "docid": "d7d119a494bbd78f0482a1ff6f9c0a33", "score": "0.4609939", "text": "def params_check_action(action)\n case action\n when :list\n p = params.reject do |k, v|\n [FILTER_KEY, SEARCH_KEY].include?(k)\n end\n unless p.empty?\n error 400, convert(body_for(:invalid_params, p))\n end\n when :read\n p = params.reject { |k, v| k == SHOW_KEY }\n unless [nil, \"all\"].include?(params[SHOW_KEY])\n error 400, convert(body_for(:invalid_params,\n { SHOW_KEY => params[SHOW_KEY] }))\n end\n unless p.empty?\n error 400, convert(body_for(:invalid_params, p))\n end\n when :create\n # No need to complain. If there are problems,\n # params_check_action_and_role will catch them.\n when :update\n if params.empty?\n error 400, convert(body_for(:no_params))\n end\n when :delete\n unless params.empty?\n error 400, convert(body_for(:invalid_params, p))\n end\n else\n raise Error, \"Unexpected: #{action.inspect}\"\n end\n end", "title": "" }, { "docid": "44fb3a2f0e0b61d8541f5cf91e7c3e81", "score": "0.46043658", "text": "def allowed?(action,user)\n\n if user.tenant?\n flash[:notice] = \"Sorry. You are not allowed to perform this action as a tenant\"\n return redirect_to action, notice:\"Sorry. You can't list a property as a tenant\"\n end\n\n\n\n end", "title": "" }, { "docid": "a745244c3165b9b1ed33e0a76155683a", "score": "0.46027532", "text": "def check_property\n return true if @current_user.is_admin?\n\n # Cambiar parametro arriba.\n if !params[:category_id].blank? && @candidate # || ADMIN\n # @user = User.find_by_id(params[:category_id])\n # logger.debug 'CANDIDATE: #{@candidate} '\n respond_to do |format|\n format.html do\n unless @candidate.category_id == @category.id\n user_session[:category_id] = nil\n redirect_to(edit_user_organizer_path(@category.selection_process.organizer.user,@category.selection_process.organizer), alert: 'Solo puedes operar sobre el proceso que tu hayas creado.')\n end\n end\n end\n end\n\n # Primero si puede ver el proceso.\n set_selection_process if @selection_process.nil?\n unless @selection_process.is_owner?(current_user.id)\n security_exit\n return false\n end\n\n @organizer = @organizer.selection_process.find_by_id(@selection_process)\n\n if @selection_process.organizer != @current_user.organizer && !@current_user.is_admin?\n respond_to do |format|\n format.html do\n unless @selection_process == @category.selection_process\n user_session[:selection_process_id] = nil\n user_session[:category_id] = nil\n redirect_to(:back , alert: 'Solo puedes operar sobre las categorías del proceso seleccionado.')\n end\n end\n end\n end\n end", "title": "" }, { "docid": "456e185ec29e99eff0bdfe9958e737d6", "score": "0.45920926", "text": "def required_properties(entity)\n requireds = entity[:children]\n .select { |ch| ch[:required] == true }\n .map { |ch| ch[:name].to_s }\n pre_req = entity[:required].is_a?(Array) ? entity[:required] : []\n { required: requireds | pre_req }\n end", "title": "" }, { "docid": "131470f3742bedbbab7956559a9f4c45", "score": "0.45915416", "text": "def require_role(roles, options = {})\n options.assert_valid_keys(:if, :unless,\n :for, :only,\n :for_all_except, :except\n )\n\n @role_requirements=[]\n\n # only declare that before filter once\n unless (@before_filter_declared||=false)\n @before_filter_declared=true\n before_filter :check_roles\n end\n\n # convert to an array if it isn't already\n roles = [roles] unless Array===roles\n\n options[:only] ||= options[:for] if options[:for]\n options[:except] ||= options[:for_all_except] if options[:for_all_except]\n\n # convert any actions into symbols\n for key in [:only, :except]\n if options.has_key?(key)\n options[key] = [options[key]] unless Array === options[key]\n options[key] = options[key].compact.collect{|v| v.to_sym}\n end\n end\n\n @role_requirements||=[] #self.\n @role_requirements << {:roles => roles, :options => options } #self.\n end", "title": "" }, { "docid": "ca1b04b9948b901749455a237c1cb4c9", "score": "0.45905814", "text": "def before_authorization(action, role, resource_config)\n raise NotImplementedError\n end", "title": "" }, { "docid": "a65ec3bfc711376040bb84dfa5e637a8", "score": "0.45893702", "text": "def approve_reject\n @property = Property.find(params[:id])\n @property.attributes = params[:property]\n if @property.valid?\n if params[:approve]\n # check requirement for property approval\n if @property.currency.blank?\n flash[:alert] = t(\"admin.properties.approve.message.no_currency\")\n elsif @property.channels.count == 0\n flash[:alert] = t(\"admin.properties.approve.message.no_channels\")\n elsif @property.room_types.count == 0\n flash[:alert] = t(\"admin.properties.approve.message.no_room_type\")\n elsif RoomTypeChannelMapping.room_type_ids(@property.room_type_ids).count != (@property.room_types.count * @property.channels.count)\n flash[:alert] = t(\"admin.properties.approve.message.no_room_type_channel_mapping\")\n else\n @property.approved = true\n @property.rejected = false\n flash[:notice] = t('properties.update.message.approved')\n end\n # reject a property\n else params[:reject]\n @property.approved = false\n @property.rejected = true\n flash[:notice] = t('properties.update.message.rejected')\n end\n @property.save\n \n redirect_to admin_setup_path\n else\n put_model_errors_to_flash(@property.errors)\n render :action => \"manage\", :layout => 'admin/layouts/no_left_menu'\n end\n end", "title": "" }, { "docid": "ea4d15e6103542e039b4e200049c0ca8", "score": "0.45822135", "text": "def validate(action)\n validate_turn(action.player)\n klass = action.class\n fail InvalidActionError, \"Attempted to perform #{klass}, \" \\\n \"Allowed Actions: (#{available_actions})\" unless\n available_actions.include?(klass)\n end", "title": "" }, { "docid": "3984fc0685cb625dc0d91eeeaa5b83c3", "score": "0.4580077", "text": "def required\n [:ext_person_source_id, :source_username, :source_password, :ext_policy_id]\n end", "title": "" }, { "docid": "973759458cc82964ccde8aac84d947bf", "score": "0.45792377", "text": "def get_full_role\n\t\tif role == \"lead\"\n\t\t\treturn \"Project Lead\"\n\t\telsif role == \"editor\"\n\t\t\treturn \"editor\"\n\t\tend\n\tend", "title": "" }, { "docid": "c623f01609a1d91ca29e5aff23758bb3", "score": "0.45710617", "text": "def login_or_role_required\n if(logged_in?)\n searchID = params[\"event\"] ? params[\"event\"][\"id\"] : params[\"id\"];\n perms = EventRole.find(:all,\n :conditions => [\"member_id = (?) AND event_id = (?)\", \n current_member().id, \n searchID]);\n if(!perms.empty?)\n return true;\n end\n end\n\n return login_required();\n end", "title": "" }, { "docid": "5cbe46832695c83f9812afb69500d7bf", "score": "0.45689756", "text": "def get_property( propname )\n resp = conn.get('/users/'+name+'/props/'+propname+'/')\n \n case resp.code.to_i\n when 200\n return JSON.parse( resp.body )\n when 404\n case resp.header['resource-type']\n when 'user'\n raise RestAuthUserNotFound.new( resp )\n when 'property'\n raise RestAuthPropertyNotFound.new( resp )\n else\n raise RestAuthBadResponse.new( resp, \"Received 404 without Resource-Type header\" )\n end\n else\n raise RestAuthUnknownStatus.new( resp )\n end\n end", "title": "" }, { "docid": "a11e1b44bf94e0618253f17076747cb7", "score": "0.4568032", "text": "def getSuccessor(agent,action)\n\t\treturn self.successorFunction.call(self,agent,action)\n\tend", "title": "" }, { "docid": "1cd32047fe8c36acdb74e179db6f37dc", "score": "0.4566124", "text": "def authorize(required_role)\n self.send required_role.to_sym\n end", "title": "" }, { "docid": "bbe13fe16fdb4cbb58ec8c676670fece", "score": "0.4561728", "text": "def admin?\n self.role.role_type == \"admin\"\n end", "title": "" }, { "docid": "418e75b7adde570b923124d7fbfe28e4", "score": "0.45609587", "text": "def requires_photographer_action\n self.requests.each do |r|\n if r.state == \"action_needed\"\n return true\n end\n end\n false\n end", "title": "" }, { "docid": "89e31724580aacf39b0630474d8c9bc1", "score": "0.45596582", "text": "def index\n @allowed = false\n if check_permissions?(session[:user_type], \"create_property\")\n @allowed = true\n end\n @properties = Property.all\n end", "title": "" }, { "docid": "d7ff84743d8326bd6e79de59991c3957", "score": "0.45542902", "text": "def crew?\n self.role == \"crew\"\n end", "title": "" }, { "docid": "61d2f903655223749964ed03d5a028f1", "score": "0.4553458", "text": "def check_role\n redirect_to(root_url) unless check_role?(\"News Editor\") or check_role?(\"Site Admin\")\n end", "title": "" }, { "docid": "61d2f903655223749964ed03d5a028f1", "score": "0.4553458", "text": "def check_role\n redirect_to(root_url) unless check_role?(\"News Editor\") or check_role?(\"Site Admin\")\n end", "title": "" }, { "docid": "2311340845e7928715ec5242d732934f", "score": "0.45454183", "text": "def is_authorized(min_role)\n @roles = Role.all.group(:name)\n\n authorized = false\n if @roles[self[:name]] >= @roles[min_role]\n authorized = true\n end\n\n return authorized\n end", "title": "" }, { "docid": "b65dfb20b321c4e832c5497452fabfd5", "score": "0.4542133", "text": "def eval_cancan_action(action)\n case action.to_s\n when \"index\", \"show\", \"search\"\n cancan_action = \"read\"\n action_desc = I18n.t :read\n when \"create\", \"new\"\n cancan_action = \"create\"\n action_desc = I18n.t :create\n when \"edit\", \"update\"\n cancan_action = \"update\"\n action_desc = I18n.t :edit\n when \"delete\", \"destroy\"\n cancan_action = \"delete\"\n action_desc = I18n.t :delete\n else\n cancan_action = action.to_s\n action_desc = \"Other: \" << cancan_action\n end\n return action_desc, cancan_action\n end", "title": "" }, { "docid": "d6b5745cd85ab74c9aad3d0cdbf418fb", "score": "0.45397648", "text": "def required_properties; end", "title": "" }, { "docid": "3f5f2948fee8926c1f54536a58f889a8", "score": "0.4534424", "text": "def allowed_to?(action)\n if action.is_a? Hash\n allowed_actions.include? \"#{action[:controller]}/#{action[:action]}\"\n else\n allowed_permissions.include? action\n end\n end", "title": "" }, { "docid": "cd81ede6d15ed0964d0ad15d5a7d8115", "score": "0.45301002", "text": "def get_role\n return case self.role_id\n when 2\n \"User\"\n else\n \"N/A\"\n end\n end", "title": "" }, { "docid": "0e72477bdac7c216c1f64e606fc7f61d", "score": "0.4527729", "text": "def allowed?(by: nil, method:, action: \"\")\n return readable?(by: by, action: action) if method == 'GET'\n\n case by&.role_id\n when ROLE_ID[:admin]\n true\n when ROLE_ID[:writer]\n creator_id == by.id\n else\n false\n end\n end", "title": "" }, { "docid": "b576ae967459c51ef846581aec73ed8f", "score": "0.45245078", "text": "def admin?\n self.role == 'admin'\n end", "title": "" }, { "docid": "b576ae967459c51ef846581aec73ed8f", "score": "0.45245078", "text": "def admin?\n self.role == 'admin'\n end", "title": "" }, { "docid": "b576ae967459c51ef846581aec73ed8f", "score": "0.45245078", "text": "def admin?\n self.role == 'admin'\n end", "title": "" }, { "docid": "bda4625246eb9be353899b7b4909ac33", "score": "0.4520148", "text": "def must_have_a_role\n errors.add(:roles, \"Must have a staff or admin role\") unless admin_or_staff?\n end", "title": "" }, { "docid": "d60fb8d514c6e40f1fa5a5bca38572ee", "score": "0.4510731", "text": "def run_action?\n admin? || cluster_owner?\n end", "title": "" }, { "docid": "7ad71c49cd77f78ef6ba0d92c225ac4e", "score": "0.45075524", "text": "def allowed?(method:, by: nil, action: '')\n return readable?(by: by, action: action) if method == 'GET'\n\n case by&.role_id\n when ROLE_ID[:admin], ROLE_ID[:writer]\n true\n else # nologin, ...\n false\n end\n end", "title": "" }, { "docid": "45a3560e26915d5f02aa17790dedfcf6", "score": "0.45055726", "text": "def validates_role\n self.role = Role.find_by_name \"Technician\" if self.role.nil?\n end", "title": "" }, { "docid": "920869c06af643018effcbe61becddb3", "score": "0.45037368", "text": "def is?( requested_role )\n self.role == requested_role.to_s\n end", "title": "" } ]
d4726fab0da16c00d42c2e57d4b6f962
process_erb_templates(cartridge_name) > nil Search cartridge for any remaining erb files render them
[ { "docid": "346c901edfc68326efaf622505245c7e", "score": "0.8834185", "text": "def process_erb_templates(cartridge_name)\n logger.info \"Processing ERB templates for #{cartridge_name}\"\n env = Utils::Environ.for_gear(@user.homedir)\n render_erbs(env, File.join(@user.homedir, cartridge_name, '**'))\n end", "title": "" } ]
[ { "docid": "9aa5a9e31e44f6bfe9cf25328030160c", "score": "0.6367204", "text": "def templates() = templates_path.glob('**/*.erb')", "title": "" }, { "docid": "d65de1644b286e74f3b32e630eabc0a0", "score": "0.5979455", "text": "def __in_erb_template;\n end", "title": "" }, { "docid": "d65de1644b286e74f3b32e630eabc0a0", "score": "0.5979455", "text": "def __in_erb_template;\n end", "title": "" }, { "docid": "b231e0db33c6af549589c007bcd53e07", "score": "0.59513694", "text": "def process_template(template)\n @dlogger.debug \"Processing template #{template} for file #{@file}\"\n # The '-' arg allows folks to use <% -%> or <%- -%> to instruct ERB to\n # not insert a newline for that line, which helps avoid a bunch of blank\n # lines in the processed file where there was code in the template.\n erb = ERB.new(IO.read(template), nil, '-')\n # The binding arg ties the template's namespace to this point in the\n # code, thus ensuring that all of the variables above (@file, etc.)\n # are visible to the template code.\n begin\n erb.result(binding)\n rescue Exception => e\n # Help the user figure out where the exception occurred, otherwise they\n # just get told it happened here, which isn't very helpful.\n raise Etch.wrap_exception(e, \"Exception while processing template #{template} for file #{@file}:\\n\" + e.message)\n ensure\n restore_globals\n end\n end", "title": "" }, { "docid": "cabe255a77453e90b9401bb18c9d21db", "score": "0.59110206", "text": "def my_render_erb erb, opts = {}\n if (path = erb_path_for(erb)).nil?\n log_error \"If you use #my_render_erb within a dynamically defined dep, you have to give the full path to the erb template.\"\n elsif !File.exists?(path) && !opts[:optional]\n log_error \"Couldn't find erb to render at #{path}.\"\n elsif File.exists?(path)\n # require 'erb'\n debug ERB.new(IO.read(path)).result(binding)\n shell(\"cat > #{opts[:to]}\",\n :input => ERB.new(IO.read(path)).result(binding),\n :sudo => opts[:sudo]\n ) do |result|\n if result\n log \"Rendered #{opts[:to]}.\"\n sudo \"chmod #{opts[:perms]} '#{opts[:to]}'\" unless opts[:perms].nil?\n else\n log_error \"Couldn't render #{opts[:to]}.\"\n end\n end\n end\nend", "title": "" }, { "docid": "54b6ec564bf4e27aa8ac5d4929b9e8fa", "score": "0.5902335", "text": "def render(template_name)\n #Use controller and template names to construct paths to template files.\n\n\n #Use File.read to read the template file.\n\n #Create a new ERB template from the contents.\n \n #Evaluate the ERB template, using binding to capture the controller's instance variables.\n\n #Pass the result to #render_content with a content_type of text/html.\n\n \n end", "title": "" }, { "docid": "1de75b43db59f9da642730acc00dcdd5", "score": "0.5876826", "text": "def render_erb\n end", "title": "" }, { "docid": "4e9cf22bb62042f5a7f4228ca3275dad", "score": "0.58025205", "text": "def uses_of_yield_in_templates\n path_to_templates = \"#{PROJECT_ROOT}/app/**/*.erb\"\n templates = Dir.glob(path_to_templates)\n\n templates.reduce([]) do |accumulator, filename|\n accumulator | UsesOfYieldInTemplate.new(filename).call\n end\nend", "title": "" }, { "docid": "fce4d581fa481d2d85f4ca1a08538f76", "score": "0.5783814", "text": "def process_template(template_path)\n if @processed_templates[template_path]\n return @processed_templates[template_path]\n end\n\n unprocessed_template = read_template(template_path)\n @processed_templates[template_path] = unprocessed_template.gsub(/{{[^{}()\\[\\]]+}}/) do |to_replace|\n replacement_path = to_replace.gsub(/[{}]/, '')\n process_template(replacement_path)\n end.strip\n end", "title": "" }, { "docid": "52f225ecca7ffcab73b9342811deca03", "score": "0.57672435", "text": "def render\n case File.extname(@template_file)\n when '.erb'\n render_erb\n else\n render_plain\n end\n end", "title": "" }, { "docid": "12303f06976a48d33243cb1d5f99975e", "score": "0.57474416", "text": "def erb_templates(*paths)\n @erb_templates ||= []\n @erb_templates.push(*paths) if paths.size > 0\n @erb_templates\n end", "title": "" }, { "docid": "59eccf322b4f7ddf823e56857bcaeb18", "score": "0.5741795", "text": "def parse_template_files(file_paths)\n require \"tempfile\"\n\n file_paths.each do |file_path|\n remote_path = File.join(latest_release, file_path)\n\n remote_template_paths = []\n\n # If a file was given, see if a template file exists.\n begin\n remote_template_paths += capture(\"ls -1 #{remote_path}.erb\").to_s.split\n rescue Capistrano::CommandError\n end\n\n # If a path was given, see recursively check for any templates.\n begin\n remote_template_paths += capture(\"find #{remote_path} -name '*.erb'\").to_s.split\n rescue Capistrano::CommandError\n end\n\n remote_template_paths.each do |remote_template_path|\n # Download the template path from the server. We want to grab the copy from\n # the server, and not the local copy, since they may differ (If I'm doing\n # a deploy and I haven't done an svn update or I'm deploying a specific\n # branch while sitting in another branch locally).\n Tempfile.open(\"capistrano-template\") do |temp_file|\n get(remote_template_path, temp_file.path)\n\n # Parse the template file as a Ruby file so we can evaluate\n # variables.\n content = File.read(temp_file.path)\n parsed_content = Erubis::Eruby.new(content).result(binding)\n\n logger.info(\"Parsed template file:\\n\\n\")\n puts parsed_content\n logger.info(\"\\n\")\n\n install_remote_path = remote_template_path.gsub(/\\.erb$/, \"\")\n\n # Write the evaluated configuration file to the server as the real\n # configuration file.\n put(parsed_content, install_remote_path)\n end\n end\n end\nend", "title": "" }, { "docid": "b583db2a261dc602f12a96fddfe77481", "score": "0.5739712", "text": "def process_template(source_file)\n rfile = ERB.new(File.read(source_file))\n @cookbook = @metadata.name\n\n rfile.result(binding)\n end", "title": "" }, { "docid": "56de333a974111affe9643f2ee1333a5", "score": "0.57188797", "text": "def render(template_name)\n if already_built_response? \n raise \"DoubleRenderError\"\n else \n controller_name = self.class.to_s.underscore \n dir = File.join(\"views\",controller_name, \"#{template_name}.html.erb\")\n # debugger\n content = File.read(dir).split(\"\\n\")\n content.map! do | statement | \n start_point = /<%/ =~ statement\n # debugger\n if start_point.nil? \n statement\n else \n front_part = statement[0...start_point]\n # returning = \n # start_point += statement[start_point+2] == \"=\" ? 2 : 1\n end_point = /%>/ =~ statement \n end_point += 1\n rear_part = statement[end_point+2..-1]\n front_part.to_s + ERB.new(statement[start_point..end_point]).result(binding) + rear_part.to_s\n end \n end \n render_content(content)\n end \n end", "title": "" }, { "docid": "00a0484651de910b22000464782dd283", "score": "0.5678053", "text": "def render(*args)\n tpls_file = (@__caller_info__ || __caller_info__).first.first\n self._template_parser.load(tpls_file).parse.each do |template_name, raw_content|\n # no controller name if absolute view path\n ctrl_name = template_name.match(/^\\//) ? nil : self.controller_name\n path = Merb.dir_for(:view) / self._template_location(template_name.gsub(/^\\//,''), nil, ctrl_name)\n file = VirtualFile.new(raw_content, path)\n TEMPLATES[path.to_s] = file\n end\n super\n end", "title": "" }, { "docid": "53ed17189f8b2c79b262c9bb32df82d9", "score": "0.5670744", "text": "def render_erb\n require 'erb'\n\n renderer = ERB.new(template_content, trim_mode: '-')\n renderer.filename = @template_file\n renderer.result(binding)\n end", "title": "" }, { "docid": "de319dc6efdf16bad85d649b10919ff2", "score": "0.5604536", "text": "def process_default_render exp\n process_layout\n process_template template_name, nil\n end", "title": "" }, { "docid": "0a62d662356df7944dae9a1f15cf42e8", "score": "0.55927426", "text": "def erb(file, options)\n # https://www.rubyguides.com/2015/05/working-with-files-ruby/\n result = File.read(\"views/layout.erb\")\n template = File.read(\"views/#{file}.erb\")\n # https://www.rubyguides.com/2019/07/ruby-gsub-method/\n result.gsub! \"<%= yield %>\", template\n result\n end", "title": "" }, { "docid": "b425fb9e41ba391bd9c350b285e52192", "score": "0.5585412", "text": "def render\n # puts 'rendering'\n # puts @@env\n if File.exist? @temp_view\n res = \n [ \n Erubis::Eruby.new(\n File.read(File.join(@@app, \"views\", \"template\", \"tem.html.erb\")) +\n File.read(@temp_view) +\n File.read(File.join(@@app, \"views\", \"template\", \"plate.html.erb\"))\n ).result( binding )\n ]\n [200, {'Content-Type' => 'text/html'}, res]\n else\n res = \n [ \n Erubis::Eruby.new(\n File.read(File.join(@@app, \"views\", \"template\", \"tem.html.erb\")) +\n File.read(File.join(@@app, \"views\", \"404.html.erb\")) +\n File.read(File.join(@@app, \"views\", \"template\", \"plate.html.erb\"))\n ).result( binding )\n ]\n [404, {'Content-Type' => 'text/html'}, res]\n end\n end", "title": "" }, { "docid": "19b529f46cb9408ac465631c301e0fe3", "score": "0.55853236", "text": "def render_template(template, context)\n begin\n eruby = Erubis::Eruby.new(template)\n output = eruby.evaluate(context)\n rescue Object => e\n raise TemplateError.new(e, template, context)\n end\n Tempfile.open(\"chef-rendered-template\") do |tempfile|\n tempfile.print(output)\n tempfile.close\n yield tempfile\n end\n end", "title": "" }, { "docid": "86250ddd38058214c528e27d2152fcd7", "score": "0.55833584", "text": "def find_template(views, name, engine, &block)\n Array(views).each {|v|super(v, name, engine, &block) }\n end", "title": "" }, { "docid": "47c20b47759dbd97470c381f1fe07bc8", "score": "0.5582376", "text": "def compile_templates\n dir = File.join(Frank.root, Frank.dynamic_folder)\n\n Dir[File.join(dir, '**{,/*/**}/*')].each do |path|\n if File.file?(path) && !File.basename(path).match(/^(\\.|_)/)\n path = path[ (dir.size + 1)..-1 ]\n ext = File.extname(path)\n new_ext = ext_from_handler(ext)\n name = File.basename(path, ext)\n\n # No suitable handler found\n if not new_ext.is_a? String\n next\n end\n\n if Frank.production? && \"#{name}.#{new_ext}\" != 'index.html' && new_ext == 'html'\n new_file = File.join(Frank.export.path, path.sub(/(\\/?[\\w-]+)\\.[\\w-]+$/, \"\\\\1/index.#{new_ext}\"))\n else\n new_file = File.join(Frank.export.path, path.sub(/\\.[\\w-]+$/, \".#{new_ext}\"))\n end\n\n create_dirs(new_file)\n File.open(new_file, 'w') {|f| f.write render(path) }\n puts \" - \\033[32mCreating\\033[0m '#{new_file}'\" unless Frank.silent_export?\n end\n end\n end", "title": "" }, { "docid": "b5d1a05b6849a56b13a447b0a112c00a", "score": "0.5575732", "text": "def render_self!(files)\n files.each do |f|\n if File.exists?(f + @config['tpl_ext'])\n basename = f.sub(/^#{@app_root}\\//, '')\n carp \"From #{'self'.blue.bold} render #{basename.bold}\",\n render_file!(f + @config['tpl_ext'], f), 1\n end\n end\n end", "title": "" }, { "docid": "00232b638a305264c07cfce3f0112d8c", "score": "0.5522577", "text": "def render(&block)\n template_names = [ @layouts, @name ].flatten.reverse\n top_render_proc = template_names.inject(block) do |render_proc, name|\n proc{ @sinatra_call.erb(name, @options, &render_proc) }\n end\n top_render_proc.call\n end", "title": "" }, { "docid": "d541319096e3c64710d0faee8a5dc758", "score": "0.55203474", "text": "def render_template(path)\n render(path)\n exit\n end", "title": "" }, { "docid": "cb7ffad1d1016f3b2533a894c0ecb954", "score": "0.550507", "text": "def find_template(views, name, engine, &block)\n paths = views.map { |d| Sinarey.root + '/app/views/' + d }\n Array(paths).each { |v| super(v, name, engine, &block) }\n end", "title": "" }, { "docid": "d79f90267423a4be928025f88d3998f1", "score": "0.54979134", "text": "def erb(template) render template end", "title": "" }, { "docid": "87c1030de65b4e4eb27bf4201f87d694", "score": "0.5497747", "text": "def create_view_templates\n unless @check_migration\n template 'views/images.html.erb', File.join(file_path, \"_images.html.erb\")\n template 'views/image.html.erb', File.join(file_path, \"_image.html.erb\")\n template 'views/images_field.html.erb', File.join(file_path, \"_images_field_#{@chunk}.html.erb\")\n else\n unless File.exists?(\"#{file_path}/_images_field_#{@chunk}.html.erb\")\n template 'views/images_field.html.erb', File.join(file_path, \"_images_field_#{@chunk}.html.erb\")\n end\n end\n end", "title": "" }, { "docid": "f82c179c7ac3fe8fe5b6a67db0ca0302", "score": "0.5496231", "text": "def templates_for(file); end", "title": "" }, { "docid": "c32dceb92cf54d6c5cb1c1d97226c345", "score": "0.54925686", "text": "def render_erb_files(files, binding: nil, remove_extension: true)\n files.each do |file|\n rendered_file = remove_extension ? file.sub_ext(\"\") : file\n template = file.read\n rendered = ERB.new(template, trim_mode: \"-\").result(binding)\n file.rename rendered_file # keep same file permissions\n rendered_file.write(rendered)\n end\n end", "title": "" }, { "docid": "5c473623a4f4c527b28faa34fc8d2aff", "score": "0.54472405", "text": "def files_for_erb\n return Dir.chdir( base ) { Dir.glob( '*.erb' ) }\n end", "title": "" }, { "docid": "777d9c20f1c66126ffc6cf277616c3b2", "score": "0.5429651", "text": "def template_files\n Pathname.glob(staged_root.join(\"**\", \"*.erb\")).select(&:file?)\n end", "title": "" }, { "docid": "3eabd0abc6a444818a75358f3c6def63", "score": "0.5421471", "text": "def find_template(name)\n \n # Search in theme path\n template_path = Themes::ThemeManager.instance.selected_theme.resource_path(\"#{name}.erb\",'template','ui') \n \n # Search in the project\n if not template_path\n path = app.get_path(name) #File.expand_path(File.join(File.dirname(__FILE__), '..', 'views', \"#{name}-fieldset-render.erb\")) \n template_path = path if File.exist?(path)\n end\n \n template_path\n \n end", "title": "" }, { "docid": "0719f1b985ef4feb896d21c57543728d", "score": "0.54159707", "text": "def compile_templates(production)\n dir = File.join(@proj_dir, @dynamic_folder)\n \n Dir[File.join(dir, '**/*')].each do |path|\n if File.file?(path) && !File.basename(path).match(/^(\\.|_)/)\n path = path[ (dir.size + 1)..-1 ]\n ext = File.extname(path)\n new_ext = ext_from_handler(ext) \n name = File.basename(path, ext)\n \n if production == true && \"#{name}.#{new_ext}\" != 'index.html' && new_ext == 'html'\n new_file = File.join(@output_folder, path.sub(/(\\/?[\\w-]+)\\.[\\w-]+$/, \"\\\\1/index.#{new_ext}\"))\n else\n new_file = File.join(@output_folder, path.sub(/\\.[\\w-]+$/, \".#{new_ext}\")) \n end\n \n create_dirs(new_file)\n File.open(new_file, 'w') {|f| f.write render(path) }\n puts \" - \\033[32mCreating\\033[0m '#{new_file}'\"\n end\n end\n end", "title": "" }, { "docid": "a6419570234fdd3c6c5358dab9ebe1a6", "score": "0.5415759", "text": "def render_template(template_name, locals={})\n parse_file_as_erb(\"#{Rails.root}/lib/tasks/templates/#{template_name}.erb\", locals)\nend", "title": "" }, { "docid": "510346443d56caad3706a127a89949ae", "score": "0.54143864", "text": "def template_for(file); end", "title": "" }, { "docid": "f1405e944e1ddcb11533edf555f9bcff", "score": "0.5385571", "text": "def render file_name\n template_file = @template_dir + file_name\n\n template = template_for template_file, false, RDoc::ERBPartial\n\n template.filename = template_file.to_s\n\n template.result @context\n end", "title": "" }, { "docid": "166cd8f9c4023e5f055997cb72adb80e", "score": "0.53787994", "text": "def load_erb(erb)\n # @tmpl = ERB.new(erb)\n @tmpl = ERB.new(erb,0,\"<>\")\n end", "title": "" }, { "docid": "fad137511fb5bcce540a53b54df4eea1", "score": "0.5376539", "text": "def process\n return @template if @template\n\n out = StringIO.new\n err = StringIO.new\n\n files = Dir.glob(File.join(@path, '*.{yml,yaml}'))\n cfoo = Cfoo::Factory.new(out, err).cfoo\n\n Dir.chdir('/') do\n cfoo.process(*files)\n end\n\n raise(TemplateYamlParseError, err.string) unless err.string.empty?\n\n @template = out.string\n @template\n end", "title": "" }, { "docid": "61c6ba1081bb475169167a44bf88077c", "score": "0.5361265", "text": "def render_cfi_library_template(templatePath, outputPath)\n\n # Read each of the library components\n cfi_config = File.read('src/epub_cfi/cfi_config.js')\n cfi_parser = File.read('src/epub_cfi/epubcfi.js')\n cfi_interpreter = File.read('src/epub_cfi/cfi_instructions.js')\n cfi_instructions = File.read('src/epub_cfi/cfi_interpreter.js')\n runtime_errors = File.read('src/epub_cfi/runtime_errors.js')\n\n template = File.read(templatePath)\n erb = ERB.new(template)\n \n # Generate library\n File.open(outputPath, \"w\") do |f|\n f.puts erb.result(binding)\n end\nend", "title": "" }, { "docid": "c8322097c3872489e7e0b1d83f78ed5b", "score": "0.53585404", "text": "def scan_templates\r\n @templates = Dir.glob(File.join(path, \"*\")).inject([]) do |list, file_path|\r\n log.debug \"Checking if #{file_path} is a recognised template file.\"\r\n if File.file?(file_path)\r\n file_name = File.basename(file_path)\r\n log.debug \"#{file_path} is a template file.\" if !(Tilt[file_name]).nil?\r\n list << file_path if !(Tilt[file_name]).nil?\r\n end\r\n list\r\n end\r\n end", "title": "" }, { "docid": "80b6feb58c218bb6f77357eaa6048f31", "score": "0.53547484", "text": "def render_cfi_library_template(templatePath, outputPath)\n\n # Read each of the library components\n cfi_parser = File.read('src/epub_cfi/epubcfi.js')\n cfi_interpreter = File.read('src/epub_cfi/cfi_instructions.js')\n cfi_instructions = File.read('src/epub_cfi/cfi_interpreter.js')\n cfi_generator = File.read('src/epub_cfi/cfi_generator.js')\n runtime_errors = File.read('src/epub_cfi/runtime_errors.js')\n\n template = File.read(templatePath)\n erb = ERB.new(template)\n \n # Generate library\n File.open(outputPath, \"w\") do |f|\n f.puts erb.result(binding)\n end\nend", "title": "" }, { "docid": "ea4b6d8b22816345de18a3e75f46f783", "score": "0.5349181", "text": "def render_erb(fname)\n ERB.new(\n File.read(\"src/#{fname}.erb\")\n ).result(binding)\nend", "title": "" }, { "docid": "5c8df213319596d76c535e2f311ddc3f", "score": "0.53261214", "text": "def all_template_files\n files = super\n files + Dir.glob(\"#{JenkinsJob.flavor_dir}/templates/**.xml.erb\")\n end", "title": "" }, { "docid": "5c8df213319596d76c535e2f311ddc3f", "score": "0.53261214", "text": "def all_template_files\n files = super\n files + Dir.glob(\"#{JenkinsJob.flavor_dir}/templates/**.xml.erb\")\n end", "title": "" }, { "docid": "00ea8a3027d541f833450478b496d8a4", "score": "0.53222334", "text": "def renderOutput(request, response, session, propertyLoader, xmlFileToRender, theme)\n @mySession = session\n @myPropertyLoader = propertyLoader\n @myTheme = theme\n rendererConfig = YAML.load_file( \"#{GlobalSettings.getGlobal(\"Server-ConfigPath\")}OutputRenderers/JSON_XMLRenderer.yaml\")\n cWorkArea = GlobalSettings.getCurrentWorkArea(session)\n docDataDir = GlobalSettings.getDocumentDataDirectory\n @FS = File::SEPARATOR\n xmlFileToRender = xmlFileToRender[0..xmlFileToRender.rindex(\".\")]+\"xml\" if xmlFileToRender.end_with? \".admin\"\n #puts \"\\n\\n----------------------------FileToRender: #{xmlFileToRender}--------------------\\n\\n\"\n file = \"#{cWorkArea}#{xmlFileToRender}\"\n file = GlobalSettings.changeFilePathToMatchSystem(file)\n fcms = nil\n myPage = nil\n if File.exists? file\n fcms = FileCMS.new(session, file, false)\n myPage = Page.new(fcms, -1, session, file)\n #puts \"\\n\\n-------------\\n\\nLoaded Page: #{myPage.title}\\n\\n---------------------------------------\"\n else\n fcms = FileCMS.new(session, file, true)\n end\n #puts \"Theme is: #{theme}\"\n themeTmp = request[\"template\"]\n templateDir = \"#{cWorkArea}#{@FS}system#{@FS}templates#{@FS}#{theme}\"\n\n puts \"TemplateDir exists? #{templateDir} -- #{File.exist?(templateDir)}\"\n if(!File.exist?(templateDir) && request[\"template\"] == nil)\n theme = \"default\"\n templateDir = \"#{cWorkArea}#{@FS}system#{@FS}templates#{@FS}#{theme}\"\n end\n\n version = -1\n if(request[\"version\"] != nil)\n version = request[\"version\"].to_i\n end\n\n # TO-DO: Implement Template system then this....\n\n myTemplate = JSONTemplate.new(templateDir, request[\"file_contents\"], myPage)\n myTemplate.setRenderer(self)\n #myTemplate.setHTMLRenderer(self)\n pageContent = myTemplate.getParsedTemplate\n pageModuleContent = \"\"\n if myTemplate.hasModuleTemplates\n\n\n file_contents = request[\"file_contents\"][:blocks]\n #puts \"HELLOOOOOO :::::: #{file_contents}\"\n file_contents.each{ |key|\n #puts \"Request :::::: #{key}\"\n if key.is_a? Array\n #modType = key[:type]\n at = 0\n modId = nil\n key.each{ |nkey|\n\n if at == 0\n modId = nkey\n at = at.next\n #puts \"Module ID::::: #{modId}\"\n elsif nkey.is_a? Hash\n\n modType = nkey[\"type\"]\n #puts \"\\n\\nNext module type: #{modType}\\n\\n\"\n if myTemplate.containsModuleTemplate(modType)\n\n #TO-DO: process needs to be implemented to support templates in modules....\n modTemplate = myTemplate.getModuleTemplate(modType)\n puts \"#{modType} :::: Data:::: #{nkey[\"data\"]}\"\n modParameters = nkey[\"data\"]\n modParameters[\"id\"] = \"#{modId}\"\n modParameters[\"visible\"] = \"true\"\n modParameters[\"descriptive_name\"] = \"#{modType.capitalize} module\"\n puts \"\\n\\nModule Parameters: #{modParameters}\\n\\n\"\n modTemplate.setModuleData(modParameters)\n #puts \"------------------>Processing module template: #{modType} :: #{modTemplate}\"\n #modTemplate.setModuleToRender(mod)\n pageModuleContent.concat(\"<module>\")\n pageModuleContent.concat(modTemplate.parseTemplate)\n pageModuleContent.concat(\"</module>\")\n #puts \"\\n\\n\\n#{pageModuleContent}\\n\\n\\n\"\n else\n pageModuleContent.concat(\"\\\"unsupported\\\": \\\"Module not supported:#{modType}\\\"\")\n end\n end\n }\n end\n }\n end\n #puts \"Test....\"\n pageContent = Parser.replaceAll(pageContent, \"*CONTENT*\", pageModuleContent)\n pageContent = Hub.applyFilters(request, response, session, pageContent)\n\n myFile = fcms.getFileForWrite# { |file|\n myFile.write( pageContent )\n myFile.close\n return \"{\\\"success\\\": \\\"Writing to #{fcms.getFileURL} success\\\"}\"\n\n end", "title": "" }, { "docid": "0b3b9d6dc565e4f7d77ed93dc87cff0c", "score": "0.53193766", "text": "def template_for file, page = true, klass = ERB\n template = @template_cache[file]\n\n return template if template\n\n if page then\n template = assemble_template file\n erbout = 'io'\n else\n template = file.read\n template = template.encode @options.encoding\n\n file_var = File.basename(file).sub(/\\..*/, '')\n\n erbout = \"_erbout_#{file_var}\"\n end\n\n if RUBY_VERSION >= '2.6'\n template = klass.new template, trim_mode: '-', eoutvar: erbout\n else\n template = klass.new template, nil, '-', erbout\n end\n @template_cache[file] = template\n template\n end", "title": "" }, { "docid": "4ffafca38e510f39d16d411ff17be5ef", "score": "0.5318182", "text": "def expand_template_files\n rails_host = config['bind-address'] || `hostname`.chomp\n rails_port = config['port-number'].to_s\n rails_url = \"http://#{rails_host}:#{rails_port}\"\n Dir[File.join(install_directory,'installer','*.template')].each do |template_file|\n output_file = template_file.gsub(/\\.template/,'')\n next if File.exists?(output_file) # don't overwrite files\n\n message \"expanding #{File.basename(output_file)} template\"\n \n text = File.read(template_file).gsub(/\\$RAILS_URL/,rails_url).gsub(/\\$RAILS_HOST/,rails_host).gsub(/\\$RAILS_PORT/,rails_port)\n \n File.open(output_file,'w') do |f|\n f.write text\n end\n end\n end", "title": "" }, { "docid": "b765a4e50a320960c22200bf8f9490a9", "score": "0.5308501", "text": "def evaluate_template(template_name,bind)\n template_dir = File.expand_path('./scripts',File.dirname(__FILE__))\n template = File.read(File.expand_path(\"./#{template_name}\",template_dir))\n ERB.new(template, nil, '-').result(bind)\nend", "title": "" }, { "docid": "b765a4e50a320960c22200bf8f9490a9", "score": "0.5308501", "text": "def evaluate_template(template_name,bind)\n template_dir = File.expand_path('./scripts',File.dirname(__FILE__))\n template = File.read(File.expand_path(\"./#{template_name}\",template_dir))\n ERB.new(template, nil, '-').result(bind)\nend", "title": "" }, { "docid": "80f5881f283a63e954462b6f528c145e", "score": "0.53009075", "text": "def erbFileHandler(src)\n # try to copy file to the project directory\n dest = getFileDest(src)\n raise \"File \" + src + \"does not belong to the template\" if dest == nil\n\n if dest =~ /.erb$/ then dest = dest[0..dest.length-5] end\n\n cmdline = ''\n\n # set environment variables if possible\n @templateSubst.each do |subst|\n if subst[0].class == 'String' && subst[0] =~ /[A-Za-z_]/ &&\n subst[1] =~ /[^']/\n cmdline += subst[0] + '=\\'' + subst[1] + '\\' '\n end\n end\n\n cmdline += 'eruby -Mf \\'' + src + '\\' >\\'' + substString(dest) + '\\''\n\n puts '-- ERuby'\n puts 'Source: ' + src\n puts 'Command: ' + cmdline\n exec(cmdline) if fork() == nil\n\n # return true to stop further processing\n return true\n end", "title": "" }, { "docid": "caf4bb03fe048733af84c4cb0aeb1187", "score": "0.5299429", "text": "def evaluate_erb; end", "title": "" }, { "docid": "b45068c4827ab5ed6197d892bb2581d8", "score": "0.52939814", "text": "def populate_from_cartridge(cartridge_name)\n return nil if exists?\n\n FileUtils.mkpath(PathUtils.join(@container.container_dir, 'git'))\n\n locations = [\n PathUtils.join(@container.container_dir, cartridge_name, 'template'),\n PathUtils.join(@container.container_dir, cartridge_name, 'template.git'),\n PathUtils.join(@container.container_dir, cartridge_name, 'usr', 'template'),\n PathUtils.join(@container.container_dir, cartridge_name, 'usr', 'template.git'),\n ]\n\n template = locations.find {|l| File.directory?(l)}\n\n if @container.cartridge_model.standalone_web_proxy? and @container.gear_registry.entries[:web]\n remote_web_gear = @container.gear_registry.entries[:web].values.first\n\n unless remote_web_gear\n raise RuntimeError.new(\"Can't find a remote web gear for solo web proxy gear #{@container.uuid}\")\n end\n\n ssh_url = \"#{remote_web_gear.uuid}@#{remote_web_gear.proxy_hostname}\"\n\n gear_env = ::OpenShift::Runtime::Utils::Environ::for_gear(@container.container_dir)\n\n out, err, rc = @container.run_in_container_context(\"mkdir -p #{locations.first} ; rsync -rOvS --exclude '.git' --delete --rsh=/usr/bin/oo-ssh #{ssh_url}:git/template/ #{locations.first}\",\n env: gear_env,\n chdir: @container.container_dir,\n expected_exitstatus: 0)\n\n template = locations.find {|l| File.directory?(l)}\n end\n\n logger.debug(\"Using '#{template}' to populate git repository for #{@container.uuid}\")\n return nil unless template\n\n # expose variables for ERB processing\n @application_name = @container.application_name\n @cartridge_name = cartridge_name\n\n if template.end_with? '.git'\n FileUtils.cp_r(template, @path, preserve: true)\n else\n build_bare(template)\n end\n\n configure\n template\n end", "title": "" }, { "docid": "60cc17028b9e73fcaa171497dff0c878", "score": "0.5281153", "text": "def initialize(template_text,options={})\n @renderer_extension_modules=[]\n\n @name=options[:template_name]\n @templates_root_dir= options[:templates_directory]# || \"#{::Rails.root.to_s}/app/views\"\n\n @output_buffer=\"\"\n #unique tag for escaping post and pre processing tags\n @ltag=\"!@@@##$$1212\"\n @rtag=\"!723465hjf3!@#\"\n\n @default_language=options[:default_language] || \"en\"\n\n\n @escape_tags= options[:tags_to_escape] || []\n @runtime_tags= options[:runtime_tags] || []\n\n\n #escape blocks that will be run at view time\n @template_text=template_text.clone\n @escape_tags.each do |etag|\n escape_tag_content( etag,@template_text)\n\n \n end\n\n# raise \"need templates directory\" unless options[:templates_directory]\n\n #escape all normal dynamic blocks for preprocessing\n @template_text=@template_text.gsub(\"<%\",@ltag).gsub(\"%>\",@rtag).gsub(\"<$\",\"<%\").gsub(\"$>\",\"%>\")\n \n #turn the setup block into a proc <## ##> into executable blocks\n @template_text=@template_text.gsub(\"<##\",\"<% set_setup_proc{ \").gsub(\"##>\",\"} %>\")\n\n #turn the key block into a proc <## ##> into executable blocks\n @template_text=@template_text.gsub(\"<!!KEY\",\"<% set_key_proc{ \").gsub(\"!!KEY>\",\"} %>\")\n\n\n @raw_template=compile(@template_text)\n #this hold variations of the template after it has been localized\n #into different languages, but before rendering\n @localized_templates={}\n @setup_proc=nil\n @key_proc=nil\n @render_base=options[:render_base]\n @template_name=options[:template_name]\n #this tag will be used to create non cachable dynamic blocks\n\n\n if options.has_key?(:helpers) && options[:helpers]!=nil\n options[:helpers].each do |helper|\n include helper\n end\n end\n \n end", "title": "" }, { "docid": "3fcd5ac40cd3100238ee6383c56d4e07", "score": "0.5271696", "text": "def compile_rails_template(template_file_name)\n template_content = read_template_content(template_file_name)\n if template_file_name[/\\.hbs\\.erb\\z/]\n compiled_rails_template = ERB.new(template_content).result\n elsif template_file_name[/\\.hamlbars\\z/]\n stub = ''\n compiled_rails_template = Haml::Engine.new(template_content).render(stub)\n end\n compiled_rails_template\n end", "title": "" }, { "docid": "391427bb6d34321c8c6391cf462a5b50", "score": "0.52658397", "text": "def update_files(&block)\n \n get_template_entries.each do |entry|\n \n next if entry.directory?\n \n entry.get_input_stream do |is|\n \n data = is.sysread\n \n if CONTENT_FILES.include?(entry.name)\n process_entry(data, &block)\n end\n \n @output_stream.put_next_entry(entry.name)\n @output_stream.write data\n \n end\n end\n end", "title": "" }, { "docid": "bc04a222c41dc602e2a93332d5f482d4", "score": "0.5263441", "text": "def find_template(template_path, format = nil, html_fallback = true)\n super\n rescue ::ActionView::MissingTemplate\n find_parent_template(template_path, format)\n end", "title": "" }, { "docid": "f86952ff048db21f07426457233a1c71", "score": "0.52486926", "text": "def populate_from_cartridge(cartridge_name)\n return nil if exists?\n\n FileUtils.mkpath(File.join(@user.homedir, 'git'))\n\n cartridge_template = File.join(@user.homedir, cartridge_name, 'template')\n cartridge_template_git = File.join(@user.homedir, cartridge_name, 'template.git')\n\n have_template = (File.exist? cartridge_template or File.exist? cartridge_template_git)\n return nil unless have_template\n\n # TODO: Support tar balls etc...\n raise NotImplementedError.new(\n \"#{File.join(cartridge_name, 'template')}: files are not support for initializing a git repository\"\n ) if File.file? cartridge_template\n\n # expose variables for ERB processing\n @application_name = @user.app_name\n @cartridge_name = cartridge_name\n @user_homedir = @user.homedir\n\n # FIXME: See below\n @broker_host = OpenShift::Config.new.get('BROKER_HOST')\n\n case\n when File.exists?(cartridge_template)\n pull_directory(cartridge_template)\n when File.exist?(cartridge_template_git)\n pull_bare_repository(cartridge_template_git)\n end\n\n configure_repository\n end", "title": "" }, { "docid": "b2300a6e1764381b15b9391f091ca89e", "score": "0.5237475", "text": "def run\n # the safe_create_module_files will render every file under the templates/module_files\n # folder in your gem and copy them to the destination.\n safe_create_module_files(template_dir, module_path, context)\n # Should you need to change the file name of the copied file you will have to move\n # the file outside of the module_files directory and\n # render it using: safe_create_template_file(file_path, template, context)\n cleanup(module_path, context.plugin_name)\n end", "title": "" }, { "docid": "510b10a2ef87f97368d260fe082a33d1", "score": "0.523514", "text": "def find_template(views, name, engine, &block)\n I18n.fallbacks[I18n.locale].each { |locale|\n super(views, \"#{name}.#{locale}\", engine, &block) }\n super(views, name, engine, &block)\n end", "title": "" }, { "docid": "12ab588b1a7971ddef5b4a4b2cb44757", "score": "0.5234348", "text": "def fill_template\n @log.debug(\"Reading erb template from file: '#{@template}'.\")\n erb = ERB.new(File.read(@template), nil, '-')\n erb.filename = @template\n erb.result(binding)\n end", "title": "" }, { "docid": "a0d921adea920b98620cfb3c6b104053", "score": "0.5226747", "text": "def rendered_templates; end", "title": "" }, { "docid": "6bfce1b7a9ca805f7dabe676ace5df2c", "score": "0.52229816", "text": "def render_template(template, env)\n templates_dir = \"lib/search_engine/views\"\n template = \"#{template}.slim\" unless template.end_with? \".slim\"\n template_path = \"#{templates_dir}/#{template}\"\n content = File.read(template_path)\n Slim::Template.new { content }.render(env)\nend", "title": "" }, { "docid": "b3ffc1722f178bc20788b097f30a0a0e", "score": "0.5214564", "text": "def render_erb_template(template_path, options)\n require 'tilt'\n Tilt::ERBTemplate.new(template_path).render(nil, options)\n end", "title": "" }, { "docid": "cc334db0deb3f1134424eb75b0a715ec", "score": "0.52129245", "text": "def process_template name, src, type, called_from = nil, file_name = nil\n case type\n when :erb\n result = ErbTemplateProcessor.new(@tracker, name, called_from, file_name).process src\n when :haml\n result = HamlTemplateProcessor.new(@tracker, name, called_from, file_name).process src\n when :erubis\n result = ErubisTemplateProcessor.new(@tracker, name, called_from, file_name).process src\n when :slim\n result = SlimTemplateProcessor.new(@tracker, name, called_from, file_name).process src\n else\n abort \"Unknown template type: #{type} (#{name})\"\n end\n\n # Each template which is rendered is stored separately\n # with a new name.\n if called_from\n name = (\"#{name}.#{called_from}\").to_sym\n end\n\n @tracker.templates[name].src = result\n @tracker.templates[name].type = type\n end", "title": "" }, { "docid": "8a2bc5f30ac5a386eba7c3d63089005c", "score": "0.5197513", "text": "def render(template_name)\n controller_name = self.class.to_s.underscore\n\n string = File.read(\"./views/#{controller_name}/#{template_name}.html.erb\")\n #\"./\" for project root dir\n\n template = ERB.new(string)\n capture = template.result(binding) #evaluate and bind\n\n render_content(capture, \"text/html\")\n end", "title": "" }, { "docid": "08cbb6deafbbe646c3c805839c9a0f5c", "score": "0.51937914", "text": "def render(template_name)\n template_content = File.read(template_path(template_name))\n template = ERB.new(template_content)\n response_body = template.result(get_binding)\n render_content(response_body, 'text/html')\n end", "title": "" }, { "docid": "93f8d390372e4355c0c14b0e6af2b649", "score": "0.5187366", "text": "def render_template(file_path)\n @current_file_stack.push(file_path)\n begin\n tilt_template(file_path)\n rescue StaticMatic::TemplateError => e\n raise e # re-raise inline errors\n rescue Exception => e\n raise StaticMatic::TemplateError.new(file_path, e)\n ensure\n @current_file_stack.pop\n end\n end", "title": "" }, { "docid": "ab098fe604d16c9139c4075069181980", "score": "0.5178397", "text": "def init_skeleton_files\n puts \"Site name is #{@site_name}\"\n \n puts \"Copying bootstrap files into site assets folder...\"\n\n img_folder = \"#{Caboose::site_assets_path}/#{@site_name_slug}/images\"\n `mkdir -p #{img_folder}` if !File.exists?(img_folder)\n icons_folder = \"#{Caboose::site_assets_path}/#{@site_name_slug}/images/icons\"\n `mkdir -p #{icons_folder}` if !File.exists?(icons_folder)\n fonts_folder = \"#{Caboose::site_assets_path}/#{@site_name_slug}/fonts\"\n `mkdir -p #{fonts_folder}` if !File.exists?(fonts_folder)\n\n str = `find #{Rails.root}/bootstrap -type file`\n x = \"#{Rails.root}/bootstrap\".length + 1\n str.strip.split(\"\\n\").each do |file|\n next if file.ends_with?('.DS_Store')\n next if !@store && (file.include?('product') || file.include?('search_results')) \n next if !@mls && file.include?('rets')\n\n file2 = \"#{Caboose::site_assets_path}/#{@site_name_slug}/#{file[x..-1]}\"\n file2 = file2.gsub('sitename',@site_name_slug)\n\n folder = File.dirname(file2) \n `mkdir -p #{folder}` if !File.exists?(folder)\n `cp #{file} #{file2}` if !File.exists?(file2)\n \n next if !['.erb', '.css', '.js', '.scss'].include?(File.extname(file)) \n \n f = File.open(file2, 'rb')\n str = f.read\n f.close\n if !@store\n str.gsub!('@import \"|SITE_SLUG|/css/pages/products\";','')\n str.gsub!('@import \"|SITE_SLUG|/css/pages/product_details\";','')\n str.gsub!('@import \"|SITE_SLUG|/css/pages/product_index\";','')\n str.gsub!('//= require |SITE_SLUG|/js/products','')\n end\n if !@mls\n str.gsub!('@import \"|SITE_SLUG|/css/pages/rets\";','')\n str.gsub!('@import \"|SITE_SLUG|/css/pages/rets_residential_details\";','')\n str.gsub!('@import \"|SITE_SLUG|/css/pages/rets_residential_index\";','')\n str.gsub!(\"//= require |SITE_SLUG|/js/functions_rets\",\"\")\n str.gsub!(\"//= require photoswipe\",\"\")\n str.gsub!(\"//= require photoswipe_ui\",\"\")\n str.gsub!(\" *= require photoswipe\",\"\")\n str.gsub!(\" *= require photoswipe_skin\",\"\")\n str.gsub!(\"_skin\",\"\")\n str.gsub!(\"_ui\",\"\")\n end\n str.gsub!(\"|SITE_SLUG|\",@site_name_slug)\n str.gsub!(\"|SITE_NAME|\",@site_name) \n File.open(file2, 'w') { |f| f.write(str) } \n end\n \n puts \"Moving block files out of site assets folder...\" \n if !File.exists?(\"#{Rails.root}/app/views/caboose/blocks/#{@site_name_slug}\")\n `mv #{Caboose::site_assets_path}/#{@site_name_slug}/blocks #{Rails.root}/app/views/caboose/blocks/#{@site_name_slug}`\n else\n `rm -rf #{Caboose::site_assets_path}/#{@site_name_slug}/blocks` \n end\n \n #Find.find(skeleton_root).each do |file| \n # next if File.directory?(file)\n # next if !@store && (file.include?('product') || file.include?('search_results'))\n # next if !@mls && file.include?('rets')\n # next if file.include?(\".DS_Store\")\n # file2 = file.gsub(skeleton_root, '').gsub(\"sitename\",@site_name_slug)\n # file2 = \"#{Caboose::site_assets_path}/#{@site_name_slug}/#{file2}\"\n #\n # FileUtils.cp(file, file2)\n # \n # #Replace any variables\n # if File.extname(file2) == \".erb\" || File.extname(file2) == \".css\" || File.extname(file2) == \".js\" || File.extname(file2) == \".scss\"\n # f = File.open(file2, 'rb')\n # str = f.read\n # f.close\n # if !@store\n # str.gsub!('@import \"|SITE_SLUG|/css/pages/products\";','')\n # str.gsub!('@import \"|SITE_SLUG|/css/pages/product_details\";','')\n # str.gsub!('@import \"|SITE_SLUG|/css/pages/product_index\";','')\n # str.gsub!('//= require |SITE_SLUG|/js/products','')\n # end\n # if !@mls\n # str.gsub!('@import \"|SITE_SLUG|/css/pages/rets\";','')\n # str.gsub!('@import \"|SITE_SLUG|/css/pages/rets_residential_details\";','')\n # str.gsub!('@import \"|SITE_SLUG|/css/pages/rets_residential_index\";','')\n # str.gsub!(\"//= require |SITE_SLUG|/js/functions_rets\",\"\")\n # str.gsub!(\"//= require photoswipe\",\"\")\n # str.gsub!(\"//= require photoswipe_ui\",\"\")\n # str.gsub!(\" *= require photoswipe\",\"\")\n # str.gsub!(\" *= require photoswipe_skin\",\"\")\n # str.gsub!(\"_skin\",\"\")\n # str.gsub!(\"_ui\",\"\")\n # end\n # str.gsub!(\"|SITE_SLUG|\",@site_name_slug)\n # str.gsub!(\"|SITE_NAME|\",@site_name)\n # #str.gsub!(\"|HOME_PAGE_ID|\",@home_page_id.to_s)\n # File.open(file2, 'w') { |f| f.write(str) }\n # end \n #end\n \n end", "title": "" }, { "docid": "df5d83cf507d6d461e02d5e78b4a0d28", "score": "0.51689005", "text": "def renderOutput( request, response, session, properties, xmlFileToRender, theme, baseDocRoot,\n baseDocRootInclude, onlyModules)\n @mySession = session\n @myRequest = request\n @myResponse = response\n @myPropertyLoader = properties\n @baseDocRoot = baseDocRoot\n @baseDocRootInclude = baseDocRootInclude\n @myTheme = theme\n\n cWorkArea = GlobalSettings.getCurrentWorkArea(session)\n #docDataDir = GlobalSettings.getDocumentDataDirectory\n @FS = File::SEPARATOR\n tmp = properties.getProperties(\"redirect\")\n myPage = FileCMS.new(session, \"#{cWorkArea}#{@FS}#{xmlFileToRender}\")\n\n #puts \"Theme is: #{theme}\"\n themeTmp = request[\"template\"]\n templateDir = \"#{cWorkArea}#{@FS}system#{@FS}templates#{@FS}#{theme}\"\n\n #puts \"TemplateDir exists? #{templateDir} -- #{File.exist?(templateDir)}\"\n if(!File.exist?(templateDir) && request[\"template\"] == nil)\n theme = \"default\"\n templateDir = \"#{cWorkArea}#{@FS}system#{@FS}templates#{@FS}#{theme}\"\n end\n\n version = -1\n if(request[\"version\"] != nil)\n version = request[\"version\"].to_i\n end\n page = Page.new(myPage, version, session, myPage.getFileURL)\n\n\n # TO-DO: Implement Template system then this....\n myTemplate = Template.new(templateDir, page)\n myTemplate.setRenderer(self)\n #puts \"AdditionalParams :: #{@extraParams}\"\n myTemplate.setAdditionalParameters(@extraParams)\n #myTemplate.setHTMLRenderer(self)\n if(!onlyModules)\n pageContent = myTemplate.getParsedTemplate\n #puts \"PageContent : #{pageContent}\"\n else\n pageContent = \"\"\n end\n\n if myTemplate.hasModuleTemplates\n\n #//TODO: process page, each module, one at a time.... Need to supply each with the correct module ID.\n pageModuleContent = \"\"\n mods = page.getAllPageModules\n #puts \"Mod count : #{mods.size}\"\n mods.each{ |mod|\n\n modType = mod.getModuleType\n if myTemplate.containsModuleTemplate(modType)\n #TO-DO: process needs to be implemented to support templates in modules....\n modTemplate = myTemplate.getModuleTemplate(modType)\n modTemplate.setModuleToRender(mod)\n pageModuleContent.concat(modTemplate.parseTemplate)\n else\n pageModuleContent.concat(\"<br>Module not supported:#{modType}<br>\")\n end\n\n }\n end\n #puts \"About to process #{@extraParams}\"\n\n\n #processExtraParameters(pageModuleContent)\n if(!onlyModules)\n pageContent = Parser.replaceAll(pageContent, \"*CONTENT*\", pageModuleContent)\n else\n pageContent = pageModuleContent\n end\n\n return pageContent\n end", "title": "" }, { "docid": "9ad8273f92c310c88e960057313c6d2e", "score": "0.51560986", "text": "def render(pathname)\n @partial_templates ||= {}\n ::ERB.new(File.read(pathname)).result(binding)\n end", "title": "" }, { "docid": "5f8d13e694e8fb4b1c30cf3fe62e4b30", "score": "0.5153115", "text": "def process_template(template_name,map)\r\n template = File.dirname(__FILE__) + \"/../templates/#{template_name}.st\"\r\n map['timestamp']=Time.now.httpdate\r\n File.open(template,'r') do | f | \r\n # detect words inside dollar sign pairs\r\n replaced = f.read.gsub(/(\\$\\w*\\$)/) do | match |\r\n key = match[1..match.size-2]\r\n (map.has_key? key) ? map[key] : 'MISSING:'+key\r\n end \r\n return replaced\r\n end # file\r\n end", "title": "" }, { "docid": "aac6566d28f67cd230771a42d6ea2d63", "score": "0.515089", "text": "def hook_add_templates\n @flavor.class.before_add_templates do |templates, resource_action|\n if :create == resource_action && fail_on_clobber\n templates.each do |template|\n if File.exist?(destination_path(template))\n fail \"tried to overwrite file #{template}; pass '-a clobber' to override\"\n end\n end\n end\n end\n end", "title": "" }, { "docid": "c520a36cede5cee34ba9a4580566624e", "score": "0.5139249", "text": "def template_files\n generator_job_templates_path = File.join(self.class.source_root, \"jobs/%job_name%_#{purpose}\")\n directory \"jobs/%job_name%_#{purpose}\", \"jobs/#{job_name}\"\n\n # build a hash of { 'bin/webapp_ctl.erb' => 'bin/webapp_ctl', ...} used in spec\n @template_files = {}\n FileUtils.chdir(File.join(generator_job_templates_path, \"templates\")) do\n `ls */*`.split(\"\\n\").each do |template_file|\n # clean up thor name convention\n template_file.gsub!(\"%job_name%\", job_name)\n template_file.gsub!(\".tt\", \"\")\n # strip erb from target file\n target_template_file = template_file.gsub(/.erb/, '')\n\n @template_files[template_file] = target_template_file\n end\n end\n end", "title": "" }, { "docid": "0b300377473bc9a8882ea5384184fc87", "score": "0.5130423", "text": "def render_erb(template_path, params) \n view = ActionView::Base.new(ActionController::Base.view_paths, {}) \n \n class << view \n include ApplicationHelper, FeeCalcsHelper\n end \n \n view.render(:file => \"#{template_path}.html.erb\", :locals => params) \n end", "title": "" }, { "docid": "6ec4a69b85e2becbaf108ddcb80e6491", "score": "0.51302344", "text": "def process_cartridges(cartridge_dir = nil) # : yields cartridge_path\n unless cartridge_dir.nil?\n cart_dir = File.join(@user.homedir, cartridge_dir)\n yield cart_dir if File.exist?(cart_dir)\n return\n end\n\n Dir[PathUtils.join(@user.homedir, \"*\")].each do |cart_dir|\n next if cart_dir.end_with?('app-root') || cart_dir.end_with?('git') ||\n (not File.directory? cart_dir)\n yield cart_dir\n end\n end", "title": "" }, { "docid": "309724a01d5a328fb871bbc99fc0987f", "score": "0.5117939", "text": "def is_erb?(file)\n /\\.erb\\z/.match?(file)\n end", "title": "" }, { "docid": "c91ebbb289b998c31c44ba4f432cf5ca", "score": "0.51129025", "text": "def load_templates\n templates = {}\n file = __FILE__\n\n begin\n io = ::IO.respond_to?(:binread) ? ::IO.binread(file) : ::IO.read(file)\n app, data = io.gsub(\"\\r\\n\", \"\\n\").split(/^__END__$/, 2)\n rescue Errno::ENOENT\n app, data = nil\n end\n\n if data\n lines = app.count(\"\\n\") + 1\n template = nil\n data.each_line do |line|\n lines += 1\n if line =~ /^@@\\s*(.*\\S)\\s*$/\n template = ''\n templates[$1.to_sym] = template\n elsif template\n template << line\n end\n end\n end\n\n templates\nend", "title": "" }, { "docid": "64e660828a8d5f988260245ab4ab7e49", "score": "0.5104218", "text": "def render(template_name)\n body_string = ''\n File.open(\"./app/views/#{controller_name}/#{template_name}.html.erb\", 'r') do |f|\n f.each_line do |line|\n body_string += line\n end\n end\n\n content = ERB.new(body_string).result(binding)\n render_content(content, 'text/html')\n end", "title": "" }, { "docid": "d7e56a55608b8277b5026908305b28f5", "score": "0.50943655", "text": "def extract_templates(&block)\n stack_template_extractor(nested_stacks(:with_resource, :with_name), &block)\n end", "title": "" }, { "docid": "8663cc64c203494904011baca895fdd2", "score": "0.5084279", "text": "def render_template template_file, out_file = nil # :yield: io\n io_output = out_file && !@dry_run && @file_output\n erb_klass = io_output ? RDoc::ERBIO : ERB\n\n template = template_for template_file, true, erb_klass\n\n if io_output then\n debug_msg \"Outputting to %s\" % [out_file.expand_path]\n\n out_file.dirname.mkpath\n out_file.open 'w', 0644 do |io|\n io.set_encoding @options.encoding\n\n @context = yield io\n\n template_result template, @context, template_file\n end\n else\n @context = yield nil\n\n output = template_result template, @context, template_file\n\n debug_msg \" would have written %d characters to %s\" % [\n output.length, out_file.expand_path\n ] if @dry_run\n\n output\n end\n end", "title": "" }, { "docid": "2f5146ee155b581b79af6f07fe212c8d", "score": "0.5083061", "text": "def render(template_name, view_handler, locals, &content)\n self.kramdown_source.render(template_name)\n end", "title": "" }, { "docid": "1e9b5cb40779f6a1faba35f26d5712ee", "score": "0.50764817", "text": "def call (template)\n handler = ActionView::Template.registered_template_handler(\"erb\")\n handler.call(template)\n end", "title": "" }, { "docid": "1658951e3449e5272eb080c73112921b", "score": "0.5076055", "text": "def render(context = Erubis::Context.new)\n # Read template data\n template_filename = \"#{@template}.rhtml\"\n begin\n template = File.read(template_filename)\n rescue Errno::ENOENT\n raise ScriptError.new(\"Template #{template_filename} does not exist!\")\n end\n\n # Prepare template and variables\n eruby = Erubis::Eruby.new template\n \n # Perform templating\n begin\n result = eruby.evaluate context\n rescue\n raise TemplateError.new(\"Encountered error processing template #{template_filename}.\", $!)\n end\n\n # Output result\n output result \n end", "title": "" }, { "docid": "7782f1a8a98524200b1a1b1c99d01751", "score": "0.5065634", "text": "def before_filter_check_on_hash(hsh, nm)\n if hsh.has_key?(:content)\n cont = hsh.delete(:content)\n temp_file = \"#{base_dir}/templates/default/#{nm}.erb\"\n ::FileUtils.mkdir_p(::File.dirname(temp_file)) unless ::File.directory? temp_file\n ::File.open(temp_file, \"w+\") {|f| f.print cont }\n hsh.merge!({:source => \"#{nm}.erb\"})\n end\n # \n hsh.delete(:require) if hsh.has_key?(:require)\n hsh\n end", "title": "" }, { "docid": "493dbe9ec4aded0f1ad7ee99f0425266", "score": "0.5065609", "text": "def render_erb_template(filename)\n template = File.read(filename)\n result = ERB.new(template).result(binding)\n end", "title": "" }, { "docid": "28af5a02aea1b2530c35af6da60fe6a6", "score": "0.5065408", "text": "def render_template(opts={})\n template_file_path = @bootstrap_template_path || File.expand_path(TEMPLATE_PATH, __FILE__)\n template_file = File.read(template_file_path)\n erb_template = ERB.new(template_file)\n last_bootstrap_line = LAST_BOOTSTRAP_LINE\n generated_template = erb_template.result(binding)\n @log.debug \"generated template is #{generated_template}\"\n return generated_template\n end", "title": "" }, { "docid": "9fbd1c331bd263ba2e25d82ada68f109", "score": "0.5062333", "text": "def apply_template_before?; end", "title": "" }, { "docid": "f6bb8bd4dd3d681951eb724d8c47b70f", "score": "0.5054027", "text": "def recurseTemplate(templateDir,targetDir)\n\n if not Dir.exists?(targetDir)\n puts \"Create Dir: #{targetDir}\"\n FileUtils.mkpath(targetDir)\n end\n \n Dir.foreach(templateDir) do |filename|\n\n sourceName=File.join(templateDir,filename)\n targetName=File.join(targetDir,filename)\n\n # Skip over . and ..\n if ( filename !='.' && filename != '..')\n\n case File.ftype(sourceName)\n\n when 'directory'\n recurseTemplate( sourceName, targetName) # Recurse to process a subdirectory\n\n when 'file'\n if not File.exists?(targetName)\n renderFile( sourceName, targetName )\n end\n\n else # This is not a file or dir so dia a horrible death\n ui.fatal \"Cannot process #{File.ftype(sourceName)}: #{sourceName}\"\n end # of case\n end # if not . or ..\n end # of for each\n end", "title": "" }, { "docid": "d6c60368058b3bc2d08b5ca58b9d86e2", "score": "0.50536495", "text": "def render_and_write_templates\n clean_build_dir()\n\n yard_file_hash = {}\n\n Dir.glob(\"#{Dir.pwd}/projects/*\").select { |f| File.directory? f }.each do|project_dir|\n yard_file = \"#{project_dir}/yard.yaml\"\n\n unless yard_file.empty?\n yard = YAML::load_file(yard_file)\n next if yard['disabled']\n\n apps = yard['apps']\n project_name = yard['project']['name']\n project_pipelines = yard['pipelines']\n\n Dir.mkdir \"#{BUILD_DIR}/#{project_name}\"\n puts project_name\n\n apps.each do |app_name, app_config|\n Dir.mkdir(\"#{BUILD_DIR}/#{project_name}/#{app_name}/\")\n app_pipelines = Hash.new({})\n\n project_pipelines.each do |pipeline|\n app_pipelines[pipeline['name']] = app_pipelines[pipeline['name']].merge(pipeline)\n end\n\n unless app_config.nil? || app_config['pipelines'].nil?\n app_config['pipelines'].each do |pipeline|\n app_pipelines[pipeline['name']] = app_pipelines[pipeline['name']].merge(pipeline)\n end\n end\n\n # puts app_pipelines\n\n base_files = Dir[\"#{Dir.pwd}/base/*\"]\n project_base_files = Dir[\"#{project_dir}/base/*\"]\n app_files = Dir[\"#{project_dir}/#{app_name}/*\"]\n\n app_pipelines.each do|pipeline_name, pipeline_config|\n template_name = pipeline_config['templateName'] ? pipeline_config['templateName'] : \"#{pipeline_name}.json\"\n\n app_files.each do|path|\n render_and_write(\n pipeline_config: pipeline_config,\n path: path,\n template_name: template_name,\n app_name: app_name,\n project_name: project_name,\n app_template_vars: app_config['template_vars']\n )\n end\n project_base_files.each do|path|\n render_and_write(\n pipeline_config: pipeline_config,\n path: path,\n template_name: template_name,\n app_name: app_name,\n project_name: project_name,\n app_template_vars: app_config['template_vars']\n )\n end\n\n base_files.each do|path|\n render_and_write(\n pipeline_config: pipeline_config,\n path: path,\n template_name: template_name,\n app_name: app_name,\n project_name: project_name,\n app_template_vars: app_config['template_vars']\n )\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "1c6d734c3a0a51d3361c1f2b9625bed0", "score": "0.5051991", "text": "def allow_erb?\n ComfortableMexicanSofa.config.allow_erb\n end", "title": "" }, { "docid": "107051ec797d974b85317fae5b5c079e", "score": "0.5041984", "text": "def erb_file(erb_path, context = {})\n erb(IO.read(erb_path))\n end", "title": "" }, { "docid": "eff7098a415dc6d21eee0cd5758b0860", "score": "0.503967", "text": "def find(name_or_path=nil)\n name_or_path ||= MB::Application.config.bootstrap.default_template\n return unless name_or_path\n installed = MB::FileSystem.templates.join(\"#{name_or_path}.erb\").to_s\n if File.exists?(installed)\n return installed\n end\n if File.exists?(name_or_path)\n return name_or_path\n else\n raise MB::BootstrapTemplateNotFound\n end\n end", "title": "" }, { "docid": "1880d85c7d812d511124ef4d9c5e97fc", "score": "0.50391585", "text": "def render(template_name)\n controller_name = self.class.to_s.gsub(/Controller$/, '').underscore\n base_template = ERB.new File.read(\"app/views/layouts/application.html.erb\")\n page_template = ERB.new File.read(\"app/views/#{controller_name}/#{template_name}.html.erb\")\n page = page_template.result(call_binding)\n content = base_template.result(call_binding { page })\n render_content(content, \"text/html\")\n end", "title": "" }, { "docid": "71206d4ce6ecfef290cf70bb52343f66", "score": "0.5031325", "text": "def load_template(template)\n begin\n template = File.join(File.dirname(__FILE__), \"/recipes/#{template}\")\n code = open(template).read\n in_root { self.instance_eval(code) }\n rescue LoadError, Errno::ENOENT => e\n raise \"The template [#{template}] could not be loaded. Error: #{e}\"\n end\nend", "title": "" }, { "docid": "96b1e64de7bb3f7cfadb9f34580be978", "score": "0.50307", "text": "def render(template_name)\n controller_name = self.class.name.underscore\n dir_path = File.dirname(__FILE__)\n\n file_path = File.join(dir_path, \"..\", 'views', controller_name, \"#{template_name}.html.erb\")\n file_content = File.read(file_path)\n\n template = ERB.new(file_content)\n render_content(template.result(binding), 'text/html')\n end", "title": "" }, { "docid": "79fe67344f694f6676c6041ef47c60e1", "score": "0.5028089", "text": "def render_yaml_templates(templates_yaml)\n log(\"Rendering YAML Templates\")\n templates = Dir[templates_yaml]\n # Render each yaml template out to a yaml file\n templates.each do | template |\n log(\"Rendering YAML template: #{template}\")\n file_name = template.split('/').last.split('.erb')[0]\n\n template \"#{node['jmxtrans']['config_dir']}/yaml/#{file_name}\" do\n source template\n owner node['jmxtrans']['user']\n group node['jmxtrans']['user']\n mode \"0755\"\n local true\n variables({\n :graphite_host => node['jmxtrans']['graphite']['host'],\n :graphite_port => node['jmxtrans']['graphite']['port'] \n })\n action :nothing\n end.run_action(:create)\n end\nend", "title": "" }, { "docid": "2e08ca39d6175480881f91bde68b8942", "score": "0.5010217", "text": "def render_erb_template(filename)\n template = File.read(filename)\n result = ERB.new(template).result(binding)\n end", "title": "" }, { "docid": "2e08ca39d6175480881f91bde68b8942", "score": "0.5010217", "text": "def render_erb_template(filename)\n template = File.read(filename)\n result = ERB.new(template).result(binding)\n end", "title": "" }, { "docid": "af7e200a55f74436346af935ea3e6a4c", "score": "0.50089", "text": "def templates\n file_list '{templates,puppet}/**/*.{erb,epp}'\n end", "title": "" } ]
eedd9619727101e652186e5b66c4d40d
Gets project role by its name
[ { "docid": "99305e01aca834371984b0b8981152f3", "score": "0.0", "text": "def get_role_by_title(role_title, role_list = roles)\n role_list.each do |role|\n return role if role.title.downcase == role_title.downcase\n end\n nil\n end", "title": "" } ]
[ { "docid": "94ab53967846c90d7ffd01497799a20f", "score": "0.7427956", "text": "def get_role(name)\n role_mapper = get_data_file(data_dir, 'role_mappings.yaml')\n unless File.exists?(role_mapper)\n raise(Exception, \"Role mapping file: #{role_mapper} should exist\")\n end\n role_mappings = YAML.load_file(role_mapper)\n split_name = name.split('.')\n split_name.size.times do |x|\n cur_name = split_name[0..(split_name.size-x-1)].join('.')\n role = role_mappings[cur_name]\n if role\n Puppet.debug(\"Found role from role mappings: #{role}\")\n return role\n end\n end\n Puppet.debug(\"Did not find role mapping for #{name}\")\n return nil\n end", "title": "" }, { "docid": "1b8c720dfcb9cb4843a4f82fac6e90a7", "score": "0.73415637", "text": "def role_get(name)\n request.handle(:auth, 'role_get', [name])\n end", "title": "" }, { "docid": "e549da3765bddaa769bfcf71c40ffc76", "score": "0.7279599", "text": "def get_role( role_name=nil )\n\n raise AccessChecker::EmptyRoles if role_objects.empty?\n\n if role_name.nil?\n role_objects.first\n else\n role_objects.where( :name => role_name.to_s ).first\n end\n\n end", "title": "" }, { "docid": "b06b8ccb1c4ebaee4c492df9c4900a38", "score": "0.7228294", "text": "def get_role(service_name, name, cluster_name = 'default')\n _get_role(_get_role_path(cluster_name, service_name, name))\n end", "title": "" }, { "docid": "9c623ad7a85206625d36701d148be1e2", "score": "0.7192773", "text": "def getRole(name, role)\n\t\tif @moderators.include?(name)\n\t\t\trole = \"Mod\"\n\t\telsif @keynote.include?(name)\n\t\t\trole = \"Keynote\"\n\t\tend\n\n\t\t@roles[role]\n\tend", "title": "" }, { "docid": "6ad41b1de92f653cf75291fe77b9bd6c", "score": "0.7189484", "text": "def role\n r=roles.first\n return r.nil? ? nil : r.name\n end", "title": "" }, { "docid": "976eb00fdce981418d955e3b6d9e090b", "score": "0.7169903", "text": "def find_role(name)\n Discordrb::Role.from_argument(proc {}, name, self)\n end", "title": "" }, { "docid": "d53dd03d94a54af79682ff2d27cc7ec2", "score": "0.7151436", "text": "def fetch_role(name, options = {})\n matched = fetch_roles(name, options)\n return matched.first if matched\n nil\n end", "title": "" }, { "docid": "c81bd394a5c6372df6a2696fc61cd82d", "score": "0.71166235", "text": "def role(name)\n if (retval = @roles[name])\n retval\n else\n raise ArgumentError, \"Requested role #{name.inspect} is not defined, available roles: #{@roles.keys}.\"\n end\n end", "title": "" }, { "docid": "c81bd394a5c6372df6a2696fc61cd82d", "score": "0.71166235", "text": "def role(name)\n if (retval = @roles[name])\n retval\n else\n raise ArgumentError, \"Requested role #{name.inspect} is not defined, available roles: #{@roles.keys}.\"\n end\n end", "title": "" }, { "docid": "900bfd84ed54b9dba64b2711c0ea3123", "score": "0.71046335", "text": "def role_for_user(user)\n user.roles.where(:project_id => self.id).first.try(:print_role)\n end", "title": "" }, { "docid": "95083aafb9c3b3b0d9eae5924bd4d0a4", "score": "0.7100963", "text": "def get_role(name)\n role = @iam_resource.role(name)\n puts(\"Got data for role '#{role.name}'. Its ARN is '#{role.arn}'.\")\n rescue Aws::Errors::ServiceError => e\n puts(\"Couldn't get data for role '#{name}' Here's why:\")\n puts(\"\\t#{e.code}: #{e.message}\")\n raise\n else\n role\n end", "title": "" }, { "docid": "96adbc2fb887a073ecab192c1ea39920", "score": "0.70466506", "text": "def find(role_name)\n\t\t\treturn nil if role_name.blank?\n\t\t\trole = roles[role_name.to_sym]\n\t\t\tunless role\n\t\t\t\traise RoleNotFound, \"Role with name #{role_name} could not be found: Roles = #{roles.inspect}\"\n\t\t\tend\n\t\t\trole\n\t\tend", "title": "" }, { "docid": "0bb28045a9a9b58cf53f27b6b8c2bd03", "score": "0.70289576", "text": "def role_for(role_name)\n @roles.each do |role|\n if role.role_type.role_name == role_name.gsub(/\\b\\w/){$&.upcase}\n return role\n end\n end\n # None of the roles matched the role type, so return nil\n return nil\n end", "title": "" }, { "docid": "4f408feea99641bdab45ecf92ce1c9aa", "score": "0.70190734", "text": "def role\n roles.first.name.to_sym if roles.present?\n end", "title": "" }, { "docid": "2da578f141207579bf92267e9eac9abf", "score": "0.70050555", "text": "def role_const(name)\n if role_const_defined?(name)\n const_get(name)\n end\n end", "title": "" }, { "docid": "230713ce1bec261c08b5133bb968da3b", "score": "0.7000783", "text": "def get_role(role_name)\n request(\n 'Action' => 'GetRole',\n 'RoleName' => role_name,\n :parser => Fog::Parsers::AWS::IAM::SingleRole.new\n )\n end", "title": "" }, { "docid": "4c97131d98e234afee32176dbbb6c833", "score": "0.69125146", "text": "def role_get(name, timeout: nil)\n @conn.handle(:auth, 'role_get', [name, timeout: timeout])\n end", "title": "" }, { "docid": "2bd6568c2449ba580d9bef080ff0907b", "score": "0.6859751", "text": "def role_name\n User::ROLES.find{ |rol| rol[:id] == self.role }[:name] if User::ROLES.any? { |rol| rol[:id] == self.role }\n end", "title": "" }, { "docid": "dd47fd34ddf2c520ee5fc44d3747f006", "score": "0.6848016", "text": "def team_role\n TEAM_ROLE[role]\n end", "title": "" }, { "docid": "c04826f3f7591c1a6afca389272a1861", "score": "0.68238634", "text": "def role\n roles.first\n end", "title": "" }, { "docid": "c04826f3f7591c1a6afca389272a1861", "score": "0.68238634", "text": "def role\n roles.first\n end", "title": "" }, { "docid": "c04826f3f7591c1a6afca389272a1861", "score": "0.68238634", "text": "def role\n roles.first\n end", "title": "" }, { "docid": "c22d57be8a5541624f7f79b3f37e5d3d", "score": "0.68044275", "text": "def getRole\r\n\t\t\t\t\treturn @role\r\n\t\t\t\tend", "title": "" }, { "docid": "c22d57be8a5541624f7f79b3f37e5d3d", "score": "0.68044275", "text": "def getRole\r\n\t\t\t\t\treturn @role\r\n\t\t\t\tend", "title": "" }, { "docid": "c22d57be8a5541624f7f79b3f37e5d3d", "score": "0.68044275", "text": "def getRole\r\n\t\t\t\t\treturn @role\r\n\t\t\t\tend", "title": "" }, { "docid": "6a539e62a32f166281802e8cfd058ddc", "score": "0.68002164", "text": "def find_role(role_name)\n\t\t\treturn nil if role_name.blank?\n\t\t\trole = roles[role_name.to_s.downcase.to_sym]\n\t\t\tunless role\n\t\t\t\traise RoleNotFound, \"Role with name #{role_name} could not be found in Roles: #{roles.inspect}\"\n\t\t\tend\n\t\t\trole\n\t\tend", "title": "" }, { "docid": "0973e43094644ccdc1125679ed5f11e2", "score": "0.67879975", "text": "def role\n return Role.find(:first, :conditions => {:id => (RolesPerson.find(:first, :conditions => {:person_id => self.id})).role_id}).name\n end", "title": "" }, { "docid": "d042671c495251ab934fcd5662f0f41f", "score": "0.6760715", "text": "def get_role_for(certname)\n role = node_roles.find { |k,v| v.include?(certname) }\n role[0] if role\n end", "title": "" }, { "docid": "c0dae085dbcf27ccfb7373fb6a335442", "score": "0.67396164", "text": "def role\n first_role = self.roles.first unless self.roles.nil?\n if (first_role.nil?)\n return \"(none)\"\n else\n return first_role.name\n end\n end", "title": "" }, { "docid": "2883d3d82e48b08fe807d51ef5382166", "score": "0.67384374", "text": "def get_role(service_id, role_name)\n response = request(:get, \"/service/#{service_id}\")\n JSON.parse(response, :symbolize_names => true)[:DOCUMENT][:TEMPLATE][:BODY][:roles].each { |role| return role if role[:name] == role_name }\n fail \"#{role_name} doesn't seem to exist!\"\n end", "title": "" }, { "docid": "daa3ddd4484a04f30b7d98015041fe4e", "score": "0.6729027", "text": "def role role_name\n run_list << \"role[#{role_name}]\"\n self.instance_eval(&@@role_implications[role_name]) if @@role_implications[role_name]\n end", "title": "" }, { "docid": "daa3ddd4484a04f30b7d98015041fe4e", "score": "0.6729027", "text": "def role role_name\n run_list << \"role[#{role_name}]\"\n self.instance_eval(&@@role_implications[role_name]) if @@role_implications[role_name]\n end", "title": "" }, { "docid": "ae738ca16f8ddc094dde26b7165deb8a", "score": "0.6705493", "text": "def get_role(id)\n @client.raw('get', \"/config/roles/#{id}\")\n end", "title": "" }, { "docid": "d8aade97e49abb22454fbdc22c833944", "score": "0.6680667", "text": "def get_role(id)\n return @client.raw(\"get\", \"/config/roles/#{id}\")\n end", "title": "" }, { "docid": "2fc67f63a0cb9026b3d9ba9a7a107a95", "score": "0.6641308", "text": "def role\n ROLES.detect { |role| self.has_role?(role) }\n end", "title": "" }, { "docid": "a06ebeb9690203b9ebb7ce8e2f51d332", "score": "0.66303617", "text": "def show_role\n role=current_user.projects.find(params[:project_id]).get_role(current_user.id);\n render response:{role:role}\n end", "title": "" }, { "docid": "141e870e74a43562a9102d8fe2981464", "score": "0.66256243", "text": "def roleName\n case role\n when 1\n return \"Admin\"\n when 2\n return \"Editor\"\n when 3 \n return \"Viewer\"\n end\n end", "title": "" }, { "docid": "940df3d6e6be12f2b854bccaf2faf9b3", "score": "0.6615531", "text": "def role_in_project(project)\n if project.scrum_master == self\n return :scrum_master\n elsif project.product_owner == self\n return :product_owner\n elsif project.team_member_ids.include?(self.id.to_s)\n return :team_member\n elsif\n project.stakeholder_ids.include?(self.id.to_s)\n return :stakeholder\n end\n nil\n end", "title": "" }, { "docid": "631176c9e2a7b8c00491270d178fa7fc", "score": "0.65657246", "text": "def get_role(r)\n value = roles[r.to_s] || roles[r.to_sym]\n value.nil? ? nil : value.to_s\n end", "title": "" }, { "docid": "565147b04ffe7ab0c4a2645c0ddd34f4", "score": "0.656318", "text": "def role\n @role\n end", "title": "" }, { "docid": "565147b04ffe7ab0c4a2645c0ddd34f4", "score": "0.656318", "text": "def role\n @role\n end", "title": "" }, { "docid": "565147b04ffe7ab0c4a2645c0ddd34f4", "score": "0.65628654", "text": "def role\n @role\n end", "title": "" }, { "docid": "593fde85de018d0635f48badf24bc00e", "score": "0.6542967", "text": "def show\n @user_role = current_user.role.name\n return @user_role\n end", "title": "" }, { "docid": "a43490ca34811e0118226bd5066c8e1b", "score": "0.6535074", "text": "def role role_name\n run_list << \"role[#{role_name}]\"\n run_list.uniq!\n self.instance_eval(&@@role_implications[role_name]) if @@role_implications[role_name]\n end", "title": "" }, { "docid": "b476296169399b86d0140c213f22f2c3", "score": "0.653453", "text": "def role\n return @role\n end", "title": "" }, { "docid": "b476296169399b86d0140c213f22f2c3", "score": "0.653453", "text": "def role\n return @role\n end", "title": "" }, { "docid": "b476296169399b86d0140c213f22f2c3", "score": "0.653453", "text": "def role\n return @role\n end", "title": "" }, { "docid": "b476296169399b86d0140c213f22f2c3", "score": "0.653453", "text": "def role\n return @role\n end", "title": "" }, { "docid": "2395b2a7e142e40baf30cc39d75da1bd", "score": "0.6521955", "text": "def role_of(user)\n record = TeamMember.where(team: self, user: user).first\n record.present? ? record.role.name : 'none'\n end", "title": "" }, { "docid": "4bc759fbec0b65f1c75c207dc531f6ef", "score": "0.65202755", "text": "def role\n\t\tr = Role.find(@user.role_id)\n\t\treturn r\n\tend", "title": "" }, { "docid": "b1cbbd7ca21787be2255fe507ee92acb", "score": "0.6494797", "text": "def role\n @role\n end", "title": "" }, { "docid": "1a5a928c94355f8e75ad5dad9fb7349d", "score": "0.6489785", "text": "def find_role role\n raise ArgumentError, \"Must be a role label\" if !role.kind_of_label?\n role_model.where(:name => role.to_s)\n end", "title": "" }, { "docid": "35bf5ad3b519f2e6ed10a95dc1f41d81", "score": "0.64885575", "text": "def current_role\n self.class.roles[role]\n end", "title": "" }, { "docid": "41f7f1c3c816517874003123f3268b59", "score": "0.64874786", "text": "def get_role\n @role = Role.find(@user.role_id)\n end", "title": "" }, { "docid": "9f9552656e5dfb25601f1984394a355b", "score": "0.64745605", "text": "def get_agent_role(agent_role_name)\n @agent_roles[agent_role_name]\n end", "title": "" }, { "docid": "049dd5f0523b0a25d008bad4c3451366", "score": "0.6467789", "text": "def fetch_role(name, included_by)\n raise NotImplementedError\n end", "title": "" }, { "docid": "7e90656e380e008c8dede794144ccea0", "score": "0.6456533", "text": "def role\n read_attribute(:role).to_sym\n end", "title": "" }, { "docid": "5f5330f47e3d24ce5914de263ba9a4f3", "score": "0.6443968", "text": "def role\n the_role = self.read_attribute(:role)\n if the_role \n the_role.to_sym\n else\n nil\n end\n end", "title": "" }, { "docid": "ab4f35a41f59fa6a0046102eecc4edf7", "score": "0.64119285", "text": "def role\n return @params ? @params[\"role\"] : @api_permission.role\n end", "title": "" }, { "docid": "60d2633faf5d15d412bd8e32678b4349", "score": "0.6399507", "text": "def get_role(user)\n list = members.where(:user_id => user.id)\n if list.size == 0\n nil\n else\n list.first.role.downcase\n end\n end", "title": "" }, { "docid": "145c301a08ad6e86ca1061acb21784e3", "score": "0.6385283", "text": "def roles\n url = \"/gdc/projects/#{pid}/roles\"\n tmp = GoodData.get(url)\n tmp['projectRoles']['roles'].map do |role_url|\n json = GoodData.get role_url\n GoodData::ProjectRole.new(json)\n end\n end", "title": "" }, { "docid": "7348ef978d9bd92f3c2dd3e0ad016fa1", "score": "0.6368364", "text": "def current_role\n self.roles[0].to_string\n end", "title": "" }, { "docid": "39f8b7336ace85673fa6ec87c6b416af", "score": "0.6365806", "text": "def role(id)\n @roles.find { |e| e.id == id }\n end", "title": "" }, { "docid": "bba7fa7fcefcec3656e33031c756bbf9", "score": "0.6362394", "text": "def role_call\n @role = Role.find(current_user.role_id)\n return \"#{@role.name}\"\n end", "title": "" }, { "docid": "257efd053fa2483723ef44d8d29d6736", "score": "0.6361823", "text": "def current_role\n self.roles[0].toString\n end", "title": "" }, { "docid": "5e5d348b6ffb8299deb86235dbfeb28b", "score": "0.63578373", "text": "def role\n self[:role].to_sym\n end", "title": "" }, { "docid": "4b48925cecdfe41765b75ec631b56721", "score": "0.6342619", "text": "def translated_role\n I18n.t( role, :scope => :roles )\n end", "title": "" }, { "docid": "8bc593b028dab704d185b29160cdebd5", "score": "0.6337907", "text": "def get_role_by_identifier(role_name, role_list = roles)\n role_name = role_name.downcase.gsub(/role$/, '')\n role_list.each do |role|\n tmp_role_name = role.identifier.downcase.gsub(/role$/, '')\n return role if tmp_role_name == role_name\n end\n nil\n end", "title": "" }, { "docid": "8bc593b028dab704d185b29160cdebd5", "score": "0.6337907", "text": "def get_role_by_identifier(role_name, role_list = roles)\n role_name = role_name.downcase.gsub(/role$/, '')\n role_list.each do |role|\n tmp_role_name = role.identifier.downcase.gsub(/role$/, '')\n return role if tmp_role_name == role_name\n end\n nil\n end", "title": "" }, { "docid": "192e7e18c65404aecb960926e21ef89a", "score": "0.6306533", "text": "def role\n return \"webmaster\" if webmaster?\n return \"employer\" if employer?\n return \"job_seeker\" if job_seeker?\n return \"group_manager\" if group_manager?\n end", "title": "" }, { "docid": "56e8743b0fedc6813996dea7e3226d18", "score": "0.62986636", "text": "def role\n user.role\n end", "title": "" }, { "docid": "ca2a78b12d3bbc4cf10902798f18c009", "score": "0.62780213", "text": "def role\n @instance['role']\n end", "title": "" }, { "docid": "00b51cf320a1c567ef0a26bd9293bd08", "score": "0.62703145", "text": "def get_project(name)\n @projects[name]\n end", "title": "" }, { "docid": "238c5b4f048027f98db782170e7256d4", "score": "0.6258628", "text": "def has_role?(role_name, project = nil)\n return true if self.admin?\n @_user_role_names ||= self.roles(:projects => project).collect(&:name)\n @_user_role_names.include?(role_name.to_s)\n end", "title": "" }, { "docid": "377fd0256f08cd6c25bf05360757c6f9", "score": "0.62561685", "text": "def role\n @params ? @params[:role] : @api_permission.role\n end", "title": "" }, { "docid": "e407fa90b4fb58d4cba03505708c209f", "score": "0.62543935", "text": "def roles_for_project(project)\n roles = []\n # No role on archived projects\n return roles if project.nil? || project.archived?\n if logged?\n # Find project membership\n membership = membership(project)\n if membership\n roles = membership.roles\n else\n @role_non_member ||= Role.non_member\n roles << @role_non_member\n end\n else\n @role_anonymous ||= Role.anonymous\n roles << @role_anonymous\n end\n roles\n end", "title": "" }, { "docid": "b6fa2496805c0b63dbc5f1222d827c95", "score": "0.62501854", "text": "def role(id)\n id = id.resolve_id\n @roles.find { |e| e.id == id }\n end", "title": "" }, { "docid": "b6fa2496805c0b63dbc5f1222d827c95", "score": "0.62501854", "text": "def role(id)\n id = id.resolve_id\n @roles.find { |e| e.id == id }\n end", "title": "" }, { "docid": "f4d2501fec6db33d772bdfbf927b5f56", "score": "0.6225698", "text": "def role\n template.dig('Metadata', 'Role')\n end", "title": "" }, { "docid": "9888aedce93e04d9a066cca66861d4da", "score": "0.62222546", "text": "def get_role\n str = \"\"; #return value\n str = GlobalConstants::TOURNAMENT_ROLES_STR[self.role].to_s.humanize.capitalize;\n return str;\n end", "title": "" }, { "docid": "7bfc720cab6c1038eaefce60a8fa354c", "score": "0.61799675", "text": "def recipe_from_role(name)\n role = Chef::Search::Query.new.search(:role, \"name:#{name}\")[0][0]\n if role.nil?\n fail \"Search for #{name} failed. Has the role been created?\"\n end\n\n run_list = role.env_run_list[chef_environment]\n run_list.select { |rli| rli.type == :recipe }.map(&:name)\n end", "title": "" }, { "docid": "36a0581c78537a2d5d849f0a9cb4333c", "score": "0.61699283", "text": "def role(user)\n UsersGroup.find_by(user_id: user.id, group_id: id, accepted: true)&.role&.to_sym\n end", "title": "" }, { "docid": "4e101a1f09337f279f710556fa355e2f", "score": "0.61661667", "text": "def role(type)\n ENUM[:roles].each {|role| return role if role[:name].downcase.to_sym == type }\n end", "title": "" }, { "docid": "110a45090a0d50fe098db8b9eca5851b", "score": "0.616231", "text": "def role\n Employee.find(self.employee_id).role\n end", "title": "" }, { "docid": "77d3cce45770e9dac35616d629511b48", "score": "0.6160288", "text": "def roleText\n User::ROLE[self.role]\n end", "title": "" }, { "docid": "19c252946f789471c56157ed93e010f2", "score": "0.6155833", "text": "def role\n @roles.find { |r| r!='DEFAULT' }\n end", "title": "" }, { "docid": "6fb8d08b0bffe213eb526b64c8d0d4cf", "score": "0.6155534", "text": "def show(id)\n response = request(:get, \"/roles/#{id}.json\")\n response[\"role\"]\n end", "title": "" }, { "docid": "bea6445243b5b0c919994318229e7cf8", "score": "0.6142514", "text": "def get_project(name)\n params = {\n 'command' => 'listProjects',\n\t'listall' => true\n }\n\n json = send_request(params)\n projects = json['project']\n return nil unless projects\n\n projects.each { |n|\n if name.is_uuid? then\n return n if n['id'] == name\n else\n return n if n['name'] == name\n end\n }\n nil\n end", "title": "" }, { "docid": "54ff0e69173f0901783ce341edbe0adf", "score": "0.61357105", "text": "def has_role?(name)\n role.name.downcase == name.to_s\n end", "title": "" }, { "docid": "1081bf71caadc293efa8ffdd56bf4d76", "score": "0.61296934", "text": "def role?(name)\n case name\n when :guest\n guest?\n when :member\n member?\n else\n role.try(:name) == name.to_s\n end\n end", "title": "" }, { "docid": "59d2017f0eb665515a3ac77b0487391e", "score": "0.6127322", "text": "def current_role\n admin_user.role.to_sym\n end", "title": "" }, { "docid": "94225e524af71a012e0eabbed0e45a64", "score": "0.6126611", "text": "def has_role? name\n roles.pluck(:name).include?(name)\n end", "title": "" }, { "docid": "6ec7bff5920ba95025fc51f0888660fe", "score": "0.61221987", "text": "def currentActorRole\n if (Role.find_by_actor_id_and_project_id(actor.id, project.id)).nil?\n return \"none\"\n end\n return (RoleLevel.find((Role.find_by_actor_id_and_project_id(actor.id, project.id)).role_level_id)).name\n end", "title": "" }, { "docid": "42ed716f0c1fca962dda5d34efc399d6", "score": "0.6103138", "text": "def role(organization = nil)\n # Return cached version if available\n return self.read_attribute(:role) if !organization\n\n # Find in arrays if organizations have been fetched\n # already. Perform remote query otherwise\n org = begin\n if self.organizations.loaded?\n self.organizations.to_a.find { |e| e.id == organization.id }\n else\n self.organizations.where(id: organization.id).first\n end\n end\n\n org ? org.role : nil\n end", "title": "" }, { "docid": "b5aaffd041660b265df8265a0d436b57", "score": "0.6100334", "text": "def change_role?(project, word)\n project.roles.find_by_user_id(self.id).name != word\n end", "title": "" }, { "docid": "01e4f874539704ed5291ca0467786141", "score": "0.6100123", "text": "def role\n ::Installation::SystemRole.find(\"cc_role\")\n end", "title": "" }, { "docid": "918d5ddad759a0ad59711290442bea39", "score": "0.6089387", "text": "def get_role(instructor_name)\n get_instructors.each do |instructor|\n if instructor[:name] == instructor_name\n return instructor[:role]\n end\n end\nend", "title": "" }, { "docid": "efa683a9f10171f77af28372e219d38f", "score": "0.60871434", "text": "def return_partner_role\n PARTNER_ROLE[id]\n end", "title": "" }, { "docid": "5d8fe8095f060726c2757ec14d1addf3", "score": "0.6082387", "text": "def role\n if self.approved? then\n r = super\n else\n r = Role.find_by_name('client')\n end\n return r\n end", "title": "" }, { "docid": "0c7cfc886ee4b4481e7da4a1a61402df", "score": "0.60795194", "text": "def role_of(user)\n record = CommunityMember.where(community: self, user: user).first\n record.present? ? record.role.name : 'none'\n end", "title": "" } ]
532c8aae79cfa14b247515543ba589bd
Human representation of average seconds per `mark`.
[ { "docid": "81bcbdd81c22be45012b43f7de9366a4", "score": "0.6723039", "text": "def ha\n \"%0.2f second average\" % average\n rescue\n \"\"\n end", "title": "" } ]
[ { "docid": "b1071d17bd505b25ad2f3fdfff2922a5", "score": "0.6432494", "text": "def average_predict_time\n\t\treturn @timmer/Float(@predict_call_count)\n\tend", "title": "" }, { "docid": "7bfb24cf2dece84b74bf5b00eb9736df", "score": "0.6270333", "text": "def average_reading_time(content)\n words_per_minute = 250\n word_count = word_count content\n minutes = (word_count / Float(words_per_minute)).ceil\n unit = minutes == 1 ? 'minute' : 'minutes'\n\n \"#{minutes} #{unit}\"\n end", "title": "" }, { "docid": "bbccd8407804e355c9c71d69ce3597f6", "score": "0.61850464", "text": "def average_idling_time\n if self.total_duration > 0\n ((self.total_idling_time / self.total_duration) * 100)\n else\n 0\n end\n end", "title": "" }, { "docid": "04d6abb63591c654f5fce63c7cd54b3f", "score": "0.60926765", "text": "def average_usage\n\t\treturn 0.0 if @run_count.zero?\n\t\t(@total_utime + @total_stime) / @run_count.to_f\n\tend", "title": "" }, { "docid": "cdbdfddde99f7df5bf4dda392447c1db", "score": "0.5993535", "text": "def average_marking_time\n @average_marking_time ||=\n if valid_submissions.empty?\n nil\n else\n valid_submissions.sum { |s| s[:published_at] - s[:submitted_at] } / valid_submissions.size\n end\n end", "title": "" }, { "docid": "102f80acfd6e5c2ddda4fa2249eb39f7", "score": "0.5982398", "text": "def average_response_time\n return summary_average[:average_response_time]\n end", "title": "" }, { "docid": "0f7833db54bfb68039f8328d491af2b9", "score": "0.5978063", "text": "def average\n return @@average_times.inject(:+).to_f / @@average_times.size\n end", "title": "" }, { "docid": "a6b760145a5c767992583e1d883a2cfb", "score": "0.59541816", "text": "def time_as_human\n return Knj::Strings.secs_to_human_time_str(self.time_total, :secs => false)\n end", "title": "" }, { "docid": "06059393b1781034d19d24fbb3e3f93e", "score": "0.59349614", "text": "def humanize secs\n [\t\n \t[60, :seconds], \n \t[60, :minutes], \n \t[24, :hours], \n \t[365, :days], \n \t[100, :years]\n ].map do |count, name|\n if secs > 0\n secs, n = secs.divmod(count)\n \"#{n.to_i} #{name}\"\n end\n end.compact.reverse.join(' ')\nend", "title": "" }, { "docid": "3f5f70a00a53aa4094cdea741a47f558", "score": "0.5891812", "text": "def report\n puts \"Time taken: #{average}\"\n puts \"Messages per second: #{@messages_count / average}\" if @messages_count\n end", "title": "" }, { "docid": "fedbcd6391ddea779c1108d55d4578b0", "score": "0.58481985", "text": "def average_wait_time\n self.reviews.average(:wait_time).to_i\n end", "title": "" }, { "docid": "bdd6aea0968ecad0bd8caade0c65b27e", "score": "0.58349365", "text": "def format_measure(v)\n v\n end", "title": "" }, { "docid": "232217554bc21459d8ef2b6a7af3edcf", "score": "0.57848454", "text": "def time\n a=[1, 1000, 60000, 3600000]*2\n ms = duration\n \"%02d\" % (ms / a[3]).to_s << \":\" << \n \"%02d\" % (ms % a[3] / a[2]).to_s << \":\" << \n \"%02d\" % (ms % a[2] / a[1]).to_s #<< \".\" << \n #\"%03d\" % (ms % a[1]).to_s\n end", "title": "" }, { "docid": "97339d3a18dfed33aca59dabc20c7cc6", "score": "0.5769956", "text": "def heading\n \"{{%.2fms}}\" % self.class.times.values.inject(0.0) do |sum, obj|\n sum + obj\n end\n end", "title": "" }, { "docid": "7a37abb00e7ba8833606ad59f71d5502", "score": "0.57565176", "text": "def format_milis(miliseconds)\n return Time.at(miliseconds/1000).gmtime.strftime('%M:%S')\nend", "title": "" }, { "docid": "fd45a39d557e858f113df41863814df3", "score": "0.5722357", "text": "def play_time\n sum = 0\n @tracks.each {|n| sum += n.total_time}\n return Time.at(sum/1000.0).strftime('%R:%S')\n end", "title": "" }, { "docid": "dfbb83c7decebf7e6dcb70c7f94712a2", "score": "0.57174087", "text": "def in_ms(seconds)\n \"#{'%.2f' % (seconds * 1000).round(2)}ms\"\nend", "title": "" }, { "docid": "1c33c3941e9916a44da5a1d6679240ef", "score": "0.56958663", "text": "def exam_mar(subject, student, marks)\n exam = exam_data(subject)\n exam_score = exam.scores(student)\n return if exam.nil?\n marks.to_f + exam_score.marks.to_f\n end", "title": "" }, { "docid": "6498cce603742a6c5765e80b9bbccc0e", "score": "0.5682784", "text": "def to_s\n t = \"#{@numerator}/#{2**@denominator}\"\n m = @metronome_ticks.to_f / 24\n \"measure #{@measure_number} #{@start}-#{@end} #{t} #{m} qs metronome\"\n end", "title": "" }, { "docid": "76b3f7a2aa3776b60b430e9218d9368a", "score": "0.56823254", "text": "def mean_seek\n mean_value(:mean_seek)\n end", "title": "" }, { "docid": "80a89f262430757bbecc7932930ad614", "score": "0.5680343", "text": "def show_avg_time\n avg_times = []\n RACER_RECORDS.each {|racer| avg_times << [ racer.piloto, racer.avg_time_lap ]}\n @view.display_avg_times(avg_times)\n end", "title": "" }, { "docid": "599bc4c94fd37f5cf12d8c8ebc3c71e0", "score": "0.56773686", "text": "def avg_time_spent\n self.average(:time_spent)\n end", "title": "" }, { "docid": "89a1aa4050819c20b6069b4d07efc57d", "score": "0.5655545", "text": "def duration\n (Time.mktime(0)+(tracks.map(&:duration).inject(:+) || 0)).strftime(\"%H:%M:%S\")\n end", "title": "" }, { "docid": "48b75573db38b8c820d3eca68b45e8f5", "score": "0.56481856", "text": "def to_seconds\n AVERAGE_FACTOR * atom\n end", "title": "" }, { "docid": "48b75573db38b8c820d3eca68b45e8f5", "score": "0.56481856", "text": "def to_seconds\n AVERAGE_FACTOR * atom\n end", "title": "" }, { "docid": "b0ba8bc4c14146e4b22a7ded7fa810ca", "score": "0.5633969", "text": "def avg_notes(subject_item)\n notes = subject_item.subject_item_notes\n return '0.00' if notes.length == 0\n '%.02f' % (notes.inject(0) { |acc, n| acc + n.value } / notes.length.to_f)\n end", "title": "" }, { "docid": "b73beba1e0afeea62c86b09b70c6a830", "score": "0.5620946", "text": "def display_avg_times(avg_times)\n puts(\"Tempo Médio De Voltas:\")\n puts(\"---------------\")\n avg_times.each do |array|\n puts \"#{array[0]} - Tempo Médio: #{array[1].round(2)} minutos\"\n end\n puts(\"---------------\")\n end", "title": "" }, { "docid": "cef618212eef0a4cbe27c7d09d7a7fdb", "score": "0.5617653", "text": "def sec_fraction() time[3] end", "title": "" }, { "docid": "a9a5aced7ef8252883fb581dea387deb", "score": "0.5615519", "text": "def get_formatted_pause\n Timing.to_formatted_pause(pause)\n end", "title": "" }, { "docid": "1372dadd86c4281d8df194ccdf95dabd", "score": "0.5589103", "text": "def seconds\n _nudge[2]\n end", "title": "" }, { "docid": "2c554b69c64614496f4a085386d39579", "score": "0.55860335", "text": "def record_measure_elapsed(label)\n elapsed = Benchmark.realtime do\n yield\n end\n\n mins, secs = elapsed.abs.divmod(60)\n $logger.debug(\"#{label}: #{mins}m #{secs.to_i}s\")\nend", "title": "" }, { "docid": "e65548b1a7a247e38fa3b1d26311f9f2", "score": "0.558222", "text": "def agop secs, desc = nil\n return '-' unless secs\n\n [[60, :sec], [60, :min], [24, :hrs], [356, :days], [1000, :years]].map do |count, name|\n if secs > 0\n secs, n = secs.divmod(count)\n \"#{n.to_i}#{name}\"\n end\n end.compact.reverse.slice(0,2).join(' ')\n end", "title": "" }, { "docid": "0392dee19315e62693aa9460c3e186a7", "score": "0.5575778", "text": "def estimated_reading_time\n estimate = content.split(/\\s+/).length / AVERAGE_WPM\n \"#{estimate >= 1 ? estimate : '< 1'} min read\"\n end", "title": "" }, { "docid": "6e23e577fb89be00a08dd221fcd1113e", "score": "0.55710244", "text": "def total_time(caption_length)\n\tcount = 0\n\tunless @user_time.nil? \n\t\tcount += 1\n\tend\n\tunless @book_time.nil?\n\t\tcount += 1\n\tend\n\tunless @review_time.nil?\n\t\tcount += 1\n\tend\n\tif count.nil? || count == 0\n\t\tputs \"No time to show.\"\n\telse\n\t\tBenchmark.benchmark(CAPTION, caption_length, FORMAT, \"total:\", \"avg:\") do |x|\n\t\t\ttotal_time = [@user_time, @book_time, @review_time].compact.inject(&:+)\n\t\t\t[total_time, total_time / count]\n\t\tend\n\tend\nend", "title": "" }, { "docid": "57abe669398b7a1841d153366da5328f", "score": "0.5570795", "text": "def avg_time_spent\n\t\ttotal_time = self.visitors.inject(0){|sum,v| sum + v.total_time }.to_f\n\t\tavg_time = total_time/self.total_visits\n\tend", "title": "" }, { "docid": "726b7f1c474f9451e1c6b37fdad61a33", "score": "0.5557602", "text": "def results(marks)\n dict = {'h' => 0, 'a'=> 0, 'l'=> 0}\n\n list = [(marks.sum.to_f / marks.count).round(3)]\n dict['h'] = marks.select { |m| m == 9 || m == 10 }.count\n dict['a'] = marks.select { |m| m == 7 || m == 8 }.count\n dict['l'] = marks.select { |m| m.between?(1,6) }.count\n list << dict\n dict['a'] == 0 && dict['l'] == 0 ? list << \"They did well\" : list\nend", "title": "" }, { "docid": "f7fbc5fee3ac7ae212264f893765827e", "score": "0.5555919", "text": "def display_time_at\n gm = self.good_memories.count\n bm = self.bad_memories.count\n lifespan = (Time.now.to_i - self.created_at.to_i)\n unless gm == 0\n shift = (lifespan * (bm + 1)) / gm\n return (Time.now.to_i - shift)\n else\n shift = lifespan * (bm + 1)\n return (Time.now.to_i - shift)\n end\n end", "title": "" }, { "docid": "549de98d708b7d5c7182fca900fd77cc", "score": "0.5549743", "text": "def benchmark_summary_str(prefix, elapsed_ms)\n summary_time = Time.at(elapsed_ms / 1000).utc.strftime('%H:%M:%S')\n \"#{prefix} SUMMARY Elapsed: #{summary_time}\"\n end", "title": "" }, { "docid": "dbc61c3077633a4a4fa10dd92b14f8ea", "score": "0.5548278", "text": "def results(marks)\n # your code here\n avg = (marks.reduce(:+) / (marks.length).to_f).round(3)\n\n scores = {\n \"h\"=> 0,\n \"a\"=> 0,\n \"l\"=> 0\n }\n\n marks.each do |i|\n if i > 8\n scores[\"h\"] += 1\n elsif i == 7 || i == 8\n scores[\"a\"] += 1\n else \n scores[\"l\"] += 1\n end\n end\n if scores[\"a\"] == 0 && scores[\"l\"] == 0\n result = [avg, scores, 'They did well']\n else\n result = [avg, scores]\n end\n result\nend", "title": "" }, { "docid": "7410d0a72b281dfed5180a53a6801818", "score": "0.554451", "text": "def tv_sec() end", "title": "" }, { "docid": "d7e199c0e470929538d84c51957b6298", "score": "0.5521839", "text": "def display_time_diff(src_path)\n td = calc_time_diff(src_path)\n avg = td.inject{|sum,el| sum + el}.to_f / td.size\n\n td.each {|t| puts t}\n puts \"Size: #{td.size}\"\n puts \"Min: #{td.min}\"\n puts \"Max: #{td.max}\"\n puts \"Avg: #{avg.round}\" \nend", "title": "" }, { "docid": "be50871995705ea5d84c9d83d36b61d0", "score": "0.55203044", "text": "def avg_duration\n @avg_duration if @total > 0\n end", "title": "" }, { "docid": "98de77d20f3e302ab82edaac700ab9b3", "score": "0.55191725", "text": "def nanoseconds; end", "title": "" }, { "docid": "a68fee4854aa3d91645ed85227a284a7", "score": "0.55040693", "text": "def average_percentage_passed_float\n return self.data[\"average_percent_passed\"].to_f\n end", "title": "" }, { "docid": "6f019064f83b2e4b96c1b263086838db", "score": "0.5486072", "text": "def calculate_marks\n stream = Stream.find(stream_id)\n sub_maps = stream.sub_str_maps.all\n xuser = self.user\n xcategory = xuser.personal.category\n xacademic = xuser.academic\n tenth_mark = xacademic.tenth_marks\n user_subs = xacademic.subject_entries.all\n total_special_sub = sub_maps.count\n total = 0\n user_subs.each do |us|\n total += us.marks\n sub_maps.each do |sm|\n if us.subject_id == sm.subject_id\n total += us.marks\n end\n end\n end\n self.calculated_marks = total*10000 + tenth_mark\n end", "title": "" }, { "docid": "b3693dc7689299da7272f419615354de", "score": "0.5449993", "text": "def avg_time_lap\n times = []\n self.voltas.each { |lap_num, lap_stat| times << time_in_ms(lap_stat[:tempo])}\n return ms_to_min(get_avg(times))\n end", "title": "" }, { "docid": "b01ac66d8f7a1ff4557af501fa7a8158", "score": "0.54492116", "text": "def str_elapsed(t)\n seconds = Time.now.to_i - t\n return \"now\" if seconds <= 1\n\n length,label = time_lengths.select{|length,label| seconds >= length }.first\n units = seconds/length\n \"#{units} #{label}#{'s' if units > 1} ago\"\nend", "title": "" }, { "docid": "a29eb41658db88d66df0003ee4399971", "score": "0.54228085", "text": "def h # human\n \"%02d:%02d:%02d\" % [total/3600%24, total/60%60, total%60]\n end", "title": "" }, { "docid": "31c1ab65fc70a7757ebc37775ac66200", "score": "0.54219556", "text": "def calculate_article_read_time\n time = description.split(' ').length\n self.read_time = (time.to_f / 250).ceil.to_s\n end", "title": "" }, { "docid": "400c2db0741fba49e03ac3fdaa4f9581", "score": "0.54203457", "text": "def pretty_runtime\n return nil if total_time.nil?\n t = total_time / 1000\n minutes = t / 60\n seconds = t - 60 * minutes\n sprintf '%d:%02d', minutes, seconds\n end", "title": "" }, { "docid": "8014608170912e6dcdfe1945a15c07e8", "score": "0.54149795", "text": "def measure(heading)\n start_time = Time.now\n print heading\n result = yield\n end_time = Time.now - start_time\n puts \" (#{end_time} s)\"\n result\nend", "title": "" }, { "docid": "c3cf3f01db69e4aa0ea4b6739c3bf0c7", "score": "0.5383602", "text": "def getavg\r\n\t\tif @duration == 0\r\n\t\t\treturn 0\r\n\t\telse\r\n\t\t\treturn ((@miles_driven.to_f / @duration)*60)\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "d6e4fb6bdd49fc22cc29b751ad55f222", "score": "0.5382208", "text": "def read_time\n (number_of_words.to_f / WORDS_PER_MINUTE).ceil\n end", "title": "" }, { "docid": "af818bc8e196704a24d0bc748c1dccfa", "score": "0.53776103", "text": "def mpk\n kmh = self.kmh\n return nil unless kmh and kmh.is_a?(Float)\n div = 60.0 / kmh\n min = div.floor\n sec = ( ( div - min ) * 60.0 ).round \n \"#{ sprintf(\"%.2d\", min ) }:#{ sprintf(\"%.2d\", sec ) }\"\n end", "title": "" }, { "docid": "7b69ae0aa6847a6271a54822d2e0a170", "score": "0.53752595", "text": "def secs\n @msecs / SEC_TO_MS_F\n end", "title": "" }, { "docid": "6dbf7383e9715145b0f5f02a206746a7", "score": "0.5372451", "text": "def record_measure(label)\n $logger.debug(\n tms = Benchmark.measure(label) do\n yield\n end.format(\"%n: %10.6rreal %10.6u user %10.6y sys\")\n )\nend", "title": "" }, { "docid": "b8dec53adfa826d57211c9643ee68e3f", "score": "0.536556", "text": "def mean()\n sum = 0\n @difference.each do |item|\n sum += item\n end\n @mean = sum / @difference.length\n return @mean\n end", "title": "" }, { "docid": "ef72b4222f9c2e019436ba6b5f55d4a3", "score": "0.5358389", "text": "def mark_up_percent\n (self.mark_up * 100 - 100).to_i.to_s + \"%\" \n end", "title": "" }, { "docid": "9ba6afa15becfed728d8ae255c5d6ccb", "score": "0.53538746", "text": "def human_duration(ms, threshhold)\n prev_string = \"#{ms} milliseconds\"\n prev_value = ms\n TIMES.each do |unit, multi|\n return prev_string.cyan.bold if prev_value.abs / multi < threshhold\n prev_value /= multi\n prev_string = \"#{prev_value.round 2} #{unit}\"\n end\n prev_string\nend", "title": "" }, { "docid": "e92acea9a87bde95a21aaadbc8a6e27d", "score": "0.5347873", "text": "def calculateAverage notes\n total_note = 0\n notes.each do |note|\n total_note += note\n end\n total_note / notes.length\nend", "title": "" }, { "docid": "4143aca05a7a3a9d043691323f821ada", "score": "0.53445655", "text": "def hsec\n (self.to_f * 100).to_i\n end", "title": "" }, { "docid": "eb60e9470db0e293ffee2d223081e35e", "score": "0.53430164", "text": "def avg_shots_per_kill\n @shots.to_f / @kills\n end", "title": "" }, { "docid": "089a5822fbddc0470df14dd7a3201d59", "score": "0.53409106", "text": "def mean\n sum / count.to_f\n end", "title": "" }, { "docid": "e24e4c3bf981085d1fc58f244a8ac1e0", "score": "0.5329394", "text": "def total_time; end", "title": "" }, { "docid": "ab269a68cd5ca64f38dfbff24d6b1ba2", "score": "0.53277564", "text": "def sec_fraction\n usec/86400000000.0\n end", "title": "" }, { "docid": "dcb75310514f052c979e3c14a5d91e46", "score": "0.53251517", "text": "def as_time_elapsed(secs)\n TIME_RANGE.map do |count, name|\n next unless secs > 0\n secs, n = secs.divmod(count)\n n = if name == :seconds\n n.round(4)\n else\n n.to_i\n end\n \"#{n} #{name}\"\n end.compact.reverse.join(' ')\n end", "title": "" }, { "docid": "10f925f8f986ed6cabf35a85302396f9", "score": "0.5323987", "text": "def running_average; end", "title": "" }, { "docid": "254621f7bfb84074bcbd5faa94f4691e", "score": "0.5312109", "text": "def to_seconds\n (@total / @fps)\n end", "title": "" }, { "docid": "254621f7bfb84074bcbd5faa94f4691e", "score": "0.5312109", "text": "def to_seconds\n (@total / @fps)\n end", "title": "" }, { "docid": "585b5a0be3196bd4f5deea66936f8d5f", "score": "0.5310175", "text": "def stats_summary\n html = \"\"\n %w(inhale exhale cycle).each do |phase|\n %w(min max avg).each do |stat|\n time = format_time(self.meditations.map {|med| med.send(phase + \"_\" + stat)}.max)\n html += \"record #{phase} #{stat}: #{time}<br>\"\n end\n end\n html\n end", "title": "" }, { "docid": "eedb7375f9f34326a194851130562188", "score": "0.53021544", "text": "def mean_time_to_failure_in_minutes\n return @mean_time_to_failure_in_minutes\n end", "title": "" }, { "docid": "eedb7375f9f34326a194851130562188", "score": "0.53021544", "text": "def mean_time_to_failure_in_minutes\n return @mean_time_to_failure_in_minutes\n end", "title": "" }, { "docid": "48a4e9fd380b6c879a0c862cb50dba13", "score": "0.529384", "text": "def average_response_time\n (active_time / requests.to_f) * 1000\n end", "title": "" }, { "docid": "48107f3366ce4c9fa8ebfc80ef6a6c00", "score": "0.52920854", "text": "def measure_format\n i = 1\n arr = []\n measure = []\n self.chords.each do |chord|\n measure << chord.value\n if measure.count == self.beats_per_measure.to_i\n arr << \" #{i}. / #{measure.join(\" , \")} /\"\n measure = []\n i +=1\n end\n if chord == self.chords.last && measure.count != 0\n until measure.count == self.beats_per_measure.to_i\n measure << \" \"\n end\n arr << \" #{i}. / #{measure.join(\" , \")} /\"\n end\n end\n arr\n end", "title": "" }, { "docid": "3fb43556bd2cf85c97ac52701ec414bb", "score": "0.5290444", "text": "def time_total_s\n time_to_s(time_total)\n end", "title": "" }, { "docid": "da1791a1820beb70b11e84f2b7d72b39", "score": "0.52847254", "text": "def get_timing\r\n (time_swam.minutes.to_i > 0 ? \"#{time_swam.minutes.to_i}'\" : '') +\r\n format('%02.0f\"', time_swam.seconds.to_i) +\r\n format('%02.0f', time_swam.hundreds.to_i)\r\n end", "title": "" }, { "docid": "f59d3c73d39e6c764717d6ff4363420d", "score": "0.5281342", "text": "def requests_avg_per(seconds = 60)\n requests_per = requests_per(seconds)\n requests_per / seconds.to_f\n end", "title": "" }, { "docid": "b0747334f04a53aaa14771ae5df29b0d", "score": "0.527999", "text": "def reading_time(index)\n words_per_second = 270 / 60\n total_words = description(index).scan(/\\s+/).count\n article_time_seconds = total_words / words_per_second\n article_time_minutes = (article_time_seconds / 60).round\n\n return \"less than a minute read\" unless article_time_minutes > 0\n \"#{article_time_minutes} min read\"\n end", "title": "" }, { "docid": "23598941942634de71e39c217d4076f6", "score": "0.52735084", "text": "def avg_rating\n\t\t('%.2f' % issues.average(:rating).to_f).to_f\n\tend", "title": "" }, { "docid": "b50e4574db32e4853293e163dd2f7478", "score": "0.52689236", "text": "def to_ms\n\t\t(to_f*1000).round\n\tend", "title": "" }, { "docid": "70f68a6d840c43d2e1ffccf174703e91", "score": "0.52659625", "text": "def avg_susu_duration_per_banker(total_susus)\n @authenticated_user.susus.map(&:length).inject(:+) / total_susus_global\n end", "title": "" }, { "docid": "80a1075c292ca82a2029d005137c00c9", "score": "0.52638626", "text": "def ms\n ((duration * 1000.0) + 0.4999).to_i\n end", "title": "" }, { "docid": "14ff13ecb9cfef8af87b170ac7c4a111", "score": "0.52590495", "text": "def total_time\n minutes_to_human_readable_time(entries.internal.sum(:duration) + expected_remaining_work * 60)\n end", "title": "" }, { "docid": "8c2104526e3e4238b4dd53404cb0102f", "score": "0.5254657", "text": "def to_human_format\n {beat: [@b, 'd'], dividend: [@n, 'd'], divisor: [@d, 'd']}\n end", "title": "" }, { "docid": "09f0d9ed730dd7b45246b6e84c9015ef", "score": "0.525318", "text": "def avg_time\n self[:avg_time] || Tournament.current.default_avg_time\n end", "title": "" }, { "docid": "59dea38268ae3ddd7f7820afd91ec784", "score": "0.52463394", "text": "def get_timing( time_swam = @time_swam )\r\n (time_swam.minutes.to_i > 0 ? \"#{time_swam.minutes.to_i}'\" : '') +\r\n format('%02.0f\"', time_swam.seconds.to_i) +\r\n format('%02.0f', time_swam.hundreds.to_i)\r\n end", "title": "" }, { "docid": "97399e513351c915c9496b5a079b4519", "score": "0.524424", "text": "def to_metric(value)\n go = (value/1000000000).floor\n mo = ((value - go*1000000000)/1000000).floor\n ko = ((value - go*1000000000 - mo*1000000)/1000).floor\n o = (value - go*1000000000 - mo*1000000 - ko*1000).floor\n\n return(\"#{go}..#{mo}.g\") if (go != 0)\n return(\"#{mo}...#{ko}.m\") if (mo != 0)\n return(\"#{ko}...#{o}).k\") if (ko != 0)\n return(o)\n end", "title": "" }, { "docid": "77a46338fb8f512476cbe028f3798ed3", "score": "0.52409196", "text": "def calculate_tar\n (Smoke.by_user(self.id).sum(:counted) * cigaret_tar).convert_to('milligram')\n .to_i\n .round(2)\n end", "title": "" }, { "docid": "ae75cb18a737e3e9ba414712a1e83d84", "score": "0.5227813", "text": "def detect_microseconds()\n\t\tsum = 0.0\n\t\tlimit = [ 100, @log_record_array.length()-1 ].min\n\t\tfor i in 0..limit\n\t\t\tsum = sum + @log_record_array[ i ].info[ POS_REQ_TIME ]\t\n\t\tend\n\t\ttreshold = 1000\n\t\tif ( sum / i > treshold )\n\t\t\tputs(\" + Guessing microseconds: average request time is greater than #{treshold}\")\n\t\t\t@log_record_array.each {|rec| rec.info[ POS_REQ_TIME ] = rec.info[ POS_REQ_TIME ].to_f / 1000000.to_f }\t\n\t\telse\n\t\t\tputs(\" + Guessing seconds: average request time is lesser than #{treshold}\")\n\t\tend\n\n\t\t\t\t\t\n\t\t\n\tend", "title": "" }, { "docid": "ede984e7544c6ea1587d064264f6585b", "score": "0.5199447", "text": "def secs_to_hms\n frac = self % 1\n mins, secs = divmod(60)\n hrs, mins = mins.divmod(60)\n if frac.round(5) > 0.0\n format('%02<hrs>d:%02<mins>d:%02<secs>d.%<frac>d',\n { hrs: hrs,\n mins: mins, secs: secs,\n frac: frac.round(5) * 100 })\n else\n format('%02<hrs>d:%02<mins>d:%02<secs>d',\n { hrs: hrs, mins: mins, secs: secs })\n end\n end", "title": "" }, { "docid": "7ce703109322d74cbc0396aafcf995dc", "score": "0.51906013", "text": "def time\n each_item.reduce(0) { |a, e| a + e.duration }\n end", "title": "" }, { "docid": "c374ca2d94f80e44dd609f3bcacc1a23", "score": "0.51812726", "text": "def average\n { value: \"%0.2f\" % @average, color: Openreply::Color.color(@average) }\n end", "title": "" }, { "docid": "f67f816316c58fc6918b351bf4c9c0c5", "score": "0.51794684", "text": "def measure(stat, time)\n write(stat, time, 'ms', 1)\n self\n end", "title": "" }, { "docid": "03983297c33ca03bf5d886af79164c03", "score": "0.51621366", "text": "def to_metric(value)\n go = (value/1000000000).floor\n mo = ((value - go*1000000000)/1000000).floor\n ko = ((value - go*1000000000 - mo*1000000)/1000).floor\n o = (value - go*1000000000 - mo*1000000 - ko*1000).floor\n\n return(\"#{go}..#{mo}.g\") if (go != 0)\n return(\"#{mo}...#{ko}.m\") if (mo != 0)\n return(\"#{ko}...#{o}).k\") if (ko != 0)\n return o\n end", "title": "" }, { "docid": "86d2398e37696ee7f76eeec632b5348c", "score": "0.5161116", "text": "def elapsed\n add(:elapsed, '00:00:00', '%s') { |v,elapsed|\n sprintf('%02i:%02i:%02i', \n elapsed / 3600, # hours, \n elapsed / 60 % 60, #minutes, \n elapsed % 60 #seconds\n )\n }\n end", "title": "" }, { "docid": "e40c8ea448d62c722ba33fd541536ef4", "score": "0.51561254", "text": "def mean\n @mean\n end", "title": "" }, { "docid": "33d3c47f2cb64fd45c541e6ee13714e0", "score": "0.5155034", "text": "def show_multiplicative_average(arr)\n multiplicative_avarage = arr.reduce(:*) / arr.count.to_f\n \n format('And the result is %.3f', multiplicative_avarage)\nend", "title": "" }, { "docid": "fd6ac7efa780282232819ee67709ab0c", "score": "0.51547587", "text": "def formatted_avg_pos_age_diff\n if self.avg_pos_age_diff.present?\n return self.avg_pos_age_diff > 0 ? \"+#{self.avg_pos_age_diff.round(0)}\" : self.avg_pos_age_diff.round(0).to_s\n else\n return \"\"\n end\n end", "title": "" }, { "docid": "a0992ad6fac9b275280e74a94a69d67e", "score": "0.5154716", "text": "def mins\n @msecs / MIN_TO_MS_F\n end", "title": "" }, { "docid": "89e415848f8c944ada75e9e2211631f1", "score": "0.5154111", "text": "def processing_times\n total = ab_output.match(/Total:\\s+([0-9.]+)\\s+([0-9.]+)\\s+([0-9.]+)\\s+([0-9.]+)\\s+([0-9.]+)/)\n ninety = ab_output.match(/ 90%\\s+([0-9.]+)/)\n ninetyfive = ab_output.match(/ 95%\\s+([0-9.]+)/)\n [total[1], total[2], total[4], ninety[1], ninetyfive[1], total[5]]\n end", "title": "" } ]
eb043f03300f20614e57322d2e2bbade
Get static (unchanging) data. Does not honor invalidation, since static data is assumed not to change. This will not cause a load orfetch if someone else (such as a parent job or build or server) has given us static data already. If we have loaded our own data, that will be used in preference.
[ { "docid": "3f841eacd048ba288ce9d2ada2d8f977", "score": "0.7461929", "text": "def static_data(field=nil)\n # We don't care about invalidation for static fields\n if field\n # If something is already loaded, use it!\n return @data[field] if @data\n static_data[field]\n else\n return @data if @data\n return @static_data if @static_data\n load!\n end\n end", "title": "" } ]
[ { "docid": "bfc86223afa3bff2c603cfc999135d1c", "score": "0.63010305", "text": "def fetch_locations_static_data\n with_cache(CACHE_KEY, freshness: CACHE_DURATION) do\n payload = payload_builder.build_locations_fetch_payload\n result = api_call(payload)\n\n return result unless result.success?\n\n result_hash = response_parser.to_hash(result.value.body)\n\n if valid_status?(result_hash, ROOT_TAG)\n Result.new(result.value.body)\n else\n error_result(result_hash, ROOT_TAG)\n end\n end\n end", "title": "" }, { "docid": "9229eca27abbbde233793332ad3ac63f", "score": "0.62928325", "text": "def load_static_cache_rows\n ret = super if defined?(super)\n ret || dataset.all.freeze\n end", "title": "" }, { "docid": "a1c465329d0128ea6046b3482540618a", "score": "0.6083641", "text": "def static_record_cache\n @static_record_cache||= initialize_static_record_cache\n end", "title": "" }, { "docid": "b499d2f9f19cf1d162e8c16843453f72", "score": "0.60092264", "text": "def loaded_data\n @loaded_data ||= data\n end", "title": "" }, { "docid": "a18a9324674dc6f151b0a61e4bbf93a2", "score": "0.59882283", "text": "def data\n @data ||= load_data\n end", "title": "" }, { "docid": "77d714e6dc17c579fc4379597e93b822", "score": "0.5947433", "text": "def get_data\n @data = fetch_yaml 'working_data'\n @data ||= {}\nend", "title": "" }, { "docid": "65cb24ffe024353368a79818eb2b20e4", "score": "0.594418", "text": "def cached\n eval(File.open(\"./lib/data/data.rb\").read)\n end", "title": "" }, { "docid": "b2161a8fa1ebd8c6ad625fb4d3f41229", "score": "0.588614", "text": "def data\n get if !@data and exists?\n @data\n end", "title": "" }, { "docid": "4cd6113c73a6f4b1c7707c101c35f939", "score": "0.5881845", "text": "def global_data\n return parent.global_data if parent\n @global_data ||= DataStore.new(File.expand_path(\"global_data.json\", home_path))\n end", "title": "" }, { "docid": "4cd6113c73a6f4b1c7707c101c35f939", "score": "0.5881845", "text": "def global_data\n return parent.global_data if parent\n @global_data ||= DataStore.new(File.expand_path(\"global_data.json\", home_path))\n end", "title": "" }, { "docid": "f29aefaf894626fd9af796bb989a3daf", "score": "0.5804741", "text": "def data\n @_data ||= data_from_constant\n end", "title": "" }, { "docid": "31a96537a07dd50961870581c1c4d414", "score": "0.57958263", "text": "def data\n @data ||= generate_data\n return @data\n end", "title": "" }, { "docid": "22335343bf09ef19239164f10b438708", "score": "0.5791423", "text": "def data\n get if !@data and exists?\n @data\n end", "title": "" }, { "docid": "3d5b3ab4cfb4890cac4a661a8eece5de", "score": "0.56959045", "text": "def static_vars\n @static_vars ||= {}\n end", "title": "" }, { "docid": "1de2f126a32867b4d7c59be43839283e", "score": "0.5661931", "text": "def data\n @data ||= get\n end", "title": "" }, { "docid": "50a8eb957e2d254b4ef0073eef6ce930", "score": "0.5612454", "text": "def getSingletonData\n @singletonData\n end", "title": "" }, { "docid": "50a8eb957e2d254b4ef0073eef6ce930", "score": "0.5612454", "text": "def getSingletonData\n @singletonData\n end", "title": "" }, { "docid": "8d460482730d910de05c1c7a80d725b2", "score": "0.5599891", "text": "def static_landing_page_content\n @soda_client.get(\n Figaro.env.landing_page_dataset\n )\n end", "title": "" }, { "docid": "67eb8ac976bcbc79e0df12657fffea5e", "score": "0.5577808", "text": "def data\n self.load if @data.nil?\n @data\n end", "title": "" }, { "docid": "e486e1b255c3952611d836d70261dd4c", "score": "0.5551089", "text": "def data\n # This is a common memoization technique used in Ruby\n @data ||= preprocess_data\nend", "title": "" }, { "docid": "e486e1b255c3952611d836d70261dd4c", "score": "0.5551089", "text": "def data\n # This is a common memoization technique used in Ruby\n @data ||= preprocess_data\nend", "title": "" }, { "docid": "57ac46e172d9a1945e7a7821811895ae", "score": "0.55335546", "text": "def static\n @static || true\n end", "title": "" }, { "docid": "98ca1f8e025171336086665906abe267", "score": "0.55272555", "text": "def data\n # This is a common memoization technique used in Ruby\n @data ||= normalize_data\nend", "title": "" }, { "docid": "25680a4f61458f2758d50b4c961be94c", "score": "0.5521574", "text": "def data\n @data ||= begin\n if File.exists? path\n Marshal.load(File.read(path))\n else\n data_init\n end\n end\n end", "title": "" }, { "docid": "59945333f9dfbf19b47448b2fae72822", "score": "0.5493377", "text": "def get_data\n data = ProjectHanlon::Data.instance\n data.check_init\n data\n end", "title": "" }, { "docid": "59945333f9dfbf19b47448b2fae72822", "score": "0.5493377", "text": "def get_data\n data = ProjectHanlon::Data.instance\n data.check_init\n data\n end", "title": "" }, { "docid": "c3298075eee917a14b563139f7903f3d", "score": "0.54787195", "text": "def cache_data\n return @cache_data if @cache_data\n cache_file # HACK writable check\n\n @only_latest = true\n\n @cache_data = read_cache_data latest_cache_file\n\n @cache_data\n end", "title": "" }, { "docid": "6bdbbb966952083162b9ef78791df6ae", "score": "0.54443526", "text": "def fallback_data\n @fallback_data ||= {}\n end", "title": "" }, { "docid": "53d87599d123d9f8133404a405fe956b", "score": "0.54397154", "text": "def phone_data\n @@phone_data ||= load_data.freeze\n end", "title": "" }, { "docid": "b24ac20bf90ec5859c2b05e0b9219d6f", "score": "0.54311705", "text": "def initialize_static_record_cache#:nodoc:\n return unless @static_record_cache.nil?\n records = self.find_without_static_record(:all, acts_as_static_record_options[:find]||{})\n @static_record_cache = records.inject({:primary_key => {}, :key => {}, :calc => {}}) do |cache, record|\n cache[:primary_key][record.send(self.primary_key)] = record\n if acts_as_static_record_options[:key]\n cache[:key][record.send(acts_as_static_record_options[:key])] = record\n end\n cache\n end\n end", "title": "" }, { "docid": "4bce0ee881c456d9f3b1f35d21e3fee3", "score": "0.5420805", "text": "def get_data\n return nil\n end", "title": "" }, { "docid": "b310d410f98da634f53ad4d32824d455", "score": "0.5398554", "text": "def data; @data ||= fetch; end", "title": "" }, { "docid": "ccc244b06201f70815fa27f4b601a081", "score": "0.537578", "text": "def merge_requested_site_data\n data.each do |k, v|\n next unless v.is_a?(String) && v.starts_with?(\"site.data.\")\n\n data_path = v.delete_prefix(\"site.data.\")\n data[k] = site.data.dig(*data_path.split(\".\"))\n end\n end", "title": "" }, { "docid": "e1ac1795e0cbf184f96917060ffd15f2", "score": "0.53697926", "text": "def static_path\n prefix = TaliaCore::CONFIG['static_data_prefix']\n return unless(prefix)\n prefix = N::LOCAL + prefix unless(prefix =~ /:\\/\\//)\n \"#{prefix}/#{class_name}/#{(\"00\" + self.id.to_s)[-3..-1]}/#{self.id}\"\n end", "title": "" }, { "docid": "e1ac1795e0cbf184f96917060ffd15f2", "score": "0.53697926", "text": "def static_path\n prefix = TaliaCore::CONFIG['static_data_prefix']\n return unless(prefix)\n prefix = N::LOCAL + prefix unless(prefix =~ /:\\/\\//)\n \"#{prefix}/#{class_name}/#{(\"00\" + self.id.to_s)[-3..-1]}/#{self.id}\"\n end", "title": "" }, { "docid": "efdd32fc53d9f0c8d3d1aeba6144ae39", "score": "0.53480375", "text": "def cache_data\n data = subjects\n return nil unless seems_legit? data\n\n Rails.cache.write CACHE_KEY, data, expires_in: 24.hours\n data\n end", "title": "" }, { "docid": "ee12a0fca9b1f7f2ca07fbb562e139ee", "score": "0.5342955", "text": "def fetch\n @data ||= get\n end", "title": "" }, { "docid": "57c803d3f16dcf5ee5212aeac7e387e0", "score": "0.53267455", "text": "def static\n @static ||= Config::Assets.new(@root)\n end", "title": "" }, { "docid": "93b805a725c5c7cf4668dfe78ef28bec", "score": "0.53238344", "text": "def data\n @data ||= {}\n end", "title": "" }, { "docid": "cec6b550872e0d7d73765b00b1de4f90", "score": "0.53216034", "text": "def is_static\n nil\n end", "title": "" }, { "docid": "49db25d87a1279073c94e223711aa9ed", "score": "0.5319242", "text": "def prepare_appdata\n @appdata = Rails.cache.fetch(\"appdata\", :expires_in => 12.hours) do\n Appdata.get \"factory\"\n end\n end", "title": "" }, { "docid": "e1f1ea7bcdb4f998b41881d444495c3d", "score": "0.5269266", "text": "def data\n @data ||= attributes[:data].freeze\n end", "title": "" }, { "docid": "6cd82ff635a9047b9b714ef79fe32022", "score": "0.526768", "text": "def data\n @data || datastore['DATA']\n end", "title": "" }, { "docid": "d0eac8c455478b7d1770b41473520a0e", "score": "0.52675486", "text": "def prepare_appdata\n @appdata = Rails.cache.fetch(\"appdata\", :expires_in => 12.hours) do\n Appdata.get \"factory\"\n end\n end", "title": "" }, { "docid": "5fcb3bdc749e7a75ad84624947ef85ec", "score": "0.5259905", "text": "def get_all(datakey = \"default\")\n if @data == UNSET_VALUE\n @logger.warn \"#get_all has been called before any data has been loaded.\"\n\n @data\n else\n @data[datakey]\n end\n end", "title": "" }, { "docid": "8bc1d473c25ecf3edbe5e20a70fbeb79", "score": "0.5253144", "text": "def load_data(site)\n if(@site.layouts[@template].nil?)\n Jekyll.logger.error \"Template #{@template} was not loaded by Jekyll for #{self.name}.\\n Skipping Page.\"\n self.data = {}\n @complete = false\n return\n end\n setData()\n if([email protected]?)\n self.data['sub_rdf'] = @resource.subResources.values\n self.data['sub_rdf'].each { |res|\n res.page = self\n res.site = site\n }\n end\n end", "title": "" }, { "docid": "3b6720106e9dd8bb4da22121ab521161", "score": "0.5249278", "text": "def get_init_data\n\t\t@current_portfolio = session[:current_portfolio_name] ? Portfolio.find_by_name(session[:current_portfolio_name]) : current_user.portfolios[0]\n\n\t\tif @current_portfolio.portfolio_weeks.any?\n\t\t\t@current_week = session[:current_week_id] ? PortfolioWeek.find(session[:current_week_id]) : @current_portfolio.portfolio_weeks.last\n\n\t\t\t# week traders for charts\n\t\t\t@portfolio_week_traders = current_portfolio_traders_for_week(@current_week)\n\t\t\t@all_week_traders = all_portfolios_traders_for_week(@current_week)\n\n\t\t\t@portfolio_traders = @current_week.portfolio_traders\n\t\telse\n\t\t\t@portfolio_traders = []\n\t\tend\n\n\t\t@history_profit = history_profit()\n\tend", "title": "" }, { "docid": "ae2066385ebfb508289b3fbe692c6ccb", "score": "0.52454907", "text": "def data()\n @data ||= {}\n end", "title": "" }, { "docid": "ed5e64d1602fd10610b99bcdada593fb", "score": "0.52374315", "text": "def get_static_resource resource_path\t\t\n\t\tresource_path.should! :relative?\n\t\tfname = lookup_resource resource_path\n\t\tunless fname\n\t\t\traise \"File '#{resource_path}' not found!\" \n\t\tend\t\t\t\t\n\t\t\n\t\tres = Core::IO::ResourceData.initialize_from_file fname\n\t\th = header(fname, res)\n\t\t#\t\tset_date! h \n\t\treturn res, h\n\tend", "title": "" }, { "docid": "b7b094acbc5ee701deec89ff73128692", "score": "0.52359134", "text": "def retrieve_external_data\n # pure_json = get_json_data\n # I'm using a json file only for testing\n pure_json = File.read(\"#{Rails.root}/streaming.json\")\n # ------------------------------------\n data_hash = JSON.parse pure_json\n data_hash\n end", "title": "" }, { "docid": "1363c1a7601d7b0da74963b93a9a3a91", "score": "0.52238953", "text": "def static_attributes_source\n attributes_source[:static] || ''\n end", "title": "" }, { "docid": "03bf535918609c2b477a93998d63bcb6", "score": "0.5222349", "text": "def data(reload = false)\n load_data if reload == true || @last_updated.nil?\n @data\n end", "title": "" }, { "docid": "03bf535918609c2b477a93998d63bcb6", "score": "0.5222349", "text": "def data(reload = false)\n load_data if reload == true || @last_updated.nil?\n @data\n end", "title": "" }, { "docid": "3d54eed8b2a80c919832966a77493e38", "score": "0.52221733", "text": "def cache_data\n @data[:cache]\n end", "title": "" }, { "docid": "de86380f456e8306d90b3ed05d4caa34", "score": "0.521627", "text": "def load_cache\n @all = load_static_cache_rows\n h = {}\n @all.each do |o|\n o.errors.freeze\n h[o.pk.freeze] = o.freeze\n end\n @cache = h.freeze\n end", "title": "" }, { "docid": "b07743589f852ce68873d2795d1eb387", "score": "0.520768", "text": "def set_static_page\n @static_page = StaticPage.find(params[:id]) if params[:id]\n @static_page = StaticPage.find_by_name(params[:static_page_name]) if params[:static_page_name]\n @available_image_names = []\n @available_image_names = @static_page.image_names - @static_page.file_attachments.pluck(:attachment_name) if @static_page.try(:image_names)\n end", "title": "" }, { "docid": "adf1c70522e827a7bd4cf1515bff9a0d", "score": "0.52054644", "text": "def set_static\n @static = Static.find(params[:id])\n end", "title": "" }, { "docid": "adf1c70522e827a7bd4cf1515bff9a0d", "score": "0.52054644", "text": "def set_static\n @static = Static.find(params[:id])\n end", "title": "" }, { "docid": "10d038d2cdbadd63980e11fdf6018319", "score": "0.51990235", "text": "def data\n fetch_data_by_key(:data)\n end", "title": "" }, { "docid": "23d7af4693e467421d9c94ee3086bf5c", "score": "0.5195697", "text": "def load_common_data\n \n @customers ||= Customer.all\n @employees ||= Employee.all\n @server_offset = Time.zone.utc_offset / 3600\n @statuses ||= Status.where(:category => Status.categories[:jobs]).order(:order)\n\n @status_checklist ||= StatusChecklistItem.all.includes(:status).to_json\n\n end", "title": "" }, { "docid": "bbe1bc94e51361bfe3e6eed16711a588", "score": "0.51939946", "text": "def global_data\n retrieve_resource_query\n @period = @query.period\n # Load users issues\n if user_opening?\n preloads = [:custom_resource_allocator, { project: [:enabled_modules, members: :roles] }, :status]\n\n if EasySetting.value(:easy_gantt_resources_show_task_soonest_start)\n preloads << :parent\n preloads << { relations_to: :issue_from }\n end\n\n if EasySetting.value(:easy_gantt_resources_show_task_latest_due)\n preloads << :parent\n preloads << { relations_from: :issue_to }\n end\n\n preloads.uniq!\n\n @issues = @query.entities(preload: preloads,\n order: 'issues.lft').to_a\n unless @query.has_column?(:spent_hours)\n Issue.load_visible_spent_hours(@issues)\n end\n\n if EasySetting.value(:easy_gantt_resources_reservation_enabled)\n @reservations = EasyGanttReservation.joins(:assigned_to).\n preload(:resources).\n where(assigned_to_id: params[:assigned_to_id]).to_a\n end\n\n load_issues_resources\n load_issues_versions\n load_issues_projects\n load_reservations_projects\n load_projects_members\n\n # Load just users\n else\n @users = @query.users\n load_users_groups\n load_users_events\n load_users_sums\n end\n end", "title": "" }, { "docid": "8773d69b1ff7fa8677c05b2462a2a70e", "score": "0.51916957", "text": "def template_data\n @template_data || load_template_data!\n end", "title": "" }, { "docid": "806415e071e704ef0645b19871c705d9", "score": "0.51896", "text": "def data file\n prefetched_data(file) || fetch_file(file)\n end", "title": "" }, { "docid": "a6da1f2b52ae7d0f22dbe73fb65c8476", "score": "0.5187625", "text": "def make_static\n @solid_static = true\n end", "title": "" }, { "docid": "128238e891534d3c2e85eeb3aaa8a677", "score": "0.51760167", "text": "def data\n return @data if @organizations\n load_response\n @data\n end", "title": "" }, { "docid": "686557152c06e563123cecc6b78e4906", "score": "0.5152198", "text": "def data_hash\n @data_hash ||= base_hash[:data]\n end", "title": "" }, { "docid": "7bbde3de753914cdb5ae5014f550e7f2", "score": "0.51420116", "text": "def data\n @data ||= Hashie::Mash.new(read_attribute(:data))\n end", "title": "" }, { "docid": "03eb874ac5f360a887c3e22cf479c65b", "score": "0.5133521", "text": "def method_missing(path)\n if @local_data.key?(path.to_s)\n # Any way to cache this?\n @local_data_enhanced ||= ::Middleman::Util.recursively_enhance(@local_data)\n return @local_data_enhanced[path.to_s]\n else\n result = data_for_path(path)\n return result if result\n end\n\n super\n end", "title": "" }, { "docid": "06a544dea668dcfca76cd5986a2b3604", "score": "0.5123097", "text": "def static_cache_object(o)\n if @static_cache_frozen\n o\n elsif o\n call(Hash[o.values])\n end\n end", "title": "" }, { "docid": "b798a6cd88abfcf7c7904b8499752802", "score": "0.51012737", "text": "def bootstrap_static(wod)\n options = {\n wod: wod,\n response: api_connection.connection.get('bootstrap-static'),\n directory: 'fpl_data/pulled_data/bootstrap_static',\n filename: \"bootstrap-static_#{DateTime.current.strftime(\"%C%y-%m-%d\")}\"\n }\n\n CoreUtility::DataToJSON.write_or_display_data(options)\n end", "title": "" }, { "docid": "ccc2d0bbee7a02f613c0fef4496d5120", "score": "0.50956017", "text": "def data\n @reloaded = false\n return @data unless File.exists?(@filepath)\n mtime = File.stat(@filepath).mtime\n return @data if mtime == @mtime\n puts \"Reloading data file #{@filepath}\"\n @mtime = mtime\n @data = File.read(@filepath)\n @reloaded = true\n @data\n end", "title": "" }, { "docid": "9756011ca0dcf2bb3d1eed3892c3477b", "score": "0.50941765", "text": "def get_data\n if @ssh_gateway\n get_data_ssh\n else\n get_data_direct\n end\n end", "title": "" }, { "docid": "b552236a4e38a191b5ce43bd142b0cf8", "score": "0.5092286", "text": "def static!\n return if (public_dir = settings.public_folder).nil?\n path = File.expand_path(\"#{public_dir}#{unescape(request.path_info)}\" )\n return unless File.file?(path)\n\n env['sinatra.static_file'] = path\n cache_control(*settings.static_cache_control) if settings.static_cache_control?\n send_file path, :disposition => nil\n end", "title": "" }, { "docid": "f6874cb96a2024443a370805a43f7684", "score": "0.50913227", "text": "def default_data\n Data.for(@template)\n end", "title": "" }, { "docid": "2bc3cdb093acf23650854b80a633f619", "score": "0.50897497", "text": "def template_data\n @data ||= metadata.merge(Data.for_machines(timestamp))\n end", "title": "" }, { "docid": "0cb33d824b1f61ee5485096a06428dc7", "score": "0.50878876", "text": "def get_data(key)\n if value = self[\"data-#{key}\"]\n value\n else\n %x{\n var data = #@native.$data;\n\n if (data === undefined) {\n return nil;\n }\n else {\n var value = #@native.$data[key];\n\n if (value === undefined) {\n return nil;\n }\n else {\n return value;\n }\n }\n }\n end\n end", "title": "" }, { "docid": "ac172a60e104bd7feea95668e4c61a8e", "score": "0.50703645", "text": "def static_entry\n super\n end", "title": "" }, { "docid": "5cbc425051ef9c97b1a800ae3c907bac", "score": "0.50594896", "text": "def fresh_data\n return '' unless morph?\n\n @fresh_data ||= MorphData.new(creation[:scraper]).query(creation[:query]) rescue nil\n end", "title": "" }, { "docid": "2180c86d22ec4ec6a05cfd88f9d1a684", "score": "0.5058396", "text": "def caching\n @caching = \"data_update[#{data_path}]\"\n end", "title": "" }, { "docid": "f2de4461ad385e3f96ab62e80d10c3cc", "score": "0.50571084", "text": "def data_path\n return @data_path if @data_path\n return default_data_path if respond_to? :default_data_path\n\n nil\n end", "title": "" }, { "docid": "9193d69325f96b00f6161b703995f30f", "score": "0.50565", "text": "def request_data\n Thread.current[THREAD_LOCAL_NAME] ||= {}\n end", "title": "" }, { "docid": "807888eee74b9340be6906b4003c5227", "score": "0.503868", "text": "def common_data\n @common_theme_entity_obj.data\n end", "title": "" }, { "docid": "f2743bb7eef965abecf20687b1640b53", "score": "0.5034083", "text": "def data_for(id)\n scraper.fetch_problem id unless cache.valid?(\"problem_#{id}\")\n cache.get(\"problem_#{id}\")[:data]\n end", "title": "" }, { "docid": "14f201104a5f790f9e1e7b2a0cbe7781", "score": "0.5030492", "text": "def fallback_data; end", "title": "" }, { "docid": "b16a56e9ccbd76ccdb126b5cc3fbab1b", "score": "0.5018673", "text": "def static_files\n @static_files\n end", "title": "" }, { "docid": "788b1a6ff14d6928dfd37aade1e5656c", "score": "0.5017582", "text": "def see_default_data\n # TODO: add assertions here to verify any default data was loaded\n end", "title": "" }, { "docid": "b3eb1bdacc587a5de68ca53ff770ba27", "score": "0.50168544", "text": "def staticreq\n request.env[\"HTTP_USER_AGENT\"] =~ /static/\n end", "title": "" }, { "docid": "16a255e8c43ac9f45838c5bbf4ae1312", "score": "0.50115687", "text": "def fetch_landing_page_content\n fetch_data(cache_name: :landing_page_content, ttl: 30.minutes)\n end", "title": "" }, { "docid": "1ae0f03a35685ced00eefd79eb43faec", "score": "0.5006917", "text": "def get_data\n raise 'calling abstract method: get_data'\n end", "title": "" }, { "docid": "c6aef461498afa8204ecf0f0564ab714", "score": "0.50066286", "text": "def cache_data\n Rails.cache.instance_eval { @data.inspect }\n end", "title": "" }, { "docid": "2d42da12e7906efd4e145aadd243cefd", "score": "0.5002517", "text": "def get_data\n data = nil\n begin\n return @stats.get\n rescue => e\n return {'Status' => 5, 'Message' => 'Error while obtaining statistics'}, e\n end\n end", "title": "" }, { "docid": "22d236846af1b55fefd2b497bf3b93bd", "score": "0.5000951", "text": "def set_static_meta_info\n @meta_info.each do |k, _|\n data = @html.css(self.class.const_get(\"META_#{k.to_s.upcase}\"))[0]\n @meta_info[k] = data['content'] if data\n end\n end", "title": "" }, { "docid": "2dac76a084774713a12ef29e20cb866f", "score": "0.49985826", "text": "def get_data_home\n context.data_home = ENV['BLINKY_DATA_HOME']\n end", "title": "" }, { "docid": "7ccce3579bcb6edca335c5ea67577016", "score": "0.49916345", "text": "def find(id, options = {})\n get(\"/api/lol/static-data/#{region}/#{version || STATIC_DATA_VERSION}/#{self.class.api_model}/#{id}\", options)\n end", "title": "" }, { "docid": "ae30dd5329b65ef225d9ed0d51f9d6fd", "score": "0.4987358", "text": "def static!\n # Workaround for differences in Sinatra versions.\n public_dir = Server.use_public_folder? ? settings.public_folder : settings.public\n return if public_dir.nil?\n public_dir = File.expand_path(public_dir)\n\n path = File.expand_path(public_dir + unescape(request.path_info.gsub(/^#{settings.config[:uri_path]}/,'')))\n return if path[0, public_dir.length] != public_dir\n return unless File.file?(path)\n\n env['sinatra.static_file'] = path\n send_file path, :disposition => nil\n end", "title": "" }, { "docid": "c1da73c808d02eeab630c13bddfba776", "score": "0.49851814", "text": "def data\n defaults.merge(JSON.parse(read_attribute(:json_data) || \"{}\"))\n end", "title": "" }, { "docid": "d9508b673b626e66fe82f99777509edd", "score": "0.4983472", "text": "def static_content\n '3|user|service|domain|1483964492|'\n end", "title": "" }, { "docid": "aa62c91bb73b517512cc7260c66a128c", "score": "0.49833035", "text": "def reload_data\n remove_instance_variable(:@data) if instance_variable_defined?(:@data)\n end", "title": "" }, { "docid": "6b9b290562c9b63952e4eb8dea7caa9e", "score": "0.4982738", "text": "def static_connections; @static = true end", "title": "" }, { "docid": "66b250fb558871983b1caadfd235822d", "score": "0.49820513", "text": "def preload_intake_data!\n nil\n end", "title": "" } ]
8d8597112f2d7bbd3c3f7cc0a493cf88
This method checks the validity of compfilters. A list of compfilters needs to be specified. Also the parent of the component we're checking should be specified, not the component to check itself.
[ { "docid": "19d5660cee0646ccb285f8772f79f8fc", "score": "0.79117954", "text": "def validate_comp_filters(parent, filters)\n filters.each do |filter|\n is_defined = parent.key?(filter['name'])\n\n if filter['is-not-defined']\n if is_defined\n return false\n else\n next\n end\n end\n\n return false unless is_defined\n\n skip = false\n if filter['time-range'] && filter['time-range'].any?\n parent[filter['name']].each do |sub_component|\n if validate_time_range(sub_component, filter['time-range']['start'], filter['time-range']['end'])\n skip = true\n break\n end\n end\n next if skip\n\n return false\n end\n\n next if !filter['comp-filters'] && !filter['prop-filters']\n\n # If there are sub-filters, we need to find at least one component\n # for which the subfilters hold true.\n parent[filter['name']].each do |sub_component|\n next unless validate_comp_filters(sub_component, filter['comp-filters']) &&\n validate_prop_filters(sub_component, filter['prop-filters'])\n skip = true\n break\n end\n next if skip\n\n # If we got here it means there were sub-comp-filters or\n # sub-prop-filters and there was no match. This means this filter\n # needs to return false.\n return false\n end\n\n # If we got here it means we got through all comp-filters alive so the\n # filters were all true.\n true\n end", "title": "" } ]
[ { "docid": "12b6d43a5d24c4abefcceeb7be471124", "score": "0.6809982", "text": "def validate_prop_filters(parent, filters)\n filters.each do |filter|\n is_defined = parent.key?(filter['name'])\n\n if filter['is-not-defined']\n if is_defined\n return false\n else\n next\n end\n end\n\n return false unless is_defined\n\n skip = false\n if filter['time-range']\n parent[filter['name']].each do |sub_component|\n if validate_time_range(sub_component, filter['time-range']['start'], filter['time-range']['end'])\n skip = true\n break\n end\n end\n next if skip\n\n return false\n end\n\n next if !filter['param-filters'] && !filter['text-match']\n\n # If there are sub-filters, we need to find at least one property\n # for which the subfilters hold true.\n parent[filter['name']].each do |sub_component|\n next unless validate_param_filters(sub_component, filter['param-filters']) &&\n (!filter['text-match'] || validate_text_match(sub_component, filter['text-match']))\n skip = true\n break\n end\n next if skip\n\n # If we got here it means there were sub-param-filters or\n # text-match filters and there was no match. This means the\n # filter needs to return false.\n return false\n end\n\n # If we got here it means we got through all prop-filters alive so the\n # filters were all true.\n true\n end", "title": "" }, { "docid": "0da9fd0659f477a4cca9d91e396da487", "score": "0.67448205", "text": "def validate_param_filters(parent, filters)\n filters.each do |filter|\n is_defined = parent.key?(filter['name'])\n\n if filter['is-not-defined']\n if is_defined\n return false\n else\n next\n end\n end\n\n return false unless is_defined\n next unless filter['text-match']\n\n # If there are sub-filters, we need to find at least one parameter\n # for which the subfilters hold true.\n skip = false\n parent[filter['name']].parts.each do |param_part|\n next unless validate_text_match(param_part, filter['text-match'])\n skip = true\n break\n end\n\n next if skip\n\n # If we got here it means there was a text-match filter and there\n # were no matches. This means the filter needs to return false.\n return false\n end\n\n # If we got here it means we got through all param-filters alive so the\n # filters were all true.\n true\n end", "title": "" }, { "docid": "e3ffdaec5ae686e03c2df86a9cce0e79", "score": "0.59164804", "text": "def has_valid_filters\n if self.filters.empty?\n errors.add(:base, \"There is a whitelist that does not have any filters.\")\n return false\n elsif self.filters.map{|f| f.resource}.uniq.size != 1\n errors.add(:base, \"A whitelist has been given filters with different resources.\")\n return false\n end\n return true\n end", "title": "" }, { "docid": "179bc17b7753090b22c2c081020b13fd", "score": "0.5875176", "text": "def validate_filter?(filter) # rubocop:disable Metrics/MethodLength\n failed = 0\n passed = 0\n\n passed = 1 if Util.empty_filter?(filter)\n\n filter.each_key do |key|\n case key\n when /puppet_class|cf_class/\n filter[key].each do |f|\n Log.debug(\"Checking for class #{f}\")\n if Util.has_cf_class?(f)\n Log.debug(\"Passing based on configuration management class #{f}\")\n passed += 1\n else\n Log.debug(\"Failing based on configuration management class #{f}\")\n failed += 1\n end\n end\n\n when \"compound\"\n # removed while rebuilding compound filters, this whole method is probably unused now\n\n when \"agent\"\n filter[key].each do |f|\n if Util.has_agent?(f) || f == \"mcollective\"\n Log.debug(\"Passing based on agent #{f}\")\n passed += 1\n else\n Log.debug(\"Failing based on agent #{f}\")\n failed += 1\n end\n end\n\n when \"fact\"\n filter[key].each do |f|\n if Util.has_fact?(f[:fact], f[:value], f[:operator])\n Log.debug(\"Passing based on fact #{f[:fact]} #{f[:operator]} #{f[:value]}\")\n passed += 1\n else\n Log.debug(\"Failing based on fact #{f[:fact]} #{f[:operator]} #{f[:value]}\")\n failed += 1\n end\n end\n\n when \"identity\"\n unless filter[key].empty?\n # Identity filters should not be 'and' but 'or' as each node can only have one identity\n matched = filter[key].select {|f| Util.has_identity?(f)}.size\n\n if matched == 1\n Log.debug(\"Passing based on identity\")\n passed += 1\n else\n Log.debug(\"Failed based on identity\")\n failed += 1\n end\n end\n end\n end\n\n if failed == 0 && passed > 0\n Log.debug(\"Message passed the filter checks\")\n\n true\n else\n Log.debug(\"Message failed the filter checks\")\n\n false\n end\n end", "title": "" }, { "docid": "3ebbbdc11bf0e663984b5c3685961255", "score": "0.5573142", "text": "def validate_filterrific_available_filters; end", "title": "" }, { "docid": "d8084c7fad2261fe31e90a6b0e497164", "score": "0.5508335", "text": "def filter(course, cohort, filters)\n # Return false if any of the filters returns false\n filters.each { |f| return false unless f.call(course, cohort) }\n # If we get here, all filters returned true\n true\n end", "title": "" }, { "docid": "545a182507ad4c82aa940c924163e3a8", "score": "0.54155314", "text": "def filter(year, course, cohort, filters)\n # Return true if no filters are specified\n return true if filters.nil? || filters.empty?\n # Return false if any of the filters returns false\n filters.each { |f| return false unless f.call(year, course, cohort) }\n # At this point all filters returned true\n true\n end", "title": "" }, { "docid": "8314ba8ede5e84b018f090fb36d38081", "score": "0.53812355", "text": "def valid_filter(valid_filters, filter)\n\t\t\tif filter && filter.is_a?(Hash)\n\t\t\t\tfilter.keys.each do |filter_key|\n\t\t\t\t\t# validates if filter criteria is recognized\n\t\t\t\t\traise Exception.new(\"Invalid filter criteria '#{filter_key.to_s}'\") if !valid_filters.key?(filter_key.to_s)\n\t\t\t\t\t# validates the filter criteria value\n\t\t\t\t\tvalid_filter_value(filter_key, filter[filter_key])\n\t\t\t\tend\n\t\t\tend\n\t\t\treturn true\n\t\tend", "title": "" }, { "docid": "64a2062b69473038263ba19cdc31a197", "score": "0.53434587", "text": "def validate_product_components_in_list(product_components)\n return if (product_components - PRODUCT_COMPONENTS[product]).empty?\n\n \"#{product_components} were not in the list of valid product components: \"\\\n \"#{PRODUCT_COMPONENTS[:'Data Blocks']} for #{product}.\"\n end", "title": "" }, { "docid": "3a64d1b561d6beddebf7b96439255093", "score": "0.5310732", "text": "def validate(params)\n validator = validator_from params\n parsed_filter = parse_filter_from params\n result = validator.validate parsed_filter\n @valid_filter = parsed_filter if result\n result\n end", "title": "" }, { "docid": "8bf86286ca3d30bd4215f1c1e404bc59", "score": "0.5270767", "text": "def verify_filters_present(cohort)\n if cohort.search_criteria.list_filters.flatten.compact.any?\n show_filters\n wait_until(Utils.short_wait) { cohort_filter_row_elements.any? }\n filters = cohort.search_criteria\n wait_until(5) do\n filters.gpa.each { |g| existing_filter_element('GPA', g).exists? } if filters.gpa && filters.gpa.any?\n filters.level.each { |l| existing_filter_element('Level', l).exists? } if filters.level && filters.level.any?\n filters.units_completed.each { |u| existing_filter_element('Units Completed', u).exists? } if filters.units_completed && filters.units_completed.any?\n filters.major.each { |m| existing_filter_element('Major', m).exists? } if filters.major && filters.major.any?\n existing_filter_element('Last Name', filters.last_name).exists? if filters.last_name\n # TODO - advisors\n filters.ethnicity.each { |e| existing_filter_element('Ethnicity', e).exists? } if filters.ethnicity && filters.ethnicity.any?\n filters.gender.each { |g| existing_filter_element('Gender', g).exists? } if filters.gender && filters.gender.any?\n existing_filter_element('Underrepresented Minority').exists? if filters.underrepresented_minority\n filters.prep.each { |p| existing_filter_element('PREP', p).exists? } if filters.prep && filters.prep.any?\n existing_filter_element('Probation').exists? if filters.probation_coe\n existing_filter_element('Inactive').exists? if filters.inactive_asc\n existing_filter_element('Intensive').exists? if filters.intensive_asc\n filters.team.each { |t| existing_filter_element('Team', t.name).exists? } if filters.team && filters.team.any?\n true\n end\n else\n unsaved_filter_apply_button_element.when_not_visible Utils.short_wait\n wait_until(1) { cohort_filter_row_elements.empty? }\n end\n end", "title": "" }, { "docid": "29de9c595daa1fa2345da571a9bf29d7", "score": "0.52344054", "text": "def valid?\n return false if @filters.nil?\n return false if @filters.length < 1\n return false if @service.nil?\n return false if @type.nil?\n true\n end", "title": "" }, { "docid": "3043e0d60d891fc7a024e0f55c14639b", "score": "0.5208912", "text": "def valid?(mol)\n !(active_filters.map { |f| f.valid?(mol) }.include?(false))\n end", "title": "" }, { "docid": "8098c1e0b7b040d11f81a8d39403db7a", "score": "0.5203502", "text": "def applied_filters?\n self.applied_filters.count > 1\n end", "title": "" }, { "docid": "b3c7b55f6444aeb2ccc336782e57c4df", "score": "0.5200851", "text": "def validate_input\n is_valid_param(@params[:filter], $valid_filters) &\n is_valid_param(@params[:sort], $valid_sort)\n end", "title": "" }, { "docid": "f63dea56306f6e24f4bf0634a150954f", "score": "0.5169926", "text": "def validate_component_compatibility\n # Run validations against remaining components\n conditions.each(&:valid?)\n effects.each(&:valid?)\n\n # Check compatibility\n incompatible = false\n\n # For each effect, there must be at least one condition which is compatible.\n effects.each do |e|\n results = conditions.map do |c|\n Promotions::Scopes.acceptable?(c.condition_scope, e.condition_scope)\n end\n\n if results.none?\n incompatible = true\n e.errors.add(:base, \"This effect is not compatible with any of the specified conditions\")\n end\n end\n\n if incompatible\n errors.add(:base, \"The combination of conditions and effects are not compatible\")\n end\n\n nil\n end", "title": "" }, { "docid": "0c22356615172dd9118f64ca2aed029d", "score": "0.51506567", "text": "def allowed_by_filters?(torrent, filter_chain = self.filters)\n return Filter.allowed?(filter_chain, torrent)\n end", "title": "" }, { "docid": "911425c2311e20a04767acbcd97bb265", "score": "0.5148989", "text": "def composite?\n components.length > 0\n end", "title": "" }, { "docid": "6575dd06f56c9025f881c43f8dce3193", "score": "0.5126943", "text": "def check_filters params\n return false if @@filter.empty? or params.start_with?(\"unfilter\")\n return Regexp.new(\"(#{@@filter.join(\"|\")})\").match(params)\n end", "title": "" }, { "docid": "178b5e626ffb0291f6f8def4e8bcc57f", "score": "0.50975555", "text": "def validate_components!\n notify_observers :before_validate_components!\n\n check_unresolved_components!\n\n required_components.each do | c |\n c.validate_with_resolver!(self)\n end\n\n notify_observers :after_validate_components!\n \n self\n end", "title": "" }, { "docid": "99b0b93e07554f55dfc747503b57eb94", "score": "0.5083194", "text": "def render_constraints_filters(localized_params = nil)\n localized_params ||= params.to_unsafe_h\n facets = localized_params[:f]\n facets = facets.to_unsafe_h if facets.respond_to?(:to_unsafe_h)\n facets ||= {}\n search_state = controller.search_state_class\n facets.map { |facet, values|\n path = search_state.new(localized_params, blacklight_config, controller)\n render_filter_element(facet, values, path)\n }.join(\"\\n\").html_safe\n end", "title": "" }, { "docid": "5d9fa518d6204fa2b68a84f29dda1e40", "score": "0.5075667", "text": "def component_is_valid?\n valid?\n end", "title": "" }, { "docid": "a6d1a099ed7e23f214cddac1812aec17", "score": "0.50624335", "text": "def check_filter_taggings\n current_filters = self.tags.collect{|tag| tag.canonical? ? tag : tag.merger }.compact\n current_filters.each {|filter| self.add_filter_tagging(filter)}\n filters_to_remove = self.filters - current_filters\n unless filters_to_remove.empty?\n filters_to_remove.each {|filter| self.remove_filter_tagging(filter)}\n end\n return true \n end", "title": "" }, { "docid": "a6d1a099ed7e23f214cddac1812aec17", "score": "0.50624335", "text": "def check_filter_taggings\n current_filters = self.tags.collect{|tag| tag.canonical? ? tag : tag.merger }.compact\n current_filters.each {|filter| self.add_filter_tagging(filter)}\n filters_to_remove = self.filters - current_filters\n unless filters_to_remove.empty?\n filters_to_remove.each {|filter| self.remove_filter_tagging(filter)}\n end\n return true \n end", "title": "" }, { "docid": "f4f2de8172df7d8d85af39fe2139ab03", "score": "0.505132", "text": "def has_filters?\n @filters.nil? ? false : @filters.filters.size > 0\n end", "title": "" }, { "docid": "78f71c38c9b59908cb83fd1ecc3ef3e8", "score": "0.49826372", "text": "def no_duplicate_filters\n return true if !active\n DataFileFilter.find_all_by_active_and_negative(true,self.negative).each do |other|\n next if other.id == id # Skip myself\n if expression_clash? other\n errors.add(:expression, \"must not conflict with other expressions. This on conflicts with '#{other.name}'\")\n end\n end\n return true\n end", "title": "" }, { "docid": "f1777de5508805baaf0643a05988dc64", "score": "0.49783403", "text": "def __filter?(filter_tok, invalid_val)\n return true unless filter_tok.id == invalid_val.id\n\n children = invalid_val.segment_tok.element_toks\n filter_tok.element_toks.zip(children) do |f_tok, e_tok|\n if f_tok.simple?\n return true unless f_tok.blank? or f_tok.value == e_tok.value\n elsif f_tok.composite?\n children = e_tok.component_toks\n f_tok.component_toks.zip(children) do |f_com, e_com|\n return true unless f_com.blank? or f_com.value == e_com.value\n end\n elsif f_tok.present?\n raise Exceptions::ParseError,\n \"only simple and composite elements can be filtered\"\n end\n end\n\n false\n end", "title": "" }, { "docid": "f1777de5508805baaf0643a05988dc64", "score": "0.49783403", "text": "def __filter?(filter_tok, invalid_val)\n return true unless filter_tok.id == invalid_val.id\n\n children = invalid_val.segment_tok.element_toks\n filter_tok.element_toks.zip(children) do |f_tok, e_tok|\n if f_tok.simple?\n return true unless f_tok.blank? or f_tok.value == e_tok.value\n elsif f_tok.composite?\n children = e_tok.component_toks\n f_tok.component_toks.zip(children) do |f_com, e_com|\n return true unless f_com.blank? or f_com.value == e_com.value\n end\n elsif f_tok.present?\n raise Exceptions::ParseError,\n \"only simple and composite elements can be filtered\"\n end\n end\n\n false\n end", "title": "" }, { "docid": "09e1830647f6475297ca4d896dc1b432", "score": "0.49780887", "text": "def compose_filters(filters)\n return nil if !filters || filters.empty?\n filters.reduce do |prev, current|\n lambda {|value| prev.call(value) && current.call(value) }\n end\n end", "title": "" }, { "docid": "2cd273390dba70cfba23eaa42ae4dd6e", "score": "0.49750435", "text": "def validate\n\t\tif self.parent_component\n\t \t\tif self.parent_component.parent_component\n\t \t\t\terrors.add(:parent_id, \"Parent Component must not have its own Parent.\")\n\t \t\tend\n\t \tend\n\t \treturn true\n\tend", "title": "" }, { "docid": "283fb81c04150d317115c78afeb6df6d", "score": "0.49727377", "text": "def valid!\n valid_categories! # checking all identifiers\n valid_parents! # parentage on kinds\n valid_actions! # associated actions\n valid_depends! # dependencies on mixins\n valid_applies! # applicability on mixins\n end", "title": "" }, { "docid": "bbc9916e901b5a18306167741b068676", "score": "0.4959451", "text": "def has_non_applied_facets_of_category_filter?\n\t\t\t\t\tself.has_non_applied_facets_of_filter_type?(:category) ||\n\t\t\t\t\tself.has_non_applied_facets_of_filter_type?(:category_second) ||\n\t\t\t\t\tself.has_non_applied_facets_of_filter_type?(:category_third) ||\n\t\t\t\t\tself.has_non_applied_facets_of_filter_type?(:category_fourth)\n\t\t\t\tend", "title": "" }, { "docid": "194994f561aec769f00587154da85ece", "score": "0.49213672", "text": "def validate_array_filters(connection, selector_or_item)\n if selector_or_item.key?(:arrayFilters) &&\n !connection.features.array_filters_enabled?\n then\n raise Error::UnsupportedArrayFilters\n end\n end", "title": "" }, { "docid": "9b75fc6cf48c5b0a652af873e310d5f5", "score": "0.49064654", "text": "def validate_request\n unless params['query'].present?\n self.status_code = 400\n self.error_message = 'Query not present'\n return false\n end\n\n unless parsed_query.present?\n self.parsed_query['query-0'] = \"TX:*\"\n end\n\n if params['filters'].present?\n # only one set of filters alowed\n if !params['filters'].one?\n self.status_code = 400\n self.error_message = \"Only one set of filters alowed.\"\n return false\n end\n\n filters = params['filters'].first['facets']\n\n filters.map! do |f|\n # Check if given keys match required FILTER_KEYS\n if (FILTER_KEYS - f.keys).present?\n self.status_code = 400\n self.error_message = \"Required filter keys are: #{FILTER_KEYS.to_sentence}\"\n return false\n end\n f\n end\n end\n\n self.requested_filters = filters || []\n return true\n end", "title": "" }, { "docid": "352445a0f7c970d4b2e5976ab32a0bb0", "score": "0.48995987", "text": "def render_constraints_filters(my_params = params)\n content = super(my_params)\n\n if advanced_query\n advanced_query.filters.each_pair do |field, value_list|\n label = facet_field_label(field)\n content << render_constraint_element(label,\n safe_join(Array(value_list), \" <strong class='text-muted constraint-connector'>OR</strong> \".html_safe),\n :remove => search_action_path(remove_advanced_filter_group(field, my_params).except(:controller, :action))\n )\n end\n end\n\n content\n end", "title": "" }, { "docid": "76befa20ec60cb912102f238414663a4", "score": "0.48815078", "text": "def set_visible_comps comp, parent=nil\n @visible_comps << [comp, parent]\n end", "title": "" }, { "docid": "6ea814c2976c91c82ffdc7b946b6460e", "score": "0.4879429", "text": "def validate!\n private_methods.select{ |m| m =~ /^validate_[a-z0-9_]+\\!$/ }.each{ |v| send(v) }\n filter.validate! unless filter.nil?\n\n true\n end", "title": "" }, { "docid": "d631b0de9aca90758222b9bd62e2395d", "score": "0.48505852", "text": "def valid_filter_structure?\n operation_value_pairs.all? do |pair|\n pair.is_a?(Hash) && pair.count == 1\n end\n end", "title": "" }, { "docid": "ddb3f6d2916b59e57cae50d4586ee828", "score": "0.48487386", "text": "def render_constraints_filters(req_params = nil)\n req_params ||= params\n # Standard search constraints.\n result = [super(req_params)]\n # Advanced search constraints.\n qp = advanced_query(req_params)\n if qp&.filters&.present?\n op_options = { class: 'text-muted constraint-connector' }\n connector = content_tag(:strong, filter_connector, op_options)\n result +=\n qp.filters.map do |field, values|\n label = facet_field_label(field)\n values = safe_join(Array.wrap(values), connector)\n path = remove_advanced_filter_group(field, req_params)\n opt = { remove: path.except(:controller, :action) }\n render_constraint_element(label, values, opt)\n end\n end\n result.delete_if(&:blank?)\n safe_join(result, \"\\n\")\n end", "title": "" }, { "docid": "05ba3b863c5e885285f74e93e0e2dab9", "score": "0.48385653", "text": "def render_constraints_filters(my_params = params)\n content = super(my_params)\n\n if advanced_query\n advanced_query.filters.each_pair do |field, value_list|\n label = facet_field_label(field)\n content << render_constraint_element(label,\n safe_join(constraint_display_values(field, Array(value_list)), \" <strong class='text-muted constraint-connector'>OR</strong> \".html_safe),\n :remove => search_action_path(remove_advanced_filter_group(field, my_params).except(:controller, :action))\n )\n end\n end\n\n content\n end", "title": "" }, { "docid": "e7d554520d300b10af625f85bb40d508", "score": "0.48291135", "text": "def filter_component(name)\n filtered_component = get_component(name)\n return [] if filtered_component.nil?\n included_components = [filtered_component]\n\n unless filtered_component.build_requires.empty?\n filtered_component.build_requires.each do |build_requirement|\n unless get_component(build_requirement).nil?\n included_components += filter_component(build_requirement)\n end\n end\n end\n included_components.uniq\n end", "title": "" }, { "docid": "abacf18a6081d247e40ca928206bb90d", "score": "0.48253146", "text": "def current_filter?(ctype)\n (ctype.to_name_s('+') == params[:filter])\n end", "title": "" }, { "docid": "abacf18a6081d247e40ca928206bb90d", "score": "0.48253146", "text": "def current_filter?(ctype)\n (ctype.to_name_s('+') == params[:filter])\n end", "title": "" }, { "docid": "acb91ec276003dae342b58a7e017f422", "score": "0.48177725", "text": "def render_constraints_filters(my_params = params)\n content = super(my_params)\n\n if (@advanced_query)\n @advanced_query.filters.each_pair do |field, value_list|\n label = facet_field_labels[field]\n content << render_constraint_element(label,\n value_list.join(\" OR \"),\n :remove => catalog_index_path( remove_advanced_filter_group(field, my_params) )\n )\n end\n end\n\n return content\n end", "title": "" }, { "docid": "fee1940cdbe030191fe8416c7a626ae1", "score": "0.48156124", "text": "def validate(acceptances)\n elements.each do |elt|\n # check the type\n accepted = acceptances.any? {|type| type == :all or elt.kind_of?(type)}\n\n # raise a context error if the type is not accepted\n raise ContextError.new(elt, self) if not(accepted)\n\n # check for inner branches recursively\n if elt.kind_of?(ConditionalBranch)\n elt.validate(acceptances)\n end\n end\n end", "title": "" }, { "docid": "1b45c05853fedc7ffc13dcc2ffe313eb", "score": "0.48070824", "text": "def has_filters?\n options[:filter_specs] or options[:filter_facts] or options[:filter_hiera] or options[:filter_examples]\n end", "title": "" }, { "docid": "05994da9f223ae9c7749e8f89f7baae9", "score": "0.4796765", "text": "def check_filter *args\n check_or_radio_filter :check, *args\n end", "title": "" }, { "docid": "f5eb31d6aa63f05e3cf92548c0c18059", "score": "0.47910634", "text": "def validate_input\n is_valid_option = false\n $valid_options.each { |option|\n if !@params[:option] || @params[:option] == option\n is_valid_option = true\n end\n }\n is_valid_filter = true\n if @params[:option] == 'newest' || @params[:option] == \"vote\"\n is_valid_filter = false\n $valid_filters.each { |filter|\n if !@params[:filter].nil? && @params[:filter] == filter\n is_valid_filter = true\n end\n }\n end\n is_valid_filter & is_valid_option\n end", "title": "" }, { "docid": "0190944b05785c11ccbfcefb25213896", "score": "0.47739837", "text": "def query_has_facetfilters?(localized_params = params)\r\n (generate_next_url.scan(\"facetfilter[]=\").length > 0) or (generate_next_url.scan(\"limiter[]=\").length > 0)\r\n end", "title": "" }, { "docid": "04457772c48e9e822b1bb76029e4eda3", "score": "0.4761117", "text": "def validate_handler_filtering(handler)\n must_be_an_array_if_set(handler[:filters]) ||\n invalid(handler, \"handler filters must be an array\")\n if is_an_array?(handler[:filters])\n items_must_be_strings(handler[:filters]) ||\n invalid(handler, \"handler filters items must be strings\")\n end\n must_be_a_string_if_set(handler[:filter]) ||\n invalid(handler, \"handler filter must be a string\")\n end", "title": "" }, { "docid": "cc20288e11baf5f1c425290067fe9759", "score": "0.47571695", "text": "def required_component? c\n @required_components.include? c\n end", "title": "" }, { "docid": "e5ddaea8a04f3db7cd596dfe695d7c93", "score": "0.47400612", "text": "def includes_components?\n (bundle? || composite? || package?) && component_entries.live.any?\n end", "title": "" }, { "docid": "f06f07642ce9d9147d85bc5a0d606c8c", "score": "0.4730774", "text": "def matches_filters?(lb)\n tags = lb.tags.to_h\n @filters.all? { |f| matches_filter?(tags, f) }\n end", "title": "" }, { "docid": "a69dbe384ed9e3b4f2ef44e13479c776", "score": "0.4728523", "text": "def validate_filter_for_object(object, filters)\n # Unfortunately, setting the 'calendardata' here is optional. If\n # it was excluded, we actually need another call to get this as\n # well.\n\n object = calendar_object(object['calendarid'], object['uri']) unless object.key?('calendardata')\n\n v_object = VObject::Reader.read(object['calendardata'])\n\n validator = CalendarQueryValidator.new\n result = validator.validate(v_object, filters)\n\n # Destroy circular references so PHP will GC the object.\n v_object.destroy\n\n result\n end", "title": "" }, { "docid": "5c209cd8c8ead42e20d4f1fea9bbdbc6", "score": "0.4727333", "text": "def has_specific_components?\n !item_components.empty? || !reagent_components.empty? || !transformation_components.empty?\n end", "title": "" }, { "docid": "5a0211a5ae3761e7b5f6f13ea96735b5", "score": "0.47270432", "text": "def is_allowed?\n self.allowed.include?(@component)\n end", "title": "" }, { "docid": "b892650f9a6d9aaae50baf3fac83454d", "score": "0.47256163", "text": "def check_component(component)\n valid = true\n tag = nil\n\n # see if we can find the component's tag in the taxonomy\n tags = component.tags\n if tags.empty?\n puts '[Check Component ERROR] Component does not have any tags'\n valid = false\n elsif tags.size > 1\n puts '[Check Component ERROR] Component has multiple tags'\n valid = false\n else\n tag = @tag_hash[tags[0].descriptor]\n unless tag\n puts \"[Check Component ERROR] Cannot find #{tags[0].descriptor} in the master taxonomy\"\n valid = false\n end\n end\n\n unless tag\n return false\n end\n\n terms = get_terms(tag)\n\n # TODO: check for all required attributes\n terms.each do |_term|\n # if term.required\n # make sure we find attribute\n # end\n end\n\n # check that all attributes are allowed\n component.attributes.each do |attribute|\n term = nil\n terms.each do |t|\n if t.name == attribute.name\n term = t\n break\n end\n end\n\n unless term\n puts \"[Check Component ERROR] Cannot find term for #{attribute.name} in #{tag.level_hierarchy}\"\n valid = false\n next\n end\n\n # TODO: validate value, datatype, units\n end\n\n valid\n end", "title": "" }, { "docid": "a77d817da92bec072b3d3bc156addf70", "score": "0.47248194", "text": "def process_components(facts, comp_list)\n\n running_components = facts[F_COMPONENTS]\n\n if $debug\n p \"running_components: %s\" % running_components.to_s\n end\n\n # Need to sort list as intersection function is picky about the order values are specified in.\n if running_components != nil\n running_components.sort!\n end\n\n # Send email b/c component(s)s are not online?\n\n # Are the required components running?\n if comp_list != nil\n comp_list.sort!\n if running_components == nil || (running_components & comp_list) != comp_list\n $alert_codes += C_COMPONENT\n # Embolden b/c we found an issue.\n facts[F_COMPONENTS] = '<b>' + running_components.join(\",\") + '</b>'\n end\n end\n\nend", "title": "" }, { "docid": "4b394238781ea859d9f0ec441e14d3d2", "score": "0.47221527", "text": "def is_filtered?\r\n filters.count > 0\r\n end", "title": "" }, { "docid": "133d1e024a69929c148c88e6e9accf95", "score": "0.4717523", "text": "def verify_custom_filter(filter, value, _context = nil)\n [filter, value]\n end", "title": "" }, { "docid": "18eb5866ac7934b32dc2ed50efed2d08", "score": "0.47032392", "text": "def rbac_group_validate?\n return false if @edit[:new][:description].nil?\n\n @assigned_filters = [] if @edit[:new][:filters].empty? || @edit[:new][:use_filter_expression]\n @filter_expression = [] if @edit[:new][:filter_expression].empty? || @edit[:new][:use_filter_expression] == false\n if @edit[:new][:role].nil? || @edit[:new][:role] == \"\"\n add_flash(_(\"A Role must be assigned to this Group\"), :error)\n return false\n end\n true\n end", "title": "" }, { "docid": "e280be09b2c8ae297a6dbabcbb9805cb", "score": "0.4690431", "text": "def valid?\n filter_group_list = @user_key.whitelists.restrict_to(@resource).to_a.map{|w| w.filters.to_a}\n # If the key has no whitelists at all, the key has no access through normal filters.\n # (If the key has no columns, the key has no access at all, but we check for that in EndpointResponse.)\n # Map the filters for each individual whitelist into a list to be checked.\n for filter_group in filter_group_list\n return true if matches_options?(filter_group)\n end\n # No filters were matched, so check for organizations instead.\n return has_valid_organization_id?\n end", "title": "" }, { "docid": "b5ef0edc372de8a02114850305e63732", "score": "0.4678805", "text": "def validate_requested_channels(channels)\n if channels.count > @output.num_channels\n message = \"Only #{@output.num_channels} channels available on #{@output.name} output\"\n raise(InvalidChannels.new(message))\n false\n end\n true\n end", "title": "" }, { "docid": "8bf91e0070cee3c82055ed55da6b9274", "score": "0.46776167", "text": "def validate_filter(filter_name)\n exists = false\n @driver.find_elements(\n @row_filter_name[:type], @row_filter_name[:value]\n ).each do |row|\n next unless row.text == filter_name\n row.displayed?\n exists = true\n break\n end\n # if filter does not exist fail the test\n if !exists\n fail('Filter: ' + filter_name + ' does not exist')\n end\n end", "title": "" }, { "docid": "f816e0666f5cb39807214369a03264a6", "score": "0.46567935", "text": "def test_composite_module_filter__module_and_method_match\n composite_filter = Module_composite_filter_A\n \n context = {}\n context.set_context :modules => [\"Hobo\", \"Dryml\"], :method_name => \"build_a\" #, :class_name => \"Dryml\" \n \n options = {:filters => composite_filter} \n exec = Tracing::Filter::Executor.new(options) \n result = exec.filters_allow?('msg', context)\n assert_equal true, result, \"Filter should allow passage\" \n end", "title": "" }, { "docid": "8cc834b9b6d5bb5a3d64093d3be22572", "score": "0.46565822", "text": "def check_unresolved_components!\n return self unless unresolved_components? \n return self if unresolved_components_ok?\n\n notify_observers :before_check_unresolved_components\n\n msg = ''\n\n unresolved_components.each do | name, x |\n msg << <<\"END\"\ncabar:\n version: #{Cabar.version.to_s.inspect}\n error:\n message: \"Connot resolve component\"\n component: #{name.inspect}\nEND\n\n msg << \" for:\\n\" \n x.each do | data |\n msg << \" - #{data[:dependent].inspect}\\n\"\n end\n\n msg << <<\"END\"\n available:\n #{\n available_components.\n select(:name => name).to_a.\n map{|c| \"- #{c.to_s.inspect}\"}.\n join(\"\\n \")}\n selected:\n #{\n (selected_components.\n selections[name] || EMPTY_ARRAY).map do | q |\n#$stderr.puts \"name = #{name.inspect}\"\n#$stderr.puts \"x = #{x.inspect}\"\n#$stderr.puts \"q = #{q.inspect}\"\nq = q.to_hash unless Hash === q\n \"constraint: %s\\n %s\" % [ (q[:version] || '<<ANY>>').to_s.inspect, \"by: #{q[:_by].to_s.inspect}\" ]\n end.\n join(\"\\n \")}\n---\nEND\n end\n# rescue Exception => err\n# $stderr.puts msg\n# ensure\n $stderr.puts msg\n raise Error, \"UnresolvedComponent\"\n end", "title": "" }, { "docid": "71791dc701fba8e9eca08c9989d9c660", "score": "0.46557736", "text": "def render_constraints_filters(localized_params = params)\n return \"\".html_safe unless localized_params[:f]\n content = []\n localized_params[:f].each_pair do |facet,values|\n content << render_filter_element(facet, values, localized_params)\n end\n\n safe_join(content.flatten, \"\\n\") \n end", "title": "" }, { "docid": "047132364430edcf34b479915eb25ec4", "score": "0.46546042", "text": "def refute_has_child parent, kind, filters = {}, &block\n result = ax_check_children parent, kind, filters, block\n msg = message {\n \"Expected #{parent.inspect} NOT to have #{result} as a child\"\n }\n assert result.blank?, msg\n result\n end", "title": "" }, { "docid": "04b4c36bfdf461258d078c4307a52743", "score": "0.46499702", "text": "def parse_current_filters\n @current_filters = ServiceCatalographer::Filtering.convert_params_to_filters(params, controller_name.downcase.to_sym)\n puts \"*** @current_filters = #{@current_filters.inspect}\"\n end", "title": "" }, { "docid": "3701511beac5531baf953281a56d226e", "score": "0.46432284", "text": "def check_component\n reject unless component\n rescue ComponentNotFoundError\n reject\n end", "title": "" }, { "docid": "5618239716280772ea390b9a24c4ed10", "score": "0.46431094", "text": "def can_manage_saved_filters?\n role?(Roles::PUBLIC_HEALTH) || role?(Roles::CONTACT_TRACER) || role?(Roles::PUBLIC_HEALTH_ENROLLER) || role?(Roles::SUPER_USER)\n end", "title": "" }, { "docid": "f689c598a0e459fd4cab9aaff8e17331", "score": "0.46393964", "text": "def _filters_form_required?\n _form[:verb].present?\n end", "title": "" }, { "docid": "2ccd1aa387c51eb774de2bcad41ad3a8", "score": "0.46272093", "text": "def validate_filter(filter)\n must_be_boolean_if_set(filter[:negate]) ||\n invalid(filter, \"filter negate must be boolean\")\n must_be_a_hash(filter[:attributes]) ||\n invalid(filter, \"filter attributes must be a hash\")\n validate_filter_when(filter) if filter[:when]\n end", "title": "" }, { "docid": "7cc4e1819321425b9193fae657ca6581", "score": "0.46257636", "text": "def validate_filter_value(value, filter_type)\n catalog = filter_type.to_s == \"e\" ? Dtn.listed_markets_catalog : Dtn.security_types_catalog\n v = value.is_a?(Array) ? value : value.to_s.split.map(&:to_i)\n v.each { |el| catalog.registered?(el) || raise(\"Missing #{el} in #{catalog.name} catalog\") }\n value\n end", "title": "" }, { "docid": "8ef661689de950d821ddf67a2b0e4e0d", "score": "0.46105748", "text": "def filter_constraints(filter_params)\n self.class.constraints filter_params, self_and_descendants.ids\n end", "title": "" }, { "docid": "aa16ff743da5d87164a02c819e4eb506", "score": "0.4610331", "text": "def process_course(year, course, cohort = nil, filters = nil)\n # The course must pass all filters\n return false unless filter(year, course, cohort, filters)\n # Get the course instructors\n course_instructors = instructors(year, course, cohort)\n # Pass the details to the block\n yield(year, course, cohort, course_instructors) if block_given?\n # Indicate that the course was processed\n true\n end", "title": "" }, { "docid": "292555f8d20f5f7cdfc7b9a919df4175", "score": "0.46101785", "text": "def safe_filter(filters = {}, meta = {})\n\n filter(filters, meta, true)\n\n self\n\n end", "title": "" }, { "docid": "ff4f211da13d6ace7becce5fe7a07055", "score": "0.46101213", "text": "def validate(path=\".\")\n filter = options[\"filter\"] || \"[^_]*.html\"\n \n puts \"Filtering on #{options[\"filter\"]}\" if options[\"filter\"]\n \n if File.directory?(path)\n any_invalid = false\n \n if (files = Dir.glob(\"#{path}/**/#{filter}\")).any?\n \tfiles.each do |file|\n \t\tif !self.w3cvalidate(file)\n \t\t any_invalid = true\n \t end\n \tend\n \tif !any_invalid\n \t puts \"All files were considered valid\"\n end\n else\n puts \"No files matched \\\"#{filter}\\\"\"\n end\n elsif File.readable?(path)\n self.w3cvalidate(path)\n else\n puts \"No such file/directory #{path}\"\n end \n end", "title": "" }, { "docid": "0f16de1fd700f5e5ef8304de4de76595", "score": "0.4593623", "text": "def render_constraints_filters_side(localized_params = params)\n return \"\".html_safe unless localized_params[:f]\n content = []\n localized_params[:f].each_pair do |facet,values|\n content << render_filter_element_side(facet, values, localized_params)\n end\n\n safe_join(content.flatten, \"\\n\") \n end", "title": "" }, { "docid": "5f093deaf2112b98cd7fd7920deeaeb1", "score": "0.4586262", "text": "def validate_nested_forms\n # If no nested forms are present in the class, just return true since\n # no validation should be tested\n return true unless nested_forms\n\n # Run all validations on all nested forms and ensure they're all valid\n nested_forms.map do |name, form|\n if object.respond_to?(name) && (resource = object.send(name)) &&\n !(resource.respond_to?(:marked_for_destruction?) && resource.marked_for_destruction?)\n then\n valid = Array.wrap(resource).map { |m| form.new(m, step, clear: @clear_cart_errors).validate }.all?\n # Bubble up nested errors\n errors.add(name, :invalid) unless valid\n\n valid\n else\n # Nested validations shouldn't be run on undefined relations\n true\n end\n end.all?\n end", "title": "" }, { "docid": "712aaf3abf5ade1747eaf01dc1e85a65", "score": "0.4584634", "text": "def validate!(props)\n\n end", "title": "" }, { "docid": "f5e05e8bacd3c0c2059568ebab244402", "score": "0.45815673", "text": "def filter_block?(filter) #:nodoc:\n filter.respond_to?('call') && ( filter.arity >= 1 || filter.arity <= -1 )\n end", "title": "" }, { "docid": "fb5a1c78b93814d002f2cdf6d244ecbf", "score": "0.45779955", "text": "def match?(entity, component, action)\n actions.include?(action) &&\n components.include?(component.class) &&\n entity.components.map(&:class) & system.filter == system.filter\n end", "title": "" }, { "docid": "7f6b9000d0daae53783530fdb96ccce8", "score": "0.4576504", "text": "def validate_params\n @connector_plugins.each_value do |connector|\n connector.validate_params if connector.respond_to?(:validate_params)\n end\n end", "title": "" }, { "docid": "180ef0a0eff48c71fb7e999703c27cb2", "score": "0.45764574", "text": "def test_composite_class_filter__class_and_method_match\n composite_filter = Class_composite_filter_A\n \n context = {:class_name => \"Hobo::Dryml\", :method_name => \"build_a\"}.context\n \n options = {:filters => composite_filter} \n exec = Tracing::Filter::Executor.new(options) \n result = exec.filters_allow?('msg', context)\n assert_equal true, result, \"Filter should allow passage\" \n end", "title": "" }, { "docid": "811ec57279c7c79bb78147676c08d2eb", "score": "0.45717585", "text": "def push_filters_match?(client, filters)\n return true if filters.nil?\n\n filters = filters.is_a?(Array) ? filters : [filters]\n filters.each do |filter|\n return true if filter.nil?\n\n case filter.scope\n when PushFilter::SOLAR_SYSTEM\n current = current_ss_id(client)\n return true if current == filter.id\n debug \"Push filtered: wanted SS #{filter.id}, had #{current.inspect}\",\n to_s(client)\n when PushFilter::SS_OBJECT\n current = current_planet_id(client)\n return true if current == filter.id\n debug \"Push filtered: wanted SSO #{filter.id}, had #{current.inspect}\",\n to_s(client)\n else\n raise ArgumentError.new(\"Unknown filter scope: #{filter.scope.inspect}\")\n end\n end\n\n false\n end", "title": "" }, { "docid": "795364403e37a7feabf489056b3c4823", "score": "0.45678082", "text": "def no_filters?\n @inclusive_filters.empty? && @exclusive_filters.empty?\n end", "title": "" }, { "docid": "6a99206df0d8fdfce68433379d466edc", "score": "0.45573363", "text": "def pass_filter(value, filters)\n for f in filters\n if $filters.has_key? f\n func = $filters[f]\n begin\n value = func.call value\n rescue => err\n puts err\n exit()\n end\n end\n end\n return value \n end", "title": "" }, { "docid": "f40360f64e09bcbd950a31f804aa4d5c", "score": "0.45538786", "text": "def filter *filters\n spawn :@filters, @filters + parse_filter_input(filters)\n end", "title": "" }, { "docid": "6a8aa953696fe0ff73843414ba3aa41c", "score": "0.45481467", "text": "def apply_filters\n if @filters.present?\n @filters.map {|i| i[1]}.each do |filter|\n unless apply_filter(filter)\n @query = @query.none\n\n return\n end\n end\n end\n end", "title": "" }, { "docid": "00432f278699d1784c4aa755d11c98a4", "score": "0.4531245", "text": "def filters? params\n filter = nil\n @filters.keys.each { |c| break if filter = filter?(c, params) }\n filter\n end", "title": "" }, { "docid": "b8f362fdd28ea78b4f3aaa5c6dda8e8d", "score": "0.45233196", "text": "def pass_filters?(filterArray, userID)\n pluginDataHash = Rails.cache.read(\"#{userID}/pluginDataHash\").with_indifferent_access\n passAllFilters = true\n\n filterArray.each do |filter|\n comparator = filter.scan(/\\${2}\\w+/)[0].sub(/../,\"\")\n variables = filter.scan(/\\#{2}\\w+/)\n var1 = variables[0].sub(/../,\"\")\n var1 = pluginDataHash[var1]\n var2 = variables[1].sub(/../,\"\")\n if var2 == \"true\"\n var2 = true\n elsif var2 == \"false\"\n var2 = false\n else\n var2 = pluginDataHash[var2]\n end\n if comparator == \"between\"\n var3 = variables[2].sub(/../,\"\")\n var3 = pluginDataHash[var3]\n passFilter = send(comparator, var1, var2, var3)\n else\n passFilter = send(comparator, var1, var2)\n end\n\n if not passFilter\n passAllFilters = false\n end\n\n return passAllFilters\n end\n end", "title": "" }, { "docid": "dd579a3cdc3fc17018b561a01bcc7e28", "score": "0.4521022", "text": "def filters(event_data)\n return false unless filter_repeated(event_data)\n return false unless filter_silenced(event_data)\n return false unless filter_dependencies(event_data)\n return false unless filter_disabled(event_data)\n\n @logger.info(\"#{event_data[:client][:name]}/#{event_data[:check][:name]} not being filtered!\")\n\n true\n end", "title": "" }, { "docid": "c1b3ae3c7652b859fc3586b75489854b", "score": "0.45204812", "text": "def filtered?\n filters.size > 0\n end", "title": "" }, { "docid": "3f94eddc25f0dff4d672dbd3f9069d7f", "score": "0.45196107", "text": "def filter_block?(filter) #:nodoc:\n filter.respond_to?('call') && ( filter.arity >= 1 || filter.arity <= -1 )\n end", "title": "" }, { "docid": "799961775aa60c22d483fb5e5f2cc390", "score": "0.45144838", "text": "def validate_proposal_elements proposal_elements\n # moved to barclamp.is_valid? deployment\n end", "title": "" }, { "docid": "46fdd951107232e3d04928870a2a0e40", "score": "0.45101064", "text": "def each(*filters, &block)\n if filters.nil? || filters.empty?\n # Avoid calling self.filter() if there are no filters defined\n self.courses.each do |course|\n course.cohorts.each { |cohort| block.call(course, cohort) }\n end\n else\n # Use the defined filters\n self.courses.each do |course|\n course.cohorts.each { |cohort| block.call(course, cohort) if filter(course, cohort, filters) }\n end\n end\n end", "title": "" }, { "docid": "c14927b364f35f096472e07d77ba9f19", "score": "0.4507827", "text": "def filtered?\n applied_filters.any?\n end", "title": "" }, { "docid": "c1cdd46158780947fdca7117a848d319", "score": "0.45072964", "text": "def components\n self.contains_resources\n end", "title": "" }, { "docid": "c2b315f7b7c3922cd287fa8e4d61ec4e", "score": "0.45066252", "text": "def validate_filter(filter)\n if filter.detect { |i| instance_id?(i) }\n instance_ids = filter.select { |i| instance_id?(i) }\n instance_ids.size == filter.size\n else\n true\n end\n end", "title": "" } ]
4d15f4e2b71ae76a2200d20ef1a35c66
Removes the block without putting it back in the frontier
[ { "docid": "f5faf7a8b8827a363047593871c23d47", "score": "0.0", "text": "def sweep(block:, name: )\n record(block: block, name: name)\n\n block.lines.each(&:mark_invisible)\n frontier.register_indent_block(block)\n end", "title": "" } ]
[ { "docid": "e22a0d65d22121b2d14bd50db2c8948b", "score": "0.74544966", "text": "def remove_block\r\n block = params[:block].to_s.underscore\r\n @user = User.current\r\n # remove block in all groups\r\n layout = @user.pref[:graph_alloc] || {}\r\n %w(top left right).each {|f| (layout[f] ||= []).delete block }\r\n @user.pref[:graph_alloc] = layout\r\n @user.pref.save\r\n redirect_to personalise_index_project_gr_graphs_path\r\n end", "title": "" }, { "docid": "2b6a467861596fdc23fffd7b3ba762e7", "score": "0.74193317", "text": "def remove_block\r\n block = params[:block]\r\n # remove block in all groups\r\n %w(top left right).each {|f| (session[:page_layout][f] ||= []).delete block }\r\n render :nothing => true\r\n end", "title": "" }, { "docid": "540bd4b427c031b1e6eb0956301ce187", "score": "0.7247569", "text": "def block_removed(block, data); end", "title": "" }, { "docid": "d7095687f73ab1544eb4d6110aec26d3", "score": "0.7077706", "text": "def clear_blocks\n @blocks = []\n end", "title": "" }, { "docid": "e51d7c648665f49ea6ffde06a1a8678f", "score": "0.68590724", "text": "def undraw\n @original_blocks.each_pair do |block, block_type|\n @sessions.delete(block)\n block.change_type block_type\n end\n @original_blocks = {}\n end", "title": "" }, { "docid": "cc46fc159b3187bf67fd1c3204baf69d", "score": "0.6852547", "text": "def remove(&remove_block)\n @remove_block = remove_block\n end", "title": "" }, { "docid": "b4b592ea4565868253f5da71fbc0d199", "score": "0.68285537", "text": "def destroy_block(&block)\n shrine_class.opts[:backgrounding][:destroy_block] = block if block\n shrine_class.opts[:backgrounding][:destroy_block]\n end", "title": "" }, { "docid": "b4b592ea4565868253f5da71fbc0d199", "score": "0.68285537", "text": "def destroy_block(&block)\n shrine_class.opts[:backgrounding][:destroy_block] = block if block\n shrine_class.opts[:backgrounding][:destroy_block]\n end", "title": "" }, { "docid": "a116398ebfb98f1e6422246d62f43dfa", "score": "0.6801183", "text": "def delete_hotel_block(hotel_block)\n hotel_blocks.delete(hotel_block)\n end", "title": "" }, { "docid": "8b279e84dd0ee4994a5aaa2708fa62ee", "score": "0.6694266", "text": "def discard\n @args = nil\n @block = nil\n end", "title": "" }, { "docid": "7f70621f2a5a62350548afc5538a640d", "score": "0.66836", "text": "def undraw(me)\n block = me.target_block\n instance = @blocks[block]\n instance.undraw if instance && (me.op? || me == instance.player)\n end", "title": "" }, { "docid": "da2387dffd977690234685445c6757bb", "score": "0.65592194", "text": "def delete_sub_blocks\n @sub_blocks = {}\n end", "title": "" }, { "docid": "d9285a787436da8a0249122e07a42d65", "score": "0.6513288", "text": "def strip_block(block_name)\n print \"Stripping block {block:#{block_name}}...\"\n if self.gsub!(ThemeSnippet.block_regex_pattern_for(block_name), '')\n puts \"removed!\"\n else\n puts \"no match found!\"\n end\n end", "title": "" }, { "docid": "2b0c62a22622d4a90ff9b1616d163d63", "score": "0.65074575", "text": "def remove\n raise NotImplementedError, \"todo\"\n # loop through all the meta blocks\n # fetch the block\n # loop through all items in the block\n # if the conditional returns true, remove the item\n #\n # NOTE: should we compact here? This is probably the easiest to do, since\n # compacting is only necessary when removing items, as keys may be unbalanced\n #\n # rebalance keys/items if necessary with surrounding blocks\n end", "title": "" }, { "docid": "21260d2e1c17ca00c8c3fb4dcbd187e9", "score": "0.64746696", "text": "def clear_block(name)\n raise ArgumentError, \"You need to specify name of block to clear.\" if name.nil?\n self.template.blocks[name] = String.new\n end", "title": "" }, { "docid": "2062896283c0bb126a129b1d1f37f428", "score": "0.64746505", "text": "def reset\n @blocks = []\n end", "title": "" }, { "docid": "30335eb0f71705455e0d0010534a8c9a", "score": "0.64264846", "text": "def destroy_block(&block)\n @destroy_block = block if block\n @destroy_block\n end", "title": "" }, { "docid": "30335eb0f71705455e0d0010534a8c9a", "score": "0.64264846", "text": "def destroy_block(&block)\n @destroy_block = block if block\n @destroy_block\n end", "title": "" }, { "docid": "0ab26f689f639d274658462164525e41", "score": "0.64253384", "text": "def clear_dangling_blocks!\n # TODO PERFORMANCE\n # optimize via sql\n # \n # NOTE is this an active record issue?\n # \n # > @note.blocks.where.not(id: child_block_ids).destroy_all\n # does not work\n\n # NOTE not using #child_blocks, to not wasting performance for ordering\n Block.where(parent: self).find_each do |b|\n unless child_block_ids.include? b.id\n b.destroy!\n end\n end\n end", "title": "" }, { "docid": "e6cb2f8c29fb0fe5ba7ddd247c6e08d7", "score": "0.6408681", "text": "def destroy\n @editorial_block = EditorialBlock.find(params[:id])\n @editorial_block.destroy\n\n redirect_to page_layout_path\n end", "title": "" }, { "docid": "34a190b91b8089b8536effd6ebb7d4af", "score": "0.63623506", "text": "def unblock(options = {})\n @req.post(\"/1.1/blocks/destroy.json\", options)\n end", "title": "" }, { "docid": "aa8065debc51e064d8c439141e0e0ca7", "score": "0.63411355", "text": "def unblock()\n merge(unblock: 'true')\n end", "title": "" }, { "docid": "05fd3e54a02c26a9f79f51021768976d", "score": "0.632266", "text": "def delete_if(&block); end", "title": "" }, { "docid": "7ecd7751086d2e1c9f415b748e318d9b", "score": "0.6315509", "text": "def remove!()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "7ecd7751086d2e1c9f415b748e318d9b", "score": "0.6315509", "text": "def remove!()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "e429127deaa867cd85973187df2bbe0b", "score": "0.63085544", "text": "def destroy\n @block = Block.find(params[:id])\n @page = @block.page\n @section = @page.section\n @block.destroy\n\n respond_to do |format|\n format.html { redirect_to([@section,@page]) }\n format.js { render :js => \"$('.block_#{params[:id]}').remove()\" }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "12178fe2785e6aa9a74dbf67bfd0adeb", "score": "0.62994295", "text": "def prune_basic_blocks(blocks); end", "title": "" }, { "docid": "a387506ce8d880283b0d1f3b23c2de01", "score": "0.62946796", "text": "def remove_line(start_row)\n start_row.downto(1).each { |row| @blocks[row] = @blocks[row - 1] }\n @blocks[0] = Array.new(COLUMNS, 0)\n end", "title": "" }, { "docid": "1a27ffa70d4a75f1d732ab7956709583", "score": "0.6268577", "text": "def delete_at(i)\n @blocks.delete_at(i)\n end", "title": "" }, { "docid": "51c6bdd8e121665aef98cc9700a1f8b1", "score": "0.6266594", "text": "def destroy\n @block.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fec26b3104e3667b869f982e96afe8ad", "score": "0.62651825", "text": "def delete_at(i)\n @blocks.delete_at(i)\n end", "title": "" }, { "docid": "2b025bde09be56183150b01f32788493", "score": "0.625742", "text": "def cancel_block\n @first_index = @last_index = nil\n @inside_block = false\n end", "title": "" }, { "docid": "c993b50607d7d1e3fb02da75087551b2", "score": "0.6231839", "text": "def unblock(id)\n users(request(\"blocks/destroy/#{id}.xml\", :auth => true, :method => :post)).first\n end", "title": "" }, { "docid": "130e44822df8f1a359101fc3eac831b2", "score": "0.622385", "text": "def main_area_off\n\t\tself.each do |w|\n \t\t\tself.remove( w )\n\t\tend\n\tend", "title": "" }, { "docid": "c4bc4096aedfb9286f16b4a8c70c7131", "score": "0.6222565", "text": "def clean_up(&block)\n if block_given?\n @scene_clean_block = block\n else\n @scene_clean_block.call if @scene_clean_block\n end\n end", "title": "" }, { "docid": "10c751c08166a62c0d1aef04e1ec9270", "score": "0.6220739", "text": "def flush!\n 0.upto(blocks.length) { blocks.pop }\n end", "title": "" }, { "docid": "9934f5d984462c4df220f0ee9f3dc387", "score": "0.62060446", "text": "def discard\n end", "title": "" }, { "docid": "67510dd19bbbc6e3f0745e6f12a59a07", "score": "0.6201514", "text": "def destroy_background\n fail Error, \"destroy block is not registered\" unless destroy_block\n\n background_block(destroy_block)\n end", "title": "" }, { "docid": "a5083d8a7c8abe437c8707cde0146aa9", "score": "0.6198014", "text": "def reset\n @blocks = {}\n end", "title": "" }, { "docid": "22adde0531e37e06ce3b2e0a9cd05bb2", "score": "0.6196397", "text": "def unblock(id)\n post(\"/blocks/destroy/#{id}.json\")\n end", "title": "" }, { "docid": "2b06d91ac9bfb541fa650af07b3d4beb", "score": "0.6129819", "text": "def unmunge(&block)\n # No implementation required (unmunging will occur on the agent)\n nil\n end", "title": "" }, { "docid": "220b8e7bef79c3b1615298de10df4cf2", "score": "0.6102245", "text": "def remove_resource(&block)\n removed_item = @items.shift\n yield removed_item if block\n end", "title": "" }, { "docid": "e790f9b871f55339257d8b7924908456", "score": "0.6093268", "text": "def remove!; end", "title": "" }, { "docid": "0f0dc0aa98bbd1e82a2d7d2fe64945c5", "score": "0.60816664", "text": "def destroy\n sample = Sample.where(sample_tag: @block.block_tag).first\n sample.update(blocked: false, included: false)\n @block.destroy\n respond_to do |format|\n format.html { redirect_to inform_path(@inf), notice: 'Block was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9e0844a3a526ffdf783c2e1ba187f10c", "score": "0.60703427", "text": "def remove_front\n end", "title": "" }, { "docid": "31e3aca57eac1496456a31c2a4369f5e", "score": "0.60691667", "text": "def destroy\n @block.destroy\n respond_to do |format|\n format.html { redirect_to :root }\n end\n end", "title": "" }, { "docid": "951383a9841f9be9ea38fa85e93a9f43", "score": "0.60531086", "text": "def unload!\n ActionBlocks.unload!\n @@loaded = false\n end", "title": "" }, { "docid": "7568fccb2bf4ca4e3931db9455cd574b", "score": "0.60497105", "text": "def cleanup\n # Check we don't have flowing water\n @window.emit(:flow_blocked) if water_flowing?\n\n # Remove neighbour references\n Direction.cardinals.each do |side|\n neighbour = send(\"#{side}_neighbour\")\n our_side = \"#{Direction.opposite_side(side)}_neighbour=\"\n neighbour.send(our_side, nil) if neighbour\n end\n end", "title": "" }, { "docid": "8939a39797669141fb15ab6894d8af02", "score": "0.6044081", "text": "def discard!\r\n @buffer.clear\r\n end", "title": "" }, { "docid": "b357595a04edef3ed31f3fd634a12231", "score": "0.60342795", "text": "def purge \r\n\t\t@head = nil\r\n\t\t@tail = nil\r\n\tend", "title": "" }, { "docid": "4836dd75f83eb0dff6c53759b82fee61", "score": "0.6021813", "text": "def destroy\n @block = Block.find(params[:id])\n @block.destroy\n\n respond_to do |format|\n format.html { redirect_to edit_post_url(@post) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "16ea3c7de1f36ebb4c4ae8414485aae4", "score": "0.6017419", "text": "def reset!\n @latest_block_number = nil\n end", "title": "" }, { "docid": "cf469d015840667eee18366c7bb6ab08", "score": "0.6014376", "text": "def remove; end", "title": "" }, { "docid": "cf469d015840667eee18366c7bb6ab08", "score": "0.6014376", "text": "def remove; end", "title": "" }, { "docid": "cf469d015840667eee18366c7bb6ab08", "score": "0.6014376", "text": "def remove; end", "title": "" }, { "docid": "cf469d015840667eee18366c7bb6ab08", "score": "0.6014376", "text": "def remove; end", "title": "" }, { "docid": "cf469d015840667eee18366c7bb6ab08", "score": "0.6014376", "text": "def remove; end", "title": "" }, { "docid": "a46bb1ded2f4b24060c1ac037bf5afc3", "score": "0.5987686", "text": "def destroy_attached\n if destroy? && destroy_block\n destroy_background\n else\n super\n end\n end", "title": "" }, { "docid": "a46bb1ded2f4b24060c1ac037bf5afc3", "score": "0.5987686", "text": "def destroy_attached\n if destroy? && destroy_block\n destroy_background\n else\n super\n end\n end", "title": "" }, { "docid": "06d32561abbaffc5f631d7787dc1aba8", "score": "0.59855187", "text": "def remove!(_)\n nil\n end", "title": "" }, { "docid": "b0f264f2087f31d45ddd5f12a40cf243", "score": "0.5983249", "text": "def discard!\n @size -= 1 if @acquired_resources.delete(Fiber.current)\n self\n end", "title": "" }, { "docid": "07b288fd956708c405b826cd6fb0f370", "score": "0.5980515", "text": "def decline\n self.destroy\n end", "title": "" }, { "docid": "e7383e5c146a1e11af9f763e97c571a0", "score": "0.5974848", "text": "def removed!; end", "title": "" }, { "docid": "4b65c20ca3cebf7c8bfb43e3feeb0d29", "score": "0.5972535", "text": "def drop_all_the_way\n if @game.is_running?\n ran = @current_block.drop_by_one\n @current_pos.each{|block| block.remove}\n while ran\n @score += 1\n ran = @current_block.drop_by_one\n end\n draw\n store_current\n if !game_over?\n next_piece\n end\n @game.update_score\n draw\n end\n end", "title": "" }, { "docid": "432a772c6502878f50c8039955347de1", "score": "0.5966262", "text": "def discard; end", "title": "" }, { "docid": "432a772c6502878f50c8039955347de1", "score": "0.5966262", "text": "def discard; end", "title": "" }, { "docid": "432a772c6502878f50c8039955347de1", "score": "0.5966262", "text": "def discard; end", "title": "" }, { "docid": "ba910e4c9336337831edcaa958364da1", "score": "0.5957514", "text": "def destroy\n @block.destroy\n respond_to do |format|\n format.html { redirect_to blocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "af8e5d5601161d29b23f91caf587b8ae", "score": "0.5951848", "text": "def discard!; end", "title": "" }, { "docid": "af8e5d5601161d29b23f91caf587b8ae", "score": "0.5951848", "text": "def discard!; end", "title": "" }, { "docid": "401af6a1d2df71629be3979a51cfc363", "score": "0.5949623", "text": "def discard!\n @size -= 1 if @acquired_resources.delete(Fiber.current)\n end", "title": "" }, { "docid": "1ebfa281a952b3315f165ad6fecaa6d0", "score": "0.5948887", "text": "def soft_drop\n @y += 1\n @blocks.each { |block| block.y += 1 }\n end", "title": "" }, { "docid": "178cc7c3958b25cc4ada84af1883517e", "score": "0.59418714", "text": "def destroy\n @block = Block.find(params[:id])\n @page = @block.col.row.page\n @block.destroy\n\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b46aad6a397dc21d454ec96988536395", "score": "0.593017", "text": "def uncached(&block); end", "title": "" }, { "docid": "49375cd192bc8421ee515b33e3f8d32b", "score": "0.5923228", "text": "def remove_card_if(&block)\n matches = self.select { |card| yield(card) }\n matches.collect { |match| self.delete(match) }\n end", "title": "" }, { "docid": "aa127653e7861de4caa141638c1c14a2", "score": "0.5914211", "text": "def destroy\n @block.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "227eea3c52e0991731c5ad248111360a", "score": "0.5910941", "text": "def destroy\n @block = Block.find(params[:id])\n @block.destroy\n\n respond_to do |format|\n format.html { redirect_to(blocks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ef851dd73f1deae8d43ec3cd41ff34aa", "score": "0.58947283", "text": "def remove_sprite options, &block\n \n end", "title": "" }, { "docid": "af82a734dd7a77518e45f996390927e4", "score": "0.58944315", "text": "def purge(save_block)\n save_block.call(@key, @data)\n @data = EMPTY\n end", "title": "" }, { "docid": "26a81eda6291acd95760aa3f23e44de1", "score": "0.5893181", "text": "def destroy\n @block = Block.find(params[:id])\n @block.destroy\n\n respond_to do |format|\n format.html { redirect_to blocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "49ee633ac77932d2bd635719d8ed49e8", "score": "0.5891531", "text": "def destroy\n @block.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b4a091d32e1227046dd7a701f908526c", "score": "0.58884275", "text": "def strip_block(block)\n block.strip\n end", "title": "" }, { "docid": "2eb78611dee54ef7c0cdf433b55a7be3", "score": "0.5883869", "text": "def without_undo(&block)\n undo_manager.without_undo(&block)\n end", "title": "" }, { "docid": "cb5acd8e90cf86725e785b9d837e63ae", "score": "0.5877658", "text": "def destroy\n @teaser_block.destroy\n respond_to do |format|\n format.html { redirect_to teaser_blocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "928d16af40144bee7dda94caf4be3d8d", "score": "0.5876448", "text": "def removed; end", "title": "" }, { "docid": "2c3e77594bb2c407b78a9bb20d560bdb", "score": "0.5865013", "text": "def remove_car\n\t\t@car = nil\n\t\t@is_slot_free = true\n\tend", "title": "" }, { "docid": "0fd19c67d2507c079092ce0fbfc0c042", "score": "0.5858619", "text": "def delete_if(&block)\n i = 0\n lim = size\n while i < lim\n break if block.call(self.__at(i) )\n i += 1\n end\n\n fill_idx = i\n while i < lim\n el = self.__at(i)\n unless block.call(el)\n self.__at_put(fill_idx, el)\n fill_idx += 1\n end\n i += 1\n end\n self.size=(fill_idx)\n self\n end", "title": "" }, { "docid": "b90f07d0ea1eca7b6cf9709b9f1e1b0c", "score": "0.5854942", "text": "def delete_tag_if(&block); end", "title": "" }, { "docid": "5e406645a67babdca25151293c98a47e", "score": "0.58544236", "text": "def remove_at(slot)\n @data[slot] = nil\n end", "title": "" }, { "docid": "b262d29846839e2e5f53b523bb189d3b", "score": "0.5854247", "text": "def remove(&proc)\n out = @fragments.select(&proc)\n @fragments -= out\n @filtered_fragments.delete_if { |fragment, content| out.include?(fragment) }\n out\n end", "title": "" }, { "docid": "3c8cdc4b3d3064095db10744e2ee6105", "score": "0.5852642", "text": "def unblock_input\r\n AI.BlockInput(0)\r\n end", "title": "" }, { "docid": "5bf584aa5cbf734fc260fafb26b884dd", "score": "0.584529", "text": "def reject(&block)\n self.dup.delete_if(&block)\n end", "title": "" }, { "docid": "98abc77c3915eb5930bca72b3750750e", "score": "0.5843828", "text": "def unmunge(&block)\n define_method(:unmunge, &block)\n end", "title": "" }, { "docid": "0e5ce1d96770675956c68bb81339da47", "score": "0.5841807", "text": "def discard_tile(tile)\n\t\t@center_tile = @turn.remove_tile(tile)\n\tend", "title": "" }, { "docid": "eb178ad659d4d5a4be952f69be062f38", "score": "0.58286387", "text": "def discard_local_buffer(&block) #:doc:\r\n push_buffer\r\n begin\r\n yield\r\n ensure\r\n pop_discard_buffer\r\n end\r\n end", "title": "" }, { "docid": "7754955a6ad8239c26f07317e1af23f3", "score": "0.58258843", "text": "def unblock(handle, offset, length); end", "title": "" }, { "docid": "c314cfe8c843344f0b82f12cbb85126c", "score": "0.5818335", "text": "def clear!\n self.current_span = nil\n end", "title": "" }, { "docid": "09c85101eea410b883b5352bc80f0084", "score": "0.5813704", "text": "def drop_all_the_way\n if @game.is_running?\n ran = @current_block.drop_by_one\n @current_pos.each{|block| block.remove}\n acc = 0 # init accumulator to count how many points were scored\n while ran\n \tacc += 1\n ran = @current_block.drop_by_one\n end\n @score += acc\n draw\n @game.put_message('+' + acc.to_s)\n store_current\n if !game_over?\n next_piece\n end\n @game.update_score\n draw\n end\n end", "title": "" }, { "docid": "fb994212f1ee8ca5147a60bef4186b7b", "score": "0.58037657", "text": "def discard\n @start += 1\n end", "title": "" }, { "docid": "9db4fdcf79d8791d534c369d36ff1f18", "score": "0.5799429", "text": "def discard_stripwells\r\n show do \r\n title \"Discard Stripwells\"\r\n note \"Discard all the empty stripwells\"\r\n operations.each do |op|\r\n #if op.input(\"Fragment\").item != nil\r\n op.input(\"Fragment\").item.mark_as_deleted\r\n #else\r\n # show do\r\n # note \"Item you are trying to delete is nil. Cannot discard.\" #{op.input(\"Fragment\").item.id}\r\n # end\r\n #end\r\n end\r\n end\r\n end", "title": "" }, { "docid": "412826ed6ace63c14ce8b6661cb9a472", "score": "0.57939965", "text": "def remove\n super\n end", "title": "" } ]
7f5e7aabca805734806cc37d2403e49c
binding a state of an object
[ { "docid": "07690685babfcb3d40e013266a2a51de", "score": "0.0", "text": "def get_a_binding\n\tval = 123\n\tbinding\nend", "title": "" } ]
[ { "docid": "8b492ad68e847046b8b9e72466fab3d0", "score": "0.6644425", "text": "def binding() end", "title": "" }, { "docid": "8b492ad68e847046b8b9e72466fab3d0", "score": "0.6644425", "text": "def binding() end", "title": "" }, { "docid": "e2bfd555f7ccf8c58c3b0987b5710577", "score": "0.6595899", "text": "def _binding() binding end", "title": "" }, { "docid": "e2bfd555f7ccf8c58c3b0987b5710577", "score": "0.6595899", "text": "def _binding() binding end", "title": "" }, { "docid": "9483554dd1eb58630f469ea612d4a794", "score": "0.64730227", "text": "def binding!\n @binding = true\n end", "title": "" }, { "docid": "841760eb22bdc8c61f9a62a2ab5be62d", "score": "0.6472002", "text": "def bind_to_object=(_arg0); end", "title": "" }, { "docid": "76472afb4a853ddb657de49e5c303f71", "score": "0.6388672", "text": "def define_state_accessor; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.6357921", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.6357921", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.6357921", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.6357921", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.6357921", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.6357921", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.6357921", "text": "def state; end", "title": "" }, { "docid": "2e7f551fec883c80a1a3f61bc27686b2", "score": "0.6357921", "text": "def state; end", "title": "" }, { "docid": "58cb9061f506c4f73f6701b69217fef4", "score": "0.63068485", "text": "def binding; super end", "title": "" }, { "docid": "b68be5d6955c8214ea3480f59976652a", "score": "0.6199754", "text": "def bind(key,obj,*args)\n\t\t@bindings[key] = [obj,*args]\n\tend", "title": "" }, { "docid": "a7fccec83f65168e5a05b85789dc598c", "score": "0.61884946", "text": "def state=(arg)\n resource.state = arg\n end", "title": "" }, { "docid": "640fac5486e85be52759ba485a3ad356", "score": "0.61846715", "text": "def state\n end", "title": "" }, { "docid": "54009de92ea7863718c2fc5245af0b06", "score": "0.6176089", "text": "def state=(_arg0); end", "title": "" }, { "docid": "54009de92ea7863718c2fc5245af0b06", "score": "0.6176089", "text": "def state=(_arg0); end", "title": "" }, { "docid": "54009de92ea7863718c2fc5245af0b06", "score": "0.6176089", "text": "def state=(_arg0); end", "title": "" }, { "docid": "7d4b2887baca54f50d8381f2f5288428", "score": "0.61569995", "text": "def switch_state state\n\t\t\t@state_buffer = Proc.new do\n\t\t\t\t@objs2 = []\n\t\t\t\t@current_state = state\n\t\t\t\t@current_state.setup\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "733aa46b395703e569c3a64093aa28bd", "score": "0.59952885", "text": "def explicit_state\n super\n end", "title": "" }, { "docid": "3ec92b062b473b7f17829c327479a19a", "score": "0.5949349", "text": "def bind\n binding\n end", "title": "" }, { "docid": "91851835ff157dc0c32e1af976d5bb74", "score": "0.5946094", "text": "def bound_object\n @obj\n end", "title": "" }, { "docid": "519dcc2e55d4cec871470b2aa68a2708", "score": "0.5930701", "text": "def set_state(key, value)\n proxy.setState(key, value)\n end", "title": "" }, { "docid": "7628e9cc67a559d2062080e8cbd1c5d7", "score": "0.5926907", "text": "def initialize_state?(object); end", "title": "" }, { "docid": "661cd8f3a2ed30c60560148a77a0d9a3", "score": "0.59074306", "text": "def state=(new_state)\n @state = new_state\n refresh\n end", "title": "" }, { "docid": "50dd4913e7b0eb1c565c6e7c8b229819", "score": "0.58742785", "text": "def set_state(state)\n self.state = state\n self.save\n end", "title": "" }, { "docid": "7120c99e71f676e3bf2cf4f93158ca5c", "score": "0.5856605", "text": "def intern_state\n super\n end", "title": "" }, { "docid": "3a3d926b8f0adadcc01d5d5ac2aa3354", "score": "0.5855564", "text": "def state= new_state\n @state = new_state\n end", "title": "" }, { "docid": "3a389600e54888ee39138d2cd969acda", "score": "0.5848357", "text": "def assign_state(state)\n @state = state\n end", "title": "" }, { "docid": "6ac156ce0801c28ce88d9371d18e5cbb", "score": "0.5814638", "text": "def bind\n \n end", "title": "" }, { "docid": "ce03628e96477ae3fc8a8c25863918e6", "score": "0.5792426", "text": "def state=(s)\n @state = s\n end", "title": "" }, { "docid": "3ecee3a31bdde4cc5ec60e3d649ba51a", "score": "0.5791319", "text": "def initialize\n @state = :new\n end", "title": "" }, { "docid": "7d0138f3741aac335c664f94199feb0d", "score": "0.5790556", "text": "def bound_object\n return super if Rib::Anchor.disabled?\n return super if eval_binding.kind_of?(Binding)\n eval_binding\n end", "title": "" }, { "docid": "9c15645fcafe3ff07108a02d22f64b05", "score": "0.57817155", "text": "def bind\n binding\n end", "title": "" }, { "docid": "63bdc943efd812bf28fa48bf26af117f", "score": "0.57613826", "text": "def state\n object.state_code\n end", "title": "" }, { "docid": "83d076041ab7fb09b70bc7d0886144f3", "score": "0.57606524", "text": "def mirror_state\n super\n end", "title": "" }, { "docid": "fd7f7336d76fb647e354320b05b97f21", "score": "0.57601327", "text": "def binding\n @binding ||= {}\n end", "title": "" }, { "docid": "c03128f473a92006d7597b2b460cec01", "score": "0.5749536", "text": "def enter_state\n end", "title": "" }, { "docid": "4836fcac49d965c5a9a8e9fcb146512c", "score": "0.57488906", "text": "def state=(value)\n @state = value\n end", "title": "" }, { "docid": "b7d96d4691841d10c57628f0eec3a7eb", "score": "0.5734094", "text": "def bind(hash)\n out = binder.new\n hash.each do |k,v|\n out.send \"#{k}=\", v\n end\n out\n end", "title": "" }, { "docid": "85bb44447a42f5fd2d0fa8bfe58bc9ae", "score": "0.57146627", "text": "def aws_obj_state(opts)\n opts[:obj].state\n end", "title": "" }, { "docid": "71376d3fc6e2c382e1b2cc982ae3c149", "score": "0.57135206", "text": "def state\n @state\n end", "title": "" }, { "docid": "7160f7abe22fa2f5b03a347e97a891d7", "score": "0.5706163", "text": "def initialize(state); end", "title": "" }, { "docid": "91d97e0dfd7e88eeffb43058eeee6a40", "score": "0.57022756", "text": "def method_missing(method_symbol, *args, &block)\n if block.nil? && args.length == 1 && !method_symbol.match(/^to_/)\n self.class.attribute method_symbol, kind_of: args[0].class\n add_state_attr(method_symbol)\n send(method_symbol, args[0]) unless args[0].nil?\n else\n super\n end\n end", "title": "" }, { "docid": "c511ca7a6c1ec2aa777f3b95e2e9fffc", "score": "0.5678051", "text": "def state\n @state\n end", "title": "" }, { "docid": "3630254a6a928ceb21dfb6f9e0da968f", "score": "0.56654376", "text": "def state\n @state\n end", "title": "" }, { "docid": "34fc0369f621e3e237ccc83b364d65ff", "score": "0.5656767", "text": "def binder; end", "title": "" }, { "docid": "34fc0369f621e3e237ccc83b364d65ff", "score": "0.5656767", "text": "def binder; end", "title": "" }, { "docid": "d43ca0fa1defbecac82e1a8fd79376f1", "score": "0.5656491", "text": "def set_door_state(state)\r\n\t\t@state = state\r\n\tend", "title": "" }, { "docid": "77cbf7cd6d80f03652597905d30c7de5", "score": "0.5653168", "text": "def initial_state=(new_initial_state); end", "title": "" }, { "docid": "abc6518b902131c7bc963057a8ca68f2", "score": "0.5646247", "text": "def state=(value)\n @state = value\n end", "title": "" }, { "docid": "abc6518b902131c7bc963057a8ca68f2", "score": "0.5646247", "text": "def state=(value)\n @state = value\n end", "title": "" }, { "docid": "abc6518b902131c7bc963057a8ca68f2", "score": "0.5646247", "text": "def state=(value)\n @state = value\n end", "title": "" }, { "docid": "abc6518b902131c7bc963057a8ca68f2", "score": "0.5646247", "text": "def state=(value)\n @state = value\n end", "title": "" }, { "docid": "abc6518b902131c7bc963057a8ca68f2", "score": "0.5646247", "text": "def state=(value)\n @state = value\n end", "title": "" }, { "docid": "abc6518b902131c7bc963057a8ca68f2", "score": "0.5646247", "text": "def state=(value)\n @state = value\n end", "title": "" }, { "docid": "abc6518b902131c7bc963057a8ca68f2", "score": "0.5646247", "text": "def state=(value)\n @state = value\n end", "title": "" }, { "docid": "abc6518b902131c7bc963057a8ca68f2", "score": "0.5646247", "text": "def state=(value)\n @state = value\n end", "title": "" }, { "docid": "abc6518b902131c7bc963057a8ca68f2", "score": "0.5646247", "text": "def state=(value)\n @state = value\n end", "title": "" }, { "docid": "abc6518b902131c7bc963057a8ca68f2", "score": "0.5646247", "text": "def state=(value)\n @state = value\n end", "title": "" }, { "docid": "aa7739dba189fcc9f5b9bfa0f0997b4b", "score": "0.56387836", "text": "def push_binding(object)\n @stopped = false\n binding_stack << Pry.binding_for(object)\n end", "title": "" }, { "docid": "32afc943077b9f1df1e7a1c28b520b62", "score": "0.56345", "text": "def state(state, &block)\n @states[state.to_sym] = State.new(&block)\n end", "title": "" }, { "docid": "346eb527f4158e3bdb720e78eb7502bf", "score": "0.5633062", "text": "def update!(**args)\n @state = args[:state] if args.key?(:state)\n end", "title": "" }, { "docid": "346eb527f4158e3bdb720e78eb7502bf", "score": "0.5633062", "text": "def update!(**args)\n @state = args[:state] if args.key?(:state)\n end", "title": "" }, { "docid": "346eb527f4158e3bdb720e78eb7502bf", "score": "0.5633062", "text": "def update!(**args)\n @state = args[:state] if args.key?(:state)\n end", "title": "" }, { "docid": "346eb527f4158e3bdb720e78eb7502bf", "score": "0.5633062", "text": "def update!(**args)\n @state = args[:state] if args.key?(:state)\n end", "title": "" }, { "docid": "346eb527f4158e3bdb720e78eb7502bf", "score": "0.5633062", "text": "def update!(**args)\n @state = args[:state] if args.key?(:state)\n end", "title": "" }, { "docid": "346eb527f4158e3bdb720e78eb7502bf", "score": "0.5633062", "text": "def update!(**args)\n @state = args[:state] if args.key?(:state)\n end", "title": "" }, { "docid": "346eb527f4158e3bdb720e78eb7502bf", "score": "0.5633062", "text": "def update!(**args)\n @state = args[:state] if args.key?(:state)\n end", "title": "" }, { "docid": "38f0b3f4fe97c6917607d292da38dea8", "score": "0.5632484", "text": "def from_state(state_object = State)\n Roby.from_state(state_object)\n end", "title": "" }, { "docid": "36a669a7ae4225605f8142df2a7949d9", "score": "0.5623274", "text": "def binding\n Binding.new(_base, _target, _association)\n end", "title": "" }, { "docid": "baa48e0ac9b3387e79e1c8b05dfa4428", "score": "0.5619419", "text": "def update_state\n raise \"Nothing to do\"\n end", "title": "" }, { "docid": "d2c7a3d6a794f1f62cc83ceabd0f2df6", "score": "0.56079876", "text": "def on_state(state, &block)\n end", "title": "" }, { "docid": "1ee003fa65b665130adcf23e21157b87", "score": "0.5603046", "text": "def state\n @obj_env\n end", "title": "" }, { "docid": "b4ac944602459846c6aad76c9cb3380a", "score": "0.55892", "text": "def initialize_states(object, options = T.unsafe(nil), attributes = T.unsafe(nil)); end", "title": "" }, { "docid": "af2206d7ead48268ffdc6e98e9118236", "score": "0.5585632", "text": "def bind; binding() end", "title": "" }, { "docid": "ab191660d8dc62e684d63532a28718d3", "score": "0.5583252", "text": "def state_obj; @_hegemon_states[@_hegemon_state]; end", "title": "" }, { "docid": "e1c7f036ecec0b7e77b3f8ac4d2f8e40", "score": "0.556176", "text": "def state\n @__state\n end", "title": "" }, { "docid": "1f7243874e264138f4d5a88f3d10d583", "score": "0.555716", "text": "def do_binding\n symbol = pop[:value]\n\t\tvalue = pop\n\t\[email protected]( symbol, value )\n end", "title": "" }, { "docid": "2902c195ffa5706ef142501dbb8cf501", "score": "0.5553532", "text": "def xy=(value); self.state = { :xy => value }; end", "title": "" }, { "docid": "e0f4d4778105ddd887d4986222315e4c", "score": "0.5550989", "text": "def indicator_state=(indicator_state); end", "title": "" }, { "docid": "017c0ff255819cd06d986cc9798a1b40", "score": "0.5550423", "text": "def setTaskState _obj, _args\n \"_obj setTaskState _args;\" \n end", "title": "" }, { "docid": "010bf9f867379d3e0fc4578bbf3ab59c", "score": "0.5518902", "text": "def set_state(key, val)\n @state[key] = val\n self\n end", "title": "" }, { "docid": "d23f1604be0dc38692dbb8785940d6ca", "score": "0.55170923", "text": "def bind(object)\n BlockAdapter.new(@block, object)\n end", "title": "" }, { "docid": "f8a5f719cf45e4b08d819b54a941b9ef", "score": "0.5503159", "text": "def set_state\n @state = State.find(params[:id])\n end", "title": "" }, { "docid": "f8a5f719cf45e4b08d819b54a941b9ef", "score": "0.5503159", "text": "def set_state\n @state = State.find(params[:id])\n end", "title": "" }, { "docid": "18c3f28aa5e60bcad6b2d2133a45e97c", "score": "0.54996675", "text": "def bind(p0) end", "title": "" }, { "docid": "18c3f28aa5e60bcad6b2d2133a45e97c", "score": "0.54996675", "text": "def bind(p0) end", "title": "" }, { "docid": "484d5c5fd619daecabd607922b4e580a", "score": "0.54991865", "text": "def __setobj__\n raise \"ObjectProxy does not support changing referenced object\"\n end", "title": "" }, { "docid": "eaf6752cc02b6bd887e134eca97e1136", "score": "0.5489505", "text": "def push_binding(value)\n super\n set_global\n end", "title": "" }, { "docid": "da6f09fc20d002af69b006dc61b5893c", "score": "0.54683053", "text": "def set_state(state)\n @original_state = state\n @first_index = 0\n @second_index = 1\n @operation = :fill\n end", "title": "" }, { "docid": "f50dc57f8deec2d81c61283e0c7a39b8", "score": "0.54636246", "text": "def update_widget_from_object(obj)\n\t\t@obj = obj\n\t\tif obj\n\t\t\t#@x1.set_value_silent(obj.x1)\n\t\t\t#@y1.set_value_silent(obj.y1)\n\t\t\t#@x2.set_value_silent(obj.x2)\n\t\t\t#@y2.set_value_silent(obj.y2)\n\t\t\[email protected]_active_silent(obj.color)\n\t\t\tself.update_attributes\n\t\tend\n\tend", "title": "" }, { "docid": "60c1120d21631521854b049b42e491dc", "score": "0.5462893", "text": "def __setobj__(obj); end", "title": "" }, { "docid": "ce2703a30a2bb1005f8580a5458ac639", "score": "0.54617226", "text": "def public_binding\n binding\n end", "title": "" }, { "docid": "36ca024f25c5ea97abe34846f3512d2f", "score": "0.54564434", "text": "def update_widget_from_object(obj)\n\t\t@obj = obj\n\t\tif obj\n\t\t\[email protected]_value_silent(obj.x1)\n\t\t\[email protected]_value_silent(obj.y1)\n\t\t\[email protected]_value_silent(obj.x2)\n\t\t\[email protected]_value_silent(obj.y2)\n\t\t\[email protected]_active_silent(obj.color)\n\t\t\tself.update_attributes\n\t\tend\n\tend", "title": "" }, { "docid": "e2feb4d8ed273762b2ab622ebe3337d5", "score": "0.54483736", "text": "def write(object, attribute, value, *args)\n result = super\n \n if (attribute == :state || attribute == :event && value) && !object.send(\"#{self.attribute}_changed?\")\n current = read(object, :state)\n object.changes[self.attribute.to_s] = [attribute == :event ? current : value, current]\n end\n \n result\n end", "title": "" }, { "docid": "61aed5af50b9dde8437801f70bde4250", "score": "0.5441594", "text": "def set_state\n @state = State.find(params[:id])\n end", "title": "" } ]
c0d004b5598fc31a921bf649a11e2af2
Set the value of the SubPostalCode input for this Choreo.
[ { "docid": "83511db9c39066ae1aeaebf9dac5272c", "score": "0.82703453", "text": "def set_SubPostalCode(value)\n set_input(\"SubPostalCode\", value)\n end", "title": "" } ]
[ { "docid": "1aed15dc4bc39a55d9a4f4d96b038db0", "score": "0.5958342", "text": "def postal_code=(postal_code)\n if postal_code.nil?\n fail ArgumentError, 'postal_code cannot be nil'\n end\n\n if postal_code.to_s.length < 1\n fail ArgumentError, 'invalid value for \"postal_code\", the character length must be great than or equal to 1.'\n end\n\n @postal_code = postal_code\n end", "title": "" }, { "docid": "e092d2b2405984ccbfab529e7ecb7a04", "score": "0.5947296", "text": "def postal_code=(postal_code)\n if !postal_code.nil? && postal_code.to_s.length > 10\n fail ArgumentError, 'invalid value for \"postal_code\", the character length must be smaller than or equal to 10.'\n end\n\n @postal_code = postal_code\n end", "title": "" }, { "docid": "f687fe1d4cfa58c57705a522dc2f3239", "score": "0.5907269", "text": "def postal_code=(postal_code)\n if !postal_code.nil? && postal_code.to_s.length > 10\n fail ArgumentError, 'invalid value for \"postal_code\", the character length must be smaller than or equal to 10.'\n end\n\n if !postal_code.nil? && postal_code.to_s.length < 0\n fail ArgumentError, 'invalid value for \"postal_code\", the character length must be great than or equal to 0.'\n end\n\n @postal_code = postal_code\n end", "title": "" }, { "docid": "d8489e3eecdeaa6804f2487718952b3c", "score": "0.57893133", "text": "def postal_code=(postal_code)\n if !postal_code.nil? && postal_code.to_s.length > 20\n fail ArgumentError, 'invalid value for \"postal_code\", the character length must be smaller than or equal to 20.'\n end\n\n @postal_code = postal_code\n end", "title": "" }, { "docid": "fb85c03f1ca52f56438fbccd79280ae8", "score": "0.56897277", "text": "def set_SubdivisionCode(value)\n set_input(\"SubdivisionCode\", value)\n end", "title": "" }, { "docid": "5955b99f14d10e18616f381146bce57e", "score": "0.5635355", "text": "def postal_code=(value)\n @postal_code = value\n end", "title": "" }, { "docid": "5955b99f14d10e18616f381146bce57e", "score": "0.5635355", "text": "def postal_code=(value)\n @postal_code = value\n end", "title": "" }, { "docid": "5955b99f14d10e18616f381146bce57e", "score": "0.5635355", "text": "def postal_code=(value)\n @postal_code = value\n end", "title": "" }, { "docid": "5955b99f14d10e18616f381146bce57e", "score": "0.5635355", "text": "def postal_code=(value)\n @postal_code = value\n end", "title": "" }, { "docid": "2f3e1a2ad960fb4bb3e722e65bd46f47", "score": "0.56117564", "text": "def sublocality=(sublocality)\n\n if !sublocality.nil? && sublocality.to_s.length > 255\n fail ArgumentError, \"invalid value for 'sublocality', the character length must be smaller than or equal to 255.\"\n end\n\n @sublocality = sublocality\n end", "title": "" }, { "docid": "0560de73b09b946a04fc423e23847de9", "score": "0.56094706", "text": "def set_PostalCode(value)\n set_input(\"PostalCode\", value)\n end", "title": "" }, { "docid": "0560de73b09b946a04fc423e23847de9", "score": "0.56094706", "text": "def set_PostalCode(value)\n set_input(\"PostalCode\", value)\n end", "title": "" }, { "docid": "0560de73b09b946a04fc423e23847de9", "score": "0.56094706", "text": "def set_PostalCode(value)\n set_input(\"PostalCode\", value)\n end", "title": "" }, { "docid": "0560de73b09b946a04fc423e23847de9", "score": "0.56094706", "text": "def set_PostalCode(value)\n set_input(\"PostalCode\", value)\n end", "title": "" }, { "docid": "530110faafbfc1571c884c4a1a53eac5", "score": "0.5536231", "text": "def postalcode(postalcode)\n @criteria[:postalcode] = postalcode\n self\n end", "title": "" }, { "docid": "f3b5781395c185bc045e7ccfbbb15252", "score": "0.5472229", "text": "def set_InPostalCode(value)\n set_input(\"InPostalCode\", value)\n end", "title": "" }, { "docid": "b8e51e1a9f0526ac5a9ba02f9f89d92c", "score": "0.5452072", "text": "def subid=(subid)\n attributes['subid'] = subid\n end", "title": "" }, { "docid": "42dc78a95551f3206e877f32ba1e67e7", "score": "0.54203725", "text": "def set_PostalCode(value)\n set_input(\"PostalCode\", value)\n end", "title": "" }, { "docid": "42dc78a95551f3206e877f32ba1e67e7", "score": "0.54203725", "text": "def set_PostalCode(value)\n set_input(\"PostalCode\", value)\n end", "title": "" }, { "docid": "42dc78a95551f3206e877f32ba1e67e7", "score": "0.54203725", "text": "def set_PostalCode(value)\n set_input(\"PostalCode\", value)\n end", "title": "" }, { "docid": "42dc78a95551f3206e877f32ba1e67e7", "score": "0.54203725", "text": "def set_PostalCode(value)\n set_input(\"PostalCode\", value)\n end", "title": "" }, { "docid": "42dc78a95551f3206e877f32ba1e67e7", "score": "0.54203725", "text": "def set_PostalCode(value)\n set_input(\"PostalCode\", value)\n end", "title": "" }, { "docid": "f5f2c9161dc2726f46d059481383bb98", "score": "0.53936327", "text": "def postal_code=(a_zip)\n self[postal_code_column] = a_zip\n end", "title": "" }, { "docid": "1fc7148839d741ab41741a134eb972c4", "score": "0.5290853", "text": "def postal_code=(str)\n @address[:postal_code] = pc_check_and_assign!(str)\n end", "title": "" }, { "docid": "90c644385f81bcf217c5a0118e2ce5d7", "score": "0.52710277", "text": "def account_postal_code=(account_postal_code)\n if account_postal_code.nil?\n fail ArgumentError, 'account_postal_code cannot be nil'\n end\n\n if account_postal_code.to_s.length < 1\n fail ArgumentError, 'invalid value for \"account_postal_code\", the character length must be great than or equal to 1.'\n end\n\n @account_postal_code = account_postal_code\n end", "title": "" }, { "docid": "76fd82e715514dce9c4e2f54d44c7036", "score": "0.5236191", "text": "def set_sub_coord(sub_coord)\n\t\t@sub_coord = sub_coord\n\tend", "title": "" }, { "docid": "579c34cdb62286300804381be0ed02f1", "score": "0.52318853", "text": "def set_DestinationPostalCode(value)\n set_input(\"DestinationPostalCode\", value)\n end", "title": "" }, { "docid": "87b4d238ab8ea59a9531fc6db2bb553c", "score": "0.51976806", "text": "def set_ZIPCode(value)\n set_input(\"ZIPCode\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187779", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187779", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187779", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187779", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187779", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187779", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187779", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187779", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187779", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "76731a968e9bce6995bc2634793f8bac", "score": "0.5187668", "text": "def set_SubAccountSID(value)\n set_input(\"SubAccountSID\", value)\n end", "title": "" }, { "docid": "642d078608105fb5a658377bcfbfe1a8", "score": "0.51824325", "text": "def set_ZipCode(value)\n set_input(\"ZipCode\", value)\n end", "title": "" }, { "docid": "642d078608105fb5a658377bcfbfe1a8", "score": "0.51824325", "text": "def set_ZipCode(value)\n set_input(\"ZipCode\", value)\n end", "title": "" }, { "docid": "642d078608105fb5a658377bcfbfe1a8", "score": "0.51824325", "text": "def set_ZipCode(value)\n set_input(\"ZipCode\", value)\n end", "title": "" }, { "docid": "642d078608105fb5a658377bcfbfe1a8", "score": "0.51824325", "text": "def set_ZipCode(value)\n set_input(\"ZipCode\", value)\n end", "title": "" }, { "docid": "642d078608105fb5a658377bcfbfe1a8", "score": "0.51824325", "text": "def set_ZipCode(value)\n set_input(\"ZipCode\", value)\n end", "title": "" }, { "docid": "eb34a2246c5f1dc412258f76645d0c1d", "score": "0.5172201", "text": "def secondary_address_postal_code=(v)\n @secondary_address_postal_code = alma_string v\n end", "title": "" }, { "docid": "6d7224929bc54b8032b60460cbad551c", "score": "0.51318806", "text": "def set_subregion\n @subregion = Subregion.find(params[:id])\n end", "title": "" }, { "docid": "81ae28222071efd95e1803c8636b7ff0", "score": "0.51305246", "text": "def set_zip_code(new_zip_code)\n update(zip_code: new_zip_code)\n end", "title": "" }, { "docid": "fb141b8681653154aa70d6715f95055c", "score": "0.51169926", "text": "def set_Zipcode(value)\n set_input(\"Zipcode\", value)\n end", "title": "" }, { "docid": "b2543e454842ee8fba1c2272f9a0f910", "score": "0.5109021", "text": "def postal_code=(val)\n address_record.postal_code = val\n end", "title": "" }, { "docid": "7463a3792c34497e7f6518c76c70b94d", "score": "0.51067686", "text": "def set_DestinationPostalCode(value)\n set_input(\"DestinationPostalCode\", value)\n end", "title": "" }, { "docid": "1320a5c1a28cd2828705a01b909fa5d4", "score": "0.51042956", "text": "def sub_network=(sub_network)\n validator = EnumAttributeValidator.new('String', [\"VISANET\", \"VISANETDEBIT\", \"VISAINTERLINK\", \"VISAPLUS\"])\n unless validator.valid?(sub_network)\n fail ArgumentError, \"invalid value for \\\"sub_network\\\", must be one of #{validator.allowable_values}.\"\n end\n @sub_network = sub_network\n end", "title": "" }, { "docid": "6106416529cd066e776b004c4f82e40d", "score": "0.5086764", "text": "def sub_network=(sub_network)\n validator = EnumAttributeValidator.new('String', [\"VISANET\", \"VISANETDEBIT\", \"VISAINTERLINK\", \"VISAPLUS\", \"MAESTRO\"])\n unless validator.valid?(sub_network)\n fail ArgumentError, \"invalid value for \\\"sub_network\\\", must be one of #{validator.allowable_values}.\"\n end\n @sub_network = sub_network\n end", "title": "" }, { "docid": "77768263154e2b766205bd43b5410b00", "score": "0.5036631", "text": "def set_zip_code(new_zip_code)\r\n update(zip_code: new_zip_code)\r\n end", "title": "" }, { "docid": "7ee2d3b7d0b98176de6fe6acc9328bcb", "score": "0.50116205", "text": "def postal_code\n element_with_value('PostalCode', opts[:postal_code][0..9])\n end", "title": "" }, { "docid": "413db7760e63b8350ccf827620ae5cff", "score": "0.49859145", "text": "def billto_postal_code=(billto_postal_code)\n if !billto_postal_code.nil? && billto_postal_code.to_s.length > 20\n fail ArgumentError, 'invalid value for \"billto_postal_code\", the character length must be smaller than or equal to 20.'\n end\n\n @billto_postal_code = billto_postal_code\n end", "title": "" }, { "docid": "53fffd4625f2f73436f89bf214d7b568", "score": "0.49831074", "text": "def shipto_postal_code=(shipto_postal_code)\n if !shipto_postal_code.nil? && shipto_postal_code.to_s.length > 20\n fail ArgumentError, 'invalid value for \"shipto_postal_code\", the character length must be smaller than or equal to 20.'\n end\n\n @shipto_postal_code = shipto_postal_code\n end", "title": "" }, { "docid": "a2da0c9696d184c27ac7579b5846f87b", "score": "0.4971122", "text": "def postal_code=(code)\n if code.presence.kind_of?(String)\n if country_code == 'CA'\n code = code.upcase.gsub(/[^A-Z0-9]/, '')\n code = code.insert(3, ' ') if code.length == 6\n elsif country_code == 'US'\n code = code.gsub(/[^0-9]/, '')\n code = code.insert(5, '-') if code.length == 9\n end\n end\n\n super(code)\n end", "title": "" }, { "docid": "7e948c8f922f1c35b223f22822f0fe22", "score": "0.49646014", "text": "def set_OriginPostalCode(value)\n set_input(\"OriginPostalCode\", value)\n end", "title": "" }, { "docid": "e005abbb543ceecc7fcdb25c319f59fd", "score": "0.4802517", "text": "def set_postal_code\n @postal_code = PostalCode.find(params[:id])\n end", "title": "" }, { "docid": "51fd360cd6ae2f89bfe171aea3269f0d", "score": "0.4759927", "text": "def zip_code=(zip_code)\n if zip_code.nil?\n fail ArgumentError, 'zip_code cannot be nil'\n end\n\n pattern = Regexp.new(/(^$)|(^\\d{5}$)/)\n if zip_code !~ pattern\n fail ArgumentError, \"invalid value for \\\"zip_code\\\", must conform to the pattern #{pattern}.\"\n end\n\n @zip_code = zip_code\n end", "title": "" }, { "docid": "2f7061999faa7c7706c7d675650d08bb", "score": "0.4668395", "text": "def set_subdepartment\n @subdepartment = Subdepartment.find(params[:id])\n end", "title": "" }, { "docid": "dd4741453f48edc9bfdbf2ef0c581c85", "score": "0.464975", "text": "def subdomain=(subdomain)\n if !subdomain.nil? && subdomain.to_s.length < 1\n fail ArgumentError, 'invalid value for \"subdomain\", the character length must be great than or equal to 1.'\n end\n\n @subdomain = subdomain\n end", "title": "" }, { "docid": "3c7cbf633ec97c58280a58e17bda3e50", "score": "0.46396005", "text": "def set_StateOrProvinceCode(value)\n set_input(\"StateOrProvinceCode\", value)\n end", "title": "" }, { "docid": "634473529b0f0bccc73d673265cf4a60", "score": "0.46290827", "text": "def subdomain=(new_subdmain)\n write_attribute(:subdomain, new_subdmain.strip.downcase)\n end", "title": "" }, { "docid": "219030d871874d82122685ee91cee09b", "score": "0.46213627", "text": "def subdomain=(subdomain)\n if subdomain.nil?\n fail ArgumentError, 'subdomain cannot be nil'\n end\n\n if subdomain.to_s.length > 100\n fail ArgumentError, 'invalid value for \"subdomain\", the character length must be smaller than or equal to 100.'\n end\n\n if subdomain.to_s.length < 1\n fail ArgumentError, 'invalid value for \"subdomain\", the character length must be great than or equal to 1.'\n end\n\n @subdomain = subdomain\n end", "title": "" }, { "docid": "6db6b5bd0ef757711b829281a183c061", "score": "0.46132177", "text": "def set_sub\n\t @sub = Sub.find(params[:sub_id])\n\tend", "title": "" }, { "docid": "f03fab50bed7d9394bc96b84439e1b19", "score": "0.4588756", "text": "def set_subfamily\n @subfamily = Subfamily.find(params[:id])\n end", "title": "" }, { "docid": "2b1b8e2cbb7c5b0cf4c9e492beed6457", "score": "0.45810014", "text": "def process_postal_code(postal_code)\n self.postal_code = postal_code\n if postal_code_changed?\n save!\n if in_supported_country?\n find_theaters_and_confirm_or_deny_location\n else\n send_unsupported_country_message\n end\n end\n end", "title": "" }, { "docid": "ec067a2ce9ecbcce95e782619bb5461c", "score": "0.45769408", "text": "def billto_country_code=(billto_country_code)\n if !billto_country_code.nil? && billto_country_code.to_s.length > 2\n fail ArgumentError, 'invalid value for \"billto_country_code\", the character length must be smaller than or equal to 2.'\n end\n\n @billto_country_code = billto_country_code\n end", "title": "" }, { "docid": "4996625a6c5bd75d043bdb2c21daf7ed", "score": "0.45514962", "text": "def set_suburb\n @suburb = Suburb.find(params[:id])\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "fa6b351422107ebb8a33cd8478e0fa5e", "score": "0.0", "text": "def measurement_params\n params.require(:measurement).permit(:value, :measurement_type_id, :comment, :date)\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.69225836", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.68929327", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.67848456", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.674347", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6682223", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.6636527", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.66291976", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.66258276", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f", "score": "0.65625846", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6491194", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.64526874", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.64001405", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.63810205", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.63634825", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.633783", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b4c9587164188c64f14b71403f80ca7c", "score": "0.6336759", "text": "def sanitize_params!\n request.sanitize_params!\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6325718", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "38bec0546a7e4cbf4c337edbee67d769", "score": "0.631947", "text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.63146484", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "5ec018b4a193bf3bf8902c9419279607", "score": "0.63137317", "text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6306224", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.6301168", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.63000035", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.629581", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.6280713", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6271388", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "f6399952b4623e5a23ce75ef1bf2af5a", "score": "0.6266194", "text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend", "title": "" }, { "docid": "37c5d0a9ebc5049d7333af81696608a0", "score": "0.6256044", "text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.62550515", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.62525266", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "d14bb69d2a7d0f302032a22bb9373a16", "score": "0.6234781", "text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend", "title": "" }, { "docid": "5629f00db37bf403d0c58b524d4c3c37", "score": "0.62278074", "text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "d370098b1b3289dbd04bf1c073f2645b", "score": "0.6226693", "text": "def allow_params\n params.permit(:id, :email, :password)\n end", "title": "" }, { "docid": "fde8b208c08c509fe9f617229dfa1a68", "score": "0.6226605", "text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end", "title": "" }, { "docid": "78cbf68c3936c666f1edf5f65e422b6f", "score": "0.6226114", "text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend", "title": "" }, { "docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5", "score": "0.6200643", "text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end", "title": "" }, { "docid": "d724124948bde3f2512c5542b9cdea74", "score": "0.61913997", "text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.61835426", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.6179986", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.61630195", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "fc4b1364974ea591f32a99898cb0078d", "score": "0.6160931", "text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6155551", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.61542404", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "b9432eac2fc04860bb585f9af0d932bc", "score": "0.61356604", "text": "def wall_params\n params.permit(:public_view, :guest)\n end", "title": "" }, { "docid": "f2342adbf71ecbb79f87f58ff29c51ba", "score": "0.61342114", "text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.61188847", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "9292c51af27231dfd9f6478a027d419e", "score": "0.61140966", "text": "def domain_params\n params[:domain].permit!\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "a3aee889e493e2b235619affa62f39c3", "score": "0.61107725", "text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "677293afd31e8916c0aee52a787b75d8", "score": "0.60860336", "text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end", "title": "" }, { "docid": "e50ea3adc222a8db489f0ed3d1dce35b", "score": "0.60855556", "text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end", "title": "" }, { "docid": "b7ab5b72771a4a2eaa77904bb0356a48", "score": "0.608446", "text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end", "title": "" }, { "docid": "b2841e384487f587427c4b35498c133f", "score": "0.6076753", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.60742563", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "0c8779b5d7fc10083824e36bfab170de", "score": "0.60677326", "text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.60666215", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "fa0608a79e8d27c2a070862e616c8c58", "score": "0.6065763", "text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.60655254", "text": "def need_params\n end", "title": "" }, { "docid": "4f8205e45790aaf4521cdc5f872c2752", "score": "0.6064794", "text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end", "title": "" }, { "docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06", "score": "0.6062697", "text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "d6886c65f0ba5ebad9a2fe5976b70049", "score": "0.60562736", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "96ddf2d48ead6ef7a904c961c284d036", "score": "0.60491294", "text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "75b7084f97e908d1548a1d23c68a6c4c", "score": "0.6046521", "text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end", "title": "" }, { "docid": "080d2fb67f69228501429ad29d14eb29", "score": "0.6041768", "text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.60346854", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.6030552", "text": "def filter_params\n end", "title": "" }, { "docid": "cf73c42e01765dd1c09630007357379c", "score": "0.6024842", "text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end", "title": "" }, { "docid": "793abf19d555fb6aa75265abdbac23a3", "score": "0.6021606", "text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end", "title": "" }, { "docid": "2e70947f467cb6b1fda5cddcd6dc6304", "score": "0.6019679", "text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend", "title": "" }, { "docid": "2a11104d8397f6fb79f9a57f6d6151c7", "score": "0.6017253", "text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end", "title": "" }, { "docid": "a83bc4d11697ba3c866a5eaae3be7e05", "score": "0.60145336", "text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end", "title": "" }, { "docid": "2aa7b93e192af3519f13e9c65843a6ed", "score": "0.60074294", "text": "def user_params\n params[:user].permit!\n end", "title": "" }, { "docid": "9c8cd7c9e353c522f2b88f2cf815ef4e", "score": "0.6006753", "text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.60048765", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "e7cad604922ed7fad31f22b52ecdbd13", "score": "0.60009843", "text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6000161", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "2e6de53893e405d0fe83b9d18b696bd5", "score": "0.599852", "text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.59947807", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "0f53610616212c35950b45fbcf9f5ad4", "score": "0.5993962", "text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end", "title": "" }, { "docid": "b545ec7bfd51dc43b982b451a715a538", "score": "0.5992739", "text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end", "title": "" }, { "docid": "0b704016f3538045eb52c45442e7f704", "score": "0.59911275", "text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.59906775", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" } ]
e38fd1b074db060f009560d8e92f9f6a
Inserts/updates two columns into subtitle markers CSV file: persistentId and recordId relativeMS samples charLength 0 0 47 > relativeMS samples charLength persistentId recordId 0 0 47 Ag57 63280005
[ { "docid": "0466119c6a0ec78ffb4b36bdd5a7a1aa", "score": "0.6216095", "text": "def fix\n record_id_mappings = compute_record_id_mappings(@content_at_file.contents)\n subtitles = @stm_csv_file.subtitles\n num_subtitles = subtitles.length\n\n if record_id_mappings.length != num_subtitles\n raise(ArgumentError.new(\"Difference in subtitles count: CSV: #{ num_subtitles }, content AT: #{ record_id_mappings.length }\"))\n end\n\n spids = Repositext::Subtitle::IdGenerator.new(\n @stids_inventory_file\n ).generate(\n num_subtitles\n ).shuffle\n\n contents_with_spids_and_rids = [\n %w[relativeMS samples charLength persistentId recordId].join(\"\\t\")\n ] # initialize with CSV header row\n subtitles.each { |subtitle|\n # append spid and rid to all lines that start with a digit\n spid = spids.shift\n raise \"Not enough spids!\" if spid.nil?\n rid = record_id_mappings.shift\n raise \"Not enough rids!\" if rid.nil?\n contents_with_spids_and_rids << [\n subtitle.relative_milliseconds,\n subtitle.samples,\n subtitle.char_length,\n spid,\n rid\n ].join(\"\\t\")\n }\n Outcome.new(true, contents_with_spids_and_rids.join(\"\\n\") + \"\\n\")\n end", "title": "" } ]
[ { "docid": "b0ce5260d5baaa67f89e9461df9df98b", "score": "0.6931952", "text": "def update_primary_subtitle_marker_csv_file(content_at_file_to, st_ops_for_file)\n # Get content_at_file as of from_git_commit\n content_at_file = content_at_file_to.as_of_git_commit(@from_git_commit)\n old_stids, new_time_slices = extract_primary_stm_csv_file_input_data(\n content_at_file,\n st_ops_for_file\n )\n\n new_char_lengths = compute_new_char_lengths(content_at_file_to)\n\n validate_subtitle_sync_input_data(\n content_at_file,\n old_stids,\n new_time_slices,\n st_ops_for_file\n )\n new_subtitles_data = compute_new_subtitle_data(\n old_stids,\n new_time_slices,\n new_char_lengths,\n st_ops_for_file\n )\n update_stm_csv_file(\n content_at_file.corresponding_subtitle_markers_csv_file,\n new_subtitles_data\n )\n\n true\n end", "title": "" }, { "docid": "7e4b95475cc9c0c9cfd6375a6c896bc0", "score": "0.6426454", "text": "def update_stm_csv_file(stm_csv_file, new_subtitles_data)\n stm_csv_file.update!(new_subtitles_data)\n end", "title": "" }, { "docid": "999014a8c51b4ee8af781c0af607e7d8", "score": "0.63401973", "text": "def subtitles\n idx = 0\n current_record_id = nil\n csv.to_a.map { |row|\n new_record_id = row['recordId']\n is_record_boundary = (new_record_id != current_record_id)\n current_record_id = new_record_id\n Subtitle.new({\n relative_milliseconds: row['relativeMS'],\n samples: row['samples'],\n char_length: row['charLength'],\n persistent_id: row['persistentId'],\n record_id: new_record_id,\n tmp_attrs: { index: idx += 1,\n is_record_boundary: is_record_boundary },\n })\n }\n end", "title": "" }, { "docid": "5d8b3268ae55499019707215c6b07c7c", "score": "0.6211746", "text": "def fix_add_initial_persistent_subtitle_ids(options)\n spids_inventory_file = File.open(\n File.join(config.base_dir(:data_dir), 'subtitle_ids.txt'),\n 'r+'\n )\n if spids_inventory_file.read.present?\n # We expect inventory file to be empty when we run this command\n raise ArgumentError.new(\"SPID inventory file is not empty!\")\n end\n\n Repositext::Cli::Utils.change_files_in_place(\n config.compute_glob_pattern(\n options['base-dir'] || :content_dir,\n options['file-selector'] || :all_files,\n options['file-extension'] || :csv_extension\n ),\n options['file_filter'] || /\\.subtitle_markers\\.csv\\z/i,\n \"Adding initial persistent subtitle ids\",\n options\n ) do |stm_csv_file|\n ccafn = stm_csv_file.filename.sub('.subtitle_markers.csv', '.at')\n corresponding_content_at_file = RFile::ContentAt.new(\n File.read(ccafn),\n stm_csv_file.language,\n ccafn\n )\n outcome = Repositext::Process::Fix::AddInitialPersistentSubtitleIds.new(\n stm_csv_file,\n corresponding_content_at_file,\n spids_inventory_file\n ).fix\n [Outcome.new(outcome.success, { contents: outcome.result })]\n end\n end", "title": "" }, { "docid": "5ba86faaf315550629eaea1e424c6484", "score": "0.5990925", "text": "def sync_subtitle_mark_character_positions(options)\n Repositext::Cli::Utils.convert_files(\n config.compute_glob_pattern(\n options['base-dir'] || :content_dir,\n options['file-selector'] || :all_files,\n options['file-extension'] || :at_extension\n ),\n /\\.at\\z/i,\n \"Syncing subtitle_mark character positions from *.at to *.subtitle_markers.csv\",\n options\n ) do |content_at_file|\n if content_at_file.contents.index('@')\n # This file contains subtitle_marks: Create subtitle_markers CSV file.\n previous_stm_csv = content_at_file.corresponding_subtitle_markers_csv_file\n outcome = Repositext::Process::Sync::SubtitleMarkCharacterPositions.sync(\n content_at_file.contents,\n previous_stm_csv,\n options['auto-insert-missing-subtitle-marks']\n )\n [Outcome.new(true, { contents: outcome.result, extension: 'subtitle_markers.csv' })]\n else\n # File doesn't contain subtitle_marks:\n # Don't create a new subtitle_markers CSV file.\n []\n end\n end\n end", "title": "" }, { "docid": "5d02ff08438186547529a1f11593e176", "score": "0.5883666", "text": "def sync_subtitle_mark_character_positions(options)\n input_file_spec = options['input'] || 'content_dir/at_files'\n Repositext::Cli::Utils.convert_files(\n config.compute_glob_pattern(input_file_spec),\n /\\.at\\z/i,\n \"Syncing subtitle_mark character positions from *.at to *.subtitle_markers.csv\",\n options.merge(input_is_binary: false)\n ) do |contents, filename|\n if !contents.index('@')\n # Don't create a new subtitle_markers CSV file for contents that don't\n # contain any subtitle_marks\n []\n else\n # this contents contains subtitle_markers\n stm_csv_path = filename.gsub(/\\.at\\z/, '.subtitle_markers.csv')\n previous_stm_csv = if File.exists?(stm_csv_path)\n File.read(stm_csv_path)\n else\n nil\n end\n outcome = Repositext::Sync::SubtitleMarkCharacterPositions.sync(\n contents, previous_stm_csv\n )\n [Outcome.new(true, { contents: outcome.result, extension: 'subtitle_markers.csv' })]\n end\n end\n end", "title": "" }, { "docid": "e0a76c66ff5c8870fe6a7c606c6ce9fd", "score": "0.5686426", "text": "def write_csv\n original_info = get_original_info\n puts original_info\n updated_info = [\n original_info[\"id\"],\n # Concatenate original and new provenance with dspace special\n # character.\n # If we try to import a csv file with just the updated provenance,\n # it will *overwrite*, not append, so we need to keep the original.\n original_info[\"provenance\"] + \"||\" + METS.provenance\n ]\n CSV.open(@current_csv, \"a\") do |csv|\n csv << updated_info\n end\n end", "title": "" }, { "docid": "5beee91a09f26559c9b560d27fc037a9", "score": "0.5667804", "text": "def example_upsert_file_2\n <<~HEREDOC\n ID,Date,Location,Type,PostCode,Units,Total Units,[00:30],[01:00],[01:30],[02:00],[02:30],[03:00],[03:30],[04:00],[04:30],[05:00],[05:30],[06:00],[06:30],[07:00],[07:30],[08:00],[08:30],[09:00],[09:30],[10:00],[10:30],[11:00],[11:30],[12:00],[12:30],[13:00],[13:30],[14:00],[14:30],[15:00],[15:30],[16:00],[16:30],[17:00],[17:30],[18:00],[18:30],[19:00],[19:30],[20:00],[20:30],[21:00],[21:30],[22:00],[22:30],[23:00],[23:30],[24:00],M1_Code1,M1_Code2\n \"59d21d2b33942ec3d1106ed2126c6b6b\",\"Sep 3 2018 12:00AM\",\"High Littleton C of E Primary School (Academy)\",\"Electricity\",\"BS39 6HF\",\"kWh\",\"24.872\",\"0.166\",\"0.183\",\"0.062\",\"0.068\",\"0.067\",\"0.063\",\"0.093\",\"0.117\",\"0.43\",\"0.068\",\"0.074\",\"0.321\",\"0.929\",\"0.759\",\"0.928\",\"0.7\",\"0.728\",\"0.723\",\"1.051\",\"0.885\",\"0.828\",\"1.048\",\"0.823\",\"0.969\",\"1.098\",\"0.869\",\"0.909\",\"0.952\",\"1.187\",\"0.907\",\"1.092\",\"1.325\",\"0.913\",\"0.853\",\"0.269\",\"0.254\",\"0.274\",\"0.156\",\"0.151\",\"0.448\",\"0.134\",\"0.122\",\"0.243\",\"0.122\",\"0.122\",\"0.116\",\"0.122\",\"0.151\",\"2200012030347\",\"E10BG50326\"\n HEREDOC\n end", "title": "" }, { "docid": "ea680cfa118adbb384bffd0918c6bba4", "score": "0.5623703", "text": "def corresponding_subtitle_markers_csv_file\n return nil if !File.exist?(corresponding_subtitle_markers_csv_filename)\n\n r = RFile::SubtitleMarkersCsv.new(\n File.read(corresponding_subtitle_markers_csv_filename),\n language,\n corresponding_subtitle_markers_csv_filename,\n content_type\n )\n\n if as_of_git_commit_attrs\n ref_commit, relative_version = as_of_git_commit_attrs\n if is_primary?\n # We're staying in the same repo, just use as_of_git_commit_attrs as is.\n r.as_of_git_commit(ref_commit, relative_version)\n else\n # We're jumping from a foreign to the primary repo, so we have to\n # find the latest commit prior or equal to ref_commit in the primary\n # repo.\n foreign_symlinked_stm_csv_file = r\n\n # Compute ref_commit datetime\n foreign_ref_commit_obj = repository.lookup(ref_commit)\n foreign_ref_commit_datetime = foreign_ref_commit_obj.time.utc\n\n # Find latest commit for corresponding primary file\n primary_stm_csv_file_shell = foreign_symlinked_stm_csv_file.corresponding_primary_file\n corresponding_primary_ref_commit_obj = primary_stm_csv_file_shell.latest_git_commit(\n foreign_ref_commit_datetime\n )\n\n primary_stm_csv_file_as_of_git_commit = primary_stm_csv_file_shell.as_of_git_commit(\n corresponding_primary_ref_commit_obj.oid,\n :at_ref_or_raise\n )\n\n # Create new instance of STM CSV file with updated attrs\n r = RFile::SubtitleMarkersCsv.new(\n primary_stm_csv_file_as_of_git_commit.contents,\n language,\n corresponding_subtitle_markers_csv_filename,\n content_type\n )\n r.as_of_git_commit_attrs = as_of_git_commit_attrs\n # Return new file instance\n r\n end\n else\n r\n end\n end", "title": "" }, { "docid": "286a1b2f6a60325f46418ca56ef5ed10", "score": "0.5617232", "text": "def add_timestamp(logging_file)\n row = get_csv_rows(logging_file)\n new_row_num = row + 1\n logging_file.Range(\"A#{new_row_num}\").value = \"------------------------#{Time.now}------------------------\"\nend", "title": "" }, { "docid": "3763ebab16d6de044db495535614ac91", "score": "0.5570135", "text": "def write_line_metadata_to_file\n file = Tempfile.new([\"transcription_line_metadata_#{@transcription.id}-\", '.csv'])\n\n CSV.open(file.path, 'wb') do |csv|\n transcription_line_metadata.each do |csv_line|\n csv << csv_line\n end\n end\n\n file.rewind\n file\n end", "title": "" }, { "docid": "aa5596f4b061e1e5b53a5ae56887a1c3", "score": "0.5521414", "text": "def csv_write_row(openfile, record, writeHeader)\n csvt,csvd = dict_to_csv(record)\n if writeHeader then \n openfile.write(\"\\n---new---\\n\")\n openfile.write(csvt)\n openfile.write(\"\\n\") \n end\n openfile.write(csvd)\n openfile.write(\"\\n\")\nend", "title": "" }, { "docid": "2b2167dbf0c29bf88d18bc49160eab47", "score": "0.5509292", "text": "def populate_metadata_bulk(csv_s3_path)\n # Load the CSV data. CSV should have columns \"sample_name\", \"project_name\", and any desired columns from Sample::METADATA_FIELDS.\n csv_data = get_s3_file(csv_s3_path)\n csv_data.delete!(\"\\uFEFF\") # Remove BOM if present (file likely comes from Excel)\n CSV.parse(csv_data, headers: true) do |row|\n # Find the right project and sample\n row_details = row.to_h\n proj = Project.find_by(name: row_details['project_name'])\n next unless proj\n sampl = Sample.find_by(project_id: proj, name: row_details['sample_name'])\n next unless sampl\n\n # Format the new details. Append to existing notes.\n new_details = {}\n new_details['sample_notes'] = sampl.sample_notes || ''\n row_details.each do |key, value|\n if !key || !value || key == 'sample_name' || key == 'project_name'\n next\n end\n if Sample::METADATA_FIELDS.include?(key.to_sym)\n new_details[key] = value\n else # Otherwise throw in notes\n new_details['sample_notes'] << format(\"\\n- %s: %s\", key, value)\n end\n end\n new_details['sample_notes'].strip!\n sampl.update_attributes!(new_details)\n end\n end", "title": "" }, { "docid": "67f341bfd6f613342b86bcce8082910c", "score": "0.54026884", "text": "def copy_subtitle_marker_csv_files_to_subtitle_export(options)\n input_file_spec = options['input'] || 'content_dir/csv_files'\n input_base_dir_name, input_file_pattern_name = input_file_spec.split(\n Repositext::Cli::FILE_SPEC_DELIMITER\n )\n input_base_dir = config.base_dir(input_base_dir_name)\n # grab source marker_csv file from primary repo\n input_base_dir.gsub!(config.base_dir(:rtfile_dir), config.primary_repo_base_dir)\n output_base_dir = options['output'] || config.base_dir(:subtitle_export_dir)\n\n Repositext::Cli::Utils.copy_files(\n input_base_dir,\n config.file_pattern(input_file_pattern_name),\n output_base_dir,\n /\\.subtitle_markers\\.csv\\z/,\n \"Copying subtitle marker CSV files from content_dir to subtitle_export_dir\",\n options.merge(\n :output_path_lambda => lambda { |input_filename|\n input_filename.gsub(input_base_dir, output_base_dir)\n .gsub(\n /\\/[[:alpha:]]{3}([^\\/\\.]+)\\.subtitle_markers\\.csv/,\n '/\\1.markers.txt'\n )\n }\n )\n )\n end", "title": "" }, { "docid": "a56277a616faa3271770bc374aa31886", "score": "0.5392784", "text": "def update_places_csv(places)\n File.open(PLACES_FILE, 'w') do |line|\n places.each do |i|\n the_line = \"#{i.created_by},#{i.name},#{i.location},#{i.rating},#{i.visits}\\n\"\n line.write the_line\n end\n end\nend", "title": "" }, { "docid": "a02f90154f892c40dfa8a51f1d1da589", "score": "0.5368017", "text": "def update_records_with_csv\n @csv = CSV.read(params[:file])\n @filename = params[:file].original_filename\n update_records\n end", "title": "" }, { "docid": "9dc525acbb77144a3e8ae0516f3c2304", "score": "0.53529084", "text": "def load_artists\n CSV.foreach('data/track1/artistData1.txt', {:col_sep => '|'}) do |row|\n row.each do |value|\n Artist.new do |a|\n a.id = value.to_i\n a.save\n end\n puts \"Created artist with id: #{value}\"\n end\n end\n end", "title": "" }, { "docid": "f7bf4ac43d896ea03e478b05bbb39784", "score": "0.53435254", "text": "def update_csv\n\tCSV.open(@csvname, \"wb\") do |csv|\n\t\tcsv << ['seqno', 'date']\n\t\tcsv << [@currentSeqno, @currentDate]\n\tend\nend", "title": "" }, { "docid": "f5188535d65f3b55b6cf3d79841087f6", "score": "0.5278056", "text": "def added_subtitle_ids\n return [] unless %w[insert split].include?(operation_type)\n affected_stids.inject([]) { |m,e|\n before = e.tmp_before.to_s.strip\n pers_id = e.persistent_id.to_s\n if '' == before || before =~ /\\A\\^\\^\\^ {: \\.rid/\n res = if pers_id.index('tmp-hunk_start')\n # add hunk index\n [hunk_index, pers_id].join('-')\n else\n # use as is\n pers_id\n end\n m << res\n end\n m\n }\n end", "title": "" }, { "docid": "b8f30d18b0bb098f7db1075a38be1074", "score": "0.5252429", "text": "def update_csv\n # We limit the CSV files to 100 lines because dspace may choke if we\n # ask it to import too much metadata at a time.\n @csv_index += 1\n if @csv_index % 100 == 0\n start_csv\n end\n write_csv\n end", "title": "" }, { "docid": "d516d9969b2364a39493b9946f01721d", "score": "0.52178556", "text": "def import_data_from_ibovespa!\n puts \"Importing data from #{IBOVESPA_FILE}\"\n\n @queries += read_csv(IBOVESPA_FILE).map do |line|\n asset = line.to_a.first.last\n\n %{insert into ibovespa (asset) values (\"#{asset}\")}\n end\n end", "title": "" }, { "docid": "3e30d62a6a9d6d308b8f485187c1913f", "score": "0.5195935", "text": "def process_records\n validate_csv\n CSV.parse(@csv, headers: true) do |record|\n if %w(Title URL Example\\ search).all? { |header| record[header].present? }\n record['Fingerprint'] = Hint.fingerprint(record['Example search'])\n Hint.upsert(title: record['Title'], url: record['URL'],\n fingerprint: record['Fingerprint'], source: @source)\n end\n end\n end", "title": "" }, { "docid": "144d36b07cc238ba73f7a543bfd9cfc6", "score": "0.51903033", "text": "def save\n tag1 = {\n 'artist' => @data['artist'],\n 'year' => @data['year'],\n 'album' => @data['album'],\n 'tracknum' => @data['index'].to_i,\n 'title' => @data['title']\n }\n tag2 = {\n 'TPE1' => @data['artist'],\n 'TYER' => @data['year'],\n 'TALB' => @data['album'],\n 'TPOS' => @data['cd'],\n 'TRCK' => @data['index'],\n 'TIT2' => @data['title']\n }\n\n # Predefined genres\n if @data['type'] == \"podcasts\"\n tag1['genre'] = 101 # There is no value for podcast in id3 v1, so we use \"speech\" instead\n tag2['TCON'] = \"Podcast\"\n end\n if @data['type'] == \"soundtracks\"\n tag1['genre'] = 24\n tag2['TCON'] = \"Soundtrack\"\n end\n\n puts \"Rewriting id3 tags of #{File.basename(@file)}\"\n Mp3Info.open(@file) do |mp3info|\n set_tags_to_file(mp3info.tag1, tag1)\n set_tags_to_file(mp3info.tag2, tag2)\n end\n\n # Mp3Info.open(@file) do |mp3info|\n # puts \"-----\"\n # puts \"tag1 :\"\n # p mp3info.tag1\n # puts \"tag2 :\"\n # p mp3info.tag2\n # puts \"tag :\"\n # p mp3info.tag\n # end\n end", "title": "" }, { "docid": "900ebf557e82266b21889711ff57dfe1", "score": "0.5182577", "text": "def enrich_aligned_subtitle_pair_attributes(aligned_subtitle_pairs)\n enriched_aligned_subtitle_pairs = []\n most_recent_existing_subtitle_id = nil # to create temp subtitle ids\n temp_subtitle_offset = 0\n # Compute truncation length for sim_left and sim_right. We only\n # consider the first/last N chars. This length is aligned with\n # max_conf_at_char_length in `StringComputations.similarity`.\n half_truncation_length = 15\n\n aligned_subtitle_pairs.each_with_index { |asp,idx|\n st_index = idx + 1 # subtitle indexes are one-based\n # Assign Subtitle object\n st_obj = if '' == asp[:from][:content]\n # Subtitle doesn't exist in `from` content, create temp subtitle object\n p_id = if '' == asp[:to][:persistent_id].to_s.strip\n # We're computing new st_ops, assign temporary stid\n [\n 'tmp-',\n most_recent_existing_subtitle_id || 'new_file',\n '+',\n temp_subtitle_offset += 1,\n ].join\n else\n # We're re-computing existing st_ops, use existing stid\n asp[:to][:persistent_id]\n end\n ::Repositext::Subtitle.new(\n persistent_id: p_id,\n tmp_attrs: { index: st_index },\n record_id: asp[:to][:record_id]\n )\n else\n # Subtitle id exists in `from` content, use it.\n # NOTE: We use record_id from `to`!\n most_recent_existing_subtitle_id = asp[:from][:persistent_id]\n ::Repositext::Subtitle.new(\n persistent_id: most_recent_existing_subtitle_id,\n record_id: asp[:to][:record_id],\n tmp_attrs: { index: st_index },\n )\n end\n st_obj.tmp_attrs[:before] = asp[:from][:content]\n st_obj.tmp_attrs[:after] = asp[:to][:content]\n asp[:subtitle_object] = st_obj\n\n # Compute various similarities between deleted and added content\n sim_text_from = asp[:from][:content_sim]\n sim_text_to = asp[:to][:content_sim]\n asp[:sim_left] = StringComputations.similarity(\n sim_text_from,\n sim_text_to,\n half_truncation_length,\n :left\n )\n asp[:sim_right] = StringComputations.similarity(\n sim_text_from,\n sim_text_to,\n half_truncation_length,\n :right\n )\n asp[:sim_abs] = StringComputations.similarity(\n sim_text_from,\n sim_text_to,\n false # look at all chars, don't truncate\n )\n\n # Compute remaining attrs\n asp[:content_length_change] = (\n asp[:to][:content].strip.length - asp[:from][:content].strip.length\n ) # neg means text removal\n asp[:subtitle_count_change] = compute_subtitle_count_change(asp)\n\n asp[:has_repetitions] = compute_repetitions(\n asp[:from][:repetitions],\n asp[:to][:repetitions]\n )\n asp[:index] = st_index\n # Take first and last_in_para from `to` st\n asp[:first_in_para] = asp[:to][:first_in_para]\n asp[:last_in_para] = asp[:to][:last_in_para]\n\n asp[:type] = compute_subtitle_pair_type(asp)\n enriched_aligned_subtitle_pairs << asp\n }\n enriched_aligned_subtitle_pairs\n end", "title": "" }, { "docid": "550361535022e1794f080eb138ecaa13", "score": "0.51777107", "text": "def bulk_insert file,file_id\n tmp = File.join Conf::directories.tmp,\"insert_#{file.name}.data\"\n ## make sure we are not taking random datas\n File.delete(tmp) if File.exists?(tmp)\n @tmp_file = File::open(tmp,\"w\")\n sql_fields = nil\n SignalHandler.ensure_block {@tmp_file.close; File.delete(tmp) }\n line = 0\n ## decoding\n @curr_source.decoder.decode file do |fields,record|\n sql_fields ||= fields\n write_to_file fields,record,file_id\n line += 1\n Logger.<<(__FILE__,\"INFO\",\"Decoded #{line} records from #{file.name}...\",inline: true) if line % 10000 == 0\n end\n @tmp_file.close\n ## insertion\n ## with file_id before\n sql = \"LOAD DATA CONCURRENT LOCAL INFILE '#{tmp}' \" + \n \" INTO TABLE #{@curr_source.schema.table_records} \" +\n RubyUtil::sqlize(['file_id'] + sql_fields.keys,no_quote:true)\n Database::Mysql::send_raw_sql_cmd sql\n File.delete(tmp) if File.exists?(tmp)\n end", "title": "" }, { "docid": "d2650d26e699fb1485b4de1661560969", "score": "0.51750726", "text": "def corresponding_subtitle_import_markers_file(respect_as_of_git_commit_attrs=true)\n return nil if !File.exist?(corresponding_subtitle_import_markers_filename)\n r = RFile::SubtitleMarkersCsv.new(\n File.read(corresponding_subtitle_import_markers_filename),\n language,\n corresponding_subtitle_import_markers_filename,\n content_type\n )\n if respect_as_of_git_commit_attrs && as_of_git_commit_attrs\n r.as_of_git_commit(*as_of_git_commit_attrs)\n else\n r\n end\n end", "title": "" }, { "docid": "6f61feacbb5c79dd24937b964be29d0d", "score": "0.5174048", "text": "def process_records\n validate_csv\n CSV.parse(@csv, headers: true) do |record|\n if ['Title', 'URL', 'Example search'].all? { |header| record[header].present? }\n record['Fingerprint'] = Hint.fingerprint(record['Example search'])\n Hint.upsert(title: record['Title'], url: record['URL'],\n fingerprint: record['Fingerprint'], source: @source)\n end\n end\n end", "title": "" }, { "docid": "fd43cd9523ab96e8b90ef34c7d18f354", "score": "0.51692617", "text": "def write_data\n table = STI[self.class.name]\n table.delete_all\n\n lines = CsvStorage.find_by!(csv_file_type: self.class.name).data_store.lines\n lines.shift(self.class::SKIP_LINES_BEFORE_HEADER)\n\n headers = get_headers(clean_line(lines.shift))\n lines.shift(self.class::SKIP_LINES_AFTER_HEADER)\n\n row = nil\n line = nil\n row_number = 1 + self.class::SKIP_LINES_BEFORE_HEADER +\n self.class::SKIP_LINES_AFTER_HEADER\n\n begin\n ActiveRecord::Base.transaction do\n lines.each do |l|\n row_number += 1\n\n line = clean_line(l) || \"\"\n row = get_row(line, headers)\n\n # Allow a block, if given to determine if row is created\n unless row.values.join.blank?\n table.create!(row) if !block_given? || yield(row)\n end\n end\n end\n rescue StandardError => e\n msg = \"row #{row_number}: #{e.message} '#{line.inspect}' \"\n raise StandardError.new(msg)\n end\n end", "title": "" }, { "docid": "3c5d1a70806e67ff273644dd6dbf4a09", "score": "0.5138474", "text": "def write_positions(filename, conditions, sql)\n sql << \" WHERE #{conditions.join(\" AND \")} AND positions IS NOT NULL\"\n rows = run_query(sql)\n\n # in Speaker, each row contains a string with a set of dash-separated start and end\n # positions that need to be split and spaces replaced by newlines. Unlike with CorpusText\n # we cannot ask MySQL to write directly to outfile since we need to do this processing\n # first.\n rows.map! { |row| row.gsub(/\\s+/, \"\\n\").gsub(/-/, \"\\t\") }\n File.write(filename, rows.join(\"\\n\"))\n end", "title": "" }, { "docid": "12ac9c321691c85998fba858085c2924", "score": "0.51174545", "text": "def cts_sqlite_writeline(madhab, tafseer, line_no)\n current_txt = Pathname(\"../../corpora/altafsir_com/processed/plain/complete/%03d-%03d.txt\" % [madhab, tafseer])\n return unless File.exist? current_txt\n begin\n text = remove_specialchars(@hash['text'])\n if _urn = urn(line_no)\n CTSUnit.create(\n cts_urn: _urn,\n text: text,\n text_hash: Digest::MD5.hexdigest(text),\n label: @hash['aaya'],\n title: @hash['meta_title'],\n author_name: @hash['meta_author'],\n author_era: @hash['meta_year'],\n category_id: @hash['position_madhab'],\n author_id: @hash['position_tafsir'],\n sura_id: @hash['position_sura'].to_i,\n aaya_id: @hash['position_aaya'].to_i\n )\n end\n rescue Exception => e\n puts \"INSERT failed: #{e.inspect}\"\n return\n end\n end", "title": "" }, { "docid": "359a1337532659af7ba26f7923b8f469", "score": "0.5099766", "text": "def cts_csv_writeline(madhab, tafseer, line_no, opts = {nospecialchars: false})\n # @hash contents example:\n #\n # {\"position_sura\"=>1,\n # \"position_aaya\"=>1,\n # \"position_madhab\"=>1,\n # \"position_tafsir\"=>1,\n # \"meta_title\"=>\"تفسير جامع البيان في تفسير القرآن\",\n # \"meta_author\"=>\"الطبري\",\n # \"meta_year\"=>\"310\",\n # \"aaya\"=>\"بِسْمِ اللَّهِ الرَّحْمَٰنِ الرَّحِيمِ\",\n # \"text\"=>\n # \"<section><p>القول فـي تأويـل { بِسْمِ }.\n return unless urn = encode_urn(line_no)\n outname = \"%03d-%03d.csv\" % [madhab, tafseer]\n optname = (opts.map {|k,v| k if v}).compact.join(',')\n outpath = File.join(@outpath, 'csv', ['cts+aaya', optname].reject {|i| i.empty?}.join('_'))\n text = @hash['text']\n text = remove_specialchars(text) if opts[:nospecialchars]\n values = [urn, text, @hash['aaya']]\n outfile = File.join(outpath, outname)\n FileUtils.mkdir_p(outpath)\n write_header = !(File.file?(outfile))\n header = ['urn', 'text', 'aaya']\n CSV.open(outfile, 'ab') do |csv|\n if write_header\n csv << header\n else\n csv << values\n end\n end\n end", "title": "" }, { "docid": "655a59a32967ff0863f553c1b149f4f1", "score": "0.50994617", "text": "def simple_position_csv(filename)\n filename = \"tmp/#{filename}.csv\"\n CSV.open(filename, \"wb\") do |csv|\n csv << [\"phrase\", \"positions\"]\n first_n.each do |hash|\n csv << [hash.first.to_s] + hash.last.positions\n end\n end\n puts \" #{filename} - created\"\n end", "title": "" }, { "docid": "411e171e0b272fd014f11f63d8714d93", "score": "0.5089912", "text": "def merge_subtitle_marks_from_subtitle_import_into_content_at(options)\n input_file_spec_subtitle_import = options['input_1'] || 'subtitle_import_dir/txt_files'\n input_file_pattern_subtitle_import = config.compute_glob_pattern(input_file_spec_subtitle_import)\n base_dir_subtitle_import = config.base_dir(:subtitle_import_dir)\n base_dir_content = options['input_2'] || config.base_dir(:content_dir)\n base_dir_output = options['output'] || config.base_dir(:content_dir)\n\n $stderr.puts 'Merging :subtitle_mark tokens from subtitle_import into content_at'\n $stderr.puts '-' * 80\n merge_subtitle_marks_from_subtitle_shared_into_content_at(\n input_file_pattern_subtitle_import,\n base_dir_subtitle_import,\n base_dir_content,\n options\n )\n end", "title": "" }, { "docid": "813791bdad352f5bcc99ace653eafd17", "score": "0.50801146", "text": "def copy_subtitle_marker_csv_files_to_content(options)\n input_file_spec = options['input'] || 'subtitle_tagging_import_dir/txt_files'\n input_base_dir_name, input_file_pattern_name = input_file_spec.split(\n Repositext::Cli::FILE_SPEC_DELIMITER\n )\n input_base_dir = config.base_dir(input_base_dir_name)\n output_base_dir = options['output'] || config.base_dir(:content_dir)\n\n Repositext::Cli::Utils.copy_files(\n input_base_dir,\n config.file_pattern(input_file_pattern_name),\n output_base_dir,\n /\\.markers\\.txt\\z/,\n \"Copying subtitle marker CSV files from subtitle_tagging_import_dir to content_dir\",\n options.merge(\n :output_path_lambda => lambda { |input_filename|\n input_filename.gsub(input_base_dir, output_base_dir)\n .gsub(\n /\\/([^\\/\\.]+)\\.markers\\.txt/,\n '/' + config.setting(:language_code_3_chars) + '\\1.subtitle_markers.csv'\n )\n }\n )\n )\n end", "title": "" }, { "docid": "f1a98c3435765bd2628e14a9ccb4f418", "score": "0.5073822", "text": "def append_data_to_file(file, data_map)\n\n CSV.open(randomized_write_file(), \"ab\") do |csv|\n csv << [file.gsub(\",\", \"\"), CLASSIFIED_TYPE, data_map.map { |k,v| \"#{k}:#{v}\" }].flatten(1)\n end\nend", "title": "" }, { "docid": "e879fae7e2f090ee5dbab0266df19807", "score": "0.5068014", "text": "def update(author, content, n)\n puts author\n puts content\n\n rows_array = CSV.read('db/gossip.csv')\n rows_array[n][0] = author\n rows_array[n][1] = content\n CSV.open('db/gossip.csv', 'wb') { |csv| rows_array.each{|row| csv << row}}\n \n \n end", "title": "" }, { "docid": "6f34b792ff7609d9b93f14f1ae3d8892", "score": "0.5065931", "text": "def create_csv_from_txt(txt_file_path)\n record_lines = []\n File.open(txt_file_path, \"r\") do |f|\n f.each_line do |line|\n details = []\n details << line.split(' ') unless line[0] == 'H'\n details.each do |record|\n record.delete_at(2)\n record[2] = 'F.MASSA' if record[2] == 'F.MASS'\n record[5].gsub!(/,/, '.')\n record_lines << record\n end\n end\n end\n csv_options = { col_sep: ',', force_quotes: true, quote_char: '\"' }\n CSV.open(\"./db/kart_log.csv\", \"wb\", csv_options) do |csv|\n csv << [\"Hora\", \"Codigo\", \"Piloto\", \"Nº Volta\", \"Tempo da Volta\", \"Velocidade média da volta\"]\n record_lines.each {|line| csv << line}\n end\n return \"./db/kart_log.csv\"\nend", "title": "" }, { "docid": "f10c0045328ff394e6e391900823e956", "score": "0.5059114", "text": "def save\n \t\tCSV.open(\"./db/gossip.csv\", \"ab\") do |csv|\n \tcsv << [@author, @content]\n \t\tend\n\tend", "title": "" }, { "docid": "d27a451657d470f35f171bf1ebb792ac", "score": "0.5035067", "text": "def import_a_igcfile(file)\n\n columns = [ :lat_lon, :baro_alt, :gps_alt, :enl, :seq_secs, :igcfile_id, :rlat, :rlon, :x, :y]\n options = { :validate => false }\n line_save=\"\"\n\n sma=[]\n\n objects = []\n num_recs=1 # to prevent divide by zero\n counter=0\n\n begin\n igcfile = Igcfile.new()\n igcfile.filename=file\n igcfile.save!\n rescue\n next\n end\n\n start = Time.now\n\n # I033638FXA3941ENL4247REX an I record defines B record extensions\n counter=0\n time=0\n fp = File.open(file, \"r\")\n contents = fp.read\n\n # get I record\n b_extensions2 = Hash.new\n contents.each_line do |line|\n a=line.unpack('a1a2a7a7a7a7a7a7a7') # hopefully enough\n if a[0]=='A'\n next\n end\n if a[0]=='H'\n next\n end\n if a[0]=='I'\n if not a[1].nil?\n 0.upto(a[1].to_i){|n|\n b=a[n+2].unpack('a2a2a3')\n b_extensions2[b[2]]={:start => b[0], :finnish => b[1]}\n }\n end\n break\n end\n break\n end\n\n if b_extensions2.length == 0\n puts 'No I record'\n end\n\n if b_extensions2['ENL'].nil?\n puts 'No ENL in I record'\n else\n # puts b_extensions2['ENL'].inspect\n end\n\n # last_time=0\n contents.each_line do |line|\n # 0(1)=rec, 1(6)=time, 2(8)=lat, 3(9)=lon, 4(1)=validity, 5(5)=baro_alt, 6(5)=gps_alt\n # optional see Irec 7(3)=fix_accuracy, 8(2)=num_satelites, 9(3)=enl\n line_save=line\n\n a=line.unpack('a1a6a8a9a1a5a5a')\n if a[0].to_s == 'B'\n\n num_recs=num_recs+1\n\n # time B0915235535648N01340869EA-006900049000\n h,m,s = a[1].scan(%r{(\\d{2})(\\d{2})(\\d{2})}).flatten\n time = h.to_i * 3600 + m.to_i * 60 + s.to_i\n # if last_time==0\n # last_time=time\n # end\n\n # enl\n if hv=b_extensions2['ENL']\n enl=line[hv[:start].to_i..hv[:finnish].to_i]\n else\n enl='0'\n end\n\n dd,mm,mmm,ns = a[2].scan(%r{(\\d{2})(\\d{2})(\\d{3})(\\w{1})}).flatten #Latitude DDMMMMMN Valid characters N, S, 0-9\n rlat = ((dd.to_f + mm.to_f/60 + (mmm.to_f/1000)/60))*RAD_PER_DEG\n rlat = - rlat unless ns=='N'\n\n ddd,mm,mmm,ew = a[3].scan(%r{(\\d{3})(\\d{2})(\\d{3})(\\w{1})}).flatten #Longitude DDDMMMMME Valid characters E,W, 0-9\n rlon = ((ddd.to_f + mm.to_f/60 + (mmm.to_f/1000)/60))*RAD_PER_DEG\n rlon = - rlon unless ew=='E'\n\n # cartesian\n x = RADIUS * Math.cos(rlat) * Math.cos(rlon)\n y = RADIUS * Math.cos(rlat) * Math.sin(rlon)\n\n objects << [ a[2]+','+a[3],a[5].to_i,a[6].to_i,enl.to_i, time, igcfile.id,rlat,rlon,x.to_i,y.to_i]\n\n # last_time=time\n\n # the import bogs down if there are too many records so chop it up\n counter=counter+1\n if counter > 100\n Igcpoint.import(columns, objects, options)\n objects=[]\n counter=0\n end\n end\n end\n\n#logger 6\n#time 6\n#date 6\n\n Igcpoint.import(columns, objects, options) unless objects.length==0\n\n secs = Time.now - start\n puts file.to_s + ' ' + num_recs.to_s + ' ' + (num_recs/secs).to_i.to_s\n STDOUT.flush\n\n fp.close\n num_recs\n end", "title": "" }, { "docid": "c6c0d93ecbc4ceeb66bfdded465613d6", "score": "0.5026969", "text": "def save_records2(key, records)\n records.each do |record|\n time = Time.parse(record[\"data\"][\"created_at\"]).to_f\n @storage.put2(key, time, record)\n end\n end", "title": "" }, { "docid": "e10bec4bca2edd2c20cfcd95be071cf6", "score": "0.50228775", "text": "def update_metadata_to_file\n # update meta-data from database\n song_file = self.song.path\n title = self.title\n artist_name = self.artist_name\n album_name = self.album_name\n track = self.track\n genre = self.genre\n if File.exists?(song_file)\n begin\n Mp3Info.open(song_file) { |mp3|\n mp3.tag.title = title unless title.blank?\n mp3.tag.artist = artist_name unless artist_name.blank?\n mp3.tag.album = album_name unless album_name.blank?\n mp3.tag.tracknum = track.to_i unless track.blank?\n mp3.tag.genre = genre unless genre.blank?\n }\n rescue =>exp\n logger.error \"Error in UpdateMetadataToFile => #{exp.message}\"\n end\n else\n puts \"No file exists with name : #{song_file}\"\n end \n end", "title": "" }, { "docid": "3382bc22951564eba2f3595cdb5259b7", "score": "0.50215316", "text": "def write_capturelog(logging_file,desired_info)\n row_count = get_csv_rows(logging_file)\n keyword = [\"<warning>\",\"<notice>\",\"<err>\"]\n str_array = desired_info.split(\"\\n\")\n \n # write the header for this sheet\n for col in 0..2\n column = (65 + col).chr #65 is the ASCII \"A\"\n row_index = row_count + 1\n logging_file.Range(\"#{column}#{row_index}\").value = keyword[col]\n end\n\n write_index = 1\n row_count = row_count + 1\n str_array_size = str_array.size - 1\n for line in 0..str_array_size\n key_index = 0\n\n # start checking keyword for a match\n keyword.each do |key| \n regexp = /\\.*#{key}/\n if str_array[line] =~ regexp\n line_info = Array.new\n \n # get the lines in the log that match the one of the parse keys\n for i in 0..keyword.length - 1\n if i == key_index\n line_info.push str_array[line].to_s.chomp #add parsed value to the suitable position in a csv line.\n else\n line_info.push \" \" # put empty information for unmatch keyword in a csv line.\n end\n end\n\n #write the information into cells\n line_info_size = line_info.size - 1\n for j in 0..line_info_size\n column = (65 + j).chr #65 is the ASCII \"A\"\n row_index = row_count + write_index\n logging_file.Range(\"#{column}#{row_index}\").value = line_info[j]\n end\n write_index = write_index + 1\n end\n\n key_index = key_index + 1\n end\n end\nend", "title": "" }, { "docid": "8673e748ce57cd8dc1325ba6072363fa", "score": "0.5013113", "text": "def save\n \tCSV.open(\"./db/gossip.csv\", \"ab\") do |csv|\n \t\tcsv << [@author, @content]\n \tend \n end", "title": "" }, { "docid": "1365bfc92086c3f588d2cc8c97c55bd8", "score": "0.50103724", "text": "def save_to_file(line); end", "title": "" }, { "docid": "1365bfc92086c3f588d2cc8c97c55bd8", "score": "0.50103724", "text": "def save_to_file(line); end", "title": "" }, { "docid": "5755617f9c68af4c9f5a73585194f621", "score": "0.5005856", "text": "def write_memory(logging_file,desired_info)\n first_line = true\n row_count = get_csv_rows(logging_file)\n str_array = desired_info.split(\"\\n\")\n\n write_index = 1\n str_array_size = str_array.size - 1\n for i in 0..str_array_size\n # ignore the last sentence and title\n if str_array[i] =~ /Press <Enter> to return to menu|Memory Usage/\n next\n end\n #ignore the empty line\n if str_array[i] == \"\"\n next\n end\n\n line_info = Array.new \n #first line miss a empty value to fill the information into cells, so there is a flag to hlep deal with it. \n if first_line\n line_info.push(\" \")\n str_array[i].split(\" \").each{|element| line_info.push(element) }\n first_line = false\n else\n line_info = str_array[i].split(\" \")\n end\n \n #write the information into cells\n line_info_size = line_info.size - 1\n for j in 0..line_info_size\n column = (65 + j).chr #65 is the ASCII \"A\"\n row_index = row_count + write_index\n logging_file.Range(\"#{column}#{row_index}\").value = line_info[j]\n end\n write_index = write_index + 1\n end\nend", "title": "" }, { "docid": "744b91c65235a5de7520cb13a15851ec", "score": "0.50051624", "text": "def update_records(datafile)\n\t\tfile = File.new('activity_log.txt', 'a+')\n\n\t\n\t\trowNumber = 1\n\t\t\n\t\t\tdatafile.read.each_line do |line|\n\t\t\t\n\t\t\t\t\tCSV.parse(line) do |row|\n\n\t\t\t\t\t\tcount = 0\n\t\t\t\t\t\tif row.length == 0\n\t\t\t\t\t\t\tlog = \"No data in input row #{rowNumber}\"\n\n\t\t\t\t\t\telse\n\t\t\t\t\t\t\tif row.length <= 9 && row.length > 0\n\t\t\t\t\t\t\t\tif row[1].nil?\n\t\t\t\t\t\t\t\t\tlog = \"No PID to retrieve archival object #{rowNumber}\"\n\n\t\t\t\t\t\t\t\telse\n\n\t\t\t\t\t\t\t\t\tif row[0] == \"title\" && row[1] == \"pid\"\n\t\t\t\t\t\t\t\t\t\tlog << \"Header row\"\n\t\t\t\t\t\t\t\t\telse\n\n\n\t\t\t\t\t\t\t\t\t\tparsedID3 = row[1]\n\t\t\t\t\t\t\t\t\t\tcount = count + 1\n\t\t\t\t\t\t\t\t\t\t####################################################################################################\n\t\t\t\t\t\t\t\t\t\t####################################################################################################\n\t\t\t\t\t\t\t\t\t\t#########################\t\t\tRegex Location 2\t\t\t\t\t ##########################\n\t\t\t\t\t\t\t\t\t\t####################################################################################################\n\t\t\t\t\t\t\t\t\t\t####################################################################################################\n\t\t\t\t\t\t\t\t\t\t####\tthe regex in the following line is configured to match the format used by \n\t\t\t\t\t\t\t\t\t\t####\tTufts University Digital Collection & Archives. You may need to adjust this according\n\t\t\t\t\t\t\t\t\t\t####\tto the needs of your institution.\n\t\t\t\t\t\t\t\t\t\tparsedID = parsedID3.gsub(/(\\w+\\:)?(.+)/, '\\2')\n\t\t\t\t\t\t\t\t\t\tlog = \"#{parsedID}: \"\n\n\t\t\t\t\t\t\t\t\t\tif search_data = Search.all(session[:repo_id], {\n\t\t\t\t\t\t\t\t\t\t\"q\" => \"\\\"#{parsedID}\\\"\" , \"filter_term[]\" => { \"primary_type\" => \"archival_object\" }.to_json\n\t\t\t\t\t\t\t\t\t\t})\n\n\t\t\t\t\t\t\t\t\t\t\tif search_data.results?\n\t\t\t\t\t\t\t\t\t\t\t\tsearch_data['results'].each do |result|\n\t\t\t\t\t\t\t\t\t\t\t\t\tbegin obj = JSON.parse(result['json'])\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tif obj['component_id'] = parsedID\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t##############\tcheck if each field exists. If any don't, it's an update request. If all do, it's a create request\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t##############\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbegin item = JSONModel::HTTP.get_json(obj['uri'])\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t####################################################################################################\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t####################################################################################################\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t#########################\t\t\tRegex Location 3\t\t\t\t\t ##########################\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t####################################################################################################\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t####################################################################################################\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t####\tthe regex in the following line is configured to match the format used by \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t####\tTufts University Digital Collection & Archives. You **will** need to adjust this according\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t####\tto the needs of your institution.\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t####\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t####\tNote that if you use the prefix format below, you should change the phrase to match\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t####\tyour institution\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tparsedID2 = parsedID.gsub(/(.+)/, '<your_institution>:\\1')\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# the following statements check if there is a value in each of the 9 fields, \n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# and in several cases checks for spefic values like True/False\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif row[0].nil?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle = \"\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount = count + 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttitle = row[0].strip\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif row[2].nil?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thandle = \"\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount = count + 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\thandle = row[2]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif row[3].nil?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocation = \"\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount = count + 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlocation = row[3]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif row[4].nil?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdo_publish = \"\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount = count + 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif row[4] == \"TRUE\" || row[4] == \"true\" || row[4] == \"True\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdo_publish = true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tdo_publish = false\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif row[5].nil?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tres = \"\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount = count + 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif row[5] == \"Open for research.\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tres = false\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tres = true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif row[6].nil?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfv_publish = \"\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount = count + 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif row[6] == \"TRUE\" || row[6] == \"true\" || row[6] == \"True\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfv_publish = true\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tfv_publish = false\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif row[7].nil?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tchecksum = \"\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount = count + 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tchecksum = row[7]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t\t\t\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif row[8].nil?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tchecksum_method = \"\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif row[8] != \"md5\" && row[8] != \"sha-1\" && row[8] != \"sha-256\" && row[8] != \"sha-384\" && row[8] != \"sha-512\" && row[8] != \"Advanced Checksum Verifier\" && row[8] != \"md5 UNIX\" && row[8] != \"Bagger 2.1.2\" && row[8] != \"NA\" && row[8] != \"python hashlib\" && row[8] != \"Advanced Checksum\" && row[8] != \"Bagger 2.6.2\" && row[8] != \"UNIX md5\" && row[8] != \"Bagger\" && row[8] != \"Bagger 2.1.3\" && row[8] != \"Bagger 2.1.3.\" && row[8] != \"Bagger2.1.3\" && row[8] != \"Bagger2.1.3.\" && row[8] != \"MD5 and SHA Checksum Utility\" && row[8] != \"Bagger-2.7.7\" && row[8] != \"Bagger 2.7.7\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tchecksum_method = \"Invalid checksum method\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tcount = count + 1\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tchecksum_method = row[8]\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# this is for creating a new digital object\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# only create a new digital object if there are no existing digital object instances\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# under the archival object\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif count > 0 && count <= 9\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif count == 9\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif item['instances'].empty?\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbegin item, log = add_digital_object(item, handle, log, parsedID2, title, do_publish, res, fv_publish, location, checksum, checksum_method, rowNumber)\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trescue\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlog << \"Couldn't add digital object for row #{rowNumber}\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif item['instances'].map{ |i| i['instance_type'] }.include?(\"digital_object\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlog << \"There is already a digital object for row #{rowNumber}\"\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\titem, log = add_digital_object(item, handle, log, parsedID2, title, do_publish, res, fv_publish, location, checksum, checksum_method, rowNumber)\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trescue\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlog << \"Couldn't add digital object for row #{rowNumber}\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t# this is for updating an existing digital object\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telsif count > 0 && count < 9\n\t\t\t\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tif item['instances'].map{ |i| i['instance_type'] }.include?(\"digital_object\")\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\titem['instances'].each do |instance|\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlog = update_digital_object(instance, handle, log, parsedID2, title, do_publish, res, fv_publish, location, checksum, checksum_method, rowNumber, count)\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trescue\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlog << \"Couldn't edit digital object for #{parsedID}\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlog << \"No digital object to update for input row #{rowNumber}\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlog << \"Wrong number of fields in input row #{rowNumber}\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tbegin\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tJSONModel::HTTP.post_json(URI(\"#{JSONModel::HTTP.backend_url}#{obj['uri']}\"), item.to_json)\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trescue\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlog << \"Can't post archival object for input in row #{rowNumber}\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlog << \"Wrong number of fields in input row #{rowNumber}\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\trescue\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlog << \"Can't return json item from AO URI for row #{rowNumber}\"\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tlog << \"can't assign PID from input for row #{rowNumber}\"\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\t\t\trescue\n\t\t\t\t\t\t\t\t\t\t\t\t\t\tlog << \"Can't get the JSON representation of the archival object for row #{rowNumber} - AO: #{parsedID}\"\n\t\t\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\t\tlog << \"No matching archival object for input row #{rowNumber}\"\n\n\t\t\t\t\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\t\t\t\tlog << \"Can't execute search for input row #{rowNumber}\"\n\t\t\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\t\t\tend # end else not the header row\n\t\t\t\t\t\t\t\tend\n\n\t\t\t\t\t\t\telse\n\t\t\t\t\t\t\t\tlog << \"Wrong number of fields in input row #{rowNumber}\"\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\tend\n\n\t\t\t\t\t\tfile.puts(log)\n\t\t\t\t\tend\n\n\t\n\t\t\t\trowNumber = rowNumber + 1\n\t\t\tend\n\n\t\treturn file\n\tend", "title": "" }, { "docid": "0b6320bb60f31d6ce8ade27a0b1b187f", "score": "0.49984238", "text": "def store_samples_and_data_from_file\n require 'chronic' #for robust timestamp parsing\n begin #rescue errors\n data_stream =\"\"\n timestamp_col =\"\"\n sample_id_col = \"\"\n vertical_offset_col = \"\"\n starting_vertical_offset_col = \"\"\n ending_vertical_offset_col = \"\"\n site = parent.managed_repository{Voeis::Site.first(:id => params[:site])}\n redirect_path =Hash.new\n @source = Voeis::Source.get(params[:source])\n @project_source = nil\n parent.managed_repository do\n @project_source = Voeis::Source.first_or_create(:organization => @source.organization, \n :source_description => @source.source_description,\n :source_link => @source.source_link, \n :contact_name => @source.contact_name, \n :phone => @source.phone, \n :email =>@source.email, \n :address => @source.address, \n :city => @source.city, \n :state => @source.state, \n :zip_code => @source.zip_code, \n :citation => @source.citation, \n :metadata_id =>@source.metadata_id)\n end\n \n columns_array = Array.new\n ignore_array = Array.new\n meta_tag_array = Array.new\n (1..params[:row_size].to_i).each do |i|\n columns_array[i-1] = params[\"column\"+i.to_s]\n ignore_array[i-1] = params[\"ignore\"+i.to_s]\n meta_tag_array[i-1] = params[\"tag_column\"+i.to_s]\n if params[\"column\"+i.to_s] == \"timestamp\"\n timestamp_col = i-1\n elsif params[\"column\"+i.to_s] == \"sample_id\"\n sample_id_col = i-1\n elsif params[\"column\"+i.to_s] == \"vertical_offset\"\n vertical_offset_col = i-1\n elsif params[\"column\"+i.to_s] == \"starting_vertical_offset\"\n vertical_offset_col = i-1\n elsif params[\"column\"+i.to_s] == \"ending_vertical_offset\"\n ending_vertical_offset_col = i-1\n end\n end\n if !params[:DST].nil?\n dst_time = 1\n dst = true\n else\n dst_time = 0\n dst = false\n end\n #if the timestamp is in UTC then don't apply the calculate utc_offset just use 0\n if params[:time_support] == \"UTC\"\n dstream_utc_offset = 0\n else\n dstream_utc_offset = params[:utc_offset].to_i\n end\n #get or create the DataStream\n if params[:save_template] == \"true\"\n data_stream_id = create_sample_and_data_parsing_template(params[:template_name], timestamp_col, sample_id_col, columns_array, ignore_array, site, params[:datafile], params[:start_line], params[:row_size], vertical_offset_col, ending_vertical_offset_col, meta_tag_array, dstream_utc_offset, dst, @project_source)\n data_stream = parent.managed_repository{Voeis::DataStream.get(data_stream_id[:data_template_id])}\n else\n data_stream = parent.managed_repository{Voeis::DataStream.get(params[:data_stream_id])}\n end \n \n range = params[:row_size].to_i - 1\n #store all the Variables in the managed repository\n @col_vars = Array.new\n @variables = Array.new\n (0..range).each do |i|\n if columns_array[i] != nil && columns_array[i] != \"ignore\" && ignore_array[i] != i && i != timestamp_col && i != sample_id_col && i != vertical_offset_col && ending_vertical_offset_col != i && meta_tag_array[i].to_i == -1\n @var = Voeis::Variable.get(columns_array[i].to_i)\n parent.managed_repository do \n # variable = Voeis::Variable.first_or_create(\n # :variable_code => @var.variable_code,\n # :variable_name => @var.variable_name,\n # :speciation => @var.speciation,\n # :variable_units_id => @var.variable_units_id,\n # :sample_medium => @var.sample_medium,\n # :value_type => @var.value_type,\n # :is_regular => @var.is_regular,\n # :time_support => @var.time_support,\n # :time_units_id => @var.time_units_id,\n # :data_type => @var.data_type,\n # :general_category => @var.general_category,\n # :no_data_value => @var.no_data_value,\n # :detection_limit => @var.detection_limit,\n # :value_type => @var.value_type,\n # :field_method_id => @var.field_method_id,\n # :lab_id => @var.lab_id,\n # :lab_method_id => @var.lab_method_id,\n # :spatial_offset_type => @var.spatial_offset_type,\n # :spatial_offset_value => @var.spatial_offset_value,\n # :spatial_units_id => @var.spatial_units_id\n # )\n if Voeis::Variable.get(@var.id).nil?\n variable = Voeis::Variable.new\n variable.attributes = @var.attributes\n variable.save!\n else\n variable = Voeis::Variable.get(@var.id)\n end\n @col_vars[i] = variable\n @variables << variable\n site.variables << variable\n site.save\n end#managed repo\n end #end if\n end #end i loop\n #site.save\n #create csv_row array\n #@csv_row = Array.new\n #csv_temp_data = CSV.read(params[:datafile])\n #csv_size = csv_temp_data.length\n #csv_data = CSV.read(params[:datafile])\n \n #i = params[:start_line].to_i\n @results =\"\"\n parent.managed_repository do \n @results = Voeis::DataValue.parse_logger_csv(params[:datafile], data_stream.id, site.id, params[:start_line].to_i, params[:sample_type], params[:sample_medium],current_user.id)\n \n # csv_data[params[:start_line].to_i-1..-1].each do |row|\n # @csv_row[i] = row\n # i = i + 1\n # end#end row loop\n # (params[:start_line].to_i-1..csv_size.to_i).each do |row|\n # if !@csv_row[row].nil?\n # #create meta_tag_data\n # row_meta_tag_array = Array.new #store the current rows MetaTagData objects for association later\n # data_stream.data_stream_columns.all(:name=>\"MetaTag\").each do |col| \n # @mtag = col.meta_tag\n # parent.managed_repository do\n # mdtag = Voeis::MetaTag.new(:name=>@mtag.name, :category=>@mtag.category)\n # mdtag.value = @csv_row[row][col.column_number]\n # \n # mdtag.save\n # row_meta_tag_array << mdtag\n # end #managed_repository\n # end #data_stream_columns\n # parent.managed_repository do\n # #create sample\n # @site = Voeis::Site.get(site.id)\n # #calculate the correct local_offset\n # sample_datetime = Chronic.parse(@csv_row[row][timestamp_col]).to_datetime\n # sampletime = DateTime.civil(sample_datetime.year,sample_datetime.month,\n # sample_datetime.day,sample_datetime.hour,sample_datetime.min,\n # sample_datetime.sec, (data_stream.utc_offset+dst_time)/24.to_f)\n # \n # @sample = Voeis::Sample.new(:sample_type => params[:sample_type],\n # :material => params[:sample_medium],\n # :lab_sample_code => @csv_row[row][@sample_col],\n # :lab_method_id => -1,\n # :local_date_time => sampletime) \n # @sample.save\n # @site.samples << @sample\n # @site.save\n # @col_vars.each do |var| \n # if !var.nil?\n # var.samples << @sample\n # var.save\n # end\n # end\n # \n # (0..range).each do |i|\n # puts i\n # if columns_array[i] != \"ignore\" && sample_id_col != i && timestamp_col != i &&\n # columns_array[i] != nil && vertical_offset_col != i && \n # ending_vertical_offset_col != i && meta_tag_array[i].to_i == -1\n # \n # new_data_val = Voeis::DataValue.new(:data_value => /^[-]?[\\d]+(\\.?\\d*)(e?|E?)(\\-?|\\+?)\\d*$|^[-]?(\\.\\d+)(e?|E?)(\\-?|\\+?)\\d*$/.match(@csv_row[row][i].to_s) ? @csv_row[row][i].to_f : -9999.0, \n # :local_date_time => sampletime,\n # :utc_offset => data_stream.utc_offset+dst_time,\n # :observes_daylight_savings => dst,\n # :date_time_utc => sampletime.utc, \n # :replicate => 0,\n # :quality_control_level=>@col_vars[i].quality_control.to_i,\n # :string_value => @csv_row[row][i].blank? ? \"Empty\" : @csv_row[row][i],\n # :vertical_offset => vertical_offset_col == \"\" ? 0.0 : @csv_row[row][vertical_offset_col].to_i,\n # :end_vertical_offset => ending_vertical_offset_col == \"\" ? nil : @csv_row[row][ending_vertical_offset_col].to_i) \n # new_data_val.save\n # @site.data_values << new_data_val\n # @site.save\n # new_data_val.variable << @col_vars[i]\n # new_data_val.source = @project_source\n # new_data_val.sample << @sample\n # row_meta_tag_array.map{|mtag| new_data_val.meta_tags << mtag} #add meta_data\n # new_data_val.save\n # new_data_val.data_streams << data_stream\n # new_data_val.save\n # @sample.data_streams << data_stream\n # @sample.save\n # end #end if\n # end #end i loop\n # end #end if @csv_array.nil?\n # end #end managed repo\n # end #end row loop\n puts \"updating the site catalog\" \n Voeis::Site.get(site.id).update_site_data_catalog_variables(@variables)\n end #end repo\n #parent.publish_his \n if @results[:errors].empty?\n flash[:notice] = \"File parsed and stored successfully for #{site.name}. #{@results[:total_records_saved]} data values saved and #{@results[:total_rows_parsed]} rows where parsed. \"\n else\n flash[:notice] = \"File parsed for #{site.name}. #{@results[:total_records_saved]} data values saved and #{@results[:total_rows_parsed]} rows where parsed.\"\n flash[:error] = \"There were the following errors: <br/>\"\n current_user.last_error = @results[:errors]\n current_user.save\n end\n redirect_to project_path(params[:project_id]) and return\n rescue Exception => e \n email_exception(e,request.env)\n parent.managed_repository{Voeis::Site.get(site.id).update_site_data_catalog}\n flash[:error] = \"Problem Parsing Sample File: \"+ e.message\n redirect_to(:controller =>\"voeis/data_values\", :action => \"pre_process_samples_file_upload\", :params => {:id => params[:project_id]})\n end\n end", "title": "" }, { "docid": "958eb03fb0f41fd891dfbc1d288f0c08", "score": "0.49872965", "text": "def save\n \tCSV.open(\"./db/gossip.csv\", \"a\") do |csv|\n \t csv << [@author, @content, @id]\n \tend\n end", "title": "" }, { "docid": "415f6e71409314de4dec07a7d6ae90eb", "score": "0.49865097", "text": "def save\n CSV.open('./db/gossip.csv', 'ab') do |csv|\n csv << [@author, @content]\n end\n end", "title": "" }, { "docid": "aafc7c1ccdb3f88e83cf8f049f5ae0fb", "score": "0.49808437", "text": "def update\n BookmarkCsvLoader.new(csv_text, tag_path, user).()\n end", "title": "" }, { "docid": "29f21b2b0fd0e777bebb5d2a130290cc", "score": "0.4976716", "text": "def save\n CSV.open('./db/gossip.csv', 'ab') do |csv|\n csv << [@content, @author]\n end\n end", "title": "" }, { "docid": "2c0d62e83d3be4cee332981241619331", "score": "0.49737275", "text": "def add_filename_to_rows(rows, bitstream_filename_csv)\n csv_file = File.join(File.dirname(__FILE__), bitstream_filename_csv)\n lines = CSV.read(csv_file, headers: true, encoding: 'ISO-8859-1:UTF-8').map(&:to_hash)\n rows.each do |row|\n if row[0].casecmp('bitstream') == 0\n bitstream_id = row[2]\n filename = row[5]\n if filename.nil? || filename.empty?\n puts \"Processing filename #{bitstream_id}\"\n row[5] = lines.select{ |l| l['bitstream_id'].casecmp(bitstream_id).zero? }.map{ |l| l['name'] }.first\n end\n end \n end\nend", "title": "" }, { "docid": "3c348ace6454be3b0abf9abc3157e3e4", "score": "0.49730194", "text": "def merge_subtitle_marks_from_subtitle_tagging_import_into_content_at(options)\n input_file_spec_subtitle_tagging_import = options['input_1'] || 'subtitle_tagging_import_dir/txt_files'\n input_file_pattern_subtitle_tagging_import = config.compute_glob_pattern(input_file_spec_subtitle_tagging_import)\n base_dir_subtitle_tagging_import = config.base_dir(:subtitle_tagging_import_dir)\n base_dir_content = options['input_2'] || config.base_dir(:content_dir)\n base_dir_output = options['output'] || config.base_dir(:content_dir)\n\n $stderr.puts 'Merging :subtitle_mark tokens from subtitle_tagging_import into content_at'\n $stderr.puts '-' * 80\n merge_subtitle_marks_from_subtitle_shared_into_content_at(\n input_file_pattern_subtitle_tagging_import,\n base_dir_subtitle_tagging_import,\n base_dir_content,\n options\n )\n end", "title": "" }, { "docid": "d14b4b0f6143a22115fb21a3c906736a", "score": "0.49672756", "text": "def write_output(logging_file,desired_info)\n first_line = true\n row_count = get_csv_rows(logging_file)\n str_array = desired_info.split(\"\\n\")\n str_array_size = str_array.size - 1\n\n write_index = 1\n for i in 0..str_array_size\n # ignore the last sentence\n if str_array[i] =~ /Press <Enter> to return to menu/\n next\n end\n\n # ignore the last sentence and title\n if str_array[i] =~ /Press <Enter> to return to menu|Realtime System Summary/\n next\n end\n #ignore the empty line\n if str_array[i] == \"\"\n next\n end\n \n line_info = Array.new \n #first line is a whole sentence, need to fill in one cell \n if first_line\n logging_file.Range(\"A#{i}\").value = str_array[i]\n first_line = false\n else \n # these four sentence need to process separately\n if str_array[i] =~ /^Tasks:*|Cpu\\(s\\):*|Mem:*|Swap:*/\n para1 = str_array[i].split(\":\")\n line_info.push para1[0]\n para = para1[1].split(\",\")\n para.each{|item|\n line_info.push item\n }\n else\n line_info = str_array[i].split(\" \")\n end\n \n #write the information into cells\n line_info_size = line_info.size - 1\n for j in 0..line_info_size\n column = (65 + j).chr #65 is the ASCII \"A\"\n row_index = row_count + write_index\n logging_file.Range(\"#{column}#{row_index}\").value = line_info[j]\n end\n write_index = write_index + 1\n end\n \n end\n\nend", "title": "" }, { "docid": "6d2be86707d636efe4c1631600b0b2a0", "score": "0.49662462", "text": "def save\n #file = File.open(\"./db/gossip.csv\", \"w\")\n #file.close\n file = CSV.open(\"./db/gossip.csv\", \"a+\") do |csv|\n csv << [@author, @content]\n end\n end", "title": "" }, { "docid": "8e081b43df407fd75f0d8cd0bd026369", "score": "0.49579427", "text": "def writetocsv cue\n File.open($dir+\"/\"+cue+\".csv\",\"w\"){|file|\n $times.each_pair {|key,value|\n if key =~ /_#{cue}/\n $output.push(value)\n end\n }\n\n size = $output.length/18\n\n while $output.length > 0 do\n size.times do\n $write.push($output[0])\n $output.delete_at(0)\n end\n file.print $write.join(\",\")\n file.puts\n $write = []\n end \n } \nend", "title": "" }, { "docid": "5215118a1af0f3e68177718d391d816d", "score": "0.49490723", "text": "def save_record(new_pokemon)\n\t\t\n\n\t\tCSV.open(@file, \"a\") do |csv|\n\n\t\t\tcsv << new_pokemon\n\t\tend\n\tend", "title": "" }, { "docid": "7b71b89d5b07a340e6dd252175e8050f", "score": "0.49459413", "text": "def save\n CSV.open(\"./db/gossip.csv\", \"ab\") do |csv|\n csv << [@author, @content]\n end\n end", "title": "" }, { "docid": "f3a6d7a424ae9f0e9f425ead78d6b6c1", "score": "0.49416587", "text": "def save\n #file = File.open(\"./db/gossip.csv\", \"w\")\n #file.close\n file = CSV.open(\"./db/gossip.csv\", \"a+\") do |csv|\n csv << [@author, @content]\n end\nend", "title": "" }, { "docid": "f56eadc07af1191b7f60877862d95ea0", "score": "0.49409488", "text": "def update_db data\n\n header = CSV.read(@@data_path)[0]\n table = CSV.table(@@data_path)\n \n table.each do |row|\n if(row[:id].to_i == id)\n # data.attrs.each{|attr| }\n header.each do |field|\n row[field.to_s] = data.instance_variable_get(\"@#{field.to_s}\")\n end\n \n end\n end\n \n File.open(@@data_path, 'w') do |f|\n f.write(table.to_csv)\n end\n\n data\n end", "title": "" }, { "docid": "34c45ab045a36fc267602b3faed1a6ef", "score": "0.493974", "text": "def read_sbv_file(sbv_file)\n\nn = 0\nstate = :timecodes\ntc_in = tc_out = nil\ntext_chunks = []\n\n#m = 1 #setting transcript number, transcript_id for the lines, to be grouped into transcripts\nsbv_file.read.split(\"\\n\").each do |line|\n line.gsub!(/\\n/, '')\n case state\n when :timecodes\n tc_in, tc_out = line.split(',')\n n += 1\n state = :text\n when :text\n if line.empty?\n self.lines.create!(tc_in: \"0\"+tc_in.gsub(/\\s+/, \"\"), tc_out: \"0\"+tc_out.gsub(/\\s+/, \"\"), text: text_chunks.join(' ').force_encoding('UTF-8'), n: n)\n text_chunks = []\n state = :timecodes\n else\n text_chunks << line\n end\n end\nend\n\n\nend", "title": "" }, { "docid": "bd3b9a5cdfb8b3055a75785d867252de", "score": "0.49305397", "text": "def save_csv_data (a)\n rAddress2 = a[3] ? \"ES\" : nil\n \n #EAGF DIRECT PAYMENTS\n if (a[4] && a[4] > 0)\n amount = a[4]\n scheme = \"ES1\"\n data = [a[1..2],rAddress2,nil,a[3],scheme,amount,nil].flatten!\n $output_file.puts CSV::generate_line(data,:encoding => 'utf-8')\n $id += 1\n end\n #EAGF OTHER PAYMENTS\n if a[5] && a[5] > 0\n amount = a[5]\n scheme = \"ES2\"\n data = [a[1..2],rAddress2,nil,a[3],scheme,amount,nil].flatten!\n $output_file.puts CSV::generate_line(data,:encoding => 'utf-8')\n $id += 1\n end\n #EAFRD PAYMENTS\n if a[6] && a[6] > 0\n amount = a[6]\n scheme = \"ES3\"\n data = [a[1..2],rAddress2,nil,a[3],scheme,amount,nil].flatten!\n $output_file.puts CSV::generate_line(data,:encoding => 'utf-8')\n $id += 1\n end\nend", "title": "" }, { "docid": "531913a81de1a5d56aca6e2d327d0c2d", "score": "0.4925374", "text": "def add_frame\n files = Dir.glob('data/precol-data.csv')\n raw_lines = []\n files.each do |file|\n raw_lines = IO.readlines(file)\n end\n\n raw_lines.each do |line|\n random_frame = 1 + rand(10)\n line.gsub!(\"\\n\", \",#{random_frame}\")\n end\n\n CSV.open(\"data/final-precol.csv\", \"ab\") do |csv|\n raw_lines.each do |array|\n csv << [array]\n end\n end\n\n end", "title": "" }, { "docid": "4770b7088285bdd2a7b068de6ac5ccce", "score": "0.49087316", "text": "def update_keyword_list_file(new_keyword_list)\n\tCSV.open(@config['keyword_list_file_name'], \"w\") do |csv_row|\n\t\tnew_keyword_list.each{|list_row|\n\t\t\tcsv_row << list_row\n\t\t}\n\tend\nend", "title": "" }, { "docid": "c82117494ad3ea6a6c2a911bf3871194", "score": "0.48992354", "text": "def save\n CSV.open(\"db/gossip.csv\", \"ab\") do |csv|\n csv << [@author, @content]\n end\n end", "title": "" }, { "docid": "f766da45a09cabcfa1a3364992dc045f", "score": "0.48935744", "text": "def insert!\n bar = ProgressBar.create(total: csv_n_lines)\n\n CSV.foreach(local_csv_path, headers: :first_row) do |line|\n geo_info = Adapter.new(line)\n\n insert_one!(geo_info)\n\n bar.increment\n end\n\n true\n end", "title": "" }, { "docid": "738855bb8892a6887f0d9d0019695e04", "score": "0.48907948", "text": "def shiftSub(inputFile, shift)\n\tshift = shift /1000.0\n\ttext = File.open(inputFile).read\n\tputs \"Please, write the name of the new subtitles...\"\n\tnewName = gets.chomp + \".srt\"\n\tnewFile = File.new(newName,\"w\")\n\ttext.each_line do |line|\n\t\tif line[2] == \":\" && line[5] == \":\"\n\t\t\t#puts line\n\t\t\tsubSeconds1 = [line[(0..1)].to_f*3600, line[(3..4)].to_f*60, (line[(6..11)].gsub(\",\",\".\")).to_f].reduce(:+)\t+ shift\t\t\n\t\t\tsubSeconds2 = [line[(17..18)].to_f*3600, line[(20..21)].to_f*60, (line[(23..28)].gsub(\",\",\".\")).to_f].reduce(:+) + shift\n\n\t\t\tsubSeconds1 = [(subSeconds1/3600).to_i, ((subSeconds1/3600 - (subSeconds1/3600).to_i)*60).to_i, ((((subSeconds1/3600 - (subSeconds1/3600).to_i)*60)-((subSeconds1/3600 - (subSeconds1/3600).to_i)*60).to_i)*60).round(3)]\n\t\t\tsubSeconds2 = [(subSeconds2/3600).to_i, ((subSeconds2/3600 - (subSeconds2/3600).to_i)*60).to_i, ((((subSeconds2/3600 - (subSeconds2/3600).to_i)*60)-((subSeconds2/3600 - (subSeconds2/3600).to_i)*60).to_i)*60).round(3)]\n\t\t\t\n\t\t\tline[(0..1)] = toStr(subSeconds1[0],2)\n\t\t\tline[(3..4)] = toStr(subSeconds1[1],2)\n\t\t\tline[(6..11)] = toStr(subSeconds1[2],6).gsub(\".\",\",\")\n\n\t\t\tline[(17..18)] = toStr(subSeconds2[0],2)\n\t\t\tline[(20..21)] = toStr(subSeconds2[1],2)\n\t\t\tline[(23..28)] = toStr(subSeconds2[2],6).gsub(\".\",\",\")\n\t\t\t#puts line\n\t\t\tnewFile.puts(line)\n\t\telse\n\t\t\tnewFile.puts(line)\n\t\tend", "title": "" }, { "docid": "83079e6d0372ce740cb2859d82384d85", "score": "0.48888963", "text": "def create\n\n \n @record = Record.new(record_params)\n @name = @record.name\n @record.transcript = @record.transcript.gsub(@name, 'John Doe')\n\n\n file = File.open(\"transcript.txt\", \"w\")\n file.puts @record.transcript\n file.close\n\n @language = @record.language\n\n\n file = File.open(\"language.txt\", \"w\")\n file.puts @record.language\n file.close\n\n @email = @record.email\n\n file = File.open(\"email.txt\", \"w\")\n file.puts @record.email\n file.close\n\n\n file = File.open(\"language.txt\", \"w\")\n file.puts @record.language\n file.close\n\n\n\n respond_to do |format|\n if @record.save\n format.html { redirect_to @record, notice: 'Record was successfully created.' }\n format.json { render :show, status: :created, location: @record }\n else\n format.html { render :new }\n format.json { render json: @record.errors, status: :unprocessable_entity }\n end\n end\n\n \n end", "title": "" }, { "docid": "f0fc243804904a2b067461e242415ee4", "score": "0.48855522", "text": "def ingest_transcript_lines(transcript, transcript_lines)\n return nil if transcript_lines.nil? or transcript_lines.empty?\n\n TranscriptLine.where(transcript_id: transcript.id).destroy_all\n TranscriptLine.create!(transcript_lines)\n transcript.update!(\n lines: transcript_lines.count,\n transcript_status: downloaded_state,\n duration: transcript_lines.last[:end_time] / 1000,\n vendor_audio_urls: [],\n transcript_retrieved_at: DateTime.now\n )\n end", "title": "" }, { "docid": "935b5b4556f2d5cc4046586a4f3ad1dd", "score": "0.48833668", "text": "def push_text_to_csv(csv_indexes, csv_rows, text)\n new_row = Array.new((csv_rows.first || csv_indexes).size)\n csv_indexes.each { |i| new_row[i] = text if new_row.size > i }\n csv_rows << new_row\n end", "title": "" }, { "docid": "d10b35eb2a67592017b130851bfa6398", "score": "0.48814186", "text": "def insert_records file_id, records\n sql = \"INSERT INTO #{@table_records} (file_id,\" \n @db.connect do \n records.each do |name,hash|\n fields = hash[:fields]\n values = hash[:values]\n next if values.empty?\n sql_ = sql + fields.keys.join(',') + \") VALUES \"\n sql_ += values.map do |rec| \n row = [file_id] + rec.values_at(*fields.values)\n RubyUtil::sqlize(row)\n end.join(',')\n @db.query(sql_)\n end\n end\n end", "title": "" }, { "docid": "fdd3eb6f3de506b57395034cfd614aff", "score": "0.48798501", "text": "def start_csv\n provenance_dir = get_output_dir\n @current_csv = File.join(provenance_dir, \"provenance_#{@csv_index}.csv\")\n system(\"touch #{@current_csv}\")\n CSV.open(@current_csv, \"wb\") do |csv|\n csv << [\"id\", \"dc.description.provenance\"]\n end\n end", "title": "" }, { "docid": "151cf7e098cb68ec05485e2e477fbe6a", "score": "0.48784068", "text": "def save_csv(csv_id, csv_header, csv_rows)\n csv_rows.insert(0, csv_header)\n filename = csv_filename(csv_id)\n CSV.open(filename, 'w') do |csv|\n csv_rows.each { |row| csv << row }\n end\n end", "title": "" }, { "docid": "dee906e0574ba336d67184a4ae67bbc3", "score": "0.48735934", "text": "def parse_gps\n # raise exception if we haven't opened the file yet\n raise Exception, 'You need to open the GPS file first' unless @f\n # iterate over each line, split the sentence by comma\n # create a new Record\n # append to @records array\n @f.readlines.each do |l|\n a = l.split(',')\n @records << GPS::Record.new(\n :time => GPS::parse_time(@f.ctime, a[1]),\n :longitude => GPS::parse_longitude(a[2], a[3]),\n :latitude => GPS::parse_latitude(a[4], a[5]),\n :satellites => a[7].to_i,\n :altitude => a[9].to_f\n )\n end\n end", "title": "" }, { "docid": "0a5141aa2b02c946c80fd94475f7a54a", "score": "0.48665476", "text": "def write_iif_file_for_increased_flooring_prices letter_number\n counter = 0\n CSV.open(\"./output/flooring_increase_output_#{letter_number}.IIF\", \"w\", { col_sep: \"\\t\" }) do |output_csv|\n CSV.foreach(\"./source/price_increase.IIF\", { col_sep: \"\\t\", headers: false }) do |csv|\n counter = counter + 1\n \n if counter <= IIF_HEADER_ROWS\n output_csv << csv\n \n elsif (csv[1] =~ VINYL_ITEM || csv[1] =~ CARPET_ITEM) && \n (csv[12].to_s.gsub(',', '').to_i != 0 ) && \n letter_number == csv[1][0]\n \n old_price = csv[12].to_s.\n gsub(',', '').to_f\n markup = 1+FLOORING_INCREASE_PERCENTAGE\n new_price = number_with_delimiter((old_price * markup).round(2))\n puts \"#{csv[1]}\\t#{csv[12]}\\t#{new_price}\"\n csv[12] = new_price.to_s if csv[1] !~ HDS_CUSTOMER \n output_csv << csv\n end\n \n end\n \n end\n\nend", "title": "" }, { "docid": "7ae270d4076440a164affafef316bdf7", "score": "0.48654377", "text": "def create_or_update_from_csv(row)\n csv_name, csv_number = row\n phone = Phone.find_by_name()\n\n\n end", "title": "" }, { "docid": "4aa0a53dcd1df7c61a2a964115f2d666", "score": "0.4863103", "text": "def save \n CSV.open(\"/Users/emma/Desktop/THP/1910_hello_wolrd_sinatra/the_gossip_project_sinatra/db/gossip.csv\", \"ab\") do |csv|\n csv << [@author, @content]\n end\n end", "title": "" }, { "docid": "fa506908769a560ba47709598e9c0b1f", "score": "0.48572153", "text": "def save\n File.open(@output_file, 'w') {|f| f.write(@snippet_csv) }\n end", "title": "" }, { "docid": "98614a433d9118f28fc7dfe1669f1710", "score": "0.48404735", "text": "def change_file_metadata(song,)\n Mp3Info.open(song[:path]) do |mp3|\n #song.dance=params['genre']\n mp3.tag2.TCON=song.dance\n #song.title=params['title']\n mp3.tag.title=song.title\n #song.artist=params['artist']\n mp3.tag.artist=song.artist\n #song.rating=params['rating'].to_i\n mp3.tag2.POPM=song.rating\n #song.save\n end\nend", "title": "" }, { "docid": "2a672950ec871a98d7935f060c4e02b0", "score": "0.483979", "text": "def readWrite(userData)\n existing = Array.new\n CSV.foreach(\"scores.csv\") do |row|\n existing.push(row)\n end\n b = userData.map { |elem| elem.split(\";\") }\n CSV.open(\"scores.csv\", \"w\") do |csv|\n existing.each do |e|\n csv << e\n end\n b.each { |row| csv << row }\n end\nend", "title": "" }, { "docid": "c918b14798e24fa390f64a7fc92d2bc2", "score": "0.4839386", "text": "def add_former_pids(pid_list_path, id_list_path)\r\n\r\ntrackingfile = File.open(\"pidtracking.txt\", \"a\")\r\nnomatchfile = File.open(\"matchfails.txt\", \"a\")\r\nold_list = {}\r\nnew_list = {}\r\n#the old fedora list\r\nputs \"pid list file is \" + pid_list_path\r\nputs \"id list file is \" + id_list_path\r\npid_text = File.read(pid_list_path,)\r\n#pid_text = File.read(pid_list_path, Encoding::UTF_8)\r\ncsv = CSV.parse(pid_text)\r\ncsv.each do |line| \r\n\tthe_pid = line[0].strip\r\n\tthe_title = line[1]\t.strip\t\r\n\told_list[the_pid] = the_title\r\nend\r\n\r\nid_text = File.read(id_list_path)\r\ncsv2 = CSV.parse(id_text)\r\ncsv2.each do |line| \r\n\tthe_id = line[0].strip\r\n\tthe_title = line[1].strip\r\n\tnew_list[the_id] = the_title\r\nend\r\n\r\n\r\n#iterate through the keys (ids) in the new list\r\n\tnew_list.each do |id, title|\r\n\t\tthe_title = title\r\n\t\tmatch = old_list.key(the_title)\r\n\t\tif match != nil \r\n\t\t\tthesis = Object::Thesis.find(id)\r\n\t\t\tthesis.former_id = [match]\r\n\t\t\tthesis.save!\r\n\t\t\ttrackingfile.puts \"found former id \" + match + \" to thesis \" + id \r\n\t\telse\r\n\t\t\tputs \"no match\"\r\n\t\t\tnomatchfile.puts \"could not match title for \" + id + \" unmatched title was \" + the_title\r\n\t\tend\r\n\tend\r\ntrackingfile.close\r\nnomatchfile.close\r\nend", "title": "" }, { "docid": "0ff0746c3e3114a651578c20da29d5ac", "score": "0.4838542", "text": "def write_table_data(resource_directories, site, headers, country_code_mappings)\n country_id = 1\n\n resource_directories.each do |directory|\n if File.exist?(directory + '/' + directory)\n data_file = File.open(directory + '/' + directory,'r')\n\n puts \"INSERT INTO countries (name,code) VALUES ('\" + country_code_mappings[directory.downcase].strip.gsub(/['’]/,\"''\") + \"','\" + directory.upcase.strip + \"');\"\n\n if not File.zero?(data_file)\n line_count = %x{wc -l #{directory}/#{directory}}.split[0].to_i\n current_line = 0\n puts \"INSERT INTO locations (name,latitude,longitude,country_id) VALUES \"\n #parse each file\n File.foreach(data_file) { |line|\n\n #chop off at any commas within the string (an unexpected formatting error in the raw data)\n line = line.gsub(',',\";\")\n #escape any single quotes\n line = line.gsub(/['’]/,\"''\")\n\n components = line.split \"\\t\"\n\n #add the necessary data to the csv file in the format\n #\"name\", latitude\",\"longitude\",\"country_id\"\n print \"('\" + components[22].strip + \"','\" + components[3].strip + \"','\" + components[4].strip + \"',\" + country_id.to_s + \")\"\n if current_line < line_count - 1\n puts \",\\n\"\n else\n puts \";\\n\\n\"\n end\n current_line += 1\n }\n end\n country_id += 1\n end\n end\nend", "title": "" }, { "docid": "62f5d2d040e1dc0313575091a6f25bef", "score": "0.48369738", "text": "def insert_new_subtitles_into_foreign_content_at!(foreign_subtitles_with_content, to_subtitles)\n insert_and_split_ops.each do |op|\n insert_after_stid = case op.operation_type\n when 'insert'\n # We use the operation's after_stid attribute\n op.after_stid\n when 'split'\n # We use the first affected_stid\n op.affected_stids.first.persistent_id\n else\n raise \"Handle this: #{ op.inspect }\"\n end\n insert_after_st = foreign_subtitles_with_content.detect { |e|\n e.persistent_id == insert_after_stid\n }\n insert_after_st_index = foreign_subtitles_with_content.index(insert_after_st)\n insert_at_index = insert_after_st_index + 1\n stid_to_insert = op.affected_stids.last.persistent_id\n st_to_insert = to_subtitles.detect { |e| e.persistent_id == stid_to_insert }\n # For foreign files, we want to treat inserts like splits, i.e.\n # we don't insert any content, we just use the second half of the\n # previous subtitle's content.\n\n # split contents\n first, second = insert_after_st.content.split_into_two\n insert_after_st.content = first\n st_to_insert.content = ['@', second].join # prefix with subtitle_mark\n\n foreign_subtitles_with_content.insert(\n insert_at_index,\n st_to_insert\n )\n end\n true\n end", "title": "" }, { "docid": "477ad0cc6c7e083d99d2884830b63e0d", "score": "0.48359478", "text": "def parse_sample_data_csv(csv_file, data_stream_template, site)\n csv_data = CSV.read(csv_file)\n path = File.dirname(csv_file)\n sensor_type_array = Array.new\n data_stream_col = Array.new\n data_stream_template.data_stream_columns.each do |col|\n sensor_type_array[col.column_number] = parent.managed_repository{Voeis::SensorType.first(:name => col.original_var + site.name)}\n data_stream_col[col.column_number] = col\n end\n data_timestamp_col = data_stream_template.data_stream_columns.first(:name => \"Timestamp\").column_number\n csv_data[data_stream_template.start_line..-1].each do |row|\n (0..row.size-1).each do |i|\n if i != data_timestamp_col\n puts data_stream_col\n if data_stream_col[i].name != \"ignore\"\n #save to sensor_value and sensor_type\n parent.managed_repository{\n sensor_value = Voeis::SensorValue.new(\n :value => row[i],\n :units => data_stream_col[i].unit,\n :timestamp => row[data_timestamp_col],\n :published => false)\n sensor_value.save\n sensor_value.sensor_type << sensor_type_array[i]\n sensor_value.site << site\n sensor_value.save}\n end\n end\n end\n end\n end", "title": "" }, { "docid": "3fe1c2d2684e6e7c648ca187c9695d8f", "score": "0.47973093", "text": "def chat_log_to_sql_import_format(file_to_read, file_to_write)\n File.open(file_to_write, 'w') do |fo|\n File.open(file_to_read, 'r').each_line do |line|\n array = line.gsub('\"', '\"\"').delete(\"\\n\").split(\"\\t\")\n if array\n if array.length >= 3\n \n # Human readable variable names.\n time_stamp = array[0]\n user = array[1]\n chat_text = array[2..-1].join(\"\\t\")\n \n # Sanitise the users a wee bit.\n user = 'jumblesale' if user == 'jumblesal'\n user = 'brighty' if user == 'brightclo'\n \n # Get rhymes using the ruby_rhymes gem.\n begin\n if chat_text[-1].numeric? || [']',')',':'].include?(chat_text[-1])\n rhyme = ''\n else\n rhyme = chat_text.to_phrase.rhymes\n rhyme = rhyme.keys.join('|').gsub('\"', '\"\"')\n end\n rescue\n rhyme = ''\n end\n \n fo.puts \"#{time_stamp}\\t\\\"#{user}\\\"\\t\\\"#{chat_text}\\\"\\t\\\"#{rhyme}\\\"\"\n end\n end\n end\n end\nend", "title": "" }, { "docid": "2d9679e823464ba7f2babab53090feb7", "score": "0.47907692", "text": "def write_records(tuples)\n tuples.sort{|a,b| a.timestamp <=> b.timestamp}.each do |tuple|\n @temporary_location.append tuple.message.format(@log_id) + \"\\n\"\n end\n end", "title": "" }, { "docid": "fce012bac5e61e83f1c0857d0c7b9a22", "score": "0.47821602", "text": "def import_csv(params={})\n # load params into instance variables.\n ######################################\n csv_params = params.fetch(:csv_params)\n table_name_orig = params.fetch(:table_name)\n table_cols = params.fetch(:table_cols)\n # column names of the table that you are working on.\n # just needs to be the stuff that you are inserting.\n key_cols = params.fetch(:key_cols)\n # keys that you want to match against\n # it could be an id or a\n table_name_temp = table_name_orig + \"temp\"\n # adding the sql table name so you can distinguish col from one table\n # to another.\n table_name_orig_s = table_name_orig + \" o\"\n table_name_temp_s = table_name_orig + \"temp t\"\n\n\n # -1 debugging\n ##############\n puts \">> IMPORT CSV PARAMS \" + Time.now.to_s\n puts \"csvp \" + csv_params.to_s\n puts \"table_cols \" + table_cols.to_s\n puts \"key_cols \" + key_cols.to_s\n\n # 0. drop temp table if exist.\n ##############################\n\n @client.drop_table? table_name_temp\n\n # 1. clone temp table.\n ######################\n\n self.clone_table(table_name_orig, table_name_temp)\n puts \">> CLONING TABLE \" + table_name_orig + \" t \" + table_name_temp + \" \" + Time.now.to_s\n\n # 2. load csv into table.\n #########################\n\n # need to use the temp table to load the csvv\n # not the original one.\n csv_params[:table_name] = table_name_temp\n self.load_data(csv_params)\n puts \">> LOAD DATA \"# + table_name_temp + \" \" + csv_params.to_s + \" \" + Time.now.to_s\n\n # 3. create the select statement in insert select\n #################################################\n\n select_str_params = {:array_vals => table_cols,\n :seperator => \", \",\n :prefix => \"t.\"}\n\n select_str = GenString.array_to_str select_str_params\n\n # need to prefix the key cols with the sql table name.\n #\n # looks like this.\n # f.date=b.date AND f.symbol=b.symbol\n #on_str = \"o.\" + key_cols[0] + \"=t.\" + key_cols[0]\n #key_cols.each_with_index do |key_col, i|\n # skip the first item since you used it already.\n # if i != 0\n # on_str = on_str + \" AND \" + \"o.\" + key_col + \"=t.\" + key_col\n # end\n #end\n\n on_param = {:seperator => \" AND \",\n :array_vals1 => key_cols,\n :prefix1 => \"o.\",\n :seperator1 => \"=\",\n :array_vals2 => key_cols,\n :prefix2 => \"t.\"}\n on_str = GenString.arrays_to_str on_param\n # puts \">>><<><><><><>\" + on_str\n\n # creating the where statement...\n # using the keys cols...\n # after the join, you are checking for keys that are null.\n # these are basically the rows that you haven't seen yet and want to insert.\n where_str_params = {:array_vals => key_cols,\n :seperator => \" AND \",\n :prefix => \"o.\",\n :suffix => \" IS NULL\"}\n\n where_str = GenString.array_to_str where_str_params\n\n # 4. insert select statement.\n #############################\n\n insert_params = {:table_name => table_name_orig,\n :into_flag => true,\n :table_cols => table_cols,\n :select_stmt => select_str +\n \" FROM \" + table_name_temp_s + \" LEFT JOIN \" + table_name_orig_s +\n \" ON \" + on_str +\n \" WHERE \"+ where_str}\n self.insert_select insert_params\n puts \">> INSERT SELECT \" + insert_params.to_s + \" \" + Time.now.to_s\n\n # 5. update existing rows with the csv values.\n ##############################################\n # basically you might want to use this if the csv values return new results.\n # a good example of this is a stock split.\n\n # the update... remember that the temp table...\n # is the one that has all of the data..\n # in this case, the temp table is foo, not bar..\n #UPDATE foo f LEFT JOIN bar b ON f.symbol=b.symbol AND f.date=b.date\n #SET b.open=f.open, b.high=f.high, b.low=f.low, b.close=f.close, b.adj_close=f.adj_close, b.volume=f.volume;\n set_params = {:seperator => \", \",\n :array_vals1 => table_cols,\n :prefix1 => \"o.\",\n :seperator1 => \"=\",\n :array_vals2 => table_cols,\n :prefix2 => \"t.\"}\n set_str = GenString.arrays_to_str set_params\n\n on_params = {:seperator => \" AND \",\n :array_vals1 => key_cols,\n :prefix1 => \"t.\",\n :seperator1 => \"=\",\n :array_vals2 => key_cols,\n :prefix2 => \"o.\"}\n on_str = GenString.arrays_to_str on_params\n\n update_table_ref = table_name_temp_s + \" LEFT JOIN \" +\n table_name_orig_s + \" ON \" +\n on_str\n\n update_params = {:table_ref => update_table_ref,\n :set_ref => set_str}\n self.update update_params\n puts \">> UPDATE EXISTING \" + Time.now.to_s\n\n #puts \">>>>>MMMMM\"\n #puts table_cols.to_s\n #puts set_str\n\n # 6. drop the temp table.\n #########################\n @client.drop_table? table_name_temp\n puts \">> DROPPING TEMP TABLE \" + Time.now.to_s\n\n return true\n end", "title": "" }, { "docid": "ec9d1eac6f37b66211723ca0e38d4306", "score": "0.4778907", "text": "def update_from_csv(key, fields_to_update)\n parser = CSV.new(File.open(filename(), 'r'),\n :headers => true, :header_converters => :symbol,\n :col_sep => ',')\n\n parser.each do |row|\n if row and row.length > 0 and row.include?(key)\n key_value = row.field(key)\n existing_entry = self.find(:first, :conditions => {key => key_value})\n\n if existing_entry\n fields_to_update.each do |field_to_update|\n value = row.field(field_to_update)\n existing_entry.update_attribute(field_to_update, value)\n existing_entry.save!\n\n puts \"Updated \" + self.name + \" for \" + key.to_s + \": \" + key_value + \", \" + field_to_update.to_s + \": \" + value\n end\n end\n end\n end\n end", "title": "" }, { "docid": "b23f00abec8132d0127e94bdb7d99897", "score": "0.47764984", "text": "def update_parameter_row(file_lines, line_index, parameter)\n append_row!(file_lines, line_index, \" #{parameter} |\")\n end", "title": "" }, { "docid": "b23f00abec8132d0127e94bdb7d99897", "score": "0.47764984", "text": "def update_parameter_row(file_lines, line_index, parameter)\n append_row!(file_lines, line_index, \" #{parameter} |\")\n end", "title": "" }, { "docid": "aa67b7a178b98ed5bf5db3b641799018", "score": "0.477041", "text": "def create_sample_and_data_parsing_template(template_name, timestamp_col, sample_id_col, columns_array, ignore_array, site, datafile, start_line, row_size, vertical_offset_col, ending_vertical_offset_col, meta_tag_array, utc_offset, dst,source)\n parent.managed_repository do\n @data_stream = Voeis::DataStream.create(:name => template_name.to_s,\n :description => \"NA\",\n :filename => datafile,\n :start_line => start_line.to_i,\n :type => \"Sample\",\n :source => source,\n :utc_offset => utc_offset,\n :DST => dst)\n #Add site association to data_stream\n\n @data_stream.sites << site\n @data_stream.save\n end #managed_repository\n @timestamp_col = -1\n\n range = row_size.to_i-1\n (0..range).each do |i|\n #create the Timestamp column\n if i == timestamp_col.to_i && timestamp_col != \"None\"\n parent.managed_repository do\n data_stream_column = Voeis::DataStreamColumn.create(\n :column_number => i,\n :name => \"Timestamp\",\n :type =>\"Timestamp\",\n :unit => \"NA\",\n :original_var => \"NA\")\n data_stream_column.data_streams << @data_stream\n\n data_stream_column.save\n end #managed_repository\n elsif columns_array[i] == \"ignore\" || ignore_array[i] == i.to_s\n parent.managed_repository do\n data_stream_column = Voeis::DataStreamColumn.create(\n :column_number => i,\n :name => \"Ignore\",\n :type =>\"Ignore\",\n :unit => \"NA\",\n :original_var => \"NA\")\n data_stream_column.data_streams << @data_stream\n data_stream_column.save\n end #managed_repository\n elsif i == sample_id_col.to_i\n parent.managed_repository do\n data_stream_column = Voeis::DataStreamColumn.create(\n :column_number => i,\n :name => \"SampleID\",\n :type =>\"SampleID\",\n :unit => \"NA\",\n :original_var => \"NA\")\n data_stream_column.data_streams << @data_stream\n data_stream_column.save\n end #managed_repository\n elsif i == vertical_offset_col.to_i\n parent.managed_repository do\n data_stream_column = Voeis::DataStreamColumn.create(\n :column_number => i,\n :name => \"VerticalOffset\",\n :type =>\"VerticalOffset\",\n :unit => \"NA\",\n :original_var => \"NA\")\n data_stream_column.data_streams << @data_stream\n data_stream_column.save\n end #managed_repository\n elsif i == ending_vertical_offset_col.to_i\n parent.managed_repository do\n data_stream_column = Voeis::DataStreamColumn.create(\n :column_number => i,\n :name => \"EndingVerticalOffset\",\n :type =>\"EndingVerticalOffset\",\n :unit => \"NA\",\n :original_var => \"NA\")\n data_stream_column.data_streams << @data_stream\n data_stream_column.save\n end #managed_repository\n elsif meta_tag_array[i].to_i != -1\n @meta_tag = Voeis::MetaTag.get(meta_tag_array[i].to_i)\n parent.managed_repository do\n mtag = Voeis::MetaTag.first_or_create(:name => @meta_tag.name, :category=>@meta_tag.category)\n data_stream_column = Voeis::DataStreamColumn.create(\n :column_number => i,\n :name => \"MetaTag\",\n :type =>\"MetaTag\",\n :unit => \"NA\",\n :original_var => \"NA\")\n data_stream_column.data_streams << @data_stream\n data_stream_column.meta_tag = mtag\n data_stream_column.save\n end #managed_repository\n elsif columns_array[i] != nil || columns_array[i] != \"\"#create other data_stream_columns and create variables\n #puts params[\"column\"+i.to_s]\n var = Voeis::Variable.get(columns_array[i].to_i)\n parent.managed_repository do\n data_stream_column = Voeis::DataStreamColumn.create(\n :column_number => i,\n :name => var.variable_code,\n :original_var => var.variable_name,\n :unit => \"NA\",\n :type => \"NA\") \n # variable = Voeis::Variable.first_or_create(\n # :variable_code => var.variable_code,\n # :variable_name => var.variable_name,\n # :speciation => var.speciation,\n # :variable_units_id => var.variable_units_id,\n # :sample_medium => var.sample_medium,\n # :value_type => var.value_type,\n # :is_regular => var.is_regular,\n # :time_support => var.time_support,\n # :time_units_id => var.time_units_id,\n # :data_type => var.data_type,\n # :general_category => var.general_category,\n # :no_data_value => var.no_data_value,\n # :detection_limit => var.detection_limit,\n # :value_type => var.value_type,\n # :field_method_id => var.field_method_id,\n # :lab_id => var.lab_id,\n # :lab_method_id => var.lab_method_id,\n # :spatial_offset_type => var.spatial_offset_type,\n # :spatial_offset_value => var.spatial_offset_value,\n # :spatial_units_id => var.spatial_units_id\n # )\n if Voeis::Variable.get(var.id).nil?\n variable = Voeis::Variable.new\n variable.attributes = var.attributes\n variable.save!\n else\n variable = Voeis::Variable.get(var.id)\n end\n\n \n \n data_stream_column.variables << variable\n data_stream_column.data_streams << @data_stream\n data_stream_column.save\n end #end managed repository\n end #end if\n end #end range.each\n data_template_hash = Hash.new\n #return our Awesome new data_stream or template if you would be so kind\n data_template_hash = {:data_template_id => @data_stream.id}\n end", "title": "" }, { "docid": "f1f910f6c7cf8a559fd8578dfbd4a849", "score": "0.47698328", "text": "def convertDataLine( line )\n loadLine = ''\n ## always have seqno and my translated hhreference as 0 and 1 elements.\n # \n ival = @hhrefs[ line[ @sernumPos ] ]\n ival = MISS if( ival.nil? )\n loadLine += \"#{line[ @sernumPos ]} #{ival} \"; \n @variables.size.times{\n |p|\n if( p != @sernumPos ) then\n type = @variables[p].type;\n item = line[p];\n if( not item.nil? and (item.length > 0) ) then\n item.strip!();\n end;\n item = cleanupItem( item, type );\n loadLine += item;\n if( @variables.size - 1) > p then \n loadLine += \" \"\n end\n end;\n }\n loadLine += \"\\n\";\n puts \"writing line #{loadLine}\";\n return loadLine;\n end", "title": "" }, { "docid": "ec2ce78dba6a51a2994a3b1b54bd271e", "score": "0.47680807", "text": "def write_filesystem(logging_file,desired_info)\n str_array = desired_info.split(\"\\n\")\n row_count = get_csv_rows(logging_file)\n str_array_size = str_array.size - 1\n\n write_index = 1\n for i in 0..str_array_size\n # ignore the last sentence and title\n if str_array[i] =~ /Press <Enter> to return to menu|Disk Usage/\n next\n end\n #ignore the empty line\n if str_array[i] == \"\"\n next\n end\n\n line_info = str_array[i].split(\" \")\n line_info_size = line_info.size - 1\n\n #write the information into cells\n for j in 0..line_info_size\n column = (65 + j).chr #65 is the ASCII \"A\"\n row_index = row_count + write_index\n logging_file.Range(\"#{column}#{row_index}\").value = line_info[j]\n end\n write_index = write_index + 1\n end\nend", "title": "" }, { "docid": "7b177299e1447359be01a79427f6a9ba", "score": "0.47679734", "text": "def add_line(points, tweet_data)\n @shapefile.transaction do |tr|\n tr.add(GeoRuby::Shp4r::ShpRecord.new(\n GeoRuby::SimpleFeatures::LineString.from_points(points),\n \"Handle\"=>tweet_data[:handle].join(','),\n \"Tweets\"=>tweet_data[:tweets]))\n end\n end", "title": "" }, { "docid": "5eba39cfa9c3d0e29a5e8a00148e8124", "score": "0.47630277", "text": "def update_metadata_from_file\n # get meta-data from file itself\n song_file = self.song.path\n song_title = ''\n song_artist = ''\n artist_music = ''\n song_track = ''\n song_genre = ''\n if File.exists?(song_file)\n begin\n Mp3Info.open(song_file) { |mp3|\n song_title = mp3.tag.title\n song_artist = mp3.tag.artist\n artist_music = mp3.tag.album\n song_track = mp3.tag.tracknum\n song_genre = mp3.tag.genre\n }\n song_title = song_title.blank? ? self.title : song_title\n self.update_attributes(:artist_name =>song_artist, :album_name =>artist_music, :track =>song_track, :genre =>song_genre)\n rescue =>exp\n logger.error \"Error in UpdateMetadataFromFile => #{exp.message}\"\n end\n else\n puts \"No file exists with name : #{song_file}\"\n end \n end", "title": "" }, { "docid": "f16ad00d232d179239f338b9dec1a344", "score": "0.4759908", "text": "def import_part_file part_file_name, last_part_file\n begin\n start_time = Time.now\n puts \"**** Starting import of Ingram stock records from #{part_file_name} at #{start_time}\"\n temp_file = IngramStockFile.new(:file_name => File.basename(part_file_name), :created_at => Time.now)\n p = temp_file.parsed\n count_products = 0\n count_updated_products = 0\n count_created_products = 0\n IngramStockFile.transaction do\n p[:body].each do |product_data|\n case create_product product_data\n when :update\n count_updated_products += 1\n when :create\n count_created_products += 1\n end\n count_products += 1\n end\n end\n p = nil\n temp_file = nil\n\n end_time = Time.now\n avg_speed = (count_products > 0) ? ((end_time - start_time)/count_products*1000).round(3) : \"N/A\"\n puts \"**** Processed #{count_products} stock records, (#{count_updated_products} updates and #{count_created_products} creates) from file #{part_file_name} in #{(end_time - start_time).round} seconds. Average speed #{avg_speed} per 1000 records\"\n\n File.delete part_file_name # delete the temporary part file\n\n if last_part_file\n self.import_queued_at = nil\n self.imported_at = Time.now\n # need a self.save here, but the import_stats code below needs a save also - make sure to put a save here, if that code is ever removed!\n end\n\n stats = self.import_stats\n unless stats.nil?\n if (/(?<records_count>^\\d+) Records; Average Time per 1000: (?<avg_record_time>\\d{2}\\.\\d{3})/ =~ stats)\n count_products += records_count.to_i\n avg_speed = (((avg_record_time.to_f * records_count.to_f / 1000) + (end_time - start_time))/count_products * 1000).round(3)\n end\n end\n # there could, potentially be a concurrency problem here, but this is informational only, so it's ok if we lose an update\n self.import_stats = \"#{count_products} Records; Average Time per 1000: #{avg_speed}\"\n self.save\n\n rescue => e\n CdfImportExceptionLog.create(:event => e.message, :file_name => part_file_name, :backtrace => e.backtrace)\n raise e\n end\n\n end", "title": "" }, { "docid": "d24fd33e20bb79ae3b612f2d877767dc", "score": "0.47595865", "text": "def parseTabFile(file2Parse, type)\n FasterCSV.foreach(file2Parse, options ={:col_sep => \"\\t\", :headers => true}) do |row|\n doc = DocumentInfo.new\n if(type == \"brief\")\n doc.doc_name = row[0]\n doc.doc_type = type\n doc.case_id = row[1]\n doc.cite = row[2]\n doc.description = row[3]\n doc.date = row[4]\n doc.submitter_type = row[5]\n doc.postion = row[6]\n #puts \"#{row}\"\n elsif type==\"opinion\"\n doc.doc_name = row[0]\n doc.doc_type = type\n doc.case_id = row[1]\n doc.submitter_type = row[2]\n end\n doc.save\n end\n end", "title": "" }, { "docid": "cdfe6a726f3d5a08e1dbd02ac0c2777a", "score": "0.4755922", "text": "def update_misc_seg_line_numbers\n segments = MiscSegmentsEra.where(:era_id => @era_job.era_id).map(&:segment_text)\n raw_era_file = File.open(\"#{@era_job.era.inbound_file_information.file_path}/#{@era_job.era.inbound_file_information.name}\", 'r')\n\n @segments = ''\n IO.foreach(raw_era_file){|segment| @segments += segment}\n @raw_835_segments = @segments.delete(\"\\n\").split(\"~\").collect{|line| line.strip+\"~\\n\"}\n\n @raw_835_segments.each_with_index do |line, index|\n @track_number = line.split(@delimiter)[2].chomp.split(/~/).first if /^ST((\\*)|(\\|)).*$/.match(line)\n if check_835_file(segments, line) && @track_number == @era_check.tracking_number\n misc_segment = MiscSegmentsEra.where(:era_id => @era_job.era_id, :segment_text => @formated_text, :segment_line_number_in_file => nil).first\n misc_segment.update_attributes(:segment_line_number_in_file => index + 1, :segment_text => line.chop) if misc_segment\n end\n end\n end", "title": "" }, { "docid": "6a8dd411cdcd01c744cdaf6c4838eedd", "score": "0.47457057", "text": "def write_sfile table, file\n\t\tresult = Sfile.read file\n\n\t\t#insert data\n\t\tunless result == nil\n\t\t\tif result.class.to_s == \"Hash\"\n\t\t\t\tarr = []\n\t\t\t\tarr << result\n\t\t\t\tresult = arr\n\t\t\tend\n\n\t\t\tresult.each do | row |\n\t\t\t\tif Sapi.public_method_defined? \"preprocess_#{table}\".to_sym\n\t\t\t\t\teval \"row = preprocess_#{table}(#{row})\"\n\t\t\t\tend\n\t\t\t\twrite_to_db table, row\n\t\t\tend\n\t\tend\n\tend", "title": "" } ]
27f8620209f33d19e7bb994598204892
Runs the tests and/or suites contained in this TestSuite.
[ { "docid": "e60aa274192c47b6e5720af2caf7b414", "score": "0.0", "text": "def run(result, &progress_block)\n @start_time = Time.now\n yield(STARTED, name)\n yield(STARTED_OBJECT, self)\n run_startup(result)\n while test = @tests.shift\n @n_tests += test.size\n test.run(result, &progress_block)\n @passed = false unless test.passed?\n end\n run_shutdown(result)\n ensure\n @elapsed_time = Time.now - @start_time\n yield(FINISHED, name)\n yield(FINISHED_OBJECT, self)\n end", "title": "" } ]
[ { "docid": "8ed4d9487da168e3023e8e171ccf922e", "score": "0.78571403", "text": "def run_tests\n _run_anything :test\n end", "title": "" }, { "docid": "b16738224a01149876e65234c9a9204a", "score": "0.7797746", "text": "def run\n tests.each do |test|\n test.run\n Reporter.print_single_test_result(test)\n end\n end", "title": "" }, { "docid": "73e3fabb26bc74953dd394de02681c85", "score": "0.7627507", "text": "def perform_tests(&block)\n model = self\n exec {\n model.test_suites.each do |ident|\n s = model.test_suite(ident)\n s.perform_tests(&block)\n end\n }\n end", "title": "" }, { "docid": "fb8e7fa97a9a2ae2d83c67e6a0e12254", "score": "0.72465116", "text": "def start\n suite = TestSuite.new\n testruns = @config.files.collect do |file|\n name = file.sub(Dir.pwd+'/','')\n suite.new_case(name, file)\n end\n test_loop_runner(suite)\n end", "title": "" }, { "docid": "63475c3c7fa5cce64c9085b8a0acdbab", "score": "0.7187502", "text": "def execute\n suite = @suite\n trace = @trace\n\n suite.before_all.each {|b| call b }\n\n suite.tests.each do |test|\n suite.before_each.each {|b| call b }\n\n @tests.push test\n\n begin\n # create nested suite\n @suite = Suite.new\n @trace = []\n\n # populate nested suite\n call test.block, test.sandbox\n\n # execute nested suite\n execute\n\n ensure\n # restore outer values\n @suite = suite\n\n trace << build_exec_trace(@trace)\n @trace = trace\n end\n\n @tests.pop\n\n suite.after_each.each {|b| call b }\n end\n\n suite.after_all.each {|b| call b }\n end", "title": "" }, { "docid": "2af7750f000b0d7ecb03d301287acf20", "score": "0.71765256", "text": "def execute\n suite = @suite\n trace = @trace\n\n suite.before_all.each {|b| call b }\n\n suite.tests.each do |test|\n\n suite.before_each.each {|b| call b }\n\n @tests.push test\n\n begin\n # create nested suite\n @suite = Suite.new\n @trace = []\n\n # populate nested suite\n call test.block, test.sandbox\n\n # execute nested suite\n execute\n\n ensure\n # restore outer values\n @suite = suite\n\n trace << build_exec_trace(@trace)\n @trace = trace\n end\n\n @tests.pop\n\n suite.after_each.each {|b| call b }\n end\n\n suite.after_all.each {|b| call b }\n end", "title": "" }, { "docid": "1fbe098b1fdd6d553fbdfefd3e166f43", "score": "0.7112701", "text": "def run_all\n success = runner.run(options[:tests_path], options.merge(\n :message => 'Running all tests'\n ))\n\n @previous_failed = !success\n throw :task_has_failed unless success\n end", "title": "" }, { "docid": "c376ea2fcc2aa10bcb1c23ea3b6d7336", "score": "0.71015745", "text": "def run_all\n run_tests_and_report\n end", "title": "" }, { "docid": "0b6b973bb43296fe4ac3422999694a1d", "score": "0.7088051", "text": "def run\n test_dir_path = path_to_adjacent_file(@test_directory)\n results_dir_path = create_results_dir('results')\n # We need to run this each time in case test case files have changed or new\n # tests have been added\n find_all_tests(test_dir_path)\n results = run_tests(test_dir_path, results_dir_path)\n show_results(results, results_dir_path)\n end", "title": "" }, { "docid": "70020bef7ce1848053b424f9b315b8d4", "score": "0.7088021", "text": "def run_all\n %w[unit functional integration performance].each do |test|\n load_in_fork(\"test/#{test}/**/*_test.rb\")\n end\n end", "title": "" }, { "docid": "743789d6c34ab5ebfff5da767a5c4e8d", "score": "0.7079226", "text": "def run_all\n receive_results do\n log \"Run all tests\"\n test_files = load_test_files([\"test\"])\n\n reset_db_connection_post_fork\n test_runner = ::Nestor::Mappers::Rails::Test::TestRunner.new(nil)\n result = ::Test::Unit::AutoRunner.run(false, nil, []) do |autorunner|\n autorunner.runner = lambda { test_runner }\n end\n\n # Returns a Hash which the parent process will retrieve\n report(test_runner, test_files)\n end\n end", "title": "" }, { "docid": "253d347b30ec438b578d6a3a1a2fe81d", "score": "0.70502335", "text": "def run\n do_run do\n test_script\n end\n end", "title": "" }, { "docid": "ff64859200fd7b955dbdbba1b603fcbf", "score": "0.7022063", "text": "def run\n require_dependencies\n require_frameworks\n init_reporters\n\n suite_passed = true\n\n Spinach.hooks.run_before_run\n\n features_to_run.each do |feature|\n feature_passed = FeatureRunner.new(feature, orderer: orderer).run\n suite_passed &&= feature_passed\n\n break if fail_fast? && !feature_passed\n end\n\n Spinach.hooks.run_after_run(suite_passed)\n\n suite_passed\n end", "title": "" }, { "docid": "8f257b4f1c6fb5d52f2c759b6c267a62", "score": "0.700098", "text": "def run_tests\n dependencies = (Buildr.artifacts(self.dependencies + compile.dependencies) + [compile.target]).map(&:to_s).uniq\n rm_rf report_to.to_s\n rm_rf failures_to.to_s\n @tests = @framework.tests(dependencies).select { |test| include?(test) }.sort\n if @tests.empty?\n @passed_tests, @failed_tests = [], []\n else\n info \"Running tests in #{@project.name}\"\n begin\n # set the baseDir system property if not set\n @framework.options[:properties] = { 'baseDir' => compile.target.to_s }.merge(@framework.options[:properties] || {})\n @passed_tests = @framework.run(@tests, dependencies)\n rescue Exception=>ex\n error \"Test framework error: #{ex.message}\"\n error ex.backtrace.join(\"\\n\") if trace?\n @passed_tests = []\n end\n @failed_tests = @tests - @passed_tests\n unless @failed_tests.empty?\n Buildr::write(failures_to.to_s, @failed_tests.join(\"\\n\"))\n error \"The following tests failed:\\n#{@failed_tests.join(\"\\n\")}\"\n fail 'Tests failed!'\n end\n end\n record_successful_run unless @forced_need\n end", "title": "" }, { "docid": "99ddf2937a8c49d3ca3c34f667a0fc0a", "score": "0.696816", "text": "def suites\n # Since we're not using `ruby -Itest -Ilib` to run the tests, we need to add this directory to the `LOAD_PATH`\n $:.unshift \"./test\", \"./lib\"\n\n if framework == :testunit1\n Test::Unit::TestCase.class_eval {\n @@test_suites = {}\n def self.inherited(klass)\n @@test_suites[klass] = true\n end\n def self.test_suites\n @@test_suites.keys\n end\n def self.test_methods\n public_instance_methods(true).grep(/^test/).map(&:to_s)\n end\n }\n end\n\n begin\n # Fire up the Ruby files. Let's hope they actually have tests.\n @files.each { |f| load f }\n rescue LoadError => e\n # Fail with a happier error message instead of spitting out a backtrace from this gem\n abort \"Failed loading test file:\\n#{e.message}\"\n end\n\n # Figure out what test framework we're using\n case framework\n when :minitest\n suites = MiniTest::Unit::TestCase.test_suites\n when :testunit1, :testunit2\n suites = Test::Unit::TestCase.test_suites\n else\n not_supported\n end\n\n # Use some janky internal APIs to group test methods by test suite.\n suites.inject({}) do |suites, suite_class|\n # End up with a hash of suite class name to an array of test methods, so we can later find them and ignore empty test suites\n suites[suite_class] = suite_class.test_methods if suite_class.test_methods.size > 0\n suites\n end\n end", "title": "" }, { "docid": "c966ad5aa43c5de2633e5e3695c0d066", "score": "0.69454753", "text": "def perform_tests(&block)\n suite = self\n @model.exec {\n suite.tests.each do |ident|\n t = suite.test(ident)\n yield t\n end\n }\n end", "title": "" }, { "docid": "631f58ffd3185acf6d3164c82788f420", "score": "0.6939026", "text": "def run(opts = {})\n # Cannot run tests if there are none\n if @tests.empty?\n puts \"No tests to run\"\n end\n\n # Iterate over all tests and dispatch each to Sauce Labs\n @tests.each do |test|\n if File.directory? test\n Dir.chdir(test) do\n prepend = \"\"\n if opts[:recursive] == true\n prepend = \"**/\"\n end\n files = Dir.glob(prepend + \"*.html\")\n files.concat(Dir.glob(prepend + \"*.rb\"))\n @error.call \"No runnable files in \\\"#{file}\\\"\" if files.empty? and [email protected]?\n files.each do |file|\n converter,global,browsers = aggregate_data(file, opts)\n run_test(converter, global, browsers)\n end\n end\n else\n file = File.basename(test)\n Dir.chdir(File.dirname(test)) do\n converter,global,browsers = aggregate_data(file, opts)\n run_test(converter, global, browsers)\n end\n end\n end\n\n # Run the supplied completion block\n @complete.call @results unless @complete.nil?\n end", "title": "" }, { "docid": "13581ebc8c96ce29b241a4722243f894", "score": "0.68789023", "text": "def execute_tests\n instance_exec(&Thread.current[:test_block]) if Thread.current[:test_block]\n end", "title": "" }, { "docid": "f55ea75a706a74bdaa3b3fd0dd29e60d", "score": "0.68719524", "text": "def start\n super\n\n @turn_config = Turn.config\n @turn_suite = Turn::TestSuite.new(@turn_config.suite_name)\n\n @test_cases = {}\n Runnable.runnables.each do |c|\n @test_cases[c] = @turn_suite.new_case(c.name) #Turn::TestCase.new(c)\n end\n\n @turn_suite.seed = options[:seed]\n @turn_suite.cases = @test_cases.values\n @turn_suite.size = @test_cases.size #::MiniTest::Unit::TestCase.test_suites.size\n\n capture_io\n\n #@_stdout, @_stderr = capture_io do\n # super_result = super(suite, type)\n #end\n\n start_suite(@turn_suite)\n end", "title": "" }, { "docid": "5f0e1a44a27651dafa1d2a7a65ea92b8", "score": "0.6870266", "text": "def run_tests(root_dir, testset=\"smoke\")\n @root_dir = root_dir\n\n ##get all directories recursively\n fetch_all_dirs(root_dir)\n\n ##each element in directories array, and run each suite one by one\n @all_dirs.each do |each_dir|\n if File.exist?(\"#{each_dir}/main.rb\")\n File.delete(\"#{each_dir}/main.log\") if File.exist?(\"#{each_dir}/main.log\")\n Dir.chdir(each_dir)\n ##print all running directories int console\n puts Dir.pwd\n IO.popen(\" ruby main.rb --testset #{testset}\")\n test_status = {\"test_name\" => \"#{each_dir}\", \"status\" => \"start\", \"detail\" => \"\", \"cache\" => 0}\n @suite.push(test_status)\n end\n Dir.chdir(root_dir)\n end\n end", "title": "" }, { "docid": "32eb8732389f631650979b5ffdf8ca35", "score": "0.68621373", "text": "def run\n Overseer.current_test = self\n start_time = Time.now\n suite.before.call if suite.before\n begin\n @code.call\n rescue Exception => e\n errors << e\n ensure\n begin\n suite.after.call if suite.after\n rescue Exception => e\n errors << e if passed?\n end\n @time = Time.now - start_time\n end\n end", "title": "" }, { "docid": "9b346e94bc7319cdd42383fb0f6ee2a6", "score": "0.6854251", "text": "def run\n catch(:abort) do\n run_tests\n end\n\n # save_results\n wrap_up\n end", "title": "" }, { "docid": "5ea0d48deef905d1933ccf324175db95", "score": "0.680498", "text": "def run(arg = nil)\n selected_tests = resolve_tests(arg).select(&:enabled?)\n puts \"RUNNING TESTS:\"\n list(selected_tests)\n\n @__bork_interrupt = false\n\n # allows the use of ctrl-c to bail out of a test to\n Signal.trap('SIGINT') { @__bork_interrupt = true }\n\n selected_tests.each do |test|\n break if @__bork_interrupt\n test.run\n end\n\n puts \"done running the tests!\"\n end", "title": "" }, { "docid": "0c1014395fdfa7562312a7a87db7b4a5", "score": "0.68047726", "text": "def run_with_test_runner(tests)\n execute(test_runner_command(tests))\n end", "title": "" }, { "docid": "79e59adc761e45e86d95971264f8e2e2", "score": "0.6783647", "text": "def run_tests(tests)\n send(\"run_with_#{test_type}_runner\", tests) unless tests.empty?\n end", "title": "" }, { "docid": "568ec89f05bc5e7a406c043f246e3927", "score": "0.6782239", "text": "def _run_anything type\n suites = TestCase.send \"#{type}_suites\"\n return if suites.empty?\n\n start = Time.now\n\n puts\n puts \"# Running #{type}s:\"\n puts\n\n @test_count, @assertion_count = 0, 0\n sync = output.respond_to? :\"sync=\" # stupid emacs\n old_sync, output.sync = output.sync, true if sync\n\n results = _run_suites suites, type\n\n @test_count = results.inject(0) { |sum, (tc, _)| sum + tc }\n @assertion_count = results.inject(0) { |sum, (_, ac)| sum + ac }\n\n output.sync = old_sync if sync\n\n t = Time.now - start\n\n puts\n puts\n puts \"Finished #{type}s in %.6fs, %.4f tests/s, %.4f assertions/s.\" %\n [t, test_count / t, assertion_count / t]\n\n report.each_with_index do |msg, i|\n puts \"\\n%3d) %s\" % [i + 1, msg]\n end\n\n puts\n\n status\n end", "title": "" }, { "docid": "1812726e864afdcc97d0f14cdb7f14e9", "score": "0.67504627", "text": "def start\n @suite_start_time = ::Qa::Time.now_f\n\n @test_cases = Minitest::Runnable.runnables\n count_tests!(@test_cases)\n\n @stdcom.reset!\n\n @io.emit_suite_event(@suite_start_time, @test_count, @options[:seed])\n end", "title": "" }, { "docid": "5b6910b821174959512a7acb627589da", "score": "0.67496186", "text": "def test_suites\n all(QTest::TestSuite, project: @project.id, release: @id)\n end", "title": "" }, { "docid": "890fdcb78630d00a363c77dc37fd9fac", "score": "0.6742435", "text": "def run_tests\n if ARGV[0] && ARGV[0] != \"\"\n eval ARGV[0]\n else\n test1\n test2\n # test3\n # test4\n # test5\n end\n end", "title": "" }, { "docid": "c7d372c3358b9bfee3e31bfca2e3e72a", "score": "0.673458", "text": "def run!\n # Only run tests if the set-up passes\n if before.passed?\n # Run tests and report results\n new_context = if Context.async?\n run_tests_async!\n else\n run_tests!\n end\n # Run the clean-up file, if present\n after.run!\n else\n # The set-up file failed, All tests in this context and sub-contexts cannot be run.\n new_context = set_reason before.result, before.reason\n # Push the setup file to the 'stack trace'\n new_context = new_context.push before.file\n # Report the results of tests\n new_context.report\n end\n new_context\n end", "title": "" }, { "docid": "26c9c533dc46a1cf6e820587ce336ad3", "score": "0.6669466", "text": "def run(*test_cases)\n fire_event :start\n test_cases.each do |test_case|\n fire_event :enter, test_case\n test_case.run(self)\n fire_event :exit, test_case\n end\n fire_event :end\n end", "title": "" }, { "docid": "9c245fa9aac3be5a9aba915319f2ff47", "score": "0.6667129", "text": "def run\n log.info \"Running test #{test_name}\"\n unless skip_build\n setup_results_dir\n build\n end\n Dir.chdir(test_file.dirname) do\n system(\n { \"AYTESTS_WORK_DIR\" => work_dir.to_s, \"AYTESTS_PROVIDER\" => provider.to_s },\n \"rspec #{test_file.basename}\"\n )\n end\n end", "title": "" }, { "docid": "43af1359ea7be3847041d0615c4d327f", "score": "0.66631603", "text": "def run_tests_global\n run_tests_on_subjects(\n 'global tests',\n :test,\n [{}]\n )\n end", "title": "" }, { "docid": "1a74dde888cf9ccfb8d0bdf834a7bff6", "score": "0.6662772", "text": "def run\n Hash[\n @tests.map do |test|\n [test, test.run]\n end\n ]\n end", "title": "" }, { "docid": "b394b10cb0558234b3c6fc1c4a03c82b", "score": "0.66613674", "text": "def run_all_tests\n read_env\n reset_tests\n\n ret = true\n self.failed_tests = []\n self.test_classes.each do |klass|\n ret &= run_all_tests_in_class(klass)\n end\n ret\n end", "title": "" }, { "docid": "12b8e0b748bcc692cde52b0b243c1290", "score": "0.6659826", "text": "def auto_run()\n path = path_to_adjacent_file 'tests'\n test_cases = read_test_dir path\n test_list = ''\n test_cases.each_pair { |dir, data|\n # Define the test directories to run.\n # TODO(mlowrie): Maybe these should eventually be passed in. Hardcoding\n # for now.\n if /bugs_fixed/ =~ dir or /ruby_classes/ =~ dir\n UI.messagebox dir\n data['tests'].each { |filepath|\n test_list += filepath + ','\n }\n end\n }\n results_path = create_results_dir 'results'\n run_tests(test_list, results_path)\n end", "title": "" }, { "docid": "9cee84d4280dc001eb989549c21675f2", "score": "0.6644994", "text": "def runall\n return DuckTest::Config.framework.run_all\n end", "title": "" }, { "docid": "f33aca67862d97a204ac3613d8770513", "score": "0.664467", "text": "def run\n @feedback.pre_tests(self)\n @results = ciat_files.\n map { |ciat_file| create_test(ciat_file) }.\n map { |test| test.run }\n @feedback.post_tests(self)\n @results\n end", "title": "" }, { "docid": "06abbf9e559b120fa85c773312d22443", "score": "0.6609061", "text": "def run_all\n paths = [@options[:all_tests_file]]\n ret_code = run_julia_command(paths)\n guard_notify(paths, ret_code)\n end", "title": "" }, { "docid": "d138925310c4c23ac56a4699ab1aec8f", "score": "0.66049594", "text": "def run(tests, dependencies)\n raise 'Not implemented'\n end", "title": "" }, { "docid": "d54b50262c989ff220e7e4d33c6f7d76", "score": "0.65915316", "text": "def _run_suite suite, type\n header = \"#{type}_suite_header\"\n puts send(header, suite) if respond_to? header\n\n filter = options[:filter] || '/./'\n filter = Regexp.new $1 if filter =~ /\\/(.*)\\//\n\n all_test_methods = suite.send \"#{type}_methods\"\n\n filtered_test_methods = all_test_methods.find_all { |m|\n filter === m || filter === \"#{suite}##{m}\"\n }\n\n assertions = filtered_test_methods.map { |method|\n inst = suite.new method\n inst._assertions = 0\n\n print \"#{suite}##{method} = \" if @verbose\n\n start_time = Time.now if @verbose\n result = inst.run self\n\n print \"%.2f s = \" % (Time.now - start_time) if @verbose\n print result\n puts if @verbose\n\n inst._assertions\n }\n\n return assertions.size, assertions.inject(0) { |sum, n| sum + n }\n end", "title": "" }, { "docid": "b5621b516cb30e8a1c41d764acfe1d83", "score": "0.6581749", "text": "def _run_suites suites, type\n suites.map { |suite| _run_suite suite, type }\n end", "title": "" }, { "docid": "997828a6344ec9028623cc4a70f683d1", "score": "0.6581157", "text": "def run_tests\n # setup environment so it should include lib dir for ld path\n export_libdir(@@project_libdir)\n success = run_cunit\n fail 'Test failed' unless success == true\n end", "title": "" }, { "docid": "ebca4b592d20977dedcd732e5e9760eb", "score": "0.65626854", "text": "def runTests(runAll, toRun)\r\n\t\tif @successfulLogin\r\n\t\t\tbegin\r\n\t\t\t\[email protected](runAll, toRun, @sfApex.endpoint_url)\r\n\t\t\trescue Exception => exception\r\n\t\t\t\tlogException('runTests(' + runAll + ')', exception.message, exception.backtrace)\r\n\t\t\t\traise\t\r\n\t\t\tend\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "2c761548d32c60bde4f3b71ee2a3413c", "score": "0.65569955", "text": "def run(tests)\n raise NotImplementedError, \"run method must be overriden!\"\n end", "title": "" }, { "docid": "cd302e69d28d4af597f551834271636b", "score": "0.655476", "text": "def run\n binaries_exist?\n binaries_run?\n run_bootstrap_tests\n run_onboot_tests\n\n if ChefInit::Test.did_pass?\n ChefInit::Log.info(\"#{ChefInit::Test.num_tests_passed} tests passed.\")\n exit true\n else\n failed_test_string = ChefInit::Test.failed_tests.each { |t|\n \"\\t #{t}\" }.join(\"\\n\")\n\n ChefInit::Log.fatal(\"Tests failed:\\n#{failed_test_string}\")\n exit false\n end\n end", "title": "" }, { "docid": "1665a976b2d05b121e4235481af78d1f", "score": "0.6552591", "text": "def run_tests(test_set, testrun_results=nil)\n testrun_results = TestRunResults.next_results(@build_results) if testrun_results.nil?\n testrun_record = TestRunRecord.for_directory(testrun_results.root_dir, @module_set)\n\n puts \"\"\n puts \"========================================================================\"\n puts \" Running tests: %s\" % test_set.to_s\n puts \"========================================================================\"\n puts \"\"\n\n testrun_record.setUp(test_set)\n have_started_at_least_one_test = false\n\n begin\n prepare_and_run_block_on_tests(test_set, testrun_results, Proc.new do |testrun|\n have_started_at_least_one_test = true\n testrun.run(@script_results)\n end, testrun_record)\n ensure\n testrun_record.tearDown\n # copy failed-tests.txt file to the aggreation directory\n if monkey?\n FileUtils.cp(testrun_record.failed_test_classnames_file.to_s, tests_aggregation_directory.to_s)\n end\n puts \"\\n\\n\"\n puts \"========================================================================\"\n puts \"Test Results:\\n\\n\"\n puts testrun_record.dump\n\n puts \"\\n\\n\"\n puts \"========================================================================\"\n if testrun_record.failed?\n puts \" Tests FAILED. See results above.\"\n elsif testrun_record.total_suites == 0\n loud_message \"No tests ran.\"\n else\n puts \" Tests passed.\"\n end\n puts \" Testrun directory: #{testrun_results.root_dir}\"\n puts \"\"\n end\n end", "title": "" }, { "docid": "79332ec2e02194f4c871861488fde0eb", "score": "0.65494114", "text": "def test_cases\n @suite.search('./test/class/test-method').map do |test_case|\n TestCase.new(self, test_case)\n end\n end", "title": "" }, { "docid": "026674b821d6c89d81887570109e47b5", "score": "0.6544588", "text": "def run_suite(suite)\n @abort = false\n @running = true\n\n return false if stop_folders_changed?\n\n result = Test::Unit::TestResult.new\n started_at = Time.now\n\n suite.tests.each do |test|\n break if @abort\n run_test test, result\n end\n\n @last_run_failures = result.instance_variable_get(:@failures)\n @last_run_errors = result.instance_variable_get(:@errors)\n\n print_negatives @last_run_failures, fail_color\n print_negatives @last_run_errors, error_color\n\n print_result_summary result, Time.now - started_at\n\n @running = false\n @last_init_time ||= Time.now\n @last_run_time = Time.now\n end", "title": "" }, { "docid": "26d954aa6cab231dcc6941b1f5ae4e01", "score": "0.653564", "text": "def test_runs\n all(QTest::TestRun, project: @project.id, test_suite: @id)\n end", "title": "" }, { "docid": "3860f2b0153157e51934dec335f33d5f", "score": "0.65264183", "text": "def start_suite(test_suite)\n end", "title": "" }, { "docid": "3860f2b0153157e51934dec335f33d5f", "score": "0.65264183", "text": "def start_suite(test_suite)\n end", "title": "" }, { "docid": "eeadc5e872b1236a575b729927e189d0", "score": "0.65261996", "text": "def suite_with_scenarios\n suite = suite_without_scenarios\n class << suite\n attr_accessor :test_class\n def run_with_scenarios(*args, &block)\n run_without_scenarios(*args, &block)\n test_class.table_config.loaded_scenarios.each { |s| s.unload } if test_class.table_config\n end\n alias_method_chain :run, :scenarios\n end\n suite.test_class = self\n suite\n end", "title": "" }, { "docid": "38ec862ec3a8882eec9d4691fbea0d5b", "score": "0.6520282", "text": "def run_all\n results = runner.test_all\n throw :task_has_failed if results.failed?\n end", "title": "" }, { "docid": "6a6786efd1c22421e32a91e071f27a03", "score": "0.6519629", "text": "def do_test_suites(test_suite_data)\n # For checking on linkstatus\n e2e_parallel_num = Bucky::Utils::Config.instance[:e2e_parallel_num]\n linkstatus_parallel_num = Bucky::Utils::Config.instance[:linkstatus_parallel_num]\n tcg = Bucky::Core::TestCore::TestClassGenerator.new(@test_cond)\n case @test_cond[:test_category]\n when 'e2e' then results_set = parallel_new_worker_each(test_suite_data, e2e_parallel_num) { |data, w_pipe| tcg.generate_test_class(data: data, w_pipe: w_pipe) }\n when 'linkstatus' then\n linkstatus_url_log = {}\n results_set = parallel_distribute_into_workers(test_suite_data, linkstatus_parallel_num) { |data, w_pipe| tcg.generate_test_class(data: data, linkstatus_url_log: linkstatus_url_log, w_pipe: w_pipe) }\n end\n\n results_set\n end", "title": "" }, { "docid": "be1a3c96e3fcb8f2d7f4f46c9b9f80d8", "score": "0.6515757", "text": "def run\n puts (1..tests.length).to_s\n tests.each_with_index do |test, i|\n begin\n if test.is_ok?\n ok(test, i)\n else\n not_ok(test, i)\n end\n rescue Sequel::DatabaseError\n puts $!.sql\n raise $!\n end\n end\n end", "title": "" }, { "docid": "d92163d50ff4c3e130c012d9de1d7741", "score": "0.65084416", "text": "def discover_tests\n TestsSuite.tests\n end", "title": "" }, { "docid": "3fab3915b2397a7d957133fd1b63cd56", "score": "0.6508043", "text": "def tests\n @tests ||= begin\n # With each suite and array of tests,\n # and with each test method present in this test file,\n # shove a new test method into this collection.\n suites.inject(TestCollection.new) do |collection, (suite_class, test_methods)|\n test_methods.each do |test_method|\n find_locations = (@files.size == 1 && @line)\n collection << TestMethod.create(suite_class, test_method, find_locations)\n end\n collection\n end\n end\n end", "title": "" }, { "docid": "e083ec978bc9ecd5d64a735b2e978b04", "score": "0.6502666", "text": "def run_test\n status.initialize_run\n\n begin\n run\n rescue Exception => exception\n status.log_exception(exception)\n raise\n ensure\n status.finalize_run\n end\n\n end", "title": "" }, { "docid": "6968d7ea57bab3479284ce9dc5dbbdac", "score": "0.6485395", "text": "def run\n stages = stage.select { |stage| run_stage?(stage) }\n stages.each { |stage| run_stage(stage) }\n run_cmds\n rescue Error\n raise\n rescue Exception => e\n raise Error.new(\"#{e.message} (#{e.class})\", backtrace: backtrace? ? e.backtrace : nil) unless test?\n raise\n ensure\n run_stage(:finish, fold: false) if finish?\n end", "title": "" }, { "docid": "7122dbf5408f604234361eef201726e6", "score": "0.64840025", "text": "def run_all\n run_auto_test(@cmd_auto_test_deps)\n end", "title": "" }, { "docid": "f6952d8e7269eb6878945e27bf65b624", "score": "0.6479479", "text": "def run_with_spec_runner(tests)\n execute(spec_runner_command(tests))\n end", "title": "" }, { "docid": "47e0b6ae5831cba69cb23933ac473679", "score": "0.6469016", "text": "def run_data_tests\n run_tests('test/models')\n end", "title": "" }, { "docid": "4214d9c38556c2b02453744c9abd3771", "score": "0.646491", "text": "def pass(suite, test, test_runner); end", "title": "" }, { "docid": "0970438f85e4c7fc41f4acc9100b7274", "score": "0.64572823", "text": "def run_with_callbacks(result, &progress_block)\n # Run setup if its defined\n test_case.setup if test_case.respond_to?(:setup)\n\n begin\n # Run all of the tests\n run_without_callbacks(result, &progress_block)\n ensure\n # Run teardown if it is defined\n test_case.teardown if test_case.respond_to?(:teardown)\n end\n end", "title": "" }, { "docid": "78896d951b2aa1831f7dd17faa203e4e", "score": "0.6446527", "text": "def run_tests\n BaconRunner.get_config.each do |tests|\n if tests.kind_of?(String)\n begin\n load \"#{tests}.rb\"\n loaded = true\n rescue LoadError\n end\n if !loaded\n puts \"Warning: #{tests} was not found -- skipping\"\n end\n else\n test_type = tests.first\n tests.last.each do |file|\n loaded = false\n [\"#{test_type}/test_#{file}.rb\", \"#{test_type}/#{file}_test.rb\"].each do |pth|\n prepend = File.dirname(DynamicApplication.current ? \n DynamicApplication.current.entry_point.to_s :\n '')\n pth = \"#{prepend}/#{pth}\" if prepend != '.'\n begin\n load pth\n loaded = true\n next\n rescue LoadError\n end \n end\n if !loaded\n puts \"Warning: #{test_type} -- #{file} was not found -- skipping\"\n end\n end\n end\n end\n BaconRunner.execute_at_exit_blocks\n end", "title": "" }, { "docid": "e275201d88968c6b923d9e5dac1dd22c", "score": "0.644552", "text": "def run_test\n start_test\n end", "title": "" }, { "docid": "c62f79e342c52d5a3beb9519149ca3a5", "score": "0.64446634", "text": "def start\n super\n\n @test_cases = Runnable.runnables\n\n capture_io\n\n #@_stdout, @_stderr = capture_io do\n # super_result = super(suite, type)\n #end\n\n before_suite(@test_cases)\n end", "title": "" }, { "docid": "afb454d44f89fa5eb7177e10f7341a6f", "score": "0.6435062", "text": "def run_tests\n @@test_config.each do |test|\n url_test = generate_url_test(test)\n @errors_or_warnings_found |= url_test.run_tests\n @email_body += url_test.format_results\n end\n end", "title": "" }, { "docid": "4844289b855153ec8fca4d9c19124b20", "score": "0.6433795", "text": "def run(live = false)\n environments.each { |e| e.setup local_path }\n\n wins, fails, errors, skipped, totals = 0, 0, 0, 0, 0\n failures = []\n tests.each_with_index do |test, i|\n unless test.match.environment.available?\n skipped += 1\n next\n end\n \n unless test.match.ran?\n test.match.run live\n # Only one match can run live, otherwise all hell will break loose.\n live = false\n end\n failure_string = nil\n begin\n if failure = test.check_output\n trace = short_backtrace failure.backtrace\n failure_string = \"#{failure.to_s}\\n#{trace.join(\"\\n\")}\"\n fails += 1\n print 'F'\n else\n wins += 1\n print '.'\n end \n rescue Exception => e\n errors += 1\n failure_string = \"#{e.class.name}: #{e.to_s}\\n#{e.backtrace.join(\"\\n\")}\"\n end\n totals += 1\n if failure_string\n failures << [test, failure_string]\n end\n end\n print \"\\n#{totals} tests, #{wins} passed, #{fails} failures, #{errors} errors\\n\\n\"\n failures.each_with_index do |failure, i|\n test, string = *failure\n print \"#{'%3d' % (i + 1)}) Failed #{test.description}\\n\"\n\n print test.match.stash_data \n print \"#{string}\\n\\n\"\n end\n\n environments.each { |e| e.teardown }\n self\n end", "title": "" }, { "docid": "f3295c945da615475a51a0d3b6de5082", "score": "0.6432331", "text": "def run_suite(suite_name, failure_strategy = nil)\n if (@options[suite_name].empty?)\n @logger.notify(\"No tests to run for suite '#{suite_name}'\")\n return\n end\n Beaker::TestSuite.new(\n suite_name, @hosts, @options, @timestamp, failure_strategy\n ).run_and_raise_on_failure\n end", "title": "" }, { "docid": "aaa55e83c39ab0ea104a265f7bbcc47a", "score": "0.64299184", "text": "def run_suite(more_tests_follow, &block)\n\tbegin\n\t yield\n\trescue Exception => ex\n\t print_exception(ex)\n\t return false\n\tensure\n\t @service.stop_everything unless more_tests_follow\n\tend\n\tif more_tests_follow\n\t return all_tests_passed?\n\telse\n\t return print_results\n\tend\n end", "title": "" }, { "docid": "e522f01507e09d3b19400eed61200ee5", "score": "0.64289904", "text": "def buildTests() \n @runner.build()\n end", "title": "" }, { "docid": "c840287fe46753b877d77086f19b14d6", "score": "0.64228135", "text": "def loadTestSuite()\n \n puts \"Loading S&S's Test Suite...\"\n \n Dir[\"./**/selenium/**/*_test.rb\"].each { |fn|\n \n test_klass = ::File.basename(fn).gsub('.rb','').split('_').each { |part| part = part.capitalize! }.join\n \n require fn\n \n tests << eval(\"#{test_klass}.suite\")\n \n }\n\n end", "title": "" }, { "docid": "718b20ece85a1b45c04d9ee274d143e3", "score": "0.64101046", "text": "def _run_suite( suite, type )\n filter = options[:filter] || '/./'\n filter = Regexp.new $1 if filter =~ /\\/(.*)\\//\n\n assertions = suite.send(\"#{type}_methods\").grep(filter).map do |method|\n inst = suite.new method\n inst._assertions = 0\n inst.run self\n\n # Failed, error, or skipped tests are handled in .puke.\n if inst.passed?\n result = Testify::TestResult.new(\n :status => :passed,\n # TODO: add the file and line\n ) \n self.results << result\n end\n \n inst._assertions\n end\n\n return assertions.size, assertions.inject(:+)\n end", "title": "" }, { "docid": "7c91d2f56a8feb86e453b1d27f762693", "score": "0.64050776", "text": "def run args = []\n options = process_args args\n\n @verbose = options[:verbose]\n\n filter = options[:filter] || '/./'\n filter = Regexp.new $1 if filter and filter =~ /\\/(.*)\\//\n\n seed = options[:seed]\n unless seed then\n srand\n seed = srand % 0xFFFF\n end\n\n srand seed\n\n @@out.puts \"Loaded suite #{$0.sub(/\\.rb$/, '')}\\nStarted\"\n\n start = Time.now\n run_test_suites filter\n\n @@out.puts\n @@out.puts \"Finished in #{'%.6f' % (Time.now - start)} seconds.\"\n\n @report.each_with_index do |msg, i|\n @@out.puts \"\\n%3d) %s\" % [i + 1, msg]\n end\n\n @@out.puts\n\n status\n\n @@out.puts\n\n help = [\"--seed\", seed]\n help.push \"--verbose\" if @verbose\n help.push(\"--name\", options[:filter].inspect) if options[:filter]\n\n @@out.puts \"Test run options: #{help.join(\" \")}\"\n\n #### GMM: Emit cppunit xml results\n if options[:runner] == \"cppunit_runner\"\n xml_file = File.expand_path($0.sub(/\\.rb$/, ''))\n xml_file << \".xml\"\n emit_xml(xml_file)\n end\n #### END GMM\n\n return failures + errors if @test_count > 0 # or return nil...\n rescue Interrupt\n abort 'Interrupted'\n end", "title": "" }, { "docid": "d86b8284299297d626e2bcc62210cc69", "score": "0.6393924", "text": "def run args\n filter = if args.first =~ /^(-n|--name)$/ then\n args.shift\n arg = args.shift\n arg =~ /\\/(.*)\\// ? Regexp.new($1) : arg\n else\n /./ # anything - ^test_ already filtered by #tests\n end\n\n @@out.puts \"Loaded suite #{$0.sub(/\\.rb$/, '')}\\nStarted\"\n\n start = Time.now\n run_test_suites filter\n\n @@out.puts\n @@out.puts \"Finished in #{'%.6f' % (Time.now - start)} seconds.\"\n\n @report.each_with_index do |msg, i|\n @@out.puts \"\\n%3d) %s\" % [i + 1, msg]\n end\n\n @@out.puts\n\n format = \"%d tests, %d assertions, %d failures, %d errors\"\n @@out.puts format % [@test_count, @assertion_count, failures, errors]\n\n return failures + errors if @test_count > 0 # or return nil...\n end", "title": "" }, { "docid": "e820a876acc56d01d07c4fe31f07d454", "score": "0.63926464", "text": "def run_tests\n count = 0\n puts \"Starting test run...\"\n self.methods.each {|test|\n next if test !~ /^test_/\n puts \"[*] Running '#{test}'...\" if @loglevel > 2\n count +=1 if self.method(test).call\n }\n \n if count > 0\n puts \"Found #{count} failure#{\"s\" if count > 1 || count == 0}.\"\n else\n puts \"Found no failures. Tokens seem sane.\"\n end\n end", "title": "" }, { "docid": "ed40ce7199db82876b1bdf9fda3f1528", "score": "0.6388522", "text": "def run_all_tests\n\n # Array of test sections\n test_library = [\n request_uri_test_cases,\n review_test_cases,\n reviews_request_test_cases,\n api_test_cases,\n server_test_cases\n ]\n\n # Actually run tests and print out results\n section_iter = 0\n puts \"\\n\"\n test_library.each do |test_section|\n section_iter += 1\n run_tests(test_section, section_iter)\n puts \"\\n\\n\"\n end\n\nend", "title": "" }, { "docid": "0c1db937a7fd5d0966a9d9f32ffa45d8", "score": "0.63872933", "text": "def run\n status('- %d @ runtime: %s', tests.length, runtime)\n tests.each do |test|\n puts(\" - #{test.identification}\")\n end\n puts('Test Output:')\n puts(object.output)\n end", "title": "" }, { "docid": "6c49f06034765dc8b8a478512e7ff97b", "score": "0.63804233", "text": "def test\n if @environment == \"prod\"\n logger.error \"There is no Test database on the Production server\"\n else\n if find_arg(['--skip-suite-teardown']).present?\n suiteTearDown = \"&runsuiteteardown=false\"\n else\n suiteTearDown = \"&runsuiteteardown=true\"\n end\n if find_arg(['--skip-test-teardown']).present?\n testTearDown = \"&runteardown=false\"\n else\n testTearDown = \"&runteardown=true\"\n end\n r = go(%Q{http://#{@hostname}:#{@properties[\"ml.test-port\"]}/test/default.xqy?func=list}, \"get\")\n suites = []\n r.body.split(\">\").each do |line|\n suites << line.gsub(/.*suite path=\"([^\"]+)\".*/, '\\1').strip if line.match(\"suite path\")\n end\n\n suites.each do |suite|\n r = go(%Q{http://#{@hostname}:#{@properties[\"ml.test-port\"]}/test/default.xqy?func=run&suite=#{url_encode(suite)}&format=junit#{suiteTearDown}#{testTearDown}}, \"get\")\n logger.info r.body\n end\n end\n return true\n end", "title": "" }, { "docid": "6d8f74bd906b7c917e338cb67cdfc109", "score": "0.6371795", "text": "def load_test_suites\n test_suite_data = Bucky::Core::TestCore::TestCaseLoader.load_testcode(@test_cond)\n raise StandardError, \"\\nThere is no test case!\\nPlease check test condition.\" if test_suite_data.empty?\n\n @tdo.update_test_suites_data(test_suite_data)\n @tdo.add_suite_id_to_loaded_suite_data(test_suite_data)\n end", "title": "" }, { "docid": "4e0c8dd455df12fb50ba99a18a94750e", "score": "0.63710636", "text": "def run_and_raise_on_failure\n begin\n run\n return self if @test_suite_results.success?\n rescue => e\n # failed during run\n report_and_raise(@logger, e, \"TestSuite :run_and_raise_on_failure\")\n else\n # failed during test\n report_and_raise(@logger, RuntimeError.new(\"Failed while running the #{name} suite\"), \"TestSuite: report_and_raise_on_failure\")\n end\n end", "title": "" }, { "docid": "0fef102f411109d6c97aba08b3526fd2", "score": "0.6365773", "text": "def run_and_raise_on_failure\n begin\n run\n return self if @test_suite_results.success?\n rescue => e\n #failed during run\n report_and_raise(@logger, e, \"TestSuite :run_and_raise_on_failure\")\n else\n #failed during test\n report_and_raise(@logger, RuntimeError.new(\"Failed while running the #{name} suite\"), \"TestSuite: report_and_raise_on_failure\")\n end\n end", "title": "" }, { "docid": "7a8f94710be4e47a0015eeac2bd05d2d", "score": "0.6353952", "text": "def run_all\n Compat::UI.info('Running all specs')\n\n run_spec\n end", "title": "" }, { "docid": "ebb971e923824d8aae1c784e6d04d850", "score": "0.6348825", "text": "def executeEntireTestSuite(options, targetDeviceID, specificTests)\n\n # loop until all test cases are covered.\n # we won't get the actual test list until partway through -- from a listener callback\n begin\n self.removeAnyAppCrashes\n @appCrashed = false\n @instrumentsStopped = false\n\n # Setup javascript to run the appropriate list of tests (initial or leftover)\n if @testSuite.nil?\n # very first attempt\n self.configureJavascriptRunner(options, targetDeviceID)\n elsif specificTests.nil?\n # not first attempt, but we haven't made it all the way through yet\n self.configureJavascriptReRunner(@testSuite.unStartedTests, @testSuite.finishedTests.length)\n else\n # we assume that we've already gone through and have been given specific tests to check out\n self.configureJavascriptReRunner(specificTests, 0)\n end\n\n # Setup new saltinel listener (will overwrite the old one if it exists)\n agentListener = SaltinelAgent.new(@javascriptRunner.saltinel)\n agentListener.eventSink = self\n @instrumentsRunner.addListener(\"saltinelAgent\", agentListener)\n\n @instrumentsRunner.runOnce @javascriptRunner.saltinel\n if @appCrashed\n self.handleAppCrash\n end\n\n end while not (@testSuite.nil? or @testSuite.unStartedTests.empty? or @instrumentsStopped)\n\n end", "title": "" }, { "docid": "f81afeb08d5b02226b0bf33c23c4bda2", "score": "0.6345122", "text": "def test_cases\n @suite.search('./testcase').map do |test_case|\n TestCase.new(self, test_case)\n end\n end", "title": "" }, { "docid": "f81afeb08d5b02226b0bf33c23c4bda2", "score": "0.6345122", "text": "def test_cases\n @suite.search('./testcase').map do |test_case|\n TestCase.new(self, test_case)\n end\n end", "title": "" }, { "docid": "abe21be75f6da5c7c80f530807b902f3", "score": "0.6330897", "text": "def run_tests\n raise NotImplementedError\n end", "title": "" }, { "docid": "110585d53036a8fd33d558ea200e6d23", "score": "0.6321336", "text": "def run\n test_code_dir = File.join(CODE_DIR, id)\n result_dir = File.join(RESULT_DIR, \"#{id}\")\n\n Dir.mkdir(result_dir) unless File.exist?(result_dir)\n $log_file = File.join(result_dir,\n \"#{Time.now.strftime(\"%Y%m%d\")}.log\")\n\n file = File.new($log_file, \"w\") || File.open($log_file, \"w+\")\n file.puts(\"#\" * 80)\n file.puts(\"# Test suite: %-55s #\" % id)\n file.puts(\"# Test item: %-55s #\" % description)\n file.puts(\"# Total test cases: %-55s #\" % size)\n file.puts(\"# Test date: %-55s #\" % Time.now.strftime(\"%Y-%m-%d\"))\n file.puts(\"#\" * 80)\n file.close\n\n Dir.glob(File.join(test_code_dir,\"test_#{id.downcase}*.rb\")) do |f|\n require f if f != \"test_#{id.downcase}_setup.rb\"\n end\n end", "title": "" }, { "docid": "60536a8595c856f241756666e65512b8", "score": "0.6307278", "text": "def setup_suite\n end", "title": "" }, { "docid": "f58d8fd67b0f32091e0936abfe1f3999", "score": "0.63072413", "text": "def run_all\n run(@options[:scenario_paths])\n end", "title": "" }, { "docid": "48a8323d450977fbe561141c68f3b106", "score": "0.63060915", "text": "def test_runner\n require 'test/unit'\n ::Test::Unit::AutoRunner.new(false).tap do |runner|\n runner.collector = lambda { |r| test_collector.new.collect($0.sub(/\\.rb\\Z/, '')) }\n end\n end", "title": "" }, { "docid": "19695c5b1ded10b8d9d366e120995491", "score": "0.6297492", "text": "def run_all\n servers = PerfTest::Config::SERVERS\n\n servers.shuffle.each do |server_name|\n start_test(server_name)\n end\n end", "title": "" }, { "docid": "5cba15726255b7228ffb26dd17e056c2", "score": "0.62914276", "text": "def test_loop_runner(suite)\n reporter.start_suite(suite)\n\n recase = []\n\n suite.each_with_index do |kase, index|\n reporter.start_case(kase)\n\n turn_path = File.expand_path(File.dirname(__FILE__) + '/../bin.rb')\n\n files = kase.files.map{ |f| f.sub(Dir.pwd+'/', '') }\n\n # FRACKING GENIUS RIGHT HERE !!!!!!!!!!!!\n cmd = []\n cmd << \"ruby\"\n cmd << \"-I#{@loadpath.join(':')}\" unless @loadpath.empty?\n cmd << \"-r#{@requires.join(':')}\" unless @requires.empty?\n cmd << \"--\"\n cmd << turn_path\n cmd << \"--marshal\"\n cmd << %[--loadpath=\"#{@loadpath.join(':')}\"] unless @loadpath.empty?\n cmd << %[--requires=\"#{@requires.join(':')}\"] unless @requires.empty?\n cmd << \"--live\" if @live\n cmd << files.join(' ')\n cmd = cmd.join(' ')\n\n #out = `#{cmd}`\n #err = ''\n\n out, err = nil, nil\n#p cmd\n Open3.popen3(cmd) do |stdin, stdout, stderr|\n stdin.close\n out = stdout.read.chomp\n err = stderr.read.chomp\n end\n\n # TODO: how to report? will need to add something to reporter\n # b/c it may have redirected stdout. Or use STDOUT?\n #if !err.empty?\n # puts err\n # raise\n #end\n\n files = kase.files\n\n # remove any unexpected output injected at the beginning\n b = out.index(/^---/m)\n yaml = out[b..-1]\n sub_suite = YAML.load(yaml)\n\n # TODO: How to handle pairs?\n #name = kase.name\n kases = sub_suite.cases\n suite.cases[index] = kases\n\n kases.each do |kase|\n kase.files = files\n #reporter.start_case(kase)\n kase.tests.each do |test|\n reporter.start_test(test)\n if test.error?\n #reporter.error(test.message)\n reporter.error(test.raised)\n elsif test.fail?\n #reporter.fail(test.message)\n reporter.error(test.raised)\n else\n reporter.pass\n end\n reporter.finish_test(test)\n end\n reporter.finish_case(kase)\n end\n end\n\n suite.cases.flatten!\n\n reporter.finish_suite(suite)\n\n suite\n end", "title": "" }, { "docid": "d4430c04cc60be3af2ddb0458e2e00aa", "score": "0.6287669", "text": "def run_all\n runner.run_all\n end", "title": "" }, { "docid": "d4430c04cc60be3af2ddb0458e2e00aa", "score": "0.6287669", "text": "def run_all\n runner.run_all\n end", "title": "" }, { "docid": "2c31b009c3807d7d08b27aef84a3c1f6", "score": "0.6284077", "text": "def execute!\n print_version_and_options\n\n begin\n trap(:INT) do\n @logger.warn \"Interrupt received; exiting...\"\n exit(1)\n end\n\n # Setup perf monitoring if needed\n @perf = Beaker::Perf.new(@hosts, @options) if /(aggressive)|(normal)/.match?(@options[:collect_perf_data].to_s)\n\n # pre acceptance phase\n run_suite(:pre_suite, :fast)\n\n # testing phase\n begin\n run_suite(:tests, @options[:fail_mode])\n # post acceptance phase\n rescue => e\n # post acceptance on failure\n # run post-suite if we are in fail-slow mode\n if @options[:fail_mode].to_s.include?('slow')\n run_suite(:post_suite)\n @perf.print_perf_info if defined? @perf\n end\n raise e\n else\n # post acceptance on success\n run_suite(:post_suite)\n @perf.print_perf_info if defined? @perf\n end\n # cleanup phase\n rescue => e\n begin\n run_suite(:pre_cleanup)\n rescue => e\n # pre-cleanup failed\n @logger.error \"Failed running the pre-cleanup suite.\"\n end\n\n # cleanup on error\n if /(never)|(onpass)/.match?(@options[:preserve_hosts].to_s)\n @logger.notify \"Cleanup: cleaning up after failed run\"\n @network_manager.cleanup if @network_manager\n else\n preserve_hosts_file\n end\n\n print_reproduction_info(:error)\n\n @logger.error \"Failed running the test suite.\"\n puts ''\n exit 1\n else\n begin\n run_suite(:pre_cleanup)\n rescue => e\n # pre-cleanup failed\n @logger.error \"Failed running the pre-cleanup suite.\"\n end\n\n # cleanup on success\n if /(never)|(onfail)/.match?(@options[:preserve_hosts].to_s)\n @logger.notify \"Cleanup: cleaning up after successful run\"\n @network_manager.cleanup if @network_manager\n else\n preserve_hosts_file\n end\n\n print_reproduction_info(:debug) if @logger.is_debug?\n end\n end", "title": "" }, { "docid": "41a541289a3ee67bfe11270a0e94e862", "score": "0.6280951", "text": "def execute(suite)\n buffer = StringIO.new\n\t\t\tios = []\n\t\t\tios << STDOUT if @stdout\n\t\t\tios << buffer\n io = MethodMulticaster.new(ios)\n\t\t\tlevel = Test::Unit::UI::NORMAL\n\n runner = case @format\n when :console\n Test::Unit::UI::Console::TestRunner\n when :xml\n Test::Unit::UI::XML::TestRunner\n else\n raise \"don't know anything about runner: [#{@runner}]\"\n end\n\n\t\t\tresult = runner.new(suite, level, io).start\n buffer.rewind\n result.output = buffer.read\n result\n end", "title": "" }, { "docid": "0134f702273e44409c4194850d39f950", "score": "0.6270375", "text": "def run\n test_documents.each do |test_document|\n classify_document(test_document)\n display_results_for(test_document)\n end\n end", "title": "" }, { "docid": "05683d73ff56e70d9ed3bf957c6443da", "score": "0.6267672", "text": "def run_tests\n Eggs.get_config.each do |test_type, test_files|\n test_files.each do |file|\n loaded = false\n [\"#{test_type}/#{file}_test.rb\", \"#{test_type}/test_#{file}.rb\"].each do |pth|\n prepend = File.dirname(DynamicApplication.current ? \n DynamicApplication.current.entry_point.to_s :\n '')\n pth = \"#{prepend}/#{pth}\" if prepend != '.'\n begin\n load pth\n loaded = true\n rescue LoadError\n puts \"Warning: #{pth} failed to load\"\n end if !loaded\n end\n raise \"#{file} is not a known test (check your Eggs.config call)\" unless loaded\n end\n end\n Eggs.execute_at_exit_blocks\n end", "title": "" } ]
2c097c10d367aaf682f579715b75b608
if first[0] > second[0] if first.nil?
[ { "docid": "3ee234071380c0fad55fd671ae4e716e", "score": "0.0", "text": "def move(coords)\n first, second = coords\n if @board[first] == []\n return @board\n elsif first > 2 || second > 2 || first < 0 || second < 0\n return @board\n elsif @board[first][0] > @board[second][0]\n return @board\n end\n @board[second].unshift(@board[first].shift)\n return @board\n end", "title": "" } ]
[ { "docid": "c23ec8bb782a69e45961f17d11ebd521", "score": "0.69762546", "text": "def can_be_merged(arr1, arr2)\n return true if arr1.nil? or arr2.nil?\n return true if arr1[1] >= arr2[0]\n\n return false\nend", "title": "" }, { "docid": "7a370289d7b0a6484d95f0d90cabdd93", "score": "0.68225604", "text": "def compare(x,y)\n case\n when x.nil? && y.nil?\n nil\n when x.nil?\n 1\n when y.nil?\n -1\n else\n x <=> y\n end\n end", "title": "" }, { "docid": "8be7efd8fea51c5e2779421f4bcfaae4", "score": "0.6818373", "text": "def <=>(other)\r\n temp = first <=> other.first\r\n temp = last <=> other.last if temp = 0\r\n return temp\r\n end", "title": "" }, { "docid": "a391d29f39f82c8c901dc509fc71053b", "score": "0.68137974", "text": "def comp(array1, array2)\n array1 && array2 ? array1.sort.map(&:abs2) == array2.sort : false\nend", "title": "" }, { "docid": "3c03cdb4ed6c16513867aee243cb2302", "score": "0.67824924", "text": "def __compare__(a, b, nils_first)\n return a <=> b unless a.nil? ^ b.nil?\n\n nils_first ^ b.nil? ? -1 : 1\n end", "title": "" }, { "docid": "d41509544025e953fcc345660ae6b025", "score": "0.6748417", "text": "def my_min_two(arr)\n min = nil \n arr.each do |ele|\n min = ele if min.nil? || ele < min \n end\n min \nend", "title": "" }, { "docid": "b5d6eff7fbe6802405d9dedfa4295737", "score": "0.6710112", "text": "def compare(left, right)\n return -1 if right.nil?\n case [left.class, right.class]\n when [Integer, Integer]\n right <=> left\n when [Array, Array]\n big = (right.size > left.size ? 1 : 0)\n left.zip(right).lazy.map { |l, r| compare(l, r) }.find(&:nonzero?) || big\n else\n compare(coerce_list(left), coerce_list(right))\n end\nend", "title": "" }, { "docid": "023addd1319a27f508548fbe6d52e25f", "score": "0.6700059", "text": "def first_in_array(arr, el1, el2)\n if arr.index(el1) > arr.index(el2)\n el2\n else\n el1\n end\nend", "title": "" }, { "docid": "7671ef4864ccaa459e03dcbdc64d3a61", "score": "0.6651936", "text": "def bigger_two(list_a, list_b)\n if list_a[0] + list_a[1] > list_b[0] + list_b[1]\n print list_a\n end\n\n if list_a[0] + list_a[1] < list_b[0] + list_b[1] \n print list_b\n end\n\n if list_a[0] + list_a[1] == list_b[0] + list_b[1]\n print list_a\n end\nend", "title": "" }, { "docid": "a8479409f16bfe4dde260d3a028a5a33", "score": "0.66489637", "text": "def sort_two array\n return array if array.length < 2 || array.first < array.last || array.first == array.last\n if array.first > array.last\n [array.last,array.first]\n end\nend", "title": "" }, { "docid": "bd2c0bb935ea313e15a14439f58552e3", "score": "0.6637151", "text": "def compare(a, b) # rubocop:disable Naming/MethodParameterName\n if a.nil? || b.nil?\n if a.nil? && b.nil?\n return 0\n end\n return -1 if a.nil?\n\n return 1\n end\n b.try(:value) <=> a.try(:value)\n end", "title": "" }, { "docid": "509643900f1ce5dc06e385056dde14ad", "score": "0.6620947", "text": "def <=>(other)\n compare_array = []\n # Lastname, Firstname, Middle\n compare_array << (@last <=> other.last) <<\n (@first <=> other.first) <<\n (@mi <=> other.mi)\n #\n # Return either:\n #\n # * zero\n # * the first compare that is non-zero\n #\n all_zero = lambda { 0 }\n compare_array.detect(all_zero) {|i| i != 0}\n end", "title": "" }, { "docid": "26df4e42438bd0fbce27b6e34e0356d5", "score": "0.6620813", "text": "def first_in_array(arr, el1, el2)\n first = \"\"\n arr.each_with_index do |element, indx|\n if arr.index(el1) < arr.index(el2) #if 3 < 1 #if 2 < 3\n first = el1\n else\n first = el2\n end\n end\n first\nend", "title": "" }, { "docid": "86be7b05f3125b9293fc16f7b41dce5a", "score": "0.6594818", "text": "def best_of(a, b)\n return a unless b\n return b unless a\n\n a[50] < b[50] ? a : b\n end", "title": "" }, { "docid": "895506b71ebbccd00057f386cc85364c", "score": "0.6558332", "text": "def comp(array1, array2)\n array1.nil? || array2.nil? ? false : array1.collect { |number| number ** 2}.sort == array2.sort\nend", "title": "" }, { "docid": "2313c6c14c31c578e75478bc1c2b1202", "score": "0.65518874", "text": "def compare_sorted(other, &block)\n sorted_self = self.sort.reverse\n sorted_other = other.sort.reverse\n \n maybe_x = nil\n\n sorted_self.zip(sorted_other)\n .each {|x,y| \n val = (block_given? ? block.call(x,y) : x <=> y)\n if(val != 0)\n maybe_x = val\n break\n else \n nil\n end\n }\n\n return maybe_x ? maybe_x : 0\n end", "title": "" }, { "docid": "6fb2f58278c65ad9c52260c9e1916cf7", "score": "0.65512145", "text": "def comp(a, b)\n if a == nil || b == nil\n false\n else\n a.map { |num| num**2 }.sort == b.sort\n end\nend", "title": "" }, { "docid": "4d647c0b89e1a7e089f8b4cf7bf4efd8", "score": "0.6546232", "text": "def sorted?(array)\n return true if array.length == 1\n first = array.shift\n second = array[0]\n return false if first > second\n sorted?(array)\nend", "title": "" }, { "docid": "75b1a046933754c237b20dd992fe2a0a", "score": "0.65206295", "text": "def higher(a, b)\n t1 = a.split('.').map{|s|s.to_i}\n t2 = b.split('.').map{|s|s.to_i}\n (t1 <=> t2) > 0\n end", "title": "" }, { "docid": "5051178c54d39ef0f9815a5fe8ee4886", "score": "0.6518324", "text": "def better?(e1, e2)\n ev1 = evaluate(e1)\n ev2 = evaluate(e2)\n\n ev1[0] < ev2[0] || (ev1[0] == ev2[0] && ev1[1] > ev2[1])\n end", "title": "" }, { "docid": "ac75452fc940baca1fee6d94ae1f3407", "score": "0.6513346", "text": "def compara_arrays(array_a, array_b)\n promedio1 = promedio(array_a)\n promedio2 = promedio(array_b)\n promedio1 > promedio2 ? promedio1 : promedio2\nend", "title": "" }, { "docid": "4f9873121fcbb5d80f0c17046e557e80", "score": "0.6506298", "text": "def compare_min(x,y)\n if x.length < y.length\n return x\n else\n return y\n end\nend", "title": "" }, { "docid": "30b8c930537bd0fd650bd2d4f1a4b1c7", "score": "0.6496997", "text": "def first_in_array(arr, el1, el2)\n if arr.index(el1) < arr.index(el2) # <= o >=\n return el1\n else\n return el2\n end\nend", "title": "" }, { "docid": "50f17831886aa887640340e1396a991e", "score": "0.64814156", "text": "def compare(a, b)\n case\n when a.nil? then b.nil? ? 0 : 1\n when b.nil? then -1\n else a <=> b\n end\n end", "title": "" }, { "docid": "50f17831886aa887640340e1396a991e", "score": "0.64814156", "text": "def compare(a, b)\n case\n when a.nil? then b.nil? ? 0 : 1\n when b.nil? then -1\n else a <=> b\n end\n end", "title": "" }, { "docid": "6463bed5dcd36c540df85ef6a61394bb", "score": "0.6467416", "text": "def my_min_two(array) #O(n)\n min_val = nil\n array.each do |ele|\n if min_val == nil || ele < min_val\n min_val = ele \n end\n end\n min_val\nend", "title": "" }, { "docid": "4fdd2b5c323e8b42da1a9d6aaecc6f5c", "score": "0.64628404", "text": "def bigger_than(first, second)\n first_sum = 0\n second_sum = 0\n i = 0\n first.size.times do\n first_sum = first_sum + first[i]\n i = i + 1\n end\n i = 0\n second.size.times do |amount|\n second_sum = second_sum + second[i]\n i = i + 1\n end\n if second_sum > first_sum\n return second\n elsif first_sum > second_sum\n return first\n elsif first_sum == second_sum\n return first\n end\nend", "title": "" }, { "docid": "8a23a94de7c7a546c2092816aecf9a34", "score": "0.6462473", "text": "def merge(first, second)\n return_array = []\n first_count = 0\n second_count = 0\n while return_array.length < (first.length + second.length)\n if first[first_count].nil?\n return_array << second[second_count]\n second_count += 1\n elsif second[second_count].nil?\n return_array << first[first_count]\n first_count += 1\n elsif first[first_count] > second[second_count]\n return_array << second[second_count]\n second_count += 1\n else # second_count == second.length || second[second_count] < first[first_count]\n return_array << first[first_count]\n first_count += 1\n end\n end\n return_array\nend", "title": "" }, { "docid": "4b4249c21a2bf2bdd5ce796d6e796222", "score": "0.6459859", "text": "def my_min_two(array)\n min = array[0] \n array.each do |el2|\n min = el2 if el2 < min\n end\n min\nend", "title": "" }, { "docid": "b4c66116c42456bd36653dc09f51f53f", "score": "0.64572877", "text": "def nil_safe_compare(a, b)\n if a.nil? && b.nil?\n 0\n elsif a.nil?\n -1\n elsif b.nil?\n 1\n else\n a <=> b\n end\nend", "title": "" }, { "docid": "b4c66116c42456bd36653dc09f51f53f", "score": "0.64572877", "text": "def nil_safe_compare(a, b)\n if a.nil? && b.nil?\n 0\n elsif a.nil?\n -1\n elsif b.nil?\n 1\n else\n a <=> b\n end\nend", "title": "" }, { "docid": "cdf0a7f15a00c9e583697360eb8699b7", "score": "0.64155805", "text": "def first_in_array(arr, el1, el2)\n if arr.index(el1) < arr.index(el2)\n el1\n else\n el2\n end\nend", "title": "" }, { "docid": "8914250f07cafe988eda5d4b7da1ff27", "score": "0.641548", "text": "def comp(array1, array2)\n return false if array1.nil? || array2.nil?\n array2 = array2.map { |x| Math.sqrt(x) }.sort\n array2 == array1.sort\nend", "title": "" }, { "docid": "3b0450e094264f1c30537dac5f00ecf9", "score": "0.6411135", "text": "def merge(arr1, arr2)\n result = []\n loop do \n compare = arr1.first <=> arr2.first\n case compare\n when -1\n result << arr1.shift\n when 1\n result << arr2.shift\n when nil\n if arr1.empty?\n result << arr2.shift\n else\n result << arr1.shift\n end\n end\n #binding.pry\n break if arr1.empty? && arr2.empty?\n end\n # compare first element from arr1 with \n ## first element from arr2\n # smaller number is appended to result array\n result\nend", "title": "" }, { "docid": "eb882d78374d25d8d977dacf83e0e4c7", "score": "0.6401386", "text": "def greater_than_v2(num1, num2)\n if [num1, num2].join.to_i > [num2, num1].join.to_i\n true\n else\n false\n end\nend", "title": "" }, { "docid": "33f1dd3f62b6e2c934ece683cb5627de", "score": "0.63947093", "text": "def first_in_array(arr, el1, el2)\n if arr.index(el1) < arr.index(el2)\n return el1\n else\n return el2\n end\nend", "title": "" }, { "docid": "6264e161af318602f0007287e1f968be", "score": "0.6394093", "text": "def comp(array1, array2)\n array1.nil? || array2.nil? ? false : (array1.map { |item| item ** 2 }.sort! == array2.sort!)\nend", "title": "" }, { "docid": "7acd02661fe2d614f6a5756984f723be", "score": "0.6371375", "text": "def overlap(arr1,arr2)\n arr1[1][0] > arr2[0][0] ? true : false\nend", "title": "" }, { "docid": "c408db189089ba3579e276f5616eddd2", "score": "0.63677454", "text": "def cmp_nils(a, b)\n if a.nil? && b.nil?\n 0\n elsif a.nil?\n -1\n elsif b.nil?\n 1\n end\n end", "title": "" }, { "docid": "97b1c406436b3202868a140da347b795", "score": "0.6365427", "text": "def smallest_diff(arr1, arr2)\n return -1 if arr1.length == 0 || arr2.length == 0\n\n a = arr1.sort!\n b = arr2.sort!\n merge_sorted(a, b)\nend", "title": "" }, { "docid": "c8ca992c575922403d7077e0027a8a9c", "score": "0.636479", "text": "def key_for_min_value(name_hash)\nif name_hash.empty?\n return nil\n else\n array = name_hash.to_a \n if array[0][1] < array [1][1] && array [0][1] < array [2][1]\n return array [0][0]\n elsif array [1][1] < array [0][1] && array [1][1] < array [2][1]\n return array [1][0]\n elsif array [2][1] < array [0][1] && array [2][1] < array [1][1]\n return array [2][0]\n end\n end\nend", "title": "" }, { "docid": "d374d4238cb2b9eb7bed785d778c7451", "score": "0.6354603", "text": "def <=>(other)\n\t\t\treturn nil if @day_number.nil? ^ other.day_number.nil? # either both or none must be nil\n\t\t\t[@day_number||0,@ps_number||0] <=> [other.day_number||0, other.ps_number||0]\n\t\tend", "title": "" }, { "docid": "40146dde7eb503d60ac07a3c20896915", "score": "0.6353672", "text": "def greater(value, neighbor)\n neighbor == nil || value >= neighbor\n end", "title": "" }, { "docid": "c75f78f381b5a004bedb948ab00e9a74", "score": "0.63478476", "text": "def comp(array1, array2)\n array1.nil? || array2.nil? ? false : array1.sort.map { |v| v**2 } == array2.sort\nend", "title": "" }, { "docid": "0f3d0021a389f8ad64af4bfde1cc2d2b", "score": "0.6346297", "text": "def bigger_two(list_1,list_2)\n if list_1[0] + list_1[1] >= list_2[0] + list_2[1] # This part adds the two numbers and test which on is greater\n return list_1\n end\n return list_2 # if the statement above is not true then return the second list since it is the greater one\n if list_1[0] + list_1[1] == list_2[0] + list_2[1]\n return list_1 # this part states that if they are equal then return the first list\n end\n\nend", "title": "" }, { "docid": "017ea96d31b7c9b9bc9ec1c383adc83e", "score": "0.6343533", "text": "def first_in_array(arr, ele1, ele2)\n if arr.index(ele1) < arr.index(ele2)\n return ele1\n else\n return ele2\n end\nend", "title": "" }, { "docid": "25ae9513cdc2a5774da3236a6b8c3dad", "score": "0.6335426", "text": "def comparor(first, second)\n if first > second\n @combo1\n elsif first < second\n @combo2\n elsif first == second\n false\n end\n end", "title": "" }, { "docid": "da9dc0e1d8020ea35017ed5233e73328", "score": "0.63149947", "text": "def bigger_two(list1, list2)\n x = list1[0] + list1[1]\n y = list2[0] + list2[1]\n\n if x > y\n return list1\n end\n\n if x < y\n return list2\n end\n\n if x = y\n return list1\n end\n\nend", "title": "" }, { "docid": "3adc9ee370273bfa5dfcc9594b5ecf8c", "score": "0.63033104", "text": "def >(other)\n raise 'Can\\'t compare with nil' if other.nil?\n value > other.value\n end", "title": "" }, { "docid": "067f847637f87cf0e4a0082395c41631", "score": "0.6295948", "text": "def compare(i,j)\n (sort_by.call(array[i].data) <=> sort_by.call(array[j].data)) == -1\n end", "title": "" }, { "docid": "b3144692f8b5ef2d6db585374bb82205", "score": "0.6286293", "text": "def <=>( other )\n first = self.x <=> other.x \n if first != 0\n return first\n else\n return self.y <=> other.y\n end\n end", "title": "" }, { "docid": "bae8bce40e585296ce68081ae7b35379", "score": "0.62781495", "text": "def fastest(t1, t2)\n m1, s1, f1 = t1[0], t1[2..3], t1[5..6]\n m2, s2, f2 = t2[0], t2[2..3], t2[5..6]\n \n if m1 < m2\n t1\n elsif m1 > m2\n t2\n else\n if s1 < s2\n t1\n elsif s1 > s2\n t2\n else\n if f1 < f2\n t1\n elsif f1 > f2\n t2\n else t1\n end\n end\n end\nend", "title": "" }, { "docid": "555c69f8676dc1f0b792bf715da5e144", "score": "0.62738204", "text": "def secondLowestAndHighest(array)\n array = array.sort\n \n second_smallest = array[1]\n second_highest = array[array.length-2]\n \n puts \" #{second_smallest}, #{second_highest}\"\n end", "title": "" }, { "docid": "49af957ca76de3c1270feb55ac919498", "score": "0.6271402", "text": "def compare_max(x,y)\n if x.length > y.length\n return x\n else\n return y\n end\nend", "title": "" }, { "docid": "1896994d8e13d25b209e0a9b805a50e4", "score": "0.6266431", "text": "def cmp(left, right)\n #puts \"cmp #{left}, #{right}\"\n\n return 0 if left.empty? && right.empty?\n return -1 if left.empty?\n return 1 if right.empty?\n\n l = left.first\n r = right.first\n\n cmp_first = case [check_type(l), check_type(r)]\n when %i[int arr]\n cmp([l], r)\n\n when %i[arr int]\n cmp(l, [r])\n\n when %i[arr arr]\n cmp(l, r)\n\n when %i[int int]\n #puts \"#{l} <=> #{r}\"\n l <=> r\n end\n\n #puts \"cmp_first #{cmp_first}\"\n\n return -1 if cmp_first == -1\n return 1 if cmp_first == 1\n\n cmp(left.clone.drop(1), right.clone.drop(1))\n end", "title": "" }, { "docid": "8498d007d10e8a8b85c200f6eb8e53e9", "score": "0.62577116", "text": "def compare(a, b)\n if a == b\n a\n else\n nil\n end\nend", "title": "" }, { "docid": "7c49dc8b2a963feb5c2c24b564bda73b", "score": "0.62563777", "text": "def check_array(a, b)\n return (a[0] == b[0] || a[a.length-1] == b[b.length-1])\nend", "title": "" }, { "docid": "6907ecf6cee0e1617e66f74a9ae2b862", "score": "0.625218", "text": "def contains(outer, inner)\n outer[0] < inner[0] && inner[1] < outer[1]\nend", "title": "" }, { "docid": "bdb7f5c45e7ad236269c0b80c186fe07", "score": "0.6247939", "text": "def merge(arr_1, arr_2)\n compares = arr_1.size + arr_2.size\n sorted_arr = []\n compares.times do\n if arr_1.empty? || (arr_2.first && (arr_2.first < arr_1.first))\n sorted_arr << arr_2.shift\n else\n sorted_arr << arr_1.shift\n end\n end\n sorted_arr\nend", "title": "" }, { "docid": "71e4c672e0d21afc02e03e6505fb0720", "score": "0.62451965", "text": "def <=>(other)\n return 1 if other.nil? or self.size > other.size\n return -1 if other.size > self.size\n # Sort any array children we have\n self.each_pair { |k, v|\n self[k] = v.sort if v.is_a?(Array)\n }\n other.each_pair { |k, v|\n other[k] = v.sort if v.is_a?(Array)\n }\n return 0 if self == other # that was easy!\n # compare elements and decide who's \"bigger\" based on their totals?\n\n # fine, try some brute force and just hope everything implements to_s\n self.flatten.map { |e| e.to_s }.join() <=> other.flatten.map { |e| e.to_s }.join()\n end", "title": "" }, { "docid": "939bb938fa21321b8677fbbadcfc21a4", "score": "0.6239273", "text": "def my_min2(arr)\n temp = arr.first\n arr.each { |el| temp = el if el < temp }\n\n temp\nend", "title": "" }, { "docid": "67409c7da05d8a35840c01dc04903384", "score": "0.6233608", "text": "def finder(arr1, arr2)\n # Sort the arrays\n arr1.sort!\n arr2.sort!\n # zip both arrays and compare\n arr1.zip(arr2) do |a, b|\n return a if b == nil\n end\nend", "title": "" }, { "docid": "7c97958cb58af9ccebde3512dac340b3", "score": "0.6232959", "text": "def compare(index1, index2)\n\n\t\tif @sort == :higher\n\t\t\t\n\t\t\treturn @arr[index1].priority > @arr[index2].priority\n\n\t\telse\n\n\t\t\treturn @arr[index1].priority < @arr[index2].priority\n\n\t\tend\n\n\t\treturn false\n\tend", "title": "" }, { "docid": "e88dbdaecafece2cd98b7e91469e2d6c", "score": "0.62031317", "text": "def array(nums, nums1)\n return (nums[0] == nums1[0] or nums[nums.length-1] == nums1[nums1.length-1])\nend", "title": "" }, { "docid": "2f6dd1ec8e341f70632b83c1d9334d39", "score": "0.6201856", "text": "def sort_element(left_array, right_array, results = Array.new)\n if left_array == []\n return results << right_array[0] if right_array.length == 1\n\n left_value = right_array[0]\n right_value = right_array[1]\n \n if left_value < right_value \n results << left_value\n right_array.delete_at(0)\n \n else\n results << right_value\n right_array.delete_at(1)\n end\n \n results\n elsif ( (right_array == []) || (right_array.class == NilClass) )\n return results << left_array[0] if left_array.length == 1\n \n left_value = left_array[0]\n right_value = left_array[1]\n \n if left_value < right_value \n results << left_value\n left_array.delete_at(0)\n \n else\n results << right_value\n left_array.delete_at(1)\n end\n \n results \n else\n \n left_value = left_array[0]\n right_value = right_array[0]\n \n if left_value < right_value \n results << left_value\n left_array.delete_at(0)\n \n else\n results << right_value\n right_array.delete_at(0)\n end\n \n results\n end\n \n results\n sort_element(left_array, right_array, results)\nend", "title": "" }, { "docid": "71bd5372fbbb3c27ce4f6a48ffe70970", "score": "0.6195052", "text": "def comp(array1, array2)\n return false if array1.nil? || array2.nil?\n array1.map { |i| i*i }.sort == array2.sort\nend", "title": "" }, { "docid": "be6669c73237adf51c9d146c96e86b20", "score": "0.6178789", "text": "def bigger_two(list, list1)\n sum = list[0] + list[1]\n sum1 = list1[0] + list1[1]\n\n if sum > sum1\n return list\n elsif sum < sum1\n return list1\n elsif sum >= sum1\n return list \n end\nend", "title": "" }, { "docid": "0884d0e443339426cbca06a504bf1e65", "score": "0.61785406", "text": "def sort_array_desc(array2)\n array2.sort do |a,b| \n b <=> a\n end \nend", "title": "" }, { "docid": "7a54b563e323281e7e72f1b982f3071f", "score": "0.617813", "text": "def abstract_relational_comparison(p1, p2, p1_first = true) # todo speed up!\n ''' p1<p2 if p1_first else p2<p1.\n Returns the result of the question: is p1 smaller than p2?\n in case p1_first is false it returns the answer of:\n is p2 smaller than p1.\n result is PyJs type: bool || undefined'''\n \n px = to_primitive(p1, :Number)\n py = to_primitive(p2, :Number)\n if !p1_first # reverse ||der\n px, py = py, px\n end\n unless (px.js_type == :String && py.js_type == :String)\n px = to_number(px)\n py = to_number(py)\n if px.nan? || py.nan?\n return nil # watch out here!\n end\n return px < py # same cmp alg||ithm\n else\n return px < py\n end\n end", "title": "" }, { "docid": "91bfff3efb6a98fba1d3b7d00f966127", "score": "0.61665475", "text": "def my_min2(list)\n test_el = list.first\n list.each { |el| test_el = el if el < test_el }\n\n test_el\nend", "title": "" }, { "docid": "343ea154757611e2fe5c41dd8fec24e4", "score": "0.61644644", "text": "def min_of_two(siffra1, siffra2)\n if siffra1 < siffra2\n output = siffra1\n else \n output = siffra2\n end\n return output\nend", "title": "" }, { "docid": "8331f4cb8c1cfcf419af5e2bf8ddc518", "score": "0.61630875", "text": "def first_in_array(arr, el1, el2)\n\n pos1 = arr.index(el1)\n pos2 = arr.index(el2)\n \n if pos1 < pos2\n print el1\n else\n print el2\n end\nend", "title": "" }, { "docid": "7dbd9655608c8e4712cf4454934609c8", "score": "0.61627686", "text": "def <=>(other)\n comparison = 0\n i = 0\n while comparison.zero? && i < 3\n comparison = self[i].to_i <=> other[i].to_i\n i += 1\n end\n comparison = qualifier_compare(non_nil_qualifier(self[3]), non_nil_qualifier(other[3])) if comparison.zero?\n\n comparison\n end", "title": "" }, { "docid": "13f3e6f539603cc74b6380a7accf3ec1", "score": "0.61571187", "text": "def comp(arr1, arr2)\n return false if arr1.nil? || arr2.nil?\n arr1.sort.map { |a| a**2 } == arr2.sort\nend", "title": "" }, { "docid": "bab019275594a04454fe6149a52e4770", "score": "0.6147728", "text": "def comp(array1, array2)\n return false if array1 == nil || array2 == nil\n \n a1 = array1.dup.sort\n a2 = array2.dup.sort\n \n 0.upto(a1.length-1) do |index|\n return false if a1[index]**2 != a2[index]\n end\n true\nend", "title": "" }, { "docid": "dc08475e504aceb22fd8bec02fca6cac", "score": "0.61468184", "text": "def bigger_two(list_1, list_2)\n sum1 = list_1[0] + list_1[1]\n sum2 = list_2[0] + list_2[1]\n if sum1 > sum2\n return list_1\n elsif sum2 > sum1\n return list_2\n end\n return list_1\nend", "title": "" }, { "docid": "1709a767a40e6791a60c7d428b64419d", "score": "0.61410755", "text": "def SecondGreatLow(arr)\n \n new_arr = (arr & arr).sort\n \n if new_arr.length > 2 \n return \"#{new_arr[1]} #{new_arr[-2]}\"\n else \n return \"#{new_arr[0]} #{new_arr[1]}\"\n end\n \nend", "title": "" }, { "docid": "9f0f9dc4cd1d8bb8c505dbc879abf961", "score": "0.6140701", "text": "def bigger_two(list_1, list_2)\n sum_1 = list_1[0].to_i + list_1[1].to_i\n sum_2 = list_2[0].to_i + list_2[1].to_i\n if sum_1 > sum_2\n return list_1\n elsif sum_2 > sum_1\n return list_2\n else\n return list_1\n end\nend", "title": "" }, { "docid": "9706b1a0a5930163a28ac5b53c777837", "score": "0.6139857", "text": "def larger_than(number_1, number_2)\n\n if number_1.length > number_2.length\n return true\n\n elsif number_1 == number_2\n return false\n\n elsif number_1.length < number_2.length\n return false\n\n elsif number_1.length == number_2.length\n for i in 0..(number_1.length)\n if number_1[i] == number_2[i]\n next\n elsif number_1[i] > number_2[i]\n return true\n else\n return false\n end\n end\n\n end\n\nend", "title": "" }, { "docid": "65162979918d4656f14d39e85f0cda6c", "score": "0.6138482", "text": "def SecondGreatLow(arr)\n max_index = arr.index(arr.max)\n min_index = arr.index(arr.min)\n arr[max_index] == arr[max_index-1] ? second_max = arr[max_index-2] : second_max = arr[max_index-1]\n arr[min_index] == arr[min_index+1] ? second_min = arr[min_index+2] : second_min = arr[min_index+1]\n return \"#{second_min} #{second_max}\"\nend", "title": "" }, { "docid": "ad261883b0f50bee134b0e2853f49839", "score": "0.61342293", "text": "def merge(left, right)\n final_sort = [] \n # Make comparison while we have two subarrays with elements\n while !left.empty? && !right.empty?\n # compare the first elements of the left & right subarrays\n # if the first element of the left is larger or equal, remove it from the left array and place it in the final_sort array\n if left.first <= right.first\n final_sort << left.shift\n else\n # if the previous condition failed, then remove the first element of the right array and put it in the final_sort array\n final_sort << right.shift\n end\n end\n # if there is a remaining single element combine it with the final_sort array\n final_sort.concat(left).concat(right)\nend", "title": "" }, { "docid": "a46f6f359bcca361e1c6f2f0fc16b6be", "score": "0.6131672", "text": "def greater_of x, y\n x > y ? x : y\nend", "title": "" }, { "docid": "2cbccab33069d22457a7a06083f081ff", "score": "0.6128539", "text": "def compare_max(x,y)\n if x > y\n return x\n else\n return y\n end\nend", "title": "" }, { "docid": "492f327a230442b316aa335a9d391104", "score": "0.61270404", "text": "def bigger_two(list1,list2)\n sum1 = list1[0] + list1[1]\n sum2 = list2[0] + list2[1]\n if sum2 > sum1\n return list2\n else\n return list1\n end\nend", "title": "" }, { "docid": "271eef315720b8e5dc47bcbae00f77b3", "score": "0.6125859", "text": "def sorted?(array)\n return false if array.empty?\n return true if array.length <= 1\n array[0] < array[1] && sorted?(array[1..-1]) \nend", "title": "" }, { "docid": "4b73ea6c7d376cfd7496f12a0854ffea", "score": "0.61222017", "text": "def bigger_two(list1, list2)\n list1_sum = list1[0] + list1[1]\n list2_sum = list2[0] + list2[1]\n if list1_sum < list2_sum\n print list2,\"\\n\"\n elsif list2_sum < list1_sum\n print list1, \"\\n\"\n else \n print list1, \"\\n\"\n end\nend", "title": "" }, { "docid": "3c1a502234fe8ff2a0c73b851263b497", "score": "0.61177105", "text": "def min (a, b)\n\t\ta > b ? b : a\n\tend", "title": "" }, { "docid": "564ab7d1bb9c83d2f2058b90682d4c2b", "score": "0.6117612", "text": "def comp(array1, array2)\n return false if array1.nil? || array2.nil?\n\n array1.map { |num| num**2 }.sort == array2.sort\nend", "title": "" }, { "docid": "85f7a477a5fd3d87f5e5b1279fb60e0b", "score": "0.6110964", "text": "def higher?(a,b)\n a>b\nend", "title": "" }, { "docid": "081abaf19c32496957c56578604f72ea", "score": "0.6105807", "text": "def merge(arr1, arr2)\n result = []\n\n until arr1.length == 0 || arr2.length == 0\n # if arr1.first > arr2.first\n # result << arr2.shift\n # else\n # result << arr1.shift\n # end\n\n # Nice one liner for the commented conditional statement above\n # Would not recommend for readability but it's cool :)\n result << (arr1.first > arr2.first ? arr2.shift : arr1.shift)\n end\n\n result.concat(arr1).concat(arr2)\nend", "title": "" }, { "docid": "6e1ca27ebfc406f81928c9574e5a5be7", "score": "0.6104705", "text": "def <=>(ary)\n `for(var i=0,l=this.length;i<l;++i){if(ary[i]==null){break;};var x=this[i].m$_ltgt(ary[i]);if(x!==0){return x;};}`\n return `this.length.m$_ltgt(ary.length)`\n end", "title": "" }, { "docid": "d6a048482af86155e07079d916849857", "score": "0.6103071", "text": "def <=>(other)\n\tif other == nil\n\t\treturn nil\n\telse\n\t\tvalue <=> other.value\n\tend\nend", "title": "" }, { "docid": "9e3660df46a6ca416e719a51abc35777", "score": "0.61022234", "text": "def <=>(other)\n len = [length, other.length].min\n\n 0.upto(len - 1) do |i|\n return -1 if self[i] < other[i]\n return 1 if self[i] > other[i]\n end\n\n return -1 if length < other.length\n return 1 if length > other.length\n return 0\n end", "title": "" }, { "docid": "11920d61fb8bf55acf2acbc68e86cda7", "score": "0.6101899", "text": "def my_min2(array)\n min = array.first\n\n array.each do |el|\n min = min > el ? el : min\n end\n min\nend", "title": "" }, { "docid": "80adc9c3281130655d900ccfe71ecc03", "score": "0.61012465", "text": "def <=>(other)\n other = Type.coerce_to other, Array, :to_ary\n\n size.times { |i|\n return 1 unless other.size > i\n\n diff = at(i) <=> other.at(i)\n return diff if diff != 0\n }\n\n return 1 if size > other.size\n return -1 if size < other.size\n 0\n end", "title": "" }, { "docid": "aa0e02f7a64da779b112aeb31e15aa95", "score": "0.6090417", "text": "def first_in_array(arr, el1, el2)\n\nif arr.index(el1) < arr.index(el2)\n return el1\nelse\n return el2\nend\n\n# see below:\n# puts [\"a\", \"b\", \"c\", \"d\"].index(\"d\")\n\nend", "title": "" }, { "docid": "6eb5a0b6739f289f61e4b7a7b5306084", "score": "0.60801136", "text": "def finder(a,b)\n c = a.sort - b.sort\n return c.first # c[0]\nend", "title": "" }, { "docid": "58a8591c2fe86d09f3bce29d2b3856f6", "score": "0.6078653", "text": "def compare(a, b)\n if (a <=> b) == -1\n p 'a is less than b'\n elsif (a <=> b) == 1\n p 'a is greater than b'\n else\n p 'a is equal to b'\n end\nend", "title": "" }, { "docid": "de036c3456abb23815e2f3dbe2380eb0", "score": "0.60715437", "text": "def merge left, right\n output = []\n # until we've emptied both arrays\n while left[0] && right[0]\n # compare the first index of both arrays\n # take the lesser value and push it into a new array\n if left[0]<right[0]\n output.push(left.shift)\n elsif right[0]<left[0]\n output.push(right.shift)\n # if the values are equal, push both of them\n else\n output.push(right.shift).push(left.shift)\n end\n end\n while left[0]\n output.push(left.shift)\n end\n\n while right[0]\n output.push(right.shift)\n end\n\n output\n\n # merge two arrays to make them sorted\n\nend", "title": "" }, { "docid": "a1566f06ed4d48c0245d7e3c31bc2f28", "score": "0.60624576", "text": "def version_one(*arrays)\n combined_array = []\n arrays.flatten.each do |val|\n i = 0\n length = combined_array.length\n if length == 0\n combined_array << val\n else\n while i < length\n current = combined_array[i]\n if val <= current\n combined_array.insert(i, val)\n break\n elsif i == length - 1\n combined_array << val\n break\n end\n i+=1\n end\n end\n end\n\n # Return the sorted array\n combined_array\n end", "title": "" }, { "docid": "1194db0ff8fc55ca731feff30ed3c9fa", "score": "0.60555875", "text": "def sorted?(array)\n return true if array.size < 2\n (array[0] <= array[1]) && sorted?(array.drop(1))\nend", "title": "" } ]
9ceb011c748e37fdf6c7d8ab714fe58f
GET /partner_details/1 GET /partner_details/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "8919e0078b61cff260e778fe27ad0978", "score": "0.7834648", "text": "def show\n @our_partner = OurPartner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @our_partner }\n end\n end", "title": "" }, { "docid": "7cde41072e6226e76e987f4c9200f334", "score": "0.78109455", "text": "def show\n @partner = Admin::Partner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partner }\n end\n end", "title": "" }, { "docid": "7592ccd22d750e7c5b32e82dfcdb9cde", "score": "0.77842844", "text": "def show\n @partner = Partner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partner }\n end\n end", "title": "" }, { "docid": "7592ccd22d750e7c5b32e82dfcdb9cde", "score": "0.77842844", "text": "def show\n @partner = Partner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partner }\n end\n end", "title": "" }, { "docid": "ad6eb5d8dac87dc31d72a8717f279883", "score": "0.7566681", "text": "def show\n @admin_partner = Admin::Partner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @admin_partner }\n end\n end", "title": "" }, { "docid": "7059daf25ba6388efcee46c041ab8ef5", "score": "0.75566363", "text": "def show\n @partner = ResPartner.find(:all, :domain=>[['ref', '=', \"h_\" + params[:id]]])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partner }\n end\n end", "title": "" }, { "docid": "bf1b323f75713ed5fb6890b54192a014", "score": "0.7478585", "text": "def show\n @partner_status = PartnerStatus.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partner_status }\n end\n end", "title": "" }, { "docid": "852d081556cc14b12edb09d996eada2f", "score": "0.74401647", "text": "def index\n @partner_details = PartnerDetail.all\n end", "title": "" }, { "docid": "89a5f5b1434d02bd0666e4bd073294bd", "score": "0.7388753", "text": "def show\n @service_partner = ServicePartner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @service_partner }\n end\n end", "title": "" }, { "docid": "3701df75e2e89a4ac8a3eeeae0dd6e77", "score": "0.7203801", "text": "def show\n @transaction_partner = TransactionPartner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @transaction_partner }\n end\n end", "title": "" }, { "docid": "894106b7b1614f534a0a3377715c519d", "score": "0.71836996", "text": "def set_partner_detail\n @partner_detail = PartnerDetail.find(params[:id])\n end", "title": "" }, { "docid": "31b7f9757c3057c01bf9d0b5e15f81d9", "score": "0.7142629", "text": "def new\n @our_partner = OurPartner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @our_partner }\n end\n end", "title": "" }, { "docid": "2b25a2c92ad3e86e930671fbaadac0dd", "score": "0.7136408", "text": "def new\n @partner = Admin::Partner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partner }\n end\n end", "title": "" }, { "docid": "526424c5bb47cf293bfdf63348f69aba", "score": "0.7103359", "text": "def new\n @partner = Partner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partner }\n end\n end", "title": "" }, { "docid": "526424c5bb47cf293bfdf63348f69aba", "score": "0.7103359", "text": "def new\n @partner = Partner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partner }\n end\n end", "title": "" }, { "docid": "8f7254624b092fe98b5a59c6f7a6b639", "score": "0.7071779", "text": "def new\n @partner = Partner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partner }\n end\n end", "title": "" }, { "docid": "3bf60ce742d95d98a814231fe1e8dadd", "score": "0.7058589", "text": "def show\n @content_partner = ContentPartner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @content_partner }\n end\n end", "title": "" }, { "docid": "8930cdd733837727e612bdeb504bba77", "score": "0.70183635", "text": "def show\n @race_partner = RacePartner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @race_partner }\n end\n end", "title": "" }, { "docid": "4023678e00675399b64ba7467bfcbf1a", "score": "0.6992382", "text": "def show\n @partner = Partner.find_by_id(params[:id])\n respond_to do |format|\n if params[:id].blank?\n format.json { render :json => { :error => \"No ID provided\" }, :status => 400 }\n format.xml { render :xml => \"<error>No ID provided</error>\", :status => 400 }\n elsif @partner.blank?\n format.json { render :json => { :error => \"Partner with ID #{params[:id]} Not Found\" }, :status => 404 }\n format.xml { render :xml => \"<error>Partner with ID #{params[:id]} Not Found</error>\", :status => 404 }\n else\n format.json { render :action => \"show\" }\n format.xml { render :action => \"show\" }\n end\n end\n end", "title": "" }, { "docid": "990112ec01e0ad32e93001dc2af6b1eb", "score": "0.68844426", "text": "def new\n @admin_partner = Admin::Partner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @admin_partner }\n end\n end", "title": "" }, { "docid": "3e928141b0a785691e7d5f863328d15d", "score": "0.6881074", "text": "def show\n @backend_partner_site = Backend::PartnerSite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @backend_partner_site }\n end\n end", "title": "" }, { "docid": "de07e12fff4458b8fa21ebab66207bf6", "score": "0.6820301", "text": "def show\n @partner_user_detail = PartnerUserDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @partner_user_detail }\n end\n end", "title": "" }, { "docid": "183dcb6e2932beef646112e33b58c3ca", "score": "0.67898256", "text": "def new\n @partner_status = PartnerStatus.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partner_status }\n end\n end", "title": "" }, { "docid": "845fbcf8cc9554bdd0dec231320ebcf7", "score": "0.67777", "text": "def show\n @partner_org_component = PartnerOrgComponent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partner_org_component }\n end\n end", "title": "" }, { "docid": "cc3b128b521783debaf1d854f9f49205", "score": "0.67548037", "text": "def new\n @service_partner = ServicePartner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @service_partner }\n end\n end", "title": "" }, { "docid": "1d505361d5834063c604a17801f2aa60", "score": "0.6738296", "text": "def show\n @partner = Partner.find(params[:id])\n @title = \"partners\"\n @state = Country.find(@partner.country_id)\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @partner }\n end\n end", "title": "" }, { "docid": "4ba944b5ab755dcb76af20e10e44e7e9", "score": "0.6652393", "text": "def show\n render json: serializer_class.new(delivery_partner, params: { lead_provider: }).serializable_hash.to_json\n end", "title": "" }, { "docid": "942df6df26b609084c47e22474cddf76", "score": "0.6640774", "text": "def new\n @transaction_partner = TransactionPartner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @transaction_partner }\n end\n end", "title": "" }, { "docid": "2ab39592826c119d36a2975aeb7014d8", "score": "0.65918374", "text": "def detail(offer_id)\n fetch_json(\"detail/#{offer_id}\")\n end", "title": "" }, { "docid": "ae90e75fa5c2a8a813e4a5058dd5a91b", "score": "0.6573206", "text": "def create\n @partner_detail = PartnerDetail.new(partner_detail_params)\n\n respond_to do |format|\n if @partner_detail.save\n format.html { redirect_to @partner_detail, notice: 'Partner detail was successfully created.' }\n format.json { render :show, status: :created, location: @partner_detail }\n else\n format.html { render :new }\n format.json { render json: @partner_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8e8fccfa1de91b21649883246b0e8ba9", "score": "0.6549959", "text": "def get_detail\n render :json => ClientCertification.find(params[:id])\n end", "title": "" }, { "docid": "b708d3da8e7e6b3be0216d6fa8294823", "score": "0.6512741", "text": "def create\n @partner = ResPartner.create(\n name: params[:name],\n ref: params[:ref],\n supplier: 'true',\n company_id: 3,\n property_account_receivable: 142,\n property_account_payable: 150\n )\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partner }\n end\n end", "title": "" }, { "docid": "047a1cfe9d21b0f3af1038b86853fed9", "score": "0.65096354", "text": "def show\n @partner_admin_association = @partner.partner_admin_associations.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @partner_admin_association }\n end\n end", "title": "" }, { "docid": "bd8294faa6566189a95f9545d03bbe0b", "score": "0.6500774", "text": "def index\n # TODO(partner)\n @partners = [] # current_user.partners.page(params[:page]).per(50)\n render json: @partners, status: 200, each_serializer: ::V1::PartnerSerializer, scope: {user: current_user}\n end", "title": "" }, { "docid": "334244706b14a524184f06e8429dc1ea", "score": "0.6487833", "text": "def show\n @question_for_partner = QuestionForPartner.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @question_for_partner }\n end\n end", "title": "" }, { "docid": "dacb1ce2bda146d271357b600c4c19fd", "score": "0.6487803", "text": "def show\n @toyota_epc_part_number_list_parent = ToyotaEpc::PartNumberListParent.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @toyota_epc_part_number_list_parent }\n end\n end", "title": "" }, { "docid": "b69d93ea6d591c790c7919ade9ebdf83", "score": "0.6464217", "text": "def show\n @apprenticeship = Apprenticeship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @apprenticeship }\n end\n end", "title": "" }, { "docid": "6699959567caf507080a02be1f780f11", "score": "0.64449704", "text": "def show\n @partner_country_association = @partner.partner_country_associations.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @partner_country_association }\n end\n end", "title": "" }, { "docid": "749ce8ebb21667c87f337a8751da7fb6", "score": "0.6435491", "text": "def show\n if @partner\n radius = params[:radius]\n render json: {\n id: @partner.id,\n name: @partner.name,\n avg_locations: @partner.average_location,\n p_locations: @partner.locations.map{ |l|{\n city: l.city, \n coords: ->(c){{lat: c[0], lng: c[1]}}[l.coords.split(',').map(&:to_f)],\n merchants: @partner.merchants.map{|m| {\n coverage: m.percent_cover(l, radius.to_f), \n m_coords: m.locations.map(&:coords).map{|c| {\n lat: c.split(',')[0].to_f,\n lng: c.split(',')[1].to_f\n } }\n }\n }\n }\n }\n }\n else\n render json: @partner.errors\n end\n end", "title": "" }, { "docid": "5cac515de4e9ec1fab9407e1bdfab6ac", "score": "0.6424294", "text": "def new\n @partner_user_detail = PartnerUserDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @partner_user_detail }\n end\n end", "title": "" }, { "docid": "81330836b34b8bf65e082273fb88367f", "score": "0.64242494", "text": "def show\n @partners = @user.partners\n @partner = Partner.new\n end", "title": "" }, { "docid": "f48fb84966877c8983e8c4ac7fecf7b0", "score": "0.6418193", "text": "def new\n @content_partner = ContentPartner.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @content_partner }\n end\n end", "title": "" }, { "docid": "6f39934b3a1b572c42010f05f86d2771", "score": "0.6402106", "text": "def create\n @partner = Partner.new(partner_params)\n if partner\n render json: @partner\n else\n render json: partner.errors\n end\n end", "title": "" }, { "docid": "bad8228f8fd74cbadb15305d3a6fdaa7", "score": "0.64019", "text": "def show\n if params[:list]\n @partner = Partner.find(:first,:conditions => [ \"id = ?\" , params[:list]])\n else \n @partner = Partner.find(params[:id])\n end\n \n end", "title": "" }, { "docid": "16751e90365d7934b72a4938a89641e5", "score": "0.6340275", "text": "def show\n render json: serializer_class.new(ecf_partnership).serializable_hash.to_json\n end", "title": "" }, { "docid": "8911f2d54dae658a06fbbad2e1c5a6b2", "score": "0.63381493", "text": "def show\n @part_detail = PartDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @part_detail }\n end\n end", "title": "" }, { "docid": "685fa4296dfd33d15f2103c7cb3ea3d7", "score": "0.6317918", "text": "def show\n @part_two_result = PartTwoResult.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @part_two_result }\n end\n end", "title": "" }, { "docid": "3dc131a43427c254f59b53602a384fc9", "score": "0.63049686", "text": "def new\n @backend_partner_site = Backend::PartnerSite.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @backend_partner_site }\n end\n end", "title": "" }, { "docid": "9ffbbbf6c58001f509a932d594c2e067", "score": "0.6298927", "text": "def index\n @partners = Partner.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @partners }\n end\n end", "title": "" }, { "docid": "ff95b4ba7990384aec43f4489c2ced98", "score": "0.6294777", "text": "def show\n @foreign_enterprise = ForeignEnterprise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @foreign_enterprise }\n end\n end", "title": "" }, { "docid": "35fd3a4363aa8f6eb15d48f6ea3073ec", "score": "0.62844896", "text": "def show\n @party = Party.find(params[:id])\n @items = @party.items\n # @rides = Ride.find(params[:id])\n respond_to do |format|\n format.json { render :json => params }\n format.html\n end\n end", "title": "" }, { "docid": "59078c0898ba6549a796019e16af6ef5", "score": "0.6265902", "text": "def get_intro_info\n\n @payment = Payment.find(params[:payment_id])\n @client = @payment.client\n @employee_code = @payment.employee_code\n\n render :json => {payment: @payment, client: @client, employee_code: @employee_code}\n\n end", "title": "" }, { "docid": "621b3e5531c3c09b908883912b96a7d5", "score": "0.6263464", "text": "def index\n @partners = Partner.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @partners }\n end\n end", "title": "" }, { "docid": "c45eac89a4e77b57db2717f4a9ff00d0", "score": "0.6253634", "text": "def index\n @partner = Partner.find(params[:partner_id])\n @categories = @partner.partner_categories.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @categories }\n end\n end", "title": "" }, { "docid": "7a0a29e9c8d821f01fc168e327e78079", "score": "0.6236215", "text": "def show\n @consumers = Consumer.find(params[:consumer_id])\n @services = Service.all\n @expenditure = @consumer.expenditures.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @expenditure }\n end\n end", "title": "" }, { "docid": "081e94b8a0606b0867e19fccad10f8b4", "score": "0.6207749", "text": "def show\n @partenaire = Partenaire.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partenaire }\n end\n end", "title": "" }, { "docid": "4274e8196aba307b3a1499bf436adad9", "score": "0.61929023", "text": "def show\n @partner_focus_area_association = @partner.partner_focus_area_associations.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @partner_focus_area_association }\n end\n end", "title": "" }, { "docid": "2f49e9c2b68b8e2f2d4ce6fc18ce25c2", "score": "0.6189461", "text": "def show\n @lead = Lead.find(params[:id])\n @partyid = @lead.agent_id.to_s\n @partyservicesurl = \"http://services.homefinder.com/partyServices/details?id=#{@partyid}&apikey=#{HF_API_KEY}\"\n @partyservicesresponse = JSON.parse(open(@partyservicesurl).read)\n logger.debug \"#{@partyservicesresponse}\" \n @agentpicurl = @partyservicesresponse['data']['parties'][@partyid]['largeLogoUrl']\n @agentname = @partyservicesresponse['data']['parties'][@partyid]['name']\n @brokername = @partyservicesresponse['data']['parties'][@partyid]['companyName']\n @listingsurl = @partyservicesresponse['data']['parties'][@partyid]['listingsUrl']\n \n @click_url = session[:click_url]\n\n if @click_url != nil\n @listingsurl = @click_url + URI.escape(@listingsurl)\n end\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lead }\n end\n end", "title": "" }, { "docid": "a69949172852bd71800220c4d00824fe", "score": "0.61875504", "text": "def show\n render json: @api_v1_opportunity\n end", "title": "" }, { "docid": "f0c9253ba5789a840855aef15be86143", "score": "0.61764", "text": "def show_by_partner_key\r\n p = PartnerProduct.find_by_partner_key(params[:id], :include => :product)\r\n @product = p.product\r\n show\r\n end", "title": "" }, { "docid": "0f4039b1de60690f251a82fc6d40db84", "score": "0.6172494", "text": "def show\n @rent_detail = RentDetail.find(params[:id])\n \n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @rent_detail }\n end\n end", "title": "" }, { "docid": "0a1cba2ae963f1eb86fe11cc9cf44408", "score": "0.61674666", "text": "def get_enterprise\n empresa = Enterprise.find(params[:idEmpresa].to_i)\n\n respond_to do |format|\n format.json {render json: empresa}\n end \n \n end", "title": "" }, { "docid": "d64a39a93bb993affbca1387f24f27fa", "score": "0.6153737", "text": "def get_client_detail\n get(\"profile/detail\")\n end", "title": "" }, { "docid": "9bc07ea84c0a9cfc028ccc46bdf66fdf", "score": "0.6152294", "text": "def create\n @partner = Partner.new(partner_params)\n\n respond_to do |format|\n if @partner.save\n format.html { redirect_to partners_path, notice: 'Partner was successfully created.' }\n format.json { render :index, status: :created, location: partners_path }\n else\n format.html { render :new }\n format.json { render json: @partner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "843dac271276abc60e9f6812f7f71b9d", "score": "0.61490256", "text": "def set_partner\n @partner = Partner.find(params[:id])\n end", "title": "" }, { "docid": "efa1fd7a51b1f2565f6527ba170ea2f9", "score": "0.6132121", "text": "def show\n @partite = Partite.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partite }\n end\n end", "title": "" }, { "docid": "ed4d0991427e87d4a2bfde9c680177dd", "score": "0.6120587", "text": "def show\n @choosing_an_apprenticeship = ChoosingAnApprenticeship.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @choosing_an_apprenticeship }\n end\n end", "title": "" }, { "docid": "bf54a1d8176b9e947f8b3f4845fdafe5", "score": "0.61185026", "text": "def set_partner\n @partner = Partner.friendly.find(params[:id])\n end", "title": "" }, { "docid": "32b3a08bdae96204d28125dd3f9da904", "score": "0.61132914", "text": "def show\n @telenumbers_of_client = TelenumbersOfClient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @telenumbers_of_client }\n end\n end", "title": "" }, { "docid": "5782079ec0c0b6af8bd51e1cbe5fbb00", "score": "0.6110588", "text": "def show\n render json: @api_v1_person\n end", "title": "" }, { "docid": "a86c0b4f67eb9ae838d3e1d4e2b6b778", "score": "0.6109948", "text": "def show\n @political_party = PoliticalParty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @political_party }\n end\n end", "title": "" }, { "docid": "01aa7c5994686ddf0235cad0bf4503d3", "score": "0.6099841", "text": "def show\n @provider = Provider.where(npi: params[:id]).first\n respond_with @provider\n end", "title": "" }, { "docid": "f5f8e44b8dea468a9bcc17fa6771bd91", "score": "0.60945946", "text": "def show\n @offer_chain = OfferChain.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @offer_chain }\n end\n end", "title": "" }, { "docid": "a0275ca323c57715c332d72a5daccbaa", "score": "0.6093625", "text": "def create\n @admin_partner = Admin::Partner.new(params[:partner])\n\n respond_to do |format|\n if @admin_partner.save\n format.html { redirect_to admin_partners_url, notice: 'Partner was successfully created.' }\n format.json { render json: @admin_partner, status: :created, location: @admin_partner }\n else\n format.html { render action: \"new\" }\n format.json { render json: @admin_partner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "95397ccc1118a8249cb1c24bb02abd34", "score": "0.60929775", "text": "def show\n @profsociety = Profsociety.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profsociety }\n end\n end", "title": "" }, { "docid": "0c999dae9bab235a163899cd6a45e97c", "score": "0.60925436", "text": "def professional_info\n respond_with_entity(api.get('/api/v1/profile/professional_info'),\n PassaporteWeb::Entities::Profile::ProfessionalInfo)\n end", "title": "" }, { "docid": "82210bc65900f5b5e898d4280f13653b", "score": "0.6091631", "text": "def show\n @enterprise = Enterprise.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @enterprise }\n end\n end", "title": "" }, { "docid": "8bb29e0c58e5ad916a5108b294bea77c", "score": "0.6088615", "text": "def show\n @entrepreneur = Entrepreneur.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @entrepreneur }\n end\n end", "title": "" }, { "docid": "65fd27aa538b318a738803fc9ddff0aa", "score": "0.60840195", "text": "def index\n @partners = Partner.paginate(page: params[:page])\n respond_to do |format|\n format.html\n format.mobile { render mobile: @partners }\n # format json for android app\n format.json { render json: @partners }\n format.xml { render xml: @partners }\n end\n end", "title": "" }, { "docid": "631843d06c3afdd90a60c7c7915d969d", "score": "0.6082826", "text": "def show\n @proveedor = Proveedor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proveedor }\n end\n end", "title": "" }, { "docid": "631843d06c3afdd90a60c7c7915d969d", "score": "0.6082826", "text": "def show\n @proveedor = Proveedor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proveedor }\n end\n end", "title": "" }, { "docid": "285fd4ac99e9c73bea5d9d0ad12f2a53", "score": "0.6079144", "text": "def update\n respond_to do |format|\n if @partner.update(partner_params)\n format.json { render :show, status: :ok, location: @partner }\n else\n format.json { render json: @partner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7cfef8a31743545a606b9b2cabdae9be", "score": "0.60775", "text": "def new\n @race_partner = RacePartner.new\n @races = Race.all\n @charities = Charity.all\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @race_partner }\n end\n end", "title": "" }, { "docid": "72745a4917d51812c2d2dea19544510a", "score": "0.6074381", "text": "def show\n @interested_party = InterestedParty.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @interested_party }\n end\n end", "title": "" }, { "docid": "e87f8208480b5745e002f3be3dd23463", "score": "0.6059115", "text": "def show\n @professional = Professional.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @professional }\n end\n end", "title": "" }, { "docid": "f9f10195fca465a327b5476f5e81caaf", "score": "0.6053253", "text": "def create\n @partner = Partner.new(partner_params)\n\n respond_to do |format|\n if @partner.save\n format.html { redirect_to @partner, notice: 'Partner was successfully created.' }\n format.json { render action: 'show', status: :created, location: @partner }\n else\n format.html { render action: 'new' }\n format.json { render json: @partner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7bbba1397bf63e939ae4737380c61d50", "score": "0.6052582", "text": "def show\n @vendor_relationship = VendorRelationship.find params[:vendor_relationship_id]\n @product_vendor_relationship = @vendor_relationship.product_vendor_relationships.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @product_vendor_relationship }\n end\n end", "title": "" }, { "docid": "ca2f437ee4f429809c30783b29df581d", "score": "0.6050895", "text": "def new\n @partner_org_component = PartnerOrgComponent.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @partner_org_component }\n end\n end", "title": "" }, { "docid": "d9880b7ee3c4deea2ee2d29d5e6bb3bd", "score": "0.6048469", "text": "def create\n @partner = Admin::Partner.new(params[:admin_partner])\n\n respond_to do |format|\n if @partner.save\n format.html { redirect_to @partner, notice: 'Partner was successfully created.' }\n format.json { render json: @partner, status: :created, location: @partner }\n else\n format.html { render action: \"new\" }\n format.json { render json: @partner.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "df2e4f12f2f5276932ad298c0cd3ae66", "score": "0.6048319", "text": "def show\n @commune = Commune.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @commune }\n end\n end", "title": "" }, { "docid": "ced609d576727891864895abd6e4aada", "score": "0.6047178", "text": "def show\n @partnership = Partnership.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @partnership }\n end\n end", "title": "" }, { "docid": "8c054ab2ff70e2209395ffc40b3faabe", "score": "0.60463715", "text": "def show\n @mypclient = Mypclient.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @mypclient }\n end\n end", "title": "" }, { "docid": "7e8b29873a00ce3399481e87a7e1b09a", "score": "0.60460156", "text": "def new\n @title = t('view.assistances.new_title')\n @assistance = Assistance.new\n @partner = Partner.new\n @assistance.partner = @partner\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @assistance }\n end\n end", "title": "" }, { "docid": "a2d114ad115e247011cde7cfb634f4dc", "score": "0.60435325", "text": "def show\n @part_two_predict = PartTwoPredict.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @part_two_predict }\n end\n end", "title": "" }, { "docid": "b9ea4e09667b3bc539cf5f35307edd2e", "score": "0.60417676", "text": "def show\n render json: @competitor_price\n end", "title": "" }, { "docid": "b9ea4e09667b3bc539cf5f35307edd2e", "score": "0.60417676", "text": "def show\n render json: @competitor_price\n end", "title": "" }, { "docid": "54ad52543543a36c7f9b89787622fb73", "score": "0.60383177", "text": "def show\n @party = Party.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @party }\n end\n end", "title": "" }, { "docid": "d038a9714e1759775c211ee17fa36822", "score": "0.6037043", "text": "def show\n @election_precinct_number = ElectionPrecinctNumber.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @election_precinct_number }\n end\n end", "title": "" }, { "docid": "eb9206e72d7f5c9abf1aa93132f600d1", "score": "0.6035737", "text": "def show\n @proctor = Proctor.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @proctor }\n end\n end", "title": "" }, { "docid": "a405dd1b2b8aead081311370c2c4ca82", "score": "0.6032244", "text": "def create\n\t\t@partner = Partner.new(partner_params)\n\n\t\trespond_to do |format|\n\t\t\tif @partner.save\n\t\t\t\tformat.html { redirect_to @partner, notice: 'Partneren blev oprettet.' }\n\t\t\t\tformat.json { render action: 'show', status: :created, location: @partner }\n\t\t\telse\n\t\t\t\tformat.html { render action: 'new' }\n\t\t\t\tformat.json { render json: @partner.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "8b0cea9aea2900a25dcde24bd625e58f", "score": "0.603223", "text": "def set_partner\n @partner = Partner.find(params[:id])\n end", "title": "" } ]
b7ea67b8067fca3c0387d7dfe325e4cb
IOflush ios.flush => ios Flushes any buffered data within _ios_ to the underlying operating system (note that this is Ruby internal buffering only; the OS may buffer the data as well). $stdout.print "no newline" $stdout.flush _produces:_ no newline
[ { "docid": "9646aede343fc5dce938fc57acd609c1", "score": "0.5741564", "text": "def flush\n end", "title": "" } ]
[ { "docid": "5f3cb2a7d1ad72a0dc08ceb1fd074fe9", "score": "0.83600587", "text": "def flush\n each_ios_and_stdout(&:flush)\n end", "title": "" }, { "docid": "2ce4cd694db79a70cd4ced6da57af56d", "score": "0.75099504", "text": "def flush!\n $stdout.flush\n end", "title": "" }, { "docid": "63bcc5ac6dba3a17e7426bb3fe8eaac2", "score": "0.72979325", "text": "def print_flush(msg)\n STDOUT.print msg\n STDOUT.flush\nend", "title": "" }, { "docid": "8e19703663aaf451e9ab3fd4bb085277", "score": "0.7227351", "text": "def flush\n @out.flush if @out.is_a?(IO)\n end", "title": "" }, { "docid": "0a2e2f5e46d0e614831928a98032c883", "score": "0.7141007", "text": "def flush!\n $stdout.flush\nend", "title": "" }, { "docid": "0a2e2f5e46d0e614831928a98032c883", "score": "0.7141007", "text": "def flush!\n $stdout.flush\nend", "title": "" }, { "docid": "92e8fc9f277b028b18863231710fbe6a", "score": "0.70516884", "text": "def print_and_flush(string)\n print string\n $stdout.flush\nend", "title": "" }, { "docid": "5a98a3ec799803c86e069adb2e63140c", "score": "0.7012696", "text": "def print_and_flush(str)\n print str\n STDOUT.flush\nend", "title": "" }, { "docid": "d205dfa4dee7829eac3c14b5eed94154", "score": "0.6973628", "text": "def flush\n # {{{\n unless @output_allowed\n raise \"You can't use flush outside of a Rweb::out-block\"\n end\n buffer = @buffer.join\n\n unless @output_started\n sendHeaders\n end\n $stdout.print(buffer)\n\n @buffer = []\n # }}}\n end", "title": "" }, { "docid": "e74780df1726aff12515caf07df9d187", "score": "0.6971969", "text": "def flush\n @ios.flush\n end", "title": "" }, { "docid": "120064a4da948bea81cf571506e0953e", "score": "0.69445235", "text": "def flush\n out = @buffer\n @buffer = ''\n out\n end", "title": "" }, { "docid": "ce4e65cdbb0f06ef324b43f4c64551a3", "score": "0.6801754", "text": "def flush\n io.flush\n end", "title": "" }, { "docid": "6763ce3eb83455585ab4457a8f904351", "score": "0.67733145", "text": "def flush\n if output\n now = Time.now\n if @last_flush.nil? || (now - @last_flush > FLUSH_TIMER)\n output.flush\n @last_flush = now\n end\n end\n end", "title": "" }, { "docid": "e04f760116ec2d1e7881c6403bf6bd8b", "score": "0.675998", "text": "def flush\n @inside_input = false\n str = \"#{END_MARKER}\\n#{FLUSH_SENTENCE}\\n\"\n @pipe.print(str)\n # Here invoke the reader thread to ensure\n # the whole output has been read.\n #@reader.run\n end", "title": "" }, { "docid": "7002b52bfe361e56c5e5663dac9c510c", "score": "0.6733288", "text": "def clear\n $stdout.print \"\\n\"\n $stdout.flush\n end", "title": "" }, { "docid": "1bf453752898169d43b0484eeef13041", "score": "0.66525894", "text": "def __flush\n @_undies_io.current.flush\n end", "title": "" }, { "docid": "4951d1849c14076f4024e8008aa00420", "score": "0.65037847", "text": "def intrflush(bool = false)\n Ncurses.intrflush(pointer, bool ? 1 : 0)\n end", "title": "" }, { "docid": "778634e26a54a06d0676fc5616831b8f", "score": "0.6461462", "text": "def flush\n\t\t\t\tsyswrite(@write_buffer)\n\t\t\t\t@write_buffer.clear\n\t\t\tend", "title": "" }, { "docid": "b3264dfbca09c7ef127c09ced70e0ccb", "score": "0.64359206", "text": "def clear_stream\n @stream.print(' ' * IO.console.winsize[1])\n end", "title": "" }, { "docid": "21b79544b53e6b0d88092f81f1808c9a", "score": "0.6364414", "text": "def flush\n @out.flush if @out.respond_to? :flush\n end", "title": "" }, { "docid": "b0cce0fc59cc5bdb286cf30a5c2500d1", "score": "0.63520396", "text": "def flush_output\n if @pending_output != \"\"\n add_prompt\n connection.send_data @pending_output\n clear_output\n end\n end", "title": "" }, { "docid": "f99f7c250c09316727b843684d604cc1", "score": "0.6350143", "text": "def flush() end", "title": "" }, { "docid": "f99f7c250c09316727b843684d604cc1", "score": "0.6350143", "text": "def flush() end", "title": "" }, { "docid": "f99f7c250c09316727b843684d604cc1", "score": "0.6350143", "text": "def flush() end", "title": "" }, { "docid": "90c6e411c3c55627822a52ac82cf87b7", "score": "0.6315968", "text": "def flush_buffer\n buf = @@output_buffer.dup\n @@output_buffer.clear\n buf\n end", "title": "" }, { "docid": "5c4d14ac0c426f167838fda26420dd16", "score": "0.6309253", "text": "def flush\n # avoid flush cycles via the @flushing flag\n if @flushing.nil?\n @flushing = true\n local_flush\n @outputs.each {|o| o.flush}\n end\n @flushing = nil\n end", "title": "" }, { "docid": "5ad5c5614970671c67f24040caf5a459", "score": "0.6291993", "text": "def flush\n @input << @tail\n buffer = @input.join\n @input.clear\n @tail = \"\" # @tail.clear is slightly faster, but not supported on 1.8.7\n buffer\n end", "title": "" }, { "docid": "983c0d3b3d04f467bdaf96d0bb332358", "score": "0.6271947", "text": "def flush\n # NOOP\n end", "title": "" }, { "docid": "983c0d3b3d04f467bdaf96d0bb332358", "score": "0.6271947", "text": "def flush\n # NOOP\n end", "title": "" }, { "docid": "a39e8837ce724068be1a907961ffbbf8", "score": "0.62315255", "text": "def print_buffer(buf)\n $stdout.print buf if @flush_buffer\n $stdout.flush unless $stdout.sync\n end", "title": "" }, { "docid": "4a8928c4ad8b694f694c20abfd3006ca", "score": "0.62185985", "text": "def flush_input\n Ncurses.flushinp\n end", "title": "" }, { "docid": "3d9175b14b944c9252e99741e896c4fc", "score": "0.61800593", "text": "def flush( text, state ); end", "title": "" }, { "docid": "362fac27f2aa37a374df5f9d3e9069bd", "score": "0.6164102", "text": "def flush()\n @device.flush() ;\n end", "title": "" }, { "docid": "2707db2a188a24cb492f95f2d4f0a632", "score": "0.614512", "text": "def flush\n @output.puts @widgets.values.join\n end", "title": "" }, { "docid": "d08d594af138c1b746b228228becb88b", "score": "0.60978407", "text": "def flush!\n @logger.debug \"FLUSH ==========> #{@output_type}\"\n if (@output_type == :blank) then\n @output << \"\\n\"\n elsif (@buffer.length > 0) then\n if @add_paragraph then\n @output << \"p. \" if @output_type == :paragraph\n @add_paragraph = false\n end\n @output << \"bq. \" if current_mode == :blockquote\n if @output_type == :definition_list and @support_definition_list then\n @output << \"-\" * @list_indent_stack.length << \" \"\n @buffer.sub!(\"::\", \":=\")\n elsif @output_type == :ordered_list then\n @output << \"#\" * @list_indent_stack.length << \" \"\n elsif @output_type == :unordered_list or \\\n (@output_type == :definition_list and not @support_definition_list) then\n @output << \"*\" * @list_indent_stack.length << \" \"\n end\n @output << inline_formatting(@buffer) << \"\\n\"\n end\n clear_accumulation_buffer!\n end", "title": "" }, { "docid": "091e19abee4360f70964ea93c32a3faf", "score": "0.6096796", "text": "def flush\n handle_fork\n _flush\n end", "title": "" }, { "docid": "2a2087f16be9c9c981ea76b7df9e3c9d", "score": "0.60580444", "text": "def flush(options = {})\n if dut_version > '0.12.0'\n sync_up\n put('j^')\n sync_up\n # By now, the simulator has generated all log output up to this point and flushed it out,\n # however it may not be in the Origen log output yet because the main Origen thread has not\n # given the stdout/err reader threads a chance to process it.\n # This will now sleep the main Origen thread to allow that to get a chance to happen and we\n # will proceed once it has been > 100ms since a log message was processed, at that point we\n # can safely assume that they are all done and nothing is left in the buffer.\n w = false\n while !w || simulation.time_since_last_log < 0.1\n w = true\n sleep 0.1\n end\n # Finally, make sure the messages are not now sitting in an IO buffer\n Origen.log.flush\n nil # Keep the console clean if this is called interactively\n else\n unless options[:quiet]\n OrigenSim.error \"Use of flush requires a DUT model compiled with OrigenSim version > 0.12.0, the current dut was compiled with #{dut_version}\"\n end\n end\n end", "title": "" }, { "docid": "19f4ff63687739597d675a311ee2700f", "score": "0.60325867", "text": "def flush_next_out\n\t\t@out_pos = @output_buffer.length\n\t\t@finished = true\n\t\tret = @output_buffer.pack(\"c*\")\n\t\t@output_buffer = []\n\t\tret\n\tend", "title": "" }, { "docid": "ebb91edb56badcdee198da10477f064c", "score": "0.6025128", "text": "def flush\n buffer = @input\n reset\n buffer\n end", "title": "" }, { "docid": "baed093cb78071d5bfbbe5af9551e474", "score": "0.6019872", "text": "def flush_buffer\n if @timer\n @timer.cancel\n @timer = nil\n end\n unless @buffer.empty?\n internal_send_request('append_output', :text => @buffer)\n @buffer = ''\n end\n end", "title": "" }, { "docid": "e258915362b9b1d350938fb7a0c85312", "score": "0.60075104", "text": "def flush\n @socket&.flush\n end", "title": "" }, { "docid": "0520cedc94a2a87c3d90fd6e2bbbcea0", "score": "0.60020703", "text": "def flush_next_out\n\t\t\t@out_pos = @output_buffer.length\n\t\t\t@finished = true\n\t\t\tret = @output_buffer.pack(\"c*\")\n\t\t\t@output_buffer = []\n\t\t\tret\n\t\tend", "title": "" }, { "docid": "fb9296281fa11ab3b719f15126d1ef78", "score": "0.5982524", "text": "def clear_stdout\n $stdout.string = '' if $stdout.is_a?(StringIO)\n end", "title": "" }, { "docid": "36bc7eb0723870e56e8a5a9ea7daf300", "score": "0.5967549", "text": "def auto_flush\n if @written.nil?\n @written = 0\n end\n\n @written += 1\n\n if @written >= self.flush_interval\n self.flush\n @written = 0\n end\n end", "title": "" }, { "docid": "16c975a526e34428ac037e74d8275ab2", "score": "0.59456545", "text": "def buffer( msg, flush: true )\n return buffer_reset if quiet\n if msg.respond_to? :each\n msg.each do |msg_line|\n @line_buffer += msg_line\n end\n else\n @line_buffer += msg\n end\n return unless flush && @to_console && @msg_queue.nil?\n STDOUT.print @line_buffer\n STDOUT.flush\n buffer_reset\n end", "title": "" }, { "docid": "de4844a696a0528ea81f23a0fcee8df3", "score": "0.594546", "text": "def puts(*args)\n @lock.synchronize do\n # ensure no indicator line remains out\n clear_stream\n @stream.puts(*args)\n end\n end", "title": "" }, { "docid": "db1646995778cb17ef9ec630611b668e", "score": "0.59184223", "text": "def flush\n @socket.flush if @socket\n end", "title": "" }, { "docid": "2272d213aae1db3e0102ccab180805d6", "score": "0.5917455", "text": "def flush\n stream.flush\n end", "title": "" }, { "docid": "89030d89aa10891a6fe72a58a5340539", "score": "0.589227", "text": "def flush\n @sendbuf_lock.synchronize {\n while @sendbuf.size > 0\n send_data(@sendbuf[0..@block_size-1])\n @sendbuf = @sendbuf[@block_size..-1].to_s\n end\n }\n end", "title": "" }, { "docid": "55aab86a8b7c972cee0884bbfb13d9ec", "score": "0.5876943", "text": "def print_raw(msg = '')\n $stdout.print(msg)\n $stdout.flush\n\n return if not self.fd\n self.fd.write(msg)\n self.fd.flush\n msg\n end", "title": "" }, { "docid": "a740e3c9170628171de1aab9bb1ffb09", "score": "0.58452713", "text": "def flush_input\n\t \[email protected](7)\n\t \[email protected](7)\n\t \tsleep(1)\n\t end", "title": "" }, { "docid": "dba78a1b5dda7731f0faa32874f70795", "score": "0.584235", "text": "def flush!\n return false if @buffer.empty? and @output_type != :blank\n @logger.debug \"FLUSH ==========> #{@output_type}\"\n @buffer.gsub!(/\\A\\n*/, \"\")\n\n case\n when mode_is_code?(current_mode)\n @output << \"```#{@block_lang}\\n\"\n @output << @buffer << \"\\n\"\n @output << \"```\\n\"\n when preserve_whitespace?\n @output << @buffer << \"\\n\"\n\n when @output_type == :blank\n @output << \"\\n\"\n\n else\n case current_mode\n when :paragraph\n @output << \"> \" if @mode_stack[0] == :quote\n\n when :list_item\n @output << \" \" * @mode_stack.count(:list_item) << \"* \"\n\n when :horizontal_rule\n @output << \"---\"\n\n end\n @output << inline_formatting(@buffer) << \"\\n\"\n end\n @buffer = \"\"\n end", "title": "" }, { "docid": "78cb31827996f04c437d556f960deddd", "score": "0.5825291", "text": "def clear_line!\n print \"\\r\\e[2K\"\n end", "title": "" }, { "docid": "0616ca5d80343ad5eaa2013ead44961a", "score": "0.58173484", "text": "def flush\n end", "title": "" }, { "docid": "0616ca5d80343ad5eaa2013ead44961a", "score": "0.58173484", "text": "def flush\n end", "title": "" }, { "docid": "0616ca5d80343ad5eaa2013ead44961a", "score": "0.58173484", "text": "def flush\n end", "title": "" }, { "docid": "0616ca5d80343ad5eaa2013ead44961a", "score": "0.58173484", "text": "def flush\n end", "title": "" }, { "docid": "0616ca5d80343ad5eaa2013ead44961a", "score": "0.58173484", "text": "def flush\n end", "title": "" }, { "docid": "f4e7d7efaebacf52b5667f63b431b0a5", "score": "0.58108157", "text": "def flush_buffer\n # note we must discard cancelled timer or else we never create a new timer and stay cancelled.\n if @timer\n @timer.cancel\n @timer = nil\n end\n\n to_send = nil\n @mutex.synchronize do\n unless @buffer.empty?\n to_send = @buffer\n @buffer = ''\n end\n end\n\n if to_send\n internal_send_audit(:kind => :output, :text => to_send, :category => EventCategories::NONE)\n end\n end", "title": "" }, { "docid": "cbf1009111fe3da1190ea5f409ed9c2a", "score": "0.5793985", "text": "def flush\n osync = @sync\n @sync = true\n do_write \"\"\n return self\n ensure\n @sync = osync\n end", "title": "" }, { "docid": "14be47ee0d96e71e8826d03176e4813f", "score": "0.5787909", "text": "def write(data, clear_first = false)\n output.print(ECMA_CSI + '1' + ECMA_CHA) if clear_first\n output.print(data)\n output.flush\n end", "title": "" }, { "docid": "b9667dc2bd1ba9c132eb8bd9d74f854e", "score": "0.57859033", "text": "def reset_flush\n @flush_thread.wakeup\n end", "title": "" }, { "docid": "f05d3922a83969237ec3167cc081dbd7", "score": "0.57811195", "text": "def print_clear; print \"\\e[0J\" end", "title": "" }, { "docid": "e4bba5bdbc1d773849d6e63b693a8c00", "score": "0.5777558", "text": "def flush\n @gnuplot.flush\n end", "title": "" }, { "docid": "87901644cf6d333e3f8fbe8142231765", "score": "0.57725006", "text": "def pout(str)\n print str\n $stdout.flush\nend", "title": "" }, { "docid": "f6af8bbd7a5d4baded24a6a5dc3fde3e", "score": "0.5769145", "text": "def flush_buffer; self.input_buffer = \"AAAA\"; end", "title": "" }, { "docid": "6b38975e32979d92ffb1ce9b315208cf", "score": "0.5765444", "text": "def kibuvits_write_to_stdout data\n $kibuvits_lc_mx_streamaccess.synchronize do\n # It's like the kibuvits_writeln, but without the\n an_io=STDOUT.reopen($stdout)\n an_io.write data\n an_io.flush\n an_io.close\n end # synchronize\nend", "title": "" }, { "docid": "17d0abe777defd60ca3d234c1ccc205d", "score": "0.5761723", "text": "def clear_stdout\n $stdout.string = ''\n end", "title": "" }, { "docid": "14ec66a358d263747b4f9e8419fa8d52", "score": "0.5758735", "text": "def sync_send\n sync_write.putc(\"!\")\n sync_write.flush\n end", "title": "" }, { "docid": "25d3c0af1345766498a55e7f7c14e4ab", "score": "0.57564807", "text": "def flush\n return unless @buffer.size > 0\n @log.write(@buffer.slice!(0..-1).join)\n end", "title": "" }, { "docid": "9c35fc20f94afdafe70157e70e73985b", "score": "0.5704385", "text": "def clear_line; print \"\\e[2K\" end", "title": "" }, { "docid": "820eee0d995f82da9f1a416390cabe91", "score": "0.56985235", "text": "def flush\n @handle.flush\n end", "title": "" }, { "docid": "d22ce8c1a00cf00ef02d7fc188b60dd0", "score": "0.56922626", "text": "def puts_clear; puts \"\\e[0J\" end", "title": "" }, { "docid": "45132d0d75d8f9782f45497dd37e5fec", "score": "0.5663681", "text": "def slowly\n yield.each_char {|x| putc x ; sleep(0.009) }\n puts \"\"\n end", "title": "" }, { "docid": "018a38e7e91fd4cc26594ecd4bf62996", "score": "0.56604683", "text": "def flush\n self.channel.flush\n end", "title": "" }, { "docid": "018a38e7e91fd4cc26594ecd4bf62996", "score": "0.56604683", "text": "def flush\n self.channel.flush\n end", "title": "" }, { "docid": "2a297b82d62d5fe5b1aa245ff298b285", "score": "0.56535673", "text": "def flush\n return if @current_line.nil?\n\n @stream << @current_line\n @current_line = nil\n end", "title": "" }, { "docid": "56a74b4e638bd1baf5039725bb048016", "score": "0.56488305", "text": "def clear_eol\n print \"\\e[0K\"\n end", "title": "" }, { "docid": "e7b8731961a9de8a2624f0e0fa69d73a", "score": "0.5646292", "text": "def flush()\n return if @loop.nil?\n @waiting_thread = Thread.current\n begin\n @loop.wakeup()\n rescue\n # ignore\n end\n while busy?\n sleep(2.0)\n end\n @waiting_thread = nil\n end", "title": "" }, { "docid": "be972ed6ad12bea6b859350817458045", "score": "0.5644351", "text": "def flush; end", "title": "" }, { "docid": "be972ed6ad12bea6b859350817458045", "score": "0.5644351", "text": "def flush; end", "title": "" }, { "docid": "be972ed6ad12bea6b859350817458045", "score": "0.5644351", "text": "def flush; end", "title": "" }, { "docid": "be972ed6ad12bea6b859350817458045", "score": "0.5644351", "text": "def flush; end", "title": "" }, { "docid": "be972ed6ad12bea6b859350817458045", "score": "0.5644351", "text": "def flush; end", "title": "" }, { "docid": "ce2c2725a3bd01ca3fbe7baa398cd5ef", "score": "0.5627325", "text": "def flush(*args, &blk)\n (@client ||= connect).flush(*args, &blk)\n end", "title": "" }, { "docid": "44a292a3db3778aa70e8ac7fa898366e", "score": "0.56256366", "text": "def flush\n @sockets.each {|s| s.flush }\n end", "title": "" }, { "docid": "97e56037d9151ed745119e9ed96766a9", "score": "0.56243515", "text": "def putc(char)\n $stdout.putc(char);\n $stdout.flush();\n end", "title": "" }, { "docid": "762866ba9f7572e259a7425237dc6142", "score": "0.5622623", "text": "def flush(**); end", "title": "" }, { "docid": "f5c7741c4131a35fc143e607c1c5be79", "score": "0.56104165", "text": "def local_flush\n end", "title": "" }, { "docid": "4af3fe20701a8ed5924e472981ef07b2", "score": "0.5608911", "text": "def clear_to_end\n ConsoleGlitter.escape('0J')\n end", "title": "" }, { "docid": "94254721644f20ee580eef5eb42c295e", "score": "0.5575958", "text": "def flush()\n wakeup()\n @flows.each_value { |f| f.flush() }\n while busy?\n sleep(0.2)\n end\n end", "title": "" }, { "docid": "b3d32b35cc5366ced59145b41f7c8147", "score": "0.55675876", "text": "def _puts(text = nil, fg = nil, bg = nil)\n if @status_displayed && self.width && self.width > 0\n _clear_line((@status.length / self.width) + 1)\n @status_displayed = false\n end\n _write(\"#{text}\", fg, bg)\n STDOUT.write \"\\n\"\n if @status\n _write @status, @status_fg, @status_bg\n @status_displayed = true\n end\n end", "title": "" }, { "docid": "091849174b278d966b0270944fbd071e", "score": "0.55492824", "text": "def clear_line\n puts \"\\e[0A\\e[0G\"\n end", "title": "" }, { "docid": "9d6aa7713a79030cd264d17548e6495b", "score": "0.55442613", "text": "def flush(&block)\n @logger.debug? && @logger.debug(\"Beats input, out of band call for flushing the content of this connection\",\n :peer => @connection.peer)\n\n @codec.flush(&block)\n end", "title": "" }, { "docid": "8df495c6acd6ee3e04c9b094341d5b8f", "score": "0.5532721", "text": "def flush\n #\n end", "title": "" }, { "docid": "a5bf766b71eba9b58812dbdea5f07860", "score": "0.5525281", "text": "def without_stdout_buffering\n sync, $stdout.sync = $stdout.sync, true\n yield\n ensure\n $stdout.sync = sync\n end", "title": "" }, { "docid": "64ecfa59be22ab857b548f30b9cff4fd", "score": "0.55180734", "text": "def clear_stdout!\n @stdout_handler.clear!\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "76c5026bf7a053411de6b3f988e8fa06", "score": "0.0", "text": "def java_jprogress_params\n params.require(:java_jprogress).permit(:heading, :ques, :ans, :point, :input, :output)\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": "" } ]
87118eaaf1e5f5ab8620d85d1a1e393f
Returns a cleaned array of keywords, free of duplicates and extraneous comma
[ { "docid": "69ab85e9415cb4d31496e4e8f2cfa117", "score": "0.7325189", "text": "def clean_keywords(input)\n keywords = input.split(',').map! { |i| i.chomp.strip.downcase }.compact.uniq.keep_if { |i| i != '' }\n if keywords.empty?\n nil\n else\n keywords.join(', ')\n end\n end", "title": "" } ]
[ { "docid": "a5827285f7fa2d7832f56f1a40e4cd55", "score": "0.6882025", "text": "def clean_array( keywords )\n keywords.map!{|keyword| keyword.downcase.strip}\n blacklist = %w{ 000 do we from as other like working web data and 00 to you your our on in the of for ru }\n\n keywords.each do |keyword|\n keywords.delete( keyword ) if keyword.empty?\n end\n\n keywords.each do |keyword|\n keywords.delete( keyword ) if keyword.numeric?\n end\n\n keywords.each do |keyword|\n ('a'..'z').to_a.each do |letter|\n keywords.delete( keyword ) if letter == keyword\n end\n end\n\n keywords.each do |keyword|\n blacklist.each do |badword|\n keywords.delete( keyword ) if keyword == badword\n end\n end\n\n keywords.each do |k|\n if k == \"12\"\n ap 'bingo=======================================' if k.numeric?\n end\n end\n\n return keywords \nend", "title": "" }, { "docid": "9206f34fbd2e0ad18cb168cbcc668dff", "score": "0.6800667", "text": "def keywords\n get_keywords.flatten.uniq\n end", "title": "" }, { "docid": "233b0f29018ba8242875999da93f88d0", "score": "0.66230583", "text": "def keywords\n self.to_s.downcase.split(SPLIT_REGEXP).uniq\n end", "title": "" }, { "docid": "e1a3cf67fdcdd8d3467c14f193e00229", "score": "0.6543932", "text": "def dull_keywords\n (@@dull_keywords ||= Defaults.dull_keywords).flatten.uniq\n end", "title": "" }, { "docid": "c921431f4c30517aade2e2ff6cea7981", "score": "0.6536122", "text": "def cleaned_tags\n @product.tags.split(',').reject{ |c| c.empty? or c == \" \" }.uniq.join(',')\n end", "title": "" }, { "docid": "84b942669b79e0ce8d1d716ee799e727", "score": "0.6396212", "text": "def extract_keywords\n self.keywords = Alice::Parser::NgramFactory.filtered_grams_from(self.text).flatten.uniq\n end", "title": "" }, { "docid": "cb907f4f69a1e33f25817a66d55741f5", "score": "0.6331432", "text": "def clean\n keylist = self.list.split(',')\n keylist.each { |i| i.strip! }\n keylist.sort! { |a,b| a.downcase <=> b.downcase }\n self.list = keylist.join(', ')\n end", "title": "" }, { "docid": "d5d19dd1634733e8cfdbc88bdd14ac71", "score": "0.6243566", "text": "def keyword_string\n keywords.pluck(:name, :synonyms).flatten.compact.uniq.join(', ')\n end", "title": "" }, { "docid": "fe6c3dbb4314aba7c443789f8c3cab30", "score": "0.61619544", "text": "def tags_array\n # http://stackoverflow.com/a/17641383/2080089\n return self.tags.split(',').uniq.map(&:strip)\n end", "title": "" }, { "docid": "1be947d341523c1cdf88d64dddbee2a3", "score": "0.61606824", "text": "def _search_text\n [_concatenated_brand,\n _concatenated_description,\n _concatenated_sell_unit,\n classic_mbid\n ].compact.map { |w| w.hanize.split(' ') }.flatten.uniq.reject { |w| w.size < 3 || self.class.stop_words.include?(w) }.join(' ')\nend", "title": "" }, { "docid": "3d623218afa9010ebcbc7f2b50a367b5", "score": "0.6127468", "text": "def create_keywords\n\n keywords = t(LOCALE_KEYWORDS_KEY, default: SiteMetaInfoDefaults.keywords)\n business_cats = BusinessCategory.pluck(:name).uniq\n\n cats_str = business_cats.empty? ? '' : ', ' + business_cats.join(', ')\n keywords + cats_str\n end", "title": "" }, { "docid": "ac56688202de60073cf77635430fdff9", "score": "0.60839456", "text": "def clean_facets_array(facets_array)\n Array(facets_array).map {|text| fix_subfield_demarcators(text) }.compact.uniq\n end", "title": "" }, { "docid": "5946e9404a4607ea685371d546bdea4c", "score": "0.60798776", "text": "def array_with_stopwords(txt)\n qa = self.query_wo_exact_phrases(txt).split\n qa.delete(',') #delete works on self (qa here), so won't work chained onto the statement above!\n qa\n end", "title": "" }, { "docid": "b377d1424c4ff65b16cb790cc0daa90d", "score": "0.6065971", "text": "def prepare_words(words)\n return [''] if words.blank?\n a = words.split(/[,\\s]/).map(&:strip)\n a.any? ? a : ['']\n end", "title": "" }, { "docid": "3ae517b0fc8413458ac27e7671b0cf6c", "score": "0.5965781", "text": "def set_keywords\n product_keywords ? product_keywords.join(', ') : ''\n end", "title": "" }, { "docid": "3ae517b0fc8413458ac27e7671b0cf6c", "score": "0.5965781", "text": "def set_keywords\n product_keywords ? product_keywords.join(', ') : ''\n end", "title": "" }, { "docid": "3ae517b0fc8413458ac27e7671b0cf6c", "score": "0.5965781", "text": "def set_keywords\n product_keywords ? product_keywords.join(', ') : ''\n end", "title": "" }, { "docid": "da466a0306a2412142a1dbb3b315e064", "score": "0.5925132", "text": "def meta_keywords\n keywords = [] # keywords = [\"one, two, three\"]\n if @category and [email protected]_record?\n keywords << [@category.title]\n end\n if @post and [email protected]_record?\n keywords << [@post.title, @post.subtitle]\n end\n keywords.join(\",\")\n end", "title": "" }, { "docid": "4317d37b843b7d6d0294dc5dc3e6a494", "score": "0.58925897", "text": "def keywords\n return nil unless @doc.keywords\n \n keywords = @doc.keywords[0..(NUM_KEYWORDS-1)].join(\", \")\n mark(keywords)\n end", "title": "" }, { "docid": "3bd8a5d464f8308a0b4cf19800cdd733", "score": "0.58850235", "text": "def fix_keywords\n @fix_keywords_cache ||= all_applicable_hooks.map do |hook|\n hook.keywords.map { |keyword| keyword.downcase.strip }\n end.flatten.uniq\n end", "title": "" }, { "docid": "96507a89415cfaa3efd597c5f0c18281", "score": "0.5877414", "text": "def set_keywords=(value)\n self.product_keywords = value ? value.split(',').map{|w| w.strip} : []\n end", "title": "" }, { "docid": "96507a89415cfaa3efd597c5f0c18281", "score": "0.5877414", "text": "def set_keywords=(value)\n self.product_keywords = value ? value.split(',').map{|w| w.strip} : []\n end", "title": "" }, { "docid": "96507a89415cfaa3efd597c5f0c18281", "score": "0.5877414", "text": "def set_keywords=(value)\n self.product_keywords = value ? value.split(',').map{|w| w.strip} : []\n end", "title": "" }, { "docid": "b0057ce5f367f51ee179eff39bc6e747", "score": "0.5840537", "text": "def filter(keywords)\n keywords.delete_if do |key, value|\n include?(key.downcase)\n end\n end", "title": "" }, { "docid": "81b758a2d7c49ba616012186dc7975e0", "score": "0.58313715", "text": "def all_words\n result = []\n tagged_words.each do |word|\n result << word[0] unless is_punctuation([ word[0], word[1] ])\n end\n result\n end", "title": "" }, { "docid": "7c5ff46c51fc5c0927402ee609e21c56", "score": "0.58266234", "text": "def meta_keywords(*args)\n if args.any?\n @meta_keywords = Array(args.first).join(\", \")\n else\n keywords = @meta_keywords\n keywords ||= @page.tag_list if @page&.tags&.any?\n strip_tags(keywords)\n end\n end", "title": "" }, { "docid": "2bfd5ae1c1a109f3e42caf9ae2ecfe58", "score": "0.5818521", "text": "def strip_keywords(overwrite=false, &block)\n return nil unless block_given?\n raise(InvalidDullKeywordsType, InvalidDullKeywordsType.message) unless block.call.is_a?(Array)\n \n overwrite ? @@dull_keywords = block.call : @@dull_keywords = (self.dull_keywords << block.call)\n self.dull_keywords\n end", "title": "" }, { "docid": "223efd321e4c0186966aa6dd660e45c0", "score": "0.57805824", "text": "def get_keywords\n titles.map do |title|\n title.split(\" \")\n end\n end", "title": "" }, { "docid": "a84db40a58d9ad5bd6b6a2665897e789", "score": "0.57504636", "text": "def tags(separator=\", \")\n self.keywords.try(:join, separator)\n end", "title": "" }, { "docid": "d4df75ef5ced2bc1670762bc7559f20f", "score": "0.5742333", "text": "def clean_tags(tags)\r\n tags = sanitize_fully(tags)\r\n if tags.match(/,/)\r\n tagslist = tags.split(/,/)\r\n else\r\n tagslist = [tags]\r\n end\r\n newlist = []\r\n tagslist.each do |tag|\r\n tag.gsub!(/[\\*\\<\\>]/, '')\r\n if tag.length > ArchiveConfig.TAG_MAX\r\n tag = tag[0..(ArchiveConfig.TAG_MAX-2)]\r\n end\r\n newlist << tag\r\n end\r\n return newlist.join(',')\r\n end", "title": "" }, { "docid": "bf3c4f3af25ebb49ec631a2ecbb8730e", "score": "0.5720796", "text": "def keywords\n read_attribute(:keywords).to_a.compact.map(&:downcase)\n end", "title": "" }, { "docid": "f7ab4aa92f04bb36a45a0771a4338f07", "score": "0.5719161", "text": "def replace_white_space keyword\n\tkeywords = []\n\tkeywords << keyword.gsub(' ', '+')\n\tkeywords << keyword.gsub(' ', '-')\n\tkeywords << keyword.gsub(' ', '_')\n\tkeywords << keyword.gsub(' ', '%20')\n\tkeywords << keyword.gsub(' ', '')\n\n\tkeywords\nend", "title": "" }, { "docid": "6ab9b8c329f6786ae491ee59f24f8395", "score": "0.57091606", "text": "def arr_word_list(pos)\n pos.flatten!\n pos.each{|e| e.strip!}\n str_res = pos.uniq.join(', ')\n return str_res\n end", "title": "" }, { "docid": "3262c0df0f1bf1fcdff48364882c9425", "score": "0.5694817", "text": "def keywords\n attr = [status, name, title_search, subject_list]\n attr.join(' ')\n end", "title": "" }, { "docid": "4e65beaa69625b5e8dd6a89939dc9f4b", "score": "0.56854707", "text": "def clean!\r\n reject!(&:blank?)\r\n map!(&:strip)\r\n uniq!\r\n end", "title": "" }, { "docid": "6b5160963ea15be56951c4e9ae8b525c", "score": "0.567987", "text": "def clean_array(ary)\n ary.compact.map(&:strip).reject(&:blank?).uniq\n end", "title": "" }, { "docid": "a26eeec85e791ec02c8aa1df4bcf10a9", "score": "0.563835", "text": "def strip_to_stems\n str = self.sanitize_tags\n terms_a = str.gsub(/[^a-z]+/u, ' ').strip.split(' ')\n terms = terms_a.reject do |term|\n ((term.length < 3 && !SHORT_WORDS.include?(term)) || term.length > 20)\n end\n terms.collect! {|term| term.stem}\n terms = terms.select {|term| term.length > 1}\n terms = terms - STOP_STEMS\n return terms.join(' ')\n end", "title": "" }, { "docid": "80507e2fd174c1d6a2feb9a408f9f77a", "score": "0.5630494", "text": "def clean!\n reject!(&:blank?)\n map!(&:strip)\n uniq!\n end", "title": "" }, { "docid": "f39ece4fd5a5c816b7d6975a922e86d1", "score": "0.5625729", "text": "def complete_keyword\n keywords = []\n definition.fields.each do|f|\n next unless f[1].complete_enabled\n if (f[1].key_field)\n keywords += complete_key(f[0], f[1], tokens.last)\n else\n keywords << f[0].to_s + ' '\n end\n end\n keywords.sort\n end", "title": "" }, { "docid": "cd9609710e7508e5fdd1fd31954814f0", "score": "0.5623745", "text": "def tag_keywords locale = :en\n tags.map do |t|\n t.try(\"keywords_#{locale}\")\n end.reject(&:blank?).uniq.join(', ')\n end", "title": "" }, { "docid": "29e0cf68dd2fb640ef76b6f68b5b25eb", "score": "0.55953234", "text": "def cleanup(results)\n results.map { |r| r.value.strip }.reject(&:empty?).uniq\n end", "title": "" }, { "docid": "29e0cf68dd2fb640ef76b6f68b5b25eb", "score": "0.55953234", "text": "def cleanup(results)\n results.map { |r| r.value.strip }.reject(&:empty?).uniq\n end", "title": "" }, { "docid": "06343c2ae385a8e01105cd81ded6205b", "score": "0.5571425", "text": "def get_meta_keywords(include_color, include_defaults)\n name = self.name_from_taxon\n name = \"\" if name.blank?\n loc = self.location\n loc = \"\" if location.blank?\n ptypes = self.product_types\n ptypes = \"\" if ptypes.blank?\n #abt = self.about\n #abt = \"\" if abt.blank?\n #name + \", \" + loc + \", \" + ptypes + \",\" + abt + \",\" + Spree::Config[:default_meta_keywords]\n name + \", \" + loc + \", \" + ptypes\n end", "title": "" }, { "docid": "25541554030ecaaad27b4b78fd063f32", "score": "0.5561923", "text": "def cleaned(txt)\n\t\ttxt.gsub(/[(,\\'.#)]/, '')\n\tend", "title": "" }, { "docid": "25541554030ecaaad27b4b78fd063f32", "score": "0.5561923", "text": "def cleaned(txt)\n\t\ttxt.gsub(/[(,\\'.#)]/, '')\n\tend", "title": "" }, { "docid": "c1ce49328e14df049936df69afc191a6", "score": "0.5554207", "text": "def keywords_subject\n key = @strip['keywords']\n if key.nil?\n @null\n else\n [@strip['subject'], key].join(',')\n end\n end", "title": "" }, { "docid": "50cfbc4f702856cbec34166291ca9c00", "score": "0.5554157", "text": "def simplify_tag_list(tag_list)\n tag_list&.delete_if { |t| t.empty? }&.join(\",\")\n end", "title": "" }, { "docid": "9d007c895cbc8a92416fa98402e95ddf", "score": "0.5499049", "text": "def get_ingredients \n # get rid of all characters that are not: a-z A-Z 0-9 - [] () . ' / , blank;\n clean_ingredients = self.ingredients.gsub(%r{[^a-zA-Z0-9\\-\\[\\]\\.\\,\\'\\(\\)\\/\\s]}, '')\n return clean_ingredients.split(', ').each { |ingredient| ingredient.strip! }\n end", "title": "" }, { "docid": "5ee59663a0ff8313c097eef565e023e1", "score": "0.5499", "text": "def strip_text_unique(passage)\n strip_text(passage).uniq#unique\nend", "title": "" }, { "docid": "f9e3eb90bbee374055937ea29bc3f9b2", "score": "0.54868704", "text": "def terms\n @data.map(&:uniq).flatten\n end", "title": "" }, { "docid": "8d5c1eb309e3687597c277eca0ab97c5", "score": "0.54775685", "text": "def tag_list\r\n clean_string(general_metadata_sheet[*WBF[:meta_projects_pos]])\r\n end", "title": "" }, { "docid": "bd1ee8d0d3e8124083cef4070cd7946d", "score": "0.54718333", "text": "def ref_keywords\n unless @ref_keywords_cache\n @ref_keywords_cache = Setting.commit_ref_keywords.downcase.split(',').collect(&:strip)\n @ref_keywords_cache.delete('*')\n end\n @ref_keywords_cache\n end", "title": "" }, { "docid": "c3bbc1754f844a8b488fbf5e9f8141e6", "score": "0.54621446", "text": "def all_excluded_words\n (excluded_words + (lazy? ? LAZY_WORDS : [])).map(&:downcase)\n end", "title": "" }, { "docid": "4265a85f417b3c8c14b4a3b7e1f3d1bb", "score": "0.54561216", "text": "def decommafy\n gsub(/(.+), (.+)/) { |s| \"#{$2} #{$1}\" }.strip.squeeze(' ')\n end", "title": "" }, { "docid": "b25f870b7da373138bc31089cbce0f41", "score": "0.5455248", "text": "def keywords\n keywords = []\n metadata[dataset_uri][dcat.keyword.to_s].each do |k|\n keywords << k\n end\n rescue\n []\n end", "title": "" }, { "docid": "aa637a824056738aabcd50aec0cf762d", "score": "0.5446255", "text": "def search_values_without_quotes_and_filters\n search_string.gsub(Regexp.union(FILTER_WORD_REGEX, REGEX_WORD_IN_QUOTES), '').split(' ')\n end", "title": "" }, { "docid": "4b54a9125557f03879c9cfc868dbe5ec", "score": "0.5430174", "text": "def keywords_for_index(_item)\n []\n end", "title": "" }, { "docid": "cf0754ca0212a201726c67d3d4dd9ffe", "score": "0.54258853", "text": "def formatted_keyword_args(keyword_args)\n keyword_args.map { |key, value| \"#{key}: #{value.inspect}\" }.join(\", \")\n end", "title": "" }, { "docid": "af19afdf0ffc8055e1fa00303b313677", "score": "0.54246897", "text": "def build_keyword_list(s, heading)\n \n a = s.split.uniq.flat_map do |raw_word|\n\n i, pos = 0, []\n\n w = raw_word[/\\w{2,}/]\n \n next if IGNOREWORDS.include? w\n next unless w\n\n (pos << (s[i..-1] =~ /#{w}/i); i += pos[-1] + 1) while s[i..-1][/#{w}/i]\n\n pos[1..-1].inject([pos[0]]) {|r,x| r << r.last + x + 1 }\n\n pos.map do |x| \n \n start = x-15\n start = 0 if start < 0\n snippet = make_snippet(s, start)\n \n \"[%s] %s | %s %s\" % [heading, snippet, w.downcase, \n heading.scan(/\\w+/).join(' ').downcase]\n end\n\n\n end\n \n a\n \n end", "title": "" }, { "docid": "35928e54d083840e9a30d0d884677091", "score": "0.5410384", "text": "def keywords\n @key_array = []\n @hash.each {|key,value| @key_array.push(key)} #push key inside key_array\n return @key_array.sort\n end", "title": "" }, { "docid": "f99a616e8e84ac80c5c0c53cf3e540d2", "score": "0.54027236", "text": "def terms\n @data.flatten.uniq\n end", "title": "" }, { "docid": "34c1bf7da0d73e66635a683d92b7bfbb", "score": "0.5384632", "text": "def filter_term_list(term_list)\n (term_list.map(&:downcase) - IGNORED_WORDS).reject { |t| t.size < 3 }\n end", "title": "" }, { "docid": "417f0b2c80d631d414ff951941adde93", "score": "0.5375624", "text": "def meta_keywords\n keywords = [\"coin collecting, coin collecting software, free coin collecting software, coins, usa coins, us coins, coin photos\"]\n if @coin and [email protected]_record?\n keywords << [@coin.meta_keywords]\n end\n raw keywords.join(\",\")\n end", "title": "" }, { "docid": "076ad1744280259c1807a8a73d62588b", "score": "0.53590286", "text": "def parse(list)\n list.gsub(/[^\\w\\ ,]+/, '').squeeze(\" \").downcase.split(\",\").map(&:strip).reject { |s| s.blank? }.uniq\n end", "title": "" }, { "docid": "b034bebc84b37fc6b7d70a05319cce37", "score": "0.5356351", "text": "def keywords\n @entries.keys.sort # sorts keys to alphabetical \n end", "title": "" }, { "docid": "504c5d60600a9a801bf2f219d2bdffc6", "score": "0.5348715", "text": "def one_word_names(values)\n one_word_names = values.map {|names| names}\n one_word_names.delete_if{|names| names[1].include?\" \"}\n one_word_names.each {|info| puts info.to_s}\nend", "title": "" }, { "docid": "e31175c860f046ccd41063831fc6d956", "score": "0.53465456", "text": "def sanitize_and_merge_order(*orders)\n orders = orders.reject(&:blank?).map do |order|\n order.strip!\n order = order.last == ',' ? order.chop : order\n end\n orders = orders.reject(&:blank?)\n orders.empty? ? nil : orders.join(\", \")\n end", "title": "" }, { "docid": "d83a661009c008fad226821a89be59f8", "score": "0.5338461", "text": "def removeQuotesAndPunc sentence\n\t\tquotes = [\"\\\"\",\"'\",\":\",\",\",\".\",\"(\",\")\",\";\",\"!\",\"&\",\"<\",\">\",\"?\",\"-\",\"_\"]\n\t\twords = sentence.split(' ')\n\t\twords.map! do |w|\n\t\t\tw.slice!(1) if quotes.include?(w[0])\n\t\t\tw.slice(-1) if quotes.include?(w[-1])\n\t\t\tw\n\t\tend\n\t\treturn words.join(' ')\n\tend", "title": "" }, { "docid": "31f4b8d9e579326413fbbab0d3cb346c", "score": "0.533421", "text": "def tags\n records.each do |record|\n KEYWORDS_TAGGER.each do |name, keywords|\n record[name] = keywords.find {|keyword| record[:text].include?(keyword) }\n end\n end\n end", "title": "" }, { "docid": "cca206284072f767eb90aed60f828aef", "score": "0.5316841", "text": "def keywords\r\n @@words.keys.sort\r\nend", "title": "" }, { "docid": "4ebc1886f5db597917fedb92c36d5202", "score": "0.5316236", "text": "def tokenize(s)\nterms = s.gsub(/(\\s|\\d|\\W)+/u,' ').rstrip.strip.downcase.split(' ')\nterms.reject!{|term| @@stop_words.include?(term) || term.length < 3}\nterms\nend", "title": "" }, { "docid": "908ec6749f5f4ee89114e04e9074373e", "score": "0.5296802", "text": "def gowords_array(txt)\n self.gowords ||= self.array_with_stopwords(txt).map do |token|\n cleaned_token = self.clean_token(token)\n self.stopwords.include?(cleaned_token) ? nil : cleaned_token.blank? ? nil : token\n end.compact\n end", "title": "" }, { "docid": "f0bdd8779c55beda8069fd54a79a9ed1", "score": "0.52922934", "text": "def keyword_query_string\n processed_terms = []\n self.search_terms.each do |search_val|\n # spaces or dashes (-) need to be quoted to be treated as single values\n term = search_val.match?(/[\\s-]/) ? \"\\\"#{search_val}\\\"\" : search_val\n processed_terms << term\n end\n processed_terms.join(' ')\n end", "title": "" }, { "docid": "7929c6e24268c7da2fc0bc3139953996", "score": "0.52913123", "text": "def unique_words(text)\n split_normalise(text).uniq\nend", "title": "" }, { "docid": "f80857d386d167c2e708396a90d6d5d6", "score": "0.5289622", "text": "def remove_affects_with_keywords(keywords)\n keywords\n list = @affects.select{ |a| a.fuzzy_match( keywords ) }\n list.each do |affect|\n affect.clear(false)\n end\n return\n end", "title": "" }, { "docid": "5f3a205924b5e49863232582356973e9", "score": "0.5278402", "text": "def email_parser(str) \n str.gsub(/, /,\" \").gsub(/,/,\" \").split.uniq\nend", "title": "" }, { "docid": "54c497b85af009aeb514f62140984a8c", "score": "0.52705073", "text": "def extract_all_words(html)\n doc = Nokogiri::HTML(html)\n keywords = []\n doc.css(\"meta[name='keywords']\").each do |node|\n keywords += node['content'].gsub(/\\s+/, \" \").gsub(/[^a-zA-Z\\- ',]/, '').squeeze(\" \").split(\",\")\n end\n text = String.new\n doc.css(\"meta[name='description']\").each do |node|\n text += node['content']\n end\n \n %w(script style link meta).each do |tag|\n doc.css(tag).each { |node| node.remove }\n end\n\n w = []\n doc.traverse do |node|\n if node.text? then\n w << node.content + \" \"\n end\n end\n text += w.join.gsub(/\\s+/, \" \").gsub(/[^a-zA-Z\\- ']/, '').squeeze(\" \")\n words = (text.downcase.split - STOPWORDS)\n \n final = (keywords + words)\n final.map do |w|\n w.stem\n end\n end", "title": "" }, { "docid": "79a29ba0242edde595710113aa88d931", "score": "0.52678174", "text": "def all_tag_names(fields)\n fields.flat_map do |field|\n next if options[field].blank?\n options[field].split(\",\").map(&:squish)\n end.reject(&:blank?).uniq\n end", "title": "" }, { "docid": "791698ada49602dab581ced814795f3c", "score": "0.52672625", "text": "def get_keywords( descriptions )\n keywords = []\n descriptions.each do |description|\n page_text = Nokogiri::HTML(description).text\n keywords.concat( page_text.split(/\\W+/) )\n end\n\n return keywords\nend", "title": "" }, { "docid": "15845f12a449fab0d0c3aa994ea44892", "score": "0.5257144", "text": "def split_strip_compact_array(values_str_array, delimiter = \",\")\n return [] if not values_str_array\n values_str_array.inject([]) {|s,x| s + split_strip_compact(x, delimiter)}\nend", "title": "" }, { "docid": "c97a2d71ed14719a3b8b9eb072367df9", "score": "0.52562344", "text": "def for_commas\n each_line! do |line| \n begin\n line.gsub! /,(\\S)/, ', \\1' unless line.match /.*\\\".*,.*\\\".*/ or line.match /','/\n rescue Exception => e\n puts e.message + \", ignored.\"\n end\n end\n end", "title": "" }, { "docid": "1150870ad37c7923948d5b29c1bcd243", "score": "0.5254954", "text": "def convert feature\n Parser::KEYWORDS.each_with_index.map do |keyword, i|\n feature[i] ? keyword : nil\n end.compact.join(\" \")\n end", "title": "" }, { "docid": "b8981fb8e091049e941188d2470038a2", "score": "0.52496904", "text": "def get_search_terms(array_of_terms)\n\t\treturn \"q=\"+array_of_terms.join(\"+\")\n\tend", "title": "" }, { "docid": "c2de68ef7ab9e686afdd6a9ba6ae43d9", "score": "0.52448034", "text": "def yummy(foods)\n delicious_foods = []\n foods.each do |key,value| \n if value == \"delicious\"\n delicious_foods << key\n else \n foods.delete(key)\n end\n end\n the_good_food = delicious_foods.join(\", \")\nend", "title": "" }, { "docid": "849a3f2c7eb4dff579691800f9e6eae1", "score": "0.52353853", "text": "def tag(tags = self.tags)\n tags.to_s.split(/\\s*,\\s*/).uniq\n end", "title": "" }, { "docid": "a8c9341898331bf2d6f843ce50bdc116", "score": "0.52271336", "text": "def keywords\n @emphasis[:stemming] = use_stemming?\n\n keywords = Keywords.new\n\n Keywords.find_keywords(processed_content, wordlist, word_pattern).each do |text|\n text = text.to_s\n text = text.stem if @emphasis[:stemming]\n\n if not (text.match(/^[\\d]+(\\.[\\d]+){0,1}$/) or text.length <= 2)\n keywords << Highscore::Keyword.new(text, weight(text))\n elsif allow_short_words\n keywords << Highscore::Keyword.new(text, weight(text))\n end\n end\n\n keywords\n end", "title": "" }, { "docid": "d71e4349d1e81857038438b37e063830", "score": "0.52268505", "text": "def find_not_uniq_words(in_array)\n all_words = []\n counter = {}\n result = []\n in_array.compact.each do |url_desc_cont|\n next unless url_desc_cont[1][0]\n url_desc_cont[1][0].scan(/\\w+/).each do |word|\n all_words << word\n end\n end\n all_words.each do |word|\n if counter[word]\n counter[word] += 1\n else\n counter[word] = 1\n end\n end\n counter.each_pair do |word, number|\n result << word if number > 1\n end\n result.uniq\n end", "title": "" }, { "docid": "b11368e0b718700f5756afce7eaebc39", "score": "0.52254605", "text": "def get_keywords\r\n\t@keywords = Keyword.all\r\n\[email protected]! { |a, b| a.name <=> b.name }\r\n end", "title": "" }, { "docid": "b63c7f686d9cb393c32361c3d8b10da9", "score": "0.52161133", "text": "def build_tags(tags, category)\n \t\ttags = tags.split(',').map{ |tag| tag.strip } << category\n \t\ttags.flatten\n \tend", "title": "" }, { "docid": "01efaa25fdb6a27bdf28ec6d99983b47", "score": "0.5212792", "text": "def tags\n entries = Entry.all\n # Create a list of all the tags, as a String\n tags_list = String.new\n entries.each do |entry|\n tags_list << entry.tags + \" \"\n end\n # Convert the String to a global array, removing the duplicate elements\n $tags_array = tags_list.split.uniq\n end", "title": "" }, { "docid": "08cdb36fb43c4ce8e78b7afcb016447a", "score": "0.5206335", "text": "def neat_genres\n genres.split(',').delete_if { |word| word.eql?(\"\") || word.eql?(\" \") }.join(', ')\n end", "title": "" }, { "docid": "e97bf7ea88c9befeefe315dcf70db12f", "score": "0.5197356", "text": "def all_tags=(keywords)\n self.tags = keywords.split(',').map do |keyword|\n Tag.where(keyword: keyword.strip).first_or_create!\n end\n end", "title": "" }, { "docid": "9d2b3d1a34b90ca393c32f40244f7269", "score": "0.5194614", "text": "def clean_all\n [@vc_primary, @vc_complement, @hc_between_strands].collect { |a| a.delete(nil); a.uniq!; a.sort! }\n end", "title": "" }, { "docid": "7b9b512a39db40016222624c296ceb37", "score": "0.518372", "text": "def data_cleansing(data)\n # Removes extra spaces, commas, dollar sign etc.\n data = data.strip.split('')\n (data - [',', '%', ' ', '$']).join\nend", "title": "" }, { "docid": "ff7a9db2437cd744ef5660427d15e5eb", "score": "0.51831824", "text": "def all_tags\n tags.map(&:title).join(\", \")\n end", "title": "" }, { "docid": "d71ca6ff840228e4de49631a665eac57", "score": "0.5181453", "text": "def prep_text_for_match_query(text,exclude_dblquote=false,remove_weak_terms=true)\r\n result = text.dup\r\n result.downcase! # downcase for stop_words removal\r\n result.gsub!(\"'s\",'')\r\n remove_punctuation_proper!(result,exclude_dblquote)\r\n # result.gsub!(/([^\\s]+)/) { |word|\r\n # weak_term?(word) ? '' : word\r\n # } if remove_weak_terms\r\n # result\r\n # #!? check terms as adverbs?\r\n words = result.split(/\\W/)\r\n if remove_weak_terms\r\n words = words.select {|w| !weak_term?(w) }\r\n end\r\n words.compact!\r\n words.join(\" \")\r\n end", "title": "" }, { "docid": "c3e5f5da4ab03f0ed93fae5dc89bbf58", "score": "0.5181317", "text": "def delete_special_chars(entries)\n entries.each { |entry|\n entry.delete(\"(),\")\n }\n return entries\n end", "title": "" }, { "docid": "8c8c45ac6a06aeb0fa2b1eba433127a2", "score": "0.51728916", "text": "def remove_stopwords(ary)\n @filter.filter(ary)\n end", "title": "" }, { "docid": "6040e7892407321280df19f1f7aadb14", "score": "0.51722175", "text": "def cleanup_image_tags\n self.tags = self.tags.strip\n unless self.tags.empty?\n tags = self.tags.split(\",\")\n tags_new = []\n tags.each do |item|\n tags_new.push(item.strip)\n end\n self.tags = tags_new.join(\",\")\n end\n end", "title": "" }, { "docid": "782d6125db74923640b2c23851662f5e", "score": "0.5171215", "text": "def unique_words(text)\n normalize(text).uniq\nend", "title": "" } ]
e1e32076c5561859bdc80145ecf3642c
DELETE /artist_people/1 DELETE /artist_people/1.json
[ { "docid": "13570fa391d81bcfb5d4ef483455164e", "score": "0.77256036", "text": "def destroy\n @artist_person = ArtistPerson.find(params[:id])\n @artist_person.destroy\n\n respond_to do |format|\n format.html { redirect_to artist_people_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "3722dbf1b3c8421b2f862ac260c782b0", "score": "0.746652", "text": "def destroy\n @artist = Artist.find(params[:id])\n @aliases = \n @artist.destroy\n\n respond_to do |format|\n format.html { redirect_to artists_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "66267315b911504f1eba438869774133", "score": "0.74552864", "text": "def destroy\n @artist.destroy\n\n respond_to do |format|\n format.html { redirect_to(artists_url) }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "c84ab64a55a242dbacf3aa7e35a16196", "score": "0.74472314", "text": "def destroy\n @artist.destroy\n respond_to do |format|\n format.html { redirect_to artists_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8f1c8e7c0e860e892949020c306c3e8e", "score": "0.7445169", "text": "def destroy\n # @artist = Artist.find(params[:id])\n @artist.destroy\n\n respond_to do |format|\n format.html { redirect_to artists_url, notice: 'Artist was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8d9127d11f6185db53392c3fda049a18", "score": "0.7438099", "text": "def destroy\n @artist = Artist.find(params[:id])\n @artist.destroy\n\n respond_to do |format|\n format.html { redirect_to artists_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8d9127d11f6185db53392c3fda049a18", "score": "0.7438099", "text": "def destroy\n @artist = Artist.find(params[:id])\n @artist.destroy\n\n respond_to do |format|\n format.html { redirect_to artists_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8d9127d11f6185db53392c3fda049a18", "score": "0.7438099", "text": "def destroy\n @artist = Artist.find(params[:id])\n @artist.destroy\n\n respond_to do |format|\n format.html { redirect_to artists_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "05a8f894ed5f52753434f1cddc1b7dda", "score": "0.7409157", "text": "def destroy\n @artist.destroy\n respond_to do |format|\n format.html { redirect_to artists_url }\n format.json { render json: { status: 200 } }\n end\n end", "title": "" }, { "docid": "41ad7a74b411ceccbcae6bcf5fa4e33d", "score": "0.7406395", "text": "def destroy\n @artist = @current_account.artists.find(params[:id])\n @artist.destroy\n\n respond_to do |format|\n format.html { redirect_to artists_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bfb279e91e40e12739897fd437464531", "score": "0.7395723", "text": "def destroy\n @artist = Artist.find(params[:id])\n @artist.destroy\n\n respond_to do |format|\n format.html { redirect_to gigs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c5c82c179914eaca5c65eb2423a67cc0", "score": "0.7343004", "text": "def destroy\n @artist = Artist.find(params[:id])\n similar_artists = SimilarArtist.where(artist_id: params[:id])\n similar_artists.destroy_all\n @artist.destroy\n\n respond_to do |format|\n format.html { redirect_to artists_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "481a1ea52012120f429ba054f025fb67", "score": "0.73387367", "text": "def destroy\n @artist = Artist.find(params[:id])\n @artist.units.clear\n @artist.aliases.clear\n @artist.destroy\n\n respond_to do |format|\n format.html { redirect_to artists_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "66a40ba98c877ab0a1539991e57a4f7e", "score": "0.728058", "text": "def destroy\n @artist.destroy\n respond_to do |format|\n format.html { redirect_to artists_url, notice: 'Artist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "66a40ba98c877ab0a1539991e57a4f7e", "score": "0.728058", "text": "def destroy\n @artist.destroy\n respond_to do |format|\n format.html { redirect_to artists_url, notice: 'Artist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "66a40ba98c877ab0a1539991e57a4f7e", "score": "0.728058", "text": "def destroy\n @artist.destroy\n respond_to do |format|\n format.html { redirect_to artists_url, notice: 'Artist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "66a40ba98c877ab0a1539991e57a4f7e", "score": "0.728058", "text": "def destroy\n @artist.destroy\n respond_to do |format|\n format.html { redirect_to artists_url, notice: 'Artist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "66a40ba98c877ab0a1539991e57a4f7e", "score": "0.728058", "text": "def destroy\n @artist.destroy\n respond_to do |format|\n format.html { redirect_to artists_url, notice: 'Artist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "66a40ba98c877ab0a1539991e57a4f7e", "score": "0.728058", "text": "def destroy\n @artist.destroy\n respond_to do |format|\n format.html { redirect_to artists_url, notice: 'Artist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "66a40ba98c877ab0a1539991e57a4f7e", "score": "0.728058", "text": "def destroy\n @artist.destroy\n respond_to do |format|\n format.html { redirect_to artists_url, notice: 'Artist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6d8354d247e5a62d6f765cda32738721", "score": "0.7278393", "text": "def destroy\n @artist.destroy\n respond_to do |format|\n format.html { redirect_to artists_url, notice: \"Artist was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b2324b92a0baf7ebbbb8782d97ca4279", "score": "0.7259022", "text": "def destroy\n @artist.destroy\n respond_to do |format|\n format.html { redirect_to artists_url, notice: 'artist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2fd6e8d341cfd751fa7f4abec4974f78", "score": "0.72410274", "text": "def destroy\n authorize @artist\n artist_strong_delete(@artist, params[:delete_associated_tracks]==\"true\")\n\n head :no_content\n end", "title": "" }, { "docid": "fd20a008f4b1b01030308d915fbb6786", "score": "0.7196568", "text": "def destroy\n @similar_artist = SimilarArtist.find(params[:id])\n @similar_artist.destroy\n\n respond_to do |format|\n format.html { redirect_to similar_artists_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "0b7805290b76423d327e15ddf2d75ecc", "score": "0.7192968", "text": "def destroy\n @artist.destroy\n respond_to do |format|\n format.html { redirect_to artists_url, notice: 'Artist was successfully destroyed.' }\n format.json { head :no_content }\n end\nend", "title": "" }, { "docid": "6318f597033423297aa7d77e7aa40300", "score": "0.7185377", "text": "def destroy\n @artist.destroy\n\n respond_to do |format|\n format.html { redirect_to artists_url, notice: 'Artist was successfully destroyed.' }\n format.json { head :no_content }\n format.xml { head :no_content }\n end\n end", "title": "" }, { "docid": "b19b85abc4efc7f3f62aea9301cc29e1", "score": "0.716793", "text": "def destroy\n artist.destroy\n respond_to do |format|\n format.html { redirect_to artists_url, notice: 'User was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "db41f1b9a859fa397b5a4886b92c87cd", "score": "0.71476597", "text": "def destroy\n @artist_belong_to.destroy\n respond_to do |format|\n format.html { redirect_to artist_belong_tos_url, notice: 'Artist belong to was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4bf4a97d2f69a68f20f5f40433938814", "score": "0.71058476", "text": "def destroy\n @artist = Artist.find(params[:id])\n @artist.destroy\n\n respond_to do |format|\n format.html { redirect_to(artists_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "4bf4a97d2f69a68f20f5f40433938814", "score": "0.71058476", "text": "def destroy\n @artist = Artist.find(params[:id])\n @artist.destroy\n\n respond_to do |format|\n format.html { redirect_to(artists_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "48b556d1889d8b061f00b24521afee22", "score": "0.71029437", "text": "def destroy\n\t\[email protected]\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to artists_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "title": "" }, { "docid": "5eccf25a64b5f8a7af8eba24b032e692", "score": "0.71000123", "text": "def destroy\n @artist_photo = ArtistPhoto.find_by_urlname(params[:id])\n @artist_photo.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/artists/#{@artist_photo.artist_id}\") }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "684e986d3951a2bcc5b3fb8715709c2c", "score": "0.70669216", "text": "def destroy\n @artist = Artist.find(params[:id])\n @artist.destroy\n\n respond_to do |format|\n format.html { redirect_to(artists_url) }\n # format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "fd7d56763b620be495ffe40656acf9f0", "score": "0.6995772", "text": "def destroy\n @admin_artist.destroy\n respond_to do |format|\n format.html { redirect_to admin_artists_url, notice: 'Artist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e890574a1ed8ffba4933f0a73fb798cb", "score": "0.6986931", "text": "def destroy\n @artist_profile.destroy\n respond_to do |format|\n format.html { redirect_to \"/admin/artists\", notice: 'Artist profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5e83014f76c85c316dbc1ea5b9333aee", "score": "0.6986269", "text": "def destroy\n @artist_fact = ArtistFact.find(params[:id])\n @artist_fact.destroy\n\n respond_to do |format|\n format.html { redirect_to artist_facts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2e94e6b58546feaaed5b5349a5a32a30", "score": "0.69826066", "text": "def destroy\n @artistum = Artistum.find(params[:id])\n @artistum.destroy\n respond_to do |format|\n format.html { redirect_to artista_url, notice: 'Artistum was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7d61a69dd978c863b8d933a77c2a1617", "score": "0.6976166", "text": "def destroy\n @artist_referred_by = ArtistReferredBy.find(params[:id])\n @artist_referred_by.destroy\n\n respond_to do |format|\n format.html { redirect_to artist_referred_bies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e9201db3ec7d3fed24742f717e129d42", "score": "0.6973066", "text": "def destroy\n @artist.destroy\n respond_to do |format|\n format.html { redirect_to artists_url, notice: 'artist was successfully destroyed.' }\n end\n end", "title": "" }, { "docid": "8e8be3d55c67834e0bd307d19291122a", "score": "0.6958926", "text": "def destroy\n @artist.destroy\n respond_to do |format|\n format.html { redirect_to artists_url, notice: 'Artist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "74da45c32b79f07e12941ae9b3e294a5", "score": "0.69436586", "text": "def destroy\n @quantone_artist.destroy\n respond_to do |format|\n format.html { redirect_to quantone_artists_url, notice: 'Quantone artist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f60c212ea68d2f0aeaabad84a0bfd787", "score": "0.69338363", "text": "def destroy\n @artist = Artist.find(params[:id])\n @artist.destroy\n redirect_to artists_url\n end", "title": "" }, { "docid": "084c814a58eb72d4c6f127cadcc263eb", "score": "0.69127756", "text": "def destroy\n @artist.destroy\n redirect_to artists_url, notice: 'Artist deleted.'\n end", "title": "" }, { "docid": "8f314271b6ddc87eeeea2ba210ec49d1", "score": "0.69095945", "text": "def delete\n render json: Person.delete(params[\"id\"])\n end", "title": "" }, { "docid": "6d9947dc9c3baff780c0fb848175f873", "score": "0.6883835", "text": "def remove\n @favorite_artist = FavoriteArtist.find(artist_id: params[:favorite_artist][:artist_id])\n @favorite_artist.destroy\n respond_to do |format|\n format.html { redirect_to favorite_artists_url, notice: 'Favorite artist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2feb7f4f816ed025bfc705a48ce7a2d1", "score": "0.68833745", "text": "def destroy\n @seeartist.destroy\n respond_to do |format|\n format.html { redirect_to seeartists_url, notice: 'Seeartist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2feb7f4f816ed025bfc705a48ce7a2d1", "score": "0.68833745", "text": "def destroy\n @seeartist.destroy\n respond_to do |format|\n format.html { redirect_to seeartists_url, notice: 'Seeartist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "98299635220f6cb489e1e1b84d5bb0de", "score": "0.68821454", "text": "def destroy\n @artist_profile.destroy\n respond_to do |format|\n format.html { redirect_to artist_profiles_url, notice: 'Artist profile was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c15e9e836c28e5a6184b69a0ba5abaa3", "score": "0.68782556", "text": "def destroy\n Artist.destroy params[:id]\n redirect_to artists_path\nend", "title": "" }, { "docid": "59504a18ea8da7a11fb0ec2bc43f33c3", "score": "0.68762153", "text": "def destroy\n @spotify_artist = SpotifyArtist.find(params[:id])\n @spotify_artist.destroy\n\n respond_to do |format|\n format.html { redirect_to(spotify_artists_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8fb43c48c64571b075fcc5ac72508c64", "score": "0.6865935", "text": "def destroy\n photo = Photo.find(params[:id])\n @artist = photo.artist\n photo.destroy\n redirect_to edit_artist_path(@artist), notice: \"Photo successfully removed\"\nend", "title": "" }, { "docid": "ab10cf6fcc01d0aacff6f20baef99551", "score": "0.68644965", "text": "def destroy\n @artist_song.destroy\n respond_to do |format|\n format.html { redirect_to artist_songs_url, notice: 'Artist song was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c1aa2b3a2818c528c97a89c8083a8884", "score": "0.6851428", "text": "def destroy\n Artist.destroy params[:id]\n\n redirect_to artists_path\nend", "title": "" }, { "docid": "760e3c46656273797fe649eb749cb8f0", "score": "0.68500984", "text": "def destroy\n json_destroy(genre)\n end", "title": "" }, { "docid": "0972030d6774f4d0c6d25517f7ec444e", "score": "0.6830382", "text": "def destroy\n @artist_expertise.destroy\n respond_to do |format|\n format.html { redirect_to artist_expertises_url, notice: 'Artist expertise was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "421282dd88c8546dca1c5584abb8c5d0", "score": "0.6824586", "text": "def destroy\n @favorite_artist.destroy\n respond_to do |format|\n format.html { redirect_to favorite_artists_url, notice: 'Favorite artist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4ecc8b7fa10f6c1ab7c1846e4b8b0453", "score": "0.67959726", "text": "def destroy\n @artista = Artista.find(params[:id])\n \n # Borrar los eventos asociados\n @artista.eventos.each do |e|\n e.destroy\n end\n \n @artista.destroy\n\n respond_to do |format|\n format.html { redirect_to artistas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "484d67412f8b3f2f51aebd9776afeb57", "score": "0.6789141", "text": "def destroy\n @artistupload.destroy\n respond_to do |format|\n format.html { redirect_to artistuploads_url, notice: 'Artistupload was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "51c4ece1da83f14395ccea5617c5daef", "score": "0.678542", "text": "def destroy\n Artist.destroy(params[:id])\n end", "title": "" }, { "docid": "7452c4d15daf08108aaa5a1b728adb31", "score": "0.67699957", "text": "def destroy\n @json.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "7391ae1b79cd4531d2e40d19a04913bd", "score": "0.67691225", "text": "def destroy\n @albumthree.destroy\n respond_to do |format|\n format.html { redirect_to albumthrees_url, notice: 'Albumthree was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c8ad2c9ade18f1985ab64898f60590f2", "score": "0.6763622", "text": "def destroy\n @featured_artist.destroy\n respond_to do |format|\n format.html { redirect_to featured_artists_url, notice: 'Featured artist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e54520bec8dbb69611f4307f2f41f68c", "score": "0.6762235", "text": "def delete_follow(options={})\n delete(\"1/follows\", options, :format => :json, :phoenix => true)\n end", "title": "" }, { "docid": "d62c1b5371cd83c186782dd01bfabdeb", "score": "0.67592305", "text": "def delete\n @@all_artists.delete(@id)\n end", "title": "" }, { "docid": "583dbc2bbd3627eca7f1d1dc2b425f7a", "score": "0.6759097", "text": "def delete()\n\n sql = \"DELETE FROM artists WHERE id = $1 \"\n\n values = [@id]\n\n results = SqlRunner.run(sql, values)\n end", "title": "" }, { "docid": "6477ccdd7dafa8988dfcef4ebfa2f899", "score": "0.67568624", "text": "def destroy\n @artist_call = ArtistCall.find(params[:id])\n @artist_call.destroy\n\n respond_to do |format|\n format.html { redirect_to artist_calls_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fe13cb071154c89276b6a864fd541fb9", "score": "0.67538166", "text": "def delete()\n sql = \"DELETE FROM artists WHERE id = $1\"\n values = [@id]\n SqlRunner.run(sql, values)\n end", "title": "" }, { "docid": "fd081018bea51aa2a57aa5f725c2525b", "score": "0.67392725", "text": "def delete()\n sql = \"DELETE FROM artists\n WHERE id = $1\"\n values = [@id]\n SqlRunner.run( sql, values )\n end", "title": "" }, { "docid": "f9e44df35ccc119de4439eae5bcac1db", "score": "0.67277145", "text": "def destroy\n @artist_movie.destroy\n respond_to do |format|\n format.html { redirect_to artist_movies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cad00d2bd955eceaaebe6046eb086ad4", "score": "0.6727311", "text": "def destroy\n artist = @cd.artist\n @cd.destroy\n respond_to do |format|\n format.html { redirect_to artist_cds_url(artist), notice: 'Cd was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "982112a708a0bd995af0b8dc49439ae7", "score": "0.67239845", "text": "def destroy\n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :no_content }\n end\n\n \n end", "title": "" }, { "docid": "597de0b9343d4eb4309aaa10e7db4f9f", "score": "0.6719824", "text": "def destroy\n @freelancer_artist_profile.destroy\n respond_to do |format|\n format.html { redirect_to freelancer_artist_profiles_url, notice: \"Freelancer artist profile was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fb77c547fc3a02e9efebe4b7839b39db", "score": "0.67191935", "text": "def destroy\n @animal.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6bcd60befc74c516809ac4b2042c5ec9", "score": "0.6714541", "text": "def destroy\n artwork = Artwork.find(params[:id])\n artwork.destroy\n render json: artwork\n end", "title": "" }, { "docid": "959ca8ba1f1bfba8b945ade6d3a45746", "score": "0.6712501", "text": "def destroy\n @onion.destroy\n respond_to do |format|\n format.html { redirect_to onions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bd7c83cca6f60070f5d2a33b5cb83741", "score": "0.67068267", "text": "def destroy\n if signed_in? && is_dba?\n @artist = Artist.find(params[:id])\n @artist.destroy\n\n respond_to do |format|\n format.html { redirect_to artists_url }\n format.json { head :no_content }\n end\n else\n not_dba_flash\n end\n end", "title": "" }, { "docid": "d35f8ffd77ddd63899a2a6a17bde9c40", "score": "0.6706341", "text": "def destroy\n @amnesty = Amnesty.find(params[:id])\n @amnesty.destroy\n\n respond_to do |format|\n format.html { redirect_to amnesties_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1216df6a60f1c146fa7372c67537e4ff", "score": "0.6704021", "text": "def destroy\n Person.destroy(params[:id])\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bb0d55c72b7b4da46f1ac59151e146de", "score": "0.67019933", "text": "def destroy\n @artist = Artist.find(params[:id])\n @artist.destroy\n\n respond_to do |format|\n flash[:notice] = \"Artist '#{@artist.name}' was destroyed.\"\n format.html { redirect_to artists_url }\n format.xml { head :ok }\n format.js # destroy.rjs\n end\n end", "title": "" }, { "docid": "54d4276ffa0b6d0d2b8be39af539122b", "score": "0.6700007", "text": "def destroy\n @artist = Artist.find(params[:id])\n @artist.log_destroy_for_audit\n flash[:notice] = \"Your requests for deletion of #{@artist.name} was successfully submitted.\"\n\n respond_to do |format|\n format.html { redirect_to(artists_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "9e5ee9acf2b2740ef19193828eceb10d", "score": "0.66954756", "text": "def destroy\n @artist_badge.destroy\n respond_to do |format|\n format.html { redirect_to artist_badges_url, notice: 'Artist badge was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8dd36523fb45422047df96d155b6177e", "score": "0.6691985", "text": "def delete!\n json = web_method_call( {\n :method => 'smugmug.albums.delete',\n :album_id => album_id\n })\n\n nil\n end", "title": "" }, { "docid": "b7fbd348c9d7ab91ce80e7628a62300f", "score": "0.668641", "text": "def destroy\n \n @artist_data.destroy\n respond_to do |format|\n @artist_data.avatar = nil\n format.html { redirect_to \"/artistas/adm\" } \n end\n\n end", "title": "" }, { "docid": "8472dbaab6e1b378aa8a8ecf9968c832", "score": "0.66855603", "text": "def destroy\n @clothing.destroy\n respond_to do |format|\n format.html { redirect_to clothings_url, notice: t('clothings.destroy.remove') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "deea9f49d8afc8cb0228f307a05e36bf", "score": "0.6684486", "text": "def destroy\n @song.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f37a885b0aa1a85be5af15eecdab72d5", "score": "0.6683596", "text": "def destroy\n @rheumatologist.destroy\n respond_to do |format|\n format.html { redirect_to rheumatologists_url, notice: 'Rheumatologist was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ee29466c3c179b9b702dc9038444c91", "score": "0.66784054", "text": "def destroy\n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "7ee29466c3c179b9b702dc9038444c91", "score": "0.66784054", "text": "def destroy\n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "73377613daf59954168a620bcf9c222f", "score": "0.66727376", "text": "def destroy\n @album.destroy\n\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c197cfd45cfa8e84777009bd6b28787b", "score": "0.66643894", "text": "def destroy\n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c197cfd45cfa8e84777009bd6b28787b", "score": "0.66643894", "text": "def destroy\n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c197cfd45cfa8e84777009bd6b28787b", "score": "0.66643894", "text": "def destroy\n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c197cfd45cfa8e84777009bd6b28787b", "score": "0.66643894", "text": "def destroy\n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c197cfd45cfa8e84777009bd6b28787b", "score": "0.66643894", "text": "def destroy\n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c197cfd45cfa8e84777009bd6b28787b", "score": "0.66643894", "text": "def destroy\n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c197cfd45cfa8e84777009bd6b28787b", "score": "0.66643894", "text": "def destroy\n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c197cfd45cfa8e84777009bd6b28787b", "score": "0.66643894", "text": "def destroy\n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c197cfd45cfa8e84777009bd6b28787b", "score": "0.66643894", "text": "def destroy\n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c197cfd45cfa8e84777009bd6b28787b", "score": "0.66643894", "text": "def destroy\n @person = Person.find(params[:id])\n @person.destroy\n\n respond_to do |format|\n format.html { redirect_to people_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5944f62e7bdf9674ef1c2ebfcce01fa8", "score": "0.6663386", "text": "def destroy\n @animal_owner = AnimalOwner.find(params[:id])\n @animal_owner.destroy\n\n respond_to do |format|\n format.html { redirect_to animal_owners_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f845bba3736ee86cff210a8417642b50", "score": "0.6662377", "text": "def destroy\n @album.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "title": "" } ]
db9d3b0ec406445c1540d88225d49e8c
O(N) increasing stack data structure
[ { "docid": "e591ff6ba5b9d2db40186829c89b110b", "score": "0.0", "text": "def largest_rectangle_area(heights)\n # Maintain increasing stack\n stack = []\n max_area = 0\n i = 0\n\n # Iterate once (Increasing order)\n while i < heights.length\n # If stack is empty or height is higher, push it in the stack\n if stack.empty? || heights[i] >= heights[stack[-1]]\n stack << i\n else\n # if height is shorter than tallest one so far, find the max area of things taller than itself first\n shortest = stack.pop\n # left bound, i = right bound\n left = stack.empty? ? 0 : stack[-1] + 1\n max_area = [max_area, heights[shortest] * (i - left)].max\n # Keep repeating until we get rid of all the heights taller than itself.\n i -= 1\n end\n\n i += 1\n end\n\n # Iterate again with the shorter ones\n # right bound is the rightmost part (current)\n current = heights.length\n while !stack.empty?\n shortest = stack.pop\n \n left = stack.empty? ? 0 : stack[-1] + 1\n max_area = [max_area, heights[shortest] * (current - left)].max\n end\n\n max_area\nend", "title": "" } ]
[ { "docid": "ad70934a6c6618f419425a4d64b6cbc7", "score": "0.6833793", "text": "def stack; @stack ||= [] end", "title": "" }, { "docid": "856cc480e4ea1d0b21fee2cf50f040c5", "score": "0.68279564", "text": "def stack_ll; end", "title": "" }, { "docid": "7b0c83a4d6a320271517b44bfe0ab629", "score": "0.68214405", "text": "def stack; end", "title": "" }, { "docid": "7b0c83a4d6a320271517b44bfe0ab629", "score": "0.68214405", "text": "def stack; end", "title": "" }, { "docid": "7b0c83a4d6a320271517b44bfe0ab629", "score": "0.68214405", "text": "def stack; end", "title": "" }, { "docid": "7b0c83a4d6a320271517b44bfe0ab629", "score": "0.68214405", "text": "def stack; end", "title": "" }, { "docid": "7b0c83a4d6a320271517b44bfe0ab629", "score": "0.68214405", "text": "def stack; end", "title": "" }, { "docid": "7b0c83a4d6a320271517b44bfe0ab629", "score": "0.68214405", "text": "def stack; end", "title": "" }, { "docid": "7b0c83a4d6a320271517b44bfe0ab629", "score": "0.68214405", "text": "def stack; end", "title": "" }, { "docid": "8587e6bc483290d06ef8473e58bd7d4b", "score": "0.6699677", "text": "def push value \n\t\tif @index_stack >= @capacity\n\t\t\t@index_stack = 0\n\t\t\t@index_stack_number += 1\n\t\t\t@stack_set[@index_stack_number] = Array.new\n\t\tend \n\n\t\t@stack_set[@index_stack_number][@index_stack] = value\n\t\t@index_stack += 1\n\tend", "title": "" }, { "docid": "e6119b5d81f705b9429f92f2048c26d8", "score": "0.6663775", "text": "def stack; @stack ||= [{}]; end", "title": "" }, { "docid": "e6119b5d81f705b9429f92f2048c26d8", "score": "0.6663775", "text": "def stack; @stack ||= [{}]; end", "title": "" }, { "docid": "46ca35031b6b920f90ca8cdaaccb8244", "score": "0.6658939", "text": "def stack; @stack; end", "title": "" }, { "docid": "9e37165428b9989695f70943a0bc53e7", "score": "0.66070694", "text": "def printStack(employeeStack)\n transferStack = Stack.new\n employeeStack.size.times do |x|\n transferStack.push(employeeStack.pop)\n end\n transferStack.size.times do |x|\n employeeStack.push(transferStack.pop)\n puts \"Employee ID: #{employeeStack.top}\"\n end\nend", "title": "" }, { "docid": "513af4f6cc259939f6e3803ff41581a6", "score": "0.65836716", "text": "def push_stack2(element)\n raise 'Sack Overflow - Stack is full' if @top1 >= @top2 - 1\n @top2 -=1\n @array[@top2] = element\n end", "title": "" }, { "docid": "f9b5abc0ac488c7025e2d5e60c1ddfe3", "score": "0.6582786", "text": "def stack\n @stack ||= []\n end", "title": "" }, { "docid": "f9b5abc0ac488c7025e2d5e60c1ddfe3", "score": "0.6582786", "text": "def stack\n @stack ||= []\n end", "title": "" }, { "docid": "305474c1124f61adbf58362daf18b1da", "score": "0.65644133", "text": "def stack\n @stack ||= Array.new\n end", "title": "" }, { "docid": "09deba81073db37be13080dc99a20d07", "score": "0.65422016", "text": "def stack\n @stack ||= []\n end", "title": "" }, { "docid": "55066287b0329ca44232e8fc513cd266", "score": "0.6507542", "text": "def push(value) #pushing element to the tail, that element is top\n @top += 1 #first increment pointer for 1, to point next empty spot in array\n @stack[@top] = value #then assign next empty spot with value\n end", "title": "" }, { "docid": "f984788bb2158cc62382d742b3f9ed00", "score": "0.6501414", "text": "def push_stack1(element)\n raise 'Stack Overflow - Stack is full' if @top1 >= @top2 - 1\n @top1 += 1\n @array[@top1] = element\n end", "title": "" }, { "docid": "65a3b2d08f1920a9cc2b0f8b6e8897f0", "score": "0.64538884", "text": "def stack_index; end", "title": "" }, { "docid": "f70a8e6707dad3eeec4f268fb70a36fd", "score": "0.6436774", "text": "def push(stack, node); end", "title": "" }, { "docid": "f70a8e6707dad3eeec4f268fb70a36fd", "score": "0.6436774", "text": "def push(stack, node); end", "title": "" }, { "docid": "a95895229f8abcdbc9301d26ec39d828", "score": "0.636873", "text": "def push\n if @top.nil?\n @top = 0\n @list[@top] = {}\n else\n @top += 1\n @list[@top] = @list[@top - 1].dup\n end\n end", "title": "" }, { "docid": "3b1ba444075e41df0e568017ecd491f6", "score": "0.63641083", "text": "def stack\n return @stack ||= []\n end", "title": "" }, { "docid": "5b309eceb23a33ceeb22a9c52bfd5c50", "score": "0.63548493", "text": "def push(val)\n while @stack1[-1] >= val\n @stack2.push(@stack1.pop)\n end\n @stack1.push(val)\n while [email protected]?\n @stack1.push(@stack2.pop)\n end\n end", "title": "" }, { "docid": "371c9f2542b468128b8d4976b304d9a6", "score": "0.6316247", "text": "def solution(arr)\n stack = []\n out = [-1] * arr.length\n # debugger\n (arr.length - 1).downto(0) do |i|\n # p i\n # p stack\n while stack.length > 0 && arr[stack.last] >= arr[i]\n out[stack.pop] = i\n # p out\n end\n stack << i\n end\n return out\nend", "title": "" }, { "docid": "e9ec820ba86c2151b61f334e0d225af3", "score": "0.6316102", "text": "def push(x)\n @heap << x\n sift_up(@heap.length - 1)\n self\nend", "title": "" }, { "docid": "767b5ce2f1975e66a2f053849f70167d", "score": "0.6297335", "text": "def push(element)\n \t# If it's full or the element being pushed is nil, return nil\n if full? or element.nil?\n nil\n # Otherwise do this\n else\n \t# .succ returns the integer equal to Int + 1 so this adds 1 to the top_index\n @top_index = @top_index.succ\n # Change the @top_index which is nil to the element added which isn't nil because that would be covered by the if statement\n @store[@top_index] = element\n # Returns the stack instance \n self\n end\n binding.pry\n end", "title": "" }, { "docid": "4217e596e796f36f5da01e0dfa408f96", "score": "0.62771195", "text": "def push n\n @left.push n\n end", "title": "" }, { "docid": "3b44fcfc82d2396eace1a60d153dd054", "score": "0.62661827", "text": "def stack(node, &block); end", "title": "" }, { "docid": "3b44fcfc82d2396eace1a60d153dd054", "score": "0.62661827", "text": "def stack(node, &block); end", "title": "" }, { "docid": "b7fcca20f33c87328d26c412397e7e0a", "score": "0.62358683", "text": "def push(item)\n #use stack position index and increment by 1,\n @stack_position +=1\n #assign element to location at the stack position index\n @stack[@stack_position] = item\n self.top = item\n end", "title": "" }, { "docid": "18bffd319bd01feda797f8cd96ba90c1", "score": "0.6231226", "text": "def sortStack(stack)\r\n new_stack = Stack.new\r\n until stack.length == 0\r\n if new_stack.length == 0\r\n new_stack.push(stack.pop)\r\n elsif stack.peek >= new_stack.peek\r\n new_stack.push(stack.pop)\r\n else\r\n var = stack.pop\r\n until new_stack.length == 0 || new_stack.peek < var\r\n stack.push(new_stack.pop)\r\n end\r\n new_stack.push(var)\r\n until stack.length == 0 || stack.peek < new_stack.peek\r\n new_stack.push(stack.pop)\r\n end\r\n end\r\n end\r\n return new_stack\r\nend", "title": "" }, { "docid": "53a97787d2ee7b8820845a05b334cc6b", "score": "0.61940354", "text": "def duplicateStackTop\n\t\tif @stack.empty?\n\t\t\tstackPush(0)\n\t\telse\n\t\t\ta = stackPop\n\n\t\t\tstackPush(a)\n\t\t\tstackPush(a)\n\t\tend\n\tend", "title": "" }, { "docid": "b3b622f151b969dbc1dfb2d69ac32388", "score": "0.61688143", "text": "def sortStack( stk)\n if ((stk.length == 0) == false)\n temp = stk.pop()\n sortStack(stk)\n sortedInsert(stk, temp)\n end\nend", "title": "" }, { "docid": "cf7f306c11d517b815c241d5678c9b38", "score": "0.61554927", "text": "def sort_stack(stack)\n if !stack.is_empty?\n temp = stack.pop\n sort_stack(stack)\n sorted_insert(stack, temp)\n end\nend", "title": "" }, { "docid": "8f36465728de1ed398519f16b06ae6e2", "score": "0.61400473", "text": "def push\n STACK << REGISTER[-1]\nend", "title": "" }, { "docid": "e8887df84a716783690aab96798a91bf", "score": "0.6121541", "text": "def get_stacked(tag)\n @stack[tag][@stack[tag].size-1]\n end", "title": "" }, { "docid": "e8887df84a716783690aab96798a91bf", "score": "0.6121541", "text": "def get_stacked(tag)\n @stack[tag][@stack[tag].size-1]\n end", "title": "" }, { "docid": "bee98ff5fc6c957945655210aee5357b", "score": "0.61133856", "text": "def inorder\n current = root\n stack = []\n output = []\n while current || !stack.empty?\n while !current.nil?\n stack.push(current)\n current = current.left\n end\n current = stack.pop\n new_hash = Hash.new\n new_hash[:key] = current.key\n new_hash[:value] = current.value\n output.push(new_hash); #storing the data\n current = current.right\n end\n return output\n end", "title": "" }, { "docid": "8cd63667435572538ce1acf7f5abc73e", "score": "0.61045194", "text": "def push(val)\n @stack << val\n if @min_stack.empty? || val >= @min_stack.last\n @min_stack.push(val)\n elsif val <= @min_stack.first\n @min_stack.insert(0, val)\n else\n (0...(@min_stack.size - 1)).each do |index|\n if val >= @min_stack[index] && val < @min_stack[index + 1]\n @min_stack.insert(index + 1, val)\n break\n end\n end\n end\n end", "title": "" }, { "docid": "e0fba99e7ac484e9582dd747b6b9b1f0", "score": "0.61028534", "text": "def sort_stack(stack)\n if !stack.is_empty?\n holder = stack.pop\n sort_stack(stack)\n insert_sorted(stack, holder)\n end\n return stack\nend", "title": "" }, { "docid": "cff21b5cb66bcf83513409d9450b8fcc", "score": "0.6100714", "text": "def test_stack\n # Initialize Stack\n stack1 = Stack.new(10)\n\n # Add item to stack\n stack.push(10)\n stack.push(20)\n\n while(!stack1.is_empty?) do\n puts stack1.pop\n end\nend", "title": "" }, { "docid": "970ea9b60c70e8caa66178ed40277f8b", "score": "0.6099658", "text": "def reverseStack( stk)\n que = Queue.new\n while (!(stk.length == 0))\n que.push(stk.pop())\n end\n while (!que.empty?)\n stk.push(que.pop())\n end\nend", "title": "" }, { "docid": "c930c643183c9a917a50cdce09075aa0", "score": "0.6097961", "text": "def push(x)\n return if @stack.size == @max_size\n @stack << x\n @values << 0\n end", "title": "" }, { "docid": "a75eb64104a94cca0dd882b7a775ca3d", "score": "0.6094215", "text": "def towers_stack(list)\n while !list.empty?\n n, src, dst, aux = list.pop\n if n == 1\n puts \"Move disk from #{src} to #{dst}\".yellow\n else\n list.push [n-1, aux, dst, src]\n list.push [1, src, dst, aux]\n list.push [n-1, src, aux, dst]\n end\n end\nend", "title": "" }, { "docid": "ffa5e1283d217472fe05f01e3290f37d", "score": "0.60892487", "text": "def sort_stack(stack)\n buffer = Stack.new\n temp = nil\n until stack.empty?\n temp = stack.pop\n if buffer.last == nil || buffer.last <= temp\n buffer.push(temp)\n else\n stack.push(buffer.pop) until buffer.empty? || buffer.last <= temp\n buffer.push(temp)\n end\n end\n\n until buffer.empty?\n stack.push(buffer.pop)\n end\n\n stack\nend", "title": "" }, { "docid": "b14ff29b2bac55441542c1bc57713ff7", "score": "0.6087362", "text": "def key_stack\n @key_stack ||= Array.new\n end", "title": "" }, { "docid": "b30b09076d2bd13a3ead9e5b0470df0d", "score": "0.6052031", "text": "def push(n)\n raise GMPForth::StackFullError if depth >= @pstack_size\n u = unsigned(n)\n if @sepstack\n @pstack.push(u)\n else\n @sp += 1\n mem_store(@sp, u)\n end\n end", "title": "" }, { "docid": "10c18100594b242ab4683837020d0fa8", "score": "0.6045571", "text": "def my_flatten_inorder_stack\n dup.my_flatten_inorder_stack!\n end", "title": "" }, { "docid": "47566aa0201aba313d8d0d93ba57c86f", "score": "0.6039969", "text": "def pushes; end", "title": "" }, { "docid": "8c697608a6ce30912045ce56dfd75947", "score": "0.6025714", "text": "def nonrecursive\n\t\t@stack = Array.new\n\t\t\n\t\[email protected](@m)\n\t\tuntil @stack.empty?\n\t\t\t@m = @stack.pop\n\t\t\tif @m == 0\n\t\t\t\t@n += 1\n\t\t\telsif @m > 0 && @n == 0\n\t\t\t\[email protected](@m-1); @n+=1\n\t\t\telsif @m > 0 && @n > 0\n\t\t\t\[email protected](@m-1, @m); @n-=1\n\t\t\tend\n\t\tend\t\n\t\treturn @n\n\tend", "title": "" }, { "docid": "5701f7b737965051ae18f1c64c70d10b", "score": "0.6024003", "text": "def tower_of_hanoi(stack1)\n puts \"stack 1 START:\" \n puts \"#{stack1.output}\"\n\n i = 0\n stack2 = Stack.new(4)\n\n while i <= stack1.count\n temp = stack1.pop\n puts \"stack1 count here: #{stack1.count}\"\n puts \"stack 1:\" \n puts \"#{stack1.output}\"\n\n while (stack1.count - i > 0)\n puts \"stack 1:\" \n puts \"#{stack1.output}\"\n stack2.push(stack1.pop)\n puts \"stack 2:\" \n puts \"#{stack2.output}\"\n end\nputs \"stack 1 before push temp:\" \n puts \"#{stack1.output}\"\n puts \"temp: #{temp}\"\n stack1.push(temp)\n \n puts \"stack 1 after push temp:\" \n puts \"#{stack1.output}\"\n while (stack2.count != 0)\n stack1.push(stack2.pop)\n puts \"stack 1:\" \n puts \"#{stack1.output}\"\n end\n\n i += 1\n end\n stack1.push(temp)\nend", "title": "" }, { "docid": "37f00e639e98b7f34919e17ea5184845", "score": "0.60239387", "text": "def test_can_push_more_than_thing\n @stack.push 0\n a = [1,2,3]\n @stack.push(*a)\n assert_eq @stack, [0, 1, 2, 3]\n end", "title": "" }, { "docid": "f656cc6826676193439b358c9c692d0e", "score": "0.60223126", "text": "def bottomInsert( stk, element)\n if ((stk.length == 0))\n stk.push(element)\n else\n temp = stk.pop()\n bottomInsert(stk, element)\n stk.push(temp)\n end\nend", "title": "" }, { "docid": "8284d969aead3f7c3efc3380eade77a4", "score": "0.6012977", "text": "def restack!(stack = [])\n pop while not empty?\n stack.each_with_index { |frame, i| self[i] = frame }\n @value = stack.value if Stack === stack\n end", "title": "" }, { "docid": "8284d969aead3f7c3efc3380eade77a4", "score": "0.6012977", "text": "def restack!(stack = [])\n pop while not empty?\n stack.each_with_index { |frame, i| self[i] = frame }\n @value = stack.value if Stack === stack\n end", "title": "" }, { "docid": "8e7487c5ea3c37989d21bd5cc733c7b7", "score": "0.6006196", "text": "def sort_stack(stack1)\n return false if stack1.pop()==false\n stack_helper= Stack.new\n stack_helper.push(stack1.pop)\n \n while(!stack1.empty?)\n current=stack1.pop\n while(current<stack_helper.peek() && !stack_helper.empty? )\n stack1.push(stack_helper.pop)\n end\n stack_helper.push(current)\n end \n \n while(!stack_helper.empty?)\n stack1.push(stack_helper.pop())\nend \n \n \n \n \nreturn stack1\n \nend", "title": "" }, { "docid": "c2225e4770ee053259decee5b3d53caa", "score": "0.6003638", "text": "def test_size_stack\n @stack.push(7)\n @stack.push(8)\n assert_equal 2, @stack.size?\n end", "title": "" }, { "docid": "6239ea6e02866cef51719de0eb2a00f2", "score": "0.59996724", "text": "def stack(n = 4)\n arr = []\n i = (self.size.to_f/n).ceil\n i.times do |x|\n arr << self[x*n..(((x+1)*n)-1)]\n end\n return arr\n end", "title": "" }, { "docid": "f704fb4a67a77c093df3ae9f38a3391d", "score": "0.59726137", "text": "def sift_up(i)\n parent = (i - 1) / 2\n if parent >= 0\n if @heap[parent][1] > @heap[i][1]\n @heap[parent], @heap[i] = @heap[i], @heap[parent]\n sift_up(parent)\n end\n end\nend", "title": "" }, { "docid": "d9dd0ff1d4fc5683e76f66d180413214", "score": "0.596988", "text": "def bottomInsert( stk, value)\n if ((stk.length == 0))\n stk.push(value)\n else\n out = stk.pop()\n bottomInsert(stk, value)\n stk.push(out)\n end\nend", "title": "" }, { "docid": "0b67faad23879f2ed59b393cdd972558", "score": "0.5964", "text": "def return_stack\n initial_size = size\n dup_many initial_size\n make_array initial_size\n end", "title": "" }, { "docid": "e1e6037c3ffa7f460e260269ba8160b2", "score": "0.5962322", "text": "def sort_stack(s1)\n working = []\n\n until s1.empty?\n check = s1.pop\n until working.empty? || working.last < check\n s1.push(working.pop)\n end\n working.push(check)\n end\n\n until working.empty?\n s1.push(working.pop)\n end\n\n s1\nend", "title": "" }, { "docid": "938ab819a4d65286f519d2665f411350", "score": "0.5961897", "text": "def pop(stack)\n stack.pop\nend", "title": "" }, { "docid": "fd4180ceabaaa2880ca22147211941f6", "score": "0.5955416", "text": "def depth_first_stack_2(graph, vtx)\n stack = [[vtx, 0]]\n discovered = { vtx => true }\n\n while stack != []\n # p stack\n\n top_vtx = stack[-1][0]\n pos = stack[-1][1]\n next_vtx = graph[top_vtx][pos]\n\n if next_vtx\n stack[-1][1] += 1\n stack.push([next_vtx, 0]) unless discovered[next_vtx]\n discovered[next_vtx] = true\n else\n stack.pop\n end\n\n end\n\n discovered.keys\nend", "title": "" }, { "docid": "a30eacdda08e4f2e65fc1a42743a12d6", "score": "0.59553444", "text": "def level_order(node = root, queue = [])\n node.data\n queue << node.left unless node.left.nil?\n queue << node.right unless node.right.nil?\n return if queue.empty?\n\n level_order(queue.shift, queue)\n # queue.shift removes a value and moves the array over by one\n end", "title": "" }, { "docid": "0991443e3c85bd9068c48880fcee3fdc", "score": "0.5953931", "text": "def sort_stacks(list)\n a = Stack.new(list)\n b = Stack.new\n\n while !a.is_empty?\n element = a.pop\n while !b.is_empty? && b.peek > element\n a.push(b.pop)\n end\n b.push(element)\n end\n b\nend", "title": "" }, { "docid": "02d1ea30ea05150b0cef5361f3066026", "score": "0.5944794", "text": "def push(x)\n evaluate_min_push(x)\n stack.push(x)\n end", "title": "" }, { "docid": "d3884de614fe1fa5361c3fc7180d93f3", "score": "0.5942551", "text": "def key_stack\n @key_stack ||= []\n end", "title": "" }, { "docid": "c23ac061daa49a38569baf65404b13c2", "score": "0.5936222", "text": "def level_order_iter\n que = [@root]\n values = []\n\n until stack.empty?\n curr_node = stack.shift\n que << curr_node.left unless curr_node.left.nil?\n que << curr_node.right unless curr_node.right.nil?\n\n que << curr_node.data unless curr_node.data.nil?\n end\n\n values\n end", "title": "" }, { "docid": "81e90c9be4e317893a0d4b02ab54e847", "score": "0.59330904", "text": "def append_stack(d)\n modify_dup(:append_stack!, d)[0]\n end", "title": "" }, { "docid": "6f31b08b8a2ee39b7c6448e633c89339", "score": "0.59290504", "text": "def push(x)\n @stack.append(x)\n if @min_stack.empty? || @min_stack[-1] >= x\n @min_stack.append(x)\n end\n end", "title": "" }, { "docid": "e909296c33eaaca5477743facfd5fb05", "score": "0.59219545", "text": "def push(x)\n @front = x if support_stack1 == []\n support_stack1.push x\n end", "title": "" }, { "docid": "d186b905fa945b9a3aadfd07cfd72f82", "score": "0.591971", "text": "def op_stack\n @op_stack ||= []\n end", "title": "" }, { "docid": "f40ab07dba13055661f6d3afb788eb1c", "score": "0.59131473", "text": "def test_full_stack_push_and_pop\n puts \"test_full_stack_push_and_pop\"\n (rand(10) + 2).times do\n expects = []\n 100.times do\n expects << random_string\n pr = push(expects[-1])\n assert_equal(0, pr, \"expected 0, got #{pr}\")\n end\n\n 100.times do\n r = pop\n s = expects.pop\n assert_equal(s, r, \"expected #{s}, got #{r}\")\n end\n end\n end", "title": "" }, { "docid": "c3731ae3097bc5ab747013e4618a9d9d", "score": "0.591072", "text": "def queue_stacks(str, stack)\n input = str.split.map(&:to_i)\n if input[0] == 1\n stack.push(input[1])\n elsif input[0] == 2\n stack.shift\n elsif input[0] == 3\n puts stack[0]\n end\n\n stack\nend", "title": "" }, { "docid": "5867e332a4173890f604ddf56d8f7030", "score": "0.5895328", "text": "def peek depth=0\n raise %Q[Illegal argument \"#{depth}\"] if depth < -1\n temp = []\n if depth == -1\n temp.push(pull()) until empty?\n else\n while @stack.size+temp.size < depth+1\n temp.push(pull())\n end\n end\n @stack += temp if temp.size > 0\n @stack[depth]\n end", "title": "" }, { "docid": "569d64cc474b18125ea9f154a849dd32", "score": "0.58878857", "text": "def level_order(array_of_values = [], queue = [], pointer = root)\n return if pointer.nil?\n\n queue << pointer\n until queue.empty?\n pointer = queue.shift\n array_of_values << pointer.data\n queue << pointer.left_child unless pointer.left_child.nil?\n queue << pointer.right_child unless pointer.right_child.nil?\n end\n array_of_values\n end", "title": "" }, { "docid": "dc694f5fccc5df1aa7b99d0c8eb3f406", "score": "0.5882102", "text": "def push(x)\n @stack << x\n nil \n end", "title": "" }, { "docid": "152964f26d7246879f800aad8e94b6df", "score": "0.58709294", "text": "def push(data)\n if (is_full?())\n puts \"Stack is full\"\n return\n end\n @data[@size] = data\n @size += 1\n end", "title": "" }, { "docid": "d82e335f885022d50556f5c5c792a5aa", "score": "0.586823", "text": "def initialize\n @stack = []\n end", "title": "" }, { "docid": "c690b456baab91f7830b22a37fd23b15", "score": "0.5865504", "text": "def push(x)\n stack.push(x)\n pq.insert(x)\n nil\n end", "title": "" }, { "docid": "9d7510ac27a7f0fa0a6b67bf07428298", "score": "0.58525366", "text": "def stack_dd; end", "title": "" }, { "docid": "da89bd39d1388afdf827de685db9e362", "score": "0.5846071", "text": "def push(stack, value)\n raise \"Not a Valid Stack\" unless valid_stack?(stack)\n raise \"Max Stack\" if max?(stack)\n @stack[@location[stack-1]] = value\n @location[stack-1] +=1\n end", "title": "" }, { "docid": "efe9a2d39ead723b805eec2f6361d407", "score": "0.5837829", "text": "def stack\n @stack ||= [get_state(:root)]\n end", "title": "" }, { "docid": "efe9a2d39ead723b805eec2f6361d407", "score": "0.5837829", "text": "def stack\n @stack ||= [get_state(:root)]\n end", "title": "" }, { "docid": "0c3ef92ca3f8d3f6e4ee3593938c3e0a", "score": "0.5834093", "text": "def test_array_stack\n {4 => (1..10).to_a, 25 => (1..100).to_a}.each do |n, array|\n \n sep_array = array.stack(n)\n \n assert_equal sep_array.first.size, n\n assert_equal sep_array.flatten, array\n end \n end", "title": "" }, { "docid": "37365db4cb8eb93b45d6d21018eb7bd0", "score": "0.5828411", "text": "def push item\n @stack.push item\n if !@maxs_stack.peek || item >= @maxs_stack.peek\n @maxs_stack.push(item)\n end\n end", "title": "" }, { "docid": "323af7e00142907ffbfc71b778ec0544", "score": "0.5824394", "text": "def remove\n return nil if @push_stack.size.zero?\n\n @push_stack.size.times { @pop_stack.push @push_stack.pop }\n @pop_stack.pop.tap { @pop_stack.size.times { @push_stack.push @pop_stack.pop } }\n end", "title": "" }, { "docid": "fa5f7aaba6dfb4880e984441342fc43f", "score": "0.5819826", "text": "def stack(tgt)\n tgt.stack.reverse.map { |n| signed(n) }\n end", "title": "" }, { "docid": "28ccdb419d953883dd28623614cfd878", "score": "0.58081305", "text": "def push_stack(node)\n @stack.push node\n end", "title": "" }, { "docid": "6cfb09b6e61c47421f184eba8bab79ae", "score": "0.58070016", "text": "def sift_up(i)\n parent = (i - 1) / 2\n if parent >= 0 and @heap[parent][1] > @heap[i][1]\n @heap[parent], @heap[i] = @heap[i], @heap[parent]\n sift_up(parent)\n end\n end", "title": "" }, { "docid": "57acb2fec01c3eeb3369fd087919bb82", "score": "0.58068484", "text": "def bfs # like reading left to right\n # you need a queue (you could use an array) for breadth-first search\n\n list = []\n return list if @root.nil?\n queue = [@root]\n\n until queue.empty?\n current = queue.shift # shift removes first element of array and returns it (or returns nil if array is empty). time complexity is O(n)\n queue.push(current.left) unless current.left.nil?\n queue.push(current.right) unless current.right.nil?\n\n list << { key: current.key, value: current.value }\n end\n\n return list\n\n end", "title": "" }, { "docid": "80a423c8c864e7b15c01d90f9cd6a166", "score": "0.58043706", "text": "def trees(low, high, cache)\n return 1 if low >= high\n cache[\"#{low}-#{high}\"] ||= low.upto(high).map { |x| trees(low, x - 1, cache) * trees(x + 1, high, cache) }.inject(:+)\nend", "title": "" }, { "docid": "83736838c1ecf2d9a3517861ace15911", "score": "0.5795857", "text": "def test_not_empty_stack\n @stack.push(5)\n @stack.push(6)\n assert_equal false, @stack.empty?\n end", "title": "" }, { "docid": "556291bb7e238bb63f88597296103c93", "score": "0.5791704", "text": "def sift_up(i)\n parent = (i - 1) / 2\n if parent >= 0 and @heap[parent] > @heap[i]\n @heap[parent], @heap[i] = @heap[i], @heap[parent]\n sift_up(parent)\n end\n end", "title": "" }, { "docid": "556291bb7e238bb63f88597296103c93", "score": "0.5791704", "text": "def sift_up(i)\n parent = (i - 1) / 2\n if parent >= 0 and @heap[parent] > @heap[i]\n @heap[parent], @heap[i] = @heap[i], @heap[parent]\n sift_up(parent)\n end\n end", "title": "" }, { "docid": "556291bb7e238bb63f88597296103c93", "score": "0.5791704", "text": "def sift_up(i)\n parent = (i - 1) / 2\n if parent >= 0 and @heap[parent] > @heap[i]\n @heap[parent], @heap[i] = @heap[i], @heap[parent]\n sift_up(parent)\n end\n end", "title": "" } ]
be6ba122ea33ec084bf38e5d536d208f
GET /email_messages/new GET /email_messages/new.json
[ { "docid": "77a7ce0067e5b3f0a9fd9408c7f80ad0", "score": "0.8299705", "text": "def new\n @email_message = EmailMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email_message }\n end\n end", "title": "" } ]
[ { "docid": "67d9910d593506f65db4e41c7e2b69b5", "score": "0.80222726", "text": "def new\n @message = Message.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "3b5c9a51f147971dfd0ba1d052d85010", "score": "0.8016582", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "1db5d88597da03d5fdcfbab9111b7bea", "score": "0.799739", "text": "def new\n @email = @recipient.emails.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email }\n end\n end", "title": "" }, { "docid": "dc07b3f4bda2b49635e071465ca166ca", "score": "0.7953643", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @message }\n end\n end", "title": "" }, { "docid": "dc07b3f4bda2b49635e071465ca166ca", "score": "0.7953643", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @message }\n end\n end", "title": "" }, { "docid": "dc07b3f4bda2b49635e071465ca166ca", "score": "0.7953643", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @message }\n end\n end", "title": "" }, { "docid": "dc07b3f4bda2b49635e071465ca166ca", "score": "0.7953643", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @message }\n end\n end", "title": "" }, { "docid": "dc07b3f4bda2b49635e071465ca166ca", "score": "0.7953643", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @message }\n end\n end", "title": "" }, { "docid": "d5b44474aedb8c8ba275790df2005ac4", "score": "0.79435897", "text": "def new\r\n @message = Message.new\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @message }\r\n end\r\n end", "title": "" }, { "docid": "b5c190ac796f472a9289d17d8fec22b7", "score": "0.7940905", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render_json_response :ok, :message => @message }\n end\n end", "title": "" }, { "docid": "d6d1be080ef2d0daa81ef25d7b3ad746", "score": "0.79264575", "text": "def new\n @message = Message.new\n\n render json: @message\n end", "title": "" }, { "docid": "68394f5c852536069eac08f028e1d609", "score": "0.78749484", "text": "def new\n @msg = Msg.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @msg }\n end\n end", "title": "" }, { "docid": "95ba06f7325c5b85720952bdb590538c", "score": "0.78598225", "text": "def new\n @email = Email.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email }\n end\n end", "title": "" }, { "docid": "95ba06f7325c5b85720952bdb590538c", "score": "0.78593016", "text": "def new\n @email = Email.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email }\n end\n end", "title": "" }, { "docid": "95ba06f7325c5b85720952bdb590538c", "score": "0.78587073", "text": "def new\n @email = Email.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email }\n end\n end", "title": "" }, { "docid": "e7ba1f2caf72e7112ccb23899abbdbaa", "score": "0.7820868", "text": "def new\n @title = t('site.home.message.creer')\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "406f9c114187e4f6469df0f3a30b9acc", "score": "0.7757795", "text": "def new\n authorize! :manage, :all\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "c95e6599001c08249d09add42b4e5d85", "score": "0.77562344", "text": "def new\n @message_template = MessageTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message_template }\n end\n end", "title": "" }, { "docid": "c95e6599001c08249d09add42b4e5d85", "score": "0.77562344", "text": "def new\n @message_template = MessageTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message_template }\n end\n end", "title": "" }, { "docid": "028a05c8b53218a28f9108ba22965e11", "score": "0.77178174", "text": "def new\n @message = @user.messages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @message }\n format.js {render :layout => false}\n end\n end", "title": "" }, { "docid": "c350bada1c5a3031b63d3c0e06834ead", "score": "0.7693771", "text": "def new\n @incoming_mail = IncomingMail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @incoming_mail }\n end\n end", "title": "" }, { "docid": "9a518ac77d60d1d0945caab5acf3ecd6", "score": "0.7641076", "text": "def new\n @message = Message.new\n @reply_to = params[:reply_to]\n @title = t('app_name') + ' | ' + t('messages.new.title')\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "12beccd8f8f136ccafbca209995b7507", "score": "0.7633582", "text": "def new\n require 'dates'\n @message = Message.new(params[:message])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "890fb59e701279bede7e7433dface8fa", "score": "0.75808895", "text": "def new\n @incoming_message = IncomingMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @incoming_message }\n end\n end", "title": "" }, { "docid": "f734f6da39b1649fe6aa86b329331e90", "score": "0.7577736", "text": "def new\n @user_message = UserMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_message }\n end\n end", "title": "" }, { "docid": "f734f6da39b1649fe6aa86b329331e90", "score": "0.7577736", "text": "def new\n @user_message = UserMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_message }\n end\n end", "title": "" }, { "docid": "77327e7c4d83d08a92610f229049516b", "score": "0.75648", "text": "def new\n @whats_new_message = WhatsNewMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @whats_new_message }\n end\n end", "title": "" }, { "docid": "534d7c29d8c817571eb6af1dbc9314bd", "score": "0.7548538", "text": "def new\n @title = \"Отправка сообщения\"\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "986729f7a43db95d2a9c919e605917d8", "score": "0.75446093", "text": "def new\n @email_template = EmailTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email_template }\n end\n end", "title": "" }, { "docid": "a2e301cdb95d65ba4dbdfdc714fc4648", "score": "0.75370026", "text": "def new\n @contact_message = ContactMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @contact_message }\n end\n end", "title": "" }, { "docid": "ecceba722cc16f769b2e0a5523842f38", "score": "0.75162536", "text": "def new\n @text_message = TextMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @text_message }\n end\n end", "title": "" }, { "docid": "12d18e9cd9f621c98d7f44566b180cb5", "score": "0.75022167", "text": "def new\n @outgoing_mail = OutgoingMail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @outgoing_mail }\n end\n end", "title": "" }, { "docid": "f11e6c3aff429518ed7d03c2e72b4009", "score": "0.74971807", "text": "def new\n @mail_body = MailBody.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mail_body }\n end\n end", "title": "" }, { "docid": "3f27d1178fb1ef966a14a1b0198c6dbf", "score": "0.7464368", "text": "def new\n @custom_message = CustomMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @custom_message }\n end\n end", "title": "" }, { "docid": "3f27d1178fb1ef966a14a1b0198c6dbf", "score": "0.7464368", "text": "def new\n @custom_message = CustomMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @custom_message }\n end\n end", "title": "" }, { "docid": "ad30f19945668ad8839b47c593de2a66", "score": "0.74560726", "text": "def new\n @smtp = Smtp.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @smtp }\n end\n end", "title": "" }, { "docid": "d1330d9480de72954cd604c3be53f1a5", "score": "0.7454364", "text": "def new\n @user_msg = UserMsg.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @user_msg }\n end\n end", "title": "" }, { "docid": "8b037dcf079a9956ac1c4402f06a64c9", "score": "0.7445433", "text": "def new\n @mailme = Mailme.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mailme }\n end\n end", "title": "" }, { "docid": "40aece8ff0cafe6c1dac9a5824055530", "score": "0.74380517", "text": "def new\n @message = Message.new\n\n @post = Post.find_by_id(params[:post_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "32a74e5a054e720e1f2199fb00b57182", "score": "0.7432951", "text": "def new\n @mail_template = MailTemplate.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mail_template }\n end\n end", "title": "" }, { "docid": "74e8dbd53de51afde4a6cf6742a364e2", "score": "0.7432801", "text": "def new\n @message = current_user.messages.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end", "title": "" }, { "docid": "4491de7fad83b957fc5b87685a0cef90", "score": "0.7430972", "text": "def new\n @in_message = InMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @in_message }\n end\n end", "title": "" }, { "docid": "367f7dfe9b8b8774db186dc4d39cbbb4", "score": "0.7430676", "text": "def new\n @message = current_user.sent_messages.build\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "9df477c6ce2c4a9800cc9532dbfdf3e2", "score": "0.74301225", "text": "def new\n @messaging_inbox_entry = Messaging::InboxEntry.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @messaging_inbox_entry }\n end\n end", "title": "" }, { "docid": "aa74703ae5cf2943625beee21a91ca67", "score": "0.74218833", "text": "def new\n @message = Message.new\n @page_title = 'Contact Us'\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "ffe9ff6ac61123f19d703079ac027e7a", "score": "0.7407825", "text": "def new\n @gettingmail = Gettingmail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @gettingmail }\n end\n end", "title": "" }, { "docid": "28fdbfb2bcb02bd1bc1f0440c2a5d0e6", "score": "0.7407237", "text": "def new\n @message = Message.new\n @message.recipient_id = params[:recipient_id]\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @message }\n end\n end", "title": "" }, { "docid": "8deb9a9d5f4c80de7730d77a4271d12b", "score": "0.74070156", "text": "def new\n \n @message = Message.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end", "title": "" }, { "docid": "5a54c54d2b37e981c4ce19b2b334275a", "score": "0.7406596", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n\t\t\tformat.js\n format.json { render :json => @message }\n end\n end", "title": "" }, { "docid": "619e99ac29d0d0b975f0a05f76adcb0c", "score": "0.7404634", "text": "def new\n @eve_mail = EveMail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @eve_mail }\n end\n end", "title": "" }, { "docid": "d235507f3236ebd391c174fc9b350ee0", "score": "0.73876816", "text": "def new\n \n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @getnotificationmessage }\n end\n end", "title": "" }, { "docid": "fd338f225e2bde73cea78c3f87f9f33a", "score": "0.7367527", "text": "def new\n @email_gmail = EmailGmail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email_gmail }\n end\n end", "title": "" }, { "docid": "ec1c161404737a922d1baff708d451a8", "score": "0.73580265", "text": "def new\n @message = current_user.messages.new\n @message.message = I18n.t('messages.new.message')\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end", "title": "" }, { "docid": "2efc24e58c3c4ec55038fc9873cfec92", "score": "0.7344001", "text": "def new\n @message = Message.new\n respond_with @message\n end", "title": "" }, { "docid": "94b7046ac825bb3f8481cc7960e6faf6", "score": "0.7340679", "text": "def new\n @message = Message.new\n\n respond_to do |format|\n format.html # new.html.erb\n end\n end", "title": "" }, { "docid": "4c279cf3d2cd81134856663dcb8cbc9a", "score": "0.73386484", "text": "def new\n @emails_of_client = EmailsOfClient.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @emails_of_client }\n end\n end", "title": "" }, { "docid": "5ab5baced71821bee30724d0dfd5596c", "score": "0.7335404", "text": "def new\n @message = Message.new\n respond_with(@message)\n end", "title": "" }, { "docid": "f637d12f2cebf9e89102e13015447640", "score": "0.73339844", "text": "def new\n @message = Message.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end", "title": "" }, { "docid": "92ec041750a6d00c1bbdc022f5ddfaeb", "score": "0.73179644", "text": "def new\n @message_thread = MessageThread.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message_thread }\n end\n end", "title": "" }, { "docid": "d43e09550ed28a64d890ba0381c2ff2b", "score": "0.7312509", "text": "def new\n @emailannouncement = Emailannouncement.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @emailannouncement }\n end\n end", "title": "" }, { "docid": "56eb82e1f66db1a43eac661fe9a8aadc", "score": "0.7309029", "text": "def new\n @chat_message = ChatMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @chat_message }\n end\n end", "title": "" }, { "docid": "56eb82e1f66db1a43eac661fe9a8aadc", "score": "0.7309029", "text": "def new\n @chat_message = ChatMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @chat_message }\n end\n end", "title": "" }, { "docid": "577de8c2c40d311d7985e21fdc0719bc", "score": "0.7305968", "text": "def new\n @message = Message.new\n @message.attachment = Attachment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "cd9e0eab3a00227b5915c22d183a9dc6", "score": "0.72782797", "text": "def new\n @message_update = MessageUpdate.new\n @message = Message.find(params[:message_id])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message_update }\n end\n end", "title": "" }, { "docid": "542287b74c8be93ecf0a70411646f35c", "score": "0.72676784", "text": "def new\n @email_address = EmailAddress.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @email_address }\n end\n end", "title": "" }, { "docid": "f58099edec5f7fcbaef9eb58f375e894", "score": "0.726671", "text": "def new\n @tipo_email = TipoEmail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @tipo_email }\n end\n end", "title": "" }, { "docid": "63ecbf7e3a5d07a50a536d2c4abc6ddb", "score": "0.7244457", "text": "def new\n @group_message = GroupMessage.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @group_message }\n end\n end", "title": "" }, { "docid": "c1585c2d3b088ef93cf964f13593f07e", "score": "0.7237556", "text": "def new\n @postmail = Postmail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @postmail }\n end\n end", "title": "" }, { "docid": "0e093ba8cd611caf35cb58c98c70f0c7", "score": "0.72286785", "text": "def new\n @mailing_list_email = MailingListEmail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mailing_list_email }\n end\n end", "title": "" }, { "docid": "462a59e1ffc10a5456d5a0b0ff1fbdc0", "score": "0.7227603", "text": "def new\n @readmsg = Readmsg.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @readmsg }\n end\n end", "title": "" }, { "docid": "66ced057dbd8ae890ea17b210ee6ceb3", "score": "0.72261846", "text": "def new\n @email_stat = EmailStat.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email_stat }\n end\n end", "title": "" }, { "docid": "862b5f366e2045a7f31f270f96fa8776", "score": "0.72170764", "text": "def new\n @email_list = EmailList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email_list }\n end\n end", "title": "" }, { "docid": "ecefba26fd9ce4350e4534d2738eed89", "score": "0.72137034", "text": "def new\n @mail_user = MailUser.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mail_user }\n end\n end", "title": "" }, { "docid": "d1ff5c281c7a6e76ee11fa32059556fa", "score": "0.71979934", "text": "def new\n if params[:client_id]\n @client = Client.find(params[:client_id])\n @message = @client.messages.build\n else\n @message = Message.new\n end\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message }\n end\n end", "title": "" }, { "docid": "222940ce62e87f03739bdf0feb8e071f", "score": "0.71883905", "text": "def new\n @email = Email.new\n @email.user_id = current_user.id\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @email }\n end\n end", "title": "" }, { "docid": "7041e9b563c57fb42d04b59e06360327", "score": "0.71863145", "text": "def new\n @message = Message.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end", "title": "" }, { "docid": "7041e9b563c57fb42d04b59e06360327", "score": "0.71863145", "text": "def new\n @message = Message.new\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @message }\n end\n end", "title": "" }, { "docid": "c3242290e31b449432d40bd9e672a8ac", "score": "0.7183139", "text": "def new\n @mail_box = MailBox.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mail_box }\n end\n end", "title": "" }, { "docid": "7da1ffa6e4efd44473ae748d94a2c7d9", "score": "0.7181588", "text": "def new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @message_board }\n end\n end", "title": "" }, { "docid": "1c07ca357b86181ed1b026e6e17a5d74", "score": "0.71758646", "text": "def new\n @mail = Mail.new\n @mail.to = params[:to]\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @mail }\n end\n end", "title": "" } ]
c657de4b70d266e9a3a784b999ea9e60
Never trust parameters from the scary internet, only allow the white list through.
[ { "docid": "14bd2071eeda438da89d5aeeb4921614", "score": "0.0", "text": "def survey_params\n params.require(:survey).permit(:name,:evento_id,:archivo,questions_attributes: [\n :content, :id, :survey_id,:_destroy, \n answers_attributes: [:content, :id, :questions_id,:_destroy]\n ])\n\n # questions_attributes: [\n # :content, :id, :survey_id, \n # answers_attributes: [:content, :id, :questions_id]\n # ]\n end", "title": "" } ]
[ { "docid": "3663f9efd3f3bbf73f4830949ab0522b", "score": "0.7495027", "text": "def whitelisted_params\n super\n end", "title": "" }, { "docid": "13a61145b00345517e33319a34f7d385", "score": "0.69566035", "text": "def strong_params\n params.require(:request).permit(param_whitelist)\n end", "title": "" }, { "docid": "c72da3a0192ce226285be9c2a583d24a", "score": "0.69225836", "text": "def strong_params\n params.require(:post).permit(param_whitelist)\n end", "title": "" }, { "docid": "3d346c1d1b79565bee6df41a22a6f28d", "score": "0.68929327", "text": "def strong_params\n params.require(:resource).permit(param_whitelist)\n end", "title": "" }, { "docid": "aa06a193f057b6be7c0713a5bd30d5fb", "score": "0.67848456", "text": "def strong_params\n params.require(:listing).permit(param_whitelist)\n end", "title": "" }, { "docid": "f6060519cb0c56a439976f0c978690db", "score": "0.674347", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "fad8fcf4e70bf3589fbcbd40db4df5e2", "score": "0.6682223", "text": "def allowed_params\n # Only this one attribute will be allowed, no hacking\n params.require(:user).permit(:username)\n end", "title": "" }, { "docid": "b453d9a67af21a3c28a62e1848094a41", "score": "0.6636527", "text": "def strong_params\n params.require(:kpi).permit(param_whitelist)\n end", "title": "" }, { "docid": "2c8e2be272a55477bfc4c0dfc6baa7a7", "score": "0.66291976", "text": "def strong_params\n params.require(:community_member).permit(param_whitelist)\n end", "title": "" }, { "docid": "1685d76d665d2c26af736aa987ac8b51", "score": "0.66258276", "text": "def permitted_params\n params.permit!\n end", "title": "" }, { "docid": "77f5795d1b9e0d0cbd4ea67d02b5ab7f", "score": "0.65625846", "text": "def safe_params\n params.except(:host, :port, :protocol).permit!\n end", "title": "" }, { "docid": "cc1542a4be8f3ca5dc359c2eb3fb7d18", "score": "0.6491194", "text": "def strong_params\n params.require(:message).permit(param_whitelist)\n end", "title": "" }, { "docid": "e291b3969196368dd4f7080a354ebb08", "score": "0.6477825", "text": "def permitir_parametros\n \t\tparams.permit!\n \tend", "title": "" }, { "docid": "2d2af8e22689ac0c0408bf4cb340d8c8", "score": "0.64526874", "text": "def allowed_params\n params.require(:user).permit(:name, :email)\n end", "title": "" }, { "docid": "236e1766ee20eef4883ed724b83e4176", "score": "0.64001405", "text": "def param_whitelist\n [\n :name,\n :tagline, :contact, :summary, :stage,\n :website, :facebook, :twitter, :linkedin, :github,\n :founded_at,\n community_ids: [],\n sectors: [\n :commercial,\n :social,\n :research\n ],\n privacy: [\n contact: [],\n kpis: []\n ],\n permission: [\n listings: [],\n profile: [],\n posts: [],\n kpis: []\n ],\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n end", "title": "" }, { "docid": "b29cf4bc4a27d4b199de5b6034f9f8a0", "score": "0.63810205", "text": "def safe_params\n params\n .require( self.class.model_class.name.underscore.to_sym )\n .permit( self.class.params_list )\n end", "title": "" }, { "docid": "bfb292096090145a067e31d8fef10853", "score": "0.63634825", "text": "def param_whitelist\n whitelist = [\n :title, :description, :skills,\n :positions, :category, :salary_period,\n :started_at, :finished_at,\n :deadline,\n :salary_min, :salary_max, :hours,\n :equity_min, :equity_max,\n :privacy,\n :owner_id, :owner_type,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:owner_id)\n whitelist.delete(:owner_type)\n end\n \n whitelist\n end", "title": "" }, { "docid": "6bf3ed161b62498559a064aea569250a", "score": "0.633783", "text": "def require_params\n return nil\n end", "title": "" }, { "docid": "b4c9587164188c64f14b71403f80ca7c", "score": "0.6336759", "text": "def sanitize_params!\n request.sanitize_params!\n end", "title": "" }, { "docid": "b63e6e97815a8745ab85cd8f7dd5b4fb", "score": "0.6325718", "text": "def excluded_from_filter_parameters; end", "title": "" }, { "docid": "38bec0546a7e4cbf4c337edbee67d769", "score": "0.631947", "text": "def user_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password)\n end", "title": "" }, { "docid": "37d1c971f6495de3cdd63a3ef049674e", "score": "0.63146484", "text": "def param_whitelist\n whitelist = [\n :name,\n :overview,\n :website, :facebook, :twitter,\n :privacy,\n :avatar_id, :community_id, :category_ids,\n location: [\n :description,\n :street,\n :city,\n :state,\n :zip,\n :country,\n :latitude,\n :longitude\n ]\n ]\n \n unless action_name === 'create'\n whitelist.delete(:community_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "5ec018b4a193bf3bf8902c9419279607", "score": "0.63137317", "text": "def user_params # contains strong parameters\n params.require(:user).permit(:name, :email, :password,\n :password_confirmation)\n # strong parameters disallows any post information that is not permitted (admin security) when signing_up\n # so not all users will get admin access by hacking params using curl\n end", "title": "" }, { "docid": "91bfe6d464d263aa01e776f24583d1d9", "score": "0.6306224", "text": "def permitir_parametros\n params.permit!\n end", "title": "" }, { "docid": "e012d7306b402a37012f98bfd4ffdb10", "score": "0.6301168", "text": "def strong_params\n params.require(:team).permit(param_whitelist)\n end", "title": "" }, { "docid": "157e773497f78353899720ad034a906a", "score": "0.63000035", "text": "def white_list_params\n params.require(:white_list).permit(:ip, :comment)\n end", "title": "" }, { "docid": "8c384af787342792f0efc7911c3b2469", "score": "0.629581", "text": "def whitelisted_vegetable_params\n params.require(:vegetable).permit(:name, :color, :rating, :latin_name)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "0f69d0204a0c9a5e4a336cbb3dccbb2c", "score": "0.62926817", "text": "def allowed_params\n params.permit(:campaign_id,:marketer_id,:creator_id,:status)\n end", "title": "" }, { "docid": "9b76b3149ac8b2743f041d1af6b768b5", "score": "0.6280713", "text": "def filter_params\n params.permit(\n\t\t\t\t:name,\n\t\t\t\t:sitedefault,\n\t\t\t\t:opinions,\n\t\t\t\t:contested,\n\t\t\t\t:uncontested,\n\t\t\t\t:initiators,\n\t\t\t\t:comments,\n\t\t\t\t:following,\n\t\t\t\t:bookmarks,\n\t\t\t\t:lone_wolf,\n\t\t\t\t:level_zero,\n\t\t\t\t:level_nonzero,\n\t\t\t\t:private,\n\t\t\t\t:public_viewing,\n\t\t\t\t:public_comments,\n\t\t\t\t:has_parent,\n\t\t\t\t:has_no_parent,\n\t\t\t\t:today,\n\t\t\t\t:last_week,\n\t\t\t\t:last_month,\n\t\t\t\t:last_year,\n\t\t\t\t:sort_by_created_at,\n\t\t\t\t:sort_by_updated_at,\n\t\t\t\t:sort_by_views,\n\t\t\t\t:sort_by_votes,\n\t\t\t\t:sort_by_scores,\n\t\t\t\t:who_id)\n end", "title": "" }, { "docid": "603f4a45e5efa778afca5372ae8a96dc", "score": "0.6271388", "text": "def param_whitelist\n [:role]\n end", "title": "" }, { "docid": "f6399952b4623e5a23ce75ef1bf2af5a", "score": "0.6266194", "text": "def allowed_params\n\t\tparams.require(:password).permit(:pass)\n\tend", "title": "" }, { "docid": "37c5d0a9ebc5049d7333af81696608a0", "score": "0.6256044", "text": "def safe_params\n\t\tparams.require(:event).permit(:title, :event_date, :begti, :endti, :comments, :has_length, :is_private)\n\tend", "title": "" }, { "docid": "505e334c1850c398069b6fb3948ce481", "score": "0.62550515", "text": "def sanitise!\n @params.keep_if {|k,v| whitelisted? k}\n end", "title": "" }, { "docid": "6c4620f5d8fd3fe3641e0474aa7014b2", "score": "0.62525266", "text": "def white_listed_parameters\n params\n .require(:movie)\n .permit(:title, :description, :year_released)\n end", "title": "" }, { "docid": "d14bb69d2a7d0f302032a22bb9373a16", "score": "0.6234781", "text": "def protect_my_params\n return params.require(:photo).permit(:title, :artist, :url)\n\tend", "title": "" }, { "docid": "5629f00db37bf403d0c58b524d4c3c37", "score": "0.62278074", "text": "def filtered_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "d370098b1b3289dbd04bf1c073f2645b", "score": "0.6226693", "text": "def allow_params\n params.permit(:id, :email, :password)\n end", "title": "" }, { "docid": "fde8b208c08c509fe9f617229dfa1a68", "score": "0.6226605", "text": "def strong_params\n params.require(:thread).permit(param_whitelist)\n end", "title": "" }, { "docid": "78cbf68c3936c666f1edf5f65e422b6f", "score": "0.6226114", "text": "def whitelisted_user_params\n if params[:user]\n params.require(:user).permit(:email, :username, :password)\n else\n { :email => params[:email],\n :username => params[:username],\n :password => params[:password] }\n end\nend", "title": "" }, { "docid": "d38efafa6be65b2f7da3a6d0c9b7eaf5", "score": "0.6200643", "text": "def roaster_params\n # Returns a sanitized hash of the params with nothing extra\n params.permit(:name, :email, :img_url, :password_digest, :address, :website, :phone, :latitude, :longitutde, :description)\n end", "title": "" }, { "docid": "d724124948bde3f2512c5542b9cdea74", "score": "0.61913997", "text": "def alpha_provider_params\n params.require(:alpha_provider).permit!\n end", "title": "" }, { "docid": "d18a36785daed9387fd6d0042fafcd03", "score": "0.61835426", "text": "def white_listed_parameters\n params\n .require(:company)\n .permit(:company_name, :company_avatar)\n end", "title": "" }, { "docid": "36956168ba2889cff7bf17d9f1db41b8", "score": "0.6179986", "text": "def set_param_whitelist(*param_list)\n self.param_whitelist = param_list\n end", "title": "" }, { "docid": "07bc0e43e1cec1a821fb2598d6489bde", "score": "0.61630195", "text": "def accept_no_params\n accept_params {}\n end", "title": "" }, { "docid": "fc4b1364974ea591f32a99898cb0078d", "score": "0.6160931", "text": "def request_params\n params.permit(:username, :password, :user_id, :status, :accepted_by, :rejected_by)\n end", "title": "" }, { "docid": "13e3cfbfe510f765b5944667d772f453", "score": "0.6155551", "text": "def admin_security_params\n params.require(:security).permit(:name, :url, :commonplace_id)\n end", "title": "" }, { "docid": "84bd386d5b2a0d586dca327046a81a63", "score": "0.61542404", "text": "def good_params\n permit_params\n end", "title": "" }, { "docid": "b9432eac2fc04860bb585f9af0d932bc", "score": "0.61356604", "text": "def wall_params\n params.permit(:public_view, :guest)\n end", "title": "" }, { "docid": "f2342adbf71ecbb79f87f58ff29c51ba", "score": "0.61342114", "text": "def housing_request_params\n params[:housing_request].permit! #allow all parameters for now\n end", "title": "" }, { "docid": "8fa507ebc4288c14857ace21acf54c26", "score": "0.61188847", "text": "def strong_params\n # to dooo\n end", "title": "" }, { "docid": "9292c51af27231dfd9f6478a027d419e", "score": "0.61140966", "text": "def domain_params\n params[:domain].permit!\n end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "fc43ee8cb2466a60d4a69a04461c601a", "score": "0.611406", "text": "def check_params; true; end", "title": "" }, { "docid": "a3aee889e493e2b235619affa62f39c3", "score": "0.61107725", "text": "def user_params\n params.permit(:full_name, :email, :job, :about, :max_search_distance,\n :website_url, :linkedin_url,\n :behance_url, :github_url, :stackoverflow_url)\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "585f461bf01ed1ef8d34fd5295a96dca", "score": "0.61038506", "text": "def param_whitelist\n whitelist = [\n :message,\n :privacy,\n :author_id\n ]\n \n unless action_name === 'create'\n whitelist.delete(:author_id)\n end\n \n whitelist\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "b63ab280629a127ecab767e2f35b8ef0", "score": "0.6097247", "text": "def params\n @_params ||= super.tap {|p| p.permit!}.to_unsafe_h\n end", "title": "" }, { "docid": "677293afd31e8916c0aee52a787b75d8", "score": "0.60860336", "text": "def newsletter_params\n params.permit!.except(:action, :controller, :_method, :authenticity_token)\n end", "title": "" }, { "docid": "e50ea3adc222a8db489f0ed3d1dce35b", "score": "0.60855556", "text": "def params_without_facebook_data\n params.except(:signed_request).permit!.to_hash\n end", "title": "" }, { "docid": "b7ab5b72771a4a2eaa77904bb0356a48", "score": "0.608446", "text": "def search_params\n params.permit!.except(:controller, :action, :format)\n end", "title": "" }, { "docid": "b2841e384487f587427c4b35498c133f", "score": "0.6076753", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "3f5347ed890eed5ea86b70281803d375", "score": "0.60742563", "text": "def user_params\n params.permit!\n end", "title": "" }, { "docid": "0c8779b5d7fc10083824e36bfab170de", "score": "0.60677326", "text": "def white_base_params\n params.fetch(:white_base, {}).permit(:name)\n end", "title": "" }, { "docid": "7646659415933bf751273d76b1d11b40", "score": "0.60666215", "text": "def whitelisted_observation_params\n return unless params[:observation]\n\n params[:observation].permit(whitelisted_observation_args)\n end", "title": "" }, { "docid": "fa0608a79e8d27c2a070862e616c8c58", "score": "0.6065763", "text": "def vampire_params\n # whitelist all of the vampire attributes so that your forms work!\n end", "title": "" }, { "docid": "a3dc8b6db1e6584a8305a96ebb06ad21", "score": "0.60655254", "text": "def need_params\n end", "title": "" }, { "docid": "4f8205e45790aaf4521cdc5f872c2752", "score": "0.6064794", "text": "def search_params\n params.permit(:looking_for, :utf8, :authenticity_token, :min_age,\n :max_age, :sort_by, likes:[])\n end", "title": "" }, { "docid": "e39a8613efaf5c6ecf8ebd58f1ac0a06", "score": "0.6062697", "text": "def permitted_params\n params.permit :utf8, :_method, :authenticity_token, :commit, :id,\n :encrypted_text, :key_size\n end", "title": "" }, { "docid": "c436017f4e8bd819f3d933587dfa070a", "score": "0.60620916", "text": "def filtered_parameters; end", "title": "" }, { "docid": "d6886c65f0ba5ebad9a2fe5976b70049", "score": "0.60562736", "text": "def allow_params_authentication!\n request.env[\"devise.allow_params_authentication\"] = true\n end", "title": "" }, { "docid": "96ddf2d48ead6ef7a904c961c284d036", "score": "0.60491294", "text": "def user_params\n permit = [\n :email, :password, :password_confirmation,\n :image, :name, :nickname, :oauth_token,\n :oauth_expires_at, :provider, :birthday\n ]\n params.permit(permit)\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "f78d6fd9154d00691c34980d7656b3fa", "score": "0.60490465", "text": "def authorize_params\n super.tap do |params|\n %w[display with_offical_account forcelogin].each do |v|\n if request.params[v]\n params[v.to_sym] = request.params[v]\n end\n end\n end\n end", "title": "" }, { "docid": "75b7084f97e908d1548a1d23c68a6c4c", "score": "0.6046521", "text": "def allowed_params\n params.require(:sea).permit(:name, :temperature, :bio, :mood, :image_url, :favorite_color, :scariest_creature, :has_mermaids)\n end", "title": "" }, { "docid": "080d2fb67f69228501429ad29d14eb29", "score": "0.6041768", "text": "def filter_user_params\n params.require(:user).permit(:name, :email, :password, :password_confirmation)\n end", "title": "" }, { "docid": "aa0aeac5c232d2a3c3f4f7e099e7e6ff", "score": "0.60346854", "text": "def parameters\n params.permit(permitted_params)\n end", "title": "" }, { "docid": "0bdcbbe05beb40f7a08bdc8e57b7eca8", "score": "0.6030552", "text": "def filter_params\n end", "title": "" }, { "docid": "cf73c42e01765dd1c09630007357379c", "score": "0.6024842", "text": "def params_striper\n\t \tparams[:user].delete :moonactor_ability\n\t end", "title": "" }, { "docid": "793abf19d555fb6aa75265abdbac23a3", "score": "0.6021606", "text": "def user_params\n if admin_user?\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter, :active, :admin, :receive_customer_inquiry)\n else\n # Don't allow non-admin users to hack the parameters and give themselves admin security; self created records automatically set to active\n params.require(:user).permit(:email, :password, :password_confirmation, :name, :address_1, :address_2, :apt_number, :city, :state_id, :zip_code, :newsletter)\n end\n end", "title": "" }, { "docid": "2e70947f467cb6b1fda5cddcd6dc6304", "score": "0.6019679", "text": "def strong_params(wimpy_params)\n ActionController::Parameters.new(wimpy_params).permit!\nend", "title": "" }, { "docid": "2a11104d8397f6fb79f9a57f6d6151c7", "score": "0.6017253", "text": "def user_params\n sanitize params.require(:user).permit(:username, :password, :password_confirmation, :display_name, :about_me, :avatar, :current_password, :banned, :ban_message)\n end", "title": "" }, { "docid": "a83bc4d11697ba3c866a5eaae3be7e05", "score": "0.60145336", "text": "def user_params\n\t params.permit(\n\t :name,\n\t :email,\n\t :password\n\t \t )\n\t end", "title": "" }, { "docid": "2aa7b93e192af3519f13e9c65843a6ed", "score": "0.60074294", "text": "def user_params\n params[:user].permit!\n end", "title": "" }, { "docid": "9c8cd7c9e353c522f2b88f2cf815ef4e", "score": "0.6006753", "text": "def case_sensitive_params\n params.require(:case_sensitive).permit(:name)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "45b8b091f448e1e15f62ce90b681e1b4", "score": "0.6005122", "text": "def allowed_params\n params.require(:user).permit(:email, :password, :role, :first_name, :last_name, :password_confirmation)\n end", "title": "" }, { "docid": "9736586d5c470252911ec58107dff461", "score": "0.60048765", "text": "def params_without_classmate_data\n params.clone.permit!.except(*(CLASSMATE_PARAM_NAMES + DEBUG_PARAMS))\n end", "title": "" }, { "docid": "e7cad604922ed7fad31f22b52ecdbd13", "score": "0.60009843", "text": "def member_params\n # byebug\n params.require(:member).permit(\n :first_name, \n :last_name, \n :username, \n :email, \n :password, \n :image, \n :family_size, \n :address)\n\n end", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "58ad32a310bf4e3c64929a860569b3db", "score": "0.6000742", "text": "def user_params\n\t\tparams.require(:user).permit!\n\tend", "title": "" }, { "docid": "f70301232281d001a4e52bd9ba4d20f5", "score": "0.6000161", "text": "def room_allowed_params\n end", "title": "" }, { "docid": "2e6de53893e405d0fe83b9d18b696bd5", "score": "0.599852", "text": "def user_params\n params.require(:user).permit(:username, :password, :realname, :email, :publicvisible)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "19bd0484ed1e2d35b30d23b301d20f7c", "score": "0.59984183", "text": "def unsafe_params\n ActiveSupport::Deprecation.warn(\"Using `unsafe_params` isn't a great plan\", caller(1))\n params.dup.tap(&:permit!)\n end", "title": "" }, { "docid": "a50ca4c82eaf086dcbcc9b485ebd4261", "score": "0.59947807", "text": "def white_listed_parameters\n params\n .require(:story)\n .permit(:title, :link, :upvotes, :category)\n end", "title": "" }, { "docid": "0f53610616212c35950b45fbcf9f5ad4", "score": "0.5993962", "text": "def user_params(params)\n\tparams.permit(:email, :password, :name, :blurb)\n end", "title": "" }, { "docid": "b545ec7bfd51dc43b982b451a715a538", "score": "0.5992739", "text": "def user_params\n params_allowed = %i[email password password_confirmation is_admin]\n params.require(:user).permit(params_allowed)\n end", "title": "" }, { "docid": "0b704016f3538045eb52c45442e7f704", "score": "0.59911275", "text": "def admin_params\n filtered_params = params.require(:admin).permit(:display_name, :email, :password, :password_confirmation)\n if filtered_params[:password] == \"\"\n filtered_params.delete(:password)\n filtered_params.delete(:password_confirmation)\n end\n filtered_params\n end", "title": "" }, { "docid": "6af3741c8644ee63d155db59be10a774", "score": "0.59906775", "text": "def allowed_params\n %i[\n lock_version\n comments\n organization\n job_title\n pronouns\n year_of_birth\n gender\n ethnicity\n opted_in\n invite_status\n acceptance_status\n registered\n registration_type\n can_share\n registration_number\n can_photo\n can_record\n name\n name_sort_by\n name_sort_by_confirmed\n pseudonym\n pseudonym_sort_by\n pseudonym_sort_by_confirmed\n ]\n end", "title": "" } ]
b0e2bbdd646cb94f792ca2c9ccade303
Returns the hash value dumped to JSON.
[ { "docid": "094a881fedfa10406af811e6891293a3", "score": "0.0", "text": "def convert_before_write(value)\n value.to_json\n end", "title": "" } ]
[ { "docid": "591e6b17363dd41043a0033dec7d99d2", "score": "0.7765287", "text": "def hashed\n Digest::SHA256.hexdigest(to_hash.to_json)\n end", "title": "" }, { "docid": "2b6d2cb1d0e4d8a3632f2583e3932881", "score": "0.7622292", "text": "def dump\n JSON.dump(@hash)\n end", "title": "" }, { "docid": "6fd3ea2493932dddde7275395ecb7bf7", "score": "0.73727244", "text": "def ruby_hash_to_json_string(hash)\n hash.to_json\n end", "title": "" }, { "docid": "a22b4bedcf60c238508bf71a7cbbc263", "score": "0.7359068", "text": "def hash\n to_json.hash\n end", "title": "" }, { "docid": "a22b4bedcf60c238508bf71a7cbbc263", "score": "0.7359068", "text": "def hash\n to_json.hash\n end", "title": "" }, { "docid": "de360587d6d5b0cd5d0b47b7dbe67a44", "score": "0.72627395", "text": "def to_json\n return to_hash.to_json\n end", "title": "" }, { "docid": "01f7a3e54adcfa63f7b0b18d471f10d2", "score": "0.72408247", "text": "def to_s; @hash end", "title": "" }, { "docid": "eab970981f674694c94e1856e38d1eca", "score": "0.71856624", "text": "def hash2json(hash)\n JSON.generate(hash)\n end", "title": "" }, { "docid": "76c82ba2d29e1890ce89c3f856787242", "score": "0.7173868", "text": "def hash\n return to_s.hash\n end", "title": "" }, { "docid": "76c82ba2d29e1890ce89c3f856787242", "score": "0.7173868", "text": "def hash\n return to_s.hash\n end", "title": "" }, { "docid": "76c82ba2d29e1890ce89c3f856787242", "score": "0.7173868", "text": "def hash\n return to_s.hash\n end", "title": "" }, { "docid": "9523469aaeae905c4ca8f09e7dd4e18d", "score": "0.7133842", "text": "def to_s\n h = to_h\n h[:digest] = digest\n Base64.urlsafe_encode64 h.to_json\n end", "title": "" }, { "docid": "8d8f02e524dd0f35245b36010770e6eb", "score": "0.7131946", "text": "def convert_hash_to_json( hash )\n JSON.generate( hash )\n end", "title": "" }, { "docid": "8d8f02e524dd0f35245b36010770e6eb", "score": "0.7131946", "text": "def convert_hash_to_json( hash )\n JSON.generate( hash )\n end", "title": "" }, { "docid": "e5de4c65753e05d0c5a724b30ae125b0", "score": "0.71318007", "text": "def serialize_to_json\n hash = serialize_to_hash()\n\n JSON.pretty_generate(hash)\n end", "title": "" }, { "docid": "4bd1d1738f42f3bd20bdf581e436cfff", "score": "0.71163154", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "4bd1d1738f42f3bd20bdf581e436cfff", "score": "0.71163154", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "4bd1d1738f42f3bd20bdf581e436cfff", "score": "0.71163154", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "20a269d9209024b80cb0b66e89cf1bb3", "score": "0.7112033", "text": "def to_json\n #JSON.fast_generate(to_hash)\n JSON.pretty_generate(to_hash)\n end", "title": "" }, { "docid": "20a269d9209024b80cb0b66e89cf1bb3", "score": "0.7112033", "text": "def to_json\n #JSON.fast_generate(to_hash)\n JSON.pretty_generate(to_hash)\n end", "title": "" }, { "docid": "9128c0efc5f85871d54ed19dc516f490", "score": "0.7103912", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "9128c0efc5f85871d54ed19dc516f490", "score": "0.7103912", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "9128c0efc5f85871d54ed19dc516f490", "score": "0.7103912", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "9128c0efc5f85871d54ed19dc516f490", "score": "0.7103912", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "9128c0efc5f85871d54ed19dc516f490", "score": "0.7103912", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "9128c0efc5f85871d54ed19dc516f490", "score": "0.7103912", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "9128c0efc5f85871d54ed19dc516f490", "score": "0.7103912", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "9128c0efc5f85871d54ed19dc516f490", "score": "0.7103912", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "748223766d73a93149a626d74306e4dd", "score": "0.71033764", "text": "def to_hash\n @json\n end", "title": "" }, { "docid": "8a0e7a713b52a45ff590a5fe570f1a31", "score": "0.7088215", "text": "def hash\r\n to_s.hash\r\n end", "title": "" }, { "docid": "ea0b0994a284c599f799ff05d1ba15ed", "score": "0.7085328", "text": "def to_json\n JSON.dump(to_hash)\n end", "title": "" }, { "docid": "66abb236ea7566762392b7d351825606", "score": "0.70678306", "text": "def to_json\n JSON.generate(to_hash)\n end", "title": "" }, { "docid": "66abb236ea7566762392b7d351825606", "score": "0.70678306", "text": "def to_json\n JSON.generate(to_hash)\n end", "title": "" }, { "docid": "cd2abbc958e2d6fba0930d47208fd20f", "score": "0.704946", "text": "def hash\n to_s.hash\n end", "title": "" }, { "docid": "cd2abbc958e2d6fba0930d47208fd20f", "score": "0.704946", "text": "def hash\n to_s.hash\n end", "title": "" }, { "docid": "cd2abbc958e2d6fba0930d47208fd20f", "score": "0.704946", "text": "def hash\n to_s.hash\n end", "title": "" }, { "docid": "1c0bbd17a565eb5d1204367e8ecc3ff2", "score": "0.7040973", "text": "def to_s\n\t\thash_string\n\tend", "title": "" }, { "docid": "ee3c459be420c6bbf69c991f69916cb4", "score": "0.70394385", "text": "def hash_to_json(data)\n JSON.generate(data)\nend", "title": "" }, { "docid": "af92afe3f249d9c5187167fce71c123b", "score": "0.70307", "text": "def to_json\n JSON.generate(to_hash)\n end", "title": "" }, { "docid": "3e48d78391045e8a0e2eb05680f1bcb2", "score": "0.70120823", "text": "def hash\n @hash_value\n end", "title": "" }, { "docid": "939f2c909301d24cdd0c38ec2f5bedbe", "score": "0.70023596", "text": "def hash\r\n to_s.hash\r\n end", "title": "" }, { "docid": "1d736abdabd9452bed3371f72193d1b9", "score": "0.70003057", "text": "def to_json\n deserialize_if_necessary!\n\n json_hash = to_json_hash\n as_string = JSON.generate(json_hash, :allow_nan => true)\n as_string = as_string.encode(Encoding::UTF_8) if as_string.respond_to?(:encode)\n\n as_string\n end", "title": "" }, { "docid": "73a97056b5ad3a056ed06777a3fa8084", "score": "0.6978822", "text": "def to_json\n JSON.pretty_generate( to_hash, :space => '' )\n end", "title": "" }, { "docid": "73a97056b5ad3a056ed06777a3fa8084", "score": "0.6978822", "text": "def to_json\n JSON.pretty_generate( to_hash, :space => '' )\n end", "title": "" }, { "docid": "9d74be1a472988c508a0c5a2b4dfd679", "score": "0.69778246", "text": "def to_json\n JSON.fast_generate(as_hash)\n end", "title": "" }, { "docid": "6e99613544e37e0f923dbc81ab96abf4", "score": "0.6965095", "text": "def hash\n to_s.hash\n end", "title": "" }, { "docid": "6e99613544e37e0f923dbc81ab96abf4", "score": "0.6965095", "text": "def hash\n to_s.hash\n end", "title": "" }, { "docid": "a41cff38fa43903dae1e45522b569e4b", "score": "0.69482577", "text": "def to_json\n Oj.dump(to_hash)\n end", "title": "" }, { "docid": "fedac223c76922acc6eefbff57759431", "score": "0.69470084", "text": "def as_json\n as_hash.to_json\n end", "title": "" }, { "docid": "e19637babcb060451cb5ac2e06e14f85", "score": "0.69106257", "text": "def to_json\n JSON.generate(to_hash).gsub('\",\"', '\", \"')\n end", "title": "" }, { "docid": "d5518994496eeba583ff9efa71b0999e", "score": "0.6884817", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "d5518994496eeba583ff9efa71b0999e", "score": "0.6884817", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "d5518994496eeba583ff9efa71b0999e", "score": "0.6884817", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "d5518994496eeba583ff9efa71b0999e", "score": "0.6884817", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "d5518994496eeba583ff9efa71b0999e", "score": "0.6884817", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "d5518994496eeba583ff9efa71b0999e", "score": "0.6884817", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "d5518994496eeba583ff9efa71b0999e", "score": "0.6884817", "text": "def to_json\n to_hash.to_json\n end", "title": "" }, { "docid": "36da72b2b3ffe685f718a0f93601d946", "score": "0.68722427", "text": "def hash\n result['hash']\n end", "title": "" }, { "docid": "f6c2dcf722bb5e8125235e73a2162592", "score": "0.68693525", "text": "def hash\n value.hash\n end", "title": "" }, { "docid": "f6c2dcf722bb5e8125235e73a2162592", "score": "0.68693525", "text": "def hash\n value.hash\n end", "title": "" }, { "docid": "7ae0b86468d3f907388e81156c16682d", "score": "0.6864178", "text": "def to_json\n self.to_hash.to_json\n end", "title": "" }, { "docid": "7ae0b86468d3f907388e81156c16682d", "score": "0.6864178", "text": "def to_json\n self.to_hash.to_json\n end", "title": "" }, { "docid": "7ae0b86468d3f907388e81156c16682d", "score": "0.6864178", "text": "def to_json\n self.to_hash.to_json\n end", "title": "" }, { "docid": "aca354430ddf4b2b06fce55d3b91b643", "score": "0.6859211", "text": "def to_hash\n @hash\n end", "title": "" }, { "docid": "b55304c454583ca15062adfeb226daf8", "score": "0.6852185", "text": "def json_encoded\n self.to_hash.to_json\n end", "title": "" }, { "docid": "a9e090a8e1120aea2de22b544562daea", "score": "0.68516695", "text": "def to_json\n self.to_hash.to_json\n end", "title": "" }, { "docid": "a9e090a8e1120aea2de22b544562daea", "score": "0.68516695", "text": "def to_json\n self.to_hash.to_json\n end", "title": "" }, { "docid": "a9e090a8e1120aea2de22b544562daea", "score": "0.68516695", "text": "def to_json\n self.to_hash.to_json\n end", "title": "" }, { "docid": "a9e090a8e1120aea2de22b544562daea", "score": "0.68516695", "text": "def to_json\n self.to_hash.to_json\n end", "title": "" }, { "docid": "a9e090a8e1120aea2de22b544562daea", "score": "0.68516695", "text": "def to_json\n self.to_hash.to_json\n end", "title": "" }, { "docid": "6c44ccafd4664d68672024e164451c45", "score": "0.68474966", "text": "def to_json\n JSON.pretty_generate(to_hash)\n end", "title": "" }, { "docid": "b59c3fe5d09fe1a4d9f369ed41b57c06", "score": "0.683876", "text": "def hash\n @value.hash\n end", "title": "" }, { "docid": "394b85e42986f180a752d32aaae96e17", "score": "0.6827721", "text": "def to_hash\n @hash\n end", "title": "" }, { "docid": "394b85e42986f180a752d32aaae96e17", "score": "0.6827721", "text": "def to_hash\n @hash\n end", "title": "" }, { "docid": "394b85e42986f180a752d32aaae96e17", "score": "0.6827721", "text": "def to_hash\n @hash\n end", "title": "" }, { "docid": "746d337a7ccaf62f85f7ad0422940d72", "score": "0.68275803", "text": "def to_s\n @hash.inspect\n end", "title": "" }, { "docid": "850956bc885c409d99dcc775d9569edd", "score": "0.6809616", "text": "def to_json\n JSON.pretty_generate(to_hash)\n end", "title": "" }, { "docid": "850956bc885c409d99dcc775d9569edd", "score": "0.6809616", "text": "def to_json\n JSON.pretty_generate(to_hash)\n end", "title": "" }, { "docid": "4510677a0898812399dd3733bd61e5e7", "score": "0.6786681", "text": "def hash\n @value.hash\n end", "title": "" }, { "docid": "4510677a0898812399dd3733bd61e5e7", "score": "0.6786681", "text": "def hash\n @value.hash\n end", "title": "" }, { "docid": "4510677a0898812399dd3733bd61e5e7", "score": "0.6786681", "text": "def hash\n @value.hash\n end", "title": "" }, { "docid": "01955f8c089a56550d880c69af94e930", "score": "0.6780136", "text": "def to_json\n return self.to_hash.to_json\n end", "title": "" }, { "docid": "43b0bbf74f6c526fca47e5c34bd71d2d", "score": "0.67768854", "text": "def get_hash\n @hash\n end", "title": "" }, { "docid": "af32cacd1bc91e56f54c6c23b4cd1c94", "score": "0.677476", "text": "def hash\n value.hash\n end", "title": "" }, { "docid": "c99e1d0fad6c674e18db6fddbdb0503b", "score": "0.67728114", "text": "def hash\n self.to_s.hash\n end", "title": "" }, { "docid": "fda0b304cc963426502d3266e8b06e05", "score": "0.6768068", "text": "def to_s\n @hash.to_s\n end", "title": "" }, { "docid": "b759be04b60deb58ca56af8a99c3495e", "score": "0.6763513", "text": "def to_s\n @raw_hash\n end", "title": "" }, { "docid": "477e7a23b19002b9f13a6647229488fc", "score": "0.67621547", "text": "def json\n # Generate and replace what become double escaped '\\\\u' UNICODE\n # escapes with single '\\u' escapes. This is a hack but is\n # reasonably safe given that 'u' isn't normally escaped. The\n # alterantive would be to hack JSON package or do the JSON\n # formatting ourselves. Ideally JSON package would support\n # serialization using unicode escapes for the non-printable,\n # non-friendly chars. As of 1.6.1 it doesn't.\n JSON.pretty_generate( hash_to_json_object ).gsub( /\\\\\\\\u/, '\\u' )\n end", "title": "" }, { "docid": "979639af810ffbe15d19688759723160", "score": "0.67564714", "text": "def serialize(hash); end", "title": "" }, { "docid": "979639af810ffbe15d19688759723160", "score": "0.67564714", "text": "def serialize(hash); end", "title": "" }, { "docid": "979639af810ffbe15d19688759723160", "score": "0.67564714", "text": "def serialize(hash); end", "title": "" }, { "docid": "979639af810ffbe15d19688759723160", "score": "0.67564714", "text": "def serialize(hash); end", "title": "" }, { "docid": "979639af810ffbe15d19688759723160", "score": "0.67564714", "text": "def serialize(hash); end", "title": "" }, { "docid": "979639af810ffbe15d19688759723160", "score": "0.67564714", "text": "def serialize(hash); end", "title": "" }, { "docid": "49b520cb3f544be287b4b96d7fb89209", "score": "0.6753104", "text": "def encoded\n self.to_hash.to_json\n end", "title": "" }, { "docid": "6ebaf69a8740240593b37f7dafb06086", "score": "0.67441964", "text": "def stringify_hash(hash)\n JSON.parse(JSON.dump(hash))\n end", "title": "" }, { "docid": "26edce11e277519dcda2a4280b07b43c", "score": "0.6738526", "text": "def json_serialize\n @value\n end", "title": "" }, { "docid": "54ab342b2208478003cd3635782a6eb9", "score": "0.673282", "text": "def to_s\n JSON.pretty_generate to_hash\n end", "title": "" }, { "docid": "fb057fcfe167e321538272b9e7a81a4d", "score": "0.6732265", "text": "def serialized_json\n ActiveSupport::JSON.encode(serializable_hash)\n end", "title": "" }, { "docid": "26b7e39779d9f792f02d7d4c5f925c78", "score": "0.6720367", "text": "def to_hash\n @value\n end", "title": "" }, { "docid": "1f553f8638c7e59afc7fd7555da1d0bb", "score": "0.6719802", "text": "def to_json\n JSON.generate(to_h)\n end", "title": "" } ]
64b60d52c13c96a60d6906cbce6f824b
DELETE /blocs/1 DELETE /blocs/1.json
[ { "docid": "5647fc053cdb4bb0742cca46e3cdaa6e", "score": "0.6887383", "text": "def destroy\n @bloc = Bloc.find(params[:id])\n @bloc.destroy\n\n respond_to do |format|\n format.html { redirect_to blocs_url }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.65437067", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "7f26eaa8ebc542e65f5515a94a5225a1", "score": "0.65401304", "text": "def destroy\n @batale_bloc.destroy\n respond_to do |format|\n format.html { redirect_to batale_blocs_url, notice: 'Bloco deletado com sucesso.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "559f455ab4e013f31c330c1a9239e358", "score": "0.6519451", "text": "def destroy\n @bloc.destroy\n respond_to do |format|\n format.html { redirect_to dashboard_show_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ead6b29a29c0902d1ab155c888bb906d", "score": "0.65190905", "text": "def delete_location(id)\n @client.raw('delete', \"/ecommerce/locations/#{id}\")\n end", "title": "" }, { "docid": "45fea0e72b82547cbcd299f48865f6bf", "score": "0.64315087", "text": "def destroy\n @cofee_loc.destroy\n respond_to do |format|\n format.html { redirect_to cofee_locs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.63911015", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "a2fc18d9ce88c960f900b5714969eb5a", "score": "0.6345001", "text": "def delete_location(id)\n return @client.raw(\"delete\", \"/ecommerce/locations/#{id}\")\n end", "title": "" }, { "docid": "faf9b1ec3a056040b2c981a5c9fa1b8a", "score": "0.63188183", "text": "def destroy\n @client = Client.find(params[:id])\n\n @client.locations.each do |location|\n location.delete\n end\n\n @client.destroy\n\n respond_to do |format|\n format.html { redirect_to clients_url}\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "899ca846f3c7da9b6bcb5ba3edee224a", "score": "0.6302615", "text": "def destroy\n @beacon.destroy\n respond_to do |format|\n format.html { redirect_to beacons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "899ca846f3c7da9b6bcb5ba3edee224a", "score": "0.6302615", "text": "def destroy\n @beacon.destroy\n respond_to do |format|\n format.html { redirect_to beacons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "86511abc6905bacd3790efa89231a0e8", "score": "0.63019294", "text": "def destroy\n @geoloc = Geoloc.find(params[:id])\n @geoloc.destroy\n\n respond_to do |format|\n format.html { redirect_to geolocs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2148e2fd9383c12872890f51efee3615", "score": "0.62602174", "text": "def delete\n begin\n task_id = \"#{@file}\".gsub(/\\.\\/singularity\\//, \"\").gsub(/\\.json/, \"\")\n # delete the request\n RestClient.delete \"#{@uri}/api/requests/request/#{task_id}\"\n puts \"#{task_id} DELETED\"\n rescue\n puts \"#{task_id} #{$!.response}\"\n end\n end", "title": "" }, { "docid": "5b22920d931949e6c08fc758420043b8", "score": "0.6258652", "text": "def destroy\n @dust_bath.destroy\n respond_to do |format|\n format.html { redirect_to dust_baths_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0b24cbc6495df3923ea7679acbcd8deb", "score": "0.62450415", "text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend", "title": "" }, { "docid": "466dcdc90d519bc0ec581215a446787d", "score": "0.6235159", "text": "def destroy\n @btoe_bloc.comments.each(&:destroy) if @btoe_bloc.comments?\n @btoe_bloc.destroy\n respond_to do |format|\n format.html { redirect_to btoe_blocs_url, notice: 'Bloco deletado com sucesso.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.62221843", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "9c8ef0b4313fef9d26c4290371bc530d", "score": "0.6219094", "text": "def delete!\n client.delete(:path => base_path)\n nil\n end", "title": "" }, { "docid": "29777cd6a4990d2a06e2c3e47a0d2571", "score": "0.6218129", "text": "def destroy\n @bloom.destroy\n respond_to do |format|\n format.html { redirect_to blooms_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "773e5d611adeb09776f9c841e1b876cc", "score": "0.62168866", "text": "def delete_json(path, params = {}, headers = {})\n json_request(:delete, path, params, headers)\n end", "title": "" }, { "docid": "822ddea2e45bf78350003645efcbdb54", "score": "0.620907", "text": "def delete uri, args = {}; Request.new(DELETE, uri, args).execute; end", "title": "" }, { "docid": "9106867cee9e8775ba817195d3bc2020", "score": "0.6201509", "text": "def delete_rest(path) \n run_request(:DELETE, create_url(path)) \n end", "title": "" }, { "docid": "543abe66ec55f971c45a98f9051b6f7b", "score": "0.6168192", "text": "def destroy\n @storeloc = Storeloc.find(params[:id])\n @storeloc.itemlocs.each do |loc|\n loc.destroy\n end\n\n @storeloc.destroy\n\n respond_to do |format|\n format.html { redirect_to(storelocs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "47a3c9c28e1fcd0fcae5ea58416b42bd", "score": "0.6165269", "text": "def delete(path)\n api :delete, path\n end", "title": "" }, { "docid": "f2b0d0e6929b2e1a6667cab25ac3e5d0", "score": "0.6163038", "text": "def destroy\n @location = Location.find(params[:id])\n ApplicationController.cluster_decrement(@location)\n @location.destroy\n LocationsType.where(\"location_id=#{params[:id]}\").each{ |lt|\n lt.destroy\n }\n expire_things\n log_changes(nil,\"1 location deleted\")\n respond_to do |format|\n format.html { redirect_to locations_url }\n format.mobile { redirect_to locations_url }\n end\n end", "title": "" }, { "docid": "efee509b9acae37591d5f9a924e97911", "score": "0.61610913", "text": "def destroy\n @blorescrapurl = Blorescrapurl.find(params[:id])\n @blorescrapurl.destroy\n\n respond_to do |format|\n format.html { redirect_to blorescrapurls_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "689893f6d7f36527cd06f06afe1df432", "score": "0.6159424", "text": "def destroy\n @banc_where.destroy\n respond_to do |format|\n format.html { redirect_to banc_wheres_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4da4dd82c73d871c95906ca2a0d70575", "score": "0.6159016", "text": "def destroy\n record = Location.find(params[:id])\n record.destroy\n\n respond_to do |format| \n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2650440f29a3d2d0f3afdb3645b515d9", "score": "0.6157571", "text": "def destroy\n @load_balancer = LoadBalancer.find(params[:id])\n @load_balancer.destroy\n\n respond_to do |format|\n format.html { redirect_to load_balancers_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c57df20292a5feddc9933a08320e90eb", "score": "0.61482865", "text": "def destroy\n @jg_bsb = JgBsb.find(params[:id])\n @jg_bsb.destroy\n\n respond_to do |format|\n format.html { redirect_to jg_bsbs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "96f2d4750d88864f8e0c11059ef1fe5a", "score": "0.6147512", "text": "def destroy\n @biketour = Biketour.find(params[:id])\n @biketour.destroy\n\n respond_to do |format|\n format.html { redirect_to biketours_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "327b23a41aaec8c65344dc7314421034", "score": "0.614736", "text": "def destroy\n @barangay_geographical.destroy\n respond_to do |format|\n format.html { redirect_to barangay_geographicals_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "dd96338a9279ee9dee93eaa1d4675038", "score": "0.6145879", "text": "def destroy\n @blab = Blab.find(params[:id])\n @blab.destroy\n\n respond_to do |format|\n format.html { redirect_to blabs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "704941ad0a0cbb076048447a6f15681d", "score": "0.61331135", "text": "def delete_location(id)\n delete(\"/locations/#{id}\")\n end", "title": "" }, { "docid": "60c254e6b86204bede1a159a2dd5656d", "score": "0.6105097", "text": "def destroy\n @bof = Bof.find(params[:id])\n @bof.destroy\n\n respond_to do |format|\n format.html { redirect_to bofs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4c1c164b581dbae14285797e584e8fb7", "score": "0.6100277", "text": "def delete_tenant_circle(args = {}) \n delete(\"/tenantcircles.json/#{args[:circleId]}\", args)\nend", "title": "" }, { "docid": "a9bebca6aa9e5ae032f7a00d8e3e93c5", "score": "0.6088866", "text": "def destroy\n @b.destroy\n respond_to do |format|\n format.html { redirect_to bs_url, notice: 'B was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "685c8331f4e9538a5e788ea89fbdad92", "score": "0.60850465", "text": "def destroy\n @reportings_b1 = Reportings::B1.find(params[:id])\n @reportings_b1.destroy\n\n respond_to do |format|\n format.html { redirect_to reportings_b1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "74921ff2c7d9c67ed00c4cce152632bc", "score": "0.6076001", "text": "def destroy\n @roadblock = Roadblock.find(params[:id])\n @roadblock.destroy\n\n respond_to do |format|\n format.html { redirect_to roadblocks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c8af6d4917580f10f9c7cbf40fb95bc7", "score": "0.60753274", "text": "def destroy\n @bat.destroy\n respond_to do |format|\n format.html { redirect_to bats_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "582a83ac8562f87ca237430f76e1c580", "score": "0.60669506", "text": "def destroy\n @beacon.destroy\n respond_to do |format|\n format.html { redirect_to central_beacons_url, notice: 'Beacon was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d2375b11675de0e152de07976b50e9c7", "score": "0.606306", "text": "def delete_request(url, queries)\n results = @@client.delete url, queries\n results.to_json\nend", "title": "" }, { "docid": "a1fc3a14318c4b7aac87746d403908ac", "score": "0.60569257", "text": "def destroy\n @bulb.destroy\n respond_to do |format|\n format.html { redirect_to bulbs_url, notice: 'Bulb was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "57b799133d29316426c358002043baa2", "score": "0.60539377", "text": "def delete_rest(path, headers={}) \n run_request(:DELETE, create_url(path), headers) \n end", "title": "" }, { "docid": "c8038aa73e6a770368ddc72d550f133f", "score": "0.6046705", "text": "def test_delete\n delete :delete, params: { alpha2: 'za' }, **{ format: 'json' }\n\n assert_response 200\n assert_equal(countries.first.name, 'South Africa', 'Not working.')\n assert_equal(countries.first.active, false, 'Not working.')\n end", "title": "" }, { "docid": "77cd3b0ef59c6305fffac749fce77b87", "score": "0.60464966", "text": "def destroy\n #non c'è più la route per questo\n #le locations vengono rimosse dai progetti modificando i progetti\n #se viene tolta una location viene fatto un controllo e si cancellano le locations non utilizzate\n @location = Location.find(params[:id])\n check_user\n @location.destroy\n Location.destroy_unused #ne approfitto per fare un po' di pulizia se serve\n\n respond_to do |format|\n format.html { redirect_to url_for current_dataset }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "87cf96bd316db97cc1e5af9eb5487d39", "score": "0.6045292", "text": "def destroy\n @bread = Bread.find(params[:id])\n @bread.destroy\n\n respond_to do |format|\n format.html { redirect_to bread_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d7fff3510584c358f979a13c2858de80", "score": "0.60378826", "text": "def destroy\n @coloc.destroy\n respond_to do |format|\n format.html { redirect_to colocs_url, notice: 'Coloc was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "09f6303f18ce5612216026bdd448d644", "score": "0.6036859", "text": "def api_delete(path)\n api_request(Net::HTTP::Delete.new(path))\n end", "title": "" }, { "docid": "33ae3fbaabb68170de9f95477c22d5d1", "score": "0.60352373", "text": "def delete_json(path)\n retries = 0\n begin\n return resource(path).delete()\n rescue => e\n if e.kind_of?(RestClient::Exception) and e.http_code == 503 and retries < RETRY_503_MAX\n # the G5K REST API sometimes fail with error 503. In that case we should just wait and retry\n puts(\"G5KRest: DELETE #{path} failed with error 503, retrying after #{RETRY_503_SLEEP} seconds\")\n retries += 1\n sleep RETRY_503_SLEEP\n retry\n end\n handle_exception(e)\n end\n end", "title": "" }, { "docid": "f5d443854e713bf151f4da7da857ccae", "score": "0.6029844", "text": "def destroy\n destroy_route(@bolt.routeid.to_s)\n @bolt.destroy\n respond_to do |format|\n\n format.html { redirect_to \"/\" + current_user.nickname, :notice => 'That bolt has been deleted!' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5ec71c33dec4fd4631328bcd69f8eb27", "score": "0.60283697", "text": "def destroy\n @internal_location.destroy\n respond_to do |format|\n format.html { redirect_to internal_locations_url, notice: 'Item Eliminado.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6fc080afc17ca7bb0d28e2504cfbdd2c", "score": "0.602726", "text": "def destroy\n @boook = Boook.find(params[:id])\n @boook.destroy\n\n respond_to do |format|\n format.html { redirect_to boooks_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8be86ba2d834b2306b57183a6c143f74", "score": "0.60235816", "text": "def destroy\n @bdc = Bdc.find(params[:id])\n @bdc.destroy\n\n respond_to do |format|\n format.html { redirect_to bdcs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "29c5346324687e5f4b8b7c741962badc", "score": "0.6023189", "text": "def a_delete(path)\n a_request(:delete, Twitter::REST::Client::ENDPOINT + path)\nend", "title": "" }, { "docid": "b8cf4adcd3e84d8199bd93a31f7a7d8a", "score": "0.60216147", "text": "def clean_indexes()\n uri = URI.parse(INDEX_API + '/indexes/source/' + CRAWLER_ID)\n http = Net::HTTP.new(uri.host, uri.port)\n req = Net::HTTP::Delete.new(uri.request_uri)\n resp = http.request(req)\n puts resp.body\nend", "title": "" }, { "docid": "3dd4ec60e94efa182001c5dab5cefb39", "score": "0.6020799", "text": "def delete_rest(db, id)\r\n\tdb.execute(\"DELETE FROM restaurants WHERE id=?\",[id])\r\nend", "title": "" }, { "docid": "cd165a951d71b63b481761507651d00a", "score": "0.6018736", "text": "def destroy \n Block.connection.execute(\"delete from blocks where id in (#{params[:id].join(',')})\") unless params[:id].blank?\n respond_to do |format|\n format.html { redirect_to(blocks_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ed919300a834562a1c4adba7175049b1", "score": "0.6014106", "text": "def destroy\n @testloc = Testloc.find(params[:id])\n @testloc.destroy\n\n respond_to do |format|\n format.html { redirect_to(testlocs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "174b723f9e43bfa7501a9cdc389e4c1b", "score": "0.6012911", "text": "def delete\n @response = self.class.delete(\"#{@server_uri}/resource_name/#{@opts[:id]}.json\")\n end", "title": "" }, { "docid": "f218fe9a0328599eb310727c9159163e", "score": "0.6012201", "text": "def destroy\n @locacion = Locacion.find(params[:id])\n @locacion.destroy\n\n respond_to do |format|\n format.html { redirect_to locacions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "feb05fa712cede2232b7a79bf0cdeb56", "score": "0.60104173", "text": "def delete\n render json: Entry.delete(params[\"id\"])\n end", "title": "" }, { "docid": "95f18c299800dba7aad745e69a5424a1", "score": "0.60084146", "text": "def destroy\n @admin_balancer.destroy\n respond_to do |format|\n format.html { redirect_to admin_balancers_path, notice: I18n.t('deleted') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3b1f1583c06e623b8d1c6c3bd6bbff36", "score": "0.60069627", "text": "def destroy\n @bell = Bell.find(params[:id])\n @bell.destroy\n\n respond_to do |format|\n format.html { redirect_to bells_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6f560665f67dc5ddd2e9f3746ca5b94d", "score": "0.60034174", "text": "def destroy\n @bimester.destroy\n respond_to do |format|\n format.html { redirect_to bimesters_url, notice: 'Bimester was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "00c90bc63b0302afbbc4b2979ae20b57", "score": "0.6000448", "text": "def api_delete(path, data = {})\n api_request(:delete, path, :data => data).parsed\n end", "title": "" }, { "docid": "60c3eade216e3f3bf2ea397f8664a9d2", "score": "0.6000214", "text": "def destroy\n @ibeacon = Ibeacon.find(params[:id])\n @ibeacon.destroy\n\n respond_to do |format|\n format.html { redirect_to ibeacons_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d", "score": "0.6000184", "text": "def delete\n client.delete uri\n end", "title": "" }, { "docid": "1691790ee2ee34cc8e6be6f7bb8d7f8d", "score": "0.6000184", "text": "def delete\n client.delete uri\n end", "title": "" }, { "docid": "ac95b4694f836a361abefff7763aa432", "score": "0.5999351", "text": "def destroy\n @bingo = Bingo.find(params[:id])\n @bingo.destroy\n\n respond_to do |format|\n format.html { redirect_to bingos_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0ac446f6920e49ec05e566f2f50b0fd9", "score": "0.59981155", "text": "def destroy\n @globe = Globe.find(params[:id])\n @globe.destroy\n\n respond_to do |format|\n format.html { redirect_to(globes_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3a058edf1213e16a932fd69b04f8a3d3", "score": "0.5997863", "text": "def destroy\n# @city_global_location = CityGlobalLocation.find(params[:id])\n# @city_global_location.destroy\n#\n# respond_to do |format|\n# format.html { redirect_to(city_global_locations_url) }\n# format.xml { head :ok }\n# end\n end", "title": "" }, { "docid": "0387aa3c568d857184e97a214e580a14", "score": "0.59941137", "text": "def delete(path, params = {}, payload = {})\n JSON.parse Generic.delete(@base_url, @headers, path, params, payload)\n end", "title": "" }, { "docid": "a7bfa3129d0595c7eb50a3fcfc8193b7", "score": "0.599329", "text": "def destroy\n @basket_visit = BasketVisit.find(params[:id])\n @basket_visit.destroy\n\n respond_to do |format|\n format.html { redirect_to pending_basket_visits_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d1fddf6a0a29ad286edbf9e6988b677c", "score": "0.5990824", "text": "def destroy\n @blast_request.destroy\n respond_to do |format|\n format.html { redirect_to mc_blast_blast_requests_path, notice: 'Blast request was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.59896415", "text": "def delete(path);end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.59896415", "text": "def delete(path);end", "title": "" }, { "docid": "6fa065ba62fe9ff106f3f6e553e507c0", "score": "0.59884816", "text": "def destroy\n @blr_place = BlrPlace.find(params[:id])\n @blr_place.destroy\n\n respond_to do |format|\n format.html { redirect_to blr_places_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "18089b2b367a0ec640ad89fcf2080332", "score": "0.5987165", "text": "def destroy\n @dibb = Dibb.find(params[:id])\n @dibb.destroy\n\n respond_to do |format|\n format.html { redirect_to dibbs_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "6b2689744d4ac4589793d9c2f5ec32c7", "score": "0.5981487", "text": "def destroy\n @bounty = Bounty.find(params[:id])\n @bounty.destroy\n\n respond_to do |format|\n format.html { redirect_to bounties_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6b2689744d4ac4589793d9c2f5ec32c7", "score": "0.5981487", "text": "def destroy\n @bounty = Bounty.find(params[:id])\n @bounty.destroy\n\n respond_to do |format|\n format.html { redirect_to bounties_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6b2689744d4ac4589793d9c2f5ec32c7", "score": "0.5981487", "text": "def destroy\n @bounty = Bounty.find(params[:id])\n @bounty.destroy\n\n respond_to do |format|\n format.html { redirect_to bounties_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "21e79e67ca972605813404c7a3295fb3", "score": "0.59778684", "text": "def destroy\n @bb = Bb.find(params[:id])\n @bb.destroy\n\n respond_to do |format|\n format.html { redirect_to(bbs_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e63152f80748eea8d403fe0adbea438e", "score": "0.597299", "text": "def destroy\n @banana.destroy\n respond_to do |format|\n format.html { redirect_to bananas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e63152f80748eea8d403fe0adbea438e", "score": "0.597299", "text": "def destroy\n @banana.destroy\n respond_to do |format|\n format.html { redirect_to bananas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b965aa2e76649b84623ed925811f4794", "score": "0.59717304", "text": "def delete(_path)\n end", "title": "" }, { "docid": "a22b147223eb84110cbb2dc7b161df5f", "score": "0.5970529", "text": "def delete_location\nCONNECTION.execute(\"DELETE FROM store_locations WHERE id = #{@id};\")\nend", "title": "" }, { "docid": "390e8e2ce3ebccf61cd00f177342fb05", "score": "0.5967792", "text": "def delete(path, &block) end", "title": "" }, { "docid": "390e8e2ce3ebccf61cd00f177342fb05", "score": "0.5967792", "text": "def delete(path, &block) end", "title": "" }, { "docid": "e3ea90f717278b79d8908e5b537926be", "score": "0.5966075", "text": "def delete(path)\n client.delete(\"/v1/#{encode_path(path)}\")\n return true\n end", "title": "" }, { "docid": "4443a61d34b72c434e75a38ab485f747", "score": "0.59651744", "text": "def destroy\r\n @location.mfile.destroy if @location.mfile\r\n# @location.destroy # obsolete as mfile has dependent destroy on location\r\n respond_to do |format|\r\n format.html { redirect_to locations_url }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.5960793", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.5960793", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "9410f5d5c06a5d4acee3b61e4f080658", "score": "0.5960793", "text": "def delete()\n @api.do_request(\"DELETE\", get_base_api_path())\n end", "title": "" }, { "docid": "8b233e4a8de0e8e149b4b72b513e9fe4", "score": "0.59606224", "text": "def destroy\n @georef = Georef.find(params[:id])\n @georef.destroy\n\n respond_to do |format|\n format.html { redirect_to georefs_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "c4002562a1883323b45eaf5b25617f15", "score": "0.59586024", "text": "def destroy\n @neighboorhood.destroy\n respond_to do |format|\n format.html { redirect_to neighboorhoods_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0f161f53f89f25bea7fe15eb14b057e6", "score": "0.5956823", "text": "def destroy\n @bundl.destroy\n respond_to do |format|\n format.html { redirect_to bundls_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "29fea76dfc81ee8d92d3222319dea61c", "score": "0.59567857", "text": "def destroy\n @location = Location.find(params[:id])\n @location.destroy\n\n respond_to do |format|\n format.html { redirect_to adm_locations_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1f9f679e98c971f443a8536dc2b8e622", "score": "0.59525734", "text": "def destroy\n @buddy_datum = BuddyDatum.find(params[:id])\n @buddy_datum.destroy\n\n respond_to do |format|\n format.html { redirect_to buddy_data_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8ed0f3928c52971005fa20a519b93697", "score": "0.59513825", "text": "def destroy\n @bbs_body = BbsBody.find(params[:id])\n @bbs_body.destroy\n\n respond_to do |format|\n format.html { redirect_to bbs_bodies_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "57f6f7f1a0e30861e7bcf1da62d6c8cc", "score": "0.59487295", "text": "def destroy\n sql = \"DELETE FROM Location WHERE locationId = #{params[:id]}\"\n ActiveRecord::Base.connection.execute(sql)\n\n respond_to do |format|\n format.html { redirect_to locations_url, notice: 'Location was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
7dc31068848417f5973f9a84f4cb446e
I worked on this challenge [by myself, with: Catie Stallings]. Your Solution Below
[ { "docid": "5d32f21db85d0932a53c17d860d86a4b", "score": "0.0", "text": "def factorial(number)\n factor = 1\n counter = 1\n while counter < number\n factor *= (counter + 1)\n counter += 1\n end\n return factor\nend", "title": "" } ]
[ { "docid": "6979036015fac47c519d3834b2c5c971", "score": "0.67630976", "text": "def sort_string(string)\r\n # your code here\r\n a = string.split(\" \")\r\n b = a.sort{|x,y| x.length <=> y.length}\r\n b[0]<<' '<<b[1]<<' '<<b[2]\r\nend\r\n\r\n\r\n# Select random elements from an array\r\n\r\ndef random_select(array, n)\r\n # your code here\r\n len = array.size\r\n result = []\r\n n.times do \r\n result = result << array[rand(len)] \r\n end\r\n return result\r\nend\r\n\r\n\r\n# Find the length of strings in an array\r\n\r\ndef length_finder(input_array)\r\n out_arr = []\r\n input_array.each do |i|\r\n out_arr = out_arr << i.length\r\n end\r\n return out_arr\r\nend\r\n\r\n\r\n# Hiring Programmers - Boolean Expressions in Ruby\r\n\r\nis_an_experienced_programmer = (\r\n (candidate.years_of_experience >= 2 || candidate.github_points >= 500) && candidate.languages_worked_with.include?(\"Ruby\") && candidate.age >= 15 && !candidate.applied_recently?\r\n )\r\n \r\n \r\n# Palindromes \r\n\r\ndef palindrome?(sentence)\r\n # Write your code here\r\n sentence = sentence.downcase.gsub(' ','')\r\n reverse = ''\r\n i = 1\r\n sentence.length.times do\r\n reverse = reverse << sentence[-i]\r\n i = i.next\r\n end\r\n return reverse == sentence\r\nend\r\n\r\n\r\n# Compute sum of cubes for given range\r\n\r\ndef sum_of_cubes(a, b)\r\n # Write your code here\r\n i = a\r\n result = i**3\r\n loop do\r\n if i == b \r\n break\r\n else\r\n i = i + 1\r\n result = result + i**3\r\n end\r\n end\r\n return result\r\nend\r\n \r\n \r\n# Find non-duplicate values in an Array\r\n\r\ndef non_duplicated_values(values)\r\n # Write your code here\r\n out_arr = values\r\n values.each do |x|\r\n n = values.select {|y| y == x}\r\n if n.length > 1\r\n out_arr.delete_if {|y| y == x}\r\n end\r\n end\r\n return out_arr\r\nend\r\n\r\n\r\n# Check if all elements in an array are Fixnum\r\n\r\ndef array_of_fixnums?(array)\r\n # Write your code here\r\n n = 0\r\n n = array.select {|x| x.is_a?(String) }\r\n if n.length == 0\r\n return true\r\n else \r\n return false\r\n end \r\nend\r\n\r\n\r\n# Kaprekar's Number\r\n\r\ndef kaprekar?(k)\r\n k2 = k**2\r\n n = \"#{k}\".length\r\n num_digits_k2 = \"#{k2}\".length\r\n right_n = k2 % (10**n)\r\n left = k2 / (10**n)\r\n k == (right_n + left)\r\nend\r\n\r\n\r\n# Number shuffle\r\n\r\ndef number_shuffle(number)\r\n # your code here\r\n len = \"#{number}\".length\r\n arr = []\r\n i = 0\r\n num = 1\r\n len.times do \r\n x = number % 10**(i+1)\r\n arr[i] = x / (10**i)\r\n i = i + 1\r\n num = num * i\r\n end\r\n result = []\r\n loop do \r\n if result.length == num\r\n break\r\n else\r\n x = arr.shuffle\r\n y = 0\r\n i = 10**(arr.length-1)\r\n x.each do |k|\r\n y = y + (k * i)\r\n i = i / 10\r\n end\r\n result.push(y)\r\n result = result.uniq\r\n end\r\n end\r\n return result.sort\r\nend\r\n\r\n\r\n# Time to run code\r\n\r\ndef exec_time(proc)\r\n # your code here\r\n h = Time.now\r\n puts proc.call\r\n n = Time.now\r\n return n - h \r\nend\t\r\n\r\n\r\n# Your sum\r\n\r\nclass MyArray\r\n attr_reader :array\r\n\r\n def initialize(array)\r\n @array = array\r\n end\r\n\r\n def sum(initial_value = 0)\r\n if block_given?\r\n res = initial_value\r\n array.each do |i|\r\n res = res + yield(i)\r\n end\r\n return res\r\n else\r\n res = initial_value\r\n array.each do |i|\r\n res = res + i\r\n end\r\n return res\r\n end\r\n end\r\nend\r\n\r\n\r\n# Orders and costs\r\n\r\nclass Restaurant\r\n def initialize(menu)\r\n @menu = menu\r\n end\r\n\r\n def cost(*orders)\r\n # your code here\r\n total = 0\r\n orders.each do |ord|\r\n ord.each do |i, q|\r\n p = @menu[i]\r\n c = p * q\r\n total = total + c\r\n end\r\n end\r\n return total\r\n end\r\nend\r\n\r\n\r\n# Enough Contrast?\r\n\r\nclass Color\r\n attr_reader :r, :g, :b\r\n def initialize(r, g, b)\r\n @r = r\r\n @g = g\r\n @b = b\r\n end\r\n\r\n def brightness_index\r\n # your code here\r\n return ( 299 * r + 587 * g + 114 * b) / 1000\r\n end\r\n\r\n def brightness_difference(another_color)\r\n #your code here\r\n return (brightness_index - another_color.brightness_index).abs\r\n end\r\n\r\n def hue_difference(another_color)\r\n #your code here\r\n return ((r - another_color::r).abs + (g - another_color::g).abs + (b - another_color::b).abs)\r\n end\r\n\r\n def enough_contrast?(another_color)\r\n # your code here\r\n if brightness_difference(another_color) > 125 && hue_difference(another_color) > 500 \r\n true\r\n else\r\n false\r\n end\r\n end\r\nend\r\n\r\n\r\n", "title": "" }, { "docid": "08fde3cd0f8d93fdc1cda3060c4f5885", "score": "0.6425306", "text": "def greedy_canoe_a(w, max_load)\n skinny, fat = [], []\n\n # Divide w into 2 arrays: skinny, fat\n w.size.times do |i|\n if w[i] + w[-1] <= max_load\n skinny << w[i]\n else\n fat << w[i]\n end\n end\n\n # fat << w[-1] <---mistake in Codility 14-GreedyAlgorithms PDF?\n canoes = 0\n\n while skinny.any? || fat.any?\n puts \"Skinny: #{skinny}, Fat: #{fat}\"\n # put heaviest skinny guy w/ heaviest fat guy\n s = skinny.any? ? skinny.pop : ''\n f = fat.pop\n puts \"Put #{s}, #{f} in 1 canoe\"\n canoes += 1\n\n # after enmptying \"fat\", move heaviest skinny guy back to \"fat\"\n if skinny.any? && fat.empty?\n fat << skinny.pop\n end\n\n # if lightest + heaviest fat guys can fit in canoe,\n # move lightest fat guy to \"skinny,\" so next loop pairs them\n while fat.size > 1 && fat[0] + fat[-1] <= max_load\n skinny << fat.shift\n end\n end\n puts \"Total canoes: #{canoes}\"\n canoes\nend", "title": "" }, { "docid": "61a5aa5387d7586d627164f40eaf623a", "score": "0.637593", "text": "def solution6(input)\n end", "title": "" }, { "docid": "b9960478999684c2b536f76e22f6fc63", "score": "0.63051355", "text": "def solution4(input)\n end", "title": "" }, { "docid": "aa89b26c8848588848ff622b5d313173", "score": "0.6255949", "text": "def solution\n 31875000\nend", "title": "" }, { "docid": "48f6ccd13854a541bfcb18ff7c741f02", "score": "0.6252265", "text": "def part1(input)\n twos = threes = 0\n\n # For each ID, bucket each char and count their instances within the ID.\n # Originally, I'd tried to sort the chars and use a regex, but getting\n # around the awkwardness of backtracking and detecting the twos that aren't\n # also threes (or more) wasn't worth the effort on this exercise.\n input.each do |id|\n counts = id.chars.group_by(&:to_s).values.map(&:size)\n\n twos += 1 if counts.include?(2)\n threes += 1 if counts.include? (3)\n end\n\n return twos * threes\nend", "title": "" }, { "docid": "7820c7c2d6fe0c780b15e6ae298593f1", "score": "0.624586", "text": "def candies(s)\n return -1 if s.length <= 1\n s.inject(0){|sum, x| sum + (s.max-x)}\nend", "title": "" }, { "docid": "4a21fd90da81a02895a7e32078bf0946", "score": "0.6195599", "text": "def solution(a)\r\n # write your code in Ruby 2.2\r\n \r\n i=0;\r\n l=a.count\r\n arr=[]\r\n p=0\r\n loop do\r\n arr[a[i]-1] = a[i]\r\n i+=1\r\n \r\n if(i==l)\r\n k=1;\r\n \r\n for j in arr\r\n if(k!=j)\r\n p=k\r\n break\r\n end\r\n k+=1\r\n end\r\n \r\n break\r\n end\r\n end\r\n \r\n \r\n p\r\nend", "title": "" }, { "docid": "01d65f828880f2b3ce5cccb589374205", "score": "0.61760545", "text": "def problem30\n total = 0\n (10..1000000).each{|n|\n total += n if n == n.to_s.split(\"\").inject(0){|sum,d|sum+=d.to_i**5}\n }\n total\nend", "title": "" }, { "docid": "af5213168e0ee82b120bec44b2735af5", "score": "0.61679465", "text": "def solution(a)\n size = 0\n value = -1\n (0..(a.length-1)).each do |i|\n if(size == 0)\n size = 1\n value = a[i]\n else\n if(value != a[i])\n size = size - 1\n else\n size = size + 1\n end\n end\n end\n\n candidate = -1\n leader = -1\n count = 0\n leader_indices = []\n\n if(size > 0)\n candidate = value\n end\n\n (0..(a.length-1)).each do |i|\n if a[i] == candidate\n count = count + 1\n end\n leader_indices << count\n end\n\n if count > (a.length/2)\n leader = candidate\n end\n\n leaders_count = 0\n\n if(leader != -1)\n (0..(a.length-1)).each do |i|\n a_1 = a[0..i]\n a_2 = a[(i+1)..(a.length-1)]\n\n count_2 = leader_indices[i]\n\n # puts \"count_2 #{count_2} , count #{a_1.length/2}\"\n # puts \"count_2 #{count_2} , (count-count_2) #{(count-count_2)}, count #{(a_2.length/2)}\"\n\n if count_2 > (a_1.length/2) && (count-count_2) > (a_2.length/2)\n leaders_count = leaders_count + 1\n end\n\n # puts leaders_count\n # puts\n end\n end\n\n leaders_count\nend", "title": "" }, { "docid": "c3a6c4ddb76579e45e3cbe80fba426be", "score": "0.61630625", "text": "def solution(a)\r\n # write your code in Ruby 2.2\r\n\r\n l=a.count-1\r\n arr=[]\r\n \r\n \r\n loop do\r\n arr[a[l]-1] = a[l]\r\n \r\n l-=1\r\n break if l<0\r\n end\r\n \r\n if arr.count == a.count\r\n return 1\r\n else\r\n return 0\r\n end\r\n \r\n \r\nend", "title": "" }, { "docid": "fcdc7a5e867d3db0a4e4c61dc4d4da37", "score": "0.6161457", "text": "def solution(a)\n # write your code in Ruby 1.9.3\n go_east = 0\n pass = 0\n a.each do |x|\n if x == 0\n go_east += 1\n else\n pass += go_east\n if pass > 100000\n return -1\n end\n end\n end\n\n return pass\n\nend", "title": "" }, { "docid": "184978b34707e2c9d190e35b6305dd56", "score": "0.6155176", "text": "def solution(n)\n a = n.to_s(2).split('')\n count, start, store = 0,0,0\n a.each do |i|\n start = 1 if i == '1' && count == 0\n count +=1 if i == '0' && start ==1\n if i=='1' && count > 0\n store = count if count > store\n count = 0\n end\n end\n store\nend", "title": "" }, { "docid": "cef825fbfb3afa754f79670aa333d6ef", "score": "0.6134625", "text": "def solution(a)\n east = 0\n west = 0\n passing = 0\n for i in a\n case i\n when 0\n east += 1\n when 1\n west += 1\n passing += east\n end\n return -1 if passing > 1_000_000_000\n end\n passing\nend", "title": "" }, { "docid": "0e4cda0adbc8b5aecd2938d89a067613", "score": "0.6112953", "text": "def solution(s)\n\nend", "title": "" }, { "docid": "c3cb3e948c27b241ea4299b2df1fa4b3", "score": "0.6112611", "text": "def solution5(input)\n end", "title": "" }, { "docid": "c3cb3e948c27b241ea4299b2df1fa4b3", "score": "0.6112611", "text": "def solution5(input)\n end", "title": "" }, { "docid": "15a47b49e9abd1e4a0e1f3149d80bbf9", "score": "0.610139", "text": "def solution(s, p, q)\n # write your code in Ruby 2.2\n letters = { 'A' => 1, 'C' => 2, 'G' => 3, 'T' => 4 }\n n = s.size\n res = []\n\n p_sums = Hash.new { |k,v| k[v] = Array.new(n + 1, 0) }\n\n letters.keys.each do |letter|\n for i in 1..n do\n p_sums[letter][i] = p_sums[letter][i -1]\n p_sums[letter][i] += 1 if s[i-1] == letter\n end\n end\n # puts \"#{p_sums}\"\n\n i = 0\n for i in i..p.size-1 do\n # puts \"== #{i}\"\n letters.keys.each do |k|\n # puts \"#{k} | P: #{p[i]} Q: #{q[i]} | #{p_sums[k][p[i]]} #{p_sums[k][q[i]+1]}\"\n if p_sums[k][p[i]] != p_sums[k][q[i]+1]\n res << letters[k]\n break\n end\n end\n end\n res\n\n \nend", "title": "" }, { "docid": "578a4c2088c4d8ec64fbe2465745ad9e", "score": "0.60998434", "text": "def solution(a)\r\n # write your code in Ruby 2.2\r\n #0 -east\r\n #1 - west\r\n \r\n\r\n\r\n arr=[]\r\n n=0\r\n a.each_with_index{|el,i|\r\n \r\n if(el==0)\r\n j=i\r\n loop do\r\n if (a[j] == 1)\r\n n+=1\r\n end\r\n \r\n j+=1 \r\n break if j==a.count \r\n end\r\n \r\n end\r\n \r\n }\r\n \r\n n\r\nend", "title": "" }, { "docid": "1f0955975a10a26277bd0d9fb51a00f1", "score": "0.6095839", "text": "def solution(s)\n t = 0\n (s.length / 3).times do |i|\n slice = s[(3 * i)..(3 * i + 2)]\n t += 1 if slice[0] != 'S'\n t += 1 if slice[1] != 'O'\n t += 1 if slice[2] != 'S'\n end\n t\nend", "title": "" }, { "docid": "4871d41491c1924c30e4fb427988073d", "score": "0.60920364", "text": "def solution(s)\n result = 'Funny'\n s = s.codepoints\n r = s.reverse\n\n for i in (1..s.length - 1)\n sum1 = (s[i] - s[i-1]).abs\n sum2 = (r[i]- r[i-1]).abs\n if sum1 != sum2\n result = 'Not Funny'\n break\n end\n end\n\n result\nend", "title": "" }, { "docid": "e64ab9041d127fd863cb8cc14dea830e", "score": "0.6082157", "text": "def solve_challenge(input)\n sum = 0\n last_index = input.length - 1\n char1 = ''\n char2 = ''\n input.split('').each_with_index do |ch, i|\n char1 = ch\n # circle around list if index is at the end\n if i == last_index\n char2 = input[0]\n # otherwise just grab the next character\n else\n char2 = input[i+1]\n end\n # add to sum if the 2 characters match\n sum += char1.to_i if char1 == char2\n end\n sum\nend", "title": "" }, { "docid": "4f7342b3592ec209d29fa49774767bb7", "score": "0.60755163", "text": "def solve\n d = %w(1 2 3 4 5 6 7 8 9).permutation.map {|i| i.join}.select {|i| i >= '918273645'}.reverse\n \n d.each do |i|\n 1.upto( 4 ) do |j|\n s = i[0, j]\n n = s.to_i\n\n 2.upto( 5 ) do |k|\n s += (k * n).to_s\n return i.to_i if i == s # puts \"%s (1..%d x %d)\" % [i, k, n]\n\n break if !i.start_with?( s )\n end\n end\n end\n end", "title": "" }, { "docid": "72bb3b989efb9ec765190d8962bff157", "score": "0.60661685", "text": "def solution(a)\n # write your code in Ruby 1.9.3\n count = Array.new(a.length,0)\n a.each do |e|\n return 0 if e > a.length\n count[e-1] += 1 \n end\n \n (1..count.length-1).each do |i|\n return 0 if count[i]!=1 || count[i] > 1\n end\n \n return 1\nend", "title": "" }, { "docid": "19bcd70b66be6f77d40897ae7a005569", "score": "0.60616505", "text": "def solution(a)\n east = 0\n passing = 0\n a.each { |v| \n case v\n when 0\n east += 1\n when 1\n passing += east\n return -1 if passing > 1_000_000_000\n end\n }\n passing\nend", "title": "" }, { "docid": "7836df19a99ee978a005375604e7f649", "score": "0.60596573", "text": "def longest_sluggish(fishes)\n longest = nil\n fishes.each_with_index do |fish1, i|\n fishes.each_with_index do |fish2, j|\n next if j <= i\n if fish2.length > fish1.length\n longest = fish2\n else\n longest = fish1\n end\n end\n longest\nend\n\n# Dominant Octopus\n# Find the longest fish in O(n log n) time. Hint: You saw a sorting algorithm that runs in O(n log n) in the Sorting Complexity Demo. Accessing this on GitHub? Use this link. Remember that Big O is classified by the dominant term.\ndef longest_dominant(fishes)\n sorted_fishes = quicksort(fishes)\n sorted_fishes.last\nend\n\ndef quicksort(fishes)\n return fishes if fishes.size < 2\n pivot = fishes.first\n left = fishes[1..-1].select { |fish| fish.length <= pivot.length }\n right = fishes[1..-1].select { |fish| fish.length > pivot.length }\n\n sorted_left = quicksort (left)\n sorted_right = quicksort(right)\n sorted = sorted_left + [pivot] + sorted_right\n sorted \nend\n\n# Clever Octopus\n# Find the longest fish in O(n) time. The octopus can hold on to the longest fish that you have found so far while stepping through the array only once.\n\ndef longest_clever(fishes)\n\nend", "title": "" }, { "docid": "41d8272b7c7b14be391f11bb61b8cafe", "score": "0.6048057", "text": "def solution(a)\n # write your code in Ruby 2.2\n \n counter = 0\n\ttotal = 0\n\t\n\ta.each do |car|\n\t\tcar == 0 ? counter += 1 : total += counter\n\tend\n\t\n\treturn total > 1_000_000_000 ? -1 : total\nend", "title": "" }, { "docid": "1364b1c9898f78882b2472ed81327101", "score": "0.6043619", "text": "def solution(s)\n str = s.gsub(/\\D+/, '')\n len = str.size\n threes = len / 3\n threes -= 1 if len % 3 == 1\n \n counts = ([3] * threes) + ([2] * ((len - (3 * threes)) / 2))\n pos = 0\n return counts.map do |count|\n temp = str.slice(pos, count)\n pos += count\n temp\n end.join('-')\nend", "title": "" }, { "docid": "75140bd92377e07bd7367ec852f43d4d", "score": "0.6037107", "text": "def solution(arr) end", "title": "" }, { "docid": "afb7c27a8561349d77eac5d9bd751021", "score": "0.6033654", "text": "def solution(a)\n # write your code in Ruby 2.2\n east = 0\n pass = 0\n \n a.each do |dir|\n if dir == 0\n east += 1\n else\n pass += east\n return -1 if pass > 1000000000\n end\n end\n \n pass\nend", "title": "" }, { "docid": "285d2e49c760ed24f2673411b06f6a8c", "score": "0.603194", "text": "def solve(arr)\n\n result = []\n\n arr.each do |i|\n if i < 38\n result << i\n else\n mg1 = i+1\n mg2 = i+2\n if mg1%5 == 0\n result << mg1\n elsif mg2%5 == 0\n result << mg2\n else\n result << i\n end\n end\n end\n\n result.each do |r|\n puts r\n end\n\nend", "title": "" }, { "docid": "24f189fd6b3cfc4aaa92f93d03441d85", "score": "0.60310525", "text": "def solution(a)\n zeroes = 0\n passes = 0\n a.each do |c|\n zeroes += 1 if c == 0\n passes += zeroes if c == 1\n return -1 if passes > 1000000000\n end\n passes\nend", "title": "" }, { "docid": "ae10f5e1641f5047aa611f426748fe1d", "score": "0.60195273", "text": "def solution(s)\n # write your code in Ruby 2.2\n len = s.length\n return 0 if len == 1\n return -1 if len % 2 == 0\n \n mid = s.length / 2\n (0...mid).each do |i|\n j = len - 1 - i\n return -1 if s[i] != s[j]\n end \n \n mid\nend", "title": "" }, { "docid": "7a007b872ce37620e3363cea2761da98", "score": "0.601488", "text": "def solution(a)\n # write your code in Ruby 2.2\n sum = a.inject(0, :+)\n n = a.length\n expected = n * (n+1)/2\n diff = sum - expected\n missing = n + 1 - diff\nend", "title": "" }, { "docid": "07a10d2fcc160a93377ffbd3e8801775", "score": "0.600105", "text": "def solve(input)\n numbers = input.to_s.split(\"\").map(&:to_i)\n length = numbers.size\n first = numbers[0]\n\n total = 0\n\n step = length / 2\n numbers.each_with_index do |number, index|\n next_position = (index + step) % length\n if numbers[next_position] == number\n total += number\n end\n end\n\n total\nend", "title": "" }, { "docid": "8d1047113f80d7be44b0b79bc00c69e8", "score": "0.59981996", "text": "def dominant_octopus_helper(fish)\n return fish if fish.length <= 1\n pivot = fish.first \n left = fish[1..-1].select {|el| el.length > pivot.length}\n right = fish[1..-1].select {|el| el.length < pivot.length}\n dominant_octopus_helper(left) + [pivot] + dominant_octopus_helper(right)\nend", "title": "" }, { "docid": "ba45c54e0e93b61df11a30895aba7b72", "score": "0.5984566", "text": "def sluggish_octopus(arr) #finding the longest fish in O(n^2) time\r\n longest_fish = \"\"\r\n arr.each do |fish|\r\n arr.each do |fish2|\r\n longest_fish = fish2 if fish2.length >= fish.length && fish2.length >= longest_fish.length\r\n end\r\n end\r\n longest_fish\r\nend", "title": "" }, { "docid": "95c5d00f6fd8f5d6f4b7368744a1a4b6", "score": "0.59831375", "text": "def solution2(input)\n end", "title": "" }, { "docid": "95c5d00f6fd8f5d6f4b7368744a1a4b6", "score": "0.59831375", "text": "def solution2(input)\n end", "title": "" }, { "docid": "2d1f5ffbab8c86bc000cce7ee42c2003", "score": "0.5981887", "text": "def solution(array)\n array.sort!\n return 0 if array.length == 1 && array.first != 1\n length = array.length\n start = 1\n length.times do |n|\n if array[start-1] != n + 1\n return 0\n end\n start += 1\n end\n return 1\nend", "title": "" }, { "docid": "f8b13ae90c3f70410bf86714d6d49eef", "score": "0.5980716", "text": "def solution(n)\n # write your code in Ruby 2.2\n s = n.to_s(2) \n zeroes = s.split('1') \n zeroes.pop if !n.odd? \n return 0 if zeroes.empty? \n zeroes.map { |x| x.length}.max\nend", "title": "" }, { "docid": "5f8f7bef44de8c5fbf543c1650f70262", "score": "0.5979637", "text": "def problem_9(sum)\n array = []\n # Divide the number by two and then subtract one \n # to ensure there are no zeros in the triplet.\n ((sum / 2) - 1).downto(1) { |n| array << n }\n\n # Iterate through possible c values. \n array.each do |c|\n remainder = sum - c\n # Create and iterate another array to run through the \n # difference of the sum and c. \n array2 = (1..remainder).to_a\n array2.each do |a|\n b = remainder - a\n if (a**2 + b**2 == c**2)\n return puts a, b, c\n end\n end\n end\nend", "title": "" }, { "docid": "03b21faf8f85eca86d55fbcd89fd6d97", "score": "0.59726644", "text": "def problem_six\n\t# Square first 100 numbers\n\tsquare = [ ]\n\t1.upto(100).each do |x|\n\t\tsquare << x ** 2 \n\tend\n\n\t# Add those square numbers\n\tsquare_sum = 0\n\tsquare.each do |y|\n\t\tsquare_sum += y\n\tend\n\t\n\t# Add first 100 numbers\n\tsum = 0\n\t1.upto(100).each do |n|\n\t\tsum += n\n\tend\n\n\t# Square sum of 100 numbers\n\tsum_square = sum ** 2\n\n\t# Find the difference\n\tdifference = sum_square - square_sum\n\treturn difference\n\nend", "title": "" }, { "docid": "0b7a616cc7822be314b767ef2b841fa3", "score": "0.5969288", "text": "def solution3(input)\n end", "title": "" }, { "docid": "28af4f93a91e45878228e29d0c8229c2", "score": "0.5961416", "text": "def solution(str)\n b = str.split(\"\")\n n = 0\n c = []\n\n p b\n\n if b.count.even?\n for i in 0..str.length/2\n c << b[i*2].to_s + b[i*2+1].to_s\n end\n else\n b << \"_\"\n b.each do |x|\n c << b[n].to_s + b[n+1].to_s\n n = n + 2\n end\n end\nc.delete(\"\")\nreturn c\nend", "title": "" }, { "docid": "a64e225ff27690e4334e4c789e82bae5", "score": "0.5960342", "text": "def solution(n)\r\n # write your code in Ruby 2.2\r\n # puts n\r\n binary = n.to_s(2)\r\n count = 0\r\n temp = 0\r\n \r\n for i in 0..(binary.size)\r\n if binary[i] == \"0\" and binary[i..-1].end_with?(\"1\")\r\n count += 1\r\n else\r\n temp = count if count > temp\r\n count = 0\r\n end\r\n end\r\n temp\r\nend", "title": "" }, { "docid": "4ad68ebce1b425c551899d5fbdae814f", "score": "0.5960026", "text": "def solution(arr)\n\nend", "title": "" }, { "docid": "d9f4dc31e32a146b09c44f50c1e8fe5d", "score": "0.59585124", "text": "def solution(a, s)\nsum_array = []\n a.sort!\n a.each_with_index do |e,i|\n each_array = []\n each_array.push(e)\n j = i + 1\n while(j<a.count)\n \n each_array.push(a[j])\n sum1 = each_array.inject(&:+)\n ave = sum1.to_f/each_array.count\n break if ave > s\n if s == ave\n sum_array.push(each_array) unless each_array.count == a.count\n end\n j+=1\n end\n end\n p sum_array\nend", "title": "" }, { "docid": "e4bf969521382732ac79be40ffa78c87", "score": "0.592905", "text": "def solution(a)\r\n ones=0\r\n temp=0\r\n ans=0\r\n for i in 0...a.size\r\n if a[i]==1\r\n ones+=1\r\n end\r\n end\r\n \r\n for i in 0...a.size\r\n if a[i]==1\r\n temp+=1\r\n else\r\n ans+=(ones-temp)\r\n end\r\n end\r\n \r\n if ans>1000000000\r\n return -1\r\n else\r\n return ans\r\n end\r\n \r\n \r\nend", "title": "" }, { "docid": "6674b95531acd21fc5571c01a50be12e", "score": "0.592074", "text": "def muchSimplerSolution(walk)\n walk.count('w') == walk.count('e') and\n walk.count('n') == walk.count('s') and\n walk.count == 10\nend", "title": "" }, { "docid": "07819e3afdf5a27c3cfb64e3e0f2ce3a", "score": "0.5918391", "text": "def problem33\n num, den = 1, 1\n 10.upto(98) do |x|\n (x+1).upto(99) do |y|\n if (((simplestTerms(x,y)<=>simplestTerms((n = (a = x.to_s)[0].to_i), (d = (b = y.to_s)[1].to_i))) == 0 && a[1] == b[0]) ||\n ((simplestTerms(x,y)<=>simplestTerms((n = a[1].to_i), (d = b[0].to_i))) == 0 && a[0] == b[1]) &&\n (a[0] != b[0] && a[1] != b[1] && a[0] != a[1] && b[0] != b[1]))\n num, den = num * n, den * d\n puts \"#{x}/#{y} == #{n}/#{d}\"\n end\n end\n end\n puts \"#{(r = simplestTerms(num,den))[0]}/#{r[1]}\"\nend", "title": "" }, { "docid": "49552ab2769a4e7e83c75ae7c3fe0900", "score": "0.5914489", "text": "def solution(a)\n size = 0\n value = -1\n (0..(a.length-1)).each do |i|\n if(size == 0)\n size = 1\n value = a[i]\n else\n if(value != a[i])\n size = size - 1\n else\n size = size + 1\n end\n end\n end\n\n candidate = -1\n leader = -1\n count = 0\n index = -1\n\n if(size > 0)\n candidate = value\n end\n\n (0..(a.length-1)).each do |i|\n if a[i] == candidate\n count = count + 1\n index = i\n end\n end\n\n if count > (a.length/2)\n leader = candidate\n else\n index = -1\n end\n\n index\nend", "title": "" }, { "docid": "56e2f4c229d68e9d667cf5f5fe1d2177", "score": "0.59121275", "text": "def solution(a)\r\n # write your code in Ruby 2.2\r\n #a[0] = 1 [-1..1]\r\n #a[1] = 5 [-4..6]\r\n #a[2] = 2 [0..4]\r\n #a[3] = 1 [2..4]\r\n #a[4] = 4 [0..8]\r\n #a[5] = 0 [0]\r\n\r\n i=0\r\n arr=[]\r\n while(i<a.count) do\r\n \r\n arr[i] = (i-a[i].. i+a[i]).to_a\r\n i+=1 \r\n end\r\n \r\n \r\n \r\n l=arr.count\r\n i=0\r\n n=0\r\n while(i<l) do\r\n \r\n \r\n j=i+1\r\n while(j<l) do\r\n if(arr[i] != arr[j])\r\n \r\n if((arr[i] & arr[j]).empty? == false)\r\n n+=1\r\n end\r\n end\r\n j+=1\r\n end \r\n i+=1\r\n end\r\n n\r\nend", "title": "" }, { "docid": "69696aa2a624b4ca18ebf88d4181f524", "score": "0.5911652", "text": "def solution(s, p, q)\n # write your code in Ruby 2.2\n factor = nil\n arr = []\n i = 0\n res = []\n \n for i in 0...s.length do \n case s[i]\n when 'A'\n arr << 1\n when 'C'\n arr << 2\n when 'G'\n arr << 3\n when 'T'\n arr << 4\n end\n end\n \n #puts \"#{arr.to_s} #{s} #{p.to_s} #{q.to_s}\"\n \n i = 0\n for i in 0...p.size do\n tmp = arr.slice(p[i],q[i] - p[i] + 1)\n #puts \"#{tmp}\"\n res << tmp.min\n end\n #puts \"#{res}\"\n \n res\n \nend", "title": "" }, { "docid": "49e90fa22be20da7afa3ca77fcf7ab39", "score": "0.5909999", "text": "def funny_plant(people, plants)\n # initialize crop, people_fed, and weeks\n crop = Array.new\n people_fed = 0\n weeks = 1\n #initialize array with positions for each plant\n plants.times do\n crop.push(0)\n end\n #until people_fed > than # of people\n until people_fed >= people\n # add 1 to each plant in array\n crop.map!{ |i| i+1}\n # count the array to find the number of people that can be fed\n people_fed = crop.count\n # add up surplus to find out how many plants can be planted and add them to array\n crop.reduce(:+).times do\n crop.push(0)\n end\n # increment week\n weeks +=1\n end\n return weeks\nend", "title": "" }, { "docid": "6125bfd7debc7af3d6a8a4bffb8ddc0a", "score": "0.5900867", "text": "def solution(n)\n # write your code in Ruby 2.2\n b = n.to_s(2)\n a = []\n incr = 0\n s = false\n b.each_char do |char|\n if char == '1'\n if s\n a.push(incr)\n incr = 0\n\n else\n s = true\n end\n else\n incr += 1\n end \n end\n a.max || 0\nend", "title": "" }, { "docid": "92fb5b402e1dcb939e613a99c86b9904", "score": "0.58982354", "text": "def problem_17(max = 1000)\n words = {\n 0 => \"\",\n 1 => \"one \", 2 => \"two \", 3 => \"three \", 4 => \"four \", 5 => \"five \",\n 6 => \"six \", 7 => \"seven \", 8 => \"eight \", 9 => \"nine \", 10 => \"ten \",\n 11 => \"eleven \", 12 => \"twelve \", 13 => \"thirteen \",\n 14 => \"fourteen\", 15 => \"fifteen \", 16 => \"sixteen \",\n 17 => \"seventeen \", 18 => \"eighteen \", 19 => \"nineteen\",\n 20 => \"twenty \", 30 => \"thirty \", 40 => \"forty\", 50 => \"fifty \",\n 60 => \"sixty \", 70 => \"seventy \", 80 => \"eighty \", 90 => \"ninety \",\n }\n\n to_words = lambda do |num|\n str = \"\"\n while num > 0\n if num >= 1000 # Thousands\n str = to_words.call(num / 1000) + \"thousand\"\n num = 0\n elsif num >= 100 # Hundreds\n n = num / 100\n str += to_words.call(n) + \"hundred \" \n num -= n * 100\n else # < 100 # Less than 100\n str += \"and \" if num > 0 and str.length > 0\n if words[num] # Get pre-known words\n str += words[num]\n num = 0\n else\n n = num / 10 * 10\n if words[n] # else see if we have a special name\n str += words[n]\n num -= n\n end\n str += words[num]\n num = 0\n end\n end\n end\n str\n end\n\n (1..max).reduce(0) do |total,num|\n total += (str = to_words.call(num)).tr(\" \",\"\").length\n puts \"#{num} => #{str} #{total}\"\n total\n end\nend", "title": "" }, { "docid": "c140f3f837acb4d7e39f4936a06a01a2", "score": "0.5898169", "text": "def iq_test(numbers)\n arr = []\n c_a = []\n final = []\n numbers.split(' ').each do |n|\n i = n.to_i\n arr.push(i.even?) \n end\n arr.each do |a|\n c_a.push(arr.count(a))\n end\n \n c_a.each_with_index do |c, i|\n final.push(c == 1 ? i+1 : 0)\n end\n return final.max\nend", "title": "" }, { "docid": "e919dd7f275dbbc97c90ea374891336c", "score": "0.58976716", "text": "def featured(n)\n star_num = (n / 7) + 1\n while true\n result = star_num * 7\n if result.odd? && (result.to_s.chars.uniq == result.to_s.chars)\n return result\n else\n star_num += 1\n end\n end\nend", "title": "" }, { "docid": "3f0b67819d2d89164741586a25635d60", "score": "0.5895024", "text": "def return_base_candidate(base_char, base_counter, target_char_arr)\n base_candidate = []\n target_counter = 0\n target_char_arr.each do |target_char|\n verdict = base_char == target_char\n base_candidate << (base_counter - target_counter).abs if verdict\n target_counter += 1\n end\n base_candidate\nend", "title": "" }, { "docid": "cd84435df4e397f4a189ab0bdd35e179", "score": "0.5894178", "text": "def part1(i)\n houses = Set.new [[0, 0]]\n santa_position = [0, 0]\n i.each_char do |char|\n next unless %w(< > ^ v).include?(char)\n santa_position = case char\n when ?<\n [santa_position[0] - 1, santa_position[1]]\n when ?>\n [santa_position[0] + 1, santa_position[1]]\n when ?^\n [santa_position[0], santa_position[1] + 1]\n when ?v\n [santa_position[0], santa_position[1] - 1]\n end\n houses.add santa_position\n end\n houses.size\nend", "title": "" }, { "docid": "1c498ff5848b8ea7cad89ed3ead7eed4", "score": "0.5892041", "text": "def solution(a)\n max = a.length + 1\n (1 + max) * max / 2 - a.inject(0, &:+)\nend", "title": "" }, { "docid": "ad39c7d5dc657f0494a8726850275ec6", "score": "0.58891654", "text": "def number_joy(n)\n\n@n = n\n@counter = 0\n@int_rev = 0\n\ndef integer_total \n arr = @n.to_s.split(\"\").map(&:to_i)\n arr.each do |a| @counter += a\n end \nend\n\ndef is_harshad\n@n%@counter == 0\nend \n\ndef integer_reversed\n@int_rev = @counter.to_s.reverse.to_i\nend\n\ndef joyful_number\nreturn @n == @counter*@int_rev && @n%@counter == 0\nend\n \n\ninteger_total\ninteger_reversed\nis_harshad\njoyful_number\n\nend", "title": "" }, { "docid": "3508e2ec55256ee8ca4d153e459a9430", "score": "0.58886194", "text": "def easy(input)\n sum = 100\n ingredients = input.map { |line| parse(line)[0..-2] }\n max = 0\n (0..sum).each do |i|\n (0..(sum - i)).each do |j|\n (0..(sum - i - j)).each do |k|\n l = sum - i - j - k\n score = score([i, j, k, l], ingredients)\n max = [score, max].max\n end\n end\n end\n max\nend", "title": "" }, { "docid": "5f06c0770371ecf0b7ec5072dd5cc614", "score": "0.58823013", "text": "def zombie_alphabetical(arr)\nx = arr.length\n loop do\n switch = false\n (x-1).times do |n|\n if arr[n] > arr[n+1]\n arr[n], arr[n+1] = arr[n+1], arr[n]\n switch = true\n endls\n\n end\n break if switch == false\n end\n arr\nend\n\np zombie_alphabetical(zombie_apocalypse_supplies)\n\n# 3. Create a method to see if a particular item (string) is in the\n# zombie_apocalypse_supplies. Do not use any special built-in methods.\n# For instance: are boots in your list of supplies?\n# ----\n\ndef search_supplies(arr, str)\n arr.each_index do |idx|\n if arr[idx] == str\n return \"Yes, #{str} is in the zombie apocalypse supplies.\"\n elsif arr[idx+1] == nil\n return \"No, these #{str} are not part of the zombie supplies list.\"\n else\n next\n end\n end\nend\n\np search_supplies(zombie_apocalypse_supplies, \"boot\")\n\n# 4. You can't carry too many things, you've only got room in your pack for 5.\n# Remove items in your zombie_apocalypse_supplies in any way you'd like,\n# leaving only 5. Do not use any special built-in methods.\n# ----\n\ndef only_five(arr)\n five_items = []\n n = (0..4).to_a\n n.each do |x|\n five_items << arr[x]\n end\n five_items\nend\n\np only_five(zombie_apocalypse_supplies)\n\n# 5. You found another survivor! This means you can combine your supplies.\n# Create a new combined supplies list out of your zombie_apocalypse_supplies\n# and their supplies below. You should get rid of any duplicate items.\n# Find the built-in method that helps you accomplish this in the Ruby\n# documentation for Arrays.\nother_survivor_supplies = [ \"warm clothes\", \"rations\", \"compass\", \"camp stove\",\n \"solar battery\", \"flashlight\"]\n# ----\n\ndef combine_supplies(arr1, arr2)\n combined_items = arr1.concat(arr2)\n combined_items_s = zombie_alphabetical(combined_items)\n combined_items_s.uniq\nend\n\np combine_supplies(zombie_apocalypse_supplies, other_survivor_supplies)\n# Hash Drills\n\nextinct_animals = {\n \"Tasmanian Tiger\" => 1936,\n \"Eastern Hare Wallaby\" => 1890,\n \"Dodo\" => 1662,\n \"Pyrenean Ibex\" => 2000,\n \"Passenger Pigeon\" => 1914,\n \"West African Black Rhinoceros\" => 2011,\n \"Laysan Crake\" => 1923\n}\n\n# 1. Iterate through extinct_animals hash, printing each key/value pair\n# with a dash in between the key and value, and an asterisk between each pair.\n# ----\n\ndef print_hsh(hsh1)\n hsh_ast = []\n hsh1.each do |k,v|\n hsh_ast << \"#{k}-#{v}\"\n end\n hsh_ast.join(\"*\")\nend\n\np print_hsh(extinct_animals)\n\n# 2. Keep only animals in extinct_animals if they were extinct before\n# the year 2000. Do not use any special built-in methods.\n# ----\n\ndef extinct_2000(hsh1)\n hsh_2000 = {}\n hsh1.each do |k, v|\n if v < 2000\n hsh_2000[k] = v\n end\n end\n hsh_2000\nend\n\np extinct_2000(extinct_animals)\n\n# 3. Our calculations were completely off, turns out all of those animals went\n# extinct 3 years before the date provided. Update the values in extinct_animals\n# so they accurately reflect what year the animal went extinct.\n# Do not use any special built-in methods.\n# ----\n\ndef extinct_correction(hsh1)\n updated_hsh = {}\n hsh1.each do |k, v|\n updated_hsh[k] = v-3\n end\n updated_hsh\nend\n\np extinct_correction(extinct_animals)\n\n# 4. You've heard that the following animals might be extinct, but you're not sure.\n# Check if they're included in extinct_animals, one by one:\n# \"Andean Cat\"\n# \"Dodo\"\n# \"Saiga Antelope\"\n# Do not use any special built-in methods.\n# ----\n\ndef check_extinct(hsh1, str)\n leftovers = []\n hsh1.each_key do |k|\n if k == str\n return \"Yes, the #{str} is extinct.\"\n end\n end\n return \"No, the #{str} is not extinct.\"\nend\n\nputs check_extinct(extinct_animals, \"Andean Cat\")\nputs check_extinct(extinct_animals, \"Dodo\")\nputs check_extinct(extinct_animals, \"Saiga Antelope\")\n\n\n# 5. We just found out that the Passenger Pigeon is actually not extinct!\n# Remove them from extinct_animals and return the key value pair as a two item array.\n# Find the built-in method that helps you accomplish this in the Ruby documentation\n# for Hashes.\n# ----\n\ndef remove_animal(hsh1, str)\n remove_hsh = {}\n hsh1.each do |k, v|\n if k == str\n remove_hsh[k] = v\n end\n end\n remove_hsh.flatten\nend\n\np remove_animal(extinct_animals, \"Passenger Pigeon\")", "title": "" }, { "docid": "fdc30d52c9adc32c82e291f2f3bc3b99", "score": "0.58799267", "text": "def problem206\n Math.sqrt(1020304050607080900).floor.upto(m = Math.sqrt(1929394959697989990).ceil) do |x|\n if (s = x.to_s)[s.length - 1].to_i % 2 == 0\n puts \"#{x} of #{m}\"\n q = x**2\n if(s = q.to_s)[18].to_i == 0 && s[16].to_i == 9 && s[14].to_i == 8 && s[12].to_i == 7 && s[10].to_i == 6 && s[8].to_i == 5 && s[6].to_i == 4 && s[4].to_i == 3 && s[2].to_i == 2\n puts s\n break\n end\n end\n end\nend", "title": "" }, { "docid": "693eeb2a9fb3ae3d838d1d74ed8e9ddf", "score": "0.58708435", "text": "def marsExploration(s)\n count = s.length / 3\n sum = 0\n count.times.each do |t|\n sum += 1 if s[3*t + 0] != 'S'\n sum += 1 if s[3*t + 1] != 'O'\n sum += 1 if s[3*t + 2] != 'S'\n end\n sum\nend", "title": "" }, { "docid": "4fe4698600eed74a37f62b10904b2103", "score": "0.5870423", "text": "def get_sandwich(string)\nbread_count = 0\n (string.length-4).times do |i|\n if string[i..i+4] == \"bread\" && bread_count == 0\n string = string[i+5..(string.length-1)]\n bread_count += 1\n end\n if string[(string.length-5-i)..(string.length-1-i)] == \"bread\" && bread_count == 1\n string = string[0..(string.length-6-i)]\n bread_count += 1\n end\n end\n if bread_count == 2 \n return string\n else \n return \"\"\n end\nend", "title": "" }, { "docid": "fe5f0e333a066eeb9c10bcfb9ade0e8c", "score": "0.5870293", "text": "def elf_house_present_counter(magic_num)\n magic_num /= 10\n return 'House #1' if magic_num < 11\n (2..magic_num).each do |house_num|\n house_factors_sum = house_num.factors_sum\n if house_factors_sum >= magic_num\n return \"The House you are looking for is: ##{house_num}\\n\" + \"It has #{house_factors_sum} presents!\"\n end\n end\nend", "title": "" }, { "docid": "7c89b4b7aba1befe09b838aaf0f6814e", "score": "0.58683836", "text": "def solve(str)\n sub_strings_arr = sub_strings(str)\n odds = []\n sub_strings_arr.each do |string|\n odds << string if string.to_i.odd?\n end\n odds.size\nend", "title": "" }, { "docid": "e9585cb8107ddba30dfb3d587cce2182", "score": "0.58642095", "text": "def is_typo this, of_that\n # ignore 1 letter variables\n if this.length == 1 or of_that.length == 1\n return false\n end\n\n # ignore difference bigger than 4 letters\n if (this.length - of_that.length).abs > 4\n return false\n end\n\n # cost[i][j] = the cost to transform the first i characters \n # of this in to the first j characters of of_that\n # cost[i][0] = 0\n # cost[0][j] = 0\n # cost[i][j] = 1 + cost[i-1][j-1] if this[i] == this[j]\n\n n = this.length \n m = of_that.length\n\n cost = Array.new(n + 1) {\n Array.new(m + 1, 0)\n }\n \n\n for i in 1..n\n cost[i][0] = i * TYPE_COST\n end\n\n for j in 1..m\n cost[0][j] = j * TYPE_COST\n end\n\n for i in 1..n\n for j in 1..m\n x = this[i-1].downcase\n y = of_that[j-1].downcase\n\n cost[i][j] = [\n cost[i-1][j] + TYPE_COST,\n cost[i][j-1] + TYPE_COST,\n cost[i-1][j-1] + TYPO_COST[x][y]\n ].min\n end\n end\n\n # puts cost[n][m]\n\n return cost[n][m] <= 18\nend", "title": "" }, { "docid": "3d0942583ab2e4df0dde23572f953bfa", "score": "0.5861398", "text": "def jumpingOnClouds(c)\n s = 0\n i = 0\n\n while i < c.length\n if c[i + 2] && c[i + 2] != 1\n s += 1\n i += 1\n elsif c[i + 1] && c[i + 1] != 1\n s += 1\n end\n i += 1\n end\n\n return s\nend", "title": "" }, { "docid": "d72ccae3f326a4e3222492869096fb16", "score": "0.58583677", "text": "def day_one_part_one(input)\n n = input.strip.split('')\n\n\n # ------- SOL 1 ------\n # puts \"n is #{n}\"\n # puts \"n.rotate(1) is #{n.rotate(1)}\"\n # puts \"n.zip(n.rotate(1)) is #{n.zip(n.rotate(1))}\"\n puts n.zip(n.rotate(1))\n .select { |x, y| x == y }\n .map(&:first)\n .map(&:to_i)\n .inject(:+)\n # ------- SOL 2 ------\n # puts \"n.each_cons(2).to_a is #{n.each_cons(2).to_a}\"\n # puts \"n.each_cons(2).to_a.select { |x, y| x == y } is #{n.each_cons(2).to_a.select { |x, y| x == y }}\"\n # puts \"n.each_cons(2).to_a.select { |x, y| x == y }.map(&:first) is #{n.each_cons(2).to_a.select { |x, y| x == y }.map(&:first)}\"\n # puts \"n.each_cons(2).to_a.select { |x, y| x == y }.map(&:first).map(&:to_i) is #{n.each_cons(2).to_a.select { |x, y| x == y }.map(&:first).map(&:to_i)}\"\n # n << n.first\n # puts n.each_cons(2).to_a\n # .select { |x, y| x == y }\n # .map(&:first)\n # .map(&:to_i)\n # .inject(:+)\n #\n # ------- SOL 3 ------\n # sum = 0\n # digits = input.strip.split('')\n # digits.each_index do |i|\n # if i == digits.size - 1\n # sum += digits.last.to_i if digits.last == digits.first\n # elsif digits[i] == digits[i + 1]\n # sum += digits[i].to_i\n # end\n # end\n # puts sum\nend", "title": "" }, { "docid": "abbdaf70b59d19f7df2c8b5397833b80", "score": "0.5855319", "text": "def solution(s, p, q)\n # write your code in Ruby 2.2\n a = []\n p.each_with_index do |e, i|\n cut = s[p[i]..q[i]]\n if cut.index('A')\n a.push(1)\n elsif cut.index('C')\n a.push(2)\n elsif cut.index('G')\n a.push(3)\n else\n a.push(4)\n end\n end\n a\nend", "title": "" }, { "docid": "4ddb265e96896424132c7b9abe9713d5", "score": "0.58547664", "text": "def ArithGeo_2(arr)\n#test for arithmetic sequence first\n #sum from i = 1 to n, = n(n+1) / 2 for sum of 1 .. n\n #general sum of an arithmetic sequence\n #a[1] - a[0] = delta\n #a[0] = a\n #arr.size = n\n #sum = a * n + delta( n(n-1) / 2 )\n sum = arr.sum\n arith_sum = arr[0] * arr.size + (arr[1] - arr[0]) * ((arr.size - 1) * (arr.size) / 2 )\n return \"Arithmetic\" if sum == arith_sum\n\n#test for geometric sequence next\n #sum from i = 1 to n, = { (a * (1 - r ** n) ) / (1 - r) }\n r = arr[1] / arr[0]\n a = arr[0]\n n = arr.size\n geo_sum = (a * (1 - (r ** n)) ) / (1 - r) if r != 1\n if r == 1\n return \"-1\"\n end\n return \"Geometric\" if geo_sum == sum\n\n\n return \"-1\"\nend", "title": "" }, { "docid": "b7c2a8e1ea8c6b545090e56a7974c707", "score": "0.58520156", "text": "def find_jewels(jewels, stones)\n jewels_array = jewels.split('')\n stones_array = stones.split('')\n result_hash = {}\n result = 0\n\n stones_array.each do |stone|\n if result_hash[stone]\n result_hash[stone] += 1\n else\n result_hash[stone] = 1\n end\n end\n\n jewels_array.each do |jewel|\n if result_hash[jewel]\n result += result_hash[jewel]\n else\n result\n end\n end\n\n result\nend", "title": "" }, { "docid": "eda747fe4aa95ca303208ac6cbacfbab", "score": "0.5847282", "text": "def solution\n\n d8_10s = []\n d7_10s = []\n d6_10s = []\n d5_10s = []\n d4_10s = []\n d3_10s = []\n d2_10s = []\n d1_10s = []\n 17.step(987, 17) do |n| \n n = n.to_s.split(\"\").to_a\n n = [\"0\"] + n if n.count == 2\n d8_10s << n if n.count == n.uniq.count\n end\n \n d8_10s.uniq.each do |d8_10|\n d8_10[0..1].join.to_i.step(987, 100) do |n|\n d7 = (n/100).to_s\n if n % 13 == 0 && !d8_10.include?(d7)\n d7_10s << [d7] + d8_10\n end\n end\n end\n\n \n d7_10s.uniq.each do |d7_10|\n d7_10[0..1].join.to_i.step(987, 100) do |n|\n d6 = (n/100).to_s\n if n % 11 == 0 && !d7_10.include?(d6)\n d6_10s << [d6] + d7_10\n end\n end\n end\n \n d6_10s.uniq.each do |d6_10|\n d6_10[0..1].join.to_i.step(987, 100) do |n|\n d5 = (n/100).to_s\n if n % 7 == 0 && !d6_10.include?(d5)\n d5_10s << [d5] + d6_10\n end\n end\n end\n \n d5_10s.uniq.each do |d5_10|\n d5_10[0..1].join.to_i.step(987, 100) do |n|\n d4 = (n/100).to_s\n if n % 5 == 0 && !d5_10.include?(d4)\n d4_10s << [d4] + d5_10\n end\n end\n end\n \n d4_10s.uniq.each do |d4_10|\n d4_10[0..1].join.to_i.step(987, 100) do |n|\n d3 = (n/100).to_s\n if n % 3 == 0 && !d4_10.include?(d3)\n d3_10s << [d3] + d4_10\n end\n end\n end\n \n d3_10s.uniq.each do |d3_10|\n d3_10[0..1].join.to_i.step(987, 100) do |n|\n d2 = (n/100).to_s\n if n % 2 == 0 && !d3_10.include?(d2)\n d2_10s << [d2] + d3_10\n end\n end\n end\n\n d2_10s.uniq.each do |d2_10|\n 10.times do |d1|\n if !d2_10.include?(d1.to_s)\n d1_10s << ([d1] + d2_10).join.to_i\n end\n end\n end\n \n d1_10s\nend", "title": "" }, { "docid": "b2d1c4efb0ce3d7f6e9ed6262fcfe11a", "score": "0.58420587", "text": "def solve(a)\n # Complete this function\n $sum_1=0\n for i in (0..a.size/2-1)\n \t#puts \"a->#{a[i]}\"\n \t$sum_1=$sum_1+a[i]\n\n end\n #puts $sum\n $sum_2=0\n for i in (a.size/2..a.size-1)\n \t#puts \"b->#{a[i]}\"\n $sum_2=$sum_2+a[i]\n end\n #puts $sum\n $temp=$sum_1-$sum_2\n if $temp < 0\n \treturn $temp*-1\n else\n \treturn $temp\n end\n\nend", "title": "" }, { "docid": "7387f3971e522eed339b3d9083b7a592", "score": "0.5839426", "text": "def solve(string)\n substrings = []\n \n 0.upto((string.length - 1)) do |current_index|\n current_index.upto((string.length - 1)) do |iteration_index|\n substrings << string.slice(0..iteration_index).to_i\n end\n end\n \n substrings.select! do |num|\n num.odd?\n end\n \n substrings.length \nend", "title": "" }, { "docid": "45481e5373649e7b3ee8090fccf3c1d6", "score": "0.58371526", "text": "def crunch(sentence)\n split_sentence = sentence.chars\n return if sentence.length == 1\n count = 0\n store_character = []\n loop do \n if split_sentence[count] != split_sentence[count + 1]\n store_character.push(split_sentence[count]) \n end \n count += 1\n break if count == sentence.length \n end \n crunched = store_character.join(\"\")\nend", "title": "" }, { "docid": "d198ce6530d8641577166dd071790bfa", "score": "0.5833868", "text": "def hard(string)\n sum = 0\n steps = string.length / 2\n string.length.times do |i|\n j = (i + steps) % string.length\n sum += check(string[i], string[j])\n end\n sum\nend", "title": "" }, { "docid": "0fca09242c00be44024f4565a0da0c63", "score": "0.58261234", "text": "def dominant_octopus(fish)\n big_fish = fish.sort { |a, b| b.length <=> a.length } # O(n log n) // since sort uses quick sort algorithm\n big_fish[0]\nend", "title": "" }, { "docid": "8680c940dfaba755439e1e4ddbcde59d", "score": "0.5824806", "text": "def solution(s, p, q)\n\n stats_a = []\n stats_c = []\n stats_g = []\n\n minimals = []\n\n stats_a[0] = 0\n stats_c[0] = 0\n stats_g[0] = 0\n (1..(s.length)).each do |i|\n stats_a[i] = stats_a[i-1]\n stats_c[i] = stats_c[i-1]\n stats_g[i] = stats_g[i-1]\n\n if(s[i-1] == \"A\")\n stats_a[i] = stats_a[i] + 1\n elsif(s[i-1] == \"C\")\n stats_c[i] = stats_c[i] + 1\n elsif(s[i-1] == \"G\")\n stats_g[i] = stats_g[i] + 1\n end\n end\n\n (0..(p.length-1)).each do |j|\n start_index = p[j]\n end_index = q[j] + 1\n\n if(stats_a[end_index] - stats_a[start_index] > 0)\n minimals[j] = 1\n elsif(stats_c[end_index] - stats_c[start_index] > 0)\n minimals[j] = 2\n elsif(stats_g[end_index] - stats_g[start_index] > 0)\n minimals[j] = 3\n else\n minimals[j] = 4\n end\n end\n minimals\nend", "title": "" }, { "docid": "e24a122b3a6c94bbd90f67ed1d2d28d3", "score": "0.5820241", "text": "def dominant_octopus(fish_arr) # merge sort though quicksort would technically work and would be more ideal to practice on but is technically worst case n^2 actually fuck it let's just do a quicksort and then merge nah let's do a merge you don't remember that as well right\n merge_sort(fish_arr)[-1] # just get the last element lol\nend", "title": "" }, { "docid": "7c341432fa7294e71154b72e87bcc162", "score": "0.5818336", "text": "def problem_75\n p3 = lambda do |m,n|\n raise \"bad value\" if m == n\n m,n = n,m if m < n\n mm = m*m\n nn = n*n\n [mm - nn, 2*m*n, mm + nn]\n end\n\n max = 1_500_000\n upto = Math.sqrt(max/2).to_i\n# upto = max\n hits = Hash.new\n\n (1..upto).each do |x|\n hit = 0\n y = x + 1\n ((x+1)..(upto+1)).each do |y|\n next unless (x+y).odd?\n a,b,c = p3.call(x,y).sort\n d = a+b+c\n if d <= max\n k = 1\n begin\n hits[d*k] ||= {}\n hits[d*k][[a*k,b*k,c*k].sort.join(\"-\")] = true\n hit += 1\n k += 1\n end while d*k <= max\n else\n break\n end\n end\n puts \"for x = #{x}, #{hit} hits\"\n end\n puts hits.length\n h = hits.select {|k,v| v.length == 1}\n h.length\nend", "title": "" }, { "docid": "d126b794382588618d12438a5e46269e", "score": "0.58124113", "text": "def solution(a)\n a.sort!\n triplets = 0\n a.each_with_index do |p, i|\n k = i + 2\n a[i+1..-1].each_with_index do |q, j|\n k += 1 while k < a.length && p + q > a[k]\n triplets += k - j - i - 2\n end\n end\n triplets\nend", "title": "" }, { "docid": "5964f0b9dfe84fc9e32e4ebbcf8a9e31", "score": "0.58118093", "text": "def solution1\n\t(1..50).each do |i|\n\tnumber = String.new\n\tnumber << \"Rubies \" if i % 3 == 0\n\tnumber << \"On The Block\" if i % 5 == 0\n\tnumber << i.to_s if number.empty?\n\tputs number\n\tend\nend", "title": "" }, { "docid": "81020d5d0e13161a4975b6bcb4887013", "score": "0.5811688", "text": "def goodVsEvil(good, evil)\n good_total = good.split(' ').map(&:to_i).map.with_index do |num, index|\n if index == 0\n num\n elsif index == 1\n num * 2\n elsif (index == 2) or (index == 3)\n num * 3\n elsif index == 4\n num * 4\n elsif index == 5\n num * 10\n end\n end.inject(:+)\n\n evil_total = evil.split(' ').map(&:to_i).map.with_index do |num, index|\n if index == 0\n num\n elsif (index == 1) or (index == 2) or (index == 3)\n num * 2\n elsif index == 4\n num * 3\n elsif index == 5\n num * 5\n elsif index == 6\n num * 10\n end\n end.inject(:+)\n\n good_total == evil_total ? \"Battle Result: No victor on this battle field\" : ( good_total > evil_total ? \"Battle Result: Good triumphs over Evil\" : \"Battle Result: Evil eradicates all trace of Good\" )\nend", "title": "" }, { "docid": "4a4eefe9eb4327fd1f51637a3d87b34e", "score": "0.58085454", "text": "def solution(a)\n a2 = (1..(a.size+1)).to_a\n r = a2-a\n return r.join(\"\").to_i\nend", "title": "" }, { "docid": "6c80ed19396ea772cefec656a0a7051b", "score": "0.5807881", "text": "def num_cats_and_bulls(str, guess)\n cows = 0 \n bulls = 0\n hash = {}\n for i in 0..guess.size-1\n if (str[i] == guess[i])\n bulls += 1\n else\n hash[guess[i]] = i\n end\n end\n\n for i in 0..str.size-1\n if (hash[str[i]] && hash[str[i]] != i)\n cows+=1\n end\n end\n puts \"cows=#{cows}, bulls=#{bulls}\"\nend", "title": "" }, { "docid": "2f2387a71509ebee78470516732568d9", "score": "0.5807188", "text": "def wordify(n)\nhash19={ one:1, two:2, three: 3, four: 4, five: 5, six: 6, seven: 7, eight: 8, nine: 9 }\nhash1119={ eleven:11, twelve: 12, thirteen: 13, fourteen: 14, fifteen: 15, sixteen: 16, seventeen: 17, eighteen: 18, nineteen: 19 }\nhash1090={ ten: 10, twenty: 20, thirty: 30, forty: 40, fifty: 50, sixty: 60, seventy: 70, eighty: 80, ninety: 90 }\nhash199=hash19.merge(hash1119)\nhash199=hash199.merge(hash1090)\nhashremain={ 'twenty one'=> 21,\n 'twenty two'=> 22, \n 'twenty three'=> 23,\n 'twenty four'=> 24,\n 'twenty five'=> 25,\n 'twenty six'=> 26,\n 'twenty seven'=> 27,\n 'twenty eight'=> 28,\n 'twenty nine'=> 29,\n 'thirty one'=> 31,\n 'thirty two'=> 32,\n 'thirty three'=> 33,\n 'thirty four'=> 34,\n 'thirty five'=> 35,\n 'thirty six'=> 36,\n 'thirty seven'=> 37,\n 'thirty eight'=> 38,\n 'thirty nine'=> 39,\n 'forty one'=> 41,\n 'forty two'=> 42,\n 'forty three'=> 43,\n 'forty four'=> 44,\n 'forty five'=> 45,\n 'forty six'=> 46,\n 'forty seven'=> 47,\n 'forty eight'=> 48,\n 'forty nine'=> 49,\n 'fifty one'=> 51,\n 'fifty two'=> 52,\n 'fifty three'=> 53,\n 'fifty four'=> 54,\n 'fifty five'=> 55,\n 'fifty six'=> 56,\n 'fifty seven'=> 57,\n 'fifty eight'=> 58,\n 'fifty nine'=> 59,\n 'sixty one'=> 61,\n 'sixty two'=> 62,\n 'sixty three'=> 63,\n 'sixty four'=> 64,\n 'sixty five'=> 65,\n 'sixty six'=> 66,\n 'sixty seven'=> 67,\n 'sixty eight'=> 68,\n 'sixty nine'=> 69,\n 'seventy one'=> 71,\n 'seventy two'=> 72,\n 'seventy three'=> 73,\n 'seventy four'=> 74,\n 'seventy five'=> 75,\n 'seventy six'=> 76,\n 'seventy seven'=> 77,\n 'seventy eight'=> 78,\n 'seventy nine'=> 79,\n 'eighty one'=> 81,\n 'eighty two'=> 82,\n 'eighty three'=> 83,\n 'eighty four'=> 84,\n 'eighty five'=> 85,\n 'eighty six'=> 86,\n 'eighty seven'=> 87,\n 'eighty eight'=> 88,\n 'eighty nine'=> 89,\n 'ninety one'=> 91,\n 'ninety two'=> 92,\n 'ninety three'=> 93,\n 'ninety four'=> 94,\n 'ninety five'=> 95,\n 'ninety six'=> 96,\n 'ninety seven'=> 97,\n 'ninety eight'=> 98,\n 'ninety nine'=> 99 }\nhash199=hash199.merge(hashremain)\n\nif n == (100 || 200 || 300 || 400 || 500 || 600 || 700 || 800 || 900)\n hash19.invert[(n.to_s.split(//)[0]).to_i].to_s + ' hundred' \nelsif n.to_s.split(//).size == 3\n hash19.invert[(n.to_s.split(//)[0]).to_i].to_s + ' hundred ' + hash199.invert[(n.to_s.split(//)[1]+n.to_s.split(//)[2]).to_i].to_s\nelsif n.to_s.split(//).size == 2 || n.to_s.split(//).size == 1\n hash199.invert[n].to_s\nend\nend", "title": "" }, { "docid": "ce25f7f355789544b562deadced11f64", "score": "0.58044803", "text": "def reduce_counting_candy(instructions)\n\n jars_count = instructions[0]\n\n # Fill jars\n\n total_candy = instructions[1..-1].reduce(0) { |total, instruction|\n num_jars = (instruction[1]+1) - instruction[0]\n # num_jars = (instructions[0]..instructions[1]).to_a.length\n candy_qty = num_jars * instruction[-1]\n total += candy_qty\n\n }\n\n # instructions[1..-1].each do |instruction|\n\n # num_jars = (instruction[1]+1) - instruction[0]\n # candy_qty = num_jars * instruction[-1]\n # total_candy += candy_qty\n\n # end\n\n total_candy/jars_count\nend", "title": "" }, { "docid": "fbbbcb3b0e2fef3847603a76fc2312d6", "score": "0.5802014", "text": "def day_1_part_2(sequence)\n sequence_digits = sequence.chars.map(&:to_i)\n sequence_digits_reference = sequence_digits * 2\n\n sum = 0\n\n sequence_digits.each.with_index do |digit, i|\n sum += digit if digit == sequence_digits_reference[i + sequence.length / 2]\n end\n\n sum\nend", "title": "" }, { "docid": "a2905991bb6a66798755ebf3edec16dd", "score": "0.5796415", "text": "def clever_octopus(fishTank) \nbiggestFish = fishTank[0]\n (1...fishTank.length).each do |i|\n biggestFish = fishTank[i] if biggestFish.length < fishTank[i].length\n end\n biggestFish\nend", "title": "" }, { "docid": "6c75c688a8c9abcf195476c507e9ea45", "score": "0.5795406", "text": "def solution(a)\n leader, count = array_leader(a)\n return 0 unless leader\n\n n = a.size\n head_count = 0\n total_equis = 0\n a.each_with_index do |e, i|\n head_count += 1 if e == leader\n tail_count = count - head_count\n\n if (head_count > (i + 1)/2) && (tail_count > (n - 1 - i)/2)\n total_equis += 1\n end\n end\n\n total_equis\nend", "title": "" }, { "docid": "3f2b381a3c1c588bb3255a76b94c2406", "score": "0.5794893", "text": "def strong_enough(earthquake, age)\n arr = []\n earthquake.each do |array|\n arr.push(array.inject(:+))\n end\n earthquake_str = arr.inject(:*)\n\n building_str = 1000 * (0.99**age)\n if building_str >= earthquake_str\n puts \"Safe!\"\n elsif building_str < earthquake_str\n puts \"Needs Reinforcement!\"\n end\nend", "title": "" }, { "docid": "b03da38241229c4fb79a6fd50999d19c", "score": "0.5789889", "text": "def problem5\n n = 20\n divs = (1..n).to_a\n lcms = Array.new\n\n 2.upto(20) do |z|\n divs.combination(z).to_a.each do |a|\n prod = 1\n a.each do |b|\n prod*=b\n end\n found = true\n 1.upto(20) do |z|\n if prod % z != 0\n found = false\n break\n end\n end\n if found\n lcms << prod\n break\n end\n end\n end\n\n puts lcms.uniq.sort[0]\nend", "title": "" }, { "docid": "537891b880848a8f972781ece5050924", "score": "0.5788322", "text": "def part2(input)\n sum = 0\n input.split('').each_index do |i|\n next_i = (input.length / 2) + i\n if next_i > input.length-1\n next_i -= input.length\n end\n\n if input[i] == input[next_i]\n sum += input[i].to_i\n end\n end\n puts sum\nend", "title": "" }, { "docid": "b8ddeb9ad1e7543e50f26119b0b5db78", "score": "0.57858944", "text": "def solution(s, p, q)\n # write your code in Ruby 2.2\n hash = { 'A'=> 1, 'C'=> 2, 'G'=> 3, 'T'=> 4 }\n array = []\n p.each_with_index do |e, i|\n low = 4\n cut = s[p[i]..q[i]]\n cut.each_char { |c| low = hash[c] if hash[c] < low }\n array.push(low)\n end\n array\nend", "title": "" }, { "docid": "32a0ef79e59e9f9547a01b3fcc7312dd", "score": "0.578525", "text": "def solution(a)\n acc = 0\n sum = 0\n\n a.each do |n|\n if n == 0\n acc += 1\n else\n sum += acc\n end\n\n return -1 if sum > 1000000000\n end\n\n sum\nend", "title": "" }, { "docid": "e332393e33f7fc2992053e0a24864665", "score": "0.57849216", "text": "def rps_tournament_winner(input_encoded)\n lookup_list=Hash[\"rr\"=>0,\"sr\"=>1,\"pr\"=>0,\"rs\"=>0,\"ss\"=>0,\"ps\"=>1,\"rp\"=>1,\"sp\"=>0,\"pp\"=>0]\n xx=input_encoded.flatten.each_slice(2).to_a.each_slice(2).to_a\n\n #d is the variable that holds the size of the flattened input array.\n #Since each entry in input array consists of two elements: Name and strategy\n #Iterations required are the output value of exp_value (d)-1\n\n d=input_encoded.flatten.size\n iteration=exp_value(d)-1\n for round in 0..(iteration-1)\n c=Array.new(xx.size)\n for i in 0..((xx.size)-1)\n input=xx[i]\n string_check=(\"#{input[0][1]}\"+\"#{input[1][1]}\").downcase\n c[i]=input[lookup_list[string_check]]\n end\n d=c.flatten.size\n xx=c.flatten.each_slice(2).to_a.each_slice(2).to_a\n end\n puts \"#{xx}\"\nend", "title": "" } ]
83a70dd95bacd7a225247e120268ffb5
GET we_all_family_stats_admin_weafam_stats_path(format: "xls") SAVE file 'we_all_family_stats.xls'
[ { "docid": "f82236e62a8bc1a2192ef00447eb5c5c", "score": "0.75040764", "text": "def we_all_family_stats\n @weafam_stats = WeafamStat.order('id DESC')\n respond_to do |format|\n format.html\n format.csv { render text: @weafam_stats.to_csv }\n # format.xls { send_data @weafam_stats.to_csv(col_sep: \"\\t\") }\n # format.xlsx {render xlsx: 'download',filename: \"payments.xlsx\"}\n format.xls { send_data @weafam_stats.to_csv(col_sep: \"\\t\") }\n # format.xls\n end\n end", "title": "" } ]
[ { "docid": "737a3381ae164528f2992de2c3ef4fc7", "score": "0.6723797", "text": "def report_xls\n book = Spreadsheet::Workbook.new\n\n add_thing_sheet(book)\n add_user_sheet(book)\n\n buffer = StringIO.new()\n\n book.write buffer\n filename = Time.now.localtime.strftime(\"edot-%Y-%m-%d-%H%M.xls\")\n\n send_data buffer.string, :filename => filename, \n :content_type => 'application/vnd.ms-excel'\n end", "title": "" }, { "docid": "c413fb09130e4feeef10dee0ffcd381b", "score": "0.64890563", "text": "def index\n \t#headers['Content-Type'] = \"application/vnd.ms-excel\"\n \theaders['Content-Disposition'] = 'attachment; filename=\"report.xls\"'\n \t#headers['Cache-Control'] = ''\n \t@users = User.find(:all)\n \tend", "title": "" }, { "docid": "21dc0c7d89ca05ee049231a11fde178c", "score": "0.6334611", "text": "def export_as_xls\n Spreadsheet.client_encoding = 'UTF-8'\n output = \"#{RAILS_ROOT}/tmp/status_#{Date.today.day}_#{Date.today.month}.xls\"\n book = Spreadsheet::Workbook.new\n forwarded_sheet = book.create_worksheet :name => \"Forwarded\"\n shortlisted_sheet = book.create_worksheet :name => \"Shortlisted\"\n offered_sheet = book.create_worksheet :name => \"Offered\"\n joining_sheet = book.create_worksheet :name => \"Joining\"\n interviews_sheet = book.create_worksheet :name => \"Interviews\"\n\n forwarded = get_hr_matches(\"FORWARDED\")\n fill_forwarded_shortlisted_data(forwarded_sheet, forwarded)\n shortlisted = get_hr_matches(\"SHORTLISTED\")\n fill_forwarded_shortlisted_data(shortlisted_sheet, shortlisted)\n offered_matches = get_all_req_matches_of_status(\"OFFERED\")\n fill_offered_data(offered_sheet, offered_matches)\n\n find_filter_interviews_based_upon_processing\n all_interview_matches = @interviews_late + @interviews_done + @under_process\n fill_interview_data(interviews_sheet, all_interview_matches)\n\n joining_matches, joined_resumes, not_joined_resumes = find_joining_resumes\n fill_joining_data(joining_sheet, joining_matches, joined_resumes, not_joined_resumes)\n\n book.write output\n\n # Send the file to download\n send_file(output)\n end", "title": "" }, { "docid": "d94e104c21218e02e0d51ab6f6ff0a57", "score": "0.6325554", "text": "def ws_reporting\n begin\n @xml = Builder::XmlMarkup.new(:indent => 1) #Builder::XmlMarkup.new(:target => $stdout, :indent => 1)\n get_projects\n\n @centers = Workstream.all()\n @centers = @centers.map { |c| stats_for_center(c) }\n\n @wps = @wps.select{ |w| w.get_status.status > 0}.sort_by { |w|\n [w.workstream, w.project_name, w.name]\n }\n\n headers['Content-Type'] = \"application/vnd.ms-excel\"\n headers['Content-Disposition'] = 'attachment; filename=\"WS_Reporting.xls\"'\n headers['Cache-Control'] = ''\n render(:layout=>false)\n rescue Exception => e\n render(:text=>\"<b>#{e}</b><br/>#{e.backtrace.join(\"<br/>\")}\")\n end\n end", "title": "" }, { "docid": "d94e104c21218e02e0d51ab6f6ff0a57", "score": "0.6325554", "text": "def ws_reporting\n begin\n @xml = Builder::XmlMarkup.new(:indent => 1) #Builder::XmlMarkup.new(:target => $stdout, :indent => 1)\n get_projects\n\n @centers = Workstream.all()\n @centers = @centers.map { |c| stats_for_center(c) }\n\n @wps = @wps.select{ |w| w.get_status.status > 0}.sort_by { |w|\n [w.workstream, w.project_name, w.name]\n }\n\n headers['Content-Type'] = \"application/vnd.ms-excel\"\n headers['Content-Disposition'] = 'attachment; filename=\"WS_Reporting.xls\"'\n headers['Cache-Control'] = ''\n render(:layout=>false)\n rescue Exception => e\n render(:text=>\"<b>#{e}</b><br/>#{e.backtrace.join(\"<br/>\")}\")\n end\n end", "title": "" }, { "docid": "95e76755ed57b113593d189cdc48c1a9", "score": "0.63061076", "text": "def index\n @speciality_pulls = SpecialityPull.all\n respond_to do |format|\n format.html\n format.xlsx \n end\n end", "title": "" }, { "docid": "ac26d1fb20c3e0a9692545a347e7b007", "score": "0.6248345", "text": "def show\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render xml: @registered_download.download_registrations }\n format.xls { \n send_data(@registered_download.download_registrations.to_xls(\n headers: @registered_download.headers_for_export,\n columns: @registered_download.columns_for_export), \n filename: \"#{@registered_download.name.gsub(/\\s/,\"-\")}.xls\") \n }\n end\n end", "title": "" }, { "docid": "18eeeaa403d8260d87a9321987c74131", "score": "0.61864716", "text": "def index\n @soglas = Sogla.all\n respond_to do |format|\n format.html\n format.xlsx \n end\n end", "title": "" }, { "docid": "460c4453f0d23be6047a4115ae859862", "score": "0.611831", "text": "def export_school\n xlsx_package = Axlsx::Package.new\n if can?(:view, @admin)\n in_tmpdir do |tmpdir, path|\n @admin.export_excel(xlsx_package, self, tmpdir, path)\n # Send file\n send_file path, :filename => \"school_export[#{@admin.full_name}].xlsx\", \n :type => \"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet\"\n end\n else\n render_unauthorized\n end\n end", "title": "" }, { "docid": "627b46f4e3876b933a5f3b4dca7ff0e7", "score": "0.61078954", "text": "def team_registrations\n book = Spreadsheet::Workbook.new\n sheet1 = book.create_worksheet\n # write out headers\n sheet1[0,0] = 'First Name'\n sheet1[0,1] = 'Last Name'\n sheet1[0,2] = 'Phone'\n sheet1[0,3] = 'Email'\n sheet1[0,4] = 'Team Name'\n sheet1[0,5] = 'Division'\n sheet1[0,6] = 'District'\n sheet1[0,7] = 'Field'\n sheet1[0,8] = 'Paid?'\n sheet1[0,9] = 'Registration Time'\n\n pos = 1\n @team_registrations.each do |team_registration|\n team_registration.teams.each do |team|\n sheet1[pos,0] = team_registration.first_name\n sheet1[pos,1] = team_registration.last_name\n sheet1[pos,2] = team_registration.phone\n sheet1[pos,3] = team_registration.email\n sheet1[pos,4] = team.name\n sheet1[pos,5] = team.division.name\n sheet1[pos,6] = team_registration.district.name\n sheet1[pos,7] = team_registration.district.region.name\n sheet1[pos,8] = team_registration.paid? ? 'YES' : 'NO'\n sheet1[pos,9] = team_registration.created_at.strftime(\"%m/%d/%Y %H:%M:%S\")\n pos = pos + 1\n end\n end\n book.write \"#{RAILS_ROOT}/public/download/team_registrations_#{@report_type}.xls\"\n\n send_file \"#{RAILS_ROOT}/public/download/team_registrations_#{@report_type}.xls\", :filename => \"team_registrations_#{@report_type}.xls\"\n end", "title": "" }, { "docid": "b66c5468a48f569adcb5d51bc631d4ff", "score": "0.60657614", "text": "def index\n respond_to do |format|\n @female110mtshudrle = Female110mtshudrle.new\n format.html\n format.json { render json: Female110mtshudrlesDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "080e855767a4bf00199499fa96552733", "score": "0.6052893", "text": "def show\n \n respond_to do |format|\n format.html\n format.csv { send_data @module_works.to_csv }\n format.xls\n end\n end", "title": "" }, { "docid": "832931cdb3532d5afd8fd802d80e5da8", "score": "0.6043071", "text": "def index\n @loan = Loan.all\n respond_to do |format|\n format.html\n format.xls\n end\n end", "title": "" }, { "docid": "a6717419f4dd1db2b00ffd062284186c", "score": "0.603979", "text": "def core_staff\n book = Spreadsheet::Workbook.new\n sheet1 = book.create_worksheet\n\n # formatting\n header_format = Spreadsheet::Format.new :weight => :bold, :align => :justify\n\n # write out headers\n column = 0\n sheet1[0,column] = 'Name'\n sheet1[0,column+=1] = 'Mobile Phone'\n sheet1[0,column+=1] = 'Email'\n sheet1[0,column+=1] = 'District'\n sheet1[0,column+=1] = 'Field'\n\n sheet1.row(0).default_format = header_format\n\n participants = ParticipantRegistration.by_registration_type('staff').by_event(params['event_id']).ordered_by_first_name\n\n pos = 1\n participants.each do |participant|\n column = 0\n sheet1[pos,column] = participant.full_name_reversed\n sheet1[pos,column+=1] = participant.home_phone\n sheet1[pos,column+=1] = participant.email\n sheet1[pos,column+=1] = !participant.district.nil? ? participant.district.name : ''\n sheet1[pos,column+=1] = !participant.district.nil? ? participant.district.region.name : ''\n pos += 1\n end\n\n # column widths\n sheet1.column(0).width = 25\n sheet1.column(1).width = 15\n sheet1.column(2).width = 30\n sheet1.column(3).width = 25\n sheet1.column(4).width = 25\n\n book.write \"#{RAILS_ROOT}/public/download/event_staff.xls\"\n\n send_file \"#{RAILS_ROOT}/public/download/event_staff.xls\", :filename => \"event_staff.xls\"\n end", "title": "" }, { "docid": "33cac97887d3a967f862f3331113c938", "score": "0.60067314", "text": "def index\n respond_to do |format|\n format.html\n format.json { render json: FemaleShotPutHeadsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "56a85170d4e236053fe9bdc9b3288a89", "score": "0.60051733", "text": "def list_xls\n do_filter\n headers['Content-Type'] = \"application/vnd.ms-excel\"\n headers['Content-Disposition'] = 'attachment; filename=\"excel-export.xls\"'\n headers['Cache-Control'] = ''\n end", "title": "" }, { "docid": "615270a7f795a3bdbee02241e6a8e1a7", "score": "0.60041183", "text": "def show\n @races = @regatta.races\n if has_assistant_rights?\n @teams = @regatta.teams\n else\n @teams = @regatta.teams.where(\"state > ?\", 0)\n end\n file_name = \"Anmalningsrapport--#{@regatta.name}--exporterad--#{DateTime.now.iso8601}\".parameterize\n respond_to do |format|\n format.html\n format.xlsx {\n response.headers['Content-Disposition'] = \"attachment; filename=#{file_name}.xlsx\"\n }\n end\n end", "title": "" }, { "docid": "69c40085b601e2330222871de0c0261a", "score": "0.6000663", "text": "def index\n respond_to do |format|\n format.html\n format.json { render json: Female100mtshurdlesHeadsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "9dff7fc6a52d74d5806d0767d520824f", "score": "0.5997957", "text": "def index\n @witnesses = Witness.all\n respond_to do |format|\n format.xlsx {\n response.headers[\n 'Content-Disposition'\n ] = \"attachment; filename='Testigos.xlsx'\"\n }\n format.html { render :index }\n end\n end", "title": "" }, { "docid": "27686da830380d018be58a0ec37f678f", "score": "0.5981182", "text": "def xls\n header = [ \"PP #{@payperiod}\", '', \"Pay Period #{@payperiod} Ended #{@pp_enddate}\" ]\n\n @report = Rms::Export::XLSSpreadsheet.new('Latest FTE Report', header)\n @filename = \"#{@filename}.xls\"\n @filetype = 'application/vnd.ms-excel'\n\n @report.add_entry [ 'GD', 'ST', 'NAME', 'HRS', 'FTEE' ], @report.format.bold\n\n generate_ftes\n\n @report.add_blank\n @report.add_entry [ '', '', '', 'FTE', @fte_total ], @report.format.bold\n\n @report.add_blank\n @report.add_entry [ '', '', \"New Hires Added PP #{@payperiod+1} EOD #{@eod_date}\" ], @report.format.bold\n\n generate_fte_new_hires\n \n @report.add_blank\n @report.add_entry [ '', '', \"Losses Subtracted PP #{@payperiod} a/o #{@loss_date}\" ], @report.format.bold\n\n generate_fte_losses\n\n @report.add_blank\n @report.add_entry [ '', '', \"TOTAL FTE A/O #{@loss_date}\", '', @fte_ao_total ]\n @report.format_entry [2,3,4], @report.format.highlight\n\n @report.add_blank 2\n @report.add_entry [ '', '', \"Total Employees on board as of #{@loss_date}\", '', @board_total ]\n @report.format_entry [2,3,4], @report.format.highlight\n\n @report.process.string\n end", "title": "" }, { "docid": "d2bfab7ed347490e3235066af5fc3858", "score": "0.5971882", "text": "def show\n CheckoutStatHasUser.per_page = 65534 if params[:format] == 'csv' or params[:format] == 'tsv'\n @stats = @user_checkout_stat.checkout_stat_has_users.order('checkouts_count DESC, user_id').page(params[:page])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @user_checkout_stat }\n format.csv\n format.tsv { send_data UserCheckoutStat.get_user_checkout_stats_tsv(@user_checkout_stat, @stats) , :filename => Setting.user_checkout_stats_print_tsv.filename }\n end\n end", "title": "" }, { "docid": "6d2f11f26b8b833844cfcb92f42e3281", "score": "0.5969577", "text": "def index\n respond_to do |format|\n format.html\n format.json { render json: Female1500mtsHeadsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "c2e77a1ca727825bd5e98203c6aa7ff9", "score": "0.59627444", "text": "def index\n respond_to do |format|\n format.html\n format.json { render json: Female200mtsHeadsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "d7b24c06197a0432633b105411d79224", "score": "0.59563047", "text": "def index\n respond_to do |format|\n format.html\n format.json { render json: Female100mtsHeadsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "b95023090430c084f5f12ee7edc7a8bf", "score": "0.59477764", "text": "def show\n respond_to do |format|\n format.html do\n @saved_list = SavedList.find(params[:id])\n @users = User.joins('INNER JOIN saved_list_users ON saved_list_users.user_id = users.id').where('saved_list_users.saved_list_id = ?', @saved_list.id)\n end\n format.xls do\n @saved_list = SavedList.find(params[:id])\n @users = User.joins('INNER JOIN saved_list_users ON saved_list_users.user_id = users.id').where('saved_list_users.saved_list_id = ?', @saved_list.id)\n\n # Create file name, downcase it, and replace all invalid file name characters with underscores\n headers[\"Content-Disposition\"] = \"attachment; filename=\\\"\" + @saved_list.list_name.downcase.gsub(/[\\x00\\/\\\\:\\*\\?\\\"<>\\| ]/, '_') + \"_\" + DateTime.now.strftime(\"%m%d%Y_%I%M%p\") + \"\\\"\"\n end\n end\n end", "title": "" }, { "docid": "9d2e9b91596e680264e816b62d5c0d99", "score": "0.5935994", "text": "def index\n @download_excels = DownloadExcel.all\n\t\n respond_to do |format|\n\t\n format.xls # send_file(file_name, filename: \"dataexcels.xls\") }\n format.html\n end\n\tbyebug\n end", "title": "" }, { "docid": "ec1645f0efacffbbdc26352ea0c3041f", "score": "0.5935741", "text": "def index\n @grads = Grad.all\n respond_to do |format|\n format.html\n format.xlsx \n end\n end", "title": "" }, { "docid": "ac43d2a5ac61473394ddb66aba29c1ab", "score": "0.593302", "text": "def index\n respond_to do |format|\n format.html\n format.json { render json: Female400mtsHeadsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "c438f056627aac4f886a5bb53dd0c545", "score": "0.5912186", "text": "def export_report\n \tbook = Spreadsheet::Workbook.new\n\t\tsheet = book.create_worksheet\n\t\t\n\t\tformat = Spreadsheet::Format.new :weight => :bold\n\t\t\n\t\tselected_measures = @current_user.selected_measures\n\t\t\n\t\tstart_date = Time.at(@period_start).strftime(\"%D\")\n end_date = Time.at(@effective_date).strftime(\"%D\")\n \n\t\t# table headers\n\t\tsheet.row(0).push 'NQF ID', 'Sub ID', 'Name', 'Subtitle', 'Numerator', 'Denominator', 'Exclusions', 'Percentage', 'Aggregate'\n\t\tsheet.row(0).default_format = format\n\t\tr = 1\n\t\t\n\t\tselected_provider = @selected_provider || Provider.where(:npi => params[:npi]).first\n\t\tproviders_for_filter = (selected_provider)? selected_provider._id.to_s : @providers.map{|pv| pv._id.to_s}\n\t\t\n\t\t# populate rows\n\t\tselected_measures.each do |measure|\n\t\t\tsubs_iterator(measure['subs']) do |sub_id|\n\t\t\t\tinfo = measure_info(measure['id'], sub_id)\n\n\t\t\t\tif selected_provider != nil\n\t\t\t\t\tquery = {:measure_id => measure['id'], :sub_id => sub_id, :effective_date => @effective_date, 'filters.providers' => [selected_provider._id.to_s] }\n\t\t\t\telse\n\t\t\t\t\tquery = {:measure_id => measure['id'], :sub_id => sub_id, :effective_date => @effective_date, 'filters.providers' => {'$all' => providers_for_filter}, 'filters.providers' => {'$size' => providers_for_filter.count} }\n\t\t\t\tend\n\t\t\t\t\n\t\t\t\tcache = MONGO_DB['query_cache'].find(query).first\n\t\t\t\tpercent = percentage(cache['NUMER'].to_f, cache['DENOM'].to_f)\n\t\t\t\tfull_percent = percentage(cache['full_numer'].to_f, cache['full_denom'].to_f)\n\t\t\t\tsheet.row(r).push info[:nqf_id], sub_id, info[:name], info[:subtitle], cache['NUMER'], cache['DENOM'], cache['DENEX'] , percent, full_percent \n\t\t\t\tr = r + 1;\n\t\t\tend\n\t\tend\n\t\n\t\ttoday = Time.now.strftime(\"%D\")\n\t\tif @selected_provider\n\t\t\tfilename = \"measure-report-\" + \"#{@selected_provider.npi}-\" + \"#{today}\" + \".xls\"\t\n\t\telse\t\n\t\t\tfilename = \"measure-report-\" + \"#{today}\" + \".xls\"\n\t\tend\n\t\tdata = StringIO.new '';\n\t\tbook.write data;\n\t\tsend_data(data.string, {\n\t\t :disposition => 'attachment',\n\t\t :encoding => 'utf8',\n\t\t :stream => false,\n\t\t :type => 'application/excel',\n\t\t :filename => filename\n\t\t})\n end", "title": "" }, { "docid": "9c8911b6825c4f3d1735bee80ef92462", "score": "0.5908396", "text": "def index\n @users = User.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xlsx\n end\n end", "title": "" }, { "docid": "be6fdfa6eec6d537a245b3928f9160d5", "score": "0.59022135", "text": "def index\n @psostavs = Psostav.all\n respond_to do |format|\n format.html\n format.xlsx \n end\n end", "title": "" }, { "docid": "1925d5cb372dbbb83bca385b228c7bb5", "score": "0.5897344", "text": "def index\n respond_to do |format|\n @female100mthudrle = Female100mthudrle.new\n format.html\n format.json { render json: Female100mthudrlesDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "f18722965b0bf4da4506a1b9f4a7221c", "score": "0.58833903", "text": "def download\n if platinum_user_and_above?\n sites=Site.where(\"site is not null\")\n workbook = RubyXL::Workbook.new\n worksheet = workbook.worksheets[0]\n worksheet.sheet_name = 'Sites'\n header = [\"Website\",\"Primary IP\",\"Port\",\"Hosting Status\",\"Server\",\"Response Code\",\"MD5 Finger-print\",\"Redirection\",\"Last Update\"]\n index = 0\n worksheet_write_row(worksheet,index,header)\n sites.each do |site|\n next if site.site.nil?\n next if site.site.empty?\n index += 1\n my_row = [site.site, site.ip, site.port, site.status, site.server, site.code, site.md5,site.redirection, site.updated_at]\n worksheet_write_row(worksheet,index, my_row)\n end\n file = \"Discovered_Websites_\" + Time.now.strftime('%m%d%Y') + \".xlsx\"\n send_data workbook.stream.string, filename: file, disposition: 'attachment'\n else\n redirect_back :fallback_location => root_path, :alert => \"Access denied.\"\n end\n end", "title": "" }, { "docid": "350ad295f79c42c2e405dffb485c4ff6", "score": "0.5862743", "text": "def index\n # @yearly_details = YearlyDetail.all\n @yearly_details = YearlyDetail.order(:created_at).page params[:page]\n @all_yearly_details = YearlyDetail.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @yearly_details }\n format.xls {\n send_data @all_yearly_details.to_xls(:name => \"All_Yearly_Details\",\n # :columns => [:name, :address, :age],\n # :headers => ['NAME', 'ADDRESS', 'AGE'],\n :cell_format => {:color => :blue},\n :header_format => {:weight => :bold, :color => :red}),\n :filename => 'All_Yearly_Details.xls' }\n end\n end", "title": "" }, { "docid": "6f67469fdaf6df2507ff0c53b0664ebe", "score": "0.5845123", "text": "def index\n respond_to do |format|\n @female_high_jump = FemaleHighJump.new\n format.html\n format.json { render json: FemaleHighJumpsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "45ac597f6802c6d4b00abb1d77366a25", "score": "0.58385533", "text": "def quizmachine\n book = Spreadsheet::Workbook.new\n sheet1 = book.create_worksheet\n\n # write out headers\n column = 0\n\n active_event = !params['event_id'].nil? ? params['event_id'] : Event.active_event.id\n @teams = Team.all(:joins => [:team_registration], :conditions => \"event_id = #{active_event}\", :order => 'last_name asc, first_name asc', :order => 'division_id asc, name asc')\n\n pos = 1\n @teams.each do |team|\n if !team.team_registration.event_id == params['event_id'] or !team.team_registration.paid?\n next\n end\n\n team.participant_registrations.each do |quizzer|\n sheet1[pos,0] = team.name\n sheet1[pos,1] = quizzer.full_name\n pos+=1\n end\n end\n \n book.write \"#{RAILS_ROOT}/public/download/quizmachine_teams_quizzers.xls\"\n\n send_file \"#{RAILS_ROOT}/public/download/quizmachine_teams_quizzers.xls\", :filename => \"quizmachine_teams_quizzers.xls\"\n end", "title": "" }, { "docid": "1a1a62b138dd44e7fd013d76e5c32b98", "score": "0.5828728", "text": "def save_feature_report(file_name = 'default_feature_report')\n save_json_report(file_name)\n save_csv_report(file_name)\n end", "title": "" }, { "docid": "f5770861269394d793e00112c60f69f5", "score": "0.5824927", "text": "def index\n respond_to do |format|\n @start_female_shot_put = StartFemaleShotPut.new\n format.html\n format.json { render json: StartFemaleShotPutsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "9ed6a2d9d86dd06cd42bf93013308ff0", "score": "0.5824124", "text": "def index\n respond_to do |format|\n @female100mt = Female100mt.new\n format.html\n format.json { render json: Female100mtsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "b9abf0e339580ade596a9ec9fbf148c0", "score": "0.581755", "text": "def index\n @faqs = Faq.all\n\n respond_to do |format|\n format.html # index.html.erb \n format.xls do \n \n \n render :xls => @faqs,\n :columns => [ :id, :admin, :answer, :member_only, :title, :user_id, :the_answer, :editor ],\n :headers => %w[ ID admin answer member_only title user_id the_answer editor ] \n\n end\n \n \n end\n \n \n \n end", "title": "" }, { "docid": "69ca379c7d50adb5080f754b6fc13154", "score": "0.5815016", "text": "def show\n begin\n scrape = Scrape.find(params[:id])\n respond_to do |format|\n format.csv do\n send_data scrape.format_to_downloadable_csv\n end\n format.xls\n format.html\n end\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "25bd98406032436e6d6c0d20407a6abe", "score": "0.5801512", "text": "def write_to_xls filename = \"#{title}.xls\", options = {}\n if to_xls(options).write(filename)\n filename\n end\n end", "title": "" }, { "docid": "22da6ef14ef76fc8c6eb215ab9b10715", "score": "0.5800704", "text": "def index\n respond_to do |format|\n @female200mt = Female200mt.new\n format.html\n format.json { render json: Female200mtsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "3bc8cad881a7712dd54c96044af4c47c", "score": "0.57981884", "text": "def index\n respond_to do |format|\n @femalesenior200mt = Femalesenior200mt.new\n format.html\n format.json { render json: Femalesenior200mtsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "e90d70fd2653548eb34e8a3bcc50e619", "score": "0.5791866", "text": "def index\n respond_to do |format|\n @start_female_senior200mt = StartFemaleSenior200mt.new\n format.html\n format.json { render json: StartFemaleSenior200mtsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "057bc93ca0dc1cf4a45653f459646adb", "score": "0.57906497", "text": "def download\n users = User.all(:order => 'last_name desc, first_name desc')\n book = Spreadsheet::Workbook.new\n sheet1 = book.create_worksheet\n # write out headers\n sheet1[0,0] = 'First Name'\n sheet1[0,1] = 'Last Name'\n sheet1[0,2] = 'Email'\n sheet1[0,3] = 'Address'\n sheet1[0,4] = 'City'\n sheet1[0,5] = 'State'\n sheet1[0,6] = 'Zipcode'\n sheet1[0,7] = 'Communicate By Email'\n sheet1[0,8] = 'Agrees To Promotion'\n registerable_items = RegisterableItem.all\n i = 9\n registerable_items.each do |registerable_item|\n sheet1[0,i] = registerable_item.name\n i += 1\n sheet1[0,i] = registerable_item.name + ' Fee'\n i += 1\n end\n sheet1[0,i] = 'Total Fee'\n i += 1\n sheet1[0,i] = 'Created On'\n i += 1\n sheet1[0,i] = 'Updated On'\n \n pos = 1\n users.each do |user|\n grand_total = 0;\n sheet1[pos,0] = user.first_name\n sheet1[pos,1] = user.last_name\n sheet1[pos,2] = user.email\n sheet1[pos,3] = user.address.street\n sheet1[pos,4] = user.address.city\n sheet1[pos,5] = user.address.state\n sheet1[pos,6] = user.address.zipcode\n sheet1[pos,7] = user.communicate_by_email\n sheet1[pos,8] = user.registration.promotion_agree\n i = 9\n user.registration.registration_items.each do |registration_item|\n sheet1[pos,i] = registration_item.count\n i += 1\n item_total = (registration_item.count * registration_item.registerable_item.price_in_cents) / 100\n grand_total += item_total\n sheet1[pos,i] = item_total\n i += 1\n end\n sheet1[pos,i] = grand_total\n i += 1\n sheet1[pos,i] = user.created_at\n i += 1\n sheet1[pos,i] = user.updated_at\n pos = pos + 1\n end\n book.write \"#{RAILS_ROOT}/public/download/registrations.xls\"\n\n send_file \"#{RAILS_ROOT}/public/download/registrations.xls\", :filename => \"registrations.xls\"\n end", "title": "" }, { "docid": "c483e275d6ed5aecef2339aa6ab59afd", "score": "0.57893485", "text": "def index\n @heatsheets = Heatsheet.all\n respond_to do |format|\n format.html\n format.csv {send_data @heatsheets.to_csv}\n end\n\n end", "title": "" }, { "docid": "27eb5e5ba56c15b65cf5fbfcaaeec84a", "score": "0.57872885", "text": "def export_report format_type='table'\n puts '--'*30\n puts 'Report Summary'\n puts '--'*30\n \n @report_list.each { |test_case| puts test_case.join(\"\\t\\t\")}\n \n \n book = Spreadsheet::Workbook.new\n sheet1 = book.create_worksheet :name=> 'Report Summary'\n \n sheet1.column(0).width = 50 # column width of case_name \n\n \n sheet1.row(0).push \n \n @report_list.each_with_index do |test_case, idx|\n if format_type == 'table'\n export_table_format(test_case, sheet1, idx)\n else\n export_xml_csv_format(test_case, sheet1, idx)\n end\n end\n book.write(@output_pathname)\n end", "title": "" }, { "docid": "dc8db077c5bc38a95b54de7d9a10e91b", "score": "0.57841665", "text": "def export\n respond_to do |format|\n\t\t@new_custom_field_values = getNewCustomField\n\t\t@entries = findEntries()\n\t\tfindWkTE(@startday)\n\t\tunitLabel = getUnitLabel\n\t\tformat.pdf {\n\t\t\tsend_data(wktime_to_pdf(@entries, @user, @startday,unitLabel), :type => 'application/pdf', :filename => \"#{@startday}-#{params[:user_id]}.pdf\")\n\t\t}\n\t\tformat.csv {\n\t\t\tsend_data(wktime_to_csv(@entries, @user, @startday,unitLabel), :type => 'text/csv', :filename => \"#{@startday}-#{params[:user_id]}.csv\")\n }\n end\n end", "title": "" }, { "docid": "dc8db077c5bc38a95b54de7d9a10e91b", "score": "0.57841665", "text": "def export\n respond_to do |format|\n\t\t@new_custom_field_values = getNewCustomField\n\t\t@entries = findEntries()\n\t\tfindWkTE(@startday)\n\t\tunitLabel = getUnitLabel\n\t\tformat.pdf {\n\t\t\tsend_data(wktime_to_pdf(@entries, @user, @startday,unitLabel), :type => 'application/pdf', :filename => \"#{@startday}-#{params[:user_id]}.pdf\")\n\t\t}\n\t\tformat.csv {\n\t\t\tsend_data(wktime_to_csv(@entries, @user, @startday,unitLabel), :type => 'text/csv', :filename => \"#{@startday}-#{params[:user_id]}.csv\")\n }\n end\n end", "title": "" }, { "docid": "70c58775c04e9d8bfc0bb886a651a350", "score": "0.578128", "text": "def index\n @my_coffees = MyCoffee.all\n respond_to do |format|\n format.html \n format.xls \n end\n\n end", "title": "" }, { "docid": "c6aa5b2f195bd533ff661e5490f07366", "score": "0.5773352", "text": "def index\n # @users = User.paginate :page => params[:page], :per_page => 25\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: UserDatatable.new(view_context) }\n format.xls { data_export(User.csv_columns, User.current_account_users.confirmed, filename: 'users_export', expressions: true, format: 'xls') }\n format.csv { data_export(User.csv_columns, User.current_account_users.confirmed, filename: 'users_export', expressions: true, format: 'csv') }\n end\n end", "title": "" }, { "docid": "fd8a67610b0f0a1326b3dedeae62a4c4", "score": "0.57529527", "text": "def report\n @priority_program_action_lines = PriorityProgramActionLine.order(\"hierarchy\").all\n\n\n\n respond_to do |format|\n format.html # index.html.erb\n format.xls {send_data @priority_program_action_lines.to_xls, content_type: 'application/vnd.ms-excel', filename: 'lineas.xls' }\n format.json { render json: @priority_program_action_lines }\n end\n end", "title": "" }, { "docid": "9c1160fe6e7ec89f34cd9c3f191100c3", "score": "0.57485235", "text": "def export\n respond_to do |format|\n @new_custom_field_values = getNewCustomField\n @entries = findEntries()\n findWkTE(@startday)\n unitLabel = getUnitLabel\n format.pdf {\n send_data(wktime_to_pdf(@entries, @user, @startday,unitLabel), :type => 'application/pdf', :filename => \"#{@startday}-#{params[:user_id]}.pdf\")\n }\n format.csv {\n send_data(wktime_to_csv(@entries, @user, @startday,unitLabel), :type => 'text/csv', :filename => \"#{@startday}-#{params[:user_id]}.csv\")\n }\n end\n end", "title": "" }, { "docid": "876ce5fc8dad45d0e8a873c20b9986d6", "score": "0.57462555", "text": "def index\n respond_to do |format|\n @male_shot_put = MaleShotPut.new\n format.html\n format.json { render json: MaleShotPutsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "5eb396130449dbdab90af57a4fb1abb1", "score": "0.57450044", "text": "def show\n @bidname = Bidname.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xls {send_data @bidname.xls, :type => :xls, :filename => @bidname.name + \".xls\"}\n end\n end", "title": "" }, { "docid": "0c55ebe34e61573bb217b1a4b41864b4", "score": "0.57435155", "text": "def export_as_xls_all_uploaded_resumes\n Spreadsheet.client_encoding = 'UTF-8'\n book = Spreadsheet::Workbook.new\n if get_current_employee.is_HR?\n resumes = Resume.all.find_all { |r| r.employee.id == get_current_employee.id }\n output = \"#{RAILS_ROOT}/tmp/All_Uploaded_Resumes.xls\"\n sheet = book.create_worksheet :name => \"Resumes\"\n fill_resume_data(sheet, resumes)\n send_file_to_download(book, output)\n else\n flash[:notice] = \"You are not authorised to access this page\"\n redirect_to :back\n end\n end", "title": "" }, { "docid": "ada511d6c9677f6a3d4881c93fa4fc0f", "score": "0.5730182", "text": "def export\n headers[\"Content-Disposition\"] = \"filename=\\\"#{download_file_name(current_date)}\\\"\"\n\n @people = Person.find_all_for_export(current_date, params[\"include\"])\n\n ActiveSupport::Notifications.instrument(\n \"export.people.admin.racing_on_rails\",\n people_count: @people.size,\n excel_layout:\n params[:excel_layout],\n format: params[:format]\n )\n\n respond_to do |format|\n format.html\n format.ppl\n format.xls do\n case params[\"excel_layout\"]\n when \"scoring_sheet\"\n render \"admin/people/scoring_sheet\"\n when \"endicia\"\n render \"admin/people/endicia\"\n end\n end\n end\n end", "title": "" }, { "docid": "5024276b3b04691b7853fc99b6e5465d", "score": "0.57249707", "text": "def index\n if request.path_parameters[:format] == 'xlsx'\n @search = DepartmentPersonRoleSearchForReport.new params[:f], params[:page] \n @department_person_roles = @search.results\n else\n @search = DepartmentPersonRoleSearch.new params[:f], params[:page] \n @department_person_roles = @search.results\n end\n \n respond_to do |format|\n format.html\n format.xlsx\n end\n end", "title": "" }, { "docid": "171873228a4050dc27f762b0406fbb9b", "score": "0.57239324", "text": "def downloaduserinfo\n\t\trespond_to do |format|\n\t\t\tformat.xls {send_data generateXLS(col_sep: \"\\t\") }\n\t\tend\n\tend", "title": "" }, { "docid": "7d0d7039e3131535313e32a91e08ffa2", "score": "0.5723835", "text": "def index\n respond_to do |format|\n @male110mtshudrle = Male110mtshudrle.new\n format.html\n format.json { render json: Male110mtshudrlesDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "06bb399e34ec00e4f7ef4102fbd9d944", "score": "0.57207143", "text": "def export\n #Initialize workbook, get current variety\n book = Spreadsheet::Workbook.new\n book.default_format = Spreadsheet::Format.new :size => 12\n sheets = []\n variety = params[:variety]\n format = Spreadsheet::Format.new :weight => :bold, :size => 12\n\t\n #Create separate spreadsheets ordered by date, grower, and grade\n EXCEL_SORT_CATEGORIES.each do |k, v|\n sheet = book.create_worksheet\n sheet.name = \"Sort By \" + k\n sheet.row(0).default_format = format\n sheet.row(0).concat [ 'Date', 'Grower Name', 'Ticket No.', 'Pit No.', 'Total Tanks', 'Grade', 'Weight' ]\n row = 1\n \n \n Ticket.active( variety, v ).each do |t|\n sheet.update_row row, t.date.to_time.getlocal.strftime( \"%m/%d/%y\" ), t.grower_name, t.id, t.get_pit, t.total_tanks, t.grade.to_s + \"%\", t.weight\n row += 1\n end\n sheets << sheet\n end\n\n #Save the workbook\n spreadsheet = StringIO.new \n book.write spreadsheet \n send_data spreadsheet.string, :filename => \"#{variety}_#{Time.now.getlocal.strftime( \"%m-%d-%y\" )}.xls\", :type => \"application/vnd.ms-excel\"\n end", "title": "" }, { "docid": "431506e3278b34653df8e2a16b515896", "score": "0.5716295", "text": "def show\n basename = @report.name.tr(' ', '_')\n respond_to do |format|\n format.html {}\n format.xlsx do\n send_data(@report.expenses.render_xlsx, filename: \"#{basename}.xlsx\")\n end\n format.pdf do\n send_data(@report.expenses.render_pdf, filename: \"#{basename}.pdf\")\n end\n end\n end", "title": "" }, { "docid": "c884c87cc2f4d158c7e3f7d0b8fe7cea", "score": "0.57158357", "text": "def index\n @quantity_eggs = QuantityEgg.all\n respond_to do |f|\n f.html\n f.csv { render text: @quantitys.to_csv }\n f.xls\n end\n end", "title": "" }, { "docid": "1adcdc4465a98b50ba96d79907315125", "score": "0.5711816", "text": "def index\n respond_to do |format|\n format.html do\n gon.records = Page.order(:id)\n gon.options = {\n colHeaders: LABELS,\n columns: ATTRIBUTES.map{|a|{data: a}},\n minSpareRows: 1,\n columnSorting: true,\n contextMenu: [\"remove_row\"]\n }\n end\n\n format.xlsx do\n @attributes = ATTRIBUTES\n timestamp = Time.zone.now.strftime(\"%Y%m%d%H%M%S\")\n filename = \"pages_#{timestamp}.xlsx\"\n response.headers['Content-Disposition'] = \"attachment; filename=#{filename}\"\n end\n end\n\n\n end", "title": "" }, { "docid": "e2a41f08ca5eb631180394b7281da3fc", "score": "0.5708774", "text": "def index\n if request.path_parameters[:format] == 'xlsx'\n @search = PersonSearchForReport.new(params[:f], params[:page], {'is_guest' => false})\n @people = @search.results\n else\n @search = PersonSearch.new params[:f], params[:page]\n #@people = Person.paginate(page: params[:page]).order(\"name, family_name ASC\")\n @people = @search.results\n end\n \n respond_to do |format|\n format.html\n format.xlsx\n end\n end", "title": "" }, { "docid": "7559a5030e01c0a66ac9f12bfb8f0ac9", "score": "0.57087433", "text": "def export_human_readable\n \t# construct the Excel file and get a list of files created\n \tfilenames = ExcelExport.project_to_xls(params[:project_id], current_user)\n \t\n user = current_user.login\n #zipfile_name = \"#{user}_project_export.zip\"\n #zipfile_loc = \"exports/#{user}_project_export_#{Time.now.to_i}.zip\"\n \t## create a zipped file to contain all exported docs\n #Zippy.create zipfile_loc do |zip|\n #\tfilenames.each do |file|\n \t#\t\tzip[file] = File.open(\"exports/#{file}\")\n\t\t#\tend \t\n #end\n ## provide the created zip file for download\n \t#send_file zipfile_loc, :type => \"application/zip\", :filename => zipfile_name\n \tfname = \"#{user}_project_export.xls\"\n \tsend_data(filenames, :type=>\"application/xls\",:filename=>fname)\n end", "title": "" }, { "docid": "39da8c93b6040ed9e85017714f1951bc", "score": "0.57004744", "text": "def index\n respond_to do |format|\n format.html\n format.json { render json: FemaleJavelinHeadsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "0578afd1d29dea4b0fde8ae9ad6d2df8", "score": "0.56989384", "text": "def history_excel\n @iAction = \"H\"\n # code to create xls file\n require 'writeexcel'\n workbook = WriteExcel.new(Rails.public_path+\"/excel/floor_views/excel_list_out.xls\")\n worksheet = workbook.add_worksheet\n format = workbook.add_format\n format1 = workbook.add_format\n format.set_bold\n format.set_color('black')\n format.set_align('left')\n format1.set_color('red')\n @ship_response = invoke_webservice method: 'get', class: 'custInv/', action: 'shipTo', query_string: {custNo: current_user}\n @shipto_response = @ship_response['shipTo']\n @floor_view_entry_response = invoke_webservice method: 'get', class: 'custInv/', action: 'floorViewEntry', query_string: {custNo: current_user, action: @iAction, noOfDays: params[:days]}\n @ship_to = @ship_response['shipTo'].split('<BR>')\n @ship_to.each_with_index do |value, index_value|\n if value != \" \"\n worksheet.write(index_value, 0, value)\n end\n @row_value = index_value\n end\n # create a table in xls file\n worksheet.write(@row_value+1, 0)\n worksheet.write(@row_value+2, 0)\n worksheet.write(@row_value+3, 0, t('floor_view_history',:scope => \"floor_views.floor_view_history\"))\n worksheet.write(@row_value+3, 1, \"#{session[:user_name]}\", format1)\n worksheet.write(@row_value+5, 0, t('STATUS',:scope => \"floor_views._history_days\"), format)\n worksheet.write(@row_value+5, 1, t('TYPE',:scope => \"floor_views._history_days\"), format)\n worksheet.set_column(@row_value+5, 1,20)\n worksheet.write(@row_value+5, 2,t('PART_NUMBER',:scope => \"floor_views._history_days\"), format)\n worksheet.set_column(@row_value+5, 2,20)\n worksheet.write(@row_value+5, 3,t('SCANCODE',:scope => \"floor_views._history_days\"), format)\n worksheet.set_column(@row_value+5, 3,20)\n worksheet.write(@row_value+5, 4,t('LINE_STATION',:scope => \"floor_views._history_days\"), format)\n worksheet.set_column(@row_value+5, 4,20)\n worksheet.write(@row_value+5, 5,t('DATE',:scope => \"floor_views._history_days\"), format)\n worksheet.set_column(@row_value+5, 5,20)\n worksheet.write(@row_value+5, 6,t('TIME',:scope => \"floor_views._history_days\"), format)\n worksheet.set_column(@row_value+5, 6,20)\n # loop for floor view entry data to show in table\n @floor_view_entry_response['partNoList'].each_index do |i|\n if @floor_view_entry_response[\"approvalStatusList\"][i] == \"None\"\n worksheet.write(@row_value+6+i,0)\n else\n worksheet.write(@row_value+6+i,0,@floor_view_entry_response['approvalStatusList'][i])\n end\n worksheet.write(@row_value+6+i,1,@floor_view_entry_response['actionCodeList'][i])\n worksheet.write(@row_value+6+i,2,@floor_view_entry_response['partNoList'][i])\n worksheet.write(@row_value+6+i,3,@floor_view_entry_response['scancodeList'][i])\n worksheet.write(@row_value+6+i,4,@floor_view_entry_response['lineStationList'][i])\n if !@floor_view_entry_response['actionDateList'][i].nil?\n worksheet.write(@row_value+6+i,5, Date.strptime(@floor_view_entry_response['actionDateList'][i],\"%m/%d/%Y\").strftime(\"%Y-%m-%d\"))\n else\n worksheet.write(@row_value+6+i,5)\n end\n if !@floor_view_entry_response['actionTimeList'][i].nil?\n worksheet.write(@row_value+6+i,6, Time.strptime(@floor_view_entry_response['actionTimeList'][i],'%I:%M%P').strftime(\"%H:%M:%S\"))\n else\n worksheet.write(@row_value+6+i,6)\n end\n end\n workbook.close\n send_file Rails.public_path+\"/excel/floor_views/excel_list_out.xls\", :disposition => \"attachment\"\n end", "title": "" }, { "docid": "1bdca922da469952d9e9551c358be26b", "score": "0.56925976", "text": "def show\n @p_report = PReport.find(params[:id])\n @data = @p_report.run\n\n respond_to do |format|\n format.html { } # show.html.erb\n format.xml { render :xml => @data }\n format.csv { render :text => create_csv_table(@data) \n headers['Content-Disposition'] = \"attachment; filename=\\\"#{@p_report.name.downcase.gsub(/\\s+/, '_')}_#{Date.today.to_s}.csv\\\"\" }\n format.xls { render :text => create_excel_table(@data)\n headers['Content-Disposition'] = \"attachment; filename=\\\"#{@p_report.name.downcase.gsub(/\\s+/, '_')}_#{Date.today.to_s}.xls\\\"\"\n headers['Cache-Control'] = '' }\n end\n end", "title": "" }, { "docid": "33335335eedc49f99076bee61fde3086", "score": "0.56903017", "text": "def export\n respond_to do |format|\n\t\t@new_custom_field_values = TimeEntry.new.custom_field_values\n\t\t@entries = findEntries()\n\t\tfindWktime(@mon)\n\t\tformat.pdf {\n\t\t\tsend_data(wktime_to_pdf(@entries, @user, @mon), :type => 'application/pdf', :filename => \"#{@mon}-#{params[:user_id]}.pdf\")\n\t\t}\n\t\tformat.csv {\n\t\t\tsend_data(wktime_to_csv(@entries, @user, @mon), :type => 'text/csv', :filename => \"#{@mon}-#{params[:user_id]}.csv\")\n }\n end\n end", "title": "" }, { "docid": "aa21fb2bf4c26144c514e9c9890d0eea", "score": "0.5678574", "text": "def index\n @search = AnimalWeight.includes(:animal).organization(current_user).search(params[:q])\n @animal_weights = @search.result.paginate(:page => params[:page], :per_page => 10).order(\"updated_at DESC\")\n @animals = Animal.organization(current_user).order(\"name\")\n respond_with(@animal_weights) do |format|\n format.html\n format.xls { send_data AnimalWeight.organization(current_user).to_xls, \n content_type: 'application/vnd.ms-excel', \n filename: 'adoption_contacts.xls' \n }\n end\n end", "title": "" }, { "docid": "c12e4d450a864c1b714a4092d4cf49ec", "score": "0.5677435", "text": "def to_xls\n book = Spreadsheet::Workbook.new\n sheet = book.create_worksheet\n\n body = YAML::load(self.body)\n body.each do |key,element|\n #for each liceserver\n element.each do |ek,ee|\n #for each office hours and 24-hours utilization\n row_pos = 0\n ee.each do |stats|\n sheet.row(row_pos).push ek.to_s\n sheet.row(row_pos).push stats[0]\n sheet.row(row_pos).push stats[1]\n sheet.row(row_pos).push (stats[2].to_f/stats[3]).round(4)*100\n row_pos += row_pos.next\n end\n end\n end\n\n return book\n end", "title": "" }, { "docid": "6c3b2d788f9033b5bc7df3e611f11a2a", "score": "0.5676772", "text": "def index\n respond_to do |format|\n @start_female_high_jump = StartFemaleHighJump.new\n format.html\n format.json { render json: StartFemaleHighJumpsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "0fa30ed418ea059241eae1741e29e1b4", "score": "0.5676521", "text": "def index\n respond_to do |format|\n @start_male400mtshudrle = StartMale400mtshudrle.new\n\n format.html\n format.json { render json: StartMale400mtshudrlesDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "b789d4754c83f927b4a4993929c6d3e7", "score": "0.5674838", "text": "def index\n schools = School.left_joins(:district).where(status: 1).select(:id, :name, :status, :user_add, :teacher_role, 'districts.name as district_name').order('district_id asc'); false\n if params[:field].present? && params[:keyword].present?\n schools = schools.where([\"schools.#{params[:field]} like ?\", \"%#{params[:keyword]}%\"])\n end\n @schools = schools.page(params[:page]).per(params[:per])\n\n respond_to do |format|\n format.html\n format.xls {\n data = @schools.map { |x| {\n 名称: x.name,\n 区县: x.district_name\n\n } }\n filename = \"School-Export-#{Time.now.strftime(\"%Y%m%d%H%M%S\")}.xls\"\n send_data(data.to_xls, :type => \"text/xls;charset=utf-8,header=present\", :filename => filename)\n }\n end\n end", "title": "" }, { "docid": "0f05face93be5841746875b8993e257e", "score": "0.5670522", "text": "def index\n respond_to do |format|\n @female4x100mt = Female4x100mt.new\n format.html\n format.json { render json: Female4x100mtsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "0da91f2f30cf627cba487371bcc8e423", "score": "0.5661934", "text": "def report\n \tif params[:output_format] == \"CSV\"\n \t\texport_data_csv\n \telse params[:output_format] == \"Excel\"\n \t\texport_data_excel\n \tredirect_to root_url, notice: \"Report created!\"\n \tend\n end", "title": "" }, { "docid": "b2da08fec36db0898efe4d73c4d05b65", "score": "0.565958", "text": "def export\n @bussiness = Bussiness.all\n respond_to do |format|\n format.html\n format.csv { send_data @bussiness.to_csv, filename: \"database_#{Date.today}.csv\" }\n end\n end", "title": "" }, { "docid": "bf7b7f35c65d6bcf749cedffeb2f9a42", "score": "0.56560147", "text": "def show\n \n # format.csv { send_data @main_routes.to_csv }\n # format.xls\n \n end", "title": "" }, { "docid": "4e25473cdc38a5cd7fd629b4d2ba0d3d", "score": "0.5654285", "text": "def index\n respond_to do |format|\n format.html\n format.json { render json: Male100mthudrlesDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "d069c2dbcb7f239ace6e8b0d6d5e4d4f", "score": "0.56541574", "text": "def index\n respond_to do |format|\n @female3000mt = Female3000mt.new\n format.html\n format.json { render json: Female3000mtsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "686868076af47b526170178d69e67213", "score": "0.5652929", "text": "def download_excel\n # code to create xls file\n workbook = WriteExcel.new(\"#{Rails.public_path}/excel/bin_line_station/bin_list_out.xls\")\n worksheet = workbook.add_worksheet\n format = workbook.add_format\n format1 = workbook.add_format\n format.set_bold\n format.set_color('black')\n format.set_align('left')\n format1.set_color('red')\n\n @bin_center_parts = invoke_webservice method: 'get', class: 'custInv/',\n action: 'binCenterParts',\n query_string: { custNo: current_user, binCenter: params[:location] }\n @ship_to = invoke_webservice method: 'get', class: 'custInv/', action: 'shipTo',\n query_string: { custNo: current_user }\n @ship_to['shipTo'].split('<BR>').each_with_index do |value, index|\n worksheet.write(index, 0, value, format) if value != \"\"\n @row_value = index\n end\n\n # create a table in xls file\n worksheet.write(@row_value+1, 0)\n worksheet.write(@row_value+2, 0)\n worksheet.set_column(0, 0, 20)\n worksheet.set_column(0, 1, 20)\n worksheet.set_column(0, 2, 20)\n worksheet.set_column(0, 3, 20)\n worksheet.set_column(0, 4, 20)\n worksheet.set_column(0, 5, 20)\n worksheet.set_column(0, 6, 20)\n worksheet.set_column(0, 7, 20)\n worksheet.write(@row_value+3, 0, I18n.translate('bin_part_loc',:scope => \"bin_line_station.download_excel\") )\n worksheet.write(@row_value+3, 1,\n \"#{params[:location]}:#{@bin_center_parts[\"whsdesc\"][1]}\", format1)\n worksheet.write(@row_value+5, 0,I18n.translate('part_num',:scope => \"bin_line_station.download_excel\"), format)\n worksheet.write(@row_value+5, 1,I18n.translate('scan_code',:scope => \"bin_line_station.download_excel\"), format)\n worksheet.write(@row_value+5, 2,I18n.translate('whse_desc',:scope => \"bin_line_station.download_excel\"), format)\n worksheet.write(@row_value+5, 3,I18n.translate('amc_qty',:scope => \"bin_line_station.new_part_to_location\"), format)\n worksheet.write(@row_value+5, 4,I18n.translate('pack_qty',:scope => \"bin_line_station.new_part_to_location\"), format)\n worksheet.write(@row_value+5, 5,I18n.translate('UM',:scope => \"panstock_requests.send_panstock_changes\"), format)\n worksheet.write(@row_value+5, 6,I18n.translate('Bin',:scope => \"panstock_requests.send_panstock_changes\").upcase, format)\n worksheet.write(@row_value+5, 7,I18n.translate('qty_on_hand',:scope => \"bin_line_station.download_excel\"), format)\n worksheet.write(@row_value+5, 8,I18n.translate('exclude',:scope => \"bin_line_station.search_by_location\"), format)\n\n # loop for bin center parts data to show in table\n (0..@bin_center_parts[\"ref\"].length).each do |i|\n worksheet.write(@row_value+6+i,0,@bin_center_parts[\"ref\"][i])\n worksheet.write(@row_value+6+i,1,@bin_center_parts[\"scancode\"][i])\n worksheet.write(@row_value+6+i,2,@bin_center_parts[\"whsdesc\"][i])\n worksheet.write(@row_value+6+i,3,@bin_center_parts[\"amcQty\"][i])\n worksheet.write(@row_value+6+i,4,@bin_center_parts[\"packQty\"][i])\n worksheet.write(@row_value+6+i,5,@bin_center_parts[\"um\"][i])\n worksheet.write(@row_value+6+i,6,@bin_center_parts[\"bin\"][i])\n worksheet.write(@row_value+6+i,7,@bin_center_parts[\"qtyOnHand\"][i])\n if @bin_center_parts[\"partExclusionList\"][i] == \"EXCLUDE\"\n worksheet.write(@row_value+6+i,8,@bin_center_parts[\"partExclusionList\"][i])\n else\n worksheet.write(@row_value+6+i,8,\"\")\n end\n end\n\n workbook.close\n send_file \"#{Rails.public_path}/excel/bin_line_station/bin_list_out.xls\", :disposition => \"attachment\"\n end", "title": "" }, { "docid": "a912d8739b84a2e78e72259bc98b6b26", "score": "0.5651163", "text": "def location_excel\n @BinCenter = params[:location]\n # code to create xls file\n require 'writeexcel'\n workbook = WriteExcel.new(Rails.public_path+\"/excel/floor_views/bin_list_out.xls\")\n worksheet = workbook.add_worksheet\n format = workbook.add_format\n format1 = workbook.add_format\n format.set_bold\n format.set_color('black')\n format.set_align('left')\n format1.set_color('red')\n #@bincenter_parts_response = invoke_get_webservice \"/custInv/binCenterParts?custNo=\"+current_user+\"&binCenter=\"+params[:location]+\"&page=\"+params[:page].to_s\n @bincenter_parts_response = invoke_webservice method: 'get', class: 'custInv/', action: 'binCenterParts', query_string: {custNo: current_user, binCenter: params[:location]}\n @ship_response = invoke_webservice method:'get', class:'custInv/', action:'shipTo', query_string: {custNo: current_user}\n @shipto_response = @ship_response['shipTo']\n @ship_to = @ship_response['shipTo'].split('<BR>')\n @ship_to.each_with_index do |value, index_value|\n if value != \"\"\n worksheet.write(index_value, 0, value, format)\n end\n @row_value = index_value\n end\n # create a table in xls file\n worksheet.write(@row_value+1, 0)\n worksheet.write(@row_value+2, 0)\n worksheet.set_column(0, 0, 20)\n worksheet.set_column(0, 1, 20)\n worksheet.set_column(0, 2, 20)\n worksheet.set_column(0, 3, 20)\n worksheet.set_column(0, 4, 20)\n worksheet.set_column(0, 5, 20)\n worksheet.set_column(0, 6, 20)\n worksheet.set_column(0, 7, 20)\n worksheet.set_column(0, 8, 20)\n worksheet.write(@row_value+3, 0, t('bin_parts_for_location',:scope => \"floor_views._location_search\"))\n worksheet.write(@row_value+3, 1, \"#{params[:location]}:#{@bincenter_parts_response[\"whsdesc\"][1]}\",format1)\n worksheet.write(@row_value+5, 0,t('PART_NUMBER',:scope => \"floor_views._location_search\"), format)\n worksheet.write(@row_value+5, 1,t('Scan_Code',:scope => \"floor_views._location_search\"), format)\n worksheet.write(@row_value+5, 2,t('Whse_Desc',:scope => \"floor_views._location_search\"), format)\n worksheet.write(@row_value+5, 3,t('amount_quantity',:scope => \"floor_views._location_search\"), format)\n worksheet.write(@row_value+5, 4,t('PACK_QTY',:scope => \"floor_views._location_search\"), format)\n worksheet.write(@row_value+5, 5,t('UM',:scope => \"floor_views._location_search\"), format)\n worksheet.write(@row_value+5, 6,t('bin',:scope => \"floor_views._location_search\"), format)\n worksheet.write(@row_value+5, 7,t('on-hand',:scope => \"floor_views._location_search\"), format)\n worksheet.write(@row_value+5, 8,t('excluded',:scope => \"floor_views._location_search\"), format)\n # loop for bin center parts data to show in table\n (0..@bincenter_parts_response[\"ref\"].length).each do |i|\n worksheet.write(@row_value+6+i,0,@bincenter_parts_response[\"ref\"][i])\n worksheet.write(@row_value+6+i,1,@bincenter_parts_response[\"scancode\"][i])\n worksheet.write(@row_value+6+i,2,@bincenter_parts_response[\"whsdesc\"][i])\n worksheet.write(@row_value+6+i,3,@bincenter_parts_response[\"amcQty\"][i])\n worksheet.write(@row_value+6+i,4,@bincenter_parts_response[\"packQty\"][i])\n worksheet.write(@row_value+6+i,5,@bincenter_parts_response[\"um\"][i])\n worksheet.write(@row_value+6+i,6,@bincenter_parts_response[\"bin\"][i])\n worksheet.write(@row_value+6+i,7,@bincenter_parts_response[\"qtyOnHand\"][i])\n if @bincenter_parts_response[\"partExclusionList\"][i] == \"EXCLUDE\"\n worksheet.write(@row_value+6+i,8,@bincenter_parts_response[\"partExclusionList\"][i])\n else\n worksheet.write(@row_value+6+i,8,\"\")\n end\n end\n workbook.close\n send_file Rails.public_path+\"/excel/floor_views/bin_list_out.xls\", :disposition => \"attachment\"\n end", "title": "" }, { "docid": "cf8d86f682f923779c3427976e4b99f1", "score": "0.56503826", "text": "def index\n @variances = Variance.all.paginate(page: params[:page], per_page: 100)\n if params[:export].to_i == 1\n render xlsx: @variances.to_xlsx\n end\n end", "title": "" }, { "docid": "7240cbd112da20d027e59504024d1f29", "score": "0.5649827", "text": "def show\n @item_doc = ItemDoc.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @item_doc }\n\t format.any(:xls) {\n\t\t\t\t\t\t\treport = Spreadsheet::Workbook.new\n\t\t\t\t\t\t\theader = Spreadsheet::Format.new :weight=>:bold, :border=>true\n\t\t\t\t\t\t\ttable = Spreadsheet::Format.new :border=>true\n\t\t\t\t\t\t\tfooter = Spreadsheet::Format.new :weight=>:bold\n\t\t\t\t\t\t\tds = report.create_worksheet :name => 'Накладная'\n\t\t\t\t\t\t\tds.column(0).width = 50\n\t\t\t\t\t\t\tds.update_row 0, \"#{@item_doc.opcode_view} № #{@item_doc.id} от #{@item_doc.created_at.localtime}\"\n\t\t\t\t\t\t\tds.update_row 1, \"Склад:\" + unless @item_doc.stock.nil? then @item_doc.stock.name else \"\" end\n\t\t\t\t\t\t\tds.update_row 2, \"Контрагент:\" + unless @item_doc.card.nil? then @item_doc.card.full_name else \"\" end\n\t\t\t\t\t\t\t#ds.row(4).default_format = header\n\t\t\t\t\t\t\t4.times do |x| ds.row(4).set_format(x,header) end\n\t\t\t\t\t\t\tds.update_row 4, \"Товар\",\"Цена\",\"Количество\",\"Сумма\",\"\",\"\",\"created_at\",\"updated_at\"\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\ttotal = 0;\n\t\t\t\t\t\t\tnrow = 5;\n\t\t\t\t\t\t\t@item_doc.item_doc_rows.each do |r|\n\t\t\t\t\t\t\t\t4.times do |x| ds.row(nrow).set_format(x,table) end\n\t\t\t\t\t\t\t\tds.update_row nrow, r.good.name, r.price, r.quantity, r.sum,\"\",\"\",r.created_at,r.updated_at\n\t\t\t\t\t\t\t\ttotal = total+r.sum\n\t\t\t\t\t\t\t\tnrow = nrow+1\n\t\t\t\t\t\t\tend\n\t\t\t\t\t\t\t4.times do |x| ds.row(nrow).set_format(x,footer) end\n\t\t\t\t\t\t\tds.update_row nrow,\"Итого:\",\"\",\"\",total\n\t\t\t\t\t\t\t#info.row(1).push 'User ID', @userid\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t@outfile = \"Invoice_#{@item_doc.id}.xls\"\n\n\t\t\t\t\t\t\trequire 'stringio'\n\t\t\t\t\t\t\tdata = StringIO.new ''\n\t\t\t\t\t\t\treport.write data\n\t\t\t\t\t\t\tsend_data data.string.bytes.to_a.pack(\"C*\"), :type=>\"application/excel\", :disposition=>'attachment', :filename => @outfile\n\t\t\t\t\t\n\t\t\t\t }\n end\n end", "title": "" }, { "docid": "1a308859ea4f16faa2337bede9f82f61", "score": "0.5649569", "text": "def downloaduserlist\n respond_to do |format|\n format.xls {send_data generateUserXLS(col_sep: \"\\t\") }\n end\n end", "title": "" }, { "docid": "60f155c44b4e05417359a246b31a353d", "score": "0.56488657", "text": "def networkstats_xls(netstats)\n\t\tSpreadsheet.client_encoding = 'UTF-8'\n\n\t book = Spreadsheet::Workbook.new\n\t sheet1 = book.create_worksheet :name => \"#{name} Data\"\n\n\t sheet1[0,1] = \"Company Profile\"\n\t \tsheet1[1,1] = \"Name:\"\n\t \tsheet1[2,1] = \"Entity:\"\n\t \tsheet1[3,1] = \"Ownership:\"\n\t \tsheet1[4,1] = \"SIC code:\"\n\t \tsheet1[5,1] = \"Country:\"\n\t \tsheet1[6,1] = \"Region:\"\n\n\t \tsheet1[1,2] = name\n\t \tsheet1[2,2] = Company.combination(combination)\n\t \tsheet1[3,2] = Company.ownership(ownership)\n\t \tsheet1[4,2] = \"#{sic} #{SIC.description(sic)}\"\n\t \tsheet1[5,2] = Company.country(country)\n\t \tsheet1[6,2] = Company.region(region)\n\n\t \ttrade_now= TradeStat.find(self.trade_now)\n \ttrade_cy = TradeStat.find(self.trade_cy)\n \ttrade_2y = TradeStat.find(self.trade_2y)\n \ttrade_3y = TradeStat.find(self.trade_3y)\n \ttrade_4y = TradeStat.find(self.trade_4y)\n \ttrade_5y = TradeStat.find(self.trade_5y)\n\n \tsheet1[8,0] = \"Company Statistics (Stat Trade)\"\n\t \tsheet1[9,0] = \"\"\n\t \tsheet1[10,0] = \"--Accounts--\"\n\t \tsheet1[11,0] = \"Asset Category:\"\n\t \tsheet1[12,0] = \"Revenue Category:\"\n\t \tsheet1[13,0] = \"Sales/Revenue Growth:\"\n\t \tsheet1[14,0] = \"Gross Profit Margin:\"\n\t \tsheet1[15,0] = \"Operating Profit Margin:\"\n\t \tsheet1[16,0] = \"EBITDA %:\"\n\t \tsheet1[17,0] = \"--Valuation--\"\n\t \tsheet1[18,0] = \"EBITDA Multiple:\"\n\t \tsheet1[19,0] = \"Sales Multiple:\"\n\t \tsheet1[20,0] = \"Funded Debt Multiple:\"\n\n\t \tsheet1[9,1] = \"NOW\"\n\t \tsheet1[10,1] = \"\"\n\t \tsheet1[11,1] = \"#{trade_now.asset_category}\"\n\t \tsheet1[12,1] = \"#{trade_now.revenue_category}\"\n\t \tsheet1[13,1] = \"#{trade_now.sales_growth}\"\n\t \tsheet1[14,1] = \"#{trade_now.gross_profit_margin}\"\n\t \tsheet1[15,1] = \"#{trade_now.operating_profit_margin}\"\n\t \tsheet1[16,1] = \"#{trade_now.ebitda_percent}\"\n\t \tsheet1[17,1] = \"\"\n\t \tsheet1[18,1] = \"#{trade_now.ebitda_multiple}\"\n\t \tsheet1[19,1] = \"#{trade_now.sales_multiple}\"\n\t \tsheet1[20,1] = \"#{trade_now.debt_multiple}\"\n\n\t \tsheet1[9,2] = \"CY\"\n\t \tsheet1[10,2] = \"\"\n\t \tsheet1[11,2] = \"#{trade_cy.asset_category}\"\n\t \tsheet1[12,2] = \"#{trade_cy.revenue_category}\"\n\t \tsheet1[13,2] = \"#{trade_cy.sales_growth}\"\n\t \tsheet1[14,2] = \"#{trade_cy.gross_profit_margin}\"\n\t \tsheet1[15,2] = \"#{trade_cy.operating_profit_margin}\"\n\t \tsheet1[16,2] = \"#{trade_cy.ebitda_percent}\"\n\t \tsheet1[17,2] = \"\"\n\t \tsheet1[18,2] = \"#{trade_cy.ebitda_multiple}\"\n\t \tsheet1[19,2] = \"#{trade_cy.sales_multiple}\"\n\t \tsheet1[20,2] = \"#{trade_cy.debt_multiple}\"\n\n\t \tsheet1[9,3] = \"2Y\"\n\t \tsheet1[10,3] = \"\"\n\t \tsheet1[11,3] = \"#{trade_2y.asset_category}\"\n\t \tsheet1[12,3] = \"#{trade_2y.revenue_category}\"\n\t \tsheet1[13,3] = \"#{trade_2y.sales_growth}\"\n\t \tsheet1[14,3] = \"#{trade_2y.gross_profit_margin}\"\n\t \tsheet1[15,3] = \"#{trade_2y.operating_profit_margin}\"\n\t \tsheet1[16,3] = \"#{trade_2y.ebitda_percent}\"\n\t \tsheet1[17,3] = \"\"\n\t \tsheet1[18,3] = \"#{trade_2y.ebitda_multiple}\"\n\t \tsheet1[19,3] = \"#{trade_2y.sales_multiple}\"\n\t \tsheet1[20,3] = \"#{trade_2y.debt_multiple}\"\n\n\t \tsheet1[9,4] = \"3Y\"\n\t \tsheet1[10,4] = \"\"\n\t \tsheet1[11,4] = \"#{trade_3y.asset_category}\"\n\t \tsheet1[12,4] = \"#{trade_3y.revenue_category}\"\n\t \tsheet1[13,4] = \"#{trade_3y.sales_growth}\"\n\t \tsheet1[14,4] = \"#{trade_3y.gross_profit_margin}\"\n\t \tsheet1[15,4] = \"#{trade_3y.operating_profit_margin}\"\n\t \tsheet1[16,4] = \"#{trade_3y.ebitda_percent}\"\n\t \tsheet1[17,4] = \"\"\n\t \tsheet1[18,4] = \"#{trade_3y.ebitda_multiple}\"\n\t \tsheet1[19,4] = \"#{trade_3y.sales_multiple}\"\n\t \tsheet1[20,4] = \"#{trade_3y.debt_multiple}\"\n\n\t \t# sheet1[9,5] = \"4Y\"\n\t \t# sheet1[10,5] = \"\"\n\t \t# sheet1[11,5] = \"#{trade_4y.asset_category}\"\n\t \t# sheet1[12,5] = \"#{trade_4y.revenue_category}\"\n\t \t# sheet1[13,5] = \"#{trade_4y.sales_growth}\"\n\t \t# sheet1[14,5] = \"#{trade_4y.gross_profit_margin}\"\n\t \t# sheet1[15,5] = \"#{trade_4y.operating_profit_margin}\"\n\t \t# sheet1[16,5] = \"#{trade_4y.ebitda_percent}\"\n\t \t# sheet1[17,5] = \"\"\n\t \t# sheet1[18,5] = \"#{trade_4y.ebitda_multiple}\"\n\t \t# sheet1[19,5] = \"#{trade_4y.sales_multiple}\"\n\t \t# sheet1[20,5] = \"#{trade_4y.debt_multiple}\"\n\n\t \t# sheet1[9,6] = \"5Y\"\n\t \t# sheet1[10,6] = \"\"\n\t \t# sheet1[11,6] = \"#{trade_5y.asset_category}\"\n\t \t# sheet1[12,6] = \"#{trade_5y.revenue_category}\"\n\t \t# sheet1[13,6] = \"#{trade_5y.sales_growth}\"\n\t \t# sheet1[14,6] = \"#{trade_5y.gross_profit_margin}\"\n\t \t# sheet1[15,6] = \"#{trade_5y.operating_profit_margin}\"\n\t \t# sheet1[16,6] = \"#{trade_5y.ebitda_percent}\"\n\t \t# sheet1[17,6] = \"\"\n\t \t# sheet1[18,6] = \"#{trade_5y.ebitda_multiple}\"\n\t \t# sheet1[19,6] = \"#{trade_5y.sales_multiple}\"\n\t \t# sheet1[20,6] = \"#{trade_5y.debt_multiple}\"\n\n\t \tsheet1[8,6] = \"Network Statistics\"\n\t \tsheet1[9,6] = \"NOW\"\n\t \tsheet1[10,6] = \"\"\n\t \tsheet1[11,6] = \"#{netstats.now_asset_category}\"\n\t \tsheet1[12,6] = \"#{netstats.now_revenue_category}\"\n\t \tsheet1[13,6] = \"#{netstats.now_sales_growth}\"\n\t \tsheet1[14,6] = \"#{netstats.now_gross_profit_margin}\"\n\t \tsheet1[15,6] = \"#{netstats.now_operating_profit_margin}\"\n\t \tsheet1[16,6] = \"#{netstats.now_ebitda_percent}\"\n\t \tsheet1[17,6] = \"\"\n\t \tsheet1[18,6] = \"#{netstats.now_ebitda_multiple}\"\n\t \tsheet1[19,6] = \"#{netstats.now_sales_multiple}\"\n\t \tsheet1[20,6] = \"#{netstats.now_debt_multiple}\"\n\n\t \tsheet1[9,7] = \"CY\"\n\t \tsheet1[10,7] = \"\"\n\t \tsheet1[11,7] = \"#{netstats.cy_asset_category}\"\n\t \tsheet1[12,7] = \"#{netstats.cy_revenue_category}\"\n\t \tsheet1[13,7] = \"#{netstats.cy_sales_growth}\"\n\t \tsheet1[14,7] = \"#{netstats.cy_gross_profit_margin}\"\n\t \tsheet1[15,7] = \"#{netstats.cy_operating_profit_margin}\"\n\t \tsheet1[16,7] = \"#{netstats.cy_ebitda_percent}\"\n\t \tsheet1[17,7] = \"\"\n\t \tsheet1[18,7] = \"#{netstats.cy_ebitda_multiple}\"\n\t \tsheet1[19,7] = \"#{netstats.cy_sales_multiple}\"\n\t \tsheet1[20,7] = \"#{netstats.cy_debt_multiple}\"\n\n\t \tsheet1[9,8] = \"2Y\"\n\t \tsheet1[10,8] = \"\"\n\t \tsheet1[11,8] = \"#{netstats.y2_asset_category}\"\n\t \tsheet1[12,8] = \"#{netstats.y2_revenue_category}\"\n\t \tsheet1[13,8] = \"#{netstats.y2_sales_growth}\"\n\t \tsheet1[14,8] = \"#{netstats.y2_gross_profit_margin}\"\n\t \tsheet1[15,8] = \"#{netstats.y2_operating_profit_margin}\"\n\t \tsheet1[16,8] = \"#{netstats.y2_ebitda_percent}\"\n\t \tsheet1[17,8] = \"\"\n\t \tsheet1[18,8] = \"#{netstats.y2_ebitda_multiple}\"\n\t \tsheet1[19,8] = \"#{netstats.y2_sales_multiple}\"\n\t \tsheet1[20,8] = \"#{netstats.y2_debt_multiple}\"\n\n\t \tsheet1[9,9] = \"3Y\"\n\t \tsheet1[10,9] = \"\"\n\t \tsheet1[11,9] = \"#{netstats.y3_asset_category}\"\n\t \tsheet1[12,9] = \"#{netstats.y3_revenue_category}\"\n\t \tsheet1[13,9] = \"#{netstats.y3_sales_growth}\"\n\t \tsheet1[14,9] = \"#{netstats.y3_gross_profit_margin}\"\n\t \tsheet1[15,9] = \"#{netstats.y3_operating_profit_margin}\"\n\t \tsheet1[16,9] = \"#{netstats.y3_ebitda_percent}\"\n\t \tsheet1[17,9] = \"\"\n\t \tsheet1[18,9] = \"#{netstats.y3_ebitda_multiple}\"\n\t \tsheet1[19,9] = \"#{netstats.y3_sales_multiple}\"\n\t \tsheet1[20,9] = \"#{netstats.y3_debt_multiple}\"\n\n\n\t spreadsheet = StringIO.new \n\t\tbook.write spreadsheet \n\t\tspreadsheet\n\tend", "title": "" }, { "docid": "fff17f2958e43f62361b0cd60560a739", "score": "0.56393003", "text": "def show\n @submission = Submission.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @submission }\n format.xls\n end\n end", "title": "" }, { "docid": "16c371c8edee26c935eb4221d4c6fab1", "score": "0.56372315", "text": "def housing\n book = Spreadsheet::Workbook.new\n sheet1 = book.create_worksheet\n\n # formatting\n header_format = Spreadsheet::Format.new :weight => :bold, :align => :justify\n\n # write out headers\n column = 0\n sheet1[0,column] = 'Building'\n sheet1[0,column+=1] = 'Room'\n sheet1[0,column+=1] = 'Key Code'\n sheet1[0,column+=1] = 'Participant'\n sheet1[0,column+=1] = 'Group Leader'\n sheet1[0,column+=1] = 'District'\n\n sheet1.row(0).default_format = header_format\n\n participants = ParticipantRegistration.by_event(params['event_id']).ordered_by_last_name\n\n pos = 1\n participants.each do |participant|\n if @only_pre && !participant.housing_saturday? && !participant.housing_sunday?\n next\n end\n \n if @only_offcampus && participant.registration_type != \"Guest (Lodging off-campus)\"\n next\n end\n\n column = 0\n sheet1[pos,column] = !participant.building.blank? ? participant.building.name : ''\n sheet1[pos,column+=1] = !participant.room.blank? ? participant.room : ''\n sheet1[pos,column+=1] = participant.keycode\n sheet1[pos,column+=1] = participant.full_name_reversed\n sheet1[pos,column+=1] = participant.group_leader_name\n sheet1[pos,column+=1] = !participant.district.nil? ? participant.district.name : ''\n pos += 1\n end\n\n # column widths\n sheet1.column(0).width = 20\n sheet1.column(1).width = 10\n sheet1.column(2).width = 10\n sheet1.column(3).width = 25\n sheet1.column(4).width = 25\n sheet1.column(5).width = 25\n\n book.write \"#{RAILS_ROOT}/public/download/housing_#{@filename}.xls\"\n\n send_file \"#{RAILS_ROOT}/public/download/housing_#{@filename}.xls\", :filename => \"housing_#{@filename}.xls\"\n end", "title": "" }, { "docid": "b393235de21d9ea976ab7593b4f32691", "score": "0.5630234", "text": "def save_as_xls(s_s,save_as)\n sleep 1\n s_s[2].saveas(save_as)\n end", "title": "" }, { "docid": "781d24003ca7eea7bcccfd8730ba1a0a", "score": "0.56295127", "text": "def index\n respond_to do |format|\n @start_male_shot_put = StartMaleShotPut.new\n format.html\n format.json { render json: StartMaleShotPutsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "97933e30cd3b6f9815cfa5cd91ba804c", "score": "0.56245273", "text": "def index\n respond_to do |format|\n @female8x50mt = Female8x50mt.new\n format.html\n format.json { render json: Female8x50mtsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "94e48fdc8677979b46abdf7212761bca", "score": "0.5624232", "text": "def export\n start = Time.now.midnight\n if (not params[:all])\n time = case params[:type]\n when \"days\" then start - params[:time].to_i.day\n when \"weeks\" then start - (7 * params[:time].to_i).day\n else Time.at(0)\n end\n else\n time = Time.at(0)\n end\n book = Spreadsheet::Workbook.new\n test_names = Testable.all(:select => \"DISTINCT(datatype)\",\n :conditions => [\"time_in >= ? AND time_in <= ?\", time, start]\n ).collect {|t|t.datatype}\n test_names.each do |t|\n sheet = book.create_worksheet :name => t\n test_cols = Testableitem.all(:select => \"DISTINCT(name), label\",\n :order => :name,\n :joins => :testable,\n :conditions => { \n :testables => {:datatype => t}\n }\n ).collect {|c|c.label.nil? ? [c.name] : [c.name,c.label]}\n write_header(sheet, \n GENERAL_COLS + test_cols.collect{|c|c[1].nil? ? c[0] : \"#{c[0]} (#{c[1]})\"})\n Testable.all(:conditions => [\"datatype = ? AND time_in >= ? AND time_in <= ?\", t, time, start], \n :include => :testableitems\n ).each do |test|\n write_test(sheet, \n test, \n GENERAL_COLS, \n test_cols.collect{|c|c[0]})\n end\n end\n \n # and now, the patient registry\n patient_sheet = book.create_worksheet :name => \"Patient Registry\"\n write_header(patient_sheet, PATIENT_COLS)\n Patient.all().each do |patient|\n write_test(patient_sheet, patient, PATIENT_COLS)\n end\n \n data = StringIO.new\n book.write data\n filename = \"latrs-#{time.strftime(TIME_STR)}-TO-#{start.strftime(TIME_STR)}\"\n\n respond_to do |format|\n format.html { send_data data.string, :type=>\"application/excel\",\n :disposition=>'attachment',\n :filename => \"#{filename}.xls\"\n }\n format.xml { \n render :xml => to_xml(book,time,start)\n }\n end\n\n end", "title": "" }, { "docid": "073c567da4bb8d1d4c49a8f5f74ac85a", "score": "0.5621556", "text": "def show\n ReserveStatHasUser.per_page = 65534 if params[:format] == 'csv' or params[:format] == 'tsv'\n @stats = @user_reserve_stat.reserve_stat_has_users.order('reserves_count DESC, user_id').page(params[:page])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @user_reserve_stat }\n format.csv\n format.tsv { send_data UserReserveStat.get_user_reserve_stats_tsv(@user_reserve_stat, @stats), :filename => Setting.user_reserve_stats_print_tsv.filename }\n end\n end", "title": "" }, { "docid": "a4de6c56123814a0bb918fecf2d89375", "score": "0.5620821", "text": "def coaches_teams\n @participant_registrations = ParticipantRegistration.all(:conditions => \"registration_type = 'coach' and event_id = #{params['event_id']} and paid = 1\", :order => 'last_name asc, first_name asc')\n \n book = Spreadsheet::Workbook.new\n sheet1 = book.create_worksheet\n\n # write out headers\n column = 0\n sheet1[0,column] = 'Participant Name'\n sheet1[0,column+=1] = 'Registration Type'\n sheet1[0,column+=1] = 'Team Name'\n sheet1[0,column+=1] = 'Division'\n sheet1[0,column+=1] = 'District'\n sheet1[0,column+=1] = 'Field'\n\n pos = 1\n @participant_registrations.each do |participant_registration|\n participant_registration.coached_teams.each do |team|\n column = 0\n sheet1[pos,column] = participant_registration.full_name\n sheet1[pos,column+=1] = participant_registration.formatted_registration_type\n sheet1[pos,column+=1] = team.name\n sheet1[pos,column+=1] = team.division.name\n sheet1[pos,column+=1] = participant_registration.district.name\n sheet1[pos,column+=1] = participant_registration.district.region.name\n pos += 1\n end\n end\n\n book.write \"#{RAILS_ROOT}/public/download/coaches_teams.xls\"\n\n send_file \"#{RAILS_ROOT}/public/download/coaches_teams.xls\", :filename => \"coaches_teams.xls\"\n end", "title": "" }, { "docid": "d7ecc4f51179e136ed6bf2c283f5e031", "score": "0.56160736", "text": "def index\n respond_to do |format|\n @start_female20000mt = StartFemale20000mt.new\n format.html\n format.json { render json: StartFemale20000mtsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "2b7acc71b943bab5743b3d7842de992c", "score": "0.5615432", "text": "def manager_stats_by_weekly\n get '/manager/stats/weekly'\n end", "title": "" }, { "docid": "e642a17105be697a12811d3f3bc7ee10", "score": "0.56145304", "text": "def index\n respond_to do |format|\n @start_female_hammer_throw = StartFemaleHammerThrow.new\n format.html\n format.json { render json: StartFemaleHammerThrowsDatatable.new(view_context) }\n format.xlsx\n end\nend", "title": "" }, { "docid": "6e61cbe4453bd3959a845177b79895b7", "score": "0.56119365", "text": "def report\n\n filename = \"nationaltally_report_from_\"+session[:from_date_range_national_tally].to_s+\"_to_\"+session[:to_date_range_national_tally].to_s+\".xls\"\n @report_donations = Donation.joins(:donour).joins('inner join users as users on users.id = donations.fundraiser_id').\n joins('inner join cities as cities on cities.id = users.city_id').\n where(\"(donations.donation_status = 'RECEIPT SENT' OR donations.donation_status = 'DEPOSIT COMPLETE') AND donations.updated_at >= ? AND donations.updated_at <= ?\", \n session[:from_date_range_national_tally].to_s+\" \"+$start_time, session[:to_date_range_national_tally].to_s+\" \"+$end_time)\n\n respond_to do |format|\n format.xls { headers[\"Content-Disposition\"] = \"attachment; filename=\\\"#{filename}\\\"\" }\n end\n end", "title": "" } ]
cfccd8c7ef4224a610a0cc779195227b
Create a Quarter with any datelike object, needs to respond to `to_date`. So Date, DateTime, and Time will all work. Note that the stored date is normalized to a proper Date object to keep things consistent.
[ { "docid": "34a11ba1e020a0185620fa8b3d6db771", "score": "0.6445099", "text": "def initialize(date:)\n @date = date.to_date.freeze\n @year = date.year.freeze\n @number = QuarterHelper.quarter(date).freeze\n end", "title": "" } ]
[ { "docid": "df87ec8c1baf34567deccf9155e335d4", "score": "0.6422409", "text": "def date_to_qspec(date, delim = nil)\n unless date.class == Date\n date = grok_date(date)\n end\n '%s%sQ%d' % [date.year, delim, quarter_by_month(date.mon)]\n end", "title": "" }, { "docid": "12a19ff6cf5a8b84b0be13f1cc2a844c", "score": "0.6397832", "text": "def to_quarter_period\n return self if quarter?\n self.class.quarter(value)\n end", "title": "" }, { "docid": "12a19ff6cf5a8b84b0be13f1cc2a844c", "score": "0.6397832", "text": "def to_quarter_period\n return self if quarter?\n self.class.quarter(value)\n end", "title": "" }, { "docid": "afa76742f1d3dbb986499e5ba8bf2d56", "score": "0.60703135", "text": "def set_quarter\n Quarter.all.sort.each do |q|\n self.quarter = (q.start_date..q.end_date).include?(date) ? q : nil\n end\n end", "title": "" }, { "docid": "72fe66998acd43d12a9c5d444222d81e", "score": "0.56263846", "text": "def specific(*args)\n number, year, type = number_and_year_and_type_from_args(*args)\n index = number.pred % number_of_quarters(*args)\n opts = args.extract_options! # at this point, args not needed in its original form.\n \n months_array = quarters_table(type)[index]\n first_months_array = quarters_table(type)[0]\n specified_quarter_month = months_array[0]\n first_quarter_month = first_months_array[0]\n \n year += opts[:this_year] ? 0 : (number.pred / number_of_quarters) + (first_quarter_month > specified_quarter_month ? 1 : 0)\n \n new(Date.new(year, months_array[0], 1), Date.new(year, months_array[1], 1).end_of_month, :number => number)\n end", "title": "" }, { "docid": "2e221ea08a2090629e8c6e5f62e684ef", "score": "0.5578623", "text": "def find_or_create(date)\n quarters[date_to_start(date)] ||= data_klass.new\n end", "title": "" }, { "docid": "ef50007bcf1c08be43beb0db0da8b819", "score": "0.5480404", "text": "def fullfill!\n return if quarters.empty?\n\n periods_range = with_quarters_dates do |period|\n find_or_create Time.at(period)\n end\n\n @start_date = Time.at(periods_range.first)\n @end_date = Time.at(periods_range.last)\n end", "title": "" }, { "docid": "602f289f5d6c094568a0008d1a9be44a", "score": "0.54568774", "text": "def quarters\n quarters = []\n quarter = Periods::Quarter.for(start_date)\n while quarter.end_date <= end_date\n quarters << quarter\n quarter = quarter.next\n end\n quarters\n end", "title": "" }, { "docid": "865a71dd3c1a969e66aa7a12baa62d08", "score": "0.5455894", "text": "def initialize(attributes = {})\n super\n self.type = type.intern if type\n self.value = if quarter?\n self.class.cast_to_quarter(value)\n else\n value.to_date.beginning_of_month\n end\n validate!\n end", "title": "" }, { "docid": "700fecd3cb1c0356da5c45f8c6330b20", "score": "0.54495573", "text": "def qspec_to_date(qstr)\n return nil unless qstr =~ /([12]\\d\\d\\d)[-.\\/ ]?Q0?([1234])/i\n Date.new($1.to_i, first_month_of_quarter($2))\n end", "title": "" }, { "docid": "32aa8d0d6e5b7fceab8f127033b73b9f", "score": "0.5448297", "text": "def date_to_start(date)\n if date.is_a? String\n # Alternative, but more expensive: DateTime.parse(value).beginning_of_quarter.to_i\n DateTime.new(*date.split('-').map(&:to_i)).beginning_of_quarter.to_i\n else\n Time.at(date).to_date.to_time(:utc).beginning_of_quarter.to_i\n end\n end", "title": "" }, { "docid": "85ec3f391e14a1fefe95c2d17198754b", "score": "0.5440775", "text": "def quarter\n @interval = 'quarter'\n self\n end", "title": "" }, { "docid": "774d1c8d7062e1620170d5a5c547758e", "score": "0.54186743", "text": "def next_quarter(num = 1)\n num = num.floor\n return self if num.zero?\n\n next_month(num * 3)\n end", "title": "" }, { "docid": "cbca4b8bc591b2430101b148f91c7fcd", "score": "0.5394966", "text": "def with_quarters_dates\n sorted_quarters = quarters.keys.sort\n (sorted_quarters.first..sorted_quarters.last).step(93.days) { |period| yield(period) }\n end", "title": "" }, { "docid": "760d4cddf7b7330c70e36c3e1637885b", "score": "0.5374935", "text": "def beginning_of_quarter\r\n beginning_of_month.change(:month => [10, 7, 4, 1].detect { |m| m <= self.month })\r\n end", "title": "" }, { "docid": "f5bd209b03b3529e715d75711ca9c6a7", "score": "0.53378916", "text": "def at_beginning_of_quarter; end", "title": "" }, { "docid": "f5bd209b03b3529e715d75711ca9c6a7", "score": "0.53378916", "text": "def at_beginning_of_quarter; end", "title": "" }, { "docid": "96ce6252d25d776c258246f78b09f15f", "score": "0.5334269", "text": "def quarter\n [\n Date.today.strftime('%B'),\n Date.today.next_month.strftime('%B'),\n Date.today.next_month.next_month.strftime('%B')\n ]\n end", "title": "" }, { "docid": "5f3a5d2d1b42e9e9dc1900a2b7fe91dd", "score": "0.53310543", "text": "def quarter\n Quarter.find_easily(deg_earned_qtr, deg_earned_yr)\n end", "title": "" }, { "docid": "bdc65b3b82684047c125a21eaf15869e", "score": "0.5299124", "text": "def start_of_quarter(year, quarter)\n fiscal_year_calendar.start_of_quarter(year + 1, quarter)\n end", "title": "" }, { "docid": "cdf1a43881b8ca0f4fb760e33771df2e", "score": "0.52512026", "text": "def quarters_since(date)\n\t\t\t(months_since(date) / 3).to_i\n\t\tend", "title": "" }, { "docid": "923d96962e6ab8415eeb50f420b1d9cd", "score": "0.5243952", "text": "def after_quarters(num)\n @base_date >> (num * 3)\n end", "title": "" }, { "docid": "f150b1861243e993605979080ab168f0", "score": "0.52378887", "text": "def beginning_of_quarter; end", "title": "" }, { "docid": "f150b1861243e993605979080ab168f0", "score": "0.52378887", "text": "def beginning_of_quarter; end", "title": "" }, { "docid": "a849acff7fc1e5ccbb3fb83767787da7", "score": "0.5233505", "text": "def quarter\n @quarter ||= calendar.quarter(merch_month)\n end", "title": "" }, { "docid": "b5f0941dc55d66c26662c3a6d05f8f8c", "score": "0.5222106", "text": "def quarter_dates(quarters_ago)\n today = Time.zone.today\n current_quarter_start = Date.new(today.year, quarter_start_month(today), 1)\n required_quarter_start = current_quarter_start - (3 * quarters_ago).months\n required_quarter_end = required_quarter_start + 3.months - 1.day\n\n [required_quarter_start, required_quarter_end]\n end", "title": "" }, { "docid": "b5f0941dc55d66c26662c3a6d05f8f8c", "score": "0.5222106", "text": "def quarter_dates(quarters_ago)\n today = Time.zone.today\n current_quarter_start = Date.new(today.year, quarter_start_month(today), 1)\n required_quarter_start = current_quarter_start - (3 * quarters_ago).months\n required_quarter_end = required_quarter_start + 3.months - 1.day\n\n [required_quarter_start, required_quarter_end]\n end", "title": "" }, { "docid": "7162416f7aae68942b639ef75af73833", "score": "0.51734316", "text": "def test_initialize_date_with_date()\n date = @dfp.date(Date.new(2017, 11, 7))\n assert_equal(2017, date.year)\n assert_equal(11, date.month)\n assert_equal(7, date.day)\n end", "title": "" }, { "docid": "2db333c9428616c7344d1aa0599e5f0a", "score": "0.5163364", "text": "def create\n @quarter = Quarter.new(quarter_params)\n\n respond_to do |format|\n if @quarter.save\n format.html { redirect_to @quarter, notice: 'Quarter was successfully created.' }\n format.json { render :show, status: :created, location: @quarter }\n else\n format.html { render :new }\n format.json { render json: @quarter.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f180d893a29579268854d77411556dd", "score": "0.51330024", "text": "def create\n @quarter = Quarter.new(params[:quarter])\n\n respond_to do |format|\n if @quarter.save\n format.html { redirect_to @quarter, notice: 'Quarter was successfully created.' }\n format.json { render json: @quarter, status: :created, location: @quarter }\n else\n format.html { render action: \"new\" }\n format.json { render json: @quarter.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ff113cf5a81ff4eadcfde2c858911345", "score": "0.5120547", "text": "def start_of_quarter(year, quarter)\n case quarter\n when QUARTER_1\n start_of_month(year, 1)\n when QUARTER_2\n start_of_month(year, 4)\n when QUARTER_3\n start_of_month(year, 7)\n when QUARTER_4\n start_of_month(year, 10)\n else\n raise \"invalid quarter\"\n end\n end", "title": "" }, { "docid": "ff113cf5a81ff4eadcfde2c858911345", "score": "0.5120547", "text": "def start_of_quarter(year, quarter)\n case quarter\n when QUARTER_1\n start_of_month(year, 1)\n when QUARTER_2\n start_of_month(year, 4)\n when QUARTER_3\n start_of_month(year, 7)\n when QUARTER_4\n start_of_month(year, 10)\n else\n raise \"invalid quarter\"\n end\n end", "title": "" }, { "docid": "2879f1e6a49d7743c1aed955792948c3", "score": "0.5119206", "text": "def create\n @quarter = Quarter.new(quarter_params)\n\n respond_to do |format|\n if @quarter.save\n format.html { redirect_to @quarter, notice: 'Quarter was successfully created.' }\n format.json { render json: @quarter, status: :created, location: @quarter }\n else\n format.html { render action: \"new\" }\n format.json { render json: @quarter.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9854d3dfc6a870b254f6df75082a9cb1", "score": "0.5103176", "text": "def beginning_of_quarter?\n beginning_of_quarter == self\n end", "title": "" }, { "docid": "f76a4673a39eb9b62f6a5f4b27289469", "score": "0.5062183", "text": "def start_of_quarter(year, quarter)\n case quarter\n when 1\n start_of_month(year, 7)\n when 2\n start_of_month(year, 10)\n when 3\n start_of_month(year, 1)\n when 4\n start_of_month(year, 4)\n end\n end", "title": "" }, { "docid": "4f4d0bfc4200901650fbc7a615ba1be8", "score": "0.5052159", "text": "def create\n @quarter = Quarter.new(quarter_params)\n\n respond_to do |format|\n if @quarter.save\n format.html { redirect_to admin_quarters_path(q: @quarter.slug), notice: t('shared.msgs.success_created',\n obj: t('activerecord.models.quarter', count: 1)) }\n else\n format.html { render :new }\n end\n end\n end", "title": "" }, { "docid": "d250087c21e26f6f0b5efcac4c81acfc", "score": "0.50520664", "text": "def prior_quarter(num = 1)\n next_quarter(-num)\n end", "title": "" }, { "docid": "5d9ad8e1ec9e9eefd719e09d16b4145e", "score": "0.5036591", "text": "def count_quarters(date)\n (date.year-2010)*4 + date.quarter - 1\n end", "title": "" }, { "docid": "9b91592d0ef7236319e52e62cca2db9a", "score": "0.50023836", "text": "def aggregated_quarter(offset = 1)\n last_quarters = quarters.sort.last(4 + offset).take(4)\n last_quarters.inject(data_klass.new) do |acc, (_, quarter)|\n acc << quarter\n end\n end", "title": "" }, { "docid": "3e11d632733189cac9e0f6ba77749bfa", "score": "0.50010055", "text": "def first_quarter\n return @first_quarter if @first_quarter\n\n @first_quarter = self.class.new(\n Point.new(upper_left.x, upper_left.y),\n Point.new(upper_left.x + quarter_length, upper_left.y - quarter_height)\n )\n @first_quarter.areas = @first_quarter.areas_within(areas)\n @first_quarter.points = @first_quarter.points_within(points)\n @first_quarter\n end", "title": "" }, { "docid": "b4c717cd0eb7563682aa0f59ddf36c00", "score": "0.49928227", "text": "def current_quarter_week(date)\n ((((date.to_i - 7171200)/86400) / 7).round % 13) + 1\n end", "title": "" }, { "docid": "b4c717cd0eb7563682aa0f59ddf36c00", "score": "0.49928227", "text": "def current_quarter_week(date)\n ((((date.to_i - 7171200)/86400) / 7).round % 13) + 1\n end", "title": "" }, { "docid": "9a122642d5680b66b35cf5c0c688361a", "score": "0.4989407", "text": "def set_quarter\n @quarter = Quarter.find(params[:id])\n end", "title": "" }, { "docid": "eb323560b8d0136da4c47f269cef1e65", "score": "0.4988791", "text": "def quarterly(models)\n Quarterly.new(models, prompt).run!\n end", "title": "" }, { "docid": "085045ae1985713229e43d8e45d735a8", "score": "0.49819118", "text": "def time_period\n \"Q#{self.quarter} #{self.year}\"\n end", "title": "" }, { "docid": "6ec218b0e7317c29c6a8e9e2c461d1d5", "score": "0.49795017", "text": "def to_date\n if !self.has_key?('to_date') && contains_date_fields?\n Date.civil(self.year, self.month, self.day)\n else\n super\n end\n end", "title": "" }, { "docid": "029bf27a0668e17174113eb346d48ea1", "score": "0.49756613", "text": "def next_quarter; end", "title": "" }, { "docid": "029bf27a0668e17174113eb346d48ea1", "score": "0.49756613", "text": "def next_quarter; end", "title": "" }, { "docid": "a61422fc22ab6d00afd0a0b565ed0c03", "score": "0.496514", "text": "def getByQ( key, year, quarter )\n month = 1 + (quarter-1)*3;\n date = Date.new( year, month, 1 ); \n getByD( key, date );\n end", "title": "" }, { "docid": "da3657094695f51e3bf0ed9fd3cbf279", "score": "0.49250036", "text": "def test_quarter_end_of_quarter_day_start_2am\n assert_result_date :quarter, \"2013-04-01\", \"2013-07-01 01:59:59\", false, day_start: 2\n end", "title": "" }, { "docid": "c2472569c65ae0fb03ef8d9b81e05b15", "score": "0.4895286", "text": "def all_quarter; end", "title": "" }, { "docid": "c2472569c65ae0fb03ef8d9b81e05b15", "score": "0.4895286", "text": "def all_quarter; end", "title": "" }, { "docid": "1786f2425d53315bede5d62c3d1a2154", "score": "0.48932004", "text": "def add_quarter\n end", "title": "" }, { "docid": "7a5f604af0880ec07384904050e587a3", "score": "0.48761278", "text": "def record_from_date(date)\n time = date.to_time # need methods only available in Time\n record = {}\n record[:date] = time.strftime(\"%m/%d/%Y\")\n record[:full_date_description] = time.strftime(\"%B %d,%Y\")\n record[:day_of_week] = time.strftime(\"%A\")\n record[:day_in_week] = record[:day_of_week] # alias\n #record[:day_number_in_epoch] = time.to_i / 24\n #record[:week_number_in_epoch] = time.to_i / (24 * 7)\n #record[:month_number_in_epoch] = time.to_i / (24 * 7 * 30)\n record[:day_number_in_calendar_month] = time.day\n record[:day_number_in_calendar_year] = time.yday\n record[:day_number_in_fiscal_month] = time.day # should this be different from CY?\n record[:day_number_in_fiscal_year] = time.fiscal_year_yday(fiscal_year_offset_month)\n #record[:last_day_in_week_indicator] = \n #record[:last_day_in_month_indicator] =\n record[:calendar_week] = \"Week #{time.week}\"\n record[:calendar_week_number] = time.week\n record[:calendar_week_number_in_year] = time.week # DEPRECATED\n record[:calendar_week_start_date] = date.beginning_of_week\n record[:calendar_week_end_date] = date.end_of_week\n record[:calendar_month_name] = time.strftime(\"%B\")\n record[:calendar_month_number_in_year] = time.month # DEPRECATED\n record[:calendar_month_number] = time.month\n record[:calendar_year_month] = time.strftime(\"%Y-%m\")\n record[:calendar_quarter] = \"Q#{time.quarter}\"\n record[:calendar_quarter_number] = time.quarter\n record[:calendar_quarter_number_in_year] = time.quarter # DEPRECATED\n record[:calendar_year_quarter] = \"#{time.strftime('%Y')}-#{record[:calendar_quarter]}\"\n #record[:calendar_half_year] = \n record[:calendar_year] = \"#{time.year}\"\n record[:fiscal_week] = \"FY Week #{time.fiscal_year_week(fiscal_year_offset_month)}\"\n record[:fiscal_week_number_in_year] = time.fiscal_year_week(fiscal_year_offset_month) # DEPRECATED\n record[:fiscal_week_number] = time.fiscal_year_week(fiscal_year_offset_month)\n record[:fiscal_month] = time.fiscal_year_month(fiscal_year_offset_month)\n record[:fiscal_month_number] = time.fiscal_year_month(fiscal_year_offset_month)\n record[:fiscal_month_number_in_year] = time.fiscal_year_month(fiscal_year_offset_month) # DEPRECATED\n record[:fiscal_year_month] = \"FY#{time.fiscal_year(fiscal_year_offset_month)}-\" + time.fiscal_year_month(fiscal_year_offset_month).to_s.rjust(2, '0')\n record[:fiscal_quarter] = \"FY Q#{time.fiscal_year_quarter(fiscal_year_offset_month)}\"\n record[:fiscal_year_quarter] = \"FY#{time.fiscal_year(fiscal_year_offset_month)}-Q#{time.fiscal_year_quarter(fiscal_year_offset_month)}\"\n record[:fiscal_quarter_number] = time.fiscal_year_quarter(fiscal_year_offset_month) # DEPRECATED\n record[:fiscal_year_quarter_number] = time.fiscal_year_quarter(fiscal_year_offset_month)\n #record[:fiscal_half_year] = \n record[:fiscal_year] = \"FY#{time.fiscal_year(fiscal_year_offset_month)}\"\n record[:fiscal_year_number] = time.fiscal_year(fiscal_year_offset_month)\n record[:holiday_indicator] = holiday_indicators.include?(date) ? 'Holiday' : 'Nonholiday'\n record[:weekday_indicator] = weekday_indicators[time.wday]\n record[:selling_season] = 'None'\n record[:major_event] = 'None'\n record[:sql_date_stamp] = date\n\n record\n end", "title": "" }, { "docid": "4ea8c235ed9d3e1b0de0f41386d54195", "score": "0.48717132", "text": "def convert_if_quarters(dates)\n quarter_dates = {}\n dates.each do |date,index|\n middle = date.month\n return dates if middle > 4\n quarter_dates[Date.new(date.year, (middle * 3) - 2)] = index\n end\n quarter_dates\n end", "title": "" }, { "docid": "7c77f391f8c113284cfb17b6cbace604", "score": "0.48621497", "text": "def to_hash\n quarters.each_with_object({}) do |(time, quarter), result|\n result[time] = quarter.to_hash\n end\n end", "title": "" }, { "docid": "0706752b37962a34b5e202b381620548", "score": "0.4842912", "text": "def quarter_number\n month = self.sale_date.strftime(\"%m\").to_i\n if month <= 3\n 1 # first quarter\n elsif month > 3 and month < 7\n 2 # second quarter\n elsif month >= 7 and month <= 9\n 3 # third quarter\n else\n 4 # forth quarter\n end\n end", "title": "" }, { "docid": "5323c6bcc4de223e24b69a919cd04062", "score": "0.4837853", "text": "def from_date(date)\n rata_die = date.to_rd\n return self.from_rd(rata_die)\n end", "title": "" }, { "docid": "6e7a31a1d127c030152509f091164f09", "score": "0.48250297", "text": "def test_quarter_end_of_quarter\n assert_result_date :quarter, \"2013-04-01\", \"2013-07-01 01:59:59\", false, day_start: 2\n end", "title": "" }, { "docid": "483e0c7daa2eb9d9c784be479ec4bca4", "score": "0.4813948", "text": "def set_quarter\n @quarter = Quarter.friendly.find(params[:id])\n end", "title": "" }, { "docid": "fc7721d3f10ecf0fc4bfbe2d7ba20b99", "score": "0.47882086", "text": "def quoted_date(value)\n if value.acts_like?(:time)\n zone_conversion_method = ActiveRecord::Base.default_timezone == :utc ? :getutc : :getlocal\n\n if value.respond_to?(zone_conversion_method)\n value = value.send(zone_conversion_method)\n end\n value.strftime('%Y-%m-%d %H:%M:%S') # Time, DateTime\n else\n value.strftime('%Y-%m-%d') # Date\n end\n end", "title": "" }, { "docid": "fc7721d3f10ecf0fc4bfbe2d7ba20b99", "score": "0.47882086", "text": "def quoted_date(value)\n if value.acts_like?(:time)\n zone_conversion_method = ActiveRecord::Base.default_timezone == :utc ? :getutc : :getlocal\n\n if value.respond_to?(zone_conversion_method)\n value = value.send(zone_conversion_method)\n end\n value.strftime('%Y-%m-%d %H:%M:%S') # Time, DateTime\n else\n value.strftime('%Y-%m-%d') # Date\n end\n end", "title": "" }, { "docid": "57d2975a0f3f75620afc452ffa6cfca1", "score": "0.47796902", "text": "def transform_to_date\n if self == 'today'\n Date.today\n elsif self == 'tomorrow'\n Date.today + 1\n elsif self == 'yesterday'\n Date.today - 1\n else\n Date.strptime(self, '%d/%m/%Y')\n end\n end", "title": "" }, { "docid": "9c818a9ac095fb82dcfee9668f520a30", "score": "0.47742316", "text": "def quoted_date(value); end", "title": "" }, { "docid": "9c818a9ac095fb82dcfee9668f520a30", "score": "0.47742316", "text": "def quoted_date(value); end", "title": "" }, { "docid": "7926069a86da7605746a69ed3fc044ab", "score": "0.4764643", "text": "def quarters_since(quarters)\n since((quarters * 3).months)\n end", "title": "" }, { "docid": "9a4b9eda262f3b4abfccecd08a39cfb9", "score": "0.47641906", "text": "def to_date\n Date.new(year, month, day)\n end", "title": "" }, { "docid": "d1473d387166f226854c234bf83380b6", "score": "0.47641414", "text": "def beginning_of_quarter\n first_quarter_month = [10, 7, 4, 1].detect { |m| m <= month }\n beginning_of_month.change(:month => first_quarter_month)\n end", "title": "" }, { "docid": "2a36dac0ca644873189c1917cc7f1a7b", "score": "0.4762813", "text": "def to_date\n Date.new(year, month, day)\n end", "title": "" }, { "docid": "419f5b5d9644f2cc33805bfc493a2406", "score": "0.47605932", "text": "def to_date\n ::Date.new(year, month, day)\n end", "title": "" }, { "docid": "ea45786a3287711ab6631a0fd903c62d", "score": "0.47510087", "text": "def preview\n quarters.sort.map { |unix_timestamp, quarter| [Time.at(unix_timestamp), quarter] }.to_h\n end", "title": "" }, { "docid": "8ebf04c042ab5def54b0b0dbc70dee63", "score": "0.47434452", "text": "def current_quarter\n\n case self.month\n\n when 1..3 then 1\n when 4..6 then 2\n when 7..9 then 3\n else 4\n end\n\n end", "title": "" }, { "docid": "286a68a17e65c29f450f12f90a5e3ce8", "score": "0.47387296", "text": "def end_of_quarter; start_of_quarter.months_since(3) - 1 end", "title": "" }, { "docid": "33da3c98810e557b23ecf1c4e9d038f1", "score": "0.47312087", "text": "def test_initialize_date()\n date = @dfp.date(2017, 11, 7)\n assert_equal(2017, date.year)\n assert_equal(11, date.month)\n assert_equal(7, date.day)\n end", "title": "" }, { "docid": "1b2f011d4a6fd8eaa9094bccec27fecc", "score": "0.47258806", "text": "def at_end_of_quarter; end", "title": "" }, { "docid": "1b2f011d4a6fd8eaa9094bccec27fecc", "score": "0.47258806", "text": "def at_end_of_quarter; end", "title": "" }, { "docid": "c8920ba89feb3af4734210cf25e0161f", "score": "0.47133008", "text": "def example_date\n return Date.new(2007,11,29)\n end", "title": "" }, { "docid": "3fb81fd241bdb551a69e878587247e28", "score": "0.4701913", "text": "def time_period\n \"#{formatted_quarter} #{self.year}\"\n end", "title": "" }, { "docid": "285efc10485c98e54d841bf03d3e3959", "score": "0.46904224", "text": "def planned_audit_quarter? year, quarter\n t = Date.new year, (quarter*3-1)\n # Check start date only\n planned_audit_start_date.beginning_of_quarter <= t && t <= planned_audit_start_date.end_of_quarter\n end", "title": "" }, { "docid": "001d88c011682b1de810104c0b0d0f12", "score": "0.46861452", "text": "def each_prev_quarter(nQuarters)\n first = Date.today + 1 - Date.today.yday\n first = first >> 3 while (first <= Date.today)\n first = first << (3 * nQuarters)\n while(first <= Date.today)\n last = (first >> 3) - 1\n if last > Date.today\n days = ((Date.today - 1) - first).to_f + (Time.now.hour.to_f / 24.0)\n else\n days = ((last + 1) - first).to_f\n end\n yield first, last, days, ((last + 1) - first).to_f\n first = first >> 3\n end\n end", "title": "" }, { "docid": "ada72c45ed0818adecaa1c6eb1dd8aad", "score": "0.46709916", "text": "def last_quarter; end", "title": "" }, { "docid": "ada72c45ed0818adecaa1c6eb1dd8aad", "score": "0.46709916", "text": "def last_quarter; end", "title": "" }, { "docid": "7c90270b9e35c3f42f43218dd0c0ee57", "score": "0.4662712", "text": "def initialize(date)\n @to_date = date\n end", "title": "" }, { "docid": "0e202023c001aad75e7924573fc6dfb3", "score": "0.46620843", "text": "def initialize(*args)\n options = args.extract_options!\n\n if month = options[:month]\n month = Date.parse(month).month if month.is_a? String\n year = options[:year] || Date.today.year\n from = Date.new(year, month, 1)\n to = from.next_month\n elsif year = options[:year]\n from = Date.new(year, 1, 1)\n to = Date.new(year+1, 1, 1)\n end\n\n from = args.shift.to_date if from.nil? and args.any?\n to = args.shift.to_date if to.nil? and args.any?\n\n raise ArgumentError, \"Please supply a start and end date, `#{args.map(&:inspect).to_sentence}' is not enough\" if from.nil? or to.nil?\n raise ArgumentError, \"Start date #{from} should be earlier than end date #{to}\" if from > to\n raise ArgumentError, 'Timeframes that cross year boundaries are dangerous' unless options[:skip_year_boundary_crossing_check] or from.year == to.yesterday.year or from == to\n\n @from, @to = from, to\n end", "title": "" }, { "docid": "2ecef481d48d3707e40119a9fe73d7a5", "score": "0.466105", "text": "def date\n case _type\n when \"quote\"\n self.quote_date.split('T').first if !self.quote_date.nil?\n when \"order\"\n self.purchase_date.split('T').first if !self.purchase_date.nil?\n end\n end", "title": "" }, { "docid": "2ecef481d48d3707e40119a9fe73d7a5", "score": "0.466105", "text": "def date\n case _type\n when \"quote\"\n self.quote_date.split('T').first if !self.quote_date.nil?\n when \"order\"\n self.purchase_date.split('T').first if !self.purchase_date.nil?\n end\n end", "title": "" }, { "docid": "ac488e19bca561f65fbde89993f4dcf7", "score": "0.4660064", "text": "def to_date()\n return Date.new(@date.year, @date.month, @date.day)\n end", "title": "" }, { "docid": "d69aecfc150bcc339352f338b3e6d0c8", "score": "0.46562204", "text": "def coerce_date(date, other)\n TimeCalc.(other)\n .merge(**Units::DEFAULTS.merge(year: date.year, month: date.month, day: date.day))\n end", "title": "" }, { "docid": "e32808806063792ac0e575a9b5c0a9bd", "score": "0.46504846", "text": "def to_date\n begin\n Date.parse(self)\n rescue Exception => e\n raise Sequel::Error::InvalidValue, \"Invalid date value '#{self}' (#{e.message})\"\n end\n end", "title": "" }, { "docid": "134dea86999b2889653b3c94d9378eea", "score": "0.46423376", "text": "def create\n #@quarter = Quarter.new(params[:quarter])\n @quarter = @district.quarters.build(params[:quarter])\n respond_to do |format|\n if @quarter.save\n format.html { redirect_to(edit_admin_town_district_quarter_path(:district_id => @district.id.to_param, :id => @quarter.id.to_param), :notice => 'Quarter was successfully created.') }\n format.xml { render :xml => @quarter, :status => :created, :location => @quarter }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @quarter.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "43a76acef6d3a072d315f1b0fbd1ba6e", "score": "0.46281284", "text": "def prev_quarter; end", "title": "" }, { "docid": "43a76acef6d3a072d315f1b0fbd1ba6e", "score": "0.46281284", "text": "def prev_quarter; end", "title": "" }, { "docid": "b675b56fe12a3ebf88b2f28725f0e0ae", "score": "0.46256426", "text": "def previous_quarter_is_created\n @user_quarters = Quarter.where(\"user_id = ?\", user_id)\n #if is the first quarter in the company... you can create it\n unless (@user_quarters.size() == 0)\n \t if (quart == 1)\n quart_required = 4\n year_required = year-1\n else\n quart_required = quart-1\n year_required = year\n end\n if\n logger.debug \"Quart required -> #{quart_required} Year required -> #{year_required}\"\n @previous_created = Quarter.where(\"quart = ? and year = ? and user_id = ?\", quart_required, year_required, user_id)\n logger.debug \"Quart found -> #{@previous_created.size()}\"\n if (@previous_created.size() == 0)\n \t errors.add(:quart, 'Sorry! You have quarters to create BEFORE this one')\n end\n end \n end\n end", "title": "" }, { "docid": "2e46df5be829ffe5da298766909e1a25", "score": "0.46234262", "text": "def build(options={})\n records = []\n date = start_date\n while date <= end_date\n record = {}\n record[:date] = date.strftime(\"%d/%m/%Y\")\n record[:mois] = %w(janvier février mars avril mai juin juillet août septembre octobre novembre décembre)[date.month-1]\n record[:jour_de_la_semaine] = %w(dimanche lundi mardi mercredi jeudi vendredi samedi)[date.wday]\n record[:annee] = date.year.to_s\n record[:annee_et_mois] = record[:annee] + \"-\" + date.month.to_s.rjust(2,'0')\n record[:date_descriptive] = \"#{record[:jour_de_la_semaine]} #{date.day}#{date.day==1 ? 'er':''} #{record[:mois]} #{record[:annee]}\"\n record[:sql_date_stamp] = date\n record[:semaine] = \"semaine #{date.to_date.cweek}\"\n # compute quarter ourselves - available in Time but not in Date - anything better ?\n quarter = 1 + (date.month-1) / 3\n record[:trimestre] = \"T#{quarter}\"\n record[:semestre] = \"S#{(quarter+1)/2}\"\n records << record\n date = date.next\n end\n records\n end", "title": "" }, { "docid": "939c09ab4336a76a0b4590dbd14a64ce", "score": "0.462094", "text": "def quarter_start?(time)\n self.start.strftime('%M') == '15' && self.title_row?(time)\n end", "title": "" }, { "docid": "9cd2bc54e4834c586e9c35ec030cc8d2", "score": "0.46097592", "text": "def convert(fuzzy_date, date_format)\n if date_format.nil?\n # Assuming a US date format with 3 parameters (i.e. MM?DD?YYYY)\n tokens = fuzzy_date.split(/\\D/)\n if tokens[0].length > 2 || fuzzy_date =~ /\\w{2}/\n # Its ISO\n return DateTime.parse(fuzzy_date.to_s).to_date\n else\n # Guessing US\n return Date.new(tokens[2].to_i, tokens[0].to_i, tokens[1].to_i)\n end\n else\n case date_format\n when ':year_quarter'\n return year_quarter_formatter(fuzzy_date)\n when ':excel-1900'\n return excel_1900_formatter(fuzzy_date)\n else #regular ruby formatter\n return regular_formatter(fuzzy_date, date_format)\n end\n\n end\n end", "title": "" }, { "docid": "d99627a428e4db7812dd3b4ed6e4e35a", "score": "0.460384", "text": "def quoted_date(value)\n if value.acts_like?(:time)\n if ActiveRecord::version >= Gem::Version.new('7')\n zone_conversion_method = ActiveRecord.default_timezone == :utc ? :getutc : :getlocal\n else\n zone_conversion_method = ActiveRecord::Base.default_timezone == :utc ? :getutc : :getlocal\n end\n\n if value.respond_to?(zone_conversion_method)\n value = value.send(zone_conversion_method)\n end\n end\n\n if ActiveRecord::version >= Gem::Version.new('7')\n value.to_fs(:db)\n else\n value.to_s(:db)\n end\n end", "title": "" }, { "docid": "823ab47b0aac2a9ff2f7d0342dd5ceea", "score": "0.4598303", "text": "def initialize(date=Date.today)\n super()\n @date = date\n end", "title": "" }, { "docid": "ba740d0ea65677b62b9a5d422daa5903", "score": "0.4582751", "text": "def quarter_before_start?(time)\n self.start.strftime('%M') == '45' && self.title_row?(time)\n end", "title": "" }, { "docid": "466957c44b1b5579bc991913f770242d", "score": "0.4567234", "text": "def convert_if_quarters(dates)\n quarter_dates = {}\n dates.each do |date,index|\n middle = date[5..6]\n return dates if middle.to_i > 4\n quarter_dates[date] = index if middle == \"01\"\n quarter_dates[date.gsub(\"-02-\",\"-04-\")] = index if middle == \"02\"\n quarter_dates[date.gsub(\"-03-\",\"-07-\")] = index if middle == \"03\"\n quarter_dates[date.gsub(\"-04-\",\"-10-\")] = index if middle == \"04\"\n end\n return quarter_dates\n end", "title": "" } ]
84f50530495633f9ffa60a5316b558fa
1. DRIVER TESTS GO BELOW THIS LINE
[ { "docid": "8005a3b1f39b377c00d376df69b67154", "score": "0.0", "text": "def assert\n\traise \"Assertion error!\" unless yield\nend", "title": "" } ]
[ { "docid": "35a51327dd0b5c9a884bb0e6f7155697", "score": "0.7101977", "text": "def testing\n # ...\n end", "title": "" }, { "docid": "8fbc98d9068bd9c82033a031286f0a1e", "score": "0.708567", "text": "def tests; end", "title": "" }, { "docid": "8fbc98d9068bd9c82033a031286f0a1e", "score": "0.708567", "text": "def tests; end", "title": "" }, { "docid": "8f1c94592f39e6f7649463118849a3c2", "score": "0.7004038", "text": "def test_cases; end", "title": "" }, { "docid": "a9f4c2a19b80ba89e2afaa1cdd14095b", "score": "0.6993461", "text": "def test_case; end", "title": "" }, { "docid": "5a628fb61130e971532ad3ae10b6ec45", "score": "0.6963542", "text": "def test_setup\r\n \r\n end", "title": "" }, { "docid": "b58cbce0e86395667aaeb65004559c80", "score": "0.68807757", "text": "def running_test_case; end", "title": "" }, { "docid": "6c73bba156f326a656a5565673fb1775", "score": "0.68059695", "text": "def test_0_dummy\n\t\tend", "title": "" }, { "docid": "3f280c87fe3f8e9fdf293a6a5315df33", "score": "0.6740355", "text": "def test_step; end", "title": "" }, { "docid": "20eee1803dc33c3ccfc6a8680fd523f5", "score": "0.669766", "text": "def my_tests\n end", "title": "" }, { "docid": "b4151c446130d8bada93b3f12a97c3e7", "score": "0.6633219", "text": "def self_test; end", "title": "" }, { "docid": "b4151c446130d8bada93b3f12a97c3e7", "score": "0.6633219", "text": "def self_test; end", "title": "" }, { "docid": "c08eb970c30b696f37e41801ce1910a5", "score": "0.66134214", "text": "def test_0_before\n\t\t$report = Report.new()\n \t\t$testReport = $report.createReport($REPORT)\n\n\t\t$browser = Watir::Browser.new\n\t\t$current=\"\"\n\tend", "title": "" }, { "docid": "8f30017d276b5452bcea06ff2233286c", "score": "0.6603004", "text": "def driver; end", "title": "" }, { "docid": "7545a391a5ee3a4356d9df2fd2e8a4f7", "score": "0.6585593", "text": "def test \n end", "title": "" }, { "docid": "154f5c1f18576f3da8e2e0aa4e6600d9", "score": "0.6583086", "text": "def before_test(test); end", "title": "" }, { "docid": "154f5c1f18576f3da8e2e0aa4e6600d9", "score": "0.6583086", "text": "def before_test(test); end", "title": "" }, { "docid": "af09ed2d8448f488f7942145770ace65", "score": "0.6577673", "text": "def testloop\n \n end", "title": "" }, { "docid": "428b5d1eaf9535043f41374ccd294f0d", "score": "0.6543914", "text": "def test_steps; end", "title": "" }, { "docid": "428b5d1eaf9535043f41374ccd294f0d", "score": "0.6543914", "text": "def test_steps; end", "title": "" }, { "docid": "169182cdb78de5f4c93943de92b336c4", "score": "0.6503522", "text": "def test_order; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "ab428ae414d7b57bc8d56e38b8d48302", "score": "0.64981014", "text": "def setup; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.6489313", "text": "def spec; end", "title": "" }, { "docid": "072514f3348fe62556dcdfd4b06e3d08", "score": "0.6489313", "text": "def spec; end", "title": "" }, { "docid": "ad21efe30c678e65d5a0eb2a5e13800a", "score": "0.64849657", "text": "def test_connection\n end", "title": "" }, { "docid": "bfc69e4949f99cb9fe298d757ddb8a87", "score": "0.6469996", "text": "def setup\n\n end", "title": "" }, { "docid": "bfc69e4949f99cb9fe298d757ddb8a87", "score": "0.6469996", "text": "def setup\n\n end", "title": "" }, { "docid": "bfc69e4949f99cb9fe298d757ddb8a87", "score": "0.6469996", "text": "def setup\n\n end", "title": "" }, { "docid": "ce5245890354c6826a1779013d5c4a23", "score": "0.6469323", "text": "def test_001\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n #Click Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n @@pu.destroy\n # logout\n logout\n\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.6445932", "text": "def setup\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.6445932", "text": "def setup\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.6445932", "text": "def setup\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.6445932", "text": "def setup\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.6445932", "text": "def setup\n end", "title": "" }, { "docid": "55011b23688ae8a6d8cf5f59a12d3923", "score": "0.6445932", "text": "def setup\n end", "title": "" }, { "docid": "e9748b85ddb9d5afe3a6b48a9795e53c", "score": "0.64453536", "text": "def test\n\n end", "title": "" }, { "docid": "da0357a2b96a610e1869a3bc7a1a68bc", "score": "0.64426666", "text": "def test_007\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n @@pu = Pu.find_by_name('SamplePU1')\n\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')\n\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # test for value of master into combobox in master tab\n assert_equal [\"sample_c_cpp\"], get_select_options(\"master_id\")\n assert is_text_present(_(\"Optional setting\"))\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n # click link setup QAC++\n assert is_text_present(\"qacpp\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link2\"]\n sleep 2\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "1a6186064d8218f9aa0c8b82bcc4fdae", "score": "0.64423496", "text": "def __dummy_test__\n end", "title": "" }, { "docid": "0d4b620075906cbc657bf6965cdeaf0c", "score": "0.64388436", "text": "def test\n end", "title": "" }, { "docid": "0d4b620075906cbc657bf6965cdeaf0c", "score": "0.64388436", "text": "def test\n end", "title": "" }, { "docid": "0d4b620075906cbc657bf6965cdeaf0c", "score": "0.64388436", "text": "def test\n end", "title": "" }, { "docid": "171bfbcb531c5e13322384224eba1358", "score": "0.64386326", "text": "def test_method\n end", "title": "" }, { "docid": "5a4611c2abd8d87da273054b80362747", "score": "0.6430815", "text": "def running_test_step; end", "title": "" }, { "docid": "38a3fd7269acc23d9e9ad422cb365507", "score": "0.64185137", "text": "def test_008\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n @@pj = Pj.find_by_name('SamplePJ1')#\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # test for value of master into combobox in master tab\n assert_equal [\"sample_c_cpp\"], get_select_options(\"master_id\")\n assert is_text_present(_(\"Optional setting\"))\n\n click $xpath[\"task\"][\"registration_task_button\"]\n sleep 2\n #assert !60.times{ break if (is_text_present(\"解析ツール未選択 入力内容に問題があるためタスクを登録できません。\") rescue false); sleep 2 }\n\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "bad56addebf754df66f254cab3a17c1a", "score": "0.6417282", "text": "def self_test(switches)\n #Visual test to see if we loaded data correctly.\n switches.each do |s|\n pp s\n end\nend", "title": "" }, { "docid": "04d18d246e7639d0aba123fd90cfb28f", "score": "0.6416549", "text": "def setup\r\n end", "title": "" }, { "docid": "b38649ee1d5bbd136b6bf45cf1133a1f", "score": "0.63794464", "text": "def boostrap_test_function()\n\n # sleep(2)\n # puts \"Test sending mms\"\n # require_relative './code-snippets/send-mms'\n # read_extension_phone_number_detect_mms_feature()\n # return\n # sleep(2)\n # puts \"Test sending Fax\"\n # require_relative './code-snippets/send-fax'\n # send_fax()\n #\n # sleep(2)\n # puts \"Test reading message store\"\n # require_relative './code-snippets/message-store'\n # read_extension_message_store()\n #\n # sleep(2)\n # puts \"Test reading number features\"\n # require_relative './code-snippets/number-features'\n # detect_sms_feature()\n\n # sleep(2)\n # puts \"Test export message store\"\n # require_relative './code-snippets/message-store-export'\n # create_message_store_report()\n\n sleep(2)\n puts \"Test sending batch sms\"\n require_relative './code-snippets/send-a2p-sms'\n read_extension_phone_number_detect_a2psms_feature()\nend", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.63730955", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.63730955", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.63730955", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.63730955", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.63730955", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.63730955", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.63730955", "text": "def setup\n \n end", "title": "" }, { "docid": "f9b8a3c689f304a84e5c9cb4c0c150e5", "score": "0.6350361", "text": "def test_004\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 全体解析 (Analysis of all)\n select \"analyze_type\", \"label=#{@overall}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n #There is no display below \"selection of the upload method of an individual analysis file.\"\n assert !is_text_present(_(\"Select the upload method of individual analysis files\"))\n\n @@pu.destroy\n # logout\n logout\n\n end", "title": "" }, { "docid": "c5eb90340ff757dcbd333dd658ca8f62", "score": "0.6334107", "text": "def setup; end", "title": "" }, { "docid": "81181d50f916900dfc9e1b5ff729dfa6", "score": "0.6305027", "text": "def simpletest_tests(bs)\n #check to see if our internal description is correct.\n assert_equal [:simpletest], bs.tables.keys\n assert_equal [:id, :test], bs.tables[:simpletest].columns.keys\n #check to see if our database description is correct\n bs.connect do |db|\n assert_equal [:simpletest], db.tables\n assert_equal [:id, :test], db[:simpletest].columns\n end\n end", "title": "" }, { "docid": "4c19dfa9f5fd3f7e08fe8999045be7d0", "score": "0.6281284", "text": "def after_test(_test); end", "title": "" }, { "docid": "4c19dfa9f5fd3f7e08fe8999045be7d0", "score": "0.6281284", "text": "def after_test(_test); end", "title": "" }, { "docid": "4c19dfa9f5fd3f7e08fe8999045be7d0", "score": "0.6281284", "text": "def after_test(_test); end", "title": "" }, { "docid": "e3c66aee08c863fc64b9c4cf56a22501", "score": "0.62787086", "text": "def before() ; end", "title": "" }, { "docid": "e4dc3df2a489fb1bddcc5bb4b5db0fc0", "score": "0.6268946", "text": "def test_005\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n # #Find a PU\n #Pu created\n pu_name = 'pu'\n register_pu(pu_name)\n @@pu = Pu.find(:last)\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n pj_name = 'pj'\n register_pj(pj_name)\n @@pj = Pj.find(:last)\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n # test for individual analysis task\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #The contents of a display of a \"master\" tab become\n # a thing for individual analysis task registration.\n click $xpath[\"task\"][\"main_area_td4\"]\n wait_for_page_to_load \"30000\"\n assert is_text_present(_(\"Registration of an Analysis Task\"))\n # select analyze type: 個人解析\n select \"analyze_type\", \"label=#{@individual}\"\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n # Below \"selection of the upload method of an individual analysis file\" is displayed.\n assert is_text_present(_(\"Select a master\"))\n assert is_text_present(_(\"Master\"))\n assert is_text_present(_(\"Select the upload method of individual analysis files\"))\n assert is_text_present(_(\"Upload of individual analysis files\"))\n\n @@pu.destroy\n # logout\n logout\n\n end", "title": "" }, { "docid": "3197d54c048f8c28657a0d0ccf70abe0", "score": "0.6263701", "text": "def testing_end\n end", "title": "" }, { "docid": "e5c9ca1c1d29d6d09c074f01efb958d9", "score": "0.6251269", "text": "def setup\n\t\t\t\tp \"mytest1 setup\"\n\t\tend", "title": "" }, { "docid": "a8afe1134a6e9676b89552ce88e9eb5f", "score": "0.62489444", "text": "def test_010\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n #Pu created\n\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n # test master of PJ is not registered\n assert is_text_present(_(\"Details of an analysis task\"))\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n\n click $xpath[\"task\"][\"general_control_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Basic Setting\")) rescue false); sleep 2 }\n sleep 3\n select \"analyze_type\", \"label=#{@individual}\"\n sleep 3\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n\n # click link setup QAC\n assert is_text_present(\"qac\")\n sleep 3\n click $xpath[\"task\"][\"option_setup_link\"]\n # check log in the navigation bar\n assert !60.times{ break if (is_text_present(_(\"It returns to the state before a save.\")) rescue false); sleep 2 }\n run_script \"destroy_subwindow()\"\n\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.6246374", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.6246374", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.6246374", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.6246374", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.6246374", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.6246374", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.6246374", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.6246374", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.6246374", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.6246374", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.6246374", "text": "def setup\n end", "title": "" }, { "docid": "412256e2fee494992b407640ab04593b", "score": "0.6246374", "text": "def setup\n end", "title": "" }, { "docid": "619be52812cb8b1d3069a29bbe25e801", "score": "0.6239469", "text": "def run_test\n # Add your code here...\n end", "title": "" }, { "docid": "619be52812cb8b1d3069a29bbe25e801", "score": "0.6239469", "text": "def run_test\n # Add your code here...\n end", "title": "" }, { "docid": "375cdff822ceca3355bb5f395548eb36", "score": "0.6208534", "text": "def test_BooksForAnAuthor\n loginRegisterBazzarVoice\n writeReview \n assert true \n end", "title": "" }, { "docid": "576384889287d1fce64efe65252ce604", "score": "0.6202874", "text": "def test_driver_start_getLocation_cathedral\n\t\td = Driver::new(\"Driver 1\",1)\n\t\tassert_equal d.getLocation, 1\n\tend", "title": "" }, { "docid": "844d78d905ab56b1bdf0377b6cc20d4c", "score": "0.6193341", "text": "def test_021\n\n # login\n login\n\n # Open PU management page\n open_pu_management_page_1\n\n #Find a PU\n\n @@pu = Pu.find_by_name('SamplePU1')\n open \"/devgroup/pu_index/#{@@pu.id}\"\n wait_for_page_to_load \"30000\"\n\n sleep 2\n\n #Find a PJ of PU\n open_pj_management_page(@@pu.id)\n\n @@pj = Pj.find_by_name('SamplePJ1')\n open\"/devgroup/pj_index/#{@@pu.id}/#{@@pj.id}\"\n wait_for_page_to_load \"30000\"\n\n #Open \"Registration of analysis task\" page\n open(\"/task/index2/#{@@pu.id}/#{@@pj.id}\")\n #Open master control tab\n click $xpath[\"task\"][\"main_area_td4\"]\n assert !60.times{ break if (is_text_present(_(\"Registration of an Analysis Task\")) rescue false); sleep 2 }\n #Master tab\n click $xpath[\"task\"][\"master_tab\"]\n assert !60.times{ break if (is_text_present(_(\"Select a master\")) rescue false); sleep 2 }\n assert is_text_present(\"qac\")\n sleep 3\n #Click link set of qac\n click $xpath[\"task\"][\"set_qac_link\"]\n\n sleep 3\n #wait for loading page\n wait_for_condition(\"Ajax.Request\",\"30000\")\n\n #uncheck an option setup of a directory.\n click $xpath[\"task\"][\"master_option_chk2\"]\n sleep 3\n\n #Set Make_root as a suitable directory.\n type \"option_makeroot\", \"public/\"\n\n #The button \"which returns reflecting change\" is clicked.\n click $xpath[\"task\"][\"back_to_reflect_the_changes\"]\n sleep 3\n\n #An option setup of the target tool is changed.\n assert is_text_present(_(\"Make root\")+\":\")\n\n # logout\n logout\n\n end", "title": "" }, { "docid": "aade447288de3899ffe45523ffa187a0", "score": "0.6185827", "text": "def test_user_input_driver_print_valid\n\n end", "title": "" } ]
d23694dee34fb222e2d04cb78b8d6f0d
additional function (reverse string)
[ { "docid": "7bafcd1b6ebdebc524d5f4ed3b5347ad", "score": "0.0", "text": "def reverse(str)\n reverse = ''\n\n str.length.times do |i|\n reverse.insert(i, str[-1-i].chr)\n end\n\n return reverse\nend", "title": "" } ]
[ { "docid": "322c8c8db406a972295707795ed604c7", "score": "0.86396486", "text": "def reverse(string)\nend", "title": "" }, { "docid": "322c8c8db406a972295707795ed604c7", "score": "0.86396486", "text": "def reverse(string)\nend", "title": "" }, { "docid": "d14471b5a64486b09658bfff828f2bfa", "score": "0.8572006", "text": "def reverse(string)\n\nend", "title": "" }, { "docid": "d14471b5a64486b09658bfff828f2bfa", "score": "0.8572006", "text": "def reverse(string)\n\nend", "title": "" }, { "docid": "d14471b5a64486b09658bfff828f2bfa", "score": "0.8572006", "text": "def reverse(string)\n\nend", "title": "" }, { "docid": "a4e55503ab080650b97a9e0ce0890719", "score": "0.8413798", "text": "def reverse_string x\n\tx.reverse\nend", "title": "" }, { "docid": "81bff02da96fec1fbc1be37453c752b3", "score": "0.8413638", "text": "def reverse_string string\n\tstring.reverse\nend", "title": "" }, { "docid": "81bff02da96fec1fbc1be37453c752b3", "score": "0.8413638", "text": "def reverse_string string\n\tstring.reverse\nend", "title": "" }, { "docid": "81bff02da96fec1fbc1be37453c752b3", "score": "0.8413638", "text": "def reverse_string string\n\tstring.reverse\nend", "title": "" }, { "docid": "6eda566289a1edfd9afd27e51c0a577c", "score": "0.84024966", "text": "def reverse_string string\n\tstring.reverse!\nend", "title": "" }, { "docid": "67abb1048b6d8edc8aa7d315e5986da5", "score": "0.8384666", "text": "def reverse_string(s)\n s.reverse! \nend", "title": "" }, { "docid": "4a8b8c9a5310bfbd00d48905b5305e59", "score": "0.83616203", "text": "def string_reverse(str)\n str.reverse\nend", "title": "" }, { "docid": "25c9bc326c54dd710b666bae54911822", "score": "0.8356373", "text": "def reverse_string(string)\n\tstring.reverse\nend", "title": "" }, { "docid": "25c9bc326c54dd710b666bae54911822", "score": "0.8356373", "text": "def reverse_string(string)\n\tstring.reverse\nend", "title": "" }, { "docid": "6b15c49bb830367682258c93a9c5e7b2", "score": "0.8346445", "text": "def reverse(s)\n\nend", "title": "" }, { "docid": "be25ef935f29a25d97a50692ee1ebdaf", "score": "0.8344963", "text": "def reverse_string (string)\n string.reverse\nend", "title": "" }, { "docid": "36d4d0698f28c27ff6eafa2295071c2a", "score": "0.83369434", "text": "def reverse(string)\n \t\tstring.reverse\nend", "title": "" }, { "docid": "8c9babbec6f7b0316ca57b1354d8f4bd", "score": "0.8316675", "text": "def reverse (string)\n string.reverse\nend", "title": "" }, { "docid": "196b8fadb1a786ce6df2f79557cf0952", "score": "0.83110565", "text": "def reverse_string(string)\n string.reverse\nend", "title": "" }, { "docid": "196b8fadb1a786ce6df2f79557cf0952", "score": "0.83110565", "text": "def reverse_string(string)\n string.reverse\nend", "title": "" }, { "docid": "196b8fadb1a786ce6df2f79557cf0952", "score": "0.83110565", "text": "def reverse_string(string)\n string.reverse\nend", "title": "" }, { "docid": "f4b0a0113d586b436d5c75e1342c1a6e", "score": "0.8296317", "text": "def reverse_string str\n\tstr.reverse\nend", "title": "" }, { "docid": "b264a9e0f370c489ad5cfff1b70c80d0", "score": "0.8256604", "text": "def reverse_string(string)\n return string.reverse\nend", "title": "" }, { "docid": "a084e752b6497b6bb282ef989a22858b", "score": "0.82504946", "text": "def reverse_string string\n string.reverse\nend", "title": "" }, { "docid": "a084e752b6497b6bb282ef989a22858b", "score": "0.82504946", "text": "def reverse_string string\n string.reverse\nend", "title": "" }, { "docid": "9fbfa2d7c3ea640507ed82c559929345", "score": "0.8249144", "text": "def reverse_string string\n return string.reverse\nend", "title": "" }, { "docid": "9fbfa2d7c3ea640507ed82c559929345", "score": "0.8249144", "text": "def reverse_string string\n return string.reverse\nend", "title": "" }, { "docid": "9fbfa2d7c3ea640507ed82c559929345", "score": "0.8249144", "text": "def reverse_string string\n return string.reverse\nend", "title": "" }, { "docid": "268d7c2c57ffaffc53773bf606b68a8a", "score": "0.82266873", "text": "def reverse(string)\n string.reverse\nend", "title": "" }, { "docid": "268d7c2c57ffaffc53773bf606b68a8a", "score": "0.82266873", "text": "def reverse(string)\n string.reverse\nend", "title": "" }, { "docid": "265b562b7027327b00d1fd428c28e84c", "score": "0.82234377", "text": "def string_reverse(my_string)\r\n string_reverse_helper(my_string, 0, my_string.length-1)\r\nend", "title": "" }, { "docid": "a4525e28ef23593b6e43a644084bcc11", "score": "0.82173955", "text": "def reverse_string string\n return string.reverse!\nend", "title": "" }, { "docid": "bdbd5f954233ef5022d39bb87274f0e0", "score": "0.81733876", "text": "def reverse(str)\n return str.reverse()\nend", "title": "" }, { "docid": "bdbd5f954233ef5022d39bb87274f0e0", "score": "0.81733876", "text": "def reverse(str)\n return str.reverse()\nend", "title": "" }, { "docid": "68949c4e0370ef837f60cbf78559e38f", "score": "0.81350565", "text": "def reverse_string string1\n string1.reverse\nend", "title": "" }, { "docid": "b8dfad0970b803e1f4a522ee31be48f4", "score": "0.81329846", "text": "def reverse_string string1\n\tstring1.reverse\nend", "title": "" }, { "docid": "6b21ef4528123d99dde7bb86c5cc2f81", "score": "0.81265676", "text": "def string_reverse(my_string)\r\n reverse(my_string, 0, my_string.length-1)\r\n return my_string\r\nend", "title": "" }, { "docid": "67afd8ef85e42d74787b7f674e206435", "score": "0.8122769", "text": "def reverse(str)\n return str.reverse\nend", "title": "" }, { "docid": "5070185c3fa45c1719f261eeb28f745c", "score": "0.8112441", "text": "def reverse(str)\n str.reverse\nend", "title": "" }, { "docid": "5070185c3fa45c1719f261eeb28f745c", "score": "0.8112441", "text": "def reverse(str)\n str.reverse\nend", "title": "" }, { "docid": "b85ea2492fb49462379647db6167e10b", "score": "0.8108128", "text": "def reverse\n str.reverse\n end", "title": "" }, { "docid": "d65dcaca528b115d228d365b4adf4248", "score": "0.81074977", "text": "def reverse_string string1\n\tstring1.reverse!\nend", "title": "" }, { "docid": "b1407fd7d32bd94d6618437ac9fda86a", "score": "0.80709124", "text": "def reverse_string(string)\n reverse = string.reverse!\nend", "title": "" }, { "docid": "8e3e3b928cdeac824a64db1e27d4596d", "score": "0.80448693", "text": "def my_reverse(str)\n new_str = str.chars.join\n my_reverse!(new_str)\nend", "title": "" }, { "docid": "75e8227a9bc683d7f28147a60e24efbc", "score": "0.8030152", "text": "def reverse_text(string)\r\n\tstring.reverse\r\nend", "title": "" }, { "docid": "662042d8c6c05eba9b756f7e29341be6", "score": "0.7974847", "text": "def reverseString(string)\n puts string.reverse\nend", "title": "" }, { "docid": "78497cfc38ba16e08cb81efe59259377", "score": "0.7970334", "text": "def reverse_string string1\n\t# string_reverse = string1\n\t# string_reverse.reverse!\n\tstring1.reverse!\nend", "title": "" }, { "docid": "a5c0536f7407e4254171363ac763223f", "score": "0.794905", "text": "def reverse(string)\n puts string.reverse\nend", "title": "" }, { "docid": "04e0faf1af9abbe8c941c342c9cccf48", "score": "0.79442775", "text": "def reverseString(s)\n # Ruby has a built-in reverse function\n return s.reverse!\nend", "title": "" }, { "docid": "eb7ba3537446fb5afd15b69f6295223a", "score": "0.7899164", "text": "def reverse(string)\n return \"\" if string == \"\"\n \n string[-1] + reverse(string[0..-2])\nend", "title": "" }, { "docid": "79c1f993fdfb05c50b2e9c4669d097be", "score": "0.78965914", "text": "def reverse_string_with_reverse (string)\n string.split(\"\").reverse.join(\"\")\nend", "title": "" }, { "docid": "7e89ff477a09795b0c29419a72e042cb", "score": "0.7877873", "text": "def reverse(str)\r\n return \"\" if str.length == 0\r\n\r\n str[-1] + reverse(str[0...-1])\r\n\r\nend", "title": "" }, { "docid": "fd343690c276fc2f4caba7933cf0a06b", "score": "0.7873683", "text": "def reverse string\r\n return string if string.length < 2\r\n string[-1] + reverse(string[1...-1]) + string[0]\r\nend", "title": "" }, { "docid": "1eb0fadfae4cd2d55fddf589f9b38c25", "score": "0.7856943", "text": "def reverse\n forward(handler.reverse(@string))\n end", "title": "" }, { "docid": "a1009ff152bf9cba1e13eb224fa4cd71", "score": "0.7840742", "text": "def string_reverse(str)\n return str if str.length == 1\n str[-1] + string_reverse(str[0..-2]) \nend", "title": "" }, { "docid": "b38b206e49774aaba85de375092f3a8f", "score": "0.7816514", "text": "def reverse(string)\n #your code here\n return string.split.reverse.join(\" \")\nend", "title": "" }, { "docid": "102275edc610e91b29b02ad165365820", "score": "0.7809497", "text": "def reverse(string)\n return \"\" if string.empty?\n string[-1]+ reverse(string[0..-2])\nend", "title": "" }, { "docid": "7c20b3815535e2bbea6a706593689b87", "score": "0.7804824", "text": "def reverse(string)\n return \"\" if string == \"\"\n string[-1] + string[0..-2].reverse\nend", "title": "" }, { "docid": "1be29a6c2f2bf32457e548269d27469a", "score": "0.7802683", "text": "def reverse(str)\n return '' if str.length == 0\n\n str[-1] + reverse(str[0..-2])\nend", "title": "" }, { "docid": "499b2b5035097212ae62b5592c5d2baf", "score": "0.7791018", "text": "def reverse_string(str)\n return \"\" if str.length == 0\n str[-1] + reverse_string(str[0...-1])\nend", "title": "" }, { "docid": "499b2b5035097212ae62b5592c5d2baf", "score": "0.7791018", "text": "def reverse_string(str)\n return \"\" if str.length == 0\n str[-1] + reverse_string(str[0...-1])\nend", "title": "" }, { "docid": "034f79f6c46accc6ef892b5eba43b509", "score": "0.7788481", "text": "def reverse(str)\n return \"\" if str.empty?\n str[-1] + reverse(str[0..-2])\nend", "title": "" }, { "docid": "aeec1eab78034ca65f4562c7ab27b7bc", "score": "0.7786341", "text": "def my_reverse(s)\n\treverse_string = s.downcase\t\t\n\t\t#Purpose is to get a new string with same legth as 's'. \n\t\t#Using downcase avoids error (maybe a relational error that causes program to run incorrectly) \n\tnum_letters = s.length\n\t(0...num_letters).each do |n|\t\t#Loop to reverse sequence of characters\n\t\treverse_string[n]=s[num_letters-1-n]\n\tend\n return reverse_string \t#Return result\nend", "title": "" }, { "docid": "d416e85d24ad318404c3f02e4acc1785", "score": "0.77703863", "text": "def reverseString(str)\n puts str.split('').reverse().join('')\nend", "title": "" }, { "docid": "7750681282caa5a139f86dc450add7af", "score": "0.7765987", "text": "def reverse(str)\n return \"\" if str.empty?\n str[-1] + reverse(str[0...-1])\nend", "title": "" }, { "docid": "050e6f887f0d82253d5dec74f8017683", "score": "0.7760558", "text": "def string_reverse(my_string)\r\n return if !my_string\r\n (my_string.length / 2).times do |i|\r\n temp = my_string[i]\r\n my_string[i] = my_string[-i - 1]\r\n my_string[-i - 1] = temp\r\n end\r\n return my_string\r\nend", "title": "" }, { "docid": "62082492f992694ee954031b130bc2a5", "score": "0.7760305", "text": "def string_reverse(my_string)\r\n return \"\" if my_string == nil || my_string.length < 1\r\n p = my_string.length / 2\r\n q = my_string.length\r\n p.times do |x|\r\n temp = my_string[x]\r\n my_string[x] = my_string[q - x - 1]\r\n my_string[q - x - 1] = temp\r\n end\r\n return my_string\r\nend", "title": "" }, { "docid": "4f1f451774e8ad7e7aa272e259c36261", "score": "0.77602977", "text": "def string_reverse(my_string)\r\n if my_string == nil\r\n return my_string\r\n end\r\n i = 0\r\n n = my_string.length - 1\r\n while i < n\r\n a = my_string[n]\r\n b = my_string[i]\r\n my_string[i] = a\r\n my_string[n] = b\r\n n -= 1\r\n i += 1\r\n end\r\nend", "title": "" }, { "docid": "e828205e46801c5c7105c9fcffd0df5e", "score": "0.77528185", "text": "def reverse(str)\n str.reverse\n end", "title": "" }, { "docid": "da2ae3fd99e740a5dd7db5323ca66ec7", "score": "0.77460164", "text": "def solution(str)\n str.reverse()\nend", "title": "" }, { "docid": "c1839aa6bc3f754c6bd2026e96771d31", "score": "0.7743611", "text": "def reverse(string)\n return '' if string.empty?\n string[1..-1].reverse + string[0]\nend", "title": "" }, { "docid": "052069d0a4a1f963a1ea6b94e81cd87b", "score": "0.7734482", "text": "def reverse(string)\n return \"\" if string.length == 0\n reverse = string[0]\n reverse(string[1..-1]) + reverse\nend", "title": "" }, { "docid": "ca0c2b16eed5a30b209a19298502b076", "score": "0.77284646", "text": "def reverse_string (ary)\n ary.reverse!\nend", "title": "" }, { "docid": "91eec72feabca60022ecc302a752a59c", "score": "0.7726313", "text": "def string_reversal(string_parameter) #local variables you can only use per section of code or whever it lies\n string_parameter.reverse\n# result = ''\n# string_parameter.chars.each do |char|\n# result = char + result\n# end\n# result\nend", "title": "" }, { "docid": "dc4d2705e2321425876a054dbb14ad06", "score": "0.7690145", "text": "def reverse(str)\n #base case\n return str if str.length <= 1\n #inductive_case\n str[-1] + reverse(str[0...-1])\nend", "title": "" }, { "docid": "b8e31171b37a93d3d2f3aa27ace040fc", "score": "0.7685843", "text": "def manual_reverse(str)\n str = str.split\n \n new_string = []\n \n str.length.times do\n new_string << str.last\n str.pop\n end\n \n joined_string = new_string.join(\" \")\n \n p joined_string\nend", "title": "" }, { "docid": "72cd4dcd54d9e2a58421db832e2c7035", "score": "0.7682756", "text": "def reverse(string)\n return \"\" if string.empty?\n new_str = \"\"\n new_str << string[-1]\n new_str + reverse(string[0..-2])\nend", "title": "" }, { "docid": "e3e07025523ed36361ec4e838809db81", "score": "0.7670339", "text": "def reverse(string)\n return \"\" if str.empty?\n reverse(string[1..-1] + string[0])\nend", "title": "" }, { "docid": "0cf7923d5d3b6577a6f92a84ef8d8ab1", "score": "0.76672953", "text": "def reverse_string1 string\n rev = ''\n length = string.length\n length.times do |i| \n rev += string[string.length-i-1]\n end\n return rev\nend", "title": "" }, { "docid": "bb289f8324b4911e44072c52fbaddc31", "score": "0.7664592", "text": "def reverse(str)\n str.length <= 1 ? str : str[-1] + reverse(str[0...-1]) \nend", "title": "" }, { "docid": "c08fbca31cbd9223724037a32637b65a", "score": "0.76622856", "text": "def reverse(s)\n return \"\" if s.length == 0 \n return s[-1] + reverse(s[0..-2])\nend", "title": "" }, { "docid": "41c954c744490620a8912c1d9092df3c", "score": "0.76615816", "text": "def reverse(word)\nend", "title": "" }, { "docid": "c3ee39796352d940cf474d0b7ca729f9", "score": "0.7651719", "text": "def reverse_inplace(s)\n #base case\n reverse_helper(s, 0, s.length - 1)\nend", "title": "" }, { "docid": "275e0eb778b6bc8351da002b09e0844d", "score": "0.76438993", "text": "def reverse(s)\n #base case\n if s.length == 0\n return \"\"\n else\n return s[-1] + reverse(s[0..-2])\n end\n \nend", "title": "" }, { "docid": "f0af7052b4664d180c4b1535bec02b65", "score": "0.76412314", "text": "def reverse_string(str)\n return str if str.length <= 1\n str[-1] + reverse_string(str[0...-1])\nend", "title": "" }, { "docid": "269d7a41e42a5b7a5ddd08432d154364", "score": "0.76389605", "text": "def string_reverse(my_string)\r\nreturn my_string if my_string == nil || my_string.length <= 1\r\n\r\n start_index = 0\r\n end_index = my_string.length - 1\r\n while start_index < end_index\r\n temp_storage = my_string[start_index]\r\n my_string[start_index] = my_string[end_index]\r\n my_string[end_index] = temp_storage\r\n start_index += 1\r\n end_index -= 1\r\n end\r\n\r\n return my_string\r\nend", "title": "" }, { "docid": "341c570626312d9e8ed846899f5c9738", "score": "0.76371384", "text": "def string_reverse(my_string)\r\n if my_string != nil\r\n i = 0\r\n last = my_string.length - 1\r\n temp = 0\r\n\r\n while i < last\r\n temp = my_string[i]\r\n my_string[i] = my_string[last]\r\n my_string[last] = temp\r\n i += 1\r\n last -= 1\r\n end\r\n end\r\n return my_string\r\nend", "title": "" }, { "docid": "61d19c90142a52a3b43c3c983ee1dc73", "score": "0.7636976", "text": "def reverse(str)\n return \"\" if str.length == 0\n return reverse(str[1..-1]) + str[0]\nend", "title": "" }, { "docid": "016378a1108c8bb71b0771da0e2866f7", "score": "0.7634781", "text": "def string_reverse(my_string)\n return my_string if my_string.nil? || my_string == \"\"\n i = 0\n j = my_string.length - 1\n\n while i < j\n placeholder = my_string[i]\n my_string[i] = my_string[j]\n my_string[j] = placeholder\n i += 1\n j -= 1\n end\n return my_string\nend", "title": "" }, { "docid": "1feafff3d6b095effd4f0ce5bef5e686", "score": "0.76291263", "text": "def reverse(s)\n\t# base case\n\t\treturn s if s.length <= 1\n\t\t# recursive case - with range argument found here: https://ruby-doc.org/core-2.5.0/Range.html\n\t\treversed_str = reverse(s[1..-1])\n\t\t# \"t\", \"ta\", \"tac\"\n\t\t# new string that contains the first reversed character\n\t\treversed_str << s[0]\n\t\treversed_str\n\t\nend", "title": "" }, { "docid": "084dfabf798af0f26cbd1a400e32465e", "score": "0.76282525", "text": "def string_reverse(my_string)\r\n if my_string == nil\r\n return my_string\r\n else\r\n f = 0\r\n l = my_string.length - 1\r\n\r\n while f < l\r\n temp = my_string[f]\r\n my_string[f] = my_string[l]\r\n my_string[l] = temp\r\n f += 1\r\n l -= 1\r\n end\r\n return my_string\r\n end \r\nend", "title": "" }, { "docid": "230daf520cd69e167f68fc2c4d389c2d", "score": "0.7626443", "text": "def reverse(str)\n #base case\n return str if str.length <= 1\n #inductive step\n string[-1] + reverse(str[0..-2])\nend", "title": "" }, { "docid": "1801443cbd6e54d06ee63b07c4f09fb7", "score": "0.76235914", "text": "def string_reverse(my_string)\r\n if my_string\r\n length = my_string.length\r\n (length / 2).times do |index|\r\n temp = my_string[index]\r\n my_string[index] = my_string[length - (index + 1)]\r\n my_string[length - (index + 1)] = temp\r\n end\r\n return my_string\r\n else\r\n return nil\r\n end\r\nend", "title": "" }, { "docid": "1d52ec6f2275a2c1212b1477fef057ee", "score": "0.7620821", "text": "def reverse1(word)\n\tword.reverse\nend", "title": "" }, { "docid": "1e743b8ad3d3276fcf336afececc89cf", "score": "0.76203686", "text": "def reverse(str)\n\treturn \"\" if str.empty?\n\treverse(str[1..-1]) + str[0]\nend", "title": "" }, { "docid": "11c5fabd7974f05da2651d752542efd2", "score": "0.7618793", "text": "def reverse(string)\n return \"\" if string.empty?\n reverse(string[1..-1]) + string[0]\nend", "title": "" }, { "docid": "873126f00bd0ec75a23fd62d941e01a5", "score": "0.7606564", "text": "def string_reverse(my_string)\r\n if my_string == nil\r\n return nil\r\n end\r\n i = 0\r\n j = my_string.length\r\n\r\n while i < j\r\n a = my_string[i]\r\n my_string[i] = my_string[j - 1]\r\n my_string[j - 1] = a\r\n i += 1\r\n j -= 1\r\n end\r\n return my_string\r\nend", "title": "" }, { "docid": "f0faa8f376af70a78f47cb74856e48f2", "score": "0.76000714", "text": "def reverse(s)\n if (s != \"\")\n return s[-1] + reverse(s[0...-1])\n else\n return \"\"\n end\nend", "title": "" }, { "docid": "694ecbf590ed5c183f79447c4d0d44ef", "score": "0.75997835", "text": "def solution(str)\n str.reverse\nend", "title": "" }, { "docid": "694ecbf590ed5c183f79447c4d0d44ef", "score": "0.75997835", "text": "def solution(str)\n str.reverse\nend", "title": "" }, { "docid": "694ecbf590ed5c183f79447c4d0d44ef", "score": "0.75997835", "text": "def solution(str)\n str.reverse\nend", "title": "" } ]
51c451cc85d201fe7ad507cc670c9c1f
Processes the output of the cartridge configure script and scrapes it for connectivity details (such as IP and credentials). Adds a new attribute 'db' of type DbConnection to the cart with the scraped details.
[ { "docid": "f38092e87bf29d06387136c3225fb24c", "score": "0.716977", "text": "def configure_hook_completed(args)\n $logger.info(\"DatabaseCartListener is processing configure hook results\")\n\n cart = args[:cart]\n output = args[:output]\n\n my_username_pattern = /Root User: (\\S+)/\n my_password_pattern = /Root Password: (\\S+)/\n\n # make this smarter if there are more use cases\n ip_pattern_prefix = cart.name[/[^-]*/]\n my_ip_pattern = /#{ip_pattern_prefix}:\\/\\/(\\d+\\.\\d+\\.\\d+\\.\\d+):(\\d+)/\n\n db = DbConnection.new\n\n output.split(/\\n/).each do |line|\n if line.match(my_username_pattern)\n db.username = $1\n end\n if line.match(my_password_pattern)\n db.password = $1\n end\n if line.match(my_ip_pattern)\n db.ip = $1\n db.port = $2\n end\n end\n\n $logger.info(\"DatabaseCartListener is adding a DbConnection to cartridge #{cart.name}: \"\\\n \"db.username=#{db.username}, db.password=#{db.password}, db.ip=#{db.port}, db.port=#{db.port}\")\n cart.instance_variable_set(:@db, db)\n cart.instance_eval('def db; @db; end')\n end", "title": "" } ]
[ { "docid": "c7d310de36bee73fded301a9edcba71b", "score": "0.55218375", "text": "def connect\n if (@type == \"db2\")\n @config\n Models::Databases::SiteDatabase::Base.setup_connection(@config)\n elsif (@type == \"bops\")\n @config\n Models::Databases::Bops::Base.setup_connection(@config)\n else\n Models::Databases::Dyces::Base.setup_connection(@config)\n end\n\n @connection = @type\n\n Log.instance.debug \"Connected to #@db_url\"\n self\n end", "title": "" }, { "docid": "7397672436caf8ffc96785fc233bad56", "score": "0.5460217", "text": "def db_config\n @db_config ||= begin \n raise \"ENV['#{env_prefix}_DATABASE_URL'] expected but not found!\" unless ENV[\"#{env_prefix}_DATABASE_URL\"]\n config = parse_db_uri(ENV[\"#{env_prefix}_DATABASE_URL\"])\n \n if ENV[\"#{env_prefix}_DATABASE_CA\"]\n config.merge!(db_configuration({\n :sslca => ENV[\"#{env_prefix}_DATABASE_CA\"],\n :sslcert => ENV[\"#{env_prefix}_DATABASE_CERT\"],\n :sslkey => ENV[\"#{env_prefix}_DATABASE_KEY\"],\n }))\n end\n \n config\n end\n end", "title": "" }, { "docid": "de1df4da7eb601f447a39e00eb9e4eb5", "score": "0.5446115", "text": "def connectDB\n \t#config = YAML.load_file( '/home/ubuntu/DB-Performance-Testing/config/db.yml' )['DB2']\n config = YAML.load_file( @@path + '../config/db.yml' )['DB2']\n\t cstring = \"DATABASE=#{config['db']};HOSTNAME=#{config['hostname']};\"\n\t cstring += \"PORT=#{config['port']};PROTOCOL=#{config['protocol']};UID=#{config['uid']};PWD=#{config['pwd']};\"\n\t @conn = IBM_DB.connect(cstring,\"\",\"\")\n end", "title": "" }, { "docid": "3eb47d98f28b0c3f4bf8d7c38896fedf", "score": "0.54394674", "text": "def do_setup \n config = self.config\n host = config['app']['host']\n port = config['app']['port']\n @url_base = \"http://#{host}:#{port}\"\n puts config.inspect\n @pcap_dir = config.fetch 'pcap_dir'\n @index_dir = config.fetch 'index_dir'\n\n # Extract test pcaps and indexes\n FileUtils.rm_rf '/tmp/pcapr_local_test'\n FileUtils.mkdir_p @pcap_dir\n FileUtils.mkdir_p @index_dir\n\n\n # Recreate test database.\n begin\n couch = config['couch']\n RestClient.delete \"#{couch['uri']}/#{couch['database']}\"\n rescue RestClient::ResourceNotFound\n end\n db = @db = PcaprLocal.get_db(config)\n end", "title": "" }, { "docid": "ee1cec620a7aa777bd6a663b0ad2e278", "score": "0.5437598", "text": "def setup!\n configuration = RfmAdaptor::Configuration.new(:database)\n database = configuration.__send__(self.database_name)\n raise \"Database: #{self.database_name} configuration file not exists.\" if database.blank?\n raise \"Database: #{self.database_name} environment[#{self.env}] not exists.\" if database[self.env].blank?\n self.attributes = database[self.env]\n self.setup_state = true\n end", "title": "" }, { "docid": "41e4f7f0c95fd7c841c93173a25e46b9", "score": "0.5435719", "text": "def configure(config)\n VCAP::Logging.setup_from_config(config[\"logging\"])\n @logger = VCAP::Logging.logger(\"collector\")\n\t @mysql_host=config['mysql']['host']\n\t @mysql_username=config['mysql']['username']\n\t @mysql_password=config['mysql']['password']\n\t @mysql_db_name=config['mysql']['db_name']\n\t @mysql_port=config['mysql']['port'] || 3306\n @noah_info=config['noah']\n @cluster_exclude=config['cluster_exclude']\n end", "title": "" }, { "docid": "089c28549030ab5f332e0f1c4b4f3d62", "score": "0.54300296", "text": "def read_config\n\t\t\n\t\[email protected] \"START #{__FILE__}.#{__method__}\"\n\t\t\n\t\tbegin\n\t\t\n\t\t\tconfig \t\t= YAML.load_file $db_config\n\t\t\t@host \t\t= config[$db_mode][\"host\"]\t\n\t\t\t@user \t\t= config[$db_mode][\"username\"] \n\t\t\t@db_name \t= config[$db_mode][\"database\"]\n\t\t\t@password \t= config[$db_mode][\"password\"]\n\t\t\n\t\trescue Mysql2::Error => e\n\t\t\t\n\t\t\tputs \"#{__FILE__}.#{__method__} An error has occured. Please check logs.\"\n\t\t\t\n\t\t\[email protected] \"Error code: #{e.error_number}\"\n\t\t\[email protected] \"Error SQLSTATE: #{e.sql_state}\" if e.respond_to?(\"sqlstate\")\n\t\t\t\n\t\tend\n\n\t\[email protected] \"END #{__FILE__}.#{__method__}\"\t\t\n\t\t\n\tend", "title": "" }, { "docid": "cd29d3d0f066c0911b000bc9689f279f", "score": "0.53311557", "text": "def configure_connection\n end", "title": "" }, { "docid": "e2dfa88ca5e8d14f8a5d5bc8eb67d712", "score": "0.5254708", "text": "def configure_database\n\tbegin\n\t @client = Mysql2::Client.new(:host => \"localhost\", :username => \"root\", :password => \"qburst\", :database => \"ruby\")\n\trescue Exception=>e\n\t puts e.message\n\tend\n end", "title": "" }, { "docid": "3373dd91fe2e7b30142589c346605b2b", "score": "0.5242909", "text": "def database_configuration\n require 'erb'\n database_configurations = IO.read(database_configuration_file)\n\n client_config_path = \"/#{client_folder}/#{env_client_code}\\\\1\"\n client_database_configuration_file = database_configuration_file.gsub(/(\\/config\\/)/, client_config_path)\n database_configurations << IO.read(client_database_configuration_file) if File.exists?(client_database_configuration_file)\n \n YAML::load(ERB.new(database_configurations).result)\n end", "title": "" }, { "docid": "39aa8990b5824555ae47372c664f8d22", "score": "0.52386916", "text": "def configure(config)\n @index = config[\"index\"].to_i\n VCAP::Logging.setup_from_config(config[\"logging\"])\n @logger = VCAP::Logging.logger(\"collector\")\n @tsdb_host = config[\"tsdb\"][\"host\"]\n @tsdb_port = config[\"tsdb\"][\"port\"]\n\t @mysql_host=config['mysql']['host']\n\t @mysql_username=config['mysql']['username']\n\t @mysql_password=config['mysql']['password']\n\t @mysql_db_name=config['mysql']['db_name']\n\t @mysql_port=config['mysql']['port'] || 3306\n @noah_parentPath=config['noah_parentPath']\n @noah_authKey=config['noah_authKey']\n intervals = config[\"intervals\"]\n @varz_interval = intervals[\"varz\"] || 10\n @timeout_check = config[\"timeout_check\"] || 2\n end", "title": "" }, { "docid": "e96f731a63da719c0ad7a7a2bf2f6725", "score": "0.5233534", "text": "def _connect_database\n _send_command(\"db_connect #{@options[:db_user]}:#{@options[:db_pass]}@#{@options[:db_host]}/#{@options[:db_name]}\")\n end", "title": "" }, { "docid": "2097d6b9b13078b98c10d17ed5168334", "score": "0.5215623", "text": "def configure_connection\n end", "title": "" }, { "docid": "77e11354ca11b4c16fe8995677ec62e8", "score": "0.52089113", "text": "def config\n \n # TODO: Re-enable:\n # # Display the value for a specific machine.\n # $ rudy -e prod -r db config param-name\n \n if @@config.nil? || @@config.empty?\n return if @@global.quiet\n raise Rudy::NoConfig\n end\n\n outform = @@global.format == :json ? :to_json : :to_yaml\n \n types = @option.marshal_dump.keys & @@config.keys # Intersections only\n types = @@config.keys if @option.all\n types = [:machines] if types.empty?\n \n if @option.project\n rf = File.join(RUDY_HOME, 'Rudyfile')\n raise \"Cannot find: #{rf}\" unless File.exists?(rf)\n li File.read(rf)\n \n elsif @option.script\n conf = fetch_script_config\n li conf.to_hash.send(outform) if conf\n \n else\n #li \"# ACCOUNTS: [not displayed]\" if types.delete(:accounts)\n types.each do |conftype|\n li \"# #{conftype.to_s.upcase}\"\n next unless @@config[conftype] # Nothing to output\n if conftype == :accounts\n skey = @@config[conftype][:aws][:secretkey]\n @@config[conftype][:aws][:secretkey] = hide_secret_key(skey)\n end\n \n li @@config[conftype].to_hash.send(outform)\n end\n end\n \n end", "title": "" }, { "docid": "939681726216a6cb7cba8d9613bbe10f", "score": "0.5204258", "text": "def connect\n \n require \"sequel\"\n require \"sequel_model\"\n\n if File.exists?(config_file)\n Merb.logger.info!(\"Connecting to the '#{config[:database]}' database on '#{config[:host]}' using '#{config[:adapter]}' ...\")\n connection = ::Sequel.connect(config_options(config))\n Merb.logger.error!(\"Connection Error: #{e}\") unless connection\n connection\n else\n copy_sample_config\n Merb.logger.set_log(STDERR)\n Merb.logger.error! \"No database.yml file found in #{Merb.root}/config.\"\n Merb.logger.error! \"A sample file was created called config/database.sample.yml for you to copy and edit.\"\n exit(1)\n end\n \n end", "title": "" }, { "docid": "6eb2fbef9376b379361daa2cb0e10f9e", "score": "0.5192304", "text": "def database\n if File.exists? \"#{RAILS_ROOT}/config/idf2chadoxml_database.yml\" then\n db_definition = open(\"#{RAILS_ROOT}/config/idf2chadoxml_database.yml\") { |f| YAML.load(f.read)\n }\n dbinfo = Hash.new\n dbinfo[:dsn] = db_definition['ruby_dsn']\n dbinfo[:user] = db_definition['user']\n dbinfo[:password] = db_definition['password']\n return dbinfo\n else\n raise Exception.new(\"You need an idf2chadoxml_database.yml file in your config/ directory with at least a Ruby DBI dsn.\")\n end\n end", "title": "" }, { "docid": "e02d0b864a3333973d80f8c8df2eb8bb", "score": "0.51862943", "text": "def configure\n configure_databases_yml\n configure_propel_ini\n end", "title": "" }, { "docid": "7794689aba7bf363de897b8b26c51290", "score": "0.5164562", "text": "def setup!\n ActiveRecord::Base.configurations[configuration_name] = db_config\n ActiveRecord::Base.establish_connection(configuration_name).connection\n self\n end", "title": "" }, { "docid": "39637240fcb220ff5d7d5fbc144998b1", "score": "0.5160654", "text": "def mysql_injector_configurator_wiper\n puts\n $config['INJECTOR']['MYSQL']['TIME']={}\n $config['INJECTOR']['MYSQL']['UNION']={}\n $config['INJECTOR']['MYSQL']['ERROR']={}\n $config['INJECTOR']['MYSQL']['BLIND']={}\n $config['INJECTOR']['MYSQL']['URL'] = nil\n $config['INJECTOR']['MYSQL']['LOC'] = nil\n $config['INJECTOR']['MYSQL']['REF'] = nil\n $config['INJECTOR']['MYSQL']['DATA'] = nil\n $config['INJECTOR']['MYSQL']['HEADERS'] = {}\n $config['INJECTOR']['MYSQL']['COOKIES'] = {}\n $config['INJECTOR']['MYSQL']['CONFIGURED'] = false\n $config['INJECTOR']['MYSQL']['UA'] = $config['HTTP']['HTTP_USER_AGENT']\n print_good(\"MySQL Injector Configuration has been reset!\")\nend", "title": "" }, { "docid": "ab49e9541283d5ccf06cea9476193e0b", "score": "0.5156393", "text": "def mysql_injector_configurator\n puts\n # Where to inject?\n while(true)\n print_caution(\"Select Injection Location: \")\n puts \" 1) URL\".white\n puts \" 2) User-Agent\".white\n puts \" 3) Referer\".white\n puts \" 4) Header\".white\n puts \" 5) Cookie\\n\".white\n answer = Readline.readline(\" Injection Location: \", true)\n puts\n if answer[0].to_i > 0 and answer[0].to_i <= 5\n case answer[0].to_i\n when 1\n $config['INJECTOR']['MYSQL']['LOC'] = 'URL'\n when 2\n $config['INJECTOR']['MYSQL']['LOC'] = 'UA'\n when 3\n $config['INJECTOR']['MYSQL']['LOC'] = 'REF'\n when 4\n $config['INJECTOR']['MYSQL']['LOC'] = 'HEADER'\n when 5\n $config['INJECTOR']['MYSQL']['LOC'] = 'COOKIE'\n end\n break\n else\n print_error(\"Unknown option selected!\")\n print_error(\"Comeback and try again when you're ready....\\n\\n\")\n return\n end\n end\n\n # Request type & Related Info for injection?\n while(true)\n print_caution(\"Request Type: \")\n print_caution(\"1) GET\")\n print_caution(\"2) POST\")\n answer = Readline.readline(\" Type: \", true)\n if answer[0].to_i == 1 or answer[0].upcase == 'G'\n # GET\n puts if $config['INJECTOR']['MYSQL']['LOC'] == 'URL'\n print_caution(\"Remember to Note Injection point with '_SQLI_' marker when giving URL!\\n\") if $config['INJECTOR']['MYSQL']['LOC'] == 'URL'\n url = Readline.readline(\" Enter URL: \", true)\n if url.nil? or url == '' or ($config['INJECTOR']['MYSQL']['LOC'] == 'URL' and not url =~ /_SQLI_/)\n puts\n print_error(\"Invalid URL String provided, try again!\\n\")\n else\n $config['INJECTOR']['MYSQL']['URL'] = url.strip.chomp\n break\n end\n elsif answer[0].to_i == 2 or answer[0].upcase == 'P'\n # POST\n puts if $config['INJECTOR']['MYSQL']['LOC'] == 'URL'\n print_caution(\"Remember to Note Injection point with '_SQLI_' marker when giving URL or DATA!\\n\") if $config['INJECTOR']['MYSQL']['LOC'] == 'URL'\n url = Readline.readline(\" Enter URL: \", true)\n if url.nil? or url == ''\n puts\n print_error(\"Invalid URL String provided, try again!\\n\")\n else\n data = Readline.readline(\" Enter POST Data: \", true)\n if ((not data =~ /_SQLI_/ and not url =~ /_SQLI_/) and $config['INJECTOR']['MYSQL']['LOC'] == 'URL')\n puts\n print_error(\"_SQLI_ Marker not found in URL or DATA string provided! Let's try again....\\n\")\n else\n $config['INJECTOR']['MYSQL']['URL'] = url.strip.chomp\n $config['INJECTOR']['MYSQL']['DATA'] = data.strip.chomp\n break\n end\n end\n else\n puts\n print_error(\"Only two options, it's not that hard!\")\n print_error(\"Please select valid option from choices below....\\n\\n\")\n end\n end\n puts\n\n # User-Agent Injection?\n if $config['INJECTOR']['MYSQL']['LOC'] == 'UA'\n print_status(\"User-Agent Injection Selected!\")\n print_caution(\"Need for you to provide UA string to use with _SQLI_ marker set where needed!\")\n print_status(\"Current User-Agent String: \\n#{$config['HTTP']['HTTP_USER_AGENT']}\\n\")\n while(true)\n ua_str = Readline.readline(\" Enter Updated User-Agent String w/Marker: \", true)\n if ua_str =~ /_SQLI_/\n $config['INJECTOR']['MYSQL']['UA'] = ua_str.strip.chomp\n break\n else\n puts\n print_error(\"_SQLI_ Marker not found in URL or DATA string provided! Let's try again....\\n\")\n end\n end\n else\n $config['INJECTOR']['MYSQL']['UA'] = $config['HTTP']['HTTP_USER_AGENT']\n end\n\n # Referrer Based Injection?\n if $config['INJECTOR']['MYSQL']['LOC'] == 'REF'\n print_status(\"Referer Injection Selected!\")\n print_caution(\"Need for you to provide Referer string to use with _SQLI_ marker set where needed!\")\n while(true)\n ref_str = Readline.readline(\" Enter Referer String w/Marker: \", true)\n if ref_str =~ /_SQLI_/\n $config['INJECTOR']['MYSQL']['REF'] = ref_str.strip.chomp\n break\n else\n puts\n print_error(\"_SQLI_ Marker not found in URL or DATA string provided! Let's try again....\\n\")\n end\n end\n else\n $config['INJECTOR']['MYSQL']['REF'] = nil\n end\n\n # Header Based Injection?\n if $config['INJECTOR']['MYSQL']['LOC'] == 'HEADER'\n $config['INJECTOR']['MYSQL']['HEADERS'] = {}\n print_status(\"Header Based Injection Selected!\")\n print_caution(\"Need for you to provide Header Name & string value to use with _SQLI_ marker set where needed!\")\n while(true)\n head_name = Readline.readline(\" Enter Header Name: \", true)\n head_str = Readline.readline(\" Enter #{head_name.strip.chomp} Header Value w/Marker: \", true)\n if not head_name.nil? and not head_str.nil? and head_str != '' and head_name != '' and head_str =~ /_SQLI_/\n $config['INJECTOR']['MYSQL']['HEADERS'].store(head_name.strip.chomp.upcase, head_str.strip.chomp)\n break\n else\n puts\n print_error(\"Invalid info provided or _SQLI_ Marker not found! Let's try this again....\\n\")\n end\n end\n else\n $config['INJECTOR']['MYSQL']['HEADERS'] = {}\n end\n\n # Cookie Based Injection?\n if $config['INJECTOR']['MYSQL']['LOC'] == 'COOKIE'\n $config['INJECTOR']['MYSQL']['COOKIES'] = {}\n print_status(\"Cookie Based Injection Selected!\")\n print_caution(\"Need for you to provide Cookie Name & string value to use with _SQLI_ marker set where needed!\")\n while(true)\n cookie_name = Readline.readline(\" Enter Cookie Name: \", true)\n cookie_str = Readline.readline(\" Enter #{cookie_name.strip.chomp} Header Value w/Marker: \", true)\n if not cookie_name.nil? and not cookie_str.nil? and cookie_str != '' and cookie_name != '' and cookie_str =~ /_SQLI_/\n $config['INJECTOR']['MYSQL']['COOKIES'].store(cookie_name.strip.chomp.upcase, cookie_str.strip.chomp)\n break\n else\n puts\n print_error(\"Invalid info provided or _SQLI_ Marker not found! Let's try this again....\\n\")\n end\n end\n else\n $config['INJECTOR']['MYSQL']['COOKIES'] = {}\n end\n\n # Finaly we have base config set and ready to go testing...\n $config['INJECTOR']['MYSQL']['CONFIGURED'] = true\n\n # Print config details so user can reset if needed...remove later?\n puts\n print_good(\"MySQL Injector is now Configured!\")\n pp $config['INJECTOR']['MYSQL']\n puts\nend", "title": "" }, { "docid": "0ee33e0a030dc64f3fa066e4d757aead", "score": "0.51508796", "text": "def establish_config_database_connection(database_path)\n RFlow.logger.debug \"Establishing connection to config database (#{Dir.getwd}) '#{database_path}'\"\n ActiveRecord::Base.logger = RFlow.logger\n ConfigurationItem.establish_connection(:adapter => 'sqlite3', :database => database_path)\n end", "title": "" }, { "docid": "d6e82c762f5658879fdd94495e89c977", "score": "0.5148845", "text": "def conf\n unless @conf\n if @db_url || @db # skip loading config if db set explicitly\n @conf = {}\n else\n parse_command_line unless @args\n\n raise \"No configuration file defined (-c <config>).\" if @args[\"config\"].nil?\n raise \"Couldn't read #{@args[\"config\"]} file.\" unless @args['config'] && @conf = YAML::load(File.new(@args[\"config\"]).read)\n # setting default options that should be written along with all the records to process_items\n if @conf['default_options']\n @conf['default_options'].each do |k,v|\n default_options.send(\"#{k}=\", v)\n end\n end\n\n if @args['params']\n @args['params'].each do |k, v|\n default_options.send(\"#{k}=\", v)\n end\n end\n end\n end\n @conf\n end", "title": "" }, { "docid": "e1cbe75ce892812dba331539caa74dc0", "score": "0.5144528", "text": "def remote_database_config(db)\n env = rails_env || db\n config = capture \"cat #{latest_release}/config/database.yml\"\n database = YAML::load(config)\n return database[\"#{env}\"]['username'], database[\"#{env}\"]['password'], database[\"#{env}\"]['database'], database[\"#{env}\"]['host']\n end", "title": "" }, { "docid": "1c3ad9d3b9aa22950e2095bf6d9000c0", "score": "0.5142834", "text": "def connect_database\n options_file = @config.persist_options_file\n logger.debug \"Loading options from file '#{$config_file_path}/#{options_file}'\"\n # if a persist_options_file parameter was included in the server configuration,\n # then load it (as YAML) into the 'options' Hash map\n options = {}\n if options_file && !(options_file.empty?)\n full_path_to_file = \"#{$app_root}/config/#{options_file}\"\n raise RuntimeError.new \"Options file '#{full_path_to_file}' from server configuration does not exist\" unless File.file?(full_path_to_file)\n begin\n options = YAML::load(File.open(full_path_to_file))\n rescue Error => e\n raise RuntimeError.new \"Failed to load options file (#{e.class}): #{e.message}\"\n end\n raise RuntimeError.new \"Options file '#{full_path_to_file}' from server configuration is not a YAML file\" unless options.class == Hash\n end\n # now, check for any \"old-style\" configuration parameters, and merge them\n # with any options that may have been read from an options file (above).\n # Note that values specified in an options file (read above) will override\n # the \"old-style\" options read here\n if @config.persist_mode == :cassandra\n options = { 'hosts' => @config.persist_host, 'username' => @config.persist_username,\n 'password' => @config.persist_password, 'port' => @config.persist_port,\n 'timeout' => @config.persist_timeout, 'keyspace' => @config.persist_dbname}.merge(options)\n elsif [:mongo, :postgres].include?(@config.persist_mode)\n options = { 'host' => @config.persist_host, 'username' => @config.persist_username,\n 'password' => @config.persist_password, 'port' => @config.persist_port,\n 'timeout' => @config.persist_timeout, 'dbname' => @config.persist_dbname}.merge(options)\n end\n @database.connect(options)\n end", "title": "" }, { "docid": "58550c7a69960cd868e43ba3c710507e", "score": "0.5129361", "text": "def database_config(db)\n puts \"database config called for #{db}\"\n database = YAML::load_file('config/database.yml')\n return (database[\"#{db}\"]['username'] || database[\"#{db}\"]['user']), database[\"#{db}\"]['password'], database[\"#{db}\"]['database'], database[\"#{db}\"]['host']\nend", "title": "" }, { "docid": "4ee3edae1eba601151eb85066f8abd30", "score": "0.5104168", "text": "def generate connection_strings_file\r\n File.open(connection_strings_file, 'r') do |file|\r\n users = {}\r\n db_users = {}\r\n while (line = file.gets)\r\n line.chomp\r\n pattern = 'initial catalog\\s*=\\s*([^;]+);.*?' +\r\n 'uid\\s*=\\s*([^;]+);.*?' +\r\n 'pwd\\s*=\\s*([^\";]+)'\r\n match = (/#{pattern}/i).match line\r\n if not match\r\n pattern = 'database\\s*=\\s*([^;]+);.*?' +\r\n 'uid\\s*=\\s*([^;]+);.*?' +\r\n 'pwd\\s*=\\s*([^\";]+)'\r\n match = (/#{pattern}/i).match line\r\n if not match\r\n pattern = 'initial catalog\\s*=\\s*([^;]+);.*?' +\r\n 'user id\\s*=\\s*([^;]+);.*?' +\r\n 'password\\s*=\\s*([^\";]+)'\r\n match = (/#{pattern}/i).match line\r\n if not match\r\n pattern = 'database\\s*=\\s*([^;]+);.*?' +\r\n 'user id\\s*=\\s*([^;]+);.*?' +\r\n 'password\\s*=\\s*([^\";]+)'\r\n match = (/#{pattern}/i).match line\r\n end\r\n end\r\n end\r\n if match\r\n db = match[1]\r\n uid = match[2]\r\n pwd = match[3]\r\n users[uid] = {:pwd => pwd, :dbs=>[]} unless users[uid]\r\n users[uid][:dbs] << db unless users[uid][:dbs].any? {|d| d == db}\r\n db_users[db] = [] unless db_users[db]\r\n db_users[db] << uid unless db_users[db].any? {|u| u == uid}\r\n end\r\n end\r\n puts \"USE [master]\"\r\n users.each do |user, data|\r\n puts \"CREATE LOGIN #{user} WITH PASSWORD='#{data[:pwd]}', CHECK_POLICY=OFF\"\r\n end\r\n puts\r\n db_users.each do |db, users|\r\n puts \"USE [#{db}]\" \r\n users.each do |user|\r\n puts \"EXEC sp_change_users_login 'Auto_Fix', '#{user}'\"\r\n end\r\n puts\r\n end\r\n end\r\nend", "title": "" }, { "docid": "5ebf1fcdfce808bf0aaf591ee4ab314b", "score": "0.5090706", "text": "def dyna_connect\n puts \"\\n\\n *** CONNECT ** \\n\\n\"\n # TODO Add some checking in here to make sure the given config even exists in the db.yml file.\n # Also make sure its not nil, etc. If validation fails forward to a common error page and\n # throw error.\n if ! session[:cur_company].nil?\n logger.info \"\\n>** Connecting to customer db: #{session[:cur_company].db_config} **<\\n\\n\"\n # for script_console copy this in there: ActiveRecord::Base.establish_connection('klaratee_development_default' )\n return ActiveRecord::Base.establish_connection( session[:cur_company].db_config )\n end\n \n false\n end", "title": "" }, { "docid": "7ca25cc47d9890ca7005b9a0a9e8becc", "score": "0.5072599", "text": "def remote_database_config( db )\n remote_config = capture(\"cat #{shared_path}/config/database.yml\")\n database = YAML::load( remote_config )\n return database[\"#{db}\"]['username'], database[\"#{db}\"]['password'], database[\"#{db}\"]['database'], database[\"#{db}\"]['host']\n end", "title": "" }, { "docid": "4c0b7128ee18acf39f7b9855ebead222", "score": "0.5071843", "text": "def connect\n if File.exists?(config_file)\n start_logging\n setup_connections\n else\n copy_sample_config\n Merb.logger.error! \"No database.yml file found in #{Merb.root}/config.\"\n Merb.logger.error! \"A sample file was created called database.sample.yml for you to copy and edit.\"\n exit(1)\n end\n end", "title": "" }, { "docid": "2d3114163ccee0664db96a47dbdd7803", "score": "0.5066001", "text": "def db=(config)\n self.config[:db] = config\n end", "title": "" }, { "docid": "606a39f7fffa968f46786f676686408d", "score": "0.50653005", "text": "def create_database_config_file(db = nil)\n fpath = db ? \"/multiple_dbs/#{db}_database.yml\" : \"/database.yml\"\n db ||= databases.first\n copy_file \"config_db.yml\", \"config#{fpath}\"\n\n insert_into_file \"config#{fpath}\",\n %Q{#{options.development[\"adapter\"] ? options.development[\"adapter\"] : @@default_db_config[\"adapter\"] } },\n before: \"#development_adapter\", verbose: false, force: true\n insert_into_file \"config#{fpath}\",\n %Q{#{options.development[\"encoding\"] ? options.development[\"encoding\"] : @@default_db_config[\"encoding\"] } },\n before: \"#development_encoding\", verbose: false, force: true\n insert_into_file \"config#{fpath}\",\n %Q{#{options.development[\"pool\"] ? options.development[\"pool\"] : @@default_db_config[\"pool\"] } },\n before: \"#development_pool\", verbose: false, force: true\n insert_into_file \"config#{fpath}\",\n %Q{#{db}_development },\n before: \"#development_database\", verbose: false, force: true\n insert_into_file \"config#{fpath}\",\n %Q{#{options.development[\"username\"] ? options.development[\"username\"] : @@default_db_config[\"username\"] } },\n before: \"#development_username\", verbose: false, force: true\n insert_into_file \"config#{fpath}\",\n %Q{#{options.development[\"password\"] ? options.development[\"password\"] : @@default_db_config[\"password\"] } },\n before: \"#development_psw\", verbose: false, force: true\n\n insert_into_file \"config#{fpath}\",\n %Q{#{options.production[\"adapter\"] ? options.production[\"adapter\"] : @@default_db_config[\"adapter\"] } },\n before: \"#production_adapter\", verbose: false, force: true\n insert_into_file \"config#{fpath}\",\n %Q{#{options.production[\"encoding\"] ? options.production[\"encoding\"] : @@default_db_config[\"encoding\"] } },\n before: \"#production_encoding\", verbose: false, force: true\n insert_into_file \"config#{fpath}\",\n %Q{#{options.production[\"pool\"] ? options.production[\"pool\"] : @@default_db_config[\"pool\"] } },\n before: \"#production_pool\", verbose: false, force: true\n insert_into_file \"config#{fpath}\",\n %Q{#{db}_production },\n before: \"#production_database\", verbose: false, force: true\n insert_into_file \"config#{fpath}\",\n %Q{#{options.production[\"username\"] ? options.production[\"username\"] : @@default_db_config[\"username\"] } },\n before: \"#production_username\", verbose: false, force: true\n insert_into_file \"config#{fpath}\",\n %Q{#{options.production[\"password\"] ? options.production[\"password\"] : @@default_db_config[\"password\"] } },\n before: \"#production_psw\", verbose: false, force: true\n\n insert_into_file \"config#{fpath}\",\n %Q{#{options.test[\"adapter\"] ? options.test[\"adapter\"] : @@default_db_config[\"adapter\"] } },\n before: \"#test_adapter\", verbose: false, force: true\n insert_into_file \"config#{fpath}\",\n %Q{#{options.test[\"encoding\"] ? options.test[\"encoding\"] : @@default_db_config[\"encoding\"] } },\n before: \"#test_encoding\", verbose: false, force: true\n insert_into_file \"config#{fpath}\",\n %Q{#{options.test[\"pool\"] ? options.test[\"pool\"] : @@default_db_config[\"pool\"] } },\n before: \"#test_pool\", verbose: false, force: true\n insert_into_file \"config#{fpath}\",\n %Q{#{db}_test },\n before: \"#test_database\", verbose: false, force: true\n insert_into_file \"config#{fpath}\",\n %Q{#{options.test[\"username\"] ? options.test[\"username\"] : @@default_db_config[\"username\"] } },\n before: \"#test_username\", verbose: false, force: true\n insert_into_file \"config#{fpath}\",\n %Q{#{options.test[\"password\"] ? options.test[\"password\"] : @@default_db_config[\"password\"] } },\n before: \"#test_psw\", verbose: false, force: true\n end", "title": "" }, { "docid": "d5f09854e0c2f87ed518ac169b73fd3e", "score": "0.505799", "text": "def read_config\n db_config = YAML.load_file('config/database.yml.production')\n set :db_user, db_config[rails_env][\"username\"]\n set :db_password, db_config[rails_env][\"password\"] \n set :db_name, db_config[rails_env][\"database\"]\nend", "title": "" }, { "docid": "d5f09854e0c2f87ed518ac169b73fd3e", "score": "0.505799", "text": "def read_config\n db_config = YAML.load_file('config/database.yml.production')\n set :db_user, db_config[rails_env][\"username\"]\n set :db_password, db_config[rails_env][\"password\"] \n set :db_name, db_config[rails_env][\"database\"]\nend", "title": "" }, { "docid": "191df56a29c7f68ee910146a774fb3c7", "score": "0.50514144", "text": "def calculate_dbhost\n owncloud_cookbook_config['dbhost'] =\n [\n owncloud_cookbook_config['dbhost'], owncloud_cookbook_config['dbport']\n ].join(':')\n end", "title": "" }, { "docid": "772907954560fb94dfbf57c51f713d0e", "score": "0.5040173", "text": "def process_config\n begin\n @version, @uri = LibertyBuildpack::Repository::ConfiguredItem.find_item(@configuration)\n rescue => e\n @logger.error(\"Unable to process the configuration for the Dynatrace Appmon Agent framework. #{e.message}\")\n end\n\n @version.nil? ? nil : \"dynatrace-appmon-agent-#{@version}\"\n end", "title": "" }, { "docid": "b64cf484f297b4f2ffb036e56a522468", "score": "0.5034227", "text": "def database_config(db)\n database = YAML::load_file('config/database.yml')\n return database[\"#{db}\"]['username'], database[\"#{db}\"]['password'], database[\"#{db}\"]['database'], database[\"#{db}\"]['host']\n end", "title": "" }, { "docid": "9911009c138bef6287da59017d3f739b", "score": "0.5029001", "text": "def load_config_from_database\n @params.each do |p|\n p['value_db'] = @bot_dbaccess.read_parameter_with_default(p['name'], p['default'])\n end\n end", "title": "" }, { "docid": "9911009c138bef6287da59017d3f739b", "score": "0.5029001", "text": "def load_config_from_database\n @params.each do |p|\n p['value_db'] = @bot_dbaccess.read_parameter_with_default(p['name'], p['default'])\n end\n end", "title": "" }, { "docid": "736e306f82335cefdbaaf36efd23211a", "score": "0.5026753", "text": "def initialize(db)\n @db = db\n @options = {\n symbolize_keys: true,\n cast_booleans: true\n }\n\n db.opts.each do |key, value|\n case (key)\n when :database, :username, :password, :host, :port, :socket, :encoding, :charset, :compress, :timeout\n @options[key] = value\n when :user\n @options[:username] = value\n when :loggers\n if (value and !value.empty?)\n @options[:logging] = true\n @options[:logger] = value.first\n end\n end\n end\n \n @query_queue = [ ]\n\n @connections = { }\n @connection_pool = [ ]\n @connections_active = { }\n \n @connection_limit = db.opts[:connections] || self.class.size\n \n if (EventMachine.reactor_running? and self.class.trace?)\n EventMachine::PeriodicTimer.new(1) do\n dump_file = \"#{self.class.trace}.#{@options[:database]}\"\n \n File.open(dump_file, 'w') do |f|\n f.puts @options[:database]\n\n @connections.each do |c, x|\n next unless (x)\n \n f.puts \"\\t#{c.inspect} -> #{x.inspect}\"\n end\n @connection_pool.each do |c|\n f.puts \"\\t#{c.inspect} (pool)\"\n end\n \n @query_queue.each do |query, callback|\n f.puts \"\\t#{query}\"\n end\n end\n end\n end\n end", "title": "" }, { "docid": "d5c7a9af57407a35e67fc194f52852b0", "score": "0.5022634", "text": "def initialize()\n # calling base constructor\n super()\n\n # trying to connect to database\n begin\n # setting the db configuration file path\n db_config_file_path = \"#{File.dirname(__FILE__)}/db/database.yml\"\n\n # creating a pointer to the file content\n f_db_config = File.open(db_config_file_path, 'r')\n\n # loading the db configuration from the YAML file\n @db_config = YAML.load(f_db_config)\n\n ## setting a global path for the database (only for the sqlite3 database)\n #@db_config[DB_TYPE]['database'] = \"#{File.dirname(__FILE__)}/db/#{@db_config[DB_TYPE]['database']}\"\n\n # actually establishing connection to database through active_record\n @db_conn = ActiveRecord::Base.establish_connection(@db_config[DB_TYPE])\n rescue Exception => e\n # building the error message\n msg = \"Failed to connect to database. Original error message:\\r\\n'#{e.message}'\"\n\n # writing message in console\n puts msg\n\n # raising the exception again\n raise e\n end\n end", "title": "" }, { "docid": "9d8f9f0a127ec8c6c4935b8a91a639c8", "score": "0.5009825", "text": "def setup\n config = self.config\n host = config['app']['host']\n port = config['app']['port']\n @url_base = \"http://#{host}:#{port}\"\n\n # Extract test pcaps and indexes\n FileUtils.rm_rf '/tmp/pcapr_local_test'\n test_tar = File.join(File.expand_path(File.dirname(__FILE__)), 'test.tgz')\n if File.exist? test_tar\n puts `tar -C /tmp/ -xzf #{test_tar}`\n end\n\n # Recreate test database.\n begin\n couch = config['couch']\n RestClient.delete \"#{couch['uri']}/#{couch['database']}\"\n rescue RestClient::ResourceNotFound\n end\n db = PcaprLocal.get_db config\n\n # And restore it from datafile.\n if self.datafile\n load_docs self.datafile, db\n end\n\n # Start server.\n config_file = Tempfile.new \"config\"\n config_file.print config.to_json\n config_file.flush\n @pid = fork do \n Process.setpgid $$, $$\n exec \"#{PcaprLocal::ROOT}/bin/startpcapr -f #{config_file.path} -d\" \n end\n\n # And wait for it to be ready.\n wait_for_server host, port\n end", "title": "" }, { "docid": "22eb9610fb5e7180f555d50896f11cc1", "score": "0.49970993", "text": "def initialize_database\n config = YAML::load(IO.read(Antfarm::Helpers.defaults_file))\n # Database setup based on adapter specified\n if config && config[ANTFARM_ENV] && config[ANTFARM_ENV].has_key?('adapter')\n if config[ANTFARM_ENV]['adapter'] == 'sqlite3'\n config[ANTFARM_ENV]['database'] = Antfarm::Helpers.db_file(ANTFARM_ENV)\n elsif config[ANTFARM_ENV]['adapter'] == 'postgres'\n config[ANTFARM_ENV]['database'] = ANTFARM_ENV\n else\n # If adapter specified isn't one of sqlite3 or postgresql,\n # default to SQLite3 database configuration.\n config = nil\n end\n else\n # If the current environment configuration doesn't specify a\n # database adapter, default to SQLite3 database configuration.\n config = nil\n end\n # Default to SQLite3 database configuration\n config ||= { ANTFARM_ENV => { 'adapter' => 'sqlite3', 'database' => Antfarm::Helpers.db_file(ANTFARM_ENV) } }\n if config[ANTFARM_ENV]['adapter'] == 'postgres'\n DataMapper.setup(:default, \"postgres:///#{config[ANTFARM_ENV]['database']}\")\n else\n DataMapper.setup(:default, \"sqlite3://#{config[ANTFARM_ENV]['database']}\")\n end\n end", "title": "" }, { "docid": "4545f1f8180150299951efc06e598357", "score": "0.49797183", "text": "def database_config( db )\n database = local_database_config_hash\n return database[\"#{db}\"]['username'], database[\"#{db}\"]['password'], database[\"#{db}\"]['database'], database[\"#{db}\"]['host']\n end", "title": "" }, { "docid": "91d36fe62e48bcd327821f0befadf062", "score": "0.49781734", "text": "def database_config\n unless defined?(@db_config) && @db_config\n @db_config = Configuration.load_yaml_config(\n Configuration.base_path, 'database.yml')\n end\n\n @db_config\n end", "title": "" }, { "docid": "83f45c09530f8a12569b5fbd72cba56a", "score": "0.497712", "text": "def create_database_yml\n return unless File.directory?(\"/app/#{ENV['app_dir']}/config\")\n topic \"Writing config/database.yml to read from DATABASE_URL\"\n File.open(\"/app/#{ENV['app_dir']}/config/database.yml\", \"w\") do |file|\n file.puts <<-DATABASE_YML\n<%\n\nrequire 'cgi'\nrequire 'uri'\n\nbegin\nuri = URI.parse(ENV[\"DATABASE_URL\"])\nrescue URI::InvalidURIError\nraise \"Invalid DATABASE_URL\"\nend\n\nraise \"No RACK_ENV or RAILS_ENV found\" unless ENV[\"RAILS_ENV\"] || ENV[\"RACK_ENV\"]\n\ndef attribute(name, value, force_string = false)\nif value\nvalue_string =\nif force_string\n '\"' + value + '\"'\nelse\n value\nend\n\"\\#{name}: \\#{value_string}\"\nelse\n\"\"\nend\nend\n\nadapter = uri.scheme\nadapter = \"postgresql\" if adapter == \"postgres\"\n\ndatabase = (uri.path || \"\").split(\"/\")[1]\n\nusername = uri.user\npassword = uri.password\n\nhost = uri.host\nport = uri.port\n\nparams = CGI.parse(uri.query || \"\")\n\n%>\n\ntest:\n<%= attribute \"adapter\", adapter %>\n<%= attribute \"database\", database %>\n<%= attribute \"username\", username %>\n<%= attribute \"password\", password, true %>\n<%= attribute \"host\", host %>\n<%= attribute \"port\", port %>\n\n<% params.each do |key, value| %>\n<%= key %>: <%= value.first %>\n<% end %>\n DATABASE_YML\n end\nend", "title": "" }, { "docid": "89a44d777fc35ea72323196fc31af2d8", "score": "0.49759743", "text": "def configure(creep_configuration)\n @creep_cfg = creep_configuration\n @host = @creep_cfg['host']\n @user = @creep_cfg['user']\n @password = @creep_cfg['password']\n @name = @creep_cfg['name']\n @connection_pool = @config.get_connection_class.new(self)\n end", "title": "" }, { "docid": "5c9a6cf67276c4f15f7bf4610d8865f5", "score": "0.49696738", "text": "def get_system_config(config)\n\n config = YAML.load_file(config_file)\n\n #Config details.\n @host = config[\"database\"][\"host\"]\n @port = config[\"database\"][\"port\"]\n\n @user_name = config[\"database\"][\"user_name\"]\n @password_encoded = config[\"database\"][\"password_encoded\"]\n\n if @password_encoded.nil? then #User is passing in plain-text password...\n @password = config[\"database\"][\"password\"]\n @password_encoded = Base64.encode64(@password)\n end\n\n @database = config[\"database\"][\"schema\"]\n end", "title": "" }, { "docid": "c76cd9f9f12b6188b65276ac326d4695", "score": "0.49563313", "text": "def config\n Puppet::Util::Puppetdb.config\n end", "title": "" }, { "docid": "4d073df8040fc68a39a83577929478b5", "score": "0.49492678", "text": "def initialize\n super\n\n @component_name = @component_name.snakecase\n @component_type = Automation::Component::DatabaseType\n @connected = false\n\n # Database details from the configuration.\n @database_id = @config_manager[\"database.#{@component_name}.database_id\"]\n @adapter = db_config('adapter', default: false)\n raise ConfigurationError.new(\"No adapter defined for database '#{@component_name}.#{@database_id}'\") unless @adapter\n # Get the adapter specific connection specification and establish the connection on all required models.\n @connection_config = db_connection_config\n end", "title": "" }, { "docid": "872ed323b13072e85f8f7ad0aa29531b", "score": "0.49422085", "text": "def database_configuration; end", "title": "" }, { "docid": "872ed323b13072e85f8f7ad0aa29531b", "score": "0.49422085", "text": "def database_configuration; end", "title": "" }, { "docid": "50e29bd30d7d846dcadb549a336561f8", "score": "0.49410555", "text": "def parse\n parse_command\n load_config\n finalize_setup\n end", "title": "" }, { "docid": "777bdb0abec3ce9066761e1e44a91618", "score": "0.49366733", "text": "def connect(db_config)\n if db_config.instance_of?(Hash)\n sym = db_config.transform_keys(& :to_sym )\n db_config = Struct.new(*(k = sym.keys)).new(*sym.values_at(*k))\n end\n\n begin\n @my = Mysql.new(db_config.host, db_config.dbuser, db_config.key, db_config.db )\n rescue StandardError => e\n @my = nil\n raise e\n end\n raise Mysql::Error, 'Not Connected' if @my.nil?\n\n # @@my.reconnect = true\n if block_given?\n yield\n return close\n end\n return @my\n end", "title": "" }, { "docid": "67646d283719bd40d9d39034d152023f", "score": "0.49205163", "text": "def connect_to_database\n config = Rails.configuration.database_configuration\n host = config[Rails.env][\"host\"]\n dbname = config[Rails.env][\"database\"]\n username = config[Rails.env][\"username\"]\n password = config[Rails.env][\"password\"]\n \n client = Mysql2::Client.new(:host => host, :username => username, :password => password, :flags => Mysql2::Client::MULTI_STATEMENTS)\n \n if client.query(\"SHOW DATABASES LIKE '#{dbname}'\").count == 0\n print \"Database '#{dbname}' not found, creating...\"\n client.query(\"CREATE DATABASE #{dbname}\")\n print \"\\n\" + File.open(SETUP_FILE,\"r\").read\n client.select_db(dbname)\n client.query(File.open(SETUP_FILE,\"r\").read)\n end\n \n finalClient = Mysql2::Client.new(:host => host, :username => username, :password => password, :database => dbname)\n \n return finalClient\n \n end", "title": "" }, { "docid": "535b778378abdeae83a5de4115968121", "score": "0.49171233", "text": "def configureProducts(iConfigureProducts)\n # Bypass the configuration file reader to force our configuration\n $WEACESlaveConfig = getComponentConfigInfo('SlaveClient')\n if ($WEACESlaveConfig == nil)\n $WEACESlaveConfig = {:WEACESlaveAdapters => []}\n end\n self.class.module_eval(\"\n alias :getComponentConfigInfo_ORG :getComponentConfigInfo\n\n def getComponentConfigInfo_NEW(iComponent)\n if (iComponent == 'SlaveClient')\n return $WEACESlaveConfig\n else\n return getComponentConfigInfo_ORG(iComponent)\n end\n end\n\n alias :getComponentConfigInfo :getComponentConfigInfo_NEW\n \")\n iConfigureProducts.each do |iProductInfo|\n iProductID, iToolID, iProductConfig = iProductInfo\n $WEACESlaveConfig[:WEACESlaveAdapters] << iProductConfig.merge(\n {\n :Product => iProductID,\n :Tool => iToolID\n }\n )\n end\n end", "title": "" }, { "docid": "bacf646f79af5709fd369289058f9131", "score": "0.4915032", "text": "def initialize(options)\n raise 'Missing config username on output.mysql' unless options.key? :username\n raise 'Missing config database on output.mysql' unless options.key? :database\n raise 'Missing config table on output.mysql' unless options.key? :table\n conf = DEFAULT_MYSQL.merge options\n @table = conf.delete :table\n conf[:port] = conf[:port].to_i\n conf[:password] = conf[:password].to_s\n @encoding = conf[:encoding]\n conf[:ssl_mode] = :disabled if conf[:ssl_mode] != :enabled\n @mysql = Mysql2::Client.new conf\n @mysql_conf = conf\n create_table_if_not_exists\n @sqls = Hash.new { |hash, key| hash[key] = generate_batch_sql key }\n end", "title": "" }, { "docid": "a7cd20964e10b47509b4c32ef4772cce", "score": "0.49033907", "text": "def setup_connection(conn)\n conn = super(conn)\n statement(conn) do |stmt|\n connection_configuration_sqls.each{|sql| log_yield(sql){stmt.execute(sql)}}\n end\n conn\n end", "title": "" }, { "docid": "6b26296fdd82f6236bee86a8323c4b24", "score": "0.49026203", "text": "def connect(db_config)\n if db_config.instance_of?(Hash)\n sym = db_config.transform_keys(& :to_sym )\n db_config = Struct.new(*(k = sym.keys)).new(*sym.values_at(*k))\n end\n\n begin\n @my = Mysql2::Client.new( host: db_config.host,\n database: db_config.db,\n username: db_config.dbuser,\n password: db_config.key,\n socket: db_config.respond_to?(:socket) ? db_config.socket : nil,\n port: db_config.respond_to?(:port) ? db_config.port : nil,\n flags: 'SESSION_TRACK',\n init_command: 'SET @@SESSION.session_track_schema=ON'\n )\n rescue StandardError => e\n @my = nil\n raise e\n end\n raise Mysql2::Error, 2002 if @my.nil?\n\n # @@my.reconnect = true\n if block_given?\n yield\n return close\n end\n return @my\n end", "title": "" }, { "docid": "938e5b10982c7f846771f8383f4c98a1", "score": "0.4900255", "text": "def connect\n config = @connection_options\n @connection = case config[:mode]\n when :dblib\n appname = config[:appname] || configure_application_name || Rails.application.class.name.split('::').first rescue nil\n login_timeout = config[:login_timeout].present? ? config[:login_timeout].to_i : nil\n timeout = config[:timeout].present? ? config[:timeout].to_i/1000 : nil\n encoding = config[:encoding].present? ? config[:encoding] : nil\n TinyTds::Client.new({\n :dataserver => config[:dataserver],\n :host => config[:host],\n :port => config[:port],\n :username => config[:username],\n :password => config[:password],\n :database => config[:database],\n :appname => appname,\n :login_timeout => login_timeout,\n :timeout => timeout,\n :encoding => encoding,\n :azure => config[:azure]\n }).tap do |client|\n if config[:azure]\n client.execute(\"SET ANSI_NULLS ON\").do\n client.execute(\"SET CURSOR_CLOSE_ON_COMMIT OFF\").do\n client.execute(\"SET ANSI_NULL_DFLT_ON ON\").do\n client.execute(\"SET IMPLICIT_TRANSACTIONS OFF\").do\n client.execute(\"SET ANSI_PADDING ON\").do\n client.execute(\"SET QUOTED_IDENTIFIER ON\")\n client.execute(\"SET ANSI_WARNINGS ON\").do\n else\n client.execute(\"SET ANSI_DEFAULTS ON\").do\n client.execute(\"SET CURSOR_CLOSE_ON_COMMIT OFF\").do\n client.execute(\"SET IMPLICIT_TRANSACTIONS OFF\").do\n end\n client.execute(\"SET TEXTSIZE 2147483647\").do\n end\n when :odbc\n if config[:dsn].include?(';')\n driver = ODBC::Driver.new.tap do |d|\n d.name = config[:dsn_name] || 'Driver1'\n d.attrs = config[:dsn].split(';').map{ |atr| atr.split('=') }.reject{ |kv| kv.size != 2 }.inject({}){ |h,kv| k,v = kv ; h[k] = v ; h }\n end\n ODBC::Database.new.drvconnect(driver)\n else\n ODBC.connect config[:dsn], config[:username], config[:password]\n end.tap do |c|\n begin\n c.use_time = true\n c.use_utc = ActiveRecord::Base.default_timezone == :utc\n rescue Exception => e\n warn \"Ruby ODBC v0.99992 or higher is required.\"\n end\n end\n end\n @spid = _raw_select('SELECT @@SPID', fetch: :rows).first.first\n configure_connection\n rescue\n raise unless @auto_connecting\n end", "title": "" }, { "docid": "6704d45db31cd8a2f85db58563637667", "score": "0.48873025", "text": "def post_init\n $connection_list << self\n @my_connection_index = $connection_list.length\n puts \"Connection Initialized #{@my_connection_index}) #{@my_address} - #{@signature}\"\n #\n # TODO: get access to the HostIP and HostPort associated with this connection\n # if it is the local control connection, do the following\n # * do not repeat other connection traffic to this connection\n # * consider any input a command to be processed\n end", "title": "" }, { "docid": "da4127df1d7735d5c372c6f2513f9c28", "score": "0.4870252", "text": "def init\n # Validate and parse the flags\n OptionParser.new do |o|\n o.on('-D NAME', '--db-name NAME') { |n| $DB_NAME = n }\n o.on('-U USER', '--db-user USER') { |u| $DB_USER = u }\n o.on('-P PASSWORD', '--db-password PASSWORD') { |p| $DB_PASSWORD = p }\n o.on('-u TABLE', '--user-table TABLE') { |t| $DB_ACC_TABLE = t }\n o.on('-t TABLE', '--domain-table TABLE') { |t| $DB_DOM_TABLE = t }\n o.on('-a TABLE', '--alias-table TABLE') { |t| $DB_VIRT_TABLE = t }\n o.on('-i ID', '--default-id ID') { |i| $DEFAULT_ID = i }\n o.on('-d DIR', '--dir DIR') { |d| $install_dir = d }\n o.on('-E', '--keep-ext') { |b| $keep_extensions = b }\n o.on('-F', '--force-install') { |b| $force_install = b }\n o.on('-c', '--just-config') { |b| $just_gen_conf = b; }\n o.on('-r', '--install-requirements') { |b| $install_req = b; }\n o.on('-n', '--no-config') { |b| $dont_gen_conf = true } # b assingment didn't work!? (b was false)\n o.on('-s', '--simulate') { |b| $simulate = b }\n o.on('-h', '--help') { usage }\n o.parse!\n end\n\n # We can't do anything if we should both skip the config file and just generate the config file\n if $just_gen_conf and $dont_gen_conf\n puts \"Conflicting flags: -n/--no-config and -c/--just-config\".red\n puts \"Since we can't both generate just the config and skip the generation of it, the script will now quit!\".red\n exit(65)\n end\n\n puts \"RUNNING IN SIMULATION MODE!\".pink if $simulate\n\n # If this isn't a simulation ...\n unless $simulate\n # ... check if the script is running as root, if it isn't: warn the user!\n puts \"WARNING!!!\\nThis script should be run with root privileges!\\n\".pink unless is_root?\n end\n\n # Add a / to the end of the install path if it's missing\n $install_dir << '/' unless $install_dir[-1,1] == '/'\n\n # Add quotes if the ID is a name\n $DEFAULT_ID = \"'#{$DEFAULT_ID}'\" unless is_numeric? $DEFAULT_ID\nend", "title": "" }, { "docid": "be1cf394698895a8eeae6acb65683885", "score": "0.48646498", "text": "def database=(*args) \n if args.first.is_a?(Array)\n reset_db = true\n url = args.first[0]\n context = args.first[1] || dm_setup_context || :default\n else\n url = args.first\n context = dm_setup_context || :default\n end\n set :dm_setup_context, context\n set :dm_database_url, url\n db_type = dm_database_url.split('://').first\n db_url = dm_database_url.sub(::APP_ROOT, '').sub(\"#{db_type}://\",'')\n puts \"-- - activated DataMapper #{db_type.capitalize} Database at [ #{db_url} ]\"\n database_reset if reset_db\n database_logger\n database\n end", "title": "" }, { "docid": "7f402fca92d3225004245bfb213e8f3a", "score": "0.4860697", "text": "def prepare_env(load_stage = stage)\n \n load_stage = load_stage.to_s\n \n if !db_config \n Wpcap::Utility.error(\"No Database Configurations Found\")\n abort \n end\n \n if remote_config(:db_priv_pass).nil?\n Wpcap::Utility.error \"This no privileged user for this server found in servers ssh environment profile (did you set it up with wpcap?)\" \n abort\n end\n \n set(:local_dump) { \"/tmp/#{application}.sql.bz2\" }\n \n if db_config[load_stage]\n \n set(:db_priv_user) { remote_config(:db_priv_user).nil? ? db_config[load_stage][\"username\"] : remote_config(:db_priv_user) }\n set(:db_priv_pass) { remote_config(:db_priv_pass).nil? ? db_config[load_stage][\"password\"] : remote_config(:db_priv_pass) }\n set(:db_host) { db_config[load_stage][\"host\"] }\n set(:db_database) { db_config[load_stage][\"database\"] }\n set(:db_username) { db_config[load_stage][\"username\"] }\n set(:db_password) { db_config[load_stage][\"password\"] }\n set(:db_encoding) { db_config[load_stage][\"encoding\"] }\n set(:db_prefix) { db_config[load_stage][\"prefix\"] } \n \n else\n\n set :db_priv_user , remote_config(:db_priv_user) \n set :db_priv_pass , remote_config(:db_priv_pass) \n set :db_username , \"#{application.split(\".\").first}_#{stage}\"\n set :db_database , \"#{application.split(\".\").first}_#{stage}\"\n set :db_password , random_password(16)\n set :db_prefix , \"wp_\" || db_config[\"development\"][\"prefix\"]\n \n run \"mkdir -p #{shared_path}/config\"\n template \"mysql.yml.erb\", \"#{shared_path}/config/database.yml\"\n server_yaml = capture \"cat #{shared_path}/config/database.yml\"\n server_mysql_config_yaml = YAML.load(server_yaml)\n update_db_config(server_mysql_config_yaml)\n db_config(true)\n end\n \n end", "title": "" }, { "docid": "139ed68cad7d96bd9eb705c3727b48df", "score": "0.4857015", "text": "def setup( opts = {} )\n\n @db.disconnect if @db\n\n log = RJack::SLF4J[ \"iudex.da.sequel\" ]\n conf = CONFIG.merge( opts )\n conf = Hooker.merge( [ :iudex, :connect_props ], conf )\n\n conf[ :loggers ] = [ log ] if conf[ :log ]\n\n cstr = ( \"%s://%s/%s?%s\" %\n [ conf[ :adapter ],\n [ conf[ :host ], conf[ :port ] ].compact.join( ':' ),\n conf[ :database ],\n params( conf ) ] )\n\n log.info { \"Connecting: #{cstr}\" }\n log.debug { \"Full Params: #{ conf.inspect }\" }\n\n @db = Sequel.connect( cstr, conf )\n\n end", "title": "" }, { "docid": "76b165d902452d302747bfd0eaa8d0ac", "score": "0.48497224", "text": "def configure\n @environment = facts.fetch(\"chef_environment\"){\"development\"}.downcase\n @fqdn = facts.fetch(\"fqdn\"){\"\"}\n @app_names = facts.fetch(\"trebuchet\"){[]}\n end", "title": "" }, { "docid": "4720f7246c5e3937ca8e9208c068ed67", "score": "0.48461843", "text": "def option_results_database\n block = proc { |database| save_option_value('database.id', database); propagate_option('--database', database) }\n @cl_parser.on('--database ID', 'Specify the id of the databases to use.',\n 'If skipped, the default specified for the mode is used.', &block)\n\n block = proc { |database| save_option_value('database.results_database.database_id', database); propagate_option('--results-database', database) }\n @cl_parser.on('--results-database ID', 'Specify the id of the database to use.',\n 'If skipped, the default specified for the mode is used.', &block)\n end", "title": "" }, { "docid": "5034c2b9639fa0f5ea9ede9ca1fe067f", "score": "0.48416895", "text": "def config\n config = PcaprLocal::Config.config\n config['couch']['database'] = \"#{config['couch']['database']}_test\"\n config['install_dir'] = \"/tmp/pcapr_local_test\"\n config['pcap_dir'] = \"/tmp/pcapr_local_test/pcaps\"\n config['index_dir'] = \"/tmp/pcapr_local_test/indexes\"\n config['app']['port'] = config['app']['port'].to_i + 1\n config\n end", "title": "" }, { "docid": "5034c2b9639fa0f5ea9ede9ca1fe067f", "score": "0.48416895", "text": "def config\n config = PcaprLocal::Config.config\n config['couch']['database'] = \"#{config['couch']['database']}_test\"\n config['install_dir'] = \"/tmp/pcapr_local_test\"\n config['pcap_dir'] = \"/tmp/pcapr_local_test/pcaps\"\n config['index_dir'] = \"/tmp/pcapr_local_test/indexes\"\n config['app']['port'] = config['app']['port'].to_i + 1\n config\n end", "title": "" }, { "docid": "60b4b80e0a8bada5b6ce956d8319bc98", "score": "0.48035598", "text": "def process_config\n begin\n @version, @uri = supports_apitoken? ? agent_download_url : LibertyBuildpack::Repository::ConfiguredItem.find_item(@configuration)\n rescue => e\n @logger.error(\"Unable to process the configuration for the Dynatrace OneAgent framework. #{e.message}\")\n end\n\n @version.nil? ? nil : \"dynatrace-one-agent-#{@version}\"\n end", "title": "" }, { "docid": "ffac29b75f60bae5b1c9412d9ba6d4e8", "score": "0.48015472", "text": "def load_configuration\n config = options[\"config\"]\n return unless config\n\n Mihari.load_config_from_yaml config\n Database.connect\n end", "title": "" }, { "docid": "33cf83088dfd7e0c2ab478f595e7ff5d", "score": "0.47927967", "text": "def setup\r\n @db = Mongo::Connection.new(\"ds029287.mongolab.com\", 29287).db(DB_NAME)\r\n\r\n is_authenticated = @db.authenticate(DB_NAME, DB_NAME)\r\n if is_authenticated\r\n @lm = LastMinute::Storage::MongoDB.new(@db, DB_COL_NAME, DB_NAME)\r\n conf_file = File.join(File.dirname(__FILE__), 'env.yml')\r\n if File.exist?(conf_file)\r\n env = YAML.load_file(File.join(File.dirname(__FILE__), 'env.yml'))\r\n env['database'].each_pair do |key, val|\r\n case key\r\n when 'host'\r\n puts \"Host is going to be: #{val}\"\r\n when 'port'\r\n puts \"Port is going to be: #{val}\"\r\n when 'db'\r\n puts \"Database we're going to use is: #{val}\"\r\n when 'username'\r\n puts \"Username is #{val}\"\r\n else\r\n # type code here\r\n end\r\n end unless env == nil\r\n end\r\n\r\n @napsu_scraper = DeturScraper.new(\"http://www.detur.fi/themes/detur/LastMinutedetail.aspx\")\r\n\r\n end\r\n end", "title": "" }, { "docid": "4ee39325fc3e50253239722192a465c8", "score": "0.47922626", "text": "def initialize()\n @config = YAML.load_file('config.yaml')\n @puppetdb = @config['puppetdb']\n @servicenow = @config['servicenoe']\n @syslog = @config['syslog']\n end", "title": "" }, { "docid": "6e9c962fdc45c1d8ef8fd804b760671c", "score": "0.47823685", "text": "def populate_cc_user_data(options)\n install_locale = options['q_struct']['locale'].value\n if install_locale.match(/\\./)\n install_locale = install_locale.split(\".\")[0]\n end\n if options['livecd'] == true\n install_target = \"/target\"\n else\n install_target = \"\"\n end\n install_nameserver = options['q_struct']['nameserver'].value\n install_base_url = \"http://\"+options['hostip']+\"/\"+options['name']\n install_layout = install_locale.split(\"_\")[0]\n install_variant = install_locale.split(\"_\")[1].downcase\n install_gateway = options['q_struct']['gateway'].value\n admin_shell = options['q_struct']['admin_shell'].value\n admin_sudo = options['q_struct']['admin_sudo'].value\n disable_dhcp = options['q_struct']['disable_dhcp'].value\n install_name = options['q_struct']['hostname'].value\n resolved_conf = \"/etc/systemd/resolved.conf\"\n admin_user = options['q_struct']['admin_username'].value\n admin_group = options['q_struct']['admin_username'].value\n admin_home = \"/home/\"+options['q_struct']['admin_username'].value\n admin_crypt = options['q_struct']['admin_crypt'].value\n install_nic = options['q_struct']['interface'].value\n if disable_dhcp.match(/true/)\n install_ip = options['q_struct']['ip'].value\n end\n install_cidr = options['q_struct']['cidr'].value\n install_disk = options['q_struct']['partition_disk'].value\n if install_disk.match(/\\//)\n install_disk = install_disk.split(/\\//)[-1]\n end\n #netplan_file = \"#{install_target}/etc/netplan/01-netcfg.yaml\"\n netplan_file = \"#{install_target}/etc/netplan/50-cloud-init.yaml\"\n locale_file = \"#{install_target}/etc/default/locales\"\n grub_file = \"#{install_target}/etc/default/grub\"\n ssh_dir = \"#{install_target}/home/#{admin_user}/.ssh\"\n auth_file = \"#{ssh_dir}/authorized_keys\"\n sudo_file = \"#{install_target}/etc/sudoers.d/#{admin_user}\"\n if options['vmnetwork'].to_s.match(/hostonly/)\n ks_ip = options['hostonlyip']\n else\n if disable_dhcp.match(/false/)\n ks_ip = options['hostonlyip']\n else\n ks_ip = options['hostip']\n end\n end\n if disable_dhcp.match(/false/)\n install_dhcp = \"yes\"\n else\n install_dhcp = \"no\"\n end\n if options['copykeys'] == true\n ssh_keyfile = options['sshkeyfile']\n if File.exist?(ssh_keyfile)\n ssh_key = %x[cat #{ssh_keyfile}].chomp\n ssh_dir = \"#{install_target}/home/\"+admin_user+\"/.ssh\"\n end\n end\n ks_port = options['httpport']\n user_data = []\n exec_data = []\n user_data.push(\"#cloud-config\")\n if !options['vm'].to_s.match(/mp|multipass/)\n in_target = \"curtin in-target --target=/target -- \"\n user_data.push(\"autoinstall:\")\n user_data.push(\" version: 1\")\n user_data.push(\" apt:\")\n user_data.push(\" geoip: true\")\n user_data.push(\" preserve_sources_list: false\")\n user_data.push(\" primary:\")\n if options['arch'].to_s.match(/arm/)\n user_data.push(\" - arches: [arm64, arm]\")\n else\n user_data.push(\" - arches: [amd64, i386]\")\n end\n user_data.push(\" uri: http://archive.ubuntu.com/ubuntu\")\n user_data.push(\" - arches: [default]\")\n user_data.push(\" uri: http://ports.ubuntu.com/ubuntu-ports\")\n user_data.push(\" identity:\")\n user_data.push(\" hostname: #{install_name}\")\n user_data.push(\" password: #{admin_crypt}\")\n user_data.push(\" realname: #{admin_user}\")\n user_data.push(\" username: #{admin_user}\")\n user_data.push(\" keyboard:\")\n user_data.push(\" layout: #{install_layout}\")\n user_data.push(\" variant: #{install_variant}\")\n user_data.push(\" locale: #{install_locale}.UTF-8\")\n user_data.push(\" network:\")\n user_data.push(\" network:\")\n user_data.push(\" version: 2\")\n user_data.push(\" ethernets:\")\n user_data.push(\" #{install_nic}:\")\n user_data.push(\" dhcp4: #{install_dhcp}\")\n user_data.push(\" ssh:\")\n user_data.push(\" install-server: true\")\n user_data.push(\" allow-pw: true\")\n user_data.push(\" storage:\")\n user_data.push(\" config:\")\n user_data.push(\" - grub_device: true\")\n user_data.push(\" id: disk-#{install_disk}\")\n user_data.push(\" path: /dev/#{install_disk}\")\n user_data.push(\" ptable: gpt\")\n user_data.push(\" type: disk\")\n user_data.push(\" wipe: superblock-recursive\")\n user_data.push(\" - device: disk-#{install_disk}\")\n user_data.push(\" flag: bios_grub\")\n user_data.push(\" id: partition-0\")\n user_data.push(\" number: 1\")\n user_data.push(\" size: 1048576\")\n user_data.push(\" type: partition\")\n user_data.push(\" - device: disk-#{install_disk}\")\n user_data.push(\" id: partition-1\")\n user_data.push(\" number: 2\")\n user_data.push(\" size: -1\")\n user_data.push(\" type: partition\")\n user_data.push(\" wipe: superblock\")\n user_data.push(\" - name: root_vg\")\n user_data.push(\" devices: [partition-1]\")\n user_data.push(\" preserve: false\")\n user_data.push(\" type: lvm_volgroup\")\n user_data.push(\" id: lvm_volgroup-0\")\n user_data.push(\" - name: root_lv\")\n user_data.push(\" volgroup: lvm_volgroup-0\")\n user_data.push(\" size: -1\")\n user_data.push(\" wipe: superblock\")\n user_data.push(\" preserve: false\")\n user_data.push(\" type: lvm_partition\")\n user_data.push(\" id: lvm_partition-0\")\n user_data.push(\" - fstype: ext4\")\n user_data.push(\" id: format-0\")\n user_data.push(\" type: format\")\n user_data.push(\" volume: lvm_partition-0\")\n user_data.push(\" - device: format-0\")\n user_data.push(\" id: mount-0\")\n user_data.push(\" path: /\")\n user_data.push(\" type: mount\")\n user_data.push(\" updates: security\")\n user_data.push(\" user-data:\")\n user_data.push(\" disable-root: false\")\n if disable_dhcp.match(/true/)\n exec_data.push(\"ip addr add #{install_ip}/#{install_cidr} dev #{install_nic}\")\n end\n exec_data.push(\"ip link set #{install_nic} up\")\n exec_data.push(\"ip route add default via #{install_gateway}\")\n exec_data.push(\"echo 'DNS=#{install_nameserver}' >> #{resolved_conf}\")\n exec_data.push(\"systemctl restart systemd-resolved\")\n else\n in_target = \"\"\n if options['method'].to_s.match(/ci/)\n user_data.push(\"hostname: #{install_name}\")\n user_data.push(\"groups:\")\n user_data.push(\" - #{admin_user}: #{admin_group}\")\n user_data.push(\"users:\")\n user_data.push(\" - default\")\n user_data.push(\" - name: #{admin_user}\")\n user_data.push(\" gecos: #{admin_user}\")\n user_data.push(\" primary_group: #{admin_group}\")\n user_data.push(\" shell: #{admin_shell}\")\n user_data.push(\" passwd: #{admin_crypt}\")\n user_data.push(\" sudo: #{admin_sudo}\")\n user_data.push(\" lock_passwd: false\")\n end\n end\n if options['dnsmasq'] == true && options['vm'].to_s.match(/mp|multipass/)\n exec_data.push(\"/usr/bin/systemctl disable systemd-resolved\")\n exec_data.push(\"/usr/bin/systemctl stop systemd-resolved\")\n exec_data.push(\"rm /etc/resolv.conf\")\n if options['q_struct']['nameserver'].value.to_s.match(/\\,/)\n nameservers = options['q_struct']['nameserver'].value.to_s.split(\"\\,\")\n nameservers.each do |nameserver|\n exec_data.push(\"echo 'nameserver #{nameserver}' >> /etc/resolv.conf\")\n end\n else\n nameserver = options['q_struct']['nameserver'].value.to_s\n exec_data.push(\" - echo 'nameserver #{nameserver}' >> /etc/resolv.conf\")\n end\n else \n exec_data.push(\"echo 'DNS=#{install_nameserver}' >> #{install_target}#{resolved_conf}\")\n exec_data.push(\"#{in_target}/usr/sbin/locale-gen #{install_locale}.UTF-8\")\n end\n exec_data.push(\"echo 'LC_ALL=en_US.UTF-8' > #{locale_file}\")\n exec_data.push(\"echo 'LANG=en_US.UTF-8' >> #{locale_file}\")\n exec_data.push(\"echo '#{admin_user} ALL=(ALL) NOPASSWD:ALL' > #{sudo_file}\")\n if options['copykeys'] == true and File.exist?(ssh_keyfile) and !options['vm'].to_s.match(/mp|multipass/)\n exec_data.push(\"#{in_target}groupadd #{admin_user}\")\n exec_data.push(\"#{in_target}useradd -p '#{admin_crypt}' -g #{admin_user} -G #{admin_group} -d #{admin_home} -s /usr/bin/bash -m #{admin_user}\")\n exec_data.push(\"mkdir -p #{ssh_dir}\")\n exec_data.push(\"echo '#{ssh_key}' > #{auth_file}\")\n exec_data.push(\"chmod 600 #{auth_file}\")\n exec_data.push(\"chmod 700 #{ssh_dir}\")\n exec_data.push(\"#{in_target}chown -R #{admin_user}:#{admin_user} #{admin_home}\")\n end\n if !options['vm'].to_s.match(/mp|multipass/)\n if options['vm'].to_s.match(/kvm/)\n exec_data.push(\"systemctl enable [email protected]\")\n exec_data.push(\"systemctl start [email protected]\")\n else\n if options['serial'] == true\n if options['biosdevnames'] == true\n exec_data.push(\"echo 'GRUB_CMDLINE_LINUX=\\\\\\\"net.ifnames=0 biosdevname=0 console=tty0 console=ttyS0\\\\\\\"' >> #{grub_file}\")\n else\n exec_data.push(\"echo 'GRUB_CMDLINE_LINUX=\\\\\\\"console=tty0 console=ttyS0\\\\\\\"' >> #{grub_file}\")\n end\n exec_data.push(\"echo 'GRUB_TERMINAL_INPUT=\\\\\\\"console serial\\\\\\\"' >> #{grub_file}\")\n exec_data.push(\"echo 'GRUB_TERMINAL_OUTPUT=\\\\\\\"console serial\\\\\\\"' >> #{grub_file}\")\n else\n if options['biosdevnames'] == true\n exec_data.push(\"echo 'GRUB_CMDLINE_LINUX=\\\\\\\"net.ifnames=0 biosdevname=0\\\\\\\"' >> #{grub_file}\")\n end\n end\n end\n if !options['vm'].to_s.match(/mp|multipass/)\n if options['dhcp'] == false || options['dnsmasq'] == true\n exec_data.push(\"echo '# This file describes the network interfaces available on your system' > #{netplan_file}\")\n exec_data.push(\"echo '# For more information, see netplan(5).' >> #{netplan_file}\")\n exec_data.push(\"echo 'network:' >> #{netplan_file}\")\n exec_data.push(\"echo ' version: 2' >> #{netplan_file}\")\n exec_data.push(\"echo ' renderer: networkd' >> #{netplan_file}\")\n exec_data.push(\"echo ' ethernets:' >> #{netplan_file}\")\n exec_data.push(\"echo ' #{install_nic}:' >> #{netplan_file}\")\n else\n if disable_dhcp.match(/true/)\n exec_data.push(\"echo ' addresses: [#{install_ip}/#{install_cidr}]' >> #{netplan_file}\")\n exec_data.push(\"echo ' gateway4: #{install_gateway}' >> #{netplan_file}\")\n else\n exec_data.push(\"echo ' dhcp4: true' >> #{netplan_file}\")\n end\n end\n if options['serial'] == true || options['biosdevnames'] == true\n exec_data.push(\"#{in_target}update-grub\")\n end\n if options['reboot'] == true\n exec_data.push(\"#{in_target}reboot\")\n end\n end\n end\n return user_data,exec_data\nend", "title": "" }, { "docid": "1c1682bbced28f3ef370b9c7b4acee52", "score": "0.4776559", "text": "def update_configuration\n if @@initialized\n url = 'http://'+ENV['CONSUL_IP']+':8500/v1/kv/docker_nodes?raw'\n #log_message('Updating configuration from: ' + url)\n response = HTTPService.get_request(url)\n log_message('Dynamo changed, updating configuration to: ' + response.body)\n response = JSON.parse(response.body)\n replicate_data(response)\n end\n respond_to do |format|\n format.json { render :json => { :configuration => @@dynamo_nodes } }\n end\n end", "title": "" }, { "docid": "069bfa71ee8603c0357a1f2067461c98", "score": "0.4774336", "text": "def configure_connection\n if @config[:encoding]\n @connection.set_client_encoding(@config[:encoding])\n end\n self.client_min_messages = @config[:min_messages] || \"warning\"\n self.schema_search_path = @config[:schema_search_path] || @config[:schema_order]\n\n # Use standard-conforming strings so we don't have to do the E'...' dance.\n set_standard_conforming_strings\n\n variables = @config.fetch(:variables, {}).stringify_keys\n\n # If using Active Record's time zone support configure the connection to return\n # TIMESTAMP WITH ZONE types in UTC.\n unless variables[\"timezone\"]\n if ActiveRecord.default_timezone == :utc\n variables[\"timezone\"] = \"UTC\"\n elsif @local_tz\n variables[\"timezone\"] = @local_tz\n end\n end\n\n # NOTE(joey): This is a workaround as CockroachDB 1.1.x\n # supports SET TIME ZONE <...> and SET \"time zone\" = <...> but\n # not SET timezone = <...>.\n if variables.key?(\"timezone\")\n tz = variables.delete(\"timezone\")\n execute(\"SET TIME ZONE #{quote(tz)}\", \"SCHEMA\")\n end\n\n # SET statements from :variables config hash\n # https://www.postgresql.org/docs/current/static/sql-set.html\n variables.map do |k, v|\n if v == \":default\" || v == :default\n # Sets the value to the global or compile default\n\n # NOTE(joey): I am not sure if simply commenting this out\n # is technically correct.\n # execute(\"SET #{k} = DEFAULT\", \"SCHEMA\")\n elsif !v.nil?\n execute(\"SET SESSION #{k} = #{quote(v)}\", \"SCHEMA\")\n end\n end\n end", "title": "" }, { "docid": "1f6299dee908e1260e4ef2049eeb415e", "score": "0.4765158", "text": "def parse_dbrc_config_file(file = @dbrc_file)\n begin\n fh = file.is_a?(StringIO) ? file : File.open(file)\n\n fh.each_line do |line|\n next if line =~ /^#/ # Ignore comments\n db, user, pwd, driver, timeout, max, interval = line.split\n\n next unless @database == db\n next if @user && @user != user\n\n @user = user\n @password = pwd\n @driver = driver\n @timeout = timeout\n @maximum_reconnects = max\n @interval = interval\n break\n end\n ensure\n fh.close if fh.respond_to?(:close)\n end\n\n if @user\n raise Error, \"no record found for #{@user}@#{@database}\" unless @user\n else\n raise Error, \"no record found for #{@database}\" unless @database\n end\n end", "title": "" }, { "docid": "4b0249a7a412c4c94e7aa830230a7a73", "score": "0.47647074", "text": "def add_database_url_config()\n str = ENV['DATABASE_URL']\n if str.blank?\n puts \"no ENV['DATABASE_URL'] found; skip adding DATABASE_URL config\"\n return\n end\n\n ####\n # fix/todo:\n # for config key (now db)\n # use RACK_ENV or RAILS_ENV if present?? why? why not?\n # only if not already in config? possible?\n\n db = URI.parse( str )\n\n ### use spec instead of config ???\n\n if db.scheme == 'postgres'\n config = {\n adapter: 'postgresql',\n host: db.host,\n port: db.port,\n username: db.user,\n password: db.password,\n database: db.path[1..-1],\n encoding: 'utf8'\n }\n else\n config = {\n adapter: db.scheme, # sqlite3\n database: db.path[1..-1] # pluto.db (NB: cut off leading /, thus 1..-1)\n }\n end\n\n puts 'db settings:'\n pp config\n\n if ActiveRecord::Base.configurations.nil?\n puts \"ActiveRecord configurations nil - set to empty hash\"\n ActiveRecord::Base.configurations = {} # make it an empty hash\n end\n\n puts 'ar configurations (before):'\n pp ActiveRecord::Base.configurations\n\n ActiveRecord::Base.configurations['db'] = config\n\n puts 'ar configurations (after):'\n pp ActiveRecord::Base.configurations\nend", "title": "" }, { "docid": "82b60275a4fc386c4557a64e55bfa6b0", "score": "0.4762692", "text": "def configure\n end", "title": "" }, { "docid": "3cc393b2a788a2ea0cf64552d198b6b0", "score": "0.47586057", "text": "def pull_config\n output = VirtualBox.run_command! ['VBoxManage', '--nologo', 'showvminfo',\n '--machinereadable', uid]\n config = self.class.parse_machine_readable output\n \n self.name = config['name']\n self.uid = config['UUID']\n board.from_params config\n \n nic_count = config.keys.select { |key| /^nic\\d+$/ =~ key }.max[3..-1].to_i\n 1.upto nic_count do |index|\n if config[\"nic#{index}\"] == 'none'\n nics[index - 1] = nil\n else\n nics[index - 1] ||= VirtualBox::Vm::Nic.new\n nics[index - 1].from_params config, index\n end\n end\n\n bus_count = 1 + (config.keys.select { |key|\n /^storagecontrollername\\d+$/ =~ key\n }.max || \"storagecontrollername-1\")[21..-1].to_i\n 0.upto bus_count - 1 do |index|\n io_buses[index] ||= VirtualBox::Vm::IoBus.new\n io_buses[index].from_params config, index\n end\n \n self\n end", "title": "" }, { "docid": "e4b3e8f6bef664d5345695742b97405b", "score": "0.47501653", "text": "def config\n Config.new(connection)\n end", "title": "" }, { "docid": "300967d4e754e9426b127c72fcca86b7", "score": "0.47479972", "text": "def manage_connect\n Puppet.debug \"calling manage_connect\"\n @options = load_fog_options\n acct = setup_account\n\n @accounts.set_cred(@account_name, setup_creds(acct))\n # write to get catalog info\n @accounts.write(@account_name)\n\n avl1_zone_parts = []\n avl1_zone_parts = (@options[:hp_avl_zone] || @options[:avl_zone]).split('.')\n avl1_zone_parts.shift if ( avl1_zone_parts[0] =~ /^az(.*)/ )\n\n region = avl1_zone_parts.join('.')\n Puppet.debug(\"Manager::HP::Connection using region => #{region}\")\n set_region(@accounts.read(@account_name), region)\n\n # validate these settings\n validate(@account_name)\n\n @accounts.write(@account_name)\n use_account(@account_name)\n Puppet.debug \"done calling manage_connect\"\n end", "title": "" }, { "docid": "4c26ae2e6b50edc9daf7a38eb1234f93", "score": "0.47429958", "text": "def database_configuration\n require 'erb'\n YAML::load(ERB.new(IO.read(database_configuration_file)).result) if File.exists?(database_configuration_file)\n end", "title": "" }, { "docid": "b47d17b67fe85c8615ea8cab5d7e8551", "score": "0.47418275", "text": "def initialize(config_str=nil)\n\n if config_str\n\n # We have been passed a config file as a string.\n #\n config_files = [ config_str ]\n config_class = StringIO\n\n else\n\n # Perform the usual search for the system and user config files.\n #\n config_files = [ File.join( '', 'etc', 'amazonrc' ) ]\n\n # Figure out where home is. The locations after HOME are for Windows.\n # [ruby-core:12347]\n #\n home = ENV['AMAZONRCDIR'] ||\n ENV['HOME'] || ENV['HOMEDRIVE'] + ENV['HOMEPATH'] ||\n ENV['USERPROFILE']\n user_rcfile = ENV['AMAZONRCFILE'] || '.amazonrc'\n\n if home\n config_files << File.expand_path( File.join( home, user_rcfile ) )\n end\n\n config_class = File\n end\n\n config_files.each do |cf|\n\n if config_class == StringIO\n readable = true\n else\n # We must determine whether the file is readable.\n #\n readable = File.exists?( cf ) && File.readable?( cf )\n end\n\n if readable\n\n Amazon.dprintf( 'Opening %s ...', cf ) if config_class == File\n \n config_class.open( cf ) { |f| lines = f.readlines }.each do |line|\n line.chomp!\n \n # Skip comments and blank lines.\n #\n next if line =~ /^(#|$)/\n \n Amazon.dprintf( 'Read: %s', line )\n \n # Store these, because we'll probably find a use for these later.\n #\n begin\n match = line.match( /^\\s*(\\S+)\\s*=\\s*(['\"]?)([^'\"]+)(['\"]?)/ )\n key, begin_quote, val, end_quote = match[1, 4]\n raise ConfigError if begin_quote != end_quote\n\n rescue NoMethodError, ConfigError\n raise ConfigError, \"bad config line: #{line}\"\n end\n \n self[key] = val\n \n end\n end\n\n end\n\n end", "title": "" }, { "docid": "534123b608f54b8984345bb0f0743510", "score": "0.47388408", "text": "def config\n details = Chassis.pkgs.dup\n details << [\"tags\"] + Chassis.tags unless Chassis.tags.empty?\n details << [\"roles\"] + Chassis.roles unless Chassis.roles.empty?\n details << [\"kind\"] + [Chassis.node_kind] if Chassis.node_kind\n details << Chassis.extra_config if Chassis.extra_config\n details\n end", "title": "" }, { "docid": "811507bb9b945def8eaa81ef0b174526", "score": "0.4736757", "text": "def make_connection database=nil\n \n self.sql ||= Mysql2::Client.new(:host => \"#{self.url}\", :username => \"username#{self.user_id}\", :password => \"cis400\", :port => 3306, :database=>\"#{database}\")\n end", "title": "" }, { "docid": "bc2888aaf9ee988ac799f4fde17b627a", "score": "0.47350544", "text": "def get_basic\n ver = [ 'version()', '@@version', '@@GLOBAL.VERSION' ]\n cdb = [ 'database()', '@@database', 'schema()', 'current_database()' ]\n usr = [ 'user()', 'system_user()', 'current_user()', 'session_user()' ]\n srvn = '@@hostname'\n dirz = [ '@@datadir', '@@basedir', '@@tmpdir' ]\n\n print_status(\"############### BASIC INFO ##################\")\n # Find Hostname of DB Server\n if @target_config['HOST'].nil?\n results = error_basic_inject(srvn)\n if results.nil? or results == ''\n print_error(\"Unable to determine Hostname!\")\n else\n @target_config['HOST'] = results\n print_good(\"Hostname: #{@target_config['HOST']}\")\n end\n else\n print_good(\"Hostname: #{@target_config['HOST']}\")\n end\n\n # Find Version of DB we are injecting\n if @target_config['VERSION'].nil?\n while(true)\n ver.each do |version|\n results = error_basic_inject(version)\n if not results.nil? and results != ''\n @target_config['VERSION'] = results\n print_good(\"Windows Backend OS Detected!\") if @target_config['VERSION'] =~ /-nt-log/\n print_good(\"Version: #{@target_config['VERSION']}\")\n break\n end\n end\n break\n end\n print_error(\"Unable to determine Version!\") if @target_config['VERSION'].nil?\n else\n print_good(\"Version: #{@target_config['VERSION']}\")\n end\n\n # Find Current Username\n if @target_config['USER'].nil?\n while(true)\n usr.each do |user|\n results = error_basic_inject(user)\n if not results.nil? and results != ''\n @target_config['USER'] = results\n print_good(\"Username: #{@target_config['USER']}\")\n break\n end\n end\n break\n end\n print_error(\"Unable to determine current Username!\") if @target_config['USER'].nil?\n else\n print_good(\"Username: #{@target_config['USER']}\")\n end\n\n # Find Current Database Name\n if @target_config['CURRENT_DB'].nil?\n while(true)\n cdb.each do |current_db|\n results = error_basic_inject(current_db)\n if not results.nil? and results != ''\n @target_config['CURRENT_DB'] = results\n print_good(\"Database: #{@target_config['CURRENT_DB']}\")\n break\n end\n end\n break\n end\n print_error(\"Unable to determine current database name!\") if @target_config['CURRENT_DB'].nil?\n else\n print_good(\"Database: #{@target_config['CURRENT_DB']}\")\n end\n\n # Find Directory Information (Datadir, basedir, tmpdir)\n while(true)\n dirz.each do |dirpath|\n results = error_basic_inject(dirpath)\n case dirpath\n when '@@basedir'\n if @target_config['BASEDIR'].nil?\n if results.nil?\n print_error(\"Unable to determine basedir!\")\n else\n @target_config['BASEDIR'] = results\n print_good(\"Basedir: #{@target_config['BASEDIR']}\")\n end\n else\n print_good(\"Basedir: #{@target_config['BASEDIR']}\")\n end\n when '@@datadir'\n if @target_config['DATADIR'].nil?\n if results.nil?\n print_error(\"Unable to determine datadir!\")\n else\n @target_config['DATADIR'] = results\n print_good(\"Datadir: #{@target_config['DATADIR']}\")\n end\n else\n print_good(\"Datadir: #{@target_config['DATADIR']}\")\n end\n when '@@tmpdir'\n if @target_config['TMPDIR'].nil?\n if results.nil?\n print_error(\"Unable to determine tmpdir!\")\n else\n @target_config['TMPDIR'] = results\n print_good(\"Tmpdir: #{@target_config['TMPDIR']}\")\n end\n else\n print_good(\"Tmpdir: #{@target_config['TMPDIR']}\")\n end\n end\n end\n break\n end\n print_status(\"#############################################\")\n end", "title": "" }, { "docid": "84c7291225bfb3562edcee0dab261db6", "score": "0.47296724", "text": "def database_config\n TemplateWriter.process(\n \"database.yml.erb\",\n \"/srv/Portus/config/database.yml\",\n binding\n )\n FileUtils.chown(\"root\", \"www\", \"/srv/Portus/config/database.yml\")\n FileUtils.chmod(0o640, \"/srv/Portus/config/database.yml\")\n end", "title": "" }, { "docid": "86252054f1b26ba3bd4823295bf61f2f", "score": "0.4719897", "text": "def child_init( request )\n @conn = PGconn.connect( \"host=localhost dbname=test\" )\n request.server.log_info \"Preconnect done: %p\" % [ @conn ]\n return Apache::OK\n end", "title": "" }, { "docid": "5e1e727241ad14debee4a44f55d117cc", "score": "0.4715648", "text": "def db\n self.config[:db]\n end", "title": "" }, { "docid": "a601dd6a405a8e6bd2e80339c3ba5ceb", "score": "0.4710546", "text": "def initialize(config)\n self.connection = ConnectionExtenders.db_connect config\n self.config = config\n self.manual_primary_keys = {}\n end", "title": "" }, { "docid": "208d4d23af3106fe29ce4a32b442de63", "score": "0.4707849", "text": "def configure_connection\n #if encoding = config[:encoding]\n # The client_encoding setting is set by the driver and should not be altered.\n # If the driver detects a change it will abort the connection.\n # see http://jdbc.postgresql.org/documentation/91/connect.html\n # self.set_client_encoding(encoding)\n #end\n self.client_min_messages = config[:min_messages] || 'warning'\n self.schema_search_path = config[:schema_search_path] || config[:schema_order]\n\n # Use standard-conforming strings if available so we don't have to do the E'...' dance.\n set_standard_conforming_strings\n\n # If using Active Record's time zone support configure the connection to return\n # TIMESTAMP WITH ZONE types in UTC.\n # (SET TIME ZONE does not use an equals sign like other SET variables)\n if ActiveRecord::Base.default_timezone == :utc\n execute(\"SET time zone 'UTC'\", 'SCHEMA')\n elsif tz = local_tz\n execute(\"SET time zone '#{tz}'\", 'SCHEMA')\n end unless redshift?\n\n # SET statements from :variables config hash\n # http://www.postgresql.org/docs/8.3/static/sql-set.html\n (config[:variables] || {}).map do |k, v|\n if v == ':default' || v == :default\n # Sets the value to the global or compile default\n execute(\"SET SESSION #{k} TO DEFAULT\", 'SCHEMA')\n elsif ! v.nil?\n execute(\"SET SESSION #{k} TO #{quote(v)}\", 'SCHEMA')\n end\n end\n end", "title": "" }, { "docid": "208d4d23af3106fe29ce4a32b442de63", "score": "0.4707849", "text": "def configure_connection\n #if encoding = config[:encoding]\n # The client_encoding setting is set by the driver and should not be altered.\n # If the driver detects a change it will abort the connection.\n # see http://jdbc.postgresql.org/documentation/91/connect.html\n # self.set_client_encoding(encoding)\n #end\n self.client_min_messages = config[:min_messages] || 'warning'\n self.schema_search_path = config[:schema_search_path] || config[:schema_order]\n\n # Use standard-conforming strings if available so we don't have to do the E'...' dance.\n set_standard_conforming_strings\n\n # If using Active Record's time zone support configure the connection to return\n # TIMESTAMP WITH ZONE types in UTC.\n # (SET TIME ZONE does not use an equals sign like other SET variables)\n if ActiveRecord::Base.default_timezone == :utc\n execute(\"SET time zone 'UTC'\", 'SCHEMA')\n elsif tz = local_tz\n execute(\"SET time zone '#{tz}'\", 'SCHEMA')\n end unless redshift?\n\n # SET statements from :variables config hash\n # http://www.postgresql.org/docs/8.3/static/sql-set.html\n (config[:variables] || {}).map do |k, v|\n if v == ':default' || v == :default\n # Sets the value to the global or compile default\n execute(\"SET SESSION #{k} TO DEFAULT\", 'SCHEMA')\n elsif ! v.nil?\n execute(\"SET SESSION #{k} TO #{quote(v)}\", 'SCHEMA')\n end\n end\n end", "title": "" }, { "docid": "64a2058743224fde5e27d634179821fe", "score": "0.470253", "text": "def remote_database_config(db)\n remote_config = capture(\"cat #{shared_path}/config/#{fetch(:db_file, 'mongoid.yml')}\")\n database = YAML::load(remote_config)\n return database[\"#{db}\"]['clients']['default']['username'], database[\"#{db}\"]['clients']['default']['password'], database[\"#{db}\"]['clients']['default']['database'], database[\"#{db}\"]['clients']['default']['hosts'][0]\n end", "title": "" }, { "docid": "6c1623194b3910948bb0e7fe07adec5e", "score": "0.47000217", "text": "def configure(config)\n setup_logging(config[\"logging\"])\n\n @kairos_host = config[\"kairos_host\"]\n\n @kairos_port = config[\"kairos_port\"]\n\n @rabbit_host = config[\"rabbit_host\"]\n @rabbit_user = config[\"rabbit_user\"]\n @rabbit_port = config[\"rabbit_port\"]\n @rabbit_pwd = config[\"rabbit_pwd\"]\n\n @connection_pool = config[\"connection_pool\"]\n\n @interval = config[\"interval\"]\n end", "title": "" }, { "docid": "ea4ba63acfb51cb57e69b518605edd07", "score": "0.46997446", "text": "def configure!\n conf = YAML::load_file(@config)\n conf.merge!({\n \"initial_token\" => 0,\n \"partitioner\" => \"org.apache.cassandra.dht.RandomPartitioner\",\n # have to force ascii or YAML will come out as binary\n \"data_file_directories\" => [@data.encode(\"us-ascii\")],\n \"commitlog_directory\" => @commit.encode(\"us-ascii\"),\n \"saved_caches_directory\" => @caches.encode(\"us-ascii\"),\n \"storage_port\" => @storage_port.to_i,\n \"ssl_storage_port\" => @ssl_storage_port.to_i,\n \"listen_address\" => @host.encode(\"us-ascii\"),\n \"rpc_address\" => @host.encode(\"us-ascii\"),\n \"rpc_port\" => @rpc_port.to_i,\n # DSE doesn't work OOTB as a single node unless you switch to simplesnitch\n \"endpoint_snitch\" => \"org.apache.cassandra.locator.SimpleSnitch\",\n })\n File.open(@config, \"w\") { |file| file.puts YAML::dump(conf) }\n\n # relocate the JMX port to avoid conflicts with running instances\n env = File.read(@envfile)\n env.sub!(/JMX_PORT=['\"]?\\d+['\"]?/, \"JMX_PORT=\\\"#{@jmx_port}\\\"\")\n File.open(@envfile, \"w\") { |file| file.puts env }\n\n # relocate the system.log\n log = File.read(@log4j)\n log.sub!(/log4j.appender.R.File=.*$/, \"log4j.appender.R.File=#{@logfile}\")\n File.open(@log4j, \"w\") do |file| file.puts log end\n end", "title": "" }, { "docid": "5c20d2132186c3e96f8b6833acf32ae3", "score": "0.4698546", "text": "def db_info\n @conn.query({url_path: \"#{database}\", method: :get})\n end", "title": "" }, { "docid": "7d1f4aca5e4fee6be14c5f638e23c698", "score": "0.46980184", "text": "def db_con_params\n db_name = nil\n\n # check env\n if @env_prefs[\"env\"] == \"test\"\n db_name = @db_prefs[\"db_name_test\"]\n elsif @env_prefs[\"env\"] == \"dev\"\n db_name = @db_prefs[\"db_name_dev\"]\n elsif @env_prefs[\"env\"] == \"prod\"\n db_name = @db_prefs[\"db_name_prod\"]\n end\n\n db_params = {\n :adapter => @db_prefs[\"db_adapter\"],\n :host => @db_prefs[\"db_url\"],\n :database => db_name,\n :user => @db_prefs[\"db_user\"],\n :password => @db_prefs[\"db_password\"]\n }\n\n return db_params\n end", "title": "" }, { "docid": "8fdfac1685612f48622a7b718d2a10eb", "score": "0.46979353", "text": "def init\n if @args.first.nil?\n @ui.error('Please specify the node')\n return ARGUMENT_ERROR_RESULT\n end\n @mdbci_config = Configuration.new(@args.first, @env.labels)\n result = NetworkSettings.from_file(@mdbci_config.network_settings_file)\n if result.error?\n @ui.error(result.error)\n return ARGUMENT_ERROR_RESULT\n end\n\n @network_settings = result.value\n @product = @env.nodeProduct\n @product_version = @env.productVersion\n if @product.nil? || @product_version.nil?\n @ui.error('You must specify the name and version of the product')\n return ARGUMENT_ERROR_RESULT\n end\n\n @machine_configurator = MachineConfigurator.new(@ui)\n\n SUCCESS_RESULT\n end", "title": "" }, { "docid": "e0e14feda6ba184d039d48522a869a6a", "score": "0.4695701", "text": "def get_remote_database(print_to_stdout)\n cleardb = api.get_config_vars(app).body[\"CLEARDB_DATABASE_URL\"]\n jawsdb = api.get_config_vars(app).body[\"JAWSDB_URL\"]\n\n if @@db == 'cleardb'\n puts \"Using ClearDB\" if print_to_stdout\n return cleardb\n elsif @@db == 'jawsdb'\n puts \"Using JawsDB\" if print_to_stdout\n return jawsdb\n elsif jawsdb && cleardb\n puts \"Error. Both CLEARDB_DATABASE_URL and JAWSDB_URL config vars are found. Please indicate which database to use with the --db parameter (values accepted: cleardb or jawsdb)\"\n return nil\n elsif cleardb\n puts \"Using ClearDB\" if print_to_stdout\n return cleardb\n elsif jawsdb\n puts \"Using JawsDB\" if print_to_stdout\n return jawsdb\n end\n\n return nil\n end", "title": "" }, { "docid": "8cfa19975909aabe177edea74da8a379", "score": "0.46918827", "text": "def connection()\r\n\r\n begin\r\n db_params = {\r\n host: ENV['host'], # AWS link\r\n port: ENV['port'], # AWS port, always 5432\r\n username: ENV['username'],\r\n password: ENV['password'],\r\n database: ENV['database']\r\n }\r\n\r\n client = Mysql2::Client.new(db_params)\r\n\r\n rescue Mysql2::Error => e\r\n puts 'Exception occurred'\r\n puts e.message\r\n end\r\n\r\nend", "title": "" } ]
e4aff57bf53974a05dc9af7a77def594
DELETE /measures/1 DELETE /measures/1.json
[ { "docid": "cd8fbc30bb03c498ccb917e509c9b82b", "score": "0.74395895", "text": "def destroy\n @measure.destroy\n respond_to do |format|\n format.html { redirect_to measures_url, notice: 'Measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "6730aee7da17a64bdf1562fd46b9c32c", "score": "0.7651387", "text": "def destroy\n @measure = Measure.find(params[:id])\n @measure.destroy\n\n respond_to do |format|\n format.html { redirect_to measures_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "44e9bd4c3a48fbb8d1bfd5fad0f63553", "score": "0.7619859", "text": "def destroy\n @measure = current_user.account.measures.find(params[:id])\n @measure.destroy\n\n respond_to do |format|\n format.html { redirect_to(measures_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "ad6f3cbd9076b89b3e73c565fc17a511", "score": "0.7127356", "text": "def destroy\n @measure.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "40a95022043e5e8f897f18a181e500a4", "score": "0.71151173", "text": "def destroy\n @measure = Measure.find(params[:id])\n\n respond_to do |format|\n if @measure.destroy\n format.html { redirect_to measures_url,\n notice: (crud_notice('destroyed', @measure) + \"#{undo_link(@measure)}\").html_safe }\n format.json { head :no_content }\n else\n format.html { redirect_to measures_url, alert: \"#{@measure.errors[:base].to_s}\".gsub('[\"', '').gsub('\"]', '') }\n format.json { render json: @measure.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fcdaf2acaec77683aafeba81ba382e32", "score": "0.7078196", "text": "def destroy\n @measure_group = MeasureGroup.find(params[:id])\n @measure_group.destroy\n\n respond_to do |format|\n format.html { redirect_to measure_groups_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4acb472f59412e9cb61a85647a02569f", "score": "0.7068745", "text": "def destroy\n @goldmeasure.destroy\n respond_to do |format|\n format.html { redirect_to goldmeasures_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6026400034dd14e6425ec7ffd27291b2", "score": "0.7063096", "text": "def destroy\n @cloth_measure = ClothMeasure.find(params[:id])\n @cloth_measure.destroy\n\n respond_to do |format|\n format.html { redirect_to cloth_measures_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "6240d643c6ee23f86356198cc2aff914", "score": "0.70487523", "text": "def destroy\n @kr_measure.destroy\n respond_to do |format|\n format.html { redirect_to kr_measures_url, notice: 'Kr measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "179488fc0aef5a174743a1ef223cc338", "score": "0.70429677", "text": "def destroy\n @unit_measure.destroy\n respond_to do |format|\n format.html { redirect_to unit_measures_url, notice: 'Unit measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5a4c2abe931a1b12cf7b4d3803c95a5b", "score": "0.7003562", "text": "def delete_measure(measure_id)\n raise ArgumentError,\"measure_id cannot be nil\" unless measure_id\n exec_req_and_parse_response \"/measure/delete\", {id: measure_id}\n end", "title": "" }, { "docid": "a7db1880f5479e1c8ed636ad930dc3aa", "score": "0.70010227", "text": "def destroy\n @measure_instance.destroy\n respond_to do |format|\n format.html { redirect_to measure_instances_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "636da65dfcbf180f5f914e302caea2df", "score": "0.6987348", "text": "def destroy\n @unit_of_measure.destroy\n respond_to do |format|\n format.html { redirect_to unit_of_measures_url, notice: 'Unit of measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "01a0928229fd6d6014148f0cf5271dc6", "score": "0.6881352", "text": "def destroy\n @admin_sub_metric.destroy\n respond_to do |format|\n format.html { redirect_to admin_sub_metrics_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cd4c4b1513f8eb56eca8476fddaea870", "score": "0.68483156", "text": "def destroy\n @standard_measurement = StandardMeasurement.find(params[:id])\n @standard_measurement.destroy\n\n respond_to do |format|\n format.html { redirect_to standard_measurements_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0c312c7bd086c6880779cb17432a34bc", "score": "0.68184566", "text": "def destroy\n @unidade_metrica = UnidadeMetrica.find(params[:id])\n @unidade_metrica.destroy\n\n respond_to do |format|\n format.html { redirect_to unidade_metricas_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7070e4dc3849fac5852c0271c9b6d7cc", "score": "0.68092775", "text": "def test_del\n header 'Content-Type', 'application/json'\n\n data = File.read 'sample-traces/0.json'\n post('/traces', data, 'CONTENT_TYPE': 'application/json')\n\n id = last_response.body\n\n delete \"/traces/#{id}\"\n assert last_response.ok?\n\n get \"/traces/#{id}\"\n\n contents = JSON.parse last_response.body\n assert_kind_of(Hash, contents, 'Response contents is not a hash')\n assert contents.key? 'description'\n assert(!last_response.ok?)\n end", "title": "" }, { "docid": "a5c6760920c93724ef3a95d2b4d02d73", "score": "0.6792381", "text": "def destroy\n @unit_of_measure = UnitOfMeasure.find(params[:id])\n @unit_of_measure.destroy\n get_data\n end", "title": "" }, { "docid": "3fda1a1f08db21b2aad7d74f40aa1388", "score": "0.678975", "text": "def destroy\n @metric = Metric.find(params[:id])\n @metric.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "2b28c904bee2736f4874e22dd06d6887", "score": "0.678681", "text": "def destroy\n @irradiance_measure.destroy\n respond_to do |format|\n format.html { redirect_to irradiance_measures_url, notice: 'Irradiance measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8cc2c6de10e3561e07437fa5331c33a4", "score": "0.67804295", "text": "def destroy\n @outcome_measure_type.destroy\n respond_to do |format|\n format.html { redirect_to outcome_measure_types_url, notice: 'Outcome measure type was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "370baabf5470b0274ce9350e8c88a595", "score": "0.67773455", "text": "def destroy\n @metric_type = MetricType.find(params[:id])\n @metric_type.destroy\n\n respond_to do |format|\n format.html { redirect_to metric_types_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "87b332e310517674e3be77c2313f3af6", "score": "0.6706955", "text": "def destroy\n @metric_speedtest.destroy\n respond_to do |format|\n format.html { redirect_to metric_speedtests_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ae032290a9d347ef4e3b89c92129c190", "score": "0.6681504", "text": "def destroy\n metric.destroy\n\n respond_with(metric)\n end", "title": "" }, { "docid": "55722509c3d5247d1f9ebceed6d89d11", "score": "0.66755986", "text": "def destroy\n @weather_measure.destroy\n respond_to do |format|\n format.html { redirect_to weather_measures_url, notice: 'Weather measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "663c93604447a2e3689fa197f0fcd260", "score": "0.66667527", "text": "def destroy\n authorize! :manage, @vspec\n metric = @vspec.metric\n @vspec.destroy\n respond_to do |format|\n format.html { redirect_to [metric.service, metric] }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a24a92dee96b8d48f47374a7e8bf478e", "score": "0.66651297", "text": "def destroy\n @ballot_measure.destroy\n respond_to do |format|\n format.html { redirect_to ballot_measures_url, notice: 'Ballot measure was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "31ccbed59cfaca8374e3ff68f45d93cd", "score": "0.66366386", "text": "def destroy\n @throughput_metric.destroy\n respond_to do |format|\n format.html { redirect_to throughput_metrics_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "92f020caa34c4afb88db915975fd16ac", "score": "0.66347444", "text": "def destroy\n @metric_type = MetricType.find(params[:id])\n @metric_type.destroy\n\n respond_to do |format|\n format.html { redirect_to(metric_types_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7f86ce0305c3cfdf088da7e0f157b7d4", "score": "0.6626555", "text": "def destroy\n @metric.destroy\n respond_to do |format|\n format.html { redirect_to metrics_url, notice: 'Metric was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b40e9795cdc53ce716dce3cf624f2e41", "score": "0.65973175", "text": "def destroy\n @k_measurement.destroy\n respond_to do |format|\n format.html { redirect_to k_measurements_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "31b9ca09941e7dcf40b3964a76d72bab", "score": "0.6596779", "text": "def destroy\n @body_measurement.destroy\n respond_to do |format|\n format.html { redirect_to body_measurements_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bd39b54f406bddbfba41bd07b7d05cfe", "score": "0.6566025", "text": "def destroy\n @exam_set.destroy\n respond_to do |format|\n format.html { redirect_to exam_sets_url, notice: 'Exam set was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "79bbcbf76fca4fb3522bf32b31fc03e2", "score": "0.6563244", "text": "def destroy\n @calculated_data_assessment = CalculatedDataAssessment.find(params[:id])\n @calculated_data_assessment.destroy\n\n respond_to do |format|\n format.html { redirect_to calculated_data_assessments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cce633b85490ff59258072860d259ad9", "score": "0.65509224", "text": "def destroy\n @measurement = Measurement.find(params[:id])\n @measurement.destroy\n\n respond_to do |format|\n format.html { redirect_to body_measurements_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2e9951aa8da2e15411333dfa370b6a1a", "score": "0.654774", "text": "def destroy\n @bg_measurement.destroy\n respond_to do |format|\n format.html { redirect_to bg_measurements_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2e9951aa8da2e15411333dfa370b6a1a", "score": "0.654774", "text": "def destroy\n @bg_measurement.destroy\n respond_to do |format|\n format.html { redirect_to bg_measurements_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d97c67fb646a5e33c519ee6db62c14df", "score": "0.6529305", "text": "def destroy\n @measurement.destroy\n respond_to do |format|\n format.html { redirect_to measurements_url, notice: 'Measurement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d97c67fb646a5e33c519ee6db62c14df", "score": "0.6529305", "text": "def destroy\n @measurement.destroy\n respond_to do |format|\n format.html { redirect_to measurements_url, notice: 'Measurement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d97c67fb646a5e33c519ee6db62c14df", "score": "0.6529305", "text": "def destroy\n @measurement.destroy\n respond_to do |format|\n format.html { redirect_to measurements_url, notice: 'Measurement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "11fa3b4745cd2ece526df2a6ac13f5cc", "score": "0.6525577", "text": "def destroy\n @measurement.destroy\n respond_to do |format|\n format.html { redirect_to measurements_url, notice: \"Measurement was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "19885d9532e712516032f2c8ab1e8d73", "score": "0.6517011", "text": "def destroy\n @mx_assessment.destroy\n respond_to do |format|\n format.html { redirect_to mx_assessments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "19af0a7ed3b5f3c3f2f9fa3f723ae6f6", "score": "0.64982396", "text": "def destroy\n @measurment.destroy\n respond_to do |format|\n format.html { redirect_to measurments_url, notice: 'Measurment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "612c7d39ecf4074e6207b69af37bef64", "score": "0.64904", "text": "def destroy\n @staff_measurement.destroy\n respond_to do |format|\n format.html { redirect_to staff_measurements_url, notice: (t 'staff_measurements.title')+(t 'actions.removed') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d3f4eff831fd37e2d1935f4b7b809717", "score": "0.64893585", "text": "def destroy\n @measurement = Measurement.find(params[:id])\n @measurement.destroy\n\n respond_to do |format|\n format.html { redirect_to(measurements_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8ac3b6e0ed7d376a7e3d4a76a59f779e", "score": "0.6478325", "text": "def destroy\n @delinquency_stat.destroy\n respond_to do |format|\n format.html { redirect_to delinquency_stats_url, notice: 'Delinquency stat was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "111bea5c02337a13a66fbfbe55dd5660", "score": "0.6473424", "text": "def destroy\n authorize! :manage, Measurement\n \n @measurement.destroy\n respond_to do |format|\n format.html { redirect_to measurements_url, notice: 'Measurement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ffe40b28307bf7986299e70b6219f3b0", "score": "0.6472306", "text": "def destroy\n @ref_med_diagnostic_test_type = Ref::MedDiagnosticTestType.find(params[:id])\n @ref_med_diagnostic_test_type.destroy\n\n respond_to do |format|\n format.html { redirect_to ref_med_diagnostic_test_types_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "b32fa745ec28645f6d2c41f71b83e4eb", "score": "0.64719", "text": "def destroy\n @measle.destroy\n respond_to do |format|\n format.html { redirect_to measles_url, notice: 'Measle was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "229e82dab77a222c33139a62d96a01e3", "score": "0.6443233", "text": "def destroy\n @metric = Metric.find(params[:id])\n @metric.destroy\n\n respond_to do |format|\n format.html { redirect_to metrics_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fbcdfd157cd11839deca6a2ec9f21ef0", "score": "0.64410216", "text": "def destroy\n @dataset.destroy\n respond_to do |format|\n format.html { redirect_to study_path(@dataset.study), notice: 'Dataset was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "01d42b1f1f2d6b5e399a23ac1f38cd9a", "score": "0.64388347", "text": "def destroy\n @key_metric = KeyMetric.find(params[:id])\n @key_metric.destroy\n\n respond_to do |format|\n format.html { redirect_to(key_metrics_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "26c70f6111fbb35086ffea4762aec0d0", "score": "0.643257", "text": "def destroy\n @test_summary = TestSummary.find(params[:id])\n @test_summary.destroy\n\n respond_to do |format|\n format.html { redirect_to test_summaries_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "3b68c60e409ca5483af02f24ac2d3722", "score": "0.64242715", "text": "def destroy\n @aspect = Aspect.find(params[:id])\n @aspect.destroy\n\n respond_to do |format|\n format.html { redirect_to(aspects_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "04b86be90f89c2ed40c43e10d076547d", "score": "0.64181304", "text": "def destroy\n @measurement = current_user.measurements.find(params[:id])\n @measurement.destroy\n\n respond_to do |format|\n format.html { redirect_to(measurements_path) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "c20e4be87b113a36dcc9ed29d9af69db", "score": "0.64142674", "text": "def destroy\n @fixturestat = Fixturestat.find(params[:id])\n @fixturestat.destroy\n\n respond_to do |format|\n format.html { redirect_to fixturestats_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "169d10d637ee0aebde245ffdb813709b", "score": "0.6394551", "text": "def destroy\n @dbh_measurement.destroy\n respond_to do |format|\n format.html { redirect_to dbh_measurements_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "11394376f35ee28dbd2c492c8f4cee90", "score": "0.6388553", "text": "def destroy\r\n Metric.find_by_metric_id(@value_metric.id).destroy\r\n #Metric.find(idx).destroy\r\n @value_metric.destroy\r\n respond_to do |format|\r\n format.html { redirect_to @game, notice: 'Value metric was successfully destroyed.' }\r\n format.json { head :no_content }\r\n end\r\n end", "title": "" }, { "docid": "f401acddb43c7484be9bb597c01ae19e", "score": "0.6387559", "text": "def destroy\n @pursuit_metric.destroy\n respond_to do |format|\n format.html { redirect_to pursuit_metrics_url, notice: 'Pursuit metric was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "76f6046761fab25b2a9ec0c0accb8284", "score": "0.63730466", "text": "def destroy\n @assert = Assert.find(params[:id])\n @assert.destroy\n\n respond_to do |format|\n format.html { redirect_to asserts_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "99b4a5bd3864e4f866e62cd849e8c789", "score": "0.6370532", "text": "def destroy\n @summary.destroy\n respond_to do |format|\n format.html { redirect_to summaries_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "40bf1f2987e62deb3d87435d29e1a69e", "score": "0.6367581", "text": "def delete_demo(id)\n delete_record \"/demos/#{id}\"\n end", "title": "" }, { "docid": "e1aa2add4721a48230357b724ee78dda", "score": "0.6358413", "text": "def destroy\n @user_measurement.destroy\n respond_to do |format|\n format.html { redirect_to user_measurements_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "12525e3c7e48e15ae8dc7ce432fe3d1a", "score": "0.6356312", "text": "def destroy\n @task_metric = TaskMetric.find(params[:id])\n @task_metric.destroy\n\n respond_to do |format|\n format.html { redirect_to task_metrics_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b7fb3594b700c59adb5f3bb29075ee57", "score": "0.6354391", "text": "def destroy\n @gios_measurment.destroy\n respond_to do |format|\n format.html { redirect_to gios_measurments_url, notice: 'Gios measurment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5d0ff8e47be57a39b8c9d350fc0dfa96", "score": "0.6353492", "text": "def destroy\n @medical_test.destroy\n respond_to do |format|\n format.html { redirect_to medical_tests_url, notice: 'Medical test was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e744ceab926deea795d7384f15adee79", "score": "0.6342687", "text": "def destroy\n @running_measurement.destroy\n respond_to do |format|\n format.html { redirect_to running_measurements_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9fcd49a7a905420862173c0fc7686ec9", "score": "0.6341065", "text": "def destroy\n @consensu = Consensu.find(params[:id])\n @consensu.destroy\n\n respond_to do |format|\n format.html { redirect_to consensus_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6a77a6f29fb18795da9df93bffdc64d0", "score": "0.6338191", "text": "def destroy\n @my_exam = MyExam.find(params[:id])\n @my_exam.destroy\n\n respond_to do |format|\n format.html { redirect_to my_exams_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "65b347e493cbce2cff2f32e486410c92", "score": "0.63370335", "text": "def destroy\n @performance_test = PerformanceTest.find(params[:id])\n @performance_test.destroy\n\n respond_to do |format|\n format.html { redirect_to performance_tests_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "02b02d0e1d2a7c645059a61203188f48", "score": "0.6336341", "text": "def destroy\n @body_measurement.destroy\n respond_to do |format|\n format.html { redirect_to body_measurements_url, notice: 'Body measurement was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "54f382ed6049f8839e68b3421b513534", "score": "0.6334931", "text": "def destroy\n @assert = Assert.find(params[:id])\n @assert.destroy\n\n respond_to do |format|\n format.html { redirect_to asserts_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "793857d6126d42749918a7bec479c164", "score": "0.6329983", "text": "def destroy\n @dataset_datum.destroy\n respond_to do |format|\n format.html { redirect_to dataset_data_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "438fc0b7b571f1f0a1b33be290448b91", "score": "0.6322792", "text": "def destroy\n @qdataset.destroy\n respond_to do |format|\n format.html { redirect_to qdatasets_url, notice: 'Qdataset was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ec5eec15edbe9ce021e3be2498d74d95", "score": "0.63172793", "text": "def destroy\n @dataset = Dataset.find(params[:id])\n @dataset.destroy\n\n respond_to do |format|\n format.html { redirect_to datasets_url }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "8994d317ca7edbab1cc4ccf54b7f3889", "score": "0.63167477", "text": "def destroy\n @statistic.destroy\n respond_to do |format|\n format.html { redirect_to statistics_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "53478fac1164360cc088b6736ed54f7c", "score": "0.6305331", "text": "def destroy\n @test_meta_datum.destroy\n respond_to do |format|\n format.html { redirect_to test_meta_data_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "689d5a07a403c4b765ba178e4aff08a3", "score": "0.6304499", "text": "def delete\n client.delete(\"/#{id}\")\n end", "title": "" }, { "docid": "ba67ebd85114998e01be10599c8943ca", "score": "0.6303601", "text": "def delete(path)\n RestClient.delete request_base+path\n end", "title": "" }, { "docid": "dfdfcbb7fc9dc8bb0179a5a59a73cbe4", "score": "0.63003135", "text": "def delete_analysis(analysis_id); rest_delete(\"#{link('analyses')}/#{analysis_id}\"); nil; end", "title": "" }, { "docid": "0cbf2af0c2d7558d11cc96bd45a56ce7", "score": "0.6293907", "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": "cb5efc5c220a142b2bbaa3af339fecdb", "score": "0.6292083", "text": "def destroy\n @accuracy = Accuracy.find(params[:id])\n @accuracy.destroy\n\n respond_to do |format|\n format.html { redirect_to accuracies_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7a5eea7c7a07ce3e7f95fa50802d596e", "score": "0.6289773", "text": "def delete path\n make_request(path, \"delete\", {})\n end", "title": "" }, { "docid": "6c0f9adf05fa7122ac4e24ab912ae455", "score": "0.6287703", "text": "def destroy\n @exam = Exam.find(params[:id])\n @exam.destroy\n\n respond_to do |format|\n format.html { redirect_to exams_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "49fef0c971f3bf604deb0efde035e30a", "score": "0.62824225", "text": "def destroy\n @experiment_raw_dataset.destroy\n respond_to do |format|\n format.html { redirect_to experiment_raw_datasets_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d063f834af2613cb8533eb79de8663c2", "score": "0.6280578", "text": "def destroy\n @slope.destroy\n respond_to do |format|\n format.html { redirect_to slopes_url, notice: 'Slope was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a278711946f2b50f32dee192437c6f9c", "score": "0.6279371", "text": "def destroy\n @exercise_set = ExerciseSet.find(params[:id])\n @exercise_set.destroy\n\n respond_to do |format|\n format.html { redirect_to exercise_sets_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "abe26c6d8bb7654e3b262d9a7b3609eb", "score": "0.6277322", "text": "def destroy\n @mssample = Mssample.find(params[:id])\n @mssample.destroy\n\n respond_to do |format|\n format.html { redirect_to(mssamples_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "cf9aa8c4d10a7fccaeb721a2d692883b", "score": "0.6273722", "text": "def destroy\n @datapoint.destroy\n respond_to do |format|\n format.html { redirect_to datapoints_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ea27a2ef313b6dc59920b91089b58bd", "score": "0.6268514", "text": "def destroy\n @dataset = Dataset.find(params[:id])\n @dataset.destroy\n\n respond_to do |format|\n format.html { redirect_to(datasets_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "7ea27a2ef313b6dc59920b91089b58bd", "score": "0.6268514", "text": "def destroy\n @dataset = Dataset.find(params[:id])\n @dataset.destroy\n\n respond_to do |format|\n format.html { redirect_to(datasets_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "2807555e68c3f9bf21717af14bd1b655", "score": "0.6259046", "text": "def destroy\n @medium_trial = MediumTrial.find(params[:id])\n @medium_trial.destroy\n\n respond_to do |format|\n format.html { redirect_to medium_trials_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a6660f8f62027412929d7b78d182281c", "score": "0.62574965", "text": "def delete endpoint\n do_request :delete, endpoint\n end", "title": "" }, { "docid": "9e657ded464c647b91d97bfa386f4f86", "score": "0.6256972", "text": "def destroy\n @dataset.destroy\n\n respond_to do |format|\n format.html { redirect_to(datasets_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "efc8015343c0d52a88d73b75c5c33591", "score": "0.62557423", "text": "def destroy\n @test_metum.destroy\n respond_to do |format|\n format.html { redirect_to test_meta_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7edea04fcb69626c4d9cea5146f45aff", "score": "0.62533545", "text": "def destroy\n @exam.destroy\n respond_to do |format|\n format.html { redirect_to exams_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0ff5318c0aeedb57d0fa05f6f6d50bc7", "score": "0.62473243", "text": "def destroy\n @medical.destroy\n respond_to do |format|\n format.html { redirect_to vigs_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fb1257c4c5cfae7fc821b4f2d9bd788b", "score": "0.6242818", "text": "def destroy\n @utilization_metric = @object\n @utilization_metric.destroy\n\n respond_to do |format|\n format.html { redirect_to utilization_metrics_url }\n format.js {\n render(:update) { |page|\n }\n }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "e66e80d646f01548287c51d2d39e58a0", "score": "0.62407154", "text": "def destroy\n @backend_tutorial_stat = Backend::TutorialStat.find(params[:id])\n @backend_tutorial_stat.destroy\n\n respond_to do |format|\n format.html { redirect_to backend_tutorial_stats_url }\n format.json { head :ok }\n end\n end", "title": "" } ]
e34829525af02d8bf86e3418488839b2
GET /indice_pincipals/1 GET /indice_pincipals/1.xml
[ { "docid": "4bbd84e88dac92e695fb7f68f0487ef3", "score": "0.6843019", "text": "def show\n @indice_pincipal = IndicePincipal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @indice_pincipal }\n end\n end", "title": "" } ]
[ { "docid": "5eeb9b4c6cd359a575fb42046865c83d", "score": "0.61953884", "text": "def show\r\n @ips = Ip.find(params[:id])\r\n respond_to do |format|\r\n format.html #show.html.erb\r\n format.xml { render :xml => @ips.to_xml(:dasherize => false) }\r\n end\r\n end", "title": "" }, { "docid": "448ad71191b137586a5c64994821c0e4", "score": "0.6145073", "text": "def show\n @percipitation = Percipitation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @percipitation }\n end\n end", "title": "" }, { "docid": "ecfb9e84c653c54ce66277eb966f0d62", "score": "0.6079464", "text": "def index\n @piis = Pii.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @piis }\n end\n end", "title": "" }, { "docid": "91d6001834013ef77f42eadea5b34cf1", "score": "0.60243595", "text": "def show\n \n render :layout => 'peir' \n \n # Starting variables \n\t @trips = \"\"\n\t @data = 0;\n\t @nrtrips = 0;\n \n #Get and parse XML\n parser = XML::Parser.file('https://peir.cens.ucla.edu/protected/private/stockholm_xml.php')\n doc = parser.parse\n doc.find('/trip').each do |p|\n # Process information\n id = p.attributes[\"id\"]\n datapoints = p.attributes[\"dataCount\"]\n\n # Aggregate information for return\n \t\t\t@nrtrips ++\n \t\t\t@data += datapoints\n \t\t\t@trips += \" \" + id\n \n\n end\n end", "title": "" }, { "docid": "78455078bd3cfb2b41a03e408246934f", "score": "0.6000841", "text": "def show\n @pii = Pii.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pii }\n end\n end", "title": "" }, { "docid": "6f1d9247d808e19e90162ae085175178", "score": "0.59337604", "text": "def new\n @indice_pincipal = IndicePincipal.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @indice_pincipal }\n end\n end", "title": "" }, { "docid": "7b7cb68cddc726385bcbc3f7279ca193", "score": "0.5851747", "text": "def index\n if params[:tag].present?\n @ip_addresses = IpAddress.tagged_with(params[:tag])\n else\n @ip_addresses = IpAddress\n end\n \n @ip_addresses = @ip_addresses.order('address').page(params[:page]).per(50)\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @ip_addresses }\n format.xml {\n send_data Scan.get_all_scanned_xml,\n :type => 'text/xml; charset=UTF-8;',\n :disposition => 'attachment; filename=nmap.xml'\n }\n end\n end", "title": "" }, { "docid": "321bfc3ecff5a54697f072cd8a2c9ebe", "score": "0.58445364", "text": "def index\n @ips = Ip.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ips }\n end\n end", "title": "" }, { "docid": "8d4ae75ab069d2fa02014e6f49cb3af4", "score": "0.58425176", "text": "def show\n @piso = Piso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @piso }\n end\n end", "title": "" }, { "docid": "56aa67e637017800b4f7f57fb4c7f83c", "score": "0.5840159", "text": "def show\n @point_of_interest = PointOfInterest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @point_of_interest }\n end\n end", "title": "" }, { "docid": "956a6a7b923673678c2fa1c01f0f33fc", "score": "0.58155644", "text": "def show\n @pin = Pin.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pin }\n end\n end", "title": "" }, { "docid": "981c04fb8625b036a2b80260929499d4", "score": "0.5774017", "text": "def get_xml\n @xml ||= Nokogiri::XML(\n open(\"#{PLOS_INFO_URL}?uri=info:doi/#{CGI::escape(@doi)}&representation=XML\")\n )\n end", "title": "" }, { "docid": "437b99756209aa14feddb6e5359c13e5", "score": "0.5761227", "text": "def index\n @piki_entries = PikiEntry.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @piki_entries }\n end\n end", "title": "" }, { "docid": "393bcf6daf50a719a437d2b48aa9fce4", "score": "0.57456726", "text": "def index\n @ignites = Ignite.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ignites }\n end\n end", "title": "" }, { "docid": "d8b8799b9f268ad9b0ba90bb83bf2113", "score": "0.5729825", "text": "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @interest }\n end\n end", "title": "" }, { "docid": "d8b8799b9f268ad9b0ba90bb83bf2113", "score": "0.5729825", "text": "def show\n @interest = Interest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @interest }\n end\n end", "title": "" }, { "docid": "db1f86f22d65976ac578124c72ee2824", "score": "0.5695949", "text": "def show\n @snip = Snip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @snip }\n end\n end", "title": "" }, { "docid": "0ad9d13e623c8243845e26fd22599f99", "score": "0.56759524", "text": "def index\n\t\t@pois = PointOfInterest.all\n\tend", "title": "" }, { "docid": "94865d49a0e85de9a69b7f72579e697c", "score": "0.5656901", "text": "def show\n @indication = Indication.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @indication }\n end\n end", "title": "" }, { "docid": "a551f267ebfec7eaa3f65cc5942e0728", "score": "0.56309634", "text": "def show\n @pia_ocotal = PiaOcotal.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pia_ocotal }\n end\n end", "title": "" }, { "docid": "f68139229c14a09a4294adb655857de0", "score": "0.5624543", "text": "def get_xml(api_call)\n xml = ''\n http = Net::HTTP.new('api.pinboard.in', 443)\n http.use_ssl = true\n http.start do |http|\n \trequest = Net::HTTP::Get.new(api_call)\n \trequest.basic_auth @user,@pass\n \tresponse = http.request(request)\n \tresponse.value\n \txml = response.body\n end\n return REXML::Document.new(xml)\n end", "title": "" }, { "docid": "fb7b90ee176850528839d5ddfb45131c", "score": "0.56217813", "text": "def index\n @instancias = Instancia.paginate :page => params[:page], :order => 'id'\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @instancias }\n end\n end", "title": "" }, { "docid": "8a9e3c8a039d50ed721fc5c3d6e63552", "score": "0.56192845", "text": "def show\n @inning = Inning.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @inning }\n end\n end", "title": "" }, { "docid": "c1c35dbb562b39e992cb541db3418d0a", "score": "0.5617713", "text": "def index\n @innappropiate_requests = InnappropiateRequest.all\n end", "title": "" }, { "docid": "6642ea9dca739923df83e467ee9e8b8d", "score": "0.56153214", "text": "def show\n @piki_entry = PikiEntry.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @piki_entry }\n end\n end", "title": "" }, { "docid": "0384929a5999e2aa9213ad7bfe8e4fec", "score": "0.5613999", "text": "def show\n \n @incidence = Incidence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @incidence }\n end\n end", "title": "" }, { "docid": "07afa7b2292e53c00b82d7382abe4c14", "score": "0.56065035", "text": "def show\n @ip = Ip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ip }\n end\n end", "title": "" }, { "docid": "07afa7b2292e53c00b82d7382abe4c14", "score": "0.56065035", "text": "def show\n @ip = Ip.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ip }\n end\n end", "title": "" }, { "docid": "d5ca8fe3162a9634d99815ba09599571", "score": "0.5598883", "text": "def index\n @pin_groups = PinGroup.paginate :per_page=>20,:page => params[:page], :order => 'id DESC'\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pin_groups }\n end\n end", "title": "" }, { "docid": "b91e8387fe37f513945e4ea771d36df1", "score": "0.5598356", "text": "def show\n @pist = Pist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @pist }\n end\n end", "title": "" }, { "docid": "d88ef802c5d9e532d89fd8a30c8c626e", "score": "0.55949193", "text": "def show\n @shared_interest_point = SharedInterestPoint.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @shared_interest_point }\n end\n end", "title": "" }, { "docid": "c3351db87a949e00149f0eb453d5ef05", "score": "0.5590725", "text": "def show\n @politician = Politician.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @politician }\n end\n end", "title": "" }, { "docid": "c3351db87a949e00149f0eb453d5ef05", "score": "0.5590725", "text": "def show\n @politician = Politician.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @politician }\n end\n end", "title": "" }, { "docid": "26bae1a03e5166a9986f050a158add4b", "score": "0.55872846", "text": "def index\n @interests = Interest.order(\"updated_at DESC\").page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @interests }\n end\n end", "title": "" }, { "docid": "47ec1644bf0b4f5835e5be556b4ec5dc", "score": "0.55643964", "text": "def show\n @ipadvance = Ipadvance.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ipadvance }\n end\n end", "title": "" }, { "docid": "0733adfec210fc1f9b210459706984de", "score": "0.55508155", "text": "def index\n @station = Station.find(params[:station_id])\n @ups = @station.ups\n\t\t\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @ups }\n end\n end", "title": "" }, { "docid": "39efe5aca794c93fa71d9a966444be87", "score": "0.5542319", "text": "def show\n @npi = Npi.find(params[:id])\n end", "title": "" }, { "docid": "6d0852c276924ee8431b32198a073faf", "score": "0.55397725", "text": "def get_psn\n Rails.logger.debug \"Fetching PSN trophies from truetrophies...\"\n get_xml('https://www.truetrophies.com/friendfeedrss.aspx?gamerid=26130', 'gaming_expiry')\n end", "title": "" }, { "docid": "f11babc2f5e89288c786f473d6c728fa", "score": "0.5538207", "text": "def show\n @cst_pi = CstPis.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @cst_pi }\n end\n end", "title": "" }, { "docid": "c8856bd66375623f225e48d38633aaae", "score": "0.553484", "text": "def show_on_map\n #@pin = Pin.find(params[:id])\n #respond_to do |format|\n #format.html do\n \n #end\n #format.xml {\n render :text=>@pin.to_xml(\n :only =>[:latitude, :longitude, :title, :description],\n :root =>\"data\")\n #}\n #end\n \n end", "title": "" }, { "docid": "5bfd64ac874fcbc6f086cbd7fd23fc38", "score": "0.5526744", "text": "def show\n @ip_discharge = IpDischarge.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ip_discharge }\n end\n end", "title": "" }, { "docid": "87d04228cd4fce2ce0e14154ab67a313", "score": "0.5524945", "text": "def show\n @profile_interest = ProfileInterest.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @profile_interest }\n end\n end", "title": "" }, { "docid": "0e6a4bdca4ccd0361cd9c19b5e102e18", "score": "0.5519277", "text": "def index\n @proposals = IlpProposal.on_signature_time\n\n respond_to do |format|\n format.xml { render :xml => @proposals }\n end\n end", "title": "" }, { "docid": "f4e596b8407e58703239731850df72f1", "score": "0.55119", "text": "def show\n @poi = Poi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @poi }\n end\n end", "title": "" }, { "docid": "d49ed44011e27ca3682731a15b70119f", "score": "0.5508151", "text": "def show\n @institucion = Institucion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @institucion }\n end\n end", "title": "" }, { "docid": "f3b4437686b65de65201b9f6d3308d8d", "score": "0.5501119", "text": "def show\n @inter = Inter.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @inter }\n end\n end", "title": "" }, { "docid": "7cb1d6deedd2043e2815adb040005c9c", "score": "0.5500566", "text": "def index\n @tipo_institucions = TipoInstitucion.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @tipo_institucions }\n end\n end", "title": "" }, { "docid": "fc713acc13cef9c684d24d5c82b1eaec", "score": "0.5495705", "text": "def index\n @instants = Instants.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @instants }\n end\n end", "title": "" }, { "docid": "54e4d8a100ad4962bf86f4dc8abe42e4", "score": "0.5491955", "text": "def index\n @sip_accounts = SipAccount.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sip_accounts }\n end\n end", "title": "" }, { "docid": "6ff706e96077073526af6ce620a2c8bf", "score": "0.5483302", "text": "def show\n @solicitation = Solicitation.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @solicitation }\n end\n end", "title": "" }, { "docid": "82873540737a8a0089c85afe41a9f87f", "score": "0.5479465", "text": "def show\n @indicator = Indicator.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @indicator }\n end\n end", "title": "" }, { "docid": "2f8ef2031a2582238ffccd53532bc371", "score": "0.5476908", "text": "def create\n @indice_pincipal = IndicePincipal.new(params[:indice_pincipal])\n\n respond_to do |format|\n if @indice_pincipal.save\n format.html { redirect_to(@indice_pincipal, :notice => 'Indice pincipal was successfully created.') }\n format.xml { render :xml => @indice_pincipal, :status => :created, :location => @indice_pincipal }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @indice_pincipal.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f081898ca17c91ab8e3d0c372680600d", "score": "0.5463419", "text": "def index\n @presale_consultings = PresaleConsulting.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @presale_consultings }\n end\n end", "title": "" }, { "docid": "d4a176cc9f478392252770323e7feea2", "score": "0.54623836", "text": "def index\n @bip_configs = BipConfig.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @bip_configs }\n end\n end", "title": "" }, { "docid": "8864825b64c0f078f220c1b263df5976", "score": "0.5462244", "text": "def show\n @panier = Panier.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @panier }\n end\n end", "title": "" }, { "docid": "e49d5cfa07e1798ecaad81d42a0d5c3e", "score": "0.54547834", "text": "def index\n @prizzm_invitations = current_company.prizzm_invitations.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @prizzm_invitations }\n end\n end", "title": "" }, { "docid": "e216d7301f87e7f3430230d792d06244", "score": "0.5448226", "text": "def index\n @sip_accounts = SipAccount.all\n \n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @sip_accounts }\n end\n end", "title": "" }, { "docid": "8f242f6b695fd275753cab57a739e5f7", "score": "0.5445251", "text": "def index\n @pings = Ping.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @pings }\n end\n end", "title": "" }, { "docid": "1d6e3a8a487ebc0d40361b0183f66b07", "score": "0.5439669", "text": "def show\n @interbitacora = Interbitacora.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @interbitacora }\n end\n end", "title": "" }, { "docid": "9fc950664164bde8210e65e639560554", "score": "0.54103", "text": "def index\n @disciplines = Discipline.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml\n end\n end", "title": "" }, { "docid": "b592938580ab967220bca1c22fad206b", "score": "0.5408091", "text": "def index\n @invites = @itinerary.invites\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @invites }\n end\n end", "title": "" }, { "docid": "89407f21efe345df7012dbb844b5ff02", "score": "0.5407688", "text": "def index\n @edu_insts = EduInst.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @edu_insts }\n end\n end", "title": "" }, { "docid": "89407f21efe345df7012dbb844b5ff02", "score": "0.5407688", "text": "def index\n @edu_insts = EduInst.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @edu_insts }\n end\n end", "title": "" }, { "docid": "c6dd048d69084dffbe79d7ff700385e5", "score": "0.5406843", "text": "def interest_info\n interest_info = Enquiries::PropertyService.new(udprn: params[:udprn].to_i).interest_info\n render json: interest_info, status: 200\n end", "title": "" }, { "docid": "73fc6558eb45b152f78ea7ffe8f0240a", "score": "0.53986186", "text": "def show\n @inlist = Inlist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @inlist }\n end\n end", "title": "" }, { "docid": "482d535c63fd066b703d111e168af921", "score": "0.5397353", "text": "def index\n @trips = Trip.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @trips }\n end\n end", "title": "" }, { "docid": "482d535c63fd066b703d111e168af921", "score": "0.5397353", "text": "def index\n @trips = Trip.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @trips }\n end\n end", "title": "" }, { "docid": "b7d778b2f8130c1e8dc42c67eb52ea77", "score": "0.53937405", "text": "def show\n @opinion = Opinion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @opinion }\n end\n end", "title": "" }, { "docid": "b7d778b2f8130c1e8dc42c67eb52ea77", "score": "0.53937405", "text": "def show\n @opinion = Opinion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @opinion }\n end\n end", "title": "" }, { "docid": "b7d778b2f8130c1e8dc42c67eb52ea77", "score": "0.53937405", "text": "def show\n @opinion = Opinion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @opinion }\n end\n end", "title": "" }, { "docid": "b7d778b2f8130c1e8dc42c67eb52ea77", "score": "0.53937405", "text": "def show\n @opinion = Opinion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @opinion }\n end\n end", "title": "" }, { "docid": "b7d778b2f8130c1e8dc42c67eb52ea77", "score": "0.53937405", "text": "def show\n @opinion = Opinion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @opinion }\n end\n end", "title": "" }, { "docid": "083f1c84a07877670a05333651221b15", "score": "0.53925455", "text": "def index\n @precipitations = Precipitation.all\n end", "title": "" }, { "docid": "1449ea9c04fa5b39d69589e2189d9b87", "score": "0.5382173", "text": "def index\n @sips = Sip.all\n end", "title": "" }, { "docid": "e17acecd7fd548e1784a98b999ba7394", "score": "0.5381528", "text": "def show\n @punchlist = Punchlist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @punchlist }\n end\n end", "title": "" }, { "docid": "07cd515dcfda01db89c66407f3498d44", "score": "0.53752667", "text": "def show\n @intencion = Intencion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @intencion }\n end\n end", "title": "" }, { "docid": "1281ebcd02849bd1aeb38e2116d6cd97", "score": "0.5372125", "text": "def index\n @indicators = Indicator.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @indicators }\n end\n end", "title": "" }, { "docid": "63a23ab2fbf5c386056c741d36f28586", "score": "0.5369833", "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": "d57fa0b690729a1cb5b30ac229adf2f8", "score": "0.5368333", "text": "def show\n @ip_service = IpService.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @ip_service }\n end\n end", "title": "" }, { "docid": "92c8fdd844dd17fea0b020f17fb339c9", "score": "0.5364984", "text": "def index\n @xps = Xp.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @xps }\n end\n end", "title": "" }, { "docid": "6583ae00d41f43a4ad5096f0870378e8", "score": "0.5357623", "text": "def show\n @residence = Residence.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @residence }\n end\n end", "title": "" }, { "docid": "9a49b25b4e7a6a9bc32b036511d58168", "score": "0.535215", "text": "def index\n @opinions = Opinion.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @opinions }\n end\n end", "title": "" }, { "docid": "7c9c9815cf17665696b804aff2c66ace", "score": "0.5350829", "text": "def index\n @politicians = Politician.all(:order => \"name\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @politicians }\n end\n end", "title": "" }, { "docid": "f3bbf8184dddf3f1d953f71cd70abaa1", "score": "0.5348961", "text": "def show\n @instants = Instants.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instants }\n end\n end", "title": "" }, { "docid": "ffce34f74db4d6405305a1fa6f4db1e5", "score": "0.53481126", "text": "def show\n @population = Population.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @population }\n end\n end", "title": "" }, { "docid": "0d06868790f67c0b9af173f7a51323e2", "score": "0.5345189", "text": "def index\n @cst_pis = CstPis.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @cst_pis }\n end\n end", "title": "" }, { "docid": "d13a63b064d5f86af3268ee14a9a29fd", "score": "0.5342313", "text": "def index\n @nonces = Nonce.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @nonces }\n end\n end", "title": "" }, { "docid": "5a062e460bad276a71c01b9d6010e69f", "score": "0.5335963", "text": "def index\n @opinions = Opinion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @opinions }\n end\n end", "title": "" }, { "docid": "5a062e460bad276a71c01b9d6010e69f", "score": "0.5335963", "text": "def index\n @opinions = Opinion.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @opinions }\n end\n end", "title": "" }, { "docid": "f1851b879a8c9122853d3b091a4d6f48", "score": "0.5334275", "text": "def index\n @initiatives = Initiative.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @initiatives }\n end\n end", "title": "" }, { "docid": "4900bbe7f3ccea080328be6d11b7c5d7", "score": "0.5333282", "text": "def index\n @inscriptions = Inscription.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @inscriptions }\n end\n end", "title": "" }, { "docid": "afb6e09c807006631ad9cc509eeee502", "score": "0.53325754", "text": "def show\n @instancia = Instancia.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instancia }\n end\n end", "title": "" }, { "docid": "7c42dc50753e7821ac7a4b5bcf7dd0f8", "score": "0.53298074", "text": "def show\n @sifi = Sifi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @sifi }\n end\n end", "title": "" }, { "docid": "114d173a75a7750e84885866791ba8f5", "score": "0.5328176", "text": "def list\n\t\t@streets = Street.paginate :page => params[:page], :per_page => 10\t#pagination\n \trespond_to do |format|\n \t\t format.html # show.html.erb\n \t\t\tformat.xml { render :xml => @streets }\t#Render XML Files\n \tend\n\n\tend", "title": "" }, { "docid": "cc328c22ec310c92153636cc3bdcaca1", "score": "0.5327635", "text": "def show\n @instalasi_layanan = InstalasiLayanan.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @instalasi_layanan }\n end\n end", "title": "" }, { "docid": "4e0577798b33ac2ce1465e886f29f185", "score": "0.53271675", "text": "def show\n @inscripcion = Inscripcion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @inscripcion }\n end\n end", "title": "" }, { "docid": "46b1b98d8e1e0315d4f595306cf34bf5", "score": "0.5324286", "text": "def show\n @par_mapping = ParMapping.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @par_mapping }\n end\n end", "title": "" }, { "docid": "e08730945173244d080d0bf1887b4107", "score": "0.5323992", "text": "def xml(options = {})\n host = Picasa.host\n path = Picasa.path(options)\n url = URI(\"#{host}#{path}\")\n\n http = Net::HTTP.new(url.host, url.port)\n http.use_ssl = true\n\n req = add_auth_headers(Net::HTTP::Get.new url.path)\n\n response = http.request(req)\n if response.code =~ /20[01]/\n response.body\n end\n end", "title": "" }, { "docid": "401bb5680556c82f6c7ce2b1c99d47fd", "score": "0.53214943", "text": "def show\n @punch = Punch.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @punch }\n end\n end", "title": "" }, { "docid": "401bb5680556c82f6c7ce2b1c99d47fd", "score": "0.53214943", "text": "def show\n @punch = Punch.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @punch }\n end\n end", "title": "" } ]
b6ef5277c946f7da46874c2b8808f6bd
GET /employeemodels/1 GET /employeemodels/1.json
[ { "docid": "a81945373733e4951b987de6ea99f9a1", "score": "0.0", "text": "def show\n end", "title": "" } ]
[ { "docid": "28a54c8aa8c773a60be2dde2a537de77", "score": "0.758373", "text": "def index\n @employeemodels = Employeemodel.all\n end", "title": "" }, { "docid": "cfada938ff1af3e36010498c05c110e6", "score": "0.71295816", "text": "def set_employeemodel\n @employeemodel = Employeemodel.find(params[:id])\n end", "title": "" }, { "docid": "1e77491152639d3885e619750e892cc9", "score": "0.69844127", "text": "def index\n @employers = Employer.all\n\n render json: @employers\n end", "title": "" }, { "docid": "a665b05d8060b79c165d67ec274c99e8", "score": "0.68311334", "text": "def index\n @employes = Employe.all\n end", "title": "" }, { "docid": "b2aa66572250401444739d4cbc48f3cc", "score": "0.6736628", "text": "def index\n @employements = Employement.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employements }\n end\n end", "title": "" }, { "docid": "082cfc024d4c16ac692d586ff33edab8", "score": "0.6630218", "text": "def index\n @employies = Employie.all\n end", "title": "" }, { "docid": "bff93d9642014e23152db5923b4cf257", "score": "0.66182506", "text": "def index\n render json: Address.where(employer_id: params[:employer_id])\n end", "title": "" }, { "docid": "ad5f17df0deb02f3a6cdac5f940d4aae", "score": "0.6614483", "text": "def index\n @employeenumbers = Employeenumber.all\n end", "title": "" }, { "docid": "bb9bd0b322fb04d9db8120a88a9778a6", "score": "0.6586172", "text": "def show\n @employement = Employement.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employement }\n end\n end", "title": "" }, { "docid": "1bdd8a952d2aa1acc1a3ba2c10d973c9", "score": "0.65795547", "text": "def index\n @employees = Employee.all\n render json: @employees\n end", "title": "" }, { "docid": "469c5150223d3b1eaf8715d1319bea76", "score": "0.6547844", "text": "def index\n @employees = Employee.all\n\n render json: @employees\n end", "title": "" }, { "docid": "4ade05b39f7d77fb32271fd693a20f3c", "score": "0.6508106", "text": "def index\n # @employees = Employee.all\n @employees = @department.employees\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end", "title": "" }, { "docid": "deacc37a9ca1f9ff3cdb9c80a78eeb55", "score": "0.6493758", "text": "def index\n @employers = Employer.all \n end", "title": "" }, { "docid": "2a05a90576e3b6904f6c3cfa267f8e6c", "score": "0.64906937", "text": "def show\n @company = Company.find(params[:company_id])\n @employee = @company.employees.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json\n end\n end", "title": "" }, { "docid": "6baa24774dd4a166a3d6b9c49c063612", "score": "0.64896667", "text": "def show\n @v1_employee = V1::Employee.find(params[:id])\n\n render json: @v1_employee\n end", "title": "" }, { "docid": "4147d1d3231bba31d5c577f49a6e809f", "score": "0.64860106", "text": "def show\n render json: @employee\n end", "title": "" }, { "docid": "6d717221bc0eb5b0e595d9856ebfd091", "score": "0.64696956", "text": "def index\n @employers = Employer.all\n end", "title": "" }, { "docid": "6d717221bc0eb5b0e595d9856ebfd091", "score": "0.64696956", "text": "def index\n @employers = Employer.all\n end", "title": "" }, { "docid": "5647d4cd999acf5f281f2b2394f514fa", "score": "0.6426834", "text": "def index\n \n @employees = Employee.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json=> @employees }\n end\n end", "title": "" }, { "docid": "46e7d46832c6f11101dbce58c898db96", "score": "0.64236104", "text": "def show\n employee_id = params[:id]\n employee = Employee.find(employee_id)\n render json: employee\n end", "title": "" }, { "docid": "524cfc04d07c74bc460cb091b62499e3", "score": "0.6408761", "text": "def index\n @employees = Employee.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end", "title": "" }, { "docid": "4b6adbba03fcb463c36e387963cb177f", "score": "0.6407353", "text": "def index\n if params[:office_id].nil?\n @employees = Employee.all\n else\n @office = Office.find(params[:office_id])\n @employees = @office.employees\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end", "title": "" }, { "docid": "0d8c412c794e2152e9f11b3a4240e1c6", "score": "0.6405584", "text": "def show\n @employee = Employee.find(params[:id])\n render :json => {:employee => @employee}\n end", "title": "" }, { "docid": "89ac05483dd09a909a239a65d6cd81db", "score": "0.6378867", "text": "def show\n @employe = Employe.find(params[:id])\n end", "title": "" }, { "docid": "0a1cba2ae963f1eb86fe11cc9cf44408", "score": "0.6378596", "text": "def get_enterprise\n empresa = Enterprise.find(params[:idEmpresa].to_i)\n\n respond_to do |format|\n format.json {render json: empresa}\n end \n \n end", "title": "" }, { "docid": "fa284c2e9bee299c756e827a8c0b910c", "score": "0.63736814", "text": "def index\r\n @employees = Employee.all\r\n\r\n respond_to do |format|\r\n format.html # index.html.erb\r\n format.json { render json: @employees }\r\n end\r\n end", "title": "" }, { "docid": "fde0182dd6200c835dcbd3c9be6fd579", "score": "0.63712174", "text": "def show\n @employee = current_employee\n @company = Company.where(:id => params[:id]).first\n @company_employee = Employee.where(:company_id => @company.id).first\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @company }\n end\n end", "title": "" }, { "docid": "617ebf1039f2e1264330d2dc4d1de81c", "score": "0.6366001", "text": "def create\n @employeemodel = Employeemodel.new(employeemodel_params)\n\n respond_to do |format|\n if @employeemodel.save\n format.html { redirect_to @employeemodel, notice: 'Employeemodel was successfully created.' }\n format.json { render :show, status: :created, location: @employeemodel }\n else\n format.html { render :new }\n format.json { render json: @employeemodel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4323349b26b430422806409195108453", "score": "0.63425815", "text": "def index\n @employees = Employee.find_all_by_business_id(current_user.id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end", "title": "" }, { "docid": "436ebfea979645b28fb56cdf2464db3b", "score": "0.63394374", "text": "def index\n @municipality = Municipality.find(params[:municipality_id]) \n \t@employees = @municipality.employees\n respond_to do |format|\n format.json { render json: @employees, status: :ok }\n end\n end", "title": "" }, { "docid": "2b83a0d5b99a2890ea8dc7c08e004c51", "score": "0.6322648", "text": "def index\n @employs = Employ.all\n end", "title": "" }, { "docid": "95f27063a3408792aa3bdb177ed22f5b", "score": "0.6311437", "text": "def new\r\n\r\n @employee = Employee.new\r\n @skills = Skill.all\r\n\r\n\r\n\r\n\r\n respond_to do |format|\r\n format.html # new.html.erb\r\n format.json { render json: @employee }\r\n end\r\n end", "title": "" }, { "docid": "51858669213743f3e1e23aebc7df3c91", "score": "0.6310834", "text": "def show\n @role = Role.find(params[:id])\n @employees = @role.employees\n # role = Role.last\n # employees = role.employees\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @role }\n end\n end", "title": "" }, { "docid": "96f6e1191ad0ee8304a10cbffd46f418", "score": "0.62677944", "text": "def getEmployeeDetailsWithAddresses\n\t\trender json: @employee, serializer: EmployeeAddressSerializer\n\tend", "title": "" }, { "docid": "722f9b64b167499bd22c9f64ca411575", "score": "0.62610483", "text": "def index\n @employees = Employee.where(company_id: params[:company_id]).includes(:user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end", "title": "" }, { "docid": "fb4b61851549eed42a32895a442ad4ac", "score": "0.62529415", "text": "def index\n @employees = Employee.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end", "title": "" }, { "docid": "11769af101a528c8b4ebe5bcf57e19d7", "score": "0.6235342", "text": "def index\n @employees = Employee.all\n\n respond_to do |format|\n format.html { render html: @employees }\n format.json { render json: @employees }\n end\n end", "title": "" }, { "docid": "7691fabb6a35c05cbe8698d749312b1f", "score": "0.6218349", "text": "def index\n @employer_infos = EmployerInfo.all\n end", "title": "" }, { "docid": "9f48c0bbf705dd371b683b67b0032041", "score": "0.62136596", "text": "def getEmployeeAddress\n\t\t@employee = Employee.find(params['employee_id'])\n\t\trender json: @employee.addresses\n\tend", "title": "" }, { "docid": "d2048eea5a22fdace6b5f7954ffe6ad8", "score": "0.6183155", "text": "def show\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "d2048eea5a22fdace6b5f7954ffe6ad8", "score": "0.6183155", "text": "def show\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "d2048eea5a22fdace6b5f7954ffe6ad8", "score": "0.6183155", "text": "def show\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "d2048eea5a22fdace6b5f7954ffe6ad8", "score": "0.6183155", "text": "def show\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "d2048eea5a22fdace6b5f7954ffe6ad8", "score": "0.6183155", "text": "def show\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "d2048eea5a22fdace6b5f7954ffe6ad8", "score": "0.6183155", "text": "def show\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "d2048eea5a22fdace6b5f7954ffe6ad8", "score": "0.6183155", "text": "def show\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "d2048eea5a22fdace6b5f7954ffe6ad8", "score": "0.6183155", "text": "def show\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "d2048eea5a22fdace6b5f7954ffe6ad8", "score": "0.6183155", "text": "def show\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "d2048eea5a22fdace6b5f7954ffe6ad8", "score": "0.6183155", "text": "def show\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "e7c2626bbb35a70eef1479fb9e47d5c3", "score": "0.6175025", "text": "def new\n @employee = Employee.new\n @employee.build_user\n @roles = Role.where(name: ['cashier','admin'])\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "8f2f6a3e97eeb5101989478bc28ad06d", "score": "0.61635196", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @employees }\n end\n end", "title": "" }, { "docid": "00311791a85e6d54b9949f554d3cde48", "score": "0.61595017", "text": "def new\n @employement = Employement.new {{ employee_id: params[:employee_id] }}\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employement }\n end\n end", "title": "" }, { "docid": "111388700d524aaa38d7031e14606b0d", "score": "0.6153388", "text": "def index\r\n @employeestatuses = Employeestatus.all\r\n end", "title": "" }, { "docid": "2649499aa8cb315a0e1c09dc991423b0", "score": "0.61457384", "text": "def new\n @employment = Employment.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employment }\n end\n end", "title": "" }, { "docid": "42e09324825887647413bea82e0e58e1", "score": "0.61452436", "text": "def new\n @employ_payment = EmployPayment.new\n @employs = Employ.all\n @bank_accounts = BankAccount.all\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employ_payment }\n end\n end", "title": "" }, { "docid": "e0678098ecdcf40921e19e99005bca95", "score": "0.61360186", "text": "def new\n @employer_profile = EmployerProfile.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employer_profile }\n end\n end", "title": "" }, { "docid": "e29b621aab58a722b5da3f9251771f82", "score": "0.61312157", "text": "def show\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "40eb8f1235a995673c6e8d9b145ac200", "score": "0.61180145", "text": "def show\n @employment_detail = EmploymentDetail.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employment_detail }\n end\n end", "title": "" }, { "docid": "3166a7d62b261f02841c64ced9891cad", "score": "0.6117644", "text": "def show\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @employee }\n end\n end", "title": "" }, { "docid": "3166a7d62b261f02841c64ced9891cad", "score": "0.6117644", "text": "def show\n @employee = Employee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @employee }\n end\n end", "title": "" }, { "docid": "0ff42625d478e6e10cd72c3f75f95a6e", "score": "0.61157763", "text": "def show\n @empolyee = Empolyee.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @empolyee }\n end\n end", "title": "" }, { "docid": "ca536612edd0c8522694a5d50f114157", "score": "0.611038", "text": "def employees_list\n render json: {\n workers: company_employee_list(params[:company_id])\n }\n end", "title": "" }, { "docid": "6ca430f835b908aadea0760cbed12649", "score": "0.61063653", "text": "def show\n\t\n @employee = Employee.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "04b330bce8f6543ce13998b9f700696d", "score": "0.6102015", "text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "04b330bce8f6543ce13998b9f700696d", "score": "0.6102015", "text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "04b330bce8f6543ce13998b9f700696d", "score": "0.6102015", "text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "04b330bce8f6543ce13998b9f700696d", "score": "0.6102015", "text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "04b330bce8f6543ce13998b9f700696d", "score": "0.6102015", "text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "04b330bce8f6543ce13998b9f700696d", "score": "0.6102015", "text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "04b330bce8f6543ce13998b9f700696d", "score": "0.6102015", "text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "04b330bce8f6543ce13998b9f700696d", "score": "0.6102015", "text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "04b330bce8f6543ce13998b9f700696d", "score": "0.6102015", "text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "04b330bce8f6543ce13998b9f700696d", "score": "0.6102015", "text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "04b330bce8f6543ce13998b9f700696d", "score": "0.6102015", "text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "04b330bce8f6543ce13998b9f700696d", "score": "0.6102015", "text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "c99db3c8ada6f8e17ecf4381da483f2c", "score": "0.61017686", "text": "def show\n @employment = Employment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employment }\n end\n end", "title": "" }, { "docid": "521fd419f6d937f5cf5da79df9f62cff", "score": "0.60977674", "text": "def index\n @employeedocuments = Employeedocument.all\n end", "title": "" }, { "docid": "d148e8798dca219fcbd418c16bd43267", "score": "0.60917115", "text": "def index\n @employee = Employee.find(params[:employee_id])\n @request = @employee.requests.all\n end", "title": "" }, { "docid": "33efb15817ee4cd8383f061f7359f21e", "score": "0.60906595", "text": "def new\n @employe = User.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employe }\n end\n end", "title": "" }, { "docid": "9b89789b0c6fb18afa5e989bb4c562f8", "score": "0.60878414", "text": "def show\n @municipality = Municipality.find(params[:municipality_id])\n \t@employee = @municipality.employees.find(params[:id])\n respond_to do |format|\n format.json { render json: @employee, status: :ok }\t\n end \t \t\n end", "title": "" }, { "docid": "15cd1efa2e4652452dc6d1c7e95eb404", "score": "0.6085706", "text": "def show\n @employ_payment = EmployPayment.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employ_payment }\n end\n end", "title": "" }, { "docid": "af6972ca6e919bffd9a62baf0491511c", "score": "0.6065007", "text": "def show\n @previous_employer = PreviousEmployer.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @previous_employer }\n end\n end", "title": "" }, { "docid": "161b51325b8e649386a584a373d35a8f", "score": "0.6064182", "text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @employee }\n end\n end", "title": "" }, { "docid": "161b51325b8e649386a584a373d35a8f", "score": "0.6064182", "text": "def new\n @employee = Employee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @employee }\n end\n end", "title": "" }, { "docid": "11f7d65971adf16f938f5001572e883b", "score": "0.60604024", "text": "def index\n @employees = @company.employees\n end", "title": "" }, { "docid": "0c8de1f811a41e106181dbf1b413e845", "score": "0.6042995", "text": "def index\n\n if @current_user.admin?\n @v1_employees = V1::Employee.all\n else\n @v1_employees = V1::Employee.all.where(company_id: @current_user.company.id)\n end\n\n render json: @v1_employees\n end", "title": "" }, { "docid": "9b66e78ad21199e78d342db20fdcac9d", "score": "0.6040353", "text": "def show\n @employee_record = EmployeeRecord.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @employee_record }\n end\n end", "title": "" }, { "docid": "acecb59acdcaa0335bcda0f93c94cbd1", "score": "0.6034061", "text": "def new\n @employment_detail = EmploymentDetail.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employment_detail }\n end\n end", "title": "" }, { "docid": "f266e9a62e8d3debafc673333c4c6e94", "score": "0.6030346", "text": "def new\n @employee_record = EmployeeRecord.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee_record }\n end\n end", "title": "" }, { "docid": "c1748921c7c0fdb4e337f8b86a3ff798", "score": "0.6026004", "text": "def index\n @absences = @employee.absences\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @absences }\n end\n end", "title": "" }, { "docid": "f67d9dd1e8d304e354b1c164ae85a7f4", "score": "0.60251456", "text": "def index\n @employments = Employment.all\n end", "title": "" }, { "docid": "f67d9dd1e8d304e354b1c164ae85a7f4", "score": "0.60251456", "text": "def index\n @employments = Employment.all\n end", "title": "" }, { "docid": "f67d9dd1e8d304e354b1c164ae85a7f4", "score": "0.60251456", "text": "def index\n @employments = Employment.all\n end", "title": "" }, { "docid": "2e34bb61f0b0f79f14ed093eb3169255", "score": "0.60228753", "text": "def new\n @previous_employer = PreviousEmployer.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @previous_employer }\n end\n end", "title": "" }, { "docid": "e78bd63e8ef19c7d5f74a6cbaf3a498f", "score": "0.60193294", "text": "def self_show\n render json: employee_json(Employee.find(params[:url_id])), status: :ok\n end", "title": "" }, { "docid": "f78a465e069b130afd94c21f887d8c9f", "score": "0.6015652", "text": "def new\n @employee = Employee.new\n \n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @employee }\n end\n end", "title": "" }, { "docid": "9ceb4829d31f9fbd8a8059c9f9690795", "score": "0.60130787", "text": "def new\n @empolyee = Empolyee.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @empolyee }\n end\n end", "title": "" }, { "docid": "2371031d4ce95a4050e465555d35aee7", "score": "0.60106057", "text": "def new\n @employer = Employer.new\n @industries = Industry.find :all\n @geo_positions = GeoPosition.find :all\n #@address = Address.new\n #@towns = Town.find :all\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @employer }\n end\n end", "title": "" }, { "docid": "68a99074ba39f54ee3e8b2cf9bc0cd20", "score": "0.6003091", "text": "def index\n @employee_details = EmployeeDetail.all\n end", "title": "" }, { "docid": "68a99074ba39f54ee3e8b2cf9bc0cd20", "score": "0.6003091", "text": "def index\n @employee_details = EmployeeDetail.all\n end", "title": "" }, { "docid": "408fe9f18bfb14c96efef029060997ca", "score": "0.6001116", "text": "def set_employe\n @employe = Employe.find(params[:id])\n end", "title": "" } ]
560120d61f6f29afc5033b5fada6277a
returns true if the specified user has already made a pick with the specified record
[ { "docid": "50ba9ca03360b20c47c97a96fe73456d", "score": "0.78551924", "text": "def user_result_picked(picks, user_id, record_abbr)\n picks.each { |pick|\n return true if pick.user_id == user_id && pick.my_record_abbreviation == record_abbr\n }\n return false\n end", "title": "" } ]
[ { "docid": "de78c88d6eb3f6240a60c4544629b6df", "score": "0.6401384", "text": "def user_already_has_item_with_name?(record)\n user_item_names(record).include?(record.name.downcase)\n end", "title": "" }, { "docid": "44fb372052108c55b401eb2926044df2", "score": "0.6156375", "text": "def chef_result_picked(picks, chef_id, record_abbr)\n picks.each { |pick|\n return true if pick.chef_id == chef_id && pick.my_record_abbreviation == record_abbr\n }\n return false\n end", "title": "" }, { "docid": "c81a887da1e5c4f1cb5798340e1a32c7", "score": "0.60169053", "text": "def has_valid_psu?(record)\n if record.respond_to?(:psu_id)\n @psus.collect(&:id).include?(record.psu_id)\n else\n true\n end\n end", "title": "" }, { "docid": "f2d78f60fbf1cfc8383fda73566b0960", "score": "0.5964086", "text": "def create?\n Listing.belongs_to_current_user(@user).exists?(@record.listing_id)\n end", "title": "" }, { "docid": "717ecea30880da137a8e7f07b8d592a9", "score": "0.5923221", "text": "def staying_pick_wins?(pick)\n\t\twon?(pick)\n\tend", "title": "" }, { "docid": "e4890749bacb9a8ac2123e5912ea4450", "score": "0.5921628", "text": "def set_user_pick\n @user_pick = UserPick.find(params[:id])\n end", "title": "" }, { "docid": "8617bc36486590b5710125d4ee25fecb", "score": "0.5906633", "text": "def owner?\n record.id == user.id\n end", "title": "" }, { "docid": "d824b69c2742033d4525bc83c93f6884", "score": "0.58813083", "text": "def owned?(user_to_check = current_user)\n user_to_check ? self.creator == user_to_check : false\n end", "title": "" }, { "docid": "ffef79a134c066de11e8cac2b8ea8b8c", "score": "0.58788264", "text": "def editable_by user\n recordings.each do |recording|\n return true if recording.update_common_work_ids.include? user.id\n end\n return false\n end", "title": "" }, { "docid": "7ff396b51aafe3750c5f37b76cc2e615", "score": "0.5859708", "text": "def friend_request_requester?\n friend_request_exists? && friend.requester == record\n end", "title": "" }, { "docid": "d586bedb2a45a11305d52073bb76baec", "score": "0.5855403", "text": "def trade_is_not_a_repeat\n # see if the record has been created, and has an id assigned\n number_that_can_exist = id.nil? ? 0 : 1\n if Offer.where(user_id: user_id, trade_id: trade_id).length > number_that_can_exist\n errors.add(:user_id, \"user has already made an offer for this trade\")\n end\n end", "title": "" }, { "docid": "c9c508b3bc1cda904f2353f1e6fc64c1", "score": "0.58543646", "text": "def check (pick, player) \n if board[pick] == pick + 1\n board[pick] = player.marker\n true\n else\n false\n end\n end", "title": "" }, { "docid": "f024d728dfcbf2b85c7ff2b8e4634317", "score": "0.5842866", "text": "def member?(trip)\n trip.users.include?(self)\n end", "title": "" }, { "docid": "2ceb8d798103b42543fc7ee45a1df4fb", "score": "0.5805585", "text": "def exists?\n uid && ABAddressBook.sharedAddressBook.recordForUniqueId(uid)\n end", "title": "" }, { "docid": "a295f12ba49ea15263e994ed40364905", "score": "0.58034563", "text": "def temp_work_complete?\n user.id == @task_work_offer.task.user.id\n end", "title": "" }, { "docid": "1ad198a40de855ffd3535e67d0ce81ab", "score": "0.5774733", "text": "def creatable_by?(user)\n true\n end", "title": "" }, { "docid": "91b9398cee601b288cf1bcceccd1a3cf", "score": "0.5763526", "text": "def has_been_acquired_by_user?(user)\n current_user_profile = Profile.find_by(user_id: user.id)\n addition = Addition.find_by(profile_id: current_user_profile, story_id: self.id)\n addition != nil\n end", "title": "" }, { "docid": "0533966ec814bc64a10b8e10962b75f7", "score": "0.5746108", "text": "def duplicate_user_assignment?\n self.id != this_user_and_assignment.id && this_user_and_assignment.id != \"\"\n end", "title": "" }, { "docid": "b6f0d925fd1c376a04882b232dffaae2", "score": "0.57196546", "text": "def duplicateable?(user)\n false\n end", "title": "" }, { "docid": "b6f0d925fd1c376a04882b232dffaae2", "score": "0.57196546", "text": "def duplicateable?(user)\n false\n end", "title": "" }, { "docid": "532851c9fac1443cab86ac0b238e314b", "score": "0.5700333", "text": "def correct_pickup\n @user = current_user\n @pickup = Pickup.find(params[:id])\n redirect_to(root_url) unless @pickup.user_id == @user.id\n end", "title": "" }, { "docid": "5672773d40c9b6bfb475d72d3d51de16", "score": "0.5696251", "text": "def saved?\n user_id?\n end", "title": "" }, { "docid": "4e9e0562d68ad177184e9e019c34693c", "score": "0.56612605", "text": "def sender? usr\n usr.id == user_id\n end", "title": "" }, { "docid": "d736bab26112f7d0f94984b6ae417fcd", "score": "0.56597215", "text": "def can_be_restored_by?(user)\n user && self.entry.user_id == user.id\n end", "title": "" }, { "docid": "eee77c65bae183c23b5c89c312533d51", "score": "0.563502", "text": "def user_attempted?(u_id)\n self.attempts.where(:user_id => u_id).any?\n end", "title": "" }, { "docid": "97c0d3d992ff8e40ed7a50185c003998", "score": "0.56246656", "text": "def created_by?(user)\n if @v_id == 1\n circuit = self\n else\n circuit = self.class.find_by_c_id_and_v_id(@c_id, 1)\n end\n circuit.uid == user.uid\n end", "title": "" }, { "docid": "c14c6ea9f45c0fe7d0c6a486f23b67a5", "score": "0.56210417", "text": "def added_by_user?(user)\n @sources.length == 1 && @sources[0].id == user.agent.id\n end", "title": "" }, { "docid": "eaa2dd1c0aefdd6c378ed7a92b189505", "score": "0.5617714", "text": "def ordered_on_behalf_of?\n user_id != created_by\n end", "title": "" }, { "docid": "5a4220ea14b30f542ff813c69a992596", "score": "0.5615908", "text": "def can_be_assigned?(_user)\n false # any user can complete operation\n end", "title": "" }, { "docid": "541fd4d7107ef4cbb1dbb5965ee23fa7", "score": "0.5612948", "text": "def seller? usr\r\n seller_id == usr.id rescue nil\r\n end", "title": "" }, { "docid": "7563dea56d136748b81acda323c4ead5", "score": "0.5608246", "text": "def created_by?(user)\n unless user.nil?\n userid = user.send(BigbluebuttonRails.configuration.user_attr_id)\n self.creator_id == userid\n else\n false\n end\n end", "title": "" }, { "docid": "2fe2655826975e63ffdb2b820a26d60e", "score": "0.5603645", "text": "def user_attempted?(u_id)\n self.attempts.where(user_id: u_id).any?\n end", "title": "" }, { "docid": "29caa6250195ce4891f1841646bf0a89", "score": "0.5602396", "text": "def matched?(other_user)\n matched.include?(other_user)\n end", "title": "" }, { "docid": "c18d56afc3ea179de7d5fa3f50406873", "score": "0.55992484", "text": "def pixter? usr\r\n pixan_id == usr.id rescue nil\r\n end", "title": "" }, { "docid": "0e21c6fe4e9d89181f3b9fb4d15388bf", "score": "0.5589359", "text": "def me?(id)\n\t\tid == @profile.id\n\tend", "title": "" }, { "docid": "f9b51307fb5023b17b30bb9d3d6dbd92", "score": "0.5584717", "text": "def pickup?\n @status == STATUS_PICKUP\n end", "title": "" }, { "docid": "7e591e47b19aa6e98543356b83d73256", "score": "0.55846846", "text": "def owned_by? a_user\n a_user == user\n end", "title": "" }, { "docid": "64eace8de1f67204e9eda5979604be7b", "score": "0.55823386", "text": "def do_you_owe_checker (record)\n\t\tRegister.register_for_payment(record.receiver_id, record.user_id).first.nil?\n end", "title": "" }, { "docid": "6047e80b3df7ad2559407a6996448d2a", "score": "0.5573244", "text": "def has_user(user_id)\n if self.user_id == user_id\n puts 'You are the mod!'\n return false\n end\n last_registered_player_id = self.last_registered_player_id.to_i\n if last_registered_player_id == -1\n puts \"No user are signed up for this game.\"\n return false\n end\n while last_registered_player_id != -1\n curr_player = Player.find(last_registered_player_id)\n if curr_player.user_id == user_id\n return true\n end\n last_registered_player_id = curr_player.prev_player_id\n end\n return false\n end", "title": "" }, { "docid": "392460a14998cbe436adc0dd5c128779", "score": "0.5566738", "text": "def employs?(user)\n employees.include?(user) or (affiliate == user) or user.admin?\n end", "title": "" }, { "docid": "c6e13f32df0b6c6d4691ea91c487f162", "score": "0.5563574", "text": "def sent_by?(user)\n from_user_id == user&.id\n end", "title": "" }, { "docid": "a84ccac03d4acbb58a95aaf243a4c93e", "score": "0.5559909", "text": "def pokemon_taken?(id = $pokemon_party.online_id)\n r = execute('isTaken', id: id)\n log_error(r) unless r == 'yes' || r == 'no'\n return r == 'yes'\n end", "title": "" }, { "docid": "2a528dbfc4bd026ca26dddd91cd5a9d5", "score": "0.5555309", "text": "def checked_out_by?(user) # user.has_tool?\n user_id == user.id if user\n end", "title": "" }, { "docid": "f7a51c5fb757c25b2d44772d07728fe9", "score": "0.5555119", "text": "def valid_user?(user_id)\n user_ids.include?(user_id)\nend", "title": "" }, { "docid": "86156a6341811012e0007dca8a60db43", "score": "0.5554983", "text": "def create_preliminary_result?\n record.unlocked? && view_access?\n end", "title": "" }, { "docid": "19980d41f4189241d558f89f02e49013", "score": "0.5548202", "text": "def account_belongs_to?(user, acct_no)\n acct_user = DB[:Account].where(AcctNo: acct_no).first[:UserID]\n acct_user == user\n end", "title": "" }, { "docid": "cf96232786cf67b99b4c94ab98886ef7", "score": "0.5541107", "text": "def made_request?(user)\n all_users.include?(user)\n end", "title": "" }, { "docid": "cad899c33571a98474f65fe945d2734b", "score": "0.553831", "text": "def user?(jid)\n users.include?(jid.to_s.downcase)\n end", "title": "" }, { "docid": "afd5a2edbdd12025c60d6823540e5dee", "score": "0.5536571", "text": "def user?(user)\n users.include? user\n end", "title": "" }, { "docid": "d4ef8ed76f5d7f7263650656f23d059c", "score": "0.55321157", "text": "def user?(user)\n self.user_id == user.id if user\n end", "title": "" }, { "docid": "d4ef8ed76f5d7f7263650656f23d059c", "score": "0.55321157", "text": "def user?(user)\n self.user_id == user.id if user\n end", "title": "" }, { "docid": "d4ef8ed76f5d7f7263650656f23d059c", "score": "0.55321157", "text": "def user?(user)\n self.user_id == user.id if user\n end", "title": "" }, { "docid": "2cc89cbbf631b054b13be9c203dc7c70", "score": "0.5528961", "text": "def owned_by?(u)\n self.user == u\n end", "title": "" }, { "docid": "baf1ceea2f0cb9d7f7a4dea3c59a5fda", "score": "0.55137914", "text": "def new_user?(seminar,user)\n user = $app_ids[seminar][user].to_s\n user[0] == 48\nend", "title": "" }, { "docid": "14be6f4a577e382b4d432427f16190fc", "score": "0.55128807", "text": "def owned?\n user.present?\n end", "title": "" }, { "docid": "5649687191473a399b2dd106de3ed5dc", "score": "0.5504321", "text": "def completed_by_user?(user)\n completing_interpreters.include?(user)\n end", "title": "" }, { "docid": "2cdd2d61283bbf3f85a08fe611e55449", "score": "0.55019456", "text": "def editable_by?(user)\n\t \t# user && user == owner\n\t user == user\n \tend", "title": "" }, { "docid": "9ddac936628b378f7930bd4dc8d23ee3", "score": "0.54953706", "text": "def member?(user)\n user_ids.include?(user.id)\n end", "title": "" }, { "docid": "916ecd9bf16ff62ad7a18c0b15f007dc", "score": "0.54945296", "text": "def edit?\n Branch.belongs_to_current_user(@user).exists?(@record.id)\n end", "title": "" }, { "docid": "a8f01748237356fd4f62a63ce282604c", "score": "0.5493373", "text": "def me?(id)\n id == @profile.id\n end", "title": "" }, { "docid": "a8f01748237356fd4f62a63ce282604c", "score": "0.5493373", "text": "def me?(id)\n id == @profile.id\n end", "title": "" }, { "docid": "053eba91733a851ad850a0463852b131", "score": "0.54914474", "text": "def editable_by?(user)\n user && self.user_id == user.id\n end", "title": "" }, { "docid": "053eba91733a851ad850a0463852b131", "score": "0.54914474", "text": "def editable_by?(user)\n user && self.user_id == user.id\n end", "title": "" }, { "docid": "955ba0e2f6c9d36df8401f20160e814d", "score": "0.548912", "text": "def valid_pickup_exists?\n if cookies[:pickup_id] && cookies[:key]\n pickup = Pickup.where(id: cookies[:pickup_id]).first\n if pickup && pickup.key == cookies[:key]\n true\n else\n delete_pickup_cookies!\n false\n end\n else\n false\n end\n end", "title": "" }, { "docid": "0ba67688497370234d0625ad38f64646", "score": "0.5484171", "text": "def has_member?(user_or_person)\n user_or_person = user_or_person.try(:person)\n current_people.include? user_or_person\n end", "title": "" }, { "docid": "0ba67688497370234d0625ad38f64646", "score": "0.5484171", "text": "def has_member?(user_or_person)\n user_or_person = user_or_person.try(:person)\n current_people.include? user_or_person\n end", "title": "" }, { "docid": "8c93eced96a04a3705b8ba8c008ea02e", "score": "0.5482478", "text": "def editable_by?(user)\n \tuser && user == owner\n\tend", "title": "" }, { "docid": "41d97f7c3c97a6068f0dfed4ed369c62", "score": "0.5482443", "text": "def show?\n user.id == record.id || user.administrator?\n end", "title": "" }, { "docid": "6ece9dc9c33aec4233976b8dc15ff0f4", "score": "0.5481655", "text": "def subscribing?(other_user)\n subscribing.include?(other_user)\n end", "title": "" }, { "docid": "c7f66016ad0b202283c7ce7d334879a4", "score": "0.5473885", "text": "def checkbox?\n (user.premium? && ( record.user_id == user.id )) || user.admin?\n end", "title": "" }, { "docid": "1f6e30da2dab6ba73ba29fb5cc7c7c46", "score": "0.5469567", "text": "def pick_first?\n @pick_first == \"pickfirst\"\n end", "title": "" }, { "docid": "21499cf30adc1258f2281fa176c8db3d", "score": "0.5458705", "text": "def record_already_exists?\n return @record_already_exists if defined?(@record_already_exists)\n\n @record_already_exists = SecurityEvent.exists?(\n issuer: service_provider.issuer,\n jti: jti,\n user_id: user.id,\n )\n end", "title": "" }, { "docid": "e71332792cefc6fb6f142d344370c7cb", "score": "0.54573625", "text": "def user?(user)\n user.id == self.user_id if user\n end", "title": "" }, { "docid": "e4d590a92168371fa38e04910dec8367", "score": "0.54553026", "text": "def chosen(already, owner, other)\n\t\tif already && already.owner_id == owner.id && current_user\n\t\t\t\"chosen\"\n\t\telse\n\t\t\tother\n\t\tend\n\tend", "title": "" }, { "docid": "2f7b8ce73901e0bd18036f6138ed3709", "score": "0.5455146", "text": "def user_exists(user)\n users.include? user\n end", "title": "" }, { "docid": "f1efbd2da0512d32adf24ec06180f0b9", "score": "0.545039", "text": "def user_meets_criteria?(user)\n user.credits > 0\n end", "title": "" }, { "docid": "ed489ff878d44ddbb66ae7f268193747", "score": "0.5445584", "text": "def duplicate?(person)\n return false if self.id == person.id\n # FIXME: more sophisticated dup check, please\n #self.display_name == person.display_name\n self.firstname == person.firstname\n end", "title": "" }, { "docid": "a2ef65e39d60237cda58cf05dc058759", "score": "0.54444146", "text": "def self_signup?\n user_id == author_id\n end", "title": "" }, { "docid": "99d61d598fc252cb3deaad84ed75bd61", "score": "0.54397964", "text": "def has_member?(user_or_person)\n user_or_person = user_or_person.try(:person)\n people.include? user_or_person\n end", "title": "" }, { "docid": "34f8b410b3316028ce691e52a581ce97", "score": "0.5439281", "text": "def owns?(user_key)\n user_key.user.id == self.id\n end", "title": "" }, { "docid": "dc68f8502ae7d13895429c0a34b3a7ef", "score": "0.54363203", "text": "def signed_up?(person)\n shifts.collect{|shift| shift.signed_up?(person)}.include?(true)\n end", "title": "" }, { "docid": "358c27afbe2f1116ee9aec2e2293e84b", "score": "0.5430064", "text": "def is_owned_by?(user_id)\n self.user_id == user_id\n end", "title": "" }, { "docid": "cde919a890b9d333b081620069c4109b", "score": "0.54265326", "text": "def checkUser(user)\n\treturn getAllUsersWithRoster().include?(user)\nend", "title": "" }, { "docid": "0c7a223b57e1975e1b455bbdfabb80e9", "score": "0.54241836", "text": "def user_can_access_files user\n recordings.each do |recording|\n return true if recording.update_common_work_ids.include? user.id\n end\n return false\n end", "title": "" }, { "docid": "361d152f34a824c626f2ed9f83a8c340", "score": "0.5419586", "text": "def owned_by?(current_user)\n current_user && user_id == current_user.id\n end", "title": "" }, { "docid": "3ac671011fd36aacc025ce6c8510a59b", "score": "0.5417316", "text": "def owner? usr\n user_id == usr.id\n end", "title": "" }, { "docid": "7eae141181b49243d80ccf713bac478c", "score": "0.5414173", "text": "def liked_by?(user)\n likers.exists?(user.id)\n end", "title": "" }, { "docid": "48a680daadfcc741081e1b6cc240c2e1", "score": "0.5413053", "text": "def staff_profile\n staff.id == record.id\n end", "title": "" }, { "docid": "fa77b30a330b9b9ee96b48f29ed6e8cf", "score": "0.54081523", "text": "def recipe_belongs_to_user(user)\n if user.recipes.select {|s| s.users == users}.count > 0\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "9e6fe4c60165d3161307f215ffbc72c2", "score": "0.54068875", "text": "def manually_added?\n if credit_note_items.size == 1\n return true if credit_note_items.first.source_type == 'User'\n end\n false\n end", "title": "" }, { "docid": "8c854aa65180d23d22925da1ea249b82", "score": "0.54040277", "text": "def create?\n Agent.belongs_to_current_user(@user).exists?(@record.agent_id)\n end", "title": "" }, { "docid": "23a8618305a84df7625bf361732e858f", "score": "0.5390571", "text": "def owner?(user_asking)\n user_asking.in? company.owners\n end", "title": "" }, { "docid": "ed36c9702a644f80a03f32e847e9cdd4", "score": "0.5390438", "text": "def friend_request_exists?\n both_user_verified?\n users = Friend.user_sequence(object.id, current_user.id)\n @friend = Friend.find_by(user1_id: users[0], user2_id: users[1])\n @friend.present?\n end", "title": "" }, { "docid": "20c171aba5c15ed094669abc5c0a5a2c", "score": "0.53842306", "text": "def created_by?(check_user)\n return false unless check_user.present?\n return true if check_user.cornerstone_admin?\n self.user && self.user == check_user\n end", "title": "" }, { "docid": "cc6b21d8478468f5f7f36ec3422fb491", "score": "0.53807265", "text": "def show\n if @call.user.nil?\n @taken = false\n elsif @call.user == current_user || current_user.issuper?\n @taken = true\n else\n redirect_to :root, notice: CALL_ERROR\n end\n end", "title": "" }, { "docid": "bb194c1e0037dddf751bd8d81d2b2786", "score": "0.5377671", "text": "def has_member?(user)\n users.include?(user)\n end", "title": "" }, { "docid": "f4b37f72aabc98a2bce8ab89643d357b", "score": "0.53728896", "text": "def staff_owned_gate?\n record.check_points.where(registrar: user).map(&:gate?).reduce(:|)\n end", "title": "" }, { "docid": "452e24468823c497705043f4fab3f6c2", "score": "0.5369", "text": "def has_user?(user)\n self.users.include?(user)\n end", "title": "" }, { "docid": "d2a9987daf24c3f721e8dc46d0360354", "score": "0.5368773", "text": "def owned_by?(student)\n student.id == self.student_id\n end", "title": "" }, { "docid": "86c22dc9bb41508865c852bb1f4e162c", "score": "0.5365984", "text": "def reviewing?(other_user)\n reviewing.include?(other_user)\n end", "title": "" } ]
658451d145d170b362581c5b634a2186
PUT /nvs_goal_types/1 PUT /nvs_goal_types/1.json
[ { "docid": "1d19e50c545b85f7c7952241a85854dc", "score": "0.7215835", "text": "def update\n @nvs_goal_type = NvsGoalType.find(params[:id])\n\n respond_to do |format|\n if @nvs_goal_type.update_attributes(params[:nvs_goal_type])\n format.html { redirect_to @nvs_goal_type, notice: 'Nvs goal type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @nvs_goal_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "90024d719dedac4a95a70fc1510dcb6e", "score": "0.65126395", "text": "def create\n @nvs_goal = NvsGoal.new(params[:nvs_goal])\n @nvs_goal.project_id = @project\n @nvs_goal.created_by = User.current\n\n respond_to do |format|\n if @nvs_goal.save\n format.html { redirect_to @nvs_goal, notice: 'Nvs goal was successfully created.' }\n format.json { render json: @nvs_goal, status: :created, location: @nvs_goal }\n else\n @nvs_goal_types = NvsGoalType.all.map{|x| [x.name, x.id]}\n format.html { render action: \"new\" }\n format.json { render json: @nvs_goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5d3efce47db0ce1c3266c63af8bb0632", "score": "0.6499156", "text": "def update\n @goal_type = GoalType.find(params[:id])\n\n respond_to do |format|\n if @goal_type.update_attributes(params[:goal_type])\n flash[:notice] = 'GoalType was successfully updated.'\n format.html { redirect_to(@goal_type) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @goal_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "18cdaef3060b5d98515ff8942ef36ade", "score": "0.63089", "text": "def update\n @nvs_goal = NvsGoal.find(params[:id])\n respond_to do |format|\n if @nvs_goal.update_attributes(params[:nvs_goal])\n format.html { redirect_to @nvs_goal, notice: 'Nvs goal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @nvs_goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3bb2f6deaca592b811b3d79c00d76d5", "score": "0.60637724", "text": "def create\n @nvs_goal_type = NvsGoalType.new(params[:nvs_goal_type])\n @nvs_goal_type.created_by = User.current\n respond_to do |format|\n if @nvs_goal_type.save\n format.html { redirect_to @nvs_goal_type, notice: 'Nvs goal type was successfully created.' }\n format.json { render json: @nvs_goal_type, status: :created, location: @nvs_goal_type }\n else\n format.html { render action: \"new\" }\n format.json { render json: @nvs_goal_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e392b3e94167617f55483f9f509abb66", "score": "0.59865195", "text": "def update_entity_type(entity_type_id, request)\n start.uri('/api/entity/type')\n .url_segment(entity_type_id)\n .body_handler(FusionAuth::JSONBodyHandler.new(request))\n .put()\n .go()\n end", "title": "" }, { "docid": "bde445e398efeba5d3afa1ecc9d05d4d", "score": "0.59842104", "text": "def destroy\n @nvs_goal_type = NvsGoalType.find(params[:id])\n @nvs_goal_type.destroy\n\n respond_to do |format|\n format.html { redirect_to nvs_goal_types_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c2b407ce70110adcc9b65894302c9e96", "score": "0.5909787", "text": "def goal_types\n @client.request_cmd(\n {\n 'goal_types_get_list' => 1,\n 'app_version' => @version\n }\n )\n end", "title": "" }, { "docid": "548ba1babbcdb78511c04a317bf5c979", "score": "0.58739114", "text": "def update\n json_update(factType,factType_params, FactType)\n end", "title": "" }, { "docid": "d9a3bb8a7c0d475a677d11bf3fc37c82", "score": "0.57943964", "text": "def index\n @nvs_goal_types = NvsGoalType.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @nvs_goal_types }\n end\n end", "title": "" }, { "docid": "0b41b07b4a04bc240de1ee17721aee79", "score": "0.5787839", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to '/misc_tasks', notice: 'Goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3faaa4940de03fb2e3af1071f9d27920", "score": "0.5777781", "text": "def update\n respond_to do |format|\n if @opportunity_type.update(opportunity_type_params)\n format.html { redirect_to @opportunity_type, notice: 'Opportunity type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @opportunity_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f292935cecd0695818235dd93ce7f79e", "score": "0.5755088", "text": "def new\n @nvs_goal_type = NvsGoalType.new\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @nvs_goal_type }\n end\n end", "title": "" }, { "docid": "c1b0c529a224b620c75599b0288f8599", "score": "0.5701207", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to @goal, notice: \"Goal was successfully updated.\" }\n format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5eea1b8fd12864429064b0714f3640b5", "score": "0.5689632", "text": "def update\n respond_to do |format|\n if @goal.update_attributes(params[:goal])\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c3370acf2ca3457b954e16e32da81d0d", "score": "0.56823915", "text": "def update\n if @goal.update(goal_params)\n render :show, status: :ok, location: @goal\n else\n render json: @goal.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ffe018214fb176e9cbba13c0e8c1efc7", "score": "0.5676169", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to @goal, notice: 'Goal goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c042ad4d6d29aaae7728dba75fcd079d", "score": "0.56732285", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c042ad4d6d29aaae7728dba75fcd079d", "score": "0.56732285", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c042ad4d6d29aaae7728dba75fcd079d", "score": "0.56732285", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c042ad4d6d29aaae7728dba75fcd079d", "score": "0.56732285", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c042ad4d6d29aaae7728dba75fcd079d", "score": "0.56732285", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c042ad4d6d29aaae7728dba75fcd079d", "score": "0.56732285", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c042ad4d6d29aaae7728dba75fcd079d", "score": "0.56732285", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c042ad4d6d29aaae7728dba75fcd079d", "score": "0.56732285", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c042ad4d6d29aaae7728dba75fcd079d", "score": "0.56732285", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c042ad4d6d29aaae7728dba75fcd079d", "score": "0.56732285", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5c00d06ddd45b1458ed60ec503a8a07", "score": "0.5670869", "text": "def update\n respond_to do |format|\n if @type_of_aggression.update(type_of_aggression_params)\n format.html { redirect_to @type_of_aggression, notice: 'Type of aggression was successfully updated.' }\n format.json { render :show, status: :ok, location: @type_of_aggression }\n else\n format.html { render :edit }\n format.json { render json: @type_of_aggression.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2296bfc21e15378b48aba4daaa9f74cc", "score": "0.56692314", "text": "def update\n respond_to do |format|\n if @visa_type.update(visa_type_params)\n format.html { redirect_to admin_visa_types_path, notice: 'Visa type was successfully updated.' }\n format.json { render :show, status: :ok, location: @visa_type }\n else\n format.html { render :edit }\n format.json { render json: @visa_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "193d471685900d9fd14f76d3f57e9b2f", "score": "0.5644247", "text": "def update\n respond_to do |format|\n if @story_type.update(story_type_params)\n format.html { redirect_to @story_type, notice: 'Story type was successfully updated.' }\n format.json { render :show, status: :ok, location: @story_type }\n else\n format.html { render :edit }\n format.json { render json: @story_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ff04bed748562e958c70cff3e8994d84", "score": "0.56409377", "text": "def goal_params\n params.require(:goal).permit(:name, :goal_type, :status, :nature, :unit, :target, :assessment_id, {position_ids: []})\n end", "title": "" }, { "docid": "5523e16ec9ec9a2eef994f120537a971", "score": "0.5629385", "text": "def update\r\n respond_to do |format|\r\n if @goal.update(goal_params)\r\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\r\n format.json { render :show, status: :ok, location: @goal }\r\n else\r\n format.html { render :edit }\r\n format.json { render json: @goal.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "7b4cacd83df5b47fa0a4118b2700b67b", "score": "0.5628163", "text": "def update\n respond_to do |format|\n if @visa_type.update(visa_type_params)\n format.html { redirect_to @visa_type, notice: \"Visa type was successfully updated.\" }\n format.json { render :show, status: :ok, location: @visa_type }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @visa_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "577ca3b5e132f3de28ca0632f6f0e2df", "score": "0.56216735", "text": "def update\n respond_to do |format|\n if @team_goal.update(team_goal_params)\n format.html { redirect_to @team_goal, notice: 'Team goal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @team_goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0d6fe695a22eece3b82a54388ea637d", "score": "0.5616913", "text": "def update\n respond_to do |format|\n if @turn_type.update(turn_type_params)\n format.html { redirect_to turn_types_path, notice: 'Turn type was successfully updated.' }\n format.json { render :show, status: :ok, location: @turn_type }\n else\n format.html { render :edit }\n format.json { render json: @turn_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0160a07acfc233ba2f4b2306dcf02200", "score": "0.5608133", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0160a07acfc233ba2f4b2306dcf02200", "score": "0.5608133", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0160a07acfc233ba2f4b2306dcf02200", "score": "0.5608133", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "54d23a35908cfb9a7ffd4a86624c81a7", "score": "0.56072104", "text": "def update\n @task_type = TaskType.find(params[:id])\n\n respond_to do |format|\n if @task_type.update_attributes(params[:task_type])\n format.html { redirect_to @task_type.project, notice: 'Tipo de Tarefa atualizado com sucesso.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @task_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2028b93260fcf75039bd5993a5d43886", "score": "0.56029433", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to new_goal_path, notice: 'Goal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dd1ea3753c30c858625ea9d51da496f3", "score": "0.55994225", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to goals_path, notice: 'Goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e9ad56ba59629f2b8f5ff23e0c9d9f3b", "score": "0.55963594", "text": "def show\n @nvs_goal_type = NvsGoalType.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @nvs_goal_type }\n end\n end", "title": "" }, { "docid": "89210cf1608444259b1f363004c7f534", "score": "0.55960125", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to :goals, \n notice: \"<p>Your goal was successfully updated. Go get it!</p>#{view_context.tweet_your_goal_button(@goal)}\".html_safe }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "642714f41b47f471adb69c861995c935", "score": "0.55933833", "text": "def update\n respond_to do |format|\n if @turn_type.update(turn_type_params)\n format.html { redirect_to turn_types_path, notice: 'Тип смены был обновлен.' }\n format.json { render :show, status: :ok, location: @turn_type }\n else\n format.html { render :edit }\n format.json { render json: @turn_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "94babfb8b9e25c0d3b12b1e0470b238a", "score": "0.5583806", "text": "def update\n respond_to do |format|\n if @goal.update(goal_params)\n format.html { redirect_to goal_path(@goal), notice: 'Goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @goal }\n else\n format.html { render :edit }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6113a23cbf951b9880cae8721f7ba2c4", "score": "0.5583651", "text": "def update\n @type = Type.find(params[:id])\n\n respond_to do |format|\n if @type.update_attributes(params[:type])\n format.html { redirect_to types_path, notice: 'Type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9edc6581f7ca4b0c959c5449cba0904e", "score": "0.55791974", "text": "def create\n @goal_type = GoalType.new(params[:goal_type])\n\n respond_to do |format|\n if @goal_type.save\n flash[:notice] = 'GoalType was successfully created.'\n format.html { redirect_to(@goal_type) }\n format.xml { render :xml => @goal_type, :status => :created, :location => @goal_type }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @goal_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ed19239c1f2b611901a14abf46a0dda", "score": "0.5563443", "text": "def update\n @verb_type = VerbType.find(params[:id])\n\n respond_to do |format|\n if @verb_type.update_attributes(params[:verb_type])\n format.html { redirect_to @verb_type, notice: 'Verb type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @verb_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23fb3b28fa137017da47242ba8f9282c", "score": "0.5561622", "text": "def update\n respond_to do |format|\n if @goal_update.update(goal_update_params)\n format.html { redirect_to [@goal, @goal_update], notice: 'Goal update was successfully updated.' }\n format.json { render :show, status: :ok, location: @goal_update }\n else\n format.html { render :edit }\n format.json { render json: @goal_update.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c1ce37391efb1725d5ad8dfc631e0c25", "score": "0.555956", "text": "def update\n @goal = Goal.find(params[:id])\n\n respond_to do |format|\n if @goal.update_attributes(params[:goal])\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c1ce37391efb1725d5ad8dfc631e0c25", "score": "0.555956", "text": "def update\n @goal = Goal.find(params[:id])\n\n respond_to do |format|\n if @goal.update_attributes(params[:goal])\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c1ce37391efb1725d5ad8dfc631e0c25", "score": "0.555956", "text": "def update\n @goal = Goal.find(params[:id])\n\n respond_to do |format|\n if @goal.update_attributes(params[:goal])\n format.html { redirect_to @goal, notice: 'Goal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a16fc9eddfe2bdcd8ce72dbcd36cbe20", "score": "0.5558453", "text": "def update\n respond_to do |format|\n if @tournament_type.update(tournament_type_params)\n format.html { redirect_to @tournament_type, notice: 'Tournament type was successfully updated.' }\n format.json { render :show, status: :ok, location: @tournament_type }\n else\n format.html { render :edit }\n format.json { render json: @tournament_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3cb86f1467829bf83f6bdc9da32f32ed", "score": "0.55533063", "text": "def goal_params\n params.require(:goal).permit(:title, :description, :achievement, :date, :horizon, :parent_goal_id, :term)\n end", "title": "" }, { "docid": "5e2886bdfc603ad400d63723930c6d7d", "score": "0.55504245", "text": "def update\n respond_to do |format|\n if @team_type.update(team_type_params)\n format.html { redirect_to @team_type, notice: 'Team type was successfully updated.' }\n format.json { render :show, status: :ok, location: @team_type }\n else\n format.html { render :edit }\n format.json { render json: @team_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0341337f5e186db943337714116630ee", "score": "0.554711", "text": "def update\n\n @goals = Goal.all\n @my_custom_goals = my_custom_goals\n @user_goal = my_goals.find(params[:id])\n\n respond_to do |format|\n if @user_goal.update_attributes(params[:users_goal])\n format.html { redirect_to action: 'new', notice: 'Users goal was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "470369b7ff586fc5881b51a88bb20440", "score": "0.55388415", "text": "def update\n authorize! :update, CompetenceType\n @competence_type.update!(competence_type_params)\n render json: {status: :ok}\n end", "title": "" }, { "docid": "1317fe9ee9261995a3c38389ade72579", "score": "0.5536464", "text": "def update\n respond_to do |format|\n if @type.update(type_params)\n format.html { redirect_to @type, notice: 'Type was successfully updated.' }\n format.json { render :show, status: :ok, location: @type }\n else\n format.html { render :edit }\n format.json { render json: @type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1317fe9ee9261995a3c38389ade72579", "score": "0.5536464", "text": "def update\n respond_to do |format|\n if @type.update(type_params)\n format.html { redirect_to @type, notice: 'Type was successfully updated.' }\n format.json { render :show, status: :ok, location: @type }\n else\n format.html { render :edit }\n format.json { render json: @type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b12024c410e22b010326862c849f5e5", "score": "0.5534879", "text": "def update\n @story_type = StoryType.find(params[:id])\n\n respond_to do |format|\n if @story_type.update_attributes(params[:story_type])\n format.html { redirect_to @story_type, notice: 'Story type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @story_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8c7ec61506af7532dd9050d8029a75b", "score": "0.55250365", "text": "def goals_id_put_with_http_info(id, goal_type, expected_type, period, expected, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug \"Calling API: GoalsApi.goals_id_put ...\"\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 GoalsApi.goals_id_put\"\n end\n # verify the required parameter 'goal_type' is set\n if @api_client.config.client_side_validation && goal_type.nil?\n fail ArgumentError, \"Missing the required parameter 'goal_type' when calling GoalsApi.goals_id_put\"\n end\n # verify the required parameter 'expected_type' is set\n if @api_client.config.client_side_validation && expected_type.nil?\n fail ArgumentError, \"Missing the required parameter 'expected_type' when calling GoalsApi.goals_id_put\"\n end\n # verify the required parameter 'period' is set\n if @api_client.config.client_side_validation && period.nil?\n fail ArgumentError, \"Missing the required parameter 'period' when calling GoalsApi.goals_id_put\"\n end\n # verify the required parameter 'expected' is set\n if @api_client.config.client_side_validation && expected.nil?\n fail ArgumentError, \"Missing the required parameter 'expected' when calling GoalsApi.goals_id_put\"\n end\n # resource path\n local_var_path = \"/goals/{id}\".sub('{' + 'id' + '}', id.to_s)\n\n # query parameters\n query_params = {}\n\n # header parameters\n header_params = {}\n\n # form parameters\n form_params = {}\n form_params[\"goal_type\"] = goal_type\n form_params[\"expected_type\"] = expected_type\n form_params[\"period\"] = period\n form_params[\"expected\"] = expected\n form_params[\"user_id\"] = opts[:'user_id'] if !opts[:'user_id'].nil?\n form_params[\"stage_id\"] = opts[:'stage_id'] if !opts[:'stage_id'].nil?\n form_params[\"currency\"] = opts[:'currency'] if !opts[:'currency'].nil?\n form_params[\"pipeline_id\"] = opts[:'pipeline_id'] if !opts[:'pipeline_id'].nil?\n\n # http body (model)\n post_body = nil\n auth_names = [ 'access_token' ]\n response = @api_client.call_api(:PUT, local_var_path,\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: GoalsApi#goals_id_put\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return response\n end", "title": "" }, { "docid": "e9b2c3a3384fabf68457faff1e771476", "score": "0.55241424", "text": "def goal_params\n params.require(:goal).permit(:id, :title, :kind, :frequency, :minimum)\n end", "title": "" }, { "docid": "4bafd6db07983daa97163294b9f3f077", "score": "0.55233896", "text": "def update\n respond_to do |format|\n if @strategic_goal.update(strategic_goal_params)\n format.html { redirect_to @strategic_goal, notice: 'Strategic goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @strategic_goal }\n else\n format.html { render :edit }\n format.json { render json: @strategic_goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a9226a523309225598228fe67203738d", "score": "0.5521752", "text": "def update\n @goal = Goal.find(params[:id])\n\n if @goal.update(run_params)\n head :no_content\n else\n render json: @goal.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "8df03d5b049a724c22efabe3470de99e", "score": "0.55121696", "text": "def update\n if @plan_type.update(plan_type_params)\n respond_with(@plan_type, location: plan_types_url, notice: 'Plan type was successfully updated.')\n else\n respond_with(@plan_type)\n end\n end", "title": "" }, { "docid": "9fe6548e2a6f4358409a7e4e5254e128", "score": "0.5510578", "text": "def put_programtransfers_types_typetoken_with_http_info(type_token, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: ProgramTransfersApi.put_programtransfers_types_typetoken ...'\n end\n # verify the required parameter 'type_token' is set\n if @api_client.config.client_side_validation && type_token.nil?\n fail ArgumentError, \"Missing the required parameter 'type_token' when calling ProgramTransfersApi.put_programtransfers_types_typetoken\"\n end\n # resource path\n local_var_path = '/programtransfers/types/{type_token}'.sub('{' + 'type_token' + '}', CGI.escape(type_token.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'body'])\n\n # return_type\n return_type = opts[:debug_return_type] || 'ProgramTransferTypeReponse'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || []\n\n new_options = opts.merge(\n :operation => :\"ProgramTransfersApi.put_programtransfers_types_typetoken\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:PUT, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: ProgramTransfersApi#put_programtransfers_types_typetoken\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "c00c683db0f6a4c62c033d3442dee33a", "score": "0.5503278", "text": "def update\n @type = Type.find(params[:id])\n\n respond_to do |format|\n if @type.update_attributes(params[:type])\n format.html { redirect_to @type, notice: 'Type was successfully updated!' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab182ab36da8574489254d9895d02ab7", "score": "0.5497327", "text": "def update\n respond_to do |format|\n if @global_goal.update(global_goal_params)\n format.html { redirect_to @global_goal, notice: 'Global goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @global_goal }\n else\n format.html { render :edit }\n format.json { render json: @global_goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dd5642a234beb0f953537ad5732ea08d", "score": "0.5488201", "text": "def update\n @goal = Goal.find(params[:id])\n\n respond_to do |format|\n if @goal.update_attributes(params[:goal])\n format.html { redirect_to welcome_home_path, notice: 'Goal was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d179db3209f83396add42d95d429cbb", "score": "0.5487477", "text": "def update\n @ot_type = OtType.find(params[:id])\n\n respond_to do |format|\n if @ot_type.update_attributes(params[:ot_type])\n format.html { redirect_to @ot_type, notice: 'Ot type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @ot_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4fca9c4a881cb9033da37aac0df9b415", "score": "0.54849285", "text": "def goal_params\n params.require(:goal).permit(:tags, :image, :description, :category_id, :status)\n end", "title": "" }, { "docid": "1893d262feebca70629795b8e6192e80", "score": "0.5484793", "text": "def update_type\n\t\tfname= \"#{self.class.name}.#{__method__}\"\n\t\t#LOG.debug(fname){\"params=#{params.inspect}\"}\n\t\t@object_plm = Project.find(params[:id])\n\t\t@types_access = Typesobject.get_types(\"project_typeaccess\")\n\t\tctrl_update_type @object_plm, params[:object_type]\n\tend", "title": "" }, { "docid": "2121a993ab239ee48d2321a354c55414", "score": "0.5482938", "text": "def goal_params\n params.require(:goal).permit(:user_id, :type_goal_id, :frequency, :goal, :time_started, :time_finished,:automatic_goal, :progress, :complete)\n end", "title": "" }, { "docid": "96c7032d26ced78f7cdd50eb716b0512", "score": "0.54690534", "text": "def update\n respond_to do |format|\n if @planning_status_type.update(planning_status_type_params)\n format.html { redirect_to @planning_status_type, notice: 'Planning status type was successfully updated.' }\n format.json { render :show, status: :ok, location: @planning_status_type }\n else\n format.html { render :edit }\n format.json { render json: @planning_status_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2e6b6edcae5b40a4b4dfa9a995be22a5", "score": "0.5467907", "text": "def update\n respond_to do |format|\n if @scheme_type.update(scheme_type_params)\n format.html { redirect_to scheme_types_path, notice: 'Entity status was successfully updated.' }\n format.json { render :show, status: :ok, location: @scheme_type }\n else\n format.html { render :edit }\n format.js { render :edit }\n format.json { render json: @scheme_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7584d4ba41f111ec08dd58483f2cb435", "score": "0.5467393", "text": "def update\n Type.find(params[:type][:id]).update(title: params[:type][:title])\n redirect_to URI.escape(\"/types\")\n end", "title": "" }, { "docid": "6d0beff16b2243e742a48db360722bda", "score": "0.54668397", "text": "def update\n @type_task = TypeTask.find(params[:id])\n\n respond_to do |format|\n if @type_task.update_attributes(params[:type_task])\n format.html { redirect_to @type_task, notice: 'Type task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @type_task.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f9867b7b2444ba884aefa0bdf4f6d86c", "score": "0.54656607", "text": "def update\n @pre_category = @story.category\n type = params[@story.type.downcase][:type]\n @story.type = type\n\n respond_to do |format|\n if @story.update_attributes(params[@story.type.downcase])\n @message = \"#{@story.type} was updated\"\n @story = Object.const_get(type).find(@story.id)\n format.js { render :template => 'stories/action_success' }\n format.html { redirect_to(project_url(@story.project), :notice => @story.type + ' was successfully updated.') }\n format.xml { head :ok }\n else\n format.js { render :template => 'stories/error' }\n format.html { redirect_to(project_url(@story.project), :notice => @story.type + ' ERROR.') }\n format.xml { render :xml => @story.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "46c1c78269f3af246d42d38e3cea94c8", "score": "0.54639816", "text": "def update\n @annotation_type = AnnotationType.find(params[:id])\n\n respond_to do |format|\n if @annotation_type.update_attributes(params[:annotation_type])\n format.html { redirect_to @annotation_type, :notice => 'Annotation type was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @annotation_type.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0329507aca2d3bb7b6a62d0d7de9168d", "score": "0.5463601", "text": "def team_goal_params\n params.require(:team_goal).permit(:team_id, :goal_id)\n end", "title": "" }, { "docid": "ef539644b3eeab9c3327114dec25511a", "score": "0.54615533", "text": "def update\n respond_to do |format|\n if @agent_type.update(agent_type_params)\n format.html { redirect_to @agent_type, notice: 'Agent type was successfully updated.' }\n format.json { render :show, status: :ok, location: @agent_type }\n else\n format.html { render :edit }\n format.json { render json: @agent_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9f927d84edb7577ca088aed859f22940", "score": "0.5459557", "text": "def update\n respond_to do |format|\n if @operational_goal.update(operational_goal_params)\n format.html { redirect_to @operational_goal, notice: 'Operational goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @operational_goal }\n else\n format.html { render :edit }\n format.json { render json: @operational_goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "14c831741ac71491403c6e5f859a5dd7", "score": "0.5458198", "text": "def update\n @goal_instance = GoalInstance.find(params[:id])\n\n respond_to do |format|\n if @goal_instance.update_attributes(params[:goal_instance])\n format.html { redirect_to @goal_instance, notice: 'Goal instance was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @goal_instance.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "98e37c8814aa297a2ab9baf55ce2f7e4", "score": "0.5455002", "text": "def resourceType\n 'Goal'\n end", "title": "" }, { "docid": "4ae80ac96cab2d7f5a23a5573a457c6c", "score": "0.54549533", "text": "def update\n if @type_activity.update(type_activity_params)\n render json: @type_activity, status: :ok#, location: @type_activity\n else\n render json: @type_activity.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "6055aee49acf8a97f04b8b7aa6a24c94", "score": "0.5453073", "text": "def set_type_of_aggression\n @type_of_aggression = TypeOfAggression.find(params[:id])\n end", "title": "" }, { "docid": "cfbbaf073f5e472b8fc42737750c2df9", "score": "0.5451718", "text": "def update\n @life_goal = LifeGoal.find(params[:id])\n @life_goal.update_attributes(params[:life_goal])\n redirect_to_index_or_todo_list\n end", "title": "" }, { "docid": "6e233529c3d7b45c9c2e44799e0abae4", "score": "0.54517055", "text": "def update\n respond_to do |format|\n if @type.update(type_params)\n format.html { redirect_to @type, notice: 'Type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "10c2d9572f8e42d42d88a834b07c87be", "score": "0.544506", "text": "def update\n respond_to do |format|\n if @phase_type_default_has_phyase_type.update(phase_type_default_has_phyase_type_params)\n format.html { redirect_to @phase_type_default_has_phyase_type, notice: 'Phase type default has phyase type was successfully updated.' }\n format.json { render :show, status: :ok, location: @phase_type_default_has_phyase_type }\n else\n format.html { render :edit }\n format.json { render json: @phase_type_default_has_phyase_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ac2ea7ce84bf1fd39d0e8ab973667c6b", "score": "0.5442647", "text": "def update\n event_type = EventType.find(params[:id])\n if event_type.update(event_type_params)\n render json: event_type, status: 200, location: [:api, event_type]\n else\n failed_to_update(event_type, \"event_type\")\n end\n end", "title": "" }, { "docid": "1e55dc6c165952ccb74b49d011b2a1e5", "score": "0.5442611", "text": "def update\n respond_to do |format|\n if @mission_type.update(mission_type_params)\n format.html { redirect_to [:admin, @mission_type], notice: 'Mission type was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @mission_type.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "551876b5ec493785a04538956eb2d4dd", "score": "0.5441093", "text": "def update\n respond_to do |format|\n if @sgoa_store_goal.update(sgoa_store_goal_params)\n format.html { redirect_to @sgoa_store_goal, notice: 'Sgoa store goal was successfully updated.' }\n format.json { render :show, status: :ok, location: @sgoa_store_goal }\n else\n format.html { render :edit }\n format.json { render json: @sgoa_store_goal.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5440549", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5440549", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5440549", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5440549", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5440549", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5440549", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5440549", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5440549", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" }, { "docid": "604f99b3d09e917590568578fb8ae912", "score": "0.5440549", "text": "def update!(**args)\n @type = args[:type] if args.key?(:type)\n end", "title": "" } ]
a12198182d9dec35ef6e9a650f5eff88
DELETE /sfprojects/1 DELETE /sfprojects/1.json
[ { "docid": "1dd861c98429fcbc2eadefd67c7d00d6", "score": "0.74818355", "text": "def destroy\n @sfproject.destroy\n respond_to do |format|\n format.html { redirect_to sfprojects_url, notice: 'Sfproject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "7ddc4c6f1bc07f28aa0ff6637e66ea9c", "score": "0.75831956", "text": "def destroy #BigCal\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5ee7238ce849a8cbaa111b2e1ea9b52c", "score": "0.7462655", "text": "def destroy\n @project1.destroy\n respond_to do |format|\n format.html { redirect_to project1s_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ce10449f9ce0fd62fdc6ce11492b8372", "score": "0.7436387", "text": "def destroy\n @root = \"projects\"\n \n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2395db8e8b2d56dc1e97347626464cb3", "score": "0.74180967", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c730619a7991376885d16cbd7b34af50", "score": "0.7394585", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n render json: {success: \"ok\"}\n\n end", "title": "" }, { "docid": "cdcb38e29615ebc7477327c5894ec0ff", "score": "0.73268026", "text": "def destroy\n @fp7_project.destroy\n respond_to do |format|\n format.html { redirect_to fp7_projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "60a544d961c8173ff15fcc39ba007802", "score": "0.7304031", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "42d8b48d73202aa1bccbeb209d54d5e5", "score": "0.7296324", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "de7ddd0ca9e3a8be596a657d2b24ed43", "score": "0.72959006", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to all_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2330747e87e44478de53741c26ec860f", "score": "0.7294109", "text": "def destroy\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "6599786f76437bfb8cad054117b62516", "score": "0.7292727", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to root_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "59c1acce22d8f40a0925ef79aacb26d8", "score": "0.7289372", "text": "def destroy\n \n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bcf2097a1848d19218b83b388767c41f", "score": "0.72872263", "text": "def destroy\n\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "eadbd01494fbad9880ba875d8bd2c42a", "score": "0.72782296", "text": "def destroy\n\t @project = Project.find(params[:id])\n\t @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5a87db64a50e6e799cb5a94dd63ff578", "score": "0.7277603", "text": "def destroy\n @project.destroy\n repsond_with @project\n # respond_to do |format|\n # format.html { redirect_to projects_url }\n # format.json { head :no_content }\n # end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "7ba4889a15628c4629b9f8f695ce054b", "score": "0.72773993", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a809d1ae1dd08d58ca817e5311290c28", "score": "0.726925", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to cms_projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "fa8e493c4806616aad00a5c22581f2c3", "score": "0.7262217", "text": "def destroy\n @title = \"Уничтожение проекта\"\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "96b739784db2b853553bec8d1263870e", "score": "0.7260353", "text": "def destroy\n @smallproject.destroy\n respond_to do |format|\n format.html { redirect_to smallprojects_url, notice: 'Smallproject was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "966ce26fc9ab8c602a4080ab3790e68e", "score": "0.7256277", "text": "def delete_project\n Task.where(:project_id => params['project_id']).each do |delete|\n delete.destroy\n end\n Project.find(params['project_id']).destroy\n render json: {success: true}\n end", "title": "" }, { "docid": "f94f5218c36466b26c738798976810cb", "score": "0.7252542", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to mrta_projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "aaeeca4d7642eeac81eeb91f76373545", "score": "0.7242079", "text": "def destroy\n @current_project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "85b55744724f90f4f00901a2230ace98", "score": "0.7224458", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n # format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "0e2b95593ca09e8b30baded7cd706a68", "score": "0.72175103", "text": "def destroy\n @project = Project.find_by_id(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213508", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "618ad030d6807471ea395c40c8ea7f36", "score": "0.7213453", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bdba333e59d8fd6d9300be85fd190a2c", "score": "0.7213377", "text": "def destroy\n @project = Project.find(params[:id])\n client_id = @project.client_id\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to client_projects_path(client_id) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2ac6b4927ecbaed24200999b5cce8d6d", "score": "0.72127366", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2ac6b4927ecbaed24200999b5cce8d6d", "score": "0.72127366", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2ac6b4927ecbaed24200999b5cce8d6d", "score": "0.72127366", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2ac6b4927ecbaed24200999b5cce8d6d", "score": "0.72127366", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2ac6b4927ecbaed24200999b5cce8d6d", "score": "0.72127366", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2ac6b4927ecbaed24200999b5cce8d6d", "score": "0.72127366", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2ac6b4927ecbaed24200999b5cce8d6d", "score": "0.72127366", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "2ac6b4927ecbaed24200999b5cce8d6d", "score": "0.72127366", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "aefbafae6d2dbcadb00be1af8dac3eaf", "score": "0.7209189", "text": "def destroy\n @project = current_user.projects.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c37e4a4266e7ee395418131a470f1923", "score": "0.72068727", "text": "def delete\n @project = Project.find(:first, :conditions => {:id => params[:project_id], :user_id => @current_user.id})\n\n # Delete collection from eXist database\n adapter = ExistAdapter.new(@project.id)\n adapter.delete_collection(@project.id)\n\n # Delete folder in directory\n project_path = Rails.root.join(\"public\", \"projects\", @project.id.to_s).to_s\n\n FileUtils.rm_rf(project_path) if File.exists?(project_path)\n\n # Delete project from database\n @project.delete()\n\n render :status => 200, :text => \"Project deleted\"\n end", "title": "" }, { "docid": "b84dafe8a21fbeede16bb95bf32aabc9", "score": "0.7206787", "text": "def destroy\n @project.destroy\n head :no_content\n end", "title": "" }, { "docid": "77d291cfb6a18b7ea620ee18ffb33f0f", "score": "0.71987814", "text": "def destroy\n @project.destroy\n respond_to do |format|\n format.html { redirect_to admin_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5b5b7c854166091b0c24ed6c6c93dc3c", "score": "0.71944344", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n respond_to do |format|\n format.html { redirect_to projects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f75e39df6ff0f92d23c70305b2b81a37", "score": "0.7193394", "text": "def destroy\n @project.destroy\n\n head :no_content\n end", "title": "" }, { "docid": "e9665da19eb03d3fbf324ee45a2b72a1", "score": "0.71827245", "text": "def destroy\n @miniproject.destroy\n respond_to do |format|\n format.html { redirect_to miniprojects_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "ebb9292fc92736d9cb36fbf21def5229", "score": "0.7180454", "text": "def destroy\n puts \"====destroy method===\"\n @projects1 = Projects1.find(params[:id])\n @projects1.destroy\n\n respond_to do |format|\n # projects1s_path\n # format.html { redirect_to projects1s_url }\n format.html { redirect_to projects1s_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d2fa1c0b844051cdb69091dbad12218a", "score": "0.7176762", "text": "def destroy\n @project = Project.find(params[:id])\n @project.destroy\n\n respond_to do |format|\n format.json { head :ok }\n format.html { redirect_to(projects_url) }\n format.xml { head :ok }\n end\n end", "title": "" } ]
cac5c3edd61586183d0c711980efd546
POST /exps POST /exps.json
[ { "docid": "9e981b3f5e29832dac8ff1280f779ff7", "score": "0.51091194", "text": "def create\n @exp = Exp.new(params[:exp])\n\n respond_to do |format|\n if @exp.save\n format.html { redirect_to @exp, notice: 'Article was successfully posted.' }\n format.json { render json: @exp, status: :created, location: @exp }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exp.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "de8036ad41041781d80a41142b81711c", "score": "0.6092958", "text": "def create\n @pex = Pex.new(pex_params)\n\n respond_to do |format|\n if @pex.save\n format.html { redirect_to @pex, notice: 'Pex was successfully created.' }\n format.json { render :show, status: :created, location: @pex }\n else\n format.html { render :new }\n format.json { render json: @pex.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f6cc26910819bd4b10ebb6bf5abda429", "score": "0.59678566", "text": "def post_evaluate(excon, body)\n excon.request(\n method: :post,\n path: '/evaluate',\n headers: { 'Content-Type' => 'application/json' },\n body: body\n )\nend", "title": "" }, { "docid": "15af77fe8da3db84bd753317fade8993", "score": "0.57322496", "text": "def create\n @exosuit = Exosuit.new(exosuit_params)\n\n respond_to do |format|\n if @exosuit.save\n format.html { redirect_to @exosuit, notice: 'Exosuit was successfully created.' }\n format.json { render :show, status: :created, location: @exosuit }\n else\n format.html { render :new }\n format.json { render json: @exosuit.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a742cd3c385253cc34f756f2d17a4847", "score": "0.5520955", "text": "def create\n @exemption = Exemption.new(exemption_params)\n\n respond_to do |format|\n if @exemption.save\n format.html { redirect_to @exemption, notice: 'Exemption was successfully created.' }\n format.json { render :show, status: :created, location: @exemption }\n else\n format.html { render :new }\n format.json { render json: @exemption.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3086b09d51517d3b14dde14d24adf8e6", "score": "0.5518675", "text": "def post_check(excon, body)\n excon.request(\n method: :post,\n path: '/check',\n headers: { 'Content-Type' => 'application/json' },\n body: body\n )\nend", "title": "" }, { "docid": "f34272f1653ce55a1f9d7c0c2801532a", "score": "0.54783446", "text": "def create\n @exalt = Exalt.new(params[:exalt])\n\n respond_to do |format|\n if @exalt.save\n format.html { redirect_to @exalt, notice: 'Exalt was successfully created.' }\n format.json { render json: @exalt, status: :created, location: @exalt }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exalt.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c7a4db118ce1be28baa83103dd7d0b3", "score": "0.5356903", "text": "def create\n points = params[:solution][:points_earned]\n unless current_user.posse.current_solution?\n solution = current_user.posse.solutions.create(solution_params)\n current_user.posse.add_points(points.to_i)\n end\n render json: solution\n end", "title": "" }, { "docid": "be837ba1bd238a596f0dc236d9e1ee35", "score": "0.5322893", "text": "def update_expirations(exps)\n template = ''\n exps.each { |exp| template += exp.template }\n return if template == ''\n logger.debug \"Setting multiple expirations:\\n#{template}\"\n return if Berta::Settings['dry-run']\n Berta::Utils::OpenNebula::Helper.handle_error do\n handle.update(template, true)\n handle.info\n end\n end", "title": "" }, { "docid": "71559d32916521111d47fe71bcbd678f", "score": "0.53064036", "text": "def create\n @planets_exoplanet = Planets::Exoplanet.new(params[:planets_exoplanet])\n\n respond_to do |format|\n if @planets_exoplanet.save\n format.html { redirect_to @planets_exoplanet, :notice => 'Exoplanet was successfully created.' }\n format.json { render :json => @planets_exoplanet, :status => :created, :location => @planets_exoplanet }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @planets_exoplanet.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b5f34f678198eb9c0ceb526a8e890e98", "score": "0.52916884", "text": "def update_expirations(exps)\n template = exps.inject('') { |temp, exp| temp + exp.template }\n return if template == ''\n logger.debug template.delete(\"\\n \")\n send_update(template)\n end", "title": "" }, { "docid": "d34f7fa06b4bf364069154fdf002ac26", "score": "0.52042794", "text": "def create\n @api_v1_exercise = Api::V1::Exercise.new(api_v1_exercise_params)\n\n respond_to do |format|\n if @api_v1_exercise.save\n format.html { redirect_to @api_v1_exercise, notice: 'Exercise was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_exercise }\n else\n format.html { render :new }\n format.json { render json: @api_v1_exercise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "546ac156c3d4bf16fbc13383978a39ac", "score": "0.5199085", "text": "def create\n @epiphany = Epiphany.new(epiphany_params)\n\n respond_to do |format|\n if @epiphany.save\n format.html { redirect_to @epiphany, notice: 'Epiphany was successfully created.' }\n format.json { render :show, status: :created, location: @epiphany }\n else\n format.html { render :new }\n format.json { render json: @epiphany.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "70414cfb1572b4a3cf5e1ae6114a5b42", "score": "0.51895744", "text": "def create\n exercise = Exercise.create(exercise_params)\n if exercise\n render json: exercise\n else\n render json: {error: 'Workout was not created.'}\n end\n end", "title": "" }, { "docid": "33111b96ab9583506b37df563232dbe4", "score": "0.5173379", "text": "def create\n @peek = Peek.new(peek_params)\n\n respond_to do |format|\n if @peek.save\n format.html { redirect_to @peek, notice: 'Peek was successfully created.' }\n format.json { render :show, status: :created, location: @peek }\n else\n format.html { render :new }\n format.json { render json: @peek.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bd79ef3072ad96c96a21302adb20f2f4", "score": "0.51469886", "text": "def create\n @exam = Exam.new(exam_params)\n @exam.patient = @patient\n\n if @exam.save\n render json: @exam, include: [:point_po, :point_or, :point_n, :point_a], methods: :maxillary_depth_angle, status: :created\n else\n render json: @exam.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "6ce58fe673872bacf69601e1eaa6ae64", "score": "0.5119845", "text": "def pex_params\n params.require(:pex).permit(:doc, :razon, :red, :ruc_red, :placa, :nromiddia, :categoria, :fecha_inicio, :hora_inicio, :fecha_fin, :hora_fin, :fecha_apro, :hora_apro, :plaza, :pista, :importe, :nro_compro, :fecha_compro)\n end", "title": "" }, { "docid": "1a284bbe84bb647653e5b155301b69dd", "score": "0.5111097", "text": "def create\n @extrainfo = Extrainfo.new(extrainfo_params)\n\n respond_to do |format|\n if @extrainfo.save\n format.html { redirect_to @extrainfo, notice: 'Extrainfo was successfully created.' }\n format.json { render :show, status: :created, location: @extrainfo }\n else\n format.html { render :new }\n format.json { render json: @extrainfo.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6e4197614cd0fa3e82a8ce392cb268fd", "score": "0.5104236", "text": "def create\n @powe_factor_nozzle_x = PoweFactorNozzleX.new(powe_factor_nozzle_x_params)\n\n respond_to do |format|\n if @powe_factor_nozzle_x.save\n format.html { redirect_to @powe_factor_nozzle_x, notice: 'Powe factor nozzle x was successfully created.' }\n format.json { render :show, status: :created, location: @powe_factor_nozzle_x }\n else\n format.html { render :new }\n format.json { render json: @powe_factor_nozzle_x.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "818a668461eacd121f2fc6d20b8482b0", "score": "0.50929266", "text": "def post endpoint, data\n do_request :post, endpoint, data\n end", "title": "" }, { "docid": "fbcddaf5580e7e029bbffc8dd35795b3", "score": "0.508793", "text": "def create\n @expression = Expression.new expression_params\n respond_to do |format|\n if @expression.save\n format.html { redirect_to @expression, notice: 'Expression was successfully created.' }\n format.json { render json: @expression, status: :created, location: @expression }\n else\n format.html { render action: \"new\" }\n format.json { render json: @expression.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "592e09f9e2581840dd856b23871789f4", "score": "0.50704724", "text": "def create\n @excercise = Excercise.new(params[:excercise])\n\n respond_to do |format|\n if @excercise.save\n format.html { redirect_to @excercise, :notice => 'Excercise was successfully created.' }\n format.json { render :json => @excercise, :status => :created, :location => @excercise }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @excercise.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d3c1ef3767dd5a4b6ae21242972e89dc", "score": "0.50660926", "text": "def create\n @exercise = Exercise.new(params[:exercise])\n\n respond_to do |format|\n if @exercise.save\n format.html { redirect_to @exercise, :notice => 'exercise was successfully created.' }\n format.json { render :json => @exercise, :status => :created, :location => @exercise }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @exercise.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0ef15b4ae9b863026fed3c5ee7d165a", "score": "0.5063106", "text": "def post operation, data={}\n body = case data\n when String\n body = data\n else\n Yajl::Encoder.encode(data)\n end\n\n request = new_request operation, body\n request.sign sts\n hydra.queue request\n hydra.run\n response = request.response\n puts response.inspect if @debug\n\n if response.code == 200\n Yajl::Parser.parse response.body\n else\n raise_error response\n end\n end", "title": "" }, { "docid": "2c1febbec5382db72953008f16944677", "score": "0.5063", "text": "def create\n @expertise = Expertise.new(expertise_params)\n\n if @expertise.save\n render json: @expertise, status: :created, location: @expertise\n else\n render json: @expertise.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "53446c9a57b683eee298cd7c606c4b2e", "score": "0.50466293", "text": "def create\n @exercise = @workout.exercises.new(exercise_params)\n\n respond_to do |format|\n if @exercise.save\n format.html { redirect_to @exercise, notice: I18n.t('exercises.created') }\n format.json { render :show, status: :created, location: @exercise }\n else\n format.html { render :new }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "32253460345719116c80ea4c4253b83d", "score": "0.50265515", "text": "def excursion_params\n params.require(:excursion).permit(:title, :phone, :duration, :imgurl, :price, :about)\n end", "title": "" }, { "docid": "edd8fadb28f952ceaa02d8cce9a22b0c", "score": "0.50139683", "text": "def ejemplares\n\t\tsnib = Geoportal::Snib.new\n\t\tsnib.params = params\n\t\tsnib.ejemplares\n\t\t\n\t\trender json: snib.resp\n\tend", "title": "" }, { "docid": "34266eab929a0315ca1cb483e61f8839", "score": "0.5011175", "text": "def create\n @exura = Exura.new(params[:exura])\n\n respond_to do |format|\n if @exura.save\n format.html { redirect_to @exura, :notice => 'Exura was successfully created.' }\n format.json { render :json => @exura, :status => :created, :location => @exura }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @exura.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1284b2fccbe6b37588cc8a922a0757e4", "score": "0.50055933", "text": "def create\n @exercise_template = ExerciseTemplate.new(exercise_template_params)\n\n if @exercise_template.save\n render json: @exercise_template, status: :created, location: @exercise_template\n else\n render json: @exercise_template.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e19e0ca76c4b8f2f75f43d9e5a2383ca", "score": "0.49890342", "text": "def exercise_params\n params.require(:exercise).permit(:workout_id, :title, :sets, :reps)\n end", "title": "" }, { "docid": "0d61cb76ff03407ebdde4960c02430f0", "score": "0.4987074", "text": "def create\n @exapmle = Exapmle.new(exapmle_params)\n\n respond_to do |format|\n if @exapmle.save\n format.html { redirect_to @exapmle, notice: 'Exapmle was successfully created.' }\n format.json { render :show, status: :created, location: @exapmle }\n else\n format.html { render :new }\n format.json { render json: @exapmle.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c3e893970de944843a138020f48a5b21", "score": "0.49780905", "text": "def create\n @etape = Etape.new(params[:etape])\n\n respond_to do |format|\n if @etape.save\n format.html { redirect_to @etape, notice: 'Etape was successfully created.' }\n format.json { render json: @etape, status: :created, location: @etape }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etape.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d36a664118d9babbb3e637767f55e3fb", "score": "0.49777225", "text": "def create\n @exercise = Exercise.new(params[:exercise])\n\n respond_to do |format|\n if @exercise.save\n format.html { redirect_to @exercise, notice: 'Exercise was successfully created.' }\n format.json { render json: @exercise, status: :created, location: @exercise }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d5240605e97f81025d01582b3f44b882", "score": "0.49752572", "text": "def create\n @expression_of_interest = ExpressionOfInterest.new(expression_of_interest_params)\n\n respond_to do |format|\n if @expression_of_interest.save\n format.html { redirect_to @expression_of_interest, notice: 'Expression of interest was successfully created.' }\n format.json { render :show, status: :created, location: @expression_of_interest }\n else\n format.html { render :new }\n format.json { render json: @expression_of_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "612b69c66105deb2a7edb0266ecaa19b", "score": "0.4973206", "text": "def create\n @sexe = Sexe.new(sexe_params)\n\n respond_to do |format|\n if @sexe.save\n format.html { redirect_to @sexe, notice: 'Sexe was successfully created.' }\n format.json { render :show, status: :created, location: @sex }\n else\n format.html { render :new }\n format.json { render json: @sexe.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8003f8c7b813469471ca783f1e0e074e", "score": "0.49715534", "text": "def create_peep_params\n params.require(:peep).permit(:user_id, :body)\n end", "title": "" }, { "docid": "98fffa555015c3d3e8404f3bc3e90b73", "score": "0.4966477", "text": "def create\n @exercise = Exercise.new(params[:exercise])\n\n respond_to do |format|\n if @exercise.save\n flash[:class] = \"alert alert-success\"\n format.html { redirect_to @exercise, :notice => 'exercise was successfully created.' }\n format.json { render :json => @exercise, :status => :created, :location => @exercise }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @exercise.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "542eb22e75573dda401a60a2409a6c8a", "score": "0.4959981", "text": "def create\n @work_exp = WorkExp.new(work_exp_params)\n\n respond_to do |format|\n if @work_exp.save\n format.html { redirect_to @work_exp, notice: 'Work exp was successfully created.' }\n format.json { render :show, status: :created, location: @work_exp }\n else\n format.html { render :new }\n format.json { render json: @work_exp.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7eb17e8daf87a6137abe3b26ff953854", "score": "0.49571627", "text": "def post(_endpoint_path, _body, _extra_headers = {})\n response\n end", "title": "" }, { "docid": "c21e8d4bafb737b8617857914528c460", "score": "0.49395427", "text": "def create\n @exp_profissional = ExpProfissional.new(exp_profissional_params)\n\n respond_to do |format|\n if @exp_profissional.save\n format.html { redirect_to @exp_profissional, notice: 'Exp profissional was successfully created.' }\n format.json { render :show, status: :created, location: @exp_profissional }\n else\n format.html { render :new }\n format.json { render json: @exp_profissional.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a9bcbeb132f75be6f14edcf5169e243b", "score": "0.4931276", "text": "def post(json)\n with_endpoint do |endpoint|\n url = [endpoint, @resource_name].compact.join('/')\n url += \"/\"\n return HTTParty.post(url, :body => json, :timeout => 4, :headers => { 'Content-Type' => 'application/json' })\n end\n end", "title": "" }, { "docid": "7f0b9674205ca9d502ef389f4a66c185", "score": "0.49305928", "text": "def exapmle_params\n params.require(:exapmle).permit(:name, :title, :message)\n end", "title": "" }, { "docid": "401fc63f0cdf94660e0271ee9eaec2a3", "score": "0.49210852", "text": "def create_ping\n post 'ping'\n end", "title": "" }, { "docid": "eb7ac6057415f35688235ef6b53e454e", "score": "0.49190643", "text": "def create\n @fixed_exp = FixedExp.new(fixed_exp_params)\n\n respond_to do |format|\n if @fixed_exp.save\n format.html { redirect_to @fixed_exp, notice: 'Fixed exp was successfully created.' }\n format.json { render :show, status: :created, location: @fixed_exp }\n else\n format.html { render :new }\n format.json { render json: @fixed_exp.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fcd83b505ceedb1bc374912fa14d1009", "score": "0.49099725", "text": "def create\n @episode = Episode.new(episode_params)\n\n if @episode.save\n render json: @episode, status: :created, location: @episode\n else\n render json: @episode.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "79f130537d22dd56bc6092bf51d052c1", "score": "0.49090734", "text": "def create\n @exercise = Exercise.new(exercise_params)\n\n respond_to do |format|\n if @exercise.save\n format.html { redirect_to @exercise, notice: 'Exercise was successfully created.' }\n format.json { render action: 'show', status: :created, location: @exercise }\n else\n format.html { render action: 'new' }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65b5934c1740fecc9951773d429e82bc", "score": "0.4901924", "text": "def post_params\n params.require(:post).permit(:title, :character_id, :episode, :user_id, :status, :point)\n end", "title": "" }, { "docid": "ee7348773a738f55c403e3a1ff09d9d4", "score": "0.49008846", "text": "def create\n @exercise = Exercise.new(params[:exercise])\n\n respond_to do |format|\n if @exercise.save\n format.html { redirect_to @exercise, notice: 'Exercise was successfully created.' }\n format.json { render json: @exercise, status: :created, location: @exercise }\n else\n flash.now[:error] = @exercise.errors.full_messages\n format.html { render action: \"new\"}\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4b9e5da71c4a4ffea4f2e3cc56f6ea5d", "score": "0.49005407", "text": "def physio_exercise_params\n params.require(:physio_exercise).permit(\n :name,\n :description,\n :client_id,\n :duration,\n :user_id\n )\n end", "title": "" }, { "docid": "55c9698634988179385cec4deaf6c47c", "score": "0.49000826", "text": "def create\n @etsy = Etsy.new(params[:etsy])\n\n respond_to do |format|\n if @etsy.save\n format.html { redirect_to @etsy, notice: 'Etsy was successfully created.' }\n format.json { render json: @etsy, status: :created, location: @etsy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @etsy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b542791b84777d51f60b4b7731bf76b0", "score": "0.4892964", "text": "def create\n @pokemon_evolution = PokemonEvolution.new(pokemon_evolution_params)\n\n respond_to do |format|\n if @pokemon_evolution.save\n format.html { redirect_to @pokemon_evolution, notice: 'Pokemon evolution was successfully created.' }\n format.json { render :show, status: :created, location: @pokemon_evolution }\n else\n format.html { render :new }\n format.json { render json: @pokemon_evolution.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c1b44ca08bd284c0d2787f63e6f034bc", "score": "0.48846522", "text": "def create\n @extent = Extent.new(extent_params)\n\n respond_to do |format|\n if @extent.save\n format.html { redirect_to @extent, notice: 'Extent was successfully created.' }\n format.json { render :show, status: :created, location: @extent }\n else\n format.html { render :new }\n format.json { render json: @extent.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "860ec265df3933875fc99d38c3f07dbb", "score": "0.48846337", "text": "def create\n @papertest = Papertest.new(papertest_params)\n\n respond_to do |format|\n if @papertest.save\n format.html { redirect_to @papertest, notice: 'Papertest was successfully created.' }\n format.json { render :show, status: :created, location: @papertest }\n else\n format.html { render :new }\n format.json { render json: @papertest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "405a837cc63f99d29318665b7e6f0296", "score": "0.4883103", "text": "def exosuit_params\n params.require(:exosuit).permit(:name, :user_id, exosuit_upgrades_attributes: [:name, :recipe, :category])\n end", "title": "" }, { "docid": "b0a6937745318c4a5eac70c389b36056", "score": "0.48726147", "text": "def create\n @steep_instruction = SteepInstruction.new(steep_instruction_params)\n\n respond_to do |format|\n if @steep_instruction.save\n format.html { redirect_to @steep_instruction, notice: 'Steep instruction was successfully created.' }\n format.json { render :show, status: :created, location: @steep_instruction }\n else\n format.html { render :new }\n format.json { render json: @steep_instruction.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "552fbd2007d7388cd3af9e3eb449f70b", "score": "0.48691678", "text": "def create\n @expediente = Expediente.new(params[:expediente])\n \n respond_to do |format|\n if @expediente.save\n format.html { redirect_to @expediente, notice: 'Expediente was successfully created.' }\n format.json { render json: @expediente, status: :created, location: @expediente }\n else\n format.html { render action: \"new\" }\n format.json { render json: @expediente.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "217e77aa3aaef9d99931645e750b4624", "score": "0.48643932", "text": "def api_v1_exercise_params\n params.require(:api_v1_exercise).permit(:title, :description, :deadline, :visible_date, :do_plagiarism_check, :exercise_test, :exercise_hidden_test, :exercise_stub)\n end", "title": "" }, { "docid": "2a16c640efce218f146ad6ab17ea2f85", "score": "0.48576653", "text": "def create\n @ess = Esse.new(ess_params)\n\n respond_to do |format|\n if @ess.save\n format.html { redirect_to esses_url, notice: 'Esse was successfully created.' }\n format.json { render :show, status: :created, location: @ess }\n else\n format.html { render :new }\n format.json { render json: @ess.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "19400f43fe604f5b36e28e504d017462", "score": "0.484332", "text": "def exposition_params\n params.require(:exposition).permit(:title, :text, :address, :start_time, :end_time, :start_date, :end_date)\n end", "title": "" }, { "docid": "d479b861878c5ce2822f3bb229941f06", "score": "0.48345077", "text": "def create\n @expedient = Expedient.new(expedient_params)\n\n respond_to do |format|\n if @expedient.save\n format.html { redirect_to expedients_url, notice: 'Se creó un nuevo expediente' }\n format.json { render :show, status: :created, location: @expedient }\n else\n format.html { render :new }\n format.json { render json: @expedient.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dce449e43b433aaf1ea17a447740d1d3", "score": "0.48335266", "text": "def create\n @performed_exercise = PerformedExercise.new(performed_exercise_params)\n\n respond_to do |format|\n if @performed_exercise.save\n format.html { redirect_to @performed_exercise, notice: 'Performed exercise was successfully created.' }\n format.json { render :show, status: :created, location: @performed_exercise }\n else\n format.html { render :new }\n format.json { render json: @performed_exercise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2fa9c47599e81386039cf49565663205", "score": "0.48282015", "text": "def create\n @exercise = current_user.exercises.build(exercise_params)\n\n respond_to do |format|\n if @exercise.save\n format.html { redirect_to exercise_weight_logs_path(@exercise)}\n format.json { render :show, status: :created, location: @exercise }\n else\n format.html { render :new }\n format.json { render json: @exercise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "65f164e4d41b08aab366cb1a856b4517", "score": "0.48259974", "text": "def post_incident(payload)\n begin\n payload_json = JSON.dump(payload)\n resp = pagerduty.incidents_api.post(payload_json, :content_type => :json)\n answer = JSON.parse(resp, :symbolize_names => true)\n log.debug(\"POST to incidents, payload=#{payload.inspect}, response=#{answer}\")\n answer\n rescue Exception => e\n log.error(\"Failed to post to incident API: #{payload.inspect}.\"+\n \"\\nError: #{e.message}\")\n raise RuntimeError.new(\"Problem talking to PagerDuty incidents:\"+\n \" #{e.message}\\nRequest was #{payload.inspect}\")\n end\n end", "title": "" }, { "docid": "ecaa19aa41ac5455aa89100c7b5f12e3", "score": "0.48214802", "text": "def test_should_create_invite_via_API_JSON\r\n get \"/logout\"\r\n post \"/invites.json\", :api_key => 'testapikey',\r\n :invite => {:message => 'API Invite 1',\r\n :accepted => false,\r\n :email => '[email protected]',\r\n :user_id => 1 }\r\n assert_response :created\r\n invite = JSON.parse(response.body)\r\n check_new_invite(invite) \r\n end", "title": "" }, { "docid": "f4706d47db035d16a7fc42f06741a1f4", "score": "0.48202014", "text": "def create\n @tipo_exame = TipoExame.new(tipo_exame_params)\n\n respond_to do |format|\n if @tipo_exame.save\n format.html { redirect_to @tipo_exame, notice: 'Tipo exame was successfully created.' }\n format.json { render :show, status: :created, location: @tipo_exame }\n else\n format.html { render :new }\n format.json { render json: @tipo_exame.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d0d25980e6e97edf61a2e0a80b020ba5", "score": "0.481945", "text": "def create\n @exemplaresproduto = Exemplaresproduto.new(exemplaresproduto_params)\n\n respond_to do |format|\n if @exemplaresproduto.save\n format.html { redirect_to @exemplaresproduto, notice: 'Exemplaresproduto was successfully created.' }\n format.json { render :show, status: :created, location: @exemplaresproduto }\n else\n format.html { render :new }\n format.json { render json: @exemplaresproduto.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b7b32a3911d75f40e248c059ae3a619d", "score": "0.48140305", "text": "def create\n @exp_paramater = ExpParamater.new(params[:exp_paramater])\n\n respond_to do |format|\n if @exp_paramater.save\n format.html { redirect_to @exp_paramater, notice: 'Exp paramater was successfully created.' }\n format.json { render json: @exp_paramater, status: :created, location: @exp_paramater }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exp_paramater.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "87550d45e78153fa3ac66c5cc23f1e85", "score": "0.48127586", "text": "def new\n @exposition = Exposition.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @exposition }\n end\n end", "title": "" }, { "docid": "6d189c3d68db1a35583ca078b053d7c6", "score": "0.48117465", "text": "def json_post\n @content_type = 'text/plain'\n @render_nothing = true\n @rendered_template = true\n @current_layout = nil\n puts \"json_post: submitting #{params[:path]}\" if @@debug\n path = params[:path]\n if path\n puts \"json_post: path is #{path} l=#{path.length}\" if @@debug\n path = path.split('/').compact()\n path.delete('')\n # you cannot make rooted nodes via json atm... fix? xxx\n if path.length > 1\n name = path.pop\n nodes = Note.make_path @user,path\n puts \"json_post: making at path #{path.join('/')}\" if @@debug\n if nodes\n note = nodes.last.make_child @user,params,name\n puts \"json_post: made child #{note} from #{name} l=#{name.length}\"\n params[:path] = path.join('/') # for call to json_query\n # it is important to do a query rather than returning the note; to get freshest order\n json_query\n return\n #write_json note if note\n end\n end\n end\n render :nothing => true\n end", "title": "" }, { "docid": "a57de67abf193a5d1f1c365206002cb1", "score": "0.4811437", "text": "def excuse_params\n params.require(:excuse).permit(:content, :count, :occasion, :user_id)\n end", "title": "" }, { "docid": "85d6436452da2d1dbc603f8499d28ff3", "score": "0.48113433", "text": "def offers \n @host.offers.create(offer_params) if request.post?\n @offers = @host.offers\n end", "title": "" }, { "docid": "4d3d796ead9e25644fc7d018bb80e87e", "score": "0.4810068", "text": "def create\n @promotion = Promotion.new(promotion_params)\n\n if @promotion.save\n render json: @promotion, status: :created, location: @promotion\n else\n render json: @promotion.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e3bae3e2686c72f429f8f16c47e6ea07", "score": "0.48081082", "text": "def create\n @power_order = PowerOrder.new(power_order_params)\n @power_order.save\n render json: @power_order\n end", "title": "" }, { "docid": "97023eeb08a0add9c6d3b3ba199caf6d", "score": "0.48015308", "text": "def create\n @post_prod_dpt = PostProdDpt.new(post_prod_dpt_params)\n\n if @post_prod_dpt.save\n render json: @post_prod_dpt, status: :created, location: @post_prod_dpt\n else\n render json: @post_prod_dpt.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "ce7f7e293c5aa24ba03b2fc4b98b5981", "score": "0.48005214", "text": "def create\n @pe_exchange_product = PeExchangeProduct.new(pe_exchange_product_params)\n\n respond_to do |format|\n if @pe_exchange_product.save\n format.html { redirect_to @pe_exchange_product, notice: 'Pe exchange product was successfully created.' }\n format.json { render :show, status: :created, location: @pe_exchange_product }\n else\n format.html { render :new }\n format.json { render json: @pe_exchange_product.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f52239ab062c98f078ea777f29e441fc", "score": "0.47973067", "text": "def create\n @patient_exercise = PatientExercise.new(params[:patient_exercise])\n\n respond_to do |format|\n if @patient_exercise.save\n format.html { redirect_to @patient_exercise, notice: 'Patient exercise was successfully created.' }\n format.json { render json: @patient_exercise, status: :created, location: @patient_exercise }\n else\n format.html { render action: \"new\" }\n format.json { render json: @patient_exercise.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "858343bdd6124be3dfe97bcf11c15aad", "score": "0.47893304", "text": "def create\n @dotsmember = Dotsmember.new(params[:dotsmember])\n\n respond_to do |format|\n if @dotsmember.save\n format.html { redirect_to @dotsmember, notice: 'Dotsmember was successfully created.' }\n format.json { render json: @dotsmember, status: :created, location: @dotsmember }\n else\n format.html { render action: \"new\" }\n format.json { render json: @dotsmember.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0b081d699eb7d356cfdef9badb5dc89f", "score": "0.47820604", "text": "def create\n @exponat = current_user.exponats.new(exponat_params)\n # Exponat.new(exponat_params)\n\n respond_to do |format|\n if @exponat.save\n format.html { redirect_to @exponat, notice: 'Exponat was successfully created.' }\n format.json { render :show, status: :created, location: @exponat }\n else\n format.html { render :new }\n format.json { render json: @exponat.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1f685648861832937e72302173a2bdf8", "score": "0.47808716", "text": "def create\n @especy = Especie.new(params[:especy])\n\n respond_to do |format|\n if @especy.save\n format.html { redirect_to @especy, notice: 'Especie was successfully created.' }\n format.json { render json: @especy, status: :created, location: @especy }\n else\n format.html { render action: \"new\" }\n format.json { render json: @especy.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ab5bbe1489876ea525b710400d627cd4", "score": "0.47779697", "text": "def bicepstriceps1_params\n params.require(:bicepstriceps1).permit(:exercise, :reps, :sets)\n end", "title": "" }, { "docid": "36dcb2e7db96a537eb63e6bde52e6bfa", "score": "0.4777822", "text": "def create\n @peep = Peep.new(params[:peep])\n\n respond_to do |format|\n if @peep.save\n format.html { redirect_to(@peep, :notice => 'Peep was successfully created.') }\n format.xml { render :xml => @peep, :status => :created, :location => @peep }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @peep.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ff0e7431cc4e94a0c35add655d2a0ac4", "score": "0.4774737", "text": "def add_tenant_circle(args = {}) \n post(\"/tenantcircles.json/\", args)\nend", "title": "" }, { "docid": "d02182d755fa249b027af5c7f2bb9dcd", "score": "0.47734898", "text": "def create\n @exp_detail = ExpDetail.new(params[:exp_detail])\n\n respond_to do |format|\n if @exp_detail.save\n format.html { redirect_to @exp_detail, notice: 'Exp detail was successfully created.' }\n format.json { render json: @exp_detail, status: :created, location: @exp_detail }\n else\n format.html { render action: \"new\" }\n format.json { render json: @exp_detail.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d1a9a6b625b7e99bfba4c620da06b324", "score": "0.47684932", "text": "def create\n @ev = Ev.new(ev_params)\n\n respond_to do |format|\n if @ev.save\n format.html { redirect_to @ev, notice: 'Ev was successfully created.' }\n format.json { render :show, status: :created, location: @ev }\n else\n format.html { render :new }\n format.json { render json: @ev.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e4a6fbb8ca754d6b9bbb53a90f044233", "score": "0.4765136", "text": "def create\n @user = @current_user\n @excuse = @user.excuses.build(params[:excuse])\n @excuse.location = @user.location\n\n respond_to do |format|\n if @excuse.save\n format.html { redirect_to @excuse, notice: 'Excuse was successfully created.' }\n format.json { render json: @excuse, status: :created, location: @excuse }\n else\n format.html { render action: \"new\" }\n format.json { render json: @excuse.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f3495686e9396fb2e05e5907fcbdd463", "score": "0.47647002", "text": "def exercise_params\n params.require(:exercise).permit(:date, :exercise, :weight, :reps, :max, :bulk, :tone, :user_id)\n end", "title": "" }, { "docid": "ea8e24edce0933dcc3d8e9e4b9b32416", "score": "0.4761293", "text": "def create\n @explc = Explc.new(explc_params)\n\n respond_to do |format|\n if @explc.save\n format.html { redirect_to @explc, notice: 'Explc was successfully created.' }\n format.json { render :show, status: :created, location: @explc }\n else\n format.html { render :new }\n format.json { render json: @explc.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "35eb5fb4c19f69c22cb3a73fb091320c", "score": "0.47528225", "text": "def create\n @excategory = Excategory.new(excategory_params)\n\n respond_to do |format|\n if @excategory.save\n format.html { redirect_to @excategory, notice: 'Excategory was successfully created.' }\n format.json { render :show, status: :created, location: @excategory }\n else\n format.html { render :new }\n format.json { render json: @excategory.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "05ccceb65cc8f962854aeb7657dda8c3", "score": "0.47501016", "text": "def create\n @essay = Essay.new(essay_params)\n @essay.user_assignment = @assignment.user_assignments.find_by(user: current_user)\n\n respond_to do |format|\n if @essay.save\n format.html { redirect_to assignment_essay_path(@assignment, @essay), notice: 'Essay was successfully created.' }\n format.json { render :show, status: :created, location: @essay }\n else\n format.html { render :new }\n format.json { render json: @essay.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1c275f21f9b6fdba5015cfc43eff7739", "score": "0.47494936", "text": "def exame_create_params\n params.require(:exame).permit(:nome, :tipo)\n end", "title": "" }, { "docid": "e3eaa800e30e2fd6b6b78ec16f930f4f", "score": "0.47401512", "text": "def create\n @possess = Possess.new(params[:possess])\n\n respond_to do |format|\n if @possess.save\n format.html { redirect_to @possess, notice: 'Possess was successfully created.' }\n format.json { render json: @possess, status: :created, location: @possess }\n else\n format.html { render action: \"new\" }\n format.json { render json: @possess.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7f247c1e36d18c324fa7ed05f0a207c2", "score": "0.47382894", "text": "def create\n @exercise_task = ExerciseTask.new(exercise_task_params)\n \n respond_to do |format|\n if @exercise_task.save\n format.html { redirect_to @exercise_task, notice: 'Exercise task was successfully created.' }\n format.json { render :show, status: :created, location: @exercise_task }\n else\n format.html { render :new }\n format.json { render json: @exercise_task.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "37fc56dc65fefe01e5d540f46f1895d1", "score": "0.4729766", "text": "def create\n newEssay = params[:essay]\n newEssay[:assignment_id] = params[:assignment_id]\n @essay = Essay.new(newEssay)\n \n respond_to do |format|\n if @essay.save\n format.html { redirect_to assignment_essay_url(@essay.assignment_id, @essay.id), notice: 'Essay was successfully created.' }\n format.json { render json: @essay, status: :created, location: @essay }\n else\n format.html { render action: \"new\" }\n format.json { render json: @essay.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a8314be317e41f019051d02705f39e29", "score": "0.4720838", "text": "def user_pokemon_params\n params.require(:user_pokemon).permit(:pokemon_id, :user_id, :exp)\n end", "title": "" }, { "docid": "8d244c8e93c271a7e92ea1ee63d3dddc", "score": "0.47207162", "text": "def POST; end", "title": "" }, { "docid": "d41009b1b473b2def09f7cffc2268a9e", "score": "0.47146803", "text": "def update\n respond_to do |format|\n if @pex.update(pex_params)\n format.html { redirect_to @pex, notice: 'Pex was successfully updated.' }\n format.json { render :show, status: :ok, location: @pex }\n else\n format.html { render :edit }\n format.json { render json: @pex.errors, status: :unprocessable_entity }\n end\n end\n\n end", "title": "" }, { "docid": "ad05019f0f838aa1a071dd40844cfd4f", "score": "0.4711865", "text": "def expedition_params\n params.require(:expedition).permit(:title, :description, :number_of_guests, :cost, :allow_multiple_bookings_on_date)\n end", "title": "" }, { "docid": "f9bb0950fff62cfc56af310eb7e192a1", "score": "0.47117156", "text": "def post_inventories(name,description, organization=1,variables='')\n dprint \"/api/v1/hosts\"\n resp = @rest['/api/v1/hosts'].post({\n :name => name,\n :description => description,\n :organization => organization,\n :variables => variables\n })\n dprint resp\n\n #[XXX] Theoretical what this is at this point - need to see \n # actual response\n JSON.parse(resp)[\"results\"]\n end", "title": "" }, { "docid": "b3a198456ac5933a2a69c97da37049cc", "score": "0.471163", "text": "def create\n @tipos_encuestum = TiposEncuestum.new(tipos_encuestum_params)\n\n respond_to do |format|\n if @tipos_encuestum.save\n format.html { redirect_to @tipos_encuestum, notice: 'Tipos encuestum was successfully created.' }\n format.json { render :show, status: :created, location: @tipos_encuestum }\n else\n format.html { render :new }\n format.json { render json: @tipos_encuestum.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f1afbaf9fd4ec47d385526156fcd79a8", "score": "0.47113678", "text": "def post(endpoint)\n respond_with(\n connection(endpoint).post(prepare(endpoint.uri), custom_dump(endpoint.req_params)),\n endpoint\n )\n end", "title": "" } ]
b7af7de16b3522d998fb61a74dd2c53d
'a'.ord => 97 97.chr => 'a' find substring by string[position]
[ { "docid": "31c59822bf967af8434c39efff44c266", "score": "0.0", "text": "def caesarCipher(string,shift)\n\tcipherString = []\n\ti = 0\n\twhile i < string.length\n\t\tif string[i] == \" \"\n\t\t\tcipherString << string[i]\n\t\telse\n\t\t\tif (string[i].ord + shift) > 122\n\t\t\t\tcipherString << (((string[i].ord + shift) - 26).chr)\n\t\t\telse\n\t\t\t\tcipherString << ((string[i].ord + shift).chr)\n\t\t\tend\n\t\tend\n\t\ti = i + 1\n\tend\n\tputs cipherString.join\nend", "title": "" } ]
[ { "docid": "573826d0efca03c9deb3f866f7b8b2ec", "score": "0.73595476", "text": "def index_of_chr(string,chr)\n i = 0\n while i < string.length\n if string[i] == chr\n return i\n end\n i += 1\n end\n return nil\nend", "title": "" }, { "docid": "10135c44b86bcf3d92a15cff9dc3a725", "score": "0.7341929", "text": "def custom_index(str, sstr)\n return nil unless str.include?(sstr)\n length = sstr.length\n str.chars.each_with_index do |char,index|\n sequence = str[index, length]\n return index if sequence == sstr\n end\nend", "title": "" }, { "docid": "6b715c20ec620908d0ff1e170b63292e", "score": "0.7246997", "text": "def custom_index(string, substring)\r\n return nil unless string.include?(substring)\r\n length = substring.length\r\n string.chars.each_with_index do |char, index|\r\n sequence = string[index, length]\r\n return index if sequence == substring\r\n end\r\nend", "title": "" }, { "docid": "c1d260751c3ec09ca243a7a913899b2e", "score": "0.7220174", "text": "def custom_index(string, substring)\n #Return nil if subsring not found in substring\n #Return index position of substring if found in string\n return nil unless string.include?(substring)\n length = substring.length\n string.chars.each_with_index do |char, index|\n sequence = string[index, length]\n return index if sequence == substring\n end\nend", "title": "" }, { "docid": "4b09f356867e2b931b9925ae09e61d5d", "score": "0.7196032", "text": "def custom_index(string, substring)\n return nil unless string.include?(substring)\n length = substring.length\n string.chars.each_with_index do |elem, index|\n sequence = string[index, length]\n return index if sequence == substring\n end\nend", "title": "" }, { "docid": "4fb5622f9bea5287a4e34e0d17382131", "score": "0.71770173", "text": "def custom_index(string, substring)\n return nil unless string.include?(substring)\n\n length = substring.length\n string.chars.each_with_index do |_char, index|\n sequence = string[index, length] # starts extracting at index and takes\n # as many characters as the called length argument has\n return index if sequence == substring\n end\nend", "title": "" }, { "docid": "15b547993eaf27031cee4fb652b3f2e0", "score": "0.7150395", "text": "def custom_index(string, substring)\n return nil unless string.include?(substring)\n length = substring.length\n string.chars.each_with_index do |char, index|\n sequence = string[index, length]\n return index if sequence == substring\n end\nend", "title": "" }, { "docid": "78f18f12354ea8ceb1c428d670a49ecb", "score": "0.714962", "text": "def custom_index(string, substring)\r\n string.each_char do |char|\r\n if substring.include?(char)\r\n end\r\n end\r\nend", "title": "" }, { "docid": "e411963f5d60349a609fa73a9e6214df", "score": "0.71412617", "text": "def custom_index(string, substring)\n return nil unless string.include?(substring)\n length = substring.length\n string.chars.each_with_index do |char, index|\n sequence = string[idex, length]\n return index if sequence == substring\n end\nend", "title": "" }, { "docid": "589723865a276fcfb8fab201befcdda4", "score": "0.7135876", "text": "def alphabet_finder(x)\n alphabet = \"abcdefghijklmnopqrstuvwxyz\"\n position = alphabet.index(x)\n position -= 1 \n char = alphabet[position]\nend", "title": "" }, { "docid": "82d67bb39d37e7a7b50c9b79f17bc301", "score": "0.708418", "text": "def find_char(word,nth_char)\n\tword[nth_char]\nend", "title": "" }, { "docid": "5a2cfda2fbc527462afbdb0c704c01b6", "score": "0.7027347", "text": "def lecturer_index(string, substring)\n return nil unless string.include?(substring)\n length = substring.length\n string.chars.each_with_index do |char, index|\n sequence = string[index, length] # 2nd variable tells it number of chars to return\n return index if sequence == substring\n end # end of do\nend", "title": "" }, { "docid": "bb4a390db16bff479028d2fbe5889363", "score": "0.700994", "text": "def index(substr[, pos])\n end", "title": "" }, { "docid": "fd5d8e8d623e66e0f9f213aa431ab635", "score": "0.69765943", "text": "def custom_index(string, search_characters)\n return nil unless string.include?(search_characters)\n length = search_characters.length\n string.chars.each_with_index do |letter, i|\n seq = string[i, length]\n return index_found = i if seq == search_characters\n end # end of do\nend", "title": "" }, { "docid": "080b2789de90731b982c31dfbd440f28", "score": "0.6907344", "text": "def indexes(s, char)\n (0 ... s.length).find_all { |i| s[i,1] == char }\nend", "title": "" }, { "docid": "746ee802b3ddf6d5d6b4507076aabb49", "score": "0.69067", "text": "def letter_position letter, alphabet\n #alphabet = \"ABCDEFGHIJKLMNOPQRSTUVWXYZ\".split('')\n alphabet.each_with_index do |l, position|\n if letter.upcase == l\n return position\n end \n end \n return -1 \nend", "title": "" }, { "docid": "a9d4fd0e5ffe2ffa28fb4ee7c7c2dfce", "score": "0.6897498", "text": "def get_character(full_string, index)\n full_string[index]\nend", "title": "" }, { "docid": "c54133817a517954b58020b3b4022f61", "score": "0.6890498", "text": "def index_of_char(str, char)\n output = 0\n i = 0\n while i < str.length\n if str[i] == char\n output = i\n return output\n end\n i += 1\n end\n return nil\nend", "title": "" }, { "docid": "3eebf37812b28c882dcde0789c8762ac", "score": "0.6886403", "text": "def custom_index(string, substring)\r\n string.index(substring)\r\nend", "title": "" }, { "docid": "d53fa11b8a451ed23988b1a57b319854", "score": "0.68489367", "text": "def char_at_pos str, pos\n \"\"\nend", "title": "" }, { "docid": "2876ee0fd1e57c4d84cbdfa0b3220422", "score": "0.6845034", "text": "def stringIndex\n return $str.index('o')\nend", "title": "" }, { "docid": "c835043a4df95fd4a7024a55e19e64db", "score": "0.6842628", "text": "def find_char_in_string(string, char)\n index = 0\n indexes = []\n while index\n index = string.index(char, index)\n if index\n indexes << index\n index += 1\n end\n end\n indexes\n end", "title": "" }, { "docid": "251c01ceda7999b8bccc31a32bebe295", "score": "0.6828279", "text": "def offset(string, offset)\n string.chars.map do |x|\n if x.match?(/[a-z]/i)\n x = ((x.ord + offset) % 122)\n x += 97 if x < 97\n x.chr\n else\n x\n end\n end.join\nend", "title": "" }, { "docid": "a196a4ec62e4dda6ed36ff55d0a2e1b2", "score": "0.68267316", "text": "def index_string(string, substring)\n i = 0 \n output = nil\n while i < string.length-1\n if string[i..(i+substring.length)] == substring\n output = i\n end\n i += 1\n end\n return output\nend", "title": "" }, { "docid": "9946ab0b967034c3dbb52a8bbc38479f", "score": "0.67788553", "text": "def get_character(full_string, index)\n return full_string[index]\nend", "title": "" }, { "docid": "ba6fda468b68c038bb06fd5903b4a15b", "score": "0.677398", "text": "def index_of_char(str, char)\n i = 0\n while i < str.length\n if str[i] == char\n return i\n end\n i += 1\n end\n return nil\nend", "title": "" }, { "docid": "13950693fc52fe19127d19781ba41b23", "score": "0.6724314", "text": "def custom_index(string, substring)\n return nil unless string.include?(substring)\n length = substring.length\n string.chars.each_with_index do |char, index|\n sequence = string[index, length]\n return index if sequence == substring\n end\n end", "title": "" }, { "docid": "26f8e371193a761bd87f2e69a3ab914d", "score": "0.672105", "text": "def substrings_at_start(str)\n str.each_char.map.with_index do |char, index|\n str[0..index]\n end\nend", "title": "" }, { "docid": "ec25c90320175edae3304ae17c126b04", "score": "0.6720705", "text": "def index_string(str, substr)\n i = 0\n while i < str.length\n if str[i] == substr[0]\n index = i\n match = true\n j = 0\n while j < substr.length\n if str[i + j] != substr[j]\n match = false\n end\n j+=1\n end\n\n if match == true\n return index\n end\n end\n i+=1\n end\nend", "title": "" }, { "docid": "4fbb45a946eb7fd7f5511f149af8fc8c", "score": "0.67081887", "text": "def character_at(text, index)\n return text[index]\nend", "title": "" }, { "docid": "2cd747d380c7fc9017535b41d8e6f361", "score": "0.6707899", "text": "def rindex(substr[, pos]) \n end", "title": "" }, { "docid": "d2207f686872bd73ddbe8fab27706032", "score": "0.6707347", "text": "def find_position_of( letter, letters )\n \n count = 0\n while count < letters.length()\n if letter == letters[count]\n position = count\n end\n count += 1\n end\n\n return position\n\nend", "title": "" }, { "docid": "5422fbefd6aa9a8b6b0867d24d9c2790", "score": "0.6705976", "text": "def index_of_char(string, char)\n i = 0\n while i < string.length\n if string[i] == char\n return i\n end\n i += 1\n end\n return nil\nend", "title": "" }, { "docid": "0c044fdd92f3cf68c7ef76b406616be2", "score": "0.6705462", "text": "def substring(str)\n # start from index i and slice up to i + 1 to get at least one character\n subs = []\n str.each_char.with_index do |char, i|\n str.each_char.with_index do |char2, j|\n if j > i\n subs << str[i..j]\n end\n end\n end\n\n subs\nend", "title": "" }, { "docid": "e138da79fe65e6b22b3309b7162192cf", "score": "0.66999555", "text": "def index_of_char(str, char)\n\ti = 0\n\twhile i < str.length - 1\n\t\tif char == str[i]\n\t\t\treturn i\n\t\tend\n\t\ti += 1\n\tend\n\treturn nil\nend", "title": "" }, { "docid": "96f7b5a91464be8f27646e1641b7c693", "score": "0.6682398", "text": "def find_subs(str)\n result = []\n str.chars.each_index do |idx|\n i_idx = idx # set the starting point of the i_idx to idx\n loop do\n break if i_idx > (str.size - 1)\n result << str[idx..i_idx]\n i_idx += 1\n end\n end\n p result\nend", "title": "" }, { "docid": "b892d4b4003e17a003d2bb76085b048d", "score": "0.66699135", "text": "def substring(string, position, length)\n string_array = string.chars\n string_array[position..position+length-1]\nend", "title": "" }, { "docid": "5a35ad82aeb06a4f7c6bb4d751ed9887", "score": "0.664455", "text": "def part_of_word\n @str[@first_letter..@last_letter]\n end", "title": "" }, { "docid": "4ca203883042a7fe44619a2d5addffd0", "score": "0.6638347", "text": "def first_letter(string,start,length)\n puts string[start,length]\nend", "title": "" }, { "docid": "2eae10f7444316c6625afc48c9f65441", "score": "0.6633255", "text": "def index_of_char(str, char)\n return false if str.length == 0\n i = 0\n while i < str.length\n if str[i] == char\n return i\n end\n i += 1\n end\n return nil\nend", "title": "" }, { "docid": "b7b9b05c77267c23ded45aee752ab393", "score": "0.66282856", "text": "def char_at_pos str, pos\n# str[pos-1] # this can return nil\n str[pos-1,1] # this can return \"\" or nil\nend", "title": "" }, { "docid": "4c5ee60cbcddf7b7b68777963eb21738", "score": "0.6610733", "text": "def find\n @total = {}\n @chars = @string.split('')\n build_total\n @chars.each do |char|\n return char if @total[char] == 1\n end\n nil\n end", "title": "" }, { "docid": "b01546ae9032db3c7d5c4f99a06fcfcf", "score": "0.66103023", "text": "def start_of_word(str, letters_num)\n return str[0..letters_num - 1]\nend", "title": "" }, { "docid": "a37a7a8ac6490548f60b0e74cd7a19ee", "score": "0.6600567", "text": "def index_of_char(string,char)\n if char.length > 1\n return \"Char can't be longer than one character\"\n end\n if contains_char(string,char) == false\n return nil\n end\n i = 0\n while i <= string.length-1\n if string[i] == char\n return i\n end\n i += 1\n end\nend", "title": "" }, { "docid": "3396674539f0c9ded08d0a63cff6e761", "score": "0.6600544", "text": "def index_string(string, characters)\n i = 0\n size = characters.length\n while i < string.length - size + 1\n if string[i,size] == characters\n return i\n end\n i += 1\n end\n return false\nend", "title": "" }, { "docid": "4e8fe357cc9d4b4b69ca6f1ca421f0f4", "score": "0.6593973", "text": "def next_char_in_string(char,string)\n target_index = string.index(char).next\n return string[target_index]\nend", "title": "" }, { "docid": "b9c46bb8edbee5d9ab7ac2e4dce593a2", "score": "0.65931344", "text": "def substrings_at_index(string)\n substrings = []\n string.chars.each_index do |idx|\n substrings << string[0..idx]\n end\n substrings\nend", "title": "" }, { "docid": "75c5eb84cdab3a909686bc73c1ccd2e0", "score": "0.6586474", "text": "def charecter_inString(string, char)\n i = 0\n while string[i] != char && string.length > i\n i += 1\n end\n if string.length == i\n return -1\n end\n return i\nend", "title": "" }, { "docid": "508705491004035a2078366402f60884", "score": "0.65803945", "text": "def substrings_at_start(str)\n results = []\n\n str.each_char.with_index do |_, idx|\n results << str[0..idx]\n end\n results\nend", "title": "" }, { "docid": "4bdeba3b84ac50b284bf40f9203a3b41", "score": "0.6570624", "text": "def str_str(haystack, needle)\n return 0 if needle == ''\n \n haystack.each_char.with_index do |char, index| \n return index if haystack[index..index + needle.size - 1] == needle\n end\n \n -1\nend", "title": "" }, { "docid": "9ffa921c686f644e2c8f825fba0f0f6e", "score": "0.65700865", "text": "def single_character(str, idx = 0)\n substr = str[idx]\n substr.class == Fixnum ? substr.chr : substr\n end", "title": "" }, { "docid": "a84d1e5c318bacabf3232ba915100628", "score": "0.65672284", "text": "def start_of_word(str_in, letter_num)\n\tstr_in[0...letter_num]\nend", "title": "" }, { "docid": "eb67a1591b2151cee4e151efd6d4178c", "score": "0.6566013", "text": "def custom_index (string, substring)\r\n # Return nil if substring not found in string\r\n # Return index position of substring if found in string\r\n return nil unless string.include?(substring)\r\n i = 0\r\n c = 0\r\n checked = \"\"\r\n\r\n while i < string.length\r\n unless string[i] == substring[c]\r\n c = 0\r\n checked = \"\"\r\n return nil if i == string.length - 1\r\n else\r\n checked << string[i]\r\n return (i-c) if substring == checked\r\n c += 1\r\n end\r\n i += 1\r\n end\r\n\r\nend", "title": "" }, { "docid": "673da245c0e20305078963cf870b1249", "score": "0.65642875", "text": "def order_value(word, string_index)\n esp_alpha = \"abcĉdefgĝhĥijĵklmnoprsŝtuŭvz\"\n\n order_value = nil\n letter_to_compare = word[string_index]\n\n order_value = esp_alpha.rindex(letter_to_compare)\nend", "title": "" }, { "docid": "8c96607914dc3e96418d9217f43346bf", "score": "0.65565157", "text": "def index_of_small_letter(word)\nend", "title": "" }, { "docid": "115ab4cc0f8d92170a88757ce3543c20", "score": "0.65542024", "text": "def start_of_word(str, num)\n\tstr[0,num]\nend", "title": "" }, { "docid": "4d7fce44f00e309f564dffe6c78fde86", "score": "0.6550232", "text": "def part_of_word\n\t\t@str[@first_letter..@last_letter]\n\tend", "title": "" }, { "docid": "cdef8fbec47603b34b6d83d03f21b0f8", "score": "0.65492535", "text": "def charpos(s, pos)\n\t\treturn s[:i] - s[:start] == pos - 1\n\tend", "title": "" }, { "docid": "7d2a270a66a3050ff7c0c60557866fae", "score": "0.6527785", "text": "def str_str\r\n nlength = needle.length\r\n return 0 if nlength == 0\r\n haystack.chars.each_with_index do |letter, i|\r\n return i if haystack[i, nlength] == needle\r\n end\r\n return -1\r\n end", "title": "" }, { "docid": "c7c54aeda4df61b8d10fe231afa13636", "score": "0.65149367", "text": "def position(s)\n find(s).first\n end", "title": "" }, { "docid": "ab9eaef257d54fc3eaf04d31f5733b92", "score": "0.651007", "text": "def start_of_word(string, char)\n\t string.slice(0, char)\n\tend", "title": "" }, { "docid": "45ec83eda4a0266c17d55df9dff4b3b1", "score": "0.6506367", "text": "def substring(str)\n (0...str.length).each do |char|\n p str[char..char]\n if char!= str.length - 1 \n p str[char..str.length]\n end\n end\nend", "title": "" }, { "docid": "fe0d212129988a5016c59e1761cc0179", "score": "0.65062034", "text": "def character_by_character(string)\n substrings = []\n\n string.each_char.with_index do |letter, idx|\n substrings << string[0..idx] \n end\n\n return substrings\nend", "title": "" }, { "docid": "ee5eaeedd8eac3fcc83ef6866ad526ba", "score": "0.6505911", "text": "def find_substring_brute(string, text)\n\n text.chars.each_with_index do |c, i|\n\n if c == string[0]\n\n match_count = 1\n (1..string.length - 1).each do |j|\n break if text[i + j] != string[j]\n match_count += 1\n end\n\n if match_count == string.length\n return i\n end\n end\n\n end\n\n return -1\nend", "title": "" }, { "docid": "0223dfaf26264792c896d3614b3651bd", "score": "0.647705", "text": "def substrings_at_start(str)\n str.chars.map.with_index { |_,index| str[0..index] }\nend", "title": "" }, { "docid": "ccc1327168f986d277296d663bfa69a5", "score": "0.64764875", "text": "def substrings_at_start(str)\n str.chars.map.with_index { |_, idx| str[0, idx + 1] }\nend", "title": "" }, { "docid": "326dfc15f9ddd9fdfb45ae83fce02a8b", "score": "0.6471224", "text": "def substrings_at_start(str)\n str.chars.map.with_index do |_, i|\n str[0..i]\n end\nend", "title": "" }, { "docid": "15fe7f08946d5cc20eb0b749cb7d916a", "score": "0.64592075", "text": "def position(character)\n alphabet.index(character)\n end", "title": "" }, { "docid": "4e4df280451e9c2b246e16e57c4475bf", "score": "0.6458675", "text": "def substrings_at_start(str)\r\n results = []\r\n str.chars.each_index { |idx| results << str[0..idx] }\r\n results\r\nend", "title": "" }, { "docid": "2f5a817c111ecd7a6537d0086f32f28f", "score": "0.64581025", "text": "def alphabet_position(text)\n #a的代碼是97,如果要變成1要減掉96\n text.gsub(/\\W/, \"\").downcase.bytes.map{|x| x - 96}.join(\" \")\nend", "title": "" }, { "docid": "1b4d9b04130b59b3fea6712e7fc447c8", "score": "0.64439285", "text": "def findFirstIndex(character, test_string)\n index = 0\n test_string.each_char do |c|\n break if c == character\n index += 1\n end \n\n index == test_string.length ? \"no match found\" : index\nend", "title": "" }, { "docid": "1e21e782f5abb3dc26c29a7bb74fcf9a", "score": "0.64417744", "text": "def str_str_ruby(haystack, needle)\n return 0 if needle == ''\n\n idx = haystack.index(needle)\n\n return -1 unless idx\n\n idx\nend", "title": "" }, { "docid": "da91684c0a64fee3687aa0a6822f7901", "score": "0.64362824", "text": "def my_string_index(haystack,needle)\n haystack_array = haystack.split(\"\")\n haystack_array.each do |character, index|\n if character == needle \n return index \n else\n return -1 \n end\n end\n\n end", "title": "" }, { "docid": "ad6ce0c3b8850b0cb4fd8415be353f8e", "score": "0.6407791", "text": "def kmp_search(str,substr)\n\n table = partial_match_table(substr)\n\n i = str.index(substr[0])\n idx_arr = []\n sub_len = substr.length\n matched_letter_cnt = 0\n if i\n matched_letter_cnt = 1\n return 1 if i + matched_letter_cnt >= str.length\n else\n return 0\n end\n\n # while i && i < str.length - substr.length + 1\n while i && i + substr.length < str.length\n # number of matched chars\n matched_letter_cnt += 1 while str[i + matched_letter_cnt] == substr[matched_letter_cnt]\n if matched_letter_cnt == sub_len\n idx_arr << i\n end\n\n # p matched_letter_cnt, 'matched_letter_cnt'\n # p 'here'\n partial_match = table[matched_letter_cnt-1]\n\n step = matched_letter_cnt - partial_match\n if step == 0\n i += 1\n matched_letter_cnt = 0\n else\n i += matched_letter_cnt - partial_match\n matched_letter_cnt = partial_match\n end\n \n end\n\n idx_arr.count\nend", "title": "" }, { "docid": "b83e8330d2237e2bf289164d11753877", "score": "0.6392008", "text": "def start_of_word(word, num_of_char)\n word[0..num_of_char-1]\nend", "title": "" }, { "docid": "e2580e1a81324b89a1d25085b823ec8c", "score": "0.6391546", "text": "def extract_char_sequence(char)\n sequence = ''\n i = @cursor\n if char.length == 1\n while @text[i, 1] == char do\n sequence << char\n i += 1\n end\n else\n chars = char.split('')\n while chars.include?(@text[i, 1]) do\n sequence << @text[i, 1]\n i += 1\n end\n end\n sequence\n end", "title": "" }, { "docid": "43ea2998af8b0ea97fc0406e1d848f9d", "score": "0.6389597", "text": "def start_of_word string, index\n string[0..index-1]\nend", "title": "" }, { "docid": "f852e16c6d22b1c4d521bd95a7bd8282", "score": "0.63841116", "text": "def pick_char_with_index\n byte, index = pick_byte_with_index\n [byte.chr, index]\n end", "title": "" }, { "docid": "de904be62c2330b8bddd6b0b3eecef82", "score": "0.6376187", "text": "def my_string_index(str, n)\n str.index(n)\nend", "title": "" }, { "docid": "41932cf5088f2ad1bed3c7b714cbd724", "score": "0.6365666", "text": "def substring(string, begin_num, end_num = nil)\n characters = string.chars\n return characters[begin_num] if end_num.nil?\n substring = ''\n begin_num.upto(end_num) { |index| substring << characters[index].to_s }\n substring\nend", "title": "" }, { "docid": "41932cf5088f2ad1bed3c7b714cbd724", "score": "0.6365666", "text": "def substring(string, begin_num, end_num = nil)\n characters = string.chars\n return characters[begin_num] if end_num.nil?\n substring = ''\n begin_num.upto(end_num) { |index| substring << characters[index].to_s }\n substring\nend", "title": "" }, { "docid": "4bc080bbef4533cc68cc0fd23f681c31", "score": "0.63480705", "text": "def chr\n substring 0, 1\n end", "title": "" }, { "docid": "2b14fe0ecb795a7cf50161831d4dd9d5", "score": "0.63469154", "text": "def substrings(str)\n results = []\n\n str.each_char.with_index do |char1, idx1|\n str.each_char.with_index do |char2, idx2|\n results << str[idx1..idx2] if idx2 >= idx1\n end\n end\n\n results\nend", "title": "" }, { "docid": "470b44796e14400f99937b45969e60aa", "score": "0.6344428", "text": "def substrings_at_start(string)\n string.chars.map.with_index { |_, index| string[0..index] }\nend", "title": "" }, { "docid": "ad6799dd643b3f95c23bd3fc4e831652", "score": "0.6342632", "text": "def findCharacter(charToFind, startPosition)\n # Return Position Or nil\n return @gameWord[startPosition, getWordLength].index(charToFind)\n end", "title": "" }, { "docid": "7d0731d96b9fdad6d90e41685e3978ed", "score": "0.63316685", "text": "def substrings_at_start(string)\n string.chars.map.with_index do |_, idx|\n string[0..idx]\n end\nend", "title": "" }, { "docid": "f4be412cdbd698facd94328b0948655e", "score": "0.63280284", "text": "def findSubStringPosition(str1, str2)\n str1_arr = str1.scan('')\n str1_arr.each_with_index do |outer, i|\n str1_arr.each_with_index do |inner, j|\n if str1[i..j] == str2\n puts i\n end\n end\n end\n nil\nend", "title": "" }, { "docid": "18f4b44c492a86ab189cc4be490c7097", "score": "0.63242376", "text": "def substrings_at_start(string)\n string.chars.map.with_index { |_, idx| string[0..idx] }\nend", "title": "" }, { "docid": "18f4b44c492a86ab189cc4be490c7097", "score": "0.63242376", "text": "def substrings_at_start(string)\n string.chars.map.with_index { |_, idx| string[0..idx] }\nend", "title": "" }, { "docid": "e26ee473edbe6200bea6b9d726129379", "score": "0.6318525", "text": "def pick_char_with_index!\n byte, index = pick_byte_with_index!\n [byte.chr, index]\n end", "title": "" }, { "docid": "92fea45c11c58339d233e37be0310ef0", "score": "0.6313835", "text": "def to_pos(str)\n r= str.downcase\n case r\n when \"a\"\n r = 0\n when \"b\"\n r = 1\n when \"c\"\n r = 2\n when \"d\"\n r = 3 \n when \"e\"\n r = 4\n when \"f\"\n r = 5\n when \"g\"\n r = 6\n when \"h\"\n r = 7\n end \n return r \n end", "title": "" }, { "docid": "92fea45c11c58339d233e37be0310ef0", "score": "0.6313835", "text": "def to_pos(str)\n r= str.downcase\n case r\n when \"a\"\n r = 0\n when \"b\"\n r = 1\n when \"c\"\n r = 2\n when \"d\"\n r = 3 \n when \"e\"\n r = 4\n when \"f\"\n r = 5\n when \"g\"\n r = 6\n when \"h\"\n r = 7\n end \n return r \n end", "title": "" }, { "docid": "233bf80e80192923b234ac03f9fd20ca", "score": "0.6311174", "text": "def my_string_index(haystack, needle)\n index = haystack.index(needle)\n if index\n return index\n else\n return -1\n end\n\nend", "title": "" }, { "docid": "3ff4337103a1e419794897b775450184", "score": "0.6301867", "text": "def start_of_word(word, letters)\n\tword[0..(letters-1)]\nend", "title": "" }, { "docid": "f4b3bbbb2b98ee344214bd13a12e3c9c", "score": "0.63012123", "text": "def substrings_at_start(str)\n substrings = []\n str.chars.each_with_index { |_, index| substrings << str[0..index] }\n substrings\nend", "title": "" }, { "docid": "f4b3bbbb2b98ee344214bd13a12e3c9c", "score": "0.63012123", "text": "def substrings_at_start(str)\n substrings = []\n str.chars.each_with_index { |_, index| substrings << str[0..index] }\n substrings\nend", "title": "" }, { "docid": "7ab5b5f5d0ba1c39c27a22acc0792f6e", "score": "0.6298951", "text": "def seven(string)\n string.downcase.index(/a|e|i|o|u/)\nend", "title": "" }, { "docid": "5c2e56a277874d021fa733f904b3c2ac", "score": "0.62945133", "text": "def sub_string(s, i=0, l=1)\n\ts[i,l]\nend", "title": "" }, { "docid": "72437be833fecf8999d9e39661586311", "score": "0.62938565", "text": "def index str, offset = 0\n result = 0\n _end = 0\n @chunks.each { |e| txt = e.text; \n _end += txt.length \n if _end < offset\n result += e.text.length \n next\n end\n\n ix = txt.index(str) \n if ix\n _off = result + ix\n return _off if _off > offset\n end\n result += e.text.length \n }\n return nil\n end", "title": "" }, { "docid": "0b4e6f5857ca1e5a00255de06286a6b3", "score": "0.62837493", "text": "def indexes_of_char(p_char)\n (0 ... self.length).find_all { |i| self[i,1] == p_char }\n end", "title": "" }, { "docid": "5d8da0a65e2c9ea9e111a0d6e818d91b", "score": "0.6269201", "text": "def index_of_small_letter(word)\n (0..word.length).select{|i| word[i] =~ /[a-z]/}\nend", "title": "" } ]
769117710083812818e56e49277956c2
reset to initial state
[ { "docid": "e6b7026b69b292451ed8d18d78bed8ab", "score": "0.0", "text": "def reset!\n @x = @init_x\n @y = @init_y\n end", "title": "" } ]
[ { "docid": "2064dc79965cdd0af12bfd8cd5d96fc5", "score": "0.8459113", "text": "def reset\n end", "title": "" }, { "docid": "2064dc79965cdd0af12bfd8cd5d96fc5", "score": "0.8459113", "text": "def reset\n end", "title": "" }, { "docid": "12ac7c0f67b29f06a45042207fdbffe5", "score": "0.8416927", "text": "def reset\n end", "title": "" }, { "docid": "12ac7c0f67b29f06a45042207fdbffe5", "score": "0.8416927", "text": "def reset\n end", "title": "" }, { "docid": "12ac7c0f67b29f06a45042207fdbffe5", "score": "0.8416927", "text": "def reset\n end", "title": "" }, { "docid": "12ac7c0f67b29f06a45042207fdbffe5", "score": "0.8416927", "text": "def reset\n end", "title": "" }, { "docid": "30a4b4f07cae560a92ab30a60e19c850", "score": "0.8350685", "text": "def reset_state\n @state = nil\n end", "title": "" }, { "docid": "aa55795959ae5eb4af049616a71e7a10", "score": "0.8345479", "text": "def reset() end", "title": "" }, { "docid": "416b840132cd0b3d6ad06a7b5a026f25", "score": "0.8342402", "text": "def reset\n # TODO\n end", "title": "" }, { "docid": "b794200e94ae72ad0a41f662e805f567", "score": "0.8331307", "text": "def reset()\n \n end", "title": "" }, { "docid": "9c84ab012711cd138182306c11bb4cf4", "score": "0.8318983", "text": "def reset!\n initialize\n end", "title": "" }, { "docid": "cf0f38b880709f5df7a38dce392befb1", "score": "0.8299501", "text": "def reset\n end", "title": "" }, { "docid": "cf0f38b880709f5df7a38dce392befb1", "score": "0.8299501", "text": "def reset\n end", "title": "" }, { "docid": "29bf4204e61ee325176a4eae7a4af8de", "score": "0.8290421", "text": "def reset\n\n end", "title": "" }, { "docid": "4b31745de03adea764ea4eb4f0d47c09", "score": "0.82638866", "text": "def reset!\n end", "title": "" }, { "docid": "4b31745de03adea764ea4eb4f0d47c09", "score": "0.82638866", "text": "def reset!\n end", "title": "" }, { "docid": "ba67786be1333f2bc8c15b10b1e674b1", "score": "0.82520837", "text": "def reset\n\t\tend", "title": "" }, { "docid": "93f437f3bb08edc3159a572d76960411", "score": "0.8222003", "text": "def reset ; end", "title": "" }, { "docid": "16e7263732d2522aa71dff263cebe964", "score": "0.8211509", "text": "def reset()\n end", "title": "" }, { "docid": "3b3ceed0dfa10a89ab732859d9e6aaed", "score": "0.81760585", "text": "def reset\n\n end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "d2c14df46cef0bb2141b95088dddd003", "score": "0.81749403", "text": "def reset; end", "title": "" }, { "docid": "26621ae7dc85308805ef875214ac0071", "score": "0.81025463", "text": "def reset\n set InitialPosition\n end", "title": "" }, { "docid": "e2a6b03de02f3835fa7ab1c093ac5b56", "score": "0.80941683", "text": "def reset\n # Empty, but subclasses will override this.\n end", "title": "" }, { "docid": "098fc0478eeafa530299fc236d4e6cfd", "score": "0.8085507", "text": "def reset\n \n end", "title": "" }, { "docid": "8b9e41ae2a0ac4e557b492065b449fe8", "score": "0.8065314", "text": "def reset\n @state = :entry\n end", "title": "" }, { "docid": "80d5e901ab0f7cab1c046178d4f784bc", "score": "0.80608344", "text": "def reset()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "80d5e901ab0f7cab1c046178d4f784bc", "score": "0.80608344", "text": "def reset()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "789dbce87baa186bd1b17d3849386bcd", "score": "0.8044308", "text": "def reset\n self\n end", "title": "" }, { "docid": "184a0950909a31a88127bcada91ce547", "score": "0.80439335", "text": "def reset!; end", "title": "" }, { "docid": "184a0950909a31a88127bcada91ce547", "score": "0.80439335", "text": "def reset!; end", "title": "" }, { "docid": "184a0950909a31a88127bcada91ce547", "score": "0.80439335", "text": "def reset!; end", "title": "" }, { "docid": "184a0950909a31a88127bcada91ce547", "score": "0.80439335", "text": "def reset!; end", "title": "" }, { "docid": "fc52c2d0483125eb4e3d84b03e4b03f6", "score": "0.78590184", "text": "def resets; end", "title": "" }, { "docid": "8475cb83c38f5151baa22cc96f6b9868", "score": "0.78480494", "text": "def reset\n initialize\n setup\n end", "title": "" }, { "docid": "b3b7cda7ae849d27c79d31c911381e78", "score": "0.78296393", "text": "def reset\n raise \"Not implemented\"\n end", "title": "" }, { "docid": "5762158d147a190151dab9811305b7c7", "score": "0.7816211", "text": "def reset!\n tap { set_defaults }\n end", "title": "" }, { "docid": "1755d15443932c1b3ab36b215e2b3cdf", "score": "0.7778663", "text": "def reset\n setup\n end", "title": "" }, { "docid": "a756ecce4ff0f10ec73b6b57b59f6e8a", "score": "0.77693444", "text": "def reset\n each(&:reset)\n self\n end", "title": "" }, { "docid": "77e6e06f27eeaf203b225a4e3568278a", "score": "0.7732193", "text": "def reset\n cleanup(true)\n end", "title": "" }, { "docid": "9efdacf49fb578104958d8fd72b96c29", "score": "0.77238286", "text": "def reset\n clear\n @position = 0\n @current_index = 0\n end", "title": "" }, { "docid": "b7006ea57782a9268e60ebb106485028", "score": "0.77213675", "text": "def reset\n @current = 0\n @state = :stopped\n end", "title": "" }, { "docid": "f7e7940c9d08ba5ae2223e787bbf118c", "score": "0.7609116", "text": "def reset\n dup.reset!\n end", "title": "" }, { "docid": "136fbbfc41944810614049239e9f5b7e", "score": "0.7607288", "text": "def reset\n\t\t@r = 0\n\t\t@p = 0\n\t\t@t = 0\n\t\t@l = 0\n\t\t@s = 0\n\tend", "title": "" }, { "docid": "120c2466985d751084a82ba70e9c622f", "score": "0.75968075", "text": "def reset\n @current = nil\n @pos = 0\n end", "title": "" }, { "docid": "96673715855128a7e591d1aa658b962e", "score": "0.7592826", "text": "def reset!\n instance.reset!\n end", "title": "" }, { "docid": "96673715855128a7e591d1aa658b962e", "score": "0.7592826", "text": "def reset!\n instance.reset!\n end", "title": "" }, { "docid": "bfcfd295dc4db13480ea25f8b24bf7b5", "score": "0.75700396", "text": "def internal_reset(initial_value); end", "title": "" }, { "docid": "93f22cdbf0328d9e725fb01615dba22e", "score": "0.7561921", "text": "def reset!\n self.instance.reset!\n end", "title": "" }, { "docid": "93f22cdbf0328d9e725fb01615dba22e", "score": "0.7561921", "text": "def reset!\n self.instance.reset!\n end", "title": "" }, { "docid": "ccdca4cb7b325d5c1b70bfef247b7cd6", "score": "0.7553529", "text": "def reset\n super\n end", "title": "" }, { "docid": "84f48ef14863124d2795c9d1d77e4e2b", "score": "0.75417286", "text": "def reset\n @count = 0\n end", "title": "" }, { "docid": "147e4beb6f5a92ee73e768868f955ddb", "score": "0.7540332", "text": "def reset\n @round = 0\n @turn = 0 \n assign_player_colors\n seat_players\n seed_player_funds\n reset_state_bins\n add_home_state_picks\n pick_who_goes_first\n start_at_first_day\n end", "title": "" }, { "docid": "6ee8ec51c5cfc00436959ceb8caac835", "score": "0.75249296", "text": "def reset\n invoke_on_reset_callbacks\n self\n end", "title": "" }, { "docid": "1d81bdab3027b3ead8d0e70c5e2fbb29", "score": "0.75215095", "text": "def do_reset\n\t\t\n\t\t\t# Mark state as reset\n\t\t\t@reset = true\n\t\t\t\n\t\t\t# Revert text and palette\n\t\t\tself.text = nil \n\t\t\tself.palette = @palette_normal\t\t\t\n\t\tend", "title": "" }, { "docid": "c103287b2a05cfb21b29bb588f507244", "score": "0.75067616", "text": "def reset(_object); end", "title": "" }, { "docid": "ab473ac5326d263db515d7ddbe91e29b", "score": "0.7489539", "text": "def reset()\n @x\n \n end", "title": "" }, { "docid": "e110d8603b352c3bfa6881a01f785626", "score": "0.74795276", "text": "def initialize\r\n reset\r\n end", "title": "" }, { "docid": "b80a7bc33e20d11f972e41d53f0778fe", "score": "0.7470338", "text": "def reset\n initialize\n @log = nil\n @default_model = nil\n end", "title": "" }, { "docid": "16d62b0b82fc65468c2224d738779e05", "score": "0.74682075", "text": "def reset\n\t\tself.state = \"off\"\n\t\tself.content_text = \"\"\n\t\tself.title_text = \"\"\n\t\tself.components.each do |c|\n\t\t\tc.reset\n\t\tend\n\tend", "title": "" }, { "docid": "bb678f5c8cb1fac21d2dfff06edcae4e", "score": "0.74565387", "text": "def clearState()\n\t\t\t@_previous_state = @_state\n\t\t\t@_state = nil\n\t\tend", "title": "" }, { "docid": "bee28ed71670e75b9d537a86a598ba72", "score": "0.745498", "text": "def initialize\n reset\n end", "title": "" }, { "docid": "bee28ed71670e75b9d537a86a598ba72", "score": "0.745498", "text": "def initialize\n reset\n end", "title": "" }, { "docid": "bee28ed71670e75b9d537a86a598ba72", "score": "0.745498", "text": "def initialize\n reset\n end", "title": "" }, { "docid": "bee28ed71670e75b9d537a86a598ba72", "score": "0.745498", "text": "def initialize\n reset\n end", "title": "" }, { "docid": "bf9acef98938f0fab203d2dd02e14131", "score": "0.74521756", "text": "def reset\n\t\tdo_send('ARST 2')\n\tend", "title": "" }, { "docid": "ec14a028f0b8a9aaae4f57443d336e05", "score": "0.7436487", "text": "def reset_initial_values\n @initial_values.clear if @initial_values\n @missing_initial_values.clear if @missing_initial_values\n end", "title": "" }, { "docid": "c3279c2d628a603ea793a3ec99cad6c0", "score": "0.742557", "text": "def reset\n @value = nil\n end", "title": "" }, { "docid": "5ae29273ca35b21252997597471d6e1a", "score": "0.7384418", "text": "def reset\n getok 'RSET'\n end", "title": "" }, { "docid": "9e9bec5ee2824f16916dc266723bb66c", "score": "0.73816663", "text": "def initialize\n reset\n end", "title": "" }, { "docid": "9e9bec5ee2824f16916dc266723bb66c", "score": "0.73816663", "text": "def initialize\n reset\n end", "title": "" }, { "docid": "ed75c1f38d8ede7b806cc6c2a7ccdb25", "score": "0.7365805", "text": "def reset\n @data = nil\n end", "title": "" }, { "docid": "03fc8d766ed8c90711047bcea30b01c5", "score": "0.7344167", "text": "def clear\n current_state.clear\n end", "title": "" }, { "docid": "6e5a1d549dc5d45b6d76e4159f427c49", "score": "0.7342973", "text": "def reset\n @value = nil\n @count = 0\n end", "title": "" }, { "docid": "f73f8dcfa71cf630d71878b1198ce6c5", "score": "0.73194194", "text": "def reset\n @cursor = Point.new(0, 0)\n @delta = Point.new(0, 1)\n @stores = Code::FINAL_CONSONANTS.times.map do |consonant|\n case consonant\n when 21 then Queue.new # ㅇ\n when 27 then Port.new # ㅎ\n else Stack.new\n end\n end\n @selected_store = @stores[0]\n @finished = false\n end", "title": "" }, { "docid": "2351b80cde768122f6a918f8c6d19fae", "score": "0.7315895", "text": "def reset\n\t\tself.rs \t= 0\n\t\tself.ps \t= 0\n\t\tself.ss \t= 0\n\t\tself.gen\t= Random.new(SEED)\n\tend", "title": "" }, { "docid": "033b677bb63bf07d243522e2d896cdc9", "score": "0.7308984", "text": "def reset()\n @result = false\n @tests = 0\n end", "title": "" }, { "docid": "a8c83d77a02abf68c44521094ff32ab1", "score": "0.73065317", "text": "def reset!\n # this should be overridden by concrete adapters\n end", "title": "" }, { "docid": "d8037872f6a3429abde1df9789d3284e", "score": "0.7289528", "text": "def reset\n @loaded = false\n @target = nil\n @stale_state = nil\n end", "title": "" }, { "docid": "d8037872f6a3429abde1df9789d3284e", "score": "0.7289528", "text": "def reset\n @loaded = false\n @target = nil\n @stale_state = nil\n end", "title": "" }, { "docid": "b1fa6a5be334f9d25bc2bfa3cad4e0a1", "score": "0.7284378", "text": "def initialize\n # reset\n end", "title": "" }, { "docid": "fb3f63bdc2798b29de3609660a4f1219", "score": "0.7280971", "text": "def initialize\n reset\n \tend", "title": "" }, { "docid": "578a6001212bd4cbbb0016edbcba473f", "score": "0.7269643", "text": "def reset!\n @cache = nil\n end", "title": "" }, { "docid": "c8028345105de66614a5540bd87c501b", "score": "0.72615564", "text": "def reset\n @parsers = nil\n @transformer = nil\n @cache = nil\n end", "title": "" }, { "docid": "c2f39192928174bc698369aa8b622208", "score": "0.7260404", "text": "def reset()\n\n\t\t@aChecksum = [ 0xFF, 0xFF ];\n\n\tend", "title": "" } ]
55538d4f1fb05ef97c12d3e000e1632e
Run before every test
[ { "docid": "806de411176d6fd49f9bcb245938b7fb", "score": "0.0", "text": "def setup\n File.delete(DB_NAME) if File.exist?(DB_NAME)\n end", "title": "" } ]
[ { "docid": "adbfdc9f43bde6e2d37ba07928b011d4", "score": "0.8145802", "text": "def before_each_test\nend", "title": "" }, { "docid": "83fb7bfbd0700b1d2cf6e17bb20b283a", "score": "0.8108899", "text": "def before_test\n end", "title": "" }, { "docid": "31af79b9c5e648e754d8dc04417bd9a7", "score": "0.7832402", "text": "def before_suites\n @before_all.call unless @before_all.nil?\n end", "title": "" }, { "docid": "a3e77c4b438be75fccee1cd2e7cdae87", "score": "0.7694849", "text": "def before_run() end", "title": "" }, { "docid": "a3e77c4b438be75fccee1cd2e7cdae87", "score": "0.7694849", "text": "def before_run() end", "title": "" }, { "docid": "9db58fdcb9fcee33ed8e8753ab71d525", "score": "0.7652977", "text": "def before_test_run(&block)\n @before_test_run = block\n end", "title": "" }, { "docid": "da88436fe6470a2da723e0a1b09a0e80", "score": "0.7611746", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "6ccc5c9128392044df2547cd9761b123", "score": "0.76042736", "text": "def before_each_test(&block)\n $before_each_test = lambda { yield }\nend", "title": "" }, { "docid": "7af501dfbc981a76f4c18b19b5b63aa4", "score": "0.7576845", "text": "def run_before_scripts\n return if @config['before_script'].empty?\n\n puts 'INFO: Running pre test scripts'\n @config['before_script'].each do |cmd|\n run cmd\n end\n end", "title": "" }, { "docid": "2553581b1d71725102c1bf828fafafb4", "score": "0.75754863", "text": "def before_all; end", "title": "" }, { "docid": "2553581b1d71725102c1bf828fafafb4", "score": "0.75754863", "text": "def before_all; end", "title": "" }, { "docid": "54bc5dcae180a37208662771ff8732ce", "score": "0.7560231", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "66c9b3e3b37433834d9e1d4320c0b8e7", "score": "0.75100374", "text": "def before_load(test_files); end", "title": "" }, { "docid": "9f52b398965c30f67f89a622c9e74688", "score": "0.75046885", "text": "def setup(&block)\n before(:each, &block)\n end", "title": "" }, { "docid": "5c05ee8144a980e20d6e9215aef247a3", "score": "0.7431112", "text": "def before\n _init_env\n end", "title": "" }, { "docid": "7e4c0133479ee4bf706a5cbecad40b4a", "score": "0.74168736", "text": "def before_all\n end", "title": "" }, { "docid": "ddfcff0d84ef8d13c9aa60027a03ee42", "score": "0.73738545", "text": "def before_run;; end", "title": "" }, { "docid": "9cffb775aa02c1d8265e0ca380519549", "score": "0.7366481", "text": "def before_run; end", "title": "" }, { "docid": "9cffb775aa02c1d8265e0ca380519549", "score": "0.7366481", "text": "def before_run; end", "title": "" }, { "docid": "9cffb775aa02c1d8265e0ca380519549", "score": "0.7366481", "text": "def before_run; end", "title": "" }, { "docid": "9cffb775aa02c1d8265e0ca380519549", "score": "0.7366481", "text": "def before_run; end", "title": "" }, { "docid": "9cffb775aa02c1d8265e0ca380519549", "score": "0.7366481", "text": "def before_run; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.73484445", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.73484445", "text": "def before_setup; end", "title": "" }, { "docid": "5387b01f3ddbf37f87f91baabff5116a", "score": "0.7339434", "text": "def setupBeforeTestTest\n assert @setup, 'setup instance method MUST be run before test'\n end", "title": "" }, { "docid": "d426cd958551ac3ab8cb35bec0dbbfc4", "score": "0.73277926", "text": "def before\n end", "title": "" }, { "docid": "d426cd958551ac3ab8cb35bec0dbbfc4", "score": "0.73277926", "text": "def before\n end", "title": "" }, { "docid": "d426cd958551ac3ab8cb35bec0dbbfc4", "score": "0.73277926", "text": "def before\n end", "title": "" }, { "docid": "c7ef6a5f10a451df31d0e088000ac04a", "score": "0.7327579", "text": "def before_load(test_files)\n end", "title": "" }, { "docid": "c7ef6a5f10a451df31d0e088000ac04a", "score": "0.7327579", "text": "def before_load(test_files)\n end", "title": "" }, { "docid": "c7ef6a5f10a451df31d0e088000ac04a", "score": "0.7327579", "text": "def before_load(test_files)\n end", "title": "" }, { "docid": "93ed7b63471afceca7ce124f4f8fbcd4", "score": "0.7323481", "text": "def before_run\n end", "title": "" }, { "docid": "6d63759364c65ebadc5fc4ca7d8aee63", "score": "0.7242763", "text": "def setup_before(pre_before)\n @before = Register.new pre_before.size, pre_before.register\n end", "title": "" }, { "docid": "31af21fb0a87821e8e8a82b0c71eb2bb", "score": "0.7188313", "text": "def before_run\n end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.7176739", "text": "def before_setup\n\n end", "title": "" }, { "docid": "07f06dd08df6ab05400a01766c8b346c", "score": "0.71715504", "text": "def test_setup\n \n end", "title": "" }, { "docid": "fd3002bddc15309761c18ce8e2b2b153", "score": "0.71103567", "text": "def testcase_setup\n end", "title": "" }, { "docid": "dbcf947dfe087583c48f2204108bbec3", "score": "0.71018654", "text": "def before() nil end", "title": "" }, { "docid": "7ce4b2ad3f71e712005007a690a16421", "score": "0.7087511", "text": "def before_all\n expected_state(:Initialized)\n\n # Execute before all hook code\n run_code_block\n\n # Execute file actions\n builtin_actions = ActionTriplet.builtin(:before_all)\n custom_actions = ActionTriplet.new(config.before_all_f_actions)\n run_triplets([builtin_actions, custom_actions])\n @state = :ReadyToRun\n end", "title": "" }, { "docid": "f6592c738c27ed89bfaecebf7ae74efa", "score": "0.7073662", "text": "def test_setup\n end", "title": "" }, { "docid": "4c23552739b40c7886414af61210d31c", "score": "0.7067671", "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": "521400b0d599a8bc4f853466b0126969", "score": "0.70226073", "text": "def before_stuff \n ...before code... \nend", "title": "" }, { "docid": "7785b5dc1fce9e69b23159d00241eb3e", "score": "0.69586986", "text": "def run_before_hooks\n run_hooks(self.class.before_hooks)\n end", "title": "" }, { "docid": "2782caff92f9708c3278c9dd4fd6f363", "score": "0.6953496", "text": "def preRun\n end", "title": "" }, { "docid": "3e7b3b2ed11535af965a3fd6457b5dc0", "score": "0.6920427", "text": "def before_all(&block)\n @runner.set_before_all(@current_platform, block)\n end", "title": "" }, { "docid": "5ea83cb96ce194504ef28a81810efa08", "score": "0.68826616", "text": "def execute_before_methods\n self.class.__send__(:before_method)&.each { |method_name| __send__(method_name) }\n end", "title": "" }, { "docid": "a5afb3290031a0a9ec78341e860883d2", "score": "0.68702316", "text": "def before(hook=:all, &block)\n setting_callback(hook, \n :all => :@before_callback, \n :each_ruby => :@before_each_ruby_callback, \n :env => :@before_environment_callback, &block)\n end", "title": "" }, { "docid": "a5afb3290031a0a9ec78341e860883d2", "score": "0.68702316", "text": "def before(hook=:all, &block)\n setting_callback(hook, \n :all => :@before_callback, \n :each_ruby => :@before_each_ruby_callback, \n :env => :@before_environment_callback, &block)\n end", "title": "" }, { "docid": "85d5acfa53122c2747b7ef5113bc3367", "score": "0.6869296", "text": "def before_run\n DemoLogger.log.info(\"----------------------- Minitest - starting class setup -----------------------\")\n Minitest.after_run {\n DemoLogger.log.info(\"----------------------- Minitest - starting class teardown -----------------------\")\n # Log the unique top stack traces.\n DemoLogParser.parse(DemoLogger.log_directory, '/tests/')\n }\nend", "title": "" }, { "docid": "8390315bbb435a8727ea72a217d8a57f", "score": "0.68620664", "text": "def before(at=:each, &block)\n @runner.before(at, &block)\nend", "title": "" }, { "docid": "d9416d3f24b6d1fe2aaa70b9a3ac3e4b", "score": "0.68588006", "text": "def before\n true\n end", "title": "" }, { "docid": "3e584b7042cf53d24843d106360f2e00", "score": "0.68350595", "text": "def call_before_all\n @before_all.each(&:call)\n end", "title": "" }, { "docid": "d54194c3047d6e5565f7807780e760f2", "score": "0.68168056", "text": "def before; end", "title": "" }, { "docid": "d54194c3047d6e5565f7807780e760f2", "score": "0.68168056", "text": "def before; end", "title": "" }, { "docid": "d54194c3047d6e5565f7807780e760f2", "score": "0.68168056", "text": "def before; end", "title": "" }, { "docid": "d54194c3047d6e5565f7807780e760f2", "score": "0.68168056", "text": "def before; end", "title": "" }, { "docid": "ec7554018a9b404d942fc0a910ed95d9", "score": "0.67965084", "text": "def before_setup(&block)\n pre_setup_actions.unshift block\n end", "title": "" }, { "docid": "f347f7ea9be822fd0cecffc1f974233f", "score": "0.67820615", "text": "def pre_before(context, &block)\n end", "title": "" }, { "docid": "e9e5469b6849fe639d968a5202a6332a", "score": "0.67258096", "text": "def BeforeAll(name: T.unsafe(nil), &proc); end", "title": "" }, { "docid": "3b211bbb6536835af42a15a41ad72640", "score": "0.6704604", "text": "def before(type=nil, &block)\n if type == :all\n define_method(:before_all) do\n super()\n instance_exec(&block)\n end\n nil\n else\n super\n end\n end", "title": "" }, { "docid": "3319f0537899445404c1874f0ba286bd", "score": "0.6697289", "text": "def before_all(&block)\n @before_all << block\n end", "title": "" }, { "docid": "e9e957f34668d8b2d72dc3086b045f34", "score": "0.6693631", "text": "def before_examples(examples)\n tc_before_examples(examples)\n end", "title": "" }, { "docid": "7b375f73958b487232f009643c2cbbbc", "score": "0.668694", "text": "def before_all(&block)\n yield if block_given?\nend", "title": "" }, { "docid": "74e6cbc0fbead9af5f3b4b2787bd4bcd", "score": "0.668204", "text": "def before &block\n hook(:before, &block)\n end", "title": "" }, { "docid": "f4cce6bf0ccc34e7fbd02a3750a4d5ca", "score": "0.66618544", "text": "def before(test = nil, &blk)\n hooks[:before] << {test: test, block: blk}\n end", "title": "" }, { "docid": "26f56b857dab6741773281d459f74aec", "score": "0.66446507", "text": "def before(&block)\n if Context.current_context\n Context.current_context.setups << block\n else\n self.add_setup_hook(nil, &block)\n end\n end", "title": "" }, { "docid": "fb4ae72df13f5f0572da288d4396067b", "score": "0.6631296", "text": "def before\n setup_supporters if use_supporters\n send(:setup) if respond_to? :setup\n end", "title": "" }, { "docid": "74fc2410c63a7682223e2add4973b0c5", "score": "0.6630073", "text": "def pre_setup_suite()\n @cfg['pre_setup'] =\"defined\"\n return true\n end", "title": "" }, { "docid": "b71725bba4452b366e14ce5a36f91a5b", "score": "0.6607955", "text": "def before_setup\n info :before_setup\n setup_ssh_key if needs?(:ssh_key)\n setup_git_config if needs?(:git)\n setup_git_http_user_agent\n end", "title": "" }, { "docid": "4f2c7903d7d80789a8ecd5dfe5aa1186", "score": "0.6606303", "text": "def testFixtureSetup()\n end", "title": "" }, { "docid": "4f2c7903d7d80789a8ecd5dfe5aa1186", "score": "0.6606303", "text": "def testFixtureSetup()\n end", "title": "" }, { "docid": "5a628fb61130e971532ad3ae10b6ec45", "score": "0.6577986", "text": "def test_setup\r\n \r\n end", "title": "" }, { "docid": "9954e2e1edd72b01cff6dd36e3536869", "score": "0.6576094", "text": "def run_before_each\n example_group_hierarchy.run_before_each(self)\n end", "title": "" }, { "docid": "61610274315e4651a0510f0e7d9206b3", "score": "0.65700644", "text": "def setup\n ApplicationController.allow_forgery_protection = true\n\n # This should be automatically removed at the beginning of each test,\n # but for some reason it is not nil before the very first test run.\n # If it is not removed, then all sessions opened in your test will have\n # the identical session instance, breaking some tests. This is probably\n # a bug in rails, but as of 20190101 it is required.\n @integration_session = nil\n\n # Treat Rails html requests as coming from non-robots.\n # If it's a bot, controllers often do not serve the expected content.\n # The requester looks like a bot to the `browser` gem because the User Agent\n # in the request is blank. I don't see an easy way to change that. -JDC\n Browser::Bot.any_instance.stubs(:bot?).returns(false)\n end", "title": "" }, { "docid": "d5a6392d95e8bc4ef73fb2e93190a7d4", "score": "0.65386695", "text": "def run_passes\n run_before FIRST_PASS\n run_after FIRST_PASS\n end", "title": "" }, { "docid": "1a22ef794fd7c9dd75d46c939c73f3ee", "score": "0.6534544", "text": "def before(scope=:each, &block)\n instance_eval &block\n end", "title": "" }, { "docid": "daf0da6f8b9404fc3b8008adb232ed21", "score": "0.65326524", "text": "def convert_setup_method\n test_case.gsub!(/def setup/,\"before(:each) do\")\n \n end", "title": "" }, { "docid": "34ad4cf24455c54d514916e9b29b9227", "score": "0.6508369", "text": "def setup\n # do nothing by default\n end", "title": "" }, { "docid": "0d13b7259f9545fdb6e01c385251304d", "score": "0.6505865", "text": "def before_test(test)\n last_test = tests.last\n if last_test.class != test.class\n after_suite(last_test.class) if last_test\n before_suite(test.class)\n end\n end", "title": "" }, { "docid": "51a03e5f505f31e7d475102bb825063a", "score": "0.6492758", "text": "def before_init; end", "title": "" }, { "docid": "5b8ad5e0c40cf83fc997a4cc0cf188ec", "score": "0.6490789", "text": "def before_all\n super\n create_metadata_stuff\n ApolloTracing.stubs(:start_proxy)\n Pusher::Client.any_instance.stubs(:trigger)\n Pusher::Client.any_instance.stubs(:post)\n ProjectMedia.any_instance.stubs(:clear_caches).returns(nil)\n Bitly::V3::Client.any_instance.stubs(:shorten).returns(OpenStruct.new({ short_url: \"http://bit.ly/#{random_string}\" }))\n # URL mocked by pender-client\n @url = 'https://www.youtube.com/user/MeedanTube'\n end", "title": "" }, { "docid": "0f44231713307aaf47125e52cbdb5508", "score": "0.64773995", "text": "def before_all(&block)\n AOP[self][:before_all] = block\n end", "title": "" }, { "docid": "458649415fade90ccab13756ca262cd2", "score": "0.6476263", "text": "def before(opts); end", "title": "" }, { "docid": "eb0384fae021f42a6640c39114d676dc", "score": "0.64728993", "text": "def before &block\n block.call\n end", "title": "" }, { "docid": "e319cc704698b8a7c4b5bc4b75585046", "score": "0.6469381", "text": "def testing_begin(files)\n end", "title": "" }, { "docid": "93711a5c6893356ab65f646f4e2f8b82", "score": "0.64613867", "text": "def before_hook\n end", "title": "" }, { "docid": "340ae187763e8cd752bda82d9c6873f3", "score": "0.6455276", "text": "def setup\n @setup_called = true\n end", "title": "" }, { "docid": "731b692d3b121935827cbcfa31300517", "score": "0.6453605", "text": "def before_suites\n LinkedData::SampleData::Ontology.delete_ontologies_and_submissions\n @@ontologies = LinkedData::SampleData::Ontology.sample_owl_ontologies\n @@sty = LinkedData::SampleData::Ontology.load_semantic_types_ontology\n annotator = Annotator::Models::NcboAnnotator.new\n annotator.init_redis_for_tests\n annotator.create_term_cache_from_ontologies(@@ontologies, true)\n annotator.redis_switch_instance\n # Ontology analytics data\n annotator.redis.set('ontology_analytics', Marshal.dump(ANALYTICS_DATA))\n annotator.redis.set('ontology_rank', Marshal.dump(ONTOLOGY_RANK_DATA))\n end", "title": "" }, { "docid": "5f270beac3a21be7a9fcb31d8837c52f", "score": "0.64534044", "text": "def before_all(&block)\n aspects[:before][:all] = block\n end", "title": "" }, { "docid": "4a1a7cf2446b7c93ac46564b21e0801a", "score": "0.64457303", "text": "def setup\n Byebug.handler = Byebug::CommandProcessor.new(Byebug::TestInterface.new)\n Byebug.breakpoints.clear if Byebug.breakpoints\n Byebug.catchpoints.clear if Byebug.catchpoints\n Byebug.stubs(:run_init_script)\n Byebug::Context.stubs(:ignored_files).returns(ignored_files)\n\n set_defaults\n end", "title": "" }, { "docid": "959ba791fa8bbb84b845730b22e5f2cf", "score": "0.6445311", "text": "def setup\n ApplicationController.allow_forgery_protection = true\n\n # NOTE: Shouldn't be necessary, but in case:\n # Capybara.reset_sessions!\n\n # needed for selenium\n Capybara.server = :webrick\n\n # Webdrivers.logger.level = :debug\n # TODO: Move this, it gets called tooo often\n # Webdrivers::Geckodriver.update\n\n # https://stackoverflow.com/questions/15675125/database-cleaner-not-working-in-minitest-rails\n DatabaseCleaner.start\n\n # Treat Rails html requests as coming from non-robots.\n # If it's a bot, controllers often do not serve the expected content.\n # The requester looks like a bot to the `browser` gem because the User Agent\n # in the request is blank. I don't see an easy way to change that. -JDC\n Browser::Bot.any_instance.stubs(:bot?).returns(false)\n end", "title": "" }, { "docid": "bb8624b6116788e6d4a9f45403f4647c", "score": "0.64447325", "text": "def setup\n\t\t\t\t# Do nothing\n\t\tend", "title": "" }, { "docid": "9f898ebf30f2336f89e5331a508f1463", "score": "0.64435077", "text": "def setup\n\t\t# Do nothing\n\tend", "title": "" }, { "docid": "9f898ebf30f2336f89e5331a508f1463", "score": "0.64435077", "text": "def setup\n\t\t# Do nothing\n\tend", "title": "" }, { "docid": "9f898ebf30f2336f89e5331a508f1463", "score": "0.64435077", "text": "def setup\n\t\t# Do nothing\n\tend", "title": "" }, { "docid": "9f898ebf30f2336f89e5331a508f1463", "score": "0.64435077", "text": "def setup\n\t\t# Do nothing\n\tend", "title": "" }, { "docid": "7fe672cd78e8853c6e587fcf03978eb5", "score": "0.643835", "text": "def setup\n self.config = Configuration.new\n\n self.environment = (ENV[\"TEST_ENVIRONMENT\"] || \"staging\").downcase.to_sym\n self.browser = (ENV[\"BROWSER\"] || \"chrome\").downcase.to_sym\n self.locale = (ENV[\"LOCALE\"] || \"en-US\").downcase.to_sym\n\n reset_test_variables\n set_up_capybara\n end", "title": "" }, { "docid": "e86784040cc0c61fd2909ee742802ec8", "score": "0.64330727", "text": "def before_all\n super\n @start = Time.now\n\n create_metadata_stuff\n @exporter = Check::OpenTelemetryTestConfig.current_exporter\n # URL mocked by pender-client\n @url = 'https://www.youtube.com/user/MeedanTube'\n end", "title": "" }, { "docid": "84148dec3c1205e779c7decaaa8f1d0a", "score": "0.6426431", "text": "def test_run_started; end", "title": "" }, { "docid": "26c2aa928ac8ea1665151fc4a8d483a0", "score": "0.64190257", "text": "def before(&block)\n @before << block\nend", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.64041924", "text": "def post_setup\n end", "title": "" } ]
c66cd9747489707ed79593b2f5f54d70
Unsets the current threadlocal SpanContext, disabling stats recorder creation methods of OpenCensus::Stats::Recorder
[ { "docid": "98be27e7dff85e2474837ce9307d1b0e", "score": "0.6629319", "text": "def unset_recorder_context\n OpenCensus::Context.unset RECORDER_CONTEXT_KEY\n end", "title": "" } ]
[ { "docid": "a0fe686c738f4468cb23522643ec484d", "score": "0.6233311", "text": "def clear_spans!\n tracer.instance_variable_set(:@spans, [])\n\n @spans = nil\n @span = nil\n end", "title": "" }, { "docid": "e92b342031feb6433f958f0560a42711", "score": "0.6089057", "text": "def clear_active_span!\n Thread.current[:lightstep_active_span] = nil\n end", "title": "" }, { "docid": "de1d37449464a1a846fd4c4a36045d0f", "score": "0.60494655", "text": "def disable!\n StaticTracing::Tracers.disable!\n StaticTracing::Provider.disable! # FIXME dangerous\n @enabled = false\n end", "title": "" }, { "docid": "e524699c4749f078babd5f6f767b3c77", "score": "0.6000413", "text": "def reset\n sync {stats.each_value {|sampler| sampler.reset}}\n self\n end", "title": "" }, { "docid": "24c7ef6a6dfbeb20c1806607f152337d", "score": "0.5922873", "text": "def ensure_clean_context!\n return unless configuration[:tracer].call_context.current_span\n\n configuration[:tracer].provider.context = Context.new\n end", "title": "" }, { "docid": "6be4a5a91b96324371051346443178f0", "score": "0.5920918", "text": "def clear_context\n Thread.current.thread_variable_set(NAME, nil)\n self\n end", "title": "" }, { "docid": "3e225e601cf13cd91bc864d35f1ec9d1", "score": "0.58779657", "text": "def reset_metrics_sdk\n OpenTelemetry.instance_variable_set(\n :@meter_provider,\n OpenTelemetry::Internal::ProxyMeterProvider.new\n )\n\n OpenTelemetry.logger = Logger.new(File::NULL)\n OpenTelemetry.error_handler = nil\nend", "title": "" }, { "docid": "d595bc7ae8c70dee8c9fa388ac7e69ed", "score": "0.5808872", "text": "def reset\n @stats.clear\n @trace.clear\n end", "title": "" }, { "docid": "d5ae4aadb288774988ded48647490cb9", "score": "0.5776521", "text": "def reset_stats; drop_buffered_data; end", "title": "" }, { "docid": "cb8df90ad942c6d08b10345815d3e471", "score": "0.5723046", "text": "def clear!\n self.current_trace = nil\n end", "title": "" }, { "docid": "e39bc6328fe7c089a58b8f82b7688b83", "score": "0.5659035", "text": "def disable_telemetry\n @enabled = false\n end", "title": "" }, { "docid": "02972d4354880946bc8610a6f826347a", "score": "0.56082755", "text": "def reset!(name)\n Thread.current[:datadog_security_trace_rate_limiter] = nil\n end", "title": "" }, { "docid": "b8c6d8bce4e67a3104ef508d5b497dc7", "score": "0.5583042", "text": "def reset\n thread = Thread.current\n thread[THREAD_VAR_FLAG] = false\n thread[THREAD_VAR_REPORT] = nil\n end", "title": "" }, { "docid": "4f789ee41fb80280c3bcb94d6ffe19f3", "score": "0.55652225", "text": "def without_tracing\n self.silence_tracing = true\n yield\n self.silence_tracing = false\n end", "title": "" }, { "docid": "c532c98387974bc9cdfec71120f4a8c7", "score": "0.55582523", "text": "def clear_request_data\n Thread.current[THREAD_LOCAL_NAME] = nil\n end", "title": "" }, { "docid": "6bd8e5fae87e8c833c26532435c450fe", "score": "0.55573356", "text": "def reset_stats; reset!; end", "title": "" }, { "docid": "c314cfe8c843344f0b82f12cbb85126c", "score": "0.55211395", "text": "def clear!\n self.current_span = nil\n end", "title": "" }, { "docid": "eb178ad659d4d5a4be952f69be062f38", "score": "0.5508732", "text": "def discard_local_buffer(&block) #:doc:\r\n push_buffer\r\n begin\r\n yield\r\n ensure\r\n pop_discard_buffer\r\n end\r\n end", "title": "" }, { "docid": "49282ccb259eab21b274791f5de6025a", "score": "0.5503703", "text": "def reset\n reset_stats\n end", "title": "" }, { "docid": "faa1f15f85dcfb7a15190488c2946bbf", "score": "0.55032384", "text": "def drop_buffered_data\n @stats_engine.reset!\n @error_collector.reset!\n @transaction_sampler.reset!\n @request_sampler.reset!\n @sql_sampler.reset!\n end", "title": "" }, { "docid": "5027f8735af057664fbbd592ecbb8ed1", "score": "0.5467081", "text": "def _reset\n @started = false\n return unless @traced\n\n TRACES.each { |mod, meth| _untrace(mod, meth) }\n @traced = false\n end", "title": "" }, { "docid": "62f238d80a5f82fb6b7f16941f286051", "score": "0.5394123", "text": "def clear_metrics!\n @metrics = nil\n self\n end", "title": "" }, { "docid": "22e389005b33f4283c778a42a9eb4e4d", "score": "0.5316804", "text": "def clear_metrics!; end", "title": "" }, { "docid": "2a93a1ea84e18474e29b325295f0c011", "score": "0.5301469", "text": "def delete_span_if\n @mutex.synchronize do\n @trace.delete_if do |span|\n finished = span.finished?\n delete_span = yield span\n if delete_span\n # We need to detach the span from the context, else, some code\n # finishing it afterwards would mess up with the number of\n # finished_spans and possibly cause other side effects.\n span.context = nil\n # Acknowledge there's one span less to finish, if needed.\n # It's very important to keep this balanced.\n @finished_spans -= 1 if finished\n end\n delete_span\n end\n end\n end", "title": "" }, { "docid": "d8f2032a54c4ee23c3a9fe577f5600bc", "score": "0.5277726", "text": "def clear_thread_context\n Thread.current[:usergrid_user_id] = nil\n Thread.current[:usergrid_auth_token] = nil\n Thread.current[:usergrid_current_user] = nil\n end", "title": "" }, { "docid": "0bcb993c57574103c01e4311ef2143a2", "score": "0.52705336", "text": "def clear_current!\n Thread.current[self.name] = nil\n end", "title": "" }, { "docid": "4cdf0a046e7ee380b66a1d2684255207", "score": "0.52672756", "text": "def tl_record_unscoped_metrics(metric_names, value = nil, aux = nil, &blk)\n state = NewRelic::Agent::Tracer.state\n record_unscoped_metrics(state, metric_names, value, aux, &blk)\n end", "title": "" }, { "docid": "788c0bcfe9d4b953c6eefe0d7a90bf44", "score": "0.52539694", "text": "def disable_telemetry\n @telemetry_toggled_off = true\n end", "title": "" }, { "docid": "7d0a3bb4b06456af7561fa488b8902b4", "score": "0.5232362", "text": "def clear\n clear_context\n Thread.current.thread_variable_set(STACK_NAME, nil)\n self\n end", "title": "" }, { "docid": "7ec70b52724c25c6a512791c09676fbe", "score": "0.5212065", "text": "def clear_taps!\n self.trace_tap = nil\n end", "title": "" }, { "docid": "218af1fe27eb310783e4bc0e37f386db", "score": "0.52004945", "text": "def disable_span_reporting?(_env)\n false\n end", "title": "" }, { "docid": "38c374275c2280fd6822e94b326a7e3a", "score": "0.5197404", "text": "def clear_transaction_record_state #:nodoc:\n if defined?(@_start_transaction_state)\n @_start_transaction_state[:level] = (@_start_transaction_state[:level] || 0) - 1\n remove_instance_variable(:@_start_transaction_state) if @_start_transaction_state[:level] < 1\n end\n end", "title": "" }, { "docid": "3288281a44d2b480fe78499ad92c4e72", "score": "0.5194813", "text": "def reset\n @ctx.reset\n self\n end", "title": "" }, { "docid": "9b56d86730e62ad45ab54df9c6b97125", "score": "0.51916414", "text": "def reset!\n @context = []\n end", "title": "" }, { "docid": "968ab7ec6db06455f09cf695d8eb1474", "score": "0.51879", "text": "def reset_context\n @vars = {}\n @object = nil\n end", "title": "" }, { "docid": "9189d0f0e2012547280ebbb95fe62825", "score": "0.5183816", "text": "def reset\n @tms = Benchmark::Tms.new\n end", "title": "" }, { "docid": "b9dcf4a1b3ea76ee95b89ba86bb0da54", "score": "0.51826984", "text": "def stop_tracer\n tracer.stop\n end", "title": "" }, { "docid": "c5134cb49d62ecaa9a79a1d275da3491", "score": "0.51604915", "text": "def untrace()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "75263305f467317646afd53156240e4e", "score": "0.5157014", "text": "def reset\n @collected_metrics = []\n end", "title": "" }, { "docid": "103f9c54fb34e2ca16232497a84b2194", "score": "0.514422", "text": "def clear_current_scenario(*args)\n @current_scenario = nil\n end", "title": "" }, { "docid": "62d6b2f452f832e4f7e8a9729986e97f", "score": "0.5143143", "text": "def context_with_span(span, parent_context: OpenTelemetry::Context.current)\n parent_context.set_value(CURRENT_SPAN_KEY, span)\n end", "title": "" }, { "docid": "3722233b59918bb0fd53fca27dad27c1", "score": "0.5138297", "text": "def teardown\n #TODO: add @Stats disconnect code\n #@Stats = nil\n end", "title": "" }, { "docid": "0b5a9c772e6b1b891fe048e3560900b4", "score": "0.51348424", "text": "def reset\n @stats = nil\n true\n end", "title": "" }, { "docid": "a68617e46d8e31fcc9a33efa418d6455", "score": "0.5127055", "text": "def toggle_tracing!\n enabled? ? disable! : enable!\n end", "title": "" }, { "docid": "0a9703abf205a74dbeb18fd99a57fda0", "score": "0.5124104", "text": "def reset\n old_logger = logger_off\n user_scores.destroy_all\n logger_on(old_logger)\n puts \"All metrics and scores from enrolment id: #{id} destroyed\"\n end", "title": "" }, { "docid": "1b6659116d59d6097de95fa0e4f5c07b", "score": "0.5106526", "text": "def clear\n @mutex.synchronize do\n @metrics.each do |key, metric|\n metric.stop if metric.respond_to?(:stop)\n end\n\n @metrics = {}\n end\n end", "title": "" }, { "docid": "76adc60e8fac4027e86df1e2cba54cf0", "score": "0.5101559", "text": "def unset_current_scope(klass)\n return unless Thread.current[CURRENT_SCOPE_KEY]\n\n Thread.current[CURRENT_SCOPE_KEY].delete(klass)\n Thread.current[CURRENT_SCOPE_KEY] = nil if Thread.current[CURRENT_SCOPE_KEY].empty?\n end", "title": "" }, { "docid": "e516982a43ccd8d332047a0b95f87c2c", "score": "0.50956213", "text": "def initialize(options = {})\n @mutex = Mutex.new\n # max_length is the amount of spans above which, for a given trace,\n # the context will simply drop and ignore spans, avoiding high memory usage.\n @max_length = options.fetch(:max_length, DEFAULT_MAX_LENGTH)\n reset(options)\n end", "title": "" }, { "docid": "cb213ee9656762539ed6b5d2d34729fc", "score": "0.50946885", "text": "def emeter_erase_stats\n send_to_plug(:emeter => {:erase_emeter_stat => {}})\n end", "title": "" }, { "docid": "a5b046759dc1e05a9975a2c8c9624e74", "score": "0.5092464", "text": "def resetCounters()\n @normal.resetCounters\n @temporal.resetCounters\n end", "title": "" }, { "docid": "554826c02b40ba4891408e3b1774abff", "score": "0.5082076", "text": "def reset_stamper\n Thread.current[\"#{self.to_s.downcase}_#{self.object_id}_stamper\"] = nil\n end", "title": "" }, { "docid": "ba7e89ea32d657a8632d3ca992bc65fc", "score": "0.5079643", "text": "def clear!\n self.context = DEFAULT_CONTEXT\n end", "title": "" }, { "docid": "3d031a2bd5dc5fd329ecd4b39df17273", "score": "0.50740147", "text": "def clear_stats\n reset!\n NewRelic::Agent::TransactionTimeAggregator.reset!\n end", "title": "" }, { "docid": "e35589fd37f13ddbe25b067bc64e5412", "score": "0.507087", "text": "def reset!\n features.clear\n logs.clear\n end", "title": "" }, { "docid": "6c75f432bc00234a22675cafd8f6caf3", "score": "0.50631094", "text": "def clear_context\n end", "title": "" }, { "docid": "27712cf2f1046a1462c1f2dc20ed6229", "score": "0.5059244", "text": "def reset\n untrack_all\n @calls = []\n end", "title": "" }, { "docid": "02505049fa5a2b189944b1b9b4d24689", "score": "0.5053919", "text": "def teardown\n (Thread.list - [Thread.current]).each(&:kill)\n super\n end", "title": "" }, { "docid": "02505049fa5a2b189944b1b9b4d24689", "score": "0.5053919", "text": "def teardown\n (Thread.list - [Thread.current]).each(&:kill)\n super\n end", "title": "" }, { "docid": "7c791ff85bbe3cde0232c456929f57b1", "score": "0.5046131", "text": "def disable_all_tracing\n return yield unless agent\n begin\n agent.push_trace_execution_flag(false)\n yield\n ensure\n agent.pop_trace_execution_flag\n end\n end", "title": "" }, { "docid": "ec094dc1f2d8242983c6309a359916f7", "score": "0.5029765", "text": "def _thread_local_clean\n ids = Thread.list.map &:object_id\n (@_thread_local_threads.keys - ids).each { |key| @_thread_local_threads.delete(key) }\n end", "title": "" }, { "docid": "6e43704000c2bb5852b14fd3636f2b06", "score": "0.5022833", "text": "def clear_context(ctx)\n (self[ctx] || {}).clear\n end", "title": "" }, { "docid": "bfb1e2daad970605358650c59ccedfc1", "score": "0.49993044", "text": "def clear\n @label = nil\n @stats.clear\n end", "title": "" }, { "docid": "bfb1e2daad970605358650c59ccedfc1", "score": "0.49993044", "text": "def clear\n @label = nil\n @stats.clear\n end", "title": "" }, { "docid": "6903d9bac6d72354a4c70afee87afe08", "score": "0.49986807", "text": "def deactivate(recorder)\n @active.delete(recorder.rid)\n end", "title": "" }, { "docid": "8b170a9eeef04e32848693fe9d4b4c9f", "score": "0.49957362", "text": "def reset!\n logs.remove\n features.remove\n end", "title": "" }, { "docid": "0eaef2f6403d47aff9a7e2c6e609f0b1", "score": "0.4995612", "text": "def clear!\n delete_thread_local! :clues_metadata\n end", "title": "" }, { "docid": "0ec2452d7051b849e8933cba85f5e68a", "score": "0.49943662", "text": "def reset!\n @run_context = nil\n @node = nil\n @provider_priority_map = nil\n @resource_priority_map = nil\n @provider_handler_map = nil\n @resource_handler_map = nil\n end", "title": "" }, { "docid": "a72f9141c0656c606714460377e9ca6a", "score": "0.49932638", "text": "def clear\n Thread\n .list\n .select { |thread| thread[PERSISTENCE_SCOPE] }\n .each { |thread| thread[PERSISTENCE_SCOPE].clear }\n end", "title": "" }, { "docid": "a72f9141c0656c606714460377e9ca6a", "score": "0.49932638", "text": "def clear\n Thread\n .list\n .select { |thread| thread[PERSISTENCE_SCOPE] }\n .each { |thread| thread[PERSISTENCE_SCOPE].clear }\n end", "title": "" }, { "docid": "2d48cb40c1cd3f1cbea45573c7ddaf3f", "score": "0.49919942", "text": "def clean_thread_locals; end", "title": "" }, { "docid": "57243316f757737fce58d7dce1538f8a", "score": "0.49908528", "text": "def reset_stats\n @rejects = RightSupport::Stats::Activity.new\n @requests = RightSupport::Stats::Activity.new\n @exceptions = RightSupport::Stats::Exceptions.new(@agent)\n true\n end", "title": "" }, { "docid": "2fcad0b3afed11feb5de327cd7c326f6", "score": "0.49869907", "text": "def delete_trace_id\n trace_ids.delete current_thread_id\n end", "title": "" }, { "docid": "90b64149e56ce85a3a4f51799754fa2d", "score": "0.49865842", "text": "def reset(transaction = nil)\n # We purposefully don't reset @untraced or @record_sql\n # since those are managed by NewRelic::Agent.disable_* calls explicitly\n # and (more importantly) outside the scope of a transaction\n\n @current_transaction = transaction\n @sql_sampler_transaction_data = nil\n end", "title": "" }, { "docid": "ab415885e5c587407874bfade58de29b", "score": "0.49771845", "text": "def discard_profile!\n self.current_profile = nil\n end", "title": "" }, { "docid": "b8027c660e1ea91aafc5bda75bc1450d", "score": "0.49745578", "text": "def clear_context\n backend.clear_context\n end", "title": "" }, { "docid": "26a30e315a042a143c4d0610a3cd41a4", "score": "0.4954759", "text": "def deactivate\n if @active && @deactivate\n deactivated_span = @deactivate.call\n warn \"ActiveSpan::SpanSource inconsistency found during deactivation\" unless deactivated_span == self\n @active = false\n end\n end", "title": "" }, { "docid": "0027aca743d4e9930d7927a9d7006f1a", "score": "0.49513373", "text": "def clear\n Thread.current.thread_variable_set(NAME, nil)\n self\n end", "title": "" }, { "docid": "b11a20f2ae5cc8b789cfdc3b46174a92", "score": "0.4951249", "text": "def tl_record_unscoped_metrics(metric_names, value=nil, aux=nil, &blk)\n state = TingYun::Agent::TransactionState.tl_get\n record_unscoped_metrics(state, metric_names, value, aux, &blk)\n end", "title": "" }, { "docid": "94f2637309bad240dffa853a74e35cf3", "score": "0.49508038", "text": "def clear(scope = T.unsafe(nil)); end", "title": "" }, { "docid": "94f2637309bad240dffa853a74e35cf3", "score": "0.49508038", "text": "def clear(scope = T.unsafe(nil)); end", "title": "" }, { "docid": "94f2637309bad240dffa853a74e35cf3", "score": "0.49508038", "text": "def clear(scope = T.unsafe(nil)); end", "title": "" }, { "docid": "bb0480fe5242edb04294631dc61cd6a0", "score": "0.4949487", "text": "def disable!\n @events_tracker = NullTracker.new(events)\n end", "title": "" }, { "docid": "0a0667731bc57f4151fc795186448486", "score": "0.49396288", "text": "def trace_execution_unscoped(metric_names, options = NewRelic::EMPTY_HASH) # THREAD_LOCAL_ACCESS\n NewRelic::Agent.record_api_supportability_metric(:trace_execution_unscoped) unless options[:internal]\n return yield unless NewRelic::Agent.tl_is_execution_traced?\n\n t0 = Process.clock_gettime(Process::CLOCK_MONOTONIC)\n begin\n yield\n ensure\n duration = Process.clock_gettime(Process::CLOCK_MONOTONIC) - t0\n NewRelic::Agent.instance.stats_engine.tl_record_unscoped_metrics(metric_names, duration)\n end\n end", "title": "" }, { "docid": "b58de99ec7527e2014f364ea09139393", "score": "0.49107572", "text": "def reset_scope\n @inclusive = @start_time = @end_time = nil\n end", "title": "" }, { "docid": "f385d3c4c9e1059eccc5bf543a4b0ce9", "score": "0.48979193", "text": "def reset\n @timestamp = Time.new.utc.to_i\n @metrics = []\n @errors = []\n @status = OK\n end", "title": "" }, { "docid": "c6bad65d3b90eca09c7c634623aa6e3d", "score": "0.48972958", "text": "def teardown\r\n\t@context = nil\r\n end", "title": "" }, { "docid": "d2b5cdd7c5dbdf2831a86b37677515f7", "score": "0.48833752", "text": "def teardown\n evicting_thread.kill\n end", "title": "" }, { "docid": "8994dd0255125efbf2c4fe6dd6fd1e11", "score": "0.48778623", "text": "def trace_context\n TraceContextData.new trace_id, @span_id, trace_options\n end", "title": "" }, { "docid": "604a66d00e21ca626ad9b1c084fe8a0c", "score": "0.4872337", "text": "def reset_status_buffer\n @@status_buffer = {}\n end", "title": "" }, { "docid": "e4f8d9997f9d801b293ef517b43e9af1", "score": "0.48516092", "text": "def reset_stats\n @return_stats = RightSupport::Stats::Activity.new\n @non_delivery_stats = RightSupport::Stats::Activity.new\n @exception_stats = @options[:exception_stats] || RightSupport::Stats::Exceptions.new(self, @options[:exception_callback])\n true\n end", "title": "" }, { "docid": "8b48a07da908e343edf549e33086a44b", "score": "0.48489952", "text": "def unmonitor(fiber)\n (@monitors ||= []).delete(fiber)\n self\n end", "title": "" }, { "docid": "5403455e323489771e0fe97b15611e96", "score": "0.48455065", "text": "def detach_stats_counter\n Thread.new do\n loop do\n start = @stats_lock.synchronize{@stats_count}\n sleep(1)\n @stats_lock.synchronize{@stats << (@stats_count - start)}\n end\n end\n end", "title": "" }, { "docid": "16bb6eef1274159cd7debc9ed33ebb1b", "score": "0.48432454", "text": "def reset_scope\n @inclusive = @start_time = @end_time = nil\n end", "title": "" }, { "docid": "96001f5782aa2604a2eca9094eb92ef0", "score": "0.48403233", "text": "def reset\n @mutex.synchronize do\n set_status_and_restore(:reset)\n end\n end", "title": "" }, { "docid": "1d9b881342410ff81268fe9ee2826f9a", "score": "0.48401055", "text": "def clear_transaction_record_state\n return unless @_start_transaction_state\n @_start_transaction_state[:level] -= 1\n @_start_transaction_state = nil if @_start_transaction_state[:level] < 1\n end", "title": "" }, { "docid": "3fd4609d8deea6f292f8e78c7df691d4", "score": "0.48376018", "text": "def reset_transaction!\n Thread::current[:scout_scope_name] = nil\n Thread::current[:scout_transaction_hash] = Hash.new\n end", "title": "" }, { "docid": "15e69ae9bebf1537bb6938985e3d6d73", "score": "0.4828639", "text": "def reset_class_context() #method\n @current_context = @main_context\n end", "title": "" }, { "docid": "f51ab34ecd6134555ac4af7a9db2af12", "score": "0.48274782", "text": "def status=(status)\n return if status.code == OpenTelemetry::Trace::Status::UNSET\n\n @mutex.synchronize do\n if @ended\n OpenTelemetry.logger.warn('Calling status= on an ended Span.')\n elsif @status.code != OpenTelemetry::Trace::Status::OK\n @status = status\n end\n end\n end", "title": "" }, { "docid": "149abcea926d6f1399d315a45d035420", "score": "0.48228672", "text": "def unscope\n Scoped.send(:new, @table, @dcaching)\n end", "title": "" }, { "docid": "58fc017b6cb1adf920bc7193e3408796", "score": "0.48139435", "text": "def clean_living_state\n Thread.current[:waw_state] = nil\n end", "title": "" } ]
a3d748db4d727b75a5d845bab6f30d97
general permission to access PCP Subjects in PcpAllSubjectsController
[ { "docid": "2fa622ca5ab19362bb58aba5a90eb973", "score": "0.0", "text": "def permitted_to_access?( account, feature = FEATURE_ID_MY_PCP_SUBJECTS, action = :to_read )\n pg = account.permitted_groups( feature, action )\n case pg\n when nil\n false\n when ''\n true\n else # ( pg & [ p_group_id, c_group_id ]).empty?\n pg.include?( p_group_id ) || pg.include?( c_group_id )\n end\n end", "title": "" } ]
[ { "docid": "d10b348ac3945b7b48723639778f9ee2", "score": "0.732846", "text": "def elective_subject\n @elective_group = ElectiveGroup.shod(params[:id])\n @elective_subjects ||= @elective_group.subjects\n authorize! :read, @elective_group\n end", "title": "" }, { "docid": "e898832426a8423e94726cb81d14a1d1", "score": "0.7209704", "text": "def set_subject\n @subject = Subject.find params[:id]\n authorize @subject\n end", "title": "" }, { "docid": "c34f07156492582d3af872ecf57ca054", "score": "0.66525835", "text": "def set_subject\n # only show subject belongs to appropriate subdomain/university\n @subject = current_university.subjects.find(params[:id])\n end", "title": "" }, { "docid": "5550b23e0947f5329e579e1110835ec6", "score": "0.6647433", "text": "def get_all_subjects\n get_all_named_subjects('p')\n end", "title": "" }, { "docid": "a14888e9f91adde11058c86c76848fab", "score": "0.66444427", "text": "def subjects\n @user = current_user\n initialize_subjects_profile(true)\n @errors = []\n end", "title": "" }, { "docid": "94684dea6e2f4c8df0dc43fc7c96655e", "score": "0.663597", "text": "def index\n if teacher_signed_in?\n @subjects = current_user.rolable.subjects # teachers can only see the subjects they're assigned to\n elsif student_signed_in?\n @subjects = @current_class.subjects # students can only see the subjects their current class is registered to\n else\n @subjects = Subject.all\n end\n respond_with @subjects\n end", "title": "" }, { "docid": "1d37f88c11ca4d7ce723b908a901c6c4", "score": "0.6578394", "text": "def privileged_psp_subjects\n OpenStruct.new(\n query: %Q(\n MATCH \n (p:Psp {privileged: 'true'})-[:SECURITY]->(r:Rule)\n <-[:GRANT]-(ro:Role {is_default: 'false'})\n <-[:ASSIGN]-(s:Subject)-[:ACCESS]->(ns:Namespace {name: '*'})\n WHERE \n ro.defined = 'true'\n AND NOT s.name IN {{whitelist_subject_names}}\n RETURN \n p.name as psp_name, \n s.kind as subject_kind,\n s.name as subject_name\n ),\n writer: <<-'EOF'\n \"#{result.subject_kind} #{result.subject_name} able to run privileged psp #{result.psp_name}\"\n EOF\n )\n end", "title": "" }, { "docid": "daee6c715d48d70c95635108af214111", "score": "0.6569339", "text": "def subject\n @batch = Batch.shod(params[:batch_id])\n subject_data\n authorize! :read, @batch\n end", "title": "" }, { "docid": "996299e6cdde117de6e20d89932e2c98", "score": "0.65442044", "text": "def active_subjects_management\n @school = current_user.get_managed_school\n @subjects = @school.all_active_subjects\n \n add_breadcrumb \"Select the subject\", 'active_subjects_management'\n end", "title": "" }, { "docid": "910021d70ab77ea4df074eccb20e4b0b", "score": "0.65378624", "text": "def set_pcp_subject\n @pcp_subject = PcpSubject.find( params[ :id ])\n end", "title": "" }, { "docid": "daff115bd77ec28d030d96d34c8e8cf6", "score": "0.6514261", "text": "def access_subjects\n subjects_array(%w[subject function occupation genreform], parent: 'archdesc')\n end", "title": "" }, { "docid": "d8abbbce5251f94c269394087d910daf", "score": "0.651247", "text": "def index\n @user_subjects = UserSubject.all\n end", "title": "" }, { "docid": "a66e263221adcbc8a96cc114c4d8371f", "score": "0.6498966", "text": "def subjects; end", "title": "" }, { "docid": "d214ab199a60524f080f74527d1114dd", "score": "0.6473992", "text": "def index\n @subjects = Subject.where(user: current_user).page(params[:page]).per(10)\n end", "title": "" }, { "docid": "7df588df274eddf020ea866bad212709", "score": "0.6432841", "text": "def index\n @page_subjects = PageSubject.all\n end", "title": "" }, { "docid": "c162abf4e9b60e1e6f61732a794cd8a6", "score": "0.63940924", "text": "def can?(action, on: nil)\n raise Cannie::SubjectNotSetError, 'Subject should be specified' unless on\n current_permissions.can?(action, on)\n end", "title": "" }, { "docid": "89f504252b00aade0ecfdf13cc90d777", "score": "0.63871443", "text": "def subject_wise_report\n @batches ||= Batch.includes(:course).all\n @subjects ||= Batch.first.subjects unless Batch.first.nil?\n @batches ||= Batch.includes(:course).all\n @subjects ||= Batch.first.subjects unless Batch.first.nil?\n authorize! :read, ExamGroup\n end", "title": "" }, { "docid": "cc066de8ed32efcfcf96c953bce7e49c", "score": "0.6377558", "text": "def select_subject\n @batch = Batch.shod(params[:batch][:id])\n @subjects ||= @batch.subjects\n authorize! :read, Attendence\n end", "title": "" }, { "docid": "72148c395d8ea642208d0b376809fa28", "score": "0.6356465", "text": "def set_pcp_subject\n @pcp_subject = PcpSubject.find( params[ :id ])\n most_recent_steps = @pcp_subject.current_steps\n @pcp_curr_step = most_recent_steps[ 0 ]\n @pcp_prev_step = most_recent_steps[ 1 ] \n @pcp_viewing_group_map = @pcp_subject.viewing_group_map( current_user, [ 'edit', 'update' ].include?( action_name ) ? :to_modify : :to_access )\n end", "title": "" }, { "docid": "62a04fbda2759004c4e39de443f97871", "score": "0.634465", "text": "def index\n @course_has_subjects = CourseHasSubject.all\n end", "title": "" }, { "docid": "50fe2e7f7ea3e4c12143dc5796ae54e4", "score": "0.63398296", "text": "def index\n @tutor_subjects = TutorSubject.all\n end", "title": "" }, { "docid": "04fb28faa853578b5ce6586064e25250", "score": "0.63381284", "text": "def subjects\n @theory_subjects = Subject.theory_subjects.all\n @practical_subjects = Subject.practical_subjects.all\n #@subjects = Subject.accessible_by(current_ability)\n respond_to do |format|\n format.html \n format.js\n end \n end", "title": "" }, { "docid": "a86bb33f3f50b8a71db2f3e4f0405c7a", "score": "0.63357013", "text": "def set_admin_subject\n @subject = Subject.find(params[:id])\n end", "title": "" }, { "docid": "2be27c2ca3c083c14a7df8aa365a923e", "score": "0.62933564", "text": "def index\n @courses_subjects = CoursesSubject.all\n end", "title": "" }, { "docid": "ccb967a85d746059897d003cd53e5766", "score": "0.6271026", "text": "def subjects=(value)\n @subjects = value\n end", "title": "" }, { "docid": "62bbf8d86abd6e14a2f900c7e9b35dc0", "score": "0.6267589", "text": "def available_subjects\n Subject.all\n end", "title": "" }, { "docid": "5762d765547991321ca81b08a5e97eeb", "score": "0.6265549", "text": "def subject_wise_report\n @subject = Subject.shod(params[:subject_id])\n @student = Student.shod(params[:student_id])\n @batch = @subject.batch\n @exam_groups ||= @batch.exam_groups\n authorize! :read, @student\n end", "title": "" }, { "docid": "7c287d3ee524e63a7f65231fe1568a15", "score": "0.6257773", "text": "def index\n @plan_subjects = PlanSubject.all\n end", "title": "" }, { "docid": "ceb5452401768daf6d3883504d2ef039", "score": "0.6242655", "text": "def explore_subjects *args\n page, per_page = TibbrResource.extract_params(args, 2)\n Subject.find(:all, :params => {:page=>page, :per_page=>per_page, :conditions => [ \"subjects.scope = ? and subjects.stype = ? \", :public, :custom ], :include => :message_subjects, :order => \"message_subjects.id DESC\" })\n end", "title": "" }, { "docid": "23e2643894827db10899c280291ff25d", "score": "0.6228421", "text": "def permitted_categories\n pg = current_user.permitted_groups( FEATURE_ID_MY_PCP_SUBJECTS, :to_create )\n PcpCategory.permitted_to_create_subject( pg, current_user ).collect{ |c| [ c.label, c.id ]}\n end", "title": "" }, { "docid": "79141d678634b02c9e1505fb23323ad3", "score": "0.6216583", "text": "def show\n authorize! :show, @course_subject\n @subject = @course_subject.subject\n @lessons = @subject.lessons\n end", "title": "" }, { "docid": "f22d689cb33e7f9903a7ba4d47ed6fe8", "score": "0.62140685", "text": "def current_user_can_read_subject\n set_subject_from_params unless @subject\n case @subject\n when Profile\n true\n when Repository\n bounce_user unless @subject.can_read?(current_user)\n end\n end", "title": "" }, { "docid": "47bf651382a4ee2514a2fdf2fea7edca", "score": "0.6212198", "text": "def index\n @published_subjects = Subject.where(published:true)\n @subjects = @published_subjects.all_with_pages\n @write_subjects = Subject.where(:section => \"Writing\")\n @math_subjects = Subject.where(:section => \"Math\")\n @read_subjects = Subject.where(:section => \"Critical Reading\")\n @user = current_user\n end", "title": "" }, { "docid": "e4130b7a82f96a139078041a62903475", "score": "0.6203251", "text": "def index\n @course_by_subjects = CourseBySubject.all\n end", "title": "" }, { "docid": "47a684dce66fd91ff534924d12d4f440", "score": "0.6202653", "text": "def index\n @subject = Subject.find(params[:subject_id])\n @assignments = @subject.assignments\n end", "title": "" }, { "docid": "56e3cf87b3546465ced3f69a68a2e305", "score": "0.6198016", "text": "def list_subjects(options = {})\n all_subjects\n end", "title": "" }, { "docid": "56e3cf87b3546465ced3f69a68a2e305", "score": "0.6198016", "text": "def list_subjects(options = {})\n all_subjects\n end", "title": "" }, { "docid": "0c770a71774218a3f2921c5cec0fd3fc", "score": "0.619681", "text": "def subjects()\n require_authentication!\n options = make_options(\"getSubjects\")\n response = self.class.post(\"/WebUntis/jsonrpc.do;jsessionid=#{@session_id}?school=#{@school}\", options)\n raise response[\"error\"][\"message\"] unless response[\"error\"].nil?\n response[\"result\"]\n end", "title": "" }, { "docid": "e46f394920a2dc87bc24c2c666347378", "score": "0.6181477", "text": "def my_subjects\n @subjects = Content.where(:id=>current_user.class_contents.map(&:id)).page(params[:page])\n end", "title": "" }, { "docid": "e57dc25b71afb4a8a0c901118f49efcc", "score": "0.618013", "text": "def subjects\n @subjects\n end", "title": "" }, { "docid": "f303fed1f3c6fdc171e4d94b19b1fc16", "score": "0.61779165", "text": "def select_subject\n @subject = Subject.shod(params[:sub][:subject_id])\n @teachers = EmployeeSubject.where(subject_id: @subject.id)\n @emp = EmployeeSubject.where(subject_id: @subject.id, employee_id: nil)\n authorize! :read, TimeTableEntry\n end", "title": "" }, { "docid": "f997ce01136bb0b79f30c7f29c47d867", "score": "0.61733985", "text": "def assign_all\n @subject = Subject.shod(params[:id])\n @students ||= @subject.elective_group.batch.students\n authorize! :read, @student\n end", "title": "" }, { "docid": "d6b1f02c8189a815a370229e9780fd3a", "score": "0.6139927", "text": "def index\n @course = Course.find(params[:course_id])\n @course_subjects = @course.subjects\n end", "title": "" }, { "docid": "44fe2c31e1d42648161865e895b20976", "score": "0.613965", "text": "def edit_subjects\n \t@presenter = current_user.presenter\n end", "title": "" }, { "docid": "4e13fbb80e462ca3713390a6468d995a", "score": "0.61308587", "text": "def subjects\n return @subjects\n end", "title": "" }, { "docid": "6e9a14a9f95a3d4a6544f848bfa3c4c8", "score": "0.61119634", "text": "def index\n @note_subjects = NoteSubject.where(user_id: current_user.id)\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.60876375", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.60876375", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.60876375", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.60876375", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.60876375", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.60876375", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.60876375", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.60876375", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.60876375", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "5701ff482ce3c5cef98e5c7295887b43", "score": "0.60876375", "text": "def index\n @subjects = Subject.all\n end", "title": "" }, { "docid": "dddf2994d8480945485ac8ebaf8f8e8c", "score": "0.608497", "text": "def set_subject\n @subject = Subject.find(params[:id])\n redirect_to(root_url) unless current_user?(@subject.user)\n end", "title": "" }, { "docid": "dd34089724ba2ed5ab4cd3e426335b93", "score": "0.60809153", "text": "def authorize(action, subject)\n Pundit.authorize(user, subject, normalize(action)) && subject\n rescue ::Pundit::NotAuthorizedError\n Logger.error <<~MESSAGE\n #{Utils.inspect user} is forbidden to perform #{action} on #{Utils.inspect subject}\n MESSAGE\n raise Forbidden\n end", "title": "" }, { "docid": "e929017474a8bc2d87c80e6308b325c5", "score": "0.6072247", "text": "def subjects_with_permission(type, permission)\n type.joins(\"INNER JOIN can_haz_permissions ON can_haz_permissions.csubject_id = #{type.table_name}.id\").where('cobject_id = ? AND cobject_type = ?', self.id, self.class.to_s).where('csubject_type = ?', type.to_s).where('permission_name = ?', permission)\n end", "title": "" }, { "docid": "e63d0e7c014371aef7bf096feb95d0f8", "score": "0.60684353", "text": "def subjects=(value)\n\t\t@subjects = value\n\tend", "title": "" }, { "docid": "64d37dd0e5142a20c263bc92045a82ab", "score": "0.6056003", "text": "def set_subjects\n\t\t@subjects = Subject.all\n\tend", "title": "" }, { "docid": "630a1a2a605b5f151afd7a251c9e8919", "score": "0.6037551", "text": "def subjects\n []\n end", "title": "" }, { "docid": "8959b162b2a604661e498c62ff0e0055", "score": "0.6035114", "text": "def index\n @forum_subjects = ForumSubject.all\n end", "title": "" }, { "docid": "1834ad84f24b794bc140f32c0f730b10", "score": "0.60332596", "text": "def subject_roots *args\n page, per_page = TibbrResource.extract_params(args, 2)\n TibbrResource.paginate_collection(Subject.get(:roots, :params => {:page=>page, :per_page=>per_page, :user_id=>id, :set_actions => true, :include_inaccessible => true}), Subject)\n end", "title": "" }, { "docid": "586bec51d589f9a4b78ec88479f3c71c", "score": "0.6026434", "text": "def authorize(action, subject)\n Pundit.authorize(user, subject, normalize(action)) && subject\n rescue ::Pundit::NotAuthorizedError\n Rails.logger.info I18n.t('errors.unauthorized', user: user, action: action, subject: subject)\n raise Forbidden\n end", "title": "" }, { "docid": "e52742d161ec135ee9c47967035d4ed6", "score": "0.6013397", "text": "def index\n # get teachers from current university ( in subdomain )\n @teachers = current_university.teachers\n authorize! :index, @teachers\n end", "title": "" }, { "docid": "341357520582ff27ade9ef942f0cab3c", "score": "0.6009243", "text": "def index\n @subject_users = SubjectUser.all\n end", "title": "" }, { "docid": "4998f53c91b60ae6f9ec2c1e8ca9a299", "score": "0.5998544", "text": "def index\n @subject_assignments = SubjectAssignment.all\n end", "title": "" }, { "docid": "69d0b8fb5475e4053d2b491ff5454f19", "score": "0.59930664", "text": "def subjects(options={})\r\n render(options.merge(:only => :subjects)) unless @subjects_rendered\r\n @subjects\r\n end", "title": "" }, { "docid": "fb9d9e2d1605e966e8e1366dc7d48f5e", "score": "0.5981567", "text": "def subjects; @store.subjects(self); end", "title": "" }, { "docid": "6a16898123bad96b99ca3d5fa1f6021b", "score": "0.5978265", "text": "def subject_certificate(*) end", "title": "" }, { "docid": "e58350aa89a458ce769c0d60e707ff4a", "score": "0.5977911", "text": "def index\n @teacher_subjects = TeacherSubject.all\n end", "title": "" }, { "docid": "82ab0d169c99ae0bbcff7c6f12c175a6", "score": "0.5961018", "text": "def authorized?(action, subject = nil)\n\n\n\n true\n\n\n\n end", "title": "" }, { "docid": "bb0ff15422c37e1e30cdc3637ecdb608", "score": "0.59551585", "text": "def list_subjects(options={})\n raise \"Method not implemented in subclass.\"\n end", "title": "" }, { "docid": "b30680cd55021e7510a4daf486f62440", "score": "0.5940047", "text": "def index\n @email_virtual_domains = EmailVirtualDomain.accessible_by(current_ability)\n authorize! :read, EmailVirtualDomain\n end", "title": "" }, { "docid": "6e635390811b6f033c0bfa6253263b32", "score": "0.5935317", "text": "def index\n @section_subjects = SectionSubject.all\n end", "title": "" }, { "docid": "900a64edfa52ada9f4b5af6f2667150c", "score": "0.5933461", "text": "def set_admin_subject\n @admin_subject = Admin::Subject.includes(:problems).find(params[:id])\n end", "title": "" }, { "docid": "04a27ae53e182de40631dabc6fe86d14", "score": "0.59311146", "text": "def campus_patron_permissions\n end", "title": "" }, { "docid": "74a33c9f5f1890143e61de681598c8cf", "score": "0.5927692", "text": "def index\n @type_subjects = TypeSubject.all\n end", "title": "" }, { "docid": "e37e5a4ce021e43f1cf36153acd7ad14", "score": "0.592721", "text": "def index\n @activity_x_subjects = ActivityXSubject.all\n end", "title": "" }, { "docid": "9c5f9277626152a10099cc8ac68f37d3", "score": "0.59219587", "text": "def index\n @subject_roles = SubjectRole.all\n end", "title": "" }, { "docid": "89e20e070f9dfba46c3102529d00d9d9", "score": "0.5918175", "text": "def subjects(options={})\n render(options.merge(:only => :subjects)) unless @subjects_rendered\n @subjects\n end", "title": "" }, { "docid": "89e20e070f9dfba46c3102529d00d9d9", "score": "0.5918175", "text": "def subjects(options={})\n render(options.merge(:only => :subjects)) unless @subjects_rendered\n @subjects\n end", "title": "" }, { "docid": "6320fca475329aea43c9a3e94e4140e1", "score": "0.5907515", "text": "def index\n @stream_subjects = StreamSubject.all\n end", "title": "" }, { "docid": "33f5804c8070f3f00964bb6cb8aac789", "score": "0.5906253", "text": "def index\n @title = t(:message_0, :scope => [:controller, :plans])\n @index = @student.index\n @voluntary_subjects = @index.specialization.voluntary_subjects\n end", "title": "" }, { "docid": "4a95a86e84de88668193e474c1850f9a", "score": "0.5898744", "text": "def index\n @class_subjects = ClassSubject.all\n end", "title": "" }, { "docid": "4e0e8d36f1de3546a3cae344693b8d21", "score": "0.5895994", "text": "def index\n @coursesubjects = Coursesubject.all\n end", "title": "" }, { "docid": "4e0e8d36f1de3546a3cae344693b8d21", "score": "0.5895994", "text": "def index\n @coursesubjects = Coursesubject.all\n end", "title": "" }, { "docid": "f582bd77b869745530d170bf7a906bcd", "score": "0.5875107", "text": "def index\n @subjects = @teacher.subjects.all\n end", "title": "" }, { "docid": "0f72ba644e12c46b67f22129d8fb36ef", "score": "0.58742476", "text": "def index\n @subjects = Subject.all.paginate(page: params[:page], per_page: 20)\n end", "title": "" }, { "docid": "cd8df97c356478fee06c6bd2e2ab845e", "score": "0.5858542", "text": "def subject\n\t\t@subject\n\tend", "title": "" }, { "docid": "390040888220ba4dfb62fcd72e813956", "score": "0.58531535", "text": "def index\n @cycle_has_subjects = CycleHasSubject.all\n end", "title": "" }, { "docid": "2c5ed611d8233a48f672d08a220a738a", "score": "0.5847837", "text": "def index\n \n @subject = Subject.find(params[:subject_id])\n\n\n end", "title": "" }, { "docid": "bb9812fcc0d5c1c6ff821e01892fb210", "score": "0.5843021", "text": "def show\n if current_user.student?\n if current_user.student.id != @student.id\n redirect_to main_home_path, alert: \"You are not authorized!\"\n end\n end\n @assigned_subjects = @student.subjects\n end", "title": "" }, { "docid": "6e9d3906c73b8570f7c86b64d79313b1", "score": "0.5835638", "text": "def assign_subject\n @batch = Batch.shod(params[:subject_assignment][:id])\n @subject = @batch.subjects.all\n end", "title": "" }, { "docid": "a65e00127c80beee350e7076cab29461", "score": "0.582399", "text": "def campus_patron_permissions\n anonymous_permissions\n end", "title": "" }, { "docid": "a65e00127c80beee350e7076cab29461", "score": "0.582399", "text": "def campus_patron_permissions\n anonymous_permissions\n end", "title": "" }, { "docid": "4a1d2a0aae79b58708fe9051ee7d7ad1", "score": "0.5820693", "text": "def current_user_can_edit_subject\n set_subject_from_params unless @subject\n unless @subject.can_edit?(current_user)\n bounce_user\n end\n bounce_user if @subject.kind_of?(Profile) && @subject.user\n end", "title": "" }, { "docid": "d4d6acdc7064df12b3c0cddae517d2e2", "score": "0.58165777", "text": "def acts_as_authorization_permission_subject(args={}, &block)\n scope = acts_as_authorization_model(args.merge({:permission_subject_class => self.name}), &block)\n include PermissionSubject\n end", "title": "" }, { "docid": "bf9d49c5fbd0b0b70b086577d3c9c8ce", "score": "0.5813561", "text": "def set_course_has_subject\n @course_has_subject = CourseHasSubject.find(params[:id])\n end", "title": "" }, { "docid": "6f6f6a19056357e28a5d60718dd1ef30", "score": "0.5810744", "text": "def current_subject_from_params\n return unless params[:s].present?\n\n subject = Actor.find_by_slug!(params[:s]).subject\n\n unless subject.represented_by?(current_user)\n raise CanCan::AccessDenied.new(\"Not authorized!\", :represent, subject.name)\n end\n\n self.current_subject = subject\n end", "title": "" } ]
38a2326f25bc71809aa5ad8ca2408afd
Yield all integers from 0 up to, but not including, the number of items in this collection. For collections which provide indexed access, these are all the valid, nonnegative indices into the collection.
[ { "docid": "fb92c2ccce740cdf1acae81d913c607f", "score": "0.58126837", "text": "def each_index(&block)\n return enum_for(:each_index) unless block_given?\n 0.upto(size-1, &block)\n self\n end", "title": "" } ]
[ { "docid": "5b600c660828785b6b2a8a7bdfdce1cd", "score": "0.60059774", "text": "def index_iterator(start=0, stop=nil)\n if stop.nil?\n stop = n\n end\n\n maximum_indicies = @reps[start...stop]\n remaining_indicies = maximum_indicies.map { |maximum| (0...maximum).to_a }\n return [[]] if remaining_indicies.empty?\n remaining_indicies[0].product(*remaining_indicies.drop(1))\n end", "title": "" }, { "docid": "629dd4b7c811e5aeff45ed3eab47dda5", "score": "0.5989652", "text": "def each\n 0.upto(item_count - 1) { | i | yield i }\n end", "title": "" }, { "docid": "e4531e5eaafbe26700c7f21665c9b41e", "score": "0.59305733", "text": "def index()\n INDEXES.find { |i| (self + i).exist? }&.yield_self { |i| self + i }\n end", "title": "" }, { "docid": "21992799e8fafc438e90ba032d513d55", "score": "0.58659256", "text": "def my_each_with_index\n return to_enum unless block_given?\n\n i = 0\n while i < size\n yield(self[i], i)\n i += 1\n end\n self\n end", "title": "" }, { "docid": "1b072075c1bb6141baf9f9765cebad2c", "score": "0.5864721", "text": "def each\n if block_given?\n (0...Count()).each { |i| yield self[i] }\n else\n (0...Count()).map { |i| self[i] }\n end\n end", "title": "" }, { "docid": "ed5d21d6b4c931e506893d3d32a52901", "score": "0.580821", "text": "def my_each_with_index\n i = 0\n while i < self.size\n yield(self[i], i)\n i += 1\n end\n self\n end", "title": "" }, { "docid": "c20e2cd098953d17bd270dfe0268c2aa", "score": "0.57921875", "text": "def my_each_with_index\n i = 0\n while i < self.size\n yield self[i], i\n i += 1\n end\n end", "title": "" }, { "docid": "fd9d061111e80133ae64a293f3e3f901", "score": "0.5697011", "text": "def my_each_with_index\n i = 0\n while i < self.length\n yield self[i], i\n i += 1\n end\n self\n end", "title": "" }, { "docid": "197eb7d15a4581b23e1112761e31d6d0", "score": "0.5690691", "text": "def my_each_with_index\n i = 0\n while i < self.length\n yield(self[i], i)\n i += 1\n end\n self\n end", "title": "" }, { "docid": "057dd530cb2d4bff2235c1b21928069a", "score": "0.56863946", "text": "def my_each_with_index\n i = 0\n while i < size\n yield(self[i], i)\n i += 1\n end\n self\n end", "title": "" }, { "docid": "fa0891fd3606fb3c16d6edaffcf4b527", "score": "0.56820184", "text": "def my_count\n return self.to_enum unless block_given?\n counter = 0\n for i in self\n counter +=1 if yield i\n end\n return counter\n end", "title": "" }, { "docid": "75ed2bfb4ef0a1926b4ac1fee1262d6d", "score": "0.5651877", "text": "def my_each_with_index\n return to_enum unless block_given?\n\n i = 0\n while i < length\n yield(self[i], i)\n i += 1\n end\n end", "title": "" }, { "docid": "963a6330c1e21acffbcc58e9575d3c0d", "score": "0.559747", "text": "def keys\n @index.range(0, -1)\n end", "title": "" }, { "docid": "60f65bb0ce6cfdad427d5c0d455b6224", "score": "0.55923283", "text": "def each_nonzero\n @buckets.each_with_index do |count, index|\n yield(to_bucket(index), count) if count != 0\n end\n end", "title": "" }, { "docid": "6bf63c6435b4d628def9bdf39f22a704", "score": "0.5589358", "text": "def each()\n i = 0\n while i < @total\n yield at(i)\n i += 1\n end\n self\n end", "title": "" }, { "docid": "9212ed82aeab9945663b4768e3fdf466", "score": "0.5586711", "text": "def my_each_with_index\n\t\tself.length.times do |index|\n\t\t\tyield(self[index], index)\n\t\tend\n\tend", "title": "" }, { "docid": "37899332caa5a8d5be0882be3b56f5ba", "score": "0.5568657", "text": "def each\n return to_enum(:each) unless block_given?\n @size.times { |position| yield self[position] }\n end", "title": "" }, { "docid": "6c779f54a73a71c4972961957735c330", "score": "0.55242074", "text": "def my_each_with_index\n for i in 0...self.length do\n yield(self[i], i)\n end\n return self\n end", "title": "" }, { "docid": "e1e16aea3a5a4ccffd4a5c11d55a9b8b", "score": "0.5512586", "text": "def my_each_with_index\n a = (is_a? Hash) ? to_a : self\n i = 0\n while i < a.count\n yield a[i], i\n i += 1\n end\n end", "title": "" }, { "docid": "47b70f832661960c296ea590fb041832", "score": "0.55123746", "text": "def each\n return to_enum :each unless block_given?\n 0.upto(size-1) { |i| yield self[i] }\n self\n end", "title": "" }, { "docid": "47b70f832661960c296ea590fb041832", "score": "0.55123746", "text": "def each\n return to_enum :each unless block_given?\n 0.upto(size-1) { |i| yield self[i] }\n self\n end", "title": "" }, { "docid": "3d5b98221cd926440c7789c52b0d734e", "score": "0.5501945", "text": "def my_each_with_index\n if block_given?\n for i in 0.upto(self.length-1)\n yield self[i], i\n end\n else\n self.to_enum\n end\n end", "title": "" }, { "docid": "c23f1cfe35e751df4ae56a31f861434d", "score": "0.54909724", "text": "def xrange(key, start = T.unsafe(nil), range_end = T.unsafe(nil), count: T.unsafe(nil)); end", "title": "" }, { "docid": "8e4898a43c36ed0d35c4f71b333d1b44", "score": "0.5473684", "text": "def my_each_with_index\n return to_enum unless block_given?\n\n index = 0\n my_each do |value|\n yield(value, index)\n index += 1\n end\n end", "title": "" }, { "docid": "aafa85f5bbff01cffe132074cee9d2e6", "score": "0.5437595", "text": "def my_each_with_index\n \ti = 0\n \twhile i < self.length\n \t\tif block_given?\n \t\t\tyield(self[i], i)\n \t\telse\n \t\t\treturn self\n \t\tend\n \t\ti +=1\n \tend\n \tself\n end", "title": "" }, { "docid": "cc4b162fc40fc3236dfba8fc34014427", "score": "0.54323727", "text": "def grab(n)\n retval = []\n begin\n n.times{retval << self.next}\n rescue StopIteration\n end\n retval\n end", "title": "" }, { "docid": "4bfcfabe9c19988184ffc0ee33a9a380", "score": "0.5424266", "text": "def each_index\n return to_enum(__callee__) unless block_given?\n \n each_with_index{ |_, idx| yield(idx) }\n end", "title": "" }, { "docid": "9dd3e71eb3a95d435b7dedccb6b45b67", "score": "0.5371467", "text": "def my_each_with_index\n for i in 0..self.length-1\n yield(self[i], i) if block_given?\n end\n self\n end", "title": "" }, { "docid": "a25b0ef26d8ea0707c170320796ae180", "score": "0.53671414", "text": "def get_index(i)\n i/BITS_PER_ITEM\n end", "title": "" }, { "docid": "d9c65ef55b817154e15c7af0ffc8dc3b", "score": "0.53631985", "text": "def my_each_with_index\n i = 0\n while i < self.to_a.length\n yield self.to_a[i], i\n i += 1\n end\n end", "title": "" }, { "docid": "a3d8e55b037b3493e025ba7c8f380f61", "score": "0.53566855", "text": "def nbr_selected_indexes\n result = 0\n for i in @indexes\n if i >= 0\n result += 1\n end\n end\n return result\n end", "title": "" }, { "docid": "a7ed0d42dc5cdf86bc1a3ffd60f50e09", "score": "0.5343678", "text": "def my_each_with_index\n return to_enum unless block_given?\n i = 0\n array = []\n while i < size\n yield to_a[i], i\n array << to_a[i]\n i += 1\n end\n array\n end", "title": "" }, { "docid": "dd0cd58a74f4baa8da54c97ba03b1a00", "score": "0.53272927", "text": "def each_missing(num, &block)\n if (num.is_a? Range) then\n num.each { |n| each_missing(n, &block) }\n return\n end\n\n if (num.is_a? Array) then\n num.each { |n| each_missing(n, &block) }\n return\n end\n\n if (!num.is_a?Integer) then\n raise \"each_missing: num argument must be an Integer, Array of Integers, or Range. num=#{num.inspect} which is a #{num.class}\"\n end\n\n if (num==0) then\n yield self\n return\n end\n\n if (num > self.size) then\n return\n end\n\n each_index do |index|\n before_first_missing = self[0,index]\n #after_first_missing = self[index+1,size]\n self[index+1,size].each_missing(num-1) do |subset|\n yield before_first_missing+subset\n end\n end\n end", "title": "" }, { "docid": "7c9f86072b8e9a398088e724d26a5a27", "score": "0.5305804", "text": "def each_with_index(&block)\n return to_enum :each_with_index unless block\n\n i = 0\n self.each{|*val|\n block.call(val.__svalue, i)\n i += 1\n }\n self\n end", "title": "" }, { "docid": "832f6f27e98a53affea488a4b30d9b28", "score": "0.5294048", "text": "def each\n (0...size).each {|i| yield(self[i])}\n nil\n end", "title": "" }, { "docid": "2ea7f97c9da0f8057d51b1afd0397b27", "score": "0.52882695", "text": "def unbounded\n RepeatCount.unbounded\n end", "title": "" }, { "docid": "c9b60c324f29ad016ccbbb01c1f37e1b", "score": "0.5267869", "text": "def each_index(&block)\n enum = Enumerator.new do |yielder|\n begin\n @each_index = {}\n\n count = 0\n self.each do |ele|\n # Remove previous element to not take up memory.\n count_before = count - 1\n @each_index.delete(count_before) if @each_index.key?(count_before)\n\n # Add current element to cache.\n @each_index[count] = ele\n yield(count)\n\n # Increase count for next run.\n count += 1\n end\n ensure\n @each_index = nil\n end\n end\n\n if block\n enum.each(&block)\n return nil\n else\n return enum\n end\n end", "title": "" }, { "docid": "1235c57ffcf01635a79e98dd291dbf55", "score": "0.523242", "text": "def each_with_index\n ordered_values = values\n ordered_values.each_with_index do |v,i|\n yield ordered_values[i], min_index + (i*@range)\n end\n end", "title": "" }, { "docid": "fb4d6b617c23739550c69fc3f64fbd5f", "score": "0.5197244", "text": "def each_number_to( number )\r\n\r\n index = 0\r\n while index < number\r\n yield(index)\r\n index += 1\r\n end\r\n\r\nend", "title": "" }, { "docid": "ecdd182d65203a26ea9a0865cc085a99", "score": "0.51959664", "text": "def each_index\n return enum_for(:each_index) unless block_given?\n\n each_index_root_page_number do |page_number|\n yield index(page_number)\n end\n\n nil\n end", "title": "" }, { "docid": "f50c2d1a3704b743654a2227c0b48b46", "score": "0.5157974", "text": "def each_nz(&block)\n return to_enum(:each_nz) unless block_given?\n nz_indicies.each { |k| yield @elements[k] }\n self\n end", "title": "" }, { "docid": "853e6574703503be0a0cbea930283d5d", "score": "0.51489365", "text": "def my_each_with_index(&block)\n return to_enum(:my_each_with_index) unless block_given?\n n = 0\n while n < length\n block.call(self[n], n) if is_a?(Array)\n block.call(keys[n], self[keys[n]]) if is_a?(Hash)\n block.call(self[n]) if is_a?(Range)\n n += 1\n end\n self\n end", "title": "" }, { "docid": "38f399d43ac6a15ce4a8f786b7156019", "score": "0.51473475", "text": "def ig\n\t\tig_ind.reduce(0, :+)/ig_ind.size\n\tend", "title": "" }, { "docid": "01727b07ec43c806facf0c1b9f1b29de", "score": "0.5144649", "text": "def iterate(collection, options = {}, &block)\n options.reverse_merge!(:size => Paginate::Config.size)\n yield_index = block.arity == 2\n\n collection[0, options[:size]].each_with_index do |item, i|\n if yield_index\n yield item, i\n else\n yield item\n end\n end\n end", "title": "" }, { "docid": "04dc9c7b8eabca639d5bb651415faaf3", "score": "0.51429725", "text": "def my_count\n return self unless block_given?\n count = 0\n for i in self\n if yield(i)\n count += 1\n end\n end\n return count\n end", "title": "" }, { "docid": "a4fc70a34b47af35b6e1cc27195dd369", "score": "0.5129935", "text": "def each_with_index(zeroes = false, &_block)\n return enum_for :each_with_index, zeroes unless block_given?\n if zeroes\n row_count.times do |row|\n column_count.times do |_col|\n element = self[row, column]\n yield [element, row, column]\n end\n end\n else\n ia.each_cons(2).each_with_index do |indexes, row|\n row_start, row_end = *indexes\n a[row_start...row_end].each_with_index do |element, index|\n yield [element, row, ja[row_start + index]]\n end\n end\n end\n end", "title": "" }, { "docid": "ebc2b0dff0098f1b3406d1c33eea960d", "score": "0.5123387", "text": "def nitems\n count = 0\n i = 0\n lim = self.__size\n while i < lim\n count += 1 unless self.__at(i)._equal?(nil)\n i += 1\n end\n count\n end", "title": "" }, { "docid": "70273282f152c5f1f2304aea89eabea7", "score": "0.51170754", "text": "def each(&block)\n @size.times { |position| yield self.get(position) }\n end", "title": "" }, { "docid": "99239598257d9065ced5131f3fff9d7e", "score": "0.51154226", "text": "def indexable_resources\n return to_enum(:indexable_resources) { resources.size + resources.sum { |r| r.items.size } } unless block_given?\n\n resources.each do |resource|\n yield resource\n\n resource.items.each do |r|\n yield r\n end\n end\n end", "title": "" }, { "docid": "b0b1ddd1dd1a16abc3558256bae02b65", "score": "0.5081082", "text": "def indgen(n)\n NVector.seq(n, :int32)\n end", "title": "" }, { "docid": "b0b1ddd1dd1a16abc3558256bae02b65", "score": "0.5081082", "text": "def indgen(n)\n NVector.seq(n, :int32)\n end", "title": "" }, { "docid": "a5882a048eeeb266123354512cd9bbfc", "score": "0.5077218", "text": "def each(&block) # :yields: result\n 0.upto(@size - 1) {|x| yield self[x]}\n end", "title": "" }, { "docid": "a34f6d9948187a9db0a036fe857be36c", "score": "0.507661", "text": "def each(&block)\n @size.times { |position| yield self[position] }\n end", "title": "" }, { "docid": "a34f6d9948187a9db0a036fe857be36c", "score": "0.50762856", "text": "def each(&block)\n @size.times { |position| yield self[position] }\n end", "title": "" }, { "docid": "6c43ad7ccc1ee5cc05db5305abcd3fee", "score": "0.50720966", "text": "def each(&block)\n return to_enum unless block_given?\n index.each(&block)\n self\n end", "title": "" }, { "docid": "5502f93dd03282c2766c65eb8a4a0a08", "score": "0.5071717", "text": "def each\n @indexes.each { |_name, index| yield index }\n end", "title": "" }, { "docid": "d36c0cc131f1f45323092cd86048457b", "score": "0.5068613", "text": "def each(collection)\n\ti = collection.count\n\twhile i > 0\n\t\tyield collection\n\t\ti -= 1\n\tend\nend", "title": "" }, { "docid": "6968272bfa015a4a06e7f8e01aecbf20", "score": "0.502497", "text": "def each(&block)\n @size.times { |position| yield self[position] }\n end", "title": "" }, { "docid": "6968272bfa015a4a06e7f8e01aecbf20", "score": "0.502497", "text": "def each(&block)\n @size.times { |position| yield self[position] }\n end", "title": "" }, { "docid": "6968272bfa015a4a06e7f8e01aecbf20", "score": "0.502497", "text": "def each(&block)\n @size.times { |position| yield self[position] }\n end", "title": "" }, { "docid": "d60b32040185cc98dc44f94f35334803", "score": "0.50217795", "text": "def each_index(&block)\n @size.times { |index| yield index}\n end", "title": "" }, { "docid": "34ca4f4a84617c7fbf4d9e69a60402af", "score": "0.5019688", "text": "def each(&block)\n unless block_given?\n return ArrayEnumerator.new(self, :each ) # for 1.8.7\n end\n i = 0\n lim = self.__size\n while i < lim\n block.call(self.__at(i))\n i += 1\n end\n self\n end", "title": "" }, { "docid": "308d5de6b71bf7045dcdb7807aba4bb8", "score": "0.5017422", "text": "def nilitems\n size - nitems\n end", "title": "" }, { "docid": "1d5b99a9c72d622b0eeaf8d7230aa9b4", "score": "0.5015351", "text": "def each\r\n res = self.to_a\r\n 0.upto(res.length - 1) do |x|\r\n yield res[x]\r\n end\r\n end", "title": "" }, { "docid": "25ae5d56ea6ceded4a8424eadb8a3aab", "score": "0.501265", "text": "def my_each_with_index\n return self unless block_given?\n\n if is_a? Array\n length.times { |idx| yield(self[idx], idx) }\n elsif is_a? Hash\n keys = self.keys\n vals = values\n length.times { |idx| yield([keys[idx], vals[idx]], idx) }\n else\n warn 'Incompatible type!'\n end\n self\n end", "title": "" }, { "docid": "5ac6d212b7359f92b9a97d76fd1ae066", "score": "0.50047743", "text": "def outidx\n @index_range.begin\n end", "title": "" }, { "docid": "49d12158f86e5992ae8dbde075e8d8cb", "score": "0.49932167", "text": "def conform input_indexes\n return self if input_indexes[0].is_a? Range\n drop_left_level input_indexes.size\n end", "title": "" }, { "docid": "49d12158f86e5992ae8dbde075e8d8cb", "score": "0.49928737", "text": "def conform input_indexes\n return self if input_indexes[0].is_a? Range\n drop_left_level input_indexes.size\n end", "title": "" }, { "docid": "49d12158f86e5992ae8dbde075e8d8cb", "score": "0.49928737", "text": "def conform input_indexes\n return self if input_indexes[0].is_a? Range\n drop_left_level input_indexes.size\n end", "title": "" }, { "docid": "76ffaac087c54fbd2476f1d55518f358", "score": "0.49837157", "text": "def each2_nz(v) # :yield: e1, e2\n raise TypeError, \"Integer is not like SparseVector\" if v.kind_of?(Integer)\n SparseVector.Raise ErrDimensionMismatch if size != v.size\n return to_enum(:each2_nz, v) unless block_given?\n (nz_indicies + v.nz_indicies).uniq.sort.each do |i|\n yield @elements[i], v[i]\n end\n end", "title": "" }, { "docid": "3e6445e04ff0b7c65950c2ae76de194c", "score": "0.49801552", "text": "def eachio_index(&block) # :yield: index\n 0.upto(length-1, &block)\n self\n end", "title": "" }, { "docid": "7042c7d27b3266cd2523d32718f9c835", "score": "0.49781585", "text": "def each\n @tuple_rec.each do |tuple, rec|\n yield tuple, rec.count if rec.count > 0\n end\n end", "title": "" }, { "docid": "09f768d2ab00fada5b73b5b41b86b385", "score": "0.4974963", "text": "def each\n @size.times do |i|\n yield self[i]\n end\n end", "title": "" }, { "docid": "81635c21938fe1ed07ec86f7239131d7", "score": "0.49730954", "text": "def ids\n key.call(\"LRANGE\", 0, -1)\n end", "title": "" }, { "docid": "18f5af539509b500539a09d22204754d", "score": "0.4969674", "text": "def nitems() end", "title": "" }, { "docid": "3f26a3e237368a25f8d2baaca509f418", "score": "0.49692518", "text": "def basic_10 (array_iterate)\n array_iterate.collect! { |n| n < 0 ? n = 0 : n }\n return array_iterate\nend", "title": "" }, { "docid": "d00c115b61367b449619833daaa2a3b2", "score": "0.4964634", "text": "def each_with_index(node=@head)\n i = 0\n until node.nil?\n result = yield(node, i)\n node = node.next_node\n i += 1\n end\n result\n end", "title": "" }, { "docid": "3e11c84c322e744e17d18fb8f49350d8", "score": "0.49569145", "text": "def each_value_with_index\n @nz.each do |i, j, v|\n yield v, i, j\n end\n end", "title": "" }, { "docid": "5962608f176a8987534675ce3eb90efb", "score": "0.49475315", "text": "def skip(n = 1)\n Enumerator.new do |out|\n s = self.ensure_enum\n begin\n n.times {s.next}\n loop do\n out.yield s.next\n end\n rescue StopIteration\n end\n end\n end", "title": "" }, { "docid": "2a5e2f2532d6c1ddbbeda7c223d35e59", "score": "0.49414334", "text": "def all_indices\n @indices ||= []\n @indices.dup\n end", "title": "" }, { "docid": "d52030d0fd6cd77a65a262dcfbd066de", "score": "0.49258533", "text": "def each_index\n @block_args.each_index do |i|\n yield i\n end\n end", "title": "" }, { "docid": "2ff771431e0c4f1455f6d323ecba3e46", "score": "0.49258238", "text": "def keys\n each_with_index.map {|_, index| index }\n end", "title": "" }, { "docid": "6859561208bd888ac0ab01d0ea98ad18", "score": "0.4924105", "text": "def lazy_index(index)\n index -= @map.keys.select{|e| e < index}.size\n result = 0\n @deleted.each do |deleted_index|\n if deleted_index - result > index\n return result + index\n else\n index -= deleted_index - result\n result = deleted_index + 1\n end\n end\n result + index\n end", "title": "" }, { "docid": "b514d46a6b62f329975f722e8592ec9c", "score": "0.49146983", "text": "def each a\n\ti = 0\n\tuntil i == a.size\n\t\tyield a[i]\n\t\ti += 1\n\tend\n\ta\nend", "title": "" }, { "docid": "76e56957209812076754d8a92734c635", "score": "0.4912263", "text": "def not_available\n (0...@size).reject { |index| bit_on?(index) }\n end", "title": "" }, { "docid": "e328224eb110e43fec79148a476e8016", "score": "0.49022788", "text": "def each(&block)\n return to_enum unless block_given?\n @index.each(&block)\n self\n end", "title": "" }, { "docid": "c3415edf2986cd4683b4a5dea79a8877", "score": "0.48963642", "text": "def last_ids(number)\n (1 + size - number..size).to_a\n end", "title": "" }, { "docid": "013892e9f792ec22d1f2ab250ab5feec", "score": "0.48840067", "text": "def each(&block)\n @size.times { |index| yield self[index]}\n end", "title": "" }, { "docid": "1985c60e7b881eb23bc42a0f56a8173f", "score": "0.48835477", "text": "def item_count\n @item_count ||= except(:includes, :limit, :offset).count\n end", "title": "" }, { "docid": "a487d4e45abb53fe8e49412a9af5b62f", "score": "0.4873606", "text": "def each_with_index\n\t\[email protected]_with_index do |v,i|\n\t\t\tyield v & 0x0F, i * 2 #Bottom Nibble\n\t\t\tyield (v >> 4) & 0x0F, i * 2 + 1#Top Nibble\n\t\tend\n\tend", "title": "" }, { "docid": "057ea0c9a80c87dd3585f6e3e4407996", "score": "0.4872324", "text": "def missing_integer(a)\n result = []\n a.each do |i|\n result[i] = i if i > 0\n end\n\n i = 1\n while result[i] != nil\n i += 1\n end\n i\nend", "title": "" }, { "docid": "3ef2c11e9f1aa28870bd10e10032f704", "score": "0.48660842", "text": "def map!\n i = 0\n while i < @total\n self[i] = yield(at(i))\n i += 1\n end\n self\n end", "title": "" }, { "docid": "821e620ce626057b116e08e73a4a8b89", "score": "0.4858836", "text": "def each(&block_)\n @indexes.each(&block_)\n end", "title": "" }, { "docid": "8c2811ce21b72c9c8369bcf83bc0ef95", "score": "0.4854042", "text": "def each_with_index(&blk)\n (0..@size-1).each { |i| blk.call(self.[](i),i) }\n end", "title": "" }, { "docid": "2d1cf1897cbf22f0cb1bc6f5cd0fb6e6", "score": "0.48537567", "text": "def each_index\n (0...hsize).each { |j|\n (0...vsize).each { |i|\n yield i, j\n }\n }\n self\n end", "title": "" }, { "docid": "71b5705aa4c1e73b2e6e10682efe80fb", "score": "0.4845835", "text": "def each\n return self.to_enum unless block_given?\n return nil if from.nil? || to.nil?\n if to < from\n from.downto(to) {|x| yield x }\n else\n from.upto(to) {|x| yield x }\n end\n end", "title": "" }, { "docid": "5b9ebe424fdec1e539ccfdec5ca028fa", "score": "0.48432645", "text": "def each_index_root_page_number\n return enum_for(:each_index_root_page_number) unless block_given?\n\n if innodb_system\n # Retrieve the index root page numbers from the data dictionary.\n innodb_system.data_dictionary.each_index_by_space_id(space_id) do |record|\n yield record[\"PAGE_NO\"]\n end\n else\n # Guess that the index root pages will be present starting at page 3,\n # and walk forward until we find a non-root page. This should work fine\n # for IBD files, if they haven't added indexes online.\n (3...@pages).each do |page_number|\n page = page(page_number)\n yield page_number if page.is_a?(Innodb::Page::Index) && page.root?\n end\n end\n\n nil\n end", "title": "" }, { "docid": "e36006bee46c56a06858397d3408ea88", "score": "0.48412126", "text": "def test_skips_all_elements_count_gt_size\n stream = FromArray.new([1, 2, 3])\n collected = stream.skip(4).collect\n assert(\n collected == [],\n 'Expected ' + [].to_s + ' but got ' + collected.to_s\n )\n end", "title": "" }, { "docid": "67fdbcc40f81d53c4ba530a364892a6c", "score": "0.4836426", "text": "def each\n @items.each { |i| yield i }\n end", "title": "" }, { "docid": "b85788f8414a7cfec32493bb1fa8c039", "score": "0.4834681", "text": "def each_leading_edge\n return to_enum(__method__) { count } unless block_given?\n\n each_item { |item| yield item.begin }\n end", "title": "" } ]
95f2736c0f4d232128777d73b4a7ae2f
Retrieve payments for a payout Retrieve payments for a payout
[ { "docid": "ff29c93d45928d5be4ada7c87ac1cc33", "score": "0.6159602", "text": "def get_payments_for_payout_v3_with_http_info(payout_id, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: PayoutServiceApi.get_payments_for_payout_v3 ...'\n end\n # verify the required parameter 'payout_id' is set\n if @api_client.config.client_side_validation && payout_id.nil?\n fail ArgumentError, \"Missing the required parameter 'payout_id' when calling PayoutServiceApi.get_payments_for_payout_v3\"\n end\n allowable_values = [\"ACCEPTED\", \"REJECTED\", \"WITHDRAWN\", \"WITHDRAWABLE\"]\n if @api_client.config.client_side_validation && opts[:'status'] && !allowable_values.include?(opts[:'status'])\n fail ArgumentError, \"invalid value for \\\"status\\\", must be one of #{allowable_values}\"\n end\n allowable_values = [\"ACH\", \"SAME_DAY_ACH\", \"WIRE\"]\n if @api_client.config.client_side_validation && opts[:'transmission_type'] && !allowable_values.include?(opts[:'transmission_type'])\n fail ArgumentError, \"invalid value for \\\"transmission_type\\\", must be one of #{allowable_values}\"\n end\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] > 100\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PayoutServiceApi.get_payments_for_payout_v3, must be smaller than or equal to 100.'\n end\n\n if @api_client.config.client_side_validation && !opts[:'page_size'].nil? && opts[:'page_size'] < 1\n fail ArgumentError, 'invalid value for \"opts[:\"page_size\"]\" when calling PayoutServiceApi.get_payments_for_payout_v3, must be greater than or equal to 1.'\n end\n\n # resource path\n local_var_path = '/v3/payouts/{payoutId}/payments'.sub('{' + 'payoutId' + '}', CGI.escape(payout_id.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?\n query_params[:'remoteId'] = opts[:'remote_id'] if !opts[:'remote_id'].nil?\n query_params[:'payorPaymentId'] = opts[:'payor_payment_id'] if !opts[:'payor_payment_id'].nil?\n query_params[:'sourceAccountName'] = opts[:'source_account_name'] if !opts[:'source_account_name'].nil?\n query_params[:'transmissionType'] = opts[:'transmission_type'] if !opts[:'transmission_type'].nil?\n query_params[:'paymentMemo'] = opts[:'payment_memo'] if !opts[:'payment_memo'].nil?\n query_params[:'pageSize'] = opts[:'page_size'] if !opts[:'page_size'].nil?\n query_params[:'page'] = opts[:'page'] if !opts[:'page'].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] || 'PagedPaymentsResponseV3'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['OAuth2']\n\n new_options = opts.merge(\n :operation => :\"PayoutServiceApi.get_payments_for_payout_v3\",\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: PayoutServiceApi#get_payments_for_payout_v3\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" } ]
[ { "docid": "77526e1ca9206f9965caa5bea7029a5a", "score": "0.68665457", "text": "def payments\n @session.payments @account_id\n end", "title": "" }, { "docid": "8852eb07c3a5d693db7f5d90c9ec3a9c", "score": "0.6783584", "text": "def get_payments(options = {})\n request_params = {}\n request_params[:PaymentID] = options[:payment_id] if options[:payment_id]\n request_params[:ModifiedAfter] = options[:modified_since] if options[:modified_since]\n request_params[:order] = options[:order] if options[:order]\n request_params[:where] = options[:where] if options[:where]\n\n response_xml = http_get(@client, \"#{@xero_url}/Payments\", request_params)\n parse_response(response_xml, {:request_params => request_params}, {:request_signature => 'GET/payments'})\n end", "title": "" }, { "docid": "30f0da8a28ce8f8da752ba958824c982", "score": "0.677031", "text": "def payments\n @session.payments @account_id\n end", "title": "" }, { "docid": "abba1614c8a1e9f39727917fe6c6e2c4", "score": "0.6578896", "text": "def payments\n @payments ||= []\n end", "title": "" }, { "docid": "31b18d97d1ae0cd0df66a15fad8c3240", "score": "0.65489787", "text": "def get_payout(payout_id:)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::GET,\n '/v2/payouts/{payout_id}',\n 'default')\n .template_param(new_parameter(payout_id, key: 'payout_id')\n .should_encode(true))\n .header_param(new_parameter('application/json', key: 'accept'))\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": "616e275c43380551248f0c230eeea851", "score": "0.651698", "text": "def index\n @payments = @user.payments\n end", "title": "" }, { "docid": "736ae45fe0913f5d2949904cc4069481", "score": "0.650494", "text": "def index\n @payouts = Payout.all\n end", "title": "" }, { "docid": "736ae45fe0913f5d2949904cc4069481", "score": "0.650494", "text": "def index\n @payouts = Payout.all\n end", "title": "" }, { "docid": "338b21ac9137bfc3d78b161955f4afcf", "score": "0.64422077", "text": "def index\n @user = User.find(current_user.id)\n @user_payouts = Payout.where(user_id:@user.id)\n end", "title": "" }, { "docid": "ca4f2dce9ac51fbb7ba63c6a4ac8be40", "score": "0.63313335", "text": "def index\n @member_payments = @customer.member_payments.pendings\n end", "title": "" }, { "docid": "f199155fd90b58a67c4d055ea2c7f902", "score": "0.62804586", "text": "def user_payments\n @payments = Payment.get_user_payments(current_user.id)\n end", "title": "" }, { "docid": "32685fc9b91e2cd0aef8b19ef3c52af2", "score": "0.62742186", "text": "def index\n\t\t@payments = @user.payments.order(\"date desc\").page( params[:page] ).per(10)\n\tend", "title": "" }, { "docid": "caa5b5168e457e6bca4d4d91c75fab6a", "score": "0.62583727", "text": "def index\n #@payments = Payment.all\n @payment = Payment.find(params[:id])\n end", "title": "" }, { "docid": "cfa49fb437b6ba9071edfc1b2d2ff6b5", "score": "0.6230233", "text": "def payments(account_id = nil)\n query_api_object Payment, account_id.nil? ? \"/rest/payments\" : \"/rest/accounts/#{account_id}/payments\", nil, \"GET\", \"payments\"\n end", "title": "" }, { "docid": "d3aca03b7ae6d2b6c2edd067d80b93cf", "score": "0.62132066", "text": "def retrieve_payment_data(pay_key)\n api.execute(:PaymentDetails, pay_key: pay_key) do |response|\n if response.success?\n response.payment_info_list.payment_info.each do |payment|\n p \"Receiver: #{payment.receiver.email}\"\n p \"Amount: #{payment.receiver.amount.to_f}\"\n p \"Transaction status: #{payment.transaction_status}\".green\n end\n else\n p \"#{response.ack_code}: #{response.error_message}\".red\n end\n return response\n end\nend", "title": "" }, { "docid": "8f189432b14ec2c71871959ce6f6d27b", "score": "0.6204968", "text": "def index\n @customer = Customer.find(params[:cust_id])\n @payments = @customer.payments\n end", "title": "" }, { "docid": "2bdca6cfc327f0315fd66bcf29de0040", "score": "0.6164439", "text": "def all_payment_entries\n @ac = ApplicationController.new\n @payments = PaymentFromDestination.find(:all, :order => \"created_at\").reverse!\n end", "title": "" }, { "docid": "964cdfeddc1163463636143876d47863", "score": "0.61428803", "text": "def set_payout\n @payout = Payout.find(params[:id])\n end", "title": "" }, { "docid": "964cdfeddc1163463636143876d47863", "score": "0.61428803", "text": "def set_payout\n @payout = Payout.find(params[:id])\n end", "title": "" }, { "docid": "11b7f471ffb6a80005c08ea6a31a280b", "score": "0.6139574", "text": "def index\n @payments = Payment.all_for_user(current_user)\n end", "title": "" }, { "docid": "042409d9a496ad46f1aba70b9f6de1b1", "score": "0.61157554", "text": "def index\n if current_user.admin?\n @payments = Payment.order(updated_at: :desc).paginate(page: params[:page], per_page: 12)\n else\n @payments = Payment.order(updated_at: :desc).where(user: current_user).paginate(page: params[:page], per_page: 12)\n end\n end", "title": "" }, { "docid": "5712b5dbe04db5ead415e166d7f0969a", "score": "0.61084646", "text": "def get_payment(payment_id)\n @session.get_payment @account_id, payment_id\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "e4386f45e63fd277454314d6d0137119", "score": "0.61079144", "text": "def index\n @payments = Payment.all\n end", "title": "" }, { "docid": "5fb344fcadbcae1103e1159ecf80c633", "score": "0.60922843", "text": "def request_a_payment_or_payout(opts = {})\n data, _status_code, _headers = request_a_payment_or_payout_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "8f1a67f6c7311af7df4f2e7917746707", "score": "0.60662174", "text": "def pay(payment)\n retval\n end", "title": "" }, { "docid": "7aafb4391b99f4ff83e79fda544b598c", "score": "0.60520655", "text": "def index\n @paymentts = Paymentt.all\n end", "title": "" }, { "docid": "a0210c484432073d36447114fb25fdc5", "score": "0.60190195", "text": "def index\n @recieve_payments = RecievePayment.all\n end", "title": "" }, { "docid": "b339d0cd748cfedbc3ebf72218ebdd7c", "score": "0.6015964", "text": "def get_payments_for_payout_v3(payout_id, opts = {})\n data, _status_code, _headers = get_payments_for_payout_v3_with_http_info(payout_id, opts)\n data\n end", "title": "" }, { "docid": "3d3fc704934957ee3ed559771e147c6c", "score": "0.60047907", "text": "def get_payment(payment_id)\n @session.get_payment @account_id, payment_id\n end", "title": "" }, { "docid": "32b3f8d84320803fda60968d3656872b", "score": "0.59989494", "text": "def get_list_payments_methods\n PaymentMethod.get_list_payment_methods\n end", "title": "" }, { "docid": "8c48f42468de38470750eec45a7e3371", "score": "0.5998334", "text": "def index\n @pay_items = PayItem.all\n end", "title": "" }, { "docid": "ede9db3b1acd05c1757cf023f93f630f", "score": "0.59979355", "text": "def payments\n if params['form_payment']\n results = CsApi::Member.update(current_access_token, @current_user.username, params['form_payment'])\n #check for errors!!\n if results['success'].eql?('false')\n flash.now[:error] = results['message']\n else\n flash.now[:notice] = 'Your payment information has been updated.'\n get_account\n end\n end\n # set the member's id for docusign\n @memberId = @account['id']\n @payments = CsApi::Member.payments(current_access_token, @current_user.username)\n @payments.each do |record| \n if record['status'].eql?('Paid')\n @show_paid_section = true\n else \n @show_outstanding_section = true\n end\n end\n @page_title = 'Your Payments and Payment Info'\n respond_to do |format|\n format.html\n format.json { render :json => @payments }\n end\n end", "title": "" }, { "docid": "5a60984085df164ca25837ddef1a9b8d", "score": "0.59966487", "text": "def index\n @payments = Payment.where client: @client\n end", "title": "" }, { "docid": "9e5125377ba0b3168fa8810aeb84eb60", "score": "0.59864795", "text": "def show\n @payment_records = @pay_roll.payment_records.page(params[:page]).per(10)\n end", "title": "" }, { "docid": "a7ce00cb72039d60f4989aa16549e21f", "score": "0.5972462", "text": "def index\n @type_of_payments = TypeOfPayment.accessible_by(current_ability).order(id: :desc).page params[:page]\n end", "title": "" }, { "docid": "d7ea6e62590b7ed613eb5356c31b126f", "score": "0.5968973", "text": "def all_payments\n Payment.joins(:application).where('applications.student_id=?', id).where.not(status: nil)\n end", "title": "" }, { "docid": "2a720af9a37ffd552c184b661d77f14d", "score": "0.595772", "text": "def index\n @debt_payments = DebtPayment.all\n end", "title": "" }, { "docid": "3f63f1ab2eaf700df38f2c0dc4bd3e11", "score": "0.59573996", "text": "def index\n @pay_methods = PayMethod.all\n end", "title": "" }, { "docid": "6768a73797272711fcf280f4edad0b63", "score": "0.59427667", "text": "def index\n @pays = Pay.all\n end", "title": "" }, { "docid": "4215dd3d2d7c4a6b7167bcc382aad884", "score": "0.59159184", "text": "def index\n @provider_payments = ProviderPayment.all\n end", "title": "" }, { "docid": "86b360cb767b15b54041be15fd9f53ae", "score": "0.58979326", "text": "def due_payments\n Payments.where(is_paid: false)\n \n end", "title": "" }, { "docid": "522e439b2749b6a25b0201f00304d5c0", "score": "0.5862676", "text": "def index\n @pay_periods = PayPeriod.all\n end", "title": "" }, { "docid": "522e439b2749b6a25b0201f00304d5c0", "score": "0.5862676", "text": "def index\n @pay_periods = PayPeriod.all\n end", "title": "" }, { "docid": "0114ab98ee18de93e8437ad8aaa7d8d1", "score": "0.5862404", "text": "def index\n @payments = Payment.order('creation_date DESC').all\n\n if current_login.has_role? :administrator\n @payments = Payment.find_by_sql('select *\nfrom Payments p, (select clinic_id, max(due_date) as d from payments group by clinic_id) s\nwhere p.clinic_id = s.clinic_id and p.due_date = s.d order by payed')\n\n\n \n elsif current_login.has_role? :manager\n logged_user = Manager.first(:conditions => \"login_id = #{current_login.id}\")\n @payments = Payment.in_clinic(logged_user.clinic.id).all\n end\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @payments }\n end\n end", "title": "" }, { "docid": "17b96ff7bba88ab05b86c17d7d0594f9", "score": "0.586184", "text": "def index\n @api_payments = Api::Payment.all\n end", "title": "" }, { "docid": "403994be00045298d16412a1e3285e30", "score": "0.585159", "text": "def index\n if current_user.has_role?(:admin)\n @payments = Payment.all.order(:created_at).reverse_order\n else\n @payments = current_user.profile.payments.order(:created_at).reverse_order\n end\n end", "title": "" }, { "docid": "d3821229b0ef45e3135f24d8229108b0", "score": "0.58487535", "text": "def group_payments\n []\n end", "title": "" }, { "docid": "646a7d7323d27141709c3dc8ed294616", "score": "0.5847322", "text": "def get_payment(payment_id, options = {})\n request_params = {}\n response_xml = http_get(client, \"#{@xero_url}/Payments/#{payment_id}\", request_params)\n parse_response(response_xml, {:request_params => request_params}, {:request_signature => 'GET/payments'})\n end", "title": "" }, { "docid": "b9a669ee734f43ee823d20894cd083be", "score": "0.5835755", "text": "def index\n @payments = []\n end", "title": "" }, { "docid": "78ae12d99b0d0cd7f2402c7930db883a", "score": "0.5827489", "text": "def invoice_payments\n @invoice_payments ||= Harvest::API::InvoicePayments.new(credentials)\n end", "title": "" }, { "docid": "f8bf56333a80096f93de7466f70fadaf", "score": "0.5823804", "text": "def index\n @rent_payments = RentPayment.all\n end", "title": "" }, { "docid": "f8bf56333a80096f93de7466f70fadaf", "score": "0.5823804", "text": "def index\n @rent_payments = RentPayment.all\n end", "title": "" }, { "docid": "b39e94cf51724329e2635b381e9733be", "score": "0.58219975", "text": "def read_claim_payment\r\n read_claim_info.read_service_payments\r\n self\r\n end", "title": "" }, { "docid": "bb2ae69be9f9c98081bb5b20ed4068e2", "score": "0.5816523", "text": "def index\n @payment_requests = PaymentRequest.all\n end", "title": "" }, { "docid": "671650cb187efc9ff88b3cfde96ab5e0", "score": "0.58108664", "text": "def payout_beneficiary(beneficiary)\n add_timestamp\n add_salt\n headers = { 'content-type' => 'application/json',\n 'signature' => signature('', 'get', \"/v1/payouts/beneficiary/#{beneficiary}\"), 'salt' => salt, 'timestamp' => timestamp, 'access_key' => access_key }\n response, msg = rest_client.getCall(\"/v1/payouts/beneficiary/#{beneficiary}\", headers)\n JSON.parse(response)['data'] if response.present?\n rescue StandardError => e\n Rails.logger.error e\n nil\n end", "title": "" }, { "docid": "479c8b4a681dc7fa7d381045f756e5e4", "score": "0.58035827", "text": "def payments(hash={}) \n Loan.all(:funding_line_id => funding_lines.map{|x| x.id}).payments(hash)\n end", "title": "" }, { "docid": "d54de9d0170aa8d0635b32b27e58af4d", "score": "0.5797857", "text": "def list()\n\t\t\tkparams = {}\n\t\t\tclient.queue_service_action_call('householdpaymentmethod', 'list', 'KalturaHouseholdPaymentMethodListResponse', kparams)\n\t\t\tif (client.is_multirequest)\n\t\t\t\treturn nil\n\t\t\tend\n\t\t\treturn client.do_queue()\n\t\tend", "title": "" }, { "docid": "2877af50a913708ab54b1eb4cbdb726e", "score": "0.5797154", "text": "def index\n @payements = Payement.all\n end", "title": "" }, { "docid": "9804b0af1ce41106bbaed8ec43474856", "score": "0.57915664", "text": "def index\n @income_payments = @income.income_payments.all\n end", "title": "" }, { "docid": "24b9da421103d2f63ce0e7c59e209542", "score": "0.57865524", "text": "def index\n @payment_entries = PaymentEntry.all\n end", "title": "" }, { "docid": "27d5a8de2c5a7a6751b124ce8eadd4ff", "score": "0.5779817", "text": "def index\n @mpayments = Mpayment.all\n end", "title": "" }, { "docid": "40067f0edb6a1429ee8d14c6e9aef8eb", "score": "0.57758766", "text": "def index\n @cargapp_payments = CargappPayment.all\n end", "title": "" }, { "docid": "46be9bc9cc6b6c5fa8af014c8b6c030d", "score": "0.5771215", "text": "def index\n @payment_orders = PaymentOrder.all\n end", "title": "" }, { "docid": "cf3fcdea6bc3255491e8acef67f31b64", "score": "0.5769479", "text": "def payment_items\n\t\t\t\t\treturn self.order_items\n\t\t\t\tend", "title": "" }, { "docid": "5815d250737ef39a2dc7db70867fb0ee", "score": "0.57645506", "text": "def index\n @payment_details = PaymentDetail.all\n end", "title": "" }, { "docid": "35d22613178830c4c1ba93d7b2bf116c", "score": "0.574975", "text": "def details\n @payments = @campaign.payments\n end", "title": "" }, { "docid": "b04d50e2d28c6ab435b192b76d76d122", "score": "0.5748803", "text": "def index\n @payments = Payment.search(attach_owner_user_id)\n end", "title": "" }, { "docid": "ab611782915ce4b15d2a9dd6437bfb82", "score": "0.5741447", "text": "def index\n @payment_methods = @user.payment_methods.page(params[:page]).per(params[:per])\n render json: @payment_methods\n end", "title": "" }, { "docid": "86178959931387e3635cdd0464c8a1ee", "score": "0.5738654", "text": "def index\n @payment_records = PaymentRecord.all\n end", "title": "" }, { "docid": "da8026ecdf8b005c9aa21b84fe0d3c5b", "score": "0.57349163", "text": "def index\n @debit_payments = DebitPayment.all\n end", "title": "" }, { "docid": "8419b3b96b3c173f91c34cf594a37cd2", "score": "0.5732245", "text": "def show\n @payment = @user.payments.find(params[:id])\n end", "title": "" }, { "docid": "5bbfb148e3e787ad5c9834614f55e463", "score": "0.5731913", "text": "def index\n @payment_entries = ReceiptEntry.all.where(\"user_id =?\", current_user.id)\n end", "title": "" }, { "docid": "0330085584680ddbd44941bc7e779de4", "score": "0.5719674", "text": "def index\n @sale_payments = SalePayment.all\n end", "title": "" }, { "docid": "7b477fd1be3255fbd4248ea7803365b3", "score": "0.5716662", "text": "def index\n @type_of_payments = TypeOfPayment.all\n end", "title": "" }, { "docid": "bad3b87cc76581c15bf571d1c8b59cfe", "score": "0.57087505", "text": "def index\n @search = Payment.search(params[:q])\n @payments = Payment.all\n end", "title": "" }, { "docid": "ef988887ef7947fbc23ba1f1597e088c", "score": "0.5702969", "text": "def index\n @typepayments = Typepayment.where(user_id: current_user.id)\n end", "title": "" }, { "docid": "7cc20b424442d9f19274626be8108d47", "score": "0.5696613", "text": "def list_payout_entries(payout_id:,\n sort_order: nil,\n cursor: nil,\n limit: nil)\n new_api_call_builder\n .request(new_request_builder(HttpMethodEnum::GET,\n '/v2/payouts/{payout_id}/payout-entries',\n 'default')\n .template_param(new_parameter(payout_id, key: 'payout_id')\n .should_encode(true))\n .query_param(new_parameter(sort_order, key: 'sort_order'))\n .query_param(new_parameter(cursor, key: 'cursor'))\n .query_param(new_parameter(limit, key: 'limit'))\n .header_param(new_parameter('application/json', key: 'accept'))\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": "b5bb3a47dd749362d79bd796045ee466", "score": "0.5692538", "text": "def index\n @pay_records = PayRecord.all\n end", "title": "" }, { "docid": "347ce6ebf4e4257fe8c8b6589b16b222", "score": "0.5690578", "text": "def get_payment(payment_id)\n post_with_auth 'payment_initiation/payment/get',\n PaymentGetResponse,\n payment_id: payment_id\n end", "title": "" }, { "docid": "647f035883708a29d2a6f3da464b754b", "score": "0.569056", "text": "def payment\n Zapi::Models::Payment.new\n end", "title": "" }, { "docid": "1a15ab556e3e5e06a6aa386caa9578ed", "score": "0.56899655", "text": "def test_retrieve_all_payments\n session = figo_session('accounts=rw user=rw payments=rw')\n payments = session.payments\n assert payments.instance_of?(Array)\n end", "title": "" }, { "docid": "07ba4e7c85f5710cb9a165b70746e3d5", "score": "0.56892484", "text": "def index\n @group_payment_items = GroupPaymentItem.all\n end", "title": "" }, { "docid": "4340249d75bafaf3849bb90af7f3a4d9", "score": "0.5688251", "text": "def index\n @payment_plans = PaymentPlan.all\n end", "title": "" }, { "docid": "0d7270bb1b72898efe67eba332ed60eb", "score": "0.56863034", "text": "def index\n @paytm_details = PaytmDetail.all\n end", "title": "" } ]
a215c01435b3845b0fbb351488cb9f33
Creates and returns a PDF::Writer instance
[ { "docid": "51cc31d6296ca16044cce560f64b5cdb", "score": "0.62299323", "text": "def to_pdf_writer(options = {})\n I18n.switch_locale(options[:locale] || Utility.locale_code) do\n # setup\n pdf = PDF::Writer.new(\n :paper => Utility.paper_size,\n :orientation => :portrait\n )\n encoding = {\n :encoding => nil, # \"MacRomanEncoding\", # \"WinAnsiEncoding\", \n :differences => { \n 215 => 'multiply', \n 148 => 'copyright',\n 142 => 'euro'\n } \n } \n pdf.select_font(\"Helvetica\", encoding)\n pdf.font_size = 12 \n pdf.margins_cm(1, 2.5, 1, 1.5) # (top, left = top, bottom = top, right = left)\n\n # header\n pdf.open_object do |header| \n pdf.save_state \n # columns\n pdf.start_columns(2, 20) \n # add logo\n if self.seller.is_a?(Organization)\n begin\n image = pdf.image(\"#{RAILS_ROOT}/#{seller.logo('invoice')}\",\n :resize => 1.00, :justification => :left, :pad => 0)\n rescue\n end\n end\n pdf.start_new_page # will start new column \n\n # senders's address\n fl = 0\n if self.origin_address\n pdf_bracket(pdf, pdf.left_margin - 10, pdf.y, pdf.column_width + 10, 120)\n\n if self.origin_address && self.origin_address.company_name\n pdf.text(\"<b>#{e(self.origin_address.company_name)}</b>\",\n :justification => :left ) and fl += 1\n end\n\n pdf.text(e(self.origin_address.name.to_s),\n :justification => :left) and fl += 1 if self.origin_address && self.origin_address.name\n\n pdf.text(e(self.origin_address.address_line_1.to_s),\n :justification => :left) and fl += 1 if self.origin_address && self.origin_address.address_line_1\n \n pdf.text(e(self.origin_address.address_line_2).to_s,\n :justification => :left) and fl += 1 unless self.origin_address.address_line_2.blank?\n \n pdf.text(e(self.origin_address.city_postal_and_province), :justification => :left)\n\n pdf.text(e(self.origin_address.country_or_country_code.to_s), :justification => :left)\n pdf.text( \"\\n\", :justification => :left )\n \n pdf.text(e(self.origin_address.phone.blank? ? \"\" : \"Phone:\".t + ' ' + self.origin_address.phone),\n :justification => :left )\n \n pdf.text(e(self.origin_address.fax.blank? ? \"\" : \"Fax:\".t + ' ' + self.origin_address.fax),\n :justification => :left )\n pdf.text(\"\\n\" * fl)\n end\n pdf.stop_columns\n\n # space\n pdf.text( \"\\n\\n\\n\" )\n\n # columns\n pdf.start_columns(2, 20) # columns=2, gutter=20\n pdf_bracket(pdf, pdf.left_margin - 10, pdf.y, pdf.column_width + 10, 110)\n\n # billing address\n if self.billing_address\n fl = 0\n pdf.text(e(self.billing_address.company_name),\n :justification => :left ) and fl += 1 unless self.billing_address.company_name.blank?\n\n pdf.text(e(self.billing_address.salutation_t.to_s),\n :justification => :left ) and fl += 1 unless String(self.billing_address.salutation_t).empty?\n\n pdf.text(e(self.billing_address.name.to_s), :justification => :left)\n\n pdf.text(e(self.billing_address.address_line_1.to_s), :justification => :left)\n\n pdf.text(e(self.billing_address.address_line_2.to_s),\n :justification => :left ) and fl += 1 unless self.billing_address.address_line_2.blank?\n \n pdf.text(e(self.billing_address.city_postal_and_province.to_s), :justification => :left)\n pdf.text(e(self.billing_address.country_or_country_code.to_s), :justification => :left )\n\n pdf.text(\"\\n\" * fl)\n end\n pdf.start_new_page # will start new column\n\n # ID, Date\n pdf.text(\"<b>#{e(self.kind_t.titleize)}:</b> #{self.short_number.to_s}\", :justification => :left)\n pdf.text(\"<b>#{e(\"Seller\".t ) }:</b> #{e(self.seller.is_a?(Organization) ? self.seller.name.to_s : self.seller.name.to_s)}\",\n :justification => :left)\n pdf.text(\"<b>#{e(\"Buyer\".t) }:</b> #{e(self.buyer.name.to_s)}\", :justification => :left)\n pdf.text(\"\\n\" )\n pdf.text(\"#{e((self.created_at || Time.now.utc).to_date.to_s(:long))}\", :justification => :left)\n\n pdf.stop_columns # stops column mode\n pdf.restore_state \n pdf.close_object \n pdf.add_object(header, :all_pages) # :this_page / :all_pages / etc.\n end\n\n # Invoice / Credit Note\n pdf.text(\"\\n\\n\\n<b>#{e(self.kind_t.titleize)}</b>\\n\\n\", :font_size => 18)\n\n # Table\n PDF::SimpleTable.new do |table|\n table.column_order.push(*%w(description sku net_price))\n header = {:description => e(\"Item\".t), :sku => e(\"Number\".t), :net_price => e(\"Net Price\".t)}\n \n table.columns['description'] = PDF::SimpleTable::Column.new('description') {|col|\n col.heading = PDF::SimpleTable::Column::Heading.new(\"<b>#{header[:description]}</b>\") {|head|\n head.justification = :left\n }\n }\n table.columns['sku'] = PDF::SimpleTable::Column.new('sku') {|col|\n col.heading = PDF::SimpleTable::Column::Heading.new(\"<b>#{ header[:sku] }</b>\") {|head|\n head.justification = :center\n }\n col.justification = :left\n }\n table.columns['net_price'] = PDF::SimpleTable::Column.new('net_price') {|col|\n col.heading = PDF::SimpleTable::Column::Heading.new(\n \"<b>#{ header[:net_price] } (#{self.net_total.currency})</b>\"\n ) { |head|\n head.justification = :center\n }\n col.justification = :right\n col.width = pdf.text_width(\"<b>#{header[:net_price] }</b>\")\n }\n\n table.maximum_width = pdf.margin_width\n table.font_size = 12\n table.show_lines = :none\n table.show_headings = true\n table.shade_headings = false\n table.shade_rows = :none\n table.orientation = :center\n table.position = :center\n\n data = []\n self.line_items.each do |item|\n data.push( {\n 'description' => \"<b>#{e(item.sellable.name)}</b>, #{e(truncate(item.sellable.description, :length => 100))}\",\n 'sku' => item.sellable.item_number,\n 'net_price' => item.amount.format(:strip_symbol => true)\n } )\n end\n table.data.replace data\n table.render_on(pdf)\n end\n \n # Space\n pdf.text( \"\\n\" )\n \n # disclaimer\n disclaimer = []\n if self.sales_invoice?\n disclaimer << \"Your %{payment_type} was credited with a total amount of %{amount}\".t % {\n :payment_type => payment_type_t,\n :amount => self.total.format(:currency_symbol => self.total.currency)\n }\n elsif self.purchase_invoice?\n disclaimer << \"Your %{payment_type} was charged with a total amount of %{amount}\".t % {\n :payment_type => payment_type_t,\n :amount => self.total.format(:currency_symbol => self.total.currency)\n }\n end\n disclaimer << \"For any remaining questions regarding this statement, please don't hesitate to consult %{url}\".t % {\n :url => service_url\n } if self.seller.is_a?(Organization) && service_url\n pdf.text(disclaimer.to_sentences, :font_size => 8) unless disclaimer.empty?\n\n # Put a footing on all pages.\n pdf.move_pointer( pdf.y - pdf.absolute_bottom_margin - 125 )\n pdf.open_object do |footer|\n pdf.save_state\n\n # pdf.move_pointer = pdf.bottom_margin - 100\n\n # columns\n pdf.start_columns(2, 20) \n # total column\n pdf.start_new_page # will start new column \n pdf_bracket( pdf, pdf.left_margin - 5, pdf.y, pdf.column_width + 5, 60 )\n # total table\n PDF::SimpleTable.new do |table|\n table.column_order.push(*%w(description total))\n table.columns['description'] = PDF::SimpleTable::Column.new('description') { |col|\n col.justification = :right\n }\n table.columns['total'] = PDF::SimpleTable::Column.new('totals') { |col|\n col.justification = :right\n }\n\n table.maximum_width = pdf.column_width\n table.font_size = 12\n table.show_lines = :none\n table.show_headings = false\n table.shade_headings = false\n table.shade_rows = :none\n table.orientation = :left\n table.position = :right\n table.heading_color = Color::RGB::Black\n\n data = [{\n 'description' => \"#{e(\"Net Total\".t)} (#{self.net_total.currency})\",\n 'total' => self.net_total.format(:strip_symbol => true)\n }, {\n 'description' => \"#{e(self.tax_rate.loc + '% ' + \"Tax\".t)} (#{self.tax_total.currency})\",\n 'total' => self.tax_total.format(:strip_symbol => true)\n }, {\n 'description' => \"<b>#{e( \"Gross Total\".t)} (#{self.gross_total.currency})</b>\",\n 'total' => \"<b>#{self.gross_total.format(:strip_symbol => true)}</b>\"\n }]\n table.data.replace data\n table.render_on(pdf)\n end\n pdf.stop_columns # stops column mode\n \n pdf.text(\"\\n\\n\", :font_size => 10)\n \n # footer info\n pdf.fill_color(Color::RGB::Grey)\n pdf.start_columns(3, 10)\n\n # seller's info\n pdf.text(\"<b>#{e(self.seller.name)}</b>\", :font_size => 8)\n\n pdf.text(\"#{e(self.seller.is_a?(Organization) && self.seller.respond_to?(:tagline) ? self.seller.tagline.to_s : '')}\",\n :font_size => 8)\n\n pdf.text(\"#{e(self.seller.is_a?(Organization) && self.seller.respond_to?(:site_url) ? self.seller.site_url.to_s: '')}\",\n :font_size => 8 )\n \n pdf.text( \"\\n\", :font_size => 8 )\n\n pdf.text(e(%(#{\"Tax Code\".t}: #{self.seller.tax_code})), :font_size => 8)\n \n pdf.start_new_page # will start new column \n \n # directions\n pdf.text(e(self.origin_address.address_line_1), :font_size => 8)\n pdf.text(e(self.origin_address.address_line_2), :font_size => 8 ) unless self.origin_address.address_line_2.blank?\n pdf.text(e(self.origin_address.city_postal_and_province), :font_size => 8)\n pdf.text(e(self.origin_address.country_or_country_code), :font_size => 8 )\n pdf.start_new_page # will start new column \n\n # Phone and Email\n pdf.text(e(\"Support\".t), :font_size => 8)\n pdf.text(e(self.seller.is_a?(Organization) ? service_url : ''), :font_size => 8) if service_url\n pdf.text(e(self.origin_address.phone.blank? ? \"\" : \"Phone\".t + ' ' + self.origin_address.phone.to_s), :font_size => 8)\n pdf.text(e(self.origin_address.fax.blank? ? \"\" : \"Fax\".t + ' ' + self.origin_address.fax.to_s), :font_size => 8)\n pdf.stop_columns\n \n pdf.restore_state\n pdf.close_object\n pdf.add_object(footer, :all_pages)\n end\n\n pdf\n end\n end", "title": "" } ]
[ { "docid": "738a5166f83c90a7fdda6cba9ddfa973", "score": "0.74901146", "text": "def create_pdf\n File.open(@path, 'wb') do |file|\n file << rendered_pdf\n end\n end", "title": "" }, { "docid": "26c28bc7e3c2eca4c6e1a6cd7860149d", "score": "0.74662495", "text": "def create_from_writer(writer_opts = {})\n activate_pdf\n writer = PDF::Writer.new(writer_opts) do |pdf|\n yield(pdf)\n end\n filename = File.join(Dir.tmpdir, \"#{rand 10E16}.pdf\")\n writer.save_as(filename)\n self.create_from_file('', filename, true) # set to delete tempfile on create\n self\n end", "title": "" }, { "docid": "94bacd23ab28f279bd0b29a97bb3e6c6", "score": "0.68535256", "text": "def make_pdf(options = {}, main_body)\n w = Wkhtmltopdf.new(WickedPdf.config, options[:wkhtmltopdf])\n @content = w.pdf_from_string(main_body, options)\n end", "title": "" }, { "docid": "a41afc43f48a93e584aae669b98cf4ec", "score": "0.6787268", "text": "def to_pdf(options={})\n self.to_pdf_writer(options).render\n end", "title": "" }, { "docid": "091cf824809d3a5f4b41b920385f2610", "score": "0.66557646", "text": "def make_pdf(template_path, pdf_name, landscape=false)\n prince = Prince.new()\n # Sets style sheets on PDF renderer.\n prince.add_style_sheets(\n \"#{RAILS_ROOT}/public/stylesheets/main.css\",\n \"#{RAILS_ROOT}/public/stylesheets/bracket.css\",\n \"#{RAILS_ROOT}/public/stylesheets/bracket-print.css\",\n \"#{RAILS_ROOT}/public/stylesheets/prince.css\"\n )\n prince.add_style_sheets(\"#{RAILS_ROOT}/public/stylesheets/prince_landscape.css\") if landscape\n # Render the estimate to a big html string.\n # Set RAILS_ASSET_ID to blank string or rails appends some time after\n # to prevent file caching, fucking up local - disk requests.\n old_rails_asset_id = ENV[\"RAILS_ASSET_ID\"]\n begin\n ENV[\"RAILS_ASSET_ID\"] = ''\n html_string = render_to_string(:template => template_path, :layout => 'print.html')\n # Make all paths relative, on disk paths...\n html_string.gsub!(\"src=\\\"\", \"src=\\\"#{RAILS_ROOT}/public\")\n # Send the generated PDF file from our html string.\n return prince.pdf_from_string(html_string)\n ensure\n ENV[\"RAILS_ASSET_ID\"] = old_rails_asset_id\n end\n end", "title": "" }, { "docid": "13d101d70ea7cc06c61f858066bb5248", "score": "0.6643511", "text": "def to_pdf_file\n Dir.mktmpdir(ident) do |output_directory|\n string = self.string\n pdf_path = File.join(output_directory, ident + '.pdf')\n Prawn::Document.generate(pdf_path) do\n font_families.update 'ComicSans' => {normal: Rails.root.join('vendor', 'assets', 'fonts', 'ComicSans.ttf').to_s}\n font('ComicSans') { text string }\n end\n yield pdf_path\n end\n end", "title": "" }, { "docid": "c44294b0bb936f5625755eac8f4cd42f", "score": "0.65577924", "text": "def to_pdf\n to_prawn.render\n end", "title": "" }, { "docid": "9a284fb7513efe8e27444532734ad785", "score": "0.6523355", "text": "def build_pdf_file(path)\n controller_name = controller.underscore.gsub('/', '-')\n tempfile = Tempfile.new([\"export-#{controller_name}\", '.pdf'], Rails.root.join('tmp'))\n tempfile.binmode\n tempfile.write pdf_from_html_file(path)\n tempfile.close\n\n save_html_export path if Rails.env.development?\n self.file = File.open(tempfile.path)\n self.file_content_type = 'application/pdf'\n end", "title": "" }, { "docid": "021cbd7711490cd5ed54e48249fdfc92", "score": "0.6470863", "text": "def to_pdf_file\n to_tex_file do |tex_path|\n Dir.mktmpdir(ident) do |output_directory|\n system pdftex, *PDFTEX_OPTIONS, \"--output-directory=#{output_directory}\", tex_path\n pdf_path = File.join(output_directory, ident + '.pdf')\n raise PDFConversionFailed, self unless File.exist?(pdf_path)\n\n yield pdf_path\n File.unlink pdf_path\n end\n end\n end", "title": "" }, { "docid": "c60a4ed86acd39c4df7aef87c52de404", "score": "0.6467813", "text": "def to_pdf\n\t\trequire 'erb'\n\t\trequire 'fileutils'\n @self = self\n template = ERB.new(LatexTemplate.where(model: self.class.to_s).first.template)\n directory = \"#{Rails.root}/tmp/pdf/#{self.class.to_s}/\"\n\t\tif not File.directory? directory\n\t\t\tFileUtils.mkpath(directory)\n\t\tend\n\t\tfile = \"#{directory}/#{self.id}.tex\"\n\t\tFile.open(file, 'w') do |f|\n # TODO: this is a potential security hole. But as we trust the user anyways, we don't give too much of a sh***\n\t\t\tf.write(template.result(binding))\n\t\tend\n\t\tIO.popen(\"pdflatex -output-directory #{directory} #{file}\") do |handle|\n\t\t\tpdflatex_output = handle.read\n\t\tend\n\t\tif $? == 0\n\t\t\treturn File.read(\"#{directory}/#{self.id}.pdf\")\n\t\telse\n\t\t\tlogger.error(pdflatex_output)\n return nil\n\t\tend\n end", "title": "" }, { "docid": "c4f411f24c05ed9a49a5beadd92f2830", "score": "0.64089626", "text": "def to_pdf\n begin \n fo = StringIO.new(to_fo).to_inputstream\n fopfac = FopFactory.newInstance\n fopfac.setBaseURL( File.join(ASUtils.find_base_directory, 'stylesheets') ) \n fop = fopfac.newFop(MimeConstants::MIME_PDF, @output.to_outputstream) \n transformer = TransformerFactory.newInstance.newTransformer()\n res = SAXResult.new(fop.getDefaultHandler)\n transformer.transform(StreamSource.new(fo), res)\n ensure\n @output.close\n end\n @output \n end", "title": "" }, { "docid": "f64d0887c38d827658009dd4c692de35", "score": "0.63776094", "text": "def make_and_send_pdf(template_path, pdf_name, landscape=false)\n send_data(\n make_pdf(template_path, pdf_name, landscape),\n :filename => pdf_name,\n :type => 'application/pdf'\n ) \n end", "title": "" }, { "docid": "1c9e7266f62f5991d718b26b05681746", "score": "0.6361476", "text": "def make_pdf(opts = {})\r\n @pdf = true\r\n @debug_pdf = params[:debug_pdf]\r\n params[:format] = 'html'\r\n html = render_to_string(:action => \"#{opts.delete(:action) || params[:action]}.html.erb\", :layout => (opts.delete(:layout) || 'pdf')) # layout not taken\r\n if !@debug_pdf\r\n html.gsub!(/\\/images\\//, Rails.root.join('public', 'images/').to_s)\r\n else\r\n render(:text => html, :layout => false) and return\r\n end\r\n kit = PDFKit.new(html, opts.merge(:encoding => 'UTF-8'))\r\n kit.stylesheets << Rails.root.join('public', 'stylesheets', 'pdf.css')\r\n return kit.to_pdf\r\n end", "title": "" }, { "docid": "261ca5bf419f2eb3d0fc9a7249930f03", "score": "0.6329722", "text": "def generate_pdf \n pdf = ParkirPdf.new(@billing)\n pdf.render\n end", "title": "" }, { "docid": "a708d8fd5cd3e1c877b03537fca2c3dd", "score": "0.63085836", "text": "def create_pdf(width, height)\n doc = HexaPDF::Document.new\n page = doc.pages.add\n page[:MediaBox] = [0, 0, width, height]\n page.canvas.draw(self, x: width / 2.0, y: height / 2.0)\n doc\n end", "title": "" }, { "docid": "eb811492b4f74b08fb38e0a4634f30a8", "score": "0.62416744", "text": "def to_pdf_data; end", "title": "" }, { "docid": "5d3c1c0ec0ae3a579c985e89fa428aa6", "score": "0.6225064", "text": "def generate_pdf\n output_path ||= CurationConcerns::DerivativePath.derivative_path_for_reference(curation_concern, 'pdf')\n output_file_dir = File.dirname(output_path)\n FileUtils.mkdir_p(output_file_dir) unless File.directory?(output_file_dir)\n curation_concern.render_pdf(output_path)\n end", "title": "" }, { "docid": "7877f40468c7ecdbac0e4e6abb4ee782", "score": "0.6198536", "text": "def to_pdf\n to_html\n end", "title": "" }, { "docid": "12ed74fc69d98aa2d9d953cb538d3838", "score": "0.61968666", "text": "def create\n\n #Creates the appropriate pdf according to the pdf_id supplied\n pdf = Pdf.create_pdf(@pdf_id, @client, @settings)\n\n disposition = false\n if @inline == \"true\"\n disposition = \"inline\"\n end\n respond_to do |format|\n format.pdf do\n send_data pdf.render,\n filename: Pdf.get_pdf_file_name(Pdf::PDFS.keys[@pdf_id.to_i], @client),\n disposition: disposition\n end\n end\n end", "title": "" }, { "docid": "87d693bcbbea041b81a98e4e93dfea9d", "score": "0.6060835", "text": "def generate_pdf(input)\n create_debug_output(input) if options[:debug]\n check_for_tex_presence!\n create_pdf(input)\n end", "title": "" }, { "docid": "275b994c5bf23f3279859b1580a45e7c", "score": "0.6006515", "text": "def generate\n add_intro\n add_blood_pressure_intro\n add_blood_pressure_list\n add_blood_pressure_outro\n add_medications_intro\n add_medications_list\n add_about\n\n @pdf\n end", "title": "" }, { "docid": "feff2a7cb839f0184698907e7a922344", "score": "0.6005788", "text": "def generate_pdf\n\t\t\n\t\tfile_name = get_pdf_file_name\n\n\t\tac = ActionController::Base.new\n\n\t\tpdf = ac.render_to_string pdf: file_name,\n\t template: \"#{ Auth::OmniAuth::Path.pathify(self.class.name).pluralize}/pdf/show.pdf.erb\",\n\t locals: {:receipt => self, :organization => self.payable_to_organization},\n\t layout: \"pdf/application.html.erb\",\n \tquiet: true,\n\t header: {\n\t \thtml: {\n\t \t\ttemplate:'/layouts/pdf/receipt_header.pdf.erb',\n\t \t\tlayout: \"pdf/application.html.erb\",\n\t \t\tlocals: {:receipt => self, :organization => self.payable_to_organization}\n\t \t}\n\t },\n\t footer: {\n\t \t\thtml: { \n\t \t\t\ttemplate:'/layouts/pdf/receipt_footer.pdf.erb',\n\t \t\t\tlayout: \"pdf/application.html.erb\",\n\t \t\tlocals: {:receipt => self, :organization => self.payable_to_organization}\n\t }\n\t } \n\n #save_path = Rails.root.join('public',\"#{file_name}.pdf\")\n\t\t#File.open(save_path, 'wb') do |file|\n\t\t# file << pdf\n\t\t# self.pdf_urls = [save_path]\n\t\t# self.pdf_url = save_path\n\t\t#end\n\t\tTempfile.open(file_name) do |f| \n\t\t f.binmode\n\t\t f.write pdf\n\t\t f.close \n\t\t #IO.write(\"#{Rails.root.join(\"public\",\"test.pdf\")}\",pdf)\n\t\t response = Cloudinary::Uploader.upload(File.open(f.path), :public_id => file_name, :upload_preset => \"report_pdf_files\")\n\t\t puts \"response is: #{response}\"\n\t\t self.latest_version = response['version'].to_s\n\t\t self.pdf_url = response[\"secure_url\"]\n\t\tend\n\t\tself.skip_pdf_generation = true\n\t\t\n\t\tafter_generate_pdf\n\n\tend", "title": "" }, { "docid": "1908c178bad4a271b7a0feeb4e69e775", "score": "0.60030717", "text": "def send_or_create_pdf(template)\n file_path = pdf_file_path(template)\n\n unless File.exist?(file_path)\n File.open(file_path, \"wb\") { |f| f.puts render_pdf(template) }\n end\n\n IO.binread(file_path)\n end", "title": "" }, { "docid": "77389926bfcf181483a3868246cfa597", "score": "0.599981", "text": "def pdfmaker_makePdf(pdf_tmp_html, filecontents, cssfile, jsfile, testing_value, watermark_css, logkey='')\n\toutput = Bkmkr::Tools.makepdf(Bkmkr::Tools.pdfprocessor, Metadata.pisbn, pdf_tmp_html, filecontents, cssfile, jsfile, testing_value, watermark_css, Bkmkr::Keys.http_username, Bkmkr::Keys.http_password)\n logstring = output\nrescue => logstring\nensure\n Mcmlln::Tools.logtoJson(@log_hash, logkey, logstring)\nend", "title": "" }, { "docid": "f2abe061d367d1f1b7108115c7d5a5bd", "score": "0.59875065", "text": "def formatter\n @formatter ||= PdfFormatter.new\n end", "title": "" }, { "docid": "ce3a1101d705499665291db5e0a2461d", "score": "0.5979472", "text": "def render_pdf\n Payday::PdfRenderer.render(self)\n end", "title": "" }, { "docid": "97e10e1055abd598a777e7c69394e881", "score": "0.5979301", "text": "def to_pdf(options = {})\n # reset version if not specified\n @version = 1.5 if @version.to_f == 0.0\n # set info for merged file\n @info[:ModDate] = @info[:CreationDate] = Time.now.strftime \"D:%Y%m%d%H%M%S%:::z'00\"\n @info[:Subject] = options[:subject] if options[:subject]\n @info[:Producer] = options[:producer] if options[:producer]\n # rebuild_catalog\n catalog = rebuild_catalog_and_objects\n # add ID and generation numbers to objects\n renumber_object_ids\n\n out = []\n xref = []\n indirect_object_count = 1 # the first object is the null object\n # write head (version and binanry-code)\n out << \"%PDF-#{@version}\\n%\\xFF\\xFF\\xFF\\xFF\\xFF\\x00\\x00\\x00\\x00\".force_encoding(Encoding::ASCII_8BIT)\n\n # collect objects and set xref table locations\n loc = 0\n out.each { |line| loc += line.bytesize + 1 }\n @objects.each do |o|\n indirect_object_count += 1\n xref << loc\n out << object_to_pdf(o)\n loc += out.last.bytesize + 1\n end\n xref_location = loc\n # xref_location = 0\n # out.each { |line| xref_location += line.bytesize + 1}\n out << \"xref\\n0 #{indirect_object_count}\\n0000000000 65535 f \\n\"\n xref.each { |offset| out << (out.pop + (\"%010d 00000 n \\n\" % offset)) }\n out << out.pop + 'trailer'\n out << \"<<\\n/Root #{false || \"#{catalog[:indirect_reference_id]} #{catalog[:indirect_generation_number]} R\"}\"\n out << \"/Size #{indirect_object_count}\"\n out << \"/Info #{@info[:indirect_reference_id]} #{@info[:indirect_generation_number]} R\"\n out << \">>\\nstartxref\\n#{xref_location}\\n%%EOF\"\n # when finished, remove the numbering system and keep only pointers\n remove_old_ids\n # output the pdf stream\n out.join(\"\\n\".force_encoding(Encoding::ASCII_8BIT)).force_encoding(Encoding::ASCII_8BIT)\n end", "title": "" }, { "docid": "12e568f82cd20212dad7e74ee95f43af", "score": "0.59680593", "text": "def to_pdf(path = nil)\n @outfile = File.expand_path(path) if path\n run\n @outfile\n end", "title": "" }, { "docid": "2d200553d1e48d0137627d825543626c", "score": "0.59445703", "text": "def to_pdf_file(file_name=self.default_pdf_file_name, options={})\n self.to_pdf_writer(options).save_as(file_name)\n end", "title": "" }, { "docid": "7b93918496276b69c8c7b5aa7fbf5fe7", "score": "0.5931088", "text": "def save_pdf\n assert_equal 'application/pdf', response.media_type\n filename = \"#{self.class.name.underscore}__#{method_name}.pdf\"\n File.open(File.join($redmine_tmp_pdf_directory, filename), \"wb\") do |f|\n f.write response.body\n end\n end", "title": "" }, { "docid": "53a7d1c6edec80b267528d9e0f6f5622", "score": "0.59285545", "text": "def generate_pdf_data\n pages = 0\n\n # Render the PDF data to string\n pdf_data = WickedPdf.new.pdf_from_string(\n ResumeRenderer.new(self).render_theme(self.current_theme, layout: 'pdf_page'),\n {\n disable_external_links: true,\n disable_internal_links: true,\n print_media_type: true,\n outline: { outline: true }\n }\n )\n\n # Extract the PDF metadata\n meta_dump = nil\n IO.popen(\"#{ENV['PDFTK_BIN']} - dump_data_utf8 output -\", \"w+\") do |pipe|\n pipe.write pdf_data\n pipe.close_write\n meta_dump = pipe.read\n end\n\n # Mutate some PDF metadata values\n # meta_dump.gsub!(/^InfoBegin\\nInfoKey:\\ Creator\\nInfoValue:\\ .+\\n/, \"InfoBegin\\nInfoKey: Creator\\nInfoValue: JibJob PDF Renderer\\n\")\n # meta_dump.gsub!(/^InfoBegin\\nInfoKey:\\ Producer\\nInfoValue:\\ .+\\n/, \"InfoBegin\\nInfoKey: Producer\\nInfoValue: https://jibjob.co\\n\")\n\n # # Inject updated PDF metadata back\n # begin\n # dump_tmpfile = Tempfile.new(\"jibjob-resume-#{self.id}\")\n # dump_tmpfile.write(meta_dump)\n # dump_tmpfile.rewind\n # IO.popen(\"#{ENV['PDFTK_BIN']} - update_info_utf8 #{dump_tmpfile.path} output - uncompress\", \"w+\") do |pipe|\n # pipe.write pdf_data\n # pipe.close_write\n # pdf_data = pipe.read\n # end\n # ensure\n # dump_tmpfile.close\n # dump_tmpfile.unlink\n # end\n\n # Fetch some PDF metadata values\n pages = meta_dump.match(/^NumberOfPages:\\ (\\d+)\\n/)[1].to_i\n\n # Return PDF data wrapper\n { content: pdf_data,\n pages: pages\n }\n end", "title": "" }, { "docid": "accdfae2ed7a136ed14d794a6dac9c8e", "score": "0.5923968", "text": "def create_pdf\n @new_businessdocument = @businessdocument.create_pdf\n redirect_to billing_businessdocument_path(@new_businessdocument), notice: t(:pdf_generation_started)\n end", "title": "" }, { "docid": "65c74559a291e44c807b691c14b6ac73", "score": "0.59224", "text": "def pdf(html)\n WickedPdf.new.pdf_from_string(html,\n margin: {:top => 0, :bottom => 0, :left => 0, :right => 0})\n end", "title": "" }, { "docid": "371b90dfed0a30f5fc5ada9fe06c3b57", "score": "0.59165907", "text": "def write!\n puts \"\\nOutputting file...\"\n verify_file_path(report_filename)\n if File.open(report_filename, \"wb\") { |f| f.write @pdf.render }\n return report_filename\n else\n raise \"ERROR\"\n nil\n end\n end", "title": "" }, { "docid": "c1c4907812163b39c9686777edabd46b", "score": "0.59090745", "text": "def to_pdf\n template = ERB.new(PDF_TEMPLATE, 0, '%')\n Iconv.conv(PDF_ENCODING, @properties['encoding'],\n template.result(binding))\n end", "title": "" }, { "docid": "261121ce9ac71615bf964989c5702afa", "score": "0.58517927", "text": "def create\n @pdf = Pdf.new(params[:pdf])\n\n respond_to do |format|\n if @pdf.save\n format.html { redirect_to @pdf, notice: 'Pdf was successfully created.' }\n format.json { render json: @pdf, status: :created, location: @pdf }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pdf.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6bbc6032f12bdf17c31b2d196b0b6450", "score": "0.58396196", "text": "def generate_pdf(report_data)\n Prawn::Document.new do\n text report_data\n end.render\n end", "title": "" }, { "docid": "f7d6219790ced6ccfca456c4140d2e63", "score": "0.583228", "text": "def generate_pdf\n\t\t\t\n\n\t\tfile_name = get_file_name\n\t\tfile_name = \"test\"\n\t \n\t ac = ActionController::Base.new\n\t \n\t pdf = ac.render_to_string pdf: file_name,\n template: \"#{ Auth::OmniAuth::Path.pathify(self.class.name).pluralize}/pdf/show.pdf.erb\",\n locals: {:object => self},\n layout: \"pdf/application.html.erb\",\n quiet: true,\n header: {\n \thtml: {\n \t\ttemplate:'/layouts/pdf/header.html.erb',\n \t\tlayout: '/layouts/pdf/empty_layout.html.erb',\n \t\tlocals: {:object => self}\n \t}\n },\n footer: {\n \t\thtml: { \n \t\t\ttemplate:'/layouts/pdf/footer.html.erb',\n \t\t\tlayout: '/layouts/pdf/empty_layout.html.erb',\n \t\tlocals: {:object => self}\n }\n } \n\n save_path = Rails.root.join('public',\"#{file_name}.pdf\")\n\t\tFile.open(save_path, 'wb') do |file|\n\t\t file << pdf\n\t\tend\n\n\t Tempfile.open(file_name) do |f| \n\t\t f.binmode\n\t\t f.write pdf\n\t\t f.close \n\t\t #IO.write(\"#{Rails.root.join(\"public\",\"test.pdf\")}\",pdf)\n\t\t response = Cloudinary::Uploader.upload(File.open(f.path), :public_id => file_name, :upload_preset => \"report_pdf_files\")\n\t\t puts \"response is-------------------------------------------------------------->: #{response}\"\n\t\t self.latest_version = response['version'].to_s\n\t\t self.pdf_url = response[\"url\"]\n\t\tend\n\n\t\tself.skip_pdf_generation = true\n\t\t\n\t\t#self.save\t\t\n\t\tafter_generate_pdf\n\n\tend", "title": "" }, { "docid": "67ac38281db56a4f377abc31ded84353", "score": "0.58213216", "text": "def new_page(mediabox = [0, 0, 612.0, 792.0], _location = -1)\n p = PDFWriter.new(mediabox)\n insert(-1, p)\n p\n end", "title": "" }, { "docid": "475289ed4e2c3b81d0ef4f02229fcae6", "score": "0.58165675", "text": "def build_and_save_pdf(path)\n message = 'Construction du fichier pdf'\n message_box = Qt::MessageBox.new(Qt::MessageBox::Warning, 'ATTENDEZ', message)\n message_box.setWindowIcon(Icons.from_file('Board-11-Flowers-icon.png'))\n message_box.standard_buttons = nil\n message_box.informative_text = 'Patientez ...'\n message_box.show\n console_message message\n ret = @report.to_pdf_file(path)\n message_box.accept\n ret\n end", "title": "" }, { "docid": "c07f9b098bc3eabb7dbb1a8af81a41fd", "score": "0.57818776", "text": "def generate_event_pdf\n event = Event.find(params[:id])\n pdf = PDF::Writer.new()\n pdf.image \"public/images/about-neova.jpg\"\n pdf.select_font \"Courier\"\n pdf.margins_pt(36)\n pdf.text \"CERTIFICATE OF ATTENDANCE\", :font_size => 32,:justification => :center,:spacing => 2\n pdf.text \"This is to certify that\", :font_size => 15, :justification => :center,:spacing => 3\n pdf.text \"#{current_user.full_name}\", :font_size =>25,:justification => :center,:spacing => 2\n pdf.text \"attended the event\", :font_size =>15,:justification => :center,:spacing => 2\n pdf.text \"#{event.name}\", :font_size =>25,:justification => :center,:spacing => 2\n pdf.text \"held on #{event.starts_on}\",:font_size => 15,:justification => :center,:spacing => 2\n respond_to do |format|\n format.pdf do\n send_data pdf.render, :filename => 'event.pdf', :type => 'application/pdf', :disposition => 'attachment'\n end\n end\n #pdf.save_as(\"public/event_certificate_user#{current_user.id}_event#{event.id}.pdf\")\n #send_file \"public/event_certificate_user#{current_user.id}_event#{event.id}.pdf\", :type => 'application/pdf'\n end", "title": "" }, { "docid": "facc73420ecf1bbfc614f0b49bbb6f63", "score": "0.57790756", "text": "def initialize(options = {})\n paper = options[:paper] || \"LETTER\"\n orientation = options[:orientation] || :portrait\n version = options[:version] || PDF_VERSION_13\n\n @mutex = Mutex.new\n @current_id = @current_font_id = 0\n\n # Start the document\n @objects = []\n @callbacks = []\n @font_families = {}\n @fonts = {}\n @stack = []\n @state_stack = StateStack.new\n @loose_objects = []\n @current_text_state = \"\"\n @options = {}\n @destinations = {}\n @add_loose_objects = {}\n @images = []\n @word_space_adjust = nil\n @current_stroke_style = PDF::Writer::StrokeStyle.new(1)\n @page_numbering = nil\n @arc4 = nil\n @encryption = nil\n @file_identifier = nil\n\n @columns = {}\n @columns_on = false\n @insert_mode = nil\n\n @catalog = PDF::Writer::Object::Catalog.new(self)\n @outlines = PDF::Writer::Object::Outlines.new(self)\n @pages = PDF::Writer::Object::Pages.new(self)\n\n @current_node\t= @pages\n @procset = PDF::Writer::Object::Procset.new(self)\n @info = PDF::Writer::Object::Info.new(self)\n @page = PDF::Writer::Object::Page.new(self)\n @current_text_render_style = 0\n @first_page = @page\n\n @version = version\n\n # Initialize the default font families.\n init_font_families\n\n @font_size = 10\n @pageset = [@pages.first_page]\n\n if paper.kind_of?(Array)\n if paper.size == 4\n size = paper # Coordinate Array\n else\n size = [0, 0, PDF::Writer.cm2pts(paper[0]), PDF::Writer.cm2pts(paper[1])]\n # Paper size in centimeters has been passed\n end\n else\n size = PAGE_SIZES[paper.upcase].dup\n end\n size[3], size[2] = size[2], size[3] if orientation == :landscape\n\n @pages.media_box = size\n\n @page_width = size[2] - size[0]\n @page_height = size[3] - size[1]\n @y = @page_height\n\n # Also set the margins to some reasonable defaults -- 1.27 cm, 36pt,\n # or 0.5 inches.\n margins_pt(36)\n\n # Set the current writing position to the top of the first page\n @y = absolute_top_margin\n # Get the ID of the page that was created during the instantiation\n # process.\n\n fill_color! Color::RGB::Black\n stroke_color! Color::RGB::Black\n\n yield self if block_given?\n end", "title": "" }, { "docid": "0566bf1bb95d6c100e872e526eb551b7", "score": "0.577295", "text": "def pdfout(content, file: 'output.pdf', width: 7, height: 7)\n \"\"\"\n pdf('#{file}', width=#{width}, height=#{height})\n #{content}\n dev.off()\n \"\"\"\nend", "title": "" }, { "docid": "6aab24e2e69c1e69b5624a7f6692ab4c", "score": "0.57694376", "text": "def to_file(path = nil)\n to_pdf(path)\n File.new(@outfile)\n end", "title": "" }, { "docid": "54788abbe71959b93cb7c5d589ca0031", "score": "0.5769393", "text": "def build_pdf_rendering(file_set_id)\n file_set_document = query_for_rendering(file_set_id)\n pdf_path = file_set_document.to_h.with_indifferent_access.dig(:parent_path_tesi).to_s + '/pdf'\n\n {\n \"@id\"=> pdf_path,\n \"label\"=> \"Download as PDF\",\n \"format\"=> \"application/pdf\"\n }\n end", "title": "" }, { "docid": "e2fd07a383dc9d768ff377f7e0fd62f4", "score": "0.5762838", "text": "def generate_html_and_make_pdf(folder, html_content, html_name, pdf_name, pdf_options)\n generate_html(folder, html_content, html_name)\n convert_html_to_pdf(folder, html_name, pdf_name, pdf_options)\n end", "title": "" }, { "docid": "81dbafb00b4c018efc911b363b67d346", "score": "0.5735036", "text": "def writer!\n return writer_class.new(settings.merge(\"logger\" => logger))\n end", "title": "" }, { "docid": "81dbafb00b4c018efc911b363b67d346", "score": "0.5735036", "text": "def writer!\n return writer_class.new(settings.merge(\"logger\" => logger))\n end", "title": "" }, { "docid": "aecd9ec8245f35fafb17db57dd9f9153", "score": "0.57310826", "text": "def to_pdf \n Editions::Book.new(@period, self)\n end", "title": "" }, { "docid": "aa1090c597af3a0738bdb3393d895dec", "score": "0.5702358", "text": "def to_pdf\n file = get_path()\n ext = File.extname(file)\n if ['.png', '.gif', '.jpg'].include?(ext.downcase)\n # image\n \"<center><p><img src='#{make_path(file)}'></p></center>\"\n else\n # other file\n source = escape_xml(File.read(File.join(@base, file)))\n \"<table width='100%' border='0' cellpadding='10'><tr>\"+\n \"<td bgcolor='#F0F0F0'><pre>#{source}</pre>\"+\n \"</td></tr></table><p></p>\"\n end\n end", "title": "" }, { "docid": "07de750ccbd45ab7a4f3316304f6c399", "score": "0.56988764", "text": "def generate_pdf\n respond_to do |format|\n format.html\n format.pdf do\n render :pdf => \"generate_pdf\"\n end\n end\n end", "title": "" }, { "docid": "5ada38f5b29ad41303832d42556f81fd", "score": "0.5688221", "text": "def generate_pdf!\n PDFGenerator.generate_invoice(self, pdf_template, pdf_template_locals)\n self.generated = true\n save\n end", "title": "" }, { "docid": "f9f8ff392cb314d50f6f07ceab8e3c43", "score": "0.5687042", "text": "def render_pdf_to_file(path)\n Payday::PdfRenderer.render_to_file(self, path)\n end", "title": "" }, { "docid": "7eb4e6c90eda3fccd24de5b639dd2653", "score": "0.56868935", "text": "def new\n @pdf = Pdf.new\n end", "title": "" }, { "docid": "6bbcb09bea46b16643a856575e31eebb", "score": "0.5683434", "text": "def create\n @pdf = Pdf.new(pdf_params)\n\n if @pdf.save\n flash[:notice] = \"Successfully added new pdf!\"\n redirect_to pdfs_path\n else\n flash[:alert] = \"Error adding new pdf!\"\n render :new\n end\n end", "title": "" }, { "docid": "568e6fb496e03b8a653973a4e255c064", "score": "0.5666594", "text": "def create\n @comments = Comment.where.not(body: '')\n\n respond_to do |format|\n original_orientation = TextOnPdf.first.original_orientation\n\n format.pdf do\n pdf = render_to_string pdf: 'generated_pdf.pdf',\n template: 'text_on_pdfs/generated_pdf.pdf',\n encording: 'UTF-8',\n layout: 'pdf.html',\n orientation: original_orientation,\n show_as_html: true\n # show_as_html: params[:debug].present?\n send_data(pdf)\n end\n end\n end", "title": "" }, { "docid": "7c70bac95b2ad999e16cc9e441e6e310", "score": "0.5650399", "text": "def save_pdf_file(pdf_content)\n File.open('data/test-generated/pdf/test.pdf', 'wb') { |file| file.puts(pdf_content) }\nend", "title": "" }, { "docid": "80ac8ad424a15cae30733455717909b2", "score": "0.5648129", "text": "def generate_content\n @pdf = Prawn::Document.new(\n info: self.metadata,\n top_margin: @format[:header_size] + @format[:top_margin],\n bottom_margin: @format[:footer_size] + @format[:bottom_margin]\n )\n add_page_body\n add_page_header\n add_page_footer\n add_page_numbering\n end", "title": "" }, { "docid": "197fb043df381ea0ebfa876da9a8aca2", "score": "0.5640537", "text": "def create\n @authenticated = authenticated?\n @me = me if authenticated?\n @pdf_report = PdfReport.new(params[:pdf_report])\n\n respond_to do |format|\n if @pdf_report.save\n format.html { redirect_to @pdf_report, notice: 'Pdf report was successfully created.' }\n format.json { render json: @pdf_report, status: :created, location: @pdf_report }\n else\n format.html { render action: \"new\" }\n format.json { render json: @pdf_report.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "23eb677bd97270a8801cbe591cbedd09", "score": "0.5637748", "text": "def render_pdf(options = {})\n # render specific options\n options[:layout] ||= false\n options[:template] ||= File.join(controller_path, action_name)\n \n # render header and footer to separate files\n options = prerender_header_and_footer(options)\n # render main body string\n externals_to_absolute_path(render_to_string(:template => options[:template], :layout => options[:layout]))\n end", "title": "" }, { "docid": "d056b69b66fba3ed1116bc3f74468387", "score": "0.56364614", "text": "def generate_print_pdf\n marks = self.mark_hash\n extra_marks = self.extra_marks\n total_mark = self.get_total_mark\n overall_comment = self.overall_comment\n submission = self.submission\n grouping = submission.grouping\n assignment = grouping.assignment\n\n # Make folder for temporary files\n workdir = \"tmp/print/#{self.id}\"\n FileUtils.mkdir_p(workdir)\n\n # Constants used for PDF generation\n logo_width = 80\n line_space = 12\n annotation_size = 20\n\n # Generate front page\n Prawn::Document.generate(\"#{workdir}/front.pdf\") do\n # Add MarkUs logo\n image Rails.root.join('app/assets/images/markus_logo_big.png'),\n at: [bounds.width - logo_width, bounds.height],\n width: logo_width\n\n font_families.update(\n 'Open Sans' => {\n normal: Rails.root.join('vendor/assets/stylesheets/fonts/OpenSansEmoji.ttf'),\n bold: Rails.root.join('vendor/assets/stylesheets/fonts/OpenSans-Bold.ttf')\n }\n )\n font 'Open Sans'\n\n # Title\n formatted_text [{\n text: \"#{assignment.short_identifier}: #{assignment.description}\", size: 20, styles: [:bold]\n }]\n move_down line_space\n\n # Group members\n grouping.accepted_students.includes(:user).find_each do |student|\n text \"#{student.user_name} - #{student.first_name} #{student.last_name}\"\n end\n move_down line_space\n\n # Marks\n assignment.ta_criteria.order(:position).find_each do |criterion|\n mark = marks.dig(criterion.id, :mark)\n if criterion.is_a? RubricCriterion\n formatted_text [{ text: \"#{criterion.name}:\", styles: [:bold] }]\n indent(10) do\n criterion.levels.order(:mark).find_each do |level|\n styles = level.mark == mark ? [:bold] : [:normal]\n formatted_text [{\n text: \"• #{level.mark} / #{criterion.max_mark} #{level.name}: #{level.description}\",\n styles: styles\n }]\n end\n end\n else\n formatted_text [{\n text: \"#{criterion.name}: #{mark || '-'} / #{criterion.max_mark}\",\n styles: [:bold]\n }]\n text criterion.description if criterion.description.present?\n end\n end\n\n extra_marks.each do |extra_mark|\n text \"#{extra_mark.description}: #{extra_mark.extra_mark}#{extra_mark.unit == 'percentage' ? '%' : ''}\"\n end\n move_down line_space\n\n formatted_text [{ text: \"#{I18n.t('results.total_mark')}: #{total_mark} / #{assignment.max_mark}\",\n styles: [:bold] }]\n move_down line_space\n\n # Annotations and overall comments\n formatted_text [{ text: Annotation.model_name.human.pluralize, styles: [:bold] }]\n submission.annotations.order(:annotation_number).includes(:annotation_text).each do |annotation|\n text \"#{annotation.annotation_number}. #{annotation.annotation_text.content}\"\n end\n move_down line_space\n\n formatted_text [{ text: Result.human_attribute_name(:overall_comment), styles: [:bold] }]\n if overall_comment.present?\n text overall_comment\n else\n text I18n.t(:not_applicable)\n end\n end\n\n # Copy all PDF submission files to workspace\n input_files = submission.submission_files.where(\"filename LIKE '%.pdf'\").order(:path, :filename)\n grouping.access_repo do |repo|\n input_files.each do |sf|\n contents = sf.retrieve_file(repo: repo)\n FileUtils.mkdir_p(File.join(workdir, sf.path))\n f = File.open(File.join(workdir, sf.path, sf.filename), 'wb')\n f.write(contents)\n f.close\n end\n end\n\n combined_pdf = CombinePDF.new\n # Simultaneouly do two things:\n # 1. Generate combined_pdf, a concatenation of all PDF submission files\n # 2. Generate annotations.pdf, a PDF containing only markers for annotations.\n # These will be overlaid onto combined_pdf.\n Prawn::Document.generate(\"#{workdir}/annotations.pdf\", skip_page_creation: true) do\n total_num_pages = 0\n input_files.each do |input_file|\n # Process the submission file\n input_pdf = CombinePDF.load(File.join(workdir, input_file.path, input_file.filename))\n combined_pdf << input_pdf\n\n num_pages = input_pdf.pages.size\n num_pages.times do\n start_new_page\n end\n\n # Create markers for the annotations.\n # TODO: remove where clause after investigating how PDF annotations might have a nil page attribute\n input_file.annotations.where.not(page: nil).order(:annotation_number).each do |annotation|\n go_to_page(total_num_pages + annotation.page)\n width, height = bounds.width, bounds.height\n x1, y1 = annotation.x1 / 1.0e5 * width, annotation.y1 / 1.0e5 * height\n\n float do\n transparent(0.5) do\n fill_color 'AAAAAA'\n fill_rectangle([x1, height - y1], annotation_size, annotation_size)\n end\n\n bounding_box([x1, height - y1], width: annotation_size, height: annotation_size) do\n move_down 5\n text annotation.annotation_number.to_s, color: '000000', align: :center\n end\n end\n end\n\n total_num_pages += num_pages\n end\n end\n\n # Combine annotations and submission files\n annotations_pdf = CombinePDF.load(\"#{workdir}/annotations.pdf\")\n combined_pdf.pages.zip(annotations_pdf.pages) do |combined_page, annotation_page|\n combined_page.fix_rotation # Fix rotation metadata, useful for scanned pages\n combined_page << annotation_page\n end\n\n # Finally, insert cover page at the front\n combined_pdf >> CombinePDF.load(\"#{workdir}/front.pdf\")\n\n # Delete old files\n FileUtils.rm_rf(workdir)\n combined_pdf\n end", "title": "" }, { "docid": "3ffa439f2ba925fa14f6e2001ef48631", "score": "0.56208503", "text": "def to_png_file\n to_pdf_file do |pdf_path|\n Dir.mktmpdir(ident) do |output_directory|\n png_path = File.join(output_directory, ident + '.png')\n system convert, *CONVERT_OPTIONS, pdf_path, png_path\n raise PNGConversionFailed, self unless File.exist?(png_path)\n\n yield png_path\n File.unlink png_path\n end\n end\n end", "title": "" }, { "docid": "3ffa439f2ba925fa14f6e2001ef48631", "score": "0.56208503", "text": "def to_png_file\n to_pdf_file do |pdf_path|\n Dir.mktmpdir(ident) do |output_directory|\n png_path = File.join(output_directory, ident + '.png')\n system convert, *CONVERT_OPTIONS, pdf_path, png_path\n raise PNGConversionFailed, self unless File.exist?(png_path)\n\n yield png_path\n File.unlink png_path\n end\n end\n end", "title": "" }, { "docid": "0109deb1f6558424c2b2691c37cb8c8f", "score": "0.5614654", "text": "def toPDF()\n doc = Prawn::Document.new(:compress => true, :page_size => [500, 280])\n doc.font 'Times-Roman'\n \n # Les images pour le background, le logo, la signature du tresorier\n doc.image \"public/images/recus/recu.png\", :at => [0, 200]\n doc.image \"public/images/recus/logo112x87.png\", :at => [370, 195], :fit => [56, 44]\n doc.image \"public/images/recus/signature_recu.png\", :at => [280, 80], :fit => [147,42]\n\n # Boite avec les informations principales du recu\n doc.bounding_box([5,180], :width => 500) do\n doc.text \"Date: \" + DateTime.now.strftime('%Y-%m-%d')\n \n doc.move_down 42\n annee = DateTime.now.strftime('%Y')\n doc.text \"Reçu pour abonnement à la piscine Dixie \" + annee, :style => :bold\n doc.text \"Receipt for Dixie pool registration \" + annee, :style => :bold\n \n doc.move_down 10\n doc.text \"Nom/Name: \" + nom\n doc.text \"Montant perçu/Amount paid: \" + sprintf('$%6.2f', @famille.paiementTotal)\n end\n \n # Boite avec les coordonnes de la piscine. En haut a droite avec le logo dedans\n doc.bounding_box([220, 195], :width => 210, :height => 45) do\n doc.stroke_bounds\n doc.bounding_box([2, 43], :width => 210) do\n doc.text \"Association Piscine Dixie Inc.\"\n doc.text \"CP 34045\"\n doc.text \"Lachine, Qc, H8S 4H4\"\n end\n end\n \n # Sous la signature\n doc.draw_text \"Trésorier / Treasurer\", :at => [300, 30]\n \n return doc\n end", "title": "" }, { "docid": "df88ee9b65f7e21c8d60dac62021f215", "score": "0.5602999", "text": "def build_pdf\n set_font\n\n repeat(:all) do\n Header.build(opts:, composer: self).draw\n Footer.build(opts:, composer: self).draw\n end\n\n bounding_box([0, bounds.top - 178], width: bounds.width - 20, height: 560) do\n AppointmentInfo.build(opts:, composer: self).draw\n Demographics.build(opts:, composer: self).draw\n QuestionnaireResponseInfo.build(opts:, composer: self).draw\n end\n end", "title": "" }, { "docid": "de12a2b2590054892264a7a7b4ee284a", "score": "0.559562", "text": "def write(dest_prefix, dest_suffix = nil)\n #self.render(@site.layouts, @site.site_payload) if self.output == nil\n\n path = File.join(dest_prefix, CGI.unescape(self.url))\n dest = File.dirname(path)\n\n # Create directory\n FileUtils.mkdir_p(dest) unless File.exist?(dest)\n\n # write partials\n #@partials.each do |partial|\n # @settings[partial].write if @settings[partial] != nil\n #end\n\n # Debugging - create html version of PDF\n #File.open(\"#{path}.html\", 'w') {|f| f.write(self.output) } if @settings[\"debug\"]\n #@settings.delete(\"debug\")\n\n self.output = File.read(\"#{path}\") if @name != \"/.pdf\"\n\n # Build PDF file\n fix_relative_paths\n kit = PDFKit.new(self.output, @settings)\n file = kit.to_file(File.join(dest_prefix, @name))\n end", "title": "" }, { "docid": "cdad7df658fe033177e30f3a843e8ed1", "score": "0.55923814", "text": "def output_pdf\n siz = @report.size.to_i\n if siz < 500 || Dialog.confirm(\"Cela demandera environ #{siz / 250} secondes\")\n path = ask_path('.pdf')\n path ? build_and_save_pdf(path) : 'Annulé'\n else\n 'Annulé'\n end\n rescue\n pdf_error\n end", "title": "" }, { "docid": "9d9f85b4cb3b33c0d5a4d0eabeb9fda2", "score": "0.5571125", "text": "def build_pdf_rendering(file_set_id)\n file_set_document = query_for_rendering(file_set_id)\n paged_resource_id = file_set_document.dig(:is_page_of_ssi)\n\n {\n \"@id\"=> pdf_hyrax_paged_resource_path(paged_resource_id),\n \"label\"=> \"Download as PDF\",\n \"format\"=> \"application/pdf\"\n }\n end", "title": "" }, { "docid": "fb1d8a560702cf2283f7b86e7492e63e", "score": "0.55700827", "text": "def wicked_pdf_options(file_name, template)\n { :pdf => file_name,\n :template => template,\n :layout => \"pdf.html\",\n :formats => [:html],\n :page_size => \"letter\",\n :show_as_html => params[:debug].present?, # renders html version if you set debug=true in URL\n :footer => {\n :center => \"CipherTech\",\n :left => Date.today.strftime(\"%B %Y\"),\n :right => \"[page] of [topage]\"\n },\n :print_media_type => true } \n end", "title": "" }, { "docid": "494949817641231e424cf3c141995c99", "score": "0.55574113", "text": "def render_pdf(output, output_filename)\n output_file = File.new(output_filename, 'w')\n output_file.write(output)\n output_file.close\n\n # Make sure this variable is escaped, clearly.....\n system(\"pdflatex -output-directory=/tmp/ #{output_filename}\")\n end", "title": "" }, { "docid": "b71fa5b66fe568794a842627704d1f6c", "score": "0.55382", "text": "def printout\n raise WedgieError, \"can't print #{content_type}\" unless content_type == 'text/x-clinical'\n pdf = FPDF.new('P','mm','A4')\n pdf.SetFont('Arial','',10)\n clinical_objects.each do |obj|\n pdf.AddPage\n obj.gen_pdf(pdf)\n end\n return pdf\n end", "title": "" }, { "docid": "f5cf88b553a1caece690356790013b99", "score": "0.5515889", "text": "def create_temp_file(params={})\n params = {:base => 'rand', :ext => '.pdf'}.merge(params)\n Tempfile.new([params[:base], params[:ext]], Rails.root.join(CONFIG[:pdftool_temp_dir])).path\n end", "title": "" }, { "docid": "d7cb29cad75c03a9a46b15a4424d11dd", "score": "0.55151355", "text": "def gerar_relatorio\n pdf = PDFController.render_pdf\n send_data pdf,\n :type => \"application/pdf\",\n :disposition => \"inline\",\n :filename => \"report.pdf\"\n end", "title": "" }, { "docid": "fcc36afdf33d228ebf3c206f3f63774b", "score": "0.5514568", "text": "def render\n @pdf.render\n end", "title": "" }, { "docid": "d17c366c847f377ce91d1f26573b11e2", "score": "0.5509172", "text": "def export\n pdftk.fill_form PdfFormController::PDF_PATH, PdfFormController::OUTPUT_PATH, attributes\n end", "title": "" }, { "docid": "155440dfacbf56b846a89d5bcef0e5b1", "score": "0.5497635", "text": "def read(path)\n Pdf.new path, self\n end", "title": "" }, { "docid": "9c37d174981d233a76c56f731d06c30f", "score": "0.5495803", "text": "def render_pdf\n render_pdf_internal(report_for_rendering)\n end", "title": "" }, { "docid": "c6587e361b9c100375b0491f79bf2139", "score": "0.54937613", "text": "def to_pdf(force_render = false)\n tex_path = File.join(OUTPUT_DIR, \"#{base_name}.tex\")\n out = 'error'\n\n if !force_render && File.size?(pdf_path) && File.mtime(pdf_path) > @r.edited_at\n return pdf_path, 'cached'\n end\n\n Dir.mkdir(OUTPUT_DIR) unless File.directory?(OUTPUT_DIR)\n FileUtils.cp_r(STYLE_DIR, OUTPUT_DIR)\n\n Dir.chdir OUTPUT_DIR do\n File.open(tex_path, 'w') do |file|\n file.write to_tex\n end\n\n File.unlink(pdf_path) if File.file?(pdf_path)\n\n cmd = \"pdflatex --halt-on-error #{tex_path}\"\n \n # Compile tex source twice (to sync AUX file and stuff)\n out = `#{cmd} && #{cmd}`\n\n return pdf_path, out if File.size?(pdf_path)\n end\n\n return nil, out\n end", "title": "" }, { "docid": "6b1e4adb0deef040c34068155fea5fde", "score": "0.5483948", "text": "def rendered_pdf\n WickedPdf.new.pdf_from_string(rendered_view, @pdf_options)\n end", "title": "" }, { "docid": "95b5cb05ce26ba08994ce9775e859f6a", "score": "0.5480477", "text": "def generate_pdf\n respond_with(invoice)\n end", "title": "" }, { "docid": "ebdec0fd35267834010f695ae7b1249d", "score": "0.547447", "text": "def render_pdf src, *opts\n render src, {render: {format: 'pdf'}}, *opts\n end", "title": "" }, { "docid": "d3c01c7775d0e64f7b60e14c1607c8d0", "score": "0.54631585", "text": "def initialize(pdf = nil)\n template(pdf) if ! pdf.nil?\n end", "title": "" }, { "docid": "2894f1ed5a1243ae9c75c5a51ddd4169", "score": "0.5453891", "text": "def render\n generate_content\n @pdf.render\n end", "title": "" }, { "docid": "4308ce7a10722cabdf968c19faa1df31", "score": "0.54311115", "text": "def create\n output_path = ''\n\n CustomUtils.mktmpdir('knowings_api_file', \"/nfs/tmp/knowings/\") do |dir|\n metapath = create_meta(dir)\n basename = ::File.basename(@file_name, '.pdf')\n output_path = ::File.join(dir, \"#{basename}#{EXTENSION}\")\n\n POSIX::Spawn.system \"zip -j #{output_path} #{metapath} #{@filepath}\"\n end\n\n output_path\n end", "title": "" }, { "docid": "1d13968cec7741dade509531e092d346", "score": "0.5430062", "text": "def create_watermark_file(text)\n return nil if text.blank?\n verify_properties\n\n temp_pdf = PDF::Writer.new(:paper => DEFAULT_PAPER, :orientation => DEFAULT_ORIENTATION )\n\n # set the watermark text properties.\n temp_pdf.fill_color( Color::RGB.from_html(@text_properties[:font_color]) )\n temp_pdf.select_font(@text_properties[:font])\n\n # count lines (line ending designated by \\n's in the text)\n linecount = text.split(\"\\n\").size\n\n # set the initial cursor position\n xoffs = @text_properties[:hmargin].blank? ? 0 : @text_properties[:hmargin]\n #yoffs = (temp_pdf.text_line_width(text, @text_properties[:font_size]) / temp_pdf.page_width + linecount - 1) * @text_properties[:font_size] + @text_properties[:vmargin]\n yoffs = 0\n case @text_properties[:alignment]\n when :bottom\n yoffs = (linecount - 1 ) * @text_properties[:font_size] + @text_properties[:vmargin]\n when :top\n yoffs = temp_pdf.page_height - @text_properties[:font_size] - @text_properties[:vmargin]\n when :center\n yoffs = (temp_pdf.page_height + (linecount - 1 ) * @text_properties[:font_size] ) / 2\n end\n # make sure the text won't go off-page\n yoffs = 0 if yoffs < 0\n yoffs = temp_pdf.page_height if yoffs > temp_pdf.page_height\n\n text.each do |tmptxt|\n while tmptxt != \"\" do # repeat until the text buffer is not empty\n # print out what fits, the remainder will go back to tmptxt\n tmptxt = temp_pdf.add_text_wrap(xoffs, yoffs, temp_pdf.page_width, tmptxt, @text_properties[:font_size], @text_properties[:justification], @text_properties[:text_angle])\n yoffs -= @text_properties[:font_size] # position to the next line\n end\n end\n\n # save the watermark file\n temp_filename = create_temp_file\n temp_pdf.save_as(temp_filename)\n temp_pdf.close_object\n\n # return watermark file\n test_file(temp_filename, \"failed to create watermark file\")\n end", "title": "" }, { "docid": "bfff486beded8d301cd714f0446ce51b", "score": "0.5414609", "text": "def read(path)\n Pdf.new path, self, options\n end", "title": "" }, { "docid": "9070fc6b010b18c27e48246a83c74461", "score": "0.5404097", "text": "def create\n @pdf2 = Pdf2.new(params[:pdf2])\n\n respond_to do |format|\n if @pdf2.save\n format.html { redirect_to(@pdf2, :notice => 'Pdf2 was successfully created.') }\n format.xml { render :xml => @pdf2, :status => :created, :location => @pdf2 }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @pdf2.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6a09622dcb022098bc84bb47fbfaf89e", "score": "0.5403892", "text": "def code_to_pdf(file, outdir)\n # decide language syntax highlighting\n case file[:ext]\n when '.cpp', '.cs'\n lang = :cplusplus\n when '.c', '.h'\n lang = :c\n when '.java'\n lang = :java\n when '.pas'\n lang = :delphi\n else\n # should follow basic C syntax (if, else etc...)\n lang = :c\n end\n # code -> HTML\n html_body = CodeRay.scan_file(file[:actualfile], lang).html(:wrap => :div, :tab_width => 2, :css => :class, :line_numbers => :table, :line_number_anchors => false)\n\n # HTML -> PDF\n kit = PDFKit.new(html_body, :page_size => 'A4', :header_right => \"[page]/[toPage]\", :margin_top => \"10mm\", :margin_right => \"5mm\", :margin_bottom => \"5mm\", :margin_left => \"5mm\", :lowquality => true, :minimum_font_size => 8)\n kit.stylesheets << Rails.root.join(\"vendor/assets/stylesheets/coderay.css\")\n kit.to_file(outdir)\n end", "title": "" }, { "docid": "0acad5560c9a73856aa2ab70601e85ac", "score": "0.53938156", "text": "def pdf_file(template)\n if Spree::PrintInvoice::Config.store_pdf\n send_or_create_pdf(template)\n else\n render_pdf(template)\n end\n end", "title": "" }, { "docid": "27b2428cf1bf9ae3790295518d617e98", "score": "0.53850824", "text": "def convert_html_to_pdf(folder, html_name, pdf_name, pdf_options={})\n #config temp folder\n @file_dir = make_file_dir(folder)\n now = Time.now.strftime(\"%A %d %B %Y %H:%M:%S\")\n \n #if header is not exist, we create it\n FileTest.exist?(\"public/temp/default-header.html\") ? \"\" : file_open_puts(\"\",\"public/temp/default-header.html\")\n FileTest.exist?(\"public/temp/default-footer.html\") ? \"\" : file_open_puts(\"\",\"public/temp/default-footer.html\")\n #--page-size A4 --header-center EmZee --header-right 'Page [page] of [toPage]' --footer-center 'Copyright EmZee Pty Ltd - Generated at #{now}'\"\n pdf_options['default_option'] ||= \"--page-size A4\"\n pdf_options['header'] ||= \"--header-html public/temp/default-header.html\"\n pdf_options['footer'] ||= \"--footer-center 'Copyright EmZee Pty Ltd - Generated at #{now}'\"\n pdf_options['extra_option'] ||= \"\" \n system \"wkhtmltopdf #{ @file_dir}/#{html_name}.html #{@file_dir}/#{pdf_name}.pdf #{pdf_options['default_option']+\" \"+pdf_options['header']+\" \"+pdf_options['footer']+\" \"+pdf_options['extra_option']}\"\n end", "title": "" }, { "docid": "9e444b7d937f664cdac4aecfc412ec97", "score": "0.5382001", "text": "def create\n @pdf_file = PdfFile.new(params[:pdf_file])\n\n respond_to do |format|\n if @pdf_file.save\n format.html { redirect_to @pdf_file, :notice => 'Pdf file was successfully created.' }\n format.json { render :json => @pdf_file, :status => :created, :location => @pdf_file }\n else\n format.html { render :action => \"new\" }\n format.json { render :json => @pdf_file.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8b0e9c7b44a372285cf627cea29aa607", "score": "0.5381313", "text": "def build_writer(settings, agent_settings)\n if (writer = settings.tracing.writer)\n return writer\n end\n\n Tracing::Writer.new(agent_settings: agent_settings, **settings.tracing.writer_options)\n end", "title": "" }, { "docid": "98dcfb7039a68b3224971a0813741f04", "score": "0.5377449", "text": "def build_pdf_object(document)\n color_space =\n case channels\n when 1\n :DeviceGray\n when 3\n :DeviceRGB\n when 4\n :DeviceCMYK\n else\n raise ArgumentError, 'JPG uses an unsupported number of channels'\n end\n\n obj = document.ref!(\n Type: :XObject,\n Subtype: :Image,\n ColorSpace: color_space,\n BitsPerComponent: bits,\n Width: width,\n Height: height\n )\n\n # add extra decode params for CMYK images. By swapping the\n # min and max values from the default, we invert the colours. See\n # section 4.8.4 of the spec.\n if color_space == :DeviceCMYK\n obj.data[:Decode] = [1.0, 0.0, 1.0, 0.0, 1.0, 0.0, 1.0, 0.0]\n end\n\n obj.stream << @data\n obj.stream.filters << :DCTDecode\n obj\n end", "title": "" }, { "docid": "9ba5a5f28b761e53785a310c3d90987e", "score": "0.53768796", "text": "def generate_pdf(pdf_path, show_id)\n @progress.fraction = 0.0\n @progress.visible = true\n @btnOK.sensitive = false\n @btnCancel.sensitive = false\n \n thd = Thread.new(pdf_path, @progress, @db, show_id) do |path, progress, db, show|\n @log.info \"Creating booklet for show (#{show_id}) in #{pdf_path}\"\n \n pdf = ShowBookletPDF.new\n pdf.render_booklet db, show do |pct|\n progress.set_fraction(pct)\n end\n File.open(path, \"wb\") do |f|\n f.write pdf.render\n end\n \n progress.fraction = 1.0\n @log.info \"Done creating booklet for show (#{show_id}) in #{pdf_path}\"\n dlg = Gtk::MessageDialog.new(@mainWindow, \n Gtk::Dialog::DESTROY_WITH_PARENT, \n Gtk::MessageDialog::INFO, \n Gtk::MessageDialog::BUTTONS_CLOSE, \n \"Your PDF file has been created...\")\n dlg.run\n dlg.destroy\n progress.visible = false\n @btnOK.sensitive = true\n @btnCancel.sensitive = true\n \n # Now, we want to actually display the pdf\n system(\"evince #{pdf_path}\") if @chkShowPDF.active?\n end\n \n end", "title": "" }, { "docid": "6a4b6a2b784958e548b48e0a3ca9e8e4", "score": "0.5374697", "text": "def get_pdf(x)\n end", "title": "" }, { "docid": "14f62493322d51d1ad3dbd1b64ec2caf", "score": "0.5359074", "text": "def to_prawn(pdf=nil)\n @pdf = pdf||Prawn::Document.new(:bottom_margin => 0.0)\n _generate_check_pdf\n @pdf\n end", "title": "" }, { "docid": "19875c1e22461fb9d217266a3874d344", "score": "0.53453434", "text": "def makePDF( stylesheetPath, xml )\n pdfFile = Tempfile.new(\"pdf\");\n xmlFile = Tempfile.new(\"xml\");\n dmpFile = Tempfile.new(\"dump\" );\n RAILS_DEFAULT_LOGGER.debug( \" makePDF; xml is #{xml} \" ); \n xmlFile.write( xml );\n xmlFile.close();\n cmd = FOP_PATH+\" -xml #{xmlFile.path} -xsl #{stylesheetPath} -pdf #{pdfFile.path} &> #{dmpFile.path}\";\n RAILS_DEFAULT_LOGGER.debug( \" makePDF; command is #{cmd} \" );\n # see: file:/home/graham_s/ruby/docs/www.rubycentral.com/book/tut_threads.html\n IO.popen( cmd ) { \n |f| \n RAILS_DEFAULT_LOGGER.debug( \"command output is #{f.gets}\" ); \n }\n pdf = pdfFile.read();\n pdfFile.close();\n RAILS_DEFAULT_LOGGER.debug( \" output dump is \" + dmpFile.read() );\n dmpFile.close();\n return pdf\nend", "title": "" }, { "docid": "99f97f9c630eb6725d552489a0fe9abe", "score": "0.53331035", "text": "def create_write_data script_filename, output_extension\n # Normalize the output extension.\n output_extension.upcase!\n output_extension = output_extension.split('.').tap{ |ext| ext.shift }.join('.') if output_extension =~ /^\\./\n\n if output_extension == 'SVG'\n create_svg script_filename\n else\n begin\n require 'RMagick'\n\n format_support = Magick.formats[output_extension]\n raise(ArgumentError, \"RMagick cannot write format '#{output_extension}'\") if format_support.nil? || format_support[2] == '-'\n\n image = Magick::Image::from_blob(create_svg(script_filename)) { self.format = 'SVG' }\n image[0].format = output_extension\n image[0].to_blob\n\n rescue LoadError\n raise(ArgumentError, \"RMagick not found; cannot write PDF\")\n end\n end\n end", "title": "" }, { "docid": "25cf3582195932b6f279ab613291683d", "score": "0.53323066", "text": "def toPDF(doc, parent)\n if !parent\n raise \"Pas de parent pour le recu\"\n end\n \n doc.start_new_page\n doc.font 'Times-Roman'\n \n # On fait deux copies.\n [650, 400].each do |y|\n doc.bounding_box([0, y], :width => 500, :height => 200) do\n oneRecu(doc, parent)\n end\n end\n \n end", "title": "" }, { "docid": "f9fdbcb304371d64d9c18a398e7cf9b3", "score": "0.53029317", "text": "def pdf\n base = Estimate.get_base\n estimate = base.fetch_by_id(id)\n return base.pdf(estimate)\n end", "title": "" } ]
c2394bb0602efc671ebbf89de2294a93
PUT /check_points/1 PUT /check_points/1.json
[ { "docid": "cf570944cac11f0d11a16bf3d89697e0", "score": "0.7295341", "text": "def update\n @check_point = CheckPoint.find(params[:id])\n respond_to do |format|\n if @check_point.update_attributes(params[:check_point])\n format.html { redirect_to check_points_path, notice: t(\"activerecord.models.check_point\") + t(\"message.updated\") }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @check_point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
[ { "docid": "b4509dab50d3c25cd60e5c13b98c0a1b", "score": "0.7158712", "text": "def update\n respond_to do |format|\n if @check_point.update(check_point_params)\n format.html { redirect_to @check_point, notice: 'Check point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @check_point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bfde2241fbaa80963732e25a01f8953d", "score": "0.7091797", "text": "def update\n respond_to do |format|\n if @check_point.update(check_point_params)\n format.html { redirect_to @check_point, notice: 'Check Point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @check_point.errors, status: :internal_server_error }\n end\n end\n\n end", "title": "" }, { "docid": "77cbc18b842cd61315c695171dd74c89", "score": "0.64447176", "text": "def set_check_point\n @check_point = CheckPoint.find(params[:id])\n end", "title": "" }, { "docid": "77cbc18b842cd61315c695171dd74c89", "score": "0.64447176", "text": "def set_check_point\n @check_point = CheckPoint.find(params[:id])\n end", "title": "" }, { "docid": "9c353322396ec89bc341c8908ce08be6", "score": "0.635954", "text": "def update\n @spotcheck = Spotcheck.find(params[:id])\n\n respond_to do |format|\n if @spotcheck.update_attributes(params[:spotcheck])\n format.html { redirect_to @spotcheck, notice: 'Spotcheck was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @spotcheck.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "27eed85a063c78b9f431669e89732263", "score": "0.63263094", "text": "def create\n @check_point = CheckPoint.new(params[:check_point])\n @check_point.user = current_user\n\n respond_to do |format|\n if @check_point.save\n format.html { redirect_to check_points_path, notice: t(\"activerecord.models.check_point\") + t(\"message.created\") }\n format.json { render json: @check_point, status: :created, location: @check_point }\n else\n format.html { render action: \"new\" }\n format.json { render json: @check_point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6ea8f740777fdd5cf23e75ea790dc876", "score": "0.6249431", "text": "def update\n respond_to do |format|\n if @api_v1_checklist.update(api_v1_checklist_params)\n format.html { redirect_to @api_v1_checklist, notice: 'Checklist was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_checklist }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_checklist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0a475c63fcfac4bb78039cf3ce54a410", "score": "0.6232535", "text": "def update\n respond_to do |format|\n if @check.update(check_params)\n format.html { redirect_to @check, notice: t(:check_updated) }\n format.json { render :show, status: :ok, location: @check }\n else\n format.html { render :edit }\n format.json { render json: @check.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "200368d4b09a51948b737bc9b6792e5e", "score": "0.6182466", "text": "def update\n respond_to do |format|\n if @check_up.update(check_up_params)\n format.html { redirect_to @check_up, notice: 'Check up was successfully updated.' }\n format.json { render :show, status: :ok, location: @check_up }\n else\n format.html { render :edit }\n format.json { render json: @check_up.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6b8171e317ea10b5a4a493efa9bce20e", "score": "0.6104221", "text": "def update\r\n @check = Check.find(params[:id])\r\n\r\n respond_to do |format|\r\n if @check.update_attributes(params[:check])\r\n format.html { redirect_to @check, notice: 'Check 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: @check.errors, status: :unprocessable_entity }\r\n end\r\n end\r\n end", "title": "" }, { "docid": "71e82cbf3956bf4307bbc7017e0e60b0", "score": "0.6074281", "text": "def create\n begin\n @check_point = CheckPoint.create!(check_point_params)\n render template: 'check_points/show', status: :created\n rescue Exception => e\n render json: {:message=> e.to_s}.to_json, status: :internal_server_error\n end\n end", "title": "" }, { "docid": "5202cb8685855fd4b4dc8ce82e40570e", "score": "0.60682744", "text": "def putCheckItemStatus(cardId, checklistId, itemId, status)\n\tresponse = RestClient.put(\n\t\t\t'https://api.trello.com/1/cards/'+cardId+'/checklist/'+checklistId+'/checkItem/'+itemId+'/state',\n\t\t\t:idCheckList \t=> checklistId,\n\t\t\t:idCheckItem\t\t\t\t=> itemId,\n\t\t\t:value\t\t\t\t\t\t\t=>\tstatus,\n\t\t\t:key \t\t\t\t=> $key,\n\t\t\t:token \t\t\t\t\t\t=> $token\n\t)\n\tresponse = JSON.parse(response)\nend", "title": "" }, { "docid": "1e9ab54b5cd351a6d6eb7a87d29ea4e2", "score": "0.6019797", "text": "def update_points\n task = Task.find(params[:task_id])\n points = params[:points] == '-' ? nil : params[:points]\n task.update_attribute(:points, points)\n render :nothing => true\n end", "title": "" }, { "docid": "42833e3f5b0d5e1a383c32f14295faa3", "score": "0.6014872", "text": "def update\n respond_to do |format|\n if @check.update(check_params)\n format.html { redirect_to @check, notice: I18n.t('messages.updated_with', item: 'Cheque') }\n format.json { render :show, status: :ok, location: @check }\n else\n format.html { render :edit }\n format.json { render json: @check.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "093ad5bd0e340fb3a383db4ccbb370ff", "score": "0.5998398", "text": "def update\n @check_in = CheckIn.find(params[:id])\n\n if @check_in.update(check_in_params)\n head :no_content\n else\n render json: @check_in.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "90a3d2c47004e7d290b6bfe4eb587d44", "score": "0.5944374", "text": "def set_trip_check_point\n @trip_check_point = TripCheckPoint.find(params[:id])\n end", "title": "" }, { "docid": "c980e0feb70a397835ca40f3edf32cf5", "score": "0.59197724", "text": "def update\n respond_to do |format|\n if @coin_check.update(coin_check_params)\n format.html { redirect_to @coin_check, notice: 'Coin check was successfully updated.' }\n format.json { render :show, status: :ok, location: @coin_check }\n else\n format.html { render :edit }\n format.json { render json: @coin_check.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2f734d8e50a1c1841ec38b59e0db9445", "score": "0.5909451", "text": "def update\n @checkpoint = Checkpoint.find(params[:id])\n row = @checkpoint.id+1\n respond_to do |format|\n if @checkpoint.update_attributes(params[:checkpoint])\n @ws[row,2] = @checkpoint.checkpoint\n @ws[row,3] = @checkpoint.lesson.lesson\n @ws[row,4] = @checkpoint.description\n @ws[row,5] = @checkpoint.videourl\n @ws[row,6] = @checkpoint.objective\n @ws[row,7] = @checkpoint.question\n @ws[row,8] = @checkpoint.answer\n @ws[row,9] = @checkpoint.position\n @ws.save()\n format.html { redirect_to @checkpoint, notice: 'Checkpoint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @checkpoint.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ed775629961537eec23b59f6f55ec125", "score": "0.58804446", "text": "def update\n respond_to do |format|\n if @checkpoint.update(checkpoint_params)\n format.html { redirect_to @checkpoint, notice: 'Checkpoint was successfully updated.' }\n format.json { render :show, status: :ok, location: @checkpoint }\n else\n format.html { render :edit }\n format.json { render json: @checkpoint.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "81967e06032609de095588c6ec0cef2f", "score": "0.58798695", "text": "def update\n @step.update(step_params)\n render json: @step\n end", "title": "" }, { "docid": "1437332a5aa1eb5fbe991ac1f66d153c", "score": "0.5859781", "text": "def putCardCheckItemPosition(cardId, idChecklist, idCheckItem, value)\n\n\thash = Hash.new\n\thash[:idChecklist] = idChecklist\n\thash[:idCheckItem] = idCheckItem\n\thash[:value] = value\t\n\thash[:key] = $key\n\thash[:token] = $token\n\n\tresponse = RestClient.put \"https://api.trello.com/1/cards/\"+cardId+\"/checklist/\"+idChecklist+\"/checkItem/\"+idCheckItem+\"/pos\", hash \n\tresponse = JSON.parse(response)\t\nend", "title": "" }, { "docid": "9ddb2f78f905bcc935e226987089f77c", "score": "0.58594674", "text": "def update\n if @recycling_point.update(recycling_point_params)\n render json: @recycling_point, status: :ok\n else\n render json: @recycling_point.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "9193eba34b9ecc98a2ef7c1bb43a6497", "score": "0.58487123", "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": "7a99e52def479cfbaff3fcc9e5cdeebd", "score": "0.58343166", "text": "def putCheckItemPos(cardId, checklistId, itemId, pos)\n\tresponse = RestClient.put(\n\t\t\t'https://api.trello.com/1/cards/'+cardId+'/checklist/'+checklistId+'/checkItem/'+itemId+'/pos',\n\t\t\t:idCheckList \t=> checklistId,\n\t\t\t:idCheckItem\t\t\t\t=> itemId,\n\t\t\t:value\t\t\t\t\t\t\t=>\tpos,\n\t\t\t:key \t\t\t\t=> $key,\n\t\t\t:token \t\t\t\t\t\t=> $token\n\t)\n\tresponse = JSON.parse(response)\nend", "title": "" }, { "docid": "47b42563eeae8c29bafc9f7ed8aa8a3c", "score": "0.58331376", "text": "def update\n @point = Point.find(params[:id])\n\n if @point.update(point_params)\n head :no_content\n else\n render json: @point.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "63aa23e78892a7a5b1357a55b5b7207c", "score": "0.58208203", "text": "def update\n @check_out = CheckOut.find(params[:id])\n \n if @check_out.update(check_out_params)\n head :no_content\n else\n render json: @check_out.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "e4936c0a0aefa09663100fb1348b49e6", "score": "0.58195263", "text": "def create\n @trip_check_point = @trip.trip_check_points.build(trip_check_point_params)\n if @trip_check_point.save\n render :show, status: :created\n else\n render json: @trip_check_point.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "06656c131d06ed4723cde921e40b2e24", "score": "0.5819256", "text": "def update\n @check_option = CheckOption.find(params[:id])\n\n respond_to do |format|\n if @check_option.update_attributes(params[:check_option])\n format.html { redirect_to check_options_path(:property_id => @check_option), :notice => 'Check option was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @check_option.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d2cdc07add9e31bc6357462213962a77", "score": "0.58044636", "text": "def putCardCheckItemPosition(cardId, idChecklist, idCheckItem, value)\n\n\thash = Hash.new\n\thash[:idChecklist] = idChecklist\n\thash[:idCheckItem] = idCheckItem\n\thash[:value] = value\t\n\thash[:key] = $key\n\thash[:token] = $token\n\n\tresponse = RestClient.put \"https://api.trello.com/1/cards/\"+cardId+\"/checklist/\"+idChecklist+\"/checkItem/\"+idCheckItem+\"/state\", hash \n\tresponse = JSON.parse(response)\t\nend", "title": "" }, { "docid": "ce95bdbb6811261240d297c980064664", "score": "0.5799554", "text": "def update\n respond_to do |format|\n if @checklist.update(checklist_params)\n format.html { redirect_to @checklist, notice: \"Checklist was successfully updated.\" }\n format.json { render :show, status: :ok, location: @checklist }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @checklist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8da390ebf50cadf581ebe8a65e358c8b", "score": "0.5790284", "text": "def update\n respond_to do |format|\n if @api_v1_checklist_item.update(api_v1_checklist_item_params)\n format.html { redirect_to @api_v1_checklist_item, notice: 'Checklist item was successfully updated.' }\n format.json { render :show, status: :ok, location: @api_v1_checklist_item }\n else\n format.html { render :edit }\n format.json { render json: @api_v1_checklist_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "07e1d4f042b98523747cde0ac46edcb8", "score": "0.57898575", "text": "def set_api_v1_checklist\n @api_v1_checklist = Api::V1::Checklist.find(params[:id])\n end", "title": "" }, { "docid": "b67ffd59c1c5f7b0ccaa564874bcd876", "score": "0.5789747", "text": "def update\n @checklist = Checklist.find(params[:id])\n\n respond_to do |format|\n if @checklist.update_attributes(params[:checklist])\n format.html { redirect_to @checklist, notice: 'Checklist was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @checklist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "db194c0e98fa49b1a05aa3dc82dd3ea8", "score": "0.57856643", "text": "def update\n @check_entry = CheckEntry.find(params[:id])\n\n respond_to do |format|\n if @check_entry.update_attributes(check_entry_params)\n format.html { redirect_to @check_entry, notice: 'Check entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @check_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4de9af20de7991fed7efe11c23468053", "score": "0.5782204", "text": "def update\n @check_class = CheckClass.find(params[:id])\n\n respond_to do |format|\n if @check_class.update_attributes(params[:check_class])\n format.html { redirect_to @check_class, notice: 'Check class was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @check_class.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9568ab6f11833caa041d344e95f1e76d", "score": "0.57782", "text": "def update\n respond_to do |format|\n if @everycheck.update(everycheck_params)\n format.html { redirect_to @everycheck, notice: \"Everycheck was successfully updated.\" }\n format.json { render :show, status: :ok, location: @everycheck }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @everycheck.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "dd201c0aab0b41e9e6d6bb0126446b47", "score": "0.5769966", "text": "def putChecklistName(idChecklist, value)\n\n\thash = Hash.new\n\thash[:value] = value if !value.nil?\n\n\tresponse = RestClient.put \"https://api.trello.com/1/checklists/\"+idChecklist+\"/name?key=\"+$key+\"&token=\"+$token+\"&filter=open\", hash\n\tresponse = JSON.parse(response)\nend", "title": "" }, { "docid": "d888c770a9f157856cea7d607d575fbe", "score": "0.5768941", "text": "def update\n respond_to do |format|\n if @checklist.update(checklist_params)\n format.html { redirect_to @checklist, notice: 'Checklist was successfully updated.' }\n format.json { render :show, status: :ok, location: @checklist }\n else\n format.html { render :edit }\n format.json { render json: @checklist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "16ca2a39ef987b9469ab814015f99cab", "score": "0.575613", "text": "def update\n respond_to do |format|\n if @check_item.update(check_item_params)\n format.html { redirect_to @check_item, notice: \"Check item was successfully updated.\" }\n format.json { render :show, status: :ok, location: @check_item }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @check_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3a282353c18677ad880d39dd6fc4d706", "score": "0.57516325", "text": "def update\n respond_to do |format|\n if @checklist.update(checklist_params)\n format.html { redirect_to @checklist, notice: 'Checklist was successfully updated.' }\n format.json { render :index, status: :ok, location: @checklist }\n else\n format.html { render :edit }\n format.json { render json: @checklist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ffea12be11a51bc6e6f66326f976bb55", "score": "0.5742128", "text": "def update\n respond_to do |format|\n if @trypoints.update(trypoints_params)\n format.html { redirect_to @trypoints, notice: 'Trypointss was successfully updated.' }\n format.json { render :show, status: :ok, location: @trypoints }\n else\n format.html { render :edit }\n format.json { render json: @trypoints.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "05aa4632b3654d68546286c5d3ef0e6d", "score": "0.57399213", "text": "def update\n respond_to do |format|\n if @health_check.update(health_check_params)\n format.html { redirect_to @health_check, notice: 'Health check was successfully updated.' }\n format.json { render :show, status: :ok, location: @health_check }\n else\n format.html { render :edit }\n format.json { render json: @health_check.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "56d0d4ab169519533141f25aae979b62", "score": "0.5734932", "text": "def update\n @operations_check = OperationsCheck.find(params[:operations_check_id])\n @lab_check = @operations_check.lab_checks.find(params[:id])\n\n respond_to do |format|\n if @nagios_check.update_attributes(nagios_check_params)\n format.html { redirect_to @nagios_check, notice: 'Nagios check was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @nagios_check.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "10045d30ad4edc39902d9e7cea601c25", "score": "0.5731494", "text": "def update\n @status_check = StatusCheck.find(params[:id])\n\n respond_to do |format|\n if @status_check.update_attributes(params[:status_check])\n format.html { redirect_to @status_check, notice: 'Status check was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @status_check.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61f6d89e76f2417b68ca418faf4806c7", "score": "0.572509", "text": "def update\n\n @check = Check.find(params[:check][:id])\n params[:check][:url] = params[:check][:url].sub(/http:\\/\\//, '')\n\n if ! @check.checklist.released?\n @check.checklist.increment_checklist_counters(@check, -1)\n\n if @check.update_attributes(params[:check])\n @check.checklist.increment_checklist_counters(@check, 1)\n flash['notice'] = 'Check was successfully updated.'\n redirect_to(:action => 'modify_checks', :id => @check.subsection_id)\n else\n flash['notice'] = 'Check was not updated.'\n redirect_to(:action => 'edit')\n end\n else\n flash['notice'] = 'Check is locked. The parent checklist is released.'\n redirect_to(:action => 'modify_checks', :id => @check.subsection_id)\n end\n\n end", "title": "" }, { "docid": "055b5a2894ab58c5f80a8842b8dc82c4", "score": "0.57245827", "text": "def create\n @checkpoint = Checkpoint.new(checkpoint_params)\n\n respond_to do |format|\n if @checkpoint.save\n format.html { redirect_to @checkpoint, notice: 'Checkpoint was successfully created.' }\n format.json { render :show, status: :created, location: @checkpoint }\n else\n format.html { render :new }\n format.json { render json: @checkpoint.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2907e6392b9fbcc3fcc8034bba4687a1", "score": "0.57241005", "text": "def update\n respond_to do |format|\n if @completed_checkpoint.update(completed_checkpoint_params)\n format.html { redirect_to @completed_checkpoint, notice: 'Completed checkpoint was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @completed_checkpoint.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "738c2d2ff1703e73c7c89410bc6b334a", "score": "0.5696079", "text": "def update\n @health_check = HealthCheck.find(params[:id])\n\n respond_to do |format|\n if @health_check.update_attributes(params[:health_check])\n format.html { redirect_to @health_check, notice: 'Health check was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @health_check.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "10f5e9eb4aee6b2ef6e3a5e9dea51e83", "score": "0.5695692", "text": "def update\n @pick_up_point = PickUpPoint.find(params[:id])\n\n respond_to do |format|\n if @pick_up_point.update_attributes(params[:pick_up_point])\n format.html { redirect_to @pick_up_point, notice: 'Pick up point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @pick_up_point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "06d44b5065c0246fc7ae5c4fedbb141a", "score": "0.56896734", "text": "def update\n @check_in = CheckIn.find(params[:id])\n\n respond_to do |format|\n if @check_in.update_attributes(params[:check_in])\n format.html { redirect_to @check_in, notice: 'Check in was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @check_in.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cdb1e9c0e0d84ec0328e484028ed5d14", "score": "0.5676381", "text": "def update\n @checkin.update(checkin_params)\n respond_with @checkin\n end", "title": "" }, { "docid": "d13ad9d25405ccbd5f11a7dd7333dfcf", "score": "0.56740177", "text": "def update\n @operations_check = OperationsCheck.find(params[:operations_check_id])\n @automount_check = @operations_check.automount_checks.find(params[:id])\n\n respond_to do |format|\n if @automount_check.update_attributes(automount_check_params)\n format.html { redirect_to @automount_check, notice: 'Automount check was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @automount_check.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4d7a4bb09213947e659c1e7a7e8e38a7", "score": "0.5656911", "text": "def update\n @operations_check = OperationsCheck.find(params[:operations_check_id])\n @lab_check = @operations_check.lab_checks.find(params[:id])\n \n respond_to do |format|\n if @lab_check.update_attributes(lab_check_params)\n format.html { redirect_to @lab_check, notice: 'Lab check was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @lab_check.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9febd2d9aedc2f639b365bc80b358da6", "score": "0.56506294", "text": "def update\n @good_point = GoodPoint.find(params[:id])\n\n respond_to do |format|\n if @good_point.update_attributes(params[:good_point])\n format.html { redirect_to @good_point, notice: 'Good point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @good_point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4e110ac001996c184c7d457a88ec5862", "score": "0.5649778", "text": "def update\n @check_method = CheckMethod.find(params[:id])\n\n respond_to do |format|\n if @check_method.update_attributes(params[:check_method])\n format.html {redirect_to income_finances_path, notice: '结算方式修改成功'}\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @check_method.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bf419ba990fed80569ce24e916e5023b", "score": "0.56467265", "text": "def update\n # REST 等で意図的に実施しない限り実行されないので処理はひとまず頑張らない\n return if @checklist.submit_at.present?\n\n respond_to do |format|\n if @checklist.update(checklist_params)\n format.html { redirect_to @checklist, notice: 'Checklist was successfully updated.' }\n format.json { render :show, status: :ok, location: @checklist }\n else\n format.html { render :edit }\n format.json { render json: @checklist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "681a9c2d89bd01f64e232aab925b5111", "score": "0.56460553", "text": "def update\n @test_point = TestPoint.find(params[:id])\n\n respond_to do |format|\n if @test_point.update_attributes(params[:test_point])\n format.html { redirect_to @test_point, notice: 'Test point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @test_point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "98fb58404c179cbbc73854c9f1fc49cb", "score": "0.56438255", "text": "def update\n @checklists_task = @checklist.tasks.find(params[:id])\n\n respond_to do |format|\n if @checklists_task.update_attributes(params[:checklists_task])\n format.html { redirect_to @checklists_task, notice: 'Task was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @checklists_task.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a5c700accd1ffc79ae1466c19a236ef0", "score": "0.5643501", "text": "def update\n @check_list_line = CheckListLine.find(params[:id])\n\n respond_to do |format|\n if @check_list_line.update_attributes(check_list_line_params)\n format.html { redirect_to @check_list_line, notice: 'Check list line was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @check_list_line.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "a9e840b92f016757debbeaa2189eb096", "score": "0.5638584", "text": "def update\n game = Game.find(params[:id]) \n game.update(points: params[:points])\n end", "title": "" }, { "docid": "a95ad1869f4b194deacaf5b53fa1a000", "score": "0.5629172", "text": "def update\n respond_to do |format|\n if @checkup_entry.update(checkup_entry_params)\n format.html { redirect_to @checkup_entry, notice: 'Checkup entry was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @checkup_entry.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "43aa4fe9123ffc3fd781f95514ed9cab", "score": "0.5625479", "text": "def create\n @spotcheck = Spotcheck.new(params[:spotcheck])\n\n respond_to do |format|\n if @spotcheck.save\n format.html { redirect_to @spotcheck, notice: 'Spotcheck was successfully created.' }\n format.json { render json: @spotcheck, status: :created, location: @spotcheck }\n else\n format.html { render action: \"new\" }\n format.json { render json: @spotcheck.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "60e7d3e0a6d99f1a3f3b26f989354686", "score": "0.5618964", "text": "def update\n @check_in = CheckIn.find(params[:id])\n @check_in.user_id = set_user_id(@check_in.user_id)\n respond_to do |format|\n if @check_in.update_attributes(params[:check_in])\n format.html { redirect_to @check_in, notice: 'Check in was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @check_in.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9c3b840b9a7ff9a64b6a9717777d11e3", "score": "0.56090146", "text": "def update\n @point = Point.find(params[:id])\n\n respond_to do |format|\n if @point.update_attributes(params[:point])\n format.html { redirect_to @point, notice: t('sigma.points.successfully_updated') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d777a0fbf2ecb62626923ea388ce65d8", "score": "0.5587586", "text": "def update\n respond_to do |format|\n if @check_in.update(check_in_params)\n format.html { redirect_to @check_in, notice: 'Check in was successfully updated.' }\n format.json { render :show, status: :ok, location: @check_in }\n else\n format.html { render :edit }\n format.json { render json: @check_in.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d777a0fbf2ecb62626923ea388ce65d8", "score": "0.5587586", "text": "def update\n respond_to do |format|\n if @check_in.update(check_in_params)\n format.html { redirect_to @check_in, notice: 'Check in was successfully updated.' }\n format.json { render :show, status: :ok, location: @check_in }\n else\n format.html { render :edit }\n format.json { render json: @check_in.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "28499f5dfeceacf02a2d5ceddf41a9d7", "score": "0.558538", "text": "def update\n respond_to do |format|\n if @point.set(point_params)\n format.html { redirect_to @point, notice: 'Point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "28499f5dfeceacf02a2d5ceddf41a9d7", "score": "0.558538", "text": "def update\n respond_to do |format|\n if @point.set(point_params)\n format.html { redirect_to @point, notice: 'Point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "77696f53b8e834469350232e602f8035", "score": "0.5585032", "text": "def create\n @api_v1_checklist = Api::V1::Checklist.new(api_v1_checklist_params)\n\n respond_to do |format|\n if @api_v1_checklist.save\n format.html { redirect_to @api_v1_checklist, notice: 'Checklist was successfully created.' }\n format.json { render :show, status: :created, location: @api_v1_checklist }\n else\n format.html { render :new }\n format.json { render json: @api_v1_checklist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c0fdd3d95cb15bdfdb83e4f251e47894", "score": "0.5584895", "text": "def update\n respond_to do |format|\n if @check_in.update(check_in_params)\n format.html { redirect_to @check_in, notice: 'Check in was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @check_in.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1b0f6ebe3ae2fe82429281a0048eeab0", "score": "0.556384", "text": "def check_params\n params.require(:check).permit(:price, :check_status_id, :check_type_id, :task_id, :currency_id)\n end", "title": "" }, { "docid": "9b31262602fc907949a7564c1a5c351c", "score": "0.55490905", "text": "def update \n if @checklist.update(checklist_params)\n #flash.now[:success] = \"Successfully created task.\" \n end\n end", "title": "" }, { "docid": "bd7d1d64af2b3887188b8ed67b2eda74", "score": "0.55464685", "text": "def destroy\n @check_point.destroy\n respond_to do |format|\n format.html { redirect_to check_points_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4bba310bfc00d2a8ca6ce73c365d4a6b", "score": "0.5540161", "text": "def update\n @api_v1_spot_estimate = Api::V1::SpotEstimate.where('spot_id = ? and user_id = ?', params[:id], @current_user.id).first\n\n if @api_v1_spot_estimate.update(api_v1_spot_estimate_params)\n head :no_content\n else\n render json: @api_v1_spot_estimate.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "98bb96543903105083f031d19670840f", "score": "0.55364275", "text": "def update\n @overview_point = OverviewPoint.find(params[:id])\n\n respond_to do |format|\n if @overview_point.update_attributes(params[:overview_point])\n format.html { redirect_to @overview_point, notice: 'Overview point was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @overview_point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d6759061af2ec0a2efdbbb5251358b25", "score": "0.5534517", "text": "def update\n respond_to do |format|\n if @check_record.update(check_record_params)\n format.html { redirect_to @check_record, notice: 'Check record was successfully updated.' }\n format.json { render :show, status: :ok, location: @check_record }\n else\n format.html { render :edit }\n format.json { render json: @check_record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4adc7146717a59fc5a61b0d381a15986", "score": "0.552943", "text": "def update\n @point = Point.find(params[:id])\n\n respond_to do |format|\n if @point.update_attributes(params[:point])\n format.html { redirect_to @point, notice: 'Point was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e69d69e7349f44be638973b53416c849", "score": "0.55268806", "text": "def set_api_v1_checklist_item\n @api_v1_checklist_item = Api::V1::ChecklistItem.find(params[:id])\n end", "title": "" }, { "docid": "44ef02c1e78bbbb54f6fc141fcfdcf3a", "score": "0.55248326", "text": "def update\n authorize! :create, Checkinout\n \n @checkinout.note = \"custom\"\n @checkinout.check_time = @checkinout.check_time.change({:hour => params[\"checkinout\"][\"check_time(4i)\"] , :min => params[\"checkinout\"][\"check_time(5i)\"]})\n \n respond_to do |format|\n if @checkinout.save\n format.html { redirect_to detail_checkinouts_url(user_id: @checkinout.user.id), notice: 'Checkinout was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit', tab_page: params[:tab_page] }\n format.json { render json: @checkinout.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "6fd7afc726c413b4cd089acd42f22dd0", "score": "0.55236465", "text": "def update\n track = Track.find(params[:track_id])\n @point = track.points.find(params[:id])\n\n respond_to do |format|\n if @point.update(point_params)\n format.html { redirect_to ([@point.track, @point]), :notice => 'Point was successfully updated.' }\n format.json { render :show, status: :ok, location: @point }\n else\n format.html { render :edit }\n format.json { render json: @point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "83f9524cc17fab55c9aeff61efce3363", "score": "0.55158913", "text": "def update\n respond_to do |format|\n if @checkresult.update(checkresult_params)\n format.html { redirect_to @checkresult, notice: 'Checkresult was successfully updated.' }\n format.json { render :show, status: :ok, location: @checkresult }\n else\n format.html { render :edit }\n format.json { render json: @checkresult.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "30364538d000808b2c476959c9af6c4a", "score": "0.5505513", "text": "def update\n respond_to do |format|\n if @track_point.update(track_point_params)\n format.html { redirect_to @track_point, notice: 'Track point was successfully updated.' }\n format.json { render :show, status: :ok, location: @track_point }\n else\n format.html { render :edit }\n format.json { render json: @track_point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0e3cda3e5c94d3db000716f5a28eacbd", "score": "0.5498394", "text": "def update\n @m_class_check = MClassCheck.find(params[:id])\n\n respond_to do |format|\n if @m_class_check.update_attributes(params[:m_class_check])\n input_check = params[:input][:check].to_i\n format.html { redirect_to :controller => \"m_class_checks\", :action => \"index\",:input_check => input_check }\n #format.html { redirect_to :controller => \"m_class_checks\", :action => \"show\",:id=>@m_class_check.id,:input_check => input_check }\n #format.html { redirect_to @m_class_check, notice: 'M class check was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @m_class_check.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba3dcf2348579ada3e1dcad3f44309a0", "score": "0.5497596", "text": "def update\n @point = Point.find(params[:id])\n\n respond_to do |format|\n if @point.update_attributes(params[:point])\n format.html { redirect_to @point, notice: 'Point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ba3dcf2348579ada3e1dcad3f44309a0", "score": "0.5497596", "text": "def update\n @point = Point.find(params[:id])\n\n respond_to do |format|\n if @point.update_attributes(params[:point])\n format.html { redirect_to @point, notice: 'Point was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "fe9bc3c38a79421757dd329459775129", "score": "0.5494212", "text": "def create\n begin\n if check_point_params[:asset_id].nil?\n logger.info(\"no asset id provided when creating point:so creating dummy asset\")\n asset = Asset.create({\n barcode: check_point_params[:barcode],\n name: check_point_params[:name],\n description: check_point_params[:description] })\n else\n logger.info(\"asset id: #{check_point_params}\")\n asset = Asset.find(check_point_params[:asset_id])\n end\n\n @check_point = asset.check_points.create!(check_point_params)\n render template: 'check_points/show', status: :created\n rescue Exception => e\n render json: {:message=> e.to_s}.to_json, status: :internal_server_error\n end\n end", "title": "" }, { "docid": "50229ba557beaa81cccb7b15d60b8961", "score": "0.54905564", "text": "def update\n respond_to do |format|\n if @way_point.update(way_point_params)\n format.html { redirect_to @way_point, notice: 'Way point was successfully updated.' }\n format.json { render :show, status: :ok, location: @way_point }\n else\n format.html { render :edit }\n format.json { render json: @way_point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2e026cfe3d513fc984f71b92426c0690", "score": "0.5486892", "text": "def update\n respond_to do |format|\n if @check_list_item.update(check_list_item_params)\n format.html { redirect_to @check_list_item, notice: \"Check list item was successfully updated.\" }\n format.json { render :show, status: :ok, location: @check_list_item }\n else\n format.html { render :edit }\n format.json { render json: @check_list_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "bb225f9bc02cfae9796a46ad463a944a", "score": "0.5480481", "text": "def update\n @point = @tour.point.find(params[:id])\n if @point.update_attributes(params[:point])\n flash.now[:notice] = 'point successfully updated'\n render :nothing => true\n else\n render :json => @point.errors, :status => :unprocessable_entity\n end\n end", "title": "" }, { "docid": "0cab8e2ae8684b013197ac853358986a", "score": "0.5479385", "text": "def update\n respond_to do |format|\n if @push_checklist.update(push_checklist_params)\n format.html { redirect_to @push_checklist, notice: 'Push checklist was successfully updated.' }\n format.json { render :show, status: :ok, location: @push_checklist }\n else\n format.html { render :edit }\n format.json { render json: @push_checklist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aee34fda37f1f92c818026d573026348", "score": "0.54754454", "text": "def update\n @internal_check = InternalCheck.find(params[:id])\n\n respond_to do |format|\n if @internal_check.update_attributes(params[:internal_check])\n format.html { redirect_to @internal_check, notice: 'Internal check was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @internal_check.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e8e98bb6d23de7447df79de46aa25e31", "score": "0.54751325", "text": "def update\n respond_to do |format|\n if @plate_check.update(plate_check_params)\n format.html { redirect_to @plate_check, notice: 'Plate check was successfully updated.' }\n format.json { render :show, status: :ok, location: @plate_check }\n else\n format.html { render :edit }\n format.json { render json: @plate_check.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1ba2642a63a26c138c6b2923fab0f30d", "score": "0.5474701", "text": "def update\n respond_to do |format|\n if @check_list_item.update(check_list_item_params)\n format.html { redirect_to @check_list_item, notice: 'Check list item was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @check_list_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7eec0109461b347363259cf6bdb52f08", "score": "0.54725784", "text": "def update\n @operations_check = OperationsCheck.find(params[:operations_check_id])\n @rt_check = @operations_check.rt_checks.find(params[:id])\n\n respond_to do |format|\n if @rt_check.update_attributes(rt_check_params)\n format.html { redirect_to @rt_check, notice: 'RT check was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @rt_check.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "039ef6638df8328b4f5694d30713dc7c", "score": "0.5462873", "text": "def update\n respond_to do |format|\n if @checkup_record.update(checkup_record_params)\n format.html { redirect_to @checkup_record, notice: 'Checkup record was successfully updated.' }\n format.json { render :show, status: :ok, location: @checkup_record }\n else\n format.html { render :edit }\n format.json { render json: @checkup_record.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8f1e6f9aa562dea97914926cc77cfbb0", "score": "0.5455746", "text": "def update\n params[:points].each do |point_id|\n cur_point = Point.find(point_id)\n input_points = params[:points][point_id][:points]\n \n if cur_point.points.to_s != input_points\n cur_point.update_attributes!(:points => input_points,\n :updated_at => DateTime.now)\n end\n end\n redirect_to :back\n flash[:success] = \"Points were successfully updated.\"\n end", "title": "" }, { "docid": "0c4e3e01ea15db52ef25744d3907a346", "score": "0.54548043", "text": "def update\n respond_to do |format|\n if @question_point.update(question_point_params)\n format.html { redirect_to @question_point, notice: 'Question point was successfully updated.' }\n format.json { render :show, status: :ok, location: @question_point }\n else\n format.html { render :edit }\n format.json { render json: @question_point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cd802ce2a17178b553ecb15c52d286d7", "score": "0.5447859", "text": "def update\n respond_to do |format|\n if @pain_point.update(pain_point_params)\n format.html { redirect_to @pain_point, notice: 'Pain point was successfully updated.' }\n format.json { render :show, status: :ok, location: @pain_point }\n else\n format.html { render :edit }\n format.json { render json: @pain_point.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e3f50e465296b23b87ebab096e3baf4e", "score": "0.5446886", "text": "def update\n respond_to do |format|\n if @check_result.update(check_result_params)\n format.html { redirect_to @check_result, notice: 'Check result was successfully updated.' }\n format.json { render :show, status: :ok, location: @check_result }\n else\n format.html { render :edit }\n format.json { render json: @check_result.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c420d7c985229b3ceed1e8765667fcae", "score": "0.54459214", "text": "def update\n @point_of_interest = PointOfInterest.find(params[:id])\n\n respond_to do |format|\n if @point_of_interest.update_attributes(params[:point_of_interest])\n format.html { redirect_to @point_of_interest, notice: 'Point of interest was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @point_of_interest.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
2ece96a65fe336b1801d90bd6305fa91
Allow caller to override the capabilities
[ { "docid": "752fa3229df32f00a775f85e3d28db58", "score": "0.0", "text": "def fmtstr_set_caps(fpu, dpa)\n\t\t@use_fpu = fpu\n\t\t@use_dpa = dpa\n\tend", "title": "" } ]
[ { "docid": "e0ccd434067c204de8909cb83569deeb", "score": "0.83256024", "text": "def capabilities; end", "title": "" }, { "docid": "e0ccd434067c204de8909cb83569deeb", "score": "0.83256024", "text": "def capabilities; end", "title": "" }, { "docid": "e0ccd434067c204de8909cb83569deeb", "score": "0.83256024", "text": "def capabilities; end", "title": "" }, { "docid": "eb471e3df0b0baf90223b523fae8f9c5", "score": "0.7442773", "text": "def client_capabilities=(_arg0); end", "title": "" }, { "docid": "52effb75ec9d6b2a476ea66de42d3b6b", "score": "0.68214697", "text": "def default_capabilities\n {\n :browserName => \"Chrome\",\n :version => nil,\n :platform => \"Linux\"\n }\n end", "title": "" }, { "docid": "2c183963440a18a0d3dd9a2f2bb2e4ae", "score": "0.6818294", "text": "def register_capabilities(methods); end", "title": "" }, { "docid": "b50ac4045296320a0087199e11c8b02b", "score": "0.6763387", "text": "def capabilities\n data[:capabilities]\n end", "title": "" }, { "docid": "2f0029e9dfaea7822e2e40a0f0b8b772", "score": "0.6721922", "text": "def capabilities\n if @capabilities\n @capabilities\n elsif @cached_capabilities\n @capabilities = add_case_insensitive_default_proc(@cached_capabilities)\n else\n login\n end\n end", "title": "" }, { "docid": "afb2882d96be685b7e2637d73f12257b", "score": "0.6720516", "text": "def capabilities\n attributes.fetch(:capabilities)\n end", "title": "" }, { "docid": "afb2882d96be685b7e2637d73f12257b", "score": "0.6720516", "text": "def capabilities\n attributes.fetch(:capabilities)\n end", "title": "" }, { "docid": "70e9889269a625eb7671a77ba623826d", "score": "0.6685665", "text": "def update!(**args)\n @required_capabilities = args[:required_capabilities] if args.key?(:required_capabilities)\n end", "title": "" }, { "docid": "b966e424af16c4afc19d2da665a368ae", "score": "0.6557588", "text": "def capability=(value)\n @capability = value\n end", "title": "" }, { "docid": "35e557a96b226687f8c15e2bb70f6946", "score": "0.6547156", "text": "def method_missing name, *named, **ordered, &block\n #log \"method #{name} missing on #{@name}\"\n capability_name = name[0..-2].to_sym\n params = RBCM::Params.new named, ordered\n if not @@capabilities.include? capability_name\n super\n elsif name =~ /\\!$/\n return # never call cap! diectly\n elsif name =~ /\\?$/\n __search capability_name, params, &block\n end\n end", "title": "" }, { "docid": "2896c1c02223092270a104d64e1daec3", "score": "0.6488966", "text": "def restrict_capabilities\n return unless current_admin&.capabilities&.reject(&:blank?)&.present?\n\n if capabilities&.reject(&:blank?)&.present?\n self.capabilities &= current_admin.capabilities\n else\n self.capabilities = current_admin.capabilities\n end\n end", "title": "" }, { "docid": "944505a703a193d800b9066f3e4db595", "score": "0.632029", "text": "def capabilities\n @stack.capabilities\n end", "title": "" }, { "docid": "e3c8d95bbef5b43e6b79d7258adaaf84", "score": "0.6294481", "text": "def capabilities\n @manage_sieve.print_capabilities\n end", "title": "" }, { "docid": "5120162b8624abc1cc8e20a9ba2a98e7", "score": "0.6285364", "text": "def []=(name, value)\n @capabilities[name] = value\n end", "title": "" }, { "docid": "d1b23fa2c9a8a2361836ebf2d44f2407", "score": "0.625645", "text": "def desired_caps_real_device\n\tdesired_caps = {\n\t caps: {\n\t platformName: \t\t'iOS',\n\t versionNumber: \t\t'9.0',\n\t deviceName: \t\t'iPad de Guillem',\n newCommandTimeout: 1000, \n\t udid: \t\t'52257b7d0ae102e2d79f02448b5486aca8c6e715',\n\t autoAcceptAlerts: true,\n bundleId: 'com.kg.GoldenManager',\n #newCommandTimeout: 10,\n\t #app:\t \t\t\t\t\tAPP_PATH, \t\n fullReset: false,\n fastReset: true\n\t }\n\t}\nend", "title": "" }, { "docid": "6709e9f6a0554216cd2ee477be9229f5", "score": "0.6199144", "text": "def capabilities(*caps)\n caps = [caps].flatten\n\n raise \"Discovery plugin capabilities can't be empty\" if caps.empty?\n\n caps.each do |cap|\n if [:classes, :facts, :identity, :agents, :compound].include?(cap)\n @entities[:discovery][:capabilities] << cap\n else\n raise \"%s is not a valid capability, valid capabilities are :classes, :facts, :identity, :agents and :compound\" % cap\n end\n end\n end", "title": "" }, { "docid": "ed52f9beca3c7d80d2f42a4d3a14fc57", "score": "0.6156093", "text": "def require_capability(capabilities, options = {})\n options.assert_valid_keys(:if, :unless,\n :for, :only, \n :for_all_except, :except\n )\n \n # only declare that before filter once\n unless (@before_filter_declared||=false)\n @before_filter_declared=true\n before_filter :check_capabilities\n end\n \n # convert to an array if it isn't already\n capabilities = [ capabilities ] unless Array === capabilities\n capabilities.map! do | x |\n x = 'controller/:controller/:action' if x == nil || x == :ACTION \n x\n end\n \n options[:only] ||= options[:for] if options[:for]\n options[:except] ||= options[:for_all_except] if options[:for_all_except]\n \n # convert any actions into symbols\n for key in [:only, :except]\n if options.has_key?(key)\n options[key] = [options[key]] unless Array === options[key]\n options[key] = options[key].compact.collect{|v| v.to_sym}\n end \n end\n \n self.capability_requirements||=[]\n self.capability_requirements << {:capabilities => capabilities, :options => options }\n end", "title": "" }, { "docid": "1cb10744d788522fff2df2ab3d5e537b", "score": "0.61351794", "text": "def capability imap, res = nil\n return imap.capability unless res\n\n data = res.data\n\n if data.code and data.code.name == 'CAPABILITY' then\n data.code.data.split ' '\n else\n imap.capability\n end\n end", "title": "" }, { "docid": "d79de8b475f9bb90fb4305ab3c98c855", "score": "0.60736597", "text": "def register_capabilities methods\n @register_semaphore.synchronize do\n send_request 'client/registerCapability', {\n registrations: methods.select{|m| can_register?(m) and !registered?(m)}.map { |m|\n @registered_capabilities.add m\n {\n id: m,\n method: m,\n registerOptions: dynamic_capability_options[m]\n }\n }\n }\n end\n end", "title": "" }, { "docid": "72c069e0496cadbcdd7a2833132070c0", "score": "0.60724473", "text": "def hasCapability?(cap)\n return !isRegularUser? && (capabilities.include?(cap) || capabilities.include?(\"admin\"))\n end", "title": "" }, { "docid": "9ec69fb2ed4512d7e11ad7bb3c596f46", "score": "0.60387176", "text": "def allow_registration method\n @register_semaphore.synchronize do\n @dynamic_capabilities.add method\n end\n end", "title": "" }, { "docid": "70428b3aa4b2f52b1174aab0a54f1602", "score": "0.6019271", "text": "def set_caps(node, identities, features)\n client.caps.node = node\n client.caps.identities = identities\n client.caps.features = features\n end", "title": "" }, { "docid": "df4f40d8e1d6fc35bf6b7c4f291728d2", "score": "0.60128224", "text": "def capability\n one_data_response(\"CAPABILITY\").transform{ |response| response.data }\n end", "title": "" }, { "docid": "b4264f9f51e3d218c8a9a1d22740d9de", "score": "0.5989237", "text": "def enable_capabilities!(stack, template)\n found = Array(template['Resources']).detect do |resource_name, resource|\n resource['Type'].start_with?('AWS::IAM')\n end\n stack['Capabilities'] = ['CAPABILITY_IAM'] if found\n nil\n end", "title": "" }, { "docid": "1f4327725a8a69f9225c53b9a9a04c84", "score": "0.5966175", "text": "def []=(key, value)\n @capabilities[key] = value\n end", "title": "" }, { "docid": "94f9b74b044d5b92296bcd5743d63e48", "score": "0.59489274", "text": "def capabilities(keyword = nil)\n request Net::NNTP::Capabilities.new(keyword)\n end", "title": "" }, { "docid": "90acf27881a06eb64cc81af623df4e63", "score": "0.59303516", "text": "def set_caps(caps)\n return false if not caps.is_a? Gst::Caps\n \n self.java_element.set_caps(caps.java_caps)\n end", "title": "" }, { "docid": "90126703590ba4130a4d621c160a0059", "score": "0.58977485", "text": "def reset_abilities\n @capabilities.each do |cap|\n cant_do cap\n end\n end", "title": "" }, { "docid": "9626e49b247ef95b7c407d60215b3239", "score": "0.58937", "text": "def capability\n return @capability\n end", "title": "" }, { "docid": "3422075e3948b8b37eba9aae9eeb7f02", "score": "0.5856563", "text": "def [](name)\n @capabilities[name] || (parent_device ? parent_device[name] : nil)\n# @capabilities[name] = parent_device[name] if parent_device\n end", "title": "" }, { "docid": "13205066bf279ed81a330ac7a2e3b7eb", "score": "0.5817352", "text": "def update!(**args)\n @app_capabilities = args[:app_capabilities] if args.key?(:app_capabilities)\n @app_capabilities_delta = args[:app_capabilities_delta] if args.key?(:app_capabilities_delta)\n @app_integrations_settings = args[:app_integrations_settings] if args.key?(:app_integrations_settings)\n @car_assistant_capabilities = args[:car_assistant_capabilities] if args.key?(:car_assistant_capabilities)\n @clock_capabilities = args[:clock_capabilities] if args.key?(:clock_capabilities)\n @conversation_version = args[:conversation_version] if args.key?(:conversation_version)\n @cross_device_execution_capabilities = args[:cross_device_execution_capabilities] if args.key?(:cross_device_execution_capabilities)\n @gacs_capabilities = args[:gacs_capabilities] if args.key?(:gacs_capabilities)\n @gcm_capabilities = args[:gcm_capabilities] if args.key?(:gcm_capabilities)\n @home_app_capabilities = args[:home_app_capabilities] if args.key?(:home_app_capabilities)\n @live_tv_channel_capabilities = args[:live_tv_channel_capabilities] if args.key?(:live_tv_channel_capabilities)\n @oem_capabilities = args[:oem_capabilities] if args.key?(:oem_capabilities)\n @on_device_assistant_capabilities = args[:on_device_assistant_capabilities] if args.key?(:on_device_assistant_capabilities)\n @on_device_smart_home_capabilities = args[:on_device_smart_home_capabilities] if args.key?(:on_device_smart_home_capabilities)\n @on_device_storage_capabilities = args[:on_device_storage_capabilities] if args.key?(:on_device_storage_capabilities)\n @operating_system = args[:operating_system] if args.key?(:operating_system)\n @ordered_live_tv_providers = args[:ordered_live_tv_providers] if args.key?(:ordered_live_tv_providers)\n @selina_capabilities = args[:selina_capabilities] if args.key?(:selina_capabilities)\n @settings_app_capabilities = args[:settings_app_capabilities] if args.key?(:settings_app_capabilities)\n @supported_client_op = args[:supported_client_op] if args.key?(:supported_client_op)\n @supported_features = args[:supported_features] if args.key?(:supported_features)\n @supported_msg_version = args[:supported_msg_version] if args.key?(:supported_msg_version)\n @supported_provider_types = args[:supported_provider_types] if args.key?(:supported_provider_types)\n @surface_properties = args[:surface_properties] if args.key?(:surface_properties)\n end", "title": "" }, { "docid": "2d7b20b85041fb0e1e54446399336605", "score": "0.58083", "text": "def capabilities\n FFI::Libvirt.virConnectGetCapabilities(pointer)\n end", "title": "" }, { "docid": "ec9f6533347becaeec5d77286cb92061", "score": "0.5759999", "text": "def support\n end", "title": "" }, { "docid": "fb95a200ceafca9560c040e52a68f839", "score": "0.57025373", "text": "def unregister_capabilities(methods); end", "title": "" }, { "docid": "cf638a03395e1d4c96fae40f88939919", "score": "0.56647253", "text": "def browser_caps(browser,browser_options)\n target = (browser.to_sym if ENV['BROWSER'].nil? or ENV['browser'].empty?) || (ENV['BROWSER'].to_sym)\n browser,version,platform,device = extract_values_from(target)\n options = {}\n options.merge! browser_options\n caps = capabilities(browser,version,platform,device)\n options[:url] = url if url\n if options.include? :url\n browser = :remote\n options[:desired_capabilities] = caps\n end\n options[:http_client] = http_client if persistent_http or options.delete(:persistent_http)\n return browser,options\n end", "title": "" }, { "docid": "9de08ae33084912b0b634e680e5b053c", "score": "0.5629592", "text": "def capability_by_object_name(object_name)\n @capabilities[object_name]\n end", "title": "" }, { "docid": "38b6545013442abf54b8312dbb7cf574", "score": "0.5610792", "text": "def add_appium_prefix(capabilities)\n w3c_capabilities = ::Selenium::WebDriver::Remote::W3C::Capabilities.new\n\n capabilities = capabilities.__send__(:capabilities) unless capabilities.is_a?(Hash)\n\n capabilities.each do |name, value|\n next if value.nil?\n next if value.is_a?(String) && value.empty?\n\n capability_name = name.to_s\n w3c_name = extension_prefix?(capability_name) ? name : \"#{APPIUM_PREFIX}#{capability_name}\"\n\n w3c_capabilities[w3c_name] = value\n end\n\n w3c_capabilities\n end", "title": "" }, { "docid": "a3f6256181795ff0d752821d4e15afab", "score": "0.5605714", "text": "def supports_required_capabilities?(tcp)\n (ToolProxy::ENABLED_CAPABILITY - tcp['capability_offered']).blank?\n end", "title": "" }, { "docid": "1cd3ff69cedff30d793ce8d0d366dca3", "score": "0.55969405", "text": "def vcap_commands\n\nend", "title": "" }, { "docid": "e55772c1c6b7b870521604c542bb93aa", "score": "0.55945045", "text": "def capability_params\n params.require(:capability).permit(:affordance_id, :setup_id, :verification_status)\n end", "title": "" }, { "docid": "763e6fe1fc6e69098b4fc44fc6b53059", "score": "0.5569161", "text": "def implementations_of(message)\n raise CapabilitiesExceeded\n end", "title": "" }, { "docid": "1b4c616674aaa3e64f92cb90f39c252e", "score": "0.5499112", "text": "def required_capabilities?(tcp)\n (ToolProxy::ENABLED_CAPABILITY - tcp['capability_offered']).blank?\n end", "title": "" }, { "docid": "73470c6ffb0ce7b8fc483a0f643982cc", "score": "0.5492255", "text": "def caps_me\n caps self\n end", "title": "" }, { "docid": "a9009da0bb7abbc2a48af2aed93b6de3", "score": "0.54498", "text": "def for_local(platform, capabilities_option, team_id = nil, udid = nil)\n capabilities = if platform.downcase == 'android'\n {\n 'platformName' => 'Android',\n 'automationName' => 'UiAutomator2',\n 'autoGrantPermissions' => 'true'\n }\n elsif platform.downcase == 'ios'\n {\n 'platformName' => 'iOS',\n 'automationName' => 'XCUITest',\n 'deviceName' => udid,\n 'xcodeOrgId' => team_id,\n 'xcodeSigningId' => 'iPhone Developer',\n 'udid' => udid\n }\n elsif platform.downcase == 'macos'\n {\n 'platformName' => 'Mac'\n }\n end\n common = {\n 'os' => platform,\n 'autoAcceptAlerts': 'true'\n }\n capabilities.merge! common\n capabilities.merge! JSON.parse(capabilities_option)\n end", "title": "" }, { "docid": "f8dbf56c869e651a8719a5c5b0547981", "score": "0.5447786", "text": "def set_capability\n @capability = Capability.find(params[:id])\n end", "title": "" }, { "docid": "3d53f33ffedc873375810567835ffc34", "score": "0.5433855", "text": "def support\n raise \"Not implemented\"\n end", "title": "" }, { "docid": "dd993552ad0c4e2e4fb6661ec0d2e595", "score": "0.54169524", "text": "def set_desired_attributes(desired, action)\n case action\n when :enable\n desired.enabled = true\n when :hup\n desired.hupped = true\n when :int\n desired.inted = true\n when :term\n desired.termed = true\n when :restart\n desired.restarted = true\n when :nothing\n # nothing\n else\n raise NotImplementedError, \"unhandled action: '#{action}'\"\n end\n end", "title": "" }, { "docid": "3384aea6d3971d1419b40a0beb4a031c", "score": "0.5400041", "text": "def modules\n raise CapabilitiesExceeded\n end", "title": "" }, { "docid": "d576470872a16f96b2d86650f75ea06d", "score": "0.5396561", "text": "def resource_for(capability:)\n @capabilities[capability]\n end", "title": "" }, { "docid": "ec472f7e8aca4a76f4be4156a2c9c98f", "score": "0.5395059", "text": "def capability(capability)\n capability = self[capability.to_s]\n return nil if capability.nil?\n case capability.strip\n when /^d+$/\n capability = capability.to_i\n when /^true$/i\n capability = true\n when /^false$/i\n capability = false\n end\n return capability\n end", "title": "" }, { "docid": "d5d0000d0b98ef1b6541c98edc31db21", "score": "0.5386916", "text": "def can_emulate\n {\n method: \"Emulation.canEmulate\"\n }\n end", "title": "" }, { "docid": "2dcff97719c414e43ae527249161cb3b", "score": "0.53822154", "text": "def browserstack\n # Documentation and the code for this class can be found here\n # http://www.rubydoc.info/gems/selenium-webdriver/0.0.28/Selenium/WebDriver/Remote/Capabilities\n # https://github.com/SeleniumHQ/selenium/blob/master/rb/lib/selenium/webdriver/remote/capabilities.rb\n capabilities = Selenium::WebDriver::Remote::Capabilities.new\n\n config.browserstack.capabilities.each do |key, value|\n capabilities[key] = value\n end\n\n capabilities\n end", "title": "" }, { "docid": "783924e5b001f13a5cccd72b5bc94313", "score": "0.5380767", "text": "def create_node_capabilities(node, caps = [])\n\n\t\tnode['driver'].each do |key, values|\n\t\t\tentry = { browserName: key, platform: node['platform'].upcase }\n\t\t\tvalues.each { |name, value| entry[name.to_s] = value }\n\t\t\tcaps << entry\n\t\tend \n\n\t\tcaps.to_json \n\tend", "title": "" }, { "docid": "31602920af169983dd811e7f7c515b17", "score": "0.5323312", "text": "def enable_hotwire_turbo_drive_support=(_arg0); end", "title": "" }, { "docid": "3f92590ff5177e3cbd336bec0cd7da33", "score": "0.53215355", "text": "def update!(**args)\n @gesture_capabilities = args[:gesture_capabilities] if args.key?(:gesture_capabilities)\n @selina_supported = args[:selina_supported] if args.key?(:selina_supported)\n @sleep_sensing_supported = args[:sleep_sensing_supported] if args.key?(:sleep_sensing_supported)\n end", "title": "" }, { "docid": "523567b5069c4267886fbc0d63d67f00", "score": "0.5319867", "text": "def caps_ios_sl\n { caps: {\n # for sauceLabs - ios:\n deviceName: \"iPhone 6\",\n platformName: \"iOS\",\n platformVersion: \"8.4\",\n app: \"https://s3.amazonaws.com/appium/TestApp8.4.app.zip\",\n deviceOrientation: \"portrait\",\n name: \"Test Sample App\",\n newCommandTimeout: \"3600\"\n },\n appium_lib: {\n server_url: \"https://#{@userName_sl}:#{@accessKey_sl}@ondemand.saucelabs.com:443/wd/hub\"\n }\n }\nend", "title": "" }, { "docid": "746a12430812f2b4a4327590b11ad537", "score": "0.53182757", "text": "def default_caps default\n fail 'default caps must be a hash' unless default && default.is_a?(Hash)\n @caps.each { |cap| cap.merge!(default) { |_key, oldval, _newval| oldval } }\n end", "title": "" }, { "docid": "7ad66619ea348eea4bdb9797f9f690f8", "score": "0.5311276", "text": "def use_agent?; end", "title": "" }, { "docid": "11c9518cd28a71d3ced3654d950abbb6", "score": "0.5308907", "text": "def vcap environment\n\nend", "title": "" }, { "docid": "fb23d40ad77bfd0ac5c3e83582dd62a2", "score": "0.5308855", "text": "def capabilities\n @capabilities ||=\n instrument \"capabilities.github_ldap\" do |payload|\n begin\n @connection.search_root_dse\n rescue Net::LDAP::Error => error\n payload[:error] = error\n # stubbed result\n Net::LDAP::Entry.new\n end\n end\n end", "title": "" }, { "docid": "571284a730193d2a3cd49dd0b08b7c87", "score": "0.5296936", "text": "def isRegularUser?\n return capabilities.nil? || capabilities.blank?\n end", "title": "" }, { "docid": "c86bd391091f92fd8940ce334de7b770", "score": "0.5292902", "text": "def add_capabilities!(opts, klass, item = nil)\n raise ArgumentError, 'klass must be a class' unless klass.is_a?(Class)\n raise ArgumentError, 'opts must be a hash' unless opts.is_a?(Hash)\n\n filter_settings = klass&.try(:filter_settings)\n\n # check we can get filter settings and that capabilities are defined for this class\n unless filter_settings in {capabilities: Hash}\n opts[:capabilities] = nil\n return\n end\n\n capabilities = filter_settings[:capabilities]\n\n opts[:capabilities] = capabilities.transform_values { |capability|\n evaluate_capability(item, klass, capability)\n }\n end", "title": "" }, { "docid": "99d37309d85e8ae066039d5591f52007", "score": "0.5283017", "text": "def capabilities\n @capabilities ||= @data[\"data\"].keys.select do |cap|\n cats = @data[\"data\"][cap][\"categories\"]\n cats.any?{|cat| cat =~ /CSS/ }\n end.sort\n end", "title": "" }, { "docid": "7359def7e7450bf6ef7542a177a0597d", "score": "0.5272789", "text": "def update!(**args)\n @android_intent_capability = args[:android_intent_capability] if args.key?(:android_intent_capability)\n end", "title": "" }, { "docid": "00806e92b4dbb9d1e617fc80874f4e89", "score": "0.5270373", "text": "def sharing_capability=(value)\n @sharing_capability = value\n end", "title": "" }, { "docid": "f02a494e95b8a3abab03cc43d17d8280", "score": "0.526902", "text": "def hardware_information\n super\n end", "title": "" }, { "docid": "94f93155d6abd6d6aaed2171906e731a", "score": "0.52669466", "text": "def patch_capability_switch_capability_with_http_info(moid, capability_switch_capability, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.patch_capability_switch_capability ...'\n end\n # verify the required parameter 'moid' is set\n if @api_client.config.client_side_validation && moid.nil?\n fail ArgumentError, \"Missing the required parameter 'moid' when calling CapabilityApi.patch_capability_switch_capability\"\n end\n # verify the required parameter 'capability_switch_capability' is set\n if @api_client.config.client_side_validation && capability_switch_capability.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_capability' when calling CapabilityApi.patch_capability_switch_capability\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchCapabilities/{Moid}'.sub('{' + 'Moid' + '}', CGI.escape(moid.to_s))\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json', 'application/json-patch+json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_capability)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchCapability'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.patch_capability_switch_capability\",\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(:PATCH, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#patch_capability_switch_capability\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "2e1b112178897518078b9f9d0ae65e11", "score": "0.52619654", "text": "def update!(**args)\n @android_intent_capabilities = args[:android_intent_capabilities] if args.key?(:android_intent_capabilities)\n @assistant_capability = args[:assistant_capability] if args.key?(:assistant_capability)\n @audio_input = args[:audio_input] if args.key?(:audio_input)\n @audio_output = args[:audio_output] if args.key?(:audio_output)\n @bluetooth_capabilities = args[:bluetooth_capabilities] if args.key?(:bluetooth_capabilities)\n @call_capabilities = args[:call_capabilities] if args.key?(:call_capabilities)\n @camera = args[:camera] if args.key?(:camera)\n @car_ux_restrictions = args[:car_ux_restrictions] if args.key?(:car_ux_restrictions)\n @cast = args[:cast] if args.key?(:cast)\n @communication_ui_capabilities = args[:communication_ui_capabilities] if args.key?(:communication_ui_capabilities)\n @contact_lookup_capabilities = args[:contact_lookup_capabilities] if args.key?(:contact_lookup_capabilities)\n @device_id = args[:device_id] if args.key?(:device_id)\n @device_ux_mode = args[:device_ux_mode] if args.key?(:device_ux_mode)\n @has_voice_telephony = args[:has_voice_telephony] if args.key?(:has_voice_telephony)\n @jwn_capabilities = args[:jwn_capabilities] if args.key?(:jwn_capabilities)\n @lens_perception_capabilities = args[:lens_perception_capabilities] if args.key?(:lens_perception_capabilities)\n @location = args[:location] if args.key?(:location)\n @logging_only_data = args[:logging_only_data] if args.key?(:logging_only_data)\n @message_capabilities = args[:message_capabilities] if args.key?(:message_capabilities)\n @movement = args[:movement] if args.key?(:movement)\n @notification_capabilities = args[:notification_capabilities] if args.key?(:notification_capabilities)\n @notification_output_restrictions = args[:notification_output_restrictions] if args.key?(:notification_output_restrictions)\n @output_restrictions = args[:output_restrictions] if args.key?(:output_restrictions)\n @pop_on_lockscreen_capability = args[:pop_on_lockscreen_capability] if args.key?(:pop_on_lockscreen_capability)\n @safety_restrictions = args[:safety_restrictions] if args.key?(:safety_restrictions)\n @screen = args[:screen] if args.key?(:screen)\n @soda_capabilities = args[:soda_capabilities] if args.key?(:soda_capabilities)\n @software = args[:software] if args.key?(:software)\n @speech_capabilities = args[:speech_capabilities] if args.key?(:speech_capabilities)\n @supported_locale = args[:supported_locale] if args.key?(:supported_locale)\n @surface_identity = args[:surface_identity] if args.key?(:surface_identity)\n @surface_type_string = args[:surface_type_string] if args.key?(:surface_type_string)\n @system_notification_restrictions = args[:system_notification_restrictions] if args.key?(:system_notification_restrictions)\n @third_party_capabilities = args[:third_party_capabilities] if args.key?(:third_party_capabilities)\n end", "title": "" }, { "docid": "701fd271692d43c4cc8cc3606449cb59", "score": "0.5240404", "text": "def create_capability_switch_capability_with_http_info(capability_switch_capability, opts = {})\n if @api_client.config.debugging\n @api_client.config.logger.debug 'Calling API: CapabilityApi.create_capability_switch_capability ...'\n end\n # verify the required parameter 'capability_switch_capability' is set\n if @api_client.config.client_side_validation && capability_switch_capability.nil?\n fail ArgumentError, \"Missing the required parameter 'capability_switch_capability' when calling CapabilityApi.create_capability_switch_capability\"\n end\n # resource path\n local_var_path = '/api/v1/capability/SwitchCapabilities'\n\n # query parameters\n query_params = opts[:query_params] || {}\n\n # header parameters\n header_params = opts[:header_params] || {}\n # HTTP header 'Accept' (if needed)\n header_params['Accept'] = @api_client.select_header_accept(['application/json'])\n # HTTP header 'Content-Type'\n content_type = @api_client.select_header_content_type(['application/json'])\n if !content_type.nil?\n header_params['Content-Type'] = content_type\n end\n header_params[:'If-Match'] = opts[:'if_match'] if !opts[:'if_match'].nil?\n header_params[:'If-None-Match'] = opts[:'if_none_match'] if !opts[:'if_none_match'].nil?\n\n # form parameters\n form_params = opts[:form_params] || {}\n\n # http body (model)\n post_body = opts[:debug_body] || @api_client.object_to_http_body(capability_switch_capability)\n\n # return_type\n return_type = opts[:debug_return_type] || 'CapabilitySwitchCapability'\n\n # auth_names\n auth_names = opts[:debug_auth_names] || ['cookieAuth', 'http_signature', 'oAuth2', 'oAuth2']\n\n new_options = opts.merge(\n :operation => :\"CapabilityApi.create_capability_switch_capability\",\n :header_params => header_params,\n :query_params => query_params,\n :form_params => form_params,\n :body => post_body,\n :auth_names => auth_names,\n :return_type => return_type\n )\n\n data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)\n if @api_client.config.debugging\n @api_client.config.logger.debug \"API called: CapabilityApi#create_capability_switch_capability\\nData: #{data.inspect}\\nStatus code: #{status_code}\\nHeaders: #{headers}\"\n end\n return data, status_code, headers\n end", "title": "" }, { "docid": "8aa7b281aca5675756459030d207425d", "score": "0.52332145", "text": "def module_scope\n raise CapabilitiesExceeded\n end", "title": "" }, { "docid": "7cc9724d622348003b2027a43911ba8b", "score": "0.5231091", "text": "def discovery_permissions\n super\n end", "title": "" }, { "docid": "f9b16c13b7e121c72c2f5b9081da82d7", "score": "0.52254385", "text": "def inherit_promoted(device)\n raise NotImplementedError\n end", "title": "" }, { "docid": "f87833ff15f1bc29b556faca1e069be6", "score": "0.52155834", "text": "def agent_interface\n super\n end", "title": "" }, { "docid": "4b3a26df22677213c4b44d73921d1b34", "score": "0.52094984", "text": "def _initialize(name, machine)\n initialize_capabilities!(\n name.to_sym,\n { name.to_sym => [Class.new, nil] },\n Vagrant.plugin(\"2\").manager.provider_capabilities,\n machine,\n )\n end", "title": "" }, { "docid": "b5fd864cc6a525cd3019759751791a1b", "score": "0.51931965", "text": "def cap_respond_all?\n false\n end", "title": "" }, { "docid": "e6431ff47476c9014fb64198d5853e1e", "score": "0.51906615", "text": "def overrides; end", "title": "" }, { "docid": "6c94b95a4b84741217bfd2ed55b23188", "score": "0.51729023", "text": "def normalize_capability cap\n cap = cap.name if cap.respond_to?(:name)\n if Hash === cap\n cap = \"controller/#{cap[:controller] || '*'}/#{cap[:action] || '*'}\"\n end\n cap = cap.to_s unless String === cap\n cap\n end", "title": "" }, { "docid": "2b7eb4602781cd3e1361a77a80529a1c", "score": "0.5171706", "text": "def threads\n raise CapabilitiesExceeded\n end", "title": "" }, { "docid": "43fbbda9261c4443c38da7fcd33d2b03", "score": "0.5150552", "text": "def chrome_capabilities\n Selenium::WebDriver::Remote::Capabilities.chrome(\n logging_prefs: {browser: 'ALL'},\n 'chromeOptions' => {\n 'args' => %w[--ignore-certificate-errors],\n 'w3c' => false\n },\n 'acceptSslCerts' => true,\n 'acceptInsecureCerts' => true\n )\n end", "title": "" }, { "docid": "238ac26256553c340ab7ffabbf1dbb4a", "score": "0.5149867", "text": "def method_missing(method_name, *args, &blk)\n enabled = enabled_value(method_name)\n\n return super if enabled.nil?\n\n enabled\n end", "title": "" }, { "docid": "da39969a52fda0972257205358cee40a", "score": "0.51354176", "text": "def provision!; end", "title": "" }, { "docid": "7e632d9ab0f0f435599bf073af6b975b", "score": "0.51228774", "text": "def extended_interfaces; end", "title": "" }, { "docid": "87690ba04e61fb42d2d8e55fda4352ab", "score": "0.5119106", "text": "def method_missing(name, *args, &block)\n if abilities.key?(name)\n if TRUE_FLAGS.include?(abilities[name])\n true\n elsif FALSE_FLAGS.include?(abilities[name])\n false\n else\n if self.class === abilities[name]\n abilities[name]\n else\n abilities[name] = self.class.new(abilities[name], true) # true for subcan\n end\n end\n else\n if subcan\n false\n else\n # If not exist a key(resource) then mock a key with a blank can instance, so\n # we can call chain like this: <tt>can.resource_name.read # => false</tt>\n abilities[name] = self.class.new({}, true)\n end\n end\n end", "title": "" }, { "docid": "423d8dd9ea42f34b7d2f87c36536e084", "score": "0.5118144", "text": "def classes\n raise CapabilitiesExceeded\n end", "title": "" }, { "docid": "2d1549aa0830877cf0ae649f8a0a72c7", "score": "0.5113687", "text": "def api_mode; end", "title": "" }, { "docid": "64a6a82139f01cb61391e94a304e218b", "score": "0.5100744", "text": "def caps_ipad_sim\n { caps: {\n deviceName: \"\",\n platformName: \"iOS\",\n udid: \"\",\n platformVersion: \"\",\n appPackage: \"\",\n bundleId: \"\",\n xcodeOrgId: \"\",\n xcodeSigningId: \"\",\n newCommandTimeout: \"3600\",\n automationName: \"XCUITest\"\n # setWebContentsDebuggingEnabled: \"true\",\n # orientation: \"LANDSCAPE\",\n # noReset: \"false\",\n # fullReset: \"false\",\n # showIOSLog: \"true\",\n # autoAcceptAlerts: \"true\",\n # showXcodeLog: \"true\",\n # useNewWDA: \"true\"\n # resetOnSessionStartOnly: \"true\"\n }\n }\nend", "title": "" }, { "docid": "8205b5f04b5fc8b4d69f58f37e7be3fa", "score": "0.5093785", "text": "def standard?\n STANDARD_CAPABILITIES.include?(@name)\n end", "title": "" }, { "docid": "c5137281ddbbd8248478da204c86b473", "score": "0.5088064", "text": "def choose\n raise NotImplementedError.new('Must override')\n end", "title": "" }, { "docid": "10ab5a76e87610c31bededccdca9f11b", "score": "0.5085715", "text": "def handle_exception(e = Exception, &block)\n raise CapabilitiesExceeded\n end", "title": "" }, { "docid": "11d238cba5bdc3dee91693be3325cfe4", "score": "0.5084768", "text": "def update!(**args)\n @fallback_to_tethered_device_app_capabilities = args[:fallback_to_tethered_device_app_capabilities] if args.key?(:fallback_to_tethered_device_app_capabilities)\n @prefer_targeting_primary_device = args[:prefer_targeting_primary_device] if args.key?(:prefer_targeting_primary_device)\n @supported_recipient_types = args[:supported_recipient_types] if args.key?(:supported_recipient_types)\n end", "title": "" }, { "docid": "c3ac5b54e7ee242da84be19c8150f511", "score": "0.50819844", "text": "def method_missing(name, *args, &block)\n if driver.respond_to?(name)\n driver.send(name, *args, &block)\n else\n super\n end\n end", "title": "" }, { "docid": "0f034ce9e34cc0ed80000a1edb163e2b", "score": "0.5075994", "text": "def toggle_guest_access\n raise NotImplementedError\n end", "title": "" }, { "docid": "db74abe0138249bbca7df5249ef15cd4", "score": "0.5066038", "text": "def driver_start(desired_capabilities, appium_server)\n\n server_caps = {\n debug: false, #true\n server_url: appium_server,\n wait: 60 # equal to @default_wait in appium_lib source code.\n }\n\n caps = { caps: desired_capabilities, appium_lib: server_caps }\n\n Appium::Driver.new(caps).start_driver\n\n # Define the methods on all objects.\n # Note that this can also be scoped to limit the potential for conflicts.\n # Example: Appium.promote_appium_methods ::Example::Spec\n # Another alternative is to not promote at all. Instead access methods via $driver\n Appium.promote_appium_methods AppiumCustomDriver\n\n @driver\n end", "title": "" }, { "docid": "005667ae0053cd30fa4bf3d98ee5f796", "score": "0.50570637", "text": "def unregister_capabilities methods\n @register_semaphore.synchronize do\n send_request 'client/unregisterCapability', {\n unregisterations: methods.select{|m| registered?(m)}.map{ |m|\n @registered_capabilities.delete m\n {\n id: m,\n method: m\n }\n }\n }\n end\n end", "title": "" }, { "docid": "2ead67db5cbd256c7044389e95beafa0", "score": "0.50555694", "text": "def enable_rc\n system(\"sudo cp /opt/bs/files/su #{@rootfs}etc/pam.d/\")\n system(\"echo \\\"session required pam_limits.so\\\" | sudo tee -a #{@rootfs}etc/pam.d/su > /dev/null\")\n end", "title": "" }, { "docid": "b5a9a18f3149d042ab6859716137a4ef", "score": "0.50545585", "text": "def opts\n {\n caps: {\n \"app\": \"apps/budgetwatch.apk\",\n \"platformName\": \"android\",\n \"deviceName\": \"emulator\"\n }\n }\nend", "title": "" }, { "docid": "182a800a3e96a89369ece34f0c21b6ef", "score": "0.5049306", "text": "def custom_permissions # rubocop:disable Metrics/CyclomaticComplexity\n can :read, ApplicationPresenter, &:can_read?\n can :read, UsersPresenter, &:can_read?\n can :read, UserPresenter, &:can_read?\n can :read, RolesPresenter, &:can_read?\n can :read, RolePresenter, &:can_read?\n\n can :read, Press\n\n grant_press_analyst_abiltites if press_analyst?\n grant_press_editor_abilities if press_editor?\n grant_press_admin_abilities if platform_admin? || press_admin?\n grant_platform_admin_abilities if platform_admin?\n end", "title": "" }, { "docid": "d61dc70feecaab160eb996af49daad15", "score": "0.5037592", "text": "def respond_to_missing?(name, include_priv)\n super\n end", "title": "" } ]
13d464b0b1e470d35e749300b3a86fd5
Determines if the user is logged in.
[ { "docid": "5a96ed2b3b5935dd9774d0c5ec9d3228", "score": "0.0", "text": "def logged_in?\n return !session[:people_title].nil?\n end", "title": "" } ]
[ { "docid": "31fb4132def094f5ed9925db932d58eb", "score": "0.85887", "text": "def user_is_logged_in\n if session[:current_user] != nil\n return true\n else\n return false\n end\n end", "title": "" }, { "docid": "22ba2a6c1fd641fead2b88113346f450", "score": "0.8514761", "text": "def logged_in?\n current_user ? true : false\n end", "title": "" }, { "docid": "22ba2a6c1fd641fead2b88113346f450", "score": "0.8514761", "text": "def logged_in?\n current_user ? true : false\n end", "title": "" }, { "docid": "0f136293c6ed556528c13adef23889bb", "score": "0.84695864", "text": "def logged_in?\n if session[:username].nil?\n false\n else\n true\n end\n end", "title": "" }, { "docid": "483aec1fc4860e4ff555f8d7a05c3158", "score": "0.8456871", "text": "def logged_in?\n (!@_current_user.nil? && session[:session_id]) ? true : false\n end", "title": "" }, { "docid": "46d6f371d2d7c70e2c30f0da2c2eade6", "score": "0.8442348", "text": "def logged_in?\n (@current_user ||= session[:user] ? User.find_by_id(session[:user]) : :false).is_a?(User)\n end", "title": "" }, { "docid": "5e8797ab67adadcb571fb446716121fe", "score": "0.84325385", "text": "def userIsLoggedIn()\n user = getUser()\n if user != nil\n true\n else\n false\n end\n end", "title": "" }, { "docid": "9a9115161cb92dc8321a286b3d4d29f0", "score": "0.8424199", "text": "def logged_in?\n # check if current session has a user_id\n !!session[:user_id]\n end", "title": "" }, { "docid": "2cd1ab14e3727fc70bf2699b36d8d03a", "score": "0.83965445", "text": "def logged_in?\n !!session_user\n end", "title": "" }, { "docid": "00aec9d05d17933534b746809c84bec9", "score": "0.83943254", "text": "def logged_in?\n Service.is_user_logged_in?\n end", "title": "" }, { "docid": "ee1b105a4471533f8e7ba878bf651ccd", "score": "0.83804274", "text": "def logged_in?\n\t\tcurrent_user ? true : false\n\t\t#session[:userid]\n\tend", "title": "" }, { "docid": "104a6d97eb8910958e811106639eb754", "score": "0.8352561", "text": "def is_logged_in?\n \tif session[:user] && session[:user] != nil\n \t\ttrue\n \telse\n \t\tfalse\n \tend\n end", "title": "" }, { "docid": "c4fe9fe2cfa4010d87c3861c50aec87b", "score": "0.83495206", "text": "def logged_in?\n if current_user\n true\n else\n false\n end\n end", "title": "" }, { "docid": "ece7eedb5f4d1034319c055d399262f0", "score": "0.83396554", "text": "def logged_in?\n return @state.user_id ? true : false\n end", "title": "" }, { "docid": "a4e8313af939628aac4589c6f3295757", "score": "0.83340687", "text": "def logged_in?\n current_user.present?\n end", "title": "" }, { "docid": "a4e8313af939628aac4589c6f3295757", "score": "0.83340687", "text": "def logged_in?\n current_user.present?\n end", "title": "" }, { "docid": "fea2a62d678aac75aa5eedc8fe0150a7", "score": "0.83136326", "text": "def logged_in?\n if session[:user_id]\n true\n end\n end", "title": "" }, { "docid": "33b21a3eab5bb991b2a9345fc7cb7531", "score": "0.8311579", "text": "def logged_in?\n options[:current_user].is_a?(User)\n end", "title": "" }, { "docid": "33b21a3eab5bb991b2a9345fc7cb7531", "score": "0.8311579", "text": "def logged_in?\n options[:current_user].is_a?(User)\n end", "title": "" }, { "docid": "c2fb1a8eaba1efa34f2d9967886d1f73", "score": "0.8305879", "text": "def logged_in?\n current_user != :false\n end", "title": "" }, { "docid": "6c519c1747edee5b362d00f85d0c752a", "score": "0.8305478", "text": "def logged_in?\n !!session[:user_id]\n end", "title": "" }, { "docid": "6c519c1747edee5b362d00f85d0c752a", "score": "0.8305478", "text": "def logged_in?\n !!session[:user_id]\n end", "title": "" }, { "docid": "6c519c1747edee5b362d00f85d0c752a", "score": "0.8305478", "text": "def logged_in?\n !!session[:user_id]\n end", "title": "" }, { "docid": "89183adda0037710bfc5bfb3afd303a0", "score": "0.82778335", "text": "def logged_in?\n\t\t!current_user.nil? #if the current user == nil it is true, ! infront makes it false, and true if other wise\n\tend", "title": "" }, { "docid": "fced62813f772aac1f643593943d2ed0", "score": "0.8267977", "text": "def is_userloggedin?\n @loggedinuser != nil\n end", "title": "" }, { "docid": "6d54b491eedd02a4765350e2fd2096de", "score": "0.82636946", "text": "def logged_in?\n\t\tputs \"CHECKING IF LOGGEDIN!------------------->\"\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "9339a0f780a886b8da70fe20d99a2304", "score": "0.82604545", "text": "def logged_in?\n @session ? true : false\n end", "title": "" }, { "docid": "107c1ffb0896b91cea7a627a5d6fcef7", "score": "0.8230514", "text": "def logged_in?\n @current_user.present?\n end", "title": "" }, { "docid": "f810933a3357f792a5a6246073ce3290", "score": "0.8227964", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "f810933a3357f792a5a6246073ce3290", "score": "0.8227964", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "d042c98609facaab42c19e88416a0cf1", "score": "0.8221501", "text": "def logged_in?\n current_user.present?\n end", "title": "" }, { "docid": "ce8185e2e98c9dac971289c2ab3b382b", "score": "0.8211151", "text": "def logged_in?\n !!user_id\n end", "title": "" }, { "docid": "e4699c04994b5ff9d93844f49ebfbb6e", "score": "0.821", "text": "def logged_in?\n current_user.is_a?(User)\n end", "title": "" }, { "docid": "9446de727201d82b7c2c48d0d1cec579", "score": "0.8207404", "text": "def logged_in?\n current_user\n !@current_user.nil?\n end", "title": "" }, { "docid": "c37a01f19f6370531bd00920a4c6ceed", "score": "0.8202631", "text": "def is_logged_in?\n !session[:user_id].nil?\n end", "title": "" }, { "docid": "c37a01f19f6370531bd00920a4c6ceed", "score": "0.8202631", "text": "def is_logged_in?\n !session[:user_id].nil?\n end", "title": "" }, { "docid": "9510bac73d07d0c21cd8606e1fc8e6d0", "score": "0.82013494", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "488276842aa9ddc1876d30d3b137b470", "score": "0.8200661", "text": "def logged_in?\n @logged_in\n end", "title": "" }, { "docid": "5cb14ea67fd965781b881908c150186b", "score": "0.8200155", "text": "def logged_in?\n\tif session[:cas_user]\n\t\tif User.where(:userid => session[:cas_user]).count > 0\n\t\t true\n else\n false\n end\n\tend\n end", "title": "" }, { "docid": "fd3df506186e7292c5de328f2266cdf6", "score": "0.81982404", "text": "def logged_in?\n \t\t# to convert to a boolean use !!\n \t\t!!current_user # returns true if there is a current user and false if there is no current user\n \tend", "title": "" }, { "docid": "86805f1792444b14e07665cb85fd9141", "score": "0.81954217", "text": "def loggedin?\n if @ao_token\n response = get_request('IsLoggedIn')\n return response[:Result][:CurrentlyLoggedIn] ? true : false\n else\n return false\n end\n end", "title": "" }, { "docid": "10b60e1e308372713f5af366530899e7", "score": "0.819389", "text": "def is_logged_in? \n @logged_in_user = User.find(session[:user]) if session[:user]\n end", "title": "" }, { "docid": "cf71a133289add025607b9dee505be6a", "score": "0.81873274", "text": "def logged_in?\n\t\t# Converts the returned value for current_user into a boolean\n\t\t# This returns true if current_user object exists. Vice versa\n\t\t!!current_user\n\tend", "title": "" }, { "docid": "eed150749ebd08408c98126688576b3e", "score": "0.81850934", "text": "def logged_in?\n\t\tsession[:user_id] != nil\n\tend", "title": "" }, { "docid": "eed150749ebd08408c98126688576b3e", "score": "0.81850934", "text": "def logged_in?\n\t\tsession[:user_id] != nil\n\tend", "title": "" }, { "docid": "eed150749ebd08408c98126688576b3e", "score": "0.81850934", "text": "def logged_in?\n\t\tsession[:user_id] != nil\n\tend", "title": "" }, { "docid": "4e5ecb8232c91ed87ea2351764438dc4", "score": "0.8182346", "text": "def is_logged_in?\n\t\t!session[:user_id].nil?\n\tend", "title": "" }, { "docid": "4e5ecb8232c91ed87ea2351764438dc4", "score": "0.8182346", "text": "def is_logged_in?\n\t\t!session[:user_id].nil?\n\tend", "title": "" }, { "docid": "4e5ecb8232c91ed87ea2351764438dc4", "score": "0.8182346", "text": "def is_logged_in?\n\t\t!session[:user_id].nil?\n\tend", "title": "" }, { "docid": "1ed7d9da58f532929c9a84d22a4f39b9", "score": "0.8181872", "text": "def logged_in?\n\t\t!current_user.nil? || !current_user_user.nil?\n\tend", "title": "" }, { "docid": "0458ac1a371758f4ab47193c31423cdd", "score": "0.8179695", "text": "def logged_in?\n !session.user.nil?\n end", "title": "" }, { "docid": "a13556739ca0c2b380848a6a7a480da6", "score": "0.8175218", "text": "def logged_in?\n !user_id.nil?\n end", "title": "" }, { "docid": "9751b035dee8fcd407f7a99d248093c7", "score": "0.8172471", "text": "def logged_in?\n\t\t# not nil, i.e. logged in\n\t\t!current_user.nil?\n\tend", "title": "" }, { "docid": "8f8d73281df0f661ca9caf77549cebd8", "score": "0.8172417", "text": "def logged_in?\n !session[:user_id].nil?\n end", "title": "" }, { "docid": "8f8d73281df0f661ca9caf77549cebd8", "score": "0.8172417", "text": "def logged_in?\n !session[:user_id].nil?\n end", "title": "" }, { "docid": "8f8d73281df0f661ca9caf77549cebd8", "score": "0.8172417", "text": "def logged_in?\n !session[:user_id].nil?\n end", "title": "" }, { "docid": "b40c68dea30f721636b84796918196b8", "score": "0.8171234", "text": "def logged_in?\n return session[:user_id] ? true : false\n end", "title": "" }, { "docid": "cad205320538d658d0c2cb231680f3bc", "score": "0.81712043", "text": "def logged_in?\n \tif session[:user_id]\n logout = \"LOGOUT\"\n \t\ttrue\n \telse\n \t\tfalse\n \tend\n end", "title": "" }, { "docid": "11c759a5840d99568dffb90b49be34a1", "score": "0.81675255", "text": "def logged_in?\n current_user ? true : false\n #session[:userid]\n end", "title": "" }, { "docid": "2871ee749495cf95d6772b49bb05b26c", "score": "0.81669664", "text": "def logged_in?\r\n !!session[:user_id]\r\n end", "title": "" }, { "docid": "33a31ea1c2b9d0e547c8795529edfad1", "score": "0.8166721", "text": "def logged_in?\n !!session[:logged_in]\n end", "title": "" }, { "docid": "874286f9380337054e7bd539f62ef5b2", "score": "0.81629264", "text": "def logged_in?\n current_user != nil\n end", "title": "" }, { "docid": "874286f9380337054e7bd539f62ef5b2", "score": "0.81629264", "text": "def logged_in?\n current_user != nil\n end", "title": "" }, { "docid": "874286f9380337054e7bd539f62ef5b2", "score": "0.81629264", "text": "def logged_in?\n current_user != nil\n end", "title": "" }, { "docid": "874286f9380337054e7bd539f62ef5b2", "score": "0.81629264", "text": "def logged_in?\n current_user != nil\n end", "title": "" }, { "docid": "7c6e081fe42d983399edd0d124e2d58a", "score": "0.81626195", "text": "def logged_in?\n current_user.is_a? User\n end", "title": "" }, { "docid": "7c6e081fe42d983399edd0d124e2d58a", "score": "0.81626195", "text": "def logged_in?\n current_user.is_a? User\n end", "title": "" }, { "docid": "7c6e081fe42d983399edd0d124e2d58a", "score": "0.81626195", "text": "def logged_in?\n current_user.is_a? User\n end", "title": "" }, { "docid": "7c6e081fe42d983399edd0d124e2d58a", "score": "0.81626195", "text": "def logged_in?\n current_user.is_a? User\n end", "title": "" }, { "docid": "7c6e081fe42d983399edd0d124e2d58a", "score": "0.81626195", "text": "def logged_in?\n current_user.is_a? User\n end", "title": "" }, { "docid": "7c6e081fe42d983399edd0d124e2d58a", "score": "0.81626195", "text": "def logged_in?\n current_user.is_a? User\n end", "title": "" }, { "docid": "95a3ab03a43fcb46555ae3a8c7d2704a", "score": "0.8159104", "text": "def logged_in?\n \n !current_user.nil?\n end", "title": "" }, { "docid": "8188b9fce1e6fbfebb37e3b855d22e1f", "score": "0.8158809", "text": "def logged_in?\n @logged_in\n end", "title": "" }, { "docid": "c770850d5dc194f0475b2fb34a143358", "score": "0.81575483", "text": "def logged_in?\n\t\tcurrent_user.present?\n\tend", "title": "" }, { "docid": "c770850d5dc194f0475b2fb34a143358", "score": "0.81575483", "text": "def logged_in?\n\t\tcurrent_user.present?\n\tend", "title": "" }, { "docid": "0aff3da0a74be2d5253dac5d20719f8d", "score": "0.81565416", "text": "def logged_in?\n session_id.nil? ? false : true\n end", "title": "" }, { "docid": "79d49b837d4b7603980f7cf783fee1fc", "score": "0.81535286", "text": "def logged_in?\n\t\t!get_current_user.nil?\n\tend", "title": "" }, { "docid": "68e697962746cffca3f555b4a4d22977", "score": "0.81526804", "text": "def is_logged_in?\n @logged_in_user ||= (login_from_session || login_from_basic_auth || login_from_cookie || login_from_twitter) unless @logged_in_user == false\n end", "title": "" }, { "docid": "9499714765edae476d7d739b25ad3467", "score": "0.81486857", "text": "def user_is_logged_in?\n !session[:user_id].nil?\n end", "title": "" }, { "docid": "9499714765edae476d7d739b25ad3467", "score": "0.81486857", "text": "def user_is_logged_in?\n !session[:user_id].nil?\n end", "title": "" }, { "docid": "19a21ec559de3ed0205b2813b1ac853b", "score": "0.8145189", "text": "def logged_in?\n !current_user.blank?\n end", "title": "" }, { "docid": "03d08a9dcedfaf2b0633368e6f441696", "score": "0.8144928", "text": "def logged_in?\n\t\tcurrent_user\n\tend", "title": "" }, { "docid": "5d0e886c20daebb08fb5e77d044e9cf6", "score": "0.814458", "text": "def logged_in?\n\t\t# implicit return lets you clean this up a lot\n\t\t!session[:username].nil?\n\tend", "title": "" }, { "docid": "cd2478663931fed9463cd79ec1e7528b", "score": "0.81403935", "text": "def logged_in?\n return session[:user_id].present?\n end", "title": "" }, { "docid": "9536c8d5896ce9b2f4515ceec063b9c9", "score": "0.81386465", "text": "def logged_in?\n @logged_in == true\n end", "title": "" }, { "docid": "9536c8d5896ce9b2f4515ceec063b9c9", "score": "0.81386465", "text": "def logged_in?\n @logged_in == true\n end", "title": "" }, { "docid": "5c0957de2e754de404d54a0cf4917c2f", "score": "0.8138173", "text": "def logged_in?\n current_user\n end", "title": "" }, { "docid": "5c0957de2e754de404d54a0cf4917c2f", "score": "0.8138173", "text": "def logged_in?\n current_user\n end", "title": "" }, { "docid": "5c0957de2e754de404d54a0cf4917c2f", "score": "0.8138173", "text": "def logged_in?\n current_user\n end", "title": "" }, { "docid": "45c8b63d260c80adc73e00226e2bf0e6", "score": "0.81327486", "text": "def logged_in?\n\t\tcurrent_user.is_a? User\n\tend", "title": "" }, { "docid": "5f54c622f7de74eeafe6d8fe146f4f83", "score": "0.8132183", "text": "def logged_in?\n return current_user.present?\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8130886", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8130886", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8130886", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8130886", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8130886", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8130886", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8130886", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8130886", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8130886", "text": "def logged_in?\n !!current_user\n end", "title": "" }, { "docid": "91bb3d124190fc74af5a3cf1b1ec27f8", "score": "0.8130886", "text": "def logged_in?\n !!current_user\n end", "title": "" } ]
d169e826b0186104dceef59591cefe3b
Send a doubleclick at the current mouse location.
[ { "docid": "ae43c75b145e4ae9174409c21f976936", "score": "0.7976238", "text": "def doubleclick(btn = 'left')\n automatically \"mousedoubleclick #{mouse_button_translate(btn)}\"\n end", "title": "" } ]
[ { "docid": "9ae956159820e6fc7725194c995deec0", "score": "0.8588992", "text": "def double_click\n Bewildr::Mouse.double_click(clickable_point)\n end", "title": "" }, { "docid": "84027c7d65d574201a53dd3a2250c72e", "score": "0.818135", "text": "def double_click point = current_position\n event = CGEventCreateMouseEvent(nil, KCGEventLeftMouseDown, point, KCGMouseButtonLeft)\n CGEventPost(KCGHIDEventTap, event)\n CGEventSetType(event, KCGEventLeftMouseUp)\n CGEventPost(KCGHIDEventTap, event)\n\n CGEventSetIntegerValueField(event, KCGMouseEventClickState, 2)\n CGEventSetType(event, KCGEventLeftMouseDown)\n CGEventPost(KCGHIDEventTap, event)\n CGEventSetType(event, KCGEventLeftMouseUp)\n CGEventPost(KCGHIDEventTap, event)\n end", "title": "" }, { "docid": "664b1c6a0a4732c1b5ff5492961c619e", "score": "0.8081533", "text": "def double_click(locator)\n do_command(\"doubleClick\", [locator,])\n end", "title": "" }, { "docid": "121f4f77c84e47c9ad9df4028121ca54", "score": "0.79782116", "text": "def double_click obj = nil\n move_mouse_to obj if obj\n Mouse.double_click\n end", "title": "" }, { "docid": "eb0ac71a2a59e1e4d8fa93656d3584b7", "score": "0.77405536", "text": "def doubleclick(btn)\n automatically \"mousedoubleclick #{mouse_button_translate(btn)}\"\n end", "title": "" }, { "docid": "65999f3ddef265b005b31f13c91d16e4", "score": "0.77402544", "text": "def double_click!\n fire_event :dblclick\n browser.after_hooks.run\n end", "title": "" }, { "docid": "2cf951e231f15e6178cfc71e13c581e0", "score": "0.7668048", "text": "def double_click_at(locator,coordString)\n do_command(\"doubleClickAt\", [locator,coordString,])\n end", "title": "" }, { "docid": "13b1fa36824983d76d3f671da2a3df9b", "score": "0.74354964", "text": "def double_click(y: nil, x: nil)\n if move_cursor_by_click y: y, x: x\n enter\n end\n end", "title": "" }, { "docid": "8080cd17a3e9ca4a681b7dd81f900c20", "score": "0.7386693", "text": "def double_click(element = nil)\n @actions << [:mouse, :double_click, [element]]\n self\n end", "title": "" }, { "docid": "47b5c16d3fb85076d3efe8e8296a6937", "score": "0.73472446", "text": "def double_click\n element_center.double_click.perform\n end", "title": "" }, { "docid": "d145192b331ed208413331d5fee189b8", "score": "0.7310623", "text": "def double_click(*args)\n if args.empty?\n root.double_click\n else\n widget(*args).double_click\n end\n end", "title": "" }, { "docid": "2c86b2cd8c651cb92be83c5ee247a489", "score": "0.70667636", "text": "def doubleclick(btn = 'left')\n not_supported('doubleclick')\n end", "title": "" }, { "docid": "b06d798ba8541b0821b0d317c6943591", "score": "0.70016885", "text": "def double_click\n begin\n obj = find_element(self, @parent_element)\n #TODO this has been deprecated need to change the implementation\n # WARN Selenium [DEPRECATION] Driver#mouse is deprecated. Use driver.action.<command>.perform instead.\n page.driver.browser.mouse.double_click(obj.native)\n true\n rescue => e\n puts e\n false\n end\n end", "title": "" }, { "docid": "acd50be391fbb1e456b7fa1295d370d6", "score": "0.69857275", "text": "def double_click(*keys, **options)\n perform_click_action(keys, **options) do |k, opts|\n base.double_click(k, **opts)\n end\n end", "title": "" }, { "docid": "bb39d866d84195d27da02465c50eeb94", "score": "0.6871053", "text": "def map_double_click\n map_click(:ondbl_click_row, options) if options[:ondbl_click_row]\n end", "title": "" }, { "docid": "11ed8228e6f256c3426831093bf48221", "score": "0.6850632", "text": "def right_click\n Bewildr::Mouse.right_click(clickable_point)\n end", "title": "" }, { "docid": "277047d36999716cbd5828aca83bcdd3", "score": "0.68244135", "text": "def double_click(element = T.unsafe(nil), device: T.unsafe(nil)); end", "title": "" }, { "docid": "4f6b0468c7e6ece6644fdfc0e30b5ecd", "score": "0.6725862", "text": "def double_click(keys = [], **options)\n native_command %(click())\n native_command %(click())\n end", "title": "" }, { "docid": "6cb9c30419695298fc51f5a71bf2cf38", "score": "0.66900194", "text": "def on_double_click(&blk)\n @on_double_action = blk\n def self.performDoubleAction(sender); @on_double_action.call(sender, self.clickedColumn, self.clickedRow); end\n setDoubleAction(\"performDoubleAction:\")\n end", "title": "" }, { "docid": "890277a8788df37db08aefbcf56b9256", "score": "0.66186696", "text": "def double_click(element = T.unsafe(nil)); end", "title": "" }, { "docid": "589446858add7bde8182671ff88eeaba", "score": "0.66135836", "text": "def mouse_down(locator)\n do_command(\"mouseDown\", [locator,])\n end", "title": "" }, { "docid": "01007868ca45fce0526675456895b362", "score": "0.66111743", "text": "def double_click(element = nil, device: nil)\n move_to(element, device: device) if element\n click(device: device)\n click(device: device)\n self\n end", "title": "" }, { "docid": "c84408b449edc7b6a5456ae55d0e940c", "score": "0.6566321", "text": "def doubleclick(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil)\n $marathon.click(componentName, false, 2, o1, o2, o3, o4)\nend", "title": "" }, { "docid": "3133ef79f74e821ff568d4910ae4fd03", "score": "0.6527888", "text": "def tripleclick(btn = 'left')\n automatically \"mousetripleclick #{mouse_button_translate(btn)}\"\n end", "title": "" }, { "docid": "08c987d98d3278e41577c7e01f16244c", "score": "0.65133786", "text": "def secondary_click point = current_position\n event = CGEventCreateMouseEvent(nil, KCGEventRightMouseDown, point, KCGMouseButtonRight)\n CGEventPost(KCGHIDEventTap, event)\n CGEventSetType(event, KCGEventRightMouseUp)\n CGEventPost(KCGHIDEventTap, event)\n end", "title": "" }, { "docid": "e9f8c61965cd51cac78e02b0db05b0e5", "score": "0.64663774", "text": "def double_click_box\n cq = @parent.core_query(@selector)\n elem = cq[0]\n elem.double_click\n cq.done\n end", "title": "" }, { "docid": "70b7ac799694eb088e16f6c4306ed0e9", "score": "0.6413156", "text": "def arbitrary_click point = current_position, button = KCGMouseButtonCenter\n event = CGEventCreateMouseEvent(nil, KCGEventOtherMouseDown, point, button)\n CGEventPost(KCGHIDEventTap, event)\n CGEventSetType(event, KCGEventOtherMouseUp)\n CGEventPost(KCGHIDEventTap, event)\n end", "title": "" }, { "docid": "997a7d12d6ec045ddc562b09ccc92e0a", "score": "0.6339266", "text": "def right_click obj = nil\n move_mouse_to obj if obj\n Mouse.right_click\n end", "title": "" }, { "docid": "d61184956d5fba527a9c410ea8820e13", "score": "0.63078135", "text": "def tripleclick(btn)\n automatically \"mousetripleclick #{mouse_button_translate(btn)}\"\n end", "title": "" }, { "docid": "6f9af01454bf58f2e616a2fae394aa12", "score": "0.62913465", "text": "def click\n Bewildr::Mouse.click(clickable_point)\n end", "title": "" }, { "docid": "097b21ce014da97fccab563859c97e1b", "score": "0.6282559", "text": "def click(y: nil, x: nil)\n move_cursor_by_click y: y, x: x\n end", "title": "" }, { "docid": "e69e1a2312da27fc2574ab2d176cf9be", "score": "0.6274456", "text": "def click point = current_position\n event = CGEventCreateMouseEvent(nil, KCGEventLeftMouseDown, point, KCGMouseButtonLeft)\n CGEventPost(KCGHIDEventTap, event)\n # @todo Should not set number of sleep frames statically.\n 12.times do sleep QUANTUM end\n CGEventSetType(event, KCGEventLeftMouseUp)\n CGEventPost(KCGHIDEventTap, event)\n end", "title": "" }, { "docid": "62b6924a8d62869655eeb26d0d1150f9", "score": "0.6220865", "text": "def mouse_down_at(locator,coordString)\n do_command(\"mouseDownAt\", [locator,coordString,])\n end", "title": "" }, { "docid": "a2da669f579dc6a9e4fb865fe8e385b5", "score": "0.61781955", "text": "def onXButton2DoubleClick(&block)\n set_event_proc(:onXButton2DoubleClick, block)\n end", "title": "" }, { "docid": "63afb3f2ea78210940186f8666b51928", "score": "0.6123153", "text": "def onMButtonDoubleClick(&block)\n set_event_proc(:onMButtonDoubleClick, block)\n end", "title": "" }, { "docid": "0cedd50d039ff73fcf69c4c275ca1aae", "score": "0.60889524", "text": "def onLButtonDoubleClick(&block)\n set_event_proc(:onLButtonDoubleClick, block)\n end", "title": "" }, { "docid": "4919d6c5dd4a6e28c99696919f7c8607", "score": "0.6080677", "text": "def right_click\n click(:right, 1)\n end", "title": "" }, { "docid": "75880abdb4634629e14cacbe2da32944", "score": "0.60786057", "text": "def onXButton1DoubleClick(&block)\n set_event_proc(:onXButton1DoubleClick, block)\n end", "title": "" }, { "docid": "4403f2003a5793d6f58d52f3e716b2f8", "score": "0.5982506", "text": "def right_click\n click(:right, 1)\n end", "title": "" }, { "docid": "6267b1e05342a9932119c584e98d767f", "score": "0.5931757", "text": "def double_click(scroll_to: :center)\n element_call(:wait_for_present) do\n scroll.to(scroll_to) if scroll_to\n driver.action.double_click(@element).perform\n end\n browser.after_hooks.run\n end", "title": "" }, { "docid": "e9f484b37979085422657078746a07a0", "score": "0.5924474", "text": "def handle_mouse_down mouse_x, mouse_y\n # empty base implementation\n end", "title": "" }, { "docid": "af5c678a8771206fc3c70d670c9b69e7", "score": "0.5878126", "text": "def double_click(row_index, column_name)\n row = select(row_index)\n return unless row\n col = column(column_name)\n fail ArgumentError, \"Invalud column `#{column_name}'\" unless col\n exec_action(:Selection, ole, row_index, col.ole, true)\n end", "title": "" }, { "docid": "f0c8d396f71aa93210a09dbf33cbfc78", "score": "0.58760786", "text": "def onXButton2DoubleClick(&block)\n set_proc(:onXButton2DoubleClick, block)\n end", "title": "" }, { "docid": "2ca357f7338bb05888ca17832cceb223", "score": "0.5852203", "text": "def onMButtonDoubleClick(&block)\n set_proc(:onMButtonDoubleClick, block)\n end", "title": "" }, { "docid": "a3a4a6be397e4e16b776c9373505cd27", "score": "0.5836258", "text": "def onLButtonDoubleClick(&block)\n set_proc(:onLButtonDoubleClick, block)\n end", "title": "" }, { "docid": "f57df087b67d3a851b07c0cbe2e5d370", "score": "0.5791347", "text": "def click!\n WinUser.PostMessageA(hwnd, BM_CLICK, 0, nil)\n end", "title": "" }, { "docid": "5d208cfacd3458db92f1f90ebd5ff0cc", "score": "0.57650983", "text": "def onXButton1DoubleClick(&block)\n set_proc(:onXButton1DoubleClick, block)\n end", "title": "" }, { "docid": "b7744084874b323a8d13542464159c2b", "score": "0.57593375", "text": "def dClick\n # double click the date label instead\n @date.dClick\n end", "title": "" }, { "docid": "e6893ba2232fbcbcab6e31e2b782c99a", "score": "0.57439864", "text": "def handle_mouse_down(_key, _x, _y) end", "title": "" }, { "docid": "ce07446d22920f27814a0b12775e4c44", "score": "0.5733709", "text": "def click_at(x, y)\n relative_coordinates(x, y).click.perform\n end", "title": "" }, { "docid": "d90497639cdabc33de60fcc3f60b82c1", "score": "0.5733575", "text": "def onRButtonDoubleClick(&block)\n set_event_proc(:onRButtonDoubleClick, block)\n end", "title": "" }, { "docid": "02ead5d5d3a363c81413a7d956c5cb18", "score": "0.57217574", "text": "def click obj = nil\n move_mouse_to obj if obj\n Mouse.click\n end", "title": "" }, { "docid": "f114a2d81992b37038551a392c19ac0e", "score": "0.5656877", "text": "def dblclick(event)\n row = event.currentTarget\n\n if row.dataset.edit == @edit\n @edit = nil\n else\n @edit = row.dataset.edit\n end\n\n window.getSelection().removeAllRanges()\n end", "title": "" }, { "docid": "8d0410df25a9fbbfac1222edbac469f3", "score": "0.5654092", "text": "def mousedown(btn = 'left')\n automatically \"mousedown #{mouse_button_translate(btn)}\"\n end", "title": "" }, { "docid": "5e7c2dbb8f2487a6cff282654b8b386f", "score": "0.5646436", "text": "def click(selected)\n\t\t\t# select @drag_selection\n\t\t\t# establish basis for drag\n\t\t\t@move_text_basis = @mouse.position_in_world\n\t\t\t# store original position of text\n\t\t\t@original_text_position = selected.position\n\t\tend", "title": "" }, { "docid": "c25a09ea4aa5bf7cc8e3af96df5d317f", "score": "0.56463295", "text": "def click_left_mouse(x, y)\n ApiDefs.set_cursor_pos.call(x, y)\n ApiDefs.mouse_event.call(ApiDefs::MOUSEEVENTF_LEFTDOWN, x, y, 0, 0)\n sleep(0.05)\n ApiDefs.mouse_event.call(ApiDefs::MOUSEEVENTF_LEFTUP, x, y, 0, 0)\n end", "title": "" }, { "docid": "e9193fb6e98b0eaa186ea539d207010d", "score": "0.5643913", "text": "def click(btn = 'left')\n automatically \"mouseclick #{mouse_button_translate(btn)}\"\n end", "title": "" }, { "docid": "fc8b35a9e8164cf7f99b9b5514530c72", "score": "0.5606796", "text": "def click\n Vedeu.log(type: :input,\n message: \"Mouse pressed: '#{button}' \" \\\n \"(x: #{x}, y: #{y})\")\n\n Vedeu.trigger(:_mouse_event_, input)\n\n if left_click?\n Vedeu.trigger(:_cursor_reposition_, Vedeu.focus, y, x)\n\n elsif wheel_up?\n Vedeu.trigger(:_cursor_up_, Vedeu.focus)\n\n elsif wheel_down?\n Vedeu.trigger(:_cursor_down_, Vedeu.focus)\n\n else\n Vedeu.log(type: :input,\n message: 'Vedeu does not support mouse button ' \\\n \"'#{button}' yet.\")\n\n false\n end\n end", "title": "" }, { "docid": "748b0aed259f5bfe1d5fe0072d3cc146", "score": "0.5599196", "text": "def left_click\n x, y = source_x_y(0)\n WindowsInput.move_mouse(x+2,y+2)\n WindowsInput.left_click\n end", "title": "" }, { "docid": "968e63d40b28229a75caec574571357f", "score": "0.55908835", "text": "def mouse_click(x)\n\t\timpulse((@x-x).normalize * IMPULSE)\n\tend", "title": "" }, { "docid": "282744e10755232b970c99063e0a618f", "score": "0.5567112", "text": "def right_click(*args)\n if args.empty?\n root.right_click\n else\n widget(*args).right_click\n end\n end", "title": "" }, { "docid": "1102151cdac1616ca063294704dfa4f2", "score": "0.55544794", "text": "def mousedown(btn)\n automatically \"mousedown #{mouse_button_translate(btn)}\"\n end", "title": "" }, { "docid": "2e8419bd586968b0b2c5daf4383423ba", "score": "0.5545673", "text": "def drag_at(x, y, dx, dy)\n relative_coordinates(x, y).click_and_hold.move_by(dx, dy).release.perform\n end", "title": "" }, { "docid": "175d52aad80f406107bd991d9e67f5cc", "score": "0.55143166", "text": "def click\n system 'xdotool click 1' # NOTE dependency\nend", "title": "" }, { "docid": "8ec0279f997e79cff0c66990f0277fd2", "score": "0.55106544", "text": "def update\n\t\tif self.button_down?(Gosu::MsRight)\n \t\tputs \"Right mouse button clicked at #{self.mouse_x}, #{self.mouse_y}\"\n \tend\n end", "title": "" }, { "docid": "ec9cbf3fbaea0442a338e3f27ea05173", "score": "0.5502171", "text": "def right_click(*keys, **options)\n perform_click_action(keys, **options) do |k, opts|\n base.right_click(k, **opts)\n end\n end", "title": "" }, { "docid": "d26bc40370e38c30011ead6886512c24", "score": "0.5496881", "text": "def click(locator)\n do_command(\"click\", [locator,])\n end", "title": "" }, { "docid": "e168c3e1ae91ad616059898811fdecb6", "score": "0.5488063", "text": "def click\n return nil unless @mouse.click\n return @mouse.click.point\n end", "title": "" }, { "docid": "0c5ef3cd811a76b688dbf7faa4ffe97e", "score": "0.5477602", "text": "def tripleclick(btn = 'left')\n not_supported('tripleclick')\n end", "title": "" }, { "docid": "5a43cf6609d110bf0ac99ac3d99bd451", "score": "0.5433526", "text": "def click_at(locator,coordString)\n do_command(\"clickAt\", [locator,coordString,])\n end", "title": "" }, { "docid": "6f66600ab90634d9d0382c8c27776534", "score": "0.5409731", "text": "def mouseDown(event)\n closeHoverWindow\n location = convertPoint(event.locationInWindow, fromView:nil)\n lineNumber = lineNumberForLocation(location.y)\n unless lineNumber == NSNotFound\n selectLineNumber(lineNumber)\n window.makeFirstResponder(clientView)\n end\n end", "title": "" }, { "docid": "e3f6468543216da2fd7f39c5f11966cc", "score": "0.5405168", "text": "def click(btn)\n automatically \"mouseclick #{mouse_button_translate(btn)}\"\n end", "title": "" }, { "docid": "b6e18720568ec13cb4506ff79e1e68e5", "score": "0.5402232", "text": "def button_down(id)\n\t\tcase id\n\t\twhen Gosu::MsLeft\n\t\t\tputs \"Left mouse button clicked at #{self.mouse_x}, #{self.mouse_y}\"\n\t\tend\n\tend", "title": "" }, { "docid": "d3d5e9c065b983896f87f4d28f93e282", "score": "0.5398721", "text": "def double_click_info_image\n double_click_by_index(1)\n end", "title": "" }, { "docid": "982d826b9fe2ee4aa4fbc1d5ebc46c71", "score": "0.5398546", "text": "def onRButtonDoubleClick(&block)\n set_proc(:onRButtonDoubleClick, block)\n end", "title": "" }, { "docid": "6643f3f39d83613df942e42f80e9956b", "score": "0.5381098", "text": "def mouse_moved(x,y)\n \n end", "title": "" }, { "docid": "3f315ec7e855becc70be7bc09ed852a7", "score": "0.53601855", "text": "def mouse_moved(window, x,y)\n \n end", "title": "" }, { "docid": "fe8e1f1aaead530c2ad8e687811500ee", "score": "0.53559095", "text": "def onMButtonDoubleClick(flags, x, y, view)\n MSPhysics::ControlPanel.bring_to_front unless AMS::IS_PLATFORM_WINDOWS\n end", "title": "" }, { "docid": "a61f52af0d94f327978dad81ee35d929", "score": "0.5353158", "text": "def rightclick(componentName, o1 = nil, o2 = nil, o3 = nil, o4 = nil, o5 = nil)\n $marathon.click(componentName, true, o1, o2, o3, o4, o5)\nend", "title": "" }, { "docid": "74e1e4f583918ff63b9feedcabbab89d", "score": "0.53473234", "text": "def onLButtonDoubleClick(flags, x, y, view)\n Sketchup.active_model.selection.add(@relatedObjects) unless @ctrlDown\n if (@ctrlDown || @shiftDown) && @relatedObjects.size > 0\n @ctrlDown = false # debounce key\n @shiftDown = false # debounce key\n if @selectedIsJoint\n keypress = UI.messagebox(\"Are you sure you want to disconnect these #{@relatedObjects.size} objects?\", MB_YESNO, 'Error')\n if keypress == 6\n puts \"Joint disconnect #{@relatedObjects.size} from #{@selectedObject.name}\"\n @relatedObjects.each { |e| disconnectJoint(@selectedObject, e) }\n end\n else\n keypress = UI.messagebox(\"Are you sure you want to disconnect from these #{@relatedObjects.size} joints?\", MB_YESNO, 'Error')\n if keypress == 6\n puts \"Disconnect #{@selectedObject.name} from #{@relatedObjects.size}.\"\n @relatedObjects.each { |e| disconnectJoint(@selectedObject,e) }\n end\n end\n end\n refresh_viewport\n end", "title": "" }, { "docid": "14ec704c4ca644f31326519fcd1e1306", "score": "0.5306945", "text": "def click!\n fire_event :click\n browser.after_hooks.run\n end", "title": "" }, { "docid": "279137fa9421a32e991c1df36fba72dd", "score": "0.52965224", "text": "def button_down(id)\n\t\tcase id\n\t \twhen Gosu::MsLeft\n\t\t\t@locs = [mouse_x, mouse_y]\n\t\t\tarea_clicked(mouse_x, mouse_y)\n\t \t\n\t\tend\n\tend", "title": "" }, { "docid": "fbefd7c5570b8b12484ec7172dc9b2f7", "score": "0.52697027", "text": "def click(button=1)\n xdo { |xdo| Libxdo.xdo_click(xdo, Libxdo::CurrentWindow, button) }\n end", "title": "" }, { "docid": "f3ceb50577bbe4dad986fc45f9f5b830", "score": "0.5264", "text": "def on_mouse_down &b\n \n end", "title": "" }, { "docid": "f3ceb50577bbe4dad986fc45f9f5b830", "score": "0.5264", "text": "def on_mouse_down &b\n \n end", "title": "" }, { "docid": "63ee5643a00be8cb89c14e12714ba236", "score": "0.52616054", "text": "def handle_key_held_down id, mouse_x, mouse_y\n # empty base implementation\n end", "title": "" }, { "docid": "14af1bdd64606cffdc406ed99740e231", "score": "0.524984", "text": "def button_down(id)\n\t\tcase id\n\t\twhen Gosu::MsRight\n\t\t\tp \"right click\"\n\t\t\t@pos = [mouse_x,mouse_y]\n\t\twhen Gosu::MsLeft\n\t\t\tif mouse_x < 100 && mouse_y > 250\n\t\t\t\[email protected]_to_player\n\t\t\t\t@show_card = true\n\t\t\t\[email protected]_score\n\t\t\telsif mouse_x > 553 && mouse_y > 250\n\t\t\t\[email protected]_hand\n\t\t\t\[email protected]_bust\n\t\t\tend\n\t\t\tp [mouse_x, mouse_y]\n\t\telse\n\t\t\tp \"Mouse clicks only\"\n\t\tend\n\tend", "title": "" }, { "docid": "65efc7468dffe418b92b1711e8f03be1", "score": "0.5239789", "text": "def click(button)\n XDo::FFILib.xdo_click @_xdo_pointer, 0, button\n end", "title": "" }, { "docid": "8dee5d58eef9b558ddf1a79bdcd12593", "score": "0.5235449", "text": "def click_at(x, y)\n obj = find_element(self, @parent_element)\n obj.click_at(x, y)\n end", "title": "" }, { "docid": "d7c5fc9f78def00f919f5c079eddb64e", "score": "0.5234797", "text": "def click *args, &block\n bind :PRESS, *args, &block\n end", "title": "" }, { "docid": "a5a46de6cb182e73dbf539cb8e0d07a2", "score": "0.52234894", "text": "def mouse_moved(x,y)\n # p \"mouse position: #{[x,y]}.inspect\"\n end", "title": "" }, { "docid": "a5a46de6cb182e73dbf539cb8e0d07a2", "score": "0.52234894", "text": "def mouse_moved(x,y)\n # p \"mouse position: #{[x,y]}.inspect\"\n end", "title": "" }, { "docid": "8c709398c07df290800ccc8f986222b3", "score": "0.52055454", "text": "def drag(dx, dy)\n element_center.click_and_hold.move_by(dx, dy).release.perform\n end", "title": "" }, { "docid": "c9299bc2594859e06ae83f0c5f1e10fa", "score": "0.5203993", "text": "def click(id)\n h = child(id).handle\n rectangle = [0, 0, 0, 0].pack 'LLLL'\n get_window_rect h, rectangle\n left, top, right, bottom = rectangle.unpack 'LLLL'\n center = [(left + right) / 2, (top + bottom) / 2]\n set_cursor_pos *center\n mouse_event MOUSEEVENTF_LEFTDOWN, 0, 0, 0, 0\n mouse_event MOUSEEVENTF_LEFTUP, 0, 0, 0, 0\n end", "title": "" }, { "docid": "f321ef2abee0a9b279e7f0b9fb268cef", "score": "0.5200516", "text": "def double_click_image(browser_handle, property, property_value)\n browser_handle.image(property.intern, /#{property_value}/).fire_event(\"ondblclick\")\nend", "title": "" }, { "docid": "0260821c44277b9f4f8700664cbd746c", "score": "0.51927257", "text": "def click(opts={})\n control = child(opts)\n if control\n left, top, right, bottom = control.get_window_rect\n\n where = opts[:point] || opts[:where] || opts[:position]\n point = case where\n when Array\n where # Explicit screen coords\n when :random\n [left + rand(right - left), top + rand(bottom - top)] # Random point within control window\n else\n [(left + right) / 2, (top + bottom) / 2] # Center of a control window\n end\n\n WinGui.set_cursor_pos *point\n\n button = opts[:mouse_button] || opts[:mouse] || opts[:which]\n down, up = (button == :right) ?\n [WinGui::MOUSEEVENTF_RIGHTDOWN, WinGui::MOUSEEVENTF_RIGHTUP] :\n [WinGui::MOUSEEVENTF_LEFTDOWN, WinGui::MOUSEEVENTF_LEFTUP]\n\n WinGui.mouse_event down, 0, 0, 0, 0\n WinGui.mouse_event up, 0, 0, 0, 0\n point\n else\n nil\n end\n end", "title": "" }, { "docid": "5a97625ea6ce2840b471fbb4aee38c65", "score": "0.5191506", "text": "def click_coords(x, y)\n ensure_current_page_exists\n javascript_code = <<-JS\n var x = #{x};\n var y = #{y};\n var ev = new MouseEvent('click', {\n 'view': window,\n 'bubbles': true,\n 'cancelable': true,\n 'screenX': x,\n 'screenY': y\n });\n var el = document.elementFromPoint(x, y);\n el.dispatchEvent(ev);\n JS\n driver.execute_script(javascript_code)\n return self\n end", "title": "" }, { "docid": "bb284c64f5a7b9fb5c90d688366024a7", "score": "0.51835394", "text": "def drag_to point, duration = 0.2\n event = CGEventCreateMouseEvent(nil, KCGEventLeftMouseDown, current_position, KCGMouseButtonLeft)\n CGEventPost(KCGHIDEventTap, event)\n animate KCGEventLeftMouseDragged, KCGMouseButtonLeft, current_position, point, duration\n event = CGEventCreateMouseEvent(nil, KCGEventLeftMouseUp, current_position, KCGMouseButtonLeft)\n CGEventPost(KCGHIDEventTap, event)\n end", "title": "" }, { "docid": "6fbd6dc5404e22c70b299b093a592731", "score": "0.5180903", "text": "def double_tap(opts)\n args = opts.select { |k, _v| %i(element x y).include? k }\n args = args_with_ele_ref(args)\n chain_method(:doubleTap, args) # doubleTap is what the appium server expects\n end", "title": "" }, { "docid": "7098a3f71f382db74a94c63470357b33", "score": "0.51790094", "text": "def expand_with_double_click\n scroll_item_into_view unless visible?\n double_click\n # No event yet so just cheat and sleep\n sleep(0.1);\n end", "title": "" } ]
ad8e089feb993c8530154ccf8b122d19
whether it should uppercase or lowercase each letter. The nonalphabetic characters should still be included in the return value, they just don't count when toggling the desired case.
[ { "docid": "52d3ada58ed0f4079afb9119ef71ee0b", "score": "0.0", "text": "def staggered_case(string, first_case = \"up\")\r\n new_string = \"\"\r\n if first_case == \"up\"\r\n index = 0\r\n else\r\n index = 1\r\n end\r\n string.each_char do |x|\r\n index % 2 == 0 ? new_string << x.upcase : new_string << x.downcase\r\n index += 1 if (\"a\"..\"z\").include?(x) || (\"A\"..\"Z\").include?(x) \r\n end\r\n new_string\r\nend", "title": "" } ]
[ { "docid": "bac74b41b99024554780fe86eaf236f4", "score": "0.73807573", "text": "def is_all_lowercase?\n return self.downcase.eql? self\n end", "title": "" }, { "docid": "bac74b41b99024554780fe86eaf236f4", "score": "0.73807573", "text": "def is_all_lowercase?\n return self.downcase.eql? self\n end", "title": "" }, { "docid": "cc10b7d2a894afb00068b88a96b45cea", "score": "0.7257314", "text": "def has_only_uppercase_chars\n !get_cap_chars.empty? && get_lower_chars.empty?\n end", "title": "" }, { "docid": "f2fc13dc4b67f5add98d37448a8e9e2a", "score": "0.7252659", "text": "def _upcase\n if @IS_UPCASE\n\t@IS_UPCASE = false\n\tputs \"Disabled upcase mode\"\n else\n\t@IS_UPCASE = true\n\tputs \"Enabled upcase mode\"\n end\n return true\n end", "title": "" }, { "docid": "a30036676ec9e526aa04dd027b6dd8fc", "score": "0.7225967", "text": "def is_lower?(letter)\r\n letter != letter.upcase #if letter is not uppercase return true, else return false\r\nend", "title": "" }, { "docid": "d82e2e3d393f6798ff867f2db2906af2", "score": "0.72035116", "text": "def lowercase ; downcase ; end", "title": "" }, { "docid": "6c978e270f4920c051f70608c3d63d7b", "score": "0.72020817", "text": "def require_uppercase_characters\n data[:require_uppercase_characters]\n end", "title": "" }, { "docid": "0e6366fc03d9d477a00c16a6858b5b31", "score": "0.7196493", "text": "def is_lower?(c)\n return c != c.capitalize\n end", "title": "" }, { "docid": "86ea5a4704e6a500d5a748c99cf1ff67", "score": "0.7188318", "text": "def mixedcase?\n if self =~/[A-Z]/ and self =~/[a-z]/\n true\n else\n false\n end\n end", "title": "" }, { "docid": "1b3db199f2ab6309568df06ef383710a", "score": "0.7149867", "text": "def letters_is_downcase?(letters)\n return true if letters = letters.downcase\n return false\n end", "title": "" }, { "docid": "5dd9ac198269054f4a17771ff846a2ef", "score": "0.7142585", "text": "def downcase!\n modify = nil\n 0.upto(self.length - 1) do |i|\n cur = self[i].chr\n if isupper cur then\n self[i] = tolower cur\n modify = self\n end\n end\n\n return modify\n end", "title": "" }, { "docid": "f2b1045b7ecd2b71ad8925ee1e4f5b2b", "score": "0.71301883", "text": "def require_uppercase_characters\n data.require_uppercase_characters\n end", "title": "" }, { "docid": "4e36ef6d16291bb9c7fa3fb8fd98c483", "score": "0.711172", "text": "def letters_only(case_matters=false)\n just_letters = split('').find_all do |char| \n DUAL_CASE_ALPHABET.include?(char) \n end.join('')\n return just_letters if (case_matters)\n return just_letters.downcase\n end", "title": "" }, { "docid": "93849e1eaf331c89e1a29e0cc9878962", "score": "0.7110443", "text": "def is_uppercase_letter?(ascii)\n ascii >= 65 && ascii <= 90\nend", "title": "" }, { "docid": "aac6c99c6e1cb2be04b19fd253714edb", "score": "0.7031804", "text": "def pin_uppercase_letters\n return @pin_uppercase_letters\n end", "title": "" }, { "docid": "b34e375609ccdf9f691daab8737c1ef7", "score": "0.6989076", "text": "def alphabet(string)\n string == string.upcase\nend", "title": "" }, { "docid": "8d27b17b7497fff35d1e47888804e9ab", "score": "0.69873405", "text": "def is_uppercase?(word)\n word == word.upcase\nend", "title": "" }, { "docid": "afe34211a2eb25dc11639a5dafd76c61", "score": "0.6986933", "text": "def all_upper?\n tr('^A-Za-z', '').split('').all? { |c| ('A'..'Z').to_a.include? c }\n end", "title": "" }, { "docid": "c951a3ef02a147ef445de49485606fa4", "score": "0.69604164", "text": "def has_upcase?\n if self =~/[A-Z]/\n true\n else\n false\n end\n end", "title": "" }, { "docid": "37eb04955ac2688b5373fb50624b1eb9", "score": "0.6943318", "text": "def staggered_case(text, only_letters=true)\n result = ''\n need_upper = true\n text.each_char do |char|\n if char =~ /[a-z]/i\n result += ( need_upper ? char.upcase : char.downcase )\n need_upper = !need_upper\n else\n result += char\n need_upper = !need_upper if !only_letters\n end\n end\n result \nend", "title": "" }, { "docid": "64c8ef9777aa4e5aa1c804ca60af84fb", "score": "0.69346833", "text": "def old_uppercase?(str)\n str == str.upcase\nend", "title": "" }, { "docid": "e5458e21df8ff1e314ff88adbe7a5525", "score": "0.6927793", "text": "def all_caps(word)\n return word.upcase\nend", "title": "" }, { "docid": "34b743244343ae3b9157e78625ef94c1", "score": "0.6909286", "text": "def downcase?\n self.downcase == self\n end", "title": "" }, { "docid": "34b743244343ae3b9157e78625ef94c1", "score": "0.6909286", "text": "def downcase?\n self.downcase == self\n end", "title": "" }, { "docid": "216b33bdefa775c59f14a8b0c26de489", "score": "0.6907642", "text": "def is_lowercase_letter letter \n if letter == letter.downcase\n return true\n else return false\n end \nend", "title": "" }, { "docid": "36324ab5848b60632afe1349818147a8", "score": "0.6873073", "text": "def is_lower?(c)\r\n c >= \"a\" && c <= \"z\"\r\nend", "title": "" }, { "docid": "8868fe56a566bbf3b8ad0e047953e9f8", "score": "0.6871109", "text": "def is_uppercase?(orginial_value)\n orginial_value > 64 && orginial_value < 91\nend", "title": "" }, { "docid": "64485b0f9cbe8e4bb19d2209ab3c4cf5", "score": "0.6859914", "text": "def detect_capital_use(word)\n char_lower = nil\n \n word.each_char.with_index do |char, index|\n if index == 0 || (index == 1 && char_lower == false)\n char_lower = is_lower(char)\n \n next\n end\n \n return false if char_lower != is_lower(char) \n end\n \n true\nend", "title": "" }, { "docid": "d3993c6972ba3df1ae9689a5bb7d4897", "score": "0.685835", "text": "def upcase!\n modified = false\n\n 0.upto(self.length - 1) do |i|\n cur = self[i].chr\n if islower cur then\n self[i] = toupper cur\n modified = true\n end\n end\n\n return modified ? self : nil\n end", "title": "" }, { "docid": "39825783464f859d5a1d01a958457de9", "score": "0.6853174", "text": "def destructive_uppercase(str)\n answer = \"\"\n str.each_char do |chr|\n if chr.downcase != chr\n answer += chr\n end\n end\n return answer\nend", "title": "" }, { "docid": "634188b040aa363a9f658102acdac1f9", "score": "0.68145025", "text": "def valid_upcase?(char)\n char == char.upcase && char != char.swapcase\nend", "title": "" }, { "docid": "cb782e5775e9801d9860271ae4137823", "score": "0.68119055", "text": "def upcase?(letter)\n ('A'..'Z').include?(letter)\nend", "title": "" }, { "docid": "497c4aa7e1fbfc1799def4d8ae6dedc1", "score": "0.6796207", "text": "def is_lowercase_letter?(ascii) \n ascii >= 97 && ascii <= 122\nend", "title": "" }, { "docid": "d8a25558e6737bdb3cf0c3c5da4ca4ab", "score": "0.6792156", "text": "def all_caps(text)\n text.upcase unless text.length < 10\nend", "title": "" }, { "docid": "404ec1c8d2e08a3253eac30851394197", "score": "0.67880696", "text": "def is_lower?(c)\n\t\t\treturn c >= 'a' && c <= 'z'\n\t\tend", "title": "" }, { "docid": "1f6f52f14c654c824682d17f912a8d02", "score": "0.6787146", "text": "def force_upcase?\n @force_upcase\n end", "title": "" }, { "docid": "8b76945426fd557228341e414d8f9915", "score": "0.67797095", "text": "def all_caps(string)\n string.upcase\nend", "title": "" }, { "docid": "2d9ad3e29d6054d146c9fbd53845eafa", "score": "0.6774928", "text": "def staggered_case str\n lower = true\n arr1 = str.chars.map do |char|\n lower = (lower ? false : true) if char.match /[a-zA-Z]/ ## here is applying boolean = !boolean using the ternary\n lower ? char.downcase : char.upcase\n end\n arr1.join\nend", "title": "" }, { "docid": "54e20a8f18cf45f9304dc76bc6ba2891", "score": "0.6769546", "text": "def starts_with_uppercase? word\n if word =~ /^[A-Z]/\n return true\n end\n\n false\n end", "title": "" }, { "docid": "087cfe4e955bb3a5e23fd7cc26328d98", "score": "0.6758292", "text": "def alternate_case!\n # Since this is descending from string, we can define new methods here\n # and use them like we would gsub! or downcase!. I've chosen to use a\n # self-modifying form to match the above style.\n\n # Storage variables\n ret = \"\" # This time use a normal String\n previous_char = \"\"\n\n # Go through each character and upcase it if the previous character\n # was a lower-case consonant\n self.each_char do |char|\n if previous_char =~ /[b-df-hj-np-z]/\n char.upcase!\n end\n ret << char\n previous_char = char\n end\n\n # Use a destructive method already in String to replace self. We can't\n # just do `self = ret` because of a SyntaxError.\n return self.replace(ret)\n end", "title": "" }, { "docid": "156675c4e0c9b68535fb3a3ae0cbbe10", "score": "0.6757891", "text": "def destructive_uppercase(str)\n str.each_char do |ltr|\n str.delete! ltr if ltr == ltr.downcase\n end\nend", "title": "" }, { "docid": "3c067ee3a2a3d0becc68d095436f2e22", "score": "0.6756222", "text": "def swapcase!\n modified = false\n\n 0.upto(self.length - 1) do |i|\n cur = self[i].chr\n if isupper cur then\n self[i] = tolower cur\n modified = true\n elsif islower cur then\n self[i] = toupper cur\n modified = true\n end\n end\n\n return modified ? self : nil\n end", "title": "" }, { "docid": "7155e776425386b0ff3f8d614f5fd904", "score": "0.674834", "text": "def all_upcase?(name)\n return name == name.upcase\nend", "title": "" }, { "docid": "7e357305f30a58229fe2486f844f8e15", "score": "0.6736795", "text": "def is_downcase?\n self == downcase\n end", "title": "" }, { "docid": "68bcd04c5209beddfadfe7c5caff7bfc", "score": "0.67362565", "text": "def is_upcase?(letter) \r\n\t('A'..'Z').include?(letter)\r\nend", "title": "" }, { "docid": "95869eb772c93f9cc233be21eb79025a", "score": "0.67357296", "text": "def capitalized?\n self.match(/^[[:upper:]]/) ? true : false\n end", "title": "" }, { "docid": "13eea94e439c00f385c874d08929305b", "score": "0.672778", "text": "def hi_low_case(pass)\n if pass == pass.upcase || pass == pass.downcase\n false\n else\n true\n end\nend", "title": "" }, { "docid": "036232609c8e18a130295f7bfc3b39e3", "score": "0.67249596", "text": "def unicode_downcase() \n new_str = ''\n each_char do |c|\n new_str << ( (@@lowercase_letters[c]) ? @@lowercase_letters[c] : c.downcase )\n end\n new_str\n end", "title": "" }, { "docid": "14a608012793f66c3b9dcab5337c6750", "score": "0.6722504", "text": "def letters_is_upcase?(letters)\n return true if letters = letters.upcase\n return false\n end", "title": "" }, { "docid": "d905f588dab482b3cd86cb732d77b6d7", "score": "0.671566", "text": "def is_capitalized(word)\n\n# \tword[0] the chr at first index\n# \tword[1..-1] the chr's in the rest index\n\tif word[0] == word[0].upcase && word[1..-1] == word[1..-1].downcase\n \treturn true\n \telse\n \treturn false\n \tend\nend", "title": "" }, { "docid": "b2276c5e9f57cc8985948488e620632e", "score": "0.67102504", "text": "def capital_checker(talk) #return false if there's a lowercase letter\n lower_case = ('a'..'z').to_a\n i = 0\n n = talk.length - 1\n while i < n\n lower_case.each do |char|\n if talk[i] == char\n return false\n end\n end\n i += 1\n end\n return true\nend", "title": "" }, { "docid": "fd23de22483e011ada99320d9013e435", "score": "0.6705361", "text": "def is_upper?(c)\n return c == c.capitalize\n end", "title": "" }, { "docid": "83d99e4eb72dbca23ad072ebe726911a", "score": "0.67049205", "text": "def upcase!\n return if @num_bytes == 0\n self.modify!\n\n modified = false\n\n ctype = Rubinius::CType\n\n i = 0\n while i < @num_bytes\n c = @data[i]\n if ctype.islower(c)\n @data[i] = ctype.toupper!(c)\n modified = true\n end\n i += 1\n end\n\n modified ? self : nil\n end", "title": "" }, { "docid": "c83795324f0013c2a40c5e5ac253dd9c", "score": "0.66965854", "text": "def destructive_uppercase(str)\n result = \"\"\n str.each_char {|ch| result.concat(ch) if ch.downcase != ch}\n result\nend", "title": "" }, { "docid": "6474f25c596d4b11cf21d05233dbc3ce", "score": "0.6685805", "text": "def all_caps\n caps = \"This string is going to be all caps using the .upcase action!\\n\"\n puts caps.upcase\nend", "title": "" }, { "docid": "9605af2e64302b9c9d139576a7b4bc0f", "score": "0.6672182", "text": "def destructive_uppercase(str)\n result = \"\"\n chars = str.chars\n chars.each do |el|\n if el == el.downcase\n next\n else\n result << el\n end\nend\nresult\nend", "title": "" }, { "docid": "84b9592f18085a26fcb6d1b890f0720b", "score": "0.6669274", "text": "def make_caps(string)\n string.upcase\nend", "title": "" }, { "docid": "8f58099f29a532ff70820496f6175bad", "score": "0.6666984", "text": "def capital?(char)\n char.upcase == char\n end", "title": "" }, { "docid": "36442f6a0bc26fb067ec2fb208fb43f7", "score": "0.6666002", "text": "def _letter\n\n _save = self.pos\n while true # choice\n _tmp = apply(:_upcase_letter)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_downcase_letter)\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_letter unless _tmp\n return _tmp\n end", "title": "" }, { "docid": "36442f6a0bc26fb067ec2fb208fb43f7", "score": "0.6666002", "text": "def _letter\n\n _save = self.pos\n while true # choice\n _tmp = apply(:_upcase_letter)\n break if _tmp\n self.pos = _save\n _tmp = apply(:_downcase_letter)\n break if _tmp\n self.pos = _save\n break\n end # end choice\n\n set_failed_rule :_letter unless _tmp\n return _tmp\n end", "title": "" }, { "docid": "32465a6d4bb98d6873d0ea97edfc0e6e", "score": "0.66531104", "text": "def upper?(password)\n password.gsub(/[A-Z]/, '') != password\nend", "title": "" }, { "docid": "e27af2c6a6f492c453487e7ea918bbf4", "score": "0.6640488", "text": "def destructive_uppercase(str)\n res_str = \"\"\n\n i = 0\n while i < str.length\n char = str[i]\n res_str += char unless char == char.downcase\n i += 1\n end\n res_str\nend", "title": "" }, { "docid": "a1eba4a8c933c0772234931f8f871dd1", "score": "0.6640096", "text": "def staggered_case(string, letters_only = true)\n match = (letters_only ? /[a-z]/i : // )\n need_upper = true\n string.chars.each do |char|\n need_upper ? char.upcase! : char.downcase!\n need_upper = !need_upper if char =~ match\n end.join\nend", "title": "" }, { "docid": "0b1d39589ac7e90fc7e57707731dbffb", "score": "0.66223073", "text": "def destructive_uppercase(str)\n output = []\n str.each_char do |char|\n if char == char.downcase\n output << char\n end\n end\n p output.join\nend", "title": "" }, { "docid": "d0ffd79a4b31f9506cfb84793f0fc182", "score": "0.662224", "text": "def pin_lowercase_letters\n return @pin_lowercase_letters\n end", "title": "" }, { "docid": "1ab86bb2d0f486ee1675273013e6dd4a", "score": "0.6621725", "text": "def is_capital?(char)\n char >= \"A\" && char <= \"Z\"\n end", "title": "" }, { "docid": "d5bcf9c466610807536fe87e1e0da45e", "score": "0.66116875", "text": "def lowercase\n @lowercase ||= false\n end", "title": "" }, { "docid": "775100cd03342458ced3067e2cac8b80", "score": "0.6610221", "text": "def change_to_all_caps(word)\n if word.length > 10 \n word.upcase \n else\n word\n end\nend", "title": "" }, { "docid": "ab0f9a02a18cd6c9b7980d7cb88a4482", "score": "0.66094387", "text": "def destructive_uppercase(str)\n str.each_char { |ch| str.delete!(ch) if ch == ch.downcase }\nend", "title": "" }, { "docid": "ab0f9a02a18cd6c9b7980d7cb88a4482", "score": "0.66094387", "text": "def destructive_uppercase(str)\n str.each_char { |ch| str.delete!(ch) if ch == ch.downcase }\nend", "title": "" }, { "docid": "9a31da30ee07efd563e40d214ef58a3a", "score": "0.66009593", "text": "def weirdcase(str)\n \nend", "title": "" }, { "docid": "4514e8ad083988f740a47e430ef4215e", "score": "0.6595947", "text": "def case_sensitive; end", "title": "" }, { "docid": "4514e8ad083988f740a47e430ef4215e", "score": "0.6595947", "text": "def case_sensitive; end", "title": "" }, { "docid": "f6c761e66a0a898594d104e275278ff5", "score": "0.65932494", "text": "def upcase?\n self.upcase == self\n end", "title": "" }, { "docid": "f6c761e66a0a898594d104e275278ff5", "score": "0.65932494", "text": "def upcase?\n self.upcase == self\n end", "title": "" }, { "docid": "96e41369ac0cfc43ad8f82363e144759", "score": "0.65889275", "text": "def upcase?(str)\n ('A'..'Z').to_a.include?(str)\nend", "title": "" }, { "docid": "aa55f8b3b5ccded7c75f6dbf6a514065", "score": "0.65881085", "text": "def destructive_uppercase(str)\n # your code goes here\n result = \"\"\n str.chars.each {|ch, i| result << ch if ch != ch.upcase}\n result\nend", "title": "" }, { "docid": "e785dedd9331c9a6d473647c133b7b2f", "score": "0.65857005", "text": "def destructive_uppercase(str)\n str.chars.each do |ch|\n str.delete!(ch) if ch.downcase == ch\n end \n str\nend", "title": "" }, { "docid": "0ee9a700ae9dec7ae2f3fbca63b111e5", "score": "0.6580194", "text": "def uppercase?(str)\nend", "title": "" }, { "docid": "585c35dee6bfbb1423a8a0af3c67345e", "score": "0.65756303", "text": "def weirdcase string\nnew_string = \"\"\ndncase=false\n string.each_char do |char|\n if char == ' '\n new_string += ' '\n dncase=false\n elsif dncase\n new_string += char.downcase\n dncase = !dncase\n else \n new_string += char.upcase\n dncase = !dncase\n end\n end \n new_string\nend", "title": "" }, { "docid": "bb54f33f09d539011c14ca9f6be49291", "score": "0.6574963", "text": "def require_lowercase_characters\n data[:require_lowercase_characters]\n end", "title": "" }, { "docid": "286357db556991ad734fb66c1b9470d4", "score": "0.6571759", "text": "def uppercase2?(str)\n str !~ /[a-z]/\nend", "title": "" }, { "docid": "e7c73dcdf236d91791a71c0867a9a294", "score": "0.65672725", "text": "def downcase! \n end", "title": "" }, { "docid": "18a69bb97938c913f65d97c32e44a04b", "score": "0.6567263", "text": "def staggered_case(str)\n new_str = ''\n uppercase = true\n str.each_char do |char|\n if (char =~ /[A-z]/) && uppercase\n new_str << char.upcase\n uppercase = !uppercase\n elsif char =~ /[A-z]/\n new_str << char.downcase\n uppercase = !uppercase\n else\n new_str << char\n end\n end\n new_str\nend", "title": "" }, { "docid": "e233330165cb8b25b2821447f5a092d5", "score": "0.6562269", "text": "def downcase!\n end", "title": "" }, { "docid": "09a0fc12ce14cff50e92e7af42715db7", "score": "0.6559228", "text": "def is_upcase?\n self == upcase\n end", "title": "" }, { "docid": "c7756f40e80dd6eb3f9bb6e810db57b7", "score": "0.6554631", "text": "def destructive_uppercase(str)\n (str.chars - str.downcase.chars).join\nend", "title": "" }, { "docid": "e0bb5da5f08442e9538847b7c9d106f6", "score": "0.6553031", "text": "def capitalize!\n modify = nil\n first = self[0].chr\n if islower first then\n self[0] = toupper first\n modify = self\n end\n\n 1.upto(self.length - 1) do |i|\n cur = self[i].chr\n if isupper cur then\n self[i] = tolower cur\n modify = self\n end\n end\n\n return modify\n end", "title": "" }, { "docid": "fd62cc9cd1d70781ae1cea4019a77cb5", "score": "0.6548221", "text": "def vowels_with_case (letter)\n\n case letter\n when \"a\"\n true\n when \"e\"\n true\n when \"i\"\n true\n when \"o\"\n true\n when \"u\"\n true\n else\n false\n end\n\nend", "title": "" }, { "docid": "e2a9859384cae6ec5b0ece12b2d74e3c", "score": "0.653039", "text": "def destructive_uppercase(str)\n\n # An easy way to solve this question whith regular expression.\n # return str.gsub(/[a-z]/, '')\n\n\n # new_str = ''\n # str_idx = 0\n # while str_idx < str.length\n # ch = str[str_idx]\n # new_str << ch if ch == ch.upcase\n # str_idx += 1\n # end\n # new_str\n\n new_str = ''\n str.chars.each { |i| new_str << i if i == i.upcase }\n new_str\nend", "title": "" }, { "docid": "8ac8594155932e5110b3474389bf589b", "score": "0.65302896", "text": "def destructive_uppercase(str)\n str.each_char do |char|\n str.delete!(char) if char == char.downcase\n end\nend", "title": "" }, { "docid": "66d73b1ee1cd57a9c537e8e9daeec2ff", "score": "0.65290844", "text": "def vowels_with_no_if_or_case(letter)\n letter == \"a\" || letter == \"e\" || letter == \"i\" || letter == \"o\" || letter == \"u\"\nend", "title": "" }, { "docid": "ae4df882cd8914d96eb24506f0a11b60", "score": "0.652883", "text": "def staggered_case(s)\n new_s = \"\"\n need_uppercase = true\n s.chars.each do |char|\n if char =~ /[a-z]/i\n need_uppercase ? new_s << char.upcase : new_s << char.downcase\n need_uppercase = !need_uppercase\n else\n new_s << char\n end\n end\n new_s\nend", "title": "" }, { "docid": "849148701fae1e562f7d428ea95a131e", "score": "0.6528449", "text": "def all_caps(word)\r\n length = word.length\r\n if length > 10\r\n word.upcase\r\n else\r\n word\r\n end\r\nend", "title": "" }, { "docid": "54df4ac4f999c13f7947134a5afc688c", "score": "0.65273994", "text": "def all_caps(str)\n str.length >= 10 ? str.upcase : str\nend", "title": "" }, { "docid": "7a236a44899f34418252042090f0bfa1", "score": "0.6524185", "text": "def lowercase?(letter)\n\t\"a\".upto(\"z\").include?(letter)\nend", "title": "" }, { "docid": "edb4ada04c5887bc4fc6be4cb8b169ce", "score": "0.652341", "text": "def all_caps(str)\r\n if str.length > 10 \r\n\t str.upcase \r\n else \r\n\t str\r\n end\r\nend", "title": "" }, { "docid": "6ddfcd1e2da8edbf0deded5d1e30efe3", "score": "0.6521613", "text": "def staggered_case(string, count_non_alpha = nil)\n result = ''\n need_upper = true\n string.chars.each do |char|\n if need_upper && (char =~ /[a-zA-Z]/) == 0\n result += char.upcase\n need_upper = !need_upper\n elsif (char =~ /[a-zA-Z]/) == 0\n result += char.downcase\n need_upper = !need_upper\n else\n result += char\n need_upper = !need_upper if count_non_alpha.nil?\n end\n end\n result\nend", "title": "" }, { "docid": "33ef08a22e67a951aabc0ba8d18cd45d", "score": "0.6520917", "text": "def all_caps(words)\n words.length > 10 ? words.upcase : \"Input must be longer than 10 characters\"\nend", "title": "" }, { "docid": "b1c4c2b1d184d8dbf4b8d2efe1c0e926", "score": "0.65193695", "text": "def downcase\n end", "title": "" }, { "docid": "4c318604137e20ae7d2ee530103a2519", "score": "0.65131587", "text": "def all_letters_capitalized(chars)\n chars.map {|string| string.upcase}\nend", "title": "" } ]
2427e517932c929e20cd524025ba28c4
> defining Go! => 42
[ { "docid": "644bf7887f66173cfadbd62654def225", "score": "0.0", "text": "def meditate\n puts 'Adjusting posture...'\n p = Proc.new do\n puts 'Ringing bell...'\n next\n puts 'Getting distracted!'\n end\n p.call\n puts 'Sitting still...'\nend", "title": "" } ]
[ { "docid": "48c979f95d65b66ecb941e7e71370af0", "score": "0.63577956", "text": "def hello; :hello; end", "title": "" }, { "docid": "48c979f95d65b66ecb941e7e71370af0", "score": "0.63577956", "text": "def hello; :hello; end", "title": "" }, { "docid": "42a15877e51f4bf3b011b712b7f0abc5", "score": "0.5951066", "text": "def foo = bar 42", "title": "" }, { "docid": "81a8b19e747c8bccec115d8e4b664b4f", "score": "0.5840447", "text": "def go\n 33\n end", "title": "" }, { "docid": "e71246dfd6114c79391aecb4980e44bb", "score": "0.57735103", "text": "def fourth!; end", "title": "" }, { "docid": "e82c9ce861b40fca782e7fdd9b7f553d", "score": "0.5762124", "text": "def foo() 1 end", "title": "" }, { "docid": "e82c9ce861b40fca782e7fdd9b7f553d", "score": "0.5762124", "text": "def foo() 1 end", "title": "" }, { "docid": "bf328ce523c3d27f319d659965e8c912", "score": "0.5678897", "text": "def do!; end", "title": "" }, { "docid": "e98cc71a7e8f36997cbf44f7e0cd20c3", "score": "0.56534564", "text": "def third!; end", "title": "" }, { "docid": "801323d593c4ee01abc15012f4868897", "score": "0.55997294", "text": "def g; 1; end", "title": "" }, { "docid": "07771226abaaeff861e01fdafce7bcf3", "score": "0.55933505", "text": "def t__90!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 68)\n\n type = T__90\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 74:9: 'default'\n match(\"default\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 68)\n\n end", "title": "" }, { "docid": "672478cd6f4b5270191404a36bde3bda", "score": "0.5560755", "text": "def t__89!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 67)\n\n type = T__89\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 73:9: 'case'\n match(\"case\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 67)\n\n end", "title": "" }, { "docid": "5d3c95b79ce11e2cddd517e89fe6fb35", "score": "0.5513614", "text": "def t__97!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 75)\n\n type = T__97\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 81:9: 'goto'\n match(\"goto\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 75)\n\n end", "title": "" }, { "docid": "65889503a5856316c4074ed702982222", "score": "0.5513538", "text": "def bar=(_arg0); end", "title": "" }, { "docid": "cf6a5c7dbb0a81a5c0b2df7eead8d453", "score": "0.55049795", "text": "def = 3", "title": "" }, { "docid": "de5d8b4f6d4e47ac63d8e345428d077b", "score": "0.55017006", "text": "def koo(bar:)\n puts bar\nend", "title": "" }, { "docid": "de5d8b4f6d4e47ac63d8e345428d077b", "score": "0.55017006", "text": "def koo(bar:)\n puts bar\nend", "title": "" }, { "docid": "dabd6b9dc12ac485d40b7f6c93ca7968", "score": "0.548984", "text": "def give_me_the_answer\n\t42\nend", "title": "" }, { "docid": "669a520bf88e6e89a3e8a5317b9181b1", "score": "0.5486398", "text": "def hello(arg)\n def its_me(arg2)\n def i_heard(arg3)\n \"that you\"\n end\n end\nend", "title": "" }, { "docid": "fb282afc358e319a0ead4a98cb7ce96c", "score": "0.5462502", "text": "def target!; end", "title": "" }, { "docid": "fb282afc358e319a0ead4a98cb7ce96c", "score": "0.5462502", "text": "def target!; end", "title": "" }, { "docid": "b587555a24949776d899209e6a6e6e63", "score": "0.5459921", "text": "def bang\n 'bang'\nend", "title": "" }, { "docid": "b587555a24949776d899209e6a6e6e63", "score": "0.5459921", "text": "def bang\n 'bang'\nend", "title": "" }, { "docid": "721d1d99e045fda0c14e7d425b06ffb0", "score": "0.5450432", "text": "def g(*) end", "title": "" }, { "docid": "721d1d99e045fda0c14e7d425b06ffb0", "score": "0.5450432", "text": "def g(*) end", "title": "" }, { "docid": "0d83acca165bc6ec813c0b05c9ffe018", "score": "0.5446519", "text": "def bar\n 42\n end", "title": "" }, { "docid": "6ad51611a2a13bd63bff8cc0731d6885", "score": "0.54427856", "text": "def hello\n def its_me\n def i_heard\n \"that you\"\n end\n end\nend", "title": "" }, { "docid": "17e05e08d2dde3bf9a9b469d58fcdac8", "score": "0.5421994", "text": "def hello arg\n arg\nend", "title": "" }, { "docid": "115809be3651e7cdf558e8f89e4bb4e2", "score": "0.5415679", "text": "def hello; 'world'; end", "title": "" }, { "docid": "115809be3651e7cdf558e8f89e4bb4e2", "score": "0.5415679", "text": "def hello; 'world'; end", "title": "" }, { "docid": "2a8bc3856a8e4e4e45ca5d368f1034f0", "score": "0.5406097", "text": "def t__95!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 73)\n\n type = T__95\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 79:9: 'do'\n match(\"do\")\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 73)\n\n end", "title": "" }, { "docid": "1f5b134f72d30a7316e35deb3a264b74", "score": "0.5395189", "text": "def foo() 'bar' end", "title": "" }, { "docid": "84794f4731bec0a5db48f249cbd27ac7", "score": "0.53950226", "text": "def hello(who)\n return \"Hello #{who}!\"\nend", "title": "" }, { "docid": "a35714fad59812f32cfcf8845d38a7df", "score": "0.53921115", "text": "def __goto__ sym\n Reconsidered::Default_Labels.goto sym\n end", "title": "" }, { "docid": "96a3739945b55259797995d379c35608", "score": "0.53876215", "text": "def shakil_the_dog\nend", "title": "" }, { "docid": "8791909cb510750566bdff09157cd993", "score": "0.5377584", "text": "def t__86!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 31 )\n\n type = T__86\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 37:9: '=>'\n match( \"=>\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 31 )\n\n end", "title": "" }, { "docid": "033a3d7a6e943d12989d9daa0d5be801", "score": "0.53737676", "text": "def t__80!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 41 )\n\n\n\n type = T__80\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 47:9: 'ValueOf'\n match( \"ValueOf\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 41 )\n\n\n end", "title": "" }, { "docid": "28194302ae87e84b5bb841646363a10e", "score": "0.5368452", "text": "def default\n 42 # the ultimate answer\nend", "title": "" }, { "docid": "be9df83331cf8f943583dcfd12d4cea6", "score": "0.5348902", "text": "def hello_world\n 'Eha! Ruby'\nend", "title": "" }, { "docid": "2d0ea1f591a49226d3130afaa4262236", "score": "0.5344873", "text": "def greet\n \"Hi there!\"\nend", "title": "" }, { "docid": "d0c599836b2f925360903d4921e2f465", "score": "0.53436977", "text": "def greet_hello\n \"Hello\"\nend", "title": "" }, { "docid": "6e48b1cc6d2c695bc61bc17edd2bbe5b", "score": "0.53406334", "text": "def say_hello_to(name=\"Ruby\")\n\t\"Hello #{name}\"\nend", "title": "" }, { "docid": "7d7bc8e6d925d70229ed389d2b53aabc", "score": "0.5338485", "text": "def thing; end", "title": "" }, { "docid": "7af3f19cfed64aa77e25ba5e57fb405b", "score": "0.53325576", "text": "def second!; end", "title": "" }, { "docid": "7865f22c5508ffbee55285557b7504b5", "score": "0.53283703", "text": "def hello\n 'hello'\nend", "title": "" }, { "docid": "59178ecc41790241c512c78be0ef254c", "score": "0.5325036", "text": "def pass!; end", "title": "" }, { "docid": "59178ecc41790241c512c78be0ef254c", "score": "0.5325036", "text": "def pass!; end", "title": "" }, { "docid": "b50b1db0eee46c115188a91e55efd229", "score": "0.5320226", "text": "def foo\n 123\nend", "title": "" }, { "docid": "74eff7785e8de1a2143e18088b285780", "score": "0.5315577", "text": "def foo; end", "title": "" }, { "docid": "afd5fa63b54b6a9ce3d36d4910888167", "score": "0.5307752", "text": "def foo(x) 1 end", "title": "" }, { "docid": "afd5fa63b54b6a9ce3d36d4910888167", "score": "0.5307752", "text": "def foo(x) 1 end", "title": "" }, { "docid": "15703e9eb539b4dff957907362e77c47", "score": "0.5294736", "text": "def hi\n end", "title": "" }, { "docid": "1624022f51cc0303ab783664375bc651", "score": "0.5292606", "text": "def foo(bar)\n bar\nend", "title": "" }, { "docid": "5df11853d2366ec62f4a5ea75ed571b7", "score": "0.5287091", "text": "def greet\n 'Greetings!'\nend", "title": "" }, { "docid": "83d822c2ba03cc9dda3c5755185451fb", "score": "0.5281834", "text": "def foo(arg)\n\targ\nend", "title": "" }, { "docid": "7cdc441356cadd7f49ecb633086cf0f4", "score": "0.5281643", "text": "def greet!(name='dude')\n puts \"Hello #{name}!\" \n end", "title": "" }, { "docid": "fed8ab9c380d600ccc535f92208fbaea", "score": "0.52487564", "text": "def case=(_arg0); end", "title": "" }, { "docid": "54b5350c9d17930bbf49a1080455230a", "score": "0.5248427", "text": "def ninety_nine_bottles_of_beer\nend", "title": "" }, { "docid": "54b5350c9d17930bbf49a1080455230a", "score": "0.5248427", "text": "def ninety_nine_bottles_of_beer\nend", "title": "" }, { "docid": "54b5350c9d17930bbf49a1080455230a", "score": "0.5248427", "text": "def ninety_nine_bottles_of_beer\nend", "title": "" }, { "docid": "54b5350c9d17930bbf49a1080455230a", "score": "0.5248427", "text": "def ninety_nine_bottles_of_beer\nend", "title": "" }, { "docid": "54b5350c9d17930bbf49a1080455230a", "score": "0.5248427", "text": "def ninety_nine_bottles_of_beer\nend", "title": "" }, { "docid": "bc7b454d9cf064daf94daf319fbd3c65", "score": "0.5245678", "text": "def jump\n \"Saltando...\"\n end", "title": "" }, { "docid": "f77cde00a0d1d3de1931dd29879196b6", "score": "0.5239911", "text": "def foo; \"invoked foo\" end", "title": "" }, { "docid": "11c8ef58ede21a35e9aacc9d874b85a5", "score": "0.52394766", "text": "def geek; end", "title": "" }, { "docid": "1ea205cf0c350943fd3eaf62c30d9149", "score": "0.52326906", "text": "def three()\n 3\nend", "title": "" }, { "docid": "62e183c59bb2ed6a8e1d31612b9bcd26", "score": "0.5232601", "text": "def hello\n 'Hello!'\nend", "title": "" }, { "docid": "bfcc61857cfdff03a2a2cebf64ff47f2", "score": "0.5230783", "text": "def t__83!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 44 )\n\n\n\n type = T__83\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 50:9: 'auto'\n match( \"auto\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 44 )\n\n\n end", "title": "" }, { "docid": "38ea6cd047f72860e00e8a2edd274ed6", "score": "0.5230087", "text": "def foo x; end", "title": "" }, { "docid": "38ea6cd047f72860e00e8a2edd274ed6", "score": "0.5230087", "text": "def foo x; end", "title": "" }, { "docid": "ef55e2f7e7df89bd31ab202a580fa990", "score": "0.5224542", "text": "def foo\n 1\n end", "title": "" }, { "docid": "ff2527cbeff1a299f2771fd4b109dbde", "score": "0.52235", "text": "def t__130!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 91 )\n\n\n\n type = T__130\n channel = ANTLR3::DEFAULT_CHANNEL\n # - - - - label initialization - - - -\n\n\n # - - - - main rule block - - - -\n # at line 97:10: 'userimpl'\n match( \"userimpl\" )\n\n\n\n @state.type = type\n @state.channel = channel\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 91 )\n\n\n end", "title": "" }, { "docid": "88e4564d919f42894b88bba7f22d38da", "score": "0.52221036", "text": "def t__43!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 23 )\n\n type = T__43\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 32:9: 'return'\n match( \"return\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 23 )\n\n end", "title": "" }, { "docid": "37710de8944b53e1d6bfece133c46ad1", "score": "0.5220883", "text": "def greet(who)\n \"Hello, #{who}!\"\nend", "title": "" }, { "docid": "aee3674a6753bd3a70a5c1c3aa4d6b3c", "score": "0.52184427", "text": "def say_hello()\n 'hello'\nend", "title": "" }, { "docid": "3b86fe2d7e50802272a0be821786f285", "score": "0.5215073", "text": "def t__81!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 26 )\n\n type = T__81\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 32:9: '('\n match( 0x28 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 26 )\n\n end", "title": "" }, { "docid": "3a5cfc9495f339e70c7aac4adeb91681", "score": "0.52135116", "text": "def foo(x); end", "title": "" }, { "docid": "3a5cfc9495f339e70c7aac4adeb91681", "score": "0.52135116", "text": "def foo(x); end", "title": "" }, { "docid": "6fafc328f524b42fbad39c026d47287a", "score": "0.52086914", "text": "def t__44!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 27 )\n\n type = T__44\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 35:9: 'int'\n match( \"int\" )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 27 )\n\n end", "title": "" }, { "docid": "f6595558c07f226721f1df9dc58ff894", "score": "0.5206384", "text": "def say_hello_to(name)\n puts \"Hello #{name}\"\nend", "title": "" }, { "docid": "09dc0b2fb8c1e5a529306e5bb4fb18f9", "score": "0.5205273", "text": "def hello\n 'Hello'\nend", "title": "" }, { "docid": "09dc0b2fb8c1e5a529306e5bb4fb18f9", "score": "0.5205273", "text": "def hello\n 'Hello'\nend", "title": "" }, { "docid": "09dc0b2fb8c1e5a529306e5bb4fb18f9", "score": "0.5205273", "text": "def hello\n 'Hello'\nend", "title": "" }, { "docid": "09dc0b2fb8c1e5a529306e5bb4fb18f9", "score": "0.5205273", "text": "def hello\n 'Hello'\nend", "title": "" }, { "docid": "09dc0b2fb8c1e5a529306e5bb4fb18f9", "score": "0.5205273", "text": "def hello\n 'Hello'\nend", "title": "" }, { "docid": "09dc0b2fb8c1e5a529306e5bb4fb18f9", "score": "0.5205273", "text": "def hello\n 'Hello'\nend", "title": "" }, { "docid": "09dc0b2fb8c1e5a529306e5bb4fb18f9", "score": "0.5205273", "text": "def hello\n 'Hello'\nend", "title": "" }, { "docid": "09dc0b2fb8c1e5a529306e5bb4fb18f9", "score": "0.5205273", "text": "def hello\n 'Hello'\nend", "title": "" }, { "docid": "09dc0b2fb8c1e5a529306e5bb4fb18f9", "score": "0.5205273", "text": "def hello\n 'Hello'\nend", "title": "" }, { "docid": "301bfd6c86d2a43d0e8d5d5d57ebbc94", "score": "0.5197108", "text": "def foo\n \"foo\"\n end", "title": "" }, { "docid": "d62c0b6e09dab022b9eb673ad743731d", "score": "0.5196742", "text": "def t__44!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in(__method__, 22)\n\n type = T__44\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 28:9: ':'\n match(?:)\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out(__method__, 22)\n\n end", "title": "" }, { "docid": "da2fb12f8c81dc329d48e46f65ea03d0", "score": "0.51948863", "text": "def say_hello\n 'hello'\nend", "title": "" }, { "docid": "da2fb12f8c81dc329d48e46f65ea03d0", "score": "0.51948863", "text": "def say_hello\n 'hello'\nend", "title": "" }, { "docid": "da2fb12f8c81dc329d48e46f65ea03d0", "score": "0.51948863", "text": "def say_hello\n 'hello'\nend", "title": "" }, { "docid": "505fb8719cfc0114256c6c5c5a3829a2", "score": "0.5193663", "text": "def say_hi\n \"hi\"\nend", "title": "" }, { "docid": "4317f44da37bd817b925178e923f17e0", "score": "0.5189665", "text": "def meaning_of_life\n puts \"42\"\nend", "title": "" }, { "docid": "90162e2f2d8b0bf20c57ad289141835d", "score": "0.5184397", "text": "def t__93!\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 38 )\n\n type = T__93\n channel = ANTLR3::DEFAULT_CHANNEL\n\n \n # - - - - main rule block - - - -\n # at line 44:9: '$'\n match( 0x24 )\n\n \n @state.type = type\n @state.channel = channel\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 38 )\n\n end", "title": "" }, { "docid": "9f0eb22f3468b8f08a09cee130e00e32", "score": "0.5183292", "text": "def honk\n 'Loud!!!'\n end", "title": "" }, { "docid": "9f0eb22f3468b8f08a09cee130e00e32", "score": "0.5183292", "text": "def honk\n 'Loud!!!'\n end", "title": "" }, { "docid": "9f0eb22f3468b8f08a09cee130e00e32", "score": "0.5183292", "text": "def honk\n 'Loud!!!'\n end", "title": "" }, { "docid": "d4b2fd93f48df6f00546bc8cd10e8361", "score": "0.51831776", "text": "def hello\n 'Hello'\nend", "title": "" } ]
22015f94884db98b0dc0d146252ccfaf
Subject can be set in your I18n file at config/locales/en.yml with the following lookup: en.party_mailer.reminder.subject
[ { "docid": "945d9f07914e21724cbe2339ae199f12", "score": "0.0", "text": "def reminder(invite)\n @greeting = \"Hi\"\n @party = invite.party\n email = invite.user.email\n organizer_email = @party.organizer.email\n mail to: email, from: organizer_email , subject: \"Please RSVP!\"\n end", "title": "" } ]
[ { "docid": "ea740e704e8f1173fb87b45dfcaaf989", "score": "0.77905834", "text": "def subject_for(key)\n I18n.t(:subject, scope: [:mailer, key])\n end", "title": "" }, { "docid": "8928fe4f050d7ebd3e9aa992b07e320a", "score": "0.7732638", "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.7116688", "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": "c99eda28be9b3fe1f10546bb5e4340fb", "score": "0.7103043", "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": "6140e73ee355af7cdcaa1bec13316266", "score": "0.6973847", "text": "def subject\n @subject ||= @email.subject.to_s\n end", "title": "" }, { "docid": "dc7d12811f6d234ea98ad06ca7ef51d8", "score": "0.6958945", "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": "0057005be13d2471732baf09ab7f3e03", "score": "0.69439626", "text": "def subject\n \"[#{I18n.t('app_name')} #{Rails.env.upcase}] #{message.subject}\"\n end", "title": "" }, { "docid": "25da83c993ce4cf1f7b9941e027ed63a", "score": "0.69006383", "text": "def subject\n email_message.subject\n end", "title": "" }, { "docid": "75e4ae88ce617fd153e0a7564934bd04", "score": "0.6881338", "text": "def default_subject\n DEFAULT_SUBJECT\n end", "title": "" }, { "docid": "c4a674d85e621eef1f1b8d2584c5ccf4", "score": "0.6875826", "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": "a88f0f72dc91909c2d67b95574182c34", "score": "0.66860944", "text": "def subject\n @msg['Subject']\n end", "title": "" }, { "docid": "a88f0f72dc91909c2d67b95574182c34", "score": "0.66860944", "text": "def subject\n @msg['Subject']\n end", "title": "" }, { "docid": "8ce192cb0eeac1cca7c1d5f1295be992", "score": "0.66648597", "text": "def subject\n @subject ||= convert(Mail::Encodings.decode_encode(message.subject || '', :decode))\n end", "title": "" }, { "docid": "f2fecd58a29b9acf94ad3b95a78dc2e7", "score": "0.6641671", "text": "def welcome_email_subject\n @attributes[:welcome_email_subject]\n end", "title": "" }, { "docid": "0c3396cb0dae322e35cdf4231cd444d6", "score": "0.66108334", "text": "def formatted_subject(text)\n name = PersonMailer.global_prefs.app_name\n label = name.blank? ? \"\" : \"[#{name}] \"\n \"#{label}#{text}\"\n end", "title": "" }, { "docid": "ab155e65d0a7fb6e58826542bee8d360", "score": "0.66066295", "text": "def auto_reply_subject(enquiry)\n I18n.t('integral.contact_mailer.auto_reply.subject', reference: enquiry.reference)\n end", "title": "" }, { "docid": "65bc93ce070dc297b0749b44e859fbe2", "score": "0.6568599", "text": "def default_i18n_subject(interpolations = {})\n I18n.t(:subject, interpolations.merge(i18n_default_params))\n end", "title": "" }, { "docid": "dc0e2948b8652d7848b464a5ec15a020", "score": "0.6469076", "text": "def subject(string)\n self << \"SUBJECT\" << string\n end", "title": "" }, { "docid": "d559f396e2aaf6d814c15d1286fe3fa4", "score": "0.6468219", "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": "5b97accc2422140e68c3765af2839e19", "score": "0.6452763", "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": "d2f26cb27e81ae8b03fd141a0f231955", "score": "0.6412018", "text": "def subject=(subject); @message_impl.setSubject subject; end", "title": "" }, { "docid": "adc4d6f399275aa030fdd9d865497b26", "score": "0.63889986", "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": "de234bc160d6b9ea980e7d1cfb28d1e4", "score": "0.63753545", "text": "def subject\n SMail::MIME.decode_field(subject_raw)\n end", "title": "" }, { "docid": "0d214ce6c70e5f2f96c759e4cff712c7", "score": "0.63460255", "text": "def subject\n fetch('educator.subject')\n end", "title": "" }, { "docid": "519f685ed317139cbea72085c30086ef", "score": "0.6341051", "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": "8e5e8a32e59042d47143922abe60d271", "score": "0.6334203", "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.63030404", "text": "def email_changed(record, opts = {})\n opts[:subject] = \"#{default_title}: #{t(:email_changed)}\"\n super\n end", "title": "" }, { "docid": "01df34cad757e9ffe18fd8399921934c", "score": "0.6300453", "text": "def subject\n @config[\"subject\"]\n end", "title": "" }, { "docid": "dfa4ecb662f4081560f4e222e22056ef", "score": "0.6286738", "text": "def define_subject(subject)\n if subject =~ /^Re: /\n subject\n else\n \"Re: #{subject}\"\n end\n end", "title": "" }, { "docid": "2316f65233b6fb2d5ca6cbcf9856af69", "score": "0.62794125", "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": "20e4267b6397ef5409d8d48a8cdac18d", "score": "0.6270685", "text": "def add_default_subject\n self.subject = 'IMPORTANT!!!'\n end", "title": "" }, { "docid": "c6afc3626cbbe68cf6cd38b69eea3b85", "score": "0.62653446", "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": "d0e1de61fdd3b17c2381046c60ded7bd", "score": "0.6237887", "text": "def subject_name\n subject_full_name\n end", "title": "" }, { "docid": "086f3cabbe22eb51f456ff15266621f2", "score": "0.6206405", "text": "def subject=(s)\n msg = Message.new\n msg.subject = s\n send(msg)\n end", "title": "" }, { "docid": "3ced77486c3fe9f91298bd4216254c91", "score": "0.6206054", "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": "3595e96093bf4fdb3c90ed70810c54bc", "score": "0.6198515", "text": "def subject(string)\n return add_params(SUBJECT, string)\n end", "title": "" }, { "docid": "01135c890b85dbc9c9f897f87df4fe98", "score": "0.6196166", "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": "91927af29dd0e00c0374e761ec60174c", "score": "0.6169878", "text": "def subject_prefix\n return \"[#{SUBJECT_PREFIX}] \" if Object.const_defined?('SUBJECT_PREFIX')\n ''\n end", "title": "" }, { "docid": "1ed364e3ab9abb0823f0d98e397e066d", "score": "0.61562157", "text": "def email_subject_request\n # XXX pull out this general_register_office specialisation\n # into some sort of separate jurisdiction dependent file\n if self.public_body.url_name == 'general_register_office'\n # without GQ in the subject, you just get an auto response\n _('{{law_used_full}} request GQ - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title)\n else\n _('{{law_used_full}} request - {{title}}',:law_used_full=>self.law_used_full,:title=>self.title)\n end\n end", "title": "" }, { "docid": "d3fe97d40a71821834b836df97a93c27", "score": "0.613475", "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": "c467d463e8e174d4b909bb1a9e466b55", "score": "0.61346096", "text": "def subject\n envelope[:subject]\n end", "title": "" }, { "docid": "cf2a25634b64117bc458dafa8c7f8602", "score": "0.6125378", "text": "def subject=(s)\n self.cached_alert_group = nil\n attribute_set(:subject, s)\n end", "title": "" }, { "docid": "422b8a96f3d51add2d884b8ab82a0752", "score": "0.6111398", "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": "23eff6c61a6c900432383b9130c65add", "score": "0.6089882", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "3cde64e8bc6885ececa6b4c7ba5f4b3d", "score": "0.60724723", "text": "def send_reminders_text\n send_reminders ? t('yes_text') : t('no_texts')\n end", "title": "" }, { "docid": "4ff9c58cae5e6739edda949291e18f0b", "score": "0.607234", "text": "def subject=(text)\n self.subject_raw = SMail::MIME.encode_field(text)\n end", "title": "" }, { "docid": "6e74d38982d77ab2d4f1247a232115b0", "score": "0.6065949", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "d9d0a041b381d1a8f3701883a1622687", "score": "0.60625774", "text": "def subject_for_reply\n subject =~ REGARD_RE ? subject : \"Re: #{subject}\"\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6051986", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6051986", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6051986", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6051986", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6051986", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6051986", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "09fd44300aaaa367f6fa38dd31fcbb56", "score": "0.6051986", "text": "def subject=(value)\n @subject = value\n end", "title": "" }, { "docid": "0e679dd9a9eb0f4062d41f4be02e2f76", "score": "0.6040917", "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": "592a4cdad3b2f1f9377bb8994ad24ca8", "score": "0.60295004", "text": "def default_subject_prefix\n @default_subject_prefix || \"[VALIDATION ERROR]\"\n end", "title": "" }, { "docid": "35beeb99a41debf763c1e156b22cf4c5", "score": "0.6024034", "text": "def rezm_subject_and_status(email)\n if email.receiver_deleted?\n email.subject + \" (Deleted)\" \n elsif email.read_at.nil?\n email.subject + \" (Unread)\" \n else \n email.subject\n end\n end", "title": "" }, { "docid": "50f888854f638edf42618d35300fb025", "score": "0.6015508", "text": "def subject=( str )\n set_string_attr 'Subject', str\n end", "title": "" }, { "docid": "2d6331689dbede789150dacf78dbe51f", "score": "0.60077006", "text": "def subject( default = nil )\n if h = @header['subject']\n h.body\n else\n default\n end\n end", "title": "" }, { "docid": "8a5f0f8f2669885dc872baa7143b45c7", "score": "0.6005408", "text": "def subject_label=(label)\n @subject_label = label\n @subject_label_customized = true\n end", "title": "" }, { "docid": "5fb60ea7315445d7605e1eead17dd1e9", "score": "0.60001636", "text": "def subject\n env['trinity.subject']\n end", "title": "" }, { "docid": "acf6d147f72804aba88819156ef816a8", "score": "0.5978465", "text": "def subject=(subject)\n @subject=subject\n end", "title": "" }, { "docid": "6878d37f22ad2148cc944a89743c0f15", "score": "0.59736866", "text": "def set_title\n @title = t(:message_1, :scope => [:controller, :students])\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.5961863", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "9f95361cf5e95156660c6c2cbddcb24a", "score": "0.5961337", "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": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.59607136", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.59607136", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.59607136", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.59607136", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.59607136", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.59607136", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.59607136", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.59607136", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "1117fdba834d3a1af2cdb19084b1bec2", "score": "0.59607136", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "0aa1cc7584224f23051efac49931c5e7", "score": "0.59567755", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "0aa1cc7584224f23051efac49931c5e7", "score": "0.59567755", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "0aa1cc7584224f23051efac49931c5e7", "score": "0.59567755", "text": "def set_Subject(value)\n set_input(\"Subject\", value)\n end", "title": "" }, { "docid": "fa33adbf1eecc39bcd457b78590d6d3f", "score": "0.5952923", "text": "def subject=(s)\n\t\t@subject = s\n\tend", "title": "" }, { "docid": "d7d5a9a0a42ea8916b34a3e34963e03c", "score": "0.5902942", "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": "441e62b981d3668556119f56fbc674a3", "score": "0.58999425", "text": "def set_subject(default_subject)\n Rails.env.production? ? default_subject : \"TEST-#{default_subject}\"\n end", "title": "" }, { "docid": "e1f95e42613ea8ee932683cc1fb77251", "score": "0.58959323", "text": "def email_reminder(assignment)\n @assignment = assignment\n\n tag :scheduler, :reminders, :email_reminder\n mail to: format_address(assignment.person), subject: \"#{assignment.shift.name} on #{assignment.date.strftime(\"%b %d\")}\"\n end", "title": "" }, { "docid": "adab5fbcef94747391c4ce52e337047e", "score": "0.5884135", "text": "def subject=(subject)\n set_content_for :subject, subject\n end", "title": "" }, { "docid": "3017141db42381c7cc5da401735d5c9e", "score": "0.5876731", "text": "def subject\n read_content :subject\n end", "title": "" }, { "docid": "00b6a5821d086aac53df53d687eee6bd", "score": "0.58744967", "text": "def subject=(subject)\n Cproton.pn_message_set_subject(@impl, subject)\n end", "title": "" }, { "docid": "e6529fab337cc0a77049c4ebce974905", "score": "0.58725077", "text": "def reminder_email(reminder)\n @reminder = reminder\n mail(:to => reminder.user.email, :subject => \"Reminder for \" + reminder.name)\n end", "title": "" }, { "docid": "6a26cb28e002fcdcabff93f31a7d3216", "score": "0.58693206", "text": "def subject=(subject)\n @content[pn(:Subject)] = pl(subject)\n end", "title": "" }, { "docid": "40067e740df0f18749be727cea3569f4", "score": "0.5864495", "text": "def mailer_locale\n I18n.locale\n end", "title": "" }, { "docid": "f4f7fbf7a6c1b9a18070b243febadd82", "score": "0.5855595", "text": "def subject\n @message.split(/$/).first\n end", "title": "" }, { "docid": "f4f7fbf7a6c1b9a18070b243febadd82", "score": "0.5855595", "text": "def subject\n @message.split(/$/).first\n end", "title": "" }, { "docid": "d8decc4e6f01660c7e8f4bb726fe5ad1", "score": "0.58521163", "text": "def set_subject(s)\n self.subject = s\n self\n end", "title": "" }, { "docid": "53732f74790b6b444ae44583691fa9bd", "score": "0.5841317", "text": "def headers\n {\n :subject => I18n.t('ecm.contact_form.attributes.subscription_request.subject'),\n :to => \"[email protected]\",\n :from => %(\"#{fullname}\" <#{email}>)\n }\n end", "title": "" }, { "docid": "3e1425a9bedfe6a65d651b5d5841dbf2", "score": "0.5840257", "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": "98da9102c01851fa213c08ba869b9856", "score": "0.5831847", "text": "def subject=(subject)\n @subject = subject\n end", "title": "" }, { "docid": "845e4f68ce289ae4e1388b791bd21f8d", "score": "0.5826393", "text": "def set_title\n @title = t(:message_2, :scope => [:controller, :terms])\n end", "title": "" }, { "docid": "60a2d908c8044990c844333ae54c7235", "score": "0.58180594", "text": "def SetSubject(subject)\n #Subject of document\n @subject = subject\n end", "title": "" }, { "docid": "6d4608a5e67f4c4b648a55a632f7ee37", "score": "0.5802496", "text": "def set_reminder\n \n time_str = ((self.time).localtime).strftime(\"%I:%M%p on %b. %d, %Y\")\n body = \"Hi. Just a reminder that you have an birthday reminder for #{self.name} at #{time_str}.\"\n \n end", "title": "" }, { "docid": "0fa56be84c0a8c0710dcc8f6cd82ea6e", "score": "0.5802189", "text": "def subject\n ::Registeruz::Subject.find(@subject_id)\n end", "title": "" }, { "docid": "0bb51af8e2fb83533ca430c259063010", "score": "0.5793248", "text": "def subject(subj = nil)\n set_multi_simple(:subject, subj)\n end", "title": "" }, { "docid": "1f23f200a3e5878c4bd5453d4bf9dafe", "score": "0.5779007", "text": "def subject=(s)\n replace_element_text('subject', s)\n end", "title": "" }, { "docid": "7a71c38641a8e1e8d966f64a383149ae", "score": "0.5777912", "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": "" } ]
144cc1dc311f9bc5f0455e0d6bab43bb
TODO don't delete this, just deactivate it
[ { "docid": "702985786a1d2f88bee00218364fe080", "score": "0.0", "text": "def destroy\n authorize @case_assignment\n @case_assignment.destroy\n\n redirect_to after_action_path(case_assignment_parent)\n end", "title": "" } ]
[ { "docid": "de16896df674d9996b64636c57994b09", "score": "0.74109447", "text": "def deactivate; end", "title": "" }, { "docid": "de16896df674d9996b64636c57994b09", "score": "0.74109447", "text": "def deactivate; end", "title": "" }, { "docid": "8d19c5a7ff773bf998fad8e175eb5b88", "score": "0.7227477", "text": "def active; end", "title": "" }, { "docid": "8d19c5a7ff773bf998fad8e175eb5b88", "score": "0.7227477", "text": "def active; end", "title": "" }, { "docid": "8d19c5a7ff773bf998fad8e175eb5b88", "score": "0.7227477", "text": "def active; end", "title": "" }, { "docid": "8d19c5a7ff773bf998fad8e175eb5b88", "score": "0.7227477", "text": "def active; end", "title": "" }, { "docid": "88a62e6d2feef00849b3dca778ef7d9d", "score": "0.7210864", "text": "def reenable; end", "title": "" }, { "docid": "ca097545995bba092374cf5ab88c48b3", "score": "0.69620544", "text": "def active?; end", "title": "" }, { "docid": "ca097545995bba092374cf5ab88c48b3", "score": "0.69620544", "text": "def active?; end", "title": "" }, { "docid": "ca097545995bba092374cf5ab88c48b3", "score": "0.69620544", "text": "def active?; end", "title": "" }, { "docid": "ca097545995bba092374cf5ab88c48b3", "score": "0.69620544", "text": "def active?; end", "title": "" }, { "docid": "ca097545995bba092374cf5ab88c48b3", "score": "0.69620544", "text": "def active?; end", "title": "" }, { "docid": "ca097545995bba092374cf5ab88c48b3", "score": "0.69620544", "text": "def active?; end", "title": "" }, { "docid": "ca097545995bba092374cf5ab88c48b3", "score": "0.69620544", "text": "def active?; end", "title": "" }, { "docid": "ca097545995bba092374cf5ab88c48b3", "score": "0.69620544", "text": "def active?; end", "title": "" }, { "docid": "24e91241aa0a56befedf2c622bd42546", "score": "0.69115293", "text": "def disable!; end", "title": "" }, { "docid": "63591f9411dc13f72d9a787a6b73054d", "score": "0.68670726", "text": "def deactivate\n end", "title": "" }, { "docid": "63591f9411dc13f72d9a787a6b73054d", "score": "0.68670726", "text": "def deactivate\n end", "title": "" }, { "docid": "f7ea3fef0051ac2e6cd7e2d7ea959364", "score": "0.68449044", "text": "def disabled; end", "title": "" }, { "docid": "bbc8fed887f45fa65bee704e28f2663f", "score": "0.6761913", "text": "def disable!() tap { @active = false } end", "title": "" }, { "docid": "a7beb8f706dc15dc78848a11ab5419fb", "score": "0.67248213", "text": "def on_disable; end", "title": "" }, { "docid": "05367bab8cefba82024f64a8e9619739", "score": "0.6688034", "text": "def disable; @enabled = false; self end", "title": "" }, { "docid": "7ff2011fa3dc45585a9272310eafb765", "score": "0.6682196", "text": "def isolated; end", "title": "" }, { "docid": "46e34fc683de3dc92a707212e1d32ce3", "score": "0.66510874", "text": "def state_deactivated; end", "title": "" }, { "docid": "aff34fc26e66f3aa3373f8f04302fb97", "score": "0.6647734", "text": "def disable\n end", "title": "" }, { "docid": "994badedae4de2e0e5556868e21e170d", "score": "0.662814", "text": "def initialize\n self.active = false\n end", "title": "" }, { "docid": "3d8bd82974cc542b0b754c8df44e7981", "score": "0.6621877", "text": "def deactivate!\n return true # TODO add deactivate support for true\n end", "title": "" }, { "docid": "abe3c13037a9c3c5928175da8611d57f", "score": "0.66195333", "text": "def activate; end", "title": "" }, { "docid": "abe3c13037a9c3c5928175da8611d57f", "score": "0.66195333", "text": "def activate; end", "title": "" }, { "docid": "0cdaaf1b80a498cf224dfd73d95ff9f0", "score": "0.66124916", "text": "def cancellable; end", "title": "" }, { "docid": "0cdaaf1b80a498cf224dfd73d95ff9f0", "score": "0.66124916", "text": "def cancellable; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.65964997", "text": "def in_use; end", "title": "" }, { "docid": "6ab77a9219ee157923bc58599ba6aa77", "score": "0.65964997", "text": "def in_use; end", "title": "" }, { "docid": "0479a647479547c4e39cd9c33d29f8a3", "score": "0.6566015", "text": "def disable_all; end", "title": "" }, { "docid": "27974f9c5fa51e1d90ac720cbc4e67f0", "score": "0.64986926", "text": "def default_off\n @default_activated = false\n end", "title": "" }, { "docid": "a2585cff76cdfccc6be5d0bd40c96a15", "score": "0.64837027", "text": "def disabled?; end", "title": "" }, { "docid": "a2585cff76cdfccc6be5d0bd40c96a15", "score": "0.64837027", "text": "def disabled?; end", "title": "" }, { "docid": "a2585cff76cdfccc6be5d0bd40c96a15", "score": "0.64837027", "text": "def disabled?; end", "title": "" }, { "docid": "f00cd06004b5c1c3964b8269193fe816", "score": "0.6470041", "text": "def deactivate!\n\t\tself.active = 0\n\tend", "title": "" }, { "docid": "232275cee9ea48713d5fabf63521a7d0", "score": "0.6465178", "text": "def disable() @enabled = false end", "title": "" }, { "docid": "a6bd0768ba688eae72b081e4b80a184e", "score": "0.6461658", "text": "def enabled; end", "title": "" }, { "docid": "a6bd0768ba688eae72b081e4b80a184e", "score": "0.6461658", "text": "def enabled; end", "title": "" }, { "docid": "a6bd0768ba688eae72b081e4b80a184e", "score": "0.6461658", "text": "def enabled; end", "title": "" }, { "docid": "75bad3d28d369f5de4232a0a4a98feec", "score": "0.64493597", "text": "def enable!; end", "title": "" }, { "docid": "cd4c731b8f1929ad1f8023641c5f6e94", "score": "0.6445177", "text": "def activate!; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.6412133", "text": "def used; end", "title": "" }, { "docid": "33e1db3c06643dd523dcc31fccf3a005", "score": "0.6412133", "text": "def used; end", "title": "" }, { "docid": "abf4063ba21175349965f6ecddefc7d2", "score": "0.64012146", "text": "def isolated?; end", "title": "" }, { "docid": "9a7f1626647be04863d8ac461fc22b4f", "score": "0.63973117", "text": "def state_active; end", "title": "" }, { "docid": "6f45e4b71e44fc9ae5916c1a9e3e58ab", "score": "0.63966906", "text": "def evaporate!()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "6f45e4b71e44fc9ae5916c1a9e3e58ab", "score": "0.63966906", "text": "def evaporate!()\n #This is a stub, used for indexing\n end", "title": "" }, { "docid": "8069e05f0b9277e6a4bed29cfddced3f", "score": "0.6384484", "text": "def at_noon; end", "title": "" }, { "docid": "8069e05f0b9277e6a4bed29cfddced3f", "score": "0.6384484", "text": "def at_noon; end", "title": "" }, { "docid": "8069e05f0b9277e6a4bed29cfddced3f", "score": "0.6384484", "text": "def at_noon; end", "title": "" }, { "docid": "8069e05f0b9277e6a4bed29cfddced3f", "score": "0.6384484", "text": "def at_noon; end", "title": "" }, { "docid": "8069e05f0b9277e6a4bed29cfddced3f", "score": "0.6384484", "text": "def at_noon; end", "title": "" }, { "docid": "8069e05f0b9277e6a4bed29cfddced3f", "score": "0.6384484", "text": "def at_noon; end", "title": "" }, { "docid": "8069e05f0b9277e6a4bed29cfddced3f", "score": "0.6384484", "text": "def at_noon; end", "title": "" }, { "docid": "3cc846ec822d4096a061db4702b0e33e", "score": "0.6358095", "text": "def deactivate\r\n self.active = false\r\n end", "title": "" }, { "docid": "0d1f19f59cd2f1532417de7a7ac22a5b", "score": "0.6348438", "text": "def deactivate\n @active = false\n end", "title": "" }, { "docid": "1eba57436c4e9a28aaff0c100fbfa5ec", "score": "0.63439584", "text": "def enabled=(_); end", "title": "" }, { "docid": "922ad13267ad637c9292ec039c11884f", "score": "0.6338709", "text": "def obscured?; end", "title": "" }, { "docid": "602caa7a9552f94c5bccd1640b56b3c3", "score": "0.63298434", "text": "def deactivate()\n @isActive = false\n end", "title": "" }, { "docid": "d87284760f35341cf47df9644d06f115", "score": "0.6297435", "text": "def set_unactive\n self.active = false\n end", "title": "" }, { "docid": "53031cd580f73fc99ae5970269191452", "score": "0.6282343", "text": "def enable\n end", "title": "" }, { "docid": "73068497a6ac43af09c4f919b5de0290", "score": "0.6280929", "text": "def obsolete?; end", "title": "" }, { "docid": "ead3519379367526aedc61fc64b8cfc1", "score": "0.62751347", "text": "def reset\n @active = false\n end", "title": "" }, { "docid": "0a39799e76643367f1b6bfac65569895", "score": "0.62731576", "text": "def used?; end", "title": "" }, { "docid": "502c7fd9c7d5a7f8e40884218d07e04c", "score": "0.6268174", "text": "def disabled_all?; end", "title": "" }, { "docid": "f0bdc6e651c59739d20d9cfeb0a3fd5d", "score": "0.62605095", "text": "def exclusive_hook; end", "title": "" }, { "docid": "fff93610c1815ace30380f8fb64d2798", "score": "0.62564015", "text": "def deactivate!\n @status = false\n end", "title": "" }, { "docid": "78d62bfb15d9fe7c86806e05422b33be", "score": "0.62539613", "text": "def deactivate!\n @deactivate = true\n end", "title": "" }, { "docid": "56d882fbb20bacef86fa59ff9b14898c", "score": "0.6253173", "text": "def deactivate\n self.active = false\n self\n end", "title": "" }, { "docid": "56d882fbb20bacef86fa59ff9b14898c", "score": "0.6253173", "text": "def deactivate\n self.active = false\n self\n end", "title": "" }, { "docid": "f8329fa81994212b93ba3859290186b1", "score": "0.62330407", "text": "def restore_state; end", "title": "" }, { "docid": "14792482b9a5961e3fe44f2d3431b0d3", "score": "0.6232664", "text": "def active=(_arg0); end", "title": "" }, { "docid": "14792482b9a5961e3fe44f2d3431b0d3", "score": "0.6232664", "text": "def active=(_arg0); end", "title": "" }, { "docid": "14792482b9a5961e3fe44f2d3431b0d3", "score": "0.6232664", "text": "def active=(_arg0); end", "title": "" }, { "docid": "14792482b9a5961e3fe44f2d3431b0d3", "score": "0.6232664", "text": "def active=(_arg0); end", "title": "" }, { "docid": "b9a1cd5a3228e8bc02063b710c7c309a", "score": "0.622644", "text": "def obsolete; end", "title": "" }, { "docid": "4b6769bbdd84d325109e2ea675ff1877", "score": "0.6218446", "text": "def toggle\n super\n\n self\n end", "title": "" }, { "docid": "264ebcd1a3506a9d2e58aca555a0e446", "score": "0.6204686", "text": "def initialize\n super(false)\n end", "title": "" }, { "docid": "ec7f99bd984d5a58fa138af584dee885", "score": "0.6203424", "text": "def iniitialize\n \n end", "title": "" }, { "docid": "baabe5bb658b17a85353fb66fdbbf873", "score": "0.620047", "text": "def extended; end", "title": "" }, { "docid": "618919f3026281eadb484a3c3b9f5fcc", "score": "0.61987436", "text": "def on_enable; end", "title": "" }, { "docid": "caabce3fd5013061e1298dee080f2194", "score": "0.6197703", "text": "def update\n super if self.active\n end", "title": "" }, { "docid": "caabce3fd5013061e1298dee080f2194", "score": "0.6197703", "text": "def update\n super if self.active\n end", "title": "" }, { "docid": "caabce3fd5013061e1298dee080f2194", "score": "0.6197703", "text": "def update\n super if self.active\n end", "title": "" }, { "docid": "c11ddde856e97cd44fc8c7de677de767", "score": "0.6143885", "text": "def disabled_support; end", "title": "" }, { "docid": "811a92e871b1dd201d83a0539a8f2910", "score": "0.6134122", "text": "def shrivel\n # Do nothing for now.\n end", "title": "" }, { "docid": "8b608597e4f8cb342968a26900959e68", "score": "0.61337394", "text": "def extended?; end", "title": "" }, { "docid": "bad9ef2eaaa2bc4b17076905c21e7cc8", "score": "0.6133308", "text": "def reset()\r\n \r\n end", "title": "" }, { "docid": "d75c7529a52027a3fe78dfdb73b1e57c", "score": "0.6127114", "text": "def in_use?; end", "title": "" }, { "docid": "e1849c5860884418f9c249661e015b2c", "score": "0.6120894", "text": "def enabled?; end", "title": "" }, { "docid": "e1849c5860884418f9c249661e015b2c", "score": "0.6120894", "text": "def enabled?; end", "title": "" }, { "docid": "e1849c5860884418f9c249661e015b2c", "score": "0.6120894", "text": "def enabled?; end", "title": "" }, { "docid": "e1849c5860884418f9c249661e015b2c", "score": "0.6120894", "text": "def enabled?; end", "title": "" }, { "docid": "e94c8dd1b5ebc6e7369049c9a911a6bf", "score": "0.6108848", "text": "def inactive\n end", "title": "" }, { "docid": "e94c8dd1b5ebc6e7369049c9a911a6bf", "score": "0.6108848", "text": "def inactive\n end", "title": "" }, { "docid": "2290804b238fc95bfd6b38f87c6d2895", "score": "0.61016214", "text": "def override; end", "title": "" }, { "docid": "cba09abc19328d2ef6aabb77eff1bec4", "score": "0.60984695", "text": "def disabled=(_arg0); end", "title": "" } ]
18034ee4d5a9836305ad783a9ec2540c
GET /doit_lists GET /doit_lists.json
[ { "docid": "67a40b6b89d0658c65464856ddf70c98", "score": "0.75135195", "text": "def index\n @doit_lists = DoitList.all\n end", "title": "" } ]
[ { "docid": "c2c6c7fb0c49180e9474b8eff2409fd5", "score": "0.7966166", "text": "def lists\n\tget('/lists.json')\nend", "title": "" }, { "docid": "77a1d3e486268772863d6922fb51ab9a", "score": "0.71837693", "text": "def list\n JSON.parse get(\"list/json\")\n end", "title": "" }, { "docid": "f551724494c644ea0e6e368d06e26eda", "score": "0.6925352", "text": "def get_lists\n return base_uri('get', 'lists')\n end", "title": "" }, { "docid": "b5be5b0ea1ca23eb03bbafb385951e83", "score": "0.6868317", "text": "def index\n @lists = current_user.lists\n authorize! :read, @lists.first\n @lists= @lists.arrange\n\n respond_to do |format|\n format.html { redirect_to list_path(current_user.lists.first) }\n format.json { render json: List.json_tree(@lists) }\n end\n end", "title": "" }, { "docid": "b03dbe4b823c1a74621e282c819d565a", "score": "0.68406993", "text": "def set_doit_list\n @doit_list = DoitList.find(params[:id])\n end", "title": "" }, { "docid": "883907f89cec311b6e0d8d3d46d67ee1", "score": "0.6837536", "text": "def index\n @lists = List.all\n \n respond_to do |format|\n format.html { render \"listopia/lists/index\"}\n format.json { render json: @lists }\n end\n end", "title": "" }, { "docid": "c41ef911434ceaca7fae567728e40333", "score": "0.6787906", "text": "def lists\n\t\tlistable = Listable.find_by_id(params['listable_id'])\n\t\tunless listable\n\t\t\trender :json => 'not found' , :status => :not_found\n\t\t\treturn\n\t\tend\n\t\tlists = List.where :name => listable.name\t\n\t\trender :json => lists.to_json\n\tend", "title": "" }, { "docid": "6f7776a19620d3334a555c8f39b50e0c", "score": "0.67768544", "text": "def get_lists\n api_get(:list, {})\n end", "title": "" }, { "docid": "8ceb9605b2326472ab7847ce63720b51", "score": "0.67545503", "text": "def index\n @lists = List.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lists }\n end\n end", "title": "" }, { "docid": "8ceb9605b2326472ab7847ce63720b51", "score": "0.67545503", "text": "def index\n @lists = List.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lists }\n end\n end", "title": "" }, { "docid": "e26209806ebc11e244460e7504fb058d", "score": "0.6721354", "text": "def index\n @items = Item.where(:list_id => @list.id)\n render json: @items\n end", "title": "" }, { "docid": "85665d37f3e4ac0651bf4d202fd810fa", "score": "0.66666645", "text": "def checklists()\n json_call Net::HTTP::Get.new(\"/checklists.json\")\n end", "title": "" }, { "docid": "806f06196f725d7e7dd90b0f04c1e52a", "score": "0.6650466", "text": "def list(list)\n response = form_response(list, true)[1]\n if Net::HTTPSuccess === response\n i = 1\n page = JSON.parse(response.body)\n puts \"\"\n page.each do |task|\n puts(\"#{i}: Task => \\\"#{task[\"task\"][\"content\"]}\\\" at => #{Time.parse(task[\"task\"][\"created_at\"]).strftime(\"%m-%d-%Y %H:%M %p\")} (Completed? #{task[\"task\"][\"completed\"]})\") \n i = i+1\n end\n if page.empty? \n puts \"Oops, that list doesn't have any items yet!\"\n puts \"Try: fluttrly post #{list} <message> first.\"\n return false\n end\n page\n else \n response.error! \n end\n end", "title": "" }, { "docid": "6253467d54c67b7eeff394f32e24d317", "score": "0.66301817", "text": "def index\n user = Account.find(params[:account_id])\n @lists = user.lists\n json_response(@lists)\n end", "title": "" }, { "docid": "cdd72f75915663f0c2f12a3b3ccd5214", "score": "0.6599498", "text": "def index\n @tasklists = @project.tasklists\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasklists }\n end\n end", "title": "" }, { "docid": "2f8ad82902263b0235eac2668577df99", "score": "0.6588424", "text": "def index\n @task_lists = TaskList.all\n render json: @task_lists, status: 200\n end", "title": "" }, { "docid": "472771bb98b682f9a7146944f7ead82c", "score": "0.65806854", "text": "def index\n @lists = List.find_all_by_user_id(current_user)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @lists }\n end\n end", "title": "" }, { "docid": "005225439f5ef107aba338963dfc8a47", "score": "0.65796274", "text": "def get_items\n render json: { items: @list.items }\n end", "title": "" }, { "docid": "a1b9f735521f97face7bd376b4f0f97d", "score": "0.6564446", "text": "def index\n\t\t\n @list = List.find(params[:list_id])\n @goals = @list.goals.paginate(page: params[:page], per_page: 5)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @list }\n end\n end", "title": "" }, { "docid": "d1434f155f1a3633f860e475841c4abd", "score": "0.6562918", "text": "def index\n @lists = MailingList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lists }\n end\n end", "title": "" }, { "docid": "66d51fd18558e806fe71121dc2bc49ec", "score": "0.6530528", "text": "def get_lists\n answer = @api.lists.get\n short_answer = {\n 'total_items' => answer['total_items']\n }\n short_answer['lists'] = answer['lists'].map do |i|\n i.slice('id', 'web_id', 'name')\n end\n\n pp(short_answer) if @debug == true\n short_answer\n end", "title": "" }, { "docid": "e8426c94c2dfac7fca3b6b20298fd8f8", "score": "0.6529513", "text": "def get_list(list_id:)\n JSON.parse(api_request(method: :get, path: \"lists/#{list_id}\"))\n end", "title": "" }, { "docid": "273f2d55b63fde1bc52ee25b059c7caf", "score": "0.65188146", "text": "def get_list(list)\n api_get(:list, {:list => list})\n end", "title": "" }, { "docid": "6fe7369c75e040a208c88b665d5254fa", "score": "0.65125877", "text": "def index\n @todo_items = @todo_list.todo_items\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @todo_items }\n end\n end", "title": "" }, { "docid": "2f2591a31887722879bc290f503c7436", "score": "0.65039825", "text": "def index\n @list_items = ListItem.all\n\n respond_to do |format|\n format.html { render \"listopia/list_items/index\"}\n format.json { render json: @list_items }\n end\n end", "title": "" }, { "docid": "3722aad9c87c79e436f207f759162837", "score": "0.64881325", "text": "def list(list_name)\n get \"#{base_url}/lists/#{list_name}\"\n end", "title": "" }, { "docid": "5797f8af03cd8341df724a8c796dbbd9", "score": "0.64849514", "text": "def list\n json_output(@status = 200, @success = true, @data = [ 'Apple', 'Banana', 'Coconut']) and return\n end", "title": "" }, { "docid": "380881fd5d28543098cbe710197f52f5", "score": "0.6464194", "text": "def lists\n end", "title": "" }, { "docid": "a288bba773f8202f03bc0704c1a24ff5", "score": "0.6463173", "text": "def index\n\t\tif params[:list_id] and (is_number?(params[:list_id]))\n\t\t\tsession[:list_id] = params[:list_id]\n\t\tend\n\t\tif !(User.find(session[:user_id]).lists.include?(List.find_by_id(session[:list_id])))\n\t\t\tsession[:list_id] = User.find(session[:user_id]).lists[0].id\n\t\tend\n\t\tif params[:comp] and ( params[:comp] == 't' or params[:comp] == 'f' )\n\t\t\t@find_completed = params[:comp]\n\t\telse\n\t\t\t@find_completed = 'f'\n\t\tend\n\t\t@items = List.find(session[:list_id]).items.find_all_by_completed(@find_completed, :order => 'due_date, name')\n\n\t\trespond_to do |format|\n\t\t\tformat.html # index.html.erb\n\t\t\tformat.xml\t{ render :xml => @items }\n\t\tend\n\tend", "title": "" }, { "docid": "ac38df720cc89336e4f28a37421a4091", "score": "0.64539593", "text": "def index\n @mylists = Mylist.all\n @status = \"ok\"\n @message = \"\"\n render :json, template: \"mylists/index.json.jbuilder\"\n end", "title": "" }, { "docid": "9330d1be13ae7e09a488c1b2c6f3b2fa", "score": "0.64521945", "text": "def index\n @lists = current_user.accessible_lists.search(params)\n @title = t('labels.list.open')\n respond_with(@list)\n end", "title": "" }, { "docid": "8db78faa24a32efa66e42108bf9fac41", "score": "0.64508843", "text": "def all\n get('lists')\n end", "title": "" }, { "docid": "769a6e0ea07292cb5714e6a90826d9da", "score": "0.64492714", "text": "def list\n get('/')\n end", "title": "" }, { "docid": "9af161d86bcc3f78e29c276d384aa1e1", "score": "0.6434705", "text": "def index\n respond_with ListType.all\n end", "title": "" }, { "docid": "e4e3cc5e81a0c03a65f7a220c073d3ec", "score": "0.6434668", "text": "def list\n response = get \"list\"\n msg response, Logger::DEBUG\n return response\n end", "title": "" }, { "docid": "1c55646d5e712338657859fa0324e287", "score": "0.6430685", "text": "def index\n @nico_list = NicoList.new\n @nico_lists = NicoList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @nico_lists }\n end\n end", "title": "" }, { "docid": "1e387ecd12ec0494c11b5ff9ea04e911", "score": "0.6425497", "text": "def create\n @doit_list = DoitList.new(doit_list_params)\n\n respond_to do |format|\n if @doit_list.save\n format.html { redirect_to @doit_list, notice: 'Doit list was successfully created.' }\n format.json { render :show, status: :created, location: @doit_list }\n else\n format.html { render :new }\n format.json { render json: @doit_list.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "97624a9f2db92b06a455aeb166f9b585", "score": "0.6421947", "text": "def index\n @lists = List.all_public\n respond_with(@lists)\n end", "title": "" }, { "docid": "02ec141ed80e78e4f273624377539aef", "score": "0.64179784", "text": "def index\n @list = List.find(params[:list_id])\n @todos = @list.todos.paginate(page: params[:page], per_page: 5)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @list }\n end\n end", "title": "" }, { "docid": "c68f1d905238fd9174d10a1aeae6aae0", "score": "0.63775384", "text": "def index\n @lists = @page.lists.find(:all)\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lists }\n end\n end", "title": "" }, { "docid": "5a0ad3fe68ca112df1add095f79434a7", "score": "0.6343087", "text": "def doit_list_params\n params.require(:doit_list).permit(:title, :description)\n end", "title": "" }, { "docid": "c0b66cb885cf50da13fc3939c4b7fb3a", "score": "0.63399994", "text": "def index\n @question_lists = QuestionList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @question_lists }\n end\n end", "title": "" }, { "docid": "4152b8134039d82046a5710e8cff9c8f", "score": "0.633458", "text": "def show\n respond_with(@list)\n end", "title": "" }, { "docid": "03e72588ca0dca27e3455cad70fdb8ab", "score": "0.63338083", "text": "def json_respond(list) \n respond_to do |format|\n format.json{ render :json => list }\n end\n end", "title": "" }, { "docid": "0cd001eef4834c64e6d6db58ffa9b64e", "score": "0.63297343", "text": "def list\n\n end", "title": "" }, { "docid": "9b7a79ba8548aff39f99c6c03750dae4", "score": "0.6314398", "text": "def get_lists (page = nil, max = nil, opts={})\n query_param_keys = [:page,:max]\n headerParams = {}\n\n \n \n # set default values and merge with input\n options = {\n :'page' => page,\n :'max' => max\n \n }.merge(opts)\n\n #resource path\n path = \"/get-lists.json\".sub('{format}','json')\n \n # pull querystring keys from options\n queryopts = options.select do |key,value|\n query_param_keys.include? key\n end\n\n # header parameters\n headers = {}\n\n _header_accept = 'application/json'\n if _header_accept != ''\n headerParams['Accept'] = _header_accept\n end \n _header_content_type = ['application/x-www-form-urlencoded']\n headerParams['Content-Type'] = _header_content_type.length > 0 ? _header_content_type[0] : 'application/json'\n\n \n \n headers[:'Authorization'] = @api_key_secret\n\n # http body (model)\n post_body = nil\n \n # form parameters\n form_parameter_hash = {}\n \n \n \n Swagger::Request.new(:POST, path, {:params=>queryopts,:headers=>headers, :body=>post_body, :form_params => form_parameter_hash }).make\n \n \n end", "title": "" }, { "docid": "b7944580f9bc131be209caf1f0c530a7", "score": "0.6292062", "text": "def index\n list\n render('list')\n end", "title": "" }, { "docid": "544f8fa3abccb1cf5b79797b29fc658e", "score": "0.6287193", "text": "def index\n list\n render('list')\n end", "title": "" }, { "docid": "544f8fa3abccb1cf5b79797b29fc658e", "score": "0.6287193", "text": "def index\n list\n render('list')\n end", "title": "" }, { "docid": "544f8fa3abccb1cf5b79797b29fc658e", "score": "0.6287193", "text": "def index\n list\n render('list')\n end", "title": "" }, { "docid": "1dca2b204cdcb70b1e326f2db68a74eb", "score": "0.62771255", "text": "def create_list\n agent = login_action(params[:u],params[:pw])\n agent.post('/eg/opac/myopac/list/update?loc=22', {\n \"loc\" => '22',\n \"name\" => params[:title],\n \"action\" => 'create',\n \"description\" => params[:desc],\n \"shared\" => params[:share]\n })\n list_page = agent.get('https://catalog.tadl.org/eg/opac/myopac/lists?')\n doc = list_page.parser\n list_title = 'a:contains(\"'+params[:title]+'\")'\n list_id = doc.at_css(list_title).attr('href').gsub('/eg/opac/myopac/lists?bbid=','')\n respond_to do |format|\n format.json { render :json => { :list_id => list_id } }\n end\nend", "title": "" }, { "docid": "c8e42d54dca4731ec31c7b1965879885", "score": "0.62737226", "text": "def index\n @todos = current_list.todos\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @todos }\n end\n end", "title": "" }, { "docid": "18f6ba308fdb6a1009d0edfca62f5f75", "score": "0.62584466", "text": "def index\n @list_urls = ListUrl.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @list_urls }\n end\n end", "title": "" }, { "docid": "15fddbeafa5832ee257b628cc754c3fb", "score": "0.62438715", "text": "def index\n @main_worklists = MainWorklist.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @main_worklists }\n end\n end", "title": "" }, { "docid": "487114df283cb851d35b2c3b008cf6ce", "score": "0.62395275", "text": "def list\n end", "title": "" }, { "docid": "487114df283cb851d35b2c3b008cf6ce", "score": "0.62395275", "text": "def list\n end", "title": "" }, { "docid": "568b4b69a8de7488fc18ccefc065d715", "score": "0.62346435", "text": "def index\n base_scope = Todo.with_list_id(list.id).order(:created_at)\n if @view_completed = (params[:view] == 'completed')\n @todos = base_scope.completed\n else\n @todos = base_scope.not_completed + [Todo.new]\n end\n respond_to do |format|\n format.html\n format.json { render json: @todos }\n end\n end", "title": "" }, { "docid": "6756007d5c219d9a13f3a127d64c7ac1", "score": "0.62329715", "text": "def show_list(id)\n get(\"lists/#{id}\")\n end", "title": "" }, { "docid": "224cba53851de4f6b8256189172fd585", "score": "0.6230467", "text": "def list_items\r\n prepare_element\r\n get(:type => :list_item, :scope => :children, :how_many => :all)\r\n end", "title": "" }, { "docid": "3ff66b41a492da5c1ce40dd6f2e9eca4", "score": "0.6229299", "text": "def my_list(*args)\n @response\n end", "title": "" }, { "docid": "4e1e33bffec558d0cdfda1e3ff25a4fb", "score": "0.6217013", "text": "def test_list\n get :list, :params => { :format => \"html\" }\n assert_response :success\n assert_template \"history\"\n assert_template :layout => \"map\"\n assert_select \"h2\", :text => \"Changesets\", :count => 1\n\n get :list, :params => { :format => \"html\", :list => \"1\" }, :xhr => true\n assert_response :success\n assert_template \"list\"\n\n check_list_result(Changeset.all)\n end", "title": "" }, { "docid": "d92ce9d458bc2a9cab727194741a781f", "score": "0.62148273", "text": "def index\n @org_lists = OrgList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @org_lists }\n end\n end", "title": "" }, { "docid": "87d2e89fd7b40ecdf349e105e4893b5d", "score": "0.6212947", "text": "def index\n @elilists = Elilist.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @elilists }\n end\n end", "title": "" }, { "docid": "c04672d55b73443db9244151b917b00c", "score": "0.6196422", "text": "def show\n\n @list = List.find(params[:list_id])\n @goal = @list.goals.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end", "title": "" }, { "docid": "4af4257a24245dd9a1c96ca1d2ea3f82", "score": "0.61954665", "text": "def show\n @list = List.find(params[:list_id])\n @todo = @list.todos.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end", "title": "" }, { "docid": "6a632cae531d3864ac51d575ee6faf52", "score": "0.6177373", "text": "def index\n @lists = List.all\n end", "title": "" }, { "docid": "6a632cae531d3864ac51d575ee6faf52", "score": "0.6177373", "text": "def index\n @lists = List.all\n end", "title": "" }, { "docid": "6a632cae531d3864ac51d575ee6faf52", "score": "0.6177373", "text": "def index\n @lists = List.all\n end", "title": "" }, { "docid": "6a632cae531d3864ac51d575ee6faf52", "score": "0.6177373", "text": "def index\n @lists = List.all\n end", "title": "" }, { "docid": "6a632cae531d3864ac51d575ee6faf52", "score": "0.6177373", "text": "def index\n @lists = List.all\n end", "title": "" }, { "docid": "6a632cae531d3864ac51d575ee6faf52", "score": "0.6177373", "text": "def index\n @lists = List.all\n end", "title": "" }, { "docid": "6a632cae531d3864ac51d575ee6faf52", "score": "0.6177373", "text": "def index\n @lists = List.all\n end", "title": "" }, { "docid": "6a632cae531d3864ac51d575ee6faf52", "score": "0.6177373", "text": "def index\n @lists = List.all\n end", "title": "" }, { "docid": "4c14858be6bf62defc4d9959d48c4daa", "score": "0.61743104", "text": "def api_index(type, list)\n return {:json=>list, :content_type=>cb_content_type(type, \"list\") }\n end", "title": "" }, { "docid": "2e70b027401b75a77393389f324eb65a", "score": "0.6154866", "text": "def index\n @shopping_lists = @dwelling.shopping_lists\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @shopping_lists }\n end\n end", "title": "" }, { "docid": "8c55084420703a4157e096ca3e235d93", "score": "0.6154676", "text": "def index\n @to_do_lists = ToDoList.all\n end", "title": "" }, { "docid": "07419673a35f6a48bb266ddc3f81acaf", "score": "0.61536986", "text": "def lists\n response = get 'lists'\n response.map{|item| Hashie::Mash.new(item)}\n end", "title": "" }, { "docid": "07419673a35f6a48bb266ddc3f81acaf", "score": "0.61536986", "text": "def lists\n response = get 'lists'\n response.map{|item| Hashie::Mash.new(item)}\n end", "title": "" }, { "docid": "482793b75172abd0cf2cd39608b8a793", "score": "0.6151525", "text": "def index\n @my_lists = MyList.all\n end", "title": "" }, { "docid": "482793b75172abd0cf2cd39608b8a793", "score": "0.6151525", "text": "def index\n @my_lists = MyList.all\n end", "title": "" }, { "docid": "8c5b562261dfcd8dc32264ca5be79e83", "score": "0.6151023", "text": "def dropletList()\n http, req = initReq(\"droplets/\")\n JSON.parse(http.request(req).body)\nend", "title": "" }, { "docid": "8c5b562261dfcd8dc32264ca5be79e83", "score": "0.6151023", "text": "def dropletList()\n http, req = initReq(\"droplets/\")\n JSON.parse(http.request(req).body)\nend", "title": "" }, { "docid": "a566a41fc8441bab757bcf463be62c89", "score": "0.6139248", "text": "def index\n @mylists = Mylist.all\n end", "title": "" }, { "docid": "e0353152d1fc8f78b929d2da2b579fdf", "score": "0.6139121", "text": "def list\n return nil unless list_id\n\n @list ||= TodoableApi::List.find(list_id)\n end", "title": "" }, { "docid": "b4cf1057b4a3d199d98bc26631b8bb04", "score": "0.6136045", "text": "def index\n respond_with(items)\n end", "title": "" }, { "docid": "c2df44be4de21c1d637f44b863f57e6d", "score": "0.61339617", "text": "def index\n # get items from the parent list\n @items = @list.items\n # create a new item for the ajax form to use\n @item = Item.new\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @items }\n end\n end", "title": "" }, { "docid": "e554d51ae9ccf1873752695fcac28ee3", "score": "0.6130921", "text": "def list # for testing \n\tend", "title": "" }, { "docid": "12542439a04f77fa127dade88247ab45", "score": "0.6129976", "text": "def index\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @todo_lists }\n format.json { render :json => @todo_lists}\n end\n end", "title": "" }, { "docid": "b32da14cbe107e1c87dea9283973f630", "score": "0.6123447", "text": "def index\n render json: WorkingList.order(:jour_id, :work_id)\n end", "title": "" }, { "docid": "74c0693f7812856c54a484af8dbc1191", "score": "0.6119731", "text": "def show\n @list = TodoList.find(params[:id])\n \n respond_to do |format|\n format.html\n format.json { render json: {\n success: true, \n data: [@list], \n message: \"TodoList found.\"\n }}\n end\n end", "title": "" }, { "docid": "9f5089fcce5d020c91699bb138d645cc", "score": "0.6119359", "text": "def index\n @lists = List.all\n\n render :json => {\n :lists => @lists\n }\n CallsWorker.perform_async()\n end", "title": "" }, { "docid": "9b916bbc664d70d98e8e87714c70bb68", "score": "0.61167294", "text": "def index\n @word_lists = WordList.order(\"due_date desc\")\n\n# puts @word_lists.inspect\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @word_lists }\n end\n end", "title": "" }, { "docid": "7bab520e8eeef165fe2bbc487d508921", "score": "0.61101836", "text": "def update\n respond_to do |format|\n if @doit_list.update(doit_list_params)\n format.html { redirect_to @doit_list, notice: 'Doit list was successfully updated.' }\n format.json { render :show, status: :ok, location: @doit_list }\n else\n format.html { render :edit }\n format.json { render json: @doit_list.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74fbb76429d2938ba05f42ab9efb83ef", "score": "0.6109593", "text": "def index\n @fleet_lists = FleetList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @fleet_lists }\n end\n end", "title": "" }, { "docid": "1f81a9905e478e5c96c836a0bf254427", "score": "0.61052847", "text": "def index\n authorize! :show, List\n @lists = current_user.lists\n end", "title": "" }, { "docid": "c7006f6c5767487767c3e9e50310cecd", "score": "0.61020833", "text": "def index\n @orderlists = Orderlist.order(\"created_at desc\").page(params[:page]).per_page(20)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @orderlists }\n end\n end", "title": "" }, { "docid": "506b5a47de14166ea6258a61195307d7", "score": "0.60974765", "text": "def index\n @playlists = Playlists.all\n \n respond_to do |format|\n format.html\n format.json { sample_playlists = Playlists.find_by_username(\"nikeelevet\");\n render :json => sample_playlists.playlists_JSON.to_json } \n end\n end", "title": "" }, { "docid": "df67a826c8b5a8a5460c1ff97a23e9a7", "score": "0.6085728", "text": "def index\n @lists = @user.lists\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @lists }\n end\n end", "title": "" }, { "docid": "7e68da4866e35accbcb204de7bfd36a9", "score": "0.6085537", "text": "def index\n @task_lists = current_user.task_lists\n\n respond_to do |format|\n format.html # index.html.erb\n end\n end", "title": "" }, { "docid": "45276429d708f36030c3b050408bbd93", "score": "0.60843146", "text": "def index\n @list_items = ListItem.where('user_id = ?', session[:user_id]).find_each\n render json: @list_items\n end", "title": "" } ]
eea906738c88dd681e1e2d5f3ce01290
Initialize and return a new API instance.
[ { "docid": "50cd53bd1048422a20e1511b8cc9cfb9", "score": "0.0", "text": "def initialize(opts)\n @opts = opts\n uri = URI(opts[:uri])\n @host = uri.host\n @port = uri.port\n end", "title": "" } ]
[ { "docid": "e3f919ef12baaa303d35c608315ed363", "score": "0.7568109", "text": "def initialize(api)\n @api = api\n end", "title": "" }, { "docid": "4151def6ff4464fd239a58f0b16e02cf", "score": "0.7567174", "text": "def api\n # Should return an instance of the API instantiated \n # with the credentials passed into the initialized.\n # Raise an error to warn it isn't implemented.\n raise NotImplementedError.new \n end", "title": "" }, { "docid": "6fd825932d4d6814d012346d807c4177", "score": "0.7450345", "text": "def initialize api_key, api_secret\n @api_key = api_key\n @api_secret = api_secret\n end", "title": "" }, { "docid": "909e9d525e0089d13c5b7764802e9921", "score": "0.7428692", "text": "def api\n @http ||= Http.new(config)\n end", "title": "" }, { "docid": "2ecf3cc037407280096c92a925d9624f", "score": "0.7270634", "text": "def initialize(api_obj)\n @api_obj = api_obj\n end", "title": "" }, { "docid": "333cb50a16a1038f824ff32254c51124", "score": "0.7195775", "text": "def initialize\n begin\n @api_methods = Api_methods\n @api_version = Api_version\n rescue StandardError => e\n $log.error(sprintf(\"%s: %s\", __method__, e.message))\n raise\n end\n end", "title": "" }, { "docid": "bc1e69b1945be97610b059516595450b", "score": "0.71045434", "text": "def initialize(api_url)\n\t\turi = URI(api_url)\n\t\tcall_api(uri)\n\tend", "title": "" }, { "docid": "493a9ede61b5b499b4c76e744d84d206", "score": "0.70495456", "text": "def initialize(api_key)\n @api_key = api_key\n end", "title": "" }, { "docid": "6024f35748b4f46df29ce0b891df26c8", "score": "0.70248073", "text": "def initialize(api_key)\n @api_key = api_key \n end", "title": "" }, { "docid": "2f98dee8796019afc4d57610625869c5", "score": "0.70152205", "text": "def initialize( api_key )\n @api_key = api_key\n end", "title": "" }, { "docid": "7f9d38f6717bb357ef8a02636a516409", "score": "0.70120263", "text": "def initialize(api_key)\n @api_key = api_key\n end", "title": "" }, { "docid": "7f9d38f6717bb357ef8a02636a516409", "score": "0.70120263", "text": "def initialize(api_key)\n @api_key = api_key\n end", "title": "" }, { "docid": "7f9d38f6717bb357ef8a02636a516409", "score": "0.70120263", "text": "def initialize(api_key)\n @api_key = api_key\n end", "title": "" }, { "docid": "8d6bcbe2b8c2234d4e0cf2b1593d4b40", "score": "0.700944", "text": "def initialize\n @api_user = \"\"\n @api_key = \"\"\n end", "title": "" }, { "docid": "1154fd378283935c472b368c7ea0c577", "score": "0.69959617", "text": "def initialize(params)\n\n fail 'missing API Base URL' if params[:api_base_url].nil?\n fail 'missing API Key' if params[:api_key].nil?\n fail 'missing API Secret' if params[:api_secret].nil?\n\n params[:api_base_url] = params[:api_base_url].gsub(/\\/$/, '') # remove trailing slash\n params[:api_spec] = false if params[:api_spec].nil?\n\n set_manifest(params)\n\n end", "title": "" }, { "docid": "69ee762ed673b1e6a9e726253794097f", "score": "0.69650334", "text": "def api_object\n unless $api\n $api = FyberAPI.new(\n 'b07a12df7d52e6c118e5d47d3f9e60135b109a1f',\n {\n appid: 157,\n format: 'json',\n device_id: '2b6f0cc904d137be2e1730235f5664094b83',\n locale: 'de',\n ip: '109.235.143.113'\n }\n )\n end\n $api\n end", "title": "" }, { "docid": "01c213a3e43c4ec20a13b021c708ecb2", "score": "0.695326", "text": "def api\n # Don't cache instance for now because of a ruby marshaling bug present\n # in MRI 1.9.3 (Bug #7627) that causes instance variables to be\n # marshaled even when explicitly specifying #marshal_dump.\n Octokit::Client.new(:login => login, :access_token => token)\n end", "title": "" }, { "docid": "b5e827b92845d51958861feee90f8f0f", "score": "0.69409186", "text": "def initialize(options = {})\n @api_key = options[:api_key]\n @language = options[:language] || Fotolia::Language.new(DEFAULT_LANGUAGE)\n @api_uri = options[:api_uri] || DEFAULT_API_URI\n @xmlrpc_client = XMLRPC::Client.new2(@api_uri)\n\n raise ApiKeyRequiredError unless(@api_key)\n end", "title": "" }, { "docid": "c9b9d14c576c139536d73acd601e3347", "score": "0.6920978", "text": "def api\n # Only instantiate the API if needed. validate_update doesn't require it, so we shouldn't\n # make an unnecessary request to get the app_access_token.\n @api ||= API.new(app_access_token)\n end", "title": "" }, { "docid": "24ef9919ad1ee1cd05d9ae612b2e5566", "score": "0.6918396", "text": "def initialize(api_key:)\n @api_key = api_key\n end", "title": "" }, { "docid": "1e5767b0a8d69c6c9046388bd277d8db", "score": "0.69138944", "text": "def initialize\r\n @apiKey = API_KEY\r\n @secret = SECRET\r\n end", "title": "" }, { "docid": "677e05fbaed4b0cc84a1ade0883bd106", "score": "0.6913055", "text": "def initialize(api_key, options = {})\n @api_key = api_key\n @api_endpoint = DEFAULT_API_ENDPOINT\n end", "title": "" }, { "docid": "483d8c823d6601bb4bf54c9fe695f28d", "score": "0.6882745", "text": "def initialize(apikey)\n @apikey = apikey\n end", "title": "" }, { "docid": "46f02a185d1d0be8cff8680440cf8f60", "score": "0.68800956", "text": "def initialize(api_key, secret, api_uri)\n @api_key = api_key\n @secret = secret\n @api_uri = api_uri\n end", "title": "" }, { "docid": "7447c44d553de4f08caf1b972dba67ad", "score": "0.6878802", "text": "def initialize(api_key: nil)\r\n Configuration.api_key = api_key\r\n end", "title": "" }, { "docid": "c01de492f58c0ac3b7e0c3e397990eb9", "score": "0.6866535", "text": "def initialize(api_key = nil, shared_secret = nil, options = nil)\n @api_key = api_key || @@default_api_key\n @shared_secret = shared_secret || @@default_shared_secret\n @options = options || @@default_options\n @rest_endpoint = @options[:rest_endpoint] || REST_ENDPOINT\n @auth_endpoint = @options[:auth_endpoint] || AUTH_ENDPOINT\n end", "title": "" }, { "docid": "7f668035ab16caef0f9d70a438850862", "score": "0.6831492", "text": "def api\n @api ||= Ncio::Api::V1.new(opts)\n end", "title": "" }, { "docid": "4fd52556e5620fe935c601dc52128009", "score": "0.68302643", "text": "def initialize(api_key = nil)\n @api_key = api_key\n @api_key ||= Songkickr.api_key\n \n self.class.default_params :apikey => @api_key\n end", "title": "" }, { "docid": "6ff493572aaf33dc7270f3719dbfd9ed", "score": "0.6825269", "text": "def new(host:, port:, ssl: false, username:, password:, api_version:)\n api = nil\n\n # check that the API version is implemented\n api_version_file = File.join(File.dirname(__FILE__), \"v#{api_version}\", \"api.rb\")\n if File.exist?(api_version_file)\n require api_version_file.sub('.rb', '')\n\n api = Object.const_get(\"PaloAlto::V#{api_version}::Api\").new(host: host,\n port: port,\n ssl: ssl,\n username: username,\n password: password)\n else\n raise \"API version '#{api_version}' is not implemented\"\n end\n\n api\n end", "title": "" }, { "docid": "d630438220f7a2b12d32a230f937aef7", "score": "0.6814567", "text": "def initialize()\n self.apikey = Rails.application.credentials.alpha_api_key\n end", "title": "" }, { "docid": "abf677d08aa66088be5cabec6a9b52c6", "score": "0.6781338", "text": "def initialize(instance_name, api_key, auth_key)\n super()\n\n self.instance_name = instance_name\n self.api_key = api_key\n self.auth_key = auth_key if auth_key.present?\n end", "title": "" }, { "docid": "e83887c83784bcc1ab2aaccae2f03ad8", "score": "0.67741317", "text": "def initialize(api_key, secret, format_options={})\n @auth = { :api_key => api_key }\n @secret = secret\n end", "title": "" }, { "docid": "ab0230a7e4b22fe71b4d43bba72f6747", "score": "0.67717165", "text": "def initialize(api_key, resource_url)\n @rest_client = RestClient.new(resource_url, api_key)\n end", "title": "" }, { "docid": "79a89ac8d3ce082937aaee6c8b2697af", "score": "0.6755092", "text": "def initialize(api_key)\n @client = HTTPClient.new(\n default_header: {\n 'X-Auth-Token' => api_key,\n 'Content-Type' => 'application/json'\n }\n )\n end", "title": "" }, { "docid": "09c139ad228ea4b36e0369da3bf96294", "score": "0.6737739", "text": "def initialize(api_key)\n @api_key = api_key\n check_api_key!\n end", "title": "" }, { "docid": "7a113b06d9f80d76bbfabb81799dc434", "score": "0.67150325", "text": "def initialize(api_key, api_secret)\n @api_key = api_key\n @api_secret = api_secret\n @api_base_url = 'https://pepocampaigns.com'\n end", "title": "" }, { "docid": "44438c567a60a704728f172e471a1fcc", "score": "0.6713979", "text": "def initialize(api_url, app_name = DEFAULT_APP_NAME)\n @app_name = app_name\n @key = Digest::MD5.hexdigest(@app_name)\n @api_endpoint = \"http://#{api_url}/api\"\n end", "title": "" }, { "docid": "bd9d23f02d27d03af99b6bfe197a5781", "score": "0.670772", "text": "def initialize(api_key, username, password)\n @api_key, @username, @password = api_key, username, password\n setup_client\n end", "title": "" }, { "docid": "8d1cdf4b365f7d77951540884a0b18e4", "score": "0.66847885", "text": "def initialize(api_key)\n @client = Juicer::Client.new(api_key)\n end", "title": "" }, { "docid": "9f89de93a8cf179cfd1b57a01e0f7fcd", "score": "0.6656609", "text": "def initialize(config)\n @config = config\n @api_client = ApiClient.new(config)\n @access_token = nil\n end", "title": "" }, { "docid": "9f89de93a8cf179cfd1b57a01e0f7fcd", "score": "0.6656609", "text": "def initialize(config)\n @config = config\n @api_client = ApiClient.new(config)\n @access_token = nil\n end", "title": "" }, { "docid": "509721c33fc9ec7f64fb3c62f9e4ac39", "score": "0.66542333", "text": "def initialize(api_key = nil, api_version = nil, url = nil, username = nil, password = nil, options = {})\n load_yaml\n if load_yaml\n @api_key = load_yaml['api_key']\n @api_version = load_yaml['api_version']\n @options = load_yaml['options']\n @password = load_yaml['password']\n @url = load_yaml['url']\n @username = load_yaml['username']\n else\n @api_key = api_key\n @api_version = api_version\n @options = options\n @password = password\n @url = url\n @username = username\n end\n end", "title": "" }, { "docid": "508e5535e5dabaf8fbe457feb9a61619", "score": "0.6653153", "text": "def initialize(opts)\n if opts[:api_key].nil?\n raise ArgumentError, \"Required option missing. Please pass ':api_key'.\"\n end\n\n client(opts)\n self\n end", "title": "" }, { "docid": "e56800364d33ac8530fff60c67cdfb93", "score": "0.6641801", "text": "def initialize(base_url: BASE_URL, api_version: API_VERSION, api_key: API_KEY)\n @base_url = base_url\n @api_version = api_version\n @api_key = api_key\n end", "title": "" }, { "docid": "cceb736a16521cb27b41b9606f5944f7", "score": "0.660358", "text": "def initialize\n self.api_root = BASE_URL\n end", "title": "" }, { "docid": "aeda159346c3e2e1c3beec495de87c62", "score": "0.6600325", "text": "def initialize(*args)\n raise ArgumentError, \"Requires at least the api_key and secret_key when instatiating\" if args.size == 0\n\n base_url = 'https://api.att.com'\n\n if args.size == 1 && args[0].instance_of?(Hash)\n args = args.shift\n @api_key = args[:api_key]\n @secret_key = args[:secret_key]\n @base_url = args[:base_url] || base_url\n set_ssl_verify args[:ssl_verify]\n else\n @api_key = args.shift\n @secret_key = args.shift\n @base_url = args.shift || base_url\n set_ssl_verify args.shift\n end\n\n @grant_type = 'client_credentials'\n @access_token = ''\n @refresh_token = ''\n\n create_connection 'application/json'\n\n get_tokens\n\n Actor.current\n end", "title": "" }, { "docid": "bf3f733940838d96d021e7be2f1a11b4", "score": "0.6598048", "text": "def initialize(api_key, api_secret, suppress_exceptions = false)\n \n # required parameters\n @api_key = api_key\n @api_secret = api_secret\n \n # calculated parameters\n @api_server_base_url = API_SERVER_BASE_URL\n @api_server_path = API_PATH_REST\n \n # optional parameters\n @suppress_exceptions = suppress_exceptions\n \n # initialize internal state\n @last_call_was_successful = true\n @last_error = nil\n @session_expired = false\n \n end", "title": "" }, { "docid": "462684fec72f2b8da1d3b4c946affefa", "score": "0.6591628", "text": "def initialize(api_key)\n @api_key = api_key\n self.class.headers({\n \"X-API-Key\" => @api_key,\n \"Accept\" => \"application/json\"\n })\n end", "title": "" }, { "docid": "ac3cbd12188d7d8dc8c6ab91203820d0", "score": "0.6589114", "text": "def api\n @api ||= KynetxAmApi::DirectApi.new({:access_token => @access_token, :access_secret => @access_secret})\n return @api\n end", "title": "" }, { "docid": "a384680f224f065fa0d1e135aaff15ab", "score": "0.65866697", "text": "def initialize(attributes = {})\n super\n self.api_endpoint ||= Orias.configuration.api_endpoint\n self.per_request ||= Orias.configuration.per_request\n self.private_key ||= Orias.configuration.private_key\n end", "title": "" }, { "docid": "8d8f203dc9b538a6194edb3157bd84e8", "score": "0.6584633", "text": "def initialize\n\t\t@zomato = Zomato::Base.new(@@api_key)\n\tend", "title": "" }, { "docid": "509c966e55b1c7b34b081ce5091f5ca3", "score": "0.6583452", "text": "def initialize(options = {})\n options = { :access_token => options } if options.is_a? String\n options = self.class.options.merge(options)\n\n # Parse `api_url` option\n if url = options.delete(:api_url)\n uri = URI.parse(url)\n options[:api_scheme] = uri.scheme\n options[:api_host] = uri.host + (uri.port != 80 && uri.port != 443 ? \":#{uri.port}\" : '')\n end\n\n @access_token = options[:access_token] if options[:access_token]\n @api_scheme = options[:api_scheme]\n @api_host = options[:api_host]\n @api_version = options[:api_version]\n @api_prefix = options[:api_prefix]\n @client_token = options[:client_token] if options[:client_token]\n @transport = options[:transport]\n @result_format = options[:result_format]\n\n # Include transport\n transport_module = Lapse::Transport::TRANSPORT_MAP[@transport]\n raise 'Invalid transport' unless transport_module\n self.extend transport_module\n end", "title": "" }, { "docid": "8311605838305ff5a5a19d419ca0fbe1", "score": "0.65813774", "text": "def initialize(api_url:, api_key:, verbose: false)\n self.api_url = api_url.is_a?(Addressable::URI) ? api_url : Addressable::URI.parse(api_url)\n self.api_key = api_key\n self.verbose = verbose\n end", "title": "" }, { "docid": "8b6d102efcc7d8e60adba07a1cf4616c", "score": "0.6578247", "text": "def initialize base_url, api_key\n\t\t\t\t\t@connection = Freshdesk::Api::Client::Request.new base_url, api_key\n\t\t\t\tend", "title": "" }, { "docid": "b8a287c7d1e49917f46af766410bb182", "score": "0.6576744", "text": "def set_api\n @api = Api.find(params[:id])\n rescue\n @api = Api.new\n end", "title": "" }, { "docid": "3a7e73cc061040f2b889c17fc8a902d6", "score": "0.6570335", "text": "def initialize api_key: nil, namespace: nil\n unless api_key && namespace\n raise ArgumentError.new(\"You must include both an api_key and namespace, e.g. Unloq::Client.new(api_key: 'foo', namespace: 'bar')\")\n end\n\n @api_key = api_key\n @namespace = namespace\n end", "title": "" }, { "docid": "233cba94795e798305a1dbd50942b879", "score": "0.6558807", "text": "def api\n @api ||= PrismicService.init_api\n end", "title": "" }, { "docid": "eb923f350d92301d21a96340ecf47abc", "score": "0.65515435", "text": "def initialize_api\n @github_api = ::Github::Repos.new do |github_config|\n github_config.endpoint = @endpoint if @endpoint\n github_config.site = @site if @site\n github_config.basic_auth = @auth\n github_config.repo = @repo\n github_config.org = @org\n github_config.adapter = :net_http\n github_config.ssl = {:verify => false}\n end\n end", "title": "" }, { "docid": "e301664dbbb02d5648272c47b6708503", "score": "0.65452075", "text": "def initialize\n @format = 'json'\n @scheme = 'https'\n @host = 'api.imagga.com:443'\n @base_path = '/v2'\n @user_agent = 'Swagger/Ruby/0.1.0/beta'\n @inject_format = false\n @force_ending_format = false\n @camelize_params = false\n # for API key/token authentication\n @api_key = '';\n @api_key_type = '';\n @api_key_name = '';\n @api_key_prefix = '';\n # for http basic authentication\n @username = ''\n @password = ''\n @user_agent = 'Swagger/Ruby/0.1.0/beta'\n end", "title": "" }, { "docid": "9a021ddb0f827f4c17a4326e2c73204f", "score": "0.6542832", "text": "def initialize(api_id)\n @api_id = api_id\n @app_info = nil\n @channels = {}\n initialize_stats\n logger.debug \"Created application\"\n end", "title": "" }, { "docid": "fd3d153c409f18f8f11feadf07041875", "score": "0.65324706", "text": "def initialize(api_key = Sift.api_key, id = Sift.account_id)\n @api_key = api_key\n @id = id\n end", "title": "" }, { "docid": "2b947d09e9d6b2c0954c15929c372d40", "score": "0.6526462", "text": "def initialize(api_key, region = 'na')\n @api_key = api_key\n @region = region\n @http = Hurley::Client.new\n @http.header[:content_type] = 'application/json'\n @http.query['api_key'] = api_key\n end", "title": "" }, { "docid": "6b544de2bf1c6c6fae757d4c0e0fa4a3", "score": "0.6525204", "text": "def initialize(api_key, source, config = {})\n raise ArgumentError.new('Your need to specify your api key') unless api_key\n raise ArgumentError.new('You need to specify a source website') unless source\n\n\n defaults = {\n :api_version => API_VERSION\n }\n\n @config = defaults.merge(config).freeze\n @api_key = api_key\n @source = source\n @litmosURL = \"https://api.litmos.com/v#{@config[:api_version]}.svc/\"\n @devURL = \"http://apidev.litmos.com/v#{@config[:api_version]}.svc/\"\n end", "title": "" }, { "docid": "0774985b235957b43e7f98c8530016dc", "score": "0.65188825", "text": "def api\n @api ||= WeatherApiCalls.new\n end", "title": "" }, { "docid": "7905144136fb194fb562bb90d6f3b434", "score": "0.65170884", "text": "def initialize(api_key = Payable.api_key, path = Payable.current_rest_api_path, timeout = API_TIMEOUT, company_id = Payable.company_id)\n raise(\"api_key must be a non-empty string\") if !api_key.is_a?(String) || api_key.empty?\n raise(\"path must be a non-empty string\") if !path.is_a?(String) || path.empty?\n @api_key = api_key\n @path = path\n @timeout = timeout\n @company_id = company_id\n end", "title": "" }, { "docid": "965b851a237077c50d42c00302df4b00", "score": "0.65168566", "text": "def initialize(key, secret_key)\n @api_request = APIRequest.new(key, secret_key)\n\n @product_resource = ProductResource.new(@api_request,\n '/product/',\n Product)\n @plan_resource = PlanResource.new(@api_request,\n '/plan/',\n Plan)\n @tax_resource = TaxResource.new(@api_request,\n '/tax/',\n Tax)\n @shipping_resource = ShippingResource.new(@api_request,\n '/shipping/',\n Shipping)\n @coupon_resource = CouponResource.new(@api_request,\n '/coupon/',\n Coupon)\n @transaction_resource = TransactionResource.new(@api_request,\n '/transaction/',\n Transaction)\n @subscription_resource = SubscriptionResource.new(@api_request,\n '/subscription/',\n Subscription)\n @authorization_resource = AuthorizationResource.new(@api_request,\n '/authorization/',\n Authorization)\n @sale_resource = SaleResource.new(@api_request,\n '/sale/',\n Sale)\n @currency_resource = CurrencyResource.new(@api_request,\n '/currency/',\n Currency)\n @gateway_resource = GatewayResource.new(@api_request,\n '/gateway/',\n Gateway)\n @pay_data_resource = PayDataResource.new(@api_request,\n '/pay/',\n PayData)\n end", "title": "" }, { "docid": "da6a29f112155aa790f6adb6209a1207", "score": "0.650443", "text": "def api\n return Runtime.instance.set_if(self, :api) do\n LapisLazuli::API.new\n end\n end", "title": "" }, { "docid": "467de21cda4a9693c41f3707f0485ccd", "score": "0.65043855", "text": "def initialize\n @api_key = ENV['NOMICS_API_KEY_V1']\n end", "title": "" }, { "docid": "57e249ef38fd9b85d541c0f6c5f8bbc6", "score": "0.6504251", "text": "def create_adwords_api()\n config_filename = File.join(Rails.root, 'config', 'adwords_api.yml')\n @api = AdwordsApi::Api.new(config_filename)\n token = session[:token]\n # If we have an OAuth2 token in session we use the credentials from it.\n if token\n credentials = @api.credential_handler()\n credentials.set_credential(:oauth2_token, token)\n credentials.set_credential(:client_customer_id, selected_account)\n end\n return @api\n end", "title": "" }, { "docid": "5f9f721cb4439884372c4c3d78514906", "score": "0.64945227", "text": "def initialize(api_key, account_id, api_version = 'v1')\n @api_key = api_key\n @account_id = account_id\n @api_ver = api_version\n instance_variables.each do |variable|\n raise ArgumentError, \"#{variable} should not be nil or blank\" if instance_variable_get(variable.to_sym).to_s == \"\"\n end\n end", "title": "" }, { "docid": "a6e3a845e05877b375ff914f3400cf85", "score": "0.6488172", "text": "def initialize(api_key, api_secet, options={})\n @api_key, @api_secret = api_key, api_secet\n @consumer_options = options.merge(ApiOptions)\n end", "title": "" }, { "docid": "b500c2ac9d4ffa053773d74262673bee", "score": "0.6484504", "text": "def initialize(server, api_version, api_key)\n self.class.base_uri \"http://#{server}/api/#{api_version}\"\n self.class.headers 'Accept' => 'application/json', \"X-CCApiKey\" => api_key\n end", "title": "" }, { "docid": "b003a1929538d8602835cc74a500a03d", "score": "0.6480469", "text": "def initialize( configuration )\n\n if configuration.is_a?(Module) && configuration.to_s == 'Edmodo'\n config = configuration\n elsif configuration.is_a?(Hash)\n config = Hashie::Rash.new( configuration )\n config.api_url = [config.endpoint,config.api_version].join('/')\n end\n\n if config.api_key\n self.class.default_params({ 'api_key' => config.api_key})\n else\n raise Edmodo::InvalidCredentials.new(\"Api Key is not present but it is required.\")\n end\n\n self.class.base_uri( config.api_url ) if config.api_url\n self.class.default_timeout config.timeout.to_f if config.timeout\n self.class.debug_output if config.testing\n self.class.headers({'User-Agent' => config.user_agent}) if config.user_agent\n end", "title": "" }, { "docid": "1a0f9e4ed1c9272bad996657c4533b8d", "score": "0.64698297", "text": "def initialize(key = nil, api_key: nil)\n @api_key = key || api_key\n end", "title": "" }, { "docid": "34ea3386e67f1787471b65e092ccc3d0", "score": "0.6461079", "text": "def create_adwords_api()\n config_filename = File.join(Rails.root, 'config', 'adwords_api.yml.erb')\n template = ERB.new File.new(config_filename).read\n processed = YAML.load template.result(binding)\n @api = AdwordsApi::Api.new(processed)\n token = session[:token]\n # If we have an OAuth2 token in session we use the credentials from it.\n if token\n credentials = @api.credential_handler()\n credentials.set_credential(:oauth2_token, token)\n credentials.set_credential(:client_customer_id, selected_account)\n end\n return @api\n end", "title": "" }, { "docid": "5d1dc1ba1d7dcc1b0435bdc25a4d01ac", "score": "0.6459311", "text": "def initialize(api, endpoint, namespace, version)\n if self.class() == AdsCommon::SavonService\n raise NoMethodError, 'Tried to instantiate an abstract class'\n end\n @api, @version, @namespace = api, version, namespace\n @headerhandler = []\n @client = create_savon_client(endpoint, namespace)\n end", "title": "" }, { "docid": "58f25e30f5ea6d61d65e2ad1aeff4dbb", "score": "0.64525115", "text": "def initialize(api, location, from_data = nil)\n @api = api\n @location = location\n\n update(from_data)\n end", "title": "" }, { "docid": "1fc70a310333ae0a6c98a686583e5bc9", "score": "0.64516205", "text": "def set_api\r\n api = EVEAPI::API.new\r\n api.api_id = api_key.api_id\r\n api.v_code = api_key.v_code\r\n api.character_id = id\r\n api\r\n end", "title": "" }, { "docid": "468e8714597fff1d4542d2d28e1da40d", "score": "0.6447596", "text": "def initialize(api_key)\n raise ArgumentError, 'api_key is required' if api_key == nil || api_key.empty?\n @api_key = api_key\n\t\tend", "title": "" }, { "docid": "1b9f19b323771dfb04a1c5eb68284ff6", "score": "0.6432519", "text": "def client\r\n @client ||= APIController.new config\r\n end", "title": "" }, { "docid": "0cf984d2afbfbb8b1ff9ec8fa3eee1f6", "score": "0.64279175", "text": "def initialize api_key=ENV['b2w_api_key'], api_url=\"http://api.born2win.local/v2/events\"\n @api_url = api_url\n @api_key = api_key\n end", "title": "" }, { "docid": "f494f0eb4781a3b0a30ea21bd95dbf0c", "score": "0.6426203", "text": "def api\n @api ||= Octokit::Client.new(:login => login, :oauth_token => token)\n end", "title": "" }, { "docid": "af947d7452cce86d6448ef3f1b443f9a", "score": "0.64185244", "text": "def initialize(api_key)\n @api_key = api_key\n @conn = Faraday.new\n end", "title": "" }, { "docid": "85509d274c2cae4912dfcf55787bca89", "score": "0.64100105", "text": "def initialize(apikey='f47a72ab00afe64aab78b9919ee3d427')\n\t\t@api_key = apikey\n\t\t@headers = {\"Accept\" => \"application/JSON\", \"user-key\" => @api_key}\n\t\t@base_uri = \"https://developers.zomato.com/api/v2.1/\"\n\tend", "title": "" }, { "docid": "f41fa02cbe4bb9365c4a9fdd97d07703", "score": "0.64036554", "text": "def initialize\n @response_format = 'json'\n @scheme = 'http'\n @host = 'api.wordnik.com'\n @hosts = []\n @load_balancer = nil\n @base_path = '/v4'\n @user_agent = \"ruby-#{Wordnik::VERSION}\"\n # Build the default set of resource names from the filenames of the API documentation\n begin\n api_docs_path = File.join(File.dirname(__FILE__), '../../api_docs')\n @resource_names = Dir.glob(File.join(api_docs_path, '*.json')).map {|f| f.split('/').last.sub('.json', '') }.sort\n true\n rescue\n raise 'Problem loading the resource files in ./api_docs/'\n end\n end", "title": "" }, { "docid": "23969adf91800c3ea676fa2325aad3e9", "score": "0.64008707", "text": "def initialize(options={})\n @api_key = options[:api_key] || config.api_key\n @path = options[:path]\n @params = options[:params]\n @http_request_options = options[:http_request_options] || {}\n end", "title": "" }, { "docid": "a7e09b4df549a00b6c525e302447f8d3", "score": "0.6399973", "text": "def initialize(key, version)\n # Sets API key and Version\n # Set api_key and check its correct format\n raise 'Version must be 1 or 2' unless %w[1 2].include?(version)\n\n warn('Warning: API key `1` is only for development') if key.to_s == '1'\n @version = version\n @key = key.to_s\n @api_url = API_ENDPOINT + \"/v#{@version}/#{@key}/\"\n end", "title": "" }, { "docid": "d18902634a3457060032dd0fbaa87322", "score": "0.63978004", "text": "def initialize(api_key=nil)\n @api_key = api_key || ENV['KULER_API_KEY'] || raise(ArgumentError, 'no API key found')\n end", "title": "" }, { "docid": "d7091e3c108c790e8339387c78417b04", "score": "0.6396895", "text": "def initialize(api_key, options = {})\n $api_key = api_key\n $redis = options[:redis] || Redis.new\n $debug = options[:debug] || false\n end", "title": "" }, { "docid": "d8b1f83444530fcadfe9a504773840bc", "score": "0.63898325", "text": "def initialize (api_key)\n\t\t@params = {\n\t\t\t\"key\" => api_key,\n\t\t\t\"wrapper\" => \"cleverbotrb\"\n\t\t}\n\t\t@endpoint = ENDPOINT\n\tend", "title": "" }, { "docid": "6c78e440558cbb01f7b5a04309bca8ee", "score": "0.6389354", "text": "def connection\n @connection ||= RestClient::Resource.new(api_uri.to_s)\n end", "title": "" }, { "docid": "133a17323c48d1d926c8fe9bac518679", "score": "0.6388663", "text": "def initialize\n @client_sdk_id = ''\n @key_file_path = ''\n @key = ''\n @sdk_identifier = 'Ruby'\n @api_url = 'https://api.yoti.com'\n @api_port = 443\n @api_version = 'v1'\n end", "title": "" }, { "docid": "83265367a4f03927eb4fb87760a96a13", "score": "0.6380001", "text": "def initialize(driver, api)\n @driver = driver\n @api = api\n end", "title": "" }, { "docid": "83265367a4f03927eb4fb87760a96a13", "score": "0.6380001", "text": "def initialize(driver, api)\n @driver = driver\n @api = api\n end", "title": "" }, { "docid": "83265367a4f03927eb4fb87760a96a13", "score": "0.6380001", "text": "def initialize(driver, api)\n @driver = driver\n @api = api\n end", "title": "" }, { "docid": "83265367a4f03927eb4fb87760a96a13", "score": "0.6380001", "text": "def initialize(driver, api)\n @driver = driver\n @api = api\n end", "title": "" }, { "docid": "83265367a4f03927eb4fb87760a96a13", "score": "0.6380001", "text": "def initialize(driver, api)\n @driver = driver\n @api = api\n end", "title": "" }, { "docid": "83265367a4f03927eb4fb87760a96a13", "score": "0.6380001", "text": "def initialize(driver, api)\n @driver = driver\n @api = api\n end", "title": "" }, { "docid": "e7d2c9257b8c8ed0f5a6567af09c21aa", "score": "0.63780653", "text": "def initialize(api_key, url='http://localhost:9001/api')\n @uri = URI.parse(url)\n raise ArgumentError, \"#{url} is not a valid url\" unless @uri.host and @uri.port\n @api_key = api_key\n connect!\n end", "title": "" }, { "docid": "efeffe5efab92317b14401aa6e19e898", "score": "0.63745004", "text": "def create_adwords_api\n config_filename = File.join(Rails.root, 'config', 'adwords_api.yml')\n @api = AdwordsApi::Api.new(config_filename)\n end", "title": "" }, { "docid": "71ae7684e1fe16f817edafa603e6944e", "score": "0.63741815", "text": "def api\n @api ||= Battlenet.new(:eu)\n end", "title": "" } ]
f0a6fd44603ecf8dd397754a9b292b0c
Do nothing or override in cloud specific derived classes for prevmcreation setup steps
[ { "docid": "cc967ba1f95c7f1ddcc0e0d4f8cc1840", "score": "0.0", "text": "def create_server_dependencies; end", "title": "" } ]
[ { "docid": "0e9ad86554e48b7b877bfd8407f71d5e", "score": "0.7201509", "text": "def setup_create\n\t\traise NotImplementedError, \"cannot create generic virtual machines on the go\"\n\tend", "title": "" }, { "docid": "70eecff7b6e2caf391e71de43710ac0a", "score": "0.66420436", "text": "def setup\n # does nothing, unless overridden in subclass.\n end", "title": "" }, { "docid": "c85b0efcd2c46a181a229078d8efb4de", "score": "0.66388226", "text": "def custom_setup\n\n end", "title": "" }, { "docid": "786e9501cd037d1c821d741fda5178d9", "score": "0.6628324", "text": "def setup_create\n\t\traise NotImplementedError, \"cannot create local machine\"\n\tend", "title": "" }, { "docid": "9358208395c0869021020ae39071eccd", "score": "0.6590051", "text": "def post_setup; end", "title": "" }, { "docid": "b6c9787acd00c1b97aeb6e797a363364", "score": "0.6551768", "text": "def setup\n # override this if needed\n end", "title": "" }, { "docid": "a5ca4679d7b3eab70d3386a5dbaf27e1", "score": "0.65178514", "text": "def perform_setup\n end", "title": "" }, { "docid": "da88436fe6470a2da723e0a1b09a0e80", "score": "0.65171796", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "34ad4cf24455c54d514916e9b29b9227", "score": "0.6464899", "text": "def setup\n # do nothing by default\n end", "title": "" }, { "docid": "9f898ebf30f2336f89e5331a508f1463", "score": "0.64625925", "text": "def setup\n\t\t# Do nothing\n\tend", "title": "" }, { "docid": "9f898ebf30f2336f89e5331a508f1463", "score": "0.64625925", "text": "def setup\n\t\t# Do nothing\n\tend", "title": "" }, { "docid": "9f898ebf30f2336f89e5331a508f1463", "score": "0.64625925", "text": "def setup\n\t\t# Do nothing\n\tend", "title": "" }, { "docid": "9f898ebf30f2336f89e5331a508f1463", "score": "0.64625925", "text": "def setup\n\t\t# Do nothing\n\tend", "title": "" }, { "docid": "21b82fda2008f3af4e4746a406167cdb", "score": "0.6451784", "text": "def setup_without_vcr\n end", "title": "" }, { "docid": "54bc5dcae180a37208662771ff8732ce", "score": "0.64456844", "text": "def before_setup\n # do nothing by default\n end", "title": "" }, { "docid": "d56f4ec734e3f3bc1ad913b36ff86130", "score": "0.6444937", "text": "def create_setup\n \n end", "title": "" }, { "docid": "bb8624b6116788e6d4a9f45403f4647c", "score": "0.6422612", "text": "def setup\n\t\t\t\t# Do nothing\n\t\tend", "title": "" }, { "docid": "c1ec1a1d8a3145d3f02197698c562aed", "score": "0.6407958", "text": "def setup\n raise NotImplementedError\n end", "title": "" }, { "docid": "6bd37bc223849096c6ea81aeb34c207e", "score": "0.6397948", "text": "def post_setup\n end", "title": "" }, { "docid": "9b276674788c4626cd160685dd94fed7", "score": "0.6383398", "text": "def setup\n super('scalarm_db_clouds_test')\n end", "title": "" }, { "docid": "f5c5465297ebef4ee6c5b882c3ccb3aa", "score": "0.63602895", "text": "def provision\n raise NotImplementedError, _(\"provision must be implemented in a subclass\")\n end", "title": "" }, { "docid": "d352a14a7abc285ca313bcb81bef3dd5", "score": "0.6354142", "text": "def setup\n not_implemented('setup')\n end", "title": "" }, { "docid": "da39969a52fda0972257205358cee40a", "score": "0.6289083", "text": "def provision!; end", "title": "" }, { "docid": "da39969a52fda0972257205358cee40a", "score": "0.6289083", "text": "def provision!; end", "title": "" }, { "docid": "da39969a52fda0972257205358cee40a", "score": "0.6289083", "text": "def provision!; end", "title": "" }, { "docid": "0286d57757b24ac07ceaaaa5cce12986", "score": "0.62618774", "text": "def __setup; end", "title": "" }, { "docid": "fc74e300487f8f43f3b9e4765e045a0e", "score": "0.62402403", "text": "def setup(*args)\n # reimplement in subclasses\n end", "title": "" }, { "docid": "46578f32957b8befb471b32b75d76e65", "score": "0.623834", "text": "def setup\n raise \"Unimplemented method #setup\"\n end", "title": "" }, { "docid": "c5e67d3883f9f7495a95cfbb6ed4612c", "score": "0.6218159", "text": "def initialize(name, run_context=nil)\n super\n set_platform_default_providers\n @action = :create\nend", "title": "" }, { "docid": "385ce97e952f58c8ef5e4c496deea236", "score": "0.6218067", "text": "def setup\n info \"setting up\".blue\n super\n end", "title": "" }, { "docid": "f6ad3e9b34f39ce286ea190d3706a644", "score": "0.62016565", "text": "def setup!\n # Does nothing.\n end", "title": "" }, { "docid": "b90d1026086b915142774153fc727d0b", "score": "0.61956716", "text": "def setup(app, machine)\n app.vm.box = machine.box\n app.vm.hostname = machine.name\n app.vm.provider :virtualbox do |vb|\n vb.customize ['setextradata', :id, \"VBoxInternal2/SharedFoldersEnableSymlinksCreate/#{machine.sync.name}\", '1']\n vb.customize ['modifyvm', :id, '--cpuexecutioncap', '50']\n vb.name = machine.name\n vb.memory = machine.memory\n vb.cpus = machine.cpus\n end\nend", "title": "" }, { "docid": "d17e2a094dbdb835aa104879c9e100a7", "score": "0.6182625", "text": "def setup\n # do nothing\n end", "title": "" }, { "docid": "3a44db7370b3e09a784083247025b528", "score": "0.61512643", "text": "def pre_build; end", "title": "" }, { "docid": "59d51aa4d0fadc523fe2174d6875ba70", "score": "0.6146046", "text": "def class_setup\n end", "title": "" }, { "docid": "82d2e5a190312eec125629ada80f43be", "score": "0.61362517", "text": "def setup(args={})\n debug 'No custom setup declared'\n end", "title": "" }, { "docid": "43419bce67ef145130837d40bc2566e5", "score": "0.61285895", "text": "def setup(force = false)\n logger.debug { \"#{self.class}##{__method__}\" }\n\n self.save! if save_on_setup?\n return unless self.active? || force\n logger.info(\"Provisioning #{self.machines.size} #{self.class} machines...\")\n provision_agents.each do |activated_agent|\n logger.debug { \"#{self.class} agent##{activated_agent.private_ip_address} validating java installation...\" }\n unless java_ok?(activated_agent)\n activated_agent.update_attribute(:active, false)\n raise Hailstorm::DataCenterJavaFailure, Defaults::JAVA_VERSION\n end\n\n logger.debug { \"#{self.class} agent##{activated_agent.private_ip_address} validating jmeter installation...\" }\n unless jmeter_ok?(activated_agent)\n activated_agent.update_attribute(:active, false)\n raise Hailstorm::DataCenterJMeterFailure, self.project.jmeter_version\n end\n end\n end", "title": "" }, { "docid": "c1a9589f693b180299b2b438e7ac1d37", "score": "0.61279106", "text": "def setup\n setup! unless setup?\n end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.6125439", "text": "def before_setup; end", "title": "" }, { "docid": "c5904f93614d08afa38cc3f05f0d2365", "score": "0.6125439", "text": "def before_setup; end", "title": "" }, { "docid": "bded370b85e86c6f72462921f7e7bbbb", "score": "0.6108601", "text": "def setup\n # Do nothing\n end", "title": "" }, { "docid": "bded370b85e86c6f72462921f7e7bbbb", "score": "0.6108601", "text": "def setup\n # Do nothing\n end", "title": "" }, { "docid": "bded370b85e86c6f72462921f7e7bbbb", "score": "0.6108601", "text": "def setup\n # Do nothing\n end", "title": "" }, { "docid": "bded370b85e86c6f72462921f7e7bbbb", "score": "0.6108601", "text": "def setup\n # Do nothing\n end", "title": "" }, { "docid": "bded370b85e86c6f72462921f7e7bbbb", "score": "0.6108601", "text": "def setup\n # Do nothing\n end", "title": "" }, { "docid": "bded370b85e86c6f72462921f7e7bbbb", "score": "0.6108601", "text": "def setup\n # Do nothing\n end", "title": "" }, { "docid": "bded370b85e86c6f72462921f7e7bbbb", "score": "0.6108601", "text": "def setup\n # Do nothing\n end", "title": "" }, { "docid": "bded370b85e86c6f72462921f7e7bbbb", "score": "0.6108601", "text": "def setup\n # Do nothing\n end", "title": "" }, { "docid": "bded370b85e86c6f72462921f7e7bbbb", "score": "0.6108601", "text": "def setup\n # Do nothing\n end", "title": "" }, { "docid": "bded370b85e86c6f72462921f7e7bbbb", "score": "0.6108601", "text": "def setup\n # Do nothing\n end", "title": "" }, { "docid": "bded370b85e86c6f72462921f7e7bbbb", "score": "0.6108601", "text": "def setup\n # Do nothing\n end", "title": "" }, { "docid": "bded370b85e86c6f72462921f7e7bbbb", "score": "0.6108601", "text": "def setup\n # Do nothing\n end", "title": "" }, { "docid": "bded370b85e86c6f72462921f7e7bbbb", "score": "0.6108601", "text": "def setup\n # Do nothing\n end", "title": "" }, { "docid": "bded370b85e86c6f72462921f7e7bbbb", "score": "0.6108601", "text": "def setup\n # Do nothing\n end", "title": "" }, { "docid": "bded370b85e86c6f72462921f7e7bbbb", "score": "0.6108601", "text": "def setup\n # Do nothing\n end", "title": "" }, { "docid": "bded370b85e86c6f72462921f7e7bbbb", "score": "0.6108601", "text": "def setup\n # Do nothing\n end", "title": "" }, { "docid": "39c39d6fe940796aadbeaef0ce1c360b", "score": "0.6108532", "text": "def setup_phase; end", "title": "" }, { "docid": "6550c1887fe3e084e2425fad3012b3b5", "score": "0.60923475", "text": "def pre_initialize ; end", "title": "" }, { "docid": "6550c1887fe3e084e2425fad3012b3b5", "score": "0.60923475", "text": "def pre_initialize ; end", "title": "" }, { "docid": "0516a5e8f46e5312ccac1691e21f3d42", "score": "0.6084329", "text": "def setup\n super\n end", "title": "" }, { "docid": "32dbbb40cc1672b3605754267e259265", "score": "0.6076812", "text": "def check_setup\n \n end", "title": "" }, { "docid": "01349f1bec2397323fa069c152abd674", "score": "0.6050169", "text": "def setup_basic_parameters\n # setup cpu and memory for the machine\n @server.vm.provider 'virtualbox' do |v|\n v.cpus = @conf.get 'cpus', 1\n v.memory = @conf.get 'memory', 1024\n end\n end", "title": "" }, { "docid": "7c12c43a3636a58aeed4fb8f3b4d49a1", "score": "0.6049165", "text": "def create_vm(attrs)\n attrs = attrs.dup\n\n if attrs[:cluster].present?\n attrs[:cluster] = client.system_service.clusters_service.cluster_service(attrs[:cluster]).get\n else\n if attrs[:cluster_name].present?\n cluster = client.system_service.clusters_service.list(:search => \"name=#{attrs[:cluster_name]}\").first\n else\n cluster = client.system_service.clusters_service.list(:search => \"datacenter=#{datacenter_hash[:name]}\").first\n attrs[:cluster_name] = cluster.name\n end\n\n attrs[:cluster] = cluster\n end\n\n vms_service = client.system_service.vms_service\n attrs[:instance_type] = attrs[:instance_type].present? ? client.system_service.instance_types_service.instance_type_service(attrs[:instance_type]).get : nil\n\n if attrs[:template].present?\n attrs[:template] = client.system_service.templates_service.template_service(attrs[:template]).get\n else\n attrs[:template] = client.system_service.get.special_objects.blank_template\n update_os_attrs(attrs)\n end\n\n attrs[:comment] ||= \"\"\n attrs[:quota] = attrs[:quota].present? ? client.system_service.data_centers_service.data_center_service(datacenter).quotas_service.quota_service(attrs[:quota]).get : nil\n if attrs[:cores].present? || attrs[:sockets].present?\n cpu_topology = OvirtSDK4::CpuTopology.new(:cores => attrs.fetch(:cores, \"1\"), :sockets => attrs.fetch(:sockets, \"1\"))\n attrs[:cpu] = OvirtSDK4::Cpu.new(:topology => cpu_topology)\n end\n attrs[:memory_policy] = OvirtSDK4::MemoryPolicy.new(:guaranteed => attrs[:memory]) if attrs[:memory].to_i < Fog::Compute::Ovirt::DISK_SIZE_TO_GB\n attrs[:high_availability] = OvirtSDK4::HighAvailability.new(:enabled => attrs[:ha] == \"1\") if attrs[:ha].present?\n\n # TODO: handle cloning from template\n process_vm_opts(attrs)\n new_vm = OvirtSDK4::Vm.new(attrs)\n vms_service.add(new_vm)\n end", "title": "" }, { "docid": "2782caff92f9708c3278c9dd4fd6f363", "score": "0.60435814", "text": "def preRun\n end", "title": "" }, { "docid": "01d5100e6b255d9caa2cbca89f6a3406", "score": "0.6042726", "text": "def before_launch_instance\n cloud_provider.before_launch_instance if cloud_provider.respond_to?(:before_launch_instance)\n end", "title": "" }, { "docid": "4716582ef90938640bcca5507ec3528f", "score": "0.60314006", "text": "def cloud_init\n @cloud_init\n end", "title": "" }, { "docid": "21883f93d566d361528b45bbb96d3d3d", "score": "0.6030052", "text": "def setup(*args)\n raise NotImplementedError\n end", "title": "" }, { "docid": "1633cd5438de0318e9627262e8c92bba", "score": "0.60157186", "text": "def setup\n ssl_options = {}\n ssl_options[:verify] = :none if insecure\n ssl_options[:ca_file] = ca_file if ca_file\n # Connect to the vAPI Service and get the vAPI Stub\n @service_manager = get_service_manager(ssl_options)\n @vm_svc = VCENTER_VM_CLASS.new(service_manager.vapi_config)\n end", "title": "" }, { "docid": "b1fd88118bc575d18b0b424ae711482e", "score": "0.601021", "text": "def preinit\n end", "title": "" }, { "docid": "cdfc3674f8eb4b78e312dae63e91bd3f", "score": "0.6004463", "text": "def use_cloud_init\n @use_cloud_init\n end", "title": "" }, { "docid": "ab2797485b69e614127f3fab49a857ec", "score": "0.60029584", "text": "def setup\n \n end", "title": "" }, { "docid": "7cb71aedec67762f6d4ac0d68bcf7551", "score": "0.6000233", "text": "def setup\n setup! unless setup?\n end", "title": "" }, { "docid": "207a668c9bce9906f5ec79b75b4d8ad7", "score": "0.5985587", "text": "def before_setup\n\n end", "title": "" }, { "docid": "8c78ba0e7d7261a5afc5d8c1605b3a77", "score": "0.59577984", "text": "def supports_cloud_init?\n true\n end", "title": "" }, { "docid": "7c070a066cd2eb6b96b9433d94357013", "score": "0.5928942", "text": "def setup\n fail \"#{__method__} not implemented\"\n end", "title": "" }, { "docid": "bac9fe0c17c216256074ab5cb8cb61f0", "score": "0.59244287", "text": "def setup\n raise StandardError.new('need setup method implementation.')\n end", "title": "" }, { "docid": "742ac26f5f86e407eade75d3e6b0ce3d", "score": "0.59186506", "text": "def before_install; end", "title": "" }, { "docid": "20638f95c3e787994c69666730576071", "score": "0.5915326", "text": "def setup\n CLASSLOG.debug \"Initializing #{self.to_s}.\"\n end", "title": "" }, { "docid": "97f432624879e52504e6ecb5c0bc7f1e", "score": "0.5915175", "text": "def setup\n super\n remove_all_pims if @@pre_clean_needed\n @@pre_clean_needed = false # rubocop:disable Style/ClassVars\n end", "title": "" }, { "docid": "991bee07aa9b9bf76f7c860030636367", "score": "0.59088945", "text": "def pre_initialize\n end", "title": "" }, { "docid": "dc310b8e6ffd61ccd7316a366b432fc4", "score": "0.5904078", "text": "def prepare\n raise NotImplementedError.new('The method should be overriden')\n end", "title": "" }, { "docid": "0bfce15e8b36bc148861ec0994b7f1a8", "score": "0.5902615", "text": "def provisional; end", "title": "" }, { "docid": "79bd5343d9d68edd7f51421535acf5ca", "score": "0.5899331", "text": "def setup\n # nothing to do by default\n end", "title": "" }, { "docid": "550592840c897d5bfd25b10037757792", "score": "0.5893151", "text": "def create_vm(attrs)\n attrs = attrs.dup\n attrs = convert_string_to_bool(attrs)\n\n if attrs[:cluster].present?\n attrs[:cluster] = client.system_service.clusters_service.cluster_service(attrs[:cluster]).get\n else\n if attrs[:cluster_name].present?\n cluster = client.system_service.clusters_service.list(:search => \"name=#{attrs[:cluster_name]}\").first\n else\n cluster = client.system_service.clusters_service.list(:search => \"datacenter=#{datacenter_hash[:name]}\").first\n attrs[:cluster_name] = cluster.name\n end\n\n attrs[:cluster] = cluster\n end\n\n vms_service = client.system_service.vms_service\n\n attrs[:type] = attrs.fetch(:type, OvirtSDK4::VmType::SERVER)\n attrs[:instance_type] = attrs[:instance_type].present? ? client.system_service.instance_types_service.instance_type_service(attrs[:instance_type]).get : nil\n\n if attrs[:template].present?\n attrs[:template] = client.system_service.templates_service.template_service(attrs[:template]).get\n else\n attrs[:template] = client.system_service.get.special_objects.blank_template\n update_os_attrs(attrs)\n end\n\n attrs[:comment] ||= \"\"\n attrs[:quota] = attrs[:quota].present? ? client.system_service.data_centers_service.data_center_service(datacenter).quotas_service.quota_service(attrs[:quota]).get : nil\n if attrs[:cores].present? || attrs[:sockets].present?\n cpu_topology = OvirtSDK4::CpuTopology.new(:cores => attrs.fetch(:cores, \"1\"), :sockets => attrs.fetch(:sockets, \"1\"))\n attrs[:cpu] = OvirtSDK4::Cpu.new(:topology => cpu_topology)\n end\n attrs[:memory_policy] = OvirtSDK4::MemoryPolicy.new(:guaranteed => attrs[:memory]) if attrs[:memory].to_i < Fog::Ovirt::Compute::DISK_SIZE_TO_GB\n attrs[:high_availability] = OvirtSDK4::HighAvailability.new(:enabled => attrs[:ha] == \"1\") if attrs[:ha].present?\n\n process_vm_disks(attrs) if attrs[:clone] == true && attrs[:disks].present?\n\n new_vm = OvirtSDK4::Vm.new(attrs)\n vms_service.add(new_vm, :clone => attrs[:clone])\n end", "title": "" }, { "docid": "b47c5d8fef84250b0e4b4b12e7703292", "score": "0.58917814", "text": "def setup(&block)\n define_method(:setup) do\n super()\n\n instance_exec(&block)\n end\n end", "title": "" }, { "docid": "3f57c9b42ca4b2b6f5ebf3bcee1aeda9", "score": "0.58878106", "text": "def after_setup\n # do nothing by default\n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.5886676", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.5886676", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.5886676", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.5886676", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.5886676", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.5886676", "text": "def setup\n \n end", "title": "" }, { "docid": "0e88625757db4ec72d353bc86812a228", "score": "0.5886676", "text": "def setup\n \n end", "title": "" }, { "docid": "bb55d2204f90520875c529c1f6e8052e", "score": "0.5881207", "text": "def init_base_vm(config)\n config.vm.box = \"bento/debian-11\"\n config.vm.box_check_update = false\n\n config.ssh.username = \"vagrant\"\nend", "title": "" }, { "docid": "c0a265132b708c0b051e18b1b23068dd", "score": "0.5880785", "text": "def setup\n nil\n end", "title": "" }, { "docid": "71d723f960c7dab637043e0a3a1fcde5", "score": "0.58777404", "text": "def setup\r\n end", "title": "" }, { "docid": "8233740f2a3115e29583d624ea5b3900", "score": "0.5869272", "text": "def before_running\n if @backend.nil?\n @backend = Backend.new(backend_name)\n @backend.reset\n end\n setup_container_name\n setup_family\n end", "title": "" }, { "docid": "c812c5d9eda0179060a4e2c8135d8c96", "score": "0.5867927", "text": "def provision!\n end", "title": "" }, { "docid": "06bb4c1cb41a3fca3152535a7c83cadf", "score": "0.5861913", "text": "def setup\n true\n end", "title": "" }, { "docid": "325239911f8bdbe9bd630f5a7c0e7342", "score": "0.58603376", "text": "def setup_default\n\n end", "title": "" }, { "docid": "325239911f8bdbe9bd630f5a7c0e7342", "score": "0.58603376", "text": "def setup_default\n\n end", "title": "" } ]
e216e581c3a61c8aaf7b3c15b53efa09
Gets the v12_0 property value. When TRUE, only Version 12.0 or later is supported. Default value is FALSE. Exactly one of the minimum operating system boolean values will be TRUE.
[ { "docid": "6edac1eb7e4a1175bdb9392f7d56215b", "score": "0.65491676", "text": "def v12_0\n return @v12_0\n end", "title": "" } ]
[ { "docid": "95ed54797cd6d00b014eee3d7e2bab11", "score": "0.5889997", "text": "def get_value\n read_attribute('boolean_value')\n end", "title": "" }, { "docid": "fe52559e171852772deea7afc06c82ed", "score": "0.56802547", "text": "def v11_0\n return @v11_0\n end", "title": "" }, { "docid": "be38d698ce0eac83b558bac558e54324", "score": "0.56351954", "text": "def unity_boolean_parameter(native_value)\n if native_value && native_value != 'N'\n 'Y'\n else\n 'N'\n end\n end", "title": "" }, { "docid": "2301fb61e6222ba1dc65385d01afab56", "score": "0.5622702", "text": "def v12_0=(value)\n @v12_0 = value\n end", "title": "" }, { "docid": "37fc68cf169ccfa904e24bf6df9e1e75", "score": "0.56214327", "text": "def get_feature_variable_boolean(feature_flag_key, variable_key, user_id, attributes = nil)\n unless @is_valid\n @logger.log(Logger::ERROR, InvalidDatafileError.new('get_feature_variable_boolean').message)\n return nil\n end\n\n variable_value = get_feature_variable_for_type(\n feature_flag_key,\n variable_key,\n Optimizely::Helpers::Constants::VARIABLE_TYPES['BOOLEAN'],\n user_id,\n attributes\n )\n\n variable_value\n end", "title": "" }, { "docid": "e8f52355ef19a96a753eadf916a36596", "score": "0.5617181", "text": "def object\n if option.value_type == 'boolean'\n (value || option.default_value) == 'Y'\n else\n null\n end\n end", "title": "" }, { "docid": "fde9a2b8174ce27361f52f134cee7fce", "score": "0.5614937", "text": "def v13_0\n return @v13_0\n end", "title": "" }, { "docid": "01333f1eb5a8cd93425aa5f09c16dbea", "score": "0.56114554", "text": "def get_feature_variable_boolean(feature_flag_key, variable_key, user_id, attributes = nil)\n unless is_valid\n @logger.log(Logger::ERROR, InvalidProjectConfigError.new('get_feature_variable_boolean').message)\n return nil\n end\n\n get_feature_variable_for_type(\n feature_flag_key,\n variable_key,\n Optimizely::Helpers::Constants::VARIABLE_TYPES['BOOLEAN'],\n user_id,\n attributes\n )\n end", "title": "" }, { "docid": "a1481b948f74ccb47f32a3d58a21ed38", "score": "0.5601888", "text": "def feature_pay_visa?\n feature_pay_visa == 'true'\n end", "title": "" }, { "docid": "65c385f38bd2acf86c56735cc117cc36", "score": "0.55600053", "text": "def check_nv_toggle\n return @dnv.get_value()\n end", "title": "" }, { "docid": "10c8c8347b29bedbeed1de0f10cabfba", "score": "0.54581255", "text": "def v9_0\n return @v9_0\n end", "title": "" }, { "docid": "b67cf93515aa3ece5603a50b46a39014", "score": "0.5427893", "text": "def support_wkt12?\n @support_wkt12\n end", "title": "" }, { "docid": "8db06386b6c5c36af1d8b498168291aa", "score": "0.5406873", "text": "def getPropertyAsBoolean(tree, userAgent, property)\n _propertyTypeCheck(tree, property, \"b\", \"boolean\")\n _getProperty(tree, userAgent, property, true)\n end", "title": "" }, { "docid": "b69066adc33771406b239882563d8734", "score": "0.54004717", "text": "def show_version?\n @options.key?(:version)\n end", "title": "" }, { "docid": "506ea8318725f4a72a08dea8632741d9", "score": "0.5383875", "text": "def boolean name, opts={}\n v_attribute name, Boolean, opts\n end", "title": "" }, { "docid": "2487478cfe0a70e3252928d9e2f966ff", "score": "0.5381207", "text": "def feature_live_service?\n feature_live_service == 'true'\n end", "title": "" }, { "docid": "e31714e570ee36fcaeba29dc6fbc7c58", "score": "0.5366426", "text": "def boolean(key)\n value = CONFIG[key]\n check_value!(key, value, Boolean)\n value.nil? ? None : Some(value.to_java(:boolean))\n end", "title": "" }, { "docid": "a52c62825ccbb7bee9bde33651c54c02", "score": "0.5353297", "text": "def to_boolean value\n\t\t\tif value == \"true\"\n\t\t\t\treturn true\n\t\t\telse\n\t\t\t\treturn false\n\t\t\tend\n\t\tend", "title": "" }, { "docid": "2b9ac88bbaa66d43d2a7271901b9319b", "score": "0.5323915", "text": "def boolean(value = true)\n Types::Boolean.new(value)\n end", "title": "" }, { "docid": "263cc5a785bf9c91933f0e50dd328397", "score": "0.5323847", "text": "def v14_0\n return @v14_0\n end", "title": "" }, { "docid": "8ce4597a083d70d56f54d499449ee6c3", "score": "0.5317225", "text": "def bool\n Cproton.pn_data_get_bool(@impl)\n end", "title": "" }, { "docid": "306ad6e860a0f172f3428bd9e785a856", "score": "0.5305226", "text": "def version?\n @option_config.name == 'version'\n end", "title": "" }, { "docid": "fce0862745a160ee51ad90c93a8211e1", "score": "0.5295447", "text": "def supports_is_true?\n false\n end", "title": "" }, { "docid": "fce0862745a160ee51ad90c93a8211e1", "score": "0.5295447", "text": "def supports_is_true?\n false\n end", "title": "" }, { "docid": "fce0862745a160ee51ad90c93a8211e1", "score": "0.5295447", "text": "def supports_is_true?\n false\n end", "title": "" }, { "docid": "fce0862745a160ee51ad90c93a8211e1", "score": "0.5295447", "text": "def supports_is_true?\n false\n end", "title": "" }, { "docid": "fce0862745a160ee51ad90c93a8211e1", "score": "0.5295447", "text": "def supports_is_true?\n false\n end", "title": "" }, { "docid": "fce0862745a160ee51ad90c93a8211e1", "score": "0.5295447", "text": "def supports_is_true?\n false\n end", "title": "" }, { "docid": "fce0862745a160ee51ad90c93a8211e1", "score": "0.5295447", "text": "def supports_is_true?\n false\n end", "title": "" }, { "docid": "fce0862745a160ee51ad90c93a8211e1", "score": "0.5295447", "text": "def supports_is_true?\n false\n end", "title": "" }, { "docid": "e1541c502f35e631bbd90b559df94caf", "score": "0.529349", "text": "def isProductionVersion?\n\t\treturn true\n\tend", "title": "" }, { "docid": "500fd3af72061fc02c77908b8f9cbb6e", "score": "0.5290932", "text": "def variable?\n @variable or vrb?\n end", "title": "" }, { "docid": "da1f073b776d12f7bfc5b902c3f50e3b", "score": "0.5284559", "text": "def v10_0\n return @v10_0\n end", "title": "" }, { "docid": "0dcc1a5f0cc50a49043d29db8930c41a", "score": "0.52702284", "text": "def payment_features_enabled?\n current_user&.beta_tester || bath_live?\n end", "title": "" }, { "docid": "c5a98826835c65845ed3c19a4160e0ad", "score": "0.5256485", "text": "def supports_is_true?\n false\n end", "title": "" }, { "docid": "c5a98826835c65845ed3c19a4160e0ad", "score": "0.5256485", "text": "def supports_is_true?\n false\n end", "title": "" }, { "docid": "c5a98826835c65845ed3c19a4160e0ad", "score": "0.5256485", "text": "def supports_is_true?\n false\n end", "title": "" }, { "docid": "1e09fbe76156e7098839dc654f47b887", "score": "0.5252722", "text": "def strict_motif\n @strict_motif.to_boolean\n end", "title": "" }, { "docid": "4dda268ec86f1dc4a9f494faed5ea572", "score": "0.525166", "text": "def pkcs12_value\n return @pkcs12_value\n end", "title": "" }, { "docid": "5a81ce2372da97abb7207cbdde9e5043", "score": "0.5248657", "text": "def bool\n Cproton.pn_data_get_bool(@data)\n end", "title": "" }, { "docid": "227034f0bcd54df5e284a78f3d9f08b0", "score": "0.5241937", "text": "def as_boolean\n Parametrized::Transformation::AsBoolean.instance\n end", "title": "" }, { "docid": "9263ff08c89d44dc2768c4e6cd6a0e75", "score": "0.5235191", "text": "def display_value\n device_property_type&.config? ? I18n.t(:enabled) : value\n end", "title": "" }, { "docid": "baa6a712bb01a7ba72b0dfa7181070bd", "score": "0.5233868", "text": "def is_default_version\n data.is_default_version\n end", "title": "" }, { "docid": "70fefc1a547cd1f33f31dde08da4e0e4", "score": "0.52303797", "text": "def build_version; property(@device.PROP_BUILD_VERSION) end", "title": "" }, { "docid": "ae8ecf9d3d244ddfa58c3d33ad9deec7", "score": "0.5223705", "text": "def boolean()\n return 'true'==strip() ? true : false\n end", "title": "" }, { "docid": "4b39a7d6081d9bc88c0677531bbb20e0", "score": "0.5221586", "text": "def boolean_attribute_get(instance, name)\n default_attribute_get(instance, name)\n end", "title": "" }, { "docid": "b45092cad987857cbd167c36674a47af", "score": "0.52021945", "text": "def output_value(key, value)\n if self.class.boolean_attributes.include?(key)\n (value ? \"yes\" : \"no\")\n else\n value\n end\n end", "title": "" }, { "docid": "7a8975dd4372ab81617695f4b5ddd329", "score": "0.51871455", "text": "def literal_true\n if db.svn_version >= 1040133\n 'TRUE'\n else\n '(1 = 1)'\n end\n end", "title": "" }, { "docid": "f5b2da5211a018c9b5ac203b9dcc2a11", "score": "0.5185989", "text": "def config_get_nu\n @settings[:nu] == \"true\"\n end", "title": "" }, { "docid": "c5a9f2280049e2e2e82d211594401484", "score": "0.5185971", "text": "def boolean_value value, default=false\n if default\n value != \"false\"\n else\n value == \"true\"\n end\n end", "title": "" }, { "docid": "c5a9f2280049e2e2e82d211594401484", "score": "0.5185971", "text": "def boolean_value value, default=false\n if default\n value != \"false\"\n else\n value == \"true\"\n end\n end", "title": "" }, { "docid": "c5a9f2280049e2e2e82d211594401484", "score": "0.5185971", "text": "def boolean_value value, default=false\n if default\n value != \"false\"\n else\n value == \"true\"\n end\n end", "title": "" }, { "docid": "0e0daf17607654e6f1ba741c941ce6a2", "score": "0.51855046", "text": "def boolean?\n @option_config.boolean? && !help? && !version?\n end", "title": "" }, { "docid": "e9d294a33f99f541e00885ed6815963a", "score": "0.5166919", "text": "def versioning?\n @gapi.versioning&.enabled?\n end", "title": "" }, { "docid": "f3771309f569dded5eeb7a0e6d1a8091", "score": "0.5165992", "text": "def supports_is_true?\n true\n end", "title": "" }, { "docid": "f3771309f569dded5eeb7a0e6d1a8091", "score": "0.5165992", "text": "def supports_is_true?\n true\n end", "title": "" }, { "docid": "d616ef081746896909328b1d360763da", "score": "0.5148172", "text": "def typus_boolean(attribute = :default)\n options = read_model_config['fields']['options']\n\n boolean = if options && options['booleans'] && boolean = options['booleans'][attribute.to_s]\n boolean.is_a?(String) ? boolean.extract_settings : boolean\n else\n [\"True\", \"False\"]\n end\n\n [[boolean.first, \"true\"], [boolean.last, \"false\"]]\n end", "title": "" }, { "docid": "4aac5667d35770bd907b749793b38ad8", "score": "0.51417416", "text": "def boolean_type?(property)\n property ? property.type == 'Boolean' : false\n end", "title": "" }, { "docid": "7e72ab24468ff453c5af55ff62490834", "score": "0.5140835", "text": "def __value(v)\n case v\n when 'false'\n false\n when 'true'\n true\n else\n Integer(v) rescue Float(v) rescue v\n end\n end", "title": "" }, { "docid": "f9ef4aa29198b920988ddf99a5cac741", "score": "0.51394486", "text": "def v120\n fetch_version(:v120)\n end", "title": "" }, { "docid": "e4d8e01d42980f0ccc5bfb1806266b51", "score": "0.51388377", "text": "def default_version?\n @default.present?\n end", "title": "" }, { "docid": "adeeda74dd41ae401ea3305b58d118d3", "score": "0.5130327", "text": "def boolean\n return @boolean\n end", "title": "" }, { "docid": "14b03494f6d7527090e9aca23146596d", "score": "0.51147825", "text": "def bool(var_name, default = nil)\n EnvHelpers.bool(var_name, default)\n end", "title": "" }, { "docid": "7ce213206638774380f9b339dac5849f", "score": "0.51042986", "text": "def literal_false\n if db.svn_version >= 1040133\n 'FALSE'\n else\n '(1 = 0)'\n end\n end", "title": "" }, { "docid": "930a58cf642f92723c1cebafb64f1840", "score": "0.5096984", "text": "def visibility\n variant.product.available?.to_s\n end", "title": "" }, { "docid": "8136aeb260a693400546f4c3c16fb494", "score": "0.50921875", "text": "def read_boolean\n read_atom(Q_TYPE_BOOLEAN)\n end", "title": "" }, { "docid": "91b672b909562217465193a8db1fcafc", "score": "0.50744003", "text": "def has_provision_vmagent?\n if defined?(properties.osProfile.windowsConfiguration)\n properties.osProfile.windowsConfiguration.provisionVMAgent\n else\n false\n end\n end", "title": "" }, { "docid": "c2fa96520225cfd4097a4756d044a30c", "score": "0.506415", "text": "def feature_pay_amex?\n feature_pay_amex == 'true'\n end", "title": "" }, { "docid": "996549bc141e4d0d5dc4408ed1c2b66c", "score": "0.5059952", "text": "def current_version?\n true\n end", "title": "" }, { "docid": "996549bc141e4d0d5dc4408ed1c2b66c", "score": "0.5059952", "text": "def current_version?\n true\n end", "title": "" }, { "docid": "745a63cbed1da7d60d862793c8fe8d29", "score": "0.50558907", "text": "def versioning?\n !@gapi[\"versioning\"].nil? && @gapi[\"versioning\"][\"enabled\"]\n end", "title": "" }, { "docid": "51d733d0609cbe752425e211d8ff48cb", "score": "0.5055187", "text": "def fetch_boolean(attr=nil)\n return @browser.fetch_boolean(attr)\n end", "title": "" }, { "docid": "0555c4bc786647ca4f941c82768ae457", "score": "0.5053476", "text": "def literal_true\n BOOL_TRUE\n end", "title": "" }, { "docid": "520b5b2bc21177600712fc785216738a", "score": "0.50500643", "text": "def version\n if instance_variable_defined?(:@version) && [email protected]?\n return @version\n elsif attributes[:version_given?]\n # 'version_given?' will be true in cases where the\n # fpm command-line tool has been given '-v' or '--version' settings\n # We do this check because the default version is \"1.0\"\n # on the fpm command line.\n return attributes.fetch(:version)\n end\n\n # No version yet, nil.\n return nil\n end", "title": "" }, { "docid": "6f249a7c70e33a23fbbe5177e7db3c08", "score": "0.5047326", "text": "def to_boolean(ctx,value)\n JavaScriptCore::Lib.JSValueToBoolean(ctx,value)\n end", "title": "" }, { "docid": "8be42934fdd76c1f3c7687c45cff0969", "score": "0.5046726", "text": "def to_boolean(ctx,value)\n JS::Lib.JSValueToBoolean(ctx,value)\n end", "title": "" }, { "docid": "a24a7aa92e56d8c93d54b33f5b8363b9", "score": "0.5037503", "text": "def qg_bool(value, default_value_key)\n return value if (!!value) == value\n return @_default[default_value_key] unless value.kind_of?(String)\n case value.downcase\n when 'false', '0', 'no', '-', 'f', 'n', 'off'\n return false\n when 'true', '1', 'yes', '+', 't', 'y', 'on'\n return true\n end\n @_default[default_value_key]\n end", "title": "" }, { "docid": "f7d1e969ec8fd67a85e1c8de9e5a2e9b", "score": "0.50291604", "text": "def feature_pay_mastercard?\n feature_pay_mastercard == 'true'\n end", "title": "" }, { "docid": "bcd419b9416fee7b2d15cd244d857a6c", "score": "0.50052243", "text": "def is_true_value(v)\n if v.nil?\n return false\n elsif v == false\n return false\n elsif v.to_s.downcase == 'true'\n return true\n end\n return false\n end", "title": "" }, { "docid": "5e9b2caa8909d462ae473562fe216cde", "score": "0.5004347", "text": "def boolean_type?(property)\n property ? property.primitive == TrueClass : false\n end", "title": "" }, { "docid": "c44992f6a26f70618828697c91f28c9e", "score": "0.50030506", "text": "def from_boolean(value)\n return if value.nil?\n value ? 1 : 0\n end", "title": "" }, { "docid": "be3a4b78524d5452519d6f072afa9b51", "score": "0.49923202", "text": "def version_support\n attributes.fetch(:versionSupport)\n end", "title": "" }, { "docid": "d2866fc59fe4b18b6ec80b17db742566", "score": "0.49858758", "text": "def literal_true\n BOOL_TRUE\n end", "title": "" }, { "docid": "f51aab4be1f5467b3c331a415542d6a2", "score": "0.49762213", "text": "def v15_0\n return @v15_0\n end", "title": "" }, { "docid": "102d189ec2cf6c11c2afd0964310bf0a", "score": "0.4973154", "text": "def to_boolean(value)\n value == Constant::ON ? true : false\n end", "title": "" }, { "docid": "0fec66697bc0e250684fe4fa112aadd3", "score": "0.49717283", "text": "def version_gte_120?\n version >= v120\n end", "title": "" }, { "docid": "8d41651264e1dd1b2e11d68c986594db", "score": "0.49599075", "text": "def version\n get_prop('ro.build.version.release')\n end", "title": "" }, { "docid": "709efbc076eea4184ad592d9cda3dcf3", "score": "0.49581483", "text": "def true_version\n # supplied version is \"current\"\n if self.version.casecmp(\"current\") == 0\n self.next_release[\"name\"]\n # supplied version is not \"current\", just return supplied version\n else \n self.version\n end\n end", "title": "" }, { "docid": "5ba940235a26145117db90cee8d1afba", "score": "0.4957945", "text": "def server_default?\n # Do not convert to boolean\n @spec['isServerDefault']\n end", "title": "" }, { "docid": "ef863de66d5bfd32600eb8ddc04ef1db", "score": "0.4949805", "text": "def properties\n { 'object_type' => 'boolean', 'value' => @value }\n end", "title": "" }, { "docid": "0264aaf1f7febcf6ea8f554a1968cf67", "score": "0.49492767", "text": "def is_video_on_demand_enabled\n return @is_video_on_demand_enabled\n end", "title": "" }, { "docid": "3f48e4295f1ecb5554effb079b55ab4c", "score": "0.49491444", "text": "def env_to_bool(var, default = nil, deprecation_warning: true)\n var = decode_array(var, deprecation_warning)\n if var && ENV.key?(var)\n value = ENV[var].to_s.strip\n value.downcase!\n value == 'true' || value == '1' # rubocop:disable Style/MultipleComparison\n else\n default\n end\n end", "title": "" }, { "docid": "357ddecc430c1831bde026de262dce1c", "score": "0.49430308", "text": "def jruby_9k_enabled?\n pe_server_version = Facter.value('pe_server_version') || 'NOT NIL'\n pe_server_version.start_with? '2018'\n end", "title": "" }, { "docid": "925b42cb924abb3b248847e8e4855387", "score": "0.49356568", "text": "def get_bool(key, default=nil)\n return default if params[key].nil? || params[key].class != String\n return true if (/^(1|true|t|on|yes)$/ === params[key])\n return false if (/^(0|false|f|off|no|)$/ === params[key])\n return default\n end", "title": "" }, { "docid": "da043f381f5bdce45daa21cfd7777b59", "score": "0.49304885", "text": "def is_true?\n\t\treturn self.value == true\n\tend", "title": "" }, { "docid": "4acdf69bb68d353e08ab4df2d6c37ee6", "score": "0.49265772", "text": "def is_preferred_support\n attributes.fetch(:isPreferredSupport)\n end", "title": "" }, { "docid": "4acdf69bb68d353e08ab4df2d6c37ee6", "score": "0.4926479", "text": "def is_preferred_support\n attributes.fetch(:isPreferredSupport)\n end", "title": "" }, { "docid": "9910aa6f162874c042dd408acc66129a", "score": "0.4922182", "text": "def parse_to_true_false_string(only_yes = false)\n fail MissingValueError.new(var: var) if vals.empty?\n fail TooManyValuesError.new(var: var) if vals.length > 1\n val = vals.first\n return \"TRUE\" if val.match(/^(1|yes|true)$/i)\n return \"FALSE\" if val.match(/^(0|no|false)$/i) && !only_yes\n fail BadYesError.new(var: var, val: val) if only_yes\n fail BadBooleanError.new(var: var, val: val)\n end", "title": "" }, { "docid": "c3c55eccb64d59c1a2767189cac78c47", "score": "0.49181575", "text": "def boolean(key, options = {})\n cast(:boolean, key, options)\n end", "title": "" }, { "docid": "5e3e246855c598865711a6813a397de1", "score": "0.4915472", "text": "def test_get_feature_variable_value_boolean_from_rollout\n set_up('FR_T_75_W_100')\n result = nil\n boolean_variable = USER_EXPECTATIONS['ROLLOUT_VARIABLES']['BOOLEAN_VARIABLE']\n USER_EXPECTATIONS['T_75_W_10_20_30_40'].each do |test|\n result = @vwo.get_feature_variable_value(\n 'FR_T_75_W_100',\n 'BOOLEAN_VARIABLE',\n test['user']\n )\n end\n assert_equal(result, boolean_variable) if result\n end", "title": "" } ]
1376923d20f97d4d1c6a4d85d74dff14
Here is the test for four of a kind
[ { "docid": "ed064b527ebc89011e6c9391d89863b1", "score": "0.0", "text": "def white_four(white_numbers)\n white = white_numbers\n if (white[0] == white[1]) && (white[0] == white[2]) && (white[0] == white[3])\n w_4s = \"Four of a kind, #{white[0]}s.\"\n elsif (white[1] == white[2]) && (white[1] == white[3]) && (white[1] == white[4])\n w_4s = \"Four of a kind, #{white[1]}s.\"\n end\nend", "title": "" } ]
[ { "docid": "314a01f527762e05559c2535f202ce35", "score": "0.7614617", "text": "def check_four_of_a_kind\n return check_matches(2, @cards)\n end", "title": "" }, { "docid": "c7a0ae811b8c8edb71b673a8a488011d", "score": "0.7453807", "text": "def four_of_a_kind?\n # Lol, for a second I was wondering why there's five-of-a-kind\n of_a_kind?(4)\n end", "title": "" }, { "docid": "2b9e9831749125553aa2e9fe60e7ade0", "score": "0.74070185", "text": "def four_of_a_kind?\n find_matches.any?{|_k,group|group.size == 4}\n end", "title": "" }, { "docid": "d55f83d789e671d4c6526db328854c47", "score": "0.7272516", "text": "def four_of_a_kind?\n counts = array_counts(card_values).values\n return counts.include?(4)\n end", "title": "" }, { "docid": "a6a51095d8374ff7ab589bd256be3ef9", "score": "0.72644097", "text": "def four_of_a_kind?\n return true if wilds >= 3\n sh[1].face == sh.last.face || sh.first.face == sh[sh.size - 2].face\n end", "title": "" }, { "docid": "801f9f712e91de1d1f9962884af1a5a4", "score": "0.7259244", "text": "def test_four_of_a_kind\n hand = Hands::Hand.new\n hand << Hands::Card[7, :hearts]\n hand << Hands::Card[7, :spades]\n hand << Hands::Card[7, :diamonds]\n hand << Hands::Card[7, :clubs]\n hand << Hands::Card[9, :clubs]\n assert_equal :four_of_a_kind, hand.best_hand[:type]\n end", "title": "" }, { "docid": "d36c14575e951e7b80867898fd1f2cb7", "score": "0.7207302", "text": "def four_of_a_kind?\n numbers = @hand_hash.values.flatten.sort\n return numbers.count(numbers[0]) == 4 || numbers.count(numbers[1]) == 4\n end", "title": "" }, { "docid": "964f87fbcb160db587b4cbb1abd115b5", "score": "0.7102202", "text": "def four_of_a_kind?(hand)\n hand.each { |k, v| \n if v == 4\n return true\n end\n }\n\nend", "title": "" }, { "docid": "639d281047a137e5b8c4d79962a796b1", "score": "0.7088389", "text": "def four_of_kind?\n\t\tsort_by_number!\n\t\tnumbers = Hash.new(0)\n\t\[email protected] do |card|\n\t\t\tnumbers[card.number] += 1\n\t\tend\n\t\tnumbers.each do |number, size|\n\t\t\treturn true if size == 4\n\t\tend\n\t\treturn false\n\tend", "title": "" }, { "docid": "c6471afa2141075c103653c2c36af56b", "score": "0.7085563", "text": "def four_of_a_kind?\n return hash_of_rank_count.values.sort == [1,4]\n end", "title": "" }, { "docid": "d157ea6a82d6ed15b617004b1b2f3fbc", "score": "0.69623744", "text": "def hand_has_four_of_a_kind?(hand)\n has = false\n \n #Used to hold pairs in this case\n @temp_array = Array.new \n \n #Get all three of a kinds from hand\n hand = (hand.sort_by {|c| c.get_compare_value}).reverse\n current = hand[0]\n match_counter = 1\n for i in 1...hand.length\n if(current.get_value == hand[i].get_value)\n match_counter += 1\n if(match_counter == 4)\n has = true\n @temp_array << hand[i]\n @temp_array << hand[i-1]\n @temp_array << hand[i-2]\n @temp_array << hand[i-3]\n @hand_value += FOUR_OF_A_KIND_VALUE + COMBO_VALUE_MULTIPLIER * (hand[i].get_value)\n break\n end\n else\n match_counter = 1\n current = hand[i] \n end\n end\n return has\n end", "title": "" }, { "docid": "e8da08e270834181004c6389f0ca2bb7", "score": "0.69369286", "text": "def four_of_a_kind?\n\t\[email protected]?(4) ? [true, [8, [@frequency.key(4)]]] : false\n\tend", "title": "" }, { "docid": "97c1e11c4a854ada768f03ae77deb44b", "score": "0.6935897", "text": "def four_kind()\n ranks = []\n self.hand.each {|card| ranks << card.rank[0] }\n\n return ranks.any? { |ele| ranks.count(ele) == 4}\n end", "title": "" }, { "docid": "d78e8a53118647d046f3800815d5d5cf", "score": "0.6922804", "text": "def four_of_a_kind?\n cards.each_with_index do |card, index1|\n matching_cards = [card]\n match_count = 1\n (index1+1...cards.length).each do |index2|\n if card.value == cards[index2].value\n match_count += 1\n matching_cards << cards[index2]\n end\n end\n if match_count == 4\n matching_cards.each {|card| cards_to_test.delete(card)}\n return [true, matching_cards]\n end\n end\n [false]\n end", "title": "" }, { "docid": "9600f0f018947d6e8949c817ae4dba97", "score": "0.6897422", "text": "def check_four_of_a_kind(cards)\n kinds = parse_cards(cards)\n max = { 'type' => '', 'size' => 0 }\n kinds.each do |kind|\n if kind[1] > max['size']\n max['size'] = kind[1]\n max['type'] = kind[0].to_i\n end\n end\n return false unless max['size'] == 4\n win = []\n cards.each do |card|\n win.push(card) if card['type'] == max['type']\n end\n win\n end", "title": "" }, { "docid": "f3f74651e86b66767643acf30d74a1a7", "score": "0.6890042", "text": "def four_of_a_kind?\n type == HandType::FOUR_OF_A_KIND\n end", "title": "" }, { "docid": "c6c860afe6decc7e5ef409bcf5ad6751", "score": "0.68538475", "text": "def four_of_a_kind?(ranks)\r\n # For each rank...\r\n ranks.each do |val|\r\n # If there are exactly four of that value in the ranks array, return that value\r\n return val if ranks.count(val) == 4\r\n end\r\n \r\n # No four of a kind was found. Return false\r\n return false\r\n end", "title": "" }, { "docid": "ad0778580fa3f9bbc88f20dafe6ec5c8", "score": "0.68220603", "text": "def four_of_a_kind?(h)\n h.values.one? { | sub_arr | sub_arr.length == 4 }\n end", "title": "" }, { "docid": "2b39ea9618fecbd57a7873a3cdee200e", "score": "0.6808045", "text": "def four_of_a_kind?\n histogram.any? {|pip,count| count == 4 } && PIP_FOR[@cards.map{|pip,_|pip}.sort[1]]\n end", "title": "" }, { "docid": "a6fa3ac68cdee29c60c8f7b8aa87e15d", "score": "0.6606955", "text": "def three_of_a_kind?\n n_of_a_kind(3)\n end", "title": "" }, { "docid": "9dbf138a597a4072b77d2aeb98a9b955", "score": "0.6570276", "text": "def test_three_of_a_kind\n hand = Hands::Hand.new\n hand << Hands::Card[7, :hearts]\n hand << Hands::Card[7, :spades]\n hand << Hands::Card[7, :diamonds]\n hand << Hands::Card[3, :hearts]\n hand << Hands::Card[9, :clubs]\n assert_equal :three_of_a_kind, hand.best_hand[:type]\n end", "title": "" }, { "docid": "d89ed4fba1ada98a7d83fc8dc254a7c2", "score": "0.65395164", "text": "def four_of_a_kind?\n @faces.uniq.length == 2 && faces.any? { |face| faces.count(face) == 4 }\n end", "title": "" }, { "docid": "a17a78886fd5d9d2141e8350c1f9ddc1", "score": "0.6516928", "text": "def test_a_deck_contains_four_of_each_face_of_cards\n end", "title": "" }, { "docid": "d9e28662fb150b3f055c53826096b862", "score": "0.6482182", "text": "def check_three_of_a_kind\n return check_matches(1, @cards)\n end", "title": "" }, { "docid": "b033196dc6186995b318de24f360572c", "score": "0.64719373", "text": "def three_of_a_kind?\n of_a_kind?(3)\n end", "title": "" }, { "docid": "e79f69d5a2c9afcce1a359d5c98962e5", "score": "0.64020115", "text": "def four_deuces?\n wilds == 4\n end", "title": "" }, { "docid": "38eecb458de3706918ccaefdf7ac8c88", "score": "0.63700545", "text": "def three_of_a_kind?\n case wilds\n when 2, 3, 4, 5\n true\n when 1\n natural_pair?\n when 0\n sh[0].face == sh[2].face ||\n sh[1].face == sh[3].face ||\n sh[2].face == sh[4].face\n end\n end", "title": "" }, { "docid": "13a8a858aaff990e14639cfeba08919a", "score": "0.63572806", "text": "def test_pick_four_of_a_kind\n cards = \"4C 7D 7H 3S 7C 10H 7S\"\n assert_equal \"Four of a Kind (7 high)\", TexasHoldEm.new(cards).best_hand\n end", "title": "" }, { "docid": "c97f5dd6cb12c89709738e7686716d83", "score": "0.6341024", "text": "def three_of_a_kind?\n find_matches.any?{|_k,group|group.size == 3}\n end", "title": "" }, { "docid": "8e9d58ff30036fcfb09efe3ff02c64c1", "score": "0.63201064", "text": "def three_of_a_kind?\n n_of_a_kind(@values).length == 3\n end", "title": "" }, { "docid": "b6a7cfca82ae0bbe63cb46b28d4f84b2", "score": "0.6295908", "text": "def four_of_a_kind\n rank_code = nil\n\n values = @cards.collect(&:value)\n\n uniq_values = values.uniq\n first_value = uniq_values.first\n second_value = uniq_values[1]\n\n if values.count(first_value) == 4\n rank_code = \"08|#{format_code([first_value] * 4, second_value)}\"\n elsif values.count(second_value) == 4\n rank_code = \"08|#{format_code([second_value] * 4, first_value)}\"\n end\n\n rank_code\n end", "title": "" }, { "docid": "a26763aead81f3574725b8c8bbd14d87", "score": "0.6177507", "text": "def five_of_a_kind?\n sh.first.face == sh.last.face\n end", "title": "" }, { "docid": "a5629fbc854ae34fa2ec9e0a182a3e0d", "score": "0.6145144", "text": "def three_of_a_kind?(hand)\n hand.each { |k, v| \n if v == 3\n return true\n end\n }\nend", "title": "" }, { "docid": "cbb9238fea9d2d561d1097287a5ec3eb", "score": "0.6123334", "text": "def three_of_kind?\n\t\tsort_by_number!\n\t\tnumbers = Hash.new(0)\n\t\[email protected] do |card|\n\t\t\tnumbers[card.number] += 1\n\t\tend\n\t\tnumbers.each do |number, size|\n\t\t\treturn true if size == 3\n\t\tend\n\t\treturn false\n\tend", "title": "" }, { "docid": "4dfdc0789fbee124bad55e71ca3c80af", "score": "0.61102957", "text": "def three_of_a_kind?\n counts = array_counts(card_values).values\n return counts.include?(3)\n end", "title": "" }, { "docid": "2a5a093c41c83fce6bb7ec62c4f0220e", "score": "0.60783356", "text": "def three_of_a_kind?\n return hash_of_rank_count.values.sort == [1,1,3]\n end", "title": "" }, { "docid": "f9ddfdf62a70895b2fd75af9487c5fc9", "score": "0.60451293", "text": "def threeofkind(array)\n i = 0\n #Check if it has 3 of a kind\n for elements in array\n if array[i] == 3\n return true\n else\n i += 1\n end\n end\n return false\n end", "title": "" }, { "docid": "d9aa184856d93b519bbed9844615a922", "score": "0.6044019", "text": "def fourth; end", "title": "" }, { "docid": "0ac07caf3ee5dd8aac21a8404af07980", "score": "0.60292083", "text": "def four_fours?(n)\n n.prime_division == 4 &&\n (n + 1).prime_division == 4 &&\n (n + 2).prime_division == 4 &&\n (n + 3).prime_division == 4\n end", "title": "" }, { "docid": "9cacc4970cec45b9dfbaba3ba8c4df39", "score": "0.6013556", "text": "def check_three_of_a_kind(cards)\n kinds = parse_cards(cards)\n max = { 'type' => '', 'size' => 0 }\n kinds.each do |kind|\n if kind[1] > max['size']\n max['size'] = kind[1]\n max['type'] = kind[0].to_i\n end\n end\n return false unless max['size'] == 3\n win = []\n cards.each do |card|\n win.push(card) if card['type'] == max['type']\n end\n win\n end", "title": "" }, { "docid": "041a064ed745c34e062aa434c23f25d2", "score": "0.60074705", "text": "def check_pairs\n pairs = @values.select{|value| @values.count(value) > 1}.uniq\n case @unique_cards\n when 2\n pairs.size == 1 ? four_of_kind(pairs) : full_house(pairs)\n when 3\n pairs.size == 1 ? three_of_kind(pairs) : two_pair(pairs)\n else\n two_of_kind(pairs)\n end\n end", "title": "" }, { "docid": "f8c4647ff5fafe63dfcdd5ffc35e2d5c", "score": "0.60013676", "text": "def test_1_4\n expected = [true, false, false, false]\n actual = EuclideanRhythm.euclidean_rhythm(1, 4)\n assert_equal expected, actual\n end", "title": "" }, { "docid": "a2aef7d0f49548452f0e79418e093869", "score": "0.598227", "text": "def four_of_a_kind?\n # loop for each \"card_one\"\n # loop over the cards and count\n # how many are the same as \"card_one\"\n # \"Jack\" == \"Jack\" + found 1 match \"Jack\"\n # \"Jack\" == \"Queen\" \n # \"Jack\" == \"Queen\" # there are not 4 jacks\n # 'break' stop the loop\n # loop for each \"card_one\"\n # loop over the cards and count\n # how many are the same as \"card_one\"\n # \"Queen\" == \"Jack\"\n # \"Queen\" == \"Queen\" # found 1 match \"queen\"\n # \"Queen\" == \"Queen\" # found 2 match \"queen\"\n # 'break' stop the loop\n \n end", "title": "" }, { "docid": "6d33659add9864b93fc473885bb46b4c", "score": "0.5976704", "text": "def three_of_a_kind?\n\t\[email protected]?(3) ? [true, [4, [@frequency.key(3)]]] : false\n\tend", "title": "" }, { "docid": "a3b5252d277e485703d448dfe231584c", "score": "0.59762347", "text": "def test_chunk_someMatch\n assert_equal [[true, [3]], [false, [2]], [true, [9]]], @triple.chunk { |e| e % 3 == 0 }.to_a\n end", "title": "" }, { "docid": "a3864ed22ed709b067c064f7be595355", "score": "0.59683573", "text": "def binary_multiple_of_4?(s)\r\n \ts[/\\A[01]+\\Z/] && (s.to_i(2)%4==0) ? TRUE : FALSE\r\nend", "title": "" }, { "docid": "cfc48662988ef09f3022fa928243c2b4", "score": "0.59474975", "text": "def test_fourth_valid\n\t\tassert_equal 'valid', @methods.fourth_check('Hospital', 'Monroeville')\n\tend", "title": "" }, { "docid": "b6a75576078b6a38a714e7222b923970", "score": "0.5940361", "text": "def evaluate\n five_of_a_kind? ||\n straight_flush? ||\n four_of_a_kind? ||\n full_house? ||\n flush? ||\n straight? ||\n three_of_a_kind? ||\n two_pair? ||\n one_pair? ||\n high_card\n end", "title": "" }, { "docid": "2b09d3feb36e9810a8b46ed8f7f4b2b1", "score": "0.5928364", "text": "def three_of_a_kind?\n cards.each_with_index do |card, index1|\n matching_cards = [card]\n match_count = 1\n (index1+1...cards.length).each do |index2|\n if card.value == cards[index2].value\n match_count += 1 \n matching_cards << cards[index2]\n end\n end\n if match_count == 3\n matching_cards.each {|card| cards_to_test.delete(card)}\n return [true, matching_cards]\n end\n end\n [false]\n end", "title": "" }, { "docid": "cd550039cf61f13adee1ee37abdc7c18", "score": "0.5924936", "text": "def result_win?(result)\n result == [:exact_match]*4\n end", "title": "" }, { "docid": "f06e9f483f680addf20340209aa07a36", "score": "0.5921844", "text": "def test_fifth_valid\n\t\tassert_equal 1, @methods.fifth_check('Downtown', 'Museum')\n\tend", "title": "" }, { "docid": "daf9dba8ba68b00435fab8fd162d13e5", "score": "0.59132254", "text": "def test_chunk_noneMatch\n assert_equal [[false, [3, 2, 9]]], @triple.chunk { |e| e % 4 == 0 }.to_a\n end", "title": "" }, { "docid": "89844c805fda4f93d740a59cc8752aa5", "score": "0.5910815", "text": "def test_Tipo\n\t\n\tassert_equal(true, @dispersa1.is_a?(MatrizDispersa))\n\tassert_equal(true, @densa1.is_a?(MatrizDensa))\n\tassert_equal(true, (@densa1+@densa3).is_a?(MatrizDispersa))\n\n\n\tend", "title": "" }, { "docid": "50cf2690995d4ba8a1623fb01d3d998f", "score": "0.59031427", "text": "def hand_has_three_of_a_kind?(hand)\n has = false\n \n #Used to hold pairs in this case\n @temp_array = Array.new \n \n #Get all three of a kinds from hand\n hand = (hand.sort_by {|c| c.get_compare_value}).reverse\n current = hand[0]\n match_counter = 1\n for i in 1...hand.length\n if(current.get_value == hand[i].get_value && match_counter < 3)\n match_counter += 1\n if(match_counter == 3)\n has = true\n @temp_array << hand[i]\n @temp_array << hand[i-1]\n @temp_array << hand[i-2]\n @hand_value += THREE_OF_A_KIND_VALUE + COMBO_VALUE_MULTIPLIER * (hand[i].get_value)\n break\n end\n else\n match_counter = 1\n current = hand[i] \n end\n end\n return has\n end", "title": "" }, { "docid": "19955b6ab4d34d26033330ef239c2855", "score": "0.5883207", "text": "def three_of_a_kind?\n type == HandType::THREE_OF_A_KIND\n end", "title": "" }, { "docid": "592971a2128e0b9d5708980b3d951ad0", "score": "0.587966", "text": "def test_fit4\n instance = Pentomino::Box.new(5,5)\n piece = Pentomino::FPiece.new\n assert_true(instance.fit?(piece, 0, 0, 0, 1))\n assert_false(instance.fit?(piece, 0, 0, 0, 0))\n end", "title": "" }, { "docid": "9df5a451bc2f601538cb932f49e0e5e1", "score": "0.5829849", "text": "def is_int4?(); @type == GDT_INT4; end", "title": "" }, { "docid": "54809b9aec62a1f92f9c2d533100c0d1", "score": "0.5820843", "text": "def test_ddm_struct\n\t\tddms = Klass.constants.map {|x| x if x =~ /DDM$/}.compact\n\t\tddms.each do |d|\n\t\t\tobj = Klass.const_get(d).new\n\t\t\tassert_operator obj.size, :>=, 7 \n\t\t\tassert_respond_to obj, :length\n\t\t\tassert_respond_to obj, :magic\n\t\t\tassert_respond_to obj, :format\n\t\t\tassert_respond_to obj, :correlid\n\t\t\tassert_respond_to obj, :length2\n\t\t\tassert_respond_to obj, :codepoint\n\t\tend\n\tend", "title": "" }, { "docid": "d62479aa8a19cb0cc94af6a05a388de0", "score": "0.5804139", "text": "def test_one_oneMatch\n assert @triple.one? { |e| e % 3 == 2 }\n end", "title": "" }, { "docid": "c02f2b2f8befa5cd44f944662c7719a4", "score": "0.5803036", "text": "def test_generate_code()\n assert_equal(4, @emi.length)\n assert_equal(true, @valid_elements.include?(@emi.sample))\n assert_equal(false, @valid_elements.include?(@lol))\n end", "title": "" }, { "docid": "c6a83b4c2ddd29a987ff8e8140a74671", "score": "0.5789396", "text": "def phasea_phase_four(group)\n #TODO implement for phase 4 in like manner\n set = {'2': 2, '3': 3, '4': 4, '5': 5, '6': 6, '7': 7, '8': 8, '9': 9, '0': 10, 'J': 11, 'Q': 12, 'K': 13 }\n wilds = ['AH', 'AD', 'AC', 'AS']\n card_counter = 0\n wilds_counter = 0\n sequence = nil\n\n group.each do |card|\n if wilds.include?(card)\n wilds_counter += 1\n sequence += 1 unless sequence.nil?\n elsif sequence.nil?\n sequence = set[card[0].to_sym] + 1\n card_counter += 1\n elsif set[card[0].to_sym] == sequence\n sequence += 1\n card_counter += 1\n end\n end\n\n group.length == 8 && card_counter >= 2 && (card_counter + wilds_counter == 8) ? 4 : nil\n\nend", "title": "" }, { "docid": "38b5cd4a69fb779aa5b9567237710d87", "score": "0.5783928", "text": "def either_2_4(list)\n count = 0\n i = 0\n list.size.times do\n num = list[i]\n if num == 2\n if list[i - 1] == 4 || list[i + 1] == 4\n return false\n end\n if list[i - 1] == 2 || list[i + 1] == 2\n count += 1\n end\n end\n if num == 4\n if list[i - 1] == 2 || list[i + 1] == 2\n return false\n end\n if list[i - 1] == 4 || list[i + 1] == 4\n count += 1\n end\n end\n i += 1\n end\n if count >= 1\n return true\n end\n return false\nend", "title": "" }, { "docid": "b13b75300d61f32bb84004ff902b7495", "score": "0.57584494", "text": "def m4?() tier == 4; end", "title": "" }, { "docid": "41a8eed82828c896000da0338f484ec3", "score": "0.5748841", "text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\n end", "title": "" }, { "docid": "7ae6470a436008fbd43b9eabacdebb6d", "score": "0.5725449", "text": "def kind\n validate\n #weird triangle\n if sidethree + sidetwo <= sideone || sideone + sidetwo <= sidethree || sidethree + sideone <= sidetwo\n raise TriangleError\n elsif sideone <= 0 || sideone <= 0 || sidethree <= 0\n begin\n raise TriangleError, \"illegal\"\n end\n # return :TriangleError - doesnt work\n #both true - all trues cos its all same\n elsif sideone == sidetwo && sidetwo == sidethree && sideone == sidethree\n return :equilateral\n elsif sidetwo == sidethree || sideone == sidetwo || sideone == sidethree\n #isosceles - either this or that?\n return :isosceles\n #wonky mate -\n else sideone != sidetwo && sidetwo != sidethree && sideone != sidethree\n return :scalene\n end\n end", "title": "" }, { "docid": "ca355bbc518c4880b3e3df32f4ac2fd3", "score": "0.5723442", "text": "def sequence_four\n end", "title": "" }, { "docid": "90e7603975cd1dac99428be384308af8", "score": "0.57219076", "text": "def max_of_four(n1, n2, n3, n4)\n if n1 > n2 && n1 > n3 && n1 > n4\n return n1\n elsif n2 > n3 && n2 > n1 && n2 > n4\n return n2\n elsif n3 > n1 && n3 > n2 && n3 > n4\n return n3\n else\n return n4\n end\n\n=begin # Alternativ implementation, kanske är snabbare\n if n1 > n2\n if n1 > n3\n if n1 > n4\n return n1\n else\n return n4\n end\n else\n if n3 > n4\n return n3\n else\n return n4\n end\n end\n else\n if n2 > n3\n if n2 > n4\n return n2\n else\n return n4\n end\n else\n if n3 > n4\n return n3\n else\n return n4\n end\n end\n end\n=end\nend", "title": "" }, { "docid": "c464663538c31d6cf244592bb8504ecd", "score": "0.5720232", "text": "def test_exons\r\n assert_equal(256, @slice.exons.length)\r\n assert_equal(Exon, @slice.exons[0].class)\r\n end", "title": "" }, { "docid": "1f65ca40a05241d51856abfc7d1a1e94", "score": "0.57146835", "text": "def test_detect_allMatch\n assert_equal 3, @triple.detect { |e| e == e }\n end", "title": "" }, { "docid": "832950e46748ad9d296322506c7ee371", "score": "0.57110965", "text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\n end", "title": "" }, { "docid": "832950e46748ad9d296322506c7ee371", "score": "0.57110965", "text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\n end", "title": "" }, { "docid": "832950e46748ad9d296322506c7ee371", "score": "0.57110965", "text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\n end", "title": "" }, { "docid": "d69532fbaad9877565aeba66536a7cb7", "score": "0.5711092", "text": "def test_pick_three_of_a_kind\n cards = \"4C 7D QH 3S 7H 10H 7S\"\n assert_equal \"Three of a Kind (7 high)\", TexasHoldEm.new(cards).best_hand\n end", "title": "" }, { "docid": "5dbd1aca51425fe074e012e7e4b18b77", "score": "0.5710571", "text": "def test_3_pairs_out_of_6\n\t\tassert_equal(3, sample([\"Aaron\", \"Anna\", \"Gail\", \"Gabrielle\", \"Scott\", \"Rob\"], 6).count)\n\t\t#print sample([\"Aaron\", \"Anna\", \"Gail\", \"Gabrielle\", \"Scott\", \"Rob\"], 6) \n\tend", "title": "" }, { "docid": "6aafbbfb98d54fb562c41e3fd1c6c889", "score": "0.5706821", "text": "def test_exons\n assert_equal(291, @slice.exons.length)\n assert_equal(Exon, @slice.exons[0].class)\n end", "title": "" }, { "docid": "f80c7af990583b5cbf679b3d47a039ec", "score": "0.5696888", "text": "def test_init_length_type\n d = Deal.new\n deck= d.deck\n assert_equal true, deck.all? {|c| c.instance_of? Card}\n end", "title": "" }, { "docid": "4b254246ae0738624ba5dc6a4c4f6d8a", "score": "0.56942856", "text": "def kind\n zeroes #calling the valid methods defined below\n inequality\n if @length_1 == @length_2 && @length_1 == @length_3\n self.type = :equilateral\n elsif @length_2 == @length_3 || @length_1 == @length_3 || @length_1 == @length_2\n self.type = :isosceles\n else\n self.type = :scalene\n end\n end", "title": "" }, { "docid": "5f93076648535c47a4a79c6cf8def414", "score": "0.56676", "text": "def binary_multiple_of_4?(s) \ntest = s.is_a?(String) && s.match(/^[0-1]+$/)!= nil && s.to_i(2) % 4 == 0\nend", "title": "" }, { "docid": "a9a5c445e4f3c6116ab0c20c1d1141a4", "score": "0.5664256", "text": "def test_4_pass_three_arguments\n\t\tassert_equal(3, three(1,1,1))\n\tend", "title": "" }, { "docid": "3773aff07e27e088af16af7e01e94d64", "score": "0.5661583", "text": "def ensure_pathtype_4()\n if pathtype != 4\n raise TypeError, \"Attempt to access a method only relevant to pathtype == 4\"\n end\n end", "title": "" }, { "docid": "28b9ffd06089847ca6c04a6330ce60b2", "score": "0.56573075", "text": "def test_it_has_a_type_MAD\n turn = Turn.new(@player1, @player4)\n\n assert_equal :mutually_assured_destruction, turn.type\n end", "title": "" }, { "docid": "f0d3fd562d1bc6049a0a2d1cac452035", "score": "0.56530654", "text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\n end", "title": "" }, { "docid": "f0d3fd562d1bc6049a0a2d1cac452035", "score": "0.56530654", "text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\n end", "title": "" }, { "docid": "f0d3fd562d1bc6049a0a2d1cac452035", "score": "0.56530654", "text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\n end", "title": "" }, { "docid": "d2f5f64c9e913c6460b34ed8f0a58a56", "score": "0.5649734", "text": "def equal_to_four(x)\n if x == 4\n puts \"yup\"\n else\n puts \"nope\"\n end\n end", "title": "" }, { "docid": "b35ea291e2e3905b8e86b2ca61514a2a", "score": "0.5648103", "text": "def kind\n result = all_kinds\n if result.length != 0\n @goods = result if result.length == 1\n @goods = [result[0]] if result[0].length > 2\n @goods = [result[0], result[1]] if result.length >= 2\n else\n @goods = []\n end\n return true if @goods.length != 0\n return false\n end", "title": "" }, { "docid": "7aa91153cb49d834aef5a3f816f18022", "score": "0.56436723", "text": "def phasea_phase_three(group)\n #TODO implement for phase 3 in like manner\n wilds = ['AH', 'AD', 'AC', 'AS']\n c_counter = 0\n wilds_counter = 0\n card_num = nil\n\n group.each do |x|\n if wilds.include?(x)\n wilds_counter += 1\n elsif card_num.nil?\n card_num = x[0]\n c_counter += 1\n elsif x[0] == card_num\n c_counter += 1\n end\n end\n\n group.length == 4 && c_counter >= 2 && (c_counter + wilds_counter == 4) ? 3 : nil\n \nend", "title": "" }, { "docid": "4b6b1cb96d840dfd5aa9915f806fc45a", "score": "0.56391805", "text": "def bm4?(s)\n regex = /\\A(0|1)+\\z/\n p s.to_i(2)\n s =~ regex && (s.to_i(2) % 4).zero?\nend", "title": "" }, { "docid": "0f719f14415ced9bcc5ac141070c61a6", "score": "0.56349295", "text": "def test_MatchData_InstanceMethods_length\n\t\tm = /(.)(.)(\\d+)(\\d)/.match(\"THX1138.\")\n\t\tassert_equal(5, m.length)\n\t\tassert_equal(5, m.size)\n\tend", "title": "" }, { "docid": "15bff7390a6700f17974d879c28e7f59", "score": "0.5631347", "text": "def phasea_phase_four(group)\n #TODO implement for phase 4 in like manner\n seq_count\nend", "title": "" }, { "docid": "25d5ba9e092040ad20c5bc52ebe0ed5a", "score": "0.5631191", "text": "def testOneFour(n)\n\n\tn[0].to_s.to_i * n[1..4].to_s.to_i == n[5..9].to_s.to_i\n\nend", "title": "" }, { "docid": "abf26e474d88efcc7e93a0851ede5e54", "score": "0.56204516", "text": "def binary_multiple_of_4?(s)\r\n\ts.split(\"\").each do |letter|\r\n\t\tif letter =~ /([^01])/ || s == \"0\"\r\n\t\t\tfalse\r\n\t\telse\r\n\t\t\tif s.to_i(2) % 4 == 0 then true else false end\r\n\t\tend\r\n\tend\t\r\nend", "title": "" }, { "docid": "ffe4a9413f380a969c37e4e57108e7d2", "score": "0.56196344", "text": "def binary_multiple_of_4?(s)\n\ts =~ /\\A[01]+\\z/ ? s.to_i(2) % 4 == 0 : false\nend", "title": "" }, { "docid": "f203fef2cdf42be141ffcb47a1ede4f0", "score": "0.5610627", "text": "def check_connect_four?(arr)\n return false if arr.length != FOUR\n\n #checks for full array\n return false if arr.any? {|square| square.nil?}\n\n #if array is full then check for winner\n return true if arr.all? { |square| square.owner == \"1\" }\n return true if arr.all? { |square| square.owner == \"2\" }\n #otherwise return false\n false\n end", "title": "" }, { "docid": "2c734c92a5a8f347acbc9a55741dab9b", "score": "0.56100905", "text": "def binary_multiple_of_4?(str)\n @str = str\n multiple_four = false\n if (@str.to_i(2) % 4 == 0)\n multiple_four = true if [email protected]_i.zero?\n end\n multiple_four\nend", "title": "" }, { "docid": "081b8f464ec9ffef60641b0be6a4cd83", "score": "0.5607442", "text": "def test_count_block\n assert_equal 2, @triple.count { |e| e % 3 == 0 }\n end", "title": "" }, { "docid": "8e76e9573c25f06e9151de043cfe33c0", "score": "0.5605954", "text": "def four_in_a_row?(array, count = 1, index = 0)\n return true if count == 4\n return false if array.nil? || index > array.size || array.size < 4\n\n if array[index].nil? || array[index] != array[index + 1]\n four_in_a_row?(array, 1, index + 1)\n elsif array[index + 1] == array[index]\n four_in_a_row?(array, count + 1, index + 1)\n end\n end", "title": "" }, { "docid": "3e14c0f5bc7fd27e88cab1336286176a", "score": "0.5594058", "text": "def full_house?\n two_kinds?(3, 2)\n end", "title": "" }, { "docid": "ceddc27b215d7682caa094d57212a314", "score": "0.5591974", "text": "def test_one_noneMatch\n assert !(@triple.one? { |e| e % 5 == 1 })\n end", "title": "" }, { "docid": "6da96b2d9658c6296bde8f699a4a7776", "score": "0.5589944", "text": "def three_of_a_kind?(h)\n h.values.one? { | sub_arr | sub_arr.length == 3 }\n end", "title": "" }, { "docid": "3954c480d6d50527cee6c68334d8ee9a", "score": "0.5584079", "text": "def test_truth\n assert_kind_of Tribute, tributes(:first)\n end", "title": "" } ]
8b059d665a567e36844c564fe4f976e2
DELETE /file_attachment_dumps/1 DELETE /file_attachment_dumps/1.json
[ { "docid": "cfe66cf6a6cafb8b4ff4f8a98ea2ab23", "score": "0.72873646", "text": "def destroy\n @dump = Dump.find(params[:dump_id])\n @file_attachment_dump = @post.file_attachment_dumps.find(params[:id])\n @file_attachment_dump.destroy\n respond_to do |format|\n format.html { redirect_to file_attachment_dumps_url, notice: 'File attachment dump was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" } ]
[ { "docid": "8605a21a07308219a55ec6021f47c90e", "score": "0.7247938", "text": "def destroy\n if @attachment.destroy \n render json: { message: \"File deleted from server\" }\n else\n render json: { message: @attachment.errors.full_messages.join(',') }\n end\n end", "title": "" }, { "docid": "3bd44d013e292eb4ae4e001b644f288b", "score": "0.72113353", "text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5a53b19c796b6cd4ad460a3ab939a6e5", "score": "0.72001994", "text": "def destroy\n @attachment_file = AttachmentFile.find(params[:id])\n\tremove_file(@attachment_file)\n\t@attachment_file.destroy\n\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f5424c63834212face3876f8f193ef18", "score": "0.7090107", "text": "def destroy\n @add_file_to_attachment.destroy\n respond_to do |format|\n format.html { redirect_to add_file_to_attachments_url, notice: 'Add file to attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5162753ce1dd7cbd096da65c137ba1a0", "score": "0.70559436", "text": "def delete_attachment(args)\n query_str = build_attachment_query(args)\n \n @conn.query({url_path: query_str, method: :delete})\n end", "title": "" }, { "docid": "1b8440b96430a819cb8c8b1a5872f19f", "score": "0.70199215", "text": "def destroy\n @request_attachment = RequestAttachment.find(params[:id])\n @request_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to request_attachments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c4b9e629fb5ebcc50adc385d3645f5ee", "score": "0.70025545", "text": "def delete id, options={}, headers={}\n @connection.delete \"pending_attachments/#{id}.json\", options, headers\n end", "title": "" }, { "docid": "edc1aac9382aa89ecdaa03f2196cee89", "score": "0.69440585", "text": "def delete_json(filename)\n filename = HelperPath.record(filename)\n return unless File.exist?(filename)\n FileUtils.rm(filename)\n end", "title": "" }, { "docid": "f4ce09a7a5a51ecfe79af346b31b6470", "score": "0.692146", "text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to :back }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0b24cbc6495df3923ea7679acbcd8deb", "score": "0.68916273", "text": "def delete_floor_plan(args = {}) \n delete(\"/files.json/floorplan/images\", args)\nend", "title": "" }, { "docid": "df82938626b42ad8956fce8cce6605df", "score": "0.68612957", "text": "def destroy\n @item_attachment = ItemAttachment.find(params[:id])\n @item_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to item_attachments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2148e2fd9383c12872890f51efee3615", "score": "0.6860567", "text": "def delete\n begin\n task_id = \"#{@file}\".gsub(/\\.\\/singularity\\//, \"\").gsub(/\\.json/, \"\")\n # delete the request\n RestClient.delete \"#{@uri}/api/requests/request/#{task_id}\"\n puts \"#{task_id} DELETED\"\n rescue\n puts \"#{task_id} #{$!.response}\"\n end\n end", "title": "" }, { "docid": "447e3f5d7bd989c5e252406885a31c86", "score": "0.68546116", "text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to attachments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "447e3f5d7bd989c5e252406885a31c86", "score": "0.68546116", "text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to attachments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "08b471a6d23f0c47129f5ceedff24dd0", "score": "0.6848904", "text": "def destroy_file\n file = ActiveStorage::Attachment.find(params[:id])\n file.purge_later\n respond_to do |format|\n format.html { redirect_to folders_url, notice: \"Folder was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "4d133a18f7fd87fa10c4cacd0dd004a9", "score": "0.68473285", "text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to document_path(@document, anchor: 'attachments'), notice: 'El archivo fue eliminado con éxito.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "17961dc77ab22982c4121ac402e58739", "score": "0.68326336", "text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: t(\"controllers.attachment.success_destroyed\") }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e090f055903dc5a6c7da785858e521ab", "score": "0.6829064", "text": "def delete\n client.file_delete(path)\n end", "title": "" }, { "docid": "986f3cca5b2a94347c9d1f5e446c62e7", "score": "0.6826189", "text": "def destroy\n @attach_file.destroy\n respond_to do |format|\n format.html { redirect_to attach_files_url, notice: 'Attach file was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d0c6a314d1d3d1de0cbfb80e47045d1c", "score": "0.68002343", "text": "def destroy\n @attached_file.destroy\n respond_to do |format|\n format.html { redirect_to attached_files_url, notice: 'Attached file was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bc2fe5e61194a4de74bb27aaf19a09db", "score": "0.67994964", "text": "def destroy\n id = @request_attachment.request_id\n @request_attachment.destroy\n flash[:success] = \"Attachment was successfully deleted.\"\n respond_to do |format|\n format.html { redirect_to controller: \"requests\", action: \"edit\", id: \"#{id}\"}\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8205b289cb7557b6c91b127e7c9952e3", "score": "0.678022", "text": "def destroy\n @sequence_attachment.destroy\n respond_to do |format|\n format.html { redirect_to @sequence, notice: 'Sequence attachment was successfully deleted.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "77e08b8819844f9dfb5cec4fbdc5c8d2", "score": "0.677812", "text": "def destroy\n @offices_attachment = OfficesAttachment.find(params[:id])\n @offices_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to offices_attachments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "62c54a1c3d4a8c8049d17497d66f1d61", "score": "0.6777101", "text": "def destroy\n @purchase_attachment = PurchaseAttachment.find(params[:id])\n @purchase_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/purchases/#{@purchase_attachment.purchase_id}\", :notice => 'Attachment successfully deleted.') }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.6768662", "text": "def delete(path);end", "title": "" }, { "docid": "4100b1ba27a9a751bb11d54b45e1aeb1", "score": "0.6768662", "text": "def delete(path);end", "title": "" }, { "docid": "d2b45d86e1789d16d66be3c9fc0392c0", "score": "0.6762954", "text": "def destroy\n @jsonfile = Jsonfile.find(params[:id])\n @jsonfile.destroy\n\n respond_to do |format|\n format.html { redirect_to(jsonfiles_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "46d1b5703dd1942ca654f5e32f1cf2cf", "score": "0.67559373", "text": "def destroy\n @attached.file = nil\n @attached.save\n @attached.destroy\n respond_to do |format|\n format.html { redirect_to request.referrer, notice: 'Attached was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "28ec9f9dbd22ceed4a51d1fd056316cd", "score": "0.6740884", "text": "def destroy\n @attachment.destroy\n end", "title": "" }, { "docid": "29e28212ea9de38cd83d020a35812c77", "score": "0.6732771", "text": "def destroy\n @filepath.destroy\n respond_to do |format|\n format.html { redirect_to filepaths_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "24ad0a67a9a37abf58570157d30b0b6e", "score": "0.67318195", "text": "def destroy\n @file_name.destroy\n respond_to do |format|\n format.html { redirect_to root_path }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "0de965c554b958c0400743c9b5586186", "score": "0.6715839", "text": "def destroy\n \n @invoice_attachment = InvoiceAttachment.find(params[:id])\n @invoice_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to(\"/invoices/#{@invoice_attachment.invoice_id}\", :notice => 'Attachment successfully deleted.') }\n format.json { head :ok }\n end\n end", "title": "" }, { "docid": "f4a9e3ef2c8191039efdca0fcb56303c", "score": "0.6713156", "text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachable = @attachment.attachable\n @attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to @attachable }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9e54403a93f1c24aad37d2572e63c4cc", "score": "0.67042065", "text": "def destroy\n @post_attachment.destroy\n respond_to do |format|\n format.html { redirect_to post_attachments_url, notice: 'Post attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5ddcbb79e07fb6152199b7a0461f292f", "score": "0.67033184", "text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5ddcbb79e07fb6152199b7a0461f292f", "score": "0.67033184", "text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5ddcbb79e07fb6152199b7a0461f292f", "score": "0.67033184", "text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5ddcbb79e07fb6152199b7a0461f292f", "score": "0.67033184", "text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5ddcbb79e07fb6152199b7a0461f292f", "score": "0.67033184", "text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5ddcbb79e07fb6152199b7a0461f292f", "score": "0.67033184", "text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5ddcbb79e07fb6152199b7a0461f292f", "score": "0.67033184", "text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5ddcbb79e07fb6152199b7a0461f292f", "score": "0.67033184", "text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "5ddcbb79e07fb6152199b7a0461f292f", "score": "0.67033184", "text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b806a11c0b1f5be8b8dda5acb8010d14", "score": "0.67011535", "text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to budget_attachments_url(@attachment.budget) }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fa434c603aef770326d3bcfb13e2a884", "score": "0.66967636", "text": "def destroy\n puts \"delete --\" * 10\n result = access_token.delete(\"/api/v1/file_assets/#{params[:id]}\")\n\n display_api_response( result )\n \n respond_to do |format|\n format.html { redirect_to(file_assets_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "42554a586f3cb714910d6f06bcd6c2dd", "score": "0.66953", "text": "def destroy\n if Attachment.find(params[:id]).destroy\n render :json => { :success => true }\n else\n render :json => { :success => false, :msg => I18n.t(\"backend.general.cantDelete\") }\n end\n end", "title": "" }, { "docid": "02d5f84aefeea9228f7db7b94de6d66e", "score": "0.66907394", "text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to @user, notice: 'Attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "24908ba4e0a626b949f0a00e7735869b", "score": "0.668786", "text": "def destroy\n @attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: \"Attachment was successfully destroyed.\" }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b2a8ec521b7095688bdab199fab748e4", "score": "0.6681467", "text": "def remove_attachment\n attachment = Attachment.find(params[:id])\n attachment.delete\n end", "title": "" }, { "docid": "9fff49695a2f566c08ba409d5bd22110", "score": "0.6678349", "text": "def delete_file(file_name)\n fail 'No Structure ID defined for structure. Can\\'t delete file' if @structure.id.nil?\n\n data = Hashie::Mash.new\n data.structure_id = @structure.id\n data.file_name = file_name\n\n push_file('api/remove_file', MultiJson.dump(data))\n end", "title": "" }, { "docid": "ab3c12d58b7f7b92b3cb57ade22afc82", "score": "0.66753256", "text": "def destroy\n\t\[email protected]\n\t\trespond_to do |format|\n\t\t\tformat.html { redirect_to attachments_url }\n\t\t\tformat.json { head :no_content }\n\t\tend\n\tend", "title": "" }, { "docid": "85cb42262029c0c0c42d9d8dbce98673", "score": "0.66579777", "text": "def destroy\n @section_attachment = SectionAttachment.find(params[:id])\n @section_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to section_attachments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e3d7a6dd46330ceec023b17a64737b56", "score": "0.66391504", "text": "def delete\n self.class.delete(dzi_uploaded_file.id)\n end", "title": "" }, { "docid": "81e2eb00289247fdf59eac87e8a56cc5", "score": "0.6633073", "text": "def destroy\n @attachment.destroy\n respond_with { head :no_content }\n end", "title": "" }, { "docid": "7f65e239b17ccbf2c0f9dda14fd587cd", "score": "0.6627584", "text": "def destroy\n @request_file = RequestFile.find(params[:id])\n @request_file.destroy\n\n respond_to do |format|\n format.html { redirect_to request_files_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2b77713c1f884d7b84c91234c37ec6a7", "score": "0.6623896", "text": "def destroy\n @email_attachment.destroy\n end", "title": "" }, { "docid": "b1a17c1ee1af05c79fe156622df44818", "score": "0.66222954", "text": "def delete(path)\n begin\n response = client[path].delete :accept => 'application/json'\n rescue Exception => e\n puts e.inspect\n end\n end", "title": "" }, { "docid": "89cb4bb960e1c536713df93b75d763f6", "score": "0.66196746", "text": "def destroy\n File.delete(file_path)\n\n render json: { status: :ok }\n end", "title": "" }, { "docid": "efb7c35d18aa3a70b02758da19a4f86f", "score": "0.6619213", "text": "def destroy\n @patient_attachment.destroy\n respond_to do |format|\n format.html { redirect_to patient_attachments_url, notice: 'Patient attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9d63209253831ea2c6144d61aae73395", "score": "0.66058725", "text": "def destroy\n @mds_file = MdsFile.find(params[:id])\n @mds_file.destroy\n\n respond_to do |format|\n format.html { redirect_to mds_files_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "bf377de530ca894edce4d814c7b728ef", "score": "0.6603353", "text": "def destroy\n @trip_attachment.destroy\n respond_to do |format|\n format.html { redirect_to trip_attachments_url, notice: 'Trip attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "9ec077fa254988f7ab36b229915fa2fb", "score": "0.6602115", "text": "def delete_file(post_id, md5, file_ext, type)\n delete(file_path(md5, file_ext, type))\n end", "title": "" }, { "docid": "b445c184893647d3482f8fbc6a507a52", "score": "0.6597533", "text": "def delete(path, params = {})\n path += '.json'\n res = @connection.delete(path, @header)\n parse_response(res)\n end", "title": "" }, { "docid": "9681069774c25ffd8e3885db0d8531b6", "score": "0.6596952", "text": "def destroy\n @item = Item.find(params[:id])\n @item.item_attachments.all.find(params[:attachment_id]).destroy\n end", "title": "" }, { "docid": "9dcf228c43f030e48ba266ba602663d9", "score": "0.65966916", "text": "def mediaObjectDelete(id,attachto,path)\n\n\tend", "title": "" }, { "docid": "0836eba45627fe953ade7a49ee7e992a", "score": "0.6593907", "text": "def delete_file(uid, info = {})\n if info[\"multipart_id\"]\n multipart_upload = object(uid).multipart_upload(info[\"multipart_id\"])\n multipart_upload.abort\n\n delete [object(\"#{uid}.info\")]\n else\n delete [object(uid), object(\"#{uid}.info\")]\n end\n end", "title": "" }, { "docid": "fd771f7ada6d80a7fff1bd3490de2626", "score": "0.6591991", "text": "def destroy\n @newspost_attachment.destroy\n respond_to do |format|\n format.html { redirect_to newspost_attachments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "d0537ffbf8e25d0fca9b228915f4b91a", "score": "0.65895486", "text": "def destroy\n @link_attachment = LinkAttachment.find(params[:id])\n @link_attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to link_attachments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e1475f631e7b15c1524d10a4219a6898", "score": "0.65877134", "text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to(attachments_url) }\n format.xml { head :ok }\n format.json { render :json => 'removeParentTR(t);' }\n end\n end", "title": "" }, { "docid": "915368108be1d4e2a517eef8cab75853", "score": "0.65856344", "text": "def destroy\n @treq_file = TreqFile.find(params[:id])\n @treq_file.destroy\n\n respond_to do |format|\n format.html { redirect_to treq_files_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c64d1f70e089d14a970de3a2a7a4fc58", "score": "0.6582502", "text": "def destroy\n @collection_note_attachment.destroy\n respond_to do |format|\n format.html { redirect_to collection_note_attachments_url, notice: 'Collection note attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "fc4127a729e7f41c20fc012dea8315ba", "score": "0.65800655", "text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachment.destroy\n\n redirect_to attachments_url\n end", "title": "" }, { "docid": "1224de81bf3d27a6aae198bb8ec185e7", "score": "0.65792483", "text": "def destroy\n @capa_file = CapaFile.find(params[:id])\n @capa_file.destroy\n\n respond_to do |format|\n format.html { redirect_to capa_files_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "60379309b0a8f0dce6d13d78b13621e6", "score": "0.65781885", "text": "def destroy\n @mail_attachment.destroy\n respond_to do |format|\n format.html { redirect_to mail_attachments_url, notice: 'Mail attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e5c97c72d24f36c0a9598108be748987", "score": "0.6570922", "text": "def destroy\n @file_upload.destroy\n\n respond_to do |format|\n format.html { redirect_to hub_group_file_uploads_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "195388ba6dffbfbdacbea8964007464f", "score": "0.6566819", "text": "def destroy\n @attach_file.destroy\n respond_to do |format|\n format.html { redirect_to personal_account_task_path(@task), notice: t('controller_messages.crud.destroy.success', model: 'AttachFile') }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "c585819ba22faf6fb1f2d0fab84921db", "score": "0.6565003", "text": "def delete_submission_url_file\n expose Deliverable.delete_url_or_file_submission(@oauth_token, params[:submission_id]) \n end", "title": "" }, { "docid": "7c6c4a9501d3d0be25c0a52a06826e44", "score": "0.65532434", "text": "def destroy\n @offer_attachment.destroy\n respond_to do |format|\n format.html { redirect_to offer_attachments_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "09cf37c3fd0fd457a3a5afd396ce771c", "score": "0.6552335", "text": "def destroy\n @newattachment.destroy\n respond_to do |format|\n format.html { redirect_to newattachments_url, notice: 'Newattachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "56be699aa8afb95f92704b69649c0b12", "score": "0.6548105", "text": "def destroy\n repository = @single_file.repository\n @single_file.destroy\n respond_to do |format|\n format.html { redirect_to repository, notice: 'Single file was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "e4395e60249aec3eb81ff359efe42e29", "score": "0.65433127", "text": "def delete_one(file)\n delete(file.id)\n end", "title": "" }, { "docid": "b965aa2e76649b84623ed925811f4794", "score": "0.6543171", "text": "def delete(_path)\n end", "title": "" }, { "docid": "b447349520a5e9319c2862d140b6426d", "score": "0.65413743", "text": "def destroy\n if File.exist?(@attachment_path)\n File.delete(@attachment_path)\n remove_attachment_at_index(@file_index)\n redirect_to task_path(@task.id), notice: @attachment_name + ' was successfully deleted.'\n else\n redirect_to task_path(@task.id), notice: @attachment_name + ' was not deleted.'\n end\n end", "title": "" }, { "docid": "5a7d8340ba889e6540f8eee3f74226c6", "score": "0.65341717", "text": "def destroy\n @file_container = FileContainer.find(params[:id])\n @file_container.destroy\n\n respond_to do |format|\n format.html { redirect_to file_containers_url, notice: 'File was deleted updated.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2f50ffc24c963acb176a82f1392d3124", "score": "0.6526222", "text": "def destroy\n @notice_attachment.destroy\n respond_to do |format|\n format.html { redirect_to notice_attachments_url, notice: 'Notice attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "2163c00655324c6555c24681d91cd5a7", "score": "0.65227515", "text": "def delete(path)\n resp = request('/files/delete', path: path)\n parse_tagged_response(resp)\n end", "title": "" }, { "docid": "3ad36797b7852a98e2b427376fd7df4d", "score": "0.65217865", "text": "def destroy\n @proof_attachment.destroy\n respond_to do |format|\n format.html { redirect_to proof_attachments_url, notice: 'Proof attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "8750152bec070aa93c440d4f21f4e736", "score": "0.65207624", "text": "def destroy\n @attachment = Attachment.find(params[:id])\n @attachment.destroy\n\n respond_to do |format|\n format.html { redirect_to(attachments_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "3c3069700eb6aaa4fd475f338c280461", "score": "0.6518059", "text": "def destroy\n @vehicle_attachment.destroy\n respond_to do |format|\n format.html { redirect_to vehicle_attachments_url, notice: 'Vehicle attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "acde7342b58699f681f95741c5dec346", "score": "0.6516462", "text": "def delete_attachment(file_name)\n file_path = ResourceItem.file_temp_storage_path(:upload, sub_directory, file_name)\n FileUtils.rm_f(file_path) # Will ignore errors\n end", "title": "" }, { "docid": "390e8e2ce3ebccf61cd00f177342fb05", "score": "0.6512808", "text": "def delete(path, &block) end", "title": "" }, { "docid": "390e8e2ce3ebccf61cd00f177342fb05", "score": "0.6512808", "text": "def delete(path, &block) end", "title": "" }, { "docid": "ae9a60902d343bf2f9352331663b17f5", "score": "0.6505631", "text": "def destroy\n @attachment.destroy\n respond_to do |format|\n format.js { render :destroy }\n end\n end", "title": "" }, { "docid": "876b587deb47bb8d8e50ab2e063480be", "score": "0.6499304", "text": "def destroy\n the_name = @attachment.document\n @attachment.destroy\n respond_to do |format|\n format.html { redirect_to attachments_url, notice: \"[#{the_name}] was successfully deleted.\" }\n format.js { redirect_to attachments_url, notice: \"[#{the_name}] was successfully deleted.\" }\n end\n end", "title": "" }, { "docid": "e0ca8382742dda26024d42633a758f90", "score": "0.64989394", "text": "def destroy\n @file_to_update.destroy\n respond_to do |format|\n format.html { redirect_to file_to_updates_url, notice: 'File to update was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "712bdeb96b33960a5655d2adc69fec00", "score": "0.6497196", "text": "def destroy\n @package_file_attachment.destroy if @package_file_attachment.user == current_user\n respond_to do |format|\n format.html { redirect_to package_file_attachments_url, notice: 'Package file attachment was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f8b09dedfefe9b7ce602800a5319663f", "score": "0.64940524", "text": "def destroy\n @event_export_file.destroy\n\n respond_to do |format|\n format.html { redirect_to event_export_files_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "f8b09dedfefe9b7ce602800a5319663f", "score": "0.64940524", "text": "def destroy\n @event_export_file.destroy\n\n respond_to do |format|\n format.html { redirect_to event_export_files_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "55843013e1806dae5bf7697bb4ac6946", "score": "0.64929575", "text": "def delete_image_attachment\n \n @image = ActiveStorage::Attachment.find(params[:id])\n @image.purge\n redirect_back(fallback_location: request.referer) \n end", "title": "" }, { "docid": "1abf5574c363f812b36b698f9d357180", "score": "0.64923096", "text": "def google_delete\n file = $bucket.file \"#{$meeting_id}.flac\"\n\n file.delete\nend", "title": "" } ]
29303ce8450334966eb97a820f255195
recursive grabering of categories
[ { "docid": "bb7f3b6b185e91563fef16e5acb31edb", "score": "0.0", "text": "def get_catalog url, categories\n url ||= self.FoodURL\n page = @agent.get(url)\n #while there is table#ctl00_ContentPH_ChildDL links - we grabber children\n\n end", "title": "" } ]
[ { "docid": "f5c7d6be0d170294621fcfbf12e1a96a", "score": "0.76266056", "text": "def get_categories\n get_sub_categories(nil)\n end", "title": "" }, { "docid": "f5c7d6be0d170294621fcfbf12e1a96a", "score": "0.76266056", "text": "def get_categories\n get_sub_categories(nil)\n end", "title": "" }, { "docid": "bedf8d58ba5efe4c8ee2589e4421b223", "score": "0.73063207", "text": "def categories\n children\n end", "title": "" }, { "docid": "bedf8d58ba5efe4c8ee2589e4421b223", "score": "0.73063207", "text": "def categories\n children\n end", "title": "" }, { "docid": "7739f1f630968a04ae228786f92c5700", "score": "0.72887266", "text": "def get_categories(row)\n categories = []\n cat = at_in(:category1 , row) if at_in(:category1 , row) # should invent some loop here\n categories << cat if cat\n cat = at_in(:category2 , row) if at_in(:category2 , row)# but we only support\n categories << cat if cat\n cat = at_in(:category3 , row) if at_in(:category3 , row)# three levels, so there you go\n categories << cat if cat\n categories\n end", "title": "" }, { "docid": "43867b6d2aa0b1be5e74e4ce6887c19f", "score": "0.72488004", "text": "def traverse(categories)\n categories.map{|cat| [cat] + traverse(cat.children)}.flatten\n end", "title": "" }, { "docid": "98a134feb44f67be123bbab10bdf40eb", "score": "0.7122776", "text": "def parse_categories!(categories)\n categories['children_data'].select! do |category|\n category['is_active']\n end\n categories['children_data'].each do |category|\n parse_categories!(category)\n end\n categories['children_data']\n end", "title": "" }, { "docid": "04800baf99843c295f396349a624d8f3", "score": "0.7099529", "text": "def list_categories\n traverse(self.categories.top)\n end", "title": "" }, { "docid": "a127964d18a5101775ca7d670483b069", "score": "0.70240706", "text": "def arranged_categories\n Category.all.each { |c| c.ancestry = c.ancestry.to_s + (c.ancestry != nil ? \"/\" : '') + c.id.to_s \n }.sort {|x,y| x.ancestry <=> y.ancestry \n }.map{ |c| [\"-\" * (c.depth - 1) + c.name,c.id] }\n # Category.ordered_by_ancestry.map { |c| [\"-\" * c.depth + c.name,c.id] }.unshift([\"--none--\", nil])\n end", "title": "" }, { "docid": "68cf0594593aa5395255230e955d037b", "score": "0.69740224", "text": "def categories\n @categories ||= categories!\n end", "title": "" }, { "docid": "da7c279eb72fe963050ce90c74edef62", "score": "0.69373685", "text": "def leaf_category_ids(categories)\n ids = []\n categories.each do |category|\n #p category\n if category[\"Children\"].empty?\n ids << category[\"Code\"]\n else\n ids += leaf_category_ids(category[\"Children\"])\n end\n end\n ids.sort\nend", "title": "" }, { "docid": "d2f09a0ddf6f9412e73a411b5ebad684", "score": "0.6933351", "text": "def categories\n _categories = races.map(&:category)\n children.inject(_categories) { |cats, child| cats + child.categories }\n end", "title": "" }, { "docid": "6d2573a7dd7e66c6b090cb93914bf727", "score": "0.693233", "text": "def categories!\n mashup(self.class.get(\"/\", :query => method_params('aj.categories.getList'))).categories.category\n end", "title": "" }, { "docid": "1fc97b026aa81a64cfa41c905b704f87", "score": "0.6891285", "text": "def children_categories\n #self_and_descendants.collect(&:children_categories)\n ([self] + children.collect(&:children_categories)).flatten\n end", "title": "" }, { "docid": "87b2d26a8650355e4327909701aae5cb", "score": "0.68845725", "text": "def find_all_subcategories_\n @@final_sub_category_list = final_sub_category_list = categories = []\n sub_categories = Category.all(:parent_id => self.id)\n if sub_categories.empty?\n puts \" Category NO SUB CATEGORIES \" + self.title \n return self \n else\n @@final_sub_category_list << self\n sub_categories.each do |category| \n @@final_sub_category_list << (category.find_all_subcategories).to_a\n @@final_sub_category_list += category.to_a \n end \n end\n @@final_sub_category_list.flatten!.uniq\n\n end", "title": "" }, { "docid": "7875697f3f21f85bf299c7434f13cbc6", "score": "0.6878068", "text": "def get_categories\n\t\t\tunpack(self.send(refernet_url(\"Category\")))\n\t\tend", "title": "" }, { "docid": "24ce5f174515d73a406422ddb1fd3b62", "score": "0.6878067", "text": "def categories_for(race)\n [race.category] + race.category.descendants\n end", "title": "" }, { "docid": "e26582d77705275fa536b8105e86a9bb", "score": "0.6838233", "text": "def categories\n race_categories = races.map(&:category)\n children.inject(race_categories) { |cats, child| cats + child.categories }\n end", "title": "" }, { "docid": "2ba5ed02f5f1dac31ca839dfc7db3ef4", "score": "0.6831375", "text": "def parent_categories\n c = category\n categories = [c]\n until c.parent.blank? do\n c = c.parent\n categories.unshift c\n end\n categories\n end", "title": "" }, { "docid": "f2a9044f952a6b481de326c208eabdb6", "score": "0.6796301", "text": "def categories\n categories = CATEGORIES.keys\n\n CATEGORIES.each do |key, value|\n categories.concat(value[:children].keys) if value[:children]\n end\n\n categories.sort\n end", "title": "" }, { "docid": "9bad5df0b3eb55c208c3efba28f87bfb", "score": "0.67886996", "text": "def get_categories_of(entry)\n entry.categories.map{|c| category_to_struct(c) }\n end", "title": "" }, { "docid": "91457cf7f4b5f9479cf774e3ddb5d9e8", "score": "0.6771344", "text": "def categories\n @categories ||= Hashie::Mash.new\n end", "title": "" }, { "docid": "c4da22d4a0cc8d9512bf47bd56e25c42", "score": "0.6761989", "text": "def get_categories_for_right_bar\n @categories = Category.search_tank(\"__type:(Category)\", :len => 100, :fetch => [:name, :ancestry], :function => 1)\n @categories = Category.sort_by_ancestry(@categories)\n end", "title": "" }, { "docid": "0d8d46e39853639532914f3e7335ad76", "score": "0.6732497", "text": "def categories\n @categories ||=\n begin\n h = Hash.new { |h2,k| h2[k] = [] }\n\n def h.method_missing msg, *args\n if self.has_key? msg.to_s then\n self[msg.to_s]\n else\n super\n end\n end\n\n time_prune\n fix_subpages\n\n pages.each do |url, page|\n dir = url.split(/\\//).first\n next unless File.directory? dir and dir !~ /^_/\n next if url =~ /index.html/ or url !~ /html/\n h[dir] << page\n end\n\n h.keys.each do |dir|\n h[dir] = h[dir].sort_by { |p| [-p.date.to_i, p.title ] }\n end\n\n h\n end\n end", "title": "" }, { "docid": "1f1fdb50c5b7b782173c4255311f82e0", "score": "0.67301047", "text": "def recursive_sub_category(page)\n listSubCatUl = page.search('#catList .categories ul')\n if listSubCatUl.size > 0\n listSubCatUl.each do |itemUl|\n listSubCatLi = itemUl.search('li')\n listSubCatLi.each do |itemLi|\n linkSubCat = itemLi.at('a')['href'].to_s\n linkSubCat = @url + linkSubCat\n page = @agent.get(linkSubCat)\n recursive_sub_category(page)\n end\n end\n else\n get_all_merchants(page)\n end\nend", "title": "" }, { "docid": "1f1fdb50c5b7b782173c4255311f82e0", "score": "0.67301047", "text": "def recursive_sub_category(page)\n listSubCatUl = page.search('#catList .categories ul')\n if listSubCatUl.size > 0\n listSubCatUl.each do |itemUl|\n listSubCatLi = itemUl.search('li')\n listSubCatLi.each do |itemLi|\n linkSubCat = itemLi.at('a')['href'].to_s\n linkSubCat = @url + linkSubCat\n page = @agent.get(linkSubCat)\n recursive_sub_category(page)\n end\n end\n else\n get_all_merchants(page)\n end\nend", "title": "" }, { "docid": "efce1062dc9ea6e18373fe17e5c9dd42", "score": "0.67157066", "text": "def categories\n []\n end", "title": "" }, { "docid": "fa288626a3dd78fd47d597e0c7c1c2b4", "score": "0.67152894", "text": "def categories\n @categories = [] if @categories.nil?\n @categories\n end", "title": "" }, { "docid": "26f03dc2bf63fe8d827166241faa48be", "score": "0.66935897", "text": "def categories_with_color\n parent_folder.category_list.select { |c| categories.include?(c.name) }\n end", "title": "" }, { "docid": "7c4ead8979115197bf5ad6e00a202c47", "score": "0.6693155", "text": "def unpack_categories!\n unpack_list!(CATEGORIES)\n end", "title": "" }, { "docid": "f2fca6c4c5746ad2000848b5a127ac92", "score": "0.6675019", "text": "def parse_category_tree\n doc = get_page_html(@donor.url)\n return if doc.nil?\n\n #parse 1st level\n doc.css('div.new_nav_left_pos.cateSub').each do |first_level|\n first_level_category = save_category(get_category_info(first_level, '.a_class'))\n\n #parse 2st level\n first_level.css('dl dt').each do |second_level|\n save_category(get_category_info(second_level, '.c_class'), first_level_category.id)\n end\n end\n end", "title": "" }, { "docid": "518694526c69f9395753bd811e357b4c", "score": "0.6667303", "text": "def leaf_categories\n self.categories.leaves\n end", "title": "" }, { "docid": "a67f74b86642132578bdcfddb820cc98", "score": "0.66600484", "text": "def get_parsed_categories\n if @categories.empty?\n get_categories\n end\n set_parsed_categories(@categories)\n return @parsed_categories\n end", "title": "" }, { "docid": "2f4a21bb534bbfb86b8b2b9d5a70a981", "score": "0.6653701", "text": "def categories\n add_category('holding')\n @categories\n end", "title": "" }, { "docid": "49b6267d96c46c301947d3badacc38bd", "score": "0.6651907", "text": "def index\n #@categories = @categorizable.categories\n if params[:cat]\n @categories = Category.where(parent_id: Category.find_by_name(params[:cat]))\n else\n @categories = Category.all\n end\n end", "title": "" }, { "docid": "2435ee6fe2edafa3cadcf4b31ce11334", "score": "0.6648847", "text": "def fetch_all_categories(store)\n \t\ttaxons = store.taxonomies.first.try(:taxons)\n if taxons.blank?\n nil\n else\n taxons.find_by_name('categories').try(:children) \n end\n \tend", "title": "" }, { "docid": "0c7ee881e068efb2fead2aab93dc986b", "score": "0.6645692", "text": "def categories\n raw_categories.to_hashugar\n end", "title": "" }, { "docid": "0c7ee881e068efb2fead2aab93dc986b", "score": "0.6645692", "text": "def categories\n raw_categories.to_hashugar\n end", "title": "" }, { "docid": "0753563e5a71c4e9c4d7d3dad2cb59ac", "score": "0.6638908", "text": "def nested_categories_array(categories, result = [])\n categories.map do |category, sub_categories|\n result << category\n nested_categories_array(sub_categories, result)\n end\n result\n end", "title": "" }, { "docid": "25cf71c68a203e57012ac055cde95802", "score": "0.6625346", "text": "def categories\n @categories ||= []\n end", "title": "" }, { "docid": "291c3ac012820b20ee940e983fbcd6be", "score": "0.6623269", "text": "def categories\n category\n end", "title": "" }, { "docid": "cbe8b947a7f0b6f80d75e3fae0e9f547", "score": "0.66204315", "text": "def parse_category_tree\n dry_run_notification\n\n page_html = get_page_html \"#{donor_domain}/sitemap\"\n\n if page_html\n page_html.css('#category + div.box-overflow .box-sitemap-list .item').each do |parent_category|\n parent_category_link = get_category_link(parent_category.at_css('strong a'))\n\n next if parent_category_link[:name].empty? && parent_category_link[:path].empty?\n\n category_parent = save_category(parent_category_link) unless DRY_RUN\n display_category_structure(parent_category_link, \"#{'-' * 80}\\n\")\n\n if parent_category\n parent_category.css('a:not(:first-child)').each do |subcategory_first_level_node|\n subcategory_first_level_link = get_category_link(subcategory_first_level_node)\n\n subcategory_first_level = save_category(subcategory_first_level_link, category_parent.id) unless DRY_RUN\n display_category_structure(subcategory_first_level_link, ' ' * 2)\n end\n end\n end\n end\n end", "title": "" }, { "docid": "98b714e5bcf40b978b385697be76afde", "score": "0.6613427", "text": "def category_and_descendants(root_id)\n if @categories.nil? || @categories.empty?\n load_categories_hash\n end\n\n cats = []\n @categories.each_pair do |id, category|\n if id == root_id || cats.include?(category[:parent_id])\n cats.push(id)\n elsif category_is_descendant_of(category, root_id)\n cats.push(id)\n while !category.nil?\n parent_id = category[:parent_id]\n cats.push(parent_id) unless cats.include?(parent_id)\n category = @categories[parent_id]\n end\n end\n end\n cats\n end", "title": "" }, { "docid": "35b601a0fd2bbd32d95a2be135d1d23e", "score": "0.66125757", "text": "def show\n @subcategories = Array.new\n @filecategories = @aggregate.categories\n @filesubcategories = @aggregate.subcategories\n @categories = Category.all\n for cat in @filecategories\n for subcat in cat.subcategories\n if [email protected]?(subcat) \n @subcategories.push(subcat)\n end\n end\n end\n end", "title": "" }, { "docid": "9a6da2bd5ea62a9bd75e8bfd3a7b8ef2", "score": "0.66070837", "text": "def set_categories\n @categories = Category.all\n @categories_for_select_1 = []\n @categories_for_select_2 = []\n @categories_for_select_3 = []\n @categories_for_select_4 = []\n @categories_for_select_5 = []\n @categories.each do |category|\n if(category.depth == 0)\n @categories_for_select_1 << [category.name, category.id]\n end\n end\n\n if @artwork\n if @artwork.category_1\n @categories = @artwork.category_1.children\n @categories.each do |category|\n @categories_for_select_2 << [category.name, category.id]\n end\n end\n\n if @artwork.category_2\n @categories = @artwork.category_2.children\n @categories.each do |category|\n @categories_for_select_3 << [category.name, category.id]\n end\n end\n\n if @artwork.category_3\n @categories = @artwork.category_3.children\n @categories.each do |category|\n @categories_for_select_4 << [category.name, category.id]\n end\n end\n\n if @artwork.category_4\n @categories = @artwork.category_4.children\n @categories.each do |category|\n @categories_for_select_5 << [category.name, category.id]\n end\n end\n end\n end", "title": "" }, { "docid": "d7b0b4c4fa809885e5098652c7bd3d0e", "score": "0.65809035", "text": "def get_categories\n metadata['catgry'].collect do | category |\n Category.new category\n end\n end", "title": "" }, { "docid": "87b35f5d1844a59ddecde144649454d4", "score": "0.6580293", "text": "def categories(idea, flag)\n categories = []\n nodey = Neo4j::Node.find(\"idea: #{idea.inspect}~\")\n if nodey.first\n node = nodey.first\n nodey.close\n node.rels.each do |rel|\n category = rel[\"category\"]\n category_flag = category.chars.first.to_i\n category = category.slice(1..-1)\n already_found = false\n categories.each { |cat| already_found = true if cat[1].eql? category }\n categories << [category_flag, category] unless already_found\n end\n if flag == :category\n print_categories categories\n elsif flag == :category_relations\n categories.first[1]\n end\n else\n puts \"Still crunching data. Nothing on #{idea} yet. Check back soon.\"\n end\n end", "title": "" }, { "docid": "712509988dac3e4368cde3f6e6a2a960", "score": "0.6576454", "text": "def categories\n # Array of categories that stores have\n store_categories = object.map(&:category_codes).flatten\n\n RetailerCategoryService.find(country: 'au').map do |category|\n\n # Same for the children\n category.children.each do |child|\n number = object.count{|store| store.accepts_giftcards && store.category_codes.include?(child.code) }\n child[:stores_accepting_gift_cards] = number\n end\n\n # Count the amount of stores that accept gift cards\n category[:stores_accepting_gift_cards] = object.count{ |store|\n store.accepts_giftcards && store.category_codes.include?(category.code)\n } + category.children.sum(&:stores_accepting_gift_cards)\n\n # Remove children that don't match to any stores\n category.children.delete_if {|child| !store_categories.include?(child.code) }\n\n # If category has no children and doesn't match to any stores, remove it\n if category.children.empty? && !store_categories.include?(category.code)\n nil\n else\n category\n end\n\n end.compact\n end", "title": "" }, { "docid": "07500c98a14467a51c8ef1ce57a3cf59", "score": "0.6568299", "text": "def cat_options_tree_recursive(node = Node.categories_node, addition=\"\")\n array = []\n array << [\"#{addition} #{h(node.title)}\", \"#{node.id}\"]\n node.children.categories.each do |childnode|\n array += cat_options_tree_recursive(childnode, \"#{addition}---\")\n end\n array\n end", "title": "" }, { "docid": "6ea866e3426dab0b9b141fee2b147217", "score": "0.65614843", "text": "def categories\n filter!\n @reporter.categories\n end", "title": "" }, { "docid": "5db18acee29cf40e9b35f133e8b484e1", "score": "0.65568644", "text": "def categories\n parent_category_id = product_category.id\n cats = []\n while parent_category_id != nil\n c = Tienda::ProductCategory.find(parent_category_id)\n cats << c\n parent_category_id = c.parent_id\n end\n cats\n end", "title": "" }, { "docid": "d71aaa85bfd2f8ef875f2edc9ee62d31", "score": "0.6554061", "text": "def uniq_categories\n object.categories.uniq\n end", "title": "" }, { "docid": "4499698c55a1c0427fc0e3dd3d8ce58f", "score": "0.65536094", "text": "def show\n @categories = Category.nested_set.select(:id, :title, :content, :secret_field, :parent_id, :lft, :rgt, :depth).paginate(:page => params[:page]).order('id DESC')\n end", "title": "" }, { "docid": "06e9fa04dd4e246da8e3dab76233adb3", "score": "0.6552411", "text": "def cat_id_options_tree_recursive(node, addition)\n array = []\n array << [\"#{addition} #{h(node.title)}\", \"#{node.page_id}\"] if node.page_type == 'Category'\n node.children.categories.each do |childnode|\n array += cat_id_options_tree_recursive(childnode, \"#{addition}---\")\n end\n array\n end", "title": "" }, { "docid": "59439c7c32a4e6a02f0c16c3f0e90cf8", "score": "0.6542588", "text": "def lowest_level_categories_ids(result = [])\n category = self\n if category.child_count == 0\n result << category.id\n return result\n else\n category.children.each do |subcat|\n subcat.lowest_level_categories_ids(result)\n end\n end\n result\n end", "title": "" }, { "docid": "6b7aac24eba9c018ec4f1d885f05b425", "score": "0.65418255", "text": "def categories\n @cat_hash.keys\n end", "title": "" }, { "docid": "6b7aac24eba9c018ec4f1d885f05b425", "score": "0.65418255", "text": "def categories\n @cat_hash.keys\n end", "title": "" }, { "docid": "6b7aac24eba9c018ec4f1d885f05b425", "score": "0.65418255", "text": "def categories\n @cat_hash.keys\n end", "title": "" }, { "docid": "e4a22c6ff5d18c20eb74af7048b6a5ed", "score": "0.6541228", "text": "def parse_category_tree\n dry_run_notification\n\n parent_category_page_html = get_page_html donor_domain\n\n if parent_category_page_html\n parent_category_page_html.css('#verticalmenu a').each do |parent_category_html|\n\n parent_category_link = get_link(parent_category_html)\n\n next if parent_category_link[:name].empty? && parent_category_link[:path].empty?\n\n parent_category = save_category(parent_category_link) unless DRY_RUN\n display_category_structure(parent_category_link, \"#{'-' * 80}\\n\")\n\n subcategory_first_level_page_html = get_page_html(donor_domain + parent_category_link[:path])\n if subcategory_first_level_page_html\n subcategory_first_level_page_html.css('#narrow-by-list2 a').each do |subcategory_first_level_html|\n subcategory_first_level_link = get_link(subcategory_first_level_html, true)\n\n subcategory_first_level = save_category(subcategory_first_level_link, parent_category.id) unless DRY_RUN\n display_category_structure(subcategory_first_level_link, ' ' * 2)\n\n subcategory_second_level_page_html = get_page_html(donor_domain + subcategory_first_level_link[:path])\n if subcategory_second_level_page_html\n subcategory_second_level_page_html.css('#narrow-by-list2 a').each do |subcategory_second_level_html|\n subcategory_second_level_link = get_link(subcategory_second_level_html, true)\n\n save_category(subcategory_second_level_link, subcategory_first_level.id) unless DRY_RUN\n display_category_structure(subcategory_second_level_link, ' ' * 4)\n end\n end\n end\n end\n end\n end\n end", "title": "" }, { "docid": "1c43526d3665c61ca9cfa1bd3c19f5c4", "score": "0.65390694", "text": "def prune_categories\n self.categories.uniq!\n end", "title": "" }, { "docid": "4d2be4f9abc267d925c6931e8c8d8c06", "score": "0.6537825", "text": "def categories_for(race)\n categories = [race.category] + race.category.descendants\n\n if race.category.name == \"Masters Men\"\n masters_men_4_5 = ::Category.find_by(name: \"Masters Men 4/5\")\n if masters_men_4_5\n categories.delete masters_men_4_5\n categories -= masters_men_4_5.descendants\n end\n end\n\n if race.category.name == \"Masters Women\"\n masters_women_4 = ::Category.find_by(name: \"Masters Women 4\")\n if masters_women_4\n categories.delete masters_women_4\n categories -= masters_women_4.descendants\n end\n end\n\n categories << ::Category.find_by(name: \"Category 2/3 Men\") if race.category.name == \"Category 3 Men\"\n\n categories.delete ::Category.find_by(name: \"Category 2/3 Men\") if race.category.name == \"Senior Men\"\n\n categories\n end", "title": "" }, { "docid": "3f548a1dbd1f90f192db9b59b562d43d", "score": "0.6525052", "text": "def categories\n categories = []\n CATEGORIES.each do |item|\n categories.push(Item_Category.new(item[0], item[1]))\n end\n categories\n end", "title": "" }, { "docid": "a9ae8522b804daf9eb1885de1c0e2fb8", "score": "0.65201217", "text": "def get_categories(distance=nil)\n if distance.nil?\n distance= @context_provider.distance\n end\n\n if @categories.include?(distance)\n return @categories\n end\n\n\n distance.times do |dist|\n next if @categories.include?(dist+1)\n\n if dist+1==1\n from_eponymous = @entity.eponymous_categories.map do |category|\n category.parents.to_a\n end.flatten\n @categories[dist+1] = (@context_provider.remote_counterparts(@entity, :categories, Rlp::Wiki::Category) + @entity.categories.to_a + from_eponymous).\n select { |c| c.regular? && c.plural? }\n next\n end\n\n @categories[dist+1] = []\n @categories[dist].each do |category|\n from_eponymous = category.eponymous_concepts.map do |concept|\n concept.categories.to_a\n end.flatten\n @categories[dist+1].concat ((@context_provider.remote_counterparts(category, :parents, Rlp::Wiki::Category) + category.parents.to_a + from_eponymous).\n select { |c| c.regular? && c.plural? })\n end\n end\n\n @categories\n end", "title": "" }, { "docid": "b0d45dc75d3b0cfd4b053b7bc6926e28", "score": "0.6500129", "text": "def categories\n cats = []\n self.product_variation.product.subcategories.collect{|sub| cats << sub.category} if self.product_variation\n cats.uniq\n end", "title": "" }, { "docid": "cd9aeaaa225b5042b964d87b5e54ec14", "score": "0.64977133", "text": "def category_list\n #categories = Sap::Category.all #get_category_tree\n #CategoryRenderer.new(categories, self).render\n end", "title": "" }, { "docid": "36e39f6aa0de3f8bef6d19ea185f4d09", "score": "0.64914495", "text": "def category\n categories.live.order(depth: :desc, lft: :asc).first\n end", "title": "" }, { "docid": "2ed31c73469a4d9d65d15585222c683b", "score": "0.6488564", "text": "def categories\n add_category('item')\n @categories\n end", "title": "" }, { "docid": "9a39173312ba4ab09d1515b89daca3ee", "score": "0.64803606", "text": "def scrape_categories\n cats = []\n # sometimes multiple selectors are used for categories so iterate through \n # each one assuming commas as a separator\n self.retailer.category_selector.split('|').each do |selector|\n the_categories = doc.css(selector)\n the_categories.each do |cat|\n # find an existing category if it exists or initialise a new one if not\n # con't create it otherwise we will end up with dud entries when running\n # tests. New retailer categories shouldn't be saved until the item is saved\n linked_cat = Category.find_or_initialize_by_name(cat.content)\n # only add the category if it isn't already there\n (self.categories << linked_cat) unless self.categories.include? linked_cat\n end\n end\n end", "title": "" }, { "docid": "9b203b743c866c3dd7d04cc9f1a0d99b", "score": "0.64761776", "text": "def cat_title_options_tree_recursive(node, addition)\n array = []\n array << [\"#{addition} #{h(node.title)}\", \"#{node.title}\"] if node.page_type == 'Category'\n node.children.categories.each do |childnode|\n array += cat_title_options_tree_recursive(childnode, \"#{addition}---\")\n end\n array\n end", "title": "" }, { "docid": "412441c2968019b82a3826702e36c3ef", "score": "0.64656746", "text": "def categories\n @categories = Category.order(:name)\n end", "title": "" }, { "docid": "f1c8848b63e3f61a98130484a9e72264", "score": "0.6464529", "text": "def index\n @categories = Category.root_level\n end", "title": "" }, { "docid": "1deb9aec63e3047a8cbe960ceb995319", "score": "0.64587665", "text": "def categories\n (@categories.delete_if {|n| n.blank?} if @categories) || []\n end", "title": "" }, { "docid": "07585b7cdb36d7c37414684aef1b96ba", "score": "0.64553285", "text": "def category_crawl_ul(options = {:relative_path => false})\n return if @search.current_category_level == 4 #|| @search.has_available_filter_of_type?(:category)\n case @search.current_category_level\n when 0\n cat_level = \"category\"\n when 1\n cat_level = \"category_second\"\n values = @search.applied_filter_values_of_type(:category)\n options[:remove] = [{:short_key => :c, :type => :all, :values => values}]\n when 2\n cat_level = \"category_third\"\n values = @search.applied_filter_values_of_type(:category_second)\n options[:remove] = [{:short_key => :c2, :type => :all, :values => values}]\n when 3\n cat_level = \"category_fourth\"\n values = @search.applied_filter_values_of_type(:category_third)\n options[:remove] = [{:short_key => :c3, :type => :all, :values => values}]\n end\n public_product_search_crawl_ul(cat_level, \"<ul class=\\\"nav\\\"><li>By category</li>\", :id, options)\n end", "title": "" }, { "docid": "02a9b3c5915fdc0a5665e79f206241d0", "score": "0.6452713", "text": "def categories\n return nil unless Documents::Category.count > 0\n Documents::CategoriesDecorator.decorate(Documents::Category.all)\n end", "title": "" }, { "docid": "1b2b4081cf0e61f3162451c065b76f87", "score": "0.64455676", "text": "def categories(cats = nil) #:yield: categories\n unless cats\n cats = @comp.categories\n yield cats\n end\n # TODO - strip the strings\n set_text_list('CATEGORIES', cats)\n end", "title": "" }, { "docid": "fd7fc4453e5911f6919e41ea8225b00b", "score": "0.6440729", "text": "def categories\n @category_templates.map do |template|\n category_hash_from_template(template[0])\n end\n end", "title": "" }, { "docid": "5f2b3c3a031fe869dba58ce2a6ad0337", "score": "0.64326364", "text": "def categories\n categories_doc = Category.new(get_category_doc.body)\n categories_doc.categories\n end", "title": "" }, { "docid": "5f2b3c3a031fe869dba58ce2a6ad0337", "score": "0.64326364", "text": "def categories\n categories_doc = Category.new(get_category_doc.body)\n categories_doc.categories\n end", "title": "" }, { "docid": "a257d4e00374074273c59135f61d175e", "score": "0.64293617", "text": "def parent_category_select(node = Node.categories_node, addition=\"\")\n array = []\n array << ((node.category.blank?) ? [\"Products\", nil] : [\"#{addition} #{node.category.title}\", node.category.id.to_s])\n node.children.categories.each do |childnode|\n array += parent_category_select(childnode, \"#{addition}---\")\n end\n array\n end", "title": "" }, { "docid": "8fc26d06055dc9a6a3ca051572ec208b", "score": "0.64271045", "text": "def index\n @categories = Category.children(nil)\n end", "title": "" }, { "docid": "54dedf7c5130d9808da3da2c2cd2cf44", "score": "0.64154917", "text": "def categories\n @categories = Category\n end", "title": "" }, { "docid": "319fa08fdebbae26e0938f1c17a9fb39", "score": "0.6410177", "text": "def categories\n taxonomies.all :conditions => { :classification => :category }\n end", "title": "" }, { "docid": "e1e24eaa8aaf12477c883a417b3bbae4", "score": "0.6402758", "text": "def categories\n \[email protected](&:to_s)\n end", "title": "" }, { "docid": "6aeef1cb999bc6673de35c8dbe3c1ac4", "score": "0.63888335", "text": "def categories\n str = \"<li>#{self.name}</li>\"\n if self.children.any?\n str = \"<li>#{self.name}<i class='fa fa-caret-right p-0'></i>\"\n str += \"<ul class='childs-menu'>\"\n self.children.each do |child|\n str += child.categories\n end\n str += \"</ul></li>\"\n end\n str.html_safe\n end", "title": "" }, { "docid": "ac9dfeb0003dd02450d953d1aa1f629b", "score": "0.6386906", "text": "def categories\n\t\t@categories = Category.order(:name) #Select * from Categories order by name \n\tend", "title": "" }, { "docid": "81a9e4239a3f9a1d3edd283e32530462", "score": "0.637835", "text": "def leaf_category_paths\n paths = []\n # 'leaves' is a named scope on the category association collection.\n self.categories.leaves.each do |cat|\n paths << {:catid => cat.id, :path => cat.full_path}\n end\n paths\n end", "title": "" }, { "docid": "e0cbcc329eb378b75dca8964f33b8c3b", "score": "0.63763285", "text": "def categories\n nil\n end", "title": "" }, { "docid": "e0cbcc329eb378b75dca8964f33b8c3b", "score": "0.63763285", "text": "def categories\n nil\n end", "title": "" }, { "docid": "ae0f58f2e322872262968494f4878dea", "score": "0.6372287", "text": "def get_categories(doc,url)\n if wiki_url?(url)\n doc.css('.reflist, .refbegin, #mw-panel, #footer').remove\n if doc.at('h2:contains(\"See also\")')\n doc.at('h2:contains(\"See also\")').next_element.remove\n end\n end\n\n final_array = get_proper_categories(doc).keys[0..1]\n common_words = get_common_categories(doc).delete_if {|k,v| final_array[0].include?(k) || final_array[1].include?(k) }.keys\n\n for word in common_words\n if final_array.length < 4\n final_array << word unless final_array.any? {|i| i.casecmp(word) == 0 } \n end\n end\n return final_array\n end", "title": "" }, { "docid": "4331a3c68be97054d8d0ec5092ec5416", "score": "0.63688177", "text": "def find_categories_under(root)\n \n if root.instance_of? String\n root = Category.find_by_name(root)\n raise \"wrong category name\" if root.nil?\n end\n \n if root.children.empty?\n false \n else\n structure = {}\n \n root.children.each do |child|\n structure[child] = find_categories_under(child)\n end\n \n structure\n end\n\n end", "title": "" }, { "docid": "da826d7241d6dae71487e5338194d8b9", "score": "0.63682497", "text": "def categories\n \t@categories = Category.all\n end", "title": "" }, { "docid": "da826d7241d6dae71487e5338194d8b9", "score": "0.63682497", "text": "def categories\n \t@categories = Category.all\n end", "title": "" }, { "docid": "0c7e3efb8f80632cd925cc7f32aeaf19", "score": "0.636726", "text": "def categories\n @persistence.categories\n end", "title": "" }, { "docid": "368f4c024905892a050e6769d09cabb4", "score": "0.63651973", "text": "def parse_category_tree\n page_html = get_page_html @donor.url\n return false if page_html.class.to_s == 'Hash'\n\n page_html.css('ul.iMenuList li a').each do |node|\n name = get_name(node)\n path = node[:href].gsub(@donor.url, '')\n next if path == 'http://www.1577shop.com/'\n save_category({name: name, path: path})\n end\n end", "title": "" }, { "docid": "ae98a405345cd53aa65a5962f1fdad10", "score": "0.63640994", "text": "def categories\n return @categories\n end", "title": "" }, { "docid": "ae98a405345cd53aa65a5962f1fdad10", "score": "0.63640994", "text": "def categories\n return @categories\n end", "title": "" }, { "docid": "1ce5a945de42c2d1522e7fa4fdadd85d", "score": "0.6355864", "text": "def get_categories_detail\n categories = Hash[\n \"clothing\" => Hash[\n \"men\" => [\"t-shirts\", \"shirts\", \"jeans\", \"kurta and shalwar kameez\", \"formal wear\", \"winter wear\"], \n \"women\" => [\"tops\", \"t-shirts\", \"jeans\", \"pants and tights\", \"dresses and skirts\", \"formal wear\", \"winter wear\"],\n \"kids\" => [\"t-shirts\", \"shirts\", \"jeans\"]\n ],\n \n \"electronics\" => Hash[\n \"laptops\" => [\"macbook\", \"window\"], \n \"smartphones\" => [\"iphone\", \"android\"],\n \"tablets\" => [\"ipad\", \"android\"]\n ],\n \n \"personal care\" => Hash[\n \"men\" => [\"deodorant\", \"hair products\", \"shaving\", \"skin care\"],\n \"women\" => [\"deodorant\", \"hair products\", \"skin care\"]\n ]\n ]\n\n return categories\n end", "title": "" }, { "docid": "f568ab4efc63c59ed1b32f025462e214", "score": "0.63544464", "text": "def list\n #get_category_list\n @categories_list = Category.sort_by_ancestry(Category.all).paginate(:page => params[:page], :per_page => 10)\n end", "title": "" }, { "docid": "0d14a9aba64e10574f9d2ddd3f24c023", "score": "0.6349871", "text": "def categories\n\t\t@categories = Category.list_categories\n\tend", "title": "" }, { "docid": "314bd295eddc2d387f8f1fe6778939ee", "score": "0.634023", "text": "def categories\n\t\t\t\t\tself.class.categories\n\t\t\t\tend", "title": "" }, { "docid": "314bd295eddc2d387f8f1fe6778939ee", "score": "0.634023", "text": "def categories\n\t\t\t\t\tself.class.categories\n\t\t\t\tend", "title": "" } ]
70b3646141194c23e9f94ee622fa3aaf
I worked on this challenge [by myself, with: ]. Your Solution Below
[ { "docid": "6322a45fef54f954cc4e77f469c97134", "score": "0.0", "text": "def good_guess?(intgr)\nif intgr == 42\n return true\nelse return false\nend\nend", "title": "" } ]
[ { "docid": "b9960478999684c2b536f76e22f6fc63", "score": "0.62877476", "text": "def solution4(input)\n end", "title": "" }, { "docid": "bca12d2414c241325b8beea187f866fa", "score": "0.60846186", "text": "def isLucky(n)\r\nhalf1 = []\r\nhalf2 = []\r\nn_string = n.to_s\r\n\r\n\r\nfirsthalf = (n_string.length / 2) - 1\r\nsecondhalfstart = (n_string.length / 2)\r\nsecondhalfend = (n_string.length - 1)\r\n(0..firsthalf).each do |idx|\r\n half1 << n_string[idx].to_i\r\nend\r\n\r\n(secondhalfstart..secondhalfend).each do |idx|\r\n half2 << n_string[idx].to_i\r\nend\r\n\r\nreturn true if half1.inject(:+) == half2.inject(:+)\r\nreturn false\r\nend", "title": "" }, { "docid": "d45d411f74262d41ad851457afd5f575", "score": "0.59898067", "text": "def problem_57\n ret,n,d = 0,1,1\n 1000.times do |i|\n n,d = (n+2*d),(n+d)\n ret += 1 if n.to_s.length > d.to_s.length\n end\n ret\nend", "title": "" }, { "docid": "f712d49ec6c615538b2e2aa846391fda", "score": "0.5987108", "text": "def challenge; end", "title": "" }, { "docid": "0aa3d9ebc94b882f1172fa1ed40657ef", "score": "0.59478503", "text": "def is_happy(n)\n i = 0\n r = false\n destination = []\n while r == false\n n.to_s.split(\"\").each do |x|\n destination << ((x.to_i * x.to_i))\n end\n i = i + 1\n n = destination.inject(&:+)\n r = true if n == 1\n destination = []\n break if i == 1000\n end\n if r == true\n p r\n else\n p false\n end\nend", "title": "" }, { "docid": "2481cbf165330db256eee896a32c82e4", "score": "0.5904577", "text": "def solution(a)\r\n n=a.size\r\n i=1\r\n for k in a.sort do\r\n\tif k!=i \r\n\t then \r\n\t return 0\r\n\t break;\r\n\tend\r\n i+=1;\r\n end\t\r\n return 1 if a.inject(:+) ==n*(n+1)/2;\r\nend", "title": "" }, { "docid": "2c5090c0737e63ee23f1300ec3567b3d", "score": "0.5855582", "text": "def solution(a)\n # write your code in Ruby 2.2\n sum = a.inject(:+)\n acc = 0\n\n min = 99999999\n a[0..-2].each do |n|\n sum -= n\n acc += n\n\n min = [(acc - sum).abs, min].min\n end\n min\nend", "title": "" }, { "docid": "8177e2338342fbfef778f02d1c1aed4b", "score": "0.5843953", "text": "def solution(a)\n # write your code in Ruby 2.2\n binding.pry\n trips = Hash.new {|h,k| h[k]=0}\n start = 0\n ending = 0\n min = nil\n a.each_with_index do |trip,i|\n ending = i\n\n if trips[trip] == 0\n min = ending - start\n end\n trips[trip] += 1\n\n while start < ending\n break if trips[a[start]] - 1 == 0\n trips[start] -= 1\n start += 1\n min = ending - start if ending-start < min\n end\n end\n min\nend", "title": "" }, { "docid": "951127c361c3ec5bdc0be7bc21790e6a", "score": "0.5840107", "text": "def isLucky(n)\n new_array = n.to_s.split(\"\")\n new_length = new_array.length\n\n a, b = [], []\n\n (0...new_length / 2).each { |x| a.push(new_array[x].to_i) }\n (new_length / 2...new_length).each { |y| b.push(new_array[y].to_i) }\n\n if a.inject(:+) == b.inject(:+)\n return true\n else\n false\n end\n\nend", "title": "" }, { "docid": "98ed5a760cfc0a12c218af7adfe0c420", "score": "0.5832357", "text": "def solution(a)\n length = a.length\n sum = (length + 1) * (length + 1 + 1) / 2\n\n sum - a.inject(0) { |acc, e| acc += e }\nend", "title": "" }, { "docid": "c746f666835e31bc402763bab3ca9579", "score": "0.58223367", "text": "def solution(a, b)\n if a.length > b.length\n return (b + a + b).to_s\n else\n return (a + b + a).to_s\n end\nend", "title": "" }, { "docid": "afd4083898e8b0a53a08b37c003cfe5c", "score": "0.5812061", "text": "def decodeHalfway(input)\n sum = 0\n\n # Only have to loop through half the array since the numbers are being compared halfway around\n # Multiply each matching character by 2 to compensate for not looping through its pair\n input.chars[0..input.length/2 - 1].each_with_index do |char, i|\n sum += 2*char.to_i if char == input[i + input.length/2]\n end\n sum\nend", "title": "" }, { "docid": "27642489b728f4d1034fbd38d2ee3dde", "score": "0.5797304", "text": "def solution(a)\n number = a.to_s.chars\n first_arrays = []\n (number.length/2).times do\n first_arrays << number.shift\n first_arrays << number.rotate(number.length-1).shift\n number.pop\n end\n ( first_arrays + number ).join(\"\").to_i\nend", "title": "" }, { "docid": "60396d976360a20a80b14f177c291c57", "score": "0.57972187", "text": "def solution(s, p, q)\n # write your code in Ruby 2.2\n g = s.length + 1\n a = (s.length + 1)**3\n c = (s.length + 1)**2\n tmp = []\n res = []\n tmp.push 0\n o = 0\n s.split('').each do |i|\n o += if i == 'T'\n 1\n elsif i == 'G'\n g\n elsif i == 'C'\n c\n else\n a\nend\n tmp.push o\n end\n (0...p.length).each do |k|\n o = tmp[q[k] + 1] - tmp[p[k]]\n if o >= a\n res.push 1\n elsif o >= c\n res.push 2\n elsif o >= g\n res.push 3\n else\n res.push 4\n end\n end\n res\nend", "title": "" }, { "docid": "01ab7e3014c59c0e8d2bf0446401b3f4", "score": "0.57929134", "text": "def solution(n)\n n.to_s.split(//).inject(1) { |a,d| a + d.to_i }\nend", "title": "" }, { "docid": "e9506e5c5be49078757652976ec6068d", "score": "0.5785207", "text": "def solution(a)\n n = a.size\n passing_cars = 0\n\n suffix_sums = Array.new(n + 1, 0)\n\n a.reverse.each_with_index do |elem, i|\n suffix_sums[i + 1] = suffix_sums[i] + elem\n end\n suffix_sums.reverse!\n\n a.each_with_index do |car, i|\n if car == 0\n passing_cars += suffix_sums[i]\n end\n end\n\n passing_cars > 1_000_000_000 ? -1 : passing_cars\nend", "title": "" }, { "docid": "11e00136309f621908b71f69ef6bd8de", "score": "0.57834065", "text": "def solutions(a)\r\n\r\n ary = a.sort\r\n ary.each_with_index do |num, index|\r\n if ary[index+1] != num + 1 && index != ary.length-1\r\n return num + 1\r\n end\r\n end\r\n\r\nend", "title": "" }, { "docid": "e2a136369b0dfe578d812e5b2abc12ec", "score": "0.5782036", "text": "def isLucky(n)\n sum, sum2 = 0, 0\n arr = n.to_s.split(\"\")\n \n first_half = arr.take(arr.size / 2) \n second_half = arr.drop((arr.size / 2))\n first_half.each { |x| sum += x.to_i }\n second_half.each {|x| sum2 += x.to_i}\n \n sum == sum2\nend", "title": "" }, { "docid": "323936c576f02d232ff8b3c7b4a0fbdb", "score": "0.5781985", "text": "def solution(number)\nn = 0..number\na = []\nfor i in n\n if i % 3 == 0 || i % 5 == 0\n a = a.push(i)\n end\n end\ns = 0\n# a.pop\na.each {|x| s += x}\ns\nend", "title": "" }, { "docid": "54b5a04b5709efbda06f838626206ec1", "score": "0.57781845", "text": "def goodVsEvil(good, evil)\n # good_power, evil_power = 0, 0\n # good.split.each_with_index do |num, i|\n # if i < 3\n # good_power += num.to_i * (i + 1)\n # elsif i < 5\n # good_power += num.to_i * i\n # elsif i == 5\n # good_power += num.to_i * 2 * i\n # end\n # end\n god = good.split.each_with_index.inject(0) do |sum, (num, i)|\n if i < 3\n sum + num.to_i * (i + 1)\n elsif i < 5\n sum + num.to_i * i\n elsif i == 5\n sum + num.to_i * 2 * i\n end\n end\n \n \n evl = evil.split.each_with_index.inject(0) do |sum, (num, i)|\n case i\n when 0\n sum + num.to_i * (i + 1)\n when 1, 2, 3\n sum + num.to_i * 2\n when 4\n sum + num.to_i * (i - 1)\n when 5\n sum + num.to_i * i\n when 6\n sum + num.to_i * (i + 4) \n end\n end\n \n if evl > god\n str = \"Evil eradicates all trace of Good\"\n elsif evl < god\n str = \"Good triumphs over Evil\"\n else\n str = \"No victor on this battle field\"\n end\n \n \"Battle Result: #{str}\"\nend", "title": "" }, { "docid": "0e327f382de084efc59140ad2970b9b8", "score": "0.57599825", "text": "def solution(a)\n return 1 if a.empty?\n a.sort!\n return 1 if a.first > 1\n return a.first + 1 if a.length <2\n (0..(a.length)).each do |index|\n return a[index] + 1 if a[index] + 1 != a[index + 1]\n end\n return a.last + 1\nend", "title": "" }, { "docid": "12e3ab5bb24eb3f6f1d00e6b007f6822", "score": "0.5756927", "text": "def solution\n (2..(9**5 * 6)).select do |n|\n n.to_s.split(//).map do |d|\n d.to_i ** 5\n end.reduce(:+) == n\n end.reduce(:+)\nend", "title": "" }, { "docid": "de48274b3b7a2f885d3d8d6629ae2bc4", "score": "0.5755901", "text": "def problem_76a\n num = 100\n solve = lambda do |a,off,max|\n n = 0\n while a[off] < max && (a.length-off) >= 2 \n a[off] += a.pop\n n += 1\n n += solve.call(a.dup,off+1,a[off]) if a.length - off > 1\n end\n n\n end\n puts 1 + solve.call([1] * num, 0,num-1)\nend", "title": "" }, { "docid": "36b0cc4672c5b01fa08e1a37de72f6bd", "score": "0.5744732", "text": "def input_string\n result = \"73167176531330624919225119674426574742355349194934\"\n result += \"96983520312774506326239578318016984801869478851843\"\n result += \"85861560789112949495459501737958331952853208805511\"\n result += \"12540698747158523863050715693290963295227443043557\"\n result += \"66896648950445244523161731856403098711121722383113\"\n result += \"62229893423380308135336276614282806444486645238749\"\n result += \"30358907296290491560440772390713810515859307960866\"\n result += \"70172427121883998797908792274921901699720888093776\"\n result += \"65727333001053367881220235421809751254540594752243\"\n result += \"52584907711670556013604839586446706324415722155397\"\n result += \"53697817977846174064955149290862569321978468622482\"\n result += \"83972241375657056057490261407972968652414535100474\"\n result += \"82166370484403199890008895243450658541227588666881\"\n result += \"16427171479924442928230863465674813919123162824586\"\n result += \"17866458359124566529476545682848912883142607690042\"\n result += \"24219022671055626321111109370544217506941658960408\"\n result += \"07198403850962455444362981230987879927244284909188\"\n result += \"84580156166097919133875499200524063689912560717606\"\n result += \"05886116467109405077541002256983155200055935729725\"\n result += \"71636269561882670428252483600823257530420752963450\"\n\n result\nend", "title": "" }, { "docid": "30f92fe33f092a92543bf7dbb1aecf45", "score": "0.5715907", "text": "def theLoveLetterMystery(s)\n chars = s.chars\n size = chars.length\n sum = 0\n ((size+1)/2..(size -1)).each do |i|\n num = chars[i].ord\n target_num = chars[size-1-i].ord\n sum += (num - target_num).abs\n end\n sum\nend", "title": "" }, { "docid": "eabdd32fa3a69c563917961e33bdbf96", "score": "0.5715599", "text": "def solution(s, p, q)\r\n # write your code in Ruby 2.2\r\n # A -1\r\n # C -2\r\n # G -3\r\n # T -4\r\n # s - string with n charactekrs\r\n #cagccta\r\n #0123345\r\n #p,q - not empty arrays\r\n #\r\n #p[0]=2 q[0]=4 gcc 322 => 2\r\n #p[1]=5 q[1]=5 t 4 => 4\r\n \r\n \r\n arr = Array.new(q.count)\r\n \r\n \r\n\r\n \r\n arr.each_with_index{|el, i|\r\n \r\n ss = s[p[i]..q[i]]\r\n \r\n if ss.index('A') \r\n n = 1\r\n elsif ss.index('C')\r\n n=2\r\n elsif ss.index('G')\r\n n=3\r\n else \r\n n=4\r\n end\r\n \r\n arr[i] = n\r\n \r\n }\r\n \r\n \r\n \r\n arr\r\n \r\nend", "title": "" }, { "docid": "cc01c5884d04791436c792567fafb5d5", "score": "0.5704328", "text": "def solution(n)\n n.to_s(2).reverse.to_i.to_s.split('1').map(&:length).max || 0\nend", "title": "" }, { "docid": "e625e8a723f51af4b24bfed22a83a7dd", "score": "0.57001245", "text": "def solution(a)\n # write your code in Ruby 2.2\n n = a.length\n \n counter = Array.new(n+1, 0)\n \n a.each do |x|\n counter[x-1] += 1\n end\n \n return counter.index { |x| x == 0 } + 1\nend", "title": "" }, { "docid": "a9392dee0faf707e292542e90b88d4c2", "score": "0.56882286", "text": "def solution(a)\r\n a.each do |num|\r\n if (a.count(num) % 2) != 0\r\n return num\r\n end\r\n end\r\nend", "title": "" }, { "docid": "1fa576a292d7587afbc3364f8dcfea1b", "score": "0.56869423", "text": "def isLucky(n)\n a = n.to_s.split(\"\")\n full = a.count - 1\n half = a.count/2 - 1\n \n total_1 = 0\n total_2 = 0\n \n for i in 0..full\n if i > half\n total_2 += a[i].to_i\n else\n total_1 += a[i].to_i\n end\n end\n \n if total_1 == total_2\n true\n else\n false\n end\nend", "title": "" }, { "docid": "528b737d0e56fa36ed3c9a0bc7d2dece", "score": "0.56753415", "text": "def decent_number(n)\n\tleft = 0\n\tright = 0\n\t(n+1).times do |i|\n\t\tleft = n - i \n\t\tright = n - left\n\t#\tputs \"#{left}%3 = #{left%3} | #{right}%5 = #{right%5}\"\n\t\tbreak if left % 3 == 0 && right % 5 == 0\n\tend\n\t#puts \"**l = #{left} r = #{right}\"\n\n\tif left % 3 == 0 && right % 5 == 0\n\t\tfives = \"5\"*left\n\t\tthrees = \"3\"*right\n\t\tputs fives+threes\n\telse\n\t\tputs -1\n\tend\nend", "title": "" }, { "docid": "4fb444751234b773ec1dc6b77775f786", "score": "0.5673146", "text": "def formingMagicSquare(s)\r\n out = 100\r\n for i in 0...8 do\r\n cost = 0\r\n for j in 0...3 do\r\n for k in 0...3 do\r\n cost += ($magic_square[i][j][k] - s[j][k]).abs\r\n end\r\n end\r\n puts cost\r\n out = [out, cost].min\r\n end \r\n out\r\nend", "title": "" }, { "docid": "2b00a8cafafc538a47343cb0c57c6885", "score": "0.5672039", "text": "def solution(a)\r\n # write your code in Ruby 2.2\r\n #trangular\r\n # a[0] = 10\r\n # a[2] = 5\r\n # a[4] = 8\r\n # 10 + 5 > 8\r\n # 5 + 8 > 10\r\n #8 + 10 > 5\r\n \r\n \r\n l=a.count\r\n \r\n i=0\r\n while(i<l) do\r\n j=i+1\r\n while(j<l) do\r\n k=j+1\r\n \r\n \r\n while(k<l) do\r\n if((a[i] + a[j] > a[k]) && (a[j] +a[k] > a[i]) && (a[k] + a[i] >a[j]))\r\n return 1\r\n end\r\n k+=1 \r\n end \r\n \r\n j+=1 \r\n end\r\n i+=1\r\n end\r\n \r\n return 0\r\n \r\nend", "title": "" }, { "docid": "8c2066be19f777ed238f012d365487d4", "score": "0.56690854", "text": "def captcha(input)\n sum = 0\n 0.upto(input.length - 1) do |i|\n sum += input[i].to_i if input[i] == input[(i+1) % input.length]\n end\n sum\nend", "title": "" }, { "docid": "492e936526ebfbffbc3c3b62f458936f", "score": "0.56674385", "text": "def solution(a)\n n = a.size\n return 0 unless n > 2\n a.sort!\n\n (2..n - 1).each do |i|\n return 1 if a[i - 2] + a[i - 1] > a[i]\n end\n\n return 0\nend", "title": "" }, { "docid": "e8f55d8332038d49a29528b132a3e632", "score": "0.5662431", "text": "def correct(element)\n result = nil\n element.downto(0).each do |j|\n i = element - j\n if j == element && j % 3 == 0\n result = Array.new(j, 5)\n elsif i % 5 == 0 && j % 3 == 0\n result = Array.new(j, 5) + Array.new(i, 3)\n elsif i == element && i % 5 == 0\n result = Array.new(i, 3)\n end\n\n break if result\n end\n\n if result.nil?\n puts -1\n else\n puts result.join()\n end\nend", "title": "" }, { "docid": "6102d628d6d63d9ee9f00ef7d54c6b21", "score": "0.56534564", "text": "def solution(s)\n if s.length.odd?\n center = s.length / 2\n if s[0...center] == s[center + 1..s.length].reverse\n return center \n end\n end\n -1\nend", "title": "" }, { "docid": "31b17baab1d625ddc147e791086d05a9", "score": "0.5652185", "text": "def solution\n (1..40).inject(:*) / (1..20).inject(:*)**2\nend", "title": "" }, { "docid": "72dc06196dfda39b3b6243930e52be3e", "score": "0.56499076", "text": "def solution(n)\n # write your code in Ruby 2.2\n a = n.to_s(2)\n arr = []\n if a[-1] == '1'\n arr = a.split('1')\n else\n arr = a.split('1')\n arr.pop\n end\n if arr.max.nil?\n 0\n else\n arr.max.length\n end\nend", "title": "" }, { "docid": "d744b037d3ee6458a3d4c99f4c1aead8", "score": "0.5649523", "text": "def solution(a)\n ans = 0\n for i in 1 .. (a.length - 1)\n ans += a[i]\n end \n ans\nend", "title": "" }, { "docid": "73d1aa4ccc53e037d7f9b2c46c5ca501", "score": "0.56367433", "text": "def solution(number)\n sum = 0\n Array(1..number-1).each do |i|\n if i % 3 == 0 || i % 5 == 0\n sum += i\n end\n end\n sum\nend", "title": "" }, { "docid": "adeefa98b6bdede7b1acc83bb93cab48", "score": "0.56206477", "text": "def solution(a)\n return 0 if a.length < 3\n a.sort!\n\n for i in 0..(a.length - 3)\n return 1 if a[i] + a[i + 1] > a[i + 2]\n end\n return 0\nend", "title": "" }, { "docid": "4c5e6216d6297e18cad7e814d6fdebb3", "score": "0.5614715", "text": "def problem18(r) \n h = r.length\n sum = 0\n for i in 0..h-1 \n \n end\nend", "title": "" }, { "docid": "61cfdc3647f43f1c505f522e570dbf15", "score": "0.56131756", "text": "def solution(n)\n # write your code in Ruby 2.2\n a = Math.sqrt(n).floor\n a -= 1 while n % a != 0\n b = n / a\n (a + b) * 2\nend", "title": "" }, { "docid": "54daf6b93940e3e4e685ffea5be30ead", "score": "0.5605672", "text": "def alg; end", "title": "" }, { "docid": "5f02d7ebc08c70831b6203c0e7147c69", "score": "0.5599195", "text": "def pzoe\n sum = 0\n (0..9).each do |a|\n (0..9).each do |b|\n (0..9).each do |c|\n (0..9).each do |e|\n (0..9).each do |f|\n (0..9).each do |g|\n sum += a * 100000 + b * 10000 + c * 1000 + e * 100 + f * 10 + g if a * 100000 + b * 10000 + c * 1000 + e * 100 + f * 10 + g == a ** 5 + b ** 5 + c ** 5 + e ** 5 + f ** 5 + g ** 5\n end\n end\n end\n end\n end\n end\n sum - 1\nend", "title": "" }, { "docid": "9ac9f4fce5c49412295e121a295a190d", "score": "0.55974835", "text": "def main\n max = 10 ** 9 + 7\n all = 1\n zero = 1\n nine = 1\n zn = 1\n N.times.each do\n all = all * 10 % max\n zero = zero * 9 % max\n nine = nine * 9 % max\n zn = zn * 8 % max\n end\n return (all - zero - nine + zn) % max\nend", "title": "" }, { "docid": "e293be50a7797e52157d79246e3acf7f", "score": "0.5596386", "text": "def solution(a)\n return 1 if a.count == 0\n \n real_sum = a.inject(:+)\n expected_sum = (a.count + 1) * (a.count + 2) / 2.0\n (expected_sum - real_sum).to_i\nend", "title": "" }, { "docid": "768f5d24f771c370ceacdbb01f661f1b", "score": "0.5586213", "text": "def minimumBribes(q)\n bribes = 0\n q.reverse.each_with_index do |n, i|\n if q[i] - (i + 1) > 2\n bribes = \"Too chaotic\"\n break\n end\n j = [0, q[i] - 2].max\n while j < i\n if q[j] > q[i]\n bribes += 1\n end\n j += 1\n end\n end\n puts bribes\nend", "title": "" }, { "docid": "86460f1eb5dea4ea117f4cd8b4b400d1", "score": "0.55841184", "text": "def featured(n)\n n += 1\n n += 1 until n % 7 == 0 && n.odd?\n loop do\n break if n.to_s.chars.uniq.join == n.to_s\n n += 14\n if n > 9876543210\n puts \"There is no possible number that fulfills those requirements\"\n return nil\n end\n end\n n\nend", "title": "" }, { "docid": "03d94266da4f853f28081559dfa20f31", "score": "0.55826294", "text": "def solution(a)\n # write your code in Ruby 2.2\n counts = {}\n missing = -1\n\n a.each do |a_i|\n counts[a_i] = counts[a_i].to_i + 1\n end\n\n (1..a.length).each do |i|\n if(counts[i].nil?)\n missing = i\n break\n end\n end\n\n if(missing == -1)\n missing = a.length + 1\n end\n\n missing\nend", "title": "" }, { "docid": "38307a67b93e49b934bcd426ae9cf2a1", "score": "0.5582062", "text": "def dominant_octopus(fish)\n #sorted = []\n return fish if fish.length < 2\n pivot = fish.first\n left = fish[1..-1].select { |feesh| feesh.length <= pivot.length }\n #p left\n right = fish[1..-1].select { |feesh| feesh.length > pivot.length }\n\n dominant_octopus(left) + [pivot] + dominant_octopus(right)\n \n\n\nend", "title": "" }, { "docid": "7be80e9f81c75b087e989f33ba8092e7", "score": "0.55787766", "text": "def solution(a)\n # write your code in Ruby 2.2\n permutation = Array(1..a.size)\n # puts permutation\n return 1 if permutation - a == []\n 0\nend", "title": "" }, { "docid": "034b369a6a4d2fb7b4420415908d3f71", "score": "0.5576581", "text": "def solution(n)\n x = (n**0.5).floor\n (1..x).reduce(0) { |s, i| n % i == 0 ? s += (i * i == n ? 1 : 2) : s }\nend", "title": "" }, { "docid": "96c8cf5dff4b610b8a092add2335be19", "score": "0.55743766", "text": "def isLucky(n)\n n = n.to_s.split('').map(&:to_i)\n n.shift(n.size/2).reduce(:+) == n.reduce(:+)\nend", "title": "" }, { "docid": "a6c0407e7795e5c1706eb42edfd6b956", "score": "0.5571653", "text": "def solution(a)\n # write your code in Ruby 2.2\n numbers = Array(1..(a.size + 1))\n res = numbers - a\n res[0]\nend", "title": "" }, { "docid": "32fe45f3f79aed200222aae586514cab", "score": "0.5565097", "text": "def solution(k, a)\n count = 0\n current = 0\n a.each { |length| \n current += length\n if current >= k\n current = 0\n count += 1\n end\n }\n count\nend", "title": "" }, { "docid": "67295e80a8da9bf6c7034a90912d7c3c", "score": "0.55624074", "text": "def solution(n)\n\t(1..n).map(&:to_s).map(&:chars).join.chars.map(&:to_i).reduce(:+)\nend", "title": "" }, { "docid": "4365770b9ed1ce1d1afda189262f2978", "score": "0.55611956", "text": "def solution(a)\n # write your code in Ruby 2.2\n\n # sort a\n a = a.sort\n odd = 0\n\n # loop over the array\n (0..(a.length-1)).step(2) do |i|\n if((i+1 >= a.length) || ((i+1 < a.length) && (a[i] != a[i+1])))\n odd = a[i]\n break\n end\n end\n\n odd\nend", "title": "" }, { "docid": "f7613aae5d648335b2424bf21c0a08b3", "score": "0.55548143", "text": "def solution1(seeds)\n turn_map = {}\n seeds.each_with_index { |n, turn| turn_map[n] = [1, turn + 1, turn + 1] }\n last_number = seeds.last\n\n ((seeds.length+1)..2020).each do |turn|\n last_stats = turn_map[last_number]\n if last_stats[TIMES_SPOKEN] == 1\n zero = turn_map[0] || [0, turn, turn]\n zero[TIMES_SPOKEN] += 1\n zero[FIRST_SPOKEN] = zero[LAST_SPOKEN]\n zero[LAST_SPOKEN] = turn\n \n turn_map[0] = zero\n last_number = 0\n else\n age = last_stats[LAST_SPOKEN] - last_stats[FIRST_SPOKEN]\n\n num = turn_map[age] || [0, turn, turn]\n num[TIMES_SPOKEN] += 1\n num[FIRST_SPOKEN] = num[LAST_SPOKEN]\n num[LAST_SPOKEN] = turn\n \n turn_map[age] = num\n last_number = age\n end\n end\n\n last_number\nend", "title": "" }, { "docid": "6382e169d9a2f48d6306d3ba92eee028", "score": "0.55546194", "text": "def solution(a)\n # write your code in Ruby 2.2\n \n is_perm = 0\n \n n = a.length\n b = [0]*n\n \n \n a.each do |v|\n break if v > n \n break if b[v] == 1 \n b[v] = 1\n end\n \n sum = b.inject(:+)\n if sum == n\n is_perm = 1\n end\n \n is_perm\nend", "title": "" }, { "docid": "88ba0caf44689a0805f0dca16999014e", "score": "0.5552787", "text": "def strong_num(n)\n array = n.to_s.chars.map(&:to_i)\n sumarray = []\n array.each do |number|\n sum = (1..number).inject(:*) || 1\n sumarray << sum\n end\n sumarray.sum == n ? \"STRONG!!!!\" : \"Not Strong !!\"\nend", "title": "" }, { "docid": "0250d227f29a83d9cd2ac26c8fcd7fcf", "score": "0.55449444", "text": "def solution(a)\n a.sort!\n a.each_with_index do |element, index|\n return 0 if element != index + 1\n end\n 1\nend", "title": "" }, { "docid": "6e33c10b282141992a38f8fd30d5a452", "score": "0.5541486", "text": "def solution(m, a)\n n = a.count\n result = 0\n front = 0\n numbers = Array.new(m + 1, false)\n n.times { |back|\n while front < n and not numbers[a[front] - 1]\n numbers[a[front] - 1] = true\n front += 1\n result += front - back\n return 1_000_000_000 if result >= 1_000_000_000\n end\n numbers[a[back] - 1] = false\n }\n result\nend", "title": "" }, { "docid": "78dbe5c66c3c7dac5a025f544ef86461", "score": "0.5541017", "text": "def solution(a)\n s= a.sort\n 0.step(s.size - 1).inject(0) do |result, x|\n z= x+2\n (x+1).step(s.size - 1).inject(result) do |acc, y|\n z+=1 while z < s.size && s[x] + s[y] > s[z]\n acc += z-y-1\n end\n end\nend", "title": "" }, { "docid": "cec8cdd07b9ddbe218324e492d764349", "score": "0.5539666", "text": "def recursive_solution\n\n end", "title": "" }, { "docid": "41785b535108a22cc6b08bf08cd5af00", "score": "0.5535844", "text": "def solution(n)\n sum = 0\n (1...n).each do |elem|\n sum += elem if elem % 3 == 0 or elem % 5 == 0\n end\n sum\nend", "title": "" }, { "docid": "b558f41a92a195a411fdbfcf8ce2eae7", "score": "0.5535633", "text": "def solution(a)\n cars_going_east = [0]\n\n a.each do |direction|\n next_counter = direction.zero? ? cars_going_east.last + 1 : cars_going_east.last\n cars_going_east << next_counter\n end\n\n passings = 0\n a.each_with_index do |direction, index|\n passings += cars_going_east[index] if direction == 1\n end\n\n return -1 if passings > 1000000000\n passings\nend", "title": "" }, { "docid": "b65619a33550fcb90621b7dedc97eb4a", "score": "0.55274105", "text": "def solution(roman)\n split = roman.split(\"\")\n last_value = 0\n split.reduce(0) do |final, char|\n current = CONVERSION[char.upcase]\n binding.pry\n if current >= last_value\n final += current\n else\n final -= current\n end\n binding.pry\n last_value = current\n final\n end\nend", "title": "" }, { "docid": "8fa28cb10a830d9a79764fce3d58aebc", "score": "0.5524687", "text": "def solve(str)\n idx = 0\n count = 0\n\n substr_1 = ''\n substr_2 = ''\n\n loop do\n substr_1 = str[0..idx]\n substr_2 = str[(idx + 1)..-1]\n\n substr_1.to_i.odd? ? count += 1 : nil \n substr_2.to_i.odd? ? count += 1 : nil \n \n idx += 1\n break if idx >= str.length\n end\n count\nend", "title": "" }, { "docid": "f83beee7264f19ff23fa689c617bcfb2", "score": "0.5523292", "text": "def hard(input)\n to = input / 10\n houses = Array.new(to, 0)\n (1..to).each do |n|\n count = 0\n n.step(by: n, to: to - 1) do |i|\n houses[i] += 11 * n\n count += 1\n break if count == 50\n end\n end\n houses.index { |count| count >= input }\nend", "title": "" }, { "docid": "70beafc23045715e7fda738e773a4e68", "score": "0.5522361", "text": "def is_happy(n)\n return false if n < 10 && n % 2 == 0\n return false if n < 1 \n return true if n == 1\n \n sum = 0\n\n nsplit = n.to_s.split(\"\")\n nsplit.each do |i|\n sum += (i.to_i * i.to_i)\n end\n\n return is_happy(sum)\n \nend", "title": "" }, { "docid": "b214c249bf03c40c9ef18e988bd417e1", "score": "0.5515779", "text": "def solve(s)\n answer = \"\"\n (0...s.length - 1).each do |idx|\n if s[idx] != s[idx + 1]\n answer += s[idx]\n end\n if idx == s.length - 2 && s[idx] == s[idx + 1]\n answer += s[idx]\n end\n end\n return answer\nend", "title": "" }, { "docid": "a34136b252942a79b5bed070aeb1febc", "score": "0.5515481", "text": "def solution(a)\n accessed = Array.new(a.size + 1, nil)\n caterpillar_back = 0\n count = 0\n\n a.each_with_index do |x, caterpillar_front|\n if accessed[x] == nil\n accessed[x] = caterpillar_front\n else\n new_caterpillar_back = accessed[x] + 1\n first_part_size = caterpillar_front - caterpillar_back\n second_part_size = caterpillar_front - new_caterpillar_back\n count += first_part_size * (first_part_size + 1) / 2\n count -= (second_part_size) * (second_part_size + 1) / 2\n caterpillar_back.upto(new_caterpillar_back - 1) { |n| accessed[a[n]] = nil}\n accessed[x] = caterpillar_front\n caterpillar_back = new_caterpillar_back\n end\n end\n\n remaining_size = a.size - caterpillar_back\n count += (remaining_size) * (remaining_size + 1) / 2\n end", "title": "" }, { "docid": "1784caef886c6a7ab2a177f23d7909ae", "score": "0.55134827", "text": "def solution\n 971 * (-61)\nend", "title": "" }, { "docid": "78bf880151361ed64e96ddc834ff7fdf", "score": "0.55110383", "text": "def solution_one\n x = 0\n (1..999).each do |i|\n if (i % 5) == 0 || (i % 3) == 0\n x = x + i\n end\n end\n x\nend", "title": "" }, { "docid": "0fd5636402d96611a2405a8ceb2921d8", "score": "0.5508901", "text": "def solve(n, s, d, m)\n # Complete this function\n records = s;\n\n (1...n).each do |i|\n records[i] += records[i-1]\n end\n\n numberOfWays = (m <= n && records[m - 1] == d) ? 1 : 0;\n\n (m...n).each do |i|\n if records[i] - records[i - m] == d\n numberOfWays += 1\n end\n end\n\n numberOfWays\n\nend", "title": "" }, { "docid": "43c7b8adabdcbd12b6793b0add7d1d3f", "score": "0.5502962", "text": "def solution(arr)\n zeros = 0\n pass_cars = 0\n\n (0...arr.size).each do |idx|\n arr[idx] == 0 ? zeros += 1 : pass_cars += zeros\n\n return -1 if pass_cars > 1000000000\n end\n\n pass_cars\nend", "title": "" }, { "docid": "890812e1620b10db01ad9be1d135a360", "score": "0.54972655", "text": "def pe52(startAt, endAt)\n (startAt..endAt).step(6).each do |x|\n bNum = x/6\n bNumCSort = bNum.to_s.chars.sort\n next if bNumCSort != x.to_s.chars.sort\n next if bNumCSort != (bNum*5).to_s.chars.sort\n next if bNumCSort != (bNum*4).to_s.chars.sort\n next if bNumCSort != (bNum*3).to_s.chars.sort\n next if bNumCSort != (bNum*2).to_s.chars.sort\n return bNum\n end\n false\nend", "title": "" }, { "docid": "686cad9dfd983144af5cfff9e1ee3760", "score": "0.5496658", "text": "def solution(n)\n\tval = 0.0\n\tval += 1.0 unless n[0].zero?\n\tval += 2.0 unless n[1].zero?\n\tval += 4.0 unless n[2].zero?\n\tval += 8.0 unless n[3].zero?\n val\n\t\nend", "title": "" }, { "docid": "a1d0ab84f51d63c330c1975d0d8199cb", "score": "0.54962796", "text": "def solve\n 1.upto(100).inject(:*).to_s.split('').map{|x| x.to_i}.inject(:+)\nend", "title": "" }, { "docid": "75f295e4180e7bece17209f2415eb2cc", "score": "0.54934126", "text": "def is_armstrong(n)\n n_str=n.to_s()\n char_list=n_str.split(//)\n int_list=char_list.map {|x| (x.to_i())**(n_str.length()) }\n mysum = int_list.reduce(0) { |sum, num| sum + num }\n return (mysum==n)\nend", "title": "" }, { "docid": "f3492c4f74b464b678df3a67cc625402", "score": "0.5491939", "text": "def solve(nums)\n count = 0\n nums.each do |num|\n if num.to_s.length % 2 != 0\n count += 1\n end\n end\n return count\nend", "title": "" }, { "docid": "3f54381f59bea3e7c2712856be90c18a", "score": "0.54902667", "text": "def featured(number)\n sum = 7\n loop do \n return \"There is no possible number that fulfills those requirements\" if number >= 9_876_543_210\n if sum <= number\n sum += 7\n elsif sum.even?\n sum += 7\n elsif sum.digits.uniq != sum.digits\n sum += 7\n else\n break\n end\n end\n sum\nend", "title": "" }, { "docid": "6ed173d0098ae4fdffd09dc2e8eeed6f", "score": "0.54901296", "text": "def solve(input)\n data = input.chars\n buckets = []\n current = []\n data.each_with_index do |c, i|\n n = data[i + 1]\n current << c\n unless n == c\n buckets << current\n current = []\n end\n break if n.nil?\n end\n\n ret = ''\n buckets.each do |b|\n ret += b.count.to_s\n ret += b.first\n end\n ret\nend", "title": "" }, { "docid": "e0e55bf3ad3af44f2259d470cbd5f318", "score": "0.5478603", "text": "def minimumBribes(q)\n bribe_count = 0\n # q.each_with_index do |person,i|\n i = q.size-1\n while i >= 0 do\n person = q[i]\n position = i+1\n offset = person - position\n\n if offset > 2\n puts \"Too chaotic\"\n return\n else\n j=[0,person-2].max\n while j < i do\n if q[j] > person\n bribe_count += 1\n else\n # break if j+1 == person\n end\n j+=1\n end\n end\n i-=1\n end\n puts bribe_count\nend", "title": "" }, { "docid": "c74d283e5b9fe5d3178eac2980a0d389", "score": "0.5471646", "text": "def solution(n)\n (1..n).to_a.join.chars.map(&:to_i).sum\nend", "title": "" }, { "docid": "08848278c512d512e04d35c06833e295", "score": "0.5471645", "text": "def solution(a)\n\traise ArgumentError.new(\"a has to be non empty array of max size #{MAX_LEN}\") if !a.is_a? Array or a.empty? or a.length > MAX_LEN\n\tret = 0\n\t#puts a.inspect\n\tmy_h = Hash.new\n\ta.each do |e|\n\t\tif my_h.include? e\n\t\t\tmy_h[e] += 1\n\t\telse\n\t\t\tmy_h[e] = 1\n\t\tend\n\tend\n\n\tmy_h_sort = my_h.sort_by {|k, v| -v}\n\t# -> my_h_sort[value][occurances]\n\treturn 0 if my_h_sort.first[1] < a.size/2\n\tleader_val = my_h_sort.first[0]\n\n\tocc_array = Array.new\n\toccurances = 0\n\ta.each do |e|\n\t\toccurances += 1 if e == leader_val\n\t\tocc_array.push(occurances)\n\tend\n\t#puts occ_array.inspect\n\n\tfor idx in (0...a.length-1) do\n\t\tsum1 = occ_array[idx]\n\t\tsum2 = occ_array.last - occ_array[idx]\n\n\t\t# puts \"#{idx}+1 < #{sum1*2}\"\n\t\t# puts \"#{(a.length - idx -1)} < #{(sum2*2 )} \"\n\n\t\tif (idx+1) < sum1 * 2 && (a.length - idx - 1 ) < sum2 * 2\n\t\t\t## we have a leader\n\t\t\t#puts \"YEAH #{idx}\"\n\t\t\tret += 1\n\t\tend\n\t\t\t#puts \"-------- ret: #{ret}\"\n\tend\n\treturn ret\nend", "title": "" }, { "docid": "827aaf29a0370415c81910d49ac40e78", "score": "0.54699564", "text": "def icecreamParlor(m, arr)\n # Complete this function\n res = []\n arr.each_index do |i|\n if i + 1 !=nil\n j = i + 1\n while j <= arr.length - 1\n if arr[i]+arr[j] == m\n res.push([i+1,j+1])\n end\n j+=1\n end\n end\n end\n res\nend", "title": "" }, { "docid": "9a738af829ca139841357e00d5f7fb6e", "score": "0.5463934", "text": "def solution(x, a)\n count = 1\n indices = []\n while count <= x\n indices << a.find_index(count)\n count += 1\n end\n\n if indices.include?(nil)\n -1\n else\n indices.sort.last\n end\nend", "title": "" }, { "docid": "41f75539c5fbe842f767f150134d4d94", "score": "0.54583776", "text": "def isHappy? n\n acc = {}\n acc[n] = true\n begin\n sum = 0\n n.to_s.split(\"\").map {|i| sum += i.to_i**2}\n\n if sum == 1 then return true\n elsif acc.has_key?(sum) then return false\n else acc[sum] = true end\n\n n = sum\n end while sum != 1\nend", "title": "" }, { "docid": "b8247964d2fa40a4082efcb16de2f0a0", "score": "0.54583496", "text": "def day_2_part_2\n noun = 0\n verb = 0\n\n while noun < 100\n while verb < 100\n if compute(noun, verb) == 19690720\n return (100 * noun) + verb\n end\n verb += 1\n end\n noun += 1\n verb = 0\n end\nend", "title": "" }, { "docid": "79bfceca24283aeffbf11a0b94149103", "score": "0.54574513", "text": "def solution(a, b, k)\n # write your code in Ruby 2.2\n e = b / k\n s = (a-1) / k\n\n e - s\nend", "title": "" }, { "docid": "e401a0891e8f3ba4745500bd3b55e994", "score": "0.54572743", "text": "def luhns(a)\n\tb = a.to_s[0..-2].reverse.split(\"\").to_a.map{|v|v.to_i}\n\t(b.each_index{|i|i.even? ? b[i]=b[i]*2>9?b[i]*2-9:b[i]*2:i=i}.inject(:+)+a)%10==0\nend", "title": "" }, { "docid": "b42eb4465b169f1981dfe468aa02c55e", "score": "0.5450274", "text": "def problem3 n\n 2.step(n,1).each do |x|\n return x-1 if n == 1\n n /= x if x.prime? && (n % x == 0)\n end\nend", "title": "" }, { "docid": "e8880fe60869bc9668a8d99bd4ae3115", "score": "0.5449156", "text": "def solveProblem lst\n big = -1\n numbers = {}\n half = lst.length / 2\n lst.each do |i|\n if numbers.has_key?(i) then\n numbers[i] += 1\n else\n numbers[i] = 1\n end\n if numbers[i] > half then return i end\n end\n return big\nend", "title": "" }, { "docid": "f0bd974b3615b717ae12eb99b586ff24", "score": "0.5447019", "text": "def solution(digits)\n\tstop = digits.length - 4\n\tgo = 0\n\tlargest_number = 0\n\tindex = 0\n\n\twhile go < stop\n\t\ttest = \"\"\n\t\textra_index = index\n\t\t5.times do \n\t\t\ttest += digits[extra_index].to_s\n\t\t\textra_index += 1 \n\t\tend\n\t\tif test.to_i > largest_number\n\t\t\tlargest_number = test.to_i\n\t\tend \n\t\tindex += 1\n\t\tgo += 1 \n\tend \n\tlargest_number\nend", "title": "" }, { "docid": "fa19fb3e173b39905bda2a9921e42992", "score": "0.5443044", "text": "def solution(digits)\n result = 0\n digits.size.times do |n|\n new_number = digits[n...(n + 5)].to_i\n result = new_number if new_number > result\n end\n result\nend", "title": "" }, { "docid": "0762028bcd8c84b0f1a3316d736cc689", "score": "0.54396224", "text": "def joltageDiff(input)\n # add my input device with rating +3\n input.append(input.max + 3)\n arr = input\n .sort\n .reverse\n \n diffs = arr\n .map.with_index{ |n, i|\n if i < arr.size - 1\n n - arr[i+1]\n end\n }\n diffs.pop # remove last element\n # puts diffs.sort\n counts = [0, 0, 0]\n counts[0] = diffs.select{ |n| n == 1 }.size + 1 # fuck knows why this is here.. #dirtyhack\n counts[1] = diffs.select{ |n| n == 2 }.size\n counts[2] = diffs.select{ |n| n == 3 }.size\n #puts counts\n return counts\nend", "title": "" }, { "docid": "4eadcb8c3b80185bf247d37fca6ee635", "score": "0.5436694", "text": "def num_decodings(s)\n\n decode = ('A'..'Z').to_a\n number_of_prev_ended_singly = 1\n\n ways_count = 1\n number_of_prev_ended_singly = 1\n\n s.chars[1..-1].each_with_index do |ch, idx|\n if s[idx - 1].to_i == 1 ||\n s[idx - 1] == 2.to_i && ch.to_i.between?(1,6)\n\n numbers_added_this_time = ways_count - number_of_prev_ended_singly\n ways_count += numbers_added_this_time\n number_of_prev_ended_singly = numbers_added_this_time\n else\n number_of_prev_ended_singly = 0\n end\n end\n\n ways_count\n\nend", "title": "" }, { "docid": "2594d3e4e7be8008e4ee79d543bd825a", "score": "0.5435785", "text": "def solution(a)\n counter = Hash.new(0)\n a.each do |elem|\n counter[elem] += 1\n end\n\n (1..a.size).each do |number|\n return 0 if counter[number] != 1\n end\n\n 1\nend", "title": "" } ]
e7e74acea7f6fe862040b97105367a86
GET /propiedadclases GET /propiedadclases.json
[ { "docid": "5d679779499c584da19f332c35d0457e", "score": "0.6883725", "text": "def index\n @propiedadclases = Propiedadclase.all\n end", "title": "" } ]
[ { "docid": "ad5209f740e388c0d040f7c81f99ecbe", "score": "0.64184266", "text": "def show\n @palabras_clafe = PalabrasClave.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @palabras_clafe }\n end\n end", "title": "" }, { "docid": "7f48fc79095de417bb92bd3fc37081ce", "score": "0.6215472", "text": "def index\n @projetos = Projeto.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @projetos }\n end\n end", "title": "" }, { "docid": "195158c19e2be2ef28e861392532bf26", "score": "0.61903334", "text": "def index\n @propuestas = Propuesta.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @propuestas }\n end\n end", "title": "" }, { "docid": "9ad287e88f031e4e5ff06ca1a0689836", "score": "0.61887175", "text": "def get\n @cine = Cine.find(params[:cine_id], :select => [\"nombre\",\"id\",\"direccion\",\"localidad\"])\n render :json => [ @cine, :peliculas => @cine.peliculas.select('titulo,horas,pelicula_id') ]\n end", "title": "" }, { "docid": "68e04d7d92616c108373e8a86578fed7", "score": "0.6119236", "text": "def index\n if params[:propietario]\n @usuario = Usuario.find(params[:usuario_id])\n authorize! :show, @usuario\n @negocios_propios = Usuario.find(params[:usuario_id]).negocios_propios\n render json: @negocios_propios,\n root: 'negocios_propios',\n each_serializer: NegocioPropioSerializer\n else\n @negocios = Negocio.all\n render json: @negocios\n end\n end", "title": "" }, { "docid": "8238df8faba2f4f3dc81dae271feb719", "score": "0.6117793", "text": "def show\n @clasificacion_pegi = ClasificacionPegi.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clasificacion_pegi }\n end\n end", "title": "" }, { "docid": "689075b83d54232708b2322ca8030876", "score": "0.61159617", "text": "def show\n \n @protectora = Protectora.find(params[:id])\n @nombreProtectora = Protectora.find(params[:id]).nombre\n @mis_mascotas = Mascotum.find(:all, :conditions => {:protectora => @nombreProtectora})\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @protectora }\n end\n end", "title": "" }, { "docid": "966a374d8827e0437fc51ace7d406bd1", "score": "0.6058216", "text": "def index\n @conseilles = Conseille.all\n respond_to do |format|\n format.html\n format.json { render json: @conseilles}\n end\n end", "title": "" }, { "docid": "ec774a71aed3880e4366ad551b9b262d", "score": "0.6053092", "text": "def index\n @copropietarios = Copropietario.all\n end", "title": "" }, { "docid": "6db3b1a644d1c2dc7bf6cd838df50eea", "score": "0.6038744", "text": "def new\n @palabras_clafe = PalabrasClave.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @palabras_clafe }\n end\n end", "title": "" }, { "docid": "b0258d91f39ca7f87edb7f3d121f3ae2", "score": "0.60248405", "text": "def show\n @produccion = Produccion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produccion }\n end\n end", "title": "" }, { "docid": "b0258d91f39ca7f87edb7f3d121f3ae2", "score": "0.60248405", "text": "def show\n @produccion = Produccion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produccion }\n end\n end", "title": "" }, { "docid": "c27fa0288a5d23a490a9cd96266a3660", "score": "0.60204434", "text": "def index\n @colegios = Colegio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @colegios }\n end\n end", "title": "" }, { "docid": "ae981b5f8c44bf9c0a4fa7b141087964", "score": "0.5994281", "text": "def create\n @clase = Clase.new(clase_params)\n\n respond_to do |format|\n if @clase.save\n format.html { redirect_to @clase, notice: 'La Clase fue creada exitosamente.' }\n format.json { render :show, status: :created, location: @clase }\n else\n @partidas_parciales = PartidaParcial.all\n format.html { render :new }\n format.json { render json: @clase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "38ea5232829ef5f823ac303ce03d1b11", "score": "0.59887797", "text": "def show\n \n @lancamentorapido = Lancamentorapido.find(params[:id])\n \n @categorias = Category.all\n @centrosdecusto = Centrodecusto.all\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @lancamentorapido }\n end\n end", "title": "" }, { "docid": "f27fc4adf9236228504b1eedbd122c42", "score": "0.59615886", "text": "def index\n @patrocinios = Patrocinio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @patrocinios }\n end\n end", "title": "" }, { "docid": "de956c7156ce6a7ad46fb0033eaac853", "score": "0.5948355", "text": "def index\n @pacientes = Pacientes.all\n render json: @pacientes\n end", "title": "" }, { "docid": "79ec36ac425286888bc7ac5ff1ed2bc6", "score": "0.5943695", "text": "def index\n @concursos = Concurso.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @concursos }\n end\n end", "title": "" }, { "docid": "15faee75462472a862b70ec32821bf65", "score": "0.5929472", "text": "def show\n @partecipanti_gruppo = PartecipantiGruppo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @partecipanti_gruppo }\n end\n end", "title": "" }, { "docid": "ba5ad329ed0829d234626e8e12ec439f", "score": "0.5910165", "text": "def index\n @proyects = Proyect.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @proyects }\n end\n end", "title": "" }, { "docid": "bbdd4c9fb227e11b3fbf2049dd5a688b", "score": "0.5905565", "text": "def index\n @prueba_jsons = PruebaJson.all\n end", "title": "" }, { "docid": "bb60b10ab032ec1c3503a677cad0a629", "score": "0.59043795", "text": "def show\n @clasp = Clasp.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @clasp }\n end\n end", "title": "" }, { "docid": "cbcf58d77b86de81476fba610e4cff61", "score": "0.5903819", "text": "def index\n @proyecto_carreras = ProyectoCarrera.all\n end", "title": "" }, { "docid": "14155319416173e7f7d6449b5be55804", "score": "0.5902016", "text": "def index\n @cursos = Curso.all_active\n @curso = Curso.new\n @programas = Programa.all_active\n \n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @cursos }\n end\n end", "title": "" }, { "docid": "a1332448602bb0dbe26b90ab994b2748", "score": "0.5891197", "text": "def get_modelos\n marca = Marca.find(params[:marca_id])\n @modelos = Modelo.of_marca(marca.id)\n\n render json: @modelos\n\n end", "title": "" }, { "docid": "80268df61ddae1034a5ebbe667adcbae", "score": "0.58870906", "text": "def propiedadclase_params\n params.require(:propiedadclase).permit(:propiedad_id, :clase_id)\n end", "title": "" }, { "docid": "dfdde0858e16e5238314d38aa549ed02", "score": "0.5882221", "text": "def get_forms\n @course = Course.find(params[:course_id])\n @forms = @course.professor_forms\n render json: @forms\n end", "title": "" }, { "docid": "2ac8b273f57c5537505b78220e6a2bb0", "score": "0.58574015", "text": "def index\n @proyectos = Proyecto.all\n end", "title": "" }, { "docid": "2ac8b273f57c5537505b78220e6a2bb0", "score": "0.58574015", "text": "def index\n @proyectos = Proyecto.all\n end", "title": "" }, { "docid": "2ac8b273f57c5537505b78220e6a2bb0", "score": "0.58574015", "text": "def index\n @proyectos = Proyecto.all\n end", "title": "" }, { "docid": "2ac8b273f57c5537505b78220e6a2bb0", "score": "0.58574015", "text": "def index\n @proyectos = Proyecto.all\n end", "title": "" }, { "docid": "695953e6ea1b148b8ddfe084f4ff3f90", "score": "0.58559906", "text": "def show\n @propuesta = Propuesta.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render :json => @propuesta }\n end\n end", "title": "" }, { "docid": "b0ba38dea3ddf0173c8dcb24267bca8f", "score": "0.58534473", "text": "def index\n @protectoras = Protectora.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @protectoras }\n end\n end", "title": "" }, { "docid": "17671fc95bad9d6fd35063da1221fc4f", "score": "0.5849485", "text": "def index\n \tif current_user && current_user.username.eql?(\"admin\")\n @courses = Course.all\n elsif current_user\n\t @lista = Profesor.joins(:course).where(:user_id => session[:user_id])\t\n\t list = Array.new\n\t @lista.each do |l|\n\t \tlist << l.course_id\n end\n\t @courses = Course.find(list)\n\tend\n\t\t\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json=> @courses }\n end\n end", "title": "" }, { "docid": "ec2bfc6d3c27703d9f81ee7affdeae76", "score": "0.58453614", "text": "def index\n @patron_clases = PatronClase.all\n end", "title": "" }, { "docid": "d10f9daba7a7d92ee0d75ddaa3013cb3", "score": "0.58309484", "text": "def show\n @concurso = Concurso.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concurso }\n end\n end", "title": "" }, { "docid": "99d8efeadccadf05f120bb8f55da2d0a", "score": "0.58303404", "text": "def index\n @usuarios = Usuario.por_colegio(colegio.id).order(\"nombre\")\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @usuarios }\n end\n end", "title": "" }, { "docid": "61ad40708ba4051f482c14b569a58e48", "score": "0.58121467", "text": "def index\n \treclamos = Reclamo.all\n \trender json: reclamos.to_json(include: [:tipo_reclamo, :ubicacion, :user], methods: [:valoracion])\n end", "title": "" }, { "docid": "4eb087fdabe658815fa2b082e8760b6f", "score": "0.5795608", "text": "def destroy\n @propiedadclase.destroy\n respond_to do |format|\n format.html { redirect_to propiedadclases_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cf89c2f9861e230239acff8f67c9bafb", "score": "0.57903236", "text": "def courses\n @courses = Course.where(faculty_id: params[:faculty_id]).order(:name)\n respond_to do |format|\n format.json { render json: @courses }\n end\n end", "title": "" }, { "docid": "39519da370dbbb79be7df588d59b909f", "score": "0.5785433", "text": "def index\n @premios = Premio.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @premios }\n end\n end", "title": "" }, { "docid": "91b2cb270321409d36fcebc0ad9bede5", "score": "0.57849115", "text": "def show\n @concour = Concour.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @concour }\n end\n end", "title": "" }, { "docid": "f138a9f4f0be30ad5f404b171a8b11d2", "score": "0.5755092", "text": "def index\n @campanhas = Campanha.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @campanhas }\n end\n end", "title": "" }, { "docid": "8f765f972fe1fdd4cacdae2c3ee2c228", "score": "0.57500774", "text": "def show\n @competency_pertenece_asignatura = CompetencyPerteneceAsignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competency_pertenece_asignatura }\n end\n end", "title": "" }, { "docid": "47df5ece2b6fd0e36d16657277c4048a", "score": "0.57479596", "text": "def index\n @clases = Clase.joins(:partida_parcial => [:partida_principal]).where(\"clases.fecha_de_baja IS NULL\").order(\"partidas_principales.codigo\").order(\"partidas_parciales.codigo\").order(\"clases.codigo\").paginate(:page => params[:page], :per_page => 30)\n end", "title": "" }, { "docid": "efea37140101666ee7f267cffefa1355", "score": "0.5734282", "text": "def show\n @perfilnegocio = Perfilnegocio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @perfilnegocio }\n end\n end", "title": "" }, { "docid": "56ac7bf56d0e8dfc79a4ba9214c3969c", "score": "0.5732549", "text": "def new\n @congreso = Congreso.new\n @campos = Campo.all\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @congreso }\n end\n end", "title": "" }, { "docid": "36469a8241a6224e5623dae6981c3659", "score": "0.5730498", "text": "def set_propiedadclase\n @propiedadclase = Propiedadclase.find(params[:id])\n end", "title": "" }, { "docid": "0d8d1ac9747e7fc863b6b049e370a0a7", "score": "0.5725031", "text": "def show\n @coligacao_partido = ColigacaoPartido.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @coligacao_partido }\n end\n end", "title": "" }, { "docid": "9af5b1061d4491218358eb9be5ea4fa8", "score": "0.5721633", "text": "def index\n @contas = Conta.all\n respond_to do |format|\n format.json { render json: @contas.to_json, status: :ok }\n end\n end", "title": "" }, { "docid": "a96948f1221b42c9334fb9a2cd16f7f1", "score": "0.5717458", "text": "def show\n @combinacion = Combinacion.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @combinacion }\n end\n end", "title": "" }, { "docid": "87130ea02f027f8a9a549b01dfb20432", "score": "0.57162255", "text": "def index \n @lancamentorapido = Lancamentorapido.new \n @lancamentorapidos = Lancamentorapido.all\n \n @categorias = Category.all\n @centrosdecusto = Centrodecusto.all \n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lancamentorapidos }\n end\n end", "title": "" }, { "docid": "d2eae6acec46fbd88ea336143845b09c", "score": "0.57117575", "text": "def index\n if params[:categoria_producto]\n render json: Producto.find(params[:producto_id]).categorias\n else\n\t\t @categorias = Categoria.all\n render json: @categorias\n end\n\tend", "title": "" }, { "docid": "c944fc31b17764f0538d90ccfa54b53a", "score": "0.57087463", "text": "def new\n @clasificacion_pegi = ClasificacionPegi.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @clasificacion_pegi }\n end\n end", "title": "" }, { "docid": "1cd5dfafdbefd1dfa40eaa4853204598", "score": "0.57085484", "text": "def show\n @respuesta = Respuesta.find(params[:id])\n\n render json: @respuesta\n end", "title": "" }, { "docid": "014f9207e0f58a63a55c5ac50ab83b92", "score": "0.5708038", "text": "def show\n @colegio = Colegio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @colegio }\n end\n end", "title": "" }, { "docid": "3409f3d5d11d439e440339e23cb79c48", "score": "0.5705967", "text": "def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n # format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end", "title": "" }, { "docid": "d4f5e3d9580bce75ce5f184c1109dde8", "score": "0.569712", "text": "def index\n @cooperativas = Cooperativa.where(:status_id => Status.find_by_descricao('Ativo'))\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render :json => @cooperativas }\n end\n end", "title": "" }, { "docid": "59e93f83d339e7f7b9ee9624dadf02d2", "score": "0.5695572", "text": "def show\n @caballo = Caballo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @caballo }\n end\n end", "title": "" }, { "docid": "6beeec43a5fb1f7048f01314f41ef8cd", "score": "0.5692706", "text": "def producirPrimasSkuYCantidad\n sku = params[:id].to_s\n cantidad_lotes = params[:cantidad].to_i\n render json: ProducirMateriasPrimas.new.producirCantidad(sku, cantidad_lotes)\nend", "title": "" }, { "docid": "541a581ebabc1e7236502fdccdcf4a8b", "score": "0.569083", "text": "def show\n @profesor_pertenece_asignatura = ProfesorPerteneceAsignatura.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @profesor_pertenece_asignatura }\n end\n end", "title": "" }, { "docid": "6479e76802f0d98bfb36292fe2a6a435", "score": "0.56826824", "text": "def index\n @proyecto_patrocinadors = ProyectoPatrocinador.all\n end", "title": "" }, { "docid": "b79e0ce6ecc2a523588672b990047789", "score": "0.56783104", "text": "def show\n @pessoa = Pessoa.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @pessoa }\n end\n end", "title": "" }, { "docid": "2f0e48cd280bebedafcc1202c585653c", "score": "0.56769335", "text": "def index\n @grupoassuntos = Grupoassunto.all\n\n render json: @grupoassuntos\n end", "title": "" }, { "docid": "e73455418e8af2bbe8aed0d13ec378e6", "score": "0.5675029", "text": "def new\n @produccion = Produccion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @produccion }\n end\n end", "title": "" }, { "docid": "113c0969d1dade8f6e788aae57f4cd76", "score": "0.5674833", "text": "def index\n @palestrantes = Palestrante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @palestrantes }\n end\n end", "title": "" }, { "docid": "3ca604c092fdc8952e08fa129e639cbe", "score": "0.56748265", "text": "def index\n @courses = Course.all\n render json: @courses, status: :ok\n end", "title": "" }, { "docid": "e73455418e8af2bbe8aed0d13ec378e6", "score": "0.56733066", "text": "def new\n @produccion = Produccion.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @produccion }\n end\n end", "title": "" }, { "docid": "6ca6bab3c9f8a6323d9f9ec5c018f9fa", "score": "0.5671525", "text": "def index\n @proprietarios = Proprietario.all\n end", "title": "" }, { "docid": "8f703056661e643ead8fc50acf3ab948", "score": "0.5669468", "text": "def index\n @comprobantes = Comprobante.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @comprobantes }\n end\n end", "title": "" }, { "docid": "87667e98bbad7446011a232d25ee3e09", "score": "0.5666254", "text": "def show\n @contato_produto = ContatoProduto.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @contato_produto }\n end\n end", "title": "" }, { "docid": "4149ec8067e8f71aaa93215d3a06672a", "score": "0.56654894", "text": "def new\n @projeto = Projeto.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @projeto }\n end\n end", "title": "" }, { "docid": "52aa6e9430985c1e85858051dbd247e7", "score": "0.5663439", "text": "def show\n @puntaje = Puntaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @puntaje }\n end\n end", "title": "" }, { "docid": "52aa6e9430985c1e85858051dbd247e7", "score": "0.5663439", "text": "def show\n @puntaje = Puntaje.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @puntaje }\n end\n end", "title": "" }, { "docid": "29838b13b2fb512d2a0fcfb559ac8e0d", "score": "0.56634027", "text": "def index\n @courts = Court.page(params[:page])\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courts }\n end\n end", "title": "" }, { "docid": "a0f4d41a4643e66f4d9d3ab4be2bef76", "score": "0.5660684", "text": "def show\n @produkt = Produkt.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @produkt }\n end\n end", "title": "" }, { "docid": "d5b44b9280f0d04587f317afd6beb1e5", "score": "0.56571203", "text": "def new\n @placa_casa = PlacaCasa.new\n # @placa = Placa.new\n # @pessoa = Pessoa.new\n\n @pessoas = Pessoa.find(:all).map { |u| [u.nome + ' - ' + u.cpf + ';'] }.uniq\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @placa_casa }\n end\n end", "title": "" }, { "docid": "1f19f684fb6ad23ffbbc07912dbfd463", "score": "0.5647841", "text": "def show\n @comentario = Comentario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comentario }\n end\n end", "title": "" }, { "docid": "1f19f684fb6ad23ffbbc07912dbfd463", "score": "0.5647841", "text": "def show\n @comentario = Comentario.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @comentario }\n end\n end", "title": "" }, { "docid": "c4db800525df65fa0eb28db2857ac756", "score": "0.5646852", "text": "def index\n @proyectos = Proyecto.search.page params[:page]\n end", "title": "" }, { "docid": "3a5f98f4ba95dfb38a95d2b83242b2e0", "score": "0.56451243", "text": "def index\n @curiosidades_japons = CuriosidadesJapon.all\n end", "title": "" }, { "docid": "869d6a8d4dfeb21c68b36d5535d676b0", "score": "0.5640603", "text": "def index\n @precio_paquetes = PrecioPaquete.all\n end", "title": "" }, { "docid": "c42ad8af3b682752a3695451fd942cb7", "score": "0.56404513", "text": "def show\n @cuerpo = Cuerpo.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @cuerpo }\n end\n end", "title": "" }, { "docid": "fe06b60c6eff55a8c8a4e2796186b749", "score": "0.56399167", "text": "def show\n @capacidad = Capacidad.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @capacidad }\n end\n end", "title": "" }, { "docid": "2795a913818efd74cf11153121f22fcc", "score": "0.56392395", "text": "def index\n seleccionarMenu(:juzgados)\n @juzgados = Juzgado.order(:ciudad_id)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @juzgados }\n end\n end", "title": "" }, { "docid": "82a224e47b66ad72d8857f6867f61421", "score": "0.56355214", "text": "def index\n professors = Professor.includes(:courses).all\n\n render json: professors.to_json(include: :courses)\n end", "title": "" }, { "docid": "ad594a9a64bae9b482843701b4630529", "score": "0.5634573", "text": "def show\n @competicao = Competicao.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @competicao }\n end\n end", "title": "" }, { "docid": "0b28aa90756482a8ee3f23831d876d40", "score": "0.56336236", "text": "def show\n @tipo_pregunta = TipoPregunta.find(params[:id])\n\n render json: @tipo_pregunta\n end", "title": "" }, { "docid": "998e533dd06903a05982b7026d126e94", "score": "0.5633024", "text": "def index\n @courts = Court.by_name\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @courts }\n end\n end", "title": "" }, { "docid": "a52b4fcad034a2c668a81a55ca33f7fb", "score": "0.56319696", "text": "def new\n @propuesta = Propuesta.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render :json => @propuesta }\n end\n end", "title": "" }, { "docid": "212fbc550c9ea112aa2b854ea7779ce7", "score": "0.56274086", "text": "def create\n @propiedadclase = Propiedadclase.new(propiedadclase_params)\n\n respond_to do |format|\n if @propiedadclase.save\n format.html { redirect_to @propiedadclase, notice: 'Propiedadclase was successfully created.' }\n format.json { render action: 'show', status: :created, location: @propiedadclase }\n else\n format.html { render action: 'new' }\n format.json { render json: @propiedadclase.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7d498f613d0a353e0b99da811254633a", "score": "0.56268936", "text": "def index\n @propuestas = Propuesta.all\n end", "title": "" }, { "docid": "14bab7d17cacb2a4e39e7225ec7ef1bc", "score": "0.5626317", "text": "def index\n @disciplines = Discipline.all\n\n render json: @disciplines\n end", "title": "" }, { "docid": "4eba4748b5bca38d21f76432cfa41586", "score": "0.5617995", "text": "def show\n @projeto = Projeto.find(params[:id])\n @enrollments = Enroll.find_all_by_projeto_id params[:id]\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @projeto }\n end\n end", "title": "" }, { "docid": "dfb72f8d35b995f26b9db63e681ced73", "score": "0.56142575", "text": "def show\n @patrocinio = Patrocinio.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @patrocinio }\n end\n end", "title": "" }, { "docid": "5d246d9e8b6d9df271584a77d98ee821", "score": "0.56123465", "text": "def show\n pessoa = Pessoa.find(params[:id])\n render json: {status: 'SUCCESS', message:'Loaded pessoa', data:pessoa},status: :ok\n end", "title": "" }, { "docid": "e4b582449ca0b27f7dc550918241b10c", "score": "0.5610308", "text": "def index\n @propuesta = Propuestum.all\n end", "title": "" }, { "docid": "e125d8d32c253553ff7308eca8977900", "score": "0.55978334", "text": "def index\n @prodorcarealizados = Prodorcarealizado.all\n end", "title": "" }, { "docid": "a1229573cba27825cf2da3fe4d35725d", "score": "0.55935925", "text": "def activo\n @produccion.activo\n respond_to do |format|\n format.html { redirect_to produccions_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "566016e0bad8e0b426274cb60e64b3a8", "score": "0.5588481", "text": "def index\n @usuario_projetos = UsuarioProjeto.all\n end", "title": "" } ]
a260bebbdaddaf76c1e263856459939e
gets the user and mission from the user session if they're not already set
[ { "docid": "c748427b506c5996aa6fd204368536f1", "score": "0.79717696", "text": "def get_user_and_mission\n\n # don't do this for XML requests\n return if request.format == Mime::XML\n\n # get the current user session from authlogic\n user_session = UserSession.find\n user = user_session.nil? ? nil : user_session.user\n unless user.nil?\n\n # look up the current user from the user session\n # we use a find call to the User class so that we can do eager loading\n @current_user = User.includes(:assignments).find(user.id)\n\n # if we're in admin mode, the current mission is nil and we need to set the user's current mission to nil also\n if admin_mode?\n @current_mission = nil\n @current_user.change_mission!(nil)\n else\n # look up the current mission based on the current user\n @current_mission = @current_user ? @current_user.current_mission : nil\n\n # save the current mission in the session so we can remember it if the user goes into admin mode\n session[:last_mission_id] = @current_mission.try(:id)\n end\n end\n end", "title": "" } ]
[ { "docid": "d0fdfcc41fc21f258f3e865e55e2722b", "score": "0.651333", "text": "def get_user_to_act_on\n @user = session[:user]\n end", "title": "" }, { "docid": "9f60d52e8adcb969ea1aec48c2ca099c", "score": "0.65019053", "text": "def current_user\n \tif session[:status] == \"3\"\n @current_user ||= Student.find_by(id: session[:student_id])\n elsif session[:status] == \"2\" || session[:status] == \"1\"\n @current_user ||= Teacher.find_by(id: session[:teacher_id])\n\n else\n end\n end", "title": "" }, { "docid": "a10e293958f9e2d923d6556349c0a253", "score": "0.64781576", "text": "def fetch_user\n # Check if session[:user_id] is set, and also make sure the #ID it contains is a vlaid isr ID - if so set an instande #variable containing the usr objest . by settin that #variable here it will be available to any action inside any #controller\n\n if session[:user_id].present?\n @current_user = User.find_by id: session[:user_id]\n end\n\n session[:user_id] = nil unless @current_user.present?\n\n end", "title": "" }, { "docid": "4cd683ead75903a82a2fd7bd7dd88958", "score": "0.62587595", "text": "def load_user_info\n if current_user\n session[:area_code] ||= current_user.phone_numbers.first.area_code.to_s\n session[:phone_number] ||= current_user.phone_numbers.first.phone_number.to_s\n session[:billing_period] ||= Date.today.beginning_of_month.to_s\n session[:full_phone_number] ||= [session[:area_code],session[:phone_number]].join(' ')\n end\n end", "title": "" }, { "docid": "cf1c5a31e260b75002ce71317980d697", "score": "0.62453127", "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": "b404b49f1e644af79d6b37d1d50df78d", "score": "0.62365097", "text": "def get_user\n if user_check_present?\n if sharing_with_me?\n @shared_user = sharing_with_me?.presence\n else\n redirect_to appointments_path, notice: 'Usuário não compartilhado!'\n end\n else\n current_user\n end\n end", "title": "" }, { "docid": "9b6a2975bb44e0ff04f89151893f0cf2", "score": "0.61971617", "text": "def load_session\n unless logged_in?\n session[Shibbolite.pid] = request.env[Shibbolite.pid.to_s]\n current_user.update(get_attributes) if registered_user?\n end\n end", "title": "" }, { "docid": "bc32243e99171029157a2143777c84eb", "score": "0.6196301", "text": "def current_user\n @current_user||=User.find_by id: session[\"user_id\"] if session[\"user_id\"]\nend", "title": "" }, { "docid": "c905e9530eed7891d93d12ac1a70fe27", "score": "0.61740243", "text": "def user\n session[:user]\n end", "title": "" }, { "docid": "da466eff4e1260dae2ad8df0eb811e7c", "score": "0.61632764", "text": "def user \n @user ||= session[:user_id] && User.find(session[:user_id]) \n end", "title": "" }, { "docid": "ef2441dbc5a69df98f00fac89cd80fce", "score": "0.61623085", "text": "def get_current_user\n unless @situation.blank? || @situation.case.blank?\n @situation.case.user\n else\n nil\n end\n end", "title": "" }, { "docid": "8b7a0fdd592b73d6d0f514df7ab60a08", "score": "0.6142237", "text": "def session_user\n case\n when session[:user_id].present?\n User.find_by_id(session[:user_id])\n when live_location.present?\n LiveLocationUser.new(live_location)\n end\n end", "title": "" }, { "docid": "321efccf3d66acba667a31cd93cc1319", "score": "0.6141066", "text": "def post_login_housekeeping\n # get the session\n @user_session = UserSession.find\n\n # reset the perishable token for security's sake\n @user_session.user.reset_perishable_token!\n\n # pick a mission\n @user_session.user.set_current_mission\n\n # if no mission, error\n if @user_session.user.current_mission.nil? && !@user_session.user.admin?\n flash[:error] = t(\"activerecord.errors.models.user.no_missions\")\n @user_session.destroy\n redirect_to(login_url)\n return false\n end\n\n return true\n end", "title": "" }, { "docid": "1284fae5f10d1a8523b15c8da099be84", "score": "0.6137403", "text": "def user\n self.session&.user\n end", "title": "" }, { "docid": "65bffb072e740d2d60923ee8e729b238", "score": "0.6120473", "text": "def current_user \n\t\t@current_user ||= User.find_by(room_code: session[:room_code])\n\tend", "title": "" }, { "docid": "15a576b5bd85e9a15b04982f5e27149f", "score": "0.6104462", "text": "def current_user\n session[:user_id] ? User.get(session[:user_id]) : nil\nend", "title": "" }, { "docid": "b18e32047d626fc52a3251704265991b", "score": "0.6089286", "text": "def current_user\n\nreturn nil if !session[:auth] || !session[:auth]['id']\n\nreturn @_users if @_users\n\n@_users = User.find_by_id(session[:auth]['id'])\n\nend", "title": "" }, { "docid": "688d49b729444da25c90bb44a08e86ad", "score": "0.60694313", "text": "def current_user\n if session[:user_id]\n @current_user ||= User.find_by(id: session[:user_id]) end\nend", "title": "" }, { "docid": "28db220d959a3ee0f206c938af9aff1c", "score": "0.6061048", "text": "def current_flow_user_data\n current_flow_data.fetch session_user_data_name\n end", "title": "" }, { "docid": "28db220d959a3ee0f206c938af9aff1c", "score": "0.6061048", "text": "def current_flow_user_data\n current_flow_data.fetch session_user_data_name\n end", "title": "" }, { "docid": "0beb7dbe8c530acaa5b67648f002a49f", "score": "0.6055246", "text": "def current_user()\n \tp \"data is: #{params[:content]}\"\n if params[:session][:id]\n User.find(params[:session][:id])\n else\n p \"ERROR! session[:id] not currently defined. No current signed in user.\"\n return nil\n end\n \n end", "title": "" }, { "docid": "cb9d86849ab03fa9c0eed3fd92d1c8c2", "score": "0.60457927", "text": "def current_user\n if session[:user_id].present?\n @current_user= User.find(session[:user_id])\n else\n @current_user= nil\n\n end\nend", "title": "" }, { "docid": "eea758daf8d2d7d02b96064f8c3b3f70", "score": "0.6036343", "text": "def current_user\n if !session[:admin_id].nil? #administrador\n @current_user ||= Administrador.find_by(id: session[:admin_id])\n elsif !session[:arren_id].nil? #es arrendatario\n @current_user ||= Arrendatario.find_by(id: session[:arren_id]) \n end\n \n end", "title": "" }, { "docid": "52cc97e686757365973a44f09f8b997d", "score": "0.6026511", "text": "def load_current_user\n the_id = session[:user_id]\n @current_user = User.where({ :id => the_id }).first\n end", "title": "" }, { "docid": "d378e60c54326f3c2ecffc03f05cf28a", "score": "0.6020377", "text": "def user\n @user = Game.current_user\nend", "title": "" }, { "docid": "4c357a33dac8005eaa0d3b95d8dbf4e6", "score": "0.60175514", "text": "def current_user\n @current_user||= User.find(session[:user_id]) if session[:user_id] #lo que hace es que evita que se tenga que hacer una consulata de la base de datos cada vez que se efectue este metodo \n end", "title": "" }, { "docid": "228d4ec24be9bbc77ddee8a475a20382", "score": "0.601651", "text": "def get_user\n return self.user if self.user\n if ipi = self.ipi\n return ipi.user\n end\n end", "title": "" }, { "docid": "aff8d643ba2dd61527438dd3c2027a5d", "score": "0.60153496", "text": "def current_user\n _user = nil \n case session[:login_type]\n when \"P\"\n _user = Patient.find(session[:user_id]) rescue nil\n when \"D\"\n _user = Driver.find(session[:user_id]) rescue nil\n when \"A\"\n _user = Admin.find(session[:user_id]) rescue nil\n else\n _user = nil\n end\n end", "title": "" }, { "docid": "703fb235a12785410f7151c5f43da014", "score": "0.6012711", "text": "def find_user\n if !current_user.nil?\n @user=User.find(current_user.id)\n @all_user=Tracker.find_all_user(@user)\n @[email protected]\n session[:admin_id][email protected]\n elsif !current_member.nil?\n @user=Member.find(current_member.id)\n @all_user=Tracker.find_all_user1(@user)\n @[email protected]_id\n session[:admin_id][email protected]_id\n end\n end", "title": "" }, { "docid": "14f4cc6436cd2c92f61cf0c06bddea91", "score": "0.60076046", "text": "def current_user_data\n\t\t@current_user ||= User.find_by(id: session[:user_id])\n\tend", "title": "" }, { "docid": "627f9f619fe93d16559a16f00a151c4a", "score": "0.6006628", "text": "def current_user\n @user ||= User.find(session[:user_id]) if session[:user_id]\nend", "title": "" }, { "docid": "0840e760c840cd1c9067fe5cb7a3d480", "score": "0.6004405", "text": "def get_user\n if (session[:user_id].nil?)\n else\n @user = User.find(session[:user_id])\n end\n end", "title": "" }, { "docid": "0840e760c840cd1c9067fe5cb7a3d480", "score": "0.6004405", "text": "def get_user\n if (session[:user_id].nil?)\n else\n @user = User.find(session[:user_id])\n end\n end", "title": "" }, { "docid": "0840e760c840cd1c9067fe5cb7a3d480", "score": "0.6004405", "text": "def get_user\n if (session[:user_id].nil?)\n else\n @user = User.find(session[:user_id])\n end\n end", "title": "" }, { "docid": "245f35ecb64224a36a2942a5d9eb7011", "score": "0.60014236", "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": "dd33e709a19c22c4e4cbc63dbb1b49b6", "score": "0.5999864", "text": "def user_from_session\n self.current_user = User.find(session[:user]) if session[:user]\n end", "title": "" }, { "docid": "0ec6222c3269c4e6c9cd977e7bbbf144", "score": "0.5997932", "text": "def current_user\n @current_user ||= User.find_by(id: session[:user_id]) unless session[:user_id].blank? || User.find_by(id: session[:user_id]).blank?\n #won't set user unless there is a session id or a user id\n\n # if @current_user.blank? && !session[:user_id].blank?\n # @current_user = User.find(session[:user_id])\n # end\n #\n # return @current_user\nend", "title": "" }, { "docid": "4dfb7a3c014082005a829e2421c15255", "score": "0.5992245", "text": "def user\n @u if logged_in?\n end", "title": "" }, { "docid": "1a3fd33b17186c4c6f07b1497720bd67", "score": "0.5989031", "text": "def current_user\n #memorization @current_user if user_id is present is in current_user otherwise it will add the user_id in current_user\n @current_user || @current_user = User.find(session[:user_id]) if session[:user_id] \n end", "title": "" }, { "docid": "e234afc67e30f83f02676f2332a7af1f", "score": "0.5983127", "text": "def get_current_user\n # puts \"\\n******* get_current_user *******\"\n if session[:user_id]\n return User.find(session[:user_id])\n else\n puts \"** NO CURRENT USER **\"\n end\nend", "title": "" }, { "docid": "d5c372a29f813af1f43860541bf894e5", "score": "0.5981512", "text": "def current_user ##function to set the current user\n if session[:id] ##this will be true if a user has logged in\n @current_user ||= User.find(session[:id]) ##if the \"current_user\" object is empty, it will create one for the logged in user, otherwise it will leave it\n end\n end", "title": "" }, { "docid": "b10685d3d3c9ee00ed190f7d25f639db", "score": "0.59802824", "text": "def update_prerequisites\r\n @user = User.find session[:user]\r\n end", "title": "" }, { "docid": "a15bbdaeee6041c4420bbfa47dfed72a", "score": "0.59796584", "text": "def current_user\n #global variable current user or use find them by current session with user id\n @current_user ||= User.find_by(id: session[:user_id])\n @current_user\n end", "title": "" }, { "docid": "333276ae705c027ac8615f23fd687e38", "score": "0.59724104", "text": "def load_current_user_and_person\n if logged_in?\n @user = User.current_user = self.current_user\n @person = @user.person\n end\n end", "title": "" }, { "docid": "a79588526d5ba0571f7e3dc3ab845bb4", "score": "0.5965862", "text": "def current_user\n @current_user = @current_user|| User.find_by(email: session[:user_id]) ||Instructor.find_by(email: session[:user_id])\n\n end", "title": "" }, { "docid": "ba4738b88b47cdabdaaee902e0496797", "score": "0.59570485", "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": "676a30bcb9ca6b45997336bd46dae957", "score": "0.5952171", "text": "def current_user\n @current_user ||= User.find_by(id: session[:user_id]) #It is either user_id or its nil\n end", "title": "" }, { "docid": "b88fe4020aea129f701d136b206e534f", "score": "0.5948684", "text": "def current_user\n @current_user =\"\";\n if (session[:user_id])\n @current_user = User.new\n @current_user.id = session[:user_id]\n @current_user.role = session[:role]\n @current_user.email = session[:email]\n @current_user.company_id = session[:company_id]\n else\n @current_user = false;\n end\n end", "title": "" }, { "docid": "cf83ab851d766977d1e60f25141db2de", "score": "0.59415704", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id].present?\nend", "title": "" }, { "docid": "88b6cbf99365ffad8e14132a831fbb6e", "score": "0.5940046", "text": "def current_user\n \t if session[:user_id].present?\n \t \tUser.find(session[:user_id])\n \t end\n end", "title": "" }, { "docid": "453da5ea3da4a19cc7b7a951055b530c", "score": "0.59388787", "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": "2d5231321c912bd1035ed41800058b7b", "score": "0.59383446", "text": "def update\n super\n session[\"current_role\"] = current_user.default_role if current_user\n session[\"current_group\"] = current_user.default_group if current_user\n session[\"current_participant\"] = current_user.default_participant if current_user\n end", "title": "" }, { "docid": "9f31de8e8f3a062d4ec8bfc3c0af832b", "score": "0.59323555", "text": "def get_current_user\n User.find(session[:user_id])\n end", "title": "" }, { "docid": "083a3d4921f921d658b441fe3ba31cac", "score": "0.59307474", "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": "d410d4da081f44aca52a21a0a2080a8a", "score": "0.59306616", "text": "def current_user\nreturn unless session[:user_id]\n@current_user ||= User.find_by_id(session[:user_id])\nend", "title": "" }, { "docid": "a4ee2b3fc821804039e402aeeaf62925", "score": "0.5918572", "text": "def session_auth=(user); end", "title": "" }, { "docid": "b050d5dd2484cc70f3db9c8d3f274d4e", "score": "0.5917253", "text": "def current_user\n if session[:user] then\n session[:user]\n else\n nil\n end\n end", "title": "" }, { "docid": "e358c6728c71e8b50cbaf3370d938abe", "score": "0.5915859", "text": "def get_current_user() \n user_handle = session['handle']\n if user_handle.nil? \n raise \"Session has no user handle\"\n else\n User.find_by(handle: user_handle)\n end\nend", "title": "" }, { "docid": "e632cb8b786d7088d463da8ec51fbcef", "score": "0.59143466", "text": "def current_user\nreturn unless session[:user_id]\n@current_user ||=User.find_by_id(session[:user_id])\nend", "title": "" }, { "docid": "aae8d7b584f424777d8649e6dde8d43b", "score": "0.5912295", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\nend", "title": "" }, { "docid": "5ec65a808c4c168fe840ef2f84b1efd5", "score": "0.5912268", "text": "def current_user \n @current_user = User.find_by(id: session[:user_id]) if session[:user_id] \n end", "title": "" }, { "docid": "d8845f849d3167fa9182178537351c52", "score": "0.59103435", "text": "def room_user\n @room_user ||= User.find_by_username(cookies[:room_user_token])\n\n end", "title": "" }, { "docid": "49070f38eb20789bf29e8c5a3833134e", "score": "0.5909762", "text": "def current_user \n User.find_by(id: session[:user_id]) \n end", "title": "" }, { "docid": "7137f8a342024fbf5295da559371f697", "score": "0.5907698", "text": "def current_user\n @current_user||= User.find_by(id:session[:user_id]) if session[:user_id]\n #if sessions user_id exists then it find that users object from user database by its id and returns the object\n end", "title": "" }, { "docid": "70c5d438865f4494142a566f5a6047f5", "score": "0.5906156", "text": "def current_user_variables\n @client = Client.find(1)\n @user = User.find(2)\n if current_user.mode == 'true'\n @toggle = false\n else\n @toggle = true\n end\n end", "title": "" }, { "docid": "6d3061190e617588069af71c34742877", "score": "0.59054047", "text": "def current_room\n\t@current_room ||= Room.where(:user_id => session[:user_id]).first if session[:user_id] #if current_user is nil then replace it, if there is a current session\n end", "title": "" }, { "docid": "2c742b20f21eb5578578a7350dc6eebd", "score": "0.58998257", "text": "def current_user\n @current_user ||= User.find_by(id: session[:user_id])\nend", "title": "" }, { "docid": "2c742b20f21eb5578578a7350dc6eebd", "score": "0.58998257", "text": "def current_user\n @current_user ||= User.find_by(id: session[:user_id])\nend", "title": "" }, { "docid": "0e3c2ec59e63624588904115dbbae7f8", "score": "0.58915836", "text": "def current_user\n if session[:pacient_id]\n @current_user ||= Pacient.find_by(id: session[:pacient_id])\n else\n @current_user ||= Doctor.find_by(id: session[:doctor_id])\n end\n end", "title": "" }, { "docid": "690b95e2edffcf4d6c41ca5458bf9534", "score": "0.58912534", "text": "def current_user\n @user ||= User.find(session[:user_id])\nend", "title": "" }, { "docid": "195ca3ca6122c1d1039d67e7a1699b2d", "score": "0.58903116", "text": "def current_user\n if session[:user_id].present?\n User.find(session[:user_id])\n end\n\nend", "title": "" }, { "docid": "1a1d07b58a21952db67b30679d2686e6", "score": "0.589014", "text": "def current_user\n @current_user||= User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "1c383716a8978a3822a2a97c3dc8a0df", "score": "0.5887525", "text": "def setup_game_and_user\n @game = Game.in_progress\n @user = User.find(params[:client_id])\n end", "title": "" }, { "docid": "6cefb45a6b934b85d778dfa850358fe2", "score": "0.5885491", "text": "def current_user\r\n if session[:user_id]\r\n @current_user = User.find(session[:user_id])\r\n end\r\nend", "title": "" }, { "docid": "b43e4dacee07927a5db1697c044d8051", "score": "0.588419", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id] #return the user \n end", "title": "" }, { "docid": "e3875d7319b21df8fef9084e003fbf9d", "score": "0.58812934", "text": "def instantiate_variables\n if(user_signed_in?)\n @model=nil\n @user = User.find(current_user.id)\n @config = @user.config\n @timer = @user.timer\n @active_quest = @user.active_quest\n @markdown = Redcarpet::Markdown.new(Redcarpet::Render::HTML, autolink: true, tables: true, no_intra_emphasis: true)\n if(@active_quest.nil?)\n aq = { name: '',\n to_link: nil, \n campaign: { name: '', to_link: nil}\n }\n \n @active_quest = to_ostruct(aq)\n end\n @journey = @user.campaigns.first\n @muse = @journey.quests.first\n @notification_count = @user.mailbox.inbox(:unread => true).distinct.count\n end\n end", "title": "" }, { "docid": "6dec22d9b725996ee9c4f43131075ae3", "score": "0.58809584", "text": "def get_session_user\n @user = User.first\n end", "title": "" }, { "docid": "71de7065fbbe8baf70deb419f5a93567", "score": "0.58791524", "text": "def current_user_id #use this method to return the appropriate User id\n session[:user_id]\n #if one is signed_in - you get nothing back\n end", "title": "" }, { "docid": "9f8289b0f1b4b133fd629b18c4e440c7", "score": "0.5875412", "text": "def set_user_if_available \n if session_id\n @user = User.find(session_id)\n else\n @user = User.new\n end\n end", "title": "" }, { "docid": "e7e07ce57cb10db668b1a11e4d2e7789", "score": "0.5870546", "text": "def current_user\n unless @current_user\n @current_user = User.find(session[:user_id], \n :include => [ :projects, { :company => :properties } ], \n :conditions => [\"projects.completed_at IS NULL\"])\n end\n @current_user\n end", "title": "" }, { "docid": "85567671446668be09773b5d631ea908", "score": "0.5869902", "text": "def set_instance_variables\n if session[:user_id]\n @logged_in_user = User.find(session[:user_id])\n end\n end", "title": "" }, { "docid": "bc1ba05d63dfa19a2413a6cbc8201a6b", "score": "0.58687586", "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": "f9a744a4dcbe70110dc4862ff4875684", "score": "0.5868033", "text": "def current_user\n \t@current_user ||= User.find_by(id: session[:user_id])\n \t# if @current_user.nil?\n \t# \t@current_user = User.find_by(id: session[:user_id])\n \t# else\n \t# \t@current_user\n \t# end\n \t\n end", "title": "" }, { "docid": "3d0643937f2eb9b757ab554802a92567", "score": "0.58653486", "text": "def current_user\n @user ||= User.find_by_id(session[:user_id])\nend", "title": "" }, { "docid": "3d0643937f2eb9b757ab554802a92567", "score": "0.58653486", "text": "def current_user\n @user ||= User.find_by_id(session[:user_id])\nend", "title": "" }, { "docid": "dd7bf40c696cf275c9c0a7dbb5f74e82", "score": "0.58650327", "text": "def current_user\n User.find_by(id: session[:user_id]) \n end", "title": "" }, { "docid": "d688c65e573d089d992b9b8444a3cf9c", "score": "0.5863059", "text": "def load_current_user\n @_current_user = User.find(session[:user_id]) if(session[:user_id] && session[:session_id])\n end", "title": "" }, { "docid": "703196c0645079d6a0d2f97e8ff68fed", "score": "0.5862975", "text": "def current_user_session\n if AdminUserSession.find\n return @current_user_session if defined?(@current_user_session)\n @current_user_session = AdminUserSession.find\n elsif AssetUserSession.find\n return @current_user_session if defined?(@current_user_session)\n @current_user_session = AssetUserSession.find\n end\n end", "title": "" }, { "docid": "558ff4c5afbb01cc38b52290180888ea", "score": "0.5862527", "text": "def current_user\n @current_user ||= Aauser.find(session[:aauser_id]) if session[:aauser_id]\n end", "title": "" }, { "docid": "7d7845eee43a34a70be0fcb88bfcb845", "score": "0.58616936", "text": "def current_user_session\n \treturn @current_user_session if defined(@current_user_session)\n \t@current_user_session = UserSession.find\nend", "title": "" }, { "docid": "c72d23fb235f747f0e72b3fac0972314", "score": "0.5860688", "text": "def current_user\n #let's look up the Hacker by the id in the session\n return Hacker.first(:id => session[:hacker_id]) if session[:hacker_id]\n\n #if we can't find them, just return nil\n nil\n end", "title": "" }, { "docid": "224b7fa3a880c6f047bfbc5e72e0eb1c", "score": "0.58605045", "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": "2081da491cb4bdecf4325e8c197733d8", "score": "0.5860317", "text": "def current_user\n @current_user ||= User.find_by_id(session[:user_id]) if session[:user_id]\n \n end", "title": "" }, { "docid": "17bc09d516804ac48d9295517130f68b", "score": "0.5859068", "text": "def current_user\n User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "17bc09d516804ac48d9295517130f68b", "score": "0.5859068", "text": "def current_user\n User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "17bc09d516804ac48d9295517130f68b", "score": "0.5859068", "text": "def current_user\n User.find_by(id: session[:user_id])\n end", "title": "" }, { "docid": "d09154929f7d4c2af51b1a5b52472a8f", "score": "0.58578783", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\nend", "title": "" }, { "docid": "d09154929f7d4c2af51b1a5b52472a8f", "score": "0.58578783", "text": "def current_user\n @current_user ||= User.find(session[:user_id]) if session[:user_id]\nend", "title": "" }, { "docid": "1cb8fccdb7b1d16f7770321060569ab9", "score": "0.58551264", "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": "b684a9b70cc4a894c0ccfc2fb04ab29e", "score": "0.585263", "text": "def current_user\n User.find_by(id: session[:user_id])\n endsss\n end", "title": "" } ]
78215de730a5d8818b2aee69ff8448ff
reset price of item
[ { "docid": "a01745f105e70ae2291a0840bd08c26c", "score": "0.75806624", "text": "def refreshPrice\n @price = @originalPrice\n end", "title": "" } ]
[ { "docid": "f91cb0ae8cad6e6e0bd61912507a7b10", "score": "0.7671542", "text": "def set_item_price\n self.item_price ||= product.price\n end", "title": "" }, { "docid": "ea8bb115cea4df3e1c07f29b0efc319c", "score": "0.750899", "text": "def zero_prices!\n raise \"Locked since #{self.locked}\" if locked?\n self.items.each do |item|\n item.price = 0.0\n end\n self.save!\n end", "title": "" }, { "docid": "fe5c40b9fbc37e80232439370dc65bc2", "score": "0.7140429", "text": "def set_price\n self.price = self.starting_price\n end", "title": "" }, { "docid": "dd9c7bc3037d1bf6e6673a364584107a", "score": "0.70227623", "text": "def set_price(item, price)\n Inventory.set_price(item, price)\n end", "title": "" }, { "docid": "e3f2fad90b521420a10be178b88605cd", "score": "0.6977994", "text": "def empty_all_items\n @items = []\n @total_price = 0.0\n end", "title": "" }, { "docid": "99739b702f801f1e8f9546c4e7e3d951", "score": "0.6947215", "text": "def set_item\n @item = Item.find(params[:id])\n updatePrice()\n end", "title": "" }, { "docid": "2ad6126c851a7f733c44491bab00090b", "score": "0.6924128", "text": "def change_item_price(item_to_change, new_price)\n reset_total\n item_to_change.price = new_price if (item_to_change.class == Item) && self.orders.each {|x| x.items.each {|y| y.name == item_to_change.name}}\n get_total(self.orders)\nend", "title": "" }, { "docid": "70afef7ea13c99e33514479af9a95962", "score": "0.6901193", "text": "def set_price\n self.total_price = self.order_price\n end", "title": "" }, { "docid": "f067b51347b61eda18a307fef576381e", "score": "0.6786064", "text": "def apply\n self.price = unit_price * item_count\n end", "title": "" }, { "docid": "681830388ec9afe83aab47d500453f25", "score": "0.6781491", "text": "def recalculate_price\n self.price = calculate_price\n end", "title": "" }, { "docid": "336bae1c8fdec218aa6317e1ebcf6253", "score": "0.6736658", "text": "def reset_old_quantity\n @old_quantity = nil\n end", "title": "" }, { "docid": "73a5776ffa96f1e38d9c82506557b088", "score": "0.6727759", "text": "def setPrice(p)\n @price = p\n end", "title": "" }, { "docid": "fb52d317fd85752376475fb4e6607403", "score": "0.67155874", "text": "def initialize\n @price = 0\n end", "title": "" }, { "docid": "339fe5abf0d33a370d12ff1f6c15cf1b", "score": "0.6645708", "text": "def set_realized_price\n @auction.realized_price = @auction.starting_price\n end", "title": "" }, { "docid": "6acf7b58f5e2297d6b1b99870550e8f9", "score": "0.66389275", "text": "def set_values\n self.unit_price = item.price\n self.total_price = quantity * item.price\n end", "title": "" }, { "docid": "aff4b13f0825acb1205af467d9ace997", "score": "0.662871", "text": "def set_item_price\n @item_price = ItemPrice.find(params[:id])\n end", "title": "" }, { "docid": "7607009c02459e03fb0d387fe1699329", "score": "0.6598248", "text": "def update_price\n self.price = product.price + product_option_selections.inject(0){|sum, s| sum + s.price_adjustment }\n self.save!\n end", "title": "" }, { "docid": "9389f1c09da3b4263929790942a34fce", "score": "0.6591267", "text": "def reset\n self.order_items.update_all(cart_id: nil)\n end", "title": "" }, { "docid": "6249109c4bb4b11b00ed334f63706e0a", "score": "0.65430135", "text": "def client_table_price_reset\n ClientTablePrice.where(client_id: self.id, reset: true).first\n end", "title": "" }, { "docid": "1433f01a16b6fd7b9d8cfbb68023f019", "score": "0.65370804", "text": "def price\n nil\n end", "title": "" }, { "docid": "ea1159681d2db1ddefcc20b834a0e83b", "score": "0.6530848", "text": "def void_last_transaction\n self.price[:qty].times do\n items.pop(1);\n end\n if items.length == 0\n self.total = 0;\n else\n self.total -= self.price[:val]\n end\n end", "title": "" }, { "docid": "e236591da64829ee6dc5591511a54f85", "score": "0.65270764", "text": "def reset_coins\n update(coins: 20)\n end", "title": "" }, { "docid": "1fed3ec1560736fe72204d2a689b0288", "score": "0.6502265", "text": "def update_price\n \tself.price = self.product.price\n \tself.save\n end", "title": "" }, { "docid": "299aa938a9355791970a08e8dc0aa2b7", "score": "0.6493078", "text": "def set_price (amount)\n @price = amount\n end", "title": "" }, { "docid": "ea67ef5dbac5cbce01bd60a1e3863813", "score": "0.6487605", "text": "def reset\n @total = 0\n @items =\n [\n {item: \"Apples\", php: 10, amt: 0},\n {item: \"Bananas\", php: 5, amt: 0},\n {item: \"Watermelons\", php: 25, amt: 0},\n {item: \"Oranges\", php: 15, amt: 0},\n {item: \"Mangoes\", php: 20, amt: 0}\n ]\n @items = @items.sort_by { |i, php, a| i[:item] }\n @money = 0\nend", "title": "" }, { "docid": "392a1c4ba5cf08bc5de881f72e2a9baf", "score": "0.6484508", "text": "def update_line_item_price!(line_item)\n price = price_from_line_item(line_item)\n if price\n # Mass Assignment Protection \\o/\n line_item.currency = price.currency\n line_item.price = price.amount\n line_item.save!\n end\n end", "title": "" }, { "docid": "10c228df95494c38a6d4c204aaa81f88", "score": "0.64700234", "text": "def set_itemPrice\r\n @itemPrice = ItemPrice.find(params[:id])\r\n end", "title": "" }, { "docid": "5931dc7a2e6427d35b09c9c977f4feef", "score": "0.64456487", "text": "def set_sale_price\n self.sale_price = product_sale_price\n end", "title": "" }, { "docid": "bd9b1c1bcd0aae18acbe375722bc61eb", "score": "0.64319503", "text": "def reset\r\n @total = 0\r\n @items =\r\n [\r\n {item: \"Apples\", php: 10, amt: 0},\r\n {item: \"Bananas\", php: 5, amt: 0},\r\n {item: \"Watermelons\", php: 25, amt: 0},\r\n {item: \"Oranges\", php: 15, amt: 0},\r\n {item: \"Mangoes\", php: 20, amt: 0}\r\n ]\r\n @items = @items.sort_by { |i, php, a| i[:item] }\r\n @money = 0\r\nend", "title": "" }, { "docid": "da67ba18f4d50cfe98c709e31e499d46", "score": "0.64252007", "text": "def reset_coins\n self.update(coins: 0)\n end", "title": "" }, { "docid": "d2ef0341cf1c4f9575b4d6d74a198801", "score": "0.6416138", "text": "def update_price_for(object, new_price)\n item = item_for(object)\n if item\n item.price = new_price\n item.save\n end\n end", "title": "" }, { "docid": "42c25b955d98f7459a524a90987cc4a5", "score": "0.6414882", "text": "def sell(item)\r\n self.credits += item.price\r\n items.delete(item)\r\n end", "title": "" }, { "docid": "c64833741b23f2092f0f1a9b0f428783", "score": "0.6402365", "text": "def price=(value) #es lo mismo que #attr_writer :price\n @price = value\n end", "title": "" }, { "docid": "8114866f9bd7a2802fd657753d704481", "score": "0.63979423", "text": "def empty_to_buy\n self.cart_items.delete(self.items_to_buy)\n end", "title": "" }, { "docid": "4d68f067aea8587e2dbb21151a6b4df6", "score": "0.6389092", "text": "def reset!\n @products = []\n end", "title": "" }, { "docid": "4d68f067aea8587e2dbb21151a6b4df6", "score": "0.6389092", "text": "def reset!\n @products = []\n end", "title": "" }, { "docid": "4d68f067aea8587e2dbb21151a6b4df6", "score": "0.6389092", "text": "def reset!\n @products = []\n end", "title": "" }, { "docid": "af439a69e9095ce967e3c0fb7354268a", "score": "0.6383342", "text": "def set_price_item\n @price_item = PriceItem.find(params[:id])\n end", "title": "" }, { "docid": "70246ea3ff1ae190f74e31b4ed08608a", "score": "0.6356361", "text": "def price\n @price ||= computed_price\n end", "title": "" }, { "docid": "e35295135f9d94e4e2e04498a12c10d1", "score": "0.63493997", "text": "def update_price_for(object, new_price)\n item = item_for(object)\n item.update_price(new_price) if item\n end", "title": "" }, { "docid": "f409aaecced2c4a95dde815609adb29e", "score": "0.633155", "text": "def sell(item)\n items.delete_if{|i| i==item}\n self.credit=credit+item.price\n end", "title": "" }, { "docid": "dc85be37f11be8f7ac9eec72f87c4c2f", "score": "0.6331396", "text": "def price\n base_price = @price\n end", "title": "" }, { "docid": "82f6427ee22b1472be8bba1d0314456c", "score": "0.63216037", "text": "def setprice=(new_price)\n\t @price= new_price\n\tend", "title": "" }, { "docid": "4589a47223b099716f1d53a12cfacb5d", "score": "0.6306009", "text": "def update_button_price\n index = start_index\n each do |button|\n button.price = button_price(index)\n index += 1\n end\n end", "title": "" }, { "docid": "b6c3e1403d2b92cbedecf08bfe39ee6e", "score": "0.6289727", "text": "def set(item, max, price)\n @item = item\n @max = max\n @price = price\n @number = 1\n refresh\n end", "title": "" }, { "docid": "b6c3e1403d2b92cbedecf08bfe39ee6e", "score": "0.6289727", "text": "def set(item, max, price)\n @item = item\n @max = max\n @price = price\n @number = 1\n refresh\n end", "title": "" }, { "docid": "b6c3e1403d2b92cbedecf08bfe39ee6e", "score": "0.6289727", "text": "def set(item, max, price)\n @item = item\n @max = max\n @price = price\n @number = 1\n refresh\n end", "title": "" }, { "docid": "26f65465e14219808466c6e8b9af544c", "score": "0.6288657", "text": "def calculate_price\n self.price ||= expected_price\n end", "title": "" }, { "docid": "263deba7144253b3026417e035e53793", "score": "0.62839174", "text": "def price=(new_price)\n @price = new_price\n end", "title": "" }, { "docid": "9e26a0dafef94b0dc1a8ee92d05e42c0", "score": "0.6277772", "text": "def set(item, max, price, currency_unit = nil)\r\n @item = item\r\n @max = max\r\n @price = price\r\n @currency_unit = currency_unit if currency_unit\r\n @number = 1\r\n refresh\r\n end", "title": "" }, { "docid": "b025a1ca3ab79bda7fbdd8ba8d064a2f", "score": "0.627641", "text": "def price_amount=(new_price = 0)\n self.standard_price = new_price.to_f * 100\n end", "title": "" }, { "docid": "b91a49a37e2898808b1bd7f9a6ea3da6", "score": "0.6270553", "text": "def modify_prices(item, count_rule)\n items = @cart.select { |c_item| c_item.product_code == item.product_code }\n items.map! do |c_item|\n count_rule.new_val_factor.nil? ? c_item.price = count_rule.new_value : c_item.price *= count_rule.new_val_factor\n c_item\n end\n item.price = count_rule.new_value\n end", "title": "" }, { "docid": "a7e95d303867a1ac3dcc12e840038cf1", "score": "0.6264061", "text": "def price= new_price\n @price = new_price\n\n notify_buyer_list\n end", "title": "" }, { "docid": "4ae93f6c67d23332334b2366cfb3a240", "score": "0.62611765", "text": "def price\n \tprice = @price\n end", "title": "" }, { "docid": "14b2890dd083a72cbd44b6e0928bc449", "score": "0.62486213", "text": "def reset_number_select()\n @ucShopItemsList.each() { |shopItem| shopItem.ucItemNumber.reset() }\n refresh()\n end", "title": "" }, { "docid": "14b2890dd083a72cbd44b6e0928bc449", "score": "0.62486213", "text": "def reset_number_select()\n @ucShopItemsList.each() { |shopItem| shopItem.ucItemNumber.reset() }\n refresh()\n end", "title": "" }, { "docid": "d2e70b3f99fa1795440dfb394a27954e", "score": "0.6238586", "text": "def price( items )\n raise NotImplemented \n end", "title": "" }, { "docid": "7c00a6d4cb48377e6e27f3d1cedec143", "score": "0.6233594", "text": "def price=(x)\n @price=x\n end", "title": "" }, { "docid": "2875942d2d5e3ba0cba38a232a96e22f", "score": "0.6223914", "text": "def update_price(new_price)\n self.price = new_price\n save\n end", "title": "" }, { "docid": "7c0153eb5fe745f96356c56c0f8261c2", "score": "0.62212056", "text": "def update_line_item_price!(line_item)\n price = price_from_line_item(line_item)\n\n if price\n line_item.update!(currency: price.currency, price: price.amount)\n else\n raise \"no #{currency} price found for #{line_item.product.name} (#{line_item.variant.sku})\"\n end\n end", "title": "" }, { "docid": "6ed59f8ff20a4f516fabbc776e70ce14", "score": "0.62153363", "text": "def price=(p)\n @price = p\n end", "title": "" }, { "docid": "b7a8f0b9ab05091667e875afcbe86779", "score": "0.6206455", "text": "def void_last_transaction\n @total -= @price\n end", "title": "" }, { "docid": "53080ae307bf55671185f815f1fdf831", "score": "0.61967355", "text": "def finalize\n self[:price] = product.price\n self[:total_price] = quantity * self[:price]\n end", "title": "" }, { "docid": "080ae5012ac91248c15c711df0b9ac77", "score": "0.6195228", "text": "def set_unit_price\n self[:price] = price\n end", "title": "" }, { "docid": "bf567251f6494c2346ae282d7e29a4b1", "score": "0.617665", "text": "def empty!\n @items = []\n @tax = 0.0\n @total = 0.0\n @shipping_cost = 0.0\n end", "title": "" }, { "docid": "bf567251f6494c2346ae282d7e29a4b1", "score": "0.61759835", "text": "def empty!\n @items = []\n @tax = 0.0\n @total = 0.0\n @shipping_cost = 0.0\n end", "title": "" }, { "docid": "2ee5517c854d813a981864e772e8fc00", "score": "0.6175006", "text": "def price=(price)\n return unless (self.visible = !price.nil?)\n\n @item_price.text = price.to_s\n end", "title": "" }, { "docid": "b323ab3b8758dd642fb599fa94e4975f", "score": "0.61612946", "text": "def item_price\n Money.new(item_price, currency)\n end", "title": "" }, { "docid": "7643474f20c38f30feb5a85aad8ebf02", "score": "0.6154358", "text": "def price; regular_price; end", "title": "" }, { "docid": "ce80dc31d2bae346ccfcbf58d1a11126", "score": "0.6153464", "text": "def purchase_price(item)\n item.price / 2\n end", "title": "" }, { "docid": "b903aaf480910ff79db769f65b0797db", "score": "0.6140682", "text": "def set_item_price\n rg = ResponseGroup.new('Offers', 'ItemAttributes')\n begin\n resp = get_item(rg)\n item = resp.item_lookup_response[0].items[0].item\n rescue Error::InvalidParameterValue\n errors.add(:asin, \"Invalid ASIN\")\n end\n begin\n self.amount = item.offers.offer.offer_listing.price.amount\n rescue NoMethodError\n self.amount = item.item_attributes.list_price.amount\n end\n end", "title": "" }, { "docid": "6581c7a3a0f1a4bcfdbd2983ac684b30", "score": "0.61304337", "text": "def base_price=(p)\n self.price = p\n end", "title": "" }, { "docid": "7a93157db2a13f0ad70cd380ba877f49", "score": "0.61223274", "text": "def recalculate_price_and_update!\n update(price: calculate_price)\n end", "title": "" }, { "docid": "89b53be2ccbeccf521a043c888afb690", "score": "0.611293", "text": "def set_amount\n self.amount = quantity * offer.price\n end", "title": "" }, { "docid": "46c72aafabfa608479a4572518279210", "score": "0.61101055", "text": "def line_items_price\n @line_items_price ||= line_items.inject(0) { |sum, item| sum + item.price }\n end", "title": "" }, { "docid": "1b26d6951f9517e90c48a8010aaba92f", "score": "0.61094576", "text": "def price=(value)\r\n\t\tbase_price = value\r\n\tend", "title": "" }, { "docid": "1b26d6951f9517e90c48a8010aaba92f", "score": "0.61094576", "text": "def price=(value)\r\n\t\tbase_price = value\r\n\tend", "title": "" }, { "docid": "bc0341036689da11d370a8e8ffb7798e", "score": "0.61027944", "text": "def price\n quantity * item_price\n end", "title": "" }, { "docid": "326ad2d74bcbcabcb61209ba4abeefc6", "score": "0.61013883", "text": "def price=(price)\n price_options.first.price = price\n end", "title": "" }, { "docid": "e210a27df14ec6b8129a2b19db3e3168", "score": "0.60917825", "text": "def price=(price)\n @price = price\n end", "title": "" }, { "docid": "e210a27df14ec6b8129a2b19db3e3168", "score": "0.60917825", "text": "def price=(price)\n @price = price\n end", "title": "" }, { "docid": "4ef6a38a6925dfc5f0326cb09a5e3d5b", "score": "0.60908943", "text": "def price\n @coffee.price += 0.50\n end", "title": "" }, { "docid": "14951e751852793200463044a109e637", "score": "0.6089706", "text": "def sell_price\n @sell_price = price || product.daily_price\n end", "title": "" }, { "docid": "afc7ba6ea69cf942c5f09115220d316b", "score": "0.60871327", "text": "def clearance!\n selling_price = style.wholesale_price * CLEARANCE_PRICE_PERCENTAGE\n if selling_price < 5 && PANTS_AND_DRESSES.include?(style.type)\n selling_price = 5\n elsif selling_price < 2\n selling_price = 2\n end\n update_attributes!(status: Item::STATUS[:clearanced], price_sold: selling_price)\n end", "title": "" }, { "docid": "aa5ee82ef52bf8e299240367a8e37255", "score": "0.6085369", "text": "def price\n @coffee.price += 0.25\n end", "title": "" }, { "docid": "150e59986caaf4d9eb6cf1e962e31acd", "score": "0.608254", "text": "def price\n item.price * quantity\n end", "title": "" }, { "docid": "6b5d49ae313bf29c003239920e3cce4e", "score": "0.60790616", "text": "def price=(value)\n @price = value\n end", "title": "" }, { "docid": "fcfbbf7868c7d54f6038fbd689d0688b", "score": "0.6073179", "text": "def reset(new_value); end", "title": "" }, { "docid": "fcfbbf7868c7d54f6038fbd689d0688b", "score": "0.6073179", "text": "def reset(new_value); end", "title": "" }, { "docid": "1bd1cc16ea1c85104f7ccc1ca235ba01", "score": "0.6070379", "text": "def update!(**args)\n @original_price = args[:original_price] if args.key?(:original_price)\n @price = args[:price] if args.key?(:price)\n end", "title": "" }, { "docid": "ed772b49a22ea91e414e7ae3a2c135c0", "score": "0.60636955", "text": "def set_item(new_item)\n @item = new_item\n @quantity = 1\n refresh\n end", "title": "" }, { "docid": "ee22e1db147ad7763cf408680af5c65b", "score": "0.6049028", "text": "def update_line_item_price!(line_item)\n list_price = list_price_from_line_item(line_item)\n price = price_from_line_item(line_item)\n\n if price\n line_item.update_attributes!(\n currency: price.currency,\n list_price: list_price.price,\n price: price.price\n )\n else\n raise RuntimeError, \"no #{currency} price found for #{line_item.product.name} (#{line_item.variant.sku})\"\n end\n end", "title": "" }, { "docid": "01e81cc57be044a7d7ae6085bfb28eba", "score": "0.60356545", "text": "def simulate(item)\n price = item.base_price\n damount = 0\n if self.amount_type == 'percent' then\n d = self.amount / 100\n damount += (price * d)\n else\n damount += self.amount\n end\n item.base_price = price - damount\n return item\n end", "title": "" }, { "docid": "01e81cc57be044a7d7ae6085bfb28eba", "score": "0.60356545", "text": "def simulate(item)\n price = item.base_price\n damount = 0\n if self.amount_type == 'percent' then\n d = self.amount / 100\n damount += (price * d)\n else\n damount += self.amount\n end\n item.base_price = price - damount\n return item\n end", "title": "" }, { "docid": "57e9dac406edd6a363664c216364fd8b", "score": "0.6031984", "text": "def item_price=(list)\n @price_list = list\n end", "title": "" }, { "docid": "cc87c9eaa897dadf2289cf089f83fe70", "score": "0.60298145", "text": "def price\n price_fixed / 100.0\n end", "title": "" }, { "docid": "258f0e1759e465e3577a98b9192a9f08", "score": "0.6028501", "text": "def update_total_price\n #self.total_price = self.receiving_lines.inject(0){ |res, item| res + item.line_item.total }\n end", "title": "" }, { "docid": "ea1a261e1faaef54d4580ffa25447427", "score": "0.60160714", "text": "def price\n @price ||= latest_price\n end", "title": "" }, { "docid": "f8e984ab05fd44541f3396359d16669b", "score": "0.60153776", "text": "def finalize\n self[:unit_price] = unit_price\n self[:total_price] = quantity * self[:unit_price]\n end", "title": "" }, { "docid": "e2f77964922621a51357fdf7c16774fa", "score": "0.60153633", "text": "def set_price_for_room\n room = Room.find_by(id: room_id)\n self.price = room.price * days if room\n end", "title": "" } ]
a7013ff371cf6eb7b567f78cf6cd72c4
Shortcut methods for the best Hsp
[ { "docid": "d9522b476124ef86742659eae844eddd", "score": "0.0", "text": "def evalue;\t\[email protected];\t\tend", "title": "" } ]
[ { "docid": "b6ea57868f70d34431fd3ddce643afcb", "score": "0.68786496", "text": "def hiss; end", "title": "" }, { "docid": "b78708f279678594607705af65622e91", "score": "0.64722127", "text": "def hamlet; end", "title": "" }, { "docid": "43457b9bb9d42357bec1690567445a86", "score": "0.638596", "text": "def H(*args)\n end", "title": "" }, { "docid": "ed1ee29e6c4cf6da4103ffec9121b4d4", "score": "0.6384569", "text": "def hd\n \n end", "title": "" }, { "docid": "65ffca17e416f77c52ce148aeafbd826", "score": "0.6262171", "text": "def schubert; end", "title": "" }, { "docid": "d14ba9198a7a84126834a8d9327c9dbf", "score": "0.62562764", "text": "def ld_hl_sp_plusr8\n end", "title": "" }, { "docid": "edfdcede98211bbf24e8a47e45c98837", "score": "0.62114394", "text": "def hiddens; end", "title": "" }, { "docid": "26a3cb31ebd1e83f308deddc3ae18307", "score": "0.6172413", "text": "def hop; end", "title": "" }, { "docid": "e162a4418e10f5c8d53fd814d502063d", "score": "0.61470795", "text": "def lh(t, s, c)\n\n end", "title": "" }, { "docid": "9513f65717ac53a33a487f6a1033b91d", "score": "0.61356544", "text": "def herald; end", "title": "" }, { "docid": "be04cb55a462491abd1acf5950c83572", "score": "0.6113541", "text": "def jack_handey; end", "title": "" }, { "docid": "2ca843f4cdf9a95b875666cf1f347ed5", "score": "0.6110332", "text": "def spice; end", "title": "" }, { "docid": "74d5b4b6e340a8f7d524e1884e322532", "score": "0.61018175", "text": "def spouse; end", "title": "" }, { "docid": "5971f871580b6a6e5171c35946a30c95", "score": "0.60559124", "text": "def stderrs; end", "title": "" }, { "docid": "febc6859eb0b0feaf1bb596c6bccc469", "score": "0.6035528", "text": "def add_hl_sp\n end", "title": "" }, { "docid": "170f73cf2814a3051547ad3c2a285806", "score": "0.60345876", "text": "def lhu(t, s, c)\n\n end", "title": "" }, { "docid": "e6259a8ab99f7f0da6d0c58a74e0e0bb", "score": "0.6033569", "text": "def isp; end", "title": "" }, { "docid": "e6259a8ab99f7f0da6d0c58a74e0e0bb", "score": "0.6033569", "text": "def isp; end", "title": "" }, { "docid": "0edd32d6de1a10ae51ca22d79cc2077b", "score": "0.6023907", "text": "def mitch_hedberg; end", "title": "" }, { "docid": "3db157d82460cb0632778815b62dbc35", "score": "0.60120225", "text": "def dh; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.5929443", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.5929443", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.5929443", "text": "def specie; end", "title": "" }, { "docid": "d8ae3e2b236950074c4632d180274b8a", "score": "0.5929443", "text": "def specie; end", "title": "" }, { "docid": "dc0a28414840f2b4955af2c9e1fa7986", "score": "0.58573", "text": "def sub_h\n end", "title": "" }, { "docid": "4e92bc73e3a3a62167e2eccd3d1b1761", "score": "0.58383703", "text": "def sld; end", "title": "" }, { "docid": "5cf20d5aba71d434e3118cf082e5b244", "score": "0.58175355", "text": "def schumann; end", "title": "" }, { "docid": "ad244bd0c45d5d9274f7612fa6fee986", "score": "0.5805255", "text": "def suivre; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.5802797", "text": "def operations; end", "title": "" }, { "docid": "2dbabd0eeb642c38aad852e40fc6aca7", "score": "0.5802797", "text": "def operations; end", "title": "" }, { "docid": "511c8117c9297eca0605a0cdd13a73cb", "score": "0.5799326", "text": "def gethashespersec\n request :gethashespersec\n end", "title": "" }, { "docid": "d41b15dea9577832d0e53ea38212e1b5", "score": "0.5747371", "text": "def dish; end", "title": "" }, { "docid": "01562b746305f335ccd31e9dff3049df", "score": "0.57345474", "text": "def sittinae_hooey(scrawny_appulsion, termly)\n end", "title": "" }, { "docid": "76b1311afc2a77f83749fdb207506a48", "score": "0.57084554", "text": "def heroine; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.5701398", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.5701398", "text": "def helpers; end", "title": "" }, { "docid": "62158baafece84b452b305badc5dd98c", "score": "0.5701398", "text": "def helpers; end", "title": "" }, { "docid": "bcf5197e5f48111d0f44c7fceb0f4ff5", "score": "0.5693812", "text": "def mhp; param(0); end", "title": "" }, { "docid": "4a8a45e636a05760a8e8c55f7aa1c766", "score": "0.56910354", "text": "def terpene; end", "title": "" }, { "docid": "0b8b7b9666e4ed32bfd448198778e4e9", "score": "0.56833655", "text": "def probers; end", "title": "" }, { "docid": "45a826938e249d2528d23e0a4436b81a", "score": "0.563738", "text": "def singular_siegler; end", "title": "" }, { "docid": "7bd36219dcf7d2e0a38e3d56f507ff30", "score": "0.56304854", "text": "def lsi; end", "title": "" }, { "docid": "cdd16ea92eae0350ca313fc870e10526", "score": "0.56289935", "text": "def who_we_are\r\n end", "title": "" }, { "docid": "f5ff1dabb022d97c4fd44bd76348f3de", "score": "0.56135297", "text": "def sbc_a_h\n end", "title": "" }, { "docid": "ef1e4c0cc26e4eec8642a7d74e09c9d1", "score": "0.56028247", "text": "def private; end", "title": "" }, { "docid": "8eccc24a735e2300a7cd20a02c963db6", "score": "0.560049", "text": "def sk! ; k! ; s! ; end", "title": "" }, { "docid": "753a1ce1b306b0882699391b8dd87561", "score": "0.5596519", "text": "def sub_hl\n end", "title": "" }, { "docid": "db7aeb37824c3836be46680fa163f7a6", "score": "0.5587124", "text": "def strain; end", "title": "" }, { "docid": "f64337f68710b6e55a87e68bde8c4693", "score": "0.5583595", "text": "def king_richard_iii; end", "title": "" }, { "docid": "c9162333e458c7116593d877efd1716d", "score": "0.5579308", "text": "def sea; end", "title": "" }, { "docid": "6fff39a4061c3c49d851ce078a1db387", "score": "0.5575079", "text": "def slop!; end", "title": "" }, { "docid": "6fff39a4061c3c49d851ce078a1db387", "score": "0.5575079", "text": "def slop!; end", "title": "" }, { "docid": "afbc4c54dabf4c09a70792d90ead3525", "score": "0.5568311", "text": "def sn\n end", "title": "" }, { "docid": "99edac1c5028f089ae32be27e18e645e", "score": "0.55367005", "text": "def hrg; xparam(7); end", "title": "" }, { "docid": "562f63d0d6997e0b09fd56c03b4f504a", "score": "0.55347294", "text": "def scientist; end", "title": "" }, { "docid": "af1366b12265a48412a348cb14e352b0", "score": "0.5534664", "text": "def high_school\n\tend", "title": "" }, { "docid": "a7522d60cb656100ff4b565112c161a6", "score": "0.55187", "text": "def desc=(_); end", "title": "" }, { "docid": "6f6cc4a2dc22593cd3a08912834641eb", "score": "0.5516241", "text": "def hints; end", "title": "" }, { "docid": "75e16b046d5e35686bee51a875999d4c", "score": "0.5508593", "text": "def short; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.55052716", "text": "def implementation; end", "title": "" }, { "docid": "3660c5f35373aec34a5a7b0869a4a8bd", "score": "0.55052716", "text": "def implementation; end", "title": "" }, { "docid": "cf9e87754465b6f387bd1187b2a2bb7f", "score": "0.54938376", "text": "def SS2_7 args\r\n\r\nend", "title": "" }, { "docid": "9d841b89340438a2d53048b8b0959e75", "score": "0.5474495", "text": "def sitemaps; end", "title": "" }, { "docid": "ecfeaf84a3523f7b95a3c5ef2b0d5fab", "score": "0.5473807", "text": "def quick_stats\n\tend", "title": "" }, { "docid": "3b4df29992323899033bb22a35a64989", "score": "0.5466638", "text": "def malts; end", "title": "" }, { "docid": "39317bf124f8271a171686c96b2aa67c", "score": "0.5416576", "text": "def high_five; end", "title": "" }, { "docid": "d492d0b1f1f3f4475f109da55d9875b0", "score": "0.5415624", "text": "def scf\n end", "title": "" }, { "docid": "bd395ef5570ec94ad67ca3120a943fca", "score": "0.54143775", "text": "def operation; end", "title": "" }, { "docid": "b2bf34b4d9f079aafc5e624689e76050", "score": "0.5413577", "text": "def algorithms; end", "title": "" }, { "docid": "b2bf34b4d9f079aafc5e624689e76050", "score": "0.5413577", "text": "def algorithms; end", "title": "" }, { "docid": "b2bf34b4d9f079aafc5e624689e76050", "score": "0.5413577", "text": "def algorithms; end", "title": "" }, { "docid": "b2bf34b4d9f079aafc5e624689e76050", "score": "0.5413577", "text": "def algorithms; end", "title": "" }, { "docid": "b2bf34b4d9f079aafc5e624689e76050", "score": "0.5413577", "text": "def algorithms; end", "title": "" }, { "docid": "97c5af340ba5e8f6958c50b6024fbc34", "score": "0.54118425", "text": "def england\n end", "title": "" }, { "docid": "94a9f9cebb96ca3b29ccb5ba3cfcdd94", "score": "0.54051954", "text": "def alternatives; end", "title": "" }, { "docid": "0b47c7bbf158a08945a18c5355a04daf", "score": "0.5390959", "text": "def usage; end", "title": "" }, { "docid": "0b47c7bbf158a08945a18c5355a04daf", "score": "0.5390959", "text": "def usage; end", "title": "" }, { "docid": "dcbe293a245d928e6d547cb8b8ef981f", "score": "0.53833437", "text": "def pha; sparam(3); end", "title": "" }, { "docid": "2d8d9f0527a44cd0febc5d6cbb3a22f2", "score": "0.53817075", "text": "def weber; end", "title": "" }, { "docid": "991b6f12a63ef51664b84eb729f67eed", "score": "0.5368255", "text": "def formation; end", "title": "" }, { "docid": "ba95d019fb69d6edfe25aba21f84f3c3", "score": "0.5362321", "text": "def handle_sy_sm_sd_h_m_s\n handle_sy_sm_sd\n next_tag # T\n handle_h_m_s\n end", "title": "" }, { "docid": "777e3be565c7c3171eca59e95fd28f4b", "score": "0.5356751", "text": "def help; end", "title": "" }, { "docid": "777e3be565c7c3171eca59e95fd28f4b", "score": "0.5356751", "text": "def help; end", "title": "" }, { "docid": "777e3be565c7c3171eca59e95fd28f4b", "score": "0.5356751", "text": "def help; end", "title": "" }, { "docid": "df034585af6986785fa1cc5a0bbca4c5", "score": "0.53546077", "text": "def cops; end", "title": "" }, { "docid": "df034585af6986785fa1cc5a0bbca4c5", "score": "0.53546077", "text": "def cops; end", "title": "" }, { "docid": "df034585af6986785fa1cc5a0bbca4c5", "score": "0.53546077", "text": "def cops; end", "title": "" }, { "docid": "9e1628b1dd153f487f68d7dc232a76ec", "score": "0.53534347", "text": "def troop; end", "title": "" }, { "docid": "1c6436423282ddf03f5b31c8ddb4ee5d", "score": "0.53441906", "text": "def bellini; end", "title": "" }, { "docid": "5490d2f075e03301ce6bab26e5fb9b6a", "score": "0.53413934", "text": "def short_usage\n short =<<HERE_YOU_GO\nmax_hp - calculate max HP for character, per AD&D rules (*FIRST* Edition,\nSpecifically as implemented by Pool of Radiance!)\n\nUsage:\nmax_hp [options] <constitution> <class><level> [<class><level> [...]]\n\nUse max_hp -h or max_hp --help for more help.\nHERE_YOU_GO\nend", "title": "" }, { "docid": "c615c9c44ec675af95a47917c42ffda2", "score": "0.5338883", "text": "def headline; end", "title": "" }, { "docid": "6b22c1887e254fb2397556f5f1904282", "score": "0.53297704", "text": "def how_it_works\r\n end", "title": "" }, { "docid": "76210af32a8c43254df98a86b32ccc17", "score": "0.532841", "text": "def gethashespersec\n coind.gethashespersec\n end", "title": "" }, { "docid": "3dd71df4c3bc0c89dc7cdc67663f0b2c", "score": "0.5327192", "text": "def show\n # implicit :get_sesh\n end", "title": "" }, { "docid": "2817d7ae52bf3881f08f35a7a5d02412", "score": "0.5324398", "text": "def manufacture; end", "title": "" }, { "docid": "eb813b4c171b5a75ecb2253b743e7c3a", "score": "0.5322679", "text": "def parslet; end", "title": "" }, { "docid": "eb813b4c171b5a75ecb2253b743e7c3a", "score": "0.5322679", "text": "def parslet; end", "title": "" }, { "docid": "eb813b4c171b5a75ecb2253b743e7c3a", "score": "0.5322679", "text": "def parslet; end", "title": "" }, { "docid": "eb813b4c171b5a75ecb2253b743e7c3a", "score": "0.5322679", "text": "def parslet; end", "title": "" }, { "docid": "c4bb06dababf8d54a0a46b28009600bf", "score": "0.5301614", "text": "def hipsterfy(word)\n\nend", "title": "" }, { "docid": "d2b919c14a14af5ce67e69dfc370fde5", "score": "0.5291338", "text": "def romeo_and_juliet; end", "title": "" } ]
3ec5b9cf6fa6f34b1faed9305f6ae1be
Public: prints the detailed view of all your Lists and all their Items. Returns nothing.
[ { "docid": "7df48e4cdbeb1aa958a8efdb2ec82c39", "score": "0.69253516", "text": "def all\n storage.lists.each do |list|\n output \" #{list.name}\"\n list.items.each do |item|\n output \" #{item.short_name}:#{item.spacer} #{item.value}\"\n end\n end\n end", "title": "" } ]
[ { "docid": "3d1c74cd5762b50df182a2935447bd12", "score": "0.7746581", "text": "def view \n puts\n puts \"Viewing #{listname.capitalize} List\"\n\n items.each_with_index do |item, index| \n puts \"#{index+1}. #{item}\"\n end\n end", "title": "" }, { "docid": "40cc92b320542ce09626a0f4b3a3884e", "score": "0.7568839", "text": "def print_list\n print_title\n print_items\n puts\n end", "title": "" }, { "docid": "2aaa3ced73f64d1df4f221265f9935e9", "score": "0.7448751", "text": "def print_items(list = @items)\n puts \"+++++#{@title} +++++ \"\n list.each{|list_item| list_item.print_details}\n puts \"\"\n end", "title": "" }, { "docid": "66658931105e4e968fbd79a92be57ae7", "score": "0.7385653", "text": "def print_list\n puts \"#{@title}\"\n puts \"************************\"\n @items.each do |items|\n items.print_items\n end\n puts \"************************\"\n puts\n end", "title": "" }, { "docid": "2fa3061fbf2cb92ee219a969d3358069", "score": "0.7223454", "text": "def print_lists()\n puts \"Here are your lists\"\n UdaciList.all_lists.each {|list| puts list.title}\n puts \"\\n\"\nend", "title": "" }, { "docid": "467d9ce92dd88c7a9cdc65f1b6d04b3b", "score": "0.72119755", "text": "def print_list\n puts\n puts \"=\" * @title.length\n puts @title\n puts \"=\" * @title.length\n @items.each do |item|\n item.print_item(@items.index(item),item)\n end\n puts\n end", "title": "" }, { "docid": "5327698d74d3e080527e18744ebf87c7", "score": "0.71274334", "text": "def overview\n storage.lists.each do |list|\n output \" #{list.name} (#{list.items.size})\"\n end\n end", "title": "" }, { "docid": "d23feb1d1ed93e53fedbd3ef29588450", "score": "0.70913625", "text": "def show\n return false if @items.length == 0\n @items.each do |item|\n puts \"#{item.name}: #{item.description}\"\n end\n end", "title": "" }, { "docid": "9b4c65213a7531bb83c60cb2f8791117", "score": "0.6993765", "text": "def preview\n puts \"Your current shopping list is:\"\n puts \"-------------------------------\"\n @list.each do |item, quantity|\n puts \"#{quantity} - #{item.item_name}\"\n end\n puts \"________________________________\"\n end", "title": "" }, { "docid": "c5be6787992b52b10b73f12db7742a7d", "score": "0.6977392", "text": "def print_list\n \t@report_file .puts '*****************************'\n \t@report_file.puts \"Title - #{@title}\"\n \t@report_file .puts '*****************************'\n\t @items.each_with_index do |value,index|\n\t value.print_items(index+1,report_file)\n\t end\n\tend", "title": "" }, { "docid": "b609dbc11e54bdee8430988c1a6ae48c", "score": "0.69126815", "text": "def print_list \n header = \"#{@title} -- Completed: #{completed?}\"\n columns = \"ID\" + \"Priority\".rjust(10) + \"Item\".rjust(8) + \"Status\".rjust(20)\n puts header\n title_break\n puts columns\n title_break\n @items.each_index do |index|\n puts \"#{index} - [#{items[index].priority}]\".ljust(12) + \"#{items[index].description}\".ljust(20) + \"Completed: #{@items[index].completion_status}\"\n end\n end", "title": "" }, { "docid": "16c3f7c99ab1f6fa0251242675086431", "score": "0.69046795", "text": "def print_list(list)\n\tputs \"List name: #{list['list_name']}\"\n\tprint_separator()\n\n\tlist['items'].each do |item|\n\t\tputs \"\\tItem: \" +item['name'] +\"\\t\\t\\t\" \n\t\tputs \"Quantity: \" +item['quantity'].to_s\n\t\tprint_separator()\n\tend\nend", "title": "" }, { "docid": "312b2bca2b23504baceca1f0cf1dd53a", "score": "0.6890886", "text": "def print_items\n print_list_header\n @items.each.with_index(1) do |task, index|\n puts \"#{index} - \" + \"#{task.print_task}\"\n end\n puts \"\"\n end", "title": "" }, { "docid": "bc74aa1c841fb0245c1202d52aff2872", "score": "0.6885069", "text": "def all\n storage.lists.each do |list|\n output \" #{list.name}\"\n list.items.each do |item|\n output \" #{item.name}: #{item.value}\"\n end\n end\n end", "title": "" }, { "docid": "12b011e11e01a8008faee526ac250d38", "score": "0.6875098", "text": "def print_list\n puts @name\n puts \"-\" * name.length\n @items.each { |item|\n puts \"[_] #{item}\"\n }\n end", "title": "" }, { "docid": "0d6d64980679f59d4428278096e65dcd", "score": "0.6871859", "text": "def overview\n storage.lists.each do |list|\n output \" #{list.name} (#{list.items.size})\"\n end\n s = \"You don't have anything yet! To start out, create a new list:\"\n s << \"\\n $ boom <list-name>\"\n s << \"\\nAnd then add something to your list!\"\n s << \"\\n $ boom <list-name> <item-name> <item-value>\"\n s << \"\\nYou can then grab your new item:\"\n s << \"\\n $ boom <item-name>\"\n output s if storage.lists.size == 0\n end", "title": "" }, { "docid": "c9cceebc55b78098971c8989b1771c9a", "score": "0.6847423", "text": "def print_list\n puts \"*\" * 25\n puts \"\\n\"\n puts \"#{@title}\"\n puts \"#{@time_created}\"\n puts \"*\" * 25\n @items.each do |item|\n item_index = get_item_index item\n item.print_item(item_index + 1)\n end\n end", "title": "" }, { "docid": "054dc6c5bd634d4fe75428b899023f49", "score": "0.68405366", "text": "def print_list\n @list.each { |item, qty| puts \"#{qty} #{item}\" }\n end", "title": "" }, { "docid": "df9c84d2b5769e952f25b9a344d3d022", "score": "0.68280244", "text": "def print_list\n \tputs \"----------------------------------------------\"\n \tputs \"#{@title}\"\n \tputs \"----------------------------------------------\"\n \[email protected] do |item|\n \t\titem_index = get_item_index item\n \t\titem.print_item(item_index + 1)\n \tend\n\tend", "title": "" }, { "docid": "6a64f4ff26342e54f97cf09dc1d2bd72", "score": "0.68019605", "text": "def show_all\n if @items.length == 0\n puts \"no hay articulos en tu lista de compras\"\n end\n @items.each_index do |index|\n puts index.to_s + \" - \" + @items[index].to_s\n end\n end", "title": "" }, { "docid": "3218a1c7b76afa5c465fa7f8eccebcbf", "score": "0.6768877", "text": "def print_list(items)\n puts Terminal::Table.new rows: list_items(items), \n title: @title, \n headings: %w(No. Type Description Other Priority)\n end", "title": "" }, { "docid": "1fc9d5168ec36746835a04d19f175cb4", "score": "0.6698496", "text": "def show\n header = \"|%2s|%-30s|%20s|%20s|%15s\\n\"%[\"ID\",\"Task\",\"Status\",\"Category\",\"Date Due\"]\n\n puts @title\n puts \"-\"*(header.length - 1)\n\n puts header\n puts \"-\"*(header.length - 1)\n @items.each do |item|\n printf \"|%2s|%-30s|%20s|%20s|%15s|\\n\",\"#{item.get_id}\",\"#{item.get_description}\",\"#{item.completed? ? \"Done\":\"Not Done\"}\",\"#{item.get_category}\",\"#{item.due_date}\"\n end\n puts \"-\"*(header.length - 1)\n puts\n end", "title": "" }, { "docid": "1468ec63a808586173b7be5b882fa481", "score": "0.66871226", "text": "def show\n @list = List.find(params[:id)])\n @items = @list.items\n end", "title": "" }, { "docid": "277d504adc12aacb3ef21ec2994d2bdd", "score": "0.6678127", "text": "def print_list; end", "title": "" }, { "docid": "a73dc409228eec7d58e7c01fc4c800fb", "score": "0.6676119", "text": "def print_list\n print_list_config = active_scaffold_config.print_list\n if params[:print_list_columns].nil?\n print_list_columns = {}\n print_list_config.columns.each { |col|\n print_list_columns[col.name.to_sym] = 1\n }\n end\n options = {\n :print_list_columns => print_list_columns,\n :full_download => print_list_config.default_full_download.to_s,\n :font_size => print_list_config.font_size,\n :empty_field_text => print_list_config.empty_field_text,\n :maximum_rows => print_list_config.maximum_rows,\n :header_text => print_list_config.header_text\n }\n params.reverse_merge!(options)\n\n find_items_for_print_list\n\n respond_to do |type|\n type.html {\n render(:partial => 'print_list', :layout => false, :locals => { :print_list_config => active_scaffold_config.print_list })\n }\n type.pdf {\n prawnto :prawn => {}, :inline => false, :filename => @title + Time.now.to_datetime.strftime(\" %Y-%m-%d-%I-%M%p\") + '.pdf'\n @print_list_config = active_scaffold_config.print_list\n render :layout => false\n }\n end\n end", "title": "" }, { "docid": "963a4a864e962069e71e02aeca3fd2ec", "score": "0.665575", "text": "def show\n list\n end", "title": "" }, { "docid": "963a4a864e962069e71e02aeca3fd2ec", "score": "0.665575", "text": "def show\n list\n end", "title": "" }, { "docid": "9a5da7d076c3372e2b337012b609b2b7", "score": "0.6641888", "text": "def print_list\n header = \"#{@title} -- Completed: #{completed?}\"\n puts \"-\" * header.length\n puts header\n puts \"-\" * header.length\n longest_word = @items.inject(0) do |previous_length, current_word|\n current_length = current_word.description.length\n current_length > previous_length ? current_length : previous_length\n end\n @items.each_index {|index|\n puts \"#{index} - [#{items[index].priority}]#{@items[index].description}\".ljust(longest_word + 10) + \"Completed: #{@items[index].completion_status}\"\n }\n end", "title": "" }, { "docid": "d4a893ac27fa619223383b13f90f285e", "score": "0.6627407", "text": "def print_list(kind='all')\n puts \"#{name} list - #{kind} items.\"\n puts \"-\" * 30\n todo_items.each do |item|\n case kind\n when 'all'\n puts \"#{item}\"\n when 'complete'\n puts \"#{item}\" if item.complete?\n when 'imcomplete'\n puts \"#{item}\" if !item.complete?\n end\n puts \"\\n\"\n end\n end", "title": "" }, { "docid": "6adbe7115cf06513d09b71987012c4fc", "score": "0.66161203", "text": "def show_list\n system \"clear\"\n puts \"Nothing here!\\n\" if @@list == []\n @@list.each {|item|\n print item.name_obj + \" \" + item.poli_or_voter_obj + \" \"\n puts item.party_obj if item.poli_or_voter_obj == \"Politician\"\n puts item.affiliation_obj if item.poli_or_voter_obj == \"Voter\"\n }\n puts \"\\nWhen finished, press enter to return to the main menu\"\n gets\n system \"clear\"\n main_menu\n end", "title": "" }, { "docid": "682a02d8d8a9b65323350c8d8cf23e0c", "score": "0.65835094", "text": "def print_items\n puts \"#{@completion_status}#{@important} ~~~~ #{@description}\"\n end", "title": "" }, { "docid": "946fa032844bfe0d24496e857a7bf005", "score": "0.6565612", "text": "def print\n print_title\n\tprint_column_headers\n\tcount = 0\n @items.each do |item|\n count += 1\n item.print(count)\n end\n\tputs\n end", "title": "" }, { "docid": "5d02bf893faa9c3b013c59d5e6e9b82e", "score": "0.6556099", "text": "def print_list\r\n\tputs \"Current List:\"\r\n\t$list.each do |item, quantity|\r\n\t\tputs \"#{item}.......#{quantity}\"\r\n\tend\r\n\tputs \"--------------\"\r\nend", "title": "" }, { "docid": "a8d5929f91096666c81008f151da78e8", "score": "0.6552608", "text": "def print_list(include_finished_item = true)\n puts \"-------------\"\n puts @title\n puts \"-------------\"\n if [email protected]?\n print_array = include_finished_item ? @items : @items.select { |e| !e.item_completed? }\n longest_item_length = print_array.max_by{ |x| x.description.length }.description.length\n print_array.each do |item|\n puts item.print_item(@items.index(item)+1, longest_item_length)\n end\n else\n puts \"-- Nothing todo! --\"\n end\n end", "title": "" }, { "docid": "a8a3e6d3ab485de995c01098085007f9", "score": "0.6531516", "text": "def detailed_display\n puts \" Company: #{self.company}\"\n puts \" Position: #{self.title}\"\n puts \" Date Posted: #{self.date_posted}\"\n puts \" Website: #{self.url}\"\n end", "title": "" }, { "docid": "18dab0ef7ab86e23747d485ad2f1783b", "score": "0.65305156", "text": "def print_list(list)\n puts \"List: #{list['name']}\"\n print_seperator\n # format list output\n list['items'].each do |item|\n puts \"\\tItem: \" + item['name'] + \"\\t\\t\\t\" \\\n 'Quantity: ' + item['quantity'].to_s\n end\n print_seperator\nend", "title": "" }, { "docid": "a68abe93d278d80e14ac40fcbcb8e5b1", "score": "0.65256715", "text": "def print_list(list)\n puts \"List name: #{list['name']}\"\n print_separator()\n \n list['items'].each do |item|\n puts \"\\t\\t\\tItem: \" + item['name'] + \"\\t\\t\\tQuantity: \" + item['quantity'].to_s\n end\n \n print_separator()\nend", "title": "" }, { "docid": "216a26cbe38b81c6ae6be9ee17c774f9", "score": "0.65216416", "text": "def print\n @list.print\nend", "title": "" }, { "docid": "1be0c23bde46472d6ae6d0587056bfa9", "score": "0.6513345", "text": "def print_list(list)\n puts \"List: #{list['name']}\"\n print_separator()\n\n list[\"items\"].each do |item|\n puts \"\\tItem: \" + item['name'] + \"\\t\\t\\t\" +\n \"Quantity: \" + item['quantity'].to_s\n end\n\n print_separator()\nend", "title": "" }, { "docid": "f2b1fb6e1feffa30f36d540c0db8ee9d", "score": "0.6508177", "text": "def print_items\n if @items.empty?\n print NO_ITEMS_MESSAGE\n else\n print WARES_MESSAGE\n @items.each { |item| puts \"#{item.name} (#{item.price} gold)\" }\n print \"\\n\"\n end\n end", "title": "" }, { "docid": "c1396aa6e2ec5f1f7d6aa1db155836e3", "score": "0.6504876", "text": "def show\n\t\tputs \"\\nShopping list: \"\n list_products.each {|key, val| print key, \" \", val, \"$\\n\"} \n\tend", "title": "" }, { "docid": "80bf4d851b087e542279a15e679bf2fb", "score": "0.6501148", "text": "def print_lists(lists)\n puts \"%-20s%-12s%-12s%-12s%-12s%-12s\" % %w[\n name\n length\n f_page\n f_offset\n l_page\n l_offset\n ]\n\n lists.each do |name, list|\n puts \"%-20s%-12i%-12i%-12i%-12i%-12i\" % [\n name,\n list.base[:length],\n (list.base[:first] && list.base[:first][:page]) || 0,\n (list.base[:first] && list.base[:first][:offset]) || 0,\n (list.base[:last] && list.base[:last][:page]) || 0,\n (list.base[:last] && list.base[:last][:offset]) || 0,\n ]\n end\nend", "title": "" }, { "docid": "d076e8b3ad15c24e03748af87c1dda45", "score": "0.6482455", "text": "def all(options = {})\n puts \"-\" * @title.length\n puts @title.colorize(:color => :white, :background => :cyan)\n puts \"-\" * @title.length\n print_items = options.empty? ? @items : options\n print_items.each_with_index do |item, position|\n puts \"#{position + 1}) #{item.details}\"\n end\n end", "title": "" }, { "docid": "e98a5ec34a1662ce6d64dc3cf0a97af6", "score": "0.6475734", "text": "def print_list\n\tputs\"This is my grocery list for the week:\"\n\t $list.each do |item, quantity|\n\t\tputs \"#{item} : #{quantity}\"\n\tend\nend", "title": "" }, { "docid": "94fd189f6f5153236eee4a291649a9d7", "score": "0.6456179", "text": "def display()\r\n\t\t# puts 'The Name of the Item is : n'\r\n\t\t# puts 'The Price of the Item is : p'\r\n\t\t# puts 'The Quatity of the Item is : q'\r\n\t\[email protected] do |i|\r\n\t\t\tputs \"#{i}\"\r\n\t\tend\r\n\tend", "title": "" }, { "docid": "9e1c05bd7566059bc52dd7dc5b176768", "score": "0.6424835", "text": "def all\n Pathfinder::Item.print_table\n end", "title": "" }, { "docid": "71613494472235b04d81abad43d6ca2f", "score": "0.6419724", "text": "def show_list\n opts = {:layout => \"ems_storage\", :model => model}\n process_show_list(opts)\n end", "title": "" }, { "docid": "ec030bb1a7e2d8417a5e2478779ebe6f", "score": "0.6410408", "text": "def display_list\n @list.each do |item, quantity|\n puts \"Buy #{quantity} - #{item}\"\n end\n end", "title": "" }, { "docid": "35f76659e30fd93ad64bde040540334e", "score": "0.6388679", "text": "def display\n @items.each do |i|\n puts ' '\n puts \"| Invoice Item #: #{Invoice.count}\"\n print '| Product: ',\n i.product_name.capitalize.split.map(&:capitalize).join(' '), \\\n ' | Price: ', number_to_currency(i.sale_price), ' | Quantity: ',\n i.quantity, ' | Tax: ', i.tax_percentage, '%', \"\\n\"\n end\n end", "title": "" }, { "docid": "d3058e74265cb16ee13c5d070ca9f148", "score": "0.63806015", "text": "def get_items\r\n p @list\r\n end", "title": "" }, { "docid": "313040c2dba5514a11d5ee4f7865eb22", "score": "0.63792115", "text": "def show\n \t@items = Item.all\n end", "title": "" }, { "docid": "918ae11dc488f7c97b19dbb766d613c0", "score": "0.6369503", "text": "def print_user_lists\n print_user_name\n\n @lists.each_with_index do |list, index|\n puts \"#{index + 1}: Title: #{('\"' + list.title + '\"').ljust(15, \" \")} Nr. of tasks: #{list.items.length}\"\n end\n end", "title": "" }, { "docid": "31b82694dcf050380f12720e252eac60", "score": "0.63559324", "text": "def print_user_list_details(index)\n @lists[index - 1].print_items\n end", "title": "" }, { "docid": "01471e717095664f82b9bba12e5fdf69", "score": "0.63534755", "text": "def show\n @list = current_user.list\n @items = @list.items\n end", "title": "" }, { "docid": "32b226f0f1be8aad6dabd9460ca42185", "score": "0.63341933", "text": "def all\n storage.lists.each do |project|\n output \" #{project.name}\"\n project.items.each do |item|\n output \" #{item.short_name}:#{item.spacer} #{item.value}\"\n end\n end\n end", "title": "" }, { "docid": "9a936f073ec0738ef1cdce3df92a78af", "score": "0.63332844", "text": "def print_items\n @items.each do |item|\n puts item.name + \" (#{item.price} gold)\"\n end\n print \"\\n\"\n end", "title": "" }, { "docid": "ea9676120d13f24b3683511d3a484ab3", "score": "0.6319999", "text": "def show_students\n\tprint_header\n\tprint_student_list\n\tprint_footer\nend", "title": "" }, { "docid": "2dbc453886d3acd8b16072b0adb7c2b3", "score": "0.6301927", "text": "def displaylist(list)\n puts \"Dislpaying list\"\n puts \"===============\"\n list.each {\n \t|item|\n\t puts \"* #{item}\"\n }\n puts \"\"\nend", "title": "" }, { "docid": "3998e4799fd56b31147ee0f21983868d", "score": "0.6284157", "text": "def print_list(list)\r\n puts \"List Name: #{list['name']}\"\r\n print_seperator()\r\n \r\n list['items'].each do |item|\r\n puts \"\\tItem: \" + item['name'] + \"\\t\\t\\t\" + \r\n \"Quantity: \" + item['quantity']\r\n print_seperator()\r\n end #end do\r\n \r\nend", "title": "" }, { "docid": "1b9648a28f3b625d1f0ef27070ba5363", "score": "0.6282665", "text": "def show_students\n\tprint_header\n\tprint_students_list\n\tprint_footer\nend", "title": "" }, { "docid": "1b9648a28f3b625d1f0ef27070ba5363", "score": "0.6282665", "text": "def show_students\n\tprint_header\n\tprint_students_list\n\tprint_footer\nend", "title": "" }, { "docid": "de6d91d4dd8f87904dd67e60ea164d12", "score": "0.6274053", "text": "def show\n @list = current_user.list\n @items = current_user.list.items\n end", "title": "" }, { "docid": "d0fc208ac1ab8f28aeb734b497942a92", "score": "0.6273463", "text": "def list_inventory\n puts \"\\nInventory List\\n\"\n @inventory.each {|item| puts item.description}\n end", "title": "" }, { "docid": "84c85947e462ab1960bff5ce3e46b89e", "score": "0.6263605", "text": "def print\n puts \"-\" * LINE_WIDTH\n puts \" \" * 13 + @label.upcase\n puts \"-\" * LINE_WIDTH\n puts \"#{'Index'.ljust(INDEX_COL_WIDTH)} | #{'Item'.ljust(ITEM_COL_WIDTH)} | #{'Deadline'.ljust(DEADLINE_COL_WIDTH)}\"\n puts \"-\" * LINE_WIDTH\n @items.each_with_index do |item, i|\n puts \"#{i.to_s.ljust(INDEX_COL_WIDTH)} | #{item.title.ljust(ITEM_COL_WIDTH)} | #{item.deadline.ljust(DEADLINE_COL_WIDTH)}\"\n end\n puts \"-\" * LINE_WIDTH\n end", "title": "" }, { "docid": "7da97623ecaeb35848e1884a55a1915e", "score": "0.6254814", "text": "def print_items\n # printing title of the ToDo list\n print_formated_list_title\n\n # checking the current sort method\n @sort_by == \"time\" ? sort_tasks_by_time_creation : sort_tasks_by_priority\n\n # printing each task\n @items.each_with_index do |task, index|\n puts \"#{index + 1} - #{task.print_task}\"\n end\n end", "title": "" }, { "docid": "7c492b3b4bd1d74917e8c0bc5ee81bd5", "score": "0.6228656", "text": "def list\n details? ? render_detail_list : render_simple_list\n end", "title": "" }, { "docid": "13a35b1bf055de8b6110bfd4d4801e26", "score": "0.62209564", "text": "def show_students\n print_header\n print_students_list \n print_footer\nend", "title": "" }, { "docid": "df291a9f546929ad7cb598439362c4ec", "score": "0.62188214", "text": "def printList(list)\n list.each do |item|\n puts item\n end\n end", "title": "" }, { "docid": "ce8ed4125873b125d93feab126b21f31", "score": "0.6217483", "text": "def print_item_sets\n puts \"Item Sets\"\n\n @item_sets.flatten.each { |item_set| puts \"#{item_set}\" }\n end", "title": "" }, { "docid": "e9a50260d816cbe477da64b34ecbe180", "score": "0.6213102", "text": "def list(**options)\n result = @mpw.list(options)\n\n if result.empty?\n puts I18n.t('display.nothing')\n else\n table_items(result)\n end\n end", "title": "" }, { "docid": "8ac7f5e63321b19a05e7243601376259", "score": "0.62081754", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "24438f903b2e0c48aef07ad241ae27d8", "score": "0.6206153", "text": "def show_students\n print_header\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "7e6b64577923798bbe9f251679f4b1da", "score": "0.62052643", "text": "def print()\r\n\t\tputs \"The list of vectors is:\" \r\n\t\t@vec_list.each { |item| puts item}\r\n\tend", "title": "" }, { "docid": "0c865719108e480be9782821eb96da39", "score": "0.62016463", "text": "def show_main_list_print\n render 'main_list_print_view', layout: 'blank'\n end", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.6194437", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.6194437", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.6194437", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.6194437", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.6194437", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.6194437", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.6194437", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.6194437", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.6194437", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "da81a499c08171baef021d41119ea200", "score": "0.6194437", "text": "def show_students\n print_header\n print_student_list\n print_footer\nend", "title": "" }, { "docid": "4d24e41b35b165826d03443bccc05ce3", "score": "0.6194054", "text": "def show\n @list = current_user.list\n if @list \n @current_items_in_the_list = @list.items\n @item = Item.new\n end\n \n end", "title": "" }, { "docid": "51df7fc479d17a1ebc81b415a1236384", "score": "0.6190035", "text": "def all\n table_header_array = table_header(@title)\n table_body_array = table_body(@items)\n print_table(table_header_array, table_body_array)\n end", "title": "" }, { "docid": "a23e85731d90835d9df58bc834c1e4e6", "score": "0.6187649", "text": "def show_students\n print_header\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "a23e85731d90835d9df58bc834c1e4e6", "score": "0.6187649", "text": "def show_students\n print_header\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "a23e85731d90835d9df58bc834c1e4e6", "score": "0.6187649", "text": "def show_students\n print_header\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "a23e85731d90835d9df58bc834c1e4e6", "score": "0.6187649", "text": "def show_students\n print_header\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "a23e85731d90835d9df58bc834c1e4e6", "score": "0.6187649", "text": "def show_students\n print_header\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "a23e85731d90835d9df58bc834c1e4e6", "score": "0.6187649", "text": "def show_students\n print_header\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "a23e85731d90835d9df58bc834c1e4e6", "score": "0.6187649", "text": "def show_students\n print_header\n print_students_list\n print_footer\nend", "title": "" }, { "docid": "d6e7559751c90a2de69855337312dfda", "score": "0.6185985", "text": "def print_list(list) #method that talks to the user- displays data to user\n\tputs \"------------------\"\n\tputs \"Grocery List:\"\n\tlist.each do |food, quantity|\n\t\tputs \"#{quantity} #{food}\"\n\tend\n\tputs \"------------------\"\t\nend", "title": "" }, { "docid": "c67cc36962010a837262a3752b1e3a46", "score": "0.6184293", "text": "def show()\n main_handle.show_all\n end", "title": "" }, { "docid": "263c938b31af931894a39485fc0d0976", "score": "0.61763906", "text": "def display_each\n puts \" * #{self.name}: #{self.description}\"\n end", "title": "" }, { "docid": "00917f573e833ed574d14c57a3067483", "score": "0.61748326", "text": "def show_all\n \n end", "title": "" }, { "docid": "00917f573e833ed574d14c57a3067483", "score": "0.61748326", "text": "def show_all\n \n end", "title": "" }, { "docid": "04c9b781c6d6b06c09470a15f4eb2383", "score": "0.6173078", "text": "def display(type = 'all')\n @users.each_value do |u|\n puts \"#{u.name} items: \"\n u.list.items.each_value do |user_item|\n puts \"#{@items[user_item.id]}-#{user_item.rating}\"\n end\n puts\n end\n end", "title": "" }, { "docid": "e4ca2b002468870a9c0401dfa37184db", "score": "0.6156903", "text": "def lists_show(options = {})\n @req.get(\"/1.1/lists/show.json\", options)\n end", "title": "" } ]
fc86e84c51f2774d8a48659aca8bf97f
Autoevals a single command
[ { "docid": "729956df4ee5f39fcc3d6089bc2adcbc", "score": "0.64485395", "text": "def one_unknown_cmd(commands, input)\n unless Setting[:autoeval]\n return errmsg(\"Unknown command: \\\"#{input}\\\". Try \\\"help\\\"\")\n end\n\n commands.find { |c| c.is_a?(EvalCommand) }.execute\n end", "title": "" } ]
[ { "docid": "41ef2ecabed6ef29d736615ad59308eb", "score": "0.66232073", "text": "def method_missing(sym, *args, &block)\n shell.execute sym.to_s\n $last_res\n end", "title": "" }, { "docid": "b662333d3814d230618be3ed2a898f65", "score": "0.66096973", "text": "def run(command)\n `#{command}`\nend", "title": "" }, { "docid": "e4c1f1ead0abaa481cc1250a9fa03956", "score": "0.6562121", "text": "def mini_command(command)\n \nend", "title": "" }, { "docid": "f47dd20614b1854dce3fa60a5033647a", "score": "0.6535842", "text": "def call(*command); end", "title": "" }, { "docid": "01afe791b038df6fe06c893200332877", "score": "0.6485788", "text": "def find_and_refresh_command(name); end", "title": "" }, { "docid": "d4ec60bbc4da4c96096086e10a462c39", "score": "0.6466113", "text": "def cmd(cmd)\n puts cmd\n `#{cmd}`\n end", "title": "" }, { "docid": "93f0f779207eea185497392727c3eeb2", "score": "0.64137965", "text": "def load_command(command); end", "title": "" }, { "docid": "b46a7172acb5da26d826fd0a9d7c1b62", "score": "0.64043933", "text": "def exec(cmd)\n puts cmd\n puts `#{cmd}`\nend", "title": "" }, { "docid": "a85d776ecb06f0b29978a7ba0280c10c", "score": "0.6376974", "text": "def evaluate_string(command)\n eval(command)\n end", "title": "" }, { "docid": "05c872af91dfe175708e04bc7d1e50c6", "score": "0.6362476", "text": "def execute(cmd)\n end", "title": "" }, { "docid": "6c055804a1a21f50fb60dfcb7e2376e5", "score": "0.6360584", "text": "def run_cmd(cmd)\n end", "title": "" }, { "docid": "94a27ba48b2a22c80f6306ca2ddd86cf", "score": "0.633701", "text": "def run_command(val); end", "title": "" }, { "docid": "94a27ba48b2a22c80f6306ca2ddd86cf", "score": "0.633701", "text": "def run_command(val); end", "title": "" }, { "docid": "cf296642f7ad157d9513491c49eb3867", "score": "0.63289493", "text": "def capture_invoked(cmd)\n `#{cmd}`\n end", "title": "" }, { "docid": "bdffdbe333930ebcfb2b1acdee3cd611", "score": "0.63255364", "text": "def run(cmd)\n `#{cmd}`\n end", "title": "" }, { "docid": "5e07e8a55cfd65a135ee7b25ac83fe2c", "score": "0.6325061", "text": "def command(name); end", "title": "" }, { "docid": "14ff06d4334424a24c3b87b7833269b3", "score": "0.630963", "text": "def command!\n @command = true\n end", "title": "" }, { "docid": "5c5ebdca6aa67f954b6c2315828ff9ba", "score": "0.62978816", "text": "def run_command; end", "title": "" }, { "docid": "5c5ebdca6aa67f954b6c2315828ff9ba", "score": "0.62978816", "text": "def run_command; end", "title": "" }, { "docid": "75cde7d2d4ea2904949577fdd331ddec", "score": "0.62660307", "text": "def execute_command(command)\n %x{#{command}}\n end", "title": "" }, { "docid": "b550dfdb256780f296acb572d7f7d320", "score": "0.62180054", "text": "def run_command() ; info[:run_command] ; end", "title": "" }, { "docid": "b550dfdb256780f296acb572d7f7d320", "score": "0.62180054", "text": "def run_command() ; info[:run_command] ; end", "title": "" }, { "docid": "1b6cbf01a69fc9a2e6c3d5c79fa04dc4", "score": "0.62173045", "text": "def eval(line='')\n # Run all the sub replacements\n @subs.each do |sub|\n line.gsub!(sub[0], sub[1])\n end\n \n cmd, *args = Shellwords.shellsplit(line)\n return if !cmd or cmd.start_with?('#')\n \n # BUG\n # `echo '~'` prints \"/home/username\"\n # should print \"'~'\"\n args.each {|a| a.start_sub!('~', Dir.home)}\n \n begin\n # Try to call owned method first\n m = method(cmd)\n raise NameError unless m.owner == self.class or m.owner == self.singleton_class\n m.call(*args)\n rescue NameError\n # Otherwise execute the arguments\n exec(cmd, *args)\n end\n end", "title": "" }, { "docid": "8f6c30bb4cd07134514a6c8af3f8ca2d", "score": "0.62154895", "text": "def execute(cmd)\n\nend", "title": "" }, { "docid": "db17f1e76c67207e94eba2cb287a059e", "score": "0.6210813", "text": "def command!\n Vedeu.bind(:_command_) { |command| Vedeu.trigger(:command, command) }\n end", "title": "" }, { "docid": "45b2986027f2d1c42c3c744763fe4452", "score": "0.6186093", "text": "def ` (cmd)\n $commands << cmd\n system(':') # to set $?\n end", "title": "" }, { "docid": "bd877f99c9959d12f51a59f967ac7c45", "score": "0.61843365", "text": "def cmd(command, *arguments) Command.send(command.to_sym, *arguments) end", "title": "" }, { "docid": "bd877f99c9959d12f51a59f967ac7c45", "score": "0.61843365", "text": "def cmd(command, *arguments) Command.send(command.to_sym, *arguments) end", "title": "" }, { "docid": "419caec3c4c9250b536f553e421adaf5", "score": "0.61728615", "text": "def execute_command() \n\t\ttext = @command_editor.text\n\n\t\tif text =~ %r{%s/([^/]*)/([^/]*)/g}\n\t\t\[email protected]_substitute($1, $2)\n\t\telsif text =~ %r{/(.*)}\n\t\t\[email protected]($1)\n\t\telsif text =~ /:e (.*)/\n\t\t\tFile.open($1, \"r\") do |f|\n\t\t\t\[email protected] = f.read()\n\t\t\tend\n\t\telsif text =~ /:w (.*)/\n\t\t\tFile.open($1, \"w+\") do |f|\n\t\t\t\tf.write(@editor.text)\n\t\t\tend\n\t\telse\n\t\t\[email protected]_eval(@command_editor.text)\n\t\tend\n\t\[email protected]_focus()\n\tend", "title": "" }, { "docid": "b7cb9a02f399c836d9b8ad7715edfd46", "score": "0.6146327", "text": "def erl_eval(cmd, *pa)\n pa_str = pa.empty? ? \"\" : \"-pa #{pa.join(' ')}\"\n sh \"erl -noshell -pa #{pa_str} -eval '#{cmd}' -s init stop\"\nend", "title": "" }, { "docid": "1a38201af3df9a84537c276e1850a95c", "score": "0.61446714", "text": "def fetch_command(command); end", "title": "" }, { "docid": "1a38201af3df9a84537c276e1850a95c", "score": "0.61446714", "text": "def fetch_command(command); end", "title": "" }, { "docid": "acabe10a23a89dad38f396b53a8498b1", "score": "0.6141521", "text": "def original_run_command=(_arg0); end", "title": "" }, { "docid": "6aa0a7163b78b1ea86f5eeeaddba7ce0", "score": "0.61392564", "text": "def run(command)\n # ...\n end", "title": "" }, { "docid": "6aa0a7163b78b1ea86f5eeeaddba7ce0", "score": "0.61392564", "text": "def run(command)\n # ...\n end", "title": "" }, { "docid": "a20ade2e6dd2af218f6c172981b4dff9", "score": "0.6134653", "text": "def execute(command)\n Kicker::Utils.execute(command)\n end", "title": "" }, { "docid": "b5fcef1d5b64d749cf98f1aace247c97", "score": "0.6129848", "text": "def cmd(cmd, *args)\n args.compact!\n args = args.collect! {|arg| arg[0] == ?- ? arg : quote(arg) }\n args.unshift(cmd)\n eval(CMD, binding, __FILE__, CMD_LINE)\n nil\nend", "title": "" }, { "docid": "00ec71cf77ba0a1ed84a732cec5505f4", "score": "0.61282915", "text": "def literal(cmd)\n end", "title": "" }, { "docid": "15f8850670bc2299ecd9e5c80c89da30", "score": "0.6119582", "text": "def execute\n exec @command\n end", "title": "" }, { "docid": "40f2a2ed3ee89b504a1343354515e5a7", "score": "0.61004585", "text": "def original_run_command; end", "title": "" }, { "docid": "182bd1bd268e3e81ed7154f1349c9a65", "score": "0.60822755", "text": "def define_commands(&block)\n instance_eval(&block)\n end", "title": "" }, { "docid": "a48a5567c98d1013a93565095550a987", "score": "0.60763764", "text": "def do_command(cmd)\n\t`amulecmd -c \"#{cmd}\" -P fil259874`\n end", "title": "" }, { "docid": "14fd14177f02ba23486adf96e57a3d1d", "score": "0.6068275", "text": "def run cmd; return `#{cmd}`.to_s end", "title": "" }, { "docid": "0121be76224458aec12e80c461d728cf", "score": "0.60662115", "text": "def commandify(command)\n return \"Command not found\" unless (cmd = Boson::Command.find(command))\n cmd.make_option_command\n Boson::Scientist.redefine_command Boson.main_object, cmd\n end", "title": "" }, { "docid": "6b18de82570d65332dfa3f6bc9e3c342", "score": "0.606379", "text": "def run_auto_cmds(run_level); end", "title": "" }, { "docid": "1a9adc75a3d355507a4486cc07a38983", "score": "0.6045281", "text": "def add_command(command); end", "title": "" }, { "docid": "1a9adc75a3d355507a4486cc07a38983", "score": "0.6045281", "text": "def add_command(command); end", "title": "" }, { "docid": "2de264d0dbabaa5d2d98c185f755b238", "score": "0.6043156", "text": "def execute\n puts \"Sed command:\"\n puts command_text\n `#{command_text}`\n end", "title": "" }, { "docid": "6b13f3b8c107a3c3292d7878bd268267", "score": "0.6038703", "text": "def run_command\n \"-c '#{@command}'\"\n end", "title": "" }, { "docid": "385feee6ce7f3c55a56305efb686c113", "score": "0.59996325", "text": "def loop_eval(input)\n if (@buffer.nil? && input =~ PATTERN)\n command = input[1..-1]\n name, arguments = ShellCommands.parse(command)\n\n unless BLACKLIST.include?(name)\n if BUILTIN.include?(name)\n arguments ||= []\n\n return ShellCommands.send(name,*arguments)\n elsif EXECUTABLES[name]\n return ShellCommands.exec(name,*arguments)\n end\n end\n end\n\n super(input)\n end", "title": "" }, { "docid": "9be2f8fd1319de0311bbb1d849ffcc8f", "score": "0.59909433", "text": "def run_command\n end", "title": "" }, { "docid": "36323cbfe8d58d212ef19906be43bbdf", "score": "0.598869", "text": "def command=(_arg0); end", "title": "" }, { "docid": "488128a7079c449a14da6b0151196e78", "score": "0.5985187", "text": "def run_command(val, eval_string = \"\", target = binding_stack.last)\n commands.process_line(val,\n :eval_string => eval_string,\n :target => target,\n :pry_instance => self,\n :output => output\n )\n Pry::Command::VOID_VALUE\n end", "title": "" }, { "docid": "a66694a77d63939e09f93e275a6c1962", "score": "0.59785616", "text": "def command cmd\n %x{ bash -c \"#{ cmd }\" }\nend", "title": "" }, { "docid": "b279aee2ad97e14c6d4308ba6a687c53", "score": "0.5972587", "text": "def command(name)\n self.class.command(name)\n end", "title": "" }, { "docid": "4e9945bf27835ec54db640d2800c5466", "score": "0.5960306", "text": "def exec; end", "title": "" }, { "docid": "4e9945bf27835ec54db640d2800c5466", "score": "0.5960306", "text": "def exec; end", "title": "" }, { "docid": "04b776fd71a982f36bc21102e6ab1045", "score": "0.59581035", "text": "def run cmd\n puts \"\\n$ #{cmd}\\n\"\n result = `#{cmd}`\n puts result\n result\nend", "title": "" }, { "docid": "7b602fc073f437fa02c33521d8c46663", "score": "0.5956466", "text": "def make_exec\n\t\tupdate_attribute(:exec, true)\n\tend", "title": "" }, { "docid": "61e401ae7ceeb2bb8976b4d8afcc166d", "score": "0.59446174", "text": "def doCmd(cmd)\n puts cmd;\n result = `#{cmd}`;\n return result;\nend", "title": "" }, { "docid": "c870c413c744adbd28f69f6703895891", "score": "0.59442437", "text": "def execute(command)\n send command\n end", "title": "" }, { "docid": "198331efa86809435e701eecd3694d67", "score": "0.593832", "text": "def call\n @content.gsub(operations) do |command|\n cmd = '@' + command.tr('{} ', '')\n next if eval(cmd.split('.').first).nil? # soft replace\n eval(cmd)\n end\n end", "title": "" }, { "docid": "cde9dfd683d1abc1b03cb9a6f29195b9", "score": "0.59283185", "text": "def execute(cmd)\n cmd.unshift @fpm\n cmd.push '2>/dev/null' unless ENV['VERBOSE'] && ENV['VERBOSE'] != '0'\n return eval `#{cmd.join(' ')}`# \n end", "title": "" }, { "docid": "5cc726832c2b5161e95aab4b47ce5fb2", "score": "0.5926143", "text": "def run_cmd(cmd)\n\t\tconsole.run_single(cmd)\n\tend", "title": "" }, { "docid": "b95b33bd54d8f066afcd7ea523d5cb6e", "score": "0.59214664", "text": "def fire\n system @command\n end", "title": "" }, { "docid": "098cb481b07bd69ffe93652078b9963c", "score": "0.5921315", "text": "def raw_command(commandline)\r\n @actions = [\" commandline \"]\r\n end", "title": "" }, { "docid": "518dbe040fdf2bd747b72e32199a2ded", "score": "0.59111494", "text": "def cmd_gorunning\n self.sendCommand('a')\n end", "title": "" }, { "docid": "cbafa1468bc3de01a0d65141d6b2ded8", "score": "0.59076214", "text": "def evalAvailableCommands\r\n @availableCommands = Array.new\r\n @commands.each{ |name,cmd|\r\n @availableCommands << name if eval( cmd.prerequisite )\r\n }\r\n end", "title": "" }, { "docid": "1bb5a94501f8a2679eec6f2f75af560c", "score": "0.5902803", "text": "def rt\n rl\n eval(choose_last_command)\nend", "title": "" }, { "docid": "1bb5a94501f8a2679eec6f2f75af560c", "score": "0.5902803", "text": "def rt\n rl\n eval(choose_last_command)\nend", "title": "" }, { "docid": "1fa94535a7bee10f5a30b2251d0512e9", "score": "0.589142", "text": "def execute_command(cmd)\n puts \"Executing: #{cmd}}\"\n %x[#{cmd}]\n puts $?.success?\n end", "title": "" }, { "docid": "7735c17137f39086f61c96921cd70c81", "score": "0.587569", "text": "def run\n if options[:command].present?\n evaluate options[:command].join(' ')\n return\n end\n welcome\n repl = lambda do |prompt|\n print prompt\n evaluate( STDIN.gets.chomp! )\n end\n loop { break unless repl[prompt] }\n end", "title": "" }, { "docid": "5bb127a59dc5ca1427067402b7b59603", "score": "0.5873582", "text": "def generate\n\t\tcommand = self.get_command\n\t\t`#{command}`\n\tend", "title": "" }, { "docid": "97bbcf4c85c9fd55a14d157372427541", "score": "0.5863843", "text": "def lexe(cmd)\n puts \"executing [local]: #{cmd}\"\n puts \"-----\"\n out = `#{cmd}`\n puts out\n puts\n out\n end", "title": "" }, { "docid": "87385c5487e965b184775375b7f2e470", "score": "0.58634967", "text": "def command(name)\n commands[name]\n end", "title": "" }, { "docid": "7d8886dc3b75054ac3016df334142294", "score": "0.5863466", "text": "def run_command\n\t\t\tCommand.send(@command)\n\t\tend", "title": "" }, { "docid": "758f54967f0e514a58080cc6d139df07", "score": "0.58449537", "text": "def execute(cmd)\n res = eval(cmd, @pure_binding)\n $last_res = res\n eval(\"_ = $last_res\", @pure_binding)\n print_result res\n rescue ::Exception => e\n puts \"Exception #{e.class} -> #{e.message}\"\n e.backtrace.each do |t|\n puts \" #{::File.expand_path(t)}\"\n end\n end", "title": "" }, { "docid": "758f54967f0e514a58080cc6d139df07", "score": "0.58449537", "text": "def execute(cmd)\n res = eval(cmd, @pure_binding)\n $last_res = res\n eval(\"_ = $last_res\", @pure_binding)\n print_result res\n rescue ::Exception => e\n puts \"Exception #{e.class} -> #{e.message}\"\n e.backtrace.each do |t|\n puts \" #{::File.expand_path(t)}\"\n end\n end", "title": "" }, { "docid": "536daf77634c45c5b881f4eec726c88b", "score": "0.58434826", "text": "def run(cmd)\n _run(self.send(cmd.to_sym),cmd)\n nil\n end", "title": "" }, { "docid": "1e8aee81cbc9d7d06b9be57555f8e275", "score": "0.583358", "text": "def exec(cmd)\n\t\tsplitted = cmd.split(\" \")\n\n\t\tif splitted.length > 1\n\t\t\tself.send(splitted[0], splitted[1..(splitted.length - 1)])\n\t\telse\n\t\t\tself.send(cmd)\n\t\tend\n\tend", "title": "" }, { "docid": "9166a746440010118d287a9dfb0769fb", "score": "0.5832568", "text": "def execute(command)\n system \"#{ command }\"\nend", "title": "" }, { "docid": "9ca03e7b93f25f2d9f9e27b434c17a5d", "score": "0.58274615", "text": "def exec(command) # rubocop:disable Lint/UnusedMethodArgument\n cache_flush if cache_auto?\n # to be implemented by subclasses\n end", "title": "" }, { "docid": "c8c4dbd31dff9dbc37fae844f95ee2fb", "score": "0.5822848", "text": "def run(command)\n commands << command if command != ''\n end", "title": "" }, { "docid": "b1f39cbbb796435a49b5a2e8c80a157e", "score": "0.5811416", "text": "def command(name, &block)\n cmd = Excavator.runner.last_command\n cmd.name = name\n cmd.block = block\n Excavator.runner.current_namespace << cmd\n Excavator.runner.clear_last_command!\n cmd\n end", "title": "" }, { "docid": "2b12f915e0d4417e90af4b4c1dfd47dc", "score": "0.5811338", "text": "def command; end", "title": "" }, { "docid": "2b12f915e0d4417e90af4b4c1dfd47dc", "score": "0.5811338", "text": "def command; end", "title": "" }, { "docid": "2b12f915e0d4417e90af4b4c1dfd47dc", "score": "0.5811338", "text": "def command; end", "title": "" }, { "docid": "2b12f915e0d4417e90af4b4c1dfd47dc", "score": "0.5811338", "text": "def command; end", "title": "" }, { "docid": "2b12f915e0d4417e90af4b4c1dfd47dc", "score": "0.5811338", "text": "def command; end", "title": "" }, { "docid": "2b12f915e0d4417e90af4b4c1dfd47dc", "score": "0.5811338", "text": "def command; end", "title": "" }, { "docid": "2b12f915e0d4417e90af4b4c1dfd47dc", "score": "0.5811338", "text": "def command; end", "title": "" }, { "docid": "2b12f915e0d4417e90af4b4c1dfd47dc", "score": "0.5811338", "text": "def command; end", "title": "" }, { "docid": "2b12f915e0d4417e90af4b4c1dfd47dc", "score": "0.5811338", "text": "def command; end", "title": "" }, { "docid": "2b12f915e0d4417e90af4b4c1dfd47dc", "score": "0.5811338", "text": "def command; end", "title": "" }, { "docid": "57026b3a6e851cbb3d9d3dae72cf17ab", "score": "0.57947135", "text": "def execute_command(cmd)\r\n old_cmd = command_line\r\n execute_command! cmd\r\n @command_win.set old_cmd\r\n end", "title": "" }, { "docid": "87f75c747391aaf2ae3e97a5fbeab237", "score": "0.5782525", "text": "def run(cmd,genv,autodelete=true)\n cmd_runner=CommandRunner.new(genv)\n cmd_runner.run_local(cmd)\n end", "title": "" }, { "docid": "eca403856c5e637136bf14ffad12dd13", "score": "0.57774377", "text": "def shell(cmd)\n `#{cmd}`\n end", "title": "" }, { "docid": "03ad8af2c6803fdaa62b7c38f9ffd4c0", "score": "0.5776737", "text": "def run_active_command\n require_valid_command\n if alias? command_name_from_args\n active_command.run *(@aliases[command_name_from_args.to_s] + args_without_command_name)\n else\n active_command.run *args_without_command_name\n end \n end", "title": "" }, { "docid": "4dbc089d9f2d40d2fb4952df32ad56d5", "score": "0.576951", "text": "def console(command = \"\")\n \n identified = false\n allow_eval_code = false\n if command.include?(\"RPG::Global\")\n command = command.split(\">>\")\n prefix = \"$\"\n identified = true\n elsif command.include?(\"PONY::Eval\")\n command = command.split(\">>\")\n prefix = \"\"\n identified = true\n allow_eval_code = true\n else\n command = command.split(\":\")\n prefix = \"GameManager.\"\n identified = true\n end\n \n execute_command = command[1]\n \n if execute_command.nil? || !identified\n info = \"No command input!\"\n elsif execute_command.include?(\"$\") && !allow_eval_code\n info = \"Invailed command!\"\n else\n executable = false\n for method in GameManager.singleton_methods\n executable = true if command[1].split('(').at(0) == method.to_s\n end\n \n if executable && !allow_eval_code\n values = command[1].tr('()','')\n executable = values.split(',').size < 3\n end\n \n if executable || allow_eval_code\n execute_command = prefix + execute_command\n info = \"success! #{execute_command}\"\n begin\n puts \"Eval: #{execute_command}\"\n eval(execute_command)\n rescue Exception => e\n info = e\n puts e.backtrace\n end\n else\n info = \"Invailed command!\"\n end\n end\n \n info = info.to_s\n info = info.match(\"success\") ? \"Info: \" + info : \"Error: \" + info\n SceneManager.display_info(info)\n end", "title": "" }, { "docid": "62da24e832fa2b6d4d1515c9cb21c6d7", "score": "0.576921", "text": "def run_cmd(input); end", "title": "" } ]
ce9dc9e5bc6d2df548245f71af52f6fe
[Array[ Word ]] the elements of this array source://syntax_tree//lib/syntax_tree/node.rb12081
[ { "docid": "050bea5ca1589e87b5597c3bf130ba26", "score": "0.0", "text": "def elements; end", "title": "" } ]
[ { "docid": "1c4294d3a167c5d54ac0d3b31e936b90", "score": "0.7565118", "text": "def visit_words(node)\n visit_array(\n ArrayLiteral.new(\n lbracket: node.beginning,\n contents: Args.new(parts: node.elements, location: node.location),\n location: node.location\n )\n )\n end", "title": "" }, { "docid": "a2307fda8f8d5f2a0aed38a8e9c9ce0f", "score": "0.6796317", "text": "def visit_words(node); end", "title": "" }, { "docid": "db5eb931ecc11887d7db64027d874676", "score": "0.6794463", "text": "def visit_qwords(node)\n visit_array(\n ArrayLiteral.new(\n lbracket: node.beginning,\n contents: Args.new(parts: node.elements, location: node.location),\n location: node.location\n )\n )\n end", "title": "" }, { "docid": "39b71722c05034b9c7a0f225f1d4cfd6", "score": "0.6521082", "text": "def word_array\t\t\n\t\t @word_array\n\tend", "title": "" }, { "docid": "4451948906974f056d8dd7fe5704a422", "score": "0.6490015", "text": "def visit_word(node); end", "title": "" }, { "docid": "f664edcf746e93ba6c256e23fbb5fd28", "score": "0.64083284", "text": "def getWord_array\n @@word_array\n end", "title": "" }, { "docid": "0e11d5c9fc2e284e87eff5f60053f457", "score": "0.6385324", "text": "def subtree\n descendant_array = []\n PyCall::List.(@py_token.subtree).each do |descendant|\n descendant_array << Token.new(descendant)\n end\n descendant_array\n end", "title": "" }, { "docid": "96bdfcaa6ee6a4ea5312dc7f909387d2", "score": "0.6366772", "text": "def semantic_tokens; end", "title": "" }, { "docid": "663d635ea51d6be5935a7d5770ed6a69", "score": "0.6353459", "text": "def array\n node.array\n end", "title": "" }, { "docid": "7e2e9da64fcc92c0c4abe6e0bc9b6505", "score": "0.63351953", "text": "def parse_array\r\n get_tk\r\n array_expr = ArrayExpression.new(@tk.line_no,@tk.char_no)\r\n skip_white_space\r\n array_expr.elements << parse_expression\r\n skip_white_space\r\n while @tk.is_a?(RDoc::RubyToken::TkCOMMA) do\r\n get_tk\r\n array_expr.elements << parse_expression\r\n skip_white_space\r\n end\r\n unless @tk.is_a?(RDoc::RubyToken::TkRBRACK)\r\n parse_error(@tk,\"']' expected but '#{@tk.text}' found\")\r\n end\r\n get_tk\r\n array_expr\r\n end", "title": "" }, { "docid": "fe9437b3eac615b406756f9856945a42", "score": "0.62025577", "text": "def visit_array(node); end", "title": "" }, { "docid": "0692f15063c583d43412600a2ab44cfe", "score": "0.61768526", "text": "def subtree\n subtree_array = []\n PyCall::List.(@py_span.subtree).each do |py_subtree|\n subtree_array << Token.new(py_subtree)\n end\n subtree_array\n end", "title": "" }, { "docid": "7190660c14bf83660fd129ad825a31c5", "score": "0.61315584", "text": "def visit_words_beg(node); end", "title": "" }, { "docid": "d2b61636176ac9a960cd79552da9765d", "score": "0.6111499", "text": "def Words(beginning, elements); end", "title": "" }, { "docid": "81a6ee4b0c3fb872a1108a559f5a1dd0", "score": "0.6069017", "text": "def as node\n map { |s| [node, s] }\n end", "title": "" }, { "docid": "2c2e402b804ebdd69ba68226b704bff9", "score": "0.60378385", "text": "def visit_array(node)\n s(\n :array,\n node.contents ? visit_all(node.contents.parts) : [],\n if node.lbracket.nil?\n smap_collection_bare(srange_node(node))\n else\n smap_collection(\n srange_node(node.lbracket),\n srange_length(node.end_char, -1),\n srange_node(node)\n )\n end\n )\n end", "title": "" }, { "docid": "4d78a32340b52803cf965f57d9a65748", "score": "0.6016961", "text": "def atoms\n terms.map(&:atom)\n end", "title": "" }, { "docid": "b85c4775707a8cf9d2049e78268e754a", "score": "0.60053974", "text": "def words(node)\r\n texts(node).flatten.compact.map{|e|e.gsub(/\\s+/,' ').strip}.reject{|e| e.blank?}\r\n end", "title": "" }, { "docid": "c26ce3d900a8210bd8b744ac71e6a6a6", "score": "0.599939", "text": "def ast_node_ids; end", "title": "" }, { "docid": "c26ce3d900a8210bd8b744ac71e6a6a6", "score": "0.599939", "text": "def ast_node_ids; end", "title": "" }, { "docid": "94b365d49f0df12a1d17a2f83c2b6b32", "score": "0.5984092", "text": "def synonyms\n ary = Array.new\n if de_line = fetch('DE') then\n line = de_line.sub(/\\[.*\\]/,'') # ignore stuff between [ and ]. That's the \"contains\" part\n line.scan(/\\([^)]+/) do |synonym| \n unless synonym =~ /fragment/i then \n ary << synonym[1..-1].strip # index to remove the leading ( \n end\n end\n end\n return ary\n end", "title": "" }, { "docid": "94b365d49f0df12a1d17a2f83c2b6b32", "score": "0.5984092", "text": "def synonyms\n ary = Array.new\n if de_line = fetch('DE') then\n line = de_line.sub(/\\[.*\\]/,'') # ignore stuff between [ and ]. That's the \"contains\" part\n line.scan(/\\([^)]+/) do |synonym| \n unless synonym =~ /fragment/i then \n ary << synonym[1..-1].strip # index to remove the leading ( \n end\n end\n end\n return ary\n end", "title": "" }, { "docid": "135d74c5d7e60529e263b77a7a4467d4", "score": "0.59766155", "text": "def array\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 40 )\n return_value = ArrayReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal174 = nil\n char_literal175 = nil\n __COMMA176__ = nil\n char_literal177 = nil\n char_literal178 = nil\n char_literal179 = nil\n ex1 = nil\n ex2 = nil\n\n tree_for_char_literal174 = nil\n tree_for_char_literal175 = nil\n tree_for_COMMA176 = nil\n tree_for_char_literal177 = nil\n tree_for_char_literal178 = nil\n tree_for_char_literal179 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 299:4: '[' ( ( '\\\\n' )? ex1= expression ( COMMA ( '\\\\n' )? ex2= expression )* )? ( '\\\\n' )? ']'\n char_literal174 = match( T__67, TOKENS_FOLLOWING_T__67_IN_array_1690 )\n\n tree_for_char_literal174 = @adaptor.create_with_payload( char_literal174 )\n @adaptor.add_child( root_0, tree_for_char_literal174 )\n\n # --> action\n return_value.result = []\n # <-- action\n # at line 300:3: ( ( '\\\\n' )? ex1= expression ( COMMA ( '\\\\n' )? ex2= expression )* )?\n alt_40 = 2\n look_40_0 = @input.peek( 1 )\n\n if ( look_40_0 == T__66 )\n look_40_1 = @input.peek( 2 )\n\n if ( look_40_1 == READ || look_40_1.between?( PLUS, INT ) || look_40_1 == LB || look_40_1 == ID || look_40_1 == NOT || look_40_1.between?( OPENFILE, ALLOC ) || look_40_1 == STRING || look_40_1 == T__67 )\n alt_40 = 1\n end\n elsif ( look_40_0 == READ || look_40_0.between?( PLUS, INT ) || look_40_0 == LB || look_40_0 == ID || look_40_0 == NOT || look_40_0.between?( OPENFILE, ALLOC ) || look_40_0 == STRING || look_40_0 == T__67 )\n alt_40 = 1\n end\n case alt_40\n when 1\n # at line 300:4: ( '\\\\n' )? ex1= expression ( COMMA ( '\\\\n' )? ex2= expression )*\n # at line 300:4: ( '\\\\n' )?\n alt_37 = 2\n look_37_0 = @input.peek( 1 )\n\n if ( look_37_0 == T__66 )\n alt_37 = 1\n end\n case alt_37\n when 1\n # at line 300:4: '\\\\n'\n char_literal175 = match( T__66, TOKENS_FOLLOWING_T__66_IN_array_1697 )\n\n tree_for_char_literal175 = @adaptor.create_with_payload( char_literal175 )\n @adaptor.add_child( root_0, tree_for_char_literal175 )\n\n\n end\n @state.following.push( TOKENS_FOLLOWING_expression_IN_array_1702 )\n ex1 = expression\n @state.following.pop\n @adaptor.add_child( root_0, ex1.tree )\n # --> action\n return_value.result << ( ex1.nil? ? nil : ex1.result )\n # <-- action\n # at line 301:3: ( COMMA ( '\\\\n' )? ex2= expression )*\n while true # decision 39\n alt_39 = 2\n look_39_0 = @input.peek( 1 )\n\n if ( look_39_0 == COMMA )\n alt_39 = 1\n\n end\n case alt_39\n when 1\n # at line 301:4: COMMA ( '\\\\n' )? ex2= expression\n __COMMA176__ = match( COMMA, TOKENS_FOLLOWING_COMMA_IN_array_1709 )\n\n tree_for_COMMA176 = @adaptor.create_with_payload( __COMMA176__ )\n @adaptor.add_child( root_0, tree_for_COMMA176 )\n\n # at line 301:10: ( '\\\\n' )?\n alt_38 = 2\n look_38_0 = @input.peek( 1 )\n\n if ( look_38_0 == T__66 )\n alt_38 = 1\n end\n case alt_38\n when 1\n # at line 301:10: '\\\\n'\n char_literal177 = match( T__66, TOKENS_FOLLOWING_T__66_IN_array_1711 )\n\n tree_for_char_literal177 = @adaptor.create_with_payload( char_literal177 )\n @adaptor.add_child( root_0, tree_for_char_literal177 )\n\n\n end\n @state.following.push( TOKENS_FOLLOWING_expression_IN_array_1716 )\n ex2 = expression\n @state.following.pop\n @adaptor.add_child( root_0, ex2.tree )\n # --> action\n return_value.result << ( ex2.nil? ? nil : ex2.result )\n # <-- action\n\n else\n break # out of loop for decision 39\n end\n end # loop for decision 39\n\n end\n # at line 302:3: ( '\\\\n' )?\n alt_41 = 2\n look_41_0 = @input.peek( 1 )\n\n if ( look_41_0 == T__66 )\n alt_41 = 1\n end\n case alt_41\n when 1\n # at line 302:3: '\\\\n'\n char_literal178 = match( T__66, TOKENS_FOLLOWING_T__66_IN_array_1727 )\n\n tree_for_char_literal178 = @adaptor.create_with_payload( char_literal178 )\n @adaptor.add_child( root_0, tree_for_char_literal178 )\n\n\n end\n char_literal179 = match( T__68, TOKENS_FOLLOWING_T__68_IN_array_1730 )\n\n tree_for_char_literal179 = @adaptor.create_with_payload( char_literal179 )\n @adaptor.add_child( root_0, tree_for_char_literal179 )\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 40 )\n\n end\n \n return return_value\n end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "28006bdb0fcb628b45d690f4ec94756f", "score": "0.5965955", "text": "def tokens; end", "title": "" }, { "docid": "3ffd2f5baff0993e72c36c880194adc9", "score": "0.5964688", "text": "def visit_words(node)\n node.copy(\n beginning: visit(node.beginning),\n elements: visit_all(node.elements)\n )\n end", "title": "" }, { "docid": "fec98f1da4e29b2176e25298d7b72e8e", "score": "0.59553623", "text": "def visit_array(node)\n node.copy(\n lbracket: visit(node.lbracket),\n contents: visit(node.contents)\n )\n end", "title": "" }, { "docid": "5abff262feaa2af58086335afcbd2d92", "score": "0.593783", "text": "def words\n\t\t(0...self.length).to_a.collect do |i|\n\t\t\tself.word( i )\n\t\tend\n\tend", "title": "" }, { "docid": "beb233ae069f71a272395da53385c2cb", "score": "0.59342945", "text": "def nodes \n elements + arrays\n end", "title": "" }, { "docid": "399261e5da8acb3008645f6895d1bcf2", "score": "0.59071785", "text": "def words\n [\n [\"basketball\", \"a game with a hoop\"], \n [\"calisthenics\", \"graceful body movements\"], \n [\"cricket\", \"a game not a bug\"], \n [\"ballet\", \"body making lines to music\"], \n [\"running\", \"rapid feet, not a car\"], \n [\"yoga\", \"bendy\"], \n ]\n end", "title": "" }, { "docid": "904894e37d562655ecc7ca8fa934b29e", "score": "0.59026104", "text": "def query(word)\n node = @the_node\n\n word.split('').each do |letter|\n next_node = node[letter]\n return [] if next_node.nil?\n\n node = next_node\n end\n\n Enumerator.new do |result|\n result << Word.new(word, node.final).to_s if node.final\n get_childs(node).each do |s|\n current_word = (Word.new(word) + s)\n result << current_word.to_s if current_word.final\n end\n end\n end", "title": "" }, { "docid": "1a9e2d7e7908b059559428cb4e97b55d", "score": "0.5901154", "text": "def array_values\n case sexp_type\n when :array\n if nil == self[1] || %i[words_new qwords_new symbols_new qsymbols_new].include?(self[1].sexp_type)\n []\n elsif %i[words_add qwords_add symbols_add qsymbols_add].include? self[1].sexp_type\n self[1].array_values\n else\n arguments.all\n end\n when :words_add, :qwords_add, :symbols_add, :qsymbols_add\n values = []\n node = self\n while true\n if %i[words_add qwords_add symbols_add qsymbols_add].include? node.sexp_type\n values.unshift node[2]\n node = node[1]\n elsif %i[words_new qwords_new symbols_new qsymbols_new].include? node.sexp_type\n break\n end\n end\n values\n else\n []\n end\n end", "title": "" }, { "docid": "6a1ae8f2a2abcd23f60f979be8e3e05b", "score": "0.5882022", "text": "def visit_word(node)\n node.copy(parts: visit_all(node.parts))\n end", "title": "" }, { "docid": "86a0cd430d5f6326e7c87977ba2c518e", "score": "0.5847285", "text": "def texts(node)\r\n text_process(node,Array) do |e| texts(e) end\r\n end", "title": "" }, { "docid": "4db95f4da4be00381b316ffe0283b84a", "score": "0.58411324", "text": "def node_array(node_info_array)\n node_info_array.map { |n| n.name }\n end", "title": "" }, { "docid": "4f513f803809bf7760d5c8f01b6833fc", "score": "0.58407706", "text": "def array\n # -> uncomment the next line to manually enable rule tracing\n # trace_in( __method__, 33 )\n return_value = ArrayReturnValue.new\n\n # $rule.start = the first token seen before matching\n return_value.start = @input.look\n\n root_0 = nil\n char_literal146 = nil\n __COMMA147__ = nil\n char_literal148 = nil\n ex1 = nil\n ex2 = nil\n\n tree_for_char_literal146 = nil\n tree_for_COMMA147 = nil\n tree_for_char_literal148 = nil\n\n begin\n root_0 = @adaptor.create_flat_list\n\n\n # at line 249:4: '[' (ex1= expression ( COMMA ex2= expression )* )? ']'\n char_literal146 = match( T__64, TOKENS_FOLLOWING_T__64_IN_array_1487 )\n\n tree_for_char_literal146 = @adaptor.create_with_payload( char_literal146 )\n @adaptor.add_child( root_0, tree_for_char_literal146 )\n\n # --> action\n return_value.result = []\n # <-- action\n # at line 250:3: (ex1= expression ( COMMA ex2= expression )* )?\n alt_40 = 2\n look_40_0 = @input.peek( 1 )\n\n if ( look_40_0 == READ || look_40_0 == LB || look_40_0.between?( PLUS, INT ) || look_40_0 == ID || look_40_0.between?( TO_INT, NEW ) || look_40_0 == STRING || look_40_0 == T__64 )\n alt_40 = 1\n end\n case alt_40\n when 1\n # at line 250:4: ex1= expression ( COMMA ex2= expression )*\n @state.following.push( TOKENS_FOLLOWING_expression_IN_array_1496 )\n ex1 = expression\n @state.following.pop\n @adaptor.add_child( root_0, ex1.tree )\n # --> action\n return_value.result << ( ex1.nil? ? nil : ex1.result )\n # <-- action\n # at line 251:3: ( COMMA ex2= expression )*\n while true # decision 39\n alt_39 = 2\n look_39_0 = @input.peek( 1 )\n\n if ( look_39_0 == COMMA )\n alt_39 = 1\n\n end\n case alt_39\n when 1\n # at line 251:4: COMMA ex2= expression\n __COMMA147__ = match( COMMA, TOKENS_FOLLOWING_COMMA_IN_array_1503 )\n\n tree_for_COMMA147 = @adaptor.create_with_payload( __COMMA147__ )\n @adaptor.add_child( root_0, tree_for_COMMA147 )\n\n @state.following.push( TOKENS_FOLLOWING_expression_IN_array_1507 )\n ex2 = expression\n @state.following.pop\n @adaptor.add_child( root_0, ex2.tree )\n # --> action\n return_value.result << ( ex2.nil? ? nil : ex2.result )\n # <-- action\n\n else\n break # out of loop for decision 39\n end\n end # loop for decision 39\n\n end\n char_literal148 = match( T__65, TOKENS_FOLLOWING_T__65_IN_array_1518 )\n\n tree_for_char_literal148 = @adaptor.create_with_payload( char_literal148 )\n @adaptor.add_child( root_0, tree_for_char_literal148 )\n\n # - - - - - - - rule clean up - - - - - - - -\n return_value.stop = @input.look( -1 )\n\n\n return_value.tree = @adaptor.rule_post_processing( root_0 )\n @adaptor.set_token_boundaries( return_value.tree, return_value.start, return_value.stop )\n\n rescue ANTLR3::Error::RecognitionError => re\n report_error(re)\n recover(re)\n return_value.tree = @adaptor.create_error_node( @input, return_value.start, @input.look(-1), re )\n\n ensure\n # -> uncomment the next line to manually enable rule tracing\n # trace_out( __method__, 33 )\n\n end\n \n return return_value\n end", "title": "" }, { "docid": "3f6f858f87a9a47feda06b38f52ae12a", "score": "0.58301175", "text": "def tokens=(_arg0); end", "title": "" }, { "docid": "3f6f858f87a9a47feda06b38f52ae12a", "score": "0.58301175", "text": "def tokens=(_arg0); end", "title": "" }, { "docid": "3f6f858f87a9a47feda06b38f52ae12a", "score": "0.58301175", "text": "def tokens=(_arg0); end", "title": "" }, { "docid": "3f6f858f87a9a47feda06b38f52ae12a", "score": "0.58301175", "text": "def tokens=(_arg0); end", "title": "" }, { "docid": "3f6f858f87a9a47feda06b38f52ae12a", "score": "0.58301175", "text": "def tokens=(_arg0); end", "title": "" }, { "docid": "3f6f858f87a9a47feda06b38f52ae12a", "score": "0.58301175", "text": "def tokens=(_arg0); end", "title": "" }, { "docid": "1e6485296c7373330dbc12d33b804a09", "score": "0.58140033", "text": "def words\n [\n \"geography\", \"cat\", \"yesterday\", \"java\", \"truck\", \"opportunity\",\n \"fish\", \"token\", \"transportation\", \"bottom\", \"apple\", \"cake\",\n \"remote\", \"boots\", \"terminology\", \"arm\", \"cranberry\", \"tool\",\n \"caterpillar\", \"spoon\", \"watermelon\", \"laptop\", \"toe\", \"toad\",\n \"fundamental\", \"capitol\", \"garbage\", \"anticipate\", \"pesky\"\n ]\n end", "title": "" }, { "docid": "db32adce0f6b8dc2d747e040dc611e3a", "score": "0.5809809", "text": "def make_word_array(sect)\n word_arry = Array.new()\n sect.each do | para|\n puts para\n para.each do |sent|\n puts sent\n end\n end\n end", "title": "" }, { "docid": "75999c41d109cfd68c5e49db45f229eb", "score": "0.57989335", "text": "def ArrayLiteral(lbracket, contents); end", "title": "" }, { "docid": "4f119edf387a884580418a6c8175caee", "score": "0.5793803", "text": "def words\n @content.scan(/[[[:alpha:]]']+/)\n end", "title": "" }, { "docid": "098a879833702f60b307140a45ce98fd", "score": "0.5790221", "text": "def tokenize\n ret = []\n\n @value.gsub(/\\(/, \" ( \").gsub(/\\)/, \" ) \").split.each do |token|\n case token\n when \"(\", \")\"\n ret << token\n else\n ret << Atom.new(token)\n end\n end\n\n Sequence.new ret\n end", "title": "" }, { "docid": "f877569e1c36cc0c16f52df17d7f252a", "score": "0.5784491", "text": "def words_within phrase\n words_within_root(phrase).to_a\n end", "title": "" }, { "docid": "8968e02bb2b024197101176fb2f90512", "score": "0.57543087", "text": "def word_list\n word_list = raw_text.to_textual.split(/\\W/)\n end", "title": "" }, { "docid": "3e36e5f21730a63bc72ac1abd129f4d2", "score": "0.5741367", "text": "def words\n _words\n end", "title": "" }, { "docid": "3e36e5f21730a63bc72ac1abd129f4d2", "score": "0.5741367", "text": "def words\n _words\n end", "title": "" }, { "docid": "568340e21546b23aa2e11ff583116793", "score": "0.57400537", "text": "def test_token_subtree\n doc = $nlp.read(\"I like New York in Autumn.\")\n token = doc[3] # \"York\"\n assert_equal token.class.name, \"Spacy::Token\"\n assert_equal token.subtree.map(&:text), [\"New\", \"York\", \"in\", \"Autumn\"] \n end", "title": "" }, { "docid": "44b2ef4edfb847a9921a685de2dc6c3b", "score": "0.5732695", "text": "def visit_qwords(node); end", "title": "" }, { "docid": "e318b9b2993f6db3fa319c721e31ad25", "score": "0.5727597", "text": "def root_terms\n terms.map(&:root_terms).flatten\n end", "title": "" }, { "docid": "59fd1b34d06ce776ee21d52c28d358ba", "score": "0.5724443", "text": "def const_node_array(node)\n return [] if node.nil?\n return [''] if node.type == :cbase\n return [\"<`#{node.location.expression.source}`>\"] unless node.type == :const\n const_node_array(node.children.first) << node.children[1]\n end", "title": "" }, { "docid": "f8ac419093f06a1aadd326a063cfcf97", "score": "0.571154", "text": "def secondary_terms\n []\n end", "title": "" }, { "docid": "0d1983ca7043c9584e592e947c0f9fa2", "score": "0.5702802", "text": "def syntax\n contents.zip(gaps).flatten\n end", "title": "" }, { "docid": "511280e5307119912e5ab511711aba83", "score": "0.56784356", "text": "def GetAll\n\t\tGetAllWords(@root)\t\t\n\tend", "title": "" }, { "docid": "19138ed3cfb0d8000c9467be9a60b51c", "score": "0.5678301", "text": "def words\n if @words\n return @words\n else\n path = Rails.root.join 'lib', 'nlp', 'python', 'tokenizer.py'\n res = `python #{path} #{@raw_file}`\n @stem_lookup = Oj.load(res)\n return @words = @stem_lookup.keys\n end\n end", "title": "" }, { "docid": "18dfed983b6631365c574e38ebb9029c", "score": "0.5669986", "text": "def test_array_semantic_tree_production\n expr = \"not(identified) or (died and unknown)\"\n result = Boolexpr.semantic_tree(expr)\n rewriter = Anagram::Rewriting::Rewriter.new do\n template Anagram::Pack::Boolexpr::SemanticTree::Or do |r, node| r.apply(:left, :right).unshift(:or) end\n template Anagram::Pack::Boolexpr::SemanticTree::And do |r, node| r.apply(:left, :right).unshift(:and) end\n template Anagram::Pack::Boolexpr::SemanticTree::Not do |r, node| [:not, r.apply(:right)] end\n template Anagram::Pack::Boolexpr::SemanticTree::Proposition do |r, node| r.semantic_value end\n template Anagram::Pack::Boolexpr::SemanticTree::Literal do |r, node| r.semantic_value end\n end\n result = rewriter << result\n expected = [:or, [:not, \"identified\"], [:and, \"died\", \"unknown\"]]\n assert_equal(expected, result)\n end", "title": "" }, { "docid": "d9b847e876af7ca2b35d844fac7b519b", "score": "0.5666746", "text": "def synonyms_arr\n self.synonyms.split( \",\" ).collect{ |s| s.strip }\n end", "title": "" }, { "docid": "9548469502d7226e0f1bdf170865e67f", "score": "0.5655266", "text": "def Word(parts); end", "title": "" }, { "docid": "609bd3d7fdc524857d1986a113f0d69b", "score": "0.56508964", "text": "def conjuncts\n conjunct_array = []\n PyCall::List.(@py_span.conjuncts).each do |py_conjunct|\n conjunct_array << Token.new(py_conjunct)\n end\n conjunct_array\n end", "title": "" }, { "docid": "d9d8b36349600bc42c7527b5c9f2b7b9", "score": "0.56405634", "text": "def sub_node_array(options={})\n a = Array.new\n sub_nodes(options) do |rf|\n a << rf\n end\n return a\n end", "title": "" }, { "docid": "90e39800095be6d953dee8d0d38212b7", "score": "0.56390834", "text": "def primary_terms\n [ ]\n end", "title": "" }, { "docid": "10e92d14b960199144f116d3e65d524a", "score": "0.5628917", "text": "def words\n @words ||= []\n end", "title": "" }, { "docid": "7cc2bb60b9f30fe53b8e125f1279e553", "score": "0.5623458", "text": "def words\n @breakdown.values\n end", "title": "" }, { "docid": "cba8768b11c80f629d89111bc5b18df8", "score": "0.56208813", "text": "def nodes\n nodes = []\n each { |node| nodes << node }\n nodes\n end", "title": "" }, { "docid": "8daac9dc3bc1b9454fb4d4fbd86cc536", "score": "0.56122476", "text": "def tokens\n @tokens\n end", "title": "" }, { "docid": "81d98a42e92de812835a04e68d0a39f6", "score": "0.5610796", "text": "def syntaxes\n Uv.syntaxes\n end", "title": "" }, { "docid": "8b8271b634cbb770f239f710bd950acb", "score": "0.5609974", "text": "def words\n @content.split\n end", "title": "" }, { "docid": "b0363f6081482f955c5a7262f2b8367f", "score": "0.5608901", "text": "def find_words(node)\n words = []\n queue = []\n words << node.full_word if node.is_word\n queue << node\n until queue.empty? do\n node = queue.shift\n node.children.each do |child_node|\n word = child_node.full_word\n words << word if child_node.is_word\n queue << child_node\n end\n end\n words\n end", "title": "" }, { "docid": "849c7c8613e9d56da6769d212ab0bc77", "score": "0.55795175", "text": "def tokens\n @tokens ||= []\n end", "title": "" }, { "docid": "849c7c8613e9d56da6769d212ab0bc77", "score": "0.55795175", "text": "def tokens\n @tokens ||= []\n end", "title": "" }, { "docid": "b7306511402af3ebf75722a3fea86cb6", "score": "0.557922", "text": "def QWords(beginning, elements); end", "title": "" }, { "docid": "ae91ed9d2ff68c530f1ace184c5789f1", "score": "0.55763847", "text": "def children\n child_array = []\n PyCall::List.(@py_token.children).each do |child|\n child_array << Token.new(child)\n end\n child_array\n end", "title": "" }, { "docid": "7a6e682bf8232a43490b18cddaf2fb80", "score": "0.55757457", "text": "def metros\n return @nodes\n end", "title": "" }, { "docid": "7b55cb65ee811b53e2a98f6302eb0ced", "score": "0.557045", "text": "def dlist node\n result = []\n counter = 0\n node.items.each do |terms, dd|\n counter += 1\n case node.style\n when 'qanda'\n result << %(.sp\n#{counter}. #{manify([*terms].map {|dt| dt.text }.join ' ')}\n.RS 4)\n else\n result << %(.sp\n#{manify([*terms].map {|dt| dt.text }.join ', ')}\n.RS 4)\n end\n if dd\n result << (manify dd.text) if dd.text?\n result << dd.content if dd.blocks?\n end\n result << '.RE'\n end\n result * LF\n end", "title": "" }, { "docid": "94c69c58cb0b9e33b36dcd3d08cb89f3", "score": "0.55609286", "text": "def visit_mrhs(node)\n visit_array(\n ArrayLiteral.new(\n lbracket: nil,\n contents: Args.new(parts: node.parts, location: node.location),\n location: node.location\n )\n )\n end", "title": "" }, { "docid": "47f78d224f99f2cc605939737299587c", "score": "0.55517495", "text": "def ast; end", "title": "" }, { "docid": "47f78d224f99f2cc605939737299587c", "score": "0.55517495", "text": "def ast; end", "title": "" }, { "docid": "47f78d224f99f2cc605939737299587c", "score": "0.55517495", "text": "def ast; end", "title": "" }, { "docid": "47f78d224f99f2cc605939737299587c", "score": "0.55517495", "text": "def ast; end", "title": "" } ]
af5c7544378f6899149752ca6d3ccd89
returns the current weather type as a string: Clear, Cloudy, Overcast, Rainy, etc...
[ { "docid": "ede015e6e4df1a26664267bc98cf40f5", "score": "0.7724508", "text": "def current_weather\n current_weather_type = @weather_instance[\"current_observation\"][\"weather\"]\n\n return current_weather_type\n end", "title": "" } ]
[ { "docid": "12879987016bc67429ce7643965c5977", "score": "0.7419974", "text": "def weather_type_code\n @weather_type_code ||= text_from_node('icon_url_name').gsub(/^n|\\.jpg$/, '').to_sym\n end", "title": "" }, { "docid": "479de67125f8a6951c5398fba7e6130d", "score": "0.69875604", "text": "def get_weather_name weather_array\n\t\treturn case weather_array[2]\n\t\t\twhen P_CLEAR\n\t\t\t\t\"Kaum Wolken\"\n\t\t\twhen P_RAIN\n\t\t\t\t\"Regen\"\n\t\t\twhen P_DOWNPOUR\n\t\t\t\t\"Regenschauer\"\n\t\t\twhen P_SNOW\n\t\t\t\t\"Schnee\"\n\t\t\twhen P_SLEET\n\t\t\t\t\"Eisregen\"\n\t\t\twhen P_FOG\n\t\t\t\t\"Nebel\"\n\t\t\twhen P_HAIL\n\t\t\t\t\"Hagel\"\n\t\t\twhen P_HSNOW\n\t\t\t\t\"Starke Schneewirbel\"\n\t\t\twhen P_THUNDERSTORM\n\t\t\t\t\"Gewitter\"\n\t\t\twhen P_SANDSTORM\n\t\t\t\t\"Sandsturm\"\n\t\t\twhen P_INDOOR\n\t\t\t\t\"Innengebiet\"\n\t\tend\n\tend", "title": "" }, { "docid": "47a265906332f5a24225980a8499a00e", "score": "0.66854143", "text": "def icon(weather)\n case weather\n when 'Fog' then ''\n when /Clear/ then ' '\n when /Rain/ then ''\n when /Cloud/ then ''\n when /Snow/ then ''\n else\n ''\n end\n end", "title": "" }, { "docid": "c99643c46aaea051cf712c6ae1ca3063", "score": "0.65579623", "text": "def weather_statuses\n [:clear, :rainy, :stormy, :snowy, :partly_cloudy, :cloudy, :hailing, :heavy_seas, :calm_seas, :foggy, :snow_flurries, :windy, :partly_cloudy]\n end", "title": "" }, { "docid": "66ba4b3c5ef38f4f79711912a0278f6b", "score": "0.64963025", "text": "def sensor_type_name(sensor_type)\n r = \"\"\n case sensor_type\n when SensorType::SECUGEN\n r = \"Secugen\"\n when SensorType::UPEK1\n r = \"UPEK1\"\n when SensorType::UPEK2\n r = \"UPEK2\"\n when SensorType::VENUS\n r = \"Lumidigm Venus\"\n when SensorType::MSO\n r = \"MSO\"\n when SensorType::MSI\n r = \"MSI\"\n when SensorType::CBI\n r = \"CBI\"\n when SensorType::FVP\n r = \"FVP\"\n else\n r = \"UNKNOWN\"\n end\n r\n end", "title": "" }, { "docid": "8561f96fc2a7c6e0adc4edef4dfcda51", "score": "0.63883066", "text": "def weather_info (temp)\n c = convertToCelsius(temp)\n if (c < 0)\n return (\"#{c} is freezing temperature\")\n else\n return (\"#{c} is above freezing temperature\")\n end\nend", "title": "" }, { "docid": "9a739452704d8c657f61219adf61234f", "score": "0.635483", "text": "def current_weather\n return @weather[2]\n end", "title": "" }, { "docid": "b7ee12571acbed5355b67aa576ec3ef1", "score": "0.63428694", "text": "def wind\n current_wind = @weather_instance[\"current_observation\"][\"wind_string\"]\n\n return current_wind\n end", "title": "" }, { "docid": "f3bce76a79e8d8b06a637bfd08fd2f13", "score": "0.6310315", "text": "def weather\n sunny || stormy\n end", "title": "" }, { "docid": "ebf0481c2765b8d8c43c4c3ad219499d", "score": "0.6223029", "text": "def display_type()\n if @species.downcase == \"other\"\n return @type\n elsif\n @type.downcase == \"unknown\"\n return @species\n else\n return \"#{@type} #{@species}\"\n end\n end", "title": "" }, { "docid": "19c6379432c198e62c98fa059c81e147", "score": "0.62209636", "text": "def current_weather\n return {\n :error => false,\n :temperature => 22.44,\n :weather => \"céu limpo\"\n }\n end", "title": "" }, { "docid": "9456dcd264b0b2608b62e8f72fa05a62", "score": "0.62102383", "text": "def set_weather(type = 'none', days_of_effect = 0)\n case type\n when 'snow'\n @weather = [@day, $scene.player, 'snow', days_of_effect]\n $game_screen.weather(3, 20, 0)\n when 'rain'\n @weather = [@day, $scene.player, 'rain', days_of_effect]\n #$game_screen.weather(1, 20, 0)\n $game_screen.weather(1, 25, 40, 1)\n when 'sand'\n @weather = [@day, $scene.player, 'sand', days_of_effect]\n \n else\n @weather = [@day, $scene.player, 'none', days_of_effect]\n $game_screen.weather(0, 0, 0)\n end\n end", "title": "" }, { "docid": "880100430db886cac7fb376a80a693d6", "score": "0.6194205", "text": "def getCensorType(type)\n\tif(!type)\n\t\treturn :default\n\tend\n\n\tcase type.downcase\n\twhen \"default\"\n\t\treturn :default\n\twhen \"garbled\"\n\t\treturn :garbled\n\twhen \"stars\"\n\t\treturn :stars\n\twhen \"vowels\"\n\t\treturn :vowels\n\twhen \"nonconsonants\"\n\t\treturn :nonconsonants\n\telse\n\t\treturn type\n\tend\nend", "title": "" }, { "docid": "b56ab42904794e02d9387feb9c485359", "score": "0.6164855", "text": "def weather_conditions(t)\n\tif t<=-5\n\t\t\"Snowfall\"\n\telsif (t<15 && t>7)\n\t\t\"Rain\"\n\telse\t\t\n\t\t\"Hot\"\n\tend\nend", "title": "" }, { "docid": "b6a05f45f5d46faff5d0b3eb8d0a7842", "score": "0.6119598", "text": "def type_name\n name_to_cast = case self.name\n when 'High Performance Transmission'\n 'High Performance Transmission'\n when 'Torque Converter &amp; HP Converter'\n 'Converter'\n when 'Transmission'\n 'Transmission'\n when 'Ring Gears'\n 'Ring Gear'\n when 'Allison&reg;'\n 'Allison'\n when 'Power Train Savers&reg;'\n 'Power Train Saver'\n when 'High Performance Torque Converter'\n 'High Performance Converter'\n when 'Driveline'\n 'Driveline'\n else\n self.name\n end\n \n type_name = name_to_cast.extend(Helper::String).to_type_name\n end", "title": "" }, { "docid": "b54015d44743e7e0b1bb34b8f994fd0f", "score": "0.6097875", "text": "def weather_description\n @weather_description ||= text_from_node('weather')\n end", "title": "" }, { "docid": "67efd53d84f1b7a0f321bfc26b857a4e", "score": "0.6094709", "text": "def GetWeatherCode(code)\n\t\treturn CODES[code].to_s\n\tend", "title": "" }, { "docid": "26ba79a68ea5779fb8617a0b41b59b24", "score": "0.6091254", "text": "def type\n return 'regional' if (self.name.downcase.include?('regional'))\n return 'district' if (self.name.downcase.include?('district'))\n return 'local' if (self.name.downcase.include?('local'))\n return 'none'\n end", "title": "" }, { "docid": "da16d1a618840abea3f911c9ad7efaef", "score": "0.6084235", "text": "def initialize(type = :none)\n @current_weather = type\n end", "title": "" }, { "docid": "5f7694419ee974ff00aeaa9e30ed3cb1", "score": "0.6082803", "text": "def human_type\n TYPES[type]\n end", "title": "" }, { "docid": "97c14896902f7f49fe038d20f4da1248", "score": "0.6065967", "text": "def weather\n @connection.response[\"weather\"].first\n end", "title": "" }, { "docid": "7898b373aa710fc0f4e80ca02eb00bb4", "score": "0.6035957", "text": "def get_type\n return Nfc.tech_MifareClassic_get_type\n end", "title": "" }, { "docid": "05567f9673e4494cf6c70875246ce6b8", "score": "0.6033004", "text": "def weather\r\n # just day/night messages at the moment\r\n if time.first == Constants::Time::SUNRISE\r\n @players.each_output \"The sun rises in the east.\"\r\n elsif time.first == Constants::Time::SUNRISE + 1\r\n @players.each_output \"The day has begun.\"\r\n elsif time.first == Constants::Time::SUNSET\r\n @players.each_output \"The sun slowly disappears in the west.\"\r\n elsif time.first == Constants::Time::SUNSET + 1\r\n @players.each_output \"The night has begun.\"\r\n end\r\n return nil\r\n end", "title": "" }, { "docid": "931b4713c9582cf426d11f37e6ab40f5", "score": "0.6016846", "text": "def print_weather(w)\n \"#{w['day']} (#{w['high']}/#{w['low']} #{GetWeatherCode(w['code']}\"\n end", "title": "" }, { "docid": "3de558d0651b028171a8dd2d2fa97bc4", "score": "0.6004477", "text": "def type_str\n Types.type_str(type)\n end", "title": "" }, { "docid": "617f63c180e0e6c8b885c2ab6997f829", "score": "0.6004197", "text": "def type\n @type_raw.nil? ? @type_raw : @type_raw.downcase\n end", "title": "" }, { "docid": "1020a400af3fce73bf769a06eb670b0c", "score": "0.6003526", "text": "def human_type\n Core::TYPES_DESC[type]\n end", "title": "" }, { "docid": "8a52f075b903253529ae05b9dd828ec5", "score": "0.6002964", "text": "def target_type_localized\n target_type.downcase.to_sym.l\n rescue StandardError\n \"\"\n end", "title": "" }, { "docid": "381a3f5002d7e60dc068af91d57e0105", "score": "0.5992003", "text": "def type\n @type = Kiwi.find_const @type if String === @type\n @type\n end", "title": "" }, { "docid": "178474efdc7431e991f07454ddca8f8e", "score": "0.5985824", "text": "def get_weather(weather)\n\n\tputs \"For your location, the temperature is: #{weather.current.temperature.f}f\"\n\tputs \"Conditions outside: #{weather.current.condition}\"\n\nend", "title": "" }, { "docid": "a8a53697a1d67a3242486cdaf18575d5", "score": "0.5981817", "text": "def type\n @info[9]\n end", "title": "" }, { "docid": "2e1ced3afd5e37d0be124628f5026a29", "score": "0.597423", "text": "def get_type_name(str)\n if str == \"Fact\"\n\t return \"Faktenwissen\"\n\telsif str == \"Action\"\n\t return \"Anwendungswissen\"\n\telsif str == \"InstructionalKnowledge\"\n\t return \"Handlungswissen\"\n else str == \"Orientation\"\n\t return \"Orientierungswissen\"\n\tend\n end", "title": "" }, { "docid": "765892bfcd909961b11d9b393385b4a8", "score": "0.5967465", "text": "def show\n info = @weather['weather'][0]['main']\n temp = @weather['main']['temp']\n \" #{temp}  #{icon(info)} #{info}\"\n end", "title": "" }, { "docid": "4a6ba6b08ddc337bbfe12182c2b74186", "score": "0.596702", "text": "def type_str\n MARKETPLACEAPP_TYPES[type]\n end", "title": "" }, { "docid": "406c77263f7aef74e9ada0ca35ac6584", "score": "0.59651613", "text": "def default_weather_code\n if weather_code\n weather_code.code\n else\n SystemConfig.instance.default_weather_code\n end\n end", "title": "" }, { "docid": "bb97b6fa2f4f6518b94e7157fe4acad0", "score": "0.59614253", "text": "def whats_the_weather\n if rand(2) == 1 then\n :sunny\n else\n :stormy\n end\n end", "title": "" }, { "docid": "449f86cd7a4ed760d9d6f33872723d14", "score": "0.5956568", "text": "def human_type\n if human_types?\n htype = self.class::TYPES[type]\n htype = type if htype.nil?\n htype.to_s\n else\n type.to_s\n end\n end", "title": "" }, { "docid": "af6f2a91e5fd9515e51c014e6d7ca723", "score": "0.5918067", "text": "def getTypeAsString()\n\t\tend", "title": "" }, { "docid": "fb035b7cddd4da2f0ef66e532674eeef", "score": "0.59150743", "text": "def type_human\n #return I18n.t(TYPE_CONST_HASH[type_const]) || \"Unknown\"\n return History.type_to_human(self.type_const) \n end", "title": "" }, { "docid": "66877901c7085725b99b0b99b2e2a0fc", "score": "0.5900582", "text": "def get_weather(weather, fahrenheit)\n if weather.nil?\n return \"\"\n end\n temperature = fahrenheit == true ? weather['tempF'] : weather['tempC']\n return sprintf(\"* Weather: %s (%.1f degrees)\\n\", weather['weather'], temperature)\n end", "title": "" }, { "docid": "4958544fdcd9e829233ff4dba351ff3b", "score": "0.5898376", "text": "def get_type_desc(type)\n if @short_types.has_key? type\n return @short_types[type]\n end\n\n \"Unknown\"\nend", "title": "" }, { "docid": "b2ba60cdd0a6b78b6689354d71e7e9e6", "score": "0.5892258", "text": "def type\n TYPES[income_type || buy_sell_type] || \"\"\n end", "title": "" }, { "docid": "57c15d4e12c030ccdd5db6c2b4225e92", "score": "0.58812374", "text": "def get_tags\n tags = \"outdoor,outdoors,outside,landscape\"\n\n case @weather_icon\n when \"clear-night\" || \"partly-cloudy-night\"\n tags.prepend(\"night,\")\n when \"cloudy\"\n tags.prepend(\"cloudy,\")\n when \"rain\" || \"sleet\"\n tags.prepend(\"rain,rainy,\")\n when \"snow\"\n tags.prepend(\"snow,snowy,\")\n when \"fog\"\n tags.prepend(\"fog,foggy,\")\n else\n tags.prepend(\"sun,sunny,\")\n end\n end", "title": "" }, { "docid": "dde20d95ac7806948f8ba55e3694492a", "score": "0.5873507", "text": "def change_weather(type)\n screen = $game_map.screen\n screen.change_weather(type, 2, 10)\n end", "title": "" }, { "docid": "ea29b4109d7aacb494b26f7488edebfd", "score": "0.58721143", "text": "def type\n info[:type]\n end", "title": "" }, { "docid": "df7726b504456717b82a0997ff5a751c", "score": "0.58656305", "text": "def platform_type_to_s(platform_type)\n if platform_type == \"1\"\n I18n.t(\"website\", default: \"Website\")\n elsif platform_type == \"2\"\n I18n.t(\"mobile\", default: \"Mobile\")\n elsif platform_type == \"3\"\n I18n.t(\"tv\", default: \"TV\")\n elsif platform_type == \"4\"\n I18n.t(\"prints\", default: \"Prints\")\n else\n I18n.t(\"others\", default: \"Others\")\n end\n end", "title": "" }, { "docid": "43c6eed8e8cfcdaf0a8cabc1e6acbabe", "score": "0.5856662", "text": "def weather(high, low, type)\n puts \"Today's high is #{high} and the low is #{low}. It will be #{type}.\"\nend", "title": "" }, { "docid": "8f04d2c4e21c0d0aecf9b9a3e792206b", "score": "0.58552784", "text": "def type_string\n @type_string ||= @daft_title.slice(split_index + 3, @daft_title.length)\n end", "title": "" }, { "docid": "b0d6a1b4f6c56c854bffa27dcb64613a", "score": "0.58549076", "text": "def type_name\n @type.to_s.gsub(/\\d/, ' \\0').capitalize\n end", "title": "" }, { "docid": "fab0a78f7d85cb5918410946d66e3bdd", "score": "0.58508956", "text": "def current_weather\n HTTParty.get(\"http://api.openweathermap.org/data/2.5/weather?q=#{city}\").parsed_response\n end", "title": "" }, { "docid": "ee0a7fb32d3a9ce1de0263a52a88c8d6", "score": "0.58507276", "text": "def get_type\n return \"misc\" if basedir =~ /\\/misc\\// || basedir =~ /\\/misc$/\n return \"nature\" if basedir =~ /\\/nature\\//\n return \"podcasts\" if basedir =~ /\\/podcasts\\//\n return \"soundtracks\" if basedir =~ /\\/soundtracks\\//\n return \"music\"\n end", "title": "" }, { "docid": "396737adeaf756df24c33bf6073514b4", "score": "0.5842719", "text": "def human_type\n self.class::TYPES.key(type) || '0x%04x' % type\n end", "title": "" }, { "docid": "e99051c2bb331c632a24c336b9cd83ce", "score": "0.58393896", "text": "def current_weather(zipcode)\n client = Weatherman::Client.new\n client.lookup_by_location(zipcode)\n \n temperature = temp_converter(client.lookup_by_location(zipcode).condition['temp'])\n conditions = client.lookup_by_location(zipcode).condition['text'].downcase\n puts \"The current weather for #{zipcode} is #{temperature} degrees Fahrenheit and #{conditions}.\"\nend", "title": "" }, { "docid": "b76db965a80d2be3b4165af743534708", "score": "0.58355236", "text": "def fuel_type\n @fuel_type ||= json['fuelType']\n end", "title": "" }, { "docid": "986bba96feac1743e1acab0e2f498688", "score": "0.5833372", "text": "def type_name\n TYPES[type.to_s]\n end", "title": "" }, { "docid": "38e69f625735ade4fabe3d83d78037cb", "score": "0.5829742", "text": "def showtype(ut)\n case ut\n when \"1\" then return \"Admin\"\n when \"2\" then return \"Government\"\n when \"3\" then return \"Corporate\"\n when \"4\" then return \"Business\"\n else return \"Unknown\"\n end\n end", "title": "" }, { "docid": "d5cfb44565df38010713f98aa70c7a3a", "score": "0.58213574", "text": "def get_pcp_type_description(x) #self.\n if x == \"snow\"\n m_hex = \"0066CC\" #Marker.find(1).description\n elsif x == \"rain\"\n m_hex = \"00CC00\" #Marker.find(2).description\n elsif x == \"sleet\"\n m_hex = \"FF66FF\" #Marker.find(12).description\n else\n m_hex = \"A0A0A0\" #Marker.find(3).description\n end\n m_hex\n end", "title": "" }, { "docid": "765be7034f473944c039c4f00465a211", "score": "0.5815724", "text": "def get_weather\n [\"sunny\", \"cloudy\", \"rainy\", \"stormy\", \"snowy\", \"hot\", \"cold\"].sample\n end", "title": "" }, { "docid": "84d0e58fcdf3ad5247222956abdc9a2a", "score": "0.5815353", "text": "def weather\r\n temp = current[\"main\"][\"temp\"]\r\n desc = current[\"weather\"][0][\"description\"]\r\n loc = current[\"name\"]\r\n\r\n weather = Weather.new(temp, desc, loc)\r\n\r\n # icon_url is of the form http://openweathermap.org/img/w/04n.png\r\n icon = current[\"weather\"][0][\"icon\"]\r\n weather.icon_url = \"http://openweathermap.org/img/w/#{icon}.png\"\r\n\r\n weather\r\n end", "title": "" }, { "docid": "31d43dc1e3647aff7b465ebc9b900997", "score": "0.580131", "text": "def display_type_locale\n s = ''\n s << \"#{type_locality} \" if type_locality?\n s << \"[#{type_geog.display_name}]\" if type_geog_id?\n s \n end", "title": "" }, { "docid": "785a405aec56b270a7f2f45553eab659", "score": "0.57948136", "text": "def condition_category_name\n if THUNDERSTORM.include?(@condition_id)\n 'thunderstorm'\n elsif DRIZZLE.include?(@condition_id)\n 'drizzle'\n elsif RAIN.include?(@condition_id)\n 'rain'\n elsif SNOW.include?(@condition_id)\n 'snow'\n else\n 'sunshine'\n end\n end", "title": "" }, { "docid": "63e6a01fcc0744a8c4245db47ed68f07", "score": "0.5791805", "text": "def weather(my_temp)\n if my_temp > 100\n puts \"It is hot hot hot!\"\n elsif my_temp > 85\n puts \"Beautiful sweatshirt weather!\"\n elsif my_temp > 55\n puts \"Don't forget your earmuffs!\"\n else \n puts \"... just move somewhere else. You don't deserve this.\"\n end\n end", "title": "" }, { "docid": "641dae95d1c0d34754ada4f0212b3d66", "score": "0.5786552", "text": "def stormy_weather?\n\t\tweather == \"stormy\"\n\tend", "title": "" }, { "docid": "da61ef125b2edeefb64fd8aa8c3c8358", "score": "0.57815665", "text": "def get_weather\n @montreal_statistics = self.get_weather_connection('Montreal')\n content = \"<h2 style=\\\"color:darkblue\\\">The weather in Montreal is #{@montreal_statistics['main']['temp']}C</h2>\"\n puts content\n return content\n end", "title": "" }, { "docid": "7fe0e5b227c80447dab79a271e51caf3", "score": "0.5774116", "text": "def init_weather\n WEATHER\n end", "title": "" }, { "docid": "18ca5bda8e052062d0a11b0aed985301", "score": "0.5769563", "text": "def weather(city, my_temp)\n\n puts \"#{city}'s Wednesday forecast: #{my_temp}\"\n \n end", "title": "" }, { "docid": "d9338d5e68b11972523f7e47faa93b27", "score": "0.5768758", "text": "def weatherTint?\n for wth in [:Hail, :Sun, :HarshSun]\n return true if @battle.pbWeather == wth\n end\n return false\n end", "title": "" }, { "docid": "9630e564da423f4883d02bcad80fb010", "score": "0.5764557", "text": "def weather(type, power, duration)\n @weather_type_target = type\n if @weather_type_target != 0\n @weather_type = @weather_type_target\n end\n if @weather_type_target == 0\n @weather_max_target = 0.0\n else\n @weather_max_target = (power + 1) * 4.0\n end\n @weather_duration = duration\n if @weather_duration == 0\n @weather_type = @weather_type_target\n @weather_max = @weather_max_target\n end\n end", "title": "" }, { "docid": "9630e564da423f4883d02bcad80fb010", "score": "0.5764557", "text": "def weather(type, power, duration)\n @weather_type_target = type\n if @weather_type_target != 0\n @weather_type = @weather_type_target\n end\n if @weather_type_target == 0\n @weather_max_target = 0.0\n else\n @weather_max_target = (power + 1) * 4.0\n end\n @weather_duration = duration\n if @weather_duration == 0\n @weather_type = @weather_type_target\n @weather_max = @weather_max_target\n end\n end", "title": "" }, { "docid": "cefaa80f24071367889c52943e7c401c", "score": "0.57480913", "text": "def parse_weather(line)\n if line =~ /\\.\\.\\..*[sS]unny/ then\n return \"\\u2600\"\n elsif line =~ /\\.\\.\\..*[cC]loudy/ then\n return \"\\u2601\"\n elsif line =~ /\\.\\.\\..*[rR]ain/ then\n return \"\\u2602\"\n elsif line =~ /\\.\\.\\..*[cC]lear/ then\n return \"\\u263d\"\n end\nend", "title": "" }, { "docid": "a8caac7f3b10401c63d23abd6bc505ef", "score": "0.57422495", "text": "def type\n return nil if info.nil?\n\n info[:type]\n end", "title": "" }, { "docid": "19fb29b87152d5b29b9efc2f41271d5a", "score": "0.5739715", "text": "def get_strength_weather\r\n if PZE::CLOCK == 0 #Majora's Mask Mode\r\n case $game_system.pze_day\r\n when 2\r\n case $game_system.pze_hour\r\n when 7,11,12,13,16\r\n return 25\r\n when 8,9,10,14,15\r\n return 35\r\n else\r\n return 25\r\n end\r\n else\r\n return 0\r\n end\r\n else\r\n if $game_system.pze_winter #winter\r\n case $game_system.pze_hour\r\n when 20, 21, 22, 23, 0, 1, 2, 3, 4\r\n return 40 #stong\r\n when 18, 19, 5, 6\r\n return 30 #medium\r\n else\r\n return 25 #normal\r\n end\r\n elsif $game_system.pze_autumn #autmn\r\n case $game_system.pze_hour\r\n when 10, 11, 12, 13\r\n return 25 #normal\r\n when 21,22,23,0,1\r\n return 30 #strong\r\n else\r\n return 10 #weak\r\n end\r\n else #summer/spring\r\n return 30 #normal\r\n end\r\n end\r\n end", "title": "" }, { "docid": "584a8f364dabfbd28f808ad7752c9e98", "score": "0.57396406", "text": "def type_str\n self.class.const_get(:TYPE_STR)\n end", "title": "" }, { "docid": "1512d21adab4c4c68fdc3ad16c35b375", "score": "0.5737575", "text": "def device_comm_type_name(device_comm_type)\n r = \"\"\n case device_comm_type\n when DeviceCommType::UNKNOWN\n r = \"UNKNOWN\"\n when DeviceCommType::ETH_WIRED\n r = \"Wired Ethernet\"\n when DeviceCommType::ETH_WIFI\n r = \"WiFi\"\n when DeviceCommType::USB\n r = \"Serial USB/AUX\"\n when DeviceCommType::RS232\n r = \"Serial RS232\"\n when DeviceCommType::RS485\n r = \"Serial RS485\"\n when DeviceCommType::RS422\n r = \"Serial RS422\"\n end\n r\n end", "title": "" }, { "docid": "bcf49f03ace2e118a43272adb6d330e5", "score": "0.57339823", "text": "def check_type\n\t\tcase self.piece\n\t\twhen \"♖\",\"♜\"\n\t\t\t@type=\"rook\"\n\t\t\treturn \"rook\"\n\t\twhen \"♝\",\"♗\"\n\t\t\t@type=\"bishop\"\n\t\t\treturn \"bishop\"\n\t\twhen \"♘\",\"♞\"\n\t\t\t@type=\"knight\"\t\n\t\t\treturn \"knight\"\n\t\twhen \"♕\",\"♛\"\n\t\t\t@type=\"king\"\n\t\t\treturn \"king\"\n\t\twhen \"♔\",\"♚\"\n\t\t\t@type=\"queen\"\n\t\t\treturn \"queen\"\n\t\twhen \"♙\",\"♟\"\n\t\t\t@type=\"pawn\"\n\t\t\treturn \"pawn\"\n\t\t\n\t\telse\n\t\t\treturn \"empty\"\n\t\tend\n\tend", "title": "" }, { "docid": "722045a60bb59c2d537503a0469cc737", "score": "0.5725527", "text": "def get_weather(this_zip)\n\n\tnew_hash = {:unit=>\"f\"}\n\tclient = Weatherman::Client.new(new_hash)\n\tweather_obj = client.lookup_by_location(this_zip) \n\t\n\ti = 1\n\tweather_obj.forecasts.each do |forecast|\n\t\tif (i == 1) \n\t\t\tdatestr = \"Today\"\n\t\t\n\t\telsif (i ==2) \n\t\t\tdatestr = \"Tomorrow\"\n\t\t\n\t\telse \n\t\t\tdatestring = forecast[\"day\"]\n\t\t\tdatestr = case datestring\n\t\t\t\twhen \"Mon\" then \"Monday\"\n\t\t\t\twhen \"Tue\" then \"Tuesday\"\n\t\t\t\twhen \"Wed\" then \"Wednesday\"\n\t\t\t\twhen \"Thu\" then \"Thursday\"\n\t\t\t\twhen \"Fri\" then \"Friday\"\n\t\t\t\twhen \"Sat\" then \"Saturday\"\n\t\t\t\telse \"day unknown\"\n\t\t\tend\n\t\tend\n\t\n\t\tputs datestr + \" is going to be \" + forecast[\"text\"].downcase + \" with a high of \" + forecast[\"high\"].to_s + \"\\nand a low of \" + forecast[\"low\"].to_s + \" degrees Fahrenheit.\"\n\t\ti += 1\n\tend\n\t# puts client.methods\n\t\nend", "title": "" }, { "docid": "5a3c33f782350243c99963801f5cf414", "score": "0.57200474", "text": "def get_current_weather\n full_url = build_url(CONDITIONS)\n current_observation = HTTParty.get(full_url)[\"current_observation\"]\n # uncomment the next object and comment the line above in order to test app functionality without making API cals\n # current_observation = {\n # \"temp_f\" => \"90\",\n # \"weather\" => \"Partly Cloudy\",\n # \"precip_today_in\" => \"0.00\",\n # \"icon_url\" => \"http://icons.wxug.com/i/c/k/mostlycloudy.gif\"\n # }\n return {temp: current_observation[\"temp_f\"], \n description: current_observation[\"weather\"],\n precip: current_observation[\"precip_today_in\"].to_f,\n icon: current_observation[\"icon_url\"]\n }\n end", "title": "" }, { "docid": "b9d5b35e02d3d6fe9405be697e7ddc3e", "score": "0.57182336", "text": "def weather(m)\n ForecastIO.api_key = \"8826650e770499ac02d3d72d17afd3c8\"\n forecast = ForecastIO.forecast(42.3598, -71.0921)\n humidity = (forecast.currently.humidity) * 100\n response = forecast.currently.summary + \", with a temperature of \" + forecast.currently.temperature.to_s + \" and humidity of \" + humidity.to_s + \"%.\"\n m.reply \"Current weather at MIT (Kendall/MIT, Cambridge, MA):\"\n m.reply response\n end", "title": "" }, { "docid": "b9d5b35e02d3d6fe9405be697e7ddc3e", "score": "0.57182336", "text": "def weather(m)\n ForecastIO.api_key = \"8826650e770499ac02d3d72d17afd3c8\"\n forecast = ForecastIO.forecast(42.3598, -71.0921)\n humidity = (forecast.currently.humidity) * 100\n response = forecast.currently.summary + \", with a temperature of \" + forecast.currently.temperature.to_s + \" and humidity of \" + humidity.to_s + \"%.\"\n m.reply \"Current weather at MIT (Kendall/MIT, Cambridge, MA):\"\n m.reply response\n end", "title": "" }, { "docid": "1ed85a611ff4708931b01d43269baa90", "score": "0.57152295", "text": "def to_s\n return @type\n end", "title": "" }, { "docid": "76f9ce6312b2c12d96ccb031aa3f6731", "score": "0.5703561", "text": "def type_str(type)\n constant = constants.find {|const| const_get(const) == type }\n constant ? constant.to_s : nil\n end", "title": "" }, { "docid": "2c74db06c9af8fc41a9ef89512774ce7", "score": "0.57020473", "text": "def kind\n case country_specific\n when 0 then :red\n when 1 then :yellow\n when 2 then :green\n end\n end", "title": "" }, { "docid": "6f11658fa7bd3bfdbca3c7b6a8e4b751", "score": "0.56925243", "text": "def current_weather_api\n sio_response = call_api_and_handle_error('current_weather')\n sio_response ? JSON.parse(sio_response.read, symbolize_names: true) : false\n end", "title": "" }, { "docid": "27a6847f65476993173aba2b2698bcf8", "score": "0.5692439", "text": "def type_str\n\t\treturn custom if vulntype == 0\n\n\t\tvt = VulnType.get(vulntype)\n\t\treturn (vt.label.nil? || vt.label.strip.empty?) ? vt.name : vt.label\n\tend", "title": "" }, { "docid": "d9b0b01b42b0a280e366ee4522cfc00f", "score": "0.5687537", "text": "def describe_weather\n weather_object.describe_weather\n end", "title": "" }, { "docid": "e1459a58354165e4588e73292166705e", "score": "0.56851935", "text": "def vehicle_type_text\n t(VEHICLE_TYPES[vehicle_type]) if vehicle_type.present?\n end", "title": "" }, { "docid": "e2d3856c5e352fdcc08f7a3fe0268af9", "score": "0.5680876", "text": "def type\n @type ||= ActiveSupport::Inflector.underscore(to_s).gsub('/', '.')\n end", "title": "" }, { "docid": "4c0679f98744429a9c33e5c9fc89218d", "score": "0.5673942", "text": "def roomtype\n return number + \" - \" + room_type.name + \" # \" + room_type.baserate.to_s\n end", "title": "" }, { "docid": "360bc0cdaaab935d316d2a35fd240aa9", "score": "0.5667505", "text": "def weather_description(description)\n # Add other sanitization things here if necessary\n # This one gets rid of \"Sky Is Clear\" which looks kinda weird\n description.downcase.gsub('sky is ', '').titleize\n end", "title": "" }, { "docid": "1210f37acc1ed07e571f8e0608635280", "score": "0.56611913", "text": "def temperature_string\n object.temperature.to_s + \" °C\" unless object.temperature.nil?\n end", "title": "" }, { "docid": "76496b93fbb125659539fca1cbbe4b16", "score": "0.5649369", "text": "def get_weather(location)\n\tclient = Weatherman::Client.new\n\tresponse = client.lookup_by_location(location)\n\tcondition = response.condition['text']\n\tputs \"The weather is #{condition.downcase}.\"\nend", "title": "" }, { "docid": "c4f33fdd7d8c3f016e533865f6d5895b", "score": "0.5647131", "text": "def get_category_type_name\n category_type ? category_type.short_name : '?'\n end", "title": "" }, { "docid": "73761f5aa051d72b6b1e1a9826516da9", "score": "0.56468064", "text": "def getHearingType(hType)\n \tcase hType\n\t\twhen \"1\"\n\t\t\treturn \"Central Office\"\n\t\twhen \"2\"\n\t\t\treturn \"Travel Board\"\n\t\twhen \"6\"\n\t\t\treturn \"Video\"\n\t\telse\n\t\t\treturn \"\"\n \tend\n end", "title": "" }, { "docid": "cfb4dba3c5166222c82ca741ee36ba3d", "score": "0.56402546", "text": "def get_movement_type_name(verbose_level = :short)\n if movement_type && movement_type.code == MovementType::CODE_FULL\n ''\n elsif movement_type # Retrieve the movement_scope_type only if it is defined and it's not \"full\"\n if verbose_level.to_sym == :short\n movement_type.i18n_short\n else\n movement_type.i18n_description\n end\n else\n ''\n end\n end", "title": "" }, { "docid": "25998b7b411fde5a1f747be45af65f3c", "score": "0.56401145", "text": "def type(name)\r\n if name =~ /(Arm|Arms|Grimoire|Primary Tool)/i\r\n return \"weapon\"\r\n elsif name =~ /Shield/i\r\n return \"shield\"\r\n elsif name.eql?(\"Ring\")\r\n return \"ring#{ring_inc}\"\r\n else\r\n return Helper.replace_downcase(name)\r\n end\r\n end", "title": "" }, { "docid": "b548beb800267ffb0f8431fae9d26193", "score": "0.5633734", "text": "def get_heating_fuel_source()\n return \"Electricity\"\n end", "title": "" }, { "docid": "5dbbb54e18152d5075905176dc65d484", "score": "0.56300175", "text": "def human_type\n self[:type].to_human\n end", "title": "" }, { "docid": "5dbbb54e18152d5075905176dc65d484", "score": "0.56300175", "text": "def human_type\n self[:type].to_human\n end", "title": "" }, { "docid": "69954a43cd23b69dcf07ff2e74ae79aa", "score": "0.5626609", "text": "def microstation_type\n ole_obj.Type\n end", "title": "" }, { "docid": "af3442f535a71ae88c9c8619a5c148ed", "score": "0.5616731", "text": "def getWeather\n options = { units: \"metric\", APPID: ENV['open_weather']}\n OpenWeather::Current.city_id(6077243, options)\n end", "title": "" } ]
d29312b8893f9040f4bb23a764a63434
PUT Update one Person using the body
[ { "docid": "42df8ba024ce54dab184f02761621ecd", "score": "0.7820142", "text": "def update_by_body\n @person = Person.find(person_update_params[:id])\n\n if @person.update_attributes(person_update_params)\n render json: { status: 'PUT Success' }, status: :ok\n else\n render json: { status: 'Error', message:'Error updating person', person: @person.errors }, status: :unprocessable_entity\n end\n end", "title": "" } ]
[ { "docid": "f15da4f0ad6bedf82602d7bee9c504c7", "score": "0.76712745", "text": "def update\n resource_path = \"/projects/#{project_id}/people/#{id}\"\n Request.put(resource_path, self.to_xml('person'))\n end", "title": "" }, { "docid": "5f65b02a816e569d1e79e1a353f47fae", "score": "0.75944656", "text": "def update\n @person = Roxiware::Person.find(params[:id])\n _create_or_update(@person)\n end", "title": "" }, { "docid": "6eddf15605851198cb1f19714d1003f9", "score": "0.75618184", "text": "def update\n if request.content_type == \"application/json\"\n # .update is like a \"update people set ...\" in sql\n if @person.update(person_params)\n render json: @person\n else\n render json: @person.errors, status: :not_found\n end\n else\n render status: :bad_request\n end\n end", "title": "" }, { "docid": "02238e462f35e91cff024c60401f58ce", "score": "0.74778277", "text": "def update\n @person = Person.find(params[:id]) \n respond_to do |format|\n if @person.update(person_params)\n format.json { render json: @person, status: :ok }\n else\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1b158758185d78cc92466c335deb8033", "score": "0.74450266", "text": "def update\n if @person.update(person_params)\n render :show, status: :ok, location: api_v1_person_url(@person)\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "6dcd8150768e6b1dc5b181e9cd020bb7", "score": "0.74265915", "text": "def update\n @person = Person.find(params[:id])\n if @person.update_attributes(person_params)\n render :json => @person\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n\n end", "title": "" }, { "docid": "bb2e5d754afd98da249c2102e3fbbc56", "score": "0.7390213", "text": "def update!(**args)\n @person = args[:person] if args.key?(:person)\n end", "title": "" }, { "docid": "bb2e5d754afd98da249c2102e3fbbc56", "score": "0.7390213", "text": "def update!(**args)\n @person = args[:person] if args.key?(:person)\n end", "title": "" }, { "docid": "bb2e5d754afd98da249c2102e3fbbc56", "score": "0.7390213", "text": "def update!(**args)\n @person = args[:person] if args.key?(:person)\n end", "title": "" }, { "docid": "bb2e5d754afd98da249c2102e3fbbc56", "score": "0.7390213", "text": "def update!(**args)\n @person = args[:person] if args.key?(:person)\n end", "title": "" }, { "docid": "bb2e5d754afd98da249c2102e3fbbc56", "score": "0.7390213", "text": "def update!(**args)\n @person = args[:person] if args.key?(:person)\n end", "title": "" }, { "docid": "360a48cfa7ecea0b1d565c1c7cc7d6b6", "score": "0.7361058", "text": "def update\n @person.update_attributes(params[:person])\n respond_with(@person)\n end", "title": "" }, { "docid": "77f129a446c2b43076f02280ac936669", "score": "0.73582584", "text": "def update\n if @person.update(person_params)\n render :show, status: :ok, location: api_v2_person_url(@person)\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "77f129a446c2b43076f02280ac936669", "score": "0.73582584", "text": "def update\n if @person.update(person_params)\n render :show, status: :ok, location: api_v2_person_url(@person)\n else\n render json: @person.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "d5bb1bd1c27f8e1482c989259df5d168", "score": "0.7351284", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d5bb1bd1c27f8e1482c989259df5d168", "score": "0.7351284", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ca1f04d265c06053298d9f7cdc765dbf", "score": "0.7341237", "text": "def update\n @person = Person.find(params[:id])\n\n populate_attributes(@person, params[:person])\n respond_to do |format|\n \n if @person.save && @person.identifiable_entries.each(&:save!)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58ba7a722eac6d091519682f9ccaf0c4", "score": "0.7330328", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58ba7a722eac6d091519682f9ccaf0c4", "score": "0.7330328", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58ba7a722eac6d091519682f9ccaf0c4", "score": "0.7330328", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58ba7a722eac6d091519682f9ccaf0c4", "score": "0.7330328", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "58ba7a722eac6d091519682f9ccaf0c4", "score": "0.7330328", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "2cedcae2b5ad2e36612e946e612c8e35", "score": "0.72273535", "text": "def update\n\t\trespond_to do |format|\n\t\t\tif @person.update(person_params)\n\t\t\t\tformat.html { redirect_to @person, notice: 'Person was successfully updated.' }\n\t\t\t\tformat.json { render :show, status: :ok, location: @person }\n\t\t\telse\n\t\t\t\tformat.html { render :edit }\n\t\t\t\tformat.json { render json: @person.errors, status: :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "aa1ddcc96b35ea927a2b404d8ecc1ab3", "score": "0.72162956", "text": "def update\n\n\t\trespond_to do |format|\n\t\t\tif @person.update_attributes(params[:person])\n\t\t\t\tformat.html { redirect_to(@person, :notice => 'Person 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 => @person.errors, :status => :unprocessable_entity }\n\t\t\tend\n\t\tend\n\tend", "title": "" }, { "docid": "550e4d1ee1dd642ec22a88c12a586be5", "score": "0.71991646", "text": "def update_person_field(id:, **args)\n params = parameters(args) do\n required_params :name\n optional_params :name, :options\n end\n request(:put, \"personFields/#{id}\", params)\n end", "title": "" }, { "docid": "9816d59625a635bd4375b29813a62223", "score": "0.7144447", "text": "def update\n @user_person = UserPerson.find(params[:id])\n\n respond_to do |format|\n if @user_person.update_attributes(params[:user_person])\n format.html { redirect_to @user_person, notice: 'User person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @user_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.71071696", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.71071696", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.71071696", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.71071696", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.71071696", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.71071696", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.71071696", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b84f0cd6052175b4610438fd5e6070ef", "score": "0.71071696", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0cb94f2511f06c1f5fdac8dac2234a4c", "score": "0.7107135", "text": "def update\n @person = Person.find(params[:id]) \n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: \"#{@person.display_name} Person was successfully updated.\" }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7aada6a1fb5d72f35e6c7c7b826165e7", "score": "0.7094131", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n flash[:notice] = 'Person was successfully updated.'\n format.html { redirect_to(person_path) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ed7ac047379a0529afb3b3e76cd6f93", "score": "0.70803404", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ed7ac047379a0529afb3b3e76cd6f93", "score": "0.70803404", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7ed7ac047379a0529afb3b3e76cd6f93", "score": "0.70803404", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "95e3b5a09867446c41975fe48cfdb6e4", "score": "0.7080245", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: \"Person was successfully updated.\" }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f584cf4f999d2e1d8c6d53fa1d8e7129", "score": "0.7057924", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: \"#{@person.name} was successfully updated.\" }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "083de56b0b5e1e7939f47e75dd968b71", "score": "0.705167", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to people_path, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c5cf2ec79c3415977c97459e223f1958", "score": "0.7045758", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to(@person, :notice => 'Person was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9077769bd49ba54d15d012412dda47d3", "score": "0.7045015", "text": "def update\n\t\t@person = Person.find_by(id: params[:id])\n\t\[email protected]_attributes(person_params)\n\n\t\t# Same as below!\n\t\t# @person.name = params[:person][:name]\n\t\t# @person.age = params[:person][:age]\n\t\t# @person.is_a_clown = params[:person][:is_a_clown]\n\t\t# @person.save\n\n\t\t# redirect_to 'index'\n\t\tredirect_to person_url(@person) # the prefix from rake routes, could also use path..\n\tend", "title": "" }, { "docid": "19c79f621bde86c2c3868d89a706a3b8", "score": "0.7043908", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html do\n redirect_to @person, notice: 'Person was successfully updated.'\n end\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json do\n render json: @person.errors, status: :unprocessable_entity\n end\n end\n end\n end", "title": "" }, { "docid": "c41b16d40daa4801fee48da95a28feae", "score": "0.70438755", "text": "def update\n errors = {}\n if ! ensure_same_as_logged_person(params['user_id'])\n render_json :status => :forbidden and return\n end\n @person = Person.find_by_guid(params['user_id'])\n if ! @person\n render_json :status => :not_found and return\n end\n if params[:person]\n begin\n if @person.json_update_attributes(params[:person])\n render_json :entry => @person.to_hash(@user, @client) and return\n end\n rescue NoMethodError => e\n errors = e.to_s\n end\n end\n\n render_json :status => :bad_request, :messages => @person.errors.full_messages\n @person = nil\n end", "title": "" }, { "docid": "79b6dfe085883ba2b7ec3d27d6099c58", "score": "0.70425606", "text": "def update\n @person_info = PersonInfo.find(params[:id])\n\n if @person_info.update(person_info_params(params[:person_info]))\n head :no_content\n else\n render json: @person_info.errors, status: :unprocessable_entity\n end\n end", "title": "" }, { "docid": "51a9392fe6a6a28387fdb47213ccc207", "score": "0.7039356", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n set_associations\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "d89320fee4f5f9184408763983800709", "score": "0.7031994", "text": "def update\n flash[:notice] = \"Person was successfully updated.\" if @person.update(person_params)\n respond_with(@person)\n end", "title": "" }, { "docid": "67c879b6174932ec75d7ed75d144779b", "score": "0.70266765", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: t('.update_ok') }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "856243eec2b39d1460160f757acaebf1", "score": "0.70222056", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n flash[:notice] = 'Person was successfully updated.'\n format.html { redirect_to(@person) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "856243eec2b39d1460160f757acaebf1", "score": "0.70222056", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n flash[:notice] = 'Person was successfully updated.'\n format.html { redirect_to(@person) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "61c66428414122f5898ba89e54fc3612", "score": "0.70186883", "text": "def update\n @persona = Persona.find(params[:id])\n \n respond_to do |format|\n if @persona.update_attributes(params[:persona])\n format.json { head :ok }\n else\n format.json { render :json => @persona.errors,\n :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e07667829cbe3f845484a8e49b2fd66a", "score": "0.700606", "text": "def update\n if params[:person][:company_name]\n params[:person][:company] = Company.find_or_create_by_name(params[:person][:company_name])\n params[:person].delete(:company_name)\n end\n @person = Person.find(params[:id])\n\n authorize! :edit, @person\n \n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3cced975feef75152008cb929c665f3c", "score": "0.7004639", "text": "def update\n @person = Person.find(params[:id])\n flash[:notice] = 'Person was successfully updated.' if @person.update_attributes(params[:person])\n respond_with(@person)\n end", "title": "" }, { "docid": "fb96b6eb28f220cccf4fdf7d85771b0b", "score": "0.69704944", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to admin_person_url(@person), notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e9468d2f0c1ae9d3628fbd803d16873a", "score": "0.6961314", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Cadastro atualizado com sucesso!' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "43821817955058b3b224f65ec22d7943", "score": "0.69524014", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n flash[:notice] = 'Pessoa atualizada com sucesso!'\n format.html { redirect_to(@person) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7575246ab0617b227d70b6b85e651f23", "score": "0.69460034", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n flash[:notice] = 'Person was successfully updated.'\n format.html { redirect_to(@person) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\", :layout => \"main\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4185e9c30ee3c6486fb8fd9aa06cfc3f", "score": "0.69222915", "text": "def update\n @person = Person.find(params[:id])\n \n if @person.update(person_param)\n redirect_to action: 'show', id: @person\n else\n render action: 'edit'\n end\n end", "title": "" }, { "docid": "01aa8bbac5188cd031237aa251177068", "score": "0.68909407", "text": "def update\n\t\tperson = Person.find_by_id(user_params[\"id\"])\n\t\tif person\n\t\t\tperson.favoriteCity = params[\"update\"]\n\t\t\tif person.save\n\t\t\t\trender json: {id: person.id, name: person.name, favoriteCity: person.favoriteCity}\n\t\t\telse\n\t\t\t\trender body: 'Person Invalid', status: 404\n\t\t\tend\n\t\telse\n\t\t\trender body: 'Person Not Found', status: 404\n\t\tend\n\tend", "title": "" }, { "docid": "40e2faf28d19d7405dc85782db7a00ac", "score": "0.6866714", "text": "def update\n\n if @person.update_attributes(params[:person])\n redirect_to people_path, notice: @person.name.to_s + ' was successfully updated.'\n else\n render action: \"edit\"\n end\n end", "title": "" }, { "docid": "d3dee1e0da2443d65f6af21a42e23873", "score": "0.68498427", "text": "def update\n @person = Person.find(params[:id])\n @title = \"people\"\n\n# @person.firstname = @person.firstname.upcase\n# @person.lastname = @person.lastname.capitalize\n params[:person][:firstname] = params[:person][:firstname].upcase\n params[:person][:lastname] = params[:person][:lastname].upcase\n\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to(@person, :notice => 'Person was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ca653a6c2d3331483ec5867d5c4ac288", "score": "0.6831591", "text": "def update\n respond_to do |format|\n if @request_person.update(request_person_params)\n format.html { redirect_to @request_person, notice: 'Request person was successfully updated.' }\n format.json { render :show, status: :ok, location: @request_person }\n else\n format.html { render :edit }\n format.json { render json: @request_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cfe87f4479d7bbadfbc7c887e4385bee", "score": "0.68243754", "text": "def update!(**args)\n @people = args[:people] if args.key?(:people)\n end", "title": "" }, { "docid": "3f4e9b6e4bed5055483d908c09447373", "score": "0.68177766", "text": "def update\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to(@person, :notice => 'Person was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3f6027d098031c02d7cde8dfccfb0197", "score": "0.68150455", "text": "def update\n @person = current_company.person\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n flash[:notice] = 'Dados atualizados com sucesso!'\n format.html { render :action => \"edit\" }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "88d025b9734bd12399c030dc3c390173", "score": "0.6807724", "text": "def update\n respond_to do |format|\n if @person.update(admin_person_params)\n format.html { redirect_to [:admin, @person], notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "0ae64b663fc357517d983c4a3a51fccc", "score": "0.6796563", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n @person.gender = nil if @person.gender.empty?\n @person.gravatar_code = nil if @person.gravatar_code.empty?\n @person.save\n format.html { redirect_to(@person, :notice => 'Person was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ded21604b6570af7da19fb864d94a663", "score": "0.6788924", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to @person, notice: 'Данные клиента обновлены.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "49fc6ef30b8d2734940415a9f724b1e7", "score": "0.67536443", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n flash[:notice] = 'Person was successfully updated.'\n format.html { redirect_to people_url }\n format.xml { head :ok }\n else\n flash[:warning] = 'Please check every information that you are entering and fill the required fields.'\n format.html { render :edit }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4498b0424f053ba5d49cf49d7d2637ae", "score": "0.67402816", "text": "def update\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n track_activity @person\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render layout: 'form', action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c7135cd7b81f7d446b9e77c899ae1dfc", "score": "0.67376566", "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": "851c9c03027ad0b0e1cab2781f1dcc83", "score": "0.6727795", "text": "def update\n @persona = Persona.find(params[:id])\n\n respond_to do |format|\n if @persona.update_attributes(params[:persona])\n format.html { redirect_to personas_path, notice: 'Persona was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @persona.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1fc3f01e8116ada966b0751a2dcc4354", "score": "0.6699725", "text": "def update\n @tasks_person = TasksPerson.find(params[:id])\n\n respond_to do |format|\n if @tasks_person.update_attributes(params[:tasks_person])\n format.html { redirect_to @tasks_person, notice: 'Tasks person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @tasks_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "74fb34dcfd307fc2790cbf577e524cdb", "score": "0.6692084", "text": "def update\n @type_person = TypePerson.find(params[:id])\n\n respond_to do |format|\n if @type_person.update_attributes(params[:type_person])\n format.html { redirect_to @type_person, notice: 'Type person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @type_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "25485ec51edef9244d6543c98d08ce93", "score": "0.66908157", "text": "def update\n @person = @scope.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to(@person, :notice => I18n.t('people.update.success')) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "3ba0c24a77e52473670d3bdb0042010d", "score": "0.6677213", "text": "def put_update(options = {})\n options[:id] ||= @phone.id\n options[:phone] ||= @attributes\n\n # options[:email][@email.id.to_s] = @attributes\n put :update,options\n end", "title": "" }, { "docid": "30049483ea20dd3f8258dc77545ab656", "score": "0.667429", "text": "def update\n @personaje = Personaje.find(params[:id])\n\n respond_to do |format|\n if @personaje.update_attributes(params[:personaje])\n format.html { redirect_to @personaje, notice: 'Personaje was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @personaje.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a20fe1a6b5ad8765dcc406a3720eb2b", "score": "0.66653454", "text": "def update\n @person = Person.find(params[:id])\n flash[:notice] = @person.Name + \" updated.\" if @person.update_attributes(params[:person])\n end", "title": "" }, { "docid": "8bf744464ca45d9153dd2e97e490913f", "score": "0.6658825", "text": "def update\n @missing_person = MissingPerson.find(params[:id])\n\n respond_to do |format|\n if @missing_person.update_attributes(params[:missing_person])\n format.html { redirect_to @missing_person, notice: 'Missing person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @missing_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "af7399653385d0553bccabdda1096c3c", "score": "0.6655732", "text": "def update\n @person = load_person\n @person_form = person_form\n\n if @person_form.valid? && @person_form.save\n redirect_to(admin_person_path(@person_form.id))\n else\n render :edit\n end\n end", "title": "" }, { "docid": "2283d6ccccd0ac63fc8147d164eefc3d", "score": "0.66431576", "text": "def update\n @personnage = Personnage.find(params[:id])\n\n respond_to do |format|\n if @personnage.update_attributes(params[:personnage])\n format.html { redirect_to @personnage, notice: 'Personnage was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @personnage.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9384313854167f456edec7ab31afa515", "score": "0.6641802", "text": "def update\n @person = Person.find(params[:id])\n\t\n respond_to do |format|\n if @person.update_attributes(params[:person])\n flash[:notice] = 'Person was successfully updated.'\n format.html { redirect_to( :action => 'show', :id => @person) }\n\t # format.html { redirect_to( :action => 'index' ) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "493b31d5bb424f5c0304ed531c145b39", "score": "0.6610078", "text": "def update\n @person = Person.find(params[:id])\n @person.delete_offices\n @person.delete_addresses\n @person.delete_phone_numbers\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, notice: 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c85df21a2c45bc007bfb6a9012f0ba65", "score": "0.65961146", "text": "def update\n @classified_person = ClassifiedPerson.find(params[:id])\n\n respond_to do |format|\n if @classified_person.update_attributes(params[:classified_person])\n flash[:notice] = 'ClassifiedPerson was successfully updated.'\n format.html { redirect_to(@classified_person) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @classified_person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "aa9d0b0ca6116043535673470427a2fe", "score": "0.6594926", "text": "def update\n if @person.seat\n render json: {errors: 'Cannot update a seated person'}, status: 422\n else\n @person.update person_params\n render json: @person\n end\n end", "title": "" }, { "docid": "96b409cdf63d055eb88403dea2677fd9", "score": "0.6586727", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n if current_user\n if current_user.user?\n current_user.person_id = @person.id\n current_user.save\n end\n end\n format.html { redirect_to @person, notice: 'Uppgifterna uppdaterades. Tack' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "9ee2c828c0f784aa7ef77fcc63ae2383", "score": "0.6580428", "text": "def update\n respond_to do |format|\n if @person.update_attributes(permit_params)\n format.html { redirect_to(@person, :notice => 'Person was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "f8205d379b346909fcd7999658581c8a", "score": "0.6558336", "text": "def update\n respond_to do |format|\n if @personel.update(personel_params)\n format.html { redirect_to @personel, notice: 'Personel was successfully updated.' }\n format.json { render :show, status: :ok, location: @personel }\n else\n format.html { render :edit }\n format.json { render json: @personel.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "eae2f9a9298053f9b5563488be4f9226", "score": "0.6555578", "text": "def update\n @people = Person.pluck(:name, :id)\n puts \"*** From update: \" \n\n respond_to do |format|\n if @book.update(book_params)\n format.html { redirect_to @book, notice: 'Book was successfully updated.' }\n format.json { render :show, status: :ok, location: @book }\n else\n format.html { render :edit }\n format.json { render json: @book.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a000f5cf38837edd6b0286ef1cb78a1", "score": "0.65528524", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.js {}\n format.html { redirect_to people_url, notice: \"Person #{@person.first_name} was successfully updated.\" }\n format.json { render :show, status: :ok, location: @person }\n else\n format.js {}\n format.html { render :edit, status: :unprocessable_entity }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "ded04ad7325ef5cf03c91ee0de52724f", "score": "0.65512174", "text": "def update\n respond_to do |format|\n if @emu_person.update(emu_person_params)\n format.html { redirect_to @emu_person, notice: 'Emu person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render action: 'edit' }\n format.json { render json: @emu_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "4604ecdde24f01c77ffb32d846ed2384", "score": "0.65444696", "text": "def update\n @persona = Persona.find(params[:id])\n\n respond_to do |format|\n #@persona.attributes = params[:persona] if params[:persona]\n \n if @persona.update_attributes(params[:persona])\n format.html { redirect_to(@persona, :notice => 'Persona was successfully updated.') }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @persona.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c0ad5773294757e1b8994761e223b841", "score": "0.65430033", "text": "def update\n # @person = Person.find(params[:id])\n # @person.pct_complete = @person.requirement_progress\n respond_to do |format|\n if @person.update_attributes(params[:person])\n format.html { redirect_to @person, :notice => 'Person was successfully updated.' }\n format.json { head :no_content }\n else\n format.html { render :action => \"edit\" }\n format.json { render :json => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "67ae52510ad5d8fa6057b044f09d02fd", "score": "0.6536459", "text": "def update\n respond_to do |format|\n if @spr_person.update(spr_person_params)\n format.html { redirect_to @spr_person, notice: 'Spr person was successfully updated.' }\n format.json { render :show, status: :ok, location: @spr_person }\n else\n format.html { render :edit }\n format.json { render json: @spr_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "85ef962aa0525988638c57e34ef944f0", "score": "0.6532147", "text": "def update\n @project = Project.find(params[:project_id])\n @person = Person.find(params[:id])\n\n respond_to do |format|\n if @person.update_attributes(params[:person])\n flash[:notice] = 'Person was successfully updated.'\n format.html { redirect_to(@person) }\n format.xml { head :ok }\n else\n format.html { render :action => \"edit\" }\n format.xml { render :xml => @person.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "e5691cf8b1e8f957e2288dcc87d50409", "score": "0.6523152", "text": "def update\n respond_to do |format|\n if @person.update(person_params)\n format.html { redirect_to result_path(@person), notice: 'Person was successfully updated.' }\n format.json { render :show, status: :ok, location: @person }\n else\n format.html { render :edit }\n format.json { render json: @person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "09676fbcd0a438f3483ffb294b9cae91", "score": "0.65121925", "text": "def update\n respond_to do |format|\n if @addresses_person.update(addresses_person_params)\n format.html { redirect_to @addresses_person, notice: 'Addresses person was successfully updated.' }\n format.json { render :show, status: :ok, location: @addresses_person }\n else\n format.html { render :edit }\n format.json { render json: @addresses_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7525ce925e6aaee1cd72627b5f677e86", "score": "0.6509219", "text": "def update\n @key_person = KeyPerson.find(params[:id])\n\n respond_to do |format|\n if @key_person.update_attributes(params[:key_person])\n format.html { redirect_to @key_person, notice: 'Key person was successfully updated.' }\n format.json { head :ok }\n else\n format.html { render action: \"edit\" }\n format.json { render json: @key_person.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" } ]
782e14bca1ae7f0f32c7194611c1f8e1
GET /wishlists GET /wishlists.json
[ { "docid": "5ff16e89deec807cba3329a9b0a9e030", "score": "0.65151966", "text": "def index\n if current_user.present?\n @wishlists1 = current_user.wishlists\n end\n @wishlists2 = Wishlist.where(\"shared =?\", 'public')\n @users = current_users\n end", "title": "" } ]
[ { "docid": "fb36cf1250dbef08b124a0edfc4bc6a1", "score": "0.8156006", "text": "def wish_list(options={})\n get('/wish_list', options)\n end", "title": "" }, { "docid": "4f2a5dc8cc42ed79611874a877ff7a84", "score": "0.7813523", "text": "def index\n @wishlists = Wishlist.all\n @mywishlists = Wishlist.where('user_id' => current_user.id)\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wishlists }\n end\n end", "title": "" }, { "docid": "dd8f28bf41922dc68e9aa71a86735e02", "score": "0.7668722", "text": "def index\n\t@wishlist = Wishlist.all\n\t@client = Client.all\n\t#@product = Product.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wishlists }\n end\n end", "title": "" }, { "docid": "35bd738320e9cd8daf51b2f792e54bbb", "score": "0.76556826", "text": "def index\n @wish_lists = WishList.all\n end", "title": "" }, { "docid": "3534fd7bff89404301aa65fa0aa86dfa", "score": "0.7374449", "text": "def index\n @wishlists = Wishlist.where(user_id: current_user.id)\n end", "title": "" }, { "docid": "640ab4f18febcfe363aa2231bf69d93b", "score": "0.72073555", "text": "def show\n @wishlistitem = Wishlistitem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @wishlistitem }\n end\n end", "title": "" }, { "docid": "fdeb8cceebab154186348f3f7f670ebd", "score": "0.71241075", "text": "def show\n @wish_list_item = WishListItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @wish_list_item }\n end\n end", "title": "" }, { "docid": "fe0fb6ecafec90875de574efa4b5fa20", "score": "0.7093352", "text": "def index\n @wish_list_items = WishListItem.all\n end", "title": "" }, { "docid": "701f9ed5a5935c09fafbf39b397c4938", "score": "0.7009122", "text": "def index\n @wish_lists = WishList.find(:all, :order => 'created_at DESC').paginate :per_page => 20, :page => params[:page]\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @wish_lists }\n end\n end", "title": "" }, { "docid": "132db82874909647cfc490337d82227e", "score": "0.69405407", "text": "def index\n set_user\n @wishlists = Wishlist.where(user_id: @user.id) || []\n end", "title": "" }, { "docid": "521920f7824398cc388b931ad67463ef", "score": "0.693525", "text": "def show\n @wishlist = Wishlist.find(params[:id])\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @wishlist }\n end\n end", "title": "" }, { "docid": "03fd0c19424ddc7c87c646acefd083b3", "score": "0.6934985", "text": "def show\n @wishlist = Wishlist.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @wishlist }\n end\n end", "title": "" }, { "docid": "fb679879e24c1fcf83374c5f89be6b90", "score": "0.6867981", "text": "def show\n \t@wishlist = Wishlist.find(params[:id])\n \t@client = @wishlist.client\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @wishlist }\n end\n end", "title": "" }, { "docid": "16035a39bed8d1002385c45ad0078e78", "score": "0.6729806", "text": "def show\n @wish = Wish.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @wish }\n end\n end", "title": "" }, { "docid": "a6e727e7f0cb66b941a1682b3cf69aec", "score": "0.6717034", "text": "def show\n @college_wish_list = CollegeWishList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @college_wish_list }\n end\n end", "title": "" }, { "docid": "53ca36650a14f5d1f87a12c53dd42343", "score": "0.6692256", "text": "def set_wish_list\n @wish_list = WishList.find(params[:id])\n end", "title": "" }, { "docid": "53ca36650a14f5d1f87a12c53dd42343", "score": "0.6692256", "text": "def set_wish_list\n @wish_list = WishList.find(params[:id])\n end", "title": "" }, { "docid": "719b3d3effcb13b311744cfbb5581cdf", "score": "0.6650708", "text": "def show\n @wish_list = WishList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @wish_list }\n end\n end", "title": "" }, { "docid": "38cd27284341f49b1f880c8db9a2ef42", "score": "0.6638712", "text": "def wishlist\n @wishlists = Wishlist.all.order('id DESC')\n render :template => \"backend/Wishlist/wishlist\"\n end", "title": "" }, { "docid": "1994b3d818df6a3fceeda3ab3841cf6d", "score": "0.663104", "text": "def set_wish_list\n @wish_list = current_user.wish_lists.find(params[:id])\n end", "title": "" }, { "docid": "7e7abf9911fd27f7616dd5cc8ecf9ce2", "score": "0.65825635", "text": "def index\n @wishes = Wish.all\n end", "title": "" }, { "docid": "7e7abf9911fd27f7616dd5cc8ecf9ce2", "score": "0.65825635", "text": "def index\n @wishes = Wish.all\n end", "title": "" }, { "docid": "a77733b991e2b06080ce43e709ccb907", "score": "0.6505265", "text": "def set_wish_list\n @wish_list = WishList.where(user_id: current_user_id)\n end", "title": "" }, { "docid": "c73c3de078574aa36ae2df871fa9aef3", "score": "0.6491626", "text": "def index\n @wishes = Wish.valid_wish.all\n end", "title": "" }, { "docid": "528a9345c89d134cf71f85ce0e6906ab", "score": "0.64654213", "text": "def create\n # user_id: current_user[:id], item_description: params[:item_description], item_link: params[:item_link], item_rank: params[:item_rank], item_image: params[:item_image], item_price: params[:item_price]\n \t@wish = Wish.new(wish_params)\n @wish.user = current_user\n \[email protected]\n\n wishList = Wish.where(\"user_id = #{@wish.user_id}\")\n render json: wishList\n\n end", "title": "" }, { "docid": "7e010a51536ec3766d13deafcb9c7bd7", "score": "0.6452316", "text": "def index\n @wishlist_items = WishlistItem.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.xml { render :xml => @wishlist_items }\n end\n end", "title": "" }, { "docid": "a491415f9b172a5c6049cebd18da0936", "score": "0.6447355", "text": "def new\n @wishlistitem = Wishlistitem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wishlistitem }\n end\n end", "title": "" }, { "docid": "9d9b9e6bea6c076bdafabac8978ad288", "score": "0.6439258", "text": "def index\n @wishlist = Wishlist.where(:user_id => current_user.id)\n @wishlist_items = Wishitem.where(:wishlist_id => @wishlist)\n end", "title": "" }, { "docid": "3d7b5aae7f13cd1c6164287116a3ce1c", "score": "0.64290905", "text": "def index\n @lists = current_user.lists\n #@lists = List.all\n render json: @lists\n end", "title": "" }, { "docid": "d0ed23436e3ac02f346acb3baeab3713", "score": "0.6402701", "text": "def create\n @wishlist = Wishlist.new(name: params[:wishlist][:name],\n user_id: current_user.email,\n shared: params[:wishlist][:shared])\n current_user.wishlists << @wishlist\n respond_to do |format|\n if @wishlist.save\n format.html { redirect_to @wishlist, notice: 'Wishlist was successfully created.' }\n format.json { render :index, status: :created, location: @wishlist }\n else\n format.html { render :new }\n format.json { render json: @wishlist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5a5ec3d981162da11ecaff4ddf663be6", "score": "0.6393411", "text": "def new\n @wish_list_item = WishListItem.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wish_list_item }\n end\n end", "title": "" }, { "docid": "0a018ebbf691b1860c61be0a6398c1cf", "score": "0.6388145", "text": "def showListPendingPays\n puts @current_user\n results = HTTParty.get(\"http://192.168.99.101:4055/lists/by_user?user_id=\"+(@current_user[\"id\"]).to_s)\n if results.code == 200\n render json: results.parsed_response, status: 200\n else\n render json: results.parsed_response, status: results.code\n end\n end", "title": "" }, { "docid": "6b641dff1d10a2792c3822ba216936b0", "score": "0.63854235", "text": "def create\n @wishlist = current_user.wishlists.build(params[:wishlist])\n\n respond_to do |format|\n if @wishlist.save\n format.html { redirect_to wishlists_url, notice: 'Wishlist was successfully created.' }\n format.json { redirect_to wishlists_url }\n else\n format.html { render action: \"new\", error: @wishlist.errors }\n format.json { render json: @wishlist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "8c931d84f96fab2c8c3f7336c5377c2e", "score": "0.6374216", "text": "def index\n @wishlists = Wishlist.all\n @authors = Author.all.order(:name)\n @publishers = Publisher.all.order(:name)\n end", "title": "" }, { "docid": "e68588403412144502e230106ec60d92", "score": "0.6343925", "text": "def get_list(user, list)\n get(\"/#{user}/lists/#{list}.json\")\n end", "title": "" }, { "docid": "c4c187ee5e3a47efe788fdf42e497c2b", "score": "0.6313455", "text": "def get_lists(user)\n get(\"/#{user}/lists.json\")\n end", "title": "" }, { "docid": "29a6d4fdf3023bd95f95382ed9f5b61f", "score": "0.63088703", "text": "def new\n @wishlist = Wishlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wishlist }\n end\n end", "title": "" }, { "docid": "29a6d4fdf3023bd95f95382ed9f5b61f", "score": "0.63088703", "text": "def new\n @wishlist = Wishlist.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wishlist }\n end\n end", "title": "" }, { "docid": "bb11c52e6f54f7d176fd7bb6b0de3361", "score": "0.6290506", "text": "def index\n @lists = current_project.lists\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @lists }\n end\n end", "title": "" }, { "docid": "4d64e2d693b959cc6ccbdba5e1269336", "score": "0.62663734", "text": "def get_list(list_id)\n rest(\"get\", \"lists/#{list_id}\")\n end", "title": "" }, { "docid": "9b56b1fa515f491097f46ba86d1b4b1e", "score": "0.62596786", "text": "def index\n json_response(@board.lists)\n end", "title": "" }, { "docid": "1a960a970db35bdbb094ef69d3900d3e", "score": "0.62534845", "text": "def show\n @wish_list_item = WishListItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @wish_list_item }\n end\n end", "title": "" }, { "docid": "4178d13a35f8a9b0f6c2aac505b72f2c", "score": "0.6215316", "text": "def create\n @wishlist = current_user.wishlists.build(wishlist_params)\n\n respond_to do |format|\n if @wishlist.save\n format.html { redirect_to wishlists_url, notice: 'Wishlist was successfully created.' }\n format.json { render :show, status: :created, location: @wishlist }\n else\n format.html { render :new }\n format.json { render json: @wishlist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "5ca4c3465cdd59849be6f4ab8bb86c0e", "score": "0.6191968", "text": "def create\n @wish_list = WishList.new(params[:wish_list])\n\n respond_to do |format|\n if @wish_list.save\n flash[:notice] = 'WishList was successfully created.'\n format.html { redirect_to(admin_wish_lists_path) }\n format.xml { render :xml => @wish_list, :status => :created, :location => @wish_list }\n else\n format.html { render :action => \"new\" }\n format.xml { render :xml => @wish_list.errors, :status => :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cf6601268f445d9d9cbadfaf470f512d", "score": "0.61779314", "text": "def index\n @howtolists = Howtolist.all\n # @howtolists = @product.howtolists.all\n\n # respond_to do |format|\n # format.html # index.html.erb\n # format.json { render json: @howtolists }\n # end\n end", "title": "" }, { "docid": "0dd1bb712db03478cabcad3b29442a04", "score": "0.6171688", "text": "def index\n @list_items = List.find(params[:list_id]).list_items\n\n render json: @list_items\n end", "title": "" }, { "docid": "8bae83e7a114a8ba026e2fae4a093269", "score": "0.61550987", "text": "def show\n @twitter_list = TwitterList.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @twitter_list }\n end\n end", "title": "" }, { "docid": "0419c5331fd547eea82c1fb942f16dd8", "score": "0.61339533", "text": "def index\n @lists = List.all\n render json: @lists\n end", "title": "" }, { "docid": "99499c775fd70ea8dbe252c1c202afac", "score": "0.61260676", "text": "def set_wishlist\n @wishlist = current_user.wishlists.find(params[:id])\n end", "title": "" }, { "docid": "60b03275e8abe9f67a6096513baabaef", "score": "0.612044", "text": "def show\n @wishlists = Wishlist.where(user_id: @user.id).to_a || []\n wishlist_ids = @wishlists.pluck(:venue_id)\n\n response = FoursquareService::API.new.get_recent_checkins(session[:access_token])\n @recents = []\n\n response[\"response\"][\"recent\"].each do |recent|\n id = recent['venue']['id']\n unless wishlist_ids.include? id\n recent_item = Hash.new\n recent_item[:venue_id] = id\n recent_item[:venue_name] = recent['venue']['name']\n recent_item[:user_name] = \"#{recent['user']['firstName']} #{recent['user']['lastName']}\"\n recent_item[:user_photo] = \"#{recent['user']['photo']['prefix'] + '100x100' + recent['user']['photo']['suffix']}\"\n\n # get venue photo\n venue_id = recent['venue']['id']\n\n venue_response = FoursquareService::API.new.get_venue(venue_id, session[:access_token])\n if venue_response['response']['venue']['photos']['count'] != 0\n prefix = venue_response['response']['venue']['photos']['groups'][0]['items'][0]['prefix']\n suffix = venue_response['response']['venue']['photos']['groups'][0]['items'][0]['suffix']\n\n recent_item[:venue_photo] = \"#{prefix}300x300#{suffix}\"\n else\n recent_item[:venue_photo] = \"https://www.socabelec.co.ke/wp-content/uploads/no-photo-14.jpg\"\n end\n\n @recents << recent_item\n end\n end\n end", "title": "" }, { "docid": "a68e9db7ce549852eb72608573d89035", "score": "0.61182654", "text": "def index\n @gift_lists = GiftList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @gift_lists }\n end\n end", "title": "" }, { "docid": "26e417a598e2d5128c376c67024fe262", "score": "0.6114986", "text": "def create\n @wish_list = WishList.new(\n product_id: params[:product_id],\n user_id: params[:user_id]\n )\n respond_to do |format|\n if @wish_list.save\n format.html { redirect_to controller: \"account\", action: \"wishlist\" }\n format.json { render :show, status: :created, location: @wish_list }\n else\n format.html { render :new }\n format.json { render json: @wish_list.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "1583d490b82e9612e4369fc87f8366a1", "score": "0.61133397", "text": "def index\n wishes = Wish.all.with_attached_image.where(is_secret: false)\n render json: { wishes: generate_image_url(wishes) }\n end", "title": "" }, { "docid": "f9c437690905bf01dddb82a90391666d", "score": "0.60994476", "text": "def favorites\n @lists = current_user.favorites\n respond_with(@lists)\n end", "title": "" }, { "docid": "43ba52d2aa1e166743ade2c6aa48ae35", "score": "0.60987264", "text": "def index\n # @playlists = Playlist.all\n # @playlists = @playlists.page(params[:page] || 1)\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: { playlists: @playlists } }\n end\n end", "title": "" }, { "docid": "52fe6ca302b7480486944715e91922c4", "score": "0.6098244", "text": "def show\n @list = current_project.lists.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @list }\n end\n end", "title": "" }, { "docid": "97ad184f096824afcc9623328a0d96f7", "score": "0.6096699", "text": "def index\n @granted_wishes = GrantedWish.all.page(params[:page])\n end", "title": "" }, { "docid": "219cd039fffbaa1da75a8bb11f0d3851", "score": "0.609571", "text": "def update\n @wishlist = current_user.wishlists.find(params[:id])\n\n respond_to do |format|\n if @wishlist.update(wishlist_params)\n format.html { redirect_to wishlists_url, notice: 'Wishlist was successfully updated.' }\n format.json { render :show, status: :ok, location: @wishlist }\n else\n format.html { render :edit }\n format.json { render json: @wishlist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "59d0fbcb98c1978f1f7c4ae081b50c0d", "score": "0.6090371", "text": "def index\n paginate json: @user.playlists.all\n end", "title": "" }, { "docid": "230ff0a4adf6e32c009832ae7c2e14ac", "score": "0.60867107", "text": "def show\n @favourite_listing = get_favourite_listing(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.json { render json: @favourite_listing }\n end\n end", "title": "" }, { "docid": "836f23eeb606f85977a653e52b58e96e", "score": "0.6076293", "text": "def new\n @wish = Wish.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.json { render json: @wish }\n end\n end", "title": "" }, { "docid": "e886e0d4febf6f553d7ae284407fd4e5", "score": "0.6066743", "text": "def find_wishlist\n @wishlist = Spree::Wishlist.find_by_access_hash!(params[:id])\n end", "title": "" }, { "docid": "7aa46c3b427e2e7cab15eb627cf7d52f", "score": "0.60596645", "text": "def create\n @wishlistitem = Wishlistitem.new(params[:wishlistitem])\n\n respond_to do |format|\n if @wishlistitem.save\n format.html { redirect_to @wishlistitem, notice: 'Wishlistitem was successfully created.' }\n format.json { render json: @wishlistitem, status: :created, location: @wishlistitem }\n else\n format.html { render action: \"new\" }\n format.json { render json: @wishlistitem.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "7416ef4794dd4ac56f5be1ee479c4dda", "score": "0.60568213", "text": "def find_wishlist\n @wishlist = Spree::Wishlist.find_by!(access_hash: params[:id])\n end", "title": "" }, { "docid": "5eef3ead468f38db5c738049dcc96b25", "score": "0.6039515", "text": "def index\n @tasks = current_user.lists.find(params[:list_id]).tasks\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @tasks }\n end\n end", "title": "" }, { "docid": "a3081c8cec82b1471251d7c0af972e55", "score": "0.6036586", "text": "def index\n @wks = Wk.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @wks }\n end\n end", "title": "" }, { "docid": "3ec13b4b2cbedaafc989b841fc87bba3", "score": "0.6034976", "text": "def wish_list_params\n params.require(:wish_list).permit(:name)\n end", "title": "" }, { "docid": "388956b663f25cb8449ee416de4ee2a1", "score": "0.6032656", "text": "def find_wishlist\n @wishlist = Spree::Wishlist.find_by_access_hash!(params[:id])\n end", "title": "" }, { "docid": "68621319630774a2a929a903403f7f3e", "score": "0.6024189", "text": "def new\n @wish_list = WishList.new\n\n respond_to do |format|\n format.html # new.html.erb\n format.xml { render :xml => @wish_list }\n end\n end", "title": "" }, { "docid": "4d02c2afb51ac4b2eb081702b80aea11", "score": "0.60228723", "text": "def destroy\n @wish_list = WishList.find(params[:id])\n @wish_list.destroy\n\n respond_to do |format|\n format.html { redirect_to(admin_wish_lists_url) }\n format.xml { head :ok }\n end\n end", "title": "" }, { "docid": "f5010b4a4d2a3d10d2a46d4d90e0673d", "score": "0.60057455", "text": "def show\n render json: @wellist\n end", "title": "" }, { "docid": "408fabed40490c4c4cc0eefc44cb9dc5", "score": "0.60008025", "text": "def index\n @todo_lists = TodoList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @todo_lists }\n end\n end", "title": "" }, { "docid": "d45e56d2dc613b7c0ddd7b33291d8791", "score": "0.5990692", "text": "def destroy\n @wishlistitem = Wishlistitem.find(params[:id])\n @wishlistitem.destroy\n\n respond_to do |format|\n format.html { redirect_to wishlistitems_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "a096927528b1505b463aa5a216a0f517", "score": "0.598837", "text": "def create\n @wish_list_item = WishListItem.new(params[:wish_list_item])\n\n respond_to do |format|\n if @wish_list_item.save\n format.html { redirect_to @wish_list_item, notice: 'Wish list item was successfully created.' }\n format.json { render json: @wish_list_item, status: :created, location: @wish_list_item }\n else\n format.html { render action: \"new\" }\n format.json { render json: @wish_list_item.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "b685590dccccf3dcc004f6ea4fed9be7", "score": "0.59859496", "text": "def create\n @wishlist = Wishlist.new(params[:wishlist])\n\n respond_to do |format|\n if @wishlist.save\n format.html { redirect_to @wishlist, notice: 'Wishlist was successfully created.' }\n format.json { render json: @wishlist, status: :created, location: @wishlist }\n else\n format.html { render action: \"new\" }\n format.json { render json: @wishlist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "c32f116c3b47e8d4e9f0083d8fb65965", "score": "0.598496", "text": "def getPlaylists\n\t\tuserid = current_user.uid\n\t\tplaylists = GetPlaylistMetadataFromSpotify.build.call(session[\"devise.spotify_data\"])\n\t\tPlaylist.sync_playlists(playlists, userid)\n\t\trender json: playlists\n\tend", "title": "" }, { "docid": "e5f549cf42ab70b077424b34c474a7fa", "score": "0.59700054", "text": "def index\n @watch_lists = WatchList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @watch_lists }\n end\n end", "title": "" }, { "docid": "3314b9037e737c7ce3fca288b1f6f4fa", "score": "0.596786", "text": "def index\n @wishlist_projects = WishlistProject.all\n authorize! :read, @wishlist_projects\n end", "title": "" }, { "docid": "741c9c80f21f96d8c5e046ee5a3a21c5", "score": "0.596426", "text": "def index\n @stopword_lists = StopwordList.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @stopword_lists }\n end\n end", "title": "" }, { "docid": "d772e38e316e09e315658c2b59a0caa9", "score": "0.5960351", "text": "def show\n @wishlist_item = WishlistItem.find(params[:id])\n\n respond_to do |format|\n format.html # show.html.erb\n format.xml { render :xml => @wishlist_item }\n end\n end", "title": "" }, { "docid": "8913f673373a460f837fcfa6ba0ff354", "score": "0.59581095", "text": "def index\n @whoarewes = Whoarewe.all\n\n respond_to do |format|\n format.html # index.html.erb\n format.json { render json: @whoarewes }\n end\n end", "title": "" }, { "docid": "8153cc13f03d49be420279fb0a7e187d", "score": "0.59514093", "text": "def destroy\n @wish_list_item = WishListItem.find(params[:id])\n @wish_list_item.destroy\n\n respond_to do |format|\n format.html { redirect_to wish_list_items_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "1bea5247f388259748ec3eff87237eb8", "score": "0.5949754", "text": "def index\n @wish_list = WishList.find_by_id(params[:wish_list_id])\n # @valid_accesses = ValidAccess.all\n @valid_accesses = @wish_list.valid_accesses\n end", "title": "" }, { "docid": "b0bd3054ab29bf397b627e0f7baf1c65", "score": "0.594837", "text": "def list\r\n #page = params[:page].nil? ? 0 : params[:page]\r\n tweets = Tweet.all\r\n render json: tweets\r\n end", "title": "" }, { "docid": "09b9fd21a5997c742bbbf060cc1a308f", "score": "0.59425604", "text": "def set_wish_list_item\n @wish_list_item = WishListItem.find(params[:id])\n end", "title": "" }, { "docid": "4f9c06cb38718b9667e827ef95e51362", "score": "0.59415275", "text": "def show\n authenticate\n list = List.find(params[:id])\n items = list.items\n render json: {\n items: items,\n id: list.id\n }\n end", "title": "" }, { "docid": "a1c85e0015c22ed997875fe6504e6b6b", "score": "0.5917324", "text": "def set_wishlist\n @wishlist = Wishlist.find(params[:id])\n end", "title": "" }, { "docid": "204ea0b7eb59c378fe80953052a21039", "score": "0.59044725", "text": "def get_lists\n response = rest(\"get\", \"lists\")\n\n return response[\"lists\"]\n end", "title": "" }, { "docid": "d12f956df1f83b2aebb1ccf339e0a0f7", "score": "0.59030014", "text": "def bid_lists\n\t\tauction_item_bids = @auction.auction_item_bids.where(user_id: current_user.id)\n\t\trender json: @auction_item_bids.as_json\n\tend", "title": "" }, { "docid": "75940c703a87a2d6b4ad84859f110220", "score": "0.59009683", "text": "def create\n @wishlist = Wishlist.new(wishlist_params)\n\n respond_to do |format|\n if @wishlist.save\n format.html { redirect_to @wishlist, notice: 'Wishlist was successfully created.' }\n format.json { render :show, status: :created, location: @wishlist }\n else\n format.html { render :new }\n format.json { render json: @wishlist.errors, status: :unprocessable_entity }\n end\n end\n end", "title": "" }, { "docid": "cdecbdf95c7424b25cfcf8288f2d0413", "score": "0.5900823", "text": "def destroy\n @wishlist = Wishlist.find(params[:id])\n @wishlist.destroy\n\n respond_to do |format|\n format.html { redirect_to wishlists_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "cdecbdf95c7424b25cfcf8288f2d0413", "score": "0.5900823", "text": "def destroy\n @wishlist = Wishlist.find(params[:id])\n @wishlist.destroy\n\n respond_to do |format|\n format.html { redirect_to wishlists_url }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "b2ea03ba07f827d766139d6a0c50a683", "score": "0.5885157", "text": "def index\n @api_v1_shopping_lists = ShoppingList.all\n end", "title": "" }, { "docid": "d69331f0487ed9064ed05b536ab40c72", "score": "0.5884031", "text": "def index\n @lists = List.inactive.paginate(page: params[:page], per_page: PER_PAGE)\n\n respond_to do |format|\n format.html\n format.json { render json: { status: 200, items: @lists } }\n end\n end", "title": "" }, { "docid": "646c0891270502692ba89e41b9a7d61d", "score": "0.58789104", "text": "def index\n @favorites = current_user.favorites\n render json: Api::V1::WatchableSerializer.new(@favorites.map(&:favoritable)).serialized_json\n end", "title": "" }, { "docid": "308a30ab8ed531445b238dd5e91890e3", "score": "0.58745176", "text": "def list\n url = prefix + \"list\"\n return response(url)\n end", "title": "" }, { "docid": "7ba1477e087adc4fe643f685be4d1d48", "score": "0.5861676", "text": "def index\n @purchase_lists = PurchaseList.all\n render json: @purchase_lists\n end", "title": "" }, { "docid": "5d8f3c00b7f05fb449d7a5fb7f31008f", "score": "0.5861126", "text": "def destroy\n @wish_list_item.destroy\n respond_to do |format|\n format.html { redirect_to wish_list_url(@wish_list_item.wish_list), notice: 'Wish list item was successfully destroyed.' }\n format.json { head :no_content }\n end\n end", "title": "" }, { "docid": "55da26d6e611a58e8fe4e03f2dcb699b", "score": "0.585682", "text": "def lists\n client.get_lists\n end", "title": "" }, { "docid": "541c92684f52669a354be3c296287637", "score": "0.58556044", "text": "def wishlist\n @lineItems = LineItem.where(\"user_id = ? AND line_item_type = ?\", current_user.id, 1)\n @items = Array.new\n @lineItems.each do |lineItem|\n @items.push(lineItem.item)\n end\n end", "title": "" } ]
0cf2c00bce5454b05e7010a8f0b5083e
Get the rules or settings defined for a role management policy. The rules are a collection of following types that are derived from the unifiedRoleManagementPolicyRule object:+ unifiedRoleManagementPolicyApprovalRule+ unifiedRoleManagementPolicyAuthenticationContextRule+ unifiedRoleManagementPolicyEnablementRule+ unifiedRoleManagementPolicyExpirationRule+ unifiedRoleManagementPolicyNotificationRule
[ { "docid": "583f0340a1135981bddd4932c2263d5b", "score": "0.5156132", "text": "def get(request_configuration=nil)\n request_info = self.to_get_request_information(\n request_configuration\n )\n error_mapping = Hash.new\n error_mapping[\"4XX\"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }\n error_mapping[\"5XX\"] = lambda {|pn| MicrosoftGraph::Models::ODataErrorsODataError.create_from_discriminator_value(pn) }\n return @request_adapter.send_async(request_info, lambda {|pn| MicrosoftGraph::Models::UnifiedRoleManagementPolicyRuleCollectionResponse.create_from_discriminator_value(pn) }, error_mapping)\n end", "title": "" } ]
[ { "docid": "22e16156f4295488d1321af5647aa903", "score": "0.6923373", "text": "def role_management_policies\n return @role_management_policies\n end", "title": "" }, { "docid": "512e310677b97e4b00203e4b2c3d2173", "score": "0.6343358", "text": "def role_management_policies()\n return MicrosoftGraph::Policies::RoleManagementPolicies::RoleManagementPoliciesRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "25244807653ac522b58fec796a4d7e05", "score": "0.6288145", "text": "def role_management_policy_assignments\n return @role_management_policy_assignments\n end", "title": "" }, { "docid": "856a435c1fa083d1936f7d71df932bde", "score": "0.6236104", "text": "def rule_set\n self.class.roles_n_privileges_hash[\"role_#{@role_name}\".to_sym]\n end", "title": "" }, { "docid": "bcf1874adebc4499308ab2aee667419b", "score": "0.60272634", "text": "def role_management_policies=(value)\n @role_management_policies = value\n end", "title": "" }, { "docid": "f601c91b648c2a17f00c62b0feaeb75e", "score": "0.60209095", "text": "def get_rules\n @rules\n end", "title": "" }, { "docid": "a25f07d47e5cdde85f2d13e7d55e5468", "score": "0.59939677", "text": "def user_rules\n default_rules\n @user.roles.each do |role|\n meth = :\"#{role}_rules\"\n send(meth) if respond_to? meth\n end\n end", "title": "" }, { "docid": "d0f647dd10e987b16fb22a03ea838e39", "score": "0.5984884", "text": "def rules\n return @rules\n end", "title": "" }, { "docid": "d0f647dd10e987b16fb22a03ea838e39", "score": "0.5984884", "text": "def rules\n return @rules\n end", "title": "" }, { "docid": "d0f647dd10e987b16fb22a03ea838e39", "score": "0.5984884", "text": "def rules\n return @rules\n end", "title": "" }, { "docid": "cc4fe0b649c62749cb3031757e14615c", "score": "0.59454644", "text": "def rulesets\n system.rulesets\n end", "title": "" }, { "docid": "19d2e6be2dbebd5e4dca842f40eaba01", "score": "0.59260327", "text": "def role_management_policy_assignments()\n return MicrosoftGraph::Policies::RoleManagementPolicyAssignments::RoleManagementPolicyAssignmentsRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "223e4cf44366679eac2a292ab1097dbf", "score": "0.58277225", "text": "def get_rules\n\t\t\[email protected]_rules\n\t\tend", "title": "" }, { "docid": "64ae89b00118f610e3dff1aa9d4c2249", "score": "0.58008647", "text": "def rules\n @@api.get(endpoint: \"rules\")\n end", "title": "" }, { "docid": "f84b1f7b3887c5bca64816b2b5115d63", "score": "0.57825947", "text": "def app_management_policies\n return @app_management_policies\n end", "title": "" }, { "docid": "f84b1f7b3887c5bca64816b2b5115d63", "score": "0.57825947", "text": "def app_management_policies\n return @app_management_policies\n end", "title": "" }, { "docid": "dfe04d94f3e273b1cd9c60ce8f46f34a", "score": "0.57709235", "text": "def policy_rules\n policy.try(:policy_rules)\n end", "title": "" }, { "docid": "cd5929b6085afbccf5169211362f7694", "score": "0.5743369", "text": "def all_rules\n @rules\n end", "title": "" }, { "docid": "7a318163078b1da95bc8e3aa2badb764", "score": "0.56779486", "text": "def rules\n @rules ||= parse_rules\n end", "title": "" }, { "docid": "67e8067d10f20039bcb7092aefbaf731", "score": "0.56643885", "text": "def rules\n system.rules\n end", "title": "" }, { "docid": "161c5c5187eceac0fda3ef351ec68db5", "score": "0.56556606", "text": "def rules\n @rules ||= []\n end", "title": "" }, { "docid": "161c5c5187eceac0fda3ef351ec68db5", "score": "0.56556606", "text": "def rules\n @rules ||= []\n end", "title": "" }, { "docid": "548e5aa11543afe2a333f26aae0b53f5", "score": "0.56243265", "text": "def get_rules(properties)\n # Interface method\n end", "title": "" }, { "docid": "8f6b830c6af77e5370f60d4362b2c226", "score": "0.5614092", "text": "def policy_rules_from_group_policy_merged\n return @policy_rules_from_group_policy_merged\n end", "title": "" }, { "docid": "5728853353a03544a7676e3b6414a7a0", "score": "0.56024915", "text": "def rules\n self.class.default_rules + @rules\n end", "title": "" }, { "docid": "4a832f348892cbb2795b24d292af53b7", "score": "0.55871135", "text": "def rules\n @rules.dup\n end", "title": "" }, { "docid": "986683333a6ef89a2b3f179030029c08", "score": "0.5585831", "text": "def _rules(resource = nil, role = nil, create = false)\n type_hint! Rend::Acl::Resource, resource\n type_hint! Rend::Acl::Role, role\n\n if resource.nil?\n visitor = @_rules[:all_resources]\n else\n if !@_rules[:by_resource_id].has_key?(resource.id)\n return nil unless create\n @_rules[:by_resource_id][resource.id] = {}\n end\n visitor = @_rules[:by_resource_id][resource.id]\n end\n\n if role.nil?\n if !visitor.has_key?(:all_roles)\n return nil unless create\n visitor[:all_roles] = { :by_privilege_id => {} }\n end\n return visitor[:all_roles]\n end\n\n visitor[:by_role_id] = {} unless visitor.has_key?(:by_role_id)\n\n unless visitor[:by_role_id].has_key?(role.id)\n return nil unless create\n visitor[:by_role_id][role.id] = {\n :by_privilege_id => {},\n :all_privileges => {:type => nil}\n }\n end\n visitor[:by_role_id][role.id]\n end", "title": "" }, { "docid": "789b874400cc96a4d076c65c9b7528c4", "score": "0.556541", "text": "def firewall_rules\n return unless exists?\n additional_resource_properties(\n {\n property_name: \"firewall_rules\",\n property_endpoint: \"#{id}/firewallRules\",\n api_version: @opts[:firewall_rules_api_version],\n },\n )\n end", "title": "" }, { "docid": "9b90a5b1ce4e366792dfc8a6faaac0cf", "score": "0.5554743", "text": "def role_rules\n Hash.new { |hash, key| hash[key] = [] }\n end", "title": "" }, { "docid": "c050118cdf05aabe640d4d280e65c77c", "score": "0.5543056", "text": "def rules\n @rules ||= EMPTY_ARRAY\n .dup\n .concat(superclass.respond_to?(:rules) ? superclass.rules : EMPTY_ARRAY)\n end", "title": "" }, { "docid": "16b48de7cf69ca05fea0187f212d50aa", "score": "0.552413", "text": "def get_rules\n # ensure we substitute all variables\n substitute_variables if @string_to_var\n @rules\n end", "title": "" }, { "docid": "ad230f7e0d3b0bc5ea0d7b9441f20caf", "score": "0.5514059", "text": "def rules\n update_rules_info if @rules_hash.nil?\n @rules_hash\n end", "title": "" }, { "docid": "6a5d86c8126e813b9ce8dd65c1032144", "score": "0.5484093", "text": "def policy_role_policies\n @policy_role_policies ||= Array.new.tap do |uris|\n policy_roles_results.each_with_object(uris) { |r, memo| memo << r[Ddr::Index::Fields::INTERNAL_URI] }\n end\n end", "title": "" }, { "docid": "11ae239cfd596801a8043f6c3bd7f6c9", "score": "0.5469923", "text": "def list_rules(*p)\n topic_name, subscription_name, options = _subscription_args(*p)\n\n query = {}\n query[\"$skip\"] = options[:skip].to_i.to_s if options[:skip]\n query[\"$top\"] = options[:top].to_i.to_s if options[:top]\n\n results = resource_list(:rule, topic_name, subscription_name, query)\n results.each { |r| r.topic = topic_name; r.subscription=subscription_name }\n\n return results\n end", "title": "" }, { "docid": "bef97edf8eaec20bb6ba87eee10bc7c5", "score": "0.5417111", "text": "def rules # :nodoc: \n self.class.rules + @rules\n end", "title": "" }, { "docid": "e289d5b28b21e3a7fba416aebe38d2c5", "score": "0.5409796", "text": "def get_config_rules\n # https://docs.aws.amazon.com/sdkforruby/api/Aws/ConfigService/Client.html#describe_config_rules-instance_method\n @cs.describe_config_rules.config_rules\n end", "title": "" }, { "docid": "168b6f012672aec273781a7262500fa5", "score": "0.5404964", "text": "def rules\n @rules ||= {}\n end", "title": "" }, { "docid": "0f3b42b4928d0b705b829c8bd9f99b2c", "score": "0.5383481", "text": "def rules\n super_rules = super\n return nil if super_rules == nil\n return nil unless super_rules.class.name == 'Array'\n return nil if super_rules.size == 0\n\n @loaded_rules ||= begin\n rulz = []\n super_rules.each do |rule|\n [rule[:rule_id]].flatten.each do |rule_id|\n language_rule = Tr8n::LanguageRule.by_id(rule_id)\n rulz << rule.merge({:rule => language_rule}) if language_rule\n end\n end\n rulz\n end\n end", "title": "" }, { "docid": "a891425c1bf5f60ce569ad6d219d6d84", "score": "0.53794295", "text": "def rules\n return [] if @rules.empty?\n @rules.sort_by { |k| k['priority'] }.map { |h| h['rule_name'] }\n end", "title": "" }, { "docid": "e26a83692b12ee72f20d8426c121aa76", "score": "0.5368069", "text": "def rules \n self.class.rules + @rules\n end", "title": "" }, { "docid": "3e256a63a1c0e08a0ce8d8e5410a7aa7", "score": "0.53676695", "text": "def effective_rules\n return @effective_rules\n end", "title": "" }, { "docid": "07d296b9a4e17a6d7a8f16867058c002", "score": "0.5355312", "text": "def rules_definitions\n return nil if rules.nil? or rules.empty? \n @rules_definitions ||= begin\n rulz = {}\n rules.each do |rule|\n rulz[rule[:token].clone] = rule[:rule].to_hash \n end\n rulz\n end\n end", "title": "" }, { "docid": "4ea5632b8a51a161ff339d9021e5ac65", "score": "0.53530484", "text": "def role_definitions\n return @role_definitions\n end", "title": "" }, { "docid": "4ea5632b8a51a161ff339d9021e5ac65", "score": "0.53530484", "text": "def role_definitions\n return @role_definitions\n end", "title": "" }, { "docid": "699140e250c38f086b53166f541a363b", "score": "0.53512746", "text": "def message_rules\n return @message_rules\n end", "title": "" }, { "docid": "60b5bb11695fe761ed53454b73741e13", "score": "0.53395414", "text": "def rules\n leaves(Rule)\n end", "title": "" }, { "docid": "d1d8f626b6a4e41a6c22fa9034590038", "score": "0.53255755", "text": "def rules\n @rules ||= [].tap do |out|\n yaml = YAML.load_file File.expand_path(\"rules/hunt.yml\", __dir__)\n if yaml.dig(\"meta\", \"enable\")\n yaml.dig(\"rules\").each { |rule| out << rule }\n end\n end\n end", "title": "" }, { "docid": "d29a08a9eba89c3e70db71ca2c373535", "score": "0.53121316", "text": "def list\n response = self.class.get(rules_url, basic_auth: @auth, headers: { 'Content-Type' => 'application/json', 'Accept' => 'application/json' }, type: :json)\n parsed_response = safe_parsed_response(response.parsed_response)\n if parsed_response.present? && parsed_response['error'].present?\n { status: :error, code: response.response.code, error: parsed_response['error']['message'] }\n else\n { status: :success, code: 200, rules: parsed_response['rules'] }\n end\n rescue Exception => e\n { status: :error, code: 500, error: e.message }\n end", "title": "" }, { "docid": "f55ed76661e69558c0745cebeb984af6", "score": "0.53034294", "text": "def policy_role_policies\n @policy_role_policies ||= Array.new.tap do |uris|\n filters = current_ability.agents.map do |agent|\n \"#{Ddr::Index::Fields::POLICY_ROLE}:\\\"#{agent}\\\"\"\n end.join(\" OR \")\n query = \"#{Ddr::Index::Fields::ACTIVE_FEDORA_MODEL}:Collection AND (#{filters})\"\n results = ActiveFedora::SolrService.query(query, rows: Collection.count, fl: Ddr::Index::Fields::ID)\n results.each_with_object(uris) { |r, memo| memo << r[Ddr::Index::Fields::ID] }\n end\n end", "title": "" }, { "docid": "5e0355b1917627084cc57cf13c51c73f", "score": "0.52962124", "text": "def rules\n @rules ||= {}\n end", "title": "" }, { "docid": "d46231b863fd9d28c2c0977c3eb52559", "score": "0.52799153", "text": "def rules\n @rules ||= []\n end", "title": "" }, { "docid": "9648fdfbe51ce47e4440f94d3e6a2da1", "score": "0.5269179", "text": "def rules(set=nil)\n @rules ||= Rule.get_rules(self.target_type, set)\n end", "title": "" }, { "docid": "cd80e933276d0947153407a7a5b385db", "score": "0.52627647", "text": "def rules\n parent_rules.merge(macros.map { |m| [m.name, m.to_rule] }.to_h.compact)\n end", "title": "" }, { "docid": "e29056806aca9219a57097bb91ec5297", "score": "0.5227318", "text": "def rules_datastructure\n cnt = 0\n new_resource.rules.map do |rule|\n cnt += 1\n { 'rule_name' => rule, 'priority' => cnt }\n end\n end", "title": "" }, { "docid": "ad025911551867d07e2d8f87492ce14f", "score": "0.52226776", "text": "def admin_rules\n can :manage, :all\n can :edit_roles, User do\n @user.has_role?(RoleName::ADMIN)\n end\n end", "title": "" }, { "docid": "3077b54809c86c340d0957ddfd41517a", "score": "0.52211076", "text": "def rules_collection\n 'rules-collection'\n end", "title": "" }, { "docid": "10acc26e7868f0cc7c21ec1f950a4f17", "score": "0.5193957", "text": "def getRules(number)\n return @xmlHash.fetch(\"languages\").fetch(@language).fetch(\"rules\").fetch(\"rule\" + number.to_s)\n end", "title": "" }, { "docid": "09ff89e2ded1b5dc81be3aa7ecdb28cc", "score": "0.5184636", "text": "def authorized_application_rules_from_group_policy_merged\n return @authorized_application_rules_from_group_policy_merged\n end", "title": "" }, { "docid": "018a3fd61a1cce5eb15566ba18a678c2", "score": "0.5176416", "text": "def get_network_switch_settings_qos_rules(network_id)\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => network_id\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/switch/settings/qosRules'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => network_id\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "title": "" }, { "docid": "f43d438d6b0c0e95b66a665c3aeeeab4", "score": "0.5160356", "text": "def by_unified_role_management_policy_rule_id(unified_role_management_policy_rule_id)\n raise StandardError, 'unified_role_management_policy_rule_id cannot be null' if unified_role_management_policy_rule_id.nil?\n url_tpl_params = @path_parameters.clone\n url_tpl_params[\"unifiedRoleManagementPolicyRule%2Did\"] = unified_role_management_policy_rule_id\n return MicrosoftGraph::Policies::RoleManagementPolicies::Item::Rules::Item::UnifiedRoleManagementPolicyRuleItemRequestBuilder.new(url_tpl_params, @request_adapter)\n end", "title": "" }, { "docid": "4b98a36da9403be64853e3cf01e9972f", "score": "0.5156223", "text": "def list_rulesets(inspector)\n inspector.describe_rules_packages({rules_package_arns: inspector.list_rules_packages({})[0] })[0]\nend", "title": "" }, { "docid": "57010f347e625b1f0be0a941d503a74b", "score": "0.5148299", "text": "def app_management_policies()\n return MicrosoftGraph::ServicePrincipals::Item::AppManagementPolicies::AppManagementPoliciesRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "f31767e3bd7a5188e2e085eb8df155d1", "score": "0.5141232", "text": "def roles_from_policy\n @policy_document[:roles].map { |role, _permissions| role.to_s }\n end", "title": "" }, { "docid": "368d68a6a89337fbacee82e0678c38b9", "score": "0.51387036", "text": "def list_rules(options=nil)\n options = DEFAULT_LIST_RULES_OPTIONS.merge(options || {})\n res = make_rules_request(:get, headers: gzip_compressed_header(options[:compressed]))\n\n # return Rule objects when required and feasible/appropriate\n if options[:objectify] &&\n res.is_a?(Hash) &&\n (rules = res['rules']).is_a?(Array) &&\n rules.all? { |rule| rule.is_a?(Hash) && rule.key?('value') }\n rules.map do |rule|\n PowerTrack::Rule.new(rule['value'], tag: rule['tag'], id: rule['id'])\n end\n else\n res\n end\n end", "title": "" }, { "docid": "08ccbb58beee98041780b3a28fe2d818", "score": "0.5135885", "text": "def permission_grant_policies\n return @permission_grant_policies\n end", "title": "" }, { "docid": "dd9ddf545fe7741eba5c3d85bf897298", "score": "0.5131607", "text": "def existing_rules\n request = Net::HTTP::Get.new URI.join(@base_uri.to_s, \"cloudlets/api/v2/policies/#{@policy_id}/versions/#{@version_id}?omitRules=false&matchRuleFormat=1.0\").to_s\n response = @http_host.request(request)\n response.body\n end", "title": "" }, { "docid": "6534da174225159268ed9057cc591c80", "score": "0.5120389", "text": "def get_ruleset\n result = []\n\n BeEF::Core::Models::Dns::Rule.each do |rule|\n element = {}\n\n element[:id] = rule.id\n element[:pattern] = rule.pattern\n element[:type] = rule.type.to_s.split('::')[-1]\n element[:response] = parse_response(rule.block)\n\n result << element\n end\n\n result\n end", "title": "" }, { "docid": "a931885c32ea185b11a56a435d22a9bf", "score": "0.5105222", "text": "def get_rules\n end", "title": "" }, { "docid": "55c9dc810a88708e8e40a46e0bbaac82", "score": "0.50995135", "text": "def get_config_rules\n @cs_utils.get_config_rules.select do |rule|\n rule.source.source_identifier == 'CLOUD_TRAIL_ENABLED' && rule.source.owner == 'AWS'\n end\n end", "title": "" }, { "docid": "fdb4b7cba533d088c5f36c7e7556ee03", "score": "0.5077553", "text": "def all_rules\n rules = Set[]\n rules << entity_rules.map{|ent| ent.rule}.to_set\n rules << groups.collect(&:entity_rules).flatten.map{|ent| ent.rule}.to_set\n rules.flatten.to_a\n end", "title": "" }, { "docid": "8093b6d5bae528bbc80b3ee143dd15ab", "score": "0.5077326", "text": "def permissions_from_policy\n @policy_document[:roles].map do |_role, permissions|\n permissions\n end.flatten.uniq\n end", "title": "" }, { "docid": "d9957daff6ef121b23210e98b702f3bf", "score": "0.5075361", "text": "def rules_for_mode(mode)\n @rules ||= {}\n @rules[mode] ||= {}\n end", "title": "" }, { "docid": "75fed28d7b1c831f66fde701526f36f2", "score": "0.50722206", "text": "def global_port_rules_from_group_policy_merged\n return @global_port_rules_from_group_policy_merged\n end", "title": "" }, { "docid": "838f4cbfcfa83d030c520278afa06b82", "score": "0.5065422", "text": "def rules\n @rules ||= {}\n end", "title": "" }, { "docid": "79ebad7ba5d6f57d9c27b6da281b41af", "score": "0.5062429", "text": "def get_policy_rules(policy_id, opts = {})\n data, _status_code, _headers = get_policy_rules_with_http_info(policy_id, opts)\n data\n end", "title": "" }, { "docid": "7bf5a4b841f574d158d1b63e2bf79565", "score": "0.50535697", "text": "def get_rules\n internal, external = [], []\n if resource[:rules]\n internal = resource[:rules].sort\n end\n if resource[:file]\n external = get_rules_from_file(resource[:file]).sort \n end\n compose(internal, external)\n end", "title": "" }, { "docid": "fe32b82a5dd370cecd25f0fe62bdc87a", "score": "0.5046948", "text": "def rrule_property\n @rrule_property ||= []\n end", "title": "" }, { "docid": "fe32b82a5dd370cecd25f0fe62bdc87a", "score": "0.5046948", "text": "def rrule_property\n @rrule_property ||= []\n end", "title": "" }, { "docid": "58a83ae0f5ed02eea143ef74594c8e32", "score": "0.50302416", "text": "def rules\n @rules ||= YAML.load_file(File.expand_path('../pricerules_sbb.yml', __FILE__))\n end", "title": "" }, { "docid": "d545ee65f4840f4b2039019ac2f3e2a2", "score": "0.502982", "text": "def rules\n db_rules.map(&method(:wrap))\n end", "title": "" }, { "docid": "7918035bf4755f342df49919a2256f79", "score": "0.5019003", "text": "def get_rights\n # logger.warn(\"Rails-Root is: #{Rails.root}\")\n rights = YAML::load_file(\"#{Rails.root}/config/group_rights.yml\")\n\t\tif not @user_group\n\t\t\treturn nil\n\t\tend\n rights = rights[@user_group]\n if not rights\n return nil\n end\n @right = rights[controller_name]\n if not @right and rights[:all]# there is the possiblity that :all controllers takes the default right, and the above rule overwrites the right\n @right = rights[:all]\n end\n rights\n end", "title": "" }, { "docid": "536813662be37c9134ec1649942bb4ee", "score": "0.5010641", "text": "def roles(admin_policy_id)\n return [] if admin_policy_id.blank?\n\n @role_cache ||= {}\n return @role_cache[admin_policy_id] if @role_cache[admin_policy_id]\n\n # Try to retrieve a Solr doc\n obj_doc = SearchService.query('id:\"' + admin_policy_id + '\"')[\"response\"][\"docs\"].first || {}\n return [] if obj_doc.empty?\n\n apo_roles = Set.new\n # Check additional known roles\n KNOWN_ROLES.each do |role|\n solr_apo_roles = [\"apo_role_#{role}_ssim\", \"apo_role_person_#{role}_ssim\"]\n apo_roles << role if solr_apo_roles.any? { |r| solr_role_allowed?(obj_doc, r) }\n end\n # store and return an array of roles (Set.sort is an Array)\n @role_cache[admin_policy_id] = apo_roles.sort\n end", "title": "" }, { "docid": "e601815c5853685b8c7db6a64332134a", "score": "0.5002439", "text": "def rules\n raise('Implement rules method ')\n end", "title": "" }, { "docid": "f4fadf6bf0776f9dd35fda4a14b48f27", "score": "0.49980804", "text": "def details\n data = Storm::Base::SODServer.remote_call \\\n '/Network/Firewall/Ruleset/details',\n :ruleset => @ruleset\n self.from_hash data\n end", "title": "" }, { "docid": "27668adb5bec257609c72b6d2407abc3", "score": "0.49882144", "text": "def process_rules!\n Halcyon.rules.collect! do |rule|\n {\n :tests => rule['tests'],\n :permissions => (rule['permissions'] || {})\n }\n end\n end", "title": "" }, { "docid": "39d8e23cd966828dbe98f77bd9b821a5", "score": "0.4983337", "text": "def rules( engine )\n MyRhouse::Rules::HouseRuleBook.new( engine ).rules\n end", "title": "" }, { "docid": "e5a8a62c153a5d1ea8578960740bfffe", "score": "0.49828964", "text": "def rules(table)\n return @tables[table][:rules]\n end", "title": "" }, { "docid": "3051eaded44e987499aacf15b0cbd133", "score": "0.49794123", "text": "def get_rule(*p)\n topic_name, subscription_name, rule_name = _rule_args(*p)\n\n result = resource_entry(:rule, topic_name, subscription_name, rule_name)\n result.topic = topic_name\n result.subscription = subscription_name\n result\n end", "title": "" }, { "docid": "b3eed65fbf36e6321bcd361b6dcfbc7e", "score": "0.49737266", "text": "def app_management_policies()\n return MicrosoftGraph::Policies::AppManagementPolicies::AppManagementPoliciesRequestBuilder.new(@path_parameters, @request_adapter)\n end", "title": "" }, { "docid": "698434335700c2d31396a98f46d43ae5", "score": "0.49733922", "text": "def properties\n @rules.map(&:property).uniq\n end", "title": "" }, { "docid": "d1c248aef2176158bcf510b4ce8a0c97", "score": "0.4967539", "text": "def parse_language_rules\n rulz = []\n return rulz unless params[:rules]\n \n Tr8n::Config.language_rule_classes.each do |cls|\n next unless params[:rules][cls.dependency]\n index = 0 \n while params[:rules][cls.dependency][\"#{index}\"]\n rule_params = params[:rules][cls.dependency][\"#{index}\"]\n rule_definition = params[:rules][cls.dependency][\"#{index}\"][:definition]\n \n if rule_params.delete(:reset_values) == \"true\"\n rule_definition = {}\n end\n \n rule_id = rule_params[:id]\n keyword = rule_params[:keyword]\n \n if rule_id.blank?\n rulz << cls.new(:keyword => keyword, :definition => rule_definition)\n else\n rule = cls.find_by_id(rule_id)\n rule = cls.new unless rule\n rule.keyword = keyword\n rule.definition = rule_definition\n rulz << rule\n end\n index += 1\n end\n \n end \n \n rulz\n end", "title": "" }, { "docid": "77cb51f94f5932f765f28cffd6f90a71", "score": "0.49501276", "text": "def list\n response = @client.get('plugins-rules')\n verify response,\n forbidden: 'You do not have permission to view plugin rules list',\n internal_server_error: 'Server failed to create the group'\n end", "title": "" }, { "docid": "0a68360d8925841c1029c40649352ca1", "score": "0.49461243", "text": "def loan_rules\n return LoanRule.find_all_by_LOCATION_PROFILE_ID(self.LOCATION_PROFILE_ID)\n end", "title": "" }, { "docid": "a54cb7de1a8847e7055c450479c06dab", "score": "0.49348944", "text": "def get_promotion_rules(params = {})\n commit(EbayTrading::Requests::GetPromotionRules, params)\n end", "title": "" }, { "docid": "76ad74d90394a937d9134ee1b7e62cec", "score": "0.49258435", "text": "def connection_security_rules_from_group_policy_merged\n return @connection_security_rules_from_group_policy_merged\n end", "title": "" }, { "docid": "9a961c6dca85d779f7c5e3213fe69b47", "score": "0.49237454", "text": "def to_a\n @rules\n end", "title": "" }, { "docid": "1ceb638f1570b87268c306f74395f875", "score": "0.49235225", "text": "def list_rules(opts = {})\n data, _status_code, _headers = list_rules_with_http_info(opts)\n data\n end", "title": "" }, { "docid": "42278e5afb7f1af71029c50698955635", "score": "0.49192697", "text": "def list_rules(options=nil)\n raise NotImplementedError\n end", "title": "" }, { "docid": "634d8e215b88f0d06074212439aeccb5", "score": "0.49179843", "text": "def permissions\n Roles.type_map[role_type.first].permissions\n end", "title": "" }, { "docid": "826a20e8be641469885019ab1c2b8a04", "score": "0.491275", "text": "def get_network_switch_settings_qos_rule(options = {})\r\n # Validate required parameters.\r\n validate_parameters(\r\n 'network_id' => options['network_id'],\r\n 'qos_rule_id' => options['qos_rule_id']\r\n )\r\n # Prepare query url.\r\n _path_url = '/networks/{networkId}/switch/settings/qosRules/{qosRuleId}'\r\n _path_url = APIHelper.append_url_with_template_parameters(\r\n _path_url,\r\n 'networkId' => options['network_id'],\r\n 'qosRuleId' => options['qos_rule_id']\r\n )\r\n _query_builder = Configuration.base_uri.dup\r\n _query_builder << _path_url\r\n _query_url = APIHelper.clean_url _query_builder\r\n # Prepare headers.\r\n _headers = {\r\n 'accept' => 'application/json'\r\n }\r\n # Prepare and execute HttpRequest.\r\n _request = @http_client.get(\r\n _query_url,\r\n headers: _headers\r\n )\r\n CustomHeaderAuth.apply(_request)\r\n _context = execute_request(_request)\r\n validate_response(_context)\r\n # Return appropriate response type.\r\n decoded = APIHelper.json_deserialize(_context.response.raw_body) unless\r\n _context.response.raw_body.nil? ||\r\n _context.response.raw_body.to_s.strip.empty?\r\n decoded\r\n end", "title": "" } ]
e7cbfa300f46d7a8b1906c29c3a7c2a6
Get the value of the specific theme option.
[ { "docid": "38441ae41befc3c348e6c4aad45d5bc1", "score": "0.6815739", "text": "def theme_option(option_name)\n theme_data(parent: true).merge(theme_data)[option_name.to_s]\n end", "title": "" } ]
[ { "docid": "1eeede738a0bf49e9411caaf1e92fca0", "score": "0.6631905", "text": "def value\n options_hash[option_id]\n end", "title": "" }, { "docid": "478646e81dacae21f4cc97dc7ffe6438", "score": "0.6190249", "text": "def value\r\n assert_exists\r\n option_value\r\n end", "title": "" }, { "docid": "26c0b644de02bef8e067b4af68a62f3b", "score": "0.61857444", "text": "def get_theme\n use_theme = Preference.get_setting('CURRENT_THEME')\n (use_theme == '' ? 'default' : use_theme).downcase\n end", "title": "" }, { "docid": "f18f82274d38e67d3335d0e8c29dd826", "score": "0.6144911", "text": "def theme\n return @theme\n end", "title": "" }, { "docid": "5eb2b1aa371c25e6afd4067c3e014925", "score": "0.6139907", "text": "def _get_option(name)\n\n # Start with nothing\n value = nil\n\n # First, get the default value by cycling through the allowed options\n method = self.class.metadata[:allowed_options].each do |allowed_option|\n value = allowed_option[:default] if allowed_option[:name] == name\n end\n\n # Then, cycle through the user-provided options\n @user_options.each do |user_option|\n value = user_option[name] if user_option.key?(name)\n end\n\n value\n end", "title": "" }, { "docid": "ea4cdb5bcfd4ebfede4ec1a7fd7cccc1", "score": "0.6116965", "text": "def theme\n options.fetch(:theme, nil)\n end", "title": "" }, { "docid": "1b5d8c3328a0b97f2505eb998a950ce5", "score": "0.60050607", "text": "def retrieve_option(name)\n if options['user-data']\n retrieve_from_userdata(name, options['user-data-type'], options['user-data-source'])\n else\n options[name] || name\n end\n end", "title": "" }, { "docid": "570bd5ec02699723c4bd783df6435de1", "score": "0.59943473", "text": "def theme\n @theme\n end", "title": "" }, { "docid": "556b7951a99b7d384aafe4d38713fe5f", "score": "0.5993505", "text": "def get_opt(opt)\n @options[opt] || nil\n end", "title": "" }, { "docid": "a676a9cf74c6af4f34e8334749812027", "score": "0.5960642", "text": "def get_theme val\n case action_name\n when 'index'\n val == 1 ? 'b' : 'd'\n when 'sent'\n val == 2 ? 'b' : 'd'\n when 'seller'\n val == 1 ? 'b' : 'd'\n when 'unposted'\n val == 2 ? 'b' : 'd'\n when 'sold'\n val == 3 ? 'b' : 'd'\n when 'received'\n val == 2 ? 'b' : 'd'\n when 'new'\n val == 3 ? 'b' : 'd'\n when 'contact'\n val == 2 ? 'b' : 'd'\n when 'password'\n val == 3 ? 'b' : 'd'\n end\n end", "title": "" }, { "docid": "fa302e8dd4ae5516354b35cff25c194f", "score": "0.5954685", "text": "def option\n return @manager.configurable.class.configuration.options[key]\n end", "title": "" }, { "docid": "846a7fbe0c01d954ad44e581ad6eda40", "score": "0.59120166", "text": "def theme\n @theme || 'plastik'\n end", "title": "" }, { "docid": "d40ea621fe1db55f5765db99e5188bdd", "score": "0.58563685", "text": "def theme\n Design::Theme.array.find_by_name(self.theme_name) || site.theme\n end", "title": "" }, { "docid": "c5a1b973438d8ed0ded196d8c06d4189", "score": "0.5826155", "text": "def theme_name\n \n if params[:action] == \"home\"\n @theme_name = ThemeOption.where(user_id: current_user.id).first.template.downcase\n else\n \"application\"\n end\n end", "title": "" }, { "docid": "461bd5c80481e2eb5ce0337b56e554b4", "score": "0.5779857", "text": "def theme_name\n if params[:action] == \"home\"\n @theme_name = ThemeOption.where(user_id: current_user.id).first.template.downcase\n else\n \"application\"\n end\n end", "title": "" }, { "docid": "850166ff8de6ca443a41aed2ca02a673", "score": "0.57430065", "text": "def getOption(name)\n return @options[name]\n end", "title": "" }, { "docid": "d6557554cb9099b6301a7e8e7d432169", "score": "0.57164735", "text": "def get_option(option, default = (default_not_passed = true; false))\n option = option.strip\n return false if option.blank?\n # Filters the value of an existing option before it is retrieved.\n pre = apply_filters(\"pre_option_#{option}\", false, option, default)\n\n return pre if pre != false\n # return false if defined? WP_SETUP_CONFIG\n passed_default = !default_not_passed\n if true #! wp_installing()\n # prevent non-existent options from triggering multiple queries\n notoptions = Rails.cache.read 'Railspress::' + 'options' + '/' + 'notoptions'\n if !notoptions.blank? && notoptions[option]\n # Filters the default value for an option.\n return apply_filters( \"default_option_#{option}\", default, option, passed_default)\n end\n\n alloptions = wp_load_alloptions\n\n if alloptions[option]\n value = alloptions[option]\n else\n value = Rails.cache.fetch('Railspress::' + 'options' + '/' + option) {\n Railspress::Option.where(option_name: option).pluck(:option_value).first\n }\n if value.nil? # option does not exist, so we must cache its non-existence\n notoptions = {} unless notoptions.kind_of? Hash\n notoptions[ option ] = true\n Rails.cache.write 'Railspress::' + 'options' + '/' + 'notoptions', notoptions\n # This filter is documented in wp-includes/option.php */\n return apply_filters(\"default_option_#{option}\", default, option, passed_default)\n end\n end\n else\n # not implementing this case\n end\n # If home is not set use siteurl.\n if 'home' == option && '' == value\n return get_option('siteurl')\n end\n\n if %w(siteurl home category_base tag_base).include? option\n value = Railspress::FormattingHelper.untrailingslashit(value)\n end\n\n # Filters the value of an existing option.\n apply_filters( \"option_#{option}\", Railspress::Functions.maybe_unserialize(value), option).freeze\n end", "title": "" }, { "docid": "4a15bd1bea6abd8207123b6733d6e52e", "score": "0.57082", "text": "def value(locale=I18n.locale)\n begin\n (self.setting_type =~ /slide/) ? self.slide : eval(\"self.#{self.setting_type}_value\")\n rescue\n nil\n end\n end", "title": "" }, { "docid": "c73bb01734af16afee543efb48f5e0fb", "score": "0.5671188", "text": "def theme_selected?\n user_selections.params['thm']\n end", "title": "" }, { "docid": "5df90d9567bd65b45775dd82044b6fd5", "score": "0.56534016", "text": "def option(opt)\n @options[opt]\n end", "title": "" }, { "docid": "8a318a2e819e675c19f60e923c97f32f", "score": "0.5646983", "text": "def value\n case ALLOWED_SETTINGS[object['key']]\n when :easy\n ::EasySetting.value(object['key'], object['project'].try(:id))\n when :redmine\n if object['key'] == 'date_format'\n ::Setting.date_format.presence || ::I18n.t('date.formats.default')\n else\n ::Setting.send(object['key'])\n end\n when :time_entry\n ::EasyGlobalTimeEntrySetting.value(object['key'], ::User.current.roles)\n else\n raise GraphQL::ExecutionError, \"Unknow setting '#{object['key']}'\"\n end\n end", "title": "" }, { "docid": "bc2a3e37a2b644ae1db41e724570e21c", "score": "0.5625261", "text": "def field_value\n opts = selected_options\n opts.count == 1 ? opts.first.text : opts.map(&:text)\n end", "title": "" }, { "docid": "bc6bdb12db26f55afa6b70ff905ba757", "score": "0.5612645", "text": "def get_theme\n @theme = Broadcaster::Theme.find(params[:theme_id])\n end", "title": "" }, { "docid": "bc6bdb12db26f55afa6b70ff905ba757", "score": "0.5612645", "text": "def get_theme\n @theme = Broadcaster::Theme.find(params[:theme_id])\n end", "title": "" }, { "docid": "bc6bdb12db26f55afa6b70ff905ba757", "score": "0.5612645", "text": "def get_theme\n @theme = Broadcaster::Theme.find(params[:theme_id])\n end", "title": "" }, { "docid": "95f963f3e7d6cb9e7029ee64fccca372", "score": "0.5598617", "text": "def for_user(user)\n if user\n by_id(user.theme_id)\n else\n default\n end\n end", "title": "" }, { "docid": "bfda839ee94e31bb24eaf763b194c29e", "score": "0.55903625", "text": "def get_theme\n @theme = Theme.find(params[:theme_id])\n end", "title": "" }, { "docid": "f412f2fd13b9dc5e4c5a4fe16d5a08f8", "score": "0.558889", "text": "def value_of(option_name)\n return value if option_name == self.name\n return nil unless has_group?\n group.value_of(option_name)\n end", "title": "" }, { "docid": "b2a9e7c23a45b8ddb6e65931e3ade4f0", "score": "0.5585794", "text": "def get_box_theme(id)\n return @themes[id]\n end", "title": "" }, { "docid": "2d939d66009f680289eca3ed06e9f524", "score": "0.5575317", "text": "def get_option(opt, default=nil)\n return @config.pluginconf[opt] if @config.pluginconf.include?(opt)\n return default if default\n\n raise(\"No plugin.#{opt} configuration option given\")\n end", "title": "" }, { "docid": "3beb417a5a3915744bd94e0f49436147", "score": "0.55731076", "text": "def get_option(opt, default=nil)\n return @config.pluginconf[opt] if @config.pluginconf.include?(opt)\n return default if default\n\n raise(\"No plugin.#{opt} configuration option given\")\n end", "title": "" }, { "docid": "fed0673ad9e71b879c37370c9df38309", "score": "0.55611056", "text": "def get_option(opt, default=nil, allow_nil=true)\n return @config.pluginconf[opt] if @config.pluginconf.include?(opt)\n return default if (default or allow_nil)\n raise(\"No plugin.#{opt} configuration option given\")\n end", "title": "" }, { "docid": "fed0673ad9e71b879c37370c9df38309", "score": "0.55611056", "text": "def get_option(opt, default=nil, allow_nil=true)\n return @config.pluginconf[opt] if @config.pluginconf.include?(opt)\n return default if (default or allow_nil)\n raise(\"No plugin.#{opt} configuration option given\")\n end", "title": "" }, { "docid": "4d732a02f3c3d898f98fad95ef1985c2", "score": "0.5556334", "text": "def get_theme\n\t\tif @current_user and @current_user.theme\n\t\t\t@current_theme = @current_user.theme.css_class\n\t\telse\n\t\t\t@current_theme = \"pond\"\n\t\tend\n\tend", "title": "" }, { "docid": "783c12a62f3a6d1c5fe2f474002e2231", "score": "0.55560976", "text": "def name\n theme.name\n end", "title": "" }, { "docid": "85194fec71a04efa15b22822f4427d30", "score": "0.5542979", "text": "def theme=(value)\n @theme = value\n end", "title": "" }, { "docid": "24df470e53f0c815181bca6ddfbe2cfd", "score": "0.5542889", "text": "def current_theme\n account_prefix\n end", "title": "" }, { "docid": "d64d06af81cf373fa97e96f29d19df4b", "score": "0.55396104", "text": "def current_theme(passed_theme = nil)\n theme_name = unless passed_theme .blank?\n passed_theme\n else\n current_blog_user ? current_blog_user.blog_config.theme_name : ''\n end\n Theme.find(theme_name)\n end", "title": "" }, { "docid": "5a9f3a103df1bb689ef269eb231b906f", "score": "0.548736", "text": "def get_preset\n pricingoptions.find_by(:preset => true) || pricingoptions.first\n end", "title": "" }, { "docid": "63aecffbf46fd8b37f8f3b1826022727", "score": "0.5456937", "text": "def option_value(opt_name)\n val = option(opt_name)\n val = (val.is_a?(String) and val.strip == '') ? nil : val\n return val\n end", "title": "" }, { "docid": "95cbcae2d0457623b9c200a177424b56", "score": "0.54492253", "text": "def GetXendOption(option_key)\n Ops.get(@SETTINGS, option_key, Ops.get(@DEFAULT_CONFIG, option_key, \"\"))\n end", "title": "" }, { "docid": "662ded0bf17edb63c9a52d62764d2b6d", "score": "0.5437648", "text": "def value\n $browser.element(@selector).div(xpath: \"./../div[@class='custom-select-display']\").text\n end", "title": "" }, { "docid": "78d29aa5e68e4aee5072cddbb76196a4", "score": "0.54290277", "text": "def value()\n $tracer.trace(\"\\tAction: #{format_method(__method__)}\")\n @tag.option.selected(true).innerText.strip\n end", "title": "" }, { "docid": "78d29aa5e68e4aee5072cddbb76196a4", "score": "0.54290277", "text": "def value()\n $tracer.trace(\"\\tAction: #{format_method(__method__)}\")\n @tag.option.selected(true).innerText.strip\n end", "title": "" }, { "docid": "78d29aa5e68e4aee5072cddbb76196a4", "score": "0.54290277", "text": "def value()\n $tracer.trace(\"\\tAction: #{format_method(__method__)}\")\n @tag.option.selected(true).innerText.strip\n end", "title": "" }, { "docid": "78d29aa5e68e4aee5072cddbb76196a4", "score": "0.54290277", "text": "def value()\n $tracer.trace(\"\\tAction: #{format_method(__method__)}\")\n @tag.option.selected(true).innerText.strip\n end", "title": "" }, { "docid": "2607b84dd4721b6d26931c02aa96369a", "score": "0.5416757", "text": "def object_value_of_selected_item\n if @options_menu.nil?\n return nil\n end\n\n @options[@options_menu.selection]\n end", "title": "" }, { "docid": "ab286dabbc49279c971cff63dde3618d", "score": "0.5399432", "text": "def get(key)\n settings.find_by_key(key).try(:value)\n end", "title": "" }, { "docid": "256c6f170eedf3a6ae92969746b609f1", "score": "0.53902453", "text": "def theme_settings\n (settings_data ? settings_data['general'].presence : nil) || {}\n end", "title": "" }, { "docid": "f0122bcde14d9db32e61c39ce49d9fc5", "score": "0.53843915", "text": "def get_value(size)\n return size if size.is_a?(Numeric)\n return get_setting_default_value(size) if size_is_a_section_setting?(size)\n end", "title": "" }, { "docid": "74a1f0fd45561a2a7e933ecc4d2dd2a5", "score": "0.53465545", "text": "def get_option(key = nil, default = nil, meta_key = \"_default\")\n values = cama_options(meta_key)\n key = key.to_sym\n values.has_key?(key) && values[key] != \"\" ? values[key] : default\n end", "title": "" }, { "docid": "bbf590f4e0df916afaeab4e0b67f822a", "score": "0.5344527", "text": "def theme\n @theme ||= resource.cache.theme(theme_id)\n end", "title": "" }, { "docid": "4ebbd56047ed1cfc5af5e2d2216f4165", "score": "0.5340458", "text": "def opt(key)\n\n @conf.each do |type|\n\n container = (type == 'options' ? @options : workitem.send(type))\n k = type == 'fields' ? \"#{@field_prefix}#{key}\" : key\n\n return container[k] if container.has_key?(k)\n end\n\n nil\n end", "title": "" }, { "docid": "c16d8a80a0b3a5eb0aba9095336c5a4e", "score": "0.53164107", "text": "def first_option_value\n self.option_values.where(option_type_id: self.product.first_option_type.try(:id)).order(position: :asc).first\n end", "title": "" }, { "docid": "ad601eae4f0a5f610e027e4e106c4038", "score": "0.5314487", "text": "def get_option_value(name=nil)\n if name.class == String && !block_given?\n return ::Vertx::Util::Utils.from_object(@j_del.java_method(:getOptionValue, [Java::java.lang.String.java_class]).call(name))\n end\n raise ArgumentError, \"Invalid arguments when calling get_option_value(name)\"\n end", "title": "" }, { "docid": "9cf996078ef90b2a2907fa277e57de9d", "score": "0.5310365", "text": "def get_option(hash, key)\n hash[key.to_sym] || hash[key] || nil\n end", "title": "" }, { "docid": "3f451e8e5334ab04eea784c18434feb7", "score": "0.5304124", "text": "def get_value(flag)\n\t\tfp = @flag_pairs.get_value(flag)\n\t\tif !@no_vals.include?(flag)\n\t\t\tif @args.has_key?(flag)\n\t\t\t\treturn @args[flag]\n\t\t\telsif @args.has_key?(fp) && fp != nil\n\t\t\t\treturn @args[fp]\n\t\t\telse\n\t\t\t\treturn nil\n\t\t\tend\n\t\telse\n\t\t\treturn nil\n\t\tend\n\tend", "title": "" }, { "docid": "7e31b80db7b818911b3f3f1d5df53e15", "score": "0.5302123", "text": "def theme\n {\n variant: {\n name: cookies[:themeVariantName],\n hue: cookies[:themeVariantHue]\n },\n mode: cookies[:themeMode] || \"light\"\n }\n end", "title": "" }, { "docid": "8b8a9cf15be9e35136bbb990341ff669", "score": "0.52790797", "text": "def get(name, default = nil)\n\t\t\t\tname = name.to_sym\n\n\t\t\t\tif @options[name][:value] != nil then\n\t\t\t\t\t@options[name][:value]\n\t\t\t\telsif default != nil then\n\t\t\t\t\tdefault\n\t\t\t\telse\n\t\t\t\t\t@options[name][:default]\n\t\t\t\tend\n\t\t\tend", "title": "" }, { "docid": "3b9fd5f89238be2836ea1ac2ec3f9a43", "score": "0.52730834", "text": "def theme_data(options = {})\n if options[:parent]\n ThemesForRails.config.themes_data(parent_theme) || {}\n else\n ThemesForRails.config.themes_data(current_theme) || {}\n end\n end", "title": "" }, { "docid": "a4bb9b8720fd46c175493590c9c8df78", "score": "0.52621496", "text": "def cli_option(key)\n return @cli_options[key]\n end", "title": "" }, { "docid": "4d2561b7a7f2bbac2473d0b5f05f20bb", "score": "0.5260863", "text": "def get_option(opt)\n @optlist.each do |o|\n return o if (opt.is_a?(Symbol) && o.name == opt) || (opt.is_a?(Fixnum) && o.opt == opt)\n end\n nil\n end", "title": "" }, { "docid": "65d11a6dc97d4cb9df8a1d6b9fe85e75", "score": "0.5258369", "text": "def current_theme(passed_theme=nil)\n theme = passed_theme || self.class.read_inheritable_attribute(\"theme\")\n \n @active_theme = case theme\n when Symbol then send(theme)\n when Proc then theme.call(self)\n when String then theme\n end\n end", "title": "" }, { "docid": "46e135ed811131131444a0667ad3fd89", "score": "0.52524835", "text": "def value\n selected&.value\n end", "title": "" }, { "docid": "564ff657aaf98c7220e6416d72e57c72", "score": "0.5249997", "text": "def get_raw_value_for_option(option=nil)\n if option.class == Hash && !block_given?\n return @j_del.java_method(:getRawValueForOption, [Java::IoVertxCoreCli::Option.java_class]).call(Java::IoVertxCoreCli::Option.new(::Vertx::Util::Utils.to_json_object(option)))\n end\n raise ArgumentError, \"Invalid arguments when calling get_raw_value_for_option(option)\"\n end", "title": "" }, { "docid": "7bed69753c1f6789cf1d4e919bcb1efd", "score": "0.52425176", "text": "def setting(name)\n\t\t\tval = config.settings.where(\"name = ?\", name.to_s).first\n\t\t\tif val.nil?\n\t\t\t\tval = config.control_system.zones.joins(:settings).where('settings.name = ?', name.to_s).first\n\t\t\t\tval = val.settings.where(\"name = ?\", name.to_s).first unless val.nil?\n\t\t\t\t\n\t\t\t\tval = config.dependency.settings.where(\"name = ?\", name.to_s).first if val.nil?\n\t\t\tend\n\t\t\t\n\t\t\tif val.present?\n\t\t\t\tcase val.value_type\n\t\t\t\t\twhen 0\n\t\t\t\t\t\treturn val.text_value\n\t\t\t\t\twhen 1\n\t\t\t\t\t\treturn val.integer_value\n\t\t\t\t\twhen 2\n\t\t\t\t\t\treturn val.float_value\n\t\t\t\t\twhen 3\n\t\t\t\t\t\treturn val.datetime_value\n\t\t\t\tend\n\t\t\tend\n\t\t\t\n\t\t\treturn nil\n\t\tend", "title": "" }, { "docid": "091527b7d578300c88da13ba3b23e19e", "score": "0.52340394", "text": "def get_template\n # Filters the name of the current theme.\n apply_filters('template', get_option('template'))\n end", "title": "" }, { "docid": "3c0b87c22c6d080b09c2ccc6a0903c59", "score": "0.5233661", "text": "def fetch(flag)\n o = option(flag)\n if o.nil?\n cleaned_key = clean_key(flag)\n raise UnknownOption.new(\"option not found: '#{cleaned_key}'\", \"#{cleaned_key}\")\n else\n o.value\n end\n end", "title": "" }, { "docid": "5fddd1e25b1326f7f8d00e76e3a34b45", "score": "0.522667", "text": "def setting\n return @setting\n end", "title": "" }, { "docid": "d0b225965d19ee04dd508dcdc6cc0439", "score": "0.52223706", "text": "def get_value(element, label = false, _browser = @browser)\n wait = Selenium::WebDriver::Wait.new(:timeout => 5)\n elem = wait.until { _browser.find_element(:xpath => element) }\n val = nil\n text = nil\n if (label)\n val = elem.find_element(:xpath => \"//option[@selected]\").text\n else\n val = elem.attribute(\"value\")\n text = elem.text\n Log.logger.info(\"Value: #{val} Text: #{text}\")\n end\n return val if text.nil? or text.empty? or (text == val)\n return text\n end", "title": "" }, { "docid": "c2030728eff46f76bc0e740aca2d0807", "score": "0.52141804", "text": "def get_option(options, key, default_value = \"\")\n result = options.has_key?(key) ? options[key] : nil\n result = default_value if result.nil? || result == \"\"\n result \n end", "title": "" }, { "docid": "07553ab4d157b5655486a5a9e0784b94", "score": "0.51975393", "text": "def setting\n resource[:name].split('/', 2).last\n end", "title": "" }, { "docid": "807a9fcde568d3fff19f500e32c09388", "score": "0.51941156", "text": "def by_id(id)\n THEMES.detect { |t| t.id == id } || default\n end", "title": "" }, { "docid": "b1bd79a58a6bb8b56a91c522d91aba48", "score": "0.51897645", "text": "def resolve(option_name)\n return unless (std_option = CFG_OPTIONS[option_name])\n mode = resolved_mode.downcase\n\n return nil if mode == 'legacy'\n\n value = resolve_for_mode(std_option[:name], mode)\n value = value * std_option[:scale] if value && std_option[:scale]\n\n value\n end", "title": "" }, { "docid": "9042b908c938661698538931b8a05811", "score": "0.51813656", "text": "def option_value(option_value_id:)\n version_id = option_value_version_id(option_value_id: option_value_id)\n\n version = PaperTrail::Version.find_by(id: version_id)\n version.try(:reify)\n end", "title": "" }, { "docid": "778d5966c46f794127a35f5c6f0fa848", "score": "0.516781", "text": "def get_opt(option)\n type = @@option_types.fetch(option) \\\n { raise ArgumentError, \"Unknown option: #{option}\" }\n \n value, size = get_opt_pointers type\n \n rc = LibZMQ.zmq_getsockopt @pointer, option, value, size\n ZMQ.error_check true if rc==-1\n \n if type == :string\n value.read_string(size.read_int-1)\n elsif type == :bool\n value.read_int == 1\n else\n value.send :\"read_#{type}\"\n end\n end", "title": "" }, { "docid": "5f1224fb9297ca05735a4f92597b0808", "score": "0.5167785", "text": "def option(name)\n @options[name.to_s]\n end", "title": "" }, { "docid": "4c00bcf9424bba5063de326f9c8ae28e", "score": "0.51589423", "text": "def pref(key)\n if pref = preferences.find_by(key: key)\n pref.value\n else\n Droom.user_default(key)\n end\n end", "title": "" }, { "docid": "d7b9db62d8647694c979a2f749fa2a7c", "score": "0.51506734", "text": "def get_site_setting(site, setting = nil)\n if setting && site_settings(site) && site_settings(site)[setting.to_sym]\n site_settings(site)[setting.to_sym]\n else \n nil\n end\n end", "title": "" }, { "docid": "fa4b540371c056e2a35150edafa311b7", "score": "0.5150444", "text": "def option_group_option_settings\n data.option_group_option_settings\n end", "title": "" }, { "docid": "17e7de69fb93157722aa62bccf94e4f0", "score": "0.51426363", "text": "def value\n get_lxd_config_value(resource[:config])\n end", "title": "" }, { "docid": "8f603927d3b2e8ffbfd613f883734990", "score": "0.5127181", "text": "def current_theme(passed_theme = nil)\n @current_theme ||= get_current_theme(passed_theme)\n end", "title": "" }, { "docid": "7c1c60ce80cad074bfd90bb5c442076d", "score": "0.5121032", "text": "def option_number\n pricing_db_hp_support_option.option_number\n end", "title": "" }, { "docid": "a510849b31c2e12b15b087542e85ce8c", "score": "0.5119101", "text": "def get_option(part, field, english)\n namespace = Module.nesting[1]\n part = part.to_s\n namespace.const_get(\"#{part}Names\").const_get(field).each_pair do |option, name|\n return option if english.to_s.downcase == name.to_s.downcase\n end\n return namespace.const_get(\"#{part}Default\").const_get(field)\n end", "title": "" }, { "docid": "8ffa606eac08d502bd1dc61b1f7186ee", "score": "0.51159555", "text": "def get_option(key)\n o = @grammar.get_locally_defined_option(key)\n if (!(o).nil?)\n return o\n end\n if (!(@parent).nil?)\n return @parent.get_option(key)\n end\n return nil # not found\n end", "title": "" }, { "docid": "c11c4bfbb69f55685db282b68a8b6bdf", "score": "0.51137906", "text": "def get_attribute(attribute_name)\n theme_attributes.find_by_attribute_name(attribute_name) ||\n populate_attribute(attribute_name)\n end", "title": "" }, { "docid": "412bc1553a15844f9cd25a9d840ee05c", "score": "0.51072264", "text": "def get_option(option_name)\n\t\toption = nil\n\t\t# Could use ternary conditional expressions here (bool ? true_value : false_value) but chose not to for readability\n\t\tif use_short_option?(option_name)\n\t\t\tdebug_log \"Short version has been flagged for option: #{option}\"\n\t\t\tcase option_name\n\t\t\twhen 'badge'\n\t\t\t\toption = \"-b\"\n\t\t\telse\n\t\t\t\traise \"Option not supported: #{option_name}\"\n\t\t\tend\n\t\telse\n\t\t\tdebug_log \"Short version not flagged for option: #{option}. Using long version.\"\n\t\t\tcase option_name\n\t\t\twhen 'badge'\n\t\t\t\toption = \"--badge\"\n\t\t\telse\n\t\t\t\traise \"Option not supported: #{option_name}\"\n\t\t\tend\n\t\tend\n\n\t\treturn option\n\n\tend", "title": "" }, { "docid": "b4591931810eadec793ec9cb63c02d6d", "score": "0.51026917", "text": "def get_value(render_context)\n return render_context.get_variable_value(@variable_name)\n end", "title": "" }, { "docid": "781045a1bd7fc8f992e234530bb11dd5", "score": "0.5095388", "text": "def find_theme\n @theme = Theme.find(params[:theme_id])\n end", "title": "" }, { "docid": "f46996da6fc98c1642bd5d82b669553a", "score": "0.509117", "text": "def get_value(key, default_value, user = nil)\n settings, fetch_time = _get_settings()\n if settings.nil?\n message = \"Config JSON is not present when evaluating setting '#{key}'. Returning the `default_value` parameter that you specified in your application: '#{default_value}'.\"\n @log.error(1000, message)\n @hooks.invoke_on_flag_evaluated(EvaluationDetails.from_error(key, default_value, error: message))\n return default_value\n end\n details = _evaluate(key, user, default_value, nil, settings, fetch_time)\n return details.value\n end", "title": "" }, { "docid": "b1418f84f9b0b52ab5d0f8e0309e46f9", "score": "0.5089657", "text": "def get_settings\n settings.get\n end", "title": "" }, { "docid": "027703ad33c5ea1746112507abefe1eb", "score": "0.5084799", "text": "def option(key)\n option_set[key]\n end", "title": "" }, { "docid": "65b37e35250b917c5af10b2e9b97de41", "score": "0.5079056", "text": "def value(op)\n raise \"Option '#{op}' not accepted\" if !accepts? op\n raise \"Option '#{op}' not specified\" if !has? op\n return @options[op].value\n end", "title": "" }, { "docid": "9a55ee456f8a9451e01214ae68a85e30", "score": "0.5058516", "text": "def theme_path\n File.join(themes_path, theme)\n end", "title": "" }, { "docid": "6e64a5abf98afee64be486a9b057a958", "score": "0.50545985", "text": "def setting_name\n return @setting_name\n end", "title": "" }, { "docid": "84f05eae5b284253f584a06681e7da51", "score": "0.50496256", "text": "def options_for(field)\n @options[field]\n end", "title": "" }, { "docid": "1a59dfdcf011446d314314ed0f8a00de", "score": "0.5044842", "text": "def get_theme_mods\n theme_slug = get_option( 'stylesheet' )\n mods = get_option( \"theme_mods_#{theme_slug}\" )\n if mods\n theme_name = get_option( 'current_theme' )\n unless theme_name\n theme_name = wp_get_theme.get( 'Name' )\n end\n # mods = get_option( \"mods_#{theme_name}\" ) # Deprecated location.\n # if is_admin() && false != mods\n # update_option( \"theme_mods_#{theme_slug}\", mods )\n # delete_option( \"mods_#{theme_name}\" )\n # end\n else\n mods = {}\n end\n mods\n end", "title": "" }, { "docid": "1e055b3c672804b07f04824be040b804", "score": "0.50398797", "text": "def setting_value(setting_name)\n if Setting.exists?(name: setting_name)\n setting = Setting.find_by(name: setting_name)\n setting.value.empty? ? default_setting_value(setting_name) : setting.value\n else\n default_setting_value(setting_name)\n end\n end", "title": "" }, { "docid": "6adeaa35580a5f00e7d4f9f8e0d48ab0", "score": "0.50367475", "text": "def first_option_value\n option_values.where(option_type_id: product.first_option_type.try(:id)).order(position: :asc).first\n end", "title": "" }, { "docid": "05b26409775d9641937868bfa12e8dd8", "score": "0.503445", "text": "def theme_name\n if request.subdomain != \"www\" && request.subdomain.present?\n @subdomain = request.subdomain\n @site = Site.where(subdomain: request.subdomain).first\n @user = User.where(id: @site.user_id).first\n @theme_name = ThemeOption.where(site_id: @site.id).first.template\n @theme = ThemeName.where(id: @theme_name).first.name.downcase\n if params[:action] == \"home\"\n @theme\n elsif params[:action] == \"leasing\"\n @theme + \"leasing\"\n end\n else\n \"test\"\n end\n end", "title": "" } ]
35c29c7d000ac3eca806e01c43388328
Truncate the account name on Accound cards if too long
[ { "docid": "779ef8713d3d3ec11cec044271b5d045", "score": "0.8246614", "text": "def account_card_title\n name_too_long ? name[0..Account::DISPLAY_NAME_LIMIT] + '...' : name\n end", "title": "" } ]
[ { "docid": "c3789ec582c3c74cd57023dca4f70c69", "score": "0.73994225", "text": "def name_too_long\n name.length > Account::DISPLAY_NAME_LIMIT\n end", "title": "" }, { "docid": "dad69cfd3d8d1b1b841e2b8790c38edf", "score": "0.6836745", "text": "def display_user_link\n name.truncate(17)\n end", "title": "" }, { "docid": "4955b64e5195351755707c2d6c516f42", "score": "0.6758635", "text": "def short_name\n name.size > 35 ? \"#{name[0..35]}...\" : name\n end", "title": "" }, { "docid": "5af6e1ec242a205501f1b91934ff8902", "score": "0.67160434", "text": "def full_name_24_length\n full = \"#{self.name} #{self.last_name}\"\n full[0,24]\n end", "title": "" }, { "docid": "ef872d16c42699bed77f635dca10d932", "score": "0.6702693", "text": "def account_name\n last_four.present? ? name + ' ( ... ' + last_four.to_s + ')' : name\n end", "title": "" }, { "docid": "0c9ad3005301f32a1a27559b9d7e5840", "score": "0.66397846", "text": "def profile_name(screenname)\n unless screenname==nil\n if screenname.size > 15 || screenname.size == 15 \n return screenname.slice(0,11)+\"...\"\n else\n return screenname.titlecase\n end\n end\nend", "title": "" }, { "docid": "bf24a3985ab2618aca78300eb11077d3", "score": "0.6624804", "text": "def full_name_length(length)\n \n full = \"#{self.name} #{self.last_name}\"\n \n if full.length <= length.to_i\n full\n else\n full[0,length.to_i]+\"...\"\n end\n end", "title": "" }, { "docid": "8b1d5769dc1e1f685c2eb995561735c0", "score": "0.65446234", "text": "def shortened_email\n \"#{email[0..4]}...\"\n end", "title": "" }, { "docid": "ca31b9f437cb7a440bedd0b967b0672f", "score": "0.63099056", "text": "def acct_number\n hidden_length = @acct_number.length - 4\n @acct_number.sub(Regexp.new(\"^.{#{hidden_length}}\"), \"*\" * hidden_length)\n end", "title": "" }, { "docid": "3f9b8e785ad2c50804c53966ab5da334", "score": "0.62843764", "text": "def short_name\n short = name[0..30]\n if name.length > 30\n short += '...'\n end\n short\n end", "title": "" }, { "docid": "2f02e63016037a8a0b6ecb0b4ab75bbc", "score": "0.6281881", "text": "def full_account_number\n if account_number_prefix && !account_number_prefix.empty? && account_number_prefix != '000000'\n \"#{account_number_prefix}-#{account_number}\"\n else\n \"#{account_number}\"\n end\n end", "title": "" }, { "docid": "3954dc46e7f78177a98a85b85e12b1fa", "score": "0.6179419", "text": "def trunc_em\n self.name = self.name.truncate 30 if self.name.present?\n self.twitter_handle = self.twitter_handle.truncate 30 if self.twitter_handle.present?\n self.location = self.location.truncate 40 if self.location.present?\n end", "title": "" }, { "docid": "32b0d2d9602076b5037271709a295865", "score": "0.61485904", "text": "def card_first_name\n card_names[0, card_names.length - 1].join(' ') if card_names.present?\n end", "title": "" }, { "docid": "e4a97c0e8f3d61bd564ecbc2e457a515", "score": "0.61468256", "text": "def user_passion(passion)\n unless passion.blank?\n if passion.size > 17 \n return passion.slice(0,15)+\"...\" \nelse\n return passion\n end \nend\nend", "title": "" }, { "docid": "0addc6f0c4ce8195cd50c5b8b9bbfb49", "score": "0.6111225", "text": "def reformat_twofaced_names(card)\n end", "title": "" }, { "docid": "50b7e66a08c93ffa6d89661bcd42b6ef", "score": "0.60958433", "text": "def name_truncated\n if self.lastname.present?\n return \"#{self.firstname} #{self.lastname[0]}\"\n else\n return self.firstname\n end\n end", "title": "" }, { "docid": "36f2bd9a370d11382c16088bde69d432", "score": "0.6082228", "text": "def ux_teacher_name( teacher, num_chars=20)\n num_chars > 0 ? teacher.full_name.truncate( num_chars) : teacher.full_name\n end", "title": "" }, { "docid": "17b8feabee3752f88b39b4e118eb1d77", "score": "0.60585403", "text": "def format_artist_name(artist_name)\n if(artist_name.length > 52)\n return artist_name[0 .. 48] + \"...\"\n else\n return artist_name\n end\n end", "title": "" }, { "docid": "41ad74676bcf7808a6bcb0b7dade161e", "score": "0.60331154", "text": "def username_format\n return if self.username.nil?\n self.username.gsub!(/[^0-9a-z\\- ]/i, '_')\n self.username.gsub!(/\\s+/, '-')\n self.username = self.username.downcase\n self.username = self.username.byteslice(0, 24) #substring 24\n end", "title": "" }, { "docid": "1f973ca38e2ccf2427a9215f3fcdd9de", "score": "0.5870398", "text": "def truncate!\n self.name = name[LENGTH_RANGE] if name && name.size > MAX_LENGTH\n self.scope = scope[LENGTH_RANGE] if scope && scope.size > MAX_LENGTH\n end", "title": "" }, { "docid": "13772f8940ef46b9b5567a5492daaf16", "score": "0.5857331", "text": "def full_name\n full_name = object.first_name + \" \" + object.last_name\n if object.profile.try(:search_engine_privacy).present?\n display_name = object.profile.try(:search_engine_privacy) == \"Show my full name\" ? full_name : object.first_name + \" \" + object.last_name.chr\n else\n display_name = full_name\n end\n return display_name \n end", "title": "" }, { "docid": "28a3af04ce52e709eef2cb5a30f009f2", "score": "0.5837009", "text": "def get_trunc_name name\n name[0..3].downcase\n end", "title": "" }, { "docid": "dfe60f76ca23d8014ad67f88ace71c91", "score": "0.5833081", "text": "def truncate_name(name, options={})\n options = {:length => NAME_MAX_LENGTH, :separator => ' '}.merge options\n h truncate(name, options)\n end", "title": "" }, { "docid": "65ea1b1328dfa11c90bd9622e65ab427", "score": "0.5830794", "text": "def short_name \r\n name.gsub(/([A-Z])[^A-Z]+/, '\\1')\r\n end", "title": "" }, { "docid": "36683d016c527e041649d9167f36a094", "score": "0.58184284", "text": "def spacer\n name.length > 15 ? '' : ' '*(15-name.length+1)\n end", "title": "" }, { "docid": "42176a8a0cccfa906ece120246d8c5e6", "score": "0.5788599", "text": "def capitalize(x)\n if x.length > 10\n return x.upcase\n end\nend", "title": "" }, { "docid": "987b02b0a177f615f6eb8c445fc88de8", "score": "0.5785346", "text": "def shortened_title\n if title.size < 120\n return title\n else\n return \"#{title.slice(0,120)}...\"\n end\n end", "title": "" }, { "docid": "9b60e36c73c6544ef947ec6d4d23fbe4", "score": "0.57571626", "text": "def check_name_length\n unless self.name.length >= 4\n errors[:name] << \"Name is too short, must be 4+ characters\"\n end\n end", "title": "" }, { "docid": "d557702033b49158ac7440d92cf90c88", "score": "0.574561", "text": "def short_bill_title(bill)\n truncate(bill['title'].gsub(/\\A\"|\"\\z/, ''), length: 95) # an unclosed quotation looks funny, so remove it\n end", "title": "" }, { "docid": "7933fac747283c099037a57fc55c2c1a", "score": "0.57260877", "text": "def get_full_name\n # [Steve, 20140725] Too long/repetitive: \"#{description} #{header_year} - #{get_federation_type}\"\n description\n end", "title": "" }, { "docid": "2471a450adb51fe08b5950d8adbf903d", "score": "0.57237583", "text": "def full_name\n \"#{first_name} #{last_name}\".strip.squeeze(' ').titleize\n end", "title": "" }, { "docid": "2c71a3f10d01682823d01f6369f31b26", "score": "0.5708546", "text": "def account_name_balance\n name + ' (' + current_balance_display + ')'\n end", "title": "" }, { "docid": "ebc7bcfa510ef8a72e1842da82e442de", "score": "0.56898665", "text": "def smart_name\n return '' if short_name.blank? && long_name.blank?\n\n (short_name.blank? ? long_name.strip : short_name.strip)\n end", "title": "" }, { "docid": "62658fc6fefe8df4e14fbdaab630a8a0", "score": "0.5679403", "text": "def shortened_tweet_truncator(tweet_string)\n if tweet_string.length > 140\n tweet_string[0..136] + \"...\"\n else\n tweet_string\n end\nend", "title": "" }, { "docid": "c91ff6d5928f2f75177bc57b42e22c92", "score": "0.56662744", "text": "def capitalize(string)\n string.upcase if string.length > 10\nend", "title": "" }, { "docid": "859d2653045ff2149e1d7cbefad49192", "score": "0.56626457", "text": "def shorten(text, chars=20)\n text.length > chars ? \"#{text[0..chars-3]}...\" : text\n end", "title": "" }, { "docid": "1167fdb002dc521debf4dea394e05a58", "score": "0.56612873", "text": "def card_last_name\n card_names[-1] if card_names.present?\n end", "title": "" }, { "docid": "651231b96b91de35c630b4ddfa8001f3", "score": "0.56531364", "text": "def account_name\n return company.company_name unless company.nil? || company.company_name.nil?\n\n [forename, surname].join(' ')\n end", "title": "" }, { "docid": "0b3efb82dd18bd18734e5c5e4d300bf0", "score": "0.5649255", "text": "def full_name\n full_name = first_name\n full_name += ' ' + middle_name if middle_name\n full_name += ' ' + last_name\n end", "title": "" }, { "docid": "0bdcd13a78b276441d84e60a960c3c26", "score": "0.5647196", "text": "def clear_personal_information\n number = String.new(self.cc_number)\n # How many spaces to replace with X's\n spaces_to_pad = number.length-4\n # Cut string\n new_number = number[spaces_to_pad,number.length]\n # Pad with X's\n new_number = new_number.rjust(spaces_to_pad, 'X')\n self.cc_number = new_number\n self.save\n # Return number in case we need it\n return new_number\n end", "title": "" }, { "docid": "10733f22696aedbc3eb0b6e3017ddbf8", "score": "0.56391484", "text": "def long_string\n \"#{name}\"\n end", "title": "" }, { "docid": "572df409c9a85175dcb3ad5cd1c6e5cb", "score": "0.562939", "text": "def full_name\n \"#{username}/#{name}\"\n end", "title": "" }, { "docid": "979ed28111a42878b06ffdbc7603fbac", "score": "0.56246173", "text": "def short_name\r\n return \"#{first_name[0].chr}. #{last_name}\"\r\n end", "title": "" }, { "docid": "ded0aec7195ae44aaf0b9cb5a2a9815d", "score": "0.5611498", "text": "def full_name\n if self.profile.present?\n \"#{self.profile.first_name.capitalize} #{self.profile.last_name.capitalize}\"\n else\n \"#{username.capitalize}\"\n end\n end", "title": "" }, { "docid": "5c99f797d1dfaaf90c3b1901ba997f6e", "score": "0.5601322", "text": "def cleanup_surname(name)\n if name.length > 4\n name.gsub!(/^Mc(\\w+)/) { |s| \"Mc#{$1.capitalize}\" }\n name.gsub!(/^Mac(\\w+)/) { |s| \"Mac#{$1.capitalize}\" }\n name.gsub!(/^Mac(\\w+)/) { |s| \"Mac#{$1.capitalize}\" }\n name.gsub!(/^Osh(\\w+)/) { |s| \"O'sh#{$1}\" }\n name.gsub!(/^Van(\\w+)/) { |s| \"Van#{$1.capitalize}\" }\n name.gsub!(/^Von(\\w+)/) { |s| \"Von#{$1.capitalize}\" } \n# name.gsub!(/^Dev(\\w+)/) { |s| \"DeV#{$1}\" } \n end\n name\n end", "title": "" }, { "docid": "a3da3b42fe249ff17f28d1a4ac796f25", "score": "0.5589365", "text": "def short_classroom(length = 25)\n ::Util.truncate(self.classroom, :length => length)\n end", "title": "" }, { "docid": "ed61c5176ab8a520f17fc7044615c1b2", "score": "0.5584024", "text": "def full_name\n \"#{first_name.strip} #{last_name.strip}\"\n end", "title": "" }, { "docid": "79136d439a3404653a6d52c74b0bbb9f", "score": "0.5579262", "text": "def full_name\n \t\t\"#{nombre} #{apellido}\"\n\tend", "title": "" }, { "docid": "fc96940d6ac18ff228e3081242531286", "score": "0.5568516", "text": "def truncate(length = 30)\n return self if self.length < length\n self[0..length].gsub(/\\s\\w+\\s*$/, '...')\n end", "title": "" }, { "docid": "e4892529fb43577615e6907861528903", "score": "0.5558532", "text": "def full_name\n \"#{first_name} #{last_name}\".strip\n end", "title": "" }, { "docid": "e4892529fb43577615e6907861528903", "score": "0.5558532", "text": "def full_name\n \"#{first_name} #{last_name}\".strip\n end", "title": "" }, { "docid": "e4892529fb43577615e6907861528903", "score": "0.5558532", "text": "def full_name\n \"#{first_name} #{last_name}\".strip\n end", "title": "" }, { "docid": "e4892529fb43577615e6907861528903", "score": "0.5558532", "text": "def full_name\n \"#{first_name} #{last_name}\".strip\n end", "title": "" }, { "docid": "48a6f2307799f2e2e04c1c1cf8f6d6d7", "score": "0.5548447", "text": "def shorten(length, suffix=\"&#8230;\")\n if self.length > length-1\n self.slice(0..length-1) + suffix\n else\n self\n end\n end", "title": "" }, { "docid": "a70b7666c5f325cbff88d75c1c25787b", "score": "0.5547007", "text": "def owner_full_name\n \"#{self.owner_first_name} #{self.owner_last_name}\".strip\n end", "title": "" }, { "docid": "2e4923c4a357f9edc72135ac5658125b", "score": "0.55414516", "text": "def full_name\n # clean_name\n \"#{@first_name} #{@middle_name} #{@last_name}\"\n [first_name, middle_name, last_name].compact.join(' ')\n end", "title": "" }, { "docid": "6fbf260c60a8f5eb1efe78fd284f3ee0", "score": "0.55361056", "text": "def caps_if_string_longer_than_10_chars string\n if string.length > 10\n string.upcase\n else\n string\n end\nend", "title": "" }, { "docid": "b51023d6e4e11bc7b468556dd16b12e2", "score": "0.5534508", "text": "def full_name\n return '' unless profile\n profile.full_name\n end", "title": "" }, { "docid": "107d3626bd81e18f7f20011b16863084", "score": "0.5529761", "text": "def full_name\n if user_data\n \"#{user_data['first_name']&.downcase&.capitalize} #{user_data['last_name']&.downcase&.capitalize}\"\n end\n end", "title": "" }, { "docid": "5254f3134619c427b51641211b2410cf", "score": "0.552353", "text": "def full_name\n \"#{user_profile.first_name} #{user_profile.last_name}\" unless user_profile.blank?\n end", "title": "" }, { "docid": "fee16cc1f679c7b973866cf60ee30032", "score": "0.5521349", "text": "def short_name\n \"#{first_name} #{last_name[0, 1]}\"\n end", "title": "" }, { "docid": "e721494723e4739e9accf8af3ac4d5f2", "score": "0.55185974", "text": "def full_name\n name = `finger $USER 2> /dev/null | grep Login | colrm 1 46`.chomp\n name.empty? ? \"John Doe\" : name.squish\n end", "title": "" }, { "docid": "0af014ca68caf7221afdd99ae7383c50", "score": "0.55145013", "text": "def acct_name\n @name\n end", "title": "" }, { "docid": "bb3ba21c40d4f147999062d6ae3001be", "score": "0.55090415", "text": "def digest_short_name(name)\n Digest::SHA2.hexdigest(name)[0..24]\n end", "title": "" }, { "docid": "ad1e78bcc661cfa522a75667f8ed9d01", "score": "0.550897", "text": "def full_name_format\n valid_full_name = true\n\n if !self.name.nil?\n # Must contains white space\n valid_full_name = false if (/^(.*\\s+.*)+$/i =~ self.name).nil?\n # Must be alpha\n valid_full_name = false if(/^[A-Z]+$/i =~ self.name.remove(' ')).nil?\n else\n valid_full_name = false\n end\n\n if !valid_full_name\n self.errors.add(:name, 'deve ser Completo')\n raise ActiveRecord::Rollback\n end\n end", "title": "" }, { "docid": "13d2c60dd3ecebb627020f9d2a5f90d9", "score": "0.5508755", "text": "def truncated_content\n\t\tid.to_s+\" - \"+content.truncate(50,{omission: '...'})\n end", "title": "" }, { "docid": "ce27ddc8cee4badbab6e05b3812dfa25", "score": "0.55080783", "text": "def formatAuthName(auth)\n str = \"\"\n if auth.at(\"lname\") && auth.at(\"fname\")\n str = auth.at(\"lname\").text.strip + \", \" + auth.at(\"fname\").text.strip\n auth.at(\"mname\") and str += \" \" + auth.at(\"mname\").text.strip\n auth.at(\"suffix\") and str += \", \" + auth.at(\"suffix\").text.strip\n elsif auth.at(\"fname\")\n str = auth.at(\"fname\").text\n elsif auth.at(\"lname\")\n str = auth.at(\"lname\").text\n else\n puts \"Warning: can't figure out author #{auth}\"\n str = auth.text\n end\n return str\nend", "title": "" }, { "docid": "c307876826a70ec8a4eecc73eaadaf56", "score": "0.5505138", "text": "def shortname\n name.downcase.gsub(/[^a-z]/, \"\")\n end", "title": "" }, { "docid": "45fd12eeff9329722311c248366773ad", "score": "0.5499617", "text": "def full_name\n \tif !self.first_name.nil? && !self.last_name.nil?\n\t\t\"#{self.first_name.titleize} #{self.last_name.titleize}\"\n\telsif !self.oauth_user_name.nil?\n\t\tself.oauth_user_name\n\telse\n\tend\n end", "title": "" }, { "docid": "409aa8de6a56dbd7701fa44512005905", "score": "0.54985285", "text": "def full_name\n \"#{firstname} #{lastname}\".strip\n end", "title": "" }, { "docid": "9c577ec35428d4ce472c09dbc261cc30", "score": "0.54863673", "text": "def display_name\n full_name.join(\" \")\n end", "title": "" }, { "docid": "15779e9d6d9e9182ee9835eaf4bd1fa4", "score": "0.54857504", "text": "def fullname\n fullname = DNSSD::Service.fullname @name.gsub(\"\\032\", ' '), @type, @domain\n fullname << '.' unless fullname =~ /\\.$/\n fullname\n end", "title": "" }, { "docid": "dd3076d9c2263b666c3a79bb5623fdbd", "score": "0.5483871", "text": "def full_name\n name = first_name.strip # required\n name << \" #{middle_name.strip}\" if !middle_name.nil?\n name << \" #{last_name.strip}\" # required\n name << \" #{mother_last_name.strip}\" if !mother_last_name.nil?\n\n # capitalize each word and return the capitalized version\n name.split.map(&:capitalize).join(' ')\n end", "title": "" }, { "docid": "e27901d45b85ccdc50cac9f590be4cce", "score": "0.54831886", "text": "def full_name\n\t name = \"\"\n\t name = name + \"#{first_name}\" if !first_name.nil? || !first_name.empty?\n\t name = name + \" #{last_name}\" if !last_name.nil? || !last_name.empty?\n\t\tname.gsub(/^ /,'')\n\tend", "title": "" }, { "docid": "e27901d45b85ccdc50cac9f590be4cce", "score": "0.54831886", "text": "def full_name\n\t name = \"\"\n\t name = name + \"#{first_name}\" if !first_name.nil? || !first_name.empty?\n\t name = name + \" #{last_name}\" if !last_name.nil? || !last_name.empty?\n\t\tname.gsub(/^ /,'')\n\tend", "title": "" }, { "docid": "95a39a43bbdb551c43eee9fafd499ee0", "score": "0.5476212", "text": "def user_full_name\n return object.billing_name if object.billing_name.present?\n \"#{user_firstname} #{user_lastname}\"\n end", "title": "" }, { "docid": "9978cd12577338007fa4bbc1b2eb8257", "score": "0.54713106", "text": "def short_name\n full_name = \"\"\n if name.present?\n full_name = name\n else\n full_name = \"#{self.first_name ? self.first_name.downcase.capitalize : \"\"} #{self.last_name ? \"#{self.last_name.first.upcase}.\" : \"\"}\"\n end\n\n full_name\n end", "title": "" }, { "docid": "40fa28437f1e002a32d1a91f9ee027c1", "score": "0.54663074", "text": "def trim_length\n \t400\n end", "title": "" }, { "docid": "53ce6f5514c827405eb6f43cfec56fde", "score": "0.546292", "text": "def full_name\n \"#{firstname} #{lastname}\".strip\n end", "title": "" }, { "docid": "c9ddc6307f32be468b3c645e67cba1bc", "score": "0.54620796", "text": "def fiat_account_description\n \"BANK OF AMERICA, N.A. ****4655\"\n end", "title": "" }, { "docid": "81b9af7f035b6f944764c4c3e461fe5b", "score": "0.5461638", "text": "def truncated_content\n\t\t\tid.to_s+\" - \"+content.truncate(50,{omission: '...'})\n\t end", "title": "" }, { "docid": "3509c35b17d17664d5724fac5619a1de", "score": "0.54613554", "text": "def full_name\n \tnombre + \" \" + apellidos\n end", "title": "" }, { "docid": "8b64640adc4878ed059d9c1904c9e5f1", "score": "0.5460288", "text": "def full_name\n full_name = \"#{first_name} #{last_name}\"\n end", "title": "" }, { "docid": "dc7c25f6d9ee2350fd6034e7add58c31", "score": "0.5452349", "text": "def woolong(argu)\n if argu.length.to_i > 10\n argu.upcase!\n else\n argu\n end\nend", "title": "" }, { "docid": "0ea1f6de04d953da6564a0e231247a6f", "score": "0.5452191", "text": "def shorten(length, suffix=\"&#8230;\")\n\t\tif self.length > length-1\n\t\t\tself.slice(0..length-1) + suffix\n\t\telse\n\t\t\tself\n\t\tend\n\tend", "title": "" }, { "docid": "12f89dc1bf3074ff099009ba8f0d1532", "score": "0.54486847", "text": "def full_name\n \"#{nombre} #{apellidos}\"\n end", "title": "" }, { "docid": "9490e93029877b05669dc7be50d32c62", "score": "0.5447477", "text": "def full_name(entry)\n \"#{entry.first_name} #{entry.last_name}\"\n end", "title": "" }, { "docid": "fbb30c913d9bf63295ea1ff866a08572", "score": "0.54348767", "text": "def show_name\n \tif first_name\n \t\t\"#{first_name}\".strip.squeeze(\" \")\n \telse\n \t\temail\n \tend\n end", "title": "" }, { "docid": "4ab91871896cbe51d64f38035ae0acea", "score": "0.54315174", "text": "def full_name\n \"#{ owner }/#{ name }\" if owner && name\n end", "title": "" }, { "docid": "dd50030c8f3f3057daafb53096e1fe8d", "score": "0.5421176", "text": "def alpha_char\n self.last_name[0..0].downcase\n end", "title": "" }, { "docid": "1958827270ca4ecb98c05b54af47150e", "score": "0.54165715", "text": "def full_name\n self.name ? \"#{self.name.split(' ')[0..-2].join(' ')}, #{self.name.split(' ')[-1]}\" : ''\n end", "title": "" }, { "docid": "8252ff03aa3947cec4cdaf7e1757a9a0", "score": "0.54156506", "text": "def tweetable_title\n title.size > 119 ? title[0,116] + \"...\" : title\n end", "title": "" }, { "docid": "b306060514eb3a64220f192fe002be09", "score": "0.54123396", "text": "def capitalize(string)\n if string.length > 10\n string.upcase\n else\n string\n end\nend", "title": "" }, { "docid": "1ce10fca18077f84e1c9937917422eeb", "score": "0.541116", "text": "def full_name(tenant)\n if tenant.nickname.empty? == false\n puts \"#{tenant.f_name} '#{tenant.nickname}' #{tenant.l_name}\"\n elsif tenant.nickname.empty? == true\n puts \"#{tenant.f_name} #{tenant.l_name}\"\n end\nend", "title": "" }, { "docid": "0252a87f5d427ac868ee99f6ad616b99", "score": "0.54100615", "text": "def up_string(str)\n puts str.upcase if str.length > 10 \nend", "title": "" }, { "docid": "9926ab96137e6b424114f28b56f30c89", "score": "0.5409009", "text": "def appellant_fullname_readable\n appellant_name&.titleize\n end", "title": "" }, { "docid": "c65e96170bd6c3cfa4514786cfa57e60", "score": "0.5406889", "text": "def short_name(how_short = 55)\n\t\tstr = self.name\n\t\tshortname = (str.length > how_short) ? (str[0..how_short] + \"...\") : str\n\t\treturn shortname\n\tend", "title": "" }, { "docid": "4e0d1bf2ccb9f6f9717e058d231960f9", "score": "0.5405755", "text": "def formatAuthName(auth)\n str = \"\"\n fname, lname = auth.text_at(\"./fname\"), auth.text_at(\"./lname\")\n if lname && fname\n str = \"#{lname}, #{fname}\"\n mname, suffix = auth.text_at(\"./mname\"), auth.text_at(\"./suffix\")\n mname and str += \" #{mname}\"\n suffix and str += \", #{suffix}\"\n elsif fname\n str = fname\n elsif lname\n str = lname\n elsif auth.text_at(\"./email\") # special case\n str = auth.text_at(\"./email\")\n else\n str = auth.text.strip\n str.empty? and return nil # ignore all-empty author\n puts \"Warning: can't figure out author #{auth}\"\n end\n return str\nend", "title": "" }, { "docid": "c3fe58581b46aad3ad4f6a1b041dee91", "score": "0.5402986", "text": "def entire_full_name\r\n mi.blank? ? \"#{first_name} #{last_name}\" : \"#{first_name} #{mi} #{last_name}\"\r\n end", "title": "" }, { "docid": "48ab47336624d6d02a9a1debfcc5c211", "score": "0.5397794", "text": "def long_cap(word)\n\tif word.length > 10\n\t\tputs \"Ah... this word is worthy, I'll shout it out:#{word.upcase}!!!!!\"\n\telse\n\t\tputs \"Too shor! It wouldn't be worth it to put that word in all caps. This is hard work you know.\"\n\tend\nend", "title": "" } ]